@42-central/ui-react 0.29.1 → 0.30.1

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 (592) 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/breadcrumb/breadcrumb.d.ts +5 -1
  115. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  116. package/dist/components/breadcrumb/index.js +12 -0
  117. package/dist/components/breadcrumb/index.js.map +1 -1
  118. package/dist/components/button/button.d.ts +15 -2
  119. package/dist/components/button/button.d.ts.map +1 -1
  120. package/dist/components/button/index.js +5 -1
  121. package/dist/components/button-multi-select/index.js +6 -4
  122. package/dist/components/button-multi-select/index.js.map +1 -1
  123. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  124. package/dist/components/button-select/button-select.d.ts +2 -2
  125. package/dist/components/button-select/button-select.d.ts.map +1 -1
  126. package/dist/components/button-select/index.js +6 -4
  127. package/dist/components/button-select/index.js.map +1 -1
  128. package/dist/components/calendar/aliases.d.ts +16 -0
  129. package/dist/components/calendar/aliases.d.ts.map +1 -0
  130. package/dist/components/calendar/calendar-body.d.ts +11 -1
  131. package/dist/components/calendar/calendar-body.d.ts.map +1 -1
  132. package/dist/components/calendar/calendar.d.ts +8 -4
  133. package/dist/components/calendar/calendar.d.ts.map +1 -1
  134. package/dist/components/calendar/index.d.ts +2 -1
  135. package/dist/components/calendar/index.d.ts.map +1 -1
  136. package/dist/components/calendar/index.js +15 -5
  137. package/dist/components/calendar/index.js.map +1 -1
  138. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
  139. package/dist/components/calendar-heatmap/index.js +85 -73
  140. package/dist/components/calendar-heatmap/index.js.map +1 -1
  141. package/dist/components/camera/index.js +16 -14
  142. package/dist/components/carousel/index.js +3 -3
  143. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  144. package/dist/components/checkbox/index.js +2 -2
  145. package/dist/components/choice-card-group/index.js +2 -2
  146. package/dist/components/choice-card-group/index.js.map +1 -1
  147. package/dist/components/circular-progress/circular-progress.d.ts +22 -11
  148. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  149. package/dist/components/circular-progress/index.d.ts +1 -1
  150. package/dist/components/circular-progress/index.d.ts.map +1 -1
  151. package/dist/components/circular-progress/index.js +68 -49
  152. package/dist/components/circular-progress/index.js.map +1 -1
  153. package/dist/components/clipboard/index.js +7 -3
  154. package/dist/components/clipboard/index.js.map +1 -1
  155. package/dist/components/code/code.d.ts +10 -0
  156. package/dist/components/code/code.d.ts.map +1 -1
  157. package/dist/components/code/index.js +1 -0
  158. package/dist/components/code/index.js.map +1 -1
  159. package/dist/components/code-block/chrome.js +10 -6
  160. package/dist/components/code-block/index.js +10 -7
  161. package/dist/components/code-block/index.js.map +1 -1
  162. package/dist/components/combobox/combobox.d.ts +5 -3
  163. package/dist/components/combobox/combobox.d.ts.map +1 -1
  164. package/dist/components/combobox/index.js +12 -7
  165. package/dist/components/combobox-list/combobox-list.d.ts +1 -1
  166. package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
  167. package/dist/components/combobox-list/index.js +14 -9
  168. package/dist/components/compare/index.js +1 -1
  169. package/dist/components/data-list/data-list.d.ts +96 -0
  170. package/dist/components/data-list/data-list.d.ts.map +1 -0
  171. package/dist/components/data-list/index.d.ts +2 -0
  172. package/dist/components/data-list/index.d.ts.map +1 -0
  173. package/dist/components/data-list/index.js +147 -0
  174. package/dist/components/data-list/index.js.map +1 -0
  175. package/dist/components/data-table/data-table-group.d.ts.map +1 -1
  176. package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
  177. package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
  178. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  179. package/dist/components/data-table/data-table.d.ts +5 -2
  180. package/dist/components/data-table/data-table.d.ts.map +1 -1
  181. package/dist/components/data-table/index.js +163 -168
  182. package/dist/components/data-table/index.js.map +1 -1
  183. package/dist/components/date-picker/aliases.d.ts +16 -0
  184. package/dist/components/date-picker/aliases.d.ts.map +1 -1
  185. package/dist/components/date-picker/date-picker.d.ts +22 -8
  186. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  187. package/dist/components/date-picker/index.d.ts +2 -2
  188. package/dist/components/date-picker/index.d.ts.map +1 -1
  189. package/dist/components/date-picker/index.js +34 -28
  190. package/dist/components/date-picker/index.js.map +1 -1
  191. package/dist/components/download-button/index.js +6 -2
  192. package/dist/components/drawer/drawer.d.ts +7 -4
  193. package/dist/components/drawer/drawer.d.ts.map +1 -1
  194. package/dist/components/drawer/index.js +11 -6
  195. package/dist/components/empty-state/empty-state.d.ts +57 -0
  196. package/dist/components/empty-state/empty-state.d.ts.map +1 -0
  197. package/dist/components/empty-state/index.d.ts +2 -0
  198. package/dist/components/empty-state/index.d.ts.map +1 -0
  199. package/dist/components/empty-state/index.js +8 -0
  200. package/dist/components/empty-state/index.js.map +1 -0
  201. package/dist/components/field/field.d.ts +20 -0
  202. package/dist/components/field/field.d.ts.map +1 -1
  203. package/dist/components/field/index.js +1 -1
  204. package/dist/components/fieldset/fieldset.d.ts +103 -0
  205. package/dist/components/fieldset/fieldset.d.ts.map +1 -0
  206. package/dist/components/fieldset/index.d.ts +2 -0
  207. package/dist/components/fieldset/index.d.ts.map +1 -0
  208. package/dist/components/fieldset/index.js +150 -0
  209. package/dist/components/fieldset/index.js.map +1 -0
  210. package/dist/components/file-item/index.js +10 -7
  211. package/dist/components/file-preview/file-preview.d.ts.map +1 -1
  212. package/dist/components/file-preview/index.js +10 -18
  213. package/dist/components/file-preview/index.js.map +1 -1
  214. package/dist/components/file-trigger/index.js +6 -2
  215. package/dist/components/file-upload/file-upload.d.ts.map +1 -1
  216. package/dist/components/file-upload/index.js +18 -14
  217. package/dist/components/file-upload/index.js.map +1 -1
  218. package/dist/components/gallery/index.js +3 -3
  219. package/dist/components/geodesic/a11y.d.ts +3 -3
  220. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  221. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  222. package/dist/components/hover-card/index.js +10 -3
  223. package/dist/components/hover-card/index.js.map +1 -1
  224. package/dist/components/image/index.js +3 -3
  225. package/dist/components/image-cropper/index.js +9 -6
  226. package/dist/components/input/index.js +2 -2
  227. package/dist/components/input/input.d.ts.map +1 -1
  228. package/dist/components/kbd/index.js +3 -3
  229. package/dist/components/kbd/kbd.d.ts +4 -0
  230. package/dist/components/kbd/kbd.d.ts.map +1 -1
  231. package/dist/components/lightbox/index.js +13 -11
  232. package/dist/components/lightbox/index.js.map +1 -1
  233. package/dist/components/menu/index.js +9 -5
  234. package/dist/components/menu/index.js.map +1 -1
  235. package/dist/components/menu/menu.d.ts.map +1 -1
  236. package/dist/components/modal/index.js +11 -6
  237. package/dist/components/modal/modal.d.ts +10 -4
  238. package/dist/components/modal/modal.d.ts.map +1 -1
  239. package/dist/components/multi-combobox-list/index.js +13 -9
  240. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
  241. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
  242. package/dist/components/multi-select/index.js +13 -10
  243. package/dist/components/multi-select/index.js.map +1 -1
  244. package/dist/components/multi-select/multi-select.d.ts +1 -1
  245. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  246. package/dist/components/nav-link/index.js +4 -4
  247. package/dist/components/nav-link/tanstack.js +4 -4
  248. package/dist/components/notification/index.js +6 -6
  249. package/dist/components/notification/index.js.map +1 -1
  250. package/dist/components/number-input/index.js +11 -7
  251. package/dist/components/number-input/number-input.d.ts +1 -1
  252. package/dist/components/number-input/number-input.d.ts.map +1 -1
  253. package/dist/components/overlays/dialog-parts.d.ts +10 -1
  254. package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
  255. package/dist/components/overlays/index.js +13 -8
  256. package/dist/components/overlays/index.js.map +1 -1
  257. package/dist/components/pagination/index.d.ts +2 -0
  258. package/dist/components/pagination/index.d.ts.map +1 -0
  259. package/dist/components/pagination/index.js +362 -0
  260. package/dist/components/pagination/index.js.map +1 -0
  261. package/dist/components/pagination/pagination.d.ts +147 -0
  262. package/dist/components/pagination/pagination.d.ts.map +1 -0
  263. package/dist/components/password-input/index.js +6 -5
  264. package/dist/components/password-input/index.js.map +1 -1
  265. package/dist/components/password-input/password-input.d.ts +1 -1
  266. package/dist/components/password-input/password-input.d.ts.map +1 -1
  267. package/dist/components/phone-input/index.js +14 -11
  268. package/dist/components/phone-input/index.js.map +1 -1
  269. package/dist/components/phone-input/phone-input.d.ts +1 -1
  270. package/dist/components/phone-input/phone-input.d.ts.map +1 -1
  271. package/dist/components/photo-capture/index.js +19 -17
  272. package/dist/components/photo-capture/index.js.map +1 -1
  273. package/dist/components/pills-input/index.js +4 -4
  274. package/dist/components/pills-input/pills-input.d.ts +1 -1
  275. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  276. package/dist/components/pin-input/index.js +6 -5
  277. package/dist/components/pin-input/index.js.map +1 -1
  278. package/dist/components/pin-input/pin-input.d.ts.map +1 -1
  279. package/dist/components/popover/index.js +7 -2
  280. package/dist/components/popover/popover.d.ts +41 -16
  281. package/dist/components/popover/popover.d.ts.map +1 -1
  282. package/dist/components/progress/index.d.ts +1 -1
  283. package/dist/components/progress/index.d.ts.map +1 -1
  284. package/dist/components/progress/index.js +4 -1
  285. package/dist/components/progress/progress.d.ts +22 -14
  286. package/dist/components/progress/progress.d.ts.map +1 -1
  287. package/dist/components/prose/index.d.ts +2 -0
  288. package/dist/components/prose/index.d.ts.map +1 -0
  289. package/dist/components/prose/index.js +17 -0
  290. package/dist/components/prose/index.js.map +1 -0
  291. package/dist/components/prose/prose.d.ts +49 -0
  292. package/dist/components/prose/prose.d.ts.map +1 -0
  293. package/dist/components/prose/styles.css +593 -0
  294. package/dist/components/radio-group/index.js +9 -3
  295. package/dist/components/radio-group/index.js.map +1 -1
  296. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  297. package/dist/components/rating/index.js +3 -2
  298. package/dist/components/rating/index.js.map +1 -1
  299. package/dist/components/rating/rating.d.ts.map +1 -1
  300. package/dist/components/schedule/index.js +10 -8
  301. package/dist/components/schedule/index.js.map +1 -1
  302. package/dist/components/scroll-area/index.d.ts +2 -0
  303. package/dist/components/scroll-area/index.d.ts.map +1 -0
  304. package/dist/components/scroll-area/index.js +10 -0
  305. package/dist/components/scroll-area/index.js.map +1 -0
  306. package/dist/components/scroll-area/scroll-area.d.ts +150 -0
  307. package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
  308. package/dist/components/segment-group/index.js +2 -2
  309. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  310. package/dist/components/select/index.js +12 -8
  311. package/dist/components/select/select.d.ts +1 -1
  312. package/dist/components/select/select.d.ts.map +1 -1
  313. package/dist/components/slider/index.js +2 -2
  314. package/dist/components/slider/slider.d.ts.map +1 -1
  315. package/dist/components/splitter/index.d.ts +2 -0
  316. package/dist/components/splitter/index.d.ts.map +1 -0
  317. package/dist/components/splitter/index.js +373 -0
  318. package/dist/components/splitter/index.js.map +1 -0
  319. package/dist/components/splitter/splitter.d.ts +159 -0
  320. package/dist/components/splitter/splitter.d.ts.map +1 -0
  321. package/dist/components/spotlight/index.js +23 -22
  322. package/dist/components/spotlight/index.js.map +1 -1
  323. package/dist/components/spotlight/spotlight.d.ts.map +1 -1
  324. package/dist/components/steps/index.d.ts +4 -0
  325. package/dist/components/steps/index.d.ts.map +1 -0
  326. package/dist/components/steps/index.js +478 -0
  327. package/dist/components/steps/index.js.map +1 -0
  328. package/dist/components/steps/steps-data.d.ts +78 -0
  329. package/dist/components/steps/steps-data.d.ts.map +1 -0
  330. package/dist/components/steps/steps.d.ts +183 -0
  331. package/dist/components/steps/steps.d.ts.map +1 -0
  332. package/dist/components/switch/index.js +4 -3
  333. package/dist/components/switch/index.js.map +1 -1
  334. package/dist/components/switch/switch.d.ts.map +1 -1
  335. package/dist/components/table-of-contents/index.d.ts +2 -0
  336. package/dist/components/table-of-contents/index.d.ts.map +1 -0
  337. package/dist/components/table-of-contents/index.js +471 -0
  338. package/dist/components/table-of-contents/index.js.map +1 -0
  339. package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
  340. package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
  341. package/dist/components/tags-input/index.js +12 -9
  342. package/dist/components/tags-input/index.js.map +1 -1
  343. package/dist/components/tags-input/tags-input.d.ts +1 -1
  344. package/dist/components/tags-input/tags-input.d.ts.map +1 -1
  345. package/dist/components/text-input/index.js +2 -2
  346. package/dist/components/textarea/index.js +8 -6
  347. package/dist/components/textarea/index.js.map +1 -1
  348. package/dist/components/textarea/textarea.d.ts.map +1 -1
  349. package/dist/components/time-input/index.js +11 -9
  350. package/dist/components/time-input/index.js.map +1 -1
  351. package/dist/components/tooltip/index.js +1 -1
  352. package/dist/components/tooltip/tooltip.d.ts +3 -8
  353. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  354. package/dist/components/tour/conditions.d.ts +83 -0
  355. package/dist/components/tour/conditions.d.ts.map +1 -0
  356. package/dist/components/tour/create-tours.d.ts +49 -0
  357. package/dist/components/tour/create-tours.d.ts.map +1 -0
  358. package/dist/components/tour/index.d.ts +6 -0
  359. package/dist/components/tour/index.d.ts.map +1 -0
  360. package/dist/components/tour/index.js +1449 -0
  361. package/dist/components/tour/index.js.map +1 -0
  362. package/dist/components/tour/runtime.d.ts +57 -0
  363. package/dist/components/tour/runtime.d.ts.map +1 -0
  364. package/dist/components/tour/storage.d.ts +14 -0
  365. package/dist/components/tour/storage.d.ts.map +1 -0
  366. package/dist/components/tour/store.d.ts +62 -0
  367. package/dist/components/tour/store.d.ts.map +1 -0
  368. package/dist/components/tour/tour.d.ts +77 -0
  369. package/dist/components/tour/tour.d.ts.map +1 -0
  370. package/dist/components/tour/types.d.ts +680 -0
  371. package/dist/components/tour/types.d.ts.map +1 -0
  372. package/dist/components/tree/index.d.ts +3 -0
  373. package/dist/components/tree/index.d.ts.map +1 -0
  374. package/dist/components/tree/index.js +457 -0
  375. package/dist/components/tree/index.js.map +1 -0
  376. package/dist/components/tree/tree-row.d.ts +72 -0
  377. package/dist/components/tree/tree-row.d.ts.map +1 -0
  378. package/dist/components/tree/tree.d.ts +193 -0
  379. package/dist/components/tree/tree.d.ts.map +1 -0
  380. package/dist/components/tree-multi-select/index.js +31 -54
  381. package/dist/components/tree-multi-select/index.js.map +1 -1
  382. package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
  383. package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
  384. package/dist/components/tree-select/index.js +30 -24
  385. package/dist/components/tree-select/index.js.map +1 -1
  386. package/dist/components/tree-select/tree-popover.d.ts +20 -31
  387. package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
  388. package/dist/components/tree-select/tree-select.d.ts +1 -1
  389. package/dist/components/tree-select/tree-select.d.ts.map +1 -1
  390. package/dist/index.d.ts +2 -0
  391. package/dist/index.d.ts.map +1 -1
  392. package/dist/index.js +10 -8
  393. package/dist/index.js.map +1 -1
  394. package/dist/lib/date-predicates.d.ts +7 -5
  395. package/dist/lib/date-predicates.d.ts.map +1 -1
  396. package/dist/lib/date-value.d.ts +20 -0
  397. package/dist/lib/date-value.d.ts.map +1 -1
  398. package/dist/lib/floating-arrow.d.ts +53 -0
  399. package/dist/lib/floating-arrow.d.ts.map +1 -0
  400. package/dist/lib/focus-return.d.ts +53 -0
  401. package/dist/lib/focus-return.d.ts.map +1 -0
  402. package/dist/lib/meter.d.ts +104 -0
  403. package/dist/lib/meter.d.ts.map +1 -0
  404. package/dist/lib/overlay-layer.d.ts +26 -8
  405. package/dist/lib/overlay-layer.d.ts.map +1 -1
  406. package/dist/lib/pressed.d.ts +92 -0
  407. package/dist/lib/pressed.d.ts.map +1 -0
  408. package/dist/lib/tree-data.d.ts +18 -2
  409. package/dist/lib/tree-data.d.ts.map +1 -1
  410. package/dist/lib/use-pagination.d.ts +102 -0
  411. package/dist/lib/use-pagination.d.ts.map +1 -0
  412. package/dist/lib/use-scroll-spy.d.ts +126 -0
  413. package/dist/lib/use-scroll-spy.d.ts.map +1 -0
  414. package/dist/theme.css +39 -3
  415. package/package.json +1 -1
  416. package/src/as-child.contract.test.tsx +283 -1
  417. package/src/components/action-icon/action-icon.tsx +34 -4
  418. package/src/components/anchor/anchor.test.tsx +232 -0
  419. package/src/components/anchor/anchor.tsx +187 -0
  420. package/src/components/anchor/index.ts +12 -0
  421. package/src/components/app-shell/app-shell.test.tsx +15 -7
  422. package/src/components/app-shell/app-shell.tsx +27 -20
  423. package/src/components/autocomplete/autocomplete.tsx +11 -3
  424. package/src/components/breadcrumb/breadcrumb.test.tsx +24 -0
  425. package/src/components/breadcrumb/breadcrumb.tsx +20 -1
  426. package/src/components/button/button-pressed.test.tsx +202 -0
  427. package/src/components/button/button.tsx +48 -6
  428. package/src/components/button-select/button-select-control.tsx +2 -2
  429. package/src/components/button-select/button-select.tsx +22 -2
  430. package/src/components/calendar/aliases.tsx +28 -0
  431. package/src/components/calendar/calendar-body.tsx +310 -210
  432. package/src/components/calendar/calendar.tsx +43 -12
  433. package/src/components/calendar/index.ts +7 -1
  434. package/src/components/calendar/month-year-calendar.test.tsx +106 -0
  435. package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
  436. package/src/components/checkbox/checkbox.tsx +7 -2
  437. package/src/components/choice-card-group/choice-card-group.tsx +2 -2
  438. package/src/components/circular-progress/circular-progress.test.tsx +35 -0
  439. package/src/components/circular-progress/circular-progress.tsx +116 -59
  440. package/src/components/circular-progress/index.ts +1 -0
  441. package/src/components/code/code.test.tsx +16 -0
  442. package/src/components/code/code.tsx +11 -0
  443. package/src/components/combobox/combobox.tsx +63 -28
  444. package/src/components/combobox-list/combobox-list.tsx +11 -3
  445. package/src/components/data-list/data-list.test.tsx +149 -0
  446. package/src/components/data-list/data-list.tsx +268 -0
  447. package/src/components/data-list/index.ts +9 -0
  448. package/src/components/data-table/data-table-group.test.tsx +16 -0
  449. package/src/components/data-table/data-table-group.tsx +15 -2
  450. package/src/components/data-table/data-table-placeholder.tsx +28 -36
  451. package/src/components/data-table/data-table-stack.tsx +33 -39
  452. package/src/components/data-table/data-table.test.tsx +31 -0
  453. package/src/components/data-table/data-table.tsx +41 -42
  454. package/src/components/date-picker/aliases.tsx +28 -0
  455. package/src/components/date-picker/date-picker.test.tsx +29 -0
  456. package/src/components/date-picker/date-picker.tsx +164 -45
  457. package/src/components/date-picker/index.ts +5 -1
  458. package/src/components/date-picker/month-year-picker.test.tsx +362 -0
  459. package/src/components/drawer/drawer.test.tsx +41 -0
  460. package/src/components/drawer/drawer.tsx +7 -1
  461. package/src/components/empty-state/empty-state.test.tsx +109 -0
  462. package/src/components/empty-state/empty-state.tsx +180 -0
  463. package/src/components/empty-state/index.ts +9 -0
  464. package/src/components/field/field.tsx +35 -1
  465. package/src/components/fieldset/fieldset.test.tsx +352 -0
  466. package/src/components/fieldset/fieldset.tsx +268 -0
  467. package/src/components/fieldset/index.ts +11 -0
  468. package/src/components/file-preview/file-preview.test.tsx +2 -1
  469. package/src/components/file-preview/file-preview.tsx +7 -13
  470. package/src/components/file-upload/file-upload.tsx +14 -5
  471. package/src/components/hover-card/hover-card.tsx +5 -1
  472. package/src/components/input/input.tsx +12 -5
  473. package/src/components/kbd/kbd.test.tsx +13 -0
  474. package/src/components/kbd/kbd.tsx +6 -0
  475. package/src/components/menu/menu.tsx +6 -2
  476. package/src/components/modal/modal.test.tsx +41 -0
  477. package/src/components/modal/modal.tsx +17 -9
  478. package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
  479. package/src/components/multi-select/multi-select.tsx +11 -3
  480. package/src/components/notification/create-notifier.tsx +1 -1
  481. package/src/components/number-input/number-input.tsx +12 -3
  482. package/src/components/overlays/dialog-parts.tsx +42 -5
  483. package/src/components/pagination/index.ts +19 -0
  484. package/src/components/pagination/pagination.test.tsx +187 -0
  485. package/src/components/pagination/pagination.tsx +563 -0
  486. package/src/components/password-input/password-input.tsx +12 -3
  487. package/src/components/phone-input/phone-input.tsx +12 -3
  488. package/src/components/pills-input/pills-input.tsx +7 -2
  489. package/src/components/pin-input/pin-input.tsx +13 -4
  490. package/src/components/popover/popover.tsx +87 -17
  491. package/src/components/progress/index.ts +1 -0
  492. package/src/components/progress/progress.test.tsx +102 -0
  493. package/src/components/progress/progress.tsx +116 -62
  494. package/src/components/prose/index.ts +1 -0
  495. package/src/components/prose/prose.test.tsx +90 -0
  496. package/src/components/prose/prose.tsx +60 -0
  497. package/src/components/prose/styles.css +593 -0
  498. package/src/components/radio-group/radio-group.tsx +8 -3
  499. package/src/components/rating/rating.tsx +5 -2
  500. package/src/components/scroll-area/index.ts +18 -0
  501. package/src/components/scroll-area/scroll-area.test.tsx +184 -0
  502. package/src/components/scroll-area/scroll-area.tsx +448 -0
  503. package/src/components/segment-group/segment-group.tsx +2 -2
  504. package/src/components/select/select.tsx +37 -18
  505. package/src/components/slider/slider.tsx +2 -2
  506. package/src/components/splitter/index.ts +15 -0
  507. package/src/components/splitter/splitter.test.tsx +244 -0
  508. package/src/components/splitter/splitter.tsx +625 -0
  509. package/src/components/spotlight/spotlight.test.tsx +34 -26
  510. package/src/components/spotlight/spotlight.tsx +7 -9
  511. package/src/components/steps/index.ts +21 -0
  512. package/src/components/steps/steps-data.tsx +179 -0
  513. package/src/components/steps/steps.test.tsx +235 -0
  514. package/src/components/steps/steps.tsx +686 -0
  515. package/src/components/switch/switch.tsx +7 -2
  516. package/src/components/table-of-contents/index.ts +17 -0
  517. package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
  518. package/src/components/table-of-contents/table-of-contents.tsx +708 -0
  519. package/src/components/tags-input/tags-input.tsx +12 -3
  520. package/src/components/textarea/textarea.tsx +15 -5
  521. package/src/components/tooltip/tooltip.tsx +8 -17
  522. package/src/components/tour/conditions.test.ts +527 -0
  523. package/src/components/tour/conditions.ts +445 -0
  524. package/src/components/tour/create-tours.tsx +150 -0
  525. package/src/components/tour/index.ts +86 -0
  526. package/src/components/tour/runtime.ts +187 -0
  527. package/src/components/tour/storage.test.ts +68 -0
  528. package/src/components/tour/storage.ts +44 -0
  529. package/src/components/tour/store.test.tsx +784 -0
  530. package/src/components/tour/store.ts +661 -0
  531. package/src/components/tour/tour.test.tsx +318 -0
  532. package/src/components/tour/tour.tsx +773 -0
  533. package/src/components/tour/tour.types.test.ts +185 -0
  534. package/src/components/tour/types.ts +904 -0
  535. package/src/components/tree/index.ts +24 -0
  536. package/src/components/tree/tree-row.tsx +179 -0
  537. package/src/components/tree/tree.test.tsx +296 -0
  538. package/src/components/tree/tree.tsx +796 -0
  539. package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
  540. package/src/components/tree-select/tree-popover.tsx +26 -107
  541. package/src/components/tree-select/tree-select.tsx +24 -16
  542. package/src/icon-stroke.test.tsx +2 -0
  543. package/src/index.ts +16 -0
  544. package/src/lib/date-predicates.test.ts +46 -0
  545. package/src/lib/date-predicates.ts +44 -24
  546. package/src/lib/date-value.test.ts +24 -1
  547. package/src/lib/date-value.ts +42 -1
  548. package/src/lib/floating-arrow.tsx +73 -0
  549. package/src/lib/focus-return.test.tsx +143 -0
  550. package/src/lib/focus-return.ts +106 -0
  551. package/src/lib/meter.test.ts +40 -0
  552. package/src/lib/meter.ts +159 -0
  553. package/src/lib/overlay-layer.test.tsx +47 -1
  554. package/src/lib/overlay-layer.tsx +65 -8
  555. package/src/lib/pressed.ts +130 -0
  556. package/src/lib/tree-data.ts +42 -2
  557. package/src/lib/use-pagination.test.ts +105 -0
  558. package/src/lib/use-pagination.ts +179 -0
  559. package/src/lib/use-scroll-spy.test.tsx +238 -0
  560. package/src/lib/use-scroll-spy.ts +336 -0
  561. package/src/theme.css +39 -3
  562. package/src/theme.test.ts +29 -1
  563. package/src/visually-hidden-containment.test.tsx +9 -0
  564. package/dist/chunk-2W7H43WL.js.map +0 -1
  565. package/dist/chunk-7E7JNWOC.js.map +0 -1
  566. package/dist/chunk-7FPSQBWB.js.map +0 -1
  567. package/dist/chunk-7KFUFAVP.js.map +0 -1
  568. package/dist/chunk-AKXALCUN.js.map +0 -1
  569. package/dist/chunk-B5YHYI7E.js.map +0 -1
  570. package/dist/chunk-FQJNQW3G.js.map +0 -1
  571. package/dist/chunk-G3AD3NJG.js.map +0 -1
  572. package/dist/chunk-GEZYGBXY.js.map +0 -1
  573. package/dist/chunk-HCHGERDB.js.map +0 -1
  574. package/dist/chunk-HWBFRDX7.js.map +0 -1
  575. package/dist/chunk-I4B3N3UX.js.map +0 -1
  576. package/dist/chunk-IA6DCC3N.js.map +0 -1
  577. package/dist/chunk-IANYMDKH.js.map +0 -1
  578. package/dist/chunk-MQHD3EJE.js.map +0 -1
  579. package/dist/chunk-NNPSBC7O.js.map +0 -1
  580. package/dist/chunk-OXR7BXZA.js.map +0 -1
  581. package/dist/chunk-QKSLDQM2.js +0 -120
  582. package/dist/chunk-QKSLDQM2.js.map +0 -1
  583. package/dist/chunk-QRNQQIQM.js.map +0 -1
  584. package/dist/chunk-RKCUXOU2.js.map +0 -1
  585. package/dist/chunk-S5CQRCTF.js +0 -426
  586. package/dist/chunk-S5CQRCTF.js.map +0 -1
  587. package/dist/chunk-SBZJGFZ6.js.map +0 -1
  588. package/dist/chunk-SP6LCCTZ.js.map +0 -1
  589. package/dist/chunk-TUP7WXQE.js.map +0 -1
  590. package/dist/chunk-V2QZG4IT.js.map +0 -1
  591. package/dist/chunk-X6DESK37.js.map +0 -1
  592. package/dist/chunk-ZB5VMGKB.js.map +0 -1
@@ -0,0 +1,686 @@
1
+ "use client"
2
+
3
+ import { ark, type HTMLArkProps } from "@ark-ui/react"
4
+ import { Steps as Ark, useStepsContext } from "@ark-ui/react/steps"
5
+ import { Check, X } from "lucide-react"
6
+ import {
7
+ createContext,
8
+ type ReactNode,
9
+ useContext,
10
+ useEffect,
11
+ useMemo,
12
+ useRef,
13
+ useState,
14
+ } from "react"
15
+ import { match } from "ts-pattern"
16
+ import { composeChildren, type NoAsChild } from "../../lib/as-child"
17
+ import { cn } from "../../lib/cn"
18
+ import type { Color } from "../../lib/colors"
19
+ import { focusStyles } from "../../lib/focus-styles"
20
+ import { type IconMap, iconStroke, mergeIcons } from "../../lib/icons"
21
+ import { useDirectionCheck, useLocale } from "../../lib/intl"
22
+ import { props } from "../../lib/props"
23
+ import type { Size } from "../../lib/sizes"
24
+ import type { WithTestId } from "../../lib/test-id"
25
+ import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
26
+ import { Button, type ButtonProps } from "../button/button"
27
+
28
+ /**
29
+ * Steps — a stepper for multi-step flows (registration, exam sign-up, a staff
30
+ * wizard), on Ark UI's Steps machine. A row (or column) of steps, each an
31
+ * indicator (its number, a check once complete, or your icon) with a title and
32
+ * an optional description, joined by connectors that fill as the flow
33
+ * advances. Each step reveals its own content panel, and a completed panel
34
+ * shows once the last step is done.
35
+ *
36
+ * Two ways to use it:
37
+ *
38
+ * // 1. Data-driven — the common case
39
+ * <Steps
40
+ * withControls
41
+ * data={[
42
+ * { title: "Account", description: "Email and password", content: <Account /> },
43
+ * { title: "Campus", content: <Campus /> },
44
+ * { title: "Confirm", content: <Confirm /> },
45
+ * ]}
46
+ * completed={<Welcome />}
47
+ * />
48
+ *
49
+ * // 2. Compound — for anything the data array can't express
50
+ * <Steps.Root count={2}>
51
+ * <Steps.List>
52
+ * <Steps.Item index={0}>
53
+ * <Steps.Trigger>
54
+ * <Steps.Indicator />
55
+ * <Steps.Title>Account</Steps.Title>
56
+ * </Steps.Trigger>
57
+ * <Steps.Separator />
58
+ * </Steps.Item>
59
+ * <Steps.Item index={1}>…</Steps.Item>
60
+ * </Steps.List>
61
+ * <Steps.Content index={0}><Account /></Steps.Content>
62
+ * <Steps.Content index={1}><Campus /></Steps.Content>
63
+ * <Steps.CompletedContent><Welcome /></Steps.CompletedContent>
64
+ * <Steps.PrevTrigger />
65
+ * <Steps.NextTrigger />
66
+ * </Steps.Root>
67
+ *
68
+ * The step is an index: `0` is the first step, and `count` (one past the
69
+ * last) is the completed state. Steps doesn't validate anything itself: gate
70
+ * Next with Ark's `isStepValid`, or control `step` and advance it yourself.
71
+ */
72
+
73
+ /** The kit's English strings. Spread a partial `translations` over it. */
74
+ export const STEPS_DEFAULT_TRANSLATIONS: Required<StepsTranslations> = {
75
+ prev: "Back",
76
+ next: "Next",
77
+ finish: "Finish",
78
+ complete: "Completed",
79
+ error: "Has errors",
80
+ progress: (step, count) => `Step ${step} of ${count}`,
81
+ done: "All steps completed",
82
+ }
83
+
84
+ export type StepsTranslations = {
85
+ /** `PrevTrigger`'s default label. @default "Back" */
86
+ prev?: string
87
+ /** `NextTrigger`'s default label. @default "Next" */
88
+ next?: string
89
+ /** `NextTrigger`'s default label on the last step. @default "Finish" */
90
+ finish?: string
91
+ /** Added to a completed step's accessible name. @default "Completed" */
92
+ complete?: string
93
+ /** Added to an errored step's accessible name. @default "Has errors" */
94
+ error?: string
95
+ /** Announced when the step changes; `step` counts from 1.
96
+ * @default (step, count) => `Step ${step} of ${count}` */
97
+ progress?: (step: number, count: number) => string
98
+ /** Announced when the last step is completed. @default "All steps completed" */
99
+ done?: string
100
+ }
101
+
102
+ /** The icons the kit draws in an indicator. */
103
+ export type StepsIconSlot = "complete" | "error"
104
+
105
+ const DEFAULT_ICONS: Record<StepsIconSlot, ReactNode> = {
106
+ complete: <Check className={iconStroke} />,
107
+ error: <X className={iconStroke} />,
108
+ }
109
+
110
+ /** What a step shows, in precedence order: an error beats every other state. */
111
+ export type StepsStatus = "error" | "complete" | "current" | "upcoming"
112
+
113
+ type StepsConfig = {
114
+ size: Size
115
+ color: Color | undefined
116
+ linear: boolean
117
+ orientation: "horizontal" | "vertical"
118
+ translations: Required<StepsTranslations>
119
+ icons: Record<StepsIconSlot, ReactNode>
120
+ }
121
+
122
+ const StepsConfigContext = createContext<StepsConfig>({
123
+ size: "md",
124
+ color: undefined,
125
+ linear: false,
126
+ orientation: "horizontal",
127
+ translations: STEPS_DEFAULT_TRANSLATIONS,
128
+ icons: DEFAULT_ICONS,
129
+ })
130
+
131
+ type StepState = {
132
+ index: number
133
+ status: StepsStatus
134
+ /** `Item`'s `disabled`: never clickable, drawn dimmed. */
135
+ disabled: boolean
136
+ /** Ahead of the current step under `linear`: not clickable, drawn as usual. */
137
+ locked: boolean
138
+ last: boolean
139
+ }
140
+
141
+ const StepStateContext = createContext<StepState>({
142
+ index: 0,
143
+ status: "upcoming",
144
+ disabled: false,
145
+ locked: false,
146
+ last: false,
147
+ })
148
+
149
+ /** The indicator's diameter per size, as `--steps-indicator`: the indicator
150
+ * reads it for its own size, and a vertical connector to sit under its
151
+ * centre. One source, so the two can't drift. */
152
+ const INDICATOR_SIZE: Record<Size, string> = {
153
+ xs: "[--steps-indicator:1.5rem]",
154
+ sm: "[--steps-indicator:1.75rem]",
155
+ md: "[--steps-indicator:2rem]",
156
+ lg: "[--steps-indicator:2.5rem]",
157
+ xl: "[--steps-indicator:3rem]",
158
+ }
159
+
160
+ /** Space between an indicator and its text, and between a step and its
161
+ * connector. */
162
+ const GAP: Record<Size, string> = {
163
+ xs: "gap-x-2",
164
+ sm: "gap-x-2.5",
165
+ md: "gap-x-3",
166
+ lg: "gap-x-3.5",
167
+ xl: "gap-x-4",
168
+ }
169
+
170
+ /** The indicator's digit and the icon slot it hosts. The host sizes the icon
171
+ * and never strokes it (code-style "Icons"). */
172
+ const INDICATOR_TEXT: Record<Size, string> = {
173
+ xs: "text-xs [&_svg]:size-3.5",
174
+ sm: "text-xs [&_svg]:size-4",
175
+ md: "text-sm [&_svg]:size-4",
176
+ lg: "text-md [&_svg]:size-5",
177
+ xl: "text-lg [&_svg]:size-6",
178
+ }
179
+
180
+ const TITLE_TEXT: Record<Size, string> = {
181
+ xs: "text-xs",
182
+ sm: "text-sm",
183
+ md: "text-md",
184
+ lg: "text-lg",
185
+ xl: "text-xl",
186
+ }
187
+
188
+ const DESCRIPTION_TEXT: Record<Size, string> = {
189
+ xs: "text-xs",
190
+ sm: "text-xs",
191
+ md: "text-sm",
192
+ lg: "text-md",
193
+ xl: "text-lg",
194
+ }
195
+
196
+ /** Room left under a vertical step for its connector to run to the next one. */
197
+ const VERTICAL_RUN: Record<Size, string> = {
198
+ xs: "pb-5",
199
+ sm: "pb-6",
200
+ md: "pb-7",
201
+ lg: "pb-8",
202
+ xl: "pb-9",
203
+ }
204
+
205
+ /**
206
+ * The indicator, per state. A hairline ring while upcoming; the palette's
207
+ * soft wash and solid ring on the current step; a solid fill with the check
208
+ * once complete. An error is Figma's error border and text, with no red
209
+ * wash, like an invalid field.
210
+ */
211
+ const INDICATOR_STATUS: Record<StepsStatus, string> = {
212
+ upcoming: cn("border-brand-900/20 dark:border-white/15", TEXT_COLOR_CLASSES.secondary),
213
+ current: "border-(--c-solid) bg-(--c-soft) text-(--c-text)",
214
+ complete: "border-(--c-solid) bg-(--c-solid) text-(--c-on-solid)",
215
+ error: cn("border-red-500", TEXT_COLOR_CLASSES.error),
216
+ }
217
+
218
+ const TITLE_STATUS: Record<StepsStatus, string> = {
219
+ upcoming: TEXT_COLOR_CLASSES.secondary,
220
+ current: TEXT_COLOR_CLASSES.primary,
221
+ complete: TEXT_COLOR_CLASSES.primary,
222
+ error: TEXT_COLOR_CLASSES.error,
223
+ }
224
+
225
+ const statusOf = (state: { current: boolean; completed: boolean }, error: boolean): StepsStatus =>
226
+ match({ error, ...state })
227
+ .with({ error: true }, () => "error" as const)
228
+ .with({ completed: true }, () => "complete" as const)
229
+ .with({ current: true }, () => "current" as const)
230
+ .otherwise(() => "upcoming" as const)
231
+
232
+ /**
233
+ * Announces each step change to a screen reader. The content panel swaps
234
+ * under a Next button that keeps focus, so without this nothing tells the
235
+ * user the step moved. Silent on mount: it only speaks once `value` differs
236
+ * from the last one it saw (a ref, not a "first render" flag, so Strict
237
+ * Mode's double effect stays silent too).
238
+ */
239
+ const Announcer = () => {
240
+ const { value, count } = useStepsContext()
241
+ const { translations: t } = useContext(StepsConfigContext)
242
+ const seen = useRef(value)
243
+ const [message, setMessage] = useState("")
244
+ useEffect(() => {
245
+ if (seen.current === value) return
246
+ seen.current = value
247
+ setMessage(value >= count ? t.done : t.progress(value + 1, count))
248
+ }, [value, count, t])
249
+ return (
250
+ <span aria-live="polite" className="sr-only">
251
+ {message}
252
+ </span>
253
+ )
254
+ }
255
+
256
+ /** `color` is omitted from Ark's props because React's `HTMLAttributes`
257
+ * carries a legacy `color?: string`, and re-added as the kit's palette.
258
+ * `linear` is redefined: see the prop. */
259
+ export type StepsRootProps = NoAsChild<Omit<Ark.RootProps, "color" | "linear">> &
260
+ WithTestId & {
261
+ /** Indicator, title and connector size; also the Prev/Next buttons'. */
262
+ size?: Size
263
+ /** Palette for the current and completed indicators and the connectors'
264
+ * progress. Lands on `List` only, so it never tints the panels. */
265
+ color?: Color
266
+ /**
267
+ * Only completed steps (and the current one) can be clicked; the steps
268
+ * ahead wait for Next. Without it any step can be clicked. Unlike Ark's
269
+ * own `linear`, a completed step stays clickable, so the user can go back.
270
+ */
271
+ linear?: boolean
272
+ /** The built-in strings: the Prev/Next labels and what a screen reader
273
+ * hears. Merged per key over `STEPS_DEFAULT_TRANSLATIONS`. */
274
+ translations?: StepsTranslations
275
+ /** `complete` (the check) and `error` (the cross) in every indicator. */
276
+ icons?: IconMap<StepsIconSlot>
277
+ }
278
+
279
+ /** The root: the Ark machine, and the screen-reader announcer. Lays its
280
+ * children out in a column when horizontal and in a row when vertical (the
281
+ * list beside the panels). */
282
+ const Root = ({
283
+ size = "md",
284
+ color,
285
+ linear = false,
286
+ translations,
287
+ icons,
288
+ orientation = "horizontal",
289
+ className,
290
+ testId,
291
+ children,
292
+ asChild: _asChild,
293
+ ...rest
294
+ }: StepsRootProps) => {
295
+ const checkDirection = useDirectionCheck()
296
+ const config = useMemo(
297
+ () => ({
298
+ size,
299
+ color,
300
+ linear,
301
+ orientation,
302
+ translations: { ...STEPS_DEFAULT_TRANSLATIONS, ...translations },
303
+ icons: mergeIcons(DEFAULT_ICONS, icons),
304
+ }),
305
+ [size, color, linear, orientation, translations, icons],
306
+ )
307
+ return (
308
+ <StepsConfigContext.Provider value={config}>
309
+ <Ark.Root
310
+ orientation={orientation}
311
+ // The kit's `linear` decides which triggers are clickable (see
312
+ // `Trigger`); Ark's would lock the completed ones too.
313
+ linear={false}
314
+ ref={checkDirection}
315
+ className={cn(
316
+ "relative flex w-full gap-6",
317
+ "data-[orientation=horizontal]:flex-col",
318
+ "data-[orientation=vertical]:items-start",
319
+ className,
320
+ )}
321
+ {...props({ "data-testid": testId })}
322
+ {...rest}
323
+ >
324
+ {children}
325
+ <Announcer />
326
+ </Ark.Root>
327
+ </StepsConfigContext.Provider>
328
+ )
329
+ }
330
+
331
+ export type StepsListProps = Ark.ListProps & WithTestId
332
+
333
+ /**
334
+ * The steps. Horizontal, it is a container: when it is narrower than 30rem,
335
+ * only the current step keeps its title and description on screen (the
336
+ * others keep them for screen readers), so the indicators and connectors fit
337
+ * a phone. Vertical lists never collapse.
338
+ */
339
+ const List = ({ className, testId, ...rest }: StepsListProps) => {
340
+ const { size, color, orientation } = useContext(StepsConfigContext)
341
+ return (
342
+ <Ark.List
343
+ data-color={color}
344
+ className={cn(
345
+ "flex",
346
+ INDICATOR_SIZE[size],
347
+ orientation === "horizontal" ? cn("@container/steps w-full", GAP[size]) : "flex-col",
348
+ className,
349
+ )}
350
+ {...props({ "data-testid": testId })}
351
+ {...rest}
352
+ />
353
+ )
354
+ }
355
+
356
+ export type StepsItemProps = Ark.ItemProps &
357
+ WithTestId & {
358
+ /** Draws this step in the error state: the cross, in red. Ark has no
359
+ * error state of its own, so the app decides when a step has one. */
360
+ error?: boolean
361
+ /** This step can't be clicked, whatever `linear` says. */
362
+ disabled?: boolean
363
+ }
364
+
365
+ /** One step: its trigger, then its connector to the next. Horizontal steps
366
+ * share the row's width, except the last, which hugs its content. */
367
+ const Item = ({
368
+ index,
369
+ error = false,
370
+ disabled = false,
371
+ className,
372
+ testId,
373
+ ...rest
374
+ }: StepsItemProps) => {
375
+ const steps = useStepsContext()
376
+ const { size, linear, orientation } = useContext(StepsConfigContext)
377
+ const itemState = steps.getItemState({ index })
378
+ const status = statusOf(itemState, error)
379
+ const state = useMemo(
380
+ () => ({
381
+ index,
382
+ status,
383
+ disabled,
384
+ locked: linear && itemState.incomplete,
385
+ last: itemState.last,
386
+ }),
387
+ [index, status, disabled, linear, itemState.incomplete, itemState.last],
388
+ )
389
+ return (
390
+ <StepStateContext.Provider value={state}>
391
+ <Ark.Item
392
+ index={index}
393
+ className={cn(
394
+ "relative flex",
395
+ orientation === "horizontal"
396
+ ? cn("items-center", GAP[size], !itemState.last && "flex-1")
397
+ : cn("min-w-0 flex-col", !itemState.last && VERTICAL_RUN[size]),
398
+ className,
399
+ )}
400
+ {...props({
401
+ "data-status": status,
402
+ "data-error": error,
403
+ "data-disabled": disabled,
404
+ "data-last": itemState.last,
405
+ "data-testid": testId,
406
+ })}
407
+ {...rest}
408
+ />
409
+ </StepStateContext.Provider>
410
+ )
411
+ }
412
+
413
+ export type StepsTriggerProps = Ark.TriggerProps & WithTestId
414
+
415
+ /**
416
+ * The step's button: indicator, title and description, laid out as a grid so
417
+ * the indicator spans both text lines. A visually hidden word ("Completed",
418
+ * "Has errors") joins its accessible name, since the check and the cross are
419
+ * decorative.
420
+ *
421
+ * A step that can't be clicked (`Item`'s `disabled`, or ahead of the current
422
+ * step under `linear`) is a native disabled button: out of the tab order, and
423
+ * no click reaches Ark. Only `disabled` dims it; a locked step looks like any
424
+ * upcoming one.
425
+ */
426
+ const Trigger = ({
427
+ className,
428
+ testId,
429
+ asChild,
430
+ children,
431
+ disabled,
432
+ ...rest
433
+ }: StepsTriggerProps) => {
434
+ const { size, orientation, translations: t } = useContext(StepsConfigContext)
435
+ const { status, locked, disabled: itemDisabled } = useContext(StepStateContext)
436
+ const stateLabel = match(status)
437
+ .with("complete", () => t.complete)
438
+ .with("error", () => t.error)
439
+ .otherwise(() => null)
440
+ const inert = disabled || itemDisabled || locked
441
+ return (
442
+ <Ark.Trigger
443
+ asChild={asChild}
444
+ disabled={inert}
445
+ className={cn(
446
+ // `1fr` keeps the text column's min-content floor, so a horizontal
447
+ // step wraps its title rather than shrinking it under its neighbour.
448
+ //
449
+ // `1fr_auto` rows: without a description the empty second row takes
450
+ // no room, so the title centres on the indicator; with one, the title
451
+ // sits over it and the pair centres on the indicator together.
452
+ "group/step relative grid grid-cols-[auto_1fr] grid-rows-[1fr_auto] items-center gap-y-0.5 rounded-xs text-start",
453
+ orientation === "vertical" && "min-w-0",
454
+ GAP[size],
455
+ focusStyles(),
456
+ "enabled:cursor-pointer",
457
+ itemDisabled && "opacity-50",
458
+ className,
459
+ )}
460
+ {...props({ "data-locked": locked, "data-testid": testId })}
461
+ {...rest}
462
+ >
463
+ {composeChildren(asChild, children, (own) => (
464
+ <>
465
+ {own}
466
+ {stateLabel && <span className="sr-only">, {stateLabel}</span>}
467
+ </>
468
+ ))}
469
+ </Ark.Trigger>
470
+ )
471
+ }
472
+
473
+ export type StepsIndicatorProps = NoAsChild<Ark.IndicatorProps> &
474
+ WithTestId & {
475
+ /** A custom icon, shown while the step is upcoming or current. The check
476
+ * and the cross still replace it once the step is complete or errored. */
477
+ children?: ReactNode
478
+ }
479
+
480
+ /** The round marker: the step's number in the locale's digits, your icon, a
481
+ * check once complete, or a cross on error. Decorative (`aria-hidden`):
482
+ * the trigger's text names the step. */
483
+ const Indicator = ({
484
+ className,
485
+ testId,
486
+ children,
487
+ asChild: _asChild,
488
+ ...rest
489
+ }: StepsIndicatorProps) => {
490
+ const { size, orientation, icons } = useContext(StepsConfigContext)
491
+ const { index, status } = useContext(StepStateContext)
492
+ const locale = useLocale()
493
+ const content = match(status)
494
+ .with("complete", () => icons.complete)
495
+ .with("error", () => icons.error)
496
+ .otherwise(() => children ?? new Intl.NumberFormat(locale).format(index + 1))
497
+ return (
498
+ <Ark.Indicator
499
+ className={cn(
500
+ // Vertical, it stays on the title's line, so the connector starts
501
+ // right under it whatever the description's length.
502
+ orientation === "vertical" && "self-start",
503
+ "row-span-2 flex size-(--steps-indicator) shrink-0 items-center justify-center rounded-full border font-medium tabular-nums",
504
+ "transition-colors duration-(--duration-normal) motion-reduce:transition-none",
505
+ INDICATOR_TEXT[size],
506
+ INDICATOR_STATUS[status],
507
+ className,
508
+ )}
509
+ {...props({ "data-status": status, "data-testid": testId })}
510
+ {...rest}
511
+ >
512
+ {content}
513
+ </Ark.Indicator>
514
+ )
515
+ }
516
+
517
+ /**
518
+ * Hides a horizontal step's text in a narrow list, except the current
519
+ * step's. `sr-only`, not `hidden`: the text is still the trigger's name.
520
+ */
521
+ const COMPACT_HIDDEN = "@max-[30rem]/steps:sr-only"
522
+
523
+ const textClass = (orientation: "horizontal" | "vertical", status: StepsStatus) =>
524
+ cn("col-start-2", orientation === "horizontal" && status !== "current" && COMPACT_HIDDEN)
525
+
526
+ export type StepsTitleProps = HTMLArkProps<"span"> & WithTestId
527
+ export type StepsDescriptionProps = HTMLArkProps<"span"> & WithTestId
528
+
529
+ /** The step's title, beside the indicator. Vertical, it is centred on the
530
+ * indicator's first line so a description runs on below it. */
531
+ const Title = ({ className, testId, ...rest }: StepsTitleProps) => {
532
+ const { size, orientation } = useContext(StepsConfigContext)
533
+ const { status } = useContext(StepStateContext)
534
+ return (
535
+ <ark.span
536
+ className={cn(
537
+ "font-medium transition-colors duration-(--duration-normal) motion-reduce:transition-none",
538
+ textClass(orientation, status),
539
+ orientation === "vertical" && "flex min-h-(--steps-indicator) items-center",
540
+ TITLE_TEXT[size],
541
+ TITLE_STATUS[status],
542
+ status !== "current" &&
543
+ "group-enabled/step:group-hover/step:text-brand-950 dark:group-enabled/step:group-hover/step:text-white",
544
+ className,
545
+ )}
546
+ {...props({ "data-testid": testId })}
547
+ {...rest}
548
+ />
549
+ )
550
+ }
551
+
552
+ /** The step's supporting line, under its title. */
553
+ const Description = ({ className, testId, ...rest }: StepsDescriptionProps) => {
554
+ const { size, orientation } = useContext(StepsConfigContext)
555
+ const { status } = useContext(StepStateContext)
556
+ return (
557
+ <ark.span
558
+ className={cn(
559
+ textClass(orientation, status),
560
+ DESCRIPTION_TEXT[size],
561
+ TEXT_COLOR_CLASSES.muted,
562
+ className,
563
+ )}
564
+ {...props({ "data-testid": testId })}
565
+ {...rest}
566
+ />
567
+ )
568
+ }
569
+
570
+ export type StepsSeparatorProps = Ark.SeparatorProps & WithTestId
571
+
572
+ /**
573
+ * The connector to the next step: a hairline track, and the palette's solid
574
+ * filling it once this step is complete. The fill grows from the inline
575
+ * start (the right edge under RTL) or from the top, so it reads as progress
576
+ * moving forward. Renders nothing on the last step.
577
+ *
578
+ * Vertical, it is absolutely placed under the indicator's centre, from just
579
+ * below the indicator to the bottom of the step (its `VERTICAL_RUN`), so it
580
+ * runs past a description of any length.
581
+ */
582
+ const Separator = ({ className, testId, ...rest }: StepsSeparatorProps) => {
583
+ const { orientation } = useContext(StepsConfigContext)
584
+ const { last } = useContext(StepStateContext)
585
+ if (last) return null
586
+ return (
587
+ <Ark.Separator
588
+ className={cn(
589
+ "overflow-hidden rounded-full bg-brand-900/20 dark:bg-white/15",
590
+ "after:block after:size-full after:bg-(--c-solid)",
591
+ "after:transition-transform after:duration-(--duration-normal) after:ease-(--ease-emphasized) motion-reduce:after:transition-none",
592
+ orientation === "horizontal"
593
+ ? cn(
594
+ "h-0.5 min-w-4 flex-1",
595
+ "after:origin-left rtl:after:origin-right after:scale-x-0 data-complete:after:scale-x-100",
596
+ )
597
+ : cn(
598
+ "absolute start-[calc(var(--steps-indicator)/2_-_1px)] top-[calc(var(--steps-indicator)+0.25rem)] bottom-1 w-0.5",
599
+ "after:origin-top after:scale-y-0 data-complete:after:scale-y-100",
600
+ ),
601
+ className,
602
+ )}
603
+ {...props({ "data-testid": testId })}
604
+ {...rest}
605
+ />
606
+ )
607
+ }
608
+
609
+ export type StepsContentProps = Ark.ContentProps & WithTestId
610
+
611
+ /** A step's panel, shown while it is the current step. Ark makes it
612
+ * focusable, so it gets the kit's focus ring. */
613
+ const Content = ({ className, testId, ...rest }: StepsContentProps) => (
614
+ <Ark.Content
615
+ className={cn("min-w-0 rounded-xs", focusStyles(), className)}
616
+ {...props({ "data-testid": testId })}
617
+ {...rest}
618
+ />
619
+ )
620
+
621
+ export type StepsCompletedContentProps = Ark.CompletedContentProps & WithTestId
622
+
623
+ /** The panel shown once every step is complete (`step === count`). */
624
+ const CompletedContent = ({ className, testId, ...rest }: StepsCompletedContentProps) => (
625
+ <Ark.CompletedContent
626
+ className={cn("min-w-0 rounded-xs", focusStyles(), className)}
627
+ {...props({ "data-testid": testId })}
628
+ {...rest}
629
+ />
630
+ )
631
+
632
+ export type StepsPrevTriggerProps = ButtonProps
633
+
634
+ /** Goes back one step: a kit `Button` (`outline` by default), disabled on the
635
+ * first step. Its label defaults to `translations.prev`. */
636
+ const PrevTrigger = ({
637
+ asChild,
638
+ children,
639
+ variant = "outline",
640
+ size,
641
+ ...rest
642
+ }: StepsPrevTriggerProps) => {
643
+ const { size: stepsSize, translations: t } = useContext(StepsConfigContext)
644
+ return (
645
+ <Ark.PrevTrigger asChild>
646
+ <Button asChild={asChild} variant={variant} size={size ?? stepsSize} {...rest}>
647
+ {asChild ? children : (children ?? t.prev)}
648
+ </Button>
649
+ </Ark.PrevTrigger>
650
+ )
651
+ }
652
+
653
+ export type StepsNextTriggerProps = ButtonProps
654
+
655
+ /** Goes forward one step: a kit `Button`, disabled once every step is
656
+ * complete. Its label defaults to `translations.next`, and to
657
+ * `translations.finish` on the last step, which completes the flow. Ark's
658
+ * `isStepValid` can refuse the move; Steps never validates by itself. */
659
+ const NextTrigger = ({ asChild, children, size, ...rest }: StepsNextTriggerProps) => {
660
+ const steps = useStepsContext()
661
+ const { size: stepsSize, translations: t } = useContext(StepsConfigContext)
662
+ const label = steps.value >= steps.count - 1 ? t.finish : t.next
663
+ return (
664
+ <Ark.NextTrigger asChild>
665
+ <Button asChild={asChild} size={size ?? stepsSize} {...rest}>
666
+ {asChild ? children : (children ?? label)}
667
+ </Button>
668
+ </Ark.NextTrigger>
669
+ )
670
+ }
671
+
672
+ export {
673
+ CompletedContent,
674
+ Content,
675
+ Description,
676
+ Indicator,
677
+ Item,
678
+ List,
679
+ NextTrigger,
680
+ PrevTrigger,
681
+ Root,
682
+ Separator,
683
+ Title,
684
+ Trigger,
685
+ }
686
+ export const Context = Ark.Context