@chassis-ui/react 0.4.1 → 0.5.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 (617) hide show
  1. package/README.md +7 -6
  2. package/dist/accordion.d.ts +1 -1
  3. package/dist/accordion.js +1 -1
  4. package/dist/alert.d.ts +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/autocomplete.d.ts +1 -1
  7. package/dist/autocomplete.js +1 -1
  8. package/dist/avatar.d.ts +1 -1
  9. package/dist/avatar.js +1 -1
  10. package/dist/badge.d.ts +1 -1
  11. package/dist/badge.js +1 -1
  12. package/dist/breadcrumb.d.ts +1 -1
  13. package/dist/breadcrumb.js +1 -1
  14. package/dist/button-group.d.ts +1 -1
  15. package/dist/button-group.js +1 -1
  16. package/dist/button.d.ts +2 -2
  17. package/dist/button.js +1 -1
  18. package/dist/calendar.d.ts +1 -1
  19. package/dist/calendar.js +1 -1
  20. package/dist/card.d.ts +1 -1
  21. package/dist/card.js +1 -1
  22. package/dist/carousel.d.ts +1 -1
  23. package/dist/carousel.js +1 -1
  24. package/dist/checkbox.d.ts +1 -1
  25. package/dist/checkbox.js +1 -1
  26. package/dist/chip-input.d.ts +1 -1
  27. package/dist/chip-input.js +1 -1
  28. package/dist/chip.d.ts +1 -1
  29. package/dist/chip.js +1 -1
  30. package/dist/chunks/{Button-BuZ_GOHS.d.ts → Button-DblYVwl-.d.ts} +4 -2
  31. package/dist/chunks/Button-ZU-x1uN_.js +2 -0
  32. package/dist/chunks/Button-ZU-x1uN_.js.map +1 -0
  33. package/dist/chunks/Chip-C7QlFCvx.js +2 -0
  34. package/dist/chunks/Chip-C7QlFCvx.js.map +1 -0
  35. package/dist/chunks/CloseButton-BPUI5iGX.js +2 -0
  36. package/dist/chunks/CloseButton-BPUI5iGX.js.map +1 -0
  37. package/dist/chunks/ComboboxListBox-Db0rSM3w.js +2 -0
  38. package/dist/chunks/ComboboxListBox-Db0rSM3w.js.map +1 -0
  39. package/dist/chunks/DateField-4cdcwt0v.js +2 -0
  40. package/dist/chunks/DateField-4cdcwt0v.js.map +1 -0
  41. package/dist/chunks/FormHelp-B1eSoack.js +2 -0
  42. package/dist/chunks/FormHelp-B1eSoack.js.map +1 -0
  43. package/dist/chunks/FormLabel-CpzWYh6U.js +2 -0
  44. package/dist/chunks/FormLabel-CpzWYh6U.js.map +1 -0
  45. package/dist/chunks/{Icon-DLB1f88W.js → Icon-Dk5_q79o.js} +2 -2
  46. package/dist/chunks/Icon-Dk5_q79o.js.map +1 -0
  47. package/dist/chunks/Link-DE8NSAXJ.js +2 -0
  48. package/dist/chunks/Link-DE8NSAXJ.js.map +1 -0
  49. package/dist/chunks/Menu-264aGoBR.js +2 -0
  50. package/dist/chunks/Menu-264aGoBR.js.map +1 -0
  51. package/dist/chunks/{Menu-QeYOzrUL.d.ts → Menu-CCYshRuL.d.ts} +3 -2
  52. package/dist/chunks/MenuToggle-DcPEh55c.js +2 -0
  53. package/dist/chunks/MenuToggle-DcPEh55c.js.map +1 -0
  54. package/dist/chunks/Portal-BTDylxAi.js +2 -0
  55. package/dist/chunks/Portal-BTDylxAi.js.map +1 -0
  56. package/dist/chunks/RangeCalendar-mM3OeTlU.js +2 -0
  57. package/dist/chunks/RangeCalendar-mM3OeTlU.js.map +1 -0
  58. package/dist/chunks/VisuallyHidden-CGv-mBuQ.js +2 -0
  59. package/dist/chunks/VisuallyHidden-CGv-mBuQ.js.map +1 -0
  60. package/dist/chunks/accordion-BZlX2uk8.js +2 -0
  61. package/dist/chunks/accordion-BZlX2uk8.js.map +1 -0
  62. package/dist/chunks/alert-DSLg5MBb.js +2 -0
  63. package/dist/chunks/alert-DSLg5MBb.js.map +1 -0
  64. package/dist/chunks/autocomplete-99usnvgh.js +2 -0
  65. package/dist/chunks/autocomplete-99usnvgh.js.map +1 -0
  66. package/dist/chunks/avatar-BQBbcnk6.js +2 -0
  67. package/dist/chunks/avatar-BQBbcnk6.js.map +1 -0
  68. package/dist/chunks/{badge-D2oztCvs.js → badge-Ths1Qn1a.js} +2 -2
  69. package/dist/chunks/badge-Ths1Qn1a.js.map +1 -0
  70. package/dist/chunks/breadcrumb-BTiQikk-.js +2 -0
  71. package/dist/chunks/breadcrumb-BTiQikk-.js.map +1 -0
  72. package/dist/chunks/breakpoints-CGk8szzR.js.map +1 -1
  73. package/dist/chunks/button-group-CefkGeYL.js +2 -0
  74. package/dist/chunks/button-group-CefkGeYL.js.map +1 -0
  75. package/dist/chunks/card-CEQgHIaL.js +2 -0
  76. package/dist/chunks/card-CEQgHIaL.js.map +1 -0
  77. package/dist/chunks/carousel-DC-UGc6W.js +2 -0
  78. package/dist/chunks/carousel-DC-UGc6W.js.map +1 -0
  79. package/dist/chunks/checkbox-ko6CdtoT.js +2 -0
  80. package/dist/chunks/checkbox-ko6CdtoT.js.map +1 -0
  81. package/dist/chunks/chip-input-CugY8EOc.js +2 -0
  82. package/dist/chunks/chip-input-CugY8EOc.js.map +1 -0
  83. package/dist/chunks/{collapse--Go2Y73B.js → collapse-CBi3RWTf.js} +2 -2
  84. package/dist/chunks/collapse-CBi3RWTf.js.map +1 -0
  85. package/dist/chunks/color-input-C4zMWlvm.js +2 -0
  86. package/dist/chunks/color-input-C4zMWlvm.js.map +1 -0
  87. package/dist/chunks/colorClassNames-YzGWu6qm.js +2 -0
  88. package/dist/chunks/colorClassNames-YzGWu6qm.js.map +1 -0
  89. package/dist/chunks/combobox-BQh3uJWB.js +2 -0
  90. package/dist/chunks/combobox-BQh3uJWB.js.map +1 -0
  91. package/dist/chunks/context-DCg95BgR.js +2 -0
  92. package/dist/chunks/context-DCg95BgR.js.map +1 -0
  93. package/dist/chunks/context-HDVxTNPi.js +2 -0
  94. package/dist/chunks/context-HDVxTNPi.js.map +1 -0
  95. package/dist/chunks/context-menu-8KIuH4cJ.js +2 -0
  96. package/dist/chunks/context-menu-8KIuH4cJ.js.map +1 -0
  97. package/dist/chunks/datagrid-n9vFeXN1.js +2 -0
  98. package/dist/chunks/datagrid-n9vFeXN1.js.map +1 -0
  99. package/dist/chunks/datepicker-DqztYJD6.js +2 -0
  100. package/dist/chunks/datepicker-DqztYJD6.js.map +1 -0
  101. package/dist/chunks/{dialogTransition-i9vw0i2Z.js → dialogTransition-C8fYTsSa.js} +2 -2
  102. package/dist/chunks/dialogTransition-C8fYTsSa.js.map +1 -0
  103. package/dist/chunks/direction-LN6uwsK5.js.map +1 -1
  104. package/dist/chunks/divider-C1-NoKMV.js +2 -0
  105. package/dist/chunks/divider-C1-NoKMV.js.map +1 -0
  106. package/dist/chunks/drawer-CRv9jmbp.js +2 -0
  107. package/dist/chunks/drawer-CRv9jmbp.js.map +1 -0
  108. package/dist/chunks/file-input-D_Gl1h-T.js +2 -0
  109. package/dist/chunks/file-input-D_Gl1h-T.js.map +1 -0
  110. package/dist/chunks/{flex-B52oLCCC.js → flex-C2jV5LyV.js} +2 -2
  111. package/dist/chunks/flex-C2jV5LyV.js.map +1 -0
  112. package/dist/chunks/floating-input-D4gWFfOU.js +2 -0
  113. package/dist/chunks/floating-input-D4gWFfOU.js.map +1 -0
  114. package/dist/chunks/focus-ring-Bs80iIBN.js +2 -0
  115. package/dist/chunks/focus-ring-Bs80iIBN.js.map +1 -0
  116. package/dist/chunks/focusRedirect-CrBl4p_n.js +2 -0
  117. package/dist/chunks/focusRedirect-CrBl4p_n.js.map +1 -0
  118. package/dist/chunks/form-CPS2eNw1.js +2 -0
  119. package/dist/chunks/form-CPS2eNw1.js.map +1 -0
  120. package/dist/chunks/{form-field-CNPGTMiW.js → form-field-Bcx96ezd.js} +2 -2
  121. package/dist/chunks/form-field-Bcx96ezd.js.map +1 -0
  122. package/dist/chunks/grid-CkdPftit.js +2 -0
  123. package/dist/chunks/grid-CkdPftit.js.map +1 -0
  124. package/dist/chunks/icon-CVD3rTr-.js +2 -0
  125. package/dist/chunks/icon-CVD3rTr-.js.map +1 -0
  126. package/dist/chunks/iconSlot-DU_WcSL_.js +2 -0
  127. package/dist/chunks/iconSlot-DU_WcSL_.js.map +1 -0
  128. package/dist/chunks/{index-91YA-jkp.d.ts → index-3JVLrDHv.d.ts} +11 -3
  129. package/dist/chunks/{index-DMbdEm__.d.ts → index-5mW1Y9Lm.d.ts} +7 -4
  130. package/dist/chunks/{index-Cc4SSslb.d.ts → index-5qsV1-cc.d.ts} +3 -3
  131. package/dist/chunks/{index-CYvVmTPR.d.ts → index-6PnrAJmb.d.ts} +4 -4
  132. package/dist/chunks/{index-BA-raEMm.d.ts → index-B5f6haU-.d.ts} +2 -2
  133. package/dist/chunks/{index-4cKG9KWB.d.ts → index-B8OIYfGw.d.ts} +2 -2
  134. package/dist/chunks/{index-CjT_4IZx.d.ts → index-BAvt_oPe.d.ts} +14 -5
  135. package/dist/chunks/{index-DtbUXxjz.d.ts → index-BB8UNxnM.d.ts} +2 -2
  136. package/dist/chunks/{index-aRdgpeRb.d.ts → index-BEAZrhyV.d.ts} +2 -2
  137. package/dist/chunks/{index-BOx8v-oT.d.ts → index-BISMaKaC.d.ts} +14 -2
  138. package/dist/chunks/{index-DtvHH_Mb.d.ts → index-BOroLDDZ.d.ts} +2 -2
  139. package/dist/chunks/{index-C4Dks__B.d.ts → index-BZpHSGlk.d.ts} +2 -2
  140. package/dist/chunks/{index-C9gzVqwX.d.ts → index-BbZzaApz.d.ts} +2 -2
  141. package/dist/chunks/{index-DAoPg59I.d.ts → index-Bca_HQWF.d.ts} +7 -3
  142. package/dist/chunks/{index-B0-8n-Gs.d.ts → index-Bl-_sC4y.d.ts} +12 -4
  143. package/dist/chunks/{index-BSLneLYu.d.ts → index-BxJ6Vrhm.d.ts} +2 -2
  144. package/dist/chunks/{index-CTpwB1yR.d.ts → index-BxrIOrAc.d.ts} +11 -6
  145. package/dist/chunks/{index-DHcztR18.d.ts → index-ByBbC4Jh.d.ts} +3 -3
  146. package/dist/chunks/{index-DHGgezXU.d.ts → index-C-IrFdKe.d.ts} +2 -2
  147. package/dist/chunks/{index-B8uaSJA9.d.ts → index-C0g8NSXY.d.ts} +13 -4
  148. package/dist/chunks/{index-CFnQubsV.d.ts → index-C1RKm3hQ.d.ts} +5 -3
  149. package/dist/chunks/{index-BxROljJI.d.ts → index-C3qqMzs5.d.ts} +2 -2
  150. package/dist/chunks/{index-Dcc_W6Kv.d.ts → index-C6F3DQCd.d.ts} +2 -2
  151. package/dist/chunks/{index-x0vZRyoU.d.ts → index-CEPAXElM.d.ts} +4 -3
  152. package/dist/chunks/{index-DaHQdNul.d.ts → index-COVY45gK.d.ts} +2 -2
  153. package/dist/chunks/{index-DJfga0Ce.d.ts → index-COq1jJ6Y.d.ts} +2 -2
  154. package/dist/chunks/{index-HrKN6s8z.d.ts → index-CSRGr7pU.d.ts} +2 -2
  155. package/dist/chunks/{index-B1kw0jzM.d.ts → index-CTNqEMug.d.ts} +6 -3
  156. package/dist/chunks/{index-6uob77s9.d.ts → index-CW94lG-e.d.ts} +7 -4
  157. package/dist/chunks/{index-Ddd7iWfm.d.ts → index-CY-A60p6.d.ts} +2 -2
  158. package/dist/chunks/{index-lSPcxiii.d.ts → index-CbcFEGCh.d.ts} +5 -3
  159. package/dist/chunks/{index-9rQeMqVI.d.ts → index-Ce0f-bDM.d.ts} +2 -2
  160. package/dist/chunks/{index-Ci7AEgEc.d.ts → index-Cf3gHDjh.d.ts} +2 -2
  161. package/dist/chunks/{index-BVGGIaPX.d.ts → index-Cm3rPbI1.d.ts} +10 -5
  162. package/dist/chunks/{index-DPCwFiJL.d.ts → index-CmljNQ8F.d.ts} +2 -2
  163. package/dist/chunks/{index-DQImhbhy.d.ts → index-Cpifcw5a.d.ts} +2 -2
  164. package/dist/chunks/{index-B_UzbGOa.d.ts → index-Ctf5hLue.d.ts} +3 -3
  165. package/dist/chunks/{index-DM01FX3a.d.ts → index-D0Dhs7YI.d.ts} +18 -6
  166. package/dist/chunks/{index-BAsbRx5n.d.ts → index-D5KJRfMg.d.ts} +2 -2
  167. package/dist/chunks/{index-Bz8MDq0H.d.ts → index-DD6Z5NW-.d.ts} +7 -4
  168. package/dist/chunks/{index-Dfg4Ftb8.d.ts → index-DFKBJxqA.d.ts} +7 -4
  169. package/dist/chunks/{index-BMkbJVHg.d.ts → index-DGGyvlEQ.d.ts} +3 -3
  170. package/dist/chunks/{index-YJ9QdBuq.d.ts → index-DOxVxbb9.d.ts} +6 -5
  171. package/dist/chunks/{index-CxjNw4ss.d.ts → index-DVK16_FU.d.ts} +2 -2
  172. package/dist/chunks/{index-DHOG_rjE.d.ts → index-DVfH_2Ma.d.ts} +7 -4
  173. package/dist/chunks/{index-0jbACjYQ.d.ts → index-DXBkVdWc.d.ts} +2 -2
  174. package/dist/chunks/{index-CsARGAzD.d.ts → index-Davd7Cue.d.ts} +10 -5
  175. package/dist/chunks/{index-Bi8FFadV.d.ts → index-Dc50UjJy.d.ts} +13 -4
  176. package/dist/chunks/{index-BF3OWUVc.d.ts → index-Dci43Xhl.d.ts} +3 -3
  177. package/dist/chunks/{index-B2K-O9kl.d.ts → index-DdFipHYL.d.ts} +5 -4
  178. package/dist/chunks/{index-Du9fBqkT.d.ts → index-DmmLEHVo.d.ts} +2 -2
  179. package/dist/chunks/{index-Dzga1f4w.d.ts → index-DsU3M0oP.d.ts} +2 -2
  180. package/dist/chunks/{index-DP5xugE-.d.ts → index-Es9I0fIS.d.ts} +3 -3
  181. package/dist/chunks/{index-CqZ68Z8R.d.ts → index-HNUhTj5e.d.ts} +25 -6
  182. package/dist/chunks/{index-CCXJXToc.d.ts → index-OnB4_h6x.d.ts} +7 -4
  183. package/dist/chunks/{index-CftERHnE.d.ts → index-QeI-KSng.d.ts} +3 -2
  184. package/dist/chunks/{index-BLS1jhSJ.d.ts → index-RyE80_VH.d.ts} +2 -2
  185. package/dist/chunks/{index-CIwzgZJi.d.ts → index-UjmJQRaG.d.ts} +2 -2
  186. package/dist/chunks/{index-B19ZH3fm.d.ts → index-YzIZhXZ1.d.ts} +2 -2
  187. package/dist/chunks/{index-CHQR8x8_.d.ts → index-Z_5ArZpE.d.ts} +4 -2
  188. package/dist/chunks/{index-BNf0jIIL.d.ts → index-doVyX-4i.d.ts} +7 -4
  189. package/dist/chunks/{index-NGgDkhyn.d.ts → index-mLtlx-d9.d.ts} +6 -3
  190. package/dist/chunks/{index-g74gO0pc.d.ts → index-sT0Hnr_n.d.ts} +12 -10
  191. package/dist/chunks/{index-Bkj17NEQ.d.ts → index-t3k_T3Dv.d.ts} +2 -2
  192. package/dist/chunks/{index-BfEJYF4c.d.ts → index-yVsGuikp.d.ts} +2 -2
  193. package/dist/chunks/input-adorn-DV9tuWXh.js +2 -0
  194. package/dist/chunks/input-adorn-DV9tuWXh.js.map +1 -0
  195. package/dist/chunks/input-group-YB_zoKud.js +2 -0
  196. package/dist/chunks/input-group-YB_zoKud.js.map +1 -0
  197. package/dist/chunks/insideEvents-CWcNrMu7.js +2 -0
  198. package/dist/chunks/insideEvents-CWcNrMu7.js.map +1 -0
  199. package/dist/chunks/lazyElement-tfMG21pZ.js.map +1 -1
  200. package/dist/chunks/list-BPBZR66Y.js +2 -0
  201. package/dist/chunks/list-BPBZR66Y.js.map +1 -0
  202. package/dist/chunks/menu-DEu-Nbv8.js +2 -0
  203. package/dist/chunks/menu-DEu-Nbv8.js.map +1 -0
  204. package/dist/chunks/modal-CHvsDTyl.js +2 -0
  205. package/dist/chunks/modal-CHvsDTyl.js.map +1 -0
  206. package/dist/chunks/nav-B4U_Hqs7.js +2 -0
  207. package/dist/chunks/nav-B4U_Hqs7.js.map +1 -0
  208. package/dist/chunks/nav-overflow-DpX_lRYf.js +2 -0
  209. package/dist/chunks/nav-overflow-DpX_lRYf.js.map +1 -0
  210. package/dist/chunks/navOverflow-C_QJmkPM.js +2 -0
  211. package/dist/chunks/navOverflow-C_QJmkPM.js.map +1 -0
  212. package/dist/chunks/{navVariant-DeGTk9B7.js → navVariant-D4wiKS8I.js} +2 -2
  213. package/dist/chunks/navVariant-D4wiKS8I.js.map +1 -0
  214. package/dist/chunks/navbar-C7dO0YRs.js +2 -0
  215. package/dist/chunks/navbar-C7dO0YRs.js.map +1 -0
  216. package/dist/chunks/notification-oIrUtDhl.js +2 -0
  217. package/dist/chunks/notification-oIrUtDhl.js.map +1 -0
  218. package/dist/chunks/number-field-ChPTSBwI.js +2 -0
  219. package/dist/chunks/number-field-ChPTSBwI.js.map +1 -0
  220. package/dist/chunks/otp-input-DUtCMg8P.js +2 -0
  221. package/dist/chunks/otp-input-DUtCMg8P.js.map +1 -0
  222. package/dist/chunks/{overlayPlacement-BtS90IVf.js → overlayPlacement-Q6bcbXA5.js} +2 -2
  223. package/dist/chunks/overlayPlacement-Q6bcbXA5.js.map +1 -0
  224. package/dist/chunks/overlayStack-BXtTGCRm.js +2 -0
  225. package/dist/chunks/overlayStack-BXtTGCRm.js.map +1 -0
  226. package/dist/chunks/pagination-Dvz8lccd.js +2 -0
  227. package/dist/chunks/pagination-Dvz8lccd.js.map +1 -0
  228. package/dist/chunks/{password-strength-DDK8pHRq.js → password-strength-Qg5GHBmu.js} +2 -2
  229. package/dist/chunks/password-strength-Qg5GHBmu.js.map +1 -0
  230. package/dist/chunks/placeholder-SPoVRkKE.js +2 -0
  231. package/dist/chunks/placeholder-SPoVRkKE.js.map +1 -0
  232. package/dist/chunks/polymorphic-CZIFszAy.js +2 -0
  233. package/dist/chunks/polymorphic-CZIFszAy.js.map +1 -0
  234. package/dist/chunks/popover-C_32yD9W.js +2 -0
  235. package/dist/chunks/popover-C_32yD9W.js.map +1 -0
  236. package/dist/chunks/progress-CiSJDNwx.js +2 -0
  237. package/dist/chunks/progress-CiSJDNwx.js.map +1 -0
  238. package/dist/chunks/radio-C42F_5OD.js +2 -0
  239. package/dist/chunks/radio-C42F_5OD.js.map +1 -0
  240. package/dist/chunks/range-input-DeZq_9S7.js +2 -0
  241. package/dist/chunks/range-input-DeZq_9S7.js.map +1 -0
  242. package/dist/chunks/renderFormCheck-DvpfK_I4.js +2 -0
  243. package/dist/chunks/renderFormCheck-DvpfK_I4.js.map +1 -0
  244. package/dist/chunks/renderFormField-_6WswnEX.js +2 -0
  245. package/dist/chunks/renderFormField-_6WswnEX.js.map +1 -0
  246. package/dist/chunks/renderMenuItemContent-DNdj-Ukz.js +2 -0
  247. package/dist/chunks/renderMenuItemContent-DNdj-Ukz.js.map +1 -0
  248. package/dist/chunks/scrollspy-BEZEVyIw.js +2 -0
  249. package/dist/chunks/scrollspy-BEZEVyIw.js.map +1 -0
  250. package/dist/chunks/scrollspy-D_lPjb92.js.map +1 -1
  251. package/dist/chunks/search-field-OFsb3t4L.js +2 -0
  252. package/dist/chunks/search-field-OFsb3t4L.js.map +1 -0
  253. package/dist/chunks/select-DwyL6aqY.js +2 -0
  254. package/dist/chunks/select-DwyL6aqY.js.map +1 -0
  255. package/dist/chunks/skeleton-B2blJGWj.js +2 -0
  256. package/dist/chunks/skeleton-B2blJGWj.js.map +1 -0
  257. package/dist/chunks/slot-BQVx1Eew.js +2 -0
  258. package/dist/chunks/slot-BQVx1Eew.js.map +1 -0
  259. package/dist/chunks/spacingClassName-DVhk8m3P.js.map +1 -1
  260. package/dist/chunks/spinner-D8lQCW4u.js +2 -0
  261. package/dist/chunks/spinner-D8lQCW4u.js.map +1 -0
  262. package/dist/chunks/stack-DtzW54UK.js +2 -0
  263. package/dist/chunks/stack-DtzW54UK.js.map +1 -0
  264. package/dist/chunks/static-table-C7ZtFQ66.js +2 -0
  265. package/dist/chunks/static-table-C7ZtFQ66.js.map +1 -0
  266. package/dist/chunks/stepper-tSA84huJ.js +2 -0
  267. package/dist/chunks/stepper-tSA84huJ.js.map +1 -0
  268. package/dist/chunks/switch-cp3IZg3L.js +2 -0
  269. package/dist/chunks/switch-cp3IZg3L.js.map +1 -0
  270. package/dist/chunks/table-CBTg5Yuq.js +2 -0
  271. package/dist/chunks/table-CBTg5Yuq.js.map +1 -0
  272. package/dist/chunks/tableClassName-jRfRDXA3.js +2 -0
  273. package/dist/chunks/tableClassName-jRfRDXA3.js.map +1 -0
  274. package/dist/chunks/tabs-DMFSLjnV.js +2 -0
  275. package/dist/chunks/tabs-DMFSLjnV.js.map +1 -0
  276. package/dist/chunks/text-input-CR73x-8D.js +2 -0
  277. package/dist/chunks/text-input-CR73x-8D.js.map +1 -0
  278. package/dist/chunks/textarea-C-1cMyH4.js +2 -0
  279. package/dist/chunks/textarea-C-1cMyH4.js.map +1 -0
  280. package/dist/chunks/time-field-CbCfOQZz.js +2 -0
  281. package/dist/chunks/time-field-CbCfOQZz.js.map +1 -0
  282. package/dist/chunks/toast-Dd0J2e1z.js +2 -0
  283. package/dist/chunks/toast-Dd0J2e1z.js.map +1 -0
  284. package/dist/chunks/tooltip-CmKeQwYw.js +2 -0
  285. package/dist/chunks/tooltip-CmKeQwYw.js.map +1 -0
  286. package/dist/chunks/tree-DNj_EfUl.js +2 -0
  287. package/dist/chunks/tree-DNj_EfUl.js.map +1 -0
  288. package/dist/chunks/unhandledProps-9Kdj7WVf.js.map +1 -1
  289. package/dist/chunks/{useButtonSemantics-CILM_lhi.js → useButtonSemantics-B1SbGaDO.js} +2 -2
  290. package/dist/chunks/useButtonSemantics-B1SbGaDO.js.map +1 -0
  291. package/dist/chunks/useControllableState-CPUJxfKW.js.map +1 -1
  292. package/dist/chunks/useDialogElement-BfygWBPZ.js +2 -0
  293. package/dist/chunks/useDialogElement-BfygWBPZ.js.map +1 -0
  294. package/dist/chunks/useDialogTitle-DiB4YDGI.js +2 -0
  295. package/dist/chunks/useDialogTitle-DiB4YDGI.js.map +1 -0
  296. package/dist/chunks/useDisabledAnchorGuard-CH6df46a.js +2 -0
  297. package/dist/chunks/useDisabledAnchorGuard-CH6df46a.js.map +1 -0
  298. package/dist/chunks/useFloatingOverlay-BuiI_CCn.js +2 -0
  299. package/dist/chunks/useFloatingOverlay-BuiI_CCn.js.map +1 -0
  300. package/dist/chunks/useForkedRef-WoqMqsWE.js +2 -0
  301. package/dist/chunks/useForkedRef-WoqMqsWE.js.map +1 -0
  302. package/dist/chunks/useFormField-DH2tlc3e.js +2 -0
  303. package/dist/chunks/useFormField-DH2tlc3e.js.map +1 -0
  304. package/dist/chunks/useHeldBack-eeTfpa_t.js +2 -0
  305. package/dist/chunks/useHeldBack-eeTfpa_t.js.map +1 -0
  306. package/dist/chunks/useHydrated-Dud4JEwp.js +2 -0
  307. package/dist/chunks/useHydrated-Dud4JEwp.js.map +1 -0
  308. package/dist/chunks/useIsomorphicLayoutEffect-BbqRwuqn.js.map +1 -1
  309. package/dist/chunks/{useOpenStateProps-DykUbnPJ.js → useOpenStateProps-BhjSQ3f6.js} +2 -2
  310. package/dist/chunks/useOpenStateProps-BhjSQ3f6.js.map +1 -0
  311. package/dist/chunks/useOverlayMaxHeight-8mQL2Q6d.js +2 -0
  312. package/dist/chunks/useOverlayMaxHeight-8mQL2Q6d.js.map +1 -0
  313. package/dist/chunks/useRequiredValueInput-gYN8I-LY.js +2 -0
  314. package/dist/chunks/useRequiredValueInput-gYN8I-LY.js.map +1 -0
  315. package/dist/chunks/useToastRegionQueue-CuAMxAIA.js +2 -0
  316. package/dist/chunks/useToastRegionQueue-CuAMxAIA.js.map +1 -0
  317. package/dist/chunks/{useTransitionState-e5ToY7eX.js → useTransitionState-sQUQey74.js} +2 -2
  318. package/dist/chunks/useTransitionState-sQUQey74.js.map +1 -0
  319. package/dist/chunks/validationClassName-gRGs4KBm.js.map +1 -1
  320. package/dist/chunks/{visibleState-B_i1zHu2.js → visibleState-CWyQak65.js} +2 -2
  321. package/dist/chunks/visibleState-CWyQak65.js.map +1 -0
  322. package/dist/close-button.d.ts +1 -1
  323. package/dist/close-button.js +1 -1
  324. package/dist/collapse.d.ts +1 -1
  325. package/dist/collapse.js +1 -1
  326. package/dist/color-input.d.ts +1 -1
  327. package/dist/color-input.js +1 -1
  328. package/dist/combobox.d.ts +1 -1
  329. package/dist/combobox.js +1 -1
  330. package/dist/context-menu.d.ts +1 -1
  331. package/dist/context-menu.js +1 -1
  332. package/dist/datagrid.d.ts +1 -1
  333. package/dist/datagrid.js +1 -1
  334. package/dist/datepicker.d.ts +1 -1
  335. package/dist/datepicker.js +1 -1
  336. package/dist/divider.d.ts +1 -1
  337. package/dist/divider.js +1 -1
  338. package/dist/drawer.d.ts +1 -1
  339. package/dist/drawer.js +1 -1
  340. package/dist/file-input.d.ts +1 -1
  341. package/dist/file-input.js +1 -1
  342. package/dist/flex.d.ts +1 -1
  343. package/dist/flex.js +1 -1
  344. package/dist/floating-input.d.ts +1 -1
  345. package/dist/floating-input.js +1 -1
  346. package/dist/form-field.d.ts +1 -1
  347. package/dist/form-field.js +1 -1
  348. package/dist/form.d.ts +1 -1
  349. package/dist/form.js +1 -1
  350. package/dist/grid.d.ts +1 -1
  351. package/dist/grid.js +1 -1
  352. package/dist/icon.d.ts +1 -1
  353. package/dist/icon.js +1 -1
  354. package/dist/index.d.ts +68 -68
  355. package/dist/index.js +1 -1
  356. package/dist/input-adorn.d.ts +1 -1
  357. package/dist/input-adorn.js +1 -1
  358. package/dist/input-group.d.ts +1 -1
  359. package/dist/input-group.js +1 -1
  360. package/dist/link.d.ts +1 -1
  361. package/dist/link.js +1 -1
  362. package/dist/list.d.ts +1 -1
  363. package/dist/list.js +1 -1
  364. package/dist/menu.d.ts +2 -2
  365. package/dist/menu.js +1 -1
  366. package/dist/modal.d.ts +1 -1
  367. package/dist/modal.js +1 -1
  368. package/dist/nav-overflow.d.ts +1 -1
  369. package/dist/nav-overflow.js +1 -1
  370. package/dist/nav.d.ts +1 -1
  371. package/dist/nav.js +1 -1
  372. package/dist/navbar.d.ts +1 -1
  373. package/dist/navbar.js +1 -1
  374. package/dist/notification.d.ts +1 -1
  375. package/dist/notification.js +1 -1
  376. package/dist/number-field.d.ts +1 -1
  377. package/dist/number-field.js +1 -1
  378. package/dist/otp-input.d.ts +1 -1
  379. package/dist/otp-input.js +1 -1
  380. package/dist/pagination.d.ts +1 -1
  381. package/dist/pagination.js +1 -1
  382. package/dist/password-strength.d.ts +1 -1
  383. package/dist/password-strength.js +1 -1
  384. package/dist/placeholder.d.ts +1 -1
  385. package/dist/placeholder.js +1 -1
  386. package/dist/popover.d.ts +1 -1
  387. package/dist/popover.js +1 -1
  388. package/dist/portal.d.ts +1 -1
  389. package/dist/portal.js +1 -1
  390. package/dist/progress.d.ts +1 -1
  391. package/dist/progress.js +1 -1
  392. package/dist/radio.d.ts +1 -1
  393. package/dist/radio.js +1 -1
  394. package/dist/range-input.d.ts +1 -1
  395. package/dist/range-input.js +1 -1
  396. package/dist/scrollspy.d.ts +1 -1
  397. package/dist/scrollspy.js +1 -1
  398. package/dist/search-field.d.ts +1 -1
  399. package/dist/search-field.js +1 -1
  400. package/dist/select.d.ts +1 -1
  401. package/dist/select.js +1 -1
  402. package/dist/skeleton.d.ts +1 -1
  403. package/dist/skeleton.js +1 -1
  404. package/dist/spinner.d.ts +1 -1
  405. package/dist/spinner.js +1 -1
  406. package/dist/stack.d.ts +1 -1
  407. package/dist/stack.js +1 -1
  408. package/dist/static-table.js +1 -1
  409. package/dist/stepper.d.ts +1 -1
  410. package/dist/stepper.js +1 -1
  411. package/dist/style.css +1 -1
  412. package/dist/switch.d.ts +1 -1
  413. package/dist/switch.js +1 -1
  414. package/dist/table.d.ts +1 -1
  415. package/dist/table.js +1 -1
  416. package/dist/tabs.d.ts +1 -1
  417. package/dist/tabs.js +1 -1
  418. package/dist/text-input.d.ts +1 -1
  419. package/dist/text-input.js +1 -1
  420. package/dist/textarea.d.ts +1 -1
  421. package/dist/textarea.js +1 -1
  422. package/dist/time-field.d.ts +1 -1
  423. package/dist/time-field.js +1 -1
  424. package/dist/toast.d.ts +1 -1
  425. package/dist/toast.js +1 -1
  426. package/dist/tooltip.d.ts +1 -1
  427. package/dist/tooltip.js +1 -1
  428. package/dist/tree.d.ts +1 -1
  429. package/dist/tree.js +1 -1
  430. package/dist/visually-hidden.d.ts +1 -1
  431. package/dist/visually-hidden.js +1 -1
  432. package/package.json +29 -28
  433. package/dist/chunks/Button-BoymWE-L.js +0 -2
  434. package/dist/chunks/Button-BoymWE-L.js.map +0 -1
  435. package/dist/chunks/Chip-DCaWaBqo.js +0 -2
  436. package/dist/chunks/Chip-DCaWaBqo.js.map +0 -1
  437. package/dist/chunks/CloseButton-DPgQztE0.js +0 -2
  438. package/dist/chunks/CloseButton-DPgQztE0.js.map +0 -1
  439. package/dist/chunks/ComboboxListBox-Cm3L1ULl.js +0 -2
  440. package/dist/chunks/ComboboxListBox-Cm3L1ULl.js.map +0 -1
  441. package/dist/chunks/DateSegment-2agXAd0f.js +0 -2
  442. package/dist/chunks/DateSegment-2agXAd0f.js.map +0 -1
  443. package/dist/chunks/FormHelp-AE6_iSLJ.js +0 -2
  444. package/dist/chunks/FormHelp-AE6_iSLJ.js.map +0 -1
  445. package/dist/chunks/FormLabel-CYcQiFUI.js +0 -2
  446. package/dist/chunks/FormLabel-CYcQiFUI.js.map +0 -1
  447. package/dist/chunks/Icon-DLB1f88W.js.map +0 -1
  448. package/dist/chunks/Link-DyZyAQFj.js +0 -2
  449. package/dist/chunks/Link-DyZyAQFj.js.map +0 -1
  450. package/dist/chunks/Menu-CSBg2Zmc.js +0 -2
  451. package/dist/chunks/Menu-CSBg2Zmc.js.map +0 -1
  452. package/dist/chunks/MenuToggle-7RQ0dmtZ.js +0 -2
  453. package/dist/chunks/MenuToggle-7RQ0dmtZ.js.map +0 -1
  454. package/dist/chunks/Portal-CgeR1WXV.js +0 -2
  455. package/dist/chunks/Portal-CgeR1WXV.js.map +0 -1
  456. package/dist/chunks/RangeCalendar-BJl-j4W2.js +0 -2
  457. package/dist/chunks/RangeCalendar-BJl-j4W2.js.map +0 -1
  458. package/dist/chunks/VisuallyHidden-C2dM7HhC.js +0 -2
  459. package/dist/chunks/VisuallyHidden-C2dM7HhC.js.map +0 -1
  460. package/dist/chunks/accordion-B8UWyvQB.js +0 -2
  461. package/dist/chunks/accordion-B8UWyvQB.js.map +0 -1
  462. package/dist/chunks/alert-3kTBfWFw.js +0 -2
  463. package/dist/chunks/alert-3kTBfWFw.js.map +0 -1
  464. package/dist/chunks/autocomplete-Baf9VSHN.js +0 -2
  465. package/dist/chunks/autocomplete-Baf9VSHN.js.map +0 -1
  466. package/dist/chunks/avatar-MklqAKcz.js +0 -2
  467. package/dist/chunks/avatar-MklqAKcz.js.map +0 -1
  468. package/dist/chunks/badge-D2oztCvs.js.map +0 -1
  469. package/dist/chunks/breadcrumb-CHxTiZLt.js +0 -2
  470. package/dist/chunks/breadcrumb-CHxTiZLt.js.map +0 -1
  471. package/dist/chunks/button-group-BGppPrIv.js +0 -2
  472. package/dist/chunks/button-group-BGppPrIv.js.map +0 -1
  473. package/dist/chunks/card-CTP9K8xG.js +0 -2
  474. package/dist/chunks/card-CTP9K8xG.js.map +0 -1
  475. package/dist/chunks/carousel-fTVPqnSV.js +0 -2
  476. package/dist/chunks/carousel-fTVPqnSV.js.map +0 -1
  477. package/dist/chunks/checkbox-ZyQn5Ku5.js +0 -2
  478. package/dist/chunks/checkbox-ZyQn5Ku5.js.map +0 -1
  479. package/dist/chunks/chip-input-BpVDRERg.js +0 -2
  480. package/dist/chunks/chip-input-BpVDRERg.js.map +0 -1
  481. package/dist/chunks/collapse--Go2Y73B.js.map +0 -1
  482. package/dist/chunks/color-input-Bwl5ef5B.js +0 -2
  483. package/dist/chunks/color-input-Bwl5ef5B.js.map +0 -1
  484. package/dist/chunks/colorClassNames-CEh5Yzfp.js +0 -2
  485. package/dist/chunks/colorClassNames-CEh5Yzfp.js.map +0 -1
  486. package/dist/chunks/combobox-Bp1tIaiW.js +0 -2
  487. package/dist/chunks/combobox-Bp1tIaiW.js.map +0 -1
  488. package/dist/chunks/context-menu-B4a0tS-h.js +0 -2
  489. package/dist/chunks/context-menu-B4a0tS-h.js.map +0 -1
  490. package/dist/chunks/datagrid-DOYxx0sF.js +0 -3
  491. package/dist/chunks/datagrid-DOYxx0sF.js.map +0 -1
  492. package/dist/chunks/datepicker-bOiM_zhJ.js +0 -2
  493. package/dist/chunks/datepicker-bOiM_zhJ.js.map +0 -1
  494. package/dist/chunks/dialogTransition-i9vw0i2Z.js.map +0 -1
  495. package/dist/chunks/divider-CjbF4OfA.js +0 -2
  496. package/dist/chunks/divider-CjbF4OfA.js.map +0 -1
  497. package/dist/chunks/drawer-C7Tz4XU_.js +0 -2
  498. package/dist/chunks/drawer-C7Tz4XU_.js.map +0 -1
  499. package/dist/chunks/file-input-CDM6qrmV.js +0 -2
  500. package/dist/chunks/file-input-CDM6qrmV.js.map +0 -1
  501. package/dist/chunks/flex-B52oLCCC.js.map +0 -1
  502. package/dist/chunks/floating-input-DmSZZc27.js +0 -2
  503. package/dist/chunks/floating-input-DmSZZc27.js.map +0 -1
  504. package/dist/chunks/focus-ring-SR_LwaN7.js +0 -2
  505. package/dist/chunks/focus-ring-SR_LwaN7.js.map +0 -1
  506. package/dist/chunks/focusRedirect-BrvK3U_o.js +0 -2
  507. package/dist/chunks/focusRedirect-BrvK3U_o.js.map +0 -1
  508. package/dist/chunks/form-GpdAyWWi.js +0 -2
  509. package/dist/chunks/form-GpdAyWWi.js.map +0 -1
  510. package/dist/chunks/form-field-CNPGTMiW.js.map +0 -1
  511. package/dist/chunks/grid-C7tO-ppc.js +0 -2
  512. package/dist/chunks/grid-C7tO-ppc.js.map +0 -1
  513. package/dist/chunks/icon-BQsT6YtE.js +0 -2
  514. package/dist/chunks/icon-BQsT6YtE.js.map +0 -1
  515. package/dist/chunks/iconSlot-BNu2MrFI.js +0 -2
  516. package/dist/chunks/iconSlot-BNu2MrFI.js.map +0 -1
  517. package/dist/chunks/input-adorn-DwdX-jxA.js +0 -2
  518. package/dist/chunks/input-adorn-DwdX-jxA.js.map +0 -1
  519. package/dist/chunks/input-group-Cuiuf4Dl.js +0 -2
  520. package/dist/chunks/input-group-Cuiuf4Dl.js.map +0 -1
  521. package/dist/chunks/list-07e2a1Ym.js +0 -2
  522. package/dist/chunks/list-07e2a1Ym.js.map +0 -1
  523. package/dist/chunks/menu-Upf6P-2P.js +0 -2
  524. package/dist/chunks/menu-Upf6P-2P.js.map +0 -1
  525. package/dist/chunks/modal-bgDR29Jh.js +0 -2
  526. package/dist/chunks/modal-bgDR29Jh.js.map +0 -1
  527. package/dist/chunks/nav-DI6oEULI.js +0 -2
  528. package/dist/chunks/nav-DI6oEULI.js.map +0 -1
  529. package/dist/chunks/nav-overflow-DlLer6EK.js +0 -2
  530. package/dist/chunks/nav-overflow-DlLer6EK.js.map +0 -1
  531. package/dist/chunks/navOverflow-B5krZe6D.js +0 -2
  532. package/dist/chunks/navOverflow-B5krZe6D.js.map +0 -1
  533. package/dist/chunks/navVariant-DeGTk9B7.js.map +0 -1
  534. package/dist/chunks/navbar-DxIwt0sc.js +0 -2
  535. package/dist/chunks/navbar-DxIwt0sc.js.map +0 -1
  536. package/dist/chunks/notification-Dbci5Ka3.js +0 -2
  537. package/dist/chunks/notification-Dbci5Ka3.js.map +0 -1
  538. package/dist/chunks/number-field-IBIX2IWH.js +0 -2
  539. package/dist/chunks/number-field-IBIX2IWH.js.map +0 -1
  540. package/dist/chunks/otp-input-ws393uPB.js +0 -2
  541. package/dist/chunks/otp-input-ws393uPB.js.map +0 -1
  542. package/dist/chunks/overlayPlacement-BtS90IVf.js.map +0 -1
  543. package/dist/chunks/pagination-BREQp-ZC.js +0 -2
  544. package/dist/chunks/pagination-BREQp-ZC.js.map +0 -1
  545. package/dist/chunks/password-strength-DDK8pHRq.js.map +0 -1
  546. package/dist/chunks/placeholder-DhNpUJqv.js +0 -2
  547. package/dist/chunks/placeholder-DhNpUJqv.js.map +0 -1
  548. package/dist/chunks/polymorphic-BhGNZQja.js +0 -2
  549. package/dist/chunks/polymorphic-BhGNZQja.js.map +0 -1
  550. package/dist/chunks/popover-Bdg8D4sm.js +0 -2
  551. package/dist/chunks/popover-Bdg8D4sm.js.map +0 -1
  552. package/dist/chunks/progress-BqgWezdG.js +0 -2
  553. package/dist/chunks/progress-BqgWezdG.js.map +0 -1
  554. package/dist/chunks/radio-B6gJdtoN.js +0 -2
  555. package/dist/chunks/radio-B6gJdtoN.js.map +0 -1
  556. package/dist/chunks/range-input-CT_8TKL7.js +0 -2
  557. package/dist/chunks/range-input-CT_8TKL7.js.map +0 -1
  558. package/dist/chunks/renderFormCheck-DN_-V62U.js +0 -2
  559. package/dist/chunks/renderFormCheck-DN_-V62U.js.map +0 -1
  560. package/dist/chunks/renderFormField-Brkw1yA6.js +0 -2
  561. package/dist/chunks/renderFormField-Brkw1yA6.js.map +0 -1
  562. package/dist/chunks/renderMenuItemContent-DUezZrpj.js +0 -2
  563. package/dist/chunks/renderMenuItemContent-DUezZrpj.js.map +0 -1
  564. package/dist/chunks/scrollspy-C2HmrnZ4.js +0 -2
  565. package/dist/chunks/scrollspy-C2HmrnZ4.js.map +0 -1
  566. package/dist/chunks/search-field--nDoCI_E.js +0 -2
  567. package/dist/chunks/search-field--nDoCI_E.js.map +0 -1
  568. package/dist/chunks/select-BwJIfv9f.js +0 -2
  569. package/dist/chunks/select-BwJIfv9f.js.map +0 -1
  570. package/dist/chunks/skeleton-Bjv9gGd3.js +0 -2
  571. package/dist/chunks/skeleton-Bjv9gGd3.js.map +0 -1
  572. package/dist/chunks/slot-CNhFZdHF.js +0 -2
  573. package/dist/chunks/slot-CNhFZdHF.js.map +0 -1
  574. package/dist/chunks/spinner-DBuvQvMR.js +0 -2
  575. package/dist/chunks/spinner-DBuvQvMR.js.map +0 -1
  576. package/dist/chunks/stack-DK5F53VT.js +0 -2
  577. package/dist/chunks/stack-DK5F53VT.js.map +0 -1
  578. package/dist/chunks/static-table-uu297Liz.js +0 -2
  579. package/dist/chunks/static-table-uu297Liz.js.map +0 -1
  580. package/dist/chunks/stepper-CVXMJ2yg.js +0 -2
  581. package/dist/chunks/stepper-CVXMJ2yg.js.map +0 -1
  582. package/dist/chunks/switch-C6s3LxEv.js +0 -2
  583. package/dist/chunks/switch-C6s3LxEv.js.map +0 -1
  584. package/dist/chunks/table-DPLOygg0.js +0 -2
  585. package/dist/chunks/table-DPLOygg0.js.map +0 -1
  586. package/dist/chunks/tableClassName-DleBjOj2.js +0 -2
  587. package/dist/chunks/tableClassName-DleBjOj2.js.map +0 -1
  588. package/dist/chunks/tabs-91T7-8qq.js +0 -2
  589. package/dist/chunks/tabs-91T7-8qq.js.map +0 -1
  590. package/dist/chunks/text-input-B4pTv6SU.js +0 -2
  591. package/dist/chunks/text-input-B4pTv6SU.js.map +0 -1
  592. package/dist/chunks/textarea-1A1nABQE.js +0 -2
  593. package/dist/chunks/textarea-1A1nABQE.js.map +0 -1
  594. package/dist/chunks/time-field-B3MA7ED_.js +0 -2
  595. package/dist/chunks/time-field-B3MA7ED_.js.map +0 -1
  596. package/dist/chunks/toast-CGHl3-oU.js +0 -2
  597. package/dist/chunks/toast-CGHl3-oU.js.map +0 -1
  598. package/dist/chunks/tooltip-Bc-u6nIW.js +0 -2
  599. package/dist/chunks/tooltip-Bc-u6nIW.js.map +0 -1
  600. package/dist/chunks/tree-Cql1veeZ.js +0 -2
  601. package/dist/chunks/tree-Cql1veeZ.js.map +0 -1
  602. package/dist/chunks/useButtonSemantics-CILM_lhi.js.map +0 -1
  603. package/dist/chunks/useDialogElement-CgOnJAzu.js +0 -2
  604. package/dist/chunks/useDialogElement-CgOnJAzu.js.map +0 -1
  605. package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js +0 -2
  606. package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js.map +0 -1
  607. package/dist/chunks/useFloatingOverlay-DLIvwx-8.js +0 -2
  608. package/dist/chunks/useFloatingOverlay-DLIvwx-8.js.map +0 -1
  609. package/dist/chunks/useForkedRef-DVEfT-KI.js +0 -2
  610. package/dist/chunks/useForkedRef-DVEfT-KI.js.map +0 -1
  611. package/dist/chunks/useFormField-BOqmBTC4.js +0 -2
  612. package/dist/chunks/useFormField-BOqmBTC4.js.map +0 -1
  613. package/dist/chunks/useOpenStateProps-DykUbnPJ.js.map +0 -1
  614. package/dist/chunks/useToastRegionQueue-CIV5SdiE.js +0 -2
  615. package/dist/chunks/useToastRegionQueue-CIV5SdiE.js.map +0 -1
  616. package/dist/chunks/useTransitionState-e5ToY7eX.js.map +0 -1
  617. package/dist/chunks/visibleState-B_i1zHu2.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chip-DCaWaBqo.js","names":[],"sources":["../../src/components/chip/Chip.tsx"],"sourcesContent":["import React, {\n ElementType,\n ForwardRefRenderFunction,\n MouseEventHandler,\n ReactElement,\n Ref\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { ContextColor, ContextStyle } from '../../types'\nimport { useButtonSemantics, useDisabledAnchorGuard } from '../../hooks'\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype ChipOwnProps<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 * Defaults to `span`, or `a` when `href` is set.\n */\n component?: C\n /**\n * Toggle the disabled state for the component. Applied as the native `disabled` attribute when\n * `component` is `button`, or the `.disabled` class for every other element (a bare `<span>`/\n * `<a>` has no real `disabled` attribute).\n */\n disabled?: boolean\n /**\n * Renders the chip as a link to this URL. Defaults `component` to `a`.\n */\n href?: string\n /**\n * Fires on click. Typed for every element `component` can actually render, rather than\n * narrowed to whichever element `C` happens to be.\n */\n onClick?: MouseEventHandler<HTMLElement>\n /**\n * Marks the chip as pressed for toggle-style usage (e.g. a filter chip). Applies the `.active`\n * class and sets `aria-pressed` so assistive technology announces the toggle state.\n */\n pressed?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Specifies the type of button. Only applies when `component` is `button`. Different browsers\n * may use different default types for the `<button>` element, so always specify it explicitly.\n */\n type?: 'button' | 'submit' | 'reset'\n /**\n * Set the chip style variant. `solid`/`basic` render the default look with no extra class.\n */\n variant?: ContextStyle\n}\n\nexport type ChipProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n ChipOwnProps<C>\n>\n\ntype ChipComponent = (<C extends ElementType = 'span'>(\n props: ChipProps<C> & { ref?: PolymorphicRefWithFallback<C, HTMLSpanElement | HTMLAnchorElement> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ChipRender<C extends ElementType = 'span'>(\n {\n children,\n className,\n color,\n component,\n disabled,\n href,\n onClick,\n pressed,\n size,\n type = 'button',\n variant,\n ...rest\n }: ChipProps<C>,\n ref: PolymorphicRef<C>\n) {\n // `href` makes it an `<a>`, unless `component` or `asChild` chose the element (see\n // `linkElement`).\n const Component = linkElement(component, href, 'span')\n // The kind rather than the tag, counting a router link with `href` or `to` as an anchor: under `asChild`, `Component` is a `Slot` standing in for the\n // caller's element, and a slotted `<a>` needs what `component=\"a\"` gets.\n const kind = resolveLinkKind(Component, href, rest)\n const linkProps = hrefProps(kind, href, 'Chip')\n const isButton = kind === 'button'\n const isAnchor = kind === 'anchor'\n\n const _className = classNames(\n 'chip',\n color,\n size,\n {\n outline: variant === 'outline',\n smooth: variant === 'smooth',\n active: pressed,\n disabled: !isButton && disabled\n },\n className\n )\n\n // `<a>`/`<span>`/`<div>` have no real `disabled` attribute, so a disabled non-button chip\n // still fires click (and an anchor still navigates) unless it's blocked here, same guard\n // `Button`/`CloseButton` apply.\n const handleClick = useDisabledAnchorGuard<HTMLElement>(!isButton, disabled, onClick)\n\n // A default (non-`button`/`a`) chip — the documented `pressed`/filter-chip use case — gets a\n // raw `onClick` with no keyboard semantics otherwise, the same gap `Link` fills via\n // `useButtonSemantics`. Skipped when the caller already supplied their own `role` via `rest`\n // (e.g. `ChipList`'s `role=\"row\"` grid semantics) — that caller is trusted to handle its own\n // keyboard interaction, same as `CloseButton`'s `isComponentReference` escape hatch.\n const hasExplicitRole = (rest as Record<string, unknown>).role !== undefined\n const needsButtonSemantics = !isButton && !isAnchor && !!onClick && !hasExplicitRole\n const { buttonProps, forkedRef } = useButtonSemantics<HTMLElement>(ref as Ref<HTMLElement>, {\n disabled,\n onClick\n })\n\n if (isButton) {\n const NativeButton = Component as 'button'\n return (\n <NativeButton\n {...(rest as Record<string, unknown>)}\n aria-pressed={pressed}\n className={_className}\n disabled={disabled}\n onClick={handleClick as MouseEventHandler<HTMLButtonElement>}\n ref={ref as Ref<HTMLButtonElement>}\n type={type}\n >\n {children}\n </NativeButton>\n )\n }\n\n if (isAnchor) {\n const Anchor = Component as 'a'\n return (\n <Anchor\n {...(rest as Record<string, unknown>)}\n aria-pressed={pressed}\n className={_className}\n {...linkProps}\n onClick={handleClick as MouseEventHandler<HTMLAnchorElement>}\n {...(disabled && { 'aria-disabled': true, tabIndex: -1 })}\n ref={ref as Ref<HTMLAnchorElement>}\n >\n {children}\n </Anchor>\n )\n }\n\n return (\n <Component\n {...(mergeProps(rest, needsButtonSemantics ? buttonProps : {}) as Record<string, unknown>)}\n aria-pressed={pressed}\n className={_className}\n {...(!needsButtonSemantics && { onClick: handleClick })}\n {...(disabled && { 'aria-disabled': true })}\n {...linkProps}\n ref={needsButtonSemantics ? forkedRef : ref}\n >\n {children}\n </Component>\n )\n}\n\nexport const Chip = createPolymorphicComponent<ChipComponent>(\n ChipRender as ForwardRefRenderFunction<Element, ChipProps<ElementType>>,\n 'Chip'\n)\n"],"mappings":"wSA8EA,SAAS,EACP,CACE,WACA,YACA,QACA,YACA,WACA,OACA,UACA,UACA,OACA,OAAO,SACP,UACA,GAAG,GAEL,EACA,CAGA,IAAM,EAAY,EAAY,EAAW,EAAM,MAAM,EAG/C,EAAO,EAAgB,EAAW,EAAM,CAAI,EAC5C,EAAY,EAAU,EAAM,EAAM,MAAM,EACxC,EAAW,IAAS,SACpB,EAAW,IAAS,SAEpB,EAAa,EACjB,OACA,EACA,EACA,CACE,QAAS,IAAY,UACrB,OAAQ,IAAY,SACpB,OAAQ,EACR,SAAU,CAAC,GAAY,CACzB,EACA,CACF,EAKM,EAAc,EAAoC,CAAC,EAAU,EAAU,CAAO,EAO9E,EAAmB,EAAiC,OAAS,IAAA,GAC7D,EAAuB,CAAC,GAAY,CAAC,GAAY,CAAC,CAAC,GAAW,CAAC,EAC/D,CAAE,cAAa,aAAc,EAAgC,EAAyB,CAC1F,WACA,SACF,CAAC,EAED,GAAI,EAAU,CACZ,IAAM,EAAe,EACrB,OACE,EAAA,cAAC,EAAD,CACE,GAAK,EACL,eAAc,EACd,UAAW,EACD,WACV,QAAS,EACJ,MACC,MAGM,EADX,CACW,CAElB,CAEA,GAAI,EAAU,CACZ,IAAM,EAAS,EACf,OACE,EAAA,cAAC,EAAD,CACE,GAAK,EACL,eAAc,EACd,UAAW,EACX,GAAI,EACJ,QAAS,EACT,GAAK,GAAY,CAAE,gBAAiB,GAAM,SAAU,EAAG,EAClD,KAGC,EADL,CACK,CAEZ,CAEA,OACE,EAAA,cAAC,EAAD,CACE,GAAK,EAAW,EAAM,EAAuB,EAAc,CAAC,CAAC,EAC7D,eAAc,EACd,UAAW,EACX,GAAK,CAAC,GAAwB,CAAE,QAAS,CAAY,EACrD,GAAK,GAAY,CAAE,gBAAiB,EAAK,EACzC,GAAI,EACJ,IAAK,EAAuB,EAAY,CAG/B,EADR,CACQ,CAEf,CAEA,MAAa,EAAO,EAClB,EACA,MACF"}
@@ -1,2 +0,0 @@
1
- import{d as e,g as t,p as n}from"./slot-CNhFZdHF.js";import{t as r}from"./polymorphic-BhGNZQja.js";import{t as i}from"./useButtonSemantics-CILM_lhi.js";import{t as a}from"./useDisabledAnchorGuard-Cz58UCXy.js";import o from"react";import s from"classnames";import{mergeProps as c}from"react-aria";function l({children:r,className:l,color:u,component:d,disabled:f,href:p,label:m,onClick:h,size:g,type:_=`button`,variant:v,...y},b){let x=n(d,p,`button`),S=t(x,p,y),C=e(S,p,`CloseButton`),w=S===`component`,T=w?l:s(`close-button`,{context:u||v,disabled:S!==`button`&&f},u,v,g,l),E=m??(r==null?`Close`:void 0),D=a(S===`anchor`,f,h),{buttonProps:O,forkedRef:k}=i(b,{disabled:f,onClick:h});if(S===`button`){let e=x;return o.createElement(e,{className:T,"aria-label":E,...y,type:_,disabled:f,onClick:D,ref:b},r)}if(S===`anchor`){let e=x;return o.createElement(e,{className:T,"aria-label":E,...y,...C,onClick:D,...f&&{"aria-disabled":!0,tabIndex:-1},ref:b},r)}let A=x;return o.createElement(A,{className:T,"aria-label":E,...w?{color:u,size:g,variant:v,disabled:f,onClick:h,...y}:c(y,O),...C,ref:w?b:k},r)}const u=r(l,`CloseButton`);export{u as t};
2
- //# sourceMappingURL=CloseButton-DPgQztE0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CloseButton-DPgQztE0.js","names":[],"sources":["../../src/components/close-button/CloseButton.tsx"],"sourcesContent":["import React, {\n ElementType,\n ForwardRefRenderFunction,\n MouseEventHandler,\n ReactElement,\n Ref\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { ContextColor, ContextStyle } from '../../types'\nimport { useButtonSemantics, useDisabledAnchorGuard } from '../../hooks'\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype CloseButtonOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors. Applies the\n * `context` class alongside it, so the icon picks up that color without needing\n * an ancestor `.context` wrapper.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n * A custom HTML tag (e.g. `'span'`) gets button semantics — role, focus, Enter/Space\n * activation — filled in automatically. A component is trusted to handle its own semantics,\n * so pass one that's already interactive (e.g. `Button`).\n */\n component?: C\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * The href attribute specifies the URL of the page the link goes to. Renders an `<a>` in place\n * of the `<button>`, unless `component` or `asChild` chose the element.\n */\n href?: string\n /**\n * The accessible label announced by assistive technology. Override this to\n * localize the button for non-English contexts.\n */\n label?: string\n /**\n * Fires on click. Typed for every element `component` can actually render (`button` or `a`\n * natively, plus whatever a custom `component` renders), rather than narrowed to\n * `HTMLButtonElement` alone.\n */\n onClick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Specifies the type of button. Always specify the type attribute for the `<button>` element.\n * Different browsers may use different default types for the `<button>` element.\n */\n type?: 'button' | 'submit' | 'reset'\n /**\n * Set the close button's context style variant. Applies the `context` class\n * alongside it, same as `color`.\n */\n variant?: ContextStyle\n}\n\nexport type CloseButtonProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n CloseButtonOwnProps<C>\n>\n\ntype CloseButtonComponent = (<C extends ElementType = 'button'>(\n props: CloseButtonProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLButtonElement | HTMLAnchorElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CloseButtonRender<C extends ElementType = 'button'>(\n {\n children,\n className,\n color,\n component,\n disabled,\n href,\n label,\n onClick,\n size,\n type = 'button',\n variant,\n ...rest\n }: CloseButtonProps<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 be dropped unless `component=\"a\"` was passed as well.\n const component_ = linkElement(component, href, 'button')\n // The kind rather than the tag, counting a router link with `href` or `to` as an anchor: under `asChild`, `component_` is a `Slot` standing in for the\n // caller's element, and a slotted `<a>` needs what `component=\"a\"` gets.\n const kind = resolveLinkKind(component_, href, rest)\n const linkProps = hrefProps(kind, href, 'CloseButton')\n\n // A component reference (e.g. `Button`) has its own visual identity and its own\n // `color`/`size`/`variant` semantics — CloseButton's icon styling (the `close-button`\n // class and its context/color/variant/size classes) would just conflict with it, and\n // would also swallow those props before the component ever saw them. So a component\n // reference gets none of CloseButton's own styling; `color`/`size`/`variant` pass\n // through untouched, same as `className`, letting the component interpret them itself.\n const isComponentReference = kind === 'component'\n\n // Only a bare, non-`button` HTML tag needs the `.disabled` class applied by hand — a real\n // `<button>` gets native `:disabled` styling for free (chassis-css matches both selectors,\n // `&:disabled, &.disabled`), and a component reference isn't styled by CloseButton at all\n // (see `isComponentReference` above).\n const _className = isComponentReference\n ? className\n : classNames(\n 'close-button',\n { context: color || variant, disabled: kind !== 'button' && disabled },\n color,\n variant,\n size,\n className\n )\n\n // The default icon-only close button has no visible text, so it needs the 'Close' fallback\n // as its accessible name. Once `children` renders visible content (e.g. custom text passed\n // through `component`), let that content be the accessible name instead — forcing the\n // fallback label here would silently override it (a Label-in-Name accessibility failure).\n // An explicit `label` always wins either way, same as an explicit `aria-label` always did.\n const _label = label ?? (children == null ? 'Close' : undefined)\n\n // `<a>` has no real `disabled` attribute, so a disabled link close-button still fires\n // click (and still navigates) unless it's blocked here, same guard `Button` applies.\n const handleClick = useDisabledAnchorGuard<HTMLButtonElement | HTMLAnchorElement>(\n kind === 'anchor',\n disabled,\n onClick\n )\n\n const { buttonProps, forkedRef } = useButtonSemantics<HTMLButtonElement | HTMLAnchorElement>(\n ref as Ref<HTMLButtonElement | HTMLAnchorElement>,\n { disabled, onClick }\n )\n\n // Rendered as explicit branches, same as `Button`, rather than one `<Component>` tag\n // driven by a `'button' | 'a' | ElementType`-typed variable — a union-typed tag would\n // make JSX intersect all of `button`/`a`/custom prop types at once. Each branch renders\n // `component_` typed as its tag: the tag itself, or the `Slot` holding an element of that kind.\n // `aria-label={_label}` comes before `...rest` in every branch below so that an explicit\n // `aria-label` (not destructured above, so it lands in `rest`) overrides the computed\n // fallback via JSX's last-attribute-wins rule, rather than the other way around.\n if (kind === 'button') {\n const NativeButton = component_ as 'button'\n return (\n <NativeButton\n className={_className}\n aria-label={_label}\n {...(rest as Record<string, unknown>)}\n type={type}\n disabled={disabled}\n onClick={handleClick}\n ref={ref as Ref<HTMLButtonElement>}\n >\n {children}\n </NativeButton>\n )\n }\n\n if (kind === 'anchor') {\n const Anchor = component_ as 'a'\n return (\n <Anchor\n className={_className}\n aria-label={_label}\n {...(rest as Record<string, unknown>)}\n {...linkProps}\n onClick={handleClick}\n {...(disabled && { 'aria-disabled': true, tabIndex: -1 })}\n ref={ref as Ref<HTMLAnchorElement>}\n >\n {children}\n </Anchor>\n )\n }\n\n const Component = component_ as ElementType\n\n // Only a bare, non-`button`/`a` HTML tag (e.g. `'span'`) reaches here needing synthesized\n // button semantics — a component reference is trusted to already be interactive, so it\n // skips `buttonProps` (double keyboard activation) and instead gets `color`/`size`/`variant`\n // passed through untouched, per the comment on `isComponentReference` above.\n return (\n <Component\n className={_className}\n aria-label={_label}\n {...(isComponentReference\n ? ({ color, size, variant, disabled, onClick, ...rest } as Record<string, unknown>)\n : (mergeProps(rest, buttonProps) as Record<string, unknown>))}\n {...linkProps}\n ref={isComponentReference ? ref : forkedRef}\n >\n {children}\n </Component>\n )\n}\n\nexport const CloseButton = createPolymorphicComponent<CloseButtonComponent>(\n CloseButtonRender as ForwardRefRenderFunction<Element, CloseButtonProps<ElementType>>,\n 'CloseButton'\n)\n"],"mappings":"wSAqFA,SAAS,EACP,CACE,WACA,YACA,QACA,YACA,WACA,OACA,QACA,UACA,OACA,OAAO,SACP,UACA,GAAG,GAEL,EACA,CAGA,IAAM,EAAa,EAAY,EAAW,EAAM,QAAQ,EAGlD,EAAO,EAAgB,EAAY,EAAM,CAAI,EAC7C,EAAY,EAAU,EAAM,EAAM,aAAa,EAQ/C,EAAuB,IAAS,YAMhC,EAAa,EACf,EACA,EACE,eACA,CAAE,QAAS,GAAS,EAAS,SAAU,IAAS,UAAY,CAAS,EACrE,EACA,EACA,EACA,CACF,EAOE,EAAS,IAAU,GAAY,KAAO,QAAU,IAAA,IAIhD,EAAc,EAClB,IAAS,SACT,EACA,CACF,EAEM,CAAE,cAAa,aAAc,EACjC,EACA,CAAE,WAAU,SAAQ,CACtB,EASA,GAAI,IAAS,SAAU,CACrB,IAAM,EAAe,EACrB,OACE,EAAA,cAAC,EAAD,CACE,UAAW,EACX,aAAY,EACZ,GAAK,EACC,OACI,WACV,QAAS,EACJ,KAGO,EADX,CACW,CAElB,CAEA,GAAI,IAAS,SAAU,CACrB,IAAM,EAAS,EACf,OACE,EAAA,cAAC,EAAD,CACE,UAAW,EACX,aAAY,EACZ,GAAK,EACL,GAAI,EACJ,QAAS,EACT,GAAK,GAAY,CAAE,gBAAiB,GAAM,SAAU,EAAG,EAClD,KAGC,EADL,CACK,CAEZ,CAEA,IAAM,EAAY,EAMlB,OACE,EAAA,cAAC,EAAD,CACE,UAAW,EACX,aAAY,EACZ,GAAK,EACA,CAAE,QAAO,OAAM,UAAS,WAAU,UAAS,GAAG,CAAK,EACnD,EAAW,EAAM,CAAW,EACjC,GAAI,EACJ,IAAK,EAAuB,EAAM,CAGzB,EADR,CACQ,CAEf,CAEA,MAAa,EAAc,EACzB,EACA,aACF"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./lazyElement-tfMG21pZ.js";import{t}from"./iconSlot-BNu2MrFI.js";import{t as n}from"./renderMenuItemContent-DUezZrpj.js";import r,{useRef as i}from"react";import a from"classnames";import{useListBox as o,useOption as s}from"react-aria";import{Item as c,Section as l}from"react-stately";const u=e=>null;u.displayName=`ComboboxItem`;const d=e=>e.entryType===`group`,f=(t,{Group:n,Item:i})=>{let a=[];return r.Children.forEach(t,(t,o)=>{if(e(t,n)){let n=t.props,s=[];r.Children.forEach(n.children,t=>{e(t,i)&&s.push(t)}),a.push({entryType:`group`,key:`group-${o}`,label:n.label,items:s});return}e(t,i)&&a.push(t)}),a},p=e=>{let t=[],n=null;return e.forEach(e=>{if(e.type===`divider`)return;if(e.type===`header`){n={entryType:`group`,key:e.id,label:e.label,items:[]},t.push(n);return}let i=r.createElement(u,{key:e.id,id:e.id,disabled:e.disabled,icon:e.icon,description:e.description,textValue:e.textValue},e.label);n?n.items.push(i):t.push(i)}),t},m=e=>e.reduce((e,t)=>{let n=d(t)?t.items:[t];return e.concat(n.filter(e=>e.props.disabled).map(e=>e.props.id))},[]),h=e=>r.createElement(c,{key:e.props.id,textValue:e.props.textValue??(typeof e.props.children==`string`?e.props.children:void 0)},n({icon:e.props.icon,label:e.props.children,description:e.props.description})),g=e=>d(e)?r.createElement(l,{key:e.key,title:e.label,items:e.items},h):h(e),_={"--cx-icon-color":`var(--cx-item-hover-icon-color)`,"--cx-item-fg-color":`var(--cx-item-hover-fg-color)`,"--cx-item-bg-color":`var(--cx-item-hover-bg-color)`},v=e=>e?_:void 0,y=({listBoxProps:e,listBoxRef:t,state:n})=>{let{listBoxProps:i}=o(e,n,t);return r.createElement(`div`,{...i,ref:t},[...n.collection].map(e=>e.type===`section`?r.createElement(b,{key:e.key,node:e,state:n}):r.createElement(x,{key:e.key,item:e,state:n})))},b=({node:e,state:t})=>{let n=[...t.collection.getChildren(e.key)];return n.length===0?null:r.createElement(r.Fragment,null,r.createElement(`div`,{className:`menu-header`,role:`presentation`},e.rendered),n.map(e=>r.createElement(x,{key:e.key,item:e,state:t})))},x=({item:e,state:n})=>{let o=i(null),{optionProps:c,isSelected:l,isDisabled:u,isFocused:d}=s({key:e.key},n,o);return r.createElement(`div`,{className:a(`menu-item`,{selected:l,disabled:u}),style:v(d),...c,ref:o},e.rendered,l&&r.createElement(t,{icon:`check`,className:`menu-item-check`}))};export{m as a,g as i,f as n,u as o,p as r,y as t};
2
- //# sourceMappingURL=ComboboxListBox-Cm3L1ULl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComboboxListBox-Cm3L1ULl.js","names":[],"sources":["../../src/components/combobox/ComboboxItem.tsx","../../src/utils/comboboxCollection.tsx","../../src/utils/virtualFocusStyle.ts","../../src/components/combobox/ComboboxListBox.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { Key } from 'react-stately'\n\nexport interface ComboboxItemProps {\n /**\n * Content of the option. Used as the filter/typeahead text when `textValue` isn't set — pass\n * `textValue` explicitly whenever `children` isn't a plain string (e.g. it wraps an icon or\n * other rich markup), since it can't otherwise be derived from rich content.\n */\n children: ReactNode\n /**\n * Secondary line of text rendered below `children` (`.menu-item-description`).\n */\n description?: ReactNode\n /**\n * Prevents the option from being selected, focused, or otherwise interacted with.\n */\n disabled?: boolean\n /**\n * Icon rendered at the option's leading edge (`.menu-item-icon`).\n */\n icon?: ReactNode\n /**\n * Identifies this option. Submitted as the value when this option is selected.\n */\n id: Key\n /**\n * Text used for filtering and typeahead. Required when `children` isn't a plain string —\n * falls back to `children` itself when omitted and `children` is a string.\n */\n textValue?: string\n}\n\n// `ComboboxItem` is never actually mounted — like `Tab`, it's read as data by `Combobox`,\n// which builds react-aria's listbox collection from each item's `id` and `children`. This keeps\n// the public authoring shape as plain composed JSX:\n//\n// <Combobox aria-label=\"Fruit\">\n// <ComboboxItem id=\"apple\">Apple</ComboboxItem>\n// <ComboboxItem id=\"banana\">Banana</ComboboxItem>\n// </Combobox>\nexport const ComboboxItem = (_props: ComboboxItemProps): null => null\n\nComboboxItem.displayName = 'ComboboxItem'\n","import React, { ComponentType, ReactElement, ReactNode } from 'react'\nimport { Item, Key, Section } from 'react-stately'\n\nimport { ComboboxGroupProps } from '../components/combobox/ComboboxGroup'\nimport { ComboboxItem, ComboboxItemProps } from '../components/combobox/ComboboxItem'\nimport { MenuItemsDef } from '../components/menu/MenuItemDef'\nimport { isElementOfType } from './lazyElement'\nimport { renderMenuItemContent } from './renderMenuItemContent'\n\n// Shared between Combobox.tsx/ComboboxListBox.tsx (which build/render this collection) and\n// Autocomplete.tsx (which reuses the same entry shape — see the comment on\n// `buildEntriesFromChildren` below). Lives in `utils/` rather than `components/combobox/` because\n// it crosses that folder boundary; kept in its own file to also avoid a circular import between\n// Combobox.tsx and ComboboxListBox.tsx.\n\nexport type ComboboxItemElement = ReactElement<ComboboxItemProps>\n\nexport interface ComboboxGroupEntry {\n entryType: 'group'\n key: Key\n label: ReactNode\n items: ComboboxItemElement[]\n}\n\nexport type ComboboxEntry = ComboboxItemElement | ComboboxGroupEntry\n\n// `useComboBoxState`/`useComboBox`'s own `SelectionMode` ('single' | 'multiple') isn't\n// re-exported from react-stately's public entry point (only `ComboBoxState` etc. are) — this is\n// a structurally-identical stand-in so `ComboboxListBox` can stay generic over it without a\n// fragile deep import.\nexport type ComboboxSelectionMode = 'single' | 'multiple'\n\nexport const isComboboxGroupEntry = (entry: ComboboxEntry): entry is ComboboxGroupEntry =>\n (entry as ComboboxGroupEntry).entryType === 'group'\n\n// `Autocomplete`'s own `AutocompleteItem`/`AutocompleteGroup` are structurally identical to\n// `ComboboxItem`/`ComboboxGroup` (see AutocompleteItem.tsx/AutocompleteGroup.tsx — kept as\n// separate named types only so `Autocomplete`'s public API doesn't leak `Combobox`'s own prop\n// type), but they're different *runtime* component identities, which is what\n// `buildEntriesFromChildren` below needs to check consumer-authored `children` against. Passing\n// the pair in lets one implementation serve both families instead of two near-duplicate copies.\nexport interface ComboboxCollectionComponents {\n Group: ComponentType<ComboboxGroupProps>\n Item: ComponentType<ComboboxItemProps>\n}\n\n// Splits `children` into a flat, ordered list of entries — bare `Item` elements and\n// `Group`-wrapped clusters of them — mirroring how `useComboBoxState`'s dynamic collection needs\n// top-level nodes: some rendered as a plain `<Item>`, some as a `<Section>` wrapping several\n// `<Item>`s (see `comboboxCollectionChildren` below).\nexport const buildEntriesFromChildren = (\n children: ReactNode,\n { Group, Item: ItemComponent }: ComboboxCollectionComponents\n): ComboboxEntry[] => {\n const entries: ComboboxEntry[] = []\n // `isElementOfType` rather than `child.type === Group`: written in a Server Component, the\n // children's types are lazy wrappers (see `./lazyElement`).\n React.Children.forEach(children, (child, index) => {\n if (isElementOfType<ComboboxGroupProps>(child, Group)) {\n const groupProps = child.props\n const items: ComboboxItemElement[] = []\n React.Children.forEach(groupProps.children, (groupChild) => {\n if (isElementOfType<ComboboxItemProps>(groupChild, ItemComponent)) items.push(groupChild)\n })\n entries.push({ entryType: 'group', key: `group-${index}`, label: groupProps.label, items })\n return\n }\n if (isElementOfType<ComboboxItemProps>(child, ItemComponent)) entries.push(child)\n })\n return entries\n}\n\n// Same shape as `buildEntriesFromChildren`, from a flat `MenuItemsDef` instead. A `'header'`\n// entry opens a new group that all following items join until the next header (or the end of\n// the array) — matching how chassis-css itself renders grouped items (flat siblings, no\n// wrapping element per group). `'divider'` entries aren't meaningful for a listbox/option\n// collection and are skipped.\n//\n// Always builds a bare `ComboboxItem` internally regardless of which family (`Combobox` or\n// `Autocomplete`) called it: unlike `buildEntriesFromChildren`, nothing downstream re-checks\n// these elements' runtime type (they're read only via `.props.*`, never matched against a\n// component reference again), so there's no need to thread `ComboboxCollectionComponents`\n// through here too. `def.href`/`def.onClick` are intentionally not read — see the doc comments on\n// `MenuItemDef` itself for why: they're `Menu`-only fields on this shared type.\nexport const buildEntriesFromItemsDef = (defs: MenuItemsDef): ComboboxEntry[] => {\n const entries: ComboboxEntry[] = []\n let currentGroup: ComboboxGroupEntry | null = null\n\n defs.forEach((def) => {\n if (def.type === 'divider') return\n if (def.type === 'header') {\n currentGroup = { entryType: 'group', key: def.id, label: def.label, items: [] }\n entries.push(currentGroup)\n return\n }\n const item = (\n <ComboboxItem\n key={def.id}\n id={def.id}\n disabled={def.disabled}\n icon={def.icon}\n description={def.description}\n textValue={def.textValue}\n >\n {def.label}\n </ComboboxItem>\n )\n if (currentGroup) currentGroup.items.push(item)\n else entries.push(item)\n })\n\n return entries\n}\n\nexport const getDisabledKeys = (entries: ComboboxEntry[]): Key[] =>\n entries.reduce<Key[]>((keys, entry) => {\n const items = isComboboxGroupEntry(entry) ? entry.items : [entry]\n return keys.concat(items.filter((item) => item.props.disabled).map((item) => item.props.id))\n }, [])\n\n// Builds the react-stately `Item` node `useComboBoxState`'s collection actually renders from one\n// entry's props — identical for `Combobox` and `Autocomplete` regardless of which authoring\n// component (`ComboboxItem`/`AutocompleteItem`) produced it, since both share the same prop shape.\nexport const renderComboboxCollectionItem = (item: ComboboxItemElement) => (\n <Item\n key={item.props.id}\n textValue={\n item.props.textValue ??\n (typeof item.props.children === 'string' ? item.props.children : undefined)\n }\n >\n {renderMenuItemContent({\n icon: item.props.icon,\n label: item.props.children,\n description: item.props.description\n })}\n </Item>\n)\n\n// `useComboBoxState`'s own `children` render prop, given one `ComboboxEntry` — a plain `Item` for\n// a bare entry, a `Section` wrapping its items for a group. Identical for `Combobox` and\n// `Autocomplete`'s state setup.\nexport const comboboxCollectionChildren = (entry: ComboboxEntry) =>\n isComboboxGroupEntry(entry) ? (\n <Section key={entry.key} title={entry.label} items={entry.items}>\n {renderComboboxCollectionItem}\n </Section>\n ) : (\n renderComboboxCollectionItem(entry)\n )\n","import { CSSProperties } from 'react'\n\n// Options in a virtually-focused listbox (react-aria's combobox/listbox patterns) never receive\n// real DOM focus — focus stays on the trigger (a text input or button) while the highlighted\n// option is tracked virtually, so `:hover`/`:focus-visible` can't style it. To indicate the\n// highlight without touching chassis-css, we reuse its own hover color tokens (already defined\n// on the ancestor `.menu`, prefixed `--cx-` by chassis-css's build) as inline overrides instead\n// of relying on `.active`, which chassis-css reserves for the pressed/`:active` look.\nexport const virtualFocusStyle: CSSProperties = {\n '--cx-icon-color': 'var(--cx-item-hover-icon-color)',\n '--cx-item-fg-color': 'var(--cx-item-hover-fg-color)',\n '--cx-item-bg-color': 'var(--cx-item-hover-bg-color)'\n} as CSSProperties\n\nexport const getVirtualFocusStyle = (isFocused: boolean): CSSProperties | undefined =>\n isFocused ? virtualFocusStyle : undefined\n","import React, { RefObject, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaListBoxOptions, useListBox, useOption } from 'react-aria'\nimport { ComboBoxState, Node } from 'react-stately'\n\nimport { getVirtualFocusStyle } from '../../utils/virtualFocusStyle'\nimport { ComboboxEntry, ComboboxSelectionMode } from '../../utils/comboboxCollection'\nimport { IconSlot } from '../../utils/iconSlot'\n\ninterface ComboboxListBoxProps<M extends ComboboxSelectionMode = 'single'> {\n listBoxProps: AriaListBoxOptions<ComboboxEntry>\n listBoxRef: RefObject<HTMLElement | null>\n state: ComboBoxState<ComboboxEntry, M>\n}\n\n// Generic over `M` (single- vs multi-select) purely so both `Combobox` (always single) and\n// `Autocomplete` (either) can pass their own `ComboBoxState` here without a cast — nothing in\n// this file's rendering logic actually depends on which mode is active.\nexport const ComboboxListBox = <M extends ComboboxSelectionMode = 'single'>({\n listBoxProps,\n listBoxRef,\n state\n}: ComboboxListBoxProps<M>) => {\n const { listBoxProps: domListBoxProps } = useListBox(listBoxProps, state, listBoxRef)\n\n return (\n <div {...domListBoxProps} ref={listBoxRef as RefObject<HTMLDivElement>}>\n {[...state.collection].map((node) =>\n node.type === 'section' ? (\n <ComboboxSection key={node.key} node={node} state={state} />\n ) : (\n <ComboboxOption key={node.key} item={node} state={state} />\n )\n )}\n </div>\n )\n}\n\ninterface ComboboxSectionProps<M extends ComboboxSelectionMode = 'single'> {\n node: Node<ComboboxEntry>\n state: ComboBoxState<ComboboxEntry, M>\n}\n\n// Chassis-css groups are `.menu-header` siblings interleaved with `.menu-item`s, no wrapping\n// element — plain, static markup, so there's no need for react-aria's `useListBoxSection`.\n// `useComboBoxState`'s filtering hides child items whose text doesn't match, but doesn't drop an\n// emptied-out section node itself, so a fully-filtered-out group's header is skipped by hand here\n// rather than left to render on its own.\nconst ComboboxSection = <M extends ComboboxSelectionMode = 'single'>({\n node,\n state\n}: ComboboxSectionProps<M>) => {\n const childNodes = [...state.collection.getChildren!(node.key)]\n if (childNodes.length === 0) return null\n\n return (\n <>\n <div className=\"menu-header\" role=\"presentation\">\n {node.rendered}\n </div>\n {childNodes.map((child) => (\n <ComboboxOption key={child.key} item={child} state={state} />\n ))}\n </>\n )\n}\n\ninterface ComboboxOptionProps<M extends ComboboxSelectionMode = 'single'> {\n item: Node<ComboboxEntry>\n state: ComboBoxState<ComboboxEntry, M>\n}\n\nconst ComboboxOption = <M extends ComboboxSelectionMode = 'single'>({\n item,\n state\n}: ComboboxOptionProps<M>) => {\n const ref = useRef<HTMLDivElement>(null)\n const { optionProps, isSelected, isDisabled, isFocused } = useOption(\n { key: item.key },\n state,\n ref\n )\n\n return (\n <div\n className={classNames('menu-item', {\n selected: isSelected,\n disabled: isDisabled\n })}\n style={getVirtualFocusStyle(isFocused)}\n {...optionProps}\n ref={ref}\n >\n {item.rendered}\n {isSelected && <IconSlot icon=\"check\" className=\"menu-item-check\" />}\n </div>\n )\n}\n"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import{c as e,l as t}from"./slot-CNhFZdHF.js";import n,{useRef as r}from"react";import i from"classnames";import{useDateSegment as a}from"react-aria";const o=/^[\s\u2066-\u2069]+$/,s=new Set([`era`,`year`,`month`,`day`]),c=(e,t)=>{let n=e.slice(0,t).reverse().find(e=>e.type!==`literal`),r=e.slice(t+1).find(e=>e.type!==`literal`);return!!(n&&r)&&s.has(n.type)!==s.has(r.type)},l=({fieldLabelledBy:s,segment:l,slots:u,state:d})=>{let f=r(null),{segmentProps:p}=a(l,d,f),m=l.type===`literal`&&(o.test(l.text)||c(d.segments,d.segments.indexOf(l)));return n.createElement(`span`,{...t(p,...u),"aria-labelledby":p[`aria-labelledby`]&&e(p.id,s),className:m?void 0:i(`datepicker-segment`,{placeholder:l.isPlaceholder}),contentEditable:p.contentEditable||void 0,ref:f},l.text)};export{l as t};
2
- //# sourceMappingURL=DateSegment-2agXAd0f.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateSegment-2agXAd0f.js","names":[],"sources":["../../src/components/datepicker/DateSegment.tsx"],"sourcesContent":["import React, { useRef } from 'react'\nimport classNames from 'classnames'\nimport { useDateSegment } from 'react-aria'\nimport { DateFieldState, DateSegment as DateSegmentType } from 'react-stately'\n\nimport './DateSegment.scss'\nimport { joinIds, withoutSlotIds } from '../../utils/idRefs'\n\n// One editable part of a date or time field (a month, an hour, a day period), for `DateField`\n// and `TimeField` alike. A `TimeFieldState` is a `DateFieldState`.\n// A literal of spaces or bidi isolation marks (U+2066-U+2069) only.\nconst BLANK_LITERAL = /^[\\s\\u2066-\\u2069]+$/\nconst DATE_PARTS = new Set(['era', 'year', 'month', 'day'])\n\n// Whether a literal stands between a field's date and its time (en-US \", \"), found by the\n// editable parts on either side of it.\nconst separatesDateAndTime = (segments: DateSegmentType[], index: number) => {\n const before = segments\n .slice(0, index)\n .reverse()\n .find((segment) => segment.type !== 'literal')\n const after = segments.slice(index + 1).find((segment) => segment.type !== 'literal')\n return Boolean(before && after) && DATE_PARTS.has(before!.type) !== DATE_PARTS.has(after!.type)\n}\n\nexport interface DateSegmentProps {\n fieldLabelledBy?: string\n segment: DateSegmentType\n slots: { id?: string }[]\n state: DateFieldState\n}\n\nexport const DateSegment = ({ fieldLabelledBy, segment, slots, state }: DateSegmentProps) => {\n const ref = useRef<HTMLDivElement>(null)\n const { segmentProps } = useDateSegment(segment, state, ref)\n const plain =\n segment.type === 'literal' &&\n (BLANK_LITERAL.test(segment.text) ||\n separatesDateAndTime(state.segments, state.segments.indexOf(segment)))\n\n return (\n <span\n {...withoutSlotIds(segmentProps, ...slots)}\n // react-aria labels a segment by an id of its own, which it merges into the segment's `id`\n // only after hydration, and by the field's label. The server's HTML referred to the first,\n // an id no element had.\n aria-labelledby={segmentProps['aria-labelledby'] && joinIds(segmentProps.id, fieldLabelledBy)}\n // A time's literal segments include bidi isolation marks around it, which show nothing, the\n // space before AM/PM, and the \", \" between a date and its time. As `.datepicker-segment`s,\n // their padding set the time off from the edge and widened the space, or put one before the\n // comma: they render as plain text. A date's own literals (\"/\", ko-KR's \". \") keep it.\n className={\n plain ? undefined : classNames('datepicker-segment', { placeholder: segment.isPlaceholder })\n }\n // A segment that can't be edited leaves `contenteditable` out rather than writing `false`:\n // react-aria marks it `aria-readonly`, which HTML allows only on an element that isn't\n // `contenteditable` at all.\n contentEditable={segmentProps.contentEditable || undefined}\n ref={ref}\n >\n {segment.text}\n </span>\n )\n}\n"],"mappings":"sJAWA,MAAM,EAAgB,uBAChB,EAAa,IAAI,IAAI,CAAC,MAAO,OAAQ,QAAS,KAAK,CAAC,EAIpD,GAAwB,EAA6B,IAAkB,CAC3E,IAAM,EAAS,EACZ,MAAM,EAAG,CAAK,CAAC,CACf,QAAQ,CAAC,CACT,KAAM,GAAY,EAAQ,OAAS,SAAS,EACzC,EAAQ,EAAS,MAAM,EAAQ,CAAC,CAAC,CAAC,KAAM,GAAY,EAAQ,OAAS,SAAS,EACpF,MAAO,GAAQ,GAAU,IAAU,EAAW,IAAI,EAAQ,IAAI,IAAM,EAAW,IAAI,EAAO,IAAI,CAChG,EASa,GAAe,CAAE,kBAAiB,UAAS,QAAO,WAA8B,CAC3F,IAAM,EAAM,EAAuB,IAAI,EACjC,CAAE,gBAAiB,EAAe,EAAS,EAAO,CAAG,EACrD,EACJ,EAAQ,OAAS,YAChB,EAAc,KAAK,EAAQ,IAAI,GAC9B,EAAqB,EAAM,SAAU,EAAM,SAAS,QAAQ,CAAO,CAAC,GAExE,OACE,EAAA,cAAC,OAAD,CACE,GAAI,EAAe,EAAc,GAAG,CAAK,EAIzC,kBAAiB,EAAa,oBAAsB,EAAQ,EAAa,GAAI,CAAe,EAK5F,UACE,EAAQ,IAAA,GAAY,EAAW,qBAAsB,CAAE,YAAa,EAAQ,aAAc,CAAC,EAK7F,gBAAiB,EAAa,iBAAmB,IAAA,GAC5C,KAGD,EADH,EAAQ,IACL,CAEV"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./polymorphic-BhGNZQja.js";import t from"react";import n from"classnames";function r({children:e,className:r,component:i,invalid:a,tooltip:o,valid:s,...c},l){let u=i??`div`,d=n({[`invalid-${o?`tooltip`:`feedback`}`]:a,[`valid-${o?`tooltip`:`feedback`}`]:s},r);return t.createElement(u,{className:d,...c,ref:l},e)}const i=e(r,`FormFeedback`);function a({children:e,className:r,component:i,...a},o){let s=i??`div`,c=n(`form-help`,r);return t.createElement(s,{className:c,...a,ref:o},e)}const o=e(a,`FormHelp`);export{i as n,o as t};
2
- //# sourceMappingURL=FormHelp-AE6_iSLJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormHelp-AE6_iSLJ.js","names":[],"sources":["../../src/components/form/FormFeedback.tsx","../../src/components/form/FormHelp.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'\n\ntype FormFeedbackOwnProps<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 * Set component validation state to invalid.\n */\n invalid?: boolean\n /**\n * If your form layout allows it, you can display validation feedback in a styled tooltip.\n */\n tooltip?: boolean\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n}\n\nexport type FormFeedbackProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n FormFeedbackOwnProps<C>\n>\n\ntype FormFeedbackComponent = (<C extends ElementType = 'div'>(\n props: FormFeedbackProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction FormFeedbackRender<C extends ElementType = 'div'>(\n { children, className, component, invalid, tooltip, valid, ...rest }: FormFeedbackProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n {\n [`invalid-${tooltip ? 'tooltip' : 'feedback'}`]: invalid,\n [`valid-${tooltip ? 'tooltip' : 'feedback'}`]: valid\n },\n className\n )\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const FormFeedback = createPolymorphicComponent<FormFeedbackComponent>(\n FormFeedbackRender as ForwardRefRenderFunction<Element, FormFeedbackProps<ElementType>>,\n 'FormFeedback'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype FormHelpOwnProps<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\nexport type FormHelpProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n FormHelpOwnProps<C>\n>\n\ntype FormHelpComponent = (<C extends ElementType = 'div'>(\n props: FormHelpProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction FormHelpRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: FormHelpProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('form-help', className)\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const FormHelp = createPolymorphicComponent<FormHelpComponent>(\n FormHelpRender as ForwardRefRenderFunction<Element, FormHelpProps<ElementType>>,\n 'FormHelp'\n)\n"],"mappings":"6FAyCA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,UAAS,UAAS,QAAO,GAAG,GAC9D,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,EACG,WAAW,EAAU,UAAY,cAAe,GAChD,SAAS,EAAU,UAAY,cAAe,CACjD,EACA,CACF,EACA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAe,EAC1B,EACA,cACF,EClCA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,YAAa,CAAS,EACpD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAW,EACtB,EACA,UACF"}
@@ -1,2 +0,0 @@
1
- import e,{forwardRef as t}from"react";import n from"classnames";const r=t(({children:t,className:r,customClassName:i,...a},o)=>{let s=i||n(`form-label`,r);return e.createElement(`label`,{className:s,...a,ref:o},t)});r.displayName=`FormLabel`;export{r as t};
2
- //# sourceMappingURL=FormLabel-CYcQiFUI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormLabel-CYcQiFUI.js","names":[],"sources":["../../src/components/form/FormLabel.tsx"],"sourcesContent":["import React, { forwardRef, LabelHTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nexport interface FormLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * A string of all className you want to be applied to the component, and override standard className value.\n */\n customClassName?: string\n}\n\nexport const FormLabel = forwardRef<HTMLLabelElement, FormLabelProps>(\n ({ children, className, customClassName, ...rest }, ref) => {\n const _className = customClassName ? customClassName : classNames('form-label', className)\n return (\n <label className={_className} {...rest} ref={ref}>\n {children}\n </label>\n )\n }\n)\n\nFormLabel.displayName = 'FormLabel'\n"],"mappings":"gEAcA,MAAa,EAAY,GACtB,CAAE,WAAU,YAAW,kBAAiB,GAAG,GAAQ,IAAQ,CAC1D,IAAM,EAAa,GAAoC,EAAW,aAAc,CAAS,EACzF,OACE,EAAA,cAAC,QAAD,CAAO,UAAW,EAAY,GAAI,EAAW,KAEtC,EADJ,CACI,CAEX,CACF,EAEA,EAAU,YAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon-DLB1f88W.js","names":[],"sources":["../../src/utils/iconConfig.ts","../../src/hooks/useIconConfig.ts","../../src/components/icon/Icon.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactElement } from 'react'\n\n/**\n * The icons this library's own components draw, by purpose rather than by icon name — so a\n * consumer can map each one onto any icon set (see `IconProvider`'s `icons`).\n */\nexport type IconKey =\n | 'check'\n | 'previous'\n | 'next'\n | 'menu'\n | 'more'\n | 'play'\n | 'pause'\n | 'increment'\n | 'decrement'\n | 'search'\n | 'clear'\n | 'expand'\n\n/**\n * An icon given to `IconProvider`'s `icons` or to a component's icon prop: a string is an icon\n * name, rendered by `IconProvider`'s `component` (or the built-in `Icon`); an element is rendered\n * as-is, with the component's own class names merged onto it.\n */\nexport type IconValue = string | ReactElement\n\n/**\n * Props `IconProvider`'s `component` receives for every icon name it's asked to render.\n */\nexport interface IconComponentProps {\n /**\n * The icon name — an `IconValue` string, or `IconProvider`'s default for that icon.\n */\n name: string\n /**\n * The class names the rendering component needs on the icon (e.g. `menu-item-check`,\n * `directional-icon`) for chassis-css to position and flip it.\n */\n className?: string\n [prop: string]: unknown\n}\n\nexport interface IconConfig {\n /**\n * Class names added to every `Icon`, alongside its own `icon` class.\n */\n className?: string\n /**\n * Replaces the built-in `Icon` for every icon this library's components render by name — the\n * strings in `icons` and their defaults, and a string `icon` on `Toast`/`Notification`. A\n * component reference can't be passed from a React Server Component, so set this in a\n * `'use client'` module.\n */\n component?: ComponentType<IconComponentProps>\n /**\n * Render `Icon` as an icon-font glyph instead of an SVG sprite reference, unless an `Icon` sets\n * `font` itself. Needs the icon font's stylesheet loaded.\n */\n font?: boolean\n /**\n * Class-name prefix of the icon font's glyphs: an icon named `check-solid` renders as\n * `{fontPrefix}check-solid`.\n *\n * @default 'cx-'\n */\n fontPrefix?: string\n /**\n * The icon to render for each of the library's own icons, by purpose. Unset ones keep their\n * defaults (`check-solid`, `chevron-left-outline`, `chevron-right-outline`, `bars-outline`,\n * `ellipsis-h-solid`, `play-solid`, `pause-solid`, `chevron-up-outline`, `chevron-down-outline`,\n * `search-outline`, `xmark-outline`, `chevron-right-outline`).\n */\n icons?: Partial<Record<IconKey, IconValue>>\n /**\n * URL of the SVG sprite `Icon` references, e.g. `/static/icons/chassis-icons.svg`. Leave empty\n * (the default) when the sprite is embedded in the page, so icons render as `href=\"#name\"`.\n * Browsers don't load an external sprite from another origin.\n *\n * @default ''\n */\n sprite?: string\n}\n\n// The chassis-icons names this library used before its icons became configurable. Both\n// previous/next consumers (Pagination, Carousel) now share the outline chevrons — Pagination used\n// the solid ones.\nexport const DEFAULT_ICONS: Record<IconKey, string> = {\n check: 'check-solid',\n previous: 'chevron-left-outline',\n next: 'chevron-right-outline',\n menu: 'bars-outline',\n more: 'ellipsis-h-solid',\n play: 'play-solid',\n pause: 'pause-solid',\n increment: 'chevron-up-outline',\n decrement: 'chevron-down-outline',\n search: 'search-outline',\n clear: 'xmark-outline',\n expand: 'chevron-right-outline'\n}\n\nexport const DEFAULT_FONT_PREFIX = 'cx-'\n\n// Lives in `utils/` rather than `components/icon/` because it's read outside that folder too —\n// by `IconSlot` (`./iconSlot.tsx`), which every icon-drawing component renders through.\nexport const IconContext = createContext<IconConfig>({})\n","import { useContext } from 'react'\n\nimport { IconConfig, IconContext } from '../utils/iconConfig'\n\n// The nearest `IconProvider`'s settings, merged with every provider above it; empty outside one.\nexport const useIconConfig = (): IconConfig => useContext(IconContext)\n","import React, { CSSProperties, forwardRef, HTMLAttributes, SVGAttributes } from 'react'\nimport classNames from 'classnames'\n\nimport { useIconConfig } from '../../hooks/useIconConfig'\nimport { DEFAULT_FONT_PREFIX } from '../../utils/iconConfig'\n\ninterface IconOwnProps {\n /**\n * Icon name, e.g. `folder-tree`. Matches an id in the SVG sprite, or a `cx-{name}` font glyph\n * class in `font` mode (see `IconProvider`'s `fontPrefix`).\n */\n name: string\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Icon size: a number of pixels, or any CSS length (`'1.25rem'`, `'1em'`). Sets chassis-css's\n * `--cx-icon-size` on the icon, so it applies in `font` mode too. Leave unset to keep the size\n * chassis-css gives icons in context (inside a button, an input, a navbar toggler, ...).\n */\n size?: number | string\n /**\n * Accessible name. When set, the icon is exposed to assistive tech instead of hidden.\n */\n title?: string\n /**\n * URL of the SVG sprite file. Defaults to `IconProvider`'s `sprite`, or to none — a sprite\n * embedded in the page, referenced as `#name`. Ignored in `font` mode.\n */\n sprite?: string\n}\n\nexport type IconProps =\n | (IconOwnProps & { font: true } & Omit<HTMLAttributes<HTMLSpanElement>, keyof IconOwnProps>)\n | (IconOwnProps & { font?: false } & Omit<SVGAttributes<SVGSVGElement>, keyof IconOwnProps>)\n\n// An SVG's `width`/`height` attributes lose to chassis-css's `.icon { width: var(--cx-icon-size) }`\n// — `size` used to set only those, so `size={48}` rendered at the stylesheet's 24px whenever\n// chassis-css was loaded. The custom property is what actually sizes an icon; the attributes stay\n// as the fallback for a page without chassis-css, where an unsized `<svg>` would render 300×150.\nconst FALLBACK_SIZE = 24\n\nexport const Icon = forwardRef<HTMLSpanElement | SVGSVGElement, IconProps>((props, ref) => {\n const config = useIconConfig()\n const {\n name,\n className,\n font = config.font ?? false,\n size,\n sprite = config.sprite ?? '',\n style,\n title,\n ...rest\n } = props as IconOwnProps & { font?: boolean; style?: CSSProperties }\n\n const sizeStyle =\n size == null\n ? style\n : ({\n '--cx-icon-size': typeof size === 'number' ? `${size}px` : size,\n ...style\n } as CSSProperties)\n const _className = classNames(\n 'icon',\n { [`${config.fontPrefix ?? DEFAULT_FONT_PREFIX}${name}`]: font },\n config.className,\n className\n )\n\n if (font) {\n return (\n <span\n className={_className}\n // A plain `<span>`'s implicit \"generic\" role doesn't support naming, so `aria-label`\n // alone is dropped by browsers/assistive tech - `role=\"img\"` (matching the SVG path's\n // own implicit role) is what actually makes the accessible name stick.\n role={title ? 'img' : undefined}\n aria-hidden={title ? undefined : true}\n aria-label={title}\n style={sizeStyle}\n ref={ref as React.Ref<HTMLSpanElement>}\n {...(rest as HTMLAttributes<HTMLSpanElement>)}\n />\n )\n }\n\n return (\n <svg\n className={_className}\n width={size ?? FALLBACK_SIZE}\n height={size ?? FALLBACK_SIZE}\n role={title ? 'img' : undefined}\n aria-hidden={title ? undefined : true}\n style={sizeStyle}\n ref={ref as React.Ref<SVGSVGElement>}\n {...(rest as SVGAttributes<SVGSVGElement>)}\n >\n {title && <title>{title}</title>}\n <use href={`${sprite}#${name}`} />\n </svg>\n )\n})\n\nIcon.displayName = 'Icon'\n"],"mappings":"mGAuFA,MAAa,EAAyC,CACpD,MAAO,cACP,SAAU,uBACV,KAAM,wBACN,KAAM,eACN,KAAM,mBACN,KAAM,aACN,MAAO,cACP,UAAW,qBACX,UAAW,uBACX,OAAQ,iBACR,MAAO,gBACP,OAAQ,uBACV,EAMa,EAAc,EAA0B,CAAC,CAAC,ECrG1C,MAAkC,EAAW,CAAW,ECsCxD,EAAO,GAAwD,EAAO,IAAQ,CACzF,IAAM,EAAS,EAAc,EACvB,CACJ,OACA,YACA,OAAO,EAAO,MAAQ,GACtB,OACA,SAAS,EAAO,QAAU,GAC1B,QACA,QACA,GAAG,GACD,EAEE,EACJ,GAAQ,KACJ,EACC,CACC,iBAAkB,OAAO,GAAS,SAAW,GAAG,EAAK,IAAM,EAC3D,GAAG,CACL,EACA,EAAa,EACjB,OACA,EAAG,GAAG,EAAO,YAAA,QAAoC,KAAS,CAAK,EAC/D,EAAO,UACP,CACF,EAmBA,OAjBI,EAEA,EAAA,cAAC,OAAD,CACE,UAAW,EAIX,KAAM,EAAQ,MAAQ,IAAA,GACtB,cAAa,IAAQ,IAAA,GACrB,aAAY,EACZ,MAAO,EACF,MACL,GAAK,CACN,CAAA,EAKH,EAAA,cAAC,MAAD,CACE,UAAW,EACX,MAAO,GAAQ,GACf,OAAQ,GAAQ,GAChB,KAAM,EAAQ,MAAQ,IAAA,GACtB,cAAa,IAAQ,IAAA,GACrB,MAAO,EACF,MACL,GAAK,CAIF,EAFF,GAAS,EAAA,cAAC,QAAA,KAAO,CAAa,EAC/B,EAAA,cAAC,MAAD,CAAK,KAAM,GAAG,EAAO,GAAG,GAAS,CAAA,CAC9B,CAET,CAAC,EAED,EAAK,YAAc"}
@@ -1,2 +0,0 @@
1
- import{d as e,f as t,g as n,p as r}from"./slot-CNhFZdHF.js";import{t as i}from"./useForkedRef-DVEfT-KI.js";import{t as a}from"./polymorphic-BhGNZQja.js";import{t as o}from"./useButtonSemantics-CILM_lhi.js";import{t as s}from"./useDisabledAnchorGuard-Cz58UCXy.js";import{i as c}from"./colorClassNames-CEh5Yzfp.js";import{n as l}from"./scrollspy-D_lPjb92.js";import u from"react";import d from"classnames";import{mergeProps as f}from"react-aria";function p({children:a,active:p,className:m,color:h,component:g,disabled:_,href:v,iconLink:y,onClick:b,reset:x,stretched:S,type:C=`button`,...w},T){let E=r(g,v,`a`),D=n(E,v,w),O=t(D),k=D===`component`,A=l(_),j=A.onClick,M=s(D===`anchor`,_,j?e=>{b?.(e),j(e)}:b),N=!O&&!k&&!!b,{buttonProps:P,forkedRef:F}=o(T,{disabled:_,onClick:b}),I=N?F:T,L=i(I,A.ref),R=p||!!A.mark,z=p?`page`:A.mark===`current`?`true`:void 0,B=d(h&&c[h],{"icon-link":y,"fg-reset":x,"stretched-link":S},{active:R,disabled:_},m);return u.createElement(E,{...f(w,N?P:{}),className:B,...e(D,v,`Link`),...z&&{"aria-current":z},...D===`anchor`&&_&&{"aria-disabled":!0,tabIndex:-1},...!N&&{onClick:M},...D===`button`&&{disabled:_,type:C},ref:A.ref?L:I},a)}const m=a(p,`Link`);export{m as t};
2
- //# sourceMappingURL=Link-DyZyAQFj.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Link-DyZyAQFj.js","names":[],"sources":["../../src/components/link/Link.tsx"],"sourcesContent":["import React, {\n ElementType,\n ForwardRefRenderFunction,\n MouseEventHandler,\n ReactElement,\n Ref\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { ContextColor } from '../../types'\nimport { LINK_COLOR_CLASS_NAMES } from '../../utils/colorClassNames'\nimport { useButtonSemantics, useDisabledAnchorGuard, useForkedRef } from '../../hooks'\nimport { hrefProps, isInteractiveKind, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { useScrollspyLink } from '../../utils/scrollspy'\n\ntype LinkOwnProps<C extends ElementType> = {\n /**\n * Toggle the active state for the component.\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 link color to one of Chassis context colors, including its interactive\n * (`:hover`/`:focus`/`:active`/`:visited`) states.\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 * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * The href attribute specifies the URL of the page the link goes to. Reaches an `<a>` or a\n * component reference (a router link); dropped, with a warning in development, when\n * `component` is another element. Declared explicitly here — rather than left to flow through\n * generically from whatever `C` is — so consumers that wrap `Link` (`MenuItem`, `ListItem`,\n * `NavLink`) can read it with a concrete type regardless of `component`.\n */\n href?: string\n /**\n * Fires on click.\n */\n onClick?: MouseEventHandler<HTMLElement>\n /**\n * Aligns a leading or trailing icon with the link text using flexbox, with a gap between\n * them and an offset underline. Icons need to be passed as `children` alongside the text.\n * Named `iconLink` rather than `icon` to avoid colliding with components (e.g. `MenuItem`)\n * that already have their own, differently-typed `icon` prop for the icon content itself.\n */\n iconLink?: boolean\n /**\n * Removes the foreground color override, so the link inherits its color from the nearest\n * ancestor instead of the default link color.\n */\n reset?: boolean\n /**\n * Expands the link's click target to fill its positioned ancestor (the nearest ancestor with\n * a `position` other than `static`).\n */\n stretched?: boolean\n /**\n * Specifies the type of button. Only applies when `component=\"button\"`. Different browsers may\n * use different default types for the `<button>` element, so always specify it explicitly.\n */\n type?: 'button' | 'submit' | 'reset'\n}\n\nexport type LinkProps<C extends ElementType = 'a'> = PolymorphicComponentProps<C, LinkOwnProps<C>>\n\ntype LinkComponent = (<C extends ElementType = 'a'>(\n props: LinkProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction LinkRender<C extends ElementType = 'a'>(\n {\n children,\n active,\n className,\n color,\n component,\n disabled,\n href,\n iconLink,\n onClick,\n reset,\n stretched,\n type = 'button',\n ...rest\n }: LinkProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = linkElement(component, href, 'a')\n // The kind rather than the tag, counting a router link with `href` or `to` as an anchor: under `asChild`, `Component` is a `Slot` standing in for the\n // caller's element, and a slotted `<a>` needs what `component=\"a\"` gets.\n const kind = resolveLinkKind(Component, href, rest)\n\n const isInteractive = isInteractiveKind(kind)\n // A component reference without a link target (a router link with `href` or `to` is an anchor,\n // see `resolveLinkKind`) has its own visual identity and is trusted to\n // handle its own keyboard/role semantics, same as `CloseButton`'s `isComponentReference` escape\n // hatch — synthesizing `role=\"button\"` and Enter/Space handling on top of it would stamp the\n // wrong ARIA role onto whatever it actually renders (e.g. an `<a>`) and can double-fire a click\n // (native anchor Enter→click, plus the synthesized keydown→click).\n const isComponentReference = kind === 'component'\n // Inside a `Scrollspy`, the link registers its element, is marked when its section is the one\n // being read, and scrolls to it smoothly when the `Scrollspy` is set to (`src/utils/scrollspy.ts`).\n const spy = useScrollspyLink(disabled)\n const spyClick = spy.onClick\n const clickHandler: MouseEventHandler<HTMLElement> | undefined = spyClick\n ? (event) => {\n onClick?.(event)\n spyClick(event)\n }\n : onClick\n // `<a>` has no real `disabled` attribute, so a disabled anchor link still fires click (and\n // still navigates) unless it's blocked here, same guard `Button`/`CloseButton` apply. A real\n // `<button>` already stops clicks on its own once the `disabled` attribute below is set.\n const handleClick = useDisabledAnchorGuard<HTMLElement>(kind === 'anchor', disabled, clickHandler)\n\n // A `component` that isn't a native interactive element gets a raw onClick with no\n // keyboard semantics otherwise — mouse-only, unlike `Button`/`CloseButton`, which\n // synthesize this via `useButtonSemantics` for exactly this \"arbitrary component\" case. A\n // component reference is excluded (see `isComponentReference` above).\n const needsButtonSemantics = !isInteractive && !isComponentReference && !!onClick\n const { buttonProps, forkedRef } = useButtonSemantics<HTMLElement>(ref as Ref<HTMLElement>, {\n disabled,\n onClick\n })\n const ownRef = needsButtonSemantics ? forkedRef : ref\n const spyRef = useForkedRef(ownRef as Ref<HTMLElement>, spy.ref)\n // A link to the section being read is `active` and `aria-current=\"true\"`: the current place in\n // the page, not the current page. A link it belongs under, such as its menu's toggle, only\n // looks active. An `active` given as a prop wins.\n const isActive = active || !!spy.mark\n const ariaCurrent = active ? 'page' : spy.mark === 'current' ? 'true' : undefined\n\n const _className = classNames(\n color && LINK_COLOR_CLASS_NAMES[color],\n { 'icon-link': iconLink, 'fg-reset': reset, 'stretched-link': stretched },\n { active: isActive, disabled },\n className\n )\n\n return (\n <Component\n {...(mergeProps(rest, needsButtonSemantics ? buttonProps : {}) as Record<string, unknown>)}\n className={_className}\n {...hrefProps(kind, href, 'Link')}\n {...(ariaCurrent && { 'aria-current': ariaCurrent })}\n {...(kind === 'anchor' && disabled && { 'aria-disabled': true, tabIndex: -1 })}\n {...(!needsButtonSemantics && { onClick: handleClick })}\n {...(kind === 'button' && { disabled, type })}\n ref={spy.ref ? spyRef : ownRef}\n >\n {children}\n </Component>\n )\n}\n\nexport const Link = createPolymorphicComponent<LinkComponent>(\n LinkRender as ForwardRefRenderFunction<Element, LinkProps<ElementType>>,\n 'Link'\n)\n"],"mappings":"4bAqFA,SAAS,EACP,CACE,WACA,SACA,YACA,QACA,YACA,WACA,OACA,WACA,UACA,QACA,YACA,OAAO,SACP,GAAG,GAEL,EACA,CACA,IAAM,EAAY,EAAY,EAAW,EAAM,GAAG,EAG5C,EAAO,EAAgB,EAAW,EAAM,CAAI,EAE5C,EAAgB,EAAkB,CAAI,EAOtC,EAAuB,IAAS,YAGhC,EAAM,EAAiB,CAAQ,EAC/B,EAAW,EAAI,QAUf,EAAc,EAAoC,IAAS,SAAU,EATV,EAC5D,GAAU,CACT,IAAU,CAAK,EACf,EAAS,CAAK,CAChB,EACA,CAI6F,EAM3F,EAAuB,CAAC,GAAiB,CAAC,GAAwB,CAAC,CAAC,EACpE,CAAE,cAAa,aAAc,EAAgC,EAAyB,CAC1F,WACA,SACF,CAAC,EACK,EAAS,EAAuB,EAAY,EAC5C,EAAS,EAAa,EAA4B,EAAI,GAAG,EAIzD,EAAW,GAAU,CAAC,CAAC,EAAI,KAC3B,EAAc,EAAS,OAAS,EAAI,OAAS,UAAY,OAAS,IAAA,GAElE,EAAa,EACjB,GAAS,EAAuB,GAChC,CAAE,YAAa,EAAU,WAAY,EAAO,iBAAkB,CAAU,EACxE,CAAE,OAAQ,EAAU,UAAS,EAC7B,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CACE,GAAK,EAAW,EAAM,EAAuB,EAAc,CAAC,CAAC,EAC7D,UAAW,EACX,GAAI,EAAU,EAAM,EAAM,MAAM,EAChC,GAAK,GAAe,CAAE,eAAgB,CAAY,EAClD,GAAK,IAAS,UAAY,GAAY,CAAE,gBAAiB,GAAM,SAAU,EAAG,EAC5E,GAAK,CAAC,GAAwB,CAAE,QAAS,CAAY,EACrD,GAAK,IAAS,UAAY,CAAE,WAAU,MAAK,EAC3C,IAAK,EAAI,IAAM,EAAS,CAGf,EADR,CACQ,CAEf,CAEA,MAAa,EAAO,EAClB,EACA,MACF"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./useForkedRef-DVEfT-KI.js";import{t}from"./polymorphic-BhGNZQja.js";import{t as n}from"./useIsomorphicLayoutEffect-BbqRwuqn.js";import{t as r}from"./dialogTransition-i9vw0i2Z.js";import{t as i}from"./useOpenStateProps-DykUbnPJ.js";import{i as a,r as o}from"./overlayPlacement-BtS90IVf.js";import{t as ee}from"./navOverflow-B5krZe6D.js";import s,{Fragment as c,createContext as l,useEffect as u,useMemo as te,useRef as d}from"react";import f from"classnames";import{useMenuTrigger as p,useOverlayPosition as m}from"react-aria";import{useMenuTriggerState as h}from"react-stately";const g=()=>void 0,_=l({autoClose:!0,close:g,focusStrategy:null,hide:g,menuId:``,menuStyle:{},menuTriggerProps:{},overlayRef:{current:null},placementAttr:`bottom-start`,reference:`toggle`,registerOverlay:g,show:g,targetRef:{current:null},toggle:g,toggleNodeRef:{current:null},triggerId:``,visible:!1});function v({children:t,autoClose:l=!0,className:g,component:v,container:y,defaultVisible:b,offset:x=[0,2],onHide:S,onHidden:C,onShow:w,onShown:T,onVisibleChange:E,placement:D=`bottom-start`,reference:O=`toggle`,visible:k,...A},j){let M=v??c,N=d(null),ne=e(j,N),P=d(null),F=d(null),I=d(null),L=d(new Map),R=(e,t)=>{t?L.current.set(e,t):L.current.delete(e)},z=h(i({defaultVisible:b,onVisibleChange:E,visible:k},`Menu`)),{menuTriggerProps:B,menuProps:V}=p({},z,P);n(()=>{O===`parent`&&(F.current=N.current)},[O]);let H=d(!1);u(()=>{let e=I.current,t=!H.current;if(H.current=!0,!t){if(z.isOpen){if(w?.(),!e){T?.();return}return r(e,()=>T?.(),!0)}if(S?.(),!e){C?.();return}return r(e,()=>C?.(),!0)}},[z.isOpen]);let{overlayProps:U,placement:W}=m({targetRef:F,overlayRef:I,placement:a(D),offset:x[1],crossOffset:x[0],containerPadding:8,isOpen:z.isOpen,onClose:null}),{menuStyle:G,placementAttr:K}=o(U.style,D,W),q=d(!0);q.current=k===void 0||!!E;let J=d(!1);J.current=k!==void 0;let Y=d(!1),X=e=>z.open(e),Z=()=>{Y.current=!1,z.close()},re=e=>z.toggle(e),Q=()=>{z.close(),J.current?Y.current=q.current:P.current?.focus()};u(()=>{!z.isOpen&&Y.current&&P.current?.focus(),Y.current=!1},[z.isOpen]),u(()=>{if(!z.isOpen||l===!1)return;let e=e=>{if(e instanceof KeyboardEvent&&e.key!==`Tab`)return;let t=e.target,n=P.current,r=I.current;if(n?.contains(t))return;let i=!!r?.contains(t)||Array.from(L.current.values()).some(e=>e.contains(t));(l!==`inside`||i)&&(l===`outside`&&i||i&&(e instanceof KeyboardEvent&&e.key===`Tab`||/input|select|option|textarea|form/i.test(t.tagName??``))||Z())},t=window.setTimeout(()=>{window.addEventListener(`click`,e),window.addEventListener(`keyup`,e)});return()=>{window.clearTimeout(t),window.removeEventListener(`click`,e),window.removeEventListener(`keyup`,e)}},[z.isOpen,l]),u(()=>{if(!z.isOpen)return;let e=e=>{e.key===`Escape`&&Q()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[z.isOpen]);let ie=te(()=>({autoClose:l,close:Q,container:y,focusStrategy:z.focusStrategy,hide:Z,menuId:V.id??``,menuStyle:G,menuTriggerProps:B,overlayRef:I,placementAttr:K,reference:O,registerOverlay:R,show:X,targetRef:F,toggle:re,toggleNodeRef:P,triggerId:B.id??``,visible:z.isOpen}),[l,y,z.focusStrategy,V.id,G,B,K,O,z.isOpen]),$=s.createElement(ee,null,t);return s.createElement(_.Provider,{value:ie},M===c?$:s.createElement(M,{className:f(g,{show:z.isOpen}),...A,ref:ne},$))}const y=t(v,`Menu`);export{_ as n,y as t};
2
- //# sourceMappingURL=Menu-CSBg2Zmc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Menu-CSBg2Zmc.js","names":[],"sources":["../../src/components/menu/Menu.tsx"],"sourcesContent":["import React, {\n createContext,\n ElementType,\n ForwardRefRenderFunction,\n Fragment,\n ReactElement,\n useEffect,\n useMemo,\n useRef\n} from 'react'\nimport classNames from 'classnames'\nimport { AriaButtonProps, useMenuTrigger, useOverlayPosition } from 'react-aria'\nimport { useMenuTriggerState } from 'react-stately'\n\nimport { useForkedRef, useIsomorphicLayoutEffect, useOpenStateProps } from '../../hooks'\nimport { executeAfterTransition } from '../../utils/dialogTransition'\nimport {\n Placement,\n resolveMenuOverlayPositioning,\n toAriaPlacement\n} from '../../utils/overlayPlacement'\nimport { NavOverflowBoundary } from '../../utils/navOverflow'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\nexport type { Placement }\nexport type MenuFocusStrategy = 'first' | 'last'\n\nexport type MenuAutoClose = boolean | 'inside' | 'outside'\n\ntype MenuOwnProps<C extends ElementType> = {\n /**\n * Controls which clicks close the menu. `true` closes on any click inside or outside.\n * `false` leaves closing to the toggle, the Escape key and `visible`. `'inside'` closes only\n * on click inside the menu. `'outside'` closes only on click outside the menu.\n */\n autoClose?: MenuAutoClose\n /**\n * A string of all className you want applied to the base 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 `Fragment` — `MenuToggle`/`MenuList` render with no wrapping element, so\n * they land as direct children of whatever contains the `Menu`. This matters inside\n * `ButtonGroup`/`InputGroup`, whose CSS expects the toggle button and menu panel as direct\n * children rather than nested inside an intermediate node.\n *\n * Pass an actual element (e.g. `\"div\"`, or `\"li\"` for a navbar item) to opt back into a\n * wrapper — needed if you want to apply `className`/`style`/other rest props to a container\n * around the whole menu, for semantic wrapping like a nav `<li>`, or for `reference=\"parent\"`,\n * which positions off this wrapper and has nothing to measure against without one.\n */\n component?: C\n /**\n * Teleports the menu panel to a container element on open. Accepts an element reference, or\n * `true` to append to `document.body`.\n */\n container?: boolean | Element\n /**\n * Whether the menu is open when it first renders. Use it instead of `visible` when nothing\n * outside needs to control the menu.\n */\n defaultVisible?: boolean\n /**\n * Distance between the menu and its reference element, as `[skidding, distance]` in pixels.\n */\n offset?: [number, number]\n /**\n * Callback fired when the menu starts to hide.\n */\n onHide?: () => void\n /**\n * Callback fired after the menu finishes hiding.\n */\n onHidden?: () => void\n /**\n * Callback fired when the menu starts to show.\n */\n onShow?: () => void\n /**\n * Callback fired after the menu finishes showing.\n */\n onShown?: () => void\n /**\n * Callback fired when the menu asks to show or hide: the toggle, a click that `autoClose`\n * counts, or the Escape or Tab key. Receives the state it asks for. With `visible` set, the\n * menu changes only when `visible` does.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Initial placement. Chassis will flip it to keep the menu in view.\n *\n * @type 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'\n */\n placement?: Placement\n /**\n * Reference element used for positioning. `'toggle'` uses the trigger. `'parent'` uses this\n * component's own rendered element, useful for split buttons and button groups.\n */\n reference?: 'toggle' | 'parent'\n /**\n * Whether the menu is open. Setting it makes the menu controlled: it opens and closes only\n * when this changes, so pair it with `onVisibleChange`. Leave it unset, or use\n * `defaultVisible`, for a menu that opens and closes itself.\n */\n visible?: boolean\n}\n\nexport type MenuProps<C extends ElementType = typeof Fragment> = PolymorphicComponentProps<\n C,\n MenuOwnProps<C>\n>\n\ntype MenuComponent = (<C extends ElementType = typeof Fragment>(\n props: MenuProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nexport interface MenuContextProps {\n autoClose: MenuAutoClose\n close: () => void\n container?: boolean | Element\n focusStrategy: MenuFocusStrategy | null\n hide: () => void\n menuId: string\n menuStyle: React.CSSProperties\n menuTriggerProps: AriaButtonProps\n overlayRef: React.MutableRefObject<HTMLElement | null>\n placementAttr: string\n reference: 'toggle' | 'parent'\n /**\n * Registers (or, passing `null`, unregisters) a nested `MenuSubmenu`'s own portaled panel\n * element, so this `Menu`'s outside/inside click-dismiss logic recognizes clicks landing in it\n * as \"inside\" the menu — see `MenuSubmenu`'s own use for why this is necessary: its panel\n * portals straight to `document.body`, structurally detached from this menu's own DOM subtree.\n */\n registerOverlay: (id: string, node: HTMLElement | null) => void\n show: (focusStrategy?: MenuFocusStrategy | null) => void\n targetRef: React.MutableRefObject<HTMLElement | null>\n toggle: (focusStrategy?: MenuFocusStrategy | null) => void\n toggleNodeRef: React.MutableRefObject<HTMLElement | null>\n triggerId: string\n visible: boolean\n}\n\n// A fully-shaped no-op default so a `MenuToggle`/`MenuList`/`MenuSubmenu` rendered without a\n// `Menu` ancestor (or in an environment where context can't cross a component boundary, e.g.\n// some static-site prerenderers) degrades to an inert, always-closed menu instead of throwing.\nconst noop = () => undefined\n\nconst defaultMenuContext: MenuContextProps = {\n autoClose: true,\n close: noop,\n focusStrategy: null,\n hide: noop,\n menuId: '',\n menuStyle: {},\n menuTriggerProps: {},\n overlayRef: { current: null },\n placementAttr: 'bottom-start',\n reference: 'toggle',\n registerOverlay: noop,\n show: noop,\n targetRef: { current: null },\n toggle: noop,\n toggleNodeRef: { current: null },\n triggerId: '',\n visible: false\n}\n\nexport const MenuContext = createContext(defaultMenuContext)\n\nfunction MenuRender<C extends ElementType = typeof Fragment>(\n {\n children,\n autoClose = true,\n className,\n component,\n container,\n defaultVisible,\n offset: offsetProp = [0, 2],\n onHide,\n onHidden,\n onShow,\n onShown,\n onVisibleChange,\n placement = 'bottom-start',\n reference = 'toggle',\n visible,\n ...rest\n }: MenuProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? (Fragment as ElementType)\n const wrapperRef = useRef<HTMLElement>(null)\n const forkedRef = useForkedRef(ref, wrapperRef)\n const toggleNodeRef = useRef<HTMLElement | null>(null)\n const targetRef = useRef<HTMLElement | null>(null)\n const overlayRef = useRef<HTMLElement | null>(null)\n // Portaled `MenuSubmenu` panels register themselves here (see `registerOverlay` below and\n // `MenuSubmenu`'s own ref callback) so `handleDismiss` can recognize clicks inside them as\n // \"inside\" this menu despite living outside `overlayRef.current`'s own DOM subtree.\n const submenuOverlaysRef = useRef<Map<string, HTMLElement>>(new Map())\n const registerOverlay = (id: string, node: HTMLElement | null) => {\n if (node) submenuOverlaysRef.current.set(id, node)\n else submenuOverlaysRef.current.delete(id)\n }\n\n // Controlled by `visible` when it is set: `show`/`hide`/`toggle` (from `MenuToggle`, autoClose\n // dismissal, an item) then only report to `onVisibleChange`.\n const state = useMenuTriggerState(\n useOpenStateProps({ defaultVisible, onVisibleChange, visible }, 'Menu')\n )\n const { menuTriggerProps, menuProps } = useMenuTrigger<unknown>({}, state, toggleNodeRef)\n\n useIsomorphicLayoutEffect(() => {\n if (reference === 'parent') {\n targetRef.current = wrapperRef.current\n }\n }, [reference])\n\n // `onShown`/`onHidden` wait for chassis-css's own opacity/transform transition on `.menu`\n // (see `_menu.scss`) to actually finish, matching `Modal`'s identically-worded \"requests to\n // be shown\" vs \"finishes showing\" contract (`Modal.tsx`'s own `executeAfterTransition` use).\n // `overlayRef.current` is `MenuList`'s root element — already in the DOM and already\n // reflecting the new `.show` class by the time this effect runs, since React commits the\n // render before passive effects execute. Falls back to firing synchronously when no\n // `MenuList` is mounted to measure (nothing to transition, so nothing to wait for).\n //\n // All four report *transitions*, so none fires for the initial commit — mounting closed is not\n // a hide. Without this guard, mounting fired `onHide` (and scheduled `onHidden`) for every menu\n // on the page before `onShow` had ever fired once, which `Menu.spec.tsx` used to have to\n // `mockClear()` past.\n const mountedRef = useRef(false)\n\n useEffect(() => {\n const overlay = overlayRef.current\n const isInitialCommit = !mountedRef.current\n mountedRef.current = true\n if (isInitialCommit) return undefined\n\n if (state.isOpen) {\n onShow?.()\n if (!overlay) {\n onShown?.()\n return undefined\n }\n return executeAfterTransition(overlay, () => onShown?.(), true)\n }\n\n onHide?.()\n if (!overlay) {\n onHidden?.()\n return undefined\n }\n return executeAfterTransition(overlay, () => onHidden?.(), true)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.isOpen])\n\n const { overlayProps, placement: resolvedPlacement } = useOverlayPosition({\n targetRef,\n overlayRef,\n placement: toAriaPlacement(placement),\n offset: offsetProp[1],\n crossOffset: offsetProp[0],\n containerPadding: 8,\n isOpen: state.isOpen,\n // `useOverlayPosition` closes on any window scroll via a backward-compat `WeakMap` that\n // `useMenuTrigger` populates for `targetRef.current` (see `MenuToggle`'s `setRefs`).\n // Passing `null` opts out so the menu repositions with its trigger instead of vanishing —\n // matching `Autocomplete`/`Combobox`, neither of which is wired into that map.\n onClose: null\n })\n\n const { menuStyle, placementAttr } = resolveMenuOverlayPositioning(\n overlayProps.style,\n placement,\n resolvedPlacement\n )\n\n // Escape closes the menu and returns focus to the toggle. Controlled, the close is a request:\n // focus returns when `visible` follows it, in the effect below, and stays where it is when\n // nothing can follow it or the caller declines. Read through a ref because the context value\n // these functions travel in is memoized.\n const followsRequestsRef = useRef(true)\n followsRequestsRef.current = visible === undefined || !!onVisibleChange\n const isControlledRef = useRef(false)\n isControlledRef.current = visible !== undefined\n const focusReturnOwedRef = useRef(false)\n\n const show = (focusStrategy?: MenuFocusStrategy | null) => state.open(focusStrategy)\n const hide = () => {\n focusReturnOwedRef.current = false\n state.close()\n }\n const toggleVisible = (focusStrategy?: MenuFocusStrategy | null) => state.toggle(focusStrategy)\n const close = () => {\n state.close()\n if (!isControlledRef.current) toggleNodeRef.current?.focus()\n else focusReturnOwedRef.current = followsRequestsRef.current\n }\n\n useEffect(() => {\n if (!state.isOpen && focusReturnOwedRef.current) toggleNodeRef.current?.focus()\n focusReturnOwedRef.current = false\n }, [state.isOpen])\n\n // Deferred so the click that opened the menu doesn't immediately close it, and scoped\n // to match menu.js's `clearMenus`: skip the toggle itself, honor `inside`/`outside`\n // modes, and let Tab or clicks on form controls inside the menu pass through untouched.\n useEffect(() => {\n if (!state.isOpen || autoClose === false) return undefined\n\n const handleDismiss = (event: MouseEvent | KeyboardEvent) => {\n if (event instanceof KeyboardEvent && event.key !== 'Tab') return\n\n const target = event.target as Node\n const toggleNode = toggleNodeRef.current\n const menuNode = overlayRef.current\n\n if (toggleNode?.contains(target)) return\n\n const isMenuTarget =\n !!menuNode?.contains(target) ||\n Array.from(submenuOverlaysRef.current.values()).some((node) => node.contains(target))\n\n if (autoClose === 'inside' && !isMenuTarget) return\n if (autoClose === 'outside' && isMenuTarget) return\n\n if (\n isMenuTarget &&\n ((event instanceof KeyboardEvent && event.key === 'Tab') ||\n /input|select|option|textarea|form/i.test((target as HTMLElement).tagName ?? ''))\n ) {\n return\n }\n\n hide()\n }\n\n const id = window.setTimeout(() => {\n window.addEventListener('click', handleDismiss)\n window.addEventListener('keyup', handleDismiss)\n })\n\n return () => {\n window.clearTimeout(id)\n window.removeEventListener('click', handleDismiss)\n window.removeEventListener('keyup', handleDismiss)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.isOpen, autoClose])\n\n // Escape should always close the menu, independent of `autoClose`'s inside/outside/false\n // modes. `MenuList`'s own `onKeyDown` handling only fires when focus is already inside the\n // panel (e.g. opened via ArrowDown) — a mouse-press open via `useMenuTrigger` leaves focus on\n // the trigger button, where that handler is unreachable. Listening on `window` catches Escape\n // regardless of where focus currently is.\n useEffect(() => {\n if (!state.isOpen) return undefined\n\n const handleEscape = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n close()\n }\n\n window.addEventListener('keydown', handleEscape)\n\n return () => {\n window.removeEventListener('keydown', handleEscape)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.isOpen])\n\n const contextValue: MenuContextProps = useMemo(\n () => ({\n autoClose,\n close,\n container,\n focusStrategy: state.focusStrategy as MenuFocusStrategy | null,\n hide,\n menuId: menuProps.id ?? '',\n menuStyle,\n menuTriggerProps,\n overlayRef,\n placementAttr,\n reference,\n registerOverlay,\n show,\n targetRef,\n toggle: toggleVisible,\n toggleNodeRef,\n triggerId: menuTriggerProps.id ?? '',\n visible: state.isOpen\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n autoClose,\n container,\n state.focusStrategy,\n menuProps.id,\n menuStyle,\n menuTriggerProps,\n placementAttr,\n reference,\n state.isOpen\n ]\n )\n\n // Inside a `NavOverflow`, a menu in a nav item is that item's content, not its link: a toggle\n // rendered as a `NavLink` has nothing to show in the overflow menu.\n const content = <NavOverflowBoundary>{children}</NavOverflowBoundary>\n\n return (\n <MenuContext.Provider value={contextValue}>\n {Component === Fragment ? (\n content\n ) : (\n // `show` mirrors vanilla menu.js's `this._parent.classList.add('show')` — needed for\n // e.g. `.nav-item.show .nav-link` to put a `NavLink`-rooted `MenuToggle` into its\n // pressed look while open, since a bare `.nav-link.show` has no styling of its own.\n <Component\n className={classNames(className, { show: state.isOpen })}\n {...rest}\n ref={forkedRef}\n >\n {content}\n </Component>\n )}\n </MenuContext.Provider>\n )\n}\n\nexport const Menu = createPolymorphicComponent<MenuComponent>(\n MenuRender as ForwardRefRenderFunction<Element, MenuProps<ElementType>>,\n 'Menu'\n)\n"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import{d as e,g as t,p as n,u as r}from"./slot-CNhFZdHF.js";import{t as i}from"./useForkedRef-DVEfT-KI.js";import{t as a}from"./polymorphic-BhGNZQja.js";import{n as o,t as s}from"./Portal-CgeR1WXV.js";import{t as c}from"./renderMenuItemContent-DUezZrpj.js";import{t as l}from"./Link-DyZyAQFj.js";import{t as u}from"./Button-BoymWE-L.js";import{n as d}from"./Menu-CSBg2Zmc.js";import f,{createContext as p,forwardRef as m,useContext as h,useEffect as g,useRef as _}from"react";import v from"classnames";import{mergeProps as y,useButton as b}from"react-aria";const x=m(({className:e,...t},n)=>{let r=v(`menu-divider`,e);return f.createElement(`hr`,{className:r,...t,ref:n})});x.displayName=`MenuDivider`;function S({children:e,className:t,component:n,role:r=`presentation`,...i},a){let o=n??`h4`,s=v(`menu-header`,t);return f.createElement(o,{className:s,role:r,...i,ref:a},e)}const C=a(S,`MenuHeader`);function w({children:e,className:t,component:r,description:i,href:a,icon:o,onClick:s,selected:u,...d},p){let m=v(`menu-item`,{selected:u},t);return f.createElement(l,{role:`menuitem`,component:n(r,a,`button`),href:a,onClick:e=>{a===`#`&&e.preventDefault(),s?.(e)},...d,className:m,ref:p},c({icon:o,label:e,description:i}))}const T=a(w,`MenuItem`),E=`:is(.menu-item, .submenu-back):not(.disabled):not(:disabled)`,D=e=>!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),O=e=>{if(!e)return[];let t=[];for(let n of Array.from(e.children))if(n.matches(E))t.push(n);else if(n.classList.contains(`submenu`)){let e=Array.from(n.children).find(e=>e.matches(E));e&&t.push(e)}return t.filter(D)},k=(e,t)=>{e.length&&(t===`first`?e[0]:e[e.length-1]).focus()},A=(e,{onArrowLeft:t,onArrowRight:n,onEscape:r})=>{let i=e.currentTarget,a=e.target;switch(e.key){case`ArrowDown`:case`ArrowUp`:{e.preventDefault(),e.stopPropagation();let t=O(i);if(!t.length)return;let n=t.indexOf(a);t[n===-1?e.key===`ArrowDown`?0:t.length-1:(n+(e.key===`ArrowDown`?1:-1)+t.length)%t.length].focus();return}case`Home`:case`End`:e.preventDefault(),e.stopPropagation(),k(O(i),e.key===`Home`?`first`:`last`);return;case`Escape`:if(!r)return;e.preventDefault(),e.stopPropagation(),r();return;case`ArrowLeft`:if(!t)return;e.preventDefault(),e.stopPropagation(),t();return;case`ArrowRight`:if(!n)return;e.preventDefault(),e.stopPropagation(),n();return}},j=p(null),M=()=>{let e=_(null);if(!e.current){let t=new Map;e.current={register:(e,n)=>(t.set(e,n),()=>{t.delete(e)}),notifyOpen:e=>{t.forEach((t,n)=>{n!==e&&t()})}}}return e.current},N=p(null),P=e=>e.type===`header`?f.createElement(C,{key:e.id},e.label):e.type===`divider`?f.createElement(x,{key:e.id}):f.createElement(T,{key:e.id,href:e.href,disabled:e.disabled,selected:e.selected,onClick:e.onClick},c({icon:e.icon,label:e.label,description:e.description,selected:e.selected}));function F({children:e,className:t,component:n,items:r,onKeyDown:a,...c},l){let u=n??`div`,{close:p,container:m,focusStrategy:_,menuId:y,menuStyle:b,overlayRef:x,placementAttr:S,triggerId:C,visible:w}=h(d),T=i(l,x),E=M(),D=o(),N=w&&D;g(()=>{w&&_&&k(O(x.current),_===`last`?`last`:`first`)},[w,_]);let F=e=>{A(e,{onEscape:p}),a?.(e)},I=c[`aria-label`]?void 0:C||void 0,L=f.createElement(u,{role:`menu`,id:y,"aria-labelledby":I,className:v(`menu`,{show:N},t),style:b,"data-cx-placement":S,...c,onKeyDown:F,ref:T},f.createElement(j.Provider,{value:E},r?r.map(P):e));return m?f.createElement(s,{container:m===!0?void 0:m},L):L}const I=a(F,`MenuList`);function L({children:n,caret:a=!0,className:o,component:s,href:c,onClick:l,onKeyDown:p,tabIndex:m,...g},x){let{hide:S,menuTriggerProps:C,reference:w,targetRef:T,toggleNodeRef:E,visible:D}=h(d),O=s??u,k=_(null),A=O===u?r(c)?`anchor`:`button`:t(O,c,g),j=A===`button`,M=O===u?{href:c}:e(A,c,`MenuToggle`),{buttonProps:N}=b({...C,elementType:j?`button`:`a`},k),P=_(!1),F=i(x,e=>{k.current=e,E.current=e,w!==`parent`&&(T.current=e)}),I=e=>{P.current=e.pointerType!==`touch`&&D},L=e=>{e.preventDefault(),e.stopPropagation(),P.current&&(P.current=!1,S()),l?.(e)};return f.createElement(O,{...j?{type:`button`}:{},className:v({caret:a,show:D},o),...y({onPointerDown:I},g,N,{onClick:L,onKeyDown:p,...m!==void 0&&{tabIndex:m}}),...M,ref:F},n)}const R=a(L,`MenuToggle`);export{M as a,A as c,x as d,j as i,T as l,I as n,k as o,N as r,O as s,R as t,C as u};
2
- //# sourceMappingURL=MenuToggle-7RQ0dmtZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MenuToggle-7RQ0dmtZ.js","names":[],"sources":["../../src/components/menu/MenuDivider.tsx","../../src/components/menu/MenuHeader.tsx","../../src/components/menu/MenuItem.tsx","../../src/components/menu/menuNavigation.ts","../../src/components/menu/submenuGroup.ts","../../src/components/menu/MenuList.tsx","../../src/components/menu/MenuToggle.tsx"],"sourcesContent":["import React, { forwardRef, HTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nexport interface MenuDividerProps extends HTMLAttributes<HTMLHRElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n}\n\nexport const MenuDivider = forwardRef<HTMLHRElement, MenuDividerProps>(\n ({ className, ...rest }, ref) => {\n const _className = classNames('menu-divider', className)\n\n return <hr className={_className} {...rest} ref={ref} />\n }\n)\n\nMenuDivider.displayName = 'MenuDivider'\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype MenuHeaderOwnProps<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 * ARIA role applied to the root node. Defaults to `'presentation'` — see the render function\n * for why.\n */\n role?: React.AriaRole\n}\n\nexport type MenuHeaderProps<C extends ElementType = 'h4'> = PolymorphicComponentProps<\n C,\n MenuHeaderOwnProps<C>\n>\n\ntype MenuHeaderComponent = (<C extends ElementType = 'h4'>(\n props: MenuHeaderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction MenuHeaderRender<C extends ElementType = 'h4'>(\n { children, className, component, role = 'presentation', ...rest }: MenuHeaderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h4'\n const _className = classNames('menu-header', className)\n\n // Always rendered as a direct child of `role=\"menu\"` (see MenuList) — ARIA's menu role only\n // permits menuitem/group/separator children, so a bare heading fails aria-required-children.\n // `role=\"presentation\"` opts the element itself out without hiding its text content.\n return (\n <Component className={_className} role={role} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const MenuHeader = createPolymorphicComponent<MenuHeaderComponent>(\n MenuHeaderRender as ForwardRefRenderFunction<Element, MenuHeaderProps<ElementType>>,\n 'MenuHeader'\n)\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n MouseEvent,\n ReactElement,\n ReactNode\n} from 'react'\nimport classNames from 'classnames'\n\nimport { linkElement } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\nimport { renderMenuItemContent } from '../../utils/renderMenuItemContent'\nimport { LinkProps, Link } from '../link/Link'\n\ntype MenuItemOwnProps = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Secondary line of text rendered below `children` (`.menu-item-description`).\n */\n description?: ReactNode\n /**\n * Icon rendered at the item's leading edge (`.menu-item-icon`).\n */\n icon?: ReactNode\n /**\n * Marks the item as the current selection in a choice list. Renders in a heavier font weight.\n * Combine with a manually-composed `.menu-item-check` icon (in `children`, or via `icon` on a\n * plain, non-selection item) to also show a checkmark — this prop alone doesn't add one, so\n * existing font-weight-only usage keeps rendering unchanged.\n */\n selected?: boolean\n}\n\nexport type MenuItemProps<C extends ElementType = 'a'> = LinkProps<C> & MenuItemOwnProps\n\ntype MenuItemComponent = (<C extends ElementType = 'a'>(\n props: MenuItemProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLAnchorElement | HTMLButtonElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction MenuItemRender<C extends ElementType = 'a'>(\n {\n children,\n className,\n component,\n description,\n href,\n icon,\n onClick,\n selected,\n ...rest\n }: MenuItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n const _className = classNames('menu-item', { selected }, className)\n\n // `href=\"#\"` is a common placeholder for menu items that act via `onClick` rather than\n // real navigation. Left alone, a plain anchor click still navigates to the empty fragment,\n // which scrolls the page to the top — so we suppress that default for the placeholder case\n // only, leaving real same-page anchors (`href=\"#some-id\"`) free to navigate as expected.\n const handleClick = (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (href === '#') event.preventDefault()\n onClick?.(event)\n }\n\n // An item with `href` is an `<a>`, one without is a `<button type=\"button\">`, unless `component`\n // or `asChild` chose the element (see `linkElement`). chassis-css styles both as `.menu-item`.\n // An item without `href` used to be an `<a>` with no `href`, which isn't focusable, so keyboard\n // users couldn't reach it outside the menu's own arrow-key handling.\n return (\n <Link\n role=\"menuitem\"\n component={linkElement(component as ElementType | undefined, href, 'button')}\n href={href}\n onClick={handleClick}\n {...(rest as Record<string, unknown>)}\n className={_className}\n ref={ref as PolymorphicRef<ElementType>}\n >\n {renderMenuItemContent({ icon, label: children, description })}\n </Link>\n )\n}\n\nexport const MenuItem = createPolymorphicComponent<MenuItemComponent>(\n MenuItemRender as ForwardRefRenderFunction<Element, MenuItemProps<ElementType>>,\n 'MenuItem'\n)\n","import React from 'react'\n\n// Mirrors Chassis CSS's menu.js SELECTOR_VISIBLE_ITEMS / SELECTOR_KB_NAV_ITEMS: direct-child\n// menu items and submenu-back buttons, plus submenu trigger items nested one level inside a\n// `.submenu` wrapper (which aren't direct children of the `.menu`).\n//\n// Walks `children` directly rather than a `:scope`-based `querySelectorAll` — jsdom's selector\n// engine (nwsapi) mis-parses `:scope` queries against an element whose `id` contains a colon,\n// which is exactly the shape of React 18's default `useId()` output now that `MenuList`/\n// `MenuSubmenu` set a real `id` for `aria-controls`/`aria-labelledby` linking. Real browsers don't\n// have this bug, but walking children is just as correct and sidesteps it either way.\nconst VISIBLE_ITEMS_SELECTOR = ':is(.menu-item, .submenu-back):not(.disabled):not(:disabled)'\n\nconst isVisible = (element: HTMLElement) =>\n Boolean(element.offsetWidth || element.offsetHeight || element.getClientRects().length)\n\nexport const getMenuItems = (menu: HTMLElement | null): HTMLElement[] => {\n if (!menu) return []\n const items: HTMLElement[] = []\n for (const child of Array.from(menu.children)) {\n if (child.matches(VISIBLE_ITEMS_SELECTOR)) {\n items.push(child as HTMLElement)\n } else if (child.classList.contains('submenu')) {\n const trigger = Array.from(child.children).find((grandchild) =>\n grandchild.matches(VISIBLE_ITEMS_SELECTOR)\n )\n if (trigger) items.push(trigger as HTMLElement)\n }\n }\n return items.filter(isVisible)\n}\n\nexport const focusMenuItem = (items: HTMLElement[], target: 'first' | 'last') => {\n if (!items.length) return\n ;(target === 'first' ? items[0]! : items[items.length - 1]!).focus()\n}\n\nexport interface MenuKeyDownOptions {\n onArrowLeft?: () => void\n onArrowRight?: () => void\n onEscape?: () => void\n}\n\n// Scoped to `event.currentTarget` (the `.menu` element the handler is bound to), so the same\n// function drives keyboard navigation for both the top-level menu and any nested submenu list.\n// `onArrowLeft`/`onArrowRight` are both optional and independent (rather than a single\n// direction-agnostic \"close\" callback) so a caller under an RTL locale can wire the one that\n// actually points back toward the trigger — see `MenuSubmenu`, the only current consumer of\n// either.\nexport const handleMenuKeyDown = (\n event: React.KeyboardEvent<HTMLElement>,\n { onArrowLeft, onArrowRight, onEscape }: MenuKeyDownOptions\n): void => {\n const menu = event.currentTarget\n const target = event.target as HTMLElement\n\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp': {\n event.preventDefault()\n event.stopPropagation()\n const items = getMenuItems(menu)\n if (!items.length) return\n const currentIndex = items.indexOf(target)\n const nextIndex =\n currentIndex === -1\n ? event.key === 'ArrowDown'\n ? 0\n : items.length - 1\n : (currentIndex + (event.key === 'ArrowDown' ? 1 : -1) + items.length) % items.length\n // `nextIndex` is always a valid index into `items` here (0, items.length - 1, or a modulo\n // result — the `if (!items.length) return` above already ruled out the empty-array case).\n items[nextIndex]!.focus()\n return\n }\n case 'Home':\n case 'End': {\n event.preventDefault()\n event.stopPropagation()\n focusMenuItem(getMenuItems(menu), event.key === 'Home' ? 'first' : 'last')\n return\n }\n case 'Escape': {\n if (!onEscape) return\n event.preventDefault()\n event.stopPropagation()\n onEscape()\n return\n }\n case 'ArrowLeft': {\n if (!onArrowLeft) return\n event.preventDefault()\n event.stopPropagation()\n onArrowLeft()\n return\n }\n case 'ArrowRight': {\n if (!onArrowRight) return\n event.preventDefault()\n event.stopPropagation()\n onArrowRight()\n return\n }\n default:\n }\n}\n","import { createContext, useRef } from 'react'\n\n// Lets sibling `.submenu` flyouts at the same menu level close one another when a new one\n// opens, mirroring menu.js's `_closeSiblingSubmenus`. One provider instance is created per\n// menu level (the top-level `.menu` and each `.submenu`'s own nested list) and lives for the\n// lifetime of that level, so registration doesn't churn on every render.\nexport interface SubmenuGroupContextValue {\n register: (id: string, close: () => void) => () => void\n notifyOpen: (id: string) => void\n}\n\nexport const SubmenuGroupContext = createContext<SubmenuGroupContextValue | null>(null)\n\nexport const useSubmenuGroupProvider = (): SubmenuGroupContextValue => {\n const ref = useRef<SubmenuGroupContextValue | null>(null)\n\n if (!ref.current) {\n const closers = new Map<string, () => void>()\n ref.current = {\n register: (id, close) => {\n closers.set(id, close)\n return () => {\n closers.delete(id)\n }\n },\n notifyOpen: (id) => {\n closers.forEach((close, key) => {\n if (key !== id) close()\n })\n }\n }\n }\n\n return ref.current\n}\n\n// Exposes the current `.submenu`'s own close-and-refocus action to a nested `MenuSubmenuBack`\n// button, without threading it through the sibling-group registry above.\nexport interface SubmenuActionsContextValue {\n close: () => void\n}\n\nexport const SubmenuActionsContext = createContext<SubmenuActionsContextValue | null>(null)\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n useContext,\n useEffect\n} from 'react'\nimport classNames from 'classnames'\n\nimport { useForkedRef } from '../../hooks'\nimport { renderMenuItemContent } from '../../utils/renderMenuItemContent'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { Portal, useHydrated } from '../portal/Portal'\nimport { MenuContext } from './Menu'\nimport { MenuDivider } from './MenuDivider'\nimport { MenuHeader } from './MenuHeader'\nimport { MenuItem } from './MenuItem'\nimport { MenuItemsDef } from './MenuItemDef'\nimport { focusMenuItem, getMenuItems, handleMenuKeyDown } from './menuNavigation'\nimport { SubmenuGroupContext, useSubmenuGroupProvider } from './submenuGroup'\n\ntype MenuListOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base 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 * Array of item/header/divider definitions for data-driven rendering. When provided, children\n * are ignored. Covers flat items, headers, and dividers only — for nested submenus, compose\n * with `children` and `MenuSubmenu` instead.\n */\n items?: MenuItemsDef\n}\n\nexport type MenuListProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n MenuListOwnProps<C>\n>\n\ntype MenuListComponent = (<C extends ElementType = 'div'>(\n props: MenuListProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nconst renderMenuItemDef = (def: MenuItemsDef[number]): ReactNode => {\n if (def.type === 'header') {\n return <MenuHeader key={def.id}>{def.label}</MenuHeader>\n }\n if (def.type === 'divider') {\n return <MenuDivider key={def.id} />\n }\n return (\n <MenuItem\n key={def.id}\n href={def.href}\n disabled={def.disabled}\n selected={def.selected}\n onClick={def.onClick}\n >\n {renderMenuItemContent({\n icon: def.icon,\n label: def.label,\n description: def.description,\n selected: def.selected\n })}\n </MenuItem>\n )\n}\n\nfunction MenuListRender<C extends ElementType = 'div'>(\n { children, className, component, items, onKeyDown, ...rest }: MenuListProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const {\n close,\n container,\n focusStrategy,\n menuId,\n menuStyle,\n overlayRef,\n placementAttr,\n triggerId,\n visible\n } = useContext(MenuContext)\n const forkedRef = useForkedRef(ref, overlayRef)\n const submenuGroup = useSubmenuGroupProvider()\n // The list is positioned in a layout effect, which the server never runs: a menu open on its\n // first render was painted at the top left of the page until the JavaScript had loaded. It is\n // shown once hydration has finished, where that effect has placed it.\n const hydrated = useHydrated()\n const shown = visible && hydrated\n\n // ArrowDown/ArrowUp on the trigger opens the menu with a focus strategy (see `Menu`'s\n // `useMenuTrigger` wiring) — this is where that intent actually lands, since we're not\n // adopting `useMenu`'s own collection-aware auto-focus.\n useEffect(() => {\n if (!visible || !focusStrategy) return\n focusMenuItem(getMenuItems(overlayRef.current), focusStrategy === 'last' ? 'last' : 'first')\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible, focusStrategy])\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n handleMenuKeyDown(event, { onEscape: close })\n onKeyDown?.(event as React.KeyboardEvent<HTMLDivElement>)\n }\n\n // Labelled by the trigger, unless the caller names the list itself: `aria-labelledby` would\n // outrank that `aria-label`. Left out when there is no trigger to point at (a `ContextMenu`'s\n // region with no id of its own has one; a list rendered with no `Menu` around it has none).\n const ariaLabel = (rest as { 'aria-label'?: string })['aria-label']\n const labelledBy = ariaLabel ? undefined : triggerId || undefined\n\n const content = (\n <Component\n role=\"menu\"\n id={menuId}\n aria-labelledby={labelledBy}\n className={classNames('menu', { show: shown }, className)}\n style={menuStyle}\n data-cx-placement={placementAttr}\n {...rest}\n onKeyDown={handleKeyDown}\n ref={forkedRef}\n >\n <SubmenuGroupContext.Provider value={submenuGroup}>\n {items ? items.map(renderMenuItemDef) : children}\n </SubmenuGroupContext.Provider>\n </Component>\n )\n\n if (container) {\n return <Portal container={container === true ? undefined : container}>{content}</Portal>\n }\n\n return content\n}\n\nexport const MenuList = createPolymorphicComponent<MenuListComponent>(\n MenuListRender as ForwardRefRenderFunction<Element, MenuListProps<ElementType>>,\n 'MenuList'\n)\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n useContext,\n useRef\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps, useButton } from 'react-aria'\n\nimport { Button, ButtonProps } from '../button/Button'\nimport { MenuContext } from './Menu'\nimport { ContextColor, Shapes } from '../../types'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { useForkedRef } from '../../hooks'\nimport { hasHref, hrefProps, resolveLinkKind } from '../../utils/elementKind'\n\ntype MenuToggleOwnProps<C extends ElementType> = {\n /**\n * Toggle the active state for the component.\n */\n active?: boolean\n /**\n * Draws the caret after the toggle's content. Set it to `false` for a toggle that shows what it\n * is another way, such as an icon-only \"more\" button.\n *\n * @default true\n */\n caret?: boolean\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors. Only applies to the\n * default `Button` root.\n */\n color?: ContextColor\n /**\n * Component used for the root node — the trigger element the menu opens from. Defaults to\n * `Button`; swap for e.g. `NavLink` to render a nav-item-style trigger (`.nav-link.caret`)\n * instead of a `.button.caret`. Its own props are type-checked at the call site once passed\n * here.\n */\n component?: C\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * The href attribute specifies the URL of the page the link goes to.\n */\n href?: string\n /**\n * Select the shape of the component. Only applies to the default `Button` root.\n */\n shape?: Shapes\n /**\n * Size the component sm or lg. Only applies to the default `Button` root.\n */\n size?: 'sm' | 'lg'\n /**\n * Sets the style variant of the component, as `Button`'s own `variant` does. Only applies to\n * the default `Button` root.\n */\n variant?: ButtonProps['variant']\n}\n\nexport type MenuToggleProps<C extends ElementType = typeof Button> = PolymorphicComponentProps<\n C,\n MenuToggleOwnProps<C>\n>\n\ntype MenuToggleComponent = (<C extends ElementType = typeof Button>(\n props: MenuToggleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction MenuToggleRender<C extends ElementType = typeof Button>(\n {\n children,\n caret = true,\n className,\n component,\n href,\n onClick,\n onKeyDown,\n tabIndex,\n ...rest\n }: MenuToggleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const { hide, menuTriggerProps, reference, targetRef, toggleNodeRef, visible } =\n useContext(MenuContext)\n const Component = component ?? Button\n const buttonRef = useRef<HTMLButtonElement | null>(null)\n // What the root renders. The default `Button` renders a `<button>`, or an `<a>` given `href`.\n // Anything else is asked, like every polymorphic component asks: `NavLink` is a component\n // reference, and `component=\"button\"` a real `<button>`.\n const kind =\n Component === Button\n ? hasHref(href)\n ? 'anchor'\n : 'button'\n : resolveLinkKind(Component, href, rest)\n const rendersButton = kind === 'button'\n // `Button` applies the `href` rule itself; anything else gets `href` only if it can take one.\n const linkProps = Component === Button ? { href } : hrefProps(kind, href, 'MenuToggle')\n // `elementType` tells react-aria whether the rendered root already has native button\n // semantics or needs them emulated (`role=\"button\"`, keyboard activation).\n const { buttonProps } = useButton(\n { ...menuTriggerProps, elementType: rendersButton ? 'button' : 'a' },\n buttonRef\n )\n const wasOpenRef = useRef(false)\n\n const setRefs = (node: HTMLButtonElement | null) => {\n buttonRef.current = node\n toggleNodeRef.current = node\n if (reference !== 'parent') {\n targetRef.current = node\n }\n }\n\n const forkedRef = useForkedRef(ref, setRefs)\n\n // react-aria's `useMenuTrigger` opens (rather than toggles) on mouse/pen press start, so\n // re-clicking an already-open trigger would otherwise re-open it right back instead of\n // closing it. Capture whether it was open before that happens — ours has to run ahead of\n // `buttonProps`' own `onPointerDown` in the `mergeProps` chain below — then close it back\n // down on click. Touch is exempt: react-aria's `onPress` already toggles it correctly there.\n const handlePointerDown = (event: React.PointerEvent<HTMLButtonElement>) => {\n wasOpenRef.current = event.pointerType !== 'touch' && visible\n }\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n event.stopPropagation()\n if (wasOpenRef.current) {\n wasOpenRef.current = false\n hide()\n }\n onClick?.(event)\n }\n\n return (\n <Component\n // A `<button>` root needs an explicit `type` to avoid an implicit form submit; other roots\n // (e.g. `NavLink`) don't render a `<button>` at all.\n {...(rendersButton ? { type: 'button' } : {})}\n // The `.caret` utility (rather than styling off `[data-cx-toggle=\"menu\"]`, as the vanilla\n // CSS docs show) keeps this element from also matching Chassis CSS's own vanilla menu.js\n // selectors on a page that happens to load both — this component reimplements all of that\n // behavior itself, so there's nothing for the vanilla plugin to usefully do with it anyway.\n // `show` mirrors `MenuList`'s own `{ show: visible }` and vanilla menu.js's\n // `this._element.classList.add('show')` — it's what puts the trigger itself into a\n // pressed look while its menu is open (`.button.show`/`.nav-item.show .nav-link`).\n className={classNames({ caret, show: visible }, className)}\n {...(mergeProps({ onPointerDown: handlePointerDown }, rest, buttonProps, {\n onClick: handleClick,\n onKeyDown,\n // The caller's, when it gives one: react-aria's own `tabIndex` would replace it.\n ...(tabIndex !== undefined && { tabIndex })\n }) as Record<string, unknown>)}\n // After `buttonProps`: for an `<a>`, react-aria returns an `href` of its own, the one it was\n // given, which is none.\n {...linkProps}\n ref={forkedRef}\n >\n {children}\n </Component>\n )\n}\n\nexport const MenuToggle = createPolymorphicComponent<MenuToggleComponent>(\n MenuToggleRender as ForwardRefRenderFunction<Element, MenuToggleProps<ElementType>>,\n 'MenuToggle'\n)\n"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import e,{useSyncExternalStore as t}from"react";import{createPortal as n}from"react-dom";const r=()=>()=>{};function i(){return t(r,()=>!0,()=>!1)}function a({children:t,container:r,fallback:a}){return i()?n(t,r??document.body):e.createElement(e.Fragment,null,a)}a.displayName=`Portal`;export{i as n,a as t};
2
- //# sourceMappingURL=Portal-CgeR1WXV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Portal-CgeR1WXV.js","names":[],"sources":["../../src/components/portal/Portal.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, useSyncExternalStore } from 'react'\nimport { createPortal } from 'react-dom'\n\n// Nothing to subscribe to: the value only differs between the server snapshot and the client one.\nconst subscribe = () => () => {}\n\n/**\n * `false` on the server and during hydration, `true` afterwards and in a client-only render. React\n * hydrates against the server snapshot, then re-renders with the client one once hydration has\n * finished, so a component can render something that only exists in the browser without\n * mismatching the server's HTML.\n */\nexport function useHydrated(): boolean {\n return useSyncExternalStore(\n subscribe,\n () => true,\n () => false\n )\n}\n\nexport interface PortalProps {\n /**\n * The content to render in the portal.\n */\n children: ReactNode\n /**\n * Where the children are portaled. Defaults to `document.body`.\n */\n container?: Element | DocumentFragment | null\n /**\n * Rendered in place until the portal exists: on the server and during hydration. Nothing by\n * default.\n */\n fallback?: ReactNode\n}\n\n// A portal has no server equivalent. `typeof window !== 'undefined' && createPortal(...)` renders\n// nothing on the server and the portal's content on the client's first render, so hydration walks\n// into content the server never sent and reports a mismatch. `Portal` renders `fallback` until\n// hydration has finished, then portals `children`; a client-only render portals immediately.\n/**\n * Renders its children into `container` (`document.body` by default), and renders `fallback` on the\n * server and during hydration, so server-rendered pages hydrate without a mismatch.\n */\nexport function Portal({ children, container, fallback }: PortalProps): ReactElement {\n const hydrated = useHydrated()\n if (!hydrated) return <>{fallback}</>\n return createPortal(children, container ?? document.body)\n}\n\nPortal.displayName = 'Portal'\n"],"mappings":"yFAIA,MAAM,UAAwB,CAAC,EAQ/B,SAAgB,GAAuB,CACrC,OAAO,EACL,MACM,OACA,EACR,CACF,CA0BA,SAAgB,EAAO,CAAE,WAAU,YAAW,YAAuC,CAGnF,OAFiB,EACL,EACL,EAAa,EAAU,GAAa,SAAS,IAAI,EADlC,EAAA,cAAA,EAAA,SAAA,KAAG,CAAW,CAEtC,CAEA,EAAO,YAAc"}
@@ -1,2 +0,0 @@
1
- import{t as e}from"./focus-ring-SR_LwaN7.js";import{t}from"./useForkedRef-DVEfT-KI.js";import{n}from"./Portal-CgeR1WXV.js";import{t as r}from"./VisuallyHidden-C2dM7HhC.js";import i,{createContext as a,forwardRef as o,useContext as s,useEffect as c,useMemo as l,useRef as u,useState as d}from"react";import f from"classnames";import{mergeProps as p,useButton as m,useCalendar as h,useCalendarCell as g,useCalendarGrid as _,useDateFormatter as v,useLocale as y,useLocalizedStringFormatter as b,useRangeCalendar as x}from"react-aria";import{useCalendarState as S,useRangeCalendarState as C}from"react-stately";import{flushSync as w}from"react-dom";import{createCalendar as T,getLocalTimeZone as E,isSameDay as D,isSameMonth as O,isToday as k,isWeekend as A,startOfMonth as j,toCalendar as M,toCalendarDate as N,today as ee}from"@internationalized/date";const P=(e,t,n)=>!!(e.isDisabled||e.maxValue&&t.compare(N(e.maxValue))>0||e.minValue&&n.compare(N(e.minValue))<0),F={previousYears:`Previous years`,nextYears:`Next years`,selectYear:`Select year`,selectMonth:`Select month`,month:`Month`,year:`Year`,calendar:`Calendar`,clear:`Clear`},I=a(F),L=()=>s(I),R=({children:e,labels:t})=>{let n=s(I),r=l(()=>t?{...n,...t}:n,[n,t]);return i.createElement(I.Provider,{value:r},e)},z=({announce:e=!0,monthStart:t,onBack:n,onSelect:a,state:o})=>{let s=L(),c=v({calendar:t.calendar.identifier,month:`short`,timeZone:o.timeZone}),l=v({calendar:t.calendar.identifier,timeZone:o.timeZone,year:`numeric`}),u=t.calendar.getMonthsInYear(t),d=[...Array(u).keys()].map(e=>{let n=t.set({day:1,month:e+1});return{date:n,formatted:c.format(n.toDate(o.timeZone))}});return i.createElement(i.Fragment,null,i.createElement(`div`,{className:`datepicker-header`},i.createElement(`div`,{className:`datepicker-header-content`},i.createElement(`button`,{className:`datepicker-month`,onClick:n,type:`button`},l.format(t.toDate(o.timeZone))))),e&&i.createElement(r,{role:`status`},`${s.selectMonth}, ${l.format(t.toDate(o.timeZone))}`),i.createElement(`div`,{className:`datepicker-content`},i.createElement(`div`,{"aria-label":l.format(t.toDate(o.timeZone)),className:`datepicker-months`,role:`group`},d.map(e=>{let n=e.date.month===t.month,r=P(o,e.date,e.date.add({months:1}).subtract({days:1}));return i.createElement(`button`,{"aria-current":n?`true`:void 0,className:f(`datepicker-months-month`,{selected:n}),disabled:r,key:e.date.month,onClick:()=>a(e.date),type:`button`},e.formatted)}))))},B=({announce:e=!0,monthStart:t,onBack:n,onSelect:a,state:o})=>{let s=L(),c=v({calendar:t.calendar.identifier,timeZone:o.timeZone,year:`numeric`}),[l,u]=d(0),p=[...Array(15).keys()].map(e=>{let n=l+e,r=t.add({years:n}),i=r.set({day:1,month:1}),a=i.add({years:1}).subtract({days:1});return{date:r,formatted:c.format(r.toDate(o.timeZone)),offset:n,yearEnd:a,yearStart:i}}),m=p[0],h=p[p.length-1],g=m.yearStart,_=h.yearEnd,y=`${m.formatted} – ${h.formatted}`,b=o.isDisabled||o.minValue!=null&&g.subtract({days:1}).compare(N(o.minValue))<0,x=o.isDisabled||o.maxValue!=null&&_.add({days:1}).compare(N(o.maxValue))>0;return i.createElement(i.Fragment,null,i.createElement(`div`,{className:`datepicker-header`},i.createElement(`button`,{"aria-label":s.previousYears,className:`datepicker-arrow datepicker-arrow-prev`,disabled:b,onClick:()=>u(e=>e-15),type:`button`}),i.createElement(`div`,{className:`datepicker-header-content`},i.createElement(`button`,{className:`datepicker-year`,onClick:n,type:`button`},y)),i.createElement(`button`,{"aria-label":s.nextYears,className:`datepicker-arrow datepicker-arrow-next`,disabled:x,onClick:()=>u(e=>e+15),type:`button`})),e&&i.createElement(r,{role:`status`},`${s.selectYear}, ${y}`),i.createElement(`div`,{className:`datepicker-content`},i.createElement(`div`,{"aria-label":y,className:`datepicker-years`,role:`group`},p.map(e=>{let t=e.offset===0,n=P(o,e.yearStart,e.yearEnd);return i.createElement(`button`,{"aria-current":t?`true`:void 0,className:f(`datepicker-years-year`,{selected:t}),disabled:n,key:e.offset,onClick:()=>a(e.date),type:`button`},e.formatted)}))))},V=(e,t)=>{let{start:n,end:r}=e.visibleRange;if(t.compare(n)===0)return;let i=e.visibleDuration.months||1,a=t.compare(n)>0;if(a?t.compare(r)>0:t.add({months:i-1}).compare(n)<0){e.setFocusedDate(H(t,a,i));return}let o=a?t.add({months:i}):t.subtract({months:i});w(()=>{e.setFocusedDate(H(o,a,i))}),e.setFocusedDate(H(t,!a,i))},H=(e,t,n)=>t?e:e.add({months:n-1}),U=({children:e,monthIndex:t=0,monthStart:n,nextArrow:a,onViewChange:o,prevArrow:s,state:l})=>{let f=L(),[p,m]=d(`days`),h=u(null),g=u(p),_=e=>{m(e),o?.(e)},y=u(o);y.current=o,c(()=>()=>y.current?.(`days`),[]),c(()=>{let e=g.current;if(e===p)return;g.current=p;let t=h.current;t&&(p===`days`?t.querySelector(`.datepicker-date-btn[tabindex="0"]`)??t.querySelector(e===`years`?`.datepicker-year`:`.datepicker-month`):t.querySelector(`.datepicker-months-month.selected, .datepicker-years-year.selected`)??t.querySelector(`.datepicker-months-month, .datepicker-years-year`))?.focus()},[p]);let b=v({calendar:n.calendar.identifier,month:`long`,timeZone:l.timeZone}),x=v({calendar:n.calendar.identifier,timeZone:l.timeZone,year:`numeric`}),S=e=>{V(l,e.subtract({months:t})),_(`days`)};return i.createElement(`div`,{className:`datepicker-column`,ref:h},p===`months`&&i.createElement(z,{announce:t===0,monthStart:n,onBack:()=>_(`days`),onSelect:S,state:l}),p===`years`&&i.createElement(B,{announce:t===0,monthStart:n,onBack:()=>_(`days`),onSelect:S,state:l}),p===`days`&&i.createElement(i.Fragment,null,i.createElement(`div`,{className:`datepicker-header`},s,i.createElement(`div`,{className:`datepicker-header-content`},i.createElement(`button`,{"aria-label":`${f.month}: ${b.format(n.toDate(l.timeZone))}`,className:`datepicker-month`,disabled:l.isDisabled,onClick:()=>_(`months`),type:`button`},b.format(n.toDate(l.timeZone))),i.createElement(`button`,{"aria-label":`${f.year}: ${x.format(n.toDate(l.timeZone))}`,className:`datepicker-year`,disabled:l.isDisabled,onClick:()=>_(`years`),type:`button`},x.format(n.toDate(l.timeZone)))),a),t===0&&i.createElement(r,{role:`status`},`${b.format(n.toDate(l.timeZone))} ${x.format(n.toDate(l.timeZone))}`),e))},W=({firstDayOfWeek:e,renderCell:t,startDate:n,state:r})=>{let{gridProps:a,headerProps:o,weekDays:s,weeksInMonth:c}=_({firstDayOfWeek:e,startDate:n},r),l=n??r.visibleRange.start;return i.createElement(`div`,{...a,className:`datepicker-content`},i.createElement(`div`,{...o,className:`datepicker-week`,role:`row`},s.map((e,t)=>i.createElement(`span`,{className:`datepicker-week-day`,key:t,role:`columnheader`},e))),i.createElement(`div`,{className:`datepicker-dates`},[...Array(c).keys()].map(e=>{let a=r.getDatesInWeek(e,n);return i.createElement(`div`,{className:`datepicker-dates-row`,key:e,role:`row`},a.map((e,n)=>e?i.createElement(i.Fragment,{key:e.toString()},t(e,n,a,!O(e,l))):i.createElement(`div`,{className:`datepicker-date`,key:n,role:`gridcell`})))})))},te=({arrows:e,firstDayOfWeek:t,monthIndex:n,onViewChange:r,renderCell:a,state:o})=>{let s=o.visibleRange.start.add({months:n});return i.createElement(i.Fragment,null,i.createElement(U,{monthIndex:n,monthStart:s,nextArrow:e?.next,onViewChange:r,prevArrow:e?.prev,state:o},i.createElement(W,{firstDayOfWeek:t,renderCell:a,startDate:s,state:o})))},G=({buttonProps:e,direction:t})=>{let n=u(null),{buttonProps:r}=m(e,n);return i.createElement(`button`,{...r,className:`datepicker-arrow datepicker-arrow-${t}`,ref:n,type:`button`})},K=(e,t)=>{if(!e?.length&&!t)return;let n=e?.length?new Set(e):null;return e=>!!n?.has(N(e).toString())||!!t?.(e)},q={"ar-AE":{todayDate:e=>`اليوم، ${e?.date}`,todayDateSelected:e=>`اليوم، ${e?.date} محدد`,dateSelected:e=>`${e?.date} المحدد`,minimumDate:`أول تاريخ متاح`,maximumDate:`آخر تاريخ متاح`},"bg-BG":{todayDate:e=>`Днес, ${e?.date}`,todayDateSelected:e=>`Днес, ${e?.date} са избрани`,dateSelected:e=>`Избрано е ${e?.date}`,minimumDate:`Първа налична дата`,maximumDate:`Последна налична дата`},"cs-CZ":{todayDate:e=>`Dnes, ${e?.date}`,todayDateSelected:e=>`Dnes, vybráno ${e?.date}`,dateSelected:e=>`Vybráno ${e?.date}`,minimumDate:`První dostupné datum`,maximumDate:`Poslední dostupné datum`},"da-DK":{todayDate:e=>`I dag, ${e?.date}`,todayDateSelected:e=>`I dag, ${e?.date} valgt`,dateSelected:e=>`${e?.date} valgt`,minimumDate:`Første ledige dato`,maximumDate:`Sidste ledige dato`},"de-DE":{todayDate:e=>`Heute, ${e?.date}`,todayDateSelected:e=>`Heute, ${e?.date} ausgewählt`,dateSelected:e=>`${e?.date} ausgewählt`,minimumDate:`Erstes verfügbares Datum`,maximumDate:`Letztes verfügbares Datum`},"el-GR":{todayDate:e=>`Σήμερα, ${e?.date}`,todayDateSelected:e=>`Σήμερα, επιλέχτηκε ${e?.date}`,dateSelected:e=>`Επιλέχθηκε ${e?.date}`,minimumDate:`Πρώτη διαθέσιμη ημερομηνία`,maximumDate:`Τελευταία διαθέσιμη ημερομηνία`},"en-US":{todayDate:e=>`Today, ${e?.date}`,todayDateSelected:e=>`Today, ${e?.date} selected`,dateSelected:e=>`${e?.date} selected`,minimumDate:`First available date`,maximumDate:`Last available date`},"es-ES":{todayDate:e=>`Hoy, ${e?.date}`,todayDateSelected:e=>`Hoy, ${e?.date} seleccionado`,dateSelected:e=>`${e?.date} seleccionado`,minimumDate:`Primera fecha disponible`,maximumDate:`Última fecha disponible`},"et-EE":{todayDate:e=>`Täna, ${e?.date}`,todayDateSelected:e=>`Täna, ${e?.date} valitud`,dateSelected:e=>`${e?.date} valitud`,minimumDate:`Esimene saadaolev kuupäev`,maximumDate:`Viimane saadaolev kuupäev`},"fi-FI":{todayDate:e=>`Tänään, ${e?.date}`,todayDateSelected:e=>`Tänään, ${e?.date} valittu`,dateSelected:e=>`${e?.date} valittu`,minimumDate:`Ensimmäinen varattavissa oleva päivämäärä`,maximumDate:`Viimeinen varattavissa oleva päivämäärä`},"fr-FR":{todayDate:e=>`Aujourd'hui, ${e?.date}`,todayDateSelected:e=>`Aujourd’hui, ${e?.date} sélectionné`,dateSelected:e=>`${e?.date} sélectionné`,minimumDate:`Première date disponible`,maximumDate:`Dernière date disponible`},"he-IL":{todayDate:e=>`היום, ${e?.date}`,todayDateSelected:e=>`היום, ${e?.date} נבחר`,dateSelected:e=>`${e?.date} נבחר`,minimumDate:`תאריך פנוי ראשון`,maximumDate:`תאריך פנוי אחרון`},"hr-HR":{todayDate:e=>`Danas, ${e?.date}`,todayDateSelected:e=>`Danas, odabran ${e?.date}`,dateSelected:e=>`${e?.date} odabran`,minimumDate:`Prvi raspoloživi datum`,maximumDate:`Posljednji raspoloživi datum`},"hu-HU":{todayDate:e=>`Ma, ${e?.date}`,todayDateSelected:e=>`Ma, ${e?.date} kijelölve`,dateSelected:e=>`${e?.date} kiválasztva`,minimumDate:`Az első elérhető dátum`,maximumDate:`Utolsó elérhető dátum`},"it-IT":{todayDate:e=>`Oggi, ${e?.date}`,todayDateSelected:e=>`Oggi, ${e?.date} selezionata`,dateSelected:e=>`${e?.date} selezionata`,minimumDate:`Prima data disponibile`,maximumDate:`Ultima data disponibile`},"ja-JP":{todayDate:e=>`本日、${e?.date}`,todayDateSelected:e=>`本日、${e?.date} を選択`,dateSelected:e=>`${e?.date} を選択`,minimumDate:`最初の利用可能日`,maximumDate:`最終利用可能日`},"ko-KR":{todayDate:e=>`오늘, ${e?.date}`,todayDateSelected:e=>`오늘, ${e?.date} 선택됨`,dateSelected:e=>`${e?.date} 선택됨`,minimumDate:`처음으로 사용 가능한 일자`,maximumDate:`마지막으로 사용 가능한 일자`},"lt-LT":{todayDate:e=>`Šiandien, ${e?.date}`,todayDateSelected:e=>`Šiandien, pasirinkta ${e?.date}`,dateSelected:e=>`Pasirinkta ${e?.date}`,minimumDate:`Pirmoji galima data`,maximumDate:`Paskutinė galima data`},"lv-LV":{todayDate:e=>`Šodien, ${e?.date}`,todayDateSelected:e=>`Atlasīta šodiena, ${e?.date}`,dateSelected:e=>`Atlasīts: ${e?.date}`,minimumDate:`Pirmais pieejamais datums`,maximumDate:`Pēdējais pieejamais datums`},"nb-NO":{todayDate:e=>`I dag, ${e?.date}`,todayDateSelected:e=>`I dag, ${e?.date} valgt`,dateSelected:e=>`${e?.date} valgt`,minimumDate:`Første tilgjengelige dato`,maximumDate:`Siste tilgjengelige dato`},"nl-NL":{todayDate:e=>`Vandaag, ${e?.date}`,todayDateSelected:e=>`Vandaag, ${e?.date} geselecteerd`,dateSelected:e=>`${e?.date} geselecteerd`,minimumDate:`Eerste beschikbare datum`,maximumDate:`Laatste beschikbare datum`},"pl-PL":{todayDate:e=>`Dzisiaj, ${e?.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e?.date}`,dateSelected:e=>`Wybrano ${e?.date}`,minimumDate:`Pierwsza dostępna data`,maximumDate:`Ostatnia dostępna data`},"pt-BR":{todayDate:e=>`Hoje, ${e?.date}`,todayDateSelected:e=>`Hoje, ${e?.date} selecionado`,dateSelected:e=>`${e?.date} selecionado`,minimumDate:`Primeira data disponível`,maximumDate:`Última data disponível`},"pt-PT":{todayDate:e=>`Hoje, ${e?.date}`,todayDateSelected:e=>`Hoje, ${e?.date} selecionado`,dateSelected:e=>`${e?.date} selecionado`,minimumDate:`Primeira data disponível`,maximumDate:`Última data disponível`},"ro-RO":{todayDate:e=>`Astăzi, ${e?.date}`,todayDateSelected:e=>`Azi, ${e?.date} selectată`,dateSelected:e=>`${e?.date} selectată`,minimumDate:`Prima dată disponibilă`,maximumDate:`Ultima dată disponibilă`},"ru-RU":{todayDate:e=>`Сегодня, ${e?.date}`,todayDateSelected:e=>`Сегодня, выбрано ${e?.date}`,dateSelected:e=>`Выбрано ${e?.date}`,minimumDate:`Первая доступная дата`,maximumDate:`Последняя доступная дата`},"sk-SK":{todayDate:e=>`Dnes ${e?.date}`,todayDateSelected:e=>`Vybratý dnešný dátum ${e?.date}`,dateSelected:e=>`Vybratý dátum ${e?.date}`,minimumDate:`Prvý dostupný dátum`,maximumDate:`Posledný dostupný dátum`},"sl-SI":{todayDate:e=>`Danes, ${e?.date}`,todayDateSelected:e=>`Danes, ${e?.date} izbrano`,dateSelected:e=>`${e?.date} izbrano`,minimumDate:`Prvi razpoložljivi datum`,maximumDate:`Zadnji razpoložljivi datum`},"sr-SP":{todayDate:e=>`Danas, ${e?.date}`,todayDateSelected:e=>`Danas, izabran ${e?.date}`,dateSelected:e=>`${e?.date} izabran`,minimumDate:`Prvi raspoloživi datum`,maximumDate:`Zadnji raspoloživi datum`},"sv-SE":{todayDate:e=>`Idag, ${e?.date}`,todayDateSelected:e=>`Idag, ${e?.date} har valts`,dateSelected:e=>`${e?.date} har valts`,minimumDate:`Första tillgängliga datum`,maximumDate:`Sista tillgängliga datum`},"tr-TR":{todayDate:e=>`Bugün, ${e?.date}`,todayDateSelected:e=>`Bugün, ${e?.date} seçildi`,dateSelected:e=>`${e?.date} seçildi`,minimumDate:`İlk müsait tarih`,maximumDate:`Son müsait tarih`},"uk-UA":{todayDate:e=>`Сьогодні, ${e?.date}`,todayDateSelected:e=>`Сьогодні, вибрано ${e?.date}`,dateSelected:e=>`Вибрано ${e?.date}`,minimumDate:`Перша доступна дата`,maximumDate:`Остання доступна дата`},"zh-CN":{todayDate:e=>`今天,即 ${e?.date}`,todayDateSelected:e=>`已选择今天,即 ${e?.date}`,dateSelected:e=>`已选择 ${e?.date}`,minimumDate:`第一个可用日期`,maximumDate:`最后一个可用日期`},"zh-TW":{todayDate:e=>`今天,${e?.date}`,todayDateSelected:e=>`已選取今天,${e?.date}`,dateSelected:e=>`已選取 ${e?.date}`,minimumDate:`第一個可用日期`,maximumDate:`最後一個可用日期`}};function J(e,t,r,i){let a=n(),o=b(q,`@react-aria/calendar`),s=k(e,t.timeZone);if(a||!s||!i)return{isCurrentDate:a&&s,label:i};let[c=``,l=``]=o.format(r?`todayDateSelected`:`todayDate`,{date:`\0`}).split(`\0`),u=``;t.minValue&&D(e,t.minValue)?u=`, ${o.format(`minimumDate`)}`:t.maxValue&&D(e,t.maxValue)&&(u=`, ${o.format(`maximumDate`)}`);let d=i.length-l.length-u.length;if(!i.startsWith(c)||!i.endsWith(l+u)||d<c.length)return{isCurrentDate:!1,label:i};let f=i.slice(c.length,d);return{isCurrentDate:!1,label:(r?o.format(`dateSelected`,{date:f}):f)+u}}const Y=o((e,n)=>{let{autoFocus:r,className:a,defaultFocusedValue:o,defaultValue:s,disabled:c,firstDayOfWeek:m=`mon`,isDateUnavailable:g,labels:_,maxValue:v,minValue:b,onChange:x,selectionMode:C=`single`,unavailableDates:w,value:D,visibleMonths:O=1,...k}=e,{locale:A}=y(),j=u(null),M=t(j,n),N=l(()=>K(w,g),[w,g]),[P,F]=d({}),I=Object.values(P).some(e=>e!==`days`),L=e=>{x?.(e)},z=D,B=s,V=z===void 0?B:z,H=o??(C===`multiple`&&Array.isArray(V)&&V.length===0?ee(E()):void 0),q=S({autoFocus:r,createCalendar:T,defaultFocusedValue:H,defaultValue:B,firstDayOfWeek:m,isDateUnavailable:N,isDisabled:c,locale:A,maxValue:v,minValue:b,onChange:L,pageBehavior:`single`,selectionMode:C,value:z,visibleDuration:{months:O}}),J={"aria-label":k[`aria-label`],"aria-labelledby":k[`aria-labelledby`],autoFocus:r,defaultFocusedValue:H,defaultValue:B,isDateUnavailable:N,isDisabled:c,maxValue:v,minValue:b,onChange:L,selectionMode:C,value:z},{calendarProps:Y,prevButtonProps:Z,nextButtonProps:ne}=h(J,q),Q=i.createElement(G,{buttonProps:Z,direction:`prev`}),$=i.createElement(G,{buttonProps:ne,direction:`next`});return i.createElement(R,{labels:_},i.createElement(`div`,{...p(Y,k),className:f(`datepicker`,a),"data-cx-inline":`true`,ref:M},O===1?i.createElement(U,{monthStart:q.visibleRange.start,nextArrow:$,prevArrow:Q,state:q},i.createElement(W,{firstDayOfWeek:m,renderCell:(e,t,n,r)=>i.createElement(X,{date:e,isOutsideMonth:r,locale:A,state:q}),state:q})):i.createElement(i.Fragment,null,!I&&i.createElement(`div`,{className:`datepicker-controls`},Q,$),i.createElement(`div`,{className:`datepicker-grid`},[...Array(O).keys()].map(e=>i.createElement(te,{firstDayOfWeek:m,key:e,monthIndex:e,onViewChange:t=>F(n=>({...n,[e]:t})),renderCell:(e,t,n,r)=>i.createElement(X,{date:e,isOutsideMonth:r,locale:A,state:q}),state:q}))))))});Y.displayName=`Calendar`;const X=({date:e,isOutsideMonth:t,locale:n,state:r})=>{let a=u(null),{cellProps:o,buttonProps:s,isSelected:c,isOutsideVisibleRange:l,isDisabled:d,isUnavailable:p,formattedDate:m}=g({date:e,isOutsideMonth:t},r,a),{isCurrentDate:h,label:_}=J(e,r,c,s[`aria-label`]);return i.createElement(`div`,{...o,"aria-current":h?`date`:void 0,className:f(`datepicker-date`,{"datepicker-date-selected":c,"datepicker-date-today":h,"datepicker-date-outside":l||t,"datepicker-date-disabled":d,"datepicker-date-unavailable":p,"datepicker-date-weekend":A(e,n)})},i.createElement(`button`,{...s,"aria-label":_,type:`button`,className:`datepicker-date-btn`,ref:a,tabIndex:s.tabIndex??-1},m))},Z=o(({autoFocus:e,className:n,defaultFocusedValue:r,defaultValue:a,disabled:o,firstDayOfWeek:s=`mon`,isDateUnavailable:c,labels:m,maxValue:h,minValue:g,onChange:_,presets:v,unavailableDates:b,value:S,visibleMonths:w=1,...E},D)=>{let{locale:k}=y(),A=u(null),ee=t(A,D),P=l(()=>K(b,c),[b,c]),F=v&&v.length>0?v:null,[I,L]=d({}),z=Object.values(I).some(e=>e!==`days`),B=C({autoFocus:e,createCalendar:T,defaultFocusedValue:r,defaultValue:a,firstDayOfWeek:s,isDateUnavailable:P,isDisabled:o,locale:k,maxValue:h,minValue:g,onChange:_,pageBehavior:`single`,value:S,visibleDuration:{months:w}}),H={"aria-label":E[`aria-label`],"aria-labelledby":E[`aria-labelledby`],autoFocus:e,defaultFocusedValue:r,defaultValue:a,isDateUnavailable:P,isDisabled:o,maxValue:h,minValue:g,onChange:_,value:S},{calendarProps:U,prevButtonProps:W,nextButtonProps:q}=x(H,B,A),J=i.createElement(G,{buttonProps:W,direction:`prev`}),Y=i.createElement(G,{buttonProps:q,direction:`next`}),X=w===1?{next:Y,prev:J}:null,Z=e=>{let t=M(N(e.start),B.focusedDate.calendar),{end:n,start:r}=B.visibleRange;(t.compare(r)<0||t.compare(n)>0)&&V(B,j(t)),B.setAnchorDate(null),B.setValue(e)},Q=(e,t)=>!!(e&&O(e,t)&&B.isSelected(e));return i.createElement(R,{labels:m},i.createElement(`div`,{...p(U,E),className:f(`datepicker`,n),"data-cx-inline":`true`,ref:ee},i.createElement(`div`,{className:`datepicker-grid`},F&&i.createElement($,{disabled:B.isDisabled,onSelect:Z,presets:F,value:B.value}),i.createElement(`div`,{className:`datepicker-body`},w>1&&!z&&i.createElement(`div`,{className:`datepicker-controls`},J,Y),i.createElement(`div`,{className:`datepicker-grid`},[...Array(w).keys()].map(e=>{let t=B.visibleRange.start.add({months:e});return i.createElement(te,{arrows:e===0?X:null,firstDayOfWeek:s,key:e,monthIndex:e,onViewChange:t=>L(n=>({...n,[e]:t})),renderCell:(e,n,r,a)=>i.createElement(ne,{date:e,isBandEnd:!Q(r[n+1],t),isBandStart:!Q(r[n-1],t),isOutsideMonth:a,locale:k,state:B}),state:B})}))))))});Z.displayName=`RangeCalendar`;const ne=({date:t,isBandEnd:n,isBandStart:r,isOutsideMonth:a,locale:o,state:s})=>{let c=u(null),{cellProps:l,buttonProps:d,isSelected:m,isOutsideVisibleRange:h,isDisabled:_,isUnavailable:v,formattedDate:y}=g({date:t,isOutsideMonth:a},s,c),{highlightedRange:b}=s,x=!!(b&&D(t,b.start)),S=!!(b&&D(t,b.end)),{isCurrentDate:C,label:w}=J(t,s,m,d[`aria-label`]);return i.createElement(`div`,{...l,"aria-current":C?`date`:void 0,className:f(`datepicker-date`,{"datepicker-date-today":C,"datepicker-date-in-range":m,"datepicker-date-range-start":m&&(x||r),"datepicker-date-range-end":m&&(S||n),"datepicker-date-outside":h||a,"datepicker-date-disabled":_,"datepicker-date-unavailable":v,"datepicker-date-weekend":A(t,o)})},i.createElement(`button`,{...p(d,{"aria-label":w,onPointerEnter:()=>{s.anchorDate&&c.current&&e(c.current)},tabIndex:d.tabIndex??-1}),type:`button`,className:f(`datepicker-date-btn`,{"datepicker-date-range-start":m&&x,"datepicker-date-range-end":m&&S}),ref:c},y))},Q=(e,t)=>D(e.start,t.start)&&D(e.end,t.end),$=({disabled:e,onSelect:t,presets:n,value:r})=>i.createElement(`ul`,{className:`datepicker-presets`},n.map(n=>{let a=!!(r&&Q(r,n.range));return i.createElement(`li`,{key:n.label},i.createElement(`button`,{"aria-current":a?`true`:void 0,className:f(`datepicker-preset`,{selected:a}),disabled:e,onClick:()=>t(n.range),type:`button`},n.label))}));export{F as a,R as i,Y as n,L as o,K as r,Z as t};
2
- //# sourceMappingURL=RangeCalendar-BJl-j4W2.js.map