@beehexa/design-rules 2611.5.5 → 2611.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/catalog.json +908 -208
- package/dist/docs/public/_redirects +2 -2
- package/dist/docs/scripts/color-pairs.mjs +4 -0
- package/dist/docs/src/components/ChildPages.astro +8 -1
- package/dist/docs/src/components/ColorDemo.astro +12 -9
- package/dist/docs/src/components/DocsFooter.astro +1 -1
- package/dist/docs/src/components/HelpOptions.astro +8 -6
- package/dist/docs/src/components/IconBrowser.astro +2 -2
- package/dist/docs/src/components/LayoutDemo.astro +178 -99
- package/dist/docs/src/components/NativeControlsDemo.astro +165 -40
- package/dist/docs/src/components/NativeFlowDemo.astro +206 -0
- package/dist/docs/src/components/PhaseTable.astro +9 -5
- package/dist/docs/src/components/RoleGuides.astro +30 -22
- package/dist/docs/src/components/RuleDemo.astro +111 -0
- package/dist/docs/src/components/ShapeDemo.astro +24 -36
- package/dist/docs/src/components/SiteHeader.astro +1 -1
- package/dist/docs/src/components/SpacingDemo.astro +2 -0
- package/dist/docs/src/components/SwitchToggle.astro +13 -0
- package/dist/docs/src/components/SystemAreas.astro +9 -6
- package/dist/docs/src/components/TableOfContents.astro +1 -1
- package/dist/docs/src/components/TokenSearch.astro +64 -0
- package/dist/docs/src/components/TokenTable.astro +14 -9
- package/dist/docs/src/components/TypeDemo.astro +1 -1
- package/dist/docs/src/components/logos/LogoClearSpace.astro +1 -1
- package/dist/docs/src/content/components/button/accessibility.mdx +3 -3
- package/dist/docs/src/content/components/button/changelog.mdx +1 -1
- package/dist/docs/src/content/components/button/examples.mdx +10 -23
- package/dist/docs/src/content/components/button/meta.json +5 -1
- package/dist/docs/src/content/components/button/usage.mdx +13 -26
- package/dist/docs/src/content/components/resizable-panel/meta.json +5 -1
- package/dist/docs/src/content/{foundations/styles/scrollbars.mdx → components/scrollbar/code.mdx} +20 -39
- package/dist/docs/src/content/components/scrollbar/meta.json +9 -0
- package/dist/docs/src/content/components/scrollbar/usage.mdx +36 -0
- package/dist/docs/src/content/components/switch/accessibility.mdx +28 -0
- package/dist/docs/src/content/components/switch/examples.mdx +35 -0
- package/dist/docs/src/content/components/switch/meta.json +9 -0
- package/dist/docs/src/content/components/switch/usage.mdx +44 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/statement.mdx +4 -2
- package/dist/docs/src/content/foundations/guidelines/accessibility/testing.mdx +1 -1
- package/dist/docs/src/content/foundations/guidelines/accessibility.mdx +1 -1
- package/dist/docs/src/content/foundations/guidelines/content/messages.mdx +67 -0
- package/dist/docs/src/content/foundations/guidelines/content/numbers-dates-and-currency.mdx +72 -0
- package/dist/docs/src/content/foundations/guidelines/content/style-and-grammar.mdx +92 -0
- package/dist/docs/src/content/foundations/guidelines/content/terms.mdx +57 -0
- package/dist/docs/src/content/foundations/guidelines/content/voice-and-tone.mdx +48 -0
- package/dist/docs/src/content/foundations/guidelines/content.mdx +22 -17
- package/dist/docs/src/content/foundations/styles/border.mdx +5 -6
- package/dist/docs/src/content/foundations/styles/color/accessibility.mdx +31 -7
- package/dist/docs/src/content/foundations/styles/color/dark-mode.mdx +66 -6
- package/dist/docs/src/content/foundations/styles/color/palette.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/color/usage.mdx +5 -5
- package/dist/docs/src/content/foundations/styles/data-visualization.mdx +33 -78
- package/dist/docs/src/content/foundations/styles/elevation.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/icons/code.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/icons/library.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/icons/usage.mdx +0 -3
- package/dist/docs/src/content/foundations/styles/interaction-states.mdx +40 -14
- package/dist/docs/src/content/foundations/styles/layout/app-frame.mdx +4 -9
- package/dist/docs/src/content/foundations/styles/layout/grid.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/layout/overlays.mdx +3 -0
- package/dist/docs/src/content/foundations/styles/logos/downloads-and-terms.mdx +3 -3
- package/dist/docs/src/content/foundations/styles/logos/using-the-logo.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/motion.mdx +2 -0
- package/dist/docs/src/content/foundations/styles/radius.mdx +38 -27
- package/dist/docs/src/content/foundations/styles/size-and-density.mdx +7 -6
- package/dist/docs/src/content/foundations/styles/spacing.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/typography/code.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/typography/usage.mdx +7 -0
- package/dist/docs/src/content/foundations/styles/z-index.mdx +3 -16
- package/dist/docs/src/content/foundations/tokens/all-tokens.mdx +51 -2
- package/dist/docs/src/content/foundations/tokens/index.mdx +91 -6
- package/dist/docs/src/content/get-started/content.mdx +25 -3
- package/dist/docs/src/content/get-started/design.mdx +34 -15
- package/dist/docs/src/content/get-started/develop.mdx +83 -28
- package/dist/docs/src/content/get-started/get-help.mdx +21 -5
- package/dist/docs/src/content/get-started/index.mdx +11 -12
- package/dist/docs/src/content/tools/ant-design-vue-theme.mdx +176 -48
- package/dist/docs/src/content/tools/application-content.mdx +52 -13
- package/dist/docs/src/content/tools/editors.mdx +36 -28
- package/dist/docs/src/content/tools/mermaid.mdx +42 -9
- package/dist/docs/src/content/tools/vueflow.mdx +56 -7
- package/dist/docs/src/content-vi/components/button/accessibility.mdx +51 -0
- package/dist/docs/src/content-vi/components/button/changelog.mdx +6 -0
- package/dist/docs/src/content-vi/components/button/examples.mdx +27 -0
- package/dist/docs/src/content-vi/components/button/usage.mdx +31 -0
- package/dist/docs/src/content-vi/components/resizable-panel/accessibility.mdx +58 -0
- package/dist/docs/src/content-vi/components/resizable-panel/changelog.mdx +20 -0
- package/dist/docs/src/content-vi/components/resizable-panel/code.mdx +78 -0
- package/dist/docs/src/content-vi/components/resizable-panel/examples.mdx +83 -0
- package/dist/docs/src/content-vi/components/resizable-panel/usage.mdx +97 -0
- package/dist/docs/src/content-vi/components/scrollbar/code.mdx +71 -0
- package/dist/docs/src/content-vi/components/scrollbar/usage.mdx +36 -0
- package/dist/docs/src/content-vi/components/switch/accessibility.mdx +28 -0
- package/dist/docs/src/content-vi/components/switch/examples.mdx +35 -0
- package/dist/docs/src/content-vi/components/switch/usage.mdx +44 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/statement.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/testing.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/guidelines/content/messages.mdx +67 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content/numbers-dates-and-currency.mdx +71 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content/style-and-grammar.mdx +91 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content/terms.mdx +57 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content/voice-and-tone.mdx +48 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content.mdx +24 -19
- package/dist/docs/src/content-vi/foundations/styles/border.mdx +5 -5
- package/dist/docs/src/content-vi/foundations/styles/color/accessibility.mdx +30 -7
- package/dist/docs/src/content-vi/foundations/styles/color/dark-mode.mdx +65 -6
- package/dist/docs/src/content-vi/foundations/styles/color/palette.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/color/usage.mdx +5 -5
- package/dist/docs/src/content-vi/foundations/styles/data-visualization.mdx +31 -1
- package/dist/docs/src/content-vi/foundations/styles/elevation.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/icons/code.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/icons/library.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/icons/usage.mdx +0 -3
- package/dist/docs/src/content-vi/foundations/styles/interaction-states.mdx +54 -12
- package/dist/docs/src/content-vi/foundations/styles/layout/app-frame.mdx +4 -9
- package/dist/docs/src/content-vi/foundations/styles/layout/grid.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/layout/overlays.mdx +3 -0
- package/dist/docs/src/content-vi/foundations/styles/logos/downloads-and-terms.mdx +3 -3
- package/dist/docs/src/content-vi/foundations/styles/motion.mdx +2 -0
- package/dist/docs/src/content-vi/foundations/styles/radius.mdx +38 -27
- package/dist/docs/src/content-vi/foundations/styles/size-and-density.mdx +7 -6
- package/dist/docs/src/content-vi/foundations/styles/spacing.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/typography/code.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/typography/usage.mdx +7 -0
- package/dist/docs/src/content-vi/foundations/styles/z-index.mdx +3 -16
- package/dist/docs/src/content-vi/foundations/tokens/all-tokens.mdx +51 -2
- package/dist/docs/src/content-vi/foundations/tokens/index.mdx +90 -5
- package/dist/docs/src/content-vi/get-started/content.mdx +36 -0
- package/dist/docs/src/content-vi/get-started/design.mdx +49 -0
- package/dist/docs/src/content-vi/get-started/develop.mdx +110 -0
- package/dist/docs/src/content-vi/get-started/get-help.mdx +35 -0
- package/dist/docs/src/content-vi/get-started/index.mdx +49 -0
- package/dist/docs/src/content-vi/release-phases/index.mdx +11 -0
- package/dist/docs/src/content-vi/tools/ai-agents.mdx +36 -0
- package/dist/docs/src/content-vi/tools/ant-design-vue-theme.mdx +676 -0
- package/dist/docs/src/content-vi/tools/application-content.mdx +171 -0
- package/dist/docs/src/content-vi/tools/editors.mdx +254 -0
- package/dist/docs/src/content-vi/tools/eslint.mdx +15 -0
- package/dist/docs/src/content-vi/tools/index.mdx +7 -0
- package/dist/docs/src/content-vi/tools/mermaid.mdx +179 -0
- package/dist/docs/src/content-vi/tools/stylelint.mdx +18 -0
- package/dist/docs/src/content-vi/tools/vueflow.mdx +189 -0
- package/dist/docs/src/content.config.ts +12 -1
- package/dist/docs/src/lib/dates.ts +8 -0
- package/dist/docs/src/lib/i18n.ts +1 -0
- package/dist/docs/src/lib/navigation.ts +6 -4
- package/dist/docs/src/lib/token-descriptions-vi.ts +247 -11
- package/dist/docs/src/lib/tokens.ts +3 -0
- package/dist/docs/src/styles/chrome.css +8 -8
- package/dist/docs/src/styles/color.css +31 -31
- package/dist/docs/src/styles/docs.css +55 -40
- package/dist/docs/src/styles/elevation.css +1 -1
- package/dist/docs/src/styles/global.css +13 -4
- package/dist/docs/src/styles/icons.css +16 -16
- package/dist/docs/src/styles/kit.css +29 -10
- package/dist/docs/src/styles/layout.css +16 -11
- package/dist/docs/src/styles/logos.css +24 -24
- package/dist/docs/src/styles/opacity.css +3 -3
- package/dist/docs/src/styles/rules.css +24 -0
- package/dist/docs/src/styles/shapes.css +2 -2
- package/dist/docs/src/styles/tokens.css +228 -147
- package/dist/docs/src/styles/tokens.js +88 -62
- package/dist/docs/src/styles/typography.css +9 -9
- package/dist/docs/src/styles/zindex.css +6 -5
- package/dist/docs/tokens/color.json +24 -14
- package/dist/docs/tokens/components.json +39 -0
- package/dist/docs/tokens/content.json +103 -10
- package/dist/docs/tokens/diagram.json +490 -49
- package/dist/docs/tokens/editor.json +128 -22
- package/dist/docs/tokens/flow.json +412 -80
- package/dist/docs/tokens/layout.json +13 -4
- package/dist/docs/tokens/motion.json +11 -0
- package/dist/docs/tokens/radius.json +9 -9
- package/dist/docs/tokens/renderer.json +8 -0
- package/dist/docs/tokens/resize.json +84 -15
- package/dist/docs/tokens/scrollbar.json +42 -7
- package/dist/docs/tokens/size.json +6 -6
- package/dist/docs/tokens/spacing.json +1 -1
- package/dist/docs/tokens/switch.json +314 -59
- package/dist/docs/tokens/typography.json +1 -1
- package/dist/docs/tokens/visualization.json +465 -53
- package/dist/docs/tokens/z-index.json +0 -10
- package/dist/index.js +908 -208
- package/package.json +1 -1
- package/dist/docs/src/brand/structure-proposal.md +0 -227
- package/dist/docs/src/content/components/button/code.mdx +0 -34
|
@@ -6,6 +6,26 @@ order: 1
|
|
|
6
6
|
|
|
7
7
|
When a designer picks "text subtle" in a design file and a developer writes `var(--bh-color-text-subtle)`, they mean the same grey. That shared name is a design token. Change its value once and every product follows, so screens never drift apart.
|
|
8
8
|
|
|
9
|
+
**Use a token for every colour, size, space, radius, shadow and duration. Do not type the raw value.**
|
|
10
|
+
|
|
11
|
+
## What a token is
|
|
12
|
+
|
|
13
|
+
A token is a name and a value. The name says what the value is for. The value can be a colour, a size, a duration or another token.
|
|
14
|
+
|
|
15
|
+
| Name | Value | What it is for |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `color.text.subtle` | `{color.graphite.11}` | Secondary text, such as descriptions and navigation |
|
|
18
|
+
| `space.card` | `{space.300}`, 24 px | Padding inside cards and panels |
|
|
19
|
+
| `radius.control` | `{radius.075}`, 6 px | Corners of buttons, text fields and selects |
|
|
20
|
+
| `motion.duration.fast` | 100 ms | Small changes, such as a hover colour |
|
|
21
|
+
|
|
22
|
+
## Why tokens matter
|
|
23
|
+
|
|
24
|
+
- **Design and code speak the same language.** A name in a design file is the same name in code, so nothing is lost in handoff.
|
|
25
|
+
- **One change reaches every product.** When a value is adjusted, every screen that uses the token updates with it.
|
|
26
|
+
- **Themes come for free.** Dark mode and Vietnamese text change token values, not your code.
|
|
27
|
+
- **Names explain the choice.** `color.border.focus` tells the next person why the line is blue. `#005195` does not.
|
|
28
|
+
|
|
9
29
|
## How tokens are layered
|
|
10
30
|
|
|
11
31
|
Tokens come in three layers. Use the most specific one that fits.
|
|
@@ -13,14 +33,26 @@ Tokens come in three layers. Use the most specific one that fits.
|
|
|
13
33
|
| Layer | Example | Use it |
|
|
14
34
|
| --- | --- | --- |
|
|
15
35
|
| Scale | `color.graphite.11`, `space.200`, `radius.100` | The raw steps. Colour scales are never used directly. Spacing and radius steps are used when no role token fits. |
|
|
16
|
-
| Role | `color.text.subtle`, `space.control.x` | In products and components. Each is named for its job, so it stays right when the scale changes. |
|
|
36
|
+
| Role | `color.text.subtle`, `space.control.x`, `radius.card` | In products and components. Each is named for its job, so it stays right when the scale changes. |
|
|
17
37
|
| Component | `color.code.background` | Only where no role fits. |
|
|
18
38
|
|
|
19
|
-
A role token points at a step of a scale
|
|
39
|
+
A role token points at a step of a scale. `color.text` points at `{color.graphite.12}`, for example. Use the role token, not the step it points at: if the step changes for the role, your screen changes with it.
|
|
20
40
|
|
|
21
|
-
##
|
|
41
|
+
## Reading a token name
|
|
22
42
|
|
|
23
|
-
|
|
43
|
+
A name reads from general to specific. Take `color.background.danger.bold.hover`:
|
|
44
|
+
|
|
45
|
+
| Part | Meaning |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `color` | The kind of value |
|
|
48
|
+
| `background` | Where it is used |
|
|
49
|
+
| `danger` | What it means |
|
|
50
|
+
| `bold` | How strong it is |
|
|
51
|
+
| `hover` | The state it is for |
|
|
52
|
+
|
|
53
|
+
Not every name has every part. `color.text` is the default text colour. Leaving a part out means "the default".
|
|
54
|
+
|
|
55
|
+
Design files and these docs separate the parts with dots. CSS uses hyphens and adds the `bh` prefix:
|
|
24
56
|
|
|
25
57
|
| Token | CSS custom property |
|
|
26
58
|
| --- | --- |
|
|
@@ -28,8 +60,61 @@ Tokens are named from general to specific, separated by dots in design and docum
|
|
|
28
60
|
| `space.200` | `--bh-space-200` |
|
|
29
61
|
| `color.border.focus` | `--bh-color-border-focus` |
|
|
30
62
|
|
|
63
|
+
## One name, several values
|
|
64
|
+
|
|
65
|
+
Some tokens have a different value in another context. The name stays the same, so your code does not change.
|
|
66
|
+
|
|
67
|
+
| Context | Example | What changes |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| Dark mode | `elevation.shadow.raised` | The shadow gets darker so it still shows on a dark surface |
|
|
70
|
+
| Vietnamese text | `font.body.default` | Line height grows from 20 px to 24 px so stacked accents are not clipped |
|
|
71
|
+
|
|
72
|
+
Dark mode follows the person's system setting, unless a page sets light or dark. Vietnamese values apply to any element marked `lang="vi"`. See [Dark mode](/foundations/styles/color/dark-mode/) and [Vietnamese](/foundations/styles/typography/vietnamese/).
|
|
73
|
+
|
|
74
|
+
## Find the right token
|
|
75
|
+
|
|
76
|
+
1. **Start from the job.** Is it text, a background, a border, a gap? Open the matching style page below.
|
|
77
|
+
2. **Pick the role.** Choose the token named for what you are building, such as `space.control.x` for the side padding of a button.
|
|
78
|
+
3. **Check the state.** Hover, pressed, selected and disabled have their own tokens. See [Interaction states](/foundations/styles/interaction-states/).
|
|
79
|
+
4. **No role fits?** Use a scale step for spacing or radius. For colour, ask the design system team for a new role.
|
|
80
|
+
|
|
81
|
+
| Do | Don't |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| Use `color.text.subtle` for a description under a title. | Use `color.graphite.11` because it looks the same today. |
|
|
84
|
+
| Use `space.card` inside a card. | Use `24px`, or `space.300` when `space.card` exists. |
|
|
85
|
+
| Use `color.text.danger` for an error message. | Use a danger token only because the colour is red. Tokens carry meaning, not just colour. |
|
|
86
|
+
| Ask for a new token when nothing fits. | Make a value close to a token, such as `15px` next to `space.200`. |
|
|
87
|
+
|
|
88
|
+
## Tokens by group
|
|
89
|
+
|
|
90
|
+
| Group | What it holds | Example |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| [Color](/foundations/styles/color/tokens/) | Text, backgrounds, borders, icons and surfaces, in light and dark | `color.background.brand.bold` |
|
|
93
|
+
| [Typography](/foundations/styles/typography/) | Font families, sizes, weights and full text styles | `font.heading.medium` |
|
|
94
|
+
| [Spacing](/foundations/styles/spacing/) | Space between and inside elements | `space.stack` |
|
|
95
|
+
| [Size and density](/foundations/styles/size-and-density/) | Heights of controls and minimum touch targets | `size.control.default` |
|
|
96
|
+
| [Radius](/foundations/styles/radius/) | Corner rounding by element | `radius.modal` |
|
|
97
|
+
| [Border](/foundations/styles/border/) | Line widths | `border.width.focused` |
|
|
98
|
+
| [Elevation](/foundations/styles/elevation/) | Shadows that lift surfaces | `elevation.shadow.raised` |
|
|
99
|
+
| [Opacity](/foundations/styles/opacity/) | See-through values | `opacity.disabled` |
|
|
100
|
+
| [Z-index](/foundations/styles/z-index/) | Stacking order of layers | `z-index.modal` |
|
|
101
|
+
| [Motion](/foundations/styles/motion/) | Durations and easing | `motion.easing.enter` |
|
|
102
|
+
| [Layout](/foundations/styles/layout/) | Page widths, margins, breakpoints and overlay widths | `layout.page.wide` |
|
|
103
|
+
|
|
31
104
|
## One source
|
|
32
105
|
|
|
33
|
-
Every token has one value, kept in one place. The token tables on this site and the CSS
|
|
106
|
+
Every token has one value, kept in one place. The token tables on this site and the CSS custom properties in products come from that same source, so they always match.
|
|
107
|
+
|
|
108
|
+
The package `@beehexa/design-tokens` carries that source in three forms:
|
|
109
|
+
|
|
110
|
+
| Form | Path in the package | Use it for |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| CSS custom properties | `@beehexa/design-tokens/css` | Product code: every token as `--bh-*`, light and dark |
|
|
113
|
+
| Typed JavaScript | `@beehexa/design-tokens` | Code that needs a value, such as a chart or an editor |
|
|
114
|
+
| DTCG JSON, one file per group | `@beehexa/design-tokens/dtcg/color.json`, `…/spacing.json` and the rest | Other tools: build tools such as Style Dictionary, and design tool plugins. The files follow the [Design Tokens Format Module](https://www.designtokens.org/tr/drafts/format/) |
|
|
115
|
+
|
|
116
|
+
## Related
|
|
34
117
|
|
|
35
|
-
|
|
118
|
+
- [All design tokens](/foundations/tokens/all-tokens/): every token with its light and dark value
|
|
119
|
+
- [Develop](/get-started/develop/): how to add the tokens to a product
|
|
120
|
+
- [Interaction states](/foundations/styles/interaction-states/): tokens for hover, pressed, selected and disabled
|
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Content
|
|
3
|
-
description:
|
|
3
|
+
description: "Words are how people get their work done in Beehexa products. Where writers find the rules, the word list and the guidance for each component."
|
|
4
4
|
order: 3
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A button that says "Submit" makes people stop and think. A button that says "Sync orders" tells them what will happen. Writers, designers and developers all write product copy, and the same rules keep it clear and consistent whoever writes it.
|
|
8
|
+
|
|
9
|
+
**Write in sentence case, lead with the action, and use the same word for the same thing everywhere.**
|
|
10
|
+
|
|
11
|
+
## Learn the content guidelines
|
|
12
|
+
|
|
13
|
+
| Page | Read it for |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| [Voice and tone](/foundations/guidelines/content/voice-and-tone/) | How Beehexa sounds, and how the tone changes when things go well or wrong |
|
|
16
|
+
| [Style and grammar](/foundations/guidelines/content/style-and-grammar/) | Capitals, buttons, labels, punctuation and links |
|
|
17
|
+
| [Numbers, dates and currency](/foundations/guidelines/content/numbers-dates-and-currency/) | Amounts in đồng, dates and times in English and Vietnamese |
|
|
18
|
+
| [Messages](/foundations/guidelines/content/messages/) | Errors, warnings, success messages, empty states and confirmations |
|
|
19
|
+
| [Terms](/foundations/guidelines/content/terms/) | The word for each thing, in English and Vietnamese |
|
|
20
|
+
|
|
21
|
+
## Follow the guidance for each component
|
|
22
|
+
|
|
23
|
+
Each component page has a Usage tab that says how to write its text, such as the label of a [button](/components/button/usage/). Read it before you write for that component.
|
|
8
24
|
|
|
9
25
|
## Quick rules
|
|
10
26
|
|
|
11
27
|
- Write in sentence case: "Create order", not "Create Order".
|
|
12
28
|
- Lead with the action or the outcome.
|
|
13
|
-
- Name things the same way everywhere.
|
|
29
|
+
- Name things the same way everywhere, using the words in [Terms](/foundations/guidelines/content/terms/).
|
|
14
30
|
- Say what went wrong and how to fix it in error messages.
|
|
31
|
+
- Write every product string in both English and Vietnamese, and check that the Vietnamese fits.
|
|
32
|
+
|
|
33
|
+
## Related
|
|
34
|
+
|
|
35
|
+
- [Accessibility](/foundations/guidelines/accessibility/): names for controls, alt text and plain language.
|
|
36
|
+
- [Get help](/get-started/get-help/): propose a new term or ask about wording.
|
|
@@ -1,30 +1,49 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Design
|
|
3
|
-
description:
|
|
3
|
+
description: "Design Beehexa screens from the same tokens, components and rules that developers build with, so what you hand off is what ships."
|
|
4
4
|
order: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
A design that uses 15 px padding and a grey picked by eye looks fine in the file. In code, it becomes a one-off value nobody can find again, and the next screen drifts a little further. When every value in a design is a token and every control is a component, developers build exactly what you drew.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Design with tokens and components first. Draw something new only when nothing in the system fits.**
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Start from the foundations
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- **Use a token for every value:** colour, type, spacing, radius, shadow and motion. See [Tokens overview](/foundations/tokens/).
|
|
14
|
+
- **Pick the role, not the look.** Choose `color.text.subtle` for secondary text, not the grey that looks right.
|
|
15
|
+
- **Missing a value?** Ask the design system team for a token instead of adding a one-off value.
|
|
14
16
|
|
|
15
|
-
##
|
|
17
|
+
## Use components first
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Check [Components](/components/) before you draw a new control. Each component page shows when to use it, when to choose something else, and how it looks in every state. If a component almost fits, ask before you change it: a small change for one screen splits the system in two.
|
|
20
|
+
|
|
21
|
+
## Design every state
|
|
22
|
+
|
|
23
|
+
Show hover, focus, pressed, selected and disabled for every interactive element, and the empty, loading and error states of every screen. See [Interaction states](/foundations/styles/interaction-states/) and [Messages](/foundations/guidelines/content/messages/).
|
|
24
|
+
|
|
25
|
+
## Write the words
|
|
26
|
+
|
|
27
|
+
Words are part of the design. Use real text, not placeholder text, and follow the [content guidelines](/foundations/guidelines/content/): sentence case, buttons that start with a verb, and the words in [Terms](/foundations/guidelines/content/terms/). Check the screen in Vietnamese too: it is often longer, and its marks need more line height.
|
|
18
28
|
|
|
19
29
|
## Check accessibility early
|
|
20
30
|
|
|
21
|
-
Beehexa
|
|
31
|
+
Beehexa products meet WCAG 2.2 AA. Fixing contrast or focus order in a design takes minutes; fixing it in code after release takes far longer. Read the [accessibility guidelines](/foundations/guidelines/accessibility/) and the Accessibility tab of each component you use.
|
|
32
|
+
|
|
33
|
+
## Before handoff
|
|
34
|
+
|
|
35
|
+
Answer yes to every question before you hand a design to development.
|
|
36
|
+
|
|
37
|
+
- Is every colour a role token, with no hex values or scale steps?
|
|
38
|
+
- Is text and every icon on a background it is [paired](/foundations/styles/color/accessibility/#pairing) with?
|
|
39
|
+
- Is yellow used only for the logo, the current-page bar, highlights and brand notes?
|
|
40
|
+
- Is there at most one primary button in each view?
|
|
41
|
+
- Is every status written in words, and does every selected item have a second cue besides colour?
|
|
42
|
+
- Does every interactive element show all its states, including focus?
|
|
43
|
+
- Did you check the screen in light and dark, and in Vietnamese?
|
|
44
|
+
- Does it work at 320 px wide, with no sideways scrolling?
|
|
22
45
|
|
|
23
|
-
##
|
|
46
|
+
## Related
|
|
24
47
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- Yellow only for the logo, the current-page bar, highlights and brand notes.
|
|
28
|
-
- One primary button per view.
|
|
29
|
-
- Every status is written in words; every selected item has a second cue.
|
|
30
|
-
- Checked in light and in dark.
|
|
48
|
+
- [Develop](/get-started/develop/): how developers use the same tokens.
|
|
49
|
+
- [Layout](/foundations/styles/layout/): the app frame, grid and page widths.
|
|
@@ -1,55 +1,110 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Develop
|
|
3
|
-
description:
|
|
3
|
+
description: "Add the Beehexa token package once, then build every screen from the same values designers use. Setup, tokens, themes and AI agents."
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
When a designer changes the border colour of cards, every product should follow without a single line of product code changing. That works when products read their values from the token package instead of copying them. This page shows how to set that up and how to build on it.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
**Import the token CSS once, then use a role token for every colour, size, space, radius, shadow and duration.**
|
|
10
|
+
|
|
11
|
+
## Install the packages
|
|
12
|
+
|
|
13
|
+
The design system is published on npm as six packages, built from the [beehexa.design](https://github.com/beehexacorp/beehexa.design) repository. Install the ones your product needs:
|
|
14
|
+
|
|
15
|
+
| Package | What it holds | Needs |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `@beehexa/design-tokens` | Every token as CSS custom properties, as typed JavaScript, and as DTCG files | Nothing else |
|
|
18
|
+
| `@beehexa/design-rules` | The guidance on this site, packaged for tools and AI agents | Nothing else |
|
|
19
|
+
| `@beehexa/ant-design-vue-tokens` | The tokens as an Ant Design Vue theme. See [Ant Design Vue theme](/tools/ant-design-vue-theme/) | `ant-design-vue` 4.2.6 or later 4.x, `vue` 3.3 or later |
|
|
20
|
+
| `@beehexa/mermaid-tokens` | The tokens as a Mermaid configuration. See [Mermaid](/tools/mermaid/) | `mermaid` 12 |
|
|
21
|
+
| `@beehexa/vueflow-tokens` | The tokens as a VueFlow theme. See [VueFlow](/tools/vueflow/) | `@vue-flow/core`, `controls` and `minimap` 1.x, `vue` 3 |
|
|
22
|
+
| `@beehexa/vue-components` | Vue components, starting with [Resizable panel](/components/resizable-panel/usage/) | `vue` 3.5 or later |
|
|
23
|
+
|
|
24
|
+
The adapter packages read the token package; they don't copy its values.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install @beehexa/design-tokens@<version> @beehexa/design-rules@<version>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- **Install the same version of every Beehexa package.** All six are released together under one version number, `YYMM.DD.N`: the date of the release and its number that day. A package from another release may not match the token values.
|
|
31
|
+
- **Pin the exact version** and update it on purpose. Read `CHANGELOG.md` in the repository before you update: a token can be renamed or removed.
|
|
32
|
+
- **Use a version only once it has been published.** Releases are published only with manager approval, so never guess a version number.
|
|
33
|
+
- **Don't copy the generated files into your product.** A copy stops following the system the day it is made.
|
|
34
|
+
|
|
35
|
+
### Trying a change before it is released
|
|
36
|
+
|
|
37
|
+
To test an unreleased change, build the packages in a checkout of the repository and point your product at them on your machine only:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npm ci
|
|
41
|
+
npm run build:packages
|
|
42
|
+
```
|
|
13
43
|
|
|
14
44
|
```json
|
|
15
45
|
{
|
|
16
46
|
"dependencies": {
|
|
17
|
-
"@beehexa/design-tokens": "portal:../beehexa.design/packages/design-tokens"
|
|
18
|
-
"@beehexa/design-rules": "portal:../beehexa.design/packages/design-rules"
|
|
47
|
+
"@beehexa/design-tokens": "portal:../beehexa.design/packages/design-tokens"
|
|
19
48
|
}
|
|
20
49
|
}
|
|
21
50
|
```
|
|
22
51
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
it does not satisfy user-default-font scaling. Do not copy generated files into consumers.
|
|
52
|
+
Keep this on your machine. CI installs published versions only, and never builds a sibling repository.
|
|
53
|
+
|
|
54
|
+
## Add the tokens
|
|
27
55
|
|
|
28
|
-
|
|
29
|
-
tags, deployment, release-CI dispatch and consumer version bumps require explicit manager approval.
|
|
30
|
-
Only an actual authorized published version may replace local references.
|
|
31
|
-
CI is single-repository and uses real published dependency versions. Do not checkout/build sibling
|
|
32
|
-
repos or pass local references into CI. Until an authorized release exists, continue local work
|
|
33
|
-
without running consumer CI or asking for a release to unblock local implementation.
|
|
56
|
+
Import the CSS once, in your app's entry point:
|
|
34
57
|
|
|
35
|
-
|
|
58
|
+
```js
|
|
59
|
+
import '@beehexa/design-tokens/css';
|
|
60
|
+
```
|
|
36
61
|
|
|
37
|
-
|
|
62
|
+
Then use the tokens in your styles:
|
|
38
63
|
|
|
39
64
|
```css
|
|
40
65
|
.panel {
|
|
41
|
-
padding: var(--bh-space-
|
|
66
|
+
padding: var(--bh-space-card);
|
|
42
67
|
border: var(--bh-border-width-default) solid var(--bh-color-border);
|
|
43
|
-
border-radius: var(--bh-radius-
|
|
68
|
+
border-radius: var(--bh-radius-card);
|
|
69
|
+
color: var(--bh-color-text);
|
|
44
70
|
}
|
|
45
71
|
```
|
|
46
72
|
|
|
47
|
-
|
|
73
|
+
When code needs a value rather than CSS, such as a chart library, read it from JavaScript:
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
import { tokens, tokenInfo } from '@beehexa/design-tokens';
|
|
77
|
+
|
|
78
|
+
const text = tokens.light['color.text'];
|
|
79
|
+
const darkText = tokens.dark['color.text'] ?? text;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The token sizes are in `rem`, so text and spacing grow with the person's browser font size. If your app sets a root font size other than 16 px, import `@beehexa/design-tokens/css/pixels` instead of, not as well as, the default CSS.
|
|
83
|
+
|
|
84
|
+
## Dark mode and Vietnamese
|
|
85
|
+
|
|
86
|
+
The same CSS handles both. You don't change any token names.
|
|
87
|
+
|
|
88
|
+
- **Dark mode** follows the person's system setting. To set it yourself, put `data-theme="dark"` or `data-theme="light"` on the root element. See [Dark mode](/foundations/styles/color/dark-mode/#turn-it-on-in-code).
|
|
89
|
+
- **Vietnamese** text gets taller line heights so its marks are not clipped. Set `lang="vi"` on the root element, or on any element that holds Vietnamese text.
|
|
90
|
+
|
|
91
|
+
## Build components
|
|
92
|
+
|
|
93
|
+
Build each control to match its page in [Components](/components/): the same structure, states, tokens and keyboard behaviour. A component page in an early release phase describes the direction, not final values: don't fill gaps with values of your own. Ask the design system team instead.
|
|
94
|
+
|
|
95
|
+
## Check before you ship
|
|
96
|
+
|
|
97
|
+
- Does every value come from a token, with no hex colours, pixel sizes or durations typed by hand?
|
|
98
|
+
- Can every control be reached and used with a keyboard, with a visible focus ring? See [Keyboard and focus](/foundations/guidelines/accessibility/keyboard-and-focus/).
|
|
99
|
+
- Does the screen pass the checks in [Accessibility testing](/foundations/guidelines/accessibility/testing/), in light and dark?
|
|
100
|
+
- Does it work at 320 px wide, and with `lang="vi"`?
|
|
48
101
|
|
|
49
102
|
## Working with AI agents
|
|
50
103
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
104
|
+
Point your agent at `@beehexa/design-rules/agent` first. It then reads the full rules offline with the package's `listRules`, `readRule` and `searchRules`. A rule marked as planned is not permission to invent values. The site's [`/llms.txt`](/llms.txt) is an index for browsing, not a replacement for the installed rules. See [Docs for AI agents](/tools/ai-agents/).
|
|
105
|
+
|
|
106
|
+
## Related
|
|
107
|
+
|
|
108
|
+
- [Tokens overview](/foundations/tokens/): how tokens are named and layered.
|
|
109
|
+
- [All design tokens](/foundations/tokens/all-tokens/): every token and its value.
|
|
110
|
+
- [Tools](/tools/): lint rules for styles and templates.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Get help
|
|
3
|
-
description: Ask a question, report a problem or propose a change
|
|
3
|
+
description: "Ask a question, report a problem or propose a change. Every report makes the system better for the next person."
|
|
4
4
|
order: 3
|
|
5
5
|
sidebarGroup: Reference
|
|
6
6
|
---
|
|
7
7
|
import HelpOptions from '../../components/HelpOptions.astro';
|
|
8
8
|
|
|
9
|
-
The design system team looks after this site, the tokens and the component guidance.
|
|
9
|
+
The design system belongs to everyone who builds Beehexa products. When a token is missing, a rule is unclear or a page is wrong, telling us fixes it for everyone. The design system team looks after this site, the tokens and the component guidance.
|
|
10
|
+
|
|
11
|
+
**If something in the system doesn't fit your work, tell us before you work around it.**
|
|
10
12
|
|
|
11
13
|
## Ways to reach us
|
|
12
14
|
|
|
@@ -14,6 +16,20 @@ The design system team looks after this site, the tokens and the component guida
|
|
|
14
16
|
|
|
15
17
|
## What to include
|
|
16
18
|
|
|
17
|
-
- The page or component
|
|
18
|
-
- What you were trying to do.
|
|
19
|
-
-
|
|
19
|
+
- **The page or component,** with a link.
|
|
20
|
+
- **What you were trying to do,** and in which product.
|
|
21
|
+
- **What happened,** with a screenshot if something looks wrong.
|
|
22
|
+
|
|
23
|
+
## Proposing a change
|
|
24
|
+
|
|
25
|
+
A good proposal starts from a real problem, not from a solution. Tell us:
|
|
26
|
+
|
|
27
|
+
- **The problem:** what you can't do with the system as it is.
|
|
28
|
+
- **Where it happens:** the screens or products, with links or screenshots.
|
|
29
|
+
- **What you tried:** the tokens or components you looked at, and why they don't fit.
|
|
30
|
+
|
|
31
|
+
The team checks each proposal against the rest of the system. Changes to the system are announced in [News](/news/).
|
|
32
|
+
|
|
33
|
+
## Related
|
|
34
|
+
|
|
35
|
+
- [Release phases](/release-phases/): how stable each page and component is.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Get started
|
|
3
|
-
description:
|
|
3
|
+
description: "Design, build and write Beehexa products that look and work as one. Pick your role and start here."
|
|
4
4
|
order: 0
|
|
5
5
|
sidebarLabel: Overview
|
|
6
6
|
audience: Designers, developers, writers
|
|
@@ -10,12 +10,9 @@ import SystemAreas from '../../components/SystemAreas.astro';
|
|
|
10
10
|
import PhaseTable from '../../components/PhaseTable.astro';
|
|
11
11
|
import HelpOptions from '../../components/HelpOptions.astro';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
<p class="callout-title">Working proposal</p>
|
|
15
|
-
<p>Token values and the component catalog are not final. Check the [release phase](/release-phases/) of anything before you rely on it.</p>
|
|
16
|
-
</div>
|
|
13
|
+
A merchant checks last night's orders in HexaSync, fixes a mapping, then opens another Beehexa product to look at stock. The buttons, the colours and the words are the same in both, so nothing has to be learned twice. That is what the Beehexa Design System is for.
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
It is the shared language for every Beehexa web product: the design tokens, guidelines and components that designers, developers and writers build from, all documented on this site.
|
|
19
16
|
|
|
20
17
|
## Pick your guide
|
|
21
18
|
|
|
@@ -27,24 +24,26 @@ The Beehexa Design System is the shared language for every Beehexa web product.
|
|
|
27
24
|
|
|
28
25
|
## Your first change
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
Replace a raw value with a token. Tokens are CSS custom properties with the `--bh-` prefix, named for their job:
|
|
31
28
|
|
|
32
29
|
```css
|
|
33
30
|
.panel {
|
|
34
|
-
padding: var(--bh-space-
|
|
31
|
+
padding: var(--bh-space-card);
|
|
35
32
|
border: var(--bh-border-width-default) solid var(--bh-color-border);
|
|
36
|
-
border-radius: var(--bh-radius-
|
|
33
|
+
border-radius: var(--bh-radius-card);
|
|
37
34
|
}
|
|
38
35
|
```
|
|
39
36
|
|
|
40
|
-
|
|
37
|
+
Read [Tokens overview](/foundations/tokens/) to learn how tokens are named and which one to choose.
|
|
41
38
|
|
|
42
|
-
##
|
|
39
|
+
## How stable things are
|
|
43
40
|
|
|
44
|
-
Every page and component shows how
|
|
41
|
+
Every page and component shows its release phase, so you know how far you can rely on it.
|
|
45
42
|
|
|
46
43
|
<PhaseTable />
|
|
47
44
|
|
|
45
|
+
See [Release phases](/release-phases/) for what each phase promises.
|
|
46
|
+
|
|
48
47
|
## Get help
|
|
49
48
|
|
|
50
49
|
<HelpOptions />
|