@chassis-ui/react 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/accordion.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/autocomplete.d.ts +1 -1
- package/dist/autocomplete.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.js +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.js +1 -1
- package/dist/chip.js +1 -1
- package/dist/chunks/Button-Cjenm3ku.js +2 -0
- package/dist/chunks/Button-Cjenm3ku.js.map +1 -0
- package/dist/chunks/{Chip-C7QlFCvx.js → Chip-CXuYhjc3.js} +2 -2
- package/dist/chunks/{Chip-C7QlFCvx.js.map → Chip-CXuYhjc3.js.map} +1 -1
- package/dist/chunks/CloseButton-CAQ--0sB.js +2 -0
- package/dist/chunks/CloseButton-CAQ--0sB.js.map +1 -0
- package/dist/chunks/{DateField-4cdcwt0v.js → DateField-G1TP9ayt.js} +2 -2
- package/dist/chunks/{DateField-4cdcwt0v.js.map → DateField-G1TP9ayt.js.map} +1 -1
- package/dist/chunks/{FormHelp-B1eSoack.js → FormHelp-2U3P8C6b.js} +2 -2
- package/dist/chunks/{FormHelp-B1eSoack.js.map → FormHelp-2U3P8C6b.js.map} +1 -1
- package/dist/chunks/Link-B3SX50Od.js +2 -0
- package/dist/chunks/Link-B3SX50Od.js.map +1 -0
- package/dist/chunks/Menu-DBN4Mxak.js +2 -0
- package/dist/chunks/Menu-DBN4Mxak.js.map +1 -0
- package/dist/chunks/MenuToggle-DHzKm1Ed.js +2 -0
- package/dist/chunks/MenuToggle-DHzKm1Ed.js.map +1 -0
- package/dist/chunks/{RangeCalendar-mM3OeTlU.js → RangeCalendar-DRcg1Hp3.js} +2 -2
- package/dist/chunks/{RangeCalendar-mM3OeTlU.js.map → RangeCalendar-DRcg1Hp3.js.map} +1 -1
- package/dist/chunks/{VisuallyHidden-CGv-mBuQ.js → VisuallyHidden-24WfUCsJ.js} +2 -2
- package/dist/chunks/{VisuallyHidden-CGv-mBuQ.js.map → VisuallyHidden-24WfUCsJ.js.map} +1 -1
- package/dist/chunks/{accordion-BZlX2uk8.js → accordion-DiYPbV_r.js} +2 -2
- package/dist/chunks/{accordion-BZlX2uk8.js.map → accordion-DiYPbV_r.js.map} +1 -1
- package/dist/chunks/alert-oSKrhxkI.js +2 -0
- package/dist/chunks/{alert-DSLg5MBb.js.map → alert-oSKrhxkI.js.map} +1 -1
- package/dist/chunks/autocomplete-wjDWeWDh.js +2 -0
- package/dist/chunks/autocomplete-wjDWeWDh.js.map +1 -0
- package/dist/chunks/{avatar-BQBbcnk6.js → avatar-CvcvC9KA.js} +2 -2
- package/dist/chunks/{avatar-BQBbcnk6.js.map → avatar-CvcvC9KA.js.map} +1 -1
- package/dist/chunks/{badge-Ths1Qn1a.js → badge-D7XgWBXc.js} +2 -2
- package/dist/chunks/{badge-Ths1Qn1a.js.map → badge-D7XgWBXc.js.map} +1 -1
- package/dist/chunks/{breadcrumb-BTiQikk-.js → breadcrumb-DxCHVppV.js} +2 -2
- package/dist/chunks/{breadcrumb-BTiQikk-.js.map → breadcrumb-DxCHVppV.js.map} +1 -1
- package/dist/chunks/{button-group-CefkGeYL.js → button-group-CXMj0D4r.js} +2 -2
- package/dist/chunks/{button-group-CefkGeYL.js.map → button-group-CXMj0D4r.js.map} +1 -1
- package/dist/chunks/{card-CEQgHIaL.js → card-C6lPZs5J.js} +2 -2
- package/dist/chunks/{card-CEQgHIaL.js.map → card-C6lPZs5J.js.map} +1 -1
- package/dist/chunks/carousel-Ka9OA-HJ.js +2 -0
- package/dist/chunks/carousel-Ka9OA-HJ.js.map +1 -0
- package/dist/chunks/checkbox-5jv0YWoi.js +2 -0
- package/dist/chunks/checkbox-5jv0YWoi.js.map +1 -0
- package/dist/chunks/chip-input-D8EaNujM.js +2 -0
- package/dist/chunks/chip-input-D8EaNujM.js.map +1 -0
- package/dist/chunks/{collapse-CBi3RWTf.js → collapse-Bc7fnmyU.js} +2 -2
- package/dist/chunks/{collapse-CBi3RWTf.js.map → collapse-Bc7fnmyU.js.map} +1 -1
- package/dist/chunks/color-input-DBOd4Jba.js +2 -0
- package/dist/chunks/color-input-DBOd4Jba.js.map +1 -0
- package/dist/chunks/combobox-DByuUtwh.js +2 -0
- package/dist/chunks/{combobox-DNqR4d3V.js.map → combobox-DByuUtwh.js.map} +1 -1
- package/dist/chunks/context-HDVxTNPi.js.map +1 -1
- package/dist/chunks/context-menu-CGOGliw6.js +2 -0
- package/dist/chunks/context-menu-CGOGliw6.js.map +1 -0
- package/dist/chunks/datagrid-Dv_9uFef.js +2 -0
- package/dist/chunks/datagrid-Dv_9uFef.js.map +1 -0
- package/dist/chunks/datepicker-DuYmXiSe.js +2 -0
- package/dist/chunks/datepicker-DuYmXiSe.js.map +1 -0
- package/dist/chunks/dialogTitle-DMBvXZLT.js +2 -0
- package/dist/chunks/dialogTitle-DMBvXZLT.js.map +1 -0
- package/dist/chunks/{divider-C1-NoKMV.js → divider-DbWmMSrn.js} +2 -2
- package/dist/chunks/{divider-C1-NoKMV.js.map → divider-DbWmMSrn.js.map} +1 -1
- package/dist/chunks/drawer-DPxF30qn.js +2 -0
- package/dist/chunks/drawer-DPxF30qn.js.map +1 -0
- package/dist/chunks/file-input-B5YaBXjI.js +2 -0
- package/dist/chunks/file-input-B5YaBXjI.js.map +1 -0
- package/dist/chunks/{flex-C2jV5LyV.js → flex-C6CbAkVJ.js} +2 -2
- package/dist/chunks/{flex-C2jV5LyV.js.map → flex-C6CbAkVJ.js.map} +1 -1
- package/dist/chunks/floating-input-B9YAJ9d4.js +2 -0
- package/dist/chunks/floating-input-B9YAJ9d4.js.map +1 -0
- package/dist/chunks/{form-field-Bcx96ezd.js → form-field-D74QY_wP.js} +2 -2
- package/dist/chunks/{form-field-Bcx96ezd.js.map → form-field-D74QY_wP.js.map} +1 -1
- package/dist/chunks/grid-BCVkow3u.js +2 -0
- package/dist/chunks/grid-BCVkow3u.js.map +1 -0
- package/dist/chunks/{index-5qsV1-cc.d.ts → index--DV9l24Q.d.ts} +18 -14
- package/dist/chunks/{index-BAvt_oPe.d.ts → index-B2d_pjjy.d.ts} +6 -5
- package/dist/chunks/{index-CbcFEGCh.d.ts → index-BIWaMOr6.d.ts} +9 -2
- package/dist/chunks/{index-3JVLrDHv.d.ts → index-BMAdUGiM.d.ts} +7 -1
- package/dist/chunks/{index-Cpifcw5a.d.ts → index-BzYAMLX1.d.ts} +44 -4
- package/dist/chunks/{index-BbZzaApz.d.ts → index-C9RqZNjk.d.ts} +7 -1
- package/dist/chunks/{index-D0Dhs7YI.d.ts → index-CHtvpvUh.d.ts} +6 -1
- package/dist/chunks/{index-Bl-_sC4y.d.ts → index-CSmHNy8M.d.ts} +8 -2
- package/dist/chunks/{index-Davd7Cue.d.ts → index-CXzKYWtS.d.ts} +3 -2
- package/dist/chunks/{index-OnB4_h6x.d.ts → index-DV_JBDoF.d.ts} +2 -2
- package/dist/chunks/{index-Es9I0fIS.d.ts → index-DjmN2hBX.d.ts} +2 -2
- package/dist/chunks/{index-UjmJQRaG.d.ts → index-DyB9XXLJ.d.ts} +3 -3
- package/dist/chunks/{index-CSRGr7pU.d.ts → index-JCnEw-55.d.ts} +2 -6
- package/dist/chunks/{index-Ctf5hLue.d.ts → index-Me921MYl.d.ts} +15 -13
- package/dist/chunks/{index-C-IrFdKe.d.ts → index-OgWCTy2Y.d.ts} +2 -2
- package/dist/chunks/{index-BZpHSGlk.d.ts → index-bZRQGwY7.d.ts} +7 -2
- package/dist/chunks/{index-Cm3rPbI1.d.ts → index-qJGkO-ni.d.ts} +3 -3
- package/dist/chunks/{input-adorn-DV9tuWXh.js → input-adorn-D0E3Afdf.js} +2 -2
- package/dist/chunks/{input-adorn-DV9tuWXh.js.map → input-adorn-D0E3Afdf.js.map} +1 -1
- package/dist/chunks/{input-group-YB_zoKud.js → input-group-paIBtI1R.js} +2 -2
- package/dist/chunks/{input-group-YB_zoKud.js.map → input-group-paIBtI1R.js.map} +1 -1
- package/dist/chunks/{list-BPBZR66Y.js → list-Ch6vxaUs.js} +2 -2
- package/dist/chunks/{list-BPBZR66Y.js.map → list-Ch6vxaUs.js.map} +1 -1
- package/dist/chunks/menu-DTe27h5q.js +2 -0
- package/dist/chunks/{menu-Bqlhottl.js.map → menu-DTe27h5q.js.map} +1 -1
- package/dist/chunks/modal-BDQe7xyy.js +2 -0
- package/dist/chunks/modal-BDQe7xyy.js.map +1 -0
- package/dist/chunks/nativeFormReset-DgsRU9SA.js +2 -0
- package/dist/chunks/nativeFormReset-DgsRU9SA.js.map +1 -0
- package/dist/chunks/nav-DDI8Dv28.js +2 -0
- package/dist/chunks/nav-DDI8Dv28.js.map +1 -0
- package/dist/chunks/{nav-overflow-GWARvoQZ.js → nav-overflow-BxAhoMh3.js} +2 -2
- package/dist/chunks/{nav-overflow-GWARvoQZ.js.map → nav-overflow-BxAhoMh3.js.map} +1 -1
- package/dist/chunks/{navOverflow-C_QJmkPM.js → navOverflow-eSROB_mV.js} +2 -2
- package/dist/chunks/{navOverflow-C_QJmkPM.js.map → navOverflow-eSROB_mV.js.map} +1 -1
- package/dist/chunks/{navVariant-D4wiKS8I.js → navVariant-Bm5k8CY3.js} +2 -2
- package/dist/chunks/{navVariant-D4wiKS8I.js.map → navVariant-Bm5k8CY3.js.map} +1 -1
- package/dist/chunks/{navbar-C7dO0YRs.js → navbar-BYMKe2yW.js} +2 -2
- package/dist/chunks/{navbar-C7dO0YRs.js.map → navbar-BYMKe2yW.js.map} +1 -1
- package/dist/chunks/{notification-oIrUtDhl.js → notification-C1Sd4X7M.js} +2 -2
- package/dist/chunks/{notification-oIrUtDhl.js.map → notification-C1Sd4X7M.js.map} +1 -1
- package/dist/chunks/{number-field-ChPTSBwI.js → number-field-BIApgIlR.js} +2 -2
- package/dist/chunks/{number-field-ChPTSBwI.js.map → number-field-BIApgIlR.js.map} +1 -1
- package/dist/chunks/otp-input-CCkfFZID.js +2 -0
- package/dist/chunks/otp-input-CCkfFZID.js.map +1 -0
- package/dist/chunks/overlayPlacement-D2vfhhg3.js +2 -0
- package/dist/chunks/overlayPlacement-D2vfhhg3.js.map +1 -0
- package/dist/chunks/{pagination-Dvz8lccd.js → pagination-WINUPT_P.js} +2 -2
- package/dist/chunks/pagination-WINUPT_P.js.map +1 -0
- package/dist/chunks/placeholder-9rTlnMso.js +2 -0
- package/dist/chunks/{placeholder-SPoVRkKE.js.map → placeholder-9rTlnMso.js.map} +1 -1
- package/dist/chunks/polymorphic-mAKwlLiW.js +2 -0
- package/dist/chunks/{polymorphic-CZIFszAy.js.map → polymorphic-mAKwlLiW.js.map} +1 -1
- package/dist/chunks/popover-CrAJTevL.js +2 -0
- package/dist/chunks/popover-CrAJTevL.js.map +1 -0
- package/dist/chunks/{progress-CiSJDNwx.js → progress-CAqSu3jc.js} +2 -2
- package/dist/chunks/{progress-CiSJDNwx.js.map → progress-CAqSu3jc.js.map} +1 -1
- package/dist/chunks/{radio-C42F_5OD.js → radio-XlINMnQm.js} +2 -2
- package/dist/chunks/{radio-C42F_5OD.js.map → radio-XlINMnQm.js.map} +1 -1
- package/dist/chunks/range-input-tyImJHKI.js +2 -0
- package/dist/chunks/range-input-tyImJHKI.js.map +1 -0
- package/dist/chunks/{renderFormField-_6WswnEX.js → renderFormField-CaZ8-xrn.js} +2 -2
- package/dist/chunks/{renderFormField-_6WswnEX.js.map → renderFormField-CaZ8-xrn.js.map} +1 -1
- package/dist/chunks/{search-field-OFsb3t4L.js → search-field-CIYtMraB.js} +2 -2
- package/dist/chunks/{search-field-OFsb3t4L.js.map → search-field-CIYtMraB.js.map} +1 -1
- package/dist/chunks/select-CkucgA6H.js +2 -0
- package/dist/chunks/select-CkucgA6H.js.map +1 -0
- package/dist/chunks/{skeleton-B2blJGWj.js → skeleton-CXFwCjB9.js} +2 -2
- package/dist/chunks/{skeleton-B2blJGWj.js.map → skeleton-CXFwCjB9.js.map} +1 -1
- package/dist/chunks/slot-DagH0Gxq.js +2 -0
- package/dist/chunks/slot-DagH0Gxq.js.map +1 -0
- package/dist/chunks/{spinner-D8lQCW4u.js → spinner-BLQiCoQd.js} +2 -2
- package/dist/chunks/{spinner-D8lQCW4u.js.map → spinner-BLQiCoQd.js.map} +1 -1
- package/dist/chunks/{stack-DtzW54UK.js → stack-OItr30SC.js} +2 -2
- package/dist/chunks/{stack-DtzW54UK.js.map → stack-OItr30SC.js.map} +1 -1
- package/dist/chunks/{stepper-tSA84huJ.js → stepper-BLjW7UnC.js} +2 -2
- package/dist/chunks/{stepper-tSA84huJ.js.map → stepper-BLjW7UnC.js.map} +1 -1
- package/dist/chunks/switch-nt7aXQDX.js +2 -0
- package/dist/chunks/switch-nt7aXQDX.js.map +1 -0
- package/dist/chunks/table-KtPHx4FG.js +2 -0
- package/dist/chunks/table-KtPHx4FG.js.map +1 -0
- package/dist/chunks/{tabs-DMFSLjnV.js → tabs-Dh5kH5Ik.js} +2 -2
- package/dist/chunks/{tabs-DMFSLjnV.js.map → tabs-Dh5kH5Ik.js.map} +1 -1
- package/dist/chunks/{text-input-CR73x-8D.js → text-input-D3jBYiLn.js} +2 -2
- package/dist/chunks/{text-input-CR73x-8D.js.map → text-input-D3jBYiLn.js.map} +1 -1
- package/dist/chunks/{textarea-C-1cMyH4.js → textarea-2BJCzT97.js} +2 -2
- package/dist/chunks/{textarea-C-1cMyH4.js.map → textarea-2BJCzT97.js.map} +1 -1
- package/dist/chunks/{time-field-CbCfOQZz.js → time-field-ClPbatW3.js} +2 -2
- package/dist/chunks/{time-field-CbCfOQZz.js.map → time-field-ClPbatW3.js.map} +1 -1
- package/dist/chunks/toast-D5-58Ch1.js +2 -0
- package/dist/chunks/toast-D5-58Ch1.js.map +1 -0
- package/dist/chunks/tooltip-TGFFlOJL.js +2 -0
- package/dist/chunks/tooltip-TGFFlOJL.js.map +1 -0
- package/dist/chunks/tree-BO0WSxQa.js +2 -0
- package/dist/chunks/tree-BO0WSxQa.js.map +1 -0
- package/dist/chunks/useButtonSemantics-DN3OIXtG.js +2 -0
- package/dist/chunks/useButtonSemantics-DN3OIXtG.js.map +1 -0
- package/dist/chunks/{useDialogElement-BfygWBPZ.js → useDialogElement-yEgUSejP.js} +2 -2
- package/dist/chunks/useDialogElement-yEgUSejP.js.map +1 -0
- package/dist/chunks/{useFormField-DH2tlc3e.js → useFormField-q21MOgh8.js} +2 -2
- package/dist/chunks/{useFormField-DH2tlc3e.js.map → useFormField-q21MOgh8.js.map} +1 -1
- package/dist/chunks/useFormReset-BK5Yb24_.js +2 -0
- package/dist/chunks/useFormReset-BK5Yb24_.js.map +1 -0
- package/dist/chunks/useHeldBack-o-CsPcSe.js +2 -0
- package/dist/chunks/useHeldBack-o-CsPcSe.js.map +1 -0
- package/dist/chunks/{useOpenStateProps-BhjSQ3f6.js → useOpenStateProps-CdSO1nmI.js} +2 -2
- package/dist/chunks/{useOpenStateProps-BhjSQ3f6.js.map → useOpenStateProps-CdSO1nmI.js.map} +1 -1
- package/dist/chunks/useOverlayMaxHeight-5UnurH0W.js +2 -0
- package/dist/chunks/useOverlayMaxHeight-5UnurH0W.js.map +1 -0
- package/dist/chunks/{useRequiredValueInput-gYN8I-LY.js → useRequiredValueInput-CL7AIgqz.js} +2 -2
- package/dist/chunks/{useRequiredValueInput-gYN8I-LY.js.map → useRequiredValueInput-CL7AIgqz.js.map} +1 -1
- package/dist/chunks/useSelectionForMode-B_oTWvEy.js +2 -0
- package/dist/chunks/useSelectionForMode-B_oTWvEy.js.map +1 -0
- package/dist/chunks/useToastRegionQueue-QHa4v7k6.js +2 -0
- package/dist/chunks/useToastRegionQueue-QHa4v7k6.js.map +1 -0
- package/dist/chunks/useTransitionState-WEw9C0yn.js +2 -0
- package/dist/chunks/useTransitionState-WEw9C0yn.js.map +1 -0
- package/dist/chunks/{visibleState-CWyQak65.js → visibleState-DVyxSMUT.js} +2 -2
- package/dist/chunks/{visibleState-CWyQak65.js.map → visibleState-DVyxSMUT.js.map} +1 -1
- package/dist/close-button.js +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.js +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.js +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.js +1 -1
- package/dist/floating-input.d.ts +1 -1
- package/dist/floating-input.js +1 -1
- package/dist/form-field.js +1 -1
- package/dist/form.js +1 -1
- package/dist/grid.js +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.js +1 -1
- package/dist/input-adorn.js +1 -1
- package/dist/input-group.js +1 -1
- package/dist/link.js +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.d.ts +1 -1
- package/dist/modal.js +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.js +1 -1
- package/dist/notification.js +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/placeholder.js +1 -1
- package/dist/popover.js +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/search-field.js +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/spinner.js +1 -1
- package/dist/stack.js +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.js +1 -1
- package/dist/text-input.js +1 -1
- package/dist/textarea.js +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.js +1 -1
- package/dist/tree.js +1 -1
- package/dist/visually-hidden.js +1 -1
- package/package.json +11 -11
- package/dist/chunks/Button-ZU-x1uN_.js +0 -2
- package/dist/chunks/Button-ZU-x1uN_.js.map +0 -1
- package/dist/chunks/CloseButton-BPUI5iGX.js +0 -2
- package/dist/chunks/CloseButton-BPUI5iGX.js.map +0 -1
- package/dist/chunks/Link-DE8NSAXJ.js +0 -2
- package/dist/chunks/Link-DE8NSAXJ.js.map +0 -1
- package/dist/chunks/Menu-BiE9CzNk.js +0 -2
- package/dist/chunks/Menu-BiE9CzNk.js.map +0 -1
- package/dist/chunks/MenuToggle-W-ZSHFwF.js +0 -2
- package/dist/chunks/MenuToggle-W-ZSHFwF.js.map +0 -1
- package/dist/chunks/alert-DSLg5MBb.js +0 -2
- package/dist/chunks/autocomplete-Btcsjrh3.js +0 -2
- package/dist/chunks/autocomplete-Btcsjrh3.js.map +0 -1
- package/dist/chunks/carousel-DC-UGc6W.js +0 -2
- package/dist/chunks/carousel-DC-UGc6W.js.map +0 -1
- package/dist/chunks/checkbox-ko6CdtoT.js +0 -2
- package/dist/chunks/checkbox-ko6CdtoT.js.map +0 -1
- package/dist/chunks/chip-input-CugY8EOc.js +0 -2
- package/dist/chunks/chip-input-CugY8EOc.js.map +0 -1
- package/dist/chunks/color-input-C4zMWlvm.js +0 -2
- package/dist/chunks/color-input-C4zMWlvm.js.map +0 -1
- package/dist/chunks/combobox-DNqR4d3V.js +0 -2
- package/dist/chunks/context-menu-D3DNFN-P.js +0 -2
- package/dist/chunks/context-menu-D3DNFN-P.js.map +0 -1
- package/dist/chunks/datagrid-n9vFeXN1.js +0 -2
- package/dist/chunks/datagrid-n9vFeXN1.js.map +0 -1
- package/dist/chunks/datepicker-DqztYJD6.js +0 -2
- package/dist/chunks/datepicker-DqztYJD6.js.map +0 -1
- package/dist/chunks/drawer-CRv9jmbp.js +0 -2
- package/dist/chunks/drawer-CRv9jmbp.js.map +0 -1
- package/dist/chunks/file-input-D_Gl1h-T.js +0 -2
- package/dist/chunks/file-input-D_Gl1h-T.js.map +0 -1
- package/dist/chunks/floating-input-D4gWFfOU.js +0 -2
- package/dist/chunks/floating-input-D4gWFfOU.js.map +0 -1
- package/dist/chunks/grid-CkdPftit.js +0 -2
- package/dist/chunks/grid-CkdPftit.js.map +0 -1
- package/dist/chunks/menu-Bqlhottl.js +0 -2
- package/dist/chunks/modal-CHvsDTyl.js +0 -2
- package/dist/chunks/modal-CHvsDTyl.js.map +0 -1
- package/dist/chunks/nav-B4U_Hqs7.js +0 -2
- package/dist/chunks/nav-B4U_Hqs7.js.map +0 -1
- package/dist/chunks/otp-input-DUtCMg8P.js +0 -2
- package/dist/chunks/otp-input-DUtCMg8P.js.map +0 -1
- package/dist/chunks/overlayPlacement-Q6bcbXA5.js +0 -2
- package/dist/chunks/overlayPlacement-Q6bcbXA5.js.map +0 -1
- package/dist/chunks/pagination-Dvz8lccd.js.map +0 -1
- package/dist/chunks/placeholder-SPoVRkKE.js +0 -2
- package/dist/chunks/polymorphic-CZIFszAy.js +0 -2
- package/dist/chunks/popover-C_32yD9W.js +0 -2
- package/dist/chunks/popover-C_32yD9W.js.map +0 -1
- package/dist/chunks/range-input-DeZq_9S7.js +0 -2
- package/dist/chunks/range-input-DeZq_9S7.js.map +0 -1
- package/dist/chunks/select-DwyL6aqY.js +0 -2
- package/dist/chunks/select-DwyL6aqY.js.map +0 -1
- package/dist/chunks/slot-BQVx1Eew.js +0 -2
- package/dist/chunks/slot-BQVx1Eew.js.map +0 -1
- package/dist/chunks/switch-cp3IZg3L.js +0 -2
- package/dist/chunks/switch-cp3IZg3L.js.map +0 -1
- package/dist/chunks/table-CBTg5Yuq.js +0 -2
- package/dist/chunks/table-CBTg5Yuq.js.map +0 -1
- package/dist/chunks/toast-Dd0J2e1z.js +0 -2
- package/dist/chunks/toast-Dd0J2e1z.js.map +0 -1
- package/dist/chunks/tooltip-CmKeQwYw.js +0 -2
- package/dist/chunks/tooltip-CmKeQwYw.js.map +0 -1
- package/dist/chunks/tree-DNj_EfUl.js +0 -2
- package/dist/chunks/tree-DNj_EfUl.js.map +0 -1
- package/dist/chunks/useButtonSemantics-B1SbGaDO.js +0 -2
- package/dist/chunks/useButtonSemantics-B1SbGaDO.js.map +0 -1
- package/dist/chunks/useDialogElement-BfygWBPZ.js.map +0 -1
- package/dist/chunks/useDialogTitle-DiB4YDGI.js +0 -2
- package/dist/chunks/useDialogTitle-DiB4YDGI.js.map +0 -1
- package/dist/chunks/useFloatingOverlay-BuiI_CCn.js +0 -2
- package/dist/chunks/useFloatingOverlay-BuiI_CCn.js.map +0 -1
- package/dist/chunks/useHeldBack-eeTfpa_t.js +0 -2
- package/dist/chunks/useHeldBack-eeTfpa_t.js.map +0 -1
- package/dist/chunks/useOverlayMaxHeight-DTgbr4UQ.js +0 -2
- package/dist/chunks/useOverlayMaxHeight-DTgbr4UQ.js.map +0 -1
- package/dist/chunks/useToastRegionQueue-CuAMxAIA.js +0 -2
- package/dist/chunks/useToastRegionQueue-CuAMxAIA.js.map +0 -1
- package/dist/chunks/useTransitionState-sQUQey74.js +0 -2
- package/dist/chunks/useTransitionState-sQUQey74.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-CEQgHIaL.js","names":["devWarning","Link","responsiveProp","baseValue","flexDirectionClassName","spacingClassName","React","classNames","CardBodyRender","rest","Component","component","_className","responsiveClassNames","direction","gap","className","children","CardBody","createPolymorphicComponent","CardFooterRender","CardFooter","BREAKPOINT_ORIENTATIONS","ORIENTATION_PREFIXES","orientationClassName","prefix","orientation","hasRule","CardImageRender","CardImage","CardSubtitleRender","CardSubtitle","CardTextRender","CardText","CardTitleRender","CardTitle","CardRender","color","variant","size","hasShorthand","image","title","subtitle","footer","text","hasBodyContent","renderedImage","imageOrientation","imageAlt","Card","CardGroupRender","CardGroup","CardHeaderRender","CardHeader","CardImageOverlayRender","CardImageOverlay","CardLinkRender","CardLink"],"sources":["../../src/components/card/CardBody.tsx","../../src/components/card/CardFooter.tsx","../../src/components/card/CardImage.tsx","../../src/components/card/CardSubtitle.tsx","../../src/components/card/CardText.tsx","../../src/components/card/CardTitle.tsx","../../src/components/card/Card.tsx","../../src/components/card/CardGroup.tsx","../../src/components/card/CardHeader.tsx","../../src/components/card/CardImageOverlay.tsx","../../src/components/card/CardLink.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { Responsive, Spacing } from '../../types'\nimport {\n flexDirectionClassName,\n FlexDirection,\n responsiveClassNames,\n responsiveProp\n} from '../../utils/breakpoints'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { spacingClassName } from '../../utils/spacingClassName'\n\ntype CardBodyOwnProps<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 * Switches the body from its default stacked (column) layout to a side-by-side (row) layout —\n * for placing an image beside text within a single padded region. Give the image and the text\n * a width utility (`w-4/12`, `w-8/12`) to control each side's width, and nest another\n * `CardBody` (with `.p-0`) for the text side so it doesn't receive double padding. An object\n * sets the direction from a breakpoint up: `{ md: 'row' }`.\n */\n direction?: Responsive<FlexDirection>\n /**\n * Spacing between children, mapped to the `gap-*` utility classes. Overrides the card's default\n * gap between body children.\n *\n * @type { Spacing | 0 }\n */\n gap?: Spacing | 0\n}\n\nexport type CardBodyProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardBodyOwnProps<C>\n>\n\ntype CardBodyComponent = (<C extends ElementType = 'div'>(\n props: CardBodyProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardBodyRender<C extends ElementType = 'div'>(\n { children, className, component, direction, gap, ...rest }: CardBodyProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n 'card-body',\n responsiveClassNames([responsiveProp(direction, flexDirectionClassName)]),\n spacingClassName('gap', gap),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardBody = createPolymorphicComponent<CardBodyComponent>(\n CardBodyRender as ForwardRefRenderFunction<Element, CardBodyProps<ElementType>>,\n 'CardBody'\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 CardFooterOwnProps<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 CardFooterProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardFooterOwnProps<C>\n>\n\ntype CardFooterComponent = (<C extends ElementType = 'div'>(\n props: CardFooterProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardFooterRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CardFooterProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('card-footer', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardFooter = createPolymorphicComponent<CardFooterComponent>(\n CardFooterRender as ForwardRefRenderFunction<Element, CardFooterProps<ElementType>>,\n 'CardFooter'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { Responsive } from '../../types'\nimport { baseValue, responsiveClassNames, responsiveProp } from '../../utils/breakpoints'\nimport { devWarning } from '../../utils/devWarning'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype CardImageOrientation = 'top' | 'bottom' | 'start' | 'end'\n\ntype CardImageOwnProps<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 * e.g. a framework's own `Image` component. Its own props (`src`, `fill`, `priority`, etc.)\n * are type-checked at the call site once passed here.\n */\n component?: C\n /**\n * Orientates the image to the top or bottom of the card as an \"image cap\", or to the start/end\n * for a horizontal layout. Omit to round all four corners for use inside `CardBody`. An object\n * sets the orientation from a breakpoint up — e.g. `{ base: 'top', lg: 'start' }` to switch an\n * image cap from `top` to `start` once the card lays out horizontally. Only `start` and `end`\n * can be set at a breakpoint, from `sm` to `xl`: `@chassis-ui/css` has no class for `top` or\n * `bottom` there, nor for any value at `2xl`: such a value renders no class and warns in\n * development.\n */\n orientation?: Responsive<CardImageOrientation>\n}\n\nexport type CardImageProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n CardImageOwnProps<C>\n>\n\ntype CardImageComponent = (<C extends ElementType = 'img'>(\n props: CardImageProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// chassis-css has the four orientation classes at the base, and of the breakpoint ones only what\n// a card needs once it lays out in a row from some width up: `start` and `end`, from `sm` to\n// `xl`. The type takes every value at every breakpoint, and narrowing it would break the callers\n// it compiles for today (`VERSIONING.md`), so the rest is accepted, renders no class (the one it\n// rendered had no rule) and says so in development. `test/components/card/CardImage.spec.tsx`\n// holds this list to the installed stylesheet.\nconst BREAKPOINT_ORIENTATIONS: readonly CardImageOrientation[] = ['start', 'end']\nconst ORIENTATION_PREFIXES: readonly string[] = ['sm:', 'md:', 'lg:', 'xl:']\n\nconst orientationClassName = (orientation: CardImageOrientation, prefix: string) => {\n const className = `${prefix}card-image-${orientation}`\n const hasRule =\n prefix === '' ||\n (BREAKPOINT_ORIENTATIONS.includes(orientation) && ORIENTATION_PREFIXES.includes(prefix))\n devWarning(\n !hasRule,\n `CardImage: \\`orientation\\` has no class to render for \"${className}\", which ` +\n \"@chassis-ui/css doesn't have, so the value does nothing. Only `start` and `end` have \" +\n 'breakpoint classes, from `sm` to `xl`; `top` and `bottom` apply at `base` alone.'\n )\n return hasRule ? className : null\n}\n\nfunction CardImageRender<C extends ElementType = 'img'>(\n { children, className, component, orientation, ...rest }: CardImageProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'img'\n const _className = classNames(\n // With no orientation at the base, the image is the plain one of `CardBody`.\n baseValue(orientation) === undefined && 'card-image',\n responsiveClassNames([responsiveProp(orientation, orientationClassName)]),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardImage = createPolymorphicComponent<CardImageComponent>(\n CardImageRender as ForwardRefRenderFunction<Element, CardImageProps<ElementType>>,\n 'CardImage'\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 CardSubtitleOwnProps<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 CardSubtitleProps<C extends ElementType = 'h6'> = PolymorphicComponentProps<\n C,\n CardSubtitleOwnProps<C>\n>\n\ntype CardSubtitleComponent = (<C extends ElementType = 'h6'>(\n props: CardSubtitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardSubtitleRender<C extends ElementType = 'h6'>(\n { children, component, className, ...rest }: CardSubtitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h6'\n const _className = classNames('card-subtitle', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardSubtitle = createPolymorphicComponent<CardSubtitleComponent>(\n CardSubtitleRender as ForwardRefRenderFunction<Element, CardSubtitleProps<ElementType>>,\n 'CardSubtitle'\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 CardTextOwnProps<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 CardTextProps<C extends ElementType = 'p'> = PolymorphicComponentProps<\n C,\n CardTextOwnProps<C>\n>\n\ntype CardTextComponent = (<C extends ElementType = 'p'>(\n props: CardTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardTextRender<C extends ElementType = 'p'>(\n { children, component, className, ...rest }: CardTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'p'\n const _className = classNames('card-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardText = createPolymorphicComponent<CardTextComponent>(\n CardTextRender as ForwardRefRenderFunction<Element, CardTextProps<ElementType>>,\n 'CardText'\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 CardTitleOwnProps<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 CardTitleProps<C extends ElementType = 'h5'> = PolymorphicComponentProps<\n C,\n CardTitleOwnProps<C>\n>\n\ntype CardTitleComponent = (<C extends ElementType = 'h5'>(\n props: CardTitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardTitleRender<C extends ElementType = 'h5'>(\n { children, component, className, ...rest }: CardTitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h5'\n const _className = classNames('card-title', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardTitle = createPolymorphicComponent<CardTitleComponent>(\n CardTitleRender as ForwardRefRenderFunction<Element, CardTitleProps<ElementType>>,\n 'CardTitle'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement, ReactNode } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor, ContextStyle, Responsive, Sizing } from '../../types'\nimport {\n flexDirectionClassName,\n FlexDirection,\n responsiveClassNames,\n responsiveProp\n} from '../../utils/breakpoints'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { CardBody } from './CardBody'\nimport { CardFooter } from './CardFooter'\nimport { CardImage } from './CardImage'\nimport { CardSubtitle } from './CardSubtitle'\nimport { CardText } from './CardText'\nimport { CardTitle } from './CardTitle'\n\ntype CardOwnProps<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 * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Switches the card from its default stacked (column) layout to a side-by-side (row) layout.\n * Give the image and the body a width utility (`w-4/12`, `w-8/12`) to control each side's\n * width. An object sets the direction from a breakpoint up — e.g. `{ lg: 'row' }` to lay the\n * card out horizontally from `lg` up while stacking below it.\n */\n direction?: Responsive<FlexDirection>\n /**\n * Shorthand for a `CardFooter`, rendered after the image/title/subtitle/text/`children` block.\n */\n footer?: ReactNode\n /**\n * Shorthand for a `CardImage` — pass either a `src` URL (combine with `imageAlt`/\n * `imageOrientation`) or a fully-formed element — a `<CardImage>`, `<Skeleton>`,\n * `<Placeholder>`, or anything else — rendered as-is in its place. `imageAlt`/`imageOrientation`\n * only apply to the `src` form; set them directly on your own element otherwise. For a\n * horizontal layout or an overlay, omit this and compose `CardImage` directly as a child\n * instead.\n */\n image?: ReactNode\n /**\n * Accessible alt text for `image`. Ignored unless `image` is set.\n */\n imageAlt?: string\n /**\n * Orientates `image` to the top (default) or bottom of the card.\n */\n imageOrientation?: 'top' | 'bottom'\n /**\n * Sets the size of the component to one of Chassis component sizes.\n */\n size?: Sizing\n /**\n * Shorthand for a `CardSubtitle`, rendered directly after `title`.\n */\n subtitle?: ReactNode\n /**\n * Shorthand for a `CardText`, rendered after `title`/`subtitle`.\n */\n text?: ReactNode\n /**\n * Shorthand for a `CardTitle`. Set alongside `subtitle`/`text` (or plain `children`, e.g. a\n * `Button`) to build a standard card without composing `CardBody`/`CardTitle` yourself — all\n * render together inside a single `CardBody`, in that order. Only takes effect when at least\n * one of `image`/`title`/`subtitle`/`text`/`footer` is set; otherwise `children` render as-is,\n * so full manual composition (`CardHeader`, lists, overlays, nav headers, …) keeps working\n * unchanged. Mixing shorthand props with a manually-composed `children` tree isn't supported —\n * pick one approach per card.\n */\n title?: ReactNode\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 CardProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, CardOwnProps<C>>\n\ntype CardComponent = (<C extends ElementType = 'div'>(\n props: CardProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n color,\n component,\n direction,\n footer,\n image,\n imageAlt,\n imageOrientation = 'top',\n size,\n subtitle,\n text,\n title,\n variant,\n ...rest\n }: CardProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n 'card',\n color,\n {\n context: !!color,\n solid: variant === 'solid',\n smooth: variant === 'smooth',\n outline: variant === 'outline',\n sm: size === 'sm',\n lg: size === 'lg'\n },\n responsiveClassNames([responsiveProp(direction, flexDirectionClassName)]),\n className\n )\n\n const hasShorthand =\n image != null || title != null || subtitle != null || footer != null || text != null\n const hasBodyContent = title != null || subtitle != null || text != null || children != null\n const renderedImage =\n typeof image === 'string' ? (\n <CardImage orientation={imageOrientation} src={image} alt={imageAlt ?? ''} />\n ) : (\n image\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {hasShorthand ? (\n <>\n {image != null && imageOrientation === 'top' && renderedImage}\n {hasBodyContent && (\n <CardBody>\n {title != null && <CardTitle>{title}</CardTitle>}\n {subtitle != null && <CardSubtitle>{subtitle}</CardSubtitle>}\n {text != null && <CardText>{text}</CardText>}\n {children}\n </CardBody>\n )}\n {image != null && imageOrientation === 'bottom' && renderedImage}\n {footer != null && <CardFooter>{footer}</CardFooter>}\n </>\n ) : (\n children\n )}\n </Component>\n )\n}\n\nexport const Card = createPolymorphicComponent<CardComponent>(\n CardRender as ForwardRefRenderFunction<Element, CardProps<ElementType>>,\n 'Card'\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 CardGroupOwnProps<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 CardGroupProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardGroupOwnProps<C>\n>\n\ntype CardGroupComponent = (<C extends ElementType = 'div'>(\n props: CardGroupProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// Arranges direct-child Cards as an equal-width row, joined edge-to-edge, once its container\n// reaches the sm container breakpoint — below that, cards stack vertically. Requires a\n// `.contains-inline` ancestor (not applied by CardGroup itself, e.g. a wrapping\n// `<div className=\"contains-inline\">`) to establish the container query context.\nfunction CardGroupRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CardGroupProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('card-group', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardGroup = createPolymorphicComponent<CardGroupComponent>(\n CardGroupRender as ForwardRefRenderFunction<Element, CardGroupProps<ElementType>>,\n 'CardGroup'\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 CardHeaderOwnProps<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 CardHeaderProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardHeaderOwnProps<C>\n>\n\ntype CardHeaderComponent = (<C extends ElementType = 'div'>(\n props: CardHeaderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardHeaderRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CardHeaderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('card-header', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardHeader = createPolymorphicComponent<CardHeaderComponent>(\n CardHeaderRender as ForwardRefRenderFunction<Element, CardHeaderProps<ElementType>>,\n 'CardHeader'\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 CardImageOverlayOwnProps<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 CardImageOverlayProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardImageOverlayOwnProps<C>\n>\n\ntype CardImageOverlayComponent = (<C extends ElementType = 'div'>(\n props: CardImageOverlayProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardImageOverlayRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CardImageOverlayProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('card-overlay', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardImageOverlay = createPolymorphicComponent<CardImageOverlayComponent>(\n CardImageOverlayRender as ForwardRefRenderFunction<Element, CardImageOverlayProps<ElementType>>,\n 'CardImageOverlay'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { createPolymorphicComponent, PolymorphicRef } from '../../utils/polymorphic'\nimport { Link, LinkProps } from '../link/Link'\n\ntype CardLinkOwnProps = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n}\n\nexport type CardLinkProps<C extends ElementType = 'a'> = LinkProps<C> & CardLinkOwnProps\n\ntype CardLinkComponent = (<C extends ElementType = 'a'>(\n props: CardLinkProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardLinkRender<C extends ElementType = 'a'>(\n { children, className, ...rest }: CardLinkProps<C>,\n ref: PolymorphicRef<C>\n) {\n const _className = classNames('card-link', className)\n\n return (\n <Link\n className={_className}\n {...(rest as Record<string, unknown>)}\n ref={ref as PolymorphicRef<ElementType>}\n >\n {children}\n </Link>\n )\n}\n\nexport const CardLink = createPolymorphicComponent<CardLinkComponent>(\n CardLinkRender as ForwardRefRenderFunction<Element, CardLinkProps<ElementType>>,\n 'CardLink'\n)\n"],"mappings":"A,wTAoDA,SAASQ,EACP,CAAE,WAAU,YAAW,YAAW,YAAW,MAAK,GAAGC,GACrD,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EAAaL,EACjB,YACAM,EAAqB,CAACX,EAAeY,EAAWV,CAAsB,CAAC,CAAC,EACxEC,EAAiB,MAAOU,CAAG,EAC3BC,CACF,EAEA,MACE,kBAAA,cAACN,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRQ,CACQ,CAEf,CAEA,MAAaC,EAAWC,EACtBX,EACA,UACF,EC7CA,SAASY,EACP,CAAE,WAAU,YAAW,YAAW,GAAGX,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EAAaL,EAAW,cAAeS,CAAS,EAEtD,MACE,kBAAA,cAACN,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRQ,CACQ,CAEf,CAEA,MAAaI,EAAaF,EACxBC,EACA,YACF,ECMME,EAA2D,CAAC,QAAS,KAAK,EAC1EC,EAA0C,CAAC,MAAO,MAAO,MAAO,KAAK,EAErEC,GAAwB,EAAmC,IAAmB,CAClF,IAAMR,EAAY,GAAGS,EAAO,aAAaC,IACnCC,EACJF,IAAW,IACVH,EAAwB,SAASI,CAAW,GAAKH,EAAqB,SAASE,CAAM,EAOxF,OANAzB,EACE,CAAC2B,EACD,0DAA0DX,EAAU,6LAGtE,EACOW,EAAUX,EAAY,IAC/B,EAEA,SAASY,EACP,CAAE,WAAU,YAAW,YAAW,cAAa,GAAGnB,GAClD,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EAAaL,EAEjBJ,EAAUuB,CAAW,IAAM,IAAA,IAAa,aACxCb,EAAqB,CAACX,EAAewB,EAAaF,CAAoB,CAAC,CAAC,EACxER,CACF,EAEA,MACE,kBAAA,cAACN,EAAD,CAAW,UAAWE,EAAY,GAA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A,YACF,ECjBA,SAASE,EACP,CAAE,WAAU,YAAW,YAAW,GAAG9C,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EAAaL,EAAW,eAAgBS,CAAS,EAEvD,MACE,kBAAA,cAACN,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRQ,CACQ,CAEf,CAEA,MAAauC,EAAmBrC,EAC9BoC,EACA,kBACF,EC3BA,SAASE,EACP,CAAE,WAAU,YAAW,GAAGhD,GAC1B,EACA,CACA,IAAMG,EAAaL,EAAW,YAAaS,CAAS,EAEpD,MACE,kBAAA,cAACf,EAAD,CACE,UAAWW,EACX,GAAKH,EACA,KAGD,EADHQ,CACG,CAEV,CAEA,MAAayC,EAAWvC,EACtBsC,EACA,UACF,E"}
|
|
1
|
+
{"version":3,"file":"card-C6lPZs5J.js","names":["devWarning","Link","responsiveProp","baseValue","flexDirectionClassName","spacingClassName","React","classNames","CardBodyRender","rest","Component","component","_className","responsiveClassNames","direction","gap","className","children","CardBody","createPolymorphicComponent","CardFooterRender","CardFooter","BREAKPOINT_ORIENTATIONS","ORIENTATION_PREFIXES","orientationClassName","prefix","orientation","hasRule","CardImageRender","CardImage","CardSubtitleRender","CardSubtitle","CardTextRender","CardText","CardTitleRender","CardTitle","CardRender","color","variant","size","hasShorthand","image","title","subtitle","footer","text","hasBodyContent","renderedImage","imageOrientation","imageAlt","Card","CardGroupRender","CardGroup","CardHeaderRender","CardHeader","CardImageOverlayRender","CardImageOverlay","CardLinkRender","CardLink"],"sources":["../../src/components/card/CardBody.tsx","../../src/components/card/CardFooter.tsx","../../src/components/card/CardImage.tsx","../../src/components/card/CardSubtitle.tsx","../../src/components/card/CardText.tsx","../../src/components/card/CardTitle.tsx","../../src/components/card/Card.tsx","../../src/components/card/CardGroup.tsx","../../src/components/card/CardHeader.tsx","../../src/components/card/CardImageOverlay.tsx","../../src/components/card/CardLink.tsx"],"sourcesContent":["import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { Responsive, Spacing } from '../../types'\nimport {\n flexDirectionClassName,\n FlexDirection,\n responsiveClassNames,\n responsiveProp\n} from '../../utils/breakpoints'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { spacingClassName } from '../../utils/spacingClassName'\n\ntype CardBodyOwnProps<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 * Switches the body from its default stacked (column) layout to a side-by-side (row) layout —\n * for placing an image beside text within a single padded region. Give the image and the text\n * a width utility (`w-4/12`, `w-8/12`) to control each side's width, and nest another\n * `CardBody` (with `.p-0`) for the text side so it doesn't receive double padding. An object\n * sets the direction from a breakpoint up: `{ md: 'row' }`.\n */\n direction?: Responsive<FlexDirection>\n /**\n * Spacing between children, mapped to the `gap-*` utility classes. Overrides the card's default\n * gap between body children.\n *\n * @type { Spacing | 0 }\n */\n gap?: Spacing | 0\n}\n\nexport type CardBodyProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardBodyOwnProps<C>\n>\n\ntype CardBodyComponent = (<C extends ElementType = 'div'>(\n props: CardBodyProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardBodyRender<C extends ElementType = 'div'>(\n { children, className, component, direction, gap, ...rest }: CardBodyProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n 'card-body',\n responsiveClassNames([responsiveProp(direction, flexDirectionClassName)]),\n spacingClassName('gap', gap),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardBody = createPolymorphicComponent<CardBodyComponent>(\n CardBodyRender as ForwardRefRenderFunction<Element, CardBodyProps<ElementType>>,\n 'CardBody'\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 CardFooterOwnProps<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 CardFooterProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardFooterOwnProps<C>\n>\n\ntype CardFooterComponent = (<C extends ElementType = 'div'>(\n props: CardFooterProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardFooterRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CardFooterProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('card-footer', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardFooter = createPolymorphicComponent<CardFooterComponent>(\n CardFooterRender as ForwardRefRenderFunction<Element, CardFooterProps<ElementType>>,\n 'CardFooter'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { Responsive } from '../../types'\nimport { baseValue, responsiveClassNames, responsiveProp } from '../../utils/breakpoints'\nimport { devWarning } from '../../utils/devWarning'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\n\ntype CardImageOrientation = 'top' | 'bottom' | 'start' | 'end'\n\ntype CardImageOwnProps<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 * e.g. a framework's own `Image` component. Its own props (`src`, `fill`, `priority`, etc.)\n * are type-checked at the call site once passed here.\n */\n component?: C\n /**\n * Orientates the image to the top or bottom of the card as an \"image cap\", or to the start/end\n * for a horizontal layout. Omit to round all four corners for use inside `CardBody`. An object\n * sets the orientation from a breakpoint up — e.g. `{ base: 'top', lg: 'start' }` to switch an\n * image cap from `top` to `start` once the card lays out horizontally. Only `start` and `end`\n * can be set at a breakpoint, from `sm` to `xl`: `@chassis-ui/css` has no class for `top` or\n * `bottom` there, nor for any value at `2xl`: such a value renders no class and warns in\n * development.\n */\n orientation?: Responsive<CardImageOrientation>\n}\n\nexport type CardImageProps<C extends ElementType = 'img'> = PolymorphicComponentProps<\n C,\n CardImageOwnProps<C>\n>\n\ntype CardImageComponent = (<C extends ElementType = 'img'>(\n props: CardImageProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// chassis-css has the four orientation classes at the base, and of the breakpoint ones only what\n// a card needs once it lays out in a row from some width up: `start` and `end`, from `sm` to\n// `xl`. The type takes every value at every breakpoint, and narrowing it would break the callers\n// it compiles for today (`VERSIONING.md`), so the rest is accepted, renders no class (the one it\n// rendered had no rule) and says so in development. `test/components/card/CardImage.spec.tsx`\n// holds this list to the installed stylesheet.\nconst BREAKPOINT_ORIENTATIONS: readonly CardImageOrientation[] = ['start', 'end']\nconst ORIENTATION_PREFIXES: readonly string[] = ['sm:', 'md:', 'lg:', 'xl:']\n\nconst orientationClassName = (orientation: CardImageOrientation, prefix: string) => {\n const className = `${prefix}card-image-${orientation}`\n const hasRule =\n prefix === '' ||\n (BREAKPOINT_ORIENTATIONS.includes(orientation) && ORIENTATION_PREFIXES.includes(prefix))\n devWarning(\n !hasRule,\n `CardImage: \\`orientation\\` has no class to render for \"${className}\", which ` +\n \"@chassis-ui/css doesn't have, so the value does nothing. Only `start` and `end` have \" +\n 'breakpoint classes, from `sm` to `xl`; `top` and `bottom` apply at `base` alone.'\n )\n return hasRule ? className : null\n}\n\nfunction CardImageRender<C extends ElementType = 'img'>(\n { children, className, component, orientation, ...rest }: CardImageProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'img'\n const _className = classNames(\n // With no orientation at the base, the image is the plain one of `CardBody`.\n baseValue(orientation) === undefined && 'card-image',\n responsiveClassNames([responsiveProp(orientation, orientationClassName)]),\n className\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardImage = createPolymorphicComponent<CardImageComponent>(\n CardImageRender as ForwardRefRenderFunction<Element, CardImageProps<ElementType>>,\n 'CardImage'\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 CardSubtitleOwnProps<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 CardSubtitleProps<C extends ElementType = 'h6'> = PolymorphicComponentProps<\n C,\n CardSubtitleOwnProps<C>\n>\n\ntype CardSubtitleComponent = (<C extends ElementType = 'h6'>(\n props: CardSubtitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardSubtitleRender<C extends ElementType = 'h6'>(\n { children, component, className, ...rest }: CardSubtitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h6'\n const _className = classNames('card-subtitle', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardSubtitle = createPolymorphicComponent<CardSubtitleComponent>(\n CardSubtitleRender as ForwardRefRenderFunction<Element, CardSubtitleProps<ElementType>>,\n 'CardSubtitle'\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 CardTextOwnProps<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 CardTextProps<C extends ElementType = 'p'> = PolymorphicComponentProps<\n C,\n CardTextOwnProps<C>\n>\n\ntype CardTextComponent = (<C extends ElementType = 'p'>(\n props: CardTextProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardTextRender<C extends ElementType = 'p'>(\n { children, component, className, ...rest }: CardTextProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'p'\n const _className = classNames('card-text', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardText = createPolymorphicComponent<CardTextComponent>(\n CardTextRender as ForwardRefRenderFunction<Element, CardTextProps<ElementType>>,\n 'CardText'\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 CardTitleOwnProps<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 CardTitleProps<C extends ElementType = 'h5'> = PolymorphicComponentProps<\n C,\n CardTitleOwnProps<C>\n>\n\ntype CardTitleComponent = (<C extends ElementType = 'h5'>(\n props: CardTitleProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardTitleRender<C extends ElementType = 'h5'>(\n { children, component, className, ...rest }: CardTitleProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'h5'\n const _className = classNames('card-title', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardTitle = createPolymorphicComponent<CardTitleComponent>(\n CardTitleRender as ForwardRefRenderFunction<Element, CardTitleProps<ElementType>>,\n 'CardTitle'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement, ReactNode } from 'react'\nimport classNames from 'classnames'\n\nimport { ContextColor, ContextStyle, Responsive, Sizing } from '../../types'\nimport {\n flexDirectionClassName,\n FlexDirection,\n responsiveClassNames,\n responsiveProp\n} from '../../utils/breakpoints'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { CardBody } from './CardBody'\nimport { CardFooter } from './CardFooter'\nimport { CardImage } from './CardImage'\nimport { CardSubtitle } from './CardSubtitle'\nimport { CardText } from './CardText'\nimport { CardTitle } from './CardTitle'\n\ntype CardOwnProps<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 * Sets the color of the component to one of Chassis context colors.\n */\n color?: ContextColor\n /**\n * Switches the card from its default stacked (column) layout to a side-by-side (row) layout.\n * Give the image and the body a width utility (`w-4/12`, `w-8/12`) to control each side's\n * width. An object sets the direction from a breakpoint up — e.g. `{ lg: 'row' }` to lay the\n * card out horizontally from `lg` up while stacking below it.\n */\n direction?: Responsive<FlexDirection>\n /**\n * Shorthand for a `CardFooter`, rendered after the image/title/subtitle/text/`children` block.\n */\n footer?: ReactNode\n /**\n * Shorthand for a `CardImage` — pass either a `src` URL (combine with `imageAlt`/\n * `imageOrientation`) or a fully-formed element — a `<CardImage>`, `<Skeleton>`,\n * `<Placeholder>`, or anything else — rendered as-is in its place. `imageAlt`/`imageOrientation`\n * only apply to the `src` form; set them directly on your own element otherwise. For a\n * horizontal layout or an overlay, omit this and compose `CardImage` directly as a child\n * instead.\n */\n image?: ReactNode\n /**\n * Accessible alt text for `image`. Ignored unless `image` is set.\n */\n imageAlt?: string\n /**\n * Orientates `image` to the top (default) or bottom of the card.\n */\n imageOrientation?: 'top' | 'bottom'\n /**\n * Sets the size of the component to one of Chassis component sizes.\n */\n size?: Sizing\n /**\n * Shorthand for a `CardSubtitle`, rendered directly after `title`.\n */\n subtitle?: ReactNode\n /**\n * Shorthand for a `CardText`, rendered after `title`/`subtitle`.\n */\n text?: ReactNode\n /**\n * Shorthand for a `CardTitle`. Set alongside `subtitle`/`text` (or plain `children`, e.g. a\n * `Button`) to build a standard card without composing `CardBody`/`CardTitle` yourself — all\n * render together inside a single `CardBody`, in that order. Only takes effect when at least\n * one of `image`/`title`/`subtitle`/`text`/`footer` is set; otherwise `children` render as-is,\n * so full manual composition (`CardHeader`, lists, overlays, nav headers, …) keeps working\n * unchanged. Mixing shorthand props with a manually-composed `children` tree isn't supported —\n * pick one approach per card.\n */\n title?: ReactNode\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 CardProps<C extends ElementType = 'div'> = PolymorphicComponentProps<C, CardOwnProps<C>>\n\ntype CardComponent = (<C extends ElementType = 'div'>(\n props: CardProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardRender<C extends ElementType = 'div'>(\n {\n children,\n className,\n color,\n component,\n direction,\n footer,\n image,\n imageAlt,\n imageOrientation = 'top',\n size,\n subtitle,\n text,\n title,\n variant,\n ...rest\n }: CardProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames(\n 'card',\n color,\n {\n context: !!color,\n solid: variant === 'solid',\n smooth: variant === 'smooth',\n outline: variant === 'outline',\n sm: size === 'sm',\n lg: size === 'lg'\n },\n responsiveClassNames([responsiveProp(direction, flexDirectionClassName)]),\n className\n )\n\n const hasShorthand =\n image != null || title != null || subtitle != null || footer != null || text != null\n const hasBodyContent = title != null || subtitle != null || text != null || children != null\n const renderedImage =\n typeof image === 'string' ? (\n <CardImage orientation={imageOrientation} src={image} alt={imageAlt ?? ''} />\n ) : (\n image\n )\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {hasShorthand ? (\n <>\n {image != null && imageOrientation === 'top' && renderedImage}\n {hasBodyContent && (\n <CardBody>\n {title != null && <CardTitle>{title}</CardTitle>}\n {subtitle != null && <CardSubtitle>{subtitle}</CardSubtitle>}\n {text != null && <CardText>{text}</CardText>}\n {children}\n </CardBody>\n )}\n {image != null && imageOrientation === 'bottom' && renderedImage}\n {footer != null && <CardFooter>{footer}</CardFooter>}\n </>\n ) : (\n children\n )}\n </Component>\n )\n}\n\nexport const Card = createPolymorphicComponent<CardComponent>(\n CardRender as ForwardRefRenderFunction<Element, CardProps<ElementType>>,\n 'Card'\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 CardGroupOwnProps<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 CardGroupProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardGroupOwnProps<C>\n>\n\ntype CardGroupComponent = (<C extends ElementType = 'div'>(\n props: CardGroupProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n// Arranges direct-child Cards as an equal-width row, joined edge-to-edge, once its container\n// reaches the sm container breakpoint — below that, cards stack vertically. Requires a\n// `.contains-inline` ancestor (not applied by CardGroup itself, e.g. a wrapping\n// `<div className=\"contains-inline\">`) to establish the container query context.\nfunction CardGroupRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CardGroupProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('card-group', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardGroup = createPolymorphicComponent<CardGroupComponent>(\n CardGroupRender as ForwardRefRenderFunction<Element, CardGroupProps<ElementType>>,\n 'CardGroup'\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 CardHeaderOwnProps<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 CardHeaderProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardHeaderOwnProps<C>\n>\n\ntype CardHeaderComponent = (<C extends ElementType = 'div'>(\n props: CardHeaderProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardHeaderRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CardHeaderProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('card-header', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardHeader = createPolymorphicComponent<CardHeaderComponent>(\n CardHeaderRender as ForwardRefRenderFunction<Element, CardHeaderProps<ElementType>>,\n 'CardHeader'\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 CardImageOverlayOwnProps<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 CardImageOverlayProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CardImageOverlayOwnProps<C>\n>\n\ntype CardImageOverlayComponent = (<C extends ElementType = 'div'>(\n props: CardImageOverlayProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardImageOverlayRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CardImageOverlayProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('card-overlay', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CardImageOverlay = createPolymorphicComponent<CardImageOverlayComponent>(\n CardImageOverlayRender as ForwardRefRenderFunction<Element, CardImageOverlayProps<ElementType>>,\n 'CardImageOverlay'\n)\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { createPolymorphicComponent, PolymorphicRef } from '../../utils/polymorphic'\nimport { Link, LinkProps } from '../link/Link'\n\ntype CardLinkOwnProps = {\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n}\n\nexport type CardLinkProps<C extends ElementType = 'a'> = LinkProps<C> & CardLinkOwnProps\n\ntype CardLinkComponent = (<C extends ElementType = 'a'>(\n props: CardLinkProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CardLinkRender<C extends ElementType = 'a'>(\n { children, className, ...rest }: CardLinkProps<C>,\n ref: PolymorphicRef<C>\n) {\n const _className = classNames('card-link', className)\n\n return (\n <Link\n className={_className}\n {...(rest as Record<string, unknown>)}\n ref={ref as PolymorphicRef<ElementType>}\n >\n {children}\n </Link>\n )\n}\n\nexport const CardLink = createPolymorphicComponent<CardLinkComponent>(\n CardLinkRender as ForwardRefRenderFunction<Element, CardLinkProps<ElementType>>,\n 'CardLink'\n)\n"],"mappings":"A,wTAoDA,SAASQ,EACP,CAAE,WAAU,YAAW,YAAW,YAAW,MAAK,GAAGC,GACrD,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EAAaL,EACjB,YACAM,EAAqB,CAACX,EAAeY,EAAWV,CAAsB,CAAC,CAAC,EACxEC,EAAiB,MAAOU,CAAG,EAC3BC,CACF,EAEA,MACE,kBAAA,cAACN,EAAD,CAAW,UAAWE,EAAY,GAAIH,EAAW,KAEtC,EADRQ,CACQ,CAEf,CAEA,MAAaC,EAAWC,EACtBX,EACA,UACF,EC7CA,SAASY,EACP,CAAE,WAAU,YAAW,YAAW,GAAGX,GACrC,EACA,CACA,IAAMC,EAAYC,GAAa,MACzBC,EA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|
1
|
+
import"./focus-ring-Bs80iIBN.js";import{C as e}from"./slot-DagH0Gxq.js";import{t}from"./lazyElement-tfMG21pZ.js";import{t as n}from"./useForkedRef-WoqMqsWE.js";import{t as r}from"./polymorphic-mAKwlLiW.js";import{t as i}from"./useControllableState-CPUJxfKW.js";import{t as a}from"./useIsomorphicLayoutEffect-BbqRwuqn.js";import{n as o,t as s}from"./dialogTransition-C8fYTsSa.js";import{t as c}from"./focusRedirect-CrBl4p_n.js";import{t as l}from"./iconSlot-DU_WcSL_.js";import{t as u}from"./VisuallyHidden-24WfUCsJ.js";import{t as d}from"./direction-LN6uwsK5.js";import f,{Children as p,Fragment as m,createContext as h,forwardRef as g,isValidElement as _,useCallback as v,useContext as y,useEffect as b,useRef as x,useState as S}from"react";import C from"classnames";const w=/* @__PURE__ */ new WeakSet;function ee(e){w.add(e)}function te(e){if(!e)return!1;let t=w.has(e);return w.delete(e),t}const T=h(null),E=()=>{let e=y(T);if(!e)throw Error(`Carousel sub-components must be rendered inside a Carousel`);return e};function D(e){return Array.from(e.querySelectorAll(`:scope > .carousel-item:not(.carousel-item-clone)`))}function ne(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function re(e){if(!e)return!1;let t=e.getBoundingClientRect();return t.top<(window.innerHeight||document.documentElement.clientHeight)&&t.bottom>0&&t.left<(window.innerWidth||document.documentElement.clientWidth)&&t.right>0}function O(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(n)return i.left+i.width/2-(r.left+r.width/2);let a=Number.parseFloat(getComputedStyle(e).scrollPaddingInlineStart)||0;return d(e)?i.right-(r.right-a):i.left-(r.left+a)}function ie(e){return e.scrollWidth-e.clientWidth>0}const ae=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2;function oe(e,t,n){if(ne()||typeof requestAnimationFrame>`u`)return e.scrollTo({left:t,behavior:`instant`}),n(),()=>{};let r=e.scrollLeft,i=t-r,a=null,o=null,s=!1,c=()=>{s||(s=!0,o!==null&&cancelAnimationFrame(o),clearTimeout(u),e.scrollTo({left:t,behavior:`instant`}),n())},l=t=>{if(s)return;a===null&&(a=t);let n=Math.min((t-a)/300,1);e.scrollTo({left:r+i*ae(n),behavior:`instant`}),n<1?o=requestAnimationFrame(l):c()},u=setTimeout(c,500);return o=requestAnimationFrame(l),()=>{s||(s=!0,o!==null&&cancelAnimationFrame(o),clearTimeout(u))}}function se(e,t,n){return Number.isNaN(e)||t===0?null:e<0?n?t-1:null:e>t-1?n?0:null:e}function ce(e,t,n){let r=t>e;return n?r?`right`:`left`:r?`left`:`right`}function le(e,t){return t?e?`right`:`left`:e?`left`:`right`}function ue(e,t,n,r,i){if(n||t<2||r||i)return!1;let a=getComputedStyle(e),o=e=>Number.parseFloat(a.getPropertyValue(e))||0;return(o(`--cx-carousel-items`)||1)===1&&o(`--cx-carousel-items-peek`)===0}function de({children:e,className:t,component:n,interval:r,...i},a){let o=n??`div`,s=y(T),c=y(pe),l=s&&c?{"aria-label":`${c.index+1} of ${c.count}`,"aria-roledescription":`slide`,role:`group`}:{},u=C(`carousel-item`,{active:!!s&&!!c&&c.index===s.activeIndex},t);return/* @__PURE__ */ f.createElement(o,{className:u,"data-interval":r,...l,...i,ref:a},e)}const fe=r(de,`CarouselItem`),pe=h(void 0);function k(e){let n=A(e);return{nodes:n,positioned:n.every(e=>t(e,fe))}}function A(e){return p.toArray(e).flatMap(e=>t(e,m)?A(e.props.children).map(t=>_(t)?f.cloneElement(t,{key:`${e.key}/${t.key}`}):t):[e])}function me({children:e,className:t,component:r,...i},a){let{registerViewport:o}=E(),s=r??`div`,c=n(a,o),l=C(`carousel-inner`,t),{nodes:u,positioned:d}=k(e);return/* @__PURE__ */ f.createElement(s,{className:l,...i,ref:c},u.map((e,t)=>/* @__PURE__ */ f.createElement(pe.Provider,{key:_(e)?e.key:t,value:d?{count:u.length,index:t}:void 0},e)))}const he=r(me,`CarouselInner`),ge=g(({children:t,activeIndex:r,auto:l,autoplay:p=!1,center:m,className:h,defaultActiveIndex:g=0,ends:_=`loop`,interval:y=5e3,items:w,itemsGap:ee,itemsPeek:E,keyboard:ae=!0,onKeyDown:de,onMouseEnter:fe,onMouseLeave:pe,onSlid:k,onSlide:A,pause:me=`hover`,style:he,transition:ge=`scroll`,...j},ve)=>{e(r!==void 0&&!A,"Carousel: `activeIndex` is set (controlled) without `onSlide`: nothing feeds the new index back to your state, so the carousel will visually freeze on click/swipe/autoplay. Pass `onSlide` and update `activeIndex` from it. `onSlid` cannot do this: it fires once a slide has arrived, which under a controlled `activeIndex` only happens after the prop has changed.");let M=x(null),ye=n(ve,M),[N,be]=S(null),xe=v(e=>be(e),[]),Se=r!==void 0,[P,Ce]=i(r,g),F=x(P),I=x(P),L=x({from:P,to:P,direction:`left`});a(()=>{let e=I.current;if(F.current=P,I.current=P,e===P)return;let t=L.current;(t.from!==e||t.to!==P)&&(L.current={from:e,to:P,direction:ce(e,P,N?d(N):!1)})},[P]);let we=x(A),R=x(k);a(()=>{we.current=A,R.current=k});let[z,Te]=S(()=>_e(t)),B=x(z);a(()=>{B.current=z},[z]);let[V,Ee]=S(p),[De,Oe]=S(!1),[ke,Ae]=S(P<=0),[je,Me]=S(z>0&&P>=z-Math.max(1,w??1)),H=x(!1),U=x(!1),W=x(null),G=x(null),Ne=x(!1),K=x(null),Pe=x(null),q=x(null),Fe=x(/* @__PURE__ */ new Map),J=x(null),Ie=x(!1),Le=x(P),Re=x(P),[ze,Be]=S(``),Ve=x(!1),He=x(/* @__PURE__ */ new Set),Ue=x(/* @__PURE__ */ new Set),We=x(/* @__PURE__ */ new Set),Y=ge===`fade`,X=Math.max(1,w??1),Z=_!==`stop`,Ge=e=>{F.current=e,Ce(e),Se&&queueMicrotask(()=>{F.current=I.current})},Ke=(e,t,n)=>{K.current?.(),U.current=!0,e.style.scrollSnapType=`none`,K.current=oe(e,e.scrollLeft+t,()=>{e.style.scrollSnapType=``,U.current=!1,K.current=null,n?.()})},qe=()=>{G.current&&clearTimeout(G.current),G.current=setTimeout(()=>Xe.current(),500)};a(()=>{let e=Math.max(0,z-X);Ae(P<=0),Me(P>=e)},[P,z,X]),b(()=>{if(!N)return;let e=()=>{if(W.current!==null&&qe(),H.current||!ie(N))return;let e=N.scrollWidth-N.clientWidth,t=N.scrollLeft,n=d(N)?Math.max(-e,Math.min(0,t)):Math.max(0,Math.min(e,t)),r=Math.abs(n);Ae(r<=1),Me(r>=e-1)},t=()=>{Ne.current=!0},n=e=>{Ne.current=e.touches.length>0};return N.addEventListener(`scroll`,e,{passive:!0}),N.addEventListener(`touchstart`,t,{passive:!0}),N.addEventListener(`touchend`,n),N.addEventListener(`touchcancel`,n),()=>{N.removeEventListener(`scroll`,e),N.removeEventListener(`touchstart`,t),N.removeEventListener(`touchend`,n),N.removeEventListener(`touchcancel`,n)}},[N]),a(()=>{if(!N||z===0||D(N).length!==z)return;let e=Math.max(0,z-X);if(P<=e)return;let t={from:P,to:e,direction:ce(P,e,d(N))};L.current=t,we.current?.(t),Ge(e)},[N,P,z,X]),a(()=>{if(!N)return;let e=()=>{let e=D(N);if(Te(e.length),q.current?.disconnect(),q.current=null,Fe.current=/* @__PURE__ */ new Map,!(Y||typeof IntersectionObserver>`u`)){q.current=new IntersectionObserver(e=>{for(let t of e)Fe.current.set(t.target,t.isIntersecting?t.intersectionRatio:0);if(H.current||U.current)return;let t=D(N).map(e=>Fe.current.get(e)??0),n=Math.max(0,...t),r=F.current;if(n>0){let e=t.findIndex(e=>e>=n-.05);e!==-1&&(r=e)}if(r!==F.current){let e=F.current,t={from:e,to:r,direction:ce(e,r,d(N))};L.current=t,we.current?.(t),W.current=r,Ge(r),qe()}},{root:N,threshold:[0,.25,.5,.75,1]});for(let t of e)q.current.observe(t)}};e();let t=new MutationObserver(e);return t.observe(N,{childList:!0}),()=>{t.disconnect(),q.current?.disconnect()}},[N,Y]);let Je=x(/* @__PURE__ */ new WeakMap);a(()=>{if(!N)return;let e=D(N);for(let[t,n]of e.entries()){n.classList.toggle(`active`,t===P),n.hasAttribute(`role`)||n.setAttribute(`role`,`group`),n.setAttribute(`aria-roledescription`,`slide`);let r=n.getAttribute(`aria-label`);if(r===null||r===Je.current.get(n)){let r=`${t+1} of ${e.length}`;n.setAttribute(`aria-label`,r),Je.current.set(n,r)}}},[N,P,z]),a(()=>{if(W.current===P){W.current=null;return}if(!N||H.current||Y)return;let e=D(N)[P];if(!e||!ie(N))return;let t=!Ie.current;Ie.current=!0;let n=O(N,e,!!m);Math.abs(n)<1||(t?(K.current?.(),U.current=!0,N.style.scrollSnapType=`none`,N.scrollTo({left:N.scrollLeft+n,behavior:`instant`}),N.style.scrollSnapType=``,U.current=!1,K.current=null):(Ve.current=!0,Ke(N,n,()=>{Ve.current=!1,R.current?.(L.current)})))},[N,P,z,m,Y]);let Ye=()=>{if(G.current=null,W.current===null)return;if(Ne.current){qe();return}if(W.current=null,!N||H.current||U.current||Y)return;let e=D(N)[I.current];if(!e)return;let t=O(N,e,!!m);Math.abs(t)>=1&&Ke(N,t)},Xe=x(Ye);a(()=>{Xe.current=Ye}),b(()=>{if(Le.current===P||(Le.current=P,Ve.current||H.current))return;let e=L.current,t=Y&&N?D(N)[P]:void 0;if(t)return s(t,()=>R.current?.(e),o(t)>0);k?.(e)},[P]),b(()=>{Re.current!==P&&(Re.current=P,Be(`Slide ${P+1} of ${z}`))},[P]),b(()=>()=>{J.current&&clearTimeout(J.current),G.current&&clearTimeout(G.current),q.current?.disconnect(),K.current?.(),Pe.current?.()},[]);let Ze=e=>{let t=N;if(!t)return;K.current?.(),U.current=!1;let n=D(t),r=n.length-1,i=F.current,a=e?0:r,o=le(e,d(t));A?.({from:i,to:a,direction:o}),L.current={from:i,to:a,direction:o},H.current=!0;let s=()=>{L.current={from:i,to:a,direction:o},H.current=!1,I.current===a?R.current?.(L.current):Ge(a)},c=e?n[0]:n[r],l=n[i],u=n[a];if(!ie(t)||!c||!l||!u){s();return}let f=c.cloneNode(!0);f.classList.add(`carousel-item-clone`),f.classList.remove(`active`),f.removeAttribute(`id`);for(let e of Array.from(f.querySelectorAll(`[id]`)))e.removeAttribute(`id`);f.setAttribute(`aria-hidden`,`true`),f.setAttribute(`inert`,``),t.style.scrollSnapType=`none`,e?t.append(f):(t.prepend(f),t.scrollTo({left:t.scrollLeft+O(t,l,!!m),behavior:`instant`}));let p=O(t,f,!!m);Pe.current=oe(t,t.scrollLeft+p,()=>{Pe.current=null,f.remove();let e=O(t,u,!!m);t.scrollTo({left:t.scrollLeft+e,behavior:`instant`}),t.style.scrollSnapType=``,s()})},Qe=e=>{if(H.current)return;let t=B.current;if(t===0)return;let n=Math.max(0,t-X);if(_===`loop`&&!Y&&!ne()&&M.current&&ue(M.current,t,Y,!!m,!!l)){if(e>n){Ze(!0);return}if(e<0){Ze(!1);return}}let r=se(e,n+1,Z),i=F.current;if(r===null||r===i)return;W.current=null;let a=ce(i,e,N?d(N):!1);A?.({from:i,to:r,direction:a}),L.current={from:i,to:r,direction:a},Ge(r)},$e=()=>Qe(F.current+1),et=()=>Qe(F.current-1),tt=e=>Qe(e),nt=()=>{J.current&&clearTimeout(J.current),J.current=null,Oe(!1)},rt=x(()=>void 0),Q=(e=F.current)=>{J.current&&clearTimeout(J.current);let t=(N?D(N):[])[e]?.dataset.interval,n=t&&!Number.isNaN(Number(t))?Number(t):y;M.current?.style.setProperty(`--cx-carousel-interval`,`${n}ms`),J.current=setTimeout(()=>rt.current(e),n)},$=()=>{Ee(!1),nt()},it=e=>{let t=B.current,n=Math.max(0,t-X),r=se(F.current+1,n+1,Z);typeof document>`u`||document.visibilityState===`visible`&&re(M.current)?($e(),r===null?$():Q(r)):Q(e)};a(()=>{rt.current=it});let at=()=>{let e=B.current;return!Z&&e>0&&F.current>=Math.max(0,e-X)},ot=()=>{at()?$():(Q(),Oe(!0))},st=()=>{V?$():(Ee(!0),ot())};b(()=>{if(N)return V&&ot(),()=>nt()},[N]),b(()=>{J.current&&!Z&&z!==0&&P>=Math.max(0,z-X)&&$()},[P,z,X,Z]),b(()=>{J.current&&Q()},[y]),b(()=>{if(!N)return;let e=()=>$();return N.addEventListener(`pointerdown`,e),()=>N.removeEventListener(`pointerdown`,e)},[N]),b(()=>{if(_!==`stop`)return;let e=document.activeElement,t=ke&&!!e&&He.current.has(e),n=je&&!!e&&(Ue.current.has(e)||!V&&We.current.has(e));if(!t&&!n)return;let r=t?Ue.current:He.current,i=(t?!je:!ke)?Array.from(r)[0]:null,a=te(e);i?c(i,a,{preventScroll:!0}):N&&(N.hasAttribute(`tabindex`)||N.setAttribute(`tabindex`,`-1`),c(N,a,{preventScroll:!0}))},[ke,je,_,V,N]);let ct=v((e,t)=>{let n={next:Ue.current,play:We.current,prev:He.current}[e];return n.add(t),()=>{n.delete(t)}},[]),lt=e=>{if(de?.(e),!ae||e.target.closest(`input, textarea, select, [contenteditable="true"]`)||e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault(),$();let t=d(e.currentTarget)?`ArrowLeft`:`ArrowRight`;e.key===t?$e():et()},ut=e=>{fe?.(e),me===`hover`&&nt()},dt=e=>{pe?.(e),me===`hover`&&V&&ot()},ft={activeIndex:P,atEnd:je,atStart:ke,ends:_,itemCount:z,itemsVisible:X,next:()=>{$(),$e()},playing:V,prev:()=>{$(),et()},registerControl:ct,registerViewport:xe,to:e=>{$(),tt(e)},togglePlayPause:st},pt=C(`carousel`,{"carousel-fade":Y,"carousel-center":m,"carousel-auto":l,"carousel-playing":De},h),mt={...he,...w!=null&&{"--cx-carousel-items":w},...ee!=null&&{"--cx-carousel-items-gap":ee},...E!=null&&{"--cx-carousel-items-peek":E}};return/* @__PURE__ */ f.createElement(`div`,{role:`region`,"aria-roledescription":`carousel`,className:pt,style:mt,onKeyDown:lt,onMouseEnter:ut,onMouseLeave:dt,...j,ref:ye},/* @__PURE__ */ f.createElement(T.Provider,{value:ft},t),/* @__PURE__ */ f.createElement(u,{role:`status`},ze))});ge.displayName=`Carousel`;function _e(e){for(let n of p.toArray(e)){if(t(n,he)){let{nodes:e,positioned:t}=k(n.props.children);return t?e.length:0}if(!_(n))continue;let e=_e(n.props.children);if(e>0)return e}return 0}const j=g(({children:e,className:t,direction:r,disabled:i,icon:a,label:o,onClick:s,...c},d)=>{let{atEnd:p,atStart:m,ends:h,next:g,prev:_,registerControl:v}=E(),y=x(null),S=n(d,y);b(()=>{let e=y.current;if(e)return v(r,e)},[v,r]);let w=r===`next`?p:m,te=r===`next`?g:_,T=i||h===`stop`&&w;return/* @__PURE__ */ f.createElement(`button`,{type:`button`,className:C(`button sm icon-only`,t),disabled:T,onClick:e=>{s?.(e),e.detail!==0&&ee(e.currentTarget),te()},...c,ref:S},e??/* @__PURE__ */ f.createElement(f.Fragment,null,/* @__PURE__ */ f.createElement(l,{icon:r===`next`?`next`:`previous`,override:a,className:`directional-icon`}),/* @__PURE__ */ f.createElement(u,null,o)))});j.displayName=`CarouselControlButton`;const ve=g(({label:e=`Next slide`,...t},n)=>/* @__PURE__ */ f.createElement(j,{...t,direction:`next`,label:e,ref:n}));ve.displayName=`CarouselControlNext`;const M=g(({label:e=`Previous slide`,...t},n)=>/* @__PURE__ */ f.createElement(j,{...t,direction:`prev`,label:e,ref:n}));M.displayName=`CarouselControlPrev`;const ye=g(({className:e,label:t=e=>`Slide ${e}`,...n},r)=>{let{activeIndex:i,itemCount:a,itemsVisible:o,to:s}=E(),c=C(`carousel-indicators`,e),l=a===0?0:Math.max(1,a-o+1);return/* @__PURE__ */ f.createElement(`ol`,{className:c,...n,ref:r},Array.from({length:l},(e,t)=>t).map(e=>/* @__PURE__ */ f.createElement(`li`,{key:e},/* @__PURE__ */ f.createElement(`button`,{type:`button`,className:e===i?`active`:void 0,"aria-current":e===i?`true`:void 0,"aria-label":t(e+1),onClick:()=>s(e)}))))});ye.displayName=`CarouselIndicators`;function N({children:e,className:t,component:n,...r},i){let a=n??`div`,o=C(`carousel-overlay`,t);return/* @__PURE__ */ f.createElement(a,{className:o,...r,ref:i},e)}const be=r(N,`CarouselOverlay`),xe=g(({children:e,className:t,disabled:r,onClick:i,pauseIcon:a,pauseLabel:o=`Pause`,playIcon:s,playLabel:c=`Play`,...u},d)=>{let{atEnd:p,ends:m,playing:h,registerControl:g,togglePlayPause:_}=E(),v=x(null),y=n(d,v);b(()=>{let e=v.current;if(e)return g(`play`,e)},[g]);let S=r||m===`stop`&&p&&!h,w=C(`carousel-control-play-pause button sm icon-only`,{paused:!h},t);return/* @__PURE__ */ f.createElement(`button`,{type:`button`,className:w,"aria-label":h?o:c,disabled:S,onClick:e=>{i?.(e),_()},...u,ref:y},e??/* @__PURE__ */ f.createElement(f.Fragment,null,/* @__PURE__ */ f.createElement(l,{icon:`pause`,override:a,className:`carousel-icon-pause`}),/* @__PURE__ */ f.createElement(l,{icon:`play`,override:s,className:`carousel-icon-play`})))});xe.displayName=`CarouselPlayPause`;export{ve as a,fe as c,M as i,be as n,ge as o,ye as r,he as s,xe as t};
|
|
2
|
+
//# sourceMappingURL=carousel-Ka9OA-HJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-Ka9OA-HJ.js","names":["devWarning","useForkedRef","createPolymorphicComponent","useControllableState","useIsomorphicLayoutEffect","getTransitionDuration","executeAfterTransition","focusRedirect","IconSlot","VisuallyHidden","isRTL","React","classNames","pointerClicks","markPointerClick","el","consumePointerClick","wasPointer","CarouselContext","createContext","useCarouselContext","context","useContext","getCarouselItems","viewport","prefersReducedMotion","isElementVisible","element","rect","scrollDeltaFor","viewportRect","target","center","padStart","isViewportScrollable","easeInOutCubic","progress","animateScrollTo","targetLeft","onSettled","startLeft","distance","startTime","frame","done","finish","safetyTimer","step","now","normalizeIndex","index","length","wraps","directionBetween","isNext","to","from","rtl","loopDirection","canLoop","isFade","itemCount","auto","styles","carouselElement","num","name","CarouselItemRender","rest","Component","component","carousel","slide","SlidePositionContext","position","_className","className","interval","children","CarouselItem","readSlides","nodes","flatten","isElementOfType","node","Children","child","Fragment","isValidElement","CarouselInnerRender","forkedRef","ref","registerViewport","positioned","CarouselInner","Carousel","forwardRef","activeIndexProp","onSlide","carouselRef","useRef","viewportEl","setViewportEl","useState","useCallback","isControlled","activeIndex","setActiveIndex","defaultActiveIndex","activeIndexRef","committedIndexRef","lastTransitionRef","asked","onSlideRef","onSlidRef","onSlid","setItemCount","countSlides","itemCountRef","playing","setPlaying","autoplay","cycling","setCycling","atStart","setAtStart","atEnd","setAtEnd","items","loopingRef","syncingScrollRef","swipedToRef","swipeSettleTimerRef","touchingRef","cancelScrollSyncRef","cancelLoopRef","observerRef","visibilityRef","timeoutRef","scrollSyncedRef","slidIndexRef","announcedIndexRef","liveMessage","setLiveMessage","deferOnSlidRef","prevControlsRef","nextControlsRef","playControlsRef","transition","itemsVisible","ends","setActiveIndexInternal","next","animateTrackBy","delta","onArrived","awaitSwipeSettle","settleSwipeRef","maxIndex","useEffect","handleScroll","maxScroll","rawScrollLeft","clampedScrollLeft","scrollLeft","handleTouchStart","handleTouchEnd","event","last","detail","syncItems","entry","entries","ratios","maxRatio","bestIndex","found","ratio","mutationObserver","positionLabelsRef","label","instant","settleSwipe","incoming","performLoopTransition","direction","source","fromItem","toItem","clone","targetDelta","finalDelta","navigate","effectiveLast","rawTarget","goNext","goPrev","goTo","pauseCycle","autoplayTickRef","scheduleAutoplay","attr","fromIndex","ms","stopPlayingForGood","autoplayTick","upcoming","hasNothingToPlay","startCycle","togglePlayPause","handlePointerDown","focused","focusedIsPrev","focusedIsNext","oppositeSet","fallback","viaPointer","registerControl","set","kind","handleKeyDown","onKeyDown","keyboard","nextKey","handleMouseEnter","onMouseEnter","pause","handleMouseLeave","onMouseLeave","contextValue","_style","style","itemsGap","itemsPeek","count","CarouselControlButton","buttonRef","atBoundary","prev","isDisabled","disabled","onClick","icon","CarouselControlNext","CarouselControlPrev","CarouselIndicators","indicatorCount","CarouselOverlayRender","CarouselOverlay","CarouselPlayPause","pauseLabel","playLabel","pauseIcon","playIcon"],"sources":["../../src/utils/pointerInteraction.ts","../../src/components/carousel/context.ts","../../src/components/carousel/carouselEngine.ts","../../src/components/carousel/CarouselItem.tsx","../../src/components/carousel/slides.tsx","../../src/components/carousel/CarouselInner.tsx","../../src/components/carousel/Carousel.tsx","../../src/components/carousel/CarouselControlButton.tsx","../../src/components/carousel/CarouselControlNext.tsx","../../src/components/carousel/CarouselControlPrev.tsx","../../src/components/carousel/CarouselIndicators.tsx","../../src/components/carousel/CarouselOverlay.tsx","../../src/components/carousel/CarouselPlayPause.tsx"],"sourcesContent":["// Tracks, per-element, whether its most recent activation came from a real pointer click rather\n// than a keyboard one (a `click` fired by pointer activation has `detail >= 1`; one fired by\n// keyboard activation, e.g. Enter/Space on a focused button, has `detail === 0`) — for callers\n// that need that information later, asynchronously, once React has committed the state update the\n// click triggered (see `Carousel.tsx`'s disabled-end focus redirect, which needs it to decide\n// whether `focusRedirect` should suppress Safari's script-focus-after-pointer-click ring). A\n// `WeakSet` rather than a DOM attribute so it doesn't leak into markup/snapshots, and consuming it\n// clears the entry so a later, unrelated keyboard activation on the same element isn't\n// misattributed as pointer-triggered.\nconst pointerClicks = new WeakSet<HTMLElement>()\n\nexport function markPointerClick(el: HTMLElement): void {\n pointerClicks.add(el)\n}\n\nexport function consumePointerClick(el: HTMLElement | null): boolean {\n if (!el) return false\n const wasPointer = pointerClicks.has(el)\n pointerClicks.delete(el)\n return wasPointer\n}\n","import { createContext, useContext } from 'react'\n\nexport type CarouselEnds = 'loop' | 'wrap' | 'stop'\n\n// The buttons the carousel moves focus away from when the end of an `ends=\"stop\"` track\n// disables the focused one.\nexport type CarouselControlKind = 'prev' | 'next' | 'play'\n\nexport interface CarouselContextProps {\n activeIndex: number\n atEnd: boolean\n atStart: boolean\n ends: CarouselEnds\n itemCount: number\n itemsVisible: number\n next: () => void\n playing: boolean\n prev: () => void\n registerControl: (kind: CarouselControlKind, element: HTMLButtonElement) => () => void\n registerViewport: (node: HTMLDivElement | null) => void\n to: (index: number) => void\n togglePlayPause: () => void\n}\n\nexport const CarouselContext = createContext<CarouselContextProps | null>(null)\n\nexport const useCarouselContext = (): CarouselContextProps => {\n const context = useContext(CarouselContext)\n if (!context) {\n throw new Error('Carousel sub-components must be rendered inside a Carousel')\n }\n return context\n}\n","// Internal helpers shared by the carousel family. Not exported from the component's public\n// barrel (see CONVENTIONS.md's helper-module carve-out).\n\nimport { isRTL } from '../../utils/direction'\n\nexport const ITEM_SELECTOR = '.carousel-item:not(.carousel-item-clone)'\n\nexport function getCarouselItems(viewport: HTMLElement): HTMLElement[] {\n return Array.from(viewport.querySelectorAll<HTMLElement>(`:scope > ${ITEM_SELECTOR}`))\n}\n\nexport { isRTL }\n\nexport function prefersReducedMotion(): boolean {\n return (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n )\n}\n\nexport function isElementVisible(element: Element | null): boolean {\n if (!element) return false\n const rect = element.getBoundingClientRect()\n return (\n rect.top < (window.innerHeight || document.documentElement.clientHeight) &&\n rect.bottom > 0 &&\n rect.left < (window.innerWidth || document.documentElement.clientWidth) &&\n rect.right > 0\n )\n}\n\n// Horizontal distance to scroll `viewport` so `target` rests where the active slide belongs —\n// centered when `center` is set, otherwise flush with the scroll-padding (peek) offset, which is\n// exactly where scroll-snap settles. Scrolling the viewport itself (rather than\n// `target.scrollIntoView()`) keeps an off-screen carousel from yanking the whole page to itself.\nexport function scrollDeltaFor(\n viewport: HTMLElement,\n target: HTMLElement,\n center: boolean\n): number {\n const viewportRect = viewport.getBoundingClientRect()\n const rect = target.getBoundingClientRect()\n\n if (center) {\n return rect.left + rect.width / 2 - (viewportRect.left + viewportRect.width / 2)\n }\n\n const padStart = Number.parseFloat(getComputedStyle(viewport).scrollPaddingInlineStart) || 0\n\n return isRTL(viewport)\n ? rect.right - (viewportRect.right - padStart)\n : rect.left - (viewportRect.left + padStart)\n}\n\nexport function isViewportScrollable(viewport: HTMLElement): boolean {\n return viewport.scrollWidth - viewport.clientWidth > 0\n}\n\nconst SCROLL_DURATION_MS = 300\n// Safety net above the animation's own duration, in case `requestAnimationFrame` stalls (a\n// backgrounded tab, a frozen/suspended webview) and never drives the animation to completion.\n// `setTimeout` still fires in that situation — throttled, but not indefinitely suspended the way\n// rAF can be — so this guarantees the scroll lands on target and callers relying on completion to\n// release a lock (e.g. re-enabling the IntersectionObserver) can never get stuck forever.\nconst SCROLL_SAFETY_MS = SCROLL_DURATION_MS + 200\n\nconst easeInOutCubic = (progress: number) =>\n progress < 0.5 ? 4 * progress * progress * progress : 1 - (-2 * progress + 2) ** 3 / 2\n\n// Animates `viewport.scrollLeft` to `targetLeft` by stepping the position by hand each frame,\n// resolving deterministically once the animation completes — not by waiting on the `scrollend`\n// event or a fixed timeout as the *primary* signal. Both of those only approximate when a native\n// `scrollTo({behavior:'smooth'})` actually finishes, and firing early restores CSS scroll-snap\n// mid-flight, which snaps the track back to the nearest point instead of the intended one rather\n// than letting it arrive. Using `behavior: 'instant'` for every step keeps this animation from\n// fighting the viewport's own CSS `scroll-behavior: smooth`. Returns a canceller so a caller that\n// starts a newer scroll before this one finishes can stop it instead of both fighting over the\n// position.\nexport function animateScrollTo(\n viewport: HTMLElement,\n targetLeft: number,\n onSettled: () => void\n): () => void {\n if (prefersReducedMotion() || typeof requestAnimationFrame === 'undefined') {\n viewport.scrollTo({ left: targetLeft, behavior: 'instant' })\n onSettled()\n return () => {}\n }\n\n const startLeft = viewport.scrollLeft\n const distance = targetLeft - startLeft\n let startTime: number | null = null\n let frame: number | null = null\n let done = false\n\n const finish = () => {\n if (done) return\n done = true\n if (frame !== null) cancelAnimationFrame(frame)\n clearTimeout(safetyTimer)\n viewport.scrollTo({ left: targetLeft, behavior: 'instant' })\n onSettled()\n }\n\n const step = (now: number) => {\n if (done) return\n if (startTime === null) startTime = now\n\n const progress = Math.min((now - startTime) / SCROLL_DURATION_MS, 1)\n viewport.scrollTo({\n left: startLeft + distance * easeInOutCubic(progress),\n behavior: 'instant'\n })\n\n if (progress < 1) {\n frame = requestAnimationFrame(step)\n return\n }\n\n finish()\n }\n\n const safetyTimer = setTimeout(finish, SCROLL_SAFETY_MS)\n frame = requestAnimationFrame(step)\n\n return () => {\n if (done) return\n done = true\n if (frame !== null) cancelAnimationFrame(frame)\n clearTimeout(safetyTimer)\n }\n}\n\nexport function normalizeIndex(index: number, length: number, wraps: boolean): number | null {\n if (Number.isNaN(index) || length === 0) return null\n if (index < 0) return wraps ? length - 1 : null\n if (index > length - 1) return wraps ? 0 : null\n return index\n}\n\nexport type CarouselDirection = 'left' | 'right'\n\nexport function directionBetween(from: number, to: number, rtl: boolean): CarouselDirection {\n const isNext = to > from\n if (rtl) return isNext ? 'right' : 'left'\n return isNext ? 'left' : 'right'\n}\n\nexport function loopDirection(isNext: boolean, rtl: boolean): CarouselDirection {\n if (rtl) return isNext ? 'right' : 'left'\n return isNext ? 'left' : 'right'\n}\n\n// Seamless looping only reads right for the plain single-slide scroll layout — multi-item, peek,\n// centered, and variable-width layouts fall back to a `wrap` jump instead (see `canLoop`).\nexport function canLoop(\n carouselElement: HTMLElement,\n itemCount: number,\n isFade: boolean,\n center: boolean,\n auto: boolean\n): boolean {\n if (isFade || itemCount < 2 || center || auto) return false\n\n const styles = getComputedStyle(carouselElement)\n const num = (name: string) => Number.parseFloat(styles.getPropertyValue(name)) || 0\n\n return (num('--cx-carousel-items') || 1) === 1 && num('--cx-carousel-items-peek') === 0\n}\n","import React, { ElementType, ForwardRefRenderFunction, ReactElement, useContext } from 'react'\nimport classNames from 'classnames'\n\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { CarouselContext } from './context'\nimport { SlidePositionContext } from './slides'\n\ntype CarouselItemOwnProps<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 * Milliseconds to wait before autoplay advances past this slide, overriding the carousel's own `interval`.\n */\n interval?: number\n}\n\nexport type CarouselItemProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CarouselItemOwnProps<C>\n>\n\ntype CarouselItemComponent = (<C extends ElementType = 'div'>(\n props: CarouselItemProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\nfunction CarouselItemRender<C extends ElementType = 'div'>(\n { children, className, component, interval, ...rest }: CarouselItemProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n // Where this slide sits, when `CarouselInner` can tell (see `slides.tsx`), so the first render,\n // the server's too, marks the active slide. `Carousel` applies the same from the DOM otherwise.\n const carousel = useContext(CarouselContext)\n const slide = useContext(SlidePositionContext)\n const position =\n carousel && slide\n ? {\n 'aria-label': `${slide.index + 1} of ${slide.count}`,\n 'aria-roledescription': 'slide',\n role: 'group'\n }\n : {}\n const _className = classNames(\n 'carousel-item',\n { active: !!carousel && !!slide && slide.index === carousel.activeIndex },\n className\n )\n\n return (\n <Component className={_className} data-interval={interval} {...position} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CarouselItem = createPolymorphicComponent<CarouselItemComponent>(\n CarouselItemRender as ForwardRefRenderFunction<Element, CarouselItemProps<ElementType>>,\n 'CarouselItem'\n)\n","import React, { Children, createContext, Fragment, isValidElement, ReactNode } from 'react'\n\nimport { isElementOfType } from '../../utils/lazyElement'\nimport { CarouselItem } from './CarouselItem'\n\n// Internal to the carousel family (see CONVENTIONS.md's helper-module carve-out).\n//\n// The carousel finds its slides in the DOM (`getCarouselItems`), which a server doesn't have: the\n// first render drew no indicators and no active slide, so a `fade` carousel, whose inactive\n// slides are transparent, was blank until the JavaScript had loaded. These read the slides from\n// `CarouselInner`'s children instead, the way the server sees them.\n\nexport interface SlidePosition {\n count: number\n index: number\n}\n\n// Each slide's position, from `CarouselInner` to its `CarouselItem`. Unset when `CarouselInner`\n// can't tell (see `readSlides`), and for a slide of a carousel nested inside another one's slide,\n// which its own `CarouselInner` resets.\nexport const SlidePositionContext = createContext<SlidePosition | undefined>(undefined)\n\nexport interface Slides {\n // `children` with fragments flattened, each keyed as React would key it.\n nodes: ReactNode[]\n // Whether every one of them is a `CarouselItem`. Anything else, such as a slide inside a\n // component of your own, sits somewhere among them that this can't see, and a position counted\n // without it would contradict the DOM's.\n positioned: boolean\n}\n\nexport function readSlides(children: ReactNode): Slides {\n const nodes = flatten(children)\n return { nodes, positioned: nodes.every((node) => isElementOfType(node, CarouselItem)) }\n}\n\nfunction flatten(children: ReactNode): ReactNode[] {\n return Children.toArray(children).flatMap((child) =>\n isElementOfType<{ children?: ReactNode }>(child, Fragment)\n ? flatten(child.props.children).map((node) =>\n isValidElement(node)\n ? React.cloneElement(node, { key: `${child.key}/${node.key}` })\n : node\n )\n : [child]\n )\n}\n","import React, { ElementType, ForwardRefRenderFunction, isValidElement, ReactElement } from 'react'\nimport classNames from 'classnames'\n\nimport { useForkedRef } from '../../hooks'\nimport {\n createPolymorphicComponent,\n PolymorphicComponentProps,\n PolymorphicRef\n} from '../../utils/polymorphic'\nimport { useCarouselContext } from './context'\nimport { readSlides, SlidePositionContext } from './slides'\n\ntype CarouselInnerOwnProps<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 CarouselInnerProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CarouselInnerOwnProps<C>\n>\n\ntype CarouselInnerComponent = (<C extends ElementType = 'div'>(\n props: CarouselInnerProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n/**\n * The scroll viewport — a real horizontally-scrolling container using CSS scroll-snap. Wrap\n * CarouselItem children in this rather than passing them directly to Carousel, so controls and\n * indicators can sit alongside it (above, below, or overlaid) instead of inside the scroll track.\n */\nfunction CarouselInnerRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CarouselInnerProps<C>,\n ref: PolymorphicRef<C>\n) {\n const { registerViewport } = useCarouselContext()\n const Component = component ?? 'div'\n const forkedRef = useForkedRef(ref, registerViewport)\n const _className = classNames('carousel-inner', className)\n const { nodes, positioned } = readSlides(children)\n\n // Every child is wrapped the same way whether or not the positions are known, so a child that\n // comes and goes (a loading spinner beside the slides) doesn't remount the slides. Unknown\n // positions are provided as unset, which also keeps an enclosing carousel's from leaking in.\n return (\n <Component className={_className} {...rest} ref={forkedRef}>\n {nodes.map((node, index) => (\n <SlidePositionContext.Provider\n key={isValidElement(node) ? node.key : index}\n value={positioned ? { count: nodes.length, index } : undefined}\n >\n {node}\n </SlidePositionContext.Provider>\n ))}\n </Component>\n )\n}\n\nexport const CarouselInner = createPolymorphicComponent<CarouselInnerComponent>(\n CarouselInnerRender as ForwardRefRenderFunction<Element, CarouselInnerProps<ElementType>>,\n 'CarouselInner'\n)\n","import React, {\n Children,\n CSSProperties,\n forwardRef,\n HTMLAttributes,\n isValidElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState\n} from 'react'\nimport classNames from 'classnames'\n\nimport { useControllableState, useForkedRef, useIsomorphicLayoutEffect } from '../../hooks'\nimport { focusRedirect } from '../../utils/focusRedirect'\nimport { consumePointerClick } from '../../utils/pointerInteraction'\nimport { CarouselContext, CarouselContextProps, CarouselControlKind, CarouselEnds } from './context'\nimport {\n animateScrollTo,\n canLoop,\n directionBetween,\n getCarouselItems,\n isElementVisible,\n isRTL,\n isViewportScrollable,\n loopDirection,\n normalizeIndex,\n prefersReducedMotion,\n scrollDeltaFor\n} from './carouselEngine'\nimport { devWarning } from '../../utils/devWarning'\nimport { executeAfterTransition, getTransitionDuration } from '../../utils/dialogTransition'\nimport { isElementOfType } from '../../utils/lazyElement'\nimport { CarouselInner } from './CarouselInner'\nimport { readSlides } from './slides'\nimport { VisuallyHidden } from '../visually-hidden/VisuallyHidden'\n\nexport type { CarouselEnds }\nexport type CarouselTransition = 'scroll' | 'fade'\n\nexport interface CarouselSlideDetail {\n /**\n * Direction of travel, mirrored in RTL.\n */\n direction: 'left' | 'right'\n /**\n * Index of the outgoing slide.\n */\n from: number\n /**\n * Index of the incoming slide.\n */\n to: number\n}\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * The active slide's index, for controlled usage. Pair with `onSlide` to feed the new index\n * back: it is the only way a controlled carousel's `activeIndex` gets updated. `onSlid` can't\n * do that, as it reports a slide that has arrived, which a controlled carousel doesn't leave\n * for until `activeIndex` names it.\n */\n activeIndex?: number\n /**\n * Let each CarouselItem size itself instead of dividing the track evenly; snap points still land on every slide.\n */\n auto?: boolean\n /**\n * Cycle through slides automatically on mount.\n */\n autoplay?: boolean\n /**\n * Snap the active slide to the center of the viewport instead of its start.\n */\n center?: boolean\n /**\n * A string of all className you want applied to the base component.\n */\n className?: string\n /**\n * The active slide's index, for uncontrolled usage.\n */\n defaultActiveIndex?: number\n /**\n * Behavior at the first/last slide. `loop` continues seamlessly past the ends for a single-slide layout, falling back to `wrap` for multi-item, peek, centered, or variable-width layouts, and under reduced motion. `wrap` jumps from the last slide back to the first, and vice versa. `stop` hard-stops and disables the previous/next controls at each end.\n */\n ends?: CarouselEnds\n /**\n * Milliseconds to wait before automatically advancing to the next slide. Override per slide with CarouselItem's own `interval` prop.\n */\n interval?: number\n /**\n * Number of whole slides visible per view, applied as the `--cx-carousel-items` custom property.\n */\n items?: number\n /**\n * Space between slides, applied as the `--cx-carousel-items-gap` custom property.\n */\n itemsGap?: string\n /**\n * How much of the neighboring slides to reveal, applied as the `--cx-carousel-items-peek` custom property.\n */\n itemsPeek?: string\n /**\n * Move to the previous/next slide with the Left/Right arrow keys while focus is inside the\n * carousel. The keys follow the slides: in a right-to-left layout the next slide is to the\n * left, and Left Arrow moves to it.\n */\n keyboard?: boolean\n /**\n * Callback fired once a slide transition completes.\n */\n onSlid?: (detail: CarouselSlideDetail) => void\n /**\n * Callback fired when a slide transition begins.\n */\n onSlide?: (detail: CarouselSlideDetail) => void\n /**\n * Pause autoplay on `mouseenter`, resuming on `mouseleave`. Set to `false` to disable pause-on-hover.\n */\n pause?: 'hover' | false\n /**\n * Replace the scroll transition with a crossfade.\n */\n transition?: CarouselTransition\n}\n\nconst ACTIVE_RATIO_TOLERANCE = 0.05\n// How long the track must have stopped scrolling for a swipe to be over, and for a controlled\n// parent that hasn't followed it to be taken as not following. `scrollend` would say the first\n// outright, but not every supported browser has it, and it can come before the observer's last\n// report of the same frame. Half a second and not the 150 ms a scroll needs to settle: a parent\n// that keeps the index somewhere slow (the URL, a store behind a transition) answers `onSlide`\n// later than that, and the track went back and then forward again under it.\nconst SWIPE_SETTLE_MS = 500\n\nexport const Carousel = forwardRef<HTMLDivElement, CarouselProps>(\n (\n {\n children,\n activeIndex: activeIndexProp,\n auto,\n autoplay = false,\n center,\n className,\n defaultActiveIndex = 0,\n ends = 'loop',\n interval = 5000,\n items,\n itemsGap,\n itemsPeek,\n keyboard = true,\n onKeyDown,\n onMouseEnter,\n onMouseLeave,\n onSlid,\n onSlide,\n pause = 'hover',\n style,\n transition = 'scroll',\n ...rest\n },\n ref\n ) => {\n // `onSlide`, not a dedicated `onChange`, is the only way a controlled `activeIndex` gets fed\n // back (see the CarouselProps `activeIndex` doc and carousel.mdx's \"Controlled usage\"\n // section). Without it every click, swipe and autoplay advance is a request nobody hears, and\n // the carousel silently freezes instead of erroring. `onSlid` is no substitute: it reports a\n // slide that has arrived, and a controlled carousel only leaves for one once `activeIndex`\n // names it. This warning and the docs offered `onSlid` too, and a carousel fed from it alone\n // never moved.\n devWarning(\n activeIndexProp !== undefined && !onSlide,\n 'Carousel: `activeIndex` is set (controlled) without `onSlide`: nothing feeds the new ' +\n 'index back to your state, so the carousel will visually freeze on click/swipe/autoplay. ' +\n 'Pass `onSlide` and update `activeIndex` from it. `onSlid` cannot do this: it fires once ' +\n 'a slide has arrived, which under a controlled `activeIndex` only happens after the ' +\n 'prop has changed.'\n )\n\n const carouselRef = useRef<HTMLDivElement>(null)\n const forkedRef = useForkedRef(ref, carouselRef)\n\n const [viewportEl, setViewportEl] = useState<HTMLDivElement | null>(null)\n // Stable identity: this goes into `contextValue` and on to `useForkedRef` in `CarouselInner`,\n // whose memo is keyed on the refs array — a fresh closure every render would keep detaching\n // and reattaching the viewport ref instead of running once per mount.\n const registerViewport = useCallback((node: HTMLDivElement | null) => setViewportEl(node), [])\n\n const isControlled = activeIndexProp !== undefined\n const [activeIndex, setActiveIndex] = useControllableState(activeIndexProp, defaultActiveIndex)\n const activeIndexRef = useRef(activeIndex)\n // The index of the last commit, which `activeIndexRef` may run ahead of (see\n // `setActiveIndexInternal`).\n const committedIndexRef = useRef(activeIndex)\n // The step last asked for, until `activeIndex` changes: then the step that happened, which\n // `onSlid` reports.\n const lastTransitionRef = useRef<CarouselSlideDetail>({\n from: activeIndex,\n to: activeIndex,\n direction: 'left'\n })\n useIsomorphicLayoutEffect(() => {\n const from = committedIndexRef.current\n activeIndexRef.current = activeIndex\n committedIndexRef.current = activeIndex\n if (from === activeIndex) return\n // The parent of a controlled carousel can choose a slide nobody asked for, or answer a\n // request with another slide. `onSlid` then reported the last request as it stood, an\n // earlier step. A request that was followed is kept whole: it has the direction that was\n // asked for, which the two indexes of a step that wrapped round would give the other way.\n const asked = lastTransitionRef.current\n if (asked.from === from && asked.to === activeIndex) return\n lastTransitionRef.current = {\n from,\n to: activeIndex,\n direction: directionBetween(from, activeIndex, viewportEl ? isRTL(viewportEl) : false)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex])\n\n // A timer, an observer and a running animation outlive the render that started them. The\n // callbacks they report to are read from here, so they are the latest render's.\n const onSlideRef = useRef(onSlide)\n const onSlidRef = useRef(onSlid)\n useIsomorphicLayoutEffect(() => {\n onSlideRef.current = onSlide\n onSlidRef.current = onSlid\n })\n\n // Counted from the DOM once the viewport is mounted (the layout effect below), which never\n // happens on the server: `CarouselIndicators` rendered an empty list there. The first render\n // counts the slides written inside `CarouselInner` instead.\n const [itemCount, setItemCount] = useState(() => countSlides(children))\n const itemCountRef = useRef(itemCount)\n useIsomorphicLayoutEffect(() => {\n itemCountRef.current = itemCount\n }, [itemCount])\n\n const [playing, setPlaying] = useState(autoplay)\n const [cycling, setCycling] = useState(false)\n // From the same index math as the layout effect below, so the server's HTML disables the\n // right end control. With no slides counted yet, neither end is known.\n const [atStart, setAtStart] = useState(activeIndex <= 0)\n const [atEnd, setAtEnd] = useState(\n itemCount > 0 && activeIndex >= itemCount - Math.max(1, items ?? 1)\n )\n\n const loopingRef = useRef(false)\n // True while a programmatic scroll-sync animation is in flight, so the IntersectionObserver\n // doesn't treat a slide passing through mid-scroll (e.g. slide 2 on the way from 1 to 3) as\n // the new active slide and hijack the navigation before it reaches its real target.\n const syncingScrollRef = useRef(false)\n // The slide the IntersectionObserver last asked for (i.e. the user physically scrolled/swiped\n // there), so the scroll-sync effect below can skip the change to it. Without this, every\n // threshold the observer crosses mid-gesture — before the browser's own scroll-snap has\n // actually settled the position — would make that effect \"correct\" the still-in-progress\n // native scroll, fighting the user's own touch/wheel input. It names the slide, and isn't a\n // plain flag, because the parent of a controlled carousel may not follow: a flag stayed set\n // then, and the next step that was followed, to any slide, didn't scroll. `settleSwipe`\n // clears the mark of a swipe nobody followed.\n const swipedToRef = useRef<number | null>(null)\n const swipeSettleTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const touchingRef = useRef(false)\n const cancelScrollSyncRef = useRef<(() => void) | null>(null)\n // The loop transition's animation, which an unmount cancels as it cancels a scroll sync.\n const cancelLoopRef = useRef<(() => void) | null>(null)\n const observerRef = useRef<IntersectionObserver | null>(null)\n const visibilityRef = useRef(new Map<Element, number>())\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const scrollSyncedRef = useRef(false)\n // The index each of the `onSlid` and live-region effects last acted on, starting with the\n // one the carousel mounted at. A \"first run\" flag would not do: StrictMode runs a mount\n // effect twice and keeps refs, so the second run would take the mount for a slide.\n const slidIndexRef = useRef(activeIndex)\n const announcedIndexRef = useRef(activeIndex)\n const [liveMessage, setLiveMessage] = useState('')\n // Set while the scroll-sync effect below owns firing `onSlid` for the in-flight\n // `animateScrollTo` animation, so the generic effect doesn't fire it early — before the slide\n // has actually finished sliding into place.\n const deferOnSlidRef = useRef(false)\n const prevControlsRef = useRef<Set<HTMLButtonElement>>(new Set())\n const nextControlsRef = useRef<Set<HTMLButtonElement>>(new Set())\n const playControlsRef = useRef<Set<HTMLButtonElement>>(new Set())\n\n const isFade = transition === 'fade'\n const itemsVisible = Math.max(1, items ?? 1)\n const wraps = ends !== 'stop'\n\n const setActiveIndexInternal = (next: number) => {\n // Update the ref synchronously, not just via the layout effect below — that effect only\n // runs after React re-renders and commits, so two `next()` calls fired back-to-back in the\n // same tick (a fast double-click, or any rapid programmatic call) would both read the same\n // stale `activeIndexRef.current` and target the same index instead of advancing twice.\n activeIndexRef.current = next\n setActiveIndex(next)\n // A controlled carousel only asks. A parent that leaves `activeIndex` where it is renders\n // nothing, so no effect would put the ref back and every later step would start from a\n // slide that isn't shown. The ref runs ahead for the rest of this tick, which is all the\n // back-to-back calls above need, and is the prop's again after it.\n if (isControlled) {\n queueMicrotask(() => {\n activeIndexRef.current = committedIndexRef.current\n })\n }\n }\n\n // Moves the track by `delta` with scroll-snap off, which would pull it to the nearest slide\n // on the way, and with the observer told not to act on the slides that pass.\n const animateTrackBy = (viewport: HTMLDivElement, delta: number, onArrived?: () => void) => {\n // Cancel any previous scroll-sync still animating so it can't finish later and clobber\n // this newer target, and so `syncingScrollRef` isn't cleared early while this one runs.\n cancelScrollSyncRef.current?.()\n syncingScrollRef.current = true\n viewport.style.scrollSnapType = 'none'\n cancelScrollSyncRef.current = animateScrollTo(viewport, viewport.scrollLeft + delta, () => {\n viewport.style.scrollSnapType = ''\n syncingScrollRef.current = false\n cancelScrollSyncRef.current = null\n onArrived?.()\n })\n }\n\n // (Re)starts the wait for a swipe to come to rest. Refs only: the observer and the scroll\n // listener that call it belong to an earlier render.\n const awaitSwipeSettle = () => {\n if (swipeSettleTimerRef.current) clearTimeout(swipeSettleTimerRef.current)\n swipeSettleTimerRef.current = setTimeout(() => settleSwipeRef.current(), SWIPE_SETTLE_MS)\n }\n\n // Index math alone (not real geometry) drives `atStart`/`atEnd` so end-control state and\n // navigation clamping are correct even before layout exists (SSR, jsdom tests). The scroll\n // listener below refines it further for peek/variable-width layouts, where a whole number of\n // \"visible items\" can't be derived from `items` alone.\n useIsomorphicLayoutEffect(() => {\n const maxIndex = Math.max(0, itemCount - itemsVisible)\n setAtStart(activeIndex <= 0)\n setAtEnd(activeIndex >= maxIndex)\n }, [activeIndex, itemCount, itemsVisible])\n\n useEffect(() => {\n if (!viewportEl) return undefined\n\n const handleScroll = () => {\n // Still moving: a swipe waiting for its answer isn't over yet.\n if (swipedToRef.current !== null) awaitSwipeSettle()\n if (loopingRef.current || !isViewportScrollable(viewportEl)) return\n const maxScroll = viewportEl.scrollWidth - viewportEl.clientWidth\n // Elastic overscroll (iOS Safari/macOS trackpad rubber-banding) can push `scrollLeft`\n // slightly past either edge mid-gesture. Clamp to the real [0, maxScroll] range (mirrored\n // for RTL's negative `scrollLeft` convention) before the RTL-normalizing `abs()` below, so\n // a bounce at the start edge doesn't briefly read as \"away from start\" - which flickered\n // `ends=\"stop\"` controls enabled while still at the first/last slide.\n const rawScrollLeft = viewportEl.scrollLeft\n const clampedScrollLeft = isRTL(viewportEl)\n ? Math.max(-maxScroll, Math.min(0, rawScrollLeft))\n : Math.max(0, Math.min(maxScroll, rawScrollLeft))\n const scrollLeft = Math.abs(clampedScrollLeft)\n setAtStart(scrollLeft <= 1)\n setAtEnd(scrollLeft >= maxScroll - 1)\n }\n\n // A finger resting on the track mid-swipe stops the scroll events too.\n const handleTouchStart = () => {\n touchingRef.current = true\n }\n const handleTouchEnd = (event: TouchEvent) => {\n touchingRef.current = event.touches.length > 0\n }\n\n viewportEl.addEventListener('scroll', handleScroll, { passive: true })\n viewportEl.addEventListener('touchstart', handleTouchStart, { passive: true })\n viewportEl.addEventListener('touchend', handleTouchEnd)\n viewportEl.addEventListener('touchcancel', handleTouchEnd)\n return () => {\n viewportEl.removeEventListener('scroll', handleScroll)\n viewportEl.removeEventListener('touchstart', handleTouchStart)\n viewportEl.removeEventListener('touchend', handleTouchEnd)\n viewportEl.removeEventListener('touchcancel', handleTouchEnd)\n }\n }, [viewportEl])\n\n // Fewer slides than the active index needs: none would be active, the end control would be\n // disabled and the other one a no-op under `ends=\"stop\"`. The index moves to the last one\n // there is, which a controlled carousel asks for through `onSlide`. Once the count is the\n // DOM's: the first render's, read from `children`, may be short of slides inside components.\n useIsomorphicLayoutEffect(() => {\n if (!viewportEl || itemCount === 0 || getCarouselItems(viewportEl).length !== itemCount)\n return\n const last = Math.max(0, itemCount - itemsVisible)\n if (activeIndex <= last) return\n const detail: CarouselSlideDetail = {\n from: activeIndex,\n to: last,\n direction: directionBetween(activeIndex, last, isRTL(viewportEl))\n }\n lastTransitionRef.current = detail\n onSlideRef.current?.(detail)\n setActiveIndexInternal(last)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [viewportEl, activeIndex, itemCount, itemsVisible])\n\n // A layout effect, not a plain effect: `itemCount` must be measured before paint so the\n // atStart/atEnd layout effect above (which runs first, in declaration order) sees the real\n // count once React re-renders to flush this effect's `setItemCount` — otherwise the first\n // paint briefly shows `atEnd=true` (itemCount still 0) even on a carousel with many slides.\n useIsomorphicLayoutEffect(() => {\n if (!viewportEl) return undefined\n\n const syncItems = () => {\n const nodes = getCarouselItems(viewportEl)\n setItemCount(nodes.length)\n\n observerRef.current?.disconnect()\n observerRef.current = null\n visibilityRef.current = new Map()\n\n if (isFade || typeof IntersectionObserver === 'undefined') return\n\n observerRef.current = new IntersectionObserver(\n (entries) => {\n // Always merge entries so `visibilityRef` tracks reality even mid-animation —\n // dropping them here would leave the outgoing slide's last-known ratio stale (e.g.\n // still 1.0 from before the scroll started), which the comparison below would then\n // wrongly treat as still the most-visible slide once the animation completes. Only\n // acting on the result is guarded, so a slide passing through mid-programmatic-scroll\n // can't hijack the navigation before it reaches its real target.\n for (const entry of entries) {\n visibilityRef.current.set(\n entry.target,\n entry.isIntersecting ? entry.intersectionRatio : 0\n )\n }\n\n if (loopingRef.current || syncingScrollRef.current) return\n\n const currentNodes = getCarouselItems(viewportEl)\n const ratios = currentNodes.map((node) => visibilityRef.current.get(node) ?? 0)\n const maxRatio = Math.max(0, ...ratios)\n let bestIndex = activeIndexRef.current\n\n if (maxRatio > 0) {\n const found = ratios.findIndex((ratio) => ratio >= maxRatio - ACTIVE_RATIO_TOLERANCE)\n if (found !== -1) bestIndex = found\n }\n\n if (bestIndex !== activeIndexRef.current) {\n const from = activeIndexRef.current\n const detail = {\n from,\n to: bestIndex,\n direction: directionBetween(from, bestIndex, isRTL(viewportEl))\n }\n lastTransitionRef.current = detail\n onSlideRef.current?.(detail)\n swipedToRef.current = bestIndex\n setActiveIndexInternal(bestIndex)\n awaitSwipeSettle()\n }\n },\n { root: viewportEl, threshold: [0, 0.25, 0.5, 0.75, 1] }\n )\n\n for (const node of nodes) observerRef.current.observe(node)\n }\n\n syncItems()\n const mutationObserver = new MutationObserver(syncItems)\n mutationObserver.observe(viewportEl, { childList: true })\n\n return () => {\n mutationObserver.disconnect()\n observerRef.current?.disconnect()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [viewportEl, isFade])\n\n // `activeIndex` is the source of truth for which slide is active, and fade mode's crossfade is\n // driven entirely by the `active` class. `CarouselItem` renders it, and the WAI-ARIA carousel\n // pattern's per-slide `role`/`aria-roledescription`/positional `aria-label`, when\n // `CarouselInner` can tell it its position (see `slides.tsx`), so the server's HTML has them.\n // This applies the same to the DOM, which also covers slides rendered by your own components.\n // A slide's own `aria-label` stays: the position is written only where there is none, or over\n // the one written here before (`positionLabelsRef`). It overwrote a `CarouselItem`'s own.\n const positionLabelsRef = useRef(new WeakMap<Element, string>())\n useIsomorphicLayoutEffect(() => {\n if (!viewportEl) return\n const nodes = getCarouselItems(viewportEl)\n for (const [index, node] of nodes.entries()) {\n node.classList.toggle('active', index === activeIndex)\n // A `group`, as the pattern has it: `aria-label` isn't allowed on an element with no role.\n if (!node.hasAttribute('role')) node.setAttribute('role', 'group')\n node.setAttribute('aria-roledescription', 'slide')\n const label = node.getAttribute('aria-label')\n if (label === null || label === positionLabelsRef.current.get(node)) {\n const position = `${index + 1} of ${nodes.length}`\n node.setAttribute('aria-label', position)\n positionLabelsRef.current.set(node, position)\n }\n }\n }, [viewportEl, activeIndex, itemCount])\n\n // Best-effort visual sync: scrolls the real DOM position to match `activeIndex` after a\n // programmatic navigation. A user-driven drag/swipe goes the other way (observer above), which\n // sets `swipedToRef` so this effect no-ops for it instead of fighting a gesture that's\n // still physically in progress — see the ref's own comment for why that matters.\n useIsomorphicLayoutEffect(() => {\n if (swipedToRef.current === activeIndex) {\n swipedToRef.current = null\n return\n }\n if (!viewportEl || loopingRef.current || isFade) return\n const nodes = getCarouselItems(viewportEl)\n const target = nodes[activeIndex]\n if (!target || !isViewportScrollable(viewportEl)) return\n\n // Marked as soon as this effect has a real viewport to sync against — on mount, even if\n // there's nothing to scroll (delta below is ~0). Otherwise the mount pass never sets it\n // (it returns early below without scrolling), and the *first real navigation* ends up\n // mistaken for the initial sync and forced instant instead of animated.\n const instant = !scrollSyncedRef.current\n scrollSyncedRef.current = true\n\n const delta = scrollDeltaFor(viewportEl, target, !!center)\n if (Math.abs(delta) < 1) return\n\n if (instant) {\n // Cancel any previous scroll-sync still animating so it can't finish later and clobber\n // this newer target, and so `syncingScrollRef` isn't cleared early while this one runs.\n cancelScrollSyncRef.current?.()\n syncingScrollRef.current = true\n viewportEl.style.scrollSnapType = 'none'\n viewportEl.scrollTo({ left: viewportEl.scrollLeft + delta, behavior: 'instant' })\n viewportEl.style.scrollSnapType = ''\n syncingScrollRef.current = false\n cancelScrollSyncRef.current = null\n } else {\n deferOnSlidRef.current = true\n animateTrackBy(viewportEl, delta, () => {\n deferOnSlidRef.current = false\n onSlidRef.current?.(lastTransitionRef.current)\n })\n }\n }, [viewportEl, activeIndex, itemCount, center, isFade])\n\n // A swipe is a request like any other, made after the track has moved. When the parent of a\n // controlled carousel doesn't follow it, the track is put back on the active slide: it stayed\n // on the slide the user had swiped to, with `activeIndex`, the indicators and the slide\n // marked `active` all naming another. Not before the swipe has come to rest, since a scroll\n // from here would fight the gesture (see `swipedToRef`): that is a pause in the track's\n // scroll events with no finger on it. An uncontrolled carousel has followed by then, and so\n // has a parent that does: the mark is gone and there is nothing to do.\n const settleSwipe = () => {\n swipeSettleTimerRef.current = null\n if (swipedToRef.current === null) return\n if (touchingRef.current) {\n awaitSwipeSettle()\n return\n }\n swipedToRef.current = null\n if (!viewportEl || loopingRef.current || syncingScrollRef.current || isFade) return\n const target = getCarouselItems(viewportEl)[committedIndexRef.current]\n if (!target) return\n const delta = scrollDeltaFor(viewportEl, target, !!center)\n if (Math.abs(delta) >= 1) animateTrackBy(viewportEl, delta)\n }\n // The timer outlives the render that set it, as the autoplay timer does.\n const settleSwipeRef = useRef(settleSwipe)\n useIsomorphicLayoutEffect(() => {\n settleSwipeRef.current = settleSwipe\n })\n\n useEffect(() => {\n if (slidIndexRef.current === activeIndex) return\n slidIndexRef.current = activeIndex\n // The loop transition fires it once it has arrived (`performLoopTransition`).\n if (deferOnSlidRef.current || loopingRef.current) return\n const detail = lastTransitionRef.current\n // A crossfade is over when the incoming slide's opacity transition is: `onSlid` used to\n // fire on the commit `onSlide` did. It waits on the element's own transition, so a themed\n // duration is followed, and one that has none (reduced motion) doesn't wait. The cleanup\n // drops a fade another step overtook, as a scroll overtaken mid-flight reports nothing.\n const incoming = isFade && viewportEl ? getCarouselItems(viewportEl)[activeIndex] : undefined\n if (incoming) {\n return executeAfterTransition(\n incoming,\n () => onSlidRef.current?.(detail),\n getTransitionDuration(incoming) > 0\n )\n }\n onSlid?.(detail)\n return undefined\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex])\n\n // Announces the active slide's position to assistive tech, per the WAI-ARIA carousel pattern.\n // Gated the same way as the `onSlid` effect above so mounting with a non-zero\n // `defaultActiveIndex`/`activeIndex` doesn't announce anything before the user has interacted.\n useEffect(() => {\n if (announcedIndexRef.current === activeIndex) return\n announcedIndexRef.current = activeIndex\n setLiveMessage(`Slide ${activeIndex + 1} of ${itemCount}`)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex])\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n if (swipeSettleTimerRef.current) clearTimeout(swipeSettleTimerRef.current)\n observerRef.current?.disconnect()\n cancelScrollSyncRef.current?.()\n cancelLoopRef.current?.()\n }\n }, [])\n\n const performLoopTransition = (isNext: boolean) => {\n const viewport = viewportEl\n if (!viewport) return\n\n // Drop any in-flight regular scroll-sync (e.g. a fast second navigation crossing the loop\n // boundary) so its stale onSettled can't fire mid-loop or after this transition completes.\n cancelScrollSyncRef.current?.()\n syncingScrollRef.current = false\n\n const nodes = getCarouselItems(viewport)\n const last = nodes.length - 1\n const from = activeIndexRef.current\n const to = isNext ? 0 : last\n const direction = loopDirection(isNext, isRTL(viewport))\n\n onSlide?.({ from, to, direction })\n // Now, not only in `finish`: a controlled parent follows `onSlide` while the loop still\n // runs, and the step that happened is matched against this one.\n lastTransitionRef.current = { from, to, direction }\n loopingRef.current = true\n\n const finish = () => {\n lastTransitionRef.current = { from, to, direction }\n loopingRef.current = false\n // A controlled parent that followed `onSlide` has already moved `activeIndex` to `to`,\n // during the loop, where `onSlid` waited (the effect that fires it): the slide has arrived\n // now. Otherwise the commit of this step fires it.\n if (committedIndexRef.current === to) onSlidRef.current?.(lastTransitionRef.current)\n else setActiveIndexInternal(to)\n }\n\n const source = isNext ? nodes[0] : nodes[last]\n const fromItem = nodes[from]\n const toItem = nodes[to]\n\n if (!isViewportScrollable(viewport) || !source || !fromItem || !toItem) {\n finish()\n return\n }\n\n const clone = source.cloneNode(true) as HTMLElement\n clone.classList.add('carousel-item-clone')\n clone.classList.remove('active')\n clone.removeAttribute('id')\n for (const node of Array.from(clone.querySelectorAll('[id]'))) node.removeAttribute('id')\n clone.setAttribute('aria-hidden', 'true')\n clone.setAttribute('inert', '')\n\n viewport.style.scrollSnapType = 'none'\n\n if (isNext) {\n viewport.append(clone)\n } else {\n viewport.prepend(clone)\n // Prepending shifts the real slides right; realign instantly so the insertion doesn't\n // flash. `scrollTo(..., 'instant')` rather than a raw `scrollLeft +=` — the compound\n // assignment's read/write isn't reliably observed by the browser right after a DOM\n // mutation changes `scrollWidth` (see the matching note by the final jump below).\n viewport.scrollTo({\n left: viewport.scrollLeft + scrollDeltaFor(viewport, fromItem, !!center),\n behavior: 'instant'\n })\n }\n\n const targetDelta = scrollDeltaFor(viewport, clone, !!center)\n cancelLoopRef.current = animateScrollTo(viewport, viewport.scrollLeft + targetDelta, () => {\n cancelLoopRef.current = null\n clone.remove()\n\n // `clone.remove()` shrinks `scrollWidth`, and the browser clamps `scrollLeft` to the new\n // max as a side effect — sometimes before a subsequent `scrollLeft +=` on the same tick\n // observes it, landing short of the real target. `scrollTo(..., 'instant')` with the full\n // absolute target doesn't have that race.\n const finalDelta = scrollDeltaFor(viewport, toItem, !!center)\n viewport.scrollTo({ left: viewport.scrollLeft + finalDelta, behavior: 'instant' })\n\n viewport.style.scrollSnapType = ''\n finish()\n })\n }\n\n const navigate = (rawTarget: number) => {\n if (loopingRef.current) return\n const length = itemCountRef.current\n if (length === 0) return\n\n const effectiveLast = Math.max(0, length - itemsVisible)\n\n if (\n ends === 'loop' &&\n !isFade &&\n !prefersReducedMotion() &&\n carouselRef.current &&\n canLoop(carouselRef.current, length, isFade, !!center, !!auto)\n ) {\n if (rawTarget > effectiveLast) {\n performLoopTransition(true)\n return\n }\n if (rawTarget < 0) {\n performLoopTransition(false)\n return\n }\n }\n\n const target = normalizeIndex(rawTarget, effectiveLast + 1, wraps)\n const from = activeIndexRef.current\n if (target === null || target === from) return\n\n // This step is the carousel's own, and scrolls: a swipe still waiting for its answer no\n // longer says where the track should be.\n swipedToRef.current = null\n\n // `rawTarget`, not the post-wrap `target`, so a wrap-around still reports the direction the\n // caller actually asked for (e.g. Next wrapping last -> 0 stays \"next\", not \"previous\").\n const direction = directionBetween(from, rawTarget, viewportEl ? isRTL(viewportEl) : false)\n onSlide?.({ from, to: target, direction })\n lastTransitionRef.current = { from, to: target, direction }\n setActiveIndexInternal(target)\n }\n\n const goNext = () => navigate(activeIndexRef.current + 1)\n const goPrev = () => navigate(activeIndexRef.current - 1)\n const goTo = (index: number) => navigate(index)\n\n const pauseCycle = () => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n timeoutRef.current = null\n setCycling(false)\n }\n\n // What the autoplay timer does when it fires. The timer is set in one render and fires in a\n // later one, and each tick used to run the closure of the render that started the cycle:\n // its `interval`, `ends`, `items`, `transition` and `onSlide`, whatever they had become.\n const autoplayTickRef = useRef<(fromIndex: number) => void>(() => undefined)\n\n const scheduleAutoplay = (fromIndex: number = activeIndexRef.current) => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current)\n\n const nodes = viewportEl ? getCarouselItems(viewportEl) : []\n const attr = nodes[fromIndex]?.dataset.interval\n const ms = attr && !Number.isNaN(Number(attr)) ? Number(attr) : interval\n carouselRef.current?.style.setProperty('--cx-carousel-interval', `${ms}ms`)\n\n timeoutRef.current = setTimeout(() => autoplayTickRef.current(fromIndex), ms)\n }\n\n const stopPlayingForGood = () => {\n setPlaying(false)\n pauseCycle()\n }\n\n const autoplayTick = (fromIndex: number) => {\n const length = itemCountRef.current\n const effectiveLast = Math.max(0, length - itemsVisible)\n const upcoming = normalizeIndex(activeIndexRef.current + 1, effectiveLast + 1, wraps)\n const canAdvance =\n typeof document === 'undefined' ||\n (document.visibilityState === 'visible' && isElementVisible(carouselRef.current))\n\n if (!canAdvance) {\n scheduleAutoplay(fromIndex)\n return\n }\n\n goNext()\n\n // Nothing after the last slide of `ends=\"stop\"`: autoplay is over, not paused, and\n // `CarouselPlayPause` says so. Left `playing`, it still read \"Pause\", and took one click to\n // stop what had stopped and another to start again.\n if (upcoming === null) {\n stopPlayingForGood()\n return\n }\n\n scheduleAutoplay(upcoming)\n }\n useIsomorphicLayoutEffect(() => {\n autoplayTickRef.current = autoplayTick\n })\n\n // Under `ends=\"stop\"` there is nothing to play from the last slide: a cycle started there\n // ran one interval, with the indicator filling, for a tick that had no slide to go to.\n const hasNothingToPlay = () => {\n const length = itemCountRef.current\n return !wraps && length > 0 && activeIndexRef.current >= Math.max(0, length - itemsVisible)\n }\n\n const startCycle = () => {\n if (hasNothingToPlay()) {\n stopPlayingForGood()\n return\n }\n scheduleAutoplay()\n setCycling(true)\n }\n\n const togglePlayPause = () => {\n if (playing) {\n stopPlayingForGood()\n return\n }\n setPlaying(true)\n startCycle()\n }\n\n useEffect(() => {\n if (!viewportEl) return undefined\n if (playing) startCycle()\n return () => pauseCycle()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [viewportEl])\n\n // Under `ends=\"stop\"` autoplay is over when it arrives at the last slide. It used to wait one\n // more interval there, for the tick that finds nothing to go to, with the indicator's\n // progress filling and `CarouselPlayPause` reading \"Pause\" all the while. An effect and not a\n // line of the tick, so that the slide is the one being shown: a controlled parent may not\n // follow the tick, or may move there by itself. Only a cycle that is running ends, so Play\n // on the last slide still starts one.\n useEffect(() => {\n if (!timeoutRef.current || wraps || itemCount === 0) return\n if (activeIndex >= Math.max(0, itemCount - itemsVisible)) stopPlayingForGood()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex, itemCount, itemsVisible, wraps])\n\n // A new `interval` applies to the slide being shown, not from the one after it. A slide's own\n // `interval` still wins, in `scheduleAutoplay`.\n useEffect(() => {\n if (timeoutRef.current) scheduleAutoplay()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [interval])\n\n useEffect(() => {\n if (!viewportEl) return undefined\n const handlePointerDown = () => stopPlayingForGood()\n viewportEl.addEventListener('pointerdown', handlePointerDown)\n return () => viewportEl.removeEventListener('pointerdown', handlePointerDown)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [viewportEl])\n\n // a11y: when a control at a disabled end is focused, move focus to the opposite control (if\n // it stays enabled) or the viewport, so focus never lands on nothing. `CarouselPlayPause` is\n // disabled at the end too, once autoplay is over there: the viewer who pressed Play and let\n // it run to the last slide has focus on it. From there, as from the next control, the way on\n // is back.\n useEffect(() => {\n if (ends !== 'stop') return\n const focused = document.activeElement as HTMLButtonElement | null\n const focusedIsPrev = atStart && !!focused && prevControlsRef.current.has(focused)\n const focusedIsNext =\n atEnd &&\n !!focused &&\n (nextControlsRef.current.has(focused) || (!playing && playControlsRef.current.has(focused)))\n if (!focusedIsPrev && !focusedIsNext) return\n\n const oppositeSet = focusedIsPrev ? nextControlsRef.current : prevControlsRef.current\n const oppositeStaysEnabled = focusedIsPrev ? !atEnd : !atStart\n const fallback = oppositeStaysEnabled ? Array.from(oppositeSet)[0] : null\n // `focused` is the control whose click (if any) just drove this redirect — `consumePointerClick`\n // reads (and clears) the pointer-vs-keyboard mark left on it, if `CarouselControlPrev`/\n // `CarouselControlNext` left one, so a stale mark from an earlier, unrelated interaction can't\n // leak into this one. See `focusRedirect`'s own comment for why this distinction matters\n // (Safari-only: a script-focused element still shows a ring there, unlike Chromium/Firefox).\n const viaPointer = consumePointerClick(focused)\n\n if (fallback) {\n focusRedirect(fallback, viaPointer, { preventScroll: true })\n return\n }\n\n if (viewportEl) {\n if (!viewportEl.hasAttribute('tabindex')) viewportEl.setAttribute('tabindex', '-1')\n focusRedirect(viewportEl, viaPointer, { preventScroll: true })\n }\n }, [atStart, atEnd, ends, playing, viewportEl])\n\n // Stable identity for the same reason as `registerViewport` above — the controls' own\n // registration effect depends on it.\n const registerControl = useCallback((kind: CarouselControlKind, element: HTMLButtonElement) => {\n const set = {\n next: nextControlsRef.current,\n play: playControlsRef.current,\n prev: prevControlsRef.current\n }[kind]\n set.add(element)\n return () => {\n set.delete(element)\n }\n }, [])\n\n // Compose rather than let a caller's handler silently replace the carousel's own — same rule\n // `CarouselControlButton`/`CarouselPlayPause` follow for `onClick`. These three sit on the\n // root element, so before this they were simply overwritten by the `{...rest}` spread below:\n // passing `onKeyDown` turned off arrow-key navigation and passing `onMouseEnter`/\n // `onMouseLeave` turned off pause-on-hover, both silently.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event)\n if (!keyboard) return\n const target = event.target as HTMLElement\n if (target.closest('input, textarea, select, [contenteditable=\"true\"]')) return\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return\n\n event.preventDefault()\n stopPlayingForGood()\n // The key that points where the next slide is: to the right, or to the left in a\n // right-to-left layout, as `directionBetween` reports the direction of travel.\n const nextKey = isRTL(event.currentTarget) ? 'ArrowLeft' : 'ArrowRight'\n if (event.key === nextKey) goNext()\n else goPrev()\n }\n\n const handleMouseEnter = (event: React.MouseEvent<HTMLDivElement>) => {\n onMouseEnter?.(event)\n if (pause === 'hover') pauseCycle()\n }\n\n const handleMouseLeave = (event: React.MouseEvent<HTMLDivElement>) => {\n onMouseLeave?.(event)\n if (pause === 'hover' && playing) startCycle()\n }\n\n const contextValue: CarouselContextProps = {\n activeIndex,\n atEnd,\n atStart,\n ends,\n itemCount,\n itemsVisible,\n next: () => {\n stopPlayingForGood()\n goNext()\n },\n playing,\n prev: () => {\n stopPlayingForGood()\n goPrev()\n },\n registerControl,\n registerViewport,\n to: (index: number) => {\n stopPlayingForGood()\n goTo(index)\n },\n togglePlayPause\n }\n\n const _className = classNames(\n 'carousel',\n {\n 'carousel-fade': isFade,\n 'carousel-center': center,\n 'carousel-auto': auto,\n 'carousel-playing': cycling\n },\n className\n )\n\n const _style = {\n ...style,\n ...(items != null && { '--cx-carousel-items': items }),\n ...(itemsGap != null && { '--cx-carousel-items-gap': itemsGap }),\n ...(itemsPeek != null && { '--cx-carousel-items-peek': itemsPeek })\n } as CSSProperties\n\n return (\n <div\n role=\"region\"\n aria-roledescription=\"carousel\"\n className={_className}\n style={_style}\n onKeyDown={handleKeyDown}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n {...rest}\n ref={forkedRef}\n >\n <CarouselContext.Provider value={contextValue}>{children}</CarouselContext.Provider>\n <VisuallyHidden role=\"status\">{liveMessage}</VisuallyHidden>\n </div>\n )\n }\n)\n\nCarousel.displayName = 'Carousel'\n\n// The slides of the first `CarouselInner` found in `children` (see `slides.tsx`), or 0 when they\n// can't be told from here: they are then counted from the DOM once the carousel has mounted.\nfunction countSlides(children: ReactNode): number {\n for (const child of Children.toArray(children)) {\n if (isElementOfType<{ children?: ReactNode }>(child, CarouselInner)) {\n const { nodes, positioned } = readSlides(child.props.children)\n return positioned ? nodes.length : 0\n }\n if (!isValidElement<{ children?: ReactNode }>(child)) continue\n const count = countSlides(child.props.children)\n if (count > 0) return count\n }\n return 0\n}\n","import React, { ButtonHTMLAttributes, forwardRef, useEffect, useRef } from 'react'\nimport classNames from 'classnames'\n\nimport { useForkedRef } from '../../hooks'\nimport { markPointerClick } from '../../utils/pointerInteraction'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../icon/iconSlot'\nimport { useCarouselContext } from './context'\nimport { VisuallyHidden } from '../visually-hidden/VisuallyHidden'\n\ninterface CarouselControlButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Which direction this control navigates, and which end-of-track state disables it.\n */\n direction: 'prev' | 'next'\n /**\n * The control's icon: an icon name, or an element of your own icon set. Defaults to\n * `IconProvider`'s `previous`/`next` icon.\n */\n icon?: IconValue\n /**\n * The accessible label announced by assistive technology.\n */\n label?: string\n}\n\n// Shared prev/next control, used by both CarouselControlPrev and CarouselControlNext — mirrors\n// how CalendarNavButton.tsx factors the same shape for Calendar/RangeCalendar.\nexport const CarouselControlButton = forwardRef<HTMLButtonElement, CarouselControlButtonProps>(\n ({ children, className, direction, disabled, icon, label, onClick, ...rest }, ref) => {\n const { atEnd, atStart, ends, next, prev, registerControl } = useCarouselContext()\n const buttonRef = useRef<HTMLButtonElement>(null)\n const forkedRef = useForkedRef(ref, buttonRef)\n\n useEffect(() => {\n const element = buttonRef.current\n if (!element) return undefined\n return registerControl(direction, element)\n }, [registerControl, direction])\n\n const atBoundary = direction === 'next' ? atEnd : atStart\n const navigate = direction === 'next' ? next : prev\n\n // Compose rather than let a caller's `onClick`/`disabled` silently replace navigation: the\n // carousel's own end-of-track state can only ever add a disable, and the click handler always\n // still navigates the carousel alongside whatever the caller's handler does.\n const isDisabled = disabled || (ends === 'stop' && atBoundary)\n const handleClick: typeof onClick = (event) => {\n onClick?.(event)\n if (event.detail !== 0) markPointerClick(event.currentTarget)\n navigate()\n }\n\n return (\n <button\n type=\"button\"\n className={classNames('button sm icon-only', className)}\n disabled={isDisabled}\n onClick={handleClick}\n {...rest}\n ref={forkedRef}\n >\n {children ?? (\n <>\n <IconSlot\n icon={direction === 'next' ? 'next' : 'previous'}\n override={icon}\n className=\"directional-icon\"\n />\n <VisuallyHidden>{label}</VisuallyHidden>\n </>\n )}\n </button>\n )\n }\n)\n\nCarouselControlButton.displayName = 'CarouselControlButton'\n","import React, { ButtonHTMLAttributes, forwardRef } from 'react'\n\nimport { IconValue } from '../../utils/iconConfig'\nimport { CarouselControlButton } from './CarouselControlButton'\n\nexport interface CarouselControlNextProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The control's icon: an icon name, or an element of your own icon set. Defaults to\n * `IconProvider`'s `next` icon.\n */\n icon?: IconValue\n /**\n * The accessible label announced by assistive technology.\n */\n label?: string\n}\n\nexport const CarouselControlNext = forwardRef<HTMLButtonElement, CarouselControlNextProps>(\n ({ label = 'Next slide', ...rest }, ref) => (\n <CarouselControlButton {...rest} direction=\"next\" label={label} ref={ref} />\n )\n)\n\nCarouselControlNext.displayName = 'CarouselControlNext'\n","import React, { ButtonHTMLAttributes, forwardRef } from 'react'\n\nimport { IconValue } from '../../utils/iconConfig'\nimport { CarouselControlButton } from './CarouselControlButton'\n\nexport interface CarouselControlPrevProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The control's icon: an icon name, or an element of your own icon set. Defaults to\n * `IconProvider`'s `previous` icon.\n */\n icon?: IconValue\n /**\n * The accessible label announced by assistive technology.\n */\n label?: string\n}\n\nexport const CarouselControlPrev = forwardRef<HTMLButtonElement, CarouselControlPrevProps>(\n ({ label = 'Previous slide', ...rest }, ref) => (\n <CarouselControlButton {...rest} direction=\"prev\" label={label} ref={ref} />\n )\n)\n\nCarouselControlPrev.displayName = 'CarouselControlPrev'\n","import React, { forwardRef, HTMLAttributes } from 'react'\nimport classNames from 'classnames'\n\nimport { useCarouselContext } from './context'\n\nexport interface CarouselIndicatorsProps extends HTMLAttributes<HTMLOListElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Accessible label for each indicator button. Receives the slide's 1-based position.\n */\n label?: (position: number) => string\n}\n\nexport const CarouselIndicators = forwardRef<HTMLOListElement, CarouselIndicatorsProps>(\n ({ className, label = (position) => `Slide ${position}`, ...rest }, ref) => {\n const { activeIndex, itemCount, itemsVisible, to } = useCarouselContext()\n const _className = classNames('carousel-indicators', className)\n // One indicator per reachable position, not per item — mirrors `navigate()`'s own clamping so\n // an indicator never targets an index the carousel can't actually land on (e.g. with\n // `items > 1`, the last few slides only ever appear alongside an earlier one).\n const indicatorCount = itemCount === 0 ? 0 : Math.max(1, itemCount - itemsVisible + 1)\n\n return (\n <ol className={_className} {...rest} ref={ref}>\n {Array.from({ length: indicatorCount }, (_, index) => index).map((index) => (\n <li key={index}>\n <button\n type=\"button\"\n className={index === activeIndex ? 'active' : undefined}\n aria-current={index === activeIndex ? 'true' : undefined}\n aria-label={label(index + 1)}\n onClick={() => to(index)}\n />\n </li>\n ))}\n </ol>\n )\n }\n)\n\nCarouselIndicators.displayName = 'CarouselIndicators'\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 CarouselOverlayOwnProps<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 CarouselOverlayProps<C extends ElementType = 'div'> = PolymorphicComponentProps<\n C,\n CarouselOverlayOwnProps<C>\n>\n\ntype CarouselOverlayComponent = (<C extends ElementType = 'div'>(\n props: CarouselOverlayProps<C> & { ref?: PolymorphicRef<C> }\n) => ReactElement | null) & { displayName?: string }\n\n/**\n * Overlays its children (typically controls and indicators) on top of the slides instead of\n * stacking them in the flow.\n */\nfunction CarouselOverlayRender<C extends ElementType = 'div'>(\n { children, className, component, ...rest }: CarouselOverlayProps<C>,\n ref: PolymorphicRef<C>\n) {\n const Component = component ?? 'div'\n const _className = classNames('carousel-overlay', className)\n\n return (\n <Component className={_className} {...rest} ref={ref}>\n {children}\n </Component>\n )\n}\n\nexport const CarouselOverlay = createPolymorphicComponent<CarouselOverlayComponent>(\n CarouselOverlayRender as ForwardRefRenderFunction<Element, CarouselOverlayProps<ElementType>>,\n 'CarouselOverlay'\n)\n","import React, { ButtonHTMLAttributes, forwardRef, useEffect, useRef } from 'react'\nimport classNames from 'classnames'\n\nimport { useForkedRef } from '../../hooks'\nimport { IconValue } from '../../utils/iconConfig'\nimport { IconSlot } from '../icon/iconSlot'\nimport { useCarouselContext } from './context'\n\nexport interface CarouselPlayPauseProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The icon shown while autoplay is running: an icon name, or an element of your own icon set.\n * Defaults to `IconProvider`'s `pause` icon.\n */\n pauseIcon?: IconValue\n /**\n * The accessible label announced while autoplay is running.\n */\n pauseLabel?: string\n /**\n * The accessible label announced while autoplay is stopped.\n */\n playLabel?: string\n /**\n * The icon shown while autoplay is stopped: an icon name, or an element of your own icon set.\n * Defaults to `IconProvider`'s `play` icon.\n */\n playIcon?: IconValue\n}\n\n/**\n * A discoverable toggle so a viewer can stop an autoplaying carousel, as required by WCAG 2.2\n * Success Criterion 2.2.2 (Pause, Stop, Hide). Reflects the current state automatically — a pause\n * icon while playing, a play icon once stopped. On the last slide of an `ends=\"stop\"` carousel\n * there is nothing left to play, and the stopped toggle is disabled, as the next control is.\n */\nexport const CarouselPlayPause = forwardRef<HTMLButtonElement, CarouselPlayPauseProps>(\n (\n {\n children,\n className,\n disabled,\n onClick,\n pauseIcon,\n pauseLabel = 'Pause',\n playIcon,\n playLabel = 'Play',\n ...rest\n },\n ref\n ) => {\n const { atEnd, ends, playing, registerControl, togglePlayPause } = useCarouselContext()\n const buttonRef = useRef<HTMLButtonElement>(null)\n const forkedRef = useForkedRef(ref, buttonRef)\n\n // Registered as the previous and next controls are, so the carousel moves focus off it when\n // the end of the track disables it.\n useEffect(() => {\n const element = buttonRef.current\n if (!element) return undefined\n return registerControl('play', element)\n }, [registerControl])\n\n // Pressed on the last slide of `ends=\"stop\"`, Play started a cycle with no slide to go to.\n // Disabled there as the next control is, and only once stopped: while autoplay runs the\n // toggle is the way to pause it (WCAG 2.2.2). Composed with the caller's own `disabled`,\n // which the carousel's state can only add to.\n const isDisabled = disabled || (ends === 'stop' && atEnd && !playing)\n const _className = classNames(\n 'carousel-control-play-pause button sm icon-only',\n { paused: !playing },\n className\n )\n // Compose rather than let a caller's `onClick` silently replace the toggle.\n const handleClick: typeof onClick = (event) => {\n onClick?.(event)\n togglePlayPause()\n }\n\n return (\n <button\n type=\"button\"\n className={_className}\n aria-label={playing ? pauseLabel : playLabel}\n disabled={isDisabled}\n onClick={handleClick}\n {...rest}\n ref={forkedRef}\n >\n {children ?? (\n <>\n <IconSlot icon=\"pause\" override={pauseIcon} className=\"carousel-icon-pause\" />\n <IconSlot icon=\"play\" override={playIcon} className=\"carousel-icon-play\" />\n </>\n )}\n </button>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B,CACE,WACA,YACA,WACA,UACA,YACA,aAAa,QACb,WACA,YAAY,OACZ,GAAG5B,GAEL,IACG,CACH,GAAM,CAAE,QAAO,OAAM,UAAS,kBAAiB,mBAAoBhD,EAAmB,EAChFwN,EAAYxI,EAA0B,IAAI,EAC1CV,EAAYzF,EAAa0F,EAAKiJ,CAAS,EAI7C7E,MAAgB,CACd,IAAMpI,EAAUiN,EAAU,QAC1B,GAAKjN,EACL,OAAO8L,EAAgB,OAAQ9L,CAAO,CACxC,EAAG,CAAC8L,CAAe,CAAC,EAMpB,IAAMsB,EAAaC,GAAa1F,IAAS,QAAUxB,GAAS,CAACP,EACvD5C,EAAa/D,EACjB,kDACA,CAAE,OAAQ,CAAC2G,CAAQ,EACnB3C,CACF,EAOA,MACE,kBAAA,cAAC,SAAD,CACE,KAAK,SACL,UAAWD,EACX,aAAY4C,EAAUmI,EAAaC,EACnC,SAAUZ,EACV,QAXiC,GAAU,CAC7CE,IAAU1E,CAAK,EACf0C,EAAgB,CAClB,EASI,GAAI7I,EACJ,IAAKsB,CAQC,EANLZ,GACC,kBAAA,cAAAnE,EAAA,SAAA,KACE,kBAAA,cAACH,EAAD,CAAU,KAAK,QAAQ,SAAUoP,EAAW,UAAU,qBAAuB,CAAA,EAC7E,kBAAA,cAACpP,EAAD,CAAU,KAAK,OAAO,SAAUqP,EAAU,UAAU,oBAAsB,CAAA,CAC1E,CAEE,CAEZ,CACF,EAEA,GAAkB,YAAc,oB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-Bs80iIBN.js";import{C as e,S as t,c as n}from"./slot-DagH0Gxq.js";import{t as r}from"./useForkedRef-WoqMqsWE.js";import{t as i}from"./useHeldBack-o-CsPcSe.js";import{n as a,t as o}from"./FormHelp-2U3P8C6b.js";import{t as s}from"./validationClassName-gRGs4KBm.js";import{t as c}from"./renderFormCheck-DvpfK_I4.js";import{n as l,r as u}from"./unhandledProps-9Kdj7WVf.js";import{t as d}from"./flex-C6CbAkVJ.js";import f,{createContext as p,forwardRef as m,useContext as h,useEffect as g,useRef as _}from"react";import v from"classnames";import{useCheckbox as y,useCheckboxGroup as b,useCheckboxGroupItem as x}from"react-aria";import{useCheckboxGroupState as S,useToggleState as C}from"react-stately";const w=p(null),T=m(({button:e,children:t,className:n,color:a,defaultSelected:o,disabled:d,id:p,indeterminate:m,invalid:h,isSelected:g,label:b,onChange:x,readOnly:S,size:w,style:T,valid:E,...D},O)=>{let k=_(null),A=r(O,k),{invalid:j,valid:M}=i(k,{invalid:h,valid:E}),N=C({defaultSelected:o,isDisabled:d,isReadOnly:S,isSelected:g,onChange:x}),P=b??t,{inputProps:F}=y({...D,children:P,isDisabled:d,isIndeterminate:m,isInvalid:j,isReadOnly:S,value:D.value},N,k),I=v(s(j,M));return c({button:e,className:n,color:a,input:/* @__PURE__ */ f.createElement(`input`,{...u(F,D,l),"aria-describedby":D[`aria-describedby`],className:I,id:p,ref:A}),invalid:j,label:P,size:w,style:T,valid:M})});T.displayName=`CheckboxStandalone`;const E=m(({button:i,children:a,className:o,color:d,defaultSelected:p,disabled:m,groupDescribedBy:h,groupState:y,groupValid:b,id:S,indeterminate:C,invalid:w,isSelected:T,label:E,onChange:D,readOnly:O,size:k,style:A,valid:j,...M},N)=>{let P=w??y.isInvalid,F=j??b,I=_(null),L=r(N,I);g(()=>{t(!M.value,"Checkbox: a `value` prop is required when rendered inside a CheckboxGroup."),e(p!==void 0||T!==void 0||D!==void 0,"Checkbox: `defaultSelected`, `isSelected`, and `onChange` are ignored inside a CheckboxGroup — selection is owned by the group's `value`/`defaultValue`/`onChange`.")},[]);let R=E??a,{inputProps:z}=x({...M,children:R,isDisabled:m,isIndeterminate:C,isInvalid:w,isReadOnly:O,value:M.value},y,I),B=v(s(P,F));return c({button:i,className:o,color:d,input:/* @__PURE__ */ f.createElement(`input`,{...u(z,M,l),"aria-describedby":n(M[`aria-describedby`],h),"aria-required":void 0,className:B,id:S,ref:L,required:M.required??(y.isRequired||void 0)}),invalid:P,label:R,size:k,style:A,valid:F})});E.displayName=`CheckboxGroupItem`;const D=m((e,t)=>{let n=h(w);return n?/* @__PURE__ */ f.createElement(E,{...e,groupDescribedBy:n.describedBy,groupState:n.state,groupValid:n.valid,ref:t}):/* @__PURE__ */ f.createElement(T,{...e,ref:t})});D.displayName=`Checkbox`;const O=m(({children:e,className:t,defaultValue:c,description:l,disabled:u,errorMessage:p,form:m,invalid:h,label:g,name:y,onChange:x,orientation:C,required:T,valid:E,value:D,...O},k)=>{let A=_(null),j=r(k,A),{invalid:M,valid:N}=i(A,{invalid:h,valid:E}),P={...O,defaultValue:c,description:l,errorMessage:p,form:m,isDisabled:u,isInvalid:M,isRequired:T,label:g,name:y,onChange:x,value:D},F=S(P),{groupProps:I,labelProps:L,descriptionProps:R,errorMessageProps:z}=b(P,F),B=v(`form-field`,s(M,N),t),V=n(!!l&&R.id,!!(M&&p)&&z.id),H=/* @__PURE__ */ f.createElement(w.Provider,{value:{describedBy:V,state:F,valid:N}},e);return/* @__PURE__ */ f.createElement(`fieldset`,{...O,...I,"aria-describedby":n(V,O[`aria-describedby`]),className:B,form:m,ref:j},g&&/* @__PURE__ */ f.createElement(`legend`,{className:`form-label`,...L},g),C===`horizontal`?/* @__PURE__ */ f.createElement(d,{wrap:`wrap`,gap:`md`},H):H,l&&/* @__PURE__ */ f.createElement(o,R,l),M&&p&&/* @__PURE__ */ f.createElement(a,{invalid:!0,...z},p))});O.displayName=`CheckboxGroup`;export{D as n,O as t};
|
|
2
|
+
//# sourceMappingURL=checkbox-5jv0YWoi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-5jv0YWoi.js","names":["devWarning","devError","joinIds","useForkedRef","useHeldBack","FormFeedback","FormHelp","validationClassName","renderFormCheck","TOGGLE_PROPS","mergeUnhandledProps","Flex","React","classNames","CheckboxGroupContext","createContext","CheckboxStandalone","forwardRef","invalidProp","validProp","rest","inputRef","useRef","forkedRef","ref","toggleState","useToggleState","disabled","readOnly","resolvedLabel","label","children","useCheckbox","indeterminate","invalid","inputClassName","valid","inputProps","CheckboxGroupItem","_defaultSelected","itemInvalid","_isSelected","_onChange","itemValid","groupState","groupValid","useEffect","useCheckboxGroupItem","groupDescribedBy","Checkbox","group","useContext","props","CheckboxGroup","fieldsetRef","groupProps","required","state","useCheckboxGroupState","ariaGroupProps","useCheckboxGroup","_className","className","describedBy","description","descriptionProps","errorMessage","errorMessageProps","items","labelProps","orientation"],"sources":["../../src/components/checkbox/context.ts","../../src/components/checkbox/Checkbox.tsx","../../src/components/checkbox/CheckboxGroup.tsx"],"sourcesContent":["import { createContext } from 'react'\nimport { CheckboxGroupState } from 'react-stately'\n\nexport interface CheckboxGroupContextValue {\n state: CheckboxGroupState\n /**\n * `CheckboxGroup`'s own `valid` prop, mirrored here since it has no react-stately equivalent to\n * read off `state` the way `isInvalid` does — each `Checkbox` needs it to apply its own\n * `is-valid` class when the item doesn't set its own (same pattern as `RadioGroupContext`).\n */\n valid?: boolean\n /**\n * The ids of the group's description and error message, when they are rendered. Each item is\n * described by them too.\n */\n describedBy?: string\n}\n\nexport const CheckboxGroupContext = createContext<CheckboxGroupContextValue | null>(null)\n","import React, {\n forwardRef,\n InputHTMLAttributes,\n ReactNode,\n useContext,\n useEffect,\n useRef\n} from 'react'\nimport classNames from 'classnames'\nimport {\n AriaCheckboxGroupItemProps,\n AriaCheckboxProps,\n useCheckbox,\n useCheckboxGroupItem\n} from 'react-aria'\nimport { CheckboxGroupState, useToggleState } from 'react-stately'\n\nimport { useForkedRef, useHeldBack } from '../../hooks'\nimport { ContextColor } from '../../types'\nimport { validationClassName } from '../../utils/validationClassName'\n\nimport { CheckboxGroupContext } from './context'\nimport { ButtonObject, renderFormCheck } from '../form/renderFormCheck'\nimport { devError, devWarning } from '../../utils/devWarning'\nimport { joinIds } from '../../utils/idRefs'\nimport { mergeUnhandledProps, TOGGLE_PROPS } from '../../utils/unhandledProps'\n\nexport type { ButtonObject } from '../form/renderFormCheck'\n\nexport interface CheckboxProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'checked' | 'defaultChecked' | 'onChange' | 'size'\n> {\n /**\n * Create button-like checkboxes.\n */\n button?: ButtonObject\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * Sets the color of the check indicator to one of Chassis context colors. Ignored when `button` is set.\n */\n color?: ContextColor\n /**\n * Whether the checkbox is selected, uncontrolled. Ignored when rendered inside a `<CheckboxGroup>` —\n * the group's `value`/`defaultValue` owns selection there.\n */\n defaultSelected?: boolean\n /**\n * The id global attribute defines an identifier (ID) that must be unique in the whole document.\n */\n id?: string\n /**\n * Checkbox indeterminate property.\n */\n indeterminate?: boolean\n /**\n * Set component validation state to invalid. Left unset, the component shows as invalid by itself\n * from a submit it held back (an empty `required` one, say) until it no longer would, or its\n * form is reset. Set it, to `false` too, and it alone decides.\n */\n invalid?: boolean\n /**\n * Whether the checkbox is selected, controlled. Ignored when rendered inside a `<CheckboxGroup>` —\n * the group's `value`/`defaultValue` owns selection there.\n */\n isSelected?: boolean\n /**\n * The element represents a caption for a component.\n *\n * Children are accepted as an alias for this prop — `label` wins when both are given.\n * react-aria, which backs this component, calls the same thing `children`; this package renames\n * it to `label`, and honouring both means the shape React developers reach for first still\n * names the control instead of silently producing an unlabelled one.\n */\n label?: ReactNode\n /**\n * Callback fired when the selected state changes. Ignored when rendered inside a `<CheckboxGroup>` —\n * use the group's `onChange` instead.\n */\n onChange?: (isSelected: boolean) => void\n /**\n * Toggle the read-only state: the control keeps its state, can still be focused, and says it\n * is read-only (`aria-readonly`).\n */\n readOnly?: boolean\n /**\n * Size the component sm or lg.\n */\n size?: 'sm' | 'lg'\n /**\n * Set component validation state to valid.\n */\n valid?: boolean\n /**\n * The value of the checkbox, used when submitting an HTML form. Required when rendered inside a\n * `<CheckboxGroup>` — it identifies this item within the group's selected values.\n */\n value?: string\n}\n\nconst CheckboxStandalone = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n button,\n children,\n className,\n color,\n defaultSelected,\n disabled,\n id,\n indeterminate,\n invalid: invalidProp,\n isSelected,\n label,\n onChange,\n readOnly,\n size,\n style,\n valid: validProp,\n ...rest\n },\n ref\n ) => {\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n // Shown as invalid from a submit it held back until it no longer would (`useHeldBack`):\n // react-aria cancels the browser's own message, and the form stayed with nothing to say why.\n const { invalid, valid } = useHeldBack(inputRef, { invalid: invalidProp, valid: validProp })\n\n // `readOnly` goes to react-aria, which keeps the box as it is and writes `aria-readonly`: a\n // browser ignores the native attribute on a checkbox, which still toggled.\n const toggleState = useToggleState({\n defaultSelected,\n isDisabled: disabled,\n isReadOnly: readOnly,\n isSelected,\n onChange\n })\n\n // `label` is this package's name for what react-aria calls `children`. Accept either, so the\n // shape React developers reach for first names the control instead of vanishing.\n const resolvedLabel = label ?? children\n\n const { inputProps } = useCheckbox(\n {\n ...rest,\n children: resolvedLabel,\n isDisabled: disabled,\n isIndeterminate: indeterminate,\n isInvalid: invalid,\n isReadOnly: readOnly,\n value: rest.value as string | undefined\n } as AriaCheckboxProps,\n toggleState,\n inputRef\n )\n\n const inputClassName = classNames(validationClassName(invalid, valid))\n\n return renderFormCheck({\n button,\n className,\n color,\n // `aria-describedby` after the spread: react-aria's own adds ids it never renders (FORMS.md,\n // gotcha 6).\n input: (\n <input\n {...mergeUnhandledProps(inputProps, rest, TOGGLE_PROPS)}\n aria-describedby={rest['aria-describedby']}\n className={inputClassName}\n id={id}\n ref={forkedRef}\n />\n ),\n invalid,\n label: resolvedLabel,\n size,\n style,\n valid\n })\n }\n)\nCheckboxStandalone.displayName = 'CheckboxStandalone'\n\ninterface CheckboxGroupItemProps extends CheckboxProps {\n groupDescribedBy?: string\n groupState: CheckboxGroupState\n groupValid?: boolean\n}\n\nconst CheckboxGroupItem = forwardRef<HTMLInputElement, CheckboxGroupItemProps>(\n (\n {\n button,\n children,\n className,\n color,\n defaultSelected: _defaultSelected,\n disabled,\n groupDescribedBy,\n groupState,\n groupValid,\n id,\n indeterminate,\n invalid: itemInvalid,\n isSelected: _isSelected,\n label,\n onChange: _onChange,\n readOnly,\n size,\n style,\n valid: itemValid,\n ...rest\n },\n ref\n ) => {\n // The group's own invalid/valid cascades to every item, same as RadioGroup does for Radio —\n // but an item can still override it with its own invalid/valid, since (unlike a lone Radio) a\n // lone Checkbox's validity is independently meaningful (see FORMS.md).\n const invalid = itemInvalid ?? groupState.isInvalid\n const valid = itemValid ?? groupValid\n const inputRef = useRef<HTMLInputElement>(null)\n const forkedRef = useForkedRef(ref, inputRef)\n\n // Once per mount, not on every render — these are dev-time misuse warnings, not something\n // that needs to re-fire for every keystroke a parent's re-render happens to cause.\n useEffect(() => {\n devError(\n !rest.value,\n 'Checkbox: a `value` prop is required when rendered inside a CheckboxGroup.'\n )\n devWarning(\n _defaultSelected !== undefined || _isSelected !== undefined || _onChange !== undefined,\n 'Checkbox: `defaultSelected`, `isSelected`, and `onChange` are ignored inside a ' +\n \"CheckboxGroup — selection is owned by the group's `value`/`defaultValue`/`onChange`.\"\n )\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // `label` is this package's name for what react-aria calls `children`. Accept either, so the\n // shape React developers reach for first names the control instead of vanishing.\n const resolvedLabel = label ?? children\n\n const { inputProps } = useCheckboxGroupItem(\n {\n ...rest,\n children: resolvedLabel,\n isDisabled: disabled,\n isIndeterminate: indeterminate,\n // The item's own `invalid`, not the group's read back from `groupState`: react-aria\n // registers an invalid item with the group, whose state then stays invalid for as long\n // as the item is, so a group's `invalid` handed back to its items never came off them\n // again. The hook shows the group's state on each item by itself.\n isInvalid: itemInvalid,\n isReadOnly: readOnly,\n value: rest.value as string\n } as AriaCheckboxGroupItemProps,\n groupState,\n inputRef\n )\n\n const inputClassName = classNames(validationClassName(invalid, valid))\n\n return renderFormCheck({\n button,\n className,\n color,\n // Described by the group's description and error message, as react-aria intends, but only\n // by those the group renders (FORMS.md, gotcha 6).\n input: (\n <input\n {...mergeUnhandledProps(inputProps, rest, TOGGLE_PROPS)}\n aria-describedby={joinIds(rest['aria-describedby'], groupDescribedBy)}\n // The native `required` below says the same.\n aria-required={undefined}\n className={inputClassName}\n id={id}\n ref={forkedRef}\n // A required group asks for one of its checkboxes, which HTML has no attribute for:\n // every checkbox is required while none is selected, as react-aria's own native\n // validation does it (`groupState.isRequired` is false once one is). react-aria writes\n // `aria-required` alone, which no form checks.\n required={rest.required ?? (groupState.isRequired || undefined)}\n />\n ),\n invalid,\n label: resolvedLabel,\n size,\n style,\n valid\n })\n }\n)\nCheckboxGroupItem.displayName = 'CheckboxGroupItem'\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {\n const group = useContext(CheckboxGroupContext)\n return group ? (\n <CheckboxGroupItem\n {...props}\n groupDescribedBy={group.describedBy}\n groupState={group.state}\n groupValid={group.valid}\n ref={ref}\n />\n ) : (\n <CheckboxStandalone {...props} ref={ref} />\n )\n})\n\nCheckbox.displayName = 'Checkbox'\n","import React, { forwardRef, HTMLAttributes, ReactNode, useRef } from 'react'\nimport classNames from 'classnames'\nimport { AriaCheckboxGroupProps, useCheckboxGroup } from 'react-aria'\nimport { useCheckboxGroupState } from 'react-stately'\n\nimport { useForkedRef, useHeldBack } from '../../hooks'\nimport { validationClassName } from '../../utils/validationClassName'\nimport { joinIds } from '../../utils/idRefs'\n\nimport { CheckboxGroupContext } from './context'\nimport { FormFeedback } from '../form/FormFeedback'\nimport { FormHelp } from '../form/FormHelp'\nimport { Flex } from '../flex'\n\nexport interface CheckboxGroupProps extends Omit<\n HTMLAttributes<HTMLFieldSetElement>,\n 'defaultValue' | 'onChange'\n> {\n /**\n * One or more `<Checkbox>` elements.\n */\n children: ReactNode\n /**\n * A string of all className you want applied to the component.\n */\n className?: string\n /**\n * The selected values, uncontrolled.\n */\n defaultValue?: string[]\n /**\n * A description for the group, rendered below the options.\n */\n description?: ReactNode\n /**\n * Disables every checkbox in the group.\n */\n disabled?: boolean\n /**\n * An error message for the group, rendered below the options when `invalid` is set, and after\n * a submit the group held back, until it no longer would.\n */\n errorMessage?: ReactNode\n /**\n * The id of the `<form>` the group belongs to, for a group rendered outside it. Reaches every\n * checkbox; a `Checkbox` with its own `form` keeps it.\n */\n form?: string\n /**\n * Set group validation state to invalid. Left unset, the group shows as invalid by itself\n * from a submit it held back (an empty `required` one, say) until it no longer would, or its\n * form is reset. Set it, to `false` too, and it alone decides.\n */\n invalid?: boolean\n /**\n * The group's caption, rendered as a `<legend>`.\n */\n label?: ReactNode\n /**\n * The name for the group, used for native form submission.\n */\n name?: string\n /**\n * Callback fired when the selected values change.\n */\n onChange?: (value: string[]) => void\n /**\n * Lay the group's checkboxes out on the same horizontal row instead of stacking them.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * Requires at least one checkbox of the group. While none is selected each carries the native\n * `required`, so a form isn't submitted until one is; a `Checkbox` with its own `required`\n * stays required whatever the others are.\n */\n required?: boolean\n /**\n * Set group validation state to valid.\n */\n valid?: boolean\n /**\n * The selected values, controlled.\n */\n value?: string[]\n}\n\nexport const CheckboxGroup = forwardRef<HTMLFieldSetElement, CheckboxGroupProps>(\n (\n {\n children,\n className,\n defaultValue,\n description,\n disabled,\n errorMessage,\n form,\n invalid: invalidProp,\n label,\n name,\n onChange,\n orientation,\n required,\n valid: validProp,\n value,\n ...rest\n },\n ref\n ) => {\n const fieldsetRef = useRef<HTMLFieldSetElement>(null)\n const forkedRef = useForkedRef(ref, fieldsetRef)\n // Shown as invalid from a submit it held back until it no longer would (`useHeldBack`):\n // react-aria cancels the browser's own message, and the form stayed with nothing to say why.\n // The fieldset hears every checkbox, and the group shows it for them all, with `errorMessage`.\n const { invalid, valid } = useHeldBack(fieldsetRef, { invalid: invalidProp, valid: validProp })\n\n const groupProps = {\n ...rest,\n defaultValue,\n description,\n errorMessage,\n form,\n isDisabled: disabled,\n isInvalid: invalid,\n isRequired: required,\n label,\n name,\n onChange,\n value\n }\n\n const state = useCheckboxGroupState(groupProps)\n const {\n groupProps: ariaGroupProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useCheckboxGroup(groupProps as AriaCheckboxGroupProps, state)\n\n const _className = classNames('form-field', validationClassName(invalid, valid), className)\n\n // Only the ids this group renders. react-aria's own describe the group and every item by a\n // description and an error message whether or not they exist (FORMS.md, gotcha 6).\n const describedBy = joinIds(\n Boolean(description) && descriptionProps.id,\n Boolean(invalid && errorMessage) && errorMessageProps.id\n )\n\n const items = (\n <CheckboxGroupContext.Provider value={{ describedBy, state, valid }}>\n {children}\n </CheckboxGroupContext.Provider>\n )\n\n return (\n <fieldset\n {...rest}\n {...ariaGroupProps}\n aria-describedby={joinIds(describedBy, rest['aria-describedby'])}\n className={_className}\n // The fieldset's own form owner. react-aria hands the group's `form` to each of its\n // checkboxes, under one that has its own.\n form={form}\n ref={forkedRef}\n >\n {label && (\n <legend className=\"form-label\" {...labelProps}>\n {label}\n </legend>\n )}\n {orientation === 'horizontal' ? (\n <Flex wrap=\"wrap\" gap=\"md\">\n {items}\n </Flex>\n ) : (\n items\n )}\n {description && <FormHelp {...descriptionProps}>{description}</FormHelp>}\n {invalid && errorMessage && (\n <FormFeedback invalid {...errorMessageProps}>\n {errorMessage}\n </FormFeedback>\n )}\n </fieldset>\n )\n }\n)\n\nCheckboxGroup.displayName = 'CheckboxGroup'\n"],"mappings":"A,6sBAkBA,MAAac,EAAuBC,EAAgD,IAAI,ECqFlFC,EAAqBC,GAEvB,CACE,SACA,WACA,YACA,QACA,kBACA,WACA,KACA,gBACA,QAASC,EACT,aACA,QACA,WACA,WACA,OACA,QACA,MAAOC,EACP,GAAGC,GAEL,IACG,CACH,IAAMC,EAAWC,EAAyB,IAAI,EACxCC,EAAYpB,EAAaqB,EAAKH,CAAQ,EAGtC,CAAE,UAAS,SAAUjB,EAAYiB,EAAU,CAAE,QAASH,EAAa,MAAOC,CAAU,CAAC,EAIrFM,EAAcC,EAAe,CACjC,kBACA,WAAYC,EAC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AQ/B,GAAWgC,IAAiBC,EAAkB,EACxD,EAEMC,EACJ,kBAAA,cAACtD,EAAqB,SAAtB,CAA+B,MAAO,CAAE,cAAa,QAAO,OAAM,CAEnC,EAD5BiB,CAC4B,EAGjC,MACE,kBAAA,cAAC,WAAD,CACE,GAAIX,EACJ,GAAIuC,EACJ,mBAAkBzD,EAAQ6D,EAAa3C,EAAK,mBAAmB,EAC/D,UAAWyC,EAGL,OACN,IAAKtC,CAoBG,EAlBPO,GACC,kBAAA,cAAC,SAAD,CAAQ,UAAU,aAAa,GAAIuC,CAE3B,EADLvC,CACK,EAETwC,IAAgB,aACf,kBAAA,cAAC3D,EAAD,CAAM,KAAK,OAAO,IAAI,IAEhB,EADHyD,CACG,EAENA,EAEDJ,GAAe,kBAAA,cAAC1D,EAAa2D,EAAmBD,CAAsB,EACtE9B,GAAWgC,GACV,kBAAA,cAAC7D,EAAD,CAAc,QAAA,GAAQ,GAAI8D,CAEZ,EADXD,CACW,CAER,CAEd,CACF,EAEA,EAAc,YAAc,gB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./focus-ring-Bs80iIBN.js";import{t as e}from"./useForkedRef-WoqMqsWE.js";import{t}from"./useControllableState-CPUJxfKW.js";import{t as n}from"./useIsomorphicLayoutEffect-BbqRwuqn.js";import{t as r}from"./useFormField-q21MOgh8.js";import{t as i}from"./useFormReset-BK5Yb24_.js";import{t as a}from"./useHeldBack-o-CsPcSe.js";import{t as o}from"./renderFormField-CaZ8-xrn.js";import{t as s}from"./CloseButton-CAQ--0sB.js";import{t as c}from"./direction-LN6uwsK5.js";import{t as l}from"./validationClassName-gRGs4KBm.js";import{t as u}from"./Chip-CXuYhjc3.js";import d,{forwardRef as f,useMemo as p,useRef as m,useState as h}from"react";import g from"classnames";import{mergeProps as _,useButton as v,useTag as y,useTagGroup as b,useTextField as ee}from"react-aria";import{Item as te,useListState as ne}from"react-stately";const re=({chipVariant:e,disabled:t,groupRef:n,onEmptyFocus:r,props:i,size:a,state:o})=>{let{gridProps:s}=b(i,o,n),c=o.collection.size===0;return/* @__PURE__ */ d.createElement(`div`,{..._(s,{onFocus:e=>{c&&e.target===e.currentTarget&&r()}}),"aria-describedby":void 0,"aria-multiselectable":s.role===`grid`?s[`aria-multiselectable`]:void 0,tabIndex:c?-1:s.tabIndex,style:{display:`contents`},ref:n},[...o.collection].map(n=>/* @__PURE__ */ d.createElement(x,{chipVariant:e,disabled:t,item:n,key:n.key,size:a,state:o})))},x=({chipVariant:e,disabled:t,item:n,size:r,state:i})=>{let a=m(null),{rowProps:o,gridCellProps:c,removeButtonProps:l,allowsRemoving:f}=y({item:n},i,a),p=m(null),{buttonProps:h}=v(l,p);return/* @__PURE__ */ d.createElement(u,{...o,"aria-labelledby":void 0,className:g(e,{active:i.selectionManager.isSelected(n.key)}),component:`div`,disabled:t,ref:a,size:r},/* @__PURE__ */ d.createElement(`div`,{...c,style:{display:`contents`}},n.rendered,f&&/* @__PURE__ */ d.createElement(s,{...h,ref:p})))},ie=e=>{let t=/* @__PURE__ */ new Map;return e.map(e=>{let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}\u0000${n}`})},S=f(({allowDuplicates:s=!1,"aria-describedby":u,"aria-label":f,"aria-labelledby":_,chipVariant:v=`default`,className:y,defaultValue:b,disabled:x,help:S,id:C,invalid:ae,invalidFeedback:w,label:T,maxChips:E,name:D,onChange:O,placeholder:oe,required:k,separator:A=`,`,size:j,valid:se,validFeedback:M,value:N,...ce},le)=>{let[P,F]=t(N,b??[],O),I=p(()=>ie(P),[P]),L=(e,t)=>t!==``&&(s||!e.includes(t)),R=()=>{if(E!=null&&P.length>=E)return;let e=W.trim();L(P,e)&&F([...P,e]),G(``)},ue=e=>{let t=new Set(e);F(P.filter((e,n)=>!t.has(I[n])))},z=p(()=>P.map((e,t)=>({id:I[t],value:e})),[P,I]),B=ne({children:e=>/* @__PURE__ */ d.createElement(te,{key:e.id,textValue:e.value},e.value),disabledKeys:x?z.map(e=>e.id):void 0,items:z,selectionMode:`multiple`}),V=m(null),H=m(null),de=e(le,H),U=m(null),[W,G]=h(``);i(H,N??b??[],e=>{F(e),G(``)});let K=!!k&&P.length===0;n(()=>{U.current?.setCustomValidity(K?`Add a chip.`:``)});let{invalid:q,valid:J}=a(U,{invalid:ae,valid:se}),Y=e=>{if(P.length===0)return;let t=I[I.length-1];e?B.selectionManager.extendSelection(t):B.selectionManager.replaceSelection(t);let n=V.current?.querySelectorAll(`[role="row"]`);n?.[n.length-1]?.focus()},fe=e=>{if(!x){if(A&&e.key===A)e.preventDefault(),R();else switch(e.key){case`Enter`:e.preventDefault(),R();break;case`Backspace`:case`Delete`:W===``&&(e.preventDefault(),Y(!1));break;case`ArrowLeft`:case`ArrowRight`:{let t=U.current;if(!t)break;e.key===`ArrowLeft`!==c(t)&&t.selectionStart===0&&t.selectionEnd===0&&(e.preventDefault(),Y(e.shiftKey));break}case`Escape`:G(``),B.selectionManager.clearSelection(),U.current?.blur()}}},pe=e=>{if(x||!A)return;let t=e.clipboardData.getData(`text`);if(!t.includes(A))return;e.preventDefault();let n=t.split(A),r=P,i=0;for(;i<n.length-1&&!(E!=null&&r.length>=E);i++){let e=n[i].trim();L(r,e)&&(r=[...r,e])}r!==P&&F(r),G(n.slice(i).join(A))},{describedBy:X,feedbackId:me,helpId:he,inputId:Z,labelId:ge,labelledBy:Q}=r({ariaDescribedBy:u,ariaLabelledBy:_,help:S,id:C,invalid:q,invalidFeedback:w,label:T,valid:J,validFeedback:M}),{inputProps:$}=ee({"aria-describedby":X,"aria-label":f??(Q?void 0:`Add value`),"aria-labelledby":Q,id:Z,isDisabled:x,isInvalid:q,isRequired:k,onChange:G,onFocus:()=>B.selectionManager.clearSelection(),onKeyDown:fe,placeholder:oe,value:W},U);return o({children:/* @__PURE__ */ d.createElement(`div`,{className:g(`form-input`,`chip-input`,j,{disabled:x},l(q,J),y),...ce,ref:de},/* @__PURE__ */ d.createElement(re,{chipVariant:v,disabled:x,groupRef:V,onEmptyFocus:()=>U.current?.focus(),props:{"aria-label":f,"aria-labelledby":Q,onRemove:x?void 0:ue},size:j,state:B}),/* @__PURE__ */ d.createElement(`input`,{...$,"aria-describedby":X,"aria-required":K?void 0:$[`aria-required`],className:`ghost-input`,onPaste:pe,ref:U,required:K||void 0}),D&&z.map(e=>/* @__PURE__ */ d.createElement(`input`,{disabled:x,key:e.id,name:D,type:`hidden`,value:e.value}))),help:S,ids:{feedback:me,help:he,input:Z,label:ge},invalid:q,invalidFeedback:w,label:T,valid:J,validFeedback:M})});S.displayName=`ChipInput`;export{S as t};
|
|
2
|
+
//# sourceMappingURL=chip-input-D8EaNujM.js.map
|