@apollion-dsi/tokens 4.9.1 → 4.10.0

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.
Files changed (3) hide show
  1. package/README.md +10 -18
  2. package/package.json +4 -9
  3. package/CHANGELOG.md +0 -162
package/README.md CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  Framework-agnostic design tokens for Apollion Design System v4+.
4
4
 
5
- **Status:** ✅ **GA desde 4.2.0** — v4 epic shipped 2026-05-25 (ADR-006). Atual **4.7.0**, lockstep com `@apollion-dsi/core@4.7.0`.
5
+ [![npm](https://img.shields.io/npm/v/@apollion-dsi/tokens.svg)](https://www.npmjs.com/package/@apollion-dsi/tokens)
6
+
7
+ **Status:** ✅ GA since 4.2.0 (v4). Versioned in lockstep with `@apollion-dsi/core`.
6
8
 
7
9
  ## Versioned API
8
10
 
9
11
  Single public entry: `@apollion-dsi/tokens/runtime/v1`.
10
12
 
11
- Future major surface changes go to `runtime/v2`, `runtime/v3`, etc. — `v1` is preserved indefinitely (Strangler Fig per ADR-006 §3.3).
13
+ Future major surface changes go to `runtime/v2`, `runtime/v3`, etc. — `v1` is preserved indefinitely (Strangler Fig).
12
14
 
13
15
  ```ts
14
16
  import { TOKENS_RUNTIME_API_VERSION } from '@apollion-dsi/tokens/runtime/v1';
@@ -30,26 +32,16 @@ Tokens em JSON estruturado — values are **structured objects**, not shorthand
30
32
 
31
33
  ## Coupling to `@apollion-dsi/core`
32
34
 
33
- Hard rule per ADR-006 §3.1:
35
+ Hard rule:
34
36
 
35
37
  - `core` declares `@apollion-dsi/tokens` in `optionalDependencies` (NOT `dependencies`).
36
38
  - Consumer that does not opt into `apollion.config.mjs#output.runtime: true` never installs tokens.
37
- - Lockstep version enforced via `.changeset/config.json#fixed` array from `4.0.0` (PRD-002 §S7).
39
+ - Lockstep version enforced via the `.changeset/config.json#fixed` array from `4.0.0`.
38
40
 
39
- ## Slicing (ADR-006 §6)
41
+ ## Documentation
40
42
 
41
- | Slice | Status | Deliverable |
42
- | ------------------------------------ | ---------- | ------------------------------------------------- |
43
- | S1 — scaffold + versioned API | ✅ shipped | `runtime/v1` namespace, esbuild ESM/CJS dual emit |
44
- | S2 — culori vendor + OKLch lerp | ✅ shipped | `vendors/Culori` in core; OKLch palette |
45
- | S3 — Dimension axis | ✅ shipped | `compact/normal/spacious` multipliers |
46
- | S4 — Foundation/Surface builders | ✅ shipped | Strangler Fig parity with core |
47
- | S5 — atomic+idempotent build CLI | ✅ shipped | `apollion-tokens build` + `dist/manifest.json` |
48
- | S6 — Config-First + sandboxed loader | ✅ shipped | `apollion.config.mjs` + zod schema |
49
- | S7 — release `4.0.0` | ✅ shipped | lockstep changesets with core |
43
+ Official docs: <https://www.apollion.com.br>
50
44
 
51
- ## Refs
45
+ ## License
52
46
 
53
- - [ADR-006 — v4 epic](../core/docs/adr/ADR-006-v4-oklch-dimension-token-split.md)
54
- - [PRD-002 — v4 epic execution](../core/docs/prd/PRD-002-v4-epic-execution.md)
55
- - [`packages/core/docs/v4-baseline-review.md`](../core/docs/v4-baseline-review.md)
47
+ MIT.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@apollion-dsi/tokens",
3
- "version": "4.9.1",
3
+ "version": "4.10.0",
4
4
  "description": "Apollion Design System — Framework-agnostic design tokens",
5
- "homepage": "https://github.com/apollion-ds/apollion",
5
+ "homepage": "https://www.apollion.com.br",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "lib/runtime/v1.cjs",
@@ -44,11 +44,6 @@
44
44
  "lib",
45
45
  "src"
46
46
  ],
47
- "repository": {
48
- "type": "git",
49
- "url": "https://github.com/fedbalves/apollion-ds.git",
50
- "directory": "packages/tokens"
51
- },
52
47
  "scripts": {
53
48
  "build": "node ./esbuild.cjs && tsc --emitDeclarationOnly",
54
49
  "check-types": "tsc --noEmit",
@@ -70,7 +65,7 @@
70
65
  "zod": "4.4.3"
71
66
  },
72
67
  "devDependencies": {
73
- "@apollion-dsi/core": "4.9.1",
68
+ "@apollion-dsi/core": "workspace:*",
74
69
  "@apollion-dsi/eslint-config": "0.8.0",
75
70
  "@types/culori": "4.0.1",
76
71
  "@types/jest": "30.0.0",
@@ -82,4 +77,4 @@
82
77
  "ts-jest": "^29.4.11",
83
78
  "typescript": "6.0.3"
84
79
  }
85
- }
80
+ }
package/CHANGELOG.md DELETED
@@ -1,162 +0,0 @@
1
- # @apollion-dsi/tokens
2
-
3
- ## 4.9.1
4
-
5
- ## 4.9.0
6
-
7
- ## 4.8.0
8
-
9
- ## 4.7.0
10
-
11
- ## 4.6.3
12
-
13
- ## 4.6.2
14
-
15
- ## 4.6.1
16
-
17
- ## 4.6.0
18
-
19
- ## 4.5.1
20
-
21
- ## 4.5.0
22
-
23
- ### Minor Changes
24
-
25
- - 1ebb3e3: Typography joins the `dimension` density axis — fixed root + `rem` scale (ADR-011)
26
- - **Fixed root:** `GlobalStyle` emits `html { font-size: 100% }` (16px) instead of
27
- the fluid `clamp(16px, 1vw + 12px, 28px)`. Product UI keeps stable reading
28
- density on ultrawide/4K — large screens gain columns/space, not inflated text.
29
- - **`createFont(input, dimension)`** mirrors `createSpacing`: the same
30
- `<ApollionProvider dimension>` knob (multipliers `0.20 / 0.25 / 0.32`) now
31
- drives type size, so spacing and typography scale together. `normal` is 1:1
32
- with the previous px scale (`small` 16px → `1rem`).
33
- - **Breaking (type):** `theme.font.fontSize.*` changed `number` → `string` (CSS
34
- `rem`). Additive `theme.font.fontSizePx.*` carries the effective px for layout
35
- math (e.g. `height = fontSizePx.small * ratio`). Style code that concatenated a
36
- manual `px` suffix (`` `${theme.font.fontSize.small}px` ``) must drop it.
37
- - **Tokens:** font left the axis-invariant `base` set — it is now emitted per
38
- dimension as `font.<dimension>` sets (symmetric with `spacing.<dimension>`),
39
- with `font.size.*` carrying the resolved `rem` value for that density.
40
-
41
- ## 4.4.0
42
-
43
- ### Patch Changes
44
-
45
- - 9e32c3b: fix(build): emit `.d.ts` by inlining `tsc --emitDeclarationOnly` into `build`.
46
-
47
- Yarn Berry does not run `pre`/`post` lifecycle hooks, so the former `postbuild`
48
- step never executed and the package shipped without type declarations. Folded it
49
- into `build` so the published `@apollion-dsi/tokens` includes its types.
50
-
51
- ## 4.3.1
52
-
53
- ## 4.3.0
54
-
55
- ## 4.2.0
56
-
57
- ### Minor Changes
58
-
59
- - 12ae4e0: feat(tokens): DTCG 2025.10 remainders — dimension references, per-token metadata, and Resolver (R5)
60
- - **Spacing + composite sub-value references**: `spacing` and `border.width`
61
- now reference primitive scales (`{space.*}`, `{border-width.*}`) instead of
62
- inlining literals. The `space` primitives are built per density via
63
- `createSpacing`, so references resolve correctly under compact/normal/spacious.
64
- - **`$deprecated` + `$description` per token**: populated from a `TOKEN_META`
65
- registry through the IR into the JSON output (a stale-key guard fails the
66
- build if a meta entry points at a non-existent token).
67
- - **DTCG Resolver (R5)**: the JSON surface now emits a single `resolver.json`
68
- plus composable `sets/` (axis-invariant `base` + per-axis colour/spacing sets)
69
- instead of one fully-resolved document per variant — a hard cutover, made
70
- pre-GA. A composition-equivalence test proves `base + colour + spacing`
71
- reproduces the old per-variant document exactly. The CSS and TS surfaces are
72
- unchanged: still per-variant, fully resolved, byte-identical.
73
-
74
- ## 4.1.0
75
-
76
- ### Minor Changes
77
-
78
- - 063e0e9: Align `@apollion-dsi/tokens` DTCG output with the Design Tokens Format Module 2025.10.
79
- - **Structured values:** `color` `$value` is now an OKLch object `{ colorSpace, components, hex, alpha? }` and `dimension` is `{ value, unit }` (was bare hex / length strings).
80
- - **Typed IR:** a single intermediate representation (`src/ir.ts`) drives the JSON/CSS/TS renderers as pure projections.
81
- - **Reference graph:** JSON emits a `color` primitives layer (structural SSOT) and foundation `bg`/`text` colours reference it via DTCG aliases (`{color.primary.base}`), with inline fallback when a resolved value diverges (e.g. surface inversion).
82
- - **Composite tokens:** `border` (dimension / strokeStyle), `typography` (fontFamily / fontWeight / number + dimension) and `shadow` (DTCG shadow composite) now ship; values DTCG cannot model (em `letterSpacing`, `textTransform`, `fontStyle`, `100%` radius) travel in `$extensions` under `com.apollion.*`.
83
-
84
- `@apollion-dsi/core` now exports the `themes/{border,depth,font}` subpaths so tokens consumes them as the single source of truth.
85
-
86
- CSS/TS outputs for the existing `bg`/`text`/`spacing` layers are byte-identical; JSON is the spec-interop surface.
87
-
88
- ## 4.0.0
89
-
90
- ### Major Changes
91
-
92
- - bd7d6cb: # v4.0.0 — OKLch + Dimension + Token Split
93
-
94
- The v4 epic per [ADR-006](../packages/core/docs/adr/ADR-006-v4-oklch-dimension-token-split.md) + [PRD-002](../packages/core/docs/prd/PRD-002-v4-epic-execution.md). DS-from-scratch (Q-G grilling 2026-05-24); no consumer migration. Greenfield adoption via [MIGRATION-v4.md](../packages/core/docs/migration/MIGRATION-v4.md).
95
-
96
- ## Breaking — `@apollion-dsi/core@4.0.0`
97
- - **Root barrel removed.** `import { Button } from '@apollion-dsi/core'` no longer works. Use granular subpaths (`@apollion-dsi/core/elements/button`). ESLint rule flips warn → error. ADR-001 Slice 6 finalized here. ADR-006 §3.7 E7.
98
- - **OKLch palette derivation.** All `mount*Colors` helpers + `getOppositeColor` migrated from `color@5` RGB lerp to `culori@4` OKLch lerp. Validated by `spike/culori-oklch-lerp-parity` (0 unexpected regressions; greyscale 19× more uniform in OKLAB L). ADR-006 §2 B1 + §6 S2.
99
- - **`defaultInputColors.opposite` token value changed.** OKLch hue rotation differs from HSL rotation (the OKLch is the perceptually correct opposite). Audit `theme.colors.opposite.*` consumers.
100
- - **Dimension axis added.** `<ApollionProvider dimension="compact|normal|spacious">` is a new prop; default `normal` preserves v3.x spacing byte-exact. ADR-006 §6 S3.
101
- - **`vendors/Color` eliminated.** Internal `color@5` vendor deleted (zero call-sites after S6 migration). `color` + `@types/color` removed from `package.json#dependencies`. WCAG functions migrated to `culori.wcagContrast` + `culori.wcagLuminance` (100% bit-exact parity per `spike/culori-wcag-parity`).
102
- - **`invertForSurface(theme, surface, mode)` 3-arg signature.** `mode` is additive optional — existing 2-arg calls continue to work; `mode` is a placeholder for future PRD-003 mode-aware inversion. ADR-006 §6 S6.
103
-
104
- ## Minor — `@apollion-dsi/eslint-config`
105
- - `culori` + `zod` added to `VENDORED_V4_LIBS` — must import via `vendors/Culori|Zod`.
106
- - `color` removed from `VENDORED_T2_LIBS` (eliminated).
107
- - `no-restricted-imports` for `'@apollion-dsi/core'` root: `warn` → `error` (per v4 barrel removal above).
108
-
109
- ## Major — `@apollion-dsi/tokens@4.0.0` (first release)
110
-
111
- New package — framework-agnostic design tokens consumed via `runtime/v1` versioned API + `apollion-tokens build` CLI.
112
- - **Strangler Fig builders** duplicated from core (`colors.ts`, `spacing.ts`); Foundation + Surface re-exported. Parity enforced by `__tests__/parity.test.ts`. ADR-006 §3.1 + §6 S4.
113
- - **Atomic + idempotent build CLI.** `apollion-tokens build [--check] [--verbose] --config <path> [--out <dir>]`. Emits `dist/{css,json,ts}/*` + `dist/manifest.json` with sha256 audit trail. Rerun byte-identical. `--check` mode for CI gate. ADR-006 §3.5 + §6 S5.
114
- - **DTCG-compliant JSON output** (tech-radar R1).
115
- - **`as const` TypeScript output** (tech-radar R4).
116
- - **CSS `@property` declarations** (tech-radar R3) + custom properties `--apollion-{layer}-{role}-{variant}`.
117
- - **Sandboxed `apollion.config.mjs` loader** (`node:vm` + zod schema) — threat-model T2+E1 mitigation. ADR-006 §3.8 B3 + §6 S6.
118
- - **Lockstep version** with `@apollion-dsi/core` via `.changeset/config.json#fixed`.
119
-
120
- ## Minor — `@apollion-dsi/scripts`
121
- - `codemods/v4-migrate.mjs` — one-way codemod (Q-G10: no `--revert`; DEX/Jovian/Fanaticofc don't consume v3.x, no legacy to revert). Transforms `invertForSurface` to 3-arg, flags `createTheme` for manual hoist to `apollion.config.mjs`. Transcript JSONL audit log.
122
- - `verify-no-install-scripts.js` — supply-chain hardening; blocks `preinstall`/`install`/`postinstall` in `@apollion-dsi/*` workspaces (threat-model E2 mitigation).
123
-
124
- ## Spike validation (preserved local, NOT merged to main)
125
- - `spike/culori-wcag-parity` — 100.0000% bit-exact culori vs color@5 (262 measurements / 10 palettes). `vendors/Color` elimination LOCKED.
126
- - `spike/culori-oklch-lerp-parity` — 0 unexpected regressions in 68 deltas; greyscale ramp 19× more uniform in OKLAB L. DECISION ✅ PROCEED.
127
-
128
- ### Patch Changes
129
-
130
- - Updated dependencies [032f81c]
131
- - Updated dependencies [32f7a1d]
132
- - Updated dependencies [2dadba5]
133
- - Updated dependencies [820a612]
134
- - Updated dependencies [c056ee3]
135
- - Updated dependencies [d032437]
136
- - Updated dependencies [00e0525]
137
- - Updated dependencies [1c87be8]
138
- - Updated dependencies [d1192da]
139
- - Updated dependencies [3194fba]
140
- - Updated dependencies [f359982]
141
- - Updated dependencies [5d17ebc]
142
- - Updated dependencies [bd7d6cb]
143
- - Updated dependencies [6545751]
144
- - Updated dependencies [36eaf4a]
145
- - Updated dependencies [802828f]
146
- - Updated dependencies [e14469c]
147
- - Updated dependencies [81cd55b]
148
- - Updated dependencies [c57c548]
149
- - Updated dependencies [879eedd]
150
- - Updated dependencies [e2abc9c]
151
- - Updated dependencies [75961a1]
152
- - Updated dependencies [e55019a]
153
- - Updated dependencies [fba9a41]
154
- - Updated dependencies [3a90653]
155
- - Updated dependencies [5fca933]
156
- - Updated dependencies [ea3dc3a]
157
- - Updated dependencies [51f71f6]
158
- - Updated dependencies [0a1baeb]
159
- - Updated dependencies [6d1371e]
160
- - Updated dependencies [e55019a]
161
- - Updated dependencies [29081ae]
162
- - @apollion-dsi/core@4.0.0