# Docflow UI Component Library

<a href="https://www.npmjs.com/package/@docflow/component-library" target="_blank"><img alt="npm" src="https://img.shields.io/npm/v/@docflow/component-library"></a> <a href="http://main--6283d7a669eaf5004a41cd49.chromatic.com/" target="_blank"><img alt="Storybook" src="https://raw.githubusercontent.com/storybooks/brand/main/badge/badge-storybook.svg"></a>

## Develop

We use [pnpm](https://pnpm.io) v8 to manage dependencies.

Start the Storybook for development:

```bash
pnpm i
pnpm dev
```

## Publish

It's going to publish automatically when you merge something to `main`:

- If the string "BREAKING CHANGE" is found anywhere in any of the commit messages or descriptions the major version will be incremented.
- If a commit message begins with the string "feat" then the minor version will be increased. This works for most common commit metadata for feature additions: "feat: new API" and "feature: new API".
- All other changes will increment the patch version.

## Add new icons

1. Go to Figma and select all 4 weight variants of the icon you want to export
2. In the Export settings, specify the suffix of an underscore and the camel-cased filename of the icon you're exporting (e.g. the suffix should be `_arrowRight` for the icon called `arrow.right`)
3. If you're exporting multiple icons, repeat steps 1 and 2 for each icon
4. Place the exported files in the `resources/icons` folder
5. Run `node scripts/1-adaptIcons.mjs` to rename the icons automatically
6. Run `node scripts/2-cleanIcons.mjs` to clean up the icons and set internal colors correctly
7. Commit!
