@chassis-ui/react 0.1.3 → 0.3.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 (721) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +56 -23
  3. package/dist/accordion.d.ts +2 -0
  4. package/dist/accordion.js +1 -0
  5. package/dist/alert.d.ts +2 -0
  6. package/dist/alert.js +1 -0
  7. package/dist/autocomplete.d.ts +2 -0
  8. package/dist/autocomplete.js +1 -0
  9. package/dist/avatar.d.ts +2 -0
  10. package/dist/avatar.js +1 -0
  11. package/dist/badge.d.ts +2 -0
  12. package/dist/badge.js +1 -0
  13. package/dist/breadcrumb.d.ts +2 -0
  14. package/dist/breadcrumb.js +1 -0
  15. package/dist/button-group.d.ts +2 -0
  16. package/dist/button-group.js +1 -0
  17. package/dist/button.d.ts +3 -0
  18. package/dist/button.js +1 -0
  19. package/dist/calendar.d.ts +3 -0
  20. package/dist/calendar.js +1 -0
  21. package/dist/card.d.ts +2 -0
  22. package/dist/card.js +1 -0
  23. package/dist/carousel.d.ts +2 -0
  24. package/dist/carousel.js +1 -0
  25. package/dist/checkbox.d.ts +3 -0
  26. package/dist/checkbox.js +1 -0
  27. package/dist/chip-input.d.ts +2 -0
  28. package/dist/chip-input.js +1 -0
  29. package/dist/chip.d.ts +2 -0
  30. package/dist/chip.js +1 -0
  31. package/dist/chunks/Button-BoymWE-L.js +2 -0
  32. package/dist/chunks/Button-BoymWE-L.js.map +1 -0
  33. package/dist/chunks/Button-Cptd4Yk7.d.ts +66 -0
  34. package/dist/chunks/Chip-DCaWaBqo.js +2 -0
  35. package/dist/chunks/Chip-DCaWaBqo.js.map +1 -0
  36. package/dist/chunks/CloseButton-DPgQztE0.js +2 -0
  37. package/dist/chunks/CloseButton-DPgQztE0.js.map +1 -0
  38. package/dist/chunks/ComboboxItem-C9TpoJOI.d.ts +55 -0
  39. package/dist/chunks/ComboboxListBox-Cm3L1ULl.js +2 -0
  40. package/dist/chunks/ComboboxListBox-Cm3L1ULl.js.map +1 -0
  41. package/dist/chunks/DateSegment-2agXAd0f.js +2 -0
  42. package/dist/chunks/DateSegment-2agXAd0f.js.map +1 -0
  43. package/dist/chunks/FormHelp-AE6_iSLJ.js +2 -0
  44. package/dist/chunks/FormHelp-AE6_iSLJ.js.map +1 -0
  45. package/dist/chunks/FormLabel-CYcQiFUI.js +2 -0
  46. package/dist/chunks/FormLabel-CYcQiFUI.js.map +1 -0
  47. package/dist/chunks/Icon-CioraWLF.d.ts +37 -0
  48. package/dist/chunks/Icon-DLB1f88W.js +2 -0
  49. package/dist/chunks/Icon-DLB1f88W.js.map +1 -0
  50. package/dist/chunks/Link-CZsWCnQb.js +2 -0
  51. package/dist/chunks/Link-CZsWCnQb.js.map +1 -0
  52. package/dist/chunks/Link-nrd0JWlO.d.ts +71 -0
  53. package/dist/chunks/Menu-CSBg2Zmc.js +2 -0
  54. package/dist/chunks/Menu-CSBg2Zmc.js.map +1 -0
  55. package/dist/chunks/Menu-QeYOzrUL.d.ts +95 -0
  56. package/{src/components/menu/MenuItemDef.ts → dist/chunks/MenuItemDef-D0VDtYIQ.d.ts} +25 -25
  57. package/dist/chunks/MenuToggle-BdQtF7FV.js +2 -0
  58. package/dist/chunks/MenuToggle-BdQtF7FV.js.map +1 -0
  59. package/dist/chunks/Portal-CgeR1WXV.js +2 -0
  60. package/dist/chunks/Portal-CgeR1WXV.js.map +1 -0
  61. package/dist/chunks/RangeCalendar-BJl-j4W2.js +2 -0
  62. package/dist/chunks/RangeCalendar-BJl-j4W2.js.map +1 -0
  63. package/dist/chunks/VisuallyHidden-C2dM7HhC.js +2 -0
  64. package/dist/chunks/VisuallyHidden-C2dM7HhC.js.map +1 -0
  65. package/dist/chunks/accordion-B8UWyvQB.js +2 -0
  66. package/dist/chunks/accordion-B8UWyvQB.js.map +1 -0
  67. package/dist/chunks/alert-BXI-_qlt.js +2 -0
  68. package/dist/chunks/alert-BXI-_qlt.js.map +1 -0
  69. package/dist/chunks/autocomplete-Baf9VSHN.js +2 -0
  70. package/dist/chunks/autocomplete-Baf9VSHN.js.map +1 -0
  71. package/dist/chunks/avatar-S3dGy6Qc.js +2 -0
  72. package/dist/chunks/avatar-S3dGy6Qc.js.map +1 -0
  73. package/dist/chunks/badge-D2oztCvs.js +2 -0
  74. package/dist/chunks/badge-D2oztCvs.js.map +1 -0
  75. package/dist/chunks/breadcrumb-s6J9itez.js +2 -0
  76. package/dist/chunks/breadcrumb-s6J9itez.js.map +1 -0
  77. package/dist/chunks/breakpoints-CJ-498B7.d.ts +7 -0
  78. package/dist/chunks/breakpoints-o_2Ev7ir.js +2 -0
  79. package/dist/chunks/breakpoints-o_2Ev7ir.js.map +1 -0
  80. package/dist/chunks/button-group-BGppPrIv.js +2 -0
  81. package/dist/chunks/button-group-BGppPrIv.js.map +1 -0
  82. package/dist/chunks/card-YXn3bj_d.js +2 -0
  83. package/dist/chunks/card-YXn3bj_d.js.map +1 -0
  84. package/dist/chunks/carousel-fTVPqnSV.js +2 -0
  85. package/dist/chunks/carousel-fTVPqnSV.js.map +1 -0
  86. package/dist/chunks/checkbox-ChACalAw.js +2 -0
  87. package/dist/chunks/checkbox-ChACalAw.js.map +1 -0
  88. package/dist/chunks/chip-input-BpVDRERg.js +2 -0
  89. package/dist/chunks/chip-input-BpVDRERg.js.map +1 -0
  90. package/dist/chunks/collapse--Go2Y73B.js +2 -0
  91. package/dist/chunks/collapse--Go2Y73B.js.map +1 -0
  92. package/dist/chunks/color-input-Bwl5ef5B.js +2 -0
  93. package/dist/chunks/color-input-Bwl5ef5B.js.map +1 -0
  94. package/dist/chunks/combobox-Bp1tIaiW.js +2 -0
  95. package/dist/chunks/combobox-Bp1tIaiW.js.map +1 -0
  96. package/dist/chunks/context-menu-B4a0tS-h.js +2 -0
  97. package/dist/chunks/context-menu-B4a0tS-h.js.map +1 -0
  98. package/dist/chunks/datagrid-CH3Cy-q7.js +3 -0
  99. package/dist/chunks/datagrid-CH3Cy-q7.js.map +1 -0
  100. package/dist/chunks/dateRangePresets-R1FtA1zp.d.ts +42 -0
  101. package/dist/chunks/datepicker-bOiM_zhJ.js +2 -0
  102. package/dist/chunks/datepicker-bOiM_zhJ.js.map +1 -0
  103. package/dist/chunks/dialogTransition-i9vw0i2Z.js +2 -0
  104. package/dist/chunks/dialogTransition-i9vw0i2Z.js.map +1 -0
  105. package/dist/chunks/direction-LN6uwsK5.js +2 -0
  106. package/dist/chunks/direction-LN6uwsK5.js.map +1 -0
  107. package/dist/chunks/divider-CjbF4OfA.js +2 -0
  108. package/dist/chunks/divider-CjbF4OfA.js.map +1 -0
  109. package/dist/chunks/drawer-C7Tz4XU_.js +2 -0
  110. package/dist/chunks/drawer-C7Tz4XU_.js.map +1 -0
  111. package/dist/chunks/file-input-CDM6qrmV.js +2 -0
  112. package/dist/chunks/file-input-CDM6qrmV.js.map +1 -0
  113. package/dist/chunks/flex-CmlJbKVj.js +2 -0
  114. package/dist/chunks/flex-CmlJbKVj.js.map +1 -0
  115. package/dist/chunks/floating-input-DmSZZc27.js +2 -0
  116. package/dist/chunks/floating-input-DmSZZc27.js.map +1 -0
  117. package/dist/chunks/focus-ring-SR_LwaN7.js +2 -0
  118. package/dist/chunks/focus-ring-SR_LwaN7.js.map +1 -0
  119. package/dist/chunks/focusRedirect-BrvK3U_o.js +2 -0
  120. package/dist/chunks/focusRedirect-BrvK3U_o.js.map +1 -0
  121. package/dist/chunks/form-GpdAyWWi.js +2 -0
  122. package/dist/chunks/form-GpdAyWWi.js.map +1 -0
  123. package/dist/chunks/form-field-CNPGTMiW.js +2 -0
  124. package/dist/chunks/form-field-CNPGTMiW.js.map +1 -0
  125. package/dist/chunks/grid-DK_vxz-4.js +2 -0
  126. package/dist/chunks/grid-DK_vxz-4.js.map +1 -0
  127. package/dist/chunks/icon-BQsT6YtE.js +2 -0
  128. package/dist/chunks/icon-BQsT6YtE.js.map +1 -0
  129. package/dist/chunks/iconConfig-C6gbYhsD.d.ts +71 -0
  130. package/dist/chunks/iconSlot-BNu2MrFI.js +2 -0
  131. package/dist/chunks/iconSlot-BNu2MrFI.js.map +1 -0
  132. package/dist/chunks/index-4cKG9KWB.d.ts +85 -0
  133. package/dist/chunks/index-6uob77s9.d.ts +81 -0
  134. package/dist/chunks/index-91YA-jkp.d.ts +127 -0
  135. package/dist/chunks/index-9rQeMqVI.d.ts +42 -0
  136. package/dist/chunks/index-B0-8n-Gs.d.ts +106 -0
  137. package/dist/chunks/index-B2K-O9kl.d.ts +59 -0
  138. package/dist/chunks/index-B8uaSJA9.d.ts +96 -0
  139. package/dist/chunks/index-BA-raEMm.d.ts +29 -0
  140. package/dist/chunks/index-BAsbRx5n.d.ts +54 -0
  141. package/dist/chunks/index-BF3OWUVc.d.ts +66 -0
  142. package/dist/chunks/index-BNf0jIIL.d.ts +213 -0
  143. package/dist/chunks/index-BO9jLOIb.d.ts +59 -0
  144. package/dist/chunks/index-BTTeKpiE.d.ts +364 -0
  145. package/dist/chunks/index-BVGGIaPX.d.ts +111 -0
  146. package/dist/chunks/index-B_UzbGOa.d.ts +195 -0
  147. package/dist/chunks/index-Bi8FFadV.d.ts +99 -0
  148. package/dist/chunks/index-Bkj17NEQ.d.ts +51 -0
  149. package/dist/chunks/index-Bm2NpgND.d.ts +82 -0
  150. package/dist/chunks/index-BnR7wjax.d.ts +68 -0
  151. package/dist/chunks/index-BxROljJI.d.ts +18 -0
  152. package/dist/chunks/index-Bz8MDq0H.d.ts +85 -0
  153. package/dist/chunks/index-C4Dks__B.d.ts +139 -0
  154. package/dist/chunks/index-CCXJXToc.d.ts +53 -0
  155. package/dist/chunks/index-CFnQubsV.d.ts +123 -0
  156. package/dist/chunks/index-CJXKl97l.d.ts +120 -0
  157. package/dist/chunks/index-CJzKu7QI.d.ts +41 -0
  158. package/dist/chunks/index-CKx1KHED.d.ts +303 -0
  159. package/dist/chunks/index-COsIPd8L.d.ts +63 -0
  160. package/dist/chunks/index-CRfm7W6C.d.ts +231 -0
  161. package/dist/chunks/index-CTpwB1yR.d.ts +236 -0
  162. package/dist/chunks/index-CVUMS0x7.d.ts +74 -0
  163. package/dist/chunks/index-CYgBmZ8w.d.ts +271 -0
  164. package/dist/chunks/index-Cc4SSslb.d.ts +205 -0
  165. package/dist/chunks/index-CftERHnE.d.ts +25 -0
  166. package/dist/chunks/index-Ci7AEgEc.d.ts +47 -0
  167. package/dist/chunks/index-CqZ68Z8R.d.ts +415 -0
  168. package/dist/chunks/index-CsARGAzD.d.ts +50 -0
  169. package/dist/chunks/index-CsMIgBsd.d.ts +40 -0
  170. package/dist/chunks/index-D9PZHY_I.d.ts +136 -0
  171. package/dist/chunks/index-DAoPg59I.d.ts +81 -0
  172. package/dist/chunks/index-DHGgezXU.d.ts +59 -0
  173. package/dist/chunks/index-DHOG_rjE.d.ts +121 -0
  174. package/dist/chunks/index-DJfga0Ce.d.ts +57 -0
  175. package/dist/chunks/index-DJr_ZK4b.d.ts +110 -0
  176. package/dist/chunks/index-DMbdEm__.d.ts +119 -0
  177. package/dist/chunks/index-DXjbI7Yv.d.ts +133 -0
  178. package/dist/chunks/index-DaHQdNul.d.ts +182 -0
  179. package/dist/chunks/index-Dcc_W6Kv.d.ts +147 -0
  180. package/dist/chunks/index-DceCODH9.d.ts +138 -0
  181. package/dist/chunks/index-Ddd7iWfm.d.ts +32 -0
  182. package/dist/chunks/index-Dfg4Ftb8.d.ts +69 -0
  183. package/dist/chunks/index-Dfy1YW5j.d.ts +74 -0
  184. package/dist/chunks/index-DgHvXzVh.d.ts +208 -0
  185. package/dist/chunks/index-Dh5CaHTP.d.ts +45 -0
  186. package/dist/chunks/index-DjXRq-n3.d.ts +98 -0
  187. package/dist/chunks/index-DjrEvKd-.d.ts +193 -0
  188. package/dist/chunks/index-DtbUXxjz.d.ts +54 -0
  189. package/dist/chunks/index-Du9fBqkT.d.ts +56 -0
  190. package/dist/chunks/index-FKh7iFQE.d.ts +95 -0
  191. package/dist/chunks/index-HrKN6s8z.d.ts +67 -0
  192. package/dist/chunks/index-I-H3VJ-L.d.ts +229 -0
  193. package/dist/chunks/index-RHJhkSY-.d.ts +273 -0
  194. package/dist/chunks/index-e7SJkI_m.d.ts +102 -0
  195. package/dist/chunks/index-g74gO0pc.d.ts +36 -0
  196. package/dist/chunks/index-qMq_-GY2.d.ts +105 -0
  197. package/dist/chunks/index-t_x6jj7l.d.ts +97 -0
  198. package/dist/chunks/input-adorn-DwdX-jxA.js +2 -0
  199. package/dist/chunks/input-adorn-DwdX-jxA.js.map +1 -0
  200. package/dist/chunks/input-group-Cuiuf4Dl.js +2 -0
  201. package/dist/chunks/input-group-Cuiuf4Dl.js.map +1 -0
  202. package/dist/chunks/lazyElement-tfMG21pZ.js +2 -0
  203. package/dist/chunks/lazyElement-tfMG21pZ.js.map +1 -0
  204. package/dist/chunks/list-BQCkwWjF.js +2 -0
  205. package/dist/chunks/list-BQCkwWjF.js.map +1 -0
  206. package/dist/chunks/menu-98EAD9nj.js +2 -0
  207. package/dist/chunks/menu-98EAD9nj.js.map +1 -0
  208. package/dist/chunks/modal-bgDR29Jh.js +2 -0
  209. package/dist/chunks/modal-bgDR29Jh.js.map +1 -0
  210. package/dist/chunks/nav-TiZuTHC6.js +2 -0
  211. package/dist/chunks/nav-TiZuTHC6.js.map +1 -0
  212. package/dist/chunks/nav-overflow-Ay5mM5Gc.js +2 -0
  213. package/dist/chunks/nav-overflow-Ay5mM5Gc.js.map +1 -0
  214. package/dist/chunks/navOverflow-B5krZe6D.js +2 -0
  215. package/dist/chunks/navOverflow-B5krZe6D.js.map +1 -0
  216. package/dist/chunks/navVariant-CnD21GBS.d.ts +5 -0
  217. package/dist/chunks/navVariant-DeGTk9B7.js +2 -0
  218. package/dist/chunks/navVariant-DeGTk9B7.js.map +1 -0
  219. package/dist/chunks/navbar-DxIwt0sc.js +2 -0
  220. package/dist/chunks/navbar-DxIwt0sc.js.map +1 -0
  221. package/dist/chunks/notification-Ds24wnPq.js +2 -0
  222. package/dist/chunks/notification-Ds24wnPq.js.map +1 -0
  223. package/dist/chunks/number-field-IBIX2IWH.js +2 -0
  224. package/dist/chunks/number-field-IBIX2IWH.js.map +1 -0
  225. package/dist/chunks/otp-input-ws393uPB.js +2 -0
  226. package/dist/chunks/otp-input-ws393uPB.js.map +1 -0
  227. package/dist/chunks/overlayPlacement-BtS90IVf.js +2 -0
  228. package/dist/chunks/overlayPlacement-BtS90IVf.js.map +1 -0
  229. package/dist/chunks/overlayPlacement-CIsLpycT.d.ts +7 -0
  230. package/dist/chunks/pagination-BkOquk-x.js +2 -0
  231. package/dist/chunks/pagination-BkOquk-x.js.map +1 -0
  232. package/dist/chunks/password-strength-DDK8pHRq.js +2 -0
  233. package/dist/chunks/password-strength-DDK8pHRq.js.map +1 -0
  234. package/dist/chunks/placeholder-BCr83sUn.js +2 -0
  235. package/dist/chunks/placeholder-BCr83sUn.js.map +1 -0
  236. package/dist/chunks/polymorphic-BhGNZQja.js +2 -0
  237. package/dist/chunks/polymorphic-BhGNZQja.js.map +1 -0
  238. package/dist/chunks/polymorphic-CVHbTHSN.d.ts +41 -0
  239. package/dist/chunks/popover-Bdg8D4sm.js +2 -0
  240. package/dist/chunks/popover-Bdg8D4sm.js.map +1 -0
  241. package/dist/chunks/progress-zWkTltor.js +2 -0
  242. package/dist/chunks/progress-zWkTltor.js.map +1 -0
  243. package/dist/chunks/radio-DOFYCfJi.js +2 -0
  244. package/dist/chunks/radio-DOFYCfJi.js.map +1 -0
  245. package/dist/chunks/range-input-CT_8TKL7.js +2 -0
  246. package/dist/chunks/range-input-CT_8TKL7.js.map +1 -0
  247. package/dist/chunks/renderFormCheck-DN_-V62U.js +2 -0
  248. package/dist/chunks/renderFormCheck-DN_-V62U.js.map +1 -0
  249. package/dist/chunks/renderFormCheck-DZh_5Df8.d.ts +24 -0
  250. package/dist/chunks/renderFormField-Brkw1yA6.js +2 -0
  251. package/dist/chunks/renderFormField-Brkw1yA6.js.map +1 -0
  252. package/dist/chunks/renderFormField-ChNagAFN.d.ts +15 -0
  253. package/dist/chunks/renderMenuItemContent-DUezZrpj.js +2 -0
  254. package/dist/chunks/renderMenuItemContent-DUezZrpj.js.map +1 -0
  255. package/dist/chunks/scrollspy-C2HmrnZ4.js +2 -0
  256. package/dist/chunks/scrollspy-C2HmrnZ4.js.map +1 -0
  257. package/dist/chunks/scrollspy-D_lPjb92.js +2 -0
  258. package/dist/chunks/scrollspy-D_lPjb92.js.map +1 -0
  259. package/dist/chunks/search-field--nDoCI_E.js +2 -0
  260. package/dist/chunks/search-field--nDoCI_E.js.map +1 -0
  261. package/dist/chunks/select-BwJIfv9f.js +2 -0
  262. package/dist/chunks/select-BwJIfv9f.js.map +1 -0
  263. package/dist/chunks/skeleton-BrD2JwNx.js +2 -0
  264. package/dist/chunks/skeleton-BrD2JwNx.js.map +1 -0
  265. package/dist/chunks/slot-CNhFZdHF.js +2 -0
  266. package/dist/chunks/slot-CNhFZdHF.js.map +1 -0
  267. package/dist/chunks/spacingClassName-DVhk8m3P.js +2 -0
  268. package/dist/chunks/spacingClassName-DVhk8m3P.js.map +1 -0
  269. package/dist/chunks/spinner-DblhvrHL.js +2 -0
  270. package/dist/chunks/spinner-DblhvrHL.js.map +1 -0
  271. package/dist/chunks/stack-CsMiQbpq.js +2 -0
  272. package/dist/chunks/stack-CsMiQbpq.js.map +1 -0
  273. package/dist/chunks/static-table-D0M4oc_t.js +2 -0
  274. package/dist/chunks/static-table-D0M4oc_t.js.map +1 -0
  275. package/dist/chunks/stepper-CVXMJ2yg.js +2 -0
  276. package/dist/chunks/stepper-CVXMJ2yg.js.map +1 -0
  277. package/dist/chunks/switch-C6s3LxEv.js +2 -0
  278. package/dist/chunks/switch-C6s3LxEv.js.map +1 -0
  279. package/dist/chunks/table-Cy6uEuEP.js +2 -0
  280. package/dist/chunks/table-Cy6uEuEP.js.map +1 -0
  281. package/dist/chunks/tableClassName-CZA2Bse8.js +2 -0
  282. package/dist/chunks/tableClassName-CZA2Bse8.js.map +1 -0
  283. package/dist/chunks/tabs-91T7-8qq.js +2 -0
  284. package/dist/chunks/tabs-91T7-8qq.js.map +1 -0
  285. package/dist/chunks/text-input-B4pTv6SU.js +2 -0
  286. package/dist/chunks/text-input-B4pTv6SU.js.map +1 -0
  287. package/dist/chunks/textarea-1A1nABQE.js +2 -0
  288. package/dist/chunks/textarea-1A1nABQE.js.map +1 -0
  289. package/dist/chunks/time-field-B3MA7ED_.js +2 -0
  290. package/dist/chunks/time-field-B3MA7ED_.js.map +1 -0
  291. package/dist/chunks/toast-CGHl3-oU.js +2 -0
  292. package/dist/chunks/toast-CGHl3-oU.js.map +1 -0
  293. package/dist/chunks/tooltip-Bc-u6nIW.js +2 -0
  294. package/dist/chunks/tooltip-Bc-u6nIW.js.map +1 -0
  295. package/dist/chunks/tree-Cql1veeZ.js +2 -0
  296. package/dist/chunks/tree-Cql1veeZ.js.map +1 -0
  297. package/dist/chunks/types-CS_40Txv.d.ts +35 -0
  298. package/dist/chunks/unhandledProps-9Kdj7WVf.js +2 -0
  299. package/dist/chunks/unhandledProps-9Kdj7WVf.js.map +1 -0
  300. package/dist/chunks/useButtonSemantics-CILM_lhi.js +2 -0
  301. package/dist/chunks/useButtonSemantics-CILM_lhi.js.map +1 -0
  302. package/dist/chunks/useControllableState-CPUJxfKW.js +2 -0
  303. package/dist/chunks/useControllableState-CPUJxfKW.js.map +1 -0
  304. package/dist/chunks/useDialogElement-CgOnJAzu.js +2 -0
  305. package/dist/chunks/useDialogElement-CgOnJAzu.js.map +1 -0
  306. package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js +2 -0
  307. package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js.map +1 -0
  308. package/dist/chunks/useFloatingOverlay-DLIvwx-8.js +2 -0
  309. package/dist/chunks/useFloatingOverlay-DLIvwx-8.js.map +1 -0
  310. package/dist/chunks/useForkedRef-DVEfT-KI.js +2 -0
  311. package/dist/chunks/useForkedRef-DVEfT-KI.js.map +1 -0
  312. package/dist/chunks/useFormField-BOqmBTC4.js +2 -0
  313. package/dist/chunks/useFormField-BOqmBTC4.js.map +1 -0
  314. package/dist/chunks/useIsomorphicLayoutEffect-BbqRwuqn.js +2 -0
  315. package/dist/chunks/useIsomorphicLayoutEffect-BbqRwuqn.js.map +1 -0
  316. package/dist/chunks/useOpenStateProps-DykUbnPJ.js +2 -0
  317. package/dist/chunks/useOpenStateProps-DykUbnPJ.js.map +1 -0
  318. package/dist/chunks/useToastRegionQueue-CIV5SdiE.js +2 -0
  319. package/dist/chunks/useToastRegionQueue-CIV5SdiE.js.map +1 -0
  320. package/dist/chunks/useTransitionState-e5ToY7eX.js +2 -0
  321. package/dist/chunks/useTransitionState-e5ToY7eX.js.map +1 -0
  322. package/dist/chunks/validationClassName-gRGs4KBm.js +2 -0
  323. package/dist/chunks/validationClassName-gRGs4KBm.js.map +1 -0
  324. package/dist/chunks/visibleState-B_i1zHu2.js +2 -0
  325. package/dist/chunks/visibleState-B_i1zHu2.js.map +1 -0
  326. package/dist/close-button.d.ts +2 -0
  327. package/dist/close-button.js +1 -0
  328. package/dist/collapse.d.ts +2 -0
  329. package/dist/collapse.js +1 -0
  330. package/dist/color-input.d.ts +2 -0
  331. package/dist/color-input.js +1 -0
  332. package/dist/combobox.d.ts +3 -0
  333. package/dist/combobox.js +1 -0
  334. package/dist/context-menu.d.ts +2 -0
  335. package/dist/context-menu.js +1 -0
  336. package/dist/datagrid.d.ts +2 -0
  337. package/dist/datagrid.js +1 -0
  338. package/dist/datepicker.d.ts +2 -0
  339. package/dist/datepicker.js +1 -0
  340. package/dist/divider.d.ts +2 -0
  341. package/dist/divider.js +1 -0
  342. package/dist/drawer.d.ts +2 -0
  343. package/dist/drawer.js +1 -0
  344. package/dist/file-input.d.ts +2 -0
  345. package/dist/file-input.js +1 -0
  346. package/dist/flex.d.ts +2 -0
  347. package/dist/flex.js +1 -0
  348. package/dist/floating-input.d.ts +2 -0
  349. package/dist/floating-input.js +1 -0
  350. package/dist/form-field.d.ts +2 -0
  351. package/dist/form-field.js +1 -0
  352. package/dist/form.d.ts +2 -0
  353. package/dist/form.js +1 -0
  354. package/dist/grid.d.ts +2 -0
  355. package/dist/grid.js +1 -0
  356. package/dist/icon.d.ts +4 -0
  357. package/dist/icon.js +1 -0
  358. package/dist/index.d.ts +84 -6369
  359. package/dist/index.js +1 -2
  360. package/dist/input-adorn.d.ts +2 -0
  361. package/dist/input-adorn.js +1 -0
  362. package/dist/input-group.d.ts +2 -0
  363. package/dist/input-group.js +1 -0
  364. package/dist/link.d.ts +3 -0
  365. package/dist/link.js +1 -0
  366. package/dist/list.d.ts +2 -0
  367. package/dist/list.js +1 -0
  368. package/dist/menu.d.ts +4 -0
  369. package/dist/menu.js +1 -0
  370. package/dist/modal.d.ts +2 -0
  371. package/dist/modal.js +1 -0
  372. package/dist/nav-overflow.d.ts +2 -0
  373. package/dist/nav-overflow.js +1 -0
  374. package/dist/nav.d.ts +2 -0
  375. package/dist/nav.js +1 -0
  376. package/dist/navbar.d.ts +2 -0
  377. package/dist/navbar.js +1 -0
  378. package/dist/notification.d.ts +2 -0
  379. package/dist/notification.js +1 -0
  380. package/dist/number-field.d.ts +2 -0
  381. package/dist/number-field.js +1 -0
  382. package/dist/otp-input.d.ts +2 -0
  383. package/dist/otp-input.js +1 -0
  384. package/dist/pagination.d.ts +2 -0
  385. package/dist/pagination.js +1 -0
  386. package/dist/password-strength.d.ts +2 -0
  387. package/dist/password-strength.js +1 -0
  388. package/dist/placeholder.d.ts +2 -0
  389. package/dist/placeholder.js +1 -0
  390. package/dist/popover.d.ts +2 -0
  391. package/dist/popover.js +1 -0
  392. package/dist/portal.d.ts +2 -0
  393. package/dist/portal.js +1 -0
  394. package/dist/progress.d.ts +2 -0
  395. package/dist/progress.js +1 -0
  396. package/dist/radio.d.ts +2 -0
  397. package/dist/radio.js +1 -0
  398. package/dist/range-input.d.ts +2 -0
  399. package/dist/range-input.js +1 -0
  400. package/dist/scrollspy.d.ts +2 -0
  401. package/dist/scrollspy.js +1 -0
  402. package/dist/search-field.d.ts +2 -0
  403. package/dist/search-field.js +1 -0
  404. package/dist/select.d.ts +2 -0
  405. package/dist/select.js +1 -0
  406. package/dist/skeleton.d.ts +2 -0
  407. package/dist/skeleton.js +1 -0
  408. package/dist/spinner.d.ts +2 -0
  409. package/dist/spinner.js +1 -0
  410. package/dist/stack.d.ts +2 -0
  411. package/dist/stack.js +1 -0
  412. package/dist/static-table.d.ts +2 -0
  413. package/dist/static-table.js +1 -0
  414. package/dist/stepper.d.ts +2 -0
  415. package/dist/stepper.js +1 -0
  416. package/dist/style.css +1 -1
  417. package/dist/switch.d.ts +2 -0
  418. package/dist/switch.js +1 -0
  419. package/dist/table.d.ts +2 -0
  420. package/dist/table.js +1 -0
  421. package/dist/tabs.d.ts +2 -0
  422. package/dist/tabs.js +1 -0
  423. package/dist/text-input.d.ts +2 -0
  424. package/dist/text-input.js +1 -0
  425. package/dist/textarea.d.ts +2 -0
  426. package/dist/textarea.js +1 -0
  427. package/dist/time-field.d.ts +2 -0
  428. package/dist/time-field.js +1 -0
  429. package/dist/toast.d.ts +2 -0
  430. package/dist/toast.js +1 -0
  431. package/dist/tooltip.d.ts +2 -0
  432. package/dist/tooltip.js +1 -0
  433. package/dist/tree.d.ts +2 -0
  434. package/dist/tree.js +1 -0
  435. package/dist/visually-hidden.d.ts +2 -0
  436. package/dist/visually-hidden.js +1 -0
  437. package/package.json +120 -53
  438. package/src/components/accordion/Accordion.tsx +0 -190
  439. package/src/components/accordion/AccordionBody.tsx +0 -46
  440. package/src/components/accordion/AccordionHeader.tsx +0 -21
  441. package/src/components/accordion/AccordionItem.tsx +0 -59
  442. package/src/components/accordion/context.ts +0 -8
  443. package/src/components/accordion/index.ts +0 -8
  444. package/src/components/autocomplete/Autocomplete.tsx +0 -464
  445. package/src/components/autocomplete/AutocompleteGroup.tsx +0 -20
  446. package/src/components/autocomplete/AutocompleteItem.tsx +0 -18
  447. package/src/components/autocomplete/index.ts +0 -6
  448. package/src/components/avatar/Avatar.tsx +0 -137
  449. package/src/components/avatar/AvatarImage.tsx +0 -19
  450. package/src/components/avatar/AvatarStack.tsx +0 -98
  451. package/src/components/avatar/index.ts +0 -6
  452. package/src/components/badge/Badge.tsx +0 -94
  453. package/src/components/badge/index.ts +0 -2
  454. package/src/components/breadcrumb/Breadcrumb.tsx +0 -68
  455. package/src/components/breadcrumb/BreadcrumbItem.tsx +0 -38
  456. package/src/components/breadcrumb/index.ts +0 -4
  457. package/src/components/button/Button.tsx +0 -232
  458. package/src/components/button/index.ts +0 -2
  459. package/src/components/button-group/ButtonGroup.tsx +0 -55
  460. package/src/components/button-group/ButtonToolbar.tsx +0 -47
  461. package/src/components/button-group/index.ts +0 -4
  462. package/src/components/calendar/Calendar.scss +0 -57
  463. package/src/components/calendar/Calendar.tsx +0 -338
  464. package/src/components/calendar/CalendarMonthBlock.tsx +0 -57
  465. package/src/components/calendar/CalendarMonthGrid.tsx +0 -94
  466. package/src/components/calendar/CalendarMonthYearPicker.tsx +0 -164
  467. package/src/components/calendar/CalendarNavButton.tsx +0 -24
  468. package/src/components/calendar/CalendarWeekGrid.tsx +0 -58
  469. package/src/components/calendar/CalendarYearGrid.tsx +0 -128
  470. package/src/components/calendar/RangeCalendar.scss +0 -95
  471. package/src/components/calendar/RangeCalendar.tsx +0 -373
  472. package/src/components/calendar/index.ts +0 -6
  473. package/src/components/calendar/labels.tsx +0 -71
  474. package/src/components/card/Card.tsx +0 -173
  475. package/src/components/card/CardBody.tsx +0 -75
  476. package/src/components/card/CardFooter.tsx +0 -47
  477. package/src/components/card/CardGroup.tsx +0 -51
  478. package/src/components/card/CardHeader.tsx +0 -47
  479. package/src/components/card/CardImage.tsx +0 -70
  480. package/src/components/card/CardImageOverlay.tsx +0 -47
  481. package/src/components/card/CardLink.tsx +0 -40
  482. package/src/components/card/CardSubtitle.tsx +0 -47
  483. package/src/components/card/CardText.tsx +0 -47
  484. package/src/components/card/CardTitle.tsx +0 -47
  485. package/src/components/card/index.ts +0 -22
  486. package/src/components/carousel/Carousel.tsx +0 -753
  487. package/src/components/carousel/CarouselControlButton.tsx +0 -74
  488. package/src/components/carousel/CarouselControlNext.tsx +0 -22
  489. package/src/components/carousel/CarouselControlPrev.tsx +0 -22
  490. package/src/components/carousel/CarouselIndicators.tsx +0 -44
  491. package/src/components/carousel/CarouselInner.tsx +0 -56
  492. package/src/components/carousel/CarouselItem.tsx +0 -51
  493. package/src/components/carousel/CarouselOverlay.tsx +0 -51
  494. package/src/components/carousel/CarouselPlayPause.tsx +0 -61
  495. package/src/components/carousel/carouselEngine.ts +0 -170
  496. package/src/components/carousel/context.ts +0 -29
  497. package/src/components/carousel/index.ts +0 -21
  498. package/src/components/checkbox/Checkbox.tsx +0 -252
  499. package/src/components/checkbox/CheckboxGroup.tsx +0 -145
  500. package/src/components/checkbox/context.ts +0 -14
  501. package/src/components/checkbox/index.ts +0 -4
  502. package/src/components/chip/Chip.tsx +0 -184
  503. package/src/components/chip/index.ts +0 -2
  504. package/src/components/chip-input/ChipInput.tsx +0 -371
  505. package/src/components/chip-input/ChipList.tsx +0 -95
  506. package/src/components/chip-input/index.ts +0 -2
  507. package/src/components/close-button/CloseButton.tsx +0 -205
  508. package/src/components/close-button/index.ts +0 -2
  509. package/src/components/collapse/Collapse.tsx +0 -128
  510. package/src/components/collapse/index.ts +0 -2
  511. package/src/components/color-input/ColorInput.tsx +0 -106
  512. package/src/components/color-input/index.ts +0 -2
  513. package/src/components/combobox/Combobox.tsx +0 -320
  514. package/src/components/combobox/ComboboxGroup.tsx +0 -27
  515. package/src/components/combobox/ComboboxItem.tsx +0 -44
  516. package/src/components/combobox/ComboboxListBox.tsx +0 -98
  517. package/src/components/combobox/index.ts +0 -6
  518. package/src/components/datagrid/DataGrid.scss +0 -203
  519. package/src/components/datagrid/DataGrid.tsx +0 -259
  520. package/src/components/datagrid/DataGridBody.tsx +0 -162
  521. package/src/components/datagrid/DataGridCell.tsx +0 -47
  522. package/src/components/datagrid/DataGridColumn.tsx +0 -109
  523. package/src/components/datagrid/DataGridHeader.tsx +0 -47
  524. package/src/components/datagrid/DataGridPinBehavior.tsx +0 -225
  525. package/src/components/datagrid/DataGridRow.tsx +0 -48
  526. package/src/components/datagrid/DataGridSelectionCell.tsx +0 -74
  527. package/src/components/datagrid/DataGridTableLayout.ts +0 -30
  528. package/src/components/datagrid/index.ts +0 -14
  529. package/src/components/datagrid/useColumnGeometry.ts +0 -161
  530. package/src/components/datepicker/CalendarToggleButton.tsx +0 -58
  531. package/src/components/datepicker/ClearButton.tsx +0 -38
  532. package/src/components/datepicker/DateField.tsx +0 -54
  533. package/src/components/datepicker/DatePicker.scss +0 -51
  534. package/src/components/datepicker/DatePicker.tsx +0 -606
  535. package/src/components/datepicker/DateRangePicker.scss +0 -11
  536. package/src/components/datepicker/DateRangePicker.tsx +0 -361
  537. package/src/components/datepicker/index.ts +0 -4
  538. package/src/components/datepicker/renderDatePickerShell.tsx +0 -104
  539. package/src/components/drawer/Drawer.tsx +0 -213
  540. package/src/components/drawer/DrawerBody.tsx +0 -47
  541. package/src/components/drawer/DrawerFooter.tsx +0 -51
  542. package/src/components/drawer/DrawerHeader.tsx +0 -60
  543. package/src/components/drawer/DrawerTitle.tsx +0 -49
  544. package/src/components/drawer/index.ts +0 -10
  545. package/src/components/file-input/FileInput.tsx +0 -100
  546. package/src/components/file-input/index.ts +0 -2
  547. package/src/components/flex/Flex.tsx +0 -134
  548. package/src/components/flex/index.ts +0 -2
  549. package/src/components/floating-input/FloatingInput.tsx +0 -94
  550. package/src/components/floating-input/index.ts +0 -2
  551. package/src/components/form/Form.tsx +0 -26
  552. package/src/components/form/FormFeedback.tsx +0 -64
  553. package/src/components/form/FormHelp.tsx +0 -46
  554. package/src/components/form/FormLabel.tsx +0 -26
  555. package/src/components/form/index.ts +0 -8
  556. package/src/components/form/renderFormCheck.tsx +0 -86
  557. package/src/components/form-field/FormField.tsx +0 -84
  558. package/src/components/form-field/index.ts +0 -2
  559. package/src/components/form-field/renderFormField.tsx +0 -85
  560. package/src/components/grid/Col.tsx +0 -69
  561. package/src/components/grid/Container.tsx +0 -59
  562. package/src/components/grid/Grid.tsx +0 -86
  563. package/src/components/grid/GridItem.tsx +0 -123
  564. package/src/components/grid/Row.tsx +0 -71
  565. package/src/components/grid/gap.ts +0 -8
  566. package/src/components/grid/index.ts +0 -10
  567. package/src/components/icon/Icon.tsx +0 -74
  568. package/src/components/icon/index.ts +0 -2
  569. package/src/components/input-adorn/InputAdorn.tsx +0 -55
  570. package/src/components/input-adorn/index.ts +0 -2
  571. package/src/components/input-group/InputGroup.tsx +0 -50
  572. package/src/components/input-group/InputGroupAddon.tsx +0 -50
  573. package/src/components/input-group/index.ts +0 -4
  574. package/src/components/link/Link.tsx +0 -148
  575. package/src/components/link/index.ts +0 -2
  576. package/src/components/list/List.tsx +0 -193
  577. package/src/components/list/ListItem.tsx +0 -91
  578. package/src/components/list/index.ts +0 -4
  579. package/src/components/menu/Menu.tsx +0 -408
  580. package/src/components/menu/MenuDivider.tsx +0 -19
  581. package/src/components/menu/MenuHeader.tsx +0 -55
  582. package/src/components/menu/MenuItem.tsx +0 -85
  583. package/src/components/menu/MenuList.tsx +0 -142
  584. package/src/components/menu/MenuSubmenu.tsx +0 -284
  585. package/src/components/menu/MenuSubmenuBack.tsx +0 -39
  586. package/src/components/menu/MenuText.tsx +0 -47
  587. package/src/components/menu/MenuToggle.tsx +0 -148
  588. package/src/components/menu/index.ts +0 -19
  589. package/src/components/menu/menuNavigation.ts +0 -106
  590. package/src/components/menu/submenuGroup.ts +0 -43
  591. package/src/components/modal/Modal.tsx +0 -164
  592. package/src/components/modal/ModalBody.tsx +0 -47
  593. package/src/components/modal/ModalFooter.tsx +0 -51
  594. package/src/components/modal/ModalHeader.tsx +0 -60
  595. package/src/components/modal/ModalTitle.tsx +0 -49
  596. package/src/components/modal/index.ts +0 -10
  597. package/src/components/nav/Nav.tsx +0 -97
  598. package/src/components/nav/NavItem.tsx +0 -42
  599. package/src/components/nav/NavLink.tsx +0 -48
  600. package/src/components/nav/NavTitle.tsx +0 -22
  601. package/src/components/nav/index.ts +0 -7
  602. package/src/components/navbar/Navbar.tsx +0 -112
  603. package/src/components/navbar/NavbarBrand.tsx +0 -58
  604. package/src/components/navbar/NavbarNav.tsx +0 -47
  605. package/src/components/navbar/NavbarText.tsx +0 -47
  606. package/src/components/navbar/NavbarToggler.tsx +0 -34
  607. package/src/components/navbar/index.ts +0 -10
  608. package/src/components/notification/Notification.scss +0 -15
  609. package/src/components/notification/Notification.tsx +0 -187
  610. package/src/components/notification/NotificationIcon.tsx +0 -21
  611. package/src/components/notification/NotificationStack.tsx +0 -66
  612. package/src/components/notification/NotificationText.tsx +0 -47
  613. package/src/components/notification/NotificationTitle.tsx +0 -47
  614. package/src/components/notification/context.ts +0 -14
  615. package/src/components/notification/index.ts +0 -17
  616. package/src/components/notification/notificationQueue.ts +0 -48
  617. package/src/components/otp-input/OtpBox.tsx +0 -68
  618. package/src/components/otp-input/OtpInput.tsx +0 -342
  619. package/src/components/otp-input/index.ts +0 -2
  620. package/src/components/pagination/Pagination.tsx +0 -199
  621. package/src/components/pagination/PaginationItem.tsx +0 -152
  622. package/src/components/pagination/index.ts +0 -4
  623. package/src/components/password-strength/PasswordStrength.tsx +0 -155
  624. package/src/components/password-strength/index.ts +0 -2
  625. package/src/components/password-strength/strengthScore.ts +0 -79
  626. package/src/components/placeholder/Placeholder.tsx +0 -178
  627. package/src/components/placeholder/index.ts +0 -2
  628. package/src/components/popover/Popover.tsx +0 -269
  629. package/src/components/popover/index.ts +0 -2
  630. package/src/components/progress/Progress.tsx +0 -154
  631. package/src/components/progress/ProgressBar.tsx +0 -88
  632. package/src/components/progress/index.ts +0 -4
  633. package/src/components/radio/Radio.tsx +0 -98
  634. package/src/components/radio/RadioGroup.tsx +0 -142
  635. package/src/components/radio/context.ts +0 -14
  636. package/src/components/radio/index.ts +0 -4
  637. package/src/components/range-input/RangeInput.tsx +0 -109
  638. package/src/components/range-input/index.ts +0 -2
  639. package/src/components/select/Select.tsx +0 -277
  640. package/src/components/select/index.ts +0 -2
  641. package/src/components/skeleton/Skeleton.tsx +0 -89
  642. package/src/components/skeleton/SkeletonLoader.tsx +0 -91
  643. package/src/components/skeleton/index.ts +0 -4
  644. package/src/components/spinner/Spinner.tsx +0 -77
  645. package/src/components/spinner/index.ts +0 -2
  646. package/src/components/stack/Stack.tsx +0 -81
  647. package/src/components/stack/index.ts +0 -2
  648. package/src/components/stepper/Stepper.tsx +0 -172
  649. package/src/components/stepper/StepperItem.tsx +0 -66
  650. package/src/components/stepper/index.ts +0 -4
  651. package/src/components/switch/Switch.tsx +0 -259
  652. package/src/components/switch/index.ts +0 -2
  653. package/src/components/table/Table.css +0 -39
  654. package/src/components/table/Table.tsx +0 -413
  655. package/src/components/table/TableBody.tsx +0 -25
  656. package/src/components/table/TableCell.tsx +0 -27
  657. package/src/components/table/TableColumn.tsx +0 -31
  658. package/src/components/table/TableHeader.tsx +0 -26
  659. package/src/components/table/TableRow.tsx +0 -24
  660. package/src/components/table/index.ts +0 -12
  661. package/src/components/tabs/Tab.tsx +0 -36
  662. package/src/components/tabs/TabList.tsx +0 -76
  663. package/src/components/tabs/TabPanel.tsx +0 -68
  664. package/src/components/tabs/Tabs.tsx +0 -136
  665. package/src/components/tabs/context.ts +0 -24
  666. package/src/components/tabs/index.ts +0 -8
  667. package/src/components/text-input/TextInput.tsx +0 -188
  668. package/src/components/text-input/index.ts +0 -2
  669. package/src/components/textarea/Textarea.tsx +0 -145
  670. package/src/components/textarea/index.ts +0 -2
  671. package/src/components/toast/Toast.tsx +0 -219
  672. package/src/components/toast/ToastBody.tsx +0 -64
  673. package/src/components/toast/ToastFooter.tsx +0 -47
  674. package/src/components/toast/ToastHeader.tsx +0 -104
  675. package/src/components/toast/ToastIcon.tsx +0 -21
  676. package/src/components/toast/Toaster.tsx +0 -87
  677. package/src/components/toast/context.ts +0 -14
  678. package/src/components/toast/index.ts +0 -18
  679. package/src/components/toast/toastQueue.ts +0 -56
  680. package/src/components/tooltip/Tooltip.tsx +0 -171
  681. package/src/components/tooltip/index.ts +0 -2
  682. package/src/global.d.ts +0 -2
  683. package/src/hooks/index.ts +0 -57
  684. package/src/hooks/useAutoDismiss.ts +0 -91
  685. package/src/hooks/useButtonSemantics.ts +0 -33
  686. package/src/hooks/useControllableState.ts +0 -24
  687. package/src/hooks/useDialogElement.ts +0 -226
  688. package/src/hooks/useDisabledAnchorGuard.ts +0 -22
  689. package/src/hooks/useDismissibleTransition.ts +0 -126
  690. package/src/hooks/useDrawer.ts +0 -9
  691. package/src/hooks/useFloatingOverlay.ts +0 -125
  692. package/src/hooks/useForkedRef.ts +0 -50
  693. package/src/hooks/useFormField.ts +0 -89
  694. package/src/hooks/useIsomorphicLayoutEffect.ts +0 -9
  695. package/src/hooks/useModal.ts +0 -9
  696. package/src/hooks/useNotification.ts +0 -10
  697. package/src/hooks/useOverlayPlacement.ts +0 -93
  698. package/src/hooks/usePagination.ts +0 -89
  699. package/src/hooks/useToast.ts +0 -9
  700. package/src/hooks/useToastRegionQueue.ts +0 -27
  701. package/src/index.ts +0 -502
  702. package/src/types.ts +0 -133
  703. package/src/utils/breakpoints.ts +0 -43
  704. package/src/utils/comboboxCollection.tsx +0 -152
  705. package/src/utils/dateRangePresets.ts +0 -6
  706. package/src/utils/devWarning.ts +0 -58
  707. package/src/utils/dialogTransition.ts +0 -39
  708. package/src/utils/direction.ts +0 -14
  709. package/src/utils/focusRedirect.ts +0 -23
  710. package/src/utils/isWholeUnitDisabled.ts +0 -17
  711. package/src/utils/mergeIsDateUnavailable.ts +0 -15
  712. package/src/utils/overlayPlacement.ts +0 -93
  713. package/src/utils/pointerInteraction.ts +0 -21
  714. package/src/utils/polymorphic.ts +0 -53
  715. package/src/utils/renderMenuItemContent.tsx +0 -62
  716. package/src/utils/setVisibleRangeStart.ts +0 -64
  717. package/src/utils/spacingClassName.ts +0 -14
  718. package/src/utils/suppressFocusRingGlobally.ts +0 -84
  719. package/src/utils/triggerElement.ts +0 -25
  720. package/src/utils/validationClassName.ts +0 -8
  721. package/src/utils/virtualFocusStyle.ts +0 -16
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover-Bdg8D4sm.js","names":[],"sources":["../../src/components/popover/Popover.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n ReactElement,\n ReactNode,\n Ref,\n useEffect,\n useRef\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps, useDialog, useOverlayPosition, useOverlayTrigger } from 'react-aria'\nimport { useOverlayTriggerState } from 'react-stately'\n\nimport {\n getOverlayArrowStyle,\n getOverlayTransitionClass,\n useFloatingOverlay,\n useForkedRef,\n useOpenStateProps,\n useTransitionState\n} from '../../hooks'\nimport { Placement, resolveDataPlacement, toAriaPlacement } from '../../utils/overlayPlacement'\nimport { Portal, useHydrated } from '../portal/Portal'\nimport { getTriggerChild, renderSlotted } from '../../utils/slot'\n\ninterface PopoverPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'content'> {\n arrowProps: HTMLAttributes<HTMLDivElement>\n content: ReactNode | string\n overlayRef: Ref<HTMLDivElement>\n overlayTriggerProps: HTMLAttributes<HTMLDivElement>\n title?: ReactNode | string\n}\n\n// A distinct component (rather than inline JSX in `Popover`) so `useDialog`'s own mount-focus\n// effect — which only fires on this component's mount, not on `overlayRef.current` merely\n// becoming non-null — actually runs each time the popover opens. `Popover` unmounts this once\n// it has exited and mounts it again on every open, giving `useDialog` a fresh mount each time.\nconst PopoverPanel = ({\n arrowProps,\n content,\n overlayRef,\n overlayTriggerProps,\n title,\n ...rest\n}: PopoverPanelProps) => {\n // `useDialog` focuses the panel through a ref object; the caller's ref is forked onto the same\n // node.\n const panelRef = useRef<HTMLDivElement>(null)\n const forkedRef = useForkedRef(overlayRef, panelRef)\n const { dialogProps, titleProps } = useDialog({}, panelRef)\n\n return (\n <div {...mergeProps(overlayTriggerProps, dialogProps, rest)} ref={forkedRef}>\n <div className=\"popover-arrow\" {...arrowProps} style={getOverlayArrowStyle(arrowProps)}></div>\n {title && (\n <div className=\"popover-header\" {...titleProps}>\n {title}\n </div>\n )}\n <div className=\"popover-body\">{content}</div>\n </div>\n )\n}\n\n// Every attribute besides the component's own props goes to the panel, the `.popover` element:\n// `className`, `style`, `id`, `data-*`, ARIA attributes and event handlers. So does the ref.\nexport interface PopoverProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children' | 'content' | 'title'\n> {\n /**\n * The trigger: a single element, which opens the popover on click.\n */\n children: ReactElement\n /**\n * Content node for your component.\n */\n content: ReactNode | string\n /**\n * Whether the popover is open when it first renders. Use it instead of `visible` when nothing\n * outside needs to control the popover.\n */\n defaultVisible?: boolean\n /**\n * Offset of the popover relative to its target, as `[crossAxis, mainAxis]`.\n */\n offset?: [number, number]\n /**\n * Callback fired when the popover hides.\n */\n onHide?: () => void\n /**\n * Callback fired when the popover shows.\n */\n onShow?: () => void\n /**\n * Callback fired when the popover asks to show or hide: a click on the trigger, a click\n * outside, the Escape key, or the closing of the dialog it is in. Receives the state it asks\n * for. With `visible` set, the popover changes only when `visible` does.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Title node for your component.\n */\n title?: ReactNode | string\n /**\n * Describes the preferred placement of your component. Chassis will flip it to keep it in\n * view.\n */\n placement?: Placement\n /**\n * Whether the popover is open. Setting it makes the popover controlled: it shows and hides\n * only when this changes, so pair it with `onVisibleChange`. Leave it unset, or use\n * `defaultVisible`, for a popover that opens and closes itself.\n */\n visible?: boolean\n}\n\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(function Popover(\n {\n children,\n className,\n content,\n defaultVisible,\n placement = 'right',\n offset: offsetProp = [0, 8],\n onHide,\n onShow,\n onVisibleChange,\n style,\n title,\n visible,\n ...rest\n },\n ref\n) {\n const arrowRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLElement | null>(null)\n const floatingRef = useRef<HTMLDivElement>(null)\n const forkedFloatingRef = useForkedRef(ref, floatingRef)\n\n // The trigger is rendered as `asChild` renders a child (`renderSlotted`): the child's own\n // `onClick` chains after this one, and `triggerRef` is forked with the ref the caller put on\n // the child. `triggerProps` state the popover's condition (`aria-expanded`, `aria-controls`),\n // so they win over the child's own.\n const triggerElement = getTriggerChild(children, 'Popover')\n\n const state = useOverlayTriggerState(\n useOpenStateProps({ defaultVisible, onVisibleChange, visible }, 'Popover')\n )\n const {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n triggerProps: { onPress: _onPress, ...triggerProps },\n overlayProps: overlayTriggerProps\n } = useOverlayTrigger({ type: 'dialog' }, state, triggerRef)\n\n const portalContainer = useFloatingOverlay({\n close: state.close,\n isOpen: state.isOpen,\n onHide,\n onShow,\n triggerRef\n })\n\n // Escape should always close the popover, regardless of where focus currently is — a\n // mouse-opened popover leaves focus on the trigger, not inside the panel. Mirrors\n // `Menu.tsx`'s own window-level Escape handling. `onExited` below already returns focus to the\n // trigger once the exit transition finishes, so this doesn't need to do that itself.\n useEffect(() => {\n if (!state.isOpen) return undefined\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n state.close()\n }\n\n window.addEventListener('keydown', handleEscape)\n return () => window.removeEventListener('keydown', handleEscape)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.isOpen, state.close])\n\n // Deferred so the click that opened the popover doesn't immediately close it again — mirrors\n // `Menu.tsx`'s own outside-click handling.\n useEffect(() => {\n if (!state.isOpen) return undefined\n\n const handleDismiss = (event: MouseEvent) => {\n const target = event.target as Node\n if (triggerRef.current?.contains(target)) return\n if (floatingRef.current?.contains(target)) return\n state.close()\n }\n\n const id = window.setTimeout(() => {\n window.addEventListener('click', handleDismiss)\n })\n\n return () => {\n window.clearTimeout(id)\n window.removeEventListener('click', handleDismiss)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.isOpen, state.close])\n\n const {\n overlayProps,\n arrowProps,\n placement: resolvedPlacement\n } = useOverlayPosition({\n targetRef: triggerRef,\n overlayRef: floatingRef,\n placement: toAriaPlacement(placement),\n offset: offsetProp[1],\n crossOffset: offsetProp[0],\n arrowSize: 8,\n arrowRef,\n isOpen: state.isOpen,\n // `useOverlayPosition` closes on any window scroll via a backward-compat `WeakMap` that\n // `useOverlayTrigger` populates for `triggerRef.current` above. Passing `null` opts out so\n // the popover repositions with its trigger instead of vanishing — matching\n // `Autocomplete`/`Combobox`, neither of which is wired into that map.\n onClose: null\n })\n\n // The caller's `style` first: the position is the component's to set.\n const floatingStyle: React.CSSProperties = {\n ...style,\n position: overlayProps.style?.position as React.CSSProperties['position'],\n top: overlayProps.style?.top,\n left: overlayProps.style?.left\n }\n const placementAttr = resolveDataPlacement(placement, resolvedPlacement)\n\n const { isMounted, phase } = useTransitionState({\n in: state.isOpen,\n mountOnEnter: true,\n nodeRef: floatingRef,\n onExited: () => {\n const trigger = triggerRef.current\n if (!trigger || !document.contains(trigger)) return\n // Only reclaim focus when the popover still owns it, or when nothing does.\n // `useDialog` moves focus into the panel on open, so the panel still holds it here\n // for an Escape/inside close (`onExited` runs before the panel is taken out of the DOM,\n // so this reads the pre-removal state); an outside click on plain page\n // content instead leaves focus loose on `<body>`. Both are worth restoring. Any\n // other active element means the user deliberately put focus there — dismissing by\n // clicking another control, or the app closing the popover via `visible` while\n // they were typing somewhere else — and this used to steal it straight back off\n // them. Mirrors react-aria's own `shouldRestoreFocus` condition.\n const active = document.activeElement\n const focusIsLoose = !active || active === document.body\n const focusIsInPanel = !!active && !!floatingRef.current?.contains(active)\n if (!focusIsLoose && !focusIsInPanel) return\n trigger.focus()\n },\n unmountOnExit: true\n })\n\n // The panel is portaled, so it exists only once hydration has finished: until then the trigger\n // doesn't point `aria-controls` at it, or its HTML would refer to an id no element has.\n const hydrated = useHydrated()\n\n return (\n <>\n {triggerElement\n ? renderSlotted(\n triggerElement,\n { onClick: () => state.toggle() },\n triggerRef,\n hydrated ? triggerProps : { ...triggerProps, 'aria-controls': undefined }\n )\n : children}\n <Portal container={portalContainer}>\n {isMounted && (\n <PopoverPanel\n className={classNames(\n 'popover cx-popover-auto',\n getOverlayTransitionClass(phase),\n className\n )}\n data-cx-placement={placementAttr}\n style={floatingStyle}\n overlayTriggerProps={overlayTriggerProps}\n overlayRef={forkedFloatingRef}\n arrowProps={arrowProps}\n title={title}\n content={content}\n {...rest}\n />\n )}\n </Portal>\n </>\n )\n})\n\nPopover.displayName = 'Popover'\n"],"mappings":"4oBAqCA,MAAM,GAAgB,CACpB,aACA,UACA,aACA,sBACA,QACA,GAAG,KACoB,CAGvB,IAAM,EAAW,EAAuB,IAAI,EACtC,EAAY,EAAa,EAAY,CAAQ,EAC7C,CAAE,cAAa,cAAe,EAAU,CAAC,EAAG,CAAQ,EAE1D,OACE,EAAA,cAAC,MAAD,CAAK,GAAI,EAAW,EAAqB,EAAa,CAAI,EAAG,IAAK,CAQ7D,EAPH,EAAA,cAAC,MAAD,CAAK,UAAU,gBAAgB,GAAI,EAAY,MAAO,EAAqB,CAAU,CAAQ,CAAA,EAC5F,GACC,EAAA,cAAC,MAAD,CAAK,UAAU,iBAAiB,GAAI,CAE/B,EADF,CACE,EAEP,EAAA,cAAC,MAAD,CAAK,UAAU,cAA6B,EAAb,CAAa,CACzC,CAET,EAwDa,EAAU,EAAyC,SAC9D,CACE,WACA,YACA,UACA,iBACA,YAAY,QACZ,OAAQ,EAAa,CAAC,EAAG,CAAC,EAC1B,SACA,SACA,kBACA,QACA,QACA,UACA,GAAG,GAEL,EACA,CACA,IAAM,EAAW,EAAuB,IAAI,EACtC,EAAa,EAA2B,IAAI,EAC5C,EAAc,EAAuB,IAAI,EACzC,EAAoB,EAAa,EAAK,CAAW,EAMjD,EAAiB,EAAgB,EAAU,SAAS,EAEpD,EAAQ,EACZ,EAAkB,CAAE,iBAAgB,kBAAiB,SAAQ,EAAG,SAAS,CAC3E,EACM,CAEJ,aAAc,CAAE,QAAS,EAAU,GAAG,GACtC,aAAc,GACZ,EAAkB,CAAE,KAAM,QAAS,EAAG,EAAO,CAAU,EAErD,EAAkB,EAAm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iB,CAAC,CAAC,GAAU,CAAC,CAAC,EAAY,SAAS,SAAS,CAAM,GACpE,GAAiB,IACtB,EAAQ,MAAM,CAChB,EACA,cAAe,EACjB,CAAC,EAIK,EAAW,EAAY,EAE7B,OACE,EAAA,cAAA,EAAA,SAAA,KACG,EACG,EACE,EACA,CAAE,YAAe,EAAM,OAAO,CAAE,EAChC,EACA,EAAW,EAAe,CAAE,GAAG,EAAc,gBAAiB,IAAA,EAAU,CAC1E,EACA,EACJ,EAAA,cAAC,EAAD,CAAQ,UAAW,CAkBX,EAjBL,GACC,EAAA,cAAC,EAAD,CACE,UAAW,EACT,0BACA,EAA0B,CAAK,EAC/B,CACF,EACA,oBAAmB,EACnB,MAAO,EACc,sBACrB,WAAY,EACA,aACL,QACE,UACT,GAAI,CACL,CAAA,CAEG,CACR,CAEN,CAAC,EAED,EAAQ,YAAc"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import t,{useId as n}from"react";import r from"classnames";function i({children:e,animated:n,className:i,color:a,component:o,striped:s,style:c,value:l=0,...u},d){let f=o??`div`,p=Math.min(100,Math.max(0,l)),m=r(`progress-bar`,a&&`bg-${a} fg-contrast`,{striped:s,animated:n},i);return t.createElement(f,{...u,className:m,style:{width:`${p}%`,...c},ref:d},t.createElement(`span`,{className:`mx-2xs`},e))}const a=e(i,`ProgressBar`);function o({"aria-label":e,animated:i,children:o,className:s,color:c,component:l,height:u,inlineValue:d,label:f,showValue:p,striped:m,style:h,value:g=0,..._},v){let y=l??`div`,b=r(`progress`,s),x=Math.min(100,Math.max(0,g)),S=o===void 0?d?`${x}%`:void 0:o,C=!!(f||p),w=n(),T=f!=null&&typeof f!=`string`,E={...h};u!==void 0&&(E[`--cx-height`]=`${u}px`);let D=t.createElement(y,{..._,className:b,role:`progressbar`,"aria-valuenow":x,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e??(typeof f==`string`?f:void 0),"aria-labelledby":!e&&T?w:void 0,style:E,ref:v},t.createElement(a,{animated:i,color:c,striped:m,value:x},S));return C?t.createElement(`div`,{className:`d-flex flex-column gap-xs`},t.createElement(`div`,{className:r(`d-flex`,f?`justify-content-between`:`justify-content-end`)},f?t.createElement(`span`,{className:`font-strong`,id:T?w:void 0},f):null,p?t.createElement(`span`,{className:`font-strong`},x,`%`):null),D):D}const s=e(o,`Progress`);export{a as n,s as t};
2
+ //# sourceMappingURL=progress-zWkTltor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-zWkTltor.js","names":[],"sources":["../../src/components/progress/ProgressBar.tsx","../../src/components/progress/Progress.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype ProgressBarOwnProps<C extends ElementType> = {\n /**\n * Use to animate the stripes right to left via CSS3 animations.\n */\n animated?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Adds a diagonal stripe pattern over the bar's background.\n */\n striped?: boolean\n /**\n * The percent to progress the ProgressBar.\n */\n value?: number\n}\n\nexport type ProgressBarProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ProgressBarOwnProps<C>\n>\n\ntype ProgressBarComponent = (<C extends ElementType = 'div'>(\n props: ProgressBarProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ProgressBarRender<C extends ElementType = 'div'>(\n {\n children,\n animated,\n className,\n color,\n component,\n striped,\n style,\n value = 0,\n ...rest\n }: ProgressBarProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const clampedValue = Math.min(100, Math.max(0, value))\n const _className = classNames(\n 'progress-bar',\n color && `bg-${color} fg-contrast`,\n {\n striped,\n animated\n },\n className\n )\n\n return (\n <Component\n {...rest}\n className={_className}\n style={{ width: `${clampedValue}%`, ...style }}\n ref={ref}\n >\n <span className=\"mx-2xs\">{children}</span>\n </Component>\n )\n}\n\nexport const ProgressBar = createPolymorphicComponent<ProgressBarComponent>(\n ProgressBarRender as ForwardRefRenderFunction<Element, ProgressBarProps<ElementType>>,\n 'ProgressBar'\n)\n","import React, {\n CSSProperties,\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n useId\n} from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { ProgressBar } from './ProgressBar'\n\ntype ProgressStyle = CSSProperties & {\n '--cx-height'?: string\n}\n\ntype ProgressOwnProps<C extends ElementType> = {\n /**\n * Use to animate the stripes right to left via CSS3 animations.\n */\n animated?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Sets the height of the component, via the `--cx-height` custom property. If you set that\n * value the inner bar (and the striped pattern's tile size) automatically resizes accordingly.\n */\n height?: number\n /**\n * Shows the current value as text inside the bar, independently of `showValue` — combine both\n * to get a `label` + `showValue` caption above the bar alongside an `inlineValue` reading\n * inside it.\n */\n inlineValue?: boolean\n /**\n * A text label describing the progress. Rendered in a caption row above the bar. Also used as\n * the default accessible name when no `aria-label`/`aria-labelledby` is supplied.\n */\n label?: ReactNode\n /**\n * Shows the current value as text in the caption row above the bar, alongside `label` when\n * both are set, or alone otherwise. Use `inlineValue` to show it inside the bar instead.\n */\n showValue?: boolean\n /**\n * Adds a diagonal stripe pattern over the bar's background.\n */\n striped?: boolean\n /**\n * The percent to progress the ProgressBar (out of 100).\n */\n value?: number\n}\n\nexport type ProgressProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ProgressOwnProps<C>\n>\n\ntype ProgressComponent = (<C extends ElementType = 'div'>(\n props: ProgressProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ProgressRender<C extends ElementType = 'div'>(\n {\n 'aria-label': ariaLabel,\n animated,\n children,\n className,\n color,\n component,\n height,\n inlineValue,\n label,\n showValue,\n striped,\n style,\n value = 0,\n ...rest\n }: ProgressProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('progress', className)\n const clampedValue = Math.min(100, Math.max(0, value))\n\n const barChildren =\n children !== undefined ? children : inlineValue ? `${clampedValue}%` : undefined\n const hasCaption = Boolean(label || showValue)\n\n const labelId = useId()\n const isNodeLabel = label != null && typeof label !== 'string'\n\n const _style: ProgressStyle = { ...style }\n if (height !== undefined) _style['--cx-height'] = `${height}px`\n\n const progressElement = (\n <Component\n {...rest}\n className={_className}\n role=\"progressbar\"\n aria-valuenow={clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={ariaLabel ?? (typeof label === 'string' ? label : undefined)}\n aria-labelledby={!ariaLabel && isNodeLabel ? labelId : undefined}\n style={_style}\n ref={ref}\n >\n <ProgressBar animated={animated} color={color} striped={striped} value={clampedValue}>\n {barChildren}\n </ProgressBar>\n </Component>\n )\n\n if (!hasCaption) return progressElement\n\n return (\n <div className=\"d-flex flex-column gap-xs\">\n <div\n className={classNames('d-flex', label ? 'justify-content-between' : 'justify-content-end')}\n >\n {label ? (\n <span className=\"font-strong\" id={isNodeLabel ? labelId : undefined}>\n {label}\n </span>\n ) : null}\n {showValue ? <span className=\"font-strong\">{clampedValue}%</span> : null}\n </div>\n {progressElement}\n </div>\n )\n}\n\nexport const Progress = createPolymorphicComponent<ProgressComponent>(\n ProgressRender as ForwardRefRenderFunction<Element, ProgressProps<ElementType>>,\n 'Progress'\n)\n"],"mappings":"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AFK,EAGH,EAAA,cAAC,MAAD,CAAK,UAAU,2BAYV,EAXH,EAAA,cAAC,MAAD,CACE,UAAW,EAAW,SAAU,EAAQ,0BAA4B,qBAAqB,CAQtF,EANF,EACC,EAAA,cAAC,OAAD,CAAM,UAAU,cAAc,GAAI,EAAc,EAAU,IAAA,EAEpD,EADH,CACG,EACJ,KACH,EAAY,EAAA,cAAC,OAAD,CAAM,UAAU,aAAmC,EAApB,EAAa,GAAO,EAAI,IACjE,EACJ,CACE,EAfiB,CAiB1B,CAEA,MAAa,EAAW,EACtB,EACA,UACF"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{c as e}from"./slot-CNhFZdHF.js";import{t}from"./useForkedRef-DVEfT-KI.js";import{n,t as r}from"./FormHelp-AE6_iSLJ.js";import{t as i}from"./validationClassName-gRGs4KBm.js";import{t as a}from"./renderFormCheck-DN_-V62U.js";import{n as o,r as s}from"./unhandledProps-9Kdj7WVf.js";import{t as c}from"./flex-CmlJbKVj.js";import l,{createContext as u,forwardRef as d,useContext as f,useRef as p}from"react";import m from"classnames";import{useRadio as h,useRadioGroup as g}from"react-aria";import{useRadioGroupState as _}from"react-stately";const v=u(null),y=[...o,`form`,`name`,`required`,`tabIndex`],b=d(({button:n,children:r,className:o,color:c,disabled:u,id:d,label:g,size:_,style:b,...x},S)=>{let C=f(v);if(!C)throw Error(`Radio must be rendered inside a RadioGroup.`);let{describedBy:w,state:T,valid:E}=C,D=T.isInvalid,O=p(null),k=t(S,O),A=g??r,{inputProps:j}=h({...x,children:A,isDisabled:u},T,O),M=m(i(D,E));return a({button:n,className:o,color:c,input:l.createElement(`input`,{...s(j,x,y),"aria-describedby":e(x[`aria-describedby`],w),className:M,id:d,ref:k}),invalid:D,label:A,size:_,style:b,valid:E})});b.displayName=`Radio`;const x=d(({children:t,className:a,defaultValue:o,description:u,disabled:d,errorMessage:f,invalid:p,label:h,name:y,onChange:b,orientation:x,required:S,valid:C,value:w,...T},E)=>{let D={...T,defaultValue:o,description:u,errorMessage:f,isDisabled:d,isInvalid:p,isRequired:S,label:h,name:y,onChange:b,orientation:x,value:w},O=_(D),{radioGroupProps:k,labelProps:A,descriptionProps:j,errorMessageProps:M}=g(D,O),N=m(`form-field`,i(p,C),a),P=e(!!u&&j.id,!!(p&&f)&&M.id),F=l.createElement(v.Provider,{value:{describedBy:P,state:O,valid:C}},t);return l.createElement(`fieldset`,{...s(k,T,[`onBlur`,`onFocus`]),"aria-describedby":e(P,T[`aria-describedby`]),className:N,ref:E},h&&l.createElement(`legend`,{className:`form-label`,...A},h),x===`horizontal`?l.createElement(c,{wrap:`wrap`,gap:`md`},F):F,u&&l.createElement(r,j,u),p&&f&&l.createElement(n,{invalid:!0,...M},f))});x.displayName=`RadioGroup`;export{b as n,x as t};
2
+ //# sourceMappingURL=radio-DOFYCfJi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-DOFYCfJi.js","names":[],"sources":["../../src/components/radio/context.ts","../../src/components/radio/Radio.tsx","../../src/components/radio/RadioGroup.tsx"],"sourcesContent":["import { createContext } from 'react'\nimport { RadioGroupState } from 'react-stately'\n\nexport interface RadioGroupContextValue {\n state: RadioGroupState\n /**\n * `RadioGroup`'s own `valid` prop, mirrored here since it has no react-stately equivalent to\n * read off `state` the way `isInvalid` does — each `Radio` needs it to apply its own\n * `is-valid` class.\n */\n valid?: boolean\n /**\n * The ids of the group's description and error message, when they are rendered. Each item is\n * described by them too.\n */\n describedBy?: string\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n","import React, { forwardRef, InputHTMLAttributes, ReactNode, useContext, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaRadioProps, useRadio } from 'react-aria'\n\nimport { useForkedRef } from '../../hooks'\nimport { ContextColor } from '../../types'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { joinIds } from '../../utils/idRefs'\nimport { mergeUnhandledProps, TOGGLE_PROPS } from '../../utils/unhandledProps'\n\nimport { RadioGroupContext } from './context'\nimport { ButtonObject, renderFormCheck } from '../form/renderFormCheck'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'checked' | 'defaultChecked' | 'onChange' | 'size'\n> {\n /**\n * Create button-like radios. Combine with `<RadioGroup>` to build radio toggle-button groups.\n */\n button?: ButtonObject\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the radio indicator to one of Chassis context colors. Ignored when `button` is set.\n */\n color?: ContextColor\n /**\n * The id global attribute defines an identifier (ID) that must be unique in the whole document.\n */\n id?: string\n /**\n * The element represents a caption for a component.\n *\n * Children are accepted as an alias for this prop — `label` wins when both are given.\n * react-aria, which backs this component, calls the same thing `children`; this package renames\n * it to `label`, and honouring both means the shape React developers reach for first still\n * names the control instead of silently producing an unlabelled one.\n */\n label?: ReactNode\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * The value of the radio button, used to identify it within its `<RadioGroup>`.\n */\n value: string\n}\n\n// The group owns its radios' `name`, `form` and required state, and which one is the tab stop.\nconst RADIO_PROPS = [...TOGGLE_PROPS, 'form', 'name', 'required', 'tabIndex']\n\n// `<Radio>` must be rendered inside a `<RadioGroup>` — react-aria has no standalone\n// radio hook, only useRadio(props, RadioGroupState, ref), because a lone radio with no group is\n// not a meaningful accessible control (see https://chassis-ui.com/css/docs/forms/checkbox-radio).\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n ({ button, children, className, color, disabled, id, label, size, style, ...rest }, ref) => {\n const group = useContext(RadioGroupContext)\n\n if (!group) {\n throw new Error('Radio must be rendered inside a RadioGroup.')\n }\n\n const { describedBy: groupDescribedBy, state: groupState, valid } = group\n const invalid = groupState.isInvalid\n\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n\n // `label` is this package's name for what react-aria calls `children`. Accept either, so the\n // shape React developers reach for first (`<Radio>Label</Radio>`) names the control instead of\n // being silently dropped — see the note on `label` in `RadioProps`.\n const resolvedLabel = label ?? children\n\n const { inputProps } = useRadio(\n {\n ...rest,\n children: resolvedLabel,\n isDisabled: disabled\n } as AriaRadioProps,\n groupState,\n inputRef\n )\n\n const inputClassName = classNames(validationClassName(invalid, valid))\n\n return renderFormCheck({\n button,\n className,\n color,\n // Described by the group's description and error message, as react-aria intends, but only\n // by those the group renders (FORMS.md, gotcha 6).\n input: (\n <input\n {...mergeUnhandledProps(inputProps, rest, RADIO_PROPS)}\n aria-describedby={joinIds(rest['aria-describedby'], groupDescribedBy)}\n className={inputClassName}\n id={id}\n ref={forkedRef}\n />\n ),\n invalid,\n label: resolvedLabel,\n size,\n style,\n valid\n })\n }\n)\n\nRadio.displayName = 'Radio'\n","import React, { forwardRef, HTMLAttributes, ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { AriaRadioGroupProps, useRadioGroup } from 'react-aria'\nimport { RadioGroupProps as StatelyRadioGroupProps, useRadioGroupState } from 'react-stately'\n\nimport { validationClassName } from '../../utils/validationClassName'\nimport { joinIds } from '../../utils/idRefs'\nimport { mergeUnhandledProps } from '../../utils/unhandledProps'\n\nimport { RadioGroupContext } from './context'\nimport { FormFeedback } from '../form/FormFeedback'\nimport { FormHelp } from '../form/FormHelp'\nimport { Flex } from '../flex'\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLFieldSetElement>,\n 'defaultValue' | 'onChange'\n> {\n /**\n * One or more `<Radio>` elements.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The selected value, uncontrolled.\n */\n defaultValue?: string\n /**\n * A description for the group, rendered below the options.\n */\n description?: ReactNode\n /**\n * Disables every radio in the group.\n */\n disabled?: boolean\n /**\n * An error message for the group, rendered below the options when `invalid` is set.\n */\n errorMessage?: ReactNode\n /**\n * Set group validation state to invalid.\n */\n invalid?: boolean\n /**\n * The group's caption, rendered as a `<legend>`.\n */\n label?: ReactNode\n /**\n * The name for the group, used for native form submission.\n */\n name?: string\n /**\n * Callback fired when the selected value changes.\n */\n onChange?: (value: string) => void\n /**\n * Lay the group's radios out on the same horizontal row instead of stacking them.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * Marks the group as required.\n */\n required?: boolean\n /**\n * Set group validation state to valid.\n */\n valid?: boolean\n /**\n * The selected value, controlled.\n */\n value?: string\n}\n\nexport const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(\n (\n {\n children,\n className,\n defaultValue,\n description,\n disabled,\n errorMessage,\n invalid,\n label,\n name,\n onChange,\n orientation,\n required,\n valid,\n value,\n ...rest\n },\n ref\n ) => {\n const groupProps = {\n ...rest,\n defaultValue,\n description,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isRequired: required,\n label,\n name,\n onChange,\n orientation,\n value\n }\n\n const state = useRadioGroupState(groupProps as StatelyRadioGroupProps)\n const { radioGroupProps, labelProps, descriptionProps, errorMessageProps } = useRadioGroup(\n groupProps as AriaRadioGroupProps,\n state\n )\n\n const _className = classNames('form-field', validationClassName(invalid, valid), className)\n\n // Only the ids this group renders. react-aria's own describe the group and every item by a\n // description and an error message whether or not they exist (FORMS.md, gotcha 6).\n const describedBy = joinIds(\n Boolean(description) && descriptionProps.id,\n Boolean(invalid && errorMessage) && errorMessageProps.id\n )\n\n const items = (\n <RadioGroupContext.Provider value={{ describedBy, state, valid }}>\n {children}\n </RadioGroupContext.Provider>\n )\n\n return (\n <fieldset\n {...mergeUnhandledProps(radioGroupProps, rest, ['onBlur', 'onFocus'])}\n aria-describedby={joinIds(describedBy, rest['aria-describedby'])}\n className={_className}\n ref={ref}\n >\n {label && (\n <legend className=\"form-label\" {...labelProps}>\n {label}\n </legend>\n )}\n {orientation === 'horizontal' ? (\n <Flex wrap=\"wrap\" gap=\"md\">\n {items}\n </Flex>\n ) : (\n items\n )}\n {description && <FormHelp {...descriptionProps}>{description}</FormHelp>}\n {invalid && errorMessage && (\n <FormFeedback invalid {...errorMessageProps}>\n {errorMessage}\n </FormFeed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,EAIpF,EAAc,EAClB,EAAQ,GAAgB,EAAiB,GACzC,GAAQ,GAAW,IAAiB,EAAkB,EACxD,EAEM,EACJ,EAAA,cAAC,EAAkB,SAAnB,CAA4B,MAAO,CAAE,cAAa,QAAO,OAAM,CAEnC,EADzB,CACyB,EAG9B,OACE,EAAA,cAAC,WAAD,CACE,GAAI,EAAoB,EAAiB,EAAM,CAAC,SAAU,SAAS,CAAC,EACpE,mBAAkB,EAAQ,EAAa,EAAK,mBAAmB,EAC/D,UAAW,EACN,KAoBG,EAlBP,GACC,EAAA,cAAC,SAAD,CAAQ,UAAU,aAAa,GAAI,CAE3B,EADL,CACK,EAET,IAAgB,aACf,EAAA,cAAC,EAAD,CAAM,KAAK,OAAO,IAAI,IAEhB,EADH,CACG,EAEN,EAED,GAAe,EAAA,cAAC,EAAa,EAAmB,CAAsB,EACtE,GAAW,GACV,EAAA,cAAC,EAAD,CAAc,QAAA,GAAQ,GAAI,CAEZ,EADX,CACW,CAER,CAEd,CACF,EAEA,EAAW,YAAc"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useFormField-BOqmBTC4.js";import{t}from"./renderFormField-Brkw1yA6.js";import{t as n}from"./validationClassName-gRGs4KBm.js";import r,{forwardRef as i}from"react";import a from"classnames";const o=i(({className:i,help:o,id:s,invalid:c,invalidFeedback:l,label:u,valid:d,validFeedback:f,...p},m)=>{let{describedBy:h,feedbackId:g,helpId:_,inputId:v}=e({ariaDescribedBy:p[`aria-describedby`],help:o,id:s,invalid:c,invalidFeedback:l,valid:d,validFeedback:f}),y=a(`form-range`,n(c,d),i);return t({children:r.createElement(`input`,{...p,"aria-describedby":h,"aria-invalid":c||void 0,className:y,id:v,ref:m,type:`range`}),help:o,ids:{feedback:g,help:_,input:v},invalid:c,invalidFeedback:l,label:u,valid:d,validFeedback:f})});o.displayName=`RangeInput`;export{o as t};
2
+ //# sourceMappingURL=range-input-CT_8TKL7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-input-CT_8TKL7.js","names":[],"sources":["../../src/components/range-input/RangeInput.tsx"],"sourcesContent":["import React, { ChangeEventHandler, forwardRef, InputHTMLAttributes, ReactNode } from 'react'\nimport classNames from 'classnames'\n\nimport { useFormField } from '../../hooks'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { renderFormField } from '../form-field/renderFormField'\n\nexport interface RangeInputProps extends InputHTMLAttributes<HTMLInputElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * A description for the field, rendered below the range input.\n */\n help?: ReactNode\n /**\n * Set component validation state to invalid.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below the range input when `invalid` is set.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with this range input.\n */\n label?: ReactNode\n /**\n * Specifies the maximum value for the component.\n */\n max?: number\n /**\n * Specifies the minimum value for the component.\n */\n min?: number\n /**\n * Method called immediately after the `value` prop changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>\n /**\n * Toggle the readonly state for the component.\n */\n readOnly?: boolean\n /**\n * Specifies the interval between legal numbers in the component.\n */\n step?: number\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below the range input when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The `value` attribute of component.\n *\n * @controllable onChange\n * */\n value?: string | number\n}\n\nexport const RangeInput = forwardRef<HTMLInputElement, RangeInputProps>(\n (\n { className, help, id, invalid, invalidFeedback, label, valid, validFeedback, ...rest },\n ref\n ) => {\n const { describedBy, feedbackId, helpId, inputId } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n help,\n id,\n invalid,\n invalidFeedback,\n valid,\n validFeedback\n })\n\n const _className = classNames('form-range', validationClassName(invalid, valid), className)\n\n return renderFormField({\n children: (\n <input\n {...rest}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n className={_className}\n id={inputId}\n ref={ref}\n type=\"range\"\n />\n ),\n help,\n ids: { feedback: feedbackId, help: helpId, input: inputId },\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n }\n)\n\nRangeInput.displayName = 'RangeInput'\n"],"mappings":"mPAoEA,MAAa,EAAa,GAEtB,CAAE,YAAW,OAAM,KAAI,UAAS,kBAAiB,QAAO,QAAO,gBAAe,GAAG,GACjF,IACG,CACH,GAAM,CAAE,cAAa,aAAY,SAAQ,WAAY,EAAa,CAChE,gBAAiB,EAAK,oBACtB,OACA,KACA,UACA,kBACA,QACA,eACF,CAAC,EAEK,EAAa,EAAW,aAAc,EAAoB,EAAS,CAAK,EAAG,CAAS,EAE1F,OAAO,EAAgB,CACrB,SACE,EAAA,cAAC,QAAD,CACE,GAAI,EACJ,mBAAkB,EAClB,eAAc,GAAW,IAAA,GACzB,UAAW,EACX,GAAI,EACC,MACL,KAAK,OACN,CAAA,EAEH,OACA,IAAK,CAAE,SAAU,EAAY,KAAM,EAAQ,MAAO,CAAQ,EAC1D,UACA,kBACA,QACA,QACA,eACF,CAAC,CACH,CACF,EAEA,EAAW,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./FormLabel-CYcQiFUI.js";import{t}from"./validationClassName-gRGs4KBm.js";import n from"react";import r from"classnames";const i=({button:i,className:a,color:o,input:s,invalid:c,label:l,size:u,style:d,valid:f})=>{if(i){let o=r(`button`,`button-check`,i.color,i.variant,i.size,i.shape,t(c,f),a);return n.createElement(e,{customClassName:o,style:d},s,l)}let p=r(`check-input`,o,t(c,f));if(!l)return n.createElement(`span`,{className:p,style:d},s);let m=r(`form-check`,u,t(c,f),a);return n.createElement(e,{customClassName:m,style:d},n.createElement(`span`,{className:p},s),l)};export{i as t};
2
+ //# sourceMappingURL=renderFormCheck-DN_-V62U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderFormCheck-DN_-V62U.js","names":[],"sources":["../../src/components/form/renderFormCheck.tsx"],"sourcesContent":["import React, { CSSProperties, ReactNode } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor, Shapes } from '../../types'\nimport { validationClassName } from '../../utils/validationClassName'\n\nimport { FormLabel } from './FormLabel'\n\nexport type ButtonObject = {\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Select the shape of the component.\n */\n shape?: Shapes\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set the button variant to an outlined button or a ghost button.\n */\n variant?: 'outline' | 'ghost'\n}\n\nexport interface RenderFormCheckOptions {\n button?: ButtonObject\n className?: string\n color?: ContextColor\n input: ReactNode\n invalid?: boolean\n label?: ReactNode\n size?: 'sm' | 'lg'\n style?: CSSProperties\n valid?: boolean\n}\n\n// Shared nested, modern `.form-check`/`.check-input` markup for Checkbox and Radio —\n// see https://chassis-ui.com/css/docs/forms/checkbox-radio/#modern-inputs. Everything renders\n// nested inside a single <label> (or a bare <span class=\"check-input\"> when there's no label);\n// there is no sibling/`for`-linked layout. `style` goes on the outermost element.\nexport const renderFormCheck = ({\n button,\n className,\n color,\n input,\n invalid,\n label,\n size,\n style,\n valid\n}: RenderFormCheckOptions) => {\n if (button) {\n const _className = classNames(\n 'button',\n 'button-check',\n button.color,\n button.variant,\n button.size,\n button.shape,\n validationClassName(invalid, valid),\n className\n )\n return (\n <FormLabel customClassName={_className} style={style}>\n {input}\n {label}\n </FormLabel>\n )\n }\n\n const checkInputClassName = classNames('check-input', color, validationClassName(invalid, valid))\n\n if (!label) {\n return (\n <span className={checkInputClassName} style={style}>\n {input}\n </span>\n )\n }\n\n const _className = classNames('form-check', size, validationClassName(invalid, valid), className)\n\n return (\n <FormLabel customClassName={_className} style={style}>\n <span className={checkInputClassName}>{input}</span>\n {label}\n </FormLabel>\n )\n}\n"],"mappings":"4IA2CA,MAAa,GAAmB,CAC9B,SACA,YACA,QACA,QACA,UACA,QACA,OACA,QACA,WAC4B,CAC5B,GAAI,EAAQ,CACV,IAAM,EAAa,EACjB,SACA,eACA,EAAO,MACP,EAAO,QACP,EAAO,KACP,EAAO,MACP,EAAoB,EAAS,CAAK,EAClC,CACF,EACA,OACE,EAAA,cAAC,EAAD,CAAW,gBAAiB,EAAmB,OAGpC,EAFR,EACA,CACQ,CAEf,CAEA,IAAM,EAAsB,EAAW,cAAe,EAAO,EAAoB,EAAS,CAAK,CAAC,EAEhG,GAAI,CAAC,EACH,OACE,EAAA,cAAC,OAAD,CAAM,UAAW,EAA4B,OAEvC,EADH,CACG,EAIV,IAAM,EAAa,EAAW,aAAc,EAAM,EAAoB,EAAS,CAAK,EAAG,CAAS,EAEhG,OACE,EAAA,cAAC,EAAD,CAAW,gBAAiB,EAAmB,OAGpC,EAFT,EAAA,cAAC,OAAD,CAAM,UAAW,CAAkC,EAAZ,CAAY,EAClD,CACQ,CAEf"}
@@ -0,0 +1,24 @@
1
+ import { a as Shapes, n as ContextColor } from "./types-CS_40Txv.js";
2
+ import React, { CSSProperties, ReactNode } from "react";
3
+ //#region src/components/form/renderFormCheck.d.ts
4
+ type ButtonObject = {
5
+ /**
6
+ * Sets the color of the component to one of Chassis context colors.
7
+ */
8
+ color?: ContextColor;
9
+ /**
10
+ * Select the shape of the component.
11
+ */
12
+ shape?: Shapes;
13
+ /**
14
+ * Size the component sm or lg.
15
+ */
16
+ size?: 'sm' | 'lg';
17
+ /**
18
+ * Set the button variant to an outlined button or a ghost button.
19
+ */
20
+ variant?: 'outline' | 'ghost';
21
+ };
22
+ //#endregion
23
+ export { ButtonObject as t };
24
+ //# sourceMappingURL=renderFormCheck-DZh_5Df8.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./FormHelp-AE6_iSLJ.js";import{t as n}from"./FormLabel-CYcQiFUI.js";import r from"react";import i from"classnames";const a=({children:a,className:o,help:s,ids:c={},invalid:l,invalidFeedback:u,label:d,ref:f,valid:p,validFeedback:m})=>{let h=!!(l&&u),g=!!(p&&m)&&!h;return!d&&!s&&!u&&!m&&!o?a:r.createElement(`div`,{className:i(`form-field`,o),ref:f},d&&r.createElement(n,{htmlFor:c.input,id:c.label},d),a,s&&r.createElement(t,{id:c.help},s),h&&r.createElement(e,{id:c.feedback,invalid:!0},u),g&&r.createElement(e,{id:c.feedback,valid:!0},m))};export{a as t};
2
+ //# sourceMappingURL=renderFormField-Brkw1yA6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderFormField-Brkw1yA6.js","names":[],"sources":["../../src/components/form-field/renderFormField.tsx"],"sourcesContent":["import React, { ReactNode, Ref } from 'react'\nimport classNames from 'classnames'\n\nimport { FormFeedback } from '../form/FormFeedback'\nimport { FormHelp } from '../form/FormHelp'\nimport { FormLabel } from '../form/FormLabel'\n\nexport interface FormFieldIds {\n feedback?: string\n help?: string\n input?: string\n /**\n * The label's own id, for controls with no single input to associate via `htmlFor` (e.g. a\n * multi-input group) — reference it from the control's own `aria-labelledby` instead.\n */\n label?: string\n}\n\nexport interface RenderFormFieldOptions {\n children: ReactNode\n className?: string\n help?: ReactNode\n ids?: FormFieldIds\n invalid?: boolean\n invalidFeedback?: ReactNode\n label?: ReactNode\n ref?: Ref<HTMLDivElement>\n valid?: boolean\n validFeedback?: ReactNode\n}\n\n// Shared `.form-field` grid wrapper for label/control/help/feedback — see\n// https://chassis-ui.com/css/docs/forms/form-field. Renders `children` bare when none of\n// label/help/validFeedback/invalidFeedback are set, so field-capable leaves stay drop-in\n// compatible until a consumer opts into the wrapping.\nexport const renderFormField = ({\n children,\n className,\n help,\n ids = {},\n invalid,\n invalidFeedback,\n label,\n ref,\n valid,\n validFeedback\n}: RenderFormFieldOptions): ReactNode => {\n // At most one feedback node renders, and `invalid` wins: both carry the same `ids.feedback`,\n // so rendering the pair (which `invalid` + `valid` set together used to do) put a duplicate id\n // in the DOM and left every control's `aria-describedby` pointing at an ambiguous target —\n // axe's `duplicate-id-aria`. `useFormField` only ever budgets one feedback id for the same\n // reason. Contradictory state, but nothing in the types rules it out and ten components route\n // through here.\n const showInvalidFeedback = Boolean(invalid && invalidFeedback)\n const showValidFeedback = Boolean(valid && validFeedback) && !showInvalidFeedback\n\n // `className` alone is enough to warrant the wrapper: it has nowhere else to land, and\n // returning `children` bare (the drop-in-compatibility path every field-capable leaf relies on\n // until a consumer opts into wrapping) silently dropped it. Only `FormField` — the standalone\n // \"wrap this yourself\" component — passes one, so this is exactly the case where the caller\n // asked for a `.form-field` element by hand.\n // Feedback that is given wraps the control whether or not it shows: a control whose validity\n // changes while it has focus (a `TimeField` typed out of its range) was otherwise moved into\n // the new wrapper, which remounts it, and focus fell to the page.\n if (!label && !help && !invalidFeedback && !validFeedback && !className) {\n return children\n }\n\n return (\n <div className={classNames('form-field', className)} ref={ref}>\n {label && (\n <FormLabel htmlFor={ids.input} id={ids.label}>\n {label}\n </FormLabel>\n )}\n {children}\n {help && <FormHelp id={ids.help}>{help}</FormHelp>}\n {showInvalidFeedback && (\n <FormFeedback id={ids.feedback} invalid>\n {invalidFeedback}\n </FormFeedback>\n )}\n {showValidFeedback && (\n <FormFeedback id={ids.feedback} valid>\n {validFeedback}\n </FormFeedback>\n )}\n </div>\n )\n}\n"],"mappings":"wIAmCA,MAAa,GAAmB,CAC9B,WACA,YACA,OACA,MAAM,CAAC,EACP,UACA,kBACA,QACA,MACA,QACA,mBACuC,CAOvC,IAAM,EAAsB,GAAQ,GAAW,GACzC,EAAoB,GAAQ,GAAS,IAAkB,CAAC,EAc9D,MAJI,CAAC,GAAS,CAAC,GAAQ,CAAC,GAAmB,CAAC,GAAiB,CAAC,EACrD,EAIP,EAAA,cAAC,MAAD,CAAK,UAAW,EAAW,aAAc,CAAS,EAAQ,KAkBrD,EAjBF,GACC,EAAA,cAAC,EAAD,CAAW,QAAS,EAAI,MAAO,GAAI,EAAI,KAE5B,EADR,CACQ,EAEZ,EACA,GAAQ,EAAA,cAAC,EAAD,CAAU,GAAI,EAAI,IAAsB,EAAf,CAAe,EAChD,GACC,EAAA,cAAC,EAAD,CAAc,GAAI,EAAI,SAAU,QAAA,EAElB,EADX,CACW,EAEf,GACC,EAAA,cAAC,EAAD,CAAc,GAAI,EAAI,SAAU,MAAA,EAElB,EADX,CACW,CAEb,CAET"}
@@ -0,0 +1,15 @@
1
+ import { ReactNode, Ref } from "react";
2
+ //#region src/components/form-field/renderFormField.d.ts
3
+ interface FormFieldIds {
4
+ feedback?: string;
5
+ help?: string;
6
+ input?: string;
7
+ /**
8
+ * The label's own id, for controls with no single input to associate via `htmlFor` (e.g. a
9
+ * multi-input group) — reference it from the control's own `aria-labelledby` instead.
10
+ */
11
+ label?: string;
12
+ }
13
+ //#endregion
14
+ export { FormFieldIds as t };
15
+ //# sourceMappingURL=renderFormField-ChNagAFN.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./iconSlot-BNu2MrFI.js";import t from"react";const n=({icon:n,label:r,description:i,selected:a})=>n==null&&i==null&&!a?r:t.createElement(t.Fragment,null,n!=null&&t.createElement(`span`,{className:`menu-item-icon`,"aria-hidden":`true`},n),i==null?r:t.createElement(`span`,{className:`menu-item-content`},t.createElement(`span`,null,r),t.createElement(`small`,{className:`menu-item-description`},i)),a&&t.createElement(e,{icon:`check`,className:`menu-item-check`}));export{n as t};
2
+ //# sourceMappingURL=renderMenuItemContent-DUezZrpj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderMenuItemContent-DUezZrpj.js","names":[],"sources":["../../src/utils/renderMenuItemContent.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\n\nimport { IconSlot } from './iconSlot'\n\nexport interface MenuItemContentDef {\n /**\n * Icon rendered at the item's leading edge (`.menu-item-icon`).\n */\n icon?: ReactNode\n /**\n * Label content.\n */\n label: ReactNode\n /**\n * Secondary line of text rendered below the label (`.menu-item-description`).\n */\n description?: ReactNode\n /**\n * Renders a `.menu-item-check` at the trailing edge when true — `IconProvider`'s `check` icon.\n */\n selected?: boolean\n}\n\n// Chassis-css defines identical markup for rich item content in both Menu and Combobox items\n// (and, by extension, Autocomplete) — `.menu-item-icon` / `.menu-item-content` (label +\n// `.menu-item-description`) / `.menu-item-check`. Shared here so every consumer produces\n// byte-identical DOM instead of three near-duplicate implementations. Lives in `utils/` rather\n// than `components/menu/` because it crosses that folder boundary — Combobox.tsx and\n// Autocomplete.tsx both import it too. Renders bare `label` when there's nothing else to show,\n// keeping simple items' markup as minimal as chassis-css's own simplest example.\nexport const renderMenuItemContent = ({\n icon,\n label,\n description,\n selected\n}: MenuItemContentDef): ReactNode => {\n if (icon == null && description == null && !selected) return label\n\n return (\n <>\n {icon != null && (\n <span className=\"menu-item-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {description != null ? (\n <span className=\"menu-item-content\">\n <span>{label}</span>\n <small className=\"menu-item-description\">{description}</small>\n </span>\n ) : (\n label\n )}\n {selected && <IconSlot icon=\"check\" className=\"menu-item-check\" />}\n </>\n )\n}\n"],"mappings":"gEA8BA,MAAa,GAAyB,CACpC,OACA,QACA,cACA,cAEI,GAAQ,MAAQ,GAAe,MAAQ,CAAC,EAAiB,EAG3D,EAAA,cAAA,EAAA,SAAA,KACG,GAAQ,MACP,EAAA,cAAC,OAAD,CAAM,UAAU,iBAAiB,cAAY,MAEvC,EADH,CACG,EAEP,GAAe,KAMd,EALA,EAAA,cAAC,OAAD,CAAM,UAAU,mBAGV,EAFJ,EAAA,cAAC,OAAA,KAAM,CAAY,EACnB,EAAA,cAAC,QAAD,CAAO,UAAU,uBAA4C,EAAnB,CAAmB,CACzD,EAIP,GAAY,EAAA,cAAC,EAAD,CAAU,KAAK,QAAQ,UAAU,iBAAmB,CAAA,CACjE"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./scrollspy-D_lPjb92.js";import t,{useCallback as n,useEffect as r,useMemo as i,useRef as a,useState as o}from"react";function s(e){return e?`current`in e?e.current:e:null}function c(e,t){let n=document.getElementById(e);return!n||t&&!t.contains(n)?null:n}function l(e,t){return e?e.endsWith(`%`)?Number.parseFloat(e)/100*t:Number.parseFloat(e)||0:0}function u(e,t){let n,r;e?(n=e.getBoundingClientRect().top+e.clientTop,r=e.clientHeight):(n=0,r=document.documentElement.clientHeight);let i=t.trim().split(/\s+/),a=i[0],o=i.length>=3?i[2]:i[0];return{top:n-l(a,r),bottom:n+r+l(o,r)}}function d(e,t){let n=null,r=null,i=!1;for(let a of e){let e=a.getBoundingClientRect();(e.width!==0||e.height!==0)&&(e.top>=t.bottom||(n===null&&(n=a.id,i=e.top>=t.top),r=a.id))}return i?{id:n,atStart:i}:{id:r,atStart:i}}function f(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function p(e,t={}){let{root:n,rootMargin:i=`0px 0px -25%`}=t,[a,l]=o(null),p=e.join(`\0`),[m,h]=o(0);return r(()=>{let e=p?p.split(`\0`):[];if(!e.length||typeof IntersectionObserver>`u`){l(null);return}let t=s(n),r=t??window,a=[],o=!1,m=()=>{let{id:e,atStart:n}=d(a,u(t,i));l(e),n!==o&&(o=n,n?r.addEventListener(`scroll`,_,{passive:!0}):r.removeEventListener(`scroll`,_))},g=0,_=()=>{g||=requestAnimationFrame(()=>{g=0,m()})},v=new IntersectionObserver(m,{root:t,rootMargin:i,threshold:[0,1]}),y=()=>{let n=e.map(e=>c(e,t)).filter(e=>e!==null).sort(f);if(n.length===a.length&&n.every((e,t)=>e===a[t]))return!1;for(let e of a)n.includes(e)||v.unobserve(e);for(let e of n)a.includes(e)||v.observe(e);return a=n,!0};y()||m();let b=0,x=new MutationObserver(()=>{b||=requestAnimationFrame(()=>{if(b=0,s(n)!==t){h(e=>e+1);return}y()&&m()})});return x.observe(document.body,{attributeFilter:[`id`],childList:!0,subtree:!0}),r.addEventListener(`scrollend`,m),()=>{v.disconnect(),x.disconnect(),cancelAnimationFrame(b),cancelAnimationFrame(g),r.removeEventListener(`scrollend`,m),r.removeEventListener(`scroll`,_)}},[p,n,i,m]),a}function m(e){let t=e.getAttribute(`href`);if(!t||!t.includes(`#`))return null;let n;try{n=new URL(t,document.baseURI)}catch{return null}let r=new URL(window.location.href);if(n.origin!==r.origin||n.pathname!==r.pathname||n.search!==r.search||n.hash.length<2)return null;try{return decodeURIComponent(n.hash.slice(1))}catch{return n.hash.slice(1)}}function h(e){let t=[],n=new Set([e]),r=[e];for(;r.length;){let e=r.shift(),i,a=e.classList.contains(`menu-item`)?e.closest(`.menu`):null;if(a){let e=a.getAttribute(`aria-labelledby`);i=e&&document.getElementById(e)||a.previousElementSibling||null}else{let t=e.parentElement?.closest(`.nav, .list`)?.previousElementSibling??null;for(;t&&!t.matches(`.nav-link, .list-item`);)t=t.previousElementSibling;i=t}i&&!n.has(i)&&(n.add(i),t.push(i),r.push(i))}return t}function g(){return typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function _(e,t){let n=g()?`auto`:`smooth`,r=Number.parseFloat(getComputedStyle(e).scrollMarginTop)||0,i=Number.parseFloat(getComputedStyle(t??document.documentElement).scrollPaddingTop)||0,a=e.getBoundingClientRect().top-r-i;if(t){let e=a-t.getBoundingClientRect().top-t.clientTop+t.scrollTop;t.scrollTo({top:e,behavior:n})}else window.scrollTo({top:a+window.scrollY,behavior:n})}function v({children:l,onActiveChange:u,root:d,rootMargin:f,smoothScroll:g=!1}){let v=a(new Map),[y,b]=o(0),[x,S]=o([]),C=n((e,t)=>{v.current.set(e,t),b(e=>e+1);let n=new MutationObserver(()=>b(e=>e+1));return n.observe(e,{attributeFilter:[`href`]}),()=>{n.disconnect(),v.current.delete(e),t(!1),b(e=>e+1)}},[]);r(()=>{let e=[];for(let t of v.current.keys()){let n=m(t);n!==null&&!e.includes(n)&&e.push(n)}S(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[y]);let w=p(x,{root:d,rootMargin:f});r(()=>{let e=new Map;if(w!==null){for(let t of v.current.keys())m(t)===w&&e.set(t,`current`);for(let t of[...e.keys()])for(let n of h(t))v.current.has(n)&&!e.has(n)&&e.set(n,`parent`)}for(let[t,n]of v.current)n(e.get(t)??!1)},[w,y]);let T=a(u),E=a(null);r(()=>{T.current=u}),r(()=>{E.current!==w&&(E.current=w,T.current?.(w))},[w]);let D=a({root:d,smoothScroll:g});r(()=>{D.current={root:d,smoothScroll:g}});let O=n(e=>{let{root:t,smoothScroll:n}=D.current;if(!n||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let r=m(e.currentTarget),i=s(t),a=r===null?null:c(r,i);a&&(e.preventDefault(),_(a,i))},[]),k=i(()=>({register:C,onLinkClick:O}),[C,O]);return t.createElement(e.Provider,{value:k},l)}v.displayName=`Scrollspy`;export{p as n,v as t};
2
+ //# sourceMappingURL=scrollspy-C2HmrnZ4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollspy-C2HmrnZ4.js","names":[],"sources":["../../src/components/scrollspy/useScrollspy.ts","../../src/components/scrollspy/Scrollspy.tsx"],"sourcesContent":["import { RefObject, useEffect, useState } from 'react'\n\nexport interface UseScrollspyOptions {\n /**\n * The element that scrolls, or a ref to it. The viewport when unset.\n */\n root?: Element | RefObject<Element | null> | null\n /**\n * The margin around `root`, as `IntersectionObserver` takes it: one to four lengths in `px` or\n * `%`. Its bottom edge is the line a section's top has to pass to become the active one;\n * `-25%` puts it a quarter of the root's height above the root's bottom.\n *\n * @default '0px 0px -25%'\n */\n rootMargin?: string\n}\n\nexport const DEFAULT_ROOT_MARGIN = '0px 0px -25%'\n\n/**\n * The element `root` names: the element itself, or what a ref holds. `null` for the viewport.\n */\nexport function resolveRoot(root: UseScrollspyOptions['root']): Element | null {\n if (!root) return null\n return 'current' in root ? root.current : root\n}\n\n/**\n * The section with this `id`, when it is inside `root` (anywhere in the document for the\n * viewport).\n */\nexport function findSection(id: string, root: Element | null): HTMLElement | null {\n const section = document.getElementById(id)\n if (!section || (root && !root.contains(section))) return null\n return section\n}\n\ninterface Zone {\n top: number\n bottom: number\n}\n\n// A length of `rootMargin`: `px`, or `%` of the root's height.\nfunction marginLength(value: string | undefined, height: number): number {\n if (!value) return 0\n if (value.endsWith('%')) return (Number.parseFloat(value) / 100) * height\n return Number.parseFloat(value) || 0\n}\n\n// The root's box grown by `rootMargin` (shrunk, for negative lengths), in viewport coordinates:\n// the box an `IntersectionObserver` with the same options observes. A section's top crosses its\n// bottom edge, the activation line, exactly when the section starts or stops intersecting from\n// below, so the observer reports it.\nfunction activationZone(root: Element | null, rootMargin: string): Zone {\n let top: number\n let height: number\n if (root) {\n // The root's padding box: what an observer with an element root clips to.\n top = root.getBoundingClientRect().top + root.clientTop\n height = root.clientHeight\n } else {\n top = 0\n height = document.documentElement.clientHeight\n }\n const values = rootMargin.trim().split(/\\s+/)\n const marginTop = values[0]\n const marginBottom = values.length >= 3 ? values[2] : values[0]\n return {\n top: top - marginLength(marginTop, height),\n bottom: top + height + marginLength(marginBottom, height)\n }\n}\n\ninterface Pick {\n id: string | null\n /**\n * The first section is active because its top is still in the zone. Leaving that state is a\n * scroll the observer doesn't always report (see `useScrollspy`).\n */\n atStart: boolean\n}\n\n/**\n * The id of the last section, in document order, whose top has passed the activation line, or\n * `null` when none has. While the first of those hasn't scrolled past the top of the zone, the\n * reader is at its start, and it is the active one: at the top of a page of short sections,\n * several have passed the line before anything scrolled. A section that isn't rendered\n * (`display: none`) takes no part.\n */\nfunction pickActive(sections: readonly HTMLElement[], zone: Zone): Pick {\n let first: string | null = null\n let last: string | null = null\n let atStart = false\n for (const section of sections) {\n const rect = section.getBoundingClientRect()\n if (rect.width === 0 && rect.height === 0) continue\n if (rect.top >= zone.bottom) continue\n if (first === null) {\n first = section.id\n atStart = rect.top >= zone.top\n }\n last = section.id\n }\n return atStart ? { id: first, atStart } : { id: last, atStart }\n}\n\nfunction inDocumentOrder(a: Node, b: Node): number {\n return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n}\n\n// A separator no id contains, to depend on the ids' values rather than the array's identity.\nconst SEPARATOR = '\\u0000'\n\n/**\n * Tracks which of the sections named by `ids` the reader is in, as a scrollspy does: the last\n * section, in document order, whose top has scrolled past a line near the bottom of `root` (set\n * by `rootMargin`), or the first one while its top is still in view at the top of `root`. Returns\n * its id, or `null` when no section has reached the line yet.\n *\n * It returns `null` on the server and on the first render in the browser, so hydration matches,\n * and the active id from the first observation after that. Sections added, removed or renamed\n * later are picked up; an id with no element in `root` is ignored.\n */\nexport function useScrollspy(\n ids: readonly string[],\n options: UseScrollspyOptions = {}\n): string | null {\n const { root, rootMargin = DEFAULT_ROOT_MARGIN } = options\n const [activeId, setActiveId] = useState<string | null>(null)\n const key = ids.join(SEPARATOR)\n // Bumped when `root` names another element than the one observed: a ref's element can mount\n // after the hook's effect ran, or be replaced, without anything rendering the hook again.\n const [generation, setGeneration] = useState(0)\n\n useEffect(() => {\n const idList = key ? key.split(SEPARATOR) : []\n if (!idList.length || typeof IntersectionObserver === 'undefined') {\n setActiveId(null)\n return\n }\n const rootElement = resolveRoot(root)\n const scroller: EventTarget = rootElement ?? window\n let sections: HTMLElement[] = []\n let followingScroll = false\n\n const update = () => {\n const { id, atStart } = pickActive(sections, activationZone(rootElement, rootMargin))\n setActiveId(id)\n // The first section stops being active when its top leaves the top of the zone. The\n // observer reports that only for a section that was wholly inside the zone (its threshold\n // of 1), which a section holding the others, or wider than the root, never is. So while\n // it is active for that reason, every scroll measures again.\n if (atStart !== followingScroll) {\n followingScroll = atStart\n if (atStart) scroller.addEventListener('scroll', onScroll, { passive: true })\n else scroller.removeEventListener('scroll', onScroll)\n }\n }\n\n let scrollFrame = 0\n const onScroll = () => {\n if (scrollFrame) return\n scrollFrame = requestAnimationFrame(() => {\n scrollFrame = 0\n update()\n })\n }\n\n // Called for every change of an intersection. The entries alone aren't enough: a section\n // that a jump scrolls from below the root to above it never intersects, and isn't reported.\n // So every section is measured again. A threshold of 1 also reports a section that starts\n // leaving the top of the zone, which ends the start of the first one (see `pickActive`).\n const observer = new IntersectionObserver(update, {\n root: rootElement,\n rootMargin,\n threshold: [0, 1]\n })\n\n // Returns whether the sections changed.\n const resolve = () => {\n const next = idList\n .map((id) => findSection(id, rootElement))\n .filter((section): section is HTMLElement => section !== null)\n .sort(inDocumentOrder)\n if (next.length === sections.length && next.every((section, i) => section === sections[i])) {\n return false\n }\n for (const section of sections) if (!next.includes(section)) observer.unobserve(section)\n for (const section of next) if (!sections.includes(section)) observer.observe(section)\n sections = next\n return true\n }\n\n // The observer reports each section once when it starts observing it, which sets the first\n // active id. With no section found, nothing would report, so that case updates here.\n if (!resolve()) update()\n\n // Sections rendered, removed or renamed later, such as content loaded after the links, and\n // a `root` ref whose element mounts later or is replaced. The whole document is watched, since\n // a replaced root is no longer in the one observed.\n let mutationFrame = 0\n const mutations = new MutationObserver(() => {\n if (mutationFrame) return\n mutationFrame = requestAnimationFrame(() => {\n mutationFrame = 0\n if (resolveRoot(root) !== rootElement) {\n setGeneration((value) => value + 1)\n return\n }\n if (resolve()) update()\n })\n })\n mutations.observe(document.body, {\n attributeFilter: ['id'],\n childList: true,\n subtree: true\n })\n\n // What a jump between two places with no section in view leaves out: nothing intersects\n // before or after it, so the observer has nothing to report. Where `scrollend` exists, the\n // end of every scroll measures again.\n scroller.addEventListener('scrollend', update)\n\n return () => {\n observer.disconnect()\n mutations.disconnect()\n cancelAnimationFrame(mutationFrame)\n cancelAnimationFrame(scrollFrame)\n scroller.removeEventListener('scrollend', update)\n scroller.removeEventListener('scroll', onScroll)\n }\n }, [key, root, rootMargin, generation])\n\n return activeId\n}\n","import React, {\n MouseEvent,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react'\n\nimport { ScrollspyContext, ScrollspyController, ScrollspyMark } from '../../utils/scrollspy'\nimport { findSection, resolveRoot, useScrollspy, UseScrollspyOptions } from './useScrollspy'\n\nexport interface ScrollspyProps extends UseScrollspyOptions {\n /**\n * The navigation whose links are marked: a `Nav`, a `List`, `Link`s, or anything holding them.\n */\n children?: ReactNode\n /**\n * Fires when the active section changes, with its id, or `null` when no section is active.\n */\n onActiveChange?: (id: string | null) => void\n /**\n * Scrolls smoothly to a section when one of the links is clicked, instead of jumping to it. The\n * page's address doesn't change. When the reader asks for reduced motion, it jumps.\n *\n * @default false\n */\n smoothScroll?: boolean\n}\n\n// The section a link points to: its fragment, when it points into the current page.\nfunction linkTarget(element: Element): string | null {\n const href = element.getAttribute('href')\n if (!href || !href.includes('#')) return null\n let url: URL\n try {\n url = new URL(href, document.baseURI)\n } catch {\n // Not a URL a browser could follow either, such as `http://#top`.\n return null\n }\n const page = new URL(window.location.href)\n if (url.origin !== page.origin || url.pathname !== page.pathname || url.search !== page.search) {\n return null\n }\n if (url.hash.length < 2) return null\n try {\n return decodeURIComponent(url.hash.slice(1))\n } catch {\n return url.hash.slice(1)\n }\n}\n\nconst LIST = '.nav, .list'\nconst LIST_LINK = '.nav-link, .list-item'\n\n// The links a marked link belongs under, as chassis-css's plugin finds them: the toggle of the\n// menu a menu item is in, and the link just before a nested `.nav` or `.list`. Each of those is\n// followed up in turn, so every level of a nested navigation is marked.\nfunction parentsOf(element: Element): Element[] {\n const parents: Element[] = []\n const seen = new Set<Element>([element])\n const queue = [element]\n while (queue.length) {\n const current = queue.shift() as Element\n let parent: Element | null\n const menu = current.classList.contains('menu-item') ? current.closest('.menu') : null\n if (menu) {\n // A `Menu`'s list is labelled by its toggle, wherever the list is rendered.\n const labelledBy = menu.getAttribute('aria-labelledby')\n parent =\n (labelledBy && document.getElementById(labelledBy)) || menu.previousElementSibling || null\n } else {\n const list = current.parentElement?.closest(LIST)\n let sibling = list?.previousElementSibling ?? null\n while (sibling && !sibling.matches(LIST_LINK)) sibling = sibling.previousElementSibling\n parent = sibling\n }\n if (parent && !seen.has(parent)) {\n seen.add(parent)\n parents.push(parent)\n queue.push(parent)\n }\n }\n return parents\n}\n\nfunction prefersReducedMotion(): boolean {\n return (\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n )\n}\n\n// Where a section lands, as a jump to it would put it: below the scroll container's\n// `scroll-padding-top` (a sticky header's usual fix) and the section's own `scroll-margin-top`.\nfunction scrollToSection(section: HTMLElement, root: Element | null) {\n const behavior: ScrollBehavior = prefersReducedMotion() ? 'auto' : 'smooth'\n const margin = Number.parseFloat(getComputedStyle(section).scrollMarginTop) || 0\n const padding =\n Number.parseFloat(getComputedStyle(root ?? document.documentElement).scrollPaddingTop) || 0\n const offset = section.getBoundingClientRect().top - margin - padding\n if (root) {\n const top = offset - root.getBoundingClientRect().top - root.clientTop + root.scrollTop\n root.scrollTo({ top, behavior })\n } else {\n window.scrollTo({ top: offset + window.scrollY, behavior })\n }\n}\n\n/**\n * Marks the link to the section being read as active, in the navigation it wraps. The links are\n * `Link`s and the components built on it (`NavLink`, `ListItem`, `MenuItem`) whose `href` points\n * to an element's `id` on the page. It renders no element of its own.\n */\nexport function Scrollspy({\n children,\n onActiveChange,\n root,\n rootMargin,\n smoothScroll = false\n}: ScrollspyProps): ReactElement {\n const links = useRef(new Map<Element, (mark: ScrollspyMark) => void>())\n // Bumped when a link comes or goes, which changes the sections to observe and the marks.\n const [version, setVersion] = useState(0)\n const [ids, setIds] = useState<string[]>([])\n\n const register = useCallback<ScrollspyController['register']>((element, setMark) => {\n links.current.set(element, setMark)\n setVersion((value) => value + 1)\n // A link's target can change without its component rendering with another `href`: the\n // element given with `asChild` has it, and a router link renders it from `to`.\n const targetChanges = new MutationObserver(() => setVersion((value) => value + 1))\n targetChanges.observe(element, { attributeFilter: ['href'] })\n return () => {\n targetChanges.disconnect()\n links.current.delete(element)\n setMark(false)\n setVersion((value) => value + 1)\n }\n }, [])\n\n // The targets are read from the elements, which is where a link given with `asChild` or a\n // router link has its `href`.\n useEffect(() => {\n const next: string[] = []\n for (const element of links.current.keys()) {\n const id = linkTarget(element)\n if (id !== null && !next.includes(id)) next.push(id)\n }\n setIds((previous) =>\n previous.length === next.length && previous.every((id, i) => id === next[i]) ? previous : next\n )\n }, [version])\n\n const activeId = useScrollspy(ids, { root, rootMargin })\n\n useEffect(() => {\n const marks = new Map<Element, ScrollspyMark>()\n if (activeId !== null) {\n for (const element of links.current.keys()) {\n if (linkTarget(element) === activeId) marks.set(element, 'current')\n }\n for (const element of [...marks.keys()]) {\n for (const parent of parentsOf(element)) {\n if (links.current.has(parent) && !marks.has(parent)) marks.set(parent, 'parent')\n }\n }\n }\n for (const [element, setMark] of links.current) setMark(marks.get(element) ?? false)\n }, [activeId, version])\n\n const onActiveChangeRef = useRef(onActiveChange)\n const reportedRef = useRef<string | null>(null)\n useEffect(() => {\n onActiveChangeRef.current = onActiveChange\n })\n useEffect(() => {\n if (reportedRef.current === activeId) return\n reportedRef.current = activeId\n onActiveChangeRef.current?.(activeId)\n }, [activeId])\n\n const optionsRef = useRef({ root, smoothScroll })\n useEffect(() => {\n optionsRef.current = { root, smoothScroll }\n })\n\n const onLinkClick = useCallback((event: MouseEvent<Element>) => {\n const { root, smoothScroll } = optionsRef.current\n if (\n !smoothScroll ||\n event.defaultPrevented ||\n event.button !== 0 ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey\n ) {\n return\n }\n const id = linkTarget(event.currentTarget)\n const rootElement = resolveRoot(root)\n const section = id === null ? null : findSection(id, rootElement)\n if (!section) return\n event.preventDefault()\n scrollToSection(section, rootElement)\n }, [])\n\n const controller = useMemo<ScrollspyController>(\n () => ({ register, onLinkClick }),\n [register, onLinkClick]\n )\n\n return <ScrollspyContext.Provider value={controller}>{children}</ScrollspyContext.Provider>\n}\n\nScrollspy.displayName = 'Scrollspy'\n"],"mappings":"0KAsBA,SAAgB,EAAY,EAAmD,CAE7E,OADK,EACE,YAAa,EAAO,EAAK,QAAU,EADxB,IAEpB,CAMA,SAAgB,EAAY,EAAY,EAA0C,CAChF,IAAM,EAAU,SAAS,eAAe,CAAE,EAE1C,MADI,CAAC,GAAY,GAAQ,CAAC,EAAK,SAAS,CAAO,EAAW,KACnD,CACT,CAQA,SAAS,EAAa,EAA2B,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,cAAa,CAAC,EAChD,MAAgB,CACd,EAAW,QAAU,CAAE,OAAM,cAAa,CAC5C,CAAC,EAED,IAAM,EAAc,EAAa,GAA+B,CAC9D,GAAM,CAAE,OAAM,gBAAiB,EAAW,QAC1C,GACE,CAAC,GACD,EAAM,kBACN,EAAM,SAAW,GACjB,EAAM,SACN,EAAM,SACN,EAAM,UACN,EAAM,OAEN,OAEF,IAAM,EAAK,EAAW,EAAM,aAAa,EACnC,EAAc,EAAY,CAAI,EAC9B,EAAU,IAAO,KAAO,KAAO,EAAY,EAAI,CAAW,EAC3D,IACL,EAAM,eAAe,EACrB,EAAgB,EAAS,CAAW,EACtC,EAAG,CAAC,CAAC,EAEC,EAAa,OACV,CAAE,WAAU,aAAY,GAC/B,CAAC,EAAU,CAAW,CACxB,EAEA,OAAO,EAAA,cAAC,EAAiB,SAAlB,CAA2B,MAAO,CAAiD,EAApC,CAAoC,CAC5F,CAEA,EAAU,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{createContext as e,useContext as t,useEffect as n,useState as r}from"react";const i=e(null);function a(e){let a=t(i),[o,s]=r(!1),[c,l]=r(null);return n(()=>{if(a&&c&&!e)return a.register(c,s)},[a,c,e]),a?{mark:!e&&o,ref:l,onClick:a.onLinkClick}:{mark:!1}}export{a as n,i as t};
2
+ //# sourceMappingURL=scrollspy-D_lPjb92.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollspy-D_lPjb92.js","names":[],"sources":["../../src/utils/scrollspy.ts"],"sourcesContent":["import { createContext, MouseEvent, RefCallback, useContext, useEffect, useState } from 'react'\n\n// How `Scrollspy` (`components/scrollspy`) and the links inside it work together.\n//\n// chassis-css's plugin finds the links in its target with a selector and toggles their `.active`\n// class. Here a link's markup belongs to React, so each `Link` inside a `Scrollspy` registers its\n// element and a setter instead, and renders the mark it is given. `NavLink`, `ListItem` and\n// `MenuItem` render through `Link`, so they take part without code of their own; so does a\n// `MenuToggle` rendered as a `NavLink`, which is marked as the parent of its menu's items.\n//\n// This lives here, not in `components/scrollspy`, so that `Link` imports a context and a hook and\n// nothing else: the observer and the rest stay out of the bundle of a page with no `Scrollspy`.\n\n/**\n * What a link shows: `'current'` for a link to the active section, `'parent'` for the link its\n * nested list or menu belongs to, `false` for any other.\n */\nexport type ScrollspyMark = 'current' | 'parent' | false\n\nexport interface ScrollspyController {\n /**\n * Adds a link's element. Returns the function that removes it.\n */\n register: (element: Element, setMark: (mark: ScrollspyMark) => void) => () => void\n /**\n * A link's click, after its own `onClick`: scrolls to the section smoothly, when the\n * `Scrollspy` is set to.\n */\n onLinkClick: (event: MouseEvent<Element>) => void\n}\n\nexport const ScrollspyContext = createContext<ScrollspyController | null>(null)\n\nexport interface ScrollspyLink {\n mark: ScrollspyMark\n /**\n * For the link's element, inside a `Scrollspy`.\n */\n ref?: RefCallback<Element>\n onClick?: (event: MouseEvent<Element>) => void\n}\n\n/**\n * A link's part in the nearest `Scrollspy`. Outside one, it returns no mark, no ref and no handler.\n * A disabled link takes no part, as under chassis-css's plugin. The `Scrollspy` reads the target\n * from the element, where a link given with `asChild` has it too, and follows it when it changes.\n */\nexport function useScrollspyLink(disabled: boolean | undefined): ScrollspyLink {\n const spy = useContext(ScrollspyContext)\n const [mark, setMark] = useState<ScrollspyMark>(false)\n const [element, setElement] = useState<Element | null>(null)\n\n useEffect(() => {\n if (!spy || !element || disabled) return\n return spy.register(element, setMark)\n }, [spy, element, disabled])\n\n if (!spy) return { mark: false }\n return { mark: disabled ? false : mark, ref: setElement, onClick: spy.onLinkClick }\n}\n"],"mappings":"mFA+BA,MAAa,EAAmB,EAA0C,IAAI,EAgB9E,SAAgB,EAAiB,EAA8C,CAC7E,IAAM,EAAM,EAAW,CAAgB,EACjC,CAAC,EAAM,GAAW,EAAwB,EAAK,EAC/C,CAAC,EAAS,GAAc,EAAyB,IAAI,EAQ3D,OANA,MAAgB,CACV,GAAC,GAAQ,GAAW,GACxB,OAAO,EAAI,SAAS,EAAS,CAAO,CACtC,EAAG,CAAC,EAAK,EAAS,CAAQ,CAAC,EAEtB,EACE,CAAE,KAAM,IAAmB,EAAM,IAAK,EAAY,QAAS,EAAI,WAAY,EADjE,CAAE,KAAM,EAAM,CAEjC"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useForkedRef-DVEfT-KI.js";import{t}from"./useFormField-BOqmBTC4.js";import{t as n}from"./iconSlot-BNu2MrFI.js";import{t as r}from"./renderFormField-Brkw1yA6.js";import{t as i}from"./validationClassName-gRGs4KBm.js";import{r as a,t as o}from"./unhandledProps-9Kdj7WVf.js";import s,{forwardRef as c,useRef as l}from"react";import u from"classnames";import{mergeProps as d,useButton as f,useSearchField as p}from"react-aria";import{useSearchFieldState as m}from"react-stately";function h({ariaLabel:e,buttonProps:t,icon:r}){let i=l(null),{buttonProps:a}=f({...t,"aria-label":e??t[`aria-label`]},i);return s.createElement(`button`,{...a,className:`button icon-only input-adorn search-field-clear`,ref:i},s.createElement(n,{icon:`clear`,override:r}))}const g=c(({className:c,clearAriaLabel:f,clearIcon:g,defaultValue:_,disabled:v,help:y,id:b,invalid:x,invalidFeedback:S,label:C,onChange:w,onClear:T,onSubmit:E,readOnly:D,searchIcon:O,size:k,style:A,valid:j,validFeedback:M,value:N,...P},F)=>{let I=l(null),L=e(F,I),{describedBy:R,feedbackId:z,helpId:B,inputId:V,labelId:H,labelledBy:U}=t({ariaDescribedBy:P[`aria-describedby`],ariaLabelledBy:P[`aria-labelledby`],help:y,id:b,invalid:x,invalidFeedback:S,label:C,valid:j,validFeedback:M}),W={...P,"aria-describedby":R,"aria-labelledby":U,defaultValue:_,id:V,isDisabled:v,isInvalid:x,isReadOnly:D,onChange:w,onClear:T,onSubmit:E,value:N},G=m(W),{clearButtonProps:K,inputProps:q}=p(W,G,I);return r({children:s.createElement(`div`,{className:u(`form-input`,`search-field`,k,c),style:A},O!==!1&&s.createElement(`span`,{className:`input-adorn search-field-icon`},s.createElement(n,{icon:`search`,override:O})),s.createElement(`input`,{...a(d(q,{onKeyDown:e=>{let t=e.shiftKey||e.altKey||e.ctrlKey||e.metaKey;E&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(t||D)&&(e.preventDefault(),E(G.value))}}),P,o),"aria-describedby":R,className:u(`ghost-input`,i(x,j)),ref:L}),G.value!==``&&!v&&!D&&s.createElement(h,{ariaLabel:f,buttonProps:K,icon:g})),help:y,ids:{feedback:z,help:B,input:V,label:H},invalid:x,invalidFeedback:S,label:C,valid:j,validFeedback:M})});g.displayName=`SearchField`;export{g as t};
2
+ //# sourceMappingURL=search-field--nDoCI_E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-field--nDoCI_E.js","names":[],"sources":["../../src/components/search-field/SearchField.tsx"],"sourcesContent":["import React, {\n forwardRef,\n InputHTMLAttributes,\n KeyboardEvent,\n ReactNode,\n RefObject,\n useRef\n} from 'react'\nimport classNames from 'classnames'\nimport { AriaSearchFieldProps, mergeProps, useButton, useSearchField } from 'react-aria'\nimport { useSearchFieldState } from 'react-stately'\n\nimport './SearchField.scss'\nimport { useForkedRef, useFormField } from '../../hooks'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../../utils/iconSlot'\nimport { mergeUnhandledProps, TEXT_FIELD_PROPS } from '../../utils/unhandledProps'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { renderFormField } from '../form-field/renderFormField'\n\nexport interface SearchFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'defaultValue' | 'onChange' | 'onSubmit' | 'size' | 'type' | 'value'\n> {\n /**\n * The accessible name of the clear button. Defaults to react-aria's, in the locale's language\n * (\"Clear search\").\n */\n clearAriaLabel?: string\n /**\n * The icon of the clear button, in place of `IconProvider`'s `clear` icon.\n */\n clearIcon?: IconValue\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The value of the field, uncontrolled.\n */\n defaultValue?: string\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * A description for the field, rendered below it.\n */\n help?: ReactNode\n /**\n * Set component validation state to invalid.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below it when `invalid` is set.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with the input.\n */\n label?: ReactNode\n /**\n * Handler that is called when the value changes.\n */\n onChange?: (value: string) => void\n /**\n * Handler that is called when the field is cleared, by the clear button or the Escape key.\n */\n onClear?: () => void\n /**\n * Handler that is called when the Enter key is pressed, with the value. When set, Enter, with\n * or without a modifier key, no longer submits the input's form.\n */\n onSubmit?: (value: string) => void\n /**\n * Toggle the readonly state for the component.\n */\n readOnly?: boolean\n /**\n * The icon at the field's start, in place of `IconProvider`'s `search` icon. `false` leaves it\n * out.\n */\n searchIcon?: IconValue | false\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below it when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The value of the field, controlled.\n */\n value?: string\n}\n\n// The clear button. A `<button>` react-aria keeps out of the tab order, since Escape does the\n// same; a press leaves focus on the input.\nfunction ClearButton({\n ariaLabel,\n buttonProps,\n icon\n}: {\n ariaLabel?: string\n buttonProps: ReturnType<typeof useSearchField>['clearButtonProps']\n icon?: IconValue\n}) {\n const ref = useRef<HTMLButtonElement>(null)\n const { buttonProps: props } = useButton(\n { ...buttonProps, 'aria-label': ariaLabel ?? buttonProps['aria-label'] },\n ref as RefObject<HTMLButtonElement | null>\n )\n return (\n <button {...props} className=\"button icon-only input-adorn search-field-clear\" ref={ref}>\n <IconSlot icon=\"clear\" override={icon} />\n </button>\n )\n}\n\nexport const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n (\n {\n className,\n clearAriaLabel,\n clearIcon,\n defaultValue,\n disabled,\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n onChange,\n onClear,\n onSubmit,\n readOnly,\n searchIcon,\n size,\n style,\n valid,\n validFeedback,\n value,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n\n const { describedBy, feedbackId, helpId, inputId, labelId, labelledBy } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n ariaLabelledBy: rest['aria-labelledby'],\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n\n const fieldProps = {\n ...rest,\n 'aria-describedby': describedBy,\n 'aria-labelledby': labelledBy,\n defaultValue,\n id: inputId,\n isDisabled: disabled,\n isInvalid: invalid,\n isReadOnly: readOnly,\n onChange,\n onClear,\n onSubmit,\n value\n } as AriaSearchFieldProps\n const state = useSearchFieldState(fieldProps)\n const { clearButtonProps, inputProps } = useSearchField(fieldProps, state, inputRef)\n\n // react-aria's Enter shortcut matches Enter alone, and a read-only field has none, so with\n // `onSubmit` Shift+Enter, or Enter in a read-only field, would still submit the form.\n const submitProps = {\n onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => {\n const modified = event.shiftKey || event.altKey || event.ctrlKey || event.metaKey\n if (!onSubmit || event.key !== 'Enter' || event.nativeEvent.isComposing) return\n if (!modified && !readOnly) return\n event.preventDefault()\n onSubmit(state.value)\n }\n }\n\n return renderFormField({\n // The input adorn shape of chassis-css: a `.form-input` around a `.ghost-input`, which takes\n // the validation classes, with the icon and the clear button as `.input-adorn`s. `style`\n // goes on the wrapper, with `className`. `aria-describedby` after the spread: react-aria's\n // own adds ids it never renders (FORMS.md, gotcha 6).\n children: (\n <div className={classNames('form-input', 'search-field', size, className)} style={style}>\n {searchIcon !== false && (\n <span className=\"input-adorn search-field-icon\">\n <IconSlot icon=\"search\" override={searchIcon} />\n </span>\n )}\n <input\n {...mergeUnhandledProps(mergeProps(inputProps, submitProps), rest, TEXT_FIELD_PROPS)}\n aria-describedby={describedBy}\n className={classNames('ghost-input', validationClassName(invalid, valid))}\n ref={forkedRef}\n />\n {state.value !== '' && !disabled && !readOnly && (\n <ClearButton\n ariaLabel={clearAriaLabel}\n buttonProps={clearButtonProps}\n icon={clearIcon}\n />\n )}\n </div>\n ),\n help,\n ids: { feedback: feedbackId, help: helpId, input: inputId, label: labelId },\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n }\n)\n\nSearchField.displayName = 'SearchField'\n"],"mappings":"ghBAuGA,SAAS,EAAY,CACnB,YACA,cACA,QAKC,CACD,IAAM,EAAM,EAA0B,IAAI,EACpC,CAAE,YAAa,GAAU,EAC7B,CAAE,GAAG,EAAa,aAAc,GAAa,EAAY,aAAc,EACvE,CACF,EACA,OACE,EAAA,cAAC,SAAD,CAAQ,GAAI,EAAO,UAAU,kDAAuD,KAE5E,EADN,EAAA,cAAC,EAAD,CAAU,KAAK,QAAQ,SAAU,CAAO,CAAA,CAClC,CAEZ,CAEA,MAAa,EAAc,GAEvB,CACE,YACA,iBACA,YACA,eACA,WACA,OACA,KACA,UACA,kBACA,QACA,WACA,UACA,WACA,WACA,aACA,OACA,QACA,QACA,gBACA,QACA,GAAG,GAEL,IACG,CACH,IAAM,EAAW,EAAyB,IAAI,EACxC,EAAY,EAAa,EAAK,CAAQ,EAEtC,CAAE,cAAa,aAAY,SAAQ,UAAS,UAAS,cAAe,EAAa,CACrF,gBAAiB,EAAK,oBACtB,eAAgB,EAAK,mBACrB,OACA,KACA,UACA,kBACA,QACA,QACA,eACF,CAAC,EAEK,EAAa,CACjB,GAAG,EACH,mBAAoB,EACpB,kBAAmB,EACnB,eACA,GAAI,EACJ,WAAY,EACZ,UAAW,EACX,WAAY,EACZ,WACA,UACA,WACA,OACF,EACM,EAAQ,EAAoB,CAAU,EACtC,CAAE,mBAAkB,cAAe,EAAe,EAAY,EAAO,CAAQ,EAcnF,OAAO,EAAgB,CAKrB,SACE,EAAA,cAAC,MAAD,CAAK,UAAW,EAAW,aAAc,eAAgB,EAAM,CAAS,EAAU,OAmB7E,EAlBF,IAAe,IACd,EAAA,cAAC,OAAD,CAAM,UAAU,+BAEV,EADJ,EAAA,cAAC,EAAD,CAAU,KAAK,SAAS,SAAU,CAAa,CAAA,CAC3C,EAER,EAAA,cAAC,QAAD,CACE,GAAI,EAAoB,EAAW,EAAY,CAtBrD,UAAY,GAA2C,CACrD,IAAM,EAAW,EAAM,UAAY,EAAM,QAAU,EAAM,SAAW,EAAM,QACrE,GAAY,EAAM,MAAQ,SAAW,GAAM,YAAY,cACvD,GAAa,KAClB,EAAM,eAAe,EACrB,EAAS,EAAM,KAAK,EACtB,CAgB+D,CAAC,EAAG,EAAM,CAAgB,EACnF,mBAAkB,EAClB,UAAW,EAAW,cAAe,EAAoB,EAAS,CAAK,CAAC,EACxE,IAAK,CACN,CAAA,EACA,EAAM,QAAU,IAAM,CAAC,GAAY,CAAC,GACnC,EAAA,cAAC,EAAD,CACE,UAAW,EACX,YAAa,EACb,KAAM,CACP,CAAA,CAEA,EAEP,OACA,IAAK,CAAE,SAAU,EAAY,KAAM,EAAQ,MAAO,EAAS,MAAO,CAAQ,EAC1E,UACA,kBACA,QACA,QACA,eACF,CAAC,CACH,CACF,EAEA,EAAY,YAAc"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{v as e}from"./slot-CNhFZdHF.js";import{t}from"./useForkedRef-DVEfT-KI.js";import{t as n}from"./useFormField-BOqmBTC4.js";import{t as r}from"./renderFormField-Brkw1yA6.js";import{t as i}from"./validationClassName-gRGs4KBm.js";import a,{forwardRef as o,useRef as s}from"react";import c from"classnames";const l=o(({adornEnd:o,adornStart:l,children:u,className:d,help:f,htmlSize:p,id:m,invalid:h,invalidFeedback:g,label:_,multiple:v,options:y,placeholder:b,size:x,valid:S,validFeedback:C,...w},T)=>{let E=s(null),D=t(T,E),O=Array.isArray(y)?y.filter(e=>typeof e==`object`&&!!e.selected).map(e=>String(e.value??``)):[];e(!v&&O.length>1,"Select: more than one option has `selected: true` but `multiple` is not set — only the last one will be selected, matching native <select> behavior.");let k=O.length&&w.value===void 0&&w.defaultValue===void 0?v?O:O[O.length-1]:void 0,{describedBy:A,feedbackId:j,helpId:M,inputId:N}=n({ariaDescribedBy:w[`aria-describedby`],help:f,id:m,invalid:h,invalidFeedback:g,valid:S,validFeedback:C}),P=l!=null||o!=null,F=!v&&(!p||p<=1),I=c(P?`ghost-input`:`form-input`,!P&&x,i(h,S),!P&&d),L=e=>{let t=E.current,n=e.target;if(t&&!t.disabled&&F&&n!==t&&!n.closest(`button, a`)){t.focus();try{t.showPicker?.()}catch{}}},R=a.createElement(`select`,{...w,"aria-describedby":A,"aria-invalid":h||void 0,className:I,id:N,multiple:v,ref:D,size:p,...k!==void 0&&{defaultValue:k}},b&&a.createElement(`option`,{value:``,disabled:!0},b),y?y.map((e,t)=>a.createElement(`option`,{...typeof e==`object`&&e.disabled&&{disabled:e.disabled},...typeof e==`object`&&e.value!=null&&{value:e.value},key:t},typeof e==`string`?e:e.label??String(e.value??``))):u),z=P?a.createElement(`div`,{className:c(`form-input`,F&&`form-caret`,x,d),onClick:L},l,R,o):R;return r({children:z,help:f,ids:{feedback:j,help:M,input:N},invalid:h,invalidFeedback:g,label:_,valid:S,validFeedback:C})});l.displayName=`Select`;export{l as t};
2
+ //# sourceMappingURL=select-BwJIfv9f.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-BwJIfv9f.js","names":[],"sources":["../../src/components/select/Select.tsx"],"sourcesContent":["import React, {\n ChangeEventHandler,\n forwardRef,\n InputHTMLAttributes,\n MouseEventHandler,\n ReactNode,\n useRef\n} from 'react'\nimport classNames from 'classnames'\n\nimport { useForkedRef, useFormField } from '../../hooks'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { renderFormField } from '../form-field/renderFormField'\nimport { devWarning } from '../../utils/devWarning'\n\nexport interface SelectOptionDef {\n /**\n * Marks the option as disabled — it can't be clicked or reached via the keyboard.\n */\n disabled?: boolean\n /**\n * Label text rendered inside the option. Falls back to the browser's default (the `value`,\n * stringified) when omitted.\n */\n label?: string\n /**\n * Marks the option as selected by default (uncontrolled) — resolved into the select's own\n * `defaultValue`, and ignored when the select's `value`/`defaultValue` is set directly. Set on\n * more than one option only when `multiple` is also set on `Select` — otherwise, matching\n * native `<select>` behavior, only the last option with `selected` set wins.\n */\n selected?: boolean\n /**\n * The option's value attribute.\n */\n value?: string | number\n}\nexport interface SelectProps extends Omit<InputHTMLAttributes<HTMLSelectElement>, 'size'> {\n /**\n * Content rendered at the select's trailing edge, e.g. a `InputAdorn` icon, text, or button.\n * Setting either `adornStart` or `adornEnd` renders a `.form-input` wrapper around a\n * `.ghost-input`, matching chassis-css's [input help](https://chassis-ui.com/css/docs/forms/input-adorn) pattern.\n * Clicking anywhere in the wrapper (other than an actionable adorn) opens the select, since the\n * native element itself no longer fills the wrapper's full width.\n */\n adornEnd?: ReactNode\n /**\n * Content rendered at the select's leading edge, e.g. a `InputAdorn` icon, text, or button.\n * Setting either `adornStart` or `adornEnd` renders a `.form-input` wrapper around a\n * `.ghost-input`, matching chassis-css's [input help](https://chassis-ui.com/css/docs/forms/input-adorn) pattern.\n * Clicking anywhere in the wrapper (other than an actionable adorn) opens the select, since the\n * native element itself no longer fills the wrapper's full width.\n */\n adornStart?: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * A description for the field, rendered below the select.\n */\n help?: ReactNode\n /**\n * Specifies the number of visible options in a drop-down list.\n */\n htmlSize?: number\n /**\n * Set component validation state to invalid.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below the select when `invalid` is set.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with this select.\n */\n label?: ReactNode\n /**\n * Allows more than one option to be selected at once. Pass `value` as a string array (or set\n * `selected` on more than one `options` entry) to control the selection.\n */\n multiple?: boolean\n /**\n * Method called immediately after the `value` prop changes.\n */\n onChange?: ChangeEventHandler<HTMLSelectElement>\n /**\n * Options list of the select component. Available keys: `label`, `value`, `disabled`,\n * `selected`.\n * Examples:\n * - `options={[{ value: 'js', label: 'JavaScript' }, { value: 'html', label: 'HTML', disabled: true }]}`\n * - `options={['js', 'html']}`\n */\n options?: SelectOptionDef[] | string[]\n /**\n * Renders a disabled placeholder option as the first item (e.g. `\"Select a country…\"`).\n * The option has an empty value so it is not selectable once another option is chosen.\n */\n placeholder?: string\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below the select when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The `value` attribute of component.\n *\n * @controllable onChange\n * */\n value?: string | string[] | number\n}\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n adornEnd,\n adornStart,\n children,\n className,\n help,\n htmlSize,\n id,\n invalid,\n invalidFeedback,\n label,\n multiple,\n options,\n placeholder,\n size,\n valid,\n validFeedback,\n ...rest\n },\n ref\n ) => {\n const selectRef = useRef<HTMLSelectElement>(null)\n const forkedRef = useForkedRef(ref, selectRef)\n\n const selectedValues = Array.isArray(options)\n ? options\n .filter(\n (option): option is SelectOptionDef => typeof option === 'object' && !!option.selected\n )\n .map((option) => String(option.value ?? ''))\n : []\n\n devWarning(\n !multiple && selectedValues.length > 1,\n 'Select: more than one option has `selected: true` but `multiple` is not set — only ' +\n 'the last one will be selected, matching native <select> behavior.'\n )\n\n // React warns against setting `selected` directly on <option>, recommending `defaultValue`/\n // `value` on <select> instead — so `options[].selected` is resolved into a `defaultValue`\n // here rather than rendered as an attribute. Left alone when the caller already controls\n // `value`/`defaultValue` themselves.\n const inferredDefaultValue =\n selectedValues.length && rest.value === undefined && rest.defaultValue === undefined\n ? multiple\n ? selectedValues\n : selectedValues[selectedValues.length - 1]\n : undefined\n\n const { describedBy, feedbackId, helpId, inputId } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n help,\n id,\n invalid,\n invalidFeedback,\n valid,\n validFeedback\n })\n\n const hasAdorn = adornStart != null || adornEnd != null\n // A caret can only pop the dropdown open when the select actually renders as one - an inline\n // listbox (`multiple`, or a `size` greater than 1) has no picker to show.\n const isDropdown = !multiple && (!htmlSize || htmlSize <= 1)\n\n // chassis-css's `.form-input:has(.ghost-input.is-valid)` selector reads validation state off\n // the inner select, not the wrapper, once adorns turn `.form-input` into a flex container -\n // see https://chassis-ui.com/css/docs/forms/input-adorn.\n const selectClassName = classNames(\n hasAdorn ? 'ghost-input' : 'form-input',\n !hasAdorn && size,\n validationClassName(invalid, valid),\n !hasAdorn && className\n )\n\n const handleWrapperClick: MouseEventHandler<HTMLDivElement> = (event) => {\n const node = selectRef.current\n const target = event.target as HTMLElement\n if (!node || node.disabled || !isDropdown || target === node || target.closest('button, a'))\n return\n node.focus()\n try {\n // showPicker() opens the native dropdown from a proxy click; unsupported browsers fall\n // back to the focus() above, same as tabbing to a bare select and pressing Space/Down.\n node.showPicker?.()\n } catch {\n // Can throw without a user activation or under a policy-restricted embed - focus() still\n // leaves the select reachable via the keyboard.\n }\n }\n\n const select = (\n <select\n {...rest}\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n className={selectClassName}\n id={inputId}\n multiple={multiple}\n ref={forkedRef}\n size={htmlSize}\n {...(inferredDefaultValue !== undefined && { defaultValue: inferredDefaultValue })}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {options\n ? options.map((option, index) => {\n return (\n <option\n {...(typeof option === 'object' &&\n option.disabled && { disabled: option.disabled })}\n {...(typeof option === 'object' &&\n option.value != null && { value: option.value })}\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n >\n {typeof option === 'string'\n ? option\n : (option.label ?? String(option.value ?? ''))}\n </option>\n )\n })\n : children}\n </select>\n )\n\n const rendered = hasAdorn ? (\n <div\n className={classNames('form-input', isDropdown && 'form-caret', size, className)}\n onClick={handleWrapperClick}\n >\n {adornStart}\n {select}\n {adornEnd}\n </div>\n ) : (\n select\n )\n\n return renderFormField({\n children: rendered,\n help,\n ids: { feedback: feedbackId, help: helpId, input: inputId },\n invalid,\n invalidFeedback,\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AAE,aAAc,CAAqB,CAyB1E,EAvBL,GACC,EAAA,cAAC,SAAD,CAAQ,MAAM,GAAG,SAAA,EAET,EADL,CACK,EAET,EACG,EAAQ,KAAK,EAAQ,IAEjB,EAAA,cAAC,SAAD,CACE,GAAK,OAAO,GAAW,UACrB,EAAO,UAAY,CAAE,SAAU,EAAO,QAAS,EACjD,GAAK,OAAO,GAAW,UACrB,EAAO,OAAS,MAAQ,CAAE,MAAO,EAAO,KAAM,EAEhD,IAAK,CAKC,EAHL,OAAO,GAAW,SACf,EACC,EAAO,OAAS,OAAO,EAAO,OAAS,EAAE,CACxC,CAEX,EACD,CACE,EAGJ,EAAW,EACf,EAAA,cAAC,MAAD,CACE,UAAW,EAAW,aAAc,GAAc,aAAc,EAAM,CAAS,EAC/E,QAAS,CAKN,EAHF,EACA,EACA,CACE,EAEL,EAGF,OAAO,EAAgB,CACrB,SAAU,EACV,OACA,IAAK,CAAE,SAAU,EAAY,KAAM,EAAQ,MAAO,CAAQ,EAC1D,UACA,kBACA,QACA,QACA,eACF,CAAC,CACH,CACF,EAEA,EAAO,YAAc"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./breakpoints-o_2Ev7ir.js";import n,{Fragment as r,forwardRef as i}from"react";import a from"classnames";const o=(e,t)=>e===!0?`${t}flex-fill`:e===`auto`?`${t}w-auto`:typeof e==`number`||typeof e==`string`?Number(e)===12?`${t}w-100`:`${t}w-${e}/12`:null,s=(e,t)=>[o(e,t)];function c({children:e,animation:r,className:i,color:o,component:c,span:l,responsive:u,...d},f){let p=c??`span`,m=a(`skeleton`,r&&`skeleton-${r}`,{[`bg-${o}`]:o},t(s,l,u),i);return n.createElement(p,{className:m,...d,ref:f},e)}const l=e(c,`Skeleton`);function u({children:e,color:t,component:i,loading:a,spans:o,...s},c){if(!a)return n.createElement(n.Fragment,null,e);let u=o===void 0?[void 0]:Array.isArray(o)?o:[o];return n.createElement(n.Fragment,null,u.map((e,a)=>n.createElement(r,{key:a},a>0&&` `,n.createElement(l,{component:i,span:e,color:t,...s,ref:a===0?c:void 0}))))}const d=i(u);d.displayName=`SkeletonLoader`;export{l as n,d as t};
2
+ //# sourceMappingURL=skeleton-BrD2JwNx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton-BrD2JwNx.js","names":[],"sources":["../../src/components/skeleton/Skeleton.tsx","../../src/components/skeleton/SkeletonLoader.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { WidthSpan, buildResponsiveClassNames } from '../../utils/breakpoints'\nimport { Breakpoint, ContextColor } from '../../types'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype SkeletonOwnProps<C extends ElementType> = {\n /**\n * Adds `skeleton-{animation}` alongside the base `skeleton` class, so the element animates\n * itself as well as any nested `<Skeleton>` children. Nest plain `<Skeleton>` children inside\n * it for the glow pulse to reach them too, or apply `wave` to a container of one or more\n * `<Skeleton>` children for a directional sweep across the whole group.\n */\n animation?: 'glow' | 'wave'\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use an HTML element or a component —\n * e.g. `Avatar` or `Button`. Its own props are type-checked at the call site once passed here.\n *\n * @default 'span'\n */\n component?: C\n /**\n * Width of the skeleton in twelfths of its parent (`span={6}` is half, mapped to the\n * `w-{n}/12` class; `span={12}` is `w-100`), `'auto'` for its natural width (`w-auto`), or\n * `true` to fill the rest of a flex row (`flex-fill`). Unset by default, so the rendered\n * element's own intrinsic width applies — set it explicitly (e.g. `span={12}`) for a\n * full-width text line; leave it unset when `component` is something that sizes itself, like\n * `Avatar` or `Button`.\n *\n * @type { 'auto' | number | string | boolean }\n */\n span?: WidthSpan\n /**\n * Overrides `span` at a breakpoint and up.\n *\n * @type { Partial<Record<'sm' | 'md' | 'lg' | 'xl' | '2xl', 'auto' | number | string | boolean>> }\n */\n responsive?: Partial<Record<Breakpoint, WidthSpan>>\n}\n\nexport type SkeletonProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n SkeletonOwnProps<C>\n>\n\ntype SkeletonComponent = (<C extends ElementType = 'span'>(\n props: SkeletonProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// chassis-css has the fractions `w-1/12` to `w-11/12`; twelve twelfths is `w-100`.\nconst spanClassName = (span: WidthSpan | undefined, prefix: string) => {\n if (span === true) return `${prefix}flex-fill`\n if (span === 'auto') return `${prefix}w-auto`\n if (typeof span === 'number' || typeof span === 'string') {\n return Number(span) === 12 ? `${prefix}w-100` : `${prefix}w-${span}/12`\n }\n return null\n}\n\nconst spanClassNames = (span: WidthSpan | undefined, prefix: string) => [\n spanClassName(span, prefix)\n]\n\nfunction SkeletonRender<C extends ElementType = 'span'>(\n { children, animation, className, color, component, span, responsive, ...rest }: SkeletonProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames(\n 'skeleton',\n animation && `skeleton-${animation}`,\n { [`bg-${color}`]: color },\n buildResponsiveClassNames(spanClassNames, span, responsive),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Skeleton = createPolymorphicComponent<SkeletonComponent>(\n SkeletonRender as ForwardRefRenderFunction<Element, SkeletonProps<ElementType>>,\n 'Skeleton'\n)\n","import React, {\n ComponentPropsWithoutRef,\n ElementType,\n ForwardedRef,\n forwardRef,\n ForwardRefRenderFunction,\n Fragment,\n ReactElement,\n ReactNode\n} from 'react'\n\nimport { WidthSpan } from '../../utils/breakpoints'\nimport { PolymorphicRef } from '../../utils/polymorphic'\nimport { ContextColor } from '../../types'\nimport { Skeleton, SkeletonProps } from './Skeleton'\n\ntype SkeletonLoaderOwnProps<C extends ElementType> = {\n /**\n * The real content, rendered unchanged (no wrapping element) once `loading` is `false`.\n */\n children: ReactNode\n /**\n * Sets the color of the generated skeleton lines to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the generated skeleton(s) — e.g. `Avatar` or `Button` — for swapping\n * non-text content, not just text runs. Its own props are type-checked at the call site once\n * passed here, same as `Skeleton`'s own `component` prop.\n *\n * @default 'span'\n */\n component?: C\n /**\n * Swaps `children` for one `<Skeleton>` per entry in `spans` while `true`.\n */\n loading: boolean\n /**\n * One skeleton line per entry, using the same values as `Skeleton`'s `span` prop — e.g.\n * `[12, 6]` for a full-width line followed by a half-width one. A single value (e.g. `6`) is\n * shorthand for a single line, equivalent to `[6]`. Leave unset for a single skeleton sized by\n * `component`'s own intrinsic width instead — e.g. an `Avatar`'s `size` prop. Rendered instead\n * of `children` while `loading` is `true`; ignored once `loading` is `false`.\n *\n * @type { 'auto' | number | string | boolean | Array<'auto' | number | string | boolean> }\n */\n spans?: WidthSpan | WidthSpan[]\n}\n\n// Spelled out rather than `PolymorphicComponentProps`, which adds `asChild`: `SkeletonLoader`\n// renders no element of its own (it swaps its `children` for generated `Skeleton` lines), so\n// there's nothing for a child element to stand in for. (`Omit`-ing it from that type instead\n// breaks `C`'s inference from `component`.)\nexport type SkeletonLoaderProps<C extends ElementType = 'span'> = SkeletonLoaderOwnProps<C> &\n Omit<ComponentPropsWithoutRef<C>, keyof SkeletonLoaderOwnProps<C> | 'asChild'>\n\ntype SkeletonLoaderComponent = (<C extends ElementType = 'span'>(\n props: SkeletonLoaderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n/**\n * A pure content swap: no wrapping element of its own, so `.skeleton-glow`/`.skeleton-wave`\n * won't reach the lines it generates unless applied to a container already in the tree — see\n * `Skeleton`'s own docs for why the animation classes need a `.skeleton` descendant to animate.\n *\n * The ref goes to the first generated skeleton while `loading`, and is `null` once the real\n * content shows: that content is the caller's, with refs of its own.\n */\nfunction SkeletonLoaderRender<C extends ElementType = 'span'>(\n { children, color, component, loading, spans, ...rest }: SkeletonLoaderProps<C>,\n ref: ForwardedRef<Element>\n) {\n if (!loading) return <>{children}</>\n\n const spanList = spans === undefined ? [undefined] : Array.isArray(spans) ? spans : [spans]\n\n return (\n <>\n {spanList.map((span, index) => (\n // eslint-disable-next-line react/no-array-index-key -- `spans` is a static prop array\n <Fragment key={index}>\n {index > 0 && ' '}\n {/* `rest` is `C`'s own props minus `SkeletonLoaderOwnProps`'s keys, which structurally\n satisfies what `Skeleton<C>` wants (`C`'s own props minus its own, different, key\n set) — TS can't verify that across two independently-generic components, hence the\n cast. */}\n <Skeleton\n component={component}\n span={span}\n color={color}\n {...(rest as unknown as SkeletonProps<C>)}\n ref={index === 0 ? ref : undefined}\n />\n </Fragment>\n ))}\n </>\n )\n}\n\n// `forwardRef` takes a render function that isn't generic, so the generic type is cast back on,\n// as `createPolymorphicComponent` does.\nexport const SkeletonLoader = forwardRef(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n SkeletonLoaderRender as ForwardRefRenderFunction<Element, any>\n) as unknown as SkeletonLoaderComponent\n\nSkeletonLoader.displayName = 'SkeletonLoader'\n"],"mappings":"sMA+DA,MAAM,GAAiB,EAA6B,IAC9C,IAAS,GAAa,GAAG,EAAO,WAChC,IAAS,OAAe,GAAG,EAAO,QAClC,OAAO,GAAS,UAAY,OAAO,GAAS,SACvC,OAAO,CAAI,IAAM,GAAK,GAAG,EAAO,OAAS,GAAG,EAAO,IAAI,EAAK,KAE9D,KAGH,GAAkB,EAA6B,IAAmB,CACtE,EAAc,EAAM,CAAM,CAC5B,EAEA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,QAAO,YAAW,OAAM,aAAY,GAAG,GACzE,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EACjB,WACA,GAAa,YAAY,IACzB,EAAG,MAAM,KAAU,CAAM,EACzB,EAA0B,EAAgB,EAAM,CAAU,EAC1D,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAW,EACtB,EACA,UACF,EC/BA,SAAS,EACP,CAAE,WAAU,QAAO,YAAW,UAAS,QAAO,GAAG,GACjD,EACA,CACA,GAAI,CAAC,EAAS,OAAO,EAAA,cAAA,EAAA,SAAA,KAAG,CAAW,EAEnC,IAAM,EAAW,IAAU,IAAA,GAAY,CAAC,IAAA,EAAS,EAAI,MAAM,QAAQ,CAAK,EAAI,EAAQ,CAAC,CAAK,EAE1F,OACE,EAAA,cAAA,EAAA,SAAA,KACG,EAAS,KAAK,EAAM,IAEnB,EAAA,cAAC,EAAD,CAAU,IAAK,CAaL,EAZP,EAAQ,GAAK,IAKd,EAAA,cAAC,EAAD,CACa,YACL,OACC,QACP,GAAK,EACL,IAAK,IAAU,EAAI,EAAM,IAAA,EAC1B,CAAA,CACO,CACX,CACD,CAEN,CAIA,MAAa,EAAiB,EAE5B,CACF,EAEA,EAAe,YAAc"}
@@ -0,0 +1,2 @@
1
+ import{t as e}from"./useForkedRef-DVEfT-KI.js";import{n as t}from"./lazyElement-tfMG21pZ.js";import n,{Fragment as r,cloneElement as i,createContext as a,forwardRef as o,isValidElement as s,useContext as c}from"react";import{mergeProps as l}from"react-aria";const u=process.env.NODE_ENV!==`production`,d=new Set;function f(e,t){u&&e&&!d.has(t)&&(d.add(t),console.warn(t))}function p(e,t){u&&e&&!d.has(t)&&(d.add(t),console.error(t))}function m(e){switch(e){case`a`:return`anchor`;case`button`:return`button`;case`input`:return`input`;default:return`host`}}function h(e){return typeof e==`string`?m(e):e.slotKind??`component`}function g(e){return typeof e==`string`?e:e.slotTag}function _(e,t,n){let r=h(e);if(r!==`component`)return r;let i=n?.to;return t!=null||i!=null?`anchor`:r}function v(e){return _(e.type,e.props.href,e.props)}function y(e){let n=e.asChild?t(e.children):void 0;return s(n)?v(n):e.component===void 0?b(e.href)?`anchor`:void 0:_(e.component,e.href,e)}const b=e=>e!=null;function x(e,t,n){return e??(b(t)?`a`:n)}function S(e,t,n){return b(t)?e===`anchor`||e===`component`?{href:t}:(f(!0,`${n}: \`href\` was ignored, because the element it renders isn't a link. Leave out \`component\` to render an <a>, or pass a link as \`component\` or as the \`asChild\` element.`),{}):{}}const C=e=>e===`anchor`||e===`button`,w=(...e)=>e.filter(Boolean).join(` `)||void 0,T=(e,...t)=>w(...(e?.split(` `)??[]).filter(e=>!t.includes(e))),E=(e,...t)=>({...e,"aria-describedby":T(e[`aria-describedby`],...t.map(e=>e.id))}),D=a(null),O=D.Provider,k=()=>c(D);function A(e){return e.props.ref}function j(t,r){let a=o(function({children:t,...r},a){let o=c(D),s=e(a,o?A(o):void 0);if(!o)return null;let u={...l(r,o.props)},d=w(r[`aria-describedby`],o.props[`aria-describedby`]);return d?u[`aria-describedby`]=d:delete u[`aria-describedby`],o.props[`aria-label`]!=null&&o.props[`aria-labelledby`]==null&&delete u[`aria-labelledby`],r[`aria-disabled`]===!0&&(u.onClick=r.onClick),n.createElement(D.Provider,{value:null},i(o,{...u,ref:s},t))});return Object.assign(a,{slotKind:t,slotTag:r})}const M=new Map;function N(e){let t=v(e),n=typeof e.type==`string`?e.type:void 0,r=n??`:${t}`,i=M.get(r);return i||(i=j(t,n),M.set(r,i)),i}const P=j(`component`,void 0);function F(e,t,r,a={}){let o=Object.entries(a).filter(([,e])=>e!==void 0),s=o.length?i(e,Object.fromEntries(o)):e;return n.createElement(O,{value:s},n.createElement(P,{...t,ref:r},e.props.children))}const I=e=>typeof e?.slotKind==`string`;function L(e){let n=t(e);return s(n)&&n.type!==r?n:null}function R(e,t){let n=L(e);return f(!n,`${t}: \`asChild\` expects exactly one React element as its child (not text, a fragment, or several elements); rendering the default element instead.`),n}function z(e,t){let n=L(e);return f(!n,`${t}: expects exactly one React element as its trigger (not text, a fragment, or several elements); rendering the children with nothing to open it.`),n}export{p as _,I as a,w as c,S as d,C as f,_ as g,y as h,z as i,E as l,g as m,N as n,F as o,x as p,R as r,k as s,O as t,b as u,f as v};
2
+ //# sourceMappingURL=slot-CNhFZdHF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot-CNhFZdHF.js","names":[],"sources":["../../src/utils/devWarning.ts","../../src/utils/elementKind.ts","../../src/utils/idRefs.ts","../../src/utils/slot.tsx"],"sourcesContent":["// Development-only misuse warnings, in one place so every component reports misuse the same way\n// and none of it reaches a consumer's production bundle.\n//\n// Two problems this fixes over calling `console.warn` directly, which is what every call site used\n// to do:\n//\n// 1. **They fired in production.** Nothing in this package guarded on `NODE_ENV`, so every\n// `console.warn` ran for end users of a consuming app. `process.env.NODE_ENV` is the idiom\n// bundlers (Vite, webpack, Turbopack, Rollup) replace with a literal, so in a production build\n// `IS_DEV` folds to `false` and no warning is ever emitted. Relying on that substitution adds\n// no new constraint: `react-dom` — a peer dependency, so always present — already requires\n// exactly the same replacement.\n// 2. **They repeated.** Most call sites warn during render, so a warning re-fired on every\n// re-render, and twice per render under StrictMode's double-invoke. De-duplicating on the\n// message means a misuse is reported once and stays readable in the console.\n//\n// What this does *not* do is strip the message strings from the bundle. Measured with esbuild\n// against the built `dist/index.js`: a `NODE_ENV=production` consumer bundle still contains them.\n// `tsdown` minifies this package's own output first (`minify: true`), collapsing each function to\n// a `IS_DEV && cond && ...` expression, and a consumer's minifier won't then inline that call to\n// discover its arguments are droppable. Building unminified would let them drop, at the cost of\n// shipping pretty-printed dist — not worth it for a few hundred gzipped bytes. The behavior that\n// mattered (nothing logged in production, nothing repeated in development) is the part that's\n// fixed; treat the strings as part of the bundle's fixed cost.\nconst IS_DEV = process.env.NODE_ENV !== 'production'\n\nconst warned = new Set<string>()\n\n/**\n * Resets the de-duplication set. Test-only — the suite asserts on these warnings, and without a\n * reset between tests the *second* test in a file to trigger the same message would see nothing.\n * Called from a global `beforeEach` in `test/setup.ts`.\n */\nexport function resetDevWarnings(): void {\n warned.clear()\n}\n\n/**\n * Logs `message` once via `console.warn` when `condition` is true, in development builds only.\n * Use for a recoverable misuse: the component still renders something sensible.\n */\nexport function devWarning(condition: boolean, message: string): void {\n if (!IS_DEV) return\n if (!condition || warned.has(message)) return\n warned.add(message)\n console.warn(message)\n}\n\n/**\n * Logs `message` once via `console.error` when `condition` is true, in development builds only.\n * Use for a misuse that leaves the component genuinely broken (e.g. a required prop missing).\n */\nexport function devError(condition: boolean, message: string): void {\n if (!IS_DEV) return\n if (!condition || warned.has(message)) return\n warned.add(message)\n console.error(message)\n}\n","import { ElementType, isValidElement, ReactElement, ReactNode } from 'react'\n\nimport { devWarning } from './devWarning'\nimport { resolveLazy } from './lazyElement'\n\n// What a polymorphic component ends up rendering, as far as its own semantics care:\n//\n// - `anchor`, `button`, `input`: the native element, which the component gives its full handling\n// (a real `disabled` attribute, or `aria-disabled`/`tabIndex`/a click guard on an anchor).\n// - `host`: any other HTML tag, which has no semantics of its own to rely on.\n// - `component`: a component reference, trusted to handle its own semantics.\n//\n// A render function asks `resolveElementKind(Component)` instead of comparing `Component` to a tag\n// name, because under `asChild` `Component` is a `Slot` (see `./slot`), not the tag the caller's\n// child element renders. The `Slot` carries that element's kind and tag.\nexport type ElementKind = 'anchor' | 'button' | 'input' | 'host' | 'component'\n\nfunction kindOfTag(tag: string): ElementKind {\n switch (tag) {\n case 'a':\n return 'anchor'\n case 'button':\n return 'button'\n case 'input':\n return 'input'\n default:\n return 'host'\n }\n}\n\ntype SlotLike = { slotKind?: ElementKind; slotTag?: string }\n\nexport function resolveElementKind(component: ElementType): ElementKind {\n if (typeof component === 'string') return kindOfTag(component)\n return (component as SlotLike).slotKind ?? 'component'\n}\n\n// The HTML tag that gets rendered, for a render function whose markup depends on a tag that has\n// no kind of its own (`List` renders `<li>` items only inside a `<ul>`/`<ol>`). `undefined` for a\n// component, whose output isn't known.\nexport function resolveElementTag(component: ElementType): string | undefined {\n return typeof component === 'string' ? component : (component as SlotLike).slotTag\n}\n\n// The kind of what a component renders, given the props it renders it with. A component reference\n// with a link target (`<Link href=\"/login\">` of Next.js, `<Link to=\"/login\">` of React Router)\n// counts as an anchor: router links render an `<a>` and forward what they're given to it, so they\n// need the anchor's disabled handling (`aria-disabled`, `tabindex=\"-1\"`, a blocked click), not a\n// `disabled` attribute passed through. This holds for the link passed as `component` and for the\n// one handed to `asChild` alike. `props` is where `to` is found: a component's remaining props.\nexport function resolveLinkKind(\n component: ElementType,\n href: unknown,\n props?: Record<string, unknown> | object\n): ElementKind {\n const kind = resolveElementKind(component)\n if (kind !== 'component') return kind\n const to = (props as { to?: unknown } | undefined)?.to\n return href != null || to != null ? 'anchor' : kind\n}\n\n// The kind of the element a caller handed to `asChild`.\nexport function resolveSlottedKind(element: ReactElement<Record<string, unknown>>): ElementKind {\n return resolveLinkKind(element.type as ElementType, element.props.href, element.props)\n}\n\n// The same question asked from outside, by a parent reading a child's props (`List` deciding its\n// own tag from its `ListItem`s). `undefined` when the child chose nothing and renders its default.\nexport function resolveKindFromProps(props: {\n asChild?: boolean\n children?: ReactNode\n component?: ElementType\n href?: string\n to?: unknown\n}): ElementKind | undefined {\n const child = props.asChild ? resolveLazy(props.children) : undefined\n if (isValidElement<Record<string, unknown>>(child)) return resolveSlottedKind(child)\n if (props.component !== undefined) return resolveLinkKind(props.component, props.href, props)\n return hasHref(props.href) ? 'anchor' : undefined\n}\n\n// One rule for `href`, followed by every component that accepts one:\n//\n// - The element is `component`, or the `asChild` element, when one is given. Otherwise `href` makes\n// it an `<a>`, and without `href` the component renders its own default (`linkElement`).\n// - `href` reaches the rendered element only when that element can take it: an `<a>`, or a\n// component reference, which is trusted to take it (a router link does). A `<button>`, an `<li>`\n// or any other tag never gets one, and in development the component says so (`hrefProps`).\n// - A component reference given `href` or `to` is a link, and is handled as an anchor\n// (`resolveLinkKind`).\n//\n// An empty string is set: `href=\"\"` is a link to the current document.\nexport const hasHref = (href: string | null | undefined): href is string => href != null\n\nexport function linkElement(\n component: ElementType | undefined,\n href: string | undefined,\n fallback: ElementType\n): ElementType {\n return component ?? (hasHref(href) ? 'a' : fallback)\n}\n\nexport function hrefProps(\n kind: ElementKind,\n href: string | undefined,\n displayName: string\n): { href?: string } {\n if (!hasHref(href)) return {}\n if (kind === 'anchor' || kind === 'component') return { href }\n devWarning(\n true,\n `${displayName}: \\`href\\` was ignored, because the element it renders isn't a link. Leave ` +\n `out \\`component\\` to render an <a>, or pass a link as \\`component\\` or as the \\`asChild\\` ` +\n `element.`\n )\n return {}\n}\n\nexport const isInteractiveKind = (kind: ElementKind | undefined): boolean =>\n kind === 'anchor' || kind === 'button'\n","// An id-reference attribute (`aria-describedby`, `aria-labelledby`) from the ids that apply, or\n// `undefined` when none does, so the attribute is left out rather than written empty.\nexport const joinIds = (...ids: (string | false | null | undefined)[]): string | undefined =>\n ids.filter(Boolean).join(' ') || undefined\n\n// `value` without the given ids: for an id-reference attribute a react-aria hook built from ids\n// that may not be rendered, such as the description and error-message ids of its `useField`.\nexport const withoutIds = (\n value: string | undefined,\n ...ids: (string | undefined)[]\n): string | undefined => joinIds(...(value?.split(' ') ?? []).filter((id) => !ids.includes(id)))\n\n// `props` with the ids of react-aria's description and error-message slots taken out of its\n// `aria-describedby`. `useField` always writes both into the server's HTML and drops each only\n// after hydration, once it finds no element with that id: this library renders its own help and\n// feedback under other ids. See FORMS.md, gotcha 6.\nexport const withoutSlotIds = <P extends { 'aria-describedby'?: string }>(\n props: P,\n ...slots: { id?: string }[]\n): P => ({\n ...props,\n 'aria-describedby': withoutIds(props['aria-describedby'], ...slots.map((slot) => slot.id))\n})\n","import React, {\n cloneElement,\n createContext,\n forwardRef,\n Fragment,\n isValidElement,\n ReactElement,\n ReactNode,\n Ref,\n useContext\n} from 'react'\nimport { mergeProps } from 'react-aria'\n\nimport { useForkedRef } from '../hooks/useForkedRef'\nimport { devWarning } from './devWarning'\nimport { ElementKind, resolveSlottedKind } from './elementKind'\nimport { joinIds } from './idRefs'\nimport { resolveLazy } from './lazyElement'\n\n// Backs the `asChild` prop every polymorphic component accepts (see `createPolymorphicComponent`).\n// The component renders a `Slot` as its `component`; the `Slot` then renders the caller's child\n// element in its place, with the props the component computed (className, handlers, ARIA\n// attributes, ref) merged onto it.\n//\n// There is one `Slot` per tag, and two for component elements (a link, anything else), and the\n// component gets the one that matches the child. A render function reads the child's kind and\n// tag back with `resolveElementKind(Component)`/`resolveElementTag(Component)` (see\n// `./elementKind`) and gives a slotted `<a>` the handling it gives `component=\"a\"`. Both travel\n// on the component rather than in a prop, so nothing extra can reach the DOM.\n//\n// The child element travels through context rather than a prop because a render function spreads\n// its `rest` props onto `component` in its own way (some filter them, some don't forward every\n// one) — context reaches `Slot` no matter how the render function wires it up. `Slot` resets the\n// context for its own subtree, so a polymorphic component nested *inside* the child doesn't pick\n// up the outer one's element.\ntype SlotElement = ReactElement<Record<string, unknown>>\n\nconst SlotContext = createContext<SlotElement | null>(null)\n\nexport const SlotProvider = SlotContext.Provider\n\n// The element `asChild` handed to the nearest polymorphic component, for a component rendered\n// beside its `Slot`. A render function can't read it: it runs above the provider.\nexport const useSlotElement = (): SlotElement | null => useContext(SlotContext)\n\n// The ref the caller put on an element. React 19 made `ref` an ordinary prop, and warns on\n// reading `element.ref`.\nexport function getElementRef<T = unknown>(element: ReactElement): Ref<T> | undefined {\n return (element.props as { ref?: Ref<T> }).ref\n}\n\n// `Record` rather than a declared prop list: `Slot` forwards whatever the render function hands it.\ntype SlotProps = Record<string, unknown>\n\nfunction createSlot(slotKind: ElementKind, slotTag: string | undefined) {\n const Slot = forwardRef<unknown, SlotProps>(function Slot({ children, ...slotProps }, ref) {\n const element = useContext(SlotContext)\n const forkedRef = useForkedRef(ref, element ? getElementRef(element) : undefined)\n if (!element) return null\n\n // react-aria's `mergeProps`: the child's own props win over the component's, except that\n // classNames concatenate, event handlers chain (the component's first), and ids merge.\n // Descriptions add up too: a child's own `aria-describedby` keeps the component's (a\n // `Tooltip`'s) rather than replacing it.\n const props: Record<string, unknown> = { ...mergeProps(slotProps, element.props) }\n // Written only when there is one: a key set to `undefined` would replace a description the\n // child's own component writes before spreading its props.\n const describedBy = joinIds(\n slotProps['aria-describedby'] as string | undefined,\n element.props['aria-describedby'] as string | undefined\n )\n if (describedBy) props['aria-describedby'] = describedBy\n else delete props['aria-describedby']\n // The child's own name wins too. `aria-labelledby` outranks `aria-label` when an element is\n // named, so the component's (a `Divider`'s label) would replace the name the child was given.\n if (element.props['aria-label'] != null && element.props['aria-labelledby'] == null) {\n delete props['aria-labelledby']\n }\n // A component marks an element that has no `disabled` attribute (an `<a>`, a `<div>`) with\n // `aria-disabled`, and blocks its click itself. The child's own `onClick` would still run\n // from the chain, so the component's handler replaces it: a disabled element doesn't act on\n // a click.\n if (slotProps['aria-disabled'] === true) props.onClick = slotProps.onClick\n\n return (\n <SlotContext.Provider value={null}>\n {cloneElement(element, { ...props, ref: forkedRef }, children as ReactNode)}\n </SlotContext.Provider>\n )\n })\n return Object.assign(Slot, { slotKind, slotTag })\n}\n\n// Created on first use and kept: a `Slot` has to be the same component on every render, or React\n// would remount the child. Keyed by tag, or by kind for a component element (a tag can't start\n// with a colon).\nconst slots = new Map<string, ReturnType<typeof createSlot>>()\n\n// The `Slot` a component renders for this child element.\nexport function getSlot(element: SlotElement) {\n const kind = resolveSlottedKind(element)\n const tag = typeof element.type === 'string' ? element.type : undefined\n const key = tag ?? `:${kind}`\n let slot = slots.get(key)\n if (!slot) {\n slot = createSlot(kind, tag)\n slots.set(key, slot)\n }\n return slot\n}\n\n// The `Slot` `renderSlotted` renders. One for every element: the trigger of a `Tooltip` has no\n// kind for a render function to read, and a `Slot` chosen by kind would change, remounting the\n// caller's trigger, when its `href` came or went.\nconst TriggerSlot = createSlot('component', undefined)\n\n// Renders an element the component doesn't own, such as the trigger of a `Tooltip` or a\n// `Popover`, the way `asChild` renders a child: with the component's `props` merged into the\n// element's own and `ref` forked with the element's ref. `owned` holds the attributes that state\n// the component's own condition (a `Popover` trigger's `aria-expanded` and `aria-controls`): they\n// win over the element's, which the merge would otherwise let win.\nexport function renderSlotted(\n element: SlotElement,\n props: object,\n ref: Ref<unknown>,\n owned: Record<string, unknown> = {}\n): ReactElement {\n const defined = Object.entries(owned).filter(([, value]) => value !== undefined)\n const slotted = defined.length ? cloneElement(element, Object.fromEntries(defined)) : element\n return (\n <SlotProvider value={slotted}>\n <TriggerSlot {...props} ref={ref}>\n {element.props.children as ReactNode}\n </TriggerSlot>\n </SlotProvider>\n )\n}\n\n// Whether a render function's `component` is a `Slot`, that is, whether it renders under `asChild`.\nexport const isSlot = (component: unknown): boolean =>\n typeof (component as { slotKind?: ElementKind } | null)?.slotKind === 'string'\n\n// The single element in `children`, or `null` when it isn't exactly one (text, a fragment,\n// several elements).\n//\n// A Server Component's child can arrive as a lazy node (#37, see `./lazyElement`): it is resolved\n// first, which suspends this component while the child is still loading.\nfunction getSingleElement(children: ReactNode): SlotElement | null {\n const child = resolveLazy(children)\n return isValidElement<Record<string, unknown>>(child) && child.type !== Fragment ? child : null\n}\n\n// The single element `asChild` renders in place of the component's own element, or `null` (with\n// a dev warning) when `children` isn't exactly one — the component then falls back to rendering\n// its default element, so a misuse degrades to a working, if unstyled-as-intended, UI.\nexport function getSlotChild(children: ReactNode, displayName: string): SlotElement | null {\n const child = getSingleElement(children)\n devWarning(\n !child,\n `${displayName}: \\`asChild\\` expects exactly one React element as its child (not text, a ` +\n `fragment, or several elements); rendering the default element instead.`\n )\n return child\n}\n\n// The trigger of a `Tooltip` or `Popover`, rendered with `renderSlotted`, or `null` (with a dev\n// warning) when `children` isn't exactly one element. The component then renders `children` as\n// they are, with nothing to open it.\nexport function getTriggerChild(children: ReactNode, displayName: string): SlotElement | null {\n const child = getSingleElement(children)\n devWarning(\n !child,\n `${displayName}: expects exactly one React element as its trigger (not text, a fragment, ` +\n `or several elements); rendering the children with nothing to open it.`\n )\n return child\n}\n"],"mappings":"kQAwBA,MAAM,EAAS,QAAQ,IAAI,WAAa,aAElC,EAAS,IAAI,IAenB,SAAgB,EAAW,EAAoB,EAAuB,CAC/D,GACA,GAAa,GAAO,IAAI,CAA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ingURL=spacingClassName-DVhk8m3P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spacingClassName-DVhk8m3P.js","names":[],"sources":["../../src/utils/spacingClassName.ts"],"sourcesContent":["import { Spacing } from '../types'\n\n// A spacing prop (`gap`/`rowGap`/`gutter`/...) is typed `Spacing | 0`, but `0` is meaningful\n// (chassis-css's `gap-0` etc. exist) while `undefined`/`false`-ish values mean \"not set\" — a\n// plain truthy check would drop `0`, so every caller needs this same `typeof` guard instead.\n// Shared by `Flex`, `Stack`, `Row`, and `CardBody`'s own `layoutClassNames`/`_className` builders,\n// which otherwise duplicated it once per spacing prop (`gap`, `rowGap`, `columnGap`, `gutter`,\n// `gutterX`, `gutterY`, ...).\nexport const spacingClassName = (\n base: string,\n value: Spacing | 0 | undefined,\n prefix = ''\n): string | null =>\n typeof value === 'string' || typeof value === 'number' ? `${prefix}${base}-${value}` : null\n"],"mappings":"AAQA,MAAa,GACX,EACA,EACA,EAAS,KAET,OAAO,GAAU,UAAY,OAAO,GAAU,SAAW,GAAG,IAAS,EAAK,GAAG,IAAU"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./VisuallyHidden-C2dM7HhC.js";import n from"react";import r from"classnames";function i({className:e,color:i,component:a,size:o,variant:s=`border`,visuallyHiddenLabel:c=`Loading...`,...l},u){let d=a??`div`,f=r(`spinner-${s}`,i?`fg-${i}`:null,o&&`spinner-${s}-${o}`,e);return n.createElement(d,{className:f,role:`status`,...l,ref:u},n.createElement(t,null,c))}const a=e(i,`Spinner`);export{a as t};
2
+ //# sourceMappingURL=spinner-DblhvrHL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner-DblhvrHL.js","names":[],"sources":["../../src/components/spinner/Spinner.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { ContextColor } from '../../types'\nimport { VisuallyHidden } from '../visually-hidden/VisuallyHidden'\n\ntype SpinnerOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Size the component sm.\n */\n size?: 'sm'\n /**\n * Set the button variant to an outlined button or a ghost button.\n */\n variant?: 'border' | 'grow'\n /**\n * Set visually hidden label for accessibility purposes.\n */\n visuallyHiddenLabel?: string\n}\n\nexport type SpinnerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SpinnerOwnProps<C>\n>\n\ntype SpinnerComponent = (<C extends ElementType = 'div'>(\n props: SpinnerProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction SpinnerRender<C extends ElementType = 'div'>(\n {\n className,\n color,\n component,\n size,\n variant = 'border',\n visuallyHiddenLabel = 'Loading...',\n ...rest\n }: SpinnerProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n `spinner-${variant}`,\n color ? `fg-${color}` : null,\n size && `spinner-${variant}-${size}`,\n className\n )\n\n return (\n <Component className={_className} role=\"status\" {...rest} ref={ref}>\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n </Component>\n )\n}\n\nexport const Spinner = createPolymorphicComponent<SpinnerComponent>(\n SpinnerRender as ForwardRefRenderFunction<Element, SpinnerProps<ElementType>>,\n 'Spinner'\n)\n"],"mappings":"0KA+CA,SAAS,EACP,CACE,YACA,QACA,YACA,OACA,UAAU,SACV,sBAAsB,aACtB,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,WAAW,IACX,EAAQ,MAAM,IAAU,KACxB,GAAQ,WAAW,EAAQ,GAAG,IAC9B,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,KAAK,SAAS,GAAI,EAAW,KAEpD,EADT,EAAA,cAAC,EAAA,KAAgB,CAAoC,CAC5C,CAEf,CAEA,MAAa,EAAU,EACrB,EACA,SACF"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./breakpoints-o_2Ev7ir.js";import{t as n}from"./spacingClassName-DVhk8m3P.js";import r from"react";import i from"classnames";const a=(e,t)=>[`${t}${e===`vertical`?`vstack`:`hstack`}`];function o({children:e,className:o,component:s,direction:c=`horizontal`,gap:l,responsive:u,...d},f){let p=s??`div`,m=i(t(a,c,u),n(`gap`,l),o);return r.createElement(p,{className:m,...d,ref:f},e)}const s=e(o,`Stack`);export{s as t};
2
+ //# sourceMappingURL=stack-CsMiQbpq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-CsMiQbpq.js","names":[],"sources":["../../src/components/stack/Stack.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { buildResponsiveClassNames } from '../../utils/breakpoints'\nimport { spacingClassName } from '../../utils/spacingClassName'\nimport { Breakpoint, Spacing } from '../../types'\n\nconst directionClassName = (direction: 'horizontal' | 'vertical', prefix: string) => [\n `${prefix}${direction === 'vertical' ? 'vstack' : 'hstack'}`\n]\n\ntype StackOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Lays children out in a row (`horizontal`, the default, maps to `.hstack`) or a column\n * (`vertical`, maps to `.vstack`).\n */\n direction?: 'horizontal' | 'vertical'\n /**\n * Spacing between children, mapped to the `gap-*` utility classes.\n */\n gap?: Spacing | 0\n /**\n * Switches `direction` at one or more breakpoints via container queries. Requires a\n * `.contains-inline` ancestor (not applied by `Stack` itself — see the docs) to establish the\n * container context these queries evaluate against.\n */\n responsive?: Partial<Record<Breakpoint, 'horizontal' | 'vertical'>>\n}\n\nexport type StackProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n StackOwnProps<C>\n>\n\ntype StackComponent = (<C extends ElementType = 'div'>(\n props: StackProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction StackRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n component,\n direction = 'horizontal',\n gap,\n responsive,\n ...rest\n }: StackProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n buildResponsiveClassNames(directionClassName, direction, responsive),\n spacingClassName('gap', gap),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Stack = createPolymorphicComponent<StackComponent>(\n StackRender as ForwardRefRenderFunction<Element, StackProps<ElementType>>,\n 'Stack'\n)\n"],"mappings":"0NAYA,MAAM,GAAsB,EAAsC,IAAmB,CACnF,GAAG,IAAS,IAAc,WAAa,SAAW,UACpD,EAqCA,SAAS,EACP,CACE,WACA,YACA,YACA,YAAY,aACZ,MACA,aACA,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,EAA0B,EAAoB,EAAW,CAAU,EACnE,EAAiB,MAAO,CAAG,EAC3B,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAQ,EACnB,EACA,OACF"}
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./tableClassName-CZA2Bse8.js";import n,{forwardRef as r}from"react";const i=r(({align:r,bordered:i,borderless:a,caption:o,children:s,className:c,color:l,hover:u,responsive:d,sm:f,stacked:p,striped:m,...h},g)=>{let _=n.createElement(`table`,{...h,className:t({align:r,bordered:i,borderless:a,className:c,color:l,hover:u,sm:f,stacked:p,striped:m}),ref:g},o&&n.createElement(`caption`,null,o),s),v=e({responsive:d,stacked:p});return v?n.createElement(`div`,{className:v},_):_});i.displayName=`StaticTable`;export{i as t};
2
+ //# sourceMappingURL=static-table-D0M4oc_t.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-table-D0M4oc_t.js","names":[],"sources":["../../src/components/static-table/StaticTable.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, TableHTMLAttributes } from 'react'\n\nimport { TableStyleProps, tableClassName, tableWrapperClassName } from '../../utils/tableClassName'\n\nexport interface StaticTableProps\n extends TableStyleProps, Omit<TableHTMLAttributes<HTMLTableElement>, 'align' | 'color'> {\n /**\n * Content shown above the table, functioning as a heading for it.\n */\n caption?: ReactNode\n /**\n * The table's own markup — plain `<thead>`/`<tbody>`/`<tfoot>`/`<tr>`/`<th>`/`<td>` elements,\n * rendered as-is.\n */\n children?: ReactNode\n /**\n * Convert rows into stacked label/value blocks below a container width, for tables with too\n * many columns to read comfortably even with horizontal scrolling. `true` always stacks; a\n * breakpoint name stacks only below it. Implies `responsive` when `responsive` isn't set\n * separately. Unlike `Table`, which derives each cell's label from its column header, a static\n * table has no collection to read labels from — give each `<td>` a `data-cell` attribute with\n * the label to show before its value.\n */\n stacked?: TableStyleProps['stacked']\n}\n\n// A plain, server-renderable `<table>` with `Table`'s styling props and none of its behavior — no\n// sorting, selection, or keyboard grid navigation, and no hooks, so it needs no client JavaScript\n// at all. Imported from `@chassis-ui/react/static-table`, whose entry deliberately has no\n// `'use client'` directive (see `RSC.md`). `forwardRef` is fine here: React Server Components\n// render forwardRef components like any other function component (a ref just can't be passed\n// from the server side).\nexport const StaticTable = forwardRef<HTMLTableElement, StaticTableProps>(\n (\n {\n align,\n bordered,\n borderless,\n caption,\n children,\n className,\n color,\n hover,\n responsive,\n sm,\n stacked,\n striped,\n ...rest\n },\n ref\n ) => {\n const table = (\n <table\n {...rest}\n className={tableClassName({\n align,\n bordered,\n borderless,\n className,\n color,\n hover,\n sm,\n stacked,\n striped\n })}\n ref={ref}\n >\n {caption && <caption>{caption}</caption>}\n {children}\n </table>\n )\n\n const wrapperClassName = tableWrapperClassName({ responsive, stacked })\n return wrapperClassName ? <div className={wrapperClassName}>{table}</div> : table\n }\n)\n\nStaticTable.displayName = 'StaticTable'\n"],"mappings":"yFAgCA,MAAa,EAAc,GAEvB,CACE,QACA,WACA,aACA,UACA,WACA,YACA,QACA,QACA,aACA,KACA,UACA,UACA,GAAG,GAEL,IACG,CACH,IAAM,EACJ,EAAA,cAAC,QAAD,CACE,GAAI,EACJ,UAAW,EAAe,CACxB,QACA,WACA,aACA,YACA,QACA,QACA,KACA,UACA,SACF,CAAC,EACI,KAIA,EAFJ,GAAW,EAAA,cAAC,UAAA,KAAS,CAAiB,EACtC,CACI,EAGH,EAAmB,EAAsB,CAAE,aAAY,SAAQ,CAAC,EACtE,OAAO,EAAmB,EAAA,cAAC,MAAD,CAAK,UAAW,CAA8B,EAAX,CAAW,EAAI,CAC9E,CACF,EAEA,EAAY,YAAc"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-SR_LwaN7.js";import{d as e,f as t,g as n,h as r,m as i,p as a,u as o}from"./slot-CNhFZdHF.js";import{t as s}from"./lazyElement-tfMG21pZ.js";import{t as c}from"./polymorphic-BhGNZQja.js";import l,{Children as u}from"react";import d from"classnames";function f({active:t,children:r,className:i,color:o,component:s,href:c,...u},f){let p=a(s,c,`li`),m=d(`stepper-item`,o&&`context`,o,{active:t},i),h={...e(n(p,c,u),c,`StepperItem`),...t?{"aria-current":`step`}:{},...u};return l.createElement(p,{className:m,...h,ref:f},r)}const p=c(f,`StepperItem`);function m({children:e,className:n,component:a,color:c,icon:f,items:m,layout:h,overflow:g,..._},v){let y=m?m.some(e=>o(e.href)):u.toArray(e).some(e=>s(e,p)&&t(r(e.props))),b=a??(y?`div`:`ol`),x=i(b),S=x===`ol`||x===`ul`,C=d(`stepper`,c&&`context`,c,h,{"icon-stepper":f},n),w=(m?m.map((e,t)=>l.createElement(p,{key:t,active:e.active,color:e.color,component:o(e.href)||S?void 0:`div`,href:e.href},e.label)):null)??(S?e:u.map(e,e=>s(e,p)&&r(e.props)===void 0?l.cloneElement(e,{component:`div`}):e)),T=l.createElement(b,{className:C,..._,ref:v},w);return g?l.createElement(`div`,{className:`stepper-overflow`},T):T}const h=c(m,`Stepper`);export{p as n,h as t};
2
+ //# sourceMappingURL=stepper-CVXMJ2yg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepper-CVXMJ2yg.js","names":[],"sources":["../../src/components/stepper/StepperItem.tsx","../../src/components/stepper/Stepper.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype StepperItemOwnProps<C extends ElementType> = {\n /**\n * Marks the item as the current step.\n */\n active?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * The `href` attribute for an interactive step rendered as a link. Renders an `<a>` in place of\n * the `<li>`, unless `component` or `asChild` chose the element. Inside a `Stepper`, the stepper\n * renders a `<div>` around it in place of the `<ol>`.\n */\n href?: string\n}\n\nexport type StepperItemProps<C extends ElementType = 'li'> = PolymorphicComponentProps<\n C,\n StepperItemOwnProps<C>\n>\n\ntype StepperItemComponent = (<C extends ElementType = 'li'>(\n props: StepperItemProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLLIElement | HTMLAnchorElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction StepperItemRender<C extends ElementType = 'li'>(\n { active, children, className, color, component, href, ...rest }: StepperItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n // `href` makes it an `<a>`, unless `component` or `asChild` chose the element (see\n // `linkElement`). It used to stay an `<li>` and carry `href` as an attribute.\n const Component = linkElement(component, href, 'li')\n const _className = classNames('stepper-item', color && 'context', color, { active }, className)\n\n const mergedProps = {\n ...hrefProps(resolveLinkKind(Component, href, rest), href, 'StepperItem'),\n ...(active ? { 'aria-current': 'step' } : {}),\n ...rest\n }\n\n return (\n <Component className={_className} {...mergedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const StepperItem = createPolymorphicComponent<StepperItemComponent>(\n StepperItemRender as ForwardRefRenderFunction<Element, StepperItemProps<ElementType>>,\n 'StepperItem'\n)\n","import React, {\n Children,\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode\n} from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport {\n hasHref,\n isInteractiveKind,\n resolveElementTag,\n resolveKindFromProps\n} from '../../utils/elementKind'\nimport { isElementOfType } from '../../utils/lazyElement'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { StepperItem } from './StepperItem'\n\nexport interface StepperItemDef {\n /**\n * Step label content.\n */\n label: React.ReactNode\n /**\n * Marks the item as the current step.\n */\n active?: boolean\n /**\n * Sets the color of the item.\n */\n color?: ContextColor\n /**\n * Renders the item as a link to the given URL.\n */\n href?: string\n}\n\ntype StepperOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `'ol'`, unless a step (a data-driven item with `href`, or a `<StepperItem>` child\n * rendering an `<a>`/`<button>` through `component` or `asChild`) is interactive — a bare `<a>`/\n * `<button>` isn't a valid direct child of `<ol>`, so the default switches to `'div'` instead.\n * Pass `component` explicitly to opt out of this.\n */\n component?: C\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Replaces the step counters with icons, driven by the `--status-icon` custom property.\n */\n icon?: boolean\n /**\n * Array of step definitions for data-driven rendering. When provided, children are ignored.\n */\n items?: StepperItemDef[]\n /**\n * Lays out steps side-by-side instead of stacking them vertically, either unconditionally or\n * from a given breakpoint up.\n */\n layout?:\n | 'horizontal'\n | 'sm:horizontal'\n | 'md:horizontal'\n | 'lg:horizontal'\n | 'xl:horizontal'\n | '2xl:horizontal'\n /**\n * Wraps the stepper in a horizontally scrollable container so steps keep their natural width\n * instead of shrinking to fit.\n */\n overflow?: boolean\n}\n\n// What `Stepper` reads off a `<StepperItem>` child to decide its own tag.\ntype StepperItemChildProps = {\n asChild?: boolean\n children?: ReactNode\n component?: ElementType\n href?: string\n}\n\nexport type StepperProps<C extends ElementType = 'ol'> = PolymorphicComponentProps<\n C,\n StepperOwnProps<C>\n>\n\ntype StepperComponent = (<C extends ElementType = 'ol'>(\n props: StepperProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction StepperRender<C extends ElementType = 'ol'>(\n {\n children,\n className,\n component,\n color,\n icon,\n items,\n layout,\n overflow,\n ...rest\n }: StepperProps<C>,\n ref: PolymorphicRef<C>\n) {\n // A linked step (data-driven `href`, or a `<StepperItem>` child rendering an `<a>`/`<button>`,\n // whether through `component` or as its `asChild` element) can't render as a bare\n // `<a>`/`<button>` inside the default `<ol>` root — only `<li>`/`script`/`template` are valid\n // children there. Default to `<div>` instead when that's the case (unless the caller already\n // chose their own `component`) — matching the `<Stepper component=\"div\">` pattern already\n // documented for composed interactive usage.\n const hasInteractiveItem = items\n ? items.some((item) => hasHref(item.href))\n : Children.toArray(children).some(\n (child) =>\n isElementOfType<StepperItemChildProps>(child, StepperItem) &&\n isInteractiveKind(resolveKindFromProps(child.props))\n )\n const Component = (component ?? (hasInteractiveItem ? 'div' : 'ol')) as ElementType\n // The tag rather than `Component`, which under `asChild` is a `Slot` holding the caller's\n // `<ol>`/`<ul>`.\n const rootTag = resolveElementTag(Component)\n const isListSemantic = rootTag === 'ol' || rootTag === 'ul'\n\n const _className = classNames(\n 'stepper',\n color && 'context',\n color,\n layout,\n { 'icon-stepper': icon },\n className\n )\n\n const autoContent = items\n ? items.map((item, idx) => (\n <StepperItem\n // eslint-disable-next-line react/no-array-index-key\n key={idx}\n active={item.active}\n color={item.color}\n // Left out with `href`, so the step renders its `<a>`.\n component={hasHref(item.href) || isListSemantic ? undefined : 'div'}\n href={item.href}\n >\n {item.label}\n </StepperItem>\n ))\n : null\n\n // When the root switched to `div` because of an interactive step, every plain `<StepperItem>`\n // sibling defaulting to `<li>` would be just as invalid (only valid inside `<ul>`/`<ol>`/\n // `<menu>`) — so give each `StepperItem` child the same `div` treatment the auto-generated\n // steps above already get, unless it chose its own element: `component`, `href` or its `asChild`\n // element. Other child types are left untouched — this is only meaningful for `Stepper`'s own\n // steps.\n const renderedChildren =\n autoContent ??\n (isListSemantic\n ? children\n : Children.map(children, (child) =>\n isElementOfType<StepperItemChildProps>(child, StepperItem) &&\n resolveKindFromProps(child.props) === undefined\n ? React.cloneElement(child, { component: 'div' })\n : child\n ))\n\n const stepperEl = (\n <Component className={_className} {...rest} ref={ref}>\n {renderedChildren}\n </Component>\n )\n\n if (!overflow) return stepperEl\n\n return <div className=\"stepper-overflow\">{stepperEl}</div>\n}\n\nexport const Stepper = createPolymorphicComponent<StepperComponent>(\n StepperRender as ForwardRefRenderFunction<Element, StepperProps<ElementType>>,\n 'Stepper'\n)\n"],"mappings":"4QAgDA,SAAS,EACP,CAAE,SAAQ,WAAU,YAAW,QAAO,YAAW,OAAM,GAAG,GAC1D,EACA,CAGA,IAAM,EAAY,EAAY,EAAW,EAAM,IAAI,EAC7C,EAAa,EAAW,eAAgB,GAAS,UAAW,EAAO,CAAE,QAAO,EAAG,CAAS,EAExF,EAAc,CAClB,GAAG,EAAU,EAAgB,EAAW,EAAM,CAAI,EAAG,EAAM,aAAa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