> This repository contains the design standard for the products of [DEMV Systems](https://demv-systems.de).
> This repository contains the design standard for the products of DEMV Systems.
1. Install the package:
```
yarn add @demvsystems/design-components
The DS needs Tailwind CSS to function properly. See their docs on how to install it.
2. Register the DS in you tailwind.config.js
`js`
module.exports = {
plugins: [
// load the design system tailwind plugin
require('@demvsystems/design-components').tailwindPlugin,
],
content: [
// ...
// the DS ships without any tailwind css,
// so you have to reference the components location here
'./node_modules/@demvsystems/design-components/dist/design-components.mjs',
],
};
3. Import the css for our font into your main css file.
`css`
@import url(https://d33aibdhl8v9sf.cloudfront.net/inter.css);
4. Since we're using Font Awesome for the icons,
you have to follow these steps to integrate the FA library:
1. Add this to you .npmrc file (create it in your project root if it doesn't exist):
`env
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${NPM_FONTAWESOME_AUTH_TOKEN}
@tiptap-pro:registry=https://registry.tiptap.dev/
//registry.tiptap.dev/:_authToken=${NPM_TIPTAP_PRO_AUTH_TOKEN}
`FONT_AWESOME_NPM_TOKEN
> [!NOTE]
> The and NPM_TIPTAP_PRO_AUTH_TOKEN are secrets that you have to get from Bitwarden.
2. Install these fontawesome packages
` `
yarn add @fortawesome/fontawesome-svg-core @fortawesome/vue-fontawesome@latest-3 @fortawesome/pro-solid-svg-icons @fortawesome/pro-regular-svg-icons @fortawesome/pro-light-svg-icons @fortawesome/pro-duotone-svg-icons
`
3. Add icons that you use to you project like so:
> [!NOTE]
> All icons needed for the design-system are automatically bundled when you import them.
ts`
// example path: /assets/Icons/icons.ts
import { library } from '@fortawesome/fontawesome-svg-core';
// Solid
import {
faCircleNotch as fasCircleNotch,
} from '@fortawesome/pro-solid-svg-icons';
// Regular
import {
faSync as farSync,
} from '@fortawesome/pro-regular-svg-icons';
library.add(
fasCircleNotch,
farSync,
);
app.ts
4. Include your icon configuration in your main setup file (, main.ts. ...), e.g.`
ts`
...
import '@/assets/Icons/icons';
...
Contributions should be done in form of a pull request
that is approved by at least one other programmer.
Commit messages must follow the
Conventional Commits specification.
Releases are triggered automatically on merge to main by
semantic-release.
Therefore, it is necessary that the PR merge commit has a semantic commit message.
> [!IMPORTANT]
> Breaking changes should always be communicated by adding BREAKING CHANGE: in the commit footer (See the
> Conventional Commits specification).
> This automatically results in a major version change, which indicates a breaking change.
> [!WARNING]
> Not all semantic commit messages trigger a release. See the
> semantic-release readme
> for more information.
You can set up design-system with docker or locally on your machine.
#### Docker
1. Copy the .env.dist file to .env:`
sh`
cp .env.dist .env
NPM_FONTAWESOME_AUTH_TOKEN
The can be found in Bitwarden.docker compose up -d
2. run 127.0.0.1 design.demv.internal
3. (optional) add to your systems hosts file.
4. design-system should be available at http://localhost:3099 (or http://design.demv.internal)
#### Local
1. Copy the .huskyrc.dist file to .huskyrc:`
sh`
cp .huskyrc.dist .huskyrc
The NPM_FONTAWESOME_AUTH_TOKEN can be found in Bitwarden..bashrc
2. Add the following line to your or .zshrc:`
sh`
if [ -f .env ]; then
export $(cat .env | xargs)
fi
source ~/.bashrc
Then run or source ~/.zshrc to apply the changes.yarn install
3. Make sure Node 20 is installed
4. to install dependenciesyarn dev
5. Start dev watcher :3001
6. design-system should be available at http://localhost:3000 (or if :3000 is occupied etc.)
Our components are written in Vue 3 TypeScript with the Composition API.
1. Create a folder for your new component in /src/components.Ds
2. Inside the new folder:
1. Create your component(s). Each component should be prefixed with : Ds.index.ts
2. Create an file. Here you should export your component(s), types, composables, etc.
3. Create a file . In here you may later add usage examples in form of stories./src/components/index.ts
See storybook documentation for help.
3. Register your component in
4. Start developing!
There are two locations to register icons. Which one should be used depends on whether an icon is used in a component or only in a story:
- /src/icons.ts for icons that are used by components and should be included in the bundle/.storybook/icons.ts
- for icons that are only used in a story
Please make sure, DsPopover always uses the max z-index in the whole project. DsModal
Otherwise, it will interfere with e.g.
Right now, we have the following stack:
``
DsPopover - z-[1000]
DsModal - z-[999]
... all the other components
If you want to test your changes with a local project where you include the DesignSystem package, do the following:
1. Make your changes
2. run yarn build"@demvsystems/design-components": "file:/home/xyz/DEMV/design",
3. go to you local project and add the DS dependency like this: (obviously use your local path to the DS repo ;))yarn || pnpm i
4. install the dependencies in your local project by running your package manager
Now you should have the local changes available in your project to test against your actual application.
If you do further modifications to the DS, you always have to run the build (Step 2) first and then update the ds dependency
in the local project like this:
yarn|pnpm upgrade @demvsystems/design-components`
This is necessary to reflect every change made in the DS.
Happy testing