@gv-tech/ui-web 2.20.0 → 2.21.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/dist/accordion-BTF24dQU.js +1 -0
- package/dist/accordion-DHTV2Am8.mjs +221 -0
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +2 -18
- package/dist/accordion.mjs +3 -259
- package/dist/alert-dialog-Bwn2-Uyf.mjs +164 -0
- package/dist/alert-dialog-DBMX5E0-.js +7 -0
- package/dist/alert-dialog.cjs +1 -7
- package/dist/alert-dialog.d.ts +2 -43
- package/dist/alert-dialog.mjs +4 -171
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +2 -18
- package/dist/alert.mjs +35 -32
- package/dist/aspect-ratio-CFWobEnT.mjs +33 -0
- package/dist/aspect-ratio-D9dApiWv.js +1 -0
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +2 -10
- package/dist/aspect-ratio.mjs +3 -43
- package/dist/avatar-BI7s8omb.js +1 -0
- package/dist/avatar-hzlewncL.mjs +185 -0
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +2 -15
- package/dist/avatar.mjs +3 -205
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +2 -16
- package/dist/badge.mjs +21 -24
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +2 -35
- package/dist/breadcrumb.mjs +60 -68
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +2 -17
- package/dist/button.mjs +40 -40
- package/dist/calendar-DtFx4qdT.mjs +3148 -0
- package/dist/calendar-ykdYhTj9.js +1 -0
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +2 -29
- package/dist/calendar.mjs +4 -2976
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +2 -19
- package/dist/card.mjs +42 -32
- package/dist/carousel-DSmAn1nc.js +1 -0
- package/dist/carousel-PQJ97GjQ.mjs +1178 -0
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +2 -50
- package/dist/carousel.mjs +4 -1403
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +2 -60
- package/dist/chart.mjs +123 -182
- package/dist/checkbox-BOmSuATv.mjs +170 -0
- package/dist/checkbox-dK6DJKeV.js +1 -0
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +2 -10
- package/dist/checkbox.mjs +3 -258
- package/dist/chunk-BmowowmI.mjs +14 -0
- package/dist/chunk-mLOUI7ql.js +1 -0
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +2 -20
- package/dist/collapsible.mjs +6 -7
- package/dist/command-CDSbHz4C.js +1 -0
- package/dist/command-j0rZqZ7B.mjs +531 -0
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +2 -115
- package/dist/command.mjs +3 -396
- package/dist/context-menu-BWgLbKLP.js +1 -0
- package/dist/context-menu-CWSzssAO.mjs +292 -0
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +2 -80
- package/dist/context-menu.mjs +3 -328
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +2 -31
- package/dist/dialog.mjs +50 -66
- package/dist/dist--EFQaGUD.mjs +18 -0
- package/dist/dist-9gQKRtL7.mjs +73 -0
- package/dist/dist-B28N93_W.js +1 -0
- package/dist/dist-B43Kk7ii.js +1 -0
- package/dist/dist-BQOrag93.mjs +152 -0
- package/dist/dist-BTPL2C0R.js +1 -0
- package/dist/dist-BTlmz3JV.js +1 -0
- package/dist/dist-BjEG16aJ.mjs +111 -0
- package/dist/dist-Bjlzl0jN.mjs +38 -0
- package/dist/dist-BlKAvKHD.js +1 -0
- package/dist/dist-Bm8Cuttq.mjs +76 -0
- package/dist/dist-Byhx2fDJ.js +1 -0
- package/dist/dist-C3Z3atn0.mjs +10 -0
- package/dist/dist-C4q8IPk4.mjs +28 -0
- package/dist/dist-C5EZ0AD6.mjs +219 -0
- package/dist/dist-C9PlF532.mjs +5 -0
- package/dist/dist-CCokLFyA.mjs +10 -0
- package/dist/dist-CEJNUZGZ.js +1 -0
- package/dist/dist-CGgemr2V.js +1 -0
- package/dist/dist-CPglx4om.js +1 -0
- package/dist/dist-CRmJFaEL.mjs +95 -0
- package/dist/dist-CSkpam6a.js +1 -0
- package/dist/dist-CTaBktQl.mjs +557 -0
- package/dist/dist-CV2U2xFR.js +1 -0
- package/dist/dist-C_45sBzc.js +1 -0
- package/dist/dist-Cb7OVHcJ.js +1 -0
- package/dist/dist-Ccv5O-Vw.js +1 -0
- package/dist/dist-Cv9YaN1n.mjs +61 -0
- package/dist/dist-DAe-fOIM.mjs +25 -0
- package/dist/dist-DCKyUINZ.mjs +27 -0
- package/dist/dist-DGzGsPqo.mjs +6 -0
- package/dist/dist-DQAJMTj0.js +1 -0
- package/dist/dist-D_tuvB-W.mjs +61 -0
- package/dist/dist-DaCPM8ia.js +1 -0
- package/dist/dist-DasmYflz.js +1 -0
- package/dist/dist-DdVp13bp.mjs +66 -0
- package/dist/dist-Df2ez-DA.mjs +12 -0
- package/dist/dist-DneYUKe0.js +1 -0
- package/dist/dist-Doq7FY_P.js +1 -0
- package/dist/dist-Du2jbEkG.mjs +1282 -0
- package/dist/dist-DuTFGM_g.mjs +45 -0
- package/dist/dist-Dw6-GQAn.js +1 -0
- package/dist/dist-DwGlbIjj.js +5 -0
- package/dist/dist-DynSBUGq.js +1 -0
- package/dist/dist-Dzjlf9ug.js +1 -0
- package/dist/dist-GaBUW_Tu.js +1 -0
- package/dist/dist-N3JLy7yk.mjs +29 -0
- package/dist/dist-NIAlh3KC.js +1 -0
- package/dist/dist-_LAgxsbh.mjs +117 -0
- package/dist/dist-xgVOvcNx.mjs +11 -0
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +2 -65
- package/dist/drawer.mjs +48 -54
- package/dist/dropdown-menu-Bz5LlLjl.js +1 -0
- package/dist/dropdown-menu-Cp1qpOLk.mjs +288 -0
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +2 -80
- package/dist/dropdown-menu.mjs +3 -316
- package/dist/es2015-Ca60p53M.js +41 -0
- package/dist/es2015-DkZq_IIO.mjs +701 -0
- package/dist/form.cjs +1 -1
- package/dist/form.d.ts +2 -53
- package/dist/form.mjs +77 -68
- package/dist/hover-card-BOk3-K0k.mjs +167 -0
- package/dist/hover-card-CyKIuXGH.js +1 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +2 -19
- package/dist/hover-card.mjs +3 -188
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -1392
- package/dist/index.mjs +56 -296
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +2 -9
- package/dist/input.mjs +14 -19
- package/dist/label-DGuuPl_e.mjs +22 -0
- package/dist/label-gVkdll-j.js +1 -0
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +2 -11
- package/dist/label.mjs +3 -22
- package/dist/menubar-DNrIQhY5.mjs +410 -0
- package/dist/menubar-DkjAo6qJ.js +1 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +2 -79
- package/dist/menubar.mjs +3 -473
- package/dist/navigation-menu-1cmCEi0j.mjs +602 -0
- package/dist/navigation-menu-qPt8hpr5.js +1 -0
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts +2 -47
- package/dist/navigation-menu.mjs +3 -673
- package/dist/packages/ui-web/src/accordion.d.ts +10 -0
- package/dist/packages/ui-web/src/accordion.d.ts.map +1 -0
- package/dist/packages/ui-web/src/accordion.test.d.ts +2 -0
- package/dist/packages/ui-web/src/accordion.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/alert-dialog.d.ts +23 -0
- package/dist/packages/ui-web/src/alert-dialog.d.ts.map +1 -0
- package/dist/packages/ui-web/src/alert-dialog.test.d.ts +2 -0
- package/dist/packages/ui-web/src/alert-dialog.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/alert.d.ts +11 -0
- package/dist/packages/ui-web/src/alert.d.ts.map +1 -0
- package/dist/packages/ui-web/src/alert.test.d.ts +2 -0
- package/dist/packages/ui-web/src/alert.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/aspect-ratio.d.ts +6 -0
- package/dist/packages/ui-web/src/aspect-ratio.d.ts.map +1 -0
- package/dist/packages/ui-web/src/aspect-ratio.test.d.ts +2 -0
- package/dist/packages/ui-web/src/aspect-ratio.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/avatar.d.ts +9 -0
- package/dist/packages/ui-web/src/avatar.d.ts.map +1 -0
- package/dist/packages/ui-web/src/avatar.test.d.ts +2 -0
- package/dist/packages/ui-web/src/avatar.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/badge.d.ts +11 -0
- package/dist/packages/ui-web/src/badge.d.ts.map +1 -0
- package/dist/packages/ui-web/src/badge.test.d.ts +2 -0
- package/dist/packages/ui-web/src/badge.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/breadcrumb.d.ts +20 -0
- package/dist/packages/ui-web/src/breadcrumb.d.ts.map +1 -0
- package/dist/packages/ui-web/src/button.d.ts +13 -0
- package/dist/packages/ui-web/src/button.d.ts.map +1 -0
- package/dist/packages/ui-web/src/button.test.d.ts +2 -0
- package/dist/packages/ui-web/src/button.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/calendar.d.ts +11 -0
- package/dist/packages/ui-web/src/calendar.d.ts.map +1 -0
- package/dist/packages/ui-web/src/calendar.test.d.ts +2 -0
- package/dist/packages/ui-web/src/calendar.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/card.d.ts +12 -0
- package/dist/packages/ui-web/src/card.d.ts.map +1 -0
- package/dist/packages/ui-web/src/card.test.d.ts +2 -0
- package/dist/packages/ui-web/src/card.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/carousel.d.ts +24 -0
- package/dist/packages/ui-web/src/carousel.d.ts.map +1 -0
- package/dist/packages/ui-web/src/carousel.test.d.ts +2 -0
- package/dist/packages/ui-web/src/carousel.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/chart.d.ts +17 -0
- package/dist/packages/ui-web/src/chart.d.ts.map +1 -0
- package/dist/packages/ui-web/src/chart.test.d.ts +2 -0
- package/dist/packages/ui-web/src/chart.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/checkbox.d.ts +8 -0
- package/dist/packages/ui-web/src/checkbox.d.ts.map +1 -0
- package/dist/packages/ui-web/src/checkbox.test.d.ts +2 -0
- package/dist/packages/ui-web/src/checkbox.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/collapsible.d.ts +8 -0
- package/dist/packages/ui-web/src/collapsible.d.ts.map +1 -0
- package/dist/packages/ui-web/src/collapsible.test.d.ts +2 -0
- package/dist/packages/ui-web/src/collapsible.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/command.d.ts +83 -0
- package/dist/packages/ui-web/src/command.d.ts.map +1 -0
- package/dist/packages/ui-web/src/command.test.d.ts +2 -0
- package/dist/packages/ui-web/src/command.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/context-menu.d.ts +24 -0
- package/dist/packages/ui-web/src/context-menu.d.ts.map +1 -0
- package/dist/packages/ui-web/src/context-menu.test.d.ts +2 -0
- package/dist/packages/ui-web/src/context-menu.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/dialog.d.ts +20 -0
- package/dist/packages/ui-web/src/dialog.d.ts.map +1 -0
- package/dist/packages/ui-web/src/dialog.test.d.ts +2 -0
- package/dist/packages/ui-web/src/dialog.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/drawer.d.ts +25 -0
- package/dist/packages/ui-web/src/drawer.d.ts.map +1 -0
- package/dist/packages/ui-web/src/drawer.test.d.ts +2 -0
- package/dist/packages/ui-web/src/drawer.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/dropdown-menu.d.ts +24 -0
- package/dist/packages/ui-web/src/dropdown-menu.d.ts.map +1 -0
- package/dist/packages/ui-web/src/dropdown-menu.test.d.ts +2 -0
- package/dist/packages/ui-web/src/dropdown-menu.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/form.d.ts +26 -0
- package/dist/packages/ui-web/src/form.d.ts.map +1 -0
- package/dist/packages/ui-web/src/form.test.d.ts +2 -0
- package/dist/packages/ui-web/src/form.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/hooks/use-theme.d.ts +52 -0
- package/dist/packages/ui-web/src/hooks/use-theme.d.ts.map +1 -0
- package/dist/packages/ui-web/src/hooks/use-toast.d.ts +45 -0
- package/dist/packages/ui-web/src/hooks/use-toast.d.ts.map +1 -0
- package/dist/packages/ui-web/src/hover-card.d.ts +9 -0
- package/dist/packages/ui-web/src/hover-card.d.ts.map +1 -0
- package/dist/packages/ui-web/src/hover-card.test.d.ts +2 -0
- package/dist/packages/ui-web/src/hover-card.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/index.d.ts +108 -0
- package/dist/packages/ui-web/src/index.d.ts.map +1 -0
- package/dist/packages/ui-web/src/input.d.ts +7 -0
- package/dist/packages/ui-web/src/input.d.ts.map +1 -0
- package/dist/packages/ui-web/src/input.test.d.ts +2 -0
- package/dist/packages/ui-web/src/input.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/label.d.ts +8 -0
- package/dist/packages/ui-web/src/label.d.ts.map +1 -0
- package/dist/packages/ui-web/src/label.test.d.ts +2 -0
- package/dist/packages/ui-web/src/label.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/lib/utils.d.ts +4 -0
- package/dist/packages/ui-web/src/lib/utils.d.ts.map +1 -0
- package/dist/packages/ui-web/src/menubar.d.ts +25 -0
- package/dist/packages/ui-web/src/menubar.d.ts.map +1 -0
- package/dist/packages/ui-web/src/menubar.test.d.ts +2 -0
- package/dist/packages/ui-web/src/menubar.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/navigation-menu.d.ts +15 -0
- package/dist/packages/ui-web/src/navigation-menu.d.ts.map +1 -0
- package/dist/packages/ui-web/src/navigation-menu.test.d.ts +2 -0
- package/dist/packages/ui-web/src/navigation-menu.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/pagination.d.ts +31 -0
- package/dist/packages/ui-web/src/pagination.d.ts.map +1 -0
- package/dist/packages/ui-web/src/pagination.test.d.ts +2 -0
- package/dist/packages/ui-web/src/pagination.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/popover.d.ts +10 -0
- package/dist/packages/ui-web/src/popover.d.ts.map +1 -0
- package/dist/packages/ui-web/src/popover.test.d.ts +2 -0
- package/dist/packages/ui-web/src/popover.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/progress.d.ts +7 -0
- package/dist/packages/ui-web/src/progress.d.ts.map +1 -0
- package/dist/packages/ui-web/src/progress.test.d.ts +2 -0
- package/dist/packages/ui-web/src/progress.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/radio-group.d.ts +11 -0
- package/dist/packages/ui-web/src/radio-group.d.ts.map +1 -0
- package/dist/packages/ui-web/src/radio-group.test.d.ts +2 -0
- package/dist/packages/ui-web/src/radio-group.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/resizable.d.ts +9 -0
- package/dist/packages/ui-web/src/resizable.d.ts.map +1 -0
- package/dist/packages/ui-web/src/resizable.test.d.ts +2 -0
- package/dist/packages/ui-web/src/resizable.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/scroll-area.d.ts +8 -0
- package/dist/packages/ui-web/src/scroll-area.d.ts.map +1 -0
- package/dist/packages/ui-web/src/scroll-area.test.d.ts +2 -0
- package/dist/packages/ui-web/src/scroll-area.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/scroll-to-top.d.ts +8 -0
- package/dist/packages/ui-web/src/scroll-to-top.d.ts.map +1 -0
- package/dist/packages/ui-web/src/scroll-to-top.test.d.ts +2 -0
- package/dist/packages/ui-web/src/scroll-to-top.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/search.d.ts +8 -0
- package/dist/packages/ui-web/src/search.d.ts.map +1 -0
- package/dist/packages/ui-web/src/search.test.d.ts +2 -0
- package/dist/packages/ui-web/src/search.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/select.d.ts +16 -0
- package/dist/packages/ui-web/src/select.d.ts.map +1 -0
- package/dist/packages/ui-web/src/select.test.d.ts +2 -0
- package/dist/packages/ui-web/src/select.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/separator.d.ts +7 -0
- package/dist/packages/ui-web/src/separator.d.ts.map +1 -0
- package/dist/packages/ui-web/src/separator.test.d.ts +2 -0
- package/dist/packages/ui-web/src/separator.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/setupTests.d.ts +1 -0
- package/dist/packages/ui-web/src/setupTests.d.ts.map +1 -0
- package/dist/packages/ui-web/src/sheet.d.ts +28 -0
- package/dist/packages/ui-web/src/sheet.d.ts.map +1 -0
- package/dist/packages/ui-web/src/sheet.test.d.ts +2 -0
- package/dist/packages/ui-web/src/sheet.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/skeleton.d.ts +6 -0
- package/dist/packages/ui-web/src/skeleton.d.ts.map +1 -0
- package/dist/packages/ui-web/src/skeleton.test.d.ts +2 -0
- package/dist/packages/ui-web/src/skeleton.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/slider.d.ts +7 -0
- package/dist/packages/ui-web/src/slider.d.ts.map +1 -0
- package/dist/packages/ui-web/src/slider.test.d.ts +2 -0
- package/dist/packages/ui-web/src/slider.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/sonner.d.ts +8 -0
- package/dist/packages/ui-web/src/sonner.d.ts.map +1 -0
- package/dist/packages/ui-web/src/sonner.test.d.ts +2 -0
- package/dist/packages/ui-web/src/sonner.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/support-fab.d.ts +16 -0
- package/dist/packages/ui-web/src/support-fab.d.ts.map +1 -0
- package/dist/packages/ui-web/src/support-fab.test.d.ts +2 -0
- package/dist/packages/ui-web/src/support-fab.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/switch.d.ts +7 -0
- package/dist/packages/ui-web/src/switch.d.ts.map +1 -0
- package/dist/packages/ui-web/src/switch.test.d.ts +2 -0
- package/dist/packages/ui-web/src/switch.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/table-of-contents.d.ts +24 -0
- package/dist/packages/ui-web/src/table-of-contents.d.ts.map +1 -0
- package/dist/packages/ui-web/src/table-of-contents.test.d.ts +2 -0
- package/dist/packages/ui-web/src/table-of-contents.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/table.d.ts +13 -0
- package/dist/packages/ui-web/src/table.d.ts.map +1 -0
- package/dist/packages/ui-web/src/table.test.d.ts +2 -0
- package/dist/packages/ui-web/src/table.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/tabs.d.ts +10 -0
- package/dist/packages/ui-web/src/tabs.d.ts.map +1 -0
- package/dist/packages/ui-web/src/tabs.test.d.ts +2 -0
- package/dist/packages/ui-web/src/tabs.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/text.d.ts +12 -0
- package/dist/packages/ui-web/src/text.d.ts.map +1 -0
- package/dist/packages/ui-web/src/text.test.d.ts +2 -0
- package/dist/packages/ui-web/src/text.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/textarea.d.ts +7 -0
- package/dist/packages/ui-web/src/textarea.d.ts.map +1 -0
- package/dist/packages/ui-web/src/textarea.test.d.ts +2 -0
- package/dist/packages/ui-web/src/textarea.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/theme-provider.d.ts +5 -0
- package/dist/packages/ui-web/src/theme-provider.d.ts.map +1 -0
- package/dist/packages/ui-web/src/theme-toggle.d.ts +4 -0
- package/dist/packages/ui-web/src/theme-toggle.d.ts.map +1 -0
- package/dist/packages/ui-web/src/theme-toggle.test.d.ts +2 -0
- package/dist/packages/ui-web/src/theme-toggle.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/toast.d.ts +16 -0
- package/dist/packages/ui-web/src/toast.d.ts.map +1 -0
- package/dist/packages/ui-web/src/toast.test.d.ts +2 -0
- package/dist/packages/ui-web/src/toast.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/toaster.d.ts +3 -0
- package/dist/packages/ui-web/src/toaster.d.ts.map +1 -0
- package/dist/packages/ui-web/src/toggle-group.d.ts +13 -0
- package/dist/packages/ui-web/src/toggle-group.d.ts.map +1 -0
- package/dist/packages/ui-web/src/toggle-group.test.d.ts +2 -0
- package/dist/packages/ui-web/src/toggle-group.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/toggle.d.ts +9 -0
- package/dist/packages/ui-web/src/toggle.d.ts.map +1 -0
- package/dist/packages/ui-web/src/toggle.test.d.ts +2 -0
- package/dist/packages/ui-web/src/toggle.test.d.ts.map +1 -0
- package/dist/packages/ui-web/src/tooltip.d.ts +13 -0
- package/dist/packages/ui-web/src/tooltip.d.ts.map +1 -0
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +2 -68
- package/dist/pagination.mjs +63 -68
- package/dist/popover-CbM1tqdC.mjs +201 -0
- package/dist/popover-DGTgqdKX.js +1 -0
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +2 -24
- package/dist/popover.mjs +3 -242
- package/dist/progress-30ehxjKg.mjs +81 -0
- package/dist/progress-BqWHea4f.js +6 -0
- package/dist/progress.cjs +1 -6
- package/dist/progress.d.ts +2 -9
- package/dist/progress.mjs +3 -99
- package/dist/radio-group-BGThTiQM.mjs +193 -0
- package/dist/radio-group-ClFpAswm.js +1 -0
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.d.ts +2 -16
- package/dist/radio-group.mjs +3 -253
- package/dist/resizable-D09wr7tV.js +1 -0
- package/dist/resizable-DhOcAmNX.mjs +1533 -0
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +2 -22
- package/dist/resizable.mjs +3 -1990
- package/dist/scroll-area-DJcPs0_v.mjs +519 -0
- package/dist/scroll-area-W_aOLOdE.js +1 -0
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +2 -14
- package/dist/scroll-area.mjs +3 -546
- package/dist/scroll-to-top.cjs +1 -1
- package/dist/scroll-to-top.d.ts +2 -12
- package/dist/scroll-to-top.mjs +71 -84
- package/dist/search.cjs +1 -1
- package/dist/search.d.ts +2 -15
- package/dist/search.mjs +52 -63
- package/dist/select-BQtkQBiD.js +1 -0
- package/dist/select-D4bxRFq5.mjs +744 -0
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +2 -54
- package/dist/select.mjs +3 -908
- package/dist/separator-BmkhoDge.js +1 -0
- package/dist/separator-DZACUutC.mjs +31 -0
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +2 -9
- package/dist/separator.mjs +3 -35
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +2 -68
- package/dist/sheet.mjs +59 -66
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +2 -9
- package/dist/skeleton.mjs +12 -7
- package/dist/slider-Bkluwc3b.js +1 -0
- package/dist/slider-DTdrUy_s.mjs +366 -0
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +2 -9
- package/dist/slider.mjs +3 -442
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +2 -10
- package/dist/sonner.mjs +21 -24
- package/dist/support-fab.cjs +1 -1
- package/dist/support-fab.d.ts +2 -20
- package/dist/support-fab.mjs +81 -117
- package/dist/switch-DENAxyga.js +1 -0
- package/dist/switch-DbsdyQVg.mjs +103 -0
- package/dist/switch.cjs +1 -1
- package/dist/switch.d.ts +2 -9
- package/dist/switch.mjs +3 -149
- package/dist/table-of-contents.cjs +1 -1
- package/dist/table-of-contents.d.ts +2 -35
- package/dist/table-of-contents.mjs +159 -155
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +2 -43
- package/dist/table.mjs +57 -56
- package/dist/tabs-C9sMowgZ.mjs +136 -0
- package/dist/tabs-DeK-zpy4.js +1 -0
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +2 -24
- package/dist/tabs.mjs +3 -195
- package/dist/text.cjs +1 -1
- package/dist/text.d.ts +2 -17
- package/dist/text.mjs +41 -42
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts +2 -9
- package/dist/textarea.mjs +13 -18
- package/dist/theme-provider.cjs +1 -1
- package/dist/theme-provider.d.ts +2 -9
- package/dist/theme-provider.mjs +14 -7
- package/dist/theme-toggle-DAHBgdy0.mjs +64 -0
- package/dist/theme-toggle-Dtze9fyN.js +1 -0
- package/dist/theme-toggle.cjs +1 -1
- package/dist/theme-toggle.d.ts +2 -8
- package/dist/theme-toggle.mjs +3 -8
- package/dist/toast-BtXY2QTe.js +1 -0
- package/dist/toast-G9LdgDDE.mjs +427 -0
- package/dist/toast.cjs +1 -1
- package/dist/toast.d.ts +2 -26
- package/dist/toast.mjs +3 -494
- package/dist/toaster-CKD4CKAZ.js +1 -0
- package/dist/toaster-WQJjavlc.mjs +125 -0
- package/dist/toaster.cjs +1 -1
- package/dist/toaster.d.ts +2 -6
- package/dist/toaster.mjs +3 -6
- package/dist/toggle-group-B0H9TwdD.mjs +155 -0
- package/dist/toggle-group-CAyztsIl.js +1 -0
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +2 -18
- package/dist/toggle-group.mjs +3 -170
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.d.ts +2 -14
- package/dist/toggle.mjs +19 -14
- package/dist/tooltip-BHEcM7lO.mjs +364 -0
- package/dist/tooltip-CKcMl7tK.js +1 -0
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +2 -25
- package/dist/tooltip.mjs +3 -342
- package/dist/utils-A_oVsYw5.mjs +11 -0
- package/dist/utils-ChMUqofy.js +1 -0
- package/package.json +2 -2
- package/src/chart.tsx +7 -7
- package/src/setupTests.ts +5 -4
- package/dist/index-0ioNhtNM.mjs +0 -10
- package/dist/index-3j-XAIXT.mjs +0 -55
- package/dist/index-B2XtpfGY.js +0 -1
- package/dist/index-B39Lzq0v.js +0 -1
- package/dist/index-B7n6fy75.js +0 -1
- package/dist/index-B8dxbSWX.js +0 -41
- package/dist/index-BGIK9FQF.js +0 -1
- package/dist/index-BZPx6jYI.mjs +0 -8
- package/dist/index-BoNjHhm4.js +0 -1
- package/dist/index-BtZvtDmp.js +0 -1
- package/dist/index-Bv7qrYW6.mjs +0 -180
- package/dist/index-ByiPJW53.js +0 -5
- package/dist/index-C0dlIQIi.js +0 -1
- package/dist/index-C1qb0595.mjs +0 -27
- package/dist/index-C7HEunrh.mjs +0 -15
- package/dist/index-C8ni3LLa.js +0 -1
- package/dist/index-CCKe-Mpx.mjs +0 -6
- package/dist/index-CD6_IrA-.mjs +0 -10
- package/dist/index-CRyCZJLa.mjs +0 -677
- package/dist/index-CVx1AgNG.mjs +0 -615
- package/dist/index-Ce5TOFAK.js +0 -1
- package/dist/index-CeSLNJ60.mjs +0 -32
- package/dist/index-CefEQe_4.js +0 -1
- package/dist/index-Cj5hzyBi.js +0 -1
- package/dist/index-Cjj_rUPu.js +0 -1
- package/dist/index-Cl3G0jzM.js +0 -1
- package/dist/index-CwfE56Ep.mjs +0 -1545
- package/dist/index-CwyAfCwY.js +0 -1
- package/dist/index-CzY-WZXL.js +0 -1
- package/dist/index-D2HnlO3y.js +0 -1
- package/dist/index-DFdF7K7v.mjs +0 -50
- package/dist/index-DIsg7zU7.js +0 -1
- package/dist/index-DKN_vhyX.mjs +0 -32
- package/dist/index-DLcqcWxM.mjs +0 -29
- package/dist/index-DSxf1gN6.mjs +0 -118
- package/dist/index-DYxWvftI.js +0 -1
- package/dist/index-DaILh3TV.mjs +0 -32
- package/dist/index-Dfzl8TxY.mjs +0 -136
- package/dist/index-Dko2XdTk.js +0 -1
- package/dist/index-DlY82G31.mjs +0 -245
- package/dist/index-DnFcfnA9.mjs +0 -13
- package/dist/index-IZ2gq03c.mjs +0 -68
- package/dist/index-K9FzbxYw.mjs +0 -93
- package/dist/index-Le8p9oP4.mjs +0 -60
- package/dist/index-MQ0c3ZX_.js +0 -1
- package/dist/index-_XxjJPRD.js +0 -1
- package/dist/index-_wdrnYim.js +0 -1
- package/dist/index-jv3B4mTd.js +0 -1
- package/dist/index-kaM0u2Q1.js +0 -1
- package/dist/index-p6xVFRb4.mjs +0 -52
- package/dist/index-rKs9bXHr.mjs +0 -6
- package/dist/index-vuPgkS0V.mjs +0 -70
- package/dist/jsx-runtime-nZSsnGb7.js +0 -6
- package/dist/jsx-runtime-tc70JA_2.mjs +0 -264
- package/dist/theme-toggle-DXQGNfCe.js +0 -1
- package/dist/theme-toggle-tHXIbr8W.mjs +0 -79
- package/dist/toaster-C_S9hnXa.js +0 -1
- package/dist/toaster-k5DnQSsh.mjs +0 -118
- package/dist/utils-DY6fhrgS.mjs +0 -12
- package/dist/utils-cdbZV8DZ.js +0 -1
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { t as e } from "./utils-A_oVsYw5.mjs";
|
|
2
|
+
import { n as t } from "./dist-Bm8Cuttq.mjs";
|
|
3
|
+
import { n } from "./dist-DAe-fOIM.mjs";
|
|
4
|
+
import { n as r, r as i, t as a } from "./dist-BjEG16aJ.mjs";
|
|
5
|
+
import { t as o } from "./dist-D_tuvB-W.mjs";
|
|
6
|
+
import { t as s } from "./dist-C9PlF532.mjs";
|
|
7
|
+
import { t as c } from "./dist-DuTFGM_g.mjs";
|
|
8
|
+
import { t as l } from "./dist-DdVp13bp.mjs";
|
|
9
|
+
import { t as u } from "./dist-CCokLFyA.mjs";
|
|
10
|
+
import { r as d, t as f } from "./dist-_LAgxsbh.mjs";
|
|
11
|
+
import { t as p } from "./dist--EFQaGUD.mjs";
|
|
12
|
+
import { r as m } from "./dist-DCKyUINZ.mjs";
|
|
13
|
+
import * as h from "react";
|
|
14
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
15
|
+
import * as y from "react-dom";
|
|
16
|
+
import { X as b } from "lucide-react";
|
|
17
|
+
import { cva as x } from "class-variance-authority";
|
|
18
|
+
//#region ../../node_modules/.bun/@radix-ui+react-toast@1.2.15+2d3f272c3a65784a/node_modules/@radix-ui/react-toast/dist/index.mjs
|
|
19
|
+
var S = "ToastProvider", [C, ee, w] = o("Toast"), [T, E] = t("Toast", [w]), [D, O] = T(S), k = (e) => {
|
|
20
|
+
let { __scopeToast: t, label: n = "Notification", duration: r = 5e3, swipeDirection: i = "right", swipeThreshold: a = 50, children: o } = e, [s, c] = h.useState(null), [l, u] = h.useState(0), d = h.useRef(!1), f = h.useRef(!1);
|
|
21
|
+
return n.trim() || console.error(`Invalid prop \`label\` supplied to \`${S}\`. Expected non-empty \`string\`.`), /* @__PURE__ */ _(C.Provider, {
|
|
22
|
+
scope: t,
|
|
23
|
+
children: /* @__PURE__ */ _(D, {
|
|
24
|
+
scope: t,
|
|
25
|
+
label: n,
|
|
26
|
+
duration: r,
|
|
27
|
+
swipeDirection: i,
|
|
28
|
+
swipeThreshold: a,
|
|
29
|
+
toastCount: l,
|
|
30
|
+
viewport: s,
|
|
31
|
+
onViewportChange: c,
|
|
32
|
+
onToastAdd: h.useCallback(() => u((e) => e + 1), []),
|
|
33
|
+
onToastRemove: h.useCallback(() => u((e) => e - 1), []),
|
|
34
|
+
isFocusedToastEscapeKeyDownRef: d,
|
|
35
|
+
isClosePausedRef: f,
|
|
36
|
+
children: o
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
k.displayName = S;
|
|
41
|
+
var A = "ToastViewport", j = ["F8"], M = "toast.viewportPause", N = "toast.viewportResume", P = h.forwardRef((e, t) => {
|
|
42
|
+
let { __scopeToast: r, hotkey: i = j, label: o = "Notifications ({hotkey})", ...s } = e, c = O(A, r), l = ee(r), u = h.useRef(null), d = h.useRef(null), p = h.useRef(null), m = h.useRef(null), g = n(t, m, c.onViewportChange), y = i.join("+").replace(/Key/g, "").replace(/Digit/g, ""), b = c.toastCount > 0;
|
|
43
|
+
h.useEffect(() => {
|
|
44
|
+
let e = (e) => {
|
|
45
|
+
i.length !== 0 && i.every((t) => e[t] || e.code === t) && m.current?.focus();
|
|
46
|
+
};
|
|
47
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
48
|
+
}, [i]), h.useEffect(() => {
|
|
49
|
+
let e = u.current, t = m.current;
|
|
50
|
+
if (b && e && t) {
|
|
51
|
+
let n = () => {
|
|
52
|
+
if (!c.isClosePausedRef.current) {
|
|
53
|
+
let e = new CustomEvent(M);
|
|
54
|
+
t.dispatchEvent(e), c.isClosePausedRef.current = !0;
|
|
55
|
+
}
|
|
56
|
+
}, r = () => {
|
|
57
|
+
if (c.isClosePausedRef.current) {
|
|
58
|
+
let e = new CustomEvent(N);
|
|
59
|
+
t.dispatchEvent(e), c.isClosePausedRef.current = !1;
|
|
60
|
+
}
|
|
61
|
+
}, i = (t) => {
|
|
62
|
+
e.contains(t.relatedTarget) || r();
|
|
63
|
+
}, a = () => {
|
|
64
|
+
e.contains(document.activeElement) || r();
|
|
65
|
+
};
|
|
66
|
+
return e.addEventListener("focusin", n), e.addEventListener("focusout", i), e.addEventListener("pointermove", n), e.addEventListener("pointerleave", a), window.addEventListener("blur", n), window.addEventListener("focus", r), () => {
|
|
67
|
+
e.removeEventListener("focusin", n), e.removeEventListener("focusout", i), e.removeEventListener("pointermove", n), e.removeEventListener("pointerleave", a), window.removeEventListener("blur", n), window.removeEventListener("focus", r);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}, [b, c.isClosePausedRef]);
|
|
71
|
+
let x = h.useCallback(({ tabbingDirection: e }) => {
|
|
72
|
+
let t = l().map((t) => {
|
|
73
|
+
let n = t.ref.current, r = [n, ...le(n)];
|
|
74
|
+
return e === "forwards" ? r : r.reverse();
|
|
75
|
+
});
|
|
76
|
+
return (e === "forwards" ? t.reverse() : t).flat();
|
|
77
|
+
}, [l]);
|
|
78
|
+
return h.useEffect(() => {
|
|
79
|
+
let e = m.current;
|
|
80
|
+
if (e) {
|
|
81
|
+
let t = (t) => {
|
|
82
|
+
let n = t.altKey || t.ctrlKey || t.metaKey;
|
|
83
|
+
if (t.key === "Tab" && !n) {
|
|
84
|
+
let n = document.activeElement, r = t.shiftKey;
|
|
85
|
+
if (t.target === e && r) {
|
|
86
|
+
d.current?.focus();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
let i = x({ tabbingDirection: r ? "backwards" : "forwards" }), a = i.findIndex((e) => e === n);
|
|
90
|
+
$(i.slice(a + 1)) ? t.preventDefault() : r ? d.current?.focus() : p.current?.focus();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
94
|
+
}
|
|
95
|
+
}, [l, x]), /* @__PURE__ */ v(f, {
|
|
96
|
+
ref: u,
|
|
97
|
+
role: "region",
|
|
98
|
+
"aria-label": o.replace("{hotkey}", y),
|
|
99
|
+
tabIndex: -1,
|
|
100
|
+
style: { pointerEvents: b ? void 0 : "none" },
|
|
101
|
+
children: [
|
|
102
|
+
b && /* @__PURE__ */ _(I, {
|
|
103
|
+
ref: d,
|
|
104
|
+
onFocusFromOutsideViewport: () => {
|
|
105
|
+
$(x({ tabbingDirection: "forwards" }));
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ _(C.Slot, {
|
|
109
|
+
scope: r,
|
|
110
|
+
children: /* @__PURE__ */ _(a.ol, {
|
|
111
|
+
tabIndex: -1,
|
|
112
|
+
...s,
|
|
113
|
+
ref: g
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
b && /* @__PURE__ */ _(I, {
|
|
117
|
+
ref: p,
|
|
118
|
+
onFocusFromOutsideViewport: () => {
|
|
119
|
+
$(x({ tabbingDirection: "backwards" }));
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
P.displayName = A;
|
|
126
|
+
var F = "ToastFocusProxy", I = h.forwardRef((e, t) => {
|
|
127
|
+
let { __scopeToast: n, onFocusFromOutsideViewport: r, ...i } = e, a = O(F, n);
|
|
128
|
+
return /* @__PURE__ */ _(m, {
|
|
129
|
+
tabIndex: 0,
|
|
130
|
+
...i,
|
|
131
|
+
ref: t,
|
|
132
|
+
style: { position: "fixed" },
|
|
133
|
+
onFocus: (e) => {
|
|
134
|
+
let t = e.relatedTarget;
|
|
135
|
+
a.viewport?.contains(t) || r();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
I.displayName = F;
|
|
140
|
+
var L = "Toast", te = "toast.swipeStart", ne = "toast.swipeMove", re = "toast.swipeCancel", ie = "toast.swipeEnd", R = h.forwardRef((e, t) => {
|
|
141
|
+
let { forceMount: n, open: r, defaultOpen: a, onOpenChange: o, ...s } = e, [d, f] = c({
|
|
142
|
+
prop: r,
|
|
143
|
+
defaultProp: a ?? !0,
|
|
144
|
+
onChange: o,
|
|
145
|
+
caller: L
|
|
146
|
+
});
|
|
147
|
+
return /* @__PURE__ */ _(l, {
|
|
148
|
+
present: n || d,
|
|
149
|
+
children: /* @__PURE__ */ _(B, {
|
|
150
|
+
open: d,
|
|
151
|
+
...s,
|
|
152
|
+
ref: t,
|
|
153
|
+
onClose: () => f(!1),
|
|
154
|
+
onPause: u(e.onPause),
|
|
155
|
+
onResume: u(e.onResume),
|
|
156
|
+
onSwipeStart: i(e.onSwipeStart, (e) => {
|
|
157
|
+
e.currentTarget.setAttribute("data-swipe", "start");
|
|
158
|
+
}),
|
|
159
|
+
onSwipeMove: i(e.onSwipeMove, (e) => {
|
|
160
|
+
let { x: t, y: n } = e.detail.delta;
|
|
161
|
+
e.currentTarget.setAttribute("data-swipe", "move"), e.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${t}px`), e.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${n}px`);
|
|
162
|
+
}),
|
|
163
|
+
onSwipeCancel: i(e.onSwipeCancel, (e) => {
|
|
164
|
+
e.currentTarget.setAttribute("data-swipe", "cancel"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), e.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
165
|
+
}),
|
|
166
|
+
onSwipeEnd: i(e.onSwipeEnd, (e) => {
|
|
167
|
+
let { x: t, y: n } = e.detail.delta;
|
|
168
|
+
e.currentTarget.setAttribute("data-swipe", "end"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), e.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), e.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${t}px`), e.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${n}px`), f(!1);
|
|
169
|
+
})
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
R.displayName = L;
|
|
174
|
+
var [ae, z] = T(L, { onClose() {} }), B = h.forwardRef((e, t) => {
|
|
175
|
+
let { __scopeToast: r, type: o = "foreground", duration: s, open: c, onClose: l, onEscapeKeyDown: f, onPause: p, onResume: m, onSwipeStart: b, onSwipeMove: x, onSwipeCancel: S, onSwipeEnd: ee, ...w } = e, T = O(L, r), [E, D] = h.useState(null), k = n(t, (e) => D(e)), A = h.useRef(null), j = h.useRef(null), P = s || T.duration, F = h.useRef(0), I = h.useRef(P), R = h.useRef(0), { onToastAdd: z, onToastRemove: B } = T, V = u(() => {
|
|
176
|
+
E?.contains(document.activeElement) && T.viewport?.focus(), l();
|
|
177
|
+
}), H = h.useCallback((e) => {
|
|
178
|
+
!e || e === Infinity || (window.clearTimeout(R.current), F.current = (/* @__PURE__ */ new Date()).getTime(), R.current = window.setTimeout(V, e));
|
|
179
|
+
}, [V]);
|
|
180
|
+
h.useEffect(() => {
|
|
181
|
+
let e = T.viewport;
|
|
182
|
+
if (e) {
|
|
183
|
+
let t = () => {
|
|
184
|
+
H(I.current), m?.();
|
|
185
|
+
}, n = () => {
|
|
186
|
+
let e = (/* @__PURE__ */ new Date()).getTime() - F.current;
|
|
187
|
+
I.current -= e, window.clearTimeout(R.current), p?.();
|
|
188
|
+
};
|
|
189
|
+
return e.addEventListener(M, n), e.addEventListener(N, t), () => {
|
|
190
|
+
e.removeEventListener(M, n), e.removeEventListener(N, t);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}, [
|
|
194
|
+
T.viewport,
|
|
195
|
+
P,
|
|
196
|
+
p,
|
|
197
|
+
m,
|
|
198
|
+
H
|
|
199
|
+
]), h.useEffect(() => {
|
|
200
|
+
c && !T.isClosePausedRef.current && H(P);
|
|
201
|
+
}, [
|
|
202
|
+
c,
|
|
203
|
+
P,
|
|
204
|
+
T.isClosePausedRef,
|
|
205
|
+
H
|
|
206
|
+
]), h.useEffect(() => (z(), () => B()), [z, B]);
|
|
207
|
+
let U = h.useMemo(() => E ? X(E) : null, [E]);
|
|
208
|
+
return T.viewport ? /* @__PURE__ */ v(g, { children: [U && /* @__PURE__ */ _(oe, {
|
|
209
|
+
__scopeToast: r,
|
|
210
|
+
role: "status",
|
|
211
|
+
"aria-live": o === "foreground" ? "assertive" : "polite",
|
|
212
|
+
children: U
|
|
213
|
+
}), /* @__PURE__ */ _(ae, {
|
|
214
|
+
scope: r,
|
|
215
|
+
onClose: V,
|
|
216
|
+
children: y.createPortal(/* @__PURE__ */ _(C.ItemSlot, {
|
|
217
|
+
scope: r,
|
|
218
|
+
children: /* @__PURE__ */ _(d, {
|
|
219
|
+
asChild: !0,
|
|
220
|
+
onEscapeKeyDown: i(f, () => {
|
|
221
|
+
T.isFocusedToastEscapeKeyDownRef.current || V(), T.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
222
|
+
}),
|
|
223
|
+
children: /* @__PURE__ */ _(a.li, {
|
|
224
|
+
tabIndex: 0,
|
|
225
|
+
"data-state": c ? "open" : "closed",
|
|
226
|
+
"data-swipe-direction": T.swipeDirection,
|
|
227
|
+
...w,
|
|
228
|
+
ref: k,
|
|
229
|
+
style: {
|
|
230
|
+
userSelect: "none",
|
|
231
|
+
touchAction: "none",
|
|
232
|
+
...e.style
|
|
233
|
+
},
|
|
234
|
+
onKeyDown: i(e.onKeyDown, (e) => {
|
|
235
|
+
e.key === "Escape" && (f?.(e.nativeEvent), e.nativeEvent.defaultPrevented || (T.isFocusedToastEscapeKeyDownRef.current = !0, V()));
|
|
236
|
+
}),
|
|
237
|
+
onPointerDown: i(e.onPointerDown, (e) => {
|
|
238
|
+
e.button === 0 && (A.current = {
|
|
239
|
+
x: e.clientX,
|
|
240
|
+
y: e.clientY
|
|
241
|
+
});
|
|
242
|
+
}),
|
|
243
|
+
onPointerMove: i(e.onPointerMove, (e) => {
|
|
244
|
+
if (!A.current) return;
|
|
245
|
+
let t = e.clientX - A.current.x, n = e.clientY - A.current.y, r = !!j.current, i = ["left", "right"].includes(T.swipeDirection), a = ["left", "up"].includes(T.swipeDirection) ? Math.min : Math.max, o = i ? a(0, t) : 0, s = i ? 0 : a(0, n), c = e.pointerType === "touch" ? 10 : 2, l = {
|
|
246
|
+
x: o,
|
|
247
|
+
y: s
|
|
248
|
+
}, u = {
|
|
249
|
+
originalEvent: e,
|
|
250
|
+
delta: l
|
|
251
|
+
};
|
|
252
|
+
r ? (j.current = l, Z(ne, x, u, { discrete: !1 })) : Q(l, T.swipeDirection, c) ? (j.current = l, Z(te, b, u, { discrete: !1 }), e.target.setPointerCapture(e.pointerId)) : (Math.abs(t) > c || Math.abs(n) > c) && (A.current = null);
|
|
253
|
+
}),
|
|
254
|
+
onPointerUp: i(e.onPointerUp, (e) => {
|
|
255
|
+
let t = j.current, n = e.target;
|
|
256
|
+
if (n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), j.current = null, A.current = null, t) {
|
|
257
|
+
let n = e.currentTarget, r = {
|
|
258
|
+
originalEvent: e,
|
|
259
|
+
delta: t
|
|
260
|
+
};
|
|
261
|
+
Q(t, T.swipeDirection, T.swipeThreshold) ? Z(ie, ee, r, { discrete: !0 }) : Z(re, S, r, { discrete: !0 }), n.addEventListener("click", (e) => e.preventDefault(), { once: !0 });
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
})
|
|
265
|
+
})
|
|
266
|
+
}), T.viewport)
|
|
267
|
+
})] }) : null;
|
|
268
|
+
}), oe = (e) => {
|
|
269
|
+
let { __scopeToast: t, children: n, ...r } = e, i = O(L, t), [a, o] = h.useState(!1), [s, c] = h.useState(!1);
|
|
270
|
+
return se(() => o(!0)), h.useEffect(() => {
|
|
271
|
+
let e = window.setTimeout(() => c(!0), 1e3);
|
|
272
|
+
return () => window.clearTimeout(e);
|
|
273
|
+
}, []), s ? null : /* @__PURE__ */ _(p, {
|
|
274
|
+
asChild: !0,
|
|
275
|
+
children: /* @__PURE__ */ _(m, {
|
|
276
|
+
...r,
|
|
277
|
+
children: a && /* @__PURE__ */ v(g, { children: [
|
|
278
|
+
i.label,
|
|
279
|
+
" ",
|
|
280
|
+
n
|
|
281
|
+
] })
|
|
282
|
+
})
|
|
283
|
+
});
|
|
284
|
+
}, V = "ToastTitle", H = h.forwardRef((e, t) => {
|
|
285
|
+
let { __scopeToast: n, ...r } = e;
|
|
286
|
+
return /* @__PURE__ */ _(a.div, {
|
|
287
|
+
...r,
|
|
288
|
+
ref: t
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
H.displayName = V;
|
|
292
|
+
var U = "ToastDescription", W = h.forwardRef((e, t) => {
|
|
293
|
+
let { __scopeToast: n, ...r } = e;
|
|
294
|
+
return /* @__PURE__ */ _(a.div, {
|
|
295
|
+
...r,
|
|
296
|
+
ref: t
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
W.displayName = U;
|
|
300
|
+
var G = "ToastAction", K = h.forwardRef((e, t) => {
|
|
301
|
+
let { altText: n, ...r } = e;
|
|
302
|
+
return n.trim() ? /* @__PURE__ */ _(Y, {
|
|
303
|
+
altText: n,
|
|
304
|
+
asChild: !0,
|
|
305
|
+
children: /* @__PURE__ */ _(J, {
|
|
306
|
+
...r,
|
|
307
|
+
ref: t
|
|
308
|
+
})
|
|
309
|
+
}) : (console.error(`Invalid prop \`altText\` supplied to \`${G}\`. Expected non-empty \`string\`.`), null);
|
|
310
|
+
});
|
|
311
|
+
K.displayName = G;
|
|
312
|
+
var q = "ToastClose", J = h.forwardRef((e, t) => {
|
|
313
|
+
let { __scopeToast: n, ...r } = e, o = z(q, n);
|
|
314
|
+
return /* @__PURE__ */ _(Y, {
|
|
315
|
+
asChild: !0,
|
|
316
|
+
children: /* @__PURE__ */ _(a.button, {
|
|
317
|
+
type: "button",
|
|
318
|
+
...r,
|
|
319
|
+
ref: t,
|
|
320
|
+
onClick: i(e.onClick, o.onClose)
|
|
321
|
+
})
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
J.displayName = q;
|
|
325
|
+
var Y = h.forwardRef((e, t) => {
|
|
326
|
+
let { __scopeToast: n, altText: r, ...i } = e;
|
|
327
|
+
return /* @__PURE__ */ _(a.div, {
|
|
328
|
+
"data-radix-toast-announce-exclude": "",
|
|
329
|
+
"data-radix-toast-announce-alt": r || void 0,
|
|
330
|
+
...i,
|
|
331
|
+
ref: t
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
function X(e) {
|
|
335
|
+
let t = [];
|
|
336
|
+
return Array.from(e.childNodes).forEach((e) => {
|
|
337
|
+
if (e.nodeType === e.TEXT_NODE && e.textContent && t.push(e.textContent), ce(e)) {
|
|
338
|
+
let n = e.ariaHidden || e.hidden || e.style.display === "none", r = e.dataset.radixToastAnnounceExclude === "";
|
|
339
|
+
if (!n) if (r) {
|
|
340
|
+
let n = e.dataset.radixToastAnnounceAlt;
|
|
341
|
+
n && t.push(n);
|
|
342
|
+
} else t.push(...X(e));
|
|
343
|
+
}
|
|
344
|
+
}), t;
|
|
345
|
+
}
|
|
346
|
+
function Z(e, t, n, { discrete: i }) {
|
|
347
|
+
let a = n.originalEvent.currentTarget, o = new CustomEvent(e, {
|
|
348
|
+
bubbles: !0,
|
|
349
|
+
cancelable: !0,
|
|
350
|
+
detail: n
|
|
351
|
+
});
|
|
352
|
+
t && a.addEventListener(e, t, { once: !0 }), i ? r(a, o) : a.dispatchEvent(o);
|
|
353
|
+
}
|
|
354
|
+
var Q = (e, t, n = 0) => {
|
|
355
|
+
let r = Math.abs(e.x), i = Math.abs(e.y), a = r > i;
|
|
356
|
+
return t === "left" || t === "right" ? a && r > n : !a && i > n;
|
|
357
|
+
};
|
|
358
|
+
function se(e = () => {}) {
|
|
359
|
+
let t = u(e);
|
|
360
|
+
s(() => {
|
|
361
|
+
let e = 0, n = 0;
|
|
362
|
+
return e = window.requestAnimationFrame(() => n = window.requestAnimationFrame(t)), () => {
|
|
363
|
+
window.cancelAnimationFrame(e), window.cancelAnimationFrame(n);
|
|
364
|
+
};
|
|
365
|
+
}, [t]);
|
|
366
|
+
}
|
|
367
|
+
function ce(e) {
|
|
368
|
+
return e.nodeType === e.ELEMENT_NODE;
|
|
369
|
+
}
|
|
370
|
+
function le(e) {
|
|
371
|
+
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
|
|
372
|
+
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
373
|
+
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
374
|
+
} });
|
|
375
|
+
for (; n.nextNode();) t.push(n.currentNode);
|
|
376
|
+
return t;
|
|
377
|
+
}
|
|
378
|
+
function $(e) {
|
|
379
|
+
let t = document.activeElement;
|
|
380
|
+
return e.some((e) => e === t ? !0 : (e.focus(), document.activeElement !== t));
|
|
381
|
+
}
|
|
382
|
+
var ue = k, de = P, fe = R, pe = H, me = W, he = K, ge = J, _e = ue, ve = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ _(de, {
|
|
383
|
+
ref: r,
|
|
384
|
+
className: e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]", t),
|
|
385
|
+
...n
|
|
386
|
+
}));
|
|
387
|
+
ve.displayName = de?.displayName || "ToastViewport";
|
|
388
|
+
var ye = x("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", {
|
|
389
|
+
variants: { variant: {
|
|
390
|
+
default: "border bg-background text-foreground",
|
|
391
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
|
|
392
|
+
} },
|
|
393
|
+
defaultVariants: { variant: "default" }
|
|
394
|
+
}), be = h.forwardRef(({ className: t, variant: n, ...r }, i) => /* @__PURE__ */ _(fe, {
|
|
395
|
+
ref: i,
|
|
396
|
+
className: e(ye({ variant: n }), t),
|
|
397
|
+
...r
|
|
398
|
+
}));
|
|
399
|
+
be.displayName = fe?.displayName || "Toast";
|
|
400
|
+
var xe = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ _(he, {
|
|
401
|
+
ref: r,
|
|
402
|
+
className: e("hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-1 focus:outline-none disabled:pointer-events-none disabled:opacity-50", t),
|
|
403
|
+
...n
|
|
404
|
+
}));
|
|
405
|
+
xe.displayName = he?.displayName || "ToastAction";
|
|
406
|
+
var Se = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ _(ge, {
|
|
407
|
+
ref: r,
|
|
408
|
+
className: e("text-foreground/50 hover:text-foreground absolute top-1 right-1 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-1 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", t),
|
|
409
|
+
"toast-close": "",
|
|
410
|
+
...n,
|
|
411
|
+
children: /* @__PURE__ */ _(b, { className: "h-4 w-4" })
|
|
412
|
+
}));
|
|
413
|
+
Se.displayName = ge?.displayName || "ToastClose";
|
|
414
|
+
var Ce = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ _(pe, {
|
|
415
|
+
ref: r,
|
|
416
|
+
className: e("text-sm font-semibold [&+div]:text-xs", t),
|
|
417
|
+
...n
|
|
418
|
+
}));
|
|
419
|
+
Ce.displayName = pe?.displayName || "ToastTitle";
|
|
420
|
+
var we = h.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ _(me, {
|
|
421
|
+
ref: r,
|
|
422
|
+
className: e("text-sm opacity-90", t),
|
|
423
|
+
...n
|
|
424
|
+
}));
|
|
425
|
+
we.displayName = me?.displayName || "ToastDescription";
|
|
426
|
+
//#endregion
|
|
427
|
+
export { _e as a, we as i, xe as n, Ce as o, Se as r, ve as s, be as t };
|
package/dist/toast.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-nZSsnGb7.js"),Ae=require("react"),Ie=require("react-dom"),x=require("./index-BtZvtDmp.js"),te=require("./index-_XxjJPRD.js"),Fe=require("./index-BGIK9FQF.js"),Oe=require("./index-D2HnlO3y.js"),se=require("./index-BoNjHhm4.js"),Le=require("./index-CwyAfCwY.js"),Me=require("./index-B2XtpfGY.js"),K=require("./index-CzY-WZXL.js"),ke=require("./index-Ce5TOFAK.js"),Ve=require("./index-MQ0c3ZX_.js"),oe=require("./index-Cl3G0jzM.js"),$e=require("class-variance-authority"),He=require("lucide-react"),S=require("./utils-cdbZV8DZ.js");function re(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const r=re(Ae),Ke=re(Ie);var z="ToastProvider",[G,qe,We]=Fe.createCollection("Toast"),[ne]=Oe.createContextScope("Toast",[We]),[Xe,q]=ne(z),ae=e=>{const{__scopeToast:t,label:s="Notification",duration:o=5e3,swipeDirection:u="right",swipeThreshold:l=50,children:p}=e,[v,T]=r.useState(null),[c,b]=r.useState(0),E=r.useRef(!1),D=r.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${z}\`. Expected non-empty \`string\`.`),n.jsxRuntimeExports.jsx(G.Provider,{scope:t,children:n.jsxRuntimeExports.jsx(Xe,{scope:t,label:s,duration:o,swipeDirection:u,swipeThreshold:l,toastCount:c,viewport:v,onViewportChange:T,onToastAdd:r.useCallback(()=>b(C=>C+1),[]),onToastRemove:r.useCallback(()=>b(C=>C-1),[]),isFocusedToastEscapeKeyDownRef:E,isClosePausedRef:D,children:p})})};ae.displayName=z;var ie="ToastViewport",Ue=["F8"],U="toast.viewportPause",Y="toast.viewportResume",ce=r.forwardRef((e,t)=>{const{__scopeToast:s,hotkey:o=Ue,label:u="Notifications ({hotkey})",...l}=e,p=q(ie,s),v=qe(s),T=r.useRef(null),c=r.useRef(null),b=r.useRef(null),E=r.useRef(null),D=te.useComposedRefs(t,E,p.onViewportChange),C=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=p.toastCount>0;r.useEffect(()=>{const i=y=>{o.length!==0&&o.every(m=>y[m]||y.code===m)&&E.current?.focus()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[o]),r.useEffect(()=>{const i=T.current,y=E.current;if(j&&i&&y){const f=()=>{if(!p.isClosePausedRef.current){const w=new CustomEvent(U);y.dispatchEvent(w),p.isClosePausedRef.current=!0}},m=()=>{if(p.isClosePausedRef.current){const w=new CustomEvent(Y);y.dispatchEvent(w),p.isClosePausedRef.current=!1}},R=w=>{!i.contains(w.relatedTarget)&&m()},g=()=>{i.contains(document.activeElement)||m()};return i.addEventListener("focusin",f),i.addEventListener("focusout",R),i.addEventListener("pointermove",f),i.addEventListener("pointerleave",g),window.addEventListener("blur",f),window.addEventListener("focus",m),()=>{i.removeEventListener("focusin",f),i.removeEventListener("focusout",R),i.removeEventListener("pointermove",f),i.removeEventListener("pointerleave",g),window.removeEventListener("blur",f),window.removeEventListener("focus",m)}}},[j,p.isClosePausedRef]);const d=r.useCallback(({tabbingDirection:i})=>{const f=v().map(m=>{const R=m.ref.current,g=[R,...nt(R)];return i==="forwards"?g:g.reverse()});return(i==="forwards"?f.reverse():f).flat()},[v]);return r.useEffect(()=>{const i=E.current;if(i){const y=f=>{const m=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!m){const g=document.activeElement,w=f.shiftKey;if(f.target===i&&w){c.current?.focus();return}const A=d({tabbingDirection:w?"backwards":"forwards"}),M=A.findIndex(N=>N===g);X(A.slice(M+1))?f.preventDefault():w?c.current?.focus():b.current?.focus()}};return i.addEventListener("keydown",y),()=>i.removeEventListener("keydown",y)}},[v,d]),n.jsxRuntimeExports.jsxs(se.Branch,{ref:T,role:"region","aria-label":u.replace("{hotkey}",C),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&n.jsxRuntimeExports.jsx(B,{ref:c,onFocusFromOutsideViewport:()=>{const i=d({tabbingDirection:"forwards"});X(i)}}),n.jsxRuntimeExports.jsx(G.Slot,{scope:s,children:n.jsxRuntimeExports.jsx(x.Primitive.ol,{tabIndex:-1,...l,ref:D})}),j&&n.jsxRuntimeExports.jsx(B,{ref:b,onFocusFromOutsideViewport:()=>{const i=d({tabbingDirection:"backwards"});X(i)}})]})});ce.displayName=ie;var ue="ToastFocusProxy",B=r.forwardRef((e,t)=>{const{__scopeToast:s,onFocusFromOutsideViewport:o,...u}=e,l=q(ue,s);return n.jsxRuntimeExports.jsx(oe.VisuallyHidden,{tabIndex:0,...u,ref:t,style:{position:"fixed"},onFocus:p=>{const v=p.relatedTarget;!l.viewport?.contains(v)&&o()}})});B.displayName=ue;var O="Toast",Ye="toast.swipeStart",Be="toast.swipeMove",ze="toast.swipeCancel",Ge="toast.swipeEnd",de=r.forwardRef((e,t)=>{const{forceMount:s,open:o,defaultOpen:u,onOpenChange:l,...p}=e,[v,T]=ke.useControllableState({prop:o,defaultProp:u??!0,onChange:l,caller:O});return n.jsxRuntimeExports.jsx(Me.Presence,{present:s||v,children:n.jsxRuntimeExports.jsx(Ze,{open:v,...p,ref:t,onClose:()=>T(!1),onPause:K.useCallbackRef(e.onPause),onResume:K.useCallbackRef(e.onResume),onSwipeStart:x.composeEventHandlers(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:x.composeEventHandlers(e.onSwipeMove,c=>{const{x:b,y:E}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${b}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${E}px`)}),onSwipeCancel:x.composeEventHandlers(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:x.composeEventHandlers(e.onSwipeEnd,c=>{const{x:b,y:E}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${b}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${E}px`),T(!1)})})})});de.displayName=O;var[Je,Qe]=ne(O,{onClose(){}}),Ze=r.forwardRef((e,t)=>{const{__scopeToast:s,type:o="foreground",duration:u,open:l,onClose:p,onEscapeKeyDown:v,onPause:T,onResume:c,onSwipeStart:b,onSwipeMove:E,onSwipeCancel:D,onSwipeEnd:C,...j}=e,d=q(O,s),[i,y]=r.useState(null),f=te.useComposedRefs(t,a=>y(a)),m=r.useRef(null),R=r.useRef(null),g=u||d.duration,w=r.useRef(0),_=r.useRef(g),L=r.useRef(0),{onToastAdd:A,onToastRemove:M}=d,N=K.useCallbackRef(()=>{i?.contains(document.activeElement)&&d.viewport?.focus(),p()}),k=r.useCallback(a=>{!a||a===1/0||(window.clearTimeout(L.current),w.current=new Date().getTime(),L.current=window.setTimeout(N,a))},[N]);r.useEffect(()=>{const a=d.viewport;if(a){const h=()=>{k(_.current),c?.()},P=()=>{const I=new Date().getTime()-w.current;_.current=_.current-I,window.clearTimeout(L.current),T?.()};return a.addEventListener(U,P),a.addEventListener(Y,h),()=>{a.removeEventListener(U,P),a.removeEventListener(Y,h)}}},[d.viewport,g,T,c,k]),r.useEffect(()=>{l&&!d.isClosePausedRef.current&&k(g)},[l,g,d.isClosePausedRef,k]),r.useEffect(()=>(A(),()=>M()),[A,M]);const Q=r.useMemo(()=>i?Te(i):null,[i]);return d.viewport?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[Q&&n.jsxRuntimeExports.jsx(et,{__scopeToast:s,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:Q}),n.jsxRuntimeExports.jsx(Je,{scope:s,onClose:N,children:Ke.createPortal(n.jsxRuntimeExports.jsx(G.ItemSlot,{scope:s,children:n.jsxRuntimeExports.jsx(se.Root,{asChild:!0,onEscapeKeyDown:x.composeEventHandlers(v,()=>{d.isFocusedToastEscapeKeyDownRef.current||N(),d.isFocusedToastEscapeKeyDownRef.current=!1}),children:n.jsxRuntimeExports.jsx(x.Primitive.li,{tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":d.swipeDirection,...j,ref:f,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:x.composeEventHandlers(e.onKeyDown,a=>{a.key==="Escape"&&(v?.(a.nativeEvent),a.nativeEvent.defaultPrevented||(d.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:x.composeEventHandlers(e.onPointerDown,a=>{a.button===0&&(m.current={x:a.clientX,y:a.clientY})}),onPointerMove:x.composeEventHandlers(e.onPointerMove,a=>{if(!m.current)return;const h=a.clientX-m.current.x,P=a.clientY-m.current.y,I=!!R.current,F=["left","right"].includes(d.swipeDirection),V=["left","up"].includes(d.swipeDirection)?Math.min:Math.max,De=F?V(0,h):0,_e=F?0:V(0,P),W=a.pointerType==="touch"?10:2,$={x:De,y:_e},Z={originalEvent:a,delta:$};I?(R.current=$,H(Be,E,Z,{discrete:!1})):ee($,d.swipeDirection,W)?(R.current=$,H(Ye,b,Z,{discrete:!1}),a.target.setPointerCapture(a.pointerId)):(Math.abs(h)>W||Math.abs(P)>W)&&(m.current=null)}),onPointerUp:x.composeEventHandlers(e.onPointerUp,a=>{const h=R.current,P=a.target;if(P.hasPointerCapture(a.pointerId)&&P.releasePointerCapture(a.pointerId),R.current=null,m.current=null,h){const I=a.currentTarget,F={originalEvent:a,delta:h};ee(h,d.swipeDirection,d.swipeThreshold)?H(Ge,C,F,{discrete:!0}):H(ze,D,F,{discrete:!0}),I.addEventListener("click",V=>V.preventDefault(),{once:!0})}})})})}),d.viewport)})]}):null}),et=e=>{const{__scopeToast:t,children:s,...o}=e,u=q(O,t),[l,p]=r.useState(!1),[v,T]=r.useState(!1);return ot(()=>p(!0)),r.useEffect(()=>{const c=window.setTimeout(()=>T(!0),1e3);return()=>window.clearTimeout(c)},[]),v?null:n.jsxRuntimeExports.jsx(Le.Portal,{asChild:!0,children:n.jsxRuntimeExports.jsx(oe.VisuallyHidden,{...o,children:l&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[u.label," ",s]})})})},tt="ToastTitle",le=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{...o,ref:t})});le.displayName=tt;var st="ToastDescription",pe=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{...o,ref:t})});pe.displayName=st;var fe="ToastAction",me=r.forwardRef((e,t)=>{const{altText:s,...o}=e;return s.trim()?n.jsxRuntimeExports.jsx(ve,{altText:s,asChild:!0,children:n.jsxRuntimeExports.jsx(J,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${fe}\`. Expected non-empty \`string\`.`),null)});me.displayName=fe;var xe="ToastClose",J=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e,u=Qe(xe,s);return n.jsxRuntimeExports.jsx(ve,{asChild:!0,children:n.jsxRuntimeExports.jsx(x.Primitive.button,{type:"button",...o,ref:t,onClick:x.composeEventHandlers(e.onClick,u.onClose)})})});J.displayName=xe;var ve=r.forwardRef((e,t)=>{const{__scopeToast:s,altText:o,...u}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...u,ref:t})});function Te(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),rt(o)){const u=o.ariaHidden||o.hidden||o.style.display==="none",l=o.dataset.radixToastAnnounceExclude==="";if(!u)if(l){const p=o.dataset.radixToastAnnounceAlt;p&&t.push(p)}else t.push(...Te(o))}}),t}function H(e,t,s,{discrete:o}){const u=s.originalEvent.currentTarget,l=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:s});t&&u.addEventListener(e,t,{once:!0}),o?x.dispatchDiscreteCustomEvent(u,l):u.dispatchEvent(l)}var ee=(e,t,s=0)=>{const o=Math.abs(e.x),u=Math.abs(e.y),l=o>u;return t==="left"||t==="right"?l&&o>s:!l&&u>s};function ot(e=()=>{}){const t=K.useCallbackRef(e);Ve.useLayoutEffect2(()=>{let s=0,o=0;return s=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(o)}},[t])}function rt(e){return e.nodeType===e.ELEMENT_NODE}function nt(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const u=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||u?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function X(e){const t=document.activeElement;return e.some(s=>s===t?!0:(s.focus(),document.activeElement!==t))}var at=ae,we=ce,Ee=de,ye=le,Re=pe,ge=me,be=J;const it=at,he=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(we,{ref:s,className:S.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",e),...t}));he.displayName=we?.displayName||"ToastViewport";const ct=$e.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Pe=r.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx(Ee,{ref:o,className:S.cn(ct({variant:t}),e),...s}));Pe.displayName=Ee?.displayName||"Toast";const Ce=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ge,{ref:s,className:S.cn("hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-1 focus:outline-none disabled:pointer-events-none disabled:opacity-50",e),...t}));Ce.displayName=ge?.displayName||"ToastAction";const je=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(be,{ref:s,className:S.cn("text-foreground/50 hover:text-foreground absolute top-1 right-1 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-1 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:n.jsxRuntimeExports.jsx(He.X,{className:"h-4 w-4"})}));je.displayName=be?.displayName||"ToastClose";const Ne=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ye,{ref:s,className:S.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Ne.displayName=ye?.displayName||"ToastTitle";const Se=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(Re,{ref:s,className:S.cn("text-sm opacity-90",e),...t}));Se.displayName=Re?.displayName||"ToastDescription";exports.Toast=Pe;exports.ToastAction=Ce;exports.ToastClose=je;exports.ToastDescription=Se;exports.ToastProvider=it;exports.ToastTitle=Ne;exports.ToastViewport=he;
|
|
1
|
+
"use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./toast-BtXY2QTe.js");exports.Toast=e.t,exports.ToastAction=e.n,exports.ToastClose=e.r,exports.ToastDescription=e.i,exports.ToastProvider=e.a,exports.ToastTitle=e.o,exports.ToastViewport=e.s;
|
package/dist/toast.d.ts
CHANGED
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
|
|
6
|
-
export declare const Toast: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React_2.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
7
|
-
variant?: "default" | "destructive" | null | undefined;
|
|
8
|
-
} & ClassProp) | undefined) => string> & React_2.RefAttributes<HTMLLIElement>>;
|
|
9
|
-
|
|
10
|
-
export declare const ToastAction: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
11
|
-
|
|
12
|
-
export declare type ToastActionElement = React_2.ReactElement<typeof ToastAction>;
|
|
13
|
-
|
|
14
|
-
export declare const ToastClose: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
15
|
-
|
|
16
|
-
export declare const ToastDescription: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
|
|
18
|
-
export declare type ToastProps = React_2.ComponentPropsWithoutRef<typeof Toast>;
|
|
19
|
-
|
|
20
|
-
export declare const ToastProvider: React_2.FC<ToastPrimitives.ToastProviderProps>;
|
|
21
|
-
|
|
22
|
-
export declare const ToastTitle: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
|
|
24
|
-
export declare const ToastViewport: React_2.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React_2.RefAttributes<HTMLOListElement>, "ref"> & React_2.RefAttributes<HTMLOListElement>>;
|
|
25
|
-
|
|
26
|
-
export { }
|
|
1
|
+
export * from './packages/ui-web/src/toast'
|
|
2
|
+
export {}
|