@kamod-ui/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +9 -0
- package/dist/Accordion-D1PiNspd.d.ts +39 -0
- package/dist/AlertDialog-CpnCfDdN.d.ts +64 -0
- package/dist/Button-tRKMr8-H.d.ts +84 -0
- package/dist/CalendarDateTimePanel-B3J8OlSc.d.ts +79 -0
- package/dist/Carousel-DvlcMPpB.d.ts +41 -0
- package/dist/Chart-Ax22S5_N.d.ts +10 -0
- package/dist/Checkbox-DBbLYq6Q.d.ts +12 -0
- package/dist/Collapsible-DSZCp0tm.d.ts +34 -0
- package/dist/ComboboxInlineInput-CB7CEXzy.d.ts +135 -0
- package/dist/CommandSeparator-pJQnB9Lu.d.ts +47 -0
- package/dist/DataTable-zNTTdYVU.d.ts +13 -0
- package/dist/DatePicker-AFAYh5Ca.d.ts +20 -0
- package/dist/Dialog-CqCI4s9U.d.ts +28 -0
- package/dist/DialogContent-9VJGDt5l.d.ts +24 -0
- package/dist/DialogHeader-CYT7iUDq.d.ts +13 -0
- package/dist/DialogTitle-CvcRlZ_Z.d.ts +13 -0
- package/dist/Direction-25ZOt0gW.d.ts +24 -0
- package/dist/Drawer-BOPihYBJ.d.ts +41 -0
- package/dist/Dropdown-uPFaMqkB.d.ts +143 -0
- package/dist/EmptyTitle-J8rVLcJ3.d.ts +59 -0
- package/dist/FieldTitle-aSgThW-B.d.ts +100 -0
- package/dist/HoverCard-OSnOE6pE.d.ts +52 -0
- package/dist/Input-Cem05el9.d.ts +27 -0
- package/dist/Menubar-DwYDW4w2.d.ts +88 -0
- package/dist/PopoverTrigger-B6kK73gh.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-B41Emmis.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-DFJR_P2D.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-BtRWVyCA.d.ts +40 -0
- package/dist/Typography-ccTtE182.d.ts +64 -0
- package/dist/chunk-2UHCXHAX.js +119 -0
- package/dist/chunk-2UHCXHAX.js.map +1 -0
- package/dist/chunk-2XNWLXG2.js +12 -0
- package/dist/chunk-2XNWLXG2.js.map +1 -0
- package/dist/chunk-3EHH62ZA.js +175 -0
- package/dist/chunk-3EHH62ZA.js.map +1 -0
- package/dist/chunk-3GKUUTSA.js +586 -0
- package/dist/chunk-3GKUUTSA.js.map +1 -0
- package/dist/chunk-3IT2RVO6.js +151 -0
- package/dist/chunk-3IT2RVO6.js.map +1 -0
- package/dist/chunk-3WAPI4KR.js +36 -0
- package/dist/chunk-3WAPI4KR.js.map +1 -0
- package/dist/chunk-44YLIQIS.js +15 -0
- package/dist/chunk-44YLIQIS.js.map +1 -0
- package/dist/chunk-4AJM7IA4.js +9 -0
- package/dist/chunk-4AJM7IA4.js.map +1 -0
- package/dist/chunk-4HX6SEWP.js +24 -0
- package/dist/chunk-4HX6SEWP.js.map +1 -0
- package/dist/chunk-6FTWMOHU.js +478 -0
- package/dist/chunk-6FTWMOHU.js.map +1 -0
- package/dist/chunk-6ZXYDBPR.js +304 -0
- package/dist/chunk-6ZXYDBPR.js.map +1 -0
- package/dist/chunk-7E2ZPDVI.js +224 -0
- package/dist/chunk-7E2ZPDVI.js.map +1 -0
- package/dist/chunk-7HZUM5ZQ.js +85 -0
- package/dist/chunk-7HZUM5ZQ.js.map +1 -0
- package/dist/chunk-7MECYLKS.js +375 -0
- package/dist/chunk-7MECYLKS.js.map +1 -0
- package/dist/chunk-7TDS7TC6.js +49 -0
- package/dist/chunk-7TDS7TC6.js.map +1 -0
- package/dist/chunk-7ZXJRNJO.js +26 -0
- package/dist/chunk-7ZXJRNJO.js.map +1 -0
- package/dist/chunk-AVCG4W6D.js +122 -0
- package/dist/chunk-AVCG4W6D.js.map +1 -0
- package/dist/chunk-BF3F5SJX.js +89 -0
- package/dist/chunk-BF3F5SJX.js.map +1 -0
- package/dist/chunk-BHMKSFES.js +195 -0
- package/dist/chunk-BHMKSFES.js.map +1 -0
- package/dist/chunk-BMF5SGYP.js +45 -0
- package/dist/chunk-BMF5SGYP.js.map +1 -0
- package/dist/chunk-D25ZQ36E.js +273 -0
- package/dist/chunk-D25ZQ36E.js.map +1 -0
- package/dist/chunk-D5W5YHJZ.js +426 -0
- package/dist/chunk-D5W5YHJZ.js.map +1 -0
- package/dist/chunk-DHBILREV.js +70 -0
- package/dist/chunk-DHBILREV.js.map +1 -0
- package/dist/chunk-DJ4PFETN.js +17 -0
- package/dist/chunk-DJ4PFETN.js.map +1 -0
- package/dist/chunk-DKXUKLZT.js +342 -0
- package/dist/chunk-DKXUKLZT.js.map +1 -0
- package/dist/chunk-EL2HT25C.js +9 -0
- package/dist/chunk-EL2HT25C.js.map +1 -0
- package/dist/chunk-FDNPBI2Z.js +26 -0
- package/dist/chunk-FDNPBI2Z.js.map +1 -0
- package/dist/chunk-FWCN47RC.js +65 -0
- package/dist/chunk-FWCN47RC.js.map +1 -0
- package/dist/chunk-G6PBJZYF.js +114 -0
- package/dist/chunk-G6PBJZYF.js.map +1 -0
- package/dist/chunk-GFF5OT46.js +80 -0
- package/dist/chunk-GFF5OT46.js.map +1 -0
- package/dist/chunk-GLWYIUE5.js +242 -0
- package/dist/chunk-GLWYIUE5.js.map +1 -0
- package/dist/chunk-HEQRODRF.js +110 -0
- package/dist/chunk-HEQRODRF.js.map +1 -0
- package/dist/chunk-HGTFOOUL.js +61 -0
- package/dist/chunk-HGTFOOUL.js.map +1 -0
- package/dist/chunk-HNESOMVN.js +18 -0
- package/dist/chunk-HNESOMVN.js.map +1 -0
- package/dist/chunk-I2PR3HXC.js +51 -0
- package/dist/chunk-I2PR3HXC.js.map +1 -0
- package/dist/chunk-IGGEBO7K.js +8 -0
- package/dist/chunk-IGGEBO7K.js.map +1 -0
- package/dist/chunk-J2Z2LSXM.js +26 -0
- package/dist/chunk-J2Z2LSXM.js.map +1 -0
- package/dist/chunk-JC7JMWSH.js +109 -0
- package/dist/chunk-JC7JMWSH.js.map +1 -0
- package/dist/chunk-JZRMLE4X.js +77 -0
- package/dist/chunk-JZRMLE4X.js.map +1 -0
- package/dist/chunk-KBXDU3G4.js +382 -0
- package/dist/chunk-KBXDU3G4.js.map +1 -0
- package/dist/chunk-KF34SFFZ.js +18 -0
- package/dist/chunk-KF34SFFZ.js.map +1 -0
- package/dist/chunk-L42B6QZS.js +524 -0
- package/dist/chunk-L42B6QZS.js.map +1 -0
- package/dist/chunk-LGO5HXMG.js +592 -0
- package/dist/chunk-LGO5HXMG.js.map +1 -0
- package/dist/chunk-LVK44RMS.js +78 -0
- package/dist/chunk-LVK44RMS.js.map +1 -0
- package/dist/chunk-N2LRB6TA.js +8 -0
- package/dist/chunk-N2LRB6TA.js.map +1 -0
- package/dist/chunk-NHTY2HD2.js +8 -0
- package/dist/chunk-NHTY2HD2.js.map +1 -0
- package/dist/chunk-NJUXP5FM.js +392 -0
- package/dist/chunk-NJUXP5FM.js.map +1 -0
- package/dist/chunk-NPHECLV5.js +94 -0
- package/dist/chunk-NPHECLV5.js.map +1 -0
- package/dist/chunk-NXVAR6P2.js +79 -0
- package/dist/chunk-NXVAR6P2.js.map +1 -0
- package/dist/chunk-OMXWBB67.js +9 -0
- package/dist/chunk-OMXWBB67.js.map +1 -0
- package/dist/chunk-PE5QQIV5.js +69 -0
- package/dist/chunk-PE5QQIV5.js.map +1 -0
- package/dist/chunk-QAUGWXGJ.js +158 -0
- package/dist/chunk-QAUGWXGJ.js.map +1 -0
- package/dist/chunk-QCYFSBZ7.js +81 -0
- package/dist/chunk-QCYFSBZ7.js.map +1 -0
- package/dist/chunk-QJT5UAL2.js +714 -0
- package/dist/chunk-QJT5UAL2.js.map +1 -0
- package/dist/chunk-QRLVOM3E.js +83 -0
- package/dist/chunk-QRLVOM3E.js.map +1 -0
- package/dist/chunk-RBVGV7VO.js +26 -0
- package/dist/chunk-RBVGV7VO.js.map +1 -0
- package/dist/chunk-RD6VXGVY.js +340 -0
- package/dist/chunk-RD6VXGVY.js.map +1 -0
- package/dist/chunk-RSPI2A4W.js +106 -0
- package/dist/chunk-RSPI2A4W.js.map +1 -0
- package/dist/chunk-RT26RZ7W.js +79 -0
- package/dist/chunk-RT26RZ7W.js.map +1 -0
- package/dist/chunk-RXAIDZ33.js +522 -0
- package/dist/chunk-RXAIDZ33.js.map +1 -0
- package/dist/chunk-S6TO62GJ.js +53 -0
- package/dist/chunk-S6TO62GJ.js.map +1 -0
- package/dist/chunk-SJ5MYJ7L.js +283 -0
- package/dist/chunk-SJ5MYJ7L.js.map +1 -0
- package/dist/chunk-SZ2I2SRP.js +156 -0
- package/dist/chunk-SZ2I2SRP.js.map +1 -0
- package/dist/chunk-UGOQKTHL.js +23 -0
- package/dist/chunk-UGOQKTHL.js.map +1 -0
- package/dist/chunk-UGQ756Z6.js +92 -0
- package/dist/chunk-UGQ756Z6.js.map +1 -0
- package/dist/chunk-UNPCAFLS.js +22 -0
- package/dist/chunk-UNPCAFLS.js.map +1 -0
- package/dist/chunk-V27UIXBD.js +36 -0
- package/dist/chunk-V27UIXBD.js.map +1 -0
- package/dist/chunk-VB5LDR7C.js +97 -0
- package/dist/chunk-VB5LDR7C.js.map +1 -0
- package/dist/chunk-VJ26PA3U.js +9 -0
- package/dist/chunk-VJ26PA3U.js.map +1 -0
- package/dist/chunk-VKB4VUN7.js +164 -0
- package/dist/chunk-VKB4VUN7.js.map +1 -0
- package/dist/chunk-Y37OHTAO.js +208 -0
- package/dist/chunk-Y37OHTAO.js.map +1 -0
- package/dist/chunk-Y4OW24IS.js +18 -0
- package/dist/chunk-Y4OW24IS.js.map +1 -0
- package/dist/chunk-YDMMDO2W.js +141 -0
- package/dist/chunk-YDMMDO2W.js.map +1 -0
- package/dist/chunk-YENXORWK.js +9 -0
- package/dist/chunk-YENXORWK.js.map +1 -0
- package/dist/chunk-YLTIB224.js +76 -0
- package/dist/chunk-YLTIB224.js.map +1 -0
- package/dist/chunk-YVA6PAML.js +63 -0
- package/dist/chunk-YVA6PAML.js.map +1 -0
- package/dist/chunk-YWUMX4JR.js +9 -0
- package/dist/chunk-YWUMX4JR.js.map +1 -0
- package/dist/chunk-ZDXR2SWG.js +32 -0
- package/dist/chunk-ZDXR2SWG.js.map +1 -0
- package/dist/chunk-ZIFL6GXH.js +187 -0
- package/dist/chunk-ZIFL6GXH.js.map +1 -0
- package/dist/chunk-ZM4VJOGF.js +40 -0
- package/dist/chunk-ZM4VJOGF.js.map +1 -0
- package/dist/chunk-ZVKIJLNO.js +9 -0
- package/dist/chunk-ZVKIJLNO.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 +14 -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 +8 -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 +4 -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 +34 -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-MrMOOgmr.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,714 @@
|
|
|
1
|
+
import { Command, CommandInput, CommandList, CommandItem, CommandEmpty, useCommand } from './chunk-7E2ZPDVI.js';
|
|
2
|
+
import { Popover, PopoverTrigger, usePopover, PopoverContent } from './chunk-GLWYIUE5.js';
|
|
3
|
+
import { cn } from './chunk-OMXWBB67.js';
|
|
4
|
+
import { signal } from '@preact/signals';
|
|
5
|
+
import { createContext } from 'preact';
|
|
6
|
+
import { useContext, useMemo, useState, useRef, useCallback, useLayoutEffect } from 'preact/hooks';
|
|
7
|
+
import { jsx, Fragment, jsxs } from 'preact/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
// src/components/combobox/combobox-utils.ts
|
|
10
|
+
function flattenComboboxItems(items) {
|
|
11
|
+
const out = [];
|
|
12
|
+
for (const el of items) {
|
|
13
|
+
if (el !== null && typeof el === "object" && "items" in el) {
|
|
14
|
+
const sub = el.items;
|
|
15
|
+
if (Array.isArray(sub)) {
|
|
16
|
+
out.push(...sub);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
out.push(el);
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
function defaultComboboxItemKey(item) {
|
|
25
|
+
if (typeof item === "string" || typeof item === "number") return String(item);
|
|
26
|
+
if (item && typeof item === "object" && "value" in item) {
|
|
27
|
+
const v = item.value;
|
|
28
|
+
return v === void 0 || v === null ? "" : String(v);
|
|
29
|
+
}
|
|
30
|
+
return JSON.stringify(item);
|
|
31
|
+
}
|
|
32
|
+
function defaultComboboxItemString(item, custom) {
|
|
33
|
+
if (custom) return custom(item);
|
|
34
|
+
if (typeof item === "string") return item;
|
|
35
|
+
if (item && typeof item === "object" && "label" in item) {
|
|
36
|
+
const l = item.label;
|
|
37
|
+
return l === void 0 || l === null ? "" : String(l);
|
|
38
|
+
}
|
|
39
|
+
return String(item);
|
|
40
|
+
}
|
|
41
|
+
function normalizeInitialKeys(multiple, defaultValue) {
|
|
42
|
+
if (defaultValue === void 0 || defaultValue === "") return [];
|
|
43
|
+
if (multiple) return Array.isArray(defaultValue) ? [...defaultValue] : [defaultValue];
|
|
44
|
+
return typeof defaultValue === "string" ? [defaultValue] : [];
|
|
45
|
+
}
|
|
46
|
+
function keysFromValueProp(multiple, valueProp) {
|
|
47
|
+
if (valueProp === void 0) return [];
|
|
48
|
+
if (multiple) return Array.isArray(valueProp) ? [...valueProp] : [];
|
|
49
|
+
return typeof valueProp === "string" && valueProp ? [valueProp] : [];
|
|
50
|
+
}
|
|
51
|
+
var ComboboxContext = createContext(null);
|
|
52
|
+
var useCombobox = () => {
|
|
53
|
+
const ctx = useContext(ComboboxContext);
|
|
54
|
+
if (!ctx) throw new Error("Combobox components must be used within Combobox");
|
|
55
|
+
return ctx;
|
|
56
|
+
};
|
|
57
|
+
function comboboxSelectionLabel(ctx) {
|
|
58
|
+
if (ctx.selectedKeys.length === 0) return "";
|
|
59
|
+
const labels = ctx.selectedKeys.map((k) => {
|
|
60
|
+
const it = ctx.leafItems.find((i) => ctx.itemKey(i) === k);
|
|
61
|
+
return it !== void 0 ? ctx.itemToString(it) : k;
|
|
62
|
+
});
|
|
63
|
+
return labels.join(", ");
|
|
64
|
+
}
|
|
65
|
+
var Combobox = ({
|
|
66
|
+
items = [],
|
|
67
|
+
itemToStringValue,
|
|
68
|
+
itemKey: itemKeyProp,
|
|
69
|
+
value: valueProp,
|
|
70
|
+
defaultValue,
|
|
71
|
+
onValueChange,
|
|
72
|
+
placeholder = "Select\u2026",
|
|
73
|
+
disabled = false,
|
|
74
|
+
open: openProp,
|
|
75
|
+
defaultOpen = false,
|
|
76
|
+
onOpenChange,
|
|
77
|
+
multiple: multipleProp = false,
|
|
78
|
+
liftedFilter = false,
|
|
79
|
+
autoHighlight = false,
|
|
80
|
+
showClear = false,
|
|
81
|
+
closeOnSelect: closeOnSelectProp,
|
|
82
|
+
class: className,
|
|
83
|
+
children,
|
|
84
|
+
...rest
|
|
85
|
+
}) => {
|
|
86
|
+
const multiple = Boolean(multipleProp);
|
|
87
|
+
const closeOnSelect = closeOnSelectProp ?? !multiple;
|
|
88
|
+
const itemToString = useMemo(
|
|
89
|
+
() => (item) => defaultComboboxItemString(item, itemToStringValue),
|
|
90
|
+
[itemToStringValue]
|
|
91
|
+
);
|
|
92
|
+
const itemKey = useMemo(
|
|
93
|
+
() => (item) => itemKeyProp ? itemKeyProp(item) : defaultComboboxItemKey(item),
|
|
94
|
+
[itemKeyProp]
|
|
95
|
+
);
|
|
96
|
+
const leafItems = useMemo(() => flattenComboboxItems(items), [items]);
|
|
97
|
+
const isValueControlled = valueProp !== void 0;
|
|
98
|
+
const [internalKeys, setInternalKeys] = useState(() => normalizeInitialKeys(multiple, defaultValue));
|
|
99
|
+
const selectedKeys = isValueControlled ? keysFromValueProp(multiple, valueProp) : internalKeys;
|
|
100
|
+
const selectedKey = selectedKeys[0] ?? "";
|
|
101
|
+
const filterQuery = useMemo(() => liftedFilter ? signal("") : null, [liftedFilter]);
|
|
102
|
+
const hasVisibleItemsSig = useMemo(() => liftedFilter ? signal(true) : null, [liftedFilter]);
|
|
103
|
+
const comboboxListRef = useMemo(() => ({ current: null }), []);
|
|
104
|
+
const commandNavRef = useMemo(() => ({ current: null }), []);
|
|
105
|
+
const isOpenRef = useRef(false);
|
|
106
|
+
const selectedKeysRef = useRef(selectedKeys);
|
|
107
|
+
selectedKeysRef.current = selectedKeys;
|
|
108
|
+
const emitKeys = useCallback(
|
|
109
|
+
(next) => {
|
|
110
|
+
if (!isValueControlled) setInternalKeys(next);
|
|
111
|
+
if (multiple) onValueChange?.(next);
|
|
112
|
+
else onValueChange?.(next[0] ?? "");
|
|
113
|
+
},
|
|
114
|
+
[isValueControlled, multiple, onValueChange]
|
|
115
|
+
);
|
|
116
|
+
const selectByItem = useCallback(
|
|
117
|
+
(item) => {
|
|
118
|
+
const key = itemKey(item);
|
|
119
|
+
emitKeys(key ? [key] : []);
|
|
120
|
+
},
|
|
121
|
+
[itemKey, emitKeys]
|
|
122
|
+
);
|
|
123
|
+
const toggleByItem = useCallback(
|
|
124
|
+
(item) => {
|
|
125
|
+
const key = itemKey(item);
|
|
126
|
+
const exists = selectedKeysRef.current.includes(key);
|
|
127
|
+
const next = exists ? selectedKeysRef.current.filter((k) => k !== key) : [...selectedKeysRef.current, key];
|
|
128
|
+
emitKeys(next);
|
|
129
|
+
},
|
|
130
|
+
[itemKey, emitKeys]
|
|
131
|
+
);
|
|
132
|
+
const removeKey = useCallback(
|
|
133
|
+
(key) => {
|
|
134
|
+
emitKeys(selectedKeysRef.current.filter((k) => k !== key));
|
|
135
|
+
},
|
|
136
|
+
[emitKeys]
|
|
137
|
+
);
|
|
138
|
+
const clearSelection = useCallback(() => {
|
|
139
|
+
emitKeys([]);
|
|
140
|
+
}, [emitKeys]);
|
|
141
|
+
const isSelected = useCallback(
|
|
142
|
+
(key) => {
|
|
143
|
+
return selectedKeys.includes(key);
|
|
144
|
+
},
|
|
145
|
+
[selectedKeys]
|
|
146
|
+
);
|
|
147
|
+
const handleOpenChange = useCallback(
|
|
148
|
+
(open) => {
|
|
149
|
+
isOpenRef.current = open;
|
|
150
|
+
onOpenChange?.(open);
|
|
151
|
+
if (!liftedFilter || !filterQuery) return;
|
|
152
|
+
if (open) {
|
|
153
|
+
filterQuery.value = "";
|
|
154
|
+
} else if (multiple) {
|
|
155
|
+
filterQuery.value = "";
|
|
156
|
+
} else {
|
|
157
|
+
const k = selectedKeysRef.current[0];
|
|
158
|
+
if (!k) filterQuery.value = "";
|
|
159
|
+
else {
|
|
160
|
+
const it = leafItems.find((i) => itemKey(i) === k);
|
|
161
|
+
filterQuery.value = it !== void 0 ? itemToString(it) : k;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
[liftedFilter, filterQuery, onOpenChange, multiple, leafItems, itemKey, itemToString]
|
|
166
|
+
);
|
|
167
|
+
useLayoutEffect(() => {
|
|
168
|
+
if (!liftedFilter || !filterQuery || multiple || isOpenRef.current) return;
|
|
169
|
+
const k = selectedKeys[0];
|
|
170
|
+
if (!k) {
|
|
171
|
+
filterQuery.value = "";
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const it = leafItems.find((i) => itemKey(i) === k);
|
|
175
|
+
filterQuery.value = it !== void 0 ? itemToString(it) : k;
|
|
176
|
+
}, [liftedFilter, filterQuery, multiple, selectedKeys, leafItems, itemKey, itemToString]);
|
|
177
|
+
const contextValue = useMemo(
|
|
178
|
+
() => ({
|
|
179
|
+
items,
|
|
180
|
+
leafItems,
|
|
181
|
+
itemToString,
|
|
182
|
+
itemKey,
|
|
183
|
+
selectedKeys,
|
|
184
|
+
selectedKey,
|
|
185
|
+
multiple,
|
|
186
|
+
isSelected,
|
|
187
|
+
selectByItem,
|
|
188
|
+
toggleByItem,
|
|
189
|
+
removeKey,
|
|
190
|
+
clearSelection,
|
|
191
|
+
placeholder,
|
|
192
|
+
disabled,
|
|
193
|
+
liftedFilter,
|
|
194
|
+
filterQuery,
|
|
195
|
+
hasVisibleItems: hasVisibleItemsSig,
|
|
196
|
+
autoHighlight,
|
|
197
|
+
showClear,
|
|
198
|
+
closeOnSelect,
|
|
199
|
+
comboboxListRef,
|
|
200
|
+
commandNavRef
|
|
201
|
+
}),
|
|
202
|
+
[
|
|
203
|
+
items,
|
|
204
|
+
leafItems,
|
|
205
|
+
itemToString,
|
|
206
|
+
itemKey,
|
|
207
|
+
selectedKeys,
|
|
208
|
+
selectedKey,
|
|
209
|
+
multiple,
|
|
210
|
+
isSelected,
|
|
211
|
+
selectByItem,
|
|
212
|
+
toggleByItem,
|
|
213
|
+
removeKey,
|
|
214
|
+
clearSelection,
|
|
215
|
+
placeholder,
|
|
216
|
+
disabled,
|
|
217
|
+
liftedFilter,
|
|
218
|
+
filterQuery,
|
|
219
|
+
hasVisibleItemsSig,
|
|
220
|
+
autoHighlight,
|
|
221
|
+
showClear,
|
|
222
|
+
closeOnSelect,
|
|
223
|
+
comboboxListRef,
|
|
224
|
+
commandNavRef
|
|
225
|
+
]
|
|
226
|
+
);
|
|
227
|
+
return /* @__PURE__ */ jsx(ComboboxContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { "data-slot": "combobox", class: cn("relative", className), ...rest, children: /* @__PURE__ */ jsx(Popover, { open: openProp, defaultOpen, onOpenChange: handleOpenChange, children }) }) });
|
|
228
|
+
};
|
|
229
|
+
var ComboboxTrigger = ({ class: className, disabled, ...rest }) => {
|
|
230
|
+
const ctx = useCombobox();
|
|
231
|
+
return /* @__PURE__ */ jsx(
|
|
232
|
+
PopoverTrigger,
|
|
233
|
+
{
|
|
234
|
+
class: cn(
|
|
235
|
+
"border-input bg-background hover:bg-muted/50 flex h-8 w-full min-w-44 items-center justify-between gap-2 rounded-md border px-3 py-1 text-start text-sm font-normal shadow-xs outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",
|
|
236
|
+
className
|
|
237
|
+
),
|
|
238
|
+
disabled: disabled ?? ctx.disabled,
|
|
239
|
+
...rest
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
};
|
|
243
|
+
var ComboboxValue = ({ placeholder: placeholderProp, children, class: className, ...rest }) => {
|
|
244
|
+
const ctx = useCombobox();
|
|
245
|
+
const label = comboboxSelectionLabel(ctx);
|
|
246
|
+
const empty = ctx.selectedKeys.length === 0;
|
|
247
|
+
if (typeof children === "function") {
|
|
248
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children({ label, empty, keys: ctx.selectedKeys }) });
|
|
249
|
+
}
|
|
250
|
+
return /* @__PURE__ */ jsx(
|
|
251
|
+
"span",
|
|
252
|
+
{
|
|
253
|
+
"data-slot": "combobox-value",
|
|
254
|
+
class: cn("truncate", empty && "text-muted-foreground", className),
|
|
255
|
+
...rest,
|
|
256
|
+
children: empty ? placeholderProp ?? ctx.placeholder : label
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
};
|
|
260
|
+
var ComboboxContent = ({
|
|
261
|
+
forceMount: forceMountProp,
|
|
262
|
+
class: className,
|
|
263
|
+
...rest
|
|
264
|
+
}) => {
|
|
265
|
+
const popover = usePopover();
|
|
266
|
+
const ctx = useCombobox();
|
|
267
|
+
const forceMount = forceMountProp ?? ctx.liftedFilter;
|
|
268
|
+
return /* @__PURE__ */ jsx(
|
|
269
|
+
PopoverContent,
|
|
270
|
+
{
|
|
271
|
+
forceMount,
|
|
272
|
+
class: cn(
|
|
273
|
+
"w-64 max-w-[calc(100vw-1.5rem)] gap-0 overflow-hidden p-0",
|
|
274
|
+
ctx.liftedFilter && !popover.open.value && "pointer-events-none invisible max-h-0 min-h-0 border-0 p-0 opacity-0 shadow-none",
|
|
275
|
+
className
|
|
276
|
+
),
|
|
277
|
+
...rest
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
function CommandNavBridge() {
|
|
282
|
+
const cmd = useCommand();
|
|
283
|
+
const combo = useCombobox();
|
|
284
|
+
const navRef = combo.commandNavRef;
|
|
285
|
+
useLayoutEffect(() => {
|
|
286
|
+
navRef.current = {
|
|
287
|
+
moveHighlight: cmd.moveHighlight,
|
|
288
|
+
activateHighlighted: cmd.activateHighlighted
|
|
289
|
+
};
|
|
290
|
+
return () => {
|
|
291
|
+
navRef.current = null;
|
|
292
|
+
};
|
|
293
|
+
}, [cmd.moveHighlight, cmd.activateHighlighted, navRef]);
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
var ComboboxCommand = ({
|
|
297
|
+
autoHighlight: autoHighlightProp,
|
|
298
|
+
class: className,
|
|
299
|
+
children,
|
|
300
|
+
...rest
|
|
301
|
+
}) => {
|
|
302
|
+
const ctx = useCombobox();
|
|
303
|
+
const query = ctx.liftedFilter && ctx.filterQuery ? ctx.filterQuery : void 0;
|
|
304
|
+
const hasVis = ctx.liftedFilter && ctx.hasVisibleItems ? ctx.hasVisibleItems : void 0;
|
|
305
|
+
const autoHighlight = autoHighlightProp ?? ctx.autoHighlight;
|
|
306
|
+
return /* @__PURE__ */ jsxs(
|
|
307
|
+
Command,
|
|
308
|
+
{
|
|
309
|
+
...rest,
|
|
310
|
+
class: cn("rounded-lg border-0 bg-transparent shadow-none", className),
|
|
311
|
+
autoHighlight,
|
|
312
|
+
query,
|
|
313
|
+
hasVisibleItems: hasVis,
|
|
314
|
+
children: [
|
|
315
|
+
/* @__PURE__ */ jsx(CommandNavBridge, {}),
|
|
316
|
+
children
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
};
|
|
321
|
+
var ComboboxInput = ({ class: className, ...rest }) => /* @__PURE__ */ jsx(CommandInput, { class: cn(className), ...rest });
|
|
322
|
+
var ComboboxList = ({ items: itemsProp, children, onMount, ...rest }) => {
|
|
323
|
+
const ctx = useCombobox();
|
|
324
|
+
const list = itemsProp !== void 0 ? itemsProp : ctx.items;
|
|
325
|
+
const body = typeof children === "function" ? list.map((item, index) => children(item, index)) : children;
|
|
326
|
+
return /* @__PURE__ */ jsx(
|
|
327
|
+
CommandList,
|
|
328
|
+
{
|
|
329
|
+
...rest,
|
|
330
|
+
onMount: (el) => {
|
|
331
|
+
ctx.comboboxListRef.current = el;
|
|
332
|
+
onMount?.(el);
|
|
333
|
+
},
|
|
334
|
+
children: body
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
};
|
|
338
|
+
var ComboboxItem = ({
|
|
339
|
+
item,
|
|
340
|
+
class: className,
|
|
341
|
+
children,
|
|
342
|
+
disabled,
|
|
343
|
+
onClick,
|
|
344
|
+
...rest
|
|
345
|
+
}) => {
|
|
346
|
+
const ctx = useCombobox();
|
|
347
|
+
const popover = usePopover();
|
|
348
|
+
const filterValue = ctx.itemToString(item);
|
|
349
|
+
const key = ctx.itemKey(item);
|
|
350
|
+
const selected = ctx.multiple ? ctx.selectedKeys.includes(key) : ctx.selectedKey === key;
|
|
351
|
+
return /* @__PURE__ */ jsx(
|
|
352
|
+
CommandItem,
|
|
353
|
+
{
|
|
354
|
+
value: filterValue,
|
|
355
|
+
disabled,
|
|
356
|
+
class: cn(selected && "bg-accent/60", className),
|
|
357
|
+
onSelect: () => {
|
|
358
|
+
if (ctx.multiple) {
|
|
359
|
+
ctx.toggleByItem(item);
|
|
360
|
+
if (ctx.closeOnSelect) popover.setOpen(false);
|
|
361
|
+
} else {
|
|
362
|
+
ctx.selectByItem(item);
|
|
363
|
+
popover.setOpen(false);
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
onClick,
|
|
367
|
+
...rest,
|
|
368
|
+
children
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
};
|
|
372
|
+
var ComboboxChip = ({ itemKey: chipKey, children, class: className, ...rest }) => {
|
|
373
|
+
const ctx = useCombobox();
|
|
374
|
+
return /* @__PURE__ */ jsxs(
|
|
375
|
+
"span",
|
|
376
|
+
{
|
|
377
|
+
"data-slot": "combobox-chip",
|
|
378
|
+
class: cn(
|
|
379
|
+
"bg-secondary text-secondary-foreground inline-flex max-w-full items-center gap-0.5 rounded-md px-2 py-0.5 text-xs",
|
|
380
|
+
className
|
|
381
|
+
),
|
|
382
|
+
...rest,
|
|
383
|
+
children: [
|
|
384
|
+
/* @__PURE__ */ jsx("span", { class: "min-w-0 truncate", children }),
|
|
385
|
+
/* @__PURE__ */ jsx(
|
|
386
|
+
"button",
|
|
387
|
+
{
|
|
388
|
+
type: "button",
|
|
389
|
+
class: "text-muted-foreground hover:text-foreground shrink-0 rounded p-0.5 outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
390
|
+
"aria-label": "Remove",
|
|
391
|
+
onClick: (event) => {
|
|
392
|
+
event.stopPropagation();
|
|
393
|
+
ctx.removeKey(chipKey);
|
|
394
|
+
},
|
|
395
|
+
children: /* @__PURE__ */ jsx(
|
|
396
|
+
"svg",
|
|
397
|
+
{
|
|
398
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
399
|
+
width: "12",
|
|
400
|
+
height: "12",
|
|
401
|
+
viewBox: "0 0 24 24",
|
|
402
|
+
fill: "none",
|
|
403
|
+
stroke: "currentColor",
|
|
404
|
+
"stroke-width": "2",
|
|
405
|
+
"aria-hidden": true,
|
|
406
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
}
|
|
410
|
+
)
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
};
|
|
415
|
+
var ComboboxChips = ({ class: className, children, ...rest }) => /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
416
|
+
"div",
|
|
417
|
+
{
|
|
418
|
+
"data-slot": "combobox-chips",
|
|
419
|
+
class: cn(
|
|
420
|
+
"border-input bg-background flex min-h-8 w-full min-w-44 flex-wrap items-center gap-1 rounded-md border px-2 py-1 shadow-xs outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
421
|
+
className
|
|
422
|
+
),
|
|
423
|
+
...rest,
|
|
424
|
+
children
|
|
425
|
+
}
|
|
426
|
+
) });
|
|
427
|
+
var ComboboxChipsInput = ({
|
|
428
|
+
class: className,
|
|
429
|
+
onKeyDown,
|
|
430
|
+
onInput,
|
|
431
|
+
onFocus,
|
|
432
|
+
...rest
|
|
433
|
+
}) => {
|
|
434
|
+
const ctx = useCombobox();
|
|
435
|
+
const popover = usePopover();
|
|
436
|
+
if (!ctx.filterQuery) {
|
|
437
|
+
throw new Error("ComboboxChipsInput must be used with Combobox liftedFilter={true}");
|
|
438
|
+
}
|
|
439
|
+
void ctx.filterQuery.value;
|
|
440
|
+
void popover.open.value;
|
|
441
|
+
return /* @__PURE__ */ jsx(
|
|
442
|
+
"input",
|
|
443
|
+
{
|
|
444
|
+
...rest,
|
|
445
|
+
"data-slot": "combobox-chips-input",
|
|
446
|
+
class: cn(
|
|
447
|
+
"placeholder:text-muted-foreground min-w-[6rem] flex-1 border-0 bg-transparent px-1 py-1 text-sm outline-none",
|
|
448
|
+
className
|
|
449
|
+
),
|
|
450
|
+
value: ctx.filterQuery.value,
|
|
451
|
+
onInput: (event) => {
|
|
452
|
+
ctx.filterQuery.value = event.currentTarget.value;
|
|
453
|
+
popover.setOpen(true);
|
|
454
|
+
onInput?.(event);
|
|
455
|
+
},
|
|
456
|
+
onFocus: (event) => {
|
|
457
|
+
onFocus?.(event);
|
|
458
|
+
popover.setOpen(true);
|
|
459
|
+
},
|
|
460
|
+
onKeyDown: (event) => {
|
|
461
|
+
const nav = ctx.commandNavRef.current;
|
|
462
|
+
if (ctx.autoHighlight && nav) {
|
|
463
|
+
if (event.key === "ArrowDown") {
|
|
464
|
+
event.preventDefault();
|
|
465
|
+
popover.setOpen(true);
|
|
466
|
+
nav.moveHighlight(1);
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (event.key === "ArrowUp") {
|
|
470
|
+
event.preventDefault();
|
|
471
|
+
popover.setOpen(true);
|
|
472
|
+
nav.moveHighlight(-1);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (event.key === "Enter") {
|
|
476
|
+
event.preventDefault();
|
|
477
|
+
if (popover.open.value) nav.activateHighlighted();
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
onKeyDown?.(event);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
};
|
|
486
|
+
var ComboboxClear = ({ class: className, onClick, ...rest }) => {
|
|
487
|
+
const ctx = useCombobox();
|
|
488
|
+
const has = ctx.selectedKeys.length > 0;
|
|
489
|
+
if (!has || !ctx.showClear) return null;
|
|
490
|
+
return /* @__PURE__ */ jsx(
|
|
491
|
+
"button",
|
|
492
|
+
{
|
|
493
|
+
type: "button",
|
|
494
|
+
"data-slot": "combobox-clear",
|
|
495
|
+
"aria-label": "Clear selection",
|
|
496
|
+
class: cn(
|
|
497
|
+
"text-muted-foreground hover:text-foreground inline-flex size-7 shrink-0 items-center justify-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
498
|
+
className
|
|
499
|
+
),
|
|
500
|
+
onClick: (event) => {
|
|
501
|
+
onClick?.(event);
|
|
502
|
+
if (event.defaultPrevented) return;
|
|
503
|
+
ctx.clearSelection();
|
|
504
|
+
if (ctx.filterQuery) ctx.filterQuery.value = "";
|
|
505
|
+
},
|
|
506
|
+
...rest,
|
|
507
|
+
children: /* @__PURE__ */ jsx(
|
|
508
|
+
"svg",
|
|
509
|
+
{
|
|
510
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
511
|
+
width: "14",
|
|
512
|
+
height: "14",
|
|
513
|
+
viewBox: "0 0 24 24",
|
|
514
|
+
fill: "none",
|
|
515
|
+
stroke: "currentColor",
|
|
516
|
+
"stroke-width": "2",
|
|
517
|
+
"aria-hidden": true,
|
|
518
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
519
|
+
}
|
|
520
|
+
)
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
};
|
|
524
|
+
var ComboboxInlineInput = ({
|
|
525
|
+
class: className,
|
|
526
|
+
onKeyDown,
|
|
527
|
+
onInput,
|
|
528
|
+
onFocus,
|
|
529
|
+
...rest
|
|
530
|
+
}) => {
|
|
531
|
+
const ctx = useCombobox();
|
|
532
|
+
const popover = usePopover();
|
|
533
|
+
if (!ctx.filterQuery) {
|
|
534
|
+
throw new Error("ComboboxInlineInput must be used with Combobox liftedFilter={true}");
|
|
535
|
+
}
|
|
536
|
+
void ctx.filterQuery.value;
|
|
537
|
+
void popover.open.value;
|
|
538
|
+
return /* @__PURE__ */ jsx(
|
|
539
|
+
"input",
|
|
540
|
+
{
|
|
541
|
+
...rest,
|
|
542
|
+
"data-slot": "combobox-inline-input",
|
|
543
|
+
class: cn(
|
|
544
|
+
"border-input bg-background placeholder:text-muted-foreground flex h-10 w-full min-w-0 rounded-md border px-3 py-2 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",
|
|
545
|
+
className
|
|
546
|
+
),
|
|
547
|
+
value: ctx.filterQuery.value,
|
|
548
|
+
onInput: (event) => {
|
|
549
|
+
ctx.filterQuery.value = event.currentTarget.value;
|
|
550
|
+
popover.setOpen(true);
|
|
551
|
+
onInput?.(event);
|
|
552
|
+
},
|
|
553
|
+
onFocus: (event) => {
|
|
554
|
+
onFocus?.(event);
|
|
555
|
+
popover.setOpen(true);
|
|
556
|
+
},
|
|
557
|
+
onKeyDown: (event) => {
|
|
558
|
+
const nav = ctx.commandNavRef.current;
|
|
559
|
+
if (ctx.autoHighlight && nav) {
|
|
560
|
+
if (event.key === "ArrowDown") {
|
|
561
|
+
event.preventDefault();
|
|
562
|
+
popover.setOpen(true);
|
|
563
|
+
nav.moveHighlight(1);
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (event.key === "ArrowUp") {
|
|
567
|
+
event.preventDefault();
|
|
568
|
+
popover.setOpen(true);
|
|
569
|
+
nav.moveHighlight(-1);
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
if (event.key === "Enter") {
|
|
573
|
+
event.preventDefault();
|
|
574
|
+
if (popover.open.value) nav.activateHighlighted();
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
onKeyDown?.(event);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
};
|
|
583
|
+
var ChevronDownIcon = () => /* @__PURE__ */ jsx(
|
|
584
|
+
"svg",
|
|
585
|
+
{
|
|
586
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
587
|
+
width: "16",
|
|
588
|
+
height: "16",
|
|
589
|
+
viewBox: "0 0 24 24",
|
|
590
|
+
fill: "none",
|
|
591
|
+
stroke: "currentColor",
|
|
592
|
+
"stroke-width": "2",
|
|
593
|
+
"aria-hidden": true,
|
|
594
|
+
class: "shrink-0 opacity-50",
|
|
595
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
596
|
+
}
|
|
597
|
+
);
|
|
598
|
+
var ComboboxSelect = ({
|
|
599
|
+
options,
|
|
600
|
+
searchPlaceholder = "Search\u2026",
|
|
601
|
+
emptyText = "No results found.",
|
|
602
|
+
triggerClass,
|
|
603
|
+
showClear = false,
|
|
604
|
+
autoHighlight = false,
|
|
605
|
+
liftedFilter = false,
|
|
606
|
+
multiple = false,
|
|
607
|
+
class: className,
|
|
608
|
+
placeholder,
|
|
609
|
+
...rest
|
|
610
|
+
}) => {
|
|
611
|
+
const useLifted = Boolean(liftedFilter || multiple);
|
|
612
|
+
if (multiple) {
|
|
613
|
+
return /* @__PURE__ */ jsxs(
|
|
614
|
+
Combobox,
|
|
615
|
+
{
|
|
616
|
+
class: className,
|
|
617
|
+
items: options,
|
|
618
|
+
itemKey: (o) => o.value,
|
|
619
|
+
itemToStringValue: (o) => o.label,
|
|
620
|
+
multiple: true,
|
|
621
|
+
liftedFilter: true,
|
|
622
|
+
autoHighlight,
|
|
623
|
+
showClear,
|
|
624
|
+
placeholder,
|
|
625
|
+
...rest,
|
|
626
|
+
children: [
|
|
627
|
+
/* @__PURE__ */ jsxs(ComboboxChips, { class: triggerClass, children: [
|
|
628
|
+
/* @__PURE__ */ jsx(ComboboxValue, { placeholder: placeholder ?? "Select\u2026", children: ({ keys, empty }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
629
|
+
keys.map((k) => {
|
|
630
|
+
const o = options.find((x) => x.value === k);
|
|
631
|
+
if (!o) return null;
|
|
632
|
+
return /* @__PURE__ */ jsx(ComboboxChip, { itemKey: k, children: o.label }, k);
|
|
633
|
+
}),
|
|
634
|
+
empty ? /* @__PURE__ */ jsx("span", { class: "text-muted-foreground px-1 py-0.5 text-sm", children: placeholder ?? "Select\u2026" }) : null
|
|
635
|
+
] }) }),
|
|
636
|
+
showClear ? /* @__PURE__ */ jsx(ComboboxClear, { class: "shrink-0" }) : null,
|
|
637
|
+
/* @__PURE__ */ jsx(ComboboxChipsInput, { placeholder: searchPlaceholder })
|
|
638
|
+
] }),
|
|
639
|
+
/* @__PURE__ */ jsx(ComboboxContent, { children: /* @__PURE__ */ jsxs(ComboboxCommand, { children: [
|
|
640
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: emptyText }),
|
|
641
|
+
/* @__PURE__ */ jsx(ComboboxList, { children: (opt) => {
|
|
642
|
+
const o = opt;
|
|
643
|
+
return /* @__PURE__ */ jsx(ComboboxItem, { item: o, children: o.label }, o.value);
|
|
644
|
+
} })
|
|
645
|
+
] }) })
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
if (useLifted) {
|
|
651
|
+
return /* @__PURE__ */ jsxs(
|
|
652
|
+
Combobox,
|
|
653
|
+
{
|
|
654
|
+
class: className,
|
|
655
|
+
items: options,
|
|
656
|
+
itemKey: (o) => o.value,
|
|
657
|
+
itemToStringValue: (o) => o.label,
|
|
658
|
+
liftedFilter: true,
|
|
659
|
+
autoHighlight,
|
|
660
|
+
showClear,
|
|
661
|
+
placeholder,
|
|
662
|
+
...rest,
|
|
663
|
+
children: [
|
|
664
|
+
/* @__PURE__ */ jsx(ComboboxTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("div", { class: cn("relative flex w-full min-w-44 items-center", triggerClass), children: [
|
|
665
|
+
/* @__PURE__ */ jsx(ComboboxInlineInput, { placeholder: searchPlaceholder, class: "pe-16" }),
|
|
666
|
+
showClear ? /* @__PURE__ */ jsx(ComboboxClear, { class: "absolute end-9 top-1/2 z-10 -translate-y-1/2" }) : null,
|
|
667
|
+
/* @__PURE__ */ jsx("span", { class: "pointer-events-none absolute end-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
|
|
668
|
+
] }) }),
|
|
669
|
+
/* @__PURE__ */ jsx(ComboboxContent, { children: /* @__PURE__ */ jsxs(ComboboxCommand, { children: [
|
|
670
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: emptyText }),
|
|
671
|
+
/* @__PURE__ */ jsx(ComboboxList, { children: (opt) => {
|
|
672
|
+
const o = opt;
|
|
673
|
+
return /* @__PURE__ */ jsx(ComboboxItem, { item: o, children: o.label }, o.value);
|
|
674
|
+
} })
|
|
675
|
+
] }) })
|
|
676
|
+
]
|
|
677
|
+
}
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
return /* @__PURE__ */ jsxs(
|
|
681
|
+
Combobox,
|
|
682
|
+
{
|
|
683
|
+
class: className,
|
|
684
|
+
items: options,
|
|
685
|
+
itemKey: (o) => o.value,
|
|
686
|
+
itemToStringValue: (o) => o.label,
|
|
687
|
+
autoHighlight,
|
|
688
|
+
showClear,
|
|
689
|
+
placeholder,
|
|
690
|
+
...rest,
|
|
691
|
+
children: [
|
|
692
|
+
/* @__PURE__ */ jsxs(ComboboxTrigger, { class: cn(triggerClass), children: [
|
|
693
|
+
/* @__PURE__ */ jsx(ComboboxValue, {}),
|
|
694
|
+
/* @__PURE__ */ jsxs("span", { class: "ms-auto flex shrink-0 items-center gap-0.5", children: [
|
|
695
|
+
showClear ? /* @__PURE__ */ jsx(ComboboxClear, {}) : null,
|
|
696
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
697
|
+
] })
|
|
698
|
+
] }),
|
|
699
|
+
/* @__PURE__ */ jsx(ComboboxContent, { children: /* @__PURE__ */ jsxs(ComboboxCommand, { children: [
|
|
700
|
+
/* @__PURE__ */ jsx(ComboboxInput, { placeholder: searchPlaceholder }),
|
|
701
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: emptyText }),
|
|
702
|
+
/* @__PURE__ */ jsx(ComboboxList, { children: (opt) => {
|
|
703
|
+
const o = opt;
|
|
704
|
+
return /* @__PURE__ */ jsx(ComboboxItem, { item: o, children: o.label }, o.value);
|
|
705
|
+
} })
|
|
706
|
+
] }) })
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
);
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCommand, ComboboxContent, ComboboxInlineInput, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSelect, ComboboxTrigger, ComboboxValue, comboboxSelectionLabel, defaultComboboxItemKey, defaultComboboxItemString, flattenComboboxItems, useCombobox };
|
|
713
|
+
//# sourceMappingURL=chunk-QJT5UAL2.js.map
|
|
714
|
+
//# sourceMappingURL=chunk-QJT5UAL2.js.map
|