@constructive-io/ui 0.12.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.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 +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 +2 -1
- package/dist/components/card.d.ts +2 -1
- 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.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 +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-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-B0wXxIAb.d.ts → index-CiO-3M_X.d.cts} +334 -18
- package/dist/{index-CyaFaZe2.d.cts → index-z3LqQ5L5.d.ts} +334 -18
- 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-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-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
|
@@ -0,0 +1,1477 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_rolldown_runtime = require('../../rolldown-runtime-D_qnwXdH.cjs');
|
|
4
|
+
const require_utils = require('../../utils-CzTQ3-VI.cjs');
|
|
5
|
+
const require_initials = require('../../initials-DSkWTOb0.cjs');
|
|
6
|
+
const require_sheet = require('../../sheet-OxWlnT_G.cjs');
|
|
7
|
+
const require_components_tooltip = require('../tooltip.cjs');
|
|
8
|
+
const require_components_dropdown_menu = require('../dropdown-menu.cjs');
|
|
9
|
+
const require_use_scroll_fade = require('../../use-scroll-fade-CaHp52u4.cjs');
|
|
10
|
+
let react = require("react");
|
|
11
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
12
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
|
+
let lucide_react = require("lucide-react");
|
|
14
|
+
let _base_ui_react_direction_provider = require("@base-ui/react/direction-provider");
|
|
15
|
+
let motion_react_animate_view = require("motion/react-animate-view");
|
|
16
|
+
|
|
17
|
+
//#region src/components/workspace-kit/shell.tsx
|
|
18
|
+
const WorkspaceShellContext = react.createContext({ openNav: () => {} });
|
|
19
|
+
/** The enclosing workspace shell. Outside one, `openNav` is a no-op. */
|
|
20
|
+
function useWorkspaceShell() {
|
|
21
|
+
return react.useContext(WorkspaceShellContext);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Workspace layout shared by the application templates: a collapsible sidebar
|
|
25
|
+
* rail beside the main region, a left drawer below the `3xl` container width,
|
|
26
|
+
* a skip link, and one tooltip provider. The root is the `ws` container, so
|
|
27
|
+
* every view sizes itself to the space it is given rather than the viewport.
|
|
28
|
+
*/
|
|
29
|
+
function WorkspaceShell({ sidebar, children, slot = "workspace-shell", defaultSidebarCollapsed = false, framed = false, className }) {
|
|
30
|
+
const [collapsed, setCollapsed] = react.useState(defaultSidebarCollapsed);
|
|
31
|
+
const [navOpen, setNavOpen] = react.useState(false);
|
|
32
|
+
const mainId = react.useId();
|
|
33
|
+
const context = react.useMemo(() => ({ openNav: () => setNavOpen(true) }), []);
|
|
34
|
+
const closeNav = react.useCallback(() => setNavOpen(false), []);
|
|
35
|
+
const shell = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
36
|
+
"data-slot": slot,
|
|
37
|
+
"data-framed": framed || void 0,
|
|
38
|
+
className: require_utils.cn("@container/ws relative flex h-full min-h-0 w-full overflow-hidden bg-background text-foreground", framed ? "min-w-0 flex-1 rounded-xl border border-border shadow-xs" : className),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
41
|
+
href: `#${mainId}`,
|
|
42
|
+
className: "sr-only z-50 rounded-md bg-card px-3 py-2 text-sm shadow-card focus:not-sr-only focus:absolute focus:top-2 focus:start-2",
|
|
43
|
+
children: "Skip to main content"
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46
|
+
className: "hidden h-full @3xl/ws:flex",
|
|
47
|
+
children: sidebar({
|
|
48
|
+
mode: "rail",
|
|
49
|
+
collapsed,
|
|
50
|
+
onCollapsedChange: setCollapsed,
|
|
51
|
+
onNavigate: () => {}
|
|
52
|
+
})
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("main", {
|
|
55
|
+
id: mainId,
|
|
56
|
+
tabIndex: -1,
|
|
57
|
+
className: "@container/view flex min-w-0 flex-1 outline-none",
|
|
58
|
+
children
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkspaceShellContext.Provider, {
|
|
63
|
+
value: context,
|
|
64
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_tooltip.TooltipProvider, { children: [framed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
65
|
+
"data-slot": "workspace-canvas",
|
|
66
|
+
className: require_utils.cn("flex h-full min-h-0 w-full bg-[color-mix(in_oklab,var(--background),var(--foreground)_6%)] p-2 sm:p-3", "dark:bg-[color-mix(in_oklab,var(--background),black_35%)]", className),
|
|
67
|
+
children: shell
|
|
68
|
+
}) : shell, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sheet.Sheet, {
|
|
69
|
+
open: navOpen,
|
|
70
|
+
onOpenChange: setNavOpen,
|
|
71
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_sheet.SheetContent, {
|
|
72
|
+
side: "left",
|
|
73
|
+
showClose: false,
|
|
74
|
+
className: "w-72 max-w-[85vw] gap-0 p-0 sm:max-w-72",
|
|
75
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_sheet.SheetTitle, {
|
|
76
|
+
className: "sr-only",
|
|
77
|
+
children: "Navigation"
|
|
78
|
+
}), sidebar({
|
|
79
|
+
mode: "drawer",
|
|
80
|
+
collapsed: false,
|
|
81
|
+
onCollapsedChange: setCollapsed,
|
|
82
|
+
onNavigate: closeNav
|
|
83
|
+
})]
|
|
84
|
+
})
|
|
85
|
+
})] })
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/components/workspace-kit/primitives.tsx
|
|
91
|
+
/** Tactile press for custom controls: 0.96, never lower. */
|
|
92
|
+
const pressClass = "transition-transform duration-(--duration-fast) ease-out motion-safe:active:scale-[0.96]";
|
|
93
|
+
/** Grows a small control's hit area to at least 40px without changing its box. */
|
|
94
|
+
const hitAreaClass = "relative before:absolute before:-inset-2 before:content-[''] pointer-coarse:before:-inset-2.5";
|
|
95
|
+
const focusRingClass = "outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50";
|
|
96
|
+
const ICON_BUTTON_VARIANT = {
|
|
97
|
+
ghost: "text-muted-foreground hover:bg-overlay-hover hover:text-foreground",
|
|
98
|
+
raised: "bg-card text-foreground shadow-card hover:bg-muted"
|
|
99
|
+
};
|
|
100
|
+
const ICON_BUTTON_SIZE = {
|
|
101
|
+
sm: "size-6",
|
|
102
|
+
md: "size-7",
|
|
103
|
+
lg: "size-8"
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Icon-only button with a matching tooltip and accessible name. Hover state is
|
|
107
|
+
* instant; press scales to 0.96.
|
|
108
|
+
*/
|
|
109
|
+
function TooltipIconButton({ label, side = "top", variant = "ghost", size = "md", extendHitArea = true, className, children, ...props }) {
|
|
110
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_tooltip.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipTrigger, { render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
111
|
+
type: "button",
|
|
112
|
+
"aria-label": label,
|
|
113
|
+
className: require_utils.cn("grid shrink-0 cursor-pointer place-items-center rounded-md disabled:cursor-not-allowed disabled:opacity-40", ICON_BUTTON_VARIANT[variant], ICON_BUTTON_SIZE[size], pressClass, focusRingClass, extendHitArea && "relative before:absolute before:-inset-2 before:content-[''] pointer-coarse:before:-inset-2.5", className),
|
|
114
|
+
...props,
|
|
115
|
+
children
|
|
116
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipContent, {
|
|
117
|
+
side,
|
|
118
|
+
children: label
|
|
119
|
+
})] });
|
|
120
|
+
}
|
|
121
|
+
/** CSS colour for each non-neutral tone, for tints mixed at runtime. */
|
|
122
|
+
const TONE_COLOR = {
|
|
123
|
+
primary: "var(--primary)",
|
|
124
|
+
warning: "var(--warning)",
|
|
125
|
+
violet: "var(--chart-3)",
|
|
126
|
+
amber: "var(--chart-4)",
|
|
127
|
+
success: "var(--success)",
|
|
128
|
+
danger: "var(--destructive)",
|
|
129
|
+
info: "var(--info)"
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Tone fills mixed from `--tone`. On a white page the fill carries the colour and the
|
|
133
|
+
* border only defines the edge; dark keeps a fainter fill under a stronger border.
|
|
134
|
+
*/
|
|
135
|
+
const toneBadgeClass = require_utils.cn("border-[color-mix(in_oklab,var(--tone)_25%,transparent)] bg-[color-mix(in_oklab,var(--tone)_14%,transparent)]", "text-[color-mix(in_oklab,var(--tone),var(--foreground)_32%)]", "dark:border-[color-mix(in_oklab,var(--tone)_35%,transparent)] dark:bg-[color-mix(in_oklab,var(--tone)_9%,transparent)]");
|
|
136
|
+
/** Small tinted label. Clickable when `onClick` is set. */
|
|
137
|
+
function ToneBadge({ tone, children, onClick, className }) {
|
|
138
|
+
const color = tone === "neutral" ? null : TONE_COLOR[tone];
|
|
139
|
+
const props = {
|
|
140
|
+
className: require_utils.cn("inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-[5px] border px-1.5 text-xs [&_svg]:size-3", color ? toneBadgeClass : "border-border bg-muted/60 text-muted-foreground", onClick && require_utils.cn("cursor-pointer", "transition-transform duration-(--duration-fast) ease-out motion-safe:active:scale-[0.96]", "outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"), className),
|
|
141
|
+
style: color ? { "--tone": color } : void 0
|
|
142
|
+
};
|
|
143
|
+
return onClick ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
144
|
+
type: "button",
|
|
145
|
+
onClick,
|
|
146
|
+
...props,
|
|
147
|
+
children
|
|
148
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
149
|
+
...props,
|
|
150
|
+
children
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** Compact search input with a leading glyph and a visually hidden label. */
|
|
154
|
+
function SearchField({ label, trailing, inputRef, className, ...props }) {
|
|
155
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
156
|
+
className: require_utils.cn("flex h-7 items-center gap-2 rounded-md border border-border bg-card px-2 shadow-2xs focus-within:ring-[3px] focus-within:ring-ring/50", className),
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Search, {
|
|
159
|
+
"aria-hidden": "true",
|
|
160
|
+
className: "size-3.5 shrink-0 text-muted-foreground"
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
163
|
+
className: "sr-only",
|
|
164
|
+
children: label
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
167
|
+
ref: inputRef,
|
|
168
|
+
type: "search",
|
|
169
|
+
className: "min-w-0 flex-1 bg-transparent text-[0.8125rem] text-foreground outline-none placeholder:text-subtle-foreground pointer-coarse:text-base [&::-webkit-search-cancel-button]:hidden",
|
|
170
|
+
...props
|
|
171
|
+
}),
|
|
172
|
+
trailing
|
|
173
|
+
]
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/** Opens the navigation drawer; only rendered below the sidebar breakpoint. */
|
|
177
|
+
function NavMenuButton() {
|
|
178
|
+
const { openNav } = useWorkspaceShell();
|
|
179
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipIconButton, {
|
|
180
|
+
label: "Open navigation",
|
|
181
|
+
side: "bottom",
|
|
182
|
+
className: "-ms-1 text-foreground @3xl/ws:hidden",
|
|
183
|
+
onClick: openNav,
|
|
184
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Menu, {
|
|
185
|
+
"aria-hidden": "true",
|
|
186
|
+
className: "size-4"
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* View header at least 48px tall: icon and title on the left, actions on the
|
|
192
|
+
* right. The title keeps a floor of 8rem, so on a narrow view the actions wrap
|
|
193
|
+
* onto a second row instead of squeezing it to an ellipsis.
|
|
194
|
+
*/
|
|
195
|
+
function ViewHeader({ icon: Icon, title, children, divider = true }) {
|
|
196
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
197
|
+
className: require_utils.cn("flex min-h-12 shrink-0 flex-wrap content-center items-center gap-x-2 gap-y-1 px-3 py-1.5", divider && "border-b border-border"),
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavMenuButton, {}),
|
|
200
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
201
|
+
className: "flex min-w-0 flex-1 basis-32 items-center gap-1.5",
|
|
202
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
203
|
+
"aria-hidden": "true",
|
|
204
|
+
className: "hidden size-3.5 shrink-0 text-muted-foreground @3xl/ws:block"
|
|
205
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
|
|
206
|
+
title: typeof title === "string" ? title : void 0,
|
|
207
|
+
className: "truncate text-sm font-medium text-foreground",
|
|
208
|
+
children: title
|
|
209
|
+
})]
|
|
210
|
+
}),
|
|
211
|
+
children ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
212
|
+
className: "ms-auto flex shrink-0 items-center gap-2",
|
|
213
|
+
children
|
|
214
|
+
}) : null
|
|
215
|
+
]
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* A full view: the 48px header over a scrolling, centred content column with
|
|
220
|
+
* container-relative padding. Views keep their own scroll so the sidebar
|
|
221
|
+
* never moves.
|
|
222
|
+
*/
|
|
223
|
+
function ViewFrame({ icon, title, actions, label, maxWidth = "max-w-6xl", className, children }) {
|
|
224
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
225
|
+
"aria-label": label ?? (typeof title === "string" ? title : void 0),
|
|
226
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
227
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ViewHeader, {
|
|
228
|
+
icon,
|
|
229
|
+
title,
|
|
230
|
+
children: actions
|
|
231
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
232
|
+
className: "min-h-0 flex-1 overflow-y-auto",
|
|
233
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
234
|
+
className: require_utils.cn("mx-auto flex w-full flex-col gap-6 px-4 py-5 @3xl/view:px-6 @3xl/view:py-6", maxWidth, className),
|
|
235
|
+
children
|
|
236
|
+
})
|
|
237
|
+
})]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Sideways-scrolling row whose children keep their shadows. A scroll container
|
|
242
|
+
* clips everything outside its padding box, which would shave the ring and
|
|
243
|
+
* drop shadow off raised children; the matching negative margin and padding
|
|
244
|
+
* give them room without moving the row.
|
|
245
|
+
*/
|
|
246
|
+
const scrollRowClass = "-m-2 overflow-x-auto p-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
247
|
+
/** Single-choice filter pills with optional counts; scrolls sideways when narrow. */
|
|
248
|
+
function FilterGroup({ label, value, options, onChange, compact = false, className, rootClassName, locale }) {
|
|
249
|
+
const rtl = (0, _base_ui_react_direction_provider.useDirection)() === "rtl";
|
|
250
|
+
const { ref, style } = require_use_scroll_fade.useScrollFade();
|
|
251
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
252
|
+
ref,
|
|
253
|
+
style,
|
|
254
|
+
className: require_utils.cn(scrollRowClass, "min-w-0", rootClassName),
|
|
255
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
256
|
+
role: "radiogroup",
|
|
257
|
+
"aria-label": label,
|
|
258
|
+
className: require_utils.cn("flex w-max gap-1", className),
|
|
259
|
+
children: options.map((option, index) => {
|
|
260
|
+
const active = value === option.value;
|
|
261
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
262
|
+
type: "button",
|
|
263
|
+
role: "radio",
|
|
264
|
+
"aria-checked": active,
|
|
265
|
+
tabIndex: active ? 0 : -1,
|
|
266
|
+
onKeyDown: (event) => {
|
|
267
|
+
const nextIndex = event.key === "Home" ? 0 : event.key === "End" ? options.length - 1 : event.key === (rtl ? "ArrowLeft" : "ArrowRight") || event.key === "ArrowDown" ? (index + 1) % options.length : event.key === (rtl ? "ArrowRight" : "ArrowLeft") || event.key === "ArrowUp" ? (index - 1 + options.length) % options.length : void 0;
|
|
268
|
+
if (nextIndex === void 0) return;
|
|
269
|
+
event.preventDefault();
|
|
270
|
+
event.currentTarget.parentElement?.querySelectorAll("[role=\"radio\"]")[nextIndex]?.focus();
|
|
271
|
+
onChange(options[nextIndex].value);
|
|
272
|
+
},
|
|
273
|
+
onClick: () => onChange(option.value),
|
|
274
|
+
className: require_utils.cn("inline-flex h-7 shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2 text-[0.8125rem] pointer-coarse:h-9", pressClass, focusRingClass, active ? "bg-card font-medium text-foreground shadow-card" : "text-muted-foreground hover:text-foreground"),
|
|
275
|
+
children: [
|
|
276
|
+
option.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(option.icon, {
|
|
277
|
+
"aria-hidden": "true",
|
|
278
|
+
className: "size-3.5 shrink-0"
|
|
279
|
+
}) : null,
|
|
280
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
281
|
+
className: compact && option.icon ? "sr-only @md/view:not-sr-only" : void 0,
|
|
282
|
+
children: option.label
|
|
283
|
+
}),
|
|
284
|
+
option.count === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
285
|
+
className: require_utils.cn("text-xs tabular-nums", active ? "text-muted-foreground" : "text-subtle-foreground"),
|
|
286
|
+
children: require_initials.formatCount(option.count, locale)
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
}, option.value);
|
|
290
|
+
})
|
|
291
|
+
})
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Two-to-four option segmented control. The track has a 6px radius and 2px
|
|
296
|
+
* padding, so each segment is 4px (concentric with the track).
|
|
297
|
+
*/
|
|
298
|
+
function Segmented({ label, value, options, onChange, className }) {
|
|
299
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
300
|
+
role: "radiogroup",
|
|
301
|
+
"aria-label": label,
|
|
302
|
+
className: require_utils.cn("flex gap-0.5 rounded-sm bg-muted p-0.5", className),
|
|
303
|
+
children: options.map((option) => {
|
|
304
|
+
const Icon = option.icon;
|
|
305
|
+
const active = value === option.value;
|
|
306
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
307
|
+
type: "button",
|
|
308
|
+
role: "radio",
|
|
309
|
+
"aria-checked": active,
|
|
310
|
+
"aria-label": Icon ? option.label : void 0,
|
|
311
|
+
onClick: () => onChange(option.value),
|
|
312
|
+
className: require_utils.cn("grid h-7 flex-1 cursor-pointer place-items-center whitespace-nowrap rounded-[4px] px-2 text-[0.8125rem]", pressClass, focusRingClass, active ? "bg-card font-medium text-foreground shadow-card" : "text-muted-foreground hover:text-foreground"),
|
|
313
|
+
children: Icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
314
|
+
"aria-hidden": "true",
|
|
315
|
+
className: "size-3.5"
|
|
316
|
+
}) : option.label
|
|
317
|
+
}, option.value);
|
|
318
|
+
})
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Card surfaces whose full-bleed children (tinted strips, sticky columns,
|
|
323
|
+
* table heads, canvas grids) must not cover the edge. `shadow-card` draws its
|
|
324
|
+
* edge as an inset shadow in both modes, which keeps it safe from any clipping
|
|
325
|
+
* ancestor but paints it beneath children, so the surface gets a 1px inset and
|
|
326
|
+
* every child lives in `SurfaceBody`.
|
|
327
|
+
*/
|
|
328
|
+
const surfaceInsetClass = "overflow-hidden p-px";
|
|
329
|
+
function SurfaceBody({ className, children, ...props }) {
|
|
330
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
331
|
+
className: require_utils.cn("relative h-full overflow-hidden rounded-[inherit]", className),
|
|
332
|
+
...props,
|
|
333
|
+
children
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
/** Staggered entrance for a column of blocks: each child waits `step` ms longer. */
|
|
337
|
+
function staggerStyle(index, step = 80) {
|
|
338
|
+
return { animationDelay: `${index * step}ms` };
|
|
339
|
+
}
|
|
340
|
+
const enterClass = "animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] motion-reduce:animate-none";
|
|
341
|
+
/**
|
|
342
|
+
* Ref that toggles the DOM `inert` property. React 18 has no `inert` prop and
|
|
343
|
+
* React 19 treats it as boolean, so setting the property works on both.
|
|
344
|
+
*/
|
|
345
|
+
function useInert(inert) {
|
|
346
|
+
return react.useCallback((node) => {
|
|
347
|
+
if (node) node.inert = inert;
|
|
348
|
+
}, [inert]);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/components/workspace-kit/reduced-motion.ts
|
|
353
|
+
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
354
|
+
function prefersReducedMotion() {
|
|
355
|
+
return typeof window !== "undefined" && Boolean(window.matchMedia?.(REDUCED_MOTION_QUERY).matches);
|
|
356
|
+
}
|
|
357
|
+
function subscribeReducedMotion(onChange) {
|
|
358
|
+
const query = typeof window === "undefined" ? void 0 : window.matchMedia?.(REDUCED_MOTION_QUERY);
|
|
359
|
+
query?.addEventListener("change", onChange);
|
|
360
|
+
return () => query?.removeEventListener("change", onChange);
|
|
361
|
+
}
|
|
362
|
+
/** Reduced-motion preference that renders `false` on the server and hydrates without a mismatch. */
|
|
363
|
+
function useReducedMotion() {
|
|
364
|
+
return react.useSyncExternalStore(subscribeReducedMotion, prefersReducedMotion, () => false);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region src/components/workspace-kit/canvas.tsx
|
|
369
|
+
const ZOOM_STEP = .25;
|
|
370
|
+
const DEFAULT_INSET = {
|
|
371
|
+
side: 24,
|
|
372
|
+
top: 64,
|
|
373
|
+
bottom: 68
|
|
374
|
+
};
|
|
375
|
+
const EASE = {
|
|
376
|
+
pan: "240ms cubic-bezier(0.5, 0, 0.1, 1)",
|
|
377
|
+
reveal: "600ms cubic-bezier(0.32, 0, 0.08, 1)"
|
|
378
|
+
};
|
|
379
|
+
/** Elements marked with this attribute (and native controls) never start a pan or swallow wheel scrolling. */
|
|
380
|
+
const NO_PAN_ATTRIBUTE = "data-no-pan";
|
|
381
|
+
/** Nodes that handle their own presses (select, drag) but still let the wheel pan and zoom over them. */
|
|
382
|
+
const CANVAS_NODE_ATTRIBUTE = "data-canvas-node";
|
|
383
|
+
const NO_PAN_SELECTOR = `button, a, input, textarea, select, [${NO_PAN_ATTRIBUTE}], [${CANVAS_NODE_ATTRIBUTE}]`;
|
|
384
|
+
function zoomAround(view, zoom, cx, cy) {
|
|
385
|
+
const px = (cx - view.x) / view.zoom;
|
|
386
|
+
const py = (cy - view.y) / view.zoom;
|
|
387
|
+
return {
|
|
388
|
+
zoom,
|
|
389
|
+
x: cx - px * zoom,
|
|
390
|
+
y: cy - py * zoom
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Pan and zoom state for a canvas: drag, pinch, wheel, ctrl/⌘-wheel,
|
|
395
|
+
* keyboard, and zoom buttons, plus `reveal` to ease a node into view and
|
|
396
|
+
* `fit` to frame the content again. The view keeps fitting its container
|
|
397
|
+
* until the person pans or zooms. Transitions are skipped while dragging so
|
|
398
|
+
* the canvas tracks the pointer 1:1.
|
|
399
|
+
*/
|
|
400
|
+
function useCanvasViewport(contentWidth, options = {}) {
|
|
401
|
+
const { fit: fitMode = "width", contentHeight = 0, minZoom = .5, maxZoom = 2 } = options;
|
|
402
|
+
const minFitZoom = options.minFitZoom ?? minZoom;
|
|
403
|
+
const originX = options.contentOrigin?.x ?? 0;
|
|
404
|
+
const originY = options.contentOrigin?.y ?? 0;
|
|
405
|
+
const { side, top, bottom } = options.inset ?? DEFAULT_INSET;
|
|
406
|
+
const viewportRef = react.useRef(null);
|
|
407
|
+
const [element, setElement] = react.useState(null);
|
|
408
|
+
const attach = react.useCallback((node) => {
|
|
409
|
+
viewportRef.current = node;
|
|
410
|
+
setElement(node);
|
|
411
|
+
}, []);
|
|
412
|
+
/** Active pointers by id; one drags, two pinch. */
|
|
413
|
+
const pointers = react.useRef(/* @__PURE__ */ new Map());
|
|
414
|
+
const gesture = react.useRef(null);
|
|
415
|
+
const [view, setView] = react.useState({
|
|
416
|
+
x: side,
|
|
417
|
+
y: top,
|
|
418
|
+
zoom: 1
|
|
419
|
+
});
|
|
420
|
+
const [transition, setTransition] = react.useState("none");
|
|
421
|
+
const [dragging, setDragging] = react.useState(false);
|
|
422
|
+
const viewRef = react.useRef(view);
|
|
423
|
+
react.useLayoutEffect(() => {
|
|
424
|
+
viewRef.current = view;
|
|
425
|
+
});
|
|
426
|
+
/** Set once the person pans or zooms; until then the view keeps fitting its container. */
|
|
427
|
+
const touched = react.useRef(false);
|
|
428
|
+
/** Whether the last press moved far enough to count as a pan rather than a click. */
|
|
429
|
+
const panned = react.useRef(false);
|
|
430
|
+
const clampZoom = react.useCallback((zoom) => Math.min(maxZoom, Math.max(minZoom, zoom)), [maxZoom, minZoom]);
|
|
431
|
+
const place = react.useCallback((update, ease) => {
|
|
432
|
+
setTransition(ease && !prefersReducedMotion() ? EASE[ease] : "none");
|
|
433
|
+
setView(update);
|
|
434
|
+
}, []);
|
|
435
|
+
const move = react.useCallback((update, ease) => {
|
|
436
|
+
touched.current = true;
|
|
437
|
+
place(update, ease);
|
|
438
|
+
}, [place]);
|
|
439
|
+
const fitted = react.useCallback(() => {
|
|
440
|
+
const viewport = viewportRef.current;
|
|
441
|
+
if (!viewport || viewport.clientWidth === 0 || contentWidth === 0) return null;
|
|
442
|
+
const width = viewport.clientWidth;
|
|
443
|
+
const availableWidth = width - side * 2;
|
|
444
|
+
if (fitMode === "width") {
|
|
445
|
+
const zoom = Math.max(minZoom, Math.min(1, Math.floor(availableWidth / contentWidth * 20) / 20));
|
|
446
|
+
return {
|
|
447
|
+
x: Math.max(side, Math.round((width - contentWidth * zoom) / 2)) - originX * zoom,
|
|
448
|
+
y: top - originY * zoom,
|
|
449
|
+
zoom
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
const availableHeight = viewport.clientHeight - top - bottom;
|
|
453
|
+
const fitZoom = Math.min(1, availableWidth / contentWidth, contentHeight ? availableHeight / contentHeight : 1);
|
|
454
|
+
const zoom = Math.max(minFitZoom, Math.floor(fitZoom * 20) / 20);
|
|
455
|
+
return {
|
|
456
|
+
x: Math.max(side, Math.round((width - contentWidth * zoom) / 2)) - originX * zoom,
|
|
457
|
+
y: Math.round(top + Math.max(0, (availableHeight - contentHeight * zoom) / 2) - originY * zoom),
|
|
458
|
+
zoom
|
|
459
|
+
};
|
|
460
|
+
}, [
|
|
461
|
+
bottom,
|
|
462
|
+
contentHeight,
|
|
463
|
+
contentWidth,
|
|
464
|
+
fitMode,
|
|
465
|
+
minFitZoom,
|
|
466
|
+
minZoom,
|
|
467
|
+
originX,
|
|
468
|
+
originY,
|
|
469
|
+
side,
|
|
470
|
+
top
|
|
471
|
+
]);
|
|
472
|
+
const refit = react.useCallback((ease) => {
|
|
473
|
+
if (touched.current) return;
|
|
474
|
+
const next = fitted();
|
|
475
|
+
if (next) place(() => next, ease);
|
|
476
|
+
}, [fitted, place]);
|
|
477
|
+
const latestRefit = react.useRef(refit);
|
|
478
|
+
const fittedElement = react.useRef(null);
|
|
479
|
+
react.useLayoutEffect(() => {
|
|
480
|
+
latestRefit.current = refit;
|
|
481
|
+
if (element) refit(fittedElement.current === element ? "reveal" : null);
|
|
482
|
+
fittedElement.current = element;
|
|
483
|
+
}, [element, refit]);
|
|
484
|
+
react.useLayoutEffect(() => {
|
|
485
|
+
if (!element) return;
|
|
486
|
+
let size = [element.clientWidth, element.clientHeight];
|
|
487
|
+
const observer = new ResizeObserver(() => {
|
|
488
|
+
if (size[0] === element.clientWidth && size[1] === element.clientHeight) return;
|
|
489
|
+
size = [element.clientWidth, element.clientHeight];
|
|
490
|
+
latestRefit.current(null);
|
|
491
|
+
});
|
|
492
|
+
observer.observe(element);
|
|
493
|
+
return () => observer.disconnect();
|
|
494
|
+
}, [element]);
|
|
495
|
+
/** Keeps the current view and stops fitting, as a pan would; for edits the person makes to the content. */
|
|
496
|
+
const hold = react.useCallback(() => {
|
|
497
|
+
touched.current = true;
|
|
498
|
+
}, []);
|
|
499
|
+
/** Frames the content again and resumes fitting on resize. */
|
|
500
|
+
const fit = react.useCallback(() => {
|
|
501
|
+
const next = fitted();
|
|
502
|
+
if (!next) return;
|
|
503
|
+
touched.current = false;
|
|
504
|
+
place(() => next, "pan");
|
|
505
|
+
}, [fitted, place]);
|
|
506
|
+
const zoomTo = react.useCallback((zoom) => {
|
|
507
|
+
const viewport = viewportRef.current;
|
|
508
|
+
if (!viewport) return;
|
|
509
|
+
move((current) => zoomAround(current, clampZoom(zoom), viewport.clientWidth / 2, viewport.clientHeight / 2), "pan");
|
|
510
|
+
}, [clampZoom, move]);
|
|
511
|
+
/**
|
|
512
|
+
* Eases the view just enough to bring a node inside the canvas margins.
|
|
513
|
+
* Pass a `CanvasBox` for a node that is still moving to where it will settle.
|
|
514
|
+
*/
|
|
515
|
+
const reveal = react.useCallback((target) => {
|
|
516
|
+
const viewport = viewportRef.current;
|
|
517
|
+
if (!viewport) return;
|
|
518
|
+
const frame = viewport.getBoundingClientRect();
|
|
519
|
+
const { x, y, zoom } = viewRef.current;
|
|
520
|
+
const rect = target instanceof Element ? target.getBoundingClientRect() : {
|
|
521
|
+
left: frame.left + x + target.x * zoom,
|
|
522
|
+
top: frame.top + y + target.y * zoom,
|
|
523
|
+
right: frame.left + x + (target.x + target.width) * zoom,
|
|
524
|
+
bottom: frame.top + y + (target.y + target.height) * zoom
|
|
525
|
+
};
|
|
526
|
+
let dx = 0;
|
|
527
|
+
let dy = 0;
|
|
528
|
+
if (rect.right > frame.right - side) dx = frame.right - side - rect.right;
|
|
529
|
+
if (rect.left + dx < frame.left + side) dx = frame.left + side - rect.left;
|
|
530
|
+
if (rect.bottom > frame.bottom - bottom) dy = frame.bottom - bottom - rect.bottom;
|
|
531
|
+
if (rect.top + dy < frame.top + side) dy = frame.top + side - rect.top;
|
|
532
|
+
if (dx || dy) place((current) => ({
|
|
533
|
+
...current,
|
|
534
|
+
x: current.x + dx,
|
|
535
|
+
y: current.y + dy
|
|
536
|
+
}), "reveal");
|
|
537
|
+
}, [
|
|
538
|
+
bottom,
|
|
539
|
+
place,
|
|
540
|
+
side
|
|
541
|
+
]);
|
|
542
|
+
react.useEffect(() => {
|
|
543
|
+
if (!element) return;
|
|
544
|
+
const onWheel = (event) => {
|
|
545
|
+
if (event.target.closest(`[${"data-no-pan"}]`)) return;
|
|
546
|
+
event.preventDefault();
|
|
547
|
+
if (event.ctrlKey || event.metaKey) {
|
|
548
|
+
const rect = element.getBoundingClientRect();
|
|
549
|
+
move((current) => zoomAround(current, clampZoom(current.zoom * Math.exp(-event.deltaY * .01)), event.clientX - rect.left, event.clientY - rect.top), null);
|
|
550
|
+
} else move((current) => ({
|
|
551
|
+
...current,
|
|
552
|
+
x: current.x - event.deltaX,
|
|
553
|
+
y: current.y - event.deltaY
|
|
554
|
+
}), null);
|
|
555
|
+
};
|
|
556
|
+
element.addEventListener("wheel", onWheel, { passive: false });
|
|
557
|
+
return () => element.removeEventListener("wheel", onWheel);
|
|
558
|
+
}, [
|
|
559
|
+
clampZoom,
|
|
560
|
+
element,
|
|
561
|
+
move
|
|
562
|
+
]);
|
|
563
|
+
/** Snapshot of the gesture origin: centroid and spread of the active pointers. */
|
|
564
|
+
const beginGesture = (current) => {
|
|
565
|
+
const points = [...pointers.current.values()];
|
|
566
|
+
const x = points.reduce((sum, point) => sum + point.x, 0) / points.length;
|
|
567
|
+
const y = points.reduce((sum, point) => sum + point.y, 0) / points.length;
|
|
568
|
+
const distance = points.length > 1 ? Math.hypot(points[0].x - points[1].x, points[0].y - points[1].y) : 0;
|
|
569
|
+
gesture.current = {
|
|
570
|
+
view: current,
|
|
571
|
+
x,
|
|
572
|
+
y,
|
|
573
|
+
distance
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
const handlers = {
|
|
577
|
+
onPointerDown(event) {
|
|
578
|
+
if (event.button !== 0 || event.target.closest(NO_PAN_SELECTOR)) return;
|
|
579
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
580
|
+
pointers.current.set(event.pointerId, {
|
|
581
|
+
x: event.clientX,
|
|
582
|
+
y: event.clientY
|
|
583
|
+
});
|
|
584
|
+
if (pointers.current.size === 1) panned.current = false;
|
|
585
|
+
beginGesture(viewRef.current);
|
|
586
|
+
setDragging(true);
|
|
587
|
+
},
|
|
588
|
+
onPointerMove(event) {
|
|
589
|
+
const start = gesture.current;
|
|
590
|
+
if (!start || !pointers.current.has(event.pointerId)) return;
|
|
591
|
+
if ((event.buttons & 1) === 0) {
|
|
592
|
+
handlers.onPointerUp(event);
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
pointers.current.set(event.pointerId, {
|
|
596
|
+
x: event.clientX,
|
|
597
|
+
y: event.clientY
|
|
598
|
+
});
|
|
599
|
+
const points = [...pointers.current.values()];
|
|
600
|
+
const x = points.reduce((sum, point) => sum + point.x, 0) / points.length;
|
|
601
|
+
const y = points.reduce((sum, point) => sum + point.y, 0) / points.length;
|
|
602
|
+
if (!panned.current && Math.hypot(x - start.x, y - start.y) < 3) return;
|
|
603
|
+
panned.current = true;
|
|
604
|
+
const next = {
|
|
605
|
+
...start.view,
|
|
606
|
+
x: start.view.x + x - start.x,
|
|
607
|
+
y: start.view.y + y - start.y
|
|
608
|
+
};
|
|
609
|
+
if (points.length < 2 || !start.distance) {
|
|
610
|
+
move(() => next, null);
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
614
|
+
const scale = Math.hypot(points[0].x - points[1].x, points[0].y - points[1].y) / start.distance;
|
|
615
|
+
move(() => zoomAround(next, clampZoom(start.view.zoom * scale), x - rect.left, y - rect.top), null);
|
|
616
|
+
},
|
|
617
|
+
onPointerUp(event) {
|
|
618
|
+
if (!pointers.current.delete(event.pointerId)) return;
|
|
619
|
+
if (pointers.current.size === 0) {
|
|
620
|
+
gesture.current = null;
|
|
621
|
+
setDragging(false);
|
|
622
|
+
} else beginGesture(viewRef.current);
|
|
623
|
+
},
|
|
624
|
+
onKeyDown(event) {
|
|
625
|
+
if (event.target !== event.currentTarget) return;
|
|
626
|
+
const step = event.shiftKey ? 120 : 40;
|
|
627
|
+
const delta = {
|
|
628
|
+
ArrowLeft: [step, 0],
|
|
629
|
+
ArrowRight: [-step, 0],
|
|
630
|
+
ArrowUp: [0, step],
|
|
631
|
+
ArrowDown: [0, -step]
|
|
632
|
+
}[event.key];
|
|
633
|
+
if (delta) {
|
|
634
|
+
event.preventDefault();
|
|
635
|
+
move((current) => ({
|
|
636
|
+
...current,
|
|
637
|
+
x: current.x + delta[0],
|
|
638
|
+
y: current.y + delta[1]
|
|
639
|
+
}), "pan");
|
|
640
|
+
} else if (event.key === "+" || event.key === "=") zoomTo(view.zoom + ZOOM_STEP);
|
|
641
|
+
else if (event.key === "-") zoomTo(view.zoom - ZOOM_STEP);
|
|
642
|
+
else if (event.key === "0") zoomTo(1);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
return {
|
|
646
|
+
/** Read-only handle on the canvas element; attach it with `attach`. */
|
|
647
|
+
viewportRef,
|
|
648
|
+
attach,
|
|
649
|
+
view,
|
|
650
|
+
transition,
|
|
651
|
+
dragging,
|
|
652
|
+
handlers: {
|
|
653
|
+
...handlers,
|
|
654
|
+
onPointerCancel: handlers.onPointerUp,
|
|
655
|
+
onLostPointerCapture: handlers.onPointerUp
|
|
656
|
+
},
|
|
657
|
+
zoomTo,
|
|
658
|
+
zoomIn: () => zoomTo(view.zoom + ZOOM_STEP),
|
|
659
|
+
zoomOut: () => zoomTo(view.zoom - ZOOM_STEP),
|
|
660
|
+
canZoomIn: view.zoom < maxZoom,
|
|
661
|
+
canZoomOut: view.zoom > minZoom,
|
|
662
|
+
fit,
|
|
663
|
+
reveal,
|
|
664
|
+
hold,
|
|
665
|
+
/** True when the last press panned; use it to ignore the click that ends a drag. */
|
|
666
|
+
wasPanned: () => panned.current
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* The canvas card: a dotted grid that pans and zooms with a transformed layer
|
|
671
|
+
* of nodes, and an overlay for pinned controls. Spread the viewport handlers
|
|
672
|
+
* here once; mark interactive node parts with `NO_PAN_ATTRIBUTE`.
|
|
673
|
+
*/
|
|
674
|
+
function CanvasSurface({ viewport, label, layerRef, children, overlay, onPaneClick, className }) {
|
|
675
|
+
const { view, transition } = viewport;
|
|
676
|
+
const eased = transition !== "none";
|
|
677
|
+
const grid = 16 * view.zoom * (view.zoom < .5 ? 2 : 1);
|
|
678
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
679
|
+
ref: viewport.attach,
|
|
680
|
+
dir: "ltr",
|
|
681
|
+
tabIndex: 0,
|
|
682
|
+
role: "region",
|
|
683
|
+
"aria-roledescription": "canvas",
|
|
684
|
+
"aria-label": label,
|
|
685
|
+
...viewport.handlers,
|
|
686
|
+
onClick: onPaneClick ? (event) => {
|
|
687
|
+
if (!viewport.wasPanned() && !event.target.closest(NO_PAN_SELECTOR)) onPaneClick();
|
|
688
|
+
} : void 0,
|
|
689
|
+
className: require_utils.cn("h-full touch-none rounded-xl bg-card shadow-card select-none", surfaceInsetClass, focusRingClass, viewport.dragging ? "cursor-grabbing" : "cursor-grab", className),
|
|
690
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SurfaceBody, { children: [
|
|
691
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
692
|
+
"aria-hidden": "true",
|
|
693
|
+
className: "absolute inset-0",
|
|
694
|
+
style: {
|
|
695
|
+
backgroundImage: "radial-gradient(circle, color-mix(in oklab, var(--foreground) 13%, transparent) 1px, transparent 1.2px)",
|
|
696
|
+
backgroundSize: `${grid}px ${grid}px`,
|
|
697
|
+
backgroundPosition: `${view.x}px ${view.y}px`,
|
|
698
|
+
transition: eased ? `background-size ${transition}, background-position ${transition}` : "none"
|
|
699
|
+
}
|
|
700
|
+
}),
|
|
701
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
702
|
+
ref: layerRef,
|
|
703
|
+
className: "absolute top-0 start-0 will-change-transform",
|
|
704
|
+
style: {
|
|
705
|
+
transform: `translate(${view.x}px, ${view.y}px) scale(${view.zoom})`,
|
|
706
|
+
transformOrigin: "0 0",
|
|
707
|
+
transition: eased ? `transform ${transition}` : "none"
|
|
708
|
+
},
|
|
709
|
+
children
|
|
710
|
+
}),
|
|
711
|
+
overlay
|
|
712
|
+
] })
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
/** Floating zoom pill: out, the current percentage (resets to 100%), in, and an optional fit. */
|
|
716
|
+
function CanvasZoomControls({ viewport, fit = false, className }) {
|
|
717
|
+
const percent = Math.round(viewport.view.zoom * 100);
|
|
718
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
719
|
+
role: "group",
|
|
720
|
+
"aria-label": "Zoom",
|
|
721
|
+
className: require_utils.cn("absolute bottom-3 left-1/2 z-10 flex -translate-x-1/2 items-center gap-0.5 rounded-lg bg-card p-0.5 shadow-card-lg", className),
|
|
722
|
+
children: [
|
|
723
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipIconButton, {
|
|
724
|
+
label: "Zoom out",
|
|
725
|
+
extendHitArea: false,
|
|
726
|
+
disabled: !viewport.canZoomOut,
|
|
727
|
+
onClick: viewport.zoomOut,
|
|
728
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Minus, {
|
|
729
|
+
"aria-hidden": "true",
|
|
730
|
+
className: "size-3.5"
|
|
731
|
+
})
|
|
732
|
+
}),
|
|
733
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
734
|
+
type: "button",
|
|
735
|
+
"aria-label": `Zoom ${percent}%, reset to 100%`,
|
|
736
|
+
onClick: () => viewport.zoomTo(1),
|
|
737
|
+
className: require_utils.cn("h-7 w-12 cursor-pointer rounded-md text-[0.8125rem] text-foreground tabular-nums hover:bg-overlay-hover", pressClass, focusRingClass),
|
|
738
|
+
children: [percent, "%"]
|
|
739
|
+
}),
|
|
740
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipIconButton, {
|
|
741
|
+
label: "Zoom in",
|
|
742
|
+
extendHitArea: false,
|
|
743
|
+
disabled: !viewport.canZoomIn,
|
|
744
|
+
onClick: viewport.zoomIn,
|
|
745
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, {
|
|
746
|
+
"aria-hidden": "true",
|
|
747
|
+
className: "size-3.5"
|
|
748
|
+
})
|
|
749
|
+
}),
|
|
750
|
+
fit ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
751
|
+
"aria-hidden": "true",
|
|
752
|
+
className: "mx-0.5 h-4 w-px bg-border"
|
|
753
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipIconButton, {
|
|
754
|
+
label: "Fit to view",
|
|
755
|
+
extendHitArea: false,
|
|
756
|
+
onClick: viewport.fit,
|
|
757
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Scan, {
|
|
758
|
+
"aria-hidden": "true",
|
|
759
|
+
className: "size-3.5"
|
|
760
|
+
})
|
|
761
|
+
})] }) : null
|
|
762
|
+
]
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
/** Shell radius; its 1px border and 3px inset make the inner card 10px (concentric). */
|
|
766
|
+
const NODE_RADIUS = "rounded-[14px]";
|
|
767
|
+
const INNER_RADIUS = "rounded-[10px]";
|
|
768
|
+
const TINT = {
|
|
769
|
+
new: {
|
|
770
|
+
borderColor: "color-mix(in oklab, var(--primary) 40%, transparent)",
|
|
771
|
+
backgroundColor: "color-mix(in oklab, var(--primary) 7%, var(--muted))"
|
|
772
|
+
},
|
|
773
|
+
target: {
|
|
774
|
+
borderColor: "color-mix(in oklab, var(--primary) 60%, transparent)",
|
|
775
|
+
backgroundColor: "color-mix(in oklab, var(--primary) 14%, var(--muted))"
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
/**
|
|
779
|
+
* Double-framed canvas node: a quiet bezel around a raised card, with
|
|
780
|
+
* concentric corners. Selected nodes get a primary edge and a soft halo.
|
|
781
|
+
*/
|
|
782
|
+
function NodeShell({ as: Element = "div", tone = "plain", selected = false, underlay, cardClassName, innerClassName, className, style, children, ...props }) {
|
|
783
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Element, {
|
|
784
|
+
"data-selected": selected || void 0,
|
|
785
|
+
style: {
|
|
786
|
+
...TINT[tone],
|
|
787
|
+
...style
|
|
788
|
+
},
|
|
789
|
+
className: require_utils.cn("relative isolate flex flex-col border p-[3px] transition-[border-color,background-color,box-shadow] duration-(--duration-moderate) ease-out motion-reduce:transition-none", NODE_RADIUS, tone === "plain" ? "border-foreground/[0.07] bg-muted/80" : "border-dashed", selected && "border-primary/50 shadow-[0_0_0_3px_color-mix(in_oklab,var(--primary)_16%,transparent)]", className),
|
|
790
|
+
...props,
|
|
791
|
+
children: [underlay, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
792
|
+
className: require_utils.cn(surfaceInsetClass, "bg-card shadow-card", INNER_RADIUS, cardClassName),
|
|
793
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SurfaceBody, {
|
|
794
|
+
className: innerClassName,
|
|
795
|
+
children
|
|
796
|
+
})
|
|
797
|
+
})]
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
/** Small framed tile holding a node's primary-tinted icon. */
|
|
801
|
+
function NodeIconTile({ icon: Icon }) {
|
|
802
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
803
|
+
"aria-hidden": "true",
|
|
804
|
+
className: "grid size-[22px] shrink-0 place-items-center rounded-[6px] bg-card text-primary shadow-card",
|
|
805
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
806
|
+
className: "size-3",
|
|
807
|
+
strokeWidth: 2
|
|
808
|
+
})
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
const WIRE_STROKE = {
|
|
812
|
+
rest: "color-mix(in oklab, var(--foreground) 20%, transparent)",
|
|
813
|
+
live: "color-mix(in oklab, var(--primary) 55%, transparent)",
|
|
814
|
+
warn: "color-mix(in oklab, var(--warning) 70%, transparent)"
|
|
815
|
+
};
|
|
816
|
+
/** One decimal is below a device pixel at any zoom the canvas allows. */
|
|
817
|
+
const round = (value) => Math.round(value * 10) / 10;
|
|
818
|
+
/** Cubic bezier between two anchors, leaving and entering along `axis`. */
|
|
819
|
+
function wirePath(start, end, axis = "horizontal") {
|
|
820
|
+
const [x1, y1, x2, y2] = [
|
|
821
|
+
start[0],
|
|
822
|
+
start[1],
|
|
823
|
+
end[0],
|
|
824
|
+
end[1]
|
|
825
|
+
].map(round);
|
|
826
|
+
if (axis === "vertical") {
|
|
827
|
+
const dy = round(Math.max(24, (y2 - y1) / 2));
|
|
828
|
+
return `M ${x1} ${y1} C ${x1} ${round(y1 + dy)}, ${x2} ${round(y2 - dy)}, ${x2} ${y2}`;
|
|
829
|
+
}
|
|
830
|
+
const dx = round(Math.max(40, (x2 - x1) / 2));
|
|
831
|
+
return `M ${x1} ${y1} C ${round(x1 + dx)} ${y1}, ${round(x2 - dx)} ${y2}, ${x2} ${y2}`;
|
|
832
|
+
}
|
|
833
|
+
const GLIDE = "d var(--duration-slow) var(--ease-out), cx var(--duration-slow) var(--ease-out), cy var(--duration-slow) var(--ease-out), stroke var(--duration-moderate)";
|
|
834
|
+
/** Anchor dot; its position also lives in CSS so `glide` can ease it. */
|
|
835
|
+
function WireDot({ at, glide = false, stroke }) {
|
|
836
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
837
|
+
cx: at[0],
|
|
838
|
+
cy: at[1],
|
|
839
|
+
r: 3,
|
|
840
|
+
fill: "var(--card)",
|
|
841
|
+
stroke,
|
|
842
|
+
strokeWidth: stroke ? 1 : void 0,
|
|
843
|
+
style: glide ? {
|
|
844
|
+
cx: at[0],
|
|
845
|
+
cy: at[1],
|
|
846
|
+
transition: GLIDE
|
|
847
|
+
} : void 0
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* One wire with anchor dots. Render inside an SVG in layer coordinates.
|
|
852
|
+
* `rest` wires are solid; `live` and `warn` wires are dashed.
|
|
853
|
+
*/
|
|
854
|
+
function CanvasWire({ start, end, tone = "rest", axis = "horizontal", animated = false, startDot = true, glide = false }) {
|
|
855
|
+
const d = wirePath(start, end, axis);
|
|
856
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("g", {
|
|
857
|
+
stroke: WIRE_STROKE[tone],
|
|
858
|
+
strokeWidth: 1,
|
|
859
|
+
className: "transition-[stroke] duration-(--duration-moderate)",
|
|
860
|
+
children: [
|
|
861
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
862
|
+
d,
|
|
863
|
+
fill: "none",
|
|
864
|
+
strokeDasharray: tone === "rest" ? void 0 : "4 4",
|
|
865
|
+
strokeLinecap: "round",
|
|
866
|
+
style: glide ? {
|
|
867
|
+
d: `path("${d}")`,
|
|
868
|
+
transition: GLIDE
|
|
869
|
+
} : void 0,
|
|
870
|
+
children: animated ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("animate", {
|
|
871
|
+
attributeName: "stroke-dashoffset",
|
|
872
|
+
from: "8",
|
|
873
|
+
to: "0",
|
|
874
|
+
dur: "0.5s",
|
|
875
|
+
repeatCount: "indefinite"
|
|
876
|
+
}) : null
|
|
877
|
+
}),
|
|
878
|
+
startDot ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WireDot, {
|
|
879
|
+
at: start,
|
|
880
|
+
glide
|
|
881
|
+
}) : null,
|
|
882
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(WireDot, {
|
|
883
|
+
at: end,
|
|
884
|
+
glide
|
|
885
|
+
})
|
|
886
|
+
]
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
//#endregion
|
|
891
|
+
//#region src/components/workspace-kit/menu.tsx
|
|
892
|
+
const THEMES = [
|
|
893
|
+
{
|
|
894
|
+
value: "light",
|
|
895
|
+
label: "Light",
|
|
896
|
+
icon: lucide_react.Sun
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
value: "dark",
|
|
900
|
+
label: "Dark",
|
|
901
|
+
icon: lucide_react.Moon
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
value: "system",
|
|
905
|
+
label: "System",
|
|
906
|
+
icon: lucide_react.Monitor
|
|
907
|
+
}
|
|
908
|
+
];
|
|
909
|
+
/** The appearance row every workspace menu carries: light, dark, or system. */
|
|
910
|
+
function AppearanceRow({ value, onChange }) {
|
|
911
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
912
|
+
className: "flex items-center gap-2 px-2 py-1 text-sm",
|
|
913
|
+
children: [
|
|
914
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.SunMoon, {
|
|
915
|
+
"aria-hidden": "true",
|
|
916
|
+
className: "size-3.5 text-muted-foreground"
|
|
917
|
+
}),
|
|
918
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
919
|
+
className: "flex-1",
|
|
920
|
+
children: "Appearance"
|
|
921
|
+
}),
|
|
922
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Segmented, {
|
|
923
|
+
label: "Appearance",
|
|
924
|
+
value,
|
|
925
|
+
options: THEMES,
|
|
926
|
+
onChange
|
|
927
|
+
})
|
|
928
|
+
]
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
/** Up to two initials for a name: "Northwind Labs" → "NL". Empty for a name with nothing to show; `SwitcherTrigger` then draws an icon. */
|
|
932
|
+
function monogram(name) {
|
|
933
|
+
return require_initials.initials(name) ?? "";
|
|
934
|
+
}
|
|
935
|
+
/** Sidebar header trigger for a workspace or account switcher menu. */
|
|
936
|
+
function SwitcherTrigger({ label, name, glyph, collapsed }) {
|
|
937
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_dropdown_menu.DropdownMenuTrigger, {
|
|
938
|
+
"aria-label": label,
|
|
939
|
+
className: require_utils.cn("flex h-8 min-w-0 cursor-pointer items-center gap-2 rounded-md px-1.5 text-start hover:bg-overlay-hover data-popup-open:bg-overlay-hover", focusRingClass, collapsed ? "w-8 justify-center px-0" : "flex-1"),
|
|
940
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
941
|
+
className: "grid size-5 shrink-0 place-items-center rounded-md bg-foreground text-[0.5625rem] font-semibold text-background",
|
|
942
|
+
children: glyph || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Building2, {
|
|
943
|
+
"aria-hidden": "true",
|
|
944
|
+
className: "size-3"
|
|
945
|
+
})
|
|
946
|
+
}), collapsed ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
947
|
+
title: name,
|
|
948
|
+
className: "min-w-0 flex-1 truncate text-sm font-medium text-foreground",
|
|
949
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("bdi", { children: name })
|
|
950
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronsUpDown, {
|
|
951
|
+
"aria-hidden": "true",
|
|
952
|
+
className: "size-3.5 shrink-0 text-muted-foreground"
|
|
953
|
+
})] })]
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region src/components/workspace-kit/nav.tsx
|
|
959
|
+
const ROW = require_utils.cn("relative flex h-8 cursor-pointer items-center rounded-md text-start text-sm pointer-coarse:h-10", focusRingClass);
|
|
960
|
+
/** Full-width row with a label, or a centred square matching the rail's icon buttons. */
|
|
961
|
+
const rowShape = (collapsed) => collapsed ? "size-8 shrink-0 justify-center pointer-coarse:size-10" : "w-full gap-2 px-2";
|
|
962
|
+
/** Labels a rail control with a tooltip only while the sidebar is collapsed. */
|
|
963
|
+
function RailTip({ label, collapsed, children }) {
|
|
964
|
+
if (!collapsed) return children;
|
|
965
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_tooltip.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipTrigger, { render: children }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_tooltip.TooltipContent, {
|
|
966
|
+
side: "right",
|
|
967
|
+
children: label
|
|
968
|
+
})] });
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* One sidebar row. Focus reads through weight and a tinted fill, never a
|
|
972
|
+
* coloured dot; hover is instant because rows are clicked constantly.
|
|
973
|
+
*/
|
|
974
|
+
function NavRow({ label, collapsed, active, leading, labelNode, trailing, muted, disabled, busy, onClick, href, renderLink }) {
|
|
975
|
+
const content = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [leading, collapsed ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
976
|
+
title: label,
|
|
977
|
+
className: "min-w-0 flex-1 truncate",
|
|
978
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("bdi", { children: labelNode ?? label })
|
|
979
|
+
}), busy ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, {
|
|
980
|
+
"aria-hidden": "true",
|
|
981
|
+
className: "size-3.5 shrink-0 text-muted-foreground motion-safe:animate-spin"
|
|
982
|
+
}) : trailing] })] });
|
|
983
|
+
const tone = active ? "bg-sidebar-accent font-medium text-foreground" : muted ? "text-muted-foreground" : "text-sidebar-foreground";
|
|
984
|
+
const shared = {
|
|
985
|
+
"aria-label": collapsed ? label : void 0,
|
|
986
|
+
"aria-current": active ? "page" : void 0,
|
|
987
|
+
"aria-busy": busy || void 0
|
|
988
|
+
};
|
|
989
|
+
let row;
|
|
990
|
+
if (href !== void 0) {
|
|
991
|
+
const props = {
|
|
992
|
+
...shared,
|
|
993
|
+
href,
|
|
994
|
+
"aria-disabled": disabled || void 0,
|
|
995
|
+
onClick: (event) => {
|
|
996
|
+
if (disabled) event.preventDefault();
|
|
997
|
+
else onClick?.();
|
|
998
|
+
},
|
|
999
|
+
className: require_utils.cn(ROW, rowShape(collapsed), "no-underline", disabled ? "cursor-not-allowed opacity-50" : require_utils.cn("hover:bg-overlay-hover", muted && !active && "hover:text-foreground"), tone),
|
|
1000
|
+
children: content
|
|
1001
|
+
};
|
|
1002
|
+
row = renderLink ? renderLink(props) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", { ...props });
|
|
1003
|
+
} else row = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1004
|
+
type: "button",
|
|
1005
|
+
...shared,
|
|
1006
|
+
disabled,
|
|
1007
|
+
onClick,
|
|
1008
|
+
className: require_utils.cn(ROW, rowShape(collapsed), "disabled:cursor-not-allowed disabled:opacity-50", active ? tone : require_utils.cn("enabled:hover:bg-overlay-hover", tone, muted && "enabled:hover:text-foreground")),
|
|
1009
|
+
children: content
|
|
1010
|
+
});
|
|
1011
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
1012
|
+
className: collapsed ? "flex justify-center" : void 0,
|
|
1013
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RailTip, {
|
|
1014
|
+
label,
|
|
1015
|
+
collapsed,
|
|
1016
|
+
children: row
|
|
1017
|
+
})
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
function NavIcon({ icon: Icon, active }) {
|
|
1021
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
1022
|
+
"aria-hidden": "true",
|
|
1023
|
+
className: require_utils.cn("size-3.5 shrink-0", active ? "text-foreground" : "text-muted-foreground")
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Quiet trailing count for a nav row; hidden from assistive tech, which reads
|
|
1028
|
+
* the label instead. A number is grouped (`1,284`); pass a string to format it yourself.
|
|
1029
|
+
*/
|
|
1030
|
+
function NavCount({ value, tone = "muted", locale }) {
|
|
1031
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1032
|
+
"aria-hidden": "true",
|
|
1033
|
+
className: require_utils.cn("text-xs tabular-nums", tone === "muted" && "text-muted-foreground", tone === "warning" && "font-medium text-warning", tone === "danger" && "font-medium text-destructive"),
|
|
1034
|
+
children: typeof value === "number" ? require_initials.formatCount(value, locale) : value
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
/** A group of rows with an optional small heading. */
|
|
1038
|
+
function NavSection({ title, collapsed, action, children }) {
|
|
1039
|
+
const headingId = react.useId();
|
|
1040
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1041
|
+
className: "flex w-full flex-col gap-1",
|
|
1042
|
+
children: [title && !collapsed || action ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1043
|
+
className: require_utils.cn("flex h-7 items-center gap-2 ps-2", collapsed && "justify-center ps-0"),
|
|
1044
|
+
children: [collapsed || !title ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
1045
|
+
id: headingId,
|
|
1046
|
+
className: "flex-1 truncate text-xs text-muted-foreground",
|
|
1047
|
+
children: title
|
|
1048
|
+
}), action]
|
|
1049
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
1050
|
+
"aria-labelledby": title && !collapsed ? headingId : void 0,
|
|
1051
|
+
"aria-label": title && collapsed ? title : void 0,
|
|
1052
|
+
className: "flex flex-col gap-0.5",
|
|
1053
|
+
children
|
|
1054
|
+
})]
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Sidebar chrome: a 48px header with the switcher and a collapse (or close)
|
|
1059
|
+
* control, a scrolling body, and an optional pinned footer. 224px wide, or a
|
|
1060
|
+
* 52px icon rail when collapsed.
|
|
1061
|
+
*/
|
|
1062
|
+
function SidebarFrame({ label, menu, collapsed: collapsedProp, onCollapsedChange, drawer = false, onClose, children, footer, className }) {
|
|
1063
|
+
const collapsed = !drawer && collapsedProp;
|
|
1064
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("aside", {
|
|
1065
|
+
"aria-label": label,
|
|
1066
|
+
"data-collapsed": collapsed || void 0,
|
|
1067
|
+
className: require_utils.cn("flex h-full shrink-0 flex-col bg-sidebar", drawer ? "w-full" : require_utils.cn("border-e border-sidebar-border", collapsed ? "w-[52px]" : "w-56"), className),
|
|
1068
|
+
children: [
|
|
1069
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1070
|
+
className: require_utils.cn("flex h-12 shrink-0 items-center gap-1 px-2.5", collapsed && "justify-center px-0"),
|
|
1071
|
+
children: [menu, drawer ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipIconButton, {
|
|
1072
|
+
label: "Close navigation",
|
|
1073
|
+
onClick: onClose,
|
|
1074
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
|
|
1075
|
+
"aria-hidden": "true",
|
|
1076
|
+
className: "size-3.5"
|
|
1077
|
+
})
|
|
1078
|
+
}) : collapsed ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipIconButton, {
|
|
1079
|
+
label: "Collapse sidebar",
|
|
1080
|
+
"aria-expanded": true,
|
|
1081
|
+
onClick: () => onCollapsedChange?.(true),
|
|
1082
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.PanelLeft, {
|
|
1083
|
+
"aria-hidden": "true",
|
|
1084
|
+
className: "size-3.5 rtl:-scale-x-100"
|
|
1085
|
+
})
|
|
1086
|
+
})]
|
|
1087
|
+
}),
|
|
1088
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1089
|
+
className: require_utils.cn("-mt-1 flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-2.5 pt-1 pb-3", collapsed && "items-center px-2"),
|
|
1090
|
+
children: [collapsed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipIconButton, {
|
|
1091
|
+
label: "Expand sidebar",
|
|
1092
|
+
side: "right",
|
|
1093
|
+
size: "lg",
|
|
1094
|
+
"aria-expanded": false,
|
|
1095
|
+
onClick: () => onCollapsedChange?.(false),
|
|
1096
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.PanelLeft, {
|
|
1097
|
+
"aria-hidden": "true",
|
|
1098
|
+
className: "size-3.5 -scale-x-100 rtl:scale-x-100"
|
|
1099
|
+
})
|
|
1100
|
+
}) : null, children]
|
|
1101
|
+
}),
|
|
1102
|
+
footer
|
|
1103
|
+
]
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
//#endregion
|
|
1108
|
+
//#region src/components/workspace-kit/middle-truncate.tsx
|
|
1109
|
+
const EXTENSION = /\.[A-Za-z0-9]{1,8}$/;
|
|
1110
|
+
/** The text split into what the line gives up first and what it always keeps, or `null` when it is too short to bother. */
|
|
1111
|
+
function splitMiddle(text, tail) {
|
|
1112
|
+
const extension = EXTENSION.exec(text)?.[0];
|
|
1113
|
+
const asked = tail ?? (extension ? extension.length + 4 : 8);
|
|
1114
|
+
const keep = Number.isFinite(asked) ? Math.max(0, Math.floor(asked)) : 0;
|
|
1115
|
+
if (keep === 0 || text.length <= keep * 2) return null;
|
|
1116
|
+
const pieces = require_initials.graphemes(text);
|
|
1117
|
+
if (pieces.length <= keep * 2) return null;
|
|
1118
|
+
return [pieces.slice(0, -keep).join(""), pieces.slice(-keep).join("")];
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* `MiddleTruncate` — one line that gives up its middle when it runs out of room, keeping the start and the end.
|
|
1122
|
+
* Names and keys differ at the end (`…edited_edited.HEIC`, `…/2025/09/14/`), so clipping only the end would make
|
|
1123
|
+
* different files read the same. The full text is the tooltip.
|
|
1124
|
+
*
|
|
1125
|
+
* A long text is drawn as two pieces, so the text itself is in the document once more, visually hidden: that copy is
|
|
1126
|
+
* what assistive tech reads and what a selection or copy picks up, so a copied name is the original string once. The
|
|
1127
|
+
* two visible pieces cannot be selected themselves. Graphemes are never cut, so an emoji or accent stays whole.
|
|
1128
|
+
*/
|
|
1129
|
+
function MiddleTruncate({ text, tail, title = text, className }) {
|
|
1130
|
+
const parts = react.useMemo(() => splitMiddle(text, tail), [text, tail]);
|
|
1131
|
+
const tooltip = title === false ? void 0 : title;
|
|
1132
|
+
if (!parts) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1133
|
+
dir: "auto",
|
|
1134
|
+
className: require_utils.cn("block min-w-0 overflow-hidden text-ellipsis whitespace-pre", className),
|
|
1135
|
+
title: tooltip,
|
|
1136
|
+
children: text
|
|
1137
|
+
});
|
|
1138
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1139
|
+
dir: "auto",
|
|
1140
|
+
className: require_utils.cn("flex min-w-0 max-w-full", className),
|
|
1141
|
+
title: tooltip,
|
|
1142
|
+
children: [
|
|
1143
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1144
|
+
className: "sr-only",
|
|
1145
|
+
children: text
|
|
1146
|
+
}),
|
|
1147
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1148
|
+
"aria-hidden": "true",
|
|
1149
|
+
className: "min-w-0 overflow-hidden text-ellipsis whitespace-pre select-none",
|
|
1150
|
+
children: parts[0]
|
|
1151
|
+
}),
|
|
1152
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1153
|
+
"aria-hidden": "true",
|
|
1154
|
+
className: "max-w-full shrink-0 overflow-hidden text-ellipsis whitespace-pre select-none",
|
|
1155
|
+
children: parts[1]
|
|
1156
|
+
})
|
|
1157
|
+
]
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
//#endregion
|
|
1162
|
+
//#region src/components/workspace-kit/surface.tsx
|
|
1163
|
+
/** Hairline dashed rule used between sections of one surface. */
|
|
1164
|
+
const dashedRule = "border-dashed border-foreground/10";
|
|
1165
|
+
/** Header row and body row classes shared by every workspace table. */
|
|
1166
|
+
const tableHeadClass = "bg-muted/60 text-left rtl:text-right text-xs font-normal text-muted-foreground [&_th]:px-4 [&_th]:py-2 [&_th]:font-normal";
|
|
1167
|
+
const tableRowClass = "border-t border-border align-middle [&_td]:px-4 [&_td]:py-2.5";
|
|
1168
|
+
/**
|
|
1169
|
+
* Heading row that opens a group of body rows, tinted like the header so the
|
|
1170
|
+
* break reads without a heavier line. Pair it with `<th scope="rowgroup" colSpan>`.
|
|
1171
|
+
*/
|
|
1172
|
+
const tableGroupRowClass = "border-t border-border bg-muted/60 [&_th]:px-4 [&_th]:py-1.5 [&_th]:text-start [&_th]:text-xs [&_th]:font-medium [&_th]:text-muted-foreground";
|
|
1173
|
+
/** A native select styled like the kit's inputs. */
|
|
1174
|
+
const nativeSelectClass = require_utils.cn("h-8 rounded-md border border-border bg-card px-2 text-[0.8125rem] text-foreground shadow-2xs", focusRingClass);
|
|
1175
|
+
/**
|
|
1176
|
+
* Card around a table that scrolls sideways below `minWidth`, keeping the card
|
|
1177
|
+
* edge visible over full-bleed header rows. An edge fades while there is more
|
|
1178
|
+
* to scroll to, so a table cut off on a phone reads as scrollable.
|
|
1179
|
+
*/
|
|
1180
|
+
function TableSurface({ children, className, minWidth = "40rem" }) {
|
|
1181
|
+
const { ref, style } = require_use_scroll_fade.useScrollFade();
|
|
1182
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1183
|
+
className: require_utils.cn(surfaceInsetClass, "rounded-xl bg-card shadow-card", className),
|
|
1184
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SurfaceBody, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1185
|
+
ref,
|
|
1186
|
+
className: "relative overflow-x-auto",
|
|
1187
|
+
style,
|
|
1188
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("table", {
|
|
1189
|
+
className: "w-full border-collapse text-[0.8125rem]",
|
|
1190
|
+
style: { minWidth },
|
|
1191
|
+
children
|
|
1192
|
+
})
|
|
1193
|
+
}) })
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
/** Small tinted status label from a presentation map entry. */
|
|
1197
|
+
function StatusBadge({ presentation, className, children }) {
|
|
1198
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToneBadge, {
|
|
1199
|
+
tone: presentation.tone,
|
|
1200
|
+
className,
|
|
1201
|
+
children: [children, presentation.label]
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
/**
|
|
1205
|
+
* The basic workspace surface: a card with an optional header, a body, and a
|
|
1206
|
+
* tinted footer strip. Full-bleed children never cover the card edge (see
|
|
1207
|
+
* `SurfaceBody`).
|
|
1208
|
+
*/
|
|
1209
|
+
function Panel({ title, description, actions, footer, bodyClassName, className, children, ...props }) {
|
|
1210
|
+
const headingId = react.useId();
|
|
1211
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
1212
|
+
"aria-labelledby": title ? headingId : void 0,
|
|
1213
|
+
className: require_utils.cn(surfaceInsetClass, "rounded-xl bg-card shadow-card", className),
|
|
1214
|
+
...props,
|
|
1215
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SurfaceBody, {
|
|
1216
|
+
className: "flex flex-col",
|
|
1217
|
+
children: [
|
|
1218
|
+
title || actions ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
1219
|
+
className: "flex flex-wrap items-start gap-x-3 gap-y-2 px-4 pt-3.5 pb-3",
|
|
1220
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1221
|
+
className: "min-w-0 flex-1 basis-48",
|
|
1222
|
+
children: [title ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
1223
|
+
id: headingId,
|
|
1224
|
+
className: "text-sm font-medium text-foreground",
|
|
1225
|
+
children: title
|
|
1226
|
+
}) : null, description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1227
|
+
className: "mt-0.5 text-pretty text-[0.8125rem] text-muted-foreground",
|
|
1228
|
+
children: description
|
|
1229
|
+
}) : null]
|
|
1230
|
+
}), actions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1231
|
+
className: "flex shrink-0 items-center gap-2",
|
|
1232
|
+
children: actions
|
|
1233
|
+
}) : null]
|
|
1234
|
+
}) : null,
|
|
1235
|
+
children ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1236
|
+
className: require_utils.cn("min-w-0 flex-1 px-4 pb-4", !(title || actions) && "pt-4", bodyClassName),
|
|
1237
|
+
children
|
|
1238
|
+
}) : null,
|
|
1239
|
+
footer ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1240
|
+
className: require_utils.cn("border-t bg-muted/50 px-4 py-2.5 text-xs text-muted-foreground", dashedRule),
|
|
1241
|
+
children: footer
|
|
1242
|
+
}) : null
|
|
1243
|
+
]
|
|
1244
|
+
})
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* Double frame: a quiet 3px bezel around a raised card. The bezel is 14px and
|
|
1249
|
+
* the card 11px, so the corners stay concentric.
|
|
1250
|
+
*/
|
|
1251
|
+
function Bezel({ className, innerClassName, muted, children, ...props }) {
|
|
1252
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1253
|
+
className: require_utils.cn("rounded-[14px] border border-foreground/[0.07] p-[3px]", muted ? "bg-muted/40" : "bg-muted/80", className),
|
|
1254
|
+
...props,
|
|
1255
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1256
|
+
className: require_utils.cn(surfaceInsetClass, "h-full w-full rounded-[11px] bg-card shadow-card"),
|
|
1257
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SurfaceBody, {
|
|
1258
|
+
className: innerClassName,
|
|
1259
|
+
children
|
|
1260
|
+
})
|
|
1261
|
+
})
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
/** Label over a large tabular figure, with an optional hint below. */
|
|
1265
|
+
function StatTile({ label, value, hint, icon: Icon, className }) {
|
|
1266
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1267
|
+
className: require_utils.cn("flex min-w-0 flex-col gap-1", className),
|
|
1268
|
+
children: [
|
|
1269
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1270
|
+
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
1271
|
+
children: [Icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
1272
|
+
"aria-hidden": "true",
|
|
1273
|
+
className: "size-3.5 shrink-0"
|
|
1274
|
+
}) : null, label]
|
|
1275
|
+
}),
|
|
1276
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1277
|
+
className: "text-xl font-semibold tracking-tight text-foreground tabular-nums [overflow-wrap:anywhere]",
|
|
1278
|
+
children: value
|
|
1279
|
+
}),
|
|
1280
|
+
hint ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1281
|
+
className: "text-xs text-muted-foreground tabular-nums",
|
|
1282
|
+
children: hint
|
|
1283
|
+
}) : null
|
|
1284
|
+
]
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
/** Label and value rows separated by dashed rules. */
|
|
1288
|
+
function KeyValueList({ items, className }) {
|
|
1289
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dl", {
|
|
1290
|
+
className: require_utils.cn("flex flex-col text-[0.8125rem]", className),
|
|
1291
|
+
children: items.map((item, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1292
|
+
className: require_utils.cn("flex items-baseline justify-between gap-4 py-2", index > 0 && require_utils.cn("border-t", "border-dashed border-foreground/10")),
|
|
1293
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", {
|
|
1294
|
+
className: "text-muted-foreground",
|
|
1295
|
+
children: item.label
|
|
1296
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", {
|
|
1297
|
+
className: "min-w-0 text-end text-foreground tabular-nums [overflow-wrap:anywhere]",
|
|
1298
|
+
children: item.value
|
|
1299
|
+
})]
|
|
1300
|
+
}, item.key ?? index))
|
|
1301
|
+
});
|
|
1302
|
+
}
|
|
1303
|
+
/** Centred empty or blocked state with one next step. */
|
|
1304
|
+
function EmptyState({ icon: Icon, title, description, action, className }) {
|
|
1305
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1306
|
+
className: require_utils.cn("flex flex-col items-center gap-3 px-6 py-10 text-center", className),
|
|
1307
|
+
children: [
|
|
1308
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1309
|
+
className: "grid size-9 place-items-center rounded-[10px] bg-card text-muted-foreground shadow-card",
|
|
1310
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
1311
|
+
"aria-hidden": "true",
|
|
1312
|
+
className: "size-4"
|
|
1313
|
+
})
|
|
1314
|
+
}),
|
|
1315
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1316
|
+
className: "max-w-sm",
|
|
1317
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1318
|
+
className: "text-sm font-medium text-foreground",
|
|
1319
|
+
children: title
|
|
1320
|
+
}), description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1321
|
+
className: "mt-1 text-pretty text-[0.8125rem] text-muted-foreground",
|
|
1322
|
+
children: description
|
|
1323
|
+
}) : null]
|
|
1324
|
+
}),
|
|
1325
|
+
action
|
|
1326
|
+
]
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
/** Heading row between groups of panels inside a view. */
|
|
1330
|
+
function SectionHeading({ title, description, actions, id }) {
|
|
1331
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1332
|
+
className: "flex flex-wrap items-end justify-between gap-x-4 gap-y-2",
|
|
1333
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1334
|
+
className: "min-w-0",
|
|
1335
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
1336
|
+
id,
|
|
1337
|
+
className: "text-[0.9375rem] font-medium tracking-tight text-foreground",
|
|
1338
|
+
children: title
|
|
1339
|
+
}), description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1340
|
+
className: "mt-0.5 text-pretty text-[0.8125rem] text-muted-foreground",
|
|
1341
|
+
children: description
|
|
1342
|
+
}) : null]
|
|
1343
|
+
}), actions ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1344
|
+
className: "flex items-center gap-2",
|
|
1345
|
+
children: actions
|
|
1346
|
+
}) : null]
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
/** Tinted icon tile used as a leading glyph in rows and notices. */
|
|
1350
|
+
function IconTile({ icon: Icon, tone = "neutral", className }) {
|
|
1351
|
+
const color = tone === "neutral" ? void 0 : TONE_COLOR[tone];
|
|
1352
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1353
|
+
"aria-hidden": "true",
|
|
1354
|
+
className: require_utils.cn("grid size-7 shrink-0 place-items-center rounded-lg", color ? null : "bg-muted text-muted-foreground", className),
|
|
1355
|
+
style: color ? {
|
|
1356
|
+
backgroundColor: `color-mix(in oklab, ${color} 12%, transparent)`,
|
|
1357
|
+
color: `color-mix(in oklab, ${color}, var(--foreground) 25%)`
|
|
1358
|
+
} : void 0,
|
|
1359
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { className: "size-3.5" })
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
//#endregion
|
|
1364
|
+
//#region src/components/workspace-kit/view-transition.tsx
|
|
1365
|
+
/**
|
|
1366
|
+
* React 19.3 ships `ViewTransition` and `addTransitionType`; older React keeps
|
|
1367
|
+
* working, just without these view swaps. Read at runtime so the template
|
|
1368
|
+
* builds against any React 18/19 host.
|
|
1369
|
+
*/
|
|
1370
|
+
const react$1 = react;
|
|
1371
|
+
const supported = typeof react$1.ViewTransition !== "undefined";
|
|
1372
|
+
/** Timing for view swaps: short enough that the non-interruptible transition never blocks the next click. */
|
|
1373
|
+
const VIEW_TRANSITION = {
|
|
1374
|
+
duration: .2,
|
|
1375
|
+
ease: [
|
|
1376
|
+
.22,
|
|
1377
|
+
1,
|
|
1378
|
+
.36,
|
|
1379
|
+
1
|
|
1380
|
+
]
|
|
1381
|
+
};
|
|
1382
|
+
/**
|
|
1383
|
+
* `AnimateView` for full-view swaps (route-like changes, list swaps, shared
|
|
1384
|
+
* elements). Renders children untouched when React lacks `ViewTransition`, and
|
|
1385
|
+
* zeroes durations under reduced motion because view-transition pseudo-elements
|
|
1386
|
+
* sit outside the app's reduced-motion CSS.
|
|
1387
|
+
*/
|
|
1388
|
+
function ViewAnimation({ children, transition, ...props }) {
|
|
1389
|
+
const reduced = useReducedMotion();
|
|
1390
|
+
if (!supported) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
1391
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react_animate_view.AnimateView, {
|
|
1392
|
+
...props,
|
|
1393
|
+
transition: reduced ? { duration: 0 } : {
|
|
1394
|
+
...VIEW_TRANSITION,
|
|
1395
|
+
...transition
|
|
1396
|
+
},
|
|
1397
|
+
children
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Runs a state update as a view transition, tagging it with `types` (e.g. a
|
|
1402
|
+
* direction) that `enter`/`exit`/`update` functions can read.
|
|
1403
|
+
*/
|
|
1404
|
+
function startViewTransition(update, ...types) {
|
|
1405
|
+
react.startTransition(() => {
|
|
1406
|
+
if (supported) for (const type of types) react$1.addTransitionType?.(type);
|
|
1407
|
+
update();
|
|
1408
|
+
});
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
//#endregion
|
|
1412
|
+
exports.AppearanceRow = AppearanceRow;
|
|
1413
|
+
exports.Bezel = Bezel;
|
|
1414
|
+
exports.CANVAS_NODE_ATTRIBUTE = CANVAS_NODE_ATTRIBUTE;
|
|
1415
|
+
exports.CanvasSurface = CanvasSurface;
|
|
1416
|
+
exports.CanvasWire = CanvasWire;
|
|
1417
|
+
exports.CanvasZoomControls = CanvasZoomControls;
|
|
1418
|
+
exports.EmptyState = EmptyState;
|
|
1419
|
+
exports.FilterGroup = FilterGroup;
|
|
1420
|
+
exports.IconTile = IconTile;
|
|
1421
|
+
exports.KeyValueList = KeyValueList;
|
|
1422
|
+
exports.MiddleTruncate = MiddleTruncate;
|
|
1423
|
+
exports.NODE_RADIUS = NODE_RADIUS;
|
|
1424
|
+
exports.NO_PAN_ATTRIBUTE = NO_PAN_ATTRIBUTE;
|
|
1425
|
+
exports.NavCount = NavCount;
|
|
1426
|
+
exports.NavIcon = NavIcon;
|
|
1427
|
+
exports.NavMenuButton = NavMenuButton;
|
|
1428
|
+
exports.NavRow = NavRow;
|
|
1429
|
+
exports.NavSection = NavSection;
|
|
1430
|
+
exports.NodeIconTile = NodeIconTile;
|
|
1431
|
+
exports.NodeShell = NodeShell;
|
|
1432
|
+
exports.Panel = Panel;
|
|
1433
|
+
exports.RailTip = RailTip;
|
|
1434
|
+
exports.SearchField = SearchField;
|
|
1435
|
+
exports.SectionHeading = SectionHeading;
|
|
1436
|
+
exports.Segmented = Segmented;
|
|
1437
|
+
exports.SidebarFrame = SidebarFrame;
|
|
1438
|
+
exports.StatTile = StatTile;
|
|
1439
|
+
exports.StatusBadge = StatusBadge;
|
|
1440
|
+
exports.SurfaceBody = SurfaceBody;
|
|
1441
|
+
exports.SwitcherTrigger = SwitcherTrigger;
|
|
1442
|
+
exports.TONE_COLOR = TONE_COLOR;
|
|
1443
|
+
exports.TableSurface = TableSurface;
|
|
1444
|
+
exports.ToneBadge = ToneBadge;
|
|
1445
|
+
exports.TooltipIconButton = TooltipIconButton;
|
|
1446
|
+
exports.ViewAnimation = ViewAnimation;
|
|
1447
|
+
exports.ViewFrame = ViewFrame;
|
|
1448
|
+
exports.ViewHeader = ViewHeader;
|
|
1449
|
+
exports.WIRE_STROKE = WIRE_STROKE;
|
|
1450
|
+
exports.WireDot = WireDot;
|
|
1451
|
+
exports.WorkspaceShell = WorkspaceShell;
|
|
1452
|
+
exports.WorkspaceShellContext = WorkspaceShellContext;
|
|
1453
|
+
exports.dashedRule = dashedRule;
|
|
1454
|
+
exports.enterClass = enterClass;
|
|
1455
|
+
exports.focusRingClass = focusRingClass;
|
|
1456
|
+
exports.formatCount = require_initials.formatCount;
|
|
1457
|
+
exports.hitAreaClass = hitAreaClass;
|
|
1458
|
+
exports.monogram = monogram;
|
|
1459
|
+
exports.nameList = require_initials.nameList;
|
|
1460
|
+
exports.nativeSelectClass = nativeSelectClass;
|
|
1461
|
+
exports.plural = require_initials.plural;
|
|
1462
|
+
exports.prefersReducedMotion = prefersReducedMotion;
|
|
1463
|
+
exports.pressClass = pressClass;
|
|
1464
|
+
exports.scrollRowClass = scrollRowClass;
|
|
1465
|
+
exports.staggerStyle = staggerStyle;
|
|
1466
|
+
exports.startViewTransition = startViewTransition;
|
|
1467
|
+
exports.surfaceInsetClass = surfaceInsetClass;
|
|
1468
|
+
exports.tableGroupRowClass = tableGroupRowClass;
|
|
1469
|
+
exports.tableHeadClass = tableHeadClass;
|
|
1470
|
+
exports.tableRowClass = tableRowClass;
|
|
1471
|
+
exports.useCanvasViewport = useCanvasViewport;
|
|
1472
|
+
exports.useInert = useInert;
|
|
1473
|
+
exports.useReducedMotion = useReducedMotion;
|
|
1474
|
+
exports.useScrollFade = require_use_scroll_fade.useScrollFade;
|
|
1475
|
+
exports.useWorkspaceShell = useWorkspaceShell;
|
|
1476
|
+
exports.wirePath = wirePath;
|
|
1477
|
+
//# sourceMappingURL=index.cjs.map
|