@oneli8/tokens 1.0.0-beta.2 → 1.0.0-beta.3
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 +75 -69
- package/dist/figma/variables.json +3682 -0
- package/dist/status/components.json +158 -0
- package/dist/tailwind/preset.mjs +335 -0
- package/dist/tailwind/theme.css +303 -0
- package/dist/tokens.css +597 -0
- package/dist/tokens.d.ts +391 -0
- package/dist/tokens.js +387 -0
- package/package.json +43 -17
- package/src/tokens.json +1936 -0
- package/build/css/tokens.css +0 -840
- package/build/figma/variables.json +0 -7472
- package/build/manifest.json +0 -22
- package/build/status/components.json +0 -235
- package/build/tailwind/preset.mjs +0 -257
- package/build/tailwind/theme.css +0 -124
- package/build/typescript/index.d.ts +0 -10
- package/build/typescript/index.js +0 -6876
- package/schema/component-status.schema.json +0 -32
- package/schema/token-file.schema.json +0 -31
- package/scripts/build.mjs +0 -191
- package/scripts/test.mjs +0 -96
- package/src/component.json +0 -262
- package/src/primitive.json +0 -211
- package/src/semantic.json +0 -1299
- package/src/themes.json +0 -823
- package/status/components.json +0 -16
package/README.md
CHANGED
|
@@ -1,94 +1,100 @@
|
|
|
1
1
|
# @oneli8/tokens
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
files live in `src/`; everything under `build/` is generated.
|
|
5
|
-
|
|
6
|
-
## Build
|
|
3
|
+
OneLi8 Design System — design tokens compiled from Figma.
|
|
7
4
|
|
|
8
5
|
```sh
|
|
9
|
-
npm
|
|
10
|
-
npm test
|
|
6
|
+
npm install @oneli8/tokens
|
|
11
7
|
```
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
registry is not proof that those components are included in a scoped distribution.
|
|
9
|
+
```js
|
|
10
|
+
import '@oneli8/tokens/css'; // :root custom properties + .ol8-type-* classes
|
|
11
|
+
import { tokens } from '@oneli8/tokens'; // flat { 'color-text-primary': '#151817', ... }
|
|
12
|
+
```
|
|
18
13
|
|
|
19
|
-
|
|
14
|
+
Every value is generated from `src/tokens.json`, which is verified against the
|
|
15
|
+
Figma file rather than hand-maintained. Do not edit `dist/` — edit the source and
|
|
16
|
+
rebuild.
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
- TypeScript/JavaScript: `@oneli8/tokens`
|
|
23
|
-
- Tailwind CSS v3 preset: `@oneli8/tokens/tailwind`
|
|
24
|
-
- Tailwind CSS v4 theme bridge: `@oneli8/tokens/tailwind.css`
|
|
25
|
-
- Figma importer data: `@oneli8/tokens/figma`
|
|
26
|
-
- Component maturity registry: `@oneli8/tokens/status`
|
|
18
|
+
## What the vocabulary contains
|
|
27
19
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Semantic colors are exposed as utilities such as
|
|
32
|
-
`bg-ol8-background-canvas`, `text-ol8-text-primary`, and
|
|
33
|
-
`bg-ol8-action-primary-default`. Product interfaces should not assign
|
|
34
|
-
meaning with raw Candidate 03 palette steps.
|
|
20
|
+
99 colour primitives across 9 ramps, 68 semantic colour roles, 45 Gem material
|
|
21
|
+
roles, 27 control-material roles, a 3px-atomic dimension scale, 9 radii, 9
|
|
22
|
+
composite typography roles and 5 elevations.
|
|
35
23
|
|
|
36
|
-
|
|
24
|
+
Two rules matter when consuming it:
|
|
37
25
|
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
- **Use semantic roles, not primitives.** `color-blue-600` is a swatch;
|
|
27
|
+
`color-actionprimary-default` is a decision. Primitives are hidden from Figma
|
|
28
|
+
pickers for the same reason.
|
|
29
|
+
- **Use the `.ol8-type-<role>` class, not individual font variables.** Typography
|
|
30
|
+
is composite in Figma — a role bundles family, size, line height, weight and
|
|
31
|
+
tracking — and the class applies all of them together.
|
|
40
32
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
## Entry points
|
|
34
|
+
|
|
35
|
+
| Import | What it gives you |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `@oneli8/tokens` | flat `{ name: value }` map, with a literal-union key type |
|
|
38
|
+
| `@oneli8/tokens/css` | the custom properties and `.ol8-type-*` classes |
|
|
39
|
+
| `@oneli8/tokens/tailwind` | Tailwind v3 preset |
|
|
40
|
+
| `@oneli8/tokens/tailwind.css` | Tailwind v4 `@theme` bridge |
|
|
41
|
+
| `@oneli8/tokens/figma` | round-trip payload: collections, theme modes, type and elevation styles |
|
|
42
|
+
| `@oneli8/tokens/status` | component maturity records |
|
|
43
|
+
| `@oneli8/tokens/source` | the editable `tokens.json` |
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
// tailwind.config.js (v3)
|
|
47
|
+
import ol8 from '@oneli8/tokens/tailwind';
|
|
48
|
+
export default { presets: [ol8], content: ['./src/**/*'] };
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
```css
|
|
52
|
+
/* Tailwind v4 */
|
|
53
|
+
@import "@oneli8/tokens/css";
|
|
54
|
+
@import "@oneli8/tokens/tailwind.css";
|
|
55
|
+
```
|
|
50
56
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
Both adapters emit `var(--ol8-*)` references rather than resolved values, so
|
|
58
|
+
Tailwind classes follow the theme attributes exactly like the raw custom
|
|
59
|
+
properties do. `bg-ol8-actionprimary-default` repaints when you switch the
|
|
60
|
+
primary family; it does not bake a blue at build time.
|
|
54
61
|
|
|
55
|
-
|
|
62
|
+
The JS map is the exception: it holds resolved literals, because code that reads
|
|
63
|
+
it wants an actual colour, not a `var()` string.
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
for CSS, Tailwind, TypeScript, and Figma. Tailwind examples include
|
|
59
|
-
`shadow-ol8-raised`, `shadow-ol8-overlay`, and `z-ol8-modal`.
|
|
65
|
+
## Naming
|
|
60
66
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`
|
|
64
|
-
|
|
67
|
+
Hyphens separate hierarchy levels; compound words inside a level run together.
|
|
68
|
+
So `--ol8-focus-ring-innerwidth`, not `inner-width` — and likewise
|
|
69
|
+
`surfacedefault`, `disabledcontent`, `paddinginline`, `cutedge`,
|
|
70
|
+
`opaqueequivalent`. This mirrors the Figma variable names exactly.
|
|
65
71
|
|
|
66
|
-
|
|
72
|
+
## Theming
|
|
67
73
|
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
Three independent axes, each an attribute. They compose — set two at once and you
|
|
75
|
+
get both; there is no Cartesian product of pre-baked modes.
|
|
70
76
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
77
|
+
```html
|
|
78
|
+
<html data-ol8-color-scheme="dark" data-ol8-primary="orange">
|
|
74
79
|
```
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
| Attribute | Values | Effect |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| `data-ol8-color-scheme` | `dark` | Remaps 86 semantic roles onto dark primitives. Omit for light. |
|
|
84
|
+
| `data-ol8-primary` | `blue` (default), `orange`, `green` | Repoints the `color-primary-*` ramp at another family. |
|
|
77
85
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
Family swapping works because semantic roles are emitted as *references*
|
|
87
|
+
(`--ol8-color-actionprimary-default: var(--ol8-color-primary-600)`), never as
|
|
88
|
+
baked hex. Repoint the ramp and every role that reads it repaints. Anything you
|
|
89
|
+
author yourself should follow the same rule: reference the semantic role, not a
|
|
90
|
+
primitive, or your UI will not follow the theme.
|
|
91
|
+
|
|
92
|
+
Not yet ported from the Figma theme source: the `typographyViewport` axis
|
|
93
|
+
(`medium` / `expanded`), which needs `font.size.090`, `font.line.096` and a
|
|
94
|
+
`font.tracking.*` scale this tree has never synced; dark overrides for the five
|
|
95
|
+
`elevation-*` composites; and dark link-state and icon-button-surface roles,
|
|
96
|
+
which have no token in this vocabulary yet.
|
|
97
|
+
|
|
98
|
+
## Licence
|
|
83
99
|
|
|
84
|
-
|
|
85
|
-
Border, Focus, Typography, Motion, Candidate 03 Color, Semantic Light/Dark
|
|
86
|
-
color modes, Blue/Orange/Green Primary families, Elevation, stacking order,
|
|
87
|
-
approved Gem material geometry and colors, plus 125 approved Component geometry
|
|
88
|
-
recipes and ten evidence-backed maturity records. The Navigation slice adds
|
|
89
|
-
shared recipes for Tabs, Segmented Control, and Tab Bar without creating
|
|
90
|
-
component-private foundation scales.
|
|
91
|
-
|
|
92
|
-
Thin agent adapters live in `../agent/`. A browser example that consumes the
|
|
93
|
-
generated CSS, ESM tokens, and maturity registry without copying values lives
|
|
94
|
-
in `../../examples/web-token-consumer/`.
|
|
100
|
+
Apache-2.0. Created by Akshay Dhore. See `LICENSE` and `NOTICE`.
|