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