@chassis-ui/react 0.2.0 → 0.4.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.
- package/LICENSE +1 -1
- package/README.md +56 -23
- package/dist/accordion.js +1 -1
- package/dist/alert.d.ts +2 -0
- package/dist/alert.js +1 -0
- package/dist/autocomplete.d.ts +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-group.d.ts +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.d.ts +1 -1
- package/dist/carousel.js +1 -1
- package/dist/checkbox.d.ts +2 -2
- package/dist/checkbox.js +1 -1
- package/dist/chip-input.js +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.js +1 -1
- package/dist/chunks/Button-BoymWE-L.js +2 -0
- package/dist/chunks/Button-BoymWE-L.js.map +1 -0
- package/dist/chunks/{Button-Cptd4Yk7.d.ts → Button-BuZ_GOHS.d.ts} +3 -2
- package/dist/chunks/Chip-DCaWaBqo.js +2 -0
- package/dist/chunks/Chip-DCaWaBqo.js.map +1 -0
- package/dist/chunks/CloseButton-DPgQztE0.js +2 -0
- package/dist/chunks/CloseButton-DPgQztE0.js.map +1 -0
- package/dist/chunks/ComboboxItem-C9TpoJOI.d.ts +2 -1
- package/dist/chunks/ComboboxListBox-Cm3L1ULl.js +2 -0
- package/dist/chunks/ComboboxListBox-Cm3L1ULl.js.map +1 -0
- package/dist/chunks/DateSegment-2agXAd0f.js +2 -0
- package/dist/chunks/DateSegment-2agXAd0f.js.map +1 -0
- package/dist/chunks/{FormHelp-Be2PQL0y.js → FormHelp-AE6_iSLJ.js} +2 -1
- package/dist/chunks/FormHelp-AE6_iSLJ.js.map +1 -0
- package/dist/chunks/FormLabel-CYcQiFUI.js +2 -1
- package/dist/chunks/FormLabel-CYcQiFUI.js.map +1 -0
- package/dist/chunks/Icon-CioraWLF.d.ts +2 -1
- package/dist/chunks/Icon-DLB1f88W.js +2 -0
- package/dist/chunks/Icon-DLB1f88W.js.map +1 -0
- package/dist/chunks/{Link-B0Y1xgYi.d.ts → Link-CKymd2ru.d.ts} +8 -6
- package/dist/chunks/Link-CZsWCnQb.js +2 -0
- package/dist/chunks/Link-CZsWCnQb.js.map +1 -0
- package/dist/chunks/Menu-CSBg2Zmc.js +2 -0
- package/dist/chunks/Menu-CSBg2Zmc.js.map +1 -0
- package/dist/chunks/Menu-QeYOzrUL.d.ts +95 -0
- package/dist/chunks/MenuItemDef-D0VDtYIQ.d.ts +2 -1
- package/dist/chunks/MenuToggle-BdQtF7FV.js +2 -0
- package/dist/chunks/MenuToggle-BdQtF7FV.js.map +1 -0
- package/dist/chunks/Portal-CgeR1WXV.js +2 -0
- package/dist/chunks/Portal-CgeR1WXV.js.map +1 -0
- package/dist/chunks/RangeCalendar-BJl-j4W2.js +2 -0
- package/dist/chunks/RangeCalendar-BJl-j4W2.js.map +1 -0
- package/dist/chunks/VisuallyHidden-C2dM7HhC.js +2 -0
- package/dist/chunks/VisuallyHidden-C2dM7HhC.js.map +1 -0
- package/dist/chunks/accordion-B8UWyvQB.js +2 -0
- package/dist/chunks/accordion-B8UWyvQB.js.map +1 -0
- package/dist/chunks/alert-BXI-_qlt.js +2 -0
- package/dist/chunks/alert-BXI-_qlt.js.map +1 -0
- package/dist/chunks/autocomplete-Baf9VSHN.js +2 -0
- package/dist/chunks/autocomplete-Baf9VSHN.js.map +1 -0
- package/dist/chunks/avatar-S3dGy6Qc.js +2 -0
- package/dist/chunks/avatar-S3dGy6Qc.js.map +1 -0
- package/dist/chunks/{badge-Bj8mf8lu.js → badge-D2oztCvs.js} +2 -1
- package/dist/chunks/badge-D2oztCvs.js.map +1 -0
- package/dist/chunks/{breadcrumb-DDxnx_iS.js → breadcrumb-s6J9itez.js} +2 -1
- package/dist/chunks/breadcrumb-s6J9itez.js.map +1 -0
- package/dist/chunks/breakpoints-CGk8szzR.js +2 -0
- package/dist/chunks/breakpoints-CGk8szzR.js.map +1 -0
- package/dist/chunks/breakpoints-ECy4lKQT.d.ts +6 -0
- package/dist/chunks/button-group-BGppPrIv.js +2 -0
- package/dist/chunks/button-group-BGppPrIv.js.map +1 -0
- package/dist/chunks/card-CobeDpf1.js +2 -0
- package/dist/chunks/card-CobeDpf1.js.map +1 -0
- package/dist/chunks/carousel-fTVPqnSV.js +2 -0
- package/dist/chunks/carousel-fTVPqnSV.js.map +1 -0
- package/dist/chunks/checkbox-ZyQn5Ku5.js +2 -0
- package/dist/chunks/checkbox-ZyQn5Ku5.js.map +1 -0
- package/dist/chunks/chip-input-BpVDRERg.js +2 -0
- package/dist/chunks/chip-input-BpVDRERg.js.map +1 -0
- package/dist/chunks/collapse--Go2Y73B.js +2 -0
- package/dist/chunks/collapse--Go2Y73B.js.map +1 -0
- package/dist/chunks/{color-input-CyRaLR_G.js → color-input-Bwl5ef5B.js} +2 -1
- package/dist/chunks/color-input-Bwl5ef5B.js.map +1 -0
- package/dist/chunks/combobox-Bp1tIaiW.js +2 -0
- package/dist/chunks/combobox-Bp1tIaiW.js.map +1 -0
- package/dist/chunks/context-menu-B4a0tS-h.js +2 -0
- package/dist/chunks/context-menu-B4a0tS-h.js.map +1 -0
- package/dist/chunks/datagrid-CH3Cy-q7.js +3 -0
- package/dist/chunks/datagrid-CH3Cy-q7.js.map +1 -0
- package/dist/chunks/dateRangePresets-R1FtA1zp.d.ts +2 -1
- package/dist/chunks/datepicker-bOiM_zhJ.js +2 -0
- package/dist/chunks/datepicker-bOiM_zhJ.js.map +1 -0
- package/dist/chunks/dialogTransition-i9vw0i2Z.js +2 -1
- package/dist/chunks/dialogTransition-i9vw0i2Z.js.map +1 -0
- package/dist/chunks/direction-LN6uwsK5.js +2 -0
- package/dist/chunks/direction-LN6uwsK5.js.map +1 -0
- package/dist/chunks/divider-CjbF4OfA.js +2 -0
- package/dist/chunks/divider-CjbF4OfA.js.map +1 -0
- package/dist/chunks/drawer-C7Tz4XU_.js +2 -0
- package/dist/chunks/drawer-C7Tz4XU_.js.map +1 -0
- package/dist/chunks/{file-input-RRqZSzjH.js → file-input-CDM6qrmV.js} +2 -1
- package/dist/chunks/file-input-CDM6qrmV.js.map +1 -0
- package/dist/chunks/flex-B52oLCCC.js +2 -0
- package/dist/chunks/flex-B52oLCCC.js.map +1 -0
- package/dist/chunks/floating-input-DmSZZc27.js +2 -0
- package/dist/chunks/floating-input-DmSZZc27.js.map +1 -0
- package/dist/chunks/focus-ring-SR_LwaN7.js +2 -1
- package/dist/chunks/focus-ring-SR_LwaN7.js.map +1 -0
- package/dist/chunks/focusRedirect-BrvK3U_o.js +2 -1
- package/dist/chunks/focusRedirect-BrvK3U_o.js.map +1 -0
- package/dist/chunks/form-GpdAyWWi.js +2 -1
- package/dist/chunks/form-GpdAyWWi.js.map +1 -0
- package/dist/chunks/form-field-CNPGTMiW.js +2 -0
- package/dist/chunks/form-field-CNPGTMiW.js.map +1 -0
- package/dist/chunks/grid-C7tO-ppc.js +2 -0
- package/dist/chunks/grid-C7tO-ppc.js.map +1 -0
- package/dist/chunks/{icon-mxYpL5nL.js → icon-BQsT6YtE.js} +2 -1
- package/dist/chunks/icon-BQsT6YtE.js.map +1 -0
- package/dist/chunks/{iconConfig-Bu6Pt9o3.d.ts → iconConfig-C6gbYhsD.d.ts} +5 -3
- package/dist/chunks/iconSlot-BNu2MrFI.js +2 -0
- package/dist/chunks/iconSlot-BNu2MrFI.js.map +1 -0
- package/dist/chunks/{index-BKMW0rkw.d.ts → index-0jbACjYQ.d.ts} +5 -3
- package/dist/chunks/{index-BO_1MN66.d.ts → index-4cKG9KWB.d.ts} +3 -5
- package/dist/chunks/index-6uob77s9.d.ts +2 -1
- package/dist/chunks/{index-tOodmT36.d.ts → index-91YA-jkp.d.ts} +4 -6
- package/dist/chunks/index-9rQeMqVI.d.ts +42 -0
- package/dist/chunks/index-B0-8n-Gs.d.ts +2 -1
- package/dist/chunks/{index-D9PZHY_I.d.ts → index-B19ZH3fm.d.ts} +3 -2
- package/dist/chunks/{index-COsIPd8L.d.ts → index-B1kw0jzM.d.ts} +3 -2
- package/dist/chunks/index-B2K-O9kl.d.ts +59 -0
- package/dist/chunks/{index-CJzKu7QI.d.ts → index-B5bF1JxF.d.ts} +3 -2
- package/dist/chunks/index-B8uaSJA9.d.ts +2 -1
- package/dist/chunks/index-BA-raEMm.d.ts +2 -1
- package/dist/chunks/{index-C61tPIJ-.d.ts → index-BAsbRx5n.d.ts} +6 -2
- package/dist/chunks/index-BF3OWUVc.d.ts +66 -0
- package/dist/chunks/{index-Ctuk1xBU.d.ts → index-BLS1jhSJ.d.ts} +10 -7
- package/dist/chunks/{index-JllMXhVx.d.ts → index-BMkbJVHg.d.ts} +22 -5
- package/dist/chunks/{index-DB_ToPdz.d.ts → index-BNf0jIIL.d.ts} +12 -1
- package/dist/chunks/{index-t_x6jj7l.d.ts → index-BOx8v-oT.d.ts} +3 -2
- package/dist/chunks/index-BSLneLYu.d.ts +79 -0
- package/dist/chunks/index-BVGGIaPX.d.ts +2 -1
- package/dist/chunks/{index-qgZ5VGmc.d.ts → index-B_UzbGOa.d.ts} +20 -2
- package/dist/chunks/{index-XjLvaH4G.d.ts → index-BfEJYF4c.d.ts} +7 -6
- package/dist/chunks/index-Bi8FFadV.d.ts +2 -1
- package/dist/chunks/index-Bkj17NEQ.d.ts +2 -1
- package/dist/chunks/{index--0_IpTDT.d.ts → index-BxROljJI.d.ts} +3 -2
- package/dist/chunks/index-Bz8MDq0H.d.ts +85 -0
- package/dist/chunks/{index-Cf2n0l0U.d.ts → index-C4Dks__B.d.ts} +3 -2
- package/dist/chunks/{index-CRfm7W6C.d.ts → index-C9gzVqwX.d.ts} +3 -2
- package/dist/chunks/index-CCXJXToc.d.ts +2 -1
- package/dist/chunks/{index-COsYSDrz.d.ts → index-CFnQubsV.d.ts} +17 -3
- package/dist/chunks/{index-8PhBSbNQ.d.ts → index-CHQR8x8_.d.ts} +16 -17
- package/dist/chunks/{index-BTTeKpiE.d.ts → index-CIwzgZJi.d.ts} +3 -2
- package/dist/chunks/{index-dh3TKanY.d.ts → index-CTpwB1yR.d.ts} +3 -2
- package/dist/chunks/{index-DR8sYtvd.d.ts → index-CYvVmTPR.d.ts} +20 -87
- package/dist/chunks/{index-Dum6Y9XR.d.ts → index-Cc4SSslb.d.ts} +20 -2
- package/dist/chunks/index-CftERHnE.d.ts +2 -1
- package/dist/chunks/{index-CaQ1JY5D.d.ts → index-Ci7AEgEc.d.ts} +4 -6
- package/dist/chunks/{index-DKma0jQw.d.ts → index-CjT_4IZx.d.ts} +4 -3
- package/dist/chunks/{index-BxTlIaZu.d.ts → index-CqZ68Z8R.d.ts} +125 -11
- package/dist/chunks/{index-D2VVO8rx.d.ts → index-CsARGAzD.d.ts} +3 -2
- package/dist/chunks/index-CxjNw4ss.d.ts +216 -0
- package/dist/chunks/index-DAoPg59I.d.ts +2 -1
- package/dist/chunks/index-DHGgezXU.d.ts +2 -1
- package/dist/chunks/index-DHOG_rjE.d.ts +121 -0
- package/dist/chunks/index-DHcztR18.d.ts +208 -0
- package/dist/chunks/index-DJfga0Ce.d.ts +57 -0
- package/dist/chunks/{index-DJJocp_q.d.ts → index-DM01FX3a.d.ts} +4 -3
- package/dist/chunks/index-DMbdEm__.d.ts +119 -0
- package/dist/chunks/{index-BlgkO3dn.d.ts → index-DP5xugE-.d.ts} +25 -34
- package/dist/chunks/index-DPCwFiJL.d.ts +95 -0
- package/dist/chunks/{index-BTDgfLxK.d.ts → index-DQImhbhy.d.ts} +21 -5
- package/dist/chunks/index-DaHQdNul.d.ts +182 -0
- package/dist/chunks/index-Dcc_W6Kv.d.ts +2 -1
- package/dist/chunks/index-Ddd7iWfm.d.ts +32 -0
- package/dist/chunks/index-Dfg4Ftb8.d.ts +2 -1
- package/dist/chunks/index-DtbUXxjz.d.ts +2 -1
- package/dist/chunks/{index-DPV62IdF.d.ts → index-DtvHH_Mb.d.ts} +12 -10
- package/dist/chunks/index-Du9fBqkT.d.ts +56 -0
- package/dist/chunks/index-HrKN6s8z.d.ts +2 -1
- package/dist/chunks/{index-ClT3E_hv.d.ts → index-NGgDkhyn.d.ts} +19 -25
- package/dist/chunks/{index-Dfy1YW5j.d.ts → index-U27Ar174.d.ts} +3 -2
- package/dist/chunks/{index-CsMIgBsd.d.ts → index-YJ9QdBuq.d.ts} +10 -10
- package/dist/chunks/{index-Dh5CaHTP.d.ts → index-aRdgpeRb.d.ts} +3 -2
- package/dist/chunks/index-g74gO0pc.d.ts +36 -0
- package/dist/chunks/{index-BO9jLOIb.d.ts → index-lSPcxiii.d.ts} +3 -2
- package/dist/chunks/{index-nklPDKlC.d.ts → index-x0vZRyoU.d.ts} +4 -3
- package/dist/chunks/{input-adorn-C_EHML68.js → input-adorn-DwdX-jxA.js} +2 -1
- package/dist/chunks/input-adorn-DwdX-jxA.js.map +1 -0
- package/dist/chunks/{input-group-iI7azfvE.js → input-group-Cuiuf4Dl.js} +2 -1
- package/dist/chunks/input-group-Cuiuf4Dl.js.map +1 -0
- package/dist/chunks/lazyElement-tfMG21pZ.js +2 -0
- package/dist/chunks/lazyElement-tfMG21pZ.js.map +1 -0
- package/dist/chunks/list-BQCkwWjF.js +2 -0
- package/dist/chunks/list-BQCkwWjF.js.map +1 -0
- package/dist/chunks/menu-98EAD9nj.js +2 -0
- package/dist/chunks/menu-98EAD9nj.js.map +1 -0
- package/dist/chunks/modal-bgDR29Jh.js +2 -0
- package/dist/chunks/modal-bgDR29Jh.js.map +1 -0
- package/dist/chunks/nav-TiZuTHC6.js +2 -0
- package/dist/chunks/nav-TiZuTHC6.js.map +1 -0
- package/dist/chunks/nav-overflow-Ay5mM5Gc.js +2 -0
- package/dist/chunks/nav-overflow-Ay5mM5Gc.js.map +1 -0
- package/dist/chunks/navOverflow-B5krZe6D.js +2 -0
- package/dist/chunks/navOverflow-B5krZe6D.js.map +1 -0
- package/dist/chunks/navVariant-CnD21GBS.d.ts +5 -0
- package/dist/chunks/navVariant-DeGTk9B7.js +2 -0
- package/dist/chunks/navVariant-DeGTk9B7.js.map +1 -0
- package/dist/chunks/navbar-DxIwt0sc.js +2 -0
- package/dist/chunks/navbar-DxIwt0sc.js.map +1 -0
- package/dist/chunks/notification-Dbci5Ka3.js +2 -0
- package/dist/chunks/notification-Dbci5Ka3.js.map +1 -0
- package/dist/chunks/number-field-IBIX2IWH.js +2 -0
- package/dist/chunks/number-field-IBIX2IWH.js.map +1 -0
- package/dist/chunks/otp-input-ws393uPB.js +2 -0
- package/dist/chunks/otp-input-ws393uPB.js.map +1 -0
- package/dist/chunks/overlayPlacement-BtS90IVf.js +2 -1
- package/dist/chunks/overlayPlacement-BtS90IVf.js.map +1 -0
- package/dist/chunks/{overlayPlacement-B7843a-Q.d.ts → overlayPlacement-CIsLpycT.d.ts} +3 -2
- package/dist/chunks/pagination-BkOquk-x.js +2 -0
- package/dist/chunks/pagination-BkOquk-x.js.map +1 -0
- package/dist/chunks/password-strength-DDK8pHRq.js +2 -0
- package/dist/chunks/password-strength-DDK8pHRq.js.map +1 -0
- package/dist/chunks/placeholder-BCr83sUn.js +2 -0
- package/dist/chunks/placeholder-BCr83sUn.js.map +1 -0
- package/dist/chunks/polymorphic-BhGNZQja.js +2 -0
- package/dist/chunks/polymorphic-BhGNZQja.js.map +1 -0
- package/dist/chunks/polymorphic-CVHbTHSN.d.ts +2 -1
- package/dist/chunks/popover-Bdg8D4sm.js +2 -0
- package/dist/chunks/popover-Bdg8D4sm.js.map +1 -0
- package/dist/chunks/{progress-DlrZ71aV.js → progress-zWkTltor.js} +2 -1
- package/dist/chunks/progress-zWkTltor.js.map +1 -0
- package/dist/chunks/radio-B6gJdtoN.js +2 -0
- package/dist/chunks/radio-B6gJdtoN.js.map +1 -0
- package/dist/chunks/{range-input-BN3430j-.js → range-input-CT_8TKL7.js} +2 -1
- package/dist/chunks/range-input-CT_8TKL7.js.map +1 -0
- package/dist/chunks/renderFormCheck-DN_-V62U.js +2 -0
- package/dist/chunks/renderFormCheck-DN_-V62U.js.map +1 -0
- package/dist/chunks/{renderFormCheck-CYWG-Rbt.d.ts → renderFormCheck-nKgpa_a3.d.ts} +4 -3
- package/dist/chunks/renderFormField-Brkw1yA6.js +2 -0
- package/dist/chunks/renderFormField-Brkw1yA6.js.map +1 -0
- package/dist/chunks/{renderFormField-fBEny6JV.d.ts → renderFormField-ChNagAFN.d.ts} +3 -2
- package/dist/chunks/{renderMenuItemContent-CmqT3YUQ.js → renderMenuItemContent-DUezZrpj.js} +2 -1
- package/dist/chunks/renderMenuItemContent-DUezZrpj.js.map +1 -0
- package/dist/chunks/scrollspy-C2HmrnZ4.js +2 -0
- package/dist/chunks/scrollspy-C2HmrnZ4.js.map +1 -0
- package/dist/chunks/scrollspy-D_lPjb92.js +2 -0
- package/dist/chunks/scrollspy-D_lPjb92.js.map +1 -0
- package/dist/chunks/search-field--nDoCI_E.js +2 -0
- package/dist/chunks/search-field--nDoCI_E.js.map +1 -0
- package/dist/chunks/select-BwJIfv9f.js +2 -0
- package/dist/chunks/select-BwJIfv9f.js.map +1 -0
- package/dist/chunks/skeleton-CmZBLJwp.js +2 -0
- package/dist/chunks/skeleton-CmZBLJwp.js.map +1 -0
- package/dist/chunks/slot-CNhFZdHF.js +2 -0
- package/dist/chunks/slot-CNhFZdHF.js.map +1 -0
- package/dist/chunks/spacingClassName-DVhk8m3P.js +2 -1
- package/dist/chunks/spacingClassName-DVhk8m3P.js.map +1 -0
- package/dist/chunks/spinner-DblhvrHL.js +2 -0
- package/dist/chunks/spinner-DblhvrHL.js.map +1 -0
- package/dist/chunks/stack-DK5F53VT.js +2 -0
- package/dist/chunks/stack-DK5F53VT.js.map +1 -0
- package/dist/chunks/static-table-D0M4oc_t.js +2 -1
- package/dist/chunks/static-table-D0M4oc_t.js.map +1 -0
- package/dist/chunks/stepper-CVXMJ2yg.js +2 -0
- package/dist/chunks/stepper-CVXMJ2yg.js.map +1 -0
- package/dist/chunks/switch-C6s3LxEv.js +2 -0
- package/dist/chunks/switch-C6s3LxEv.js.map +1 -0
- package/dist/chunks/table-Cy6uEuEP.js +2 -0
- package/dist/chunks/table-Cy6uEuEP.js.map +1 -0
- package/dist/chunks/tableClassName-CZA2Bse8.js +2 -1
- package/dist/chunks/tableClassName-CZA2Bse8.js.map +1 -0
- package/dist/chunks/tabs-91T7-8qq.js +2 -0
- package/dist/chunks/tabs-91T7-8qq.js.map +1 -0
- package/dist/chunks/text-input-B4pTv6SU.js +2 -0
- package/dist/chunks/text-input-B4pTv6SU.js.map +1 -0
- package/dist/chunks/textarea-1A1nABQE.js +2 -0
- package/dist/chunks/textarea-1A1nABQE.js.map +1 -0
- package/dist/chunks/time-field-B3MA7ED_.js +2 -0
- package/dist/chunks/time-field-B3MA7ED_.js.map +1 -0
- package/dist/chunks/toast-CGHl3-oU.js +2 -0
- package/dist/chunks/toast-CGHl3-oU.js.map +1 -0
- package/dist/chunks/tooltip-Bc-u6nIW.js +2 -0
- package/dist/chunks/tooltip-Bc-u6nIW.js.map +1 -0
- package/dist/chunks/tree-Cql1veeZ.js +2 -0
- package/dist/chunks/tree-Cql1veeZ.js.map +1 -0
- package/dist/chunks/{types-CS_40Txv.d.ts → types-D6FM7bYR.d.ts} +16 -1
- package/dist/chunks/unhandledProps-9Kdj7WVf.js +2 -0
- package/dist/chunks/unhandledProps-9Kdj7WVf.js.map +1 -0
- package/dist/chunks/useButtonSemantics-CILM_lhi.js +2 -1
- package/dist/chunks/useButtonSemantics-CILM_lhi.js.map +1 -0
- package/dist/chunks/useControllableState-CPUJxfKW.js +2 -0
- package/dist/chunks/useControllableState-CPUJxfKW.js.map +1 -0
- package/dist/chunks/useDialogElement-CgOnJAzu.js +2 -0
- package/dist/chunks/useDialogElement-CgOnJAzu.js.map +1 -0
- package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js +2 -1
- package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js.map +1 -0
- package/dist/chunks/useFloatingOverlay-DLIvwx-8.js +2 -0
- package/dist/chunks/useFloatingOverlay-DLIvwx-8.js.map +1 -0
- package/dist/chunks/useForkedRef-DVEfT-KI.js +2 -1
- package/dist/chunks/useForkedRef-DVEfT-KI.js.map +1 -0
- package/dist/chunks/useFormField-BOqmBTC4.js +2 -1
- package/dist/chunks/useFormField-BOqmBTC4.js.map +1 -0
- package/dist/chunks/useIsomorphicLayoutEffect-BbqRwuqn.js +2 -1
- package/dist/chunks/useIsomorphicLayoutEffect-BbqRwuqn.js.map +1 -0
- package/dist/chunks/useOpenStateProps-DykUbnPJ.js +2 -0
- package/dist/chunks/useOpenStateProps-DykUbnPJ.js.map +1 -0
- package/dist/chunks/useToastRegionQueue-CIV5SdiE.js +2 -0
- package/dist/chunks/useToastRegionQueue-CIV5SdiE.js.map +1 -0
- package/dist/chunks/useTransitionState-e5ToY7eX.js +2 -0
- package/dist/chunks/useTransitionState-e5ToY7eX.js.map +1 -0
- package/dist/chunks/validationClassName-gRGs4KBm.js +2 -1
- package/dist/chunks/validationClassName-gRGs4KBm.js.map +1 -0
- package/dist/chunks/visibleState-B_i1zHu2.js +2 -0
- package/dist/chunks/visibleState-B_i1zHu2.js.map +1 -0
- package/dist/close-button.d.ts +1 -1
- package/dist/close-button.js +1 -1
- package/dist/collapse.js +1 -1
- package/dist/color-input.js +1 -1
- package/dist/combobox.js +1 -1
- package/dist/context-menu.d.ts +2 -0
- package/dist/context-menu.js +1 -0
- package/dist/datagrid.d.ts +1 -1
- package/dist/datagrid.js +1 -1
- package/dist/datepicker.d.ts +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/divider.d.ts +2 -0
- package/dist/divider.js +1 -0
- package/dist/drawer.d.ts +1 -1
- package/dist/drawer.js +1 -1
- package/dist/file-input.js +1 -1
- package/dist/flex.d.ts +1 -1
- package/dist/flex.js +1 -1
- package/dist/floating-input.d.ts +1 -1
- package/dist/floating-input.js +1 -1
- package/dist/form-field.d.ts +1 -1
- package/dist/form-field.js +1 -1
- package/dist/form.js +1 -1
- package/dist/grid.d.ts +2 -2
- package/dist/grid.js +1 -1
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/index.d.ts +61 -49
- package/dist/index.js +1 -1
- package/dist/input-adorn.js +1 -1
- package/dist/input-group.js +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.js +1 -1
- package/dist/list.d.ts +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.d.ts +2 -1
- package/dist/menu.js +1 -1
- package/dist/modal.d.ts +1 -1
- package/dist/modal.js +1 -1
- package/dist/nav-overflow.d.ts +2 -0
- package/dist/nav-overflow.js +1 -0
- package/dist/nav.d.ts +2 -2
- package/dist/nav.js +1 -1
- package/dist/navbar.d.ts +1 -1
- package/dist/navbar.js +1 -1
- package/dist/notification.d.ts +1 -1
- package/dist/notification.js +1 -1
- package/dist/number-field.d.ts +2 -0
- package/dist/number-field.js +1 -0
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-strength.d.ts +1 -1
- package/dist/password-strength.js +1 -1
- package/dist/placeholder.d.ts +1 -1
- package/dist/placeholder.js +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/portal.d.ts +2 -0
- package/dist/portal.js +1 -0
- package/dist/progress.d.ts +1 -1
- package/dist/progress.js +1 -1
- package/dist/radio.d.ts +1 -1
- package/dist/radio.js +1 -1
- package/dist/range-input.js +1 -1
- package/dist/scrollspy.d.ts +2 -0
- package/dist/scrollspy.js +1 -0
- package/dist/search-field.d.ts +2 -0
- package/dist/search-field.js +1 -0
- package/dist/select.js +1 -1
- package/dist/skeleton.d.ts +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/spinner.d.ts +1 -1
- package/dist/spinner.js +1 -1
- package/dist/stack.d.ts +1 -1
- package/dist/stack.js +1 -1
- package/dist/static-table.d.ts +1 -1
- package/dist/stepper.d.ts +1 -1
- package/dist/stepper.js +1 -1
- package/dist/style.css +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-input.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/time-field.d.ts +2 -0
- package/dist/time-field.js +1 -0
- package/dist/toast.d.ts +1 -1
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/tree.d.ts +2 -0
- package/dist/tree.js +1 -0
- package/dist/visually-hidden.d.ts +2 -0
- package/dist/visually-hidden.js +1 -0
- package/package.json +61 -52
- package/dist/chunks/Button-I0aUy5h-.js +0 -1
- package/dist/chunks/Chip-D0Cw0mAr.js +0 -1
- package/dist/chunks/CloseButton-DJM7FRKh.js +0 -1
- package/dist/chunks/ComboboxListBox-BhO8uRNg.js +0 -1
- package/dist/chunks/Icon-BIwkD-kx.js +0 -1
- package/dist/chunks/Link-Cq7FNWpm.js +0 -1
- package/dist/chunks/RangeCalendar-COnSfurr.js +0 -1
- package/dist/chunks/accordion-okRicuG5.js +0 -1
- package/dist/chunks/autocomplete-B0xTc6kg.js +0 -1
- package/dist/chunks/avatar-Bjm0DlPO.js +0 -1
- package/dist/chunks/breakpoints-SLMTNHF9.d.ts +0 -5
- package/dist/chunks/breakpoints-o_2Ev7ir.js +0 -1
- package/dist/chunks/button-group-CPZYA6aZ.js +0 -1
- package/dist/chunks/card-DfF2K_5p.js +0 -1
- package/dist/chunks/carousel-DEvwcA7H.js +0 -1
- package/dist/chunks/checkbox-BFPS0pD6.js +0 -1
- package/dist/chunks/chip-input-CB1lE6vP.js +0 -1
- package/dist/chunks/collapse-WifcChO8.js +0 -1
- package/dist/chunks/combobox-DWEj-Sv7.js +0 -1
- package/dist/chunks/datagrid-nbnNThsT.js +0 -2
- package/dist/chunks/datepicker-CslLKMm1.js +0 -1
- package/dist/chunks/direction-CPhdeL3A.js +0 -1
- package/dist/chunks/drawer-zReFjoJG.js +0 -1
- package/dist/chunks/flex-BTvpgaRv.js +0 -1
- package/dist/chunks/floating-input-CIC9Lm2a.js +0 -1
- package/dist/chunks/form-field-BjQ9SIjx.js +0 -1
- package/dist/chunks/grid-CuFw89yV.js +0 -1
- package/dist/chunks/iconSlot-BmWxJh27.js +0 -1
- package/dist/chunks/index-BDfh8YBc.d.ts +0 -39
- package/dist/chunks/index-CVUMS0x7.d.ts +0 -73
- package/dist/chunks/index-D949AidR.d.ts +0 -40
- package/dist/chunks/index-DEb9zXlC.d.ts +0 -210
- package/dist/chunks/list-CMr-wB9d.js +0 -1
- package/dist/chunks/menu-CXUc-Gva.js +0 -1
- package/dist/chunks/modal-ByIj71Mq.js +0 -1
- package/dist/chunks/nav-BldxFo_B.js +0 -1
- package/dist/chunks/navbar-BwcsQuBk.js +0 -1
- package/dist/chunks/notification-DdqigVB1.js +0 -1
- package/dist/chunks/otp-input-CXe_wkII.js +0 -1
- package/dist/chunks/pagination-BOpEAYW2.js +0 -1
- package/dist/chunks/password-strength-BfLiYiGj.js +0 -1
- package/dist/chunks/placeholder-pg95KELl.js +0 -1
- package/dist/chunks/polymorphic-CACPOv1_.js +0 -1
- package/dist/chunks/popover-BpSfnZzk.js +0 -1
- package/dist/chunks/radio-BV7Sq6D1.js +0 -1
- package/dist/chunks/renderFormCheck-BXBs6_ov.js +0 -1
- package/dist/chunks/renderFormField-wiaxvvLG.js +0 -1
- package/dist/chunks/select-CclIIux8.js +0 -1
- package/dist/chunks/skeleton-CKq76sE_.js +0 -1
- package/dist/chunks/spinner-BEq4PAlu.js +0 -1
- package/dist/chunks/stack-D3retZ-W.js +0 -1
- package/dist/chunks/stepper-CTa6e8uv.js +0 -1
- package/dist/chunks/switch-BmHpq4tL.js +0 -1
- package/dist/chunks/table-Fme9GbAR.js +0 -1
- package/dist/chunks/tabs-BnbMJM_b.js +0 -1
- package/dist/chunks/text-input-DD3d08Yf.js +0 -1
- package/dist/chunks/textarea-C0qQdCcu.js +0 -1
- package/dist/chunks/toast-BQhZ2pv5.js +0 -1
- package/dist/chunks/tooltip-DHtVAYUo.js +0 -1
- package/dist/chunks/triggerElement-BIqA4KqZ.js +0 -1
- package/dist/chunks/useDialogElement-BRIU60cT.js +0 -1
- package/dist/chunks/useFloatingOverlay-CcmDZKMK.js +0 -1
- package/dist/chunks/useToastRegionQueue-BH6bWZ73.js +0 -1
- package/src/components/accordion/Accordion.tsx +0 -190
- package/src/components/accordion/AccordionBody.tsx +0 -46
- package/src/components/accordion/AccordionHeader.tsx +0 -21
- package/src/components/accordion/AccordionItem.tsx +0 -59
- package/src/components/accordion/context.ts +0 -8
- package/src/components/accordion/index.ts +0 -12
- package/src/components/autocomplete/Autocomplete.tsx +0 -464
- package/src/components/autocomplete/AutocompleteGroup.tsx +0 -20
- package/src/components/autocomplete/AutocompleteItem.tsx +0 -18
- package/src/components/autocomplete/index.ts +0 -10
- package/src/components/avatar/Avatar.tsx +0 -137
- package/src/components/avatar/AvatarImage.tsx +0 -19
- package/src/components/avatar/AvatarStack.tsx +0 -98
- package/src/components/avatar/index.ts +0 -10
- package/src/components/badge/Badge.tsx +0 -94
- package/src/components/badge/index.ts +0 -6
- package/src/components/breadcrumb/Breadcrumb.tsx +0 -68
- package/src/components/breadcrumb/BreadcrumbItem.tsx +0 -38
- package/src/components/breadcrumb/index.ts +0 -8
- package/src/components/button/Button.tsx +0 -232
- package/src/components/button/index.ts +0 -6
- package/src/components/button-group/ButtonGroup.tsx +0 -55
- package/src/components/button-group/ButtonToolbar.tsx +0 -47
- package/src/components/button-group/index.ts +0 -8
- package/src/components/calendar/Calendar.scss +0 -57
- package/src/components/calendar/Calendar.tsx +0 -338
- package/src/components/calendar/CalendarMonthBlock.tsx +0 -57
- package/src/components/calendar/CalendarMonthGrid.tsx +0 -94
- package/src/components/calendar/CalendarMonthYearPicker.tsx +0 -164
- package/src/components/calendar/CalendarNavButton.tsx +0 -24
- package/src/components/calendar/CalendarWeekGrid.tsx +0 -58
- package/src/components/calendar/CalendarYearGrid.tsx +0 -128
- package/src/components/calendar/RangeCalendar.scss +0 -95
- package/src/components/calendar/RangeCalendar.tsx +0 -373
- package/src/components/calendar/index.ts +0 -10
- package/src/components/calendar/labels.tsx +0 -71
- package/src/components/card/Card.tsx +0 -173
- package/src/components/card/CardBody.tsx +0 -75
- package/src/components/card/CardFooter.tsx +0 -47
- package/src/components/card/CardGroup.tsx +0 -51
- package/src/components/card/CardHeader.tsx +0 -47
- package/src/components/card/CardImage.tsx +0 -70
- package/src/components/card/CardImageOverlay.tsx +0 -47
- package/src/components/card/CardLink.tsx +0 -40
- package/src/components/card/CardSubtitle.tsx +0 -47
- package/src/components/card/CardText.tsx +0 -47
- package/src/components/card/CardTitle.tsx +0 -47
- package/src/components/card/index.ts +0 -26
- package/src/components/carousel/Carousel.tsx +0 -753
- package/src/components/carousel/CarouselControlButton.tsx +0 -81
- package/src/components/carousel/CarouselControlNext.tsx +0 -28
- package/src/components/carousel/CarouselControlPrev.tsx +0 -28
- package/src/components/carousel/CarouselIndicators.tsx +0 -44
- package/src/components/carousel/CarouselInner.tsx +0 -56
- package/src/components/carousel/CarouselItem.tsx +0 -51
- package/src/components/carousel/CarouselOverlay.tsx +0 -51
- package/src/components/carousel/CarouselPlayPause.tsx +0 -84
- package/src/components/carousel/carouselEngine.ts +0 -170
- package/src/components/carousel/context.ts +0 -29
- package/src/components/carousel/index.ts +0 -25
- package/src/components/checkbox/Checkbox.tsx +0 -252
- package/src/components/checkbox/CheckboxGroup.tsx +0 -145
- package/src/components/checkbox/context.ts +0 -14
- package/src/components/checkbox/index.ts +0 -8
- package/src/components/chip/Chip.tsx +0 -184
- package/src/components/chip/index.ts +0 -6
- package/src/components/chip-input/ChipInput.tsx +0 -371
- package/src/components/chip-input/ChipList.tsx +0 -95
- package/src/components/chip-input/index.ts +0 -6
- package/src/components/close-button/CloseButton.tsx +0 -205
- package/src/components/close-button/index.ts +0 -6
- package/src/components/collapse/Collapse.tsx +0 -128
- package/src/components/collapse/index.ts +0 -6
- package/src/components/color-input/ColorInput.tsx +0 -106
- package/src/components/color-input/index.ts +0 -6
- package/src/components/combobox/Combobox.tsx +0 -320
- package/src/components/combobox/ComboboxGroup.tsx +0 -27
- package/src/components/combobox/ComboboxItem.tsx +0 -44
- package/src/components/combobox/ComboboxListBox.tsx +0 -98
- package/src/components/combobox/index.ts +0 -10
- package/src/components/datagrid/DataGrid.scss +0 -203
- package/src/components/datagrid/DataGrid.tsx +0 -259
- package/src/components/datagrid/DataGridBody.tsx +0 -162
- package/src/components/datagrid/DataGridCell.tsx +0 -47
- package/src/components/datagrid/DataGridColumn.tsx +0 -109
- package/src/components/datagrid/DataGridHeader.tsx +0 -47
- package/src/components/datagrid/DataGridPinBehavior.tsx +0 -225
- package/src/components/datagrid/DataGridRow.tsx +0 -48
- package/src/components/datagrid/DataGridSelectionCell.tsx +0 -74
- package/src/components/datagrid/DataGridTableLayout.ts +0 -30
- package/src/components/datagrid/index.ts +0 -18
- package/src/components/datagrid/useColumnGeometry.ts +0 -161
- package/src/components/datepicker/CalendarToggleButton.tsx +0 -58
- package/src/components/datepicker/ClearButton.tsx +0 -38
- package/src/components/datepicker/DateField.tsx +0 -54
- package/src/components/datepicker/DatePicker.scss +0 -51
- package/src/components/datepicker/DatePicker.tsx +0 -606
- package/src/components/datepicker/DateRangePicker.scss +0 -11
- package/src/components/datepicker/DateRangePicker.tsx +0 -361
- package/src/components/datepicker/index.ts +0 -8
- package/src/components/datepicker/renderDatePickerShell.tsx +0 -104
- package/src/components/drawer/Drawer.tsx +0 -213
- package/src/components/drawer/DrawerBody.tsx +0 -47
- package/src/components/drawer/DrawerFooter.tsx +0 -51
- package/src/components/drawer/DrawerHeader.tsx +0 -60
- package/src/components/drawer/DrawerTitle.tsx +0 -49
- package/src/components/drawer/index.ts +0 -18
- package/src/components/file-input/FileInput.tsx +0 -100
- package/src/components/file-input/index.ts +0 -6
- package/src/components/flex/Flex.tsx +0 -134
- package/src/components/flex/index.ts +0 -6
- package/src/components/floating-input/FloatingInput.tsx +0 -94
- package/src/components/floating-input/index.ts +0 -6
- package/src/components/form/Form.tsx +0 -26
- package/src/components/form/FormFeedback.tsx +0 -64
- package/src/components/form/FormHelp.tsx +0 -46
- package/src/components/form/FormLabel.tsx +0 -26
- package/src/components/form/index.ts +0 -12
- package/src/components/form/renderFormCheck.tsx +0 -86
- package/src/components/form-field/FormField.tsx +0 -84
- package/src/components/form-field/index.ts +0 -6
- package/src/components/form-field/renderFormField.tsx +0 -85
- package/src/components/grid/Col.tsx +0 -69
- package/src/components/grid/Container.tsx +0 -59
- package/src/components/grid/Grid.tsx +0 -86
- package/src/components/grid/GridItem.tsx +0 -123
- package/src/components/grid/Row.tsx +0 -71
- package/src/components/grid/gap.ts +0 -8
- package/src/components/grid/index.ts +0 -14
- package/src/components/icon/Icon.tsx +0 -105
- package/src/components/icon/IconProvider.tsx +0 -40
- package/src/components/icon/index.ts +0 -9
- package/src/components/input-adorn/InputAdorn.tsx +0 -55
- package/src/components/input-adorn/index.ts +0 -6
- package/src/components/input-group/InputGroup.tsx +0 -50
- package/src/components/input-group/InputGroupAddon.tsx +0 -50
- package/src/components/input-group/index.ts +0 -8
- package/src/components/link/Link.tsx +0 -148
- package/src/components/link/index.ts +0 -6
- package/src/components/list/List.tsx +0 -193
- package/src/components/list/ListItem.tsx +0 -91
- package/src/components/list/index.ts +0 -8
- package/src/components/menu/Menu.tsx +0 -408
- package/src/components/menu/MenuDivider.tsx +0 -19
- package/src/components/menu/MenuHeader.tsx +0 -55
- package/src/components/menu/MenuItem.tsx +0 -85
- package/src/components/menu/MenuItemDef.ts +0 -83
- package/src/components/menu/MenuList.tsx +0 -142
- package/src/components/menu/MenuSubmenu.tsx +0 -284
- package/src/components/menu/MenuSubmenuBack.tsx +0 -39
- package/src/components/menu/MenuText.tsx +0 -47
- package/src/components/menu/MenuToggle.tsx +0 -148
- package/src/components/menu/index.ts +0 -23
- package/src/components/menu/menuNavigation.ts +0 -106
- package/src/components/menu/submenuGroup.ts +0 -43
- package/src/components/modal/Modal.tsx +0 -164
- package/src/components/modal/ModalBody.tsx +0 -47
- package/src/components/modal/ModalFooter.tsx +0 -51
- package/src/components/modal/ModalHeader.tsx +0 -60
- package/src/components/modal/ModalTitle.tsx +0 -49
- package/src/components/modal/index.ts +0 -18
- package/src/components/nav/Nav.tsx +0 -97
- package/src/components/nav/NavItem.tsx +0 -42
- package/src/components/nav/NavLink.tsx +0 -48
- package/src/components/nav/NavTitle.tsx +0 -22
- package/src/components/nav/index.ts +0 -11
- package/src/components/navbar/Navbar.tsx +0 -112
- package/src/components/navbar/NavbarBrand.tsx +0 -58
- package/src/components/navbar/NavbarNav.tsx +0 -47
- package/src/components/navbar/NavbarText.tsx +0 -47
- package/src/components/navbar/NavbarToggler.tsx +0 -40
- package/src/components/navbar/index.ts +0 -14
- package/src/components/notification/Notification.scss +0 -15
- package/src/components/notification/Notification.tsx +0 -188
- package/src/components/notification/NotificationIcon.tsx +0 -21
- package/src/components/notification/NotificationStack.tsx +0 -66
- package/src/components/notification/NotificationText.tsx +0 -47
- package/src/components/notification/NotificationTitle.tsx +0 -47
- package/src/components/notification/context.ts +0 -14
- package/src/components/notification/index.ts +0 -25
- package/src/components/notification/notificationQueue.ts +0 -48
- package/src/components/otp-input/OtpBox.tsx +0 -68
- package/src/components/otp-input/OtpInput.tsx +0 -342
- package/src/components/otp-input/index.ts +0 -6
- package/src/components/pagination/Pagination.tsx +0 -212
- package/src/components/pagination/PaginationItem.tsx +0 -152
- package/src/components/pagination/index.ts +0 -12
- package/src/components/password-strength/PasswordStrength.tsx +0 -155
- package/src/components/password-strength/index.ts +0 -6
- package/src/components/password-strength/strengthScore.ts +0 -79
- package/src/components/placeholder/Placeholder.tsx +0 -178
- package/src/components/placeholder/index.ts +0 -6
- package/src/components/popover/Popover.tsx +0 -269
- package/src/components/popover/index.ts +0 -6
- package/src/components/progress/Progress.tsx +0 -154
- package/src/components/progress/ProgressBar.tsx +0 -88
- package/src/components/progress/index.ts +0 -8
- package/src/components/radio/Radio.tsx +0 -98
- package/src/components/radio/RadioGroup.tsx +0 -142
- package/src/components/radio/context.ts +0 -14
- package/src/components/radio/index.ts +0 -8
- package/src/components/range-input/RangeInput.tsx +0 -109
- package/src/components/range-input/index.ts +0 -6
- package/src/components/select/Select.tsx +0 -277
- package/src/components/select/index.ts +0 -6
- package/src/components/skeleton/Skeleton.tsx +0 -89
- package/src/components/skeleton/SkeletonLoader.tsx +0 -98
- package/src/components/skeleton/index.ts +0 -8
- package/src/components/spinner/Spinner.tsx +0 -77
- package/src/components/spinner/index.ts +0 -6
- package/src/components/stack/Stack.tsx +0 -81
- package/src/components/stack/index.ts +0 -6
- package/src/components/static-table/StaticTable.tsx +0 -78
- package/src/components/static-table/index.ts +0 -8
- package/src/components/stepper/Stepper.tsx +0 -172
- package/src/components/stepper/StepperItem.tsx +0 -66
- package/src/components/stepper/index.ts +0 -8
- package/src/components/switch/Switch.tsx +0 -259
- package/src/components/switch/index.ts +0 -6
- package/src/components/table/Table.css +0 -39
- package/src/components/table/Table.tsx +0 -405
- package/src/components/table/TableBody.tsx +0 -25
- package/src/components/table/TableCell.tsx +0 -27
- package/src/components/table/TableColumn.tsx +0 -31
- package/src/components/table/TableHeader.tsx +0 -26
- package/src/components/table/TableRow.tsx +0 -24
- package/src/components/table/index.ts +0 -16
- package/src/components/tabs/Tab.tsx +0 -36
- package/src/components/tabs/TabList.tsx +0 -76
- package/src/components/tabs/TabPanel.tsx +0 -68
- package/src/components/tabs/Tabs.tsx +0 -136
- package/src/components/tabs/context.ts +0 -24
- package/src/components/tabs/index.ts +0 -12
- package/src/components/text-input/TextInput.tsx +0 -188
- package/src/components/text-input/index.ts +0 -6
- package/src/components/textarea/Textarea.tsx +0 -145
- package/src/components/textarea/index.ts +0 -6
- package/src/components/toast/Toast.tsx +0 -220
- package/src/components/toast/ToastBody.tsx +0 -64
- package/src/components/toast/ToastFooter.tsx +0 -47
- package/src/components/toast/ToastHeader.tsx +0 -105
- package/src/components/toast/ToastIcon.tsx +0 -21
- package/src/components/toast/Toaster.tsx +0 -87
- package/src/components/toast/context.ts +0 -14
- package/src/components/toast/index.ts +0 -26
- package/src/components/toast/toastQueue.ts +0 -56
- package/src/components/tooltip/Tooltip.tsx +0 -171
- package/src/components/tooltip/index.ts +0 -6
- package/src/global.d.ts +0 -2
- package/src/hooks/index.ts +0 -57
- package/src/hooks/useAutoDismiss.ts +0 -91
- package/src/hooks/useButtonSemantics.ts +0 -33
- package/src/hooks/useControllableState.ts +0 -24
- package/src/hooks/useDialogElement.ts +0 -226
- package/src/hooks/useDisabledAnchorGuard.ts +0 -22
- package/src/hooks/useDismissibleTransition.ts +0 -126
- package/src/hooks/useDrawer.ts +0 -9
- package/src/hooks/useFloatingOverlay.ts +0 -125
- package/src/hooks/useForkedRef.ts +0 -50
- package/src/hooks/useFormField.ts +0 -89
- package/src/hooks/useIconConfig.ts +0 -6
- package/src/hooks/useIsomorphicLayoutEffect.ts +0 -9
- package/src/hooks/useModal.ts +0 -9
- package/src/hooks/useNotification.ts +0 -10
- package/src/hooks/useOverlayPlacement.ts +0 -93
- package/src/hooks/usePagination.ts +0 -89
- package/src/hooks/useToast.ts +0 -9
- package/src/hooks/useToastRegionQueue.ts +0 -27
- package/src/index.ts +0 -522
- package/src/types.ts +0 -133
- package/src/utils/breakpoints.ts +0 -43
- package/src/utils/comboboxCollection.tsx +0 -152
- package/src/utils/dateRangePresets.ts +0 -6
- package/src/utils/devWarning.ts +0 -58
- package/src/utils/dialogTransition.ts +0 -39
- package/src/utils/direction.ts +0 -14
- package/src/utils/focusRedirect.ts +0 -23
- package/src/utils/iconConfig.ts +0 -88
- package/src/utils/iconSlot.tsx +0 -41
- package/src/utils/isWholeUnitDisabled.ts +0 -17
- package/src/utils/mergeIsDateUnavailable.ts +0 -15
- package/src/utils/overlayPlacement.ts +0 -93
- package/src/utils/pointerInteraction.ts +0 -21
- package/src/utils/polymorphic.ts +0 -100
- package/src/utils/renderMenuItemContent.tsx +0 -57
- package/src/utils/setVisibleRangeStart.ts +0 -64
- package/src/utils/slot.tsx +0 -78
- package/src/utils/spacingClassName.ts +0 -14
- package/src/utils/suppressFocusRingGlobally.ts +0 -84
- package/src/utils/tableClassName.ts +0 -93
- package/src/utils/triggerElement.ts +0 -25
- package/src/utils/validationClassName.ts +0 -8
- package/src/utils/virtualFocusStyle.ts +0 -16
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./focus-ring-SR_LwaN7.js";
|
|
2
|
+
import { ReactElement, ReactNode } from "react";
|
|
3
|
+
//#region src/components/portal/Portal.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* `false` on the server and during hydration, `true` afterwards and in a client-only render. React
|
|
6
|
+
* hydrates against the server snapshot, then re-renders with the client one once hydration has
|
|
7
|
+
* finished, so a component can render something that only exists in the browser without
|
|
8
|
+
* mismatching the server's HTML.
|
|
9
|
+
*/
|
|
10
|
+
declare function useHydrated(): boolean;
|
|
11
|
+
interface PortalProps {
|
|
12
|
+
/**
|
|
13
|
+
* The content to render in the portal.
|
|
14
|
+
*/
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Where the children are portaled. Defaults to `document.body`.
|
|
18
|
+
*/
|
|
19
|
+
container?: Element | DocumentFragment | null;
|
|
20
|
+
/**
|
|
21
|
+
* Rendered in place until the portal exists: on the server and during hydration. Nothing by
|
|
22
|
+
* default.
|
|
23
|
+
*/
|
|
24
|
+
fallback?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Renders its children into `container` (`document.body` by default), and renders `fallback` on the
|
|
28
|
+
* server and during hydration, so server-rendered pages hydrate without a mismatch.
|
|
29
|
+
*/
|
|
30
|
+
declare function Portal({ children, container, fallback }: PortalProps): ReactElement;
|
|
31
|
+
declare namespace Portal {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { PortalProps as n, useHydrated as r, Portal as t };
|
|
36
|
+
//# sourceMappingURL=index-g74gO0pc.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./focus-ring-SR_LwaN7.js";
|
|
2
|
-
import {
|
|
2
|
+
import { r as ContextColor } from "./types-D6FM7bYR.js";
|
|
3
3
|
import React, { InputHTMLAttributes, ReactNode } from "react";
|
|
4
4
|
//#region src/components/switch/Switch.d.ts
|
|
5
5
|
interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'defaultChecked' | 'onChange' | 'size'> {
|
|
@@ -55,4 +55,5 @@ interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'check
|
|
|
55
55
|
}
|
|
56
56
|
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
57
57
|
//#endregion
|
|
58
|
-
export { SwitchProps as n, Switch as t };
|
|
58
|
+
export { SwitchProps as n, Switch as t };
|
|
59
|
+
//# sourceMappingURL=index-lSPcxiii.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./focus-ring-SR_LwaN7.js";
|
|
2
2
|
import { n as PolymorphicRef, r as PolymorphicRefWithFallback, t as PolymorphicComponentProps } from "./polymorphic-CVHbTHSN.js";
|
|
3
|
-
import {
|
|
4
|
-
import { i as IconValue } from "./iconConfig-
|
|
3
|
+
import { i as ContextStyle, r as ContextColor, t as Breakpoint } from "./types-D6FM7bYR.js";
|
|
4
|
+
import { i as IconValue } from "./iconConfig-C6gbYhsD.js";
|
|
5
5
|
import React, { ElementType, HTMLAttributes, ReactElement } from "react";
|
|
6
6
|
//#region src/components/navbar/Navbar.d.ts
|
|
7
7
|
type NavbarOwnProps<C extends ElementType> = {
|
|
@@ -134,4 +134,5 @@ interface NavbarTogglerProps extends HTMLAttributes<HTMLButtonElement> {
|
|
|
134
134
|
}
|
|
135
135
|
declare const NavbarToggler: React.ForwardRefExoticComponent<NavbarTogglerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
136
136
|
//#endregion
|
|
137
|
-
export { NavbarNav as a, NavbarBrandProps as c, NavbarTextProps as i, Navbar as l, NavbarTogglerProps as n, NavbarNavProps as o, NavbarText as r, NavbarBrand as s, NavbarToggler as t, NavbarProps as u };
|
|
137
|
+
export { NavbarNav as a, NavbarBrandProps as c, NavbarTextProps as i, Navbar as l, NavbarTogglerProps as n, NavbarNavProps as o, NavbarText as r, NavbarBrand as s, NavbarToggler as t, NavbarProps as u };
|
|
138
|
+
//# sourceMappingURL=index-x0vZRyoU.d.ts.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import t from"react";import n from"classnames";function r({children:e,className:r,component:i,onMouseDown:a,...o},s){let c=i??`span`,l=n(`input-adorn`,r);return t.createElement(c,{className:l,onMouseDown:e=>{a?.(e),e.defaultPrevented||e.preventDefault()},...o,ref:s},e)}const i=e(r,`InputAdorn`);export{i as t};
|
|
2
|
+
//# sourceMappingURL=input-adorn-DwdX-jxA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-adorn-DwdX-jxA.js","names":[],"sources":["../../src/components/input-adorn/InputAdorn.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype InputAdornOwnProps<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. Use\n * `\"button\"` or `\"a\"` for an actionable adorn, e.g. a password reveal toggle or a clear button.\n */\n component?: C\n}\n\nexport type InputAdornProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n InputAdornOwnProps<C>\n>\n\ntype InputAdornComponent = (<C extends ElementType = 'span'>(\n props: InputAdornProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction InputAdornRender<C extends ElementType = 'span'>(\n { children, className, component, onMouseDown, ...rest }: InputAdornProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('input-adorn', className)\n const handleMouseDown: React.MouseEventHandler<Element> = (event) => {\n onMouseDown?.(event)\n // Keep focus on the associated input (e.g. a password toggle) instead of\n // letting the browser shift it to this button/anchor on mousedown.\n if (!event.defaultPrevented) {\n event.preventDefault()\n }\n }\n return (\n <Component className={_className} onMouseDown={handleMouseDown} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const InputAdorn = createPolymorphicComponent<InputAdornComponent>(\n InputAdornRender as ForwardRefRenderFunction<Element, InputAdornProps<ElementType>>,\n 'InputAdorn'\n)\n"],"mappings":"8HA8BA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,cAAa,GAAG,GAClD,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EAAW,cAAe,CAAS,EAStD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,YATuB,GAAU,CACnE,IAAc,CAAK,EAGd,EAAM,kBACT,EAAM,eAAe,CAEzB,EAEkE,GAAI,EAAW,KAEpE,EADR,CACQ,CAEf,CAEA,MAAa,EAAa,EACxB,EACA,YACF"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import t from"react";import n from"classnames";function r({children:e,className:r,component:i,size:a,...o},s){let c=i??`div`,l=n(`input-group`,a,r);return t.createElement(c,{className:l,...o,ref:s},e)}const i=e(r,`InputGroup`);function a({children:e,className:r,component:i,...a},o){let s=i??`span`,c=n(`input-addon`,r);return t.createElement(s,{className:c,...a,ref:o},e)}const o=e(a,`InputGroupAddon`);export{i as n,o as t};
|
|
2
|
+
//# sourceMappingURL=input-group-Cuiuf4Dl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-group-Cuiuf4Dl.js","names":[],"sources":["../../src/components/input-group/InputGroup.tsx","../../src/components/input-group/InputGroupAddon.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype InputGroupOwnProps<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 * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n}\n\nexport type InputGroupProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n InputGroupOwnProps<C>\n>\n\ntype InputGroupComponent = (<C extends ElementType = 'div'>(\n props: InputGroupProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction InputGroupRender<C extends ElementType = 'div'>(\n { children, className, component, size, ...rest }: InputGroupProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('input-group', size, className)\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const InputGroup = createPolymorphicComponent<InputGroupComponent>(\n InputGroupRender as ForwardRefRenderFunction<Element, InputGroupProps<ElementType>>,\n 'InputGroup'\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 InputGroupAddonOwnProps<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 * The id of the form control this addon labels, when rendered as `component=\"label\"`.\n */\n htmlFor?: string\n}\n\nexport type InputGroupAddonProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n InputGroupAddonOwnProps<C>\n>\n\ntype InputGroupAddonComponent = (<C extends ElementType = 'span'>(\n props: InputGroupAddonProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction InputGroupAddonRender<C extends ElementType = 'span'>(\n { children, className, component, ...rest }: InputGroupAddonProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('input-addon', className)\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const InputGroupAddon = createPolymorphicComponent<InputGroupAddonComponent>(\n InputGroupAddonRender as ForwardRefRenderFunction<Element, InputGroupAddonProps<ElementType>>,\n 'InputGroupAddon'\n)\n"],"mappings":"8HAiCA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,OAAM,GAAG,GAC3C,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,cAAe,EAAM,CAAS,EAC5D,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAa,EACxB,EACA,YACF,EChBA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EAAW,cAAe,CAAS,EACtD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAkB,EAC7B,EACA,iBACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isValidElement as e}from"react";const t=Symbol.for(`react.lazy`),n=e=>typeof e==`object`&&!!e&&e.$$typeof===t&&typeof e._init==`function`;function r(e){let t=e;for(;n(t);)t=t._init(t._payload);return t}function i(t,n){return e(t)?t.type===n||r(t.type)===n:!1}export{r as n,i as t};
|
|
2
|
+
//# sourceMappingURL=lazyElement-tfMG21pZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazyElement-tfMG21pZ.js","names":[],"sources":["../../src/utils/lazyElement.ts"],"sourcesContent":["import { isValidElement, ReactElement } from 'react'\n\n// What React Server Components hand a client component in place of a value that isn't ready, or\n// that they never resolve eagerly. Two cases reach this library, both from a Server Component\n// that composes its components directly:\n//\n// - An element's `type`, when it is a client component: always a lazy wrapper around the module,\n// in a production build too. `child.type === ListItem` is therefore false for a `<ListItem>`\n// written in a Server Component.\n// - A whole element, when something in its props is still loading (a client component passed by\n// reference, a server function): a lazy node, which is not a valid element and has no `props`.\n// See #37.\n//\n// React resolves both when it renders them. Code that reads a child before rendering it\n// (`isValidElement`, `child.type === X`, `child.props`) has to resolve them itself, the way\n// React's own `Children` helpers do: by calling the node's `_init` with its `_payload`. That\n// returns the value, or throws what React throws for a lazy component: a thenable while the value\n// is loading, which suspends the component until it is there, or the error it failed with.\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy')\n\ninterface LazyNode {\n $$typeof: symbol\n _init: (payload: unknown) => unknown\n _payload: unknown\n}\n\nconst isLazy = (value: unknown): value is LazyNode =>\n typeof value === 'object' &&\n value !== null &&\n (value as LazyNode).$$typeof === REACT_LAZY_TYPE &&\n typeof (value as LazyNode)._init === 'function'\n\n// The value a lazy node or lazy type stands for; anything else comes back as it is. A lazy value\n// can hold another, so this unwraps until it reaches one that isn't.\nexport function resolveLazy<T>(value: T): T {\n let resolved: unknown = value\n while (isLazy(resolved)) resolved = resolved._init(resolved._payload)\n return resolved as T\n}\n\n// Whether `node` is an element of `Component`. Replaces `isValidElement(node) && node.type ===\n// Component`, which a Server Component's children fail.\nexport function isElementOfType<P>(\n node: unknown,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Component: (props: any) => unknown\n): node is ReactElement<P>\nexport function isElementOfType<P>(node: unknown, Component: object): node is ReactElement<P>\nexport function isElementOfType<P>(node: unknown, Component: unknown): node is ReactElement<P> {\n if (!isValidElement(node)) return false\n return node.type === Component || resolveLazy(node.type) === Component\n}\n"],"mappings":"uCAkBA,MAAM,EAAkB,OAAO,IAAI,YAAY,EAQzC,EAAU,GACd,OAAO,GAAU,YACjB,GACC,EAAmB,WAAa,GACjC,OAAQ,EAAmB,OAAU,WAIvC,SAAgB,EAAe,EAAa,CAC1C,IAAI,EAAoB,EACxB,KAAO,EAAO,CAAQ,GAAG,EAAW,EAAS,MAAM,EAAS,QAAQ,EACpE,OAAO,CACT,CAUA,SAAgB,EAAmB,EAAe,EAA6C,CAE7F,OADK,EAAe,CAAI,EACjB,EAAK,OAAS,GAAa,EAAY,EAAK,IAAI,IAAM,EAD3B,EAEpC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{d as e,f as t,g as n,h as r,m as i,p as a,u as o}from"./slot-CNhFZdHF.js";import{t as s}from"./lazyElement-tfMG21pZ.js";import{t as c}from"./polymorphic-BhGNZQja.js";import{t as l}from"./Link-CZsWCnQb.js";import u,{Children as d}from"react";import f from"classnames";function p({children:r,active:i,className:o,disabled:s,color:c,component:d,href:p,...m},h){let g=a(d,p,`li`),_=n(g,p,m),v=t(_),y=e(_,p,`ListItem`),b=f(`list-item`,c&&`context`,c,{"list-action":v,active:i&&!v,disabled:s&&!v},o),x=v?l:g,S=v?{active:i,disabled:s,component:g,...y,...m}:{...i&&{"aria-current":`page`},...s&&{"aria-disabled":!0},...y,...m};return u.createElement(x,{className:b,...S,ref:h},r)}const m=c(p,`ListItem`);function h({children:e,className:n,component:c,color:l,variant:p,flush:h,items:g,layout:_,numbered:v,plain:y,...b},x){let S=g?g.some(e=>o(e.href)):d.toArray(e).some(e=>s(e,m)&&t(r(e.props))),C=c??(S?`div`:`ul`),w=i(C),T=w===`ul`||w===`ol`,E=f(`list`,l&&`context`,l,p,_,{flush:h,plain:y,numbered:v},n),D=(g?g.map((e,t)=>{let n=f(`list-item`,e.color&&`context`,e.color,{"list-action":o(e.href),active:e.active,disabled:e.disabled}),r=a(void 0,e.href,T?`li`:`div`);return u.createElement(r,{key:e.id??t,className:n,...o(e.href)&&{href:e.href},...e.active?{"aria-current":`page`}:{},...e.disabled?{"aria-disabled":!0}:{}},e.label)}):null)??(T?e:d.map(e,e=>s(e,m)&&r(e.props)===void 0?u.cloneElement(e,{component:`div`}):e));return u.createElement(C,{className:E,...b,ref:x},D)}const g=c(h,`List`);export{m as n,g as t};
|
|
2
|
+
//# sourceMappingURL=list-BQCkwWjF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-BQCkwWjF.js","names":[],"sources":["../../src/components/list/ListItem.tsx","../../src/components/list/List.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport { hrefProps, isInteractiveKind, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\nimport { Link } from '../link/Link'\n\ntype ListItemOwnProps<C extends ElementType> = {\n /**\n * Toggle the active state for the component.\n */\n active?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: 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 * The href attribute specifies the URL of the page the link goes to. Renders an `<a>` in place\n * of the `<li>`, unless `component` or `asChild` chose the element. Inside a `List`, the list\n * renders a `<div>` around it in place of the `<ul>`.\n */\n href?: string\n}\n\nexport type ListItemProps<C extends ElementType = 'li'> = PolymorphicComponentProps<\n C,\n ListItemOwnProps<C>\n>\n\ntype ListItemComponent = (<C extends ElementType = 'li'>(\n props: ListItemProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLLIElement | HTMLAnchorElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ListItemRender<C extends ElementType = 'li'>(\n { children, active, className, disabled, color, component, href, ...rest }: ListItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n // `href` makes it an `<a>`, unless `component` or `asChild` chose the element (see\n // `linkElement`). It used to stay an `<li>` and carry `href` as an attribute.\n const tag = linkElement(component, href, 'li')\n // The kind rather than the tag, counting a router link with `href` or `to` as an anchor: under `asChild`, `tag` is a `Slot` standing in for the caller's\n // element, and a slotted `<a>` is as interactive as `component=\"a\"`.\n const kind = resolveLinkKind(tag, href, rest)\n const isInteractive = isInteractiveKind(kind)\n const linkProps = hrefProps(kind, href, 'ListItem')\n\n const _className = classNames(\n 'list-item',\n color && 'context',\n color,\n {\n 'list-action': isInteractive,\n // An interactive item renders through `Link`, which adds these classes and their ARIA\n // attributes itself.\n active: active && !isInteractive,\n disabled: disabled && !isInteractive\n },\n className\n )\n\n const Component = (isInteractive ? Link : tag) as ElementType\n\n const finalRest = isInteractive\n ? { active, disabled, component: tag, ...linkProps, ...rest }\n : {\n ...(active && { 'aria-current': 'page' }),\n ...(disabled && { 'aria-disabled': true }),\n ...linkProps,\n ...rest\n }\n\n return (\n <Component className={_className} {...finalRest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ListItem = createPolymorphicComponent<ListItemComponent>(\n ListItemRender as ForwardRefRenderFunction<Element, ListItemProps<ElementType>>,\n 'ListItem'\n)\n","import React, {\n Children,\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode\n} from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor, ContextStyle } from '../../types'\nimport {\n hasHref,\n isInteractiveKind,\n linkElement,\n resolveElementTag,\n resolveKindFromProps\n} from '../../utils/elementKind'\nimport { isElementOfType } from '../../utils/lazyElement'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { ListItem } from './ListItem'\n\nexport interface ListItemDef {\n /**\n * Stable key for the rendered item. Falls back to the item's index in `items`.\n */\n id?: number | string\n /**\n * Item label content.\n */\n label: React.ReactNode\n /**\n * Makes the item a link.\n */\n href?: string\n /**\n * Sets the color of the item.\n */\n color?: ContextColor\n /**\n * Marks the item as active.\n */\n active?: boolean\n /**\n * Marks the item as disabled.\n */\n disabled?: boolean\n}\n\ntype ListOwnProps<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 `'ul'`, unless an item (a data-driven item with `href`, or a `<ListItem>` child\n * rendering an `<a>`/`<button>` through `component` or `asChild`) is interactive — a bare\n * `<a>`/`<button>` isn't a valid direct child of `<ul>`/`<ol>`, so the default switches to\n * `'div'` instead. Pass `component` explicitly to opt out of this.\n */\n component?: C\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Remove outer borders and rounded corners to render list items edge-to-edge in a parent component (e.g., `<Card>`).\n */\n flush?: boolean\n /**\n * Array of item definitions for data-driven rendering. When provided, children are ignored.\n */\n items?: ListItemDef[]\n /**\n * Specify a layout type.\n */\n layout?:\n | 'horizontal'\n | 'sm:horizontal'\n | 'md:horizontal'\n | 'lg:horizontal'\n | 'xl:horizontal'\n | '2xl:horizontal'\n /**\n * Number list items sequentially using CSS counters. Pair with `component=\"ol\"` for semantic correctness.\n */\n numbered?: boolean\n /**\n * Remove outer borders, rounded corners, and horizontal padding for a minimal, edge-to-edge appearance.\n */\n plain?: boolean\n /**\n * Applies a `.solid`, `.outline`, or `.smooth` context style. Only meaningful together with `color`.\n */\n variant?: ContextStyle\n}\n\n// What `List` reads off a `<ListItem>` child to decide its own tag.\ntype ListItemChildProps = {\n asChild?: boolean\n children?: ReactNode\n component?: ElementType\n href?: string\n}\n\nexport type ListProps<C extends ElementType = 'ul'> = PolymorphicComponentProps<C, ListOwnProps<C>>\n\ntype ListComponent = (<C extends ElementType = 'ul'>(\n props: ListProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ListRender<C extends ElementType = 'ul'>(\n {\n children,\n className,\n component,\n color,\n variant,\n flush,\n items,\n layout,\n numbered,\n plain,\n ...rest\n }: ListProps<C>,\n ref: PolymorphicRef<C>\n) {\n // A linked item (data-driven `href`, or a `<ListItem>` child rendering an `<a>`/`<button>`,\n // whether through `component` or as its `asChild` element) can't render as a bare\n // `<a>`/`<button>` inside the default `<ul>`/`<ol>` root — only `<li>`/`script`/`template` are\n // valid children there. Default to `<div>` instead when that's the case (unless the caller\n // already chose their own `component`), matching the same `component=\"div\"` pattern already\n // documented for `Stepper`'s composed interactive usage.\n const hasInteractiveItem = items\n ? items.some((item) => hasHref(item.href))\n : Children.toArray(children).some(\n (child) =>\n isElementOfType<ListItemChildProps>(child, ListItem) &&\n isInteractiveKind(resolveKindFromProps(child.props))\n )\n const Component = (component ?? (hasInteractiveItem ? 'div' : 'ul')) as ElementType\n // The tag rather than `Component`, which under `asChild` is a `Slot` holding the caller's\n // `<ul>`/`<ol>`.\n const rootTag = resolveElementTag(Component)\n const isListSemantic = rootTag === 'ul' || rootTag === 'ol'\n\n const _className = classNames(\n 'list',\n color && 'context',\n color,\n variant,\n layout,\n {\n flush,\n plain,\n numbered\n },\n className\n )\n\n const autoContent = items\n ? items.map((item, idx) => {\n const itemClass = classNames('list-item', item.color && 'context', item.color, {\n 'list-action': hasHref(item.href),\n active: item.active,\n disabled: item.disabled\n })\n const Tag = linkElement(undefined, item.href, isListSemantic ? 'li' : 'div')\n return (\n <Tag\n key={item.id ?? idx}\n className={itemClass}\n {...(hasHref(item.href) && { href: item.href })}\n {...(item.active ? { 'aria-current': 'page' } : {})}\n {...(item.disabled ? { 'aria-disabled': true } : {})}\n >\n {item.label}\n </Tag>\n )\n })\n : null\n\n // When the root switched to `div` because of an interactive child, every plain `<ListItem>`\n // sibling defaulting to `<li>` would be just as invalid (only valid inside `<ul>`/`<ol>`/\n // `<menu>`) — so give each `ListItem` child the same `div` treatment the auto-generated items\n // above already get, unless it chose its own element: `component`, `href` or its `asChild`\n // element. Other child types are left untouched — this is only meaningful for `List`'s own list\n // items.\n const renderedChildren =\n autoContent ??\n (isListSemantic\n ? children\n : Children.map(children, (child) =>\n isElementOfType<ListItemChildProps>(child, ListItem) &&\n resolveKindFromProps(child.props) === undefined\n ? React.cloneElement(child, { component: 'div' })\n : child\n ))\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {renderedChildren}\n </Component>\n )\n}\n\nexport const List = createPolymorphicComponent<ListComponent>(\n ListRender as ForwardRefRenderFunction<Element, ListProps<ElementType>>,\n 'List'\n)\n"],"mappings":"mTAqDA,SAAS,EACP,CAAE,WAAU,SAAQ,YAAW,WAAU,QAAO,YAAW,OAAM,GAAG,GACpE,EACA,CAGA,IAAM,EAAM,EAAY,EAAW,EAAM,IAAI,EAGvC,EAAO,EAAgB,EAAK,EAAM,CAAI,EACtC,EAAgB,EAAkB,CAAI,EACtC,EAAY,EAAU,EAAM,EAAM,UAAU,EAE5C,EAAa,EACjB,YACA,GAAS,UACT,EACA,CACE,cAAe,EAGf,OAAQ,GAAU,CAAC,EACnB,SAAU,GAAY,CAAC,CACzB,EACA,CACF,EAEM,EAAa,EAAgB,EAAO,EAEpC,EAAY,EACd,CAAE,SAAQ,WAAU,UAAW,EAAK,GAAG,EAAW,GAAG,CAAK,EAC1D,CACE,GAAI,GAAU,CAAE,eAAgB,MAAO,EACvC,GAAI,GAAY,CAAE,gBAAiB,EAAK,EACxC,GAAG,EACH,GAAG,CACL,EAEJ,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAgB,K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AW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAO,EAClB,EACA,MACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./Portal-CgeR1WXV.js";import{i as n,r}from"./overlayPlacement-BtS90IVf.js";import{n as i}from"./Menu-CSBg2Zmc.js";import{a,c as o,i as s,o as ee,r as c,s as l}from"./MenuToggle-BdQtF7FV.js";import u,{forwardRef as d,useCallback as f,useContext as p,useEffect as m,useId as te,useRef as h,useState as ne}from"react";import g from"classnames";import{useLocale as _,useOverlayPosition as v}from"react-aria";function y({children:e,className:t,component:n,...r},i){let a=n??`span`,o=g(`menu-text`,t);return u.createElement(a,{className:o,...r,ref:i},e)}const b=e(y,`MenuText`),x=d(({children:e,activation:d=`both`,className:y,disabled:b,offset:x=[-4,0],placement:S,stacked:C,submenuDelay:w=100,trigger:T,...E},D)=>{let O=te(),k=`${O}-trigger`,A=`${O}-menu`,[j,M]=ne(!1),N=h(void 0),P=h(void 0),F=h(null),I=h(null),L=p(s),R=a(),{registerOverlay:z,visible:B}=p(i),{direction:V}=_(),H=V===`rtl`,U=S??(H?`left-start`:`right-start`),{overlayProps:W,placement:G}=v({targetRef:F,overlayRef:I,placement:n(U),offset:x[1],crossOffset:x[0],containerPadding:8,isOpen:j,onClose:null}),{menuStyle:re,placementAttr:ie}=r(W.style,U,G),K=f(()=>{N.current!==void 0&&(window.clearTimeout(N.current),N.current=void 0)},[]),q=f(()=>{P.current!==void 0&&(cancelAnimationFrame(P.current),P.current=void 0)},[]),J=f(()=>{K(),q(),M(!1)},[K,q]),Y=()=>{b||j||(K(),L?.notifyOpen(O),M(!0))},X=()=>{K(),N.current=window.setTimeout(J,w)};m(()=>L?.register(O,J),[L,O,J]),m(()=>K,[K]),m(()=>q,[q]),m(()=>{B||J()},[B,J]);let Z=typeof window<`u`&&!!window.matchMedia&&window.matchMedia(`(hover: hover)`).matches&&(d===`hover`||d===`both`),ae=d===`click`||d===`both`,Q=()=>{Y(),q(),P.current=requestAnimationFrame(()=>{P.current=void 0,ee(l(I.current),`first`)})},$=()=>{J(),F.current?.focus()},oe=e=>{ae&&!b&&(e.preventDefault(),e.stopPropagation(),j?J():Q())},se=H?`ArrowLeft`:`ArrowRight`,ce=e=>{b||(e.key===`Enter`||e.key===` `||e.key===se)&&(e.preventDefault(),e.stopPropagation(),Q())},le={close:$};return u.createElement(`div`,{className:g(`submenu`,{show:j},y),...E,ref:D},u.createElement(`button`,{type:`button`,id:k,role:`menuitem`,className:`menu-item`,"aria-expanded":j,"aria-haspopup":`true`,"aria-controls":j?A:void 0,disabled:b,onClick:oe,onKeyDown:ce,onMouseEnter:Z?Y:void 0,onMouseLeave:Z?X:void 0,ref:e=>{F.current=e}},T),(()=>{let n=u.createElement(`div`,{role:`menu`,id:A,"aria-labelledby":k,className:g(`menu`,{show:j,"submenu-stacked":C}),style:re,"data-cx-placement":ie,onKeyDown:e=>o(e,{onEscape:$,...H?{onArrowRight:$}:{onArrowLeft:$}}),onMouseEnter:Z?K:void 0,onMouseLeave:Z?X:void 0,ref:e=>{I.current=e,z(A,e)}},u.createElement(c.Provider,{value:le},u.createElement(s.Provider,{value:R},e)));return C?n:u.createElement(t,{fallback:n},n)})())});x.displayName=`MenuSubmenu`;const S=d(({children:e,className:t,onClick:n,type:r=`button`,...i},a)=>{let o=p(c),s=e=>{n?.(e),o?.close()};return u.createElement(`button`,{type:r,role:`menuitem`,className:g(`submenu-back`,`menu-item`,t),...i,onClick:s,ref:a},e)});S.displayName=`MenuSubmenuBack`;export{x as n,b as r,S as t};
|
|
2
|
+
//# sourceMappingURL=menu-98EAD9nj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-98EAD9nj.js","names":[],"sources":["../../src/components/menu/MenuText.tsx","../../src/components/menu/MenuSubmenu.tsx","../../src/components/menu/MenuSubmenuBack.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype MenuTextOwnProps<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 MenuTextProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n MenuTextOwnProps<C>\n>\n\ntype MenuTextComponent = (<C extends ElementType = 'span'>(\n props: MenuTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction MenuTextRender<C extends ElementType = 'span'>(\n { children, className, component, ...rest }: MenuTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('menu-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const MenuText = createPolymorphicComponent<MenuTextComponent>(\n MenuTextRender as ForwardRefRenderFunction<Element, MenuTextProps<ElementType>>,\n 'MenuText'\n)\n","import React, {\n forwardRef,\n HTMLAttributes,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState\n} from 'react'\nimport classNames from 'classnames'\nimport { useLocale, useOverlayPosition } from 'react-aria'\n\nimport { MenuContext } from './Menu'\nimport {\n Placement,\n resolveMenuOverlayPositioning,\n toAriaPlacement\n} from '../../utils/overlayPlacement'\nimport { Portal } from '../portal/Portal'\nimport { focusMenuItem, getMenuItems, handleMenuKeyDown } from './menuNavigation'\nimport { SubmenuActionsContext, SubmenuGroupContext, useSubmenuGroupProvider } from './submenuGroup'\n\nexport interface MenuSubmenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n /**\n * MenuSubmenu activation mode on hover-capable devices. `'click'` activates on click only.\n * `'hover'` activates on hover only. `'both'` (the default) activates on both. Touch\n * devices always use tap regardless of this setting.\n */\n activation?: 'click' | 'hover' | 'both'\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Prevents the submenu from opening.\n */\n disabled?: boolean\n /**\n * Distance between the nested menu and the trigger, as `[skidding, distance]` in pixels.\n */\n offset?: [number, number]\n /**\n * Placement of the nested menu relative to the trigger. Defaults to cascading in the reading\n * direction — `'right-start'` under LTR locales, `'left-start'` under RTL ones (see\n * `useLocale`) — matching native OS/browser submenu behavior. An explicit value always wins\n * over that locale-based default.\n */\n placement?: Placement\n /**\n * Switches to a view-replacement pattern below the `sm` breakpoint. Pair with a\n * `MenuSubmenuBack` as the first item of the nested menu.\n */\n stacked?: boolean\n /**\n * Milliseconds before closing the submenu when the pointer leaves it.\n */\n submenuDelay?: number\n /**\n * Content of the `.menu-item` trigger that opens the submenu.\n */\n trigger: ReactNode\n}\n\nexport const MenuSubmenu = forwardRef<HTMLDivElement, MenuSubmenuProps>(\n (\n {\n children,\n activation = 'both',\n className,\n disabled,\n offset: offsetProp = [-4, 0],\n placement,\n stacked,\n submenuDelay = 100,\n trigger,\n ...rest\n },\n ref\n ) => {\n const id = useId()\n const triggerId = `${id}-trigger`\n const menuId = `${id}-menu`\n const [visible, setVisible] = useState(false)\n const closeTimeoutRef = useRef<number | undefined>(undefined)\n const focusFirstRafRef = useRef<number | undefined>(undefined)\n const triggerRef = useRef<HTMLButtonElement | null>(null)\n const overlayRef = useRef<HTMLElement | null>(null)\n const parentGroup = useContext(SubmenuGroupContext)\n const ownGroup = useSubmenuGroupProvider()\n const { registerOverlay, visible: parentMenuVisible } = useContext(MenuContext)\n const { direction } = useLocale()\n const isRtl = direction === 'rtl'\n const effectivePlacement = placement ?? (isRtl ? 'left-start' : 'right-start')\n\n const { overlayProps, placement: resolvedPlacement } = useOverlayPosition({\n targetRef: triggerRef,\n overlayRef,\n // Viewport-relative (matching the portal below): the trigger lives inside the parent\n // menu's own floated panel, and `useOverlayPosition` measures against the overlay's real\n // containing block — since the panel portals straight to `document.body`, that resolves\n // the same way a `fixed`-strategy engine would.\n placement: toAriaPlacement(effectivePlacement),\n offset: offsetProp[1],\n crossOffset: offsetProp[0],\n containerPadding: 8,\n isOpen: visible,\n // See `useOverlayPlacement`'s comment for why this needs to be explicit `null`, not left\n // unset — matches the same fix already applied to `Autocomplete`/`Combobox`/`Menu`/`Popover`.\n onClose: null\n })\n\n const { menuStyle, placementAttr } = resolveMenuOverlayPositioning(\n overlayProps.style,\n effectivePlacement,\n resolvedPlacement\n )\n\n const clearCloseTimeout = useCallback(() => {\n if (closeTimeoutRef.current !== undefined) {\n window.clearTimeout(closeTimeoutRef.current)\n closeTimeoutRef.current = undefined\n }\n }, [])\n\n const cancelFocusFirstRaf = useCallback(() => {\n if (focusFirstRafRef.current !== undefined) {\n cancelAnimationFrame(focusFirstRafRef.current)\n focusFirstRafRef.current = undefined\n }\n }, [])\n\n const close = useCallback(() => {\n clearCloseTimeout()\n cancelFocusFirstRaf()\n setVisible(false)\n }, [clearCloseTimeout, cancelFocusFirstRaf])\n\n const open = () => {\n if (disabled || visible) return\n clearCloseTimeout()\n parentGroup?.notifyOpen(id)\n setVisible(true)\n }\n\n const scheduleClose = () => {\n clearCloseTimeout()\n closeTimeoutRef.current = window.setTimeout(close, submenuDelay)\n }\n\n useEffect(() => parentGroup?.register(id, close), [parentGroup, id, close])\n useEffect(() => clearCloseTimeout, [clearCloseTimeout])\n useEffect(() => cancelFocusFirstRaf, [cancelFocusFirstRaf])\n\n // The submenu's own open state is local and doesn't otherwise hear about its ancestor\n // `Menu` closing (via Escape, outside click, etc.) — without this it's left open and\n // fully visible (it's portaled to `document.body`, so nothing hides it for free) even\n // after the menu it belongs to has disappeared.\n useEffect(() => {\n if (!parentMenuVisible) close()\n }, [parentMenuVisible, close])\n\n const supportsHover =\n typeof window !== 'undefined' &&\n !!window.matchMedia &&\n window.matchMedia('(hover: hover)').matches\n const hoverEnabled = supportsHover && (activation === 'hover' || activation === 'both')\n const clickEnabled = activation === 'click' || activation === 'both'\n\n const openAndFocusFirst = () => {\n open()\n cancelFocusFirstRaf()\n focusFirstRafRef.current = requestAnimationFrame(() => {\n focusFirstRafRef.current = undefined\n focusMenuItem(getMenuItems(overlayRef.current), 'first')\n })\n }\n\n const closeAndRefocusTrigger = () => {\n close()\n triggerRef.current?.focus()\n }\n\n const handleTriggerClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (!clickEnabled || disabled) return\n event.preventDefault()\n event.stopPropagation()\n visible ? close() : openAndFocusFirst()\n }\n\n // A submenu cascades toward the reading direction, so the arrow key that opens it (and the\n // one its own item list closes on, below) mirror too: ArrowRight/ArrowLeft under LTR,\n // ArrowLeft/ArrowRight under RTL.\n const openKey = isRtl ? 'ArrowLeft' : 'ArrowRight'\n\n const handleTriggerKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === openKey) {\n event.preventDefault()\n event.stopPropagation()\n openAndFocusFirst()\n }\n }\n\n const actionsValue = { close: closeAndRefocusTrigger }\n\n return (\n <div className={classNames('submenu', { show: visible }, className)} {...rest} ref={ref}>\n <button\n type=\"button\"\n id={triggerId}\n role=\"menuitem\"\n className=\"menu-item\"\n aria-expanded={visible}\n aria-haspopup=\"true\"\n aria-controls={visible ? menuId : undefined}\n disabled={disabled}\n onClick={handleTriggerClick}\n onKeyDown={handleTriggerKeyDown}\n onMouseEnter={hoverEnabled ? open : undefined}\n onMouseLeave={hoverEnabled ? scheduleClose : undefined}\n ref={(node) => {\n triggerRef.current = node\n }}\n >\n {trigger}\n </button>\n {(() => {\n const panel = (\n <div\n role=\"menu\"\n id={menuId}\n aria-labelledby={triggerId}\n className={classNames('menu', { show: visible, 'submenu-stacked': stacked })}\n style={menuStyle}\n data-cx-placement={placementAttr}\n onKeyDown={(event) =>\n handleMenuKeyDown(event, {\n onEscape: closeAndRefocusTrigger,\n ...(isRtl\n ? { onArrowRight: closeAndRefocusTrigger }\n : { onArrowLeft: closeAndRefocusTrigger })\n })\n }\n onMouseEnter={hoverEnabled ? clearCloseTimeout : undefined}\n onMouseLeave={hoverEnabled ? scheduleClose : undefined}\n // Registers this panel with the ancestor `Menu` (see `MenuContext.registerOverlay`)\n // so its own click-dismiss logic recognizes clicks here as \"inside\" the menu — the\n // panel portals straight to `document.body` when not `stacked`, so plain DOM\n // containment against the top-level menu's own element wouldn't otherwise see it.\n ref={(node) => {\n overlayRef.current = node\n registerOverlay(menuId, node)\n }}\n >\n <SubmenuActionsContext.Provider value={actionsValue}>\n <SubmenuGroupContext.Provider value={ownGroup}>\n {children}\n </SubmenuGroupContext.Provider>\n </SubmenuActionsContext.Provider>\n </div>\n )\n\n // `stacked`'s sm-breakpoint CSS (`.menu:has(.submenu-stacked.show) ...`) needs the\n // panel to be a real DOM descendant of `.menu`/`.submenu` to match — portaling would\n // break that ancestor relationship, so it renders inline instead. Trade-off: above the\n // `sm` breakpoint a `stacked` submenu no longer escapes ancestor overflow/stacking-\n // context clipping the way a portaled one does; accepted since `stacked` targets mobile\n // nav/drawer usage, not floating dropdowns.\n // On the server and during hydration the panel renders inline next to its trigger, which\n // is what the server's HTML holds; `Portal` moves it to `document.body` afterwards.\n return stacked ? panel : <Portal fallback={panel}>{panel}</Portal>\n })()}\n </div>\n )\n }\n)\n\nMenuSubmenu.displayName = 'MenuSubmenu'\n","import React, { ButtonHTMLAttributes, forwardRef, useContext } from 'react'\nimport classNames from 'classnames'\n\nimport { SubmenuActionsContext } from './submenuGroup'\n\nexport interface MenuSubmenuBackProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n}\n\n// First item of a stacked submenu's nested menu (see `MenuSubmenu`'s `stacked` prop). Closes\n// the submenu and returns focus to its trigger — visible only below the `sm` breakpoint.\nexport const MenuSubmenuBack = forwardRef<HTMLButtonElement, MenuSubmenuBackProps>(\n ({ children, className, onClick, type = 'button', ...rest }, ref) => {\n const actions = useContext(SubmenuActionsContext)\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n actions?.close()\n }\n\n return (\n <button\n type={type}\n role=\"menuitem\"\n className={classNames('submenu-back', 'menu-item', className)}\n {...rest}\n onClick={handleClick}\n ref={ref}\n >\n {children}\n </button>\n )\n }\n)\n\nMenuSubmenuBack.displayName = 'MenuSubmenuBack'\n"],"mappings":"ifA6BA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EAAW,YAAa,CAAS,EAEpD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAW,EACtB,EACA,UACF,ECmBa,EAAc,GAEvB,CACE,WACA,aAAa,OACb,YACA,WACA,OAAQ,EAAa,CAAC,GAAI,CAAC,EAC3B,YACA,UACA,eAAe,IACf,UACA,GAAG,GAEL,IACG,CACH,IAAM,EAAK,GAAM,EACX,EAAY,GAAG,EAAG,UAClB,EAAS,GAAG,EAAG,OACf,CAAC,EAAS,GAAc,GAAS,EAAK,EACtC,EAAkB,EAA2B,IAAA,EAAS,EACtD,EAAmB,EAA2B,IAAA,EAAS,EACvD,EAAa,EAAiC,IAAI,EAClD,EAAa,EAA2B,IAAI,EAC5C,EAAc,EAAW,CAAmB,EAC5C,EAAW,EAAwB,EACnC,CAAE,kBAAiB,QAAS,GAAsB,EAAW,CAAW,EACxE,CAAE,aAAc,EAAU,EAC1B,EAAQ,IAAc,MACtB,EAAqB,IAAc,EAAQ,aAAe,eAE1D,CAAE,eAAc,UAAW,GAAsB,EAAmB,CACxE,UAAW,EACX,aAKA,UAAW,EAAgB,CAAkB,EAC7C,OAAQ,EAAW,GACnB,YAAa,EAAW,GACxB,iBAAkB,EAClB,OAAQ,EAGR,QAAS,IACX,CAAC,EAEK,CAAE,aAAW,kBAAkB,EACnC,EAAa,MACb,EACA,CACF,EAEM,EAAoB,MAAkB,CACtC,EA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GAC5B,CAAE,WAAU,YAAW,UAAS,OAAO,SAAU,GAAG,GAAQ,IAAQ,CACnE,IAAM,EAAU,EAAW,CAAqB,EAE1C,EAAe,GAA+C,CAClE,IAAU,CAAK,EACf,GAAS,MAAM,CACjB,EAEA,OACE,EAAA,cAAC,SAAD,CACQ,OACN,KAAK,WACL,UAAW,EAAW,eAAgB,YAAa,CAAS,EAC5D,GAAI,EACJ,QAAS,EACJ,KAGC,EADL,CACK,CAEZ,CACF,EAEA,EAAgB,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./useDialogElement-CgOnJAzu.js";import{t as n}from"./CloseButton-DPgQztE0.js";import r,{createContext as i,forwardRef as a,useContext as o,useId as s}from"react";import c from"classnames";const l=i({close:()=>{}}),u=a(({children:e,backdrop:n=!0,className:i,defaultVisible:a,fullscreen:o,instant:u,keyboard:d=!0,modal:f=!0,onClick:p,onClose:m,onClosePrevented:h,onHidden:g,onShow:_,onShown:v,onVisibleChange:y,scrollable:b,size:x,open:S,visible:C,...w},T)=>{let{close:E,forkedRef:D,handleBackdropClick:O,handleCancel:k,hiding:A,staticBounce:j}=t({backdrop:n,defaultVisible:a,instant:u,isModal:f,keyboard:d,onClick:p,onClose:m,onClosePrevented:h,onHidden:g,onShow:_,onShown:v,onVisibleChange:y,open:S,ref:T,visible:C}),M=s(),N=c(`modal`,`dialog`,{[typeof o==`boolean`?`fullscreen`:`max-${o}:fullscreen`]:o,[`${x}`]:x,instant:u,nonmodal:!f,scrollable:b,hiding:A,"dialog-static":j},i);return r.createElement(l.Provider,{value:{close:E,titleId:M}},r.createElement(`dialog`,{"aria-labelledby":M,...w,open:S,className:N,onCancel:k,onClick:O,ref:D},e))});u.displayName=`Modal`;const d=()=>o(l);function f({children:e,className:t,component:n,...i},a){let o=n??`div`,s=c(`modal-body`,t);return r.createElement(o,{className:s,...i,ref:a},e)}const p=e(f,`ModalBody`);function m({children:e,className:t,component:n,stacked:i,...a},o){let s=n??`div`,l=c(`modal-footer`,{stacked:i},t);return r.createElement(s,{className:l,...a,ref:o},e)}const h=e(m,`ModalFooter`);function g({children:e,className:t,closeButton:i=!0,closeLabel:a,component:o,...s},l){let u=o??`div`,{close:f}=d(),p=c(`modal-header`,t);return r.createElement(u,{className:p,...s,ref:l},e,i&&r.createElement(n,{label:a,onClick:f}))}const _=e(g,`ModalHeader`);function v({children:e,component:t,className:n,id:i,...a},o){let{titleId:s}=d(),l=t??`h2`,u=c(`modal-title`,n);return r.createElement(l,{className:u,id:i??s,...a,ref:o},e)}const y=e(v,`ModalTitle`);export{d as a,p as i,_ as n,u as o,h as r,y as t};
|
|
2
|
+
//# sourceMappingURL=modal-bgDR29Jh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-bgDR29Jh.js","names":[],"sources":["../../src/components/modal/Modal.tsx","../../src/hooks/useModal.ts","../../src/components/modal/ModalBody.tsx","../../src/components/modal/ModalFooter.tsx","../../src/components/modal/ModalHeader.tsx","../../src/components/modal/ModalTitle.tsx"],"sourcesContent":["import React, { createContext, DialogHTMLAttributes, forwardRef, useId } from 'react'\nimport classNames from 'classnames'\n\nimport { useDialogElement } from '../../hooks'\n\nexport interface ModalProps extends Omit<\n DialogHTMLAttributes<HTMLDialogElement>,\n 'onCancel' | 'onClose'\n> {\n /**\n * Show a backdrop while the modal is open. `'static'` blocks closing on backdrop click\n * (the modal bounces instead). `false` is intentionally not equivalent to `modal={false}` —\n * unlike `Drawer`, whose vanilla chassis-css counterpart derives modality from `backdrop`,\n * chassis-css's vanilla `Dialog` only ever reads `backdrop` to distinguish `'static'` from\n * everything else; `modal` alone decides `showModal()`/`show()`. This mirrors that faithfully\n * rather than reintroducing an inconsistency with the vendored behavior.\n */\n backdrop?: boolean | 'static'\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Whether the modal is open when it first renders. Such a modal is uncontrolled: it closes\n * itself on a close request. Use `visible` to open and close it from outside.\n */\n defaultVisible?: boolean\n /**\n * Set modal to cover the entire user viewport. A breakpoint value goes fullscreen only\n * below that breakpoint.\n */\n fullscreen?: boolean | 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n /**\n * Disable the open/close transition entirely.\n */\n instant?: boolean\n /**\n * Closes the modal when the escape key is pressed.\n */\n keyboard?: boolean\n /**\n * Open with `showModal()` (top-layer, native backdrop). Set `false` to open with `show()`\n * instead — no backdrop, and the page behind the modal stays interactive.\n */\n modal?: boolean\n /**\n * Renders the modal open from its first paint, server HTML included, as a non-modal dialog: a\n * static preview. It stays open until a close request. Use `visible` or `defaultVisible` to\n * open it as a modal dialog.\n */\n open?: boolean\n /**\n * Callback fired when the modal requests to be closed (escape, backdrop click, or close button).\n */\n onClose?: () => void\n /**\n * Callback fired when a close attempt is blocked (static backdrop click, or escape with `keyboard=false`).\n */\n onClosePrevented?: () => void\n /**\n * Callback fired after the exit transition completes and the modal is fully hidden.\n */\n onHidden?: () => void\n /**\n * Callback fired when the modal starts to open.\n */\n onShow?: () => void\n /**\n * Callback fired after the entry transition completes and the modal is fully visible.\n */\n onShown?: () => void\n /**\n * Callback fired with `false` when the modal requests to be closed, at the same moments as\n * `onClose`. It makes `visible` and `onVisibleChange` a pair that takes a state setter.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Create a scrollable modal — the header and footer stay fixed while the body scrolls.\n */\n scrollable?: boolean\n /**\n * Size the component sm, lg, or extra lg.\n */\n size?: 'sm' | 'lg' | 'xl'\n /**\n * Whether the modal is open. The modal is then controlled: a close request only fires\n * `onClose` and `onVisibleChange`, and the modal closes when this becomes `false`.\n */\n visible?: boolean\n}\n\nexport interface ModalContextProps {\n /**\n * Requests the modal be closed — fires `onClose`. Wire this to any element's `onClick`; see\n * `useModal`.\n */\n close: () => void\n /**\n * Id generated by `Modal` and applied automatically by `ModalTitle` to itself, so the\n * dialog's `aria-labelledby` resolves to it without any manual wiring.\n */\n titleId?: string\n}\n\nexport const ModalContext = createContext<ModalContextProps>({ close: () => {} })\n\nexport const Modal = forwardRef<HTMLDialogElement, ModalProps>(\n (\n {\n children,\n backdrop = true,\n className,\n defaultVisible,\n fullscreen,\n instant,\n keyboard = true,\n modal = true,\n onClick,\n onClose,\n onClosePrevented,\n onHidden,\n onShow,\n onShown,\n onVisibleChange,\n scrollable,\n size,\n open,\n visible,\n ...rest\n },\n ref\n ) => {\n const { close, forkedRef, handleBackdropClick, handleCancel, hiding, staticBounce } =\n useDialogElement({\n backdrop,\n defaultVisible,\n instant,\n isModal: modal,\n keyboard,\n onClick,\n onClose,\n onClosePrevented,\n onHidden,\n onShow,\n onShown,\n onVisibleChange,\n open,\n ref,\n visible\n })\n\n const titleId = useId()\n\n const _className = classNames(\n 'modal',\n 'dialog',\n {\n [typeof fullscreen === 'boolean' ? 'fullscreen' : `max-${fullscreen}:fullscreen`]:\n fullscreen,\n [`${size}`]: size,\n instant,\n nonmodal: !modal,\n scrollable,\n hiding,\n 'dialog-static': staticBounce\n },\n className\n )\n\n return (\n <ModalContext.Provider value={{ close, titleId }}>\n <dialog\n aria-labelledby={titleId}\n {...rest}\n open={open}\n className={_className}\n onCancel={handleCancel}\n onClick={handleBackdropClick}\n ref={forkedRef}\n >\n {children}\n </dialog>\n </ModalContext.Provider>\n )\n }\n)\n\nModal.displayName = 'Modal'\n","import { useContext } from 'react'\nimport { ModalContext, ModalContextProps } from '../components/modal/Modal'\n\nexport type UseModalResult = ModalContextProps\n\n// Reach the enclosing `Modal`'s close handler from anywhere in its composed markup — e.g. to\n// close it from a plain `Button` placed in a `ModalFooter`. Only meaningful inside a `Modal`;\n// outside one it returns a no-op `close`.\nexport const useModal = (): UseModalResult => useContext(ModalContext)\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 ModalBodyOwnProps<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 ModalBodyProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ModalBodyOwnProps<C>\n>\n\ntype ModalBodyComponent = (<C extends ElementType = 'div'>(\n props: ModalBodyProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ModalBodyRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: ModalBodyProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('modal-body', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ModalBody = createPolymorphicComponent<ModalBodyComponent>(\n ModalBodyRender as ForwardRefRenderFunction<Element, ModalBodyProps<ElementType>>,\n 'ModalBody'\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 ModalFooterOwnProps<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 * Stack the footer actions as full-width columns instead of a right-aligned row.\n */\n stacked?: boolean\n}\n\nexport type ModalFooterProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ModalFooterOwnProps<C>\n>\n\ntype ModalFooterComponent = (<C extends ElementType = 'div'>(\n props: ModalFooterProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ModalFooterRender<C extends ElementType = 'div'>(\n { children, className, component, stacked, ...rest }: ModalFooterProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('modal-footer', { stacked }, className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ModalFooter = createPolymorphicComponent<ModalFooterComponent>(\n ModalFooterRender as ForwardRefRenderFunction<Element, ModalFooterProps<ElementType>>,\n 'ModalFooter'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { useModal } from '../../hooks'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { CloseButton } from '../close-button/CloseButton'\n\ntype ModalHeaderOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Add a close button component to the header.\n */\n closeButton?: boolean\n /**\n * Overrides the close button's accessible name (defaults to `'Close'`). Set this for\n * non-English UIs.\n */\n closeLabel?: 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 ModalHeaderProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ModalHeaderOwnProps<C>\n>\n\ntype ModalHeaderComponent = (<C extends ElementType = 'div'>(\n props: ModalHeaderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ModalHeaderRender<C extends ElementType = 'div'>(\n { children, className, closeButton = true, closeLabel, component, ...rest }: ModalHeaderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const { close } = useModal()\n const _className = classNames('modal-header', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n {closeButton && <CloseButton label={closeLabel} onClick={close} />}\n </Component>\n )\n}\n\nexport const ModalHeader = createPolymorphicComponent<ModalHeaderComponent>(\n ModalHeaderRender as ForwardRefRenderFunction<Element, ModalHeaderProps<ElementType>>,\n 'ModalHeader'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { useModal } from '../../hooks'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype ModalTitleOwnProps<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 ModalTitleProps<C extends ElementType = 'h2'> = PolymorphicComponentProps<\n C,\n ModalTitleOwnProps<C>\n>\n\ntype ModalTitleComponent = (<C extends ElementType = 'h2'>(\n props: ModalTitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ModalTitleRender<C extends ElementType = 'h2'>(\n { children, component, className, id, ...rest }: ModalTitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const { titleId } = useModal()\n const Component = component ?? 'h2'\n const _className = classNames('modal-title', className)\n\n return (\n <Component className={_className} id={id ?? titleId} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ModalTitle = createPolymorphicComponent<ModalTitleComponent>(\n ModalTitleRender as ForwardRefRenderFunction<Element, ModalTitleProps<ElementType>>,\n 'ModalTitle'\n)\n"],"mappings":"yRAwGA,MAAa,EAAe,EAAiC,CAAE,UAAa,CAAC,CAAE,CAAC,EAEnE,EAAQ,GAEjB,CACE,WACA,WAAW,GACX,YACA,iBACA,aACA,UACA,WAAW,GACX,QAAQ,GACR,UACA,UACA,mBACA,WACA,SACA,UACA,kBACA,aACA,OACA,OACA,UACA,GAAG,GAEL,IACG,CACH,GAAM,CAAE,QAAO,YAAW,sBAAqB,eAAc,SAAQ,gBACnE,EAAiB,CACf,WACA,iBACA,UACA,QAAS,EACT,WACA,UACA,UACA,mBACA,WACA,SACA,UACA,kBACA,OACA,MACA,SACF,CAAC,EAEG,EAAU,EAAM,EAEhB,EAAa,EACjB,QACA,SACA,EACG,OAAO,GAAe,UAAY,aAAe,OAAO,EAAW,cAClE,GACD,GAAG,KAAS,EACb,UACA,SAAU,CAAC,EACX,aACA,SACA,gBAAiB,CACnB,EACA,CACF,EAEA,OACE,EA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AC,EAAD,CAAW,UAAW,EAAY,GAAI,GAAM,EAAS,GAAI,EAAW,KAEzD,EADR,CACQ,CAEf,CAEA,MAAa,EAAa,EACxB,EACA,YACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{m as e,u as t,v as n}from"./slot-CNhFZdHF.js";import{t as r}from"./useForkedRef-DVEfT-KI.js";import{t as i}from"./polymorphic-BhGNZQja.js";import{t as a}from"./Link-CZsWCnQb.js";import{a as o,i as s,o as c,r as l,s as u}from"./navOverflow-B5krZe6D.js";import{t as d}from"./navVariant-DeGTk9B7.js";import f,{forwardRef as p}from"react";import m from"classnames";function h({children:e,className:t,...n},r){let i=m(`nav-link`,t),s=c();return f.createElement(f.Fragment,null,f.createElement(a,{className:i,...n,ref:r},e),s&&f.createElement(o,{props:{...n,children:e}}))}const g=i(h,`NavLink`),_=new Set([`active`,`color`,`disabled`,`iconLink`,`reset`,`stretched`,`type`]);function v({children:e,className:i,keepVisible:a,...o},s){let c=m(`nav-item`,{"nav-overflow-keep":a},i),{asChild:d,component:p,href:h}=o,v=u(),y=r(s,v.ref),b=v.hidden?{"data-cx-nav-overflow":`true`}:void 0;if(t(h)||p!==void 0||d)return f.createElement(`li`,{className:c,...b,ref:y},f.createElement(l,{value:v.scope},f.createElement(g,o,e)));let{active:x,disabled:S}=o,C=Object.fromEntries(Object.entries(o).filter(([e])=>!_.has(e)));return n(!!x||!!S,"NavItem: `active` and `disabled` style its link, and without `href`, `component` or `asChild` it renders none. Put them on the link inside it."),f.createElement(`li`,{className:c,...C,...b,ref:y},f.createElement(l,{value:v.scope},e))}const y=p(v);y.displayName=`NavItem`;function b({children:t,className:n,component:r,items:i,layout:a,size:o,variant:c,...l},u){let p=r??`ul`,h=m(`nav`,o,{[`nav-${a}`]:a},d(c,`Nav`),n),g=i?i.map((e,t)=>f.createElement(y,{key:t,active:e.active,disabled:e.disabled,href:e.href},e.label)):null;return f.createElement(p,{className:h,...l,ref:u},f.createElement(s,{tag:e(p)},g??t))}const x=i(b,`Nav`),S=p(({children:e,className:t,...n},r)=>{let i=m(`nav-title`,t);return f.createElement(`li`,{className:i,...n,ref:r},e)});S.displayName=`NavTitle`;export{g as i,x as n,y as r,S as t};
|
|
2
|
+
//# sourceMappingURL=nav-TiZuTHC6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-TiZuTHC6.js","names":[],"sources":["../../src/components/nav/NavLink.tsx","../../src/components/nav/NavItem.tsx","../../src/components/nav/Nav.tsx","../../src/components/nav/NavTitle.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { NavOverflowLink, useIsNavOverflowLink } from '../../utils/navOverflow'\nimport { createPolymorphicComponent, PolymorphicRef } from '../../utils/polymorphic'\nimport { LinkProps, Link } from '../link/Link'\n\ntype NavLinkOwnProps = {\n /**\n * Toggle the active state for the component.\n */\n active?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n}\n\nexport type NavLinkProps<C extends ElementType = 'a'> = LinkProps<C> & NavLinkOwnProps\n\ntype NavLinkComponent = (<C extends ElementType = 'a'>(\n props: NavLinkProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavLinkRender<C extends ElementType = 'a'>(\n { children, className, ...rest }: NavLinkProps<C>,\n ref: PolymorphicRef<C>\n) {\n const _className = classNames('nav-link', className)\n // Inside a `NavOverflow`, the link of an item that doesn't fit is shown in the menu instead, as\n // a `MenuItem` with these props.\n const isOverflowLink = useIsNavOverflowLink()\n\n return (\n <>\n <Link\n className={_className}\n {...(rest as Record<string, unknown>)}\n ref={ref as PolymorphicRef<ElementType>}\n >\n {children}\n </Link>\n {isOverflowLink && <NavOverflowLink props={{ ...rest, children }} />}\n </>\n )\n}\n\nexport const NavLink = createPolymorphicComponent<NavLinkComponent>(\n NavLinkRender as ForwardRefRenderFunction<Element, NavLinkProps<ElementType>>,\n 'NavLink'\n)\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n forwardRef,\n ReactElement,\n ReactNode,\n Ref\n} from 'react'\nimport classNames from 'classnames'\n\nimport { useForkedRef } from '../../hooks'\nimport { devWarning } from '../../utils/devWarning'\nimport { hasHref } from '../../utils/elementKind'\nimport { NavOverflowItemScope, useNavOverflowItem } from '../../utils/navOverflow'\nimport { NavLink, NavLinkProps } from './NavLink'\n\nexport type NavItemProps<C extends ElementType = 'a'> = NavLinkProps<C> & {\n /**\n * Keeps the item in the list inside a `NavOverflow`, whatever the width.\n */\n keepVisible?: boolean\n}\n\ntype NavItemComponent = (<C extends ElementType = 'a'>(\n props: NavItemProps<C> & { ref?: Ref<HTMLLIElement> }\n) => ReactElement | null) & { displayName?: string }\n\nconst LINK_ONLY_PROPS = new Set([\n 'active',\n 'color',\n 'disabled',\n 'iconLink',\n 'reset',\n 'stretched',\n 'type'\n])\n\n// A `.nav-item` wrapping a `.nav-link` when there is a link to render: an `href`, or a `component`\n// or `asChild` element, which `NavLink` renders. Otherwise a bare `<li>` around `children`, such as\n// a `MenuToggle`. Only the `<li>` takes the caller's own attributes then: `active`, `disabled` and\n// the other `NavLink` props style a link, and on the `<li>` they were written out as invalid\n// attributes (`disabled=\"\"`, `component=\"button\"`).\nfunction NavItemRender<C extends ElementType = 'a'>(\n { children, className, keepVisible, ...rest }: NavItemProps<C>,\n ref: Ref<HTMLLIElement>\n) {\n const _className = classNames('nav-item', { 'nav-overflow-keep': keepVisible }, className)\n const { asChild, component, href } = rest as {\n asChild?: boolean\n component?: ElementType\n href?: string\n }\n // Inside a `NavOverflow`: the `<li>` is what it measures, and hides when the item is in the\n // menu. chassis-css hides it by this attribute.\n const overflow = useNavOverflowItem()\n const forkedRef = useForkedRef(ref, overflow.ref)\n const overflowProps = overflow.hidden ? { 'data-cx-nav-overflow': 'true' } : undefined\n\n if (hasHref(href) || component !== undefined || asChild) {\n return (\n <li className={_className} {...overflowProps} ref={forkedRef}>\n <NavOverflowItemScope value={overflow.scope}>\n <NavLink {...(rest as Record<string, unknown>)}>{children as ReactNode}</NavLink>\n </NavOverflowItemScope>\n </li>\n )\n }\n\n const { active, disabled } = rest as NavLinkProps<'a'>\n const itemProps = Object.fromEntries(\n Object.entries(rest).filter(([key]) => !LINK_ONLY_PROPS.has(key))\n )\n devWarning(\n !!active || !!disabled,\n 'NavItem: `active` and `disabled` style its link, and without `href`, `component` or ' +\n '`asChild` it renders none. Put them on the link inside it.'\n )\n return (\n <li className={_className} {...itemProps} {...overflowProps} ref={forkedRef}>\n <NavOverflowItemScope value={overflow.scope}>{children}</NavOverflowItemScope>\n </li>\n )\n}\n\nexport const NavItem = forwardRef(\n NavItemRender as ForwardRefRenderFunction<HTMLLIElement, NavItemProps<ElementType>>\n) as NavItemComponent\n\nNavItem.displayName = 'NavItem'\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { resolveElementTag } from '../../utils/elementKind'\nimport { NavOverflowItems } from '../../utils/navOverflow'\nimport { NavVariant, navVariantClassName } from '../../utils/navVariant'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { NavItem } from './NavItem'\n\nexport interface NavItemDef {\n /**\n * Label content for the nav item.\n */\n label: React.ReactNode\n /**\n * URL for the nav link.\n */\n href?: string\n /**\n * Marks the item as active.\n */\n active?: boolean\n /**\n * Marks the item as disabled.\n */\n disabled?: boolean\n}\n\ntype NavOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Array of nav item definitions for data-driven rendering. When provided, children are ignored.\n */\n items?: NavItemDef[]\n /**\n * Specify a layout type for component.\n */\n layout?: 'fill' | 'justified'\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set the nav variant to tabs, to segments (a segmented control) or to underline, which\n * underlines the active link. `'pills'` is the former name of `'segments'`: deprecated, it\n * renders the same.\n *\n * @type { 'tabs' | 'segments' | 'underline' | 'pills' }\n */\n variant?: NavVariant\n}\n\nexport type NavProps<C extends ElementType = 'ul'> = PolymorphicComponentProps<C, NavOwnProps<C>>\n\ntype NavComponent = (<C extends ElementType = 'ul'>(\n props: NavProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavRender<C extends ElementType = 'ul'>(\n { children, className, component, items, layout, size, variant, ...rest }: NavProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'ul'\n const _className = classNames(\n 'nav',\n size,\n { [`nav-${layout}`]: layout },\n navVariantClassName(variant, 'Nav'),\n className\n )\n\n const autoContent = items\n ? items.map((item, idx) => (\n <NavItem\n // eslint-disable-next-line react/no-array-index-key\n key={idx}\n active={item.active}\n disabled={item.disabled}\n href={item.href}\n >\n {item.label}\n </NavItem>\n ))\n : null\n\n // No `role`: `navigation` on the `<ul>` took away its list semantics, and `ul` doesn't allow\n // that role. A landmark is the caller's `<nav>` around it, or `component=\"nav\"` holding\n // `NavLink`s without items.\n return (\n <Component className={_className} {...rest} ref={ref}>\n {/* Inside a `NavOverflow`, the items it collapses and its toggle item. */}\n <NavOverflowItems tag={resolveElementTag(Component)}>\n {autoContent ?? children}\n </NavOverflowItems>\n </Component>\n )\n}\n\nexport const Nav = createPolymorphicComponent<NavComponent>(\n NavRender as ForwardRefRenderFunction<Element, NavProps<ElementType>>,\n 'Nav'\n)\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nexport interface NavTitleProps extends HTMLAttributes<HTMLLIElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n}\n\nexport const NavTitle = forwardRef<HTMLLIElement, NavTitleProps>(\n ({ children, className, ...rest }, ref) => {\n const _className = classNames('nav-title', className)\n return (\n <li className={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EAAW,GAAI,EAAe,IAAK,CAE9D,EADF,EAAA,cAAC,EAAD,CAAsB,MAAO,EAAS,KAAuC,EAA/B,CAA+B,CAC3E,CAER,CAEA,MAAa,EAAU,EACrB,CACF,EAEA,EAAQ,YAAc,UCnBtB,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,QAAO,SAAQ,OAAM,UAAS,GAAG,GACnE,EACA,CACA,IAAM,EAAY,GAAa,KACzB,EAAa,EACjB,MACA,EACA,EAAG,OAAO,KAAW,CAAO,EAC5B,EAAoB,EAAS,KAAK,EAClC,CACF,EAEM,EAAc,EAChB,EAAM,KAAK,EAAM,IACf,EAAA,cAAC,EAAD,CAEE,IAAK,EACL,OAAQ,EAAK,OACb,SAAU,EAAK,SACf,KAAM,EAAK,IAGJ,EADN,EAAK,KACC,CACV,EACD,KAKJ,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAKtC,EAHT,EAAA,cAAC,EAAD,CAAkB,IAAK,EAAkB,CAAS,CAEhC,EADf,GAAe,CACA,CACT,CAEf,CAEA,MAAa,EAAM,EACjB,EACA,KACF,ECtGa,EAAW,GACrB,CAAE,WAAU,YAAW,GAAG,GAAQ,IAAQ,CACzC,IAAM,EAAa,EAAW,YAAa,CAAS,EACpD,OACE,EAAA,cAAC,KAAD,CAAI,UAAW,EAAY,GAAI,EAAW,KAEtC,EADD,CACC,CAER,CACF,EAEA,EAAS,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{v as e}from"./slot-CNhFZdHF.js";import{t}from"./useForkedRef-DVEfT-KI.js";import{t as n}from"./polymorphic-BhGNZQja.js";import{t as r}from"./useIsomorphicLayoutEffect-BbqRwuqn.js";import{n as i}from"./Portal-CgeR1WXV.js";import{t as a}from"./iconSlot-BNu2MrFI.js";import{n as o}from"./navOverflow-B5krZe6D.js";import{t as s}from"./Menu-CSBg2Zmc.js";import{l as c,n as l,t as u}from"./MenuToggle-BdQtF7FV.js";import d,{createContext as f,useCallback as p,useContext as m,useEffect as h,useMemo as g,useRef as _,useState as v,useSyncExternalStore as y}from"react";import b from"classnames";import{flushSync as x}from"react-dom";const S=f(null);function C(e){for(let t=e.previousElementSibling;t;t=t.previousElementSibling){if(t.hasAttribute(`data-cx-nav-overflow`))continue;let e=t.querySelector(`a[href], button:not(:disabled), [tabindex]`);if(e)return e}return null}function w({tabs:e}){let t=m(S),[n,i]=v(!1),o=_(null),f=_(!1),p=t?.hidden,h=!p?.length;r(()=>{let e=o.current;if(!e||!f.current)return;let t=e.ownerDocument.activeElement;(!t||t===e.ownerDocument.body||h&&e.contains(t))&&(f.current=!h,(h?C(e):e.querySelector(`.nav-overflow-toggle`))?.focus())},[p,h]);let g=t=>{f.current=!0,e&&t.stopPropagation()},x=()=>{f.current=!1};if(y(t?.subscribe??D,t?.getVersion??O,t?.getVersion??O),!t||!p)return null;let{getLink:w,iconPlacement:k,menuContainer:A,menuPlacement:j,moreIcon:M,moreLabel:N,moreText:P}=t;h&&n&&i(!1);let F=d.createElement(`span`,{key:`icon`,className:`nav-overflow-icon`,style:E},d.createElement(a,{icon:`more`,override:M})),I=P===!1?null:d.createElement(`span`,{key:`text`,className:`nav-overflow-text`},P);return d.createElement(s,{component:`li`,className:b(`nav-item nav-overflow-item`,{[T]:h}),container:e&&typeof A!=`object`||A,onBlur:x,onFocus:g,onVisibleChange:i,placement:j,visible:n&&!h,...e&&{role:`presentation`},ref:o},d.createElement(u,{"aria-label":P===!1?N:void 0,caret:!1,className:`nav-link nav-overflow-toggle`,component:`button`,...e&&{"aria-selected":!1,role:`tab`,tabIndex:-1}},k===`end`?[I,F]:[F,I]),d.createElement(l,{className:`nav-overflow-menu`},p.map(e=>{let t=w(e);return t&&d.createElement(c,{key:e,...t})})))}const T=`d-none`,E={"--cx-icon-color":`currentcolor`,"--cx-icon-size":`1rem`},D=()=>()=>{},O=()=>0;function k({available:e,collapseAll:t,gap:n,items:r,more:i,threshold:a}){let o=r.filter(e=>!e.keep),s=e=>e.map(e=>e.id);if(t)return s(o);if(r.reduce((e,t)=>e+t.width,0)+n*(r.length-1)<=e+1)return[];let c=i+r.reduce((e,t)=>t.keep?e+t.width+n:e,0),l=o.filter(t=>(c+=t.width+n,c>e+1));return r.length-l.length<a&&r.length>a&&(l=r.slice(a).filter(e=>!e.keep)),s(l)}function A(){let e=new Map,t=new Set,n=0,r=t=>{let n=e.get(t);return n||(n={element:null,link:null},e.set(t,n)),n};return{entries:e,getVersion:()=>n,notify:()=>{n+=1,t.forEach(e=>e())},set:(t,n)=>{let i=Object.assign(r(t),n);!i.element&&!i.link&&e.delete(t)},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}const j=`data-cx-nav-overflow`,M=`d-none`,N=[],P=e=>Number.parseFloat(e)||0,F=e=>`offsetWidth`in e,I=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function ee(e,t){if(typeof e==`number`)return e;if(!e)return 0;let n=getComputedStyle(t.ownerDocument.documentElement),r=n.getPropertyValue(`--cx-breakpoint-${e}`).trim();return/r?em$/.test(r)?P(r)*(P(n.fontSize)||16):P(r)}const te={overflowX:`auto`,scrollbarWidth:`none`};function L({children:n,className:a,collapseBelow:s,component:c,iconPlacement:l=`start`,menuContainer:u,menuPlacement:f=`bottom-end`,moreIcon:m,moreLabel:y=`More`,moreText:C=`More`,onOverflow:T,style:E,threshold:D=0,...O},L){let R=c??`div`,z=_(null),ne=p(e=>{e&&(z.current=e)},[]),re=t(L,ne),ie=i(),[B]=v(A),[V,H]=v(N),U=_(V),W=_(0),G=_({collapseBelow:s,threshold:D});G.current={collapseBelow:s,threshold:D};let K=_(null),q=p(()=>{let t=z.current?.isConnected?z.current:null,n=t&&Array.from(t.children).find(e=>e.matches(`.nav`));if(e(!!t&&!n,"NavOverflow: expects a `Nav`, a `NavbarNav` or a `TabList` as its child; found no `.nav` to collapse."),!t||!n)return null;let r=Array.from(n.children).filter(F),i=r.find(e=>e.classList.contains(`nav-overflow-item`)),a=r.filter(e=>e!==i);if(Y(t,n,r),W.current=a.length,!i)return[];let o=new Map;B.entries.forEach((e,t)=>{e.element&&o.set(e.element,t)});let s=a.filter(e=>e.hasAttribute(j)),c=i.classList.contains(M);s.forEach(e=>e.removeAttribute(j)),i.classList.remove(M);try{let e=getComputedStyle(t),r=getComputedStyle(n),s=t.clientWidth-P(e.paddingInlineStart)-P(e.paddingInlineEnd),c=t.ownerDocument.activeElement,l=a.map(e=>{let t=o.get(e);return{id:t,keep:!t||!B.entries.get(t)?.link||e.classList.contains(`nav-overflow-keep`)||e.querySelector(`.nav-link.active, .nav-link[aria-current]:not([aria-current="false"]), [role="tab"][tabindex="0"]`)!==null||e.contains(c),width:e.offsetWidth}}),{collapseBelow:u,threshold:d}=G.current;return k({available:s-P(r.paddingInlineStart)-P(r.paddingInlineEnd)-P(r.borderInlineStartWidth)-P(r.borderInlineEndWidth),collapseAll:s<ee(u,t),gap:P(r.columnGap),items:l,more:i.offsetWidth,threshold:d})}finally{s.forEach(e=>e.setAttribute(j,`true`)),c&&i.classList.add(M),t.offsetWidth,K.current?.mutation?.takeRecords()}},[B]),J=p(()=>{let e=q();e&&!I(e,U.current)&&(U.current=e,H(e))},[q]);function Y(e,t,n){let r=K.current;if(r&&r.wrapper!==e&&(X(),r=null),!r){let t=()=>x(J),n={frame:0,mutation:typeof MutationObserver>`u`?null:new MutationObserver(t),nav:null,observed:new Set,resize:typeof ResizeObserver>`u`?null:new ResizeObserver(r=>{if(!r.some(t=>t.target===e)){cancelAnimationFrame(n.frame),n.frame=requestAnimationFrame(t);return}let i=U.current;t(),U.current!==i&&K.current===n&&(n.resize?.unobserve(e),cancelAnimationFrame(n.wrapperFrame),n.wrapperFrame=requestAnimationFrame(()=>n.resize?.observe(e)))}),wrapperFrame:0,wrapper:e};r=K.current=n,r.resize?.observe(e)}let{mutation:i,observed:a,resize:o}=r;r.nav!==t&&(r.nav=t,i?.disconnect(),i?.observe(t,{attributeFilter:[`class`,`aria-current`],attributes:!0,childList:!0,subtree:!0}));let s=new Set(n);a.forEach(e=>{s.has(e)||(o?.unobserve(e),a.delete(e))}),s.forEach(e=>{a.has(e)||(o?.observe(e),a.add(e))})}function X(){let e=K.current;e&&(cancelAnimationFrame(e.frame),cancelAnimationFrame(e.wrapperFrame),e.mutation?.disconnect(),e.resize?.disconnect(),K.current=null)}h(()=>X,[]),r(J,[J,R,s,D]);let Z=_(V);h(()=>{Z.current!==V&&(Z.current=V,T?.({overflowCount:V.length,visibleCount:W.current-V.length}))},[V]);let Q=p((e,t)=>B.set(e,{element:t}),[B]),$=p((e,t)=>{B.set(e,{link:t}),U.current.includes(e)&&B.notify()},[B]),ae=g(()=>({hidden:V,More:w,registerItem:Q,registerLink:$,update:J}),[V,Q,$,J]),oe=g(()=>({getLink:e=>B.entries.get(e)?.link??null,getVersion:B.getVersion,hidden:V,iconPlacement:l,menuContainer:u,menuPlacement:f,moreIcon:m,moreLabel:y,moreText:C,subscribe:B.subscribe}),[V,l,u,f,m,y,C,B]);return d.createElement(o.Provider,{value:ae},d.createElement(S.Provider,{value:oe},d.createElement(R,{className:b(`nav-overflow`,a),style:ie?E:{...te,...E},...O,ref:re},n)))}const R=n(L,`NavOverflow`);export{R as t};
|
|
2
|
+
//# sourceMappingURL=nav-overflow-Ay5mM5Gc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-overflow-Ay5mM5Gc.js","names":["HIDDEN_CLASS"],"sources":["../../src/components/nav-overflow/more.tsx","../../src/components/nav-overflow/overflow.ts","../../src/components/nav-overflow/NavOverflow.tsx"],"sourcesContent":["import React, {\n createContext,\n CSSProperties,\n FocusEvent,\n ReactNode,\n useContext,\n useRef,\n useState,\n useSyncExternalStore\n} from 'react'\nimport classNames from 'classnames'\n\nimport { useIsomorphicLayoutEffect } from '../../hooks'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../../utils/iconSlot'\nimport { NavOverflowLinkProps, NavOverflowMoreProps } from '../../utils/navOverflow'\nimport { Placement } from '../../utils/overlayPlacement'\nimport { Menu } from '../menu/Menu'\nimport { MenuItem } from '../menu/MenuItem'\nimport { MenuList } from '../menu/MenuList'\nimport { MenuToggle } from '../menu/MenuToggle'\n\n// From `NavOverflow` to the toggle item, which a list renders for it: the items in the menu, the\n// props their links registered, and how the toggle looks.\nexport interface NavOverflowMoreState {\n getLink: (id: string) => NavOverflowLinkProps | null\n getVersion: () => number\n hidden: readonly string[]\n iconPlacement: 'start' | 'end'\n menuContainer: boolean | Element | undefined\n menuPlacement: Placement\n moreIcon: IconValue | undefined\n moreLabel: string\n moreText: ReactNode | false\n subscribe: (listener: () => void) => () => void\n}\n\nexport const NavOverflowMoreContext = createContext<NavOverflowMoreState | null>(null)\n\n// The nearest item before `item` that is shown and can take focus: its link, or its tab.\nfunction lastShownStop(item: HTMLElement): HTMLElement | null {\n for (let shown = item.previousElementSibling; shown; shown = shown.previousElementSibling) {\n if (shown.hasAttribute('data-cx-nav-overflow')) continue\n const stop = shown.querySelector<HTMLElement>('a[href], button:not(:disabled), [tabindex]')\n if (stop) return stop\n }\n return null\n}\n\n// chassis-css's markup (`nav-overflow.js`): a `.nav-item.nav-overflow-item` holding the\n// `.nav-link.nav-overflow-toggle` button and the `.menu.nav-overflow-menu`. It is in the list at\n// all times, hidden while every item fits, so its width can be measured before it is needed.\nexport function NavOverflowMore({ tabs }: NavOverflowMoreProps) {\n const state = useContext(NavOverflowMoreContext)\n const [visible, setVisible] = useState(false)\n const itemRef = useRef<HTMLLIElement>(null)\n const focusWithinRef = useRef(false)\n const hidden = state?.hidden\n const empty = !hidden?.length\n\n // A resize can take away what has focus here: the toggle, when the last item leaves the menu,\n // or a menu item, when its item is back in the list. Neither blurs first, and focus would fall\n // to the page. It goes to the toggle while there is one, and to the last item otherwise.\n useIsomorphicLayoutEffect(() => {\n const item = itemRef.current\n if (!item || !focusWithinRef.current) return\n const active = item.ownerDocument.activeElement\n const lost = !active || active === item.ownerDocument.body || (empty && item.contains(active))\n if (!lost) return\n focusWithinRef.current = !empty\n const stop = empty\n ? lastShownStop(item)\n : item.querySelector<HTMLElement>('.nav-overflow-toggle')\n stop?.focus()\n }, [hidden, empty])\n\n const handleFocus = (event: FocusEvent) => {\n focusWithinRef.current = true\n // react-aria's tab list takes focus back to the selected tab when focus enters the list from\n // outside, which a click on the toggle does. The toggle is reached with the arrow keys, from\n // a tab (`TabList`), so the list doesn't need to hear of its focus.\n if (tabs) event.stopPropagation()\n }\n const handleBlur = () => {\n focusWithinRef.current = false\n }\n // A hidden item's link re-registers its props on each of its renders.\n useSyncExternalStore(\n state?.subscribe ?? subscribeToNothing,\n state?.getVersion ?? zero,\n state?.getVersion ?? zero\n )\n\n if (!state || !hidden) return null\n\n const { getLink, iconPlacement, menuContainer, menuPlacement, moreIcon, moreLabel, moreText } =\n state\n // The toggle goes when the last item leaves the menu, and an open menu with it.\n if (empty && visible) setVisible(false)\n\n // Keyed, so `iconPlacement` moves the two spans instead of turning one into the other.\n const icon = (\n <span key=\"icon\" className=\"nav-overflow-icon\" style={ICON_STYLE}>\n <IconSlot icon=\"more\" override={moreIcon} />\n </span>\n )\n const text =\n moreText === false ? null : (\n <span key=\"text\" className=\"nav-overflow-text\">\n {moreText}\n </span>\n )\n\n return (\n <Menu\n component=\"li\"\n className={classNames('nav-item nav-overflow-item', { [HIDDEN_CLASS]: empty })}\n // A `tablist` owns tabs only. The toggle is one of them, and the menu is rendered outside.\n // (No `instanceof Element`: a server has no `Element`.)\n container={tabs ? (typeof menuContainer === 'object' ? menuContainer : true) : menuContainer}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onVisibleChange={setVisible}\n placement={menuPlacement}\n visible={visible && !empty}\n {...(tabs && { role: 'presentation' })}\n ref={itemRef}\n >\n <MenuToggle\n aria-label={moreText === false ? moreLabel : undefined}\n caret={false}\n className=\"nav-link nav-overflow-toggle\"\n component=\"button\"\n {...(tabs && { 'aria-selected': false, role: 'tab', tabIndex: -1 })}\n >\n {iconPlacement === 'end' ? [text, icon] : [icon, text]}\n </MenuToggle>\n <MenuList className=\"nav-overflow-menu\">\n {hidden.map((id) => {\n const link = getLink(id)\n return link && <MenuItem key={id} {...link} />\n })}\n </MenuList>\n </Menu>\n )\n}\n\nconst HIDDEN_CLASS = 'd-none'\n// The icon as chassis-css's plugin draws its own: in the color of the toggle's text, and 1rem\n// wide. The default icon size is taller than a link's text, and would make the list a little\n// taller each time the toggle appeared.\nconst ICON_STYLE = { '--cx-icon-color': 'currentcolor', '--cx-icon-size': '1rem' } as CSSProperties\nconst subscribeToNothing = () => () => {}\nconst zero = () => 0\n","// Which items go into the menu, from widths `NavOverflow` has read with every item shown.\n\nexport interface MeasuredItem {\n /**\n * Unset for an item that registered nothing, which can't be moved.\n */\n id?: string\n /**\n * Stays in the list whatever the width: marked to keep, active, focused, or with no link for\n * the menu to show.\n */\n keep: boolean\n width: number\n}\n\nexport interface Measurement {\n /**\n * The width the items have to fit in.\n */\n available: number\n /**\n * The wrapper is narrower than `collapseBelow`.\n */\n collapseAll: boolean\n gap: number\n /**\n * In document order, without the toggle item.\n */\n items: MeasuredItem[]\n /**\n * The width of the toggle item.\n */\n more: number\n /**\n * The fewest items to leave in the list.\n */\n threshold: number\n}\n\n// A pixel of slack for sub-pixel layout: `offsetWidth` is rounded.\nconst SLACK = 1\n\nexport function overflowingIds({\n available,\n collapseAll,\n gap,\n items,\n more,\n threshold\n}: Measurement): string[] {\n const movable = items.filter((item) => !item.keep)\n const ids = (overflowing: MeasuredItem[]) => overflowing.map((item) => item.id as string)\n\n if (collapseAll) return ids(movable)\n\n // Everything fits without the toggle, which then isn't shown. chassis-css's plugin always\n // reserves the toggle's width, and so moves the last item of a list that fits exactly.\n const total = items.reduce((sum, item) => sum + item.width, 0) + gap * (items.length - 1)\n if (total <= available + SLACK) return []\n\n // The toggle and the kept items are shown whatever happens, each with the gap to the next.\n let used = more + items.reduce((sum, item) => (item.keep ? sum + item.width + gap : sum), 0)\n let overflowing = movable.filter((item) => {\n used += item.width + gap\n return used > available + SLACK\n })\n\n if (items.length - overflowing.length < threshold && items.length > threshold) {\n overflowing = items.slice(threshold).filter((item) => !item.keep)\n }\n\n return ids(overflowing)\n}\n","import React, {\n CSSProperties,\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react'\nimport { flushSync } from 'react-dom'\nimport classNames from 'classnames'\n\nimport { useForkedRef, useIsomorphicLayoutEffect } from '../../hooks'\nimport { Breakpoint } from '../../types'\nimport { devWarning } from '../../utils/devWarning'\nimport { IconValue } from '../../utils/iconConfig'\nimport {\n NavOverflowContext,\n NavOverflowController,\n NavOverflowLinkProps\n} from '../../utils/navOverflow'\nimport { Placement } from '../../utils/overlayPlacement'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { useHydrated } from '../portal/Portal'\nimport { NavOverflowMore, NavOverflowMoreContext, NavOverflowMoreState } from './more'\nimport { MeasuredItem, overflowingIds } from './overflow'\n\nexport interface NavOverflowDetail {\n /**\n * How many items are in the menu.\n */\n overflowCount: number\n /**\n * How many items are left in the list.\n */\n visibleCount: number\n}\n\ntype NavOverflowOwnProps<C extends ElementType> = {\n /**\n * The list to collapse: a `Nav`, a `NavbarNav` or a `TabList`.\n */\n children?: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Moves every item into the menu while the component is narrower than this: a width in pixels,\n * or the name of a breakpoint, read from `--cx-breakpoint-{name}`.\n */\n collapseBelow?: number | Breakpoint\n /**\n * Component used for the root node. Either a string to use an HTML element or a component.\n *\n * @default 'div'\n */\n component?: C\n /**\n * Which side of the toggle's text its icon is on.\n *\n * @default 'start'\n */\n iconPlacement?: 'start' | 'end'\n /**\n * Renders the menu in a container element instead of inside the toggle's item, where an\n * ancestor with `overflow` set would clip it: an element, or `true` for `document.body`. The\n * menu of a `TabList` is always rendered outside it.\n */\n menuContainer?: boolean | Element\n /**\n * Where the menu opens, relative to the toggle. It flips to stay in view.\n *\n * @default 'bottom-end'\n * @type 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'\n */\n menuPlacement?: Placement\n /**\n * The toggle's icon: an icon name, or an element of your own icon set. Defaults to\n * `IconProvider`'s `more` icon.\n */\n moreIcon?: IconValue\n /**\n * The accessible name of a toggle without text (`moreText={false}`).\n *\n * @default 'More'\n */\n moreLabel?: string\n /**\n * The toggle's text. `false` leaves the icon alone, named by `moreLabel`.\n *\n * @default 'More'\n */\n moreText?: ReactNode | false\n /**\n * Callback fired when items move into the menu or back out of it, with the number of items in\n * the menu and in the list.\n */\n onOverflow?: (detail: NavOverflowDetail) => void\n /**\n * The fewest items to leave in the list. They stay even when they don't fit.\n *\n * @default 0\n */\n threshold?: number\n}\n\nexport type NavOverflowProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n NavOverflowOwnProps<C>\n>\n\ntype NavOverflowComponent = (<C extends ElementType = 'div'>(\n props: NavOverflowProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\ninterface Entry {\n element: HTMLElement | null\n link: NavOverflowLinkProps | null\n}\n\ninterface Observers {\n frame: number\n mutation: MutationObserver | null\n nav: Element | null\n observed: Set<Element>\n resize: ResizeObserver | null\n wrapper: HTMLElement\n wrapperFrame: number\n}\n\n// What the items and links registered, and the listeners of the menu that renders from it. Kept\n// outside React state: a link registers new props on every one of its renders.\nfunction createRegistry() {\n const entries = new Map<string, Entry>()\n const listeners = new Set<() => void>()\n let version = 0\n\n const entry = (id: string) => {\n let found = entries.get(id)\n if (!found) {\n found = { element: null, link: null }\n entries.set(id, found)\n }\n return found\n }\n\n return {\n entries,\n getVersion: () => version,\n notify: () => {\n version += 1\n listeners.forEach((listener) => listener())\n },\n set: (id: string, value: Partial<Entry>) => {\n const next = Object.assign(entry(id), value)\n if (!next.element && !next.link) entries.delete(id)\n },\n subscribe: (listener: () => void) => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n }\n }\n}\n\n// chassis-css hides an item with this attribute (`_nav-overflow.scss`) and the toggle item with\n// the display utility, as its plugin does.\nconst HIDDEN_ATTRIBUTE = 'data-cx-nav-overflow'\nconst HIDDEN_CLASS = 'd-none'\n\n// What keeps an item in the list by being inside it: the current link, and the tab that is the\n// list's Tab stop. react-aria gives that to the tab focused last, which needn't be the selected\n// one: hidden, it would leave the keyboard no way into the list.\nconst KEPT_CONTENT =\n '.nav-link.active, .nav-link[aria-current]:not([aria-current=\"false\"]), [role=\"tab\"][tabindex=\"0\"]'\n\nconst EMPTY: readonly string[] = []\n\nconst pixels = (value: string) => Number.parseFloat(value) || 0\n\n// Not `instanceof HTMLElement`: a list rendered into another window has that window's classes.\nconst isHTMLElement = (element: Element): element is HTMLElement => 'offsetWidth' in element\n\nconst sameIds = (a: readonly string[], b: readonly string[]) =>\n a.length === b.length && a.every((id, index) => id === b[index])\n\n// `collapseBelow` in pixels. A breakpoint is a custom property of chassis-css, in `rem`.\nfunction resolveCollapseBelow(value: number | Breakpoint | undefined, wrapper: HTMLElement) {\n if (typeof value === 'number') return value\n if (!value) return 0\n const root = getComputedStyle(wrapper.ownerDocument.documentElement)\n const width = root.getPropertyValue(`--cx-breakpoint-${value}`).trim()\n return /r?em$/.test(width) ? pixels(width) * (pixels(root.fontSize) || 16) : pixels(width)\n}\n\n// Until the page has hydrated nothing has been measured, and the server's HTML holds every item\n// on one line (`.nav-overflow > .nav` doesn't wrap). The items that don't fit are clipped at the\n// wrapper's edge and can be scrolled to, instead of running over what is next to the list.\nconst UNMEASURED_STYLE: CSSProperties = { overflowX: 'auto', scrollbarWidth: 'none' }\n\nfunction NavOverflowRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n collapseBelow,\n component,\n iconPlacement = 'start',\n menuContainer,\n menuPlacement = 'bottom-end',\n moreIcon,\n moreLabel = 'More',\n moreText = 'More',\n onOverflow,\n style,\n threshold = 0,\n ...rest\n }: NavOverflowProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n // The wrapper, kept while React re-attaches a ref: a caller's ref that is a new function on\n // each render makes it detach and attach this one too, and in between, where the list's\n // effects run, there would be nothing to measure.\n const wrapperRef = useRef<HTMLElement | null>(null)\n const setWrapper = useCallback((element: HTMLElement | null) => {\n if (element) wrapperRef.current = element\n }, [])\n const forkedRef = useForkedRef(ref, setWrapper)\n const hydrated = useHydrated()\n\n const [registry] = useState(createRegistry)\n const [hidden, setHidden] = useState(EMPTY)\n const hiddenRef = useRef(hidden)\n const itemCountRef = useRef(0)\n const optionsRef = useRef({ collapseBelow, threshold })\n optionsRef.current = { collapseBelow, threshold }\n\n const observersRef = useRef<Observers | null>(null)\n\n // Which items don't fit, or `null` when there is nothing to measure.\n //\n // Widths are read with every item and the toggle shown, so they never depend on what the last\n // pass hid. Showing and hiding again happens in one synchronous block, outside React: the browser\n // paints neither, and the elements are back as React rendered them before it looks again.\n const measure = useCallback((): string[] | null => {\n const wrapper = wrapperRef.current?.isConnected ? wrapperRef.current : null\n const nav = wrapper && Array.from(wrapper.children).find((child) => child.matches('.nav'))\n devWarning(\n !!wrapper && !nav,\n 'NavOverflow: expects a `Nav`, a `NavbarNav` or a `TabList` as its child; found no `.nav` ' +\n 'to collapse.'\n )\n if (!wrapper || !nav) return null\n\n // Every child of the list takes room in the row, a title or a divider too; only registered\n // items can leave it.\n const children = Array.from(nav.children).filter(isHTMLElement)\n const more = children.find((child) => child.classList.contains('nav-overflow-item'))\n const elements = children.filter((child) => child !== more)\n observe(wrapper, nav, children)\n itemCountRef.current = elements.length\n // No toggle: the list is not one that takes part, so nothing can move.\n if (!more) return []\n\n const ids = new Map<Element, string>()\n registry.entries.forEach((entry, id) => {\n if (entry.element) ids.set(entry.element, id)\n })\n\n const wereHidden = elements.filter((element) => element.hasAttribute(HIDDEN_ATTRIBUTE))\n const moreWasHidden = more.classList.contains(HIDDEN_CLASS)\n wereHidden.forEach((element) => element.removeAttribute(HIDDEN_ATTRIBUTE))\n more.classList.remove(HIDDEN_CLASS)\n\n try {\n const wrapperStyle = getComputedStyle(wrapper)\n const navStyle = getComputedStyle(nav)\n // The wrapper's content box, as chassis-css's plugin takes it.\n const width =\n wrapper.clientWidth -\n pixels(wrapperStyle.paddingInlineStart) -\n pixels(wrapperStyle.paddingInlineEnd)\n const focused = wrapper.ownerDocument.activeElement\n\n const items = elements.map((element): MeasuredItem => {\n const id = ids.get(element)\n return {\n id,\n // An item stays in the list when the menu has nothing to show for it, when it is\n // marked to stay, when it is the current one or the list's Tab stop, and while it has\n // focus, which hiding it would drop.\n keep:\n !id ||\n !registry.entries.get(id)?.link ||\n element.classList.contains('nav-overflow-keep') ||\n element.querySelector(KEPT_CONTENT) !== null ||\n element.contains(focused),\n width: element.offsetWidth\n }\n })\n\n const { collapseBelow, threshold } = optionsRef.current\n return overflowingIds({\n available:\n width -\n pixels(navStyle.paddingInlineStart) -\n pixels(navStyle.paddingInlineEnd) -\n pixels(navStyle.borderInlineStartWidth) -\n pixels(navStyle.borderInlineEndWidth),\n collapseAll: width < resolveCollapseBelow(collapseBelow, wrapper),\n gap: pixels(navStyle.columnGap),\n items,\n more: more.offsetWidth,\n threshold\n })\n } finally {\n wereHidden.forEach((element) => element.setAttribute(HIDDEN_ATTRIBUTE, 'true'))\n if (moreWasHidden) more.classList.add(HIDDEN_CLASS)\n // Lay the list out as it was. Without this the layout stays as measured, with everything\n // shown, until the browser next needs it, and a ResizeObserver delivering in the meantime\n // (react-aria's, on the toggle) is told of sizes that were never painted.\n void wrapper.offsetWidth\n // The mutations above are this function's own.\n observersRef.current?.mutation?.takeRecords()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registry])\n\n const update = useCallback(() => {\n const next = measure()\n if (!next || sameIds(next, hiddenRef.current)) return\n hiddenRef.current = next\n setHidden(next)\n }, [measure])\n\n // What changes the result without a render of the list:\n //\n // - The wrapper's width. The wrapper and not the list, whose width the result itself changes.\n // - An item's width: a font that loads, a label that changes.\n // - A link that becomes the current one by itself, as a router's link does on navigation.\n //\n // An observer's callback runs before the browser paints, and `flushSync` commits the result\n // there, so no frame shows the items of the old width.\n //\n // A ResizeObserver delivers sizes top down, and reports a loop error when a callback changes\n // a size it has already passed. Two things here would: hiding an item's siblings from the\n // callback for that item, so an item's own resize waits a frame; and a toggle taller than the\n // links, which changes the wrapper's height from the wrapper's own callback, so the wrapper is\n // observed again from the next frame once a pass has moved anything.\n function observe(wrapper: HTMLElement, nav: Element, children: HTMLElement[]) {\n let observers = observersRef.current\n if (observers && observers.wrapper !== wrapper) {\n disconnect()\n observers = null\n }\n if (!observers) {\n const flush = () => flushSync(update)\n const created: Observers = {\n frame: 0,\n mutation: typeof MutationObserver === 'undefined' ? null : new MutationObserver(flush),\n nav: null,\n observed: new Set(),\n resize:\n typeof ResizeObserver === 'undefined'\n ? null\n : new ResizeObserver((entries) => {\n if (!entries.some((entry) => entry.target === wrapper)) {\n cancelAnimationFrame(created.frame)\n created.frame = requestAnimationFrame(flush)\n return\n }\n const before = hiddenRef.current\n flush()\n // The pass can have replaced these observers, for a wrapper that is a new element.\n if (hiddenRef.current === before || observersRef.current !== created) return\n created.resize?.unobserve(wrapper)\n cancelAnimationFrame(created.wrapperFrame)\n created.wrapperFrame = requestAnimationFrame(() => created.resize?.observe(wrapper))\n }),\n wrapperFrame: 0,\n wrapper\n }\n observers = observersRef.current = created\n observers.resize?.observe(wrapper)\n }\n const { mutation, observed, resize } = observers\n\n if (observers.nav !== nav) {\n observers.nav = nav\n mutation?.disconnect()\n mutation?.observe(nav, {\n attributeFilter: ['class', 'aria-current'],\n attributes: true,\n childList: true,\n subtree: true\n })\n }\n\n const current = new Set<Element>(children)\n observed.forEach((element) => {\n if (current.has(element)) return\n resize?.unobserve(element)\n observed.delete(element)\n })\n current.forEach((element) => {\n if (observed.has(element)) return\n resize?.observe(element)\n observed.add(element)\n })\n }\n\n function disconnect() {\n const observers = observersRef.current\n if (!observers) return\n cancelAnimationFrame(observers.frame)\n cancelAnimationFrame(observers.wrapperFrame)\n observers.mutation?.disconnect()\n observers.resize?.disconnect()\n observersRef.current = null\n }\n\n useEffect(() => disconnect, [])\n\n // The list measures after each of its commits (`NavOverflowItems`). This covers what it can't:\n // the first commit and a wrapper that becomes another element, where React attaches the\n // wrapper's ref after the list's effects have run, and the options, which can change without\n // the list rendering.\n useIsomorphicLayoutEffect(update, [update, Component, collapseBelow, threshold])\n\n const reportedRef = useRef(hidden)\n useEffect(() => {\n if (reportedRef.current === hidden) return\n reportedRef.current = hidden\n onOverflow?.({\n overflowCount: hidden.length,\n visibleCount: itemCountRef.current - hidden.length\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hidden])\n\n const registerItem = useCallback(\n (id: string, element: HTMLElement | null) => registry.set(id, { element }),\n [registry]\n )\n const registerLink = useCallback(\n (id: string, link: NavOverflowLinkProps | null) => {\n registry.set(id, { link })\n // The menu renders from these props, and only it needs to hear of new ones.\n if (hiddenRef.current.includes(id)) registry.notify()\n },\n [registry]\n )\n\n const controller: NavOverflowController = useMemo(\n () => ({ hidden, More: NavOverflowMore, registerItem, registerLink, update }),\n [hidden, registerItem, registerLink, update]\n )\n\n const more: NavOverflowMoreState = useMemo(\n () => ({\n getLink: (id) => registry.entries.get(id)?.link ?? null,\n getVersion: registry.getVersion,\n hidden,\n iconPlacement,\n menuContainer,\n menuPlacement,\n moreIcon,\n moreLabel,\n moreText,\n subscribe: registry.subscribe\n }),\n [hidden, iconPlacement, menuContainer, menuPlacement, moreIcon, moreLabel, moreText, registry]\n )\n\n return (\n <NavOverflowContext.Provider value={controller}>\n <NavOverflowMoreContext.Provider value={more}>\n <Component\n className={classNames('nav-overflow', className)}\n style={hydrated ? style : { ...UNMEASURED_STYLE, ...style }}\n {...rest}\n ref={forkedRef}\n >\n {children}\n </Component>\n </NavOverflowMoreContext.Provider>\n </NavOverflowContext.Provider>\n )\n}\n\nexport const NavOverflow = createPolymorphicComponent<NavOverflowComponent>(\n NavOverflowRender as ForwardRefRenderFunction<Element, NavOverflowProps<ElementType>>,\n 'NavOverflow'\n)\n"],"mappings":"0pBAqCA,MAAa,EAAyB,EAA2C,IAAI,EAGrF,SAAS,EAAc,EAAuC,CAC5D,IAAK,IAAI,EAAQ,EAAK,uBAAwB,EAAO,EAAQ,EAAM,uBAAwB,CACzF,GAAI,EAAM,aAAa,sBAAsB,EAAG,SAChD,IAAM,EAAO,EAAM,cAA2B,4CAA4C,EAC1F,GAAI,EAAM,OAAO,CACnB,CACA,OAAO,IACT,CAKA,SAAgB,EAAgB,CAAE,QAA8B,CAC9D,IAAM,EAAQ,EAAW,CAAsB,EACzC,CAAC,EAAS,GAAc,EAAS,EAAK,EACtC,EAAU,EAAsB,IAAI,EACpC,EAAiB,EAAO,EAAK,EAC7B,EAAS,GAAO,OAChB,EAAQ,CAAC,GAAQ,OAKvB,MAAgC,CAC9B,IAAM,EAAO,EAAQ,QACrB,GAAI,CAAC,GAAQ,CAAC,EAAe,QAAS,OACtC,IAAM,EAAS,EAAK,cAAc,eACrB,CAAC,GAAU,IAAW,EAAK,cAAc,MAAS,GAAS,EAAK,SAAS,CAAM,KAE5F,EAAe,QAAU,CAAC,GACb,EACT,EAAc,CAAI,EAClB,EAAK,cAA2B,sBAAsB,EAAA,EACpD,MAAM,EACd,EAAG,CAAC,EAAQ,CAAK,CAAC,EAElB,IAAM,EAAe,GAAsB,CACzC,EAAe,QAAU,GAIrB,GAAM,EAAM,gBAAgB,CAClC,EACM,MAAmB,CACvB,EAAe,QAAU,EAC3B,EAQA,GANA,EACE,GAAO,WAAa,EACpB,GAAO,YAAc,EACrB,GAAO,YAAc,CACvB,EAEI,CAAC,GAAS,CAAC,EAAQ,OAAO,KAE9B,GAAM,CAAE,UAAS,gBAAe,gBAAe,gBAAe,WAAU,YAAW,YACjF,EAEE,GAAS,GAAS,EAAW,EAAK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rB,SACA,gBACA,gBACA,gBACA,WACA,YACA,WACA,UAAW,EAAS,SACtB,GACA,CAAC,EAAQ,EAAe,EAAe,EAAe,EAAU,EAAW,EAAU,CAAQ,CAC/F,EAEA,OACE,EAAA,cAAC,EAAmB,SAApB,CAA6B,MAAO,EAWP,EAV3B,EAAA,cAAC,EAAuB,SAAxB,CAAiC,MAAO,EASP,EAR/B,EAAA,cAAC,EAAD,CACE,UAAW,EAAW,eAAgB,CAAS,EAC/C,MAAO,GAAW,EAAQ,CAAE,GAAG,GAAkB,GAAG,CAAM,EAC1D,GAAI,EACJ,IAAK,EAGI,EADR,CACQ,CACoB,CACN,CAEjC,CAEA,MAAa,EAAc,EACzB,EACA,aACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,s as t,v as n}from"./slot-CNhFZdHF.js";import{t as r}from"./useIsomorphicLayoutEffect-BbqRwuqn.js";import i,{cloneElement as a,createContext as o,useCallback as s,useContext as c,useId as l,useMemo as u}from"react";const d=o(null),f=o(null);function p({children:e}){return i.createElement(f.Provider,{value:null},e)}function m({children:e,tabs:t,tag:a}){let o=a===void 0||a===`ul`||a===`ol`,s=c(d);n(!!s&&!o,`NavOverflow: collapses the \`NavItem\`s of a list, and a <${a}> has none. Leave out \`component\` to render a <ul>.`);let l=o?s:null,p=u(()=>l?{controller:l}:null,[l]),m=l?.update;r(()=>{m?.()});let h=l?.More;return i.createElement(i.Fragment,null,i.createElement(d.Provider,{value:null},i.createElement(f.Provider,{value:p},e)),h&&i.createElement(h,{tabs:t}))}const h=f.Provider;function g(e){let t=c(f),n=l(),r=t&&t.itemId===void 0?t.controller:null,i=u(()=>r?{controller:r,itemId:n}:null,[r,n]),a=r?.registerItem,o=s(e=>a?.(n,e),[a,n]);return b(e?r?.registerLink:void 0,n,e),{hidden:!!r&&r.hidden.includes(n),ref:r?o:void 0,scope:i}}const _=()=>c(f)?.itemId!==void 0;function v({props:n}){let r=c(f),i=t(),{component:o,...s}=y(n);return b(r?.itemId===void 0?void 0:r.controller.registerLink,r?.itemId,e(o)&&i?{...s,asChild:!0,children:a(i,{id:void 0,ref:null})}:{...s,component:o}),null}function y(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e!==`id`&&e!==`aria-describedby`&&(e===`onClick`||!/^on[A-Z]/.test(e))))}function b(e,t,n){r(()=>{e&&t!==void 0&&n&&e(t,n)}),r(()=>{if(e&&t!==void 0)return()=>e(t,null)},[e,t])}export{v as a,m as i,d as n,_ as o,h as r,g as s,p as t};
|
|
2
|
+
//# sourceMappingURL=navOverflow-B5krZe6D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navOverflow-B5krZe6D.js","names":[],"sources":["../../src/utils/navOverflow.tsx"],"sourcesContent":["import React, {\n cloneElement,\n ComponentType,\n createContext,\n ReactElement,\n ReactNode,\n RefCallback,\n useCallback,\n useContext,\n useId,\n useMemo\n} from 'react'\n\nimport { useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect'\nimport { devWarning } from './devWarning'\nimport { isSlot, useSlotElement } from './slot'\n\n// How `NavOverflow` (`components/nav-overflow`) and the lists it collapses work together.\n//\n// chassis-css's plugin clones the links that don't fit into its menu. A clone has no React\n// behind it: no `onClick`, no router link. Here nothing is cloned. Three parts take a role each:\n//\n// - The list (`Nav`, `NavbarNav`, `TabList`) renders `NavOverflowItems` around its items, which\n// adds the toggle item after them.\n// - An item (`NavItem`, a tab) registers its `<li>`, which is what `NavOverflow` measures and\n// hides.\n// - The item's link (`NavLink`) registers the props it was rendered with, and the menu renders a\n// `MenuItem` from them. An item with no link registered, such as one holding a dropdown, has\n// nothing to show in the menu, so it is never moved.\n//\n// An item is known by an id of its own rather than by its position among the list's children, so\n// a component that renders several items, or a fragment of them, works like items written in\n// place. `NavOverflow` takes their order from the document.\n//\n// These live here, not in `components/nav-overflow`, so that `Nav` and `Tabs` import a context and\n// nothing else: the toggle and its `Menu` reach a list through the controller (`More`), and stay\n// out of the bundle of a page that only renders a `Nav`.\n\n/** The props a link hands to the `MenuItem` that stands in for it. */\nexport type NavOverflowLinkProps = Record<string, unknown>\n\nexport interface NavOverflowMoreProps {\n /**\n * The list is a `tablist`: the toggle is one of its tabs, and its menu is rendered outside it.\n */\n tabs?: boolean\n}\n\nexport interface NavOverflowController {\n /**\n * The ids of the items that are in the menu, in document order.\n */\n hidden: readonly string[]\n /**\n * The toggle item and its menu, rendered by the list after its items.\n */\n More: ComponentType<NavOverflowMoreProps>\n registerItem: (id: string, element: HTMLElement | null) => void\n registerLink: (id: string, props: NavOverflowLinkProps | null) => void\n /**\n * Measures again. A list calls it after each of its commits.\n */\n update: () => void\n}\n\n/**\n * From `NavOverflow` to the list directly inside it.\n */\nexport const NavOverflowContext = createContext<NavOverflowController | null>(null)\n\n// From the list to its items (`itemId` unset), and from an item to its link (`itemId` set). One\n// context, so an item nested in another item finds `itemId` set and knows it isn't the list's own.\ninterface NavOverflowScope {\n controller: NavOverflowController\n itemId?: string\n}\n\nconst NavOverflowScopeContext = createContext<NavOverflowScope | null>(null)\n\n/**\n * Closes the scope for everything inside: a `Menu` in an item isn't that item's link, and neither\n * is anything in its list.\n */\nexport function NavOverflowBoundary({ children }: { children?: ReactNode }): ReactElement {\n return (\n <NavOverflowScopeContext.Provider value={null}>{children}</NavOverflowScopeContext.Provider>\n )\n}\n\n/**\n * A list's items. Inside a `NavOverflow` they are the items it collapses, followed by the toggle\n * item. Anywhere else they render as they are, and a list nested in a collapsing item takes no\n * part in it.\n */\nexport function NavOverflowItems({\n children,\n tabs,\n tag\n}: NavOverflowMoreProps & {\n children?: ReactNode\n /**\n * The tag the list renders, when it is known. The toggle item is an `<li>`, so only a `<ul>`\n * or an `<ol>` takes part.\n */\n tag?: string\n}): ReactElement {\n const collapses = tag === undefined || tag === 'ul' || tag === 'ol'\n const inherited = useContext(NavOverflowContext)\n devWarning(\n !!inherited && !collapses,\n `NavOverflow: collapses the \\`NavItem\\`s of a list, and a <${tag}> has none. Leave out ` +\n `\\`component\\` to render a <ul>.`\n )\n const controller = collapses ? inherited : null\n const scope = useMemo(() => (controller ? { controller } : null), [controller])\n const update = controller?.update\n\n // After every commit of the list: an item added, removed, renamed or made active changes what\n // fits, and none of those resizes the wrapper.\n useIsomorphicLayoutEffect(() => {\n update?.()\n })\n\n const More = controller?.More\n\n return (\n <>\n <NavOverflowContext.Provider value={null}>\n <NavOverflowScopeContext.Provider value={scope}>\n {children}\n </NavOverflowScopeContext.Provider>\n </NavOverflowContext.Provider>\n {More && <More tabs={tabs} />}\n </>\n )\n}\n\nexport interface NavOverflowItem {\n /**\n * Whether the item is in the menu, and so hidden in the list.\n */\n hidden: boolean\n /**\n * For the item's `<li>`. `undefined` outside a collapsing list.\n */\n ref: RefCallback<HTMLElement> | undefined\n /**\n * For `NavOverflowItemScope`, around the item's children.\n */\n scope: NavOverflowScope | null\n}\n\nexport const NavOverflowItemScope = NavOverflowScopeContext.Provider\n\n/**\n * An item of a list. `link` is for an item that is its own link, as a tab is; an item that holds\n * a `NavLink` leaves it out, and the link registers itself.\n */\nexport function useNavOverflowItem(link?: NavOverflowLinkProps): NavOverflowItem {\n const inherited = useContext(NavOverflowScopeContext)\n const id = useId()\n // The list's own items only: inside another item, `itemId` is that item's.\n const controller = inherited && inherited.itemId === undefined ? inherited.controller : null\n const scope = useMemo(() => (controller ? { controller, itemId: id } : null), [controller, id])\n const registerItem = controller?.registerItem\n const ref = useCallback(\n (element: HTMLElement | null) => registerItem?.(id, element),\n [registerItem, id]\n )\n\n useRegisteredLink(link ? controller?.registerLink : undefined, id, link)\n\n return {\n hidden: !!controller && controller.hidden.includes(id),\n ref: controller ? ref : undefined,\n scope\n }\n}\n\n/**\n * Whether the caller is the link of an item that can move into the menu, and so should render a\n * `NavOverflowLink`.\n */\nexport const useIsNavOverflowLink = (): boolean =>\n useContext(NavOverflowScopeContext)?.itemId !== undefined\n\n/**\n * Registers the props of an item's link, which the menu renders its `MenuItem` from. It renders\n * nothing. A component, not a hook, because a link rendered with `asChild` has to hand over the\n * element it was given, and only something rendered beside the `Slot` can read that.\n */\nexport function NavOverflowLink({ props }: { props: NavOverflowLinkProps }): null {\n const scope = useContext(NavOverflowScopeContext)\n const slotted = useSlotElement()\n const { component, ...link } = menuProps(props)\n useRegisteredLink(\n scope?.itemId === undefined ? undefined : scope.controller.registerLink,\n scope?.itemId,\n isSlot(component) && slotted\n ? // The caller's element, without what is its own in the list: its `ref` would be taken\n // over by the copy in the menu, and dropped when that copy went.\n { ...link, asChild: true, children: cloneElement(slotted, { id: undefined, ref: null }) }\n : { ...link, component }\n )\n return null\n}\n\n// What a link hands to its menu item. Not its `id`: the two are in the document together. And of\n// its handlers, `onClick` only: the rest are for the link where it is, such as the hover and\n// focus handlers a `Tooltip` around it adds, which would open a tooltip anchored to a hidden\n// link. Its description goes with them.\nfunction menuProps(props: NavOverflowLinkProps): NavOverflowLinkProps {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([name]) =>\n name !== 'id' &&\n name !== 'aria-describedby' &&\n (name === 'onClick' || !/^on[A-Z]/.test(name))\n )\n )\n}\n\nfunction useRegisteredLink(\n register: NavOverflowController['registerLink'] | undefined,\n id: string | undefined,\n props: NavOverflowLinkProps | undefined\n) {\n // On every commit: the props are new objects on each render, and the menu shows the latest.\n useIsomorphicLayoutEffect(() => {\n if (register && id !== undefined && props) register(id, props)\n })\n\n useIsomorphicLayoutEffect(() => {\n if (!register || id === undefined) return undefined\n return () => register(id, null)\n }, [register, id])\n}\n"],"mappings":"qOAoEA,MAAa,EAAqB,EAA4C,IAAI,EAS5E,EAA0B,EAAuC,IAAI,EAM3E,SAAgB,EAAoB,CAAE,YAAoD,CACxF,OACE,EAAA,cAAC,EAAwB,SAAzB,CAAkC,MAAO,IAAkD,EAA3C,CAA2C,CAE/F,CAOA,SAAgB,EAAiB,CAC/B,WACA,OACA,OAQe,CACf,IAAM,EAAY,IAAQ,IAAA,IAAa,IAAQ,MAAQ,IAAQ,KACzD,EAAY,EAAW,CAAk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AO,OACP,EAAO,CAAS,GAAK,EAGjB,CAAE,GAAG,EAAM,QAAS,GAAM,SAAU,EAAa,EAAS,CAAE,GAAI,IAAA,GAAW,IAAK,IAAK,CAAC,CAAE,EACxF,CAAE,GAAG,EAAM,WAAU,CAC3B,EACO,IACT,CAMA,SAAS,EAAU,EAAmD,CACpE,OAAO,OAAO,YACZ,OAAO,QAAQ,CAAK,CAAC,CAAC,QACnB,CAAC,KACA,IAAS,MACT,IAAS,qBACR,IAAS,WAAa,CAAC,WAAW,KAAK,CAAI,EAChD,CACF,CACF,CAEA,SAAS,EACP,EACA,EACA,EACA,CAEA,MAAgC,CAC1B,GAAY,IAAO,IAAA,IAAa,GAAO,EAAS,EAAI,CAAK,CAC/D,CAAC,EAED,MAAgC,CAC1B,GAAC,GAAY,IAAO,IAAA,GACxB,UAAa,EAAS,EAAI,IAAI,CAChC,EAAG,CAAC,EAAU,CAAE,CAAC,CACnB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{v as e}from"./slot-CNhFZdHF.js";function t(t,n){return e(t===`pills`,`${n}: variant="pills" is deprecated, use variant="segments" instead. It will be removed in a future major version.`),t&&`nav-${t===`pills`?`segments`:t}`}export{t};
|
|
2
|
+
//# sourceMappingURL=navVariant-DeGTk9B7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navVariant-DeGTk9B7.js","names":[],"sources":["../../src/utils/navVariant.ts"],"sourcesContent":["import { devWarning } from './devWarning'\n\n// The looks of a `.nav` that `Nav` and `TabList` share. `'pills'` is what `'segments'` was called\n// until chassis-css 0.6 renamed `.nav-pills` to `.nav-segments`: still accepted, deprecated.\nexport type NavVariant = 'tabs' | 'segments' | 'underline' | 'pills'\n\nexport function navVariantClassName(\n variant: NavVariant | undefined,\n displayName: string\n): string | undefined {\n devWarning(\n variant === 'pills',\n `${displayName}: variant=\"pills\" is deprecated, use variant=\"segments\" instead. It will be ` +\n 'removed in a future major version.'\n )\n\n return variant && `nav-${variant === 'pills' ? 'segments' : variant}`\n}\n"],"mappings":"uCAMA,SAAgB,EACd,EACA,EACoB,CAOpB,OANA,EACE,IAAY,QACZ,GAAG,EAAY,+GAEjB,EAEO,GAAW,OAAO,IAAY,QAAU,WAAa,GAC9D"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{d as e,g as t,m as n,p as r}from"./slot-CNhFZdHF.js";import{t as i}from"./polymorphic-BhGNZQja.js";import{t as a}from"./iconSlot-BNu2MrFI.js";import{t as o}from"./VisuallyHidden-C2dM7HhC.js";import{i as s,n as c}from"./navOverflow-B5krZe6D.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?l.createElement(`div`,{className:`container${i===!0?``:`-`+i}`},e):e,l.createElement(p,{className:m,...u,ref:d},h)}const m=i(p,`Navbar`);function h({children:n,component:i,className:a,href:o,...s},c){let u=r(i,o,`span`),d=f(`navbar-brand`,a);return l.createElement(u,{className:d,...e(t(u,o,s),o,`NavbarBrand`),...s,ref:c},n)}const g=i(h,`NavbarBrand`);function _({children:e,component:t,className:r,...i},a){let o=t??`ul`,u=d(c)!==null,p=f({nav:u},`navbar-nav`,r);return l.createElement(o,{className:p,...i,ref:a},l.createElement(s,{tag:n(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 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 l.createElement(`button`,{type:`button`,className:c,...i,ref:s},e??l.createElement(l.Fragment,null,l.createElement(a,{icon:`menu`,override:n,className:`navbar-toggler-icon`}),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-DxIwt0sc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar-DxIwt0sc.js","names":[],"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 * Defines optional container wrapping children elements.\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 className={`container${container !== true ? '-' + container : ''}`}>{children}</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 '../../utils/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":"4WA6DA,SAAS,EACP,CACE,WACA,YACA,QACA,YACA,YACA,SACA,YACA,cACA,UACA,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,SACA,EACA,CACE,QAAS,CAAC,CAAC,EACX,MAAO,IAAY,QACnB,OAAQ,IAAY,SACpB,QAAS,IAAY,UACrB,eACC,OAAO,GAAW,UAAY,gBAAkB,GAAG,EAAO,iBAAkB,CAC/E,EACA,EACA,CACF,EAEI,EASJ,MARA,CAKE,EALE,EAEA,EAAA,cAAC,MAAD,CAAK,UAAW,YAAY,IAAc,GAAyB,GAAlB,IAAM,GAAiC,EAAd,CAAc,EAGhF,EAIV,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAS,EACpB,EACA,QACF,ECvEA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,OAAM,GAAG,GAC3C,EACA,CAGA,IAAM,EAAY,EAAY,EAAW,EAAM,MAAM,EAC/C,EAAa,EAAW,eAAgB,CAAS,EAEvD,OACE,EAAA,cAAC,EAAD,CACE,UAAW,EACX,GAAI,EAAU,EAAgB,EAAW,EAAM,CAAI,EAAG,EAAM,aAAa,EACzE,GAAI,EACC,KAGI,EADR,CACQ,CAEf,CAEA,MAAa,EAAc,EACzB,EACA,aACF,ECjCA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,KAGzB,EAAY,EAAW,CAAkB,IAAM,KAC/C,EAAa,EAAW,CAAE,IAAK,CAAU,EAAG,aAAc,CAAS,EAEzE,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADT,EAAA,cAAC,EAAD,CAAkB,IAAK,EAAkB,CAAS,CAA+B,EAA3B,CAA2B,CACxE,CAEf,CAEA,MAAa,EAAY,EACvB,EACA,WACF,ECtBA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EAAW,cAAe,CAAS,EAEtD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAa,EACxB,EACA,YACF,ECvBa,EAAgB,GAC1B,CAAE,WAAU,YAAW,OAAM,QAAQ,oBAAqB,GAAG,GAAQ,IAAQ,CAC5E,IAAM,EAAa,EAAW,kCAAmC,CAAS,EAE1E,OACE,EAAA,cAAC,SAAD,CAAQ,KAAK,SAAS,UAAW,EAAY,GAAI,EAAW,KAOpD,EANL,GACC,EAAA,cAAA,EAAA,SAAA,KACE,EAAA,cAAC,EAAD,CAAU,KAAK,OAAO,SAAU,EAAM,UAAU,qBAAuB,CAAA,EACvE,EAAA,cAAC,EAAA,KAAgB,CAAsB,CACvC,CAEE,CAEZ,CACF,EAEA,EAAc,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{n as t,r as n,t as r}from"./useToastRegionQueue-CIV5SdiE.js";import{t as i}from"./Icon-DLB1f88W.js";import{n as a}from"./iconSlot-BNu2MrFI.js";import{t as o}from"./CloseButton-DPgQztE0.js";import{t as s}from"./stack-DK5F53VT.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:()=>{}}),g=()=>d(h);function _({children:e,component:t,className:n,...r},i){let a=t??`div`,o=f(`notification-text`,n);return c.createElement(a,{className:o,...r,ref:i},e)}const v=e(_,`NotificationText`);function y({children:e,className:t,component:n,...r},i){let a=n??`h4`,o=f(`notification-title`,t);return c.createElement(a,{className:o,...r,ref:i},e)}const b=e(y,`NotificationTitle`),x=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:_,solid:y,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:y},s);return P?c.createElement(h.Provider,{value:{visible:R,close:j}},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},_&&(typeof _==`string`?c.createElement(a,{value:_,className:f(`notification-icon`,{"align-self-start":!!S})}):_),S&&c.createElement(b,{id:I,component:C},S),x&&c.createElement(v,{id:F},x),i,e,g&&c.createElement(o,{label:l,onClick:j}))):null});x.displayName=`Notification`;const S=u(({className:e,...t},n)=>{let r=f(`notification-icon`,e);return c.createElement(i,{className:r,...t,ref:n})});S.displayName=`NotificationIcon`;const C=new m;function w(e,t={}){return C.add({children:e,...t})}function T(e){C.close(e)}const E=u(({children:e,className:t,reverse:n,...i},a)=>{let{forkedRef:o,regionProps:l,state:u}=r(C,a);if(u.visibleToasts.length===0&&!e)return null;let d=n?[...u.visibleToasts].reverse():u.visibleToasts;return c.createElement(s,{direction:`vertical`,gap:`sm`,className:t,...l,...i,ref:o},e,d.map(e=>{let{children:t,...n}=e.content;return c.createElement(x,{key:e.key,...n,onClose:()=>u.close(e.key)},t)}))});E.displayName=`NotificationStack`;export{S as a,v as c,C as i,g as l,w as n,x as o,T as r,b as s,E as t};
|
|
2
|
+
//# sourceMappingURL=notification-Dbci5Ka3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-Dbci5Ka3.js","names":[],"sources":["../../src/components/notification/context.ts","../../src/hooks/useNotification.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"],"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 { useContext } from 'react'\nimport { NotificationContext, NotificationContextProps } from '../components/notification/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","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 '../../utils/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"],"mappings":"ifAaA,MAAa,EAAsB,EAAwC,CAAE,UAAa,CAAC,CAAE,CAAC,ECJjF,MAA+C,EAAW,CAAmB,ECoB1F,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,oBAAqB,CAAS,EAE5D,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAmB,EAC9B,EACA,kBACF,ECjBA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,KACzB,EAAa,EAAW,qBAAsB,CAAS,EAE7D,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAoB,EAC/B,EACA,mBACF,EC4Da,EAAe,GAExB,CACE,UACA,WAAW,GACX,WACA,YACA,aAAa,QACb,QAAQ,UACR,iBAAiB,GACjB,QAAQ,IACR,cACA,OACA,QACA,OACA,QACA,iBAAiB,KACjB,OAAO,SACP,UACA,UACA,SACA,kBACA,GAAG,GAEL,IACG,CACH,GAAM,CACJ,QACA,UACA,YACA,YACA,SACA,UACA,kBACA,QAAS,GACP,EAAyB,CAC3B,iBACA,YAAa,eACb,UACA,SACA,kBACA,MACA,SACF,CAAC,EAKK,EAAmB,EAAe,CACtC,QAAS,EACT,QACA,QAAS,GAAY,EACrB,OAAQ,CACV,CAAC,EAEK,EAAa,EACjB,eACA,OACA,EACA,CACE,OACF,EACA,CACF,EAIA,OAFK,EAGH,EAAA,cAAC,EAAoB,SAArB,CAA8B,MAAO,CAAE,QAAS,EAAU,OAAM,CA4B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AC,CAAC,QAAQ,EAAI,EAAM,cAEpE,OACE,EAAA,cAAC,EAAD,CACE,UAAU,WACV,IAAI,KACO,YACX,GAAI,EACJ,GAAI,EACJ,IAAK,CAeA,EAbJ,EACA,EAAO,IAAK,GAAS,CACpB,GAAM,CAAE,SAAU,EAAsB,GAAG,GAAsB,EAAK,QACtE,OACE,EAAA,cAAC,EAAD,CACE,IAAK,EAAK,IACV,GAAI,EACJ,YAAe,EAAM,MAAM,EAAK,GAAG,CAGvB,EADX,CACW,CAElB,CAAC,CACI,CAEX,CACF,EAEA,EAAkB,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useForkedRef-DVEfT-KI.js";import{n as t}from"./Portal-CgeR1WXV.js";import{t as n}from"./useFormField-BOqmBTC4.js";import{t as r}from"./iconSlot-BNu2MrFI.js";import{t as i}from"./renderFormField-Brkw1yA6.js";import{t as a}from"./validationClassName-gRGs4KBm.js";import{r as o,t as ee}from"./unhandledProps-9Kdj7WVf.js";import s,{forwardRef as c,useRef as l}from"react";import u from"classnames";import{mergeProps as te,useButton as d,useLocale as f,useNumberField as ne}from"react-aria";import{useNumberFieldState as p}from"react-stately";function m({buttonProps:e,className:t,icon:n,iconKey:i}){let a=l(null),{buttonProps:o}=d(e,a);return s.createElement(`button`,{...o,className:t,ref:a},s.createElement(r,{icon:i,override:n}))}const h=c(({adornEnd:r,adornStart:c,className:d,decrementAriaLabel:h,decrementIcon:g,defaultValue:_,disabled:v,form:y,formatOptions:re,help:b,id:x,incrementAriaLabel:S,incrementIcon:C,invalid:w,invalidFeedback:T,label:E,max:D,min:O,name:k,onChange:ie,readOnly:ae,required:oe,size:A,step:se,stepButtons:j=!0,style:M,valid:N,validFeedback:P,value:F,...I},L)=>{let R=l(null),z=e(L,R),B=t(),{locale:V}=f(),{describedBy:H,feedbackId:U,helpId:W,inputId:G,labelId:ce,labelledBy:le}=n({ariaDescribedBy:I[`aria-describedby`],ariaLabelledBy:I[`aria-labelledby`],help:b,id:x,invalid:w,invalidFeedback:T,label:E,valid:N,validFeedback:P}),K={...I,"aria-describedby":H,"aria-labelledby":le,decrementAriaLabel:h,defaultValue:_,formatOptions:re,id:G,incrementAriaLabel:S,isDisabled:v,isInvalid:w,isReadOnly:ae,isRequired:oe,maxValue:D,minValue:O,onChange:ie,step:se,value:F},q=p({...K,locale:V}),{decrementButtonProps:ue,groupProps:J,incrementButtonProps:de,inputProps:Y}=ne(K,q,R),X=j||c!=null||r!=null,Z={onBlur:J.onBlur,onFocus:J.onFocus},Q=s.createElement(`input`,{...o(X?Y:te(Y,Z),I,ee),"aria-describedby":H,"aria-disabled":void 0,"aria-readonly":void 0,"aria-roledescription":B?Y[`aria-roledescription`]:void 0,className:u(X?`ghost-input`:`form-input`,!X&&A,a(w,N),!X&&d),form:y,inputMode:B?Y.inputMode:`numeric`,ref:z,style:X?void 0:M}),$=X?s.createElement(`div`,{className:u(`form-input`,`number-field`,A,d),style:M,...Z},c,Q,r,j&&s.createElement(`div`,{className:`number-field-buttons`},s.createElement(m,{buttonProps:de,className:`number-field-increment`,icon:C,iconKey:`increment`}),s.createElement(m,{buttonProps:ue,className:`number-field-decrement`,icon:g,iconKey:`decrement`}))):Q,fe=k?s.createElement(s.Fragment,null,$,s.createElement(`input`,{disabled:v||void 0,form:y,name:k,type:`hidden`,value:isNaN(q.numberValue)?``:q.numberValue})):$;return i({children:fe,help:b,ids:{feedback:U,help:W,input:G,label:ce},invalid:w,invalidFeedback:T,label:E,valid:N,validFeedback:P})});h.displayName=`NumberField`;export{h as t};
|
|
2
|
+
//# sourceMappingURL=number-field-IBIX2IWH.js.map
|