@chassis-ui/react 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.js +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.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.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 +2 -1
- 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-CZsWCnQb.js +2 -0
- package/dist/chunks/Link-CZsWCnQb.js.map +1 -0
- package/dist/chunks/{Link-B0Y1xgYi.d.ts → Link-nrd0JWlO.d.ts} +7 -5
- 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-CJ-498B7.d.ts +7 -0
- package/dist/chunks/breakpoints-o_2Ev7ir.js +2 -1
- package/dist/chunks/breakpoints-o_2Ev7ir.js.map +1 -0
- package/dist/chunks/button-group-BGppPrIv.js +2 -0
- package/dist/chunks/button-group-BGppPrIv.js.map +1 -0
- package/dist/chunks/{card-DfF2K_5p.js → card-YXn3bj_d.js} +2 -1
- package/dist/chunks/card-YXn3bj_d.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-ChACalAw.js +2 -0
- package/dist/chunks/checkbox-ChACalAw.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-BTvpgaRv.js → flex-CmlJbKVj.js} +2 -1
- package/dist/chunks/flex-CmlJbKVj.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-DK_vxz-4.js +2 -0
- package/dist/chunks/grid-DK_vxz-4.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-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-B2K-O9kl.d.ts +59 -0
- 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-DB_ToPdz.d.ts → index-BNf0jIIL.d.ts} +12 -1
- package/dist/chunks/index-BO9jLOIb.d.ts +2 -1
- package/dist/chunks/index-BTTeKpiE.d.ts +2 -1
- 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-Bi8FFadV.d.ts +2 -1
- package/dist/chunks/index-Bkj17NEQ.d.ts +2 -1
- package/dist/chunks/{index-BKMW0rkw.d.ts → index-Bm2NpgND.d.ts} +4 -2
- package/dist/chunks/{index-XjLvaH4G.d.ts → index-BnR7wjax.d.ts} +6 -5
- 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-CCXJXToc.d.ts +2 -1
- package/dist/chunks/{index-COsYSDrz.d.ts → index-CFnQubsV.d.ts} +17 -3
- package/dist/chunks/{index-DPV62IdF.d.ts → index-CJXKl97l.d.ts} +11 -9
- package/dist/chunks/index-CJzKu7QI.d.ts +2 -1
- package/dist/chunks/{index-ClT3E_hv.d.ts → index-CKx1KHED.d.ts} +4 -3
- package/dist/chunks/index-COsIPd8L.d.ts +2 -1
- package/dist/chunks/index-CRfm7W6C.d.ts +2 -1
- package/dist/chunks/{index-dh3TKanY.d.ts → index-CTpwB1yR.d.ts} +3 -2
- package/dist/chunks/index-CVUMS0x7.d.ts +2 -1
- package/dist/chunks/{index-BlgkO3dn.d.ts → index-CYgBmZ8w.d.ts} +24 -33
- 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-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-CsMIgBsd.d.ts +2 -1
- package/dist/chunks/index-D9PZHY_I.d.ts +2 -1
- 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-DJfga0Ce.d.ts +57 -0
- package/dist/chunks/{index-BTDgfLxK.d.ts → index-DJr_ZK4b.d.ts} +21 -5
- package/dist/chunks/index-DMbdEm__.d.ts +119 -0
- package/dist/chunks/{index-DJJocp_q.d.ts → index-DXjbI7Yv.d.ts} +3 -2
- package/dist/chunks/index-DaHQdNul.d.ts +182 -0
- package/dist/chunks/index-Dcc_W6Kv.d.ts +2 -1
- package/dist/chunks/{index-nklPDKlC.d.ts → index-DceCODH9.d.ts} +3 -2
- package/dist/chunks/index-Ddd7iWfm.d.ts +32 -0
- package/dist/chunks/index-Dfg4Ftb8.d.ts +2 -1
- package/dist/chunks/index-Dfy1YW5j.d.ts +2 -1
- package/dist/chunks/index-DgHvXzVh.d.ts +208 -0
- package/dist/chunks/index-Dh5CaHTP.d.ts +2 -1
- package/dist/chunks/{index-8PhBSbNQ.d.ts → index-DjXRq-n3.d.ts} +15 -10
- package/dist/chunks/{index-JllMXhVx.d.ts → index-DjrEvKd-.d.ts} +21 -4
- package/dist/chunks/index-DtbUXxjz.d.ts +2 -1
- package/dist/chunks/index-Du9fBqkT.d.ts +56 -0
- package/dist/chunks/index-FKh7iFQE.d.ts +95 -0
- package/dist/chunks/index-HrKN6s8z.d.ts +2 -1
- package/dist/chunks/{index-DR8sYtvd.d.ts → index-I-H3VJ-L.d.ts} +20 -87
- package/dist/chunks/{index-DEb9zXlC.d.ts → index-RHJhkSY-.d.ts} +79 -16
- package/dist/chunks/{index-Ctuk1xBU.d.ts → index-e7SJkI_m.d.ts} +9 -6
- package/dist/chunks/index-g74gO0pc.d.ts +36 -0
- package/dist/chunks/{index-DKma0jQw.d.ts → index-qMq_-GY2.d.ts} +3 -2
- package/dist/chunks/index-t_x6jj7l.d.ts +2 -1
- 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-Ds24wnPq.js +2 -0
- package/dist/chunks/notification-Ds24wnPq.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-DOFYCfJi.js +2 -0
- package/dist/chunks/radio-DOFYCfJi.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-DZh_5Df8.d.ts} +3 -2
- 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-BrD2JwNx.js +2 -0
- package/dist/chunks/skeleton-BrD2JwNx.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-D3retZ-W.js → stack-CsMiQbpq.js} +2 -1
- package/dist/chunks/stack-CsMiQbpq.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 +2 -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.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.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 +50 -38
- 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.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.js +1 -1
- package/dist/stack.js +1 -1
- package/dist/stepper.d.ts +1 -1
- package/dist/stepper.js +1 -1
- package/dist/style.css +1 -1
- package/dist/switch.js +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/button-group-CPZYA6aZ.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/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-D949AidR.d.ts +0 -40
- 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/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 @@
|
|
|
1
|
+
{"version":3,"file":"slot-CNhFZdHF.js","names":[],"sources":["../../src/utils/devWarning.ts","../../src/utils/elementKind.ts","../../src/utils/idRefs.ts","../../src/utils/slot.tsx"],"sourcesContent":["// Development-only misuse warnings, in one place so every component reports misuse the same way\n// and none of it reaches a consumer's production bundle.\n//\n// Two problems this fixes over calling `console.warn` directly, which is what every call site used\n// to do:\n//\n// 1. **They fired in production.** Nothing in this package guarded on `NODE_ENV`, so every\n// `console.warn` ran for end users of a consuming app. `process.env.NODE_ENV` is the idiom\n// bundlers (Vite, webpack, Turbopack, Rollup) replace with a literal, so in a production build\n// `IS_DEV` folds to `false` and no warning is ever emitted. Relying on that substitution adds\n// no new constraint: `react-dom` — a peer dependency, so always present — already requires\n// exactly the same replacement.\n// 2. **They repeated.** Most call sites warn during render, so a warning re-fired on every\n// re-render, and twice per render under StrictMode's double-invoke. De-duplicating on the\n// message means a misuse is reported once and stays readable in the console.\n//\n// What this does *not* do is strip the message strings from the bundle. Measured with esbuild\n// against the built `dist/index.js`: a `NODE_ENV=production` consumer bundle still contains them.\n// `tsdown` minifies this package's own output first (`minify: true`), collapsing each function to\n// a `IS_DEV && cond && ...` expression, and a consumer's minifier won't then inline that call to\n// discover its arguments are droppable. Building unminified would let them drop, at the cost of\n// shipping pretty-printed dist — not worth it for a few hundred gzipped bytes. The behavior that\n// mattered (nothing logged in production, nothing repeated in development) is the part that's\n// fixed; treat the strings as part of the bundle's fixed cost.\nconst IS_DEV = process.env.NODE_ENV !== 'production'\n\nconst warned = new Set<string>()\n\n/**\n * Resets the de-duplication set. Test-only — the suite asserts on these warnings, and without a\n * reset between tests the *second* test in a file to trigger the same message would see nothing.\n * Called from a global `beforeEach` in `test/setup.ts`.\n */\nexport function resetDevWarnings(): void {\n warned.clear()\n}\n\n/**\n * Logs `message` once via `console.warn` when `condition` is true, in development builds only.\n * Use for a recoverable misuse: the component still renders something sensible.\n */\nexport function devWarning(condition: boolean, message: string): void {\n if (!IS_DEV) return\n if (!condition || warned.has(message)) return\n warned.add(message)\n console.warn(message)\n}\n\n/**\n * Logs `message` once via `console.error` when `condition` is true, in development builds only.\n * Use for a misuse that leaves the component genuinely broken (e.g. a required prop missing).\n */\nexport function devError(condition: boolean, message: string): void {\n if (!IS_DEV) return\n if (!condition || warned.has(message)) return\n warned.add(message)\n console.error(message)\n}\n","import { ElementType, isValidElement, ReactElement, ReactNode } from 'react'\n\nimport { devWarning } from './devWarning'\nimport { resolveLazy } from './lazyElement'\n\n// What a polymorphic component ends up rendering, as far as its own semantics care:\n//\n// - `anchor`, `button`, `input`: the native element, which the component gives its full handling\n// (a real `disabled` attribute, or `aria-disabled`/`tabIndex`/a click guard on an anchor).\n// - `host`: any other HTML tag, which has no semantics of its own to rely on.\n// - `component`: a component reference, trusted to handle its own semantics.\n//\n// A render function asks `resolveElementKind(Component)` instead of comparing `Component` to a tag\n// name, because under `asChild` `Component` is a `Slot` (see `./slot`), not the tag the caller's\n// child element renders. The `Slot` carries that element's kind and tag.\nexport type ElementKind = 'anchor' | 'button' | 'input' | 'host' | 'component'\n\nfunction kindOfTag(tag: string): ElementKind {\n switch (tag) {\n case 'a':\n return 'anchor'\n case 'button':\n return 'button'\n case 'input':\n return 'input'\n default:\n return 'host'\n }\n}\n\ntype SlotLike = { slotKind?: ElementKind; slotTag?: string }\n\nexport function resolveElementKind(component: ElementType): ElementKind {\n if (typeof component === 'string') return kindOfTag(component)\n return (component as SlotLike).slotKind ?? 'component'\n}\n\n// The HTML tag that gets rendered, for a render function whose markup depends on a tag that has\n// no kind of its own (`List` renders `<li>` items only inside a `<ul>`/`<ol>`). `undefined` for a\n// component, whose output isn't known.\nexport function resolveElementTag(component: ElementType): string | undefined {\n return typeof component === 'string' ? component : (component as SlotLike).slotTag\n}\n\n// The kind of what a component renders, given the props it renders it with. A component reference\n// with a link target (`<Link href=\"/login\">` of Next.js, `<Link to=\"/login\">` of React Router)\n// counts as an anchor: router links render an `<a>` and forward what they're given to it, so they\n// need the anchor's disabled handling (`aria-disabled`, `tabindex=\"-1\"`, a blocked click), not a\n// `disabled` attribute passed through. This holds for the link passed as `component` and for the\n// one handed to `asChild` alike. `props` is where `to` is found: a component's remaining props.\nexport function resolveLinkKind(\n component: ElementType,\n href: unknown,\n props?: Record<string, unknown> | object\n): ElementKind {\n const kind = resolveElementKind(component)\n if (kind !== 'component') return kind\n const to = (props as { to?: unknown } | undefined)?.to\n return href != null || to != null ? 'anchor' : kind\n}\n\n// The kind of the element a caller handed to `asChild`.\nexport function resolveSlottedKind(element: ReactElement<Record<string, unknown>>): ElementKind {\n return resolveLinkKind(element.type as ElementType, element.props.href, element.props)\n}\n\n// The same question asked from outside, by a parent reading a child's props (`List` deciding its\n// own tag from its `ListItem`s). `undefined` when the child chose nothing and renders its default.\nexport function resolveKindFromProps(props: {\n asChild?: boolean\n children?: ReactNode\n component?: ElementType\n href?: string\n to?: unknown\n}): ElementKind | undefined {\n const child = props.asChild ? resolveLazy(props.children) : undefined\n if (isValidElement<Record<string, unknown>>(child)) return resolveSlottedKind(child)\n if (props.component !== undefined) return resolveLinkKind(props.component, props.href, props)\n return hasHref(props.href) ? 'anchor' : undefined\n}\n\n// One rule for `href`, followed by every component that accepts one:\n//\n// - The element is `component`, or the `asChild` element, when one is given. Otherwise `href` makes\n// it an `<a>`, and without `href` the component renders its own default (`linkElement`).\n// - `href` reaches the rendered element only when that element can take it: an `<a>`, or a\n// component reference, which is trusted to take it (a router link does). A `<button>`, an `<li>`\n// or any other tag never gets one, and in development the component says so (`hrefProps`).\n// - A component reference given `href` or `to` is a link, and is handled as an anchor\n// (`resolveLinkKind`).\n//\n// An empty string is set: `href=\"\"` is a link to the current document.\nexport const hasHref = (href: string | null | undefined): href is string => href != null\n\nexport function linkElement(\n component: ElementType | undefined,\n href: string | undefined,\n fallback: ElementType\n): ElementType {\n return component ?? (hasHref(href) ? 'a' : fallback)\n}\n\nexport function hrefProps(\n kind: ElementKind,\n href: string | undefined,\n displayName: string\n): { href?: string } {\n if (!hasHref(href)) return {}\n if (kind === 'anchor' || kind === 'component') return { href }\n devWarning(\n true,\n `${displayName}: \\`href\\` was ignored, because the element it renders isn't a link. Leave ` +\n `out \\`component\\` to render an <a>, or pass a link as \\`component\\` or as the \\`asChild\\` ` +\n `element.`\n )\n return {}\n}\n\nexport const isInteractiveKind = (kind: ElementKind | undefined): boolean =>\n kind === 'anchor' || kind === 'button'\n","// An id-reference attribute (`aria-describedby`, `aria-labelledby`) from the ids that apply, or\n// `undefined` when none does, so the attribute is left out rather than written empty.\nexport const joinIds = (...ids: (string | false | null | undefined)[]): string | undefined =>\n ids.filter(Boolean).join(' ') || undefined\n\n// `value` without the given ids: for an id-reference attribute a react-aria hook built from ids\n// that may not be rendered, such as the description and error-message ids of its `useField`.\nexport const withoutIds = (\n value: string | undefined,\n ...ids: (string | undefined)[]\n): string | undefined => joinIds(...(value?.split(' ') ?? []).filter((id) => !ids.includes(id)))\n\n// `props` with the ids of react-aria's description and error-message slots taken out of its\n// `aria-describedby`. `useField` always writes both into the server's HTML and drops each only\n// after hydration, once it finds no element with that id: this library renders its own help and\n// feedback under other ids. See FORMS.md, gotcha 6.\nexport const withoutSlotIds = <P extends { 'aria-describedby'?: string }>(\n props: P,\n ...slots: { id?: string }[]\n): P => ({\n ...props,\n 'aria-describedby': withoutIds(props['aria-describedby'], ...slots.map((slot) => slot.id))\n})\n","import React, {\n cloneElement,\n createContext,\n forwardRef,\n Fragment,\n isValidElement,\n ReactElement,\n ReactNode,\n Ref,\n useContext\n} from 'react'\nimport { mergeProps } from 'react-aria'\n\nimport { useForkedRef } from '../hooks/useForkedRef'\nimport { devWarning } from './devWarning'\nimport { ElementKind, resolveSlottedKind } from './elementKind'\nimport { joinIds } from './idRefs'\nimport { resolveLazy } from './lazyElement'\n\n// Backs the `asChild` prop every polymorphic component accepts (see `createPolymorphicComponent`).\n// The component renders a `Slot` as its `component`; the `Slot` then renders the caller's child\n// element in its place, with the props the component computed (className, handlers, ARIA\n// attributes, ref) merged onto it.\n//\n// There is one `Slot` per tag, and two for component elements (a link, anything else), and the\n// component gets the one that matches the child. A render function reads the child's kind and\n// tag back with `resolveElementKind(Component)`/`resolveElementTag(Component)` (see\n// `./elementKind`) and gives a slotted `<a>` the handling it gives `component=\"a\"`. Both travel\n// on the component rather than in a prop, so nothing extra can reach the DOM.\n//\n// The child element travels through context rather than a prop because a render function spreads\n// its `rest` props onto `component` in its own way (some filter them, some don't forward every\n// one) — context reaches `Slot` no matter how the render function wires it up. `Slot` resets the\n// context for its own subtree, so a polymorphic component nested *inside* the child doesn't pick\n// up the outer one's element.\ntype SlotElement = ReactElement<Record<string, unknown>>\n\nconst SlotContext = createContext<SlotElement | null>(null)\n\nexport const SlotProvider = SlotContext.Provider\n\n// The element `asChild` handed to the nearest polymorphic component, for a component rendered\n// beside its `Slot`. A render function can't read it: it runs above the provider.\nexport const useSlotElement = (): SlotElement | null => useContext(SlotContext)\n\n// The ref the caller put on an element. React 19 made `ref` an ordinary prop, and warns on\n// reading `element.ref`.\nexport function getElementRef<T = unknown>(element: ReactElement): Ref<T> | undefined {\n return (element.props as { ref?: Ref<T> }).ref\n}\n\n// `Record` rather than a declared prop list: `Slot` forwards whatever the render function hands it.\ntype SlotProps = Record<string, unknown>\n\nfunction createSlot(slotKind: ElementKind, slotTag: string | undefined) {\n const Slot = forwardRef<unknown, SlotProps>(function Slot({ children, ...slotProps }, ref) {\n const element = useContext(SlotContext)\n const forkedRef = useForkedRef(ref, element ? getElementRef(element) : undefined)\n if (!element) return null\n\n // react-aria's `mergeProps`: the child's own props win over the component's, except that\n // classNames concatenate, event handlers chain (the component's first), and ids merge.\n // Descriptions add up too: a child's own `aria-describedby` keeps the component's (a\n // `Tooltip`'s) rather than replacing it.\n const props: Record<string, unknown> = { ...mergeProps(slotProps, element.props) }\n // Written only when there is one: a key set to `undefined` would replace a description the\n // child's own component writes before spreading its props.\n const describedBy = joinIds(\n slotProps['aria-describedby'] as string | undefined,\n element.props['aria-describedby'] as string | undefined\n )\n if (describedBy) props['aria-describedby'] = describedBy\n else delete props['aria-describedby']\n // The child's own name wins too. `aria-labelledby` outranks `aria-label` when an element is\n // named, so the component's (a `Divider`'s label) would replace the name the child was given.\n if (element.props['aria-label'] != null && element.props['aria-labelledby'] == null) {\n delete props['aria-labelledby']\n }\n // A component marks an element that has no `disabled` attribute (an `<a>`, a `<div>`) with\n // `aria-disabled`, and blocks its click itself. The child's own `onClick` would still run\n // from the chain, so the component's handler replaces it: a disabled element doesn't act on\n // a click.\n if (slotProps['aria-disabled'] === true) props.onClick = slotProps.onClick\n\n return (\n <SlotContext.Provider value={null}>\n {cloneElement(element, { ...props, ref: forkedRef }, children as ReactNode)}\n </SlotContext.Provider>\n )\n })\n return Object.assign(Slot, { slotKind, slotTag })\n}\n\n// Created on first use and kept: a `Slot` has to be the same component on every render, or React\n// would remount the child. Keyed by tag, or by kind for a component element (a tag can't start\n// with a colon).\nconst slots = new Map<string, ReturnType<typeof createSlot>>()\n\n// The `Slot` a component renders for this child element.\nexport function getSlot(element: SlotElement) {\n const kind = resolveSlottedKind(element)\n const tag = typeof element.type === 'string' ? element.type : undefined\n const key = tag ?? `:${kind}`\n let slot = slots.get(key)\n if (!slot) {\n slot = createSlot(kind, tag)\n slots.set(key, slot)\n }\n return slot\n}\n\n// The `Slot` `renderSlotted` renders. One for every element: the trigger of a `Tooltip` has no\n// kind for a render function to read, and a `Slot` chosen by kind would change, remounting the\n// caller's trigger, when its `href` came or went.\nconst TriggerSlot = createSlot('component', undefined)\n\n// Renders an element the component doesn't own, such as the trigger of a `Tooltip` or a\n// `Popover`, the way `asChild` renders a child: with the component's `props` merged into the\n// element's own and `ref` forked with the element's ref. `owned` holds the attributes that state\n// the component's own condition (a `Popover` trigger's `aria-expanded` and `aria-controls`): they\n// win over the element's, which the merge would otherwise let win.\nexport function renderSlotted(\n element: SlotElement,\n props: object,\n ref: Ref<unknown>,\n owned: Record<string, unknown> = {}\n): ReactElement {\n const defined = Object.entries(owned).filter(([, value]) => value !== undefined)\n const slotted = defined.length ? cloneElement(element, Object.fromEntries(defined)) : element\n return (\n <SlotProvider value={slotted}>\n <TriggerSlot {...props} ref={ref}>\n {element.props.children as ReactNode}\n </TriggerSlot>\n </SlotProvider>\n )\n}\n\n// Whether a render function's `component` is a `Slot`, that is, whether it renders under `asChild`.\nexport const isSlot = (component: unknown): boolean =>\n typeof (component as { slotKind?: ElementKind } | null)?.slotKind === 'string'\n\n// The single element in `children`, or `null` when it isn't exactly one (text, a fragment,\n// several elements).\n//\n// A Server Component's child can arrive as a lazy node (#37, see `./lazyElement`): it is resolved\n// first, which suspends this component while the child is still loading.\nfunction getSingleElement(children: ReactNode): SlotElement | null {\n const child = resolveLazy(children)\n return isValidElement<Record<string, unknown>>(child) && child.type !== Fragment ? child : null\n}\n\n// The single element `asChild` renders in place of the component's own element, or `null` (with\n// a dev warning) when `children` isn't exactly one — the component then falls back to rendering\n// its default element, so a misuse degrades to a working, if unstyled-as-intended, UI.\nexport function getSlotChild(children: ReactNode, displayName: string): SlotElement | null {\n const child = getSingleElement(children)\n devWarning(\n !child,\n `${displayName}: \\`asChild\\` expects exactly one React element as its child (not text, a ` +\n `fragment, or several elements); rendering the default element instead.`\n )\n return child\n}\n\n// The trigger of a `Tooltip` or `Popover`, rendered with `renderSlotted`, or `null` (with a dev\n// warning) when `children` isn't exactly one element. The component then renders `children` as\n// they are, with nothing to open it.\nexport function getTriggerChild(children: ReactNode, displayName: string): SlotElement | null {\n const child = getSingleElement(children)\n devWarning(\n !child,\n `${displayName}: expects exactly one React element as its trigger (not text, a fragment, ` +\n `or several elements); rendering the children with nothing to open it.`\n )\n return child\n}\n"],"mappings":"kQAwBA,MAAM,EAAS,QAAQ,IAAI,WAAa,aAElC,EAAS,IAAI,IAenB,SAAgB,EAAW,EAAoB,EAAuB,CAC/D,GACA,GAAa,GAAO,IAAI,CAAO,IACpC,EAAO,IAAI,CAAO,EAClB,QAAQ,KAAK,CAAO,EACtB,CAMA,SAAgB,EAAS,EAAoB,EAAuB,CAC7D,GACA,GAAa,GAAO,IAAI,CAAO,IACpC,EAAO,IAAI,CAAO,EAClB,QAAQ,MAAM,CAAO,EACvB,CCxCA,SAAS,EAAU,EAA0B,CAC3C,OAAQ,EAAR,CACE,IAAK,IACH,MAAO,SACT,IAAK,SACH,MAAO,SACT,IAAK,QACH,MAAO,QACT,QACE,MAAO,MACX,CACF,CAIA,SAAgB,E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AM,EAAc,EAAW,YAAa,IAAA,EAAS,EAOrD,SAAgB,EACd,EACA,EACA,EACA,EAAiC,CAAC,EACpB,CACd,IAAM,EAAU,OAAO,QAAQ,CAAK,CAAC,CAAC,QAAQ,EAAG,KAAW,IAAU,IAAA,EAAS,EACzE,EAAU,EAAQ,OAAS,EAAa,EAAS,OAAO,YAAY,CAAO,CAAC,EAAI,EACtF,OACE,EAAA,cAAC,EAAD,CAAc,MAAO,CAIP,EAHZ,EAAA,cAAC,EAAD,CAAa,GAAI,EAAY,KAEhB,EADV,EAAQ,MAAM,QACJ,CACD,CAElB,CAGA,MAAa,EAAU,GACrB,OAAQ,GAAiD,UAAa,SAOxE,SAAS,EAAiB,EAAyC,CACjE,IAAM,EAAQ,EAAY,CAAQ,EAClC,OAAO,EAAwC,CAAK,GAAK,EAAM,OAAS,EAAW,EAAQ,IAC7F,CAKA,SAAgB,EAAa,EAAqB,EAAyC,CACzF,IAAM,EAAQ,EAAiB,CAAQ,EAMvC,OALA,EACE,CAAC,EACD,GAAG,EAAY,iJAEjB,EACO,CACT,CAKA,SAAgB,EAAgB,EAAqB,EAAyC,CAC5F,IAAM,EAAQ,EAAiB,CAAQ,EAMvC,OALA,EACE,CAAC,EACD,GAAG,EAAY,gJAEjB,EACO,CACT"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
const e=(e,t,n=``)=>typeof t==`string`||typeof t==`number`?`${n}${e}-${t}`:null;export{e as t};
|
|
1
|
+
const e=(e,t,n=``)=>typeof t==`string`||typeof t==`number`?`${n}${e}-${t}`:null;export{e as t};
|
|
2
|
+
//# sourceMappingURL=spacingClassName-DVhk8m3P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spacingClassName-DVhk8m3P.js","names":[],"sources":["../../src/utils/spacingClassName.ts"],"sourcesContent":["import { Spacing } from '../types'\n\n// A spacing prop (`gap`/`rowGap`/`gutter`/...) is typed `Spacing | 0`, but `0` is meaningful\n// (chassis-css's `gap-0` etc. exist) while `undefined`/`false`-ish values mean \"not set\" — a\n// plain truthy check would drop `0`, so every caller needs this same `typeof` guard instead.\n// Shared by `Flex`, `Stack`, `Row`, and `CardBody`'s own `layoutClassNames`/`_className` builders,\n// which otherwise duplicated it once per spacing prop (`gap`, `rowGap`, `columnGap`, `gutter`,\n// `gutterX`, `gutterY`, ...).\nexport const spacingClassName = (\n base: string,\n value: Spacing | 0 | undefined,\n prefix = ''\n): string | null =>\n typeof value === 'string' || typeof value === 'number' ? `${prefix}${base}-${value}` : null\n"],"mappings":"AAQA,MAAa,GACX,EACA,EACA,EAAS,KAET,OAAO,GAAU,UAAY,OAAO,GAAU,SAAW,GAAG,IAAS,EAAK,GAAG,IAAU"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./VisuallyHidden-C2dM7HhC.js";import n from"react";import r from"classnames";function i({className:e,color:i,component:a,size:o,variant:s=`border`,visuallyHiddenLabel:c=`Loading...`,...l},u){let d=a??`div`,f=r(`spinner-${s}`,i?`fg-${i}`:null,o&&`spinner-${s}-${o}`,e);return n.createElement(d,{className:f,role:`status`,...l,ref:u},n.createElement(t,null,c))}const a=e(i,`Spinner`);export{a as t};
|
|
2
|
+
//# sourceMappingURL=spinner-DblhvrHL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner-DblhvrHL.js","names":[],"sources":["../../src/components/spinner/Spinner.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { ContextColor } from '../../types'\nimport { VisuallyHidden } from '../visually-hidden/VisuallyHidden'\n\ntype SpinnerOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Size the component sm.\n */\n size?: 'sm'\n /**\n * Set the button variant to an outlined button or a ghost button.\n */\n variant?: 'border' | 'grow'\n /**\n * Set visually hidden label for accessibility purposes.\n */\n visuallyHiddenLabel?: string\n}\n\nexport type SpinnerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n SpinnerOwnProps<C>\n>\n\ntype SpinnerComponent = (<C extends ElementType = 'div'>(\n props: SpinnerProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction SpinnerRender<C extends ElementType = 'div'>(\n {\n className,\n color,\n component,\n size,\n variant = 'border',\n visuallyHiddenLabel = 'Loading...',\n ...rest\n }: SpinnerProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n `spinner-${variant}`,\n color ? `fg-${color}` : null,\n size && `spinner-${variant}-${size}`,\n className\n )\n\n return (\n <Component className={_className} role=\"status\" {...rest} ref={ref}>\n <VisuallyHidden>{visuallyHiddenLabel}</VisuallyHidden>\n </Component>\n )\n}\n\nexport const Spinner = createPolymorphicComponent<SpinnerComponent>(\n SpinnerRender as ForwardRefRenderFunction<Element, SpinnerProps<ElementType>>,\n 'Spinner'\n)\n"],"mappings":"0KA+CA,SAAS,EACP,CACE,YACA,QACA,YACA,OACA,UAAU,SACV,sBAAsB,aACtB,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,WAAW,IACX,EAAQ,MAAM,IAAU,KACxB,GAAQ,WAAW,EAAQ,GAAG,IAC9B,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,KAAK,SAAS,GAAI,EAAW,KAEpD,EADT,EAAA,cAAC,EAAA,KAAgB,CAAoC,CAC5C,CAEf,CAEA,MAAa,EAAU,EACrB,EACA,SACF"}
|
|
@@ -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"./breakpoints-o_2Ev7ir.js";import{t as n}from"./spacingClassName-DVhk8m3P.js";import r from"react";import i from"classnames";const a=(e,t)=>[`${t}${e===`vertical`?`vstack`:`hstack`}`];function o({children:e,className:o,component:s,direction:c=`horizontal`,gap:l,responsive:u,...d},f){let p=s??`div`,m=i(t(a,c,u),n(`gap`,l),o);return r.createElement(p,{className:m,...d,ref:f},e)}const s=e(o,`Stack`);export{s as t};
|
|
2
|
+
//# sourceMappingURL=stack-CsMiQbpq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack-CsMiQbpq.js","names":[],"sources":["../../src/components/stack/Stack.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { buildResponsiveClassNames } from '../../utils/breakpoints'\nimport { spacingClassName } from '../../utils/spacingClassName'\nimport { Breakpoint, Spacing } from '../../types'\n\nconst directionClassName = (direction: 'horizontal' | 'vertical', prefix: string) => [\n `${prefix}${direction === 'vertical' ? 'vstack' : 'hstack'}`\n]\n\ntype StackOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Lays children out in a row (`horizontal`, the default, maps to `.hstack`) or a column\n * (`vertical`, maps to `.vstack`).\n */\n direction?: 'horizontal' | 'vertical'\n /**\n * Spacing between children, mapped to the `gap-*` utility classes.\n */\n gap?: Spacing | 0\n /**\n * Switches `direction` at one or more breakpoints via container queries. Requires a\n * `.contains-inline` ancestor (not applied by `Stack` itself — see the docs) to establish the\n * container context these queries evaluate against.\n */\n responsive?: Partial<Record<Breakpoint, 'horizontal' | 'vertical'>>\n}\n\nexport type StackProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n StackOwnProps<C>\n>\n\ntype StackComponent = (<C extends ElementType = 'div'>(\n props: StackProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction StackRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n component,\n direction = 'horizontal',\n gap,\n responsive,\n ...rest\n }: StackProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n buildResponsiveClassNames(directionClassName, direction, responsive),\n spacingClassName('gap', gap),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Stack = createPolymorphicComponent<StackComponent>(\n StackRender as ForwardRefRenderFunction<Element, StackProps<ElementType>>,\n 'Stack'\n)\n"],"mappings":"0NAYA,MAAM,GAAsB,EAAsC,IAAmB,CACnF,GAAG,IAAS,IAAc,WAAa,SAAW,UACpD,EAqCA,SAAS,EACP,CACE,WACA,YACA,YACA,YAAY,aACZ,MACA,aACA,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,EAA0B,EAAoB,EAAW,CAAU,EACnE,EAAiB,MAAO,CAAG,EAC3B,CACF,EAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAQ,EACnB,EACA,OACF"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{n as e,t}from"./tableClassName-CZA2Bse8.js";import n,{forwardRef as r}from"react";const i=r(({align:r,bordered:i,borderless:a,caption:o,children:s,className:c,color:l,hover:u,responsive:d,sm:f,stacked:p,striped:m,...h},g)=>{let _=n.createElement(`table`,{...h,className:t({align:r,bordered:i,borderless:a,className:c,color:l,hover:u,sm:f,stacked:p,striped:m}),ref:g},o&&n.createElement(`caption`,null,o),s),v=e({responsive:d,stacked:p});return v?n.createElement(`div`,{className:v},_):_});i.displayName=`StaticTable`;export{i as t};
|
|
1
|
+
import{n as e,t}from"./tableClassName-CZA2Bse8.js";import n,{forwardRef as r}from"react";const i=r(({align:r,bordered:i,borderless:a,caption:o,children:s,className:c,color:l,hover:u,responsive:d,sm:f,stacked:p,striped:m,...h},g)=>{let _=n.createElement(`table`,{...h,className:t({align:r,bordered:i,borderless:a,className:c,color:l,hover:u,sm:f,stacked:p,striped:m}),ref:g},o&&n.createElement(`caption`,null,o),s),v=e({responsive:d,stacked:p});return v?n.createElement(`div`,{className:v},_):_});i.displayName=`StaticTable`;export{i as t};
|
|
2
|
+
//# sourceMappingURL=static-table-D0M4oc_t.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-table-D0M4oc_t.js","names":[],"sources":["../../src/components/static-table/StaticTable.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, TableHTMLAttributes } from 'react'\n\nimport { TableStyleProps, tableClassName, tableWrapperClassName } from '../../utils/tableClassName'\n\nexport interface StaticTableProps\n extends TableStyleProps, Omit<TableHTMLAttributes<HTMLTableElement>, 'align' | 'color'> {\n /**\n * Content shown above the table, functioning as a heading for it.\n */\n caption?: ReactNode\n /**\n * The table's own markup — plain `<thead>`/`<tbody>`/`<tfoot>`/`<tr>`/`<th>`/`<td>` elements,\n * rendered as-is.\n */\n children?: ReactNode\n /**\n * Convert rows into stacked label/value blocks below a container width, for tables with too\n * many columns to read comfortably even with horizontal scrolling. `true` always stacks; a\n * breakpoint name stacks only below it. Implies `responsive` when `responsive` isn't set\n * separately. Unlike `Table`, which derives each cell's label from its column header, a static\n * table has no collection to read labels from — give each `<td>` a `data-cell` attribute with\n * the label to show before its value.\n */\n stacked?: TableStyleProps['stacked']\n}\n\n// A plain, server-renderable `<table>` with `Table`'s styling props and none of its behavior — no\n// sorting, selection, or keyboard grid navigation, and no hooks, so it needs no client JavaScript\n// at all. Imported from `@chassis-ui/react/static-table`, whose entry deliberately has no\n// `'use client'` directive (see `RSC.md`). `forwardRef` is fine here: React Server Components\n// render forwardRef components like any other function component (a ref just can't be passed\n// from the server side).\nexport const StaticTable = forwardRef<HTMLTableElement, StaticTableProps>(\n (\n {\n align,\n bordered,\n borderless,\n caption,\n children,\n className,\n color,\n hover,\n responsive,\n sm,\n stacked,\n striped,\n ...rest\n },\n ref\n ) => {\n const table = (\n <table\n {...rest}\n className={tableClassName({\n align,\n bordered,\n borderless,\n className,\n color,\n hover,\n sm,\n stacked,\n striped\n })}\n ref={ref}\n >\n {caption && <caption>{caption}</caption>}\n {children}\n </table>\n )\n\n const wrapperClassName = tableWrapperClassName({ responsive, stacked })\n return wrapperClassName ? <div className={wrapperClassName}>{table}</div> : table\n }\n)\n\nStaticTable.displayName = 'StaticTable'\n"],"mappings":"yFAgCA,MAAa,EAAc,GAEvB,CACE,QACA,WACA,aACA,UACA,WACA,YACA,QACA,QACA,aACA,KACA,UACA,UACA,GAAG,GAEL,IACG,CACH,IAAM,EACJ,EAAA,cAAC,QAAD,CACE,GAAI,EACJ,UAAW,EAAe,CACxB,QACA,WACA,aACA,YACA,QACA,QACA,KACA,UACA,SACF,CAAC,EACI,KAIA,EAFJ,GAAW,EAAA,cAAC,UAAA,KAAS,CAAiB,EACtC,CACI,EAGH,EAAmB,EAAsB,CAAE,aAAY,SAAQ,CAAC,EACtE,OAAO,EAAmB,EAAA,cAAC,MAAD,CAAK,UAAW,CAA8B,EAAX,CAAW,EAAI,CAC9E,CACF,EAEA,EAAY,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{d as e,f as t,g as n,h as r,m as i,p as a,u as o}from"./slot-CNhFZdHF.js";import{t as s}from"./lazyElement-tfMG21pZ.js";import{t as c}from"./polymorphic-BhGNZQja.js";import l,{Children as u}from"react";import d from"classnames";function f({active:t,children:r,className:i,color:o,component:s,href:c,...u},f){let p=a(s,c,`li`),m=d(`stepper-item`,o&&`context`,o,{active:t},i),h={...e(n(p,c,u),c,`StepperItem`),...t?{"aria-current":`step`}:{},...u};return l.createElement(p,{className:m,...h,ref:f},r)}const p=c(f,`StepperItem`);function m({children:e,className:n,component:a,color:c,icon:f,items:m,layout:h,overflow:g,..._},v){let y=m?m.some(e=>o(e.href)):u.toArray(e).some(e=>s(e,p)&&t(r(e.props))),b=a??(y?`div`:`ol`),x=i(b),S=x===`ol`||x===`ul`,C=d(`stepper`,c&&`context`,c,h,{"icon-stepper":f},n),w=(m?m.map((e,t)=>l.createElement(p,{key:t,active:e.active,color:e.color,component:o(e.href)||S?void 0:`div`,href:e.href},e.label)):null)??(S?e:u.map(e,e=>s(e,p)&&r(e.props)===void 0?l.cloneElement(e,{component:`div`}):e)),T=l.createElement(b,{className:C,..._,ref:v},w);return g?l.createElement(`div`,{className:`stepper-overflow`},T):T}const h=c(m,`Stepper`);export{p as n,h as t};
|
|
2
|
+
//# sourceMappingURL=stepper-CVXMJ2yg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper-CVXMJ2yg.js","names":[],"sources":["../../src/components/stepper/StepperItem.tsx","../../src/components/stepper/Stepper.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype StepperItemOwnProps<C extends ElementType> = {\n /**\n * Marks the item as the current step.\n */\n active?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * The `href` attribute for an interactive step rendered as a link. Renders an `<a>` in place of\n * the `<li>`, unless `component` or `asChild` chose the element. Inside a `Stepper`, the stepper\n * renders a `<div>` around it in place of the `<ol>`.\n */\n href?: string\n}\n\nexport type StepperItemProps<C extends ElementType = 'li'> = PolymorphicComponentProps<\n C,\n StepperItemOwnProps<C>\n>\n\ntype StepperItemComponent = (<C extends ElementType = 'li'>(\n props: StepperItemProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLLIElement | HTMLAnchorElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction StepperItemRender<C extends ElementType = 'li'>(\n { active, children, className, color, component, href, ...rest }: StepperItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n // `href` makes it an `<a>`, unless `component` or `asChild` chose the element (see\n // `linkElement`). It used to stay an `<li>` and carry `href` as an attribute.\n const Component = linkElement(component, href, 'li')\n const _className = classNames('stepper-item', color && 'context', color, { active }, className)\n\n const mergedProps = {\n ...hrefProps(resolveLinkKind(Component, href, rest), href, 'StepperItem'),\n ...(active ? { 'aria-current': 'step' } : {}),\n ...rest\n }\n\n return (\n <Component className={_className} {...mergedProps} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const StepperItem = createPolymorphicComponent<StepperItemComponent>(\n StepperItemRender as ForwardRefRenderFunction<Element, StepperItemProps<ElementType>>,\n 'StepperItem'\n)\n","import React, {\n Children,\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode\n} from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport {\n hasHref,\n isInteractiveKind,\n resolveElementTag,\n resolveKindFromProps\n} from '../../utils/elementKind'\nimport { isElementOfType } from '../../utils/lazyElement'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { StepperItem } from './StepperItem'\n\nexport interface StepperItemDef {\n /**\n * Step label content.\n */\n label: React.ReactNode\n /**\n * Marks the item as the current step.\n */\n active?: boolean\n /**\n * Sets the color of the item.\n */\n color?: ContextColor\n /**\n * Renders the item as a link to the given URL.\n */\n href?: string\n}\n\ntype StepperOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `'ol'`, unless a step (a data-driven item with `href`, or a `<StepperItem>` child\n * rendering an `<a>`/`<button>` through `component` or `asChild`) is interactive — a bare `<a>`/\n * `<button>` isn't a valid direct child of `<ol>`, so the default switches to `'div'` instead.\n * Pass `component` explicitly to opt out of this.\n */\n component?: C\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Replaces the step counters with icons, driven by the `--status-icon` custom property.\n */\n icon?: boolean\n /**\n * Array of step definitions for data-driven rendering. When provided, children are ignored.\n */\n items?: StepperItemDef[]\n /**\n * Lays out steps side-by-side instead of stacking them vertically, either unconditionally or\n * from a given breakpoint up.\n */\n layout?:\n | 'horizontal'\n | 'sm:horizontal'\n | 'md:horizontal'\n | 'lg:horizontal'\n | 'xl:horizontal'\n | '2xl:horizontal'\n /**\n * Wraps the stepper in a horizontally scrollable container so steps keep their natural width\n * instead of shrinking to fit.\n */\n overflow?: boolean\n}\n\n// What `Stepper` reads off a `<StepperItem>` child to decide its own tag.\ntype StepperItemChildProps = {\n asChild?: boolean\n children?: ReactNode\n component?: ElementType\n href?: string\n}\n\nexport type StepperProps<C extends ElementType = 'ol'> = PolymorphicComponentProps<\n C,\n StepperOwnProps<C>\n>\n\ntype StepperComponent = (<C extends ElementType = 'ol'>(\n props: StepperProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction StepperRender<C extends ElementType = 'ol'>(\n {\n children,\n className,\n component,\n color,\n icon,\n items,\n layout,\n overflow,\n ...rest\n }: StepperProps<C>,\n ref: PolymorphicRef<C>\n) {\n // A linked step (data-driven `href`, or a `<StepperItem>` child rendering an `<a>`/`<button>`,\n // whether through `component` or as its `asChild` element) can't render as a bare\n // `<a>`/`<button>` inside the default `<ol>` root — only `<li>`/`script`/`template` are valid\n // children there. Default to `<div>` instead when that's the case (unless the caller already\n // chose their own `component`) — matching the `<Stepper component=\"div\">` pattern already\n // documented for composed interactive usage.\n const hasInteractiveItem = items\n ? items.some((item) => hasHref(item.href))\n : Children.toArray(children).some(\n (child) =>\n isElementOfType<StepperItemChildProps>(child, StepperItem) &&\n isInteractiveKind(resolveKindFromProps(child.props))\n )\n const Component = (component ?? (hasInteractiveItem ? 'div' : 'ol')) as ElementType\n // The tag rather than `Component`, which under `asChild` is a `Slot` holding the caller's\n // `<ol>`/`<ul>`.\n const rootTag = resolveElementTag(Component)\n const isListSemantic = rootTag === 'ol' || rootTag === 'ul'\n\n const _className = classNames(\n 'stepper',\n color && 'context',\n color,\n layout,\n { 'icon-stepper': icon },\n className\n )\n\n const autoContent = items\n ? items.map((item, idx) => (\n <StepperItem\n // eslint-disable-next-line react/no-array-index-key\n key={idx}\n active={item.active}\n color={item.color}\n // Left out with `href`, so the step renders its `<a>`.\n component={hasHref(item.href) || isListSemantic ? undefined : 'div'}\n href={item.href}\n >\n {item.label}\n </StepperItem>\n ))\n : null\n\n // When the root switched to `div` because of an interactive step, every plain `<StepperItem>`\n // sibling defaulting to `<li>` would be just as invalid (only valid inside `<ul>`/`<ol>`/\n // `<menu>`) — so give each `StepperItem` child the same `div` treatment the auto-generated\n // steps above already get, unless it chose its own element: `component`, `href` or its `asChild`\n // element. Other child types are left untouched — this is only meaningful for `Stepper`'s own\n // steps.\n const renderedChildren =\n autoContent ??\n (isListSemantic\n ? children\n : Children.map(children, (child) =>\n isElementOfType<StepperItemChildProps>(child, StepperItem) &&\n resolveKindFromProps(child.props) === undefined\n ? React.cloneElement(child, { component: 'div' })\n : child\n ))\n\n const stepperEl = (\n <Component className={_className} {...rest} ref={ref}>\n {renderedChildren}\n </Component>\n )\n\n if (!overflow) return stepperEl\n\n return <div className=\"stepper-overflow\">{stepperEl}</div>\n}\n\nexport const Stepper = createPolymorphicComponent<StepperComponent>(\n StepperRender as ForwardRefRenderFunction<Element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AClC,EAAM,aAAa,EAAO,CAAE,UAAW,KAAM,CAAC,EAC9C,CACN,GAEA,EACJ,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,EAKb,OAFK,EAEE,EAAA,cAAC,MAAD,CAAK,UAAU,kBAAmC,EAAf,CAAe,EAFnC,CAGxB,CAEA,MAAa,EAAU,EACrB,EACA,SACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useForkedRef-DVEfT-KI.js";import{t}from"./FormLabel-CYcQiFUI.js";import{t as n}from"./validationClassName-gRGs4KBm.js";import{n as r,r as i}from"./unhandledProps-9Kdj7WVf.js";import a,{forwardRef as o,useRef as s}from"react";import c from"classnames";import{useSwitch as l}from"react-aria";import{useToggleState as u}from"react-stately";const d=({checkInputClassName:e,className:n,input:r,label:i,style:o})=>i?a.createElement(t,{customClassName:n,style:o},a.createElement(`span`,{className:e},r),i):a.createElement(`span`,{className:e,style:o},r),f=({className:e,color:t,forkedRef:r,id:i,inputProps:o,invalid:s,label:l,size:u,style:f,valid:p})=>{let m=c(n(s,p)),h=c(`check-input`,t,n(s,p)),g=c(`form-check form-switch`,u,n(s,p),e);return d({checkInputClassName:h,className:g,input:a.createElement(`input`,{...o,className:m,id:i,ref:r}),label:l,style:f})},p=o(({className:t,children:n,color:a,defaultSelected:o,disabled:c,id:d,invalid:p,isSelected:m,label:h,onChange:g,size:_,style:v,valid:y,...b},x)=>{let S=s(null),C=e(x,S),w=h??n,T=u({defaultSelected:o,isDisabled:c,isSelected:m,onChange:g}),{inputProps:E}=l({...b,children:w,isDisabled:c,isInvalid:p,value:b.value},T,S);return f({className:t,color:a,forkedRef:C,id:d,inputProps:{...i(E,b,r),"aria-describedby":b[`aria-describedby`]},invalid:p,label:w,size:_,style:v,valid:y})});p.displayName=`SwitchCheckbox`;const m=o(({children:t,className:n,color:r,defaultSelected:i,disabled:a,id:o,invalid:c,isSelected:l,label:u,onChange:d,size:p,style:m,valid:h,...g},_)=>{let v=s(null),y=e(_,v),b=u??t,x={...g,"aria-invalid":c,checked:l,defaultChecked:i,disabled:a,onChange:d?e=>d(e.target.checked):void 0,role:`switch`,type:`radio`};return f({className:n,color:r,forkedRef:y,id:o,inputProps:x,invalid:c,label:b,size:p,style:m,valid:h})});m.displayName=`SwitchRadio`;const h=o(({type:e=`checkbox`,...t},n)=>e===`radio`?a.createElement(m,{...t,ref:n}):a.createElement(p,{...t,ref:n}));h.displayName=`Switch`;export{h as t};
|
|
2
|
+
//# sourceMappingURL=switch-C6s3LxEv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-C6s3LxEv.js","names":[],"sources":["../../src/components/switch/Switch.tsx"],"sourcesContent":["import React, { CSSProperties, forwardRef, InputHTMLAttributes, ReactNode, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaSwitchProps, useSwitch } from 'react-aria'\nimport { useToggleState } from 'react-stately'\n\nimport { useForkedRef } from '../../hooks'\nimport { ContextColor } from '../../types'\nimport { mergeUnhandledProps, TOGGLE_PROPS } from '../../utils/unhandledProps'\nimport { validationClassName } from '../../utils/validationClassName'\n\nimport { FormLabel } from '../form/FormLabel'\n\nexport interface SwitchProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'checked' | 'defaultChecked' | 'onChange' | 'size'\n> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the switch indicator to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Whether the switch is selected, uncontrolled.\n */\n defaultSelected?: boolean\n /**\n * The id global attribute defines an identifier (ID) that must be unique in the whole document.\n */\n id?: string\n /**\n * Set component validation state to invalid.\n */\n invalid?: boolean\n /**\n * Whether the switch is selected, controlled.\n */\n isSelected?: boolean\n /**\n * The element represents a caption for a component.\n *\n * Children are accepted as an alias for this prop — `label` wins when both are given.\n * react-aria, which backs this component, calls the same thing `children`; this package renames\n * it to `label`, and honouring both means the shape React developers reach for first still\n * names the control instead of silently producing an unlabelled one.\n */\n label?: ReactNode\n /**\n * Callback fired when the selected state changes.\n */\n onChange?: (isSelected: boolean) => void\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Specifies the type of component.\n */\n type?: 'checkbox' | 'radio'\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n}\n\ntype SwitchVariantProps = Omit<SwitchProps, 'type'>\n\ninterface RenderSwitchOptions {\n checkInputClassName: string\n className: string\n input: ReactNode\n label?: ReactNode\n style?: CSSProperties\n}\n\n// Mirrors renderFormCheck's nested-label/bare-span shape — Switch inlines its own markup (see\n// FORMS.md) rather than sharing that helper directly, since `role=\"switch\"` placement didn't fit\n// it cleanly. Keep this in sync with renderFormCheck by eye if either changes.\nconst renderSwitch = ({\n checkInputClassName,\n className,\n input,\n label,\n style\n}: RenderSwitchOptions) => {\n if (!label) {\n return (\n <span className={checkInputClassName} style={style}>\n {input}\n </span>\n )\n }\n return (\n <FormLabel customClassName={className} style={style}>\n <span className={checkInputClassName}>{input}</span>\n {label}\n </FormLabel>\n )\n}\n\ninterface RenderSwitchInputOptions {\n className?: string\n color?: ContextColor\n forkedRef: React.Ref<HTMLInputElement>\n id?: string\n inputProps: InputHTMLAttributes<HTMLInputElement>\n invalid?: boolean\n label?: ReactNode\n size?: 'sm' | 'lg'\n style?: CSSProperties\n valid?: boolean\n}\n\n// Shared className-building/markup for `SwitchCheckbox`/`SwitchRadio` — the two variants only\n// differ in how `inputProps` gets built (a react-aria hook vs. a hand-wired radio), everything\n// after that is identical. `style` goes on the outermost element, as `className` does.\nconst renderSwitchInput = ({\n className,\n color,\n forkedRef,\n id,\n inputProps,\n invalid,\n label,\n size,\n style,\n valid\n}: RenderSwitchInputOptions) => {\n const inputClassName = classNames(validationClassName(invalid, valid))\n const checkInputClassName = classNames('check-input', color, validationClassName(invalid, valid))\n const _className = classNames(\n 'form-check form-switch',\n size,\n validationClassName(invalid, valid),\n className\n )\n\n return renderSwitch({\n checkInputClassName,\n className: _className,\n input: <input {...inputProps} className={inputClassName} id={id} ref={forkedRef} />,\n label,\n style\n })\n}\n\n// Checkbox-backed switch: a real toggle, so it goes through react-aria's useSwitch/useToggleState\n// like Checkbox does. Split into its own component (rather than branching inside one Switch on\n// `type`) so SwitchRadio below never has to call these hooks just to discard their result —\n// calling them unconditionally and ignoring the output risked react-aria's own dev-mode warnings\n// (e.g. its missing-accessible-name check) firing for state that was never actually rendered.\nconst SwitchCheckbox = forwardRef<HTMLInputElement, SwitchVariantProps>(\n (\n {\n className,\n children,\n color,\n defaultSelected,\n disabled,\n id,\n invalid,\n isSelected,\n label,\n onChange,\n size,\n style,\n valid,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n // `label` is this package's name for what react-aria calls `children`. Accept either, so the\n // shape React developers reach for first names the control instead of vanishing.\n const resolvedLabel = label ?? children\n\n const toggleState = useToggleState({\n defaultSelected,\n isDisabled: disabled,\n isSelected,\n onChange\n })\n\n const { inputProps: switchProps } = useSwitch(\n {\n ...rest,\n children: resolvedLabel,\n isDisabled: disabled,\n isInvalid: invalid,\n value: rest.value as string | undefined\n } as AriaSwitchProps,\n toggleState,\n inputRef\n )\n\n return renderSwitchInput({\n className,\n color,\n forkedRef,\n id,\n // `aria-describedby` over react-aria's own, which adds ids it never renders (FORMS.md,\n // gotcha 6).\n inputProps: {\n ...mergeUnhandledProps(switchProps, rest, TOGGLE_PROPS),\n 'aria-describedby': rest['aria-describedby']\n },\n invalid,\n label: resolvedLabel,\n size,\n style,\n valid\n })\n }\n)\nSwitchCheckbox.displayName = 'SwitchCheckbox'\n\n// Radio-backed switch: react-aria has no ungrouped radio hook (see Checkbox's own split for the\n// same reason), so this stays a native, hand-wired `<input type=\"radio\" role=\"switch\">` — no\n// react-aria hook to call here at all.\nconst SwitchRadio = forwardRef<HTMLInputElement, SwitchVariantProps>(\n (\n {\n children,\n className,\n color,\n defaultSelected,\n disabled,\n id,\n invalid,\n isSelected,\n label,\n onChange,\n size,\n style,\n valid,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n // `label` is this package's name for what react-aria calls `children`. Accept either, so the\n // shape React developers reach for first names the control instead of vanishing.\n const resolvedLabel = label ?? children\n\n const radioProps = {\n ...rest,\n 'aria-invalid': invalid,\n checked: isSelected,\n defaultChecked: defaultSelected,\n disabled,\n onChange: onChange\n ? (event: React.ChangeEvent<HTMLInputElement>) => onChange(event.target.checked)\n : undefined,\n role: 'switch' as const,\n type: 'radio' as const\n }\n\n return renderSwitchInput({\n className,\n color,\n forkedRef,\n id,\n inputProps: radioProps,\n invalid,\n label: resolvedLabel,\n size,\n style,\n valid\n })\n }\n)\nSwitchRadio.displayName = 'SwitchRadio'\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(\n ({ type = 'checkbox', ...rest }, ref) =>\n type === 'radio' ? <SwitchRadio {...rest} ref={ref} /> : <SwitchCheckbox {...rest} ref={ref} />\n)\n\nSwitch.displayName = 'Switch'\n"],"mappings":"uYAgFA,MAAM,GAAgB,CACpB,sBACA,YACA,QACA,QACA,WAEK,EAQH,EAAA,cAAC,EAAD,CAAW,gBAAiB,EAAkB,OAGnC,EAFT,EAAA,cAAC,OAAD,CAAM,UAAW,CAAkC,EAAZ,CAAY,EAClD,CACQ,EATT,EAAA,cAAC,OAAD,CAAM,UAAW,EAA4B,OAEvC,EADH,CACG,EA2BN,GAAqB,CACzB,YACA,QACA,YACA,KACA,aACA,UACA,QACA,OACA,QACA,WAC8B,CAC9B,IAAM,EAAiB,EAAW,EAAoB,EAAS,CAAK,CAAC,EAC/D,EAAsB,EAAW,cAAe,EAAO,EAAoB,EAAS,CAAK,CAAC,EAC1F,EAAa,EACjB,yBACA,EACA,EAAoB,EAAS,CAAK,EAClC,CACF,EAEA,OAAO,EAAa,CAClB,sBACA,U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,EAAW,KAAM,CAAA,EAAI,EAAA,cAAC,EAAD,CAAgB,GAAI,EAAW,KAAM,CAAA,CAClG,EAEA,EAAO,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,t as n}from"./tableClassName-CZA2Bse8.js";import r,{forwardRef as i,useRef as a}from"react";import o from"classnames";import{useCheckbox as s,useTable as c,useTableCell as l,useTableColumnHeader as u,useTableHeaderRow as d,useTableRow as f,useTableRowGroup as p,useTableSelectAllCheckbox as m,useTableSelectionCheckbox as h}from"react-aria";import{Cell as g,Column as _,Row as v,TableBody as y,TableHeader as b,useTableState as x,useToggleState as S}from"react-stately";const C=i(({align:i,bordered:o,borderless:s,caption:l,children:u,className:d,color:f,disabledKeys:p,footer:m,hover:h,id:g,onSelectionChange:_,onSortChange:v,responsive:y,selectedKeys:b,selectionMode:S=`none`,sm:C,sortDescriptor:j,stacked:M,striped:N,...P},F)=>{let I=x({children:u,disabledKeys:p,onSelectionChange:_,onSortChange:v,selectedKeys:b,selectionMode:S,showSelectionCheckboxes:S===`multiple`,sortDescriptor:j}),L=a(null),R=e(L,F),{gridProps:z}=c({"aria-label":P[`aria-label`],"aria-labelledby":P[`aria-labelledby`],id:g},I,L),B=n({align:i,bordered:o,borderless:s,className:d,color:f,hover:h,sm:C,stacked:M,striped:N}),V=r.createElement(`table`,{...z,"aria-describedby":z[`aria-describedby`]||void 0,className:B,ref:R},l&&r.createElement(`caption`,null,l),r.createElement(w,{className:u[0].props.className,type:`thead`},I.collection.headerRows.map(e=>r.createElement(T,{key:e.key,item:e,state:I},[...I.collection.getChildren?.(e.key)??[]].map(e=>e.props?.isSelectionCell?r.createElement(D,{key:e.key,column:e,state:I}):r.createElement(E,{key:e.key,column:e,state:I}))))),r.createElement(w,{className:u[1].props.className,type:`tbody`},[...I.collection.body.childNodes].map(e=>r.createElement(O,{key:e.key,item:e,state:I},[...I.collection.getChildren?.(e.key)??[]].map(e=>e.props?.isSelectionCell?r.createElement(A,{key:e.key,cell:e,state:I}):r.createElement(k,{key:e.key,cell:e,stacked:!!M,state:I}))))),m&&r.createElement(`tfoot`,null,m)),H=t({responsive:y,stacked:M});return H?r.createElement(`div`,{className:H},V):V});C.displayName=`Table`;const w=({className:e,type:t,children:n})=>{let{rowGroupProps:i}=p();return r.createElement(t,{...i,className:e||void 0},n)},T=({children:e,item:t,state:n})=>{let i=a(null),{rowProps:o}=d({node:t},n,i);return r.createElement(`tr`,{...o,ref:i},e)},E=({column:e,state:t})=>{let n=a(null),{columnHeaderProps:i}=u({node:e},t,n),o=t.sortDescriptor?.column===e.key,s=t.sortDescriptor?.direction===`ascending`?`▲`:`▼`;return r.createElement(`th`,{...i,className:e.props?.className||void 0,colSpan:e.colSpan??void 0,scope:`col`,ref:n},e.rendered,e.props?.allowsSorting&&r.createElement(`span`,{"aria-hidden":`true`,className:`table-sort-icon`},o?s:`⇅`))},D=({column:e,state:t})=>{let n=a(null),{columnHeaderProps:i}=u({node:e},t,n),{checkboxProps:o}=m(t);return r.createElement(`th`,{...i,className:`table-selection-cell`,scope:`col`,suppressHydrationWarning:!0,ref:n},r.createElement(j,{checkboxProps:o}))},O=({children:e,item:t,state:n})=>{let i=a(null),{rowProps:s}=f({node:t},n,i),c=n.selectionManager.isSelected(t.key);return r.createElement(`tr`,{...s,className:o({active:c},t.props?.className),ref:i},e)},k=({cell:e,stacked:t,state:n})=>{let i=a(null),{gridCellProps:o}=l({node:e},n,i);return r.createElement(`td`,{...o,className:e.props?.className||void 0,"data-cell":t&&e.column?.textValue||void 0,ref:i},e.rendered)},A=({cell:e,state:t})=>{let n=a(null),{gridCellProps:i}=l({node:e},t,n),{checkboxProps:o}=h({key:e.parentKey},t);return r.createElement(`td`,{...i,className:`table-selection-cell`,suppressHydrationWarning:!0,ref:n},r.createElement(j,{checkboxProps:o}))},j=({checkboxProps:e})=>{let t=S(e),n=a(null),{inputProps:i}=s(e,t,n);return r.createElement(`input`,{...i,"aria-describedby":void 0,className:`check-input`,ref:n})},M=y,N=g,P=_,F=b,I=v;export{M as a,N as i,F as n,C as o,P as r,I as t};
|
|
2
|
+
//# sourceMappingURL=table-Cy6uEuEP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-Cy6uEuEP.js","names":["TableRow","TableCell","TableBody","StatelyTableBody","TableHeader","StatelyTableHeader"],"sources":["../../src/components/table/Table.tsx","../../src/components/table/TableBody.tsx","../../src/components/table/TableCell.tsx","../../src/components/table/TableColumn.tsx","../../src/components/table/TableHeader.tsx","../../src/components/table/TableRow.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, Ref, forwardRef, useRef } from 'react'\nimport classNames from 'classnames'\nimport {\n AriaCheckboxProps,\n Key,\n useCheckbox,\n useTable,\n useTableCell,\n useTableColumnHeader,\n useTableHeaderRow,\n useTableRow,\n useTableRowGroup,\n useTableSelectAllCheckbox,\n useTableSelectionCheckbox\n} from 'react-aria'\nimport {\n Selection,\n SortDescriptor,\n TableBodyProps,\n TableHeaderProps,\n TableState,\n useTableState,\n useToggleState\n} from 'react-stately'\n\nimport { useForkedRef } from '../../hooks/useForkedRef'\nimport { ContextColor } from '../../types'\nimport { tableClassName, tableWrapperClassName } from '../../utils/tableClassName'\nimport './Table.css'\n\n// `GridNode<T>` (from `@react-types/shared`) isn't re-exported by either package's public\n// surface — derived from the hooks' own parameter types instead of adding an undeclared\n// dependency on react-aria/react-stately's shared internals package.\ntype ColumnNode<T> = Parameters<typeof useTableColumnHeader<T>>[0]['node']\ntype RowNode<T> = Parameters<typeof useTableRow<T>>[0]['node']\ntype CellNode<T> = Parameters<typeof useTableCell<T>>[0]['node']\n\nexport interface TableProps<T extends object> {\n /**\n * An accessible label for the table, used when there's no visible heading.\n */\n 'aria-label'?: string\n /**\n * Identifies a visible heading element for the table.\n */\n 'aria-labelledby'?: string\n /**\n * Set the vertical alignment of cell content.\n */\n align?: 'bottom' | 'middle' | 'top'\n /**\n * Add borders on all sides of the table and cells.\n */\n bordered?: boolean\n /**\n * Remove borders on all sides of the table and cells.\n */\n borderless?: boolean\n /**\n * Content shown above the table, functioning as a heading for it.\n */\n caption?: ReactNode\n /**\n * A `TableHeader` and a `TableBody`, each built from `TableColumn`/`TableRow`/\n * `TableCell` — read as data to build the table's collection. Not rendered directly.\n */\n children: [\n ReactElement<TableHeaderProps<T> & { className?: string }>,\n ReactElement<TableBodyProps<T> & { className?: string }>\n ]\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.\n */\n color?: ContextColor\n /**\n * A list of row keys to disable. Disabled rows cannot be selected, focused, or interacted with.\n */\n disabledKeys?: Iterable<Key>\n /**\n * Content shown below the table in a `<tfoot>`, e.g. a totals row. Rendered as plain markup —\n * not part of the keyboard-navigable grid.\n */\n footer?: ReactNode\n /**\n * Enable a hover state on table rows.\n */\n hover?: boolean\n /**\n * `id` forwarded to the table element.\n */\n id?: string\n /**\n * Handler that is called when the selection changes.\n */\n onSelectionChange?: (keys: Selection) => void\n /**\n * Handler that is called when a column is sorted.\n */\n onSortChange?: (descriptor: SortDescriptor) => void\n /**\n * Make any table responsive across all viewports or pick a maximum breakpoint.\n */\n responsive?: boolean | 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n /**\n * The currently selected row keys (controlled).\n */\n selectedKeys?: Selection\n /**\n * The type of selection that is allowed.\n */\n selectionMode?: 'none' | 'single' | 'multiple'\n /**\n * Make table more compact by cutting all cell padding.\n */\n sm?: boolean\n /**\n * The current sort column and direction.\n */\n sortDescriptor?: SortDescriptor\n /**\n * Convert rows into stacked label/value blocks below a container width, for tables with too\n * many columns to read comfortably even with horizontal scrolling. `true` always stacks; a\n * breakpoint name stacks only below it. Implies `responsive` when `responsive` isn't set\n * separately, since stacking needs the same `.table-responsive` container-query ancestor.\n * Labels come from each `TableColumn`'s text (or its `textValue`, for non-text headers).\n */\n stacked?: boolean | 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n /**\n * Add zebra-striping to table rows.\n */\n striped?: boolean\n}\n\nconst TableInner = <T extends object>(\n {\n align,\n bordered,\n borderless,\n caption,\n children,\n className,\n color,\n disabledKeys,\n footer,\n hover,\n id,\n onSelectionChange,\n onSortChange,\n responsive,\n selectedKeys,\n selectionMode = 'none',\n sm,\n sortDescriptor,\n stacked,\n striped,\n ...rest\n }: TableProps<T>,\n forwardedRef: Ref<HTMLTableElement>\n) => {\n const state = useTableState<T>({\n children,\n disabledKeys,\n onSelectionChange,\n onSortChange,\n selectedKeys,\n selectionMode,\n showSelectionCheckboxes: selectionMode === 'multiple',\n sortDescriptor\n })\n\n const internalRef = useRef<HTMLTableElement>(null)\n const ref = useForkedRef(internalRef, forwardedRef)\n const { gridProps } = useTable(\n { 'aria-label': rest['aria-label'], 'aria-labelledby': rest['aria-labelledby'], id },\n state,\n internalRef\n )\n\n const _className = tableClassName({\n align,\n bordered,\n borderless,\n className,\n color,\n hover,\n sm,\n stacked,\n striped\n })\n\n const tableEl = (\n // react-aria joins the table's descriptions without dropping an empty result, so a table\n // with none had `aria-describedby=\"\"`.\n <table\n {...gridProps}\n aria-describedby={gridProps['aria-describedby'] || undefined}\n className={_className}\n ref={ref}\n >\n {caption && <caption>{caption}</caption>}\n <TableRowGroup className={children[0].props.className} type=\"thead\">\n {state.collection.headerRows.map((headerRow) => (\n <TableHeaderRow key={headerRow.key} item={headerRow} state={state}>\n {[...(state.collection.getChildren?.(headerRow.key) ?? [])].map((column) =>\n column.props?.isSelectionCell ? (\n <TableSelectAllCell key={column.key} column={column} state={state} />\n ) : (\n <TableColumnHeader key={column.key} column={column} state={state} />\n )\n )}\n </TableHeaderRow>\n ))}\n </TableRowGroup>\n <TableRowGroup className={children[1].props.className} type=\"tbody\">\n {[...state.collection.body.childNodes].map((row) => (\n <TableRow key={row.key} item={row} state={state}>\n {[...(state.collection.getChildren?.(row.key) ?? [])].map((cell) =>\n cell.props?.isSelectionCell ? (\n <TableSelectionCell key={cell.key} cell={cell} state={state} />\n ) : (\n <TableCell key={cell.key} cell={cell} stacked={!!stacked} state={state} />\n )\n )}\n </TableRow>\n ))}\n </TableRowGroup>\n {footer && <tfoot>{footer}</tfoot>}\n </table>\n )\n\n const wrapperClassName = tableWrapperClassName({ responsive, stacked })\n if (!wrapperClassName) return tableEl\n\n return <div className={wrapperClassName}>{tableEl}</div>\n}\n\n// `forwardRef` erases type parameters, so the generic component is cast back to a generic\n// signature for callers — same reasoning as `TableHeader`/`TableBody`'s casts above.\nexport const Table = forwardRef(TableInner) as <T extends object>(\n props: TableProps<T> & { ref?: Ref<HTMLTableElement> }\n) => ReactElement\n\n;(Table as { displayName?: string }).displayName = 'Table'\n\nconst TableRowGroup = ({\n className,\n type: Element,\n children\n}: {\n children: ReactNode\n className?: string\n type: 'thead' | 'tbody'\n}) => {\n const { rowGroupProps } = useTableRowGroup()\n return (\n <Element {...rowGroupProps} className={className || undefined}>\n {children}\n </Element>\n )\n}\n\ninterface TableHeaderRowProps<T> {\n children: ReactNode\n item: RowNode<T>\n state: TableState<T>\n}\n\nconst TableHeaderRow = <T extends object>({ children, item, state }: TableHeaderRowProps<T>) => {\n const ref = useRef<HTMLTableRowElement>(null)\n const { rowProps } = useTableHeaderRow({ node: item }, state, ref)\n return (\n <tr {...rowProps} ref={ref}>\n {children}\n </tr>\n )\n}\n\ninterface TableColumnHeaderProps<T> {\n column: ColumnNode<T>\n state: TableState<T>\n}\n\nconst TableColumnHeader = <T extends object>({ column, state }: TableColumnHeaderProps<T>) => {\n const ref = useRef<HTMLTableCellElement>(null)\n const { columnHeaderProps } = useTableColumnHeader({ node: column }, state, ref)\n const sortActive = state.sortDescriptor?.column === column.key\n const sortIcon = state.sortDescriptor?.direction === 'ascending' ? '▲' : '▼'\n\n return (\n <th\n {...columnHeaderProps}\n className={column.props?.className || undefined}\n colSpan={column.colSpan ?? undefined}\n // react-aria's `useTableColumnHeader` supplies `role=\"columnheader\"` for the ARIA grid\n // pattern but no `scope`, so the native table semantics were left ambiguous — a `<th>` with\n // no `scope` fails WCAG H63, and assistive technology reading the table natively (rather\n // than through the grid roles) has to guess whether the header applies to its column or its\n // row. These are always column headers; the row-header case doesn't exist in this API.\n scope=\"col\"\n ref={ref}\n >\n {column.rendered}\n {column.props?.allowsSorting && (\n <span aria-hidden=\"true\" className=\"table-sort-icon\">\n {sortActive ? sortIcon : '⇅'}\n </span>\n )}\n </th>\n )\n}\n\ninterface TableSelectAllCellProps<T> {\n column: ColumnNode<T>\n state: TableState<T>\n}\n\nconst TableSelectAllCell = <T extends object>({ column, state }: TableSelectAllCellProps<T>) => {\n const ref = useRef<HTMLTableCellElement>(null)\n const { columnHeaderProps } = useTableColumnHeader({ node: column }, state, ref)\n const { checkboxProps } = useTableSelectAllCheckbox(state)\n\n return (\n <th\n {...columnHeaderProps}\n className=\"table-selection-cell\"\n scope=\"col\"\n // react-stately's internal \"select all\" column key is a module-scoped\n // `'row-header-column-' + Math.random()` constant (@react-stately/table's TableCollection),\n // computed once per JS environment rather than per render. Under SSR this makes `id`/\n // `data-key` here differ between the server module instance and the browser's, on every\n // request — a real react-stately bug, not something this component can influence (the key\n // never reaches a public prop) — see README.md's Table/DataGrid known-issue section for the\n // upstream write-up. The mismatch is confined to this internal bookkeeping attribute (no\n // visible content, nothing else references this id), so suppressing the warning is safe\n // rather than papering over a real functional break.\n suppressHydrationWarning\n ref={ref}\n >\n <TableCheckbox checkboxProps={checkboxProps} />\n </th>\n )\n}\n\ninterface TableRowProps<T> {\n children: ReactNode\n item: RowNode<T>\n state: TableState<T>\n}\n\nconst TableRow = <T extends object>({ children, item, state }: TableRowProps<T>) => {\n const ref = useRef<HTMLTableRowElement>(null)\n const { rowProps } = useTableRow({ node: item }, state, ref)\n const isSelected = state.selectionManager.isSelected(item.key)\n\n return (\n <tr\n {...rowProps}\n className={classNames({ active: isSelected }, item.props?.className)}\n ref={ref}\n >\n {children}\n </tr>\n )\n}\n\ninterface TableCellProps<T> {\n cell: CellNode<T>\n stacked?: boolean\n state: TableState<T>\n}\n\nconst TableCell = <T extends object>({ cell, stacked, state }: TableCellProps<T>) => {\n const ref = useRef<HTMLTableCellElement>(null)\n const { gridCellProps } = useTableCell({ node: cell }, state, ref)\n\n return (\n <td\n {...gridCellProps}\n className={cell.props?.className || undefined}\n data-cell={stacked ? cell.column?.textValue || undefined : undefined}\n ref={ref}\n >\n {cell.rendered}\n </td>\n )\n}\n\nconst TableSelectionCell = <T extends object>({ cell, state }: TableCellProps<T>) => {\n const ref = useRef<HTMLTableCellElement>(null)\n const { gridCellProps } = useTableCell({ node: cell }, state, ref)\n const { checkboxProps } = useTableSelectionCheckbox({ key: cell.parentKey! }, state)\n\n return (\n // See `TableSelectAllCell`'s comment: this cell's `id`/`data-key` derive from the same\n // module-scoped random column key and mismatch between server and client under SSR.\n <td {...gridCellProps} className=\"table-selection-cell\" suppressHydrationWarning ref={ref}>\n <TableCheckbox checkboxProps={checkboxProps} />\n </td>\n )\n}\n\nconst TableCheckbox = ({ checkboxProps }: { checkboxProps: AriaCheckboxProps }) => {\n const toggleState = useToggleState(checkboxProps)\n const ref = useRef<HTMLInputElement>(null)\n const { inputProps } = useCheckbox(checkboxProps, toggleState, ref)\n\n // `aria-describedby` after the spread: react-aria's own adds ids it never renders (FORMS.md,\n // gotcha 6).\n return <input {...inputProps} aria-describedby={undefined} className=\"check-input\" ref={ref} />\n}\n","import { ReactElement } from 'react'\nimport { TableBody as StatelyTableBody } from 'react-stately'\n\nexport interface TableBodyProps<T> {\n /**\n * `TableRow` elements, or a render function paired with `items` for dynamic row generation.\n */\n children: ReactElement | ReactElement[] | ((item: T) => ReactElement)\n /**\n * A string of all className you want applied to the `<tbody>` element.\n */\n className?: string\n /**\n * A list of row data objects, rendered via the function form of `children`.\n */\n items?: Iterable<T>\n}\n\n/**\n * Collection node, data-only — read by `Table` to build the table's row collection. Never\n * rendered directly.\n */\nexport const TableBody = StatelyTableBody as unknown as <T>(\n props: TableBodyProps<T>\n) => ReactElement\n","import { ReactElement, ReactNode } from 'react'\nimport { Cell } from 'react-stately'\n\nexport interface TableCellProps {\n /**\n * The contents of the cell.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the cell.\n */\n className?: string\n /**\n * Indicates how many columns the cell spans.\n */\n colSpan?: number\n /**\n * A string representation of the cell's contents, used for typeahead.\n */\n textValue?: string\n}\n\n/**\n * Collection node, data-only — see `TableHeader`. Read by `Table` to build a cell in the\n * table's collection; never rendered directly.\n */\nexport const TableCell = Cell as unknown as (props: TableCellProps) => ReactElement\n","import { ReactElement, ReactNode } from 'react'\nimport { Column } from 'react-stately'\n\nexport interface TableColumnProps {\n /**\n * Whether the column allows sorting. Adds a sort indicator and makes the header\n * clickable/keyboard-activatable.\n */\n allowsSorting?: boolean\n /**\n * Rendered contents of the column header.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the column header.\n */\n className?: string\n /**\n * A string representation of the column header, used for accessibility announcements and,\n * when `Table`'s `stacked` prop is set, as the label shown before each row's value for this\n * column. Defaults to `children` when it's a plain string — set this explicitly when the\n * header contains anything else (an icon, a `Tooltip`, etc.).\n */\n textValue?: string\n}\n\n/**\n * Collection node, data-only — see `TableHeader`. Read by `Table` to build a column in the\n * table's collection; never rendered directly.\n */\nexport const TableColumn = Column as unknown as (props: TableColumnProps) => ReactElement\n","import { ReactElement } from 'react'\nimport { TableHeader as StatelyTableHeader } from 'react-stately'\n\nexport interface TableHeaderProps<T> {\n /**\n * `TableColumn` elements, or a render function paired with `columns` for dynamic column\n * generation.\n */\n children: ReactElement | ReactElement[] | ((column: T) => ReactElement)\n /**\n * A string of all className you want applied to the `<thead>` element.\n */\n className?: string\n /**\n * A list of column data objects, rendered via the function form of `children`.\n */\n columns?: readonly T[]\n}\n\n/**\n * Collection node, data-only — read by `Table` to build the table's column collection. Never\n * rendered directly.\n */\nexport const TableHeader = StatelyTableHeader as unknown as <T>(\n props: TableHeaderProps<T>\n) => ReactElement\n","import { Key, ReactElement } from 'react'\nimport { Row } from 'react-stately'\n\nexport interface TableRowProps {\n /**\n * `TableCell` elements, or a render function called once per column with that column's key —\n * required when the row's parent `TableBody` uses the `items`/render-function form.\n */\n children: ReactElement | ReactElement[] | ((columnKey: Key) => ReactElement)\n /**\n * A string of all className you want applied to the row.\n */\n className?: string\n /**\n * A string representation of the row's contents, used for typeahead.\n */\n textValue?: string\n}\n\n/**\n * Collection node, data-only — see `TableHeader`. Read by `Table` to build a row in the\n * table's collection; never rendered directly.\n */\nexport const TableRow = Row as unknown as (props: TableRowProps) => ReactElement\n"],"mappings":"ojBAkPA,MAAa,EAAQ,GAxGnB,CACE,QACA,WACA,aACA,UACA,WACA,YACA,QACA,eACA,SACA,QACA,KACA,oBACA,eACA,aACA,eACA,gBAAgB,OAChB,KACA,iBACA,UACA,UACA,GAAG,GAEL,IACG,CACH,IAAM,EAAQ,EAAiB,CAC7B,WACA,eACA,oBACA,eACA,eACA,gBACA,wBAAyB,IAAkB,WAC3C,gBACF,CAAC,EAEK,EAAc,EAAyB,IAAI,EAC3C,EAAM,EAAa,EAAa,CAAY,EAC5C,CAAE,aAAc,EACpB,CAAE,aAAc,EAAK,cAAe,kBAAmB,EAAK,mBAAoB,IAAG,EACnF,EACA,CACF,EAEM,EAAa,EAAe,CAChC,QACA,WACA,aACA,YACA,QACA,QACA,KACA,UACA,SACF,CAAC,EAEK,EAGJ,EAAA,cAAC,QAAD,CACE,GAAI,EACJ,mBAAkB,EAAU,qBAAuB,IAAA,GACnD,UAAW,EACN,KA8BA,EA5BJ,GAAW,EAAA,cAAC,UAAA,KAAS,CAAiB,EACvC,EAAA,cAAC,EAAD,CAAe,UAAW,EAAS,EAAE,CAAC,MAAM,UAAW,KAAK,OAY7C,EAXZ,EAAM,WAAW,WAAW,IAAK,GAChC,EAAA,cAAC,EAAD,CAAgB,IAAK,EAAU,IAAK,KAAM,EAAkB,OAQ5C,EAPb,CAAC,GAAI,EAAM,WAAW,cAAc,EAAU,GAAG,GAAK,CAAC,CAAE,CAAC,CAA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CAAG,EAEjE,OACE,EAAA,cAAC,KAAD,CACE,GAAI,EACJ,UAAW,EAAK,OAAO,WAAa,IAAA,GACpC,YAAW,GAAU,EAAK,QAAQ,WAAyB,IAAA,GACtD,KAGH,EADD,EAAK,QACJ,CAER,EAEM,GAAwC,CAAE,OAAM,WAA+B,CACnF,IAAM,EAAM,EAA6B,IAAI,EACvC,CAAE,iBAAkB,EAAa,CAAE,KAAM,CAAK,EAAG,EAAO,CAAG,EAC3D,CAAE,iBAAkB,EAA0B,CAAE,IAAK,EAAK,SAAW,EAAG,CAAK,EAEnF,OAGE,EAAA,cAAC,KAAD,CAAI,GAAI,EAAe,UAAU,uBAAuB,yBAAA,GAA8B,KAElF,EADF,EAAA,cAAC,EAAD,CAA8B,eAAgB,CAAA,CAC5C,CAER,EAEM,GAAiB,CAAE,mBAA0D,CACjF,IAAM,EAAc,EAAe,CAAa,EAC1C,EAAM,EAAyB,IAAI,EACnC,CAAE,cAAe,EAAY,EAAe,EAAa,CAAG,EAIlE,OAAO,EAAA,cAAC,QAAD,CAAO,GAAI,EAAY,mBAAkB,IAAA,GAAW,UAAU,cAAmB,KAAM,CAAA,CAChG,ECvYaC,EAAYC,ECIZ,EAAY,ECIZ,EAAc,ECPdC,EAAcC,ECAd,EAAW"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import e from"classnames";function t({align:t,bordered:n,borderless:r,className:i,color:a,hover:o,sm:s,stacked:c,striped:l}){return e(`table`,a,{[`align-${t}`]:t,bordered:n,borderless:r,hoverable:o,sm:s,stacked:c===!0,striped:l},typeof c==`string`?`max-${c}:stacked`:void 0,i)||void 0}function n({responsive:e,stacked:t}){if(e||t)return!e||e===!0?`table-responsive`:`max-${e}:table-responsive`}export{n,t};
|
|
1
|
+
import e from"classnames";function t({align:t,bordered:n,borderless:r,className:i,color:a,hover:o,sm:s,stacked:c,striped:l}){return e(`table`,a,{[`align-${t}`]:t,bordered:n,borderless:r,hoverable:o,sm:s,stacked:c===!0,striped:l},typeof c==`string`?`max-${c}:stacked`:void 0,i)||void 0}function n({responsive:e,stacked:t}){if(e||t)return!e||e===!0?`table-responsive`:`max-${e}:table-responsive`}export{n,t};
|
|
2
|
+
//# sourceMappingURL=tableClassName-CZA2Bse8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableClassName-CZA2Bse8.js","names":[],"sources":["../../src/utils/tableClassName.ts"],"sourcesContent":["import classNames from 'classnames'\n\nimport { Breakpoint, ContextColor } from '../types'\n\n// The styling props `Table` and `StaticTable` share. Kept in one place so the two can't drift into\n// applying different chassis-css classes for the same prop — `StaticTable` exists to be the\n// zero-JS twin of `Table`'s look, so a prop meaning something different on each would defeat it.\nexport interface TableStyleProps {\n /**\n * Set the vertical alignment of cell content.\n */\n align?: 'bottom' | 'middle' | 'top'\n /**\n * Add borders on all sides of the table and cells.\n */\n bordered?: boolean\n /**\n * Remove borders on all sides of the table and cells.\n */\n borderless?: 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.\n */\n color?: ContextColor\n /**\n * Enable a hover state on table rows.\n */\n hover?: boolean\n /**\n * Make any table responsive across all viewports or pick a maximum breakpoint.\n */\n responsive?: boolean | Breakpoint\n /**\n * Make table more compact by cutting all cell padding.\n */\n sm?: boolean\n /**\n * Convert rows into stacked label/value blocks below a container width, for tables with too\n * many columns to read comfortably even with horizontal scrolling. `true` always stacks; a\n * breakpoint name stacks only below it. Implies `responsive` when `responsive` isn't set\n * separately, since stacking needs the same `.table-responsive` container-query ancestor.\n */\n stacked?: boolean | Breakpoint\n /**\n * Add zebra-striping to table rows.\n */\n striped?: boolean\n}\n\nexport function tableClassName({\n align,\n bordered,\n borderless,\n className,\n color,\n hover,\n sm,\n stacked,\n striped\n}: TableStyleProps): string | undefined {\n return (\n classNames(\n 'table',\n color,\n {\n [`align-${align}`]: align,\n bordered,\n borderless,\n hoverable: hover,\n sm,\n stacked: stacked === true,\n striped\n },\n typeof stacked === 'string' ? `max-${stacked}:stacked` : undefined,\n className\n ) || undefined\n )\n}\n\n// `undefined` when the table needs no wrapper at all. Stacking needs the same `.table-responsive`\n// container-query ancestor as horizontal scrolling, so `stacked` alone still gets one.\nexport function tableWrapperClassName({\n responsive,\n stacked\n}: Pick<TableStyleProps, 'responsive' | 'stacked'>): string | undefined {\n if (!responsive && !stacked) return undefined\n if (!responsive || responsive === true) return 'table-responsive'\n return `max-${responsive}:table-responsive`\n}\n"],"mappings":"0BAqDA,SAAgB,EAAe,CAC7B,QACA,WACA,aACA,YACA,QACA,QACA,KACA,UACA,WACsC,CACtC,OACE,EACE,QACA,EACA,EACG,SAAS,KAAU,EACpB,WACA,aACA,UAAW,EACX,KACA,QAAS,IAAY,GACrB,SACF,EACA,OAAO,GAAY,SAAW,OAAO,EAAQ,UAAY,IAAA,GACzD,CACF,GAAK,IAAA,EAET,CAIA,SAAgB,EAAsB,CACpC,aACA,WACsE,CAClE,GAAC,GAAe,EAEpB,MADI,CAAC,GAAc,IAAe,GAAa,mBACxC,OAAO,EAAW,kBAC3B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useForkedRef-DVEfT-KI.js";import{t}from"./lazyElement-tfMG21pZ.js";import{t as n}from"./polymorphic-BhGNZQja.js";import{t as r}from"./useIsomorphicLayoutEffect-BbqRwuqn.js";import{t as i}from"./useTransitionState-e5ToY7eX.js";import{i as a,n as o,s}from"./navOverflow-B5krZe6D.js";import{r as c}from"./unhandledProps-9Kdj7WVf.js";import{t as l}from"./navVariant-DeGTk9B7.js";import u,{createContext as d,forwardRef as f,useContext as p,useEffect as m,useRef as h,useState as g}from"react";import _ from"classnames";import{useLocale as v,useTab as y,useTabList as b,useTabPanel as x}from"react-aria";import{Item as S,useTabListState as C}from"react-stately";const w=d(null),T=()=>{let e=p(w);if(!e)throw Error(`TabList and TabPanel must be rendered inside a Tabs`);return e},E=f(({className:t,size:n,variant:r=`tabs`,...i},s)=>{let{keyboardActivation:d,orientation:f,state:m}=T(),y=h(null),x=e(s,y),{direction:S}=v(),{tabListProps:C}=b({keyboardActivation:d,orientation:f,...i},m,y),w=p(o)!==null,[E]=g(()=>new WeakMap),[A,j]=g(!1),M=_(`nav`,n,l(r,`TabList`),t),N=e=>{if(!w||f===`vertical`)return;let t=D(e.key,S===`rtl`);if(t===void 0)return;let n=O(e.currentTarget),r=n.findIndex(t=>t.contains(e.target));if(r===-1)return;e.preventDefault(),e.stopPropagation();let i=t===`first`?n[0]:t===`last`?n[n.length-1]:n[(r+t+n.length)%n.length];if(!i)return;i.focus();let a=E.get(i);a!==void 0&&d!==`manual`&&m.setSelectedKey(a)};return u.createElement(`ul`,{className:M,...c(C,i,[`children`]),onKeyDownCapture:N,...w&&{onBlurCapture:()=>j(!1),onFocusCapture:e=>j(e.target.matches(`.nav-overflow-toggle`))},ref:x},u.createElement(a,{tabs:!0},[...m.collection].map(e=>u.createElement(k,{key:e.key,item:e,tabKeys:E,tabStop:!A}))))});E.displayName=`TabList`;const D=(e,t)=>{switch(e){case`ArrowRight`:return t?-1:1;case`ArrowLeft`:return t?1:-1;case`Home`:return`first`;case`End`:return`last`;default:return}},O=e=>Array.from(e.children).flatMap(e=>{if(e.hasAttribute(`data-cx-nav-overflow`)||e.classList.contains(`d-none`))return[];let t=e.querySelector(`[role="tab"]:not([aria-disabled="true"])`);return t?[t]:[]}),k=({item:e,tabKeys:t,tabStop:n})=>{let{state:i}=T(),a=h(null),{tabProps:o,isSelected:c,isDisabled:l}=y({key:e.key},i,a),d=h(!1),f=s({children:e.rendered,disabled:l,onClick:()=>{d.current=!0,requestAnimationFrame(()=>{d.current=!1}),i.setSelectedKey(e.key)}});return r(()=>{a.current&&t.set(a.current,e.key)}),r(()=>{!f.hidden&&d.current&&(d.current=!1,a.current?.focus())},[f.hidden]),u.createElement(`li`,{className:_(`nav-item`,{"nav-overflow-keep":e.value?.props.keepVisible}),role:`presentation`,...f.hidden&&{"data-cx-nav-overflow":`true`},ref:f.ref},u.createElement(`a`,{className:_(`nav-link`,{active:c,disabled:l}),...o,tabIndex:n?c&&!l&&i.selectionManager.focusedKey==null?0:o.tabIndex:-1,ref:a},e.rendered))},A=f(({children:t,className:n,id:r,...a},o)=>{let{state:s,isInitialSelectionRef:c}=T(),l=h(null),d=e(o,l),{tabPanelProps:f}=x({id:r},s,l),p=s.selectedKey===r,{phase:m}=i({appear:!c.current,in:p,nodeRef:l,unmountOnExit:!0});return p?u.createElement(`div`,{className:_(`tab-pane`,`fade`,`active`,{show:m===`entering`||m===`entered`},n),...f,...a,ref:d},t):null});A.displayName=`TabPanel`;function j({children:e,className:t,component:n,defaultSelectedKey:r,disabledKeys:i,keyboardActivation:a,onSelectionChange:o,orientation:s,selectedKey:c,...l},d){let f=n??`div`,p=u.Children.toArray(e),g=p.find(e=>N(e)!==void 0),_=N(g),v=p.filter(e=>e!==g),y=(_?u.Children.toArray(_.props.children):[]).filter(e=>u.isValidElement(e)),b=y.filter(e=>e.props.disabled).map(e=>e.props.id),x=i?[...i,...b]:b,T=r??P(y,new Set(x)),E=C({children:e=>u.createElement(S,{key:e.props.id,textValue:typeof e.props.children==`string`?e.props.children:void 0},e.props.children),items:y,defaultSelectedKey:T,disabledKeys:x,selectedKey:c,onSelectionChange:o}),D=h(!1);m(()=>{D.current||(D.current=!0,c==null&&r==null&&T!=null&&o?.(T))},[]);let O=h(!0);return m(()=>{O.current=!1},[]),u.createElement(w.Provider,{value:{keyboardActivation:a,orientation:s,state:E,isInitialSelectionRef:O}},u.createElement(f,{className:t,...l,ref:d},g,u.createElement(`div`,{className:`tab-content`},v)))}const M=e=>t(e,E);function N(e,n=2){if(M(e))return e;if(!(n===0||t(e,A))&&u.isValidElement(e))for(let t of u.Children.toArray(e.props.children)){let e=N(t,n-1);if(e)return e}}function P(e,t){return(e.find(e=>!t.has(e.props.id))??e[0])?.props.id}const F=n(j,`Tabs`),I=e=>null;I.displayName=`Tab`;export{E as i,F as n,A as r,I as t};
|
|
2
|
+
//# sourceMappingURL=tabs-91T7-8qq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs-91T7-8qq.js","names":[],"sources":["../../src/components/tabs/context.ts","../../src/components/tabs/TabList.tsx","../../src/components/tabs/TabPanel.tsx","../../src/components/tabs/Tabs.tsx","../../src/components/tabs/Tab.tsx"],"sourcesContent":["import { createContext, MutableRefObject, ReactElement, useContext } from 'react'\nimport { TabListState } from 'react-stately'\n\nimport { TabProps } from './Tab'\n\nexport interface TabsContextValue {\n keyboardActivation?: 'automatic' | 'manual'\n orientation?: 'horizontal' | 'vertical'\n state: TabListState<ReactElement<TabProps>>\n // Read by `TabPanel` at mount time to skip its fade-in for whichever panel is selected on the\n // very first render — only a tab *switch* should animate, not the page settling in. `Tabs`\n // flips this to `false` in an effect once the initial commit has painted.\n isInitialSelectionRef: MutableRefObject<boolean>\n}\n\nexport const TabsContext = createContext<TabsContextValue | null>(null)\n\nexport const useTabsContext = (): TabsContextValue => {\n const context = useContext(TabsContext)\n if (!context) {\n throw new Error('TabList and TabPanel must be rendered inside a Tabs')\n }\n return context\n}\n","import React, {\n AriaAttributes,\n FocusEvent,\n forwardRef,\n KeyboardEvent,\n ReactElement,\n ReactNode,\n useContext,\n useRef,\n useState\n} from 'react'\nimport classNames from 'classnames'\nimport { useLocale, useTab, useTabList } from 'react-aria'\nimport { Key, Node } from 'react-stately'\n\nimport { useForkedRef, useIsomorphicLayoutEffect } from '../../hooks'\nimport { NavOverflowContext, NavOverflowItems, useNavOverflowItem } from '../../utils/navOverflow'\nimport { NavVariant, navVariantClassName } from '../../utils/navVariant'\nimport { mergeUnhandledProps } from '../../utils/unhandledProps'\nimport { TabProps } from './Tab'\nimport { useTabsContext } from './context'\n\nexport interface TabListProps extends AriaAttributes {\n /**\n * `Tab` elements — read as data by `Tabs` to build the tab collection (see `Tabs.tsx`). Not\n * rendered directly.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set the tab list variant to tabs, to segments (a segmented control) or to underline, which\n * underlines the selected tab. `'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\n// Renders the actual, focusable tabs from `state.collection` — built by the ancestor `Tabs`\n// from this component's own `children` (see the comment there). This component's own `children`\n// prop is intentionally unused for rendering.\nexport const TabList = forwardRef<HTMLUListElement, TabListProps>(\n ({ className, size, variant = 'tabs', ...rest }, ref) => {\n const { keyboardActivation, orientation, state } = useTabsContext()\n const listRef = useRef<HTMLUListElement>(null)\n const forkedRef = useForkedRef(ref, listRef)\n const { direction } = useLocale()\n const { tabListProps } = useTabList(\n { keyboardActivation, orientation, ...rest },\n state,\n listRef\n )\n const overflows = useContext(NavOverflowContext) !== null\n const [tabKeys] = useState(() => new WeakMap<Element, Key>())\n // The list is one Tab stop. While the toggle has focus it is that stop, and no tab is: Tab\n // and Shift+Tab then leave the list from it, instead of stopping at a tab on the way.\n const [toggleFocused, setToggleFocused] = useState(false)\n\n const _className = classNames('nav', size, navVariantClassName(variant, 'TabList'), className)\n\n // Inside a `NavOverflow` some tabs are in its menu, hidden here, and its toggle is one more\n // stop among the tabs. react-aria's own arrow keys walk the whole collection, so they would\n // give focus to a hidden tab and never reach the toggle: the arrow keys, Home and End are\n // handled here instead, among the tabs that are shown and the toggle.\n const handleKeyDownCapture = (event: KeyboardEvent<HTMLUListElement>) => {\n if (!overflows || orientation === 'vertical') return\n const step = keyStep(event.key, direction === 'rtl')\n if (step === undefined) return\n const stops = tabStops(event.currentTarget)\n const index = stops.findIndex((stop) => stop.contains(event.target as globalThis.Node))\n if (index === -1) return\n\n event.preventDefault()\n event.stopPropagation()\n const next =\n step === 'first'\n ? stops[0]\n : step === 'last'\n ? stops[stops.length - 1]\n : stops[(index + step + stops.length) % stops.length]\n if (!next) return\n next.focus()\n const key = tabKeys.get(next)\n if (key !== undefined && keyboardActivation !== 'manual') state.setSelectedKey(key)\n }\n\n return (\n <ul\n className={_className}\n {...mergeUnhandledProps(tabListProps, rest, ['children'])}\n onKeyDownCapture={handleKeyDownCapture}\n {...(overflows && {\n onBlurCapture: () => setToggleFocused(false),\n onFocusCapture: (event: FocusEvent) =>\n setToggleFocused((event.target as Element).matches('.nav-overflow-toggle'))\n })}\n ref={forkedRef}\n >\n <NavOverflowItems tabs>\n {[...state.collection].map((item) => (\n <TabItem key={item.key} item={item} tabKeys={tabKeys} tabStop={!toggleFocused} />\n ))}\n </NavOverflowItems>\n </ul>\n )\n }\n)\n\nTabList.displayName = 'TabList'\n\nconst keyStep = (key: string, rtl: boolean): 1 | -1 | 'first' | 'last' | undefined => {\n switch (key) {\n case 'ArrowRight':\n return rtl ? -1 : 1\n case 'ArrowLeft':\n return rtl ? 1 : -1\n case 'Home':\n return 'first'\n case 'End':\n return 'last'\n default:\n return undefined\n }\n}\n\n// What the arrow keys move among: the tabs that are shown and enabled, then the overflow toggle\n// while it is shown. Walks `children` rather than querying with `:scope`, which jsdom misreads\n// under an id with a colon (see `menu/menuNavigation.ts`).\nconst tabStops = (list: HTMLElement): HTMLElement[] =>\n Array.from(list.children).flatMap((item) => {\n if (item.hasAttribute('data-cx-nav-overflow') || item.classList.contains('d-none')) return []\n const stop = item.querySelector<HTMLElement>('[role=\"tab\"]:not([aria-disabled=\"true\"])')\n return stop ? [stop] : []\n })\n\ninterface TabItemProps {\n item: Node<ReactElement<TabProps>>\n tabKeys: WeakMap<Element, Key>\n /**\n * Whether a tab may be the list's Tab stop now.\n */\n tabStop: boolean\n}\n\nconst TabItem = ({ item, tabKeys, tabStop }: TabItemProps) => {\n const { state } = useTabsContext()\n const ref = useRef<HTMLAnchorElement>(null)\n const { tabProps, isSelected, isDisabled } = useTab({ key: item.key }, state, ref)\n\n // Inside a `NavOverflow`, a tab that doesn't fit is shown in its menu as an item that selects\n // it. Selected, the tab is back in the list (the selected tab always is), and takes the focus\n // the menu item had.\n const focusWhenShownRef = useRef(false)\n const overflow = useNavOverflowItem({\n children: item.rendered,\n disabled: isDisabled,\n onClick: () => {\n focusWhenShownRef.current = true\n // Dropped if the tab isn't shown by then: a controlled `selectedKey` that didn't follow.\n requestAnimationFrame(() => {\n focusWhenShownRef.current = false\n })\n state.setSelectedKey(item.key)\n }\n })\n\n useIsomorphicLayoutEffect(() => {\n if (ref.current) tabKeys.set(ref.current, item.key)\n })\n\n useIsomorphicLayoutEffect(() => {\n if (overflow.hidden || !focusWhenShownRef.current) return\n focusWhenShownRef.current = false\n ref.current?.focus()\n }, [overflow.hidden])\n\n return (\n // ARIA's `tablist` role only permits `tab`-role children — `role=\"presentation\"` opts this\n // `<li>` wrapper out without hiding its content, same pattern as `MenuHeader`.\n <li\n className={classNames('nav-item', { 'nav-overflow-keep': item.value?.props.keepVisible })}\n role=\"presentation\"\n {...(overflow.hidden && { 'data-cx-nav-overflow': 'true' })}\n ref={overflow.ref}\n >\n <a\n className={classNames('nav-link', { active: isSelected, disabled: isDisabled })}\n {...tabProps}\n // react-aria makes the selected tab the tab stop in an effect, so the server's HTML had no\n // tab stop and Tab skipped the list until the JavaScript had loaded. A disabled tab never\n // is one.\n tabIndex={\n !tabStop\n ? -1\n : isSelected && !isDisabled && state.selectionManager.focusedKey == null\n ? 0\n : tabProps.tabIndex\n }\n ref={ref}\n >\n {item.rendered}\n </a>\n </li>\n )\n}\n","import React, { forwardRef, HTMLAttributes, ReactNode, useRef } from 'react'\nimport classNames from 'classnames'\nimport { useTabPanel } from 'react-aria'\nimport { Key } from 'react-stately'\n\nimport { useForkedRef, useTransitionState } from '../../hooks'\nimport { useTabsContext } from './context'\n\nexport interface TabPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, 'id'> {\n /**\n * Content of the panel, shown while the `Tab` of the same `id` is selected.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Pairs this panel with the `Tab` of the same `id`.\n */\n id: Key\n}\n\n// The counterpart to `Tab` — unlike `Tab`, `TabPanel` renders for real, but only while its `id`\n// matches the currently selected tab, and unmounts immediately (not staggered) once it isn't.\n// chassis-css's `.tab-content > .tab-pane`/`.active` rule (`_transitions.scss`) assumes exactly\n// one visible block-level panel at a time — there's no overlap/positioning support for a second\n// panel to occupy the same space while it exits, so staggering the *outgoing* panel's removal\n// would leave two full-height panels stacked in flow simultaneously and visibly shove the layout\n// around. Only the *incoming* panel gets a transition: it mounts without the `show` class —\n// `fade` alone means `opacity: 0` — and gets it once those styles are computed, so the panel\n// fades in instead of popping straight to full opacity. `appear` is gated on\n// `isInitialSelectionRef` so only an actual tab *switch* animates, not whichever panel happens to\n// be selected on first paint.\nexport const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(\n ({ children, className, id, ...rest }, ref) => {\n const { state, isInitialSelectionRef } = useTabsContext()\n const panelRef = useRef<HTMLDivElement>(null)\n const forkedRef = useForkedRef(ref, panelRef)\n const { tabPanelProps } = useTabPanel({ id }, state, panelRef)\n\n const isSelected = state.selectedKey === id\n const { phase } = useTransitionState({\n appear: !isInitialSelectionRef.current,\n in: isSelected,\n nodeRef: panelRef,\n unmountOnExit: true\n })\n\n // Not `isMounted`: that stays `true` through an exit, and this panel has none. With no\n // element left to wait on, the exit the hook starts ends at once.\n if (!isSelected) return null\n\n return (\n <div\n className={classNames(\n 'tab-pane',\n 'fade',\n 'active',\n { show: phase === 'entering' || phase === 'entered' },\n className\n )}\n {...tabPanelProps}\n {...rest}\n ref={forkedRef}\n >\n {children}\n </div>\n )\n }\n)\n\nTabPanel.displayName = 'TabPanel'\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n useEffect,\n useRef\n} from 'react'\nimport { Item, Key, useTabListState } from 'react-stately'\n\nimport { isElementOfType } from '../../utils/lazyElement'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { TabProps } from './Tab'\nimport { TabList } from './TabList'\nimport { TabPanel } from './TabPanel'\nimport { TabsContext } from './context'\n\ntype TabsOwnProps<C extends ElementType> = {\n /**\n * A `TabList` (containing `Tab` children) followed by one `TabPanel` per tab.\n */\n children?: ReactNode\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 * The initially selected tab's key (uncontrolled).\n */\n defaultSelectedKey?: Key\n /**\n * The keys of tabs that cannot be selected, focused, or otherwise interacted with.\n */\n disabledKeys?: Iterable<Key>\n /**\n * Whether tabs are selected automatically on arrow-key focus (`'automatic'`, the default) or\n * only on explicit activation — Enter/Space or click (`'manual'`).\n */\n keyboardActivation?: 'automatic' | 'manual'\n /**\n * Callback fired when the selected tab changes.\n */\n onSelectionChange?: (key: Key) => void\n /**\n * The orientation of the tab list.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * The selected tab's key (controlled).\n */\n selectedKey?: Key\n}\n\nexport type TabsProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, TabsOwnProps<C>>\n\ntype TabsComponent = (<C extends ElementType = 'div'>(\n props: TabsProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction TabsRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n component,\n defaultSelectedKey,\n disabledKeys,\n keyboardActivation,\n onSelectionChange,\n orientation,\n selectedKey,\n ...rest\n }: TabsProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n // `TabList`'s own children (the `Tab`s) are the source of truth for the collection —\n // `TabList` never renders them directly (see its own comment), it only reads them here,\n // at the point react-stately actually needs a collection to build `state` from. This keeps\n // the public authoring shape as plain composed JSX (matching every other chassis-react\n // component) instead of exposing react-aria's raw `items`/`Item` collection API directly.\n //\n // `isElementOfType` rather than `child.type === TabList`: written in a Server Component, the\n // children's types are lazy wrappers (see `utils/lazyElement`).\n const childArray = React.Children.toArray(children)\n // The `TabList`, or the element that holds it: a `NavOverflow` around the list is found inside\n // it, and rendered where the list would be.\n const tabListHolder = childArray.find((child) => findTabList(child) !== undefined)\n const tabListChild = findTabList(tabListHolder)\n const panelChildren = childArray.filter((child) => child !== tabListHolder)\n const tabs = (tabListChild ? React.Children.toArray(tabListChild.props.children) : []).filter(\n (child): child is ReactElement<TabProps> => React.isValidElement(child)\n )\n\n const tabDisabledKeys = tabs.filter((tab) => tab.props.disabled).map((tab) => tab.props.id)\n const allDisabledKeys = disabledKeys ? [...disabledKeys, ...tabDisabledKeys] : tabDisabledKeys\n\n // With no key given, react-stately selects the first enabled tab in an effect, which never runs\n // on the server: the server HTML had no selected tab and no panel. Choosing that tab here, by\n // react-stately's own rule (the first enabled tab, or the first tab when all are disabled),\n // selects it on the first render.\n const initialKey = defaultSelectedKey ?? firstEnabledKey(tabs, new Set(allDisabledKeys))\n\n const state = useTabListState<ReactElement<TabProps>>({\n children: (tab) => (\n <Item\n key={tab.props.id}\n textValue={typeof tab.props.children === 'string' ? tab.props.children : undefined}\n >\n {tab.props.children}\n </Item>\n ),\n items: tabs,\n defaultSelectedKey: initialKey,\n disabledKeys: allDisabledKeys,\n selectedKey,\n onSelectionChange\n })\n\n // react-stately's own selection of that tab reported it through `onSelectionChange`, which a key\n // given up front doesn't: report it once on mount, as before, so state kept from it (a\n // `selectedKey` that starts unset) learns the initial tab.\n const reportedInitialKeyRef = useRef(false)\n useEffect(() => {\n if (reportedInitialKeyRef.current) return\n reportedInitialKeyRef.current = true\n if (selectedKey == null && defaultSelectedKey == null && initialKey != null) {\n onSelectionChange?.(initialKey)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // Flipped to `false` once the initial commit has painted, so `TabPanel` can tell \"selected on\n // load\" apart from \"selected by switching\" and only fade in the latter.\n const isInitialSelectionRef = useRef(true)\n useEffect(() => {\n isInitialSelectionRef.current = false\n }, [])\n\n return (\n <TabsContext.Provider value={{ keyboardActivation, orientation, state, isInitialSelectionRef }}>\n <Component className={className} {...rest} ref={ref}>\n {tabListHolder}\n <div className=\"tab-content\">{panelChildren}</div>\n </Component>\n </TabsContext.Provider>\n )\n}\n\ntype TabListElement = ReactElement<{ children?: ReactNode }>\n\nconst isTabList = (child: unknown): child is TabListElement =>\n isElementOfType<{ children?: ReactNode }>(child, TabList)\n\n// `child` when it is the `TabList`, or the `TabList` inside it: one level down, or two, which is\n// where `<NavOverflow asChild>` around an element of the caller's puts it. Never inside a\n// `TabPanel`: reading a panel's children would wait for content that isn't shown.\nfunction findTabList(child: unknown, depth = 2): TabListElement | undefined {\n if (isTabList(child)) return child\n if (depth === 0 || isElementOfType(child, TabPanel)) return undefined\n if (!React.isValidElement<{ children?: ReactNode }>(child)) return undefined\n for (const inner of React.Children.toArray(child.props.children)) {\n const found = findTabList(inner, depth - 1)\n if (found) return found\n }\n return undefined\n}\n\nfunction firstEnabledKey(tabs: ReactElement<TabProps>[], disabled: Set<Key>): Key | undefined {\n return (tabs.find((tab) => !disabled.has(tab.props.id)) ?? tabs[0])?.props.id\n}\n\nexport const Tabs = createPolymorphicComponent<TabsComponent>(\n TabsRender as ForwardRefRenderFunction<Element, TabsProps<ElementType>>,\n 'Tabs'\n)\n","import { ReactNode } from 'react'\nimport { Key } from 'react-stately'\n\nexport interface TabProps {\n /**\n * Label content for the tab. Must be a plain string for it to be used as the tab's accessible\n * name when the rendered content itself doesn't expose one (e.g. an icon-only tab).\n */\n children: ReactNode\n /**\n * Prevents the tab from being selected, focused, or otherwise interacted with.\n */\n disabled?: boolean\n /**\n * Identifies this tab and pairs it with the `TabPanel` of the same `id`.\n */\n id: Key\n /**\n * Keeps the tab in the list inside a `NavOverflow`, whatever the width.\n */\n keepVisible?: boolean\n}\n\n// `Tab` is never actually mounted — it's read as data by `Tabs`, which builds react-aria's tab\n// collection from each `Tab`'s `id` and `children` (see `Tabs.tsx`), and `TabList` renders the\n// real, focusable tab elements from that collection instead. This keeps the public authoring\n// shape as plain composed JSX:\n//\n// <TabList aria-label=\"...\">\n// <Tab id=\"home\">Home</Tab>\n// <Tab id=\"profile\">Profile</Tab>\n// </TabList>\n// <TabPanel id=\"home\">...</TabPanel>\n// <TabPanel id=\"profile\">...</TabPanel>\n//\n// `id` (not React's own `key`) is what pairs a tab with its panel — still give each `Tab`/\n// `TabPanel` a React `key` too, as you would for any list.\nexport const Tab = (_props: TabProps): null => null\n\nTab.displayName = 'Tab'\n"],"mappings":"usBAeA,MAAa,EAAc,EAAuC,IAAI,EAEzD,MAAyC,CACpD,IAAM,EAAU,EAAW,CAAW,EACtC,GAAI,CAAC,EACH,MAAU,MAAM,qDAAqD,EAEvE,OAAO,CACT,EC0Ba,EAAU,GACpB,CAAE,YAAW,OAAM,UAAU,OAAQ,GAAG,GAAQ,IAAQ,CACvD,GAAM,CAAE,qBAAoB,cAAa,SAAU,EAAe,EAC5D,EAAU,EAAyB,IAAI,EACvC,EAAY,EAAa,EAAK,CAAO,EACrC,CAAE,aAAc,EAAU,EAC1B,CAAE,gBAAiB,EACvB,CAAE,qBAAoB,cAAa,GAAG,CAAK,EAC3C,EACA,CACF,EACM,EAAY,EAAW,CAAkB,IAAM,KAC/C,CAAC,GAAW,MAAe,IAAI,OAAuB,EAGtD,CAAC,EAAe,GAAoB,EAAS,EAAK,EAElD,EAAa,EAAW,MAAO,EAAM,EAAoB,EAAS,SAAS,EAAG,CAAS,EAMvF,EAAwB,GAA2C,CACvE,GAAI,CAAC,GAAa,IAAgB,WAAY,OAC9C,IAAM,EAAO,EAAQ,EAAM,IAAK,IAAc,KAAK,EACnD,GAAI,IAAS,IAAA,GAAW,OACxB,IAAM,EAAQ,EAAS,EAAM,aAAa,EACpC,EAAQ,EAAM,UAAW,GAAS,EAAK,SAAS,EAAM,MAAyB,CAAC,EACtF,GAAI,IAAU,GAAI,OAElB,EAAM,eAAe,EACrB,EAAM,gBAAgB,EACtB,IAAM,EACJ,IAAS,QACL,EAAM,GACN,IAAS,OACP,EAAM,EAAM,OAAS,GACrB,G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,SAAb,CAAsB,MAAO,CAAE,qBAAoB,cAAa,QAAO,uBAAsB,CAKvE,EAJpB,EAAA,cAAC,EAAD,CAAsB,YAAW,GAAI,EAAW,KAGrC,EAFR,EACD,EAAA,cAAC,MAAD,CAAK,UAAU,aAAkC,EAAnB,CAAmB,CACxC,CACS,CAE1B,CAIA,MAAM,EAAa,GACjB,EAA0C,EAAO,CAAO,EAK1D,SAAS,EAAY,EAAgB,EAAQ,EAA+B,CAC1E,GAAI,EAAU,CAAK,EAAG,OAAO,EACzB,SAAU,GAAK,EAAgB,EAAO,CAAQ,IAC7C,EAAM,eAAyC,CAAK,EACzD,IAAK,IAAM,KAAS,EAAM,SAAS,QAAQ,EAAM,MAAM,QAAQ,EAAG,CAChE,IAAM,EAAQ,EAAY,EAAO,EAAQ,CAAC,EAC1C,GAAI,EAAO,OAAO,CACpB,CAEF,CAEA,SAAS,EAAgB,EAAgC,EAAqC,CAC5F,OAAQ,EAAK,KAAM,GAAQ,CAAC,EAAS,IAAI,EAAI,MAAM,EAAE,CAAC,GAAK,EAAK,GAAA,EAAK,MAAM,EAC7E,CAEA,MAAa,EAAO,EAClB,EACA,MACF,ECjJa,EAAO,GAA2B,KAE/C,EAAI,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useForkedRef-DVEfT-KI.js";import{t}from"./useFormField-BOqmBTC4.js";import{t as n}from"./renderFormField-Brkw1yA6.js";import{t as r}from"./validationClassName-gRGs4KBm.js";import{r as i,t as a}from"./unhandledProps-9Kdj7WVf.js";import o,{forwardRef as s,useRef as c}from"react";import l from"classnames";import{useTextField as u}from"react-aria";const d=s(({adornEnd:s,adornStart:d,className:f,disabled:p,help:m,id:h,invalid:g,invalidFeedback:_,label:v,plainText:y,readOnly:b,size:x,style:S,type:C=`text`,valid:w,validFeedback:T,...E},D)=>{let O=c(null),k=e(D,O),{describedBy:A,feedbackId:j,helpId:M,inputId:N,labelId:P,labelledBy:F}=t({ariaDescribedBy:E[`aria-describedby`],ariaLabelledBy:E[`aria-labelledby`],help:m,id:h,invalid:g,invalidFeedback:_,label:v,valid:w,validFeedback:T}),{inputProps:I}=u({...E,"aria-describedby":A,"aria-labelledby":F,id:N,isDisabled:p,isInvalid:g,isReadOnly:b,type:C},O),L=d!=null||s!=null,R=l(L?`ghost-input`:`form-input`,!L&&y&&`plaintext`,!L&&x,r(g,w),!L&&f),z=o.createElement(`input`,{...i(I,E,a),"aria-describedby":A,className:R,ref:k,style:L?void 0:S}),B=L?o.createElement(`div`,{className:l(`form-input`,y&&`plaintext`,x,f),style:S},d,z,s):z;return n({children:B,help:m,ids:{feedback:j,help:M,input:N,label:P},invalid:g,invalidFeedback:_,label:v,valid:w,validFeedback:T})});d.displayName=`TextInput`;export{d as t};
|
|
2
|
+
//# sourceMappingURL=text-input-B4pTv6SU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-input-B4pTv6SU.js","names":[],"sources":["../../src/components/text-input/TextInput.tsx"],"sourcesContent":["import React, { forwardRef, InputHTMLAttributes, ReactNode, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaTextFieldProps, useTextField } from 'react-aria'\n\nimport { useForkedRef, useFormField } from '../../hooks'\nimport { mergeUnhandledProps, TEXT_FIELD_PROPS } from '../../utils/unhandledProps'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { renderFormField } from '../form-field/renderFormField'\n\nexport interface TextInputProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'defaultValue' | 'onChange' | 'size' | 'value'\n> {\n /**\n * Content rendered at the input's trailing edge, e.g. a `InputAdorn` icon, text, or button.\n * Setting either `adornStart` or `adornEnd` renders a `.form-input` wrapper around a\n * `.ghost-input`, matching chassis-css's [input help](https://chassis-ui.com/css/docs/forms/input-adorn) pattern.\n */\n adornEnd?: ReactNode\n /**\n * Content rendered at the input's leading edge, e.g. a `InputAdorn` icon, text, or button.\n * Setting either `adornStart` or `adornEnd` renders a `.form-input` wrapper around a\n * `.ghost-input`, matching chassis-css's [input help](https://chassis-ui.com/css/docs/forms/input-adorn) pattern.\n */\n adornStart?: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The value of the input, uncontrolled.\n */\n defaultValue?: string\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * A description for the field, rendered below the input.\n */\n help?: ReactNode\n /**\n * Set component validation state to invalid.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below the input when `invalid` is set.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with this input.\n */\n label?: ReactNode\n /**\n * Handler that is called when the value changes.\n */\n onChange?: (value: string) => void\n /**\n * Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly` [docs]\n */\n plainText?: boolean\n /**\n * Toggle the readonly state for the component.\n */\n readOnly?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Specifies the type of component. For `color` or `file` inputs, use the dedicated `ColorInput` or `FileInput` components instead.\n */\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'month'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'time'\n | 'url'\n | 'week'\n | (string & {})\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below the input when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The value of the input, controlled.\n */\n value?: string\n}\n\nexport const TextInput = forwardRef<HTMLInputElement, TextInputProps>(\n (\n {\n adornEnd,\n adornStart,\n className,\n disabled,\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n plainText,\n readOnly,\n size,\n style,\n type = 'text',\n valid,\n validFeedback,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n\n const { describedBy, feedbackId, helpId, inputId, labelId, labelledBy } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n ariaLabelledBy: rest['aria-labelledby'],\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n\n const { inputProps } = useTextField(\n {\n ...rest,\n 'aria-describedby': describedBy,\n 'aria-labelledby': labelledBy,\n id: inputId,\n isDisabled: disabled,\n isInvalid: invalid,\n isReadOnly: readOnly,\n type\n } as AriaTextFieldProps,\n inputRef\n )\n\n const hasAdorn = adornStart != null || adornEnd != null\n\n // chassis-css's `.form-input:has(.ghost-input.is-valid)` selector reads validation state off\n // the inner input, not the wrapper, once adorns turn `.form-input` into a flex container - see\n // https://chassis-ui.com/css/docs/forms/input-adorn.\n const inputClassName = classNames(\n hasAdorn ? 'ghost-input' : 'form-input',\n !hasAdorn && plainText && 'plaintext',\n !hasAdorn && size,\n validationClassName(invalid, valid),\n !hasAdorn && className\n )\n\n // `aria-describedby` after the spread: react-aria's own adds ids it never renders (FORMS.md,\n // gotcha 6). `style` goes where `className` does, on the outermost element.\n const input = (\n <input\n {...mergeUnhandledProps(inputProps, rest, TEXT_FIELD_PROPS)}\n aria-describedby={describedBy}\n className={inputClassName}\n ref={forkedRef}\n style={hasAdorn ? undefined : style}\n />\n )\n\n const children = hasAdorn ? (\n <div\n className={classNames('form-input', plainText && 'plaintext', size, className)}\n style={style}\n >\n {adornStart}\n {input}\n {adornEnd}\n </div>\n ) : (\n input\n )\n\n return renderFormField({\n children,\n help,\n ids: { feedback: feedbackId, help: helpId, input: inputId, label: labelId },\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n }\n)\n\nTextInput.displayName = 'TextInput'\n"],"mappings":"gZAmGA,MAAa,EAAY,GAErB,CACE,WACA,aACA,YACA,WACA,OACA,KACA,UACA,kBACA,QACA,YACA,WACA,OACA,QACA,OAAO,OACP,QACA,gBACA,GAAG,GAEL,IACG,CACH,IAAM,EAAW,EAAyB,IAAI,EACxC,EAAY,EAAa,EAAK,CAAQ,EAEtC,CAAE,cAAa,aAAY,SAAQ,UAAS,UAAS,cAAe,EAAa,CACrF,gBAAiB,EAAK,oBACtB,eAAgB,EAAK,mBACrB,OACA,KACA,UACA,kBACA,QACA,QACA,eACF,CAAC,EAEK,CAAE,cAAe,EACrB,CACE,GAAG,EACH,mBAAoB,EACpB,kBAAmB,EACnB,GAAI,EACJ,WAAY,EACZ,UAAW,EACX,WAAY,EACZ,MACF,EACA,CACF,EAEM,EAAW,GAAc,MAAQ,GAAY,KAK7C,EAAiB,EACrB,EAAW,cAAgB,aAC3B,CAAC,GAAY,GAAa,YAC1B,CAAC,GAAY,EACb,EAAoB,EAAS,CAAK,EAClC,CAAC,GAAY,CACf,EAIM,EACJ,EAAA,cAAC,QAAD,CACE,GAAI,EAAoB,EAAY,EAAM,CAAgB,EAC1D,mBAAkB,EAClB,UAAW,EACX,IAAK,EACL,MAAO,EAAW,IAAA,GAAY,CAC/B,CAAA,EAGG,EAAW,EACf,EAAA,cAAC,MAAD,CACE,UAAW,EAAW,aAAc,GAAa,YAAa,EAAM,CAAS,EACtE,OAKJ,EAHF,EACA,EACA,CACE,EAEL,EAGF,OAAO,EAAgB,CACrB,WACA,OACA,IAAK,CAAE,SAAU,EAAY,KAAM,EAAQ,MAAO,EAAS,MAAO,CAAQ,EAC1E,UACA,kBACA,QACA,QACA,eACF,CAAC,CACH,CACF,EAEA,EAAU,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./useForkedRef-DVEfT-KI.js";import{t}from"./useFormField-BOqmBTC4.js";import{t as n}from"./renderFormField-Brkw1yA6.js";import{t as r}from"./validationClassName-gRGs4KBm.js";import{r as i,t as a}from"./unhandledProps-9Kdj7WVf.js";import o,{forwardRef as s,useRef as c}from"react";import l from"classnames";import{useTextField as u}from"react-aria";const d=s(({className:s,disabled:d,help:f,id:p,invalid:m,invalidFeedback:h,label:g,plainText:_,readOnly:v,rows:y,size:b,valid:x,validFeedback:S,...C},w)=>{let T=c(null),E=e(w,T),{describedBy:D,feedbackId:O,helpId:k,inputId:A,labelId:j,labelledBy:M}=t({ariaDescribedBy:C[`aria-describedby`],ariaLabelledBy:C[`aria-labelledby`],help:f,id:p,invalid:m,invalidFeedback:h,label:g,valid:x,validFeedback:S}),{inputProps:N}=u({...C,"aria-describedby":D,"aria-labelledby":M,id:A,inputElementType:`textarea`,isDisabled:d,isInvalid:m,isReadOnly:v},T),P=l(`form-input`,_&&`plaintext`,b,r(m,x),s);return n({children:o.createElement(`textarea`,{...i(N,C,a),"aria-describedby":D,rows:y,className:P,ref:E}),help:f,ids:{feedback:O,help:k,input:A,label:j},invalid:m,invalidFeedback:h,label:g,valid:x,validFeedback:S})});d.displayName=`Textarea`;export{d as t};
|
|
2
|
+
//# sourceMappingURL=textarea-1A1nABQE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea-1A1nABQE.js","names":[],"sources":["../../src/components/textarea/Textarea.tsx"],"sourcesContent":["import React, { forwardRef, ReactNode, TextareaHTMLAttributes, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaTextFieldOptions, useTextField } from 'react-aria'\n\nimport { useForkedRef, useFormField } from '../../hooks'\nimport { mergeUnhandledProps, TEXT_FIELD_PROPS } from '../../utils/unhandledProps'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { renderFormField } from '../form-field/renderFormField'\n\nexport interface TextareaProps extends Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n 'defaultValue' | 'onChange' | 'value'\n> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The value of the textarea, uncontrolled.\n */\n defaultValue?: string\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * A description for the field, rendered below the textarea.\n */\n help?: ReactNode\n /**\n * Set component validation state to invalid.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below the textarea when `invalid` is set.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with this textarea.\n */\n label?: ReactNode\n /**\n * Handler that is called when the value changes.\n */\n onChange?: (value: string) => void\n /**\n * Render the component styled as plain text. Removes the default form field styling and preserve the correct margin and padding. Recommend to use only along side `readonly`.\n */\n plainText?: boolean\n /**\n * Toggle the readonly state for the component.\n */\n readOnly?: boolean\n /**\n * The number of visible text lines for the control.\n */\n rows?: number\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below the textarea when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The value of the textarea, controlled.\n */\n value?: string\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n className,\n disabled,\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n plainText,\n readOnly,\n rows,\n size,\n valid,\n validFeedback,\n ...rest\n },\n ref\n ) => {\n const textareaRef = useRef<HTMLTextAreaElement>(null)\n const forkedRef = useForkedRef(ref, textareaRef)\n\n const { describedBy, feedbackId, helpId, inputId, labelId, labelledBy } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n ariaLabelledBy: rest['aria-labelledby'],\n help,\n id,\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n\n const { inputProps } = useTextField<'textarea'>(\n {\n ...rest,\n 'aria-describedby': describedBy,\n 'aria-labelledby': labelledBy,\n id: inputId,\n inputElementType: 'textarea',\n isDisabled: disabled,\n isInvalid: invalid,\n isReadOnly: readOnly\n } as AriaTextFieldOptions<'textarea'>,\n textareaRef\n )\n\n const _className = classNames(\n 'form-input',\n plainText && 'plaintext',\n size,\n validationClassName(invalid, valid),\n className\n )\n\n return renderFormField({\n // `aria-describedby` after the spread: see `TextInput`.\n children: (\n <textarea\n {...mergeUnhandledProps(inputProps, rest, TEXT_FIELD_PROPS)}\n aria-describedby={describedBy}\n rows={rows}\n className={_className}\n ref={forkedRef}\n />\n ),\n help,\n ids: { feedback: feedbackId, help: helpId, input: inputId, label: labelId },\n invalid,\n invalidFeedback,\n label,\n valid,\n validFeedback\n })\n }\n)\n\nTextarea.displayName = 'Textarea'\n"],"mappings":"gZA2EA,MAAa,EAAW,GAEpB,CACE,YACA,WACA,OACA,KACA,UACA,kBACA,QACA,YACA,WACA,OACA,OACA,QACA,gBACA,GAAG,GAEL,IACG,CACH,IAAM,EAAc,EAA4B,IAAI,EAC9C,EAAY,EAAa,EAAK,CAAW,EAEzC,CAAE,cAAa,aAAY,SAAQ,UAAS,UAAS,cAAe,EAAa,CACrF,gBAAiB,EAAK,oBACtB,eAAgB,EAAK,mBACrB,OACA,KACA,UACA,kBACA,QACA,QACA,eACF,CAAC,EAEK,CAAE,cAAe,EACrB,CACE,GAAG,EACH,mBAAoB,EACpB,kBAAmB,EACnB,GAAI,EACJ,iBAAkB,WAClB,WAAY,EACZ,UAAW,EACX,WAAY,CACd,EACA,CACF,EAEM,EAAa,EACjB,aACA,GAAa,YACb,EACA,EAAoB,EAAS,CAAK,EAClC,CACF,EAEA,OAAO,EAAgB,CAErB,SACE,EAAA,cAAC,WAAD,CACE,GAAI,EAAoB,EAAY,EAAM,CAAgB,EAC1D,mBAAkB,EACZ,OACN,UAAW,EACX,IAAK,CACN,CAAA,EAEH,OACA,IAAK,CAAE,SAAU,EAAY,KAAM,EAAQ,MAAO,EAAS,MAAO,CAAQ,EAC1E,UACA,kBACA,QACA,QACA,eACF,CAAC,CACH,CACF,EAEA,EAAS,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{l as e}from"./slot-CNhFZdHF.js";import{t}from"./useForkedRef-DVEfT-KI.js";import{t as n}from"./useFormField-BOqmBTC4.js";import{t as r}from"./renderFormField-Brkw1yA6.js";import{t as i}from"./validationClassName-gRGs4KBm.js";import{t as a}from"./DateSegment-2agXAd0f.js";import o,{forwardRef as s,useRef as c}from"react";import ee from"classnames";import{mergeProps as l,useLocale as te,useTimeField as u}from"react-aria";import{useTimeFieldState as ne}from"react-stately";const d=s(({autoFocus:s,className:d,defaultValue:f,disabled:p,form:m,granularity:h,help:g,hideTimeZone:_,hourCycle:re,id:ie,invalid:v,invalidFeedback:y,label:b,maxValue:x,minValue:S,name:C,onBlur:w,onChange:T,onFocus:E,onKeyDown:D,onKeyUp:O,placeholderValue:k,readOnly:A,required:j,shouldForceLeadingZeros:M,size:N,valid:P,validFeedback:F,value:I,...L},R)=>{let z=c(null),B=t(R,z),V=c(null),{locale:H}=te(),U={"aria-label":L[`aria-label`],autoFocus:s,defaultValue:f,form:m,granularity:h,hideTimeZone:_,hourCycle:re,inputRef:V,isDisabled:p,isInvalid:v||void 0,isReadOnly:A,isRequired:j,maxValue:x,minValue:S,name:C,onBlur:w,onChange:T,onFocus:E,onKeyDown:D,onKeyUp:O,placeholderValue:k,shouldForceLeadingZeros:M,value:I},W=ne({...U,locale:H}),G=v||W.displayValidation.isInvalid,K=P&&!G,{describedBy:q,feedbackId:J,helpId:Y,inputId:ae,labelId:oe,labelledBy:X}=n({ariaDescribedBy:L[`aria-describedby`],ariaLabelledBy:L[`aria-labelledby`],help:g,id:ie,invalid:G,invalidFeedback:y,label:b,valid:K,validFeedback:F}),{descriptionProps:Z,errorMessageProps:Q,fieldProps:se,inputProps:ce}=u({...U,"aria-describedby":q,"aria-labelledby":X,id:ae},W,z),$=e(se,Z,Q);return r({children:o.createElement(o.Fragment,null,o.createElement(`div`,{...l($,L),"aria-describedby":$[`aria-describedby`],"aria-labelledby":X,className:ee(`form-input`,`time-field`,N,{disabled:p},i(G,K),d),ref:B,style:{...$.style,...L.style}},o.createElement(`div`,{className:`datepicker-field`},W.segments.map((e,t)=>o.createElement(a,{fieldLabelledBy:X,key:t,segment:e,slots:[Z,Q],state:W})))),o.createElement(`input`,{...ce,ref:V})),help:g,ids:{feedback:J,help:Y,label:oe},invalid:G,invalidFeedback:y,label:b,valid:K,validFeedback:F})});d.displayName=`TimeField`;export{d as t};
|
|
2
|
+
//# sourceMappingURL=time-field-B3MA7ED_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-field-B3MA7ED_.js","names":[],"sources":["../../src/components/time-field/TimeField.tsx"],"sourcesContent":["import React, { forwardRef, HTMLAttributes, ReactNode, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaTimeFieldProps, mergeProps, TimeValue, useLocale, useTimeField } from 'react-aria'\nimport { useTimeFieldState } from 'react-stately'\n\nimport { useForkedRef, useFormField } from '../../hooks'\nimport { withoutSlotIds } from '../../utils/idRefs'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { DateSegment } from '../datepicker/DateSegment'\nimport { renderFormField } from '../form-field/renderFormField'\n\nexport interface TimeFieldProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'defaultValue' | 'onChange'\n> {\n /**\n * An accessible label for the field, used when there's no visible `label`.\n */\n 'aria-label'?: string\n /**\n * Identifies a visible element that labels the field.\n */\n 'aria-labelledby'?: string\n /**\n * Focus the first segment when the field mounts.\n */\n autoFocus?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The value of the field, uncontrolled.\n */\n defaultValue?: TimeValue | null\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * The id of a form elsewhere on the page that the field belongs to.\n */\n form?: string\n /**\n * The smallest unit shown and edited.\n *\n * @default 'minute'\n */\n granularity?: 'hour' | 'minute' | 'second'\n /**\n * A description for the field, rendered below it.\n */\n help?: ReactNode\n /**\n * Hide the time zone of a `ZonedDateTime` value.\n */\n hideTimeZone?: boolean\n /**\n * Show 12 or 24 hours. Defaults to the locale's.\n */\n hourCycle?: 12 | 24\n /**\n * Set component validation state to invalid.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below it when `invalid` is set.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` that names the field.\n */\n label?: ReactNode\n /**\n * The latest time. A later one entered marks the field invalid.\n */\n maxValue?: TimeValue | null\n /**\n * The earliest time. An earlier one entered marks the field invalid.\n */\n minValue?: TimeValue | null\n /**\n * The name the value is submitted under with a form, as an ISO 8601 time (`09:30:00`).\n */\n name?: string\n /**\n * Handler that is called when the value changes: once every segment has a value, and with\n * `null` once every segment is empty. A partly emptied field keeps its last value.\n */\n onChange?: (value: TimeValue | null) => void\n /**\n * The time the segments start from when the field is empty, such as `new Time(9)`. It also\n * sets the type of value `onChange` receives.\n */\n placeholderValue?: TimeValue\n /**\n * Toggle the readonly state for the component.\n */\n readOnly?: boolean\n /**\n * Toggle the required state for the component.\n */\n required?: boolean\n /**\n * Show a leading zero on the hour, as `09:30` rather than `9:30`, whatever the locale does.\n */\n shouldForceLeadingZeros?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below it when `valid` is set.\n */\n validFeedback?: ReactNode\n /**\n * The value of the field, controlled: a `Time`, or a `CalendarDateTime` or `ZonedDateTime`\n * whose date is kept. `null` for an empty field.\n */\n value?: TimeValue | null\n}\n\ntype FieldProps = AriaTimeFieldProps<TimeValue>\n\n// A time as `DateField` renders a date for the date pickers: a `.form-input` holding one editable\n// segment per unit, with the segments' styles shared (`DateSegment`). The `.form-input` is the\n// field's group, named by the label; each segment is a spin button named by its unit and the\n// label.\nexport const TimeField = forwardRef<HTMLDivElement, TimeFieldProps>(\n (\n {\n autoFocus,\n className,\n defaultValue,\n disabled,\n form,\n granularity,\n help,\n hideTimeZone,\n hourCycle,\n id,\n invalid,\n invalidFeedback,\n label,\n maxValue,\n minValue,\n name,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n onKeyUp,\n placeholderValue,\n readOnly,\n required,\n shouldForceLeadingZeros,\n size,\n valid,\n validFeedback,\n value,\n ...rest\n },\n ref\n ) => {\n const fieldRef = useRef<HTMLDivElement>(null)\n const forkedRef = useForkedRef(ref, fieldRef)\n const inputRef = useRef<HTMLInputElement>(null)\n const { locale } = useLocale()\n\n // `label` stays out, as the other fields keep it: react-aria would name the field by a label\n // element of its own, which this component doesn't render.\n // `inputRef` is the hidden input's: react-aria resets the field with that input's form and\n // reports validity through it, as react-aria-components passes it, outside the public type.\n const baseProps: FieldProps & { inputRef: typeof inputRef } = {\n 'aria-label': rest['aria-label'],\n autoFocus,\n defaultValue,\n form,\n granularity,\n hideTimeZone,\n hourCycle,\n inputRef,\n isDisabled: disabled,\n // `false` would override react-aria's own range check: react-stately takes a defined\n // `isInvalid` as the whole validation state.\n isInvalid: invalid || undefined,\n isReadOnly: readOnly,\n isRequired: required,\n maxValue,\n minValue,\n name,\n onBlur: onBlur as FieldProps['onBlur'],\n onChange,\n onFocus: onFocus as FieldProps['onFocus'],\n onKeyDown: onKeyDown as FieldProps['onKeyDown'],\n onKeyUp: onKeyUp as FieldProps['onKeyUp'],\n placeholderValue,\n shouldForceLeadingZeros,\n value\n }\n const state = useTimeFieldState({ ...baseProps, locale })\n // A time outside `minValue`/`maxValue` is invalid too, shown as `invalid` is: the state\n // knows before the ids are built, so the feedback describes the field either way.\n const showInvalid = invalid || state.displayValidation.isInvalid\n // A time outside the range isn't valid, whatever `valid` says.\n const showValid = valid && !showInvalid\n\n const { describedBy, feedbackId, helpId, inputId, labelId, labelledBy } = useFormField({\n ariaDescribedBy: rest['aria-describedby'],\n ariaLabelledBy: rest['aria-labelledby'],\n help,\n id,\n invalid: showInvalid,\n invalidFeedback,\n label,\n valid: showValid,\n validFeedback\n })\n\n const {\n descriptionProps,\n errorMessageProps,\n fieldProps: groupProps,\n inputProps\n } = useTimeField(\n { ...baseProps, 'aria-describedby': describedBy, 'aria-labelledby': labelledBy, id: inputId },\n state,\n fieldRef\n )\n\n // The field's `aria-describedby` from react-aria holds its description of the value, added\n // once mounted, and the help and feedback given to it; the slot ids come out (FORMS.md, gotcha\n // 6). It's set again after the spread, where the caller's own value would replace it (gotcha\n // 4).\n const group = withoutSlotIds(groupProps, descriptionProps, errorMessageProps)\n\n return renderFormField({\n children: (\n <>\n <div\n {...mergeProps(group, rest)}\n aria-describedby={group['aria-describedby']}\n aria-labelledby={labelledBy}\n className={classNames(\n 'form-input',\n 'time-field',\n size,\n { disabled },\n validationClassName(showInvalid, showValid),\n className\n )}\n ref={forkedRef}\n style={{ ...group.style, ...rest.style }}\n >\n <div className=\"datepicker-field\">\n {state.segments.map((segment, index) => (\n <DateSegment\n fieldLabelledBy={labelledBy}\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n segment={segment}\n slots={[descriptionProps, errorMessageProps]}\n state={state}\n />\n ))}\n </div>\n </div>\n <input {...inputProps} ref={inputRef} />\n </>\n ),\n help,\n ids: { feedback: feedbackId, help: helpId, label: labelId },\n invalid: showInvalid,\n invalidFeedback,\n label,\n valid: showValid,\n validFeedback\n })\n }\n)\n\nTimeField.displayName = 'TimeField'\n"],"mappings":"igBAoIA,MAAa,EAAY,GAErB,CACE,YACA,YACA,eACA,WACA,OACA,cACA,OACA,eACA,aACA,MACA,UACA,kBACA,QACA,WACA,WACA,OACA,SACA,WACA,UACA,YACA,UACA,mBACA,WACA,WACA,0BACA,OACA,QACA,gBACA,QACA,GAAG,GAEL,IACG,CACH,IAAM,EAAW,EAAuB,IAAI,EACtC,EAAY,EAAa,EAAK,CAAQ,EACtC,EAAW,EAAyB,IAAI,EACxC,CAAE,UAAW,GAAU,EAMvB,EAAwD,CAC5D,aAAc,EAAK,cACnB,YACA,eACA,OACA,cACA,eACA,aACA,WACA,WAAY,EAGZ,UAAW,GAAW,IAAA,GACtB,WAAY,EACZ,WAAY,EACZ,WACA,WACA,OACQ,SACR,WACS,UACE,YACF,UACT,mBACA,0BACA,OACF,EACM,EAAQ,GAAkB,CAAE,GAAG,EAAW,QAAO,CAAC,EAGlD,EAAc,GAAW,EAAM,kBAAkB,UAEjD,EAAY,GAAS,CAAC,EAEtB,CAAE,cAAa,aAAY,SAAQ,WAAS,WAAS,cAAe,EAAa,CACrF,gBAAiB,EAAK,oBACtB,eAAgB,EAAK,mBACrB,OACA,MACA,QAAS,EACT,kBACA,QACA,MAAO,EACP,eACF,CAAC,EAEK,CACJ,mBACA,oBACA,WAAY,GACZ,eACE,EACF,CAAE,GAAG,EAAW,mBAAoB,EAAa,kBAAmB,EAAY,GAAI,EAAQ,EAC5F,EACA,CACF,EAMM,EAAQ,EAAe,GAAY,EAAkB,CAAiB,EAE5E,OAAO,EAAgB,CACrB,SACE,EAAA,cAAA,EAAA,SAAA,KACE,EAAA,cAAC,MAAD,CACE,GAAI,EAAW,EAAO,CAAI,EAC1B,mBAAkB,EAAM,oBACxB,kBAAiB,EACjB,UAAW,GACT,aACA,aACA,EACA,CAAE,UAAS,EACX,EAAoB,EAAa,CAAS,EAC1C,CACF,EACA,IAAK,EACL,MAAO,CAAE,GAAG,EAAM,MAAO,GAAG,EAAK,KAAM,CAcpC,EAZH,EAAA,cAAC,MAAD,CAAK,UAAU,kBAWV,EAVF,EAAM,SAAS,KAAK,EAAS,IAC5B,EAAA,cAAC,EAAD,CACE,gBAAiB,EAEjB,IAAK,EACI,UACT,MAAO,CAAC,EAAkB,CAAiB,EACpC,OACR,CAAA,CACF,CACE,CACF,EACL,EAAA,cAAC,QAAD,CAAO,GAAI,GAAY,IAAK,CAAW,CAAA,CACvC,EAEJ,OACA,IAAK,CAAE,SAAU,EAAY,KAAM,EAAQ,MAAO,EAAQ,EAC1D,QAAS,EACT,kBACA,QACA,MAAO,EACP,eACF,CAAC,CACH,CACF,EAEA,EAAU,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"./Portal-CgeR1WXV.js";import{t as a}from"./Icon-DLB1f88W.js";import{n as o}from"./iconSlot-BNu2MrFI.js";import{t as s}from"./CloseButton-DPgQztE0.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,className:t,closeButton:n,closeLabel:r,component:i,...a},o){let{close:l}=g(),u=i??`div`,d=f(`toast-body`,{"d-flex align-items-start justify-content-between gap-sm":n},t);return c.createElement(u,{className:d,...a,ref:o},n?c.createElement(`div`,null,e):e,n&&c.createElement(s,{label:r,onClick:l}))}const v=e(_,`ToastBody`);function y({children:e,className:t,component:n,...r},i){let a=n??`div`,o=f(`toast-footer`,t);return c.createElement(a,{className:o,...r,ref:i},e)}const b=e(y,`ToastFooter`);function x({children:e,className:t,closeButton:n,closeLabel:r,component:i,icon:a,time:l,titleId:u,...d},p){let{close:m}=g(),h=i??`div`,_=f(`toast-header`,t);return c.createElement(h,{className:_,...d,ref:p},a!=null&&(typeof a==`string`?c.createElement(`span`,{"aria-hidden":`true`,className:`me-sm`},c.createElement(o,{value:a,className:`toast-icon`})):c.createElement(`span`,{className:`me-sm`},a)),e!=null&&c.createElement(`strong`,{id:u,className:`me-auto`},e),l!=null&&c.createElement(`small`,null,l),n&&c.createElement(s,{label:r,onClick:m}))}const S=e(x,`ToastHeader`),C=u(({children:e,animation:r=!0,autohide:i=!0,className:a,closeButton:o,closeLabel:s,color:l,defaultVisible:u=!1,delay:d=5e3,footer:m,icon:g,message:_,role:y=`status`,solid:x,time:C,title:w,translucent:T,visible:E,onClose:D,onShow:O,onVisibleChange:k,...A},j)=>{let{close:M,entered:N,forkedRef:P,isMounted:F,textId:I,titleId:L,transitionClass:R,visible:z}=t({defaultVisible:u,displayName:`Toast`,onClose:D,onShow:O,onVisibleChange:k,ref:j,visible:E}),B=n({enabled:i,delay:d,visible:z&&N,onHide:M}),V={visible:z,close:M},H=f(`toast`,{fade:r,context:!!l,solid:!!(x&&l),translucent:T},l,a),U=g!=null||w!=null||C!=null,W=o&&(U||_==null),G=o&&!U&&_!=null,K=U||W;return F?c.createElement(h.Provider,{value:V},c.createElement(`div`,{className:f(H,R),role:y,"aria-labelledby":w==null?void 0:L,"aria-describedby":w!=null&&_!=null?I:void 0,...p(A,B),ref:P},K&&c.createElement(S,{icon:g,time:C,titleId:w==null?void 0:L,closeButton:W,closeLabel:s},w),_!=null&&c.createElement(v,{id:w!=null&&_!=null?I:void 0,closeButton:G,closeLabel:s},_),e,m!=null&&c.createElement(b,null,typeof m==`function`?m(M):m))):null});C.displayName=`Toast`;const w=u(({className:e,...t},n)=>{let r=f(`toast-icon`,e);return c.createElement(a,{className:r,...t,ref:n})});w.displayName=`ToastIcon`;const T=new m;function E(e,t={}){return T.add({children:e,...t})}function D(e){T.close(e)}const O=u(({children:e,className:t,placement:n,...a},o)=>{let{forkedRef:s,regionProps:l,state:u}=r(T,o),d=f(`toaster toast-container p-md`,{"position-fixed":n,"position-static":!n,"top-0":n&&n.includes(`top`),"top-50 translate-middle-y":n&&n.includes(`middle`),"bottom-0":n&&n.includes(`bottom`),"start-0":n&&n.includes(`start`),"start-50 translate-middle-x":n&&n.includes(`center`),"end-0":n&&n.includes(`end`)},t),p=t=>u.visibleToasts.length>0||e?c.createElement(`div`,{className:d,...l,...a,ref:t},e,u.visibleToasts.map(e=>{let{children:t,...n}=e.content;return c.createElement(C,{key:e.key,defaultVisible:!0,...n,onClose:()=>u.close(e.key)},t)})):null;return n?c.createElement(i,null,p(s)):p(s)});O.displayName=`Toaster`;export{w as a,b as c,T as i,v as l,E as n,C as o,D as r,S as s,O as t,g as u};
|
|
2
|
+
//# sourceMappingURL=toast-CGHl3-oU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-CGHl3-oU.js","names":[],"sources":["../../src/components/toast/context.ts","../../src/hooks/useToast.ts","../../src/components/toast/ToastBody.tsx","../../src/components/toast/ToastFooter.tsx","../../src/components/toast/ToastHeader.tsx","../../src/components/toast/Toast.tsx","../../src/components/toast/ToastIcon.tsx","../../src/components/toast/toastQueue.ts","../../src/components/toast/Toaster.tsx"],"sourcesContent":["import { createContext } from 'react'\n\nexport interface ToastContextProps {\n /**\n * Whether the toast is currently visible.\n */\n visible?: boolean\n /**\n * Dismisses the toast. Wire this to any element's `onClick` — see `useToast`.\n */\n close: () => void\n}\n\nexport const ToastContext = createContext<ToastContextProps>({ close: () => {} })\n","import { useContext } from 'react'\nimport { ToastContext, ToastContextProps } from '../components/toast/context'\n\nexport type UseToastResult = ToastContextProps\n\n// Reach the enclosing `Toast`'s dismiss handler from anywhere in its composed markup — e.g. to\n// close it from a plain `Button` placed in a `ToastFooter`, instead of a dedicated close\n// component. Only meaningful inside a `Toast`; outside one it returns a no-op `close`.\nexport const useToast = (): UseToastResult => useContext(ToastContext)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { CloseButton } from '../close-button/CloseButton'\nimport { useToast } from '../../hooks'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype ToastBodyOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Adds a close button alongside the body content, so a toast composed without a\n * `ToastHeader` still gets a dismiss control without any manual layout markup.\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 ToastBodyProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ToastBodyOwnProps<C>\n>\n\ntype ToastBodyComponent = (<C extends ElementType = 'div'>(\n props: ToastBodyProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ToastBodyRender<C extends ElementType = 'div'>(\n { children, className, closeButton, closeLabel, component, ...rest }: ToastBodyProps<C>,\n ref: PolymorphicRef<C>\n) {\n const { close } = useToast()\n const Component = component ?? 'div'\n const _className = classNames(\n 'toast-body',\n { 'd-flex align-items-start justify-content-between gap-sm': closeButton },\n className\n )\n return (\n <Component className={_className} {...rest} ref={ref}>\n {closeButton ? <div>{children}</div> : children}\n {closeButton && <CloseButton label={closeLabel} onClick={close} />}\n </Component>\n )\n}\n\nexport const ToastBody = createPolymorphicComponent<ToastBodyComponent>(\n ToastBodyRender as ForwardRefRenderFunction<Element, ToastBodyProps<ElementType>>,\n 'ToastBody'\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 ToastFooterOwnProps<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 ToastFooterProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ToastFooterOwnProps<C>\n>\n\ntype ToastFooterComponent = (<C extends ElementType = 'div'>(\n props: ToastFooterProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ToastFooterRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: ToastFooterProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('toast-footer', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ToastFooter = createPolymorphicComponent<ToastFooterComponent>(\n ToastFooterRender as ForwardRefRenderFunction<Element, ToastFooterProps<ElementType>>,\n 'ToastFooter'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement, ReactNode } from 'react'\nimport classNames from 'classnames'\n\nimport { CloseButton } from '../close-button/CloseButton'\nimport { useToast } from '../../hooks'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { ResolvedIcon } from '../../utils/iconSlot'\n\ntype ToastHeaderOwnProps<C extends ElementType> = {\n /**\n * Heading, rendered before `time` as a `<strong>`.\n */\n children?: ReactNode\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Automatically add a close button 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 * Leading icon. A string is an icon name, rendered like `<ToastIcon name={icon} />` (or by\n * `IconProvider`'s `component`) and hidden from\n * assistive technology by default, since it duplicates the heading visually. Pass any other\n * node for a fully custom icon (typically a logo or avatar) — a custom node is left as-is,\n * since it may carry its own meaningful accessible name (e.g. an avatar's `alt` text).\n */\n icon?: string | ReactNode\n /**\n * Trailing timestamp, rendered after the heading.\n */\n time?: ReactNode\n /**\n * Sets the `id` on the rendered heading element, for `aria-labelledby` wiring. Set\n * automatically by `Toast` when both `title` and `message` are used together; only needed\n * here for manual wiring in a fully custom composition.\n */\n titleId?: string\n}\n\nexport type ToastHeaderProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ToastHeaderOwnProps<C>\n>\n\ntype ToastHeaderComponent = (<C extends ElementType = 'div'>(\n props: ToastHeaderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ToastHeaderRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n closeButton,\n closeLabel,\n component,\n icon,\n time,\n titleId,\n ...rest\n }: ToastHeaderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const { close } = useToast()\n const Component = component ?? 'div'\n const _className = classNames('toast-header', className)\n return (\n <Component className={_className} {...rest} ref={ref}>\n {icon != null &&\n (typeof icon === 'string' ? (\n <span aria-hidden=\"true\" className=\"me-sm\">\n <ResolvedIcon value={icon} className=\"toast-icon\" />\n </span>\n ) : (\n <span className=\"me-sm\">{icon}</span>\n ))}\n {children != null && (\n <strong id={titleId} className=\"me-auto\">\n {children}\n </strong>\n )}\n {time != null && <small>{time}</small>}\n {closeButton && <CloseButton label={closeLabel} onClick={close} />}\n </Component>\n )\n}\n\nexport const ToastHeader = createPolymorphicComponent<ToastHeaderComponent>(\n ToastHeaderRender as ForwardRefRenderFunction<Element, ToastHeaderProps<ElementType>>,\n 'ToastHeader'\n)\n","import React, { forwardRef, HTMLAttributes, ReactNode } from 'react'\nimport { mergeProps } from 'react-aria'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport { useAutoDismiss, useDismissibleTransition } from '../../hooks'\nimport { ToastContext } from './context'\nimport { ToastBody } from './ToastBody'\nimport { ToastFooter } from './ToastFooter'\nimport { ToastHeader } from './ToastHeader'\n\nexport interface ToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /**\n * Apply a CSS fade transition to the toast.\n */\n animation?: boolean\n /**\n * Auto hide the toast. The timer starts once the show transition completes and pauses\n * while the pointer is over the toast or focus is within it.\n */\n autohide?: boolean\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Adds a close button — shorthand for `ToastHeader`'s/`ToastBody`'s `closeButton` prop.\n * Placed in the header when `icon`/`title`/`time` is set; otherwise placed in the body\n * alongside `message`, or in a header containing only the close button if `message` is\n * also unset.\n */\n closeButton?: boolean\n /**\n * Overrides the close button's accessible name (defaults to `'Close'`). Set this for\n * non-English UIs. Shorthand for `ToastHeader`'s `closeLabel` prop.\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 toast is shown when it first renders. Such a toast is uncontrolled: its close\n * button and the `autohide` timer hide it. Use `visible` to show and hide it from outside.\n */\n defaultVisible?: boolean\n /**\n * Delay hiding the toast (ms).\n */\n delay?: number\n /**\n * Trailing content — typically a row of `Button`s — rendered via a single `ToastFooter`,\n * after `message`/`children`. Pass a function to receive `close` directly, instead of\n * calling `useToast()` from a child component to wire up a \"Close\" action.\n */\n footer?: ReactNode | ((close: () => void) => ReactNode)\n /**\n * Leading icon for the header. A string is an icon name, rendered like\n * `<ToastIcon name={icon} />` (or by `IconProvider`'s `component`); pass\n * any other node for a fully custom icon (typically a logo or avatar). Shorthand for\n * `ToastHeader`'s `icon` prop; hidden from assistive technology by default, since it\n * duplicates `title` visually.\n */\n icon?: string | ReactNode\n /**\n * Message body, rendered via a single `ToastBody`. For multi-block content, compose\n * `children` manually instead — `message` wraps everything in one element.\n */\n message?: ReactNode\n /**\n * Header timestamp, rendered after `title`. Shorthand for `ToastHeader`'s `time` prop.\n */\n time?: ReactNode\n /**\n * Header heading, rendered before `time`. Shorthand for `ToastHeader`'s children. When set\n * alongside `message`, wires the toast's `aria-labelledby`/`aria-describedby` to them\n * automatically.\n */\n title?: ReactNode\n /**\n * Callback fired once the toast has hidden: after its exit transition.\n */\n onClose?: () => void\n /**\n * Callback fired when the toast starts to show.\n */\n onShow?: () => void\n /**\n * Callback fired with `false` when the toast asks to hide: its close button, `close` from\n * `useToast` or `footer`, or the `autohide` timer. With `visible` set, the toast hides only\n * 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 * Apply a full-color background with inverted text. Only meaningful alongside `color`.\n */\n solid?: boolean\n /**\n * Apply a semi-transparent background.\n */\n translucent?: boolean\n /**\n * Whether the toast is shown. Setting it makes the toast controlled: it hides only when this\n * becomes `false`, so pair it with `onVisibleChange`. Without either `visible` or\n * `defaultVisible` a toast renders nothing.\n */\n visible?: boolean\n}\n\nexport const Toast = forwardRef<HTMLDivElement, ToastProps>(\n (\n {\n children,\n animation = true,\n autohide = true,\n className,\n closeButton,\n closeLabel,\n color,\n defaultVisible = false,\n delay = 5000,\n footer,\n icon,\n message,\n role = 'status',\n solid,\n time,\n title,\n translucent,\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: 'Toast',\n onClose,\n onShow,\n onVisibleChange,\n ref,\n visible\n })\n\n // The autohide timer is only meaningful once the show transition has actually finished (see\n // `autohide`'s JSDoc) — gating on `_visible` alone would start it the instant the toast is\n // asked to show, while it is still fading/sliding in.\n const autoDismissProps = useAutoDismiss({\n enabled: autohide,\n delay,\n visible: _visible && entered,\n onHide: close\n })\n\n const contextValues = {\n visible: _visible,\n close\n }\n\n const _className = classNames(\n 'toast',\n {\n fade: animation,\n context: !!color,\n solid: Boolean(solid && color),\n translucent\n },\n color,\n className\n )\n\n const hasHeaderShorthand = icon != null || title != null || time != null\n const headerGetsCloseButton = closeButton && (hasHeaderShorthand || message == null)\n const bodyGetsCloseButton = closeButton && !hasHeaderShorthand && message != null\n const hasHeaderContent = hasHeaderShorthand || headerGetsCloseButton\n\n if (!isMounted) return null\n\n return (\n <ToastContext.Provider value={contextValues}>\n <div\n className={classNames(_className, transitionClass)}\n role={role}\n aria-labelledby={title != null ? titleId : undefined}\n aria-describedby={title != null && message != null ? textId : undefined}\n {...mergeProps(rest, autoDismissProps)}\n ref={forkedRef}\n >\n {hasHeaderContent && (\n <ToastHeader\n icon={icon}\n time={time}\n titleId={title != null ? titleId : undefined}\n closeButton={headerGetsCloseButton}\n closeLabel={closeLabel}\n >\n {title}\n </ToastHeader>\n )}\n {message != null && (\n <ToastBody\n id={title != null && message != null ? textId : undefined}\n closeButton={bodyGetsCloseButton}\n closeLabel={closeLabel}\n >\n {message}\n </ToastBody>\n )}\n {children}\n {footer != null && (\n <ToastFooter>{typeof footer === 'function' ? footer(close) : footer}</ToastFooter>\n )}\n </div>\n </ToastContext.Provider>\n )\n }\n)\n\nToast.displayName = 'Toast'\n","import React, { forwardRef } from 'react'\nimport classNames from 'classnames'\n\nimport { Icon, IconProps } from '../icon/Icon'\n\nexport type ToastIconProps = IconProps & {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n}\n\nexport const ToastIcon = forwardRef<HTMLSpanElement | SVGSVGElement, ToastIconProps>(\n ({ className, ...rest }, ref) => {\n const _className = classNames('toast-icon', className)\n\n return <Icon className={_className} {...rest} ref={ref} />\n }\n)\n\nToastIcon.displayName = 'ToastIcon'\n","import { ReactNode } from 'react'\nimport { ToastQueue } from 'react-stately'\n\nimport { ToastProps } from './Toast'\n\n// What `Toaster` spreads onto the `<Toast>` it renders for a queued toast: every `Toast` prop\n// that describes the toast itself. The queue owns whether it is shown.\nexport interface ToastContent extends Pick<\n ToastProps,\n | 'animation'\n | 'autohide'\n | 'closeButton'\n | 'closeLabel'\n | 'color'\n | 'delay'\n | 'footer'\n | 'icon'\n | 'message'\n | 'role'\n | 'solid'\n | 'time'\n | 'title'\n | 'translucent'\n> {\n /**\n * Content of the toast. Compose manually (typically a `ToastHeader`/`ToastBody`/\n * `ToastFooter`), or leave empty and use the `title`/`message`/`footer` shorthand options\n * instead.\n */\n children?: ReactNode\n}\n\n// The queue backing `Toaster` — a module-level singleton so `addToast()` is callable from\n// anywhere (an event handler, an async callback) without threading a `push` prop through\n// render. `Toaster` subscribes to it via `useToastQueue`; nothing renders until a\n// `<Toaster />` is actually mounted somewhere to display the queue's contents.\nexport const toastQueue = new ToastQueue<ToastContent>()\n\n// Adds a toast to the queue. Returns the toast's key, which can be passed to `closeToast` to\n// dismiss it programmatically. `children` is optional — omit it for a toast composed entirely\n// from the `title`/`message`/`footer` shorthand options.\nexport function addToast(\n children?: ReactNode,\n options: Omit<ToastContent, 'children'> = {}\n): string {\n return toastQueue.add({ children, ...options })\n}\n\n// Removes a queued toast immediately, bypassing its own exit animation.\nexport function closeToast(key: string): void {\n toastQueue.close(key)\n}\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nimport { useToastRegionQueue } from '../../hooks'\nimport { Portal } from '../portal/Portal'\nimport { Toast } from './Toast'\nimport { toastQueue } from './toastQueue'\n\nexport interface ToasterProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Overrides the toast region's accessible name (defaults to `'Notifications'`, per\n * react-aria). Set this for non-English UIs, or to distinguish multiple toasters on the\n * same page.\n */\n 'aria-label'?: string\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Describes the placement of your component.\n *\n * @type 'top-start' | 'top-center' | 'top-end' | 'middle-start' | 'middle-center' | 'middle-end' | 'bottom-start' | 'bottom-center' | 'bottom-end' | string\n */\n placement?:\n | 'top-start'\n | 'top-center'\n | 'top-end'\n | 'middle-start'\n | 'middle-center'\n | 'middle-end'\n | 'bottom-start'\n | 'bottom-center'\n | 'bottom-end'\n | string\n}\n\n// Renders the shared `toastQueue` (see `toastQueue.ts` — `addToast()` is how toasts get added\n// to it from anywhere in the app) plus any statically-passed `children`, e.g. a permanently\n// pinned toast alongside dynamic ones.\nexport const Toaster = forwardRef<HTMLDivElement, ToasterProps>(\n ({ children, className, placement, ...rest }, ref) => {\n const { forkedRef, regionProps, state } = useToastRegionQueue(toastQueue, ref)\n\n const _className = classNames(\n 'toaster toast-container p-md',\n {\n 'position-fixed': placement,\n 'position-static': !placement,\n 'top-0': placement && placement.includes('top'),\n 'top-50 translate-middle-y': placement && placement.includes('middle'),\n 'bottom-0': placement && placement.includes('bottom'),\n 'start-0': placement && placement.includes('start'),\n 'start-50 translate-middle-x': placement && placement.includes('center'),\n 'end-0': placement && placement.includes('end')\n },\n className\n )\n\n const toaster = (toasterRef?: React.Ref<HTMLDivElement>) => {\n return state.visibleToasts.length > 0 || children ? (\n <div className={_className} {...regionProps} {...rest} ref={toasterRef}>\n {children}\n {state.visibleToasts.map((queued) => {\n const { children: toastChildren, ...toastProps } = queued.content\n return (\n <Toast\n key={queued.key}\n defaultVisible\n {...toastProps}\n onClose={() => state.close(queued.key)}\n >\n {toastChildren}\n </Toast>\n )\n })}\n </div>\n ) : null\n }\n\n // A placed region is portaled to `document.body`, on the server as on the client: it renders\n // nothing until hydration has finished, instead of rendering inline on the server and moving\n // on the client, which discarded the server's markup.\n return placement ? <Portal>{toaster(forkedRef)}</Portal> : toaster(forkedRef)\n }\n)\n\nToaster.displayName = 'Toaster'\n"],"mappings":"kfAaA,MAAa,EAAe,EAAiC,CAAE,UAAa,CAAC,CAAE,CAAC,ECLnE,MAAiC,EAAW,CAAY,ECiCrE,SAAS,EACP,CAAE,WAAU,YAAW,cAAa,aAAY,YAAW,GAAG,GAC9D,EACA,CACA,GAAM,CAAE,SAAU,EAAS,EACrB,EAAY,GAAa,MACzB,EAAa,EACjB,aACA,CAAE,0DAA2D,CAAY,EACzE,CACF,EACA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAGtC,EAFR,EAAc,EAAA,cAAC,MAAA,KAAK,CAAc,EAAI,EACtC,GAAe,EAAA,cAAC,EAAD,CAAa,MAAO,EAAY,QAAS,CAAQ,CAAA,CACxD,CAEf,CAEA,MAAa,EAAY,EACvB,EACA,WACF,EClCA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,eAAgB,CAAS,EAEvD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAc,EACzB,EACA,aACF,ECiBA,SAAS,EACP,CACE,WACA,YACA,cACA,aACA,YACA,OACA,OACA,UACA,GAAG,GAEL,EACA,CACA,GAAM,CAAE,SAAU,EAAS,EACrB,EAAY,GAAa,MACzB,EAAa,EAAW,eAAgB,CAAS,EACvD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAgBtC,EAfR,GAAQ,OACN,OAAO,GAAS,SACf,EAAA,cAAC,OAAD,CAAM,cAAY,OAAO,UAAU,OAE7B,EADJ,EAAA,cAAC,EAAD,CAAc,MAAO,EAAM,UAAU,YAAc,CAAA,CAC/C,EAEN,EAAA,cAAC,OAAD,C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GAAI,EAAa,GAAI,EAAM,IAAK,CAevD,EAdF,EACA,EAAM,cAAc,IAAK,GAAW,CACnC,GAAM,CAAE,SAAU,EAAe,GAAG,GAAe,EAAO,QAC1D,OACE,EAAA,cAAC,EAAD,CACE,IAAK,EAAO,IACZ,eAAA,GACA,GAAI,EACJ,YAAe,EAAM,MAAM,EAAO,GAAG,CAGhC,EADJ,CACI,CAEX,CAAC,CACE,EACH,KAMN,OAAO,EAAY,EAAA,cAAC,EAAA,KAAQ,EAAQ,CAAS,CAAU,EAAI,EAAQ,CAAS,CAC9E,CACF,EAEA,EAAQ,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-SR_LwaN7.js";import{i as e,o as t}from"./slot-CNhFZdHF.js";import{t as n}from"./useForkedRef-DVEfT-KI.js";import{n as ee,t as r}from"./Portal-CgeR1WXV.js";import{t as i}from"./useTransitionState-e5ToY7eX.js";import{n as a,r as o,t as s}from"./useFloatingOverlay-DLIvwx-8.js";import{t as c}from"./useOpenStateProps-DykUbnPJ.js";import{i as l,n as u}from"./overlayPlacement-BtS90IVf.js";import d,{forwardRef as f,useEffect as p,useRef as m}from"react";import h from"classnames";import{mergeProps as g,useOverlayPosition as _,useTooltip as v,useTooltipTrigger as y}from"react-aria";import{useTooltipTriggerState as b}from"react-stately";const x=f(function({children:f,className:x,content:S,defaultVisible:C,placement:w=`top`,offset:T=[0,6],onHide:E,onShow:D,onVisibleChange:O,style:k,trigger:A,visible:j,...M},N){let P=m(null),F=m(null),I=m(null),L=n(N,I),R=e(f,`Tooltip`),z=b({...c({defaultVisible:C,onVisibleChange:O,visible:j},`Tooltip`),trigger:A,delay:0,closeDelay:0}),B=j!==void 0&&!O,{triggerProps:V,tooltipProps:H}=y({trigger:A},B?{...z,isOpen:!1}:z,F),{tooltipProps:U}=v({},z),W=z.open;p(()=>{z.isOpen&&W(!0)},[z.isOpen]);let G=o({close:()=>z.close(!0),isOpen:z.isOpen,onHide:E,onShow:D,triggerRef:F}),{overlayProps:K,arrowProps:q,placement:J}=_({targetRef:F,overlayRef:I,placement:l(w),offset:T[1],crossOffset:T[0],arrowSize:8,arrowRef:P,isOpen:z.isOpen}),Y={...k,position:K.style?.position,top:K.style?.top,left:K.style?.left},X=u(w,J),{isMounted:Z,phase:Q}=i({in:z.isOpen,mountOnEnter:!0,nodeRef:I,unmountOnExit:!0}),$=ee();return d.createElement(d.Fragment,null,R?t(R,g($?V:{...V,"aria-describedby":void 0},$&&B&&z.isOpen?{"aria-describedby":H.id}:{}),F):f,d.createElement(r,{container:G},Z&&d.createElement(`div`,{...g(H,U,M),className:h(`tooltip cx-tooltip-auto`,a(Q),x),"data-cx-placement":X,ref:L,style:Y},d.createElement(`div`,{className:`tooltip-arrow`,...q,style:s(q)}),d.createElement(`div`,{className:`tooltip-inner`},S))))});x.displayName=`Tooltip`;export{x as t};
|
|
2
|
+
//# sourceMappingURL=tooltip-Bc-u6nIW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip-Bc-u6nIW.js","names":[],"sources":["../../src/components/tooltip/Tooltip.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n ReactElement,\n ReactNode,\n useEffect,\n useRef\n} from 'react'\nimport classNames from 'classnames'\nimport { mergeProps, useOverlayPosition, useTooltip, useTooltipTrigger } from 'react-aria'\nimport { useTooltipTriggerState } from 'react-stately'\n\nimport {\n getOverlayArrowStyle,\n getOverlayTransitionClass,\n useFloatingOverlay,\n useForkedRef,\n useOpenStateProps,\n useTransitionState\n} from '../../hooks'\nimport { Placement, resolveDataPlacement, toAriaPlacement } from '../../utils/overlayPlacement'\nimport { Portal, useHydrated } from '../portal/Portal'\nimport { getTriggerChild, renderSlotted } from '../../utils/slot'\n\nexport type { Placement }\n\n// Every attribute besides the component's own props goes to the panel, the `.tooltip` element:\n// `className`, `style`, `id`, `data-*`, ARIA attributes and event handlers. So does the ref.\nexport interface TooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'content'> {\n /**\n * The trigger: a single element, which shows the tooltip on hover and focus.\n */\n children: ReactElement\n /**\n * Content node for your component.\n */\n content: ReactNode | string\n /**\n * Whether the tooltip is shown when it first renders. Use it instead of `visible` when nothing\n * outside needs to control the tooltip.\n */\n defaultVisible?: boolean\n /**\n * Offset of the tooltip relative to its target, as `[crossAxis, mainAxis]`.\n */\n offset?: [number, number]\n /**\n * Callback fired when the tooltip hides.\n */\n onHide?: () => void\n /**\n * Callback fired when the tooltip shows.\n */\n onShow?: () => void\n /**\n * Callback fired when the tooltip asks to show or hide: hover, focus, blur, the Escape key, or\n * the closing of the dialog it is in. Receives the state it asks for. With `visible` set, the\n * tooltip changes only when `visible` does.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Describes the preferred placement of your component. Chassis will flip it to keep it in\n * view.\n */\n placement?: Placement\n /**\n * Tooltips always show on focus, since keyboard/screen-reader users need them too. Set to\n * `'focus'` to disable the hover trigger and show on focus only.\n */\n trigger?: 'hover' | 'focus'\n /**\n * Whether the tooltip is shown. Setting it makes the tooltip controlled: it shows and hides\n * only when this changes, so pair it with `onVisibleChange`. Leave it unset, or use\n * `defaultVisible`, for a tooltip that shows and hides itself.\n */\n visible?: boolean\n}\n\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(\n {\n children,\n className,\n content,\n defaultVisible,\n placement = 'top',\n offset: offsetProp = [0, 6],\n onHide,\n onShow,\n onVisibleChange,\n style,\n trigger,\n visible,\n ...rest\n },\n ref\n) {\n const arrowRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLElement | null>(null)\n const floatingRef = useRef<HTMLDivElement>(null)\n const forkedFloatingRef = useForkedRef(ref, floatingRef)\n\n // The trigger is rendered as `asChild` renders a child (`renderSlotted`): `triggerProps` merge\n // into the child's own props, so its handlers chain and its `aria-describedby` adds up, and\n // `triggerRef` is forked with the ref the caller put on the child.\n const triggerElement = getTriggerChild(children, 'Tooltip')\n\n // react-stately defaults to a 1500ms warmup delay (and 500ms cooldown) before a first tooltip\n // shows, spectrum-style — chassis-css's own JS plugin defaults to instant (`delay: 0`), so\n // match that here rather than leaving new adopters to wonder why the first hover lags.\n const state = useTooltipTriggerState({\n ...useOpenStateProps({ defaultVisible, onVisibleChange, visible }, 'Tooltip'),\n trigger,\n delay: 0,\n closeDelay: 0\n })\n // While a tooltip is open, react-aria stops every Escape at the document and closes the\n // tooltip with it. One held open by `visible` with no `onVisibleChange` never closes, so it\n // would swallow Escape for the whole page: a popover, a menu or a dialog beside it could no\n // longer be closed by it. Such a tooltip is passed as closed, which is all the hook reads the\n // state for besides `aria-describedby`, set below.\n const isHeld = visible !== undefined && !onVisibleChange\n const { triggerProps, tooltipProps: tooltipTriggerProps } = useTooltipTrigger(\n { trigger },\n isHeld ? { ...state, isOpen: false } : state,\n triggerRef\n )\n const { tooltipProps } = useTooltip({}, state)\n\n // react-stately shows one tooltip at a time, but counts only a tooltip it opened through\n // `open()`. One shown by `visible` or `defaultVisible` joins here, so the next tooltip to open\n // asks it to hide, and it closes the ones already open.\n const registerOpen = state.open\n useEffect(() => {\n if (state.isOpen) registerOpen(true)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.isOpen])\n\n // Bypasses the hook's hover-warmup delay (`close`'s `immediate` argument): a containing dialog\n // closing applies right away.\n const portalContainer = useFloatingOverlay({\n close: () => state.close(true),\n isOpen: state.isOpen,\n onHide,\n onShow,\n triggerRef\n })\n\n const {\n overlayProps,\n arrowProps,\n placement: resolvedPlacement\n } = useOverlayPosition({\n targetRef: triggerRef,\n overlayRef: floatingRef,\n placement: toAriaPlacement(placement),\n offset: offsetProp[1],\n crossOffset: offsetProp[0],\n arrowSize: 8,\n arrowRef,\n isOpen: state.isOpen\n })\n\n // The caller's `style` first: the position is the component's to set.\n const floatingStyle: React.CSSProperties = {\n ...style,\n position: overlayProps.style?.position as React.CSSProperties['position'],\n top: overlayProps.style?.top,\n left: overlayProps.style?.left\n }\n const placementAttr = resolveDataPlacement(placement, resolvedPlacement)\n\n const { isMounted, phase } = useTransitionState({\n in: state.isOpen,\n mountOnEnter: true,\n nodeRef: floatingRef,\n unmountOnExit: true\n })\n\n // The tooltip is portaled, so it exists only once hydration has finished: until then the\n // trigger isn't described by it, or its HTML would refer to an id no element has.\n const hydrated = useHydrated()\n\n return (\n <>\n {triggerElement\n ? renderSlotted(\n triggerElement,\n mergeProps(\n hydrated ? triggerProps : { ...triggerProps, 'aria-describedby': undefined },\n hydrated && isHeld && state.isOpen\n ? { 'aria-describedby': tooltipTriggerProps.id }\n : {}\n ),\n triggerRef\n )\n : children}\n <Portal container={portalContainer}>\n {isMounted && (\n <div\n {...mergeProps(tooltipTriggerProps, tooltipProps, rest)}\n className={classNames(\n 'tooltip cx-tooltip-auto',\n getOverlayTransitionClass(phase),\n className\n )}\n data-cx-placement={placementAttr}\n ref={forkedFloatingRef}\n style={floatingStyle}\n >\n <div\n className=\"tooltip-arrow\"\n {...arrowProps}\n style={getOverlayArrowStyle(arrowProps)}\n ></div>\n <div className=\"tooltip-inner\">{content}</div>\n </div>\n )}\n </Portal>\n </>\n )\n})\n\nTooltip.displayName = 'Tooltip'\n"],"mappings":"8oBA8EA,MAAa,EAAU,EAAyC,SAC9D,CACE,WACA,YACA,UACA,iBACA,YAAY,MACZ,OAAQ,EAAa,CAAC,EAAG,CAAC,EAC1B,SACA,SACA,kBACA,QACA,UACA,UACA,GAAG,GAEL,EACA,CACA,IAAM,EAAW,EAAuB,IAAI,EACtC,EAAa,EAA2B,IAAI,EAC5C,EAAc,EAAuB,IAAI,EACzC,EAAoB,EAAa,EAAK,CAAW,EAKjD,EAAiB,EAAgB,EAAU,SAAS,EAKpD,EAAQ,EAAuB,CACnC,GAAG,EAAkB,CAAE,iBAAgB,kBAAiB,SAAQ,EAAG,SAAS,EAC5E,UACA,MAAO,EACP,WAAY,CACd,CAAC,EAMK,EAAS,IAAY,IAAA,IAAa,CAAC,EACnC,CAAE,eAAc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