@constructive-io/ui 0.11.0 → 0.13.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/README.md +1 -1
- package/dist/{ai-CiaH2sfF.js → ai-B7XNnqYL.js} +1674 -228
- package/dist/ai-B7XNnqYL.js.map +1 -0
- package/dist/{ai-lAkichk8.cjs → ai-DJ-YPj8c.cjs} +1768 -226
- package/dist/ai-DJ-YPj8c.cjs.map +1 -0
- package/dist/{alert-BXuP0ayz.d.ts → alert-CJ4Qyk6W.d.cts} +4 -2
- package/dist/{alert-BXuP0ayz.d.cts → alert-CJ4Qyk6W.d.ts} +4 -2
- package/dist/components/accordion.cjs +60 -0
- package/dist/components/accordion.cjs.map +1 -0
- package/dist/components/accordion.d.cts +14 -0
- package/dist/components/accordion.d.ts +14 -0
- package/dist/components/accordion.js +54 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/ai/index.cjs +17 -1
- package/dist/components/ai/index.d.cts +2 -2
- package/dist/components/ai/index.d.ts +2 -2
- package/dist/components/ai/index.js +2 -2
- package/dist/components/alert-dialog.cjs +17 -8
- package/dist/components/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog.d.cts +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +17 -8
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +18 -8
- package/dist/components/alert.cjs.map +1 -1
- package/dist/components/alert.d.cts +2 -2
- package/dist/components/alert.d.ts +2 -2
- package/dist/components/alert.js +18 -9
- package/dist/components/alert.js.map +1 -1
- package/dist/components/autocomplete.cjs +9 -5
- package/dist/components/autocomplete.cjs.map +1 -1
- package/dist/components/autocomplete.js +9 -5
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +9 -3
- package/dist/components/avatar.cjs.map +1 -1
- package/dist/components/avatar.d.cts +6 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.js +9 -3
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +25 -18
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.js +25 -18
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +9 -6
- package/dist/components/breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb.js +9 -6
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.cjs +57 -0
- package/dist/components/button-group.cjs.map +1 -0
- package/dist/components/button-group.d.cts +16 -0
- package/dist/components/button-group.d.ts +16 -0
- package/dist/components/button-group.js +51 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.cjs +59 -15
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +32 -2
- package/dist/components/button.d.ts +32 -2
- package/dist/components/button.js +59 -15
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +14 -8
- package/dist/components/calendar-rac.cjs.map +1 -1
- package/dist/components/calendar-rac.js +14 -8
- package/dist/components/calendar-rac.js.map +1 -1
- package/dist/components/card.cjs +35 -23
- package/dist/components/card.cjs.map +1 -1
- package/dist/components/card.d.cts +3 -2
- package/dist/components/card.d.ts +3 -2
- package/dist/components/card.js +35 -23
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.cjs +5 -5
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +5 -5
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +3 -3
- package/dist/components/collapsible.cjs.map +1 -1
- package/dist/components/collapsible.js +3 -3
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +24 -12
- package/dist/components/combobox.cjs.map +1 -1
- package/dist/components/combobox.d.cts +2 -1
- package/dist/components/combobox.d.ts +2 -1
- package/dist/components/combobox.js +24 -12
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +25 -14
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.d.cts +6 -2
- package/dist/components/command.d.ts +6 -2
- package/dist/components/command.js +25 -14
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +22 -12
- package/dist/components/dialog.cjs.map +1 -1
- package/dist/components/dialog.d.cts +5 -2
- package/dist/components/dialog.d.ts +5 -2
- package/dist/components/dialog.js +22 -12
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +50 -27
- package/dist/components/dock.cjs.map +1 -1
- package/dist/components/dock.d.cts +1 -1
- package/dist/components/dock.d.ts +1 -1
- package/dist/components/dock.js +51 -28
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +22 -14
- package/dist/components/drawer.cjs.map +1 -1
- package/dist/components/drawer.js +22 -14
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +34 -28
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.d.cts +2 -2
- package/dist/components/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu.js +52 -46
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +4 -4
- package/dist/components/empty.cjs.map +1 -1
- package/dist/components/empty.js +4 -4
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.cjs +33 -33
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.d.cts +1 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/field.js +34 -34
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +1 -1
- package/dist/components/flickering-grid.cjs.map +1 -1
- package/dist/components/flickering-grid.js +1 -1
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +10 -5
- package/dist/components/flow-zoom-panel.cjs.map +1 -1
- package/dist/components/flow-zoom-panel.d.cts +8 -1
- package/dist/components/flow-zoom-panel.d.ts +8 -1
- package/dist/components/flow-zoom-panel.js +10 -5
- package/dist/components/flow-zoom-panel.js.map +1 -1
- package/dist/components/form-control.cjs +12 -8
- package/dist/components/form-control.cjs.map +1 -1
- package/dist/components/form-control.js +12 -8
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +5 -5
- package/dist/components/form.cjs.map +1 -1
- package/dist/components/form.js +5 -5
- package/dist/components/form.js.map +1 -1
- package/dist/components/input-group.cjs +13 -7
- package/dist/components/input-group.cjs.map +1 -1
- package/dist/components/input-group.d.cts +2 -2
- package/dist/components/input-group.d.ts +2 -2
- package/dist/components/input-group.js +11 -7
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.cjs +252 -0
- package/dist/components/input-otp.cjs.map +1 -0
- package/dist/components/input-otp.d.cts +44 -0
- package/dist/components/input-otp.d.ts +44 -0
- package/dist/components/input-otp.js +251 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.cjs +10 -4
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.d.cts +11 -2
- package/dist/components/input.d.ts +11 -2
- package/dist/components/input.js +10 -4
- package/dist/components/input.js.map +1 -1
- package/dist/components/item.cjs +151 -0
- package/dist/components/item.cjs.map +1 -0
- package/dist/components/item.d.cts +37 -0
- package/dist/components/item.d.ts +37 -0
- package/dist/components/item.js +137 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/json-input.cjs +4 -143
- package/dist/components/json-input.d.cts +6 -4
- package/dist/components/json-input.d.ts +6 -4
- package/dist/components/json-input.js +2 -140
- package/dist/components/kbd.cjs +35 -0
- package/dist/components/kbd.cjs.map +1 -0
- package/dist/components/kbd.d.cts +16 -0
- package/dist/components/kbd.d.ts +16 -0
- package/dist/components/kbd.js +31 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.cjs +3 -3
- package/dist/components/label.cjs.map +1 -1
- package/dist/components/label.js +3 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/motion-grid.cjs +20 -8
- package/dist/components/motion-grid.cjs.map +1 -1
- package/dist/components/motion-grid.js +20 -8
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +77 -67
- package/dist/components/multi-select.cjs.map +1 -1
- package/dist/components/multi-select.js +77 -67
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +12 -9
- package/dist/components/page-header.cjs.map +1 -1
- package/dist/components/page-header.js +12 -9
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.cjs +10 -4
- package/dist/components/pagination.cjs.map +1 -1
- package/dist/components/pagination.d.cts +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +10 -4
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/phone-input.cjs +228 -0
- package/dist/components/phone-input.cjs.map +1 -0
- package/dist/components/phone-input.d.cts +42 -0
- package/dist/components/phone-input.d.ts +42 -0
- package/dist/components/phone-input.js +220 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/popover.cjs +5 -4
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.js +5 -4
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.cjs +20 -3
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.d.cts +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +20 -3
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +2 -2
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
- package/dist/components/progressive-blur-scroll-container.d.cts +1 -1
- package/dist/components/progressive-blur-scroll-container.d.ts +1 -1
- package/dist/components/progressive-blur-scroll-container.js +2 -2
- package/dist/components/progressive-blur-scroll-container.js.map +1 -1
- package/dist/components/progressive-blur.cjs +3 -2
- package/dist/components/progressive-blur.cjs.map +1 -1
- package/dist/components/progressive-blur.js +3 -2
- package/dist/components/progressive-blur.js.map +1 -1
- package/dist/components/radio-group.cjs +2 -2
- package/dist/components/radio-group.cjs.map +1 -1
- package/dist/components/radio-group.js +2 -2
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +1 -1
- package/dist/components/record-picker.js +1 -1
- package/dist/components/resizable.cjs +2 -2
- package/dist/components/resizable.cjs.map +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/responsive-diagram.cjs +43 -21
- package/dist/components/responsive-diagram.cjs.map +1 -1
- package/dist/components/responsive-diagram.d.cts +7 -1
- package/dist/components/responsive-diagram.d.ts +7 -1
- package/dist/components/responsive-diagram.js +43 -21
- package/dist/components/responsive-diagram.js.map +1 -1
- package/dist/components/scroll-area.cjs +2 -2
- package/dist/components/scroll-area.cjs.map +1 -1
- package/dist/components/scroll-area.js +2 -2
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.cjs +84 -20
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.d.cts +12 -7
- package/dist/components/select.d.ts +12 -7
- package/dist/components/select.js +84 -20
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.cjs.map +1 -1
- package/dist/components/separator.d.cts +11 -2
- package/dist/components/separator.d.ts +11 -2
- package/dist/components/separator.js +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.cjs +1 -1
- package/dist/components/sheet.d.cts +11 -5
- package/dist/components/sheet.d.ts +12 -6
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.cjs +2 -1
- package/dist/components/sidebar.d.cts +7 -6
- package/dist/components/sidebar.d.ts +7 -6
- package/dist/components/sidebar.js +2 -1
- package/dist/components/slider.cjs +47 -0
- package/dist/components/slider.cjs.map +1 -0
- package/dist/components/slider.d.cts +8 -0
- package/dist/components/slider.d.ts +8 -0
- package/dist/components/slider.js +44 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.cjs +15 -4
- package/dist/components/sonner.cjs.map +1 -1
- package/dist/components/sonner.d.cts +10 -1
- package/dist/components/sonner.d.ts +10 -1
- package/dist/components/sonner.js +16 -5
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.cjs +25 -0
- package/dist/components/spinner.cjs.map +1 -0
- package/dist/components/spinner.d.cts +16 -0
- package/dist/components/spinner.d.ts +16 -0
- package/dist/components/spinner.js +22 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stack/index.cjs +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/stepper.cjs +23 -17
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.d.cts +2 -2
- package/dist/components/stepper.d.ts +2 -2
- package/dist/components/stepper.js +23 -17
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +5 -5
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.js +5 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +26 -7
- package/dist/components/table.cjs.map +1 -1
- package/dist/components/table.d.cts +20 -2
- package/dist/components/table.d.ts +20 -2
- package/dist/components/table.js +26 -8
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +61 -8
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.d.cts +13 -2
- package/dist/components/tabs.d.ts +13 -2
- package/dist/components/tabs.js +63 -11
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +10 -5
- package/dist/components/tags.cjs.map +1 -1
- package/dist/components/tags.d.cts +1 -1
- package/dist/components/tags.d.ts +1 -1
- package/dist/components/tags.js +10 -5
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +5 -4
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.js +5 -4
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast/index.cjs +1 -1
- package/dist/components/toast/index.d.cts +2 -2
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toggle-group.cjs +69 -0
- package/dist/components/toggle-group.cjs.map +1 -0
- package/dist/components/toggle-group.d.cts +27 -0
- package/dist/components/toggle-group.d.ts +27 -0
- package/dist/components/toggle-group.js +65 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.cjs +54 -0
- package/dist/components/toggle.cjs.map +1 -0
- package/dist/components/toggle.d.cts +13 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.js +50 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.cjs +18 -6
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.d.cts +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +18 -6
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +2 -2
- package/dist/components/unlink-button.cjs.map +1 -1
- package/dist/components/unlink-button.d.cts +1 -0
- package/dist/components/unlink-button.d.ts +1 -0
- package/dist/components/unlink-button.js +2 -2
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/components/workspace-kit/index.cjs +1477 -0
- package/dist/components/workspace-kit/index.cjs.map +1 -0
- package/dist/components/workspace-kit/index.d.cts +716 -0
- package/dist/components/workspace-kit/index.d.ts +716 -0
- package/dist/components/workspace-kit/index.js +1410 -0
- package/dist/components/workspace-kit/index.js.map +1 -0
- package/dist/compose-refs-Mbma1O3M.js +47 -0
- package/dist/compose-refs-Mbma1O3M.js.map +1 -0
- package/dist/compose-refs-uPrvNoiU.cjs +52 -0
- package/dist/compose-refs-uPrvNoiU.cjs.map +1 -0
- package/dist/fluid-highlight-AW-OITqJ.cjs +124 -0
- package/dist/fluid-highlight-AW-OITqJ.cjs.map +1 -0
- package/dist/fluid-highlight-DxWeZ7iu.js +119 -0
- package/dist/fluid-highlight-DxWeZ7iu.js.map +1 -0
- package/dist/{index-UnM04j0t.d.ts → index-BQZxmMpw.d.cts} +11 -31
- package/dist/{index-UnM04j0t.d.cts → index-BQZxmMpw.d.ts} +11 -31
- package/dist/{index-CyaFaZe2.d.cts → index-CiO-3M_X.d.cts} +334 -18
- package/dist/{index-B0wXxIAb.d.ts → index-z3LqQ5L5.d.ts} +334 -18
- package/dist/index.cjs +107 -17
- package/dist/index.d.cts +63 -13
- package/dist/index.d.ts +63 -13
- package/dist/index.js +27 -14
- package/dist/initial-focus-B8RLtyOZ.cjs +67 -0
- package/dist/initial-focus-B8RLtyOZ.cjs.map +1 -0
- package/dist/initial-focus-j2E0EnIx.js +61 -0
- package/dist/initial-focus-j2E0EnIx.js.map +1 -0
- package/dist/initials-DSkWTOb0.cjs +127 -0
- package/dist/initials-DSkWTOb0.cjs.map +1 -0
- package/dist/initials-kCcHgrSy.js +97 -0
- package/dist/initials-kCcHgrSy.js.map +1 -0
- package/dist/json-input-CH5aEmoA.js +293 -0
- package/dist/json-input-CH5aEmoA.js.map +1 -0
- package/dist/json-input-D8yM578l.cjs +311 -0
- package/dist/json-input-D8yM578l.cjs.map +1 -0
- package/dist/{motion-config-COCFHq1L.cjs → motion-config-DZ7w5Uhq.cjs} +32 -2
- package/dist/motion-config-DZ7w5Uhq.cjs.map +1 -0
- package/dist/{motion-config-COsZ6azM.js → motion-config-DoFp4I8f.js} +21 -3
- package/dist/motion-config-DoFp4I8f.js.map +1 -0
- package/dist/{record-picker-Bz4FApxD.cjs → record-picker-BQ1-Vx0g.cjs} +23 -8
- package/dist/record-picker-BQ1-Vx0g.cjs.map +1 -0
- package/dist/{record-picker-BbxngCeV.js → record-picker-DSRo4RXV.js} +23 -8
- package/dist/record-picker-DSRo4RXV.js.map +1 -0
- package/dist/{sheet-BdA0rfIz.cjs → sheet-OxWlnT_G.cjs} +25 -32
- package/dist/sheet-OxWlnT_G.cjs.map +1 -0
- package/dist/{sheet-BLHnhLRH.js → sheet-wPF_l9Cn.js} +25 -32
- package/dist/sheet-wPF_l9Cn.js.map +1 -0
- package/dist/{sidebar-BavjjJp0.cjs → sidebar-BEEWmJwC.cjs} +74 -57
- package/dist/sidebar-BEEWmJwC.cjs.map +1 -0
- package/dist/{sidebar-DeoL2ttp.js → sidebar-DWl1Azyv.js} +74 -57
- package/dist/sidebar-DWl1Azyv.js.map +1 -0
- package/dist/{stack-ci2lkfkr.cjs → stack-CEvmUSwF.cjs} +12 -10
- package/dist/stack-CEvmUSwF.cjs.map +1 -0
- package/dist/{stack-C9GROTGA.js → stack-Kqu7YaR0.js} +12 -10
- package/dist/stack-Kqu7YaR0.js.map +1 -0
- package/dist/text-runs-CdmlS5C7.cjs +52 -0
- package/dist/text-runs-CdmlS5C7.cjs.map +1 -0
- package/dist/text-runs-DqcEO8L_.js +45 -0
- package/dist/text-runs-DqcEO8L_.js.map +1 -0
- package/dist/theme-DTTTlylA.d.cts +520 -0
- package/dist/theme-DTTTlylA.d.ts +520 -0
- package/dist/theme-dials-config.cjs +273 -0
- package/dist/theme-dials-config.cjs.map +1 -0
- package/dist/theme-dials-config.d.cts +95 -0
- package/dist/theme-dials-config.d.ts +95 -0
- package/dist/theme-dials-config.js +269 -0
- package/dist/theme-dials-config.js.map +1 -0
- package/dist/theme-presets.cjs +922 -0
- package/dist/theme-presets.cjs.map +1 -0
- package/dist/theme-presets.d.cts +89 -0
- package/dist/theme-presets.d.ts +89 -0
- package/dist/theme-presets.js +912 -0
- package/dist/theme-presets.js.map +1 -0
- package/dist/theme-tuning-DjgDvV8V.d.ts +158 -0
- package/dist/theme-tuning-TJ76tnxZ.d.cts +158 -0
- package/dist/theme-tuning.cjs +349 -0
- package/dist/theme-tuning.cjs.map +1 -0
- package/dist/theme-tuning.d.cts +2 -0
- package/dist/theme-tuning.d.ts +2 -0
- package/dist/theme-tuning.js +333 -0
- package/dist/theme-tuning.js.map +1 -0
- package/dist/theme.cjs +432 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +2 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +430 -0
- package/dist/theme.js.map +1 -0
- package/dist/toast-08jF1DBQ.cjs +193 -0
- package/dist/toast-08jF1DBQ.cjs.map +1 -0
- package/dist/toast-CVW5XY4u.js +164 -0
- package/dist/toast-CVW5XY4u.js.map +1 -0
- package/dist/toast-details-BdxxSLlN.cjs +209 -0
- package/dist/toast-details-BdxxSLlN.cjs.map +1 -0
- package/dist/toast-details-CfsB1Vxb.js +198 -0
- package/dist/toast-details-CfsB1Vxb.js.map +1 -0
- package/dist/{tooltip-CTRQoN1A.d.ts → tooltip-Fqb4JK-g.d.cts} +2 -2
- package/dist/{tooltip-CTRQoN1A.d.cts → tooltip-Fqb4JK-g.d.ts} +2 -2
- package/dist/tuning-BKVFsxLr.js +48 -0
- package/dist/tuning-BKVFsxLr.js.map +1 -0
- package/dist/tuning-BRPG7U1U.cjs +71 -0
- package/dist/tuning-BRPG7U1U.cjs.map +1 -0
- package/dist/use-document-theme-BSEuNsEE.cjs +43 -0
- package/dist/use-document-theme-BSEuNsEE.cjs.map +1 -0
- package/dist/use-document-theme-Ch_PqxZz.js +38 -0
- package/dist/use-document-theme-Ch_PqxZz.js.map +1 -0
- package/dist/use-scroll-fade-CaHp52u4.cjs +79 -0
- package/dist/use-scroll-fade-CaHp52u4.cjs.map +1 -0
- package/dist/use-scroll-fade-ilq-o00-.js +72 -0
- package/dist/use-scroll-fade-ilq-o00-.js.map +1 -0
- package/package.json +163 -27
- package/src/styles/globals.css +176 -97
- package/dist/ai-CiaH2sfF.js.map +0 -1
- package/dist/ai-lAkichk8.cjs.map +0 -1
- package/dist/button-DBRYW_AI.d.cts +0 -20
- package/dist/button-DBRYW_AI.d.ts +0 -20
- package/dist/components/app-bar.cjs +0 -81
- package/dist/components/app-bar.cjs.map +0 -1
- package/dist/components/app-bar.d.cts +0 -27
- package/dist/components/app-bar.d.ts +0 -27
- package/dist/components/app-bar.js +0 -77
- package/dist/components/app-bar.js.map +0 -1
- package/dist/components/app-shell.cjs +0 -267
- package/dist/components/app-shell.cjs.map +0 -1
- package/dist/components/app-shell.d.cts +0 -98
- package/dist/components/app-shell.d.ts +0 -98
- package/dist/components/app-shell.js +0 -264
- package/dist/components/app-shell.js.map +0 -1
- package/dist/components/json-input.cjs.map +0 -1
- package/dist/components/json-input.js.map +0 -1
- package/dist/input-CBrCuMH8.d.cts +0 -11
- package/dist/input-CBrCuMH8.d.ts +0 -11
- package/dist/motion-config-COCFHq1L.cjs.map +0 -1
- package/dist/motion-config-COsZ6azM.js.map +0 -1
- package/dist/record-picker-BbxngCeV.js.map +0 -1
- package/dist/record-picker-Bz4FApxD.cjs.map +0 -1
- package/dist/separator-BQEsr0Rc.d.cts +0 -11
- package/dist/separator-BQEsr0Rc.d.ts +0 -11
- package/dist/sheet-BLHnhLRH.js.map +0 -1
- package/dist/sheet-BdA0rfIz.cjs.map +0 -1
- package/dist/sidebar-BavjjJp0.cjs.map +0 -1
- package/dist/sidebar-DeoL2ttp.js.map +0 -1
- package/dist/stack-C9GROTGA.js.map +0 -1
- package/dist/stack-ci2lkfkr.cjs.map +0 -1
- package/dist/toast-D6MqijT2.cjs +0 -316
- package/dist/toast-D6MqijT2.cjs.map +0 -1
- package/dist/toast-D_BOLzm3.js +0 -287
- package/dist/toast-D_BOLzm3.js.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Separator } from "./separator.cjs";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/components/item.d.ts
|
|
5
|
+
type ItemGroupProps = React$1.ComponentProps<'div'>;
|
|
6
|
+
declare function ItemGroup({ className, ...props }: ItemGroupProps): React$1.JSX.Element;
|
|
7
|
+
type ItemSeparatorProps = React$1.ComponentProps<typeof Separator>;
|
|
8
|
+
declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): React$1.JSX.Element;
|
|
9
|
+
declare const itemVariants: (props?: ({
|
|
10
|
+
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
11
|
+
size?: "default" | "sm" | "xs" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
interface ItemProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemVariants> {
|
|
14
|
+
/** When true, merges props onto the child element instead of rendering a div. */
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const Item: React$1.ForwardRefExoticComponent<ItemProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const itemMediaVariants: (props?: ({
|
|
19
|
+
variant?: "default" | "icon" | "image" | null | undefined;
|
|
20
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
|
+
interface ItemMediaProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemMediaVariants> {}
|
|
22
|
+
declare function ItemMedia({ className, variant, ...props }: ItemMediaProps): React$1.JSX.Element;
|
|
23
|
+
type ItemContentProps = React$1.ComponentProps<'div'>;
|
|
24
|
+
declare function ItemContent({ className, ...props }: ItemContentProps): React$1.JSX.Element;
|
|
25
|
+
type ItemTitleProps = React$1.ComponentProps<'div'>;
|
|
26
|
+
declare function ItemTitle({ className, children, ...props }: ItemTitleProps): React$1.JSX.Element;
|
|
27
|
+
type ItemDescriptionProps = React$1.ComponentProps<'p'>;
|
|
28
|
+
declare function ItemDescription({ className, children, ...props }: ItemDescriptionProps): React$1.JSX.Element;
|
|
29
|
+
type ItemActionsProps = React$1.ComponentProps<'div'>;
|
|
30
|
+
declare function ItemActions({ className, ...props }: ItemActionsProps): React$1.JSX.Element;
|
|
31
|
+
type ItemHeaderProps = React$1.ComponentProps<'div'>;
|
|
32
|
+
declare function ItemHeader({ className, ...props }: ItemHeaderProps): React$1.JSX.Element;
|
|
33
|
+
type ItemFooterProps = React$1.ComponentProps<'div'>;
|
|
34
|
+
declare function ItemFooter({ className, ...props }: ItemFooterProps): React$1.JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Item, ItemActions, type ItemActionsProps, ItemContent, type ItemContentProps, ItemDescription, type ItemDescriptionProps, ItemFooter, type ItemFooterProps, ItemGroup, type ItemGroupProps, ItemHeader, type ItemHeaderProps, ItemMedia, type ItemMediaProps, type ItemProps, ItemSeparator, type ItemSeparatorProps, ItemTitle, type ItemTitleProps, itemMediaVariants, itemVariants };
|
|
37
|
+
//# sourceMappingURL=item.d.cts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Separator } from "./separator.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
//#region src/components/item.d.ts
|
|
5
|
+
type ItemGroupProps = React$1.ComponentProps<'div'>;
|
|
6
|
+
declare function ItemGroup({ className, ...props }: ItemGroupProps): React$1.JSX.Element;
|
|
7
|
+
type ItemSeparatorProps = React$1.ComponentProps<typeof Separator>;
|
|
8
|
+
declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): React$1.JSX.Element;
|
|
9
|
+
declare const itemVariants: (props?: ({
|
|
10
|
+
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
11
|
+
size?: "default" | "sm" | "xs" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
interface ItemProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemVariants> {
|
|
14
|
+
/** When true, merges props onto the child element instead of rendering a div. */
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const Item: React$1.ForwardRefExoticComponent<ItemProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const itemMediaVariants: (props?: ({
|
|
19
|
+
variant?: "default" | "icon" | "image" | null | undefined;
|
|
20
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
|
+
interface ItemMediaProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof itemMediaVariants> {}
|
|
22
|
+
declare function ItemMedia({ className, variant, ...props }: ItemMediaProps): React$1.JSX.Element;
|
|
23
|
+
type ItemContentProps = React$1.ComponentProps<'div'>;
|
|
24
|
+
declare function ItemContent({ className, ...props }: ItemContentProps): React$1.JSX.Element;
|
|
25
|
+
type ItemTitleProps = React$1.ComponentProps<'div'>;
|
|
26
|
+
declare function ItemTitle({ className, children, ...props }: ItemTitleProps): React$1.JSX.Element;
|
|
27
|
+
type ItemDescriptionProps = React$1.ComponentProps<'p'>;
|
|
28
|
+
declare function ItemDescription({ className, children, ...props }: ItemDescriptionProps): React$1.JSX.Element;
|
|
29
|
+
type ItemActionsProps = React$1.ComponentProps<'div'>;
|
|
30
|
+
declare function ItemActions({ className, ...props }: ItemActionsProps): React$1.JSX.Element;
|
|
31
|
+
type ItemHeaderProps = React$1.ComponentProps<'div'>;
|
|
32
|
+
declare function ItemHeader({ className, ...props }: ItemHeaderProps): React$1.JSX.Element;
|
|
33
|
+
type ItemFooterProps = React$1.ComponentProps<'div'>;
|
|
34
|
+
declare function ItemFooter({ className, ...props }: ItemFooterProps): React$1.JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Item, ItemActions, type ItemActionsProps, ItemContent, type ItemContentProps, ItemDescription, type ItemDescriptionProps, ItemFooter, type ItemFooterProps, ItemGroup, type ItemGroupProps, ItemHeader, type ItemHeaderProps, ItemMedia, type ItemMediaProps, type ItemProps, ItemSeparator, type ItemSeparatorProps, ItemTitle, type ItemTitleProps, itemMediaVariants, itemVariants };
|
|
37
|
+
//# sourceMappingURL=item.d.ts.map
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as cn } from "../utils-BkMLyah9.js";
|
|
3
|
+
import { t as Slot } from "../slot-EL8zfLG0.js";
|
|
4
|
+
import { Separator } from "./separator.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
|
|
9
|
+
//#region src/components/item.tsx
|
|
10
|
+
function ItemGroup({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", {
|
|
12
|
+
role: "list",
|
|
13
|
+
"data-slot": "item-group",
|
|
14
|
+
className: cn("group/item-group flex w-full flex-col gap-2", className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function ItemSeparator({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
20
|
+
"data-slot": "item-separator",
|
|
21
|
+
orientation: "horizontal",
|
|
22
|
+
className: cn("bg-border/60", className),
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const itemVariants = cva(`group/item flex w-full flex-wrap items-center gap-3 rounded-md outline-none
|
|
27
|
+
transition-[box-shadow] duration-(--duration-moderate) ease-out
|
|
28
|
+
focus-visible:ring-[3px] focus-visible:ring-ring/50`, {
|
|
29
|
+
variants: {
|
|
30
|
+
variant: {
|
|
31
|
+
default: "",
|
|
32
|
+
outline: "border border-border bg-clip-padding",
|
|
33
|
+
muted: "bg-muted/60"
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
default: "p-3",
|
|
37
|
+
sm: "gap-2.5 px-3 py-2.5 text-[0.8125rem]",
|
|
38
|
+
xs: "gap-2 px-2.5 py-2 text-[0.75rem]"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
variant: "default",
|
|
43
|
+
size: "default"
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const Item = React$1.forwardRef(({ className, variant, size, asChild, children, ...props }, ref) => {
|
|
47
|
+
const classes = cn(itemVariants({
|
|
48
|
+
variant,
|
|
49
|
+
size,
|
|
50
|
+
className
|
|
51
|
+
}));
|
|
52
|
+
if (asChild && React$1.isValidElement(children)) return /* @__PURE__ */ jsx(Slot, {
|
|
53
|
+
ref,
|
|
54
|
+
className: classes,
|
|
55
|
+
"data-slot": "item",
|
|
56
|
+
...props,
|
|
57
|
+
children
|
|
58
|
+
});
|
|
59
|
+
return /* @__PURE__ */ jsx("div", {
|
|
60
|
+
ref,
|
|
61
|
+
"data-slot": "item",
|
|
62
|
+
role: "listitem",
|
|
63
|
+
className: classes,
|
|
64
|
+
...props,
|
|
65
|
+
children
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
Item.displayName = "Item";
|
|
69
|
+
const itemMediaVariants = cva("flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
70
|
+
variants: { variant: {
|
|
71
|
+
default: "",
|
|
72
|
+
icon: "size-8 rounded-sm bg-muted text-muted-foreground [&_svg]:size-4",
|
|
73
|
+
image: "size-10 overflow-hidden rounded-sm outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10 [&_img]:size-full [&_img]:object-cover"
|
|
74
|
+
} },
|
|
75
|
+
defaultVariants: { variant: "default" }
|
|
76
|
+
});
|
|
77
|
+
function ItemMedia({ className, variant, ...props }) {
|
|
78
|
+
return /* @__PURE__ */ jsx("div", {
|
|
79
|
+
"data-slot": "item-media",
|
|
80
|
+
"data-variant": variant,
|
|
81
|
+
className: cn(itemMediaVariants({
|
|
82
|
+
variant,
|
|
83
|
+
className
|
|
84
|
+
})),
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function ItemContent({ className, ...props }) {
|
|
89
|
+
return /* @__PURE__ */ jsx("div", {
|
|
90
|
+
"data-slot": "item-content",
|
|
91
|
+
className: cn("flex min-w-0 flex-1 basis-32 flex-col gap-0.5 [&+[data-slot=item-content]]:max-w-full [&+[data-slot=item-content]]:flex-none", className),
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function ItemTitle({ className, children, ...props }) {
|
|
96
|
+
return /* @__PURE__ */ jsx("div", {
|
|
97
|
+
"data-slot": "item-title",
|
|
98
|
+
title: typeof children === "string" ? children : void 0,
|
|
99
|
+
className: cn("flex w-fit max-w-full items-center gap-1.5 text-[0.8125rem] font-medium text-pretty [overflow-wrap:anywhere] [&:not(:has(>*))]:line-clamp-2", className),
|
|
100
|
+
...props,
|
|
101
|
+
children
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function ItemDescription({ className, children, ...props }) {
|
|
105
|
+
return /* @__PURE__ */ jsx("p", {
|
|
106
|
+
"data-slot": "item-description",
|
|
107
|
+
title: typeof children === "string" ? children : void 0,
|
|
108
|
+
className: cn("line-clamp-2 text-pretty text-[0.75rem] leading-5 text-muted-foreground [overflow-wrap:anywhere] [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link", className),
|
|
109
|
+
...props,
|
|
110
|
+
children
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function ItemActions({ className, ...props }) {
|
|
114
|
+
return /* @__PURE__ */ jsx("div", {
|
|
115
|
+
"data-slot": "item-actions",
|
|
116
|
+
className: cn("flex max-w-full flex-wrap items-center justify-end gap-2 ms-auto", className),
|
|
117
|
+
...props
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function ItemHeader({ className, ...props }) {
|
|
121
|
+
return /* @__PURE__ */ jsx("div", {
|
|
122
|
+
"data-slot": "item-header",
|
|
123
|
+
className: cn("flex min-w-0 basis-full items-center justify-between gap-2", className),
|
|
124
|
+
...props
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function ItemFooter({ className, ...props }) {
|
|
128
|
+
return /* @__PURE__ */ jsx("div", {
|
|
129
|
+
"data-slot": "item-footer",
|
|
130
|
+
className: cn("flex min-w-0 basis-full items-center justify-between gap-2", className),
|
|
131
|
+
...props
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, itemMediaVariants, itemVariants };
|
|
137
|
+
//# sourceMappingURL=item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.js","names":["React"],"sources":["../../src/components/item.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { Separator } from './separator';\nimport { Slot } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\ntype ItemGroupProps = React.ComponentProps<'div'>;\n\nfunction ItemGroup({ className, ...props }: ItemGroupProps) {\n\treturn (\n\t\t<div\n\t\t\trole=\"list\"\n\t\t\tdata-slot=\"item-group\"\n\t\t\tclassName={cn('group/item-group flex w-full flex-col gap-2', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype ItemSeparatorProps = React.ComponentProps<typeof Separator>;\n\nfunction ItemSeparator({ className, ...props }: ItemSeparatorProps) {\n\treturn (\n\t\t<Separator\n\t\t\tdata-slot=\"item-separator\"\n\t\t\torientation=\"horizontal\"\n\t\t\tclassName={cn('bg-border/60', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst itemVariants = cva(\n\t`group/item flex w-full flex-wrap items-center gap-3 rounded-md outline-none\n\t\ttransition-[box-shadow] duration-(--duration-moderate) ease-out\n\t\tfocus-visible:ring-[3px] focus-visible:ring-ring/50`,\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: '',\n\t\t\t\toutline: 'border border-border bg-clip-padding',\n\t\t\t\tmuted: 'bg-muted/60',\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: 'p-3',\n\t\t\t\tsm: 'gap-2.5 px-3 py-2.5 text-[0.8125rem]',\n\t\t\t\txs: 'gap-2 px-2.5 py-2 text-[0.75rem]',\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: 'default',\n\t\t\tsize: 'default',\n\t\t},\n\t},\n);\n\ninterface ItemProps\n\textends React.HTMLAttributes<HTMLDivElement>,\n\t\tVariantProps<typeof itemVariants> {\n\t/** When true, merges props onto the child element instead of rendering a div. */\n\tasChild?: boolean;\n}\n\nconst Item = React.forwardRef<HTMLDivElement, ItemProps>(\n\t({ className, variant, size, asChild, children, ...props }, ref) => {\n\t\tconst classes = cn(itemVariants({ variant, size, className }));\n\t\tif (asChild && React.isValidElement(children)) {\n\t\t\treturn (\n\t\t\t\t<Slot ref={ref} className={classes} data-slot=\"item\" {...props}>\n\t\t\t\t\t{children}\n\t\t\t\t</Slot>\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t<div ref={ref} data-slot=\"item\" role=\"listitem\" className={classes} {...props}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\nItem.displayName = 'Item';\n\nconst itemMediaVariants = cva(\n\t'flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0',\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: '',\n\t\t\t\ticon: 'size-8 rounded-sm bg-muted text-muted-foreground [&_svg]:size-4',\n\t\t\t\timage:\n\t\t\t\t\t'size-10 overflow-hidden rounded-sm outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10 [&_img]:size-full [&_img]:object-cover',\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: 'default',\n\t\t},\n\t},\n);\n\ninterface ItemMediaProps\n\textends React.HTMLAttributes<HTMLDivElement>,\n\t\tVariantProps<typeof itemMediaVariants> {}\n\nfunction ItemMedia({ className, variant, ...props }: ItemMediaProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"item-media\"\n\t\t\tdata-variant={variant}\n\t\t\tclassName={cn(itemMediaVariants({ variant, className }))}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype ItemContentProps = React.ComponentProps<'div'>;\n\nfunction ItemContent({ className, ...props }: ItemContentProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"item-content\"\n\t\t\t// `basis-32` is the floor: when the actions would squeeze the text below it, the\n\t\t\t// Item wraps them onto their own line instead of crushing the column.\n\t\t\tclassName={cn('flex min-w-0 flex-1 basis-32 flex-col gap-0.5 [&+[data-slot=item-content]]:max-w-full [&+[data-slot=item-content]]:flex-none', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype ItemTitleProps = React.ComponentProps<'div'>;\n\nfunction ItemTitle({ className, children, ...props }: ItemTitleProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"item-title\"\n\t\t\ttitle={typeof children === 'string' ? children : undefined}\n\t\t\t// Text-only titles clamp to two lines with an ellipsis. `line-clamp` needs\n\t\t\t// `display: -webkit-box`, which would stack inline children such as a Badge, so\n\t\t\t// titles that hold elements stay a flex row (their text still wraps).\n\t\t\tclassName={cn(\n\t\t\t\t'flex w-fit max-w-full items-center gap-1.5 text-[0.8125rem] font-medium text-pretty [overflow-wrap:anywhere] [&:not(:has(>*))]:line-clamp-2',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\ntype ItemDescriptionProps = React.ComponentProps<'p'>;\n\nfunction ItemDescription({ className, children, ...props }: ItemDescriptionProps) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"item-description\"\n\t\t\ttitle={typeof children === 'string' ? children : undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'line-clamp-2 text-pretty text-[0.75rem] leading-5 text-muted-foreground [overflow-wrap:anywhere] [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-link',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</p>\n\t);\n}\n\ntype ItemActionsProps = React.ComponentProps<'div'>;\n\nfunction ItemActions({ className, ...props }: ItemActionsProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"item-actions\"\n\t\t\tclassName={cn('flex max-w-full flex-wrap items-center justify-end gap-2 ms-auto', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype ItemHeaderProps = React.ComponentProps<'div'>;\n\nfunction ItemHeader({ className, ...props }: ItemHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"item-header\"\n\t\t\tclassName={cn('flex min-w-0 basis-full items-center justify-between gap-2', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype ItemFooterProps = React.ComponentProps<'div'>;\n\nfunction ItemFooter({ className, ...props }: ItemFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"item-footer\"\n\t\t\tclassName={cn('flex min-w-0 basis-full items-center justify-between gap-2', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tItem,\n\tItemMedia,\n\tItemContent,\n\tItemActions,\n\tItemGroup,\n\tItemSeparator,\n\tItemTitle,\n\tItemDescription,\n\tItemHeader,\n\tItemFooter,\n\titemVariants,\n\titemMediaVariants,\n};\nexport type {\n\tItemProps,\n\tItemMediaProps,\n\tItemContentProps,\n\tItemActionsProps,\n\tItemGroupProps,\n\tItemSeparatorProps,\n\tItemTitleProps,\n\tItemDescriptionProps,\n\tItemHeaderProps,\n\tItemFooterProps,\n};\n"],"mappings":";;;;;;;;;AASA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAyB;CAC3D,OACC,oBAAC,OAAD;EACC,MAAK;EACL,aAAU;EACV,WAAW,GAAG,+CAA+C,SAAS;EACtE,GAAI;CACJ;AAEH;AAIA,SAAS,cAAc,EAAE,WAAW,GAAG,SAA6B;CACnE,OACC,oBAAC,WAAD;EACC,aAAU;EACV,aAAY;EACZ,WAAW,GAAG,gBAAgB,SAAS;EACvC,GAAI;CACJ;AAEH;AAEA,MAAM,eAAe,IACpB;;wDAGA;CACC,UAAU;EACT,SAAS;GACR,SAAS;GACT,SAAS;GACT,OAAO;EACR;EACA,MAAM;GACL,SAAS;GACT,IAAI;GACJ,IAAI;EACL;CACD;CACA,iBAAiB;EAChB,SAAS;EACT,MAAM;CACP;AACD,CACD;AASA,MAAM,OAAOA,QAAM,YACjB,EAAE,WAAW,SAAS,MAAM,SAAS,UAAU,GAAG,SAAS,QAAQ;CACnE,MAAM,UAAU,GAAG,aAAa;EAAE;EAAS;EAAM;CAAU,CAAC,CAAC;CAC7D,IAAI,WAAWA,QAAM,eAAe,QAAQ,GAC3C,OACC,oBAAC,MAAD;EAAW;EAAK,WAAW;EAAS,aAAU;EAAO,GAAI;EACvD;CACI;CAGR,OACC,oBAAC,OAAD;EAAU;EAAK,aAAU;EAAO,MAAK;EAAW,WAAW;EAAS,GAAI;EACtE;CACG;AAEP,CACD;AACA,KAAK,cAAc;AAEnB,MAAM,oBAAoB,IACzB,0FACA;CACC,UAAU,EACT,SAAS;EACR,SAAS;EACT,MAAM;EACN,OACC;CACF,EACD;CACA,iBAAiB,EAChB,SAAS,UACV;AACD,CACD;AAMA,SAAS,UAAU,EAAE,WAAW,SAAS,GAAG,SAAyB;CACpE,OACC,oBAAC,OAAD;EACC,aAAU;EACV,gBAAc;EACd,WAAW,GAAG,kBAAkB;GAAE;GAAS;EAAU,CAAC,CAAC;EACvD,GAAI;CACJ;AAEH;AAIA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA2B;CAC/D,OACC,oBAAC,OAAD;EACC,aAAU;EAGV,WAAW,GAAG,gIAAgI,SAAS;EACvJ,GAAI;CACJ;AAEH;AAIA,SAAS,UAAU,EAAE,WAAW,UAAU,GAAG,SAAyB;CACrE,OACC,oBAAC,OAAD;EACC,aAAU;EACV,OAAO,OAAO,aAAa,WAAW,WAAW;EAIjD,WAAW,GACV,+IACA,SACD;EACA,GAAI;EAEH;CACG;AAEP;AAIA,SAAS,gBAAgB,EAAE,WAAW,UAAU,GAAG,SAA+B;CACjF,OACC,oBAAC,KAAD;EACC,aAAU;EACV,OAAO,OAAO,aAAa,WAAW,WAAW;EACjD,WAAW,GACV,mKACA,SACD;EACA,GAAI;EAEH;CACC;AAEL;AAIA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA2B;CAC/D,OACC,oBAAC,OAAD;EACC,aAAU;EACV,WAAW,GAAG,oEAAoE,SAAS;EAC3F,GAAI;CACJ;AAEH;AAIA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA0B;CAC7D,OACC,oBAAC,OAAD;EACC,aAAU;EACV,WAAW,GAAG,8DAA8D,SAAS;EACrF,GAAI;CACJ;AAEH;AAIA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA0B;CAC7D,OACC,oBAAC,OAAD;EACC,aAAU;EACV,WAAW,GAAG,8DAA8D,SAAS;EACrF,GAAI;CACJ;AAEH"}
|
|
@@ -1,147 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const
|
|
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");
|
|
4
|
+
const require_json_input = require('../json-input-D8yM578l.cjs');
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
20
|
-
});
|
|
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" })
|
|
24
|
-
});
|
|
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];
|
|
44
|
-
};
|
|
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
|
-
})] });
|
|
94
|
-
};
|
|
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
|
-
});
|
|
124
|
-
};
|
|
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
|
-
}
|
|
133
|
-
};
|
|
134
|
-
const prettifyJson = (text) => {
|
|
135
|
-
try {
|
|
136
|
-
return JSON.stringify(JSON.parse(text), null, 2);
|
|
137
|
-
} catch {
|
|
138
|
-
return text;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
const countJsonLines = (text) => text.split(/\n/).length;
|
|
142
|
-
|
|
143
|
-
//#endregion
|
|
144
|
-
exports.JsonEditor = JsonEditor;
|
|
145
|
-
exports.JsonInput = JsonInput;
|
|
146
|
-
exports.validateJson = validateJson;
|
|
147
|
-
//# sourceMappingURL=json-input.cjs.map
|
|
6
|
+
exports.JsonEditor = require_json_input.JsonEditor;
|
|
7
|
+
exports.JsonInput = require_json_input.JsonInput;
|
|
8
|
+
exports.validateJson = require_json_input.validateJson;
|
|
@@ -4,11 +4,13 @@ type JsonInputProps = {
|
|
|
4
4
|
value: string;
|
|
5
5
|
setValue: (value: string) => void;
|
|
6
6
|
minLines?: number;
|
|
7
|
+
/** Tallest the editor grows, in lines; longer documents scroll inside it. Defaults to what fits in 40% of the viewport. */
|
|
8
|
+
maxLines?: number;
|
|
7
9
|
className?: string;
|
|
8
|
-
/** Theme for the editor: 'light' or 'dark'. Defaults to '
|
|
10
|
+
/** Theme for the editor: 'light' or 'dark'. Defaults to the document's theme (the `dark` class on `<html>`). */
|
|
9
11
|
theme?: 'light' | 'dark';
|
|
10
12
|
};
|
|
11
|
-
declare const JsonInput: ({ value, setValue, minLines, className, theme }: JsonInputProps) => React$1.JSX.Element;
|
|
13
|
+
declare const JsonInput: ({ value, setValue, minLines, maxLines, className, theme: themeProp }: JsonInputProps) => React$1.JSX.Element;
|
|
12
14
|
type JsonEditorProps = {
|
|
13
15
|
value: string;
|
|
14
16
|
lines: number;
|
|
@@ -16,10 +18,10 @@ type JsonEditorProps = {
|
|
|
16
18
|
readOnly?: boolean;
|
|
17
19
|
isValid?: boolean;
|
|
18
20
|
enableFolding?: boolean;
|
|
19
|
-
/** Theme for the editor: 'light' or 'dark'. Defaults to '
|
|
21
|
+
/** Theme for the editor: 'light' or 'dark'. Defaults to the document's theme (the `dark` class on `<html>`). */
|
|
20
22
|
theme?: 'light' | 'dark';
|
|
21
23
|
};
|
|
22
|
-
declare const JsonEditor: ({ value, setValue, lines, readOnly, isValid, enableFolding, theme }: JsonEditorProps) => React$1.JSX.Element;
|
|
24
|
+
declare const JsonEditor: ({ value, setValue, lines, readOnly, isValid, enableFolding, theme: themeProp }: JsonEditorProps) => React$1.JSX.Element;
|
|
23
25
|
declare const validateJson: (text: string) => string | null;
|
|
24
26
|
//#endregion
|
|
25
27
|
export { JsonEditor, JsonInput, validateJson };
|
|
@@ -4,11 +4,13 @@ type JsonInputProps = {
|
|
|
4
4
|
value: string;
|
|
5
5
|
setValue: (value: string) => void;
|
|
6
6
|
minLines?: number;
|
|
7
|
+
/** Tallest the editor grows, in lines; longer documents scroll inside it. Defaults to what fits in 40% of the viewport. */
|
|
8
|
+
maxLines?: number;
|
|
7
9
|
className?: string;
|
|
8
|
-
/** Theme for the editor: 'light' or 'dark'. Defaults to '
|
|
10
|
+
/** Theme for the editor: 'light' or 'dark'. Defaults to the document's theme (the `dark` class on `<html>`). */
|
|
9
11
|
theme?: 'light' | 'dark';
|
|
10
12
|
};
|
|
11
|
-
declare const JsonInput: ({ value, setValue, minLines, className, theme }: JsonInputProps) => React$1.JSX.Element;
|
|
13
|
+
declare const JsonInput: ({ value, setValue, minLines, maxLines, className, theme: themeProp }: JsonInputProps) => React$1.JSX.Element;
|
|
12
14
|
type JsonEditorProps = {
|
|
13
15
|
value: string;
|
|
14
16
|
lines: number;
|
|
@@ -16,10 +18,10 @@ type JsonEditorProps = {
|
|
|
16
18
|
readOnly?: boolean;
|
|
17
19
|
isValid?: boolean;
|
|
18
20
|
enableFolding?: boolean;
|
|
19
|
-
/** Theme for the editor: 'light' or 'dark'. Defaults to '
|
|
21
|
+
/** Theme for the editor: 'light' or 'dark'. Defaults to the document's theme (the `dark` class on `<html>`). */
|
|
20
22
|
theme?: 'light' | 'dark';
|
|
21
23
|
};
|
|
22
|
-
declare const JsonEditor: ({ value, setValue, lines, readOnly, isValid, enableFolding, theme }: JsonEditorProps) => React$1.JSX.Element;
|
|
24
|
+
declare const JsonEditor: ({ value, setValue, lines, readOnly, isValid, enableFolding, theme: themeProp }: JsonEditorProps) => React$1.JSX.Element;
|
|
23
25
|
declare const validateJson: (text: string) => string | null;
|
|
24
26
|
//#endregion
|
|
25
27
|
export { JsonEditor, JsonInput, validateJson };
|
|
@@ -1,143 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { t as
|
|
4
|
-
import { Button } from "./button.js";
|
|
5
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
6
|
-
import * as React$1 from "react";
|
|
7
|
-
import { Suspense, useEffect, useMemo, useState } from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { CheckCircle2, CircleAlert, Loader2, WandSparkles } from "lucide-react";
|
|
3
|
+
import { n as JsonInput, r as validateJson, t as JsonEditor } from "../json-input-CH5aEmoA.js";
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
const AceEditor = React$1.lazy(async () => {
|
|
13
|
-
const ace = await import("react-ace");
|
|
14
|
-
await import("ace-builds/src-noconflict/mode-json");
|
|
15
|
-
await import("ace-builds/src-noconflict/theme-textmate");
|
|
16
|
-
await import("ace-builds/src-noconflict/theme-cloud9_night");
|
|
17
|
-
return ace;
|
|
18
|
-
});
|
|
19
|
-
const EditorLoading = () => /* @__PURE__ */ jsx("div", {
|
|
20
|
-
className: "flex h-32 items-center justify-center",
|
|
21
|
-
children: /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin" })
|
|
22
|
-
});
|
|
23
|
-
const displayJsonState = (jsonState) => {
|
|
24
|
-
return {
|
|
25
|
-
loading: {
|
|
26
|
-
icon: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground size-[18px] animate-spin" }),
|
|
27
|
-
text: "Checking JSON Format...",
|
|
28
|
-
className: "text-muted-foreground"
|
|
29
|
-
},
|
|
30
|
-
success: {
|
|
31
|
-
icon: /* @__PURE__ */ jsx(CheckCircle2, { className: "size-[18px] text-green-600" }),
|
|
32
|
-
text: "Valid JSON Format",
|
|
33
|
-
className: "text-foreground"
|
|
34
|
-
},
|
|
35
|
-
error: {
|
|
36
|
-
icon: /* @__PURE__ */ jsx(CircleAlert, { className: "text-destructive size-[18px]" }),
|
|
37
|
-
text: jsonState.errMsg || "Invalid JSON Format",
|
|
38
|
-
className: "text-destructive"
|
|
39
|
-
},
|
|
40
|
-
empty: {}
|
|
41
|
-
}[jsonState.state];
|
|
42
|
-
};
|
|
43
|
-
const JsonInput = ({ value = "", setValue, minLines = 16, className, theme = "light" }) => {
|
|
44
|
-
const [jsonState, setJsonState] = useState({ state: "empty" });
|
|
45
|
-
const handleChange = (val) => {
|
|
46
|
-
setJsonState({ state: "loading" });
|
|
47
|
-
setValue(val);
|
|
48
|
-
};
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
const timeoutId = setTimeout(() => {
|
|
51
|
-
const error = validateJson(value);
|
|
52
|
-
if (value.trim().length === 0) setJsonState({ state: "empty" });
|
|
53
|
-
else if (error) setJsonState({
|
|
54
|
-
state: "error",
|
|
55
|
-
errMsg: error
|
|
56
|
-
});
|
|
57
|
-
else setJsonState({ state: "success" });
|
|
58
|
-
}, 400);
|
|
59
|
-
return () => clearTimeout(timeoutId);
|
|
60
|
-
}, [value]);
|
|
61
|
-
const { icon, text, className: textClassName } = displayJsonState(jsonState);
|
|
62
|
-
const isValidJson = validateJson(value) === null;
|
|
63
|
-
const lines = useMemo(() => {
|
|
64
|
-
return Math.max(countJsonLines(value), minLines);
|
|
65
|
-
}, [value, minLines]);
|
|
66
|
-
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
67
|
-
className: cn("border-border/60 relative overflow-y-auto rounded-md border p-2.5", className),
|
|
68
|
-
children: [/* @__PURE__ */ jsx(JsonEditor, {
|
|
69
|
-
value,
|
|
70
|
-
setValue: handleChange,
|
|
71
|
-
lines,
|
|
72
|
-
theme
|
|
73
|
-
}), /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
74
|
-
asChild: true,
|
|
75
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
76
|
-
className: "absolute top-2 right-2 size-8 rounded-xl",
|
|
77
|
-
size: "icon",
|
|
78
|
-
variant: "outline",
|
|
79
|
-
type: "button",
|
|
80
|
-
disabled: !isValidJson,
|
|
81
|
-
onClick: () => setValue(prettifyJson(value)),
|
|
82
|
-
children: /* @__PURE__ */ jsx(WandSparkles, { className: "text-muted-foreground size-4" })
|
|
83
|
-
})
|
|
84
|
-
}), /* @__PURE__ */ jsx(TooltipContent, { children: "Format JSON" })] }) })]
|
|
85
|
-
}), jsonState.state !== "empty" && /* @__PURE__ */ jsxs("div", {
|
|
86
|
-
className: "mt-2 flex items-center gap-2",
|
|
87
|
-
children: [icon, /* @__PURE__ */ jsx("span", {
|
|
88
|
-
className: cn("text-sm", textClassName),
|
|
89
|
-
children: text
|
|
90
|
-
})]
|
|
91
|
-
})] });
|
|
92
|
-
};
|
|
93
|
-
const JsonEditor = ({ value, setValue, lines, readOnly = false, isValid = true, enableFolding = false, theme = "light" }) => {
|
|
94
|
-
return /* @__PURE__ */ jsx(Suspense, {
|
|
95
|
-
fallback: /* @__PURE__ */ jsx(EditorLoading, {}),
|
|
96
|
-
children: /* @__PURE__ */ jsx(AceEditor, {
|
|
97
|
-
mode: "json",
|
|
98
|
-
theme: theme === "light" ? "textmate" : "cloud9_night",
|
|
99
|
-
fontSize: "14px",
|
|
100
|
-
readOnly,
|
|
101
|
-
style: {
|
|
102
|
-
width: "100%",
|
|
103
|
-
background: "transparent",
|
|
104
|
-
offset: 0
|
|
105
|
-
},
|
|
106
|
-
setOptions: {
|
|
107
|
-
useWorker: false,
|
|
108
|
-
printMargin: false,
|
|
109
|
-
showFoldWidgets: enableFolding,
|
|
110
|
-
foldStyle: "markbegin"
|
|
111
|
-
},
|
|
112
|
-
tabSize: 2,
|
|
113
|
-
wrapEnabled: readOnly && !isValid,
|
|
114
|
-
showGutter: enableFolding,
|
|
115
|
-
minLines: lines,
|
|
116
|
-
maxLines: lines,
|
|
117
|
-
highlightActiveLine: !readOnly,
|
|
118
|
-
value,
|
|
119
|
-
onChange: setValue
|
|
120
|
-
})
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
const validateJson = (text) => {
|
|
124
|
-
try {
|
|
125
|
-
if (text.trim().length === 0) throw new SyntaxError(`Can't use empty string`);
|
|
126
|
-
JSON.parse(text);
|
|
127
|
-
return null;
|
|
128
|
-
} catch (error) {
|
|
129
|
-
return error.message;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
const prettifyJson = (text) => {
|
|
133
|
-
try {
|
|
134
|
-
return JSON.stringify(JSON.parse(text), null, 2);
|
|
135
|
-
} catch {
|
|
136
|
-
return text;
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
const countJsonLines = (text) => text.split(/\n/).length;
|
|
140
|
-
|
|
141
|
-
//#endregion
|
|
142
|
-
export { JsonEditor, JsonInput, validateJson };
|
|
143
|
-
//# sourceMappingURL=json-input.js.map
|
|
5
|
+
export { JsonEditor, JsonInput, validateJson };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_rolldown_runtime = require('../rolldown-runtime-D_qnwXdH.cjs');
|
|
4
|
+
const require_utils = require('../utils-CzTQ3-VI.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
|
|
9
|
+
//#region src/components/kbd.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Keycap for a single key. Its fill, edge, and bottom lip are mixed from the
|
|
12
|
+
* inherited text color instead of a fixed surface token, so the key always
|
|
13
|
+
* sits one step off whatever it is placed on: a card, a muted row, a tinted
|
|
14
|
+
* tray, a tooltip, or a primary button. Set the parent's text color (or
|
|
15
|
+
* `className="text-…"`) to change its tone.
|
|
16
|
+
*/
|
|
17
|
+
function Kbd({ className, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
|
|
19
|
+
"data-slot": "kbd",
|
|
20
|
+
className: require_utils.cn("pointer-events-none inline-flex h-5 min-w-5 shrink-0 select-none items-center justify-center gap-0.5 rounded-[5px] px-1 align-middle font-sans text-[0.6875rem] font-medium leading-none whitespace-nowrap tabular-nums [&_svg]:size-3", "bg-[color-mix(in_oklab,currentColor_9%,transparent)]", "shadow-[inset_0_0_0_1px_color-mix(in_oklab,currentColor_16%,transparent),inset_0_-1px_0_color-mix(in_oklab,currentColor_18%,transparent)]", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function KbdGroup({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
|
|
26
|
+
"data-slot": "kbd-group",
|
|
27
|
+
className: require_utils.cn("inline-flex items-center gap-1 align-middle", className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.Kbd = Kbd;
|
|
34
|
+
exports.KbdGroup = KbdGroup;
|
|
35
|
+
//# sourceMappingURL=kbd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kbd.cjs","names":["cn"],"sources":["../../src/components/kbd.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype KbdProps = React.ComponentProps<'kbd'>;\n\n/**\n * Keycap for a single key. Its fill, edge, and bottom lip are mixed from the\n * inherited text color instead of a fixed surface token, so the key always\n * sits one step off whatever it is placed on: a card, a muted row, a tinted\n * tray, a tooltip, or a primary button. Set the parent's text color (or\n * `className=\"text-…\"`) to change its tone.\n */\nfunction Kbd({ className, ...props }: KbdProps) {\n\treturn (\n\t\t<kbd\n\t\t\tdata-slot=\"kbd\"\n\t\t\tclassName={cn(\n\t\t\t\t'pointer-events-none inline-flex h-5 min-w-5 shrink-0 select-none items-center justify-center gap-0.5 rounded-[5px] px-1 align-middle font-sans text-[0.6875rem] font-medium leading-none whitespace-nowrap tabular-nums [&_svg]:size-3',\n\t\t\t\t'bg-[color-mix(in_oklab,currentColor_9%,transparent)]',\n\t\t\t\t'shadow-[inset_0_0_0_1px_color-mix(in_oklab,currentColor_16%,transparent),inset_0_-1px_0_color-mix(in_oklab,currentColor_18%,transparent)]',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype KbdGroupProps = React.ComponentProps<'kbd'>;\n\nfunction KbdGroup({ className, ...props }: KbdGroupProps) {\n\treturn (\n\t\t<kbd\n\t\t\tdata-slot=\"kbd-group\"\n\t\t\tclassName={cn('inline-flex items-center gap-1 align-middle', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Kbd, KbdGroup };\nexport type { KbdProps, KbdGroupProps };\n"],"mappings":";;;;;;;;;;;;;;;;AAaA,SAAS,IAAI,EAAE,WAAW,GAAG,SAAmB;CAC/C,OACC,2CAAC,OAAD;EACC,aAAU;EACV,WAAWA,iBACV,0OACA,wDACA,6IACA,SACD;EACA,GAAI;CACJ;AAEH;AAIA,SAAS,SAAS,EAAE,WAAW,GAAG,SAAwB;CACzD,OACC,2CAAC,OAAD;EACC,aAAU;EACV,WAAWA,iBAAG,+CAA+C,SAAS;EACtE,GAAI;CACJ;AAEH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/kbd.d.ts
|
|
3
|
+
type KbdProps = React$1.ComponentProps<'kbd'>;
|
|
4
|
+
/**
|
|
5
|
+
* Keycap for a single key. Its fill, edge, and bottom lip are mixed from the
|
|
6
|
+
* inherited text color instead of a fixed surface token, so the key always
|
|
7
|
+
* sits one step off whatever it is placed on: a card, a muted row, a tinted
|
|
8
|
+
* tray, a tooltip, or a primary button. Set the parent's text color (or
|
|
9
|
+
* `className="text-…"`) to change its tone.
|
|
10
|
+
*/
|
|
11
|
+
declare function Kbd({ className, ...props }: KbdProps): React$1.JSX.Element;
|
|
12
|
+
type KbdGroupProps = React$1.ComponentProps<'kbd'>;
|
|
13
|
+
declare function KbdGroup({ className, ...props }: KbdGroupProps): React$1.JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Kbd, KbdGroup, type KbdGroupProps, type KbdProps };
|
|
16
|
+
//# sourceMappingURL=kbd.d.cts.map
|