@kamod-ch/ui 0.2.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/LICENSE.md +9 -0
- package/README.md +183 -0
- package/dist/Accordion-D1PiNspd.d.ts +39 -0
- package/dist/AlertDialog-ALB541qy.d.ts +64 -0
- package/dist/Button-vQnkiVTI.d.ts +84 -0
- package/dist/CalendarDateTimePanel-B3J8OlSc.d.ts +79 -0
- package/dist/Carousel-BUB4DVuh.d.ts +48 -0
- package/dist/Chart-Ax22S5_N.d.ts +10 -0
- package/dist/Checkbox-DBbLYq6Q.d.ts +12 -0
- package/dist/Collapsible-CW1hQwqV.d.ts +34 -0
- package/dist/ComboboxValue-BGfXgtZt.d.ts +135 -0
- package/dist/CommandSeparator-wZRCsqsT.d.ts +47 -0
- package/dist/DataTable-zNTTdYVU.d.ts +13 -0
- package/dist/DatePicker-AFAYh5Ca.d.ts +20 -0
- package/dist/Dialog-BOIteLfe.d.ts +28 -0
- package/dist/DialogContent-CK1t4m4e.d.ts +24 -0
- package/dist/DialogHeader-CYT7iUDq.d.ts +13 -0
- package/dist/DialogTitle-CerJD0oA.d.ts +13 -0
- package/dist/Direction-25ZOt0gW.d.ts +24 -0
- package/dist/Drawer-B3pZMn5j.d.ts +41 -0
- package/dist/Dropdown-CVbWVKok.d.ts +143 -0
- package/dist/FieldTitle-aSgThW-B.d.ts +100 -0
- package/dist/HoverCard-aVEEtkyO.d.ts +52 -0
- package/dist/Input-Cem05el9.d.ts +27 -0
- package/dist/Menubar-DwYDW4w2.d.ts +88 -0
- package/dist/PopoverTrigger-CH_Kx2mn.d.ts +43 -0
- package/dist/Progress-BGij8Hob.d.ts +13 -0
- package/dist/RadioGroup-BaElzLwa.d.ts +40 -0
- package/dist/ScrollArea-B-vILe3g.d.ts +16 -0
- package/dist/Select-B_mNVh70.d.ts +51 -0
- package/dist/Separator-DCQYrnpB.d.ts +9 -0
- package/dist/Sheet-s0xRF22F.d.ts +29 -0
- package/dist/SidebarProvider-IAihmyD7.d.ts +46 -0
- package/dist/Slider-BQLMBpYs.d.ts +16 -0
- package/dist/Switch-CTTkNdqF.d.ts +31 -0
- package/dist/Tabs-CR-thcs6.d.ts +47 -0
- package/dist/Textarea-DbKkduOG.d.ts +27 -0
- package/dist/ThemeToggle-DfiEM1dZ.d.ts +9 -0
- package/dist/Toggle-CseZl7XN.d.ts +49 -0
- package/dist/ToggleGroup-UeYHzQe7.d.ts +137 -0
- package/dist/Tooltip-Ba3GxE7u.d.ts +40 -0
- package/dist/Typography-ccTtE182.d.ts +64 -0
- package/dist/chunk-26CRIZXP.js +244 -0
- package/dist/chunk-26CRIZXP.js.map +1 -0
- package/dist/chunk-2BQ54337.js +282 -0
- package/dist/chunk-2BQ54337.js.map +1 -0
- package/dist/chunk-2HZCH73K.js +109 -0
- package/dist/chunk-2HZCH73K.js.map +1 -0
- package/dist/chunk-2KY7P27I.js +64 -0
- package/dist/chunk-2KY7P27I.js.map +1 -0
- package/dist/chunk-3DNIMQX6.js +78 -0
- package/dist/chunk-3DNIMQX6.js.map +1 -0
- package/dist/chunk-3KB54OYF.js +81 -0
- package/dist/chunk-3KB54OYF.js.map +1 -0
- package/dist/chunk-4BJJOHZT.js +477 -0
- package/dist/chunk-4BJJOHZT.js.map +1 -0
- package/dist/chunk-4IBTERDG.js +9 -0
- package/dist/chunk-4IBTERDG.js.map +1 -0
- package/dist/chunk-4V3WHQJE.js +510 -0
- package/dist/chunk-4V3WHQJE.js.map +1 -0
- package/dist/chunk-5FBD2NTR.js +103 -0
- package/dist/chunk-5FBD2NTR.js.map +1 -0
- package/dist/chunk-5KS2VSX2.js +94 -0
- package/dist/chunk-5KS2VSX2.js.map +1 -0
- package/dist/chunk-5Q4RBIMZ.js +25 -0
- package/dist/chunk-5Q4RBIMZ.js.map +1 -0
- package/dist/chunk-67J4KBOW.js +124 -0
- package/dist/chunk-67J4KBOW.js.map +1 -0
- package/dist/chunk-6BK3PIRX.js +151 -0
- package/dist/chunk-6BK3PIRX.js.map +1 -0
- package/dist/chunk-6FYSVMH7.js +21 -0
- package/dist/chunk-6FYSVMH7.js.map +1 -0
- package/dist/chunk-6RASPU5N.js +31 -0
- package/dist/chunk-6RASPU5N.js.map +1 -0
- package/dist/chunk-7AJT2E2Y.js +624 -0
- package/dist/chunk-7AJT2E2Y.js.map +1 -0
- package/dist/chunk-7IOAIEIA.js +102 -0
- package/dist/chunk-7IOAIEIA.js.map +1 -0
- package/dist/chunk-7MITRFPE.js +192 -0
- package/dist/chunk-7MITRFPE.js.map +1 -0
- package/dist/chunk-BDK7CDEI.js +22 -0
- package/dist/chunk-BDK7CDEI.js.map +1 -0
- package/dist/chunk-BQP4UA44.js +18 -0
- package/dist/chunk-BQP4UA44.js.map +1 -0
- package/dist/chunk-BYG2ULS3.js +196 -0
- package/dist/chunk-BYG2ULS3.js.map +1 -0
- package/dist/chunk-C7WEQOUA.js +26 -0
- package/dist/chunk-C7WEQOUA.js.map +1 -0
- package/dist/chunk-CLEC2RMU.js +8 -0
- package/dist/chunk-CLEC2RMU.js.map +1 -0
- package/dist/chunk-CMBERB5B.js +9 -0
- package/dist/chunk-CMBERB5B.js.map +1 -0
- package/dist/chunk-COPT6I2D.js +122 -0
- package/dist/chunk-COPT6I2D.js.map +1 -0
- package/dist/chunk-CP55TVOV.js +271 -0
- package/dist/chunk-CP55TVOV.js.map +1 -0
- package/dist/chunk-D3DQ4ICC.js +25 -0
- package/dist/chunk-D3DQ4ICC.js.map +1 -0
- package/dist/chunk-ERBGZZ2U.js +26 -0
- package/dist/chunk-ERBGZZ2U.js.map +1 -0
- package/dist/chunk-FIOKWIJP.js +361 -0
- package/dist/chunk-FIOKWIJP.js.map +1 -0
- package/dist/chunk-G6TV6TF7.js +95 -0
- package/dist/chunk-G6TV6TF7.js.map +1 -0
- package/dist/chunk-GGTDJEE2.js +15 -0
- package/dist/chunk-GGTDJEE2.js.map +1 -0
- package/dist/chunk-GIU6BZTW.js +173 -0
- package/dist/chunk-GIU6BZTW.js.map +1 -0
- package/dist/chunk-HAAXVB3R.js +34 -0
- package/dist/chunk-HAAXVB3R.js.map +1 -0
- package/dist/chunk-HTSAUMF5.js +398 -0
- package/dist/chunk-HTSAUMF5.js.map +1 -0
- package/dist/chunk-IJ4ZRIR4.js +182 -0
- package/dist/chunk-IJ4ZRIR4.js.map +1 -0
- package/dist/chunk-J4DMQV64.js +340 -0
- package/dist/chunk-J4DMQV64.js.map +1 -0
- package/dist/chunk-JKXSX67K.js +95 -0
- package/dist/chunk-JKXSX67K.js.map +1 -0
- package/dist/chunk-JNF7FDJO.js +633 -0
- package/dist/chunk-JNF7FDJO.js.map +1 -0
- package/dist/chunk-JURNPBSW.js +70 -0
- package/dist/chunk-JURNPBSW.js.map +1 -0
- package/dist/chunk-LCMPFPBN.js +141 -0
- package/dist/chunk-LCMPFPBN.js.map +1 -0
- package/dist/chunk-LCWXIQKA.js +36 -0
- package/dist/chunk-LCWXIQKA.js.map +1 -0
- package/dist/chunk-LFJF3M6M.js +171 -0
- package/dist/chunk-LFJF3M6M.js.map +1 -0
- package/dist/chunk-MD6HHORY.js +524 -0
- package/dist/chunk-MD6HHORY.js.map +1 -0
- package/dist/chunk-MJG6UKD4.js +83 -0
- package/dist/chunk-MJG6UKD4.js.map +1 -0
- package/dist/chunk-MKG3UAP6.js +347 -0
- package/dist/chunk-MKG3UAP6.js.map +1 -0
- package/dist/chunk-MS2ZNYCJ.js +9 -0
- package/dist/chunk-MS2ZNYCJ.js.map +1 -0
- package/dist/chunk-NGKQBNZ5.js +29 -0
- package/dist/chunk-NGKQBNZ5.js.map +1 -0
- package/dist/chunk-NKKMM6CK.js +56 -0
- package/dist/chunk-NKKMM6CK.js.map +1 -0
- package/dist/chunk-OCLVMKVC.js +110 -0
- package/dist/chunk-OCLVMKVC.js.map +1 -0
- package/dist/chunk-PFV7YIEP.js +104 -0
- package/dist/chunk-PFV7YIEP.js.map +1 -0
- package/dist/chunk-PGOCR4LG.js +216 -0
- package/dist/chunk-PGOCR4LG.js.map +1 -0
- package/dist/chunk-PPYJQNE5.js +159 -0
- package/dist/chunk-PPYJQNE5.js.map +1 -0
- package/dist/chunk-PU5J5EPY.js +733 -0
- package/dist/chunk-PU5J5EPY.js.map +1 -0
- package/dist/chunk-PZS2D2QM.js +32 -0
- package/dist/chunk-PZS2D2QM.js.map +1 -0
- package/dist/chunk-Q5IUIA6B.js +9 -0
- package/dist/chunk-Q5IUIA6B.js.map +1 -0
- package/dist/chunk-QFDTG2ZJ.js +176 -0
- package/dist/chunk-QFDTG2ZJ.js.map +1 -0
- package/dist/chunk-QZX3RFIC.js +165 -0
- package/dist/chunk-QZX3RFIC.js.map +1 -0
- package/dist/chunk-R565SY7K.js +69 -0
- package/dist/chunk-R565SY7K.js.map +1 -0
- package/dist/chunk-RHNI5UQO.js +455 -0
- package/dist/chunk-RHNI5UQO.js.map +1 -0
- package/dist/chunk-ROKLAZHC.js +550 -0
- package/dist/chunk-ROKLAZHC.js.map +1 -0
- package/dist/chunk-RTIFG4XT.js +9 -0
- package/dist/chunk-RTIFG4XT.js.map +1 -0
- package/dist/chunk-TFLSEEM4.js +88 -0
- package/dist/chunk-TFLSEEM4.js.map +1 -0
- package/dist/chunk-U2UNWXBC.js +242 -0
- package/dist/chunk-U2UNWXBC.js.map +1 -0
- package/dist/chunk-UEGIKBX6.js +385 -0
- package/dist/chunk-UEGIKBX6.js.map +1 -0
- package/dist/chunk-UEXTD7ZB.js +108 -0
- package/dist/chunk-UEXTD7ZB.js.map +1 -0
- package/dist/chunk-UNWEH4Z6.js +83 -0
- package/dist/chunk-UNWEH4Z6.js.map +1 -0
- package/dist/chunk-UXWUFNXY.js +8 -0
- package/dist/chunk-UXWUFNXY.js.map +1 -0
- package/dist/chunk-V2MG5Y5F.js +77 -0
- package/dist/chunk-V2MG5Y5F.js.map +1 -0
- package/dist/chunk-V63YIVKJ.js +326 -0
- package/dist/chunk-V63YIVKJ.js.map +1 -0
- package/dist/chunk-WAPRVVDQ.js +9 -0
- package/dist/chunk-WAPRVVDQ.js.map +1 -0
- package/dist/chunk-X4HPHMYW.js +17 -0
- package/dist/chunk-X4HPHMYW.js.map +1 -0
- package/dist/chunk-XGFJJ2YB.js +36 -0
- package/dist/chunk-XGFJJ2YB.js.map +1 -0
- package/dist/chunk-YJGECAOZ.js +18 -0
- package/dist/chunk-YJGECAOZ.js.map +1 -0
- package/dist/chunk-YTHUHPE5.js +51 -0
- package/dist/chunk-YTHUHPE5.js.map +1 -0
- package/dist/chunk-YTJRKLUR.js +76 -0
- package/dist/chunk-YTJRKLUR.js.map +1 -0
- package/dist/chunk-YVALXJRN.js +49 -0
- package/dist/chunk-YVALXJRN.js.map +1 -0
- package/dist/chunk-YZLPO4B2.js +33 -0
- package/dist/chunk-YZLPO4B2.js.map +1 -0
- package/dist/chunk-ZHAGKFSO.js +16 -0
- package/dist/chunk-ZHAGKFSO.js.map +1 -0
- package/dist/chunk-ZM67EKZC.js +135 -0
- package/dist/chunk-ZM67EKZC.js.map +1 -0
- package/dist/chunk-ZVAW22GX.js +50 -0
- package/dist/chunk-ZVAW22GX.js.map +1 -0
- package/dist/components/accordion/index.d.ts +12 -0
- package/dist/components/accordion/index.js +4 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/alert/index.d.ts +64 -0
- package/dist/components/alert/index.js +4 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/alert-dialog/index.d.ts +22 -0
- package/dist/components/alert-dialog/index.js +9 -0
- package/dist/components/alert-dialog/index.js.map +1 -0
- package/dist/components/aspect-ratio/index.d.ts +11 -0
- package/dist/components/aspect-ratio/index.js +4 -0
- package/dist/components/aspect-ratio/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +53 -0
- package/dist/components/avatar/index.js +4 -0
- package/dist/components/avatar/index.js.map +1 -0
- package/dist/components/badge/index.d.ts +175 -0
- package/dist/components/badge/index.js +4 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +38 -0
- package/dist/components/breadcrumb/index.js +4 -0
- package/dist/components/breadcrumb/index.js.map +1 -0
- package/dist/components/button/index.d.ts +72 -0
- package/dist/components/button/index.js +5 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/button-group/index.d.ts +21 -0
- package/dist/components/button-group/index.js +4 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +7 -0
- package/dist/components/calendar/index.js +12 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/card/index.d.ts +80 -0
- package/dist/components/card/index.js +3 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/carousel/index.d.ts +15 -0
- package/dist/components/carousel/index.js +5 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/chart/index.d.ts +6 -0
- package/dist/components/chart/index.js +4 -0
- package/dist/components/chart/index.js.map +1 -0
- package/dist/components/checkbox/index.d.ts +7 -0
- package/dist/components/checkbox/index.js +4 -0
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/components/collapsible/index.d.ts +11 -0
- package/dist/components/collapsible/index.js +4 -0
- package/dist/components/collapsible/index.js.map +1 -0
- package/dist/components/combobox/index.d.ts +13 -0
- package/dist/components/combobox/index.js +7 -0
- package/dist/components/combobox/index.js.map +1 -0
- package/dist/components/command/index.d.ts +21 -0
- package/dist/components/command/index.js +10 -0
- package/dist/components/command/index.js.map +1 -0
- package/dist/components/context-menu/index.d.ts +114 -0
- package/dist/components/context-menu/index.js +5 -0
- package/dist/components/context-menu/index.js.map +1 -0
- package/dist/components/data-table/index.d.ts +6 -0
- package/dist/components/data-table/index.js +5 -0
- package/dist/components/data-table/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +7 -0
- package/dist/components/date-picker/index.js +8 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/dialog/index.d.ts +22 -0
- package/dist/components/dialog/index.js +8 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/direction/index.d.ts +7 -0
- package/dist/components/direction/index.js +4 -0
- package/dist/components/direction/index.js.map +1 -0
- package/dist/components/drawer/index.d.ts +19 -0
- package/dist/components/drawer/index.js +8 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/dropdown/index.d.ts +24 -0
- package/dist/components/dropdown/index.js +5 -0
- package/dist/components/dropdown/index.js.map +1 -0
- package/dist/components/dropzone/index.d.ts +26 -0
- package/dist/components/dropzone/index.js +5 -0
- package/dist/components/dropzone/index.js.map +1 -0
- package/dist/components/empty/index.d.ts +59 -0
- package/dist/components/empty/index.js +4 -0
- package/dist/components/empty/index.js.map +1 -0
- package/dist/components/field/index.d.ts +8 -0
- package/dist/components/field/index.js +6 -0
- package/dist/components/field/index.js.map +1 -0
- package/dist/components/hover-card/index.d.ts +12 -0
- package/dist/components/hover-card/index.js +3 -0
- package/dist/components/hover-card/index.js.map +1 -0
- package/dist/components/image/index.d.ts +6 -0
- package/dist/components/image/index.js +4 -0
- package/dist/components/image/index.js.map +1 -0
- package/dist/components/input/index.d.ts +27 -0
- package/dist/components/input/index.js +4 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input-group/index.d.ts +132 -0
- package/dist/components/input-group/index.js +7 -0
- package/dist/components/input-group/index.js.map +1 -0
- package/dist/components/input-otp/index.d.ts +39 -0
- package/dist/components/input-otp/index.js +4 -0
- package/dist/components/input-otp/index.js.map +1 -0
- package/dist/components/item/index.d.ts +108 -0
- package/dist/components/item/index.js +5 -0
- package/dist/components/item/index.js.map +1 -0
- package/dist/components/kbd/index.d.ts +31 -0
- package/dist/components/kbd/index.js +4 -0
- package/dist/components/kbd/index.js.map +1 -0
- package/dist/components/label/index.d.ts +49 -0
- package/dist/components/label/index.js +4 -0
- package/dist/components/label/index.js.map +1 -0
- package/dist/components/locale-segment-group/index.d.ts +15 -0
- package/dist/components/locale-segment-group/index.js +4 -0
- package/dist/components/locale-segment-group/index.js.map +1 -0
- package/dist/components/menubar/index.d.ts +23 -0
- package/dist/components/menubar/index.js +5 -0
- package/dist/components/menubar/index.js.map +1 -0
- package/dist/components/native-select/index.d.ts +89 -0
- package/dist/components/native-select/index.js +3 -0
- package/dist/components/native-select/index.js.map +1 -0
- package/dist/components/navigation-menu/index.d.ts +15 -0
- package/dist/components/navigation-menu/index.js +5 -0
- package/dist/components/navigation-menu/index.js.map +1 -0
- package/dist/components/pagination/index.d.ts +44 -0
- package/dist/components/pagination/index.js +5 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/popover/index.d.ts +76 -0
- package/dist/components/popover/index.js +5 -0
- package/dist/components/popover/index.js.map +1 -0
- package/dist/components/progress/index.d.ts +6 -0
- package/dist/components/progress/index.js +4 -0
- package/dist/components/progress/index.js.map +1 -0
- package/dist/components/prose/index.d.ts +8 -0
- package/dist/components/prose/index.js +4 -0
- package/dist/components/prose/index.js.map +1 -0
- package/dist/components/radio-group/index.d.ts +11 -0
- package/dist/components/radio-group/index.js +5 -0
- package/dist/components/radio-group/index.js.map +1 -0
- package/dist/components/scroll-area/index.d.ts +11 -0
- package/dist/components/scroll-area/index.js +4 -0
- package/dist/components/scroll-area/index.js.map +1 -0
- package/dist/components/select/index.d.ts +17 -0
- package/dist/components/select/index.js +5 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/selectable-card/index.d.ts +11 -0
- package/dist/components/selectable-card/index.js +5 -0
- package/dist/components/selectable-card/index.js.map +1 -0
- package/dist/components/separator/index.d.ts +24 -0
- package/dist/components/separator/index.js +4 -0
- package/dist/components/separator/index.js.map +1 -0
- package/dist/components/sheet/index.d.ts +20 -0
- package/dist/components/sheet/index.js +8 -0
- package/dist/components/sheet/index.js.map +1 -0
- package/dist/components/sidebar/index.d.ts +16 -0
- package/dist/components/sidebar/index.js +3 -0
- package/dist/components/sidebar/index.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +52 -0
- package/dist/components/skeleton/index.js +3 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/slider/index.d.ts +7 -0
- package/dist/components/slider/index.js +4 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/sonner/index.d.ts +7 -0
- package/dist/components/sonner/index.js +3 -0
- package/dist/components/sonner/index.js.map +1 -0
- package/dist/components/spinner/index.d.ts +10 -0
- package/dist/components/spinner/index.js +4 -0
- package/dist/components/spinner/index.js.map +1 -0
- package/dist/components/switch/index.d.ts +7 -0
- package/dist/components/switch/index.js +4 -0
- package/dist/components/switch/index.js.map +1 -0
- package/dist/components/table/index.d.ts +45 -0
- package/dist/components/table/index.js +5 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +13 -0
- package/dist/components/tabs/index.js +5 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/textarea/index.d.ts +27 -0
- package/dist/components/textarea/index.js +4 -0
- package/dist/components/textarea/index.js.map +1 -0
- package/dist/components/theme-toggle/index.d.ts +6 -0
- package/dist/components/theme-toggle/index.js +6 -0
- package/dist/components/theme-toggle/index.js.map +1 -0
- package/dist/components/toast/index.d.ts +27 -0
- package/dist/components/toast/index.js +3 -0
- package/dist/components/toast/index.js.map +1 -0
- package/dist/components/toggle/index.d.ts +7 -0
- package/dist/components/toggle/index.js +4 -0
- package/dist/components/toggle/index.js.map +1 -0
- package/dist/components/toggle-group/index.d.ts +11 -0
- package/dist/components/toggle-group/index.js +4 -0
- package/dist/components/toggle-group/index.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +12 -0
- package/dist/components/tooltip/index.js +3 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/typography/index.d.ts +8 -0
- package/dist/components/typography/index.js +4 -0
- package/dist/components/typography/index.js.map +1 -0
- package/dist/components/video/index.d.ts +8 -0
- package/dist/components/video/index.js +4 -0
- package/dist/components/video/index.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/interactive/index.d.ts +44 -0
- package/dist/lib/interactive/index.js +3 -0
- package/dist/lib/interactive/index.js.map +1 -0
- package/dist/lib/signals/index.d.ts +15 -0
- package/dist/lib/signals/index.js +3 -0
- package/dist/lib/signals/index.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +3 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/navigationMenuTriggerStyle-BWnESpon.d.ts +48 -0
- package/dist/sonner-store-Dfdxy8ba.d.ts +11 -0
- package/dist/theme.css +81 -0
- package/package.json +360 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Separator } from './chunk-LCWXIQKA.js';
|
|
2
|
+
import { cn } from './chunk-MS2ZNYCJ.js';
|
|
3
|
+
import { isValidElement, cloneElement } from 'preact';
|
|
4
|
+
import { tv } from 'tailwind-variants';
|
|
5
|
+
import { jsx } from 'preact/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var item = tv({
|
|
8
|
+
base: [
|
|
9
|
+
"group/item flex flex-wrap items-center rounded-md border border-transparent text-sm outline-none transition-[color,background-color,box-shadow] duration-100",
|
|
10
|
+
"[a]:transition-colors [a]:hover:bg-accent/50",
|
|
11
|
+
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
12
|
+
],
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
default: "bg-transparent hover:bg-muted/40",
|
|
16
|
+
outline: "border-border hover:bg-accent/35",
|
|
17
|
+
muted: "bg-muted/50 hover:bg-muted/65"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "gap-4 p-4",
|
|
21
|
+
sm: "gap-2.5 px-4 py-3",
|
|
22
|
+
xs: "gap-2 px-3 py-2 text-xs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "default",
|
|
27
|
+
size: "default"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var Item = ({
|
|
31
|
+
variant,
|
|
32
|
+
size,
|
|
33
|
+
asChild = false,
|
|
34
|
+
class: className,
|
|
35
|
+
children,
|
|
36
|
+
...rest
|
|
37
|
+
}) => {
|
|
38
|
+
const resolvedVariant = variant ?? "default";
|
|
39
|
+
const resolvedSize = size ?? "default";
|
|
40
|
+
const resolvedClassName = item({
|
|
41
|
+
variant: resolvedVariant,
|
|
42
|
+
size: resolvedSize,
|
|
43
|
+
class: className
|
|
44
|
+
});
|
|
45
|
+
if (asChild) {
|
|
46
|
+
if (!isValidElement(children)) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const childProps = children.props ?? {};
|
|
50
|
+
return cloneElement(children, {
|
|
51
|
+
...childProps,
|
|
52
|
+
...rest,
|
|
53
|
+
class: cn(childProps.class, childProps.className, resolvedClassName),
|
|
54
|
+
"data-slot": "item",
|
|
55
|
+
"data-variant": resolvedVariant,
|
|
56
|
+
"data-size": resolvedSize
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
"data-slot": "item",
|
|
63
|
+
"data-variant": resolvedVariant,
|
|
64
|
+
"data-size": resolvedSize,
|
|
65
|
+
class: resolvedClassName,
|
|
66
|
+
...rest,
|
|
67
|
+
children
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
var ItemActions = ({ class: className, children, ...rest }) => /* @__PURE__ */ jsx("div", { "data-slot": "item-actions", class: cn("flex items-center gap-2", className), ...rest, children });
|
|
72
|
+
var ItemContent = ({ class: className, children, ...rest }) => /* @__PURE__ */ jsx(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
"data-slot": "item-content",
|
|
76
|
+
class: cn("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", className),
|
|
77
|
+
...rest,
|
|
78
|
+
children
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
var ItemDescription = ({ class: className, children, ...rest }) => /* @__PURE__ */ jsx(
|
|
82
|
+
"p",
|
|
83
|
+
{
|
|
84
|
+
"data-slot": "item-description",
|
|
85
|
+
class: cn(
|
|
86
|
+
"text-muted-foreground line-clamp-2 text-balance text-sm font-normal leading-normal",
|
|
87
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
88
|
+
className
|
|
89
|
+
),
|
|
90
|
+
...rest,
|
|
91
|
+
children
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
var ItemFooter = ({ class: className, children, ...rest }) => /* @__PURE__ */ jsx(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
"data-slot": "item-footer",
|
|
98
|
+
class: cn("flex basis-full items-center justify-between gap-2", className),
|
|
99
|
+
...rest,
|
|
100
|
+
children
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
var ItemGroup = ({ class: className, children, ...rest }) => /* @__PURE__ */ jsx(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
role: "list",
|
|
107
|
+
"data-slot": "item-group",
|
|
108
|
+
class: cn("group/item-group flex flex-col", className),
|
|
109
|
+
...rest,
|
|
110
|
+
children
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
var ItemHeader = ({ class: className, children, ...rest }) => /* @__PURE__ */ jsx(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
"data-slot": "item-header",
|
|
117
|
+
class: cn("flex basis-full items-center justify-between gap-2", className),
|
|
118
|
+
...rest,
|
|
119
|
+
children
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
var itemMedia = tv({
|
|
123
|
+
base: [
|
|
124
|
+
"flex shrink-0 items-center justify-center gap-2",
|
|
125
|
+
"group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start",
|
|
126
|
+
"[&_svg]:pointer-events-none"
|
|
127
|
+
],
|
|
128
|
+
variants: {
|
|
129
|
+
variant: {
|
|
130
|
+
default: "bg-transparent",
|
|
131
|
+
icon: "bg-muted size-8 rounded-sm border [&_svg:not([class*='size-'])]:size-4",
|
|
132
|
+
image: "size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
defaultVariants: {
|
|
136
|
+
variant: "default"
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
var ItemMedia = ({ variant, class: className, children, ...rest }) => {
|
|
140
|
+
const resolvedVariant = variant ?? "default";
|
|
141
|
+
return /* @__PURE__ */ jsx(
|
|
142
|
+
"div",
|
|
143
|
+
{
|
|
144
|
+
"data-slot": "item-media",
|
|
145
|
+
"data-variant": resolvedVariant,
|
|
146
|
+
class: cn(itemMedia({ variant: resolvedVariant, class: className })),
|
|
147
|
+
...rest,
|
|
148
|
+
children
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
var ItemSeparator = ({ class: className, ...rest }) => /* @__PURE__ */ jsx(
|
|
153
|
+
Separator,
|
|
154
|
+
{
|
|
155
|
+
orientation: "horizontal",
|
|
156
|
+
class: cn("my-0", className),
|
|
157
|
+
"data-slot": "item-separator",
|
|
158
|
+
...rest
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
var ItemTitle = ({ class: className, children, ...rest }) => /* @__PURE__ */ jsx(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
"data-slot": "item-title",
|
|
165
|
+
class: cn("flex w-fit items-center gap-2 text-sm font-medium leading-snug", className),
|
|
166
|
+
...rest,
|
|
167
|
+
children
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle };
|
|
172
|
+
//# sourceMappingURL=chunk-GIU6BZTW.js.map
|
|
173
|
+
//# sourceMappingURL=chunk-GIU6BZTW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/item/Item.tsx","../src/components/item/ItemActions.tsx","../src/components/item/ItemContent.tsx","../src/components/item/ItemDescription.tsx","../src/components/item/ItemFooter.tsx","../src/components/item/ItemGroup.tsx","../src/components/item/ItemHeader.tsx","../src/components/item/ItemMedia.tsx","../src/components/item/ItemSeparator.tsx","../src/components/item/ItemTitle.tsx"],"names":["jsx","tv"],"mappings":"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","file":"chunk-GIU6BZTW.js","sourcesContent":["import { type ComponentChildren, cloneElement, isValidElement, type JSX } from \"preact\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\nimport { cn } from \"../../lib/utils\";\n\nexport const item = tv({\n base: [\n \"group/item flex flex-wrap items-center rounded-md border border-transparent text-sm outline-none transition-[color,background-color,box-shadow] duration-100\",\n \"[a]:transition-colors [a]:hover:bg-accent/50\",\n \"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50\",\n ],\n variants: {\n variant: {\n default: \"bg-transparent hover:bg-muted/40\",\n outline: \"border-border hover:bg-accent/35\",\n muted: \"bg-muted/50 hover:bg-muted/65\",\n },\n size: {\n default: \"gap-4 p-4\",\n sm: \"gap-2.5 px-4 py-3\",\n xs: \"gap-2 px-3 py-2 text-xs\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n});\n\nexport type ItemProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, \"size\"> &\n VariantProps<typeof item> & {\n children?: ComponentChildren;\n asChild?: boolean;\n };\n\nexport const Item = ({\n variant,\n size,\n asChild = false,\n class: className,\n children,\n ...rest\n}: ItemProps) => {\n const resolvedVariant = variant ?? \"default\";\n const resolvedSize = size ?? \"default\";\n const resolvedClassName = item({\n variant: resolvedVariant,\n size: resolvedSize,\n class: className as string | undefined,\n });\n\n if (asChild) {\n if (!isValidElement(children)) {\n return null;\n }\n\n const childProps = (children.props ?? {}) as JSX.HTMLAttributes<HTMLElement> & {\n class?: string;\n className?: string;\n };\n\n return cloneElement(children, {\n ...childProps,\n ...(rest as JSX.HTMLAttributes<HTMLElement>),\n class: cn(childProps.class, childProps.className, resolvedClassName),\n \"data-slot\": \"item\",\n \"data-variant\": resolvedVariant,\n \"data-size\": resolvedSize,\n });\n }\n\n return (\n <div\n data-slot=\"item\"\n data-variant={resolvedVariant}\n data-size={resolvedSize}\n class={resolvedClassName}\n {...rest}\n >\n {children}\n </div>\n );\n};\n","import type { ComponentChildren, JSX } from \"preact\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ItemActionsProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children?: ComponentChildren;\n};\n\nexport const ItemActions = ({ class: className, children, ...rest }: ItemActionsProps) => (\n <div data-slot=\"item-actions\" class={cn(\"flex items-center gap-2\", className)} {...rest}>\n {children}\n </div>\n);\n","import type { ComponentChildren, JSX } from \"preact\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ItemContentProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children?: ComponentChildren;\n};\n\nexport const ItemContent = ({ class: className, children, ...rest }: ItemContentProps) => (\n <div\n data-slot=\"item-content\"\n class={cn(\"flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none\", className)}\n {...rest}\n >\n {children}\n </div>\n);\n","import type { ComponentChildren, JSX } from \"preact\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ItemDescriptionProps = JSX.HTMLAttributes<HTMLParagraphElement> & {\n children?: ComponentChildren;\n};\n\nexport const ItemDescription = ({ class: className, children, ...rest }: ItemDescriptionProps) => (\n <p\n data-slot=\"item-description\"\n class={cn(\n \"text-muted-foreground line-clamp-2 text-balance text-sm font-normal leading-normal\",\n \"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4\",\n className,\n )}\n {...rest}\n >\n {children}\n </p>\n);\n","import type { ComponentChildren, JSX } from \"preact\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ItemFooterProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children?: ComponentChildren;\n};\n\nexport const ItemFooter = ({ class: className, children, ...rest }: ItemFooterProps) => (\n <div\n data-slot=\"item-footer\"\n class={cn(\"flex basis-full items-center justify-between gap-2\", className)}\n {...rest}\n >\n {children}\n </div>\n);\n","import type { ComponentChildren, JSX } from \"preact\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ItemGroupProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children?: ComponentChildren;\n};\n\nexport const ItemGroup = ({ class: className, children, ...rest }: ItemGroupProps) => (\n <div\n role=\"list\"\n data-slot=\"item-group\"\n class={cn(\"group/item-group flex flex-col\", className)}\n {...rest}\n >\n {children}\n </div>\n);\n","import type { ComponentChildren, JSX } from \"preact\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ItemHeaderProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children?: ComponentChildren;\n};\n\nexport const ItemHeader = ({ class: className, children, ...rest }: ItemHeaderProps) => (\n <div\n data-slot=\"item-header\"\n class={cn(\"flex basis-full items-center justify-between gap-2\", className)}\n {...rest}\n >\n {children}\n </div>\n);\n","import type { ComponentChildren, JSX } from \"preact\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\nimport { cn } from \"../../lib/utils\";\n\nexport const itemMedia = tv({\n base: [\n \"flex shrink-0 items-center justify-center gap-2\",\n \"group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start\",\n \"[&_svg]:pointer-events-none\",\n ],\n variants: {\n variant: {\n default: \"bg-transparent\",\n icon: \"bg-muted size-8 rounded-sm border [&_svg:not([class*='size-'])]:size-4\",\n image: \"size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n});\n\nexport type ItemMediaProps = JSX.HTMLAttributes<HTMLDivElement> &\n VariantProps<typeof itemMedia> & {\n children?: ComponentChildren;\n };\n\nexport const ItemMedia = ({ variant, class: className, children, ...rest }: ItemMediaProps) => {\n const resolvedVariant = variant ?? \"default\";\n return (\n <div\n data-slot=\"item-media\"\n data-variant={resolvedVariant}\n class={cn(itemMedia({ variant: resolvedVariant, class: className as string | undefined }))}\n {...rest}\n >\n {children}\n </div>\n );\n};\n","import { cn } from \"../../lib/utils\";\nimport { Separator, type SeparatorProps } from \"../separator/Separator\";\n\nexport const ItemSeparator = ({ class: className, ...rest }: SeparatorProps) => (\n <Separator\n orientation=\"horizontal\"\n class={cn(\"my-0\", className)}\n data-slot=\"item-separator\"\n {...rest}\n />\n);\n","import type { ComponentChildren, JSX } from \"preact\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ItemTitleProps = JSX.HTMLAttributes<HTMLDivElement> & {\n children?: ComponentChildren;\n};\n\nexport const ItemTitle = ({ class: className, children, ...rest }: ItemTitleProps) => (\n <div\n data-slot=\"item-title\"\n class={cn(\"flex w-fit items-center gap-2 text-sm font-medium leading-snug\", className)}\n {...rest}\n >\n {children}\n </div>\n);\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { signal } from '@preact/signals';
|
|
2
|
+
import { jsx, jsxs } from 'preact/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/components/sonner/sonner-store.ts
|
|
5
|
+
var sonnerToasts = signal([]);
|
|
6
|
+
var nextId = () => `sonner-${Math.random().toString(36).slice(2, 10)}`;
|
|
7
|
+
var sonner = (args) => {
|
|
8
|
+
const toast = { id: nextId(), title: args.title, description: args.description };
|
|
9
|
+
sonnerToasts.value = [...sonnerToasts.value, toast];
|
|
10
|
+
return toast.id;
|
|
11
|
+
};
|
|
12
|
+
var dismissSonner = (id) => {
|
|
13
|
+
sonnerToasts.value = sonnerToasts.value.filter((toast) => toast.id !== id);
|
|
14
|
+
};
|
|
15
|
+
var Sonner = () => /* @__PURE__ */ jsx("div", { "data-slot": "sonner", class: "fixed right-4 bottom-4 z-[100] grid gap-2", children: sonnerToasts.value.map((toast) => /* @__PURE__ */ jsxs("div", { class: "min-w-64 rounded-md border bg-popover p-3 shadow-md", children: [
|
|
16
|
+
/* @__PURE__ */ jsx("div", { class: "text-sm font-medium", children: toast.title }),
|
|
17
|
+
toast.description ? /* @__PURE__ */ jsx("div", { class: "mt-1 text-xs text-muted-foreground", children: toast.description }) : null,
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
"button",
|
|
20
|
+
{
|
|
21
|
+
type: "button",
|
|
22
|
+
class: "mt-2 text-xs underline",
|
|
23
|
+
onClick: () => dismissSonner(toast.id),
|
|
24
|
+
children: "Dismiss"
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
] }, toast.id)) });
|
|
28
|
+
|
|
29
|
+
// src/components/sonner/index.ts
|
|
30
|
+
var sonner_default = Sonner;
|
|
31
|
+
|
|
32
|
+
export { Sonner, dismissSonner, sonner, sonner_default };
|
|
33
|
+
//# sourceMappingURL=chunk-HAAXVB3R.js.map
|
|
34
|
+
//# sourceMappingURL=chunk-HAAXVB3R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/sonner/sonner-store.ts","../src/components/sonner/Sonner.tsx","../src/components/sonner/index.ts"],"names":[],"mappings":";;;;AAQO,IAAM,YAAA,GAAe,MAAA,CAAsB,EAAE,CAAA;AAEpD,IAAM,MAAA,GAAS,MAAM,CAAA,OAAA,EAAU,IAAA,CAAK,MAAA,EAAO,CAAE,QAAA,CAAS,EAAE,CAAA,CAAE,KAAA,CAAM,CAAA,EAAG,EAAE,CAAC,CAAA,CAAA;AAE/D,IAAM,MAAA,GAAS,CAAC,IAAA,KAAkD;AACvE,EAAA,MAAM,KAAA,GAAQ,EAAE,EAAA,EAAI,MAAA,EAAO,EAAG,OAAO,IAAA,CAAK,KAAA,EAAO,WAAA,EAAa,IAAA,CAAK,WAAA,EAAY;AAC/E,EAAA,YAAA,CAAa,KAAA,GAAQ,CAAC,GAAG,YAAA,CAAa,OAAO,KAAK,CAAA;AAClD,EAAA,OAAO,KAAA,CAAM,EAAA;AACf;AAEO,IAAM,aAAA,GAAgB,CAAC,EAAA,KAAe;AAC3C,EAAA,YAAA,CAAa,KAAA,GAAQ,aAAa,KAAA,CAAM,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,OAAO,EAAE,CAAA;AAC3E;AClBO,IAAM,SAAS,sBACpB,GAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAU,UAAS,KAAA,EAAM,2CAAA,EAC3B,QAAA,EAAA,YAAA,CAAa,KAAA,CAAM,IAAI,CAAC,KAAA,qBACvB,IAAA,CAAC,KAAA,EAAA,EAAmB,OAAM,qDAAA,EACxB,QAAA,EAAA;AAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,KAAA,EAAM,qBAAA,EAAuB,QAAA,EAAA,KAAA,CAAM,KAAA,EAAM,CAAA;AAAA,EAC7C,KAAA,CAAM,8BACL,GAAA,CAAC,KAAA,EAAA,EAAI,OAAM,oCAAA,EAAsC,QAAA,EAAA,KAAA,CAAM,aAAY,CAAA,GACjE,IAAA;AAAA,kBACJ,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,KAAA,EAAM,wBAAA;AAAA,MACN,OAAA,EAAS,MAAM,aAAA,CAAc,KAAA,CAAM,EAAE,CAAA;AAAA,MACtC,QAAA,EAAA;AAAA;AAAA;AAED,CAAA,EAAA,EAXQ,KAAA,CAAM,EAYhB,CACD,CAAA,EACH;;;ACdF,IAAO,cAAA,GAAQ","file":"chunk-HAAXVB3R.js","sourcesContent":["import { signal } from \"@preact/signals\";\n\nexport type SonnerToast = {\n id: string;\n title: string;\n description?: string;\n};\n\nexport const sonnerToasts = signal<SonnerToast[]>([]);\n\nconst nextId = () => `sonner-${Math.random().toString(36).slice(2, 10)}`;\n\nexport const sonner = (args: { title: string; description?: string }) => {\n const toast = { id: nextId(), title: args.title, description: args.description };\n sonnerToasts.value = [...sonnerToasts.value, toast];\n return toast.id;\n};\n\nexport const dismissSonner = (id: string) => {\n sonnerToasts.value = sonnerToasts.value.filter((toast) => toast.id !== id);\n};\n","import { dismissSonner, sonnerToasts } from \"./sonner-store\";\n\nexport const Sonner = () => (\n <div data-slot=\"sonner\" class=\"fixed right-4 bottom-4 z-[100] grid gap-2\">\n {sonnerToasts.value.map((toast) => (\n <div key={toast.id} class=\"min-w-64 rounded-md border bg-popover p-3 shadow-md\">\n <div class=\"text-sm font-medium\">{toast.title}</div>\n {toast.description ? (\n <div class=\"mt-1 text-xs text-muted-foreground\">{toast.description}</div>\n ) : null}\n <button\n type=\"button\"\n class=\"mt-2 text-xs underline\"\n onClick={() => dismissSonner(toast.id)}\n >\n Dismiss\n </button>\n </div>\n ))}\n </div>\n);\n","import { Sonner } from \"./Sonner\";\nimport { dismissSonner, sonner } from \"./sonner-store\";\n\nexport { dismissSonner, Sonner, sonner };\n\nexport default Sonner;\n"]}
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { signal } from '@preact/signals';
|
|
2
|
+
import { createContext, isValidElement, cloneElement } from 'preact';
|
|
3
|
+
import { useContext, useMemo, useRef, useEffect, useId, useState, useLayoutEffect } from 'preact/hooks';
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'preact/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/components/tooltip/Tooltip.tsx
|
|
7
|
+
var TooltipProviderContext = createContext(null);
|
|
8
|
+
var TooltipContext = createContext(null);
|
|
9
|
+
var useTooltip = () => {
|
|
10
|
+
const context = useContext(TooltipContext);
|
|
11
|
+
if (!context) throw new Error("Tooltip subcomponents must be used within Tooltip");
|
|
12
|
+
return context;
|
|
13
|
+
};
|
|
14
|
+
var TooltipProvider = ({
|
|
15
|
+
delayDuration = 250,
|
|
16
|
+
closeDelayDuration = 120,
|
|
17
|
+
disableHoverableContent = false,
|
|
18
|
+
children
|
|
19
|
+
}) => /* @__PURE__ */ jsx(
|
|
20
|
+
TooltipProviderContext.Provider,
|
|
21
|
+
{
|
|
22
|
+
value: { delayDuration, closeDelayDuration, disableHoverableContent },
|
|
23
|
+
children
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
var Tooltip = ({
|
|
27
|
+
defaultOpen = false,
|
|
28
|
+
open: controlledOpen,
|
|
29
|
+
onOpenChange,
|
|
30
|
+
delayDuration,
|
|
31
|
+
closeDelayDuration,
|
|
32
|
+
disableHoverableContent,
|
|
33
|
+
children,
|
|
34
|
+
...rest
|
|
35
|
+
}) => {
|
|
36
|
+
const provider = useContext(TooltipProviderContext);
|
|
37
|
+
const resolvedDelayDuration = delayDuration ?? provider?.delayDuration ?? 250;
|
|
38
|
+
const resolvedCloseDelayDuration = closeDelayDuration ?? provider?.closeDelayDuration ?? 120;
|
|
39
|
+
const resolvedDisableHoverableContent = disableHoverableContent ?? provider?.disableHoverableContent ?? false;
|
|
40
|
+
const open = useMemo(() => signal(defaultOpen), []);
|
|
41
|
+
const contentId = useMemo(() => signal(void 0), []);
|
|
42
|
+
const openTimerRef = useRef(null);
|
|
43
|
+
const closeTimerRef = useRef(null);
|
|
44
|
+
const { style, ...remainingProps } = rest;
|
|
45
|
+
const isControlled = typeof controlledOpen === "boolean";
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (isControlled) {
|
|
48
|
+
open.value = controlledOpen;
|
|
49
|
+
}
|
|
50
|
+
}, [controlledOpen, isControlled, open]);
|
|
51
|
+
const cancelTimers = () => {
|
|
52
|
+
if (openTimerRef.current !== null) {
|
|
53
|
+
window.clearTimeout(openTimerRef.current);
|
|
54
|
+
openTimerRef.current = null;
|
|
55
|
+
}
|
|
56
|
+
if (closeTimerRef.current !== null) {
|
|
57
|
+
window.clearTimeout(closeTimerRef.current);
|
|
58
|
+
closeTimerRef.current = null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const setOpen = (next) => {
|
|
62
|
+
cancelTimers();
|
|
63
|
+
if (isControlled) {
|
|
64
|
+
onOpenChange?.(next);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
open.value = next;
|
|
68
|
+
onOpenChange?.(next);
|
|
69
|
+
};
|
|
70
|
+
const setContentId = (id) => {
|
|
71
|
+
contentId.value = id;
|
|
72
|
+
};
|
|
73
|
+
const openWithDelay = () => {
|
|
74
|
+
if (open.value) return;
|
|
75
|
+
if (closeTimerRef.current !== null) {
|
|
76
|
+
window.clearTimeout(closeTimerRef.current);
|
|
77
|
+
closeTimerRef.current = null;
|
|
78
|
+
}
|
|
79
|
+
if (openTimerRef.current !== null) return;
|
|
80
|
+
openTimerRef.current = window.setTimeout(() => {
|
|
81
|
+
setOpen(true);
|
|
82
|
+
openTimerRef.current = null;
|
|
83
|
+
}, resolvedDelayDuration);
|
|
84
|
+
};
|
|
85
|
+
const closeWithDelay = () => {
|
|
86
|
+
if (!open.value) return;
|
|
87
|
+
if (openTimerRef.current !== null) {
|
|
88
|
+
window.clearTimeout(openTimerRef.current);
|
|
89
|
+
openTimerRef.current = null;
|
|
90
|
+
}
|
|
91
|
+
if (closeTimerRef.current !== null) return;
|
|
92
|
+
closeTimerRef.current = window.setTimeout(() => {
|
|
93
|
+
setOpen(false);
|
|
94
|
+
closeTimerRef.current = null;
|
|
95
|
+
}, resolvedCloseDelayDuration);
|
|
96
|
+
};
|
|
97
|
+
useEffect(() => cancelTimers, []);
|
|
98
|
+
const resolvedStyle = typeof style === "object" && style && !("value" in style) ? style : {};
|
|
99
|
+
const mergedStyle = {
|
|
100
|
+
position: "relative",
|
|
101
|
+
display: "inline-flex",
|
|
102
|
+
...resolvedStyle
|
|
103
|
+
};
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
TooltipContext.Provider,
|
|
106
|
+
{
|
|
107
|
+
value: {
|
|
108
|
+
open,
|
|
109
|
+
contentId,
|
|
110
|
+
disableHoverableContent: resolvedDisableHoverableContent,
|
|
111
|
+
setOpen,
|
|
112
|
+
openWithDelay,
|
|
113
|
+
closeWithDelay,
|
|
114
|
+
setContentId,
|
|
115
|
+
cancelTimers
|
|
116
|
+
},
|
|
117
|
+
children: /* @__PURE__ */ jsx(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
"data-slot": "tooltip",
|
|
121
|
+
"data-state": open.value ? "open" : "closed",
|
|
122
|
+
"data-delay-duration": resolvedDelayDuration,
|
|
123
|
+
style: mergedStyle,
|
|
124
|
+
onKeyDown: (event) => {
|
|
125
|
+
if (event.key === "Escape") {
|
|
126
|
+
setOpen(false);
|
|
127
|
+
event.stopPropagation();
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
...remainingProps,
|
|
131
|
+
children
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
var TooltipContent = ({
|
|
138
|
+
asChild = false,
|
|
139
|
+
side = "top",
|
|
140
|
+
align = "center",
|
|
141
|
+
sideOffset = 8,
|
|
142
|
+
alignOffset = 0,
|
|
143
|
+
collisionPadding = 8,
|
|
144
|
+
forceMount = false,
|
|
145
|
+
children,
|
|
146
|
+
...rest
|
|
147
|
+
}) => {
|
|
148
|
+
const tooltip = useTooltip();
|
|
149
|
+
const contentId = useId();
|
|
150
|
+
const contentRef = useRef(null);
|
|
151
|
+
const [resolvedSide, setResolvedSide] = useState(side);
|
|
152
|
+
const prevSideRef = useRef(side);
|
|
153
|
+
const flipTimerRef = useRef(null);
|
|
154
|
+
const [isFlipAnimating, setIsFlipAnimating] = useState(false);
|
|
155
|
+
const [dynamicClamp, setDynamicClamp] = useState({});
|
|
156
|
+
const [arrowStyle, setArrowStyle] = useState({});
|
|
157
|
+
const { onMouseEnter, onMouseLeave, style, ...remainingProps } = rest;
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
tooltip.setContentId(contentId);
|
|
160
|
+
return () => {
|
|
161
|
+
tooltip.setContentId(void 0);
|
|
162
|
+
};
|
|
163
|
+
}, [contentId, tooltip]);
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
setResolvedSide(side);
|
|
166
|
+
}, [side, tooltip.open.value]);
|
|
167
|
+
useEffect(
|
|
168
|
+
() => () => {
|
|
169
|
+
if (flipTimerRef.current !== null) {
|
|
170
|
+
window.clearTimeout(flipTimerRef.current);
|
|
171
|
+
flipTimerRef.current = null;
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
[]
|
|
175
|
+
);
|
|
176
|
+
useLayoutEffect(() => {
|
|
177
|
+
if (!tooltip.open.value || !contentRef.current) return;
|
|
178
|
+
const contentEl = contentRef.current;
|
|
179
|
+
const triggerRect = contentEl.parentElement?.getBoundingClientRect();
|
|
180
|
+
const contentRect = contentEl.getBoundingClientRect();
|
|
181
|
+
if (!triggerRect) return;
|
|
182
|
+
const viewportWidth = window.innerWidth;
|
|
183
|
+
const viewportHeight = window.innerHeight;
|
|
184
|
+
const fitsTop = triggerRect.top >= contentRect.height + sideOffset + collisionPadding;
|
|
185
|
+
const fitsBottom = viewportHeight - triggerRect.bottom >= contentRect.height + sideOffset + collisionPadding;
|
|
186
|
+
const fitsLeft = triggerRect.left >= contentRect.width + sideOffset + collisionPadding;
|
|
187
|
+
const fitsRight = viewportWidth - triggerRect.right >= contentRect.width + sideOffset + collisionPadding;
|
|
188
|
+
let nextSide = side;
|
|
189
|
+
if (side === "top" && !fitsTop && fitsBottom) nextSide = "bottom";
|
|
190
|
+
if (side === "bottom" && !fitsBottom && fitsTop) nextSide = "top";
|
|
191
|
+
if (side === "left" && !fitsLeft && fitsRight) nextSide = "right";
|
|
192
|
+
if (side === "right" && !fitsRight && fitsLeft) nextSide = "left";
|
|
193
|
+
if (nextSide !== resolvedSide) {
|
|
194
|
+
setResolvedSide(nextSide);
|
|
195
|
+
}
|
|
196
|
+
if (tooltip.open.value && nextSide !== prevSideRef.current) {
|
|
197
|
+
setIsFlipAnimating(true);
|
|
198
|
+
if (flipTimerRef.current !== null) {
|
|
199
|
+
window.clearTimeout(flipTimerRef.current);
|
|
200
|
+
}
|
|
201
|
+
flipTimerRef.current = window.setTimeout(() => {
|
|
202
|
+
setIsFlipAnimating(false);
|
|
203
|
+
flipTimerRef.current = null;
|
|
204
|
+
}, 140);
|
|
205
|
+
prevSideRef.current = nextSide;
|
|
206
|
+
}
|
|
207
|
+
const nextClamp = {};
|
|
208
|
+
if (nextSide === "top" || nextSide === "bottom") {
|
|
209
|
+
const left = contentRect.left;
|
|
210
|
+
const right = contentRect.right;
|
|
211
|
+
if (left < collisionPadding) {
|
|
212
|
+
nextClamp.left = `${collisionPadding}px`;
|
|
213
|
+
nextClamp.transform = "none";
|
|
214
|
+
} else if (right > viewportWidth - collisionPadding) {
|
|
215
|
+
nextClamp.right = `${collisionPadding}px`;
|
|
216
|
+
nextClamp.left = "auto";
|
|
217
|
+
nextClamp.transform = "none";
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
const top = contentRect.top;
|
|
221
|
+
const bottom = contentRect.bottom;
|
|
222
|
+
if (top < collisionPadding) {
|
|
223
|
+
nextClamp.top = `${collisionPadding}px`;
|
|
224
|
+
nextClamp.transform = "none";
|
|
225
|
+
} else if (bottom > viewportHeight - collisionPadding) {
|
|
226
|
+
nextClamp.bottom = `${collisionPadding}px`;
|
|
227
|
+
nextClamp.top = "auto";
|
|
228
|
+
nextClamp.transform = "none";
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
setDynamicClamp(nextClamp);
|
|
232
|
+
const arrowInset = 12;
|
|
233
|
+
const nextArrowStyle = {};
|
|
234
|
+
if (nextSide === "top" || nextSide === "bottom") {
|
|
235
|
+
const triggerCenterX = triggerRect.left + triggerRect.width / 2;
|
|
236
|
+
const desired = triggerCenterX - contentRect.left;
|
|
237
|
+
const clamped = Math.max(arrowInset, Math.min(contentRect.width - arrowInset, desired));
|
|
238
|
+
nextArrowStyle["--tooltip-arrow-x"] = `${clamped}px`;
|
|
239
|
+
nextArrowStyle["--tooltip-arrow-y"] = void 0;
|
|
240
|
+
} else {
|
|
241
|
+
const triggerCenterY = triggerRect.top + triggerRect.height / 2;
|
|
242
|
+
const desired = triggerCenterY - contentRect.top;
|
|
243
|
+
const clamped = Math.max(arrowInset, Math.min(contentRect.height - arrowInset, desired));
|
|
244
|
+
nextArrowStyle["--tooltip-arrow-y"] = `${clamped}px`;
|
|
245
|
+
nextArrowStyle["--tooltip-arrow-x"] = void 0;
|
|
246
|
+
}
|
|
247
|
+
setArrowStyle(nextArrowStyle);
|
|
248
|
+
}, [align, collisionPadding, resolvedSide, side, sideOffset, tooltip.open.value]);
|
|
249
|
+
if (!tooltip.open.value && !forceMount) return null;
|
|
250
|
+
const baseSideStyles = {
|
|
251
|
+
top: { bottom: `calc(100% + ${sideOffset}px)` },
|
|
252
|
+
right: { left: `calc(100% + ${sideOffset}px)` },
|
|
253
|
+
bottom: { top: `calc(100% + ${sideOffset}px)` },
|
|
254
|
+
left: { right: `calc(100% + ${sideOffset}px)` }
|
|
255
|
+
};
|
|
256
|
+
const alignStyles = {
|
|
257
|
+
start: resolvedSide === "top" || resolvedSide === "bottom" ? { left: `${alignOffset}px` } : { top: `${alignOffset}px` },
|
|
258
|
+
center: resolvedSide === "top" || resolvedSide === "bottom" ? { left: `calc(50% + ${alignOffset}px)`, transform: "translateX(-50%)" } : { top: `calc(50% + ${alignOffset}px)`, transform: "translateY(-50%)" },
|
|
259
|
+
end: resolvedSide === "top" || resolvedSide === "bottom" ? { right: `${alignOffset}px` } : { bottom: `${alignOffset}px` }
|
|
260
|
+
};
|
|
261
|
+
const resolvedStyle = typeof style === "object" && style && !("value" in style) ? style : {};
|
|
262
|
+
const mergedStyle = {
|
|
263
|
+
position: "absolute",
|
|
264
|
+
zIndex: 50,
|
|
265
|
+
maxWidth: "min(22rem, 92vw)",
|
|
266
|
+
...baseSideStyles[resolvedSide],
|
|
267
|
+
...alignStyles[align],
|
|
268
|
+
...dynamicClamp,
|
|
269
|
+
...arrowStyle,
|
|
270
|
+
...resolvedStyle
|
|
271
|
+
};
|
|
272
|
+
const commonProps = {
|
|
273
|
+
id: contentId,
|
|
274
|
+
role: "tooltip",
|
|
275
|
+
"data-slot": "tooltip-content",
|
|
276
|
+
"data-state": tooltip.open.value ? "open" : "closed",
|
|
277
|
+
"data-side": resolvedSide,
|
|
278
|
+
"data-align": align,
|
|
279
|
+
"data-flip-animating": isFlipAnimating ? "true" : "false",
|
|
280
|
+
onMouseEnter: (event) => {
|
|
281
|
+
if (!tooltip.disableHoverableContent) {
|
|
282
|
+
tooltip.cancelTimers();
|
|
283
|
+
tooltip.setOpen(true);
|
|
284
|
+
}
|
|
285
|
+
onMouseEnter?.(event);
|
|
286
|
+
},
|
|
287
|
+
onMouseLeave: (event) => {
|
|
288
|
+
tooltip.closeWithDelay();
|
|
289
|
+
onMouseLeave?.(event);
|
|
290
|
+
},
|
|
291
|
+
style: mergedStyle
|
|
292
|
+
};
|
|
293
|
+
if (asChild) {
|
|
294
|
+
if (!isValidElement(children)) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
const childProps = children.props ?? {};
|
|
298
|
+
const nextChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
299
|
+
childProps.children,
|
|
300
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", "data-slot": "tooltip-arrow" })
|
|
301
|
+
] });
|
|
302
|
+
return cloneElement(children, {
|
|
303
|
+
...childProps,
|
|
304
|
+
...commonProps,
|
|
305
|
+
...remainingProps,
|
|
306
|
+
children: nextChildren
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
return /* @__PURE__ */ jsxs(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
...commonProps,
|
|
313
|
+
...remainingProps,
|
|
314
|
+
ref: (element) => {
|
|
315
|
+
contentRef.current = element;
|
|
316
|
+
},
|
|
317
|
+
children: [
|
|
318
|
+
children,
|
|
319
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", "data-slot": "tooltip-arrow" })
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
);
|
|
323
|
+
};
|
|
324
|
+
var TooltipTrigger = ({ asChild = false, children, ...rest }) => {
|
|
325
|
+
const tooltip = useTooltip();
|
|
326
|
+
const {
|
|
327
|
+
onMouseEnter,
|
|
328
|
+
onMouseLeave,
|
|
329
|
+
onPointerEnter,
|
|
330
|
+
onPointerLeave,
|
|
331
|
+
onFocus,
|
|
332
|
+
onBlur,
|
|
333
|
+
"aria-describedby": ariaDescribedBy,
|
|
334
|
+
...remainingProps
|
|
335
|
+
} = rest;
|
|
336
|
+
const describedBy = tooltip.open.value ? tooltip.contentId.value : void 0;
|
|
337
|
+
const commonProps = {
|
|
338
|
+
"data-slot": "tooltip-trigger",
|
|
339
|
+
"aria-describedby": describedBy ?? ariaDescribedBy,
|
|
340
|
+
"data-state": tooltip.open.value ? "open" : "closed",
|
|
341
|
+
onPointerEnter: (event) => {
|
|
342
|
+
tooltip.openWithDelay();
|
|
343
|
+
onPointerEnter?.(event);
|
|
344
|
+
},
|
|
345
|
+
onPointerLeave: (event) => {
|
|
346
|
+
tooltip.closeWithDelay();
|
|
347
|
+
onPointerLeave?.(event);
|
|
348
|
+
},
|
|
349
|
+
onMouseEnter: (event) => {
|
|
350
|
+
tooltip.openWithDelay();
|
|
351
|
+
onMouseEnter?.(event);
|
|
352
|
+
},
|
|
353
|
+
onMouseLeave: (event) => {
|
|
354
|
+
tooltip.closeWithDelay();
|
|
355
|
+
onMouseLeave?.(event);
|
|
356
|
+
},
|
|
357
|
+
onFocus: (event) => {
|
|
358
|
+
tooltip.setOpen(true);
|
|
359
|
+
onFocus?.(event);
|
|
360
|
+
},
|
|
361
|
+
onBlur: (event) => {
|
|
362
|
+
tooltip.setOpen(false);
|
|
363
|
+
onBlur?.(event);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
if (asChild) {
|
|
367
|
+
if (!isValidElement(children)) {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
const childProps = children.props ?? {};
|
|
371
|
+
return cloneElement(children, {
|
|
372
|
+
...childProps,
|
|
373
|
+
...commonProps,
|
|
374
|
+
...remainingProps
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
return /* @__PURE__ */ jsx(
|
|
378
|
+
"span",
|
|
379
|
+
{
|
|
380
|
+
tabIndex: 0,
|
|
381
|
+
...commonProps,
|
|
382
|
+
...remainingProps,
|
|
383
|
+
children
|
|
384
|
+
}
|
|
385
|
+
);
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
// src/components/tooltip/index.ts
|
|
389
|
+
var tooltip_default = {
|
|
390
|
+
Provider: TooltipProvider,
|
|
391
|
+
Root: Tooltip,
|
|
392
|
+
Trigger: TooltipTrigger,
|
|
393
|
+
Content: TooltipContent
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, tooltip_default };
|
|
397
|
+
//# sourceMappingURL=chunk-HTSAUMF5.js.map
|
|
398
|
+
//# sourceMappingURL=chunk-HTSAUMF5.js.map
|