@chassis-ui/react 0.4.1 → 0.5.1
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/README.md +7 -6
- package/dist/accordion.d.ts +1 -1
- package/dist/accordion.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/autocomplete.d.ts +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-group.d.ts +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.d.ts +2 -2
- 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 +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-input.d.ts +1 -1
- package/dist/chip-input.js +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.js +1 -1
- package/dist/chunks/{Button-BuZ_GOHS.d.ts → Button-DblYVwl-.d.ts} +4 -2
- package/dist/chunks/Button-ZU-x1uN_.js +2 -0
- package/dist/chunks/Button-ZU-x1uN_.js.map +1 -0
- package/dist/chunks/Chip-C7QlFCvx.js +2 -0
- package/dist/chunks/Chip-C7QlFCvx.js.map +1 -0
- package/dist/chunks/CloseButton-BPUI5iGX.js +2 -0
- package/dist/chunks/CloseButton-BPUI5iGX.js.map +1 -0
- package/dist/chunks/ComboboxListBox-Db0rSM3w.js +2 -0
- package/dist/chunks/ComboboxListBox-Db0rSM3w.js.map +1 -0
- package/dist/chunks/DateField-4cdcwt0v.js +2 -0
- package/dist/chunks/DateField-4cdcwt0v.js.map +1 -0
- package/dist/chunks/FormHelp-B1eSoack.js +2 -0
- package/dist/chunks/FormHelp-B1eSoack.js.map +1 -0
- package/dist/chunks/FormLabel-CpzWYh6U.js +2 -0
- package/dist/chunks/FormLabel-CpzWYh6U.js.map +1 -0
- package/dist/chunks/{Icon-DLB1f88W.js → Icon-Dk5_q79o.js} +2 -2
- package/dist/chunks/Icon-Dk5_q79o.js.map +1 -0
- package/dist/chunks/Link-DE8NSAXJ.js +2 -0
- package/dist/chunks/Link-DE8NSAXJ.js.map +1 -0
- package/dist/chunks/Menu-BiE9CzNk.js +2 -0
- package/dist/chunks/Menu-BiE9CzNk.js.map +1 -0
- package/dist/chunks/{Menu-QeYOzrUL.d.ts → Menu-CCYshRuL.d.ts} +3 -2
- package/dist/chunks/MenuToggle-W-ZSHFwF.js +2 -0
- package/dist/chunks/MenuToggle-W-ZSHFwF.js.map +1 -0
- package/dist/chunks/Portal-BTDylxAi.js +2 -0
- package/dist/chunks/Portal-BTDylxAi.js.map +1 -0
- package/dist/chunks/RangeCalendar-mM3OeTlU.js +2 -0
- package/dist/chunks/RangeCalendar-mM3OeTlU.js.map +1 -0
- package/dist/chunks/VisuallyHidden-CGv-mBuQ.js +2 -0
- package/dist/chunks/VisuallyHidden-CGv-mBuQ.js.map +1 -0
- package/dist/chunks/accordion-BZlX2uk8.js +2 -0
- package/dist/chunks/accordion-BZlX2uk8.js.map +1 -0
- package/dist/chunks/alert-DSLg5MBb.js +2 -0
- package/dist/chunks/alert-DSLg5MBb.js.map +1 -0
- package/dist/chunks/autocomplete-Btcsjrh3.js +2 -0
- package/dist/chunks/autocomplete-Btcsjrh3.js.map +1 -0
- package/dist/chunks/avatar-BQBbcnk6.js +2 -0
- package/dist/chunks/avatar-BQBbcnk6.js.map +1 -0
- package/dist/chunks/{badge-D2oztCvs.js → badge-Ths1Qn1a.js} +2 -2
- package/dist/chunks/badge-Ths1Qn1a.js.map +1 -0
- package/dist/chunks/breadcrumb-BTiQikk-.js +2 -0
- package/dist/chunks/breadcrumb-BTiQikk-.js.map +1 -0
- package/dist/chunks/breakpoints-CGk8szzR.js.map +1 -1
- package/dist/chunks/button-group-CefkGeYL.js +2 -0
- package/dist/chunks/button-group-CefkGeYL.js.map +1 -0
- package/dist/chunks/card-CEQgHIaL.js +2 -0
- package/dist/chunks/card-CEQgHIaL.js.map +1 -0
- package/dist/chunks/carousel-DC-UGc6W.js +2 -0
- package/dist/chunks/carousel-DC-UGc6W.js.map +1 -0
- package/dist/chunks/checkbox-ko6CdtoT.js +2 -0
- package/dist/chunks/checkbox-ko6CdtoT.js.map +1 -0
- package/dist/chunks/chip-input-CugY8EOc.js +2 -0
- package/dist/chunks/chip-input-CugY8EOc.js.map +1 -0
- package/dist/chunks/{collapse--Go2Y73B.js → collapse-CBi3RWTf.js} +2 -2
- package/dist/chunks/collapse-CBi3RWTf.js.map +1 -0
- package/dist/chunks/color-input-C4zMWlvm.js +2 -0
- package/dist/chunks/color-input-C4zMWlvm.js.map +1 -0
- package/dist/chunks/colorClassNames-YzGWu6qm.js +2 -0
- package/dist/chunks/colorClassNames-YzGWu6qm.js.map +1 -0
- package/dist/chunks/combobox-DNqR4d3V.js +2 -0
- package/dist/chunks/combobox-DNqR4d3V.js.map +1 -0
- package/dist/chunks/context-DCg95BgR.js +2 -0
- package/dist/chunks/context-DCg95BgR.js.map +1 -0
- package/dist/chunks/context-HDVxTNPi.js +2 -0
- package/dist/chunks/context-HDVxTNPi.js.map +1 -0
- package/dist/chunks/context-menu-D3DNFN-P.js +2 -0
- package/dist/chunks/context-menu-D3DNFN-P.js.map +1 -0
- package/dist/chunks/datagrid-n9vFeXN1.js +2 -0
- package/dist/chunks/datagrid-n9vFeXN1.js.map +1 -0
- package/dist/chunks/datepicker-DqztYJD6.js +2 -0
- package/dist/chunks/datepicker-DqztYJD6.js.map +1 -0
- package/dist/chunks/{dialogTransition-i9vw0i2Z.js → dialogTransition-C8fYTsSa.js} +2 -2
- package/dist/chunks/dialogTransition-C8fYTsSa.js.map +1 -0
- package/dist/chunks/direction-LN6uwsK5.js.map +1 -1
- package/dist/chunks/divider-C1-NoKMV.js +2 -0
- package/dist/chunks/divider-C1-NoKMV.js.map +1 -0
- package/dist/chunks/drawer-CRv9jmbp.js +2 -0
- package/dist/chunks/drawer-CRv9jmbp.js.map +1 -0
- package/dist/chunks/file-input-D_Gl1h-T.js +2 -0
- package/dist/chunks/file-input-D_Gl1h-T.js.map +1 -0
- package/dist/chunks/{flex-B52oLCCC.js → flex-C2jV5LyV.js} +2 -2
- package/dist/chunks/flex-C2jV5LyV.js.map +1 -0
- package/dist/chunks/floating-input-D4gWFfOU.js +2 -0
- package/dist/chunks/floating-input-D4gWFfOU.js.map +1 -0
- package/dist/chunks/focus-ring-Bs80iIBN.js +2 -0
- package/dist/chunks/focus-ring-Bs80iIBN.js.map +1 -0
- package/dist/chunks/focusRedirect-CrBl4p_n.js +2 -0
- package/dist/chunks/focusRedirect-CrBl4p_n.js.map +1 -0
- package/dist/chunks/form-CPS2eNw1.js +2 -0
- package/dist/chunks/form-CPS2eNw1.js.map +1 -0
- package/dist/chunks/{form-field-CNPGTMiW.js → form-field-Bcx96ezd.js} +2 -2
- package/dist/chunks/form-field-Bcx96ezd.js.map +1 -0
- package/dist/chunks/grid-CkdPftit.js +2 -0
- package/dist/chunks/grid-CkdPftit.js.map +1 -0
- package/dist/chunks/icon-CVD3rTr-.js +2 -0
- package/dist/chunks/icon-CVD3rTr-.js.map +1 -0
- package/dist/chunks/iconSlot-DU_WcSL_.js +2 -0
- package/dist/chunks/iconSlot-DU_WcSL_.js.map +1 -0
- package/dist/chunks/{index-91YA-jkp.d.ts → index-3JVLrDHv.d.ts} +11 -3
- package/dist/chunks/{index-DMbdEm__.d.ts → index-5mW1Y9Lm.d.ts} +7 -4
- package/dist/chunks/{index-Cc4SSslb.d.ts → index-5qsV1-cc.d.ts} +3 -3
- package/dist/chunks/{index-CYvVmTPR.d.ts → index-6PnrAJmb.d.ts} +4 -4
- package/dist/chunks/{index-BA-raEMm.d.ts → index-B5f6haU-.d.ts} +2 -2
- package/dist/chunks/{index-4cKG9KWB.d.ts → index-B8OIYfGw.d.ts} +2 -2
- package/dist/chunks/{index-CjT_4IZx.d.ts → index-BAvt_oPe.d.ts} +14 -5
- package/dist/chunks/{index-DtbUXxjz.d.ts → index-BB8UNxnM.d.ts} +2 -2
- package/dist/chunks/{index-aRdgpeRb.d.ts → index-BEAZrhyV.d.ts} +2 -2
- package/dist/chunks/{index-BOx8v-oT.d.ts → index-BISMaKaC.d.ts} +14 -2
- package/dist/chunks/{index-DtvHH_Mb.d.ts → index-BOroLDDZ.d.ts} +2 -2
- package/dist/chunks/{index-C4Dks__B.d.ts → index-BZpHSGlk.d.ts} +2 -2
- package/dist/chunks/{index-C9gzVqwX.d.ts → index-BbZzaApz.d.ts} +2 -2
- package/dist/chunks/{index-DAoPg59I.d.ts → index-Bca_HQWF.d.ts} +7 -3
- package/dist/chunks/{index-B0-8n-Gs.d.ts → index-Bl-_sC4y.d.ts} +12 -4
- package/dist/chunks/{index-BSLneLYu.d.ts → index-BxJ6Vrhm.d.ts} +2 -2
- package/dist/chunks/{index-CTpwB1yR.d.ts → index-BxrIOrAc.d.ts} +11 -6
- package/dist/chunks/{index-DHcztR18.d.ts → index-ByBbC4Jh.d.ts} +3 -3
- package/dist/chunks/{index-DHGgezXU.d.ts → index-C-IrFdKe.d.ts} +2 -2
- package/dist/chunks/{index-B8uaSJA9.d.ts → index-C0g8NSXY.d.ts} +13 -4
- package/dist/chunks/{index-CFnQubsV.d.ts → index-C1RKm3hQ.d.ts} +5 -3
- package/dist/chunks/{index-BxROljJI.d.ts → index-C3qqMzs5.d.ts} +2 -2
- package/dist/chunks/{index-Dcc_W6Kv.d.ts → index-C6F3DQCd.d.ts} +2 -2
- package/dist/chunks/{index-x0vZRyoU.d.ts → index-CEPAXElM.d.ts} +4 -3
- package/dist/chunks/{index-DaHQdNul.d.ts → index-COVY45gK.d.ts} +2 -2
- package/dist/chunks/{index-DJfga0Ce.d.ts → index-COq1jJ6Y.d.ts} +2 -2
- package/dist/chunks/{index-HrKN6s8z.d.ts → index-CSRGr7pU.d.ts} +2 -2
- package/dist/chunks/{index-B1kw0jzM.d.ts → index-CTNqEMug.d.ts} +6 -3
- package/dist/chunks/{index-6uob77s9.d.ts → index-CW94lG-e.d.ts} +7 -4
- package/dist/chunks/{index-Ddd7iWfm.d.ts → index-CY-A60p6.d.ts} +2 -2
- package/dist/chunks/{index-lSPcxiii.d.ts → index-CbcFEGCh.d.ts} +5 -3
- package/dist/chunks/{index-9rQeMqVI.d.ts → index-Ce0f-bDM.d.ts} +2 -2
- package/dist/chunks/{index-Ci7AEgEc.d.ts → index-Cf3gHDjh.d.ts} +2 -2
- package/dist/chunks/{index-BVGGIaPX.d.ts → index-Cm3rPbI1.d.ts} +10 -5
- package/dist/chunks/{index-DPCwFiJL.d.ts → index-CmljNQ8F.d.ts} +2 -2
- package/dist/chunks/{index-DQImhbhy.d.ts → index-Cpifcw5a.d.ts} +2 -2
- package/dist/chunks/{index-B_UzbGOa.d.ts → index-Ctf5hLue.d.ts} +3 -3
- package/dist/chunks/{index-DM01FX3a.d.ts → index-D0Dhs7YI.d.ts} +18 -6
- package/dist/chunks/{index-BAsbRx5n.d.ts → index-D5KJRfMg.d.ts} +2 -2
- package/dist/chunks/{index-Bz8MDq0H.d.ts → index-DD6Z5NW-.d.ts} +7 -4
- package/dist/chunks/{index-Dfg4Ftb8.d.ts → index-DFKBJxqA.d.ts} +7 -4
- package/dist/chunks/{index-BMkbJVHg.d.ts → index-DGGyvlEQ.d.ts} +3 -3
- package/dist/chunks/{index-YJ9QdBuq.d.ts → index-DOxVxbb9.d.ts} +6 -5
- package/dist/chunks/{index-CxjNw4ss.d.ts → index-DVK16_FU.d.ts} +2 -2
- package/dist/chunks/{index-DHOG_rjE.d.ts → index-DVfH_2Ma.d.ts} +7 -4
- package/dist/chunks/{index-0jbACjYQ.d.ts → index-DXBkVdWc.d.ts} +2 -2
- package/dist/chunks/{index-CsARGAzD.d.ts → index-Davd7Cue.d.ts} +10 -5
- package/dist/chunks/{index-Bi8FFadV.d.ts → index-Dc50UjJy.d.ts} +13 -4
- package/dist/chunks/{index-BF3OWUVc.d.ts → index-Dci43Xhl.d.ts} +3 -3
- package/dist/chunks/{index-B2K-O9kl.d.ts → index-DdFipHYL.d.ts} +5 -4
- package/dist/chunks/{index-Du9fBqkT.d.ts → index-DmmLEHVo.d.ts} +2 -2
- package/dist/chunks/{index-Dzga1f4w.d.ts → index-DsU3M0oP.d.ts} +2 -2
- package/dist/chunks/{index-DP5xugE-.d.ts → index-Es9I0fIS.d.ts} +3 -3
- package/dist/chunks/{index-CqZ68Z8R.d.ts → index-HNUhTj5e.d.ts} +25 -6
- package/dist/chunks/{index-CCXJXToc.d.ts → index-OnB4_h6x.d.ts} +7 -4
- package/dist/chunks/{index-CftERHnE.d.ts → index-QeI-KSng.d.ts} +3 -2
- package/dist/chunks/{index-BLS1jhSJ.d.ts → index-RyE80_VH.d.ts} +2 -2
- package/dist/chunks/{index-CIwzgZJi.d.ts → index-UjmJQRaG.d.ts} +2 -2
- package/dist/chunks/{index-B19ZH3fm.d.ts → index-YzIZhXZ1.d.ts} +2 -2
- package/dist/chunks/{index-CHQR8x8_.d.ts → index-Z_5ArZpE.d.ts} +4 -2
- package/dist/chunks/{index-BNf0jIIL.d.ts → index-doVyX-4i.d.ts} +7 -4
- package/dist/chunks/{index-NGgDkhyn.d.ts → index-mLtlx-d9.d.ts} +6 -3
- package/dist/chunks/{index-g74gO0pc.d.ts → index-sT0Hnr_n.d.ts} +12 -10
- package/dist/chunks/{index-Bkj17NEQ.d.ts → index-t3k_T3Dv.d.ts} +2 -2
- package/dist/chunks/{index-BfEJYF4c.d.ts → index-yVsGuikp.d.ts} +2 -2
- package/dist/chunks/input-adorn-DV9tuWXh.js +2 -0
- package/dist/chunks/input-adorn-DV9tuWXh.js.map +1 -0
- package/dist/chunks/input-group-YB_zoKud.js +2 -0
- package/dist/chunks/input-group-YB_zoKud.js.map +1 -0
- package/dist/chunks/insideEvents-CWcNrMu7.js +2 -0
- package/dist/chunks/insideEvents-CWcNrMu7.js.map +1 -0
- package/dist/chunks/lazyElement-tfMG21pZ.js.map +1 -1
- package/dist/chunks/list-BPBZR66Y.js +2 -0
- package/dist/chunks/list-BPBZR66Y.js.map +1 -0
- package/dist/chunks/menu-Bqlhottl.js +2 -0
- package/dist/chunks/menu-Bqlhottl.js.map +1 -0
- package/dist/chunks/modal-CHvsDTyl.js +2 -0
- package/dist/chunks/modal-CHvsDTyl.js.map +1 -0
- package/dist/chunks/nav-B4U_Hqs7.js +2 -0
- package/dist/chunks/nav-B4U_Hqs7.js.map +1 -0
- package/dist/chunks/nav-overflow-GWARvoQZ.js +2 -0
- package/dist/chunks/nav-overflow-GWARvoQZ.js.map +1 -0
- package/dist/chunks/navOverflow-C_QJmkPM.js +2 -0
- package/dist/chunks/navOverflow-C_QJmkPM.js.map +1 -0
- package/dist/chunks/{navVariant-DeGTk9B7.js → navVariant-D4wiKS8I.js} +2 -2
- package/dist/chunks/navVariant-D4wiKS8I.js.map +1 -0
- package/dist/chunks/navbar-C7dO0YRs.js +2 -0
- package/dist/chunks/navbar-C7dO0YRs.js.map +1 -0
- package/dist/chunks/notification-oIrUtDhl.js +2 -0
- package/dist/chunks/notification-oIrUtDhl.js.map +1 -0
- package/dist/chunks/number-field-ChPTSBwI.js +2 -0
- package/dist/chunks/number-field-ChPTSBwI.js.map +1 -0
- package/dist/chunks/otp-input-DUtCMg8P.js +2 -0
- package/dist/chunks/otp-input-DUtCMg8P.js.map +1 -0
- package/dist/chunks/{overlayPlacement-BtS90IVf.js → overlayPlacement-Q6bcbXA5.js} +2 -2
- package/dist/chunks/overlayPlacement-Q6bcbXA5.js.map +1 -0
- package/dist/chunks/overlayStack-BXtTGCRm.js +2 -0
- package/dist/chunks/overlayStack-BXtTGCRm.js.map +1 -0
- package/dist/chunks/pagination-Dvz8lccd.js +2 -0
- package/dist/chunks/pagination-Dvz8lccd.js.map +1 -0
- package/dist/chunks/{password-strength-DDK8pHRq.js → password-strength-Qg5GHBmu.js} +2 -2
- package/dist/chunks/password-strength-Qg5GHBmu.js.map +1 -0
- package/dist/chunks/placeholder-SPoVRkKE.js +2 -0
- package/dist/chunks/placeholder-SPoVRkKE.js.map +1 -0
- package/dist/chunks/polymorphic-CZIFszAy.js +2 -0
- package/dist/chunks/polymorphic-CZIFszAy.js.map +1 -0
- package/dist/chunks/popover-C_32yD9W.js +2 -0
- package/dist/chunks/popover-C_32yD9W.js.map +1 -0
- package/dist/chunks/progress-CiSJDNwx.js +2 -0
- package/dist/chunks/progress-CiSJDNwx.js.map +1 -0
- package/dist/chunks/radio-C42F_5OD.js +2 -0
- package/dist/chunks/radio-C42F_5OD.js.map +1 -0
- package/dist/chunks/range-input-DeZq_9S7.js +2 -0
- package/dist/chunks/range-input-DeZq_9S7.js.map +1 -0
- package/dist/chunks/renderFormCheck-DvpfK_I4.js +2 -0
- package/dist/chunks/renderFormCheck-DvpfK_I4.js.map +1 -0
- package/dist/chunks/renderFormField-_6WswnEX.js +2 -0
- package/dist/chunks/renderFormField-_6WswnEX.js.map +1 -0
- package/dist/chunks/renderMenuItemContent-DNdj-Ukz.js +2 -0
- package/dist/chunks/renderMenuItemContent-DNdj-Ukz.js.map +1 -0
- package/dist/chunks/scrollspy-BEZEVyIw.js +2 -0
- package/dist/chunks/scrollspy-BEZEVyIw.js.map +1 -0
- package/dist/chunks/scrollspy-D_lPjb92.js.map +1 -1
- package/dist/chunks/search-field-OFsb3t4L.js +2 -0
- package/dist/chunks/search-field-OFsb3t4L.js.map +1 -0
- package/dist/chunks/select-DwyL6aqY.js +2 -0
- package/dist/chunks/select-DwyL6aqY.js.map +1 -0
- package/dist/chunks/skeleton-B2blJGWj.js +2 -0
- package/dist/chunks/skeleton-B2blJGWj.js.map +1 -0
- package/dist/chunks/slot-BQVx1Eew.js +2 -0
- package/dist/chunks/slot-BQVx1Eew.js.map +1 -0
- package/dist/chunks/spacingClassName-DVhk8m3P.js.map +1 -1
- package/dist/chunks/spinner-D8lQCW4u.js +2 -0
- package/dist/chunks/spinner-D8lQCW4u.js.map +1 -0
- package/dist/chunks/stack-DtzW54UK.js +2 -0
- package/dist/chunks/stack-DtzW54UK.js.map +1 -0
- package/dist/chunks/static-table-C7ZtFQ66.js +2 -0
- package/dist/chunks/static-table-C7ZtFQ66.js.map +1 -0
- package/dist/chunks/stepper-tSA84huJ.js +2 -0
- package/dist/chunks/stepper-tSA84huJ.js.map +1 -0
- package/dist/chunks/switch-cp3IZg3L.js +2 -0
- package/dist/chunks/switch-cp3IZg3L.js.map +1 -0
- package/dist/chunks/table-CBTg5Yuq.js +2 -0
- package/dist/chunks/table-CBTg5Yuq.js.map +1 -0
- package/dist/chunks/tableClassName-jRfRDXA3.js +2 -0
- package/dist/chunks/tableClassName-jRfRDXA3.js.map +1 -0
- package/dist/chunks/tabs-DMFSLjnV.js +2 -0
- package/dist/chunks/tabs-DMFSLjnV.js.map +1 -0
- package/dist/chunks/text-input-CR73x-8D.js +2 -0
- package/dist/chunks/text-input-CR73x-8D.js.map +1 -0
- package/dist/chunks/textarea-C-1cMyH4.js +2 -0
- package/dist/chunks/textarea-C-1cMyH4.js.map +1 -0
- package/dist/chunks/time-field-CbCfOQZz.js +2 -0
- package/dist/chunks/time-field-CbCfOQZz.js.map +1 -0
- package/dist/chunks/toast-Dd0J2e1z.js +2 -0
- package/dist/chunks/toast-Dd0J2e1z.js.map +1 -0
- package/dist/chunks/tooltip-CmKeQwYw.js +2 -0
- package/dist/chunks/tooltip-CmKeQwYw.js.map +1 -0
- package/dist/chunks/tree-DNj_EfUl.js +2 -0
- package/dist/chunks/tree-DNj_EfUl.js.map +1 -0
- package/dist/chunks/unhandledProps-9Kdj7WVf.js.map +1 -1
- package/dist/chunks/{useButtonSemantics-CILM_lhi.js → useButtonSemantics-B1SbGaDO.js} +2 -2
- package/dist/chunks/useButtonSemantics-B1SbGaDO.js.map +1 -0
- package/dist/chunks/useControllableState-CPUJxfKW.js.map +1 -1
- package/dist/chunks/useDialogElement-BfygWBPZ.js +2 -0
- package/dist/chunks/useDialogElement-BfygWBPZ.js.map +1 -0
- package/dist/chunks/useDialogTitle-DiB4YDGI.js +2 -0
- package/dist/chunks/useDialogTitle-DiB4YDGI.js.map +1 -0
- package/dist/chunks/useDisabledAnchorGuard-CH6df46a.js +2 -0
- package/dist/chunks/useDisabledAnchorGuard-CH6df46a.js.map +1 -0
- package/dist/chunks/useFloatingOverlay-BuiI_CCn.js +2 -0
- package/dist/chunks/useFloatingOverlay-BuiI_CCn.js.map +1 -0
- package/dist/chunks/useForkedRef-WoqMqsWE.js +2 -0
- package/dist/chunks/useForkedRef-WoqMqsWE.js.map +1 -0
- package/dist/chunks/useFormField-DH2tlc3e.js +2 -0
- package/dist/chunks/useFormField-DH2tlc3e.js.map +1 -0
- package/dist/chunks/useHeldBack-eeTfpa_t.js +2 -0
- package/dist/chunks/useHeldBack-eeTfpa_t.js.map +1 -0
- package/dist/chunks/useHydrated-Dud4JEwp.js +2 -0
- package/dist/chunks/useHydrated-Dud4JEwp.js.map +1 -0
- package/dist/chunks/useIsomorphicLayoutEffect-BbqRwuqn.js.map +1 -1
- package/dist/chunks/{useOpenStateProps-DykUbnPJ.js → useOpenStateProps-BhjSQ3f6.js} +2 -2
- package/dist/chunks/useOpenStateProps-BhjSQ3f6.js.map +1 -0
- package/dist/chunks/useOverlayMaxHeight-DTgbr4UQ.js +2 -0
- package/dist/chunks/useOverlayMaxHeight-DTgbr4UQ.js.map +1 -0
- package/dist/chunks/useRequiredValueInput-gYN8I-LY.js +2 -0
- package/dist/chunks/useRequiredValueInput-gYN8I-LY.js.map +1 -0
- package/dist/chunks/useToastRegionQueue-CuAMxAIA.js +2 -0
- package/dist/chunks/useToastRegionQueue-CuAMxAIA.js.map +1 -0
- package/dist/chunks/{useTransitionState-e5ToY7eX.js → useTransitionState-sQUQey74.js} +2 -2
- package/dist/chunks/useTransitionState-sQUQey74.js.map +1 -0
- package/dist/chunks/validationClassName-gRGs4KBm.js.map +1 -1
- package/dist/chunks/{visibleState-B_i1zHu2.js → visibleState-CWyQak65.js} +2 -2
- package/dist/chunks/visibleState-CWyQak65.js.map +1 -0
- package/dist/close-button.d.ts +1 -1
- package/dist/close-button.js +1 -1
- package/dist/collapse.d.ts +1 -1
- package/dist/collapse.js +1 -1
- package/dist/color-input.d.ts +1 -1
- package/dist/color-input.js +1 -1
- package/dist/combobox.d.ts +1 -1
- package/dist/combobox.js +1 -1
- package/dist/context-menu.d.ts +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/datagrid.d.ts +1 -1
- package/dist/datagrid.js +1 -1
- package/dist/datepicker.d.ts +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/divider.d.ts +1 -1
- package/dist/divider.js +1 -1
- package/dist/drawer.d.ts +1 -1
- package/dist/drawer.js +1 -1
- package/dist/file-input.d.ts +1 -1
- package/dist/file-input.js +1 -1
- package/dist/flex.d.ts +1 -1
- package/dist/flex.js +1 -1
- package/dist/floating-input.d.ts +1 -1
- package/dist/floating-input.js +1 -1
- package/dist/form-field.d.ts +1 -1
- package/dist/form-field.js +1 -1
- package/dist/form.d.ts +1 -1
- package/dist/form.js +1 -1
- package/dist/grid.d.ts +1 -1
- package/dist/grid.js +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/icon.js +1 -1
- package/dist/index.d.ts +68 -68
- package/dist/index.js +1 -1
- package/dist/input-adorn.d.ts +1 -1
- package/dist/input-adorn.js +1 -1
- package/dist/input-group.d.ts +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 -2
- 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 +1 -1
- package/dist/nav-overflow.js +1 -1
- package/dist/nav.d.ts +1 -1
- 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 +1 -1
- package/dist/number-field.js +1 -1
- package/dist/otp-input.d.ts +1 -1
- 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 +1 -1
- package/dist/portal.js +1 -1
- package/dist/progress.d.ts +1 -1
- package/dist/progress.js +1 -1
- package/dist/radio.d.ts +1 -1
- package/dist/radio.js +1 -1
- package/dist/range-input.d.ts +1 -1
- package/dist/range-input.js +1 -1
- package/dist/scrollspy.d.ts +1 -1
- package/dist/scrollspy.js +1 -1
- package/dist/search-field.d.ts +1 -1
- package/dist/search-field.js +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.d.ts +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/spinner.d.ts +1 -1
- package/dist/spinner.js +1 -1
- package/dist/stack.d.ts +1 -1
- package/dist/stack.js +1 -1
- package/dist/static-table.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.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-input.d.ts +1 -1
- package/dist/text-input.js +1 -1
- package/dist/textarea.d.ts +1 -1
- package/dist/textarea.js +1 -1
- package/dist/time-field.d.ts +1 -1
- package/dist/time-field.js +1 -1
- 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 +1 -1
- package/dist/tree.js +1 -1
- package/dist/visually-hidden.d.ts +1 -1
- package/dist/visually-hidden.js +1 -1
- package/package.json +29 -28
- package/dist/chunks/Button-BoymWE-L.js +0 -2
- package/dist/chunks/Button-BoymWE-L.js.map +0 -1
- package/dist/chunks/Chip-DCaWaBqo.js +0 -2
- package/dist/chunks/Chip-DCaWaBqo.js.map +0 -1
- package/dist/chunks/CloseButton-DPgQztE0.js +0 -2
- package/dist/chunks/CloseButton-DPgQztE0.js.map +0 -1
- package/dist/chunks/ComboboxListBox-Cm3L1ULl.js +0 -2
- package/dist/chunks/ComboboxListBox-Cm3L1ULl.js.map +0 -1
- package/dist/chunks/DateSegment-2agXAd0f.js +0 -2
- package/dist/chunks/DateSegment-2agXAd0f.js.map +0 -1
- package/dist/chunks/FormHelp-AE6_iSLJ.js +0 -2
- package/dist/chunks/FormHelp-AE6_iSLJ.js.map +0 -1
- package/dist/chunks/FormLabel-CYcQiFUI.js +0 -2
- package/dist/chunks/FormLabel-CYcQiFUI.js.map +0 -1
- package/dist/chunks/Icon-DLB1f88W.js.map +0 -1
- package/dist/chunks/Link-DyZyAQFj.js +0 -2
- package/dist/chunks/Link-DyZyAQFj.js.map +0 -1
- package/dist/chunks/Menu-CSBg2Zmc.js +0 -2
- package/dist/chunks/Menu-CSBg2Zmc.js.map +0 -1
- package/dist/chunks/MenuToggle-7RQ0dmtZ.js +0 -2
- package/dist/chunks/MenuToggle-7RQ0dmtZ.js.map +0 -1
- package/dist/chunks/Portal-CgeR1WXV.js +0 -2
- package/dist/chunks/Portal-CgeR1WXV.js.map +0 -1
- package/dist/chunks/RangeCalendar-BJl-j4W2.js +0 -2
- package/dist/chunks/RangeCalendar-BJl-j4W2.js.map +0 -1
- package/dist/chunks/VisuallyHidden-C2dM7HhC.js +0 -2
- package/dist/chunks/VisuallyHidden-C2dM7HhC.js.map +0 -1
- package/dist/chunks/accordion-B8UWyvQB.js +0 -2
- package/dist/chunks/accordion-B8UWyvQB.js.map +0 -1
- package/dist/chunks/alert-3kTBfWFw.js +0 -2
- package/dist/chunks/alert-3kTBfWFw.js.map +0 -1
- package/dist/chunks/autocomplete-Baf9VSHN.js +0 -2
- package/dist/chunks/autocomplete-Baf9VSHN.js.map +0 -1
- package/dist/chunks/avatar-MklqAKcz.js +0 -2
- package/dist/chunks/avatar-MklqAKcz.js.map +0 -1
- package/dist/chunks/badge-D2oztCvs.js.map +0 -1
- package/dist/chunks/breadcrumb-CHxTiZLt.js +0 -2
- package/dist/chunks/breadcrumb-CHxTiZLt.js.map +0 -1
- package/dist/chunks/button-group-BGppPrIv.js +0 -2
- package/dist/chunks/button-group-BGppPrIv.js.map +0 -1
- package/dist/chunks/card-CTP9K8xG.js +0 -2
- package/dist/chunks/card-CTP9K8xG.js.map +0 -1
- package/dist/chunks/carousel-fTVPqnSV.js +0 -2
- package/dist/chunks/carousel-fTVPqnSV.js.map +0 -1
- package/dist/chunks/checkbox-ZyQn5Ku5.js +0 -2
- package/dist/chunks/checkbox-ZyQn5Ku5.js.map +0 -1
- package/dist/chunks/chip-input-BpVDRERg.js +0 -2
- package/dist/chunks/chip-input-BpVDRERg.js.map +0 -1
- package/dist/chunks/collapse--Go2Y73B.js.map +0 -1
- package/dist/chunks/color-input-Bwl5ef5B.js +0 -2
- package/dist/chunks/color-input-Bwl5ef5B.js.map +0 -1
- package/dist/chunks/colorClassNames-CEh5Yzfp.js +0 -2
- package/dist/chunks/colorClassNames-CEh5Yzfp.js.map +0 -1
- package/dist/chunks/combobox-Bp1tIaiW.js +0 -2
- package/dist/chunks/combobox-Bp1tIaiW.js.map +0 -1
- package/dist/chunks/context-menu-B4a0tS-h.js +0 -2
- package/dist/chunks/context-menu-B4a0tS-h.js.map +0 -1
- package/dist/chunks/datagrid-DOYxx0sF.js +0 -3
- package/dist/chunks/datagrid-DOYxx0sF.js.map +0 -1
- package/dist/chunks/datepicker-bOiM_zhJ.js +0 -2
- package/dist/chunks/datepicker-bOiM_zhJ.js.map +0 -1
- package/dist/chunks/dialogTransition-i9vw0i2Z.js.map +0 -1
- package/dist/chunks/divider-CjbF4OfA.js +0 -2
- package/dist/chunks/divider-CjbF4OfA.js.map +0 -1
- package/dist/chunks/drawer-C7Tz4XU_.js +0 -2
- package/dist/chunks/drawer-C7Tz4XU_.js.map +0 -1
- package/dist/chunks/file-input-CDM6qrmV.js +0 -2
- package/dist/chunks/file-input-CDM6qrmV.js.map +0 -1
- package/dist/chunks/flex-B52oLCCC.js.map +0 -1
- package/dist/chunks/floating-input-DmSZZc27.js +0 -2
- package/dist/chunks/floating-input-DmSZZc27.js.map +0 -1
- package/dist/chunks/focus-ring-SR_LwaN7.js +0 -2
- package/dist/chunks/focus-ring-SR_LwaN7.js.map +0 -1
- package/dist/chunks/focusRedirect-BrvK3U_o.js +0 -2
- package/dist/chunks/focusRedirect-BrvK3U_o.js.map +0 -1
- package/dist/chunks/form-GpdAyWWi.js +0 -2
- package/dist/chunks/form-GpdAyWWi.js.map +0 -1
- package/dist/chunks/form-field-CNPGTMiW.js.map +0 -1
- package/dist/chunks/grid-C7tO-ppc.js +0 -2
- package/dist/chunks/grid-C7tO-ppc.js.map +0 -1
- package/dist/chunks/icon-BQsT6YtE.js +0 -2
- package/dist/chunks/icon-BQsT6YtE.js.map +0 -1
- package/dist/chunks/iconSlot-BNu2MrFI.js +0 -2
- package/dist/chunks/iconSlot-BNu2MrFI.js.map +0 -1
- package/dist/chunks/input-adorn-DwdX-jxA.js +0 -2
- package/dist/chunks/input-adorn-DwdX-jxA.js.map +0 -1
- package/dist/chunks/input-group-Cuiuf4Dl.js +0 -2
- package/dist/chunks/input-group-Cuiuf4Dl.js.map +0 -1
- package/dist/chunks/list-07e2a1Ym.js +0 -2
- package/dist/chunks/list-07e2a1Ym.js.map +0 -1
- package/dist/chunks/menu-Upf6P-2P.js +0 -2
- package/dist/chunks/menu-Upf6P-2P.js.map +0 -1
- package/dist/chunks/modal-bgDR29Jh.js +0 -2
- package/dist/chunks/modal-bgDR29Jh.js.map +0 -1
- package/dist/chunks/nav-DI6oEULI.js +0 -2
- package/dist/chunks/nav-DI6oEULI.js.map +0 -1
- package/dist/chunks/nav-overflow-DlLer6EK.js +0 -2
- package/dist/chunks/nav-overflow-DlLer6EK.js.map +0 -1
- package/dist/chunks/navOverflow-B5krZe6D.js +0 -2
- package/dist/chunks/navOverflow-B5krZe6D.js.map +0 -1
- package/dist/chunks/navVariant-DeGTk9B7.js.map +0 -1
- package/dist/chunks/navbar-DxIwt0sc.js +0 -2
- package/dist/chunks/navbar-DxIwt0sc.js.map +0 -1
- package/dist/chunks/notification-Dbci5Ka3.js +0 -2
- package/dist/chunks/notification-Dbci5Ka3.js.map +0 -1
- package/dist/chunks/number-field-IBIX2IWH.js +0 -2
- package/dist/chunks/number-field-IBIX2IWH.js.map +0 -1
- package/dist/chunks/otp-input-ws393uPB.js +0 -2
- package/dist/chunks/otp-input-ws393uPB.js.map +0 -1
- package/dist/chunks/overlayPlacement-BtS90IVf.js.map +0 -1
- package/dist/chunks/pagination-BREQp-ZC.js +0 -2
- package/dist/chunks/pagination-BREQp-ZC.js.map +0 -1
- package/dist/chunks/password-strength-DDK8pHRq.js.map +0 -1
- package/dist/chunks/placeholder-DhNpUJqv.js +0 -2
- package/dist/chunks/placeholder-DhNpUJqv.js.map +0 -1
- package/dist/chunks/polymorphic-BhGNZQja.js +0 -2
- package/dist/chunks/polymorphic-BhGNZQja.js.map +0 -1
- package/dist/chunks/popover-Bdg8D4sm.js +0 -2
- package/dist/chunks/popover-Bdg8D4sm.js.map +0 -1
- package/dist/chunks/progress-BqgWezdG.js +0 -2
- package/dist/chunks/progress-BqgWezdG.js.map +0 -1
- package/dist/chunks/radio-B6gJdtoN.js +0 -2
- package/dist/chunks/radio-B6gJdtoN.js.map +0 -1
- package/dist/chunks/range-input-CT_8TKL7.js +0 -2
- package/dist/chunks/range-input-CT_8TKL7.js.map +0 -1
- package/dist/chunks/renderFormCheck-DN_-V62U.js +0 -2
- package/dist/chunks/renderFormCheck-DN_-V62U.js.map +0 -1
- package/dist/chunks/renderFormField-Brkw1yA6.js +0 -2
- package/dist/chunks/renderFormField-Brkw1yA6.js.map +0 -1
- package/dist/chunks/renderMenuItemContent-DUezZrpj.js +0 -2
- package/dist/chunks/renderMenuItemContent-DUezZrpj.js.map +0 -1
- package/dist/chunks/scrollspy-C2HmrnZ4.js +0 -2
- package/dist/chunks/scrollspy-C2HmrnZ4.js.map +0 -1
- package/dist/chunks/search-field--nDoCI_E.js +0 -2
- package/dist/chunks/search-field--nDoCI_E.js.map +0 -1
- package/dist/chunks/select-BwJIfv9f.js +0 -2
- package/dist/chunks/select-BwJIfv9f.js.map +0 -1
- package/dist/chunks/skeleton-Bjv9gGd3.js +0 -2
- package/dist/chunks/skeleton-Bjv9gGd3.js.map +0 -1
- package/dist/chunks/slot-CNhFZdHF.js +0 -2
- package/dist/chunks/slot-CNhFZdHF.js.map +0 -1
- package/dist/chunks/spinner-DBuvQvMR.js +0 -2
- package/dist/chunks/spinner-DBuvQvMR.js.map +0 -1
- package/dist/chunks/stack-DK5F53VT.js +0 -2
- package/dist/chunks/stack-DK5F53VT.js.map +0 -1
- package/dist/chunks/static-table-uu297Liz.js +0 -2
- package/dist/chunks/static-table-uu297Liz.js.map +0 -1
- package/dist/chunks/stepper-CVXMJ2yg.js +0 -2
- package/dist/chunks/stepper-CVXMJ2yg.js.map +0 -1
- package/dist/chunks/switch-C6s3LxEv.js +0 -2
- package/dist/chunks/switch-C6s3LxEv.js.map +0 -1
- package/dist/chunks/table-DPLOygg0.js +0 -2
- package/dist/chunks/table-DPLOygg0.js.map +0 -1
- package/dist/chunks/tableClassName-DleBjOj2.js +0 -2
- package/dist/chunks/tableClassName-DleBjOj2.js.map +0 -1
- package/dist/chunks/tabs-91T7-8qq.js +0 -2
- package/dist/chunks/tabs-91T7-8qq.js.map +0 -1
- package/dist/chunks/text-input-B4pTv6SU.js +0 -2
- package/dist/chunks/text-input-B4pTv6SU.js.map +0 -1
- package/dist/chunks/textarea-1A1nABQE.js +0 -2
- package/dist/chunks/textarea-1A1nABQE.js.map +0 -1
- package/dist/chunks/time-field-B3MA7ED_.js +0 -2
- package/dist/chunks/time-field-B3MA7ED_.js.map +0 -1
- package/dist/chunks/toast-CGHl3-oU.js +0 -2
- package/dist/chunks/toast-CGHl3-oU.js.map +0 -1
- package/dist/chunks/tooltip-Bc-u6nIW.js +0 -2
- package/dist/chunks/tooltip-Bc-u6nIW.js.map +0 -1
- package/dist/chunks/tree-Cql1veeZ.js +0 -2
- package/dist/chunks/tree-Cql1veeZ.js.map +0 -1
- package/dist/chunks/useButtonSemantics-CILM_lhi.js.map +0 -1
- package/dist/chunks/useDialogElement-CgOnJAzu.js +0 -2
- package/dist/chunks/useDialogElement-CgOnJAzu.js.map +0 -1
- package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js +0 -2
- package/dist/chunks/useDisabledAnchorGuard-Cz58UCXy.js.map +0 -1
- package/dist/chunks/useFloatingOverlay-DLIvwx-8.js +0 -2
- package/dist/chunks/useFloatingOverlay-DLIvwx-8.js.map +0 -1
- package/dist/chunks/useForkedRef-DVEfT-KI.js +0 -2
- package/dist/chunks/useForkedRef-DVEfT-KI.js.map +0 -1
- package/dist/chunks/useFormField-BOqmBTC4.js +0 -2
- package/dist/chunks/useFormField-BOqmBTC4.js.map +0 -1
- package/dist/chunks/useOpenStateProps-DykUbnPJ.js.map +0 -1
- package/dist/chunks/useToastRegionQueue-CIV5SdiE.js +0 -2
- package/dist/chunks/useToastRegionQueue-CIV5SdiE.js.map +0 -1
- package/dist/chunks/useTransitionState-e5ToY7eX.js.map +0 -1
- package/dist/chunks/visibleState-B_i1zHu2.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focus-ring-SR_LwaN7.js","names":[],"sources":["../../src/utils/suppressFocusRingGlobally.ts"],"sourcesContent":["// Chromium/WebKit's `:focus-visible` heuristic has no interaction history to consult on the very\n// first focus event of a page load, so a genuine pointer press can still paint a focus ring as if\n// it came from the keyboard — most visible on whatever element happens to be the first thing a\n// visitor clicks. A single capture-phase `pointerdown` listener on `document`, installed once (see\n// `install` below, called for its side effect from `index.ts`), preemptively suppresses the\n// outline on whatever focusable element the press is about to focus — before the browser's own\n// default action grants focus and paints the ring for it — then restores it on blur. Safe to run\n// on every press, not just the page's first: if the browser was already going to correctly\n// withhold the ring, this suppress/restore cycle is a no-op within the same frame.\n//\n// Mirrors react-aria's own `@react-aria/interactions` global modality tracking (one document-level\n// listener rather than one per component/instance) without switching this library's focus rings\n// from chassis-css's native `:focus-visible` CSS to JS-driven state — react-aria's `isFocusVisible`\n// is consumed by applying a class/attribute, which would fork focus-ring styling from the vanilla,\n// non-React product chassis-css also ships. Deliberately unscoped to this library's own markup, for\n// the same reason react-aria's own fix is unscoped: the browser bug isn't specific to any one\n// component library, and a page generally wants one consistent focus-ring policy for every\n// focusable element on it, not just the subset a component library happens to own.\nconst FOCUSABLE_SELECTOR = 'a[href], button, input, select, textarea, [tabindex]'\n\nconst suppressed = new WeakSet<HTMLElement>()\n\n// Which ring-painting style properties a given call suppresses. The global `pointerdown` path\n// only ever needs `outline` (that's the whole of chassis-css's `:focus-visible` ring); a\n// script-driven focus redirect also clears `boxShadow`, since an element it lands on may carry a\n// ring painted that way — see `focusRedirect`.\nexport type SuppressibleStyle = 'outline' | 'boxShadow'\n\nconst DEFAULT_STYLES: readonly SuppressibleStyle[] = ['outline']\n\n// Shared by the global `pointerdown` listener below and by call sites that move focus themselves\n// via script (e.g. `RangeCalendar`'s hover-to-preview-a-range, which calls `element.focus()` from\n// a `pointerenter` handler — outside the `pointerdown` this module otherwise listens for, and\n// `focusRedirect`, which delegates here rather than reimplementing the save/restore cycle).\nexport function suppressFocusRing(\n el: HTMLElement,\n styles: readonly SuppressibleStyle[] = DEFAULT_STYLES\n): void {\n // chassis-css's `.form-input` placeholder deliberately grants its focus ring on `:focus-within`\n // as well as `:focus-visible` (see `_form.scss`), unlike the `:focus-visible`-only policy this\n // module otherwise mirrors for buttons/links/checks/etc. — a form field is meant to show its\n // ring regardless of whether the focus came from a click or the keyboard, so the very\n // first-press-of-page-load quirk this module works around isn't a bug for `.form-input` in the\n // first place: forcing its outline off here would fight, then correctly-but-uselessly restore,\n // an outline chassis-css wants visible the whole time the field is focused.\n if (el.classList.contains('form-input')) return\n // `suppressed` guards re-entrancy: a second call for the same element before it blurs (e.g. a\n // rapid re-press, the pointer re-entering a cell, or a repeated `focusRedirect` onto the same\n // element) would otherwise stack a second blur listener whose \"previous\" value it captured\n // *after* the first call already set the property to `none` — restoring `none` and leaving the\n // ring permanently suppressed. One shared set across every caller, so a global-listener\n // suppression and a `focusRedirect` one can't stack on each other either.\n if (suppressed.has(el)) return\n\n suppressed.add(el)\n const restore = styles.map((style) => [style, el.style[style]] as const)\n for (const [style] of restore) el.style[style] = 'none'\n el.addEventListener(\n 'blur',\n () => {\n for (const [style, value] of restore) el.style[style] = value\n suppressed.delete(el)\n },\n { once: true }\n )\n}\n\nfunction handlePointerDown(event: PointerEvent) {\n const target = event.target\n if (!(target instanceof Element)) return\n const el = target.closest<HTMLElement>(FOCUSABLE_SELECTOR)\n if (!el) return\n suppressFocusRing(el)\n}\n\nlet installed = false\n\nexport function install(): void {\n if (installed || typeof document === 'undefined') return\n installed = true\n document.addEventListener('pointerdown', handlePointerDown, true)\n}\n\ninstall()\n"],"mappings":"AAkBA,MAEM,EAAa,IAAI,QAQjB,EAA+C,CAAC,SAAS,EAM/D,SAAgB,EACd,EACA,EAAuC,EACjC,CAeN,GAPI,EAAG,UAAU,SAAS,YAAY,GAOlC,EAAW,IAAI,CAAE,EAAG,OAExB,EAAW,IAAI,CAAE,EACjB,IAAM,EAAU,EAAO,IAAK,GAAU,CAAC,EAAO,EAAG,MAAM,EAAM,CAAU,EACvE,IAAK,GAAM,CAAC,KAAU,EAAS,EAAG,MAAM,GAAS,OACjD,EAAG,iBACD,WACM,CACJ,IAAK,GAAM,CAAC,EAAO,KAAU,EAAS,EAAG,MAAM,GAAS,EACxD,EAAW,OAAO,CAAE,CACtB,EACA,CAAE,KAAM,EAAK,CACf,CACF,CAEA,SAAS,EAAkB,EAAqB,CAC9C,IAAM,EAAS,EAAM,OACrB,GAAI,EAAE,aAAkB,SAAU,OAClC,IAAM,EAAK,EAAO,QAAqB,sDAAkB,EACpD,GACL,EAAkB,CAAE,CACtB,CAEA,IAAI,EAAY,GAEhB,SAAgB,GAAgB,CAC1B,GAAa,OAAO,SAAa,MACrC,EAAY,GACZ,SAAS,iBAAiB,cAAe,EAAmB,EAAI,EAClE,CAEA,EAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"focusRedirect-BrvK3U_o.js","names":[],"sources":["../../src/utils/focusRedirect.ts"],"sourcesContent":["import { suppressFocusRing } from './suppressFocusRingGlobally'\n\n// Safari shows a `:focus-visible` ring on an element focused via script even when the\n// interaction that triggered the script was a real pointer click — unlike Chromium/Firefox,\n// which correctly suppress it in that case. Force the ring off for a pointer-triggered redirect,\n// then let normal focus-visible behavior resume the next time this element is genuinely\n// (re)focused, e.g. via Tab.\n//\n// The suppress/restore cycle itself is `suppressFocusRing`'s, not reimplemented here: it owns the\n// re-entrancy guard that keeps a second call before the element blurs from capturing the\n// already-suppressed value as the one to restore (which left the ring off for good — reachable by\n// clicking twice at the same disabled end of a `ends=\"stop\"` carousel). `boxShadow` is suppressed\n// alongside `outline` here, but not on the global pointerdown path, because a redirect can land\n// on an element whose ring is painted that way.\nexport function focusRedirect(\n el: HTMLElement | null,\n viaPointer: boolean,\n focusOptions?: FocusOptions\n): void {\n if (!el) return\n if (viaPointer) suppressFocusRing(el, ['outline', 'boxShadow'])\n el.focus(focusOptions)\n}\n"],"mappings":"6CAcA,SAAgB,EACd,EACA,EACA,EACM,CACD,IACD,GAAY,EAAkB,EAAI,CAAC,UAAW,WAAW,CAAC,EAC9D,EAAG,MAAM,CAAY,EACvB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import e,{forwardRef as t}from"react";import n from"classnames";const r=t(({children:t,className:r,validated:i,...a},o)=>{let s=n({"was-validated":i},r);return e.createElement(`form`,{className:s,...a,ref:o},t)});r.displayName=`Form`;export{r as t};
|
|
2
|
-
//# sourceMappingURL=form-GpdAyWWi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form-GpdAyWWi.js","names":[],"sources":["../../src/components/form/Form.tsx"],"sourcesContent":["import React, { forwardRef, FormHTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nexport interface FormProps extends FormHTMLAttributes<HTMLFormElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Mark a form as validated. If you set it `true`, all validation styles will be applied to the forms component.\n */\n validated?: boolean\n}\n\nexport const Form = forwardRef<HTMLFormElement, FormProps>(\n ({ children, className, validated, ...rest }, ref) => {\n const _className = classNames({ 'was-validated': validated }, className)\n return (\n <form className={_className} {...rest} ref={ref}>\n {children}\n </form>\n )\n }\n)\n\nForm.displayName = 'Form'\n"],"mappings":"iGAcA,MAAa,EAAO,GACjB,CAAE,WAAU,YAAW,YAAW,GAAG,GAAQ,IAAQ,CACpD,IAAM,EAAa,EAAW,CAAE,gBAAiB,CAAU,EAAG,CAAS,EACvE,OACE,EAAA,cAAC,OAAD,CAAM,UAAW,EAAY,GAAI,EAAW,KAEtC,EADH,CACG,CAEV,CACF,EAEA,EAAK,YAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-CNPGTMiW.js","names":[],"sources":["../../src/components/form-field/FormField.tsx"],"sourcesContent":["import { forwardRef, ReactNode } from 'react'\n\nimport { FormFieldIds, renderFormField } from './renderFormField'\nimport { devWarning } from '../../utils/devWarning'\n\nexport interface FormFieldProps {\n /**\n * The form control(s) this field wraps.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * A description for the field, rendered below the control(s).\n */\n help?: ReactNode\n /**\n * The DOM ids of the wrapped control(s), used to associate the label (`htmlFor`) and\n * point your control's own `aria-describedby` at the rendered help/feedback text.\n */\n ids?: FormFieldIds\n /**\n * Set field validation state to invalid.\n */\n invalid?: boolean\n /**\n * An error message for the field, rendered below the control(s) when `invalid` is set.\n */\n invalidFeedback?: ReactNode\n /**\n * The field's caption, rendered as a `FormLabel` associated with `ids.input`.\n */\n label?: ReactNode\n /**\n * Set field validation state to valid.\n */\n valid?: boolean\n /**\n * A success message for the field, rendered below the control(s) when `valid` is set.\n */\n validFeedback?: ReactNode\n}\n\n// Standalone `.form-field` wrapper for the \"wrap this yourself\" case: a control with no field\n// props of its own, or grouping more than one element under one label (e.g. an input plus a\n// sibling status meter). Combobox/DatePicker/ChipInput/OtpInput do NOT use this — they\n// call `renderFormField` directly and expose label/help/validFeedback/invalidFeedback as their\n// own props (see FORMS.md). Wrapping any of those 10 components in `FormField` produces a\n// nested, empty `.form-field` div — see FORMS.md's Gotchas section.\n//\n// The ref goes to the `.form-field` element. It stays `null` while the field renders its children\n// bare, with no `label`, `help`, feedback or `className` to need the element.\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n { children, className, help, ids, invalid, invalidFeedback, label, valid, validFeedback },\n ref\n) {\n devWarning(\n !!label && !ids?.input && !ids?.label,\n 'FormField: `label` is set but `ids.input`/`ids.label` are not — the rendered label ' +\n \"won't be associated with your control (no `htmlFor`, no `aria-labelledby` target). \" +\n 'Pass `ids={{ input: yourControlId }}` (or `ids.label` for a group with no single ' +\n 'input) so the label has something to point at.'\n )\n\n return renderFormField({\n children,\n className,\n help,\n ids,\n invalid,\n invalidFeedback,\n label,\n ref,\n valid,\n validFeedback\n })\n})\n\nFormField.displayName = 'FormField'\n"],"mappings":"wJAsDA,MAAa,EAAY,EAA2C,SAClE,CAAE,WAAU,YAAW,OAAM,MAAK,UAAS,kBAAiB,QAAO,QAAO,iBAC1E,EACA,CASA,OARA,EACE,CAAC,CAAC,GAAS,CAAC,GAAK,OAAS,CAAC,GAAK,MAChC,uSAIF,EAEO,EAAgB,CACrB,WACA,YACA,OACA,MACA,UACA,kBACA,QACA,MACA,QACA,eACF,CAAC,CACH,CAAC,EAED,EAAU,YAAc"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{a as t,i as n,n as r,t as i}from"./breakpoints-CGk8szzR.js";import a from"react";import o from"classnames";function s({children:e,className:t,component:n,fluidUntil:r,fluid:i,...s},c){let l=n??`div`,u=o(`container`,i&&`fluid`,r,t);return a.createElement(l,{className:u,...s,ref:c},e)}const c=e(s,`Container`),l=new Set([`zero`,`4xs`,`3xs`,`2xs`,`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`]),u=(e,t=``)=>e!==void 0&&l.has(e)?`${t}gap-${e}`:null,d=e=>e!==void 0&&!l.has(e)?e:void 0,f=e=>e!==void 0&&Number.isInteger(e)&&e>=1&&e<=6,p=e=>e!==void 0&&!f(e)?`repeat(${e}, minmax(0, 1fr))`:void 0,m=e=>e!==void 0&&Number.isInteger(e)&&e>=1&&e<=12,h=(e,t)=>`${t}grid-flow-${e.replace(`column`,`col`)}`;function g({children:e,className:s,component:c,columns:l,rows:g,gap:_,flow:v,contained:y,fill:b,min:x,style:S,...C},w){let T=c??`div`,E=r(l),D=r(g),O=r(_),k=o(b?`grid-fill`:`grid`,y&&`contained`,n([t(l,(e,t)=>!b&&(t!==``||m(e))&&`${t}grid-cols-${e}`),t(g,(e,t)=>!b&&(t!==``||f(e))&&`${t}grid-rows-${e}`),t(_,u),t(v,h)],i),s),A={...S},j=d(O);if(j!==void 0&&(A[`--cx-grid-gap`]=j),b)x!==void 0&&(A[`--cx-grid-min`]=x);else{E!==void 0&&!m(E)&&(A[`--cx-grid-columns`]=E);let e=p(D);e!==void 0&&(A.gridTemplateRows=e)}return a.createElement(T,{className:k,style:A,...C,ref:w},e)}const _=e(g,`Grid`);function v({children:e,className:r,component:s,span:c,start:l,end:m,rowSpan:h,rowStart:g,rowEnd:_,subgrid:v,rows:y,gap:b,style:x,...S},C){let w=s??`div`,T=o(n([t(c,(e,t)=>`${t}col-span-${e}`),t(l,(e,t)=>`${t}col-start-${e}`),t(m,(e,t)=>`${t}col-end-${e}`),t(h,(e,t)=>`${t}row-span-${e}`),t(g,(e,t)=>`${t}row-start-${e}`),t(_,(e,t)=>`${t}row-end-${e}`)],i),v&&`grid grid-cols-subgrid`,v&&f(y)&&`grid-rows-${y}`,v&&u(b),r),E={...x};if(v){let e=p(y);e!==void 0&&(E.gridTemplateRows=e);let t=d(b);t!==void 0&&(E[`--cx-grid-gap`]=t)}return a.createElement(w,{className:T,style:E,...S,ref:C},e)}const y=e(v,`GridItem`);export{_ as n,c as r,y as t};
|
|
2
|
-
//# sourceMappingURL=grid-C7tO-ppc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid-C7tO-ppc.js","names":[],"sources":["../../src/components/grid/Container.tsx","../../src/types.ts","../../src/components/grid/gap.ts","../../src/components/grid/rows.ts","../../src/components/grid/Grid.tsx","../../src/components/grid/GridItem.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { Breakpoint } from '../../types'\n\ntype ContainerOwnProps<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 * Set container 100% wide until the given breakpoint, after which it scales up with `max-width`\n * at every larger breakpoint.\n *\n * @type Breakpoint\n */\n fluidUntil?: Breakpoint\n /**\n * Set container 100% wide, spanning the entire width of the viewport.\n */\n fluid?: boolean\n}\n\nexport type ContainerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ContainerOwnProps<C>\n>\n\ntype ContainerComponent = (<C extends ElementType = 'div'>(\n props: ContainerProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ContainerRender<C extends ElementType = 'div'>(\n { children, className, component, fluidUntil, fluid, ...rest }: ContainerProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('container', fluid && 'fluid', fluidUntil, className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Container = createPolymorphicComponent<ContainerComponent>(\n ContainerRender as ForwardRefRenderFunction<Element, ContainerProps<ElementType>>,\n 'Container'\n)\n","/**\n * Breakpoints\n */\nexport type Breakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n\n/**\n * Container breakpoints: the same widths, measured on the nearest query container instead of the\n * viewport. chassis-css's `@md:` classes.\n */\nexport type ContainerBreakpoint = '@sm' | '@md' | '@lg' | '@xl' | '@2xl'\n\n/**\n * A prop value that can change with the width. A plain value applies at every width. An object\n * holds one value per width: `base` from the narrowest, each breakpoint key from that breakpoint\n * up, as in `{ base: 'column', md: 'row' }`. `K` is the keys the prop reads: the viewport\n * breakpoints unless the component also takes the container ones.\n */\nexport type Responsive<T, K extends string = Breakpoint> =\n T | ({ base?: T } & Partial<Record<K, T>>)\n\n/**\n * Context colors\n */\nexport type ContextColor =\n | 'default'\n | 'alternate'\n | 'primary'\n | 'secondary'\n | 'neutral'\n | 'success'\n | 'danger'\n | 'warning'\n | 'info'\n | 'black'\n | 'white'\n\n/**\n * Context styles\n */\nexport type ContextStyle = 'basic' | 'solid' | 'outline' | 'smooth'\n\n/**\n * Component sizes\n */\nexport type Sizing = 'sm' | 'md' | 'lg'\n\n/**\n * Extended sizes\n */\nexport type ExtendedSizing = '2xs' | 'xs' | Sizing | 'xl' | '2xl'\n\n/**\n * Spacing values. `SPACING` is the runtime source of truth — `Spacing` is derived from it so the\n * two can't drift apart; anything needing the values at runtime (e.g. validating a string against\n * the scale) should import `SPACING`, not hand-copy the list.\n */\nexport const SPACING = [\n 'zero',\n '4xs',\n '3xs',\n '2xs',\n 'xs',\n 'sm',\n 'md',\n 'lg',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n '6xl'\n] as const\n\nexport type Spacing = (typeof SPACING)[number]\n\n/**\n * Font families\n */\nexport type FontFamily = 'text' | 'display' | 'code' | 'html'\n\n/**\n * Font weights\n */\nexport type FontWeight = 'elegant' | 'normal' | 'strong' | 'mass'\n\n/**\n * Font sizes\n */\nexport type FontSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl'\n\n/**\n * Component placements\n */\nexport type Placements =\n | 'auto'\n | 'auto-start'\n | 'auto-end'\n | 'top-end'\n | 'top'\n | 'top-start'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'left-start'\n | 'left'\n | 'left-end'\n\n/**\n * Component shapes\n */\nexport type Shapes =\n | 'rounded'\n | 'rounded-top'\n | 'rounded-end'\n | 'rounded-bottom'\n | 'rounded-start'\n | 'rounded-circle'\n | 'rounded-pill'\n | 'rounded-0'\n | 'rounded-1'\n | 'rounded-2'\n | 'rounded-3'\n\nexport type TextColor =\n | ContextColor\n | 'main'\n | 'subtle'\n | 'slight'\n | 'solid'\n | 'inverse'\n | 'highlight'\n | 'active'\n | 'contrast'\n\nexport type Triggers = 'hover' | 'focus' | 'click'\n","import { SPACING } from '../../types'\n\nconst SPACING_TOKENS = new Set<string>(SPACING)\n\n// A `Spacing` token is chassis-css's own `gap-{token}` utility, which a breakpoint prefix makes\n// responsive. Anything else (a raw CSS value, e.g. `\"1rem\"` or `\".25rem 1rem\"`) has no class and\n// goes to the `--cx-grid-gap` custom property instead: see `gapValue`.\nexport const gapClassName = (gap: string | undefined, prefix = ''): string | null =>\n gap !== undefined && SPACING_TOKENS.has(gap) ? `${prefix}gap-${gap}` : null\n\nexport const gapValue = (gap: string | undefined): string | undefined =>\n gap !== undefined && !SPACING_TOKENS.has(gap) ? gap : undefined\n","// chassis-css has `grid-rows-1` to `grid-rows-6`.\nexport const hasRowsClass = (rows: number | undefined) =>\n rows !== undefined && Number.isInteger(rows) && rows >= 1 && rows <= 6\n\n// A row count with no class is the declaration of the class, set inline: see `Grid`'s `rows`.\n// `grid-template-rows` isn't inherited, so unlike a custom property it stays on the one grid.\nexport const rowsTemplate = (rows: number | undefined): string | undefined =>\n rows !== undefined && !hasRowsClass(rows) ? `repeat(${rows}, minmax(0, 1fr))` : undefined\n","import React, { CSSProperties, ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport {\n baseValue,\n GRID_BREAKPOINTS,\n responsiveClassNames,\n responsiveProp\n} from '../../utils/breakpoints'\nimport { Breakpoint, ContainerBreakpoint, Responsive, Spacing } from '../../types'\nimport { gapClassName, gapValue } from './gap'\nimport { hasRowsClass, rowsTemplate } from './rows'\n\ntype GridStyle = CSSProperties & {\n '--cx-grid-columns'?: number\n '--cx-grid-gap'?: string\n '--cx-grid-min'?: string\n}\n\n/**\n * The direction a grid places its items in, and whether it fills earlier gaps (`dense`): the\n * values of CSS `grid-auto-flow`.\n */\nexport type GridFlow = 'row' | 'column' | 'dense' | 'row-dense' | 'column-dense'\n\n// A token is a class at any width. A raw CSS value is a custom property, which only the base\n// can be: an inline style holds no media query.\ntype GridGap = Spacing | (string & {})\n\ntype GridOwnProps<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 * Number of columns in the grid template (the column count of `@chassis-ui/css` when omitted,\n * `12` by default). A count from 1 to 12 is mapped to the `grid-cols-{n}` class, which applies\n * to this grid alone. Any other count has no class and is set via the `--cx-grid-columns`\n * custom property, which a grid nested in this one inherits: give that grid `columns` of its\n * own. Has no effect when `fill` is set.\n *\n * An object sets the count from a width up, as in `{ base: 1, md: 3 }`, here and on `rows`,\n * `gap` and `flow`. A breakpoint key (`md`) is a width of the viewport. A container key\n * (`'@md'`) is the same width of the nearest query container (an ancestor with the\n * `contains-inline` class), and wins over a breakpoint key where both apply. Without a query\n * container above the grid, a container key never applies. The count of a key is a class, so\n * a count from 1 to 12.\n */\n columns?: Responsive<number, Breakpoint | ContainerBreakpoint>\n /**\n * Number of equal rows in the grid template. A grid has none when omitted: its rows are as\n * tall as their content. A count from 1 to 6 is mapped to the `grid-rows-{n}` class; any other\n * count has no class and is set inline, as the `grid-template-rows` the class declares. Has no\n * effect when `fill` is set. An object sets the count from a width up, where it is a class, so\n * a count from 1 to 6.\n */\n rows?: Responsive<number, Breakpoint | ContainerBreakpoint>\n /**\n * Gap between grid items: a `Spacing` token (mapped to the `gap-{token}` class) or any raw CSS\n * `gap` value, including a `\"{row} {column}\"` pair (set via the `--cx-grid-gap` custom\n * property). The gutter of the current breakpoint when omitted, or of the query container when\n * `contained` is set. An object sets the gap from a width up: only a token fits a key other\n * than `base`, since a raw value has no class.\n *\n * @type { Spacing | string | { base?: Spacing | string } & Partial<Record<Breakpoint | ContainerBreakpoint, Spacing>> }\n */\n gap?: GridGap | ({ base?: GridGap } & Partial<Record<Breakpoint | ContainerBreakpoint, Spacing>>)\n /**\n * The direction items are placed in, mapped to the `grid-flow-*` classes: by `'row'` (the CSS\n * default) or by `'column'`, which fills the `rows` of one column before it starts the next.\n * `'dense'`, `'row-dense'` and `'column-dense'` also move later items into gaps that earlier,\n * wider ones left. An object sets the flow from a width up.\n */\n flow?: Responsive<GridFlow, Breakpoint | ContainerBreakpoint>\n /**\n * Adds the `contained` class: the default gutter and column count follow the width of the\n * nearest query container instead of the viewport, so a grid in a narrow column of a wide page\n * has the gutter of a narrow page. Without a query container above it the grid keeps the\n * values of the viewport. `columns` and `gap` still override them.\n */\n contained?: boolean\n /**\n * Renders `.grid-fill` instead of `.grid` — columns expand equally to fill the available\n * width, with the column count determined by the number of children rather than `columns`.\n */\n fill?: boolean\n /**\n * Minimum column width of a `fill` grid, set via the `--cx-grid-min` custom property: any CSS\n * length, e.g. `\"16rem\"`. Children wrap to a new row when they would get narrower. `12rem` in\n * `@chassis-ui/css` when omitted. Only relevant when `fill` is set.\n */\n min?: string\n}\n\nexport type GridProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, GridOwnProps<C>>\n\n// chassis-css has `grid-cols-1` to `grid-cols-12`.\nconst hasColumnsClass = (columns: number | undefined) =>\n columns !== undefined && Number.isInteger(columns) && columns >= 1 && columns <= 12\n\n// chassis-css names the values as Tailwind does: `grid-flow-col`, `grid-flow-col-dense`.\nconst flowClassName = (flow: GridFlow, prefix: string) =>\n `${prefix}grid-flow-${flow.replace('column', 'col')}`\n\ntype GridComponent = (<C extends ElementType = 'div'>(\n props: GridProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction GridRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n component,\n columns,\n rows,\n gap,\n flow,\n contained,\n fill,\n min,\n style,\n ...rest\n }: GridProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n\n // A class where chassis-css has one: `--cx-grid-columns` set inline is inherited by every grid\n // nested in this one, which then has this grid's column count instead of its own. Only a base\n // count with no class falls back to the property; a breakpoint's can't, since an inline style\n // holds no media query. `.grid-fill` counts its own columns. A base row count with no class is\n // set inline too, as a declaration: see `rowsTemplate`.\n const baseColumns = baseValue(columns)\n const baseRows = baseValue(rows)\n const baseGap = baseValue<string>(gap)\n\n const _className = classNames(\n fill ? 'grid-fill' : 'grid',\n contained && 'contained',\n responsiveClassNames(\n [\n responsiveProp(\n columns,\n (value, prefix) =>\n !fill && (prefix !== '' || hasColumnsClass(value)) && `${prefix}grid-cols-${value}`\n ),\n responsiveProp(\n rows,\n (value, prefix) =>\n !fill && (prefix !== '' || hasRowsClass(value)) && `${prefix}grid-rows-${value}`\n ),\n responsiveProp<string>(gap, gapClassName),\n responsiveProp(flow, flowClassName)\n ],\n GRID_BREAKPOINTS\n ),\n className\n )\n\n const _style: GridStyle = { ...style }\n const _gap = gapValue(baseGap)\n\n if (_gap !== undefined) _style['--cx-grid-gap'] = _gap\n\n if (fill) {\n if (min !== undefined) _style['--cx-grid-min'] = min\n } else {\n if (baseColumns !== undefined && !hasColumnsClass(baseColumns)) {\n _style['--cx-grid-columns'] = baseColumns\n }\n const _rows = rowsTemplate(baseRows)\n if (_rows !== undefined) _style.gridTemplateRows = _rows\n }\n\n return (\n <Component className={_className} style={_style} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const Grid = createPolymorphicComponent<GridComponent>(\n GridRender as ForwardRefRenderFunction<Element, GridProps<ElementType>>,\n 'Grid'\n)\n","import React, { CSSProperties, ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { GRID_BREAKPOINTS, responsiveClassNames, responsiveProp } from '../../utils/breakpoints'\nimport { Breakpoint, ContainerBreakpoint, Responsive, Spacing } from '../../types'\nimport { gapClassName, gapValue } from './gap'\nimport { hasRowsClass, rowsTemplate } from './rows'\n\ntype GridItemStyle = CSSProperties & {\n '--cx-grid-gap'?: string\n}\n\ntype GridItemOwnProps<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 * Number of grid column tracks (of the parent `<Grid>`'s `columns`) this item spans, mapped to\n * the `col-span-{n}` class, or `'full'` for every track of the row (`col-span-full`). An item\n * with no `span` is one track wide.\n *\n * An object sets the span from a width up, as in `{ base: 'full', md: 6 }`, here and on\n * `start`, `end`, `rowSpan`, `rowStart` and `rowEnd`. A breakpoint key (`md`) is a width of\n * the viewport. A container key (`'@md'`) is the same width of the nearest query container\n * (an ancestor with the `contains-inline` class), and wins over a breakpoint key where both\n * apply. Without a query container above the grid, a container key never applies.\n *\n * @type { Responsive<number | 'full', Breakpoint | ContainerBreakpoint> }\n */\n span?: Responsive<number | 'full', Breakpoint | ContainerBreakpoint>\n /**\n * Grid column line to start this item at, mapped to the `col-start-{n}` class (1 to 12).\n * `'auto'` (`col-start-auto`) returns the item to the flow, to undo a start line at a wider\n * breakpoint: `{ base: 4, md: 'auto' }`.\n *\n * @type { Responsive<number | 'auto', Breakpoint | ContainerBreakpoint> }\n */\n start?: Responsive<number | 'auto', Breakpoint | ContainerBreakpoint>\n /**\n * Grid column line to end this item at, mapped to the `col-end-{n}` class (1 to 13, the line\n * after the last of 12 columns). With `span`, it places the item against the end edge of the\n * grid: `span={3} end={13}`. `'auto'` (`col-end-auto`) undoes an end line at a wider\n * breakpoint: `{ base: 13, md: 'auto' }`.\n *\n * @type { Responsive<number | 'auto', Breakpoint | ContainerBreakpoint> }\n */\n end?: Responsive<number | 'auto', Breakpoint | ContainerBreakpoint>\n /**\n * Number of grid row tracks this item spans, mapped to the `row-span-{n}` class. Takes an\n * object per width, as `span` does.\n */\n rowSpan?: Responsive<number, Breakpoint | ContainerBreakpoint>\n /**\n * Grid row line to start this item at, mapped to the `row-start-{n}` class (1 to 6), or\n * `'auto'` (`row-start-auto`) to return it to the flow. Takes an object per width, as `span`\n * does.\n *\n * @type { Responsive<number | 'auto', Breakpoint | ContainerBreakpoint> }\n */\n rowStart?: Responsive<number | 'auto', Breakpoint | ContainerBreakpoint>\n /**\n * Grid row line to end this item at, mapped to the `row-end-{n}` class (1 to 7, the line after\n * the last of 6 rows), or `'auto'` (`row-end-auto`) to undo an end line at a wider breakpoint.\n * Takes an object per width, as `span` does.\n *\n * @type { Responsive<number | 'auto', Breakpoint | ContainerBreakpoint> }\n */\n rowEnd?: Responsive<number | 'auto', Breakpoint | ContainerBreakpoint>\n /**\n * Turns this item into a nested subgrid: adds `.grid`/`.grid-cols-subgrid` alongside its\n * `col-span-{n}`/`col-start-{n}` placement classes, so its own children inherit the parent\n * `<Grid>`'s column tracks instead of defining new ones. Combine with `span` — a subgrid\n * item must itself be a grid item of the parent for `grid-template-columns: subgrid` to take\n * effect, which is why `subgrid` lives on `<GridItem>` (the element actually placed as a grid\n * item) rather than on a `<Grid>` nested inside it.\n */\n subgrid?: boolean\n /**\n * Number of equal rows in the subgrid's own row template: the `grid-rows-{n}` class for a\n * count from 1 to 6, the same `grid-template-rows` set inline for any other. Only relevant\n * when `subgrid` is set — subgrid only inherits the parent's column tracks, not its rows.\n */\n rows?: number\n /**\n * Gap between the subgrid's children: a `Spacing` token (mapped to the `gap-{token}` class) or\n * any raw CSS `gap` value (set via the `--cx-grid-gap` custom property). Only relevant when\n * `subgrid` is set. A subgrid has the gap of its own: when the parent `<Grid>` takes a `gap`\n * token, give the subgrid the same one, or its children are narrower than the parent's tracks.\n *\n * @type { Spacing | string }\n */\n gap?: Spacing | (string & {})\n}\n\nexport type GridItemProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n GridItemOwnProps<C>\n>\n\ntype GridItemComponent = (<C extends ElementType = 'div'>(\n props: GridItemProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction GridItemRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n component,\n span,\n start,\n end,\n rowSpan,\n rowStart,\n rowEnd,\n subgrid,\n rows,\n gap,\n style,\n ...rest\n }: GridItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n responsiveClassNames(\n [\n responsiveProp(span, (value, prefix) => `${prefix}col-span-${value}`),\n responsiveProp(start, (value, prefix) => `${prefix}col-start-${value}`),\n responsiveProp(end, (value, prefix) => `${prefix}col-end-${value}`),\n responsiveProp(rowSpan, (value, prefix) => `${prefix}row-span-${value}`),\n responsiveProp(rowStart, (value, prefix) => `${prefix}row-start-${value}`),\n responsiveProp(rowEnd, (value, prefix) => `${prefix}row-end-${value}`)\n ],\n GRID_BREAKPOINTS\n ),\n subgrid && 'grid grid-cols-subgrid',\n subgrid && hasRowsClass(rows) && `grid-rows-${rows}`,\n subgrid && gapClassName(gap),\n className\n )\n\n const _style: GridItemStyle = { ...style }\n\n if (subgrid) {\n const _rows = rowsTemplate(rows)\n if (_rows !== undefined) _style.gridTemplateRows = _rows\n const _gap = gapValue(gap)\n if (_gap !== undefined) _style['--cx-grid-gap'] = _gap\n }\n\n return (\n <Component className={_className} style={_style} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const GridItem = createPolymorphicComponent<GridItemComponent>(\n GridItemRender as ForwardRefRenderFunction<Element, GridItemProps<ElementType>>,\n 'GridItem'\n)\n"],"mappings":"iMAyCA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,aAAY,QAAO,GAAG,GACxD,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,YAAa,GAAS,QAAS,EAAY,CAAS,EAElF,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAY,EACvB,EACA,WACF,EExDM,EAAiB,IAAI,IAAY,CDuDrC,OACA,MACA,MACA,MACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,KCpEqC,CAAO,EAKjC,GAAgB,EAAyB,EAAS,KAC7D,IAAQ,IAAA,IAAa,EAAe,IAAI,CAAG,EAAI,GAAG,EAAO,MAAM,IAAQ,KAE5D,EAAY,GACvB,IAAQ,IAAA,IAAa,CAAC,EAAe,IAAI,CAAG,EAAI,EAAM,IAAA,GCV3C,EAAgB,GAC3B,IAAS,IAAA,IAAa,OAAO,UAAU,CAAI,GAAK,GAAQ,GAAK,GAAQ,EAI1D,EAAgB,GAC3B,IAAS,IAAA,IAAa,CAAC,EAAa,CAAI,EAAI,UAAU,EAAK,mBAAqB,IAAA,GCmG5E,EAAmB,GACv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O,IAAW,GAAG,EAAO,WAAW,GAAO,EACpE,EAAe,GAAQ,EAAO,IAAW,GAAG,EAAO,YAAY,GAAO,EACtE,EAAe,GAAM,EAAO,IAAW,GAAG,EAAO,UAAU,GAAO,EAClE,EAAe,GAAU,EAAO,IAAW,GAAG,EAAO,WAAW,GAAO,EACvE,EAAe,GAAW,EAAO,IAAW,GAAG,EAAO,YAAY,GAAO,EACzE,EAAe,GAAS,EAAO,IAAW,GAAG,EAAO,UAAU,GAAO,CACvE,EACA,CACF,EACA,GAAW,yBACX,GAAW,EAAa,CAAI,GAAK,aAAa,IAC9C,GAAW,EAAa,CAAG,EAC3B,CACF,EAEM,EAAwB,CAAE,GAAG,CAAM,EAEzC,GAAI,EAAS,CACX,IAAM,EAAQ,EAAa,CAAI,EAC3B,IAAU,IAAA,KAAW,EAAO,iBAAmB,GACnD,IAAM,EAAO,EAAS,CAAG,EACrB,IAAS,IAAA,KAAW,EAAO,iBAAmB,EACpD,CAEA,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,MAAO,EAAQ,GAAI,EAAW,KAErD,EADR,CACQ,CAEf,CAEA,MAAa,EAAW,EACtB,EACA,UACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{i as e,n as t}from"./Icon-DLB1f88W.js";import n,{useMemo as r}from"react";const i=({children:i,className:a,component:o,font:s,fontPrefix:c,icons:l,sprite:u})=>{let d=t(),f=r(()=>({className:a??d.className,component:o??d.component,font:s??d.font,fontPrefix:c??d.fontPrefix,icons:l?{...d.icons,...l}:d.icons,sprite:u??d.sprite}),[d,a,o,s,c,l,u]);return n.createElement(e.Provider,{value:f},i)};i.displayName=`IconProvider`;export{i as t};
|
|
2
|
-
//# sourceMappingURL=icon-BQsT6YtE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icon-BQsT6YtE.js","names":[],"sources":["../../src/components/icon/IconProvider.tsx"],"sourcesContent":["import React, { ReactNode, useMemo } from 'react'\n\nimport { useIconConfig } from '../../hooks/useIconConfig'\nimport { IconConfig, IconContext } from '../../utils/iconConfig'\n\nexport interface IconProviderProps extends IconConfig {\n /**\n * The part of the app these icon settings apply to.\n */\n children?: ReactNode\n}\n\n// Nested providers extend the one above them: a setting left unset here keeps the outer value,\n// and `icons` merges per key, so an inner provider can remap one icon without restating the rest.\nexport const IconProvider = ({\n children,\n className,\n component,\n font,\n fontPrefix,\n icons,\n sprite\n}: IconProviderProps) => {\n const parent = useIconConfig()\n const value = useMemo<IconConfig>(\n () => ({\n className: className ?? parent.className,\n component: component ?? parent.component,\n font: font ?? parent.font,\n fontPrefix: fontPrefix ?? parent.fontPrefix,\n icons: icons ? { ...parent.icons, ...icons } : parent.icons,\n sprite: sprite ?? parent.sprite\n }),\n [parent, className, component, font, fontPrefix, icons, sprite]\n )\n\n return <IconContext.Provider value={value}>{children}</IconContext.Provider>\n}\n\nIconProvider.displayName = 'IconProvider'\n"],"mappings":"kHAcA,MAAa,GAAgB,CAC3B,WACA,YACA,YACA,OACA,aACA,QACA,YACuB,CACvB,IAAM,EAAS,EAAc,EACvB,EAAQ,OACL,CACL,UAAW,GAAa,EAAO,UAC/B,UAAW,GAAa,EAAO,UAC/B,KAAM,GAAQ,EAAO,KACrB,WAAY,GAAc,EAAO,WACjC,MAAO,EAAQ,CAAE,GAAG,EAAO,MAAO,GAAG,CAAM,EAAI,EAAO,MACtD,OAAQ,GAAU,EAAO,MAC3B,GACA,CAAC,EAAQ,EAAW,EAAW,EAAM,EAAY,EAAO,CAAM,CAChE,EAEA,OAAO,EAAA,cAAC,EAAY,SAAb,CAA6B,OAAuC,EAA/B,CAA+B,CAC7E,EAEA,EAAa,YAAc"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./lazyElement-tfMG21pZ.js";import{n as t,r as n,t as r}from"./Icon-DLB1f88W.js";import i,{cloneElement as a}from"react";import{mergeProps as o}from"react-aria";function s({value:n,...s}){let{component:c}=t(),l={"aria-hidden":!0,...s};if(typeof n!=`string`){let t=e(n);return a(t,o(l,t.props))}return c?i.createElement(c,{name:n,...l}):i.createElement(r,{name:n,...l})}function c({icon:e,override:r,...a}){let{icons:o}=t();return i.createElement(s,{value:r??o?.[e]??n[e],...a})}export{s as n,c as t};
|
|
2
|
-
//# sourceMappingURL=iconSlot-BNu2MrFI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iconSlot-BNu2MrFI.js","names":[],"sources":["../../src/utils/iconSlot.tsx"],"sourcesContent":["import React, { cloneElement, ReactElement } from 'react'\nimport { mergeProps } from 'react-aria'\n\nimport { Icon } from '../components/icon/Icon'\nimport { useIconConfig } from '../hooks/useIconConfig'\nimport { DEFAULT_ICONS, IconKey, IconValue } from './iconConfig'\nimport { resolveLazy } from './lazyElement'\n\n// Every icon this library's own components draw goes through here, never through `<Icon>`\n// directly, so a consumer can swap in their own icons (`IconProvider`'s `icons`/`component`, or a\n// component's own icon prop). The rendering component passes the class names chassis-css hooks\n// onto (`menu-item-check` positions the check, `navbar-toggler-icon` sizes and colors it,\n// `carousel-icon-play`/`-pause` are toggled by state, `directional-icon` flips in RTL); those are\n// merged onto whatever icon ends up rendered, so a custom icon lands in the same place a built-in\n// one would. `aria-hidden` defaults on: each of these icons sits beside its own visible or\n// visually-hidden label.\n//\n// A custom *element* deliberately doesn't get the `icon` class itself: chassis-css's `.icon` sets\n// `fill`, which would paint over an outline icon set's `fill=\"none\"` (Lucide, Heroicons outline,\n// ...). It keeps its own size and color — `currentColor` icons still follow the control's text.\ntype IconRenderProps = { className?: string } & Record<string, unknown>\n\nexport function ResolvedIcon({ value, ...props }: IconRenderProps & { value: IconValue }) {\n const { component: Component } = useIconConfig()\n const iconProps = { 'aria-hidden': true, ...props }\n\n if (typeof value !== 'string') {\n // An icon element passed from a Server Component can be a lazy node (see `./lazyElement`).\n const element = resolveLazy(value) as ReactElement<Record<string, unknown>>\n return cloneElement(element, mergeProps(iconProps, element.props))\n }\n if (Component) return <Component name={value} {...iconProps} />\n return <Icon name={value} {...iconProps} />\n}\n\nexport function IconSlot({\n icon,\n override,\n ...props\n}: IconRenderProps & { icon: IconKey; override?: IconValue }) {\n const { icons } = useIconConfig()\n return <ResolvedIcon value={override ?? icons?.[icon] ?? DEFAULT_ICONS[icon]} {...props} />\n}\n"],"mappings":"mLAsBA,SAAgB,EAAa,CAAE,QAAO,GAAG,GAAiD,CACxF,GAAM,CAAE,UAAW,GAAc,EAAc,EACzC,EAAY,CAAE,cAAe,GAAM,GAAG,CAAM,EAElD,GAAI,OAAO,GAAU,SAAU,CAE7B,IAAM,EAAU,EAAY,CAAK,EACjC,OAAO,EAAa,EAAS,EAAW,EAAW,EAAQ,KAAK,CAAC,CACnE,CAEA,OADI,EAAkB,EAAA,cAAC,EAAD,CAAW,KAAM,EAAO,GAAI,CAAY,CAAA,EACvD,EAAA,cAAC,EAAD,CAAM,KAAM,EAAO,GAAI,CAAY,CAAA,CAC5C,CAEA,SAAgB,EAAS,CACvB,OACA,WACA,GAAG,GACyD,CAC5D,GAAM,CAAE,SAAU,EAAc,EAChC,OAAO,EAAA,cAAC,EAAD,CAAc,MAAO,GAAY,IAAQ,IAAS,EAAc,GAAO,GAAI,CAAQ,CAAA,CAC5F"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import t from"react";import n from"classnames";function r({children:e,className:r,component:i,onMouseDown:a,...o},s){let c=i??`span`,l=n(`input-adorn`,r);return t.createElement(c,{className:l,onMouseDown:e=>{a?.(e),e.defaultPrevented||e.preventDefault()},...o,ref:s},e)}const i=e(r,`InputAdorn`);export{i as t};
|
|
2
|
-
//# sourceMappingURL=input-adorn-DwdX-jxA.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-adorn-DwdX-jxA.js","names":[],"sources":["../../src/components/input-adorn/InputAdorn.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype InputAdornOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component. Use\n * `\"button\"` or `\"a\"` for an actionable adorn, e.g. a password reveal toggle or a clear button.\n */\n component?: C\n}\n\nexport type InputAdornProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n InputAdornOwnProps<C>\n>\n\ntype InputAdornComponent = (<C extends ElementType = 'span'>(\n props: InputAdornProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction InputAdornRender<C extends ElementType = 'span'>(\n { children, className, component, onMouseDown, ...rest }: InputAdornProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('input-adorn', className)\n const handleMouseDown: React.MouseEventHandler<Element> = (event) => {\n onMouseDown?.(event)\n // Keep focus on the associated input (e.g. a password toggle) instead of\n // letting the browser shift it to this button/anchor on mousedown.\n if (!event.defaultPrevented) {\n event.preventDefault()\n }\n }\n return (\n <Component className={_className} onMouseDown={handleMouseDown} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const InputAdorn = createPolymorphicComponent<InputAdornComponent>(\n InputAdornRender as ForwardRefRenderFunction<Element, InputAdornProps<ElementType>>,\n 'InputAdorn'\n)\n"],"mappings":"8HA8BA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,cAAa,GAAG,GAClD,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EAAW,cAAe,CAAS,EAStD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,YATuB,GAAU,CACnE,IAAc,CAAK,EAGd,EAAM,kBACT,EAAM,eAAe,CAEzB,EAEkE,GAAI,EAAW,KAEpE,EADR,CACQ,CAEf,CAEA,MAAa,EAAa,EACxB,EACA,YACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import t from"react";import n from"classnames";function r({children:e,className:r,component:i,size:a,...o},s){let c=i??`div`,l=n(`input-group`,a,r);return t.createElement(c,{className:l,...o,ref:s},e)}const i=e(r,`InputGroup`);function a({children:e,className:r,component:i,...a},o){let s=i??`span`,c=n(`input-addon`,r);return t.createElement(s,{className:c,...a,ref:o},e)}const o=e(a,`InputGroupAddon`);export{i as n,o as t};
|
|
2
|
-
//# sourceMappingURL=input-group-Cuiuf4Dl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-group-Cuiuf4Dl.js","names":[],"sources":["../../src/components/input-group/InputGroup.tsx","../../src/components/input-group/InputGroupAddon.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype InputGroupOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n}\n\nexport type InputGroupProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n InputGroupOwnProps<C>\n>\n\ntype InputGroupComponent = (<C extends ElementType = 'div'>(\n props: InputGroupProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction InputGroupRender<C extends ElementType = 'div'>(\n { children, className, component, size, ...rest }: InputGroupProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('input-group', size, className)\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const InputGroup = createPolymorphicComponent<InputGroupComponent>(\n InputGroupRender as ForwardRefRenderFunction<Element, InputGroupProps<ElementType>>,\n 'InputGroup'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype InputGroupAddonOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * The id of the form control this addon labels, when rendered as `component=\"label\"`.\n */\n htmlFor?: string\n}\n\nexport type InputGroupAddonProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n InputGroupAddonOwnProps<C>\n>\n\ntype InputGroupAddonComponent = (<C extends ElementType = 'span'>(\n props: InputGroupAddonProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction InputGroupAddonRender<C extends ElementType = 'span'>(\n { children, className, component, ...rest }: InputGroupAddonProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('input-addon', className)\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const InputGroupAddon = createPolymorphicComponent<InputGroupAddonComponent>(\n InputGroupAddonRender as ForwardRefRenderFunction<Element, InputGroupAddonProps<ElementType>>,\n 'InputGroupAddon'\n)\n"],"mappings":"8HAiCA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,OAAM,GAAG,GAC3C,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,cAAe,EAAM,CAAS,EAC5D,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAa,EACxB,EACA,YACF,EChBA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EAAW,cAAe,CAAS,EACtD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAkB,EAC7B,EACA,iBACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{d as e,f as t,g as n,h as r,m as i,p as a,u as o}from"./slot-CNhFZdHF.js";import{t as s}from"./lazyElement-tfMG21pZ.js";import{t as c}from"./polymorphic-BhGNZQja.js";import{t as l}from"./Link-DyZyAQFj.js";import u,{Children as d}from"react";import f from"classnames";function p({children:r,active:i,className:o,disabled:s,color:c,component:d,href:p,...m},h){let g=a(d,p,`li`),_=n(g,p,m),v=t(_),y=e(_,p,`ListItem`),b=f(`list-item`,c&&`context`,c,{"list-action":v,active:i&&!v,disabled:s&&!v},o),x=v?l:g,S=v?{active:i,disabled:s,component:g,...y,...m}:{...i&&{"aria-current":`page`},...s&&{"aria-disabled":!0},...y,...m};return u.createElement(x,{className:b,...S,ref:h},r)}const m=c(p,`ListItem`);function h({children:e,className:n,component:c,color:l,variant:p,flush:h,items:g,layout:_,numbered:v,plain:y,...b},x){let S=g?g.some(e=>o(e.href)):d.toArray(e).some(e=>s(e,m)&&t(r(e.props))),C=c??(S?`div`:`ul`),w=i(C),T=w===`ul`||w===`ol`,E=f(`list`,l&&`context`,l,p,_,{flush:h,plain:y,numbered:v},n),D=(g?g.map((e,t)=>{let n=f(`list-item`,e.color&&`context`,e.color,{"list-action":o(e.href),active:e.active,disabled:e.disabled}),r=a(void 0,e.href,T?`li`:`div`);return u.createElement(r,{key:e.id??t,className:n,...o(e.href)&&{href:e.href},...e.active?{"aria-current":`page`}:{},...e.disabled?{"aria-disabled":!0}:{}},e.label)}):null)??(T?e:d.map(e,e=>s(e,m)&&r(e.props)===void 0?u.cloneElement(e,{component:`div`}):e));return u.createElement(C,{className:E,...b,ref:x},D)}const g=c(h,`List`);export{m as n,g as t};
|
|
2
|
-
//# sourceMappingURL=list-07e2a1Ym.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-07e2a1Ym.js","names":[],"sources":["../../src/components/list/ListItem.tsx","../../src/components/list/List.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor } from '../../types'\nimport { hrefProps, isInteractiveKind, linkElement, resolveLinkKind } from '../../utils/elementKind'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\nimport { Link } from '../link/Link'\n\ntype ListItemOwnProps<C extends ElementType> = {\n /**\n * Toggle the active state for the component.\n */\n active?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * The href attribute specifies the URL of the page the link goes to. Renders an `<a>` in place\n * of the `<li>`, unless `component` or `asChild` chose the element. Inside a `List`, the list\n * renders a `<div>` around it in place of the `<ul>`.\n */\n href?: string\n}\n\nexport type ListItemProps<C extends ElementType = 'li'> = PolymorphicComponentProps<\n C,\n ListItemOwnProps<C>\n>\n\ntype ListItemComponent = (<C extends ElementType = 'li'>(\n props: ListItemProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLLIElement | HTMLAnchorElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ListItemRender<C extends ElementType = 'li'>(\n { children, active, className, disabled, color, component, href, ...rest }: ListItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n // `href` makes it an `<a>`, unless `component` or `asChild` chose the element (see\n // `linkElement`). It used to stay an `<li>` and carry `href` as an attribute.\n const tag = linkElement(component, href, 'li')\n // The kind rather than the tag, counting a router link with `href` or `to` as an anchor: under `asChild`, `tag` is a `Slot` standing in for the caller's\n // element, and a slotted `<a>` is as interactive as `component=\"a\"`.\n const kind = resolveLinkKind(tag, href, rest)\n const isInteractive = isInteractiveKind(kind)\n const linkProps = hrefProps(kind, href, 'ListItem')\n\n const _className = classNames(\n 'list-item',\n color && 'context',\n color,\n {\n 'list-action': isInteractive,\n // An interactive item renders through `Link`, which adds these classes and their ARIA\n // attributes itself.\n active: active && !isInteractive,\n disabled: disabled && !isInteractive\n },\n className\n )\n\n const Component = (isInteractive ? Link : tag) as ElementType\n\n const finalRest = isInteractive\n ? { active, disabled, component: tag, ...linkProps, ...rest }\n : {\n ...(active && { 'aria-current': 'page' }),\n ...(disabled && { 'aria-disabled': true }),\n ...linkProps,\n ...rest\n }\n\n return (\n <Component className={_className} {...finalRest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ListItem = createPolymorphicComponent<ListItemComponent>(\n ListItemRender as ForwardRefRenderFunction<Element, ListItemProps<ElementType>>,\n 'ListItem'\n)\n","import React, {\n Children,\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode\n} from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor, ContextStyle } from '../../types'\nimport {\n hasHref,\n isInteractiveKind,\n linkElement,\n resolveElementTag,\n resolveKindFromProps\n} from '../../utils/elementKind'\nimport { isElementOfType } from '../../utils/lazyElement'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { ListItem } from './ListItem'\n\nexport interface ListItemDef {\n /**\n * Stable key for the rendered item. Falls back to the item's index in `items`.\n */\n id?: number | string\n /**\n * Item label content.\n */\n label: React.ReactNode\n /**\n * Makes the item a link.\n */\n href?: string\n /**\n * Sets the color of the item.\n */\n color?: ContextColor\n /**\n * Marks the item as active.\n */\n active?: boolean\n /**\n * Marks the item as disabled.\n */\n disabled?: boolean\n}\n\ntype ListOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `'ul'`, unless an item (a data-driven item with `href`, or a `<ListItem>` child\n * rendering an `<a>`/`<button>` through `component` or `asChild`) is interactive — a bare\n * `<a>`/`<button>` isn't a valid direct child of `<ul>`/`<ol>`, so the default switches to\n * `'div'` instead. Pass `component` explicitly to opt out of this.\n */\n component?: C\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Remove outer borders and rounded corners to render list items edge-to-edge in a parent component (e.g., `<Card>`).\n */\n flush?: boolean\n /**\n * Array of item definitions for data-driven rendering. When provided, children are ignored.\n */\n items?: ListItemDef[]\n /**\n * Specify a layout type.\n */\n layout?:\n | 'horizontal'\n | 'sm:horizontal'\n | 'md:horizontal'\n | 'lg:horizontal'\n | 'xl:horizontal'\n | '2xl:horizontal'\n /**\n * Number list items sequentially using CSS counters. Pair with `component=\"ol\"` for semantic correctness.\n */\n numbered?: boolean\n /**\n * Remove outer borders, rounded corners, and horizontal padding for a minimal, edge-to-edge appearance.\n */\n plain?: boolean\n /**\n * Applies a `.solid`, `.outline`, or `.smooth` context style. Only meaningful together with `color`.\n */\n variant?: ContextStyle\n}\n\n// What `List` reads off a `<ListItem>` child to decide its own tag.\ntype ListItemChildProps = {\n asChild?: boolean\n children?: ReactNode\n component?: ElementType\n href?: string\n}\n\nexport type ListProps<C extends ElementType = 'ul'> = PolymorphicComponentProps<C, ListOwnProps<C>>\n\ntype ListComponent = (<C extends ElementType = 'ul'>(\n props: ListProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ListRender<C extends ElementType = 'ul'>(\n {\n children,\n className,\n component,\n color,\n variant,\n flush,\n items,\n layout,\n numbered,\n plain,\n ...rest\n }: ListProps<C>,\n ref: PolymorphicRef<C>\n) {\n // A linked item (data-driven `href`, or a `<ListItem>` child rendering an `<a>`/`<button>`,\n // whether through `component` or as its `asChild` element) can't render as a bare\n // `<a>`/`<button>` inside the default `<ul>`/`<ol>` root — only `<li>`/`script`/`template` are\n // valid children there. Default to `<div>` instead when that's the case (unless the caller\n // already chose their own `component`), matching the same `component=\"div\"` pattern already\n // documented for `Stepper`'s composed interactive usage.\n const hasInteractiveItem = items\n ? items.some((item) => hasHref(item.href))\n : Children.toArray(children).some(\n (child) =>\n isElementOfType<ListItemChildProps>(child, ListItem) &&\n isInteractiveKind(resolveKindFromProps(child.props))\n )\n const Component = (component ?? (hasInteractiveItem ? 'div' : 'ul')) as ElementType\n // The tag rather than `Component`, which under `asChild` is a `Slot` holding the caller's\n // `<ul>`/`<ol>`.\n const rootTag = resolveElementTag(Component)\n const isListSemantic = rootTag === 'ul' || rootTag === 'ol'\n\n const _className = classNames(\n 'list',\n color && 'context',\n color,\n variant,\n layout,\n {\n flush,\n plain,\n numbered\n },\n className\n )\n\n const autoContent = items\n ? items.map((item, idx) => {\n const itemClass = classNames('list-item', item.color && 'context', item.color, {\n 'list-action': hasHref(item.href),\n active: item.active,\n disabled: item.disabled\n })\n const Tag = linkElement(undefined, item.href, isListSemantic ? 'li' : 'div')\n return (\n <Tag\n key={item.id ?? idx}\n className={itemClass}\n {...(hasHref(item.href) && { href: item.href })}\n {...(item.active ? { 'aria-current': 'page' } : {})}\n {...(item.disabled ? { 'aria-disabled': true } : {})}\n >\n {item.label}\n </Tag>\n )\n })\n : null\n\n // When the root switched to `div` because of an interactive child, every plain `<ListItem>`\n // sibling defaulting to `<li>` would be just as invalid (only valid inside `<ul>`/`<ol>`/\n // `<menu>`) — so give each `ListItem` child the same `div` treatment the auto-generated items\n // above already get, unless it chose its own element: `component`, `href` or its `asChild`\n // element. Other child types are left untouched — this is only meaningful for `List`'s own list\n // items.\n const renderedChildren =\n autoContent ??\n (isListSemantic\n ? children\n : Children.map(children, (child) =>\n isElementOfType<ListItemChildProps>(child, ListItem) &&\n resolveKindFromProps(child.props) === undefined\n ? React.cloneElement(child, { component: 'div' })\n : child\n ))\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {renderedChildren}\n </Component>\n )\n}\n\nexport const List = createPolymorphicComponent<ListComponent>(\n ListRender as ForwardRefRenderFunction<Element, ListProps<ElementType>>,\n 'List'\n)\n"],"mappings":"mTAqDA,SAAS,EACP,CAAE,WAAU,SAAQ,YAAW,WAAU,QAAO,YAAW,OAAM,GAAG,GACpE,EACA,CAGA,IAAM,EAAM,EAAY,EAAW,EAAM,IAAI,EAGvC,EAAO,EAAgB,EAAK,EAAM,CAAI,EACtC,EAAgB,EAAkB,CAAI,EACtC,EAAY,EAAU,EAAM,EAAM,UAAU,EAE5C,EAAa,EACjB,YACA,GAAS,UACT,EACA,CACE,cAAe,EAGf,OAAQ,GAAU,CAAC,EACnB,SAAU,GAAY,CAAC,CACzB,EACA,CACF,EAEM,EAAa,EAAgB,EAAO,EAEpC,EAAY,EACd,CAAE,SAAQ,WAAU,UAAW,EAAK,GAAG,EAAW,GAAG,CAAK,EAC1D,CACE,GAAI,GAAU,CAAE,eAAgB,MAAO,EACvC,GAAI,GAAY,CAAE,gBAAiB,EAAK,EACxC,GAAG,EACH,GAAG,CACL,EAEJ,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAgB,KAE3C,EADR,CACQ,CAEf,CAEA,MAAa,EAAW,EACtB,EACA,UACF,ECcA,SAAS,EACP,CACE,WACA,YACA,YACA,QACA,UACA,QACA,QACA,SACA,WACA,QACA,GAAG,GAEL,EACA,CAOA,IAAM,EAAqB,EACvB,EAAM,KAAM,GAAS,EAAQ,EAAK,IAAI,CAAC,EACvC,EAAS,QAAQ,CAAQ,CAAC,CAAC,KACxB,GACC,EAAoC,EAAO,CAAQ,GACnD,EAAkB,EAAqB,EAAM,KAAK,CAAC,CACvD,EACE,EAAa,IAAc,EAAqB,MAAQ,MAGxD,EAAU,EAAkB,CAAS,EACrC,EAAiB,IAAY,MAAQ,IAAY,KAEjD,EAAa,EACjB,OACA,GAAS,UACT,EACA,EACA,EACA,CACE,QACA,QACA,UACF,EACA,CACF,EA8BM,GA5Bc,EAChB,EAAM,KAAK,EAAM,IAAQ,CACvB,IAAM,EAAY,EAAW,YAAa,EAAK,OAAS,UAAW,EAAK,MAAO,CAC7E,cAAe,EAAQ,EAAK,IAAI,EAChC,OAAQ,EAAK,OACb,SAAU,EAAK,QACjB,CAAC,EACK,EAAM,EAAY,IAAA,GAAW,EAAK,KAAM,EAAiB,KAAO,KAAK,EAC3E,OACE,EAAA,cAAC,EAAD,CACE,IAAK,EAAK,IAAM,EAChB,UAAW,EACX,GAAK,EAAQ,EAAK,IAAI,GAAK,CAAE,KAAM,EAAK,IAAK,EAC7C,GAAK,EAAK,OAAS,CAAE,eAAgB,MAAO,EAAI,CAAC,EACjD,GAAK,EAAK,SAAW,CAAE,gBAAiB,EAAK,EAAI,CAAC,CAG/C,EADF,EAAK,KACH,CAET,CAAC,EACD,QAUD,EACG,EACA,EAAS,IAAI,EAAW,GACtB,EAAoC,EAAO,CAAQ,GACnD,EAAqB,EAAM,KAAK,IAAM,IAAA,GAClC,EAAM,aAAa,EAAO,CAAE,UAAW,KAAM,CAAC,EAC9C,CACN,GAEN,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAO,EAClB,EACA,MACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./Portal-CgeR1WXV.js";import{i as n,r}from"./overlayPlacement-BtS90IVf.js";import{n as i}from"./Menu-CSBg2Zmc.js";import{a,c as o,i as s,o as ee,r as c,s as l}from"./MenuToggle-7RQ0dmtZ.js";import u,{forwardRef as d,useCallback as f,useContext as p,useEffect as m,useId as te,useRef as h,useState as ne}from"react";import g from"classnames";import{useLocale as _,useOverlayPosition as v}from"react-aria";function y({children:e,className:t,component:n,...r},i){let a=n??`span`,o=g(`menu-text`,t);return u.createElement(a,{className:o,...r,ref:i},e)}const b=e(y,`MenuText`),x=d(({children:e,activation:d=`both`,className:y,disabled:b,offset:x=[-4,0],placement:S,stacked:C,submenuDelay:w=100,trigger:T,...E},D)=>{let O=te(),k=`${O}-trigger`,A=`${O}-menu`,[j,M]=ne(!1),N=h(void 0),P=h(void 0),F=h(null),I=h(null),L=p(s),R=a(),{registerOverlay:z,visible:B}=p(i),{direction:V}=_(),H=V===`rtl`,U=S??(H?`left-start`:`right-start`),{overlayProps:W,placement:G}=v({targetRef:F,overlayRef:I,placement:n(U),offset:x[1],crossOffset:x[0],containerPadding:8,isOpen:j,onClose:null}),{menuStyle:re,placementAttr:ie}=r(W.style,U,G),K=f(()=>{N.current!==void 0&&(window.clearTimeout(N.current),N.current=void 0)},[]),q=f(()=>{P.current!==void 0&&(cancelAnimationFrame(P.current),P.current=void 0)},[]),J=f(()=>{K(),q(),M(!1)},[K,q]),Y=()=>{b||j||(K(),L?.notifyOpen(O),M(!0))},X=()=>{K(),N.current=window.setTimeout(J,w)};m(()=>L?.register(O,J),[L,O,J]),m(()=>K,[K]),m(()=>q,[q]),m(()=>{B||J()},[B,J]);let Z=typeof window<`u`&&!!window.matchMedia&&window.matchMedia(`(hover: hover)`).matches&&(d===`hover`||d===`both`),ae=d===`click`||d===`both`,Q=()=>{Y(),q(),P.current=requestAnimationFrame(()=>{P.current=void 0,ee(l(I.current),`first`)})},$=()=>{J(),F.current?.focus()},oe=e=>{ae&&!b&&(e.preventDefault(),e.stopPropagation(),j?J():Q())},se=H?`ArrowLeft`:`ArrowRight`,ce=e=>{b||(e.key===`Enter`||e.key===` `||e.key===se)&&(e.preventDefault(),e.stopPropagation(),Q())},le={close:$};return u.createElement(`div`,{className:g(`submenu`,{show:j},y),...E,ref:D},u.createElement(`button`,{type:`button`,id:k,role:`menuitem`,className:`menu-item`,"aria-expanded":j,"aria-haspopup":`true`,"aria-controls":j?A:void 0,disabled:b,onClick:oe,onKeyDown:ce,onMouseEnter:Z?Y:void 0,onMouseLeave:Z?X:void 0,ref:e=>{F.current=e}},T),(()=>{let n=u.createElement(`div`,{role:`menu`,id:A,"aria-labelledby":k,className:g(`menu`,{show:j,"submenu-stacked":C}),style:re,"data-cx-placement":ie,onKeyDown:e=>o(e,{onEscape:$,...H?{onArrowRight:$}:{onArrowLeft:$}}),onMouseEnter:Z?K:void 0,onMouseLeave:Z?X:void 0,ref:e=>{I.current=e,z(A,e)}},u.createElement(c.Provider,{value:le},u.createElement(s.Provider,{value:R},e)));return C?n:u.createElement(t,{fallback:n},n)})())});x.displayName=`MenuSubmenu`;const S=d(({children:e,className:t,onClick:n,type:r=`button`,...i},a)=>{let o=p(c),s=e=>{n?.(e),o?.close()};return u.createElement(`button`,{type:r,role:`menuitem`,className:g(`submenu-back`,`menu-item`,t),...i,onClick:s,ref:a},e)});S.displayName=`MenuSubmenuBack`;export{x as n,b as r,S as t};
|
|
2
|
-
//# sourceMappingURL=menu-Upf6P-2P.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"menu-Upf6P-2P.js","names":[],"sources":["../../src/components/menu/MenuText.tsx","../../src/components/menu/MenuSubmenu.tsx","../../src/components/menu/MenuSubmenuBack.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype MenuTextOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type MenuTextProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n MenuTextOwnProps<C>\n>\n\ntype MenuTextComponent = (<C extends ElementType = 'span'>(\n props: MenuTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction MenuTextRender<C extends ElementType = 'span'>(\n { children, className, component, ...rest }: MenuTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('menu-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const MenuText = createPolymorphicComponent<MenuTextComponent>(\n MenuTextRender as ForwardRefRenderFunction<Element, MenuTextProps<ElementType>>,\n 'MenuText'\n)\n","import React, {\n forwardRef,\n HTMLAttributes,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState\n} from 'react'\nimport classNames from 'classnames'\nimport { useLocale, useOverlayPosition } from 'react-aria'\n\nimport { MenuContext } from './Menu'\nimport {\n Placement,\n resolveMenuOverlayPositioning,\n toAriaPlacement\n} from '../../utils/overlayPlacement'\nimport { Portal } from '../portal/Portal'\nimport { focusMenuItem, getMenuItems, handleMenuKeyDown } from './menuNavigation'\nimport { SubmenuActionsContext, SubmenuGroupContext, useSubmenuGroupProvider } from './submenuGroup'\n\nexport interface MenuSubmenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n /**\n * MenuSubmenu activation mode on hover-capable devices. `'click'` activates on click only.\n * `'hover'` activates on hover only. `'both'` (the default) activates on both. Touch\n * devices always use tap regardless of this setting.\n */\n activation?: 'click' | 'hover' | 'both'\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Prevents the submenu from opening.\n */\n disabled?: boolean\n /**\n * Distance between the nested menu and the trigger, as `[skidding, distance]` in pixels.\n */\n offset?: [number, number]\n /**\n * Placement of the nested menu relative to the trigger. Defaults to cascading in the reading\n * direction — `'right-start'` under LTR locales, `'left-start'` under RTL ones (see\n * `useLocale`) — matching native OS/browser submenu behavior. An explicit value always wins\n * over that locale-based default.\n */\n placement?: Placement\n /**\n * Switches to a view-replacement pattern below the `sm` breakpoint. Pair with a\n * `MenuSubmenuBack` as the first item of the nested menu.\n */\n stacked?: boolean\n /**\n * Milliseconds before closing the submenu when the pointer leaves it.\n */\n submenuDelay?: number\n /**\n * Content of the `.menu-item` trigger that opens the submenu.\n */\n trigger: ReactNode\n}\n\nexport const MenuSubmenu = forwardRef<HTMLDivElement, MenuSubmenuProps>(\n (\n {\n children,\n activation = 'both',\n className,\n disabled,\n offset: offsetProp = [-4, 0],\n placement,\n stacked,\n submenuDelay = 100,\n trigger,\n ...rest\n },\n ref\n ) => {\n const id = useId()\n const triggerId = `${id}-trigger`\n const menuId = `${id}-menu`\n const [visible, setVisible] = useState(false)\n const closeTimeoutRef = useRef<number | undefined>(undefined)\n const focusFirstRafRef = useRef<number | undefined>(undefined)\n const triggerRef = useRef<HTMLButtonElement | null>(null)\n const overlayRef = useRef<HTMLElement | null>(null)\n const parentGroup = useContext(SubmenuGroupContext)\n const ownGroup = useSubmenuGroupProvider()\n const { registerOverlay, visible: parentMenuVisible } = useContext(MenuContext)\n const { direction } = useLocale()\n const isRtl = direction === 'rtl'\n const effectivePlacement = placement ?? (isRtl ? 'left-start' : 'right-start')\n\n const { overlayProps, placement: resolvedPlacement } = useOverlayPosition({\n targetRef: triggerRef,\n overlayRef,\n // Viewport-relative (matching the portal below): the trigger lives inside the parent\n // menu's own floated panel, and `useOverlayPosition` measures against the overlay's real\n // containing block — since the panel portals straight to `document.body`, that resolves\n // the same way a `fixed`-strategy engine would.\n placement: toAriaPlacement(effectivePlacement),\n offset: offsetProp[1],\n crossOffset: offsetProp[0],\n containerPadding: 8,\n isOpen: visible,\n // See `useOverlayPlacement`'s comment for why this needs to be explicit `null`, not left\n // unset — matches the same fix already applied to `Autocomplete`/`Combobox`/`Menu`/`Popover`.\n onClose: null\n })\n\n const { menuStyle, placementAttr } = resolveMenuOverlayPositioning(\n overlayProps.style,\n effectivePlacement,\n resolvedPlacement\n )\n\n const clearCloseTimeout = useCallback(() => {\n if (closeTimeoutRef.current !== undefined) {\n window.clearTimeout(closeTimeoutRef.current)\n closeTimeoutRef.current = undefined\n }\n }, [])\n\n const cancelFocusFirstRaf = useCallback(() => {\n if (focusFirstRafRef.current !== undefined) {\n cancelAnimationFrame(focusFirstRafRef.current)\n focusFirstRafRef.current = undefined\n }\n }, [])\n\n const close = useCallback(() => {\n clearCloseTimeout()\n cancelFocusFirstRaf()\n setVisible(false)\n }, [clearCloseTimeout, cancelFocusFirstRaf])\n\n const open = () => {\n if (disabled || visible) return\n clearCloseTimeout()\n parentGroup?.notifyOpen(id)\n setVisible(true)\n }\n\n const scheduleClose = () => {\n clearCloseTimeout()\n closeTimeoutRef.current = window.setTimeout(close, submenuDelay)\n }\n\n useEffect(() => parentGroup?.register(id, close), [parentGroup, id, close])\n useEffect(() => clearCloseTimeout, [clearCloseTimeout])\n useEffect(() => cancelFocusFirstRaf, [cancelFocusFirstRaf])\n\n // The submenu's own open state is local and doesn't otherwise hear about its ancestor\n // `Menu` closing (via Escape, outside click, etc.) — without this it's left open and\n // fully visible (it's portaled to `document.body`, so nothing hides it for free) even\n // after the menu it belongs to has disappeared.\n useEffect(() => {\n if (!parentMenuVisible) close()\n }, [parentMenuVisible, close])\n\n const supportsHover =\n typeof window !== 'undefined' &&\n !!window.matchMedia &&\n window.matchMedia('(hover: hover)').matches\n const hoverEnabled = supportsHover && (activation === 'hover' || activation === 'both')\n const clickEnabled = activation === 'click' || activation === 'both'\n\n const openAndFocusFirst = () => {\n open()\n cancelFocusFirstRaf()\n focusFirstRafRef.current = requestAnimationFrame(() => {\n focusFirstRafRef.current = undefined\n focusMenuItem(getMenuItems(overlayRef.current), 'first')\n })\n }\n\n const closeAndRefocusTrigger = () => {\n close()\n triggerRef.current?.focus()\n }\n\n const handleTriggerClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (!clickEnabled || disabled) return\n event.preventDefault()\n event.stopPropagation()\n visible ? close() : openAndFocusFirst()\n }\n\n // A submenu cascades toward the reading direction, so the arrow key that opens it (and the\n // one its own item list closes on, below) mirror too: ArrowRight/ArrowLeft under LTR,\n // ArrowLeft/ArrowRight under RTL.\n const openKey = isRtl ? 'ArrowLeft' : 'ArrowRight'\n\n const handleTriggerKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (disabled) return\n if (event.key === 'Enter' || event.key === ' ' || event.key === openKey) {\n event.preventDefault()\n event.stopPropagation()\n openAndFocusFirst()\n }\n }\n\n const actionsValue = { close: closeAndRefocusTrigger }\n\n return (\n <div className={classNames('submenu', { show: visible }, className)} {...rest} ref={ref}>\n <button\n type=\"button\"\n id={triggerId}\n role=\"menuitem\"\n className=\"menu-item\"\n aria-expanded={visible}\n aria-haspopup=\"true\"\n aria-controls={visible ? menuId : undefined}\n disabled={disabled}\n onClick={handleTriggerClick}\n onKeyDown={handleTriggerKeyDown}\n onMouseEnter={hoverEnabled ? open : undefined}\n onMouseLeave={hoverEnabled ? scheduleClose : undefined}\n ref={(node) => {\n triggerRef.current = node\n }}\n >\n {trigger}\n </button>\n {(() => {\n const panel = (\n <div\n role=\"menu\"\n id={menuId}\n aria-labelledby={triggerId}\n className={classNames('menu', { show: visible, 'submenu-stacked': stacked })}\n style={menuStyle}\n data-cx-placement={placementAttr}\n onKeyDown={(event) =>\n handleMenuKeyDown(event, {\n onEscape: closeAndRefocusTrigger,\n ...(isRtl\n ? { onArrowRight: closeAndRefocusTrigger }\n : { onArrowLeft: closeAndRefocusTrigger })\n })\n }\n onMouseEnter={hoverEnabled ? clearCloseTimeout : undefined}\n onMouseLeave={hoverEnabled ? scheduleClose : undefined}\n // Registers this panel with the ancestor `Menu` (see `MenuContext.registerOverlay`)\n // so its own click-dismiss logic recognizes clicks here as \"inside\" the menu — the\n // panel portals straight to `document.body` when not `stacked`, so plain DOM\n // containment against the top-level menu's own element wouldn't otherwise see it.\n ref={(node) => {\n overlayRef.current = node\n registerOverlay(menuId, node)\n }}\n >\n <SubmenuActionsContext.Provider value={actionsValue}>\n <SubmenuGroupContext.Provider value={ownGroup}>\n {children}\n </SubmenuGroupContext.Provider>\n </SubmenuActionsContext.Provider>\n </div>\n )\n\n // `stacked`'s sm-breakpoint CSS (`.menu:has(.submenu-stacked.show) ...`) needs the\n // panel to be a real DOM descendant of `.menu`/`.submenu` to match — portaling would\n // break that ancestor relationship, so it renders inline instead. Trade-off: above the\n // `sm` breakpoint a `stacked` submenu no longer escapes ancestor overflow/stacking-\n // context clipping the way a portaled one does; accepted since `stacked` targets mobile\n // nav/drawer usage, not floating dropdowns.\n // On the server and during hydration the panel renders inline next to its trigger, which\n // is what the server's HTML holds; `Portal` moves it to `document.body` afterwards.\n return stacked ? panel : <Portal fallback={panel}>{panel}</Portal>\n })()}\n </div>\n )\n }\n)\n\nMenuSubmenu.displayName = 'MenuSubmenu'\n","import React, { ButtonHTMLAttributes, forwardRef, useContext } from 'react'\nimport classNames from 'classnames'\n\nimport { SubmenuActionsContext } from './submenuGroup'\n\nexport interface MenuSubmenuBackProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n}\n\n// First item of a stacked submenu's nested menu (see `MenuSubmenu`'s `stacked` prop). Closes\n// the submenu and returns focus to its trigger — visible only below the `sm` breakpoint.\nexport const MenuSubmenuBack = forwardRef<HTMLButtonElement, MenuSubmenuBackProps>(\n ({ children, className, onClick, type = 'button', ...rest }, ref) => {\n const actions = useContext(SubmenuActionsContext)\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n actions?.close()\n }\n\n return (\n <button\n type={type}\n role=\"menuitem\"\n className={classNames('submenu-back', 'menu-item', className)}\n {...rest}\n onClick={handleClick}\n ref={ref}\n >\n {children}\n </button>\n )\n }\n)\n\nMenuSubmenuBack.displayName = 'MenuSubmenuBack'\n"],"mappings":"ifA6BA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,OACzB,EAAa,EAAW,YAAa,CAAS,EAEpD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAW,EACtB,EACA,UACF,ECmBa,EAAc,GA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A,GAC7C,IAAM,GAAS,CACb,EAAW,QAAU,CACvB,CAGM,EADL,CACK,OACA,CACN,IAAM,EACJ,EAAA,cAAC,MAAD,CACE,KAAK,OACL,GAAI,EACJ,kBAAiB,EACjB,UAAW,EAAW,OAAQ,CAAE,KAAM,EAAS,kBAAmB,CAAQ,CAAC,EAC3E,MAAO,GACP,oBAAmB,GACnB,UAAY,GACV,EAAkB,EAAO,CACvB,SAAU,EACV,GAAI,EACA,CAAE,aAAc,CAAuB,EACvC,CAAE,YAAa,CAAuB,CAC5C,CAAC,EAEH,aAAc,EAAe,EAAoB,IAAA,GACjD,aAAc,EAAe,EAAgB,IAAA,GAK7C,IAAM,GAAS,CACb,EAAW,QAAU,EACrB,EAAgB,EAAQ,CAAI,CAC9B,CAOG,EALH,EAAA,cAAC,EAAsB,SAAvB,CAAgC,MAAO,EAIP,EAH9B,EAAA,cAAC,EAAoB,SAArB,CAA8B,MAAO,CAEP,EAD3B,CAC2B,CACA,CAC7B,EAWP,OAAO,EAAU,EAAQ,EAAA,cAAC,EAAD,CAAQ,SAAU,CAAsB,EAAd,CAAc,CACnE,EAAA,CAAG,CACA,CAET,CACF,EAEA,EAAY,YAAc,cCzQ1B,MAAa,EAAkB,GAC5B,CAAE,WAAU,YAAW,UAAS,OAAO,SAAU,GAAG,GAAQ,IAAQ,CACnE,IAAM,EAAU,EAAW,CAAqB,EAE1C,EAAe,GAA+C,CAClE,IAAU,CAAK,EACf,GAAS,MAAM,CACjB,EAEA,OACE,EAAA,cAAC,SAAD,CACQ,OACN,KAAK,WACL,UAAW,EAAW,eAAgB,YAAa,CAAS,EAC5D,GAAI,EACJ,QAAS,EACJ,KAGC,EADL,CACK,CAEZ,CACF,EAEA,EAAgB,YAAc"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{t}from"./useDialogElement-CgOnJAzu.js";import{t as n}from"./CloseButton-DPgQztE0.js";import r,{createContext as i,forwardRef as a,useContext as o,useId as s}from"react";import c from"classnames";const l=i({close:()=>{}}),u=a(({children:e,backdrop:n=!0,className:i,defaultVisible:a,fullscreen:o,instant:u,keyboard:d=!0,modal:f=!0,onClick:p,onClose:m,onClosePrevented:h,onHidden:g,onShow:_,onShown:v,onVisibleChange:y,scrollable:b,size:x,open:S,visible:C,...w},T)=>{let{close:E,forkedRef:D,handleBackdropClick:O,handleCancel:k,hiding:A,staticBounce:j}=t({backdrop:n,defaultVisible:a,instant:u,isModal:f,keyboard:d,onClick:p,onClose:m,onClosePrevented:h,onHidden:g,onShow:_,onShown:v,onVisibleChange:y,open:S,ref:T,visible:C}),M=s(),N=c(`modal`,`dialog`,{[typeof o==`boolean`?`fullscreen`:`max-${o}:fullscreen`]:o,[`${x}`]:x,instant:u,nonmodal:!f,scrollable:b,hiding:A,"dialog-static":j},i);return r.createElement(l.Provider,{value:{close:E,titleId:M}},r.createElement(`dialog`,{"aria-labelledby":M,...w,open:S,className:N,onCancel:k,onClick:O,ref:D},e))});u.displayName=`Modal`;const d=()=>o(l);function f({children:e,className:t,component:n,...i},a){let o=n??`div`,s=c(`modal-body`,t);return r.createElement(o,{className:s,...i,ref:a},e)}const p=e(f,`ModalBody`);function m({children:e,className:t,component:n,stacked:i,...a},o){let s=n??`div`,l=c(`modal-footer`,{stacked:i},t);return r.createElement(s,{className:l,...a,ref:o},e)}const h=e(m,`ModalFooter`);function g({children:e,className:t,closeButton:i=!0,closeLabel:a,component:o,...s},l){let u=o??`div`,{close:f}=d(),p=c(`modal-header`,t);return r.createElement(u,{className:p,...s,ref:l},e,i&&r.createElement(n,{label:a,onClick:f}))}const _=e(g,`ModalHeader`);function v({children:e,component:t,className:n,id:i,...a},o){let{titleId:s}=d(),l=t??`h2`,u=c(`modal-title`,n);return r.createElement(l,{className:u,id:i??s,...a,ref:o},e)}const y=e(v,`ModalTitle`);export{d as a,p as i,_ as n,u as o,h as r,y as t};
|
|
2
|
-
//# sourceMappingURL=modal-bgDR29Jh.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal-bgDR29Jh.js","names":[],"sources":["../../src/components/modal/Modal.tsx","../../src/hooks/useModal.ts","../../src/components/modal/ModalBody.tsx","../../src/components/modal/ModalFooter.tsx","../../src/components/modal/ModalHeader.tsx","../../src/components/modal/ModalTitle.tsx"],"sourcesContent":["import React, { createContext, DialogHTMLAttributes, forwardRef, useId } from 'react'\nimport classNames from 'classnames'\n\nimport { useDialogElement } from '../../hooks'\n\nexport interface ModalProps extends Omit<\n DialogHTMLAttributes<HTMLDialogElement>,\n 'onCancel' | 'onClose'\n> {\n /**\n * Show a backdrop while the modal is open. `'static'` blocks closing on backdrop click\n * (the modal bounces instead). `false` is intentionally not equivalent to `modal={false}` —\n * unlike `Drawer`, whose vanilla chassis-css counterpart derives modality from `backdrop`,\n * chassis-css's vanilla `Dialog` only ever reads `backdrop` to distinguish `'static'` from\n * everything else; `modal` alone decides `showModal()`/`show()`. This mirrors that faithfully\n * rather than reintroducing an inconsistency with the vendored behavior.\n */\n backdrop?: boolean | 'static'\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Whether the modal is open when it first renders. Such a modal is uncontrolled: it closes\n * itself on a close request. Use `visible` to open and close it from outside.\n */\n defaultVisible?: boolean\n /**\n * Set modal to cover the entire user viewport. A breakpoint value goes fullscreen only\n * below that breakpoint.\n */\n fullscreen?: boolean | 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n /**\n * Disable the open/close transition entirely.\n */\n instant?: boolean\n /**\n * Closes the modal when the escape key is pressed.\n */\n keyboard?: boolean\n /**\n * Open with `showModal()` (top-layer, native backdrop). Set `false` to open with `show()`\n * instead — no backdrop, and the page behind the modal stays interactive.\n */\n modal?: boolean\n /**\n * Renders the modal open from its first paint, server HTML included, as a non-modal dialog: a\n * static preview. It stays open until a close request. Use `visible` or `defaultVisible` to\n * open it as a modal dialog.\n */\n open?: boolean\n /**\n * Callback fired when the modal requests to be closed (escape, backdrop click, or close button).\n */\n onClose?: () => void\n /**\n * Callback fired when a close attempt is blocked (static backdrop click, or escape with `keyboard=false`).\n */\n onClosePrevented?: () => void\n /**\n * Callback fired after the exit transition completes and the modal is fully hidden.\n */\n onHidden?: () => void\n /**\n * Callback fired when the modal starts to open.\n */\n onShow?: () => void\n /**\n * Callback fired after the entry transition completes and the modal is fully visible.\n */\n onShown?: () => void\n /**\n * Callback fired with `false` when the modal requests to be closed, at the same moments as\n * `onClose`. It makes `visible` and `onVisibleChange` a pair that takes a state setter.\n */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Create a scrollable modal — the header and footer stay fixed while the body scrolls.\n */\n scrollable?: boolean\n /**\n * Size the component sm, lg, or extra lg.\n */\n size?: 'sm' | 'lg' | 'xl'\n /**\n * Whether the modal is open. The modal is then controlled: a close request only fires\n * `onClose` and `onVisibleChange`, and the modal closes when this becomes `false`.\n */\n visible?: boolean\n}\n\nexport interface ModalContextProps {\n /**\n * Requests the modal be closed — fires `onClose`. Wire this to any element's `onClick`; see\n * `useModal`.\n */\n close: () => void\n /**\n * Id generated by `Modal` and applied automatically by `ModalTitle` to itself, so the\n * dialog's `aria-labelledby` resolves to it without any manual wiring.\n */\n titleId?: string\n}\n\nexport const ModalContext = createContext<ModalContextProps>({ close: () => {} })\n\nexport const Modal = forwardRef<HTMLDialogElement, ModalProps>(\n (\n {\n children,\n backdrop = true,\n className,\n defaultVisible,\n fullscreen,\n instant,\n keyboard = true,\n modal = true,\n onClick,\n onClose,\n onClosePrevented,\n onHidden,\n onShow,\n onShown,\n onVisibleChange,\n scrollable,\n size,\n open,\n visible,\n ...rest\n },\n ref\n ) => {\n const { close, forkedRef, handleBackdropClick, handleCancel, hiding, staticBounce } =\n useDialogElement({\n backdrop,\n defaultVisible,\n instant,\n isModal: modal,\n keyboard,\n onClick,\n onClose,\n onClosePrevented,\n onHidden,\n onShow,\n onShown,\n onVisibleChange,\n open,\n ref,\n visible\n })\n\n const titleId = useId()\n\n const _className = classNames(\n 'modal',\n 'dialog',\n {\n [typeof fullscreen === 'boolean' ? 'fullscreen' : `max-${fullscreen}:fullscreen`]:\n fullscreen,\n [`${size}`]: size,\n instant,\n nonmodal: !modal,\n scrollable,\n hiding,\n 'dialog-static': staticBounce\n },\n className\n )\n\n return (\n <ModalContext.Provider value={{ close, titleId }}>\n <dialog\n aria-labelledby={titleId}\n {...rest}\n open={open}\n className={_className}\n onCancel={handleCancel}\n onClick={handleBackdropClick}\n ref={forkedRef}\n >\n {children}\n </dialog>\n </ModalContext.Provider>\n )\n }\n)\n\nModal.displayName = 'Modal'\n","import { useContext } from 'react'\nimport { ModalContext, ModalContextProps } from '../components/modal/Modal'\n\nexport type UseModalResult = ModalContextProps\n\n// Reach the enclosing `Modal`'s close handler from anywhere in its composed markup — e.g. to\n// close it from a plain `Button` placed in a `ModalFooter`. Only meaningful inside a `Modal`;\n// outside one it returns a no-op `close`.\nexport const useModal = (): UseModalResult => useContext(ModalContext)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype ModalBodyOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type ModalBodyProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ModalBodyOwnProps<C>\n>\n\ntype ModalBodyComponent = (<C extends ElementType = 'div'>(\n props: ModalBodyProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ModalBodyRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: ModalBodyProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('modal-body', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ModalBody = createPolymorphicComponent<ModalBodyComponent>(\n ModalBodyRender as ForwardRefRenderFunction<Element, ModalBodyProps<ElementType>>,\n 'ModalBody'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype ModalFooterOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Stack the footer actions as full-width columns instead of a right-aligned row.\n */\n stacked?: boolean\n}\n\nexport type ModalFooterProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ModalFooterOwnProps<C>\n>\n\ntype ModalFooterComponent = (<C extends ElementType = 'div'>(\n props: ModalFooterProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ModalFooterRender<C extends ElementType = 'div'>(\n { children, className, component, stacked, ...rest }: ModalFooterProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('modal-footer', { stacked }, className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ModalFooter = createPolymorphicComponent<ModalFooterComponent>(\n ModalFooterRender as ForwardRefRenderFunction<Element, ModalFooterProps<ElementType>>,\n 'ModalFooter'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { useModal } from '../../hooks'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { CloseButton } from '../close-button/CloseButton'\n\ntype ModalHeaderOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Add a close button component to the header.\n */\n closeButton?: boolean\n /**\n * Overrides the close button's accessible name (defaults to `'Close'`). Set this for\n * non-English UIs.\n */\n closeLabel?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type ModalHeaderProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n ModalHeaderOwnProps<C>\n>\n\ntype ModalHeaderComponent = (<C extends ElementType = 'div'>(\n props: ModalHeaderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ModalHeaderRender<C extends ElementType = 'div'>(\n { children, className, closeButton = true, closeLabel, component, ...rest }: ModalHeaderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const { close } = useModal()\n const _className = classNames('modal-header', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n {closeButton && <CloseButton label={closeLabel} onClick={close} />}\n </Component>\n )\n}\n\nexport const ModalHeader = createPolymorphicComponent<ModalHeaderComponent>(\n ModalHeaderRender as ForwardRefRenderFunction<Element, ModalHeaderProps<ElementType>>,\n 'ModalHeader'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { useModal } from '../../hooks'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype ModalTitleOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type ModalTitleProps<C extends ElementType = 'h2'> = PolymorphicComponentProps<\n C,\n ModalTitleOwnProps<C>\n>\n\ntype ModalTitleComponent = (<C extends ElementType = 'h2'>(\n props: ModalTitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction ModalTitleRender<C extends ElementType = 'h2'>(\n { children, component, className, id, ...rest }: ModalTitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const { titleId } = useModal()\n const Component = component ?? 'h2'\n const _className = classNames('modal-title', className)\n\n return (\n <Component className={_className} id={id ?? titleId} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const ModalTitle = createPolymorphicComponent<ModalTitleComponent>(\n ModalTitleRender as ForwardRefRenderFunction<Element, ModalTitleProps<ElementType>>,\n 'ModalTitle'\n)\n"],"mappings":"yRAwGA,MAAa,EAAe,EAAiC,CAAE,UAAa,CAAC,CAAE,CAAC,EAEnE,EAAQ,GAEjB,CACE,WACA,WAAW,GACX,YACA,iBACA,aACA,UACA,WAAW,GACX,QAAQ,GACR,UACA,UACA,mBACA,WACA,SACA,UACA,kBACA,aACA,OACA,OACA,UACA,GAAG,GAEL,IACG,CACH,GAAM,CAAE,QAAO,YAAW,sBAAqB,eAAc,SAAQ,gBACnE,EAAiB,CACf,WACA,iBACA,UACA,QAAS,EACT,WACA,UACA,UACA,mBACA,WACA,SACA,UACA,kBACA,OACA,MACA,SACF,CAAC,EAEG,EAAU,EAAM,EAEhB,EAAa,EACjB,QACA,SACA,EACG,OAAO,GAAe,UAAY,aAAe,OAAO,EAAW,cAClE,GACD,GAAG,KAAS,EACb,UACA,SAAU,CAAC,EACX,aACA,SACA,gBAAiB,CACnB,EACA,CACF,EAEA,OACE,EAAA,cAAC,EAAa,SAAd,CAAuB,MAAO,CAAE,QAAO,SAAQ,CAYxB,EAXrB,EAAA,cAAC,SAAD,CACE,kBAAiB,EACjB,GAAI,EACE,OACN,UAAW,EACX,SAAU,EACV,QAAS,EACT,IAAK,CAGC,EADL,CACK,CACa,CAE3B,CACF,EAEA,EAAM,YAAc,QCnLpB,MAAa,MAAiC,EAAW,CAAY,ECqBrE,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,GAAG,GACrC,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,aAAc,CAAS,EAErD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAY,EACvB,EACA,WACF,ECbA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,UAAS,GAAG,GAC9C,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EAAW,eAAgB,CAAE,SAAQ,EAAG,CAAS,EAEpE,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAEtC,EADR,CACQ,CAEf,CAEA,MAAa,EAAc,EACzB,EACA,aACF,ECVA,SAAS,EACP,CAAE,WAAU,YAAW,cAAc,GAAM,aAAY,YAAW,GAAG,GACrE,EACA,CACA,IAAM,EAAY,GAAa,MACzB,CAAE,SAAU,EAAS,EACrB,EAAa,EAAW,eAAgB,CAAS,EAEvD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAGtC,EAFR,EACA,GAAe,EAAA,cAAC,EAAD,CAAa,MAAO,EAAY,QAAS,CAAQ,CAAA,CACxD,CAEf,CAEA,MAAa,EAAc,EACzB,EACA,aACF,EC7BA,SAAS,EACP,CAAE,WAAU,YAAW,YAAW,KAAI,GAAG,GACzC,EACA,CACA,GAAM,CAAE,WAAY,EAAS,EACvB,EAAY,GAAa,KACzB,EAAa,EAAW,cAAe,CAAS,EAEtD,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,GAAM,EAAS,GAAI,EAAW,KAEzD,EADR,CACQ,CAEf,CAEA,MAAa,EAAa,EACxB,EACA,YACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{m as e,u as t,v as n}from"./slot-CNhFZdHF.js";import{t as r}from"./useForkedRef-DVEfT-KI.js";import{t as i}from"./polymorphic-BhGNZQja.js";import{t as a}from"./Link-DyZyAQFj.js";import{a as o,i as s,o as c,r as l,s as u}from"./navOverflow-B5krZe6D.js";import{t as d}from"./navVariant-DeGTk9B7.js";import f,{forwardRef as p}from"react";import m from"classnames";function h({children:e,className:t,...n},r){let i=m(`nav-link`,t),s=c();return f.createElement(f.Fragment,null,f.createElement(a,{className:i,...n,ref:r},e),s&&f.createElement(o,{props:{...n,children:e}}))}const g=i(h,`NavLink`),_=new Set([`active`,`color`,`disabled`,`iconLink`,`reset`,`stretched`,`type`]);function v({children:e,className:i,keepVisible:a,...o},s){let c=m(`nav-item`,{"nav-overflow-keep":a},i),{asChild:d,component:p,href:h}=o,v=u(),y=r(s,v.ref),b=v.hidden?{"data-cx-nav-overflow":`true`}:void 0;if(t(h)||p!==void 0||d)return f.createElement(`li`,{className:c,...b,ref:y},f.createElement(l,{value:v.scope},f.createElement(g,o,e)));let{active:x,disabled:S}=o,C=Object.fromEntries(Object.entries(o).filter(([e])=>!_.has(e)));return n(!!x||!!S,"NavItem: `active` and `disabled` style its link, and without `href`, `component` or `asChild` it renders none. Put them on the link inside it."),f.createElement(`li`,{className:c,...C,...b,ref:y},f.createElement(l,{value:v.scope},e))}const y=p(v);y.displayName=`NavItem`;function b({children:t,className:n,component:r,items:i,layout:a,size:o,variant:c,...l},u){let p=r??`ul`,h=m(`nav`,o,{[`nav-${a}`]:a},d(c,`Nav`),n),g=i?i.map((e,t)=>f.createElement(y,{key:t,active:e.active,disabled:e.disabled,href:e.href},e.label)):null;return f.createElement(p,{className:h,...l,ref:u},f.createElement(s,{tag:e(p)},g??t))}const x=i(b,`Nav`),S=p(({children:e,className:t,...n},r)=>{let i=m(`nav-title`,t);return f.createElement(`li`,{className:i,...n,ref:r},e)});S.displayName=`NavTitle`;export{g as i,x as n,y as r,S as t};
|
|
2
|
-
//# sourceMappingURL=nav-DI6oEULI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-DI6oEULI.js","names":[],"sources":["../../src/components/nav/NavLink.tsx","../../src/components/nav/NavItem.tsx","../../src/components/nav/Nav.tsx","../../src/components/nav/NavTitle.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { NavOverflowLink, useIsNavOverflowLink } from '../../utils/navOverflow'\nimport { createPolymorphicComponent, PolymorphicRef } from '../../utils/polymorphic'\nimport { LinkProps, Link } from '../link/Link'\n\ntype NavLinkOwnProps = {\n /**\n * Toggle the active state for the component.\n */\n active?: boolean\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Toggle the disabled state for the component.\n */\n disabled?: boolean\n}\n\nexport type NavLinkProps<C extends ElementType = 'a'> = LinkProps<C> & NavLinkOwnProps\n\ntype NavLinkComponent = (<C extends ElementType = 'a'>(\n props: NavLinkProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavLinkRender<C extends ElementType = 'a'>(\n { children, className, ...rest }: NavLinkProps<C>,\n ref: PolymorphicRef<C>\n) {\n const _className = classNames('nav-link', className)\n // Inside a `NavOverflow`, the link of an item that doesn't fit is shown in the menu instead, as\n // a `MenuItem` with these props.\n const isOverflowLink = useIsNavOverflowLink()\n\n return (\n <>\n <Link\n className={_className}\n {...(rest as Record<string, unknown>)}\n ref={ref as PolymorphicRef<ElementType>}\n >\n {children}\n </Link>\n {isOverflowLink && <NavOverflowLink props={{ ...rest, children }} />}\n </>\n )\n}\n\nexport const NavLink = createPolymorphicComponent<NavLinkComponent>(\n NavLinkRender as ForwardRefRenderFunction<Element, NavLinkProps<ElementType>>,\n 'NavLink'\n)\n","import React, {\n ElementType,\n ForwardRefRenderFunction,\n forwardRef,\n ReactElement,\n ReactNode,\n Ref\n} from 'react'\nimport classNames from 'classnames'\n\nimport { useForkedRef } from '../../hooks'\nimport { devWarning } from '../../utils/devWarning'\nimport { hasHref } from '../../utils/elementKind'\nimport { NavOverflowItemScope, useNavOverflowItem } from '../../utils/navOverflow'\nimport { NavLink, NavLinkProps } from './NavLink'\n\nexport type NavItemProps<C extends ElementType = 'a'> = NavLinkProps<C> & {\n /**\n * Keeps the item in the list inside a `NavOverflow`, whatever the width.\n */\n keepVisible?: boolean\n}\n\ntype NavItemComponent = (<C extends ElementType = 'a'>(\n props: NavItemProps<C> & { ref?: Ref<HTMLLIElement> }\n) => ReactElement | null) & { displayName?: string }\n\nconst LINK_ONLY_PROPS = new Set([\n 'active',\n 'color',\n 'disabled',\n 'iconLink',\n 'reset',\n 'stretched',\n 'type'\n])\n\n// A `.nav-item` wrapping a `.nav-link` when there is a link to render: an `href`, or a `component`\n// or `asChild` element, which `NavLink` renders. Otherwise a bare `<li>` around `children`, such as\n// a `MenuToggle`. Only the `<li>` takes the caller's own attributes then: `active`, `disabled` and\n// the other `NavLink` props style a link, and on the `<li>` they were written out as invalid\n// attributes (`disabled=\"\"`, `component=\"button\"`).\nfunction NavItemRender<C extends ElementType = 'a'>(\n { children, className, keepVisible, ...rest }: NavItemProps<C>,\n ref: Ref<HTMLLIElement>\n) {\n const _className = classNames('nav-item', { 'nav-overflow-keep': keepVisible }, className)\n const { asChild, component, href } = rest as {\n asChild?: boolean\n component?: ElementType\n href?: string\n }\n // Inside a `NavOverflow`: the `<li>` is what it measures, and hides when the item is in the\n // menu. chassis-css hides it by this attribute.\n const overflow = useNavOverflowItem()\n const forkedRef = useForkedRef(ref, overflow.ref)\n const overflowProps = overflow.hidden ? { 'data-cx-nav-overflow': 'true' } : undefined\n\n if (hasHref(href) || component !== undefined || asChild) {\n return (\n <li className={_className} {...overflowProps} ref={forkedRef}>\n <NavOverflowItemScope value={overflow.scope}>\n <NavLink {...(rest as Record<string, unknown>)}>{children as ReactNode}</NavLink>\n </NavOverflowItemScope>\n </li>\n )\n }\n\n const { active, disabled } = rest as NavLinkProps<'a'>\n const itemProps = Object.fromEntries(\n Object.entries(rest).filter(([key]) => !LINK_ONLY_PROPS.has(key))\n )\n devWarning(\n !!active || !!disabled,\n 'NavItem: `active` and `disabled` style its link, and without `href`, `component` or ' +\n '`asChild` it renders none. Put them on the link inside it.'\n )\n return (\n <li className={_className} {...itemProps} {...overflowProps} ref={forkedRef}>\n <NavOverflowItemScope value={overflow.scope}>{children}</NavOverflowItemScope>\n </li>\n )\n}\n\nexport const NavItem = forwardRef(\n NavItemRender as ForwardRefRenderFunction<HTMLLIElement, NavItemProps<ElementType>>\n) as NavItemComponent\n\nNavItem.displayName = 'NavItem'\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { resolveElementTag } from '../../utils/elementKind'\nimport { NavOverflowItems } from '../../utils/navOverflow'\nimport { NavVariant, navVariantClassName } from '../../utils/navVariant'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { NavItem } from './NavItem'\n\nexport interface NavItemDef {\n /**\n * Label content for the nav item.\n */\n label: React.ReactNode\n /**\n * URL for the nav link.\n */\n href?: string\n /**\n * Marks the item as active.\n */\n active?: boolean\n /**\n * Marks the item as disabled.\n */\n disabled?: boolean\n}\n\ntype NavOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Array of nav item definitions for data-driven rendering. When provided, children are ignored.\n */\n items?: NavItemDef[]\n /**\n * Specify a layout type for component.\n */\n layout?: 'fill' | 'justified'\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set the nav variant to tabs, to segments (a segmented control) or to underline, which\n * underlines the active link. `'pills'` is the former name of `'segments'`: deprecated, it\n * renders the same.\n *\n * @type { 'tabs' | 'segments' | 'underline' | 'pills' }\n */\n variant?: NavVariant\n}\n\nexport type NavProps<C extends ElementType = 'ul'> = PolymorphicComponentProps<C, NavOwnProps<C>>\n\ntype NavComponent = (<C extends ElementType = 'ul'>(\n props: NavProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavRender<C extends ElementType = 'ul'>(\n { children, className, component, items, layout, size, variant, ...rest }: NavProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'ul'\n const _className = classNames(\n 'nav',\n size,\n { [`nav-${layout}`]: layout },\n navVariantClassName(variant, 'Nav'),\n className\n )\n\n const autoContent = items\n ? items.map((item, idx) => (\n <NavItem\n // eslint-disable-next-line react/no-array-index-key\n key={idx}\n active={item.active}\n disabled={item.disabled}\n href={item.href}\n >\n {item.label}\n </NavItem>\n ))\n : null\n\n // No `role`: `navigation` on the `<ul>` took away its list semantics, and `ul` doesn't allow\n // that role. A landmark is the caller's `<nav>` around it, or `component=\"nav\"` holding\n // `NavLink`s without items.\n return (\n <Component className={_className} {...rest} ref={ref}>\n {/* Inside a `NavOverflow`, the items it collapses and its toggle item. */}\n <NavOverflowItems tag={resolveElementTag(Component)}>\n {autoContent ?? children}\n </NavOverflowItems>\n </Component>\n )\n}\n\nexport const Nav = createPolymorphicComponent<NavComponent>(\n NavRender as ForwardRefRenderFunction<Element, NavProps<ElementType>>,\n 'Nav'\n)\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nexport interface NavTitleProps extends HTMLAttributes<HTMLLIElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n}\n\nexport const NavTitle = forwardRef<HTMLLIElement, NavTitleProps>(\n ({ children, className, ...rest }, ref) => {\n const _className = classNames('nav-title', className)\n return (\n <li className={_className} {...rest} ref={ref}>\n {children}\n </li>\n )\n }\n)\n\nNavTitle.displayName = 'NavTitle'\n"],"mappings":"iZA4BA,SAAS,EACP,CAAE,WAAU,YAAW,GAAG,GAC1B,EACA,CACA,IAAM,EAAa,EAAW,WAAY,CAAS,EAG7C,EAAiB,EAAqB,EAE5C,OACE,EAAA,cAAA,EAAA,SAAA,KACE,EAAA,cAAC,EAAD,CACE,UAAW,EACX,GAAK,EACA,KAGD,EADH,CACG,EACL,GAAkB,EAAA,cAAC,EAAD,CAAiB,MAAO,CAAE,GAAG,EAAM,UAAS,CAAI,CAAA,CACnE,CAEN,CAEA,MAAa,EAAU,EACrB,EACA,SACF,EC3BM,EAAkB,IAAI,IAAI,CAC9B,SACA,QACA,WACA,WACA,QACA,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IAGJ,EADN,EAAK,KACC,CACV,EACD,KAKJ,OACE,EAAA,cAAC,EAAD,CAAW,UAAW,EAAY,GAAI,EAAW,KAKtC,EAHT,EAAA,cAAC,EAAD,CAAkB,IAAK,EAAkB,CAAS,CAEhC,EADf,GAAe,CACA,CACT,CAEf,CAEA,MAAa,EAAM,EACjB,EACA,KACF,ECtGa,EAAW,GACrB,CAAE,WAAU,YAAW,GAAG,GAAQ,IAAQ,CACzC,IAAM,EAAa,EAAW,YAAa,CAAS,EACpD,OACE,EAAA,cAAC,KAAD,CAAI,UAAW,EAAY,GAAI,EAAW,KAEtC,EADD,CACC,CAER,CACF,EAEA,EAAS,YAAc"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{v as e}from"./slot-CNhFZdHF.js";import{t}from"./useForkedRef-DVEfT-KI.js";import{t as n}from"./polymorphic-BhGNZQja.js";import{t as r}from"./useIsomorphicLayoutEffect-BbqRwuqn.js";import{n as i}from"./Portal-CgeR1WXV.js";import{t as a}from"./iconSlot-BNu2MrFI.js";import{n as o}from"./navOverflow-B5krZe6D.js";import{t as s}from"./Menu-CSBg2Zmc.js";import{l as c,n as l,t as u}from"./MenuToggle-7RQ0dmtZ.js";import d,{createContext as f,useCallback as p,useContext as m,useEffect as h,useMemo as g,useRef as _,useState as v,useSyncExternalStore as y}from"react";import b from"classnames";import{flushSync as x}from"react-dom";const S=f(null);function C(e){for(let t=e.previousElementSibling;t;t=t.previousElementSibling){if(t.hasAttribute(`data-cx-nav-overflow`))continue;let e=t.querySelector(`a[href], button:not(:disabled), [tabindex]`);if(e)return e}return null}function w({tabs:e}){let t=m(S),[n,i]=v(!1),o=_(null),f=_(!1),p=t?.hidden,h=!p?.length;r(()=>{let e=o.current;if(!e||!f.current)return;let t=e.ownerDocument.activeElement;(!t||t===e.ownerDocument.body||h&&e.contains(t))&&(f.current=!h,(h?C(e):e.querySelector(`.nav-overflow-toggle`))?.focus())},[p,h]);let g=t=>{f.current=!0,e&&t.stopPropagation()},x=()=>{f.current=!1};if(y(t?.subscribe??D,t?.getVersion??O,t?.getVersion??O),!t||!p)return null;let{getLink:w,iconPlacement:k,menuContainer:A,menuPlacement:j,moreIcon:M,moreLabel:N,moreText:P}=t;h&&n&&i(!1);let F=d.createElement(`span`,{key:`icon`,className:`nav-overflow-icon`,style:E},d.createElement(a,{icon:`more`,override:M})),I=P===!1?null:d.createElement(`span`,{key:`text`,className:`nav-overflow-text`},P);return d.createElement(s,{component:`li`,className:b(`nav-item nav-overflow-item`,{[T]:h}),container:e&&typeof A!=`object`||A,onBlur:x,onFocus:g,onVisibleChange:i,placement:j,visible:n&&!h,...e&&{role:`presentation`},ref:o},d.createElement(u,{"aria-label":P===!1?N:void 0,caret:!1,className:`nav-link nav-overflow-toggle`,component:`button`,...e&&{"aria-selected":!1,role:`tab`,tabIndex:-1}},k===`end`?[I,F]:[F,I]),d.createElement(l,{className:`nav-overflow-menu`},p.map(e=>{let t=w(e);return t&&d.createElement(c,{key:e,...t})})))}const T=`d-none`,E={"--cx-icon-color":`currentcolor`,"--cx-icon-size":`1rem`},D=()=>()=>{},O=()=>0;function k({available:e,collapseAll:t,gap:n,items:r,more:i,threshold:a}){let o=r.filter(e=>!e.keep),s=e=>e.map(e=>e.id);if(t)return s(o);if(r.reduce((e,t)=>e+t.width,0)+n*(r.length-1)<=e+1)return[];let c=i+r.reduce((e,t)=>t.keep?e+t.width+n:e,0),l=o.filter(t=>(c+=t.width+n,c>e+1));return r.length-l.length<a&&r.length>a&&(l=r.slice(a).filter(e=>!e.keep)),s(l)}function A(){let e=new Map,t=new Set,n=0,r=t=>{let n=e.get(t);return n||(n={element:null,link:null},e.set(t,n)),n};return{entries:e,getVersion:()=>n,notify:()=>{n+=1,t.forEach(e=>e())},set:(t,n)=>{let i=Object.assign(r(t),n);!i.element&&!i.link&&e.delete(t)},subscribe:e=>(t.add(e),()=>{t.delete(e)})}}const j=`data-cx-nav-overflow`,M=`d-none`,N=[],P=e=>Number.parseFloat(e)||0,F=e=>`offsetWidth`in e,I=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function ee(e,t){if(typeof e==`number`)return e;if(!e)return 0;let n=getComputedStyle(t.ownerDocument.documentElement),r=n.getPropertyValue(`--cx-breakpoint-${e}`).trim();return/r?em$/.test(r)?P(r)*(P(n.fontSize)||16):P(r)}const te={overflowX:`auto`,scrollbarWidth:`none`};function L({children:n,className:a,collapseBelow:s,component:c,iconPlacement:l=`start`,menuContainer:u,menuPlacement:f=`bottom-end`,moreIcon:m,moreLabel:y=`More`,moreText:C=`More`,onOverflow:T,style:E,threshold:D=0,...O},L){let R=c??`div`,z=_(null),ne=p(e=>{e&&(z.current=e)},[]),re=t(L,ne),ie=i(),[B]=v(A),[V,H]=v(N),U=_(V),W=_(0),G=_({collapseBelow:s,threshold:D});G.current={collapseBelow:s,threshold:D};let K=_(null),q=p(()=>{let t=z.current?.isConnected?z.current:null,n=t&&Array.from(t.children).find(e=>e.matches(`.nav`));if(e(!!t&&!n,"NavOverflow: expects a `Nav`, a `NavbarNav` or a `TabList` as its child; found no `.nav` to collapse."),!t||!n)return null;let r=Array.from(n.children).filter(F),i=r.find(e=>e.classList.contains(`nav-overflow-item`)),a=r.filter(e=>e!==i);if(Y(t,n,r),W.current=a.length,!i)return[];let o=new Map;B.entries.forEach((e,t)=>{e.element&&o.set(e.element,t)});let s=a.filter(e=>e.hasAttribute(j)),c=i.classList.contains(M);s.forEach(e=>e.removeAttribute(j)),i.classList.remove(M);try{let e=getComputedStyle(t),r=getComputedStyle(n),s=t.clientWidth-P(e.paddingInlineStart)-P(e.paddingInlineEnd),c=t.ownerDocument.activeElement,l=a.map(e=>{let t=o.get(e);return{id:t,keep:!t||!B.entries.get(t)?.link||e.classList.contains(`nav-overflow-keep`)||e.querySelector(`.nav-link.active, .nav-link[aria-current]:not([aria-current="false"]), [role="tab"][tabindex="0"]`)!==null||e.contains(c),width:e.offsetWidth}}),{collapseBelow:u,threshold:d}=G.current;return k({available:s-P(r.paddingInlineStart)-P(r.paddingInlineEnd)-P(r.borderInlineStartWidth)-P(r.borderInlineEndWidth),collapseAll:s<ee(u,t),gap:P(r.columnGap),items:l,more:i.offsetWidth,threshold:d})}finally{s.forEach(e=>e.setAttribute(j,`true`)),c&&i.classList.add(M),t.offsetWidth,K.current?.mutation?.takeRecords()}},[B]),J=p(()=>{let e=q();e&&!I(e,U.current)&&(U.current=e,H(e))},[q]);function Y(e,t,n){let r=K.current;if(r&&r.wrapper!==e&&(X(),r=null),!r){let t=()=>x(J),n={frame:0,mutation:typeof MutationObserver>`u`?null:new MutationObserver(t),nav:null,observed:new Set,resize:typeof ResizeObserver>`u`?null:new ResizeObserver(r=>{if(!r.some(t=>t.target===e)){cancelAnimationFrame(n.frame),n.frame=requestAnimationFrame(t);return}let i=U.current;t(),U.current!==i&&K.current===n&&(n.resize?.unobserve(e),cancelAnimationFrame(n.wrapperFrame),n.wrapperFrame=requestAnimationFrame(()=>n.resize?.observe(e)))}),wrapperFrame:0,wrapper:e};r=K.current=n,r.resize?.observe(e)}let{mutation:i,observed:a,resize:o}=r;r.nav!==t&&(r.nav=t,i?.disconnect(),i?.observe(t,{attributeFilter:[`class`,`aria-current`],attributes:!0,childList:!0,subtree:!0}));let s=new Set(n);a.forEach(e=>{s.has(e)||(o?.unobserve(e),a.delete(e))}),s.forEach(e=>{a.has(e)||(o?.observe(e),a.add(e))})}function X(){let e=K.current;e&&(cancelAnimationFrame(e.frame),cancelAnimationFrame(e.wrapperFrame),e.mutation?.disconnect(),e.resize?.disconnect(),K.current=null)}h(()=>X,[]),r(J,[J,R,s,D]);let Z=_(V);h(()=>{Z.current!==V&&(Z.current=V,T?.({overflowCount:V.length,visibleCount:W.current-V.length}))},[V]);let Q=p((e,t)=>B.set(e,{element:t}),[B]),$=p((e,t)=>{B.set(e,{link:t}),U.current.includes(e)&&B.notify()},[B]),ae=g(()=>({hidden:V,More:w,registerItem:Q,registerLink:$,update:J}),[V,Q,$,J]),oe=g(()=>({getLink:e=>B.entries.get(e)?.link??null,getVersion:B.getVersion,hidden:V,iconPlacement:l,menuContainer:u,menuPlacement:f,moreIcon:m,moreLabel:y,moreText:C,subscribe:B.subscribe}),[V,l,u,f,m,y,C,B]);return d.createElement(o.Provider,{value:ae},d.createElement(S.Provider,{value:oe},d.createElement(R,{className:b(`nav-overflow`,a),style:ie?E:{...te,...E},...O,ref:re},n)))}const R=n(L,`NavOverflow`);export{R as t};
|
|
2
|
-
//# sourceMappingURL=nav-overflow-DlLer6EK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-overflow-DlLer6EK.js","names":["HIDDEN_CLASS"],"sources":["../../src/components/nav-overflow/more.tsx","../../src/components/nav-overflow/overflow.ts","../../src/components/nav-overflow/NavOverflow.tsx"],"sourcesContent":["import React, {\n createContext,\n CSSProperties,\n FocusEvent,\n ReactNode,\n useContext,\n useRef,\n useState,\n useSyncExternalStore\n} from 'react'\nimport classNames from 'classnames'\n\nimport { useIsomorphicLayoutEffect } from '../../hooks'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../../utils/iconSlot'\nimport { NavOverflowLinkProps, NavOverflowMoreProps } from '../../utils/navOverflow'\nimport { Placement } from '../../utils/overlayPlacement'\nimport { Menu } from '../menu/Menu'\nimport { MenuItem } from '../menu/MenuItem'\nimport { MenuList } from '../menu/MenuList'\nimport { MenuToggle } from '../menu/MenuToggle'\n\n// From `NavOverflow` to the toggle item, which a list renders for it: the items in the menu, the\n// props their links registered, and how the toggle looks.\nexport interface NavOverflowMoreState {\n getLink: (id: string) => NavOverflowLinkProps | null\n getVersion: () => number\n hidden: readonly string[]\n iconPlacement: 'start' | 'end'\n menuContainer: boolean | Element | undefined\n menuPlacement: Placement\n moreIcon: IconValue | undefined\n moreLabel: string\n moreText: ReactNode | false\n subscribe: (listener: () => void) => () => void\n}\n\nexport const NavOverflowMoreContext = createContext<NavOverflowMoreState | null>(null)\n\n// The nearest item before `item` that is shown and can take focus: its link, or its tab.\nfunction lastShownStop(item: HTMLElement): HTMLElement | null {\n for (let shown = item.previousElementSibling; shown; shown = shown.previousElementSibling) {\n if (shown.hasAttribute('data-cx-nav-overflow')) continue\n const stop = shown.querySelector<HTMLElement>('a[href], button:not(:disabled), [tabindex]')\n if (stop) return stop\n }\n return null\n}\n\n// chassis-css's markup (`nav-overflow.js`): a `.nav-item.nav-overflow-item` holding the\n// `.nav-link.nav-overflow-toggle` button and the `.menu.nav-overflow-menu`. It is in the list at\n// all times, hidden while every item fits, so its width can be measured before it is needed.\nexport function NavOverflowMore({ tabs }: NavOverflowMoreProps) {\n const state = useContext(NavOverflowMoreContext)\n const [visible, setVisible] = useState(false)\n const itemRef = useRef<HTMLLIElement>(null)\n const focusWithinRef = useRef(false)\n const hidden = state?.hidden\n const empty = !hidden?.length\n\n // A resize can take away what has focus here: the toggle, when the last item leaves the menu,\n // or a menu item, when its item is back in the list. Neither blurs first, and focus would fall\n // to the page. It goes to the toggle while there is one, and to the last item otherwise.\n useIsomorphicLayoutEffect(() => {\n const item = itemRef.current\n if (!item || !focusWithinRef.current) return\n const active = item.ownerDocument.activeElement\n const lost = !active || active === item.ownerDocument.body || (empty && item.contains(active))\n if (!lost) return\n focusWithinRef.current = !empty\n const stop = empty\n ? lastShownStop(item)\n : item.querySelector<HTMLElement>('.nav-overflow-toggle')\n stop?.focus()\n }, [hidden, empty])\n\n const handleFocus = (event: FocusEvent) => {\n focusWithinRef.current = true\n // react-aria's tab list takes focus back to the selected tab when focus enters the list from\n // outside, which a click on the toggle does. The toggle is reached with the arrow keys, from\n // a tab (`TabList`), so the list doesn't need to hear of its focus.\n if (tabs) event.stopPropagation()\n }\n const handleBlur = () => {\n focusWithinRef.current = false\n }\n // A hidden item's link re-registers its props on each of its renders.\n useSyncExternalStore(\n state?.subscribe ?? subscribeToNothing,\n state?.getVersion ?? zero,\n state?.getVersion ?? zero\n )\n\n if (!state || !hidden) return null\n\n const { getLink, iconPlacement, menuContainer, menuPlacement, moreIcon, moreLabel, moreText } =\n state\n // The toggle goes when the last item leaves the menu, and an open menu with it.\n if (empty && visible) setVisible(false)\n\n // Keyed, so `iconPlacement` moves the two spans instead of turning one into the other.\n const icon = (\n <span key=\"icon\" className=\"nav-overflow-icon\" style={ICON_STYLE}>\n <IconSlot icon=\"more\" override={moreIcon} />\n </span>\n )\n const text =\n moreText === false ? null : (\n <span key=\"text\" className=\"nav-overflow-text\">\n {moreText}\n </span>\n )\n\n return (\n <Menu\n component=\"li\"\n className={classNames('nav-item nav-overflow-item', { [HIDDEN_CLASS]: empty })}\n // A `tablist` owns tabs only. The toggle is one of them, and the menu is rendered outside.\n // (No `instanceof Element`: a server has no `Element`.)\n container={tabs ? (typeof menuContainer === 'object' ? menuContainer : true) : menuContainer}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onVisibleChange={setVisible}\n placement={menuPlacement}\n visible={visible && !empty}\n {...(tabs && { role: 'presentation' })}\n ref={itemRef}\n >\n <MenuToggle\n aria-label={moreText === false ? moreLabel : undefined}\n caret={false}\n className=\"nav-link nav-overflow-toggle\"\n component=\"button\"\n {...(tabs && { 'aria-selected': false, role: 'tab', tabIndex: -1 })}\n >\n {iconPlacement === 'end' ? [text, icon] : [icon, text]}\n </MenuToggle>\n <MenuList className=\"nav-overflow-menu\">\n {hidden.map((id) => {\n const link = getLink(id)\n return link && <MenuItem key={id} {...link} />\n })}\n </MenuList>\n </Menu>\n )\n}\n\nconst HIDDEN_CLASS = 'd-none'\n// The icon as chassis-css's plugin draws its own: in the color of the toggle's text, and 1rem\n// wide. The default icon size is taller than a link's text, and would make the list a little\n// taller each time the toggle appeared.\nconst ICON_STYLE = { '--cx-icon-color': 'currentcolor', '--cx-icon-size': '1rem' } as CSSProperties\nconst subscribeToNothing = () => () => {}\nconst zero = () => 0\n","// Which items go into the menu, from widths `NavOverflow` has read with every item shown.\n\nexport interface MeasuredItem {\n /**\n * Unset for an item that registered nothing, which can't be moved.\n */\n id?: string\n /**\n * Stays in the list whatever the width: marked to keep, active, focused, or with no link for\n * the menu to show.\n */\n keep: boolean\n width: number\n}\n\nexport interface Measurement {\n /**\n * The width the items have to fit in.\n */\n available: number\n /**\n * The wrapper is narrower than `collapseBelow`.\n */\n collapseAll: boolean\n gap: number\n /**\n * In document order, without the toggle item.\n */\n items: MeasuredItem[]\n /**\n * The width of the toggle item.\n */\n more: number\n /**\n * The fewest items to leave in the list.\n */\n threshold: number\n}\n\n// A pixel of slack for sub-pixel layout: `offsetWidth` is rounded.\nconst SLACK = 1\n\nexport function overflowingIds({\n available,\n collapseAll,\n gap,\n items,\n more,\n threshold\n}: Measurement): string[] {\n const movable = items.filter((item) => !item.keep)\n const ids = (overflowing: MeasuredItem[]) => overflowing.map((item) => item.id as string)\n\n if (collapseAll) return ids(movable)\n\n // Everything fits without the toggle, which then isn't shown. chassis-css's plugin always\n // reserves the toggle's width, and so moves the last item of a list that fits exactly.\n const total = items.reduce((sum, item) => sum + item.width, 0) + gap * (items.length - 1)\n if (total <= available + SLACK) return []\n\n // The toggle and the kept items are shown whatever happens, each with the gap to the next.\n let used = more + items.reduce((sum, item) => (item.keep ? sum + item.width + gap : sum), 0)\n let overflowing = movable.filter((item) => {\n used += item.width + gap\n return used > available + SLACK\n })\n\n if (items.length - overflowing.length < threshold && items.length > threshold) {\n overflowing = items.slice(threshold).filter((item) => !item.keep)\n }\n\n return ids(overflowing)\n}\n","import React, {\n CSSProperties,\n ElementType,\n ForwardRefRenderFunction,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react'\nimport { flushSync } from 'react-dom'\nimport classNames from 'classnames'\n\nimport { useForkedRef, useIsomorphicLayoutEffect } from '../../hooks'\nimport { Breakpoint } from '../../types'\nimport { devWarning } from '../../utils/devWarning'\nimport { IconValue } from '../../utils/iconConfig'\nimport {\n NavOverflowContext,\n NavOverflowController,\n NavOverflowLinkProps\n} from '../../utils/navOverflow'\nimport { Placement } from '../../utils/overlayPlacement'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { useHydrated } from '../portal/Portal'\nimport { NavOverflowMore, NavOverflowMoreContext, NavOverflowMoreState } from './more'\nimport { MeasuredItem, overflowingIds } from './overflow'\n\nexport interface NavOverflowDetail {\n /**\n * How many items are in the menu.\n */\n overflowCount: number\n /**\n * How many items are left in the list.\n */\n visibleCount: number\n}\n\ntype NavOverflowOwnProps<C extends ElementType> = {\n /**\n * The list to collapse: a `Nav`, a `NavbarNav` or a `TabList`.\n */\n children?: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Moves every item into the menu while the component is narrower than this: a width in pixels,\n * or the name of a breakpoint, read from `--cx-breakpoint-{name}`.\n */\n collapseBelow?: number | Breakpoint\n /**\n * Component used for the root node. Either a string to use an HTML element or a component.\n *\n * @default 'div'\n */\n component?: C\n /**\n * Which side of the toggle's text its icon is on.\n *\n * @default 'start'\n */\n iconPlacement?: 'start' | 'end'\n /**\n * Renders the menu in a container element instead of inside the toggle's item, where an\n * ancestor with `overflow` set would clip it: an element, or `true` for `document.body`. The\n * menu of a `TabList` is always rendered outside it.\n */\n menuContainer?: boolean | Element\n /**\n * Where the menu opens, relative to the toggle. It flips to stay in view.\n *\n * @default 'bottom-end'\n * @type 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'\n */\n menuPlacement?: Placement\n /**\n * The toggle's icon: an icon name, or an element of your own icon set. Defaults to\n * `IconProvider`'s `more` icon.\n */\n moreIcon?: IconValue\n /**\n * The accessible name of a toggle without text (`moreText={false}`).\n *\n * @default 'More'\n */\n moreLabel?: string\n /**\n * The toggle's text. `false` leaves the icon alone, named by `moreLabel`.\n *\n * @default 'More'\n */\n moreText?: ReactNode | false\n /**\n * Callback fired when items move into the menu or back out of it, with the number of items in\n * the menu and in the list.\n */\n onOverflow?: (detail: NavOverflowDetail) => void\n /**\n * The fewest items to leave in the list. They stay even when they don't fit.\n *\n * @default 0\n */\n threshold?: number\n}\n\nexport type NavOverflowProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n NavOverflowOwnProps<C>\n>\n\ntype NavOverflowComponent = (<C extends ElementType = 'div'>(\n props: NavOverflowProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\ninterface Entry {\n element: HTMLElement | null\n link: NavOverflowLinkProps | null\n}\n\ninterface Observers {\n frame: number\n mutation: MutationObserver | null\n nav: Element | null\n observed: Set<Element>\n resize: ResizeObserver | null\n wrapper: HTMLElement\n wrapperFrame: number\n}\n\n// What the items and links registered, and the listeners of the menu that renders from it. Kept\n// outside React state: a link registers new props on every one of its renders.\nfunction createRegistry() {\n const entries = new Map<string, Entry>()\n const listeners = new Set<() => void>()\n let version = 0\n\n const entry = (id: string) => {\n let found = entries.get(id)\n if (!found) {\n found = { element: null, link: null }\n entries.set(id, found)\n }\n return found\n }\n\n return {\n entries,\n getVersion: () => version,\n notify: () => {\n version += 1\n listeners.forEach((listener) => listener())\n },\n set: (id: string, value: Partial<Entry>) => {\n const next = Object.assign(entry(id), value)\n if (!next.element && !next.link) entries.delete(id)\n },\n subscribe: (listener: () => void) => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n }\n }\n}\n\n// chassis-css hides an item with this attribute (`_nav-overflow.scss`) and the toggle item with\n// the display utility, as its plugin does.\nconst HIDDEN_ATTRIBUTE = 'data-cx-nav-overflow'\nconst HIDDEN_CLASS = 'd-none'\n\n// What keeps an item in the list by being inside it: the current link, and the tab that is the\n// list's Tab stop. react-aria gives that to the tab focused last, which needn't be the selected\n// one: hidden, it would leave the keyboard no way into the list.\nconst KEPT_CONTENT =\n '.nav-link.active, .nav-link[aria-current]:not([aria-current=\"false\"]), [role=\"tab\"][tabindex=\"0\"]'\n\nconst EMPTY: readonly string[] = []\n\nconst pixels = (value: string) => Number.parseFloat(value) || 0\n\n// Not `instanceof HTMLElement`: a list rendered into another window has that window's classes.\nconst isHTMLElement = (element: Element): element is HTMLElement => 'offsetWidth' in element\n\nconst sameIds = (a: readonly string[], b: readonly string[]) =>\n a.length === b.length && a.every((id, index) => id === b[index])\n\n// `collapseBelow` in pixels. A breakpoint is a custom property of chassis-css, in `rem`.\nfunction resolveCollapseBelow(value: number | Breakpoint | undefined, wrapper: HTMLElement) {\n if (typeof value === 'number') return value\n if (!value) return 0\n const root = getComputedStyle(wrapper.ownerDocument.documentElement)\n const width = root.getPropertyValue(`--cx-breakpoint-${value}`).trim()\n return /r?em$/.test(width) ? pixels(width) * (pixels(root.fontSize) || 16) : pixels(width)\n}\n\n// Until the page has hydrated nothing has been measured, and the server's HTML holds every item\n// on one line (`.nav-overflow > .nav` doesn't wrap). The items that don't fit are clipped at the\n// wrapper's edge and can be scrolled to, instead of running over what is next to the list.\nconst UNMEASURED_STYLE: CSSProperties = { overflowX: 'auto', scrollbarWidth: 'none' }\n\nfunction NavOverflowRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n collapseBelow,\n component,\n iconPlacement = 'start',\n menuContainer,\n menuPlacement = 'bottom-end',\n moreIcon,\n moreLabel = 'More',\n moreText = 'More',\n onOverflow,\n style,\n threshold = 0,\n ...rest\n }: NavOverflowProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n // The wrapper, kept while React re-attaches a ref: a caller's ref that is a new function on\n // each render makes it detach and attach this one too, and in between, where the list's\n // effects run, there would be nothing to measure.\n const wrapperRef = useRef<HTMLElement | null>(null)\n const setWrapper = useCallback((element: HTMLElement | null) => {\n if (element) wrapperRef.current = element\n }, [])\n const forkedRef = useForkedRef(ref, setWrapper)\n const hydrated = useHydrated()\n\n const [registry] = useState(createRegistry)\n const [hidden, setHidden] = useState(EMPTY)\n const hiddenRef = useRef(hidden)\n const itemCountRef = useRef(0)\n const optionsRef = useRef({ collapseBelow, threshold })\n optionsRef.current = { collapseBelow, threshold }\n\n const observersRef = useRef<Observers | null>(null)\n\n // Which items don't fit, or `null` when there is nothing to measure.\n //\n // Widths are read with every item and the toggle shown, so they never depend on what the last\n // pass hid. Showing and hiding again happens in one synchronous block, outside React: the browser\n // paints neither, and the elements are back as React rendered them before it looks again.\n const measure = useCallback((): string[] | null => {\n const wrapper = wrapperRef.current?.isConnected ? wrapperRef.current : null\n const nav = wrapper && Array.from(wrapper.children).find((child) => child.matches('.nav'))\n devWarning(\n !!wrapper && !nav,\n 'NavOverflow: expects a `Nav`, a `NavbarNav` or a `TabList` as its child; found no `.nav` ' +\n 'to collapse.'\n )\n if (!wrapper || !nav) return null\n\n // Every child of the list takes room in the row, a title or a divider too; only registered\n // items can leave it.\n const children = Array.from(nav.children).filter(isHTMLElement)\n const more = children.find((child) => child.classList.contains('nav-overflow-item'))\n const elements = children.filter((child) => child !== more)\n observe(wrapper, nav, children)\n itemCountRef.current = elements.length\n // No toggle: the list is not one that takes part, so nothing can move.\n if (!more) return []\n\n const ids = new Map<Element, string>()\n registry.entries.forEach((entry, id) => {\n if (entry.element) ids.set(entry.element, id)\n })\n\n const wereHidden = elements.filter((element) => element.hasAttribute(HIDDEN_ATTRIBUTE))\n const moreWasHidden = more.classList.contains(HIDDEN_CLASS)\n wereHidden.forEach((element) => element.removeAttribute(HIDDEN_ATTRIBUTE))\n more.classList.remove(HIDDEN_CLASS)\n\n try {\n const wrapperStyle = getComputedStyle(wrapper)\n const navStyle = getComputedStyle(nav)\n // The wrapper's content box, as chassis-css's plugin takes it.\n const width =\n wrapper.clientWidth -\n pixels(wrapperStyle.paddingInlineStart) -\n pixels(wrapperStyle.paddingInlineEnd)\n const focused = wrapper.ownerDocument.activeElement\n\n const items = elements.map((element): MeasuredItem => {\n const id = ids.get(element)\n return {\n id,\n // An item stays in the list when the menu has nothing to show for it, when it is\n // marked to stay, when it is the current one or the list's Tab stop, and while it has\n // focus, which hiding it would drop.\n keep:\n !id ||\n !registry.entries.get(id)?.link ||\n element.classList.contains('nav-overflow-keep') ||\n element.querySelector(KEPT_CONTENT) !== null ||\n element.contains(focused),\n width: element.offsetWidth\n }\n })\n\n const { collapseBelow, threshold } = optionsRef.current\n return overflowingIds({\n available:\n width -\n pixels(navStyle.paddingInlineStart) -\n pixels(navStyle.paddingInlineEnd) -\n pixels(navStyle.borderInlineStartWidth) -\n pixels(navStyle.borderInlineEndWidth),\n collapseAll: width < resolveCollapseBelow(collapseBelow, wrapper),\n gap: pixels(navStyle.columnGap),\n items,\n more: more.offsetWidth,\n threshold\n })\n } finally {\n wereHidden.forEach((element) => element.setAttribute(HIDDEN_ATTRIBUTE, 'true'))\n if (moreWasHidden) more.classList.add(HIDDEN_CLASS)\n // Lay the list out as it was. Without this the layout stays as measured, with everything\n // shown, until the browser next needs it, and a ResizeObserver delivering in the meantime\n // (react-aria's, on the toggle) is told of sizes that were never painted.\n void wrapper.offsetWidth\n // The mutations above are this function's own.\n observersRef.current?.mutation?.takeRecords()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [registry])\n\n const update = useCallback(() => {\n const next = measure()\n if (!next || sameIds(next, hiddenRef.current)) return\n hiddenRef.current = next\n setHidden(next)\n }, [measure])\n\n // What changes the result without a render of the list:\n //\n // - The wrapper's width. The wrapper and not the list, whose width the result itself changes.\n // - An item's width: a font that loads, a label that changes.\n // - A link that becomes the current one by itself, as a router's link does on navigation.\n //\n // An observer's callback runs before the browser paints, and `flushSync` commits the result\n // there, so no frame shows the items of the old width.\n //\n // A ResizeObserver delivers sizes top down, and reports a loop error when a callback changes\n // a size it has already passed. Two things here would: hiding an item's siblings from the\n // callback for that item, so an item's own resize waits a frame; and a toggle taller than the\n // links, which changes the wrapper's height from the wrapper's own callback, so the wrapper is\n // observed again from the next frame once a pass has moved anything.\n function observe(wrapper: HTMLElement, nav: Element, children: HTMLElement[]) {\n let observers = observersRef.current\n if (observers && observers.wrapper !== wrapper) {\n disconnect()\n observers = null\n }\n if (!observers) {\n const flush = () => flushSync(update)\n const created: Observers = {\n frame: 0,\n mutation: typeof MutationObserver === 'undefined' ? null : new MutationObserver(flush),\n nav: null,\n observed: new Set(),\n resize:\n typeof ResizeObserver === 'undefined'\n ? null\n : new ResizeObserver((entries) => {\n if (!entries.some((entry) => entry.target === wrapper)) {\n cancelAnimationFrame(created.frame)\n created.frame = requestAnimationFrame(flush)\n return\n }\n const before = hiddenRef.current\n flush()\n // The pass can have replaced these observers, for a wrapper that is a new element.\n if (hiddenRef.current === before || observersRef.current !== created) return\n created.resize?.unobserve(wrapper)\n cancelAnimationFrame(created.wrapperFrame)\n created.wrapperFrame = requestAnimationFrame(() => created.resize?.observe(wrapper))\n }),\n wrapperFrame: 0,\n wrapper\n }\n observers = observersRef.current = created\n observers.resize?.observe(wrapper)\n }\n const { mutation, observed, resize } = observers\n\n if (observers.nav !== nav) {\n observers.nav = nav\n mutation?.disconnect()\n mutation?.observe(nav, {\n attributeFilter: ['class', 'aria-current'],\n attributes: true,\n childList: true,\n subtree: true\n })\n }\n\n const current = new Set<Element>(children)\n observed.forEach((element) => {\n if (current.has(element)) return\n resize?.unobserve(element)\n observed.delete(element)\n })\n current.forEach((element) => {\n if (observed.has(element)) return\n resize?.observe(element)\n observed.add(element)\n })\n }\n\n function disconnect() {\n const observers = observersRef.current\n if (!observers) return\n cancelAnimationFrame(observers.frame)\n cancelAnimationFrame(observers.wrapperFrame)\n observers.mutation?.disconnect()\n observers.resize?.disconnect()\n observersRef.current = null\n }\n\n useEffect(() => disconnect, [])\n\n // The list measures after each of its commits (`NavOverflowItems`). This covers what it can't:\n // the first commit and a wrapper that becomes another element, where React attaches the\n // wrapper's ref after the list's effects have run, and the options, which can change without\n // the list rendering.\n useIsomorphicLayoutEffect(update, [update, Component, collapseBelow, threshold])\n\n const reportedRef = useRef(hidden)\n useEffect(() => {\n if (reportedRef.current === hidden) return\n reportedRef.current = hidden\n onOverflow?.({\n overflowCount: hidden.length,\n visibleCount: itemCountRef.current - hidden.length\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hidden])\n\n const registerItem = useCallback(\n (id: string, element: HTMLElement | null) => registry.set(id, { element }),\n [registry]\n )\n const registerLink = useCallback(\n (id: string, link: NavOverflowLinkProps | null) => {\n registry.set(id, { link })\n // The menu renders from these props, and only it needs to hear of new ones.\n if (hiddenRef.current.includes(id)) registry.notify()\n },\n [registry]\n )\n\n const controller: NavOverflowController = useMemo(\n () => ({ hidden, More: NavOverflowMore, registerItem, registerLink, update }),\n [hidden, registerItem, registerLink, update]\n )\n\n const more: NavOverflowMoreState = useMemo(\n () => ({\n getLink: (id) => registry.entries.get(id)?.link ?? null,\n getVersion: registry.getVersion,\n hidden,\n iconPlacement,\n menuContainer,\n menuPlacement,\n moreIcon,\n moreLabel,\n moreText,\n subscribe: registry.subscribe\n }),\n [hidden, iconPlacement, menuContainer, menuPlacement, moreIcon, moreLabel, moreText, registry]\n )\n\n return (\n <NavOverflowContext.Provider value={controller}>\n <NavOverflowMoreContext.Provider value={more}>\n <Component\n className={classNames('nav-overflow', className)}\n style={hydrated ? style : { ...UNMEASURED_STYLE, ...style }}\n {...rest}\n ref={forkedRef}\n >\n {children}\n </Component>\n </NavOverflowMoreContext.Provider>\n </NavOverflowContext.Provider>\n )\n}\n\nexport const NavOverflow = createPolymorphicComponent<NavOverflowComponent>(\n NavOverflowRender as ForwardRefRenderFunction<Element, NavOverflowProps<ElementType>>,\n 'NavOverflow'\n)\n"],"mappings":"0pBAqCA,MAAa,EAAyB,EAA2C,IAAI,EAGrF,SAAS,EAAc,EAAuC,CAC5D,IAAK,IAAI,EAAQ,EAAK,uBAAwB,EAAO,EAAQ,EAAM,uBAAwB,CACzF,GAAI,EAAM,aAAa,sBAAsB,EAAG,SAChD,IAAM,EAAO,EAAM,cAA2B,4CAA4C,EAC1F,GAAI,EAAM,OAAO,CACnB,CACA,OAAO,IACT,CAKA,SAAgB,EAAgB,CAAE,QAA8B,CAC9D,IAAM,EAAQ,EAAW,CAAsB,EACzC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-
import{a as e,s as t,v as n}from"./slot-CNhFZdHF.js";import{t as r}from"./useIsomorphicLayoutEffect-BbqRwuqn.js";import i,{cloneElement as a,createContext as o,useCallback as s,useContext as c,useId as l,useMemo as u}from"react";const d=o(null),f=o(null);function p({children:e}){return i.createElement(f.Provider,{value:null},e)}function m({children:e,tabs:t,tag:a}){let o=a===void 0||a===`ul`||a===`ol`,s=c(d);n(!!s&&!o,`NavOverflow: collapses the \`NavItem\`s of a list, and a <${a}> has none. Leave out \`component\` to render a <ul>.`);let l=o?s:null,p=u(()=>l?{controller:l}:null,[l]),m=l?.update;r(()=>{m?.()});let h=l?.More;return i.createElement(i.Fragment,null,i.createElement(d.Provider,{value:null},i.createElement(f.Provider,{value:p},e)),h&&i.createElement(h,{tabs:t}))}const h=f.Provider;function g(e){let t=c(f),n=l(),r=t&&t.itemId===void 0?t.controller:null,i=u(()=>r?{controller:r,itemId:n}:null,[r,n]),a=r?.registerItem,o=s(e=>a?.(n,e),[a,n]);return b(e?r?.registerLink:void 0,n,e),{hidden:!!r&&r.hidden.includes(n),ref:r?o:void 0,scope:i}}const _=()=>c(f)?.itemId!==void 0;function v({props:n}){let r=c(f),i=t(),{component:o,...s}=y(n);return b(r?.itemId===void 0?void 0:r.controller.registerLink,r?.itemId,e(o)&&i?{...s,asChild:!0,children:a(i,{id:void 0,ref:null})}:{...s,component:o}),null}function y(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e!==`id`&&e!==`aria-describedby`&&(e===`onClick`||!/^on[A-Z]/.test(e))))}function b(e,t,n){r(()=>{e&&t!==void 0&&n&&e(t,n)}),r(()=>{if(e&&t!==void 0)return()=>e(t,null)},[e,t])}export{v as a,m as i,d as n,_ as o,h as r,g as s,p as t};
|
|
2
|
-
//# sourceMappingURL=navOverflow-B5krZe6D.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navOverflow-B5krZe6D.js","names":[],"sources":["../../src/utils/navOverflow.tsx"],"sourcesContent":["import React, {\n cloneElement,\n ComponentType,\n createContext,\n ReactElement,\n ReactNode,\n RefCallback,\n useCallback,\n useContext,\n useId,\n useMemo\n} from 'react'\n\nimport { useIsomorphicLayoutEffect } from '../hooks/useIsomorphicLayoutEffect'\nimport { devWarning } from './devWarning'\nimport { isSlot, useSlotElement } from './slot'\n\n// How `NavOverflow` (`components/nav-overflow`) and the lists it collapses work together.\n//\n// chassis-css's plugin clones the links that don't fit into its menu. A clone has no React\n// behind it: no `onClick`, no router link. Here nothing is cloned. Three parts take a role each:\n//\n// - The list (`Nav`, `NavbarNav`, `TabList`) renders `NavOverflowItems` around its items, which\n// adds the toggle item after them.\n// - An item (`NavItem`, a tab) registers its `<li>`, which is what `NavOverflow` measures and\n// hides.\n// - The item's link (`NavLink`) registers the props it was rendered with, and the menu renders a\n// `MenuItem` from them. An item with no link registered, such as one holding a dropdown, has\n// nothing to show in the menu, so it is never moved.\n//\n// An item is known by an id of its own rather than by its position among the list's children, so\n// a component that renders several items, or a fragment of them, works like items written in\n// place. `NavOverflow` takes their order from the document.\n//\n// These live here, not in `components/nav-overflow`, so that `Nav` and `Tabs` import a context and\n// nothing else: the toggle and its `Menu` reach a list through the controller (`More`), and stay\n// out of the bundle of a page that only renders a `Nav`.\n\n/** The props a link hands to the `MenuItem` that stands in for it. */\nexport type NavOverflowLinkProps = Record<string, unknown>\n\nexport interface NavOverflowMoreProps {\n /**\n * The list is a `tablist`: the toggle is one of its tabs, and its menu is rendered outside it.\n */\n tabs?: boolean\n}\n\nexport interface NavOverflowController {\n /**\n * The ids of the items that are in the menu, in document order.\n */\n hidden: readonly string[]\n /**\n * The toggle item and its menu, rendered by the list after its items.\n */\n More: ComponentType<NavOverflowMoreProps>\n registerItem: (id: string, element: HTMLElement | null) => void\n registerLink: (id: string, props: NavOverflowLinkProps | null) => void\n /**\n * Measures again. A list calls it after each of its commits.\n */\n update: () => void\n}\n\n/**\n * From `NavOverflow` to the list directly inside it.\n */\nexport const NavOverflowContext = createContext<NavOverflowController | null>(null)\n\n// From the list to its items (`itemId` unset), and from an item to its link (`itemId` set). One\n// context, so an item nested in another item finds `itemId` set and knows it isn't the list's own.\ninterface NavOverflowScope {\n controller: NavOverflowController\n itemId?: string\n}\n\nconst NavOverflowScopeContext = createContext<NavOverflowScope | null>(null)\n\n/**\n * Closes the scope for everything inside: a `Menu` in an item isn't that item's link, and neither\n * is anything in its list.\n */\nexport function NavOverflowBoundary({ children }: { children?: ReactNode }): ReactElement {\n return (\n <NavOverflowScopeContext.Provider value={null}>{children}</NavOverflowScopeContext.Provider>\n )\n}\n\n/**\n * A list's items. Inside a `NavOverflow` they are the items it collapses, followed by the toggle\n * item. Anywhere else they render as they are, and a list nested in a collapsing item takes no\n * part in it.\n */\nexport function NavOverflowItems({\n children,\n tabs,\n tag\n}: NavOverflowMoreProps & {\n children?: ReactNode\n /**\n * The tag the list renders, when it is known. The toggle item is an `<li>`, so only a `<ul>`\n * or an `<ol>` takes part.\n */\n tag?: string\n}): ReactElement {\n const collapses = tag === undefined || tag === 'ul' || tag === 'ol'\n const inherited = useContext(NavOverflowContext)\n devWarning(\n !!inherited && !collapses,\n `NavOverflow: collapses the \\`NavItem\\`s of a list, and a <${tag}> has none. Leave out ` +\n `\\`component\\` to render a <ul>.`\n )\n const controller = collapses ? inherited : null\n const scope = useMemo(() => (controller ? { controller } : null), [controller])\n const update = controller?.update\n\n // After every commit of the list: an item added, removed, renamed or made active changes what\n // fits, and none of those resizes the wrapper.\n useIsomorphicLayoutEffect(() => {\n update?.()\n })\n\n const More = controller?.More\n\n return (\n <>\n <NavOverflowContext.Provider value={null}>\n <NavOverflowScopeContext.Provider value={scope}>\n {children}\n </NavOverflowScopeContext.Provider>\n </NavOverflowContext.Provider>\n {More && <More tabs={tabs} />}\n </>\n )\n}\n\nexport interface NavOverflowItem {\n /**\n * Whether the item is in the menu, and so hidden in the list.\n */\n hidden: boolean\n /**\n * For the item's `<li>`. `undefined` outside a collapsing list.\n */\n ref: RefCallback<HTMLElement> | undefined\n /**\n * For `NavOverflowItemScope`, around the item's children.\n */\n scope: NavOverflowScope | null\n}\n\nexport const NavOverflowItemScope = NavOverflowScopeContext.Provider\n\n/**\n * An item of a list. `link` is for an item that is its own link, as a tab is; an item that holds\n * a `NavLink` leaves it out, and the link registers itself.\n */\nexport function useNavOverflowItem(link?: NavOverflowLinkProps): NavOverflowItem {\n const inherited = useContext(NavOverflowScopeContext)\n const id = useId()\n // The list's own items only: inside another item, `itemId` is that item's.\n const controller = inherited && inherited.itemId === undefined ? inherited.controller : null\n const scope = useMemo(() => (controller ? { controller, itemId: id } : null), [controller, id])\n const registerItem = controller?.registerItem\n const ref = useCallback(\n (element: HTMLElement | null) => registerItem?.(id, element),\n [registerItem, id]\n )\n\n useRegisteredLink(link ? controller?.registerLink : undefined, id, link)\n\n return {\n hidden: !!controller && controller.hidden.includes(id),\n ref: controller ? ref : undefined,\n scope\n }\n}\n\n/**\n * Whether the caller is the link of an item that can move into the menu, and so should render a\n * `NavOverflowLink`.\n */\nexport const useIsNavOverflowLink = (): boolean =>\n useContext(NavOverflowScopeContext)?.itemId !== undefined\n\n/**\n * Registers the props of an item's link, which the menu renders its `MenuItem` from. It renders\n * nothing. A component, not a hook, because a link rendered with `asChild` has to hand over the\n * element it was given, and only something rendered beside the `Slot` can read that.\n */\nexport function NavOverflowLink({ props }: { props: NavOverflowLinkProps }): null {\n const scope = useContext(NavOverflowScopeContext)\n const slotted = useSlotElement()\n const { component, ...link } = menuProps(props)\n useRegisteredLink(\n scope?.itemId === undefined ? undefined : scope.controller.registerLink,\n scope?.itemId,\n isSlot(component) && slotted\n ? // The caller's element, without what is its own in the list: its `ref` would be taken\n // over by the copy in the menu, and dropped when that copy went.\n { ...link, asChild: true, children: cloneElement(slotted, { id: undefined, ref: null }) }\n : { ...link, component }\n )\n return null\n}\n\n// What a link hands to its menu item. Not its `id`: the two are in the document together. And of\n// its handlers, `onClick` only: the rest are for the link where it is, such as the hover and\n// focus handlers a `Tooltip` around it adds, which would open a tooltip anchored to a hidden\n// link. Its description goes with them.\nfunction menuProps(props: NavOverflowLinkProps): NavOverflowLinkProps {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([name]) =>\n name !== 'id' &&\n name !== 'aria-describedby' &&\n (name === 'onClick' || !/^on[A-Z]/.test(name))\n )\n )\n}\n\nfunction useRegisteredLink(\n register: NavOverflowController['registerLink'] | undefined,\n id: string | undefined,\n props: NavOverflowLinkProps | undefined\n) {\n // On every commit: the props are new objects on each render, and the menu shows the latest.\n useIsomorphicLayoutEffect(() => {\n if (register && id !== undefined && props) register(id, props)\n })\n\n useIsomorphicLayoutEffect(() => {\n if (!register || id === undefined) return undefined\n return () => register(id, null)\n }, [register, id])\n}\n"],"mappings":"qOAoEA,MAAa,EAAqB,EAA4C,IAAI,EAS5E,EAA0B,EAAuC,IAAI,EAM3E,SAAgB,EAAoB,CAAE,YAAoD,CACxF,OACE,EAAA,cAAC,EAAwB,SAAzB,CAAkC,MAAO,IAAkD,EAA3C,CAA2C,CAE/F,CAOA,SAAgB,EAAiB,CAC/B,WACA,OACA,OAQe,CACf,IAAM,EAAY,IAAQ,IAAA,IAAa,IAAQ,MAAQ,IAAQ,KACzD,EAAY,EAAW,CAAkB,EAC/C,EACE,CAAC,CAAC,GAAa,CAAC,EAChB,6DAA6D,EAAI,sDAEnE,EACA,IAAM,EAAa,EAAY,EAAY,KACrC,EAAQ,MAAe,EAAa,CAAE,YAAW,EAAI,KAAO,CAAC,CAAU,CAAC,EACxE,EAAS,GAAY,OAI3B,MAAgC,CAC9B,IAAS,CACX,CAAC,EAED,IAAM,EAAO,GAAY,KAEzB,OACE,EAAA,cAAA,EAAA,SAAA,KACE,EAAA,cAAC,EAAmB,SAApB,CAA6B,MAAO,IAIP,EAH3B,EAAA,cAAC,EAAwB,SAAzB,CAAkC,MAAO,CAEP,EAD/B,CAC+B,CACP,EAC5B,GAAQ,EAAA,cAAC,EAAD,CAAY,MAAO,CAAA,CAC5B,CAEN,CAiBA,MAAa,EA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,GAAC,GAAY,IAAO,IAAA,GACxB,UAAa,EAAS,EAAI,IAAI,CAChC,EAAG,CAAC,EAAU,CAAE,CAAC,CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navVariant-DeGTk9B7.js","names":[],"sources":["../../src/utils/navVariant.ts"],"sourcesContent":["import { devWarning } from './devWarning'\n\n// The looks of a `.nav` that `Nav` and `TabList` share. `'pills'` is what `'segments'` was called\n// until chassis-css 0.6 renamed `.nav-pills` to `.nav-segments`: still accepted, deprecated.\nexport type NavVariant = 'tabs' | 'segments' | 'underline' | 'pills'\n\nexport function navVariantClassName(\n variant: NavVariant | undefined,\n displayName: string\n): string | undefined {\n devWarning(\n variant === 'pills',\n `${displayName}: variant=\"pills\" is deprecated, use variant=\"segments\" instead. It will be ` +\n 'removed in a future major version.'\n )\n\n return variant && `nav-${variant === 'pills' ? 'segments' : variant}`\n}\n"],"mappings":"uCAMA,SAAgB,EACd,EACA,EACoB,CAOpB,OANA,EACE,IAAY,QACZ,GAAG,EAAY,+GAEjB,EAEO,GAAW,OAAO,IAAY,QAAU,WAAa,GAC9D"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{d as e,g as t,m as n,p as r}from"./slot-CNhFZdHF.js";import{t as i}from"./polymorphic-BhGNZQja.js";import{t as a}from"./iconSlot-BNu2MrFI.js";import{t as o}from"./VisuallyHidden-C2dM7HhC.js";import{i as s,n as c}from"./navOverflow-B5krZe6D.js";import l,{forwardRef as u,useContext as d}from"react";import f from"classnames";function p({children:e,className:t,color:n,component:r,container:i,expand:a,placement:o,translucent:s,variant:c,...u},d){let p=r??`nav`,m=f(`navbar`,n,{context:!!n,solid:c===`solid`,smooth:c===`smooth`,outline:c===`outline`,translucent:s,[typeof a==`boolean`?`navbar-expand`:`${a}:navbar-expand`]:a},o,t),h;return h=i?l.createElement(`div`,{className:`container${i===!0?``:`-`+i}`},e):e,l.createElement(p,{className:m,...u,ref:d},h)}const m=i(p,`Navbar`);function h({children:n,component:i,className:a,href:o,...s},c){let u=r(i,o,`span`),d=f(`navbar-brand`,a);return l.createElement(u,{className:d,...e(t(u,o,s),o,`NavbarBrand`),...s,ref:c},n)}const g=i(h,`NavbarBrand`);function _({children:e,component:t,className:r,...i},a){let o=t??`ul`,u=d(c)!==null,p=f({nav:u},`navbar-nav`,r);return l.createElement(o,{className:p,...i,ref:a},l.createElement(s,{tag:n(o)},e))}const v=i(_,`NavbarNav`);function y({children:e,className:t,component:n,...r},i){let a=n??`span`,o=f(`navbar-text`,t);return l.createElement(a,{className:o,...r,ref:i},e)}const b=i(y,`NavbarText`),x=u(({children:e,className:t,icon:n,label:r=`Toggle navigation`,...i},s)=>{let c=f(`button icon-only navbar-toggler`,t);return l.createElement(`button`,{type:`button`,className:c,...i,ref:s},e??l.createElement(l.Fragment,null,l.createElement(a,{icon:`menu`,override:n,className:`navbar-toggler-icon`}),l.createElement(o,null,r)))});x.displayName=`NavbarToggler`;export{m as a,g as i,b as n,v as r,x as t};
|
|
2
|
-
//# sourceMappingURL=navbar-DxIwt0sc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navbar-DxIwt0sc.js","names":[],"sources":["../../src/components/navbar/Navbar.tsx","../../src/components/navbar/NavbarBrand.tsx","../../src/components/navbar/NavbarNav.tsx","../../src/components/navbar/NavbarText.tsx","../../src/components/navbar/NavbarToggler.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { Breakpoint, ContextColor, ContextStyle } from '../../types'\n\ntype NavbarOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n /**\n * Defines optional container wrapping children elements.\n */\n container?: boolean | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'fluid'\n /**\n * Opts this navbar into the framework's dark or light theming, independent of the page's own\n * theme.\n */\n 'data-cx-theme'?: 'dark' | 'light'\n /**\n * Renders inline at and above this breakpoint, as a drawer below it. `true` renders inline at\n * every width; omit to keep the drawer at every width.\n */\n expand?: boolean | Breakpoint\n /**\n * Place component in non-static positions.\n */\n placement?: 'fixed-top' | 'fixed-bottom' | 'sticky-top' | 'sticky-bottom'\n /**\n * Blurs and saturates whatever sits behind the navbar — useful when it's positioned over a\n * hero image, video, or scrollable content.\n */\n translucent?: boolean\n /**\n * Sets the context style of the component. `basic` (the default) renders with no extra class.\n */\n variant?: ContextStyle\n}\n\nexport type NavbarProps<C extends ElementType = 'nav'> = PolymorphicComponentProps<\n C,\n NavbarOwnProps<C>\n>\n\ntype NavbarComponent = (<C extends ElementType = 'nav'>(\n props: NavbarProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarRender<C extends ElementType = 'nav'>(\n {\n children,\n className,\n color,\n component,\n container,\n expand,\n placement,\n translucent,\n variant,\n ...rest\n }: NavbarProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'nav'\n const _className = classNames(\n 'navbar',\n color,\n {\n context: !!color,\n solid: variant === 'solid',\n smooth: variant === 'smooth',\n outline: variant === 'outline',\n translucent,\n [typeof expand === 'boolean' ? 'navbar-expand' : `${expand}:navbar-expand`]: expand\n },\n placement,\n className\n )\n\n let content\n if (container) {\n content = (\n <div className={`container${container !== true ? '-' + container : ''}`}>{children}</div>\n )\n } else {\n content = children\n }\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {content}\n </Component>\n )\n}\n\nexport const Navbar = createPolymorphicComponent<NavbarComponent>(\n NavbarRender as ForwardRefRenderFunction<Element, NavbarProps<ElementType>>,\n 'Navbar'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { hrefProps, linkElement, resolveLinkKind } from '../../utils/elementKind'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef,\n PolymorphicRefWithFallback\n} from '../../utils/polymorphic'\n\ntype NavbarBrandOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n * Defaults to `span`, or `a` when `href` is set.\n */\n component?: C\n /**\n * The href attribute specifies the URL of the page the link goes to. Defaults `component` to\n * `a`.\n */\n href?: string\n}\n\nexport type NavbarBrandProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n NavbarBrandOwnProps<C>\n>\n\ntype NavbarBrandComponent = (<C extends ElementType = 'span'>(\n props: NavbarBrandProps<C> & {\n ref?: PolymorphicRefWithFallback<C, HTMLSpanElement | HTMLAnchorElement>\n }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarBrandRender<C extends ElementType = 'span'>(\n { children, component, className, href, ...rest }: NavbarBrandProps<C>,\n ref: PolymorphicRef<C>\n) {\n // `href` makes it an `<a>`, unless `component` or `asChild` chose the element (see\n // `linkElement`).\n const Component = linkElement(component, href, 'span')\n const _className = classNames('navbar-brand', className)\n\n return (\n <Component\n className={_className}\n {...hrefProps(resolveLinkKind(Component, href, rest), href, 'NavbarBrand')}\n {...rest}\n ref={ref}\n >\n {children}\n </Component>\n )\n}\n\nexport const NavbarBrand = createPolymorphicComponent<NavbarBrandComponent>(\n NavbarBrandRender as ForwardRefRenderFunction<Element, NavbarBrandProps<ElementType>>,\n 'NavbarBrand'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement, useContext } from 'react'\nimport classNames from 'classnames'\n\nimport { resolveElementTag } from '../../utils/elementKind'\nimport { NavOverflowContext, NavOverflowItems } from '../../utils/navOverflow'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype NavbarNavOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type NavbarNavProps<C extends ElementType = 'ul'> = PolymorphicComponentProps<\n C,\n NavbarNavOwnProps<C>\n>\n\ntype NavbarNavComponent = (<C extends ElementType = 'ul'>(\n props: NavbarNavProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarNavRender<C extends ElementType = 'ul'>(\n { children, component, className, ...rest }: NavbarNavProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'ul'\n // Inside a `NavOverflow` the list is also a `.nav`, which is what chassis-css keeps on one line\n // there (`.nav-overflow > .nav`).\n const overflows = useContext(NavOverflowContext) !== null\n const _className = classNames({ nav: overflows }, 'navbar-nav', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n <NavOverflowItems tag={resolveElementTag(Component)}>{children}</NavOverflowItems>\n </Component>\n )\n}\n\nexport const NavbarNav = createPolymorphicComponent<NavbarNavComponent>(\n NavbarNavRender as ForwardRefRenderFunction<Element, NavbarNavProps<ElementType>>,\n 'NavbarNav'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype NavbarTextOwnProps<C extends ElementType> = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * Component used for the root node. Either a string to use a HTML element or a component.\n */\n component?: C\n}\n\nexport type NavbarTextProps<C extends ElementType = 'span'> = PolymorphicComponentProps<\n C,\n NavbarTextOwnProps<C>\n>\n\ntype NavbarTextComponent = (<C extends ElementType = 'span'>(\n props: NavbarTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction NavbarTextRender<C extends ElementType = 'span'>(\n { children, className, component, ...rest }: NavbarTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'span'\n const _className = classNames('navbar-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const NavbarText = createPolymorphicComponent<NavbarTextComponent>(\n NavbarTextRender as ForwardRefRenderFunction<Element, NavbarTextProps<ElementType>>,\n 'NavbarText'\n)\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../../utils/iconSlot'\nimport { VisuallyHidden } from '../visually-hidden/VisuallyHidden'\n\nexport interface NavbarTogglerProps extends HTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * The toggler icon: an icon name, or an element of your own icon set. Defaults to\n * `IconProvider`'s `menu` icon.\n */\n icon?: IconValue\n /**\n * The accessible label announced by assistive technology when no children are provided.\n */\n label?: string\n}\n\nexport const NavbarToggler = forwardRef<HTMLButtonElement, NavbarTogglerProps>(\n ({ children, className, icon, label = 'Toggle navigation', ...rest }, ref) => {\n const _className = classNames('button icon-only navbar-toggler', className)\n\n return (\n <button type=\"button\" className={_className} {...rest} ref={ref}>\n {children ?? (\n <>\n <IconSlot icon=\"menu\" override={icon} className=\"navbar-toggler-icon\" />\n <VisuallyHidden>{label}</VisuallyHidden>\n </>\n )}\n </button>\n )\n }\n)\n\nNavbarToggler.displayName = 'NavbarToggler'\n"],"mappings":"4WA6DA,SAAS,EACP,CACE,WACA,YACA,QACA,YACA,YACA,SACA,YACA,cACA,UACA,GAAG,GAEL,EACA,CACA,IAAM,EAAY,GAAa,MACzB,EAAa,EACjB,SACA,EACA,CACE,QAAS,CAAC,CAAC,EACX,MAAO,IAAY,QACnB,OAAQ,IAAY,SACpB,QAAS,IAAY,UACrB,eACC,OAAO,GAAW,UAAY,gBAAkB,GAAG,EAAO,iBAAkB,CAC/E,EACA,EACA,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,EAAa,EAAW,kCAAmC,CAAS,EAE1E,OACE,EAAA,cAAC,SAAD,CAAQ,KAAK,SAAS,UAAW,EAAY,GAAI,EAAW,KAOpD,EANL,GACC,EAAA,cAAA,EAAA,SAAA,KACE,EAAA,cAAC,EAAD,CAAU,KAAK,OAAO,SAAU,EAAM,UAAU,qBAAuB,CAAA,EACvE,EAAA,cAAC,EAAA,KAAgB,CAAsB,CACvC,CAEE,CAEZ,CACF,EAEA,EAAc,YAAc"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./focus-ring-SR_LwaN7.js";import{t as e}from"./polymorphic-BhGNZQja.js";import{n as t,r as n,t as r}from"./useToastRegionQueue-CIV5SdiE.js";import{t as i}from"./Icon-DLB1f88W.js";import{n as a}from"./iconSlot-BNu2MrFI.js";import{t as o}from"./CloseButton-DPgQztE0.js";import{t as s}from"./stack-DK5F53VT.js";import c,{createContext as l,forwardRef as u,useContext as d}from"react";import f from"classnames";import{mergeProps as p}from"react-aria";import{ToastQueue as m}from"react-stately";const h=l({close:()=>{}}),g=()=>d(h);function _({children:e,component:t,className:n,...r},i){let a=t??`div`,o=f(`notification-text`,n);return c.createElement(a,{className:o,...r,ref:i},e)}const v=e(_,`NotificationText`);function y({children:e,className:t,component:n,...r},i){let a=n??`h4`,o=f(`notification-title`,t);return c.createElement(a,{className:o,...r,ref:i},e)}const b=e(y,`NotificationTitle`),x=u(({actions:e,autohide:r=!1,children:i,className:s,closeLabel:l=`Close`,color:u=`primary`,defaultVisible:d=!0,delay:m=5e3,dismissible:g,icon:_,solid:y,text:x,title:S,titleComponent:C=`h4`,role:w=`status`,visible:T,onClose:E,onShow:D,onVisibleChange:O,...k},A)=>{let{close:j,entered:M,forkedRef:N,isMounted:P,textId:F,titleId:I,transitionClass:L,visible:R}=t({defaultVisible:d,displayName:`Notification`,onClose:E,onShow:D,onVisibleChange:O,ref:A,visible:T}),z=n({enabled:r,delay:m,visible:R&&M,onHide:j}),B=f(`notification`,`fade`,u,{solid:y},s);return P?c.createElement(h.Provider,{value:{visible:R,close:j}},c.createElement(`div`,{className:f(B,L),role:w,"aria-labelledby":S?I:void 0,"aria-describedby":S&&x?F:void 0,...p(k,z),ref:N},_&&(typeof _==`string`?c.createElement(a,{value:_,className:f(`notification-icon`,{"align-self-start":!!S})}):_),S&&c.createElement(b,{id:I,component:C},S),x&&c.createElement(v,{id:F},x),i,e,g&&c.createElement(o,{label:l,onClick:j}))):null});x.displayName=`Notification`;const S=u(({className:e,...t},n)=>{let r=f(`notification-icon`,e);return c.createElement(i,{className:r,...t,ref:n})});S.displayName=`NotificationIcon`;const C=new m;function w(e,t={}){return C.add({children:e,...t})}function T(e){C.close(e)}const E=u(({children:e,className:t,reverse:n,...i},a)=>{let{forkedRef:o,regionProps:l,state:u}=r(C,a);if(u.visibleToasts.length===0&&!e)return null;let d=n?[...u.visibleToasts].reverse():u.visibleToasts;return c.createElement(s,{direction:`vertical`,gap:`sm`,className:t,...l,...i,ref:o},e,d.map(e=>{let{children:t,...n}=e.content;return c.createElement(x,{key:e.key,...n,onClose:()=>u.close(e.key)},t)}))});E.displayName=`NotificationStack`;export{S as a,v as c,C as i,g as l,w as n,x as o,T as r,b as s,E as t};
|
|
2
|
-
//# sourceMappingURL=notification-Dbci5Ka3.js.map
|