@aurea-uds/tokens 0.10.0 → 0.10.1

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/README.md +78 -75
  2. package/package.json +6 -2
package/README.md CHANGED
@@ -1,117 +1,120 @@
1
- # Aurea foundations — what the tokens govern, and what they do not
1
+ # Fundamentos da Aurea — o que os tokens governam, e o que não governam
2
2
 
3
- Canonical answer to "which axis owns this value". Written in Phase 6 of the audit plan,
4
- because the audit found the foundations documented nowhere: density and theme both promised
5
- things no document defined, and a quarter of the tokens had no consumer (findings M2, M17, M18).
3
+ A resposta oficial para "qual eixo manda neste valor". Escrito na Fase 6 do plano da auditoria,
4
+ porque a auditoria achou os fundamentos documentados em lugar nenhum: densidade e tema prometiam
5
+ coisas que nenhum documento definia, e um quarto dos tokens não tinha quem os usasse (achados M2,
6
+ M17, M18).
6
7
 
7
- Counts live in [`STATE.md`](../../STATE.md), generated and gated. This file holds the rules.
8
+ As contagens moram no [`STATE.md`](../../STATE.md), gerado e conferido. Este arquivo guarda as
9
+ regras.
8
10
 
9
11
  ---
10
12
 
11
- ## The axes
13
+ ## Os eixos
12
14
 
13
- | Axis | Tokens | Unit | Notes |
15
+ | Eixo | Tokens | Unidade | Observações |
14
16
  |---|---|---|---|
15
- | Colour | `--<semantic>`, `--<family>-<step>` | oklch / hex | semantic first; a ramp step is for building a semantic, not for using directly |
16
- | Spacing | `--space-0` … `--space-24` | rem | scale with deliberate gaps — not every integer exists |
17
- | Type size | `--text-xs` … `--text-5xl` | rem | |
18
- | Type family | `--font-ui`, `--font-editorial`, `--font-code` | — | IBM Plex Sans / Serif / Mono |
19
- | Type weight | `--weight-regular` … `--weight-bold` | number | created in Phase 6; the axis did not exist |
20
- | Line height | `--leading-none` … `--leading-relaxed` | number | `--leading-none` exists for components whose HEIGHT is a contract |
21
- | Letter spacing | `--tracking-tight` … `--tracking-widest` | em | created in Phase 6 |
22
- | Radius | `--radius-sm` … `--radius-card`, `--radius-control` | px | `--radius-card` (22px) and `--radius-control` (999px) are identity — gated |
23
- | Border | `--border-width` | px | |
24
- | Shadow | `--shadow-md`, `--shadow-lg` | shadow | the `xs`/`sm` steps were removed in Phase 6: both were `none` and unused |
25
- | Layer | `--z-sticky` … `--z-toast` | number | for OVERLAY stacking. Local `z-index: 1/2/3` inside a component is not this axis |
26
- | Motion | `--duration-*`, `--ease-*` | duration / bezier | |
27
- | Icon size | `--icon-sm` … `--icon-xl` | rem | created in Phase 6; rem so glyphs follow text size |
28
- | Touch target | `--target-min` | rem | 44px at a 16px root — WCAG 2.5.5/2.5.8 |
29
- | Breakpoint | `--breakpoint-sm` … `--breakpoint-2xl` | px | `@media` cannot read `var()`, so the CSS repeats the literal and `validate.py` check 4b guards the scale |
30
- | Density | see below | rem | |
31
-
32
- **New value on any of these axes comes from a token.** Raw values in the core are ratcheted per
33
- axis by `validate.py` check 12 against `scripts/raw-px-baseline.json`: the count may fall, never
34
- rise.
17
+ | Cor | `--<semântico>`, `--<família>-<degrau>` | oklch / hex | o semântico vem primeiro; um degrau da rampa serve para montar um semântico, não para usar direto |
18
+ | Espaço | `--space-0` … `--space-24` | rem | escala com saltos de propósito — nem todo inteiro existe |
19
+ | Tamanho de letra | `--text-xs` … `--text-5xl` | rem | |
20
+ | Família de letra | `--font-ui`, `--font-editorial`, `--font-code` | — | IBM Plex Sans / Serif / Mono |
21
+ | Peso de letra | `--weight-regular` … `--weight-bold` | número | criado na Fase 6; o eixo não existia |
22
+ | Altura de linha | `--leading-none` … `--leading-relaxed` | número | `--leading-none` existe para componentes cuja ALTURA é contrato |
23
+ | Espaçamento entre letras | `--tracking-tight` … `--tracking-widest` | em | criado na Fase 6 |
24
+ | Raio | `--radius-sm` … `--radius-card`, `--radius-control` | px | `--radius-card` (22px) e `--radius-control` (999px) são identidade — conferidos |
25
+ | Borda | `--border-width` | px | |
26
+ | Sombra | `--shadow-md`, `--shadow-lg` | sombra | os degraus `xs`/`sm` saíram na Fase 6: os dois eram `none` e ninguém usava |
27
+ | Camada | `--z-sticky` … `--z-toast` | número | para empilhar OVERLAYS. `z-index: 1/2/3` local, dentro de um componente, não é este eixo |
28
+ | Movimento | `--duration-*`, `--ease-*` | duração / curva | |
29
+ | Tamanho de ícone | `--icon-sm` … `--icon-xl` | rem | criado na Fase 6; em rem para o glifo acompanhar a letra |
30
+ | Área de toque | `--target-min` | rem | 44px com raiz de 16px — WCAG 2.5.5/2.5.8 |
31
+ | Ponto de quebra | `--breakpoint-sm` … `--breakpoint-2xl` | px | `@media` não lê `var()`, então o CSS repete o número e o check 4b do `validate.py` guarda a escala |
32
+ | Densidade | ver abaixo | rem | |
33
+
34
+ **Valor novo em qualquer um destes eixos sai de um token.** Os valores crus do core são contados
35
+ por eixo pelo check 12 do `validate.py`, contra o `scripts/raw-px-baseline.json`: a conta pode
36
+ cair, nunca subir.
35
37
 
36
38
  ---
37
39
 
38
- ## Density contract — what actually changes
40
+ ## O contrato da densidade — o que de fato muda
39
41
 
40
- `data-density="compact | comfortable | spacious"` changes **eight** tokens, and only these:
42
+ `data-density="compact | comfortable | spacious"` muda **oito** tokens, e só eles:
41
43
 
42
44
  `--control-h-xs`, `--control-h-sm`, `--control-h-md`, `--control-h-lg`, `--control-h-xl`,
43
45
  `--row-h`, `--card-pad`, `--section-gap`.
44
46
 
45
- So density changes **control height, table row height, card padding and gap between sections**.
47
+ Ou seja: a densidade muda **a altura dos controles, a altura da linha de tabela, o respiro do
48
+ cartão e o vão entre seções**.
46
49
 
47
- It deliberately does **not** change: type size, the general spacing scale, layout gaps, radii,
48
- icon sizes or line heights. Density is about how tightly controls pack, not about a second
49
- type scale.
50
+ Ela **não** muda, de propósito: tamanho de letra, a escala geral de espaço, os vãos de layout,
51
+ raios, tamanhos de ícone nem alturas de linha. Densidade é sobre quão juntos os controles ficam, e
52
+ não uma segunda escala de letras.
50
53
 
51
- This was undocumented until Phase 6, and the promise "three densities" read as if it governed
52
- everything. Every control must take its height from `--control-h-*` — three families did not,
53
- and that is why a tab measured 8px shorter than the field beside it in `spacious`
54
- (finding A1). `tests/visual/geometry.spec.ts` now enforces it.
54
+ Isso não estava escrito até a Fase 6, e a promessa "três densidades" soava como se mandasse em
55
+ tudo. Todo controle tem de tirar a altura de `--control-h-*` — três famílias não tiravam, e por
56
+ isso uma aba media 8px a menos que o campo ao lado em `spacious` (achado A1). O
57
+ `tests/visual/geometry.spec.ts` cobra isso hoje.
55
58
 
56
59
  ---
57
60
 
58
- ## Theme contract — and one asymmetry, on purpose
61
+ ## O contrato do tema — e uma assimetria, de propósito
59
62
 
60
- `data-theme="dark | light"`. Dark is the base; light overrides.
63
+ `data-theme="dark | light"`. O escuro é a base; o claro sobrescreve.
61
64
 
62
- The two themes are **not** symmetric, and this is the exception: light overrides six colours
63
- that dark leaves at their base value —
64
- `danger-400`, `info-400`, `success-400`, `warning-400`, `oracle-300`, `oracle-400`.
65
+ Os dois temas **não** são simétricos, e esta é a exceção: o claro sobrescreve seis cores que o
66
+ escuro deixa no valor base — `danger-400`, `info-400`, `success-400`, `warning-400`, `oracle-300`,
67
+ `oracle-400`.
65
68
 
66
- Reason: on a light surface those four semantic families need a deeper tone to reach 4.5:1,
67
- while on dark the base value already does. Nothing is undefined in dark — it inherits from
68
- `base`, so there is no missing-value bug. What was missing was this paragraph.
69
+ Motivo: sobre uma superfície clara essas quatro famílias semânticas precisam de um tom mais fundo
70
+ para chegar a 4,5:1, enquanto no escuro o valor base já chega. Nada fica indefinido no escuro — ele
71
+ herda da base, então não há valor faltando. O que faltava era este parágrafo.
69
72
 
70
- Identity does not change between themes: the primary yellow is `oklch(0.795 0.184 86.047)` in
71
- both, and `validate.py` check 3 fails on the canonical value, not just the token name.
73
+ A identidade não muda entre temas: o amarelo principal é `oklch(0.795 0.184 86.047)` nos dois, e o
74
+ check 3 do `validate.py` reprova pelo valor canônico, não só pelo nome do token.
72
75
 
73
76
  ---
74
77
 
75
- ## Units: rem for anything that should follow text
78
+ ## Unidades: rem para tudo que deve acompanhar a letra
76
79
 
77
- Type, spacing, icon sizes, control heights, sidebar width and topbar height are **rem**, so a
78
- reader who doubles the browser font size gets bigger controls instead of clipped text
79
- (WCAG 1.4.4, finding M12). The conversion from px was exact (px÷16), so nothing moved at the
80
- default root size — the 52 pixel baselines prove it.
80
+ Letra, espaço, tamanho de ícone, altura de controle, largura da lateral e altura da barra do topo
81
+ são **rem**, para que quem dobra a letra do navegador ganhe controles maiores em vez de texto
82
+ cortado (WCAG 1.4.4, achado M12). A conversão de px foi exata (px÷16), então nada se moveu no
83
+ tamanho de raiz padrão — os 52 baselines de screenshot provam.
81
84
 
82
- Radii stay **px**: a corner is a physical shape, not text, and scaling it with type size makes
83
- a pill stop being a pill.
85
+ Os raios ficam em **px**: um canto é forma física, não texto, e escalá-lo com a letra faz a cápsula
86
+ deixar de ser cápsula.
84
87
 
85
88
  ---
86
89
 
87
- ## Tokens with no consumer
90
+ ## Tokens sem quem os use
88
91
 
89
- 63 of 174 distinct names are not referenced by the core. That is not automatically waste:
92
+ 63 de 174 nomes distintos não são citados pelo core. Isso não é desperdício automático:
90
93
 
91
- | Group | Why it exists |
94
+ | Grupo | Por que existe |
92
95
  |---|---|
93
- | `--breakpoint-*` (5) | `@media` cannot read `var()`. The CSS repeats the literal and check 4b guards the scale against them |
94
- | `--oracle-*` (11) | consumed only by `apps/docs/docs.css`. `oracle` is vocabulary from the origin app, not the system (finding M9) — these leave with that page |
95
- | `--chart-*` (4) | reserved for charts, which do not exist yet as components |
96
- | ramp steps (6) | intermediate steps of the semantic families, kept so a consumer can build a variant |
97
- | the rest | used only by `docs.css` — 14 in total |
96
+ | `--breakpoint-*` (5) | `@media` não lê `var()`. O CSS repete o número e o check 4b guarda a escala contra eles |
97
+ | `--oracle-*` (11) | usados só por `apps/docs/docs.css`. `oracle` é vocabulário do app de origem, não do sistema (achado M9) — saem junto com aquela página |
98
+ | `--chart-*` (4) | reservados para gráficos, que ainda não existiam como componentes |
99
+ | degraus de rampa (6) | degraus intermediários das famílias semânticas, mantidos para um consumidor montar uma variante |
100
+ | o resto | usados só pelo `docs.css` — 14 no total |
98
101
 
99
- **The rule going forward:** a token is born from a use, not from a scale that looks complete.
100
- Phase 6 removed 26 that had no use anywhere (`--aether-*`, `--ember-*`, two `none` shadows, two
101
- duplicate radii) and created 15 that were needed immediately.
102
+ **A regra daqui em diante:** um token nasce de um uso, não de uma escala que parece completa. A Fase
103
+ 6 tirou 26 que não tinham uso em lugar nenhum (`--aether-*`, `--ember-*`, duas sombras `none`, dois
104
+ raios repetidos) e criou 15 que eram necessários na hora.
102
105
 
103
- Duplicates are references, not copies: `--radius-full` is `{radius-control}`, so the two names
104
- cannot drift. Two tokens with the same number written by hand diverge the day one is adjusted.
106
+ Repetidos são referências, não cópias: `--radius-full` é `{radius-control}`, então os dois nomes não
107
+ podem divergir. Dois tokens com o mesmo número escrito à mão divergem no dia em que um é ajustado.
105
108
 
106
109
  ---
107
110
 
108
- ## Cascade
111
+ ## Cascata
109
112
 
110
- `packages/core/dist/aurea.css` wraps tokens **and** component CSS in `@layer aurea`. A
111
- consumer's own CSS, written without a layer, therefore wins over the library regardless of
112
- selector specificity — no `!important`, no specificity hunting.
113
+ O `packages/core/dist/aurea.css` embrulha os tokens **e** o CSS dos componentes em `@layer aurea`. O
114
+ CSS do próprio consumidor, escrito sem camada, ganha da biblioteca qualquer que seja a
115
+ especificidade do seletor — sem `!important`, sem caça à especificidade.
113
116
 
114
- Tokens are inside the layer with the core, not outside it. A custom property **declaration**
115
- competes in the cascade like any other: with the tokens outside, the `:root` override that the
116
- core declares inside a media query lost to the base value, and the sidebar jumped 48px.
117
- An app that redefines a token in its own unlayered `:root` still wins over both.
117
+ Os tokens ficam dentro da camada, junto com o core, e não fora. Uma **declaração** de propriedade
118
+ customizada disputa a cascata como qualquer outra: com os tokens fora, a sobrescrita de `:root` que
119
+ o core declara dentro de uma media query perdia para o valor base, e a lateral pulava 48px. Um app
120
+ que redefine um token no próprio `:root` sem camada continua ganhando dos dois.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aurea-uds/tokens",
3
- "version": "0.10.0",
4
- "description": "Design tokens for Aurea UDS: the DTCG source and the CSS custom properties generated from it.",
3
+ "version": "0.10.1",
4
+ "description": "Os tokens da Aurea UDS: a fonte em DTCG e as variáveis CSS geradas dela.",
5
5
  "keywords": [
6
6
  "aurea",
7
7
  "design-system",
@@ -14,6 +14,10 @@
14
14
  "url": "git+https://github.com/victor1mor/aurea-uds.git",
15
15
  "directory": "packages/tokens"
16
16
  },
17
+ "homepage": "https://github.com/victor1mor/aurea-uds/tree/main/packages/tokens#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/victor1mor/aurea-uds/issues"
20
+ },
17
21
  "publishConfig": {
18
22
  "access": "public"
19
23
  },