@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-zoom-panel.cjs","names":["RiFocus3Line","Panel","cn","Button","RiAddLine","RiSubtractLine"],"sources":["../../src/components/flow-zoom-panel.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\nimport { Panel, useReactFlow, type PanelPosition, type FitViewOptions } from '@xyflow/react';\nimport { RiAddLine, RiFocus3Line, RiSubtractLine } from '@remixicon/react';\n\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\ninterface FlowZoomPanelProps {\n className?: string;\n position?: PanelPosition;\n fitViewIcon?: React.ReactNode;\n fitViewOptions?: FitViewOptions;\n}\n\nconst BUTTON_CLASS =\n 'text-muted-foreground/80 hover:text-muted-foreground bg-card size-10 rounded-none shadow-none first:rounded-s-lg last:rounded-e-lg focus-visible:z-10';\n\nexport function FlowZoomPanel({\n className,\n position = 'bottom-right',\n fitViewIcon = <RiFocus3Line className='size-5' aria-hidden='true' />,\n fitViewOptions,\n}: FlowZoomPanelProps) {\n const { zoomIn, zoomOut, fitView } = useReactFlow();\n\n const onFitView = useCallback(() => {\n fitView(fitViewOptions);\n }, [fitView, fitViewOptions]);\n\n return (\n <Panel\n data-slot='flow-zoom-panel'\n position={position}\n className={cn('inline-flex -space-x-px rounded-md shadow-xs rtl:space-x-reverse', className)}\n >\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomIn()} aria-label='Zoom in'>\n <RiAddLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomOut()} aria-label='Zoom out'>\n <RiSubtractLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={onFitView} aria-label='Fit view'>\n {fitViewIcon}\n </Button>\n </Panel>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-zoom-panel.cjs","names":["RiFocus3Line","Panel","cn","Button","RiAddLine","RiSubtractLine"],"sources":["../../src/components/flow-zoom-panel.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\nimport { Panel, useReactFlow, type PanelPosition, type FitViewOptions } from '@xyflow/react';\nimport { RiAddLine, RiFocus3Line, RiSubtractLine } from '@remixicon/react';\n\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\ninterface FlowZoomPanelProps {\n className?: string;\n position?: PanelPosition;\n fitViewIcon?: React.ReactNode;\n /** Options for the fit-view button. `minZoom` defaults to 0.05 so a wide graph fits instead of stopping at the flow's own minimum. */\n fitViewOptions?: FitViewOptions;\n /** Accessible names for the three buttons, for translated UIs. Default: English. */\n labels?: { zoomIn?: string; zoomOut?: string; fitView?: string };\n}\n\n/** React Flow's own `minZoom` (0.5) would leave a wide graph clipped after \"fit\", so fitting may zoom further out. */\nconst DEFAULT_FIT_VIEW_OPTIONS: FitViewOptions = { minZoom: 0.05 };\n\nconst BUTTON_CLASS =\n 'text-muted-foreground/80 hover:text-muted-foreground bg-card size-10 rounded-none shadow-none first:rounded-s-lg last:rounded-e-lg focus-visible:z-10';\n\nexport function FlowZoomPanel({\n className,\n position = 'bottom-right',\n fitViewIcon = <RiFocus3Line className='size-5' aria-hidden='true' />,\n fitViewOptions,\n labels,\n}: FlowZoomPanelProps) {\n const { zoomIn, zoomOut, fitView } = useReactFlow();\n\n const onFitView = useCallback(() => {\n fitView({ ...DEFAULT_FIT_VIEW_OPTIONS, ...fitViewOptions });\n }, [fitView, fitViewOptions]);\n\n return (\n <Panel\n data-slot='flow-zoom-panel'\n position={position}\n className={cn('inline-flex -space-x-px rounded-md shadow-xs rtl:space-x-reverse', className)}\n >\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomIn()} aria-label={labels?.zoomIn ?? 'Zoom in'}>\n <RiAddLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomOut()} aria-label={labels?.zoomOut ?? 'Zoom out'}>\n <RiSubtractLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={onFitView} aria-label={labels?.fitView ?? 'Fit view'}>\n {fitViewIcon}\n </Button>\n </Panel>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,2BAA2C,EAAE,SAAS,IAAK;AAEjE,MAAM,eACJ;AAEF,SAAgB,cAAc,EAC5B,WACA,WAAW,gBACX,cAAc,2CAACA,+BAAD;CAAc,WAAU;CAAS,eAAY;AAAQ,IACnE,gBACA,UACqB;CACrB,MAAM,EAAE,QAAQ,SAAS,4CAAyB;CAElD,MAAM,yCAA8B;EAClC,QAAQ;GAAE,GAAG;GAA0B,GAAG;EAAe,CAAC;CAC5D,GAAG,CAAC,SAAS,cAAc,CAAC;CAE5B,OACE,4CAACC,qBAAD;EACE,aAAU;EACA;EACV,WAAWC,iBAAG,oEAAoE,SAAS;YAH7F;GAKE,2CAACC,kCAAD;IAAQ,SAAQ;IAAU,MAAK;IAAO,WAAW;IAAc,eAAe,OAAO;IAAG,cAAY,QAAQ,UAAU;cACpH,2CAACC,4BAAD;KAAW,WAAU;KAAS,eAAY;IAAQ;GAC5C;GACR,2CAACD,kCAAD;IAAQ,SAAQ;IAAU,MAAK;IAAO,WAAW;IAAc,eAAe,QAAQ;IAAG,cAAY,QAAQ,WAAW;cACtH,2CAACE,iCAAD;KAAgB,WAAU;KAAS,eAAY;IAAQ;GACjD;GACR,2CAACF,kCAAD;IAAQ,SAAQ;IAAU,MAAK;IAAO,WAAW;IAAc,SAAS;IAAW,cAAY,QAAQ,WAAW;cAC/G;GACK;EACH;;AAEX"}
|
|
@@ -4,9 +4,16 @@ interface FlowZoomPanelProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
position?: PanelPosition;
|
|
6
6
|
fitViewIcon?: React.ReactNode;
|
|
7
|
+
/** Options for the fit-view button. `minZoom` defaults to 0.05 so a wide graph fits instead of stopping at the flow's own minimum. */
|
|
7
8
|
fitViewOptions?: FitViewOptions;
|
|
9
|
+
/** Accessible names for the three buttons, for translated UIs. Default: English. */
|
|
10
|
+
labels?: {
|
|
11
|
+
zoomIn?: string;
|
|
12
|
+
zoomOut?: string;
|
|
13
|
+
fitView?: string;
|
|
14
|
+
};
|
|
8
15
|
}
|
|
9
|
-
declare function FlowZoomPanel({ className, position, fitViewIcon, fitViewOptions }: FlowZoomPanelProps): import("react").JSX.Element;
|
|
16
|
+
declare function FlowZoomPanel({ className, position, fitViewIcon, fitViewOptions, labels }: FlowZoomPanelProps): import("react").JSX.Element;
|
|
10
17
|
//#endregion
|
|
11
18
|
export { FlowZoomPanel };
|
|
12
19
|
//# sourceMappingURL=flow-zoom-panel.d.cts.map
|
|
@@ -4,9 +4,16 @@ interface FlowZoomPanelProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
position?: PanelPosition;
|
|
6
6
|
fitViewIcon?: React.ReactNode;
|
|
7
|
+
/** Options for the fit-view button. `minZoom` defaults to 0.05 so a wide graph fits instead of stopping at the flow's own minimum. */
|
|
7
8
|
fitViewOptions?: FitViewOptions;
|
|
9
|
+
/** Accessible names for the three buttons, for translated UIs. Default: English. */
|
|
10
|
+
labels?: {
|
|
11
|
+
zoomIn?: string;
|
|
12
|
+
zoomOut?: string;
|
|
13
|
+
fitView?: string;
|
|
14
|
+
};
|
|
8
15
|
}
|
|
9
|
-
declare function FlowZoomPanel({ className, position, fitViewIcon, fitViewOptions }: FlowZoomPanelProps): import("react").JSX.Element;
|
|
16
|
+
declare function FlowZoomPanel({ className, position, fitViewIcon, fitViewOptions, labels }: FlowZoomPanelProps): import("react").JSX.Element;
|
|
10
17
|
//#endregion
|
|
11
18
|
export { FlowZoomPanel };
|
|
12
19
|
//# sourceMappingURL=flow-zoom-panel.d.ts.map
|
|
@@ -8,14 +8,19 @@ import { Panel, useReactFlow } from "@xyflow/react";
|
|
|
8
8
|
import { RiAddLine, RiFocus3Line, RiSubtractLine } from "@remixicon/react";
|
|
9
9
|
|
|
10
10
|
//#region src/components/flow-zoom-panel.tsx
|
|
11
|
+
/** React Flow's own `minZoom` (0.5) would leave a wide graph clipped after "fit", so fitting may zoom further out. */
|
|
12
|
+
const DEFAULT_FIT_VIEW_OPTIONS = { minZoom: .05 };
|
|
11
13
|
const BUTTON_CLASS = "text-muted-foreground/80 hover:text-muted-foreground bg-card size-10 rounded-none shadow-none first:rounded-s-lg last:rounded-e-lg focus-visible:z-10";
|
|
12
14
|
function FlowZoomPanel({ className, position = "bottom-right", fitViewIcon = /* @__PURE__ */ jsx(RiFocus3Line, {
|
|
13
15
|
className: "size-5",
|
|
14
16
|
"aria-hidden": "true"
|
|
15
|
-
}), fitViewOptions }) {
|
|
17
|
+
}), fitViewOptions, labels }) {
|
|
16
18
|
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
|
17
19
|
const onFitView = useCallback(() => {
|
|
18
|
-
fitView(
|
|
20
|
+
fitView({
|
|
21
|
+
...DEFAULT_FIT_VIEW_OPTIONS,
|
|
22
|
+
...fitViewOptions
|
|
23
|
+
});
|
|
19
24
|
}, [fitView, fitViewOptions]);
|
|
20
25
|
return /* @__PURE__ */ jsxs(Panel, {
|
|
21
26
|
"data-slot": "flow-zoom-panel",
|
|
@@ -27,7 +32,7 @@ function FlowZoomPanel({ className, position = "bottom-right", fitViewIcon = /*
|
|
|
27
32
|
size: "icon",
|
|
28
33
|
className: BUTTON_CLASS,
|
|
29
34
|
onClick: () => zoomIn(),
|
|
30
|
-
"aria-label": "Zoom in",
|
|
35
|
+
"aria-label": labels?.zoomIn ?? "Zoom in",
|
|
31
36
|
children: /* @__PURE__ */ jsx(RiAddLine, {
|
|
32
37
|
className: "size-5",
|
|
33
38
|
"aria-hidden": "true"
|
|
@@ -38,7 +43,7 @@ function FlowZoomPanel({ className, position = "bottom-right", fitViewIcon = /*
|
|
|
38
43
|
size: "icon",
|
|
39
44
|
className: BUTTON_CLASS,
|
|
40
45
|
onClick: () => zoomOut(),
|
|
41
|
-
"aria-label": "Zoom out",
|
|
46
|
+
"aria-label": labels?.zoomOut ?? "Zoom out",
|
|
42
47
|
children: /* @__PURE__ */ jsx(RiSubtractLine, {
|
|
43
48
|
className: "size-5",
|
|
44
49
|
"aria-hidden": "true"
|
|
@@ -49,7 +54,7 @@ function FlowZoomPanel({ className, position = "bottom-right", fitViewIcon = /*
|
|
|
49
54
|
size: "icon",
|
|
50
55
|
className: BUTTON_CLASS,
|
|
51
56
|
onClick: onFitView,
|
|
52
|
-
"aria-label": "Fit view",
|
|
57
|
+
"aria-label": labels?.fitView ?? "Fit view",
|
|
53
58
|
children: fitViewIcon
|
|
54
59
|
})
|
|
55
60
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-zoom-panel.js","names":[],"sources":["../../src/components/flow-zoom-panel.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\nimport { Panel, useReactFlow, type PanelPosition, type FitViewOptions } from '@xyflow/react';\nimport { RiAddLine, RiFocus3Line, RiSubtractLine } from '@remixicon/react';\n\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\ninterface FlowZoomPanelProps {\n className?: string;\n position?: PanelPosition;\n fitViewIcon?: React.ReactNode;\n fitViewOptions?: FitViewOptions;\n}\n\nconst BUTTON_CLASS =\n 'text-muted-foreground/80 hover:text-muted-foreground bg-card size-10 rounded-none shadow-none first:rounded-s-lg last:rounded-e-lg focus-visible:z-10';\n\nexport function FlowZoomPanel({\n className,\n position = 'bottom-right',\n fitViewIcon = <RiFocus3Line className='size-5' aria-hidden='true' />,\n fitViewOptions,\n}: FlowZoomPanelProps) {\n const { zoomIn, zoomOut, fitView } = useReactFlow();\n\n const onFitView = useCallback(() => {\n fitView(fitViewOptions);\n }, [fitView, fitViewOptions]);\n\n return (\n <Panel\n data-slot='flow-zoom-panel'\n position={position}\n className={cn('inline-flex -space-x-px rounded-md shadow-xs rtl:space-x-reverse', className)}\n >\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomIn()} aria-label='Zoom in'>\n <RiAddLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomOut()} aria-label='Zoom out'>\n <RiSubtractLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={onFitView} aria-label='Fit view'>\n {fitViewIcon}\n </Button>\n </Panel>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-zoom-panel.js","names":[],"sources":["../../src/components/flow-zoom-panel.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback } from 'react';\nimport { Panel, useReactFlow, type PanelPosition, type FitViewOptions } from '@xyflow/react';\nimport { RiAddLine, RiFocus3Line, RiSubtractLine } from '@remixicon/react';\n\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\ninterface FlowZoomPanelProps {\n className?: string;\n position?: PanelPosition;\n fitViewIcon?: React.ReactNode;\n /** Options for the fit-view button. `minZoom` defaults to 0.05 so a wide graph fits instead of stopping at the flow's own minimum. */\n fitViewOptions?: FitViewOptions;\n /** Accessible names for the three buttons, for translated UIs. Default: English. */\n labels?: { zoomIn?: string; zoomOut?: string; fitView?: string };\n}\n\n/** React Flow's own `minZoom` (0.5) would leave a wide graph clipped after \"fit\", so fitting may zoom further out. */\nconst DEFAULT_FIT_VIEW_OPTIONS: FitViewOptions = { minZoom: 0.05 };\n\nconst BUTTON_CLASS =\n 'text-muted-foreground/80 hover:text-muted-foreground bg-card size-10 rounded-none shadow-none first:rounded-s-lg last:rounded-e-lg focus-visible:z-10';\n\nexport function FlowZoomPanel({\n className,\n position = 'bottom-right',\n fitViewIcon = <RiFocus3Line className='size-5' aria-hidden='true' />,\n fitViewOptions,\n labels,\n}: FlowZoomPanelProps) {\n const { zoomIn, zoomOut, fitView } = useReactFlow();\n\n const onFitView = useCallback(() => {\n fitView({ ...DEFAULT_FIT_VIEW_OPTIONS, ...fitViewOptions });\n }, [fitView, fitViewOptions]);\n\n return (\n <Panel\n data-slot='flow-zoom-panel'\n position={position}\n className={cn('inline-flex -space-x-px rounded-md shadow-xs rtl:space-x-reverse', className)}\n >\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomIn()} aria-label={labels?.zoomIn ?? 'Zoom in'}>\n <RiAddLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={() => zoomOut()} aria-label={labels?.zoomOut ?? 'Zoom out'}>\n <RiSubtractLine className='size-5' aria-hidden='true' />\n </Button>\n <Button variant='outline' size='icon' className={BUTTON_CLASS} onClick={onFitView} aria-label={labels?.fitView ?? 'Fit view'}>\n {fitViewIcon}\n </Button>\n </Panel>\n );\n}\n"],"mappings":";;;;;;;;;;;AAoBA,MAAM,2BAA2C,EAAE,SAAS,IAAK;AAEjE,MAAM,eACJ;AAEF,SAAgB,cAAc,EAC5B,WACA,WAAW,gBACX,cAAc,oBAAC,cAAD;CAAc,WAAU;CAAS,eAAY;AAAQ,IACnE,gBACA,UACqB;CACrB,MAAM,EAAE,QAAQ,SAAS,YAAY,aAAa;CAElD,MAAM,YAAY,kBAAkB;EAClC,QAAQ;GAAE,GAAG;GAA0B,GAAG;EAAe,CAAC;CAC5D,GAAG,CAAC,SAAS,cAAc,CAAC;CAE5B,OACE,qBAAC,OAAD;EACE,aAAU;EACA;EACV,WAAW,GAAG,oEAAoE,SAAS;YAH7F;GAKE,oBAAC,QAAD;IAAQ,SAAQ;IAAU,MAAK;IAAO,WAAW;IAAc,eAAe,OAAO;IAAG,cAAY,QAAQ,UAAU;cACpH,oBAAC,WAAD;KAAW,WAAU;KAAS,eAAY;IAAQ;GAC5C;GACR,oBAAC,QAAD;IAAQ,SAAQ;IAAU,MAAK;IAAO,WAAW;IAAc,eAAe,QAAQ;IAAG,cAAY,QAAQ,WAAW;cACtH,oBAAC,gBAAD;KAAgB,WAAU;KAAS,eAAY;IAAQ;GACjD;GACR,oBAAC,QAAD;IAAQ,SAAQ;IAAU,MAAK;IAAO,WAAW;IAAc,SAAS;IAAW,cAAY,QAAQ,WAAW;cAC/G;GACK;EACH;;AAEX"}
|
|
@@ -22,37 +22,41 @@ function FormControl({ children, label, id, layout = "stacked", error, className
|
|
|
22
22
|
if (layout === "floating") childProps.placeholder = " ";
|
|
23
23
|
const childWithProps = react.cloneElement(children, childProps);
|
|
24
24
|
if (layout === "floating") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
25
|
-
className: require_utils.cn("space-y-1", className),
|
|
25
|
+
className: require_utils.cn("min-w-0 space-y-1", className),
|
|
26
26
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
27
|
-
className: require_utils.cn("relative", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-
|
|
27
|
+
className: require_utils.cn("relative", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-link", "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]", "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:text-link", "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]", "has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]", error && "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-destructive", error && "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:text-destructive"),
|
|
28
28
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_slot.Slot, {
|
|
29
29
|
className: require_utils.cn(error && "border-destructive focus-visible:ring-destructive/20"),
|
|
30
30
|
children: childWithProps
|
|
31
31
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_label.Label, {
|
|
32
32
|
htmlFor: inputId,
|
|
33
33
|
"data-slot": "form-control-label",
|
|
34
|
-
className: require_utils.cn("pointer-events-none absolute start-3 top-2 translate-y-[0.45rem]", "origin-left text-[
|
|
35
|
-
children:
|
|
34
|
+
className: require_utils.cn("pointer-events-none absolute start-3 top-2 max-w-[calc(100%-1.5rem)] translate-y-[0.45rem]", "origin-left rtl:origin-right text-[0.8125rem] leading-none font-normal text-muted-foreground/60 select-none", "transition-[transform,color] duration-(--duration-slow) ease-out motion-reduce:transition-none", error && "text-destructive"),
|
|
35
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
36
|
+
dir: "auto",
|
|
37
|
+
className: "block truncate",
|
|
38
|
+
children: label
|
|
39
|
+
})
|
|
36
40
|
})]
|
|
37
41
|
}), error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
38
42
|
id: errorId,
|
|
39
|
-
className: "text-destructive text-xs",
|
|
43
|
+
className: "text-destructive text-xs [overflow-wrap:anywhere]",
|
|
40
44
|
role: "alert",
|
|
41
45
|
children: error
|
|
42
46
|
})]
|
|
43
47
|
});
|
|
44
48
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
45
|
-
className: require_utils.cn("grid gap-2", className),
|
|
49
|
+
className: require_utils.cn("grid min-w-0 grid-cols-1 gap-2", className),
|
|
46
50
|
children: [
|
|
47
51
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_label.Label, {
|
|
48
52
|
htmlFor: inputId,
|
|
49
|
-
className: require_utils.cn(error && "text-destructive"),
|
|
53
|
+
className: require_utils.cn("[overflow-wrap:anywhere]", error && "text-destructive"),
|
|
50
54
|
children: label
|
|
51
55
|
}),
|
|
52
56
|
childWithProps,
|
|
53
57
|
error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
54
58
|
id: errorId,
|
|
55
|
-
className: "text-destructive text-sm",
|
|
59
|
+
className: "text-destructive text-sm [overflow-wrap:anywhere]",
|
|
56
60
|
role: "alert",
|
|
57
61
|
children: error
|
|
58
62
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.cjs","names":["React","cn","Slot","Label"],"sources":["../../src/components/form-control.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\ntype FormControlLayout = 'stacked' | 'floating';\n\ninterface FormControlProps {\n children: React.ReactElement;\n label: string;\n id?: string;\n layout?: FormControlLayout;\n error?: string;\n className?: string;\n}\n\nfunction FormControl({ children, label, id, layout = 'stacked', error, className }: FormControlProps) {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const errorId = error ? `${inputId}-error` : undefined;\n\n const childProps: Record<string, unknown> = {\n id: inputId,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': errorId,\n };\n\n if (layout === 'floating') {\n childProps.placeholder = ' ';\n }\n\n const childWithProps = React.cloneElement(children, childProps);\n\n if (layout === 'floating') {\n return (\n <div className={cn('space-y-1', className)}>\n <div\n className={cn(\n 'relative',\n // Float label when focused\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-
|
|
1
|
+
{"version":3,"file":"form-control.cjs","names":["React","cn","Slot","Label"],"sources":["../../src/components/form-control.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\ntype FormControlLayout = 'stacked' | 'floating';\n\ninterface FormControlProps {\n children: React.ReactElement;\n label: string;\n id?: string;\n layout?: FormControlLayout;\n error?: string;\n className?: string;\n}\n\nfunction FormControl({ children, label, id, layout = 'stacked', error, className }: FormControlProps) {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const errorId = error ? `${inputId}-error` : undefined;\n\n const childProps: Record<string, unknown> = {\n id: inputId,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': errorId,\n };\n\n if (layout === 'floating') {\n childProps.placeholder = ' ';\n }\n\n const childWithProps = React.cloneElement(children, childProps);\n\n if (layout === 'floating') {\n return (\n <div className={cn('min-w-0 space-y-1', className)}>\n <div\n className={cn(\n 'relative',\n // Float label when focused\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-link',\n 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]',\n 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:text-link',\n // Float label when there's a value\n 'has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]',\n 'has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]',\n // Error\n error && 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-destructive',\n error && 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:text-destructive',\n )}\n >\n <Slot\n className={cn(\n error && 'border-destructive focus-visible:ring-destructive/20',\n )}\n >\n {childWithProps}\n </Slot>\n <Label\n htmlFor={inputId}\n data-slot=\"form-control-label\"\n className={cn(\n // Base: centered when empty; one line, so a long label ends in an ellipsis instead of wrapping over the value\n 'pointer-events-none absolute start-3 top-2 max-w-[calc(100%-1.5rem)] translate-y-[0.45rem]',\n // Small, subtle typography; the origin follows the text direction so the floated label stays at the start edge\n 'origin-left rtl:origin-right text-[0.8125rem] leading-none font-normal text-muted-foreground/60 select-none',\n // Snappy transition\n 'transition-[transform,color] duration-(--duration-slow) ease-out motion-reduce:transition-none',\n // Error state\n error && 'text-destructive',\n )}\n >\n {/* `block truncate` keeps the label to one line; `dir=\"auto\"` makes the ellipsis fall at the end of the text. */}\n <span dir='auto' className='block truncate'>\n {label}\n </span>\n </Label>\n </div>\n {error && (\n <p id={errorId} className='text-destructive text-xs [overflow-wrap:anywhere]' role='alert'>\n {error}\n </p>\n )}\n </div>\n );\n }\n\n return (\n // `grid-cols-1` is minmax(0, 1fr): an unbreakable error or label wraps instead of widening the whole control.\n <div className={cn('grid min-w-0 grid-cols-1 gap-2', className)}>\n <Label htmlFor={inputId} className={cn('[overflow-wrap:anywhere]', error && 'text-destructive')}>\n {label}\n </Label>\n {childWithProps}\n {error && (\n <p id={errorId} className='text-destructive text-sm [overflow-wrap:anywhere]' role='alert'>\n {error}\n </p>\n )}\n </div>\n );\n}\n\nexport { FormControl, type FormControlLayout };\n"],"mappings":";;;;;;;;;;;;AAmBA,SAAS,YAAY,EAAE,UAAU,OAAO,IAAI,SAAS,WAAW,OAAO,aAA+B;CACpG,MAAM,cAAcA,MAAM,MAAM;CAChC,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,QAAQ,GAAG,QAAQ,UAAU;CAE7C,MAAM,aAAsC;EAC1C,IAAI;EACJ,gBAAgB,QAAQ,OAAO;EAC/B,oBAAoB;CACtB;CAEA,IAAI,WAAW,YACb,WAAW,cAAc;CAG3B,MAAM,iBAAiBA,MAAM,aAAa,UAAU,UAAU;CAE9D,IAAI,WAAW,YACb,OACE,4CAAC,OAAD;EAAK,WAAWC,iBAAG,qBAAqB,SAAS;YAAjD,CACE,4CAAC,OAAD;GACE,WAAWA,iBACT,YAEA,8EACA,4EACA,gGACA,0EACA,iFACA,+EACA,mGACA,6EAEA,wFACA,sFACA,0GACA,2FACA,yFACA,6GAEA,SAAS,iFACT,SAAS,kFACX;aAtBF,CAwBE,2CAACC,mBAAD;IACE,WAAWD,iBACT,SAAS,sDACX;cAEC;GACG,IACN,2CAACE,gCAAD;IACE,SAAS;IACT,aAAU;IACV,WAAWF,iBAET,8FAEA,+GAEA,kGAEA,SAAS,kBACX;cAGA,2CAAC,QAAD;KAAM,KAAI;KAAO,WAAU;eACxB;IACG;GACD,EACJ;MACJ,SACC,2CAAC,KAAD;GAAG,IAAI;GAAS,WAAU;GAAoD,MAAK;aAChF;EACA,EAEF;;CAIT,OAEE,4CAAC,OAAD;EAAK,WAAWA,iBAAG,kCAAkC,SAAS;YAA9D;GACE,2CAACE,gCAAD;IAAO,SAAS;IAAS,WAAWF,iBAAG,4BAA4B,SAAS,kBAAkB;cAC3F;GACI;GACN;GACA,SACC,2CAAC,KAAD;IAAG,IAAI;IAAS,WAAU;IAAoD,MAAK;cAChF;GACA;EAEF;;AAET"}
|
|
@@ -19,37 +19,41 @@ function FormControl({ children, label, id, layout = "stacked", error, className
|
|
|
19
19
|
if (layout === "floating") childProps.placeholder = " ";
|
|
20
20
|
const childWithProps = React$1.cloneElement(children, childProps);
|
|
21
21
|
if (layout === "floating") return /* @__PURE__ */ jsxs("div", {
|
|
22
|
-
className: cn("space-y-1", className),
|
|
22
|
+
className: cn("min-w-0 space-y-1", className),
|
|
23
23
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
24
|
-
className: cn("relative", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-
|
|
24
|
+
className: cn("relative", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]", "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-link", "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]", "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:text-link", "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]", "has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0", "has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]", "has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]", error && "has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-destructive", error && "has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:text-destructive"),
|
|
25
25
|
children: [/* @__PURE__ */ jsx(Slot, {
|
|
26
26
|
className: cn(error && "border-destructive focus-visible:ring-destructive/20"),
|
|
27
27
|
children: childWithProps
|
|
28
28
|
}), /* @__PURE__ */ jsx(Label, {
|
|
29
29
|
htmlFor: inputId,
|
|
30
30
|
"data-slot": "form-control-label",
|
|
31
|
-
className: cn("pointer-events-none absolute start-3 top-2 translate-y-[0.45rem]", "origin-left text-[
|
|
32
|
-
children:
|
|
31
|
+
className: cn("pointer-events-none absolute start-3 top-2 max-w-[calc(100%-1.5rem)] translate-y-[0.45rem]", "origin-left rtl:origin-right text-[0.8125rem] leading-none font-normal text-muted-foreground/60 select-none", "transition-[transform,color] duration-(--duration-slow) ease-out motion-reduce:transition-none", error && "text-destructive"),
|
|
32
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
33
|
+
dir: "auto",
|
|
34
|
+
className: "block truncate",
|
|
35
|
+
children: label
|
|
36
|
+
})
|
|
33
37
|
})]
|
|
34
38
|
}), error && /* @__PURE__ */ jsx("p", {
|
|
35
39
|
id: errorId,
|
|
36
|
-
className: "text-destructive text-xs",
|
|
40
|
+
className: "text-destructive text-xs [overflow-wrap:anywhere]",
|
|
37
41
|
role: "alert",
|
|
38
42
|
children: error
|
|
39
43
|
})]
|
|
40
44
|
});
|
|
41
45
|
return /* @__PURE__ */ jsxs("div", {
|
|
42
|
-
className: cn("grid gap-2", className),
|
|
46
|
+
className: cn("grid min-w-0 grid-cols-1 gap-2", className),
|
|
43
47
|
children: [
|
|
44
48
|
/* @__PURE__ */ jsx(Label, {
|
|
45
49
|
htmlFor: inputId,
|
|
46
|
-
className: cn(error && "text-destructive"),
|
|
50
|
+
className: cn("[overflow-wrap:anywhere]", error && "text-destructive"),
|
|
47
51
|
children: label
|
|
48
52
|
}),
|
|
49
53
|
childWithProps,
|
|
50
54
|
error && /* @__PURE__ */ jsx("p", {
|
|
51
55
|
id: errorId,
|
|
52
|
-
className: "text-destructive text-sm",
|
|
56
|
+
className: "text-destructive text-sm [overflow-wrap:anywhere]",
|
|
53
57
|
role: "alert",
|
|
54
58
|
children: error
|
|
55
59
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.js","names":["React"],"sources":["../../src/components/form-control.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\ntype FormControlLayout = 'stacked' | 'floating';\n\ninterface FormControlProps {\n children: React.ReactElement;\n label: string;\n id?: string;\n layout?: FormControlLayout;\n error?: string;\n className?: string;\n}\n\nfunction FormControl({ children, label, id, layout = 'stacked', error, className }: FormControlProps) {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const errorId = error ? `${inputId}-error` : undefined;\n\n const childProps: Record<string, unknown> = {\n id: inputId,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': errorId,\n };\n\n if (layout === 'floating') {\n childProps.placeholder = ' ';\n }\n\n const childWithProps = React.cloneElement(children, childProps);\n\n if (layout === 'floating') {\n return (\n <div className={cn('space-y-1', className)}>\n <div\n className={cn(\n 'relative',\n // Float label when focused\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-
|
|
1
|
+
{"version":3,"file":"form-control.js","names":["React"],"sources":["../../src/components/form-control.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\ntype FormControlLayout = 'stacked' | 'floating';\n\ninterface FormControlProps {\n children: React.ReactElement;\n label: string;\n id?: string;\n layout?: FormControlLayout;\n error?: string;\n className?: string;\n}\n\nfunction FormControl({ children, label, id, layout = 'stacked', error, className }: FormControlProps) {\n const generatedId = React.useId();\n const inputId = id || generatedId;\n const errorId = error ? `${inputId}-error` : undefined;\n\n const childProps: Record<string, unknown> = {\n id: inputId,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': errorId,\n };\n\n if (layout === 'floating') {\n childProps.placeholder = ' ';\n }\n\n const childWithProps = React.cloneElement(children, childProps);\n\n if (layout === 'floating') {\n return (\n <div className={cn('min-w-0 space-y-1', className)}>\n <div\n className={cn(\n 'relative',\n // Float label when focused\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]',\n 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-link',\n 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]',\n 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:text-link',\n // Float label when there's a value\n 'has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[input:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]',\n 'has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:translate-y-0',\n 'has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:scale-[0.7]',\n 'has-[textarea:not(:placeholder-shown)]:[&_[data-slot=form-control-label]]:max-w-[calc((100%-1.5rem)/0.7)]',\n // Error\n error && 'has-[input:focus-visible]:[&_[data-slot=form-control-label]]:text-destructive',\n error && 'has-[textarea:focus-visible]:[&_[data-slot=form-control-label]]:text-destructive',\n )}\n >\n <Slot\n className={cn(\n error && 'border-destructive focus-visible:ring-destructive/20',\n )}\n >\n {childWithProps}\n </Slot>\n <Label\n htmlFor={inputId}\n data-slot=\"form-control-label\"\n className={cn(\n // Base: centered when empty; one line, so a long label ends in an ellipsis instead of wrapping over the value\n 'pointer-events-none absolute start-3 top-2 max-w-[calc(100%-1.5rem)] translate-y-[0.45rem]',\n // Small, subtle typography; the origin follows the text direction so the floated label stays at the start edge\n 'origin-left rtl:origin-right text-[0.8125rem] leading-none font-normal text-muted-foreground/60 select-none',\n // Snappy transition\n 'transition-[transform,color] duration-(--duration-slow) ease-out motion-reduce:transition-none',\n // Error state\n error && 'text-destructive',\n )}\n >\n {/* `block truncate` keeps the label to one line; `dir=\"auto\"` makes the ellipsis fall at the end of the text. */}\n <span dir='auto' className='block truncate'>\n {label}\n </span>\n </Label>\n </div>\n {error && (\n <p id={errorId} className='text-destructive text-xs [overflow-wrap:anywhere]' role='alert'>\n {error}\n </p>\n )}\n </div>\n );\n }\n\n return (\n // `grid-cols-1` is minmax(0, 1fr): an unbreakable error or label wraps instead of widening the whole control.\n <div className={cn('grid min-w-0 grid-cols-1 gap-2', className)}>\n <Label htmlFor={inputId} className={cn('[overflow-wrap:anywhere]', error && 'text-destructive')}>\n {label}\n </Label>\n {childWithProps}\n {error && (\n <p id={errorId} className='text-destructive text-sm [overflow-wrap:anywhere]' role='alert'>\n {error}\n </p>\n )}\n </div>\n );\n}\n\nexport { FormControl, type FormControlLayout };\n"],"mappings":";;;;;;;;;AAmBA,SAAS,YAAY,EAAE,UAAU,OAAO,IAAI,SAAS,WAAW,OAAO,aAA+B;CACpG,MAAM,cAAcA,QAAM,MAAM;CAChC,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,QAAQ,GAAG,QAAQ,UAAU;CAE7C,MAAM,aAAsC;EAC1C,IAAI;EACJ,gBAAgB,QAAQ,OAAO;EAC/B,oBAAoB;CACtB;CAEA,IAAI,WAAW,YACb,WAAW,cAAc;CAG3B,MAAM,iBAAiBA,QAAM,aAAa,UAAU,UAAU;CAE9D,IAAI,WAAW,YACb,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,qBAAqB,SAAS;YAAjD,CACE,qBAAC,OAAD;GACE,WAAW,GACT,YAEA,8EACA,4EACA,gGACA,0EACA,iFACA,+EACA,mGACA,6EAEA,wFACA,sFACA,0GACA,2FACA,yFACA,6GAEA,SAAS,iFACT,SAAS,kFACX;aAtBF,CAwBE,oBAAC,MAAD;IACE,WAAW,GACT,SAAS,sDACX;cAEC;GACG,IACN,oBAAC,OAAD;IACE,SAAS;IACT,aAAU;IACV,WAAW,GAET,8FAEA,+GAEA,kGAEA,SAAS,kBACX;cAGA,oBAAC,QAAD;KAAM,KAAI;KAAO,WAAU;eACxB;IACG;GACD,EACJ;MACJ,SACC,oBAAC,KAAD;GAAG,IAAI;GAAS,WAAU;GAAoD,MAAK;aAChF;EACA,EAEF;;CAIT,OAEE,qBAAC,OAAD;EAAK,WAAW,GAAG,kCAAkC,SAAS;YAA9D;GACE,oBAAC,OAAD;IAAO,SAAS;IAAS,WAAW,GAAG,4BAA4B,SAAS,kBAAkB;cAC3F;GACI;GACN;GACA,SACC,oBAAC,KAAD;IAAG,IAAI;IAAS,WAAU;IAAoD,MAAK;cAChF;GACA;EAEF;;AAET"}
|
package/dist/components/form.cjs
CHANGED
|
@@ -43,7 +43,7 @@ function FormItem({ className, ...props }) {
|
|
|
43
43
|
value: { id },
|
|
44
44
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
45
45
|
"data-slot": "form-item",
|
|
46
|
-
className: require_utils.cn("grid gap-2", className),
|
|
46
|
+
className: require_utils.cn("grid min-w-0 grid-cols-1 gap-2", className),
|
|
47
47
|
...props
|
|
48
48
|
})
|
|
49
49
|
});
|
|
@@ -53,7 +53,7 @@ function FormLabel({ className, ...props }) {
|
|
|
53
53
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_label.Label, {
|
|
54
54
|
"data-slot": "form-label",
|
|
55
55
|
"data-error": !!error,
|
|
56
|
-
className: require_utils.cn("data-[error=true]:text-destructive", className),
|
|
56
|
+
className: require_utils.cn("[overflow-wrap:anywhere] data-[error=true]:text-destructive", className),
|
|
57
57
|
htmlFor: formItemId,
|
|
58
58
|
...props
|
|
59
59
|
});
|
|
@@ -73,18 +73,18 @@ function FormDescription({ className, ...props }) {
|
|
|
73
73
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
74
74
|
"data-slot": "form-description",
|
|
75
75
|
id: formDescriptionId,
|
|
76
|
-
className: require_utils.cn("text-muted-foreground text-sm", className),
|
|
76
|
+
className: require_utils.cn("text-muted-foreground text-sm [overflow-wrap:anywhere]", className),
|
|
77
77
|
...props
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
function FormMessage({ className, ...props }) {
|
|
81
81
|
const { error, formMessageId } = useFormField();
|
|
82
|
-
const body = error ? String(error?.message ?? "") : props.children;
|
|
82
|
+
const body = (error ? String(error?.message ?? "") : "") || props.children;
|
|
83
83
|
if (!body) return null;
|
|
84
84
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
85
85
|
"data-slot": "form-message",
|
|
86
86
|
id: formMessageId,
|
|
87
|
-
className: require_utils.cn("text-destructive text-sm", className),
|
|
87
|
+
className: require_utils.cn("text-destructive text-sm [overflow-wrap:anywhere]", className),
|
|
88
88
|
...props,
|
|
89
89
|
children: body
|
|
90
90
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.cjs","names":["FormProvider","React","Controller","cn","Label","Slot"],"sources":["../../src/components/form.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '../lib/slot';\nimport {\n\tController,\n\tFormProvider,\n\tuseFormContext,\n\tuseFormState,\n\ttype ControllerProps,\n\ttype FieldPath,\n\ttype FieldValues,\n} from 'react-hook-form';\n\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n\tname: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n\t...props\n}: ControllerProps<TFieldValues, TName>) => {\n\treturn (\n\t\t<FormFieldContext.Provider value={{ name: props.name }}>\n\t\t\t<Controller {...props} />\n\t\t</FormFieldContext.Provider>\n\t);\n};\n\nconst useFormField = () => {\n\tconst fieldContext = React.useContext(FormFieldContext);\n\tconst itemContext = React.useContext(FormItemContext);\n\tconst { getFieldState } = useFormContext();\n\tconst formState = useFormState({ name: fieldContext.name });\n\tconst fieldState = getFieldState(fieldContext.name, formState);\n\n\tif (!fieldContext) {\n\t\tthrow new Error('useFormField should be used within <FormField>');\n\t}\n\n\tconst { id } = itemContext;\n\n\treturn {\n\t\tid,\n\t\tname: fieldContext.name,\n\t\tformItemId: `${id}-form-item`,\n\t\tformDescriptionId: `${id}-form-item-description`,\n\t\tformMessageId: `${id}-form-item-message`,\n\t\t...fieldState,\n\t};\n};\n\ntype FormItemContextValue = {\n\tid: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n\tconst id = React.useId();\n\n\treturn (\n\t\t<FormItemContext.Provider value={{ id }}>\n\t\t\t<div data-slot=\"form-item\" className={cn('grid gap-2', className)} {...props} />\n\t\t</FormItemContext.Provider>\n\t);\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n\tconst { error, formItemId } = useFormField();\n\n\treturn (\n\t\t<Label\n\t\t\tdata-slot=\"form-label\"\n\t\t\tdata-error={!!error}\n\t\t\tclassName={cn('data-[error=true]:text-destructive', className)}\n\t\t\thtmlFor={formItemId}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n\tconst { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n\treturn (\n\t\t<Slot\n\t\t\tdata-slot=\"form-control\"\n\t\t\tid={formItemId}\n\t\t\taria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n\t\t\taria-invalid={!!error}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n\tconst { formDescriptionId } = useFormField();\n\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"form-description\"\n\t\t\tid={formDescriptionId}\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<'p'>) {\n\tconst { error, formMessageId } = useFormField();\n\tconst body = error ? String(error?.message ?? '') : props.children;\n\n\tif (!body) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<p
|
|
1
|
+
{"version":3,"file":"form.cjs","names":["FormProvider","React","Controller","cn","Label","Slot"],"sources":["../../src/components/form.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '../lib/slot';\nimport {\n\tController,\n\tFormProvider,\n\tuseFormContext,\n\tuseFormState,\n\ttype ControllerProps,\n\ttype FieldPath,\n\ttype FieldValues,\n} from 'react-hook-form';\n\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n\tname: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n\t...props\n}: ControllerProps<TFieldValues, TName>) => {\n\treturn (\n\t\t<FormFieldContext.Provider value={{ name: props.name }}>\n\t\t\t<Controller {...props} />\n\t\t</FormFieldContext.Provider>\n\t);\n};\n\nconst useFormField = () => {\n\tconst fieldContext = React.useContext(FormFieldContext);\n\tconst itemContext = React.useContext(FormItemContext);\n\tconst { getFieldState } = useFormContext();\n\tconst formState = useFormState({ name: fieldContext.name });\n\tconst fieldState = getFieldState(fieldContext.name, formState);\n\n\tif (!fieldContext) {\n\t\tthrow new Error('useFormField should be used within <FormField>');\n\t}\n\n\tconst { id } = itemContext;\n\n\treturn {\n\t\tid,\n\t\tname: fieldContext.name,\n\t\tformItemId: `${id}-form-item`,\n\t\tformDescriptionId: `${id}-form-item-description`,\n\t\tformMessageId: `${id}-form-item-message`,\n\t\t...fieldState,\n\t};\n};\n\ntype FormItemContextValue = {\n\tid: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n\tconst id = React.useId();\n\n\t// `grid-cols-1` is minmax(0, 1fr): an unbreakable message or label wraps instead of widening the whole field.\n\treturn (\n\t\t<FormItemContext.Provider value={{ id }}>\n\t\t\t<div data-slot=\"form-item\" className={cn('grid min-w-0 grid-cols-1 gap-2', className)} {...props} />\n\t\t</FormItemContext.Provider>\n\t);\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n\tconst { error, formItemId } = useFormField();\n\n\treturn (\n\t\t<Label\n\t\t\tdata-slot=\"form-label\"\n\t\t\tdata-error={!!error}\n\t\t\tclassName={cn('[overflow-wrap:anywhere] data-[error=true]:text-destructive', className)}\n\t\t\thtmlFor={formItemId}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n\tconst { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n\treturn (\n\t\t<Slot\n\t\t\tdata-slot=\"form-control\"\n\t\t\tid={formItemId}\n\t\t\taria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n\t\t\taria-invalid={!!error}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n\tconst { formDescriptionId } = useFormField();\n\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"form-description\"\n\t\t\tid={formDescriptionId}\n\t\t\tclassName={cn('text-muted-foreground text-sm [overflow-wrap:anywhere]', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<'p'>) {\n\tconst { error, formMessageId } = useFormField();\n\t// A field can be invalid without a message (for example `setError(name, { type })`); `children` then act as the\n\t// fallback so the field never turns red without saying why.\n\tconst body = (error ? String(error?.message ?? '') : '') || props.children;\n\n\tif (!body) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"form-message\"\n\t\t\tid={formMessageId}\n\t\t\tclassName={cn('text-destructive text-sm [overflow-wrap:anywhere]', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{body}\n\t\t</p>\n\t);\n}\n\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,OAAOA;AASb,MAAM,mBAAmBC,MAAM,cAAqC,CAAC,CAA0B;AAE/F,MAAM,aAGJ,EACD,GAAG,YACwC;CAC3C,OACC,2CAAC,iBAAiB,UAAlB;EAA2B,OAAO,EAAE,MAAM,MAAM,KAAK;YACpD,2CAACC,4BAAD,EAAY,GAAI,MAAQ;CACE;AAE7B;AAEA,MAAM,qBAAqB;CAC1B,MAAM,eAAeD,MAAM,WAAW,gBAAgB;CACtD,MAAM,cAAcA,MAAM,WAAW,eAAe;CACpD,MAAM,EAAE,sDAAiC;CACzC,MAAM,8CAAyB,EAAE,MAAM,aAAa,KAAK,CAAC;CAC1D,MAAM,aAAa,cAAc,aAAa,MAAM,SAAS;CAE7D,IAAI,CAAC,cACJ,MAAM,IAAI,MAAM,gDAAgD;CAGjE,MAAM,EAAE,OAAO;CAEf,OAAO;EACN;EACA,MAAM,aAAa;EACnB,YAAY,GAAG,GAAG;EAClB,mBAAmB,GAAG,GAAG;EACzB,eAAe,GAAG,GAAG;EACrB,GAAG;CACJ;AACD;AAMA,MAAM,kBAAkBA,MAAM,cAAoC,CAAC,CAAyB;AAE5F,SAAS,SAAS,EAAE,WAAW,GAAG,SAAsC;CACvE,MAAM,KAAKA,MAAM,MAAM;CAGvB,OACC,2CAAC,gBAAgB,UAAjB;EAA0B,OAAO,EAAE,GAAG;YACrC,2CAAC,OAAD;GAAK,aAAU;GAAY,WAAWE,iBAAG,kCAAkC,SAAS;GAAG,GAAI;EAAQ;CAC1E;AAE5B;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAA6C;CAC/E,MAAM,EAAE,OAAO,eAAe,aAAa;CAE3C,OACC,2CAACC,gCAAD;EACC,aAAU;EACV,cAAY,CAAC,CAAC;EACd,WAAWD,iBAAG,+DAA+D,SAAS;EACtF,SAAS;EACT,GAAI;CACJ;AAEH;AAEA,SAAS,YAAY,EAAE,GAAG,SAA4C;CACrE,MAAM,EAAE,OAAO,YAAY,mBAAmB,kBAAkB,aAAa;CAE7E,OACC,2CAACE,mBAAD;EACC,aAAU;EACV,IAAI;EACJ,oBAAkB,CAAC,QAAQ,GAAG,sBAAsB,GAAG,kBAAkB,GAAG;EAC5E,gBAAc,CAAC,CAAC;EAChB,GAAI;CACJ;AAEH;AAEA,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAoC;CAC5E,MAAM,EAAE,sBAAsB,aAAa;CAE3C,OACC,2CAAC,KAAD;EACC,aAAU;EACV,IAAI;EACJ,WAAWF,iBAAG,0DAA0D,SAAS;EACjF,GAAI;CACJ;AAEH;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAoC;CACxE,MAAM,EAAE,OAAO,kBAAkB,aAAa;CAG9C,MAAM,QAAQ,QAAQ,OAAO,OAAO,WAAW,EAAE,IAAI,OAAO,MAAM;CAElE,IAAI,CAAC,MACJ,OAAO;CAGR,OACC,2CAAC,KAAD;EACC,aAAU;EACV,IAAI;EACJ,WAAWA,iBAAG,qDAAqD,SAAS;EAC5E,GAAI;YAEH;CACC;AAEL"}
|
package/dist/components/form.js
CHANGED
|
@@ -40,7 +40,7 @@ function FormItem({ className, ...props }) {
|
|
|
40
40
|
value: { id },
|
|
41
41
|
children: /* @__PURE__ */ jsx("div", {
|
|
42
42
|
"data-slot": "form-item",
|
|
43
|
-
className: cn("grid gap-2", className),
|
|
43
|
+
className: cn("grid min-w-0 grid-cols-1 gap-2", className),
|
|
44
44
|
...props
|
|
45
45
|
})
|
|
46
46
|
});
|
|
@@ -50,7 +50,7 @@ function FormLabel({ className, ...props }) {
|
|
|
50
50
|
return /* @__PURE__ */ jsx(Label, {
|
|
51
51
|
"data-slot": "form-label",
|
|
52
52
|
"data-error": !!error,
|
|
53
|
-
className: cn("data-[error=true]:text-destructive", className),
|
|
53
|
+
className: cn("[overflow-wrap:anywhere] data-[error=true]:text-destructive", className),
|
|
54
54
|
htmlFor: formItemId,
|
|
55
55
|
...props
|
|
56
56
|
});
|
|
@@ -70,18 +70,18 @@ function FormDescription({ className, ...props }) {
|
|
|
70
70
|
return /* @__PURE__ */ jsx("p", {
|
|
71
71
|
"data-slot": "form-description",
|
|
72
72
|
id: formDescriptionId,
|
|
73
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
73
|
+
className: cn("text-muted-foreground text-sm [overflow-wrap:anywhere]", className),
|
|
74
74
|
...props
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
function FormMessage({ className, ...props }) {
|
|
78
78
|
const { error, formMessageId } = useFormField();
|
|
79
|
-
const body = error ? String(error?.message ?? "") : props.children;
|
|
79
|
+
const body = (error ? String(error?.message ?? "") : "") || props.children;
|
|
80
80
|
if (!body) return null;
|
|
81
81
|
return /* @__PURE__ */ jsx("p", {
|
|
82
82
|
"data-slot": "form-message",
|
|
83
83
|
id: formMessageId,
|
|
84
|
-
className: cn("text-destructive text-sm", className),
|
|
84
|
+
className: cn("text-destructive text-sm [overflow-wrap:anywhere]", className),
|
|
85
85
|
...props,
|
|
86
86
|
children: body
|
|
87
87
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","names":["React"],"sources":["../../src/components/form.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '../lib/slot';\nimport {\n\tController,\n\tFormProvider,\n\tuseFormContext,\n\tuseFormState,\n\ttype ControllerProps,\n\ttype FieldPath,\n\ttype FieldValues,\n} from 'react-hook-form';\n\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n\tname: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n\t...props\n}: ControllerProps<TFieldValues, TName>) => {\n\treturn (\n\t\t<FormFieldContext.Provider value={{ name: props.name }}>\n\t\t\t<Controller {...props} />\n\t\t</FormFieldContext.Provider>\n\t);\n};\n\nconst useFormField = () => {\n\tconst fieldContext = React.useContext(FormFieldContext);\n\tconst itemContext = React.useContext(FormItemContext);\n\tconst { getFieldState } = useFormContext();\n\tconst formState = useFormState({ name: fieldContext.name });\n\tconst fieldState = getFieldState(fieldContext.name, formState);\n\n\tif (!fieldContext) {\n\t\tthrow new Error('useFormField should be used within <FormField>');\n\t}\n\n\tconst { id } = itemContext;\n\n\treturn {\n\t\tid,\n\t\tname: fieldContext.name,\n\t\tformItemId: `${id}-form-item`,\n\t\tformDescriptionId: `${id}-form-item-description`,\n\t\tformMessageId: `${id}-form-item-message`,\n\t\t...fieldState,\n\t};\n};\n\ntype FormItemContextValue = {\n\tid: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n\tconst id = React.useId();\n\n\treturn (\n\t\t<FormItemContext.Provider value={{ id }}>\n\t\t\t<div data-slot=\"form-item\" className={cn('grid gap-2', className)} {...props} />\n\t\t</FormItemContext.Provider>\n\t);\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n\tconst { error, formItemId } = useFormField();\n\n\treturn (\n\t\t<Label\n\t\t\tdata-slot=\"form-label\"\n\t\t\tdata-error={!!error}\n\t\t\tclassName={cn('data-[error=true]:text-destructive', className)}\n\t\t\thtmlFor={formItemId}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n\tconst { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n\treturn (\n\t\t<Slot\n\t\t\tdata-slot=\"form-control\"\n\t\t\tid={formItemId}\n\t\t\taria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n\t\t\taria-invalid={!!error}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n\tconst { formDescriptionId } = useFormField();\n\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"form-description\"\n\t\t\tid={formDescriptionId}\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<'p'>) {\n\tconst { error, formMessageId } = useFormField();\n\tconst body = error ? String(error?.message ?? '') : props.children;\n\n\tif (!body) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<p
|
|
1
|
+
{"version":3,"file":"form.js","names":["React"],"sources":["../../src/components/form.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '../lib/slot';\nimport {\n\tController,\n\tFormProvider,\n\tuseFormContext,\n\tuseFormState,\n\ttype ControllerProps,\n\ttype FieldPath,\n\ttype FieldValues,\n} from 'react-hook-form';\n\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n\tname: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n\tTFieldValues extends FieldValues = FieldValues,\n\tTName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n\t...props\n}: ControllerProps<TFieldValues, TName>) => {\n\treturn (\n\t\t<FormFieldContext.Provider value={{ name: props.name }}>\n\t\t\t<Controller {...props} />\n\t\t</FormFieldContext.Provider>\n\t);\n};\n\nconst useFormField = () => {\n\tconst fieldContext = React.useContext(FormFieldContext);\n\tconst itemContext = React.useContext(FormItemContext);\n\tconst { getFieldState } = useFormContext();\n\tconst formState = useFormState({ name: fieldContext.name });\n\tconst fieldState = getFieldState(fieldContext.name, formState);\n\n\tif (!fieldContext) {\n\t\tthrow new Error('useFormField should be used within <FormField>');\n\t}\n\n\tconst { id } = itemContext;\n\n\treturn {\n\t\tid,\n\t\tname: fieldContext.name,\n\t\tformItemId: `${id}-form-item`,\n\t\tformDescriptionId: `${id}-form-item-description`,\n\t\tformMessageId: `${id}-form-item-message`,\n\t\t...fieldState,\n\t};\n};\n\ntype FormItemContextValue = {\n\tid: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n\tconst id = React.useId();\n\n\t// `grid-cols-1` is minmax(0, 1fr): an unbreakable message or label wraps instead of widening the whole field.\n\treturn (\n\t\t<FormItemContext.Provider value={{ id }}>\n\t\t\t<div data-slot=\"form-item\" className={cn('grid min-w-0 grid-cols-1 gap-2', className)} {...props} />\n\t\t</FormItemContext.Provider>\n\t);\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n\tconst { error, formItemId } = useFormField();\n\n\treturn (\n\t\t<Label\n\t\t\tdata-slot=\"form-label\"\n\t\t\tdata-error={!!error}\n\t\t\tclassName={cn('[overflow-wrap:anywhere] data-[error=true]:text-destructive', className)}\n\t\t\thtmlFor={formItemId}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n\tconst { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n\treturn (\n\t\t<Slot\n\t\t\tdata-slot=\"form-control\"\n\t\t\tid={formItemId}\n\t\t\taria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n\t\t\taria-invalid={!!error}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n\tconst { formDescriptionId } = useFormField();\n\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"form-description\"\n\t\t\tid={formDescriptionId}\n\t\t\tclassName={cn('text-muted-foreground text-sm [overflow-wrap:anywhere]', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<'p'>) {\n\tconst { error, formMessageId } = useFormField();\n\t// A field can be invalid without a message (for example `setError(name, { type })`); `children` then act as the\n\t// fallback so the field never turns red without saying why.\n\tconst body = (error ? String(error?.message ?? '') : '') || props.children;\n\n\tif (!body) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"form-message\"\n\t\t\tid={formMessageId}\n\t\t\tclassName={cn('text-destructive text-sm [overflow-wrap:anywhere]', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{body}\n\t\t</p>\n\t);\n}\n\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"],"mappings":";;;;;;;;;;AAiBA,MAAM,OAAO;AASb,MAAM,mBAAmBA,QAAM,cAAqC,CAAC,CAA0B;AAE/F,MAAM,aAGJ,EACD,GAAG,YACwC;CAC3C,OACC,oBAAC,iBAAiB,UAAlB;EAA2B,OAAO,EAAE,MAAM,MAAM,KAAK;YACpD,oBAAC,YAAD,EAAY,GAAI,MAAQ;CACE;AAE7B;AAEA,MAAM,qBAAqB;CAC1B,MAAM,eAAeA,QAAM,WAAW,gBAAgB;CACtD,MAAM,cAAcA,QAAM,WAAW,eAAe;CACpD,MAAM,EAAE,kBAAkB,eAAe;CACzC,MAAM,YAAY,aAAa,EAAE,MAAM,aAAa,KAAK,CAAC;CAC1D,MAAM,aAAa,cAAc,aAAa,MAAM,SAAS;CAE7D,IAAI,CAAC,cACJ,MAAM,IAAI,MAAM,gDAAgD;CAGjE,MAAM,EAAE,OAAO;CAEf,OAAO;EACN;EACA,MAAM,aAAa;EACnB,YAAY,GAAG,GAAG;EAClB,mBAAmB,GAAG,GAAG;EACzB,eAAe,GAAG,GAAG;EACrB,GAAG;CACJ;AACD;AAMA,MAAM,kBAAkBA,QAAM,cAAoC,CAAC,CAAyB;AAE5F,SAAS,SAAS,EAAE,WAAW,GAAG,SAAsC;CACvE,MAAM,KAAKA,QAAM,MAAM;CAGvB,OACC,oBAAC,gBAAgB,UAAjB;EAA0B,OAAO,EAAE,GAAG;YACrC,oBAAC,OAAD;GAAK,aAAU;GAAY,WAAW,GAAG,kCAAkC,SAAS;GAAG,GAAI;EAAQ;CAC1E;AAE5B;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAA6C;CAC/E,MAAM,EAAE,OAAO,eAAe,aAAa;CAE3C,OACC,oBAAC,OAAD;EACC,aAAU;EACV,cAAY,CAAC,CAAC;EACd,WAAW,GAAG,+DAA+D,SAAS;EACtF,SAAS;EACT,GAAI;CACJ;AAEH;AAEA,SAAS,YAAY,EAAE,GAAG,SAA4C;CACrE,MAAM,EAAE,OAAO,YAAY,mBAAmB,kBAAkB,aAAa;CAE7E,OACC,oBAAC,MAAD;EACC,aAAU;EACV,IAAI;EACJ,oBAAkB,CAAC,QAAQ,GAAG,sBAAsB,GAAG,kBAAkB,GAAG;EAC5E,gBAAc,CAAC,CAAC;EAChB,GAAI;CACJ;AAEH;AAEA,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAoC;CAC5E,MAAM,EAAE,sBAAsB,aAAa;CAE3C,OACC,oBAAC,KAAD;EACC,aAAU;EACV,IAAI;EACJ,WAAW,GAAG,0DAA0D,SAAS;EACjF,GAAI;CACJ;AAEH;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAoC;CACxE,MAAM,EAAE,OAAO,kBAAkB,aAAa;CAG9C,MAAM,QAAQ,QAAQ,OAAO,OAAO,WAAW,EAAE,IAAI,OAAO,MAAM;CAElE,IAAI,CAAC,MACJ,OAAO;CAGR,OACC,oBAAC,KAAD;EACC,aAAU;EACV,IAAI;EACJ,WAAW,GAAG,qDAAqD,SAAS;EAC5E,GAAI;YAEH;CACC;AAEL"}
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_rolldown_runtime = require('../rolldown-runtime-D_qnwXdH.cjs');
|
|
4
5
|
const require_utils = require('../utils-CzTQ3-VI.cjs');
|
|
6
|
+
const require_text_runs = require('../text-runs-CdmlS5C7.cjs');
|
|
5
7
|
const require_components_input = require('./input.cjs');
|
|
6
8
|
const require_components_textarea = require('./textarea.cjs');
|
|
9
|
+
let react = require("react");
|
|
10
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
7
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
12
|
let class_variance_authority = require("class-variance-authority");
|
|
9
13
|
|
|
10
14
|
//#region src/components/input-group.tsx
|
|
11
15
|
function InputGroup({ className, ...props }) {
|
|
12
16
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
13
|
-
className: require_utils.cn("relative inline-flex w-full min-w-0 items-center rounded-
|
|
17
|
+
className: require_utils.cn("relative inline-flex w-full min-w-0 items-center overflow-x-clip rounded-md border border-input bg-background bg-clip-padding text-base transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid=true],textarea[aria-invalid=true]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring/60 has-[input[aria-invalid=true],textarea[aria-invalid=true]]:border-destructive/36 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid=true],textarea[aria-invalid=true]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[input:focus-visible,textarea:focus-visible]:ring-ring/35 sm:text-sm dark:bg-input/32 dark:bg-clip-border dark:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid=true],textarea[aria-invalid=true]]:before:shadow-[0_-1px_--theme(--color-white/8%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:data-[slot=input]:min-w-[max(8ch,35%)] **:data-[slot=input]:flex-1 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-2px)]", className),
|
|
14
18
|
"data-slot": "input-group",
|
|
15
19
|
role: "group",
|
|
16
20
|
...props
|
|
17
21
|
});
|
|
18
22
|
}
|
|
19
|
-
const inputGroupAddonVariants = (0, class_variance_authority.cva)("[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80", {
|
|
23
|
+
const inputGroupAddonVariants = (0, class_variance_authority.cva)("[&_svg]:-mx-0.5 flex h-auto min-w-0 shrink-0 cursor-text select-none items-center justify-center gap-2 has-[[data-slot=input-group-text]]:shrink [&_svg]:shrink-0 [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80", {
|
|
20
24
|
defaultVariants: { align: "inline-start" },
|
|
21
25
|
variants: { align: {
|
|
22
26
|
"block-end": "order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
|
|
23
27
|
"block-start": "order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]",
|
|
24
|
-
"inline-end": "has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]",
|
|
25
|
-
"inline-start": "has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]"
|
|
28
|
+
"inline-end": "overflow-x-clip has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]",
|
|
29
|
+
"inline-start": "overflow-x-clip has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]"
|
|
26
30
|
} }
|
|
27
31
|
});
|
|
28
32
|
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
@@ -40,10 +44,12 @@ function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
|
40
44
|
...props
|
|
41
45
|
});
|
|
42
46
|
}
|
|
43
|
-
function InputGroupText({ className, ...props }) {
|
|
47
|
+
function InputGroupText({ className, children, ...props }) {
|
|
44
48
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
"data-slot": "input-group-text",
|
|
50
|
+
className: require_utils.cn("[&_svg]:-mx-0.5 flex min-w-0 items-center gap-2 text-subtle-foreground [&_svg]:shrink-0 in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className),
|
|
51
|
+
...props,
|
|
52
|
+
children: require_text_runs.truncateTextRuns(children).nodes
|
|
47
53
|
});
|
|
48
54
|
}
|
|
49
55
|
function InputGroupInput({ className, ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.cjs","names":["cn","Input","Textarea"],"sources":["../../src/components/input-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport
|
|
1
|
+
{"version":3,"file":"input-group.cjs","names":["cn","truncateTextRuns","Input","Textarea"],"sources":["../../src/components/input-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { truncateTextRuns } from \"../lib/text-runs\";\nimport { cn } from \"../lib/utils\";\nimport { Input, type InputProps } from \"./input\";\nimport { Textarea, type TextareaProps } from \"./textarea\";\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n // Match aria-invalid=\"true\" only. aria-invalid=\"false\" must not paint as invalid.\n \"relative inline-flex w-full min-w-0 items-center overflow-x-clip rounded-md border border-input bg-background bg-clip-padding text-base transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid=true],textarea[aria-invalid=true]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring/60 has-[input[aria-invalid=true],textarea[aria-invalid=true]]:border-destructive/36 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid=true],textarea[aria-invalid=true]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] has-[input:focus-visible,textarea:focus-visible]:ring-ring/35 sm:text-sm dark:bg-input/32 dark:bg-clip-border dark:has-[input[aria-invalid=true],textarea[aria-invalid=true]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid=true],textarea[aria-invalid=true]]:before:shadow-[0_-1px_--theme(--color-white/8%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:data-[slot=input]:min-w-[max(8ch,35%)] **:data-[slot=input]:flex-1 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-2px)]\",\n className,\n )}\n data-slot=\"input-group\"\n role=\"group\"\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"[&_svg]:-mx-0.5 flex h-auto min-w-0 shrink-0 cursor-text select-none items-center justify-center gap-2 has-[[data-slot=input-group-text]]:shrink [&_svg]:shrink-0 [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80\",\n {\n defaultVariants: {\n align: \"inline-start\",\n },\n variants: {\n align: {\n \"block-end\":\n \"order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n \"block-start\":\n \"order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n \"inline-end\":\n \"overflow-x-clip has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]\",\n \"inline-start\":\n \"overflow-x-clip has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]\",\n },\n },\n },\n);\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n className={cn(inputGroupAddonVariants({ align }), className)}\n data-align={align}\n data-slot=\"input-group-addon\"\n onMouseDown={(e) => {\n const target = e.target as HTMLElement;\n const isInteractive = target.closest(\"button, a\");\n if (isInteractive) return;\n e.preventDefault();\n const parent = e.currentTarget.parentElement;\n const input = parent?.querySelector<\n HTMLInputElement | HTMLTextAreaElement\n >(\"input, textarea\");\n if (input && !parent?.querySelector(\"input:focus, textarea:focus\")) {\n input.focus();\n }\n }}\n {...props}\n />\n );\n}\n\nfunction InputGroupText({ className, children, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"input-group-text\"\n className={cn(\n \"[&_svg]:-mx-0.5 flex min-w-0 items-center gap-2 text-subtle-foreground [&_svg]:shrink-0 in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none\",\n className,\n )}\n {...props}\n >\n {truncateTextRuns(children).nodes}\n </span>\n );\n}\n\nfunction InputGroupInput({ className, ...props }: InputProps) {\n return <Input className={className} unstyled {...props} />;\n}\n\nfunction InputGroupTextarea({ className, ...props }: TextareaProps) {\n return <Textarea className={className} unstyled {...props} />;\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n"],"mappings":";;;;;;;;;;;;;;AAUA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,2CAAC,OAAD;EACE,WAAWA,iBAET,u6EACA,SACF;EACA,aAAU;EACV,MAAK;EACL,GAAI;CACL;AAEL;AAEA,MAAM,4DACJ,8gBACA;CACE,iBAAiB,EACf,OAAO,eACT;CACA,UAAU,EACR,OAAO;EACL,aACE;EACF,eACE;EACF,cACE;EACF,gBACE;CACJ,EACF;AACF,CACF;AAEA,SAAS,gBAAgB,EACvB,WACA,QAAQ,gBACR,GAAG,SAC0E;CAC7E,OACE,2CAAC,OAAD;EACE,WAAWA,iBAAG,wBAAwB,EAAE,MAAM,CAAC,GAAG,SAAS;EAC3D,cAAY;EACZ,aAAU;EACV,cAAc,MAAM;GAGlB,IAFe,EAAE,OACY,QAAQ,WACrB,GAAG;GACnB,EAAE,eAAe;GACjB,MAAM,SAAS,EAAE,cAAc;GAC/B,MAAM,QAAQ,QAAQ,cAEpB,iBAAiB;GACnB,IAAI,SAAS,CAAC,QAAQ,cAAc,6BAA6B,GAC/D,MAAM,MAAM;EAEhB;EACA,GAAI;CACL;AAEL;AAEA,SAAS,eAAe,EAAE,WAAW,UAAU,GAAG,SAAuC;CACvF,OACE,2CAAC,QAAD;EACE,aAAU;EACV,WAAWA,iBACT,wXACA,SACF;EACA,GAAI;YAEHC,mCAAiB,QAAQ,CAAC,CAAC;CACxB;AAEV;AAEA,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAqB;CAC5D,OAAO,2CAACC,gCAAD;EAAkB;EAAW;EAAS,GAAI;CAAQ;AAC3D;AAEA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAwB;CAClE,OAAO,2CAACC,sCAAD;EAAqB;EAAW;EAAS,GAAI;CAAQ;AAC9D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputProps } from "./input.cjs";
|
|
2
2
|
import { TextareaProps } from "./textarea.cjs";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
@@ -8,7 +8,7 @@ declare const inputGroupAddonVariants: (props?: ({
|
|
|
8
8
|
align?: "inline-start" | "block-end" | "block-start" | "inline-end" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
declare function InputGroupAddon({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React$1.JSX.Element;
|
|
11
|
-
declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
11
|
+
declare function InputGroupText({ className, children, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
12
12
|
declare function InputGroupInput({ className, ...props }: InputProps): React$1.JSX.Element;
|
|
13
13
|
declare function InputGroupTextarea({ className, ...props }: TextareaProps): React$1.JSX.Element;
|
|
14
14
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputProps } from "./input.js";
|
|
2
2
|
import { TextareaProps } from "./textarea.js";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
@@ -8,7 +8,7 @@ declare const inputGroupAddonVariants: (props?: ({
|
|
|
8
8
|
align?: "inline-start" | "block-end" | "block-start" | "inline-end" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
declare function InputGroupAddon({ className, align, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React$1.JSX.Element;
|
|
11
|
-
declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
11
|
+
declare function InputGroupText({ className, children, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
12
12
|
declare function InputGroupInput({ className, ...props }: InputProps): React$1.JSX.Element;
|
|
13
13
|
declare function InputGroupTextarea({ className, ...props }: TextareaProps): React$1.JSX.Element;
|
|
14
14
|
//#endregion
|