@servicetitan/anvil2 1.44.2 → 1.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -7
- package/README.md +0 -8
- package/dist/Alert-BNGvfMAV.js +112 -0
- package/dist/Alert-BNGvfMAV.js.map +1 -0
- package/dist/{Alert-C3WoRkeN.css → Alert.css} +0 -1
- package/dist/Alert.js +1 -1
- package/dist/{Announcement-ButSjdLn.js → Announcement-CoheCP1i.js} +23 -28
- package/dist/Announcement-CoheCP1i.js.map +1 -0
- package/dist/Announcement.css +0 -1
- package/dist/Announcement.js +1 -1
- package/dist/{HammerProvider-vt3DkcCZ-06BeBrPu.js → AnvilProvider-C_qRQnE6.js} +22 -12
- package/dist/AnvilProvider-C_qRQnE6.js.map +1 -0
- package/dist/AnvilProvider.js +1 -1
- package/dist/{Avatar-DREZJN2K.js → Avatar-CyGjhToG.js} +3 -10
- package/dist/Avatar-CyGjhToG.js.map +1 -0
- package/dist/{Avatar-C7cbRTCt-DCvzmr2C.js → Avatar-D07f9NH_.js} +9 -9
- package/dist/Avatar-D07f9NH_.js.map +1 -0
- package/dist/{Avatar-C7cbRTCt.css → Avatar.css} +0 -1
- package/dist/Avatar.js +2 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/{Badge-7aZfE-LH.js → Badge-DCA9mfc2.js} +5 -12
- package/dist/Badge-DCA9mfc2.js.map +1 -0
- package/dist/Badge.css +0 -1
- package/dist/Badge.js +1 -1
- package/dist/{Breadcrumbs-BMbkH9hL-BUjQksuj.js → Breadcrumbs-C4_PEolS.js} +7 -7
- package/dist/Breadcrumbs-C4_PEolS.js.map +1 -0
- package/dist/{Breadcrumbs-BMbkH9hL.css → Breadcrumbs.css} +0 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/{Button-BaHFf1AT-BQy-PFB5.js → Button-BxFXQ0-n.js} +31 -16
- package/dist/Button-BxFXQ0-n.js.map +1 -0
- package/dist/Button.css +59 -46
- package/dist/Button.js +1 -1
- package/dist/Button.module-pUNSKoVC.js +25 -0
- package/dist/Button.module-pUNSKoVC.js.map +1 -0
- package/dist/ButtonCompound-BF2Q6gGX.js +64 -0
- package/dist/ButtonCompound-BF2Q6gGX.js.map +1 -0
- package/dist/ButtonCompound.js +1 -1
- package/dist/{ButtonLink-5qlX0uZx-b9H7MGhk.js → ButtonLink-CXv65WVV.js} +35 -17
- package/dist/ButtonLink-CXv65WVV.js.map +1 -0
- package/dist/ButtonLink.js +1 -1
- package/dist/{ButtonToggle-Bm4KRl3o-B1-LbfjY.js → ButtonToggle-pSwg7NvT.js} +26 -5
- package/dist/ButtonToggle-pSwg7NvT.js.map +1 -0
- package/dist/ButtonToggle.js +1 -1
- package/dist/{Calendar-BvftKznl-D4_xp9Rv.js → Calendar-Dq_of5A3.js} +324 -255
- package/dist/Calendar-Dq_of5A3.js.map +1 -0
- package/dist/{Calendar-BvftKznl.css → Calendar.css} +0 -1
- package/dist/Calendar.js +1 -1
- package/dist/{Card-ZknG-yim-7W6rYSFV.js → Card-vTYeSkxt.js} +3 -3
- package/dist/Card-vTYeSkxt.js.map +1 -0
- package/dist/{Card-ZknG-yim.css → Card.css} +0 -1
- package/dist/Card.js +1 -1
- package/dist/{Checkbox-zg8LVvB6.js → Checkbox-3y2d9mBd.js} +4 -10
- package/dist/Checkbox-3y2d9mBd.js.map +1 -0
- package/dist/{Checkbox-DyHm7Ntt-DYw5QL3l.js → Checkbox-BiOzGpgJ.js} +9 -11
- package/dist/Checkbox-BiOzGpgJ.js.map +1 -0
- package/dist/Checkbox.js +2 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/{Chip-MbBEXeAm-DmAcwPRJ.js → Chip-Bz-vlQ4D.js} +37 -10
- package/dist/Chip-Bz-vlQ4D.js.map +1 -0
- package/dist/{Chip-MbBEXeAm.css → Chip.css} +0 -1
- package/dist/Chip.js +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DateField-Bqsnpt8S.js → DateField-B2mnasH5.js} +42 -45
- package/dist/DateField-B2mnasH5.js.map +1 -0
- package/dist/DateField.js +1 -1
- package/dist/DateFieldRange-DPbyzuHb.js +557 -0
- package/dist/DateFieldRange-DPbyzuHb.js.map +1 -0
- package/dist/DateFieldRange.js +1 -1
- package/dist/DateFieldSingle-CfAJDcx9.js +450 -0
- package/dist/DateFieldSingle-CfAJDcx9.js.map +1 -0
- package/dist/DateFieldSingle.js +1 -1
- package/dist/DateFieldYearless-ydxcsmRV.js +266 -0
- package/dist/DateFieldYearless-ydxcsmRV.js.map +1 -0
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DaysOfTheWeek-ImBPjEvl.js → DaysOfTheWeek-BYvE9QK5.js} +9 -28
- package/dist/DaysOfTheWeek-BYvE9QK5.js.map +1 -0
- package/dist/DaysOfTheWeek.css +0 -1
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/{Details-DVg0EOkv.js → Details-CF8DImjw.js} +34 -100
- package/dist/Details-CF8DImjw.js.map +1 -0
- package/dist/Details.css +0 -1
- package/dist/Details.js +1 -1
- package/dist/{Dialog-BR6f-XRH.js → Dialog-DpH2Qvbd.js} +71 -166
- package/dist/Dialog-DpH2Qvbd.js.map +1 -0
- package/dist/Dialog.css +29 -30
- package/dist/Dialog.js +1 -1
- package/dist/{Divider-B0xGfyWE-f5-ThMiS.js → Divider-DJe8kLf2.js} +3 -3
- package/dist/Divider-DJe8kLf2.js.map +1 -0
- package/dist/{Divider-B0xGfyWE.css → Divider.css} +0 -1
- package/dist/Divider.js +1 -1
- package/dist/Dnd.js +1 -1
- package/dist/DndSort.css +0 -1
- package/dist/DndSort.js +5545 -1
- package/dist/DndSort.js.map +1 -1
- package/dist/Drawer-DI_k6W2k.js +377 -0
- package/dist/Drawer-DI_k6W2k.js.map +1 -0
- package/dist/Drawer.css +161 -0
- package/dist/Drawer.js +1 -1
- package/dist/{floating-ui.react-BFNinq1w.js → DrawerContext-DboTgTmo.js} +958 -908
- package/dist/DrawerContext-DboTgTmo.js.map +1 -0
- package/dist/{EditCard-B_n1uFkv.js → EditCard-WKzZ2XCz.js} +12 -19
- package/dist/EditCard-WKzZ2XCz.js.map +1 -0
- package/dist/EditCard.css +0 -1
- package/dist/EditCard.js +1 -1
- package/dist/FieldLabel-BfnCXung.js +87 -0
- package/dist/FieldLabel-BfnCXung.js.map +1 -0
- package/dist/FieldLabel.css +60 -0
- package/dist/FieldLabel.js +1 -1
- package/dist/{FieldMessage-Bobp105T-DYhStLY4.js → FieldMessage-B7uQ8vmr.js} +3 -3
- package/dist/FieldMessage-B7uQ8vmr.js.map +1 -0
- package/dist/{FieldMessage-Bobp105T.css → FieldMessage.css} +0 -2
- package/dist/FieldMessage.js +1 -1
- package/dist/{Flex-CiK7uNUu-BfxHG4L0.js → Flex-BdQMekvA.js} +3 -3
- package/dist/Flex-BdQMekvA.js.map +1 -0
- package/dist/{Flex-CiK7uNUu.css → Flex.css} +0 -1
- package/dist/Flex.js +1 -1
- package/dist/{Grid-DFAd8mTe.js → Grid-MGUC698u.js} +48 -30
- package/dist/Grid-MGUC698u.js.map +1 -0
- package/dist/Grid.css +0 -1
- package/dist/Grid.js +1 -1
- package/dist/{Helper-h7k80qls-DHPFHTvI.js → Helper-BkIDJqgA.js} +4 -4
- package/dist/Helper-BkIDJqgA.js.map +1 -0
- package/dist/{Helper-h7k80qls.css → Helper.css} +0 -1
- package/dist/{Icon-B6HmlQiR-BxQkO3X5.js → Icon-D8SPKeO4.js} +3 -3
- package/dist/Icon-D8SPKeO4.js.map +1 -0
- package/dist/{Icon-B6HmlQiR.css → Icon.css} +0 -1
- package/dist/Icon.js +1 -1
- package/dist/{InputMask-BuO8lNAB-DdxdO5Jw.js → InputMask-O_qi1p_3.js} +88 -67
- package/dist/InputMask-O_qi1p_3.js.map +1 -0
- package/dist/InputMask.js +1 -1
- package/dist/Link-eRsLWPaQ.js +103 -0
- package/dist/Link-eRsLWPaQ.js.map +1 -0
- package/dist/{Link-MiffPrW9.css → Link.css} +0 -1
- package/dist/Link.js +1 -1
- package/dist/Link.module-Cf17JWod.js +12 -0
- package/dist/Link.module-Cf17JWod.js.map +1 -0
- package/dist/LinkButton-2lXfrVoU.js +64 -0
- package/dist/LinkButton-2lXfrVoU.js.map +1 -0
- package/dist/LinkButton.js +1 -75
- package/dist/LinkButton.js.map +1 -1
- package/dist/{ListView-DVPhWDCM.js → ListView-jR2ZkBB7.js} +151 -234
- package/dist/ListView-jR2ZkBB7.js.map +1 -0
- package/dist/ListView.css +0 -1
- package/dist/ListView.js +1 -1
- package/dist/{ListView.module-MVsNF0X0-MVsNF0X0.js → ListView.module-MVsNF0X0.js} +1 -1
- package/dist/ListView.module-MVsNF0X0.js.map +1 -0
- package/dist/{Listbox-B-WUuj-_-BWWeWtLW.js → Listbox-CUhMbFm2.js} +67 -50
- package/dist/Listbox-CUhMbFm2.js.map +1 -0
- package/dist/Listbox.css +0 -1
- package/dist/Listbox.js +1 -1
- package/dist/{Listbox.module-DcBE8Zmo-DcBE8Zmo.js → Listbox.module-DcBE8Zmo.js} +1 -1
- package/dist/Listbox.module-DcBE8Zmo.js.map +1 -0
- package/dist/{LocalizationContext-UsmB5mnR-BUIYgNp2.js → LocalizationContext-UsmB5mnR.js} +2 -2
- package/dist/LocalizationContext-UsmB5mnR.js.map +1 -0
- package/dist/{LocalizationProvider-VtRAfGBT-Bo8XuFoE.js → LocalizationProvider-DEZyjW5d.js} +3 -3
- package/dist/LocalizationProvider-DEZyjW5d.js.map +1 -0
- package/dist/LocalizationProvider.d.ts +0 -4
- package/dist/LocalizationProvider.js +2 -2
- package/dist/{Menu-TtVJnSrA-yBYichuJ.js → Menu-C8we5CHP.js} +52 -22
- package/dist/Menu-C8we5CHP.js.map +1 -0
- package/dist/{Menu-TtVJnSrA.css → Menu.css} +0 -2
- package/dist/Menu.js +1 -1
- package/dist/{NumberField-C9lMsPMD.js → NumberField-1_gRsWT4.js} +158 -175
- package/dist/NumberField-1_gRsWT4.js.map +1 -0
- package/dist/NumberField.css +7 -8
- package/dist/NumberField.js +1 -1
- package/dist/{Overflow-CFClqFVC.css → Overflow.css} +0 -2
- package/dist/Overflow.js +400 -1
- package/dist/Overflow.js.map +1 -1
- package/dist/{Page-CGAylFKz.js → Page-CY6QRlvb.js} +14 -14
- package/dist/Page-CY6QRlvb.js.map +1 -0
- package/dist/Page.js +1 -1
- package/dist/{Pagination-DU_qvFRR.js → Pagination-ta8a2cJN.js} +29 -30
- package/dist/Pagination-ta8a2cJN.js.map +1 -0
- package/dist/Pagination.css +28 -28
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-CU2cGVD8-Casl3vM1.js → Popover-r26xMIfm.js} +260 -229
- package/dist/Popover-r26xMIfm.js.map +1 -0
- package/dist/{Popover-CU2cGVD8.css → Popover.css} +0 -2
- package/dist/Popover.js +1 -1
- package/dist/{PortalProvider-9lXkQ0xY-BKoGegS1.js → PortalProvider-9lXkQ0xY.js} +2 -2
- package/dist/PortalProvider-9lXkQ0xY.js.map +1 -0
- package/dist/PortalProvider.d.ts +0 -4
- package/dist/PortalProvider.js +1 -1
- package/dist/ProgressBar-BnXuQ6Bx.js +130 -0
- package/dist/ProgressBar-BnXuQ6Bx.js.map +1 -0
- package/dist/ProgressBar.css +89 -0
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-DnOuBPi_.js → Radio-CwmRUIzo.js} +4 -10
- package/dist/Radio-CwmRUIzo.js.map +1 -0
- package/dist/Radio.js +2 -1
- package/dist/Radio.js.map +1 -1
- package/dist/{Radio-DQ_VQFGZ-SdFBlDnE.js → RadioGroup-BNCWIHOG.js} +84 -105
- package/dist/RadioGroup-BNCWIHOG.js.map +1 -0
- package/dist/{Radio-DQ_VQFGZ.css → RadioGroup.css} +0 -1
- package/dist/{SearchField-BGPqpnVd.js → SearchField-BKXkoWPs.js} +21 -27
- package/dist/SearchField-BKXkoWPs.js.map +1 -0
- package/dist/SearchField.css +0 -1
- package/dist/SearchField.js +1 -1
- package/dist/{SegmentedControl-DY1PSYmd.js → SegmentedControl-CsjjV1Dz.js} +32 -80
- package/dist/SegmentedControl-CsjjV1Dz.js.map +1 -0
- package/dist/SegmentedControl.css +0 -1
- package/dist/SegmentedControl.js +1 -1
- package/dist/{SelectCard-LSAl_7Lh-BYtfe9PC.js → SelectCard-DOGCG0zr.js} +17 -17
- package/dist/SelectCard-DOGCG0zr.js.map +1 -0
- package/dist/{SelectCard-LSAl_7Lh.css → SelectCard.css} +0 -1
- package/dist/SelectCard.js +1 -1
- package/dist/{SelectTrigger-C2w-flvK.js → SelectTrigger-BMo0e-F7.js} +31 -44
- package/dist/SelectTrigger-BMo0e-F7.js.map +1 -0
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-Dj154EN4-BtTvR-Nh.js → SelectTriggerBase-BMMxnXrw.js} +54 -40
- package/dist/SelectTriggerBase-BMMxnXrw.js.map +1 -0
- package/dist/{SelectTriggerBase-Dj154EN4.css → SelectTriggerBase.css} +68 -54
- package/dist/{SideNav-Bh_pVeEw.js → SideNav-CBAzYyML.js} +71 -154
- package/dist/SideNav-CBAzYyML.js.map +1 -0
- package/dist/SideNav.css +0 -1
- package/dist/SideNav.js +1 -1
- package/dist/Skeleton.css +0 -1
- package/dist/Skeleton.d.ts +0 -4
- package/dist/Skeleton.js +190 -1
- package/dist/Skeleton.js.map +1 -1
- package/dist/{Spinner-DliJVzdW-BQlZEj4V.js → Spinner-wmO8Epw0.js} +2 -2
- package/dist/Spinner-wmO8Epw0.js.map +1 -0
- package/dist/{Spinner-DliJVzdW.css → Spinner.css} +0 -1
- package/dist/Spinner.js +1 -1
- package/dist/{SrOnly-BsKDHetF-B93X65F1.js → SrOnly-CTsYSuby.js} +2 -2
- package/dist/SrOnly-CTsYSuby.js.map +1 -0
- package/dist/{SrOnly-BsKDHetF.css → SrOnly.css} +0 -1
- package/dist/SrOnly.js +1 -1
- package/dist/{Stepper-BtbDBIzz.js → Stepper-D-fOH9TF.js} +142 -326
- package/dist/Stepper-D-fOH9TF.js.map +1 -0
- package/dist/Stepper.css +43 -44
- package/dist/Stepper.js +1 -1
- package/dist/{Switch-DAQFzi-X.js → Switch-C2ddZcr9.js} +22 -28
- package/dist/Switch-C2ddZcr9.js.map +1 -0
- package/dist/Switch.css +0 -1
- package/dist/Switch.js +1 -1
- package/dist/{Tab-BSC7e4rM.js → Tab-wNucMTgo.js} +42 -120
- package/dist/Tab-wNucMTgo.js.map +1 -0
- package/dist/Tab.css +0 -1
- package/dist/Tab.js +1 -1
- package/dist/{Text-CED_yrId-DsRYZw2-.js → Text-BqvcbXyp.js} +3 -3
- package/dist/Text-BqvcbXyp.js.map +1 -0
- package/dist/{Text-CED_yrId.css → Text.css} +0 -1
- package/dist/Text.js +1 -1
- package/dist/TextField-CwgE_JJU.js +13 -0
- package/dist/TextField-CwgE_JJU.js.map +1 -0
- package/dist/{TextField-DoPP1CQ--UWAOTYiv.js → TextField-DlsZEkS0.js} +29 -12
- package/dist/TextField-DlsZEkS0.js.map +1 -0
- package/dist/TextField.css +0 -1
- package/dist/TextField.js +1 -1
- package/dist/{TextField.module-EkKlj66e-EkKlj66e.js → TextField.module-EkKlj66e.js} +1 -1
- package/dist/TextField.module-EkKlj66e.js.map +1 -0
- package/dist/{Textarea-D2AAZ1L3.js → Textarea-DU-SpoDL.js} +38 -44
- package/dist/Textarea-DU-SpoDL.js.map +1 -0
- package/dist/Textarea.css +0 -1
- package/dist/Textarea.js +1 -1
- package/dist/{ThemeProvider-Q3ji6Rpx-DBXlAuQ8.js → ThemeProvider-Be3Pvtpz.js} +6 -8
- package/dist/ThemeProvider-Be3Pvtpz.js.map +1 -0
- package/dist/{ThemeProvider-Q3ji6Rpx.css → ThemeProvider.css} +0 -1
- package/dist/ThemeProvider.d.ts +0 -4
- package/dist/ThemeProvider.js +2 -1
- package/dist/ThemeProvider.js.map +1 -1
- package/dist/ThemeProviderContext-l52GohYT.js +8 -0
- package/dist/ThemeProviderContext-l52GohYT.js.map +1 -0
- package/dist/{TimeField-tA9uo4lK.js → TimeField-CfhyRfX9.js} +229 -215
- package/dist/TimeField-CfhyRfX9.js.map +1 -0
- package/dist/TimeField.css +0 -1
- package/dist/TimeField.d.ts +4 -0
- package/dist/TimeField.js +1 -1
- package/dist/Toast.js +2 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Toaster-BgjT0p8b.js +1124 -0
- package/dist/Toaster-BgjT0p8b.js.map +1 -0
- package/dist/{toast-BhV_Ask2.js → Toaster-CfC9wod0.js} +5 -7
- package/dist/Toaster-CfC9wod0.js.map +1 -0
- package/dist/Toaster.css +235 -0
- package/dist/{Toolbar-CSWhVSUM.js → Toolbar-DK7tXy_W.js} +163 -279
- package/dist/Toolbar-DK7tXy_W.js.map +1 -0
- package/dist/Toolbar.css +28 -19
- package/dist/Toolbar.js +1 -1
- package/dist/Tooltip-BI3Xs75X.js +730 -0
- package/dist/Tooltip-BI3Xs75X.js.map +1 -0
- package/dist/Tooltip.css +99 -0
- package/dist/Tooltip.js +1 -1
- package/dist/assets/icons/st/atlas_gradient.svg +1 -0
- package/dist/assets/icons/st/atlas_logo.svg +1 -0
- package/dist/assets/icons/st/atlas_simple.svg +1 -0
- package/dist/assets/icons/st.ts +3 -0
- package/dist/{check_circle-BGfigqq-.js → check_circle-Dja-C2lM.js} +2 -4
- package/dist/check_circle-Dja-C2lM.js.map +1 -0
- package/dist/{childrenToString-Bz9MqbHb-Bz9MqbHb.js → childrenToString-Bz9MqbHb.js} +1 -1
- package/dist/childrenToString-Bz9MqbHb.js.map +1 -0
- package/dist/components/Alert/Alert.d.ts +26 -8
- package/dist/components/Announcement/Announcement.d.ts +26 -8
- package/dist/components/Avatar/Avatar.d.ts +2 -48
- package/dist/components/Avatar/AvatarGroup.d.ts +39 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/internal/Avatar.d.ts +58 -0
- package/dist/components/Avatar/internal/AvatarBase.d.ts +75 -0
- package/dist/components/Badge/Badge.d.ts +31 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +23 -14
- package/dist/components/Breadcrumbs/BreadcrumbsLink.d.ts +23 -0
- package/dist/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +43 -9
- package/dist/components/ButtonCompound/ButtonCompound.d.ts +20 -7
- package/dist/components/ButtonLink/ButtonLink.d.ts +66 -15
- package/dist/components/ButtonToggle/ButtonToggle.d.ts +46 -11
- package/dist/components/Calendar/Calendar.d.ts +149 -36
- package/dist/components/Calendar/CalendarContext.d.ts +153 -0
- package/dist/components/Calendar/CalendarMonth.d.ts +9 -0
- package/dist/components/Calendar/CalendarMonthButton.d.ts +16 -0
- package/dist/components/Calendar/CalendarNextButton.d.ts +11 -0
- package/dist/components/Calendar/CalendarNowButton.d.ts +20 -0
- package/dist/components/Calendar/CalendarPrevButton.d.ts +11 -0
- package/dist/components/Calendar/CalendarYearButton.d.ts +15 -0
- package/dist/components/Calendar/index.d.ts +9 -2
- package/dist/components/Calendar/internal/CalendarDay.d.ts +21 -0
- package/dist/components/Calendar/internal/CalendarMonthSelection.d.ts +25 -0
- package/dist/components/Calendar/internal/CalendarWeek.d.ts +28 -0
- package/dist/components/Calendar/internal/CalendarYearSelection.d.ts +25 -0
- package/dist/components/Calendar/internal/utils.d.ts +12 -0
- package/dist/components/Card/Card.d.ts +26 -16
- package/dist/components/Checkbox/Checkbox.d.ts +3 -29
- package/dist/components/Checkbox/CheckboxGroup.d.ts +53 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/internal/Checkbox.d.ts +133 -0
- package/dist/components/Checkbox/types.d.ts +4 -0
- package/dist/components/Chip/Chip.d.ts +4 -3
- package/dist/components/Chip/internal/Chip.d.ts +108 -0
- package/dist/components/Combobox/Combobox.d.ts +11 -283
- package/dist/components/Combobox/ComboboxContent.d.ts +59 -0
- package/dist/components/Combobox/ComboboxEmpty.d.ts +26 -0
- package/dist/components/Combobox/ComboboxItem.d.ts +34 -0
- package/dist/components/Combobox/ComboboxList.d.ts +31 -0
- package/dist/components/Combobox/ComboboxMockData.d.ts +44 -0
- package/dist/components/Combobox/ComboboxSelect.d.ts +59 -0
- package/dist/components/Combobox/ComboboxTrigger.d.ts +43 -0
- package/dist/components/Combobox/ComboboxTypes.d.ts +374 -0
- package/dist/components/Combobox/index.d.ts +10 -3
- package/dist/components/Combobox/internal/ComboboxContext.d.ts +8 -0
- package/dist/components/Combobox/internal/ComboboxGroupContext.d.ts +8 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/ComboboxLegacy.d.ts +131 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/ComboboxLegacyContent.d.ts +20 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/ComboboxLegacyEmpty.d.ts +5 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/ComboboxLegacyItem.d.ts +26 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/ComboboxLegacyList.d.ts +5 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/ComboboxLegacyMockData.d.ts +37 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/ComboboxLegacyTrigger.d.ts +21 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/ComboboxLegacyUtils.d.ts +38 -0
- package/dist/components/Combobox/internal/ComboboxLegacy/index.d.ts +7 -0
- package/dist/components/Combobox/internal/ComboboxMockData.d.ts +44 -0
- package/dist/components/Combobox/internal/ComboboxUtils.d.ts +74 -0
- package/dist/components/Combobox/internal/useGroups.d.ts +14 -0
- package/dist/components/Combobox/useInfiniteCombobox.d.ts +69 -1
- package/dist/components/DateField/DateField.d.ts +23 -61
- package/dist/components/DateField/internal/DateFieldLegacy/DateFieldLegacy.d.ts +37 -0
- package/dist/components/DateField/internal/DateFieldLegacy/index.d.ts +1 -0
- package/dist/components/DateField/internal/isoToDateFormat.d.ts +1 -0
- package/dist/components/DateField/types.d.ts +47 -0
- package/dist/components/DateFieldRange/DateFieldRange.d.ts +57 -6
- package/dist/components/DateFieldRange/internal/DateFieldRangeCalendar.d.ts +17 -0
- package/dist/components/DateFieldRange/internal/MaskedDateRangeInput.d.ts +41 -0
- package/dist/components/DateFieldRange/internal/maskito/dateRangePlaceholderMask.d.ts +18 -0
- package/dist/components/DateFieldRange/internal/useDateFieldRangeConversion.d.ts +29 -0
- package/dist/components/DateFieldRange/internal/useDateFieldRangeState.d.ts +70 -0
- package/dist/components/DateFieldRange/internal/utils.d.ts +17 -0
- package/dist/components/DateFieldSingle/DateFieldSingle.d.ts +55 -5
- package/dist/components/DateFieldSingle/index.d.ts +1 -0
- package/dist/components/DateFieldSingle/internal/DateFieldSingleCalendar.d.ts +15 -0
- package/dist/components/DateFieldSingle/internal/MaskedDateInput.d.ts +35 -0
- package/dist/components/DateFieldSingle/internal/constants.d.ts +3 -0
- package/dist/components/DateFieldSingle/internal/maskito/datePlaceholderMask.d.ts +16 -0
- package/dist/components/DateFieldSingle/internal/maskito/makeZeroShortcutPreprocessor.d.ts +10 -0
- package/dist/components/DateFieldSingle/internal/useDateFieldOrchestration.d.ts +17 -0
- package/dist/components/DateFieldSingle/internal/useDateFieldSingleConversion.d.ts +45 -0
- package/dist/components/DateFieldSingle/internal/useDateFieldSingleState.d.ts +49 -0
- package/dist/components/DateFieldSingle/internal/utils.d.ts +14 -0
- package/dist/components/DateFieldSingle/types.d.ts +2 -0
- package/dist/components/DateFieldYearless/DateFieldYearless.d.ts +61 -36
- package/dist/components/DateFieldYearless/index.d.ts +1 -0
- package/dist/components/DateFieldYearless/internal/MaskedYearlessDateInput.d.ts +35 -0
- package/dist/components/DateFieldYearless/internal/maskito/yearlessDatePlaceholderMask.d.ts +16 -0
- package/dist/components/DateFieldYearless/internal/utils.d.ts +12 -0
- package/dist/components/DateFieldYearless/types.d.ts +7 -0
- package/dist/components/DaysOfTheWeek/DaysOfTheWeek.d.ts +117 -20
- package/dist/components/Details/Details.d.ts +30 -58
- package/dist/components/Details/DetailsContent.d.ts +41 -0
- package/dist/components/Details/DetailsSummary.d.ts +24 -0
- package/dist/components/Details/index.d.ts +2 -0
- package/dist/components/Details/internal/DetailsArrow.d.ts +20 -0
- package/dist/components/Details/internal/DetailsContext.d.ts +8 -0
- package/dist/components/Dialog/Dialog.d.ts +97 -109
- package/dist/components/Dialog/DialogCancelButton.d.ts +21 -0
- package/dist/components/Dialog/DialogContent.d.ts +22 -0
- package/dist/components/Dialog/DialogFooter.d.ts +33 -0
- package/dist/components/Dialog/DialogHeader.d.ts +21 -0
- package/dist/components/Dialog/index.d.ts +6 -2
- package/dist/components/Dialog/internal/DialogContext.d.ts +8 -0
- package/dist/components/Dialog/internal/useDialogContext.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +34 -7
- package/dist/components/Dnd/DndHandle.d.ts +26 -0
- package/dist/components/Dnd/DndHandleButton.d.ts +32 -0
- package/dist/components/Dnd/DndSortLine.d.ts +39 -0
- package/dist/components/Dnd/DndZone.d.ts +55 -0
- package/dist/components/Dnd/index.d.ts +7 -1
- package/dist/components/DndSort/DndSort.d.ts +40 -0
- package/dist/components/DndSort/DndSortCard.d.ts +63 -0
- package/dist/components/DndSort/DndSortZone.d.ts +130 -0
- package/dist/components/DndSort/index.d.ts +12 -2
- package/dist/components/DndSort/internal/DndSortContext.d.ts +21 -0
- package/dist/components/DndSort/internal/DndSortItem.d.ts +30 -0
- package/dist/components/DndSort/internal/DndSortOverlay.d.ts +5 -0
- package/dist/components/DndSort/internal/DndSortZoneContext.d.ts +24 -0
- package/dist/components/DndSort/internal/announcements.d.ts +8 -0
- package/dist/components/DndSort/internal/collisionDetection.d.ts +3 -0
- package/dist/components/DndSort/internal/getNextCoordinates.d.ts +17 -0
- package/dist/components/DndSort/internal/test-utils.d.ts +24 -0
- package/dist/components/DndSort/internal/utils.d.ts +55 -0
- package/dist/components/DndSort/types.d.ts +55 -0
- package/dist/components/Drawer/Drawer.d.ts +63 -118
- package/dist/components/Drawer/DrawerCancelButton.d.ts +25 -0
- package/dist/components/Drawer/DrawerContent.d.ts +26 -0
- package/dist/components/Drawer/DrawerFooter.d.ts +37 -0
- package/dist/components/Drawer/DrawerHeader.d.ts +23 -0
- package/dist/components/Drawer/index.d.ts +6 -2
- package/dist/components/Drawer/internal/DrawerContext.d.ts +15 -0
- package/dist/components/Drawer/internal/useDrawerContext.d.ts +7 -0
- package/dist/components/EditCard/EditCard.d.ts +71 -14
- package/dist/components/FieldLabel/FieldLabel.d.ts +62 -4
- package/dist/components/FieldLabel/internal/FieldLabelMoreInfoIcon.d.ts +12 -0
- package/dist/components/FieldMessage/FieldMessage.d.ts +48 -12
- package/dist/components/Flex/Flex.d.ts +46 -61
- package/dist/components/Flex/internal/FlexSpecificProps.d.ts +34 -0
- package/dist/components/Grid/Grid.d.ts +55 -27
- package/dist/components/Grid/index.d.ts +1 -0
- package/dist/components/Grid/internal/GridItem.d.ts +27 -0
- package/dist/components/Grid/internal/GridSpecificProps.d.ts +28 -0
- package/dist/components/Icon/Icon.d.ts +42 -15
- package/dist/components/InputMask/InputMask.d.ts +109 -48
- package/dist/components/InputMask/internal/constants.d.ts +1 -0
- package/dist/components/InputMask/internal/utils.d.ts +41 -0
- package/dist/components/Link/Link.d.ts +5 -17
- package/dist/components/Link/index.d.ts +1 -0
- package/dist/components/Link/internal/Link.d.ts +57 -0
- package/dist/components/Link/internal/LinkHeadless.d.ts +24 -0
- package/dist/components/Link/useLinkStyles.d.ts +17 -0
- package/dist/components/LinkButton/LinkButton.d.ts +5 -31
- package/dist/components/ListView/ListView.d.ts +17 -46
- package/dist/components/ListView/ListViewOption.d.ts +38 -0
- package/dist/components/ListView/ListViewOptionCell.d.ts +12 -0
- package/dist/components/ListView/index.d.ts +3 -1
- package/dist/components/ListView/internal/ListViewContext.d.ts +28 -0
- package/dist/components/ListView/internal/types.d.ts +52 -0
- package/dist/components/ListView/internal/utils.d.ts +4 -0
- package/dist/components/Listbox/Listbox.d.ts +97 -61
- package/dist/components/Listbox/ListboxOption.d.ts +53 -0
- package/dist/components/Listbox/ListboxOptionGroup.d.ts +32 -0
- package/dist/components/Listbox/index.d.ts +3 -1
- package/dist/components/Listbox/internal/ListboxContext.d.ts +38 -0
- package/dist/components/Listbox/internal/ListboxOptionGroupContext.d.ts +5 -0
- package/dist/components/Listbox/internal/utils.d.ts +4 -0
- package/dist/components/Menu/Menu.d.ts +20 -46
- package/dist/components/Menu/MenuItem.d.ts +57 -0
- package/dist/components/Menu/index.d.ts +2 -0
- package/dist/components/Menu/internal/MenuContext.d.ts +15 -0
- package/dist/components/Menu/internal/MenuLegacy/MenuLegacy.d.ts +50 -0
- package/dist/components/Menu/internal/MenuLegacy/MenuLegacyContext.d.ts +9 -0
- package/dist/components/Menu/internal/MenuLegacy/MenuLegacyItem.d.ts +12 -0
- package/dist/components/Menu/internal/MenuLegacy/index.d.ts +3 -0
- package/dist/components/Menu/internal/MenuNested.d.ts +42 -0
- package/dist/components/Menu/types.d.ts +72 -0
- package/dist/components/NumberField/NumberField.d.ts +48 -7
- package/dist/components/Overflow/Overflow.d.ts +51 -84
- package/dist/components/Overflow/OverflowText.d.ts +82 -0
- package/dist/components/Overflow/index.d.ts +31 -2
- package/dist/components/Page/Page.d.ts +7 -7
- package/dist/components/Page/PageFooter.d.ts +1 -1
- package/dist/components/Page/PageHeader.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +4 -6
- package/dist/components/Pagination/internal/Pagination.d.ts +55 -0
- package/dist/components/Pagination/internal/PaginationItem.d.ts +52 -0
- package/dist/components/Pagination/internal/PaginationItemsPerPageMenu.d.ts +37 -0
- package/dist/components/Pagination/internal/PaginationList.d.ts +9 -0
- package/dist/components/Pagination/internal/PaginationOverflowMenu.d.ts +61 -0
- package/dist/components/Pagination/internal/PaginationTotalCount.d.ts +6 -0
- package/dist/components/Popover/Popover.d.ts +146 -134
- package/dist/components/Popover/PopoverButton.d.ts +34 -0
- package/dist/components/Popover/PopoverClose.d.ts +33 -0
- package/dist/components/Popover/PopoverContent.d.ts +46 -0
- package/dist/components/Popover/PopoverTrigger.d.ts +63 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/components/Popover/internal/PopoverContext.d.ts +40 -0
- package/dist/components/Popover/internal/PopoverLegacy/PopoverLegacy.d.ts +8 -0
- package/dist/components/Popover/internal/PopoverLegacy/PopoverLegacyButton.d.ts +3 -0
- package/dist/components/Popover/internal/PopoverLegacy/PopoverLegacyClose.d.ts +3 -0
- package/dist/components/Popover/internal/PopoverLegacy/PopoverLegacyContent.d.ts +3 -0
- package/dist/components/Popover/internal/PopoverLegacy/PopoverLegacyTrigger.d.ts +9 -0
- package/dist/components/Popover/internal/PopoverLegacy/index.d.ts +8 -0
- package/dist/components/Popover/internal/PopoverLegacy/usePopoverLegacy.d.ts +121 -0
- package/dist/components/Popover/internal/PopoverLegacy/usePopoverLegacyContext.d.ts +79 -0
- package/dist/components/Popover/internal/compareElements.d.ts +1 -0
- package/dist/components/Popover/internal/usePopoverContext.d.ts +50 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +59 -14
- package/dist/components/Radio/Radio.d.ts +3 -44
- package/dist/components/Radio/RadioGroup.d.ts +61 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/internal/Radio.d.ts +145 -0
- package/dist/components/Radio/types.d.ts +13 -0
- package/dist/components/SearchField/SearchField.d.ts +33 -8
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +54 -49
- package/dist/components/SegmentedControl/SegmentedControlSegment.d.ts +69 -0
- package/dist/components/SegmentedControl/index.d.ts +1 -0
- package/dist/components/SegmentedControl/internal/SegmentedControlContext.d.ts +24 -0
- package/dist/components/SelectCard/SelectCard.d.ts +45 -16
- package/dist/components/SelectCard/SelectCardGroup.d.ts +24 -13
- package/dist/components/SelectCard/index.d.ts +1 -2
- package/dist/components/SelectCard/internal/SelectCardProvider.d.ts +83 -0
- package/dist/components/SelectTrigger/SelectTrigger.d.ts +22 -8
- package/dist/components/SelectTrigger/internal/SelectTriggerBase.d.ts +40 -0
- package/dist/components/SideNav/SideNav.d.ts +32 -114
- package/dist/components/SideNav/SideNavCollapsible.d.ts +73 -0
- package/dist/components/SideNav/SideNavGroup.d.ts +37 -0
- package/dist/components/SideNav/SideNavLink.d.ts +46 -0
- package/dist/components/SideNav/index.d.ts +4 -1
- package/dist/components/SideNav/internal/SideNavLink.d.ts +74 -0
- package/dist/components/SideNav/internal/utils.d.ts +16 -0
- package/dist/components/Skeleton/SkeletonCircle.d.ts +41 -0
- package/dist/components/Skeleton/SkeletonPill.d.ts +41 -0
- package/dist/components/Skeleton/SkeletonRectangle.d.ts +42 -0
- package/dist/components/Skeleton/SkeletonText.d.ts +52 -0
- package/dist/components/Skeleton/index.d.ts +16 -2
- package/dist/components/Spinner/Spinner.d.ts +11 -6
- package/dist/components/SrOnly/SrOnly.d.ts +3 -7
- package/dist/components/Stepper/Stepper.d.ts +119 -239
- package/dist/components/Stepper/StepperFinalPanel.d.ts +30 -0
- package/dist/components/Stepper/StepperList.d.ts +28 -0
- package/dist/components/Stepper/StepperNextButton.d.ts +73 -0
- package/dist/components/Stepper/StepperPanel.d.ts +52 -0
- package/dist/components/Stepper/StepperPrevButton.d.ts +44 -0
- package/dist/components/Stepper/StepperStep.d.ts +58 -0
- package/dist/components/Stepper/index.d.ts +6 -0
- package/dist/components/Stepper/internal/StepperContext.d.ts +15 -0
- package/dist/components/Switch/Switch.d.ts +47 -11
- package/dist/components/Tab/Tab.d.ts +22 -88
- package/dist/components/Tab/TabButton.d.ts +54 -0
- package/dist/components/Tab/TabList.d.ts +26 -0
- package/dist/components/Tab/TabPanel.d.ts +34 -0
- package/dist/components/Tab/index.d.ts +3 -0
- package/dist/components/Tab/internal/TabContext.d.ts +15 -0
- package/dist/components/Text/Text.d.ts +7 -17
- package/dist/components/Text/types.d.ts +93 -0
- package/dist/components/TextField/TextField.d.ts +4 -5
- package/dist/components/TextField/internal/TextField.d.ts +20 -0
- package/dist/components/Textarea/Textarea.d.ts +52 -19
- package/dist/components/Textarea/index.d.ts +1 -2
- package/dist/components/Textarea/types.d.ts +35 -0
- package/dist/components/TimeField/TimeField.d.ts +55 -18
- package/dist/components/TimeField/index.d.ts +2 -0
- package/dist/components/TimeField/internal/MaskedTimeInput.d.ts +87 -0
- package/dist/components/TimeField/internal/constants.d.ts +25 -0
- package/dist/components/TimeField/internal/maskito/timePlaceholderMask.d.ts +28 -0
- package/dist/components/TimeField/internal/types.d.ts +27 -0
- package/dist/components/TimeField/internal/utils/timeFormatting.d.ts +10 -0
- package/dist/components/TimeField/internal/utils/timeOptions.d.ts +24 -0
- package/dist/components/TimeField/internal/utils/timeParsing.d.ts +43 -0
- package/dist/components/TimeField/internal/utils/timeRounding.d.ts +58 -0
- package/dist/components/TimeField/internal/utils/timeValidation.d.ts +28 -0
- package/dist/components/Toast/Toaster.d.ts +4 -4
- package/dist/components/Toast/internal/Toast.d.ts +106 -0
- package/dist/components/Toast/internal/ToastProvider.d.ts +90 -0
- package/dist/components/Toast/internal/ToastStack.d.ts +81 -0
- package/dist/components/Toast/internal/Toaster.d.ts +108 -0
- package/dist/components/Toast/internal/ToasterPopover.d.ts +19 -0
- package/dist/components/Toast/internal/addOrUpdateToastHeight.d.ts +8 -0
- package/dist/components/Toast/internal/constants.d.ts +4 -0
- package/dist/components/Toast/internal/types.d.ts +18 -0
- package/dist/components/Toast/internal/useCloseToast.d.ts +7 -0
- package/dist/components/Toast/internal/useHotkeyFocus.d.ts +25 -0
- package/dist/components/Toast/internal/useShowMoreButtonPositionStyles.d.ts +6 -0
- package/dist/components/Toast/internal/useToastPositionStyles.d.ts +7 -0
- package/dist/components/Toast/internal/useToasts.d.ts +6 -0
- package/dist/components/Toast/toast.d.ts +113 -38
- package/dist/components/Toolbar/Toolbar.d.ts +99 -141
- package/dist/components/Toolbar/ToolbarButton.d.ts +41 -0
- package/dist/components/Toolbar/ToolbarButtonLink.d.ts +43 -0
- package/dist/components/Toolbar/ToolbarButtonToggle.d.ts +37 -0
- package/dist/components/Toolbar/ToolbarSelect.d.ts +108 -0
- package/dist/components/Toolbar/index.d.ts +6 -1
- package/dist/components/Toolbar/internal/ToolbarItemOverflowContext.d.ts +19 -0
- package/dist/components/Toolbar/internal/ToolbarItemWrapper.d.ts +33 -0
- package/dist/components/Toolbar/internal/ToolbarOverflowContext.d.ts +35 -0
- package/dist/components/Toolbar/internal/ToolbarOverflowMenu.d.ts +29 -0
- package/dist/components/Toolbar/internal/utils/accessibility.d.ts +21 -0
- package/dist/components/Toolbar/internal/utils/test.d.ts +29 -0
- package/dist/components/Toolbar/types.d.ts +48 -0
- package/dist/components/Tooltip/Tooltip.d.ts +73 -71
- package/dist/components/Tooltip/TooltipContent.d.ts +26 -0
- package/dist/components/Tooltip/TooltipTrigger.d.ts +30 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/internal/TooltipContext.d.ts +92 -0
- package/dist/components/Tooltip/internal/TooltipLegacy/TooltipLegacy.d.ts +6 -0
- package/dist/components/Tooltip/internal/TooltipLegacy/TooltipLegacyContent.d.ts +3 -0
- package/dist/components/Tooltip/internal/TooltipLegacy/TooltipLegacyTrigger.d.ts +5 -0
- package/dist/components/Tooltip/internal/TooltipLegacy/index.d.ts +6 -0
- package/dist/components/Tooltip/internal/TooltipLegacy/useTooltipLegacy.d.ts +70 -0
- package/dist/components/Tooltip/internal/TooltipLegacy/useTooltipLegacyContext.d.ts +58 -0
- package/dist/components/Tooltip/internal/isNonInteractiveTrigger.d.ts +1 -0
- package/dist/components/Tooltip/internal/useTooltipContext.d.ts +47 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/extends-Bg2s_OKl.js.map +1 -1
- package/dist/getActiveElement-BcSyVE7S.js +25 -0
- package/dist/getActiveElement-BcSyVE7S.js.map +1 -0
- package/dist/getKeyboardFocusableElements-QqcABz0D.js.map +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useAccessibleColor/index.d.ts +1 -1
- package/dist/hooks/useAccessibleColor/useAccessibleColor.d.ts +38 -0
- package/dist/hooks/useBreakpoint/index.d.ts +1 -1
- package/dist/hooks/useBreakpoint/useBreakpoint.d.ts +49 -0
- package/dist/hooks/useMergeRefs/index.d.ts +1 -1
- package/dist/hooks/useMergeRefs/useMergeRefs.d.ts +17 -0
- package/dist/hooks/usePrefersColorScheme/index.d.ts +1 -1
- package/dist/hooks/usePrefersColorScheme/usePrefersColorScheme.d.ts +16 -0
- package/dist/hooks/useSwipe/index.d.ts +1 -1
- package/dist/hooks/useSwipe/useSwipe.d.ts +32 -0
- package/dist/{Checkbox.module-DZ58p15b-BUsQC1lW.js → indeterminate_check_box-Bg24oeHy.js} +8 -8
- package/dist/indeterminate_check_box-Bg24oeHy.js.map +1 -0
- package/dist/{Checkbox.css → indeterminate_check_box.css} +0 -1
- package/dist/{index-CKfiQx8n-4nziUo7G.js → index-CqdP5W00.js} +5 -5
- package/dist/index-CqdP5W00.js.map +1 -0
- package/dist/{ProgressBar-BRvB-bD4.css → index.css} +0 -641
- package/dist/index.d.ts +1 -0
- package/dist/{index.esm-dyoPQhi6.js → index.esm-D889iexm.js} +115 -115
- package/dist/index.esm-D889iexm.js.map +1 -0
- package/dist/index.js +508 -72
- package/dist/index.js.map +1 -1
- package/dist/{index-CKfiQx8n.css → index2.css} +0 -1
- package/dist/info-CYpG6tcI.js +6 -0
- package/dist/info-CYpG6tcI.js.map +1 -0
- package/dist/internal/components/Helper/Helper.d.ts +18 -0
- package/dist/internal/components/Helper/index.d.ts +1 -0
- package/dist/internal/components/Label/Label.d.ts +77 -0
- package/dist/internal/components/Label/index.d.ts +2 -0
- package/dist/internal/components/index.d.ts +2 -0
- package/dist/internal/functions/childrenToString.d.ts +25 -0
- package/dist/internal/functions/getActiveElement.d.ts +1 -0
- package/dist/internal/functions/getInitial.d.ts +16 -0
- package/dist/internal/functions/getKeyboardFocusableElements.d.ts +25 -0
- package/dist/internal/functions/index.d.ts +9 -0
- package/dist/internal/functions/kebabize.d.ts +16 -0
- package/dist/internal/functions/mapOrder.d.ts +1 -0
- package/dist/internal/functions/safePopover.d.ts +2 -0
- package/dist/internal/functions/sizeToToken.d.ts +2 -0
- package/dist/internal/functions/supportsPopover.d.ts +1 -0
- package/dist/internal/hooks/index.d.ts +17 -0
- package/dist/internal/hooks/useDialogScrollLock/index.d.ts +1 -0
- package/dist/internal/hooks/useDialogScrollLock/useDialogScrollLock.d.ts +40 -0
- package/dist/internal/hooks/useDialogTransitionStates/index.d.ts +1 -0
- package/dist/internal/hooks/useDialogTransitionStates/useDialogTransitionStates.d.ts +32 -0
- package/dist/internal/hooks/useFocusWithin/index.d.ts +1 -0
- package/dist/internal/hooks/useFocusWithin/useFocusWithin.d.ts +33 -0
- package/dist/internal/hooks/useIntersectionObserver/index.d.ts +1 -0
- package/dist/internal/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +67 -0
- package/dist/internal/hooks/useIsScrollable/index.d.ts +1 -0
- package/dist/internal/hooks/useIsScrollable/useIsScrollable.d.ts +6 -0
- package/dist/internal/hooks/useKeyboardFocusables/index.d.ts +1 -0
- package/dist/internal/hooks/useKeyboardFocusables/useKeyboardFocusables.d.ts +54 -0
- package/dist/internal/hooks/useLayoutPropsUtil/index.d.ts +1 -0
- package/dist/internal/hooks/useLayoutPropsUtil/useLayoutPropsUtil.d.ts +56 -0
- package/dist/internal/hooks/useNumberField/index.d.ts +1 -0
- package/dist/internal/hooks/useNumberField/internal/useNumberFieldInputMode.d.ts +24 -0
- package/dist/internal/hooks/useNumberField/internal/useNumberFieldKeys.d.ts +43 -0
- package/dist/internal/hooks/useNumberField/useNumberField.d.ts +118 -0
- package/dist/internal/hooks/useOnClickOutside/index.d.ts +1 -0
- package/dist/internal/hooks/useOnClickOutside/useOnClickOutside.d.ts +34 -0
- package/dist/internal/hooks/useOpenCloseTransitionStates/index.d.ts +1 -0
- package/dist/internal/hooks/useOpenCloseTransitionStates/useOpenCloseTransitionStates.d.ts +51 -0
- package/dist/internal/hooks/useOptionallyControlledState/index.d.ts +1 -0
- package/dist/internal/hooks/useOptionallyControlledState/useOptionallyControlledState.d.ts +59 -0
- package/dist/internal/hooks/usePlatform/index.d.ts +1 -0
- package/dist/internal/hooks/usePlatform/usePlatform.d.ts +65 -0
- package/dist/internal/hooks/usePopoverCloseDelayWorkaround/index.d.ts +1 -0
- package/dist/internal/hooks/usePopoverCloseDelayWorkaround/usePopoverCloseDelayWorkaround.d.ts +1 -0
- package/dist/internal/hooks/usePopoverSupport/index.d.ts +1 -0
- package/dist/internal/hooks/usePopoverSupport/usePopoverSupport.d.ts +1 -0
- package/dist/internal/hooks/usePopoverTransitionStates/index.d.ts +1 -0
- package/dist/internal/hooks/usePopoverTransitionStates/usePopoverTransitionStates.d.ts +25 -0
- package/dist/internal/hooks/usePrevious/index.d.ts +1 -0
- package/dist/internal/hooks/usePrevious/usePrevious.d.ts +1 -0
- package/dist/internal/hooks/useTypeAhead/index.d.ts +1 -0
- package/dist/internal/hooks/useTypeAhead/useTypeAhead.d.ts +15 -0
- package/dist/internal/types/index.d.ts +1 -0
- package/dist/internal/types/props.d.ts +7 -0
- package/dist/internal/utils/index.d.ts +1 -0
- package/dist/makeZeroShortcutPreprocessor-CxsiGTRW.js +47 -0
- package/dist/makeZeroShortcutPreprocessor-CxsiGTRW.js.map +1 -0
- package/dist/providers/AnvilProvider/AnvilProvider.d.ts +29 -6
- package/dist/providers/LocalizationProvider/LocalizationContext.d.ts +6 -0
- package/dist/providers/LocalizationProvider/LocalizationProvider.d.ts +17 -0
- package/dist/providers/LocalizationProvider/LocalizationStoryWrapper.d.ts +6 -0
- package/dist/providers/LocalizationProvider/index.d.ts +2 -1
- package/dist/providers/LocalizationProvider/useTranslations.d.ts +4 -0
- package/dist/providers/PortalProvider/PortalProvider.d.ts +10 -0
- package/dist/providers/PortalProvider/index.d.ts +1 -1
- package/dist/providers/ThemeProvider/ThemeProvider.d.ts +14 -4
- package/dist/providers/ThemeProvider/index.d.ts +7 -1
- package/dist/providers/ThemeProvider/internal/ThemeProviderContext.d.ts +6 -0
- package/dist/providers/ThemeProvider/useTheme.d.ts +1 -0
- package/dist/types/MaxLengthCounterProps.d.ts +8 -0
- package/dist/types/ianaZones.d.ts +2 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/locales.d.ts +3 -0
- package/dist/types/props.d.ts +66 -0
- package/dist/{useAccessibleColor-Dc6B_M-Z-BYKjkGRg.js → useAccessibleColor-BYKjkGRg.js} +1 -1
- package/dist/useAccessibleColor-BYKjkGRg.js.map +1 -0
- package/dist/useAccessibleColor.js +1 -1
- package/dist/{useBreakpoint-7QkBkSeP-Cv5fnZxs.js → useBreakpoint-Cv5fnZxs.js} +1 -1
- package/dist/useBreakpoint-Cv5fnZxs.js.map +1 -0
- package/dist/useBreakpoint.js +1 -1
- package/dist/useDateFieldOrchestration-Cqa7dxtr.js +138 -0
- package/dist/useDateFieldOrchestration-Cqa7dxtr.js.map +1 -0
- package/dist/useDialogTransitionStates-2NaE_noq.js +64 -0
- package/dist/useDialogTransitionStates-2NaE_noq.js.map +1 -0
- package/dist/{useFocusWithin-Cxz14Zyz-DEudRcSI.js → useFocusWithin-BhU7hoAD.js} +2 -10
- package/dist/useFocusWithin-BhU7hoAD.js.map +1 -0
- package/dist/{Combobox-BOpe_NUu.js → useInfiniteCombobox-BN2uGhBh.js} +1791 -1847
- package/dist/useInfiniteCombobox-BN2uGhBh.js.map +1 -0
- package/dist/{Combobox.css → useInfiniteCombobox.css} +102 -45
- package/dist/{useLayoutPropsUtil-DWACCL8v-CZNrcQT-.js → useLayoutPropsUtil-DjD5IMh0.js} +2 -2
- package/dist/useLayoutPropsUtil-DjD5IMh0.js.map +1 -0
- package/dist/{useMergeRefs-Bde85AWI-Bde85AWI.js → useMergeRefs-Bde85AWI.js} +1 -1
- package/dist/useMergeRefs-Bde85AWI.js.map +1 -0
- package/dist/useMergeRefs.js +1 -1
- package/dist/useOnClickOutside-BHEWMLa9.js +170 -0
- package/dist/useOnClickOutside-BHEWMLa9.js.map +1 -0
- package/dist/{useOptionallyControlledState-DbDuos5L-DbDuos5L.js → useOptionallyControlledState-DbDuos5L.js} +1 -1
- package/dist/useOptionallyControlledState-DbDuos5L.js.map +1 -0
- package/dist/{usePopoverCloseDelayWorkaround-BZcjPkvT-BZcjPkvT.js → usePopoverCloseDelayWorkaround-BZcjPkvT.js} +1 -1
- package/dist/usePopoverCloseDelayWorkaround-BZcjPkvT.js.map +1 -0
- package/dist/{usePopoverSupport-B9Lsqryr-CYJxXiun.js → usePopoverSupport-DIjjfodl.js} +2 -2
- package/dist/usePopoverSupport-DIjjfodl.js.map +1 -0
- package/dist/{usePrefersColorScheme-_hT7dK7_-_hT7dK7_.js → usePrefersColorScheme-_hT7dK7_.js} +1 -1
- package/dist/usePrefersColorScheme-_hT7dK7_.js.map +1 -0
- package/dist/usePrefersColorScheme.js +1 -1
- package/dist/usePrevious-Bvq-5auG.js +12 -0
- package/dist/usePrevious-Bvq-5auG.js.map +1 -0
- package/dist/{useSwipe-CULmVQEk-CULmVQEk.js → useSwipe-CULmVQEk.js} +1 -1
- package/dist/useSwipe-CULmVQEk.js.map +1 -0
- package/dist/useSwipe.js +1 -1
- package/dist/useTheme-B4i6a3bM.js +9 -0
- package/dist/useTheme-B4i6a3bM.js.map +1 -0
- package/package.json +29 -4
- package/dist/Alert-C3WoRkeN-D_6Yf63F.js +0 -98
- package/dist/Alert-C3WoRkeN-D_6Yf63F.js.map +0 -1
- package/dist/Alert-DipY5OlC.js +0 -23
- package/dist/Alert-DipY5OlC.js.map +0 -1
- package/dist/Announcement-ButSjdLn.js.map +0 -1
- package/dist/AnvilProvider-BLYCqIbb.js +0 -16
- package/dist/AnvilProvider-BLYCqIbb.js.map +0 -1
- package/dist/Avatar-C7cbRTCt-DCvzmr2C.js.map +0 -1
- package/dist/Avatar-DREZJN2K.js.map +0 -1
- package/dist/Badge-7aZfE-LH.js.map +0 -1
- package/dist/Breadcrumbs-BMbkH9hL-BUjQksuj.js.map +0 -1
- package/dist/Breadcrumbs-fthw3qaL.js +0 -36
- package/dist/Breadcrumbs-fthw3qaL.js.map +0 -1
- package/dist/Button-BaHFf1AT-BQy-PFB5.js.map +0 -1
- package/dist/Button-DMQKV2sV.js +0 -27
- package/dist/Button-DMQKV2sV.js.map +0 -1
- package/dist/Button.module-BqTaW8HK-BqTaW8HK.js +0 -25
- package/dist/Button.module-BqTaW8HK-BqTaW8HK.js.map +0 -1
- package/dist/ButtonCompound-Cs2A5X-Z-Dl3InVab.js +0 -49
- package/dist/ButtonCompound-Cs2A5X-Z-Dl3InVab.js.map +0 -1
- package/dist/ButtonCompound-DGuF0zzT.js +0 -25
- package/dist/ButtonCompound-DGuF0zzT.js.map +0 -1
- package/dist/ButtonLink-5qlX0uZx-b9H7MGhk.js.map +0 -1
- package/dist/ButtonLink-B0NJuVk5.js +0 -28
- package/dist/ButtonLink-B0NJuVk5.js.map +0 -1
- package/dist/ButtonToggle-Bm4KRl3o-B1-LbfjY.js.map +0 -1
- package/dist/ButtonToggle-CKVyEODc.js +0 -27
- package/dist/ButtonToggle-CKVyEODc.js.map +0 -1
- package/dist/Calendar-BvftKznl-D4_xp9Rv.js.map +0 -1
- package/dist/Calendar-DdOR9T_K.js +0 -130
- package/dist/Calendar-DdOR9T_K.js.map +0 -1
- package/dist/Card-U2IJPk8B.js +0 -11
- package/dist/Card-U2IJPk8B.js.map +0 -1
- package/dist/Card-ZknG-yim-7W6rYSFV.js.map +0 -1
- package/dist/Checkbox-DyHm7Ntt-DYw5QL3l.js.map +0 -1
- package/dist/Checkbox-zg8LVvB6.js.map +0 -1
- package/dist/Checkbox.module-DZ58p15b-BUsQC1lW.js.map +0 -1
- package/dist/Chip-DXQiqF8k.js +0 -34
- package/dist/Chip-DXQiqF8k.js.map +0 -1
- package/dist/Chip-MbBEXeAm-DmAcwPRJ.js.map +0 -1
- package/dist/Combobox-BOpe_NUu.js.map +0 -1
- package/dist/DateField-Bqsnpt8S.js.map +0 -1
- package/dist/DateFieldRange-Cax7Kl9A.js +0 -22
- package/dist/DateFieldRange-Cax7Kl9A.js.map +0 -1
- package/dist/DateFieldSingle-bMX770gU.js +0 -22
- package/dist/DateFieldSingle-bMX770gU.js.map +0 -1
- package/dist/DateFieldYearless-ClNYTBK_.js +0 -22
- package/dist/DateFieldYearless-ClNYTBK_.js.map +0 -1
- package/dist/DateFieldYearless-pejtv7-x-DBHpW83U.js +0 -1373
- package/dist/DateFieldYearless-pejtv7-x-DBHpW83U.js.map +0 -1
- package/dist/DaysOfTheWeek-ImBPjEvl.js.map +0 -1
- package/dist/Details-DVg0EOkv.js.map +0 -1
- package/dist/Dialog-BR6f-XRH.js.map +0 -1
- package/dist/Divider-B0xGfyWE-f5-ThMiS.js.map +0 -1
- package/dist/Divider-azRKjITG.js +0 -13
- package/dist/Divider-azRKjITG.js.map +0 -1
- package/dist/DndSort-Cl0FCNQm.js +0 -5546
- package/dist/DndSort-Cl0FCNQm.js.map +0 -1
- package/dist/Drawer-0ayAWgAA.js +0 -142
- package/dist/Drawer-0ayAWgAA.js.map +0 -1
- package/dist/EditCard-B_n1uFkv.js.map +0 -1
- package/dist/FieldLabel-DWl5qsRY.js +0 -13
- package/dist/FieldLabel-DWl5qsRY.js.map +0 -1
- package/dist/FieldMessage-Bobp105T-DYhStLY4.js.map +0 -1
- package/dist/FieldMessage-DkJ0K5s-.js +0 -13
- package/dist/FieldMessage-DkJ0K5s-.js.map +0 -1
- package/dist/Flex-CiK7uNUu-BfxHG4L0.js.map +0 -1
- package/dist/Flex-Ln6PmaDl.js +0 -11
- package/dist/Flex-Ln6PmaDl.js.map +0 -1
- package/dist/Grid-CMcDeSYT.js +0 -33
- package/dist/Grid-CMcDeSYT.js.map +0 -1
- package/dist/Grid-DFAd8mTe.js.map +0 -1
- package/dist/HammerProvider-vt3DkcCZ-06BeBrPu.js.map +0 -1
- package/dist/Helper-h7k80qls-DHPFHTvI.js.map +0 -1
- package/dist/Icon-B6HmlQiR-BxQkO3X5.js.map +0 -1
- package/dist/Icon-BgKqBmlj.js +0 -13
- package/dist/Icon-BgKqBmlj.js.map +0 -1
- package/dist/InputMask-BOUlnmiF.js +0 -30
- package/dist/InputMask-BOUlnmiF.js.map +0 -1
- package/dist/InputMask-BuO8lNAB-DdxdO5Jw.js.map +0 -1
- package/dist/Link-C4N_cV3i.js +0 -45
- package/dist/Link-C4N_cV3i.js.map +0 -1
- package/dist/Link-MiffPrW9-Cx1zYWSF.js +0 -67
- package/dist/Link-MiffPrW9-Cx1zYWSF.js.map +0 -1
- package/dist/ListView-DVPhWDCM.js.map +0 -1
- package/dist/ListView.module-MVsNF0X0-MVsNF0X0.js.map +0 -1
- package/dist/Listbox-B-WUuj-_-BWWeWtLW.js.map +0 -1
- package/dist/Listbox-Di6OS1Fk.js +0 -67
- package/dist/Listbox-Di6OS1Fk.js.map +0 -1
- package/dist/Listbox.module-DcBE8Zmo-DcBE8Zmo.js.map +0 -1
- package/dist/LocalizationContext-UsmB5mnR-BUIYgNp2.js.map +0 -1
- package/dist/LocalizationProvider-VtRAfGBT-Bo8XuFoE.js.map +0 -1
- package/dist/Menu-DHCOMJx2.js +0 -60
- package/dist/Menu-DHCOMJx2.js.map +0 -1
- package/dist/Menu-TtVJnSrA-yBYichuJ.js.map +0 -1
- package/dist/NumberField-C9lMsPMD.js.map +0 -1
- package/dist/Overflow-CFClqFVC-BKqOBCan.js +0 -393
- package/dist/Overflow-CFClqFVC-BKqOBCan.js.map +0 -1
- package/dist/Overflow-w-3_04fS.js +0 -69
- package/dist/Overflow-w-3_04fS.js.map +0 -1
- package/dist/Page-CGAylFKz.js.map +0 -1
- package/dist/Pagination-DU_qvFRR.js.map +0 -1
- package/dist/Popover-BPiqdyu1.js +0 -135
- package/dist/Popover-BPiqdyu1.js.map +0 -1
- package/dist/Popover-CU2cGVD8-Casl3vM1.js.map +0 -1
- package/dist/PortalProvider-9lXkQ0xY-BKoGegS1.js.map +0 -1
- package/dist/ProgressBar-BRvB-bD4-DppwBrFg.js +0 -2616
- package/dist/ProgressBar-BRvB-bD4-DppwBrFg.js.map +0 -1
- package/dist/ProgressBar-lPKNTz6i.js +0 -13
- package/dist/ProgressBar-lPKNTz6i.js.map +0 -1
- package/dist/Radio-DQ_VQFGZ-SdFBlDnE.js.map +0 -1
- package/dist/Radio-DnOuBPi_.js.map +0 -1
- package/dist/SearchField-BGPqpnVd.js.map +0 -1
- package/dist/SegmentedControl-DY1PSYmd.js.map +0 -1
- package/dist/SelectCard-LSAl_7Lh-BYtfe9PC.js.map +0 -1
- package/dist/SelectCardGroup-u_QKdeRZ.js +0 -49
- package/dist/SelectCardGroup-u_QKdeRZ.js.map +0 -1
- package/dist/SelectTrigger-C2w-flvK.js.map +0 -1
- package/dist/SelectTrigger.css +0 -16
- package/dist/SelectTriggerBase-Dj154EN4-BtTvR-Nh.js.map +0 -1
- package/dist/SideNav-Bh_pVeEw.js.map +0 -1
- package/dist/Skeleton-COxTdwjO.js +0 -398
- package/dist/Skeleton-COxTdwjO.js.map +0 -1
- package/dist/Spinner-C1r3COiQ.js +0 -13
- package/dist/Spinner-C1r3COiQ.js.map +0 -1
- package/dist/Spinner-DliJVzdW-BQlZEj4V.js.map +0 -1
- package/dist/SrOnly-BsKDHetF-B93X65F1.js.map +0 -1
- package/dist/SrOnly-C_I8eH4C.js +0 -9
- package/dist/SrOnly-C_I8eH4C.js.map +0 -1
- package/dist/Stepper-BtbDBIzz.js.map +0 -1
- package/dist/Switch-DAQFzi-X.js.map +0 -1
- package/dist/Tab-BSC7e4rM.js.map +0 -1
- package/dist/Text-35Ve4Uq0.js +0 -13
- package/dist/Text-35Ve4Uq0.js.map +0 -1
- package/dist/Text-CED_yrId-DsRYZw2-.js.map +0 -1
- package/dist/TextField-B364hxo8.js +0 -29
- package/dist/TextField-B364hxo8.js.map +0 -1
- package/dist/TextField-DoPP1CQ--UWAOTYiv.js.map +0 -1
- package/dist/TextField.module-EkKlj66e-EkKlj66e.js.map +0 -1
- package/dist/Textarea-D2AAZ1L3.js.map +0 -1
- package/dist/ThemeProvider-DwJqkbiU.js +0 -7
- package/dist/ThemeProvider-DwJqkbiU.js.map +0 -1
- package/dist/ThemeProvider-Q3ji6Rpx-DBXlAuQ8.js.map +0 -1
- package/dist/TimeField-tA9uo4lK.js.map +0 -1
- package/dist/Toolbar-CSWhVSUM.js.map +0 -1
- package/dist/Tooltip-C2HQDvYj.js +0 -73
- package/dist/Tooltip-C2HQDvYj.js.map +0 -1
- package/dist/check_circle-BGfigqq-.js.map +0 -1
- package/dist/childrenToString-Bz9MqbHb-Bz9MqbHb.js.map +0 -1
- package/dist/components/Skeleton/Skeleton.d.ts +0 -153
- package/dist/floating-ui.react-BFNinq1w.js.map +0 -1
- package/dist/hooks/useLinkStyles/index.d.ts +0 -1
- package/dist/index-CKfiQx8n-4nziUo7G.js.map +0 -1
- package/dist/index.esm-dyoPQhi6.js.map +0 -1
- package/dist/toast-BhV_Ask2.js.map +0 -1
- package/dist/useAccessibleColor-Dc6B_M-Z-BYKjkGRg.js.map +0 -1
- package/dist/useBreakpoint-7QkBkSeP-Cv5fnZxs.js.map +0 -1
- package/dist/useFocusWithin-Cxz14Zyz-DEudRcSI.js.map +0 -1
- package/dist/useLayoutPropsUtil-DWACCL8v-CZNrcQT-.js.map +0 -1
- package/dist/useLinkStyles.d.ts +0 -6
- package/dist/useLinkStyles.js +0 -2
- package/dist/useLinkStyles.js.map +0 -1
- package/dist/useMergeRefs-Bde85AWI-Bde85AWI.js.map +0 -1
- package/dist/useOptionallyControlledState-DbDuos5L-DbDuos5L.js.map +0 -1
- package/dist/usePopoverCloseDelayWorkaround-BZcjPkvT-BZcjPkvT.js.map +0 -1
- package/dist/usePopoverSupport-B9Lsqryr-CYJxXiun.js.map +0 -1
- package/dist/usePrefersColorScheme-_hT7dK7_-_hT7dK7_.js.map +0 -1
- package/dist/useSwipe-CULmVQEk-CULmVQEk.js.map +0 -1
- /package/dist/components/SideNav/{SideNavProvider.d.ts → internal/SideNavProvider.d.ts} +0 -0
|
@@ -1,2616 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useRef, useEffect, forwardRef, useId, createContext, useContext, useCallback, useMemo, cloneElement, isValidElement, Fragment as Fragment$1, useLayoutEffect } from 'react';
|
|
3
|
-
import { c as cx } from './index-tZvMCc77.js';
|
|
4
|
-
import { I as Icon } from './Icon-B6HmlQiR-BxQkO3X5.js';
|
|
5
|
-
import { a as SvgCheckCircle, S as SvgError, b as SvgInfo } from './check_circle-BGfigqq-.js';
|
|
6
|
-
import { B as tabbable, C as useDelayGroup, F as FloatingPortal, b as FloatingArrow, p as computePosition, n as autoUpdate, o as offset, f as flip, d as shift, e as arrow$1, l as limitShift, D as useDelayGroupContext, c as useFloating, h as useHover, i as safePolygon, E as useFocus, j as useDismiss, k as useRole, m as useInteractions } from './floating-ui.react-BFNinq1w.js';
|
|
7
|
-
import { a as PortalProviderContext } from './PortalProvider-9lXkQ0xY-BKoGegS1.js';
|
|
8
|
-
import { S as SvgClose } from './close-DZj38AEh.js';
|
|
9
|
-
import { T as Text } from './Text-CED_yrId-DsRYZw2-.js';
|
|
10
|
-
import { B as Button } from './Button-BaHFf1AT-BQy-PFB5.js';
|
|
11
|
-
import { A as Alert } from './Alert-C3WoRkeN-D_6Yf63F.js';
|
|
12
|
-
import { F as Flex } from './Flex-CiK7uNUu-BfxHG4L0.js';
|
|
13
|
-
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-DWACCL8v-CZNrcQT-.js';
|
|
14
|
-
import { H as Helper } from './Helper-h7k80qls-DHPFHTvI.js';
|
|
15
|
-
import { u as useSwipe } from './useSwipe-CULmVQEk-CULmVQEk.js';
|
|
16
|
-
import { S as SrOnly } from './SrOnly-BsKDHetF-B93X65F1.js';
|
|
17
|
-
import { u as useMergeRefs } from './useMergeRefs-Bde85AWI-Bde85AWI.js';
|
|
18
|
-
import { T as ThemeProvider, a as ThemeProviderContext } from './ThemeProvider-Q3ji6Rpx-DBXlAuQ8.js';
|
|
19
|
-
import { g as getKeyboardFocusableElements } from './getKeyboardFocusableElements-QqcABz0D.js';
|
|
20
|
-
import { u as useTooltipLegacyGroup } from './HammerProvider-vt3DkcCZ-06BeBrPu.js';
|
|
21
|
-
|
|
22
|
-
import './ProgressBar-BRvB-bD4.css';/**
|
|
23
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
|
24
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
25
|
-
*/
|
|
26
|
-
var byteToHex = [];
|
|
27
|
-
for (var i = 0; i < 256; ++i) {
|
|
28
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
29
|
-
}
|
|
30
|
-
function unsafeStringify(arr, offset = 0) {
|
|
31
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
|
32
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
33
|
-
//
|
|
34
|
-
// Note to future-self: No, you can't remove the `toLowerCase()` call.
|
|
35
|
-
// REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
|
|
36
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
40
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
41
|
-
// generators (like Math.random()).
|
|
42
|
-
|
|
43
|
-
var getRandomValues;
|
|
44
|
-
var rnds8 = new Uint8Array(16);
|
|
45
|
-
function rng() {
|
|
46
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
47
|
-
if (!getRandomValues) {
|
|
48
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
49
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
50
|
-
if (!getRandomValues) {
|
|
51
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return getRandomValues(rnds8);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
58
|
-
const native = {
|
|
59
|
-
randomUUID
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
function v4(options, buf, offset) {
|
|
63
|
-
if (native.randomUUID && true && !options) {
|
|
64
|
-
return native.randomUUID();
|
|
65
|
-
}
|
|
66
|
-
options = options || {};
|
|
67
|
-
var rnds = options.random || (options.rng || rng)();
|
|
68
|
-
|
|
69
|
-
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
70
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
71
|
-
rnds[8] = rnds[8] & 0x3f | 0x80;
|
|
72
|
-
return unsafeStringify(rnds);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const useKeyboardFocusables = (element, options = {
|
|
76
|
-
observeChange: true,
|
|
77
|
-
attributes: true,
|
|
78
|
-
characterData: true,
|
|
79
|
-
childList: true,
|
|
80
|
-
subtree: true
|
|
81
|
-
}) => {
|
|
82
|
-
const [focusables, setFocusables] = useState(null);
|
|
83
|
-
const observerRef = useRef();
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
const target = element instanceof HTMLElement ? element : element?.current;
|
|
86
|
-
if (!target) return;
|
|
87
|
-
if (observerRef.current) return;
|
|
88
|
-
if (!options.observeChange && !focusables) {
|
|
89
|
-
setFocusables(tabbable(target));
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
let timeoutId = null;
|
|
93
|
-
const debounceDelay = 100;
|
|
94
|
-
const mutationCallback = () => {
|
|
95
|
-
const targetArr = tabbable(target);
|
|
96
|
-
if (targetArr.length === 0) return;
|
|
97
|
-
if (timeoutId) {
|
|
98
|
-
clearTimeout(timeoutId);
|
|
99
|
-
}
|
|
100
|
-
timeoutId = setTimeout(() => {
|
|
101
|
-
setFocusables(targetArr);
|
|
102
|
-
}, debounceDelay);
|
|
103
|
-
};
|
|
104
|
-
const observer = new MutationObserver(mutationCallback);
|
|
105
|
-
observerRef.current = observer;
|
|
106
|
-
observer.observe(target, {
|
|
107
|
-
childList: true,
|
|
108
|
-
// Observe changes to child elements
|
|
109
|
-
subtree: true,
|
|
110
|
-
// Observe changes to descendants of the target
|
|
111
|
-
attributes: true,
|
|
112
|
-
// Observe changes to attributes
|
|
113
|
-
characterData: true
|
|
114
|
-
// Observe changes to text content
|
|
115
|
-
});
|
|
116
|
-
}, [element, options]);
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
return () => {
|
|
119
|
-
if (!observerRef.current) return;
|
|
120
|
-
observerRef.current.disconnect();
|
|
121
|
-
};
|
|
122
|
-
}, []);
|
|
123
|
-
const updateFocusables = () => {
|
|
124
|
-
const target = element instanceof HTMLElement ? element : element?.current;
|
|
125
|
-
if (!target) return;
|
|
126
|
-
setFocusables(tabbable(target));
|
|
127
|
-
};
|
|
128
|
-
return { focusables, updateFocusables };
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const useOnClickOutside = ({
|
|
132
|
-
onOutsidePress,
|
|
133
|
-
targets,
|
|
134
|
-
onClose
|
|
135
|
-
}) => {
|
|
136
|
-
useEffect(() => {
|
|
137
|
-
if (typeof document === "undefined") return;
|
|
138
|
-
let isClosable = false;
|
|
139
|
-
const onMouseDownHandler = (e) => {
|
|
140
|
-
let isTarget = false;
|
|
141
|
-
const path = e.composedPath();
|
|
142
|
-
for (const el of targets) {
|
|
143
|
-
if (el && path.includes(el)) {
|
|
144
|
-
isTarget = true;
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (!isTarget) {
|
|
149
|
-
onOutsidePress?.(e);
|
|
150
|
-
isClosable = true;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
const onMouseUpHandler = (e) => {
|
|
154
|
-
if (!isClosable) return;
|
|
155
|
-
let isTarget = false;
|
|
156
|
-
const path = e.composedPath();
|
|
157
|
-
for (const el of targets) {
|
|
158
|
-
if (el && path.includes(el)) {
|
|
159
|
-
isTarget = true;
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (!isTarget) {
|
|
164
|
-
onClose?.();
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
document.addEventListener("mousedown", onMouseDownHandler);
|
|
168
|
-
document.addEventListener("mouseup", onMouseUpHandler);
|
|
169
|
-
return () => {
|
|
170
|
-
document.removeEventListener("mousedown", onMouseDownHandler);
|
|
171
|
-
document.removeEventListener("mouseup", onMouseUpHandler);
|
|
172
|
-
};
|
|
173
|
-
}, [onClose, onOutsidePress, targets]);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
const getActiveElement = (activeDocument) => {
|
|
177
|
-
const activeElement = activeDocument.activeElement;
|
|
178
|
-
if (!activeElement) {
|
|
179
|
-
return activeElement;
|
|
180
|
-
}
|
|
181
|
-
if (activeElement.tagName === "IFRAME") {
|
|
182
|
-
const iframes = Array.from(document.getElementsByTagName("iframe"));
|
|
183
|
-
if (iframes.includes(activeElement)) {
|
|
184
|
-
const iframeActiveElement = activeElement;
|
|
185
|
-
const iframeActiveDocument = iframeActiveElement.contentDocument || iframeActiveElement.contentWindow?.document;
|
|
186
|
-
if (!iframeActiveDocument) return activeElement;
|
|
187
|
-
return getActiveElement(iframeActiveDocument);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (!activeElement.shadowRoot) {
|
|
191
|
-
return activeElement;
|
|
192
|
-
}
|
|
193
|
-
if (activeElement.shadowRoot) {
|
|
194
|
-
return getActiveElement(activeElement.shadowRoot);
|
|
195
|
-
}
|
|
196
|
-
return activeElement;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const label = "_label_jfzvd_2";
|
|
200
|
-
const required = "_required_jfzvd_46";
|
|
201
|
-
const styles$5 = {
|
|
202
|
-
label: label,
|
|
203
|
-
"top-container": "_top-container_jfzvd_37",
|
|
204
|
-
"label-text": "_label-text_jfzvd_42",
|
|
205
|
-
required: required,
|
|
206
|
-
"info-trigger": "_info-trigger_jfzvd_51",
|
|
207
|
-
"info-content": "_info-content_jfzvd_56"
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
const content$1 = "_content_1tuax_2";
|
|
211
|
-
const scroller = "_scroller_1tuax_29";
|
|
212
|
-
const arrow = "_arrow_1tuax_32";
|
|
213
|
-
const trigger = "_trigger_1tuax_39";
|
|
214
|
-
const styles$4 = {
|
|
215
|
-
content: content$1,
|
|
216
|
-
scroller: scroller,
|
|
217
|
-
arrow: arrow,
|
|
218
|
-
trigger: trigger
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const TooltipContext = createContext(null);
|
|
222
|
-
|
|
223
|
-
function useTooltipContext() {
|
|
224
|
-
const context = useContext(TooltipContext);
|
|
225
|
-
const invokerRef = useRef(null);
|
|
226
|
-
const popoverRef = useRef(null);
|
|
227
|
-
const arrowRef = useRef(null);
|
|
228
|
-
useLayoutEffect(() => {
|
|
229
|
-
if (!invokerRef.current) return;
|
|
230
|
-
context?.setInvoker?.(invokerRef.current);
|
|
231
|
-
if (!context?.openState) return;
|
|
232
|
-
context.openTooltip();
|
|
233
|
-
}, [context, invokerRef]);
|
|
234
|
-
useLayoutEffect(() => {
|
|
235
|
-
if (!popoverRef.current) return;
|
|
236
|
-
context?.setTooltip?.(popoverRef.current);
|
|
237
|
-
context?.setRootNode?.(popoverRef.current.getRootNode());
|
|
238
|
-
if (!arrowRef.current) return;
|
|
239
|
-
context?.setArrowElement?.(arrowRef.current);
|
|
240
|
-
}, [context, popoverRef]);
|
|
241
|
-
const onMouseEnterHandler = () => {
|
|
242
|
-
if (context?.controlled) return;
|
|
243
|
-
context?.openTooltip();
|
|
244
|
-
};
|
|
245
|
-
const onMouseLeaveHandler = () => {
|
|
246
|
-
if (context?.controlled) return;
|
|
247
|
-
context?.closeTooltip();
|
|
248
|
-
};
|
|
249
|
-
const onFocusHandler = () => {
|
|
250
|
-
if (context?.controlled) return;
|
|
251
|
-
context?.openTooltip();
|
|
252
|
-
};
|
|
253
|
-
const onBlurHandler = () => {
|
|
254
|
-
if (context?.controlled) return;
|
|
255
|
-
context?.closeTooltip();
|
|
256
|
-
};
|
|
257
|
-
const onKeyDownHandler = (e) => {
|
|
258
|
-
if (!context?.openState) return;
|
|
259
|
-
if (e.code === "Escape" && !context.controlled) {
|
|
260
|
-
context?.closeTooltip();
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
if (!context || !invokerRef || !popoverRef) return;
|
|
265
|
-
return {
|
|
266
|
-
invoker: {
|
|
267
|
-
ref: invokerRef,
|
|
268
|
-
element: context.invoker,
|
|
269
|
-
onMouseEnter: onMouseEnterHandler,
|
|
270
|
-
onMouseLeave: onMouseLeaveHandler,
|
|
271
|
-
onKeyDown: onKeyDownHandler,
|
|
272
|
-
onFocus: onFocusHandler,
|
|
273
|
-
onBlur: onBlurHandler,
|
|
274
|
-
"aria-haspopup": true,
|
|
275
|
-
"aria-details": context.tooltipId,
|
|
276
|
-
"data-state": context.openState ? "open" : "closed",
|
|
277
|
-
"aria-describedby": context.tooltipId
|
|
278
|
-
},
|
|
279
|
-
tooltip: {
|
|
280
|
-
ref: popoverRef,
|
|
281
|
-
element: context.popover,
|
|
282
|
-
id: context.tooltipId,
|
|
283
|
-
setId: context.setTooltipId,
|
|
284
|
-
show: context.openTooltip,
|
|
285
|
-
close: context.closeTooltip,
|
|
286
|
-
style: context.tooltipStyle,
|
|
287
|
-
arrowRef,
|
|
288
|
-
key: context.resetKey
|
|
289
|
-
},
|
|
290
|
-
setOpen: context.setOpenState,
|
|
291
|
-
open: context.openState,
|
|
292
|
-
controlled: context.controlled,
|
|
293
|
-
placement: context.placement,
|
|
294
|
-
disableFlipFallback: context.disableFlipFallback
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
function supportsPopover() {
|
|
299
|
-
return Object.prototype.hasOwnProperty.call(HTMLElement.prototype, "popover");
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
const TooltipLegacyContext = createContext(null);
|
|
303
|
-
const useTooltipLegacyContext = () => {
|
|
304
|
-
const context = useContext(TooltipLegacyContext);
|
|
305
|
-
if (context == null) {
|
|
306
|
-
throw new Error(
|
|
307
|
-
"TooltipLegacy components must be wrapped in <TooltipLegacy />"
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
return context;
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
const styles$3 = {
|
|
314
|
-
"content-legacy": "_content-legacy_3w3om_3",
|
|
315
|
-
"arrow-legacy": "_arrow-legacy_3w3om_29",
|
|
316
|
-
"trigger-legacy": "_trigger-legacy_3w3om_32"
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
const ATTRIBUTE_NAME_LIST = "data-anv-dialogs";
|
|
320
|
-
const ATTRIBUTE_NAME_BOOL = "data-anv-dialogs-open";
|
|
321
|
-
const useDialogScrollLock = ({
|
|
322
|
-
open,
|
|
323
|
-
id,
|
|
324
|
-
enableScrollChaining,
|
|
325
|
-
elementRef
|
|
326
|
-
}) => {
|
|
327
|
-
useEffect(() => {
|
|
328
|
-
if (enableScrollChaining) return () => {
|
|
329
|
-
};
|
|
330
|
-
const root = elementRef.current?.getRootNode();
|
|
331
|
-
if (!(root instanceof ShadowRoot)) return () => {
|
|
332
|
-
};
|
|
333
|
-
const updateDialogAttributes = (shouldAdd) => {
|
|
334
|
-
const currentDialogs = root.host.getAttribute(ATTRIBUTE_NAME_LIST)?.split(" ").filter(Boolean) ?? [];
|
|
335
|
-
const newDialogs = new Set(currentDialogs);
|
|
336
|
-
if (shouldAdd) {
|
|
337
|
-
newDialogs.add(id);
|
|
338
|
-
} else {
|
|
339
|
-
newDialogs.delete(id);
|
|
340
|
-
}
|
|
341
|
-
const dialogList = Array.from(newDialogs);
|
|
342
|
-
root.host.setAttribute(ATTRIBUTE_NAME_LIST, dialogList.join(" "));
|
|
343
|
-
if (dialogList.length > 0) {
|
|
344
|
-
root.host.setAttribute(ATTRIBUTE_NAME_BOOL, "true");
|
|
345
|
-
} else {
|
|
346
|
-
root.host.removeAttribute(ATTRIBUTE_NAME_BOOL);
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
updateDialogAttributes(open);
|
|
350
|
-
return () => {
|
|
351
|
-
updateDialogAttributes(false);
|
|
352
|
-
};
|
|
353
|
-
}, [open, id, enableScrollChaining, elementRef]);
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
const DialogContext = createContext(null);
|
|
357
|
-
|
|
358
|
-
const ToastProviderContext = createContext({
|
|
359
|
-
toasts: [],
|
|
360
|
-
setToasts: () => [],
|
|
361
|
-
toastHeights: [],
|
|
362
|
-
setToastHeights: () => [],
|
|
363
|
-
getToastStackHeight: () => 0,
|
|
364
|
-
toastsBeforeStack: 3,
|
|
365
|
-
setToastsBeforeStack: () => [],
|
|
366
|
-
extraToastsVisible: false,
|
|
367
|
-
setExtraToastsVisible: () => [],
|
|
368
|
-
isDialogToaster: false
|
|
369
|
-
});
|
|
370
|
-
const ToastProvider = ({
|
|
371
|
-
children,
|
|
372
|
-
isDialogToaster: isDialogToasterProp = false
|
|
373
|
-
}) => {
|
|
374
|
-
const [toasts, setToasts] = useState([]);
|
|
375
|
-
const [toastHeights, setToastHeights] = useState([]);
|
|
376
|
-
const [toastsBeforeStack, setToastsBeforeStack] = useState(3);
|
|
377
|
-
const [extraToastsVisible, setExtraToastsVisible] = useState(false);
|
|
378
|
-
const [isDialogToaster, setIsDialogToaster] = useState(isDialogToasterProp);
|
|
379
|
-
const removeDuplicateToasts = (toasts2) => {
|
|
380
|
-
const toastIds = /* @__PURE__ */ new Set();
|
|
381
|
-
const uniqueToasts = toasts2.filter((toast) => {
|
|
382
|
-
if (toastIds.has(toast.id)) {
|
|
383
|
-
console.error(
|
|
384
|
-
`Encountered toast with duplicate id ${toast.id}. Each toast id needs to be unique.`
|
|
385
|
-
);
|
|
386
|
-
return false;
|
|
387
|
-
} else {
|
|
388
|
-
toastIds.add(toast.id);
|
|
389
|
-
return true;
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
return uniqueToasts;
|
|
393
|
-
};
|
|
394
|
-
useEffect(() => {
|
|
395
|
-
const uniqueToasts = removeDuplicateToasts(toasts);
|
|
396
|
-
if (toasts.length !== uniqueToasts.length) {
|
|
397
|
-
setToasts(uniqueToasts);
|
|
398
|
-
}
|
|
399
|
-
}, [toasts]);
|
|
400
|
-
useEffect(() => {
|
|
401
|
-
setIsDialogToaster(isDialogToasterProp);
|
|
402
|
-
}, [isDialogToasterProp]);
|
|
403
|
-
const getToastStackHeight = useCallback(
|
|
404
|
-
(index) => {
|
|
405
|
-
const toastHeightsOnly = toastHeights.filter((_t, i) => {
|
|
406
|
-
return index !== void 0 ? i > index : true;
|
|
407
|
-
}).map((t) => t.height);
|
|
408
|
-
if (toastHeightsOnly.length > 0) {
|
|
409
|
-
if (extraToastsVisible) {
|
|
410
|
-
return toastHeightsOnly.reduce((totalHeight, currentHeight) => {
|
|
411
|
-
return totalHeight + currentHeight;
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
return toastHeightsOnly.filter((_t, i) => i >= toastHeightsOnly.length - toastsBeforeStack).reduce((totalHeight, currentHeight) => {
|
|
415
|
-
return totalHeight + currentHeight;
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
return 0;
|
|
419
|
-
},
|
|
420
|
-
[toastHeights, extraToastsVisible, toastsBeforeStack]
|
|
421
|
-
);
|
|
422
|
-
const value = useMemo(
|
|
423
|
-
() => ({
|
|
424
|
-
toasts,
|
|
425
|
-
setToasts,
|
|
426
|
-
toastHeights,
|
|
427
|
-
setToastHeights,
|
|
428
|
-
getToastStackHeight,
|
|
429
|
-
toastsBeforeStack,
|
|
430
|
-
setToastsBeforeStack,
|
|
431
|
-
extraToastsVisible,
|
|
432
|
-
setExtraToastsVisible,
|
|
433
|
-
isDialogToaster
|
|
434
|
-
}),
|
|
435
|
-
[
|
|
436
|
-
extraToastsVisible,
|
|
437
|
-
getToastStackHeight,
|
|
438
|
-
toastHeights,
|
|
439
|
-
toasts,
|
|
440
|
-
toastsBeforeStack,
|
|
441
|
-
isDialogToaster
|
|
442
|
-
]
|
|
443
|
-
);
|
|
444
|
-
return /* @__PURE__ */ jsx(ToastProviderContext.Provider, { value, children });
|
|
445
|
-
};
|
|
446
|
-
const useToasts = () => {
|
|
447
|
-
const context = useContext(ToastProviderContext);
|
|
448
|
-
if (context == null) {
|
|
449
|
-
throw new Error("useToasts must be wrapped in <ToastProvider />");
|
|
450
|
-
}
|
|
451
|
-
return context;
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
const popover = "_popover_x2c3m_2";
|
|
455
|
-
const toaster = "_toaster_x2c3m_9";
|
|
456
|
-
const hidden = "_hidden_x2c3m_24";
|
|
457
|
-
const stacked = "_stacked_x2c3m_89";
|
|
458
|
-
const open = "_open_x2c3m_184";
|
|
459
|
-
const close = "_close_x2c3m_185";
|
|
460
|
-
const styles$2 = {
|
|
461
|
-
popover: popover,
|
|
462
|
-
toaster: toaster,
|
|
463
|
-
hidden: hidden,
|
|
464
|
-
"toast-stack": "_toast-stack_x2c3m_27",
|
|
465
|
-
"toast-wrapper": "_toast-wrapper_x2c3m_40",
|
|
466
|
-
"toast-alert": "_toast-alert_x2c3m_54",
|
|
467
|
-
"alert-action": "_alert-action_x2c3m_60",
|
|
468
|
-
"message-container": "_message-container_x2c3m_66",
|
|
469
|
-
"show-extra-toast": "_show-extra-toast_x2c3m_75",
|
|
470
|
-
stacked: stacked,
|
|
471
|
-
"stack-one": "_stack-one_x2c3m_92",
|
|
472
|
-
"stack-two": "_stack-two_x2c3m_92",
|
|
473
|
-
"stacked-show-extra": "_stacked-show-extra_x2c3m_108",
|
|
474
|
-
"stacked-extra": "_stacked-extra_x2c3m_122",
|
|
475
|
-
"show-more-button-container": "_show-more-button-container_x2c3m_135",
|
|
476
|
-
"show-collapse-button-container": "_show-collapse-button-container_x2c3m_136",
|
|
477
|
-
"show-collapse-button": "_show-collapse-button_x2c3m_136",
|
|
478
|
-
"disable-animations": "_disable-animations_x2c3m_160",
|
|
479
|
-
open: open,
|
|
480
|
-
close: close};
|
|
481
|
-
|
|
482
|
-
const ANIMATION_DURATION = 300;
|
|
483
|
-
const useShowMoreButtonPositionStyles = () => {
|
|
484
|
-
const { toastHeights, toastsBeforeStack } = useToasts();
|
|
485
|
-
const totalToasts = toastHeights.length;
|
|
486
|
-
const extraSpace = totalToasts > toastsBeforeStack + 1 ? "2rem" : "1rem";
|
|
487
|
-
const top = useMemo(() => {
|
|
488
|
-
if (totalToasts > toastsBeforeStack) {
|
|
489
|
-
return toastHeights.filter((_t, i) => i >= totalToasts - toastsBeforeStack).map((t) => t.height).reduce((t, c) => t + c);
|
|
490
|
-
}
|
|
491
|
-
return "unset";
|
|
492
|
-
}, [toastHeights, toastsBeforeStack]);
|
|
493
|
-
return {
|
|
494
|
-
// -0.75px fixes hover issue when 1rem != 16px due to pixel rounding
|
|
495
|
-
top: `calc(${top}px + ${extraSpace} - 0.75px)`,
|
|
496
|
-
position: "absolute",
|
|
497
|
-
display: totalToasts > toastsBeforeStack ? void 0 : "none"
|
|
498
|
-
};
|
|
499
|
-
};
|
|
500
|
-
const STACKED_TOAST_HEIGHT = "5.3125rem";
|
|
501
|
-
const STACKED_TOAST_PEEK_HEIGHT = "1rem";
|
|
502
|
-
const TOAST_GAP = `${24 / 16}rem`;
|
|
503
|
-
const useToastPositionStyles = (index) => {
|
|
504
|
-
const {
|
|
505
|
-
toasts,
|
|
506
|
-
toastHeights,
|
|
507
|
-
getToastStackHeight,
|
|
508
|
-
toastsBeforeStack,
|
|
509
|
-
extraToastsVisible
|
|
510
|
-
} = useToasts();
|
|
511
|
-
const toastCount = toasts.length;
|
|
512
|
-
const toasterHeight = getToastStackHeight(index);
|
|
513
|
-
return useMemo(() => {
|
|
514
|
-
if (index === toastCount - 1) {
|
|
515
|
-
return {
|
|
516
|
-
top: TOAST_GAP,
|
|
517
|
-
zIndex: 3
|
|
518
|
-
};
|
|
519
|
-
} else if (
|
|
520
|
-
// all toasts when show more is clicked
|
|
521
|
-
extraToastsVisible || // or visible toasts when stacked
|
|
522
|
-
!extraToastsVisible && (toastCount <= toastsBeforeStack || toastCount > toastsBeforeStack && index >= toastCount - toastsBeforeStack)
|
|
523
|
-
) {
|
|
524
|
-
return {
|
|
525
|
-
top: `calc(${toasterHeight}px + ${TOAST_GAP})`
|
|
526
|
-
};
|
|
527
|
-
} else {
|
|
528
|
-
if (toastCount > toastsBeforeStack) {
|
|
529
|
-
if (index === toastCount - toastsBeforeStack - 1) {
|
|
530
|
-
return {
|
|
531
|
-
top: `calc(${toasterHeight || 0}px - ${STACKED_TOAST_HEIGHT} +
|
|
532
|
-
${STACKED_TOAST_PEEK_HEIGHT})`,
|
|
533
|
-
zIndex: 1
|
|
534
|
-
};
|
|
535
|
-
} else if (index <= toastCount - toastsBeforeStack - 2) {
|
|
536
|
-
return {
|
|
537
|
-
top: `calc(${toasterHeight || 0}px -
|
|
538
|
-
${STACKED_TOAST_HEIGHT}
|
|
539
|
-
+ ${STACKED_TOAST_PEEK_HEIGHT} * 2)`,
|
|
540
|
-
zIndex: 0
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
return void 0;
|
|
546
|
-
}, [toastHeights]);
|
|
547
|
-
};
|
|
548
|
-
const addOrUpdateToastHeight = (toastId, toastHeight, setToastHeights) => {
|
|
549
|
-
setToastHeights((prev) => {
|
|
550
|
-
if (prev.find((t) => t.id === toastId)) {
|
|
551
|
-
return prev.map((t) => {
|
|
552
|
-
if (t.id === toastId) {
|
|
553
|
-
return { ...t, height: toastHeight };
|
|
554
|
-
}
|
|
555
|
-
return t;
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
return [
|
|
559
|
-
...prev,
|
|
560
|
-
{
|
|
561
|
-
id: toastId,
|
|
562
|
-
height: toastHeight
|
|
563
|
-
}
|
|
564
|
-
];
|
|
565
|
-
});
|
|
566
|
-
};
|
|
567
|
-
const setToastsAfterClose = (setToasts, setToastHeights, id) => {
|
|
568
|
-
setToasts((prev) => id ? prev.filter((t) => t.id !== id) : []);
|
|
569
|
-
setToastHeights((prev) => id ? prev.filter((t) => t.id !== id) : []);
|
|
570
|
-
};
|
|
571
|
-
const closeToast = (setToasts, setToastHeights, closingToastClassName, id) => {
|
|
572
|
-
const prefersReducedMotion = globalThis.matchMedia(
|
|
573
|
-
`(prefers-reduced-motion: reduce)`
|
|
574
|
-
).matches;
|
|
575
|
-
if (prefersReducedMotion) {
|
|
576
|
-
setToastsAfterClose(setToasts, setToastHeights, id);
|
|
577
|
-
} else {
|
|
578
|
-
setToasts(
|
|
579
|
-
(prev) => prev.map((t) => {
|
|
580
|
-
if (!id || t.id === id) {
|
|
581
|
-
return {
|
|
582
|
-
...t,
|
|
583
|
-
toastClassName: closingToastClassName
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
return t;
|
|
587
|
-
})
|
|
588
|
-
);
|
|
589
|
-
setTimeout(() => {
|
|
590
|
-
setToastsAfterClose(setToasts, setToastHeights, id);
|
|
591
|
-
}, ANIMATION_DURATION - 10);
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
const useCloseToast = (closingToastClassName) => {
|
|
595
|
-
const { setToasts, setToastHeights } = useToasts();
|
|
596
|
-
return (id) => {
|
|
597
|
-
closeToast(setToasts, setToastHeights, closingToastClassName, id);
|
|
598
|
-
};
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
const toast = () => {
|
|
602
|
-
const toastMethods = [
|
|
603
|
-
"info",
|
|
604
|
-
"success",
|
|
605
|
-
"warning",
|
|
606
|
-
"danger",
|
|
607
|
-
"promise",
|
|
608
|
-
"update",
|
|
609
|
-
"dismiss"
|
|
610
|
-
];
|
|
611
|
-
console.error(
|
|
612
|
-
"Please use one of the following toast methods:\n",
|
|
613
|
-
...toastMethods.map((m) => ` toast.${m}()
|
|
614
|
-
`)
|
|
615
|
-
);
|
|
616
|
-
};
|
|
617
|
-
const TOAST_EVENT_NAME = "hammer-toast";
|
|
618
|
-
const TOAST_TYPES = ["info", "success", "warning", "danger"];
|
|
619
|
-
const methods = {};
|
|
620
|
-
TOAST_TYPES.forEach((type) => {
|
|
621
|
-
methods[type] = (props) => {
|
|
622
|
-
const uniqueId = v4();
|
|
623
|
-
const ToastAddEvent = new CustomEvent(TOAST_EVENT_NAME, {
|
|
624
|
-
composed: true,
|
|
625
|
-
detail: {
|
|
626
|
-
id: uniqueId,
|
|
627
|
-
eventType: "add",
|
|
628
|
-
status: type,
|
|
629
|
-
createdAt: Date.now(),
|
|
630
|
-
...props
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
dispatchEvent(ToastAddEvent);
|
|
634
|
-
return uniqueId;
|
|
635
|
-
};
|
|
636
|
-
});
|
|
637
|
-
const update = (id, props) => {
|
|
638
|
-
const ToastEvent = new CustomEvent(
|
|
639
|
-
TOAST_EVENT_NAME,
|
|
640
|
-
{
|
|
641
|
-
composed: true,
|
|
642
|
-
detail: {
|
|
643
|
-
eventType: "update",
|
|
644
|
-
id,
|
|
645
|
-
...props
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
);
|
|
649
|
-
dispatchEvent(ToastEvent);
|
|
650
|
-
};
|
|
651
|
-
const dismiss = (id) => {
|
|
652
|
-
const ToastEvent = new CustomEvent(
|
|
653
|
-
TOAST_EVENT_NAME,
|
|
654
|
-
{
|
|
655
|
-
composed: true,
|
|
656
|
-
detail: {
|
|
657
|
-
eventType: "dismiss",
|
|
658
|
-
id
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
);
|
|
662
|
-
dispatchEvent(ToastEvent);
|
|
663
|
-
};
|
|
664
|
-
const promise = async (promise2, toastConfig) => {
|
|
665
|
-
const { onClose, ...loadingToastConfig } = toastConfig.loading;
|
|
666
|
-
let closedWhileLoading = false;
|
|
667
|
-
const onCloseWhileLoading = (e) => {
|
|
668
|
-
toastConfig.loading.onClose?.(e);
|
|
669
|
-
closedWhileLoading = true;
|
|
670
|
-
};
|
|
671
|
-
const id = toast.info({
|
|
672
|
-
...loadingToastConfig,
|
|
673
|
-
onClose: onCloseWhileLoading,
|
|
674
|
-
duration: false
|
|
675
|
-
});
|
|
676
|
-
await Promise.resolve(promise2).then((res) => {
|
|
677
|
-
if (closedWhileLoading) {
|
|
678
|
-
toast.success({
|
|
679
|
-
...toastConfig.success(res)
|
|
680
|
-
});
|
|
681
|
-
} else {
|
|
682
|
-
toast.update(id, {
|
|
683
|
-
...toastConfig.success(res),
|
|
684
|
-
status: "success"
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
}).catch((err) => {
|
|
688
|
-
if (closedWhileLoading) {
|
|
689
|
-
toast.danger({
|
|
690
|
-
...toastConfig.error(err)
|
|
691
|
-
});
|
|
692
|
-
} else {
|
|
693
|
-
toast.update(id, {
|
|
694
|
-
...toastConfig.error(err),
|
|
695
|
-
status: "danger"
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
return id;
|
|
700
|
-
};
|
|
701
|
-
toast.info = methods.info;
|
|
702
|
-
toast.success = methods.success;
|
|
703
|
-
toast.warning = methods.warning;
|
|
704
|
-
toast.danger = methods.danger;
|
|
705
|
-
toast.update = update;
|
|
706
|
-
toast.dismiss = dismiss;
|
|
707
|
-
toast.promise = promise;
|
|
708
|
-
|
|
709
|
-
const Toast = forwardRef(
|
|
710
|
-
({
|
|
711
|
-
actions,
|
|
712
|
-
containerClassName,
|
|
713
|
-
createdAt,
|
|
714
|
-
duration: durationProp,
|
|
715
|
-
index = 0,
|
|
716
|
-
isBelowStackIndex,
|
|
717
|
-
isStacked,
|
|
718
|
-
message,
|
|
719
|
-
onClose,
|
|
720
|
-
onDismiss,
|
|
721
|
-
pausedStatus,
|
|
722
|
-
progress,
|
|
723
|
-
toastClassName,
|
|
724
|
-
...alertProps
|
|
725
|
-
}, ref) => {
|
|
726
|
-
const { setToastHeights, extraToastsVisible, isDialogToaster } = useToasts();
|
|
727
|
-
const closeToast = useCloseToast(styles$2.close);
|
|
728
|
-
const toastPositionStyles = useToastPositionStyles(index);
|
|
729
|
-
const toastWrapperRef = useRef(null);
|
|
730
|
-
const timerRef = useRef();
|
|
731
|
-
const pausedAtRef = useRef(0);
|
|
732
|
-
const createdAtRef = useRef(createdAt ?? 0);
|
|
733
|
-
const hasBeenStackedRef = useRef(false);
|
|
734
|
-
const [transitionClass, setTransitionClass] = useState(
|
|
735
|
-
styles$2.hidden
|
|
736
|
-
);
|
|
737
|
-
const [toastOpened, setToastOpened] = useState(false);
|
|
738
|
-
const duration = actions ? false : durationProp;
|
|
739
|
-
const alertClasses = cx(
|
|
740
|
-
styles$2["toast-alert"],
|
|
741
|
-
toastClassName,
|
|
742
|
-
transitionClass
|
|
743
|
-
);
|
|
744
|
-
useEffect(() => {
|
|
745
|
-
if (!toastOpened) {
|
|
746
|
-
setTransitionClass(styles$2.open);
|
|
747
|
-
setTimeout(() => {
|
|
748
|
-
setTransitionClass(void 0);
|
|
749
|
-
}, ANIMATION_DURATION);
|
|
750
|
-
setToastOpened(true);
|
|
751
|
-
}
|
|
752
|
-
return () => {
|
|
753
|
-
onDismiss?.();
|
|
754
|
-
};
|
|
755
|
-
}, []);
|
|
756
|
-
useEffect(() => {
|
|
757
|
-
if (toastWrapperRef.current && toastOpened && !isStacked) {
|
|
758
|
-
if (isBelowStackIndex && extraToastsVisible || isDialogToaster) {
|
|
759
|
-
const delay = isDialogToaster ? 0 : ANIMATION_DURATION;
|
|
760
|
-
setTimeout(() => {
|
|
761
|
-
const height = toastWrapperRef.current?.clientHeight;
|
|
762
|
-
addOrUpdateToastHeight(alertProps.id, height ?? 0, setToastHeights);
|
|
763
|
-
}, delay);
|
|
764
|
-
} else {
|
|
765
|
-
const height = toastWrapperRef.current.clientHeight;
|
|
766
|
-
addOrUpdateToastHeight(alertProps.id, height, setToastHeights);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}, [
|
|
770
|
-
toastOpened,
|
|
771
|
-
isStacked,
|
|
772
|
-
extraToastsVisible,
|
|
773
|
-
isDialogToaster,
|
|
774
|
-
// toast updates
|
|
775
|
-
actions,
|
|
776
|
-
message,
|
|
777
|
-
alertProps.title
|
|
778
|
-
]);
|
|
779
|
-
useEffect(() => {
|
|
780
|
-
if (duration && !isStacked) {
|
|
781
|
-
if (!pausedStatus) {
|
|
782
|
-
timerRef.current = setTimeout(
|
|
783
|
-
() => closeToast(alertProps.id),
|
|
784
|
-
duration
|
|
785
|
-
);
|
|
786
|
-
return () => clearTimeout(timerRef.current);
|
|
787
|
-
} else if (typeof pausedStatus === "number") {
|
|
788
|
-
clearTimeout(timerRef.current);
|
|
789
|
-
pausedAtRef.current = pausedStatus;
|
|
790
|
-
} else if (pausedStatus === "resumed") {
|
|
791
|
-
const remainingDuration = (
|
|
792
|
-
// rendering new toast after initial hover
|
|
793
|
-
pausedAtRef.current === 0 ? duration : (
|
|
794
|
-
// resume timer after valid hover
|
|
795
|
-
duration + (createdAtRef.current || 0) - pausedAtRef.current
|
|
796
|
-
)
|
|
797
|
-
);
|
|
798
|
-
timerRef.current = setTimeout(() => {
|
|
799
|
-
closeToast(alertProps.id);
|
|
800
|
-
pausedAtRef.current = 0;
|
|
801
|
-
}, remainingDuration);
|
|
802
|
-
return () => clearTimeout(timerRef.current);
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}, [createdAtRef.current, duration, pausedStatus]);
|
|
806
|
-
useEffect(() => {
|
|
807
|
-
if (duration) {
|
|
808
|
-
if (isStacked) {
|
|
809
|
-
clearTimeout(timerRef.current);
|
|
810
|
-
hasBeenStackedRef.current = true;
|
|
811
|
-
} else if (!isStacked && hasBeenStackedRef.current && !(typeof pausedStatus === "number")) {
|
|
812
|
-
createdAtRef.current = Date.now();
|
|
813
|
-
timerRef.current = setTimeout(() => {
|
|
814
|
-
closeToast(alertProps.id);
|
|
815
|
-
hasBeenStackedRef.current = false;
|
|
816
|
-
}, duration);
|
|
817
|
-
return () => clearTimeout(timerRef.current);
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
}, [isStacked, duration]);
|
|
821
|
-
const onSwipe = (dir) => {
|
|
822
|
-
if (dir === "right") {
|
|
823
|
-
toast.dismiss(alertProps.id);
|
|
824
|
-
return;
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
const { direction, ...touchProps } = useSwipe(onSwipe);
|
|
828
|
-
const alertCloseProps = isStacked && !extraToastsVisible ? {} : {
|
|
829
|
-
onClose
|
|
830
|
-
};
|
|
831
|
-
const hasMessage = message && message !== "";
|
|
832
|
-
const hasProgress = progress != null;
|
|
833
|
-
return /* @__PURE__ */ jsx(
|
|
834
|
-
"div",
|
|
835
|
-
{
|
|
836
|
-
"data-anv": "toast",
|
|
837
|
-
className: containerClassName,
|
|
838
|
-
style: toastPositionStyles ?? { top: "1.5rem" },
|
|
839
|
-
ref: toastWrapperRef,
|
|
840
|
-
onAnimationStart: () => setToastOpened(true),
|
|
841
|
-
role: isStacked ? "presentation" : void 0,
|
|
842
|
-
...touchProps,
|
|
843
|
-
children: /* @__PURE__ */ jsx(
|
|
844
|
-
Alert,
|
|
845
|
-
{
|
|
846
|
-
className: alertClasses,
|
|
847
|
-
...alertProps,
|
|
848
|
-
...alertCloseProps,
|
|
849
|
-
ref,
|
|
850
|
-
tabIndex: isStacked && !extraToastsVisible ? -1 : 0,
|
|
851
|
-
children: hasMessage || hasProgress || actions ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
852
|
-
hasMessage ? /* @__PURE__ */ jsx(
|
|
853
|
-
"div",
|
|
854
|
-
{
|
|
855
|
-
className: styles$2["message-container"],
|
|
856
|
-
id: `toast-message-${alertProps.id}`,
|
|
857
|
-
children: message
|
|
858
|
-
}
|
|
859
|
-
) : null,
|
|
860
|
-
hasProgress ? /* @__PURE__ */ jsx(Fragment, { children: progress === "indeterminate" ? /* @__PURE__ */ jsx(
|
|
861
|
-
ProgressBar,
|
|
862
|
-
{
|
|
863
|
-
"aria-labelledby": `toast-message-${alertProps.id}`,
|
|
864
|
-
indeterminate: true
|
|
865
|
-
}
|
|
866
|
-
) : /* @__PURE__ */ jsx(
|
|
867
|
-
ProgressBar,
|
|
868
|
-
{
|
|
869
|
-
"aria-labelledby": `toast-message-${alertProps.id}`,
|
|
870
|
-
value: progress
|
|
871
|
-
}
|
|
872
|
-
) }) : null,
|
|
873
|
-
actions ? /* @__PURE__ */ jsxs("div", { className: styles$2["alert-action"], children: [
|
|
874
|
-
/* @__PURE__ */ jsx(
|
|
875
|
-
Button,
|
|
876
|
-
{
|
|
877
|
-
appearance: actions.primary.appearance,
|
|
878
|
-
onClick: actions.primary.onClick,
|
|
879
|
-
size: "small",
|
|
880
|
-
children: actions.primary.label
|
|
881
|
-
}
|
|
882
|
-
),
|
|
883
|
-
actions.secondary && /* @__PURE__ */ jsx(
|
|
884
|
-
Button,
|
|
885
|
-
{
|
|
886
|
-
appearance: actions.secondary.appearance,
|
|
887
|
-
onClick: actions.secondary.onClick,
|
|
888
|
-
size: "small",
|
|
889
|
-
children: actions.secondary.label
|
|
890
|
-
}
|
|
891
|
-
)
|
|
892
|
-
] }) : null
|
|
893
|
-
] }) : null
|
|
894
|
-
}
|
|
895
|
-
)
|
|
896
|
-
}
|
|
897
|
-
);
|
|
898
|
-
}
|
|
899
|
-
);
|
|
900
|
-
Toast.displayName = "Toast";
|
|
901
|
-
|
|
902
|
-
function useHotkeyFocus({
|
|
903
|
-
disabled,
|
|
904
|
-
hotkey,
|
|
905
|
-
onHotkeyIn,
|
|
906
|
-
onHotkeyOut,
|
|
907
|
-
refToFocus,
|
|
908
|
-
rootRef
|
|
909
|
-
}) {
|
|
910
|
-
const [shouldEscapeRefocus, setShouldEscapeRefocus] = useState(false);
|
|
911
|
-
const previousFocusElement = useRef(null);
|
|
912
|
-
useEffect(() => {
|
|
913
|
-
if (disabled || typeof document === "undefined") return;
|
|
914
|
-
const rootElement = rootRef.current;
|
|
915
|
-
const blurHandler = (e) => {
|
|
916
|
-
if (e.relatedTarget && rootElement.contains(e.relatedTarget)) {
|
|
917
|
-
return;
|
|
918
|
-
}
|
|
919
|
-
setShouldEscapeRefocus(false);
|
|
920
|
-
};
|
|
921
|
-
const keyDownHandler = async (e) => {
|
|
922
|
-
const activeElement = getActiveElement(document);
|
|
923
|
-
if (activeElement?.tagName.toLowerCase() !== "input" && activeElement?.tagName.toLowerCase() !== "textarea" && activeElement?.tagName.toLowerCase() !== "pre" && e.key === hotkey) {
|
|
924
|
-
e.preventDefault();
|
|
925
|
-
previousFocusElement.current = activeElement;
|
|
926
|
-
await onHotkeyIn?.();
|
|
927
|
-
if (refToFocus.current) {
|
|
928
|
-
refToFocus.current.focus();
|
|
929
|
-
setShouldEscapeRefocus(true);
|
|
930
|
-
if (refToFocus.current.scrollTo) {
|
|
931
|
-
refToFocus.current.scrollTo();
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
} else if (e.code === "Escape" && shouldEscapeRefocus) {
|
|
935
|
-
onHotkeyOut?.();
|
|
936
|
-
if (previousFocusElement.current && previousFocusElement.current.tagName.toLowerCase() !== "body") {
|
|
937
|
-
previousFocusElement.current.focus();
|
|
938
|
-
} else {
|
|
939
|
-
activeElement.blur();
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
};
|
|
943
|
-
document.addEventListener("keydown", keyDownHandler);
|
|
944
|
-
rootElement.addEventListener("focusout", blurHandler);
|
|
945
|
-
return () => {
|
|
946
|
-
document.removeEventListener("keydown", keyDownHandler);
|
|
947
|
-
rootElement.removeEventListener("focusout", blurHandler);
|
|
948
|
-
};
|
|
949
|
-
}, [
|
|
950
|
-
hotkey,
|
|
951
|
-
disabled,
|
|
952
|
-
rootRef,
|
|
953
|
-
shouldEscapeRefocus,
|
|
954
|
-
onHotkeyIn,
|
|
955
|
-
refToFocus,
|
|
956
|
-
onHotkeyOut
|
|
957
|
-
]);
|
|
958
|
-
return { returnFocusRef: previousFocusElement };
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
const ToastStack = forwardRef(
|
|
962
|
-
({
|
|
963
|
-
className,
|
|
964
|
-
duration = false,
|
|
965
|
-
focusKey = "t",
|
|
966
|
-
toasts,
|
|
967
|
-
toastsBeforeStack = 3,
|
|
968
|
-
...props
|
|
969
|
-
}, ref) => {
|
|
970
|
-
const toastStackRef = useRef(null);
|
|
971
|
-
const firstToastRef = useRef(null);
|
|
972
|
-
const mergedToastStackRef = useMergeRefs([toastStackRef, ref]);
|
|
973
|
-
const {
|
|
974
|
-
setToastsBeforeStack,
|
|
975
|
-
extraToastsVisible,
|
|
976
|
-
setExtraToastsVisible,
|
|
977
|
-
getToastStackHeight,
|
|
978
|
-
isDialogToaster
|
|
979
|
-
} = useToasts();
|
|
980
|
-
const toastCount = toasts.length;
|
|
981
|
-
const isToastStackEmpty = toastCount === 0;
|
|
982
|
-
const lastToastCount = useRef(0);
|
|
983
|
-
const [toastStackHeight, setToastStackHeight] = useState(0);
|
|
984
|
-
const [disableAnimations, setDisableAnimations] = useState(false);
|
|
985
|
-
const [toastPausedStatus, setToastPausedStatus] = useState(void 0);
|
|
986
|
-
useEffect(() => {
|
|
987
|
-
if (toastCount === 0) {
|
|
988
|
-
setToastPausedStatus(void 0);
|
|
989
|
-
}
|
|
990
|
-
}, [toastCount]);
|
|
991
|
-
useEffect(() => {
|
|
992
|
-
const scrollListener = (e) => {
|
|
993
|
-
e.preventDefault();
|
|
994
|
-
e.stopPropagation();
|
|
995
|
-
toastStackRef.current?.scrollTo({
|
|
996
|
-
top: toastStackRef.current.scrollTop + e.deltaY
|
|
997
|
-
});
|
|
998
|
-
};
|
|
999
|
-
if (isDialogToaster) {
|
|
1000
|
-
setDisableAnimations(isDialogToaster);
|
|
1001
|
-
setTimeout(() => {
|
|
1002
|
-
setDisableAnimations(false);
|
|
1003
|
-
}, 500);
|
|
1004
|
-
const toastStackRefCurrent = toastStackRef.current;
|
|
1005
|
-
toastStackRefCurrent?.addEventListener("wheel", scrollListener, {
|
|
1006
|
-
passive: false
|
|
1007
|
-
});
|
|
1008
|
-
return () => {
|
|
1009
|
-
toastStackRefCurrent?.removeEventListener("wheel", scrollListener);
|
|
1010
|
-
};
|
|
1011
|
-
}
|
|
1012
|
-
}, [isDialogToaster]);
|
|
1013
|
-
useEffect(() => {
|
|
1014
|
-
let timer;
|
|
1015
|
-
if (toastCount > lastToastCount.current || isDialogToaster) {
|
|
1016
|
-
setToastStackHeight(getToastStackHeight());
|
|
1017
|
-
} else {
|
|
1018
|
-
timer = setTimeout(
|
|
1019
|
-
() => setToastStackHeight(getToastStackHeight()),
|
|
1020
|
-
ANIMATION_DURATION - 10
|
|
1021
|
-
);
|
|
1022
|
-
}
|
|
1023
|
-
lastToastCount.current = toastCount;
|
|
1024
|
-
return () => {
|
|
1025
|
-
clearTimeout(timer);
|
|
1026
|
-
};
|
|
1027
|
-
}, [getToastStackHeight, isDialogToaster]);
|
|
1028
|
-
useEffect(() => {
|
|
1029
|
-
setToastsBeforeStack(toastsBeforeStack);
|
|
1030
|
-
}, [setToastsBeforeStack, toastsBeforeStack]);
|
|
1031
|
-
const handleToastStackBlur = useCallback(() => {
|
|
1032
|
-
setExtraToastsVisible(false);
|
|
1033
|
-
setToastPausedStatus("resumed");
|
|
1034
|
-
if (toastStackRef.current?.scrollTo) {
|
|
1035
|
-
toastStackRef.current?.scrollTo(0, 0);
|
|
1036
|
-
}
|
|
1037
|
-
}, [setExtraToastsVisible]);
|
|
1038
|
-
const { returnFocusRef } = useHotkeyFocus({
|
|
1039
|
-
disabled: isToastStackEmpty,
|
|
1040
|
-
hotkey: focusKey,
|
|
1041
|
-
onHotkeyIn: async () => {
|
|
1042
|
-
setExtraToastsVisible(true);
|
|
1043
|
-
return new Promise((resolve) => {
|
|
1044
|
-
setTimeout(() => {
|
|
1045
|
-
resolve();
|
|
1046
|
-
}, 100);
|
|
1047
|
-
});
|
|
1048
|
-
},
|
|
1049
|
-
onHotkeyOut: () => {
|
|
1050
|
-
setExtraToastsVisible(false);
|
|
1051
|
-
handleToastStackBlur();
|
|
1052
|
-
},
|
|
1053
|
-
refToFocus: firstToastRef,
|
|
1054
|
-
rootRef: toastStackRef
|
|
1055
|
-
});
|
|
1056
|
-
const showMoreButtonPositionStyles = useShowMoreButtonPositionStyles();
|
|
1057
|
-
const showMoreButton = !extraToastsVisible && toastCount > toastsBeforeStack;
|
|
1058
|
-
const extraToastsLength = toastCount - toastsBeforeStack;
|
|
1059
|
-
const showMoreButtonText = `${extraToastsLength} more message${extraToastsLength > 1 ? "s" : ""}`;
|
|
1060
|
-
const toastStackClasses = cx(styles$2["toast-stack"], className, {
|
|
1061
|
-
[styles$2["show-more-button"]]: showMoreButton,
|
|
1062
|
-
[styles$2["show-extra-toast"]]: extraToastsVisible,
|
|
1063
|
-
[styles$2["disable-animations"]]: disableAnimations
|
|
1064
|
-
});
|
|
1065
|
-
const handleToastStackFocusHover = () => {
|
|
1066
|
-
if (toastPausedStatus === "resumed" || toastPausedStatus === void 0) {
|
|
1067
|
-
setToastPausedStatus(Date.now());
|
|
1068
|
-
}
|
|
1069
|
-
};
|
|
1070
|
-
const handleToastStackOnBlur = () => {
|
|
1071
|
-
if (!toastStackRef.current?.matches(":focus-within")) {
|
|
1072
|
-
handleToastStackBlur();
|
|
1073
|
-
}
|
|
1074
|
-
};
|
|
1075
|
-
const handleShowMoreButtonClick = () => {
|
|
1076
|
-
setExtraToastsVisible(true);
|
|
1077
|
-
};
|
|
1078
|
-
let toastStackHeightStyle = 0;
|
|
1079
|
-
if (extraToastsVisible) {
|
|
1080
|
-
toastStackHeightStyle = "calc(100vh - var(--toast-stack-padding) * 2)";
|
|
1081
|
-
} else if (toastCount > toastsBeforeStack) {
|
|
1082
|
-
toastStackHeightStyle = `calc(${toastStackHeight}px + 3rem + var(--toast-stack-padding))`;
|
|
1083
|
-
} else {
|
|
1084
|
-
toastStackHeightStyle = toastStackHeight;
|
|
1085
|
-
}
|
|
1086
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1087
|
-
/* @__PURE__ */ jsxs(
|
|
1088
|
-
"div",
|
|
1089
|
-
{
|
|
1090
|
-
"data-anv": "ToastStack",
|
|
1091
|
-
className: toastStackClasses,
|
|
1092
|
-
ref: mergedToastStackRef,
|
|
1093
|
-
onMouseOver: handleToastStackFocusHover,
|
|
1094
|
-
onMouseLeave: handleToastStackBlur,
|
|
1095
|
-
onFocus: handleToastStackFocusHover,
|
|
1096
|
-
onBlur: handleToastStackOnBlur,
|
|
1097
|
-
style: {
|
|
1098
|
-
height: toastStackHeightStyle
|
|
1099
|
-
},
|
|
1100
|
-
...props,
|
|
1101
|
-
children: [
|
|
1102
|
-
toasts.map(({ toastClassName, onClose, ...toastProps }, index) => {
|
|
1103
|
-
const isStacked = !extraToastsVisible && index < toastCount - toastsBeforeStack;
|
|
1104
|
-
const isLastToastDisplayed = index === toastCount - toastsBeforeStack;
|
|
1105
|
-
const isHidden = index < toastCount - toastsBeforeStack - 2;
|
|
1106
|
-
const toastClasses = cx(styles$2.toast, toastClassName);
|
|
1107
|
-
const toastContainerClasses = cx(styles$2["toast-wrapper"], {
|
|
1108
|
-
[styles$2.stacked]: isStacked || isLastToastDisplayed,
|
|
1109
|
-
[styles$2["stack-one"]]: isStacked && index === toastCount - toastsBeforeStack - 1,
|
|
1110
|
-
[styles$2["stack-two"]]: isStacked && index === toastCount - toastsBeforeStack - 2,
|
|
1111
|
-
[styles$2["stacked-extra"]]: isHidden,
|
|
1112
|
-
[styles$2["stacked-show-extra"]]: extraToastsVisible
|
|
1113
|
-
});
|
|
1114
|
-
const handleOnClose = (e) => {
|
|
1115
|
-
onClose?.(e);
|
|
1116
|
-
returnFocusRef.current?.focus();
|
|
1117
|
-
toast.dismiss(toastProps.id);
|
|
1118
|
-
};
|
|
1119
|
-
return /* @__PURE__ */ jsx(
|
|
1120
|
-
Toast,
|
|
1121
|
-
{
|
|
1122
|
-
containerClassName: toastContainerClasses,
|
|
1123
|
-
duration,
|
|
1124
|
-
index,
|
|
1125
|
-
isStacked,
|
|
1126
|
-
isBelowStackIndex: index < toastCount - toastsBeforeStack,
|
|
1127
|
-
onClose: handleOnClose,
|
|
1128
|
-
pausedStatus: toastPausedStatus,
|
|
1129
|
-
toastClassName: toastClasses,
|
|
1130
|
-
ref: index === 0 ? firstToastRef : void 0,
|
|
1131
|
-
...toastProps
|
|
1132
|
-
},
|
|
1133
|
-
toastProps.id
|
|
1134
|
-
);
|
|
1135
|
-
}),
|
|
1136
|
-
showMoreButton && /* @__PURE__ */ jsx(
|
|
1137
|
-
"div",
|
|
1138
|
-
{
|
|
1139
|
-
className: styles$2["show-more-button-container"],
|
|
1140
|
-
style: showMoreButtonPositionStyles,
|
|
1141
|
-
children: /* @__PURE__ */ jsx(
|
|
1142
|
-
Button,
|
|
1143
|
-
{
|
|
1144
|
-
className: styles$2["show-collapse-button"],
|
|
1145
|
-
onClick: handleShowMoreButtonClick,
|
|
1146
|
-
appearance: "secondary",
|
|
1147
|
-
tabIndex: 0,
|
|
1148
|
-
children: showMoreButtonText
|
|
1149
|
-
}
|
|
1150
|
-
)
|
|
1151
|
-
}
|
|
1152
|
-
),
|
|
1153
|
-
/* @__PURE__ */ jsxs(SrOnly, { "aria-live": "polite", children: [
|
|
1154
|
-
"New toast message appeared. Press the ",
|
|
1155
|
-
focusKey,
|
|
1156
|
-
" key to focus on the toast messages. Press escape to return focus to previous position."
|
|
1157
|
-
] })
|
|
1158
|
-
]
|
|
1159
|
-
}
|
|
1160
|
-
),
|
|
1161
|
-
extraToastsVisible && /* @__PURE__ */ jsx("div", { className: styles$2["show-collapse-button-container"], children: /* @__PURE__ */ jsx(
|
|
1162
|
-
Button,
|
|
1163
|
-
{
|
|
1164
|
-
className: styles$2["show-collapse-button"],
|
|
1165
|
-
onClick: handleToastStackBlur,
|
|
1166
|
-
appearance: "secondary",
|
|
1167
|
-
children: "Collapse Messages"
|
|
1168
|
-
}
|
|
1169
|
-
) })
|
|
1170
|
-
] });
|
|
1171
|
-
}
|
|
1172
|
-
);
|
|
1173
|
-
ToastStack.displayName = "ToastStack";
|
|
1174
|
-
|
|
1175
|
-
const safeShowPopover = (element) => {
|
|
1176
|
-
try {
|
|
1177
|
-
element?.showPopover();
|
|
1178
|
-
} catch (e) {
|
|
1179
|
-
console.warn(e);
|
|
1180
|
-
}
|
|
1181
|
-
};
|
|
1182
|
-
const safeHidePopover = (element) => {
|
|
1183
|
-
try {
|
|
1184
|
-
element?.hidePopover();
|
|
1185
|
-
} catch (e) {
|
|
1186
|
-
console.warn(e);
|
|
1187
|
-
}
|
|
1188
|
-
};
|
|
1189
|
-
|
|
1190
|
-
const ToasterPopover = forwardRef(
|
|
1191
|
-
(props, ref) => {
|
|
1192
|
-
const { isDialogToaster } = useToasts();
|
|
1193
|
-
const popoverRef = useRef(null);
|
|
1194
|
-
const combinedRef = useMergeRefs([popoverRef, ref]);
|
|
1195
|
-
const { toasts } = useToasts();
|
|
1196
|
-
const toastCount = useMemo(() => toasts.length, [toasts]);
|
|
1197
|
-
useEffect(() => {
|
|
1198
|
-
if (!popoverRef.current) return;
|
|
1199
|
-
if (!supportsPopover()) {
|
|
1200
|
-
console.error("Popover is not supported in this browser");
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
const currentPopover = popoverRef.current;
|
|
1204
|
-
let timeout;
|
|
1205
|
-
if (toastCount > 0) {
|
|
1206
|
-
if (isDialogToaster) {
|
|
1207
|
-
timeout = setTimeout(() => {
|
|
1208
|
-
safeHidePopover(currentPopover);
|
|
1209
|
-
safeShowPopover(currentPopover);
|
|
1210
|
-
});
|
|
1211
|
-
} else {
|
|
1212
|
-
safeShowPopover(currentPopover);
|
|
1213
|
-
}
|
|
1214
|
-
} else {
|
|
1215
|
-
safeHidePopover(currentPopover);
|
|
1216
|
-
}
|
|
1217
|
-
return () => {
|
|
1218
|
-
if (timeout) clearTimeout(timeout);
|
|
1219
|
-
if (toastCount === 0) {
|
|
1220
|
-
safeHidePopover(currentPopover);
|
|
1221
|
-
}
|
|
1222
|
-
};
|
|
1223
|
-
}, [toastCount, isDialogToaster]);
|
|
1224
|
-
return /* @__PURE__ */ jsx("div", { ref: combinedRef, className: styles$2.popover, popover: "manual", children: props.children });
|
|
1225
|
-
}
|
|
1226
|
-
);
|
|
1227
|
-
ToasterPopover.displayName = "ToasterPopover";
|
|
1228
|
-
|
|
1229
|
-
const ToasterContent = forwardRef(
|
|
1230
|
-
({
|
|
1231
|
-
className,
|
|
1232
|
-
disableEvents = false,
|
|
1233
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- pulling out of props
|
|
1234
|
-
forceRender = false,
|
|
1235
|
-
id,
|
|
1236
|
-
onToastEvent,
|
|
1237
|
-
// ToastStackProps
|
|
1238
|
-
duration,
|
|
1239
|
-
focusKey,
|
|
1240
|
-
toastsBeforeStack,
|
|
1241
|
-
...props
|
|
1242
|
-
}, ref) => {
|
|
1243
|
-
const toasterRef = useRef(null);
|
|
1244
|
-
const mergedToasterRef = useMergeRefs([toasterRef, ref]);
|
|
1245
|
-
const { toasts, setToasts, isDialogToaster } = useToasts();
|
|
1246
|
-
const disableEventsRef = useRef(disableEvents);
|
|
1247
|
-
const toastCountRef = useRef(0);
|
|
1248
|
-
const isDialogToasterRef = useRef(isDialogToaster);
|
|
1249
|
-
const [shouldHideToaster, setShouldHideToaster] = useState(false);
|
|
1250
|
-
const updateDialogToasterStorage = useCallback(
|
|
1251
|
-
(isDialogToaster2) => {
|
|
1252
|
-
const dialogToasters = JSON.parse(
|
|
1253
|
-
window.sessionStorage.getItem("dialog-toasters") ?? "[]"
|
|
1254
|
-
);
|
|
1255
|
-
if (isDialogToaster2) {
|
|
1256
|
-
if (!dialogToasters.includes(id)) {
|
|
1257
|
-
window.sessionStorage.setItem(
|
|
1258
|
-
"dialog-toasters",
|
|
1259
|
-
JSON.stringify([...dialogToasters, id])
|
|
1260
|
-
);
|
|
1261
|
-
}
|
|
1262
|
-
} else if (dialogToasters.includes(id)) {
|
|
1263
|
-
window.sessionStorage.setItem(
|
|
1264
|
-
"dialog-toasters",
|
|
1265
|
-
JSON.stringify(
|
|
1266
|
-
dialogToasters.filter(
|
|
1267
|
-
(dialogToaster) => dialogToaster !== id
|
|
1268
|
-
)
|
|
1269
|
-
)
|
|
1270
|
-
);
|
|
1271
|
-
}
|
|
1272
|
-
},
|
|
1273
|
-
[id]
|
|
1274
|
-
);
|
|
1275
|
-
useEffect(() => {
|
|
1276
|
-
disableEventsRef.current = disableEvents;
|
|
1277
|
-
}, [disableEvents]);
|
|
1278
|
-
useEffect(() => {
|
|
1279
|
-
toastCountRef.current = toasts.length;
|
|
1280
|
-
}, [toasts.length]);
|
|
1281
|
-
useEffect(() => {
|
|
1282
|
-
updateDialogToasterStorage(isDialogToaster);
|
|
1283
|
-
isDialogToasterRef.current = isDialogToaster;
|
|
1284
|
-
const DialogToasterEvent = new CustomEvent("dialog-toaster", {
|
|
1285
|
-
composed: true,
|
|
1286
|
-
detail: {
|
|
1287
|
-
eventType: "dialog-toaster"
|
|
1288
|
-
}
|
|
1289
|
-
});
|
|
1290
|
-
dispatchEvent(DialogToasterEvent);
|
|
1291
|
-
}, [isDialogToaster]);
|
|
1292
|
-
const closeToast = useCloseToast(styles$2.close);
|
|
1293
|
-
useEffect(() => {
|
|
1294
|
-
let timeout;
|
|
1295
|
-
updateDialogToasterStorage(isDialogToaster);
|
|
1296
|
-
const toastEventListener = (e) => {
|
|
1297
|
-
if (disableEventsRef.current) {
|
|
1298
|
-
return;
|
|
1299
|
-
}
|
|
1300
|
-
const { eventType, ...toastProps } = e.detail;
|
|
1301
|
-
if (eventType === "add") {
|
|
1302
|
-
const toastAddProps = toastProps;
|
|
1303
|
-
if (!toastAddProps.toasterId || toastAddProps.toasterId === id) {
|
|
1304
|
-
setToasts((prev) => [...prev, toastProps]);
|
|
1305
|
-
}
|
|
1306
|
-
timeout = setTimeout(() => {
|
|
1307
|
-
onToastEvent?.({
|
|
1308
|
-
eventType: "add",
|
|
1309
|
-
toastCount: toastCountRef.current,
|
|
1310
|
-
id: toastAddProps.id,
|
|
1311
|
-
toasterId: id,
|
|
1312
|
-
toastProps: toastAddProps
|
|
1313
|
-
});
|
|
1314
|
-
});
|
|
1315
|
-
} else if (eventType === "update") {
|
|
1316
|
-
const toastUpdateProps = toastProps;
|
|
1317
|
-
setToasts((prev) => {
|
|
1318
|
-
return prev.map((t) => {
|
|
1319
|
-
if (t.id === toastUpdateProps.id) {
|
|
1320
|
-
return {
|
|
1321
|
-
...t,
|
|
1322
|
-
...toastUpdateProps
|
|
1323
|
-
};
|
|
1324
|
-
} else {
|
|
1325
|
-
return t;
|
|
1326
|
-
}
|
|
1327
|
-
});
|
|
1328
|
-
});
|
|
1329
|
-
onToastEvent?.({
|
|
1330
|
-
eventType: "update",
|
|
1331
|
-
toastCount: toastCountRef.current,
|
|
1332
|
-
id: toastUpdateProps.id,
|
|
1333
|
-
toasterId: id,
|
|
1334
|
-
toastProps: toastUpdateProps
|
|
1335
|
-
});
|
|
1336
|
-
} else if (eventType === "dismiss") {
|
|
1337
|
-
if (toastProps.id) {
|
|
1338
|
-
closeToast(toastProps.id);
|
|
1339
|
-
timeout = setTimeout(() => {
|
|
1340
|
-
onToastEvent?.({
|
|
1341
|
-
eventType: "dismiss",
|
|
1342
|
-
toastCount: toastCountRef.current,
|
|
1343
|
-
id: toastProps.id,
|
|
1344
|
-
toasterId: id
|
|
1345
|
-
});
|
|
1346
|
-
}, ANIMATION_DURATION);
|
|
1347
|
-
} else {
|
|
1348
|
-
closeToast();
|
|
1349
|
-
onToastEvent?.({
|
|
1350
|
-
eventType: "dismiss-all",
|
|
1351
|
-
toastCount: 0,
|
|
1352
|
-
toasterId: id
|
|
1353
|
-
});
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
};
|
|
1357
|
-
const dialogToasterEventListener = (e) => {
|
|
1358
|
-
const { eventType } = e.detail;
|
|
1359
|
-
if (eventType === "dialog-toaster") {
|
|
1360
|
-
const dialogToasters = JSON.parse(
|
|
1361
|
-
window.sessionStorage.getItem("dialog-toasters") ?? "[]"
|
|
1362
|
-
);
|
|
1363
|
-
if (dialogToasters.length > 0) {
|
|
1364
|
-
if (isDialogToasterRef.current && dialogToasters[dialogToasters.length - 1] === id) {
|
|
1365
|
-
setShouldHideToaster(false);
|
|
1366
|
-
} else {
|
|
1367
|
-
setShouldHideToaster(true);
|
|
1368
|
-
}
|
|
1369
|
-
} else {
|
|
1370
|
-
setShouldHideToaster(false);
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
};
|
|
1374
|
-
const onPageRefreshListener = () => {
|
|
1375
|
-
window.sessionStorage.removeItem("dialog-toasters");
|
|
1376
|
-
};
|
|
1377
|
-
window.addEventListener("hammer-toast", toastEventListener);
|
|
1378
|
-
window.addEventListener("dialog-toaster", dialogToasterEventListener);
|
|
1379
|
-
window.addEventListener("beforeunload", onPageRefreshListener);
|
|
1380
|
-
return () => {
|
|
1381
|
-
window.removeEventListener("hammer-toast", toastEventListener);
|
|
1382
|
-
window.removeEventListener(
|
|
1383
|
-
"dialog-toaster",
|
|
1384
|
-
dialogToasterEventListener
|
|
1385
|
-
);
|
|
1386
|
-
window.removeEventListener("beforeunload", onPageRefreshListener);
|
|
1387
|
-
clearTimeout(timeout);
|
|
1388
|
-
updateDialogToasterStorage(false);
|
|
1389
|
-
};
|
|
1390
|
-
}, []);
|
|
1391
|
-
const toasterClasses = cx(styles$2.toaster, {
|
|
1392
|
-
[styles$2["hidden"]]: shouldHideToaster,
|
|
1393
|
-
[`${className}`]: className != null
|
|
1394
|
-
});
|
|
1395
|
-
return /* @__PURE__ */ jsx(
|
|
1396
|
-
"div",
|
|
1397
|
-
{
|
|
1398
|
-
"data-anv": "toaster",
|
|
1399
|
-
"data-toaster-id": id,
|
|
1400
|
-
"aria-hidden": shouldHideToaster,
|
|
1401
|
-
className: toasterClasses,
|
|
1402
|
-
ref: mergedToasterRef,
|
|
1403
|
-
...props,
|
|
1404
|
-
children: /* @__PURE__ */ jsx(
|
|
1405
|
-
ToastStack,
|
|
1406
|
-
{
|
|
1407
|
-
toasts,
|
|
1408
|
-
duration,
|
|
1409
|
-
focusKey,
|
|
1410
|
-
toastsBeforeStack
|
|
1411
|
-
}
|
|
1412
|
-
)
|
|
1413
|
-
}
|
|
1414
|
-
);
|
|
1415
|
-
}
|
|
1416
|
-
);
|
|
1417
|
-
const Toaster = forwardRef(
|
|
1418
|
-
(props, ref) => {
|
|
1419
|
-
return /* @__PURE__ */ jsx(ToastProvider, { children: /* @__PURE__ */ jsx(ToasterPopover, { children: /* @__PURE__ */ jsx(ToasterContent, { ...props, ref }) }) });
|
|
1420
|
-
}
|
|
1421
|
-
);
|
|
1422
|
-
Toaster.displayName = "Toaster";
|
|
1423
|
-
ToasterContent.displayName = "ToasterContent";
|
|
1424
|
-
|
|
1425
|
-
const useOpenCloseTransitionStates = (openProp, options = {
|
|
1426
|
-
durationMs: 0
|
|
1427
|
-
}) => {
|
|
1428
|
-
const {
|
|
1429
|
-
onOpenAnimationStart,
|
|
1430
|
-
onCloseAnimationStart,
|
|
1431
|
-
onOpenAnimationComplete,
|
|
1432
|
-
onCloseAnimationComplete,
|
|
1433
|
-
durationMs
|
|
1434
|
-
} = options;
|
|
1435
|
-
const prevOpenProp = useRef(openProp);
|
|
1436
|
-
const [state, setState] = useState(
|
|
1437
|
-
openProp ? "open" : "closed"
|
|
1438
|
-
);
|
|
1439
|
-
useEffect(() => {
|
|
1440
|
-
if (prevOpenProp.current && !openProp) {
|
|
1441
|
-
setState("closing");
|
|
1442
|
-
} else if (!prevOpenProp.current && openProp) {
|
|
1443
|
-
setState("opening");
|
|
1444
|
-
} else {
|
|
1445
|
-
setState(openProp ? "opening" : "closed");
|
|
1446
|
-
}
|
|
1447
|
-
prevOpenProp.current = openProp;
|
|
1448
|
-
}, [openProp]);
|
|
1449
|
-
useEffect(() => {
|
|
1450
|
-
if (!durationMs) return;
|
|
1451
|
-
if (state === "open" || state === "closed") return;
|
|
1452
|
-
if (state === "opening") {
|
|
1453
|
-
onOpenAnimationStart?.();
|
|
1454
|
-
} else if (state === "closing") {
|
|
1455
|
-
onCloseAnimationStart?.();
|
|
1456
|
-
}
|
|
1457
|
-
const d = typeof durationMs === "function" ? durationMs() : durationMs;
|
|
1458
|
-
const timeout = setTimeout(() => {
|
|
1459
|
-
if (state === "opening") {
|
|
1460
|
-
setState("open");
|
|
1461
|
-
onOpenAnimationComplete?.();
|
|
1462
|
-
} else if (state === "closing") {
|
|
1463
|
-
setState("closed");
|
|
1464
|
-
onCloseAnimationComplete?.();
|
|
1465
|
-
}
|
|
1466
|
-
}, d);
|
|
1467
|
-
return () => {
|
|
1468
|
-
clearTimeout(timeout);
|
|
1469
|
-
};
|
|
1470
|
-
}, [
|
|
1471
|
-
state,
|
|
1472
|
-
onOpenAnimationComplete,
|
|
1473
|
-
onCloseAnimationComplete,
|
|
1474
|
-
onOpenAnimationStart,
|
|
1475
|
-
onCloseAnimationStart,
|
|
1476
|
-
durationMs
|
|
1477
|
-
]);
|
|
1478
|
-
const beginClosing = useCallback(() => {
|
|
1479
|
-
setState("closing");
|
|
1480
|
-
}, []);
|
|
1481
|
-
return {
|
|
1482
|
-
state,
|
|
1483
|
-
beginClosing,
|
|
1484
|
-
isOpenOrOpening: state === "open" || state === "opening",
|
|
1485
|
-
isClosedOrClosing: state === "closed" || state === "closing"
|
|
1486
|
-
};
|
|
1487
|
-
};
|
|
1488
|
-
|
|
1489
|
-
const useDialogTransitionStates = (ref, openProp, options = {}) => {
|
|
1490
|
-
const { onOpenAnimationStart, onCloseAnimationComplete } = options;
|
|
1491
|
-
return useOpenCloseTransitionStates(openProp, {
|
|
1492
|
-
...options,
|
|
1493
|
-
onOpenAnimationStart: () => {
|
|
1494
|
-
if (!ref.current) return;
|
|
1495
|
-
ref.current.showModal();
|
|
1496
|
-
onOpenAnimationStart?.();
|
|
1497
|
-
},
|
|
1498
|
-
onCloseAnimationComplete: () => {
|
|
1499
|
-
if (!ref.current) return;
|
|
1500
|
-
ref.current.close();
|
|
1501
|
-
onCloseAnimationComplete?.();
|
|
1502
|
-
},
|
|
1503
|
-
durationMs: () => {
|
|
1504
|
-
if (!ref.current) return 0;
|
|
1505
|
-
const duration = window.getComputedStyle(ref.current).animationDuration;
|
|
1506
|
-
return parseFloat(duration) * 1e3;
|
|
1507
|
-
}
|
|
1508
|
-
});
|
|
1509
|
-
};
|
|
1510
|
-
|
|
1511
|
-
const drawer = "_drawer_1jl82_2";
|
|
1512
|
-
const container = "_container_1jl82_28";
|
|
1513
|
-
const content = "_content_1jl82_41";
|
|
1514
|
-
const header = "_header_1jl82_48";
|
|
1515
|
-
const footer = "_footer_1jl82_72";
|
|
1516
|
-
const remove = "_remove_1jl82_90";
|
|
1517
|
-
const large = "_large_1jl82_99";
|
|
1518
|
-
const sticky = "_sticky_1jl82_102";
|
|
1519
|
-
const styles$1 = {
|
|
1520
|
-
drawer: drawer,
|
|
1521
|
-
container: container,
|
|
1522
|
-
content: content,
|
|
1523
|
-
header: header,
|
|
1524
|
-
"close-container": "_close-container_1jl82_65",
|
|
1525
|
-
footer: footer,
|
|
1526
|
-
remove: remove,
|
|
1527
|
-
large: large,
|
|
1528
|
-
sticky: sticky,
|
|
1529
|
-
"close-button": "_close-button_1jl82_108"
|
|
1530
|
-
};
|
|
1531
|
-
|
|
1532
|
-
const DrawerCancelButton = forwardRef((props, ref) => {
|
|
1533
|
-
const { onClick, ...rest } = props;
|
|
1534
|
-
const { close } = useDrawerContext();
|
|
1535
|
-
const onClickHandler = (e) => {
|
|
1536
|
-
onClick?.(e);
|
|
1537
|
-
close();
|
|
1538
|
-
};
|
|
1539
|
-
return /* @__PURE__ */ jsx(
|
|
1540
|
-
Button,
|
|
1541
|
-
{
|
|
1542
|
-
"aria-label": "Close drawer",
|
|
1543
|
-
"data-anv": "drawer-cancel-button",
|
|
1544
|
-
onClick: onClickHandler,
|
|
1545
|
-
ref,
|
|
1546
|
-
...rest
|
|
1547
|
-
}
|
|
1548
|
-
);
|
|
1549
|
-
});
|
|
1550
|
-
DrawerCancelButton.displayName = "DrawerCancelButton";
|
|
1551
|
-
|
|
1552
|
-
const DrawerHeader = forwardRef(
|
|
1553
|
-
(props, ref) => {
|
|
1554
|
-
const { className, children } = props;
|
|
1555
|
-
const drawerHeaderClasses = cx(styles$1.header, className);
|
|
1556
|
-
return /* @__PURE__ */ jsxs(
|
|
1557
|
-
"header",
|
|
1558
|
-
{
|
|
1559
|
-
className: drawerHeaderClasses,
|
|
1560
|
-
"data-anv": "drawer-header",
|
|
1561
|
-
ref,
|
|
1562
|
-
children: [
|
|
1563
|
-
/* @__PURE__ */ jsx(Text, { variant: "headline", el: "h1", children }),
|
|
1564
|
-
/* @__PURE__ */ jsx("span", { className: styles$1["close-container"], children: /* @__PURE__ */ jsx(
|
|
1565
|
-
DrawerCancelButton,
|
|
1566
|
-
{
|
|
1567
|
-
className: styles$1["close-button"],
|
|
1568
|
-
size: "small",
|
|
1569
|
-
appearance: "ghost",
|
|
1570
|
-
"aria-label": "Close drawer",
|
|
1571
|
-
"data-anv": "drawer-header-close-button",
|
|
1572
|
-
icon: SvgClose
|
|
1573
|
-
}
|
|
1574
|
-
) })
|
|
1575
|
-
]
|
|
1576
|
-
}
|
|
1577
|
-
);
|
|
1578
|
-
}
|
|
1579
|
-
);
|
|
1580
|
-
DrawerHeader.displayName = "DrawerHeader";
|
|
1581
|
-
|
|
1582
|
-
const DrawerFooter = forwardRef(
|
|
1583
|
-
(props, ref) => {
|
|
1584
|
-
const { className, children, sticky = false, ...rest } = props;
|
|
1585
|
-
const drawerFooterClasses = cx(styles$1.footer, className, {
|
|
1586
|
-
[styles$1["sticky"]]: sticky
|
|
1587
|
-
});
|
|
1588
|
-
return /* @__PURE__ */ jsx(
|
|
1589
|
-
"footer",
|
|
1590
|
-
{
|
|
1591
|
-
className: drawerFooterClasses,
|
|
1592
|
-
"data-anv": "drawer-footer",
|
|
1593
|
-
ref,
|
|
1594
|
-
...rest,
|
|
1595
|
-
children
|
|
1596
|
-
}
|
|
1597
|
-
);
|
|
1598
|
-
}
|
|
1599
|
-
);
|
|
1600
|
-
DrawerFooter.displayName = "DrawerFooter";
|
|
1601
|
-
|
|
1602
|
-
const DrawerContent = forwardRef(
|
|
1603
|
-
(props, ref) => {
|
|
1604
|
-
const { className, children, ...rest } = props;
|
|
1605
|
-
const drawerContentClasses = cx(styles$1.content, className);
|
|
1606
|
-
return /* @__PURE__ */ jsx(
|
|
1607
|
-
"div",
|
|
1608
|
-
{
|
|
1609
|
-
className: drawerContentClasses,
|
|
1610
|
-
"data-anv": "drawer-content",
|
|
1611
|
-
ref,
|
|
1612
|
-
...rest,
|
|
1613
|
-
children
|
|
1614
|
-
}
|
|
1615
|
-
);
|
|
1616
|
-
}
|
|
1617
|
-
);
|
|
1618
|
-
DrawerContent.displayName = "DrawerContent";
|
|
1619
|
-
|
|
1620
|
-
const DrawerContext = createContext(null);
|
|
1621
|
-
const DrawerElement = forwardRef(
|
|
1622
|
-
(props, ref) => {
|
|
1623
|
-
const {
|
|
1624
|
-
className,
|
|
1625
|
-
open = false,
|
|
1626
|
-
children,
|
|
1627
|
-
onOpen,
|
|
1628
|
-
onClose,
|
|
1629
|
-
/* eslint-disable-next-line @typescript-eslint/no-unused-vars --
|
|
1630
|
-
onCancel is destructured so that it is not passed to the dialog in ...rest
|
|
1631
|
-
*/
|
|
1632
|
-
onCancel,
|
|
1633
|
-
onKeyDown,
|
|
1634
|
-
disableCloseOnEscape = false,
|
|
1635
|
-
onClickOutside,
|
|
1636
|
-
disableCloseOnClickOutside = false,
|
|
1637
|
-
size = "medium",
|
|
1638
|
-
enableScrollChaining,
|
|
1639
|
-
onOpenAnimationStart,
|
|
1640
|
-
onOpenAnimationComplete,
|
|
1641
|
-
onCloseAnimationStart,
|
|
1642
|
-
onCloseAnimationComplete,
|
|
1643
|
-
...rest
|
|
1644
|
-
} = props;
|
|
1645
|
-
const elRef = useRef(null);
|
|
1646
|
-
const contentRef = useRef(null);
|
|
1647
|
-
const toasterRef = useRef(null);
|
|
1648
|
-
const combinedRef = useMergeRefs([elRef, ref]);
|
|
1649
|
-
const id = useId();
|
|
1650
|
-
const { state, isOpenOrOpening } = useDialogTransitionStates(elRef, open, {
|
|
1651
|
-
onOpenAnimationStart: useCallback(() => {
|
|
1652
|
-
onOpenAnimationStart?.();
|
|
1653
|
-
}, [onOpenAnimationStart]),
|
|
1654
|
-
onOpenAnimationComplete: useCallback(() => {
|
|
1655
|
-
onOpenAnimationComplete?.();
|
|
1656
|
-
onOpen?.();
|
|
1657
|
-
}, [onOpen, onOpenAnimationComplete]),
|
|
1658
|
-
onCloseAnimationStart: useCallback(() => {
|
|
1659
|
-
onCloseAnimationStart?.();
|
|
1660
|
-
}, [onCloseAnimationStart]),
|
|
1661
|
-
onCloseAnimationComplete: useCallback(() => {
|
|
1662
|
-
onCloseAnimationComplete?.();
|
|
1663
|
-
}, [onCloseAnimationComplete])
|
|
1664
|
-
});
|
|
1665
|
-
const classNames = cx([styles$1.drawer], className, {
|
|
1666
|
-
[styles$1.remove]: state === "closing",
|
|
1667
|
-
[styles$1.large]: size === "large"
|
|
1668
|
-
});
|
|
1669
|
-
const { focusables } = useKeyboardFocusables(contentRef, {
|
|
1670
|
-
observeChange: false
|
|
1671
|
-
});
|
|
1672
|
-
const firstFocusable = focusables?.[0];
|
|
1673
|
-
const lastFocusable = focusables?.[focusables.length - 1];
|
|
1674
|
-
useDialogScrollLock({
|
|
1675
|
-
open: isOpenOrOpening,
|
|
1676
|
-
id,
|
|
1677
|
-
enableScrollChaining,
|
|
1678
|
-
elementRef: elRef
|
|
1679
|
-
});
|
|
1680
|
-
useEffect(() => {
|
|
1681
|
-
if (!isOpenOrOpening) return;
|
|
1682
|
-
if (!focusables) return;
|
|
1683
|
-
const activeElement = getActiveElement(document);
|
|
1684
|
-
if (!activeElement) return;
|
|
1685
|
-
if (activeElement.dataset.anv !== "drawer-header-close-button" && (focusables.includes(activeElement) || activeElement.tagName === "DIALOG")) {
|
|
1686
|
-
return;
|
|
1687
|
-
}
|
|
1688
|
-
if (focusables[0]?.dataset.anv === "drawer-header-close-button" && focusables[1]) {
|
|
1689
|
-
focusables[1].focus();
|
|
1690
|
-
} else {
|
|
1691
|
-
focusables[0]?.focus();
|
|
1692
|
-
}
|
|
1693
|
-
}, [isOpenOrOpening, focusables]);
|
|
1694
|
-
const onCancelHandler = (e) => {
|
|
1695
|
-
e.preventDefault();
|
|
1696
|
-
if (disableCloseOnEscape) return;
|
|
1697
|
-
onClose?.();
|
|
1698
|
-
};
|
|
1699
|
-
useOnClickOutside({
|
|
1700
|
-
onOutsidePress: (e) => {
|
|
1701
|
-
if (!open) return;
|
|
1702
|
-
onClickOutside?.(e);
|
|
1703
|
-
},
|
|
1704
|
-
targets: [
|
|
1705
|
-
contentRef.current,
|
|
1706
|
-
toasterRef.current
|
|
1707
|
-
],
|
|
1708
|
-
onClose: () => {
|
|
1709
|
-
if (disableCloseOnClickOutside || !open) return;
|
|
1710
|
-
onClose?.();
|
|
1711
|
-
}
|
|
1712
|
-
});
|
|
1713
|
-
const onKeyDownHandler = (e) => {
|
|
1714
|
-
onKeyDown?.(e);
|
|
1715
|
-
if (e.code === "Tab") {
|
|
1716
|
-
if (e.shiftKey && e.target === firstFocusable) {
|
|
1717
|
-
e.preventDefault();
|
|
1718
|
-
lastFocusable?.focus();
|
|
1719
|
-
return;
|
|
1720
|
-
}
|
|
1721
|
-
if (e.target === lastFocusable && !e.shiftKey) {
|
|
1722
|
-
e.preventDefault();
|
|
1723
|
-
firstFocusable?.focus();
|
|
1724
|
-
return;
|
|
1725
|
-
}
|
|
1726
|
-
}
|
|
1727
|
-
};
|
|
1728
|
-
const contextValue = useMemo(() => {
|
|
1729
|
-
return { close: () => onClose?.() };
|
|
1730
|
-
}, [onClose]);
|
|
1731
|
-
return (
|
|
1732
|
-
// dialog element does seem to be interactive on MDN guideline
|
|
1733
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
1734
|
-
/* @__PURE__ */ jsxs(
|
|
1735
|
-
"dialog",
|
|
1736
|
-
{
|
|
1737
|
-
className: classNames,
|
|
1738
|
-
"data-anv": "drawer",
|
|
1739
|
-
"data-anv-scroll-chaining": enableScrollChaining,
|
|
1740
|
-
"data-anv-transition-state": state,
|
|
1741
|
-
ref: combinedRef,
|
|
1742
|
-
onCancel: onCancelHandler,
|
|
1743
|
-
onKeyDown: onKeyDownHandler,
|
|
1744
|
-
...rest,
|
|
1745
|
-
children: [
|
|
1746
|
-
/* @__PURE__ */ jsx(ToastProvider, { isDialogToaster: isOpenOrOpening, children: /* @__PURE__ */ jsx(ToasterPopover, { children: /* @__PURE__ */ jsx(ToasterContent, { id: "drawer-toaster", ref: toasterRef }) }) }),
|
|
1747
|
-
/* @__PURE__ */ jsx(DrawerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
1748
|
-
"section",
|
|
1749
|
-
{
|
|
1750
|
-
ref: contentRef,
|
|
1751
|
-
className: styles$1.container,
|
|
1752
|
-
"data-open": isOpenOrOpening,
|
|
1753
|
-
children
|
|
1754
|
-
}
|
|
1755
|
-
) })
|
|
1756
|
-
]
|
|
1757
|
-
}
|
|
1758
|
-
)
|
|
1759
|
-
);
|
|
1760
|
-
}
|
|
1761
|
-
);
|
|
1762
|
-
function useDrawerContext() {
|
|
1763
|
-
const context = useContext(DrawerContext);
|
|
1764
|
-
if (!context) {
|
|
1765
|
-
throw new Error(
|
|
1766
|
-
"useDrawerContext must be used within a DrawerContextProvider"
|
|
1767
|
-
);
|
|
1768
|
-
}
|
|
1769
|
-
return context;
|
|
1770
|
-
}
|
|
1771
|
-
DrawerElement.displayName = "Drawer";
|
|
1772
|
-
const Drawer = Object.assign(DrawerElement, {
|
|
1773
|
-
/**
|
|
1774
|
-
* Header component for the drawer that displays a title and close button.
|
|
1775
|
-
*
|
|
1776
|
-
* Features:
|
|
1777
|
-
* - Displays the drawer title as a headline
|
|
1778
|
-
* - Includes an accessible close button
|
|
1779
|
-
* - Sticky positioning at the top of the drawer
|
|
1780
|
-
* - Proper semantic HTML structure
|
|
1781
|
-
* - Accessible with proper ARIA attributes
|
|
1782
|
-
* - Consistent styling with the design system
|
|
1783
|
-
* - Automatic close functionality
|
|
1784
|
-
*
|
|
1785
|
-
* @example
|
|
1786
|
-
* <Drawer.Header>Settings</Drawer.Header>
|
|
1787
|
-
*/
|
|
1788
|
-
Header: DrawerHeader,
|
|
1789
|
-
/**
|
|
1790
|
-
* Footer component for the drawer that displays action buttons and controls.
|
|
1791
|
-
*
|
|
1792
|
-
* Features:
|
|
1793
|
-
* - Flexible layout for action buttons and controls
|
|
1794
|
-
* - Optional sticky positioning at the bottom
|
|
1795
|
-
* - Proper semantic HTML structure
|
|
1796
|
-
* - Accessible with proper ARIA attributes
|
|
1797
|
-
* - Consistent styling with the design system
|
|
1798
|
-
* - Supports all standard footer element props
|
|
1799
|
-
* - Responsive design that adapts to content
|
|
1800
|
-
*
|
|
1801
|
-
* @example
|
|
1802
|
-
* <Drawer.Footer sticky>
|
|
1803
|
-
* <Button onClick={handleSave}>Save</Button>
|
|
1804
|
-
* <Drawer.CancelButton>Cancel</Drawer.CancelButton>
|
|
1805
|
-
* </Drawer.Footer>
|
|
1806
|
-
*/
|
|
1807
|
-
Footer: DrawerFooter,
|
|
1808
|
-
/**
|
|
1809
|
-
* Content container for the drawer that holds the main content area.
|
|
1810
|
-
*
|
|
1811
|
-
* Features:
|
|
1812
|
-
* - Flexible content area with proper spacing
|
|
1813
|
-
* - Scrollable content when needed
|
|
1814
|
-
* - Proper semantic HTML structure
|
|
1815
|
-
* - Accessible with proper ARIA attributes
|
|
1816
|
-
* - Consistent styling with the design system
|
|
1817
|
-
* - Supports all standard div element props
|
|
1818
|
-
* - Responsive design that adapts to content
|
|
1819
|
-
* - Proper focus management
|
|
1820
|
-
*
|
|
1821
|
-
* @example
|
|
1822
|
-
* <Drawer.Content>
|
|
1823
|
-
* <p>This is the main content of the drawer.</p>
|
|
1824
|
-
* <p>It can contain any type of content.</p>
|
|
1825
|
-
* </Drawer.Content>
|
|
1826
|
-
*/
|
|
1827
|
-
Content: DrawerContent,
|
|
1828
|
-
/**
|
|
1829
|
-
* A button component that automatically closes the drawer when clicked.
|
|
1830
|
-
*
|
|
1831
|
-
* Features:
|
|
1832
|
-
* - Automatically closes the drawer when clicked
|
|
1833
|
-
* - Extends Button component functionality
|
|
1834
|
-
* - Accessible with proper ARIA attributes
|
|
1835
|
-
* - Consistent styling with the design system
|
|
1836
|
-
* - Supports all standard button props
|
|
1837
|
-
* - Proper focus management
|
|
1838
|
-
* - Can be used anywhere within the drawer context
|
|
1839
|
-
*
|
|
1840
|
-
* @example
|
|
1841
|
-
* <Drawer.CancelButton appearance="ghost" size="small">
|
|
1842
|
-
* Cancel
|
|
1843
|
-
* </Drawer.CancelButton>
|
|
1844
|
-
*/
|
|
1845
|
-
CancelButton: DrawerCancelButton
|
|
1846
|
-
});
|
|
1847
|
-
|
|
1848
|
-
const TooltipLegacyContent = forwardRef(function TooltipLegacyContent2({ style, className, ...props }, propRef) {
|
|
1849
|
-
const {
|
|
1850
|
-
context: floatingContext,
|
|
1851
|
-
theme,
|
|
1852
|
-
mode,
|
|
1853
|
-
root,
|
|
1854
|
-
...context
|
|
1855
|
-
} = useTooltipLegacyContext();
|
|
1856
|
-
const { root: portalRoot } = useContext(PortalProviderContext);
|
|
1857
|
-
const dialogContext = useContext(DialogContext);
|
|
1858
|
-
const drawerContext = useContext(DrawerContext);
|
|
1859
|
-
const id = useId();
|
|
1860
|
-
useDelayGroup(floatingContext, { id });
|
|
1861
|
-
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
1862
|
-
if (!floatingContext.open) return null;
|
|
1863
|
-
const contentCx = cx(styles$3["content-legacy"], className);
|
|
1864
|
-
return /* @__PURE__ */ jsx(
|
|
1865
|
-
FloatingPortal,
|
|
1866
|
-
{
|
|
1867
|
-
root: root ?? dialogContext?.ref?.current ?? drawerContext?.ref?.current ?? portalRoot ?? context.refs.reference,
|
|
1868
|
-
children: /* @__PURE__ */ jsx(ThemeProvider, { theme, mode, children: /* @__PURE__ */ jsxs(
|
|
1869
|
-
"div",
|
|
1870
|
-
{
|
|
1871
|
-
ref,
|
|
1872
|
-
className: contentCx,
|
|
1873
|
-
"data-anv": "tooltip-content",
|
|
1874
|
-
style: {
|
|
1875
|
-
...context.floatingStyles,
|
|
1876
|
-
...style
|
|
1877
|
-
},
|
|
1878
|
-
onBlur: () => context.setOpen(false),
|
|
1879
|
-
...context.getFloatingProps(props),
|
|
1880
|
-
children: [
|
|
1881
|
-
/* @__PURE__ */ jsx(
|
|
1882
|
-
FloatingArrow,
|
|
1883
|
-
{
|
|
1884
|
-
ref: context.arrowRef,
|
|
1885
|
-
context: floatingContext,
|
|
1886
|
-
className: styles$3["arrow-legacy"]
|
|
1887
|
-
}
|
|
1888
|
-
),
|
|
1889
|
-
props.children
|
|
1890
|
-
]
|
|
1891
|
-
}
|
|
1892
|
-
) })
|
|
1893
|
-
}
|
|
1894
|
-
);
|
|
1895
|
-
});
|
|
1896
|
-
|
|
1897
|
-
const TooltipContentElement = forwardRef(
|
|
1898
|
-
function TooltipContent2(props, ref) {
|
|
1899
|
-
const {
|
|
1900
|
-
children,
|
|
1901
|
-
className,
|
|
1902
|
-
style,
|
|
1903
|
-
onMouseEnter,
|
|
1904
|
-
onMouseLeave,
|
|
1905
|
-
onKeyDown,
|
|
1906
|
-
onFocus,
|
|
1907
|
-
onBlur,
|
|
1908
|
-
id,
|
|
1909
|
-
...rest
|
|
1910
|
-
} = props;
|
|
1911
|
-
const context = useTooltipContext();
|
|
1912
|
-
const { mode: currentMode } = useContext(ThemeProviderContext);
|
|
1913
|
-
const tooltipClassNames = cx(className, styles$4["content"]);
|
|
1914
|
-
const childrenRef = useRef(null);
|
|
1915
|
-
const focusItems = useRef();
|
|
1916
|
-
const combinedStyles = {
|
|
1917
|
-
...style,
|
|
1918
|
-
...context?.tooltip.style
|
|
1919
|
-
};
|
|
1920
|
-
const tooltipMode = currentMode === "dark" ? "light" : "dark";
|
|
1921
|
-
useLayoutEffect(() => {
|
|
1922
|
-
if (!childrenRef.current) return;
|
|
1923
|
-
const focusElements = getKeyboardFocusableElements(childrenRef.current);
|
|
1924
|
-
focusItems.current = focusElements;
|
|
1925
|
-
}, [childrenRef, children, context?.open]);
|
|
1926
|
-
useLayoutEffect(() => {
|
|
1927
|
-
if (id) {
|
|
1928
|
-
context?.tooltip.setId(id);
|
|
1929
|
-
}
|
|
1930
|
-
}, [id, context?.tooltip.setId, context?.tooltip]);
|
|
1931
|
-
const onMouseEnterHandler = (e) => {
|
|
1932
|
-
onMouseEnter?.(e);
|
|
1933
|
-
if (context?.controlled) return;
|
|
1934
|
-
context?.tooltip.show();
|
|
1935
|
-
};
|
|
1936
|
-
const onMouseLeaveHandler = (e) => {
|
|
1937
|
-
onMouseLeave?.(e);
|
|
1938
|
-
if (context?.controlled) return;
|
|
1939
|
-
context?.tooltip.close();
|
|
1940
|
-
};
|
|
1941
|
-
const onFocusHandler = (e) => {
|
|
1942
|
-
onFocus?.(e);
|
|
1943
|
-
if (context?.controlled) return;
|
|
1944
|
-
context?.tooltip.show();
|
|
1945
|
-
};
|
|
1946
|
-
const onBlurHandler = (e) => {
|
|
1947
|
-
onBlur?.(e);
|
|
1948
|
-
if (context?.controlled) return;
|
|
1949
|
-
context?.tooltip.close();
|
|
1950
|
-
};
|
|
1951
|
-
const onKeyDownHandler = (e) => {
|
|
1952
|
-
onKeyDown?.(e);
|
|
1953
|
-
if (!context?.open) return;
|
|
1954
|
-
if (e.code === "Escape") {
|
|
1955
|
-
context?.tooltip.close();
|
|
1956
|
-
}
|
|
1957
|
-
};
|
|
1958
|
-
const hasSimpleContent = typeof children === "string";
|
|
1959
|
-
const role = hasSimpleContent ? "tooltip" : "region";
|
|
1960
|
-
const tooltipWrapperRef = useMergeRefs([context?.tooltip.ref, ref]);
|
|
1961
|
-
return /* @__PURE__ */ jsxs(
|
|
1962
|
-
"div",
|
|
1963
|
-
{
|
|
1964
|
-
popover: context?.controlled ? "manual" : "auto",
|
|
1965
|
-
"data-anv": "tooltip-content",
|
|
1966
|
-
className: tooltipClassNames,
|
|
1967
|
-
ref: tooltipWrapperRef,
|
|
1968
|
-
style: combinedStyles,
|
|
1969
|
-
onMouseEnter: onMouseEnterHandler,
|
|
1970
|
-
onMouseLeave: onMouseLeaveHandler,
|
|
1971
|
-
onBlur: onBlurHandler,
|
|
1972
|
-
onFocus: onFocusHandler,
|
|
1973
|
-
role,
|
|
1974
|
-
id: context?.tooltip.id,
|
|
1975
|
-
...rest,
|
|
1976
|
-
children: [
|
|
1977
|
-
/* @__PURE__ */ jsx(
|
|
1978
|
-
"div",
|
|
1979
|
-
{
|
|
1980
|
-
className: styles$4.scroller,
|
|
1981
|
-
role: "presentation",
|
|
1982
|
-
tabIndex: -1,
|
|
1983
|
-
ref: childrenRef,
|
|
1984
|
-
onKeyDown: onKeyDownHandler,
|
|
1985
|
-
children: hasSimpleContent ? children : /* @__PURE__ */ jsx(ThemeProvider, { mode: tooltipMode, "data-anv": "tooltip-content-theme", children })
|
|
1986
|
-
},
|
|
1987
|
-
context?.tooltip.key
|
|
1988
|
-
),
|
|
1989
|
-
/* @__PURE__ */ jsx("span", { className: styles$4["arrow"], ref: context?.tooltip.arrowRef, children: /* @__PURE__ */ jsxs("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 14 14", children: [
|
|
1990
|
-
/* @__PURE__ */ jsx("path", { stroke: "none", d: "M0,0 H14 L7,7 Q7,7 7,7 Z" }),
|
|
1991
|
-
/* @__PURE__ */ jsx("clipPath", { id: ":r9:", children: /* @__PURE__ */ jsx("rect", { x: "0", y: "0", width: "14", height: "14" }) })
|
|
1992
|
-
] }) })
|
|
1993
|
-
]
|
|
1994
|
-
}
|
|
1995
|
-
);
|
|
1996
|
-
}
|
|
1997
|
-
);
|
|
1998
|
-
const TooltipContent = forwardRef(
|
|
1999
|
-
function TooltipContent3(props, ref) {
|
|
2000
|
-
if (!supportsPopover())
|
|
2001
|
-
return /* @__PURE__ */ jsx(TooltipLegacyContent, { ...props, ref });
|
|
2002
|
-
return /* @__PURE__ */ jsx(TooltipContentElement, { ...props, ref });
|
|
2003
|
-
}
|
|
2004
|
-
);
|
|
2005
|
-
|
|
2006
|
-
const TooltipLegacyTrigger = forwardRef(function TooltipLegacyTrigger2({ children, className, ...props }, propRef) {
|
|
2007
|
-
const context = useTooltipLegacyContext();
|
|
2008
|
-
const ref = useMergeRefs([context.refs.setReference, propRef]);
|
|
2009
|
-
const { "aria-describedby": ariaDescribedBy, ...restOfContextProps } = context.getReferenceProps(props);
|
|
2010
|
-
const child = cloneElement(children, {
|
|
2011
|
-
ref,
|
|
2012
|
-
"aria-describedby": ariaDescribedBy
|
|
2013
|
-
});
|
|
2014
|
-
return /* @__PURE__ */ jsx(
|
|
2015
|
-
"span",
|
|
2016
|
-
{
|
|
2017
|
-
ref,
|
|
2018
|
-
className: cx([styles$3["trigger-legacy"]], className),
|
|
2019
|
-
"data-anv": "tooltip-trigger",
|
|
2020
|
-
"data-state": context.open ? "open" : "closed",
|
|
2021
|
-
...restOfContextProps,
|
|
2022
|
-
children: child
|
|
2023
|
-
}
|
|
2024
|
-
);
|
|
2025
|
-
});
|
|
2026
|
-
|
|
2027
|
-
const INTERACTIVE_ELEMENTS = ["button", "a", "input", "textarea", "select"];
|
|
2028
|
-
function isNonInteractiveElement(element) {
|
|
2029
|
-
if (!isValidElement(element)) return false;
|
|
2030
|
-
const type = element.type;
|
|
2031
|
-
return typeof type === "string" && !INTERACTIVE_ELEMENTS.includes(type);
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
const TooltipTriggerElement = forwardRef(
|
|
2035
|
-
function TooltipTrigger2(props, propRef) {
|
|
2036
|
-
const { children, className, onKeyDown, onFocus, onBlur, ...rest } = props;
|
|
2037
|
-
const context = useTooltipContext();
|
|
2038
|
-
const childCanAcceptRef = useMemo(
|
|
2039
|
-
() => isValidElement(children) && children.type !== Fragment$1 && typeof children.type !== "function",
|
|
2040
|
-
[children]
|
|
2041
|
-
);
|
|
2042
|
-
const refs = useMergeRefs([children?.ref, context?.invoker.ref]);
|
|
2043
|
-
const childProps = useMemo(() => {
|
|
2044
|
-
const baseProps = {
|
|
2045
|
-
ref: refs,
|
|
2046
|
-
"aria-haspopup": context?.invoker["aria-haspopup"],
|
|
2047
|
-
"aria-details": context?.invoker["aria-details"],
|
|
2048
|
-
"data-state": context?.invoker["data-state"],
|
|
2049
|
-
"aria-describedby": context?.invoker["aria-describedby"]
|
|
2050
|
-
};
|
|
2051
|
-
if (isNonInteractiveElement(children)) {
|
|
2052
|
-
if (!("tabIndex" in (children.props || {}))) {
|
|
2053
|
-
baseProps.tabIndex = 0;
|
|
2054
|
-
}
|
|
2055
|
-
if (!("role" in (children.props || {}))) {
|
|
2056
|
-
baseProps.role = "button";
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
return baseProps;
|
|
2060
|
-
}, [context?.invoker, refs, children]);
|
|
2061
|
-
const child = childCanAcceptRef ? cloneElement(children, childProps) : /* @__PURE__ */ jsx("span", { ...childProps, children });
|
|
2062
|
-
const onKeyDownHandler = (e) => {
|
|
2063
|
-
onKeyDown?.(e);
|
|
2064
|
-
context?.invoker.onKeyDown(e);
|
|
2065
|
-
};
|
|
2066
|
-
const onFocusHandler = (e) => {
|
|
2067
|
-
onFocus?.(e);
|
|
2068
|
-
context?.invoker.onFocus();
|
|
2069
|
-
};
|
|
2070
|
-
const onBlurHandler = (e) => {
|
|
2071
|
-
onBlur?.(e);
|
|
2072
|
-
context?.invoker.onBlur();
|
|
2073
|
-
};
|
|
2074
|
-
useLayoutEffect(() => {
|
|
2075
|
-
const onMouseEnterHandler = () => {
|
|
2076
|
-
context?.invoker.onMouseEnter();
|
|
2077
|
-
};
|
|
2078
|
-
const onMouseLeaveHandler = () => {
|
|
2079
|
-
context?.invoker.onMouseLeave();
|
|
2080
|
-
};
|
|
2081
|
-
context?.invoker.ref.current?.addEventListener(
|
|
2082
|
-
"mouseleave",
|
|
2083
|
-
onMouseLeaveHandler
|
|
2084
|
-
);
|
|
2085
|
-
context?.invoker.ref.current?.addEventListener(
|
|
2086
|
-
"mouseenter",
|
|
2087
|
-
onMouseEnterHandler
|
|
2088
|
-
);
|
|
2089
|
-
return () => {
|
|
2090
|
-
context?.invoker.ref.current?.removeEventListener(
|
|
2091
|
-
"mouseleave",
|
|
2092
|
-
onMouseLeaveHandler
|
|
2093
|
-
);
|
|
2094
|
-
context?.invoker.ref.current?.removeEventListener(
|
|
2095
|
-
"mouseenter",
|
|
2096
|
-
onMouseEnterHandler
|
|
2097
|
-
);
|
|
2098
|
-
};
|
|
2099
|
-
}, [context?.invoker]);
|
|
2100
|
-
if (!supportsPopover()) return /* @__PURE__ */ jsx(TooltipLegacyTrigger, { ...props });
|
|
2101
|
-
return /* @__PURE__ */ jsx(
|
|
2102
|
-
"span",
|
|
2103
|
-
{
|
|
2104
|
-
className: cx([styles$4["trigger"]], className),
|
|
2105
|
-
"data-anv": "tooltip-trigger",
|
|
2106
|
-
ref: propRef,
|
|
2107
|
-
onKeyDown: onKeyDownHandler,
|
|
2108
|
-
onFocus: onFocusHandler,
|
|
2109
|
-
onBlur: onBlurHandler,
|
|
2110
|
-
role: "presentation",
|
|
2111
|
-
...rest,
|
|
2112
|
-
children: child
|
|
2113
|
-
}
|
|
2114
|
-
);
|
|
2115
|
-
}
|
|
2116
|
-
);
|
|
2117
|
-
const TooltipTrigger = forwardRef(
|
|
2118
|
-
function TooltipTrigger3(props, propRef) {
|
|
2119
|
-
if (!supportsPopover())
|
|
2120
|
-
return /* @__PURE__ */ jsx(TooltipLegacyTrigger, { ...props, ref: propRef });
|
|
2121
|
-
return /* @__PURE__ */ jsx(TooltipTriggerElement, { ...props, ref: propRef });
|
|
2122
|
-
}
|
|
2123
|
-
);
|
|
2124
|
-
|
|
2125
|
-
function useTooltipLegacy({
|
|
2126
|
-
defaultOpen = false,
|
|
2127
|
-
offset: offsetProp = 5,
|
|
2128
|
-
open: controlledOpen,
|
|
2129
|
-
placement = "top",
|
|
2130
|
-
fallbackPlacements,
|
|
2131
|
-
disableFlip,
|
|
2132
|
-
disableShift,
|
|
2133
|
-
root
|
|
2134
|
-
} = {}) {
|
|
2135
|
-
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
2136
|
-
const open = controlledOpen ?? uncontrolledOpen;
|
|
2137
|
-
const setOpen = setUncontrolledOpen;
|
|
2138
|
-
const { disableDelayGroup } = useTooltipLegacyGroup();
|
|
2139
|
-
useEffect(() => {
|
|
2140
|
-
if (!defaultOpen && !controlledOpen) {
|
|
2141
|
-
disableDelayGroup(true);
|
|
2142
|
-
}
|
|
2143
|
-
disableDelayGroup(false);
|
|
2144
|
-
}, [defaultOpen, controlledOpen, disableDelayGroup]);
|
|
2145
|
-
const arrowRef = useRef(null);
|
|
2146
|
-
const { delay } = useDelayGroupContext();
|
|
2147
|
-
const data = useFloating({
|
|
2148
|
-
placement,
|
|
2149
|
-
open,
|
|
2150
|
-
onOpenChange: setOpen,
|
|
2151
|
-
whileElementsMounted: autoUpdate,
|
|
2152
|
-
middleware: [
|
|
2153
|
-
offset(offsetProp),
|
|
2154
|
-
flip({
|
|
2155
|
-
crossAxis: !disableFlip ? placement.includes("-") : false,
|
|
2156
|
-
mainAxis: !disableFlip,
|
|
2157
|
-
fallbackAxisSideDirection: "start",
|
|
2158
|
-
fallbackPlacements,
|
|
2159
|
-
padding: 5
|
|
2160
|
-
}),
|
|
2161
|
-
shift({
|
|
2162
|
-
padding: 5,
|
|
2163
|
-
mainAxis: !disableShift,
|
|
2164
|
-
crossAxis: false,
|
|
2165
|
-
limiter: limitShift({
|
|
2166
|
-
mainAxis: !disableShift
|
|
2167
|
-
})
|
|
2168
|
-
}),
|
|
2169
|
-
arrow$1({ element: arrowRef, padding: 5 })
|
|
2170
|
-
]
|
|
2171
|
-
});
|
|
2172
|
-
const context = data.context;
|
|
2173
|
-
const hover = useHover(context, {
|
|
2174
|
-
move: false,
|
|
2175
|
-
handleClose: safePolygon(),
|
|
2176
|
-
delay
|
|
2177
|
-
});
|
|
2178
|
-
const focus = useFocus(context, {});
|
|
2179
|
-
const dismiss = useDismiss(context);
|
|
2180
|
-
const role = useRole(context, { role: "tooltip" });
|
|
2181
|
-
const interactions = useInteractions([hover, focus, dismiss, role]);
|
|
2182
|
-
return useMemo(
|
|
2183
|
-
() => ({
|
|
2184
|
-
open,
|
|
2185
|
-
setOpen,
|
|
2186
|
-
arrowRef,
|
|
2187
|
-
root,
|
|
2188
|
-
...interactions,
|
|
2189
|
-
...data
|
|
2190
|
-
}),
|
|
2191
|
-
[open, setOpen, interactions, data, root]
|
|
2192
|
-
);
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
|
-
function TooltipLegacyElement({
|
|
2196
|
-
children,
|
|
2197
|
-
...options
|
|
2198
|
-
}) {
|
|
2199
|
-
const tooltip = useTooltipLegacy(options);
|
|
2200
|
-
const { theme, mode } = useContext(ThemeProviderContext);
|
|
2201
|
-
const value = useMemo(
|
|
2202
|
-
() => ({ ...tooltip, theme, mode }),
|
|
2203
|
-
[mode, theme, tooltip]
|
|
2204
|
-
);
|
|
2205
|
-
return /* @__PURE__ */ jsx(TooltipLegacyContext.Provider, { value, children });
|
|
2206
|
-
}
|
|
2207
|
-
const TooltipLegacy = Object.assign(TooltipLegacyElement, {
|
|
2208
|
-
Trigger: TooltipLegacyTrigger,
|
|
2209
|
-
Content: TooltipLegacyContent
|
|
2210
|
-
});
|
|
2211
|
-
|
|
2212
|
-
const TooltipElement = (props) => {
|
|
2213
|
-
const {
|
|
2214
|
-
children,
|
|
2215
|
-
delay = 100,
|
|
2216
|
-
placement = "top",
|
|
2217
|
-
open,
|
|
2218
|
-
defaultOpen = false,
|
|
2219
|
-
disableShift,
|
|
2220
|
-
disableFlip,
|
|
2221
|
-
disableFlipFallback,
|
|
2222
|
-
id,
|
|
2223
|
-
offset: offsetProp = 5,
|
|
2224
|
-
fallbackPlacements,
|
|
2225
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2226
|
-
root
|
|
2227
|
-
} = props;
|
|
2228
|
-
const uid = useId();
|
|
2229
|
-
const [invoker, setInvoker] = useState(void 0);
|
|
2230
|
-
const [tooltip, setTooltip] = useState(void 0);
|
|
2231
|
-
const [rootNode, setRootNode] = useState();
|
|
2232
|
-
const [arrowElement, setArrowElement] = useState(void 0);
|
|
2233
|
-
const [openState, setOpenState] = useState(
|
|
2234
|
-
open ?? defaultOpen
|
|
2235
|
-
);
|
|
2236
|
-
const arrowRef = useRef(null);
|
|
2237
|
-
const [tooltipId, setTooltipId] = useState(
|
|
2238
|
-
id ?? `tooltip-${uid.replace(/:/g, "")}`
|
|
2239
|
-
);
|
|
2240
|
-
const updatePosition = useCallback(() => {
|
|
2241
|
-
if (!invoker || !tooltip) return;
|
|
2242
|
-
if (!openState) return;
|
|
2243
|
-
computePosition(invoker, tooltip, {
|
|
2244
|
-
placement,
|
|
2245
|
-
middleware: [
|
|
2246
|
-
offset(offsetProp),
|
|
2247
|
-
flip({
|
|
2248
|
-
mainAxis: !disableFlip,
|
|
2249
|
-
crossAxis: false,
|
|
2250
|
-
fallbackAxisSideDirection: disableFlipFallback ? "none" : "end",
|
|
2251
|
-
fallbackPlacements,
|
|
2252
|
-
padding: 5
|
|
2253
|
-
}),
|
|
2254
|
-
shift({
|
|
2255
|
-
padding: 5,
|
|
2256
|
-
mainAxis: !disableShift,
|
|
2257
|
-
crossAxis: false,
|
|
2258
|
-
limiter: limitShift({
|
|
2259
|
-
mainAxis: !disableShift
|
|
2260
|
-
})
|
|
2261
|
-
}),
|
|
2262
|
-
arrow$1({
|
|
2263
|
-
element: arrowElement ? arrowElement : null,
|
|
2264
|
-
padding: 5
|
|
2265
|
-
})
|
|
2266
|
-
]
|
|
2267
|
-
}).then(({ x, y, placement: placement2, middlewareData }) => {
|
|
2268
|
-
const side = placement2.split("-")[0];
|
|
2269
|
-
const staticSide = {
|
|
2270
|
-
top: "bottom",
|
|
2271
|
-
right: "left",
|
|
2272
|
-
bottom: "top",
|
|
2273
|
-
left: "right"
|
|
2274
|
-
}[side];
|
|
2275
|
-
const arrowDeg = () => {
|
|
2276
|
-
if (staticSide === "top") return 180;
|
|
2277
|
-
if (staticSide === "bottom") return 0;
|
|
2278
|
-
if (staticSide === "left") return 90;
|
|
2279
|
-
return 270;
|
|
2280
|
-
};
|
|
2281
|
-
Object.assign(tooltip.style, {
|
|
2282
|
-
left: `${x}px`,
|
|
2283
|
-
top: `${y}px`
|
|
2284
|
-
});
|
|
2285
|
-
if (middlewareData.arrow && arrowElement) {
|
|
2286
|
-
const { x: x2, y: y2 } = middlewareData.arrow;
|
|
2287
|
-
Object.assign(arrowElement.style, {
|
|
2288
|
-
left: x2 != null ? `${x2}px` : "",
|
|
2289
|
-
top: y2 != null ? `${y2}px` : "",
|
|
2290
|
-
right: "",
|
|
2291
|
-
bottom: "",
|
|
2292
|
-
[staticSide]: `${-arrowElement.offsetWidth + 2}px`,
|
|
2293
|
-
transform: `rotate(${arrowDeg()}deg)`
|
|
2294
|
-
});
|
|
2295
|
-
}
|
|
2296
|
-
});
|
|
2297
|
-
}, [
|
|
2298
|
-
invoker,
|
|
2299
|
-
tooltip,
|
|
2300
|
-
openState,
|
|
2301
|
-
placement,
|
|
2302
|
-
offsetProp,
|
|
2303
|
-
disableFlip,
|
|
2304
|
-
disableFlipFallback,
|
|
2305
|
-
fallbackPlacements,
|
|
2306
|
-
disableShift,
|
|
2307
|
-
arrowElement
|
|
2308
|
-
]);
|
|
2309
|
-
const resetKey = useRef(0);
|
|
2310
|
-
useLayoutEffect(() => {
|
|
2311
|
-
if (!tooltip || !invoker) return;
|
|
2312
|
-
if (!openState) {
|
|
2313
|
-
resetKey.current += 1;
|
|
2314
|
-
return;
|
|
2315
|
-
}
|
|
2316
|
-
let requestID = null;
|
|
2317
|
-
const cleanup = autoUpdate(invoker, tooltip, () => {
|
|
2318
|
-
requestID = requestAnimationFrame(updatePosition);
|
|
2319
|
-
});
|
|
2320
|
-
return () => {
|
|
2321
|
-
if (requestID) cancelAnimationFrame(requestID);
|
|
2322
|
-
cleanup();
|
|
2323
|
-
};
|
|
2324
|
-
}, [invoker, tooltip, updatePosition, openState]);
|
|
2325
|
-
const isControlled = typeof open !== "undefined";
|
|
2326
|
-
const openTimeoutRef = useRef(null);
|
|
2327
|
-
const closeTimeoutRef = useRef(null);
|
|
2328
|
-
const openTooltip = useCallback(() => {
|
|
2329
|
-
clearTimeout(closeTimeoutRef.current);
|
|
2330
|
-
clearTimeout(openTimeoutRef.current);
|
|
2331
|
-
if (!tooltip || !rootNode?.querySelector(`#${tooltipId}`)) return;
|
|
2332
|
-
openTimeoutRef.current = setTimeout(() => {
|
|
2333
|
-
safeShowPopover(tooltip);
|
|
2334
|
-
setOpenState(true);
|
|
2335
|
-
}, delay);
|
|
2336
|
-
}, [tooltip, rootNode, tooltipId, delay]);
|
|
2337
|
-
const closeTooltip = useCallback(
|
|
2338
|
-
(fn) => {
|
|
2339
|
-
clearTimeout(openTimeoutRef.current);
|
|
2340
|
-
clearTimeout(closeTimeoutRef.current);
|
|
2341
|
-
if (!tooltip || !openState) return;
|
|
2342
|
-
closeTimeoutRef.current = setTimeout(() => {
|
|
2343
|
-
fn?.();
|
|
2344
|
-
setOpenState(false);
|
|
2345
|
-
safeHidePopover(tooltip);
|
|
2346
|
-
}, 100);
|
|
2347
|
-
},
|
|
2348
|
-
[openState, tooltip]
|
|
2349
|
-
);
|
|
2350
|
-
const initialRender = useRef(true);
|
|
2351
|
-
useEffect(() => {
|
|
2352
|
-
if (initialRender.current === true) {
|
|
2353
|
-
if (openState) openTooltip();
|
|
2354
|
-
initialRender.current = false;
|
|
2355
|
-
return;
|
|
2356
|
-
}
|
|
2357
|
-
}, [openTooltip, openState, isControlled]);
|
|
2358
|
-
useEffect(() => {
|
|
2359
|
-
if (!isControlled) return;
|
|
2360
|
-
if (open) {
|
|
2361
|
-
openTooltip();
|
|
2362
|
-
} else {
|
|
2363
|
-
closeTooltip();
|
|
2364
|
-
}
|
|
2365
|
-
}, [closeTooltip, isControlled, open, openTooltip]);
|
|
2366
|
-
const value = useMemo(() => {
|
|
2367
|
-
updatePosition();
|
|
2368
|
-
return {
|
|
2369
|
-
tooltipId,
|
|
2370
|
-
setTooltipId,
|
|
2371
|
-
invoker,
|
|
2372
|
-
setInvoker,
|
|
2373
|
-
tooltip,
|
|
2374
|
-
setTooltip,
|
|
2375
|
-
arrowElement,
|
|
2376
|
-
setArrowElement,
|
|
2377
|
-
openTooltip,
|
|
2378
|
-
closeTooltip,
|
|
2379
|
-
placement,
|
|
2380
|
-
openState,
|
|
2381
|
-
setOpenState,
|
|
2382
|
-
disableFlipFallback,
|
|
2383
|
-
controlled: isControlled,
|
|
2384
|
-
arrowRef,
|
|
2385
|
-
resetKey: resetKey.current,
|
|
2386
|
-
rootNode,
|
|
2387
|
-
setRootNode
|
|
2388
|
-
};
|
|
2389
|
-
}, [
|
|
2390
|
-
updatePosition,
|
|
2391
|
-
tooltipId,
|
|
2392
|
-
setTooltipId,
|
|
2393
|
-
invoker,
|
|
2394
|
-
tooltip,
|
|
2395
|
-
arrowElement,
|
|
2396
|
-
openTooltip,
|
|
2397
|
-
closeTooltip,
|
|
2398
|
-
placement,
|
|
2399
|
-
openState,
|
|
2400
|
-
disableFlipFallback,
|
|
2401
|
-
isControlled,
|
|
2402
|
-
rootNode
|
|
2403
|
-
]);
|
|
2404
|
-
if (!supportsPopover()) return /* @__PURE__ */ jsx(TooltipLegacy, { ...props });
|
|
2405
|
-
return /* @__PURE__ */ jsx(TooltipContext.Provider, { value, children });
|
|
2406
|
-
};
|
|
2407
|
-
const Tooltip = Object.assign(TooltipElement, {
|
|
2408
|
-
/**
|
|
2409
|
-
* TooltipTrigger component that wraps the element that triggers the tooltip.
|
|
2410
|
-
*
|
|
2411
|
-
* Features:
|
|
2412
|
-
* - Wraps any React element to make it a tooltip trigger
|
|
2413
|
-
* - Handles mouse and keyboard interactions
|
|
2414
|
-
* - Provides proper ARIA attributes for accessibility
|
|
2415
|
-
* - Supports all standard HTML element props
|
|
2416
|
-
* - Automatically clones child elements with proper refs
|
|
2417
|
-
* - Handles both focusable and non-focusable children
|
|
2418
|
-
* - Manages mouse enter/leave events for hover behavior
|
|
2419
|
-
*
|
|
2420
|
-
* @example
|
|
2421
|
-
* <Tooltip.Trigger>
|
|
2422
|
-
* <Button>Click me</Button>
|
|
2423
|
-
* </Tooltip.Trigger>
|
|
2424
|
-
*/
|
|
2425
|
-
Trigger: TooltipTrigger,
|
|
2426
|
-
/**
|
|
2427
|
-
* TooltipContent component that displays the tooltip content.
|
|
2428
|
-
*
|
|
2429
|
-
* Features:
|
|
2430
|
-
* - Displays the tooltip content with proper positioning
|
|
2431
|
-
* - Includes an arrow pointing to the trigger element
|
|
2432
|
-
* - Supports keyboard navigation and escape key to close
|
|
2433
|
-
* - Handles mouse interactions for hover behavior
|
|
2434
|
-
* - Accessible with proper ARIA roles
|
|
2435
|
-
* - Supports all standard div element props
|
|
2436
|
-
* - Automatic focus management for keyboard navigation
|
|
2437
|
-
* - Real-time position updates
|
|
2438
|
-
* - Handles both string and complex content
|
|
2439
|
-
*
|
|
2440
|
-
* @example
|
|
2441
|
-
* <Tooltip.Content>
|
|
2442
|
-
* This tooltip provides helpful context
|
|
2443
|
-
* </Tooltip.Content>
|
|
2444
|
-
*/
|
|
2445
|
-
Content: TooltipContent,
|
|
2446
|
-
Context: TooltipContext
|
|
2447
|
-
});
|
|
2448
|
-
|
|
2449
|
-
const LabelMoreInfoIcon = ({
|
|
2450
|
-
moreInfo,
|
|
2451
|
-
openMoreInfo
|
|
2452
|
-
}) => {
|
|
2453
|
-
const [open, setOpen] = useState(openMoreInfo);
|
|
2454
|
-
useEffect(() => {
|
|
2455
|
-
if (openMoreInfo) {
|
|
2456
|
-
setOpen(true);
|
|
2457
|
-
} else {
|
|
2458
|
-
setOpen(false);
|
|
2459
|
-
setTimeout(() => {
|
|
2460
|
-
setOpen(void 0);
|
|
2461
|
-
});
|
|
2462
|
-
}
|
|
2463
|
-
}, [openMoreInfo]);
|
|
2464
|
-
return /* @__PURE__ */ jsxs(
|
|
2465
|
-
Tooltip,
|
|
2466
|
-
{
|
|
2467
|
-
open,
|
|
2468
|
-
placement: "top",
|
|
2469
|
-
offset: 5,
|
|
2470
|
-
fallbackPlacements: ["right", "bottom", "left"],
|
|
2471
|
-
children: [
|
|
2472
|
-
/* @__PURE__ */ jsx(Tooltip.Trigger, { className: styles$5["info-trigger"], children: /* @__PURE__ */ jsx(Icon, { svg: SvgInfo }) }),
|
|
2473
|
-
/* @__PURE__ */ jsx(Tooltip.Content, { className: styles$5["info-content"], children: moreInfo })
|
|
2474
|
-
]
|
|
2475
|
-
}
|
|
2476
|
-
);
|
|
2477
|
-
};
|
|
2478
|
-
const Label = forwardRef((props, ref) => {
|
|
2479
|
-
const { children, className, moreInfo, required, openMoreInfo, ...rest } = props;
|
|
2480
|
-
const LabelClassNames = cx([styles$5["label"]], className);
|
|
2481
|
-
return /* @__PURE__ */ jsxs("label", { className: LabelClassNames, "data-anv": "label", ref, ...rest, children: [
|
|
2482
|
-
/* @__PURE__ */ jsxs("div", { className: styles$5["top-container"], "aria-atomic": "true", children: [
|
|
2483
|
-
/* @__PURE__ */ jsxs("span", { className: styles$5["label-text"], children: [
|
|
2484
|
-
children,
|
|
2485
|
-
required ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2486
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: styles$5["required"], children: "*" }),
|
|
2487
|
-
/* @__PURE__ */ jsx(SrOnly, { children: "Required" })
|
|
2488
|
-
] }) : null
|
|
2489
|
-
] }),
|
|
2490
|
-
moreInfo ? /* @__PURE__ */ jsx(LabelMoreInfoIcon, { moreInfo, openMoreInfo }) : null
|
|
2491
|
-
] }),
|
|
2492
|
-
moreInfo ? /* @__PURE__ */ jsx(SrOnly, { children: moreInfo }) : null
|
|
2493
|
-
] });
|
|
2494
|
-
});
|
|
2495
|
-
Label.displayName = "Label";
|
|
2496
|
-
|
|
2497
|
-
const bar = "_bar_1lj98_23";
|
|
2498
|
-
const indeterminate = "_indeterminate_1lj98_1";
|
|
2499
|
-
const success = "_success_1lj98_66";
|
|
2500
|
-
const error = "_error_1lj98_52";
|
|
2501
|
-
const styles = {
|
|
2502
|
-
"progress-bar": "_progress-bar_1lj98_2",
|
|
2503
|
-
"bar-container": "_bar-container_1lj98_23",
|
|
2504
|
-
bar: bar,
|
|
2505
|
-
"check-icon": "_check-icon_1lj98_49",
|
|
2506
|
-
"error-icon": "_error-icon_1lj98_52",
|
|
2507
|
-
indeterminate: indeterminate,
|
|
2508
|
-
success: success,
|
|
2509
|
-
error: error
|
|
2510
|
-
};
|
|
2511
|
-
|
|
2512
|
-
const ProgressBar = forwardRef(
|
|
2513
|
-
(props, ref) => {
|
|
2514
|
-
const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
|
|
2515
|
-
const {
|
|
2516
|
-
className,
|
|
2517
|
-
style,
|
|
2518
|
-
value,
|
|
2519
|
-
children,
|
|
2520
|
-
indeterminate,
|
|
2521
|
-
errorAriaLive,
|
|
2522
|
-
description,
|
|
2523
|
-
error = false,
|
|
2524
|
-
max = 100,
|
|
2525
|
-
...mainProps
|
|
2526
|
-
} = componentProps;
|
|
2527
|
-
const styleCombined = {
|
|
2528
|
-
...style,
|
|
2529
|
-
...layoutStyles
|
|
2530
|
-
};
|
|
2531
|
-
const errorMessage = typeof error !== "boolean" ? error : void 0;
|
|
2532
|
-
const labelUid = useId();
|
|
2533
|
-
const isSuccess = typeof value !== "undefined" && +value === +max;
|
|
2534
|
-
if ("label" in props && !!props.label) {
|
|
2535
|
-
const { label, labelProps, ...rest } = mainProps;
|
|
2536
|
-
const ProgressBarClassNames2 = cx(
|
|
2537
|
-
[styles["progress-bar"]],
|
|
2538
|
-
className,
|
|
2539
|
-
{
|
|
2540
|
-
[styles[`error`]]: error,
|
|
2541
|
-
[styles[`success`]]: isSuccess
|
|
2542
|
-
}
|
|
2543
|
-
);
|
|
2544
|
-
return /* @__PURE__ */ jsxs(
|
|
2545
|
-
"div",
|
|
2546
|
-
{
|
|
2547
|
-
className: ProgressBarClassNames2,
|
|
2548
|
-
"data-anv": "progress-bar",
|
|
2549
|
-
style: styleCombined,
|
|
2550
|
-
ref,
|
|
2551
|
-
children: [
|
|
2552
|
-
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
|
|
2553
|
-
/* @__PURE__ */ jsx(Label, { id: labelUid, ...labelProps, children: label }),
|
|
2554
|
-
isSuccess && !error ? /* @__PURE__ */ jsx(Icon, { className: styles["check-icon"], svg: SvgCheckCircle }) : null,
|
|
2555
|
-
error ? /* @__PURE__ */ jsx(Icon, { className: styles["error-icon"], svg: SvgError }) : null
|
|
2556
|
-
] }),
|
|
2557
|
-
/* @__PURE__ */ jsx("div", { className: styles["bar-container"], children: /* @__PURE__ */ jsx(
|
|
2558
|
-
"progress",
|
|
2559
|
-
{
|
|
2560
|
-
"aria-labelledby": labelUid,
|
|
2561
|
-
className: styles["bar"],
|
|
2562
|
-
value,
|
|
2563
|
-
max,
|
|
2564
|
-
...rest
|
|
2565
|
-
}
|
|
2566
|
-
) }),
|
|
2567
|
-
errorMessage || description ? /* @__PURE__ */ jsx(
|
|
2568
|
-
Helper,
|
|
2569
|
-
{
|
|
2570
|
-
errorMessage,
|
|
2571
|
-
errorAriaLive,
|
|
2572
|
-
description
|
|
2573
|
-
}
|
|
2574
|
-
) : null
|
|
2575
|
-
]
|
|
2576
|
-
}
|
|
2577
|
-
);
|
|
2578
|
-
}
|
|
2579
|
-
const ProgressBarClassNames = cx([styles["progress-bar"]], className, {
|
|
2580
|
-
[styles[`error`]]: error,
|
|
2581
|
-
[styles[`success`]]: isSuccess
|
|
2582
|
-
});
|
|
2583
|
-
return /* @__PURE__ */ jsxs(
|
|
2584
|
-
"div",
|
|
2585
|
-
{
|
|
2586
|
-
className: ProgressBarClassNames,
|
|
2587
|
-
"data-anv": "progress-bar",
|
|
2588
|
-
style: styleCombined,
|
|
2589
|
-
ref,
|
|
2590
|
-
children: [
|
|
2591
|
-
/* @__PURE__ */ jsx("div", { className: styles["bar-container"], children: /* @__PURE__ */ jsx(
|
|
2592
|
-
"progress",
|
|
2593
|
-
{
|
|
2594
|
-
className: styles["bar"],
|
|
2595
|
-
max,
|
|
2596
|
-
value,
|
|
2597
|
-
...mainProps
|
|
2598
|
-
}
|
|
2599
|
-
) }),
|
|
2600
|
-
errorMessage || description ? /* @__PURE__ */ jsx(
|
|
2601
|
-
Helper,
|
|
2602
|
-
{
|
|
2603
|
-
errorMessage,
|
|
2604
|
-
errorAriaLive,
|
|
2605
|
-
description
|
|
2606
|
-
}
|
|
2607
|
-
) : null
|
|
2608
|
-
]
|
|
2609
|
-
}
|
|
2610
|
-
);
|
|
2611
|
-
}
|
|
2612
|
-
);
|
|
2613
|
-
ProgressBar.displayName = "ProgressBar";
|
|
2614
|
-
|
|
2615
|
-
export { DrawerCancelButton as D, Label as L, ProgressBar as P, TooltipTrigger as T, DrawerFooter as a, DrawerHeader as b, DrawerContent as c, Drawer as d, TooltipContent as e, Tooltip as f, getActiveElement as g, Toaster as h, DialogContext as i, useDialogTransitionStates as j, useDialogScrollLock as k, useOnClickOutside as l, ToastProvider as m, ToasterPopover as n, ToasterContent as o, DrawerContext as p, safeShowPopover as q, safeHidePopover as r, supportsPopover as s, toast as t, useKeyboardFocusables as u, useOpenCloseTransitionStates as v };
|
|
2616
|
-
//# sourceMappingURL=ProgressBar-BRvB-bD4-DppwBrFg.js.map
|