@constructive-io/ui 0.12.0 → 0.14.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-4JrVVL3q.js} +1794 -250
- package/dist/ai-4JrVVL3q.js.map +1 -0
- package/dist/{ai-lAkichk8.cjs → ai-B08ufcbD.cjs} +1888 -248
- package/dist/ai-B08ufcbD.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.d.cts +2 -2
- package/dist/components/badge.d.ts +2 -2
- 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 +62 -18
- 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 +62 -18
- 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 +30 -14
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.d.cts +9 -2
- package/dist/components/command.d.ts +9 -2
- package/dist/components/command.js +30 -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.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 +12 -4
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.d.cts +7 -1
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.js +12 -5
- 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 +8 -7
- package/dist/components/sidebar.d.ts +8 -7
- 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.d.cts +1 -1
- package/dist/components/stack/index.d.ts +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 +64 -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 +66 -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 +1507 -0
- package/dist/components/workspace-kit/index.cjs.map +1 -0
- package/dist/components/workspace-kit/index.d.cts +728 -0
- package/dist/components/workspace-kit/index.d.ts +728 -0
- package/dist/components/workspace-kit/index.js +1440 -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-CNELHV8o.js +134 -0
- package/dist/fluid-highlight-CNELHV8o.js.map +1 -0
- package/dist/fluid-highlight-YWFRZXsw.cjs +145 -0
- package/dist/fluid-highlight-YWFRZXsw.cjs.map +1 -0
- package/dist/{index-BzLmDsId.d.cts → index-B7cT7gZU.d.cts} +3 -3
- package/dist/{index-BzLmDsId.d.ts → index-B7cT7gZU.d.ts} +3 -3
- 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-Cluc_xc5.d.ts} +345 -20
- package/dist/{index-B0wXxIAb.d.ts → index-DXoG0ghv.d.cts} +345 -20
- package/dist/index.cjs +107 -17
- package/dist/index.d.cts +64 -14
- package/dist/index.d.ts +64 -14
- 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-CKpIa4Fj.d.cts +536 -0
- package/dist/theme-CKpIa4Fj.d.ts +536 -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-CTOHSrsh.d.cts +158 -0
- package/dist/theme-tuning-DOko6Pmy.d.ts +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 +438 -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 +436 -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 +166 -27
- package/src/styles/globals.css +194 -97
- package/dist/ai-CiaH2sfF.js.map +0 -1
- package/dist/ai-lAkichk8.cjs.map +0 -1
- package/dist/button-Bvh83YGs.d.cts +0 -20
- package/dist/button-Bvh83YGs.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
|
@@ -10,7 +10,7 @@ import { CheckIcon, LoaderCircleIcon } from "lucide-react";
|
|
|
10
10
|
//#region src/components/stepper.tsx
|
|
11
11
|
const StepperContext = createContext(void 0);
|
|
12
12
|
const StepItemContext = createContext(void 0);
|
|
13
|
-
const iconSwapClass = "transition-[opacity,scale,filter] duration-
|
|
13
|
+
const iconSwapClass = "transition-[opacity,scale,filter] duration-(--duration-slow) ease-out motion-reduce:transition-none";
|
|
14
14
|
const iconSwapVisible = "scale-100 opacity-100 blur-0";
|
|
15
15
|
const iconSwapHidden = "scale-[0.25] opacity-0 blur-[4px]";
|
|
16
16
|
const useStepper = () => {
|
|
@@ -38,7 +38,8 @@ function Stepper({ defaultValue = 0, value, onValueChange, orientation = "horizo
|
|
|
38
38
|
},
|
|
39
39
|
children: /* @__PURE__ */ jsx("div", {
|
|
40
40
|
"data-slot": "stepper",
|
|
41
|
-
className: cn(`group/stepper inline-flex data-[orientation=horizontal]
|
|
41
|
+
className: cn(`group/stepper inline-flex max-w-full min-w-0 data-[orientation=horizontal]:-my-2 data-[orientation=horizontal]:w-full
|
|
42
|
+
data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:overflow-x-auto data-[orientation=horizontal]:py-2
|
|
42
43
|
data-[orientation=vertical]:flex-col`, className),
|
|
43
44
|
"data-orientation": orientation,
|
|
44
45
|
...props
|
|
@@ -58,8 +59,8 @@ function StepperItem({ step, completed = false, disabled = false, loading = fals
|
|
|
58
59
|
},
|
|
59
60
|
children: /* @__PURE__ */ jsx("div", {
|
|
60
61
|
"data-slot": "stepper-item",
|
|
61
|
-
className: cn(`group/step flex items-center group-data-[orientation=horizontal]/stepper:flex-row
|
|
62
|
-
group-data-[orientation=vertical]/stepper:flex-col`, className),
|
|
62
|
+
className: cn(`group/step flex min-w-0 items-center group-data-[orientation=horizontal]/stepper:flex-row
|
|
63
|
+
group-data-[orientation=vertical]/stepper:flex-col group-data-[orientation=vertical]/stepper:items-start`, className),
|
|
63
64
|
"data-state": state,
|
|
64
65
|
...isLoading ? { "data-loading": true } : {},
|
|
65
66
|
...props,
|
|
@@ -70,9 +71,9 @@ function StepperItem({ step, completed = false, disabled = false, loading = fals
|
|
|
70
71
|
function StepperTrigger({ asChild = false, static: isStatic, className, children, ...props }) {
|
|
71
72
|
const { setActiveStep } = useStepper();
|
|
72
73
|
const { step, isDisabled } = useStepItem();
|
|
73
|
-
const triggerClassName = cn(`focus-visible:
|
|
74
|
-
duration-
|
|
75
|
-
disabled:pointer-events-none disabled:opacity-
|
|
74
|
+
const triggerClassName = cn(`focus-visible:ring-ring/50 -my-1 inline-flex min-w-0 items-center gap-3 rounded-full py-1 transition-transform
|
|
75
|
+
duration-(--duration-moderate) ease-out outline-none focus-visible:z-10 focus-visible:ring-[3px]
|
|
76
|
+
disabled:pointer-events-none disabled:opacity-64 [&>*]:min-w-0`, !isStatic && "motion-safe:hover:scale-105 motion-safe:active:not-disabled:scale-[0.96]", className);
|
|
76
77
|
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
77
78
|
"data-slot": "stepper-trigger",
|
|
78
79
|
className: triggerClassName,
|
|
@@ -98,12 +99,12 @@ function StepperIndicator({ asChild = false, className, children, ...props }) {
|
|
|
98
99
|
"data-slot": "stepper-indicator",
|
|
99
100
|
className: cn(`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary
|
|
100
101
|
data-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6
|
|
101
|
-
shrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-
|
|
102
|
+
shrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-(--duration-slow) ease-out`, className),
|
|
102
103
|
"data-state": state,
|
|
103
104
|
...props,
|
|
104
105
|
children: asChild ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105
106
|
/* @__PURE__ */ jsx("span", {
|
|
106
|
-
className: cn("absolute", iconSwapClass, showNumber ? iconSwapVisible : iconSwapHidden),
|
|
107
|
+
className: cn("absolute tabular-nums", iconSwapClass, showNumber ? iconSwapVisible : iconSwapHidden),
|
|
107
108
|
children: step
|
|
108
109
|
}),
|
|
109
110
|
/* @__PURE__ */ jsx(CheckIcon, {
|
|
@@ -122,26 +123,31 @@ function StepperIndicator({ asChild = false, className, children, ...props }) {
|
|
|
122
123
|
] })
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
|
-
function StepperTitle({ className, ...props }) {
|
|
126
|
+
function StepperTitle({ className, children, ...props }) {
|
|
126
127
|
return /* @__PURE__ */ jsx("h3", {
|
|
127
128
|
"data-slot": "stepper-title",
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
title: typeof children === "string" ? children : void 0,
|
|
130
|
+
className: cn("text-sm font-medium [overflow-wrap:anywhere] group-data-[orientation=horizontal]/stepper:truncate transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] duration-(--duration-slow) ease-out", className),
|
|
131
|
+
...props,
|
|
132
|
+
children
|
|
130
133
|
});
|
|
131
134
|
}
|
|
132
|
-
function StepperDescription({ className, ...props }) {
|
|
135
|
+
function StepperDescription({ className, children, ...props }) {
|
|
133
136
|
return /* @__PURE__ */ jsx("p", {
|
|
134
137
|
"data-slot": "stepper-description",
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
title: typeof children === "string" ? children : void 0,
|
|
139
|
+
className: cn("text-muted-foreground text-sm [overflow-wrap:anywhere] group-data-[orientation=horizontal]/stepper:truncate transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] duration-(--duration-slow) ease-out", className),
|
|
140
|
+
...props,
|
|
141
|
+
children
|
|
137
142
|
});
|
|
138
143
|
}
|
|
139
144
|
function StepperSeparator({ className, ...props }) {
|
|
140
145
|
return /* @__PURE__ */ jsx("div", {
|
|
141
146
|
"data-slot": "stepper-separator",
|
|
142
|
-
className: cn(`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-
|
|
147
|
+
className: cn(`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] duration-(--duration-slow) ease-out
|
|
143
148
|
group-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full
|
|
144
|
-
group-data-[orientation=horizontal]/stepper:flex-1
|
|
149
|
+
group-data-[orientation=horizontal]/stepper:flex-1
|
|
150
|
+
group-data-[orientation=vertical]/stepper:ms-[calc(--spacing(3)-1px)] group-data-[orientation=vertical]/stepper:h-12
|
|
145
151
|
group-data-[orientation=vertical]/stepper:w-0.5`, className),
|
|
146
152
|
...props
|
|
147
153
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.js","names":["React"],"sources":["../../src/components/stepper.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createContext, useContext } from 'react';\nimport { CheckIcon, LoaderCircleIcon } from 'lucide-react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\n\n// Types\ntype StepperContextValue = {\n\tactiveStep: number;\n\tsetActiveStep: (step: number) => void;\n\torientation: 'horizontal' | 'vertical';\n};\n\ntype StepItemContextValue = {\n\tstep: number;\n\tstate: StepState;\n\tisDisabled: boolean;\n\tisLoading: boolean;\n};\n\ntype StepState = 'active' | 'completed' | 'inactive' | 'loading';\n\n// Contexts\nconst StepperContext = createContext<StepperContextValue | undefined>(undefined);\nconst StepItemContext = createContext<StepItemContextValue | undefined>(undefined);\n\nconst iconSwapClass =\n\t'transition-[opacity,scale,filter] duration-300 ease-[cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none';\nconst iconSwapVisible = 'scale-100 opacity-100 blur-0';\nconst iconSwapHidden = 'scale-[0.25] opacity-0 blur-[4px]';\n\nconst useStepper = () => {\n\tconst context = useContext(StepperContext);\n\tif (!context) {\n\t\tthrow new Error('useStepper must be used within a Stepper');\n\t}\n\treturn context;\n};\n\nconst useStepItem = () => {\n\tconst context = useContext(StepItemContext);\n\tif (!context) {\n\t\tthrow new Error('useStepItem must be used within a StepperItem');\n\t}\n\treturn context;\n};\n\n// Components\ninterface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n\tdefaultValue?: number;\n\tvalue?: number;\n\tonValueChange?: (value: number) => void;\n\torientation?: 'horizontal' | 'vertical';\n}\n\nfunction Stepper({\n\tdefaultValue = 0,\n\tvalue,\n\tonValueChange,\n\torientation = 'horizontal',\n\tclassName,\n\t...props\n}: StepperProps) {\n\tconst [activeStep, setInternalStep] = React.useState(defaultValue);\n\n\tconst setActiveStep = React.useCallback(\n\t\t(step: number) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsetInternalStep(step);\n\t\t\t}\n\t\t\tonValueChange?.(step);\n\t\t},\n\t\t[value, onValueChange],\n\t);\n\n\tconst currentStep = value ?? activeStep;\n\n\treturn (\n\t\t<StepperContext.Provider\n\t\t\tvalue={{\n\t\t\t\tactiveStep: currentStep,\n\t\t\t\tsetActiveStep,\n\t\t\t\torientation,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/stepper inline-flex data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row\n\t\t\t\t\tdata-[orientation=vertical]:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</StepperContext.Provider>\n\t);\n}\n\n// StepperItem\ninterface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n\tstep: number;\n\tcompleted?: boolean;\n\tdisabled?: boolean;\n\tloading?: boolean;\n}\n\nfunction StepperItem({\n\tstep,\n\tcompleted = false,\n\tdisabled = false,\n\tloading = false,\n\tclassName,\n\tchildren,\n\t...props\n}: StepperItemProps) {\n\tconst { activeStep } = useStepper();\n\n\tconst state: StepState = completed || step < activeStep ? 'completed' : activeStep === step ? 'active' : 'inactive';\n\n\tconst isLoading = loading && step === activeStep;\n\n\treturn (\n\t\t<StepItemContext.Provider value={{ step, state, isDisabled: disabled, isLoading }}>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper-item\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/step flex items-center group-data-[orientation=horizontal]/stepper:flex-row\n\t\t\t\t\tgroup-data-[orientation=vertical]/stepper:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-state={state}\n\t\t\t\t{...(isLoading ? { 'data-loading': true } : {})}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</StepItemContext.Provider>\n\t);\n}\n\n// StepperTrigger\ninterface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tasChild?: boolean;\n\t/** Disables hover and press scaling when motion would distract. */\n\tstatic?: boolean;\n}\n\nfunction StepperTrigger({ asChild = false, static: isStatic, className, children, ...props }: StepperTriggerProps) {\n\tconst { setActiveStep } = useStepper();\n\tconst { step, isDisabled } = useStepItem();\n\n\tconst triggerClassName = cn(\n\t\t`focus-visible:border-ring focus-visible:ring-ring/50 inline-flex items-center gap-3 rounded-full transition-transform\n\t\tduration-150 ease-out outline-none focus-visible:z-10 focus-visible:ring-[3px]\n\t\tdisabled:pointer-events-none disabled:opacity-50`,\n\t\t!isStatic && 'motion-safe:hover:scale-105 motion-safe:active:not-disabled:scale-[0.96]',\n\t\tclassName,\n\t);\n\n\tif (asChild) {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\t\tclassName={triggerClassName}\n\t\t\t\tonClick={() => setActiveStep(step)}\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Slot>\n\t\t);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\tclassName={triggerClassName}\n\t\t\tonClick={() => setActiveStep(step)}\n\t\t\tdisabled={isDisabled}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\n// StepperIndicator\ninterface StepperIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n\tasChild?: boolean;\n}\n\nfunction StepperIndicator({ asChild = false, className, children, ...props }: StepperIndicatorProps) {\n\tconst { state, step, isLoading } = useStepItem();\n\tconst showNumber = !isLoading && state !== 'completed';\n\tconst showCheck = !isLoading && state === 'completed';\n\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"stepper-indicator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary\n\t\t\t\t\tdata-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6\n\t\t\t\t\tshrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-200 ease-out`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-state={state}\n\t\t\t{...props}\n\t\t>\n\t\t\t{asChild ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span className={cn('absolute', iconSwapClass, showNumber ? iconSwapVisible : iconSwapHidden)}>\n\t\t\t\t\t\t{step}\n\t\t\t\t\t</span>\n\t\t\t\t\t<CheckIcon\n\t\t\t\t\t\tclassName={cn('absolute', iconSwapClass, showCheck ? iconSwapVisible : iconSwapHidden)}\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t/>\n\t\t\t\t\t<span className={cn('absolute', iconSwapClass, isLoading ? iconSwapVisible : iconSwapHidden)}>\n\t\t\t\t\t\t<LoaderCircleIcon\n\t\t\t\t\t\t\tclassName={cn(isLoading && 'motion-safe:animate-spin')}\n\t\t\t\t\t\t\tsize={14}\n\t\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\n// StepperTitle\nfunction StepperTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot=\"stepper-title\"\n\t\t\tclassName={cn('text-sm font-medium transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperDescription\nfunction StepperDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"stepper-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm transition-colors duration-200 ease-out', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// StepperSeparator\nfunction StepperSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"stepper-separator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-colors duration-200 ease-out\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:flex-1 group-data-[orientation=vertical]/stepper:h-12\n\t\t\t\tgroup-data-[orientation=vertical]/stepper:w-0.5`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger };\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"stepper.js","names":["React"],"sources":["../../src/components/stepper.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createContext, useContext } from 'react';\nimport { CheckIcon, LoaderCircleIcon } from 'lucide-react';\nimport { Slot } from '../lib/slot';\n\nimport { cn } from '../lib/utils';\n\n// Types\ntype StepperContextValue = {\n\tactiveStep: number;\n\tsetActiveStep: (step: number) => void;\n\torientation: 'horizontal' | 'vertical';\n};\n\ntype StepItemContextValue = {\n\tstep: number;\n\tstate: StepState;\n\tisDisabled: boolean;\n\tisLoading: boolean;\n};\n\ntype StepState = 'active' | 'completed' | 'inactive' | 'loading';\n\n// Contexts\nconst StepperContext = createContext<StepperContextValue | undefined>(undefined);\nconst StepItemContext = createContext<StepItemContextValue | undefined>(undefined);\n\nconst iconSwapClass =\n\t'transition-[opacity,scale,filter] duration-(--duration-slow) ease-out motion-reduce:transition-none';\nconst iconSwapVisible = 'scale-100 opacity-100 blur-0';\nconst iconSwapHidden = 'scale-[0.25] opacity-0 blur-[4px]';\n\nconst useStepper = () => {\n\tconst context = useContext(StepperContext);\n\tif (!context) {\n\t\tthrow new Error('useStepper must be used within a Stepper');\n\t}\n\treturn context;\n};\n\nconst useStepItem = () => {\n\tconst context = useContext(StepItemContext);\n\tif (!context) {\n\t\tthrow new Error('useStepItem must be used within a StepperItem');\n\t}\n\treturn context;\n};\n\n// Components\ninterface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n\tdefaultValue?: number;\n\tvalue?: number;\n\tonValueChange?: (value: number) => void;\n\torientation?: 'horizontal' | 'vertical';\n}\n\nfunction Stepper({\n\tdefaultValue = 0,\n\tvalue,\n\tonValueChange,\n\torientation = 'horizontal',\n\tclassName,\n\t...props\n}: StepperProps) {\n\tconst [activeStep, setInternalStep] = React.useState(defaultValue);\n\n\tconst setActiveStep = React.useCallback(\n\t\t(step: number) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsetInternalStep(step);\n\t\t\t}\n\t\t\tonValueChange?.(step);\n\t\t},\n\t\t[value, onValueChange],\n\t);\n\n\tconst currentStep = value ?? activeStep;\n\n\treturn (\n\t\t<StepperContext.Provider\n\t\t\tvalue={{\n\t\t\t\tactiveStep: currentStep,\n\t\t\t\tsetActiveStep,\n\t\t\t\torientation,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t// Never wider than the container. Labels truncate before connectors shrink, and\n\t\t\t\t\t// horizontal scrolls only as a last resort instead of widening the page.\n\t\t\t\t\t// A scroll container clips on both axes, and a trigger reaches 4px past the row (`-my-1 py-1`) with a 3px\n\t\t\t\t\t// focus ring around that. The 0.5rem of vertical padding keeps both inside the clip and the negative\n\t\t\t\t\t// margin takes it back, so the stepper covers the height it always did. It adds nothing sideways: a box\n\t\t\t\t\t// wider than its container would widen the page when the stepper runs edge to edge.\n\t\t\t\t\t`group/stepper inline-flex max-w-full min-w-0 data-[orientation=horizontal]:-my-2 data-[orientation=horizontal]:w-full\n\t\t\t\t\tdata-[orientation=horizontal]:flex-row data-[orientation=horizontal]:overflow-x-auto data-[orientation=horizontal]:py-2\n\t\t\t\t\tdata-[orientation=vertical]:flex-col`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</StepperContext.Provider>\n\t);\n}\n\n// StepperItem\ninterface StepperItemProps extends React.HTMLAttributes<HTMLDivElement> {\n\tstep: number;\n\tcompleted?: boolean;\n\tdisabled?: boolean;\n\tloading?: boolean;\n}\n\nfunction StepperItem({\n\tstep,\n\tcompleted = false,\n\tdisabled = false,\n\tloading = false,\n\tclassName,\n\tchildren,\n\t...props\n}: StepperItemProps) {\n\tconst { activeStep } = useStepper();\n\n\tconst state: StepState = completed || step < activeStep ? 'completed' : activeStep === step ? 'active' : 'inactive';\n\n\tconst isLoading = loading && step === activeStep;\n\n\treturn (\n\t\t<StepItemContext.Provider value={{ step, state, isDisabled: disabled, isLoading }}>\n\t\t\t<div\n\t\t\t\tdata-slot=\"stepper-item\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`group/step flex min-w-0 items-center group-data-[orientation=horizontal]/stepper:flex-row\n\t\t\t\t\tgroup-data-[orientation=vertical]/stepper:flex-col group-data-[orientation=vertical]/stepper:items-start`,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-state={state}\n\t\t\t\t{...(isLoading ? { 'data-loading': true } : {})}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</StepItemContext.Provider>\n\t);\n}\n\n// StepperTrigger\ninterface StepperTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tasChild?: boolean;\n\t/** Disables hover and press scaling when motion would distract. */\n\tstatic?: boolean;\n}\n\nfunction StepperTrigger({ asChild = false, static: isStatic, className, children, ...props }: StepperTriggerProps) {\n\tconst { setActiveStep } = useStepper();\n\tconst { step, isDisabled } = useStepItem();\n\n\tconst triggerClassName = cn(\n\t\t`focus-visible:ring-ring/50 -my-1 inline-flex min-w-0 items-center gap-3 rounded-full py-1 transition-transform\n\t\tduration-(--duration-moderate) ease-out outline-none focus-visible:z-10 focus-visible:ring-[3px]\n\t\tdisabled:pointer-events-none disabled:opacity-64 [&>*]:min-w-0`,\n\t\t!isStatic && 'motion-safe:hover:scale-105 motion-safe:active:not-disabled:scale-[0.96]',\n\t\tclassName,\n\t);\n\n\tif (asChild) {\n\t\treturn (\n\t\t\t<Slot\n\t\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\t\tclassName={triggerClassName}\n\t\t\t\tonClick={() => setActiveStep(step)}\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Slot>\n\t\t);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tdata-slot=\"stepper-trigger\"\n\t\t\tclassName={triggerClassName}\n\t\t\tonClick={() => setActiveStep(step)}\n\t\t\tdisabled={isDisabled}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\n// StepperIndicator\ninterface StepperIndicatorProps extends React.HTMLAttributes<HTMLDivElement> {\n\tasChild?: boolean;\n}\n\nfunction StepperIndicator({ asChild = false, className, children, ...props }: StepperIndicatorProps) {\n\tconst { state, step, isLoading } = useStepItem();\n\tconst showNumber = !isLoading && state !== 'completed';\n\tconst showCheck = !isLoading && state === 'completed';\n\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"stepper-indicator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted text-muted-foreground data-[state=active]:bg-primary data-[state=completed]:bg-primary\n\t\t\t\t\tdata-[state=active]:text-primary-foreground data-[state=completed]:text-primary-foreground relative flex size-6\n\t\t\t\t\tshrink-0 items-center justify-center rounded-full text-xs font-medium transition-[color,background-color] duration-(--duration-slow) ease-out`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-state={state}\n\t\t\t{...props}\n\t\t>\n\t\t\t{asChild ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={cn('absolute tabular-nums', iconSwapClass, showNumber ? iconSwapVisible : iconSwapHidden)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{step}\n\t\t\t\t\t</span>\n\t\t\t\t\t<CheckIcon\n\t\t\t\t\t\tclassName={cn('absolute', iconSwapClass, showCheck ? iconSwapVisible : iconSwapHidden)}\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t/>\n\t\t\t\t\t<span className={cn('absolute', iconSwapClass, isLoading ? iconSwapVisible : iconSwapHidden)}>\n\t\t\t\t\t\t<LoaderCircleIcon\n\t\t\t\t\t\t\tclassName={cn(isLoading && 'motion-safe:animate-spin')}\n\t\t\t\t\t\t\tsize={14}\n\t\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</span>\n\t);\n}\n\n// StepperTitle\nfunction StepperTitle({ className, children, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {\n\treturn (\n\t\t<h3\n\t\t\tdata-slot=\"stepper-title\"\n\t\t\ttitle={typeof children === 'string' ? children : undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'text-sm font-medium [overflow-wrap:anywhere] group-data-[orientation=horizontal]/stepper:truncate transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] duration-(--duration-slow) ease-out',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</h3>\n\t);\n}\n\n// StepperDescription\nfunction StepperDescription({ className, children, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {\n\treturn (\n\t\t<p\n\t\t\tdata-slot=\"stepper-description\"\n\t\t\ttitle={typeof children === 'string' ? children : undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'text-muted-foreground text-sm [overflow-wrap:anywhere] group-data-[orientation=horizontal]/stepper:truncate transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] duration-(--duration-slow) ease-out',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</p>\n\t);\n}\n\n// StepperSeparator\nfunction StepperSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"stepper-separator\"\n\t\t\tclassName={cn(\n\t\t\t\t`bg-muted group-data-[state=completed]/step:bg-primary m-0.5 transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow] duration-(--duration-slow) ease-out\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:h-0.5 group-data-[orientation=horizontal]/stepper:w-full\n\t\t\t\tgroup-data-[orientation=horizontal]/stepper:flex-1\n\t\t\t\tgroup-data-[orientation=vertical]/stepper:ms-[calc(--spacing(3)-1px)] group-data-[orientation=vertical]/stepper:h-12\n\t\t\t\tgroup-data-[orientation=vertical]/stepper:w-0.5`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Stepper, StepperDescription, StepperIndicator, StepperItem, StepperSeparator, StepperTitle, StepperTrigger };\n"],"mappings":"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"}
|
|
@@ -12,14 +12,14 @@ let _base_ui_react_switch = require("@base-ui/react/switch");
|
|
|
12
12
|
function Switch({ className, ...props }) {
|
|
13
13
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_switch.Switch.Root, {
|
|
14
14
|
"data-slot": "switch",
|
|
15
|
-
className: require_utils.cn(`peer relative inline-flex h-
|
|
16
|
-
|
|
17
|
-
before:
|
|
15
|
+
className: require_utils.cn(`peer relative inline-flex h-[1.15rem] w-8 shrink-0 items-center outline-none
|
|
16
|
+
after:absolute after:-inset-x-1.5 after:-inset-y-[0.675rem] after:content-[''] pointer-coarse:after:-inset-y-[0.8rem]
|
|
17
|
+
before:pointer-events-none before:absolute before:inset-0 before:rounded-full before:border
|
|
18
18
|
before:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]
|
|
19
19
|
data-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80
|
|
20
20
|
focus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50
|
|
21
|
-
transition-transform duration-
|
|
22
|
-
motion-reduce:transition-none
|
|
21
|
+
transition-transform duration-(--duration-moderate) ease-out motion-safe:active:not-data-disabled:scale-[0.96]
|
|
22
|
+
motion-reduce:transition-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-64`, className),
|
|
23
23
|
...props,
|
|
24
24
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_switch.Switch.Thumb, {
|
|
25
25
|
"data-slot": "switch-thumb",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.cjs","names":["SwitchPrimitive","cn"],"sources":["../../src/components/switch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch';\n\nimport { cn } from '../lib/utils';\n\ntype SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root>;\n\nfunction Switch({ className, ...props }: SwitchProps) {\n\treturn (\n\t\t<SwitchPrimitive.Root\n\t\t\tdata-slot=\"switch\"\n\t\t\tclassName={cn(\n\t\t\t\t`peer relative inline-flex h-
|
|
1
|
+
{"version":3,"file":"switch.cjs","names":["SwitchPrimitive","cn"],"sources":["../../src/components/switch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch';\n\nimport { cn } from '../lib/utils';\n\ntype SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root>;\n\nfunction Switch({ className, ...props }: SwitchProps) {\n\treturn (\n\t\t<SwitchPrimitive.Root\n\t\t\tdata-slot=\"switch\"\n\t\t\tclassName={cn(\n\t\t\t\t// The box is the track itself (so a top-aligned switch lines up with the first label line); the 44x40\n\t\t\t\t// touch target is the `after` pseudo-element, the way Checkbox and Radio do it with `before`.\n\t\t\t\t`peer relative inline-flex h-[1.15rem] w-8 shrink-0 items-center outline-none\n\t\t\t\t\tafter:absolute after:-inset-x-1.5 after:-inset-y-[0.675rem] after:content-[''] pointer-coarse:after:-inset-y-[0.8rem]\n\t\t\t\t\tbefore:pointer-events-none before:absolute before:inset-0 before:rounded-full before:border\n\t\t\t\t\tbefore:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]\n\t\t\t\t\tdata-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80\n\t\t\t\t\tfocus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50\n\t\t\t\t\ttransition-transform duration-(--duration-moderate) ease-out motion-safe:active:not-data-disabled:scale-[0.96]\n\t\t\t\t\tmotion-reduce:transition-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-64`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SwitchPrimitive.Thumb\n\t\t\t\tdata-slot=\"switch-thumb\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground\n\t\t\t\t\tpointer-events-none absolute left-[calc(50%-1rem)] top-1/2 block size-4 -translate-y-1/2 rounded-full ring-0 transition-transform\n\t\t\t\t\tdata-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`,\n\t\t\t\t)}\n\t\t\t/>\n\t\t</SwitchPrimitive.Root>\n\t);\n}\n\nexport { Switch };\nexport type { SwitchProps };\n"],"mappings":";;;;;;;;;;;AASA,SAAS,OAAO,EAAE,WAAW,GAAG,SAAsB;CACrD,OACC,2CAACA,6BAAgB,MAAjB;EACC,aAAU;EACV,WAAWC,iBAGV;;;;;;;mGAQA,SACD;EACA,GAAI;YAEJ,2CAACD,6BAAgB,OAAjB;GACC,aAAU;GACV,WAAWC,iBACV;;gFAGD;EACA;CACoB;AAExB"}
|
|
@@ -9,14 +9,14 @@ import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
|
9
9
|
function Switch({ className, ...props }) {
|
|
10
10
|
return /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
11
11
|
"data-slot": "switch",
|
|
12
|
-
className: cn(`peer relative inline-flex h-
|
|
13
|
-
|
|
14
|
-
before:
|
|
12
|
+
className: cn(`peer relative inline-flex h-[1.15rem] w-8 shrink-0 items-center outline-none
|
|
13
|
+
after:absolute after:-inset-x-1.5 after:-inset-y-[0.675rem] after:content-[''] pointer-coarse:after:-inset-y-[0.8rem]
|
|
14
|
+
before:pointer-events-none before:absolute before:inset-0 before:rounded-full before:border
|
|
15
15
|
before:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]
|
|
16
16
|
data-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80
|
|
17
17
|
focus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50
|
|
18
|
-
transition-transform duration-
|
|
19
|
-
motion-reduce:transition-none
|
|
18
|
+
transition-transform duration-(--duration-moderate) ease-out motion-safe:active:not-data-disabled:scale-[0.96]
|
|
19
|
+
motion-reduce:transition-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-64`, className),
|
|
20
20
|
...props,
|
|
21
21
|
children: /* @__PURE__ */ jsx(Switch$1.Thumb, {
|
|
22
22
|
"data-slot": "switch-thumb",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","names":["SwitchPrimitive"],"sources":["../../src/components/switch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch';\n\nimport { cn } from '../lib/utils';\n\ntype SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root>;\n\nfunction Switch({ className, ...props }: SwitchProps) {\n\treturn (\n\t\t<SwitchPrimitive.Root\n\t\t\tdata-slot=\"switch\"\n\t\t\tclassName={cn(\n\t\t\t\t`peer relative inline-flex h-
|
|
1
|
+
{"version":3,"file":"switch.js","names":["SwitchPrimitive"],"sources":["../../src/components/switch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Switch as SwitchPrimitive } from '@base-ui/react/switch';\n\nimport { cn } from '../lib/utils';\n\ntype SwitchProps = React.ComponentProps<typeof SwitchPrimitive.Root>;\n\nfunction Switch({ className, ...props }: SwitchProps) {\n\treturn (\n\t\t<SwitchPrimitive.Root\n\t\t\tdata-slot=\"switch\"\n\t\t\tclassName={cn(\n\t\t\t\t// The box is the track itself (so a top-aligned switch lines up with the first label line); the 44x40\n\t\t\t\t// touch target is the `after` pseudo-element, the way Checkbox and Radio do it with `before`.\n\t\t\t\t`peer relative inline-flex h-[1.15rem] w-8 shrink-0 items-center outline-none\n\t\t\t\t\tafter:absolute after:-inset-x-1.5 after:-inset-y-[0.675rem] after:content-[''] pointer-coarse:after:-inset-y-[0.8rem]\n\t\t\t\t\tbefore:pointer-events-none before:absolute before:inset-0 before:rounded-full before:border\n\t\t\t\t\tbefore:border-transparent before:bg-input before:shadow-xs before:transition-[background-color,box-shadow]\n\t\t\t\t\tdata-[checked]:before:bg-primary dark:data-[unchecked]:before:bg-input/80\n\t\t\t\t\tfocus-visible:before:border-ring focus-visible:before:ring-[3px] focus-visible:before:ring-ring/50\n\t\t\t\t\ttransition-transform duration-(--duration-moderate) ease-out motion-safe:active:not-data-disabled:scale-[0.96]\n\t\t\t\t\tmotion-reduce:transition-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-64`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SwitchPrimitive.Thumb\n\t\t\t\tdata-slot=\"switch-thumb\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`bg-background dark:data-[unchecked]:bg-foreground dark:data-[checked]:bg-primary-foreground\n\t\t\t\t\tpointer-events-none absolute left-[calc(50%-1rem)] top-1/2 block size-4 -translate-y-1/2 rounded-full ring-0 transition-transform\n\t\t\t\t\tdata-[checked]:translate-x-[calc(100%-2px)] data-[unchecked]:translate-x-0`,\n\t\t\t\t)}\n\t\t\t/>\n\t\t</SwitchPrimitive.Root>\n\t);\n}\n\nexport { Switch };\nexport type { SwitchProps };\n"],"mappings":";;;;;;;;AASA,SAAS,OAAO,EAAE,WAAW,GAAG,SAAsB;CACrD,OACC,oBAACA,SAAgB,MAAjB;EACC,aAAU;EACV,WAAW,GAGV;;;;;;;mGAQA,SACD;EACA,GAAI;YAEJ,oBAACA,SAAgB,OAAjB;GACC,aAAU;GACV,WAAW,GACV;;gFAGD;EACA;CACoB;AAExB"}
|
|
@@ -26,7 +26,7 @@ function Table({ className, containerClassName, containerProps, ...props }) {
|
|
|
26
26
|
function TableHeader({ className, ...props }) {
|
|
27
27
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", {
|
|
28
28
|
"data-slot": "table-header",
|
|
29
|
-
className: require_utils.cn("bg-muted/
|
|
29
|
+
className: require_utils.cn("bg-muted/50 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent", className),
|
|
30
30
|
...props
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -40,35 +40,53 @@ function TableBody({ className, ...props }) {
|
|
|
40
40
|
function TableFooter({ className, ...props }) {
|
|
41
41
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tfoot", {
|
|
42
42
|
"data-slot": "table-footer",
|
|
43
|
-
className: require_utils.cn("border-t border-border
|
|
43
|
+
className: require_utils.cn("border-t border-border bg-muted/50 font-medium", "[&>tr]:border-b-0 [&>tr]:hover:bg-transparent", className),
|
|
44
44
|
...props
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function TableRow({ className, ...props }) {
|
|
48
48
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
49
49
|
"data-slot": "table-row",
|
|
50
|
-
className: require_utils.cn("border-b border-border
|
|
50
|
+
className: require_utils.cn("border-b border-border", "hover:bg-muted/40 data-[state=selected]:bg-muted", className),
|
|
51
51
|
...props
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Heading row for a group of body rows. Put each group in its own `TableBody`
|
|
56
|
+
* and this row first: the tint and `scope="rowgroup"` mark the break, so the
|
|
57
|
+
* hairlines between rows stay the same weight everywhere.
|
|
58
|
+
*/
|
|
59
|
+
function TableGroupRow({ colSpan, className, children, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
|
|
61
|
+
"data-slot": "table-group-row",
|
|
62
|
+
className: require_utils.cn("border-y border-border bg-muted/50", className),
|
|
63
|
+
...props,
|
|
64
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
65
|
+
scope: "rowgroup",
|
|
66
|
+
colSpan,
|
|
67
|
+
className: "h-9 px-4 text-start align-middle text-xs font-medium text-muted-foreground",
|
|
68
|
+
children
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
54
72
|
function TableHead({ className, ...props }) {
|
|
55
73
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
56
74
|
"data-slot": "table-head",
|
|
57
|
-
className: require_utils.cn("h-11 px-4 text-
|
|
75
|
+
className: require_utils.cn("h-11 px-4 text-start align-middle text-xs font-medium tracking-wide text-muted-foreground", "whitespace-nowrap", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-px", className),
|
|
58
76
|
...props
|
|
59
77
|
});
|
|
60
78
|
}
|
|
61
|
-
function TableCell({ className, ...props }) {
|
|
79
|
+
function TableCell({ className, truncate, ...props }) {
|
|
62
80
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
63
81
|
"data-slot": "table-cell",
|
|
64
|
-
className: require_utils.cn("px-4 py-3 align-middle whitespace-nowrap", "[&:has([role=checkbox])]:
|
|
82
|
+
className: require_utils.cn("px-4 py-3 align-middle whitespace-nowrap", "[&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-px", truncate && "max-w-0 truncate", className),
|
|
65
83
|
...props
|
|
66
84
|
});
|
|
67
85
|
}
|
|
68
86
|
function TableCaption({ className, ...props }) {
|
|
69
87
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("caption", {
|
|
70
88
|
"data-slot": "table-caption",
|
|
71
|
-
className: require_utils.cn("mt-3 text-pretty text-sm text-
|
|
89
|
+
className: require_utils.cn("mt-3 text-pretty text-sm text-subtle-foreground", className),
|
|
72
90
|
...props
|
|
73
91
|
});
|
|
74
92
|
}
|
|
@@ -79,6 +97,7 @@ exports.TableBody = TableBody;
|
|
|
79
97
|
exports.TableCaption = TableCaption;
|
|
80
98
|
exports.TableCell = TableCell;
|
|
81
99
|
exports.TableFooter = TableFooter;
|
|
100
|
+
exports.TableGroupRow = TableGroupRow;
|
|
82
101
|
exports.TableHead = TableHead;
|
|
83
102
|
exports.TableHeader = TableHeader;
|
|
84
103
|
exports.TableRow = TableRow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.cjs","names":["cn"],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype TableProps = React.ComponentProps<'table'> & {\n\t/** Classes for the horizontal scroll wrapper around the table */\n\tcontainerClassName?: string;\n\t/** Extra props for the scroll wrapper (e.g. ref, data attributes) */\n\tcontainerProps?: Omit<React.ComponentProps<'div'>, 'className' | 'children'>;\n};\n\n/**\n * Semantic table primitives. `Table` wraps the native element in an overflow\n * container so wide content scrolls without breaking page layout.\n */\nfunction Table({ className, containerClassName, containerProps, ...props }: TableProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"table-container\"\n\t\t\t{...containerProps}\n\t\t\tclassName={cn('relative w-full overflow-x-auto', containerClassName)}\n\t\t>\n\t\t\t<table\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tclassName={cn('w-full caption-bottom text-sm', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n\treturn (\n\t\t<thead\n\t\t\tdata-slot=\"table-header\"\n\t\t\tclassName={cn(\n\t\t\t\t// Quiet band under headers; kill row hover on thead\n\t\t\t\t'bg-muted/
|
|
1
|
+
{"version":3,"file":"table.cjs","names":["cn"],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype TableProps = React.ComponentProps<'table'> & {\n\t/** Classes for the horizontal scroll wrapper around the table */\n\tcontainerClassName?: string;\n\t/** Extra props for the scroll wrapper (e.g. ref, data attributes) */\n\tcontainerProps?: Omit<React.ComponentProps<'div'>, 'className' | 'children'>;\n};\n\n/**\n * Semantic table primitives. `Table` wraps the native element in an overflow\n * container so wide content scrolls without breaking page layout.\n */\nfunction Table({ className, containerClassName, containerProps, ...props }: TableProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"table-container\"\n\t\t\t{...containerProps}\n\t\t\tclassName={cn('relative w-full overflow-x-auto', containerClassName)}\n\t\t>\n\t\t\t<table\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tclassName={cn('w-full caption-bottom text-sm', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n\treturn (\n\t\t<thead\n\t\t\tdata-slot=\"table-header\"\n\t\t\tclassName={cn(\n\t\t\t\t// Quiet band under headers; kill row hover on thead\n\t\t\t\t'bg-muted/50 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n\treturn (\n\t\t<tbody\n\t\t\tdata-slot=\"table-body\"\n\t\t\tclassName={cn('[&_tr:last-child]:border-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n\treturn (\n\t\t<tfoot\n\t\t\tdata-slot=\"table-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t'border-t border-border bg-muted/50 font-medium',\n\t\t\t\t'[&>tr]:border-b-0 [&>tr]:hover:bg-transparent',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-row\"\n\t\t\tclassName={cn(\n\t\t\t\t'border-b border-border',\n\t\t\t\t'hover:bg-muted/40 data-[state=selected]:bg-muted',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype TableGroupRowProps = React.ComponentProps<'tr'> & {\n\t/** Columns the group heading spans; usually the table's column count. */\n\tcolSpan: number;\n};\n\n/**\n * Heading row for a group of body rows. Put each group in its own `TableBody`\n * and this row first: the tint and `scope=\"rowgroup\"` mark the break, so the\n * hairlines between rows stay the same weight everywhere.\n */\nfunction TableGroupRow({ colSpan, className, children, ...props }: TableGroupRowProps) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-group-row\"\n\t\t\tclassName={cn('border-y border-border bg-muted/50', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<th\n\t\t\t\tscope=\"rowgroup\"\n\t\t\t\tcolSpan={colSpan}\n\t\t\t\tclassName=\"h-9 px-4 text-start align-middle text-xs font-medium text-muted-foreground\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</th>\n\t\t</tr>\n\t);\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<'th'>) {\n\treturn (\n\t\t<th\n\t\t\tdata-slot=\"table-head\"\n\t\t\tclassName={cn(\n\t\t\t\t'h-11 px-4 text-start align-middle text-xs font-medium tracking-wide text-muted-foreground',\n\t\t\t\t'whitespace-nowrap',\n\t\t\t\t'[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-px',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype TableCellProps = React.ComponentProps<'td'> & {\n\t/**\n\t * Clip a long value with an ellipsis instead of letting it widen the whole column. The column takes the\n\t * width left over by its neighbours, so give those a width (or `w-px` for shrink-to-fit); add a `title`\n\t * with the full value, since the cell never wraps.\n\t */\n\ttruncate?: boolean;\n};\n\nfunction TableCell({ className, truncate, ...props }: TableCellProps) {\n\treturn (\n\t\t<td\n\t\t\tdata-slot=\"table-cell\"\n\t\t\tclassName={cn(\n\t\t\t\t'px-4 py-3 align-middle whitespace-nowrap',\n\t\t\t\t'[&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-px',\n\t\t\t\ttruncate && 'max-w-0 truncate',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n\treturn (\n\t\t<caption\n\t\t\tdata-slot=\"table-caption\"\n\t\t\tclassName={cn('mt-3 text-pretty text-sm text-subtle-foreground', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tTable,\n\tTableBody,\n\tTableCaption,\n\tTableCell,\n\tTableFooter,\n\tTableGroupRow,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n};\nexport type { TableCellProps, TableGroupRowProps, TableProps };\n"],"mappings":";;;;;;;;;;;;;AAeA,SAAS,MAAM,EAAE,WAAW,oBAAoB,gBAAgB,GAAG,SAAqB;CACvF,OACC,2CAAC,OAAD;EACC,aAAU;EACV,GAAI;EACJ,WAAWA,iBAAG,mCAAmC,kBAAkB;YAEnE,2CAAC,SAAD;GACC,aAAU;GACV,WAAWA,iBAAG,iCAAiC,SAAS;GACxD,GAAI;EACJ;CACG;AAEP;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAwC;CAC5E,OACC,2CAAC,SAAD;EACC,aAAU;EACV,WAAWA,iBAEV,uGACA,SACD;EACA,GAAI;CACJ;AAEH;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAwC;CAC1E,OACC,2CAAC,SAAD;EACC,aAAU;EACV,WAAWA,iBAAG,8BAA8B,SAAS;EACrD,GAAI;CACJ;AAEH;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAwC;CAC5E,OACC,2CAAC,SAAD;EACC,aAAU;EACV,WAAWA,iBACV,kDACA,iDACA,SACD;EACA,GAAI;CACJ;AAEH;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAAqC;CACtE,OACC,2CAAC,MAAD;EACC,aAAU;EACV,WAAWA,iBACV,0BACA,oDACA,SACD;EACA,GAAI;CACJ;AAEH;;;;;;AAYA,SAAS,cAAc,EAAE,SAAS,WAAW,UAAU,GAAG,SAA6B;CACtF,OACC,2CAAC,MAAD;EACC,aAAU;EACV,WAAWA,iBAAG,sCAAsC,SAAS;EAC7D,GAAI;YAEJ,2CAAC,MAAD;GACC,OAAM;GACG;GACT,WAAU;GAET;EACE;CACD;AAEN;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAqC;CACvE,OACC,2CAAC,MAAD;EACC,aAAU;EACV,WAAWA,iBACV,6FACA,qBACA,kGACA,SACD;EACA,GAAI;CACJ;AAEH;AAWA,SAAS,UAAU,EAAE,WAAW,UAAU,GAAG,SAAyB;CACrE,OACC,2CAAC,MAAD;EACC,aAAU;EACV,WAAWA,iBACV,4CACA,oEACA,YAAY,oBACZ,SACD;EACA,GAAI;CACJ;AAEH;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAA0C;CAC/E,OACC,2CAAC,WAAD;EACC,aAAU;EACV,WAAWA,iBAAG,mDAAmD,SAAS;EAC1E,GAAI;CACJ;AAEH"}
|
|
@@ -15,9 +15,27 @@ declare function TableHeader({ className, ...props }: React$1.ComponentProps<'th
|
|
|
15
15
|
declare function TableBody({ className, ...props }: React$1.ComponentProps<'tbody'>): React$1.JSX.Element;
|
|
16
16
|
declare function TableFooter({ className, ...props }: React$1.ComponentProps<'tfoot'>): React$1.JSX.Element;
|
|
17
17
|
declare function TableRow({ className, ...props }: React$1.ComponentProps<'tr'>): React$1.JSX.Element;
|
|
18
|
+
type TableGroupRowProps = React$1.ComponentProps<'tr'> & {
|
|
19
|
+
/** Columns the group heading spans; usually the table's column count. */
|
|
20
|
+
colSpan: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Heading row for a group of body rows. Put each group in its own `TableBody`
|
|
24
|
+
* and this row first: the tint and `scope="rowgroup"` mark the break, so the
|
|
25
|
+
* hairlines between rows stay the same weight everywhere.
|
|
26
|
+
*/
|
|
27
|
+
declare function TableGroupRow({ colSpan, className, children, ...props }: TableGroupRowProps): React$1.JSX.Element;
|
|
18
28
|
declare function TableHead({ className, ...props }: React$1.ComponentProps<'th'>): React$1.JSX.Element;
|
|
19
|
-
|
|
29
|
+
type TableCellProps = React$1.ComponentProps<'td'> & {
|
|
30
|
+
/**
|
|
31
|
+
* Clip a long value with an ellipsis instead of letting it widen the whole column. The column takes the
|
|
32
|
+
* width left over by its neighbours, so give those a width (or `w-px` for shrink-to-fit); add a `title`
|
|
33
|
+
* with the full value, since the cell never wraps.
|
|
34
|
+
*/
|
|
35
|
+
truncate?: boolean;
|
|
36
|
+
};
|
|
37
|
+
declare function TableCell({ className, truncate, ...props }: TableCellProps): React$1.JSX.Element;
|
|
20
38
|
declare function TableCaption({ className, ...props }: React$1.ComponentProps<'caption'>): React$1.JSX.Element;
|
|
21
39
|
//#endregion
|
|
22
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow };
|
|
40
|
+
export { Table, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableGroupRow, type TableGroupRowProps, TableHead, TableHeader, type TableProps, TableRow };
|
|
23
41
|
//# sourceMappingURL=table.d.cts.map
|
|
@@ -15,9 +15,27 @@ declare function TableHeader({ className, ...props }: React$1.ComponentProps<'th
|
|
|
15
15
|
declare function TableBody({ className, ...props }: React$1.ComponentProps<'tbody'>): React$1.JSX.Element;
|
|
16
16
|
declare function TableFooter({ className, ...props }: React$1.ComponentProps<'tfoot'>): React$1.JSX.Element;
|
|
17
17
|
declare function TableRow({ className, ...props }: React$1.ComponentProps<'tr'>): React$1.JSX.Element;
|
|
18
|
+
type TableGroupRowProps = React$1.ComponentProps<'tr'> & {
|
|
19
|
+
/** Columns the group heading spans; usually the table's column count. */
|
|
20
|
+
colSpan: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Heading row for a group of body rows. Put each group in its own `TableBody`
|
|
24
|
+
* and this row first: the tint and `scope="rowgroup"` mark the break, so the
|
|
25
|
+
* hairlines between rows stay the same weight everywhere.
|
|
26
|
+
*/
|
|
27
|
+
declare function TableGroupRow({ colSpan, className, children, ...props }: TableGroupRowProps): React$1.JSX.Element;
|
|
18
28
|
declare function TableHead({ className, ...props }: React$1.ComponentProps<'th'>): React$1.JSX.Element;
|
|
19
|
-
|
|
29
|
+
type TableCellProps = React$1.ComponentProps<'td'> & {
|
|
30
|
+
/**
|
|
31
|
+
* Clip a long value with an ellipsis instead of letting it widen the whole column. The column takes the
|
|
32
|
+
* width left over by its neighbours, so give those a width (or `w-px` for shrink-to-fit); add a `title`
|
|
33
|
+
* with the full value, since the cell never wraps.
|
|
34
|
+
*/
|
|
35
|
+
truncate?: boolean;
|
|
36
|
+
};
|
|
37
|
+
declare function TableCell({ className, truncate, ...props }: TableCellProps): React$1.JSX.Element;
|
|
20
38
|
declare function TableCaption({ className, ...props }: React$1.ComponentProps<'caption'>): React$1.JSX.Element;
|
|
21
39
|
//#endregion
|
|
22
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow };
|
|
40
|
+
export { Table, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableGroupRow, type TableGroupRowProps, TableHead, TableHeader, type TableProps, TableRow };
|
|
23
41
|
//# sourceMappingURL=table.d.ts.map
|
package/dist/components/table.js
CHANGED
|
@@ -23,7 +23,7 @@ function Table({ className, containerClassName, containerProps, ...props }) {
|
|
|
23
23
|
function TableHeader({ className, ...props }) {
|
|
24
24
|
return /* @__PURE__ */ jsx("thead", {
|
|
25
25
|
"data-slot": "table-header",
|
|
26
|
-
className: cn("bg-muted/
|
|
26
|
+
className: cn("bg-muted/50 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent", className),
|
|
27
27
|
...props
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -37,39 +37,57 @@ function TableBody({ className, ...props }) {
|
|
|
37
37
|
function TableFooter({ className, ...props }) {
|
|
38
38
|
return /* @__PURE__ */ jsx("tfoot", {
|
|
39
39
|
"data-slot": "table-footer",
|
|
40
|
-
className: cn("border-t border-border
|
|
40
|
+
className: cn("border-t border-border bg-muted/50 font-medium", "[&>tr]:border-b-0 [&>tr]:hover:bg-transparent", className),
|
|
41
41
|
...props
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
function TableRow({ className, ...props }) {
|
|
45
45
|
return /* @__PURE__ */ jsx("tr", {
|
|
46
46
|
"data-slot": "table-row",
|
|
47
|
-
className: cn("border-b border-border
|
|
47
|
+
className: cn("border-b border-border", "hover:bg-muted/40 data-[state=selected]:bg-muted", className),
|
|
48
48
|
...props
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Heading row for a group of body rows. Put each group in its own `TableBody`
|
|
53
|
+
* and this row first: the tint and `scope="rowgroup"` mark the break, so the
|
|
54
|
+
* hairlines between rows stay the same weight everywhere.
|
|
55
|
+
*/
|
|
56
|
+
function TableGroupRow({ colSpan, className, children, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
58
|
+
"data-slot": "table-group-row",
|
|
59
|
+
className: cn("border-y border-border bg-muted/50", className),
|
|
60
|
+
...props,
|
|
61
|
+
children: /* @__PURE__ */ jsx("th", {
|
|
62
|
+
scope: "rowgroup",
|
|
63
|
+
colSpan,
|
|
64
|
+
className: "h-9 px-4 text-start align-middle text-xs font-medium text-muted-foreground",
|
|
65
|
+
children
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}
|
|
51
69
|
function TableHead({ className, ...props }) {
|
|
52
70
|
return /* @__PURE__ */ jsx("th", {
|
|
53
71
|
"data-slot": "table-head",
|
|
54
|
-
className: cn("h-11 px-4 text-
|
|
72
|
+
className: cn("h-11 px-4 text-start align-middle text-xs font-medium tracking-wide text-muted-foreground", "whitespace-nowrap", "[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-px", className),
|
|
55
73
|
...props
|
|
56
74
|
});
|
|
57
75
|
}
|
|
58
|
-
function TableCell({ className, ...props }) {
|
|
76
|
+
function TableCell({ className, truncate, ...props }) {
|
|
59
77
|
return /* @__PURE__ */ jsx("td", {
|
|
60
78
|
"data-slot": "table-cell",
|
|
61
|
-
className: cn("px-4 py-3 align-middle whitespace-nowrap", "[&:has([role=checkbox])]:
|
|
79
|
+
className: cn("px-4 py-3 align-middle whitespace-nowrap", "[&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-px", truncate && "max-w-0 truncate", className),
|
|
62
80
|
...props
|
|
63
81
|
});
|
|
64
82
|
}
|
|
65
83
|
function TableCaption({ className, ...props }) {
|
|
66
84
|
return /* @__PURE__ */ jsx("caption", {
|
|
67
85
|
"data-slot": "table-caption",
|
|
68
|
-
className: cn("mt-3 text-pretty text-sm text-
|
|
86
|
+
className: cn("mt-3 text-pretty text-sm text-subtle-foreground", className),
|
|
69
87
|
...props
|
|
70
88
|
});
|
|
71
89
|
}
|
|
72
90
|
|
|
73
91
|
//#endregion
|
|
74
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
92
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableGroupRow, TableHead, TableHeader, TableRow };
|
|
75
93
|
//# sourceMappingURL=table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","names":[],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype TableProps = React.ComponentProps<'table'> & {\n\t/** Classes for the horizontal scroll wrapper around the table */\n\tcontainerClassName?: string;\n\t/** Extra props for the scroll wrapper (e.g. ref, data attributes) */\n\tcontainerProps?: Omit<React.ComponentProps<'div'>, 'className' | 'children'>;\n};\n\n/**\n * Semantic table primitives. `Table` wraps the native element in an overflow\n * container so wide content scrolls without breaking page layout.\n */\nfunction Table({ className, containerClassName, containerProps, ...props }: TableProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"table-container\"\n\t\t\t{...containerProps}\n\t\t\tclassName={cn('relative w-full overflow-x-auto', containerClassName)}\n\t\t>\n\t\t\t<table\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tclassName={cn('w-full caption-bottom text-sm', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n\treturn (\n\t\t<thead\n\t\t\tdata-slot=\"table-header\"\n\t\t\tclassName={cn(\n\t\t\t\t// Quiet band under headers; kill row hover on thead\n\t\t\t\t'bg-muted/
|
|
1
|
+
{"version":3,"file":"table.js","names":[],"sources":["../../src/components/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype TableProps = React.ComponentProps<'table'> & {\n\t/** Classes for the horizontal scroll wrapper around the table */\n\tcontainerClassName?: string;\n\t/** Extra props for the scroll wrapper (e.g. ref, data attributes) */\n\tcontainerProps?: Omit<React.ComponentProps<'div'>, 'className' | 'children'>;\n};\n\n/**\n * Semantic table primitives. `Table` wraps the native element in an overflow\n * container so wide content scrolls without breaking page layout.\n */\nfunction Table({ className, containerClassName, containerProps, ...props }: TableProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"table-container\"\n\t\t\t{...containerProps}\n\t\t\tclassName={cn('relative w-full overflow-x-auto', containerClassName)}\n\t\t>\n\t\t\t<table\n\t\t\t\tdata-slot=\"table\"\n\t\t\t\tclassName={cn('w-full caption-bottom text-sm', className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n\treturn (\n\t\t<thead\n\t\t\tdata-slot=\"table-header\"\n\t\t\tclassName={cn(\n\t\t\t\t// Quiet band under headers; kill row hover on thead\n\t\t\t\t'bg-muted/50 [&_tr]:border-b [&_tr]:hover:bg-transparent [&_tr]:data-[state=selected]:bg-transparent',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n\treturn (\n\t\t<tbody\n\t\t\tdata-slot=\"table-body\"\n\t\t\tclassName={cn('[&_tr:last-child]:border-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n\treturn (\n\t\t<tfoot\n\t\t\tdata-slot=\"table-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t'border-t border-border bg-muted/50 font-medium',\n\t\t\t\t'[&>tr]:border-b-0 [&>tr]:hover:bg-transparent',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-row\"\n\t\t\tclassName={cn(\n\t\t\t\t'border-b border-border',\n\t\t\t\t'hover:bg-muted/40 data-[state=selected]:bg-muted',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype TableGroupRowProps = React.ComponentProps<'tr'> & {\n\t/** Columns the group heading spans; usually the table's column count. */\n\tcolSpan: number;\n};\n\n/**\n * Heading row for a group of body rows. Put each group in its own `TableBody`\n * and this row first: the tint and `scope=\"rowgroup\"` mark the break, so the\n * hairlines between rows stay the same weight everywhere.\n */\nfunction TableGroupRow({ colSpan, className, children, ...props }: TableGroupRowProps) {\n\treturn (\n\t\t<tr\n\t\t\tdata-slot=\"table-group-row\"\n\t\t\tclassName={cn('border-y border-border bg-muted/50', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<th\n\t\t\t\tscope=\"rowgroup\"\n\t\t\t\tcolSpan={colSpan}\n\t\t\t\tclassName=\"h-9 px-4 text-start align-middle text-xs font-medium text-muted-foreground\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</th>\n\t\t</tr>\n\t);\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<'th'>) {\n\treturn (\n\t\t<th\n\t\t\tdata-slot=\"table-head\"\n\t\t\tclassName={cn(\n\t\t\t\t'h-11 px-4 text-start align-middle text-xs font-medium tracking-wide text-muted-foreground',\n\t\t\t\t'whitespace-nowrap',\n\t\t\t\t'[&:has([role=checkbox])]:w-px [&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-px',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\ntype TableCellProps = React.ComponentProps<'td'> & {\n\t/**\n\t * Clip a long value with an ellipsis instead of letting it widen the whole column. The column takes the\n\t * width left over by its neighbours, so give those a width (or `w-px` for shrink-to-fit); add a `title`\n\t * with the full value, since the cell never wraps.\n\t */\n\ttruncate?: boolean;\n};\n\nfunction TableCell({ className, truncate, ...props }: TableCellProps) {\n\treturn (\n\t\t<td\n\t\t\tdata-slot=\"table-cell\"\n\t\t\tclassName={cn(\n\t\t\t\t'px-4 py-3 align-middle whitespace-nowrap',\n\t\t\t\t'[&:has([role=checkbox])]:pe-0 [&>[role=checkbox]]:translate-y-px',\n\t\t\t\ttruncate && 'max-w-0 truncate',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n\treturn (\n\t\t<caption\n\t\t\tdata-slot=\"table-caption\"\n\t\t\tclassName={cn('mt-3 text-pretty text-sm text-subtle-foreground', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tTable,\n\tTableBody,\n\tTableCaption,\n\tTableCell,\n\tTableFooter,\n\tTableGroupRow,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n};\nexport type { TableCellProps, TableGroupRowProps, TableProps };\n"],"mappings":";;;;;;;;;;AAeA,SAAS,MAAM,EAAE,WAAW,oBAAoB,gBAAgB,GAAG,SAAqB;CACvF,OACC,oBAAC,OAAD;EACC,aAAU;EACV,GAAI;EACJ,WAAW,GAAG,mCAAmC,kBAAkB;YAEnE,oBAAC,SAAD;GACC,aAAU;GACV,WAAW,GAAG,iCAAiC,SAAS;GACxD,GAAI;EACJ;CACG;AAEP;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAwC;CAC5E,OACC,oBAAC,SAAD;EACC,aAAU;EACV,WAAW,GAEV,uGACA,SACD;EACA,GAAI;CACJ;AAEH;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAwC;CAC1E,OACC,oBAAC,SAAD;EACC,aAAU;EACV,WAAW,GAAG,8BAA8B,SAAS;EACrD,GAAI;CACJ;AAEH;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAwC;CAC5E,OACC,oBAAC,SAAD;EACC,aAAU;EACV,WAAW,GACV,kDACA,iDACA,SACD;EACA,GAAI;CACJ;AAEH;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAAqC;CACtE,OACC,oBAAC,MAAD;EACC,aAAU;EACV,WAAW,GACV,0BACA,oDACA,SACD;EACA,GAAI;CACJ;AAEH;;;;;;AAYA,SAAS,cAAc,EAAE,SAAS,WAAW,UAAU,GAAG,SAA6B;CACtF,OACC,oBAAC,MAAD;EACC,aAAU;EACV,WAAW,GAAG,sCAAsC,SAAS;EAC7D,GAAI;YAEJ,oBAAC,MAAD;GACC,OAAM;GACG;GACT,WAAU;GAET;EACE;CACD;AAEN;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAqC;CACvE,OACC,oBAAC,MAAD;EACC,aAAU;EACV,WAAW,GACV,6FACA,qBACA,kGACA,SACD;EACA,GAAI;CACJ;AAEH;AAWA,SAAS,UAAU,EAAE,WAAW,UAAU,GAAG,SAAyB;CACrE,OACC,oBAAC,MAAD;EACC,aAAU;EACV,WAAW,GACV,4CACA,oEACA,YAAY,oBACZ,SACD;EACA,GAAI;CACJ;AAEH;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAA0C;CAC/E,OACC,oBAAC,WAAD;EACC,aAAU;EACV,WAAW,GAAG,mDAAmD,SAAS;EAC1E,GAAI;CACJ;AAEH"}
|