@techzyapp/ui-library 1.0.49 → 1.0.51
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/dist/{Accordion-DOrTQJB9.js → Accordion-C6vW_OMd.js} +2 -2
- package/dist/{Accordion-DOrTQJB9.js.map → Accordion-C6vW_OMd.js.map} +1 -1
- package/dist/{Accordion-CFyeLfPT.cjs → Accordion-Icvl9S8c.cjs} +2 -2
- package/dist/{Accordion-CFyeLfPT.cjs.map → Accordion-Icvl9S8c.cjs.map} +1 -1
- package/dist/{AdminRoot-CGf-Q8Hs.cjs → AdminRoot-CFDMjB1A.cjs} +2 -2
- package/dist/{AdminRoot-CGf-Q8Hs.cjs.map → AdminRoot-CFDMjB1A.cjs.map} +1 -1
- package/dist/{AdminRoot-DYM9r25r.js → AdminRoot-D4GGvprQ.js} +9 -9
- package/dist/{AdminRoot-DYM9r25r.js.map → AdminRoot-D4GGvprQ.js.map} +1 -1
- package/dist/{Alert-QvfNBhlU.cjs → Alert-CC4gxX9w.cjs} +2 -2
- package/dist/{Alert-QvfNBhlU.cjs.map → Alert-CC4gxX9w.cjs.map} +1 -1
- package/dist/{Alert-Bo_XgY-A.js → Alert-D56N-LeR.js} +4 -4
- package/dist/{Alert-Bo_XgY-A.js.map → Alert-D56N-LeR.js.map} +1 -1
- package/dist/{AuthGuard-Ck31lvBA.js → AuthGuard-D6_sTASu.js} +2 -2
- package/dist/{AuthGuard-Ck31lvBA.js.map → AuthGuard-D6_sTASu.js.map} +1 -1
- package/dist/{AuthGuard-C2eA3mJA.cjs → AuthGuard-DM1nDTE5.cjs} +2 -2
- package/dist/{AuthGuard-C2eA3mJA.cjs.map → AuthGuard-DM1nDTE5.cjs.map} +1 -1
- package/dist/{AuthLayout-BI1wLuDl.js → AuthLayout-BDRJFSpi.js} +2 -2
- package/dist/{AuthLayout-BI1wLuDl.js.map → AuthLayout-BDRJFSpi.js.map} +1 -1
- package/dist/{AuthLayout-Bzlsvicf.cjs → AuthLayout-D7mSMdM4.cjs} +2 -2
- package/dist/{AuthLayout-Bzlsvicf.cjs.map → AuthLayout-D7mSMdM4.cjs.map} +1 -1
- package/dist/{Avatar-BBqX1732.cjs → Avatar-BwGJl-ru.cjs} +2 -2
- package/dist/{Avatar-BBqX1732.cjs.map → Avatar-BwGJl-ru.cjs.map} +1 -1
- package/dist/{Avatar-CaYyv5wk.js → Avatar-C4qgzth2.js} +2 -2
- package/dist/{Avatar-CaYyv5wk.js.map → Avatar-C4qgzth2.js.map} +1 -1
- package/dist/{AvatarGroup-DrkzAt1-.cjs → AvatarGroup-B8u8ONs5.cjs} +2 -2
- package/dist/{AvatarGroup-DrkzAt1-.cjs.map → AvatarGroup-B8u8ONs5.cjs.map} +1 -1
- package/dist/{AvatarGroup-6fhm-van.js → AvatarGroup-BqxTFzRc.js} +2 -2
- package/dist/{AvatarGroup-6fhm-van.js.map → AvatarGroup-BqxTFzRc.js.map} +1 -1
- package/dist/BottomSheet-0oqSWjBx.js +646 -0
- package/dist/BottomSheet-0oqSWjBx.js.map +1 -0
- package/dist/BottomSheet-BWTYMGOU.cjs +2 -0
- package/dist/BottomSheet-BWTYMGOU.cjs.map +1 -0
- package/dist/{Breadcrumbs-BEv57tuJ.js → Breadcrumbs-BEcEVdRt.js} +4 -4
- package/dist/{Breadcrumbs-BEv57tuJ.js.map → Breadcrumbs-BEcEVdRt.js.map} +1 -1
- package/dist/{Breadcrumbs-CqGS32x5.cjs → Breadcrumbs-DGyb8ntF.cjs} +2 -2
- package/dist/{Breadcrumbs-CqGS32x5.cjs.map → Breadcrumbs-DGyb8ntF.cjs.map} +1 -1
- package/dist/{Button-DZWYeAno.js → Button-CwwuhATn.js} +2 -2
- package/dist/{Button-DZWYeAno.js.map → Button-CwwuhATn.js.map} +1 -1
- package/dist/{Button-BtiFpRie.cjs → Button-D6f4SooD.cjs} +2 -2
- package/dist/{Button-BtiFpRie.cjs.map → Button-D6f4SooD.cjs.map} +1 -1
- package/dist/{Calendar-7W9xNVBZ.js → Calendar-CGLl3HmM.js} +4 -4
- package/dist/{Calendar-7W9xNVBZ.js.map → Calendar-CGLl3HmM.js.map} +1 -1
- package/dist/{Calendar-Bgh_3Vk2.cjs → Calendar-CjHLOfVw.cjs} +2 -2
- package/dist/{Calendar-Bgh_3Vk2.cjs.map → Calendar-CjHLOfVw.cjs.map} +1 -1
- package/dist/{Card-KfmWG9Uz.cjs → Card-BbfesgrZ.cjs} +2 -2
- package/dist/{Card-KfmWG9Uz.cjs.map → Card-BbfesgrZ.cjs.map} +1 -1
- package/dist/{Card-ckOd617g.js → Card-DTmvoxKG.js} +4 -4
- package/dist/{Card-ckOd617g.js.map → Card-DTmvoxKG.js.map} +1 -1
- package/dist/{Chip-BDUsue_R.cjs → Chip-CguuQYqY.cjs} +2 -2
- package/dist/{Chip-BDUsue_R.cjs.map → Chip-CguuQYqY.cjs.map} +1 -1
- package/dist/{Chip-Crzm7Eux.js → Chip-DRwzCG96.js} +3 -3
- package/dist/{Chip-Crzm7Eux.js.map → Chip-DRwzCG96.js.map} +1 -1
- package/dist/{ChoiceCardGroup-D37XREKV.js → ChoiceCardGroup-BBqUbFLS.js} +2 -2
- package/dist/{ChoiceCardGroup-D37XREKV.js.map → ChoiceCardGroup-BBqUbFLS.js.map} +1 -1
- package/dist/{ChoiceCardGroup-Cj_YFj6C.cjs → ChoiceCardGroup-bnKFPDYz.cjs} +2 -2
- package/dist/{ChoiceCardGroup-Cj_YFj6C.cjs.map → ChoiceCardGroup-bnKFPDYz.cjs.map} +1 -1
- package/dist/{CodeBlock-CX8_dMPD.js → CodeBlock-C-8MTy4V.js} +4 -4
- package/dist/{CodeBlock-CX8_dMPD.js.map → CodeBlock-C-8MTy4V.js.map} +1 -1
- package/dist/{CodeBlock-rnGAu2DQ.cjs → CodeBlock-Dv7hXdPl.cjs} +2 -2
- package/dist/{CodeBlock-rnGAu2DQ.cjs.map → CodeBlock-Dv7hXdPl.cjs.map} +1 -1
- package/dist/{ColorPicker-BaAdcqR9.cjs → ColorPicker-B4UqiIvG.cjs} +2 -2
- package/dist/{ColorPicker-BaAdcqR9.cjs.map → ColorPicker-B4UqiIvG.cjs.map} +1 -1
- package/dist/{ColorPicker-CwLivdAt.js → ColorPicker-Rva-0w3d.js} +3 -3
- package/dist/{ColorPicker-CwLivdAt.js.map → ColorPicker-Rva-0w3d.js.map} +1 -1
- package/dist/{ColorPickerPanel-IOhJJF1R.cjs → ColorPickerPanel-DRJzClGA.cjs} +2 -2
- package/dist/{ColorPickerPanel-IOhJJF1R.cjs.map → ColorPickerPanel-DRJzClGA.cjs.map} +1 -1
- package/dist/{ColorPickerPanel-CkrSIf35.js → ColorPickerPanel-Dx_TIReY.js} +3 -3
- package/dist/{ColorPickerPanel-CkrSIf35.js.map → ColorPickerPanel-Dx_TIReY.js.map} +1 -1
- package/dist/{ColorRamp-BCy8a7ks.cjs → ColorRamp-C5KkZS8L.cjs} +2 -2
- package/dist/{ColorRamp-BCy8a7ks.cjs.map → ColorRamp-C5KkZS8L.cjs.map} +1 -1
- package/dist/{ColorRamp-DbFOsspz.js → ColorRamp-CBkbpBHf.js} +2 -2
- package/dist/{ColorRamp-DbFOsspz.js.map → ColorRamp-CBkbpBHf.js.map} +1 -1
- package/dist/{ConfigProvider-DtyUlWk6.js → ConfigProvider-BOcVBt4M.js} +2 -2
- package/dist/{ConfigProvider-DtyUlWk6.js.map → ConfigProvider-BOcVBt4M.js.map} +1 -1
- package/dist/{ConfigProvider-CYSpuSMJ.cjs → ConfigProvider-DPk0aHDG.cjs} +2 -2
- package/dist/{ConfigProvider-CYSpuSMJ.cjs.map → ConfigProvider-DPk0aHDG.cjs.map} +1 -1
- package/dist/{CopyButton-LURMuaYw.js → CopyButton-BjNknp73.js} +4 -4
- package/dist/{CopyButton-LURMuaYw.js.map → CopyButton-BjNknp73.js.map} +1 -1
- package/dist/{CopyButton-DUG5s3TM.cjs → CopyButton-BxOhFQiM.cjs} +2 -2
- package/dist/{CopyButton-DUG5s3TM.cjs.map → CopyButton-BxOhFQiM.cjs.map} +1 -1
- package/dist/{DashedButton-BX8hfY1x.cjs → DashedButton-CZ2hjLxT.cjs} +2 -2
- package/dist/{DashedButton-BX8hfY1x.cjs.map → DashedButton-CZ2hjLxT.cjs.map} +1 -1
- package/dist/{DashedButton-wcmXTYBw.js → DashedButton-meJSIY61.js} +2 -2
- package/dist/{DashedButton-wcmXTYBw.js.map → DashedButton-meJSIY61.js.map} +1 -1
- package/dist/{DatePicker-Bw9gLB8o.cjs → DatePicker-DCCq8OCQ.cjs} +2 -2
- package/dist/{DatePicker-Bw9gLB8o.cjs.map → DatePicker-DCCq8OCQ.cjs.map} +1 -1
- package/dist/{DatePicker-CSIBYSZt.js → DatePicker-UCzOaIUQ.js} +5 -5
- package/dist/{DatePicker-CSIBYSZt.js.map → DatePicker-UCzOaIUQ.js.map} +1 -1
- package/dist/{DateTimePicker-C9F2yJMf.js → DateTimePicker-1716FCsy.js} +8 -8
- package/dist/{DateTimePicker-C9F2yJMf.js.map → DateTimePicker-1716FCsy.js.map} +1 -1
- package/dist/{DateTimePicker-kikKdt0F.cjs → DateTimePicker-nN9Okf1Y.cjs} +2 -2
- package/dist/{DateTimePicker-kikKdt0F.cjs.map → DateTimePicker-nN9Okf1Y.cjs.map} +1 -1
- package/dist/{DescriptionList-kfNXbf_D.js → DescriptionList-BTdmaD1T.js} +5 -5
- package/dist/{DescriptionList-kfNXbf_D.js.map → DescriptionList-BTdmaD1T.js.map} +1 -1
- package/dist/{DescriptionList-DnGkHdzT.cjs → DescriptionList-BbLVh3eI.cjs} +2 -2
- package/dist/{DescriptionList-DnGkHdzT.cjs.map → DescriptionList-BbLVh3eI.cjs.map} +1 -1
- package/dist/{Dropdown-D-D_Z1Jo.js → Dropdown-CmEWQTdx.js} +2 -2
- package/dist/{Dropdown-D-D_Z1Jo.js.map → Dropdown-CmEWQTdx.js.map} +1 -1
- package/dist/{Dropdown-C_y9_dVn.cjs → Dropdown-DC0Cl9Tb.cjs} +2 -2
- package/dist/{Dropdown-C_y9_dVn.cjs.map → Dropdown-DC0Cl9Tb.cjs.map} +1 -1
- package/dist/{EmptyState-DrSj2XV_.js → EmptyState-Cd1IxApj.js} +3 -3
- package/dist/{EmptyState-DrSj2XV_.js.map → EmptyState-Cd1IxApj.js.map} +1 -1
- package/dist/{EmptyState-BM5LrRLq.cjs → EmptyState-DQJ1JswD.cjs} +2 -2
- package/dist/{EmptyState-BM5LrRLq.cjs.map → EmptyState-DQJ1JswD.cjs.map} +1 -1
- package/dist/{ErrorBoundary-yz669VEu.cjs → ErrorBoundary-CXhzkfEl.cjs} +2 -2
- package/dist/{ErrorBoundary-yz669VEu.cjs.map → ErrorBoundary-CXhzkfEl.cjs.map} +1 -1
- package/dist/{ErrorBoundary-DsP4hO_V.js → ErrorBoundary-DUbPB1_a.js} +3 -3
- package/dist/{ErrorBoundary-DsP4hO_V.js.map → ErrorBoundary-DUbPB1_a.js.map} +1 -1
- package/dist/{ErrorState-DEngucdq.js → ErrorState-CbKuo8cI.js} +8 -8
- package/dist/{ErrorState-DEngucdq.js.map → ErrorState-CbKuo8cI.js.map} +1 -1
- package/dist/{ErrorState-BThPIYaM.cjs → ErrorState-URYycye9.cjs} +2 -2
- package/dist/{ErrorState-BThPIYaM.cjs.map → ErrorState-URYycye9.cjs.map} +1 -1
- package/dist/{FileCard-CmCESTQd.js → FileCard-DxwKSMN1.js} +5 -5
- package/dist/{FileCard-CmCESTQd.js.map → FileCard-DxwKSMN1.js.map} +1 -1
- package/dist/{FileCard-wxDT2rj9.cjs → FileCard-o7zymUXi.cjs} +2 -2
- package/dist/{FileCard-wxDT2rj9.cjs.map → FileCard-o7zymUXi.cjs.map} +1 -1
- package/dist/{FileUploader-Dp1r4Sxc.js → FileUploader-CS5HbKW3.js} +7 -7
- package/dist/{FileUploader-Dp1r4Sxc.js.map → FileUploader-CS5HbKW3.js.map} +1 -1
- package/dist/{FileUploader-DBNRp5eT.cjs → FileUploader-uaTl82eB.cjs} +2 -2
- package/dist/{FileUploader-DBNRp5eT.cjs.map → FileUploader-uaTl82eB.cjs.map} +1 -1
- package/dist/{Flag-B6OhgwZr.cjs → Flag-BodaDmHB.cjs} +2 -2
- package/dist/{Flag-B6OhgwZr.cjs.map → Flag-BodaDmHB.cjs.map} +1 -1
- package/dist/{Flag-Q3vI7cgt.js → Flag-CS4SH1Nt.js} +2 -2
- package/dist/{Flag-Q3vI7cgt.js.map → Flag-CS4SH1Nt.js.map} +1 -1
- package/dist/{FullscreenToggle-DVdQriWB.cjs → FullscreenToggle--qqOi3Bw.cjs} +2 -2
- package/dist/{FullscreenToggle-DVdQriWB.cjs.map → FullscreenToggle--qqOi3Bw.cjs.map} +1 -1
- package/dist/{FullscreenToggle-WGsbE3Op.js → FullscreenToggle-CI3fmt9Q.js} +4 -4
- package/dist/{FullscreenToggle-WGsbE3Op.js.map → FullscreenToggle-CI3fmt9Q.js.map} +1 -1
- package/dist/Icon-BoQmbW7j.cjs +2 -0
- package/dist/Icon-BoQmbW7j.cjs.map +1 -0
- package/dist/{Icon-B7DJn8Tw.js → Icon-DMMO32p6.js} +72 -71
- package/dist/Icon-DMMO32p6.js.map +1 -0
- package/dist/{IconButton-iWbUJAz7.js → IconButton-CCxNWwlu.js} +2 -2
- package/dist/{IconButton-iWbUJAz7.js.map → IconButton-CCxNWwlu.js.map} +1 -1
- package/dist/{IconButton-DSPdv-oI.cjs → IconButton-DOlCOuKu.cjs} +2 -2
- package/dist/{IconButton-DSPdv-oI.cjs.map → IconButton-DOlCOuKu.cjs.map} +1 -1
- package/dist/{ImageEditor-BDNys8pq.js → ImageEditor-CKfaHNGz.js} +8 -8
- package/dist/{ImageEditor-BDNys8pq.js.map → ImageEditor-CKfaHNGz.js.map} +1 -1
- package/dist/{ImageEditor-C40dp2-V.cjs → ImageEditor-CWISFJ1J.cjs} +2 -2
- package/dist/{ImageEditor-C40dp2-V.cjs.map → ImageEditor-CWISFJ1J.cjs.map} +1 -1
- package/dist/{List-CLUXeaXS.cjs → List-4VSERgRp.cjs} +2 -2
- package/dist/{List-CLUXeaXS.cjs.map → List-4VSERgRp.cjs.map} +1 -1
- package/dist/{List-DS91CZUt.js → List-H70lnOLB.js} +2 -2
- package/dist/{List-DS91CZUt.js.map → List-H70lnOLB.js.map} +1 -1
- package/dist/ListItem-DRzwCAvN.js +79 -0
- package/dist/ListItem-DRzwCAvN.js.map +1 -0
- package/dist/ListItem-wMTmx1yX.cjs +2 -0
- package/dist/ListItem-wMTmx1yX.cjs.map +1 -0
- package/dist/{Loader-RyFTP2X5.cjs → Loader-DUp5O6pO.cjs} +2 -2
- package/dist/{Loader-RyFTP2X5.cjs.map → Loader-DUp5O6pO.cjs.map} +1 -1
- package/dist/{Loader-DD1vfqmN.js → Loader-Dj_lwZT2.js} +2 -2
- package/dist/{Loader-DD1vfqmN.js.map → Loader-Dj_lwZT2.js.map} +1 -1
- package/dist/{LocationPicker-DpmYaYyd.js → LocationPicker-CB2vrhu0.js} +8 -8
- package/dist/{LocationPicker-DpmYaYyd.js.map → LocationPicker-CB2vrhu0.js.map} +1 -1
- package/dist/{LocationPicker-B594f0bz.cjs → LocationPicker-DzCmt8Xb.cjs} +2 -2
- package/dist/{LocationPicker-B594f0bz.cjs.map → LocationPicker-DzCmt8Xb.cjs.map} +1 -1
- package/dist/{Modal-7cCok6fV.cjs → Modal-C5sKj4UK.cjs} +2 -2
- package/dist/{Modal-7cCok6fV.cjs.map → Modal-C5sKj4UK.cjs.map} +1 -1
- package/dist/{Modal-DVGTD2Ck.js → Modal-Cr1aqYgb.js} +4 -4
- package/dist/{Modal-DVGTD2Ck.js.map → Modal-Cr1aqYgb.js.map} +1 -1
- package/dist/{MultiSelect-D-X833xt.js → MultiSelect-DgrL23Nr.js} +5 -5
- package/dist/{MultiSelect-D-X833xt.js.map → MultiSelect-DgrL23Nr.js.map} +1 -1
- package/dist/{MultiSelect-DTKNjUDH.cjs → MultiSelect-mY7X3O7V.cjs} +2 -2
- package/dist/{MultiSelect-DTKNjUDH.cjs.map → MultiSelect-mY7X3O7V.cjs.map} +1 -1
- package/dist/{NumberField-Xz4yQMlm.cjs → NumberField-CnsHPDuN.cjs} +2 -2
- package/dist/{NumberField-Xz4yQMlm.cjs.map → NumberField-CnsHPDuN.cjs.map} +1 -1
- package/dist/{NumberField-OPOl0Yph.js → NumberField-GxQeV07e.js} +4 -4
- package/dist/{NumberField-OPOl0Yph.js.map → NumberField-GxQeV07e.js.map} +1 -1
- package/dist/{OtpField-kd0YghZq.cjs → OtpField-Dt71t0PF.cjs} +2 -2
- package/dist/{OtpField-kd0YghZq.cjs.map → OtpField-Dt71t0PF.cjs.map} +1 -1
- package/dist/{OtpField-CLrDMNtS.js → OtpField-b31rUMV1.js} +2 -2
- package/dist/{OtpField-CLrDMNtS.js.map → OtpField-b31rUMV1.js.map} +1 -1
- package/dist/{PageError-BIiZDzey.js → PageError-0it6u2r9.js} +5 -5
- package/dist/{PageError-BIiZDzey.js.map → PageError-0it6u2r9.js.map} +1 -1
- package/dist/{PageError-v6MAH_OL.cjs → PageError-BYIkzEfs.cjs} +2 -2
- package/dist/{PageError-v6MAH_OL.cjs.map → PageError-BYIkzEfs.cjs.map} +1 -1
- package/dist/{PageLayout-DH3jochw.cjs → PageLayout-8ZHBwDeC.cjs} +2 -2
- package/dist/{PageLayout-DH3jochw.cjs.map → PageLayout-8ZHBwDeC.cjs.map} +1 -1
- package/dist/{PageLayout-BjaPfXvb.js → PageLayout-Cqb2pczH.js} +5 -5
- package/dist/{PageLayout-BjaPfXvb.js.map → PageLayout-Cqb2pczH.js.map} +1 -1
- package/dist/{PageNotFound-Cse4bROv.cjs → PageNotFound-BCX-XQLA.cjs} +2 -2
- package/dist/{PageNotFound-Cse4bROv.cjs.map → PageNotFound-BCX-XQLA.cjs.map} +1 -1
- package/dist/{PageNotFound-C1oSsMG-.js → PageNotFound-ChpqEtgV.js} +5 -5
- package/dist/{PageNotFound-C1oSsMG-.js.map → PageNotFound-ChpqEtgV.js.map} +1 -1
- package/dist/{Pagination-DkmfEmgK.cjs → Pagination-DSdcF9UF.cjs} +2 -2
- package/dist/{Pagination-DkmfEmgK.cjs.map → Pagination-DSdcF9UF.cjs.map} +1 -1
- package/dist/{Pagination-BNJdqcu4.js → Pagination-Du6tATTZ.js} +3 -3
- package/dist/{Pagination-BNJdqcu4.js.map → Pagination-Du6tATTZ.js.map} +1 -1
- package/dist/{PaletteField-DqZl1mK0.cjs → PaletteField-D_wYeYEx.cjs} +2 -2
- package/dist/{PaletteField-DqZl1mK0.cjs.map → PaletteField-D_wYeYEx.cjs.map} +1 -1
- package/dist/{PaletteField-Cdky6Zka.js → PaletteField-F-6hF1Ly.js} +3 -3
- package/dist/{PaletteField-Cdky6Zka.js.map → PaletteField-F-6hF1Ly.js.map} +1 -1
- package/dist/{PhoneField-jq-3_i_b.cjs → PhoneField-BdRlvj7L.cjs} +2 -2
- package/dist/{PhoneField-jq-3_i_b.cjs.map → PhoneField-BdRlvj7L.cjs.map} +1 -1
- package/dist/{PhoneField-DmFaJJEa.js → PhoneField-D99W6Abz.js} +5 -5
- package/dist/{PhoneField-DmFaJJEa.js.map → PhoneField-D99W6Abz.js.map} +1 -1
- package/dist/{Popconfirm-KOE9gGi6.cjs → Popconfirm-B4506C47.cjs} +2 -2
- package/dist/{Popconfirm-KOE9gGi6.cjs.map → Popconfirm-B4506C47.cjs.map} +1 -1
- package/dist/{Popconfirm-D-8ZG2WR.js → Popconfirm-C5ldh11s.js} +4 -4
- package/dist/{Popconfirm-D-8ZG2WR.js.map → Popconfirm-C5ldh11s.js.map} +1 -1
- package/dist/{Progress-CdX666FP.js → Progress-C71Yo8Mw.js} +2 -2
- package/dist/{Progress-CdX666FP.js.map → Progress-C71Yo8Mw.js.map} +1 -1
- package/dist/{Progress-7EyhPtnu.cjs → Progress-sa-c4iAK.cjs} +2 -2
- package/dist/{Progress-7EyhPtnu.cjs.map → Progress-sa-c4iAK.cjs.map} +1 -1
- package/dist/{QrCode-D7ocSDi7.js → QrCode-CMLPHVUN.js} +2 -2
- package/dist/{QrCode-D7ocSDi7.js.map → QrCode-CMLPHVUN.js.map} +1 -1
- package/dist/{QrCode-ClIJjjvF.cjs → QrCode-lWfNmqL8.cjs} +2 -2
- package/dist/{QrCode-ClIJjjvF.cjs.map → QrCode-lWfNmqL8.cjs.map} +1 -1
- package/dist/{RemoveDialog-UsSX5z8Y.cjs → RemoveDialog-C6XRG1SG.cjs} +2 -2
- package/dist/{RemoveDialog-UsSX5z8Y.cjs.map → RemoveDialog-C6XRG1SG.cjs.map} +1 -1
- package/dist/{RemoveDialog-DTzRPLaT.js → RemoveDialog-D01OLxbj.js} +6 -6
- package/dist/{RemoveDialog-DTzRPLaT.js.map → RemoveDialog-D01OLxbj.js.map} +1 -1
- package/dist/{RichTextEditor-BMctlkVC.js → RichTextEditor-BFzWo8Ih.js} +10 -10
- package/dist/{RichTextEditor-BMctlkVC.js.map → RichTextEditor-BFzWo8Ih.js.map} +1 -1
- package/dist/{RichTextEditor-Bh0Q3dIW.cjs → RichTextEditor-JpvFdJMa.cjs} +2 -2
- package/dist/{RichTextEditor-Bh0Q3dIW.cjs.map → RichTextEditor-JpvFdJMa.cjs.map} +1 -1
- package/dist/{RootLayout-CTkv4iQJ.js → RootLayout-Dbika05Y.js} +21 -21
- package/dist/{RootLayout-CTkv4iQJ.js.map → RootLayout-Dbika05Y.js.map} +1 -1
- package/dist/{RootLayout-BztZetpk.cjs → RootLayout-IwlWqYVL.cjs} +2 -2
- package/dist/{RootLayout-BztZetpk.cjs.map → RootLayout-IwlWqYVL.cjs.map} +1 -1
- package/dist/{Select-BzVyK6Ne.cjs → Select-CioU7fV7.cjs} +2 -2
- package/dist/{Select-BzVyK6Ne.cjs.map → Select-CioU7fV7.cjs.map} +1 -1
- package/dist/{Select-CmonDIIU.js → Select-DKaKdvG0.js} +4 -4
- package/dist/{Select-CmonDIIU.js.map → Select-DKaKdvG0.js.map} +1 -1
- package/dist/Sidebar-B7mCqEkl.cjs +2 -0
- package/dist/Sidebar-B7mCqEkl.cjs.map +1 -0
- package/dist/Sidebar-D0pNTtIb.js +543 -0
- package/dist/Sidebar-D0pNTtIb.js.map +1 -0
- package/dist/{Slider-C7Wb3q_F.js → Slider-BVM_MXjM.js} +2 -2
- package/dist/{Slider-C7Wb3q_F.js.map → Slider-BVM_MXjM.js.map} +1 -1
- package/dist/{Slider-Oe9VSAdy.cjs → Slider-RpFfWXLX.cjs} +2 -2
- package/dist/{Slider-Oe9VSAdy.cjs.map → Slider-RpFfWXLX.cjs.map} +1 -1
- package/dist/{SpeedDial-CCGQlwn2.js → SpeedDial-BMd4lvc6.js} +3 -3
- package/dist/{SpeedDial-CCGQlwn2.js.map → SpeedDial-BMd4lvc6.js.map} +1 -1
- package/dist/{SpeedDial-DpIXoYHB.cjs → SpeedDial-BpHZ09TN.cjs} +2 -2
- package/dist/{SpeedDial-DpIXoYHB.cjs.map → SpeedDial-BpHZ09TN.cjs.map} +1 -1
- package/dist/{Stepper-PBDU60G_.cjs → Stepper-BhtP1FgK.cjs} +2 -2
- package/dist/{Stepper-PBDU60G_.cjs.map → Stepper-BhtP1FgK.cjs.map} +1 -1
- package/dist/{Stepper-D_WKS1RG.js → Stepper-CedGw8c6.js} +3 -3
- package/dist/{Stepper-D_WKS1RG.js.map → Stepper-CedGw8c6.js.map} +1 -1
- package/dist/{SwatchPicker-DS4WY2eM.js → SwatchPicker-BI0XHphv.js} +2 -2
- package/dist/{SwatchPicker-DS4WY2eM.js.map → SwatchPicker-BI0XHphv.js.map} +1 -1
- package/dist/{SwatchPicker-DCjE0T80.cjs → SwatchPicker-QYtqEUxX.cjs} +2 -2
- package/dist/{SwatchPicker-DCjE0T80.cjs.map → SwatchPicker-QYtqEUxX.cjs.map} +1 -1
- package/dist/{Table-CZ4n4-TN.cjs → Table-C-s1M3ZJ.cjs} +2 -2
- package/dist/{Table-CZ4n4-TN.cjs.map → Table-C-s1M3ZJ.cjs.map} +1 -1
- package/dist/{Table-DZQVa_PE.js → Table-CEIZw6O7.js} +19 -19
- package/dist/{Table-DZQVa_PE.js.map → Table-CEIZw6O7.js.map} +1 -1
- package/dist/{Tabs-B063mP-v.js → Tabs-BryFjibj.js} +3 -3
- package/dist/{Tabs-B063mP-v.js.map → Tabs-BryFjibj.js.map} +1 -1
- package/dist/{Tabs-Byhqm-TE.cjs → Tabs-DXb1phlV.cjs} +2 -2
- package/dist/{Tabs-Byhqm-TE.cjs.map → Tabs-DXb1phlV.cjs.map} +1 -1
- package/dist/{TagsField-g_LtwYgz.cjs → TagsField-BG7ianZI.cjs} +2 -2
- package/dist/{TagsField-g_LtwYgz.cjs.map → TagsField-BG7ianZI.cjs.map} +1 -1
- package/dist/{TagsField-hQFYyNcM.js → TagsField-Dju_vk92.js} +5 -5
- package/dist/{TagsField-hQFYyNcM.js.map → TagsField-Dju_vk92.js.map} +1 -1
- package/dist/{TextField-D4s2hGSd.cjs → TextField-D5NDKrbU.cjs} +2 -2
- package/dist/{TextField-D4s2hGSd.cjs.map → TextField-D5NDKrbU.cjs.map} +1 -1
- package/dist/{TextField-Dfpk0jOg.js → TextField-DATNsTzX.js} +4 -4
- package/dist/{TextField-Dfpk0jOg.js.map → TextField-DATNsTzX.js.map} +1 -1
- package/dist/{ThemeToggle-BQQ3eswr.js → ThemeToggle-CCSi6b_Z.js} +4 -4
- package/dist/{ThemeToggle-BQQ3eswr.js.map → ThemeToggle-CCSi6b_Z.js.map} +1 -1
- package/dist/{ThemeToggle-BTTI7Jz0.cjs → ThemeToggle-or27hawd.cjs} +2 -2
- package/dist/{ThemeToggle-BTTI7Jz0.cjs.map → ThemeToggle-or27hawd.cjs.map} +1 -1
- package/dist/{TimeColumns-BpjhrNCq.js → TimeColumns-B5LAStb0.js} +2 -2
- package/dist/{TimeColumns-BpjhrNCq.js.map → TimeColumns-B5LAStb0.js.map} +1 -1
- package/dist/{TimeColumns-DZYGWWG_.cjs → TimeColumns-BNmC-5do.cjs} +2 -2
- package/dist/{TimeColumns-DZYGWWG_.cjs.map → TimeColumns-BNmC-5do.cjs.map} +1 -1
- package/dist/{TimePicker-DChtZgBs.cjs → TimePicker-CKNymi90.cjs} +2 -2
- package/dist/{TimePicker-DChtZgBs.cjs.map → TimePicker-CKNymi90.cjs.map} +1 -1
- package/dist/{TimePicker-mzoMIlpq.js → TimePicker-D43aa4JA.js} +6 -6
- package/dist/{TimePicker-mzoMIlpq.js.map → TimePicker-D43aa4JA.js.map} +1 -1
- package/dist/{Timeline-DOojNvLG.cjs → Timeline-CFKbPpAV.cjs} +2 -2
- package/dist/{Timeline-DOojNvLG.cjs.map → Timeline-CFKbPpAV.cjs.map} +1 -1
- package/dist/{Timeline-Dg03dwTN.js → Timeline-zCHcq7Ra.js} +2 -2
- package/dist/{Timeline-Dg03dwTN.js.map → Timeline-zCHcq7Ra.js.map} +1 -1
- package/dist/{Toaster-79DvOW80.js → Toaster-BmH9V76v.js} +3 -3
- package/dist/{Toaster-79DvOW80.js.map → Toaster-BmH9V76v.js.map} +1 -1
- package/dist/{Toaster-lonArt-H.cjs → Toaster-CvtKx3FV.cjs} +2 -2
- package/dist/{Toaster-lonArt-H.cjs.map → Toaster-CvtKx3FV.cjs.map} +1 -1
- package/dist/{ToggleButtonGroup-CGNRLxjg.cjs → ToggleButtonGroup-CbKtjm8O.cjs} +2 -2
- package/dist/{ToggleButtonGroup-CGNRLxjg.cjs.map → ToggleButtonGroup-CbKtjm8O.cjs.map} +1 -1
- package/dist/{ToggleButtonGroup-K6ZcrTZT.js → ToggleButtonGroup-D3Jltv0z.js} +2 -2
- package/dist/{ToggleButtonGroup-K6ZcrTZT.js.map → ToggleButtonGroup-D3Jltv0z.js.map} +1 -1
- package/dist/{TranslatedFields-CHHtXO_n.js → TranslatedFields-Bn0cR47v.js} +5 -5
- package/dist/{TranslatedFields-CHHtXO_n.js.map → TranslatedFields-Bn0cR47v.js.map} +1 -1
- package/dist/{TranslatedFields-BYpMrYaw.cjs → TranslatedFields-U1cjZKWn.cjs} +2 -2
- package/dist/{TranslatedFields-BYpMrYaw.cjs.map → TranslatedFields-U1cjZKWn.cjs.map} +1 -1
- package/dist/{UserCard-BJFNP_nl.js → UserCard-BNKMs48t.js} +5 -5
- package/dist/{UserCard-BJFNP_nl.js.map → UserCard-BNKMs48t.js.map} +1 -1
- package/dist/{UserCard-SlkCgZS9.cjs → UserCard-D0RokNh8.cjs} +2 -2
- package/dist/{UserCard-SlkCgZS9.cjs.map → UserCard-D0RokNh8.cjs.map} +1 -1
- package/dist/{authLayoutRoute-CgSQIDD5.cjs → authLayoutRoute-23XOJ9q9.cjs} +2 -2
- package/dist/{authLayoutRoute-CgSQIDD5.cjs.map → authLayoutRoute-23XOJ9q9.cjs.map} +1 -1
- package/dist/{authLayoutRoute-CEFmEYy7.js → authLayoutRoute-BE0nGH_N.js} +2 -2
- package/dist/{authLayoutRoute-CEFmEYy7.js.map → authLayoutRoute-BE0nGH_N.js.map} +1 -1
- package/dist/chunks/icons/{62-Bfupp-0A.js → 62-9nuZO-ct.js} +9 -10
- package/dist/chunks/icons/{62-CZZzM1ev.cjs → 62-DQQ1U3IB.cjs} +1 -1
- package/dist/components/Accordion/index.cjs +1 -1
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/AuthLayout/index.cjs +1 -1
- package/dist/components/AuthLayout/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.js +2 -2
- package/dist/components/BottomSheet/BottomSheet.d.cts +59 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +59 -0
- package/dist/components/BottomSheet/gesture.d.cts +51 -0
- package/dist/components/BottomSheet/gesture.d.ts +51 -0
- package/dist/components/BottomSheet/index.cjs +2 -0
- package/dist/components/BottomSheet/index.cjs.map +1 -0
- package/dist/components/BottomSheet/index.d.cts +2 -0
- package/dist/components/BottomSheet/index.d.ts +2 -0
- package/dist/components/BottomSheet/index.js +6 -0
- package/dist/components/BottomSheet/index.js.map +1 -0
- package/dist/components/BottomSheet/motion.d.cts +47 -0
- package/dist/components/BottomSheet/motion.d.ts +47 -0
- package/dist/components/Breadcrumbs/index.cjs +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Card/index.cjs +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Chip/index.cjs +1 -1
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/ChoiceCard/index.cjs +1 -1
- package/dist/components/ChoiceCard/index.js +1 -1
- package/dist/components/CodeBlock/index.cjs +1 -1
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ColorPicker/index.cjs +1 -1
- package/dist/components/ColorPicker/index.js +1 -1
- package/dist/components/ColorRamp/index.cjs +1 -1
- package/dist/components/ColorRamp/index.js +1 -1
- package/dist/components/CopyButton/index.cjs +1 -1
- package/dist/components/CopyButton/index.js +1 -1
- package/dist/components/DashedButton/index.cjs +1 -1
- package/dist/components/DashedButton/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DateTimePicker/index.cjs +1 -1
- package/dist/components/DateTimePicker/index.js +1 -1
- package/dist/components/DescriptionList/index.cjs +1 -1
- package/dist/components/DescriptionList/index.js +1 -1
- package/dist/components/Dropdown/index.cjs +1 -1
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/EmptyState/index.cjs +1 -1
- package/dist/components/EmptyState/index.js +1 -1
- package/dist/components/ErrorState/index.cjs +1 -1
- package/dist/components/ErrorState/index.js +2 -2
- package/dist/components/FileCard/index.cjs +1 -1
- package/dist/components/FileCard/index.js +1 -1
- package/dist/components/FileUploader/index.cjs +1 -1
- package/dist/components/FileUploader/index.js +1 -1
- package/dist/components/Flag/index.cjs +1 -1
- package/dist/components/Flag/index.js +1 -1
- package/dist/components/FullscreenToggle/index.cjs +1 -1
- package/dist/components/FullscreenToggle/index.js +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/IconButton/index.cjs +1 -1
- package/dist/components/IconButton/index.js +1 -1
- package/dist/components/ImageEditor/index.cjs +1 -1
- package/dist/components/ImageEditor/index.js +1 -1
- package/dist/components/List/ListItem.d.cts +9 -1
- package/dist/components/List/ListItem.d.ts +9 -1
- package/dist/components/List/index.cjs +1 -1
- package/dist/components/List/index.d.cts +1 -1
- package/dist/components/List/index.d.ts +1 -1
- package/dist/components/List/index.js +2 -2
- package/dist/components/Loader/index.cjs +1 -1
- package/dist/components/Loader/index.js +1 -1
- package/dist/components/LocationPicker/index.cjs +1 -1
- package/dist/components/LocationPicker/index.js +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/MultiSelect/index.cjs +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OtpField/index.cjs +1 -1
- package/dist/components/OtpField/index.js +1 -1
- package/dist/components/PageError/index.cjs +1 -1
- package/dist/components/PageError/index.js +1 -1
- package/dist/components/PageLayout/index.cjs +1 -1
- package/dist/components/PageLayout/index.js +1 -1
- package/dist/components/PageNotFound/index.cjs +1 -1
- package/dist/components/PageNotFound/index.js +1 -1
- package/dist/components/Pagination/index.cjs +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/PaletteField/index.cjs +1 -1
- package/dist/components/PaletteField/index.js +1 -1
- package/dist/components/PhoneField/index.cjs +1 -1
- package/dist/components/PhoneField/index.js +1 -1
- package/dist/components/Popconfirm/index.cjs +1 -1
- package/dist/components/Popconfirm/index.js +1 -1
- package/dist/components/Progress/index.cjs +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/QrCode/index.cjs +1 -1
- package/dist/components/QrCode/index.js +1 -1
- package/dist/components/RemoveDialog/index.cjs +1 -1
- package/dist/components/RemoveDialog/index.js +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RootLayout/index.cjs +1 -1
- package/dist/components/RootLayout/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Sidebar/Sidebar.d.cts +40 -4
- package/dist/components/Sidebar/Sidebar.d.ts +40 -4
- package/dist/components/Sidebar/index.cjs +1 -1
- package/dist/components/Sidebar/index.d.cts +2 -1
- package/dist/components/Sidebar/index.d.ts +2 -1
- package/dist/components/Sidebar/index.js +5 -4
- package/dist/components/Slider/index.cjs +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/SpeedDial/index.cjs +1 -1
- package/dist/components/SpeedDial/index.js +1 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/SwatchPicker/index.cjs +1 -1
- package/dist/components/SwatchPicker/index.js +1 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/index.cjs +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/TagsField/index.cjs +1 -1
- package/dist/components/TagsField/index.js +1 -1
- package/dist/components/TextField/index.cjs +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/ThemeToggle/index.cjs +1 -1
- package/dist/components/ThemeToggle/index.js +1 -1
- package/dist/components/TimePicker/index.cjs +1 -1
- package/dist/components/TimePicker/index.js +1 -1
- package/dist/components/Timeline/index.cjs +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleButton/index.cjs +1 -1
- package/dist/components/ToggleButton/index.js +1 -1
- package/dist/components/TranslatedFields/index.cjs +1 -1
- package/dist/components/TranslatedFields/index.js +1 -1
- package/dist/components/UserCard/index.cjs +1 -1
- package/dist/components/UserCard/index.js +1 -1
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/entries/app.cjs +1 -1
- package/dist/entries/app.js +1 -1
- package/dist/entries/auth.cjs +1 -1
- package/dist/entries/auth.js +2 -2
- package/dist/entries/components.cjs +1 -1
- package/dist/entries/components.js +192 -189
- package/dist/entries/components.js.map +1 -1
- package/dist/entries/i18n.cjs +1 -1
- package/dist/entries/i18n.js +2 -2
- package/dist/entries/icons.cjs +1 -1
- package/dist/entries/icons.js +1 -1
- package/dist/entries/theme.cjs +1 -1
- package/dist/entries/theme.js +1 -1
- package/dist/i18n/messages.d.cts +6 -0
- package/dist/i18n/messages.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +208 -205
- package/dist/index.js.map +1 -1
- package/dist/messages-C2DUaZkS.cjs +36 -0
- package/dist/messages-C2DUaZkS.cjs.map +1 -0
- package/dist/{messages-DeQuvGln.js → messages-DWL0ZaKa.js} +36 -15
- package/dist/messages-DWL0ZaKa.js.map +1 -0
- package/dist/useHomeTo-Ao53ZjWz.cjs +2 -0
- package/dist/useHomeTo-Ao53ZjWz.cjs.map +1 -0
- package/dist/useHomeTo-DG69efNE.js +10 -0
- package/dist/useHomeTo-DG69efNE.js.map +1 -0
- package/dist/{useOptionMenu-6ZffgbYG.cjs → useOptionMenu-B9zQfGTN.cjs} +2 -2
- package/dist/{useOptionMenu-6ZffgbYG.cjs.map → useOptionMenu-B9zQfGTN.cjs.map} +1 -1
- package/dist/{useOptionMenu-CxM6FHXL.js → useOptionMenu-C8SEMVFV.js} +6 -6
- package/dist/{useOptionMenu-CxM6FHXL.js.map → useOptionMenu-C8SEMVFV.js.map} +1 -1
- package/package.json +1 -1
- package/dist/Icon-B7DJn8Tw.js.map +0 -1
- package/dist/Icon-CBg21lKA.cjs +0 -2
- package/dist/Icon-CBg21lKA.cjs.map +0 -1
- package/dist/ListItem-CguNjf-u.cjs +0 -2
- package/dist/ListItem-CguNjf-u.cjs.map +0 -1
- package/dist/ListItem-Ezmdk7q-.js +0 -76
- package/dist/ListItem-Ezmdk7q-.js.map +0 -1
- package/dist/Sidebar-CLr-DyQ_.js +0 -522
- package/dist/Sidebar-CLr-DyQ_.js.map +0 -1
- package/dist/Sidebar-CM-jZfj5.cjs +0 -2
- package/dist/Sidebar-CM-jZfj5.cjs.map +0 -1
- package/dist/messages-DeQuvGln.js.map +0 -1
- package/dist/messages-dL9MkVze.cjs +0 -36
- package/dist/messages-dL9MkVze.cjs.map +0 -1
- package/dist/useHomeTo-BLSvhJd5.js +0 -25
- package/dist/useHomeTo-BLSvhJd5.js.map +0 -1
- package/dist/useHomeTo-cXCg1tf0.cjs +0 -2
- package/dist/useHomeTo-cXCg1tf0.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheet-0oqSWjBx.js","sources":["../src/components/BottomSheet/gesture.ts","../src/components/BottomSheet/motion.ts","../src/components/BottomSheet/BottomSheet.tsx"],"sourcesContent":["// The body gesture of a BottomSheet: a touch on the content either scrolls it or moves the sheet — and hands\n// over between the two mid-gesture, like a native sheet. Pure (no DOM), so every rule is unit-testable; the\n// component feeds it the touch deltas and applies what comes back.\n//\n// Offsets are the sheet's translateY (0 = at its tallest snap; larger = lower). `scrollTop` is the body's.\n\n/**\n * Who owns the current touch on the body:\n * - `pending` — not decided yet (still within the slop);\n * - `sheet` — the finger moves the sheet (the native scroll is prevented);\n * - `scroll` — the sheet is at its tallest and the finger scrolls the content, driven by us (the gesture\n * started as a sheet drag, so the native scroll was already prevented — the scroll is emulated);\n * - `native` — the browser scrolls the content natively, and the sheet stays put for this gesture.\n */\nexport type BodyGestureMode = 'pending' | 'sheet' | 'scroll' | 'native'\n\n/** What the first decisive move sees. */\nexport interface GestureStart {\n /** The sheet's offset (0 = at its tallest snap). */\n offset: number\n /** The body's scrollTop. */\n scrollTop: number\n /** Whether the body's content is taller than the body (it can scroll at all). */\n canScroll: boolean\n /** Total finger movement so far, px (`dy` positive = down). */\n dx: number\n dy: number\n}\n\n/**\n * The owner of a gesture, decided on its first decisive move:\n * - a mostly horizontal move is never the sheet's (a carousel, a wide table) → `native`;\n * - the sheet below its tallest snap → `sheet` (it grows / shrinks before anything scrolls);\n * - at its tallest, content scrolled down → `native` (the content scrolls; the sheet waits for the next gesture);\n * - at its tallest, content at its top: pulling down → `sheet`; pushing up → `native` when there's content to\n * scroll, else `sheet` (the rubber band).\n */\nexport function decideBodyGesture({ offset, scrollTop, canScroll, dx, dy }: GestureStart) {\n if (Math.abs(dx) > Math.abs(dy)) return 'native' as const\n if (offset > 0.5) return 'sheet' as const\n if (scrollTop > 0) return 'native' as const\n if (dy > 0) return 'sheet' as const\n return canScroll ? ('native' as const) : ('sheet' as const)\n}\n\n/** A gesture's moving parts: who owns it, the sheet's raw (un-rubber-banded) offset, the body's scrollTop. */\nexport interface HandoffState {\n mode: 'sheet' | 'scroll'\n raw: number\n scrollTop: number\n}\n\n/**\n * Apply a finger move of `dy` px (positive = down) to an owned gesture, handing over between the sheet and the\n * content: pushing up moves the sheet to its tallest, then scrolls the content (up to `scrollMax`); pulling down\n * scrolls the content back to its top, then moves the sheet down. With no content left to scroll the sheet takes\n * the overshoot (the caller rubber-bands a negative `raw`).\n */\nexport function handoff(state: HandoffState, dy: number, scrollMax: number): HandoffState {\n let { mode, raw, scrollTop } = state\n let rest = dy\n if (rest < 0) {\n // up: the sheet first (down to offset 0), then the content\n if (mode === 'sheet' && raw > 0) {\n const take = Math.max(rest, -raw)\n raw += take\n rest -= take\n }\n if (rest < 0) {\n if (scrollTop < scrollMax) {\n mode = 'scroll'\n const take = Math.max(rest, scrollTop - scrollMax)\n scrollTop -= take\n rest -= take\n }\n // nothing left to scroll: the sheet overshoots its tallest snap (rubber band)\n if (rest < 0) {\n mode = mode === 'scroll' && scrollTop < scrollMax ? mode : 'sheet'\n if (mode === 'sheet') raw += rest\n }\n }\n } else if (rest > 0) {\n // down: a sheet already below its tallest snap takes it all; otherwise undo an overshoot, then scroll the\n // content back to its top, then move the sheet\n if (raw > 0) {\n raw += rest\n rest = 0\n }\n if (rest > 0 && raw < 0) {\n const take = Math.min(rest, -raw)\n raw += take\n rest -= take\n }\n if (rest > 0 && scrollTop > 0) {\n mode = 'scroll'\n const take = Math.min(rest, scrollTop)\n scrollTop -= take\n rest -= take\n }\n if (rest > 0) {\n mode = 'sheet'\n raw += rest\n }\n }\n return { mode, raw, scrollTop }\n}\n\n/**\n * One frame of iOS-like momentum for an emulated scroll: `velocity` in px / s (positive = scrollTop growing),\n * `dt` in seconds. Returns the new scrollTop (clamped to `0…max`) and velocity (0 once it stops or hits an end).\n */\nexport function momentumStep(\n scrollTop: number,\n velocity: number,\n dt: number,\n max: number,\n deceleration = 0.998,\n): { scrollTop: number; velocity: number } {\n const next = scrollTop + velocity * dt\n const v = velocity * Math.pow(deceleration, dt * 1000)\n if (next <= 0) return { scrollTop: 0, velocity: 0 }\n if (next >= max) return { scrollTop: max, velocity: 0 }\n return { scrollTop: next, velocity: Math.abs(v) < 10 ? 0 : v }\n}\n","// The BottomSheet's physics, kept pure (no DOM) so it's unit-testable: snap points → pixel heights, the\n// rubber band past a limit, release velocity, which snap a release lands on, and a spring with an initial\n// velocity (so a fling carries straight into the settle — no jolt).\n//\n// Everything works in HEIGHT space: `0` is closed, a snap point is the sheet's visible height in px.\n\n/**\n * A snap point — a height in px, a percentage of the viewport height (`'50%'`), or `'content'`: the height of\n * the sheet's own content (handle + header + body + footer).\n */\nexport type BottomSheetSnapPoint = number | `${number}%` | 'content'\n\n/**\n * Snap points → visible heights in px, ascending and de-duplicated, each clamped to `1…max` (`max` = the\n * tallest the sheet may be). A percentage is of `viewport`; `'content'` is `content` (the measured content\n * height — `max` when unknown); anything unparsable is dropped. Never empty: with nothing usable it falls\n * back to `[max]`.\n */\nexport function resolveSnapPoints(\n points: readonly BottomSheetSnapPoint[],\n viewport: number,\n max: number,\n content?: number,\n): number[] {\n const heights = points\n .map((p) => {\n if (typeof p === 'number') return p\n if (p === 'content') return content != null && content > 0 ? content : max\n const m = /^\\s*(-?\\d+(?:\\.\\d+)?)\\s*%\\s*$/.exec(p)\n return m ? (Number(m[1]) / 100) * viewport : NaN\n })\n .filter((h) => Number.isFinite(h) && h > 0)\n .map((h) => Math.round(Math.min(max, Math.max(1, h))))\n const unique = [...new Set(heights)].sort((a, b) => a - b)\n return unique.length ? unique : [Math.max(1, Math.round(max))]\n}\n\n/**\n * How far an overshoot of `distance` px past a limit is shown — iOS-style resistance that never reaches\n * `dimension` (`c` sets how stiff it feels).\n */\nexport function rubberBand(distance: number, dimension: number, c = 0.55): number {\n if (distance <= 0 || dimension <= 0) return 0\n return (1 - 1 / ((distance * c) / dimension + 1)) * dimension\n}\n\n/** A pointer sample for the release velocity. */\nexport interface MotionSample {\n /** Time in ms (an event `timeStamp`). */\n t: number\n /** Position in px. */\n y: number\n}\n\n/** How far back (ms) the release velocity looks — older samples are stale (the finger may have paused). */\nconst VELOCITY_WINDOW = 100\n\n/** px / s over the last `VELOCITY_WINDOW` ms of `samples` (positive = moving down); `0` with too little data. */\nexport function releaseVelocity(samples: readonly MotionSample[]): number {\n if (samples.length < 2) return 0\n const last = samples[samples.length - 1]\n let first = samples[samples.length - 2]\n for (let i = samples.length - 2; i >= 0; i--) {\n if (last.t - samples[i].t > VELOCITY_WINDOW) break\n first = samples[i]\n }\n const dt = last.t - first.t\n return dt > 0 ? ((last.y - first.y) / dt) * 1000 : 0\n}\n\n/** A release faster than this (px / s) is a fling: it moves to the next snap in its direction. */\nexport const FLING_VELOCITY = 800\n\n/**\n * Where a release lands, as a height: `height` is the sheet's visible height at release, `velocity` its\n * rate of change in px / s (positive = growing, i.e. the finger moving UP), `snaps` the ascending snap\n * heights. With `dismissible`, `0` (closed) is a candidate too. A fling goes to the next candidate in its\n * direction; a slow release goes to the nearest one.\n */\nexport function pickSnap(\n height: number,\n velocity: number,\n snaps: readonly number[],\n dismissible: boolean,\n): number {\n const candidates = dismissible ? [0, ...snaps] : [...snaps]\n if (velocity >= FLING_VELOCITY) {\n return candidates.find((c) => c > height + 1) ?? candidates[candidates.length - 1]\n }\n if (velocity <= -FLING_VELOCITY) {\n return [...candidates].reverse().find((c) => c < height - 1) ?? candidates[0]\n }\n return candidates.reduce((best, c) => (Math.abs(c - height) < Math.abs(best - height) ? c : best))\n}\n\n/** Whether the user asked for reduced motion (then a spring jumps straight to its target). */\nexport const prefersReducedMotion = () =>\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\nexport interface SheetSpringOptions {\n stiffness?: number\n damping?: number\n}\n\n/**\n * Spring a value `from` → `to`, starting at `velocity` (units / s), calling `onFrame(value, velocity)` every\n * animation frame and once with `to` at the end, then `onDone`. Returns a cancel function. Jumps straight\n * to `to` under reduced motion (or without `requestAnimationFrame`).\n */\nexport function animateSpring(\n from: number,\n to: number,\n velocity: number,\n onFrame: (value: number, velocity: number) => void,\n onDone?: () => void,\n { stiffness = 420, damping = 38 }: SheetSpringOptions = {},\n): () => void {\n if (prefersReducedMotion() || typeof requestAnimationFrame !== 'function' || from === to) {\n onFrame(to, 0)\n onDone?.()\n return () => {}\n }\n let x = from\n let v = velocity\n let last = performance.now()\n let raf = 0\n let cancelled = false\n const step = (now: number) => {\n if (cancelled) return\n // sub-step so a long frame (a background tab, a GC pause) can't blow the integration up\n let dt = Math.min(0.064, Math.max(0, (now - last) / 1000))\n last = now\n while (dt > 0) {\n const h = Math.min(dt, 1 / 240)\n v += (-stiffness * (x - to) - damping * v) * h\n x += v * h\n dt -= h\n }\n if (Math.abs(x - to) < 0.3 && Math.abs(v) < 8) {\n onFrame(to, 0)\n onDone?.()\n return\n }\n onFrame(x, v)\n raf = requestAnimationFrame(step)\n }\n raf = requestAnimationFrame(step)\n return () => {\n cancelled = true\n cancelAnimationFrame(raf)\n }\n}\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Overlay } from '../Overlay/Overlay'\nimport { decideBodyGesture, handoff, momentumStep, type BodyGestureMode } from './gesture'\nimport {\n animateSpring,\n pickSnap,\n prefersReducedMotion,\n releaseVelocity,\n resolveSnapPoints,\n rubberBand,\n type BottomSheetSnapPoint,\n type MotionSample,\n} from './motion'\nimport styles from './BottomSheet.module.css'\n\nexport type { BottomSheetSnapPoint } from './motion'\n\nconst FOCUSABLE =\n 'a[href]:not([tabindex=\"-1\"]), button:not(:disabled):not([tabindex=\"-1\"]), textarea:not(:disabled):not([tabindex=\"-1\"]), input:not(:disabled):not([tabindex=\"-1\"]), select:not(:disabled):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'\n\n/** Controls a drag on the header must not start from (they keep their own click). */\nconst INTERACTIVE = 'button, a, input, textarea, select, [contenteditable], [role=\"button\"]'\n\n/** Form fields — they keep their own touch, and bring up the phone keyboard. */\nconst FIELDS = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])'\n\n/** Content a touch on the body never drags the sheet from — fields keep their own touch, and anything can opt\n * out with `data-sheet-no-drag` (a map, a slider, a signature pad). */\nconst NO_DRAG = `${FIELDS}, [data-sheet-no-drag]`\n\n/** A visible area this much (px) shorter than when the sheet opened means the keyboard is up. */\nconst KEYBOARD_MIN = 80\n\n/** Room (px) kept between a focused field and the keyboard / footer when it's scrolled into view. */\nconst FIELD_MARGIN = 16\n\n/** The visual viewport, unless pinch-zoomed (then its size isn't the space the sheet's layer can use). */\nfunction visibleViewport() {\n const vv = typeof window === 'undefined' ? null : window.visualViewport\n return vv && !(vv.scale > 1.01) ? vv : null\n}\n\n/** The height of the sheet's full-screen layer (the scrim) — `innerHeight` until it has a size. */\nfunction layerHeight(layer: HTMLElement | null) {\n return layer?.getBoundingClientRect().height || window.innerHeight\n}\n\n/**\n * Where the visible area starts in the layer's coordinates, px. iOS brings a focused field into view in one\n * of two ways: it **pans** the visual viewport (`offsetTop`; the fixed layer moves up with the page, so the\n * visible area starts `offsetTop` down the layer), or — iOS 26 — it **scrolls the page** and reports about\n * the same `offsetTop` while the fixed layer stays on the screen. The page scroll since `baseScrollY` (when\n * the sheet opened) tells the two apart.\n */\nfunction visibleTop(baseScrollY: number) {\n const vv = visibleViewport()\n if (!vv) return 0\n return Math.max(0, Math.round(vv.offsetTop - (window.scrollY - baseScrollY)))\n}\n\n/**\n * How much of the sheet's layer the browser covers at the bottom, px: the keyboard (plus, on iOS 26, its\n * accessory bar and the floating address bar) — the layer's bottom minus the visible area's bottom.\n * Measured on the layer itself, not `innerHeight` (iOS 26 resizes the layout viewport in steps while the\n * keyboard opens). `0` without `visualViewport` or while pinch-zoomed.\n */\nfunction coveredBottom(layer: HTMLElement | null, baseScrollY: number) {\n const vv = visibleViewport()\n if (!vv) return 0\n const bottom = layer?.getBoundingClientRect().bottom || window.innerHeight\n const inset = Math.round(bottom - visibleTop(baseScrollY) - vv.height)\n return inset > 1 ? inset : 0\n}\n\n/** A touch screen (the phone keyboard's home). */\nconst isTouchScreen = () =>\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(pointer: coarse)').matches\n\n// The page pin is shared and ref-counted (like the overflow lock): a sheet sliding out while the next one\n// opens must not hand the page back — nor restore the other's pin. Saved on the first pin, put back on the last.\nlet pins = 0\nlet pinned: { x: number; y: number; before: string[] } | null = null\nconst PIN_KEYS = ['position', 'top', 'left', 'right', 'width'] as const\n\nfunction pinPage() {\n if (pins++ > 0) return\n const { body } = document\n const x = window.scrollX\n const y = window.scrollY\n // only these properties are touched (the scroll lock sets others on the body, and may release first)\n pinned = { x, y, before: PIN_KEYS.map((key) => body.style[key]) }\n Object.assign(body.style, {\n position: 'fixed',\n top: `${-y}px`,\n left: `${-x}px`,\n right: '0',\n width: '100%',\n })\n}\n\nfunction unpinPage() {\n pins = Math.max(0, pins - 1)\n if (pins > 0 || !pinned) return\n const { x, y, before } = pinned\n pinned = null\n PIN_KEYS.forEach((key, i) => {\n document.body.style[key] = before[i]\n })\n window.scrollTo(x, y)\n // again once the overflow lock is released too, if it still held the page\n requestAnimationFrame(() => {\n if (window.scrollX !== x || window.scrollY !== y) window.scrollTo(x, y)\n })\n}\n\n/** Whether an element scrolls its own content (either axis) and has something to scroll. */\nfunction canScroll(el: Element) {\n const style = getComputedStyle(el)\n const y = /auto|scroll/.test(style.overflowY) && el.scrollHeight > el.clientHeight\n const x = /auto|scroll/.test(style.overflowX) && el.scrollWidth > el.clientWidth\n return y || x\n}\n\n/** How long (ms) the layer keeps being re-measured after a keyboard event — iOS doesn't report every step. */\nconst KEYBOARD_WATCH = 1000\n\n/** Movement (px) before a press on the drag area counts as a drag rather than a tap. */\nconst DRAG_SLOP = 4\n\nconst DEFAULT_SNAP_POINTS: BottomSheetSnapPoint[] = ['50%', '100%']\n\n/** The tallest the sheet may be, as a share of the space it fits into — it never reaches the top edge. */\nconst MAX_HEIGHT_RATIO = 0.96\n\nexport interface BottomSheetProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Whether the sheet is open — it slides up on open and down on close (then unmounts). */\n open: boolean\n /** Called when a dismiss is requested — a swipe down past the lowest snap, a backdrop click, Escape or the ×. */\n onClose: () => void\n /**\n * The heights the sheet rests at — px, a percentage of the viewport height (`'50%'`), or `'content'` (the\n * sheet's own content height: handle + header + body content + footer, followed as it changes). Sorted\n * ascending and de-duplicated; each is capped at 96% of the visible height (it never reaches the top edge).\n * Defaults to `['50%', '100%']`.\n */\n snapPoints?: BottomSheetSnapPoint[]\n /** The snap point (index into `snapPoints`, after sorting) the sheet opens at. Defaults to `0`. */\n defaultSnapIndex?: number\n /** Called with the new snap index each time the sheet comes to rest at a different snap point. */\n onSnapChange?: (index: number) => void\n /** Swiping down past the lowest snap point closes the sheet. Defaults to `true`. */\n swipeToClose?: boolean\n /** Close when the backdrop (above the sheet) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Header title. When set, labels the sheet (`aria-labelledby`). */\n title?: ReactNode\n /** Muted description line under the title. */\n description?: ReactNode\n /** Footer slot — pinned to the bottom of the screen at every snap point (e.g. Cancel / Apply). */\n footer?: ReactNode\n /** Show a header × close button. Defaults to `false` (the handle, a swipe, the backdrop and Escape close it). */\n showCloseButton?: boolean\n /** Accessible label — used when there's no `title`. */\n ariaLabel?: string\n /** Backdrop darkness at the lowest snap and above (0–1). Defaults to `0.45`. */\n dim?: number\n /** Extra class on the scrollable body element. */\n bodyClassName?: string\n /** Sheet body — scrolls inside the sheet. */\n children?: ReactNode\n}\n\n/**\n * A bottom sheet: a panel that slides up from the bottom of the screen and rests at one of its\n * **`snapPoints`**. Drag its handle / header to move it — it follows the finger, resists past the top\n * (rubber band), carries a fling into the next snap point, and closes when pulled below the lowest one\n * (`swipeToClose`). Motion is transform-only (GPU) with a spring that keeps the release velocity; the\n * backdrop dims in proportion to the height. Portaled over a dimmed backdrop (the shared `Overlay`): page\n * scroll is locked (on a touch screen the page is pinned), focus moves into the sheet and is trapped there,\n * and returns to the opener on close unless something else took it.\n * The handle is a button: Enter / Space / a tap step to the next snap point, Arrow Up / Down move one,\n * Home / End jump to the lowest / highest. Controlled by `open` + `onClose`; the ref points at the sheet.\n *\n * @example\n * <BottomSheet open={isOpen} onClose={close} title=\"Filters\" footer={<Button onClick={close}>Apply</Button>}>\n * …\n * </BottomSheet>\n */\nexport const BottomSheet = forwardRef<HTMLDivElement, BottomSheetProps>(function BottomSheet(\n {\n open,\n onClose,\n snapPoints = DEFAULT_SNAP_POINTS,\n defaultSnapIndex = 0,\n onSnapChange,\n swipeToClose = true,\n closeOnBackdrop = true,\n closeOnEscape = true,\n title,\n description,\n footer,\n showCloseButton = false,\n ariaLabel,\n dim,\n bodyClassName,\n className,\n style,\n children,\n ...props\n },\n forwardedRef,\n) {\n const t = useT()\n const titleId = useId()\n const descId = useId()\n\n // mounted while open AND while the exit animation runs after `open` turns false\n const [mounted, setMounted] = useState(open)\n if (open && !mounted) setMounted(true)\n\n const sheetRef = useRef<HTMLDivElement | null>(null)\n const scrimRef = useRef<HTMLDivElement | null>(null)\n const footerRef = useRef<HTMLDivElement | null>(null)\n const dragAreaRef = useRef<HTMLDivElement | null>(null)\n const contentRef = useRef<HTMLDivElement | null>(null)\n const bodyRef = useRef<HTMLDivElement | null>(null)\n\n // live motion state — kept in refs: a drag frame must never wait for a React render\n const offset = useRef(0) // translateY of the sheet, px (0 = its full height is visible)\n const maxHeight = useRef(0) // the sheet's laid-out height = the tallest snap\n const snaps = useRef<number[]>([]) // ascending snap heights, px\n const snapIndex = useRef(0) // the snap it's at or heading to (steps count from here, even mid-flight)\n const restIndex = useRef(-1) // the snap it last came to rest at (what `onSnapChange` reported)\n const cancelAnim = useRef<() => void>(() => {})\n const animating = useRef(false) // a spring is running (a touch on the body then grabs the sheet)\n const cancelMomentum = useRef<() => void>(() => {}) // an emulated scroll's momentum\n const releaseVy = useRef(0) // the last release velocity (px / s, down = positive), for the exit\n const openRef = useRef(open)\n openRef.current = open\n const onSnapChangeRef = useRef(onSnapChange)\n onSnapChangeRef.current = onSnapChange\n const onCloseRef = useRef(onClose)\n onCloseRef.current = onClose\n const swipeToCloseRef = useRef(swipeToClose)\n swipeToCloseRef.current = swipeToClose\n // the phone keyboard: the lift being painted (animated) and the inset it's heading to\n const keyboard = useRef(0)\n const keyboardTarget = useRef(0)\n const cancelKeyboard = useRef<() => void>(() => {})\n // the page's scroll and the layer's height when the sheet opened (see `visibleTop`, `keyboardUp`)\n const baseScrollY = useRef(0)\n const baseHeight = useRef(0)\n /** Whether the phone keyboard is up: part of the layer is covered, or the visible area has shrunk. */\n const keyboardUp = () => {\n const vv = visibleViewport()\n return keyboardTarget.current > 0 || (!!vv && vv.height < baseHeight.current - KEYBOARD_MIN)\n }\n // a finger / pointer is moving the sheet (handle, header or body) — layout changes wait for its release\n const dragging = useRef(false)\n const refitPending = useRef(false)\n const refitRef = useRef<() => void>(() => {})\n // the pointer being dragged (null when none)\n const dragRef = useRef<{\n id: number\n startY: number\n startOffset: number\n dragging: boolean\n samples: MotionSample[]\n } | null>(null)\n // set by a drag's pointerup, cleared after that event's click: a drag on the handle is not a tap\n const suppressClick = useRef(false)\n\n // the element focused before opening — read during the render that opens the sheet\n const openerRef = useRef<HTMLElement | null>(null)\n const wasOpenRef = useRef(false)\n if (open !== wasOpenRef.current) {\n wasOpenRef.current = open\n if (open && typeof document !== 'undefined') {\n openerRef.current = document.activeElement as HTMLElement | null\n }\n }\n\n /** Paint an offset: the sheet, the footer pinned to the screen bottom, and the backdrop's dim. */\n const paint = useCallback((y: number) => {\n offset.current = y\n const sheet = sheetRef.current\n if (!sheet) return\n // lifted above the phone keyboard, if it's open\n sheet.style.transform = `translate3d(0, ${y - keyboard.current}px, 0)`\n const max = maxHeight.current\n const lowest = snaps.current[0] ?? max\n // the footer stays on the screen's bottom edge while the sheet is at / above its lowest snap, and goes\n // down with the sheet below it (a dismiss)\n if (footerRef.current)\n footerRef.current.style.transform = `translate3d(0, ${-Math.min(y, max - lowest)}px, 0)`\n // the backdrop's darkness (NOT its opacity — the sheet sits inside the scrim and would fade with it)\n if (scrimRef.current) {\n const visible = Math.max(0, max - y)\n const progress = Math.min(1, visible / Math.max(1, lowest))\n scrimRef.current.style.setProperty('--tz-sheet-progress', String(progress))\n }\n }, [])\n\n /** After coming to rest: let the body scroll its last content above the footer at this snap. */\n const settleLayout = useCallback(() => {\n const sheet = sheetRef.current\n if (!sheet) return\n sheet.style.setProperty('--tz-sheet-hidden', `${Math.max(0, offset.current)}px`)\n }, [])\n\n // the component is gone (a parent unmounted it mid-gesture): no more springs / callbacks\n const unmounted = useRef(false)\n // the running spring's velocity (px / s, down = positive) — carried on when a resize re-aims it\n const springVelocity = useRef(0)\n\n /** Spring to a snap index (or to closed with `index = -1`). */\n const springTo = useCallback(\n (index: number, velocity = 0, onDone?: () => void) => {\n cancelAnim.current()\n const max = maxHeight.current\n const target = index < 0 ? max : max - snaps.current[index]\n if (index >= 0) snapIndex.current = index\n animating.current = true\n const onFrame = (value: number, v: number) => {\n springVelocity.current = v\n paint(value)\n }\n const cancel = animateSpring(offset.current, target, velocity, onFrame, () => {\n animating.current = false\n if (index >= 0) {\n settleLayout()\n if (index !== restIndex.current) {\n restIndex.current = index\n onSnapChangeRef.current?.(index)\n }\n }\n onDone?.()\n })\n cancelAnim.current = () => {\n cancel()\n animating.current = false\n }\n },\n [paint, settleLayout],\n )\n\n /** A raw sheet offset with the rubber bands applied: past the tallest snap, and (without swipe-to-close)\n * below the lowest one. */\n const banded = useCallback((raw: number) => {\n const max = maxHeight.current\n const lowestOffset = max - snaps.current[0]\n const vh = (typeof window === 'undefined' ? 0 : window.innerHeight) || max\n let y = raw\n if (raw < 0) y = -rubberBand(-raw, vh)\n else if (!swipeToCloseRef.current && raw > lowestOffset)\n y = lowestOffset + rubberBand(raw - lowestOffset, vh)\n return Math.min(y, max)\n }, [])\n\n /** A drag of the sheet ended with velocity `vy` (px / s, down = positive): settle, or close. */\n const releaseSheet = useCallback(\n (vy: number) => {\n dragging.current = false\n // the space changed during the drag (the keyboard went away): re-fit before picking a snap\n if (refitPending.current) refitRef.current()\n const max = maxHeight.current\n const target = pickSnap(max - offset.current, -vy, snaps.current, swipeToCloseRef.current)\n if (target === 0) {\n releaseVy.current = vy\n onCloseRef.current()\n // a parent that keeps it open: settle back at the lowest snap\n requestAnimationFrame(() => {\n if (openRef.current && !unmounted.current) {\n releaseVy.current = 0\n springTo(0, vy)\n }\n })\n return\n }\n springTo(snaps.current.indexOf(target), vy)\n },\n [springTo],\n )\n\n /**\n * The sheet's natural content height — handle + header, the body's content, the footer — plus the sheet's\n * own top border, rounded UP: a sheet even a fraction of a pixel shorter than its content would let the\n * body scroll.\n */\n const contentHeight = () => {\n const h = (el: HTMLElement | null) => el?.getBoundingClientRect().height ?? 0\n const sheet = sheetRef.current\n const border = sheet ? sheet.offsetHeight - sheet.clientHeight : 0\n // with no header the body is pulled up into the handle's strip (a negative margin) — count it\n const pull = bodyRef.current ? parseFloat(getComputedStyle(bodyRef.current).marginTop) || 0 : 0\n return Math.ceil(\n h(dragAreaRef.current) + pull + h(contentRef.current) + h(footerRef.current) + border,\n )\n }\n\n /** Measure the viewport, resolve the snap points and size the sheet (no animation). */\n const measure = useCallback(() => {\n const vh = typeof window === 'undefined' ? 0 : layerHeight(scrimRef.current)\n // the sheet fits into the visible area — with the keyboard up that's less than the layer, even when\n // nothing of the layer is covered (iOS 26 can move the layer up past the screen's top instead);\n // percentages stay of the layer\n const vv = visibleViewport()\n const available = vv ? Math.min(vh, vv.height) : vh\n const heights = resolveSnapPoints(\n snapPoints,\n vh,\n Math.max(1, Math.floor(available * MAX_HEIGHT_RATIO)),\n snapPoints.includes('content') ? contentHeight() : undefined,\n )\n snaps.current = heights\n maxHeight.current = heights[heights.length - 1]\n if (sheetRef.current) sheetRef.current.style.height = `${maxHeight.current}px`\n // snapPoints is compared by value (an inline array literal is a new array every render)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(snapPoints)])\n\n // open: size the sheet, start it below the screen, spring it up to `defaultSnapIndex`; close: spring it\n // down (carrying a swipe's velocity), then unmount\n useLayoutEffect(() => {\n if (!mounted) return\n if (open) {\n // a just-mounted sheet has no transform yet; one sliding out (re-opened mid-exit) has\n const fresh = !sheetRef.current?.style.transform\n measure()\n const index = Math.min(Math.max(0, defaultSnapIndex), snaps.current.length - 1)\n if (fresh) {\n paint(maxHeight.current) // just below the screen\n // opening at the default snap isn't a \"change\" (onSnapChange reports moves the user makes)\n restIndex.current = index\n springTo(index)\n } else {\n // re-opened mid-exit: back up to where it was\n springTo(snapIndex.current)\n }\n } else {\n // a focused field inside would keep the keyboard up over the page\n const active = document.activeElement\n if (active instanceof HTMLElement && sheetRef.current?.contains(active)) active.blur()\n const vy = releaseVy.current\n releaseVy.current = 0\n springTo(-1, vy, () => setMounted(false))\n }\n // defaultSnapIndex is read on open only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, mounted])\n\n useEffect(() => {\n unmounted.current = false\n return () => {\n unmounted.current = true\n cancelAnim.current()\n }\n }, [])\n\n // a resize (rotation, a desktop window) re-resolves the snap points and jumps to the current one — but a\n // sheet in motion keeps moving (iOS resizes as the sheet opens: pinning the page brings its toolbar back),\n // and a closing one just finishes\n useEffect(() => {\n if (!mounted) return\n const onResize = () => {\n if (dragging.current || !openRef.current) return\n measure()\n const index = Math.min(snapIndex.current, snaps.current.length - 1)\n if (animating.current) {\n springTo(index, springVelocity.current)\n return\n }\n snapIndex.current = index\n cancelAnim.current()\n paint(openRef.current ? maxHeight.current - snaps.current[index] : maxHeight.current)\n settleLayout()\n }\n window.addEventListener('resize', onResize)\n return () => window.removeEventListener('resize', onResize)\n }, [mounted, measure, paint, settleLayout, springTo])\n\n // ── the phone keyboard ───────────────────────────────────────────────────────────────────────────────\n /** Re-resolve the snaps (the space changed) keeping the sheet's visible height — no jump. */\n const refit = useCallback(() => {\n refitPending.current = false\n const visible = maxHeight.current - offset.current\n measure()\n paint(maxHeight.current - Math.min(visible, maxHeight.current))\n }, [measure, paint])\n refitRef.current = refit\n\n /** Scroll the focused field (inside the body) into the space above the keyboard and the footer. */\n const revealFocusedField = useCallback(() => {\n const body = bodyRef.current\n const el = document.activeElement\n if (!body || !(el instanceof HTMLElement) || !body.contains(el) || !el.matches(FIELDS)) return\n // the visible bottom (in the layer's coordinates — see `visibleTop`), or the footer's top above it\n const vv = visibleViewport()\n const screenBottom = vv ? visibleTop(baseScrollY.current) + vv.height : window.innerHeight\n const footerTop = footerRef.current?.getBoundingClientRect().top || Infinity\n const bottom = Math.min(screenBottom, footerTop) - FIELD_MARGIN\n const top = body.getBoundingClientRect().top + FIELD_MARGIN\n const rect = el.getBoundingClientRect()\n if (rect.bottom > bottom) body.scrollTop += rect.bottom - bottom\n else if (rect.top < top) body.scrollTop -= top - rect.top\n }, [])\n\n // the keyboard opening / closing (the visual viewport resizing): fit the snaps into the space above it,\n // lift the sheet onto it (a spring), and bring the focused field into view\n useEffect(() => {\n const vv = typeof window === 'undefined' ? undefined : window.visualViewport\n const sheet = sheetRef.current\n if (!mounted || !vv || !sheet) return\n baseScrollY.current = window.scrollY\n baseHeight.current = layerHeight(scrimRef.current)\n const apply = (inset: number) => {\n keyboardTarget.current = inset\n if (openRef.current && dragging.current) {\n // mid-drag (e.g. the drag itself put the keyboard away): re-fit on release\n refitPending.current = true\n } else if (openRef.current) {\n // a sheet in motion (opening) keeps its speed\n const velocity = animating.current ? springVelocity.current : 0\n cancelAnim.current()\n refit()\n springTo(Math.min(snapIndex.current, snaps.current.length - 1), velocity)\n }\n cancelKeyboard.current()\n cancelKeyboard.current = animateSpring(\n keyboard.current,\n inset,\n 0,\n (value) => {\n keyboard.current = value\n paint(offset.current)\n },\n () => {\n revealFocusedField()\n },\n )\n }\n // iOS reports the keyboard in steps, and not every step fires an event (iOS 26 resizes the layout\n // viewport on its own): after each event the layer is re-measured every frame for a while, and a value\n // that holds for a few frames is applied\n let poll = 0\n let watchUntil = 0\n let seen = ''\n let steady = 0\n // what the sheet was last fitted to: the covered part and the visible height (either can change alone —\n // iOS 26 may move the layer up past the screen's top, so less is visible with nothing covered)\n const read = () => {\n const inset = coveredBottom(scrimRef.current, baseScrollY.current)\n const visible = Math.round(visibleViewport()?.height ?? 0)\n return { inset, key: `${inset}:${visible}` }\n }\n let fitted = read().key\n const tick = () => {\n const { inset, key } = read()\n steady = key === seen ? steady + 1 : 0\n seen = key\n if (steady === 3 && key !== fitted) {\n fitted = key\n apply(inset)\n }\n poll = performance.now() < watchUntil ? requestAnimationFrame(tick) : 0\n }\n const update = () => {\n const { inset, key } = read()\n if (key !== fitted) {\n fitted = key\n apply(inset)\n } else revealFocusedField()\n watchUntil = performance.now() + KEYBOARD_WATCH\n if (!poll && typeof requestAnimationFrame === 'function') poll = requestAnimationFrame(tick)\n }\n const onFocusIn = () => {\n update()\n // moving focus between fields with the keyboard already up: keep the new one in view\n if (keyboardUp()) requestAnimationFrame(revealFocusedField)\n }\n vv.addEventListener('resize', update)\n vv.addEventListener('scroll', update)\n window.addEventListener('resize', update)\n sheet.addEventListener('focusin', onFocusIn)\n sheet.addEventListener('focusout', update)\n update()\n return () => {\n vv.removeEventListener('resize', update)\n vv.removeEventListener('scroll', update)\n window.removeEventListener('resize', update)\n sheet.removeEventListener('focusin', onFocusIn)\n sheet.removeEventListener('focusout', update)\n cancelAnimationFrame(poll)\n cancelKeyboard.current()\n keyboard.current = 0\n keyboardTarget.current = 0\n }\n }, [mounted, measure, paint, refit, springTo, revealFocusedField])\n\n // iOS scrolls the page behind even when its overflow is locked — to a focused field, or under a finger once\n // the keyboard is up — and the sheet's fixed layer then moves with the page (the page shows below it). On a\n // touch screen the page is pinned instead (the classic iOS lock: the body fixed at its scroll offset, put\n // back on close), so iOS can only pan the visual viewport, which `visibleTop` accounts for.\n useLayoutEffect(() => {\n if (!mounted || !isTouchScreen()) return\n pinPage()\n return unpinPage\n }, [mounted])\n\n // …and a finger never scrolls / pans the page: a touch move is stopped unless something it's on can scroll\n // (the body, a nested scroller, a portaled option list) or handles its own moves (`data-sheet-no-drag`, a\n // range input); the sheet's own drags stop theirs themselves\n useEffect(() => {\n if (!mounted || typeof document === 'undefined') return\n const onMove = (event: TouchEvent) => {\n if (event.touches.length > 1 || !event.cancelable) return\n const target = event.target as Element | null\n // a slider, a map, a signature pad: their own moves\n if (target?.closest?.('[data-sheet-no-drag], input[type=\"range\"]')) return\n for (let el = target; el && el !== document.body; el = el.parentElement) {\n const scroller = el === bodyRef.current ? el.scrollHeight > el.clientHeight : canScroll(el)\n if (scroller) return\n }\n event.preventDefault()\n }\n document.addEventListener('touchmove', onMove, { passive: false })\n return () => document.removeEventListener('touchmove', onMove)\n }, [mounted])\n\n /** Dragging the sheet with the keyboard up: put the keyboard away first (blur the focused field). */\n const dismissKeyboard = useCallback(() => {\n if (!keyboardUp()) return\n const active = document.activeElement\n if (\n active instanceof HTMLElement &&\n sheetRef.current?.contains(active) &&\n active.matches(FIELDS)\n )\n active.blur()\n }, [])\n\n // new snap points while open: re-resolve and settle at the same index\n const measuredWith = useRef(measure)\n useEffect(() => {\n if (measuredWith.current === measure) return\n measuredWith.current = measure\n if (!mounted || !openRef.current || dragging.current) return\n measure()\n springTo(Math.min(snapIndex.current, snaps.current.length - 1))\n }, [measure, mounted, springTo])\n\n // `'content'`: follow the content's height — re-resolve when it changes and settle at the new height\n const usesContent = snapPoints.includes('content')\n useEffect(() => {\n if (!mounted || !usesContent || typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(() => {\n if (!openRef.current || dragging.current) return\n const before = snaps.current.join()\n measure()\n if (snaps.current.join() !== before)\n springTo(Math.min(snapIndex.current, snaps.current.length - 1))\n })\n for (const el of [dragAreaRef.current, contentRef.current, footerRef.current])\n if (el) observer.observe(el)\n return () => observer.disconnect()\n }, [mounted, usesContent, measure, springTo])\n\n // the footer's height, so the body can scroll its last content above it\n useEffect(() => {\n const footerEl = footerRef.current\n const sheet = sheetRef.current\n if (!mounted || !footerEl || !sheet) return\n const update = () =>\n sheet.style.setProperty('--tz-sheet-footer', `${footerEl.getBoundingClientRect().height}px`)\n update()\n if (typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(update)\n observer.observe(footerEl)\n return () => observer.disconnect()\n }, [mounted, footer])\n\n // focus: into the sheet on open (the sheet itself — a field would pop the phone keyboard), back to the\n // opener once the sheet has unmounted\n useEffect(() => {\n if (!mounted) return\n const sheet = sheetRef.current\n if (sheet && !sheet.contains(document.activeElement)) sheet.focus({ preventScroll: true })\n const opener = openerRef.current\n return () => {\n // only while nobody else owns focus — a Modal / sheet opened as this one slid out keeps it\n const active = document.activeElement\n const free = !active || active === document.body || !!sheet?.contains(active)\n if (free && opener?.isConnected) opener.focus?.({ preventScroll: true })\n }\n }, [mounted])\n\n // ── drag from the body (touch): the scroll ↔ sheet handoff ─────────────────────────────────────────\n // A touch on the content scrolls it or moves the sheet, handing over mid-gesture (see `gesture.ts`). Touch\n // events, not pointer events: only a non-passive `touchmove` can stop the native scroll once the sheet takes\n // a gesture — the content is then scrolled by hand (with momentum). A mouse scrolls the body with its wheel.\n const hasBody = children != null\n useEffect(() => {\n const body = bodyRef.current\n if (!mounted || !body) return\n let gesture: {\n id: number\n x0: number\n y0: number\n lastY: number\n mode: BodyGestureMode\n raw: number\n grabbed: boolean\n samples: MotionSample[]\n } | null = null\n const scrollMax = () => Math.max(0, body.scrollHeight - body.clientHeight)\n /** Touches the sheet never takes: fields, opt-outs, and nested vertical scrollers. */\n const leaveAlone = (target: EventTarget | null) => {\n const el = target instanceof Element ? target : null\n if (!el) return false\n if (el.closest(NO_DRAG)) return true\n for (let n: Element | null = el; n && n !== body; n = n.parentElement) {\n const overflow = getComputedStyle(n).overflowY\n if ((overflow === 'auto' || overflow === 'scroll') && n.scrollHeight > n.clientHeight + 1)\n return true\n }\n return false\n }\n const own = (e: TouchEvent) =>\n gesture ? Array.from(e.changedTouches).find((t) => t.identifier === gesture!.id) : undefined\n\n const momentum = (velocity: number) => {\n cancelMomentum.current()\n if (prefersReducedMotion() || Math.abs(velocity) < 50) return\n let v = velocity\n let pos = body.scrollTop\n let last = performance.now()\n let raf = 0\n const step = (now: number) => {\n const dt = Math.min(0.064, Math.max(0, (now - last) / 1000))\n last = now\n const next = momentumStep(pos, v, dt, scrollMax())\n pos = next.scrollTop\n v = next.velocity\n body.scrollTop = pos\n if (v !== 0) raf = requestAnimationFrame(step)\n }\n raf = requestAnimationFrame(step)\n cancelMomentum.current = () => cancelAnimationFrame(raf)\n }\n\n const onStart = (e: TouchEvent) => {\n cancelMomentum.current()\n gesture = null\n if (!openRef.current || e.touches.length !== 1 || leaveAlone(e.target)) return\n const t = e.touches[0]\n // a touch on a moving sheet catches it\n const grabbed = animating.current\n if (grabbed) cancelAnim.current()\n gesture = {\n id: t.identifier,\n x0: t.clientX,\n y0: t.clientY,\n lastY: t.clientY,\n mode: 'pending',\n raw: offset.current,\n grabbed,\n samples: [{ t: e.timeStamp, y: t.clientY }],\n }\n }\n const onMove = (e: TouchEvent) => {\n const g = gesture\n if (!g || g.mode === 'native') return\n const t = own(e)\n if (!t) return\n if (g.mode === 'pending') {\n const dx = t.clientX - g.x0\n const dy = t.clientY - g.y0\n if (Math.abs(dx) < DRAG_SLOP && Math.abs(dy) < DRAG_SLOP) return\n const mode = decideBodyGesture({\n offset: offset.current,\n scrollTop: body.scrollTop,\n canScroll: scrollMax() > 0,\n dx,\n dy,\n })\n if (mode === 'native') {\n g.mode = 'native'\n // a caught sheet that the content's own scroll leaves behind: let it settle\n if (g.grabbed) springTo(snapIndex.current)\n return\n }\n g.mode = 'sheet'\n g.raw = offset.current\n dragging.current = true\n sheetRef.current?.setAttribute('data-dragging', 'true')\n dismissKeyboard()\n }\n if (e.cancelable) e.preventDefault()\n const dy = t.clientY - g.lastY\n g.lastY = t.clientY\n g.samples.push({ t: e.timeStamp, y: t.clientY })\n if (g.samples.length > 8) g.samples.shift()\n const next = handoff(\n { mode: g.mode as 'sheet' | 'scroll', raw: g.raw, scrollTop: body.scrollTop },\n dy,\n scrollMax(),\n )\n g.mode = next.mode\n g.raw = next.raw\n if (next.scrollTop !== body.scrollTop) body.scrollTop = next.scrollTop\n paint(banded(next.raw))\n }\n const onEnd = (e: TouchEvent, cancelled: boolean) => {\n const g = gesture\n if (!g || !own(e)) return\n gesture = null\n if (g.mode === 'native') return\n if (g.mode === 'pending') {\n // a tap: a caught sheet settles where it was heading\n if (g.grabbed) springTo(snapIndex.current)\n return\n }\n sheetRef.current?.removeAttribute('data-dragging')\n const vy = cancelled ? 0 : releaseVelocity(g.samples)\n // scrolling the content by hand: carry the flick on as momentum (the finger's opposite)\n if (g.mode === 'scroll' && g.raw >= 0) {\n dragging.current = false\n if (refitPending.current) {\n refit()\n springTo(Math.min(snapIndex.current, snaps.current.length - 1))\n }\n momentum(-vy)\n } else releaseSheet(vy)\n }\n const onTouchEnd = (e: TouchEvent) => onEnd(e, false)\n const onTouchCancel = (e: TouchEvent) => onEnd(e, true)\n\n body.addEventListener('touchstart', onStart, { passive: true })\n // non-passive: once the sheet owns a gesture it must stop the native scroll\n body.addEventListener('touchmove', onMove, { passive: false })\n body.addEventListener('touchend', onTouchEnd)\n body.addEventListener('touchcancel', onTouchCancel)\n return () => {\n body.removeEventListener('touchstart', onStart)\n body.removeEventListener('touchmove', onMove)\n body.removeEventListener('touchend', onTouchEnd)\n body.removeEventListener('touchcancel', onTouchCancel)\n cancelMomentum.current()\n }\n }, [mounted, hasBody, paint, banded, springTo, releaseSheet, dismissKeyboard, refit])\n\n // ── drag (the handle + header) ──────────────────────────────────────────────────────────────────────\n\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (!open || (event.pointerType === 'mouse' && event.button !== 0)) return\n const target = event.target as HTMLElement\n // a control in the header keeps its own click — except the handle, which is the thing you drag\n const control = target.closest(INTERACTIVE)\n if (control && !control.hasAttribute('data-sheet-handle')) return\n cancelAnim.current()\n dragRef.current = {\n id: event.pointerId,\n startY: event.clientY,\n startOffset: offset.current,\n dragging: false,\n samples: [{ t: event.timeStamp, y: event.clientY }],\n }\n }\n\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const drag = dragRef.current\n if (!drag || drag.id !== event.pointerId) return\n const dy = event.clientY - drag.startY\n if (!drag.dragging) {\n if (Math.abs(dy) < DRAG_SLOP) return\n drag.dragging = true\n dragging.current = true\n sheetRef.current?.setAttribute('data-dragging', 'true')\n dismissKeyboard()\n // capture only once it IS a drag: a tap must still reach the handle as a click\n event.currentTarget.setPointerCapture?.(event.pointerId)\n }\n drag.samples.push({ t: event.timeStamp, y: event.clientY })\n if (drag.samples.length > 8) drag.samples.shift()\n paint(banded(drag.startOffset + dy))\n }\n\n const finishDrag = (event: PointerEvent<HTMLDivElement>, cancelled: boolean) => {\n const drag = dragRef.current\n if (!drag || drag.id !== event.pointerId) return\n dragRef.current = null\n sheetRef.current?.removeAttribute('data-dragging')\n if (!drag.dragging) {\n // a tap: the handle's own click handles it; anywhere else on the header, settle where it was\n if (!(event.target as HTMLElement).closest('[data-sheet-handle]')) springTo(snapIndex.current)\n return\n }\n // a drag is not a click — keep the handle from stepping the snap on this pointerup's click (if any)\n suppressClick.current = true\n setTimeout(() => {\n suppressClick.current = false\n }, 0)\n releaseSheet(cancelled ? 0 : releaseVelocity(drag.samples))\n }\n\n // ── the handle: a button that steps through the snap points ─────────────────────────────────────────\n const stepTo = (index: number) => {\n const last = snaps.current.length - 1\n springTo(Math.min(Math.max(0, index), last))\n }\n const onHandleClick = () => {\n if (suppressClick.current) {\n suppressClick.current = false\n return\n }\n const last = snaps.current.length - 1\n stepTo(snapIndex.current >= last ? 0 : snapIndex.current + 1)\n }\n const onHandleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n const last = snaps.current.length - 1\n const moves: Record<string, number> = {\n ArrowUp: snapIndex.current + 1,\n ArrowRight: snapIndex.current + 1,\n ArrowDown: snapIndex.current - 1,\n ArrowLeft: snapIndex.current - 1,\n Home: 0,\n End: last,\n }\n if (!(event.key in moves)) return\n event.preventDefault()\n stepTo(moves[event.key])\n }\n\n // trap Tab within the sheet (Escape + backdrop dismissal live in `<Overlay>`)\n const handleTabTrap = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab') return\n const sheet = sheetRef.current\n if (!sheet) return\n const focusables = [...sheet.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => el.offsetParent !== null || el === document.activeElement,\n )\n if (focusables.length === 0) {\n event.preventDefault()\n sheet.focus()\n return\n }\n const first = focusables[0]\n const last = focusables[focusables.length - 1]\n const active = document.activeElement\n if (event.shiftKey && (active === first || active === sheet)) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n const setSheetRef = (node: HTMLDivElement | null) => {\n sheetRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n if (!mounted) return null\n\n const hasHeader = title != null || description != null || showCloseButton\n\n return (\n <Overlay\n ref={scrimRef}\n open={mounted}\n // while it slides out the sheet is already closing — no second dismiss\n onClose={open ? onClose : undefined}\n closeOnBackdrop={closeOnBackdrop}\n closeOnEscape={closeOnEscape}\n onKeyDown={handleTabTrap}\n dim={dim}\n className={styles.overlay}\n data-closing={open ? undefined : 'true'}\n >\n <div\n ref={setSheetRef}\n className={clsx(styles.sheet, className)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title != null ? titleId : undefined}\n aria-label={title == null ? ariaLabel : undefined}\n aria-describedby={description != null ? descId : undefined}\n tabIndex={-1}\n style={style as CSSProperties}\n {...props}\n >\n <div\n ref={dragAreaRef}\n className={styles.dragArea}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={(e) => finishDrag(e, false)}\n onPointerCancel={(e) => finishDrag(e, true)}\n >\n <button\n type=\"button\"\n className={styles.handle}\n data-sheet-handle=\"\"\n aria-label={t('bottomSheet.resize')}\n onClick={onHandleClick}\n onKeyDown={onHandleKeyDown}\n >\n <span className={styles.handleBar} aria-hidden />\n </button>\n {hasHeader && (\n <div className={styles.header}>\n {(title != null || description != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n )}\n {description != null && (\n <div id={descId} className={styles.subtitle}>\n {description}\n </div>\n )}\n </div>\n )}\n {showCloseButton && (\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n size=\"sm\"\n className={styles.close}\n aria-label={t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )}\n </div>\n {children != null && (\n <div\n ref={bodyRef}\n className={clsx(\n styles.body,\n !hasHeader && styles.bodyNoHeader,\n footer != null && styles.bodyWithFooter,\n bodyClassName,\n )}\n // the header's divider shows only once the content scrolls under it\n onScroll={(e) => {\n const scrolled = e.currentTarget.scrollTop > 0\n if (scrolled !== sheetRef.current?.hasAttribute('data-scrolled'))\n sheetRef.current?.toggleAttribute('data-scrolled', scrolled)\n }}\n >\n <div ref={contentRef} className={styles.bodyContent}>\n {children}\n </div>\n </div>\n )}\n {footer != null && (\n <div ref={footerRef} className={styles.footer}>\n {footer}\n </div>\n )}\n </div>\n </Overlay>\n )\n})\n"],"names":["decideBodyGesture","offset","scrollTop","canScroll","dx","dy","handoff","state","scrollMax","mode","raw","rest","take","momentumStep","velocity","dt","max","deceleration","next","v","resolveSnapPoints","points","viewport","content","heights","p","m","h","unique","b","rubberBand","distance","dimension","c","VELOCITY_WINDOW","releaseVelocity","samples","last","first","FLING_VELOCITY","pickSnap","height","snaps","dismissible","candidates","best","prefersReducedMotion","animateSpring","from","to","onFrame","onDone","stiffness","damping","x","raf","cancelled","step","now","FOCUSABLE","INTERACTIVE","FIELDS","NO_DRAG","KEYBOARD_MIN","FIELD_MARGIN","visibleViewport","vv","layerHeight","layer","visibleTop","baseScrollY","coveredBottom","bottom","inset","isTouchScreen","pins","pinned","PIN_KEYS","pinPage","body","y","key","unpinPage","before","el","style","KEYBOARD_WATCH","DRAG_SLOP","DEFAULT_SNAP_POINTS","MAX_HEIGHT_RATIO","BottomSheet","forwardRef","open","onClose","snapPoints","defaultSnapIndex","onSnapChange","swipeToClose","closeOnBackdrop","closeOnEscape","title","description","footer","showCloseButton","ariaLabel","dim","bodyClassName","className","children","props","forwardedRef","t","useT","titleId","useId","descId","mounted","setMounted","useState","sheetRef","useRef","scrimRef","footerRef","dragAreaRef","contentRef","bodyRef","maxHeight","snapIndex","restIndex","cancelAnim","animating","cancelMomentum","releaseVy","openRef","onSnapChangeRef","onCloseRef","swipeToCloseRef","keyboard","keyboardTarget","cancelKeyboard","baseHeight","keyboardUp","dragging","refitPending","refitRef","dragRef","suppressClick","openerRef","wasOpenRef","paint","useCallback","sheet","lowest","visible","progress","settleLayout","unmounted","springVelocity","springTo","index","target","value","cancel","_a","banded","lowestOffset","vh","releaseSheet","vy","contentHeight","border","pull","measure","available","useLayoutEffect","fresh","active","_b","useEffect","onResize","refit","revealFocusedField","screenBottom","footerTop","top","rect","apply","poll","watchUntil","seen","steady","read","fitted","tick","update","onFocusIn","onMove","event","dismissKeyboard","measuredWith","usesContent","observer","footerEl","opener","hasBody","gesture","leaveAlone","n","overflow","own","e","momentum","pos","onStart","grabbed","g","onEnd","onTouchEnd","onTouchCancel","onPointerDown","control","onPointerMove","drag","_c","finishDrag","stepTo","onHandleClick","onHandleKeyDown","moves","handleTabTrap","focusables","setSheetRef","node","hasHeader","jsx","Overlay","styles","jsxs","clsx","IconButton","Icon","scrolled"],"mappings":";;;;;;;AAqCO,SAASA,GAAkB,EAAE,QAAAC,GAAQ,WAAAC,GAAW,WAAAC,GAAW,IAAAC,GAAI,IAAAC,KAAoB;AACxF,SAAI,KAAK,IAAID,CAAE,IAAI,KAAK,IAAIC,CAAE,IAAU,WACpCJ,IAAS,MAAY,UACrBC,IAAY,IAAU,WACtBG,IAAK,IAAU,UACZF,IAAa,WAAsB;AAC5C;AAeO,SAASG,GAAQC,GAAqBF,GAAYG,GAAiC;AACxF,MAAI,EAAE,MAAAC,GAAM,KAAAC,GAAK,WAAAR,EAAA,IAAcK,GAC3BI,IAAON;AACX,MAAIM,IAAO,GAAG;AAEZ,QAAIF,MAAS,WAAWC,IAAM,GAAG;AAC/B,YAAME,IAAO,KAAK,IAAID,GAAM,CAACD,CAAG;AAChC,MAAAA,KAAOE,GACPD,KAAQC;AAAA,IACV;AACA,QAAID,IAAO,GAAG;AACZ,UAAIT,IAAYM,GAAW;AACzB,QAAAC,IAAO;AACP,cAAMG,IAAO,KAAK,IAAID,GAAMT,IAAYM,CAAS;AACjD,QAAAN,KAAaU,GACbD,KAAQC;AAAA,MACV;AAEA,MAAID,IAAO,MACTF,IAAOA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9E,IAAA5C,EAAS,YAAT,gBAAA4C,EAAkB,aAAa,uBAC9Cc,IAAA1D,EAAS,YAAT,QAAA0D,EAAkB,gBAAgB,iBAAiBgE;AAAA,gBACvD;AAAA,gBAEA,4BAAC,OAAA,EAAI,KAAKrH,IAAY,WAAWgH,EAAO,aACrC,UAAAhI,GAAA,CACH;AAAA,cAAA;AAAA,YAAA;AAAA,YAGHN,KAAU,QACT,gBAAAoI,EAAC,OAAA,EAAI,KAAKhH,GAAW,WAAWkH,EAAO,QACpC,UAAAtI,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const T=require("react/jsx-runtime"),r=require("react"),We=require("clsx"),dt=require("./Icon-BoQmbW7j.cjs"),ht=require("./IconButton-DOlCOuKu.cjs"),mt=require("./Overlay-CywFQfjm.cjs"),gt=require("./ConfigProvider-DPk0aHDG.cjs");function bt({offset:c,scrollTop:o,canScroll:d,dx:f,dy:i}){return Math.abs(f)>Math.abs(i)?"native":c>.5?"sheet":o>0?"native":i>0?"sheet":d?"native":"sheet"}function pt(c,o,d){let{mode:f,raw:i,scrollTop:m}=c,l=o;if(l<0){if(f==="sheet"&&i>0){const b=Math.max(l,-i);i+=b,l-=b}if(l<0){if(m<d){f="scroll";const b=Math.max(l,m-d);m-=b,l-=b}l<0&&(f=f==="scroll"&&m<d?f:"sheet",f==="sheet"&&(i+=l))}}else if(l>0){if(i>0&&(i+=l,l=0),l>0&&i<0){const b=Math.min(l,-i);i+=b,l-=b}if(l>0&&m>0){f="scroll";const b=Math.min(l,m);m-=b,l-=b}l>0&&(f="sheet",i+=l)}return{mode:f,raw:i,scrollTop:m}}function vt(c,o,d,f,i=.998){const m=c+o*d,l=o*Math.pow(i,d*1e3);return m<=0?{scrollTop:0,velocity:0}:m>=f?{scrollTop:f,velocity:0}:{scrollTop:m,velocity:Math.abs(l)<10?0:l}}function yt(c,o,d,f){const i=c.map(l=>{if(typeof l=="number")return l;if(l==="content")return f!=null&&f>0?f:d;const b=/^\s*(-?\d+(?:\.\d+)?)\s*%\s*$/.exec(l);return b?Number(b[1])/100*o:NaN}).filter(l=>Number.isFinite(l)&&l>0).map(l=>Math.round(Math.min(d,Math.max(1,l)))),m=[...new Set(i)].sort((l,b)=>l-b);return m.length?m:[Math.max(1,Math.round(d))]}function Ve(c,o,d=.55){return c<=0||o<=0?0:(1-1/(c*d/o+1))*o}const wt=100;function De(c){if(c.length<2)return 0;const o=c[c.length-1];let d=c[c.length-2];for(let i=c.length-2;i>=0&&!(o.t-c[i].t>wt);i--)d=c[i];const f=o.t-d.t;return f>0?(o.y-d.y)/f*1e3:0}const Ge=800;function xt(c,o,d,f){const i=f?[0,...d]:[...d];return o>=Ge?i.find(m=>m>c+1)??i[i.length-1]:o<=-Ge?[...i].reverse().find(m=>m<c-1)??i[0]:i.reduce((m,l)=>Math.abs(l-c)<Math.abs(m-c)?l:m)}const Qe=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Ue(c,o,d,f,i,{stiffness:m=420,damping:l=38}={}){if(Qe()||typeof requestAnimationFrame!="function"||c===o)return f(o,0),i==null||i(),()=>{};let b=c,O=d,k=performance.now(),Y=0,q=!1;const D=ee=>{if(q)return;let G=Math.min(.064,Math.max(0,(ee-k)/1e3));for(k=ee;G>0;){const U=Math.min(G,.004166666666666667);O+=(-m*(b-o)-l*O)*U,b+=O*U,G-=U}if(Math.abs(b-o)<.3&&Math.abs(O)<8){f(o,0),i==null||i();return}f(b,O),Y=requestAnimationFrame(D)};return Y=requestAnimationFrame(D),()=>{q=!0,cancelAnimationFrame(Y)}}const Mt="_overlay_1fz4x_5",Rt="_sheet_1fz4x_27",Et="_dragArea_1fz4x_66",_t="_handle_1fz4x_81",Tt="_handleBar_1fz4x_97",At="_header_1fz4x_119",Lt="_headerText_1fz4x_133",Ct="_title_1fz4x_140",St="_subtitle_1fz4x_151",Ht="_close_1fz4x_162",zt="_body_1fz4x_169",It="_bodyNoHeader_1fz4x_179",Nt="_bodyWithFooter_1fz4x_183",kt="_bodyContent_1fz4x_169",Yt="_footer_1fz4x_192",E={overlay:Mt,sheet:Rt,dragArea:Et,handle:_t,handleBar:Tt,header:At,headerText:Lt,title:Ct,subtitle:St,close:Ht,body:zt,bodyNoHeader:It,bodyWithFooter:Nt,bodyContent:kt,footer:Yt},Ft='a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), textarea:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), select:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',Bt='button, a, input, textarea, select, [contenteditable], [role="button"]',Ce='input, textarea, select, [contenteditable]:not([contenteditable="false"])',Ot=`${Ce}, [data-sheet-no-drag]`,qt=80,Xe=16;function V(){const c=typeof window>"u"?null:window.visualViewport;return c&&!(c.scale>1.01)?c:null}function Je(c){return(c==null?void 0:c.getBoundingClientRect().height)||window.innerHeight}function Ze(c){const o=V();return o?Math.max(0,Math.round(o.offsetTop-(window.scrollY-c))):0}function jt(c,o){const d=V();if(!d)return 0;const f=(c==null?void 0:c.getBoundingClientRect().bottom)||window.innerHeight,i=Math.round(f-Ze(o)-d.height);return i>1?i:0}const Pt=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches;let de=0,he=null;const et=["position","top","left","right","width"];function $t(){if(de++>0)return;const{body:c}=document,o=window.scrollX,d=window.scrollY;he={x:o,y:d,before:et.map(f=>c.style[f])},Object.assign(c.style,{position:"fixed",top:`${-d}px`,left:`${-o}px`,right:"0",width:"100%"})}function Kt(){if(de=Math.max(0,de-1),de>0||!he)return;const{x:c,y:o,before:d}=he;he=null,et.forEach((f,i)=>{document.body.style[f]=d[i]}),window.scrollTo(c,o),requestAnimationFrame(()=>{(window.scrollX!==c||window.scrollY!==o)&&window.scrollTo(c,o)})}function Wt(c){const o=getComputedStyle(c),d=/auto|scroll/.test(o.overflowY)&&c.scrollHeight>c.clientHeight,f=/auto|scroll/.test(o.overflowX)&&c.scrollWidth>c.clientWidth;return d||f}const Vt=1e3,Le=4,Dt=["50%","100%"],Gt=.96,Ut=r.forwardRef(function({open:o,onClose:d,snapPoints:f=Dt,defaultSnapIndex:i=0,onSnapChange:m,swipeToClose:l=!0,closeOnBackdrop:b=!0,closeOnEscape:O=!0,title:k,description:Y,footer:q,showCloseButton:D=!1,ariaLabel:ee,dim:G,bodyClassName:U,className:tt,style:nt,children:me,...rt},te){const Se=gt.useT(),He=r.useId(),ze=r.useId(),[p,Ie]=r.useState(o);o&&!p&&Ie(!0);const y=r.useRef(null),$=r.useRef(null),j=r.useRef(null),ge=r.useRef(null),be=r.useRef(null),K=r.useRef(null),N=r.useRef(0),S=r.useRef(0),x=r.useRef([]),M=r.useRef(0),pe=r.useRef(-1),P=r.useRef(()=>{}),W=r.useRef(!1),ne=r.useRef(()=>{}),re=r.useRef(0),F=r.useRef(o);F.current=o;const ce=r.useRef(m);ce.current=m;const Ne=r.useRef(d);Ne.current=d;const ve=r.useRef(l);ve.current=l;const oe=r.useRef(0),ye=r.useRef(0),we=r.useRef(()=>{}),xe=r.useRef(0),ke=r.useRef(0),Ye=()=>{const e=V();return ye.current>0||!!e&&e.height<ke.current-qt},B=r.useRef(!1),se=r.useRef(!1),Fe=r.useRef(()=>{}),ue=r.useRef(null),ie=r.useRef(!1),Be=r.useRef(null),Oe=r.useRef(!1);o!==Oe.current&&(Oe.current=o,o&&typeof document<"u"&&(Be.current=document.activeElement));const H=r.useCallback(e=>{N.current=e;const t=y.current;if(!t)return;t.style.transform=`translate3d(0, ${e-oe.current}px, 0)`;const n=S.current,s=x.current[0]??n;if(j.current&&(j.current.style.transform=`translate3d(0, ${-Math.min(e,n-s)}px, 0)`),$.current){const h=Math.max(0,n-e),w=Math.min(1,h/Math.max(1,s));$.current.style.setProperty("--tz-sheet-progress",String(w))}},[]),ae=r.useCallback(()=>{const e=y.current;e&&e.style.setProperty("--tz-sheet-hidden",`${Math.max(0,N.current)}px`)},[]),Me=r.useRef(!1),Re=r.useRef(0),v=r.useCallback((e,t=0,n)=>{P.current();const s=S.current,h=e<0?s:s-x.current[e];e>=0&&(M.current=e),W.current=!0;const w=(R,z)=>{Re.current=z,H(R)},_=Ue(N.current,h,t,w,()=>{var R;W.current=!1,e>=0&&(ae(),e!==pe.current&&(pe.current=e,(R=ce.current)==null||R.call(ce,e))),n==null||n()});P.current=()=>{_(),W.current=!1}},[H,ae]),Ee=r.useCallback(e=>{const t=S.current,n=t-x.current[0],s=(typeof window>"u"?0:window.innerHeight)||t;let h=e;return e<0?h=-Ve(-e,s):!ve.current&&e>n&&(h=n+Ve(e-n,s)),Math.min(h,t)},[]),_e=r.useCallback(e=>{B.current=!1,se.current&&Fe.current();const t=S.current,n=xt(t-N.current,-e,x.current,ve.current);if(n===0){re.current=e,Ne.current(),requestAnimationFrame(()=>{F.current&&!Me.current&&(re.current=0,v(0,e))});return}v(x.current.indexOf(n),e)},[v]),ct=()=>{const e=h=>(h==null?void 0:h.getBoundingClientRect().height)??0,t=y.current,n=t?t.offsetHeight-t.clientHeight:0,s=K.current&&parseFloat(getComputedStyle(K.current).marginTop)||0;return Math.ceil(e(ge.current)+s+e(be.current)+e(j.current)+n)},A=r.useCallback(()=>{const e=typeof window>"u"?0:Je($.current),t=V(),n=t?Math.min(e,t.height):e,s=yt(f,e,Math.max(1,Math.floor(n*Gt)),f.includes("content")?ct():void 0);x.current=s,S.current=s[s.length-1],y.current&&(y.current.style.height=`${S.current}px`)},[JSON.stringify(f)]);r.useLayoutEffect(()=>{var e,t;if(p)if(o){const n=!((e=y.current)!=null&&e.style.transform);A();const s=Math.min(Math.max(0,i),x.current.length-1);n?(H(S.current),pe.current=s,v(s)):v(M.current)}else{const n=document.activeElement;n instanceof HTMLElement&&((t=y.current)!=null&&t.contains(n))&&n.blur();const s=re.current;re.current=0,v(-1,s,()=>Ie(!1))}},[o,p]),r.useEffect(()=>(Me.current=!1,()=>{Me.current=!0,P.current()}),[]),r.useEffect(()=>{if(!p)return;const e=()=>{if(B.current||!F.current)return;A();const t=Math.min(M.current,x.current.length-1);if(W.current){v(t,Re.current);return}M.current=t,P.current(),H(F.current?S.current-x.current[t]:S.current),ae()};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[p,A,H,ae,v]);const X=r.useCallback(()=>{se.current=!1;const e=S.current-N.current;A(),H(S.current-Math.min(e,S.current))},[A,H]);Fe.current=X;const le=r.useCallback(()=>{var z;const e=K.current,t=document.activeElement;if(!e||!(t instanceof HTMLElement)||!e.contains(t)||!t.matches(Ce))return;const n=V(),s=n?Ze(xe.current)+n.height:window.innerHeight,h=((z=j.current)==null?void 0:z.getBoundingClientRect().top)||1/0,w=Math.min(s,h)-Xe,_=e.getBoundingClientRect().top+Xe,R=t.getBoundingClientRect();R.bottom>w?e.scrollTop+=R.bottom-w:R.top<_&&(e.scrollTop-=_-R.top)},[]);r.useEffect(()=>{const e=typeof window>"u"?void 0:window.visualViewport,t=y.current;if(!p||!e||!t)return;xe.current=window.scrollY,ke.current=Je($.current);const n=u=>{if(ye.current=u,F.current&&B.current)se.current=!0;else if(F.current){const a=W.current?Re.current:0;P.current(),X(),v(Math.min(M.current,x.current.length-1),a)}we.current(),we.current=Ue(oe.current,u,0,a=>{oe.current=a,H(N.current)},()=>{le()})};let s=0,h=0,w="",_=0;const R=()=>{var C;const u=jt($.current,xe.current),a=Math.round(((C=V())==null?void 0:C.height)??0);return{inset:u,key:`${u}:${a}`}};let z=R().key;const J=()=>{const{inset:u,key:a}=R();_=a===w?_+1:0,w=a,_===3&&a!==z&&(z=a,n(u)),s=performance.now()<h?requestAnimationFrame(J):0},L=()=>{const{inset:u,key:a}=R();a!==z?(z=a,n(u)):le(),h=performance.now()+Vt,!s&&typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(J))},g=()=>{L(),Ye()&&requestAnimationFrame(le)};return e.addEventListener("resize",L),e.addEventListener("scroll",L),window.addEventListener("resize",L),t.addEventListener("focusin",g),t.addEventListener("focusout",L),L(),()=>{e.removeEventListener("resize",L),e.removeEventListener("scroll",L),window.removeEventListener("resize",L),t.removeEventListener("focusin",g),t.removeEventListener("focusout",L),cancelAnimationFrame(s),we.current(),oe.current=0,ye.current=0}},[p,A,H,X,v,le]),r.useLayoutEffect(()=>{if(!(!p||!Pt()))return $t(),Kt},[p]),r.useEffect(()=>{if(!p||typeof document>"u")return;const e=t=>{var s;if(t.touches.length>1||!t.cancelable)return;const n=t.target;if(!((s=n==null?void 0:n.closest)!=null&&s.call(n,'[data-sheet-no-drag], input[type="range"]'))){for(let h=n;h&&h!==document.body;h=h.parentElement)if(h===K.current?h.scrollHeight>h.clientHeight:Wt(h))return;t.preventDefault()}};return document.addEventListener("touchmove",e,{passive:!1}),()=>document.removeEventListener("touchmove",e)},[p]);const Te=r.useCallback(()=>{var t;if(!Ye())return;const e=document.activeElement;e instanceof HTMLElement&&((t=y.current)!=null&&t.contains(e))&&e.matches(Ce)&&e.blur()},[]),qe=r.useRef(A);r.useEffect(()=>{qe.current!==A&&(qe.current=A,!(!p||!F.current||B.current)&&(A(),v(Math.min(M.current,x.current.length-1))))},[A,p,v]);const je=f.includes("content");r.useEffect(()=>{if(!p||!je||typeof ResizeObserver>"u")return;const e=new ResizeObserver(()=>{if(!F.current||B.current)return;const t=x.current.join();A(),x.current.join()!==t&&v(Math.min(M.current,x.current.length-1))});for(const t of[ge.current,be.current,j.current])t&&e.observe(t);return()=>e.disconnect()},[p,je,A,v]),r.useEffect(()=>{const e=j.current,t=y.current;if(!p||!e||!t)return;const n=()=>t.style.setProperty("--tz-sheet-footer",`${e.getBoundingClientRect().height}px`);if(n(),typeof ResizeObserver>"u")return;const s=new ResizeObserver(n);return s.observe(e),()=>s.disconnect()},[p,q]),r.useEffect(()=>{if(!p)return;const e=y.current;e&&!e.contains(document.activeElement)&&e.focus({preventScroll:!0});const t=Be.current;return()=>{var h;const n=document.activeElement;(!n||n===document.body||!!(e!=null&&e.contains(n)))&&(t!=null&&t.isConnected)&&((h=t.focus)==null||h.call(t,{preventScroll:!0}))}},[p]);const ot=me!=null;r.useEffect(()=>{const e=K.current;if(!p||!e)return;let t=null;const n=()=>Math.max(0,e.scrollHeight-e.clientHeight),s=g=>{const u=g instanceof Element?g:null;if(!u)return!1;if(u.closest(Ot))return!0;for(let a=u;a&&a!==e;a=a.parentElement){const C=getComputedStyle(a).overflowY;if((C==="auto"||C==="scroll")&&a.scrollHeight>a.clientHeight+1)return!0}return!1},h=g=>t?Array.from(g.changedTouches).find(u=>u.identifier===t.id):void 0,w=g=>{if(ne.current(),Qe()||Math.abs(g)<50)return;let u=g,a=e.scrollTop,C=performance.now(),I=0;const Q=Z=>{const fe=Math.min(.064,Math.max(0,(Z-C)/1e3));C=Z;const Ae=vt(a,u,fe,n());a=Ae.scrollTop,u=Ae.velocity,e.scrollTop=a,u!==0&&(I=requestAnimationFrame(Q))};I=requestAnimationFrame(Q),ne.current=()=>cancelAnimationFrame(I)},_=g=>{if(ne.current(),t=null,!F.current||g.touches.length!==1||s(g.target))return;const u=g.touches[0],a=W.current;a&&P.current(),t={id:u.identifier,x0:u.clientX,y0:u.clientY,lastY:u.clientY,mode:"pending",raw:N.current,grabbed:a,samples:[{t:g.timeStamp,y:u.clientY}]}},R=g=>{var Q;const u=t;if(!u||u.mode==="native")return;const a=h(g);if(!a)return;if(u.mode==="pending"){const Z=a.clientX-u.x0,fe=a.clientY-u.y0;if(Math.abs(Z)<Le&&Math.abs(fe)<Le)return;if(bt({offset:N.current,scrollTop:e.scrollTop,canScroll:n()>0,dx:Z,dy:fe})==="native"){u.mode="native",u.grabbed&&v(M.current);return}u.mode="sheet",u.raw=N.current,B.current=!0,(Q=y.current)==null||Q.setAttribute("data-dragging","true"),Te()}g.cancelable&&g.preventDefault();const C=a.clientY-u.lastY;u.lastY=a.clientY,u.samples.push({t:g.timeStamp,y:a.clientY}),u.samples.length>8&&u.samples.shift();const I=pt({mode:u.mode,raw:u.raw,scrollTop:e.scrollTop},C,n());u.mode=I.mode,u.raw=I.raw,I.scrollTop!==e.scrollTop&&(e.scrollTop=I.scrollTop),H(Ee(I.raw))},z=(g,u)=>{var I;const a=t;if(!a||!h(g)||(t=null,a.mode==="native"))return;if(a.mode==="pending"){a.grabbed&&v(M.current);return}(I=y.current)==null||I.removeAttribute("data-dragging");const C=u?0:De(a.samples);a.mode==="scroll"&&a.raw>=0?(B.current=!1,se.current&&(X(),v(Math.min(M.current,x.current.length-1))),w(-C)):_e(C)},J=g=>z(g,!1),L=g=>z(g,!0);return e.addEventListener("touchstart",_,{passive:!0}),e.addEventListener("touchmove",R,{passive:!1}),e.addEventListener("touchend",J),e.addEventListener("touchcancel",L),()=>{e.removeEventListener("touchstart",_),e.removeEventListener("touchmove",R),e.removeEventListener("touchend",J),e.removeEventListener("touchcancel",L),ne.current()}},[p,ot,H,Ee,v,_e,Te,X]);const st=e=>{if(!o||e.pointerType==="mouse"&&e.button!==0)return;const n=e.target.closest(Bt);n&&!n.hasAttribute("data-sheet-handle")||(P.current(),ue.current={id:e.pointerId,startY:e.clientY,startOffset:N.current,dragging:!1,samples:[{t:e.timeStamp,y:e.clientY}]})},ut=e=>{var s,h,w;const t=ue.current;if(!t||t.id!==e.pointerId)return;const n=e.clientY-t.startY;if(!t.dragging){if(Math.abs(n)<Le)return;t.dragging=!0,B.current=!0,(s=y.current)==null||s.setAttribute("data-dragging","true"),Te(),(w=(h=e.currentTarget).setPointerCapture)==null||w.call(h,e.pointerId)}t.samples.push({t:e.timeStamp,y:e.clientY}),t.samples.length>8&&t.samples.shift(),H(Ee(t.startOffset+n))},Pe=(e,t)=>{var s;const n=ue.current;if(!(!n||n.id!==e.pointerId)){if(ue.current=null,(s=y.current)==null||s.removeAttribute("data-dragging"),!n.dragging){e.target.closest("[data-sheet-handle]")||v(M.current);return}ie.current=!0,setTimeout(()=>{ie.current=!1},0),_e(t?0:De(n.samples))}},$e=e=>{const t=x.current.length-1;v(Math.min(Math.max(0,e),t))},it=()=>{if(ie.current){ie.current=!1;return}const e=x.current.length-1;$e(M.current>=e?0:M.current+1)},at=e=>{const t=x.current.length-1,n={ArrowUp:M.current+1,ArrowRight:M.current+1,ArrowDown:M.current-1,ArrowLeft:M.current-1,Home:0,End:t};e.key in n&&(e.preventDefault(),$e(n[e.key]))},lt=e=>{if(e.key!=="Tab")return;const t=y.current;if(!t)return;const n=[...t.querySelectorAll(Ft)].filter(_=>_.offsetParent!==null||_===document.activeElement);if(n.length===0){e.preventDefault(),t.focus();return}const s=n[0],h=n[n.length-1],w=document.activeElement;e.shiftKey&&(w===s||w===t)?(e.preventDefault(),h.focus()):!e.shiftKey&&w===h&&(e.preventDefault(),s.focus())},ft=e=>{y.current=e,typeof te=="function"?te(e):te&&(te.current=e)};if(!p)return null;const Ke=k!=null||Y!=null||D;return T.jsx(mt.Overlay,{ref:$,open:p,onClose:o?d:void 0,closeOnBackdrop:b,closeOnEscape:O,onKeyDown:lt,dim:G,className:E.overlay,"data-closing":o?void 0:"true",children:T.jsxs("div",{ref:ft,className:We.clsx(E.sheet,tt),role:"dialog","aria-modal":"true","aria-labelledby":k!=null?He:void 0,"aria-label":k==null?ee:void 0,"aria-describedby":Y!=null?ze:void 0,tabIndex:-1,style:nt,...rt,children:[T.jsxs("div",{ref:ge,className:E.dragArea,onPointerDown:st,onPointerMove:ut,onPointerUp:e=>Pe(e,!1),onPointerCancel:e=>Pe(e,!0),children:[T.jsx("button",{type:"button",className:E.handle,"data-sheet-handle":"","aria-label":Se("bottomSheet.resize"),onClick:it,onKeyDown:at,children:T.jsx("span",{className:E.handleBar,"aria-hidden":!0})}),Ke&&T.jsxs("div",{className:E.header,children:[(k!=null||Y!=null)&&T.jsxs("div",{className:E.headerText,children:[k!=null&&T.jsx("div",{id:He,className:E.title,children:k}),Y!=null&&T.jsx("div",{id:ze,className:E.subtitle,children:Y})]}),D&&T.jsx(ht.IconButton,{variant:"filled",color:"primary",size:"sm",className:E.close,"aria-label":Se("common.close"),onClick:d,children:T.jsx(dt.Icon,{name:"Close"})})]})]}),me!=null&&T.jsx("div",{ref:K,className:We.clsx(E.body,!Ke&&E.bodyNoHeader,q!=null&&E.bodyWithFooter,U),onScroll:e=>{var n,s;const t=e.currentTarget.scrollTop>0;t!==((n=y.current)==null?void 0:n.hasAttribute("data-scrolled"))&&((s=y.current)==null||s.toggleAttribute("data-scrolled",t))},children:T.jsx("div",{ref:be,className:E.bodyContent,children:me})}),q!=null&&T.jsx("div",{ref:j,className:E.footer,children:q})]})})});exports.BottomSheet=Ut;
|
|
2
|
+
//# sourceMappingURL=BottomSheet-BWTYMGOU.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheet-BWTYMGOU.cjs","sources":["../src/components/BottomSheet/gesture.ts","../src/components/BottomSheet/motion.ts","../src/components/BottomSheet/BottomSheet.tsx"],"sourcesContent":["// The body gesture of a BottomSheet: a touch on the content either scrolls it or moves the sheet — and hands\n// over between the two mid-gesture, like a native sheet. Pure (no DOM), so every rule is unit-testable; the\n// component feeds it the touch deltas and applies what comes back.\n//\n// Offsets are the sheet's translateY (0 = at its tallest snap; larger = lower). `scrollTop` is the body's.\n\n/**\n * Who owns the current touch on the body:\n * - `pending` — not decided yet (still within the slop);\n * - `sheet` — the finger moves the sheet (the native scroll is prevented);\n * - `scroll` — the sheet is at its tallest and the finger scrolls the content, driven by us (the gesture\n * started as a sheet drag, so the native scroll was already prevented — the scroll is emulated);\n * - `native` — the browser scrolls the content natively, and the sheet stays put for this gesture.\n */\nexport type BodyGestureMode = 'pending' | 'sheet' | 'scroll' | 'native'\n\n/** What the first decisive move sees. */\nexport interface GestureStart {\n /** The sheet's offset (0 = at its tallest snap). */\n offset: number\n /** The body's scrollTop. */\n scrollTop: number\n /** Whether the body's content is taller than the body (it can scroll at all). */\n canScroll: boolean\n /** Total finger movement so far, px (`dy` positive = down). */\n dx: number\n dy: number\n}\n\n/**\n * The owner of a gesture, decided on its first decisive move:\n * - a mostly horizontal move is never the sheet's (a carousel, a wide table) → `native`;\n * - the sheet below its tallest snap → `sheet` (it grows / shrinks before anything scrolls);\n * - at its tallest, content scrolled down → `native` (the content scrolls; the sheet waits for the next gesture);\n * - at its tallest, content at its top: pulling down → `sheet`; pushing up → `native` when there's content to\n * scroll, else `sheet` (the rubber band).\n */\nexport function decideBodyGesture({ offset, scrollTop, canScroll, dx, dy }: GestureStart) {\n if (Math.abs(dx) > Math.abs(dy)) return 'native' as const\n if (offset > 0.5) return 'sheet' as const\n if (scrollTop > 0) return 'native' as const\n if (dy > 0) return 'sheet' as const\n return canScroll ? ('native' as const) : ('sheet' as const)\n}\n\n/** A gesture's moving parts: who owns it, the sheet's raw (un-rubber-banded) offset, the body's scrollTop. */\nexport interface HandoffState {\n mode: 'sheet' | 'scroll'\n raw: number\n scrollTop: number\n}\n\n/**\n * Apply a finger move of `dy` px (positive = down) to an owned gesture, handing over between the sheet and the\n * content: pushing up moves the sheet to its tallest, then scrolls the content (up to `scrollMax`); pulling down\n * scrolls the content back to its top, then moves the sheet down. With no content left to scroll the sheet takes\n * the overshoot (the caller rubber-bands a negative `raw`).\n */\nexport function handoff(state: HandoffState, dy: number, scrollMax: number): HandoffState {\n let { mode, raw, scrollTop } = state\n let rest = dy\n if (rest < 0) {\n // up: the sheet first (down to offset 0), then the content\n if (mode === 'sheet' && raw > 0) {\n const take = Math.max(rest, -raw)\n raw += take\n rest -= take\n }\n if (rest < 0) {\n if (scrollTop < scrollMax) {\n mode = 'scroll'\n const take = Math.max(rest, scrollTop - scrollMax)\n scrollTop -= take\n rest -= take\n }\n // nothing left to scroll: the sheet overshoots its tallest snap (rubber band)\n if (rest < 0) {\n mode = mode === 'scroll' && scrollTop < scrollMax ? mode : 'sheet'\n if (mode === 'sheet') raw += rest\n }\n }\n } else if (rest > 0) {\n // down: a sheet already below its tallest snap takes it all; otherwise undo an overshoot, then scroll the\n // content back to its top, then move the sheet\n if (raw > 0) {\n raw += rest\n rest = 0\n }\n if (rest > 0 && raw < 0) {\n const take = Math.min(rest, -raw)\n raw += take\n rest -= take\n }\n if (rest > 0 && scrollTop > 0) {\n mode = 'scroll'\n const take = Math.min(rest, scrollTop)\n scrollTop -= take\n rest -= take\n }\n if (rest > 0) {\n mode = 'sheet'\n raw += rest\n }\n }\n return { mode, raw, scrollTop }\n}\n\n/**\n * One frame of iOS-like momentum for an emulated scroll: `velocity` in px / s (positive = scrollTop growing),\n * `dt` in seconds. Returns the new scrollTop (clamped to `0…max`) and velocity (0 once it stops or hits an end).\n */\nexport function momentumStep(\n scrollTop: number,\n velocity: number,\n dt: number,\n max: number,\n deceleration = 0.998,\n): { scrollTop: number; velocity: number } {\n const next = scrollTop + velocity * dt\n const v = velocity * Math.pow(deceleration, dt * 1000)\n if (next <= 0) return { scrollTop: 0, velocity: 0 }\n if (next >= max) return { scrollTop: max, velocity: 0 }\n return { scrollTop: next, velocity: Math.abs(v) < 10 ? 0 : v }\n}\n","// The BottomSheet's physics, kept pure (no DOM) so it's unit-testable: snap points → pixel heights, the\n// rubber band past a limit, release velocity, which snap a release lands on, and a spring with an initial\n// velocity (so a fling carries straight into the settle — no jolt).\n//\n// Everything works in HEIGHT space: `0` is closed, a snap point is the sheet's visible height in px.\n\n/**\n * A snap point — a height in px, a percentage of the viewport height (`'50%'`), or `'content'`: the height of\n * the sheet's own content (handle + header + body + footer).\n */\nexport type BottomSheetSnapPoint = number | `${number}%` | 'content'\n\n/**\n * Snap points → visible heights in px, ascending and de-duplicated, each clamped to `1…max` (`max` = the\n * tallest the sheet may be). A percentage is of `viewport`; `'content'` is `content` (the measured content\n * height — `max` when unknown); anything unparsable is dropped. Never empty: with nothing usable it falls\n * back to `[max]`.\n */\nexport function resolveSnapPoints(\n points: readonly BottomSheetSnapPoint[],\n viewport: number,\n max: number,\n content?: number,\n): number[] {\n const heights = points\n .map((p) => {\n if (typeof p === 'number') return p\n if (p === 'content') return content != null && content > 0 ? content : max\n const m = /^\\s*(-?\\d+(?:\\.\\d+)?)\\s*%\\s*$/.exec(p)\n return m ? (Number(m[1]) / 100) * viewport : NaN\n })\n .filter((h) => Number.isFinite(h) && h > 0)\n .map((h) => Math.round(Math.min(max, Math.max(1, h))))\n const unique = [...new Set(heights)].sort((a, b) => a - b)\n return unique.length ? unique : [Math.max(1, Math.round(max))]\n}\n\n/**\n * How far an overshoot of `distance` px past a limit is shown — iOS-style resistance that never reaches\n * `dimension` (`c` sets how stiff it feels).\n */\nexport function rubberBand(distance: number, dimension: number, c = 0.55): number {\n if (distance <= 0 || dimension <= 0) return 0\n return (1 - 1 / ((distance * c) / dimension + 1)) * dimension\n}\n\n/** A pointer sample for the release velocity. */\nexport interface MotionSample {\n /** Time in ms (an event `timeStamp`). */\n t: number\n /** Position in px. */\n y: number\n}\n\n/** How far back (ms) the release velocity looks — older samples are stale (the finger may have paused). */\nconst VELOCITY_WINDOW = 100\n\n/** px / s over the last `VELOCITY_WINDOW` ms of `samples` (positive = moving down); `0` with too little data. */\nexport function releaseVelocity(samples: readonly MotionSample[]): number {\n if (samples.length < 2) return 0\n const last = samples[samples.length - 1]\n let first = samples[samples.length - 2]\n for (let i = samples.length - 2; i >= 0; i--) {\n if (last.t - samples[i].t > VELOCITY_WINDOW) break\n first = samples[i]\n }\n const dt = last.t - first.t\n return dt > 0 ? ((last.y - first.y) / dt) * 1000 : 0\n}\n\n/** A release faster than this (px / s) is a fling: it moves to the next snap in its direction. */\nexport const FLING_VELOCITY = 800\n\n/**\n * Where a release lands, as a height: `height` is the sheet's visible height at release, `velocity` its\n * rate of change in px / s (positive = growing, i.e. the finger moving UP), `snaps` the ascending snap\n * heights. With `dismissible`, `0` (closed) is a candidate too. A fling goes to the next candidate in its\n * direction; a slow release goes to the nearest one.\n */\nexport function pickSnap(\n height: number,\n velocity: number,\n snaps: readonly number[],\n dismissible: boolean,\n): number {\n const candidates = dismissible ? [0, ...snaps] : [...snaps]\n if (velocity >= FLING_VELOCITY) {\n return candidates.find((c) => c > height + 1) ?? candidates[candidates.length - 1]\n }\n if (velocity <= -FLING_VELOCITY) {\n return [...candidates].reverse().find((c) => c < height - 1) ?? candidates[0]\n }\n return candidates.reduce((best, c) => (Math.abs(c - height) < Math.abs(best - height) ? c : best))\n}\n\n/** Whether the user asked for reduced motion (then a spring jumps straight to its target). */\nexport const prefersReducedMotion = () =>\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n\nexport interface SheetSpringOptions {\n stiffness?: number\n damping?: number\n}\n\n/**\n * Spring a value `from` → `to`, starting at `velocity` (units / s), calling `onFrame(value, velocity)` every\n * animation frame and once with `to` at the end, then `onDone`. Returns a cancel function. Jumps straight\n * to `to` under reduced motion (or without `requestAnimationFrame`).\n */\nexport function animateSpring(\n from: number,\n to: number,\n velocity: number,\n onFrame: (value: number, velocity: number) => void,\n onDone?: () => void,\n { stiffness = 420, damping = 38 }: SheetSpringOptions = {},\n): () => void {\n if (prefersReducedMotion() || typeof requestAnimationFrame !== 'function' || from === to) {\n onFrame(to, 0)\n onDone?.()\n return () => {}\n }\n let x = from\n let v = velocity\n let last = performance.now()\n let raf = 0\n let cancelled = false\n const step = (now: number) => {\n if (cancelled) return\n // sub-step so a long frame (a background tab, a GC pause) can't blow the integration up\n let dt = Math.min(0.064, Math.max(0, (now - last) / 1000))\n last = now\n while (dt > 0) {\n const h = Math.min(dt, 1 / 240)\n v += (-stiffness * (x - to) - damping * v) * h\n x += v * h\n dt -= h\n }\n if (Math.abs(x - to) < 0.3 && Math.abs(v) < 8) {\n onFrame(to, 0)\n onDone?.()\n return\n }\n onFrame(x, v)\n raf = requestAnimationFrame(step)\n }\n raf = requestAnimationFrame(step)\n return () => {\n cancelled = true\n cancelAnimationFrame(raf)\n }\n}\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Overlay } from '../Overlay/Overlay'\nimport { decideBodyGesture, handoff, momentumStep, type BodyGestureMode } from './gesture'\nimport {\n animateSpring,\n pickSnap,\n prefersReducedMotion,\n releaseVelocity,\n resolveSnapPoints,\n rubberBand,\n type BottomSheetSnapPoint,\n type MotionSample,\n} from './motion'\nimport styles from './BottomSheet.module.css'\n\nexport type { BottomSheetSnapPoint } from './motion'\n\nconst FOCUSABLE =\n 'a[href]:not([tabindex=\"-1\"]), button:not(:disabled):not([tabindex=\"-1\"]), textarea:not(:disabled):not([tabindex=\"-1\"]), input:not(:disabled):not([tabindex=\"-1\"]), select:not(:disabled):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'\n\n/** Controls a drag on the header must not start from (they keep their own click). */\nconst INTERACTIVE = 'button, a, input, textarea, select, [contenteditable], [role=\"button\"]'\n\n/** Form fields — they keep their own touch, and bring up the phone keyboard. */\nconst FIELDS = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])'\n\n/** Content a touch on the body never drags the sheet from — fields keep their own touch, and anything can opt\n * out with `data-sheet-no-drag` (a map, a slider, a signature pad). */\nconst NO_DRAG = `${FIELDS}, [data-sheet-no-drag]`\n\n/** A visible area this much (px) shorter than when the sheet opened means the keyboard is up. */\nconst KEYBOARD_MIN = 80\n\n/** Room (px) kept between a focused field and the keyboard / footer when it's scrolled into view. */\nconst FIELD_MARGIN = 16\n\n/** The visual viewport, unless pinch-zoomed (then its size isn't the space the sheet's layer can use). */\nfunction visibleViewport() {\n const vv = typeof window === 'undefined' ? null : window.visualViewport\n return vv && !(vv.scale > 1.01) ? vv : null\n}\n\n/** The height of the sheet's full-screen layer (the scrim) — `innerHeight` until it has a size. */\nfunction layerHeight(layer: HTMLElement | null) {\n return layer?.getBoundingClientRect().height || window.innerHeight\n}\n\n/**\n * Where the visible area starts in the layer's coordinates, px. iOS brings a focused field into view in one\n * of two ways: it **pans** the visual viewport (`offsetTop`; the fixed layer moves up with the page, so the\n * visible area starts `offsetTop` down the layer), or — iOS 26 — it **scrolls the page** and reports about\n * the same `offsetTop` while the fixed layer stays on the screen. The page scroll since `baseScrollY` (when\n * the sheet opened) tells the two apart.\n */\nfunction visibleTop(baseScrollY: number) {\n const vv = visibleViewport()\n if (!vv) return 0\n return Math.max(0, Math.round(vv.offsetTop - (window.scrollY - baseScrollY)))\n}\n\n/**\n * How much of the sheet's layer the browser covers at the bottom, px: the keyboard (plus, on iOS 26, its\n * accessory bar and the floating address bar) — the layer's bottom minus the visible area's bottom.\n * Measured on the layer itself, not `innerHeight` (iOS 26 resizes the layout viewport in steps while the\n * keyboard opens). `0` without `visualViewport` or while pinch-zoomed.\n */\nfunction coveredBottom(layer: HTMLElement | null, baseScrollY: number) {\n const vv = visibleViewport()\n if (!vv) return 0\n const bottom = layer?.getBoundingClientRect().bottom || window.innerHeight\n const inset = Math.round(bottom - visibleTop(baseScrollY) - vv.height)\n return inset > 1 ? inset : 0\n}\n\n/** A touch screen (the phone keyboard's home). */\nconst isTouchScreen = () =>\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(pointer: coarse)').matches\n\n// The page pin is shared and ref-counted (like the overflow lock): a sheet sliding out while the next one\n// opens must not hand the page back — nor restore the other's pin. Saved on the first pin, put back on the last.\nlet pins = 0\nlet pinned: { x: number; y: number; before: string[] } | null = null\nconst PIN_KEYS = ['position', 'top', 'left', 'right', 'width'] as const\n\nfunction pinPage() {\n if (pins++ > 0) return\n const { body } = document\n const x = window.scrollX\n const y = window.scrollY\n // only these properties are touched (the scroll lock sets others on the body, and may release first)\n pinned = { x, y, before: PIN_KEYS.map((key) => body.style[key]) }\n Object.assign(body.style, {\n position: 'fixed',\n top: `${-y}px`,\n left: `${-x}px`,\n right: '0',\n width: '100%',\n })\n}\n\nfunction unpinPage() {\n pins = Math.max(0, pins - 1)\n if (pins > 0 || !pinned) return\n const { x, y, before } = pinned\n pinned = null\n PIN_KEYS.forEach((key, i) => {\n document.body.style[key] = before[i]\n })\n window.scrollTo(x, y)\n // again once the overflow lock is released too, if it still held the page\n requestAnimationFrame(() => {\n if (window.scrollX !== x || window.scrollY !== y) window.scrollTo(x, y)\n })\n}\n\n/** Whether an element scrolls its own content (either axis) and has something to scroll. */\nfunction canScroll(el: Element) {\n const style = getComputedStyle(el)\n const y = /auto|scroll/.test(style.overflowY) && el.scrollHeight > el.clientHeight\n const x = /auto|scroll/.test(style.overflowX) && el.scrollWidth > el.clientWidth\n return y || x\n}\n\n/** How long (ms) the layer keeps being re-measured after a keyboard event — iOS doesn't report every step. */\nconst KEYBOARD_WATCH = 1000\n\n/** Movement (px) before a press on the drag area counts as a drag rather than a tap. */\nconst DRAG_SLOP = 4\n\nconst DEFAULT_SNAP_POINTS: BottomSheetSnapPoint[] = ['50%', '100%']\n\n/** The tallest the sheet may be, as a share of the space it fits into — it never reaches the top edge. */\nconst MAX_HEIGHT_RATIO = 0.96\n\nexport interface BottomSheetProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Whether the sheet is open — it slides up on open and down on close (then unmounts). */\n open: boolean\n /** Called when a dismiss is requested — a swipe down past the lowest snap, a backdrop click, Escape or the ×. */\n onClose: () => void\n /**\n * The heights the sheet rests at — px, a percentage of the viewport height (`'50%'`), or `'content'` (the\n * sheet's own content height: handle + header + body content + footer, followed as it changes). Sorted\n * ascending and de-duplicated; each is capped at 96% of the visible height (it never reaches the top edge).\n * Defaults to `['50%', '100%']`.\n */\n snapPoints?: BottomSheetSnapPoint[]\n /** The snap point (index into `snapPoints`, after sorting) the sheet opens at. Defaults to `0`. */\n defaultSnapIndex?: number\n /** Called with the new snap index each time the sheet comes to rest at a different snap point. */\n onSnapChange?: (index: number) => void\n /** Swiping down past the lowest snap point closes the sheet. Defaults to `true`. */\n swipeToClose?: boolean\n /** Close when the backdrop (above the sheet) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Header title. When set, labels the sheet (`aria-labelledby`). */\n title?: ReactNode\n /** Muted description line under the title. */\n description?: ReactNode\n /** Footer slot — pinned to the bottom of the screen at every snap point (e.g. Cancel / Apply). */\n footer?: ReactNode\n /** Show a header × close button. Defaults to `false` (the handle, a swipe, the backdrop and Escape close it). */\n showCloseButton?: boolean\n /** Accessible label — used when there's no `title`. */\n ariaLabel?: string\n /** Backdrop darkness at the lowest snap and above (0–1). Defaults to `0.45`. */\n dim?: number\n /** Extra class on the scrollable body element. */\n bodyClassName?: string\n /** Sheet body — scrolls inside the sheet. */\n children?: ReactNode\n}\n\n/**\n * A bottom sheet: a panel that slides up from the bottom of the screen and rests at one of its\n * **`snapPoints`**. Drag its handle / header to move it — it follows the finger, resists past the top\n * (rubber band), carries a fling into the next snap point, and closes when pulled below the lowest one\n * (`swipeToClose`). Motion is transform-only (GPU) with a spring that keeps the release velocity; the\n * backdrop dims in proportion to the height. Portaled over a dimmed backdrop (the shared `Overlay`): page\n * scroll is locked (on a touch screen the page is pinned), focus moves into the sheet and is trapped there,\n * and returns to the opener on close unless something else took it.\n * The handle is a button: Enter / Space / a tap step to the next snap point, Arrow Up / Down move one,\n * Home / End jump to the lowest / highest. Controlled by `open` + `onClose`; the ref points at the sheet.\n *\n * @example\n * <BottomSheet open={isOpen} onClose={close} title=\"Filters\" footer={<Button onClick={close}>Apply</Button>}>\n * …\n * </BottomSheet>\n */\nexport const BottomSheet = forwardRef<HTMLDivElement, BottomSheetProps>(function BottomSheet(\n {\n open,\n onClose,\n snapPoints = DEFAULT_SNAP_POINTS,\n defaultSnapIndex = 0,\n onSnapChange,\n swipeToClose = true,\n closeOnBackdrop = true,\n closeOnEscape = true,\n title,\n description,\n footer,\n showCloseButton = false,\n ariaLabel,\n dim,\n bodyClassName,\n className,\n style,\n children,\n ...props\n },\n forwardedRef,\n) {\n const t = useT()\n const titleId = useId()\n const descId = useId()\n\n // mounted while open AND while the exit animation runs after `open` turns false\n const [mounted, setMounted] = useState(open)\n if (open && !mounted) setMounted(true)\n\n const sheetRef = useRef<HTMLDivElement | null>(null)\n const scrimRef = useRef<HTMLDivElement | null>(null)\n const footerRef = useRef<HTMLDivElement | null>(null)\n const dragAreaRef = useRef<HTMLDivElement | null>(null)\n const contentRef = useRef<HTMLDivElement | null>(null)\n const bodyRef = useRef<HTMLDivElement | null>(null)\n\n // live motion state — kept in refs: a drag frame must never wait for a React render\n const offset = useRef(0) // translateY of the sheet, px (0 = its full height is visible)\n const maxHeight = useRef(0) // the sheet's laid-out height = the tallest snap\n const snaps = useRef<number[]>([]) // ascending snap heights, px\n const snapIndex = useRef(0) // the snap it's at or heading to (steps count from here, even mid-flight)\n const restIndex = useRef(-1) // the snap it last came to rest at (what `onSnapChange` reported)\n const cancelAnim = useRef<() => void>(() => {})\n const animating = useRef(false) // a spring is running (a touch on the body then grabs the sheet)\n const cancelMomentum = useRef<() => void>(() => {}) // an emulated scroll's momentum\n const releaseVy = useRef(0) // the last release velocity (px / s, down = positive), for the exit\n const openRef = useRef(open)\n openRef.current = open\n const onSnapChangeRef = useRef(onSnapChange)\n onSnapChangeRef.current = onSnapChange\n const onCloseRef = useRef(onClose)\n onCloseRef.current = onClose\n const swipeToCloseRef = useRef(swipeToClose)\n swipeToCloseRef.current = swipeToClose\n // the phone keyboard: the lift being painted (animated) and the inset it's heading to\n const keyboard = useRef(0)\n const keyboardTarget = useRef(0)\n const cancelKeyboard = useRef<() => void>(() => {})\n // the page's scroll and the layer's height when the sheet opened (see `visibleTop`, `keyboardUp`)\n const baseScrollY = useRef(0)\n const baseHeight = useRef(0)\n /** Whether the phone keyboard is up: part of the layer is covered, or the visible area has shrunk. */\n const keyboardUp = () => {\n const vv = visibleViewport()\n return keyboardTarget.current > 0 || (!!vv && vv.height < baseHeight.current - KEYBOARD_MIN)\n }\n // a finger / pointer is moving the sheet (handle, header or body) — layout changes wait for its release\n const dragging = useRef(false)\n const refitPending = useRef(false)\n const refitRef = useRef<() => void>(() => {})\n // the pointer being dragged (null when none)\n const dragRef = useRef<{\n id: number\n startY: number\n startOffset: number\n dragging: boolean\n samples: MotionSample[]\n } | null>(null)\n // set by a drag's pointerup, cleared after that event's click: a drag on the handle is not a tap\n const suppressClick = useRef(false)\n\n // the element focused before opening — read during the render that opens the sheet\n const openerRef = useRef<HTMLElement | null>(null)\n const wasOpenRef = useRef(false)\n if (open !== wasOpenRef.current) {\n wasOpenRef.current = open\n if (open && typeof document !== 'undefined') {\n openerRef.current = document.activeElement as HTMLElement | null\n }\n }\n\n /** Paint an offset: the sheet, the footer pinned to the screen bottom, and the backdrop's dim. */\n const paint = useCallback((y: number) => {\n offset.current = y\n const sheet = sheetRef.current\n if (!sheet) return\n // lifted above the phone keyboard, if it's open\n sheet.style.transform = `translate3d(0, ${y - keyboard.current}px, 0)`\n const max = maxHeight.current\n const lowest = snaps.current[0] ?? max\n // the footer stays on the screen's bottom edge while the sheet is at / above its lowest snap, and goes\n // down with the sheet below it (a dismiss)\n if (footerRef.current)\n footerRef.current.style.transform = `translate3d(0, ${-Math.min(y, max - lowest)}px, 0)`\n // the backdrop's darkness (NOT its opacity — the sheet sits inside the scrim and would fade with it)\n if (scrimRef.current) {\n const visible = Math.max(0, max - y)\n const progress = Math.min(1, visible / Math.max(1, lowest))\n scrimRef.current.style.setProperty('--tz-sheet-progress', String(progress))\n }\n }, [])\n\n /** After coming to rest: let the body scroll its last content above the footer at this snap. */\n const settleLayout = useCallback(() => {\n const sheet = sheetRef.current\n if (!sheet) return\n sheet.style.setProperty('--tz-sheet-hidden', `${Math.max(0, offset.current)}px`)\n }, [])\n\n // the component is gone (a parent unmounted it mid-gesture): no more springs / callbacks\n const unmounted = useRef(false)\n // the running spring's velocity (px / s, down = positive) — carried on when a resize re-aims it\n const springVelocity = useRef(0)\n\n /** Spring to a snap index (or to closed with `index = -1`). */\n const springTo = useCallback(\n (index: number, velocity = 0, onDone?: () => void) => {\n cancelAnim.current()\n const max = maxHeight.current\n const target = index < 0 ? max : max - snaps.current[index]\n if (index >= 0) snapIndex.current = index\n animating.current = true\n const onFrame = (value: number, v: number) => {\n springVelocity.current = v\n paint(value)\n }\n const cancel = animateSpring(offset.current, target, velocity, onFrame, () => {\n animating.current = false\n if (index >= 0) {\n settleLayout()\n if (index !== restIndex.current) {\n restIndex.current = index\n onSnapChangeRef.current?.(index)\n }\n }\n onDone?.()\n })\n cancelAnim.current = () => {\n cancel()\n animating.current = false\n }\n },\n [paint, settleLayout],\n )\n\n /** A raw sheet offset with the rubber bands applied: past the tallest snap, and (without swipe-to-close)\n * below the lowest one. */\n const banded = useCallback((raw: number) => {\n const max = maxHeight.current\n const lowestOffset = max - snaps.current[0]\n const vh = (typeof window === 'undefined' ? 0 : window.innerHeight) || max\n let y = raw\n if (raw < 0) y = -rubberBand(-raw, vh)\n else if (!swipeToCloseRef.current && raw > lowestOffset)\n y = lowestOffset + rubberBand(raw - lowestOffset, vh)\n return Math.min(y, max)\n }, [])\n\n /** A drag of the sheet ended with velocity `vy` (px / s, down = positive): settle, or close. */\n const releaseSheet = useCallback(\n (vy: number) => {\n dragging.current = false\n // the space changed during the drag (the keyboard went away): re-fit before picking a snap\n if (refitPending.current) refitRef.current()\n const max = maxHeight.current\n const target = pickSnap(max - offset.current, -vy, snaps.current, swipeToCloseRef.current)\n if (target === 0) {\n releaseVy.current = vy\n onCloseRef.current()\n // a parent that keeps it open: settle back at the lowest snap\n requestAnimationFrame(() => {\n if (openRef.current && !unmounted.current) {\n releaseVy.current = 0\n springTo(0, vy)\n }\n })\n return\n }\n springTo(snaps.current.indexOf(target), vy)\n },\n [springTo],\n )\n\n /**\n * The sheet's natural content height — handle + header, the body's content, the footer — plus the sheet's\n * own top border, rounded UP: a sheet even a fraction of a pixel shorter than its content would let the\n * body scroll.\n */\n const contentHeight = () => {\n const h = (el: HTMLElement | null) => el?.getBoundingClientRect().height ?? 0\n const sheet = sheetRef.current\n const border = sheet ? sheet.offsetHeight - sheet.clientHeight : 0\n // with no header the body is pulled up into the handle's strip (a negative margin) — count it\n const pull = bodyRef.current ? parseFloat(getComputedStyle(bodyRef.current).marginTop) || 0 : 0\n return Math.ceil(\n h(dragAreaRef.current) + pull + h(contentRef.current) + h(footerRef.current) + border,\n )\n }\n\n /** Measure the viewport, resolve the snap points and size the sheet (no animation). */\n const measure = useCallback(() => {\n const vh = typeof window === 'undefined' ? 0 : layerHeight(scrimRef.current)\n // the sheet fits into the visible area — with the keyboard up that's less than the layer, even when\n // nothing of the layer is covered (iOS 26 can move the layer up past the screen's top instead);\n // percentages stay of the layer\n const vv = visibleViewport()\n const available = vv ? Math.min(vh, vv.height) : vh\n const heights = resolveSnapPoints(\n snapPoints,\n vh,\n Math.max(1, Math.floor(available * MAX_HEIGHT_RATIO)),\n snapPoints.includes('content') ? contentHeight() : undefined,\n )\n snaps.current = heights\n maxHeight.current = heights[heights.length - 1]\n if (sheetRef.current) sheetRef.current.style.height = `${maxHeight.current}px`\n // snapPoints is compared by value (an inline array literal is a new array every render)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(snapPoints)])\n\n // open: size the sheet, start it below the screen, spring it up to `defaultSnapIndex`; close: spring it\n // down (carrying a swipe's velocity), then unmount\n useLayoutEffect(() => {\n if (!mounted) return\n if (open) {\n // a just-mounted sheet has no transform yet; one sliding out (re-opened mid-exit) has\n const fresh = !sheetRef.current?.style.transform\n measure()\n const index = Math.min(Math.max(0, defaultSnapIndex), snaps.current.length - 1)\n if (fresh) {\n paint(maxHeight.current) // just below the screen\n // opening at the default snap isn't a \"change\" (onSnapChange reports moves the user makes)\n restIndex.current = index\n springTo(index)\n } else {\n // re-opened mid-exit: back up to where it was\n springTo(snapIndex.current)\n }\n } else {\n // a focused field inside would keep the keyboard up over the page\n const active = document.activeElement\n if (active instanceof HTMLElement && sheetRef.current?.contains(active)) active.blur()\n const vy = releaseVy.current\n releaseVy.current = 0\n springTo(-1, vy, () => setMounted(false))\n }\n // defaultSnapIndex is read on open only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, mounted])\n\n useEffect(() => {\n unmounted.current = false\n return () => {\n unmounted.current = true\n cancelAnim.current()\n }\n }, [])\n\n // a resize (rotation, a desktop window) re-resolves the snap points and jumps to the current one — but a\n // sheet in motion keeps moving (iOS resizes as the sheet opens: pinning the page brings its toolbar back),\n // and a closing one just finishes\n useEffect(() => {\n if (!mounted) return\n const onResize = () => {\n if (dragging.current || !openRef.current) return\n measure()\n const index = Math.min(snapIndex.current, snaps.current.length - 1)\n if (animating.current) {\n springTo(index, springVelocity.current)\n return\n }\n snapIndex.current = index\n cancelAnim.current()\n paint(openRef.current ? maxHeight.current - snaps.current[index] : maxHeight.current)\n settleLayout()\n }\n window.addEventListener('resize', onResize)\n return () => window.removeEventListener('resize', onResize)\n }, [mounted, measure, paint, settleLayout, springTo])\n\n // ── the phone keyboard ───────────────────────────────────────────────────────────────────────────────\n /** Re-resolve the snaps (the space changed) keeping the sheet's visible height — no jump. */\n const refit = useCallback(() => {\n refitPending.current = false\n const visible = maxHeight.current - offset.current\n measure()\n paint(maxHeight.current - Math.min(visible, maxHeight.current))\n }, [measure, paint])\n refitRef.current = refit\n\n /** Scroll the focused field (inside the body) into the space above the keyboard and the footer. */\n const revealFocusedField = useCallback(() => {\n const body = bodyRef.current\n const el = document.activeElement\n if (!body || !(el instanceof HTMLElement) || !body.contains(el) || !el.matches(FIELDS)) return\n // the visible bottom (in the layer's coordinates — see `visibleTop`), or the footer's top above it\n const vv = visibleViewport()\n const screenBottom = vv ? visibleTop(baseScrollY.current) + vv.height : window.innerHeight\n const footerTop = footerRef.current?.getBoundingClientRect().top || Infinity\n const bottom = Math.min(screenBottom, footerTop) - FIELD_MARGIN\n const top = body.getBoundingClientRect().top + FIELD_MARGIN\n const rect = el.getBoundingClientRect()\n if (rect.bottom > bottom) body.scrollTop += rect.bottom - bottom\n else if (rect.top < top) body.scrollTop -= top - rect.top\n }, [])\n\n // the keyboard opening / closing (the visual viewport resizing): fit the snaps into the space above it,\n // lift the sheet onto it (a spring), and bring the focused field into view\n useEffect(() => {\n const vv = typeof window === 'undefined' ? undefined : window.visualViewport\n const sheet = sheetRef.current\n if (!mounted || !vv || !sheet) return\n baseScrollY.current = window.scrollY\n baseHeight.current = layerHeight(scrimRef.current)\n const apply = (inset: number) => {\n keyboardTarget.current = inset\n if (openRef.current && dragging.current) {\n // mid-drag (e.g. the drag itself put the keyboard away): re-fit on release\n refitPending.current = true\n } else if (openRef.current) {\n // a sheet in motion (opening) keeps its speed\n const velocity = animating.current ? springVelocity.current : 0\n cancelAnim.current()\n refit()\n springTo(Math.min(snapIndex.current, snaps.current.length - 1), velocity)\n }\n cancelKeyboard.current()\n cancelKeyboard.current = animateSpring(\n keyboard.current,\n inset,\n 0,\n (value) => {\n keyboard.current = value\n paint(offset.current)\n },\n () => {\n revealFocusedField()\n },\n )\n }\n // iOS reports the keyboard in steps, and not every step fires an event (iOS 26 resizes the layout\n // viewport on its own): after each event the layer is re-measured every frame for a while, and a value\n // that holds for a few frames is applied\n let poll = 0\n let watchUntil = 0\n let seen = ''\n let steady = 0\n // what the sheet was last fitted to: the covered part and the visible height (either can change alone —\n // iOS 26 may move the layer up past the screen's top, so less is visible with nothing covered)\n const read = () => {\n const inset = coveredBottom(scrimRef.current, baseScrollY.current)\n const visible = Math.round(visibleViewport()?.height ?? 0)\n return { inset, key: `${inset}:${visible}` }\n }\n let fitted = read().key\n const tick = () => {\n const { inset, key } = read()\n steady = key === seen ? steady + 1 : 0\n seen = key\n if (steady === 3 && key !== fitted) {\n fitted = key\n apply(inset)\n }\n poll = performance.now() < watchUntil ? requestAnimationFrame(tick) : 0\n }\n const update = () => {\n const { inset, key } = read()\n if (key !== fitted) {\n fitted = key\n apply(inset)\n } else revealFocusedField()\n watchUntil = performance.now() + KEYBOARD_WATCH\n if (!poll && typeof requestAnimationFrame === 'function') poll = requestAnimationFrame(tick)\n }\n const onFocusIn = () => {\n update()\n // moving focus between fields with the keyboard already up: keep the new one in view\n if (keyboardUp()) requestAnimationFrame(revealFocusedField)\n }\n vv.addEventListener('resize', update)\n vv.addEventListener('scroll', update)\n window.addEventListener('resize', update)\n sheet.addEventListener('focusin', onFocusIn)\n sheet.addEventListener('focusout', update)\n update()\n return () => {\n vv.removeEventListener('resize', update)\n vv.removeEventListener('scroll', update)\n window.removeEventListener('resize', update)\n sheet.removeEventListener('focusin', onFocusIn)\n sheet.removeEventListener('focusout', update)\n cancelAnimationFrame(poll)\n cancelKeyboard.current()\n keyboard.current = 0\n keyboardTarget.current = 0\n }\n }, [mounted, measure, paint, refit, springTo, revealFocusedField])\n\n // iOS scrolls the page behind even when its overflow is locked — to a focused field, or under a finger once\n // the keyboard is up — and the sheet's fixed layer then moves with the page (the page shows below it). On a\n // touch screen the page is pinned instead (the classic iOS lock: the body fixed at its scroll offset, put\n // back on close), so iOS can only pan the visual viewport, which `visibleTop` accounts for.\n useLayoutEffect(() => {\n if (!mounted || !isTouchScreen()) return\n pinPage()\n return unpinPage\n }, [mounted])\n\n // …and a finger never scrolls / pans the page: a touch move is stopped unless something it's on can scroll\n // (the body, a nested scroller, a portaled option list) or handles its own moves (`data-sheet-no-drag`, a\n // range input); the sheet's own drags stop theirs themselves\n useEffect(() => {\n if (!mounted || typeof document === 'undefined') return\n const onMove = (event: TouchEvent) => {\n if (event.touches.length > 1 || !event.cancelable) return\n const target = event.target as Element | null\n // a slider, a map, a signature pad: their own moves\n if (target?.closest?.('[data-sheet-no-drag], input[type=\"range\"]')) return\n for (let el = target; el && el !== document.body; el = el.parentElement) {\n const scroller = el === bodyRef.current ? el.scrollHeight > el.clientHeight : canScroll(el)\n if (scroller) return\n }\n event.preventDefault()\n }\n document.addEventListener('touchmove', onMove, { passive: false })\n return () => document.removeEventListener('touchmove', onMove)\n }, [mounted])\n\n /** Dragging the sheet with the keyboard up: put the keyboard away first (blur the focused field). */\n const dismissKeyboard = useCallback(() => {\n if (!keyboardUp()) return\n const active = document.activeElement\n if (\n active instanceof HTMLElement &&\n sheetRef.current?.contains(active) &&\n active.matches(FIELDS)\n )\n active.blur()\n }, [])\n\n // new snap points while open: re-resolve and settle at the same index\n const measuredWith = useRef(measure)\n useEffect(() => {\n if (measuredWith.current === measure) return\n measuredWith.current = measure\n if (!mounted || !openRef.current || dragging.current) return\n measure()\n springTo(Math.min(snapIndex.current, snaps.current.length - 1))\n }, [measure, mounted, springTo])\n\n // `'content'`: follow the content's height — re-resolve when it changes and settle at the new height\n const usesContent = snapPoints.includes('content')\n useEffect(() => {\n if (!mounted || !usesContent || typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(() => {\n if (!openRef.current || dragging.current) return\n const before = snaps.current.join()\n measure()\n if (snaps.current.join() !== before)\n springTo(Math.min(snapIndex.current, snaps.current.length - 1))\n })\n for (const el of [dragAreaRef.current, contentRef.current, footerRef.current])\n if (el) observer.observe(el)\n return () => observer.disconnect()\n }, [mounted, usesContent, measure, springTo])\n\n // the footer's height, so the body can scroll its last content above it\n useEffect(() => {\n const footerEl = footerRef.current\n const sheet = sheetRef.current\n if (!mounted || !footerEl || !sheet) return\n const update = () =>\n sheet.style.setProperty('--tz-sheet-footer', `${footerEl.getBoundingClientRect().height}px`)\n update()\n if (typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(update)\n observer.observe(footerEl)\n return () => observer.disconnect()\n }, [mounted, footer])\n\n // focus: into the sheet on open (the sheet itself — a field would pop the phone keyboard), back to the\n // opener once the sheet has unmounted\n useEffect(() => {\n if (!mounted) return\n const sheet = sheetRef.current\n if (sheet && !sheet.contains(document.activeElement)) sheet.focus({ preventScroll: true })\n const opener = openerRef.current\n return () => {\n // only while nobody else owns focus — a Modal / sheet opened as this one slid out keeps it\n const active = document.activeElement\n const free = !active || active === document.body || !!sheet?.contains(active)\n if (free && opener?.isConnected) opener.focus?.({ preventScroll: true })\n }\n }, [mounted])\n\n // ── drag from the body (touch): the scroll ↔ sheet handoff ─────────────────────────────────────────\n // A touch on the content scrolls it or moves the sheet, handing over mid-gesture (see `gesture.ts`). Touch\n // events, not pointer events: only a non-passive `touchmove` can stop the native scroll once the sheet takes\n // a gesture — the content is then scrolled by hand (with momentum). A mouse scrolls the body with its wheel.\n const hasBody = children != null\n useEffect(() => {\n const body = bodyRef.current\n if (!mounted || !body) return\n let gesture: {\n id: number\n x0: number\n y0: number\n lastY: number\n mode: BodyGestureMode\n raw: number\n grabbed: boolean\n samples: MotionSample[]\n } | null = null\n const scrollMax = () => Math.max(0, body.scrollHeight - body.clientHeight)\n /** Touches the sheet never takes: fields, opt-outs, and nested vertical scrollers. */\n const leaveAlone = (target: EventTarget | null) => {\n const el = target instanceof Element ? target : null\n if (!el) return false\n if (el.closest(NO_DRAG)) return true\n for (let n: Element | null = el; n && n !== body; n = n.parentElement) {\n const overflow = getComputedStyle(n).overflowY\n if ((overflow === 'auto' || overflow === 'scroll') && n.scrollHeight > n.clientHeight + 1)\n return true\n }\n return false\n }\n const own = (e: TouchEvent) =>\n gesture ? Array.from(e.changedTouches).find((t) => t.identifier === gesture!.id) : undefined\n\n const momentum = (velocity: number) => {\n cancelMomentum.current()\n if (prefersReducedMotion() || Math.abs(velocity) < 50) return\n let v = velocity\n let pos = body.scrollTop\n let last = performance.now()\n let raf = 0\n const step = (now: number) => {\n const dt = Math.min(0.064, Math.max(0, (now - last) / 1000))\n last = now\n const next = momentumStep(pos, v, dt, scrollMax())\n pos = next.scrollTop\n v = next.velocity\n body.scrollTop = pos\n if (v !== 0) raf = requestAnimationFrame(step)\n }\n raf = requestAnimationFrame(step)\n cancelMomentum.current = () => cancelAnimationFrame(raf)\n }\n\n const onStart = (e: TouchEvent) => {\n cancelMomentum.current()\n gesture = null\n if (!openRef.current || e.touches.length !== 1 || leaveAlone(e.target)) return\n const t = e.touches[0]\n // a touch on a moving sheet catches it\n const grabbed = animating.current\n if (grabbed) cancelAnim.current()\n gesture = {\n id: t.identifier,\n x0: t.clientX,\n y0: t.clientY,\n lastY: t.clientY,\n mode: 'pending',\n raw: offset.current,\n grabbed,\n samples: [{ t: e.timeStamp, y: t.clientY }],\n }\n }\n const onMove = (e: TouchEvent) => {\n const g = gesture\n if (!g || g.mode === 'native') return\n const t = own(e)\n if (!t) return\n if (g.mode === 'pending') {\n const dx = t.clientX - g.x0\n const dy = t.clientY - g.y0\n if (Math.abs(dx) < DRAG_SLOP && Math.abs(dy) < DRAG_SLOP) return\n const mode = decideBodyGesture({\n offset: offset.current,\n scrollTop: body.scrollTop,\n canScroll: scrollMax() > 0,\n dx,\n dy,\n })\n if (mode === 'native') {\n g.mode = 'native'\n // a caught sheet that the content's own scroll leaves behind: let it settle\n if (g.grabbed) springTo(snapIndex.current)\n return\n }\n g.mode = 'sheet'\n g.raw = offset.current\n dragging.current = true\n sheetRef.current?.setAttribute('data-dragging', 'true')\n dismissKeyboard()\n }\n if (e.cancelable) e.preventDefault()\n const dy = t.clientY - g.lastY\n g.lastY = t.clientY\n g.samples.push({ t: e.timeStamp, y: t.clientY })\n if (g.samples.length > 8) g.samples.shift()\n const next = handoff(\n { mode: g.mode as 'sheet' | 'scroll', raw: g.raw, scrollTop: body.scrollTop },\n dy,\n scrollMax(),\n )\n g.mode = next.mode\n g.raw = next.raw\n if (next.scrollTop !== body.scrollTop) body.scrollTop = next.scrollTop\n paint(banded(next.raw))\n }\n const onEnd = (e: TouchEvent, cancelled: boolean) => {\n const g = gesture\n if (!g || !own(e)) return\n gesture = null\n if (g.mode === 'native') return\n if (g.mode === 'pending') {\n // a tap: a caught sheet settles where it was heading\n if (g.grabbed) springTo(snapIndex.current)\n return\n }\n sheetRef.current?.removeAttribute('data-dragging')\n const vy = cancelled ? 0 : releaseVelocity(g.samples)\n // scrolling the content by hand: carry the flick on as momentum (the finger's opposite)\n if (g.mode === 'scroll' && g.raw >= 0) {\n dragging.current = false\n if (refitPending.current) {\n refit()\n springTo(Math.min(snapIndex.current, snaps.current.length - 1))\n }\n momentum(-vy)\n } else releaseSheet(vy)\n }\n const onTouchEnd = (e: TouchEvent) => onEnd(e, false)\n const onTouchCancel = (e: TouchEvent) => onEnd(e, true)\n\n body.addEventListener('touchstart', onStart, { passive: true })\n // non-passive: once the sheet owns a gesture it must stop the native scroll\n body.addEventListener('touchmove', onMove, { passive: false })\n body.addEventListener('touchend', onTouchEnd)\n body.addEventListener('touchcancel', onTouchCancel)\n return () => {\n body.removeEventListener('touchstart', onStart)\n body.removeEventListener('touchmove', onMove)\n body.removeEventListener('touchend', onTouchEnd)\n body.removeEventListener('touchcancel', onTouchCancel)\n cancelMomentum.current()\n }\n }, [mounted, hasBody, paint, banded, springTo, releaseSheet, dismissKeyboard, refit])\n\n // ── drag (the handle + header) ──────────────────────────────────────────────────────────────────────\n\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (!open || (event.pointerType === 'mouse' && event.button !== 0)) return\n const target = event.target as HTMLElement\n // a control in the header keeps its own click — except the handle, which is the thing you drag\n const control = target.closest(INTERACTIVE)\n if (control && !control.hasAttribute('data-sheet-handle')) return\n cancelAnim.current()\n dragRef.current = {\n id: event.pointerId,\n startY: event.clientY,\n startOffset: offset.current,\n dragging: false,\n samples: [{ t: event.timeStamp, y: event.clientY }],\n }\n }\n\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const drag = dragRef.current\n if (!drag || drag.id !== event.pointerId) return\n const dy = event.clientY - drag.startY\n if (!drag.dragging) {\n if (Math.abs(dy) < DRAG_SLOP) return\n drag.dragging = true\n dragging.current = true\n sheetRef.current?.setAttribute('data-dragging', 'true')\n dismissKeyboard()\n // capture only once it IS a drag: a tap must still reach the handle as a click\n event.currentTarget.setPointerCapture?.(event.pointerId)\n }\n drag.samples.push({ t: event.timeStamp, y: event.clientY })\n if (drag.samples.length > 8) drag.samples.shift()\n paint(banded(drag.startOffset + dy))\n }\n\n const finishDrag = (event: PointerEvent<HTMLDivElement>, cancelled: boolean) => {\n const drag = dragRef.current\n if (!drag || drag.id !== event.pointerId) return\n dragRef.current = null\n sheetRef.current?.removeAttribute('data-dragging')\n if (!drag.dragging) {\n // a tap: the handle's own click handles it; anywhere else on the header, settle where it was\n if (!(event.target as HTMLElement).closest('[data-sheet-handle]')) springTo(snapIndex.current)\n return\n }\n // a drag is not a click — keep the handle from stepping the snap on this pointerup's click (if any)\n suppressClick.current = true\n setTimeout(() => {\n suppressClick.current = false\n }, 0)\n releaseSheet(cancelled ? 0 : releaseVelocity(drag.samples))\n }\n\n // ── the handle: a button that steps through the snap points ─────────────────────────────────────────\n const stepTo = (index: number) => {\n const last = snaps.current.length - 1\n springTo(Math.min(Math.max(0, index), last))\n }\n const onHandleClick = () => {\n if (suppressClick.current) {\n suppressClick.current = false\n return\n }\n const last = snaps.current.length - 1\n stepTo(snapIndex.current >= last ? 0 : snapIndex.current + 1)\n }\n const onHandleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n const last = snaps.current.length - 1\n const moves: Record<string, number> = {\n ArrowUp: snapIndex.current + 1,\n ArrowRight: snapIndex.current + 1,\n ArrowDown: snapIndex.current - 1,\n ArrowLeft: snapIndex.current - 1,\n Home: 0,\n End: last,\n }\n if (!(event.key in moves)) return\n event.preventDefault()\n stepTo(moves[event.key])\n }\n\n // trap Tab within the sheet (Escape + backdrop dismissal live in `<Overlay>`)\n const handleTabTrap = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab') return\n const sheet = sheetRef.current\n if (!sheet) return\n const focusables = [...sheet.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => el.offsetParent !== null || el === document.activeElement,\n )\n if (focusables.length === 0) {\n event.preventDefault()\n sheet.focus()\n return\n }\n const first = focusables[0]\n const last = focusables[focusables.length - 1]\n const active = document.activeElement\n if (event.shiftKey && (active === first || active === sheet)) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n const setSheetRef = (node: HTMLDivElement | null) => {\n sheetRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n if (!mounted) return null\n\n const hasHeader = title != null || description != null || showCloseButton\n\n return (\n <Overlay\n ref={scrimRef}\n open={mounted}\n // while it slides out the sheet is already closing — no second dismiss\n onClose={open ? onClose : undefined}\n closeOnBackdrop={closeOnBackdrop}\n closeOnEscape={closeOnEscape}\n onKeyDown={handleTabTrap}\n dim={dim}\n className={styles.overlay}\n data-closing={open ? undefined : 'true'}\n >\n <div\n ref={setSheetRef}\n className={clsx(styles.sheet, className)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title != null ? titleId : undefined}\n aria-label={title == null ? ariaLabel : undefined}\n aria-describedby={description != null ? descId : undefined}\n tabIndex={-1}\n style={style as CSSProperties}\n {...props}\n >\n <div\n ref={dragAreaRef}\n className={styles.dragArea}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={(e) => finishDrag(e, false)}\n onPointerCancel={(e) => finishDrag(e, true)}\n >\n <button\n type=\"button\"\n className={styles.handle}\n data-sheet-handle=\"\"\n aria-label={t('bottomSheet.resize')}\n onClick={onHandleClick}\n onKeyDown={onHandleKeyDown}\n >\n <span className={styles.handleBar} aria-hidden />\n </button>\n {hasHeader && (\n <div className={styles.header}>\n {(title != null || description != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n )}\n {description != null && (\n <div id={descId} className={styles.subtitle}>\n {description}\n </div>\n )}\n </div>\n )}\n {showCloseButton && (\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n size=\"sm\"\n className={styles.close}\n aria-label={t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )}\n </div>\n {children != null && (\n <div\n ref={bodyRef}\n className={clsx(\n styles.body,\n !hasHeader && styles.bodyNoHeader,\n footer != null && styles.bodyWithFooter,\n bodyClassName,\n )}\n // the header's divider shows only once the content scrolls under it\n onScroll={(e) => {\n const scrolled = e.currentTarget.scrollTop > 0\n if (scrolled !== sheetRef.current?.hasAttribute('data-scrolled'))\n sheetRef.current?.toggleAttribute('data-scrolled', scrolled)\n }}\n >\n <div ref={contentRef} className={styles.bodyContent}>\n {children}\n </div>\n </div>\n )}\n {footer != null && (\n <div ref={footerRef} className={styles.footer}>\n {footer}\n </div>\n )}\n </div>\n </Overlay>\n )\n})\n"],"names":["decideBodyGesture","offset","scrollTop","canScroll","dx","dy","handoff","state","scrollMax","mode","raw","rest","take","momentumStep","velocity","dt","max","deceleration","next","v","resolveSnapPoints","points","viewport","content","heights","p","m","h","unique","a","rubberBand","distance","dimension","c","VELOCITY_WINDOW","releaseVelocity","samples","last","first","FLING_VELOCITY","pickSnap","height","snaps","dismissible","candidates","best","prefersReducedMotion","animateSpring","from","to","onFrame","onDone","stiffness","damping","x","raf","cancelled","step","now","FOCUSABLE","INTERACTIVE","FIELDS","NO_DRAG","KEYBOARD_MIN","FIELD_MARGIN","visibleViewport","vv","layerHeight","layer","visibleTop","baseScrollY","coveredBottom","bottom","inset","isTouchScreen","pins","pinned","PIN_KEYS","pinPage","body","y","key","unpinPage","before","el","style","KEYBOARD_WATCH","DRAG_SLOP","DEFAULT_SNAP_POINTS","MAX_HEIGHT_RATIO","BottomSheet","forwardRef","open","onClose","snapPoints","defaultSnapIndex","onSnapChange","swipeToClose","closeOnBackdrop","closeOnEscape","title","description","footer","showCloseButton","ariaLabel","dim","bodyClassName","className","children","props","forwardedRef","t","useT","titleId","useId","descId","mounted","setMounted","useState","sheetRef","useRef","scrimRef","footerRef","dragAreaRef","contentRef","bodyRef","maxHeight","snapIndex","restIndex","cancelAnim","animating","cancelMomentum","releaseVy","openRef","onSnapChangeRef","onCloseRef","swipeToCloseRef","keyboard","keyboardTarget","cancelKeyboard","baseHeight","keyboardUp","dragging","refitPending","refitRef","dragRef","suppressClick","openerRef","wasOpenRef","paint","useCallback","sheet","lowest","visible","progress","settleLayout","unmounted","springVelocity","springTo","index","target","value","cancel","_a","banded","lowestOffset","vh","releaseSheet","vy","contentHeight","border","pull","measure","available","useLayoutEffect","fresh","active","_b","useEffect","onResize","refit","revealFocusedField","screenBottom","footerTop","top","rect","apply","poll","watchUntil","seen","steady","read","fitted","tick","update","onFocusIn","onMove","event","dismissKeyboard","measuredWith","usesContent","observer","footerEl","opener","hasBody","gesture","leaveAlone","n","overflow","own","e","momentum","pos","onStart","grabbed","g","onEnd","onTouchEnd","onTouchCancel","onPointerDown","control","onPointerMove","drag","_c","finishDrag","stepTo","onHandleClick","onHandleKeyDown","moves","handleTabTrap","focusables","setSheetRef","node","hasHeader","jsx","Overlay","styles","jsxs","clsx","IconButton","Icon","scrolled"],"mappings":"mPAqCO,SAASA,GAAkB,CAAE,OAAAC,EAAQ,UAAAC,EAAW,UAAAC,EAAW,GAAAC,EAAI,GAAAC,GAAoB,CACxF,OAAI,KAAK,IAAID,CAAE,EAAI,KAAK,IAAIC,CAAE,EAAU,SACpCJ,EAAS,GAAY,QACrBC,EAAY,EAAU,SACtBG,EAAK,EAAU,QACZF,EAAa,SAAsB,OAC5C,CAeO,SAASG,GAAQC,EAAqBF,EAAYG,EAAiC,CACxF,GAAI,CAAE,KAAAC,EAAM,IAAAC,EAAK,UAAAR,CAAA,EAAcK,EAC3BI,EAAON,EACX,GAAIM,EAAO,EAAG,CAEZ,GAAIF,IAAS,SAAWC,EAAM,EAAG,CAC/B,MAAME,EAAO,KAAK,IAAID,EAAM,CAACD,CAAG,EAChCA,GAAOE,EACPD,GAAQC,CACV,CACA,GAAID,EAAO,EAAG,CACZ,GAAIT,EAAYM,EAAW,CACzBC,EAAO,SACP,MAAMG,EAAO,KAAK,IAAID,EAAMT,EAAYM,CAAS,EACjDN,GAAaU,EACbD,GAAQC,CACV,CAEID,EAAO,IACTF,EAAOA,IAAS,UAAYP,EAAYM,EAAYC,EAAO,QACvDA,IAAS,UAASC,GAAOC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AvI,CAAA,CACH,CAAA,EAEJ,EAEDE,GACCmI,EAAAA,IAACK,GAAAA,WAAA,CACC,QAAQ,SACR,MAAM,UACN,KAAK,KACL,UAAWH,EAAO,MAClB,aAAY7H,GAAE,cAAc,EAC5B,QAASlB,EAET,SAAA6I,EAAAA,IAACM,GAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CAAA,CACrB,CAAA,CAEJ,CAAA,CAAA,CAAA,EAGHpI,IAAY,MACX8H,EAAAA,IAAC,MAAA,CACC,IAAK7G,EACL,UAAWiH,GAAAA,KACTF,EAAO,KACP,CAACH,IAAaG,EAAO,aACrBtI,GAAU,MAAQsI,EAAO,eACzBlI,CAAA,EAGF,SAAW,GAAM,SACf,MAAMuI,EAAW,EAAE,cAAc,UAAY,EACzCA,MAAa9E,EAAA5C,EAAS,UAAT,YAAA4C,EAAkB,aAAa,qBAC9Cc,EAAA1D,EAAS,UAAT,MAAA0D,EAAkB,gBAAgB,gBAAiBgE,GACvD,EAEA,eAAC,MAAA,CAAI,IAAKrH,GAAY,UAAWgH,EAAO,YACrC,SAAAhI,EAAA,CACH,CAAA,CAAA,EAGHN,GAAU,MACToI,MAAC,MAAA,CAAI,IAAKhH,EAAW,UAAWkH,EAAO,OACpC,SAAAtI,CAAA,CACH,CAAA,CAAA,CAAA,CAEJ,CAAA,CAGN,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { Link as u } from "@tanstack/react-router";
|
|
3
|
-
import { b as l, a as _ } from "./Icon-
|
|
4
|
-
import {
|
|
5
|
-
import { a as d } from "./ConfigProvider-
|
|
3
|
+
import { b as l, a as _ } from "./Icon-DMMO32p6.js";
|
|
4
|
+
import { a as h } from "./Sidebar-D0pNTtIb.js";
|
|
5
|
+
import { a as d } from "./ConfigProvider-BOcVBt4M.js";
|
|
6
6
|
const p = "_breadcrumbs_9gbua_4", N = "_list_9gbua_8", g = "_item_9gbua_18", f = "_home_9gbua_27", k = "_separator_9gbua_41", S = "_link_9gbua_52", T = "_current_9gbua_65", e = {
|
|
7
7
|
breadcrumbs: p,
|
|
8
8
|
list: N,
|
|
@@ -31,4 +31,4 @@ function w({ separator: s = "ArrowRight4" } = {}) {
|
|
|
31
31
|
export {
|
|
32
32
|
w as B
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=Breadcrumbs-
|
|
34
|
+
//# sourceMappingURL=Breadcrumbs-BEcEVdRt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs-
|
|
1
|
+
{"version":3,"file":"Breadcrumbs-BEcEVdRt.js","sources":["../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Link, type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useBreadcrumbs } from '../Sidebar/Sidebar'\nimport styles from './Breadcrumbs.module.css'\n\nconst linkTo = (to: string) => to as LinkProps['to']\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface BreadcrumbsProps {\n /**\n * Separator between crumbs. A known `IconName` (the default `\"ArrowRight4\"`) renders as an icon; any\n * other string renders as plain text; or pass a node.\n */\n separator?: IconName | ReactNode\n}\n\nfunction Separator({ separator }: { separator: IconName | ReactNode }) {\n if (typeof separator === 'string' && ICON_NAME_SET.has(separator)) {\n return <Icon name={separator as IconName} size=\"sm\" className={styles.separator} />\n }\n return (\n <span className={styles.separator} aria-hidden=\"true\">\n {separator}\n </span>\n )\n}\n\n/**\n * Auto-generated breadcrumb trail for the current route, rendered at the top of `RootLayout`'s\n * content. It always starts with a home icon that links to the first allowed menu page (the same\n * target as `FirstRouteRedirect`), followed by one crumb per matched route that declares a\n * `staticData.name`. Intermediate crumbs link to their page when navigable; the current page is\n * plain text. Renders nothing when no path prefix has a name and the leaf route has no\n * `staticData.breadcrumb`. Token-only styling.\n */\nexport function Breadcrumbs({ separator = 'ArrowRight4' }: BreadcrumbsProps = {}) {\n const { homeTo, items } = useBreadcrumbs()\n const t = useT()\n if (items.length === 0) return null\n\n return (\n <nav aria-label={t('breadcrumbs.label')} className={styles.breadcrumbs}>\n <ol className={styles.list}>\n <li className={styles.item}>\n {homeTo ? (\n <Link to={linkTo(homeTo)} className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </Link>\n ) : (\n <span className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </span>\n )}\n </li>\n {items.map((item, index) => {\n const isLast = index === items.length - 1\n return (\n <li className={styles.item} key={`${item.label}-${index}`}>\n <Separator separator={separator} />\n {item.to && !isLast ? (\n <Link to={linkTo(item.to)} className={styles.link}>\n {item.label}\n </Link>\n ) : (\n <span className={styles.current} aria-current={isLast ? 'page' : undefined}>\n {item.label}\n </span>\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"names":["linkTo","to","ICON_NAME_SET","ICON_NAMES","Separator","separator","jsx","Icon","styles","Breadcrumbs","homeTo","items","useBreadcrumbs","useT","jsxs","Link","item","index","isLast"],"mappings":";;;;;;;;;;;;;GAQMA,IAAS,CAACC,MAAeA,GACzBC,IAAgB,IAAI,IAAYC,CAAU;AAUhD,SAASC,EAAU,EAAE,WAAAC,KAAkD;AACrE,SAAI,OAAOA,KAAc,YAAYH,EAAc,IAAIG,CAAS,IACvD,gBAAAC,EAACC,KAAK,MAAMF,GAAuB,MAAK,MAAK,WAAWG,EAAO,WAAW,sBAGhF,QAAA,EAAK,WAAWA,EAAO,WAAW,eAAY,QAC5C,UAAAH,GACH;AAEJ;AAUO,SAASI,EAAY,EAAE,WAAAJ,IAAY,cAAA,IAAoC,CAAA,GAAI;AAChF,QAAM,EAAE,QAAAK,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GACpB,IAAIC,EAAA;AAC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require("react/jsx-runtime"),u=require("@tanstack/react-router"),n=require("./Icon-BoQmbW7j.cjs"),b=require("./Sidebar-B7mCqEkl.cjs"),_=require("./ConfigProvider-DPk0aHDG.cjs"),d="_breadcrumbs_9gbua_4",h="_list_9gbua_8",j="_item_9gbua_18",N="_home_9gbua_27",g="_separator_9gbua_41",x="_link_9gbua_52",p="_current_9gbua_65",s={breadcrumbs:d,list:h,item:j,home:N,separator:g,link:x,current:p},m=r=>r,k=new Set(n.ICON_NAMES);function f({separator:r}){return typeof r=="string"&&k.has(r)?e.jsx(n.Icon,{name:r,size:"sm",className:s.separator}):e.jsx("span",{className:s.separator,"aria-hidden":"true",children:r})}function I({separator:r="ArrowRight4"}={}){const{homeTo:i,items:c}=b.useBreadcrumbs(),t=_.useT();return c.length===0?null:e.jsx("nav",{"aria-label":t("breadcrumbs.label"),className:s.breadcrumbs,children:e.jsxs("ol",{className:s.list,children:[e.jsx("li",{className:s.item,children:i?e.jsx(u.Link,{to:m(i),className:s.home,"aria-label":t("breadcrumbs.home"),children:e.jsx(n.Icon,{name:"Home2",size:"sm"})}):e.jsx("span",{className:s.home,"aria-label":t("breadcrumbs.home"),children:e.jsx(n.Icon,{name:"Home2",size:"sm"})})}),c.map((a,l)=>{const o=l===c.length-1;return e.jsxs("li",{className:s.item,children:[e.jsx(f,{separator:r}),a.to&&!o?e.jsx(u.Link,{to:m(a.to),className:s.link,children:a.label}):e.jsx("span",{className:s.current,"aria-current":o?"page":void 0,children:a.label})]},`${a.label}-${l}`)})]})})}exports.Breadcrumbs=I;
|
|
2
|
+
//# sourceMappingURL=Breadcrumbs-DGyb8ntF.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs-
|
|
1
|
+
{"version":3,"file":"Breadcrumbs-DGyb8ntF.cjs","sources":["../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Link, type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useBreadcrumbs } from '../Sidebar/Sidebar'\nimport styles from './Breadcrumbs.module.css'\n\nconst linkTo = (to: string) => to as LinkProps['to']\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface BreadcrumbsProps {\n /**\n * Separator between crumbs. A known `IconName` (the default `\"ArrowRight4\"`) renders as an icon; any\n * other string renders as plain text; or pass a node.\n */\n separator?: IconName | ReactNode\n}\n\nfunction Separator({ separator }: { separator: IconName | ReactNode }) {\n if (typeof separator === 'string' && ICON_NAME_SET.has(separator)) {\n return <Icon name={separator as IconName} size=\"sm\" className={styles.separator} />\n }\n return (\n <span className={styles.separator} aria-hidden=\"true\">\n {separator}\n </span>\n )\n}\n\n/**\n * Auto-generated breadcrumb trail for the current route, rendered at the top of `RootLayout`'s\n * content. It always starts with a home icon that links to the first allowed menu page (the same\n * target as `FirstRouteRedirect`), followed by one crumb per matched route that declares a\n * `staticData.name`. Intermediate crumbs link to their page when navigable; the current page is\n * plain text. Renders nothing when no path prefix has a name and the leaf route has no\n * `staticData.breadcrumb`. Token-only styling.\n */\nexport function Breadcrumbs({ separator = 'ArrowRight4' }: BreadcrumbsProps = {}) {\n const { homeTo, items } = useBreadcrumbs()\n const t = useT()\n if (items.length === 0) return null\n\n return (\n <nav aria-label={t('breadcrumbs.label')} className={styles.breadcrumbs}>\n <ol className={styles.list}>\n <li className={styles.item}>\n {homeTo ? (\n <Link to={linkTo(homeTo)} className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </Link>\n ) : (\n <span className={styles.home} aria-label={t('breadcrumbs.home')}>\n <Icon name=\"Home2\" size=\"sm\" />\n </span>\n )}\n </li>\n {items.map((item, index) => {\n const isLast = index === items.length - 1\n return (\n <li className={styles.item} key={`${item.label}-${index}`}>\n <Separator separator={separator} />\n {item.to && !isLast ? (\n <Link to={linkTo(item.to)} className={styles.link}>\n {item.label}\n </Link>\n ) : (\n <span className={styles.current} aria-current={isLast ? 'page' : undefined}>\n {item.label}\n </span>\n )}\n </li>\n )\n })}\n </ol>\n </nav>\n )\n}\n"],"names":["linkTo","to","ICON_NAME_SET","ICON_NAMES","Separator","separator","jsx","Icon","styles","Breadcrumbs","homeTo","items","useBreadcrumbs","useT","jsxs","Link","item","index","isLast"],"mappings":"4ZAQMA,EAAUC,GAAeA,EACzBC,EAAgB,IAAI,IAAYC,YAAU,EAUhD,SAASC,EAAU,CAAE,UAAAC,GAAkD,CACrE,OAAI,OAAOA,GAAc,UAAYH,EAAc,IAAIG,CAAS,EACvDC,MAACC,EAAAA,MAAK,KAAMF,EAAuB,KAAK,KAAK,UAAWG,EAAO,UAAW,QAGhF,OAAA,CAAK,UAAWA,EAAO,UAAW,cAAY,OAC5C,SAAAH,EACH,CAEJ,CAUO,SAASI,EAAY,CAAE,UAAAJ,EAAY,aAAA,EAAoC,CAAA,EAAI,CAChF,KAAM,CAAE,OAAAK,EAAQ,MAAAC,CAAA,EAAUC,iBAAA,EACpB,EAAIC,EAAAA,KAAA,EACV,OAAIF,EAAM,SAAW,EAAU,KAG7BL,EAAAA,IAAC,MAAA,CAAI,aAAY,EAAE,mBAAmB,EAAG,UAAWE,EAAO,YACzD,SAAAM,EAAAA,KAAC,KAAA,CAAG,UAAWN,EAAO,KACpB,SAAA,CAAAF,EAAAA,IAAC,MAAG,UAAWE,EAAO,KACnB,SAAAE,EACCJ,EAAAA,IAACS,EAAAA,MAAK,GAAIf,EAAOU,CAAM,EAAG,UAAWF,EAAO,KAAM,aAAY,EAAE,kBAAkB,EAChF,eAACD,EAAAA,KAAA,CAAK,KAAK,QAAQ,KAAK,KAAK,CAAA,CAC/B,QAEC,OAAA,CAAK,UAAWC,EAAO,KAAM,aAAY,EAAE,kBAAkB,EAC5D,eAACD,EAAAA,KAAA,CAAK,KAAK,QAAQ,KAAK,KAAK,EAC/B,CAAA,CAEJ,EACCI,EAAM,IAAI,CAACK,EAAMC,IAAU,CAC1B,MAAMC,EAASD,IAAUN,EAAM,OAAS,EACxC,OACEG,EAAAA,KAAC,KAAA,CAAG,UAAWN,EAAO,KACpB,SAAA,CAAAF,MAACF,GAAU,UAAAC,EAAsB,EAChCW,EAAK,IAAM,CAACE,EACXZ,EAAAA,IAACS,EAAAA,KAAA,CAAK,GAAIf,EAAOgB,EAAK,EAAE,EAAG,UAAWR,EAAO,KAC1C,SAAAQ,EAAK,KAAA,CACR,EAEAV,EAAAA,IAAC,OAAA,CAAK,UAAWE,EAAO,QAAS,eAAcU,EAAS,OAAS,OAC9D,SAAAF,EAAK,KAAA,CACR,CAAA,CAAA,EAT6B,GAAGA,EAAK,KAAK,IAAIC,CAAK,EAWvD,CAEJ,CAAC,CAAA,CAAA,CACH,CAAA,CACF,CAEJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as z, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as W, isValidElement as v, cloneElement as y } from "react";
|
|
3
3
|
import { clsx as B } from "clsx";
|
|
4
|
-
import { L as i } from "./Loader-
|
|
4
|
+
import { L as i } from "./Loader-Dj_lwZT2.js";
|
|
5
5
|
const E = "_button_1jlfc_1", L = "_sm_1jlfc_23", N = "_md_1jlfc_29", $ = "_lg_1jlfc_35", w = "_contained_1jlfc_42", A = "_filled_1jlfc_54", R = "_outlined_1jlfc_65", V = "_text_1jlfc_78", k = "_fullWidth_1jlfc_90", q = "_rounded_1jlfc_94", C = "_disabled_1jlfc_102", D = "_loading_1jlfc_106", F = "_label_1jlfc_111", t = {
|
|
6
6
|
button: E,
|
|
7
7
|
sm: L,
|
|
@@ -69,4 +69,4 @@ const E = "_button_1jlfc_1", L = "_sm_1jlfc_23", N = "_md_1jlfc_29", $ = "_lg_1j
|
|
|
69
69
|
export {
|
|
70
70
|
M as B
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=Button-
|
|
72
|
+
//# sourceMappingURL=Button-CwwuhATn.js.map
|