@constructive-io/ui 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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-CPy_fibW.cjs +608 -0
- package/dist/sidebar-CPy_fibW.cjs.map +1 -0
- package/dist/sidebar-Cfax0g0_.js +463 -0
- package/dist/sidebar-Cfax0g0_.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/input.js
CHANGED
|
@@ -1,60 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
import { Input as Input$1 } from '@base-ui/react/input';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
'use client';
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
3
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Input as Input$1 } from "@base-ui/react/input";
|
|
6
|
+
|
|
7
|
+
//#region src/components/input.tsx
|
|
10
8
|
function Input({ className, size = "default", unstyled = false, ...props }) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
className
|
|
35
|
-
) || void 0,
|
|
36
|
-
"data-size": size,
|
|
37
|
-
"data-slot": "input-control",
|
|
38
|
-
children: /* @__PURE__ */ jsx(
|
|
39
|
-
Input$1,
|
|
40
|
-
{
|
|
41
|
-
className: cn(
|
|
42
|
-
"w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none pointer-coarse:min-h-11",
|
|
43
|
-
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",
|
|
44
|
-
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"),
|
|
45
|
-
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"),
|
|
46
|
-
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",
|
|
47
|
-
props.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm"
|
|
48
|
-
),
|
|
49
|
-
"data-slot": "input",
|
|
50
|
-
size: typeof size === "number" ? size : void 0,
|
|
51
|
-
...props
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
);
|
|
9
|
+
const isFloating = props.placeholder === " ";
|
|
10
|
+
return /* @__PURE__ */ jsx("span", {
|
|
11
|
+
className: cn(!unstyled && [
|
|
12
|
+
"relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow",
|
|
13
|
+
"before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]",
|
|
14
|
+
"not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]",
|
|
15
|
+
"has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35",
|
|
16
|
+
"has-aria-invalid:border-destructive/36",
|
|
17
|
+
"has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16",
|
|
18
|
+
"has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none",
|
|
19
|
+
"sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border",
|
|
20
|
+
"dark:has-aria-invalid:ring-destructive/24",
|
|
21
|
+
"dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]"
|
|
22
|
+
], className) || void 0,
|
|
23
|
+
"data-size": size,
|
|
24
|
+
"data-slot": "input-control",
|
|
25
|
+
children: /* @__PURE__ */ jsx(Input$1, {
|
|
26
|
+
className: cn("w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none pointer-coarse:min-h-11", 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", 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"), 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"), 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", props.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm"),
|
|
27
|
+
"data-slot": "input",
|
|
28
|
+
size: typeof size === "number" ? size : void 0,
|
|
29
|
+
...props
|
|
30
|
+
})
|
|
31
|
+
});
|
|
56
32
|
}
|
|
57
33
|
|
|
34
|
+
//#endregion
|
|
58
35
|
export { Input };
|
|
59
|
-
//# sourceMappingURL=input.js.map
|
|
60
36
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"input.js","names":["InputPrimitive"],"sources":["../../src/components/input.tsx"],"sourcesContent":["'use client';\n\nimport { Input as InputPrimitive } from '@base-ui/react/input';\nimport type * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype InputProps = Omit<InputPrimitive.Props & React.RefAttributes<HTMLInputElement>, 'size'> & {\n\tsize?: 'sm' | 'default' | 'lg' | number;\n\tunstyled?: boolean;\n};\n\nfunction Input({ className, size = 'default', unstyled = false, ...props }: InputProps) {\n\tconst isFloating = props.placeholder === ' ';\n\n\treturn (\n\t\t<span\n\t\t\tclassName={\n\t\t\t\tcn(\n\t\t\t\t\t!unstyled && [\n\t\t\t\t\t\t// Base layout\n\t\t\t\t\t\t'relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow',\n\t\t\t\t\t\t// Inner shadow highlight\n\t\t\t\t\t\t'before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]',\n\t\t\t\t\t\t'not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]',\n\t\t\t\t\t\t// Focus state - use primary brand color\n\t\t\t\t\t\t'has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35',\n\t\t\t\t\t\t// Invalid state\n\t\t\t\t\t\t'has-aria-invalid:border-destructive/36',\n\t\t\t\t\t\t'has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16',\n\t\t\t\t\t\t// Disabled state\n\t\t\t\t\t\t'has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none',\n\t\t\t\t\t\t// Dark mode\n\t\t\t\t\t\t'sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border',\n\t\t\t\t\t\t'dark:has-aria-invalid:ring-destructive/24',\n\t\t\t\t\t\t'dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]',\n\t\t\t\t\t],\n\t\t\t\t\tclassName,\n\t\t\t\t) || undefined\n\t\t\t}\n\t\t\tdata-size={size}\n\t\t\tdata-slot=\"input-control\"\n\t\t>\n\t\t\t<InputPrimitive\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none pointer-coarse:min-h-11',\n\t\t\t\t\tisFloating\n\t\t\t\t\t\t? 'h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10'\n\t\t\t\t\t\t: 'h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5',\n\t\t\t\t\tsize === 'sm' &&\n\t\t\t\t\t\t(isFloating\n\t\t\t\t\t\t\t? 'h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9'\n\t\t\t\t\t\t\t: 'h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5'),\n\t\t\t\t\tsize === 'lg' &&\n\t\t\t\t\t\t(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'),\n\t\t\t\t\tprops.type === 'search' &&\n\t\t\t\t\t\t'[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none',\n\t\t\t\t\tprops.type === 'file' &&\n\t\t\t\t\t\t'text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm',\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"input\"\n\t\t\t\tsize={typeof size === 'number' ? size : undefined}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</span>\n\t);\n}\n\nexport { Input };\nexport type { InputProps };\n"],"mappings":";;;;;;;AAYA,SAAS,MAAM,EAAE,WAAW,OAAO,WAAW,WAAW,OAAO,GAAG,SAAqB;CACvF,MAAM,aAAa,MAAM,gBAAgB;CAEzC,OACC,oBAAC,QAAD;EACC,WACC,GACC,CAAC,YAAY;GAEZ;GAEA;GACA;GAEA;GAEA;GACA;GAEA;GAEA;GACA;GACA;EACD,GACA,SACD,KAAK;EAEN,aAAW;EACX,aAAU;YAEV,oBAACA,SAAD;GACC,WAAW,GACV,oHACA,aACG,uEACA,kFACH,SAAS,SACP,aACE,wDACA,4EACJ,SAAS,SACP,aAAa,6BAA6B,8CAC5C,MAAM,SAAS,YACd,8MACD,MAAM,SAAS,UACd,wGACF;GACA,aAAU;GACV,MAAM,OAAO,SAAS,WAAW,OAAO;GACxC,GAAI;EACJ;CACI;AAER"}
|
|
@@ -1,351 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
1
|
+
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_rolldown_runtime = require('../rolldown-runtime-D_qnwXdH.cjs');
|
|
5
|
+
const require_utils = require('../utils-CzTQ3-VI.cjs');
|
|
6
|
+
const require_components_button = require('./button.cjs');
|
|
7
|
+
const require_components_tooltip = require('./tooltip.cjs');
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let lucide_react = require("lucide-react");
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () { return e[k]; }
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
n.default = e;
|
|
28
|
-
return Object.freeze(n);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
32
|
-
|
|
33
|
-
function cn(...inputs) {
|
|
34
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
35
|
-
}
|
|
36
|
-
function composeRefs(...refs) {
|
|
37
|
-
return (node) => {
|
|
38
|
-
refs.forEach((ref) => {
|
|
39
|
-
if (typeof ref === "function") {
|
|
40
|
-
ref(node);
|
|
41
|
-
} else if (ref != null) {
|
|
42
|
-
ref.current = node;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function mergeProps(slotProps, childProps) {
|
|
48
|
-
const overrideProps = { ...childProps };
|
|
49
|
-
for (const propName in childProps) {
|
|
50
|
-
if (propName === "ref") continue;
|
|
51
|
-
const slotPropValue = slotProps[propName];
|
|
52
|
-
const childPropValue = childProps[propName];
|
|
53
|
-
if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
54
|
-
overrideProps[propName] = (...args) => {
|
|
55
|
-
childPropValue(...args);
|
|
56
|
-
slotPropValue(...args);
|
|
57
|
-
};
|
|
58
|
-
} else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
|
|
59
|
-
overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
|
|
60
|
-
} else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
|
|
61
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return { ...slotProps, ...overrideProps };
|
|
65
|
-
}
|
|
66
|
-
function isSlottable(child) {
|
|
67
|
-
return React__namespace.isValidElement(child);
|
|
68
|
-
}
|
|
69
|
-
var Slot = React__namespace.forwardRef((props, forwardedRef) => {
|
|
70
|
-
const { children, ...slotProps } = props;
|
|
71
|
-
if (isSlottable(children)) {
|
|
72
|
-
const childProps = children.props;
|
|
73
|
-
const childRef = childProps.ref;
|
|
74
|
-
return React__namespace.cloneElement(children, {
|
|
75
|
-
...mergeProps(slotProps, childProps),
|
|
76
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
if (React__namespace.Children.count(children) > 1) {
|
|
80
|
-
const childrenArray = React__namespace.Children.toArray(children);
|
|
81
|
-
const slottableChild = childrenArray.find(
|
|
82
|
-
(child) => React__namespace.isValidElement(child) && child.type === Slottable
|
|
83
|
-
);
|
|
84
|
-
if (slottableChild) {
|
|
85
|
-
const newElement = slottableChild.props.children;
|
|
86
|
-
if (isSlottable(newElement)) {
|
|
87
|
-
const newElementProps = newElement.props;
|
|
88
|
-
const newChildren = childrenArray.map((child) => {
|
|
89
|
-
if (child === slottableChild) {
|
|
90
|
-
return React__namespace.Children.count(newElementProps.children) > 1 ? React__namespace.Children.only(null) : newElementProps.children;
|
|
91
|
-
}
|
|
92
|
-
return child;
|
|
93
|
-
});
|
|
94
|
-
const childRef = newElementProps.ref;
|
|
95
|
-
return React__namespace.cloneElement(newElement, {
|
|
96
|
-
...mergeProps(slotProps, newElementProps),
|
|
97
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
|
|
98
|
-
children: newChildren
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
13
|
+
//#region src/components/json-input.tsx
|
|
14
|
+
const AceEditor = react.lazy(async () => {
|
|
15
|
+
const ace = await import("react-ace");
|
|
16
|
+
await import("ace-builds/src-noconflict/mode-json");
|
|
17
|
+
await import("ace-builds/src-noconflict/theme-textmate");
|
|
18
|
+
await import("ace-builds/src-noconflict/theme-cloud9_night");
|
|
19
|
+
return ace;
|
|
104
20
|
});
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
var buttonVariants = classVarianceAuthority.cva(
|
|
110
|
-
"[&_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",
|
|
111
|
-
{
|
|
112
|
-
defaultVariants: {
|
|
113
|
-
size: "default",
|
|
114
|
-
static: false,
|
|
115
|
-
variant: "default"
|
|
116
|
-
},
|
|
117
|
-
variants: {
|
|
118
|
-
static: {
|
|
119
|
-
false: "motion-safe:active:not-disabled:scale-[0.96]",
|
|
120
|
-
true: null
|
|
121
|
-
},
|
|
122
|
-
size: {
|
|
123
|
-
default: "h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
124
|
-
icon: "size-10 pointer-coarse:size-11",
|
|
125
|
-
"icon-lg": "size-11",
|
|
126
|
-
"icon-sm": "size-8 pointer-coarse:size-11",
|
|
127
|
-
"icon-xl": 'size-11 [&_svg:not([class*="size-"])]:size-5',
|
|
128
|
-
"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',
|
|
129
|
-
lg: "h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]",
|
|
130
|
-
sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
131
|
-
xl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*="size-"])]:size-5',
|
|
132
|
-
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'
|
|
133
|
-
},
|
|
134
|
-
variant: {
|
|
135
|
-
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",
|
|
136
|
-
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",
|
|
137
|
-
"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",
|
|
138
|
-
ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
|
|
139
|
-
link: "border-transparent underline-offset-4 hover:underline",
|
|
140
|
-
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",
|
|
141
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
var Button = React__namespace.forwardRef(
|
|
147
|
-
({ className, variant, size, static: isStatic, asChild, children, type = "button", ...props }, ref) => {
|
|
148
|
-
const buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));
|
|
149
|
-
const Comp = asChild ? Slot : "button";
|
|
150
|
-
if (asChild) {
|
|
151
|
-
const SlottedComp = Comp;
|
|
152
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
153
|
-
SlottedComp,
|
|
154
|
-
{
|
|
155
|
-
ref,
|
|
156
|
-
className: buttonClasses,
|
|
157
|
-
"data-slot": "button",
|
|
158
|
-
...props,
|
|
159
|
-
children
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
return /* @__PURE__ */ jsxRuntime.jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
|
|
164
|
-
}
|
|
165
|
-
);
|
|
166
|
-
Button.displayName = "Button";
|
|
167
|
-
function TooltipProvider({ delay = 0, delayDuration, ...props }) {
|
|
168
|
-
return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Provider, { "data-slot": "tooltip-provider", delay: delayDuration ?? delay, ...props });
|
|
169
|
-
}
|
|
170
|
-
function Tooltip({ delayDuration: _delayDuration, ...props }) {
|
|
171
|
-
return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Root, { "data-slot": "tooltip", ...props });
|
|
172
|
-
}
|
|
173
|
-
function TooltipTrigger({ delay = 0, asChild, children, render, ...props }) {
|
|
174
|
-
const childRender = render === void 0 && asChild && React__namespace.isValidElement(children) ? children : void 0;
|
|
175
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
-
tooltip.Tooltip.Trigger,
|
|
177
|
-
{
|
|
178
|
-
"data-slot": "tooltip-trigger",
|
|
179
|
-
delay,
|
|
180
|
-
render: render ?? childRender,
|
|
181
|
-
...props,
|
|
182
|
-
children: childRender ? void 0 : children
|
|
183
|
-
}
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
function TooltipContent({
|
|
187
|
-
className,
|
|
188
|
-
sideOffset = 4,
|
|
189
|
-
showArrow = false,
|
|
190
|
-
side = "top",
|
|
191
|
-
align = "center",
|
|
192
|
-
children,
|
|
193
|
-
...props
|
|
194
|
-
}) {
|
|
195
|
-
const { container, zIndexClass } = portal.useFloatingOverlayPortalProps();
|
|
196
|
-
return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Positioner, { side, align, sideOffset, className: zIndexClass, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
197
|
-
tooltip.Tooltip.Popup,
|
|
198
|
-
{
|
|
199
|
-
"data-slot": "tooltip-content",
|
|
200
|
-
className: cn(
|
|
201
|
-
`bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1
|
|
202
|
-
text-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
|
|
203
|
-
data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
|
|
204
|
-
data-[side=bottom]:data-starting-style:-translate-y-2
|
|
205
|
-
data-[side=left]:data-starting-style:translate-x-2
|
|
206
|
-
data-[side=right]:data-starting-style:-translate-x-2
|
|
207
|
-
data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
|
|
208
|
-
className
|
|
209
|
-
),
|
|
210
|
-
...props,
|
|
211
|
-
role: "tooltip",
|
|
212
|
-
children: [
|
|
213
|
-
children,
|
|
214
|
-
showArrow && /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })
|
|
215
|
-
]
|
|
216
|
-
}
|
|
217
|
-
) }) });
|
|
218
|
-
}
|
|
219
|
-
var AceEditor = React__namespace.lazy(async () => {
|
|
220
|
-
const ace = await import('react-ace');
|
|
221
|
-
await import('ace-builds/src-noconflict/mode-json');
|
|
222
|
-
await import('ace-builds/src-noconflict/theme-textmate');
|
|
223
|
-
await import('ace-builds/src-noconflict/theme-cloud9_night');
|
|
224
|
-
return ace;
|
|
21
|
+
const EditorLoading = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22
|
+
className: "flex h-32 items-center justify-center",
|
|
23
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "h-6 w-6 animate-spin" })
|
|
225
24
|
});
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
};
|
|
246
|
-
return jsonStateMap[jsonState.state];
|
|
25
|
+
const displayJsonState = (jsonState) => {
|
|
26
|
+
return {
|
|
27
|
+
loading: {
|
|
28
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "text-muted-foreground size-[18px] animate-spin" }),
|
|
29
|
+
text: "Checking JSON Format...",
|
|
30
|
+
className: "text-muted-foreground"
|
|
31
|
+
},
|
|
32
|
+
success: {
|
|
33
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckCircle2, { className: "size-[18px] text-green-600" }),
|
|
34
|
+
text: "Valid JSON Format",
|
|
35
|
+
className: "text-foreground"
|
|
36
|
+
},
|
|
37
|
+
error: {
|
|
38
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleAlert, { className: "text-destructive size-[18px]" }),
|
|
39
|
+
text: jsonState.errMsg || "Invalid JSON Format",
|
|
40
|
+
className: "text-destructive"
|
|
41
|
+
},
|
|
42
|
+
empty: {}
|
|
43
|
+
}[jsonState.state];
|
|
247
44
|
};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
45
|
+
const JsonInput = ({ value = "", setValue, minLines = 16, className, theme = "light" }) => {
|
|
46
|
+
const [jsonState, setJsonState] = (0, react.useState)({ state: "empty" });
|
|
47
|
+
const handleChange = (val) => {
|
|
48
|
+
setJsonState({ state: "loading" });
|
|
49
|
+
setValue(val);
|
|
50
|
+
};
|
|
51
|
+
(0, react.useEffect)(() => {
|
|
52
|
+
const timeoutId = setTimeout(() => {
|
|
53
|
+
const error = validateJson(value);
|
|
54
|
+
if (value.trim().length === 0) setJsonState({ state: "empty" });
|
|
55
|
+
else if (error) setJsonState({
|
|
56
|
+
state: "error",
|
|
57
|
+
errMsg: error
|
|
58
|
+
});
|
|
59
|
+
else setJsonState({ state: "success" });
|
|
60
|
+
}, 400);
|
|
61
|
+
return () => clearTimeout(timeoutId);
|
|
62
|
+
}, [value]);
|
|
63
|
+
const { icon, text, className: textClassName } = displayJsonState(jsonState);
|
|
64
|
+
const isValidJson = validateJson(value) === null;
|
|
65
|
+
const lines = (0, react.useMemo)(() => {
|
|
66
|
+
return Math.max(countJsonLines(value), minLines);
|
|
67
|
+
}, [value, minLines]);
|
|
68
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
69
|
+
className: require_utils.cn("border-border/60 relative overflow-y-auto rounded-md border p-2.5", className),
|
|
70
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(JsonEditor, {
|
|
71
|
+
value,
|
|
72
|
+
setValue: handleChange,
|
|
73
|
+
lines,
|
|
74
|
+
theme
|
|
75
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_tooltip.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipTrigger, {
|
|
76
|
+
asChild: true,
|
|
77
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_button.Button, {
|
|
78
|
+
className: "absolute top-2 right-2 size-8 rounded-xl",
|
|
79
|
+
size: "icon",
|
|
80
|
+
variant: "outline",
|
|
81
|
+
type: "button",
|
|
82
|
+
disabled: !isValidJson,
|
|
83
|
+
onClick: () => setValue(prettifyJson(value)),
|
|
84
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.WandSparkles, { className: "text-muted-foreground size-4" })
|
|
85
|
+
})
|
|
86
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipContent, { children: "Format JSON" })] }) })]
|
|
87
|
+
}), jsonState.state !== "empty" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
88
|
+
className: "mt-2 flex items-center gap-2",
|
|
89
|
+
children: [icon, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
90
|
+
className: require_utils.cn("text-sm", textClassName),
|
|
91
|
+
children: text
|
|
92
|
+
})]
|
|
93
|
+
})] });
|
|
292
94
|
};
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
maxLines: lines,
|
|
323
|
-
highlightActiveLine: !readOnly,
|
|
324
|
-
value,
|
|
325
|
-
onChange: setValue
|
|
326
|
-
};
|
|
327
|
-
return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(EditorLoading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(AceEditor, { ...editorProps }) });
|
|
95
|
+
const JsonEditor = ({ value, setValue, lines, readOnly = false, isValid = true, enableFolding = false, theme = "light" }) => {
|
|
96
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
|
|
97
|
+
fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditorLoading, {}),
|
|
98
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AceEditor, {
|
|
99
|
+
mode: "json",
|
|
100
|
+
theme: theme === "light" ? "textmate" : "cloud9_night",
|
|
101
|
+
fontSize: "14px",
|
|
102
|
+
readOnly,
|
|
103
|
+
style: {
|
|
104
|
+
width: "100%",
|
|
105
|
+
background: "transparent",
|
|
106
|
+
offset: 0
|
|
107
|
+
},
|
|
108
|
+
setOptions: {
|
|
109
|
+
useWorker: false,
|
|
110
|
+
printMargin: false,
|
|
111
|
+
showFoldWidgets: enableFolding,
|
|
112
|
+
foldStyle: "markbegin"
|
|
113
|
+
},
|
|
114
|
+
tabSize: 2,
|
|
115
|
+
wrapEnabled: readOnly && !isValid,
|
|
116
|
+
showGutter: enableFolding,
|
|
117
|
+
minLines: lines,
|
|
118
|
+
maxLines: lines,
|
|
119
|
+
highlightActiveLine: !readOnly,
|
|
120
|
+
value,
|
|
121
|
+
onChange: setValue
|
|
122
|
+
})
|
|
123
|
+
});
|
|
328
124
|
};
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
125
|
+
const validateJson = (text) => {
|
|
126
|
+
try {
|
|
127
|
+
if (text.trim().length === 0) throw new SyntaxError(`Can't use empty string`);
|
|
128
|
+
JSON.parse(text);
|
|
129
|
+
return null;
|
|
130
|
+
} catch (error) {
|
|
131
|
+
return error.message;
|
|
132
|
+
}
|
|
337
133
|
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
134
|
+
const prettifyJson = (text) => {
|
|
135
|
+
try {
|
|
136
|
+
return JSON.stringify(JSON.parse(text), null, 2);
|
|
137
|
+
} catch {
|
|
138
|
+
return text;
|
|
139
|
+
}
|
|
344
140
|
};
|
|
345
|
-
|
|
141
|
+
const countJsonLines = (text) => text.split(/\n/).length;
|
|
346
142
|
|
|
143
|
+
//#endregion
|
|
347
144
|
exports.JsonEditor = JsonEditor;
|
|
348
145
|
exports.JsonInput = JsonInput;
|
|
349
146
|
exports.validateJson = validateJson;
|
|
350
|
-
//# sourceMappingURL=json-input.cjs.map
|
|
351
147
|
//# sourceMappingURL=json-input.cjs.map
|