@42-central/ui-react 0.29.1 → 0.30.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 (586) hide show
  1. package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
  2. package/dist/chunk-2RRTT4AF.js.map +1 -0
  3. package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
  4. package/dist/chunk-322I2RSV.js.map +1 -0
  5. package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
  6. package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
  7. package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
  8. package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
  9. package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
  10. package/dist/chunk-3XQEOJCE.js.map +1 -0
  11. package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
  12. package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
  13. package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
  14. package/dist/chunk-5HWFYYHW.js.map +1 -0
  15. package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
  16. package/dist/chunk-6MVFCS46.js.map +1 -0
  17. package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
  18. package/dist/chunk-6WZSUS3U.js.map +1 -0
  19. package/dist/chunk-6YRGP6PS.js +138 -0
  20. package/dist/chunk-6YRGP6PS.js.map +1 -0
  21. package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
  22. package/dist/chunk-ALANKV5Y.js.map +1 -0
  23. package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
  24. package/dist/chunk-AUQPNDE5.js.map +1 -0
  25. package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
  26. package/dist/chunk-D7SW2E24.js.map +1 -0
  27. package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
  28. package/dist/chunk-DQIYYDFD.js.map +1 -0
  29. package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
  30. package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
  31. package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
  32. package/dist/chunk-FED6SJWM.js.map +1 -0
  33. package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
  34. package/dist/chunk-FEPIHXVI.js.map +1 -0
  35. package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
  36. package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
  37. package/dist/chunk-GZN5CXMR.js +100 -0
  38. package/dist/chunk-GZN5CXMR.js.map +1 -0
  39. package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
  40. package/dist/chunk-HCSZPBWV.js.map +1 -0
  41. package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
  42. package/dist/chunk-HTVICHT4.js.map +1 -0
  43. package/dist/chunk-I7TC2C3I.js +163 -0
  44. package/dist/chunk-I7TC2C3I.js.map +1 -0
  45. package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
  46. package/dist/chunk-IBXYLO2J.js.map +1 -0
  47. package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
  48. package/dist/chunk-IRYG6B5A.js.map +1 -0
  49. package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
  50. package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
  51. package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
  52. package/dist/chunk-KZDMVOL6.js.map +1 -0
  53. package/dist/chunk-LR5U6TZZ.js +169 -0
  54. package/dist/chunk-LR5U6TZZ.js.map +1 -0
  55. package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
  56. package/dist/chunk-LZHZJWVM.js.map +1 -0
  57. package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
  58. package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
  59. package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
  60. package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
  61. package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
  62. package/dist/chunk-MV5DIE2T.js.map +1 -0
  63. package/dist/chunk-NDI4HLQE.js +41 -0
  64. package/dist/chunk-NDI4HLQE.js.map +1 -0
  65. package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
  66. package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
  67. package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
  68. package/dist/chunk-QHT4DCXE.js.map +1 -0
  69. package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
  70. package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
  71. package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
  72. package/dist/chunk-RNTDM3RP.js.map +1 -0
  73. package/dist/chunk-RPFN6ETQ.js +509 -0
  74. package/dist/chunk-RPFN6ETQ.js.map +1 -0
  75. package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
  76. package/dist/chunk-SI7C3W5M.js.map +1 -0
  77. package/dist/chunk-TPOV3OCC.js +234 -0
  78. package/dist/chunk-TPOV3OCC.js.map +1 -0
  79. package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
  80. package/dist/chunk-UBQ54W46.js.map +1 -0
  81. package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
  82. package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
  83. package/dist/chunk-UOWQH53N.js +70 -0
  84. package/dist/chunk-UOWQH53N.js.map +1 -0
  85. package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
  86. package/dist/chunk-WJUY6YWF.js.map +1 -0
  87. package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
  88. package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
  89. package/dist/chunk-X6RB74JN.js +37 -0
  90. package/dist/chunk-X6RB74JN.js.map +1 -0
  91. package/dist/chunk-XQ6L2CM5.js +83 -0
  92. package/dist/chunk-XQ6L2CM5.js.map +1 -0
  93. package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
  94. package/dist/chunk-YUVKROMA.js.map +1 -0
  95. package/dist/components/action-icon/action-icon.d.ts +9 -2
  96. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  97. package/dist/components/action-icon/index.js +5 -1
  98. package/dist/components/alert/index.js +4 -4
  99. package/dist/components/anchor/anchor.d.ts +45 -0
  100. package/dist/components/anchor/anchor.d.ts.map +1 -0
  101. package/dist/components/anchor/index.d.ts +2 -0
  102. package/dist/components/anchor/index.d.ts.map +1 -0
  103. package/dist/components/anchor/index.js +11 -0
  104. package/dist/components/anchor/index.js.map +1 -0
  105. package/dist/components/app-shell/app-shell.d.ts +10 -6
  106. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  107. package/dist/components/app-shell/index.js +23 -24
  108. package/dist/components/app-shell/index.js.map +1 -1
  109. package/dist/components/autocomplete/autocomplete.d.ts +1 -1
  110. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  111. package/dist/components/autocomplete/index.js +15 -9
  112. package/dist/components/autocomplete/index.js.map +1 -1
  113. package/dist/components/avatar/index.js +1 -1
  114. package/dist/components/button/button.d.ts +15 -2
  115. package/dist/components/button/button.d.ts.map +1 -1
  116. package/dist/components/button/index.js +5 -1
  117. package/dist/components/button-multi-select/index.js +6 -4
  118. package/dist/components/button-multi-select/index.js.map +1 -1
  119. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  120. package/dist/components/button-select/button-select.d.ts +2 -2
  121. package/dist/components/button-select/button-select.d.ts.map +1 -1
  122. package/dist/components/button-select/index.js +6 -4
  123. package/dist/components/button-select/index.js.map +1 -1
  124. package/dist/components/calendar/aliases.d.ts +16 -0
  125. package/dist/components/calendar/aliases.d.ts.map +1 -0
  126. package/dist/components/calendar/calendar-body.d.ts +11 -1
  127. package/dist/components/calendar/calendar-body.d.ts.map +1 -1
  128. package/dist/components/calendar/calendar.d.ts +8 -4
  129. package/dist/components/calendar/calendar.d.ts.map +1 -1
  130. package/dist/components/calendar/index.d.ts +2 -1
  131. package/dist/components/calendar/index.d.ts.map +1 -1
  132. package/dist/components/calendar/index.js +15 -5
  133. package/dist/components/calendar/index.js.map +1 -1
  134. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
  135. package/dist/components/calendar-heatmap/index.js +85 -73
  136. package/dist/components/calendar-heatmap/index.js.map +1 -1
  137. package/dist/components/camera/index.js +16 -14
  138. package/dist/components/carousel/index.js +3 -3
  139. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  140. package/dist/components/checkbox/index.js +2 -2
  141. package/dist/components/choice-card-group/index.js +2 -2
  142. package/dist/components/choice-card-group/index.js.map +1 -1
  143. package/dist/components/circular-progress/circular-progress.d.ts +22 -11
  144. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  145. package/dist/components/circular-progress/index.d.ts +1 -1
  146. package/dist/components/circular-progress/index.d.ts.map +1 -1
  147. package/dist/components/circular-progress/index.js +68 -49
  148. package/dist/components/circular-progress/index.js.map +1 -1
  149. package/dist/components/clipboard/index.js +7 -3
  150. package/dist/components/clipboard/index.js.map +1 -1
  151. package/dist/components/code/code.d.ts +10 -0
  152. package/dist/components/code/code.d.ts.map +1 -1
  153. package/dist/components/code/index.js +1 -0
  154. package/dist/components/code/index.js.map +1 -1
  155. package/dist/components/code-block/chrome.js +10 -6
  156. package/dist/components/code-block/index.js +10 -7
  157. package/dist/components/code-block/index.js.map +1 -1
  158. package/dist/components/combobox/combobox.d.ts +5 -3
  159. package/dist/components/combobox/combobox.d.ts.map +1 -1
  160. package/dist/components/combobox/index.js +12 -7
  161. package/dist/components/combobox-list/combobox-list.d.ts +1 -1
  162. package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
  163. package/dist/components/combobox-list/index.js +14 -9
  164. package/dist/components/compare/index.js +1 -1
  165. package/dist/components/data-list/data-list.d.ts +96 -0
  166. package/dist/components/data-list/data-list.d.ts.map +1 -0
  167. package/dist/components/data-list/index.d.ts +2 -0
  168. package/dist/components/data-list/index.d.ts.map +1 -0
  169. package/dist/components/data-list/index.js +147 -0
  170. package/dist/components/data-list/index.js.map +1 -0
  171. package/dist/components/data-table/data-table-group.d.ts.map +1 -1
  172. package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
  173. package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
  174. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  175. package/dist/components/data-table/data-table.d.ts +5 -2
  176. package/dist/components/data-table/data-table.d.ts.map +1 -1
  177. package/dist/components/data-table/index.js +163 -168
  178. package/dist/components/data-table/index.js.map +1 -1
  179. package/dist/components/date-picker/aliases.d.ts +16 -0
  180. package/dist/components/date-picker/aliases.d.ts.map +1 -1
  181. package/dist/components/date-picker/date-picker.d.ts +22 -8
  182. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  183. package/dist/components/date-picker/index.d.ts +2 -2
  184. package/dist/components/date-picker/index.d.ts.map +1 -1
  185. package/dist/components/date-picker/index.js +34 -28
  186. package/dist/components/date-picker/index.js.map +1 -1
  187. package/dist/components/download-button/index.js +6 -2
  188. package/dist/components/drawer/drawer.d.ts +7 -4
  189. package/dist/components/drawer/drawer.d.ts.map +1 -1
  190. package/dist/components/drawer/index.js +11 -6
  191. package/dist/components/empty-state/empty-state.d.ts +57 -0
  192. package/dist/components/empty-state/empty-state.d.ts.map +1 -0
  193. package/dist/components/empty-state/index.d.ts +2 -0
  194. package/dist/components/empty-state/index.d.ts.map +1 -0
  195. package/dist/components/empty-state/index.js +8 -0
  196. package/dist/components/empty-state/index.js.map +1 -0
  197. package/dist/components/field/field.d.ts +20 -0
  198. package/dist/components/field/field.d.ts.map +1 -1
  199. package/dist/components/field/index.js +1 -1
  200. package/dist/components/fieldset/fieldset.d.ts +103 -0
  201. package/dist/components/fieldset/fieldset.d.ts.map +1 -0
  202. package/dist/components/fieldset/index.d.ts +2 -0
  203. package/dist/components/fieldset/index.d.ts.map +1 -0
  204. package/dist/components/fieldset/index.js +150 -0
  205. package/dist/components/fieldset/index.js.map +1 -0
  206. package/dist/components/file-item/index.js +10 -7
  207. package/dist/components/file-preview/file-preview.d.ts.map +1 -1
  208. package/dist/components/file-preview/index.js +10 -18
  209. package/dist/components/file-preview/index.js.map +1 -1
  210. package/dist/components/file-trigger/index.js +6 -2
  211. package/dist/components/file-upload/file-upload.d.ts.map +1 -1
  212. package/dist/components/file-upload/index.js +18 -14
  213. package/dist/components/file-upload/index.js.map +1 -1
  214. package/dist/components/gallery/index.js +3 -3
  215. package/dist/components/geodesic/a11y.d.ts +3 -3
  216. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  217. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  218. package/dist/components/hover-card/index.js +10 -3
  219. package/dist/components/hover-card/index.js.map +1 -1
  220. package/dist/components/image/index.js +3 -3
  221. package/dist/components/image-cropper/index.js +9 -6
  222. package/dist/components/input/index.js +2 -2
  223. package/dist/components/input/input.d.ts.map +1 -1
  224. package/dist/components/kbd/index.js +3 -3
  225. package/dist/components/kbd/kbd.d.ts +4 -0
  226. package/dist/components/kbd/kbd.d.ts.map +1 -1
  227. package/dist/components/lightbox/index.js +13 -11
  228. package/dist/components/lightbox/index.js.map +1 -1
  229. package/dist/components/menu/index.js +9 -5
  230. package/dist/components/menu/index.js.map +1 -1
  231. package/dist/components/menu/menu.d.ts.map +1 -1
  232. package/dist/components/modal/index.js +11 -6
  233. package/dist/components/modal/modal.d.ts +10 -4
  234. package/dist/components/modal/modal.d.ts.map +1 -1
  235. package/dist/components/multi-combobox-list/index.js +13 -9
  236. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
  237. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
  238. package/dist/components/multi-select/index.js +13 -10
  239. package/dist/components/multi-select/index.js.map +1 -1
  240. package/dist/components/multi-select/multi-select.d.ts +1 -1
  241. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  242. package/dist/components/nav-link/index.js +4 -4
  243. package/dist/components/nav-link/tanstack.js +4 -4
  244. package/dist/components/notification/index.js +6 -6
  245. package/dist/components/notification/index.js.map +1 -1
  246. package/dist/components/number-input/index.js +11 -7
  247. package/dist/components/number-input/number-input.d.ts +1 -1
  248. package/dist/components/number-input/number-input.d.ts.map +1 -1
  249. package/dist/components/overlays/dialog-parts.d.ts +10 -1
  250. package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
  251. package/dist/components/overlays/index.js +13 -8
  252. package/dist/components/overlays/index.js.map +1 -1
  253. package/dist/components/pagination/index.d.ts +2 -0
  254. package/dist/components/pagination/index.d.ts.map +1 -0
  255. package/dist/components/pagination/index.js +362 -0
  256. package/dist/components/pagination/index.js.map +1 -0
  257. package/dist/components/pagination/pagination.d.ts +147 -0
  258. package/dist/components/pagination/pagination.d.ts.map +1 -0
  259. package/dist/components/password-input/index.js +6 -5
  260. package/dist/components/password-input/index.js.map +1 -1
  261. package/dist/components/password-input/password-input.d.ts +1 -1
  262. package/dist/components/password-input/password-input.d.ts.map +1 -1
  263. package/dist/components/phone-input/index.js +14 -11
  264. package/dist/components/phone-input/index.js.map +1 -1
  265. package/dist/components/phone-input/phone-input.d.ts +1 -1
  266. package/dist/components/phone-input/phone-input.d.ts.map +1 -1
  267. package/dist/components/photo-capture/index.js +19 -17
  268. package/dist/components/photo-capture/index.js.map +1 -1
  269. package/dist/components/pills-input/index.js +4 -4
  270. package/dist/components/pills-input/pills-input.d.ts +1 -1
  271. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  272. package/dist/components/pin-input/index.js +6 -5
  273. package/dist/components/pin-input/index.js.map +1 -1
  274. package/dist/components/pin-input/pin-input.d.ts.map +1 -1
  275. package/dist/components/popover/index.js +7 -2
  276. package/dist/components/popover/popover.d.ts +41 -16
  277. package/dist/components/popover/popover.d.ts.map +1 -1
  278. package/dist/components/progress/index.d.ts +1 -1
  279. package/dist/components/progress/index.d.ts.map +1 -1
  280. package/dist/components/progress/index.js +4 -1
  281. package/dist/components/progress/progress.d.ts +22 -14
  282. package/dist/components/progress/progress.d.ts.map +1 -1
  283. package/dist/components/prose/index.d.ts +2 -0
  284. package/dist/components/prose/index.d.ts.map +1 -0
  285. package/dist/components/prose/index.js +17 -0
  286. package/dist/components/prose/index.js.map +1 -0
  287. package/dist/components/prose/prose.d.ts +49 -0
  288. package/dist/components/prose/prose.d.ts.map +1 -0
  289. package/dist/components/prose/styles.css +593 -0
  290. package/dist/components/radio-group/index.js +9 -3
  291. package/dist/components/radio-group/index.js.map +1 -1
  292. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  293. package/dist/components/rating/index.js +3 -2
  294. package/dist/components/rating/index.js.map +1 -1
  295. package/dist/components/rating/rating.d.ts.map +1 -1
  296. package/dist/components/schedule/index.js +10 -8
  297. package/dist/components/schedule/index.js.map +1 -1
  298. package/dist/components/scroll-area/index.d.ts +2 -0
  299. package/dist/components/scroll-area/index.d.ts.map +1 -0
  300. package/dist/components/scroll-area/index.js +10 -0
  301. package/dist/components/scroll-area/index.js.map +1 -0
  302. package/dist/components/scroll-area/scroll-area.d.ts +150 -0
  303. package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
  304. package/dist/components/segment-group/index.js +2 -2
  305. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  306. package/dist/components/select/index.js +12 -8
  307. package/dist/components/select/select.d.ts +1 -1
  308. package/dist/components/select/select.d.ts.map +1 -1
  309. package/dist/components/slider/index.js +2 -2
  310. package/dist/components/slider/slider.d.ts.map +1 -1
  311. package/dist/components/splitter/index.d.ts +2 -0
  312. package/dist/components/splitter/index.d.ts.map +1 -0
  313. package/dist/components/splitter/index.js +373 -0
  314. package/dist/components/splitter/index.js.map +1 -0
  315. package/dist/components/splitter/splitter.d.ts +159 -0
  316. package/dist/components/splitter/splitter.d.ts.map +1 -0
  317. package/dist/components/spotlight/index.js +23 -22
  318. package/dist/components/spotlight/index.js.map +1 -1
  319. package/dist/components/spotlight/spotlight.d.ts.map +1 -1
  320. package/dist/components/steps/index.d.ts +4 -0
  321. package/dist/components/steps/index.d.ts.map +1 -0
  322. package/dist/components/steps/index.js +478 -0
  323. package/dist/components/steps/index.js.map +1 -0
  324. package/dist/components/steps/steps-data.d.ts +78 -0
  325. package/dist/components/steps/steps-data.d.ts.map +1 -0
  326. package/dist/components/steps/steps.d.ts +183 -0
  327. package/dist/components/steps/steps.d.ts.map +1 -0
  328. package/dist/components/switch/index.js +4 -3
  329. package/dist/components/switch/index.js.map +1 -1
  330. package/dist/components/switch/switch.d.ts.map +1 -1
  331. package/dist/components/table-of-contents/index.d.ts +2 -0
  332. package/dist/components/table-of-contents/index.d.ts.map +1 -0
  333. package/dist/components/table-of-contents/index.js +471 -0
  334. package/dist/components/table-of-contents/index.js.map +1 -0
  335. package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
  336. package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
  337. package/dist/components/tags-input/index.js +12 -9
  338. package/dist/components/tags-input/index.js.map +1 -1
  339. package/dist/components/tags-input/tags-input.d.ts +1 -1
  340. package/dist/components/tags-input/tags-input.d.ts.map +1 -1
  341. package/dist/components/text-input/index.js +2 -2
  342. package/dist/components/textarea/index.js +8 -6
  343. package/dist/components/textarea/index.js.map +1 -1
  344. package/dist/components/textarea/textarea.d.ts.map +1 -1
  345. package/dist/components/time-input/index.js +11 -9
  346. package/dist/components/time-input/index.js.map +1 -1
  347. package/dist/components/tooltip/index.js +1 -1
  348. package/dist/components/tooltip/tooltip.d.ts +3 -8
  349. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  350. package/dist/components/tour/conditions.d.ts +83 -0
  351. package/dist/components/tour/conditions.d.ts.map +1 -0
  352. package/dist/components/tour/create-tours.d.ts +49 -0
  353. package/dist/components/tour/create-tours.d.ts.map +1 -0
  354. package/dist/components/tour/index.d.ts +6 -0
  355. package/dist/components/tour/index.d.ts.map +1 -0
  356. package/dist/components/tour/index.js +1449 -0
  357. package/dist/components/tour/index.js.map +1 -0
  358. package/dist/components/tour/runtime.d.ts +57 -0
  359. package/dist/components/tour/runtime.d.ts.map +1 -0
  360. package/dist/components/tour/storage.d.ts +14 -0
  361. package/dist/components/tour/storage.d.ts.map +1 -0
  362. package/dist/components/tour/store.d.ts +62 -0
  363. package/dist/components/tour/store.d.ts.map +1 -0
  364. package/dist/components/tour/tour.d.ts +77 -0
  365. package/dist/components/tour/tour.d.ts.map +1 -0
  366. package/dist/components/tour/types.d.ts +680 -0
  367. package/dist/components/tour/types.d.ts.map +1 -0
  368. package/dist/components/tree/index.d.ts +3 -0
  369. package/dist/components/tree/index.d.ts.map +1 -0
  370. package/dist/components/tree/index.js +457 -0
  371. package/dist/components/tree/index.js.map +1 -0
  372. package/dist/components/tree/tree-row.d.ts +72 -0
  373. package/dist/components/tree/tree-row.d.ts.map +1 -0
  374. package/dist/components/tree/tree.d.ts +193 -0
  375. package/dist/components/tree/tree.d.ts.map +1 -0
  376. package/dist/components/tree-multi-select/index.js +31 -54
  377. package/dist/components/tree-multi-select/index.js.map +1 -1
  378. package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
  379. package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
  380. package/dist/components/tree-select/index.js +30 -24
  381. package/dist/components/tree-select/index.js.map +1 -1
  382. package/dist/components/tree-select/tree-popover.d.ts +20 -31
  383. package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
  384. package/dist/components/tree-select/tree-select.d.ts +1 -1
  385. package/dist/components/tree-select/tree-select.d.ts.map +1 -1
  386. package/dist/index.d.ts +2 -0
  387. package/dist/index.d.ts.map +1 -1
  388. package/dist/index.js +10 -8
  389. package/dist/index.js.map +1 -1
  390. package/dist/lib/date-predicates.d.ts +7 -5
  391. package/dist/lib/date-predicates.d.ts.map +1 -1
  392. package/dist/lib/date-value.d.ts +20 -0
  393. package/dist/lib/date-value.d.ts.map +1 -1
  394. package/dist/lib/floating-arrow.d.ts +53 -0
  395. package/dist/lib/floating-arrow.d.ts.map +1 -0
  396. package/dist/lib/focus-return.d.ts +53 -0
  397. package/dist/lib/focus-return.d.ts.map +1 -0
  398. package/dist/lib/meter.d.ts +104 -0
  399. package/dist/lib/meter.d.ts.map +1 -0
  400. package/dist/lib/overlay-layer.d.ts +26 -8
  401. package/dist/lib/overlay-layer.d.ts.map +1 -1
  402. package/dist/lib/pressed.d.ts +92 -0
  403. package/dist/lib/pressed.d.ts.map +1 -0
  404. package/dist/lib/tree-data.d.ts +18 -2
  405. package/dist/lib/tree-data.d.ts.map +1 -1
  406. package/dist/lib/use-pagination.d.ts +102 -0
  407. package/dist/lib/use-pagination.d.ts.map +1 -0
  408. package/dist/lib/use-scroll-spy.d.ts +126 -0
  409. package/dist/lib/use-scroll-spy.d.ts.map +1 -0
  410. package/dist/theme.css +39 -3
  411. package/package.json +1 -1
  412. package/src/as-child.contract.test.tsx +283 -1
  413. package/src/components/action-icon/action-icon.tsx +34 -4
  414. package/src/components/anchor/anchor.test.tsx +232 -0
  415. package/src/components/anchor/anchor.tsx +187 -0
  416. package/src/components/anchor/index.ts +12 -0
  417. package/src/components/app-shell/app-shell.test.tsx +15 -7
  418. package/src/components/app-shell/app-shell.tsx +27 -20
  419. package/src/components/autocomplete/autocomplete.tsx +11 -3
  420. package/src/components/button/button-pressed.test.tsx +202 -0
  421. package/src/components/button/button.tsx +48 -6
  422. package/src/components/button-select/button-select-control.tsx +2 -2
  423. package/src/components/button-select/button-select.tsx +22 -2
  424. package/src/components/calendar/aliases.tsx +28 -0
  425. package/src/components/calendar/calendar-body.tsx +310 -210
  426. package/src/components/calendar/calendar.tsx +43 -12
  427. package/src/components/calendar/index.ts +7 -1
  428. package/src/components/calendar/month-year-calendar.test.tsx +106 -0
  429. package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
  430. package/src/components/checkbox/checkbox.tsx +7 -2
  431. package/src/components/choice-card-group/choice-card-group.tsx +2 -2
  432. package/src/components/circular-progress/circular-progress.test.tsx +35 -0
  433. package/src/components/circular-progress/circular-progress.tsx +116 -59
  434. package/src/components/circular-progress/index.ts +1 -0
  435. package/src/components/code/code.test.tsx +16 -0
  436. package/src/components/code/code.tsx +11 -0
  437. package/src/components/combobox/combobox.tsx +63 -28
  438. package/src/components/combobox-list/combobox-list.tsx +11 -3
  439. package/src/components/data-list/data-list.test.tsx +149 -0
  440. package/src/components/data-list/data-list.tsx +268 -0
  441. package/src/components/data-list/index.ts +9 -0
  442. package/src/components/data-table/data-table-group.test.tsx +16 -0
  443. package/src/components/data-table/data-table-group.tsx +15 -2
  444. package/src/components/data-table/data-table-placeholder.tsx +28 -36
  445. package/src/components/data-table/data-table-stack.tsx +33 -39
  446. package/src/components/data-table/data-table.test.tsx +31 -0
  447. package/src/components/data-table/data-table.tsx +41 -42
  448. package/src/components/date-picker/aliases.tsx +28 -0
  449. package/src/components/date-picker/date-picker.test.tsx +29 -0
  450. package/src/components/date-picker/date-picker.tsx +164 -45
  451. package/src/components/date-picker/index.ts +5 -1
  452. package/src/components/date-picker/month-year-picker.test.tsx +362 -0
  453. package/src/components/drawer/drawer.test.tsx +41 -0
  454. package/src/components/drawer/drawer.tsx +7 -1
  455. package/src/components/empty-state/empty-state.test.tsx +109 -0
  456. package/src/components/empty-state/empty-state.tsx +180 -0
  457. package/src/components/empty-state/index.ts +9 -0
  458. package/src/components/field/field.tsx +35 -1
  459. package/src/components/fieldset/fieldset.test.tsx +352 -0
  460. package/src/components/fieldset/fieldset.tsx +268 -0
  461. package/src/components/fieldset/index.ts +11 -0
  462. package/src/components/file-preview/file-preview.test.tsx +2 -1
  463. package/src/components/file-preview/file-preview.tsx +7 -13
  464. package/src/components/file-upload/file-upload.tsx +14 -5
  465. package/src/components/hover-card/hover-card.tsx +5 -1
  466. package/src/components/input/input.tsx +12 -5
  467. package/src/components/kbd/kbd.test.tsx +13 -0
  468. package/src/components/kbd/kbd.tsx +6 -0
  469. package/src/components/menu/menu.tsx +6 -2
  470. package/src/components/modal/modal.test.tsx +41 -0
  471. package/src/components/modal/modal.tsx +17 -9
  472. package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
  473. package/src/components/multi-select/multi-select.tsx +11 -3
  474. package/src/components/notification/create-notifier.tsx +1 -1
  475. package/src/components/number-input/number-input.tsx +12 -3
  476. package/src/components/overlays/dialog-parts.tsx +42 -5
  477. package/src/components/pagination/index.ts +19 -0
  478. package/src/components/pagination/pagination.test.tsx +187 -0
  479. package/src/components/pagination/pagination.tsx +563 -0
  480. package/src/components/password-input/password-input.tsx +12 -3
  481. package/src/components/phone-input/phone-input.tsx +12 -3
  482. package/src/components/pills-input/pills-input.tsx +7 -2
  483. package/src/components/pin-input/pin-input.tsx +13 -4
  484. package/src/components/popover/popover.tsx +87 -17
  485. package/src/components/progress/index.ts +1 -0
  486. package/src/components/progress/progress.test.tsx +102 -0
  487. package/src/components/progress/progress.tsx +116 -62
  488. package/src/components/prose/index.ts +1 -0
  489. package/src/components/prose/prose.test.tsx +90 -0
  490. package/src/components/prose/prose.tsx +60 -0
  491. package/src/components/prose/styles.css +593 -0
  492. package/src/components/radio-group/radio-group.tsx +8 -3
  493. package/src/components/rating/rating.tsx +5 -2
  494. package/src/components/scroll-area/index.ts +18 -0
  495. package/src/components/scroll-area/scroll-area.test.tsx +184 -0
  496. package/src/components/scroll-area/scroll-area.tsx +448 -0
  497. package/src/components/segment-group/segment-group.tsx +2 -2
  498. package/src/components/select/select.tsx +37 -18
  499. package/src/components/slider/slider.tsx +2 -2
  500. package/src/components/splitter/index.ts +15 -0
  501. package/src/components/splitter/splitter.test.tsx +244 -0
  502. package/src/components/splitter/splitter.tsx +625 -0
  503. package/src/components/spotlight/spotlight.test.tsx +34 -26
  504. package/src/components/spotlight/spotlight.tsx +7 -9
  505. package/src/components/steps/index.ts +21 -0
  506. package/src/components/steps/steps-data.tsx +179 -0
  507. package/src/components/steps/steps.test.tsx +235 -0
  508. package/src/components/steps/steps.tsx +686 -0
  509. package/src/components/switch/switch.tsx +7 -2
  510. package/src/components/table-of-contents/index.ts +17 -0
  511. package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
  512. package/src/components/table-of-contents/table-of-contents.tsx +708 -0
  513. package/src/components/tags-input/tags-input.tsx +12 -3
  514. package/src/components/textarea/textarea.tsx +15 -5
  515. package/src/components/tooltip/tooltip.tsx +8 -17
  516. package/src/components/tour/conditions.test.ts +527 -0
  517. package/src/components/tour/conditions.ts +445 -0
  518. package/src/components/tour/create-tours.tsx +150 -0
  519. package/src/components/tour/index.ts +86 -0
  520. package/src/components/tour/runtime.ts +187 -0
  521. package/src/components/tour/storage.test.ts +68 -0
  522. package/src/components/tour/storage.ts +44 -0
  523. package/src/components/tour/store.test.tsx +784 -0
  524. package/src/components/tour/store.ts +661 -0
  525. package/src/components/tour/tour.test.tsx +318 -0
  526. package/src/components/tour/tour.tsx +773 -0
  527. package/src/components/tour/tour.types.test.ts +185 -0
  528. package/src/components/tour/types.ts +904 -0
  529. package/src/components/tree/index.ts +24 -0
  530. package/src/components/tree/tree-row.tsx +179 -0
  531. package/src/components/tree/tree.test.tsx +296 -0
  532. package/src/components/tree/tree.tsx +796 -0
  533. package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
  534. package/src/components/tree-select/tree-popover.tsx +26 -107
  535. package/src/components/tree-select/tree-select.tsx +24 -16
  536. package/src/icon-stroke.test.tsx +2 -0
  537. package/src/index.ts +16 -0
  538. package/src/lib/date-predicates.test.ts +46 -0
  539. package/src/lib/date-predicates.ts +44 -24
  540. package/src/lib/date-value.test.ts +24 -1
  541. package/src/lib/date-value.ts +42 -1
  542. package/src/lib/floating-arrow.tsx +73 -0
  543. package/src/lib/focus-return.test.tsx +143 -0
  544. package/src/lib/focus-return.ts +106 -0
  545. package/src/lib/meter.test.ts +40 -0
  546. package/src/lib/meter.ts +159 -0
  547. package/src/lib/overlay-layer.test.tsx +47 -1
  548. package/src/lib/overlay-layer.tsx +65 -8
  549. package/src/lib/pressed.ts +130 -0
  550. package/src/lib/tree-data.ts +42 -2
  551. package/src/lib/use-pagination.test.ts +105 -0
  552. package/src/lib/use-pagination.ts +179 -0
  553. package/src/lib/use-scroll-spy.test.tsx +238 -0
  554. package/src/lib/use-scroll-spy.ts +336 -0
  555. package/src/theme.css +39 -3
  556. package/src/theme.test.ts +29 -1
  557. package/src/visually-hidden-containment.test.tsx +9 -0
  558. package/dist/chunk-2W7H43WL.js.map +0 -1
  559. package/dist/chunk-7E7JNWOC.js.map +0 -1
  560. package/dist/chunk-7FPSQBWB.js.map +0 -1
  561. package/dist/chunk-7KFUFAVP.js.map +0 -1
  562. package/dist/chunk-AKXALCUN.js.map +0 -1
  563. package/dist/chunk-B5YHYI7E.js.map +0 -1
  564. package/dist/chunk-FQJNQW3G.js.map +0 -1
  565. package/dist/chunk-G3AD3NJG.js.map +0 -1
  566. package/dist/chunk-GEZYGBXY.js.map +0 -1
  567. package/dist/chunk-HCHGERDB.js.map +0 -1
  568. package/dist/chunk-HWBFRDX7.js.map +0 -1
  569. package/dist/chunk-I4B3N3UX.js.map +0 -1
  570. package/dist/chunk-IA6DCC3N.js.map +0 -1
  571. package/dist/chunk-IANYMDKH.js.map +0 -1
  572. package/dist/chunk-MQHD3EJE.js.map +0 -1
  573. package/dist/chunk-NNPSBC7O.js.map +0 -1
  574. package/dist/chunk-OXR7BXZA.js.map +0 -1
  575. package/dist/chunk-QKSLDQM2.js +0 -120
  576. package/dist/chunk-QKSLDQM2.js.map +0 -1
  577. package/dist/chunk-QRNQQIQM.js.map +0 -1
  578. package/dist/chunk-RKCUXOU2.js.map +0 -1
  579. package/dist/chunk-S5CQRCTF.js +0 -426
  580. package/dist/chunk-S5CQRCTF.js.map +0 -1
  581. package/dist/chunk-SBZJGFZ6.js.map +0 -1
  582. package/dist/chunk-SP6LCCTZ.js.map +0 -1
  583. package/dist/chunk-TUP7WXQE.js.map +0 -1
  584. package/dist/chunk-V2QZG4IT.js.map +0 -1
  585. package/dist/chunk-X6DESK37.js.map +0 -1
  586. package/dist/chunk-ZB5VMGKB.js.map +0 -1
@@ -0,0 +1,180 @@
1
+ import { ark, type HTMLArkProps } from "@ark-ui/react"
2
+ import type { ReactNode, Ref } from "react"
3
+ import { withAsChildContent } from "../../lib/as-child"
4
+ import { cn } from "../../lib/cn"
5
+ import type { Color } from "../../lib/colors"
6
+ import { props } from "../../lib/props"
7
+ import type { WithTestId } from "../../lib/test-id"
8
+ import { ThemeIcon, type ThemeIconProps } from "../theme-icon"
9
+
10
+ /**
11
+ * EmptyState — the block a list shows in place of its rows: an icon in a
12
+ * `ThemeIcon`, a title, a muted description and the actions, centred at a
13
+ * minimum height. `DataTable` draws its empty and error views with it, so a
14
+ * card grid, a timeline or a grouped list that has nothing to show (or failed
15
+ * to load) looks the same as a table that does.
16
+ *
17
+ * `color` tints the icon and the title; the description stays muted whatever
18
+ * the palette, so the detail never competes with the headline. An error is
19
+ * `color="red" role="alert"`: the role is the caller's, since only the caller
20
+ * knows whether the block appeared in response to something (a failed fetch)
21
+ * or was there from the start.
22
+ *
23
+ * It sets no font size of its own: it takes the one of where it sits, so a
24
+ * table's density carries into its placeholder. Pin one with `className`
25
+ * (`text-sm`) when it sits in body text.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <EmptyState icon={<SearchIcon />} title="No projects yet" description="…">
30
+ * <Button>New project</Button>
31
+ * </EmptyState>
32
+ * <EmptyState color="red" role="alert" icon={<ServerCrashIcon />} title="Couldn't load projects">
33
+ * {retry}
34
+ * </EmptyState>
35
+ * ```
36
+ */
37
+
38
+ /** The title's colour goes through `--empty-state-title`, set on the root, so a
39
+ * composed `EmptyState.Title` follows the root's `color` without being told.
40
+ * Neutral (and no `color`) keeps the kit's primary text; a hue takes its
41
+ * `--c-text` step (the -700 / -300). `data-color:` outranks `dark:` (an
42
+ * attribute selector against a zero-specificity variant), so the neutral
43
+ * override restates both themes, with `dark:` last to win their tie. */
44
+ const rootClasses = [
45
+ "flex flex-col gap-3 items-center justify-center text-center min-h-48.5 py-6",
46
+ "[--empty-state-title:var(--color-brand-950)] dark:[--empty-state-title:var(--color-white)]",
47
+ "data-color:[--empty-state-title:var(--c-text)]",
48
+ "data-[color=neutral]:[--empty-state-title:var(--color-brand-950)]",
49
+ "dark:data-[color=neutral]:[--empty-state-title:var(--color-white)]",
50
+ ]
51
+
52
+ export type EmptyStateRootProps = HTMLArkProps<"div"> &
53
+ WithTestId & {
54
+ /** Palette for the icon and title. Omitted, everything stays neutral. */
55
+ color?: Color
56
+ ref?: Ref<HTMLDivElement>
57
+ }
58
+
59
+ const Root = ({ className, color, testId, ...rest }: EmptyStateRootProps) => (
60
+ <ark.div
61
+ data-color={color}
62
+ className={cn(rootClasses, className)}
63
+ {...props({ "data-testid": testId })}
64
+ {...rest}
65
+ />
66
+ )
67
+
68
+ export type EmptyStateIconProps = ThemeIconProps
69
+
70
+ /** The icon badge: a `ThemeIcon`, decorative (`aria-hidden`). Without a
71
+ * `color` it is the muted `default` tile; with one, the `light` tile of that
72
+ * palette. Pass the same `color` as the root when composing by hand. */
73
+ const Icon = ({ color, variant, ...rest }: EmptyStateIconProps) => (
74
+ <ThemeIcon
75
+ aria-hidden
76
+ color={color}
77
+ variant={variant ?? (color != null ? "light" : "default")}
78
+ {...rest}
79
+ />
80
+ )
81
+
82
+ export type EmptyStateTitleProps = HTMLArkProps<"p">
83
+
84
+ const Title = ({ className, ...rest }: EmptyStateTitleProps) => (
85
+ <ark.p className={cn("text-(--empty-state-title)", className)} {...rest} />
86
+ )
87
+
88
+ export type EmptyStateDescriptionProps = HTMLArkProps<"p">
89
+
90
+ const Description = ({ className, ...rest }: EmptyStateDescriptionProps) => (
91
+ <ark.p className={cn("text-brand-900/40 dark:text-white/35", className)} {...rest} />
92
+ )
93
+
94
+ export type EmptyStateActionsProps = HTMLArkProps<"div">
95
+
96
+ const Actions = ({ className, ...rest }: EmptyStateActionsProps) => (
97
+ <ark.div
98
+ className={cn("flex flex-row flex-wrap gap-1 justify-center items-center", className)}
99
+ {...rest}
100
+ />
101
+ )
102
+
103
+ export type EmptyStateProps = Omit<EmptyStateRootProps, "title"> & {
104
+ /** The glyph, drawn in a `ThemeIcon`. Omitted or `null`, no badge. */
105
+ icon?: ReactNode
106
+ /** The headline: what the list shows instead of rows. */
107
+ title: ReactNode
108
+ /** A muted line under the title: why, or what to do next. */
109
+ description?: ReactNode
110
+ /** A class per part, on top of the kit's. */
111
+ classNames?: { icon?: string; title?: string; description?: string; actions?: string }
112
+ }
113
+
114
+ /**
115
+ * The ready-made **`EmptyState`**: lays out `icon`, `title` and `description`,
116
+ * skipping the ones not given, and puts its children (the buttons: clear the
117
+ * filters, retry, create the first item) in the actions row under the text. For a bespoke layout, compose the
118
+ * parts: `EmptyState.Root`, `.Icon`, `.Title`, `.Description`, `.Actions`.
119
+ */
120
+ function EmptyStateComponent({
121
+ icon,
122
+ title,
123
+ description,
124
+ color,
125
+ classNames,
126
+ asChild,
127
+ children,
128
+ ...rest
129
+ }: EmptyStateProps) {
130
+ const actions = (content: ReactNode) =>
131
+ content != null &&
132
+ content !== false && <Actions className={classNames?.actions}>{content}</Actions>
133
+ const block = (
134
+ <>
135
+ {icon != null && (
136
+ <Icon color={color} className={classNames?.icon}>
137
+ {icon}
138
+ </Icon>
139
+ )}
140
+ <div className="flex flex-col">
141
+ <Title className={classNames?.title}>{title}</Title>
142
+ {description != null && (
143
+ <Description className={classNames?.description}>{description}</Description>
144
+ )}
145
+ </div>
146
+ </>
147
+ )
148
+ return (
149
+ // Under `asChild` the block becomes the consumer's element (the `<li>` of
150
+ // the list it stands in for, say): the block's parts are folded in, and
151
+ // that element's own content is the actions.
152
+ <Root color={color} asChild={asChild} {...rest}>
153
+ {asChild ? (
154
+ withAsChildContent(children, (own) => (
155
+ <>
156
+ {block}
157
+ {actions(own)}
158
+ </>
159
+ ))
160
+ ) : (
161
+ <>
162
+ {block}
163
+ {actions(children)}
164
+ </>
165
+ )}
166
+ </Root>
167
+ )
168
+ }
169
+
170
+ /**
171
+ * `EmptyState` — the ready-made block, with its parts attached for bespoke
172
+ * composition (`EmptyState.Root`, `.Icon`, `.Title`, `.Description`, `.Actions`).
173
+ */
174
+ export const EmptyState = Object.assign(EmptyStateComponent, {
175
+ Root,
176
+ Icon,
177
+ Title,
178
+ Description,
179
+ Actions,
180
+ })
@@ -0,0 +1,9 @@
1
+ export {
2
+ EmptyState,
3
+ type EmptyStateActionsProps,
4
+ type EmptyStateDescriptionProps,
5
+ type EmptyStateIconProps,
6
+ type EmptyStateProps,
7
+ type EmptyStateRootProps,
8
+ type EmptyStateTitleProps,
9
+ } from "./empty-state"
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { ark } from "@ark-ui/react/factory"
4
4
  import { Field as Ark, type UseFieldContext, useFieldContext } from "@ark-ui/react/field"
5
+ import { useFieldsetContext } from "@ark-ui/react/fieldset"
5
6
  import { cva, type VariantProps } from "class-variance-authority"
6
7
  import type { ComponentPropsWithoutRef, ReactNode } from "react"
7
8
  import type { NoAsChild } from "../../lib/as-child"
@@ -27,6 +28,9 @@ import { TEXT_COLOR_CLASSES, TYPOGRAPHY_SHADE_CLASSES } from "../../lib/typograp
27
28
  * - `size` scales only the field's own typography; set the control's `size`
28
29
  * separately (the family components forward both).
29
30
  *
31
+ * Inside a `Fieldset`, the field takes the group's `disabled` and `invalid`
32
+ * unless it sets its own.
33
+ *
30
34
  * Every other prop (incl. `disabled`, `readOnly`, `id`) forwards to Ark's
31
35
  * `Field.Root`. `asChild` is a compile error: the field renders its label,
32
36
  * helper and error rows around the control, which can't live inside one
@@ -125,6 +129,33 @@ export type FieldSize = NonNullable<VariantProps<typeof fieldRoot>["size"]>
125
129
  */
126
130
  export const requiredMark = { className: cn("ms-0.5", TEXT_COLOR_CLASSES.error) } as const
127
131
 
132
+ /**
133
+ * Whether a control is disabled once its surroundings are counted: its own
134
+ * prop, else the enclosing `Field`'s, else the enclosing `Fieldset`'s. The
135
+ * nearest one wins, since a `Field` has already taken its fieldset's state
136
+ * unless it set its own. Ark's own machines read a `Field` this way; this is
137
+ * for the kit's controls whose machine reads neither (a `Popover` trigger, a
138
+ * toggle group, a file upload) or that render with no `Field` at all (an
139
+ * unlabelled `Input`). It works at the control's top level, above its own
140
+ * `FieldShell`.
141
+ */
142
+ export const useInheritedDisabled = (disabled?: boolean) => {
143
+ const field = useFieldContext()
144
+ const fieldset = useFieldsetContext()
145
+ return Boolean(disabled || (field ? field.disabled : fieldset?.disabled))
146
+ }
147
+
148
+ /**
149
+ * `invalid`'s twin of `useInheritedDisabled`: the control's own flag, else the
150
+ * nearest `Field`'s, else the nearest `Fieldset`'s. Ark's `Field` doesn't take
151
+ * a fieldset's `invalid`; the kit's `Field` below does.
152
+ */
153
+ export const useInheritedInvalid = (invalid?: boolean) => {
154
+ const field = useFieldContext()
155
+ const fieldset = useFieldsetContext()
156
+ return Boolean(invalid || (field ? field.invalid : fieldset?.invalid))
157
+ }
158
+
128
159
  export const fieldA11yProps = (field: UseFieldContext) => ({
129
160
  "aria-describedby": field?.invalid ? field.ids.errorText : field?.ariaDescribedby,
130
161
  "aria-errormessage": field?.invalid ? field.ids.errorText : undefined,
@@ -240,7 +271,10 @@ export const Field = ({
240
271
  asChild: _asChild,
241
272
  ...rest
242
273
  }: FieldProps) => {
243
- const isInvalid = invalid ?? error != null
274
+ // A `Fieldset`'s `invalid` reaches every field in it; Ark's `Field` only
275
+ // inherits its `disabled`.
276
+ const fieldset = useFieldsetContext()
277
+ const isInvalid = invalid ?? (error != null || Boolean(fieldset?.invalid))
244
278
  const Label = composite ? CompositeLabel : Ark.Label
245
279
 
246
280
  return (
@@ -0,0 +1,352 @@
1
+ import { Field as ArkField } from "@ark-ui/react/field"
2
+ import { act, render, screen } from "@testing-library/react"
3
+ import type { ReactNode } from "react"
4
+ import { describe, expect, it } from "vitest"
5
+ import { Autocomplete } from "../autocomplete"
6
+ import { Button } from "../button"
7
+ import { ButtonMultiSelect } from "../button-multi-select"
8
+ import { ButtonSelect } from "../button-select"
9
+ import { Calendar } from "../calendar"
10
+ import { Checkbox } from "../checkbox"
11
+ import { ChoiceCardGroup } from "../choice-card-group"
12
+ import { Combobox, createListCollection } from "../combobox"
13
+ import { ComboboxList } from "../combobox-list"
14
+ import { DatePicker } from "../date-picker"
15
+ import { Field } from "../field"
16
+ import { FileUpload } from "../file-upload"
17
+ import { Input } from "../input"
18
+ import { MultiComboboxList } from "../multi-combobox-list"
19
+ import { MultiSelect } from "../multi-select"
20
+ import { NumberInput } from "../number-input"
21
+ import { PasswordInput } from "../password-input"
22
+ import { PhoneInput } from "../phone-input"
23
+ import { PillsInput } from "../pills-input"
24
+ import { PinInput } from "../pin-input"
25
+ import { RadioGroup } from "../radio-group"
26
+ import { Rating } from "../rating"
27
+ import { SegmentGroup } from "../segment-group"
28
+ import { Select } from "../select"
29
+ import { Slider } from "../slider"
30
+ import { Switch } from "../switch"
31
+ import { TagsInput } from "../tags-input"
32
+ import { TextInput } from "../text-input"
33
+ import { Textarea } from "../textarea"
34
+ import { TimeInput } from "../time-input"
35
+ import { TreeMultiSelect } from "../tree-multi-select"
36
+ import { TreeSelect } from "../tree-select"
37
+ import { Fieldset } from "./fieldset"
38
+
39
+ const DATA = ["a", "b"]
40
+
41
+ /**
42
+ * Every kit control a form puts in a group, each with a label (so in a `Field`,
43
+ * as a real form has it). `Rating` takes no `label` of its own: its docs wrap
44
+ * it in a `Field`, so it is here too. `Button` has no field at all.
45
+ */
46
+ const CONTROLS: [string, ReactNode][] = [
47
+ ["TextInput", <TextInput key="c" label="L" />],
48
+ ["Textarea", <Textarea key="c" label="L" />],
49
+ ["PasswordInput", <PasswordInput key="c" label="L" />],
50
+ ["NumberInput", <NumberInput key="c" label="L" />],
51
+ ["PinInput", <PinInput key="c" label="L" length={4} />],
52
+ ["PhoneInput", <PhoneInput key="c" label="L" defaultCountry="FR" />],
53
+ ["Select", <Select key="c" label="L" data={DATA} />],
54
+ ["MultiSelect", <MultiSelect key="c" label="L" data={DATA} />],
55
+ ["Autocomplete", <Autocomplete key="c" label="L" data={DATA} />],
56
+ ["TagsInput", <TagsInput key="c" label="L" />],
57
+ ["TreeSelect", <TreeSelect key="c" label="L" data={[{ value: "a", label: "A" }]} />],
58
+ ["Checkbox", <Checkbox key="c" label="L" />],
59
+ ["RadioGroup", <RadioGroup key="c" label="L" data={DATA} />],
60
+ ["Switch", <Switch key="c" label="L" />],
61
+ ["Slider", <Slider key="c" label="L" />],
62
+ [
63
+ "Rating",
64
+ <Field key="c" label="L" composite>
65
+ <Rating />
66
+ </Field>,
67
+ ],
68
+ ["SegmentGroup", <SegmentGroup key="c" label="L" data={DATA} />],
69
+ ["ButtonSelect", <ButtonSelect key="c" label="L" data={DATA} />],
70
+ ["DatePicker", <DatePicker key="c" label="L" />],
71
+ ["TimeInput", <TimeInput key="c" label="L" />],
72
+ ["FileUpload", <FileUpload key="c" label="L" withButton />],
73
+ ["Button", <Button key="c">Save</Button>],
74
+ ]
75
+
76
+ const TREE = [{ value: "a", label: "A" }]
77
+ const COLLECTION = createListCollection({ items: DATA })
78
+
79
+ /**
80
+ * Every kit form control again, this time with no `label` and no `Field`: the
81
+ * only thing between it and the `<fieldset>` is nothing. The `<fieldset>`
82
+ * disables their native elements by itself; what these lists check is that the
83
+ * control *looks* it, which is what `useInheritedDisabled` / `useInheritedInvalid`
84
+ * are for.
85
+ */
86
+ const UNLABELLED: [string, ReactNode, string?][] = [
87
+ ["Input", <Input key="c" aria-label="L" />],
88
+ ["Textarea", <Textarea key="c" aria-label="L" />],
89
+ ["PasswordInput", <PasswordInput key="c" aria-label="L" />],
90
+ ["NumberInput", <NumberInput key="c" aria-label="L" />],
91
+ ["PinInput", <PinInput key="c" length={4} />],
92
+ ["PhoneInput", <PhoneInput key="c" aria-label="L" defaultCountry="FR" />],
93
+ ["Select", <Select key="c" aria-label="L" data={DATA} />],
94
+ ["MultiSelect", <MultiSelect key="c" aria-label="L" data={DATA} />],
95
+ ["Autocomplete", <Autocomplete key="c" aria-label="L" data={DATA} />],
96
+ ["TagsInput", <TagsInput key="c" aria-label="L" />],
97
+ [
98
+ "Combobox (composed)",
99
+ <Combobox.Root key="c" collection={COLLECTION}>
100
+ <Combobox.Control>
101
+ <Combobox.Input aria-label="L" />
102
+ <Combobox.Trigger />
103
+ </Combobox.Control>
104
+ </Combobox.Root>,
105
+ ],
106
+ ["ComboboxList", <ComboboxList key="c" data={DATA} />],
107
+ ["MultiComboboxList", <MultiComboboxList key="c" data={DATA} />],
108
+ ["TreeSelect", <TreeSelect key="c" aria-label="L" data={TREE} />],
109
+ ["TreeMultiSelect", <TreeMultiSelect key="c" aria-label="L" data={TREE} />],
110
+ ["Checkbox", <Checkbox key="c" aria-label="L" />],
111
+ ["RadioGroup", <RadioGroup key="c" aria-label="L" data={DATA} />],
112
+ ["ChoiceCardGroup", <ChoiceCardGroup key="c" aria-label="L" data={DATA} />],
113
+ ["Switch", <Switch key="c" aria-label="L" />],
114
+ ["Slider", <Slider key="c" aria-label={["L"]} />],
115
+ ["Rating", <Rating key="c" />],
116
+ ["SegmentGroup", <SegmentGroup key="c" aria-label="L" data={DATA} />],
117
+ ["ButtonSelect", <ButtonSelect key="c" aria-label="L" data={DATA} />],
118
+ ["ButtonMultiSelect", <ButtonMultiSelect key="c" aria-label="L" data={DATA} />],
119
+ ["DatePicker", <DatePicker key="c" aria-label="L" />],
120
+ // Its days outside the month always carry `data-disabled`: look at the root.
121
+ ["Calendar", <Calendar key="c" />, '[data-scope="date-picker"][data-part="root"]'],
122
+ ["TimeInput", <TimeInput key="c" aria-label="L" />],
123
+ ["FileUpload", <FileUpload key="c" withButton />],
124
+ ["PillsInput", <PillsInput key="c" />],
125
+ ]
126
+
127
+ /** The group's own parts, which carry its state whatever the controls do. */
128
+ const GROUP_PARTS = new Set(["fieldset:root", "fieldset:legend"])
129
+
130
+ /**
131
+ * `Calendar` has no element of its own that shows `invalid`, even with its own
132
+ * prop (zag puts it only on the text input a calendar doesn't render).
133
+ */
134
+ const NO_INVALID_LOOK = new Set(["Calendar"])
135
+
136
+ /**
137
+ * The elements inside the group that carry `selector`, past the group's own
138
+ * parts, and only those matching `stateOn` when the control names the element
139
+ * its state shows on.
140
+ */
141
+ const flaggedIn = (container: HTMLElement, selector: string, stateOn?: string) =>
142
+ Array.from(controlIn(container).querySelectorAll(selector)).filter(
143
+ (el) =>
144
+ !GROUP_PARTS.has(`${el.getAttribute("data-scope")}:${el.getAttribute("data-part")}`) &&
145
+ (stateOn == null || el.matches(stateOn)),
146
+ )
147
+
148
+ /**
149
+ * zag's machines pick up a disabled `<fieldset>` in an effect that watches it,
150
+ * so give them a tick before reading the DOM.
151
+ */
152
+ const settle = () => act(() => new Promise((resolve) => setTimeout(resolve, 0)))
153
+
154
+ const INTERACTIVE = "input, button, select, textarea, [tabindex]"
155
+
156
+ /** Reachable by Tab or a click: not `:disabled`, and not taken out of the tab order. */
157
+ const reachable = (root: Element) =>
158
+ Array.from(root.querySelectorAll(INTERACTIVE)).filter(
159
+ (el) =>
160
+ !el.matches(":disabled") &&
161
+ !(el instanceof HTMLInputElement && el.type === "hidden") &&
162
+ (el.getAttribute("tabindex") ?? "0") !== "-1",
163
+ )
164
+
165
+ /** The control's elements, without the `<fieldset>` and its legend. */
166
+ const controlIn = (container: HTMLElement) => {
167
+ const fieldset = container.querySelector("fieldset")
168
+ if (!fieldset) throw new Error("no fieldset rendered")
169
+ return fieldset
170
+ }
171
+
172
+ describe("Fieldset", () => {
173
+ it("names the group with its legend and describes it with its description", () => {
174
+ render(
175
+ <Fieldset legend="Personal information" description="Shown on your profile.">
176
+ <TextInput label="Name" />
177
+ </Fieldset>,
178
+ )
179
+ const group = screen.getByRole("group", { name: "Personal information" })
180
+ expect(group.tagName).toBe("FIELDSET")
181
+ const description = screen.getByText("Shown on your profile.")
182
+ expect(group.getAttribute("aria-describedby")).toContain(description.id)
183
+ })
184
+
185
+ it("shows its error only while invalid, and an error makes it invalid", () => {
186
+ const { rerender } = render(
187
+ <Fieldset.Root>
188
+ <Fieldset.Legend>Plan</Fieldset.Legend>
189
+ <Fieldset.Error>Pick one</Fieldset.Error>
190
+ </Fieldset.Root>,
191
+ )
192
+ expect(screen.queryByText("Pick one")).toBeNull()
193
+
194
+ rerender(
195
+ <Fieldset legend="Plan" error="Pick one">
196
+ <TextInput label="Name" />
197
+ </Fieldset>,
198
+ )
199
+ const group = screen.getByRole("group", { name: "Plan" })
200
+ const error = screen.getByText("Pick one")
201
+ expect(group.hasAttribute("data-invalid")).toBe(true)
202
+ expect(group.getAttribute("aria-describedby")).toContain(error.id)
203
+ expect(error.getAttribute("aria-live")).toBe("polite")
204
+ })
205
+
206
+ it("puts testId on the fieldset and suffixes it on each part", () => {
207
+ render(
208
+ <Fieldset testId="profile" legend="Profile" description="Help" error="Wrong">
209
+ <TextInput label="Name" />
210
+ </Fieldset>,
211
+ )
212
+ expect(screen.getByTestId("profile").tagName).toBe("FIELDSET")
213
+ expect(screen.getByTestId("profile-legend").textContent).toBe("Profile")
214
+ expect(screen.getByTestId("profile-description").textContent).toBe("Help")
215
+ expect(screen.getByTestId("profile-error").textContent).toBe("Wrong")
216
+ })
217
+
218
+ it("leaves a Field's own label, description and error alone", () => {
219
+ render(
220
+ <Fieldset legend="Account" description="Group help">
221
+ <TextInput label="Email" description="Field help" error="Field error" />
222
+ </Fieldset>,
223
+ )
224
+ const input = screen.getByLabelText("Email")
225
+ const fieldError = screen.getByText("Field error")
226
+ expect(input.getAttribute("aria-describedby")).toBe(fieldError.id)
227
+ expect(input.getAttribute("aria-invalid")).toBe("true")
228
+ })
229
+
230
+ describe("disabled reaches every kit control inside", () => {
231
+ it.each(CONTROLS)("%s", async (_name, control) => {
232
+ const { container } = render(
233
+ <Fieldset legend="Group" disabled>
234
+ {control}
235
+ </Fieldset>,
236
+ )
237
+ await settle()
238
+ const fieldset = controlIn(container)
239
+ // Nothing in the group can be tabbed to or clicked into…
240
+ expect(reachable(fieldset).map((el) => el.outerHTML.slice(0, 80))).toEqual([])
241
+ // …and the control says so, which is what its dimmed styling keys off.
242
+ const flagged = fieldset.querySelectorAll(
243
+ ':disabled, [data-disabled], [aria-disabled="true"]',
244
+ )
245
+ expect(flagged.length).toBeGreaterThan(0)
246
+ })
247
+ })
248
+
249
+ it("stays out of the way when not disabled", async () => {
250
+ const { container } = render(
251
+ <Fieldset legend="Group">
252
+ {CONTROLS.map(([name, control]) => (
253
+ <div key={name}>{control}</div>
254
+ ))}
255
+ </Fieldset>,
256
+ )
257
+ await settle()
258
+ expect(controlIn(container).querySelectorAll(":disabled, [data-disabled]")).toHaveLength(0)
259
+ })
260
+
261
+ /**
262
+ * Ark's `Field` takes a fieldset's `disabled` but not its `invalid`; the kit's
263
+ * `Field` adds that, so every labelled control turns red with the group.
264
+ * `Button` is no field control, so it has no red state to take.
265
+ */
266
+ describe("invalid reaches every control in a Field", () => {
267
+ const IGNORES_FIELD_INVALID = new Set(["Button"])
268
+ const FIELD_PARTS = new Set(["field:root", "field:label", "fieldset:root", "fieldset:legend"])
269
+ it.each(CONTROLS.filter(([name]) => !IGNORES_FIELD_INVALID.has(name)))(
270
+ "%s",
271
+ async (_name, control) => {
272
+ const { container } = render(
273
+ <Fieldset legend="Group" invalid>
274
+ {control}
275
+ </Fieldset>,
276
+ )
277
+ await settle()
278
+ const fieldset = controlIn(container)
279
+ // The field's own parts (root, label) turn red in any case: look past them.
280
+ const red = Array.from(
281
+ fieldset.querySelectorAll('[data-invalid], [aria-invalid="true"]'),
282
+ ).filter(
283
+ (el) =>
284
+ !FIELD_PARTS.has(`${el.getAttribute("data-scope")}:${el.getAttribute("data-part")}`),
285
+ )
286
+ expect(red.length).toBeGreaterThan(0)
287
+ },
288
+ )
289
+ })
290
+
291
+ it("lets a Field inside opt out of the group's invalid state", () => {
292
+ render(
293
+ <Fieldset legend="Group" invalid>
294
+ <Field label="Other" invalid={false}>
295
+ <ArkField.Input />
296
+ </Field>
297
+ <Field label="Kit" invalid={false}>
298
+ <Input />
299
+ </Field>
300
+ </Fieldset>,
301
+ )
302
+ expect(screen.getByLabelText("Other").getAttribute("aria-invalid")).toBeNull()
303
+ expect(screen.getByLabelText("Kit").getAttribute("aria-invalid")).toBeNull()
304
+ })
305
+
306
+ /**
307
+ * With no `Field` between them, only the control's own reading of the
308
+ * enclosing `Fieldset` can dim it or turn it red: the browser's `:disabled`
309
+ * reaches the native elements, never the shell, cells, stars or trigger the
310
+ * kit styles. Each control has to put `data-disabled` / `data-invalid` (or
311
+ * `aria-invalid`) on something of its own.
312
+ */
313
+ describe("an unlabelled control looks disabled in a disabled group", () => {
314
+ it.each(UNLABELLED)("%s", async (_name, control, stateOn) => {
315
+ const { container } = render(
316
+ <Fieldset legend="Group" disabled>
317
+ {control}
318
+ </Fieldset>,
319
+ )
320
+ await settle()
321
+ expect(reachable(controlIn(container)).map((el) => el.outerHTML.slice(0, 80))).toEqual([])
322
+ expect(flaggedIn(container, "[data-disabled]", stateOn).length).toBeGreaterThan(0)
323
+ })
324
+ })
325
+
326
+ describe("an unlabelled control turns red in an invalid group", () => {
327
+ it.each(UNLABELLED.filter(([name]) => !NO_INVALID_LOOK.has(name)))(
328
+ "%s",
329
+ async (_name, control) => {
330
+ const { container } = render(
331
+ <Fieldset legend="Group" invalid>
332
+ {control}
333
+ </Fieldset>,
334
+ )
335
+ await settle()
336
+ expect(
337
+ flaggedIn(container, '[data-invalid], [aria-invalid="true"]').length,
338
+ ).toBeGreaterThan(0)
339
+ },
340
+ )
341
+ })
342
+
343
+ describe("an unlabelled control stays as it is in a plain group", () => {
344
+ it.each(UNLABELLED)("%s", async (_name, control, stateOn) => {
345
+ const { container } = render(<Fieldset legend="Group">{control}</Fieldset>)
346
+ await settle()
347
+ expect(
348
+ flaggedIn(container, '[data-disabled], [data-invalid], [aria-invalid="true"]', stateOn),
349
+ ).toEqual([])
350
+ })
351
+ })
352
+ })