@alien6-studio/elea-tokens 0.1.2 → 0.1.4
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 +86 -5
- package/dist/dtcg/2025.10/elea.dark.tokens.json +1349 -0
- package/dist/dtcg/2025.10/elea.tokens.json +1367 -0
- package/dist/editions.css +6 -0
- package/dist/elea.css +24 -0
- package/dist/package.json +89 -0
- package/dist/src/brand.d.ts.map +1 -1
- package/dist/src/brand.js +30 -16
- package/dist/src/brand.js.map +1 -1
- package/dist/src/contrast.d.ts +3 -0
- package/dist/src/contrast.d.ts.map +1 -0
- package/dist/src/contrast.js +16 -0
- package/dist/src/contrast.js.map +1 -0
- package/dist/src/dtcg.d.ts +2 -2
- package/dist/src/dtcg.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/qualification.d.ts +26 -0
- package/dist/src/qualification.d.ts.map +1 -0
- package/dist/src/qualification.js +40 -0
- package/dist/src/qualification.js.map +1 -0
- package/dist/tokens/elea.tokens.json +8 -0
- package/package.json +13 -3
- package/tokens/elea.tokens.json +8 -0
- package/typography.css +33 -0
package/README.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# @alien6-studio/elea-tokens
|
|
2
2
|
|
|
3
|
-
Design tokens
|
|
4
|
-
JSON file; the package resolves its aliases and emits every form a project needs.
|
|
3
|
+
Design tokens for ELEA, available as CSS, JavaScript and DTCG 2025.10 interchange files.
|
|
5
4
|
|
|
6
5
|
The JavaScript entry points are ES modules. For Jest with `next/jest`, add `@alien6-studio/elea-tokens` to `transpilePackages` when testing a JavaScript import such as `@alien6-studio/elea-tokens/brand`.
|
|
7
6
|
|
|
8
7
|
## What you get
|
|
9
8
|
|
|
10
|
-
- `
|
|
11
|
-
|
|
9
|
+
- `dtcg/2025.10/elea.tokens.json` and `dtcg/2025.10/elea.dark.tokens.json` each contain a complete theme for external design-token tools.
|
|
10
|
+
- `tokens/elea.tokens.json` and `tokens/elea.dark.tokens.json` expose ELEA's original CSS-oriented JSON. The second file contains only overrides and refers back to the first. Existing integrations can keep using these paths.
|
|
12
11
|
- `elea.css`: the runtime stylesheet. Every token is a custom property on `:root`
|
|
13
12
|
(`--elea-color-text-default`, `--elea-space-4`, `--elea-radius-lg`,
|
|
14
13
|
`--elea-motion-duration-base`, `--elea-motion-easing-standard`...); the dark overrides apply
|
|
@@ -27,6 +26,35 @@ The JavaScript entry points are ES modules. For Jest with `next/jest`, add `@ali
|
|
|
27
26
|
produce all of the above (`toStylesheet`, `toTailwindTheme`, `toTailwindPreset`,
|
|
28
27
|
`toShadcnAliases`, `toShadcnPreset`) for custom themes.
|
|
29
28
|
|
|
29
|
+
## DTCG 2025.10 interchange
|
|
30
|
+
|
|
31
|
+
Choose one document as the input to your tool. Dimensions carry a number and a unit, colors carry sRGB components and alpha, and each shadow layer has its own offsets, blur, spread and color. Aliases retain their named targets so editing a primitive updates the roles that reference it. Both exports target the [DTCG Format](https://www.designtokens.org/tr/2025.10/format/) and [Color](https://www.designtokens.org/tr/2025.10/color/) modules for October 2025.
|
|
32
|
+
|
|
33
|
+
These export paths were added in 0.1.3. To reproduce the check, use Node.js 22 or later at the root of a checkout.
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npm ci
|
|
37
|
+
npm run export:dtcg -w packages/tokens
|
|
38
|
+
npm run test:dtcg
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`export:dtcg` writes both JSON files to `packages/tokens/dist/dtcg/2025.10/`. The test installs Style Dictionary 5.8.0 from the example's lockfile, reads the package exports and writes `light.css` and `dark.css` under `artifacts/examples/dtcg/`. It compares every token path, type, computed CSS value and alias target with the source. For example, the `100ms` duration becomes the equivalent `0.1s`, and both layers of `shadow.md` retain their negative spreads.
|
|
42
|
+
|
|
43
|
+
In the generated light CSS, two declarations show how a primary swatch reaches a button. The example changes that swatch and verifies that both roles take its new color. [Runnable example](../../docs/examples/dtcg/qualify.test.mjs)
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
--color-info: var(--color-primary-600);
|
|
47
|
+
--color-action-info: var(--color-info);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The following command uses `uvx` to validate both files against the pinned JSON Schema.
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
uvx --from check-jsonschema==0.39.0 check-jsonschema \
|
|
54
|
+
--schemafile https://www.designtokens.org/schemas/2025.10/format.json \
|
|
55
|
+
packages/tokens/dist/dtcg/2025.10/*.tokens.json
|
|
56
|
+
```
|
|
57
|
+
|
|
30
58
|
## Use
|
|
31
59
|
|
|
32
60
|
```css
|
|
@@ -93,6 +121,16 @@ The chart and sidebar variables have no Elea counterpart and stay yours. An alia
|
|
|
93
121
|
where it is declared: `shadcn.css` covers the root, `data-theme` containers and the three
|
|
94
122
|
editions; for your own brand class, emit `toShadcnAliases(".journal")` next to its theme.
|
|
95
123
|
|
|
124
|
+
## Interface density
|
|
125
|
+
|
|
126
|
+
The runtime stylesheet includes three regional spacing profiles. Set
|
|
127
|
+
`data-elea-density="compact"` on a workspace, `"comfortable"` on a roomy
|
|
128
|
+
form or `"standard"` to reset an inner region. Each profile defines
|
|
129
|
+
`--elea-density-control-offset`, `--elea-density-field-gap`,
|
|
130
|
+
`--elea-density-action-gap` and `--elea-density-table-padding`.
|
|
131
|
+
The brand generator's `rhythm` still controls reading text. See the
|
|
132
|
+
[UI density example](../ui#regional-density).
|
|
133
|
+
|
|
96
134
|
## Local appearance
|
|
97
135
|
|
|
98
136
|
Set `data-elea-appearance="light"`, `"dark"` or `"auto"` on an HTML container
|
|
@@ -194,7 +232,8 @@ makeBrandTheme({ ...createThemeProfile("reserve"), buttonRadiusScale: "profile"
|
|
|
194
232
|
|
|
195
233
|
Small and medium scale each axis and cap to 50% and 75% of its original value.
|
|
196
234
|
Large uses the profile’s action shape. For a full capsule the smaller steps
|
|
197
|
-
scale from a maximum of 1.5em.
|
|
235
|
+
scale from a maximum of 1.5em. A silhouette below 0.25rem would put these steps
|
|
236
|
+
less than a pixel apart, so it keeps the uniform scale. To supply your own shapes, set
|
|
198
237
|
`--elea-button-radius-sm`, `--elea-button-radius-md` and `--elea-button-radius-lg`
|
|
199
238
|
as complete CSS corner values on your scope or Button.
|
|
200
239
|
|
|
@@ -274,3 +313,45 @@ the new values.
|
|
|
274
313
|
|
|
275
314
|
`color` (neutral, primary, secondary scales; success, warning, danger, info; semantic text, surface,
|
|
276
315
|
border, focus), `font` (family, size, weight, leading), `space`, `radius`, `shadow`, `size`.
|
|
316
|
+
|
|
317
|
+
## Interface typography
|
|
318
|
+
|
|
319
|
+
Import `@alien6-studio/elea-tokens/elea.css` and `@alien6-studio/elea-tokens/typography.css`.
|
|
320
|
+
Set `data-elea-type` on the element that renders the text. Choose its HTML heading level separately.
|
|
321
|
+
The following are the defaults at a 16px root. A scoped reading theme supplies its own body family, size, leading and measure.
|
|
322
|
+
|
|
323
|
+
| Role | Use | Size / weight | Line height | Tracking | Maximum measure |
|
|
324
|
+
| --- | --- | --- | --- | --- | --- |
|
|
325
|
+
| `display` | Opening headline | 48px / 600 | 1.05 | −.045em | 18ch |
|
|
326
|
+
| `page` | Page title | 36px / 700 | 1.1 | −.035em | 28ch |
|
|
327
|
+
| `section` | Section heading | 24px / 600 | 1.25 | −.02em | 38ch |
|
|
328
|
+
| `reading` | Body copy | 18px / 400 | 1.625 | Normal | Reading measure token |
|
|
329
|
+
| `label` | Field or action label | 14px / 500 | 1.5 | Normal | Container |
|
|
330
|
+
| `data` | Dates and numeric values | 14px / 500 | 1.5 | Normal | Column |
|
|
331
|
+
| `annotation` | Source or figure note | 12px / 400 | 1.5 | .01em | 56ch |
|
|
332
|
+
|
|
333
|
+
The data role requests lining, tabular figures. Align comparable amounts to the end of their column and format units, dates and currencies for the reader’s locale. Keep identifiers as strings to preserve leading zeroes.
|
|
334
|
+
|
|
335
|
+
## Qualify a theme
|
|
336
|
+
|
|
337
|
+
Import `qualifyTheme` and `compareThemeReports` from `@alien6-studio/elea-tokens/qualification`.
|
|
338
|
+
The Studio’s **Download contrast report** exports the same JSON. Each record includes the resolved foreground, background, full-precision contrast ratio, threshold and outcome. A complete named profile has 56 checks across seven roles, two appearances and four states. Unassigned roles are listed separately because they inherit their colours from the host.
|
|
339
|
+
|
|
340
|
+
From a source checkout, generate two reports and inspect the changes:
|
|
341
|
+
|
|
342
|
+
```sh
|
|
343
|
+
npm ci
|
|
344
|
+
npm run build:packages
|
|
345
|
+
node docs/examples/qualify-theme.mjs --profile reserve > reserve.json
|
|
346
|
+
node docs/examples/qualify-theme.mjs --profile braise --previous reserve.json > braise.json
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Pass `--theme path/to/brand.json` to use your own `BrandTheme`. A colour pair below 4.5:1 sets the command’s exit status to 1 and is included in the output. Diff entries are keyed by role, appearance and state, with the previous and current pair. The comparison lists changed theme settings, including typography and shape.
|
|
350
|
+
|
|
351
|
+
The colour report uses the [WCAG relative luminance calculation](https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html) on the generated sRGB values. Browser styles, host overrides, focus indicators, images and document accessibility require separate checks. The site’s Playwright `theme-proof.spec.ts` records actual button foregrounds and backgrounds at rest, on hover and on press, and field, button and row measurements at all three densities. Its declared matrix covers Réserve and Rasance in light and dark across Chromium, Firefox and WebKit. Each result identifies the engine, version, viewport and component states exercised. To deliver a combined report, supply matching Playwright files from that build. Repeat `--evidence` for additional configurations:
|
|
352
|
+
|
|
353
|
+
```sh
|
|
354
|
+
node docs/examples/qualify-theme.mjs --profile reserve --evidence path/to/theme-proof.json > qualified.json
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
The command checks the recorded profile configuration and tokens version, retains the original run metadata and returns a failing status for unsuccessful measurements. Use results from the same library and site revisions as your delivery.
|