|
1 | 1 | <p align="center"> |
2 | | - <a href="https://hyphen.ai" rel="noopener" target="_blank"><img width="150" src="public/images/logo.png" alt="Hyphen logo"></a></p> |
| 2 | + <a href="https://hyphen.ai" rel="noopener" target="_blank"><img width="150" src="packages/components/public/images/logo.png" alt="Hyphen logo"></a></p> |
3 | 3 | </p> |
4 | 4 |
|
5 | | -<h1 align="center" style="border-bottom: none;">Hyphen Component Library</h1> |
| 5 | +<h1 align="center" style="border-bottom: none;">Hyphen Design System</h1> |
6 | 6 | <h3 align="center"> |
7 | 7 |
|
8 | | - A [React](https://reactjs.org/) component library to power all Hyphen UI |
| 8 | + The monorepo for Hyphen's design system packages |
9 | 9 |
|
10 | 10 | </h3> |
11 | 11 |
|
12 | | -## Quick Start |
| 12 | +## Packages |
13 | 13 |
|
14 | | -### 1. Install |
| 14 | +| Package | Description | |
| 15 | +| --- | --- | |
| 16 | +| [`@hyphen/hyphen-components`](packages/components) | A [React](https://reactjs.org/) component library to power all Hyphen UI | |
| 17 | +| [`@hyphen/hyphen-design-tokens`](packages/design-tokens) | Design tokens (color, spacing, typography, icons, logos) that power all Hyphen UIs | |
15 | 18 |
|
16 | | -`pnpm add @hyphen/hyphen-components` |
17 | | - |
18 | | -### 2. Import Global CSS |
| 19 | +Both packages are versioned and released together: one GitHub release |
| 20 | +publishes both to npm with the same version. |
19 | 21 |
|
20 | | -```jsx |
21 | | -import '@hyphen/hyphen-components/dist/css/utilities.css'; // Utility classes -- REQUIRED |
22 | | -import '@hyphen/hyphen-components/dist/css/variables.css'; // CSS Variables -- REQUIRED |
23 | | -import '@hyphen/hyphen-components/dist/css/index.css'; // Component CSS -- REQUIRED |
24 | | -import '@hyphen/hyphen-components/dist/css/fonts.css'; // Included Font files -- OPTIONAL BUT ENCOURAGED |
25 | | -``` |
| 22 | +## Quick Start (consumers) |
26 | 23 |
|
27 | | -We recommend importing our global reset in order to maintain a consistent |
28 | | -look of all components across applications. |
| 24 | +`pnpm add @hyphen/hyphen-components` |
29 | 25 |
|
30 | | -```jsx |
31 | | -import '@hyphen/hyphen-components/dist/css/reset.css' // A Basic CSS Reset -- OPTIONAL BUT ENCOURAGED. |
32 | | -``` |
| 26 | +See the [components README](packages/components/README.md) for usage, |
| 27 | +global CSS imports, and documentation links. |
33 | 28 |
|
34 | | -### 3. Usage |
| 29 | +Design tokens can also be consumed directly on other platforms: |
| 30 | +`pnpm add @hyphen/hyphen-design-tokens` — see the |
| 31 | +[design tokens README](packages/design-tokens/README.md). |
35 | 32 |
|
36 | | -```jsx |
37 | | -import React from 'react'; |
38 | | -import ReactDOM from 'react-dom'; |
39 | | -import { Box } from '@hyphen/hyphen-components'; |
| 33 | +## Development |
40 | 34 |
|
41 | | -function App() { |
42 | | - return <Box>Hello World</Box>; |
43 | | -} |
| 35 | +This is a [pnpm workspace](https://pnpm.io/workspaces). All commands run |
| 36 | +from the repo root: |
44 | 37 |
|
45 | | -ReactDOM.render(<App />, document.querySelector('#app')); |
| 38 | +```sh |
| 39 | +pnpm install # install all workspace dependencies |
| 40 | +pnpm build # build design tokens, then components |
| 41 | +pnpm test # build tokens, then run all test suites |
| 42 | +pnpm lint # lint all packages |
| 43 | +pnpm storybook # run the component Storybook locally |
46 | 44 | ``` |
47 | 45 |
|
48 | | -## Documentation |
49 | | - |
50 | | -[SEE FULL DOCS HERE](https://ux.hyphen.ai) |
51 | | - |
52 | | -## Contributing |
53 | | - |
54 | | -Issues and PRs welcome! See [HERE](./CONTRIBUTING.md) for our Contribution Guide. |
55 | | - |
56 | | -## Raising an Issue |
57 | | - |
58 | | -When raising an issue: |
59 | | - |
60 | | -* Make sure the issue hasn't been raised yet. |
61 | | -* Tag issue accordingly using your best judgement. Do NOT create new tags. If you feel a new one is needed, raise it in your issue. |
62 | | -* If your issue is a bug, include **screenshots** or animated GIFs in your issue whenever needed (if issue is visual in nature). |
63 | | -* If your issue is a bug, include steps to reproduce, or link to reproducible issue, e.g.: Code Sandbox or similar. Please also provide any additional details including device, OS, browser, browser version etc. |
64 | | - |
65 | | -[Issues can be raised here](https://github.com/hyphen/hyphen-components/issues). |
| 46 | +Changing a color, icon, or any other token is now a normal PR to this |
| 47 | +repo: edit the sources in `packages/design-tokens` (token JSON in |
| 48 | +`tokens/`, icon SVGs in `assets/icons`) and the same PR can update the |
| 49 | +components that use them. |
66 | 50 |
|
67 | | -## License |
| 51 | +## Releasing |
68 | 52 |
|
69 | | -This project is licensed under the terms of the |
70 | | -[MIT license](./LICENSE). |
| 53 | +Releases are automated with [semantic-release](https://github.com/semantic-release/semantic-release) |
| 54 | +from conventional commit messages. When a GitHub release is published, |
| 55 | +the Release workflow stamps the tag's version into both packages and |
| 56 | +publishes them to npm in dependency order. |
0 commit comments