@beehexa/design-tokens 0.0.0-stage → 2611.3.2
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 +41 -2
- package/dist/dtcg/border.json +26 -0
- package/dist/dtcg/breakpoints.json +8 -0
- package/dist/dtcg/color.json +1350 -0
- package/dist/dtcg/elevation.json +26 -0
- package/dist/dtcg/layout.json +29 -0
- package/dist/dtcg/motion.json +12 -0
- package/dist/dtcg/radius.json +44 -0
- package/dist/dtcg/size.json +13 -0
- package/dist/dtcg/spacing.json +18 -0
- package/dist/dtcg/states.json +12 -0
- package/dist/dtcg/typography.json +220 -0
- package/dist/index.d.ts +4280 -0
- package/dist/index.js +4278 -0
- package/dist/tokens.css +461 -0
- package/dist/tokens.pixels.css +461 -0
- package/package.json +34 -4
package/README.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @beehexa/design-tokens
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Source-checkout development package (`0.0.0`, `private: true`), not a registry release number. Managers must authorize a release before the GitHub runner stamps the real version. CI stages checked tarballs; npm maintainer approval with 2FA is required before publication.
|
|
4
|
+
|
|
5
|
+
## Use the installed package
|
|
6
|
+
|
|
7
|
+
Build in the beehexa.design source checkout with `npm ci && npm run build:packages`. Until release approval, consumers install a local reference to `packages/design-tokens` (for example Yarn `portal:../beehexa.design/packages/design-tokens`). Do not copy generated CSS/JavaScript into a product, use a Vite source alias, or fetch rendered website HTML.
|
|
8
|
+
|
|
9
|
+
Local references are **local-development only**. Consumer CI requires actual released npm versions and must never check out sibling repositories or build from sibling paths. Producer CI stays single-repository. Do not release, deploy, or execute CI as a prerequisite for local work; an unavailable approved npm release is not permission to add a cross-repository CI fallback.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import '@beehexa/design-tokens/css';
|
|
13
|
+
import { tokens, tokenInfo } from '@beehexa/design-tokens';
|
|
14
|
+
|
|
15
|
+
const text = tokens.light['color.text'];
|
|
16
|
+
const darkText = tokens.dark['color.text'] ?? text;
|
|
17
|
+
const description = tokenInfo['color.text'].description;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import type { TokenName } from '@beehexa/design-tokens';
|
|
22
|
+
const spacing: TokenName = 'space.200';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- `tokens.light` contains every token with references recursively resolved.
|
|
26
|
+
- `tokens.dark` and `tokens.vi` contain only values differing from light, including indirect changes through aliases. Vietnamese deltas are resolved against the Vietnamese graph, not just the base targets. These are independent mode deltas; there is no exported combined dark+Vietnamese object. Do not assume arbitrary delta merging models overlapping future mode overrides; use the CSS cascade for combined presentation.
|
|
27
|
+
- `tokenInfo` is keyed by the same token names. It contains `name`, `path`, `type`, `description`, raw alias-bearing `value`, optional source `dark`/`vi` extensions, `cssVar`, and fully resolved `resolved`/`darkResolved`/`viResolved`. These descriptions explain individual decisions; they are not a replacement for the complete usage rules in `@beehexa/design-rules`.
|
|
28
|
+
- Generated declarations preserve literal token keys and values. `TokenName` is `keyof typeof tokens.light`; a misspelled key is not widened into `Record<string, string>`.
|
|
29
|
+
- `@beehexa/design-tokens/css` retains native `rem`. It defines `--bh-*` on `:root`, honors explicit `data-theme="light"`/`"dark"`, uses system dark preference only without an explicit light selection, and applies Vietnamese typography via `:lang(vi)` with resets on other explicit languages. It does not set the application's root font size.
|
|
30
|
+
- `@beehexa/design-tokens/css/pixels` uses the identical generator and selectors, converting every `rem` literal to pixels at **16 px per rem**, including compound values. Import this instead of, not alongside, native CSS when integrating the dashboard's current 14px root. This compatibility choice is migration debt, not a 14px design-scale exemption or permission to change token values.
|
|
31
|
+
- `@beehexa/design-tokens/dtcg/color.json` (and every other original `tokens/*.json`) exposes the unchanged source data.
|
|
32
|
+
- `@beehexa/design-tokens/package.json` exposes installed origin/version metadata.
|
|
33
|
+
|
|
34
|
+
## Source authority and limits
|
|
35
|
+
|
|
36
|
+
`beehexa.design/tokens/*.json` is the only token source. `scripts/token-utils.mjs` owns flattening, CSS naming, mode-aware graph resolution, and CSS generation; the website and package builders share it. Builds reject duplicate token/CSS names, unknown references, and cycles in light, dark, Vietnamese, and combined dark+Vietnamese graphs. The generated outputs are not another editable source.
|
|
37
|
+
|
|
38
|
+
Usage choices remain governed by the complete installed rule documents, including accessibility, interaction state, layout, responsive and locale rules. Use semantic role tokens rather than palette primitives where the source defines a role. There are no product/dashboard exemptions. Planned or missing source guidance must be reported upstream instead of invented downstream. The source design system is still a working proposal; the existence of a token or metadata description does not imply its component guidance is complete or GA.
|
|
39
|
+
|
|
40
|
+
## Producer commands
|
|
41
|
+
|
|
42
|
+
From the source root: `npm run build:packages`, `npm run check:packages`, `npm run pack:packages`. Workspace `npm run build -w @beehexa/design-tokens` builds just this package; `prepack` also builds real artifacts before packing. Package checks need only this producer repository, never a dashboard checkout. Distribution includes ESM, declarations, both CSS variants, unchanged DTCG files and this README.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"border": {
|
|
3
|
+
"width": {
|
|
4
|
+
"default": {
|
|
5
|
+
"$type": "dimension",
|
|
6
|
+
"$value": "1px",
|
|
7
|
+
"$description": "1 px. Inputs, secondary buttons, cards, tables and dividers."
|
|
8
|
+
},
|
|
9
|
+
"selected": {
|
|
10
|
+
"$type": "dimension",
|
|
11
|
+
"$value": "2px",
|
|
12
|
+
"$description": "2 px. The bar under a selected tab or beside a selected side navigation item, and the edge of a selected card. Pair with color.border.selected."
|
|
13
|
+
},
|
|
14
|
+
"focused": {
|
|
15
|
+
"$type": "dimension",
|
|
16
|
+
"$value": "2px",
|
|
17
|
+
"$description": "2 px. The focus ring. Pair with color.border.focus and state.focus.offset."
|
|
18
|
+
},
|
|
19
|
+
"accent": {
|
|
20
|
+
"$type": "dimension",
|
|
21
|
+
"$value": "4px",
|
|
22
|
+
"$description": "4 px. A status or emphasis bar on one edge: alerts, banners, rows with an error, callouts and quotes. Pair with a status or brand border colour."
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"breakpoint": {
|
|
3
|
+
"xs": { "$type": "dimension", "$value": "0px", "$description": "Phones and small windows, below 768 px. One fluid layout: 4 columns, gutter and margin 16 px, side navigation in a drawer. Must work down to 320 px." },
|
|
4
|
+
"md": { "$type": "dimension", "$value": "768px", "$description": "Tablets and narrow windows. 8 columns, gutter and margin 24 px. Side navigation still in a drawer." },
|
|
5
|
+
"lg": { "$type": "dimension", "$value": "1024px", "$description": "Laptops from 1024 px, including 1280 and 1366 px screens. 12 columns. Side navigation open at 280 px; people can collapse it to the 64 px rail." },
|
|
6
|
+
"xl": { "$type": "dimension", "$value": "1440px", "$description": "Desktops, including 1536 and 1920 px screens. Page margin 32 px." }
|
|
7
|
+
}
|
|
8
|
+
}
|