@chassis-ui/react 0.5.0 → 0.6.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 (356) hide show
  1. package/README.md +4 -3
  2. package/dist/accordion.js +1 -1
  3. package/dist/alert.js +1 -1
  4. package/dist/autocomplete.d.ts +1 -1
  5. package/dist/autocomplete.js +1 -1
  6. package/dist/avatar.js +1 -1
  7. package/dist/badge.js +1 -1
  8. package/dist/breadcrumb.js +1 -1
  9. package/dist/button-group.js +1 -1
  10. package/dist/button.js +1 -1
  11. package/dist/calendar.js +1 -1
  12. package/dist/card.js +1 -1
  13. package/dist/carousel.js +1 -1
  14. package/dist/checkbox.d.ts +1 -1
  15. package/dist/checkbox.js +1 -1
  16. package/dist/chip-input.js +1 -1
  17. package/dist/chip.js +1 -1
  18. package/dist/chunks/Button-Cjenm3ku.js +2 -0
  19. package/dist/chunks/Button-Cjenm3ku.js.map +1 -0
  20. package/dist/chunks/{Chip-C7QlFCvx.js → Chip-CXuYhjc3.js} +2 -2
  21. package/dist/chunks/{Chip-C7QlFCvx.js.map → Chip-CXuYhjc3.js.map} +1 -1
  22. package/dist/chunks/CloseButton-CAQ--0sB.js +2 -0
  23. package/dist/chunks/CloseButton-CAQ--0sB.js.map +1 -0
  24. package/dist/chunks/{DateField-4cdcwt0v.js → DateField-G1TP9ayt.js} +2 -2
  25. package/dist/chunks/{DateField-4cdcwt0v.js.map → DateField-G1TP9ayt.js.map} +1 -1
  26. package/dist/chunks/{FormHelp-B1eSoack.js → FormHelp-2U3P8C6b.js} +2 -2
  27. package/dist/chunks/{FormHelp-B1eSoack.js.map → FormHelp-2U3P8C6b.js.map} +1 -1
  28. package/dist/chunks/Link-B3SX50Od.js +2 -0
  29. package/dist/chunks/Link-B3SX50Od.js.map +1 -0
  30. package/dist/chunks/Menu-DBN4Mxak.js +2 -0
  31. package/dist/chunks/Menu-DBN4Mxak.js.map +1 -0
  32. package/dist/chunks/MenuToggle-DHzKm1Ed.js +2 -0
  33. package/dist/chunks/MenuToggle-DHzKm1Ed.js.map +1 -0
  34. package/dist/chunks/{RangeCalendar-mM3OeTlU.js → RangeCalendar-DRcg1Hp3.js} +2 -2
  35. package/dist/chunks/{RangeCalendar-mM3OeTlU.js.map → RangeCalendar-DRcg1Hp3.js.map} +1 -1
  36. package/dist/chunks/{VisuallyHidden-CGv-mBuQ.js → VisuallyHidden-24WfUCsJ.js} +2 -2
  37. package/dist/chunks/{VisuallyHidden-CGv-mBuQ.js.map → VisuallyHidden-24WfUCsJ.js.map} +1 -1
  38. package/dist/chunks/{accordion-BZlX2uk8.js → accordion-DiYPbV_r.js} +2 -2
  39. package/dist/chunks/{accordion-BZlX2uk8.js.map → accordion-DiYPbV_r.js.map} +1 -1
  40. package/dist/chunks/alert-oSKrhxkI.js +2 -0
  41. package/dist/chunks/{alert-DSLg5MBb.js.map → alert-oSKrhxkI.js.map} +1 -1
  42. package/dist/chunks/autocomplete-wjDWeWDh.js +2 -0
  43. package/dist/chunks/autocomplete-wjDWeWDh.js.map +1 -0
  44. package/dist/chunks/{avatar-BQBbcnk6.js → avatar-CvcvC9KA.js} +2 -2
  45. package/dist/chunks/{avatar-BQBbcnk6.js.map → avatar-CvcvC9KA.js.map} +1 -1
  46. package/dist/chunks/{badge-Ths1Qn1a.js → badge-D7XgWBXc.js} +2 -2
  47. package/dist/chunks/{badge-Ths1Qn1a.js.map → badge-D7XgWBXc.js.map} +1 -1
  48. package/dist/chunks/{breadcrumb-BTiQikk-.js → breadcrumb-DxCHVppV.js} +2 -2
  49. package/dist/chunks/{breadcrumb-BTiQikk-.js.map → breadcrumb-DxCHVppV.js.map} +1 -1
  50. package/dist/chunks/{button-group-CefkGeYL.js → button-group-CXMj0D4r.js} +2 -2
  51. package/dist/chunks/{button-group-CefkGeYL.js.map → button-group-CXMj0D4r.js.map} +1 -1
  52. package/dist/chunks/{card-CEQgHIaL.js → card-C6lPZs5J.js} +2 -2
  53. package/dist/chunks/{card-CEQgHIaL.js.map → card-C6lPZs5J.js.map} +1 -1
  54. package/dist/chunks/carousel-Ka9OA-HJ.js +2 -0
  55. package/dist/chunks/carousel-Ka9OA-HJ.js.map +1 -0
  56. package/dist/chunks/checkbox-5jv0YWoi.js +2 -0
  57. package/dist/chunks/checkbox-5jv0YWoi.js.map +1 -0
  58. package/dist/chunks/chip-input-D8EaNujM.js +2 -0
  59. package/dist/chunks/chip-input-D8EaNujM.js.map +1 -0
  60. package/dist/chunks/{collapse-CBi3RWTf.js → collapse-Bc7fnmyU.js} +2 -2
  61. package/dist/chunks/{collapse-CBi3RWTf.js.map → collapse-Bc7fnmyU.js.map} +1 -1
  62. package/dist/chunks/color-input-DBOd4Jba.js +2 -0
  63. package/dist/chunks/color-input-DBOd4Jba.js.map +1 -0
  64. package/dist/chunks/combobox-DByuUtwh.js +2 -0
  65. package/dist/chunks/{combobox-BQh3uJWB.js.map → combobox-DByuUtwh.js.map} +1 -1
  66. package/dist/chunks/context-HDVxTNPi.js.map +1 -1
  67. package/dist/chunks/context-menu-CGOGliw6.js +2 -0
  68. package/dist/chunks/context-menu-CGOGliw6.js.map +1 -0
  69. package/dist/chunks/datagrid-Dv_9uFef.js +2 -0
  70. package/dist/chunks/datagrid-Dv_9uFef.js.map +1 -0
  71. package/dist/chunks/datepicker-DuYmXiSe.js +2 -0
  72. package/dist/chunks/datepicker-DuYmXiSe.js.map +1 -0
  73. package/dist/chunks/dialogTitle-DMBvXZLT.js +2 -0
  74. package/dist/chunks/dialogTitle-DMBvXZLT.js.map +1 -0
  75. package/dist/chunks/{divider-C1-NoKMV.js → divider-DbWmMSrn.js} +2 -2
  76. package/dist/chunks/{divider-C1-NoKMV.js.map → divider-DbWmMSrn.js.map} +1 -1
  77. package/dist/chunks/drawer-DPxF30qn.js +2 -0
  78. package/dist/chunks/drawer-DPxF30qn.js.map +1 -0
  79. package/dist/chunks/file-input-B5YaBXjI.js +2 -0
  80. package/dist/chunks/file-input-B5YaBXjI.js.map +1 -0
  81. package/dist/chunks/{flex-C2jV5LyV.js → flex-C6CbAkVJ.js} +2 -2
  82. package/dist/chunks/{flex-C2jV5LyV.js.map → flex-C6CbAkVJ.js.map} +1 -1
  83. package/dist/chunks/floating-input-B9YAJ9d4.js +2 -0
  84. package/dist/chunks/floating-input-B9YAJ9d4.js.map +1 -0
  85. package/dist/chunks/{form-field-Bcx96ezd.js → form-field-D74QY_wP.js} +2 -2
  86. package/dist/chunks/{form-field-Bcx96ezd.js.map → form-field-D74QY_wP.js.map} +1 -1
  87. package/dist/chunks/grid-BCVkow3u.js +2 -0
  88. package/dist/chunks/grid-BCVkow3u.js.map +1 -0
  89. package/dist/chunks/{index-5qsV1-cc.d.ts → index--DV9l24Q.d.ts} +18 -14
  90. package/dist/chunks/{index-BAvt_oPe.d.ts → index-B2d_pjjy.d.ts} +6 -5
  91. package/dist/chunks/{index-CbcFEGCh.d.ts → index-BIWaMOr6.d.ts} +9 -2
  92. package/dist/chunks/{index-3JVLrDHv.d.ts → index-BMAdUGiM.d.ts} +7 -1
  93. package/dist/chunks/{index-Cpifcw5a.d.ts → index-BzYAMLX1.d.ts} +44 -4
  94. package/dist/chunks/{index-BbZzaApz.d.ts → index-C9RqZNjk.d.ts} +7 -1
  95. package/dist/chunks/{index-D0Dhs7YI.d.ts → index-CHtvpvUh.d.ts} +6 -1
  96. package/dist/chunks/{index-Bl-_sC4y.d.ts → index-CSmHNy8M.d.ts} +8 -2
  97. package/dist/chunks/{index-Davd7Cue.d.ts → index-CXzKYWtS.d.ts} +3 -2
  98. package/dist/chunks/{index-OnB4_h6x.d.ts → index-DV_JBDoF.d.ts} +2 -2
  99. package/dist/chunks/{index-Es9I0fIS.d.ts → index-DjmN2hBX.d.ts} +2 -2
  100. package/dist/chunks/{index-UjmJQRaG.d.ts → index-DyB9XXLJ.d.ts} +3 -3
  101. package/dist/chunks/{index-CSRGr7pU.d.ts → index-JCnEw-55.d.ts} +2 -6
  102. package/dist/chunks/{index-Ctf5hLue.d.ts → index-Me921MYl.d.ts} +15 -13
  103. package/dist/chunks/{index-C-IrFdKe.d.ts → index-OgWCTy2Y.d.ts} +2 -2
  104. package/dist/chunks/{index-BZpHSGlk.d.ts → index-bZRQGwY7.d.ts} +7 -2
  105. package/dist/chunks/{index-Cm3rPbI1.d.ts → index-qJGkO-ni.d.ts} +3 -3
  106. package/dist/chunks/{input-adorn-DV9tuWXh.js → input-adorn-D0E3Afdf.js} +2 -2
  107. package/dist/chunks/{input-adorn-DV9tuWXh.js.map → input-adorn-D0E3Afdf.js.map} +1 -1
  108. package/dist/chunks/{input-group-YB_zoKud.js → input-group-paIBtI1R.js} +2 -2
  109. package/dist/chunks/{input-group-YB_zoKud.js.map → input-group-paIBtI1R.js.map} +1 -1
  110. package/dist/chunks/{list-BPBZR66Y.js → list-Ch6vxaUs.js} +2 -2
  111. package/dist/chunks/{list-BPBZR66Y.js.map → list-Ch6vxaUs.js.map} +1 -1
  112. package/dist/chunks/menu-DTe27h5q.js +2 -0
  113. package/dist/chunks/{menu-DEu-Nbv8.js.map → menu-DTe27h5q.js.map} +1 -1
  114. package/dist/chunks/modal-BDQe7xyy.js +2 -0
  115. package/dist/chunks/modal-BDQe7xyy.js.map +1 -0
  116. package/dist/chunks/nativeFormReset-DgsRU9SA.js +2 -0
  117. package/dist/chunks/nativeFormReset-DgsRU9SA.js.map +1 -0
  118. package/dist/chunks/nav-DDI8Dv28.js +2 -0
  119. package/dist/chunks/nav-DDI8Dv28.js.map +1 -0
  120. package/dist/chunks/{nav-overflow-DpX_lRYf.js → nav-overflow-BxAhoMh3.js} +2 -2
  121. package/dist/chunks/{nav-overflow-DpX_lRYf.js.map → nav-overflow-BxAhoMh3.js.map} +1 -1
  122. package/dist/chunks/{navOverflow-C_QJmkPM.js → navOverflow-eSROB_mV.js} +2 -2
  123. package/dist/chunks/{navOverflow-C_QJmkPM.js.map → navOverflow-eSROB_mV.js.map} +1 -1
  124. package/dist/chunks/{navVariant-D4wiKS8I.js → navVariant-Bm5k8CY3.js} +2 -2
  125. package/dist/chunks/{navVariant-D4wiKS8I.js.map → navVariant-Bm5k8CY3.js.map} +1 -1
  126. package/dist/chunks/{navbar-C7dO0YRs.js → navbar-BYMKe2yW.js} +2 -2
  127. package/dist/chunks/{navbar-C7dO0YRs.js.map → navbar-BYMKe2yW.js.map} +1 -1
  128. package/dist/chunks/{notification-oIrUtDhl.js → notification-C1Sd4X7M.js} +2 -2
  129. package/dist/chunks/{notification-oIrUtDhl.js.map → notification-C1Sd4X7M.js.map} +1 -1
  130. package/dist/chunks/{number-field-ChPTSBwI.js → number-field-BIApgIlR.js} +2 -2
  131. package/dist/chunks/{number-field-ChPTSBwI.js.map → number-field-BIApgIlR.js.map} +1 -1
  132. package/dist/chunks/otp-input-CCkfFZID.js +2 -0
  133. package/dist/chunks/otp-input-CCkfFZID.js.map +1 -0
  134. package/dist/chunks/overlayPlacement-D2vfhhg3.js +2 -0
  135. package/dist/chunks/overlayPlacement-D2vfhhg3.js.map +1 -0
  136. package/dist/chunks/{pagination-Dvz8lccd.js → pagination-WINUPT_P.js} +2 -2
  137. package/dist/chunks/pagination-WINUPT_P.js.map +1 -0
  138. package/dist/chunks/placeholder-9rTlnMso.js +2 -0
  139. package/dist/chunks/{placeholder-SPoVRkKE.js.map → placeholder-9rTlnMso.js.map} +1 -1
  140. package/dist/chunks/polymorphic-mAKwlLiW.js +2 -0
  141. package/dist/chunks/{polymorphic-CZIFszAy.js.map → polymorphic-mAKwlLiW.js.map} +1 -1
  142. package/dist/chunks/popover-CrAJTevL.js +2 -0
  143. package/dist/chunks/popover-CrAJTevL.js.map +1 -0
  144. package/dist/chunks/{progress-CiSJDNwx.js → progress-CAqSu3jc.js} +2 -2
  145. package/dist/chunks/{progress-CiSJDNwx.js.map → progress-CAqSu3jc.js.map} +1 -1
  146. package/dist/chunks/{radio-C42F_5OD.js → radio-XlINMnQm.js} +2 -2
  147. package/dist/chunks/{radio-C42F_5OD.js.map → radio-XlINMnQm.js.map} +1 -1
  148. package/dist/chunks/range-input-tyImJHKI.js +2 -0
  149. package/dist/chunks/range-input-tyImJHKI.js.map +1 -0
  150. package/dist/chunks/{renderFormField-_6WswnEX.js → renderFormField-CaZ8-xrn.js} +2 -2
  151. package/dist/chunks/{renderFormField-_6WswnEX.js.map → renderFormField-CaZ8-xrn.js.map} +1 -1
  152. package/dist/chunks/{search-field-OFsb3t4L.js → search-field-CIYtMraB.js} +2 -2
  153. package/dist/chunks/{search-field-OFsb3t4L.js.map → search-field-CIYtMraB.js.map} +1 -1
  154. package/dist/chunks/select-CkucgA6H.js +2 -0
  155. package/dist/chunks/select-CkucgA6H.js.map +1 -0
  156. package/dist/chunks/{skeleton-B2blJGWj.js → skeleton-CXFwCjB9.js} +2 -2
  157. package/dist/chunks/{skeleton-B2blJGWj.js.map → skeleton-CXFwCjB9.js.map} +1 -1
  158. package/dist/chunks/slot-DagH0Gxq.js +2 -0
  159. package/dist/chunks/slot-DagH0Gxq.js.map +1 -0
  160. package/dist/chunks/{spinner-D8lQCW4u.js → spinner-BLQiCoQd.js} +2 -2
  161. package/dist/chunks/{spinner-D8lQCW4u.js.map → spinner-BLQiCoQd.js.map} +1 -1
  162. package/dist/chunks/{stack-DtzW54UK.js → stack-OItr30SC.js} +2 -2
  163. package/dist/chunks/{stack-DtzW54UK.js.map → stack-OItr30SC.js.map} +1 -1
  164. package/dist/chunks/{stepper-tSA84huJ.js → stepper-BLjW7UnC.js} +2 -2
  165. package/dist/chunks/{stepper-tSA84huJ.js.map → stepper-BLjW7UnC.js.map} +1 -1
  166. package/dist/chunks/switch-nt7aXQDX.js +2 -0
  167. package/dist/chunks/switch-nt7aXQDX.js.map +1 -0
  168. package/dist/chunks/table-KtPHx4FG.js +2 -0
  169. package/dist/chunks/table-KtPHx4FG.js.map +1 -0
  170. package/dist/chunks/{tabs-DMFSLjnV.js → tabs-Dh5kH5Ik.js} +2 -2
  171. package/dist/chunks/{tabs-DMFSLjnV.js.map → tabs-Dh5kH5Ik.js.map} +1 -1
  172. package/dist/chunks/{text-input-CR73x-8D.js → text-input-D3jBYiLn.js} +2 -2
  173. package/dist/chunks/{text-input-CR73x-8D.js.map → text-input-D3jBYiLn.js.map} +1 -1
  174. package/dist/chunks/{textarea-C-1cMyH4.js → textarea-2BJCzT97.js} +2 -2
  175. package/dist/chunks/{textarea-C-1cMyH4.js.map → textarea-2BJCzT97.js.map} +1 -1
  176. package/dist/chunks/{time-field-CbCfOQZz.js → time-field-ClPbatW3.js} +2 -2
  177. package/dist/chunks/{time-field-CbCfOQZz.js.map → time-field-ClPbatW3.js.map} +1 -1
  178. package/dist/chunks/toast-D5-58Ch1.js +2 -0
  179. package/dist/chunks/toast-D5-58Ch1.js.map +1 -0
  180. package/dist/chunks/tooltip-TGFFlOJL.js +2 -0
  181. package/dist/chunks/tooltip-TGFFlOJL.js.map +1 -0
  182. package/dist/chunks/tree-BO0WSxQa.js +2 -0
  183. package/dist/chunks/tree-BO0WSxQa.js.map +1 -0
  184. package/dist/chunks/useButtonSemantics-DN3OIXtG.js +2 -0
  185. package/dist/chunks/useButtonSemantics-DN3OIXtG.js.map +1 -0
  186. package/dist/chunks/{useDialogElement-BfygWBPZ.js → useDialogElement-yEgUSejP.js} +2 -2
  187. package/dist/chunks/useDialogElement-yEgUSejP.js.map +1 -0
  188. package/dist/chunks/{useFormField-DH2tlc3e.js → useFormField-q21MOgh8.js} +2 -2
  189. package/dist/chunks/{useFormField-DH2tlc3e.js.map → useFormField-q21MOgh8.js.map} +1 -1
  190. package/dist/chunks/useFormReset-BK5Yb24_.js +2 -0
  191. package/dist/chunks/useFormReset-BK5Yb24_.js.map +1 -0
  192. package/dist/chunks/useHeldBack-o-CsPcSe.js +2 -0
  193. package/dist/chunks/useHeldBack-o-CsPcSe.js.map +1 -0
  194. package/dist/chunks/{useOpenStateProps-BhjSQ3f6.js → useOpenStateProps-CdSO1nmI.js} +2 -2
  195. package/dist/chunks/{useOpenStateProps-BhjSQ3f6.js.map → useOpenStateProps-CdSO1nmI.js.map} +1 -1
  196. package/dist/chunks/useOverlayMaxHeight-5UnurH0W.js +2 -0
  197. package/dist/chunks/useOverlayMaxHeight-5UnurH0W.js.map +1 -0
  198. package/dist/chunks/{useRequiredValueInput-gYN8I-LY.js → useRequiredValueInput-CL7AIgqz.js} +2 -2
  199. package/dist/chunks/{useRequiredValueInput-gYN8I-LY.js.map → useRequiredValueInput-CL7AIgqz.js.map} +1 -1
  200. package/dist/chunks/useSelectionForMode-B_oTWvEy.js +2 -0
  201. package/dist/chunks/useSelectionForMode-B_oTWvEy.js.map +1 -0
  202. package/dist/chunks/useToastRegionQueue-QHa4v7k6.js +2 -0
  203. package/dist/chunks/useToastRegionQueue-QHa4v7k6.js.map +1 -0
  204. package/dist/chunks/useTransitionState-WEw9C0yn.js +2 -0
  205. package/dist/chunks/useTransitionState-WEw9C0yn.js.map +1 -0
  206. package/dist/chunks/{visibleState-CWyQak65.js → visibleState-DVyxSMUT.js} +2 -2
  207. package/dist/chunks/{visibleState-CWyQak65.js.map → visibleState-DVyxSMUT.js.map} +1 -1
  208. package/dist/close-button.js +1 -1
  209. package/dist/collapse.js +1 -1
  210. package/dist/color-input.d.ts +1 -1
  211. package/dist/color-input.js +1 -1
  212. package/dist/combobox.js +1 -1
  213. package/dist/context-menu.js +1 -1
  214. package/dist/datagrid.d.ts +1 -1
  215. package/dist/datagrid.js +1 -1
  216. package/dist/datepicker.js +1 -1
  217. package/dist/divider.js +1 -1
  218. package/dist/drawer.d.ts +1 -1
  219. package/dist/drawer.js +1 -1
  220. package/dist/file-input.d.ts +1 -1
  221. package/dist/file-input.js +1 -1
  222. package/dist/flex.js +1 -1
  223. package/dist/floating-input.d.ts +1 -1
  224. package/dist/floating-input.js +1 -1
  225. package/dist/form-field.js +1 -1
  226. package/dist/form.js +1 -1
  227. package/dist/grid.js +1 -1
  228. package/dist/index.d.ts +19 -19
  229. package/dist/index.js +1 -1
  230. package/dist/input-adorn.js +1 -1
  231. package/dist/input-group.js +1 -1
  232. package/dist/link.js +1 -1
  233. package/dist/list.js +1 -1
  234. package/dist/menu.js +1 -1
  235. package/dist/modal.d.ts +1 -1
  236. package/dist/modal.js +1 -1
  237. package/dist/nav-overflow.js +1 -1
  238. package/dist/nav.d.ts +1 -1
  239. package/dist/nav.js +1 -1
  240. package/dist/navbar.js +1 -1
  241. package/dist/notification.js +1 -1
  242. package/dist/number-field.js +1 -1
  243. package/dist/otp-input.d.ts +1 -1
  244. package/dist/otp-input.js +1 -1
  245. package/dist/pagination.d.ts +1 -1
  246. package/dist/pagination.js +1 -1
  247. package/dist/placeholder.js +1 -1
  248. package/dist/popover.js +1 -1
  249. package/dist/progress.js +1 -1
  250. package/dist/radio.d.ts +1 -1
  251. package/dist/radio.js +1 -1
  252. package/dist/range-input.d.ts +1 -1
  253. package/dist/range-input.js +1 -1
  254. package/dist/search-field.js +1 -1
  255. package/dist/select.d.ts +1 -1
  256. package/dist/select.js +1 -1
  257. package/dist/skeleton.js +1 -1
  258. package/dist/spinner.js +1 -1
  259. package/dist/stack.js +1 -1
  260. package/dist/stepper.js +1 -1
  261. package/dist/style.css +1 -1
  262. package/dist/switch.d.ts +1 -1
  263. package/dist/switch.js +1 -1
  264. package/dist/table.d.ts +1 -1
  265. package/dist/table.js +1 -1
  266. package/dist/tabs.js +1 -1
  267. package/dist/text-input.js +1 -1
  268. package/dist/textarea.js +1 -1
  269. package/dist/time-field.js +1 -1
  270. package/dist/toast.d.ts +1 -1
  271. package/dist/toast.js +1 -1
  272. package/dist/tooltip.js +1 -1
  273. package/dist/tree.js +1 -1
  274. package/dist/visually-hidden.js +1 -1
  275. package/package.json +11 -11
  276. package/dist/chunks/Button-ZU-x1uN_.js +0 -2
  277. package/dist/chunks/Button-ZU-x1uN_.js.map +0 -1
  278. package/dist/chunks/CloseButton-BPUI5iGX.js +0 -2
  279. package/dist/chunks/CloseButton-BPUI5iGX.js.map +0 -1
  280. package/dist/chunks/Link-DE8NSAXJ.js +0 -2
  281. package/dist/chunks/Link-DE8NSAXJ.js.map +0 -1
  282. package/dist/chunks/Menu-264aGoBR.js +0 -2
  283. package/dist/chunks/Menu-264aGoBR.js.map +0 -1
  284. package/dist/chunks/MenuToggle-DcPEh55c.js +0 -2
  285. package/dist/chunks/MenuToggle-DcPEh55c.js.map +0 -1
  286. package/dist/chunks/alert-DSLg5MBb.js +0 -2
  287. package/dist/chunks/autocomplete-99usnvgh.js +0 -2
  288. package/dist/chunks/autocomplete-99usnvgh.js.map +0 -1
  289. package/dist/chunks/carousel-DC-UGc6W.js +0 -2
  290. package/dist/chunks/carousel-DC-UGc6W.js.map +0 -1
  291. package/dist/chunks/checkbox-ko6CdtoT.js +0 -2
  292. package/dist/chunks/checkbox-ko6CdtoT.js.map +0 -1
  293. package/dist/chunks/chip-input-CugY8EOc.js +0 -2
  294. package/dist/chunks/chip-input-CugY8EOc.js.map +0 -1
  295. package/dist/chunks/color-input-C4zMWlvm.js +0 -2
  296. package/dist/chunks/color-input-C4zMWlvm.js.map +0 -1
  297. package/dist/chunks/combobox-BQh3uJWB.js +0 -2
  298. package/dist/chunks/context-menu-8KIuH4cJ.js +0 -2
  299. package/dist/chunks/context-menu-8KIuH4cJ.js.map +0 -1
  300. package/dist/chunks/datagrid-n9vFeXN1.js +0 -2
  301. package/dist/chunks/datagrid-n9vFeXN1.js.map +0 -1
  302. package/dist/chunks/datepicker-DqztYJD6.js +0 -2
  303. package/dist/chunks/datepicker-DqztYJD6.js.map +0 -1
  304. package/dist/chunks/drawer-CRv9jmbp.js +0 -2
  305. package/dist/chunks/drawer-CRv9jmbp.js.map +0 -1
  306. package/dist/chunks/file-input-D_Gl1h-T.js +0 -2
  307. package/dist/chunks/file-input-D_Gl1h-T.js.map +0 -1
  308. package/dist/chunks/floating-input-D4gWFfOU.js +0 -2
  309. package/dist/chunks/floating-input-D4gWFfOU.js.map +0 -1
  310. package/dist/chunks/grid-CkdPftit.js +0 -2
  311. package/dist/chunks/grid-CkdPftit.js.map +0 -1
  312. package/dist/chunks/menu-DEu-Nbv8.js +0 -2
  313. package/dist/chunks/modal-CHvsDTyl.js +0 -2
  314. package/dist/chunks/modal-CHvsDTyl.js.map +0 -1
  315. package/dist/chunks/nav-B4U_Hqs7.js +0 -2
  316. package/dist/chunks/nav-B4U_Hqs7.js.map +0 -1
  317. package/dist/chunks/otp-input-DUtCMg8P.js +0 -2
  318. package/dist/chunks/otp-input-DUtCMg8P.js.map +0 -1
  319. package/dist/chunks/overlayPlacement-Q6bcbXA5.js +0 -2
  320. package/dist/chunks/overlayPlacement-Q6bcbXA5.js.map +0 -1
  321. package/dist/chunks/pagination-Dvz8lccd.js.map +0 -1
  322. package/dist/chunks/placeholder-SPoVRkKE.js +0 -2
  323. package/dist/chunks/polymorphic-CZIFszAy.js +0 -2
  324. package/dist/chunks/popover-C_32yD9W.js +0 -2
  325. package/dist/chunks/popover-C_32yD9W.js.map +0 -1
  326. package/dist/chunks/range-input-DeZq_9S7.js +0 -2
  327. package/dist/chunks/range-input-DeZq_9S7.js.map +0 -1
  328. package/dist/chunks/select-DwyL6aqY.js +0 -2
  329. package/dist/chunks/select-DwyL6aqY.js.map +0 -1
  330. package/dist/chunks/slot-BQVx1Eew.js +0 -2
  331. package/dist/chunks/slot-BQVx1Eew.js.map +0 -1
  332. package/dist/chunks/switch-cp3IZg3L.js +0 -2
  333. package/dist/chunks/switch-cp3IZg3L.js.map +0 -1
  334. package/dist/chunks/table-CBTg5Yuq.js +0 -2
  335. package/dist/chunks/table-CBTg5Yuq.js.map +0 -1
  336. package/dist/chunks/toast-Dd0J2e1z.js +0 -2
  337. package/dist/chunks/toast-Dd0J2e1z.js.map +0 -1
  338. package/dist/chunks/tooltip-CmKeQwYw.js +0 -2
  339. package/dist/chunks/tooltip-CmKeQwYw.js.map +0 -1
  340. package/dist/chunks/tree-DNj_EfUl.js +0 -2
  341. package/dist/chunks/tree-DNj_EfUl.js.map +0 -1
  342. package/dist/chunks/useButtonSemantics-B1SbGaDO.js +0 -2
  343. package/dist/chunks/useButtonSemantics-B1SbGaDO.js.map +0 -1
  344. package/dist/chunks/useDialogElement-BfygWBPZ.js.map +0 -1
  345. package/dist/chunks/useDialogTitle-DiB4YDGI.js +0 -2
  346. package/dist/chunks/useDialogTitle-DiB4YDGI.js.map +0 -1
  347. package/dist/chunks/useFloatingOverlay-BuiI_CCn.js +0 -2
  348. package/dist/chunks/useFloatingOverlay-BuiI_CCn.js.map +0 -1
  349. package/dist/chunks/useHeldBack-eeTfpa_t.js +0 -2
  350. package/dist/chunks/useHeldBack-eeTfpa_t.js.map +0 -1
  351. package/dist/chunks/useOverlayMaxHeight-8mQL2Q6d.js +0 -2
  352. package/dist/chunks/useOverlayMaxHeight-8mQL2Q6d.js.map +0 -1
  353. package/dist/chunks/useToastRegionQueue-CuAMxAIA.js +0 -2
  354. package/dist/chunks/useToastRegionQueue-CuAMxAIA.js.map +0 -1
  355. package/dist/chunks/useTransitionState-sQUQey74.js +0 -2
  356. package/dist/chunks/useTransitionState-sQUQey74.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import"./focus-ring-Bs80iIBN.js";import{f as e,g as t,m as n,v as r}from"./slot-BQVx1Eew.js";import{t as i}from"./polymorphic-CZIFszAy.js";import{t as a}from"./iconSlot-DU_WcSL_.js";import{t as o}from"./VisuallyHidden-CGv-mBuQ.js";import{i as s,n as c}from"./navOverflow-C_QJmkPM.js";import l,{forwardRef as u,useContext as d}from"react";import f from"classnames";function p({children:e,className:t,color:n,component:r,container:i,expand:a,placement:o,translucent:s,variant:c,...u},d){let p=r??`nav`,m=f(`navbar`,n,{context:!!n,solid:c===`solid`,smooth:c===`smooth`,outline:c===`outline`,translucent:s,[typeof a==`boolean`?`navbar-expand`:`${a}:navbar-expand`]:a},o,t),h;return h=i?/* @__PURE__ */ l.createElement(`div`,{className:f(`container`,i===`fluid`?`fluid`:i!==!0&&i)},e):e,/* @__PURE__ */ l.createElement(p,{className:m,...u,ref:d},h)}const m=i(p,`Navbar`);function h({children:t,component:i,className:a,href:o,...s},c){let u=n(i,o,`span`),d=f(`navbar-brand`,a);return/* @__PURE__ */ l.createElement(u,{className:d,...e(r(u,o,s),o,`NavbarBrand`),...s,ref:c},t)}const g=i(h,`NavbarBrand`);function _({children:e,component:n,className:r,...i},a){let o=n??`ul`,u=d(c)!==null,p=f({nav:u},`navbar-nav`,r);return/* @__PURE__ */ l.createElement(o,{className:p,...i,ref:a},/* @__PURE__ */ l.createElement(s,{tag:t(o)},e))}const v=i(_,`NavbarNav`);function y({children:e,className:t,component:n,...r},i){let a=n??`span`,o=f(`navbar-text`,t);return/* @__PURE__ */ l.createElement(a,{className:o,...r,ref:i},e)}const b=i(y,`NavbarText`),x=u(({children:e,className:t,icon:n,label:r=`Toggle navigation`,...i},s)=>{let c=f(`button icon-only navbar-toggler`,t);return/* @__PURE__ */ l.createElement(`button`,{type:`button`,className:c,...i,ref:s},e??/* @__PURE__ */ l.createElement(l.Fragment,null,/* @__PURE__ */ l.createElement(a,{icon:`menu`,override:n,className:`navbar-toggler-icon`}),/* @__PURE__ */ l.createElement(o,null,r)))});x.displayName=`NavbarToggler`;export{m as a,g as i,b as n,v as r,x as t};
2
- //# sourceMappingURL=navbar-C7dO0YRs.js.map
1
+ import"./focus-ring-Bs80iIBN.js";import{f as e,g as t,m as n,v as r}from"./slot-DagH0Gxq.js";import{t as i}from"./polymorphic-mAKwlLiW.js";import{t as a}from"./iconSlot-DU_WcSL_.js";import{t as o}from"./VisuallyHidden-24WfUCsJ.js";import{i as s,n as c}from"./navOverflow-eSROB_mV.js";import l,{forwardRef as u,useContext as d}from"react";import f from"classnames";function p({children:e,className:t,color:n,component:r,container:i,expand:a,placement:o,translucent:s,variant:c,...u},d){let p=r??`nav`,m=f(`navbar`,n,{context:!!n,solid:c===`solid`,smooth:c===`smooth`,outline:c===`outline`,translucent:s,[typeof a==`boolean`?`navbar-expand`:`${a}:navbar-expand`]:a},o,t),h;return h=i?/* @__PURE__ */ l.createElement(`div`,{className:f(`container`,i===`fluid`?`fluid`:i!==!0&&i)},e):e,/* @__PURE__ */ l.createElement(p,{className:m,...u,ref:d},h)}const m=i(p,`Navbar`);function h({children:t,component:i,className:a,href:o,...s},c){let u=n(i,o,`span`),d=f(`navbar-brand`,a);return/* @__PURE__ */ l.createElement(u,{className:d,...e(r(u,o,s),o,`NavbarBrand`),...s,ref:c},t)}const g=i(h,`NavbarBrand`);function _({children:e,component:n,className:r,...i},a){let o=n??`ul`,u=d(c)!==null,p=f({nav:u},`navbar-nav`,r);return/* @__PURE__ */ l.createElement(o,{className:p,...i,ref:a},/* @__PURE__ */ l.createElement(s,{tag:t(o)},e))}const v=i(_,`NavbarNav`);function y({children:e,className:t,component:n,...r},i){let a=n??`span`,o=f(`navbar-text`,t);return/* @__PURE__ */ l.createElement(a,{className:o,...r,ref:i},e)}const b=i(y,`NavbarText`),x=u(({children:e,className:t,icon:n,label:r=`Toggle navigation`,...i},s)=>{let c=f(`button icon-only navbar-toggler`,t);return/* @__PURE__ */ l.createElement(`button`,{type:`button`,className:c,...i,ref:s},e??/* @__PURE__ */ l.createElement(l.Fragment,null,/* @__PURE__ */ l.createElement(a,{icon:`menu`,override:n,className:`navbar-toggler-icon`}),/* @__PURE__ */ l.createElement(o,null,r)))});x.displayName=`NavbarToggler`;export{m as a,g as i,b as n,v as r,x as t};
2
+ //# sourceMappingURL=navbar-BYMKe2yW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navbar-C7dO0YRs.js","names":["hrefProps","resolveElementTag","linkElement","resolveLinkKind","createPolymorphicComponent","IconSlot","VisuallyHidden","NavOverflowItems","NavOverflowContext","React","classNames","NavbarRender","rest","Component","component","_className","color","variant","expand","placement","className","content","container","children","Navbar","NavbarBrandRender","href","NavbarBrand","NavbarNavRender","overflows","useContext","NavbarNav","NavbarTextRender","NavbarText","NavbarToggler","forwardRef","icon","label"],"sources":["../../src/components/navbar/Navbar.tsx","../../src/components/navbar/NavbarBrand.tsx","../../src/components/navbar/NavbarNav.tsx","../../src/components/navbar/NavbarText.tsx","../../src/components/navbar/NavbarToggler.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { Breakpoint, ContextColor, ContextStyle } from '../../types'\n\ntype NavbarOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Wraps the children in a `.container`, as `Container` renders one: `true` for the default,\n * `'fluid'` for one as wide as the navbar, or a breakpoint for one that is fluid until it.\n */\n container?: boolean | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'fluid'\n /**\n * Opts this navbar into the framework's dark or light theming, independent of the page's own\n * theme.\n */\n 'data-cx-theme'?: 'dark' | 'light'\n /**\n * Renders inline at and above this breakpoint, as a drawer below it. `true` renders inline at\n * every width; omit to keep the drawer at every width.\n */\n expand?: boolean | Breakpoint\n /**\n * Place component in non-static positions.\n */\n placement?: 'fixed-top' | 'fixed-bottom' | 'sticky-top' | 'sticky-bottom'\n /**\n * Blurs and saturates whatever sits behind the navbar — useful when it's positioned over a\n * hero image, video, or scrollable content.\n */\n translucent?: boolean\n /**\n * Sets the context style of the component. `basic` (the default) renders with no extra class.\n */\n variant?: ContextStyle\n}\n\nexport type NavbarProps<C extends ElementType = 'nav'> = PolymorphicComponentProps<\n C,\n NavbarOwnProps<C>\n>\n\ntype NavbarComponent = (<C extends ElementType = 'nav'>(\n props: NavbarProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarRender<C extends ElementType = 'nav'>(\n {\n children,\n className,\n color,\n component,\n container,\n expand,\n placement,\n translucent,\n variant,\n ...rest\n }: NavbarProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'nav'\n const _className = classNames(\n 'navbar',\n color,\n {\n context: !!color,\n solid: variant === 'solid',\n smooth: variant === 'smooth',\n outline: variant === 'outline',\n translucent,\n [typeof expand === 'boolean' ? 'navbar-expand' : `${expand}:navbar-expand`]: expand\n },\n placement,\n className\n )\n\n let content\n if (container) {\n content = (\n <div\n className={classNames(\n 'container',\n container === 'fluid' ? 'fluid' : container !== true && container\n )}\n >\n {children}\n </div>\n )\n } else {\n content = children\n }\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {content}\n </Component>\n )\n}\n\nexport const Navbar = createPolymorphicComponent<NavbarComponent>(\n NavbarRender as ForwardRefRenderFunction<Element, NavbarProps<ElementType>>,\n 'Navbar'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype NavbarBrandOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `span`, or `a` when `href` is set.\n */\n component?: C\n /**\n * The href attribute specifies the URL of the page the link goes to. Defaults `component` to\n * `a`.\n */\n href?: string\n}\n\nexport type NavbarBrandProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n NavbarBrandOwnProps<C>\n>\n\ntype NavbarBrandComponent = (<C extends ElementType = 'span'>(\n props: NavbarBrandProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLSpanElement | HTMLAnchorElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarBrandRender<C extends ElementType = 'span'>(\n { children, component, className, href, ...rest }: NavbarBrandProps<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 const _className = classNames('navbar-brand', className)\n\n return (\n <Component\n className={_className}\n {...hrefProps(resolveLinkKind(Component, href, rest), href, 'NavbarBrand')}\n {...rest}\n ref={ref}\n >\n {children}\n </Component>\n )\n}\n\nexport const NavbarBrand = createPolymorphicComponent<NavbarBrandComponent>(\n NavbarBrandRender as ForwardRefRenderFunction<Element, NavbarBrandProps<ElementType>>,\n 'NavbarBrand'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement, useContext } from 'react'\nimport classNames from 'classnames'\n\nimport { resolveElementTag } from '../../utils/elementKind'\nimport { NavOverflowContext, NavOverflowItems } from '../../utils/navOverflow'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype NavbarNavOwnProps<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 NavbarNavProps<C extends ElementType = 'ul'> = PolymorphicComponentProps<\n C,\n NavbarNavOwnProps<C>\n>\n\ntype NavbarNavComponent = (<C extends ElementType = 'ul'>(\n props: NavbarNavProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarNavRender<C extends ElementType = 'ul'>(\n { children, component, className, ...rest }: NavbarNavProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'ul'\n // Inside a `NavOverflow` the list is also a `.nav`, which is what chassis-css keeps on one line\n // there (`.nav-overflow > .nav`).\n const overflows = useContext(NavOverflowContext) !== null\n const _className = classNames({ nav: overflows }, 'navbar-nav', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n <NavOverflowItems tag={resolveElementTag(Component)}>{children}</NavOverflowItems>\n </Component>\n )\n}\n\nexport const NavbarNav = createPolymorphicComponent<NavbarNavComponent>(\n NavbarNavRender as ForwardRefRenderFunction<Element, NavbarNavProps<ElementType>>,\n 'NavbarNav'\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 NavbarTextOwnProps<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\nexport type NavbarTextProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n NavbarTextOwnProps<C>\n>\n\ntype NavbarTextComponent = (<C extends ElementType = 'span'>(\n props: NavbarTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarTextRender<C extends ElementType = 'span'>(\n { children, className, component, ...rest }: NavbarTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('navbar-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NavbarText = createPolymorphicComponent<NavbarTextComponent>(\n NavbarTextRender as ForwardRefRenderFunction<Element, NavbarTextProps<ElementType>>,\n 'NavbarText'\n)\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../icon/iconSlot'\nimport { VisuallyHidden } from '../visually-hidden/VisuallyHidden'\n\nexport interface NavbarTogglerProps extends HTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * The toggler icon: an icon name, or an element of your own icon set. Defaults to\n * `IconProvider`'s `menu` icon.\n */\n icon?: IconValue\n /**\n * The accessible label announced by assistive technology when no children are provided.\n */\n label?: string\n}\n\nexport const NavbarToggler = forwardRef<HTMLButtonElement, NavbarTogglerProps>(\n ({ children, className, icon, label = 'Toggle navigation', ...rest }, ref) => {\n const _className = classNames('button icon-only navbar-toggler', className)\n\n return (\n <button type=\"button\" className={_className} {...rest} ref={ref}>\n {children ?? (\n <>\n <IconSlot icon=\"menu\" override={icon} className=\"navbar-toggler-icon\" />\n <VisuallyHidden>{label}</VisuallyHidden>\n </>\n )}\n </button>\n )\n }\n)\n\nNavbarToggler.displayName = 'NavbarToggler'\n"],"mappings":"A,4WA8DA,SAASW,EACP,CACE,WACA,YACA,QACA,YACA,YACA,SACA,YACA,cACA,UACA,GAAGC,GAEL,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EAAaL,EACjB,SACAM,EACA,CACE,QAAS,CAAC,CAACA,EACX,MAAOC,IAAY,QACnB,OAAQA,IAAY,SACpB,QAASA,IAAY,UACrB,eACC,OAAOC,GAAW,UAAY,gBAAkB,GAAGA,EAAO,iBAAkBA,CAC/E,EACAC,EACAC,CACF,EAEIC,EAgBJ,MAfA,CAYEA,EAZEC,EAEA,kBAAA,cAAC,MAAD,CACE,UAAWZ,EACT,YACAY,IAAc,QAAU,QAAUA,IAAc,IAAQA,CAC1D,CAGG,EADFC,CACE,EAGGA,EAIV,kBAAA,cAACV,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRS,CACQ,CAEf,CAEA,MAAaG,EAASpB,EACpBO,EACA,QACF,EC/EA,SAASc,EACP,CAAE,WAAU,YAAW,YAAW,OAAM,GAAGb,GAC3C,EACA,CAGA,IAAMC,EAAYX,EAAYY,EAAWY,EAAM,MAAM,EAC/CX,EAAaL,EAAW,eAAgBU,CAAS,EAEvD,MACE,kBAAA,cAACP,EAAD,CACE,UAAWE,EACX,GAAIf,EAAUG,EAAgBU,EAAWa,EAAMd,CAAI,EAAGc,EAAM,aAAa,EACzE,GAAId,EACC,KAGI,EADRW,CACQ,CAEf,CAEA,MAAaI,EAAcvB,EACzBqB,EACA,aACF,ECjCA,SAASG,EACP,CAAE,WAAU,YAAW,YAAW,GAAGhB,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,KAGzBe,EAAYC,EAAWtB,CAAkB,IAAM,KAC/CO,EAAaL,EAAW,CAAE,IAAKmB,CAAU,EAAG,aAAcT,CAAS,EAEzE,MACE,kBAAA,cAACP,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADT,kBAAA,cAACL,EAAD,CAAkB,IAAKN,EAAkBY,CAAS,CAA+B,EAA3BU,CAA2B,CACxE,CAEf,CAEA,MAAaQ,EAAY3B,EACvBwB,EACA,WACF,ECtBA,SAASI,EACP,CAAE,WAAU,YAAW,YAAW,GAAGpB,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,OACzBC,EAAaL,EAAW,cAAeU,CAAS,EAEtD,MACE,kBAAA,cAACP,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRW,CACQ,CAEf,CAEA,MAAaU,EAAa7B,EACxB4B,EACA,YACF,ECvBaE,EAAgBC,GAC1B,CAAE,WAAU,YAAW,OAAM,QAAQ,oBAAqB,GAAGvB,GAAQ,IAAQ,CAC5E,IAAMG,EAAaL,EAAW,kCAAmCU,CAAS,EAE1E,MACE,kBAAA,cAAC,SAAD,CAAQ,KAAK,SAAS,UAAWL,EAAY,GAAIH,EAAW,KAOpD,EANLW,GACC,kBAAA,cAAAd,EAAA,SAAA,KACE,kBAAA,cAACJ,EAAD,CAAU,KAAK,OAAO,SAAU+B,EAAM,UAAU,qBAAuB,CAAA,EACvE,kBAAA,cAAC9B,EAAA,KAAgB+B,CAAsB,CACvC,CAEE,CAEZ,CACF,EAEA,EAAc,YAAc,gB"}
1
+ {"version":3,"file":"navbar-BYMKe2yW.js","names":["hrefProps","resolveElementTag","linkElement","resolveLinkKind","createPolymorphicComponent","IconSlot","VisuallyHidden","NavOverflowItems","NavOverflowContext","React","classNames","NavbarRender","rest","Component","component","_className","color","variant","expand","placement","className","content","container","children","Navbar","NavbarBrandRender","href","NavbarBrand","NavbarNavRender","overflows","useContext","NavbarNav","NavbarTextRender","NavbarText","NavbarToggler","forwardRef","icon","label"],"sources":["../../src/components/navbar/Navbar.tsx","../../src/components/navbar/NavbarBrand.tsx","../../src/components/navbar/NavbarNav.tsx","../../src/components/navbar/NavbarText.tsx","../../src/components/navbar/NavbarToggler.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { Breakpoint, ContextColor, ContextStyle } from '../../types'\n\ntype NavbarOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Wraps the children in a `.container`, as `Container` renders one: `true` for the default,\n * `'fluid'` for one as wide as the navbar, or a breakpoint for one that is fluid until it.\n */\n container?: boolean | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'fluid'\n /**\n * Opts this navbar into the framework's dark or light theming, independent of the page's own\n * theme.\n */\n 'data-cx-theme'?: 'dark' | 'light'\n /**\n * Renders inline at and above this breakpoint, as a drawer below it. `true` renders inline at\n * every width; omit to keep the drawer at every width.\n */\n expand?: boolean | Breakpoint\n /**\n * Place component in non-static positions.\n */\n placement?: 'fixed-top' | 'fixed-bottom' | 'sticky-top' | 'sticky-bottom'\n /**\n * Blurs and saturates whatever sits behind the navbar — useful when it's positioned over a\n * hero image, video, or scrollable content.\n */\n translucent?: boolean\n /**\n * Sets the context style of the component. `basic` (the default) renders with no extra class.\n */\n variant?: ContextStyle\n}\n\nexport type NavbarProps<C extends ElementType = 'nav'> = PolymorphicComponentProps<\n C,\n NavbarOwnProps<C>\n>\n\ntype NavbarComponent = (<C extends ElementType = 'nav'>(\n props: NavbarProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarRender<C extends ElementType = 'nav'>(\n {\n children,\n className,\n color,\n component,\n container,\n expand,\n placement,\n translucent,\n variant,\n ...rest\n }: NavbarProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'nav'\n const _className = classNames(\n 'navbar',\n color,\n {\n context: !!color,\n solid: variant === 'solid',\n smooth: variant === 'smooth',\n outline: variant === 'outline',\n translucent,\n [typeof expand === 'boolean' ? 'navbar-expand' : `${expand}:navbar-expand`]: expand\n },\n placement,\n className\n )\n\n let content\n if (container) {\n content = (\n <div\n className={classNames(\n 'container',\n container === 'fluid' ? 'fluid' : container !== true && container\n )}\n >\n {children}\n </div>\n )\n } else {\n content = children\n }\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {content}\n </Component>\n )\n}\n\nexport const Navbar = createPolymorphicComponent<NavbarComponent>(\n NavbarRender as ForwardRefRenderFunction<Element, NavbarProps<ElementType>>,\n 'Navbar'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype NavbarBrandOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `span`, or `a` when `href` is set.\n */\n component?: C\n /**\n * The href attribute specifies the URL of the page the link goes to. Defaults `component` to\n * `a`.\n */\n href?: string\n}\n\nexport type NavbarBrandProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n NavbarBrandOwnProps<C>\n>\n\ntype NavbarBrandComponent = (<C extends ElementType = 'span'>(\n props: NavbarBrandProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLSpanElement | HTMLAnchorElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarBrandRender<C extends ElementType = 'span'>(\n { children, component, className, href, ...rest }: NavbarBrandProps<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 const _className = classNames('navbar-brand', className)\n\n return (\n <Component\n className={_className}\n {...hrefProps(resolveLinkKind(Component, href, rest), href, 'NavbarBrand')}\n {...rest}\n ref={ref}\n >\n {children}\n </Component>\n )\n}\n\nexport const NavbarBrand = createPolymorphicComponent<NavbarBrandComponent>(\n NavbarBrandRender as ForwardRefRenderFunction<Element, NavbarBrandProps<ElementType>>,\n 'NavbarBrand'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement, useContext } from 'react'\nimport classNames from 'classnames'\n\nimport { resolveElementTag } from '../../utils/elementKind'\nimport { NavOverflowContext, NavOverflowItems } from '../../utils/navOverflow'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype NavbarNavOwnProps<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 NavbarNavProps<C extends ElementType = 'ul'> = PolymorphicComponentProps<\n C,\n NavbarNavOwnProps<C>\n>\n\ntype NavbarNavComponent = (<C extends ElementType = 'ul'>(\n props: NavbarNavProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarNavRender<C extends ElementType = 'ul'>(\n { children, component, className, ...rest }: NavbarNavProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'ul'\n // Inside a `NavOverflow` the list is also a `.nav`, which is what chassis-css keeps on one line\n // there (`.nav-overflow > .nav`).\n const overflows = useContext(NavOverflowContext) !== null\n const _className = classNames({ nav: overflows }, 'navbar-nav', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n <NavOverflowItems tag={resolveElementTag(Component)}>{children}</NavOverflowItems>\n </Component>\n )\n}\n\nexport const NavbarNav = createPolymorphicComponent<NavbarNavComponent>(\n NavbarNavRender as ForwardRefRenderFunction<Element, NavbarNavProps<ElementType>>,\n 'NavbarNav'\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 NavbarTextOwnProps<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\nexport type NavbarTextProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n NavbarTextOwnProps<C>\n>\n\ntype NavbarTextComponent = (<C extends ElementType = 'span'>(\n props: NavbarTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarTextRender<C extends ElementType = 'span'>(\n { children, className, component, ...rest }: NavbarTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('navbar-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NavbarText = createPolymorphicComponent<NavbarTextComponent>(\n NavbarTextRender as ForwardRefRenderFunction<Element, NavbarTextProps<ElementType>>,\n 'NavbarText'\n)\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../icon/iconSlot'\nimport { VisuallyHidden } from '../visually-hidden/VisuallyHidden'\n\nexport interface NavbarTogglerProps extends HTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * The toggler icon: an icon name, or an element of your own icon set. Defaults to\n * `IconProvider`'s `menu` icon.\n */\n icon?: IconValue\n /**\n * The accessible label announced by assistive technology when no children are provided.\n */\n label?: string\n}\n\nexport const NavbarToggler = forwardRef<HTMLButtonElement, NavbarTogglerProps>(\n ({ children, className, icon, label = 'Toggle navigation', ...rest }, ref) => {\n const _className = classNames('button icon-only navbar-toggler', className)\n\n return (\n <button type=\"button\" className={_className} {...rest} ref={ref}>\n {children ?? (\n <>\n <IconSlot icon=\"menu\" override={icon} className=\"navbar-toggler-icon\" />\n <VisuallyHidden>{label}</VisuallyHidden>\n </>\n )}\n </button>\n )\n }\n)\n\nNavbarToggler.displayName = 'NavbarToggler'\n"],"mappings":"A,4WA8DA,SAASW,EACP,CACE,WACA,YACA,QACA,YACA,YACA,SACA,YACA,cACA,UACA,GAAGC,GAEL,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EAAaL,EACjB,SACAM,EACA,CACE,QAAS,CAAC,CAACA,EACX,MAAOC,IAAY,QACnB,OAAQA,IAAY,SACpB,QAASA,IAAY,UACrB,eACC,OAAOC,GAAW,UAAY,gBAAkB,GAAGA,EAAO,iBAAkBA,CAC/E,EACAC,EACAC,CACF,EAEIC,EAgBJ,MAfA,CAYEA,EAZEC,EAEA,kBAAA,cAAC,MAAD,CACE,UAAWZ,EACT,YACAY,IAAc,QAAU,QAAUA,IAAc,IAAQA,CAC1D,CAGG,EADFC,CACE,EAGGA,EAIV,kBAAA,cAACV,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRS,CACQ,CAEf,CAEA,MAAaG,EAASpB,EACpBO,EACA,QACF,EC/EA,SAASc,EACP,CAAE,WAAU,YAAW,YAAW,OAAM,GAAGb,GAC3C,EACA,CAGA,IAAMC,EAAYX,EAAYY,EAAWY,EAAM,MAAM,EAC/CX,EAAaL,EAAW,eAAgBU,CAAS,EAEvD,MACE,kBAAA,cAACP,EAAD,CACE,UAAWE,EACX,GAAIf,EAAUG,EAAgBU,EAAWa,EAAMd,CAAI,EAAGc,EAAM,aAAa,EACzE,GAAId,EACC,KAGI,EADRW,CACQ,CAEf,CAEA,MAAaI,EAAcvB,EACzBqB,EACA,aACF,ECjCA,SAASG,EACP,CAAE,WAAU,YAAW,YAAW,GAAGhB,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,KAGzBe,EAAYC,EAAWtB,CAAkB,IAAM,KAC/CO,EAAaL,EAAW,CAAE,IAAKmB,CAAU,EAAG,aAAcT,CAAS,EAEzE,MACE,kBAAA,cAACP,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADT,kBAAA,cAACL,EAAD,CAAkB,IAAKN,EAAkBY,CAAS,CAA+B,EAA3BU,CAA2B,CACxE,CAEf,CAEA,MAAaQ,EAAY3B,EACvBwB,EACA,WACF,ECtBA,SAASI,EACP,CAAE,WAAU,YAAW,YAAW,GAAGpB,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,OACzBC,EAAaL,EAAW,cAAeU,CAAS,EAEtD,MACE,kBAAA,cAACP,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRW,CACQ,CAEf,CAEA,MAAaU,EAAa7B,EACxB4B,EACA,YACF,ECvBaE,EAAgBC,GAC1B,CAAE,WAAU,YAAW,OAAM,QAAQ,oBAAqB,GAAGvB,GAAQ,IAAQ,CAC5E,IAAMG,EAAaL,EAAW,kCAAmCU,CAAS,EAE1E,MACE,kBAAA,cAAC,SAAD,CAAQ,KAAK,SAAS,UAAWL,EAAY,GAAIH,EAAW,KAOpD,EANLW,GACC,kBAAA,cAAAd,EAAA,SAAA,KACE,kBAAA,cAACJ,EAAD,CAAU,KAAK,OAAO,SAAU+B,EAAM,UAAU,qBAAuB,CAAA,EACvE,kBAAA,cAAC9B,EAAA,KAAgB+B,CAAsB,CACvC,CAEE,CAEZ,CACF,EAEA,EAAc,YAAc,gB"}
@@ -1,2 +1,2 @@
1
- import"./focus-ring-Bs80iIBN.js";import{t as e}from"./polymorphic-CZIFszAy.js";import{n as t,r as n,t as r}from"./useToastRegionQueue-CuAMxAIA.js";import{t as i}from"./Icon-Dk5_q79o.js";import{n as a}from"./iconSlot-DU_WcSL_.js";import{t as o}from"./CloseButton-BPUI5iGX.js";import{t as s}from"./stack-DtzW54UK.js";import c,{createContext as l,forwardRef as u,useContext as d}from"react";import f from"classnames";import{mergeProps as p}from"react-aria";import{ToastQueue as m}from"react-stately";const h=l({close:()=>{}});function g({children:e,component:t,className:n,...r},i){let a=t??`div`,o=f(`notification-text`,n);return/* @__PURE__ */ c.createElement(a,{className:o,...r,ref:i},e)}const _=e(g,`NotificationText`);function v({children:e,className:t,component:n,...r},i){let a=n??`h4`,o=f(`notification-title`,t);return/* @__PURE__ */ c.createElement(a,{className:o,...r,ref:i},e)}const y=e(v,`NotificationTitle`),b=u(({actions:e,autohide:r=!1,children:i,className:s,closeLabel:l=`Close`,color:u=`primary`,defaultVisible:d=!0,delay:m=5e3,dismissible:g,icon:v,solid:b,text:x,title:S,titleComponent:C=`h4`,role:w=`status`,visible:T,onClose:E,onShow:D,onVisibleChange:O,...k},A)=>{let{close:j,entered:M,forkedRef:N,isMounted:P,textId:F,titleId:I,transitionClass:L,visible:R}=t({defaultVisible:d,displayName:`Notification`,onClose:E,onShow:D,onVisibleChange:O,ref:A,visible:T}),z=n({enabled:r,delay:m,visible:R&&M,onHide:j}),B=f(`notification`,`fade`,u,{solid:b},s);return P?/* @__PURE__ */ c.createElement(h.Provider,{value:{visible:R,close:j}},/* @__PURE__ */ c.createElement(`div`,{className:f(B,L),role:w,"aria-labelledby":S?I:void 0,"aria-describedby":S&&x?F:void 0,...p(k,z),ref:N},v&&(typeof v==`string`?/* @__PURE__ */ c.createElement(a,{value:v,className:f(`notification-icon`,{"align-self-start":!!S})}):v),S&&/* @__PURE__ */ c.createElement(y,{id:I,component:C},S),x&&/* @__PURE__ */ c.createElement(_,{id:F},x),i,e,g&&/* @__PURE__ */ c.createElement(o,{label:l,onClick:j}))):null});b.displayName=`Notification`;const x=u(({className:e,...t},n)=>{let r=f(`notification-icon`,e);return/* @__PURE__ */ c.createElement(i,{className:r,...t,ref:n})});x.displayName=`NotificationIcon`;const S=new m;function C(e,t={}){return S.add({children:e,...t})}function w(e){S.close(e)}const T=u(({children:e,className:t,reverse:n,...i},a)=>{let{forkedRef:o,regionProps:l,state:u}=r(S,a);if(u.visibleToasts.length===0&&!e)return null;let d=n?[...u.visibleToasts].reverse():u.visibleToasts;return/* @__PURE__ */ c.createElement(s,{direction:`vertical`,gap:`sm`,className:t,...l,...i,ref:o},e,d.map(e=>{let{children:t,...n}=e.content;return/* @__PURE__ */ c.createElement(b,{key:e.key,...n,onClose:()=>u.close(e.key)},t)}))});T.displayName=`NotificationStack`;const E=()=>d(h);export{S as a,y as c,w as i,_ as l,T as n,x as o,C as r,b as s,E as t};
2
- //# sourceMappingURL=notification-oIrUtDhl.js.map
1
+ import"./focus-ring-Bs80iIBN.js";import{t as e}from"./polymorphic-mAKwlLiW.js";import{n as t,r as n,t as r}from"./useToastRegionQueue-QHa4v7k6.js";import{t as i}from"./Icon-Dk5_q79o.js";import{n as a}from"./iconSlot-DU_WcSL_.js";import{t as o}from"./CloseButton-CAQ--0sB.js";import{t as s}from"./stack-OItr30SC.js";import c,{createContext as l,forwardRef as u,useContext as d}from"react";import f from"classnames";import{mergeProps as p}from"react-aria";import{ToastQueue as m}from"react-stately";const h=l({close:()=>{}});function g({children:e,component:t,className:n,...r},i){let a=t??`div`,o=f(`notification-text`,n);return/* @__PURE__ */ c.createElement(a,{className:o,...r,ref:i},e)}const _=e(g,`NotificationText`);function v({children:e,className:t,component:n,...r},i){let a=n??`h4`,o=f(`notification-title`,t);return/* @__PURE__ */ c.createElement(a,{className:o,...r,ref:i},e)}const y=e(v,`NotificationTitle`),b=u(({actions:e,autohide:r=!1,children:i,className:s,closeLabel:l=`Close`,color:u=`primary`,defaultVisible:d=!0,delay:m=5e3,dismissible:g,icon:v,solid:b,text:x,title:S,titleComponent:C=`h4`,role:w=`status`,visible:T,onClose:E,onShow:D,onVisibleChange:O,...k},A)=>{let{close:j,entered:M,forkedRef:N,isMounted:P,textId:F,titleId:I,transitionClass:L,visible:R}=t({defaultVisible:d,displayName:`Notification`,onClose:E,onShow:D,onVisibleChange:O,ref:A,visible:T}),z=n({enabled:r,delay:m,visible:R&&M,onHide:j}),B=f(`notification`,`fade`,u,{solid:b},s);return P?/* @__PURE__ */ c.createElement(h.Provider,{value:{visible:R,close:j}},/* @__PURE__ */ c.createElement(`div`,{className:f(B,L),role:w,"aria-labelledby":S?I:void 0,"aria-describedby":S&&x?F:void 0,...p(k,z),ref:N},v&&(typeof v==`string`?/* @__PURE__ */ c.createElement(a,{value:v,className:f(`notification-icon`,{"align-self-start":!!S})}):v),S&&/* @__PURE__ */ c.createElement(y,{id:I,component:C},S),x&&/* @__PURE__ */ c.createElement(_,{id:F},x),i,e,g&&/* @__PURE__ */ c.createElement(o,{label:l,onClick:j}))):null});b.displayName=`Notification`;const x=u(({className:e,...t},n)=>{let r=f(`notification-icon`,e);return/* @__PURE__ */ c.createElement(i,{className:r,...t,ref:n})});x.displayName=`NotificationIcon`;const S=new m;function C(e,t={}){return S.add({children:e,...t})}function w(e){S.close(e)}const T=u(({children:e,className:t,reverse:n,...i},a)=>{let{forkedRef:o,regionProps:l,state:u}=r(S,a);if(u.visibleToasts.length===0&&!e)return null;let d=n?[...u.visibleToasts].reverse():u.visibleToasts;return/* @__PURE__ */ c.createElement(s,{direction:`vertical`,gap:`sm`,className:t,...p(l,i),ref:o},e,d.map(e=>{let{children:t,...n}=e.content;return/* @__PURE__ */ c.createElement(b,{key:e.key,...n,onClose:()=>u.close(e.key)},t)}))});T.displayName=`NotificationStack`;const E=()=>d(h);export{S as a,y as c,w as i,_ as l,T as n,x as o,C as r,b as s,E as t};
2
+ //# sourceMappingURL=notification-C1Sd4X7M.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-oIrUtDhl.js","names":["createPolymorphicComponent","useDismissibleTransition","useAutoDismiss","useToastRegionQueue","Icon","ResolvedIcon","CloseButton","Stack","React","classNames","NotificationContext","createContext","NotificationTextRender","rest","Component","component","_className","className","children","NotificationText","NotificationTitleRender","NotificationTitle","Notification","forwardRef","_visible","autoDismissProps","autohide","entered","close","color","isMounted","transitionClass","title","titleId","text","textId","mergeProps","forkedRef","icon","titleComponent","actions","dismissible","closeLabel","NotificationIcon","notificationQueue","ToastQueue","addNotification","options","closeNotification","key","NotificationStack","ref","state","queued","reverse","regionProps","notificationChildren","notificationProps","item","useNotification","useContext"],"sources":["../../src/components/notification/context.ts","../../src/components/notification/NotificationText.tsx","../../src/components/notification/NotificationTitle.tsx","../../src/components/notification/Notification.tsx","../../src/components/notification/NotificationIcon.tsx","../../src/components/notification/notificationQueue.ts","../../src/components/notification/NotificationStack.tsx","../../src/components/notification/useNotification.ts"],"sourcesContent":["import { createContext } from 'react'\n\nexport interface NotificationContextProps {\n /**\n * Whether the notification is currently visible.\n */\n visible?: boolean\n /**\n * Dismisses the notification. Wire this to any element's `onClick` — see `useNotification`.\n */\n close: () => void\n}\n\nexport const NotificationContext = createContext<NotificationContextProps>({ close: () => {} })\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 NotificationTextOwnProps<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 NotificationTextProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n NotificationTextOwnProps<C>\n>\n\ntype NotificationTextComponent = (<C extends ElementType = 'div'>(\n props: NotificationTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NotificationTextRender<C extends ElementType = 'div'>(\n { children, component, className, ...rest }: NotificationTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('notification-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NotificationText = createPolymorphicComponent<NotificationTextComponent>(\n NotificationTextRender as ForwardRefRenderFunction<Element, NotificationTextProps<ElementType>>,\n 'NotificationText'\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 NotificationTitleOwnProps<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\nexport type NotificationTitleProps<C extends ElementType = 'h4'> = PolymorphicComponentProps<\n C,\n NotificationTitleOwnProps<C>\n>\n\ntype NotificationTitleComponent = (<C extends ElementType = 'h4'>(\n props: NotificationTitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NotificationTitleRender<C extends ElementType = 'h4'>(\n { children, className, component, ...rest }: NotificationTitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h4'\n const _className = classNames('notification-title', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NotificationTitle = createPolymorphicComponent<NotificationTitleComponent>(\n NotificationTitleRender as ForwardRefRenderFunction<Element, NotificationTitleProps<ElementType>>,\n 'NotificationTitle'\n)\n","import React, { ElementType, forwardRef, HTMLAttributes, ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { ContextColor } from '../../types'\nimport { CloseButton } from '../close-button/CloseButton'\nimport { useAutoDismiss, useDismissibleTransition } from '../../hooks'\nimport { NotificationContext } from './context'\nimport { ResolvedIcon } from '../icon/iconSlot'\nimport { NotificationText } from './NotificationText'\nimport { NotificationTitle } from './NotificationTitle'\nimport './Notification.scss'\n\nexport interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /**\n * Optional trailing content — e.g. a row of `Button`s — rendered after `text`/`children`.\n */\n actions?: ReactNode\n /**\n * Automatically dismiss the notification after `delay`. The timer pauses while the pointer\n * or focus is on the notification, and only starts once the notification is visible.\n * Defaults to `false` — unlike `Toast`, notifications are persistent banners by default.\n */\n autohide?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Overrides the dismiss button's accessible name (defaults to `'Close'`). Set this for\n * non-English UIs.\n */\n closeLabel?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Whether the notification is shown when it first renders. Such a notification is\n * uncontrolled: its close button and the `autohide` timer hide it. Use `visible` to show and\n * hide it from outside.\n *\n * @default true\n */\n defaultVisible?: boolean\n /**\n * Delay in ms before an `autohide` notification dismisses itself.\n */\n delay?: number\n /**\n * Optionally add a close button to the notification and allow it to self dismiss.\n */\n dismissible?: boolean\n /**\n * Leading icon. A string is an icon name, rendered like `<NotificationIcon name={icon} />` (or\n * by `IconProvider`'s `component`); pass any other\n * node for a fully custom icon. Automatically top-aligns with `title` when both are set —\n * a custom icon node is responsible for its own alignment.\n */\n icon?: string | ReactNode\n /**\n * Applies the solid context style to the notification.\n */\n solid?: boolean\n /**\n * Message body, rendered via a single `<NotificationText>`. For multi-block content, compose\n * `children` manually instead — `text` wraps everything in one element.\n */\n text?: ReactNode\n /**\n * Heading, rendered via `<NotificationTitle>`.\n */\n title?: ReactNode\n /**\n * Element or component used for the `title` heading. Passed through to `NotificationTitle`'s\n * own `component` prop. Defaults to `'h4'`.\n */\n titleComponent?: ElementType\n /**\n * Callback fired once the notification has hidden: after its exit transition.\n */\n onClose?: () => void\n /**\n * Callback fired when the notification starts to show.\n */\n onShow?: () => void\n /**\n * Callback fired with `false` when the notification asks to hide: its close button, `close`\n * from `useNotification`, or the `autohide` timer. With `visible` set, the notification hides\n * only when `visible` becomes `false`.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * ARIA live-region role. Use `status` (the default) for confirmation, progress, and\n * informational messages, which announce politely. Use `alert` for messages that need\n * immediate attention — validation errors, failed operations — which interrupt speech.\n */\n role?: 'status' | 'alert'\n /**\n * Whether the notification is shown. Setting it makes the notification controlled: it hides\n * only when this becomes `false`, so pair it with `onVisibleChange`. Left unset, the\n * notification is shown and hides itself (see `defaultVisible`).\n */\n visible?: boolean\n}\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n actions,\n autohide = false,\n children,\n className,\n closeLabel = 'Close',\n color = 'primary',\n defaultVisible = true,\n delay = 5000,\n dismissible,\n icon,\n solid,\n text,\n title,\n titleComponent = 'h4',\n role = 'status',\n visible,\n onClose,\n onShow,\n onVisibleChange,\n ...rest\n },\n ref\n ) => {\n const {\n close,\n entered,\n forkedRef,\n isMounted,\n textId,\n titleId,\n transitionClass,\n visible: _visible\n } = useDismissibleTransition({\n defaultVisible,\n displayName: 'Notification',\n onClose,\n onShow,\n onVisibleChange,\n ref,\n visible\n })\n\n // Gated on `entered`, not just `_visible` (see `Toast`'s identical comment) — the entrance\n // transition finishing is what `autohide`'s JSDoc means by \"the timer starts once the\n // notification is visible\".\n const autoDismissProps = useAutoDismiss({\n enabled: autohide,\n delay,\n visible: _visible && entered,\n onHide: close\n })\n\n const _className = classNames(\n 'notification',\n 'fade',\n color,\n {\n solid\n },\n className\n )\n\n if (!isMounted) return null\n\n return (\n <NotificationContext.Provider value={{ visible: _visible, close }}>\n <div\n className={classNames(_className, transitionClass)}\n role={role}\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={title && text ? textId : undefined}\n {...mergeProps(rest, autoDismissProps)}\n ref={forkedRef}\n >\n {icon &&\n (typeof icon === 'string' ? (\n <ResolvedIcon\n value={icon}\n className={classNames('notification-icon', { 'align-self-start': !!title })}\n />\n ) : (\n icon\n ))}\n {title && (\n <NotificationTitle id={titleId} component={titleComponent}>\n {title}\n </NotificationTitle>\n )}\n {text && <NotificationText id={textId}>{text}</NotificationText>}\n {children}\n {actions}\n {dismissible && <CloseButton label={closeLabel} onClick={close} />}\n </div>\n </NotificationContext.Provider>\n )\n }\n)\n\nNotification.displayName = 'Notification'\n","import React, { forwardRef } from 'react'\nimport classNames from 'classnames'\n\nimport { Icon, IconProps } from '../icon/Icon'\n\nexport type NotificationIconProps = IconProps & {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n}\n\nexport const NotificationIcon = forwardRef<HTMLSpanElement | SVGSVGElement, NotificationIconProps>(\n ({ className, ...rest }, ref) => {\n const _className = classNames('notification-icon', className)\n\n return <Icon className={_className} {...rest} ref={ref} />\n }\n)\n\nNotificationIcon.displayName = 'NotificationIcon'\n","import { ReactNode } from 'react'\nimport { ToastQueue } from 'react-stately'\n\nimport { NotificationProps } from './Notification'\n\nexport interface NotificationContent extends Pick<\n NotificationProps,\n | 'actions'\n | 'autohide'\n | 'closeLabel'\n | 'color'\n | 'delay'\n | 'dismissible'\n | 'icon'\n | 'role'\n | 'solid'\n | 'text'\n | 'title'\n | 'titleComponent'\n> {\n /**\n * Content of the notification. Compose manually (typically a `NotificationIcon`/\n * `NotificationTitle`/`NotificationText`), or leave empty and use the `icon`/`title`/`text`\n * shorthand options instead.\n */\n children?: ReactNode\n}\n\n// The queue backing `NotificationStack` — a module-level singleton so `addNotification()` is\n// callable from anywhere (an event handler, an async callback) without threading a `push` prop\n// through render. `NotificationStack` subscribes to it via `useToastQueue`; nothing renders\n// until a `<NotificationStack />` is actually mounted somewhere to display the queue's contents.\nexport const notificationQueue = new ToastQueue<NotificationContent>()\n\n// Adds a notification to the queue. Returns the notification's key, which can be passed to\n// `closeNotification` to dismiss it programmatically. `children` is optional — omit it for a\n// notification composed entirely from the `icon`/`title`/`text` shorthand options.\nexport function addNotification(\n children?: ReactNode,\n options: Omit<NotificationContent, 'children'> = {}\n): string {\n return notificationQueue.add({ children, ...options })\n}\n\n// Removes a queued notification immediately, bypassing its own exit animation.\nexport function closeNotification(key: string): void {\n notificationQueue.close(key)\n}\n","import React, { forwardRef, HTMLAttributes } from 'react'\n\nimport { useToastRegionQueue } from '../../hooks'\nimport { Stack } from '../stack'\nimport { Notification } from './Notification'\nimport { notificationQueue } from './notificationQueue'\n\nexport interface NotificationStackProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Queued notifications show newest-first by default — the typical toast pattern. Set\n * `reverse` for a chronological transcript instead, oldest-first.\n */\n reverse?: boolean\n}\n\n// Renders the shared `notificationQueue` (see `notificationQueue.ts` — `addNotification()` is\n// how notifications get added to it from anywhere in the app) plus any statically-passed\n// `children`, e.g. a permanently pinned notification alongside dynamic ones — the same static\n// children still render with nothing queued, so this doubles as a plain grouping/spacing\n// wrapper for hand-placed notifications. Unlike `Toaster`, this always renders in normal\n// document flow rather than a fixed/portaled overlay — Chassis notifications are in-page\n// banners, not floating toasts.\nexport const NotificationStack = forwardRef<HTMLDivElement, NotificationStackProps>(\n ({ children, className, reverse, ...rest }, ref) => {\n const { forkedRef, regionProps, state } = useToastRegionQueue(notificationQueue, ref)\n\n if (state.visibleToasts.length === 0 && !children) {\n return null\n }\n\n // The queue is already newest-first (each add unshifts); `reverse` opts into chronological\n // order instead.\n const queued = reverse ? [...state.visibleToasts].reverse() : state.visibleToasts\n\n return (\n <Stack\n direction=\"vertical\"\n gap=\"sm\"\n className={className}\n {...regionProps}\n {...rest}\n ref={forkedRef}\n >\n {children}\n {queued.map((item) => {\n const { children: notificationChildren, ...notificationProps } = item.content\n return (\n <Notification\n key={item.key}\n {...notificationProps}\n onClose={() => state.close(item.key)}\n >\n {notificationChildren}\n </Notification>\n )\n })}\n </Stack>\n )\n }\n)\n\nNotificationStack.displayName = 'NotificationStack'\n","import { useContext } from 'react'\nimport { NotificationContext, NotificationContextProps } from './context'\n\nexport type UseNotificationResult = NotificationContextProps\n\n// Reach the enclosing `Notification`'s dismiss handler from anywhere in its composed markup —\n// e.g. to close it from a plain `Button` placed alongside other `actions`, instead of the\n// built-in `dismissible` close button. Only meaningful inside a `Notification`; outside one it\n// returns a no-op `close`.\nexport const useNotification = (): UseNotificationResult => useContext(NotificationContext)\n"],"mappings":"A,ifAaA,MAAaU,EAAsBC,EAAwC,CAAE,UA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AD,CACE,UAAU,WACV,IAAI,KACO,YACX,GAAIgD,EACJ,GAAI1C,EACJ,IAAKwB,CAeA,EAbJnB,EACAmC,EAAO,IAAK,GAAS,CACpB,GAAM,CAAE,SAAUG,EAAsB,GAAGC,GAAsBC,EAAK,QACtE,MACE,kBAAA,cAACpC,EAAD,CACE,IAAKoC,EAAK,IACV,GAAID,EACJ,YAAeL,EAAM,MAAMM,EAAK,GAAG,CAGvB,EADXF,CACW,CAElB,CAAC,CACI,CAEX,CACF,EAEA,EAAkB,YAAc,oBCxDhC,MAAaG,MAA+CC,EAAWlD,CAAmB,E"}
1
+ {"version":3,"file":"notification-C1Sd4X7M.js","names":["createPolymorphicComponent","useDismissibleTransition","useAutoDismiss","useToastRegionQueue","Icon","ResolvedIcon","CloseButton","Stack","React","classNames","NotificationContext","createContext","NotificationTextRender","rest","Component","component","_className","className","children","NotificationText","NotificationTitleRender","NotificationTitle","Notification","forwardRef","_visible","autoDismissProps","autohide","entered","close","color","isMounted","transitionClass","title","titleId","text","textId","mergeProps","forkedRef","icon","titleComponent","actions","dismissible","closeLabel","NotificationIcon","notificationQueue","ToastQueue","addNotification","options","closeNotification","key","NotificationStack","ref","state","queued","reverse","regionProps","notificationChildren","notificationProps","item","useNotification","useContext"],"sources":["../../src/components/notification/context.ts","../../src/components/notification/NotificationText.tsx","../../src/components/notification/NotificationTitle.tsx","../../src/components/notification/Notification.tsx","../../src/components/notification/NotificationIcon.tsx","../../src/components/notification/notificationQueue.ts","../../src/components/notification/NotificationStack.tsx","../../src/components/notification/useNotification.ts"],"sourcesContent":["import { createContext } from 'react'\n\nexport interface NotificationContextProps {\n /**\n * Whether the notification is currently visible.\n */\n visible?: boolean\n /**\n * Dismisses the notification. Wire this to any element's `onClick` — see `useNotification`.\n */\n close: () => void\n}\n\nexport const NotificationContext = createContext<NotificationContextProps>({ close: () => {} })\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 NotificationTextOwnProps<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 NotificationTextProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n NotificationTextOwnProps<C>\n>\n\ntype NotificationTextComponent = (<C extends ElementType = 'div'>(\n props: NotificationTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NotificationTextRender<C extends ElementType = 'div'>(\n { children, component, className, ...rest }: NotificationTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('notification-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NotificationText = createPolymorphicComponent<NotificationTextComponent>(\n NotificationTextRender as ForwardRefRenderFunction<Element, NotificationTextProps<ElementType>>,\n 'NotificationText'\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 NotificationTitleOwnProps<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\nexport type NotificationTitleProps<C extends ElementType = 'h4'> = PolymorphicComponentProps<\n C,\n NotificationTitleOwnProps<C>\n>\n\ntype NotificationTitleComponent = (<C extends ElementType = 'h4'>(\n props: NotificationTitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NotificationTitleRender<C extends ElementType = 'h4'>(\n { children, className, component, ...rest }: NotificationTitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h4'\n const _className = classNames('notification-title', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NotificationTitle = createPolymorphicComponent<NotificationTitleComponent>(\n NotificationTitleRender as ForwardRefRenderFunction<Element, NotificationTitleProps<ElementType>>,\n 'NotificationTitle'\n)\n","import React, { ElementType, forwardRef, HTMLAttributes, ReactNode } from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { ContextColor } from '../../types'\nimport { CloseButton } from '../close-button/CloseButton'\nimport { useAutoDismiss, useDismissibleTransition } from '../../hooks'\nimport { NotificationContext } from './context'\nimport { ResolvedIcon } from '../icon/iconSlot'\nimport { NotificationText } from './NotificationText'\nimport { NotificationTitle } from './NotificationTitle'\nimport './Notification.scss'\n\nexport interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /**\n * Optional trailing content — e.g. a row of `Button`s — rendered after `text`/`children`.\n */\n actions?: ReactNode\n /**\n * Automatically dismiss the notification after `delay`. The timer pauses while the pointer\n * or focus is on the notification, and only starts once the notification is visible.\n * Defaults to `false` — unlike `Toast`, notifications are persistent banners by default.\n */\n autohide?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Overrides the dismiss button's accessible name (defaults to `'Close'`). Set this for\n * non-English UIs.\n */\n closeLabel?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Whether the notification is shown when it first renders. Such a notification is\n * uncontrolled: its close button and the `autohide` timer hide it. Use `visible` to show and\n * hide it from outside.\n *\n * @default true\n */\n defaultVisible?: boolean\n /**\n * Delay in ms before an `autohide` notification dismisses itself.\n */\n delay?: number\n /**\n * Optionally add a close button to the notification and allow it to self dismiss.\n */\n dismissible?: boolean\n /**\n * Leading icon. A string is an icon name, rendered like `<NotificationIcon name={icon} />` (or\n * by `IconProvider`'s `component`); pass any other\n * node for a fully custom icon. Automatically top-aligns with `title` when both are set —\n * a custom icon node is responsible for its own alignment.\n */\n icon?: string | ReactNode\n /**\n * Applies the solid context style to the notification.\n */\n solid?: boolean\n /**\n * Message body, rendered via a single `<NotificationText>`. For multi-block content, compose\n * `children` manually instead — `text` wraps everything in one element.\n */\n text?: ReactNode\n /**\n * Heading, rendered via `<NotificationTitle>`.\n */\n title?: ReactNode\n /**\n * Element or component used for the `title` heading. Passed through to `NotificationTitle`'s\n * own `component` prop. Defaults to `'h4'`.\n */\n titleComponent?: ElementType\n /**\n * Callback fired once the notification has hidden: after its exit transition.\n */\n onClose?: () => void\n /**\n * Callback fired when the notification starts to show.\n */\n onShow?: () => void\n /**\n * Callback fired with `false` when the notification asks to hide: its close button, `close`\n * from `useNotification`, or the `autohide` timer. With `visible` set, the notification hides\n * only when `visible` becomes `false`.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * ARIA live-region role. Use `status` (the default) for confirmation, progress, and\n * informational messages, which announce politely. Use `alert` for messages that need\n * immediate attention — validation errors, failed operations — which interrupt speech.\n */\n role?: 'status' | 'alert'\n /**\n * Whether the notification is shown. Setting it makes the notification controlled: it hides\n * only when this becomes `false`, so pair it with `onVisibleChange`. Left unset, the\n * notification is shown and hides itself (see `defaultVisible`).\n */\n visible?: boolean\n}\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n actions,\n autohide = false,\n children,\n className,\n closeLabel = 'Close',\n color = 'primary',\n defaultVisible = true,\n delay = 5000,\n dismissible,\n icon,\n solid,\n text,\n title,\n titleComponent = 'h4',\n role = 'status',\n visible,\n onClose,\n onShow,\n onVisibleChange,\n ...rest\n },\n ref\n ) => {\n const {\n close,\n entered,\n forkedRef,\n isMounted,\n textId,\n titleId,\n transitionClass,\n visible: _visible\n } = useDismissibleTransition({\n defaultVisible,\n displayName: 'Notification',\n onClose,\n onShow,\n onVisibleChange,\n ref,\n visible\n })\n\n // Gated on `entered`, not just `_visible` (see `Toast`'s identical comment) — the entrance\n // transition finishing is what `autohide`'s JSDoc means by \"the timer starts once the\n // notification is visible\".\n const autoDismissProps = useAutoDismiss({\n enabled: autohide,\n delay,\n visible: _visible && entered,\n onHide: close\n })\n\n const _className = classNames(\n 'notification',\n 'fade',\n color,\n {\n solid\n },\n className\n )\n\n if (!isMounted) return null\n\n return (\n <NotificationContext.Provider value={{ visible: _visible, close }}>\n <div\n className={classNames(_className, transitionClass)}\n role={role}\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={title && text ? textId : undefined}\n {...mergeProps(rest, autoDismissProps)}\n ref={forkedRef}\n >\n {icon &&\n (typeof icon === 'string' ? (\n <ResolvedIcon\n value={icon}\n className={classNames('notification-icon', { 'align-self-start': !!title })}\n />\n ) : (\n icon\n ))}\n {title && (\n <NotificationTitle id={titleId} component={titleComponent}>\n {title}\n </NotificationTitle>\n )}\n {text && <NotificationText id={textId}>{text}</NotificationText>}\n {children}\n {actions}\n {dismissible && <CloseButton label={closeLabel} onClick={close} />}\n </div>\n </NotificationContext.Provider>\n )\n }\n)\n\nNotification.displayName = 'Notification'\n","import React, { forwardRef } from 'react'\nimport classNames from 'classnames'\n\nimport { Icon, IconProps } from '../icon/Icon'\n\nexport type NotificationIconProps = IconProps & {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n}\n\nexport const NotificationIcon = forwardRef<HTMLSpanElement | SVGSVGElement, NotificationIconProps>(\n ({ className, ...rest }, ref) => {\n const _className = classNames('notification-icon', className)\n\n return <Icon className={_className} {...rest} ref={ref} />\n }\n)\n\nNotificationIcon.displayName = 'NotificationIcon'\n","import { ReactNode } from 'react'\nimport { ToastQueue } from 'react-stately'\n\nimport { NotificationProps } from './Notification'\n\nexport interface NotificationContent extends Pick<\n NotificationProps,\n | 'actions'\n | 'autohide'\n | 'closeLabel'\n | 'color'\n | 'delay'\n | 'dismissible'\n | 'icon'\n | 'role'\n | 'solid'\n | 'text'\n | 'title'\n | 'titleComponent'\n> {\n /**\n * Content of the notification. Compose manually (typically a `NotificationIcon`/\n * `NotificationTitle`/`NotificationText`), or leave empty and use the `icon`/`title`/`text`\n * shorthand options instead.\n */\n children?: ReactNode\n}\n\n// The queue backing `NotificationStack` — a module-level singleton so `addNotification()` is\n// callable from anywhere (an event handler, an async callback) without threading a `push` prop\n// through render. `NotificationStack` subscribes to it via `useToastQueue`; nothing renders\n// until a `<NotificationStack />` is actually mounted somewhere to display the queue's contents.\nexport const notificationQueue = new ToastQueue<NotificationContent>()\n\n// Adds a notification to the queue. Returns the notification's key, which can be passed to\n// `closeNotification` to dismiss it programmatically. `children` is optional — omit it for a\n// notification composed entirely from the `icon`/`title`/`text` shorthand options.\nexport function addNotification(\n children?: ReactNode,\n options: Omit<NotificationContent, 'children'> = {}\n): string {\n return notificationQueue.add({ children, ...options })\n}\n\n// Removes a queued notification immediately, bypassing its own exit animation.\nexport function closeNotification(key: string): void {\n notificationQueue.close(key)\n}\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport { mergeProps } from 'react-aria'\n\nimport { useToastRegionQueue } from '../../hooks'\nimport { Stack } from '../stack'\nimport { Notification } from './Notification'\nimport { notificationQueue } from './notificationQueue'\n\nexport interface NotificationStackProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Queued notifications show newest-first by default — the typical toast pattern. Set\n * `reverse` for a chronological transcript instead, oldest-first.\n */\n reverse?: boolean\n}\n\n// Renders the shared `notificationQueue` (see `notificationQueue.ts` — `addNotification()` is\n// how notifications get added to it from anywhere in the app) plus any statically-passed\n// `children`, e.g. a permanently pinned notification alongside dynamic ones — the same static\n// children still render with nothing queued, so this doubles as a plain grouping/spacing\n// wrapper for hand-placed notifications. Unlike `Toaster`, this always renders in normal\n// document flow rather than a fixed/portaled overlay — Chassis notifications are in-page\n// banners, not floating toasts.\nexport const NotificationStack = forwardRef<HTMLDivElement, NotificationStackProps>(\n ({ children, className, reverse, ...rest }, ref) => {\n const { forkedRef, regionProps, state } = useToastRegionQueue(notificationQueue, ref)\n\n if (state.visibleToasts.length === 0 && !children) {\n return null\n }\n\n // The queue is already newest-first (each add unshifts); `reverse` opts into chronological\n // order instead.\n const queued = reverse ? [...state.visibleToasts].reverse() : state.visibleToasts\n\n return (\n <Stack\n direction=\"vertical\"\n gap=\"sm\"\n className={className}\n // Merged, as in `Toaster`: a caller's handlers chain with the region's own.\n {...mergeProps(regionProps, rest)}\n ref={forkedRef}\n >\n {children}\n {queued.map((item) => {\n const { children: notificationChildren, ...notificationProps } = item.content\n return (\n <Notification\n key={item.key}\n {...notificationProps}\n onClose={() => state.close(item.key)}\n >\n {notificationChildren}\n </Notification>\n )\n })}\n </Stack>\n )\n }\n)\n\nNotificationStack.displayName = 'NotificationStack'\n","import { useContext } from 'react'\nimport { NotificationContext, NotificationContextProps } from './context'\n\nexport type UseNotificationResult = NotificationContextProps\n\n// Reach the enclosing `Notification`'s dismiss handler from anywhere in its composed markup —\n// e.g. to close it from a plain `Button` placed alongside other `actions`, instead of the\n// built-in `dismissible` close button. Only meaningful inside a `Notification`; outside one it\n// returns a no-op `close`.\nexport const useNotification = (): UseNotificationResult => useContext(NotificationContext)\n"],"mappings":"A,ifAaA,MAAaU,EAAsBC,EAAwC,CAAE,UAAa,CAAC,CAAE,CAAC,ECgB9F,SAASC,EACP,CAAE,WAAU,YAAW,YAAW,GAAGC,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EAAaP,EAAW,oBAAqBQ,CAAS,EAE5D,MACE,kBAAA,cAACH,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRK,CACQ,CAEf,CAEA,MAAaC,EAAmBnB,EAC9BY,EACA,kBACF,ECjBA,SAASQ,EACP,CAAE,WAAU,YAAW,YAAW,GAAGP,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,KACzBC,EAAaP,EAAW,qBAAsBQ,CAAS,EAE7D,MACE,kBAAA,cAACH,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRK,CACQ,CAEf,CAEA,MAAaG,EAAoBrB,EAC/BoB,EACA,mBACF,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AE,YAAW,GAAGV,GAAQ,IAAQ,CAC/B,IAAMG,EAAaP,EAAW,oBAAqBQ,CAAS,EAE5D,MAAO,kBAAA,cAACb,EAAD,CAAM,UAAWY,EAAY,GAAIH,EAAW,KAAM,CAAA,CAC3D,CACF,EAEA,EAAiB,YAAc,mBCY/B,MAAa+B,EAAoB,IAAIC,EAKrC,SAAgBC,EACd,EACA,EAAiD,CAAC,EAC1C,CACR,OAAOF,EAAkB,IAAI,CAAE,WAAU,GAAGG,CAAQ,CAAC,CACvD,CAGA,SAAgBC,EAAkB,EAAmB,CACnDJ,EAAkB,MAAMK,CAAG,CAC7B,CCpBA,MAAaC,EAAoB3B,GAC9B,CAAE,WAAU,YAAW,UAAS,GAAGV,GAAQ,IAAQ,CAClD,GAAM,CAAE,YAAW,cAAa,SAAUV,EAAoByC,EAAmBO,CAAG,EAEpF,GAAIC,EAAM,cAAc,SAAW,GAAK,CAAClC,EACvC,OAAO,KAKT,IAAMmC,EAASC,EAAU,CAAC,GAAGF,EAAM,aAAa,CAAC,CAAC,QAAQ,EAAIA,EAAM,cAEpE,MACE,kBAAA,cAAC7C,EAAD,CACE,UAAU,WACV,IAAI,KACO,YAEX,GAAI6B,EAAWmB,EAAa1C,CAAI,EAChC,IAAKwB,CAeA,EAbJnB,EACAmC,EAAO,IAAK,GAAS,CACpB,GAAM,CAAE,SAAUG,EAAsB,GAAGC,GAAsBC,EAAK,QACtE,MACE,kBAAA,cAACpC,EAAD,CACE,IAAKoC,EAAK,IACV,GAAID,EACJ,YAAeL,EAAM,MAAMM,EAAK,GAAG,CAGvB,EADXF,CACW,CAElB,CAAC,CACI,CAEX,CACF,EAEA,EAAkB,YAAc,oBCzDhC,MAAaG,MAA+CC,EAAWlD,CAAmB,E"}
@@ -1,2 +1,2 @@
1
- import"./focus-ring-Bs80iIBN.js";import{t as e}from"./useForkedRef-WoqMqsWE.js";import{t}from"./useHydrated-Dud4JEwp.js";import{t as n}from"./useFormField-DH2tlc3e.js";import{t as r}from"./useHeldBack-eeTfpa_t.js";import{t as i}from"./iconSlot-DU_WcSL_.js";import{t as a}from"./renderFormField-_6WswnEX.js";import{t as o}from"./validationClassName-gRGs4KBm.js";import{r as ee,t as s}from"./unhandledProps-9Kdj7WVf.js";import c,{forwardRef as l,useRef as u}from"react";import d from"classnames";import{mergeProps as te,useButton as f,useLocale as p,useNumberField as ne}from"react-aria";import{useNumberFieldState as re}from"react-stately";function m({buttonProps:e,className:t,icon:n,iconKey:r}){let a=u(null),{buttonProps:o}=f(e,a);return/* @__PURE__ */ c.createElement(`button`,{...o,className:t,ref:a},/* @__PURE__ */ c.createElement(i,{icon:r,override:n}))}const h=l(({adornEnd:i,adornStart:l,className:f,decrementAriaLabel:h,decrementIcon:g,defaultValue:_,disabled:v,form:y,formatOptions:ie,help:b,id:ae,incrementAriaLabel:x,incrementIcon:S,invalid:C,invalidFeedback:w,label:T,max:E,min:oe,name:D,onChange:se,readOnly:ce,required:O,size:k,step:le,stepButtons:A=!0,style:j,valid:M,validFeedback:N,value:P,...F},I)=>{let L=u(null),R=e(I,L),{invalid:z,valid:B}=r(L,{invalid:C,valid:M}),V=t(),{locale:H}=p(),{describedBy:U,feedbackId:ue,helpId:de,inputId:W,labelId:fe,labelledBy:pe}=n({ariaDescribedBy:F[`aria-describedby`],ariaLabelledBy:F[`aria-labelledby`],help:b,id:ae,invalid:z,invalidFeedback:w,label:T,valid:B,validFeedback:N}),G={...F,"aria-describedby":U,"aria-labelledby":pe,decrementAriaLabel:h,defaultValue:_,formatOptions:ie,id:W,incrementAriaLabel:x,isDisabled:v,isInvalid:z,isReadOnly:ce,isRequired:O,maxValue:E,minValue:oe,onChange:se,step:le,value:P},K=re({...G,locale:H}),{decrementButtonProps:me,groupProps:q,incrementButtonProps:J,inputProps:Y}=ne(G,K,L),X=A||l!=null||i!=null,Z={onBlur:q.onBlur,onFocus:q.onFocus},Q=/* @__PURE__ */ c.createElement(`input`,{...ee(X?Y:te(Y,Z),F,s),"aria-describedby":U,"aria-disabled":void 0,"aria-readonly":void 0,"aria-required":void 0,"aria-roledescription":V?Y[`aria-roledescription`]:void 0,className:d(X?`ghost-input`:`form-input`,!X&&k,o(z,B),!X&&f),form:y,inputMode:V?Y.inputMode:`numeric`,ref:R,required:O||void 0,style:X?void 0:j}),$=X?/* @__PURE__ */ c.createElement(`div`,{className:d(`form-input`,`number-field`,k,f),style:j,...Z},l,Q,i,A&&/* @__PURE__ */ c.createElement(`div`,{className:`number-field-buttons`},/* @__PURE__ */ c.createElement(m,{buttonProps:J,className:`number-field-increment`,icon:S,iconKey:`increment`}),/* @__PURE__ */ c.createElement(m,{buttonProps:me,className:`number-field-decrement`,icon:g,iconKey:`decrement`}))):Q,he=D?/* @__PURE__ */ c.createElement(c.Fragment,null,$,/* @__PURE__ */ c.createElement(`input`,{disabled:v||void 0,form:y,name:D,type:`hidden`,value:isNaN(K.numberValue)?``:K.numberValue})):$;return a({children:he,help:b,ids:{feedback:ue,help:de,input:W,label:fe},invalid:z,invalidFeedback:w,label:T,valid:B,validFeedback:N})});h.displayName=`NumberField`;export{h as t};
2
- //# sourceMappingURL=number-field-ChPTSBwI.js.map
1
+ import"./focus-ring-Bs80iIBN.js";import{t as e}from"./useForkedRef-WoqMqsWE.js";import{t}from"./useHydrated-Dud4JEwp.js";import{t as n}from"./useFormField-q21MOgh8.js";import{t as r}from"./useHeldBack-o-CsPcSe.js";import{t as i}from"./iconSlot-DU_WcSL_.js";import{t as a}from"./renderFormField-CaZ8-xrn.js";import{t as o}from"./validationClassName-gRGs4KBm.js";import{r as ee,t as s}from"./unhandledProps-9Kdj7WVf.js";import c,{forwardRef as l,useRef as u}from"react";import d from"classnames";import{mergeProps as te,useButton as f,useLocale as p,useNumberField as ne}from"react-aria";import{useNumberFieldState as re}from"react-stately";function m({buttonProps:e,className:t,icon:n,iconKey:r}){let a=u(null),{buttonProps:o}=f(e,a);return/* @__PURE__ */ c.createElement(`button`,{...o,className:t,ref:a},/* @__PURE__ */ c.createElement(i,{icon:r,override:n}))}const h=l(({adornEnd:i,adornStart:l,className:f,decrementAriaLabel:h,decrementIcon:g,defaultValue:_,disabled:v,form:y,formatOptions:ie,help:b,id:ae,incrementAriaLabel:x,incrementIcon:S,invalid:C,invalidFeedback:w,label:T,max:E,min:oe,name:D,onChange:se,readOnly:ce,required:O,size:k,step:le,stepButtons:A=!0,style:j,valid:M,validFeedback:N,value:P,...F},I)=>{let L=u(null),R=e(I,L),{invalid:z,valid:B}=r(L,{invalid:C,valid:M}),V=t(),{locale:H}=p(),{describedBy:U,feedbackId:ue,helpId:de,inputId:W,labelId:fe,labelledBy:pe}=n({ariaDescribedBy:F[`aria-describedby`],ariaLabelledBy:F[`aria-labelledby`],help:b,id:ae,invalid:z,invalidFeedback:w,label:T,valid:B,validFeedback:N}),G={...F,"aria-describedby":U,"aria-labelledby":pe,decrementAriaLabel:h,defaultValue:_,formatOptions:ie,id:W,incrementAriaLabel:x,isDisabled:v,isInvalid:z,isReadOnly:ce,isRequired:O,maxValue:E,minValue:oe,onChange:se,step:le,value:P},K=re({...G,locale:H}),{decrementButtonProps:me,groupProps:q,incrementButtonProps:J,inputProps:Y}=ne(G,K,L),X=A||l!=null||i!=null,Z={onBlur:q.onBlur,onFocus:q.onFocus},Q=/* @__PURE__ */ c.createElement(`input`,{...ee(X?Y:te(Y,Z),F,s),"aria-describedby":U,"aria-disabled":void 0,"aria-readonly":void 0,"aria-required":void 0,"aria-roledescription":V?Y[`aria-roledescription`]:void 0,className:d(X?`ghost-input`:`form-input`,!X&&k,o(z,B),!X&&f),form:y,inputMode:V?Y.inputMode:`numeric`,ref:R,required:O||void 0,style:X?void 0:j}),$=X?/* @__PURE__ */ c.createElement(`div`,{className:d(`form-input`,`number-field`,k,f),style:j,...Z},l,Q,i,A&&/* @__PURE__ */ c.createElement(`div`,{className:`number-field-buttons`},/* @__PURE__ */ c.createElement(m,{buttonProps:J,className:`number-field-increment`,icon:S,iconKey:`increment`}),/* @__PURE__ */ c.createElement(m,{buttonProps:me,className:`number-field-decrement`,icon:g,iconKey:`decrement`}))):Q,he=D?/* @__PURE__ */ c.createElement(c.Fragment,null,$,/* @__PURE__ */ c.createElement(`input`,{disabled:v||void 0,form:y,name:D,type:`hidden`,value:isNaN(K.numberValue)?``:K.numberValue})):$;return a({children:he,help:b,ids:{feedback:ue,help:de,input:W,label:fe},invalid:z,invalidFeedback:w,label:T,valid:B,validFeedback:N})});h.displayName=`NumberField`;export{h as t};
2
+ //# sourceMappingURL=number-field-BIApgIlR.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"number-field-ChPTSBwI.js","names":["useForkedRef","useFormField","useHeldBack","IconSlot","renderFormField","validationClassName","mergeUnhandledProps","TEXT_FIELD_PROPS","React","classNames","StepButton","ref","useRef","props","useButton","buttonProps","iconKey","icon","NumberField","forwardRef","invalidProp","validProp","rest","inputRef","forkedRef","hydrated","useHydrated","useLocale","fieldProps","describedBy","labelledBy","inputId","disabled","invalid","readOnly","required","max","min","state","useNumberFieldState","useNumberField","hasWrapper","stepButtons","adornStart","adornEnd","focusWithin","groupProps","input","inputProps","mergeProps","size","valid","className","style","field","incrementButtonProps","incrementIcon","decrementButtonProps","decrementIcon","children","name","feedbackId","helpId","labelId"],"sources":["../../src/components/number-field/NumberField.tsx"],"sourcesContent":["import React, { forwardRef, InputHTMLAttributes, ReactNode, RefObject, useRef } from 'react'\nimport classNames from 'classnames'\nimport {\n AriaButtonProps,\n AriaNumberFieldProps,\n mergeProps,\n useButton,\n useLocale,\n useNumberField\n} from 'react-aria'\nimport { useNumberFieldState } from 'react-stately'\n\nimport './NumberField.scss'\nimport { useForkedRef, useFormField, useHeldBack } from '../../hooks'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../icon/iconSlot'\nimport { mergeUnhandledProps, TEXT_FIELD_PROPS } from '../../utils/unhandledProps'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { useHydrated } from '../../hooks/useHydrated'\nimport { renderFormField } from '../form-field/renderFormField'\n\nexport interface NumberFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'defaultValue' | 'inputMode' | 'max' | 'min' | 'onChange' | 'size' | 'step' | 'type' | 'value'\n> {\n /**\n * Content rendered at the input's trailing edge, before the step buttons, e.g. a unit as an\n * `InputAdorn`.\n */\n adornEnd?: ReactNode\n /**\n * Content rendered at the input's leading edge, e.g. an `InputAdorn` icon or text.\n */\n adornStart?: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The name of the decrement button for screen readers. Defaults to \"Decrease\" and the field's\n * label, in the locale's language.\n */\n decrementAriaLabel?: string\n /**\n * The decrement button's icon, in place of `IconProvider`'s `decrement`.\n */\n decrementIcon?: IconValue\n /**\n * The value of the field, uncontrolled.\n */\n defaultValue?: number\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * How the value is shown and typed: decimals, a percent, a currency or a unit, with the\n * locale's separators. `Intl.NumberFormat`'s options.\n */\n formatOptions?: Intl.NumberFormatOptions\n /**\n * A description for the field, rendered below the input.\n */\n help?: ReactNode\n /**\n * The name of the increment button for screen readers. Defaults to \"Increase\" and the field's\n * label, in the locale's language.\n */\n incrementAriaLabel?: string\n /**\n * The increment button's icon, in place of `IconProvider`'s `increment`.\n */\n incrementIcon?: IconValue\n /**\n * Set component validation state to invalid. Left unset, the component shows as invalid by itself\n * from a submit it held back (an empty `required` one, say) until it no longer would, or its\n * form is reset. Set it, to `false` too, and it alone decides.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below the input when `invalid` is set, and after a\n * submit the field held back, until it no longer would.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with this input.\n */\n label?: ReactNode\n /**\n * The largest value. A larger one typed in is clamped to it when the field loses focus.\n */\n max?: number\n /**\n * The smallest value. A smaller one typed in is clamped to it when the field loses focus.\n */\n min?: number\n /**\n * Handler that is called when the value is committed: on a step (a button, an arrow key, Home,\n * End, the mouse wheel), on Enter or when the field loses focus after typing, on a paste that\n * replaces the whole text, and on a form reset. `NaN` when the field is empty.\n */\n onChange?: (value: number) => void\n /**\n * Toggle the readonly state for the component.\n */\n readOnly?: boolean\n /**\n * Toggle the required state for the component.\n */\n required?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * The amount the buttons and the arrow keys add or take away. A typed value snaps to it,\n * counted from `min`.\n *\n * @default 1\n */\n step?: number\n /**\n * Show the increment and decrement buttons. Without them the arrow keys still step the value.\n *\n * @default true\n */\n stepButtons?: boolean\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below the input when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The value of the field, controlled. `NaN` for an empty field.\n */\n value?: number\n}\n\n// One step button. A `<button>` react-aria keeps out of the tab order: the input's arrow keys do\n// the same. A mouse press leaves focus on the input; a touch focuses the button, so no software\n// keyboard opens.\nfunction StepButton({\n buttonProps,\n className,\n icon,\n iconKey\n}: {\n buttonProps: AriaButtonProps\n className: string\n icon?: IconValue\n iconKey: 'increment' | 'decrement'\n}) {\n const ref = useRef<HTMLButtonElement>(null)\n const { buttonProps: props } = useButton(buttonProps, ref as RefObject<HTMLButtonElement | null>)\n return (\n <button {...props} className={className} ref={ref}>\n <IconSlot icon={iconKey} override={icon} />\n </button>\n )\n}\n\nexport const NumberField = forwardRef<HTMLInputElement, NumberFieldProps>(\n (\n {\n adornEnd,\n adornStart,\n className,\n decrementAriaLabel,\n decrementIcon,\n defaultValue,\n disabled,\n form,\n formatOptions,\n help,\n id,\n incrementAriaLabel,\n incrementIcon,\n invalid: invalidProp,\n invalidFeedback,\n label,\n max,\n min,\n name,\n onChange,\n readOnly,\n required,\n size,\n step,\n stepButtons = true,\n style,\n valid: validProp,\n validFeedback,\n value,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n // Shown as invalid from a submit it held back until it no longer would (`useHeldBack`):\n // react-aria cancels the browser's own message, and the form stayed with nothing to say why.\n const { invalid, valid } = useHeldBack(inputRef, { invalid: invalidProp, valid: validProp })\n const hydrated = useHydrated()\n const { locale } = useLocale()\n\n const { describedBy, feedbackId, helpId, inputId, labelId, labelledBy } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n ariaLabelledBy: rest['aria-labelledby'],\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n\n // `label` stays out: react-aria would label the input and the buttons with a label element of\n // its own, which this component doesn't render. The buttons are named from `aria-labelledby`,\n // which names the `FormLabel` (FORMS.md, gotcha 5).\n const fieldProps = {\n ...rest,\n 'aria-describedby': describedBy,\n 'aria-labelledby': labelledBy,\n decrementAriaLabel,\n defaultValue,\n formatOptions,\n id: inputId,\n incrementAriaLabel,\n isDisabled: disabled,\n isInvalid: invalid,\n isReadOnly: readOnly,\n isRequired: required,\n maxValue: max,\n minValue: min,\n onChange,\n step,\n value\n } as AriaNumberFieldProps\n const state = useNumberFieldState({ ...fieldProps, locale })\n const { decrementButtonProps, groupProps, incrementButtonProps, inputProps } = useNumberField(\n fieldProps,\n state,\n inputRef\n )\n\n const hasWrapper = stepButtons || adornStart != null || adornEnd != null\n\n // react-aria picks the keyboard (`inputMode`) and drops `aria-roledescription` by platform\n // (iPhone, Android, iOS), which the server can't know, and a hydrating render doesn't patch an\n // attribute. Until the page has hydrated, both are what the server renders: `numeric`, which\n // any platform but those picks, and no role description, whose text iOS doesn't get.\n // `aria-describedby` after the spread: react-aria's own adds ids it never renders (FORMS.md,\n // gotcha 6).\n // react-aria's focus-within handlers let the mouse wheel step the value while the field has\n // focus: on the wrapper when there is one, else on the input. The wrapper isn't a named group.\n const focusWithin = { onBlur: groupProps.onBlur, onFocus: groupProps.onFocus }\n // `form` reaches the visible input too, which has no `name`: react-aria resets the field on\n // the reset of the input's own form, and a form linked by id is the input's form only then.\n const input = (\n <input\n {...mergeUnhandledProps(\n hasWrapper ? inputProps : mergeProps(inputProps, focusWithin),\n rest,\n TEXT_FIELD_PROPS\n )}\n aria-describedby={describedBy}\n // react-aria's spin button props repeat the native `disabled` and `readOnly` the text\n // field sets; the Nu Html Checker flags the copies.\n aria-disabled={undefined}\n aria-readonly={undefined}\n // The native `required` below says the same.\n aria-required={undefined}\n aria-roledescription={hydrated ? inputProps['aria-roledescription'] : undefined}\n className={classNames(\n hasWrapper ? 'ghost-input' : 'form-input',\n !hasWrapper && size,\n validationClassName(invalid, valid),\n !hasWrapper && className\n )}\n form={form}\n inputMode={hydrated ? inputProps.inputMode : 'numeric'}\n ref={forkedRef}\n // On the visible input, not the hidden one that carries `name`: a hidden input is barred\n // from constraint validation, and this one is empty exactly when the value is. react-aria\n // writes `aria-required` alone, which no form checks.\n required={required || undefined}\n style={hasWrapper ? undefined : style}\n />\n )\n\n // The step buttons sit in their own element: chassis-css styles `.form-input` as disabled when\n // one of its direct children is, and a step button is disabled at `min` or `max`.\n const field = hasWrapper ? (\n <div\n className={classNames('form-input', 'number-field', size, className)}\n style={style}\n {...focusWithin}\n >\n {adornStart}\n {input}\n {adornEnd}\n {stepButtons && (\n <div className=\"number-field-buttons\">\n <StepButton\n buttonProps={incrementButtonProps}\n className=\"number-field-increment\"\n icon={incrementIcon}\n iconKey=\"increment\"\n />\n <StepButton\n buttonProps={decrementButtonProps}\n className=\"number-field-decrement\"\n icon={decrementIcon}\n iconKey=\"decrement\"\n />\n </div>\n )}\n </div>\n ) : (\n input\n )\n\n // The input shows the formatted text; a form receives the number, from a hidden input as\n // react-aria-components' `NumberField` renders it.\n const children = name ? (\n <>\n {field}\n <input\n disabled={disabled || undefined}\n form={form}\n name={name}\n type=\"hidden\"\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n </>\n ) : (\n field\n )\n\n return renderFormField({\n children,\n help,\n ids: { feedback: feedbackId, help: helpId, input: inputId, label: labelId },\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n }\n)\n\nNumberField.displayName = 'NumberField'\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YAAc,c"}
1
+ {"version":3,"file":"number-field-BIApgIlR.js","names":["useForkedRef","useFormField","useHeldBack","IconSlot","renderFormField","validationClassName","mergeUnhandledProps","TEXT_FIELD_PROPS","React","classNames","StepButton","ref","useRef","props","useButton","buttonProps","iconKey","icon","NumberField","forwardRef","invalidProp","validProp","rest","inputRef","forkedRef","hydrated","useHydrated","useLocale","fieldProps","describedBy","labelledBy","inputId","disabled","invalid","readOnly","required","max","min","state","useNumberFieldState","useNumberField","hasWrapper","stepButtons","adornStart","adornEnd","focusWithin","groupProps","input","inputProps","mergeProps","size","valid","className","style","field","incrementButtonProps","incrementIcon","decrementButtonProps","decrementIcon","children","name","feedbackId","helpId","labelId"],"sources":["../../src/components/number-field/NumberField.tsx"],"sourcesContent":["import React, { forwardRef, InputHTMLAttributes, ReactNode, RefObject, useRef } from 'react'\nimport classNames from 'classnames'\nimport {\n AriaButtonProps,\n AriaNumberFieldProps,\n mergeProps,\n useButton,\n useLocale,\n useNumberField\n} from 'react-aria'\nimport { useNumberFieldState } from 'react-stately'\n\nimport './NumberField.scss'\nimport { useForkedRef, useFormField, useHeldBack } from '../../hooks'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../icon/iconSlot'\nimport { mergeUnhandledProps, TEXT_FIELD_PROPS } from '../../utils/unhandledProps'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { useHydrated } from '../../hooks/useHydrated'\nimport { renderFormField } from '../form-field/renderFormField'\n\nexport interface NumberFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'defaultValue' | 'inputMode' | 'max' | 'min' | 'onChange' | 'size' | 'step' | 'type' | 'value'\n> {\n /**\n * Content rendered at the input's trailing edge, before the step buttons, e.g. a unit as an\n * `InputAdorn`.\n */\n adornEnd?: ReactNode\n /**\n * Content rendered at the input's leading edge, e.g. an `InputAdorn` icon or text.\n */\n adornStart?: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The name of the decrement button for screen readers. Defaults to \"Decrease\" and the field's\n * label, in the locale's language.\n */\n decrementAriaLabel?: string\n /**\n * The decrement button's icon, in place of `IconProvider`'s `decrement`.\n */\n decrementIcon?: IconValue\n /**\n * The value of the field, uncontrolled.\n */\n defaultValue?: number\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * How the value is shown and typed: decimals, a percent, a currency or a unit, with the\n * locale's separators. `Intl.NumberFormat`'s options.\n */\n formatOptions?: Intl.NumberFormatOptions\n /**\n * A description for the field, rendered below the input.\n */\n help?: ReactNode\n /**\n * The name of the increment button for screen readers. Defaults to \"Increase\" and the field's\n * label, in the locale's language.\n */\n incrementAriaLabel?: string\n /**\n * The increment button's icon, in place of `IconProvider`'s `increment`.\n */\n incrementIcon?: IconValue\n /**\n * Set component validation state to invalid. Left unset, the component shows as invalid by itself\n * from a submit it held back (an empty `required` one, say) until it no longer would, or its\n * form is reset. Set it, to `false` too, and it alone decides.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below the input when `invalid` is set, and after a\n * submit the field held back, until it no longer would.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with this input.\n */\n label?: ReactNode\n /**\n * The largest value. A larger one typed in is clamped to it when the field loses focus.\n */\n max?: number\n /**\n * The smallest value. A smaller one typed in is clamped to it when the field loses focus.\n */\n min?: number\n /**\n * Handler that is called when the value is committed: on a step (a button, an arrow key, Home,\n * End, the mouse wheel), on Enter or when the field loses focus after typing, on a paste that\n * replaces the whole text, and on a form reset. `NaN` when the field is empty.\n */\n onChange?: (value: number) => void\n /**\n * Toggle the readonly state for the component.\n */\n readOnly?: boolean\n /**\n * Toggle the required state for the component.\n */\n required?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * The amount the buttons and the arrow keys add or take away. A typed value snaps to it,\n * counted from `min`.\n *\n * @default 1\n */\n step?: number\n /**\n * Show the increment and decrement buttons. Without them the arrow keys still step the value.\n *\n * @default true\n */\n stepButtons?: boolean\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below the input when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The value of the field, controlled. `NaN` for an empty field.\n */\n value?: number\n}\n\n// One step button. A `<button>` react-aria keeps out of the tab order: the input's arrow keys do\n// the same. A mouse press leaves focus on the input; a touch focuses the button, so no software\n// keyboard opens.\nfunction StepButton({\n buttonProps,\n className,\n icon,\n iconKey\n}: {\n buttonProps: AriaButtonProps\n className: string\n icon?: IconValue\n iconKey: 'increment' | 'decrement'\n}) {\n const ref = useRef<HTMLButtonElement>(null)\n const { buttonProps: props } = useButton(buttonProps, ref as RefObject<HTMLButtonElement | null>)\n return (\n <button {...props} className={className} ref={ref}>\n <IconSlot icon={iconKey} override={icon} />\n </button>\n )\n}\n\nexport const NumberField = forwardRef<HTMLInputElement, NumberFieldProps>(\n (\n {\n adornEnd,\n adornStart,\n className,\n decrementAriaLabel,\n decrementIcon,\n defaultValue,\n disabled,\n form,\n formatOptions,\n help,\n id,\n incrementAriaLabel,\n incrementIcon,\n invalid: invalidProp,\n invalidFeedback,\n label,\n max,\n min,\n name,\n onChange,\n readOnly,\n required,\n size,\n step,\n stepButtons = true,\n style,\n valid: validProp,\n validFeedback,\n value,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n // Shown as invalid from a submit it held back until it no longer would (`useHeldBack`):\n // react-aria cancels the browser's own message, and the form stayed with nothing to say why.\n const { invalid, valid } = useHeldBack(inputRef, { invalid: invalidProp, valid: validProp })\n const hydrated = useHydrated()\n const { locale } = useLocale()\n\n const { describedBy, feedbackId, helpId, inputId, labelId, labelledBy } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n ariaLabelledBy: rest['aria-labelledby'],\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n\n // `label` stays out: react-aria would label the input and the buttons with a label element of\n // its own, which this component doesn't render. The buttons are named from `aria-labelledby`,\n // which names the `FormLabel` (FORMS.md, gotcha 5).\n const fieldProps = {\n ...rest,\n 'aria-describedby': describedBy,\n 'aria-labelledby': labelledBy,\n decrementAriaLabel,\n defaultValue,\n formatOptions,\n id: inputId,\n incrementAriaLabel,\n isDisabled: disabled,\n isInvalid: invalid,\n isReadOnly: readOnly,\n isRequired: required,\n maxValue: max,\n minValue: min,\n onChange,\n step,\n value\n } as AriaNumberFieldProps\n const state = useNumberFieldState({ ...fieldProps, locale })\n const { decrementButtonProps, groupProps, incrementButtonProps, inputProps } = useNumberField(\n fieldProps,\n state,\n inputRef\n )\n\n const hasWrapper = stepButtons || adornStart != null || adornEnd != null\n\n // react-aria picks the keyboard (`inputMode`) and drops `aria-roledescription` by platform\n // (iPhone, Android, iOS), which the server can't know, and a hydrating render doesn't patch an\n // attribute. Until the page has hydrated, both are what the server renders: `numeric`, which\n // any platform but those picks, and no role description, whose text iOS doesn't get.\n // `aria-describedby` after the spread: react-aria's own adds ids it never renders (FORMS.md,\n // gotcha 6).\n // react-aria's focus-within handlers let the mouse wheel step the value while the field has\n // focus: on the wrapper when there is one, else on the input. The wrapper isn't a named group.\n const focusWithin = { onBlur: groupProps.onBlur, onFocus: groupProps.onFocus }\n // `form` reaches the visible input too, which has no `name`: react-aria resets the field on\n // the reset of the input's own form, and a form linked by id is the input's form only then.\n const input = (\n <input\n {...mergeUnhandledProps(\n hasWrapper ? inputProps : mergeProps(inputProps, focusWithin),\n rest,\n TEXT_FIELD_PROPS\n )}\n aria-describedby={describedBy}\n // react-aria's spin button props repeat the native `disabled` and `readOnly` the text\n // field sets; the Nu Html Checker flags the copies.\n aria-disabled={undefined}\n aria-readonly={undefined}\n // The native `required` below says the same.\n aria-required={undefined}\n aria-roledescription={hydrated ? inputProps['aria-roledescription'] : undefined}\n className={classNames(\n hasWrapper ? 'ghost-input' : 'form-input',\n !hasWrapper && size,\n validationClassName(invalid, valid),\n !hasWrapper && className\n )}\n form={form}\n inputMode={hydrated ? inputProps.inputMode : 'numeric'}\n ref={forkedRef}\n // On the visible input, not the hidden one that carries `name`: a hidden input is barred\n // from constraint validation, and this one is empty exactly when the value is. react-aria\n // writes `aria-required` alone, which no form checks.\n required={required || undefined}\n style={hasWrapper ? undefined : style}\n />\n )\n\n // The step buttons sit in their own element: chassis-css styles `.form-input` as disabled when\n // one of its direct children is, and a step button is disabled at `min` or `max`.\n const field = hasWrapper ? (\n <div\n className={classNames('form-input', 'number-field', size, className)}\n style={style}\n {...focusWithin}\n >\n {adornStart}\n {input}\n {adornEnd}\n {stepButtons && (\n <div className=\"number-field-buttons\">\n <StepButton\n buttonProps={incrementButtonProps}\n className=\"number-field-increment\"\n icon={incrementIcon}\n iconKey=\"increment\"\n />\n <StepButton\n buttonProps={decrementButtonProps}\n className=\"number-field-decrement\"\n icon={decrementIcon}\n iconKey=\"decrement\"\n />\n </div>\n )}\n </div>\n ) : (\n input\n )\n\n // The input shows the formatted text; a form receives the number, from a hidden input as\n // react-aria-components' `NumberField` renders it.\n const children = name ? (\n <>\n {field}\n <input\n disabled={disabled || undefined}\n form={form}\n name={name}\n type=\"hidden\"\n value={isNaN(state.numberValue) ? '' : state.numberValue}\n />\n </>\n ) : (\n field\n )\n\n return renderFormField({\n children,\n help,\n ids: { feedback: feedbackId, help: helpId, input: inputId, label: labelId },\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n }\n)\n\nNumberField.displayName = 'NumberField'\n"],"mappings":"A,+nBAgJA,SAASU,EAAW,CAClB,cACA,YACA,OACA,WAMC,CACD,IAAMC,EAAMC,EAA0B,IAAI,EACpC,CAAE,YAAaC,GAAUC,EAAUC,EAAaJ,CAA0C,EAChG,MACE,kBAAA,cAAC,SAAD,CAAQ,GAAIE,EAAkB,YAAgB,KAEtC,EADN,kBAAA,cAACV,EAAD,CAAU,KAAMa,EAAS,SAAUC,CAAO,CAAA,CACpC,CAEZ,CAEA,MAAaC,EAAcC,GAEvB,CACE,WACA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AoB4B,EAASkB,CAAK,EAClC,CAACV,GAAcW,CACjB,EACM,OACN,UAAW3B,EAAWuB,EAAW,UAAY,UAC7C,IAAKxB,EAIL,SAAUW,GAAY,IAAA,GACtB,MAAOM,EAAa,IAAA,GAAYY,CACjC,CAAA,EAKGC,EAAQb,EACZ,kBAAA,cAAC,MAAD,CACE,UAAWhC,EAAW,aAAc,eAAgByC,EAAME,CAAS,EAC5D,QACP,GAAIP,CAqBD,EAnBFF,EACAI,EACAH,EACAF,GACC,kBAAA,cAAC,MAAD,CAAK,UAAU,sBAaV,EAZH,kBAAA,cAAChC,EAAD,CACE,YAAa6C,EACb,UAAU,yBACV,KAAMC,EACN,QAAQ,WACT,CAAA,EACD,kBAAA,cAAC9C,EAAD,CACE,YAAa+C,GACb,UAAU,yBACV,KAAMC,EACN,QAAQ,WACT,CAAA,CACE,CAEJ,EAELX,EAKIY,GAAWC,EACf,kBAAA,cAAApD,EAAA,SAAA,KACG8C,EACD,kBAAA,cAAC,QAAD,CACE,SAAUtB,GAAY,IAAA,GAChB,OACA,OACN,KAAK,SACL,MAAO,MAAMM,EAAM,WAAW,EAAI,GAAKA,EAAM,WAC9C,CAAA,CACD,EAEFgB,EAGF,OAAOlD,EAAgB,CACrB,YACA,OACA,IAAK,CAAE,SAAUyD,GAAY,KAAMC,GAAQ,MAAO/B,EAAS,MAAOgC,EAAQ,EAC1E,UACA,kBACA,QACA,QACA,eACF,CAAC,CACH,CACF,EAEA,EAAY,YAAc,c"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-Bs80iIBN.js";import{t as e}from"./useForkedRef-WoqMqsWE.js";import{t}from"./useControllableState-CPUJxfKW.js";import{t as n}from"./useFormField-q21MOgh8.js";import{t as r}from"./useHeldBack-o-CsPcSe.js";import{t as i}from"./renderFormField-CaZ8-xrn.js";import{t as a}from"./direction-LN6uwsK5.js";import{t as o}from"./validationClassName-gRGs4KBm.js";import s,{Fragment as c,forwardRef as l,useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import m from"classnames";import{mergeProps as h,useFocusRing as g,useObjectRef as _,useTextField as v}from"react-aria";const y=l(({disabled:e,form:t,index:n,invalid:r,mask:i,onChangeValue:a,onFocusBox:c,onKeyDownBox:l,onPasteBox:u,required:d,size:f,valid:p,value:y},b)=>{let x=_(b),{focusProps:S,isFocusVisible:C}=g(),{inputProps:w}=v({"aria-label":`Digit ${n+1}`,autoComplete:n===0||i?`one-time-code`:`off`,isDisabled:e,isInvalid:r,isRequired:d,maxLength:1,onFocus:e=>{e.target.select(),c()},onKeyDown:l,type:i?`password`:`text`,value:y},x);return/* @__PURE__ */ s.createElement(`input`,{...h(w,S),"aria-describedby":void 0,"aria-required":void 0,className:m(`form-input`,f,o(r,p)),"data-focus-visible":C||void 0,form:t,inputMode:`numeric`,onChange:e=>a(e.target.value),onPaste:u,pattern:`\\d*`,ref:x,required:d||void 0})});y.displayName=`OtpBox`;const b=e=>e.replace(/\D/g,``),x=(e,t)=>{let n=[...b(e)].slice(0,t);return Array.from({length:t},(e,t)=>n[t]??``)},S=l(({className:l,defaultValue:h,disabled:g,form:_,groupSizes:v,help:S,id:C,inputGroup:w,invalid:T,invalidFeedback:E,label:D,length:ee=6,mask:O,name:k,onChange:A,onComplete:j,required:te,separator:ne=`–`,size:re,valid:ie,validFeedback:M,value:N,...P},F)=>{let I=v&&v.length>0?v.reduce((e,t)=>e+t,0):ee,[L,R]=t(N,h??``,A),[z,B]=p(null),V=d(()=>z&&z.length===I&&z.join(``)===L?z:x(L,I),[z,L,I]),H=f([]),U=e=>H.current[e]?.focus(),W=f(null),G=e(F,W),{invalid:K,valid:q}=r(W,{invalid:T,valid:ie}),J=f(V);J.current=V;let ae=e=>{let t=J.current,n=t.indexOf(``);n!==-1&&e>n&&t.slice(n).every(e=>!e)&&U(n)},oe=f(N??h??``),Y=f(()=>{});Y.current=()=>{let e=oe.current;B(null),e!==L&&R(e)},u(()=>{let e=H.current[0]?.form;if(!e)return;let t=()=>Y.current();return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)},[_]);let X=e=>{J.current=e;let t=e.join(``);B(e),R(t),e.length===I&&e.every(e=>e!==``)&&j?.(t)},se=(e,t)=>{let n=b(t);if(t!==``&&n===``)return;if(n.length>1){let t=[...n],r=[...V];for(let n=0;n<t.length&&e+n<I;n++)r[e+n]=t[n];X(r),U(Math.min(e+t.length,I-1));return}let r=[...V];r[e]=n,X(r),n&&e<I-1&&U(e+1)},ce=(e,t)=>{if(!g)switch(t.key){case`Backspace`:if(!V[e]&&e>0){t.preventDefault();let n=[...V];n[e-1]=``,X(n),U(e-1)}break;case`Delete`:{t.preventDefault();let n=[...V];for(let t=e;t<I-1;t++)n[t]=n[t+1];n[I-1]=``,X(n);break}case`ArrowLeft`:case`ArrowRight`:{let n=t.key===`ArrowRight`===a(t.currentTarget)?e-1:e+1;n>=0&&n<I&&(t.preventDefault(),U(n));break}}},le=e=>{if(e.preventDefault(),g)return;let t=b(e.clipboardData.getData(`text`)).slice(0,I);t&&(X(x(t,I)),U(Math.min(t.length,I-1)))},Z=(e,t)=>Array.from({length:t},(t,n)=>e+n).map(e=>/* @__PURE__ */ s.createElement(y,{disabled:g,form:_,index:e,invalid:K,key:e,mask:O,onChangeValue:t=>se(e,t),onFocusBox:()=>ae(e),onKeyDownBox:t=>ce(e,t),onPasteBox:le,ref:t=>{H.current[e]=t},required:te,size:re,valid:q,value:V[e]??``})),Q;if(v&&v.length>0){let e=0;Q=v.map((t,n)=>{let r=e;return e+=t,/* @__PURE__ */ s.createElement(c,{key:n},n>0&&/* @__PURE__ */ s.createElement(`span`,{className:`form-otp-separator`},ne),w?/* @__PURE__ */ s.createElement(`div`,{className:`input-group`},Z(r,t)):Z(r,t))})}else Q=Z(0,I);let{describedBy:$,feedbackId:ue,helpId:de,inputId:fe,labelId:pe,labelledBy:me}=n({ariaDescribedBy:P[`aria-describedby`],ariaLabelledBy:P[`aria-labelledby`],help:S,id:C,invalid:K,invalidFeedback:E,label:D,valid:q,validFeedback:M});return i({children:/* @__PURE__ */ s.createElement(`div`,{...P,"aria-describedby":$,"aria-labelledby":me,className:m(`form-otp`,{"input-group":w&&!(v&&v.length>0)},o(K,q),l),id:fe,ref:G,role:`group`},Q,k&&/* @__PURE__ */ s.createElement(`input`,{disabled:g,form:_,name:k,type:`hidden`,value:V.join(``)})),help:S,ids:{feedback:ue,help:de,label:pe},invalid:K,invalidFeedback:E,label:D,valid:q,validFeedback:M})});S.displayName=`OtpInput`;export{S as t};
2
+ //# sourceMappingURL=otp-input-CCkfFZID.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otp-input-CCkfFZID.js","names":["useForkedRef","useFormField","useHeldBack","renderFormField","isRTL","validationClassName","React","classNames","OtpBox","forwardRef","ref","useObjectRef","forwardedRef","useFocusRing","useTextField","index","mask","disabled","invalid","required","event","onFocusBox","onKeyDownBox","mergeProps","inputProps","focusProps","size","valid","isFocusVisible","onChangeValue","onPasteBox","onlyDigits","raw","toBoxes","digits","total","i","OtpInput","invalidProp","validProp","rest","groupSizes","a","b","length","rawValue","setRawValue","useControllableState","value","defaultValue","onChange","typedBoxes","setTypedBoxes","useState","boxes","useMemo","boxRefs","useRef","focusBox","containerRef","forkedRef","latestBoxes","handleFocus","current","firstEmpty","box","initialCode","resetCode","initial","useEffect","owner","onReset","form","commit","nextBoxes","next","onComplete","handleChange","chars","handleKeyDown","nextIndex","handlePaste","renderBoxes","count","start","el","content","cursor","groupSize","Fragment","groupIndex","separator","inputGroup","groupId","describedBy","labelledBy","className","name","feedbackId","helpId","labelId"],"sources":["../../src/components/otp-input/OtpBox.tsx","../../src/components/otp-input/OtpInput.tsx"],"sourcesContent":["import React, { ClipboardEvent, ForwardedRef, forwardRef, KeyboardEvent } from 'react'\nimport classNames from 'classnames'\nimport { mergeProps, useFocusRing, useObjectRef, useTextField } from 'react-aria'\n\nimport { validationClassName } from '../../utils/validationClassName'\n\ninterface OtpBoxProps {\n disabled?: boolean\n form?: string\n index: number\n invalid?: boolean\n mask?: boolean\n onChangeValue: (value: string) => void\n onFocusBox: () => void\n onKeyDownBox: (event: KeyboardEvent<HTMLInputElement>) => void\n onPasteBox: (event: ClipboardEvent<HTMLInputElement>) => void\n required?: boolean\n size?: 'sm' | 'lg'\n valid?: boolean\n value: string\n}\n\nexport const OtpBox = forwardRef(\n (\n {\n disabled,\n form,\n index,\n invalid,\n mask,\n onChangeValue,\n onFocusBox,\n onKeyDownBox,\n onPasteBox,\n required,\n size,\n valid,\n value\n }: OtpBoxProps,\n forwardedRef: ForwardedRef<HTMLInputElement>\n ) => {\n const ref = useObjectRef(forwardedRef)\n const { focusProps, isFocusVisible } = useFocusRing()\n const { inputProps } = useTextField(\n {\n 'aria-label': `Digit ${index + 1}`,\n // Only the first box takes the whole code; the others turn autofill off. Browsers ignore\n // `off` on a password field, though, so a masked box would be offered saved passwords:\n // every masked box says it takes a one-time code instead, the one other value that fits.\n autoComplete: index === 0 || mask ? 'one-time-code' : 'off',\n isDisabled: disabled,\n isInvalid: invalid,\n isRequired: required,\n maxLength: 1,\n // No `onChange` here: react-aria resets each box to its first value on a form reset and\n // reports it there, and each box then wrote itself into the same code. `OtpInput` resets\n // the whole code once; the input's own `onChange` below reports what is typed.\n onFocus: (event) => {\n ;(event.target as HTMLInputElement).select()\n onFocusBox()\n },\n onKeyDown: onKeyDownBox,\n type: mask ? 'password' : 'text',\n value\n },\n ref\n )\n\n return (\n <input\n {...mergeProps(inputProps, focusProps)}\n // The group describes the boxes. react-aria's own ids here are never rendered (FORMS.md,\n // gotcha 6).\n aria-describedby={undefined}\n // The native `required` below says the same.\n aria-required={undefined}\n className={classNames('form-input', size, validationClassName(invalid, valid))}\n data-focus-visible={isFocusVisible || undefined}\n form={form}\n inputMode=\"numeric\"\n onChange={(event) => onChangeValue(event.target.value)}\n onPaste={onPasteBox}\n pattern=\"\\d*\"\n ref={ref}\n // A required code is one with every box filled, so each box is required: a form is held\n // back by the first empty one, which react-aria's listener then focuses. The hidden input\n // that carries `name` is barred from constraint validation (FORMS.md, gotcha 9), and\n // react-aria writes `aria-required` alone, which no form checks.\n required={required || undefined}\n />\n )\n }\n)\n\nOtpBox.displayName = 'OtpBox'\n","import React, {\n ClipboardEvent,\n forwardRef,\n Fragment,\n HTMLAttributes,\n KeyboardEvent,\n ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react'\nimport classNames from 'classnames'\n\nimport { useControllableState, useForkedRef, useFormField, useHeldBack } from '../../hooks'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { renderFormField } from '../form-field/renderFormField'\nimport { OtpBox } from './OtpBox'\nimport { isRTL } from '../../utils/direction'\n\nexport interface OtpInputProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /**\n * Identifies the element that describes the group, e.g. a `FormHelp` help element.\n */\n 'aria-describedby'?: string\n /**\n * An accessible label for the group, used when there's no visible `<label>`.\n */\n 'aria-label'?: string\n /**\n * Identifies a visible `<label>` element for the group.\n */\n 'aria-labelledby'?: string\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * The initial code (uncontrolled), e.g. `\"123\"` for a partially filled code.\n */\n defaultValue?: string\n /**\n * Prevents input and makes every box non-interactive.\n */\n disabled?: boolean\n /**\n * The id of a form elsewhere on the page that the field belongs to: the boxes and the hidden\n * `name` input join it, and a reset of it puts the code back.\n */\n form?: string\n /**\n * Splits the boxes into groups (e.g. `[3, 3]` for a \"123-456\" layout), rendering a\n * `.form-otp-separator` between each group. The total number of boxes becomes the sum of\n * `groupSizes`, overriding `length`.\n */\n groupSizes?: number[]\n /**\n * A description for the field, rendered below the boxes.\n */\n help?: ReactNode\n /**\n * `id` forwarded to the group container.\n */\n id?: string\n /**\n * Visually connects the boxes into a single bordered control. When `groupSizes` is set, each\n * group is connected separately.\n */\n inputGroup?: boolean\n /**\n * Set component validation state to invalid. Left unset, the component shows as invalid by itself\n * from a submit it held back (an empty `required` one, say) until it no longer would, or its\n * form is reset. Set it, to `false` too, and it alone decides.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below the boxes when `invalid` is set, and after a\n * submit the field held back, until it no longer would.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with the group via\n * `aria-labelledby` (there's no single input to target with `htmlFor`).\n */\n label?: ReactNode\n /**\n * Number of digit boxes. Ignored when `groupSizes` is set. Defaults to `6`.\n */\n length?: number\n /**\n * Mask entered digits using `type=\"password\"` boxes.\n */\n mask?: boolean\n /**\n * `name` of an auto-created hidden input kept in sync with the code, for native form\n * submission. Omit to skip creating it.\n */\n name?: string\n /**\n * Callback fired whenever the code changes.\n */\n onChange?: (value: string) => void\n /**\n * Callback fired on each edit that leaves every box filled, so a correction to a complete code\n * fires it again with the new code.\n */\n onComplete?: (value: string) => void\n /**\n * Toggle the required state for the component. Every box is then required: a code with a box\n * left empty holds its form back from submitting, and the first empty box takes focus.\n */\n required?: boolean\n /**\n * Content of the separator rendered between groups when `groupSizes` is set. Defaults to `–`.\n */\n separator?: ReactNode\n /**\n * Size the boxes sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below the boxes when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The code (controlled), digits only, e.g. `\"123456\"`.\n */\n value?: string\n}\n\nconst onlyDigits = (raw: string) => raw.replace(/\\D/g, '')\n\nconst toBoxes = (raw: string, total: number): string[] => {\n const digits = [...onlyDigits(raw)].slice(0, total)\n return Array.from({ length: total }, (_, i) => digits[i] ?? '')\n}\n\nexport const OtpInput = forwardRef<HTMLDivElement, OtpInputProps>(\n (\n {\n className,\n defaultValue,\n disabled,\n form,\n groupSizes,\n help,\n id,\n inputGroup,\n invalid: invalidProp,\n invalidFeedback,\n label,\n length = 6,\n mask,\n name,\n onChange,\n onComplete,\n required,\n separator = '–',\n size,\n valid: validProp,\n validFeedback,\n value,\n ...rest\n }: OtpInputProps,\n ref\n ): ReactNode => {\n const total =\n groupSizes && groupSizes.length > 0 ? groupSizes.reduce((a, b) => a + b, 0) : length\n\n const [rawValue, setRawValue] = useControllableState(value, defaultValue ?? '', onChange)\n // The code is reported as one string of digits, which has no room for a box cleared in the\n // middle: rebuilt from it, every later digit moved one box left. The boxes keep what was typed\n // in them for as long as the code is still theirs, joined; a code from anywhere else (a\n // controlled `value`, a reset) fills them from the first.\n const [typedBoxes, setTypedBoxes] = useState<string[] | null>(null)\n const boxes = useMemo(\n () =>\n typedBoxes && typedBoxes.length === total && typedBoxes.join('') === rawValue\n ? typedBoxes\n : toBoxes(rawValue, total),\n [typedBoxes, rawValue, total]\n )\n\n const boxRefs = useRef<Array<HTMLInputElement | null>>([])\n const focusBox = (index: number) => boxRefs.current[index]?.focus()\n const containerRef = useRef<HTMLDivElement>(null)\n const forkedRef = useForkedRef(ref, containerRef)\n // Shown as invalid from a submit it held back until it no longer would (`useHeldBack`):\n // react-aria cancels the browser's own message, and the form stayed with nothing to say why.\n // The container hears every box.\n const { invalid, valid } = useHeldBack(containerRef, { invalid: invalidProp, valid: validProp })\n\n // The boxes as last committed. A box focused by the handler that committed them (the next box,\n // after a digit) is focused before the render that shows them.\n const latestBoxes = useRef(boxes)\n latestBoxes.current = boxes\n\n // The code is entered from the start: focus on an empty box past its end goes to the first\n // empty one. A box cleared inside the code, and the digits after it, can still be focused.\n const handleFocus = (index: number) => {\n const current = latestBoxes.current\n const firstEmpty = current.indexOf('')\n if (\n firstEmpty !== -1 &&\n index > firstEmpty &&\n current.slice(firstEmpty).every((box) => !box)\n ) {\n focusBox(firstEmpty)\n }\n }\n\n // A form reset puts the code back once, to its first value, controlled or not, as react-aria's\n // fields go back to theirs. Each box restoring its own first digit wrote each into the same\n // stale code, which left one digit short and reported every box.\n const initialCode = useRef(value ?? defaultValue ?? '')\n const resetCode = useRef(() => {})\n resetCode.current = () => {\n const initial = initialCode.current\n setTypedBoxes(null)\n if (initial !== rawValue) setRawValue(initial)\n }\n // The box's form owner: the one around it, or the one its `form` attribute names.\n useEffect(() => {\n const owner = boxRefs.current[0]?.form\n if (!owner) return\n const onReset = () => resetCode.current()\n owner.addEventListener('reset', onReset)\n return () => owner.removeEventListener('reset', onReset)\n }, [form])\n\n const commit = (nextBoxes: string[]) => {\n latestBoxes.current = nextBoxes\n const next = nextBoxes.join('')\n setTypedBoxes(nextBoxes)\n setRawValue(next)\n if (nextBoxes.length === total && nextBoxes.every((box) => box !== '')) {\n onComplete?.(next)\n }\n }\n\n const handleChange = (index: number, raw: string) => {\n const digits = onlyDigits(raw)\n // A key other than a digit does nothing, in a filled box as in an empty one: the box goes\n // back to what it showed.\n if (raw !== '' && digits === '') return\n\n if (digits.length > 1) {\n // Multi-character value landing in a single box (autofill, or a fast typist outrunning\n // the auto-advance) — distribute across this and subsequent boxes, matching chassis-css's\n // vanilla otp-input.js `_handleInput`.\n const chars = [...digits]\n const nextBoxes = [...boxes]\n for (let i = 0; i < chars.length && index + i < total; i++) {\n nextBoxes[index + i] = chars[i]!\n }\n commit(nextBoxes)\n focusBox(Math.min(index + chars.length, total - 1))\n return\n }\n\n const nextBoxes = [...boxes]\n nextBoxes[index] = digits\n commit(nextBoxes)\n if (digits && index < total - 1) focusBox(index + 1)\n }\n\n const handleKeyDown = (index: number, event: KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return\n\n switch (event.key) {\n case 'Backspace': {\n if (!boxes[index] && index > 0) {\n event.preventDefault()\n const nextBoxes = [...boxes]\n nextBoxes[index - 1] = ''\n commit(nextBoxes)\n focusBox(index - 1)\n }\n break\n }\n case 'Delete': {\n event.preventDefault()\n // `boxes` (and every copy derived from it) is always exactly `total` entries long — see\n // `toBoxes` — so `i + 1` (bounded by `i < total - 1`) never reads past the end.\n const nextBoxes = [...boxes]\n for (let i = index; i < total - 1; i++) nextBoxes[i] = nextBoxes[i + 1]!\n nextBoxes[total - 1] = ''\n commit(nextBoxes)\n break\n }\n // Arrow keys move by *visual* direction, so they mirror under RTL: the box to the left of\n // the focused one is the next box, not the previous. `Carousel` and `MenuSubmenu` already\n // mirror their own arrow handling this way; this used to hardcode the LTR mapping and sent\n // an RTL user backwards through the field.\n case 'ArrowLeft':\n case 'ArrowRight': {\n const movesForward = (event.key === 'ArrowRight') !== isRTL(event.currentTarget)\n const nextIndex = movesForward ? index + 1 : index - 1\n if (nextIndex >= 0 && nextIndex < total) {\n event.preventDefault()\n focusBox(nextIndex)\n }\n break\n }\n default:\n break\n }\n }\n\n const handlePaste = (event: ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault()\n if (disabled) return\n const digits = onlyDigits(event.clipboardData.getData('text')).slice(0, total)\n if (!digits) return\n commit(toBoxes(digits, total))\n // The next empty box, as the autofill branch of `handleChange` does: a box selects its\n // content on focus, so on the last filled one the next digit typed would replace it.\n focusBox(Math.min(digits.length, total - 1))\n }\n\n const renderBoxes = (start: number, count: number) =>\n Array.from({ length: count }, (_, i) => start + i).map((i) => (\n <OtpBox\n disabled={disabled}\n form={form}\n index={i}\n invalid={invalid}\n key={i}\n mask={mask}\n onChangeValue={(next) => handleChange(i, next)}\n onFocusBox={() => handleFocus(i)}\n onKeyDownBox={(event) => handleKeyDown(i, event)}\n onPasteBox={handlePaste}\n ref={(el) => {\n boxRefs.current[i] = el\n }}\n required={required}\n size={size}\n valid={valid}\n value={boxes[i] ?? ''}\n />\n ))\n\n let content: ReactNode\n if (groupSizes && groupSizes.length > 0) {\n let cursor = 0\n content = groupSizes.map((groupSize, groupIndex) => {\n const start = cursor\n cursor += groupSize\n return (\n // eslint-disable-next-line react/no-array-index-key\n <Fragment key={groupIndex}>\n {groupIndex > 0 && <span className=\"form-otp-separator\">{separator}</span>}\n {inputGroup ? (\n <div className=\"input-group\">{renderBoxes(start, groupSize)}</div>\n ) : (\n renderBoxes(start, groupSize)\n )}\n </Fragment>\n )\n })\n } else {\n content = renderBoxes(0, total)\n }\n\n const {\n describedBy,\n feedbackId,\n helpId,\n inputId: groupId,\n labelId,\n labelledBy\n } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n ariaLabelledBy: rest['aria-labelledby'],\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n\n return renderFormField({\n children: (\n <div\n {...rest}\n aria-describedby={describedBy}\n aria-labelledby={labelledBy}\n className={classNames(\n 'form-otp',\n { 'input-group': inputGroup && !(groupSizes && groupSizes.length > 0) },\n validationClassName(invalid, valid),\n className\n )}\n id={groupId}\n ref={forkedRef}\n role=\"group\"\n >\n {content}\n {name && (\n <input\n disabled={disabled}\n form={form}\n name={name}\n type=\"hidden\"\n value={boxes.join('')}\n />\n )}\n </div>\n ),\n help,\n ids: { feedback: feedbackId, help: helpId, label: labelId },\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n }\n)\n\nOtpInput.displayName = 'OtpInput'\n"],"mappings":"A,qlBAsBA,MAAaQ,EAASC,GAElB,CACE,WACA,OACA,QACA,UACA,OACA,gBACA,aACA,eACA,aACA,WACA,OACA,QACA,SAEF,IACG,CACH,IAAMC,EAAMC,EAAaC,CAAY,EAC/B,CAAE,aAAY,kBAAmBC,EAAa,EAC9C,CAAE,cAAeC,EACrB,CACE,aAAc,SAASC,EAAQ,IAI/B,aAAcA,IAAU,GAAKC,EAAO,gBAAkB,MACtD,WAAYC,EACZ,UAAWC,EACX,WAAYC,EACZ,UAAW,EAIX,QAAU,GAAU,CACjBC,EAAO,OAA4B,OAAO,EAC3CC,EAAW,CACb,EACA,UAAWC,EACX,KAAMN,EAAO,WAAa,OAC1B,OACF,EACAN,CACF,EAEA,MACE,kBAAA,cAAC,QAAD,CACE,GAAIa,EAAWC,EAAYC,CAAU,EAGrC,mBAAkB,IAAA,GAElB,gBAAe,IAAA,GACf,UAAWlB,EAAW,aAAcmB,EAAMrB,EAAoBa,EAASS,CAAK,CAAC,EAC7E,qBAAoBC,GAAkB,IAAA,GAChC,OACN,UAAU,UACV,SAAW,GAAUC,EAAcT,EAAM,OAAO,KAAK,EACrD,QAASU,EACT,QAA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,MAAO3C,EAAM,KAAK,EAAE,CACrB,CAAA,CAEA,EAEP,OACA,IAAK,CAAE,SAAU4C,GAAY,KAAMC,GAAQ,MAAOC,EAAQ,EAC1D,UACA,kBACA,QACA,QACA,eACF,CAAC,CACH,CACF,EAEA,EAAS,YAAc,W"}
@@ -0,0 +1,2 @@
1
+ import{useEffect as e,useRef as t,useState as n}from"react";const r=e=>e.closest(`dialog[open]`)??document.body;function i({close:i,isOpen:a,onHide:o,onShow:s,triggerRef:c}){let[l,u]=n(null);a&&!l?.open&&c.current?u({container:r(c.current),open:!0}):!a&&l?.open&&u({container:l.container,open:!1}),e(()=>{let e=c.current;if(!a||!e)return;let t=r(e);u(e=>e?.open&&e.container===t?e:{container:t,open:!0})},[a]);let d=t(a);e(()=>{d.current!==a&&(d.current=a,a?s?.():o?.())},[a]);let f=a&&!l?.open?null:l?.container??null,p=t(i);return p.current=i,e(()=>{let e=f?.closest(`dialog`);if(!a||!e)return;let t=()=>{e.open||p.current()};return e.addEventListener(`close`,t),()=>e.removeEventListener(`close`,t)},[a,f]),f}function a(e){return{position:`absolute`,...e.style,transform:e.style?.top===void 0?`translateX(-50%)`:`translateY(-50%)`}}function o(e){return e===`entering`||e===`entered`?`fade show`:`fade`}const s={top:`top`,"top-start":`top start`,"top-end":`top end`,bottom:`bottom`,"bottom-start":`bottom start`,"bottom-end":`bottom end`,left:`left`,"left-start":`left top`,"left-end":`left bottom`,right:`right`,"right-start":`right top`,"right-end":`right bottom`},c=e=>s[e],l=(e,t)=>{if(!t||t===`center`)return e;let n=e.split(`-`)[1];return n?`${t}-${n}`:t},u=(e,t,n)=>({menuStyle:{position:e?.position,top:e?.top,left:e?.left},placementAttr:l(t,n)}),d={"--cx-menu-max-height":`320px`,"--cx-menu-overflow-y":`auto`};export{a,c as i,l as n,o,u as r,i as s,d as t};
2
+ //# sourceMappingURL=overlayPlacement-D2vfhhg3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlayPlacement-D2vfhhg3.js","names":["resolvePortalContainer","trigger","useFloatingOverlay","portal","setPortal","useState","isOpen","triggerRef","useEffect","container","current","reportedOpenRef","useRef","onShow","onHide","portalContainer","closeRef","close","dialog","handleClose","getOverlayArrowStyle","arrowProps","getOverlayTransitionClass","phase","ARIA_PLACEMENT","toAriaPlacement","placement","resolveDataPlacement","resolvedMain","requested","cross","resolveMenuOverlayPositioning","overlayStyle","requestedPlacement","resolvedPlacement","COMBOBOX_MENU_OVERLAY_STYLE"],"sources":["../../src/hooks/useFloatingOverlay.ts","../../src/utils/overlayPlacement.ts"],"sourcesContent":["import { CSSProperties, HTMLAttributes, RefObject, useEffect, useRef, useState } from 'react'\n\nimport { TransitionPhase } from './useTransitionState'\n\nexport interface UseFloatingOverlayOptions {\n /**\n * Imperatively closes the overlay — called when the containing `<dialog>` fires its native\n * `close` event. Pass a stable callback (e.g. the trigger state's own `close`) where possible;\n * an inline arrow is fine too, since only its latest value is ever invoked.\n */\n close: () => void\n /**\n * Whether the overlay is currently open — drives `onShow`/`onHide` and portal-container\n * resolution.\n */\n isOpen: boolean\n onHide?: () => void\n onShow?: () => void\n /**\n * Ref to the element that triggers the overlay, used to resolve which `<dialog>` (if any) it\n * lives inside.\n */\n triggerRef: RefObject<HTMLElement | null>\n}\n\n// The open dialog a trigger is in, where its overlay is portaled, so it renders in that dialog's\n// top layer and closes with it. `document.body` otherwise.\nconst resolvePortalContainer = (trigger: HTMLElement): Element =>\n trigger.closest('dialog[open]') ?? document.body\n\n/**\n * Shared portal-container/visibility wiring for `Popover` and `Tooltip`: resolves the `<dialog>`\n * a trigger lives inside (if any), `null` while an open overlay's isn't known yet, fires `onShow`/`onHide`, and resets on the containing dialog's\n * native `close` event. The open state itself is the trigger state's, which each component builds\n * from `visible`/`defaultVisible`/`onVisibleChange` (`toOpenStateProps`). Positioning-specific\n * concerns (placement, arrow, escape/outside-click dismissal) stay in each component.\n */\nexport function useFloatingOverlay({\n close,\n isOpen,\n onHide,\n onShow,\n triggerRef\n}: UseFloatingOverlayOptions): Element | null {\n // The container, and whether it was resolved for the open that is current.\n const [portal, setPortal] = useState<{ container: Element; open: boolean } | null>(null)\n\n // Resolved in the render that opens the overlay, while the trigger the user pressed is in the\n // DOM, so the panel mounts straight into its container. A passive effect resolved it after the\n // panel had mounted into `document.body`: inside a dialog the panel then mounted a second time,\n // its effects ran twice, its state was lost and its first fade with it.\n if (isOpen && !portal?.open && triggerRef.current) {\n setPortal({ container: resolvePortalContainer(triggerRef.current), open: true })\n } else if (!isOpen && portal?.open) {\n setPortal({ container: portal.container, open: false })\n }\n\n // Checked again once the commit is done, after the layout effects that open dialogs: an overlay\n // mounted open has no trigger element in its first render, and one opened in the same commit\n // as the dialog around it found that dialog still closed. Only these move the panel. An overlay\n // waits for its container (`null` while open), so one mounted open mounts its panel once too.\n useEffect(() => {\n const trigger = triggerRef.current\n if (!isOpen || !trigger) return\n const container = resolvePortalContainer(trigger)\n setPortal((current) =>\n current?.open && current.container === container ? current : { container, open: true }\n )\n }, [isOpen])\n\n // `onShow`/`onHide` report changes of the open state, against the value of the last run: not\n // the first commit (mounting closed is not a hide, mounting open not a show), and not\n // StrictMode's second run of the effect on mount, which a `mounted` flag let through.\n const reportedOpenRef = useRef(isOpen)\n useEffect(() => {\n if (reportedOpenRef.current === isOpen) return\n reportedOpenRef.current = isOpen\n if (isOpen) onShow?.()\n else onHide?.()\n }, [isOpen])\n\n // `null` while the container of the current open isn't known yet. Kept through the exit, so a\n // closing panel stays where it is.\n const portalContainer = isOpen && !portal?.open ? null : (portal?.container ?? null)\n\n // `close` is read through a ref so this effect only re-subscribes when `isOpen`/\n // `portalContainer` actually change, regardless of whether the caller passes a stable\n // callback or a fresh inline arrow each render.\n const closeRef = useRef(close)\n closeRef.current = close\n\n // A dialog fires a native `close` event on ESC, backdrop click, or `.close()`, so resetting\n // on it keeps a reopened dialog from showing a stale, already-open overlay. The event comes\n // from a task the browser queues: a dialog that is open again by then has not closed, and an\n // overlay opened in it stays (`useDialogElement`'s `handleNativeClose`).\n useEffect(() => {\n const dialog = portalContainer?.closest('dialog')\n if (!isOpen || !dialog) return\n\n const handleClose = () => {\n if (!dialog.open) closeRef.current()\n }\n dialog.addEventListener('close', handleClose)\n return () => dialog.removeEventListener('close', handleClose)\n }, [isOpen, portalContainer])\n\n return portalContainer\n}\n\n// `useOverlayPosition`'s `arrowProps.style` sets a single cross-axis offset (`top` for a\n// left/right overlay, `left` for a top/bottom one) to the trigger's center point, not the arrow\n// element's top-left corner — so it must be recentered by half the arrow's own size on that\n// axis. Chassis-css's JS plugin never has this problem since Floating UI's `arrow` middleware\n// returns a top-left-corner coordinate directly; react-aria's is center-based. Unlike the\n// chassis-css JS plugin, react-aria also never sets `position: absolute` on the arrow element\n// itself, so without it the offset has no effect and the arrow renders in normal document flow.\nexport function getOverlayArrowStyle(arrowProps: HTMLAttributes<HTMLDivElement>): CSSProperties {\n return {\n position: 'absolute',\n ...arrowProps.style,\n transform: arrowProps.style?.top !== undefined ? 'translateY(-50%)' : 'translateX(-50%)'\n }\n}\n\n// Mounted without `show`, shown once those styles are computed, and without it again for as\n// long as the exit lasts: chassis-css's `.fade` transitions the opacity between the two.\nexport function getOverlayTransitionClass(phase: TransitionPhase): string {\n return phase === 'entering' || phase === 'entered' ? 'fade show' : 'fade'\n}\n","import type { CSSProperties } from 'react'\nimport type { Placement as AriaPlacement, PlacementAxis } from 'react-aria'\n\n// Chassis CSS's floating components (`.menu`, `.tooltip`, `.popover`) read a `data-cx-placement`\n// attribute in this hyphenated, compound form (`\"bottom-end\"`, `\"top-start\"`, ...) to pick the\n// right transform-origin for the open/close animation. React Aria's `useOverlayPosition` speaks a\n// different, space-separated placement vocabulary (`\"bottom end\"`) and only reports back the\n// resolved main axis after flipping, not the full compound value — this module bridges the two.\nexport type Placement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n\nconst ARIA_PLACEMENT: Record<Placement, AriaPlacement> = {\n top: 'top',\n 'top-start': 'top start',\n 'top-end': 'top end',\n bottom: 'bottom',\n 'bottom-start': 'bottom start',\n 'bottom-end': 'bottom end',\n left: 'left',\n 'left-start': 'left top',\n 'left-end': 'left bottom',\n right: 'right',\n 'right-start': 'right top',\n 'right-end': 'right bottom'\n}\n\n// Translates chassis-react's public `placement` prop values into the strings\n// `useOverlayPosition` expects.\nexport const toAriaPlacement = (placement: Placement): AriaPlacement => ARIA_PLACEMENT[placement]\n\n// `useOverlayPosition`'s own `shouldFlip` only ever swaps the main axis (top<->bottom or\n// left<->right) — it never changes the requested cross-axis alignment — so the resolved compound\n// value is always the requested cross-axis suffix reattached to the (possibly flipped) main axis\n// `useOverlayPosition` reports back.\nexport const resolveDataPlacement = (\n requested: Placement,\n resolvedMain: PlacementAxis | null\n): string => {\n if (!resolvedMain || resolvedMain === 'center') return requested\n const cross = requested.split('-')[1]\n return cross ? `${resolvedMain}-${cross}` : resolvedMain\n}\n\n// Shared between `Menu`/`MenuSubmenu` and `Combobox`/`Autocomplete`, whose floating panels all\n// position via `useOverlayPosition` the same way: only `position`/`top`/`left` are taken from the\n// hook's computed style (`zIndex`/`maxHeight` stay owned by chassis-css's own `--zindex`/\n// `--max-height` tokens, see `_menu.scss`; the inline `max-height` the hook writes on the element\n// itself is kept by `useOverlayMaxHeight` only where it is smaller than that cap), and\n// `data-cx-placement` needs the resolved main axis reattached to the originally-requested\n// cross-axis alignment. Pure positioning that renders\n// nothing and belongs to none of the four, so it lives here and not in `components/menu/`.\nexport interface MenuOverlayPositioning {\n menuStyle: CSSProperties\n placementAttr: string\n}\n\nexport const resolveMenuOverlayPositioning = (\n overlayStyle: CSSProperties | undefined,\n requestedPlacement: Placement,\n resolvedPlacement: PlacementAxis | null\n): MenuOverlayPositioning => ({\n menuStyle: {\n position: overlayStyle?.position,\n top: overlayStyle?.top,\n left: overlayStyle?.left\n },\n placementAttr: resolveDataPlacement(requestedPlacement, resolvedPlacement)\n})\n\n// chassis-css's `.combobox + .menu` sibling-selector rule (`_combobox.scss`) sets\n// `--cx-menu-max-height`/`--cx-menu-overflow-y` from `$combobox-menu-max-height`/\n// `$combobox-menu-overflow-y` (320px/auto by default) — but only while the panel is an adjacent\n// DOM sibling of `.combobox`. `Autocomplete`/`Combobox` portal their panel to `document.body` (or\n// an enclosing open `<dialog>`, via `useFloatingOverlay`), breaking that adjacency, so both inline\n// this as a fallback matching the shipped Sass defaults instead of the generic, uncapped `.menu`\n// fallback (`max-height: none`). The names carry the `cx-` prefix of chassis-css's built CSS:\n// unprefixed, as they were, nothing read them, and only the inline `max-height` react-aria wrote\n// (`useOverlayMaxHeight`) capped the list. A consumer who customized either Sass variable needs to\n// re-override `--cx-menu-max-height`/`--cx-menu-overflow-y` on `.menu` directly, since the\n// sibling-selector auto-application can no longer reach a portaled panel.\nexport const COMBOBOX_MENU_OVERLAY_STYLE: CSSProperties = {\n '--cx-menu-max-height': '320px',\n '--cx-menu-overflow-y': 'auto'\n} as CSSProperties\n"],"mappings":"A,4DA2BA,MAAMA,EAA0B,GAC9BC,EAAQ,QAAQ,cAAc,GAAK,SAAS,KAS9C,SAAgBC,EAAmB,CACjC,QACA,SACA,SACA,SACA,cAC4C,CAE5C,GAAM,CAACC,EAAQC,GAAaC,EAAuD,IAAI,EAMnFC,GAAU,CAACH,GAAQ,MAAQI,EAAW,QACxCH,EAAU,CAAE,UAAWJ,EAAuBO,EAAW,OAAO,EAAG,KAAM,EAAK,CAAC,EACtE,CAACD,GAAUH,GAAQ,MAC5BC,EAAU,CAAE,UAAWD,EAAO,UAAW,KAAM,EAAM,CAAC,EAOxDK,MAAgB,CACd,IAAMP,EAAUM,EAAW,QAC3B,GAAI,CAACD,GAAU,CAACL,EAAS,OACzB,IAAMQ,EAAYT,EAAuBC,CAAO,EAChDG,EAAW,GACTM,GAAS,MAAQA,EAAQ,YAAcD,EAAYC,EAAU,CAAE,YAAW,KAAM,EAAK,CACv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B,IAAKA,GAAc,IACnB,KAAMA,GAAc,IACtB,EACA,cAAeL,EAAqBM,EAAoBC,CAAiB,CAC3E,GAaaC,EAA6C,CACxD,uBAAwB,QACxB,uBAAwB,MAC1B,E"}
@@ -1,2 +1,2 @@
1
- import"./focus-ring-Bs80iIBN.js";import{f as e,m as t,v as n}from"./slot-BQVx1Eew.js";import{t as r}from"./polymorphic-CZIFszAy.js";import{t as i}from"./useButtonSemantics-B1SbGaDO.js";import{t as a}from"./focusRedirect-CrBl4p_n.js";import{t as o}from"./iconSlot-DU_WcSL_.js";import s,{forwardRef as c,useEffect as l,useRef as u}from"react";import d from"classnames";import{mergeProps as f}from"react-aria";function p({prevDisabled:e,nextDisabled:t,onPrev:n,onNext:r}){let i=u(null),o=u(null),s=u(null);return l(()=>{let n=s.current;s.current=null,n&&(n.from===`prev`&&e?a(o.current,n.viaPointer):n.from===`next`&&t&&a(i.current,n.viaPointer))}),{prevRef:i,nextRef:o,handlePrevClick:e=>{s.current={from:`prev`,viaPointer:e.detail!==0},n()},handleNextClick:e=>{s.current={from:`next`,viaPointer:e.detail!==0},r()}}}function m({active:r,children:a,className:o,component:c,disabled:l,href:u,onClick:p,...m},h){let g=d(`pagination-item`,{active:r,disabled:l},o),_=t(c,u,`button`),v=n(_,u,m),y=e(v,u,`PaginationItem`),b=_,x=_,S=e=>{v===`anchor`&&l?e.preventDefault():p?.(e)},C=v!==`button`&&v!==`anchor`&&!!p,{buttonProps:w,forkedRef:T}=i(h,{disabled:l,onClick:p}),E=r?{"aria-current":`page`}:{};return/* @__PURE__ */ s.createElement(`li`,{className:g},v===`button`?/* @__PURE__ */ s.createElement(b,{...m,className:`pagination-link`,type:`button`,disabled:l,onClick:S,...E,ref:h},a):v===`anchor`?/* @__PURE__ */ s.createElement(x,{...m,className:`pagination-link`,...y,onClick:S,...l&&{"aria-disabled":!0,tabIndex:-1},...E,ref:h},a):/* @__PURE__ */ s.createElement(_,{className:`pagination-link`,...f(m,C?w:{}),...!C&&{onClick:S},...y,...E,ref:C?T:h},a))}const h=r(m,`PaginationItem`),g={start:`justify-content-start`,center:`justify-content-center`,end:`justify-content-end`};function _(e,t,n){let r=Math.max(1,n);if(t<=r)return Array.from({length:t},(e,t)=>t+1);let i=Math.floor(r/2),a=Math.max(1,e-i),o=Math.min(t,a+r-1);o-a<r-1&&(a=Math.max(1,o-r+1));let s=[];a>1&&(s.push(1),a>2&&s.push(`...`));for(let e=a;e<=o;e++)s.push(e);return o<t&&(o<t-1&&s.push(`...`),s.push(t)),s}const v=c(({activePage:e=1,align:t,"aria-label":n=`Pagination`,children:r,className:i,maxVisiblePages:a=5,nextIcon:c,nextLabel:l=`Next`,onActivePageChange:u,pages:f,previousIcon:m,previousLabel:v=`Previous`,showPageNumbers:y=!0,showPrevNext:b=!0,size:x,...S},C)=>{let w=d(`pagination`,x,t&&g[t],i),T=f!=null,E=T?Math.min(Math.max(e,1),f):e,D=T?E<=1:!1,O=T?E>=f:!1,{prevRef:k,nextRef:A,handlePrevClick:j,handleNextClick:M}=p({prevDisabled:D,nextDisabled:O,onPrev:()=>u&&u(E-1),onNext:()=>u&&u(E+1)}),N=T?/* @__PURE__ */ s.createElement(s.Fragment,null,b&&/* @__PURE__ */ s.createElement(h,{ref:k,disabled:D,onClick:j,"aria-label":v},/* @__PURE__ */ s.createElement(o,{icon:`previous`,override:m,className:`directional-icon`})),y&&_(E,f,a).map((e,t)=>e===`...`?/* @__PURE__ */ s.createElement(h,{key:`ellipsis-${t}`,disabled:!0,component:`span`,"aria-hidden":`true`},`…`):/* @__PURE__ */ s.createElement(h,{key:e,active:e===E,onClick:()=>u&&u(e)},e)),b&&/* @__PURE__ */ s.createElement(h,{ref:A,disabled:O,onClick:M,"aria-label":l},/* @__PURE__ */ s.createElement(o,{icon:`next`,override:c,className:`directional-icon`}))):null;return/* @__PURE__ */ s.createElement(`nav`,{"aria-label":n,ref:C,...S},/* @__PURE__ */ s.createElement(`ul`,{className:w},N??r))});v.displayName=`Pagination`;export{h as n,p as r,v as t};
2
- //# sourceMappingURL=pagination-Dvz8lccd.js.map
1
+ import"./focus-ring-Bs80iIBN.js";import{f as e,m as t,v as n}from"./slot-DagH0Gxq.js";import{t as r}from"./polymorphic-mAKwlLiW.js";import{n as i}from"./useButtonSemantics-DN3OIXtG.js";import{t as a}from"./focusRedirect-CrBl4p_n.js";import{t as o}from"./iconSlot-DU_WcSL_.js";import s,{forwardRef as c,useEffect as l,useRef as u}from"react";import d from"classnames";import{mergeProps as f}from"react-aria";function p({prevDisabled:e,nextDisabled:t,onPrev:n,onNext:r}){let i=u(null),o=u(null),s=u(null);return l(()=>{let n=s.current;s.current=null,n&&(n.from===`prev`&&e?a(o.current,n.viaPointer):n.from===`next`&&t&&a(i.current,n.viaPointer))}),{prevRef:i,nextRef:o,handlePrevClick:e=>{s.current={from:`prev`,viaPointer:e.detail!==0},n()},handleNextClick:e=>{s.current={from:`next`,viaPointer:e.detail!==0},r()}}}function m({active:r,children:a,className:o,component:c,disabled:l,href:u,onClick:p,...m},h){let g=d(`pagination-item`,{active:r,disabled:l},o),_=t(c,u,`button`),v=n(_,u,m),y=e(v,u,`PaginationItem`),b=_,x=_,S=e=>{v===`anchor`&&l?e.preventDefault():p?.(e)},C=v!==`button`&&v!==`anchor`&&!!p,{buttonProps:w,forkedRef:T}=i(h,{disabled:l,onClick:p}),E=r?{"aria-current":`page`}:{};return/* @__PURE__ */ s.createElement(`li`,{className:g},v===`button`?/* @__PURE__ */ s.createElement(b,{...m,className:`pagination-link`,type:`button`,disabled:l,onClick:S,...E,ref:h},a):v===`anchor`?/* @__PURE__ */ s.createElement(x,{...m,className:`pagination-link`,...y,onClick:S,...l&&{"aria-disabled":!0,tabIndex:-1},...E,ref:h},a):/* @__PURE__ */ s.createElement(_,{className:`pagination-link`,...f(m,C?w:{}),...!C&&{onClick:S},...y,...E,ref:C?T:h},a))}const h=r(m,`PaginationItem`),g={start:`justify-content-start`,center:`justify-content-center`,end:`justify-content-end`};function _(e,t,n){let r=Math.max(1,n);if(t<=r)return Array.from({length:t},(e,t)=>t+1);let i=Math.floor(r/2),a=Math.max(1,e-i),o=Math.min(t,a+r-1);o-a<r-1&&(a=Math.max(1,o-r+1));let s=[];a>1&&(s.push(1),a>2&&s.push(`...`));for(let e=a;e<=o;e++)s.push(e);return o<t&&(o<t-1&&s.push(`...`),s.push(t)),s}const v=c(({activePage:e=1,align:t,"aria-label":n=`Pagination`,children:r,className:i,listClassName:a,maxVisiblePages:c=5,nextIcon:l,nextLabel:u=`Next`,onActivePageChange:f,pages:m,previousIcon:v,previousLabel:y=`Previous`,showPageNumbers:b=!0,showPrevNext:x=!0,size:S,...C},w)=>{let T=d(`pagination`,S,t&&g[t],a),E=m!=null,D=E?Math.min(Math.max(e,1),m):e,O=E?D<=1:!1,k=E?D>=m:!1,{prevRef:A,nextRef:j,handlePrevClick:M,handleNextClick:N}=p({prevDisabled:O,nextDisabled:k,onPrev:()=>f&&f(D-1),onNext:()=>f&&f(D+1)}),P=E?/* @__PURE__ */ s.createElement(s.Fragment,null,x&&/* @__PURE__ */ s.createElement(h,{ref:A,disabled:O,onClick:M,"aria-label":y},/* @__PURE__ */ s.createElement(o,{icon:`previous`,override:v,className:`directional-icon`})),b&&_(D,m,c).map((e,t)=>e===`...`?/* @__PURE__ */ s.createElement(h,{key:`ellipsis-${t}`,disabled:!0,component:`span`,"aria-hidden":`true`},`…`):/* @__PURE__ */ s.createElement(h,{key:e,active:e===D,onClick:()=>f&&f(e)},e)),x&&/* @__PURE__ */ s.createElement(h,{ref:j,disabled:k,onClick:N,"aria-label":u},/* @__PURE__ */ s.createElement(o,{icon:`next`,override:l,className:`directional-icon`}))):null;return/* @__PURE__ */ s.createElement(`nav`,{"aria-label":n,className:i,ref:w,...C},/* @__PURE__ */ s.createElement(`ul`,{className:T},P??r))});v.displayName=`Pagination`;export{h as n,p as r,v as t};
2
+ //# sourceMappingURL=pagination-WINUPT_P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination-WINUPT_P.js","names":["hrefProps","linkElement","resolveLinkKind","createPolymorphicComponent","useButtonSemantics","focusRedirect","IconSlot","React","classNames","usePagination","prevRef","useRef","nextRef","pending","useEffect","from","prevDisabled","nextDisabled","event","onPrev","onNext","PaginationItemRender","rest","_className","className","Component","component","href","kind","linkProps","NativeButton","Anchor","handleClick","disabled","onClick","needsButtonSemantics","ref","currentProps","active","children","mergeProps","buttonProps","forkedRef","PaginationItem","ALIGN_CLASS_NAMES","getPageRange","safeMaxVisible","maxVisible","pages","i","half","start","activePage","end","result","Pagination","forwardRef","ariaLabel","_listClassName","size","align","listClassName","isSmart","clampedActivePage","onActivePageChange","smartContent","showPrevNext","handlePrevClick","previousLabel","previousIcon","showPageNumbers","maxVisiblePages","page","idx","handleNextClick","nextLabel","nextIcon"],"sources":["../../src/hooks/usePagination.ts","../../src/components/pagination/PaginationItem.tsx","../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import { MouseEvent, RefObject, useEffect, useRef } from 'react'\n\nimport { focusRedirect } from '../utils/focusRedirect'\n\nexport interface UsePaginationOptions {\n /**\n * Whether the Previous control is currently disabled.\n */\n prevDisabled: boolean\n /**\n * Whether the Next control is currently disabled.\n */\n nextDisabled: boolean\n /**\n * Called when Previous is clicked, before the state change that may disable it.\n */\n onPrev: () => void\n /**\n * Called when Next is clicked, before the state change that may disable it.\n */\n onNext: () => void\n}\n\nexport interface UsePaginationResult<T extends HTMLElement = HTMLButtonElement> {\n // `RefObject<T | null>`, not `RefObject<T>`: these come from `useRef<T>(null)`, so `.current`\n // really is null before mount (and whenever the control isn't rendered — a hand-composed\n // pagination may omit Prev/Next entirely). Declaring the non-null form let a consumer write\n // `prevRef.current.focus()` with no type error and crash at runtime.\n prevRef: RefObject<T | null>\n nextRef: RefObject<T | null>\n handlePrevClick: (event: MouseEvent<T>) => void\n handleNextClick: (event: MouseEvent<T>) => void\n}\n\ninterface Pending {\n from: 'prev' | 'next'\n // A `click` fired by real pointer activation has `detail >= 1`; one fired by keyboard\n // activation (Enter/Space on a focused button) has `detail === 0`.\n viaPointer: boolean\n}\n\n// Native `disabled` buttons are blurred by the browser the instant they're disabled. Clicking a\n// Prev/Next control into the first/last page disables that very control, silently dropping focus\n// to `<body>`. Wire `handlePrevClick`/`handleNextClick` up as each control's `onClick` — they call\n// `onPrev`/`onNext` and redirect focus to the still-enabled sibling in one step, so callers don't\n// hand-wrap their own click handler around a separate mark-then-focus call.\n// Works for `Pagination`'s built-in smart mode and for hand-composed Prev/Next controls alike —\n// pass the element type of whatever you're attaching the refs to (`PaginationItem` defaults to\n// an `HTMLButtonElement`, but renders an `HTMLAnchorElement` when given `href` or `component`).\nexport function usePagination<T extends HTMLElement = HTMLButtonElement>({\n prevDisabled,\n nextDisabled,\n onPrev,\n onNext\n}: UsePaginationOptions): UsePaginationResult<T> {\n const prevRef = useRef<T>(null)\n const nextRef = useRef<T>(null)\n const pending = useRef<Pending | null>(null)\n\n // Deliberately no dependency array: this must run after every render, not just ones where\n // prevDisabled/nextDisabled change value. A Prev/Next click that doesn't cross a boundary\n // (e.g. moving between two enabled middle pages) leaves both booleans unchanged, so a\n // dependency-gated effect would skip and leave `pending` stale — a later, unrelated render\n // that does flip one of the booleans (e.g. jumping straight to the first/last page via a\n // page-number click) would then wrongly consume that stale mark and redirect focus.\n useEffect(() => {\n const from = pending.current\n pending.current = null\n if (!from) return\n if (from.from === 'prev' && prevDisabled) {\n focusRedirect(nextRef.current, from.viaPointer)\n } else if (from.from === 'next' && nextDisabled) {\n focusRedirect(prevRef.current, from.viaPointer)\n }\n })\n\n return {\n prevRef,\n nextRef,\n handlePrevClick: (event) => {\n pending.current = { from: 'prev', viaPointer: event.detail !== 0 }\n onPrev()\n },\n handleNextClick: (event) => {\n pending.current = { from: 'next', viaPointer: event.detail !== 0 }\n onNext()\n }\n }\n}\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n Ref\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps } from 'react-aria'\n\nimport { useButtonSemantics } from '../../hooks'\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype PaginationItemOwnProps<C extends ElementType> = {\n /**\n * Toggle the active state for the component.\n */\n active?: boolean\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. When provided the item renders as an `<a>` tag; otherwise as a `<button>`.\n */\n href?: string\n}\n\nexport type PaginationItemProps<C extends ElementType = 'button'> = PolymorphicComponentProps<\n C,\n PaginationItemOwnProps<C>\n>\n\ntype PaginationItemComponent = (<C extends ElementType = 'button'>(\n props: PaginationItemProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLButtonElement | HTMLAnchorElement | HTMLSpanElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction PaginationItemRender<C extends ElementType = 'button'>(\n {\n active,\n children,\n className,\n component,\n disabled,\n href,\n onClick,\n ...rest\n }: PaginationItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n const _className = classNames(\n 'pagination-item',\n {\n active,\n disabled\n },\n className\n )\n\n // The active page keeps whatever element it would render anyway (`<button>`, or `<a>` when\n // given `href`) rather than collapsing to a `<span>`. Swapping the tag on activation made React\n // unmount the focused control and mount a different element in its place, so a keyboard user who\n // activated a page was dropped to `<body>` and had to tab in from the top of the document again\n // (WCAG 2.4.3). The `<span>` wasn't even inert: `Pagination`'s smart mode passes an `onClick`,\n // so `useButtonSemantics` gave it `role=\"button\"` and `tabIndex={0}` — a synthetic button,\n // strictly worse than the real one it replaced. Styling is unaffected either way: chassis-css\n // matches `.pagination-link { &.active, .active > & }`, and `active` still lands on the `<li>`.\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. Each branch below\n // renders `Component` typed as its tag, which is the tag itself or that `Slot`.\n const kind = resolveLinkKind(Component, href, rest)\n // A router link as `component` takes `href` too; it used to get none.\n const linkProps = hrefProps(kind, href, 'PaginationItem')\n const NativeButton = Component as 'button'\n const Anchor = Component as 'a'\n\n // `<a>` has no real `disabled` attribute, so a disabled anchor pagination item still fires\n // click (and still navigates) unless it's blocked here, same guard `Button` applies.\n const handleClick = (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (kind === 'anchor' && disabled) {\n event.preventDefault()\n return\n }\n onClick?.(event as never)\n }\n\n // A custom `component`/default (non-`button`/`a`) branch gets a raw `onClick` with no keyboard\n // semantics otherwise — the same gap `Link` fills via `useButtonSemantics`.\n const needsButtonSemantics = kind !== 'button' && kind !== 'anchor' && !!onClick\n const { buttonProps, forkedRef } = useButtonSemantics<HTMLElement>(ref as Ref<HTMLElement>, {\n disabled,\n onClick: onClick as MouseEventHandler<HTMLElement> | undefined\n })\n\n // `aria-current=\"page\"` goes on the control itself, not the wrapping `<li>` — that's where the\n // WAI-ARIA pagination pattern puts it, and it's what a screen reader conveys when focus lands on\n // the control. On the `<li>` it was attached to a presentational list item nothing focuses.\n const currentProps = active ? { 'aria-current': 'page' as const } : {}\n\n return (\n <li className={_className}>\n {kind === 'button' ? (\n <NativeButton\n {...(rest as Record<string, unknown>)}\n className=\"pagination-link\"\n type=\"button\"\n disabled={disabled}\n onClick={handleClick}\n {...currentProps}\n ref={ref as Ref<HTMLButtonElement>}\n >\n {children}\n </NativeButton>\n ) : kind === 'anchor' ? (\n <Anchor\n {...(rest as Record<string, unknown>)}\n className=\"pagination-link\"\n {...linkProps}\n onClick={handleClick}\n {...(disabled && { 'aria-disabled': true, tabIndex: -1 })}\n {...currentProps}\n ref={ref as Ref<HTMLAnchorElement>}\n >\n {children}\n </Anchor>\n ) : (\n <Component\n className=\"pagination-link\"\n {...(mergeProps(rest, needsButtonSemantics ? buttonProps : {}) as Record<\n string,\n unknown\n >)}\n {...(!needsButtonSemantics && { onClick: handleClick })}\n {...linkProps}\n {...currentProps}\n ref={needsButtonSemantics ? forkedRef : ref}\n >\n {children}\n </Component>\n )}\n </li>\n )\n}\n\nexport const PaginationItem = createPolymorphicComponent<PaginationItemComponent>(\n PaginationItemRender as ForwardRefRenderFunction<Element, PaginationItemProps<ElementType>>,\n 'PaginationItem'\n)\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../icon/iconSlot'\nimport classNames from 'classnames'\n\nimport { PaginationItem } from './PaginationItem'\nimport { usePagination } from '../../hooks'\n\n// Whole class names, not `justify-content-${align}`: see `utils/colorClassNames.ts`.\nconst ALIGN_CLASS_NAMES: Record<NonNullable<PaginationProps['align']>, string> = {\n start: 'justify-content-start',\n center: 'justify-content-center',\n end: 'justify-content-end'\n}\n\nexport interface PaginationProps extends HTMLAttributes<HTMLElement> {\n /**\n * Current active page (1-indexed). Used with `pages` for data-driven mode.\n */\n activePage?: number\n /**\n * Set the alignment of pagination components.\n */\n align?: 'start' | 'center' | 'end'\n /**\n * Accessible label for the pagination `<nav>` landmark. Override for non-English locales,\n * or when multiple paginators appear on the same page.\n *\n * @default 'Pagination'\n */\n 'aria-label'?: string\n /**\n * A string of all className you want applied to the `<nav>`, which takes the ref and the other\n * attributes too.\n */\n className?: string\n /**\n * Classes for the `.pagination` list inside the `<nav>`.\n */\n listClassName?: string\n /**\n * Maximum number of visible page buttons (default: 5). Flanking pages are collapsed to ellipsis.\n */\n maxVisiblePages?: number\n /**\n * The \"next page\" control's icon in smart pagination mode: an icon name, or an element of your\n * own icon set. Defaults to `IconProvider`'s `next` icon.\n */\n nextIcon?: IconValue\n /**\n * Accessible label for the \"next page\" control, used in smart pagination mode. Override for\n * non-English locales.\n *\n * @default 'Next'\n */\n nextLabel?: string\n /**\n * Callback fired when the active page changes.\n */\n onActivePageChange?: (page: number) => void\n /**\n * Total number of pages. When provided alongside `activePage` and `onActivePageChange`,\n * the component renders a fully-controlled smart paginator with Prev/Next and ellipsis.\n */\n pages?: number\n /**\n * The \"previous page\" control's icon in smart pagination mode: an icon name, or an element of\n * your own icon set. Defaults to `IconProvider`'s `previous` icon.\n */\n previousIcon?: IconValue\n /**\n * Accessible label for the \"previous page\" control, used in smart pagination mode. Override\n * for non-English locales.\n *\n * @default 'Previous'\n */\n previousLabel?: string\n /**\n * Show the numbered page buttons in smart pagination mode. Set `false` alongside\n * `showPrevNext` to build a Prev/Next-only paginator.\n *\n * @default true\n */\n showPageNumbers?: boolean\n /**\n * Show the Prev/Next controls in smart pagination mode. Set `false` alongside\n * `showPageNumbers` to build a page-numbers-only paginator.\n *\n * @default true\n */\n showPrevNext?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n}\n\nfunction getPageRange(activePage: number, pages: number, maxVisible: number): (number | '...')[] {\n const safeMaxVisible = Math.max(1, maxVisible)\n\n if (pages <= safeMaxVisible) {\n return Array.from({ length: pages }, (_, i) => i + 1)\n }\n\n const half = Math.floor(safeMaxVisible / 2)\n let start = Math.max(1, activePage - half)\n const end = Math.min(pages, start + safeMaxVisible - 1)\n\n if (end - start < safeMaxVisible - 1) {\n start = Math.max(1, end - safeMaxVisible + 1)\n }\n\n const result: (number | '...')[] = []\n\n if (start > 1) {\n result.push(1)\n if (start > 2) result.push('...')\n }\n\n for (let i = start; i <= end; i++) {\n result.push(i)\n }\n\n if (end < pages) {\n if (end < pages - 1) result.push('...')\n result.push(pages)\n }\n\n return result\n}\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(\n (\n {\n activePage = 1,\n align,\n 'aria-label': ariaLabel = 'Pagination',\n children,\n className,\n listClassName,\n maxVisiblePages = 5,\n nextIcon,\n nextLabel = 'Next',\n onActivePageChange,\n pages,\n previousIcon,\n previousLabel = 'Previous',\n showPageNumbers = true,\n showPrevNext = true,\n size,\n ...rest\n },\n ref\n ) => {\n const _listClassName = classNames(\n 'pagination',\n size,\n align && ALIGN_CLASS_NAMES[align],\n listClassName\n )\n\n // `pages != null`, not truthiness: `pages={0}` is a pagination with no pages, both of its\n // controls disabled. It rendered `children` instead, an empty navigation landmark.\n const isSmart = pages != null\n const clampedActivePage = isSmart ? Math.min(Math.max(activePage, 1), pages) : activePage\n const prevDisabled = isSmart ? clampedActivePage <= 1 : false\n const nextDisabled = isSmart ? clampedActivePage >= pages : false\n\n const { prevRef, nextRef, handlePrevClick, handleNextClick } = usePagination({\n prevDisabled,\n nextDisabled,\n onPrev: () => onActivePageChange && onActivePageChange(clampedActivePage - 1),\n onNext: () => onActivePageChange && onActivePageChange(clampedActivePage + 1)\n })\n\n const smartContent = isSmart ? (\n <>\n {showPrevNext && (\n <PaginationItem\n ref={prevRef}\n disabled={prevDisabled}\n onClick={handlePrevClick}\n aria-label={previousLabel}\n >\n <IconSlot icon=\"previous\" override={previousIcon} className=\"directional-icon\" />\n </PaginationItem>\n )}\n {showPageNumbers &&\n getPageRange(clampedActivePage, pages, maxVisiblePages).map((page, idx) =>\n page === '...' ? (\n // eslint-disable-next-line react/no-array-index-key\n <PaginationItem key={`ellipsis-${idx}`} disabled component=\"span\" aria-hidden=\"true\">\n &hellip;\n </PaginationItem>\n ) : (\n <PaginationItem\n key={page}\n active={page === clampedActivePage}\n onClick={() => onActivePageChange && onActivePageChange(page)}\n >\n {page}\n </PaginationItem>\n )\n )}\n {showPrevNext && (\n <PaginationItem\n ref={nextRef}\n disabled={nextDisabled}\n onClick={handleNextClick}\n aria-label={nextLabel}\n >\n <IconSlot icon=\"next\" override={nextIcon} className=\"directional-icon\" />\n </PaginationItem>\n )}\n </>\n ) : null\n\n return (\n // The `<nav>` takes `className`, the ref and the other attributes alike; the list inside it\n // takes `listClassName`. `className` went to the list while the rest went to the `<nav>`.\n <nav aria-label={ariaLabel} className={className} ref={ref} {...rest}>\n <ul className={_listClassName}>{smartContent ?? children}</ul>\n </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a,CAEpB,EACDN,GACC,kBAAA,cAACvB,EAAD,CACE,IAAK/B,EACL,SAAUK,EACV,QAASyD,EACT,aAAYC,CAGE,EADd,kBAAA,cAACrE,EAAD,CAAU,KAAK,OAAO,SAAUsE,EAAU,UAAU,kBAAoB,CAAA,CAC1D,CAElB,EACA,KAEJ,MAGE,kBAAA,cAAC,MAAD,CAAK,aAAYnB,EAAsB,YAAgB,MAAK,GAAInC,CAE3D,EADH,kBAAA,cAAC,KAAD,CAAI,UAAWoC,CAA8C,EAA7BO,GAAgB1B,CAAa,CAC1D,CAET,CACF,EAEA,EAAW,YAAc,a"}
@@ -0,0 +1,2 @@
1
+ import"./focus-ring-Bs80iIBN.js";import{a as e}from"./slot-DagH0Gxq.js";import{t}from"./polymorphic-mAKwlLiW.js";import n from"react";import r from"classnames";const i={start:`float-start`,center:`d-block mx-auto`,end:`float-end`};function a({align:t,alt:a,className:o,color:s,component:c,fluid:l,height:u,rounded:d,src:f,text:p,thumbnail:m,title:h=`Placeholder`,variant:g,width:_,...v},y){let b=h!==!1,x=p===!1?void 0:p??(_!==void 0&&u!==void 0?`${_}x${u}`:void 0),S=x!==void 0,C=[b&&h,S&&x].filter(Boolean).join(`: `)||void 0;if(f||e(c)){let e=c??`img`,s=r({image:l||m,fluid:l,rounded:d,thumbnail:m},t&&i[t],o);return/* @__PURE__ */ n.createElement(e,{src:f,width:_,height:u,alt:a??``,className:s,...v,ref:y})}let w=r(`image`,{context:!!(s||g)},s,g||`bg-evident`,`fg-subtle`,o);return/* @__PURE__ */ n.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:_,height:u,"aria-label":C,"aria-hidden":!C||void 0,className:w,preserveAspectRatio:`xMidYMid slice`,role:C?`img`:void 0,...v,ref:y},b&&/* @__PURE__ */ n.createElement(`title`,null,h),S&&/* @__PURE__ */ n.createElement(`text`,{dy:`.3em`,fill:`currentColor`,textAnchor:`middle`,x:`50%`,y:`50%`},x))}const o=t(a,`Placeholder`);export{o as t};
2
+ //# sourceMappingURL=placeholder-9rTlnMso.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"placeholder-SPoVRkKE.js","names":["isSlot","React","classNames","ALIGN_CLASS_NAMES","PlaceholderRender","rest","showTitle","title","displayText","text","width","height","showText","label","src","component","Component","_className","fluid","thumbnail","align","className","alt","color","variant","Placeholder","createPolymorphicComponent"],"sources":["../../src/components/placeholder/Placeholder.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor, ContextStyle } from '../../types'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { isSlot } from '../../utils/slot'\n\ntype PlaceholderAlign = 'start' | 'center' | 'end'\n\ntype PlaceholderOwnProps<C extends ElementType> = {\n /**\n * Set the horizontal alignment. Only applies when `src` is set.\n */\n align?: PlaceholderAlign\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the generated placeholder graphic to one of Chassis context colors. Has no\n * effect when `src` is set.\n */\n color?: ContextColor\n /**\n * Sets the variant of the generated placeholder graphic to one of Chassis context styles. Has no\n * effect when `src` is set.\n */\n variant?: Exclude<ContextStyle, 'basic' | 'outline'>\n /**\n * Component used for the root node when `src` is set. Either a string to use an HTML element\n * or a component — e.g. a framework's own `Image` component. Its own props (`src`, `fill`,\n * `priority`, etc.) are type-checked at the call site once passed here. With `asChild`, the\n * child element is the image and carries its own `src`.\n */\n component?: C\n /**\n * Make the image responsive, so it never grows larger than its parent. Only applies when `src`\n * is set.\n */\n fluid?: boolean\n /**\n * Placeholder height.\n */\n height?: number | string\n /**\n * Give the image a rounded border-radius. Only applies when `src` is set.\n */\n rounded?: boolean\n /**\n * Renders a real image instead of the generated placeholder graphic, e.g. a default asset or a\n * `placehold.co` URL.\n */\n src?: string\n /**\n * Text shown in the generated placeholder graphic. Defaults to `{width}x{height}`. Pass `false`\n * to hide it. Has no effect when `src` is set.\n */\n text?: string | false\n /**\n * Give the image a thumbnail appearance (padding, background, border, box-shadow). Only\n * applies when `src` is set.\n */\n thumbnail?: boolean\n /**\n * Accessible title for the generated placeholder graphic, rendered as an SVG `<title>`. Pass\n * `false` to hide it. Has no effect when `src` is set.\n *\n * @default 'Placeholder'\n */\n title?: string | false\n /**\n * Placeholder width.\n */\n width?: number | string\n}\n\nexport type PlaceholderProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n PlaceholderOwnProps<C>\n>\n\ntype PlaceholderComponent = (<C extends ElementType = 'img'>(\n props: PlaceholderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// Whole class names, not `float-${align}`: see `utils/colorClassNames.ts`.\nconst ALIGN_CLASS_NAMES: Record<PlaceholderAlign, string> = {\n start: 'float-start',\n center: 'd-block mx-auto',\n end: 'float-end'\n}\n\nfunction PlaceholderRender<C extends ElementType = 'img'>(\n {\n align,\n alt,\n className,\n color,\n component,\n fluid,\n height,\n rounded,\n src,\n text,\n thumbnail,\n title = 'Placeholder',\n variant,\n width,\n ...rest\n }: PlaceholderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const showTitle = title !== false\n const displayText =\n text === false\n ? undefined\n : (text ?? (width !== undefined && height !== undefined ? `${width}x${height}` : undefined))\n const showText = displayText !== undefined\n const label =\n [showTitle && title, showText && displayText].filter(Boolean).join(': ') || undefined\n\n // Under `asChild` the caller's element is the image and holds the `src`, so there is none here\n // to choose the branch by.\n if (src || isSlot(component)) {\n const Component = component ?? 'img'\n const _className = classNames(\n { image: fluid || thumbnail, fluid, rounded, thumbnail },\n align && ALIGN_CLASS_NAMES[align],\n className\n )\n\n return (\n <Component\n src={src}\n width={width}\n height={height}\n alt={alt ?? label ?? ''}\n className={_className}\n {...rest}\n ref={ref}\n />\n )\n }\n\n const _className = classNames(\n 'image',\n { context: Boolean(color || variant) },\n color,\n variant ? variant : 'bg-evident',\n 'fg-subtle',\n className\n )\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={width}\n height={height}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={_className}\n preserveAspectRatio=\"xMidYMid slice\"\n role={label ? 'img' : undefined}\n {...rest}\n ref={ref as PolymorphicRef<'svg'>}\n >\n {showTitle && <title>{title}</title>}\n {showText && (\n <text dy=\".3em\" fill=\"currentColor\" textAnchor=\"middle\" x=\"50%\" y=\"50%\">\n {displayText}\n </text>\n )}\n </svg>\n )\n}\n\nexport const Placeholder = createPolymorphicComponent<PlaceholderComponent>(\n PlaceholderRender as ForwardRefRenderFunction<Element, PlaceholderProps<ElementType>>,\n 'Placeholder'\n)\n"],"mappings":"A,gKA0FA,MAAMG,EAAsD,CAC1D,MAAO,cACP,OAAQ,kBACR,IAAK,WACP,EAEA,SAASC,EACP,CACE,QACA,MACA,YACA,QACA,YACA,QACA,SACA,UACA,MACA,OACA,YACA,QAAQ,cACR,UACA,QACA,GAAGC,GAEL,EACA,CACA,IAAMC,EAAYC,IAAU,GACtBC,EACJC,IAAS,GACL,IAAA,GACCA,IAASC,IAAU,IAAA,IAAaC,IAAW,IAAA,GAAY,GAAGD,EAAM,GAAGC,IAAW,IAAA,IAC/EC,EAAWJ,IAAgB,IAAA,GAC3BK,EACJ,CAACP,GAAaC,EAAOK,GAAYJ,CAAW,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,GAAK,IAAA,GAI9E,GAAIM,GAAOd,EAAOe,CAAS,EAAG,CAC5B,IAAMC,EAAYD,GAAa,MACzBE,EAAaf,EACjB,CAAE,MAAOgB,GAASC,EAAW,QAAO,UAAS,WAAU,EACvDC,GAASjB,EAAkBiB,GAC3BC,CACF,EAEA,MACE,kBAAA,cAACL,EAAD,CACO,MACE,QACC,SACR,IAAKM,GAAOT,GAAS,GACrB,UAAWI,EACX,GAAIZ,EACC,KACN,CAAA,CAEL,CAEA,IAAMY,EAAaf,EACjB,QACA,CAAE,QAAS,GAAQqB,GAASC,EAAS,EACrCD,EACAC,GAAoB,aACpB,YACAH,CACF,EAEA,MACE,kBAAA,cAAC,MAAD,CACE,MAAM,6BACC,QACC,SACR,aAAYR,EACZ,cAAa,IAAQ,IAAA,GACrB,UAAWI,EACX,oBAAoB,iBACpB,KAAMJ,EAAQ,MAAQ,IAAA,GACtB,GAAIR,EACC,KAQF,EANFC,GAAa,kBAAA,cAAC,QAAA,KAAOC,CAAa,EAClCK,GACC,kBAAA,cAAC,OAAD,CAAM,GAAG,OAAO,KAAK,eAAe,WAAW,SAAS,EAAE,MAAM,EAAE,KAE5D,EADHJ,CACG,CAEL,CAET,CAEA,MAAaiB,EAAcC,EACzBtB,EACA,aACF,E"}
1
+ {"version":3,"file":"placeholder-9rTlnMso.js","names":["isSlot","React","classNames","ALIGN_CLASS_NAMES","PlaceholderRender","rest","showTitle","title","displayText","text","width","height","showText","label","src","component","Component","_className","fluid","thumbnail","align","className","alt","color","variant","Placeholder","createPolymorphicComponent"],"sources":["../../src/components/placeholder/Placeholder.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor, ContextStyle } from '../../types'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { isSlot } from '../../utils/slot'\n\ntype PlaceholderAlign = 'start' | 'center' | 'end'\n\ntype PlaceholderOwnProps<C extends ElementType> = {\n /**\n * Set the horizontal alignment. Only applies when `src` is set.\n */\n align?: PlaceholderAlign\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the generated placeholder graphic to one of Chassis context colors. Has no\n * effect when `src` is set.\n */\n color?: ContextColor\n /**\n * Sets the variant of the generated placeholder graphic to one of Chassis context styles. Has no\n * effect when `src` is set.\n */\n variant?: Exclude<ContextStyle, 'basic' | 'outline'>\n /**\n * Component used for the root node when `src` is set. Either a string to use an HTML element\n * or a component — e.g. a framework's own `Image` component. Its own props (`src`, `fill`,\n * `priority`, etc.) are type-checked at the call site once passed here. With `asChild`, the\n * child element is the image and carries its own `src`.\n */\n component?: C\n /**\n * Make the image responsive, so it never grows larger than its parent. Only applies when `src`\n * is set.\n */\n fluid?: boolean\n /**\n * Placeholder height.\n */\n height?: number | string\n /**\n * Give the image a rounded border-radius. Only applies when `src` is set.\n */\n rounded?: boolean\n /**\n * Renders a real image instead of the generated placeholder graphic, e.g. a default asset or a\n * `placehold.co` URL.\n */\n src?: string\n /**\n * Text shown in the generated placeholder graphic. Defaults to `{width}x{height}`. Pass `false`\n * to hide it. Has no effect when `src` is set.\n */\n text?: string | false\n /**\n * Give the image a thumbnail appearance (padding, background, border, box-shadow). Only\n * applies when `src` is set.\n */\n thumbnail?: boolean\n /**\n * Accessible title for the generated placeholder graphic, rendered as an SVG `<title>`. Pass\n * `false` to hide it. Has no effect when `src` is set.\n *\n * @default 'Placeholder'\n */\n title?: string | false\n /**\n * Placeholder width.\n */\n width?: number | string\n}\n\nexport type PlaceholderProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n PlaceholderOwnProps<C>\n>\n\ntype PlaceholderComponent = (<C extends ElementType = 'img'>(\n props: PlaceholderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// Whole class names, not `float-${align}`: see `utils/colorClassNames.ts`.\nconst ALIGN_CLASS_NAMES: Record<PlaceholderAlign, string> = {\n start: 'float-start',\n center: 'd-block mx-auto',\n end: 'float-end'\n}\n\nfunction PlaceholderRender<C extends ElementType = 'img'>(\n {\n align,\n alt,\n className,\n color,\n component,\n fluid,\n height,\n rounded,\n src,\n text,\n thumbnail,\n title = 'Placeholder',\n variant,\n width,\n ...rest\n }: PlaceholderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const showTitle = title !== false\n const displayText =\n text === false\n ? undefined\n : (text ?? (width !== undefined && height !== undefined ? `${width}x${height}` : undefined))\n const showText = displayText !== undefined\n const label =\n [showTitle && title, showText && displayText].filter(Boolean).join(': ') || undefined\n\n // Under `asChild` the caller's element is the image and holds the `src`, so there is none here\n // to choose the branch by.\n if (src || isSlot(component)) {\n const Component = component ?? 'img'\n const _className = classNames(\n { image: fluid || thumbnail, fluid, rounded, thumbnail },\n align && ALIGN_CLASS_NAMES[align],\n className\n )\n\n // `title` and `text` describe the generated graphic, which isn't rendered: an image given no\n // `alt` is decorative, as an `<img alt=\"\">`, not one named after a graphic it doesn't show.\n return (\n <Component\n src={src}\n width={width}\n height={height}\n alt={alt ?? ''}\n className={_className}\n {...rest}\n ref={ref}\n />\n )\n }\n\n const _className = classNames(\n 'image',\n { context: Boolean(color || variant) },\n color,\n variant ? variant : 'bg-evident',\n 'fg-subtle',\n className\n )\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={width}\n height={height}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={_className}\n preserveAspectRatio=\"xMidYMid slice\"\n role={label ? 'img' : undefined}\n {...rest}\n ref={ref as PolymorphicRef<'svg'>}\n >\n {showTitle && <title>{title}</title>}\n {showText && (\n <text dy=\".3em\" fill=\"currentColor\" textAnchor=\"middle\" x=\"50%\" y=\"50%\">\n {displayText}\n </text>\n )}\n </svg>\n )\n}\n\nexport const Placeholder = createPolymorphicComponent<PlaceholderComponent>(\n PlaceholderRender as ForwardRefRenderFunction<Element, PlaceholderProps<ElementType>>,\n 'Placeholder'\n)\n"],"mappings":"A,gKA0FA,MAAMG,EAAsD,CAC1D,MAAO,cACP,OAAQ,kBACR,IAAK,WACP,EAEA,SAASC,EACP,CACE,QACA,MACA,YACA,QACA,YACA,QACA,SACA,UACA,MACA,OACA,YACA,QAAQ,cACR,UACA,QACA,GAAGC,GAEL,EACA,CACA,IAAMC,EAAYC,IAAU,GACtBC,EACJC,IAAS,GACL,IAAA,GACCA,IAASC,IAAU,IAAA,IAAaC,IAAW,IAAA,GAAY,GAAGD,EAAM,GAAGC,IAAW,IAAA,IAC/EC,EAAWJ,IAAgB,IAAA,GAC3BK,EACJ,CAACP,GAAaC,EAAOK,GAAYJ,CAAW,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,IAAI,GAAK,IAAA,GAI9E,GAAIM,GAAOd,EAAOe,CAAS,EAAG,CAC5B,IAAMC,EAAYD,GAAa,MACzBE,EAAaf,EACjB,CAAE,MAAOgB,GAASC,EAAW,QAAO,UAAS,WAAU,EACvDC,GAASjB,EAAkBiB,GAC3BC,CACF,EAIA,MACE,kBAAA,cAACL,EAAD,CACO,MACE,QACC,SACR,IAAKM,GAAO,GACZ,UAAWL,EACX,GAAIZ,EACC,KACN,CAAA,CAEL,CAEA,IAAMY,EAAaf,EACjB,QACA,CAAE,QAAS,GAAQqB,GAASC,EAAS,EACrCD,EACAC,GAAoB,aACpB,YACAH,CACF,EAEA,MACE,kBAAA,cAAC,MAAD,CACE,MAAM,6BACC,QACC,SACR,aAAYR,EACZ,cAAa,IAAQ,IAAA,GACrB,UAAWI,EACX,oBAAoB,iBACpB,KAAMJ,EAAQ,MAAQ,IAAA,GACtB,GAAIR,EACC,KAQF,EANFC,GAAa,kBAAA,cAAC,QAAA,KAAOC,CAAa,EAClCK,GACC,kBAAA,cAAC,OAAD,CAAM,GAAG,OAAO,KAAK,eAAe,WAAW,SAAS,EAAE,MAAM,EAAE,KAE5D,EADHJ,CACG,CAEL,CAET,CAEA,MAAaiB,EAAcC,EACzBtB,EACA,aACF,E"}
@@ -0,0 +1,2 @@
1
+ import{C as e,a as t,n,r,s as i,t as a,x as o}from"./slot-DagH0Gxq.js";import{createElement as s,forwardRef as c}from"react";function l(l,u){let d=c(({asChild:c,...d},f)=>{let p=i(),m=c?r(d.children,u):null;return m?(e(d.component!==void 0,`${u}: both \`asChild\` and \`component\` were passed; \`asChild\` wins and \`component\` is ignored.`),s(a,{value:m},o(m,()=>l({...d,component:n(m),children:m.props.children},f)))):t(d.component)?o(p,()=>l(d,f)):l(d,f)});return d.displayName=u,d}export{l as t};
2
+ //# sourceMappingURL=polymorphic-mAKwlLiW.js.map