@apollion-dsi/core 4.7.0 → 4.9.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 (134) hide show
  1. package/CHANGELOG.md +1508 -0
  2. package/lib/chunks/{chunk-KXFXI625.esm.js → chunk-26LI3MXC.esm.js} +1 -1
  3. package/lib/chunks/{chunk-7M5NAYRT.esm.js → chunk-2DLDGQEF.esm.js} +1 -1
  4. package/lib/chunks/{chunk-5HJ3BOZK.esm.js → chunk-2PA37TWW.esm.js} +1 -1
  5. package/lib/chunks/{chunk-OURV2YRG.esm.js → chunk-2URCFJDM.esm.js} +1 -1
  6. package/lib/chunks/{chunk-AMQZYF7R.esm.js → chunk-2ZOV42J4.esm.js} +1 -1
  7. package/lib/chunks/{chunk-Q5IN7W6Y.esm.js → chunk-3F7OIMU5.esm.js} +1 -1
  8. package/lib/chunks/{chunk-DXIQZQ6P.esm.js → chunk-3WTCIJQT.esm.js} +1 -1
  9. package/lib/chunks/{chunk-LYBLPBOI.esm.js → chunk-46TTCCRW.esm.js} +1 -1
  10. package/lib/chunks/{chunk-MC24H4VS.esm.js → chunk-4ETGHVIY.esm.js} +1 -1
  11. package/lib/chunks/{chunk-Y6HWZAYB.esm.js → chunk-4RAVNJVP.esm.js} +1 -1
  12. package/lib/chunks/{chunk-NZ5TNNU5.esm.js → chunk-5N2JVFTP.esm.js} +1 -1
  13. package/lib/chunks/{chunk-2ZEMSYQA.esm.js → chunk-5PG5BLXK.esm.js} +1 -1
  14. package/lib/chunks/{chunk-ZPYVQROT.esm.js → chunk-AHV3TGEY.esm.js} +1 -1
  15. package/lib/chunks/{chunk-SECCSVYK.esm.js → chunk-CPGN2SH2.esm.js} +1 -1
  16. package/lib/chunks/{chunk-625OZCFV.esm.js → chunk-ECSEHSVO.esm.js} +1 -1
  17. package/lib/chunks/{chunk-WLDWNLLU.esm.js → chunk-GOLX7UQY.esm.js} +1 -1
  18. package/lib/chunks/{chunk-7XA3S6CO.esm.js → chunk-HF3LH5A2.esm.js} +1 -1
  19. package/lib/chunks/{chunk-UAWML4II.esm.js → chunk-HNO34UKT.esm.js} +1 -1
  20. package/lib/chunks/{chunk-WIS62POP.esm.js → chunk-ITUU5A6G.esm.js} +1 -1
  21. package/lib/chunks/{chunk-BR2DFS7H.esm.js → chunk-JLARG22X.esm.js} +1 -1
  22. package/lib/chunks/{chunk-NRFK622K.esm.js → chunk-KAM7CXBI.esm.js} +1 -1
  23. package/lib/chunks/{chunk-Z5H27NAU.esm.js → chunk-KDUQEGEN.esm.js} +1 -1
  24. package/lib/chunks/{chunk-RAJPMKI6.esm.js → chunk-LMFXELKN.esm.js} +1 -1
  25. package/lib/chunks/{chunk-TLX7B6M2.esm.js → chunk-MBFUX4KR.esm.js} +1 -1
  26. package/lib/chunks/{chunk-Z5HASYRF.esm.js → chunk-MSLFSFPM.esm.js} +1 -1
  27. package/lib/chunks/{chunk-DV4C3AUK.esm.js → chunk-MSX4RO76.esm.js} +1 -1
  28. package/lib/chunks/chunk-PD3U6Y6P.esm.js +1 -0
  29. package/lib/chunks/chunk-PQXDJLGK.esm.js +43 -0
  30. package/lib/chunks/{chunk-B4ETUBXP.esm.js → chunk-PWGN2XFC.esm.js} +1 -1
  31. package/lib/chunks/{chunk-5LHZPJ5E.esm.js → chunk-QH4TOZTO.esm.js} +1 -1
  32. package/lib/chunks/chunk-SYABXHFT.esm.js +1 -0
  33. package/lib/chunks/{chunk-JFVGLAKG.esm.js → chunk-SZFWURBI.esm.js} +1 -1
  34. package/lib/chunks/{chunk-SHUKTRN3.esm.js → chunk-TOI4RVAE.esm.js} +1 -1
  35. package/lib/chunks/{chunk-5BVSCTJG.esm.js → chunk-UBSYXIRH.esm.js} +1 -1
  36. package/lib/chunks/{chunk-IHZS35P6.esm.js → chunk-UHBWT5AW.esm.js} +1 -1
  37. package/lib/chunks/{chunk-SEIW5WO7.esm.js → chunk-VKXOGGQ2.esm.js} +1 -1
  38. package/lib/chunks/{chunk-ZVWWMYDL.esm.js → chunk-XBPBD5Z4.esm.js} +1 -1
  39. package/lib/chunks/{chunk-DYCYRCQE.esm.js → chunk-YCGCCH6Q.esm.js} +1 -1
  40. package/lib/chunks/{chunk-HJOSYMRU.esm.js → chunk-ZE7R46X3.esm.js} +1 -1
  41. package/lib/containers/Base/index.esm.js +1 -1
  42. package/lib/containers/Card/index.esm.js +1 -1
  43. package/lib/containers/Content/index.esm.js +1 -1
  44. package/lib/containers/Flex/index.esm.js +1 -1
  45. package/lib/containers/Grid/index.esm.js +1 -1
  46. package/lib/containers/Notification/index.esm.js +1 -1
  47. package/lib/containers/Paper/index.esm.js +1 -1
  48. package/lib/containers/Scroll/index.esm.js +1 -1
  49. package/lib/containers/index.esm.js +1 -1
  50. package/lib/dataDisplay/DataTable/index.esm.js +1 -1
  51. package/lib/dataDisplay/DescriptionList/index.esm.js +1 -1
  52. package/lib/dataDisplay/Table/Table/index.esm.js +1 -1
  53. package/lib/dataDisplay/Table/TableCell/index.esm.js +1 -1
  54. package/lib/dataDisplay/Table/TableCheckboxCell/index.esm.js +1 -1
  55. package/lib/dataDisplay/Table/TableEmpty/index.esm.js +1 -1
  56. package/lib/dataDisplay/Table/TableFooter/index.esm.js +1 -1
  57. package/lib/dataDisplay/Table/TableHeaderCell/index.esm.js +1 -1
  58. package/lib/dataDisplay/Table/TableHeaderCheckboxCell/index.esm.js +1 -1
  59. package/lib/dataDisplay/Table/TablePagination/index.esm.js +1 -1
  60. package/lib/dataDisplay/Table/index.esm.js +1 -1
  61. package/lib/dataDisplay/Tabs/index.esm.js +1 -1
  62. package/lib/dataDisplay/index.esm.js +1 -1
  63. package/lib/elements/Avatar/index.esm.js +1 -1
  64. package/lib/elements/Button/index.esm.js +1 -1
  65. package/lib/elements/Dropdown/index.esm.js +1 -1
  66. package/lib/elements/Icon/index.esm.js +1 -1
  67. package/lib/elements/IconButton/index.esm.js +1 -1
  68. package/lib/elements/Image/index.esm.js +1 -1
  69. package/lib/elements/Label/index.esm.js +1 -1
  70. package/lib/elements/Link/Link.d.ts +29 -3
  71. package/lib/elements/Link/Link.interface.d.ts +14 -1
  72. package/lib/elements/Link/Link.style.d.ts +2 -0
  73. package/lib/elements/Link/index.esm.js +1 -1
  74. package/lib/elements/List/index.esm.js +1 -1
  75. package/lib/elements/Modal/index.esm.js +1 -1
  76. package/lib/elements/Popover/index.esm.js +1 -1
  77. package/lib/elements/ProgressBar/index.esm.js +1 -1
  78. package/lib/elements/Spinner/index.esm.js +1 -1
  79. package/lib/elements/Svg/index.esm.js +1 -1
  80. package/lib/elements/Text/Text.d.ts +10 -6
  81. package/lib/elements/Text/Text.interface.d.ts +67 -32
  82. package/lib/elements/Text/Text.props.d.ts +105 -3
  83. package/lib/elements/Text/index.esm.js +1 -1
  84. package/lib/elements/Tooltip/index.esm.js +1 -1
  85. package/lib/elements/index.esm.js +1 -1
  86. package/lib/factory/DeepFactory/index.esm.js +1 -1
  87. package/lib/factory/ResponsiveFactory/index.esm.js +1 -1
  88. package/lib/factory/System/index.esm.js +1 -1
  89. package/lib/factory/index.esm.js +1 -1
  90. package/lib/form/Checkbox/index.esm.js +1 -1
  91. package/lib/form/Field/index.esm.js +1 -1
  92. package/lib/form/FieldGroup/index.esm.js +1 -1
  93. package/lib/form/Form/index.esm.js +1 -1
  94. package/lib/form/Input/Input.style.d.ts +6 -6
  95. package/lib/form/Input/index.esm.js +1 -1
  96. package/lib/form/InputCurrency/index.esm.js +1 -1
  97. package/lib/form/InputDate/index.esm.js +1 -1
  98. package/lib/form/InputMask/index.esm.js +1 -1
  99. package/lib/form/InputRange/index.esm.js +1 -1
  100. package/lib/form/InputSelect/index.esm.js +1 -1
  101. package/lib/form/Radio/index.esm.js +1 -1
  102. package/lib/form/Select/Select.d.ts +34 -0
  103. package/lib/form/Select/Select.interface.d.ts +91 -0
  104. package/lib/form/Select/Select.style.d.ts +23 -0
  105. package/lib/form/Select/index.d.ts +9 -0
  106. package/lib/form/Select/index.esm.js +1 -0
  107. package/lib/form/Switch/index.esm.js +1 -1
  108. package/lib/form/TextArea/index.esm.js +1 -1
  109. package/lib/form/UploadCard/UploadCard.style.d.ts +2 -2
  110. package/lib/form/UploadCard/index.esm.js +1 -1
  111. package/lib/form/index.d.ts +1 -0
  112. package/lib/form/index.esm.js +1 -1
  113. package/lib/hooks/index.esm.js +1 -1
  114. package/lib/index.d.ts +1 -1
  115. package/lib/index.esm.js +1 -1
  116. package/lib/index.js +1 -1
  117. package/lib/layouts/DefaultLayout/index.esm.js +1 -1
  118. package/lib/layouts/SideBarLayout/index.esm.js +1 -1
  119. package/lib/layouts/index.esm.js +1 -1
  120. package/lib/scenario/RectComponent/index.esm.js +1 -1
  121. package/lib/scenario/index.esm.js +1 -1
  122. package/lib/skeleton/ComposedSkeleton/index.esm.js +1 -1
  123. package/lib/skeleton/TextPreset/index.esm.js +1 -1
  124. package/lib/skeleton/index.esm.js +1 -1
  125. package/lib/themes/Colors/Colors.presets.d.ts +67 -0
  126. package/lib/themes/Colors/index.d.ts +1 -0
  127. package/lib/themes/Colors/index.esm.js +1 -1
  128. package/lib/themes/Deep/index.esm.js +1 -1
  129. package/lib/themes/ThemeProvider/index.esm.js +1 -1
  130. package/lib/themes/index.esm.js +1 -1
  131. package/package.json +7 -3
  132. package/lib/chunks/chunk-HWEDMSNR.esm.js +0 -1
  133. package/lib/chunks/chunk-K3WQZ3OY.esm.js +0 -1
  134. /package/lib/chunks/{chunk-4P7MB5JL.esm.js → chunk-WCNOO6RU.esm.js} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,1508 @@
1
+ # @apollion-dsi/core
2
+
3
+ ## 4.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f44247c: feat(form): add SSR-inert, native-`<select>`-backed `Select`
8
+
9
+ New `@apollion-dsi/core/form/select` component: a token-styled native
10
+ `<select>` that renders correct, functional markup with JavaScript disabled
11
+ (no hydration, no `useEffect`) and emits native `change` events — usable on
12
+ pure static SSG (`renderToStaticMarkup`, zero app JS) where `InputSelect`
13
+ (react-select) cannot. Typed `options`, `size` (`small`/`medium`/`large`),
14
+ `variant`, `borderRadius` (incl. `straight`), visible `:focus-visible`
15
+ outline, and forced-readable native `option` colors on dark surfaces.
16
+
17
+ Also adds accessibility palette presets to `@apollion-dsi/core/themes/colors`
18
+ (`grayscalePalette`, `highContrastPalette` AAA, `colorblindPalette`
19
+ Okabe–Ito, and the `accessibilityPalettes` registry) — color-input factories
20
+ for `createTheme({ colors })`.
21
+
22
+ ## 4.8.0
23
+
24
+ ### Minor Changes
25
+
26
+ - 5bd1d6f: feat(core): `Text` tipa os atributos HTML pela `variant`, não só pelo `as`
27
+
28
+ Desde a 4.7.0 o `Text` derivava os atributos nativos da tag concreta, mas `T` era inferido **só do `as`** — enquanto o runtime (`getTextProps`) resolve a tag pela `variant` quando a entrada de `variantStyleProps` não declara uma. Resultado: `<Text variant="blockquote" cite="…">` renderizava um `<blockquote>` no DOM e mesmo assim não compilava; o `as` precisava ser repetido junto da variante só para destravar o tipo (o próprio exemplo da doc fazia isso). Agora `T` segue a mesma ordem do runtime: `as` quando presente, senão a tag da `variant`, senão o default `span`. `variant="blockquote"` aceita `cite`; `variant="meta"` e `variant="lead"` tipam como `<p>` e `d1`–`d4` como `h1`–`h4`, respeitando a `tag` explícita do mapa; `as` continua vencendo a `variant` quando os dois aparecem, como no runtime. O mapa variante → tag é derivado de `typeof variantStyleProps` (`as const satisfies`), então uma variante nova entra no tipo sem segunda fonte de verdade. Sem breaking change: `TextInterface` sem argumento — usado em composição por `Label`, `Tooltip` e os `labelProps` de `Radio`/`Checkbox`/`Switch` — continua no conjunto global de atributos, e nenhum call-site com `as` muda de comportamento.
29
+
30
+ ### Patch Changes
31
+
32
+ - 30e6fb7: fix(core): `Link` mescla o `rel` do consumer em URL externa em vez de sobrescrever
33
+
34
+ `Link` e `Link.Button` aplicavam `externalAttrs` **depois** do spread de `props`, então qualquer `rel` passado pelo consumer era descartado em `href` externo — `rel="nofollow noopener"` saía como `rel="noopener noreferrer"`. Agora há uma função pura `mergeRel`: `noopener` e `noreferrer` continuam sempre presentes e vêm primeiro (ordem estável), tokens extras do consumer (`nofollow`, `ugc`, `sponsored`, `me`) são preservados na ordem em que vieram, tudo deduplicado e normalizado para minúsculas. `target="_blank"` segue forçado em link externo (nova aba é o contrato do DS) e `href` interno não recebe injeção — o `rel` do consumer passa como veio. Sem mudança de API e sem churn de snapshot: link externo sem `rel` continua renderizando `rel="noopener noreferrer"`. Origem: feedback do consumidor Brasil 2030 — link de citação de fonte externa em `<figcaption>` precisa de `nofollow` (higiene de SEO).
35
+
36
+ ## 4.7.0
37
+
38
+ ### Minor Changes
39
+
40
+ - 4ff812d: feat(core): `Text` aceita os atributos HTML da tag escolhida por `as`
41
+
42
+ `TextInterface` estendia apenas `HTMLAttributes<HTMLElement>` — só os atributos **globais**. Atributos específicos de elemento ficavam de fora, então a variante `blockquote` existia sem que a fonte da citação (`cite`, de `BlockquoteHTMLAttributes`) pudesse ser declarada; em runtime o atributo já chegava ao DOM (`shouldForwardProp` → `isPropValid`), o bloqueio era só de tipo.
43
+
44
+ `TextInterface<T>` agora é polimórfico: `T` é inferido do próprio `as` e os atributos nativos vêm da tag resolvida — `cite` em `blockquote`/`q`, `dateTime` em `time`, `value` em `li`, etc. Sem `as` (e em `TextInterface` sem argumento — `Label`, `Tooltip`, `labelProps`) o tipo cai no conjunto global de atributos, exatamente o contrato anterior: nenhum consumidor existente estreita. Em nome repetido (`color`, `width`, `height`, `type`), a prop da Apollion continua vencendo.
45
+
46
+ Sem mudança de runtime nem de API: o consumidor deixa de precisar de spread com cast (`{...(citeAttr(url) as object)}`) para citar a fonte. Origem: feedback do consumidor Brasil 2030 (`web/ssg/pages/report/RetirementCard.tsx`, citação em `<figure>`/`<blockquote cite>`/`<figcaption>` conforme HTML §4.4.4).
47
+
48
+ ### Patch Changes
49
+
50
+ - 0e1aa6e: fix(core): `getContrastColor` escolhe o texto de maior contraste em fundos de tom médio
51
+
52
+ `getContrastColor` usava um threshold fixo de luminância + um único candidato escurecido e podia escolher branco a ~3.6:1 sobre fundos de luminância média (ex.: `#708B97`), reprovando WCAG AA. Agora seleciona, entre o texto escuro tonalizado e o claro, o de maior contraste — escalando para o endpoint puro (`#000`/`#fff`) quando nenhum passa — garantindo AA (≥ 4.5) em qualquer fundo. Alinha `getContrastColor` à direção-por-contraste que `readableColor` já aplicava (math WCAG unificada em `contrastRatio`). Sem mudança de API; cores de marca/feedback que já passavam permanecem idênticas (0 churn de snapshot). Origem: feedback do consumidor Brasil 2030 (ADR-010 §12).
53
+
54
+ ## 4.6.3
55
+
56
+ ### Patch Changes
57
+
58
+ - Sync `APOLLION_CORE_VERSION` with `package.json#version` (was still `4.6.1` after the 4.6.2 bump).
59
+
60
+ ## 4.6.2
61
+
62
+ ### Patch Changes
63
+
64
+ - bc11147: fix(core): Storybook iframe empty in `storybook dev` — apply relative `publicPath` only on production builds
65
+
66
+ ## 4.6.1
67
+
68
+ ### Patch Changes
69
+
70
+ - fix(core): `Image` e `Svg` emitem `width`/`height` como atributos HTML nativos
71
+
72
+ `width`/`height` são props de dimensão do `SizeFactory` **e** atributos HTML
73
+ nativos de elementos de mídia/vetor (`<img>`, `<svg>`). O `shouldForwardProp`
74
+ global os removia do DOM, então os elementos renderizados saíam sem
75
+ `width`/`height` — o PageSpeed acusa "image elements do not have explicit width
76
+ and height" (risco de CLS) e SVGs "explodem" sem CSS de autor.
77
+ - **`Image`**: `ImageStyle` passa a encaminhar `width`/`height` para o DOM.
78
+ - **`Svg`**: novo `getNativeDims` deriva `width`/`height` nativos de
79
+ `size`/`dimensions` **quando numéricos** e os emite via `attrs`. Valores
80
+ CSS-only (`1em`, `auto`, `calc(...)`, `100%` fluido) seguem só como CSS.
81
+
82
+ Ambos usam o novo predicado compartilhado `shouldForwardDimensionAttrs`, que
83
+ reintroduz só esses dois atributos preservando o resto da regra do DS. Sem
84
+ mudança de layout com CSS: os valores já eram aplicados como estilo; agora
85
+ também chegam como atributos, reservando o espaço.
86
+
87
+ ## 4.6.0
88
+
89
+ ### Minor Changes
90
+
91
+ - Move `styled-components` from `dependencies` to `peerDependencies` (`^6.0.0`) so the consumer app always owns the single `styled-components` instance.
92
+
93
+ Previously the exact pin (`"styled-components": "6.4.1"`) prevented yarn from deduping against an app resolving a different `6.x` patch (e.g. `6.4.3`), installing a second nested copy under `@apollion-dsi/core/node_modules`. Two `styled-components` instances meant two React `ThemeContext`s: `<ApollionProvider>` set the theme on core's context while the app's own `styled()` read its own empty context, so `theme.breakpoints` was `undefined` and any `Grid`/`theme.breakpoints` consumer crashed.
94
+
95
+ Also loosened the `react`/`react-dom` peer ranges from the exact `19.2.6` to `^19.0.0`.
96
+
97
+ Note for consumers: `styled-components` is now a peer — apps must declare it directly (yarn Berry does not auto-install peers). Any app that already writes `styled()` against the Apollion theme already does.
98
+
99
+ ## 4.5.1
100
+
101
+ ### Patch Changes
102
+
103
+ - 461d7a1: fix(core): sync `APOLLION_CORE_VERSION` with package version + README subpaths
104
+ - `APOLLION_CORE_VERSION` was a stale hand-maintained literal: it reported
105
+ `4.1.0` through the 4.2→4.5 releases (the published 4.5.0 build exposed
106
+ `4.1.0` at runtime). Bumped to `4.5.0` and added `src/index.test.ts`, a
107
+ drift guard that fails `validate` whenever the literal and
108
+ `package.json#version` disagree.
109
+ - README "Setup mínimo"/"Theming" still showed the pre-v4 barrel import
110
+ (`import { ApollionProvider } from '@apollion-dsi/core'`), which throws under
111
+ the subpaths-only barrel (ADR-006 §3.7 E7). Rewrote the examples to granular
112
+ subpaths and added an explicit "Imports (v4 — subpaths-only)" section. The
113
+ barrel removal stays intentional; only the docs were out of sync.
114
+
115
+ ## 4.5.0
116
+
117
+ ### Minor Changes
118
+
119
+ - 1ebb3e3: Typography joins the `dimension` density axis — fixed root + `rem` scale (ADR-011)
120
+ - **Fixed root:** `GlobalStyle` emits `html { font-size: 100% }` (16px) instead of
121
+ the fluid `clamp(16px, 1vw + 12px, 28px)`. Product UI keeps stable reading
122
+ density on ultrawide/4K — large screens gain columns/space, not inflated text.
123
+ - **`createFont(input, dimension)`** mirrors `createSpacing`: the same
124
+ `<ApollionProvider dimension>` knob (multipliers `0.20 / 0.25 / 0.32`) now
125
+ drives type size, so spacing and typography scale together. `normal` is 1:1
126
+ with the previous px scale (`small` 16px → `1rem`).
127
+ - **Breaking (type):** `theme.font.fontSize.*` changed `number` → `string` (CSS
128
+ `rem`). Additive `theme.font.fontSizePx.*` carries the effective px for layout
129
+ math (e.g. `height = fontSizePx.small * ratio`). Style code that concatenated a
130
+ manual `px` suffix (`` `${theme.font.fontSize.small}px` ``) must drop it.
131
+ - **Tokens:** font left the axis-invariant `base` set — it is now emitted per
132
+ dimension as `font.<dimension>` sets (symmetric with `spacing.<dimension>`),
133
+ with `font.size.*` carrying the resolved `rem` value for that density.
134
+
135
+ ## 4.4.0
136
+
137
+ ### Minor Changes
138
+
139
+ - 1d0fcc6: feat(form): add `Switch` component — on/off toggle for immediate-effect settings.
140
+
141
+ Mirrors the `Checkbox`/`Radio` anatomy (`DefaultInputInterface`, semantic
142
+ `variant`, `label`/`labelProps`) and adds a `size` axis (`small`/`medium`/`large`).
143
+ Renders a native `<input type="checkbox" role="switch">`, keyboard-focusable
144
+ (Tab + Space), with a sliding thumb. Ships stories, tests (variant × size
145
+ snapshots), `README.mdx` + `README.AI.md`, barrel + generated subpath export
146
+ (`@apollion-dsi/core/form/switch`), and catalog/doc updates.
147
+
148
+ ## 4.3.1
149
+
150
+ ### Patch Changes
151
+
152
+ - ADR-010 follow-up: o elemento `Link` agora mira **AA + margem** (~5:1 contra `baseLight`) ao tornar a cor de acento legível via `readableColor`, garantindo ≥ AA também em superfícies levemente diferentes do `baseLight` — footer (`neutral.5`), cards, etc. A v4.3.0 mirava 4.5:1 contra `baseLight` e caía para ~4.42:1 no footer (sub-AA). `readableColor` ganha cobertura de teste da margem.
153
+
154
+ ## 4.3.0
155
+
156
+ ### Minor Changes
157
+
158
+ - ADR-010: `txtOn` por contraste de luminância (`getContrastColor`) — on-color **dark-mode-stable** para superfícies sólidas (marca + feedback/action + interface.function). Corrige o "escuro-no-escuro" em fundos de marca fixos (`main`) no dark mode: o texto agora deriva da luminância do próprio fundo, não do par `baseLight`/`baseDark` que o dark mode troca.
159
+
160
+ Novos tokens Foundation (aditivos): `bg.brand`, `text.onMain`, `text.onOpposite`, `text.onComplementary`.
161
+
162
+ Novo helper `readableColor(color, background, minRatio?)` (export de `themes/colors`) — ajusta a luminância OKLch de uma cor de acento até passar o piso WCAG contra um fundo, **preservando hue/croma** (diferente de `getContrastColor`). Aplicado no elemento `Link`: links de marca agora ficam legíveis sobre fundos escuros (dark mode) sem perder a cor.
163
+
164
+ ## 4.2.0
165
+
166
+ ### Minor Changes
167
+
168
+ - feat(form): `Checkbox`/`Radio` string labels render with DS typography; new `labelProps`
169
+
170
+ String labels now render through the DS `BaseText` styles instead of raw text,
171
+ and the new optional `labelProps` lets consumers override the label typography
172
+ (`fontSize`, `color`, `fontWeight`, …). `ReactNode` labels are rendered as-is,
173
+ unchanged.
174
+
175
+ - feat(themes): native dark mode in `ApollionProvider` + `useApollionTheme`
176
+ - `ApollionProvider` now implements the mode API its types already advertised:
177
+ the `lightTheme`/`darkTheme` pair, controlled `themeMode` +
178
+ `onThemeModeChange`, `useSystemPreference` (watches `prefers-color-scheme`,
179
+ SSR-safe) and `toggleTheme` via the new `useApollionTheme()` hook. The single
180
+ `theme` prop keeps working unchanged.
181
+ - Dark-mode contrast fixes: the `Tabs` header divider now uses a mode-symmetric
182
+ gray (`grayscale.30`), and `InputSelect` no longer hardcodes white — the
183
+ control and menu follow the same surface tokens as the other inputs
184
+ (`grayscale.0`/`baseLight`).
185
+ - Vendor isolation now also blocks `import type` of vendored libs, enforced
186
+ via `@typescript-eslint/no-restricted-imports` in the package lint config.
187
+ - Internal: the `entities/` folder was dissolved — the SSR-safe window helpers
188
+ (`$window`, `$documentBody`, `canuseDom`) moved into `utils` (still exported
189
+ via `@apollion-dsi/core/utils`); the unused `debounce`/`timer` entities were
190
+ removed (never part of the public API).
191
+ - Storybook: stories renamed to `<Component>.story.tsx` and new `Flex`/`Grid`
192
+ stories (not part of the published bundle).
193
+
194
+ ### Patch Changes
195
+
196
+ - 3321f56: fix(core): correct three DataTable/Calendar visual bugs
197
+ - **DataTable EmptyState** now centers horizontally. The 80%-wide empty block
198
+ was pinned to the left because the flex container (a `BaseContainer`, which
199
+ defaults to `flex-direction: column`) lacked `align-items: center` on its
200
+ cross axis.
201
+ - **DataTable pagination** no longer renders an empty scroll region when the
202
+ page size grows. The virtualizer now targets the element that actually
203
+ scrolls — `CustomScroll`'s inner node, exposed via a new optional
204
+ `scrollableRef` prop — instead of the non-scrolling outer container, so
205
+ `getScrollElement` reads the correct `scrollTop`/`clientHeight` and receives
206
+ scroll events.
207
+ - **Calendar** renders the day number on a day that is simultaneously today and
208
+ selected. A CSS specificity collision painted the number in `primary.base`
209
+ over the selected `primary.base` background (invisible); the today rule now
210
+ excludes selected days so the selected contrast color wins.
211
+
212
+ - b3cf796: fix(core): seed type-aware empty defaults in `Form` so fields mount controlled
213
+
214
+ `Form` passed `defaultValues: { ...initialValues }` to `useForm`, so a field
215
+ without an `initialValues` entry mounted with `value={undefined}` (uncontrolled)
216
+ and flipped to controlled on the first change — triggering React's
217
+ "changing an uncontrolled input to be controlled" warning. The new
218
+ `buildDefaultValues` helper seeds every field with a type-aware empty value
219
+ (`false` for checkbox/radio, `''` otherwise — same convention as `Field` reset),
220
+ with `initialValues` taking precedence. No public API change.
221
+
222
+ ## 4.1.0
223
+
224
+ ### Minor Changes
225
+
226
+ - d18737c: Add `DescriptionList` + widen `Field` hint props to `ReactNode` — closes two open "Gaps Apollion" tracked by DEX-Aggregator.
227
+ - **`DescriptionList`** (`@apollion-dsi/core/data-display/description-list`) — new `data-display` component: semantic key/value list (`<dl>`/`<dt>`/`<dd>`) under an optional title, `direction="row" | "column"`. Both `key` and `value` accept `ReactNode`. Absorbs the recurring "key/value card under a title" pattern that clients reimplemented locally (DEX-Aggregator `InfoCard`, ~210 LOC duplicated across 7 screens). Full doc surface (TSDoc + Storybook + README.mdx + README.AI.md) + unit tests.
228
+ - **`Field` hint props accept `ReactNode`.** `hintText`, `hintSuccessText` and `hintErrorText` widen from `string` to `React.ReactNode` (backward-compatible — `string ⊂ ReactNode`). Unblocks inline hint affordances — an action button ("use max"), a daily-limit `Text` — that previously had to render as a sibling outside `Field`, blocking deletion of the consumer wrapper (DEX-Aggregator `InputTextAdapter`).
229
+
230
+ No breaking change. `@apollion-dsi/tokens` bumps in lockstep (`.changeset/config.json#fixed`).
231
+
232
+ - 063e0e9: Align `@apollion-dsi/tokens` DTCG output with the Design Tokens Format Module 2025.10.
233
+ - **Structured values:** `color` `$value` is now an OKLch object `{ colorSpace, components, hex, alpha? }` and `dimension` is `{ value, unit }` (was bare hex / length strings).
234
+ - **Typed IR:** a single intermediate representation (`src/ir.ts`) drives the JSON/CSS/TS renderers as pure projections.
235
+ - **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).
236
+ - **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.*`.
237
+
238
+ `@apollion-dsi/core` now exports the `themes/{border,depth,font}` subpaths so tokens consumes them as the single source of truth.
239
+
240
+ CSS/TS outputs for the existing `bg`/`text`/`spacing` layers are byte-identical; JSON is the spec-interop surface.
241
+
242
+ ## 4.0.0
243
+
244
+ ### Major Changes
245
+
246
+ - bd7d6cb: # v4.0.0 — OKLch + Dimension + Token Split
247
+
248
+ 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).
249
+
250
+ ## Breaking — `@apollion-dsi/core@4.0.0`
251
+ - **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.
252
+ - **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.
253
+ - **`defaultInputColors.opposite` token value changed.** OKLch hue rotation differs from HSL rotation (the OKLch is the perceptually correct opposite). Audit `theme.colors.opposite.*` consumers.
254
+ - **Dimension axis added.** `<ApollionProvider dimension="compact|normal|spacious">` is a new prop; default `normal` preserves v3.x spacing byte-exact. ADR-006 §6 S3.
255
+ - **`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`).
256
+ - **`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.
257
+
258
+ ## Minor — `@apollion-dsi/eslint-config`
259
+ - `culori` + `zod` added to `VENDORED_V4_LIBS` — must import via `vendors/Culori|Zod`.
260
+ - `color` removed from `VENDORED_T2_LIBS` (eliminated).
261
+ - `no-restricted-imports` for `'@apollion-dsi/core'` root: `warn` → `error` (per v4 barrel removal above).
262
+
263
+ ## Major — `@apollion-dsi/tokens@4.0.0` (first release)
264
+
265
+ New package — framework-agnostic design tokens consumed via `runtime/v1` versioned API + `apollion-tokens build` CLI.
266
+ - **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.
267
+ - **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.
268
+ - **DTCG-compliant JSON output** (tech-radar R1).
269
+ - **`as const` TypeScript output** (tech-radar R4).
270
+ - **CSS `@property` declarations** (tech-radar R3) + custom properties `--apollion-{layer}-{role}-{variant}`.
271
+ - **Sandboxed `apollion.config.mjs` loader** (`node:vm` + zod schema) — threat-model T2+E1 mitigation. ADR-006 §3.8 B3 + §6 S6.
272
+ - **Lockstep version** with `@apollion-dsi/core` via `.changeset/config.json#fixed`.
273
+
274
+ ## Minor — `@apollion-dsi/scripts`
275
+ - `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.
276
+ - `verify-no-install-scripts.js` — supply-chain hardening; blocks `preinstall`/`install`/`postinstall` in `@apollion-dsi/*` workspaces (threat-model E2 mitigation).
277
+
278
+ ## Spike validation (preserved local, NOT merged to main)
279
+ - `spike/culori-wcag-parity` — 100.0000% bit-exact culori vs color@5 (262 measurements / 10 palettes). `vendors/Color` elimination LOCKED.
280
+ - `spike/culori-oklch-lerp-parity` — 0 unexpected regressions in 68 deltas; greyscale ramp 19× more uniform in OKLAB L. DECISION ✅ PROCEED.
281
+
282
+ - 879eedd: feat(core)!: ADR-007 S6 — hard cut Formik+Yup vendors (v4.0.0)
283
+
284
+ Completa a migração ADR-007 com a remoção definitiva do legacy stack
285
+ Formik+Yup. Vendors removidos, deps dropped, ESLint VENDORED_LIBS limpo.
286
+
287
+ **Removidos:**
288
+ - `packages/core/src/vendors/Formik/` — 4 arquivos (component.ts, interface.ts, index.ts, README.md).
289
+ - `packages/core/src/vendors/Yup/` — 4 arquivos (mesmo padrão).
290
+ - `formik@2.4.9` removido de `packages/core/package.json#dependencies`.
291
+ - `yup@1.7.1` removido de `packages/core/package.json#dependencies`.
292
+ - `formik` + `yup` removidos de `packages/eslint-config/index.js` `VENDORED_T1_FORM_LIBS`.
293
+ - `yarn.lock` shrunk em ~932 KiB (-9 transitive packages).
294
+
295
+ **Estado pós-S6:**
296
+ - 0 imports diretos de `formik`/`yup` em `packages/core/src/**` e `website/src/**`.
297
+ - `corepack yarn workspace @apollion-dsi/core run check-types`: ✅
298
+ - `corepack yarn workspace @apollion-dsi/core run lint`: ✅
299
+ - `corepack yarn workspace @apollion-dsi/core run validate:tests`: ✅ 317 passed (1 skipped pre-existente), 59 snapshots OK.
300
+ - `corepack yarn workspace @apollion-dsi/website run build`: ✅
301
+ - Bundle form-basic/form-form/form-dynamic: 422 kB First Load JS (unchanged vs S3 — Formik/Yup já eram dead code desde S3).
302
+
303
+ **Status ADR-007:** ✅ Implemented. Todos S0-S6 mergeados.
304
+
305
+ **Achado de sessão:** ADR-006 v4 epic já estava ✅ Implemented (2026-05-25,
306
+ commit `4188501`). O "gate v4.0.0" para S6 era apenas pendência de
307
+ execução, não bloqueio externo. S6 executado imediatamente.
308
+
309
+ **Trabalho restante (fora do escopo ADR-007):**
310
+ 1. `corepack yarn version` — consolida changesets queued, bumpa
311
+ `@apollion-dsi/core@3.0.0 → 4.0.0` (lockstep com `@apollion-dsi/tokens`).
312
+ 2. `corepack yarn release` — npm publish com `--provenance` (ADR-006 §AI-7).
313
+ 3. Visual regression 3-browser full pass na CI antes do release.
314
+
315
+ **Breaking changes consumer-facing (já documentados em MIGRATION-v4.md §1-§8):**
316
+ - `validation` prop em `<Form fields>` agora aceita `ZodTypeAny` (era Yup).
317
+ - `validateOnChange`/`validateOnBlur` booleans → `mode?: Mode` enum.
318
+ - `onError(errors)` recebe `FieldErrors` (era `FormikErrors`).
319
+ - `handleSubmit(values, methods)` recebe `UseFormReturn` no 2º arg (era `FormikHelpers`).
320
+ - `FormRef` type aponta para `UseFormReturn<any>` (era `FormikProps<any>`).
321
+ - `formik` + `yup` removidos de transitive deps — consumers que importavam diretamente do core via barrel devem trocar para `import { z } from 'zod'` / `import { useForm } from 'react-hook-form'` direto.
322
+
323
+ Ver `packages/core/docs/adr/ADR-007-form-stack-rhf-zod.md` §6 Slice 6 +
324
+ `packages/core/MIGRATION-v4.md` para guia consumer-side completo.
325
+
326
+ - e2abc9c: feat(core)!: ADR-008 — router-agnostic polymorphic Link (v4.0.0)
327
+
328
+ `<Link>` deixa de depender de `react-router-dom`. Refactor para polymorphic
329
+ component via prop `as` — default `<a>` nativo; consumer passa
330
+ `as={NextLink}`/`as={RouterLink}`/`as={RemixLink}` para SPA navigation.
331
+
332
+ **Removidos:**
333
+ - `packages/core/src/vendors/ReactRouterDom/` (4 files).
334
+ - `react-router-dom@7.15.0` de `packages/core/package.json#dependencies`.
335
+ - `react-router-dom` de `packages/eslint-config/index.js` `VENDORED_T1_DATA_LIBS`.
336
+ - `<MemoryRouter>` wrapper de `website/pages/_app.jsx` (era só para satisfazer Link RRD-based).
337
+ - Yarn lockfile shrunk **−4.17 MiB** (−4 packages: `react-router-dom`, `react-router`, `cookie`, `set-cookie-parser`).
338
+
339
+ **Refatorados:**
340
+ - `elements/Link/Link.tsx` — single render path; `effectiveAs = isExternal ? 'a' : as`; dropped `getRoute()` helper.
341
+ - `elements/Link/Link.style.ts` — `LinkStyle` + `LinkButtonStyle` base em `baseStyled.a`; styled-components forward `as` prop. Eliminados styles redundantes (`ExternalLinkStyle`, `ExternalLinkButtonStyle`).
342
+ - `elements/Link/Link.interface.ts` — drop `Partial<LinkProps>`; add `as?: React.ElementType` + `to?: any`.
343
+ - `elements/Link/Link.test.tsx` — drop `<Router>` wrapper + `jest.mock('react-router-dom')`.
344
+ - `elements/Link/story.tsx` — drop `MemoryRouter` decorator.
345
+ - `elements/List/story.tsx` — drop `MemoryRouter` decorator (era scaffolding-only).
346
+ - `elements/List/List.tsx` — `<Link to={item.to}>` → `<Link href={item.to}>`.
347
+ - `elements/Link/README.mdx` + `README.AI.md` — rewrite com pattern `as={NextLink}` / `as={RouterLink}`.
348
+ - `hooks/useUnload/README.mdx` — remove exemplo legacy com `<Prompt>` (Prompt nem existe em react-router v6+).
349
+
350
+ **Bundle delta (Next.js First Load JS, website pós-build):**
351
+
352
+ | Page | Pre | Post | Δ |
353
+ | ------------------- | -----: | -----: | -------------: |
354
+ | `form-basic` | 422 kB | 410 kB | −12 kB / −2.8% |
355
+ | `form-form` | 422 kB | 410 kB | −12 kB / −2.8% |
356
+ | `form-input-select` | 411 kB | 399 kB | −12 kB / −2.9% |
357
+ | Shared chunks | 211 kB | 199 kB | −12 kB / −5.7% |
358
+
359
+ **12 kB real savings** em todas pages do website — `react-router-dom` saía amortizado em shared chunks. Aplica também a consumers externos que não usavam RRD (Next.js, Remix). Contraste com ADR-007 (Form migration) que ficou em +1.2%.
360
+
361
+ **Breaking change consumer-facing** (documentado em MIGRATION-v4.md §ADR-008):
362
+ - `<Link to="/x">` sem `as` vira no-op silencioso. Migrar para `<Link as={RouterLink} to="/x">` ou `<Link href="/x">`.
363
+ - `<MemoryRouter>` wrappers que só existiam para satisfazer DS Link podem ser removidos.
364
+
365
+ **Validation:**
366
+ - check-types ✅ / lint ✅ / 317 tests ✅ / 59 snapshots ✅ / core build ✅ / website build ✅
367
+ - 0 imports de `react-router-dom` em `packages/core/src/**` e `website/src/**` (only docs/JSDoc examples remain — legítimos).
368
+
369
+ ROADMAP entry "Router-agnostic Link" → ✅ COMPLETE. ADR-008 Status → ✅ Implemented.
370
+
371
+ Ver `packages/core/docs/adr/ADR-008-router-agnostic-link.md` para análise completa + `packages/core/MIGRATION-v4.md` §ADR-008 para guia consumer-side.
372
+
373
+ ### Minor Changes
374
+
375
+ - 32f7a1d: feat(themes): ADR-002 Slice 2 — Semantic alias layer
376
+
377
+ Adds `theme.semantic` — the intent-named token layer that mirrors Aplica DS
378
+ taxonomy (`semantic.<category>.<group>.<state>.<property>`) and derives
379
+ from the existing structural theme without breaking it.
380
+
381
+ Public API:
382
+ - `theme.semantic.color.feedback.{success|danger|warning|information}.{bg|txtOn|border}`
383
+ - `theme.semantic.color.interface.function.{primary|secondary|tertiary}.normal.{bg|txtOn}`
384
+ - `theme.semantic.color.brand.{first|second|third}.default.{surface|txtOn}`
385
+ - `theme.semantic.dimension.spacing.{zero..giant}` (pre-resolved CSS strings)
386
+ - `createSemantic(input)` helper — pure, idempotent, no side-effects
387
+ - Granular subpath import: `@apollion-dsi/core/themes/semantic`
388
+
389
+ Backward-compatible: `theme.colors.*`, `theme.spacing(...)` and all other
390
+ structural tokens remain untouched. Components migrate at their own pace.
391
+
392
+ Also fixes a latent regression in `scripts/generate-exports.js` that would
393
+ overwrite `package.json#sideEffects` (currently `false` since the v3.0.0
394
+ side-effects-free refactor) back to the legacy allow-list.
395
+
396
+ See `packages/core/docs/adr/ADR-002-layered-theme-aliases-and-surface.md`
397
+ §3, §6 (Slice 2), §9 (grill-with-docs validations).
398
+
399
+ - 2dadba5: feat(themes): ADR-002 Slice 3 — Foundation alias layer
400
+
401
+ Adds `theme.foundation` — ergonomic short aliases over Semantic, designed
402
+ as the **default layer for product code** (DEX, Jovian, Fanaticofc).
403
+
404
+ Public API:
405
+ - `theme.foundation.bg.{primary, secondary, tertiary, success, danger, warning, info}`
406
+ - `theme.foundation.text.{onPrimary, onSecondary, onTertiary, onSuccess, onDanger, onWarning, onInfo}`
407
+ - `theme.foundation.spacing.{xs, sm, md, lg, xl, xxl}` (pre-resolved CSS strings)
408
+ - `createFoundation(semantic)` helper — pure, idempotent (ADR-002 §9 contract)
409
+ - Subpath import: `@apollion-dsi/core/themes/foundation`
410
+ - Cheatsheet: `packages/core/src/themes/Foundation/README.md`
411
+
412
+ Layer-of-choice rule (CONCEPTS.md §3):
413
+ - Product code → Foundation
414
+ - Core components → Semantic
415
+ - Engine internals → Structural (unchanged)
416
+
417
+ Backward-compatible: no breaking change. Existing `theme.colors.*`,
418
+ `theme.spacing(...)`, `theme.semantic.*` remain intact.
419
+
420
+ Storybook MDX cheatsheet deferred (themes folder has no story precedent
421
+ in repo) — replaced by Markdown cheatsheet co-located with the layer.
422
+
423
+ See `packages/core/docs/adr/ADR-002-layered-theme-aliases-and-surface.md`
424
+ §3, §6 (Slice 3).
425
+
426
+ - 820a612: feat(themes): ADR-002 Slice 4 — Surface inversion (positive / negative)
427
+
428
+ Adds contextual surface inversion for Semantic + Foundation **without
429
+ touching Structural**, resolving the "dark card on light page" hack
430
+ documented in ADR-002 §2.
431
+
432
+ Public API:
433
+ - `<SurfaceProvider surface="positive" | "negative">` — lightweight wrapper
434
+ for subtree inversion (preferred). Uses styled-components theme function
435
+ pattern (ADR-002 §9 grill-with-docs §1).
436
+ - `invertForSurface(theme, surface)` — pure, idempotent helper (ADR-002 §9).
437
+ - `ApollionProvider` now accepts `surface` prop for app-wide inversion.
438
+ - New type: `SurfaceMode = 'positive' | 'negative'`.
439
+ - Subpath import: `@apollion-dsi/core/themes/surface`.
440
+ - Quick docs: `packages/core/src/themes/Surface/README.md`.
441
+
442
+ Semantics of inversion (v1):
443
+ - Structural (`theme.colors.*`, `theme.spacing(...)`) untouched.
444
+ - `foundation.bg.{primary,secondary,tertiary}` → `colors.baseDark`.
445
+ - `foundation.bg.<feedback>` → `colors.<feedback>.dark` (hue preserved).
446
+ - `foundation.text.*` → `colors.baseLight` (always).
447
+ - `semantic.color.brand.{n}.default.surface` → `colors.<brand>.dark`.
448
+ - `semantic.color.feedback.<state>.border` → `colors.<state>.base`.
449
+
450
+ Tests: 17 new cases including WCAG contrast sanity checks and subtree
451
+ isolation (negative does not leak to siblings).
452
+
453
+ Limitations (v1, deferred to ADR-003 / v4 epic):
454
+ - Inversion is deterministic and ignores `themeMode` — Apollion v3.x has
455
+ no algorithmic mode resolution yet. v4 will introduce "negative within
456
+ the current mode" semantics per Aplica DS Mode × Surface matrix.
457
+
458
+ Refs:
459
+ - packages/core/docs/adr/ADR-002-layered-theme-aliases-and-surface.md §3.2, §6, §9
460
+ - packages/core/src/themes/Surface/README.md (full cheatsheet)
461
+
462
+ 🎉 ADR-002 epic complete (Slices 1-4 shipped, 3.0.0 → 3.3.0).
463
+
464
+ - 75961a1: feat: novo `Calendar` primitive + `InputDate` reescrito com popover Apollion-styled
465
+
466
+ Substitui o antigo wrapper de `<input type="date">` nativo por um popover
467
+ Apollion-styled. Resolve dois problemas distintos:
468
+ 1. **Bug crítico no `form/Input`**: o default `value = ''` em
469
+ `Input.tsx:27` forçava todos os Inputs ao modo controlled mesmo quando
470
+ o consumer passava apenas `defaultValue`. Afetava `InputDate`,
471
+ `InputCurrency`, `InputMask`, etc. — sintoma reportado era "valor não
472
+ atualiza ao selecionar". Fix cirúrgico + regressão em `Input.test.tsx`.
473
+ 2. **Visual inconsistente cross-browser do `InputDate`**: o picker nativo
474
+ variava de UA pra UA e Safari Desktop não tinha picker nenhum.
475
+
476
+ Mudanças:
477
+ - **Novo:** `elements/Calendar` — primitive de grid headless sobre
478
+ `react-day-picker@9`. Modos `single`/`multiple`/`range`, locale via
479
+ `date-fns` (default `ptBR`), `disabled`/`hidden` via `Matcher`. Não
480
+ cuida de posicionamento — é grid puro. Stories Default/Range/Locale/MinMax.
481
+ - **Refatorado:** `form/InputDate` — `Input[type=text readOnly]` + popover
482
+ com `@floating-ui/react` + `Paper` + `Calendar`. API **drop-in**:
483
+ `onChange: (e: ChangeEvent<HTMLInputElement>) => void` preservado via
484
+ synthetic event (`target.value` em ISO `yyyy-MM-dd`). Adicional
485
+ `onValueChange: (iso) => void` para código novo. Novas props: `locale`,
486
+ `displayFormat`, `minDate`, `maxDate`, `disabledDates`.
487
+ - **Fix:** `form/Input` deixa de forçar `value=""` quando consumer omite
488
+ `value`. Permite `defaultValue` funcionar.
489
+ - **Novo ícone:** `calendar` em `icons/Icons/categoryInterface.tsx`.
490
+ - **Deps:** `react-day-picker@9.5.0`, `date-fns@4.1.0`. ~25 KB gzip.
491
+ - **Subpath export:** `@apollion-dsi/core/elements/calendar` registrado em
492
+ `package.json#exports`.
493
+
494
+ Sem breaking change. Consumers existentes do `InputDate` (zero hoje em
495
+ DEX/Jovian/Fanaticofc) continuam funcionando — `onValueChange` é o caminho
496
+ novo recomendado.
497
+
498
+ Ver `docs/ROADMAP.md` §🟡 Next ("Calendar primitive + InputDate refactor"
499
+ ✅ COMPLETE 2026-05-27).
500
+
501
+ - fba9a41: feat(core): DataTable absorbs faceted filters (per-column drill-down)
502
+
503
+ ROADMAP §🟡 Next "DataTable absorption gaps" — 3rd sub-feature
504
+ shipped (after pagination + tree expansion). Remaining: column
505
+ reordering + detail-panel expansion (deferred — conflicts with
506
+ fixed-row-height virtualizer).
507
+
508
+ Shipped across 4 vertical slices (+ 2 visual baseline commits):
509
+ - **S1** (`552e1ca`) — Vendor extension: added `getFacetedRowModel`,
510
+ `getFacetedUniqueValues`, `getFacetedMinMaxValues` runtime exports
511
+ and `ColumnFiltersState`, `FilterFn` type re-exports to
512
+ `vendors/TanstackReactTable/`. Wrapper test grew from 15 to 21
513
+ invariant cases (`TanstackReactTable.test.ts`).
514
+ - **S2** (`865525c` + baseline `90ce176`) — DataTable wiring + filter
515
+ UI + bonus dead-code fix. New `DataTable.filters.tsx` houses three
516
+ pure sub-components anchored in `<Dropdown>` popovers off the
517
+ header filter icon: - `SelectFilter` — multi-select checkboxes with counts (uses
518
+ `getFacetedUniqueValues()`). - `RangeFilter` — 2 number inputs (uses
519
+ `getFacetedMinMaxValues()` for placeholders). Apply debounced
520
+ 200ms. - `TextFilter` — single input. Case-insensitive contains. Apply
521
+ debounced 200ms. - `VARIANT_FILTER_FN` resolver maps
522
+ `'select' → 'arrIncludesSome'`, `'range' → 'inNumberRange'`,
523
+ `'text' → 'includesString'`. Consumer overrides via
524
+ `Column.filterFn`.
525
+
526
+ New styled `HeaderControls` grouper centralizes the filter + sort
527
+ icon alignment in the header cell. Filter icon click stops
528
+ propagation so it does NOT toggle sort. `useReactTable` spreads
529
+ faceted helpers + columnFilters state conditionally on
530
+ `hasAnyFilter` (derived from `columns.some(c =>
531
+
532
+ c.filterVariant && !c.disableFilters)`) — zero overhead when no
533
+ column opts in.
534
+
535
+ **Bonus fix:** activates `Column.disableFilters` (was no-op for
536
+ multiple cycles). Now hides the filter icon AND sets
537
+ `enableColumnFilter: false` on the corresponding ColumnDef.
538
+
539
+ Filter icon: `ellipsisH` (3-dot more-options) — DS icon registry
540
+ has no `filter`/`funnel` icon; `ellipsisH` reads as "open options".
541
+ A dedicated SVG can land later without changing the public API.
542
+
543
+ Existing 5 DataTable visual baselines regen'd: the `<HeaderControls>`
544
+ wrapper shifts the sort icon's spacing by `theme.spacing('xs')` on
545
+ any sortable column, even when no filter chrome is rendered. The
546
+ functional behavior is unchanged — click on the header still
547
+ toggles sort.
548
+
549
+ - **S3** (`2ce44ef` + baseline `b9fa130`) — New `FacetedFiltering`
550
+ story with 4 columns showcasing all three variants + a
551
+ `disableFilters` override. 9 new jsdom-observable smoke tests
552
+ (mounts per variant, header text co-exists with chrome,
553
+ `disableFilters` honored, controlled / initialColumnFilters,
554
+ consumer filterFn override, default-off path).
555
+ - **S4** (this commit) — README.mdx adds "Filtros por coluna
556
+ (faceted)" section with variant table, controlled + uncontrolled
557
+ examples, `filterFn` override pattern, and the i18n / pipeline /
558
+ drill-down notes. README.AI.md grows by 5 rows (Column-level
559
+ `filterVariant` + `filterFn` + DataTable-level
560
+ `initialColumnFilters`, `columnFilters`, `onColumnFiltersChange`).
561
+ `disableFilters` description corrected (was "exclude from global
562
+ filter" — actually it opts the column out of the per-column filter
563
+ pipeline AND hides the filter icon).
564
+
565
+ New props on `DataTableProps` (all optional, default-off):
566
+ - `initialColumnFilters?: ColumnFiltersState` — uncontrolled init.
567
+ - `columnFilters?: ColumnFiltersState` — controlled state.
568
+ - `onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>` — controlled
569
+ callback; also fires in uncontrolled mode as observer (via reused
570
+ `useHybridState` helper from S2/S3 #8).
571
+
572
+ New props on `Column<T>`:
573
+ - `filterVariant?: 'select' | 'range' | 'text'` — opt-in switch +
574
+ drives UI choice.
575
+ - `filterFn?: FilterFn<T> | string` — custom filter logic override.
576
+
577
+ Non-breaking for existing consumers — all new props default-off. The
578
+ `Column.disableFilters` activation is technically observable but the
579
+ declared semantics were already what the docs said; the no-op was the
580
+ bug.
581
+
582
+ 40 suites · 318 tests passing. Coverage 69.72 / 50.57 / 56.65 / 69.42
583
+ (vs floors 68/48/53/67).
584
+
585
+ - 3a90653: feat(core): DataTable absorbs pagination + expandable tree rows
586
+
587
+ ROADMAP §🟡 Next "DataTable absorption gaps" — 2 of 4 sub-features
588
+ shipped this cycle. The remaining 2 (column reordering, faceted
589
+ filters) stay open for future cycles; detail-panel expansion is
590
+ documented as a separate gap (conflicts with the fixed-row-height
591
+ virtualizer).
592
+
593
+ Shipped across 4 vertical slices:
594
+ - **S1** (`e53fec6`) — Vendor extension: added `getPaginationRowModel`
595
+ - `getExpandedRowModel` runtime exports and `PaginationState`,
596
+ `ExpandedState`, `OnChangeFn` type re-exports to
597
+ `vendors/TanstackReactTable/`. Closed the pre-existing wrapper-test
598
+ gap (15 invariant cases mirror FloatingUI / TanstackReactVirtual S1
599
+ pattern).
600
+ - **S2** (`ac54bd8` + baseline `3d3a45e`) — Pagination: opt-in via
601
+ `paginated: true`. New `PaginationRow` styled + `PaginationControls`
602
+ pure component (`"Mostrando X-Y de Z"` + Anterior / page indicator /
603
+ Próximo + page-size dropdown). Hybrid state pattern via new
604
+ `useHybridState<T>` helper that unifies controlled/uncontrolled in a
605
+ single `[value, setValue]` callsite. New `Paginated` story + 1
606
+ visual baseline. 8 new tests.
607
+ - **S3** (`808d162` + baseline `763bbe6`) — Expandable tree: opt-in
608
+ via `getSubRows` callback. New `buildExpandColumnDef` helper mirrors
609
+ `buildSelectableColumnDef`; expand toggle column injected leftmost
610
+ (read order: "control the tree → select what you see → consume
611
+ data"). Chevron indented by `row.depth * 16px`. `useHybridState`
612
+ reused for `ExpandedState`. New `Expandable` story + 1 baseline. 5
613
+ new tests.
614
+ - **S4** (this commit) — README.mdx adds "Paginação client-side" +
615
+ "Linhas expansíveis (modo tree)" sections with controlled +
616
+ uncontrolled examples. README.AI.md props table extended with the
617
+ 10 new props. ROADMAP entry stays in `🟡 Next` annotated with the
618
+ shipped sub-features.
619
+
620
+ New props on `DataTableProps` (all optional, default-off):
621
+
622
+ Pagination:
623
+ - `paginated?: boolean` — opt-in flag.
624
+ - `initialPagination?: Partial<PaginationState>` — uncontrolled init.
625
+ - `pagination?: PaginationState` — controlled state.
626
+ - `onPaginationChange?: OnChangeFn<PaginationState>` — controlled
627
+ callback; also fires in uncontrolled mode as observer.
628
+ - `pageSizeOptions?: number[]` — default `[10, 25, 50, 100]`. Empty
629
+ or single-element hides the page-size selector.
630
+
631
+ Expandable (tree mode):
632
+ - `getSubRows?: (row: T, index: number) => T[] | undefined` — opt-in.
633
+ - `expandedColumnWidth?: number` — defaults to
634
+ `selectableColumnWidth`.
635
+ - `initialExpanded?: ExpandedState` — uncontrolled init (use `true`
636
+ to expand all).
637
+ - `expanded?: ExpandedState` — controlled state.
638
+ - `onExpandedChange?: OnChangeFn<ExpandedState>` — controlled callback.
639
+
640
+ Non-breaking for existing consumers — all new props default-off, none
641
+ of the 21 existing DataTable visual baselines drift, public API of
642
+ `DataTableProps` is purely additive.
643
+
644
+ Strings (`"Mostrando X-Y de Z"`, `"Anterior"`, `"Próximo"`,
645
+ `"{N} / página"`) hardcoded PT-BR — consistent with `EmptyTable`'s
646
+ default `"Nada foi encontrado"`. Apollion has no i18n layer today;
647
+ documented gap.
648
+
649
+ 40 suites · 302 tests passing. Coverage `70.46 / 50.95 / 57.73 /
650
+ 70.17` (vs floors `68 / 48 / 53 / 67`).
651
+
652
+ - 5fca933: feat(core): swap `react-window` for `@tanstack/react-virtual` in DataTable
653
+
654
+ ROADMAP §🟡 Next "Migrate ReactWindow → @tanstack/react-virtual" closes
655
+ across 4 vertical slices:
656
+ - **S1** (`456b13e`) — Scaffolded `vendors/TanstackReactVirtual/`
657
+ re-exporting `useVirtualizer` + `Virtualizer` + `VirtualItem` from
658
+ `@tanstack/react-virtual@^3.13.26`. 3 wrapper-invariant unit tests
659
+ modeled on ADR-005 S2.
660
+ - **S2** (`e04e6c4`) — Refactored `DataTable.tsx` virtualization block
661
+ to use the hook via a small internal `VirtualizedRows` wrapper. The
662
+ public `renderRow({ index, style })` callsite contract stayed
663
+ stable. Dropped the file-level `@ts-ignore` and the inline
664
+ `@ts-ignore TS2786` over the JSX block. Replaced
665
+ `outerElementType={VitualScrollbar}` with direct
666
+ `<VitualScrollbar ref={parentRef}>`. Added 4 jsdom-observable
667
+ characterization tests (mount / headers / empty state). Refreshed
668
+ one visual-regression baseline (`components-datatable--bordered`,
669
+ 0.19% pixel drift on transform-vs-absolute border rendering).
670
+ - **S3** (`04d9f7e`) — Added 8 wide-scope smoke tests: header chrome
671
+ (title / hasHeader gating / search placeholder), header checkbox
672
+ select-all + deselect cycles via `onRowSelect`, spacing-menu
673
+ rendering, sortable-header click cycle.
674
+ - **S4** (this commit) — Removed `vendors/ReactWindow/` and the
675
+ `react-window` + `@types/react-window` deps. Flipped the
676
+ `VENDORED_T1_UI_LIBS` allow-list in `@apollion-dsi/eslint-config`
677
+ to replace `'react-window'` with `'@tanstack/react-virtual'` so the
678
+ vendor-isolation rule keeps catching future direct imports outside
679
+ `src/vendors/**`.
680
+
681
+ Why the swap (driver):
682
+ 1. **Same family as `@tanstack/react-table`** (already vendored). One
683
+ fewer mental model, one fewer audit surface.
684
+ 2. **React 19 + TS 6 compatibility.** `react-window` is class-component
685
+ with an incompatible type shape — required `@ts-ignore TS2786` at
686
+ the JSX site. Hook surface removes that debt.
687
+ 3. **Variable-row-height unlocked.** `useVirtualizer` exposes
688
+ `estimateSize: (i) => number` + opt-in `measureElement`. Future
689
+ DataTable variable-row work (ROADMAP §🟡 "DataTable absorption
690
+ gaps") needs no further vendor swap.
691
+
692
+ Non-breaking for consumers — `DataTable<T>` public API
693
+ (`data` / `columns` / `height` / `striped` / `bordered` / `hasHeader` /
694
+ `onRowSelect` / `renderRow`-like callbacks via `Column.Cell`) stays
695
+ identical. Bundle delta: react-window 1.8.11 + @types/react-window
696
+ 1.8.8 (~7 KB shipped + types) out, @tanstack/react-virtual 3.13.26 +
697
+ @tanstack/virtual-core 3.16.0 (~12 KB shipped) in. Net node_modules
698
+ freed: 929 KiB.
699
+
700
+ Coverage at the end of the swap: statements 69.95 / branches 49.69 /
701
+ functions 56.08 / lines 69.63 — comfortably above the ratchet floors
702
+ (68 / 48 / 53 / 67). +1 vendor test suite + 1 DataTable test suite (12
703
+ cases total).
704
+
705
+ - ea3dc3a: feat(core): swap `@tippyjs/react/headless` for `@floating-ui/react` in Tooltip + Dropdown
706
+
707
+ ROADMAP §🟡 Next "Migrate TippyHeadless → @floating-ui/react" closes
708
+ across 4 vertical slices, all landed in the same day:
709
+ - **S1** (`f75e428`) — Scaffolded `vendors/FloatingUI/` re-exporting
710
+ the runtime surface from `@floating-ui/react@^0.27.19`: 10 hooks
711
+ (`useFloating`, `useInteractions`, `useClick`, `useHover`,
712
+ `useFocus`, `useDismiss`, `useRole`), 2 components
713
+ (`FloatingPortal`, `FloatingFocusManager`), 5 middleware (`arrow`,
714
+ `offset`, `flip`, `shift`, `autoUpdate`), 4 types (`Placement`,
715
+ `Strategy`, `MiddlewareData`, `OpenChangeReason`). 29 wrapper-
716
+ invariant unit tests (singleton + runtime shape + type re-exports).
717
+ - **S2** (`d61a111`) — Refactored `Tooltip.tsx` from `<Tippy
718
+ render={…}>` to `useFloating + useInteractions([useHover(restMs: 40),
719
+ useFocus(), useDismiss(), useRole({ role: 'tooltip' })])`. Added
720
+ `useFocus` per Q2 of the grill so the tooltip also opens on Tab
721
+ focus (a11y AAA). Arrow positioning is now inline at the callsite,
722
+ reading `middlewareData.arrow.{x, y}` (Q3 option a). Tooltip gained
723
+ its first `.test.tsx` (6 cases on the controlled `visible` path —
724
+ jsdom can't observe uncontrolled hover/focus). Dropped the
725
+ `@ts-ignore TS2786`.
726
+ - **S3** (`681f73b`) — Refactored `Dropdown.tsx` to `useFloating +
727
+ useInteractions([useClick({ enabled: !function-children }),
728
+ useHover({ enabled: hoverable }), useDismiss(), useRole({ role })])`.
729
+ Per Q1.a: `role: 'menu'` when `options` prop is passed, `role:
730
+ 'dialog'` when arbitrary `content` — `useRole(context, { role })`
731
+ injects the correct `aria-haspopup` and the floating-element role.
732
+ Wraps the floating element in `<FloatingPortal>` +
733
+ `<FloatingFocusManager modal={false} initialFocus={-1}>` (no trap,
734
+ no auto-focus jump — preserves the legacy click-and-pick UX).
735
+ Existing 5 tests in `Dropdown.test.tsx` pass unchanged. Dropped
736
+ the `@ts-ignore TS2786`.
737
+ - **S4** (this commit) — Removed `vendors/TippyHeadless/` and the
738
+ `@tippyjs/react` dep. Flipped the `VENDORED_T1_UI_LIBS` allow-list
739
+ in `@apollion-dsi/eslint-config` to replace
740
+ `'@tippyjs/react/headless'` with `'@floating-ui/react'` so the
741
+ vendor-isolation rule keeps catching future direct imports outside
742
+ `src/vendors/**`. Removed the corresponding ROADMAP entry per the
743
+ new convention (drop completed items instead of striking them
744
+ through — see `7c2d253`).
745
+
746
+ Why the swap (driver):
747
+ 1. **`tippy.js` sem release ≥ 18 meses.** `floating-ui` is the de
748
+ facto successor, maintained by the original Popper author whose
749
+ library `tippy.js` already wrapped internally. Same family, zero
750
+ functional regression in the consumer-facing surface.
751
+ 2. **Explicit a11y.** Tippy didn't dictate ARIA. `useRole(context, {
752
+ role })` injects `role="tooltip" | "menu" | "dialog"` plus the
753
+ matching `aria-haspopup` / `aria-describedby` linkage via prop
754
+ getters. A11y is now code, not hope.
755
+ 3. **Composição visível.** `<Tippy interactive onClickOutside={…}>`
756
+ packaged hover/click/focus/dismiss into a single opaque boolean.
757
+ floating-ui demands `useInteractions([useClick, useHover, useFocus,
758
+ useDismiss, useRole])` — the reader knows exactly which behaviors
759
+ are wired. Tested invariants per `enabled` flag.
760
+ 4. **Type ergonomics.** Pure hooks — no `@ts-ignore TS2786` (which
761
+ was required in 2 sites with React 19 + TS 6).
762
+
763
+ Non-breaking for consumers — `TooltipProps` and `DropdownProps`
764
+ public surface unchanged. `interactive?: boolean` on `Tooltip` is
765
+ kept as a `@deprecated` legacy no-op because floating-ui's tooltip is
766
+ inherently interactive (hover/focus on the floating element doesn't
767
+ trigger dismiss). `position` props now type as `Placement` from
768
+ `@floating-ui/react` — same 12 string-literal values as Tippy.
769
+
770
+ Bundle delta:
771
+ - Out: `@tippyjs/react@4.2.6` + transitive `tippy.js@6.3.7` (~2.23 MiB
772
+ on disk, ~16 KB shipped).
773
+ - In: `@floating-ui/react@0.27.19` + transitive `@floating-ui/react-
774
+ dom`, `@floating-ui/utils`, `tabbable` (~911 KiB on disk, ~11 KB
775
+ shipped).
776
+ - Net: ~5 KB shipped reduction; ~1.32 MiB node_modules freed.
777
+
778
+ Coverage at the end of the swap: statements 70.25 / branches 49.97 /
779
+ functions 57.37 / lines 70.01 — comfortably above the ratchet floors
780
+ (68 / 48 / 53 / 67). +1 vendor test suite (29 cases) + 1 Tooltip test
781
+ suite (6 cases).
782
+
783
+ ### Patch Changes
784
+
785
+ - 032f81c: docs: ADR-002 Slice 1 — CONCEPTS.md + README lineage
786
+
787
+ Adds conceptual reference document covering the Layer Cake (Structural →
788
+ Semantic → Foundation), 3-group communication model (Abstraction / Intent /
789
+ Consumer), Learning Spiral with three personas, bilingual glossary (PT-BR /
790
+ EN-US), and the Apollion ⇄ Aplica DS vocabulary map.
791
+
792
+ Credits Fernando Poe (co-author of Apollion 2020, author of
793
+ [Aplica DS](https://aplica.me/en/)) in a new Lineage & Acknowledgements
794
+ section of the README.
795
+
796
+ Doc-only. Zero API change.
797
+
798
+ See `packages/core/docs/adr/ADR-002-layered-theme-aliases-and-surface.md` §6
799
+ (Migration Plan, Slice 1).
800
+
801
+ - c056ee3: chore(core,eslint-config): ADR-004 backfill — vendor `react-day-picker` + `date-fns` + InputDate hardening
802
+
803
+ Pattern-guardian audit do commit `75961a1 Input Date` (Calendar primitive +
804
+ InputDate refactor) flagueou 4 desvios vs Apollion gold standard. Backfill
805
+ consolidado neste PR:
806
+
807
+ **V1 — ADR-004 backfill (2 novos vendors, vendor count 16 → 18):**
808
+ - **ReactDayPicker** (T1 UI, 4 files)
809
+ - Absorbed runtime: `DayPicker`
810
+ - Absorbed types: `DayPickerProps`, `Mode`, `DateRange`, `Matcher`,
811
+ `PropsSingle`, `PropsSingleRequired`, `PropsRange`, `PropsRangeRequired`
812
+ - Gap intencional: `useDayPicker` hook, `Modifier` API, plugins `addons`
813
+ — reabsorver quando `InputDateTime`/`TimePicker` (ROADMAP) precisar.
814
+ - **DateFns** (util tier, 4 files, novo `VENDORED_DATE_LIBS` na eslint-config)
815
+ - Absorbed runtime: `format`, `parse`, `parseISO`, `isValid`
816
+ - Absorbed locales: `ptBR`, `enUS`
817
+ - Absorbed types: `Locale`
818
+ - Gap intencional: `addDays`/`subDays`/aritmética, `formatDistance`/
819
+ formatação relativa, locales adicionais — adicionar conforme demanda.
820
+
821
+ Sites migrados (8 files): Calendar.tsx, Calendar.interface, Calendar.test,
822
+ Calendar/story, InputDate.tsx, InputDate.interface, InputDate.test,
823
+ InputDate/story.
824
+
825
+ **V2 — `parseInputDate` removido** do barrel `form/InputDate/index.ts`:
826
+ re-export vazava `date-fns` na public surface do DS (anti-pattern
827
+ ADR-004). Sem consumers conhecidos. Consumers que precisem importam
828
+ direto de `date-fns` no próprio package.
829
+
830
+ **V3 — `InputDate.handleKeyDown` a11y**: rewrite blocklist → allowlist.
831
+ Antes: `preventDefault` em tudo exceto Tab/Enter/Space — Esc, ArrowUp/Down/
832
+ Left/Right, Home, End, PageUp/Down ficavam swallowed, quebrando
833
+ `useDismiss({ escapeKey: true })`. Agora: `preventDefault` só em printable
834
+ chars (`key.length === 1 && key !== ' '`); named keys bubblam livremente.
835
+ WCAG 2.1.1 ok.
836
+
837
+ **V4 — `buildSyntheticEvent` extraído** para `form/InputDate/buildSyntheticEvent.ts`:
838
+ helper com cast-chain `as unknown as ChangeEvent` é fragile sob mudança
839
+ de shape em majors do React. Novo arquivo dedicado + 6 testes de contrato
840
+ runtime detectam drift cedo.
841
+
842
+ **Determinismo visual**: `Calendar/story.tsx` agora pin `FIXED_TODAY`
843
+ constant + `today`/`month` props nas 4 stories — baseline não drifta
844
+ diariamente conforme `new Date()` muda (era 0.5%+ por dia, acima do
845
+ threshold 0.1%).
846
+
847
+ Backward-compatible runtime API. Validate verde
848
+ (54 visual tests, 352+ unit tests, lint, typecheck, build).
849
+
850
+ Refs:
851
+ - `packages/core/docs/adr/ADR-004-vendor-isolation-policy.md` (status
852
+ atualizado: 18 vendors após backfill)
853
+ - `docs/ROADMAP.md` §"Calendar primitive + InputDate refactor" (hardening
854
+ block adicionado)
855
+ - `packages/core/src/vendors/ReactDayPicker/README.md` + DateFns/README.md
856
+
857
+ - d032437: docs(core): ADR-004 / PRD-001 S0 — vendor isolation scaffold
858
+
859
+ Approves ADR-004 (Vendor Isolation Policy) and PRD-001 (Vendor Isolation
860
+ Execution). Adds the infrastructure that makes `packages/core/src/vendors/`
861
+ internal-only:
862
+ - `esbuild.js` skips `vendors/` in `findEntryPoints` so wrappers never
863
+ become bundle entry points.
864
+ - `scripts/check-vendors-not-published.js` (new) asserts the invariant
865
+ post-build: no `lib/vendors/**` and no `./vendors/*` keys in
866
+ `package.json#exports`. Wired into `validate.sh`.
867
+ - `docs/CONCEPTS.md` gets a new §8 Vendor Isolation covering the canonical
868
+ shape (`component.ts` / `interface.ts` / `index.ts` / `README.md`), hard
869
+ rules, and rationale.
870
+ - `ROADMAP.md` moves vendor isolation to 🔴 Now.
871
+
872
+ `generate-exports.js` needed no change: its allow-list (`LEAF_CATEGORIES`,
873
+ `UTIL_CATEGORIES`) already excludes `vendors/` by construction.
874
+
875
+ No vendor wrappers in this slice. No API surface change. Doc + infra only.
876
+
877
+ See `packages/core/docs/adr/ADR-004-vendor-isolation-policy.md` §6 (Migration
878
+ Plan, Slice 0) and `packages/core/docs/prd/PRD-001-vendor-isolation-execution.md`.
879
+
880
+ - 00e0525: feat(core,eslint-config): ADR-004 Slice 1 — T2 utils vendoring
881
+
882
+ Vendor 8 T2 utility libs (re-export wrappers only) into
883
+ `packages/core/src/vendors/<Lib>/`, migrating all direct imports across
884
+ the core, and add a `no-restricted-imports` ESLint rule (severity `warn`)
885
+ that enforces the policy in `@apollion-dsi/eslint-config`.
886
+
887
+ **Vendored libs (T2 utils, 8 wrappers × 4 files):**
888
+ - Nanoid (4 sites)
889
+ - LodashDebounce (2)
890
+ - ObjectHash (1)
891
+ - Deepmerge (1)
892
+ - Color (3 — incl. Surface.test.tsx)
893
+ - FastDeepEqual (1)
894
+ - EmotionIsPropValid (2)
895
+ - StyledNormalize (1)
896
+
897
+ **Each vendor ships with:**
898
+ - `component.ts` — typed re-export of the absorbed surface
899
+ - `interface.ts` — DS-owned contract (skeleton for S1; full opinionated
900
+ shape will land per-lib in S2-S4 where DS opinion matters more)
901
+ - `index.ts` — barrel
902
+ - `README.md` — skeleton with `## What this vendor wraps` etc. — full
903
+ pass in S5
904
+
905
+ **ESLint rule (`@apollion-dsi/eslint-config`):**
906
+ - Path-scoped to `packages/core/src/**/*.{ts,tsx}`
907
+ - Allows direct upstream imports inside `packages/core/src/vendors/**`
908
+ - Severity `warn` in S1-S5 (grace period); flips to `error` in S6
909
+ - Other workspaces unaffected (paths don't match)
910
+
911
+ **Backward-compatible:** vendors are internal (esbuild skips the folder,
912
+ generate-exports.js doesn't list them, validate.sh's
913
+ `check-vendors-not-published.js` keeps the invariant). Consumer-side import
914
+ surface (`@apollion-dsi/core/elements/button` etc.) unchanged.
915
+
916
+ Bundle delta target: ≤ 0 KB gzip (re-exports are inlined by esbuild).
917
+
918
+ Refs:
919
+ - `packages/core/docs/adr/ADR-004-vendor-isolation-policy.md` §6 Slice 1
920
+ - `packages/core/docs/prd/PRD-001-vendor-isolation-execution.md` §S1
921
+
922
+ - 1c87be8: feat(core,eslint-config): ADR-004 S2 — T1 UI primitives vendoring
923
+
924
+ Vendor 4 T1 UI primitive libs into `packages/core/src/vendors/<Lib>/`
925
+ and migrate 12 direct import sites. Extends the ESLint
926
+ `no-restricted-imports` rule (warn) to cover the new vendors.
927
+
928
+ **Vendored libs (T1 UI, 4 × 4 files):**
929
+ - FramerMotion (6 sites: Modal, Notification × 3, Flex.style, Base.style)
930
+ - Absorbed: `motion`, `AnimatePresence`, `MotionConfig`, `useReducedMotion`, `MotionProps`
931
+ - Gap: gestures, drag, useAnimate, useScroll, layoutGroup (intentional — DS doesn't expose full expressiveness)
932
+ - TippyHeadless (3 sites: Dropdown, Tooltip × 2)
933
+ - Absorbed: `Tippy` default + `TippyProps`
934
+ - Uses headless entry only (no embedded CSS)
935
+ - ReactContentLoader (2 sites: ComposedSkeleton × 2)
936
+ - Absorbed: `ContentLoader`, `BulletList`, `Code`, `Facebook`, `List`, `IContentLoaderProps`
937
+ - ReactWindow (1 site: DataTable)
938
+ - Absorbed: `FixedSizeList` only
939
+
940
+ Backward-compatible. Bundle delta target ≤ +0.1 KB gzip per ADR-004 §6.
941
+ Snapshot tests Modal/Notification (framer consumers) inalterados.
942
+
943
+ Refs:
944
+ - `packages/core/docs/adr/ADR-004-vendor-isolation-policy.md` §6 Slice 2
945
+ - `packages/core/docs/prd/PRD-001-vendor-isolation-execution.md` §S2
946
+
947
+ - d1192da: feat(core,eslint-config): ADR-004 S3 — T1 form/validation vendoring
948
+
949
+ Vendor 3 T1 form/validation libs into `packages/core/src/vendors/<Lib>/`
950
+ and migrate 13 direct import sites. Slice mais opinativo do épico
951
+ ADR-004 — `interface.ts` faz o exercício real de "contrato ideal do DS,
952
+ não espelho da lib" (ADR-004 §6 S3).
953
+
954
+ **Vendored libs (T1 form/validation, 3 × 4 files):**
955
+ - **Formik** (4 sites: Form.{interface,tsx,helpers}, Field.interface)
956
+ - Absorbed runtime: `useFormik` apenas (DS expõe `Form`/`Field`/`FieldGroup` próprios)
957
+ - Absorbed types: `FormikErrors`, `FormikHelpers`, `FormikProps`, `FormikSharedConfig`
958
+ - Gap intencional: `<Field>`, `<FieldArray>`, `<ErrorMessage>`, `Formik`, `FormikProvider`, `useFormikContext`, `useField`, `withFormik`, wizards
959
+ - **Yup** (4 sites: Form.{interface,tsx,helpers}, story.tsx)
960
+ - Absorbed: namespace inteiro via `export *` — preserva padrão `import * as Yup`
961
+ - Justificativa: Yup é DSL; restringir builders quebra expressividade
962
+ - **ReactSelect** (5 sites: InputSelect.{tsx,interface}, DropdownIndicator)
963
+ - Sync + `/async` consolidados em 1 wrapper
964
+ - Absorbed runtime: `DefaultSelect`, `AsyncSelect`, `components`
965
+ - Absorbed types: `DropdownIndicatorProps`, `ReactSelectProps` (re-export renomeado de `Props`)
966
+ - Gap: `Creatable`, `formatGroupLabel`, `MenuListProps`, `MultiValue`, sortable
967
+
968
+ ESLint rule estendida para cobrir `formik`, `react-select`,
969
+ `react-select/async`, `yup` com severidade `warn` (flips em S6).
970
+
971
+ Backward-compatible. Bundle delta target ≤ +0.1 KB gzip em `lib/form/form/`.
972
+
973
+ Refs:
974
+ - `packages/core/docs/adr/ADR-004-vendor-isolation-policy.md` §6 Slice 3
975
+ - `packages/core/docs/prd/PRD-001-vendor-isolation-execution.md` §S3
976
+
977
+ - 3194fba: feat(core,eslint-config): ADR-004 S4 — T1 data/routing vendoring
978
+
979
+ Vendor 2 T1 data/routing libs into `packages/core/src/vendors/<Lib>/`
980
+ and migrate 7 direct import sites.
981
+
982
+ **Vendored libs (T1 data/routing, 2 × 4 files):**
983
+ - **ReactRouterDom** (5 sites: Link.style, Link.interface, Link.test,
984
+ List/story, Link/story)
985
+ - Absorbed runtime: `Link`, `MemoryRouter` (stories + tests apenas)
986
+ - Absorbed types: `LinkProps`
987
+ - Gap intencional: tudo o mais. Decisão consciente (ADR-004 §9 Q3):
988
+ DS não deve ditar router. Reabsorver é diff por símbolo + entrada
989
+ de roadmap. `BrowserRouter`, `Route`, `Routes`, `Outlet`,
990
+ `useNavigate`, `useLocation`, `useParams`, `NavLink`, `Navigate`
991
+ não absorvidos.
992
+ - **TanstackReactTable** (2 sites: DataTable.tsx multi-import + DataTable.interface)
993
+ - Absorbed runtime: `useReactTable`, `flexRender`, `getCoreRowModel`,
994
+ `getSortedRowModel`, `getFilteredRowModel`
995
+ - Absorbed types: `ColumnDef`, `Row`, `RowSelectionState`,
996
+ `SortingState`
997
+ - Gap: `getExpandedRowModel`, `getGroupedRowModel`,
998
+ `getPaginationRowModel`, `getFacetedRowModel` + types `Cell`,
999
+ `Header`, `Table`, `RowModel`, `Column`, etc. — features que
1000
+ DataTable do core não suporta hoje.
1001
+
1002
+ ESLint rule estendida (warn) cobrindo `@tanstack/react-table` e
1003
+ `react-router-dom`.
1004
+
1005
+ Backward-compatible. Validate target verde (180+ tests, snapshots
1006
+ inalterados em DataTable/Link).
1007
+
1008
+ Refs:
1009
+ - `packages/core/docs/adr/ADR-004-vendor-isolation-policy.md` §6 Slice 4
1010
+ - `packages/core/docs/prd/PRD-001-vendor-isolation-execution.md` §S4
1011
+
1012
+ - f359982: docs(core): ADR-004 S5 — Vendor README full pass
1013
+
1014
+ Preenche os 17 vendor READMEs (skeleton → completo) com 3 seções
1015
+ padronizadas + atualiza ROADMAP com 6 entradas derivadas de gaps:
1016
+
1017
+ **Cada vendor README agora tem:**
1018
+ - `## What this vendor wraps` — npm link + versão exata + tabela
1019
+ símbolo → tipo → uso no core
1020
+ - `## DS Absorption Gap` — bullet do que ficou fora + rationale + link
1021
+ ROADMAP quando candidato
1022
+ - `## Replacement candidates` — libs concorrentes com trade-off explícito
1023
+ - "When to consider" + triggers de troca quantificados
1024
+
1025
+ **Novas entradas em ROADMAP.md (🟡 Next):**
1026
+ 1. Migrate ReactWindow → @tanstack/react-virtual (Low burn, consolida ecosystem)
1027
+ 2. Migrate TippyHeadless → @floating-ui/react (Medium burn, sucessor natural)
1028
+ 3. Router-agnostic Link — remove react-router-dom dep (Medium, candidato ADR-006)
1029
+ 4. DataTable absorption gaps (expandable rows, pagination, etc.)
1030
+ 5. FormWizard absorption + Combobox replacement evaluation
1031
+ 6. Zod/Valibot evaluation paired with form library refactor
1032
+
1033
+ **Resolve numbering conflict:**
1034
+ - ADR-003 (file) = Visual regression (não "v4 epic")
1035
+ - ADR-005 = styled-components facade (placeholder)
1036
+ - ADR-006 = v4 epic (OKLch + Dimension + token-only) — renomeado de "ADR-003"
1037
+
1038
+ Remove entrada duplicada "Visual regression suite (Chromatic)" de 🟡 Next
1039
+ (agora coberta por ADR-003).
1040
+
1041
+ Doc-only. Sem mudança de código/API. Patch bump.
1042
+
1043
+ Refs:
1044
+ - packages/core/docs/adr/ADR-004-vendor-isolation-policy.md §6 Slice 5
1045
+ - packages/core/docs/prd/PRD-001-vendor-isolation-execution.md §S5
1046
+
1047
+ - 5d17ebc: feat(core, eslint-config): ADR-005 — styled-components vendor facade
1048
+
1049
+ Closes the Vendor Isolation epic (ADR-004 §5 leftover). styled-components
1050
+ becomes vendor #18 under `packages/core/src/vendors/StyledComponents/`,
1051
+ following the same canonical 4-file shape used by the other vendors.
1052
+
1053
+ **Core (`@apollion-dsi/core`):**
1054
+ - New `vendors/StyledComponents/{component.ts, interface.ts, index.ts,
1055
+ README.md, StyledComponents.test.ts}`. Wrapper re-exports the surface
1056
+ consumed by the core (runtime: `styled`, `css`, `keyframes`,
1057
+ `ThemeProvider`, `StyleSheetManager`, `createGlobalStyle`, `useTheme`;
1058
+ types: `CSSObject`, `DefaultTheme`, `Interpolation`, `IStyledComponent`,
1059
+ `RuleSet`, `Styled`).
1060
+ - `DefaultTheme extends Theme` augmentation moved out of
1061
+ `src/typings/index.d.ts` into the co-located `vendors/StyledComponents/
1062
+ interface.ts`. `typings/index.d.ts` reduced to `@testing-library/jest-dom` - the legacy `react-table` module declaration.
1063
+ - 62 sites under `src/**/*.{ts,tsx}` codemoded from `import ... from
1064
+ 'styled-components'` to the vendor wrapper via the new
1065
+ `scripts/migrate-styled-components-imports.js` helper. READMEs in
1066
+ `containers/Base/README.{mdx,AI.md}` preserved — consumer-facing examples
1067
+ must keep showing `from 'styled-components'`.
1068
+ - `@types/styled-components@5.1.36` removed from `devDependencies` — dead
1069
+ for `styled-components@6.x`, which ships its own `dist/index.d.ts`.
1070
+ - Vendor test verifies (a) singleton — wrapper re-exports identical
1071
+ upstream runtime references, (b) `Theme` `satisfies DefaultTheme` at
1072
+ compile time, (c) `useTheme()` returns the `Theme`-shaped object injected
1073
+ by `<ApollionProvider>`.
1074
+
1075
+ **ESLint config (`@apollion-dsi/eslint-config`):**
1076
+ - New `VENDORED_STYLED_LIBS = ['styled-components']` group folded into
1077
+ `VENDORED_LIBS`. The existing `no-restricted-imports` rule now blocks
1078
+ direct `from 'styled-components'` in `packages/core/src/**` (vendor
1079
+ directory remains exempt). Severity `error` from day one — the codemod
1080
+ guarantees zero violations before the rule activates, so the
1081
+ warn-intermediate phase originally proposed in ADR-005 §6 S3 was
1082
+ skipped (documented in ADR-005 §11.2).
1083
+
1084
+ Non-breaking: consumer-facing API and `ApollionProvider` behavior
1085
+ unchanged. See `packages/core/docs/adr/ADR-005-styled-components-vendor-facade.md`
1086
+ §11 for the full set of deviations between the planned and executed slices.
1087
+
1088
+ - 6545751: docs(core): ADR-007 — Zod v4 idiomatic corrections + shadow-PoC S1 wording
1089
+
1090
+ Atualiza ADR-007 (Form stack migration) com correções pós grill-with-docs
1091
+ (2026-05-27) sobre as APIs externas reais:
1092
+ - **§S1 wording:** clarifica que S1 é **shadow-PoC em arquivo novo**
1093
+ (`poc-rhf-zod.tsx`), NÃO migração do example atual. Examples atuais usam
1094
+ `<Form>` do DS que ainda é Formik-backed em S0/S1 — migrar example exige
1095
+ S2 (DS Form refactor) primeiro. Shadow-PoC destrava sem reverter ordem.
1096
+ - **§S2 + §7 PoC code:** validation API muda de `validateOnChange`/
1097
+ `validateOnBlur` booleans → `mode?: Mode` direto (breaking aceito em
1098
+ v4.0.0). Mode type vendored em S0 follow-up.
1099
+ - **§7 Yup→Zod mapping:** atualizado para Zod v4 idiomatic:
1100
+ - `z.string().email()` → `z.email()` (top-level)
1101
+ - `Yup.string().required()` → `z.string().min(1, 'msg')`
1102
+ - `Yup.boolean().required()` → `z.boolean().refine((v) => v === true, ...)`
1103
+ - `z.ZodIssueCode.custom` → `'custom'` string literal
1104
+ - Nota sobre `z.unknown()` não ser optional por default em v4.
1105
+ - **§7 BasicFormExample concrete mapping** adicionado — fonte de verdade
1106
+ do S1 PoC schema.
1107
+ - **§7 Zod v4 breaking changes table** adicionada com 10 entries cobrindo
1108
+ todas as APIs usadas no PoC.
1109
+ - **§8 Risks #6 atualizado:** validation API direct mode (não mais
1110
+ mapping interno boolean→enum).
1111
+ - **§8 Risks #9 + #10 adicionados:** Zod v4 `z.unknown()` não-optional
1112
+ por default; `.refine()` removeu type narrowing via predicate.
1113
+ - **§S0 marcado MERGED** com commits + 3 changesets gerados.
1114
+ - **Status do ADR:** 📝 Proposed → 🚧 In Progress.
1115
+
1116
+ Doc-lock cross-checked contra `.d.ts` locais de `react-hook-form@7.76.1`,
1117
+ `@hookform/resolvers@5.4.0` e `zod@4.4.3`, suplementado com WebFetch de
1118
+ zod.dev/v4/changelog.
1119
+
1120
+ - 36eaf4a: feat(core): ADR-007 S0 follow-up — expose `Mode` type in ReactHookForm vendor
1121
+
1122
+ Adiciona `Mode` (`'onSubmit' | 'onBlur' | 'onChange' | 'onTouched' | 'all'`)
1123
+ ao surface re-exportado de `vendors/ReactHookForm/interface.ts`. Necessário
1124
+ para `Form.interface.ts#FormCommonInterface['mode']` em S2 — substitui o par
1125
+ booleano legado `validateOnChange?`/`validateOnBlur?` do Formik (decisão
1126
+ fixada via tech-radar pass 2026-05-27).
1127
+
1128
+ Surface change pequena, isolada à interface do vendor. Zero impacto
1129
+ runtime — só types.
1130
+
1131
+ Ver `packages/core/src/vendors/ReactHookForm/README.md` para tabela
1132
+ atualizada.
1133
+
1134
+ - 802828f: feat(core): ADR-007 S0 — react-hook-form vendor scaffold
1135
+
1136
+ Adds `packages/core/src/vendors/ReactHookForm/` (4 arquivos no padrão
1137
+ ADR-004): re-export tipado de `useForm`, `Controller`, `useFormContext`,
1138
+ `useFieldArray` + bridge adapter `zodResolver` (de `@hookform/resolvers/zod`)
1139
+ co-localizado para evitar dois call-sites distintos.
1140
+
1141
+ Deps adicionadas (exact pin, latest stable):
1142
+ - `react-hook-form@7.76.1`
1143
+ - `@hookform/resolvers@5.4.0`
1144
+
1145
+ Vendor wrapper isolado — ainda não consumido pelo core (S2 migra
1146
+ `form/Form/Form.tsx`). Zero impacto runtime nesta slice. `vendors/Zod/`
1147
+ já existe desde ADR-006 S6 e cobre a surface de schema requerida — sem
1148
+ duplicação.
1149
+
1150
+ Pre-flight verificado: lint, check-types e prettier verdes; sem violações
1151
+ da regra `no-restricted-imports` (codemod do core acontece em S2).
1152
+
1153
+ Ver `packages/core/docs/adr/ADR-007-form-stack-rhf-zod.md` §6 Slice 0
1154
+ e `docs/ROADMAP.md` §🟡 Next "Form stack migration — Formik+Yup → RHF+Zod".
1155
+
1156
+ - e14469c: feat(core): ADR-007 S2 — DS Form internals migrated Formik+Yup → RHF+Zod
1157
+
1158
+ Migra os 4 arquivos core do `form/` do stack Formik+Yup para React Hook
1159
+ Form + Zod, dentro do escopo de [vendors/ReactHookForm](src/vendors/ReactHookForm)
1160
+ e [vendors/Zod](src/vendors/Zod) (ADR-004 vendor isolation). Single
1161
+ commit no padrão "vertical-slice":
1162
+
1163
+ **Arquivos migrados:**
1164
+ - **`form/Form/Form.tsx`** — `useFormik({...})` → `useForm<any>({ resolver: zodResolver(schema), mode: mode ?? 'onSubmit', defaultValues })`. `useImperativeHandle(ref, () => methods)` agora expõe `UseFormReturn<any>` no lugar de `FormikProps<any>`. `Field` continua recebendo `value`/`errors`/`setFieldValue` via prop (paradigma controlled preservado via `methods.watch()` e `methods.setValue`).
1165
+ - **`form/Form/Form.helpers.ts`** — `getValidationSchema` agora constrói `z.object(shape)`. Default fallback p/ fields sem `validation`: `z.unknown().optional()` (Zod v4 requer `.optional()` explícito — `z.unknown()` não é optional por default em object schemas, mudança vs v3). `prepareSubmit` assinatura aceita `UseFormReturn<any>` no lugar de `FormikHelpers`.
1166
+ - **`form/Form/Form.interface.ts`** — types swap inteiro:
1167
+ - `FormRef = FormikProps<any>` → `FormRef = UseFormReturn<any>` (breaking API ref — major bump em v4)
1168
+ - `validateOnChange?: boolean` + `validateOnBlur?: boolean` → **REMOVIDOS**. Substituídos por `mode?: Mode` enum (`'onSubmit' | 'onBlur' | 'onChange' | 'onTouched' | 'all'`), default `'onSubmit'`. Mapping legacy em MIGRATION-v4.md (ADR-007 §S5).
1169
+ - `validation?: any | (() => any)` → `validation?: ZodTypeAny`
1170
+ - `onError?: (errors: FormikErrors<...>) => void` → `onError?: (errors: FieldErrors<...>) => void`
1171
+ - Workaround `const a = Yup.string().required()` (tree-shake legacy) removido.
1172
+ - **`form/Field/Field.interface.ts`** — `setFieldValue?: FormikHelpers<any>['setFieldValue']` → `setFieldValue?: UseFormSetValue<any>`. Nome da prop preservado para minimizar blast-radius nos primitives (`InputDate`, `InputSelect`, etc. continuam chamando `setFieldValue(name, value)` — assinatura compat). Renome `FormikBaseInterface` → `FormBaseInterface`.
1173
+ - **`form/Form/story.tsx`** (Storybook) — `Yup.string().required('Required')` → `z.string().min(1, 'Required')`; `Yup.string().email()` → `z.email()`. Import de `vendors/Yup` removido.
1174
+
1175
+ **Estado pós-S2:**
1176
+ - `yarn workspace @apollion-dsi/core run validate:tests`: ✅ 317 passed (1 skipped pre-existente), 59 snapshots OK.
1177
+ - `yarn workspace @apollion-dsi/core run check-types`: ✅ verde.
1178
+ - `yarn workspace @apollion-dsi/core run lint`: ✅ zero violations.
1179
+ - `yarn workspace @apollion-dsi/core run build` (esbuild + tsc + Storybook): ✅ verde.
1180
+ - `yarn workspace @apollion-dsi/website run build` (Next.js): ✅ verde.
1181
+
1182
+ **Website examples (`BasicFormExample`, `FormExample`, `DynamicFormExample`) ainda usam Yup schemas:**
1183
+
1184
+ Type check passa via casting permissivo (`validation as ZodSchema`), mas runtime de submit no website QUEBRA (Yup schema sem `.parse()` → `zodResolver` throws). Render OK; submit broken until S3 migra os examples. Esperado per ADR-007 §S2 critério.
1185
+
1186
+ **Bundle delta:** ainda não visível (Yup permanece importado pelos examples website até S3). Re-measure em S3 com examples + smoke pages atualizadas.
1187
+
1188
+ Storybook stories (`Form/story.tsx`) já migradas — Storybook submit funciona end-to-end.
1189
+
1190
+ **Vendors antigos `vendors/Formik/` + `vendors/Yup/`:** preservados sem uso interno até S6 (hard cut em v4.0.0). 0 imports de `formik`/`yup` em `packages/core/src/**` fora dos próprios vendor dirs.
1191
+
1192
+ Ver `packages/core/docs/adr/ADR-007-form-stack-rhf-zod.md` §6 Slice 2.
1193
+
1194
+ - 81cd55b: feat(website): ADR-007 S3 — migrate 8 form examples Yup → Zod + cleanup PoC/smoke
1195
+
1196
+ Completa a migração end-to-end Formik+Yup → RHF+Zod no website:
1197
+
1198
+ **6 example files migrados:**
1199
+ - `website/src/examples/Components/Form/Form/index.tsx` — `BasicFormExample`, `FormExample` (15 fields), `DynamicFormExample` (8 fields + conditional).
1200
+ - `website/src/examples/Components/Form/Field/index.tsx` — `FieldFormExample` (UploadCard).
1201
+ - `website/src/examples/Components/Form/Inputs/Input/index.tsx` — `InputFormExample`.
1202
+ - `website/src/examples/Components/Form/Inputs/InputDate/index.tsx` — `InputDateFormExample`.
1203
+ - `website/src/examples/Components/Form/Inputs/InputMask/index.tsx` — `InputMaskDateExample`.
1204
+ - `website/src/examples/Components/Form/Inputs/InputSelect/index.tsx` — `InputSelectExampleButton`.
1205
+
1206
+ **Mapping aplicado** (consistente com MIGRATION-v4.md ADR-007 §S5):
1207
+
1208
+ | Yup pattern | Zod v4 equivalent |
1209
+ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
1210
+ | `Yup.string().required('msg')` | `z.string().min(1, 'msg')` |
1211
+ | `Yup.string().email('m1').required('m2')` | `z.email('m1')` (top-level v4) |
1212
+ | `Yup.boolean().required('msg')` | `z.boolean()` (matches Yup loose `.required` semantics) |
1213
+ | `Yup.number().required('msg')` | `z.coerce.number()` (HTML inputs return string) |
1214
+ | `Yup.mixed().test('hasFile', 'm', fn)` | `z.unknown().refine(fn, { message: 'm' })` |
1215
+ | `Yup.mixed().test(date).required()` | `z.string().min(1, 'Required').refine(dateValid, { message: 'm' })` |
1216
+ | `Yup.string().required()` on InputSelect/FieldGroup (object/array stores) | `z.unknown().refine((v) => !!v, { message: 'Required' })` (preserve Yup permissive coercion) |
1217
+
1218
+ **Cleanup:**
1219
+ - ❌ `website/src/examples/Components/Form/Form/poc-rhf-zod.tsx` — deletado (shadow-PoC obsoleto; `BasicFormExample` agora cobre o mesmo pattern via DS `<Form>` migrado).
1220
+ - ❌ `website/pages/docs/smoke-form-poc-rhf-zod.mdx` — deletado (instrumentação S1).
1221
+ - ❌ `website/pages/docs/smoke-form-basic-formik.mdx` — deletado (instrumentação S1).
1222
+
1223
+ **Bundle re-measurement (Next.js First Load JS):**
1224
+
1225
+ | Page | Pre-S0 (Formik+Yup) | Post-S3 (RHF+Zod) | Δ |
1226
+ | -------------- | ------------------: | ----------------: | ------------: |
1227
+ | `form-basic` | 417 kB | 422 kB | +5 kB / +1.2% |
1228
+ | `form-dynamic` | 417 kB | 422 kB | +5 kB / +1.2% |
1229
+ | `form-form` | 417 kB | 422 kB | +5 kB / +1.2% |
1230
+
1231
+ **Δ NEGATIVO vs ADR-007 target** (≥15% redução; alvo 21%). Análise honesta:
1232
+ - Zod v4 com features atuais (`z.email`, `z.coerce`, `z.refine`, `z.string().min`) ship mais bytes que o subset de Yup usado previamente.
1233
+ - Formik (~13kB) → RHF (~10kB) shrink ~3kB.
1234
+ - Yup (~15kB) → Zod (~15-18kB) wash or slight growth.
1235
+ - Net: bundle parity, com leve growth devido a Zod ser mais "feature-rich" em runtime.
1236
+
1237
+ **Benefícios do migration (realizados, independente do bundle):**
1238
+ - ✅ Ecosystem alignment 2024-2026+: RHF + Zod dominantes em TS-first stacks.
1239
+ - ✅ TypeScript SSOT via `z.infer<typeof schema>` (Yup exigia tipo manual `Values<T>`).
1240
+ - ✅ Future-proofing: Formik+Yup com manutenção decrescente, React 19/20 risk.
1241
+ - ✅ Vendor isolation paga: refactor cirúrgico em 4 arquivos core + 6 examples.
1242
+ - ✅ Apollion como gold-standard do ecosystem mantém alinhamento com mercado.
1243
+
1244
+ **Acceptance Criteria ADR-007:**
1245
+ - ✅ 0 imports diretos de `formik`/`yup` em `packages/core/src/**` e `website/src/**` (fora dos vendors).
1246
+ - ✅ 0 imports diretos de `react-hook-form`/`zod`/`@hookform/resolvers/zod` em core fora de `vendors/`.
1247
+ - ⚠️ Bundle delta target ≥15%: **NÃO atingido** (medição real: +1.2% growth). Documentado como finding honesto. Justificativa do migration permanece válida (ecosystem + maintenance + TS).
1248
+ - ✅ `yarn validate` verde nos 4 workspaces.
1249
+ - ✅ 317 tests passed (1 skipped pre-existente), 59 snapshots OK.
1250
+
1251
+ Vendors `vendors/Formik/` + `vendors/Yup/` permanecem sem uso interno até S6 hard cut em v4.0.0.
1252
+
1253
+ Ver `packages/core/docs/adr/ADR-007-form-stack-rhf-zod.md` §6 Slice 3.
1254
+
1255
+ - c57c548: docs(core): ADR-007 S4+S5 — README sweep + MIGRATION-v4.md draft
1256
+
1257
+ **S4 — README + AI docs sweep (12 arquivos):**
1258
+
1259
+ MDX docs (4):
1260
+ - `form/Form/README.mdx` — exemplos Yup → Zod v4 idiomatic.
1261
+ - `form/Field/README.mdx` — exemplos Yup → Zod; "(Formik)" → "(RHF + Zod)".
1262
+ - `form/InputDate/README.mdx` — `Yup.mixed().test(date)` → `z.string().min(1).refine(date)`.
1263
+ - `form/InputMask/README.mdx` — mesma migration de date validator.
1264
+
1265
+ AI docs (8):
1266
+ - `form/Form/README.AI.md` — reescrita full (purpose, props table com `mode`,
1267
+ examples Zod, do-not section atualizada).
1268
+ - `form/Field/README.AI.md` — referências "Formik" → "RHF + Zod"; exemplo
1269
+ inside-form com Zod.
1270
+ - `form/Checkbox/README.AI.md`, `form/InputCurrency/README.AI.md`,
1271
+ `form/InputDate/README.AI.md`, `form/InputMask/README.AI.md`,
1272
+ `form/InputRange/README.AI.md`, `form/InputSelect/README.AI.md`,
1273
+ `form/TextArea/README.AI.md` — `<related>` section "Form orquestra
1274
+ validação Yup" → "Zod"; exemplos Yup migrados onde presentes.
1275
+
1276
+ **DEPRECATED headers nos vendors antigos:**
1277
+ - `vendors/Formik/README.md` — ⚠️ DEPRECATED header apontando ReactHookForm
1278
+ - ADR-007 §S6.
1279
+ - `vendors/Yup/README.md` — ⚠️ DEPRECATED header apontando Zod + ADR-007 §S6.
1280
+
1281
+ **S5 — MIGRATION-v4.md draft:**
1282
+
1283
+ Cria `packages/core/MIGRATION-v4.md` com seção "Form stack migration"
1284
+ cobrindo:
1285
+ - §1 Resumo do impacto (7 surfaces com migration cost por linha).
1286
+ - §2 Mapping Yup → Zod v4 (cheat sheet com 20+ patterns).
1287
+ - §3 `validateOnChange`/`validateOnBlur` → `mode` (com diff blocks).
1288
+ - §4 `onError` callback shape (FormikErrors → FieldErrors).
1289
+ - §5 `handleSubmit` second arg (FormikHelpers → UseFormReturn method map).
1290
+ - §6 Ref imperativa (FormikProps → UseFormReturn).
1291
+ - §7 Type inference (`z.infer<typeof schema>` SSOT vs `Values<T>` manual).
1292
+ - §8 Migration steps consumer-side (7 passos).
1293
+ - §9 Bundle delta esperado (medição real + análise honesta).
1294
+ - §10 Refs (ADR-007, ADR-004, Zod v4 changelog, RHF docs).
1295
+
1296
+ Status DRAFT — finalizado no merge final do épico v4.0.0.
1297
+
1298
+ **ADR-007 status atualizado:** S0-S5 marcados ✅; S6 (hard cut) ⏳ gated pelo
1299
+ épico v4.0.0 (ADR-006). Acceptance criteria atualizado com checkboxes
1300
+ reais; finding de bundle delta documentado honestamente (NÃO atingido
1301
+ target; justificativa migration permanece válida).
1302
+
1303
+ Vendors `Formik`/`Yup` permanecem (sem uso interno) até S6 hard cut.
1304
+
1305
+ Ver `packages/core/docs/adr/ADR-007-form-stack-rhf-zod.md` §6 Slice 4 + 5
1306
+ - §10 Acceptance Criteria atualizado.
1307
+
1308
+ - e55019a: chore(security): bump Storybook 8.6.9 → 8.6.18 + force `uuid` to 11.1.1
1309
+
1310
+ DevDeps-only — no consumer-facing API change. Closes three security
1311
+ advisories surfaced by `yarn audit-dependencies` (after the audit pipeline
1312
+ itself was migrated off the broken `audit-ci@7.1.0` Yarn Berry handler in
1313
+ the same cycle):
1314
+ - **High** — Storybook manager bundle env-var exposure during build
1315
+ (GHSA-8452-54wp-rmv6, fixed in `storybook >=8.6.15`).
1316
+ - **High** — Storybook Dev Server WebSocket Hijacking
1317
+ (GHSA-mjf5-7g4m-gx5w, fixed in `storybook >=8.6.17`).
1318
+ - **Moderate** — `uuid` missing buffer bounds check in v3/v5/v6
1319
+ (GHSA-w5hq-g745-h8pq, fixed in `uuid >=11.1.1`). Forced via root
1320
+ `resolutions` since `@storybook/addon-actions` + `jest-junit` would
1321
+ otherwise keep transitive `uuid@8.3.2` / `uuid@9.0.1`.
1322
+
1323
+ Verified:
1324
+ - `yarn install` clean.
1325
+ - `yarn workspace @apollion-dsi/core build-storybook` succeeds.
1326
+ - Visual regression suite (chromium, 133/133) idempotent — matches the
1327
+ pre-push hook default.
1328
+ - `yarn audit-dependencies` no longer reports any of the three
1329
+ advisories above.
1330
+
1331
+ - 51f71f6: fix(core): emit `.d.ts` for every subpath entry (v4 build follow-up)
1332
+
1333
+ `packages/core/tsconfig.json` used `files: ["src/index.ts"]` as its only
1334
+ entry point. After ADR-006 §3.7 E7 emptied the root barrel in v4.0.0,
1335
+ that entry walks to nothing — `tsc --emitDeclarationOnly` produced a
1336
+ single `lib/index.d.ts` while `esbuild` emitted 217 `.esm.js` files for
1337
+ every subpath barrel discovered via `findEntryPoints`. Consumers
1338
+ importing `@apollion-dsi/core/themes/colors`, `@apollion-dsi/core/elements/
1339
+ button`, etc. got runtime JS but `any`-typed modules — which only became
1340
+ visible when `@apollion-dsi/tokens` validate started failing with TS7016
1341
+ "Could not find a declaration file" against the published subpaths.
1342
+
1343
+ The same bug also reduced `yarn check-types` to a near no-op: since
1344
+ `src/index.ts` no longer imported anything, `tsc --noEmit` only checked
1345
+ that one file and silently ignored real type errors in the remaining 200+
1346
+ modules of the source tree.
1347
+
1348
+ Switches the config to `include: ["src/**/*"]` with explicit excludes for
1349
+ test files (`*.test.{ts,tsx}`, `__tests__/**`) and Storybook stories
1350
+ (`story.{ts,tsx}`, `__stories__/**`) — neither of which should ship type
1351
+ declarations. Post-fix:
1352
+ - `lib/` carries 430 `.d.ts` files (covering all 217 ESM entries plus
1353
+ pure-type interface files), matching the surface declared in
1354
+ `package.json#exports`.
1355
+ - `lib/vendors/StyledComponents/` ships `.d.ts` only (`component.d.ts`,
1356
+ `interface.d.ts`, `index.d.ts`) — `scripts/check-vendors-not-published.js`
1357
+ remains green (the script only forbids `.js` under `lib/vendors/`).
1358
+ - `yarn check-types` now type-checks the entire `src/**` tree.
1359
+ - No new TypeScript errors surfaced — the existing source tree was
1360
+ internally consistent; it just wasn't being checked.
1361
+
1362
+ Pure build-config fix. No runtime change, no public API change. Patch
1363
+ bump.
1364
+
1365
+ - 0a1baeb: chore(core): coverage re-baseline — exclude boilerplate, honest floors
1366
+
1367
+ Apply coverage exclusions em `packages/core/jest.config.js` +
1368
+ `packages/relay/jest.config.js` para boilerplate sem business logic
1369
+ testável:
1370
+ - `/vendors/` — wrappers re-export-only (re-exports a 100% statements
1371
+ - 0-50% functions noise via IIFE wrappers ts-jest).
1372
+ - `*.story.tsx` — Storybook stories (visual coverage via visual-gate).
1373
+ - `*.interface.ts` — type-only files (compile a empty JS = 100% padding).
1374
+ - `*.style.ts` — styled-components (testados via component renders).
1375
+ - `/index.ts` (barrels) — re-exports puros.
1376
+
1377
+ **Impact:** revela coverage real do código com lógica testável.
1378
+
1379
+ | Métrica core | Pre-exclusões | Post-exclusões | Δ |
1380
+ | ------------ | ------------: | -------------: | ------: |
1381
+ | Statements | 69.8% | 61.75% | -8.05pp |
1382
+ | Branches | 50.63% | 50.74% | +0.11pp |
1383
+ | Functions | 56.2% | 48.25% | -7.95pp |
1384
+ | Lines | 69.41% | 62.3% | -7.11pp |
1385
+
1386
+ Drop em statements/functions/lines reflete REMOÇÃO de files inflados
1387
+ (re-exports a 100%, types a 100%) — não regressão real. Branches estável
1388
+ porque excluídos não tinham branches significativos.
1389
+
1390
+ **Thresholds rebaselined** (core/jest.config.js):
1391
+ - `branches`: 48 → 50 (sobe acompanhando actuals)
1392
+ - `functions`: 53 → 47 (cai — honest baseline)
1393
+ - `lines`: 67 → 61
1394
+ - `statements`: 68 → 60
1395
+
1396
+ Buffer ~1-2pp do actuals real. Relay thresholds unchanged (actuals
1397
+ post-exclusion ainda passam).
1398
+
1399
+ **Path para 80% goal** (adoption-readiness, decisão @fedbalves 2026-05-27):
1400
+
1401
+ Top gaps onde testes reais teriam impacto:
1402
+ - `hooks/*` — useDrag/useClipboard/useScript/useProgress/useIntersect/
1403
+ useFileDialog todos <30% statements.
1404
+ - `form/UploadCard` (21%), `form/InputSelect` (51%), `form/InputRange` (55%).
1405
+ - `entities/*` (32%).
1406
+ - `containers/Scroll` (63%).
1407
+ - `elements/Svg` (38%), `elements/Label` (52%).
1408
+
1409
+ Ratchet path: +5pp incremental atrás de feature work TDD-vertical (per
1410
+ strategy original do ROADMAP).
1411
+
1412
+ Ver `docs/ROADMAP.md` §🟡 Next "Coverage ratchet to 80%" — entrada
1413
+ atualizada com baseline honesta + path detalhado.
1414
+
1415
+ - 6d1371e: docs: factual drift sweep + AI-friendly doc surface
1416
+
1417
+ Sincroniza documentação com estado de `main` pós-v3.x (ADR-002 +
1418
+ ADR-004 shipped, ADR-005 escrito) e introduz camada AI-readable
1419
+ (`README.AI.md`, `AGENTS.md`, `llms.txt` por sub-package).
1420
+
1421
+ **Drift corrigido (BLOCKER):**
1422
+ - Root README + core README: Storybook `9` → `8.x` (real: 8.6.9).
1423
+ - ROADMAP: ADR-005 "placeholder/não escrita" → "Proposed" linkando ao
1424
+ arquivo já existente.
1425
+ - `website/README.md`: era boilerplate de Docusaurus 2 — substituído
1426
+ por descrição real (Next 15 + Nextra 2 + copyStorybook).
1427
+ - `website/pages/index.mdx`: remove `npm install` (yarn-only) e
1428
+ amplia scope para citar 3-layer theme + vendor isolation.
1429
+ - `packages/scripts/README.MD`: rebrand de `@captalys-platform/scripts`
1430
+ → `@apollion-dsi/scripts`; atualiza stack (webpack 5, Babel 7,
1431
+ Jest 30, TS 6); remove `.editorconfig.js`.
1432
+
1433
+ **Novas concept pages no website (IMPORTANT):**
1434
+ - `concept-semantic-tokens.mdx` — explica Foundation/Semantic/Structural
1435
+ (ADR-002).
1436
+ - `concept-surface-inversion.mdx` — `surface="negative"` + limitação
1437
+ mode-agnostic (ADR-002 S4 / refinada em ADR-006).
1438
+ - `concept-vendor-policy.mdx` — política de vendor isolation pública
1439
+ (ADR-004).
1440
+
1441
+ Source canônica em `packages/core/concept/`; thin re-exports em
1442
+ `website/pages/docs/`; entradas em `_meta.json`.
1443
+
1444
+ **AI-friendly doc layer:**
1445
+ - Raiz `README.AI.md` — navegação + decision tree + ADR matrix.
1446
+ - Raiz `AGENTS.md` — contrato operacional p/ agentes (hard rules,
1447
+ per-component checklist, skill triggers).
1448
+ - `packages/eslint-config/llms.txt`, `packages/relay/llms.txt`,
1449
+ `packages/scripts/llms.txt` — indexação token-otimizada por package
1450
+ (espelhando o padrão já em `packages/core/llms.txt`).
1451
+
1452
+ Doc-only. Sem mudança de API/código. Patch bump em todos os
1453
+ publishable packages para sincronizar versões.
1454
+
1455
+ - e55019a: chore(security): close 7 pre-existing CVEs revealed by audit-dependencies fix
1456
+
1457
+ Follow-up to the `audit-ci@7.1.0` → `yarn npm audit` migration earlier in
1458
+ this cycle. The native audit pipeline surfaced 7 vulnerabilities that the
1459
+ broken handler had been printing as `undefined` and never failing on.
1460
+ All closed in this changeset. `yarn audit-dependencies` → 0 findings.
1461
+
1462
+ | # | CVE | Pkg | Severity | Strategy |
1463
+ | --- | ------------------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
1464
+ | 1 | GHSA-3xgq-45jj-v275 | `cross-spawn` | High | Root resolution `cross-spawn: ^7.0.6` (was transitive 5.1.0 via `execa@0.8.0` → `clipboardy` → `title` → `nextra`). |
1465
+ | 2 | GHSA-qjx8-664m-686j | `js-cookie` | High | Direct upgrade in `packages/relay`: `3.0.5` → `3.0.7`. |
1466
+ | 3 | GHSA-37ch-88jc-xwx2 | `path-to-regexp` | High | Direct upgrade in `packages/relay`: `express 4.21.2` → `4.22.2` (express 4.22 ships path-to-regexp 0.1.13). |
1467
+ | 4 | GHSA-7mvr-c777-76hp | `playwright` | High | Direct upgrade in `packages/core`: `@playwright/test 1.49.1` → `1.60.0`. |
1468
+ | 5 | GHSA-qx2v-qp2m-jg93 | `postcss` | Moderate | Root resolution `postcss: ^8.5.10` (Next 15 pinned 8.4.31; css-loader already uses 8.5.15). |
1469
+ | 6 | GHSA-6rw7-vpxm-498p | `qs` | Moderate | Closed by item 3 (express 4.22.2 bundles body-parser 1.20.5 → qs 6.15.2). |
1470
+ | 7 | GHSA-q8mj-m7cp-5q26 | `qs` | Moderate | Closed by item 3 (same). |
1471
+
1472
+ **Verified post-remediation:**
1473
+ - `corepack yarn audit-dependencies` → exit 0, no audit suggestions.
1474
+ - `corepack yarn workspace @apollion-dsi/core run validate` → green (types + prettier + lint + tests + build + check-vendors-not-published + visual gate). Visual regression suite chromium **133/133 passing** with `@playwright/test@1.60.0` — no baseline drift from the playwright bump.
1475
+ - `corepack yarn workspace @apollion-dsi/relay run validate` → green (3 test suites / 11 tests / 0 failures).
1476
+ - `corepack yarn workspace @apollion-dsi/website run build` → green.
1477
+
1478
+ **Exploit-surface notes:**
1479
+ - Express, body-parser, qs, path-to-regexp are all in `@apollion-dsi/relay#devDependencies` (test fixtures for the GraphQL relay environment) — realistic exploit surface was zero. Upgraded anyway because the fix was free.
1480
+ - Playwright cert verification (item 4) only matters during `npx playwright install` — also low exploit surface in a single-machine setup, but upgrading was free.
1481
+ - cross-spawn ReDoS reachable only during `nextra` doc generation, dev-only.
1482
+
1483
+ - 29081ae: chore(visual): regenerate firefox + webkit baselines (post ADR-006 OKLch)
1484
+
1485
+ DevDeps-only — no consumer-facing API change. Refreshes the 124 stale
1486
+ firefox + webkit baselines that drifted after `d57c47c feat(v4-s2): OKLch
1487
+ lerp via culori` updated only chromium baselines (the pre-push hook is
1488
+ chromium-only, so firefox + webkit drift went unnoticed). Restores the
1489
+ multi-browser net at 399/399 green and idempotent on darwin-arm64.
1490
+ - **Median diff absorbed:** 0.53 %; **max:** 10.35 % on
1491
+ `Layouts/SideBarLayout › Default` firefox — `primary.dark` shifted from
1492
+ `rgb(20, 70, 88)` (pre-OKLch RGB lerp) to `rgb(7, 46, 60)` (OKLch lerp).
1493
+ Same code, new perceptually-uniform color math.
1494
+ - **Net-new baselines:** `Components/Button › AllDimensions` and
1495
+ `Components/Card › AllDimensions` firefox + webkit captured for the first
1496
+ time (story count 131 → 133).
1497
+ - **PER_STORY_THRESHOLD escalations** (firefox skeleton shimmer sub-pixel
1498
+ drift — pre-existing class documented in `__image_snapshots__/AUDIT.md`):
1499
+ - `components-textpreset--default`: 0.5 % (re-emergence of the S2 entry,
1500
+ handled per AUDIT's predicted path).
1501
+ - `components-scenario-rect--default`: 1 % (new entry — same root cause).
1502
+
1503
+ Verified:
1504
+ - `VISUAL_BROWSERS="chromium firefox webkit" yarn workspace @apollion-dsi/core run test-storybook`
1505
+ is 399/399 green on two consecutive fresh runs (~80 s each, no `-u`).
1506
+ - Pre-push hook (chromium-only) behavior unchanged — closes the same gate.
1507
+ - SHA-256 of regenerated PNGs differs from `HEAD` (real pixel updates, not
1508
+ no-op mtime touches).