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