@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
|
@@ -1,420 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
1
|
+
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var clsx = require('clsx');
|
|
9
|
-
var tailwindMerge = require('tailwind-merge');
|
|
10
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
12
|
-
var input = require('@base-ui/react/input');
|
|
13
|
-
var scrollArea = require('@base-ui/react/scroll-area');
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
require('./checkbox.cjs');
|
|
5
|
+
require('./input-group.cjs');
|
|
6
|
+
const require_record_picker = require('../record-picker-Bz4FApxD.cjs');
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
if (e && e.__esModule) return e;
|
|
17
|
-
var n = Object.create(null);
|
|
18
|
-
if (e) {
|
|
19
|
-
Object.keys(e).forEach(function (k) {
|
|
20
|
-
if (k !== 'default') {
|
|
21
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function () { return e[k]; }
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
n.default = e;
|
|
30
|
-
return Object.freeze(n);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
34
|
-
|
|
35
|
-
function useDebounce(value, delay) {
|
|
36
|
-
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
|
37
|
-
React.useEffect(() => {
|
|
38
|
-
const handler = setTimeout(() => {
|
|
39
|
-
setDebouncedValue(value);
|
|
40
|
-
}, delay);
|
|
41
|
-
return () => {
|
|
42
|
-
clearTimeout(handler);
|
|
43
|
-
};
|
|
44
|
-
}, [value, delay]);
|
|
45
|
-
return debouncedValue;
|
|
46
|
-
}
|
|
47
|
-
function cn(...inputs) {
|
|
48
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
49
|
-
}
|
|
50
|
-
var Checkbox = React__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
51
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
52
|
-
checkbox.Checkbox.Root,
|
|
53
|
-
{
|
|
54
|
-
ref,
|
|
55
|
-
className: cn(
|
|
56
|
-
"relative inline-flex size-10 shrink-0 items-center justify-center outline-none transition-transform duration-150 ease-out motion-safe:active:not-data-disabled:scale-[0.96] motion-reduce:transition-none pointer-coarse:size-11 data-disabled:cursor-not-allowed data-disabled:opacity-64 aria-invalid:[&_[data-slot=checkbox-control]]:border-destructive/36 focus-visible:[&_[data-slot=checkbox-control]]:ring-2 focus-visible:[&_[data-slot=checkbox-control]]:ring-ring focus-visible:[&_[data-slot=checkbox-control]]:ring-offset-1 focus-visible:[&_[data-slot=checkbox-control]]:ring-offset-background focus-visible:aria-invalid:[&_[data-slot=checkbox-control]]:border-destructive/64 focus-visible:aria-invalid:[&_[data-slot=checkbox-control]]:ring-destructive/48 dark:aria-invalid:[&_[data-slot=checkbox-control]]:ring-destructive/24",
|
|
57
|
-
className
|
|
58
|
-
),
|
|
59
|
-
"data-slot": "checkbox",
|
|
60
|
-
...props,
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
-
"span",
|
|
64
|
-
{
|
|
65
|
-
"aria-hidden": "true",
|
|
66
|
-
className: "pointer-events-none absolute size-4.5 rounded-[4px] border border-input bg-background bg-clip-padding shadow-[0_1px_--theme(--color-black/4%)] sm:size-4 dark:bg-input/32 dark:bg-clip-border dark:shadow-[0_-1px_--theme(--color-white/8%)]",
|
|
67
|
-
"data-slot": "checkbox-control"
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
-
checkbox.Checkbox.Indicator,
|
|
72
|
-
{
|
|
73
|
-
keepMounted: true,
|
|
74
|
-
className: "absolute flex size-4.5 items-center justify-center rounded-[4px] text-primary-foreground transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] data-unchecked:scale-[0.25] data-unchecked:opacity-0 data-unchecked:blur-[4px] data-checked:bg-primary data-indeterminate:text-foreground motion-reduce:transition-none sm:size-4",
|
|
75
|
-
"data-slot": "checkbox-indicator",
|
|
76
|
-
render: (props2, state) => /* @__PURE__ */ jsxRuntime.jsxs("span", { ...props2, children: [
|
|
77
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
78
|
-
"span",
|
|
79
|
-
{
|
|
80
|
-
className: cn(
|
|
81
|
-
"absolute inset-0 flex items-center justify-center transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none",
|
|
82
|
-
state.indeterminate ? "scale-100 opacity-100 blur-0" : "scale-[0.25] opacity-0 blur-[4px]"
|
|
83
|
-
),
|
|
84
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
-
"svg",
|
|
86
|
-
{
|
|
87
|
-
className: "size-3.5 sm:size-3",
|
|
88
|
-
fill: "none",
|
|
89
|
-
height: "24",
|
|
90
|
-
stroke: "currentColor",
|
|
91
|
-
strokeLinecap: "round",
|
|
92
|
-
strokeLinejoin: "round",
|
|
93
|
-
strokeWidth: "3",
|
|
94
|
-
viewBox: "0 0 24 24",
|
|
95
|
-
width: "24",
|
|
96
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
97
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5.252 12h13.496" })
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
),
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
-
"span",
|
|
104
|
-
{
|
|
105
|
-
className: cn(
|
|
106
|
-
"absolute inset-0 flex items-center justify-center transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none",
|
|
107
|
-
state.indeterminate ? "scale-[0.25] opacity-0 blur-[4px]" : "scale-100 opacity-100 blur-0"
|
|
108
|
-
),
|
|
109
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
110
|
-
"svg",
|
|
111
|
-
{
|
|
112
|
-
className: "size-3.5 sm:size-3",
|
|
113
|
-
fill: "none",
|
|
114
|
-
height: "24",
|
|
115
|
-
stroke: "currentColor",
|
|
116
|
-
strokeLinecap: "round",
|
|
117
|
-
strokeLinejoin: "round",
|
|
118
|
-
strokeWidth: "3",
|
|
119
|
-
viewBox: "0 0 24 24",
|
|
120
|
-
width: "24",
|
|
121
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
122
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
] })
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
});
|
|
134
|
-
Checkbox.displayName = "Checkbox";
|
|
135
|
-
function Input({ className, size = "default", unstyled = false, ...props }) {
|
|
136
|
-
const isFloating = props.placeholder === " ";
|
|
137
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
138
|
-
"span",
|
|
139
|
-
{
|
|
140
|
-
className: cn(
|
|
141
|
-
!unstyled && [
|
|
142
|
-
// Base layout
|
|
143
|
-
"relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow",
|
|
144
|
-
// Inner shadow highlight
|
|
145
|
-
"before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]",
|
|
146
|
-
"not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]",
|
|
147
|
-
// Focus state - use primary brand color
|
|
148
|
-
"has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35",
|
|
149
|
-
// Invalid state
|
|
150
|
-
"has-aria-invalid:border-destructive/36",
|
|
151
|
-
"has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16",
|
|
152
|
-
// Disabled state
|
|
153
|
-
"has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none",
|
|
154
|
-
// Dark mode
|
|
155
|
-
"sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border",
|
|
156
|
-
"dark:has-aria-invalid:ring-destructive/24",
|
|
157
|
-
"dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]"
|
|
158
|
-
],
|
|
159
|
-
className
|
|
160
|
-
) || void 0,
|
|
161
|
-
"data-size": size,
|
|
162
|
-
"data-slot": "input-control",
|
|
163
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
164
|
-
input.Input,
|
|
165
|
-
{
|
|
166
|
-
className: cn(
|
|
167
|
-
"w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none pointer-coarse:min-h-11",
|
|
168
|
-
isFloating ? "h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10" : "h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5",
|
|
169
|
-
size === "sm" && (isFloating ? "h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9" : "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5"),
|
|
170
|
-
size === "lg" && (isFloating ? "h-12 pt-5 pb-1.5 sm:h-11" : "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5"),
|
|
171
|
-
props.type === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",
|
|
172
|
-
props.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm"
|
|
173
|
-
),
|
|
174
|
-
"data-slot": "input",
|
|
175
|
-
size: typeof size === "number" ? size : void 0,
|
|
176
|
-
...props
|
|
177
|
-
}
|
|
178
|
-
)
|
|
179
|
-
}
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
function InputGroup({ className, ...props }) {
|
|
183
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
184
|
-
"div",
|
|
185
|
-
{
|
|
186
|
-
className: cn(
|
|
187
|
-
// Match aria-invalid="true" only. aria-invalid="false" must not paint as invalid.
|
|
188
|
-
"relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid=true],textarea[aria-invalid=true]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-primary/60 has-[input[aria-invalid=true],textarea[aria-invalid=true]]:border-destructive/36 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid=true],textarea[aria-invalid=true]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[input:focus-visible,textarea:focus-visible]:ring-primary/35 sm:text-sm dark:bg-input/32 dark:bg-clip-border dark:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid=true],textarea[aria-invalid=true]]:before:shadow-[0_-1px_--theme(--color-white/8%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]",
|
|
189
|
-
className
|
|
190
|
-
),
|
|
191
|
-
"data-slot": "input-group",
|
|
192
|
-
role: "group",
|
|
193
|
-
...props
|
|
194
|
-
}
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
var inputGroupAddonVariants = classVarianceAuthority.cva(
|
|
198
|
-
"[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80",
|
|
199
|
-
{
|
|
200
|
-
defaultVariants: {
|
|
201
|
-
align: "inline-start"
|
|
202
|
-
},
|
|
203
|
-
variants: {
|
|
204
|
-
align: {
|
|
205
|
-
"block-end": "order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
|
|
206
|
-
"block-start": "order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
|
|
207
|
-
"inline-end": "has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]",
|
|
208
|
-
"inline-start": "has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]"
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
function InputGroupAddon({
|
|
214
|
-
className,
|
|
215
|
-
align = "inline-start",
|
|
216
|
-
...props
|
|
217
|
-
}) {
|
|
218
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
219
|
-
"div",
|
|
220
|
-
{
|
|
221
|
-
className: cn(inputGroupAddonVariants({ align }), className),
|
|
222
|
-
"data-align": align,
|
|
223
|
-
"data-slot": "input-group-addon",
|
|
224
|
-
onMouseDown: (e) => {
|
|
225
|
-
const target = e.target;
|
|
226
|
-
const isInteractive = target.closest("button, a");
|
|
227
|
-
if (isInteractive) return;
|
|
228
|
-
e.preventDefault();
|
|
229
|
-
const parent = e.currentTarget.parentElement;
|
|
230
|
-
const input = parent?.querySelector("input, textarea");
|
|
231
|
-
if (input && !parent?.querySelector("input:focus, textarea:focus")) {
|
|
232
|
-
input.focus();
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
...props
|
|
236
|
-
}
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
function InputGroupInput({ className, ...props }) {
|
|
240
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Input, { className, unstyled: true, ...props });
|
|
241
|
-
}
|
|
242
|
-
var ScrollArea = React__namespace.forwardRef(
|
|
243
|
-
({ className, children, scrollFade = false, scrollbarGutter = false, ...props }, ref) => {
|
|
244
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
245
|
-
scrollArea.ScrollArea.Root,
|
|
246
|
-
{
|
|
247
|
-
ref,
|
|
248
|
-
className: cn("size-full min-h-0", className),
|
|
249
|
-
...props,
|
|
250
|
-
children: [
|
|
251
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
252
|
-
scrollArea.ScrollArea.Viewport,
|
|
253
|
-
{
|
|
254
|
-
className: cn(
|
|
255
|
-
"h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
|
256
|
-
scrollFade && "mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",
|
|
257
|
-
scrollbarGutter && "data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"
|
|
258
|
-
),
|
|
259
|
-
"data-slot": "scroll-area-viewport",
|
|
260
|
-
children
|
|
261
|
-
}
|
|
262
|
-
),
|
|
263
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "vertical" }),
|
|
264
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollBar, { orientation: "horizontal" }),
|
|
265
|
-
/* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea.Corner, { "data-slot": "scroll-area-corner" })
|
|
266
|
-
]
|
|
267
|
-
}
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
);
|
|
271
|
-
ScrollArea.displayName = "ScrollArea";
|
|
272
|
-
function ScrollBar({
|
|
273
|
-
className,
|
|
274
|
-
orientation = "vertical",
|
|
275
|
-
...props
|
|
276
|
-
}) {
|
|
277
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
278
|
-
scrollArea.ScrollArea.Scrollbar,
|
|
279
|
-
{
|
|
280
|
-
className: cn(
|
|
281
|
-
"m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100",
|
|
282
|
-
className
|
|
283
|
-
),
|
|
284
|
-
"data-slot": "scroll-area-scrollbar",
|
|
285
|
-
orientation,
|
|
286
|
-
...props,
|
|
287
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
288
|
-
scrollArea.ScrollArea.Thumb,
|
|
289
|
-
{
|
|
290
|
-
className: "relative flex-1 rounded-full bg-foreground/20",
|
|
291
|
-
"data-slot": "scroll-area-thumb"
|
|
292
|
-
}
|
|
293
|
-
)
|
|
294
|
-
}
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
function RecordPicker({
|
|
298
|
-
records,
|
|
299
|
-
linkedRecordIds,
|
|
300
|
-
onLink,
|
|
301
|
-
isLinking,
|
|
302
|
-
getRecordLabel,
|
|
303
|
-
getRecordId,
|
|
304
|
-
searchFields = ["name", "title", "label"],
|
|
305
|
-
placeholder = "Search records...",
|
|
306
|
-
maxHeight = "300px"
|
|
307
|
-
}) {
|
|
308
|
-
const [searchQuery, setSearchQuery] = React.useState("");
|
|
309
|
-
const debouncedSearchQuery = useDebounce(searchQuery, 300);
|
|
310
|
-
const filteredRecords = React.useMemo(() => {
|
|
311
|
-
if (!debouncedSearchQuery.trim()) {
|
|
312
|
-
return records;
|
|
313
|
-
}
|
|
314
|
-
return matchSorter.matchSorter(records, debouncedSearchQuery, {
|
|
315
|
-
keys: searchFields,
|
|
316
|
-
threshold: matchSorter.matchSorter.rankings.CONTAINS
|
|
317
|
-
});
|
|
318
|
-
}, [records, debouncedSearchQuery, searchFields]);
|
|
319
|
-
const { linkedRecords, unlinkableRecords } = React.useMemo(() => {
|
|
320
|
-
const linked = [];
|
|
321
|
-
const unlinkable = [];
|
|
322
|
-
filteredRecords.forEach((record) => {
|
|
323
|
-
const recordId = getRecordId(record);
|
|
324
|
-
if (linkedRecordIds.has(recordId)) {
|
|
325
|
-
linked.push(record);
|
|
326
|
-
} else {
|
|
327
|
-
unlinkable.push(record);
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
return { linkedRecords: linked, unlinkableRecords: unlinkable };
|
|
331
|
-
}, [filteredRecords, linkedRecordIds, getRecordId]);
|
|
332
|
-
const handleLinkRecord = React.useCallback(
|
|
333
|
-
(record) => {
|
|
334
|
-
onLink(record);
|
|
335
|
-
},
|
|
336
|
-
[onLink]
|
|
337
|
-
);
|
|
338
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
339
|
-
/* @__PURE__ */ jsxRuntime.jsxs(InputGroup, { children: [
|
|
340
|
-
/* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, { children: /* @__PURE__ */ jsxRuntime.jsx(react.RiSearchLine, {}) }),
|
|
341
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
342
|
-
InputGroupInput,
|
|
343
|
-
{
|
|
344
|
-
placeholder,
|
|
345
|
-
value: searchQuery,
|
|
346
|
-
onChange: (e) => setSearchQuery(e.target.value)
|
|
347
|
-
}
|
|
348
|
-
)
|
|
349
|
-
] }),
|
|
350
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollArea, { style: { maxHeight }, className: "scrollbar-neutral-thin", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 pr-2", children: [
|
|
351
|
-
unlinkableRecords.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
352
|
-
/* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "text-muted-foreground text-xs font-medium tracking-wide uppercase", children: [
|
|
353
|
-
"Available Records (",
|
|
354
|
-
unlinkableRecords.length,
|
|
355
|
-
")"
|
|
356
|
-
] }),
|
|
357
|
-
unlinkableRecords.map((record) => {
|
|
358
|
-
const recordId = getRecordId(record);
|
|
359
|
-
const label = getRecordLabel(record);
|
|
360
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
361
|
-
"div",
|
|
362
|
-
{
|
|
363
|
-
className: "hover:bg-muted/50 flex items-center space-x-3 rounded-md p-2 transition-colors",
|
|
364
|
-
children: [
|
|
365
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
366
|
-
Checkbox,
|
|
367
|
-
{
|
|
368
|
-
id: `record-${recordId}`,
|
|
369
|
-
checked: false,
|
|
370
|
-
onCheckedChange: () => handleLinkRecord(record),
|
|
371
|
-
disabled: isLinking,
|
|
372
|
-
className: "flex-shrink-0"
|
|
373
|
-
}
|
|
374
|
-
),
|
|
375
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
376
|
-
"label",
|
|
377
|
-
{
|
|
378
|
-
htmlFor: `record-${recordId}`,
|
|
379
|
-
className: "flex-1 cursor-pointer truncate text-sm",
|
|
380
|
-
title: label,
|
|
381
|
-
children: label
|
|
382
|
-
}
|
|
383
|
-
),
|
|
384
|
-
isLinking && /* @__PURE__ */ jsxRuntime.jsx(react.RiLoader4Line, { className: "text-muted-foreground h-4 w-4 flex-shrink-0 animate-spin" })
|
|
385
|
-
]
|
|
386
|
-
},
|
|
387
|
-
recordId
|
|
388
|
-
);
|
|
389
|
-
})
|
|
390
|
-
] }),
|
|
391
|
-
linkedRecords.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
392
|
-
/* @__PURE__ */ jsxRuntime.jsxs("h4", { className: "text-muted-foreground text-xs font-medium tracking-wide uppercase", children: [
|
|
393
|
-
"Already Linked (",
|
|
394
|
-
linkedRecords.length,
|
|
395
|
-
")"
|
|
396
|
-
] }),
|
|
397
|
-
linkedRecords.map((record) => {
|
|
398
|
-
const recordId = getRecordId(record);
|
|
399
|
-
const label = getRecordLabel(record);
|
|
400
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted/30 flex items-center space-x-3 rounded-md p-2", children: [
|
|
401
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(react.RiCheckLine, { className: "h-3 w-3 text-green-600" }) }),
|
|
402
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground flex-1 truncate text-sm", title: label, children: label })
|
|
403
|
-
] }, recordId);
|
|
404
|
-
})
|
|
405
|
-
] }),
|
|
406
|
-
filteredRecords.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-muted-foreground py-8 text-center", children: [
|
|
407
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.RiSearchLine, { className: "mx-auto mb-2 h-8 w-8 opacity-50" }),
|
|
408
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: searchQuery ? "No records match your search" : "No records available" })
|
|
409
|
-
] }),
|
|
410
|
-
filteredRecords.length > 0 && unlinkableRecords.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-muted-foreground py-4 text-center", children: [
|
|
411
|
-
/* @__PURE__ */ jsxRuntime.jsx(react.RiCheckLine, { className: "mx-auto mb-2 h-6 w-6 opacity-50" }),
|
|
412
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: "All matching records are already linked" })
|
|
413
|
-
] })
|
|
414
|
-
] }) })
|
|
415
|
-
] });
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
exports.RecordPicker = RecordPicker;
|
|
419
|
-
//# sourceMappingURL=record-picker.cjs.map
|
|
420
|
-
//# sourceMappingURL=record-picker.cjs.map
|
|
8
|
+
exports.RecordPicker = require_record_picker.RecordPicker;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/components/record-picker.d.ts
|
|
3
2
|
interface RecordPickerProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
records: any[];
|
|
4
|
+
linkedRecordIds: Set<string>;
|
|
5
|
+
onLink: (record: any) => void;
|
|
6
|
+
isLinking: boolean;
|
|
7
|
+
getRecordLabel: (record: any) => string;
|
|
8
|
+
getRecordId: (record: any) => string;
|
|
9
|
+
searchFields?: string[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
maxHeight?: string;
|
|
13
12
|
}
|
|
14
|
-
declare function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLabel, getRecordId, searchFields, placeholder, maxHeight
|
|
15
|
-
|
|
13
|
+
declare function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLabel, getRecordId, searchFields, placeholder, maxHeight }: RecordPickerProps): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
16
15
|
export { RecordPicker };
|
|
16
|
+
//# sourceMappingURL=record-picker.d.cts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/components/record-picker.d.ts
|
|
3
2
|
interface RecordPickerProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
records: any[];
|
|
4
|
+
linkedRecordIds: Set<string>;
|
|
5
|
+
onLink: (record: any) => void;
|
|
6
|
+
isLinking: boolean;
|
|
7
|
+
getRecordLabel: (record: any) => string;
|
|
8
|
+
getRecordId: (record: any) => string;
|
|
9
|
+
searchFields?: string[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
maxHeight?: string;
|
|
13
12
|
}
|
|
14
|
-
declare function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLabel, getRecordId, searchFields, placeholder, maxHeight
|
|
15
|
-
|
|
13
|
+
declare function RecordPicker({ records, linkedRecordIds, onLink, isLinking, getRecordLabel, getRecordId, searchFields, placeholder, maxHeight }: RecordPickerProps): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
16
15
|
export { RecordPicker };
|
|
16
|
+
//# sourceMappingURL=record-picker.d.ts.map
|