@aurea-uds/tokens 0.62.0 → 0.63.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/README.md +65 -80
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,120 +1,105 @@
1
- # Fundamentos da Aurea — o que os tokens governam, e o que não governam
1
+ # Aurea foundations — what the tokens govern, and what they do not
2
2
 
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).
3
+ The official answer to "which axis controls this value".
7
4
 
8
- As contagens moram no [`STATE.md`](../../STATE.md), gerado e conferido. Este arquivo guarda as
9
- regras.
5
+ The counts live in [`STATE.md`](https://github.com/victor1mor/aurea-uds/blob/main/STATE.md), generated and
6
+ checked. This file holds the rules.
10
7
 
11
8
  ---
12
9
 
13
- ## Os eixos
10
+ ## The axes
14
11
 
15
- | Eixo | Tokens | Unidade | Observações |
12
+ | Axis | Tokens | Unit | Notes |
16
13
  |---|---|---|---|
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-heading`, `--font-editorial`, `--font-code` | — | Inter / Sora (todo h1 a h6) / Inter (apelido, sai na 1.0) / IBM Plex Mono — ADR-0077 |
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.
14
+ | Colour | `--<semantic>`, `--<family>-<step>` | oklch / hex | the semantic token comes first; a ramp step is for building a semantic token, not for direct use |
15
+ | Space | `--space-0` … `--space-24` | rem | the scale skips values on purpose — not every integer exists |
16
+ | Type size | `--text-xs` … `--text-7xl` | rem | |
17
+ | Type family | `--font-ui`, `--font-heading`, `--font-editorial`, `--font-code` | — | Inter / Sora (every h1 to h6) / Inter (alias, removed in 1.0) / IBM Plex Mono |
18
+ | Type weight | `--weight-regular` … `--weight-extrabold` | number | |
19
+ | Line height | `--leading-none` … `--leading-relaxed` | number | `--leading-none` exists for components whose HEIGHT is part of the contract |
20
+ | Letter spacing | `--tracking-tight` … `--tracking-widest` | em | |
21
+ | Radius | `--radius-xs` … `--radius-card`, `--radius-sheet`, `--radius-control` | px | `--radius-card` (22px), `--radius-sheet` (32px, the sheet that rises from the bottom) and `--radius-control` (999px) are identity — checked |
22
+ | Border | `--border-width` | px | |
23
+ | Shadow | `--shadow-sm`, `--shadow-md`, `--shadow-lg` | shadow | |
24
+ | Layer | `--z-sticky` … `--z-toast` | number | for stacking OVERLAYS. A local `z-index: 1/2/3` inside a component is not this axis |
25
+ | Motion | `--duration-*`, `--ease-*` | duration / curve | |
26
+ | Icon size | `--icon-sm` … `--icon-xl` | rem | in rem so the glyph follows the text |
27
+ | Touch target | `--target-min` | rem | 44px with a 16px root — WCAG 2.5.5/2.5.8 |
28
+ | Breakpoint | `--breakpoint-2xs` … `--breakpoint-2xl` | px | `@media` cannot read `var()`, so the CSS repeats each breakpoint in `em` (it follows the browser's font size) and a build check guards the scale |
29
+ | Density | see below | rem | |
30
+
31
+ **A new value on any of these axes comes from a token.** The raw values in the core are counted per
32
+ axis against a baseline: the count may go down, never up.
37
33
 
38
34
  ---
39
35
 
40
- ## O contrato da densidade — o que de fato muda
36
+ ## The density contract — what actually changes
41
37
 
42
- `data-density="compact | comfortable | spacious"` muda **oito** tokens, e só eles:
38
+ `data-density="compact | comfortable | spacious"` changes **eleven** tokens, and only those:
43
39
 
44
40
  `--control-h-xs`, `--control-h-sm`, `--control-h-md`, `--control-h-lg`, `--control-h-xl`,
45
- `--row-h`, `--card-pad`, `--section-gap`.
41
+ `--touch-control-h-sm`, `--touch-control-h-md`, `--touch-control-h-lg` (the control heights of the native
42
+ touch target), `--row-h`, `--card-pad`, `--section-gap`.
46
43
 
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**.
44
+ In other words: density changes **control height, table row height, card padding and the gap between
45
+ sections**.
49
46
 
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.
47
+ It does **not** change, on purpose: type size, the general space scale, layout gaps, radii, icon sizes
48
+ or line heights. Density is about how close together the controls sit, not a second type scale.
53
49
 
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.
50
+ Every control must take its height from `--control-h-*`. `tests/visual/geometry.spec.ts` checks this.
58
51
 
59
52
  ---
60
53
 
61
- ## O contrato do tema — e uma assimetria, de propósito
54
+ ## The theme contract — and an asymmetry, on purpose
62
55
 
63
- `data-theme="dark | light"`. O escuro é a base; o claro sobrescreve.
56
+ `data-theme="dark | light"`. Dark is the base; light overrides it.
64
57
 
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`.
58
+ The two themes are **not** fully symmetric, and this is the exception: light overrides three colours that
59
+ dark leaves at the base value — `warning-500`, `oracle-300` and `oracle-400`. Nothing is undefined in dark:
60
+ those tokens inherit the base value, so no value is missing.
68
61
 
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.
72
-
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.
62
+ The identity does not change between themes: the main yellow is `oklch(0.795 0.184 86.047)` in both, and
63
+ the build fails on the canonical value, not only on the token name.
75
64
 
76
65
  ---
77
66
 
78
- ## Unidades: rem para tudo que deve acompanhar a letra
67
+ ## Units: rem for everything that should follow the text
79
68
 
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.
69
+ Type, space, icon size, control height, sidebar width and top bar height are **rem**, so that someone who
70
+ enlarges the browser's text gets bigger controls instead of clipped text (WCAG 1.4.4). The conversion
71
+ from px was exact (px÷16), so nothing moved at the default root size.
84
72
 
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.
73
+ Radii stay in **px**: a corner is a physical shape, not text, and scaling it with the text makes the
74
+ capsule stop being a capsule.
87
75
 
88
76
  ---
89
77
 
90
- ## Tokens sem quem os use
78
+ ## Tokens nobody uses
91
79
 
92
- 63 de 174 nomes distintos não são citados pelo core. Isso não é desperdício automático:
80
+ Not every token is referenced by the core. That is not automatically waste:
93
81
 
94
- | Grupo | Por que existe |
82
+ | Group | Why it exists |
95
83
  |---|---|
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 |
84
+ | `--breakpoint-*` | `@media` cannot read `var()`. The CSS repeats the number and a build check guards the scale against them |
85
+ | `--oracle-*` | used only by `apps/docs/docs.css`. `oracle` is vocabulary of the app it came from, not of the system — they go away together with that page |
86
+ | ramp steps | intermediate steps of the semantic families, kept so a consumer can build a variant |
101
87
 
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.
88
+ **The rule:** a token is born from a use, not from a scale that looks complete. Tokens that had no use
89
+ anywhere were removed, and the ones that were needed were created.
105
90
 
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.
91
+ Repeats are references, not copies: `--radius-full` is `{radius-control}`, so the two names cannot
92
+ diverge. Two tokens with the same number written by hand diverge the day one of them is adjusted.
108
93
 
109
94
  ---
110
95
 
111
- ## Cascata
96
+ ## Cascade
112
97
 
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.
98
+ `packages/core/dist/aurea.css` wraps the tokens **and** the component CSS in `@layer aurea`. The
99
+ consumer's own CSS, written without a layer, wins over the library whatever the selector's specificity —
100
+ no `!important`, no specificity hunting.
116
101
 
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.
102
+ The tokens sit inside the layer, together with the core, not outside it. A custom property
103
+ **declaration** competes in the cascade like any other: with the tokens outside, the `:root` override
104
+ that the core declares inside a media query lost to the base value, and the sidebar jumped 48px. An app
105
+ that redefines a token in its own unlayered `:root` still wins over both.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurea-uds/tokens",
3
- "version": "0.62.0",
3
+ "version": "0.63.0",
4
4
  "description": "Os tokens da Aurea UDS: a fonte em DTCG e as variáveis CSS geradas dela.",
5
5
  "keywords": [
6
6
  "aurea",