@apollion-dsi/tokens 5.1.0 → 5.2.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 (2) hide show
  1. package/package.json +3 -3
  2. package/CHANGELOG.md +0 -248
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollion-dsi/tokens",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Apollion Design System — Framework-agnostic design tokens",
5
5
  "homepage": "https://www.apollion.com.br",
6
6
  "license": "MIT",
@@ -65,7 +65,7 @@
65
65
  "zod": "4.4.3"
66
66
  },
67
67
  "devDependencies": {
68
- "@apollion-dsi/core": "5.1.0",
68
+ "@apollion-dsi/core": "workspace:*",
69
69
  "@apollion-dsi/eslint-config": "0.9.0",
70
70
  "@types/culori": "4.0.1",
71
71
  "@types/jest": "30.0.0",
@@ -77,4 +77,4 @@
77
77
  "ts-jest": "^29.4.11",
78
78
  "typescript": "6.0.3"
79
79
  }
80
- }
80
+ }
package/CHANGELOG.md DELETED
@@ -1,248 +0,0 @@
1
- # @apollion-dsi/tokens
2
-
3
- ## 5.1.0
4
-
5
- ## 5.0.0
6
-
7
- ## 4.12.1
8
-
9
- ## 4.12.0
10
-
11
- ### Minor Changes
12
-
13
- - a15d280: feat(themes): estados de interação mode-aware com piso perceptual nativo (`action`/`active`) — ADR-012
14
-
15
- `mountSingleColor` agora garante que hover (`action`) e pressed (`active`)
16
- sejam shifts **perceptíveis** contra o `base`, em qualquer tema: predicado
17
- duplo (razão de luminância WCAG ≥ 1.3x **ou** ΔL OKLch ≥ 0.05 — o JND onde a
18
- razão satura perto do preto). Temas já compliant saem **byte-idênticos** à
19
- derivação anterior (zero churn de baseline visual no light default e no dark
20
- invertido das docs); só temas que violam o piso ganham correção — o estado é
21
- re-derivado movendo apenas o L OKLch do `base` (hue/croma preservados), na
22
- direção do mode da superfície (inferido da luminância de `baseLight`:
23
- superfície escura clareia, clara escurece), com snap preto/branco como
24
- fallback do engine.
25
-
26
- Origem: feedback brasil_2030 — o `squadDarkTheme` ancora `deepDark`/`deepLight`
27
- em cinzas (legibilidade de card) e o hover do único CTA colapsava a 1.02x
28
- (`#2062CE` → `#2b64b9`, morto). Com o piso: `action #397be9` a **1.401x** +
29
- texto AA (5.18) via `getContrastColor`. `deep*` volta a ter função única
30
- (âncora das rampas neutral/greyscale — intocadas).
31
-
32
- Escape hatch por slot: `ColorsInput` aceita, além do seed string, uma paleta
33
- parcial explícita (`{ base, action?, active?, dark?, light? }` —
34
- `ColorPalleteOverrideInterface`); steps fornecidos passam verbatim, ausentes
35
- seguem o engine. Tokens espelha a lógica byte-a-byte (contrato Strangler Fig;
36
- suíte de parity estendida com o dark cinza-ancorado e o escape hatch).
37
-
38
- ## 4.11.0
39
-
40
- ### Minor Changes
41
-
42
- - bd17e17: feat(themes,tokens): camada nativa de texto legível por tema (plano contraste G2)
43
-
44
- **Core:** novo `createReadableTextLayer(colors, { surface?, minRatio? })` em
45
- `@apollion-dsi/core/themes/colors` — deriva, via `readableColor`, um ink AA
46
- por paleta nomeada (`main`…`information`, a partir do `base`) e por índice de
47
- texto da rampa neutra (`NEUTRAL_TEXT_INDICES`, ≥ 120), contra a superfície do
48
- tema (default `colors.neutral['10']`). Chame 1× por tema (light/dark) e emita
49
- onde precisar — substitui a reimplementação local do consumidor brasil_2030
50
- (`themeCssVars.ts` + helpers `txt()`/`ink()`, gap A1).
51
-
52
- **Tokens:** cada variante agora emite o grupo `tx.*`
53
- (`--apollion-tx-primary`, `--apollion-tx-neutral-140`, …) no CSS/TS/JSON,
54
- derivado pela mesma função do core. Quando o eixo `mode` ficar real (ADR-006
55
- E6/S6), os arquivos `.dark.*` passam a carregar inks escuros sem mudança de
56
- topologia. Matriz de aceite WCAG ≥ 4.5 coberta por testes nos dois pacotes.
57
-
58
- ## 4.10.0
59
-
60
- ### Patch Changes
61
-
62
- - 36c582b: feat(link,text): prose-link underline engine; quiet-link hover; honor `contrast`
63
- - `Text` now underlines any descendant `<a>` inside running text, so an inline
64
- link stays distinguishable by more than color (WCAG 1.4.1) regardless of the
65
- Link's own `textDecoration`. The container owns the rule — only it knows the
66
- content is prose. `Link.Button` opts out via `data-ds-link-button`.
67
- - `Link.Button` resets `text-decoration` (its native `<a>` base inherited the UA
68
- `underline`, unlike `Button`'s `<button>`). The `linked` variant still
69
- underlines on `:hover`/`:focus`.
70
- - `:hover` / `:focus-visible` restore `text-decoration: underline` when the
71
- consumer sets `textDecoration="none"` (chrome/nav quiet links) — a11y without
72
- looking like a button. Scoped to the quiet mode so the default emits no
73
- redundant rule.
74
- - Skip `readableColor(…, baseLight)` remapping when `contrast` is set: the ink
75
- is already the on-color of the declared surface. Remapping broke links on
76
- `main` bands (header/footer) that correctly used `contrast="main"`.
77
-
78
- - 93e718c: docs(readme): fix npm-facing links on published packages
79
- - Official-docs link now points to https://www.apollion.com.br (was a broken
80
- relative/Nextra link, and a GitHub `homepage` on a private repo).
81
- - Removed links to internal ADR/PRD/design docs that only exist in the private
82
- GitHub repo, plus broken relative source links (`docs/CONCEPTS.md`,
83
- `src/...`, migration guide).
84
- - `core`/`tokens` `homepage` → the docs site; dropped the private `repository`
85
- field so npm no longer shows a 404 link.
86
- - Fixed the stale hardcoded version in the `tokens` README (added the npm badge
87
- instead) and pruned internal slice/tracking sections not meant for consumers.
88
-
89
- ## 4.9.1
90
-
91
- ## 4.9.0
92
-
93
- ## 4.8.0
94
-
95
- ## 4.7.0
96
-
97
- ## 4.6.3
98
-
99
- ## 4.6.2
100
-
101
- ## 4.6.1
102
-
103
- ## 4.6.0
104
-
105
- ## 4.5.1
106
-
107
- ## 4.5.0
108
-
109
- ### Minor Changes
110
-
111
- - 1ebb3e3: Typography joins the `dimension` density axis — fixed root + `rem` scale (ADR-011)
112
- - **Fixed root:** `GlobalStyle` emits `html { font-size: 100% }` (16px) instead of
113
- the fluid `clamp(16px, 1vw + 12px, 28px)`. Product UI keeps stable reading
114
- density on ultrawide/4K — large screens gain columns/space, not inflated text.
115
- - **`createFont(input, dimension)`** mirrors `createSpacing`: the same
116
- `<ApollionProvider dimension>` knob (multipliers `0.20 / 0.25 / 0.32`) now
117
- drives type size, so spacing and typography scale together. `normal` is 1:1
118
- with the previous px scale (`small` 16px → `1rem`).
119
- - **Breaking (type):** `theme.font.fontSize.*` changed `number` → `string` (CSS
120
- `rem`). Additive `theme.font.fontSizePx.*` carries the effective px for layout
121
- math (e.g. `height = fontSizePx.small * ratio`). Style code that concatenated a
122
- manual `px` suffix (`` `${theme.font.fontSize.small}px` ``) must drop it.
123
- - **Tokens:** font left the axis-invariant `base` set — it is now emitted per
124
- dimension as `font.<dimension>` sets (symmetric with `spacing.<dimension>`),
125
- with `font.size.*` carrying the resolved `rem` value for that density.
126
-
127
- ## 4.4.0
128
-
129
- ### Patch Changes
130
-
131
- - 9e32c3b: fix(build): emit `.d.ts` by inlining `tsc --emitDeclarationOnly` into `build`.
132
-
133
- Yarn Berry does not run `pre`/`post` lifecycle hooks, so the former `postbuild`
134
- step never executed and the package shipped without type declarations. Folded it
135
- into `build` so the published `@apollion-dsi/tokens` includes its types.
136
-
137
- ## 4.3.1
138
-
139
- ## 4.3.0
140
-
141
- ## 4.2.0
142
-
143
- ### Minor Changes
144
-
145
- - 12ae4e0: feat(tokens): DTCG 2025.10 remainders — dimension references, per-token metadata, and Resolver (R5)
146
- - **Spacing + composite sub-value references**: `spacing` and `border.width`
147
- now reference primitive scales (`{space.*}`, `{border-width.*}`) instead of
148
- inlining literals. The `space` primitives are built per density via
149
- `createSpacing`, so references resolve correctly under compact/normal/spacious.
150
- - **`$deprecated` + `$description` per token**: populated from a `TOKEN_META`
151
- registry through the IR into the JSON output (a stale-key guard fails the
152
- build if a meta entry points at a non-existent token).
153
- - **DTCG Resolver (R5)**: the JSON surface now emits a single `resolver.json`
154
- plus composable `sets/` (axis-invariant `base` + per-axis colour/spacing sets)
155
- instead of one fully-resolved document per variant — a hard cutover, made
156
- pre-GA. A composition-equivalence test proves `base + colour + spacing`
157
- reproduces the old per-variant document exactly. The CSS and TS surfaces are
158
- unchanged: still per-variant, fully resolved, byte-identical.
159
-
160
- ## 4.1.0
161
-
162
- ### Minor Changes
163
-
164
- - 063e0e9: Align `@apollion-dsi/tokens` DTCG output with the Design Tokens Format Module 2025.10.
165
- - **Structured values:** `color` `$value` is now an OKLch object `{ colorSpace, components, hex, alpha? }` and `dimension` is `{ value, unit }` (was bare hex / length strings).
166
- - **Typed IR:** a single intermediate representation (`src/ir.ts`) drives the JSON/CSS/TS renderers as pure projections.
167
- - **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).
168
- - **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.*`.
169
-
170
- `@apollion-dsi/core` now exports the `themes/{border,depth,font}` subpaths so tokens consumes them as the single source of truth.
171
-
172
- CSS/TS outputs for the existing `bg`/`text`/`spacing` layers are byte-identical; JSON is the spec-interop surface.
173
-
174
- ## 4.0.0
175
-
176
- ### Major Changes
177
-
178
- - bd7d6cb: # v4.0.0 — OKLch + Dimension + Token Split
179
-
180
- 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).
181
-
182
- ## Breaking — `@apollion-dsi/core@4.0.0`
183
- - **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.
184
- - **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.
185
- - **`defaultInputColors.opposite` token value changed.** OKLch hue rotation differs from HSL rotation (the OKLch is the perceptually correct opposite). Audit `theme.colors.opposite.*` consumers.
186
- - **Dimension axis added.** `<ApollionProvider dimension="compact|normal|spacious">` is a new prop; default `normal` preserves v3.x spacing byte-exact. ADR-006 §6 S3.
187
- - **`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`).
188
- - **`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.
189
-
190
- ## Minor — `@apollion-dsi/eslint-config`
191
- - `culori` + `zod` added to `VENDORED_V4_LIBS` — must import via `vendors/Culori|Zod`.
192
- - `color` removed from `VENDORED_T2_LIBS` (eliminated).
193
- - `no-restricted-imports` for `'@apollion-dsi/core'` root: `warn` → `error` (per v4 barrel removal above).
194
-
195
- ## Major — `@apollion-dsi/tokens@4.0.0` (first release)
196
-
197
- New package — framework-agnostic design tokens consumed via `runtime/v1` versioned API + `apollion-tokens build` CLI.
198
- - **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.
199
- - **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.
200
- - **DTCG-compliant JSON output** (tech-radar R1).
201
- - **`as const` TypeScript output** (tech-radar R4).
202
- - **CSS `@property` declarations** (tech-radar R3) + custom properties `--apollion-{layer}-{role}-{variant}`.
203
- - **Sandboxed `apollion.config.mjs` loader** (`node:vm` + zod schema) — threat-model T2+E1 mitigation. ADR-006 §3.8 B3 + §6 S6.
204
- - **Lockstep version** with `@apollion-dsi/core` via `.changeset/config.json#fixed`.
205
-
206
- ## Minor — `@apollion-dsi/scripts`
207
- - `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.
208
- - `verify-no-install-scripts.js` — supply-chain hardening; blocks `preinstall`/`install`/`postinstall` in `@apollion-dsi/*` workspaces (threat-model E2 mitigation).
209
-
210
- ## Spike validation (preserved local, NOT merged to main)
211
- - `spike/culori-wcag-parity` — 100.0000% bit-exact culori vs color@5 (262 measurements / 10 palettes). `vendors/Color` elimination LOCKED.
212
- - `spike/culori-oklch-lerp-parity` — 0 unexpected regressions in 68 deltas; greyscale ramp 19× more uniform in OKLAB L. DECISION ✅ PROCEED.
213
-
214
- ### Patch Changes
215
-
216
- - Updated dependencies [032f81c]
217
- - Updated dependencies [32f7a1d]
218
- - Updated dependencies [2dadba5]
219
- - Updated dependencies [820a612]
220
- - Updated dependencies [c056ee3]
221
- - Updated dependencies [d032437]
222
- - Updated dependencies [00e0525]
223
- - Updated dependencies [1c87be8]
224
- - Updated dependencies [d1192da]
225
- - Updated dependencies [3194fba]
226
- - Updated dependencies [f359982]
227
- - Updated dependencies [5d17ebc]
228
- - Updated dependencies [bd7d6cb]
229
- - Updated dependencies [6545751]
230
- - Updated dependencies [36eaf4a]
231
- - Updated dependencies [802828f]
232
- - Updated dependencies [e14469c]
233
- - Updated dependencies [81cd55b]
234
- - Updated dependencies [c57c548]
235
- - Updated dependencies [879eedd]
236
- - Updated dependencies [e2abc9c]
237
- - Updated dependencies [75961a1]
238
- - Updated dependencies [e55019a]
239
- - Updated dependencies [fba9a41]
240
- - Updated dependencies [3a90653]
241
- - Updated dependencies [5fca933]
242
- - Updated dependencies [ea3dc3a]
243
- - Updated dependencies [51f71f6]
244
- - Updated dependencies [0a1baeb]
245
- - Updated dependencies [6d1371e]
246
- - Updated dependencies [e55019a]
247
- - Updated dependencies [29081ae]
248
- - @apollion-dsi/core@4.0.0