@constructive-io/ui 0.6.0 → 0.8.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/dist/button-D4vqTxhp.d.cts +20 -0
- package/dist/button-D4vqTxhp.d.ts +20 -0
- package/dist/components/alert-dialog.cjs +98 -302
- package/dist/components/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog.d.cts +22 -21
- package/dist/components/alert-dialog.d.ts +22 -21
- package/dist/components/alert-dialog.js +96 -281
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +51 -108
- package/dist/components/alert.cjs.map +1 -1
- package/dist/components/alert.d.cts +13 -13
- package/dist/components/alert.d.ts +13 -13
- package/dist/components/alert.js +49 -87
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-bar.cjs +73 -359
- package/dist/components/app-bar.cjs.map +1 -1
- package/dist/components/app-bar.d.cts +21 -20
- package/dist/components/app-bar.d.ts +21 -20
- package/dist/components/app-bar.js +71 -338
- package/dist/components/app-bar.js.map +1 -1
- package/dist/components/app-shell.cjs +252 -1777
- package/dist/components/app-shell.cjs.map +1 -1
- package/dist/components/app-shell.d.cts +77 -85
- package/dist/components/app-shell.d.ts +77 -85
- package/dist/components/app-shell.js +249 -1756
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/autocomplete.cjs +146 -397
- package/dist/components/autocomplete.cjs.map +1 -1
- package/dist/components/autocomplete.d.cts +24 -24
- package/dist/components/autocomplete.d.ts +24 -24
- package/dist/components/autocomplete.js +146 -376
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +26 -38
- package/dist/components/avatar.cjs.map +1 -1
- package/dist/components/avatar.d.cts +11 -10
- package/dist/components/avatar.d.ts +11 -10
- package/dist/components/avatar.js +24 -37
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +42 -60
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +13 -13
- package/dist/components/badge.d.ts +13 -13
- package/dist/components/badge.js +39 -38
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +65 -94
- package/dist/components/breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb.d.cts +14 -13
- package/dist/components/breadcrumb.d.ts +14 -13
- package/dist/components/breadcrumb.js +63 -73
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.cjs +68 -162
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +2 -20
- package/dist/components/button.d.ts +2 -20
- package/dist/components/button.js +65 -140
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +49 -62
- package/dist/components/calendar-rac.cjs.map +1 -1
- package/dist/components/calendar-rac.d.cts +8 -8
- package/dist/components/calendar-rac.d.ts +8 -8
- package/dist/components/calendar-rac.js +49 -61
- package/dist/components/calendar-rac.js.map +1 -1
- package/dist/components/card.cjs +61 -74
- package/dist/components/card.cjs.map +1 -1
- package/dist/components/card.d.cts +15 -16
- package/dist/components/card.d.ts +15 -16
- package/dist/components/card.js +58 -72
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox-group.cjs +12 -11
- package/dist/components/checkbox-group.cjs.map +1 -1
- package/dist/components/checkbox-group.d.cts +5 -5
- package/dist/components/checkbox-group.d.ts +5 -5
- package/dist/components/checkbox-group.js +12 -10
- package/dist/components/checkbox-group.js.map +1 -1
- package/dist/components/checkbox.cjs +60 -114
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.d.cts +6 -6
- package/dist/components/checkbox.d.ts +6 -6
- package/dist/components/checkbox.js +58 -93
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +76 -113
- package/dist/components/collapsible.cjs.map +1 -1
- package/dist/components/collapsible.d.cts +16 -15
- package/dist/components/collapsible.d.ts +16 -15
- package/dist/components/collapsible.js +74 -92
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +213 -507
- package/dist/components/combobox.cjs.map +1 -1
- package/dist/components/combobox.d.cts +36 -35
- package/dist/components/combobox.d.ts +36 -35
- package/dist/components/combobox.js +229 -504
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +102 -199
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.d.cts +22 -21
- package/dist/components/command.d.ts +22 -21
- package/dist/components/command.js +100 -198
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +110 -402
- package/dist/components/dialog.cjs.map +1 -1
- package/dist/components/dialog.d.cts +27 -26
- package/dist/components/dialog.d.ts +27 -26
- package/dist/components/dialog.js +107 -380
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +80 -111
- package/dist/components/dock.cjs.map +1 -1
- package/dist/components/dock.d.cts +25 -25
- package/dist/components/dock.d.ts +25 -25
- package/dist/components/dock.js +78 -106
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +77 -111
- package/dist/components/drawer.cjs.map +1 -1
- package/dist/components/drawer.d.cts +15 -14
- package/dist/components/drawer.d.ts +15 -14
- package/dist/components/drawer.js +75 -90
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +163 -238
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.d.cts +44 -43
- package/dist/components/dropdown-menu.d.ts +44 -43
- package/dist/components/dropdown-menu.js +161 -217
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +51 -85
- package/dist/components/empty.cjs.map +1 -1
- package/dist/components/empty.d.cts +13 -13
- package/dist/components/empty.d.ts +13 -13
- package/dist/components/empty.js +48 -83
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.cjs +150 -259
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.d.cts +39 -39
- package/dist/components/field.d.ts +39 -39
- package/dist/components/field.js +148 -238
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +143 -166
- package/dist/components/flickering-grid.cjs.map +1 -1
- package/dist/components/flickering-grid.d.cts +14 -13
- package/dist/components/flickering-grid.d.ts +14 -13
- package/dist/components/flickering-grid.js +141 -161
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +56 -188
- package/dist/components/flow-zoom-panel.cjs.map +1 -1
- package/dist/components/flow-zoom-panel.d.cts +9 -9
- package/dist/components/flow-zoom-panel.d.ts +9 -9
- package/dist/components/flow-zoom-panel.js +56 -168
- package/dist/components/flow-zoom-panel.js.map +1 -1
- package/dist/components/form-control.cjs +58 -186
- package/dist/components/form-control.cjs.map +1 -1
- package/dist/components/form-control.d.cts +11 -10
- package/dist/components/form-control.d.ts +11 -10
- package/dist/components/form-control.js +56 -165
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +78 -184
- package/dist/components/form.cjs.map +1 -1
- package/dist/components/form.d.cts +2 -36
- package/dist/components/form.d.ts +2 -36
- package/dist/components/form.js +76 -163
- package/dist/components/form.js.map +1 -1
- package/dist/components/input-group.cjs +51 -165
- package/dist/components/input-group.cjs.map +1 -1
- package/dist/components/input-group.d.cts +14 -15
- package/dist/components/input-group.d.ts +14 -15
- package/dist/components/input-group.js +51 -164
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.cjs +30 -55
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.d.cts +2 -10
- package/dist/components/input.d.ts +2 -10
- package/dist/components/input.js +30 -54
- package/dist/components/input.js.map +1 -1
- package/dist/components/json-input.cjs +133 -337
- package/dist/components/json-input.cjs.map +1 -1
- package/dist/components/json-input.d.cts +20 -19
- package/dist/components/json-input.d.ts +20 -19
- package/dist/components/json-input.js +132 -317
- package/dist/components/json-input.js.map +1 -1
- package/dist/components/label.cjs +19 -21
- package/dist/components/label.cjs.map +1 -1
- package/dist/components/label.d.cts +6 -5
- package/dist/components/label.d.ts +6 -5
- package/dist/components/label.js +17 -20
- package/dist/components/label.js.map +1 -1
- package/dist/components/motion-grid.cjs +61 -101
- package/dist/components/motion-grid.cjs.map +1 -1
- package/dist/components/motion-grid.d.cts +15 -14
- package/dist/components/motion-grid.d.ts +15 -14
- package/dist/components/motion-grid.js +59 -80
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +563 -786
- package/dist/components/multi-select.cjs.map +1 -1
- package/dist/components/multi-select.d.cts +173 -173
- package/dist/components/multi-select.d.ts +173 -173
- package/dist/components/multi-select.js +561 -765
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +24 -13
- package/dist/components/page-header.cjs.map +1 -1
- package/dist/components/page-header.d.cts +11 -11
- package/dist/components/page-header.d.ts +11 -11
- package/dist/components/page-header.js +23 -11
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.cjs +72 -272
- package/dist/components/pagination.cjs.map +1 -1
- package/dist/components/pagination.d.cts +15 -16
- package/dist/components/pagination.d.ts +15 -16
- package/dist/components/pagination.js +69 -250
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.cjs +68 -111
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.d.cts +31 -30
- package/dist/components/popover.d.ts +31 -30
- package/dist/components/popover.js +66 -90
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.cjs +128 -81
- package/dist/components/portal.cjs.map +1 -1
- package/dist/components/portal.d.cts +24 -23
- package/dist/components/portal.d.ts +24 -23
- package/dist/components/portal.js +126 -60
- package/dist/components/portal.js.map +1 -1
- package/dist/components/progress.cjs +23 -24
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.d.cts +8 -7
- package/dist/components/progress.d.ts +8 -7
- package/dist/components/progress.js +21 -23
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +70 -138
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
- package/dist/components/progressive-blur-scroll-container.d.cts +19 -19
- package/dist/components/progressive-blur-scroll-container.d.ts +19 -19
- package/dist/components/progressive-blur-scroll-container.js +70 -137
- package/dist/components/progressive-blur-scroll-container.js.map +1 -1
- package/dist/components/progressive-blur.cjs +40 -64
- package/dist/components/progressive-blur.cjs.map +1 -1
- package/dist/components/progressive-blur.d.cts +15 -14
- package/dist/components/progressive-blur.d.ts +15 -14
- package/dist/components/progressive-blur.js +38 -63
- package/dist/components/progressive-blur.js.map +1 -1
- package/dist/components/radio-group.cjs +28 -42
- package/dist/components/radio-group.cjs.map +1 -1
- package/dist/components/radio-group.d.cts +8 -8
- package/dist/components/radio-group.d.ts +8 -8
- package/dist/components/radio-group.js +28 -41
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +6 -418
- package/dist/components/record-picker.d.cts +13 -13
- package/dist/components/record-picker.d.ts +13 -13
- package/dist/components/record-picker.js +5 -397
- package/dist/components/resizable.cjs +32 -58
- package/dist/components/resizable.cjs.map +1 -1
- package/dist/components/resizable.d.cts +10 -9
- package/dist/components/resizable.d.ts +10 -9
- package/dist/components/resizable.js +29 -37
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/responsive-diagram.cjs +50 -61
- package/dist/components/responsive-diagram.cjs.map +1 -1
- package/dist/components/responsive-diagram.d.cts +7 -7
- package/dist/components/responsive-diagram.d.ts +7 -7
- package/dist/components/responsive-diagram.js +50 -60
- package/dist/components/responsive-diagram.js.map +1 -1
- package/dist/components/scroll-area.cjs +37 -83
- package/dist/components/scroll-area.cjs.map +1 -1
- package/dist/components/scroll-area.d.cts +9 -8
- package/dist/components/scroll-area.d.ts +9 -8
- package/dist/components/scroll-area.js +35 -62
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.cjs +175 -300
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.d.cts +36 -35
- package/dist/components/select.d.ts +36 -35
- package/dist/components/select.js +172 -278
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +16 -19
- package/dist/components/separator.cjs.map +1 -1
- package/dist/components/separator.d.cts +2 -10
- package/dist/components/separator.d.ts +2 -10
- package/dist/components/separator.js +14 -18
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.cjs +17 -487
- package/dist/components/sheet.d.cts +85 -85
- package/dist/components/sheet.d.ts +85 -85
- package/dist/components/sheet.js +3 -453
- package/dist/components/sidebar.cjs +27 -1298
- package/dist/components/sidebar.d.cts +62 -65
- package/dist/components/sidebar.d.ts +62 -65
- package/dist/components/sidebar.js +3 -1254
- package/dist/components/skeleton.cjs +18 -30
- package/dist/components/skeleton.cjs.map +1 -1
- package/dist/components/skeleton.d.cts +6 -5
- package/dist/components/skeleton.d.ts +6 -5
- package/dist/components/skeleton.js +15 -28
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/sonner.cjs +17 -19
- package/dist/components/sonner.cjs.map +1 -1
- package/dist/components/sonner.d.cts +7 -7
- package/dist/components/sonner.d.ts +7 -7
- package/dist/components/sonner.js +17 -18
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/stack/index.cjs +43 -1515
- package/dist/components/stack/index.d.cts +2 -672
- package/dist/components/stack/index.d.ts +2 -672
- package/dist/components/stack/index.js +3 -1455
- package/dist/components/stepper.cjs +131 -285
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.d.cts +27 -26
- package/dist/components/stepper.d.ts +27 -26
- package/dist/components/stepper.js +130 -265
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +21 -32
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.d.cts +7 -6
- package/dist/components/switch.d.ts +7 -6
- package/dist/components/switch.js +19 -31
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +58 -106
- package/dist/components/table.cjs.map +1 -1
- package/dist/components/table.d.cts +17 -16
- package/dist/components/table.d.ts +17 -16
- package/dist/components/table.js +55 -104
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +31 -35
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.d.cts +9 -8
- package/dist/components/tabs.d.ts +9 -8
- package/dist/components/tabs.js +29 -34
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +114 -433
- package/dist/components/tags.cjs.map +1 -1
- package/dist/components/tags.d.cts +24 -28
- package/dist/components/tags.d.ts +24 -28
- package/dist/components/tags.js +114 -413
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +27 -49
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.d.cts +8 -7
- package/dist/components/textarea.d.ts +8 -7
- package/dist/components/textarea.js +27 -48
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast/index.cjs +9 -612
- package/dist/components/toast/index.d.cts +2 -52
- package/dist/components/toast/index.d.ts +2 -52
- package/dist/components/toast/index.js +3 -586
- package/dist/components/tooltip.cjs +47 -72
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.d.cts +2 -28
- package/dist/components/tooltip.d.ts +2 -28
- package/dist/components/tooltip.js +45 -51
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +19 -192
- package/dist/components/unlink-button.cjs.map +1 -1
- package/dist/components/unlink-button.d.cts +11 -11
- package/dist/components/unlink-button.d.ts +11 -11
- package/dist/components/unlink-button.js +18 -170
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/form-DgRTv7O7.d.ts +54 -0
- package/dist/form-DoZEWSzb.d.cts +54 -0
- package/dist/index-CjA4CENl.d.cts +684 -0
- package/dist/index-CjA4CENl.d.ts +684 -0
- package/dist/index-UnM04j0t.d.cts +58 -0
- package/dist/index-UnM04j0t.d.ts +58 -0
- package/dist/index.cjs +408 -8697
- package/dist/index.d.cts +224 -2136
- package/dist/index.d.ts +224 -2136
- package/dist/index.js +65 -8350
- package/dist/input-CBrCuMH8.d.cts +11 -0
- package/dist/input-CBrCuMH8.d.ts +11 -0
- package/dist/motion-config-COCFHq1L.cjs +271 -0
- package/dist/motion-config-COCFHq1L.cjs.map +1 -0
- package/dist/motion-config-COsZ6azM.js +241 -0
- package/dist/motion-config-COsZ6azM.js.map +1 -0
- package/dist/record-picker-BbxngCeV.js +162 -0
- package/dist/record-picker-BbxngCeV.js.map +1 -0
- package/dist/record-picker-Bz4FApxD.cjs +167 -0
- package/dist/record-picker-Bz4FApxD.cjs.map +1 -0
- package/dist/rolldown-runtime-D_qnwXdH.cjs +35 -0
- package/dist/separator-BQEsr0Rc.d.cts +11 -0
- package/dist/separator-BQEsr0Rc.d.ts +11 -0
- package/dist/sheet-BLHnhLRH.js +425 -0
- package/dist/sheet-BLHnhLRH.js.map +1 -0
- package/dist/sheet-BdA0rfIz.cjs +515 -0
- package/dist/sheet-BdA0rfIz.cjs.map +1 -0
- package/dist/sidebar-BavjjJp0.cjs +625 -0
- package/dist/sidebar-BavjjJp0.cjs.map +1 -0
- package/dist/sidebar-DeoL2ttp.js +481 -0
- package/dist/sidebar-DeoL2ttp.js.map +1 -0
- package/dist/slot-C-jEfihz.cjs +122 -0
- package/dist/slot-C-jEfihz.cjs.map +1 -0
- package/dist/slot-EL8zfLG0.js +97 -0
- package/dist/slot-EL8zfLG0.js.map +1 -0
- package/dist/stack-DKdvlOM6.cjs +1771 -0
- package/dist/stack-DKdvlOM6.cjs.map +1 -0
- package/dist/stack-jMdxDrex.js +1531 -0
- package/dist/stack-jMdxDrex.js.map +1 -0
- package/dist/toast-D6MqijT2.cjs +316 -0
- package/dist/toast-D6MqijT2.cjs.map +1 -0
- package/dist/toast-D_BOLzm3.js +287 -0
- package/dist/toast-D_BOLzm3.js.map +1 -0
- package/dist/tooltip-CTRQoN1A.d.cts +29 -0
- package/dist/tooltip-CTRQoN1A.d.ts +29 -0
- package/dist/utils-BkMLyah9.js +12 -0
- package/dist/utils-BkMLyah9.js.map +1 -0
- package/dist/utils-CzTQ3-VI.cjs +17 -0
- package/dist/utils-CzTQ3-VI.cjs.map +1 -0
- package/package.json +5 -5
- package/dist/components/record-picker.cjs.map +0 -1
- package/dist/components/record-picker.js.map +0 -1
- package/dist/components/sheet.cjs.map +0 -1
- package/dist/components/sheet.js.map +0 -1
- package/dist/components/sidebar.cjs.map +0 -1
- package/dist/components/sidebar.js.map +0 -1
- package/dist/components/stack/index.cjs.map +0 -1
- package/dist/components/stack/index.js.map +0 -1
- package/dist/components/toast/index.cjs.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/components/tags.js
CHANGED
|
@@ -1,422 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React2 from 'react';
|
|
3
|
-
import { createContext, useState, useRef, useEffect, useContext } from 'react';
|
|
4
|
-
import { XIcon, SearchIcon } from 'lucide-react';
|
|
5
|
-
import { clsx } from 'clsx';
|
|
6
|
-
import { twMerge } from 'tailwind-merge';
|
|
7
|
-
import { cva } from 'class-variance-authority';
|
|
8
|
-
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
9
|
-
import { Command as Command$1 } from 'cmdk';
|
|
10
|
-
import { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';
|
|
11
|
-
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
1
|
+
'use client';
|
|
12
2
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
default: "bg-primary text-primary-foreground [button,a&]:hover:bg-primary/90",
|
|
31
|
-
destructive: "bg-destructive text-white [button,a&]:hover:bg-destructive/90",
|
|
32
|
-
error: "bg-destructive/8 text-destructive dark:bg-destructive/16",
|
|
33
|
-
info: "bg-info/8 text-info-foreground dark:bg-info/16",
|
|
34
|
-
outline: "border-border/60 bg-transparent dark:bg-input/32 [button,a&]:hover:bg-accent/50 dark:[button,a&]:hover:bg-input/48",
|
|
35
|
-
secondary: "bg-secondary text-secondary-foreground [button,a&]:hover:bg-secondary/90",
|
|
36
|
-
success: "bg-success/8 text-success-foreground dark:bg-success/16",
|
|
37
|
-
warning: "bg-warning/8 text-warning-foreground dark:bg-warning/16"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
var Badge = React2.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx("span", { ref, "data-slot": "badge", className: cn(badgeVariants({ variant, size }), className), ...props }));
|
|
43
|
-
Badge.displayName = "Badge";
|
|
44
|
-
function composeRefs(...refs) {
|
|
45
|
-
return (node) => {
|
|
46
|
-
refs.forEach((ref) => {
|
|
47
|
-
if (typeof ref === "function") {
|
|
48
|
-
ref(node);
|
|
49
|
-
} else if (ref != null) {
|
|
50
|
-
ref.current = node;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function mergeProps(slotProps, childProps) {
|
|
56
|
-
const overrideProps = { ...childProps };
|
|
57
|
-
for (const propName in childProps) {
|
|
58
|
-
if (propName === "ref") continue;
|
|
59
|
-
const slotPropValue = slotProps[propName];
|
|
60
|
-
const childPropValue = childProps[propName];
|
|
61
|
-
if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
62
|
-
overrideProps[propName] = (...args) => {
|
|
63
|
-
childPropValue(...args);
|
|
64
|
-
slotPropValue(...args);
|
|
65
|
-
};
|
|
66
|
-
} else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
|
|
67
|
-
overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
|
|
68
|
-
} else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
|
|
69
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return { ...slotProps, ...overrideProps };
|
|
73
|
-
}
|
|
74
|
-
function isSlottable(child) {
|
|
75
|
-
return React2.isValidElement(child);
|
|
76
|
-
}
|
|
77
|
-
var Slot = React2.forwardRef((props, forwardedRef) => {
|
|
78
|
-
const { children, ...slotProps } = props;
|
|
79
|
-
if (isSlottable(children)) {
|
|
80
|
-
const childProps = children.props;
|
|
81
|
-
const childRef = childProps.ref;
|
|
82
|
-
return React2.cloneElement(children, {
|
|
83
|
-
...mergeProps(slotProps, childProps),
|
|
84
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
if (React2.Children.count(children) > 1) {
|
|
88
|
-
const childrenArray = React2.Children.toArray(children);
|
|
89
|
-
const slottableChild = childrenArray.find(
|
|
90
|
-
(child) => React2.isValidElement(child) && child.type === Slottable
|
|
91
|
-
);
|
|
92
|
-
if (slottableChild) {
|
|
93
|
-
const newElement = slottableChild.props.children;
|
|
94
|
-
if (isSlottable(newElement)) {
|
|
95
|
-
const newElementProps = newElement.props;
|
|
96
|
-
const newChildren = childrenArray.map((child) => {
|
|
97
|
-
if (child === slottableChild) {
|
|
98
|
-
return React2.Children.count(newElementProps.children) > 1 ? React2.Children.only(null) : newElementProps.children;
|
|
99
|
-
}
|
|
100
|
-
return child;
|
|
101
|
-
});
|
|
102
|
-
const childRef = newElementProps.ref;
|
|
103
|
-
return React2.cloneElement(newElement, {
|
|
104
|
-
...mergeProps(slotProps, newElementProps),
|
|
105
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
|
|
106
|
-
children: newChildren
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
112
|
-
});
|
|
113
|
-
Slot.displayName = "Slot";
|
|
114
|
-
function Slottable({ children }) {
|
|
115
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
116
|
-
}
|
|
117
|
-
var buttonVariants = cva(
|
|
118
|
-
"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
119
|
-
{
|
|
120
|
-
defaultVariants: {
|
|
121
|
-
size: "default",
|
|
122
|
-
static: false,
|
|
123
|
-
variant: "default"
|
|
124
|
-
},
|
|
125
|
-
variants: {
|
|
126
|
-
static: {
|
|
127
|
-
false: "motion-safe:active:not-disabled:scale-[0.96]",
|
|
128
|
-
true: null
|
|
129
|
-
},
|
|
130
|
-
size: {
|
|
131
|
-
default: "h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
132
|
-
icon: "size-10 pointer-coarse:size-11",
|
|
133
|
-
"icon-lg": "size-11",
|
|
134
|
-
"icon-sm": "size-8 pointer-coarse:size-11",
|
|
135
|
-
"icon-xl": 'size-11 [&_svg:not([class*="size-"])]:size-5',
|
|
136
|
-
"icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4',
|
|
137
|
-
lg: "h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]",
|
|
138
|
-
sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
139
|
-
xl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*="size-"])]:size-5',
|
|
140
|
-
xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*="size-"])]:size-3.5'
|
|
141
|
-
},
|
|
142
|
-
variant: {
|
|
143
|
-
default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
144
|
-
destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
145
|
-
"destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
|
|
146
|
-
ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
|
|
147
|
-
link: "border-transparent underline-offset-4 hover:underline",
|
|
148
|
-
outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
|
|
149
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
);
|
|
154
|
-
var Button = React2.forwardRef(
|
|
155
|
-
({ className, variant, size, static: isStatic, asChild, children, type = "button", ...props }, ref) => {
|
|
156
|
-
const buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));
|
|
157
|
-
const Comp = asChild ? Slot : "button";
|
|
158
|
-
if (asChild) {
|
|
159
|
-
const SlottedComp = Comp;
|
|
160
|
-
return /* @__PURE__ */ jsx(
|
|
161
|
-
SlottedComp,
|
|
162
|
-
{
|
|
163
|
-
ref,
|
|
164
|
-
className: buttonClasses,
|
|
165
|
-
"data-slot": "button",
|
|
166
|
-
...props,
|
|
167
|
-
children
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
|
|
172
|
-
}
|
|
173
|
-
);
|
|
174
|
-
Button.displayName = "Button";
|
|
175
|
-
function Command({
|
|
176
|
-
className,
|
|
177
|
-
...props
|
|
178
|
-
}) {
|
|
179
|
-
return /* @__PURE__ */ jsx(
|
|
180
|
-
Command$1,
|
|
181
|
-
{
|
|
182
|
-
className: cn(
|
|
183
|
-
"flex h-full w-full flex-col overflow-hidden rounded-2xl",
|
|
184
|
-
className
|
|
185
|
-
),
|
|
186
|
-
"data-slot": "command",
|
|
187
|
-
...props
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
function CommandInput({
|
|
192
|
-
className,
|
|
193
|
-
placeholder,
|
|
194
|
-
...props
|
|
195
|
-
}) {
|
|
196
|
-
return /* @__PURE__ */ jsx("div", { className: "px-2.5 py-1.5", "data-slot": "command-input-wrapper", children: /* @__PURE__ */ jsxs(
|
|
197
|
-
"div",
|
|
198
|
-
{
|
|
199
|
-
className: cn(
|
|
200
|
-
"flex items-center gap-2 rounded-lg px-3 text-base",
|
|
201
|
-
className
|
|
202
|
-
),
|
|
203
|
-
children: [
|
|
204
|
-
/* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
205
|
-
/* @__PURE__ */ jsx(
|
|
206
|
-
Command$1.Input,
|
|
207
|
-
{
|
|
208
|
-
className: "flex h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
209
|
-
placeholder,
|
|
210
|
-
"data-slot": "command-input",
|
|
211
|
-
...props
|
|
212
|
-
}
|
|
213
|
-
)
|
|
214
|
-
]
|
|
215
|
-
}
|
|
216
|
-
) });
|
|
217
|
-
}
|
|
218
|
-
function CommandList({
|
|
219
|
-
className,
|
|
220
|
-
...props
|
|
221
|
-
}) {
|
|
222
|
-
return /* @__PURE__ */ jsx(
|
|
223
|
-
Command$1.List,
|
|
224
|
-
{
|
|
225
|
-
className: cn("not-empty:scroll-py-2 not-empty:p-2 max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
226
|
-
"data-slot": "command-list",
|
|
227
|
-
...props
|
|
228
|
-
}
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
function CommandEmpty({
|
|
232
|
-
className,
|
|
233
|
-
...props
|
|
234
|
-
}) {
|
|
235
|
-
return /* @__PURE__ */ jsx(
|
|
236
|
-
Command$1.Empty,
|
|
237
|
-
{
|
|
238
|
-
className: cn("not-empty:py-6", className),
|
|
239
|
-
"data-slot": "command-empty",
|
|
240
|
-
...props
|
|
241
|
-
}
|
|
242
|
-
);
|
|
243
|
-
}
|
|
244
|
-
function CommandGroup({
|
|
245
|
-
className,
|
|
246
|
-
heading,
|
|
247
|
-
children,
|
|
248
|
-
...props
|
|
249
|
-
}) {
|
|
250
|
-
return /* @__PURE__ */ jsx(
|
|
251
|
-
Command$1.Group,
|
|
252
|
-
{
|
|
253
|
-
className: cn(
|
|
254
|
-
"overflow-hidden text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
255
|
-
className
|
|
256
|
-
),
|
|
257
|
-
heading,
|
|
258
|
-
"data-slot": "command-group",
|
|
259
|
-
...props,
|
|
260
|
-
children
|
|
261
|
-
}
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
function CommandItem({
|
|
265
|
-
className,
|
|
266
|
-
...props
|
|
267
|
-
}) {
|
|
268
|
-
return /* @__PURE__ */ jsx(
|
|
269
|
-
Command$1.Item,
|
|
270
|
-
{
|
|
271
|
-
className: cn(
|
|
272
|
-
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none pointer-coarse:min-h-11 data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
|
|
273
|
-
className
|
|
274
|
-
),
|
|
275
|
-
"data-slot": "command-item",
|
|
276
|
-
...props
|
|
277
|
-
}
|
|
278
|
-
);
|
|
279
|
-
}
|
|
280
|
-
function Popover({ ...props }) {
|
|
281
|
-
return /* @__PURE__ */ jsx(Popover$1.Root, { "data-slot": "popover", ...props });
|
|
282
|
-
}
|
|
283
|
-
function PopoverTrigger({ asChild, children, render, nativeButton, ...props }) {
|
|
284
|
-
const childRender = render === void 0 && asChild && React2.isValidElement(children) ? children : void 0;
|
|
285
|
-
return /* @__PURE__ */ jsx(
|
|
286
|
-
Popover$1.Trigger,
|
|
287
|
-
{
|
|
288
|
-
"data-slot": "popover-trigger",
|
|
289
|
-
nativeButton: nativeButton ?? (childRender ? true : void 0),
|
|
290
|
-
render: render ?? childRender,
|
|
291
|
-
...props,
|
|
292
|
-
children: childRender ? void 0 : children
|
|
293
|
-
}
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
function PopoverContent({
|
|
297
|
-
className,
|
|
298
|
-
align = "center",
|
|
299
|
-
sideOffset = 4,
|
|
300
|
-
showArrow = false,
|
|
301
|
-
side = "bottom",
|
|
302
|
-
children,
|
|
303
|
-
onOpenAutoFocus: _onOpenAutoFocus,
|
|
304
|
-
onCloseAutoFocus: _onCloseAutoFocus,
|
|
305
|
-
onFocusOutside: _onFocusOutside,
|
|
306
|
-
onEscapeKeyDown: _onEscapeKeyDown,
|
|
307
|
-
...props
|
|
308
|
-
}) {
|
|
309
|
-
const { container, zIndexClass } = useFloatingOverlayPortalProps();
|
|
310
|
-
return /* @__PURE__ */ jsx(Popover$1.Portal, { container, children: /* @__PURE__ */ jsx(
|
|
311
|
-
Popover$1.Positioner,
|
|
312
|
-
{
|
|
313
|
-
side,
|
|
314
|
-
align,
|
|
315
|
-
sideOffset,
|
|
316
|
-
className: zIndexClass,
|
|
317
|
-
children: /* @__PURE__ */ jsxs(
|
|
318
|
-
Popover$1.Popup,
|
|
319
|
-
{
|
|
320
|
-
"data-slot": "popover-content",
|
|
321
|
-
className: cn(
|
|
322
|
-
`bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden
|
|
323
|
-
transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
|
|
324
|
-
data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
|
|
325
|
-
data-[side=bottom]:data-starting-style:-translate-y-2
|
|
326
|
-
data-[side=left]:data-starting-style:translate-x-2
|
|
327
|
-
data-[side=right]:data-starting-style:-translate-x-2
|
|
328
|
-
data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
|
|
329
|
-
className
|
|
330
|
-
),
|
|
331
|
-
...props,
|
|
332
|
-
children: [
|
|
333
|
-
children,
|
|
334
|
-
showArrow && /* @__PURE__ */ jsx(Popover$1.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]" })
|
|
335
|
-
]
|
|
336
|
-
}
|
|
337
|
-
)
|
|
338
|
-
}
|
|
339
|
-
) });
|
|
340
|
-
}
|
|
341
|
-
var TagsContext = createContext({
|
|
342
|
-
value: void 0,
|
|
343
|
-
setValue: void 0,
|
|
344
|
-
open: false,
|
|
345
|
-
onOpenChange: () => {
|
|
346
|
-
},
|
|
347
|
-
width: void 0,
|
|
348
|
-
setWidth: void 0
|
|
3
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { Badge } from "./badge.js";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
7
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./command.js";
|
|
8
|
+
import { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { XIcon } from "lucide-react";
|
|
11
|
+
|
|
12
|
+
//#region src/components/tags.tsx
|
|
13
|
+
const TagsContext = createContext({
|
|
14
|
+
value: void 0,
|
|
15
|
+
setValue: void 0,
|
|
16
|
+
open: false,
|
|
17
|
+
onOpenChange: () => {},
|
|
18
|
+
width: void 0,
|
|
19
|
+
setWidth: void 0
|
|
349
20
|
});
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
return context;
|
|
21
|
+
const useTagsContext = () => {
|
|
22
|
+
const context = useContext(TagsContext);
|
|
23
|
+
if (!context) throw new Error("useTagsContext must be used within a TagsProvider");
|
|
24
|
+
return context;
|
|
356
25
|
};
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
26
|
+
const Tags = ({ value, setValue, open: controlledOpen, onOpenChange: controlledOnOpenChange, children, className }) => {
|
|
27
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
|
|
28
|
+
const [width, setWidth] = useState();
|
|
29
|
+
const ref = useRef(null);
|
|
30
|
+
const open = controlledOpen ?? uncontrolledOpen;
|
|
31
|
+
const onOpenChange = controlledOnOpenChange ?? setUncontrolledOpen;
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!ref.current) return;
|
|
34
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
35
|
+
setWidth(entries[0].contentRect.width);
|
|
36
|
+
});
|
|
37
|
+
resizeObserver.observe(ref.current);
|
|
38
|
+
return () => {
|
|
39
|
+
resizeObserver.disconnect();
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
return /* @__PURE__ */ jsx(TagsContext.Provider, {
|
|
43
|
+
value: {
|
|
44
|
+
value,
|
|
45
|
+
setValue,
|
|
46
|
+
open,
|
|
47
|
+
onOpenChange,
|
|
48
|
+
width,
|
|
49
|
+
setWidth
|
|
50
|
+
},
|
|
51
|
+
children: /* @__PURE__ */ jsx(Popover, {
|
|
52
|
+
onOpenChange,
|
|
53
|
+
open,
|
|
54
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: cn("relative w-full", className),
|
|
56
|
+
ref,
|
|
57
|
+
children
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
});
|
|
383
61
|
};
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
62
|
+
const TagsTrigger = ({ className, children, ...props }) => /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
63
|
+
asChild: true,
|
|
64
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
65
|
+
className: cn("h-auto w-full justify-between p-2", className),
|
|
66
|
+
role: "combobox",
|
|
67
|
+
variant: "outline",
|
|
68
|
+
...props,
|
|
69
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
70
|
+
className: "flex flex-wrap items-center gap-1",
|
|
71
|
+
children: [children, /* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "text-muted-foreground px-2 py-px",
|
|
73
|
+
children: "Select a tag..."
|
|
74
|
+
})]
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
const TagsValue = ({ className, children, onRemove, ...props }) => {
|
|
79
|
+
const handleRemove = (event) => {
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
event.stopPropagation();
|
|
82
|
+
onRemove?.();
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ jsxs(Badge, {
|
|
85
|
+
className: cn("flex items-center gap-2", className),
|
|
86
|
+
...props,
|
|
87
|
+
children: [children, onRemove && /* @__PURE__ */ jsx("div", {
|
|
88
|
+
className: "hover:text-muted-foreground size-auto cursor-pointer",
|
|
89
|
+
onClick: handleRemove,
|
|
90
|
+
children: /* @__PURE__ */ jsx(XIcon, { size: 12 })
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
409
93
|
};
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
94
|
+
const TagsContent = ({ className, children, ...props }) => {
|
|
95
|
+
const { width } = useTagsContext();
|
|
96
|
+
return /* @__PURE__ */ jsx(PopoverContent, {
|
|
97
|
+
className: cn("p-0", className),
|
|
98
|
+
style: { width },
|
|
99
|
+
...props,
|
|
100
|
+
children: /* @__PURE__ */ jsx(Command, { children })
|
|
101
|
+
});
|
|
413
102
|
};
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
103
|
+
const TagsInput = ({ className, ...props }) => /* @__PURE__ */ jsx(CommandInput, {
|
|
104
|
+
className: cn("h-9", className),
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
const TagsList = ({ className, ...props }) => /* @__PURE__ */ jsx(CommandList, {
|
|
108
|
+
className: cn("max-h-[200px]", className),
|
|
109
|
+
...props
|
|
110
|
+
});
|
|
111
|
+
const TagsEmpty = ({ children, className: _className, ...props }) => /* @__PURE__ */ jsx(CommandEmpty, {
|
|
112
|
+
...props,
|
|
113
|
+
children: children ?? "No tags found."
|
|
114
|
+
});
|
|
115
|
+
const TagsGroup = CommandGroup;
|
|
116
|
+
const TagsItem = ({ className, ...props }) => /* @__PURE__ */ jsx(CommandItem, {
|
|
117
|
+
className: cn("cursor-pointer items-center justify-between", className),
|
|
118
|
+
...props
|
|
119
|
+
});
|
|
419
120
|
|
|
121
|
+
//#endregion
|
|
420
122
|
export { Tags, TagsContent, TagsEmpty, TagsGroup, TagsInput, TagsItem, TagsList, TagsTrigger, TagsValue };
|
|
421
|
-
//# sourceMappingURL=tags.js.map
|
|
422
123
|
//# sourceMappingURL=tags.js.map
|