@constructive-io/ui 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{ai-CiaH2sfF.js → ai-4JrVVL3q.js} +1794 -250
- package/dist/ai-4JrVVL3q.js.map +1 -0
- package/dist/{ai-lAkichk8.cjs → ai-B08ufcbD.cjs} +1888 -248
- package/dist/ai-B08ufcbD.cjs.map +1 -0
- package/dist/{alert-BXuP0ayz.d.ts → alert-CJ4Qyk6W.d.cts} +4 -2
- package/dist/{alert-BXuP0ayz.d.cts → alert-CJ4Qyk6W.d.ts} +4 -2
- package/dist/components/accordion.cjs +60 -0
- package/dist/components/accordion.cjs.map +1 -0
- package/dist/components/accordion.d.cts +14 -0
- package/dist/components/accordion.d.ts +14 -0
- package/dist/components/accordion.js +54 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/ai/index.cjs +17 -1
- package/dist/components/ai/index.d.cts +2 -2
- package/dist/components/ai/index.d.ts +2 -2
- package/dist/components/ai/index.js +2 -2
- package/dist/components/alert-dialog.cjs +17 -8
- package/dist/components/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog.d.cts +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +17 -8
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +18 -8
- package/dist/components/alert.cjs.map +1 -1
- package/dist/components/alert.d.cts +2 -2
- package/dist/components/alert.d.ts +2 -2
- package/dist/components/alert.js +18 -9
- package/dist/components/alert.js.map +1 -1
- package/dist/components/autocomplete.cjs +9 -5
- package/dist/components/autocomplete.cjs.map +1 -1
- package/dist/components/autocomplete.js +9 -5
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +9 -3
- package/dist/components/avatar.cjs.map +1 -1
- package/dist/components/avatar.d.cts +6 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.js +9 -3
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +25 -18
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +2 -2
- package/dist/components/badge.d.ts +2 -2
- package/dist/components/badge.js +25 -18
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +9 -6
- package/dist/components/breadcrumb.cjs.map +1 -1
- package/dist/components/breadcrumb.js +9 -6
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.cjs +57 -0
- package/dist/components/button-group.cjs.map +1 -0
- package/dist/components/button-group.d.cts +16 -0
- package/dist/components/button-group.d.ts +16 -0
- package/dist/components/button-group.js +51 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.cjs +62 -18
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +32 -2
- package/dist/components/button.d.ts +32 -2
- package/dist/components/button.js +62 -18
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +14 -8
- package/dist/components/calendar-rac.cjs.map +1 -1
- package/dist/components/calendar-rac.js +14 -8
- package/dist/components/calendar-rac.js.map +1 -1
- package/dist/components/card.cjs +35 -23
- package/dist/components/card.cjs.map +1 -1
- package/dist/components/card.d.cts +3 -2
- package/dist/components/card.d.ts +3 -2
- package/dist/components/card.js +35 -23
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox.cjs +5 -5
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +5 -5
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +3 -3
- package/dist/components/collapsible.cjs.map +1 -1
- package/dist/components/collapsible.js +3 -3
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +24 -12
- package/dist/components/combobox.cjs.map +1 -1
- package/dist/components/combobox.d.cts +2 -1
- package/dist/components/combobox.d.ts +2 -1
- package/dist/components/combobox.js +24 -12
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +30 -14
- package/dist/components/command.cjs.map +1 -1
- package/dist/components/command.d.cts +9 -2
- package/dist/components/command.d.ts +9 -2
- package/dist/components/command.js +30 -14
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +22 -12
- package/dist/components/dialog.cjs.map +1 -1
- package/dist/components/dialog.d.cts +5 -2
- package/dist/components/dialog.d.ts +5 -2
- package/dist/components/dialog.js +22 -12
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +50 -27
- package/dist/components/dock.cjs.map +1 -1
- package/dist/components/dock.d.cts +1 -1
- package/dist/components/dock.d.ts +1 -1
- package/dist/components/dock.js +51 -28
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +22 -14
- package/dist/components/drawer.cjs.map +1 -1
- package/dist/components/drawer.js +22 -14
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +34 -28
- package/dist/components/dropdown-menu.cjs.map +1 -1
- package/dist/components/dropdown-menu.d.cts +2 -2
- package/dist/components/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu.js +52 -46
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +4 -4
- package/dist/components/empty.cjs.map +1 -1
- package/dist/components/empty.js +4 -4
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.cjs +33 -33
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.js +34 -34
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +1 -1
- package/dist/components/flickering-grid.cjs.map +1 -1
- package/dist/components/flickering-grid.js +1 -1
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +10 -5
- package/dist/components/flow-zoom-panel.cjs.map +1 -1
- package/dist/components/flow-zoom-panel.d.cts +8 -1
- package/dist/components/flow-zoom-panel.d.ts +8 -1
- package/dist/components/flow-zoom-panel.js +10 -5
- package/dist/components/flow-zoom-panel.js.map +1 -1
- package/dist/components/form-control.cjs +12 -8
- package/dist/components/form-control.cjs.map +1 -1
- package/dist/components/form-control.js +12 -8
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +5 -5
- package/dist/components/form.cjs.map +1 -1
- package/dist/components/form.js +5 -5
- package/dist/components/form.js.map +1 -1
- package/dist/components/input-group.cjs +13 -7
- package/dist/components/input-group.cjs.map +1 -1
- package/dist/components/input-group.d.cts +2 -2
- package/dist/components/input-group.d.ts +2 -2
- package/dist/components/input-group.js +11 -7
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.cjs +252 -0
- package/dist/components/input-otp.cjs.map +1 -0
- package/dist/components/input-otp.d.cts +44 -0
- package/dist/components/input-otp.d.ts +44 -0
- package/dist/components/input-otp.js +251 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.cjs +10 -4
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.d.cts +11 -2
- package/dist/components/input.d.ts +11 -2
- package/dist/components/input.js +10 -4
- package/dist/components/input.js.map +1 -1
- package/dist/components/item.cjs +151 -0
- package/dist/components/item.cjs.map +1 -0
- package/dist/components/item.d.cts +37 -0
- package/dist/components/item.d.ts +37 -0
- package/dist/components/item.js +137 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/json-input.cjs +4 -143
- package/dist/components/json-input.d.cts +6 -4
- package/dist/components/json-input.d.ts +6 -4
- package/dist/components/json-input.js +2 -140
- package/dist/components/kbd.cjs +35 -0
- package/dist/components/kbd.cjs.map +1 -0
- package/dist/components/kbd.d.cts +16 -0
- package/dist/components/kbd.d.ts +16 -0
- package/dist/components/kbd.js +31 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.cjs +3 -3
- package/dist/components/label.cjs.map +1 -1
- package/dist/components/label.js +3 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/motion-grid.cjs +20 -8
- package/dist/components/motion-grid.cjs.map +1 -1
- package/dist/components/motion-grid.js +20 -8
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +77 -67
- package/dist/components/multi-select.cjs.map +1 -1
- package/dist/components/multi-select.js +77 -67
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +12 -9
- package/dist/components/page-header.cjs.map +1 -1
- package/dist/components/page-header.js +12 -9
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.cjs +10 -4
- package/dist/components/pagination.cjs.map +1 -1
- package/dist/components/pagination.d.cts +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +10 -4
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/phone-input.cjs +228 -0
- package/dist/components/phone-input.cjs.map +1 -0
- package/dist/components/phone-input.d.cts +42 -0
- package/dist/components/phone-input.d.ts +42 -0
- package/dist/components/phone-input.js +220 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/popover.cjs +12 -4
- package/dist/components/popover.cjs.map +1 -1
- package/dist/components/popover.d.cts +7 -1
- package/dist/components/popover.d.ts +7 -1
- package/dist/components/popover.js +12 -5
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.cjs +20 -3
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.d.cts +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +20 -3
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +2 -2
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
- package/dist/components/progressive-blur-scroll-container.d.cts +1 -1
- package/dist/components/progressive-blur-scroll-container.d.ts +1 -1
- package/dist/components/progressive-blur-scroll-container.js +2 -2
- package/dist/components/progressive-blur-scroll-container.js.map +1 -1
- package/dist/components/progressive-blur.cjs +3 -2
- package/dist/components/progressive-blur.cjs.map +1 -1
- package/dist/components/progressive-blur.js +3 -2
- package/dist/components/progressive-blur.js.map +1 -1
- package/dist/components/radio-group.cjs +2 -2
- package/dist/components/radio-group.cjs.map +1 -1
- package/dist/components/radio-group.js +2 -2
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +1 -1
- package/dist/components/record-picker.js +1 -1
- package/dist/components/resizable.cjs +2 -2
- package/dist/components/resizable.cjs.map +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/responsive-diagram.cjs +43 -21
- package/dist/components/responsive-diagram.cjs.map +1 -1
- package/dist/components/responsive-diagram.d.cts +7 -1
- package/dist/components/responsive-diagram.d.ts +7 -1
- package/dist/components/responsive-diagram.js +43 -21
- package/dist/components/responsive-diagram.js.map +1 -1
- package/dist/components/scroll-area.cjs +2 -2
- package/dist/components/scroll-area.cjs.map +1 -1
- package/dist/components/scroll-area.js +2 -2
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.cjs +84 -20
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.d.cts +12 -7
- package/dist/components/select.d.ts +12 -7
- package/dist/components/select.js +84 -20
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.cjs.map +1 -1
- package/dist/components/separator.d.cts +11 -2
- package/dist/components/separator.d.ts +11 -2
- package/dist/components/separator.js +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.cjs +1 -1
- package/dist/components/sheet.d.cts +11 -5
- package/dist/components/sheet.d.ts +12 -6
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.cjs +2 -1
- package/dist/components/sidebar.d.cts +8 -7
- package/dist/components/sidebar.d.ts +8 -7
- package/dist/components/sidebar.js +2 -1
- package/dist/components/slider.cjs +47 -0
- package/dist/components/slider.cjs.map +1 -0
- package/dist/components/slider.d.cts +8 -0
- package/dist/components/slider.d.ts +8 -0
- package/dist/components/slider.js +44 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.cjs +15 -4
- package/dist/components/sonner.cjs.map +1 -1
- package/dist/components/sonner.d.cts +10 -1
- package/dist/components/sonner.d.ts +10 -1
- package/dist/components/sonner.js +16 -5
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.cjs +25 -0
- package/dist/components/spinner.cjs.map +1 -0
- package/dist/components/spinner.d.cts +16 -0
- package/dist/components/spinner.d.ts +16 -0
- package/dist/components/spinner.js +22 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stack/index.cjs +1 -1
- package/dist/components/stack/index.d.cts +1 -1
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/index.js +1 -1
- package/dist/components/stepper.cjs +23 -17
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.d.cts +2 -2
- package/dist/components/stepper.d.ts +2 -2
- package/dist/components/stepper.js +23 -17
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +5 -5
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.js +5 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +26 -7
- package/dist/components/table.cjs.map +1 -1
- package/dist/components/table.d.cts +20 -2
- package/dist/components/table.d.ts +20 -2
- package/dist/components/table.js +26 -8
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +64 -8
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.d.cts +13 -2
- package/dist/components/tabs.d.ts +13 -2
- package/dist/components/tabs.js +66 -11
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +10 -5
- package/dist/components/tags.cjs.map +1 -1
- package/dist/components/tags.d.cts +1 -1
- package/dist/components/tags.d.ts +1 -1
- package/dist/components/tags.js +10 -5
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +5 -4
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.js +5 -4
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast/index.cjs +1 -1
- package/dist/components/toast/index.d.cts +2 -2
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toggle-group.cjs +69 -0
- package/dist/components/toggle-group.cjs.map +1 -0
- package/dist/components/toggle-group.d.cts +27 -0
- package/dist/components/toggle-group.d.ts +27 -0
- package/dist/components/toggle-group.js +65 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.cjs +54 -0
- package/dist/components/toggle.cjs.map +1 -0
- package/dist/components/toggle.d.cts +13 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.js +50 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.cjs +18 -6
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.d.cts +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +18 -6
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +2 -2
- package/dist/components/unlink-button.cjs.map +1 -1
- package/dist/components/unlink-button.d.cts +1 -0
- package/dist/components/unlink-button.d.ts +1 -0
- package/dist/components/unlink-button.js +2 -2
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/components/workspace-kit/index.cjs +1507 -0
- package/dist/components/workspace-kit/index.cjs.map +1 -0
- package/dist/components/workspace-kit/index.d.cts +728 -0
- package/dist/components/workspace-kit/index.d.ts +728 -0
- package/dist/components/workspace-kit/index.js +1440 -0
- package/dist/components/workspace-kit/index.js.map +1 -0
- package/dist/compose-refs-Mbma1O3M.js +47 -0
- package/dist/compose-refs-Mbma1O3M.js.map +1 -0
- package/dist/compose-refs-uPrvNoiU.cjs +52 -0
- package/dist/compose-refs-uPrvNoiU.cjs.map +1 -0
- package/dist/fluid-highlight-CNELHV8o.js +134 -0
- package/dist/fluid-highlight-CNELHV8o.js.map +1 -0
- package/dist/fluid-highlight-YWFRZXsw.cjs +145 -0
- package/dist/fluid-highlight-YWFRZXsw.cjs.map +1 -0
- package/dist/{index-BzLmDsId.d.cts → index-B7cT7gZU.d.cts} +3 -3
- package/dist/{index-BzLmDsId.d.ts → index-B7cT7gZU.d.ts} +3 -3
- package/dist/{index-UnM04j0t.d.ts → index-BQZxmMpw.d.cts} +11 -31
- package/dist/{index-UnM04j0t.d.cts → index-BQZxmMpw.d.ts} +11 -31
- package/dist/{index-CyaFaZe2.d.cts → index-Cluc_xc5.d.ts} +345 -20
- package/dist/{index-B0wXxIAb.d.ts → index-DXoG0ghv.d.cts} +345 -20
- package/dist/index.cjs +107 -17
- package/dist/index.d.cts +64 -14
- package/dist/index.d.ts +64 -14
- package/dist/index.js +27 -14
- package/dist/initial-focus-B8RLtyOZ.cjs +67 -0
- package/dist/initial-focus-B8RLtyOZ.cjs.map +1 -0
- package/dist/initial-focus-j2E0EnIx.js +61 -0
- package/dist/initial-focus-j2E0EnIx.js.map +1 -0
- package/dist/initials-DSkWTOb0.cjs +127 -0
- package/dist/initials-DSkWTOb0.cjs.map +1 -0
- package/dist/initials-kCcHgrSy.js +97 -0
- package/dist/initials-kCcHgrSy.js.map +1 -0
- package/dist/json-input-CH5aEmoA.js +293 -0
- package/dist/json-input-CH5aEmoA.js.map +1 -0
- package/dist/json-input-D8yM578l.cjs +311 -0
- package/dist/json-input-D8yM578l.cjs.map +1 -0
- package/dist/{motion-config-COCFHq1L.cjs → motion-config-DZ7w5Uhq.cjs} +32 -2
- package/dist/motion-config-DZ7w5Uhq.cjs.map +1 -0
- package/dist/{motion-config-COsZ6azM.js → motion-config-DoFp4I8f.js} +21 -3
- package/dist/motion-config-DoFp4I8f.js.map +1 -0
- package/dist/{record-picker-Bz4FApxD.cjs → record-picker-BQ1-Vx0g.cjs} +23 -8
- package/dist/record-picker-BQ1-Vx0g.cjs.map +1 -0
- package/dist/{record-picker-BbxngCeV.js → record-picker-DSRo4RXV.js} +23 -8
- package/dist/record-picker-DSRo4RXV.js.map +1 -0
- package/dist/{sheet-BdA0rfIz.cjs → sheet-OxWlnT_G.cjs} +25 -32
- package/dist/sheet-OxWlnT_G.cjs.map +1 -0
- package/dist/{sheet-BLHnhLRH.js → sheet-wPF_l9Cn.js} +25 -32
- package/dist/sheet-wPF_l9Cn.js.map +1 -0
- package/dist/{sidebar-BavjjJp0.cjs → sidebar-BEEWmJwC.cjs} +74 -57
- package/dist/sidebar-BEEWmJwC.cjs.map +1 -0
- package/dist/{sidebar-DeoL2ttp.js → sidebar-DWl1Azyv.js} +74 -57
- package/dist/sidebar-DWl1Azyv.js.map +1 -0
- package/dist/{stack-ci2lkfkr.cjs → stack-CEvmUSwF.cjs} +12 -10
- package/dist/stack-CEvmUSwF.cjs.map +1 -0
- package/dist/{stack-C9GROTGA.js → stack-Kqu7YaR0.js} +12 -10
- package/dist/stack-Kqu7YaR0.js.map +1 -0
- package/dist/text-runs-CdmlS5C7.cjs +52 -0
- package/dist/text-runs-CdmlS5C7.cjs.map +1 -0
- package/dist/text-runs-DqcEO8L_.js +45 -0
- package/dist/text-runs-DqcEO8L_.js.map +1 -0
- package/dist/theme-CKpIa4Fj.d.cts +536 -0
- package/dist/theme-CKpIa4Fj.d.ts +536 -0
- package/dist/theme-dials-config.cjs +273 -0
- package/dist/theme-dials-config.cjs.map +1 -0
- package/dist/theme-dials-config.d.cts +95 -0
- package/dist/theme-dials-config.d.ts +95 -0
- package/dist/theme-dials-config.js +269 -0
- package/dist/theme-dials-config.js.map +1 -0
- package/dist/theme-presets.cjs +922 -0
- package/dist/theme-presets.cjs.map +1 -0
- package/dist/theme-presets.d.cts +89 -0
- package/dist/theme-presets.d.ts +89 -0
- package/dist/theme-presets.js +912 -0
- package/dist/theme-presets.js.map +1 -0
- package/dist/theme-tuning-CTOHSrsh.d.cts +158 -0
- package/dist/theme-tuning-DOko6Pmy.d.ts +158 -0
- package/dist/theme-tuning.cjs +349 -0
- package/dist/theme-tuning.cjs.map +1 -0
- package/dist/theme-tuning.d.cts +2 -0
- package/dist/theme-tuning.d.ts +2 -0
- package/dist/theme-tuning.js +333 -0
- package/dist/theme-tuning.js.map +1 -0
- package/dist/theme.cjs +438 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +2 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +436 -0
- package/dist/theme.js.map +1 -0
- package/dist/toast-08jF1DBQ.cjs +193 -0
- package/dist/toast-08jF1DBQ.cjs.map +1 -0
- package/dist/toast-CVW5XY4u.js +164 -0
- package/dist/toast-CVW5XY4u.js.map +1 -0
- package/dist/toast-details-BdxxSLlN.cjs +209 -0
- package/dist/toast-details-BdxxSLlN.cjs.map +1 -0
- package/dist/toast-details-CfsB1Vxb.js +198 -0
- package/dist/toast-details-CfsB1Vxb.js.map +1 -0
- package/dist/{tooltip-CTRQoN1A.d.ts → tooltip-Fqb4JK-g.d.cts} +2 -2
- package/dist/{tooltip-CTRQoN1A.d.cts → tooltip-Fqb4JK-g.d.ts} +2 -2
- package/dist/tuning-BKVFsxLr.js +48 -0
- package/dist/tuning-BKVFsxLr.js.map +1 -0
- package/dist/tuning-BRPG7U1U.cjs +71 -0
- package/dist/tuning-BRPG7U1U.cjs.map +1 -0
- package/dist/use-document-theme-BSEuNsEE.cjs +43 -0
- package/dist/use-document-theme-BSEuNsEE.cjs.map +1 -0
- package/dist/use-document-theme-Ch_PqxZz.js +38 -0
- package/dist/use-document-theme-Ch_PqxZz.js.map +1 -0
- package/dist/use-scroll-fade-CaHp52u4.cjs +79 -0
- package/dist/use-scroll-fade-CaHp52u4.cjs.map +1 -0
- package/dist/use-scroll-fade-ilq-o00-.js +72 -0
- package/dist/use-scroll-fade-ilq-o00-.js.map +1 -0
- package/package.json +166 -27
- package/src/styles/globals.css +194 -97
- package/dist/ai-CiaH2sfF.js.map +0 -1
- package/dist/ai-lAkichk8.cjs.map +0 -1
- package/dist/button-Bvh83YGs.d.cts +0 -20
- package/dist/button-Bvh83YGs.d.ts +0 -20
- package/dist/components/app-bar.cjs +0 -81
- package/dist/components/app-bar.cjs.map +0 -1
- package/dist/components/app-bar.d.cts +0 -27
- package/dist/components/app-bar.d.ts +0 -27
- package/dist/components/app-bar.js +0 -77
- package/dist/components/app-bar.js.map +0 -1
- package/dist/components/app-shell.cjs +0 -267
- package/dist/components/app-shell.cjs.map +0 -1
- package/dist/components/app-shell.d.cts +0 -98
- package/dist/components/app-shell.d.ts +0 -98
- package/dist/components/app-shell.js +0 -264
- package/dist/components/app-shell.js.map +0 -1
- package/dist/components/json-input.cjs.map +0 -1
- package/dist/components/json-input.js.map +0 -1
- package/dist/input-CBrCuMH8.d.cts +0 -11
- package/dist/input-CBrCuMH8.d.ts +0 -11
- package/dist/motion-config-COCFHq1L.cjs.map +0 -1
- package/dist/motion-config-COsZ6azM.js.map +0 -1
- package/dist/record-picker-BbxngCeV.js.map +0 -1
- package/dist/record-picker-Bz4FApxD.cjs.map +0 -1
- package/dist/separator-BQEsr0Rc.d.cts +0 -11
- package/dist/separator-BQEsr0Rc.d.ts +0 -11
- package/dist/sheet-BLHnhLRH.js.map +0 -1
- package/dist/sheet-BdA0rfIz.cjs.map +0 -1
- package/dist/sidebar-BavjjJp0.cjs.map +0 -1
- package/dist/sidebar-DeoL2ttp.js.map +0 -1
- package/dist/stack-C9GROTGA.js.map +0 -1
- package/dist/stack-ci2lkfkr.cjs.map +0 -1
- package/dist/toast-D6MqijT2.cjs +0 -316
- package/dist/toast-D6MqijT2.cjs.map +0 -1
- package/dist/toast-D_BOLzm3.js +0 -287
- package/dist/toast-D_BOLzm3.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","React","React","React","React","React","React","React"],"sources":["../../../src/components/workspace-kit/shell.tsx","../../../src/components/workspace-kit/primitives.tsx","../../../src/components/workspace-kit/reduced-motion.ts","../../../src/components/workspace-kit/canvas.tsx","../../../src/components/workspace-kit/menu.tsx","../../../src/components/workspace-kit/nav.tsx","../../../src/components/workspace-kit/middle-truncate.tsx","../../../src/components/workspace-kit/surface.tsx","../../../src/components/workspace-kit/view-transition.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { Sheet, SheetContent, SheetTitle } from '../sheet';\nimport { TooltipProvider } from '../tooltip';\n\n/** An icon for a navigation row or account action: any component that takes a class name. */\ntype WorkspaceIcon = React.ComponentType<{ className?: string; 'aria-hidden'?: boolean | 'true' | 'false' }>;\n\n/** The product mark at the top of the sidebar. */\ntype WorkspaceBrand = {\n\tname: React.ReactNode;\n\tdescription?: React.ReactNode;\n\thref?: string;\n\tlogo?: React.ReactNode;\n};\n\n/** One sidebar destination. Rows are links, so hosts keep their own router. */\ntype WorkspaceNavigationItem = {\n\tid: string;\n\tlabel: React.ReactNode;\n\thref: string;\n\tisActive?: boolean;\n\tdisabled?: boolean;\n\ticon?: WorkspaceIcon;\n\t/** Quiet trailing value, such as a count. */\n\tbadge?: React.ReactNode;\n};\n\n/** A titled run of sidebar rows. */\ntype WorkspaceNavigationGroup = {\n\tid: string;\n\tlabel?: React.ReactNode;\n\titems: readonly WorkspaceNavigationItem[];\n};\n\ntype WorkspaceAccountActionBase = {\n\tid: string;\n\tlabel: React.ReactNode;\n\ticon?: WorkspaceIcon;\n\tdisabled?: boolean;\n\tvariant?: 'default' | 'destructive';\n};\n\n/** A session action in the account menu: a link, or a callback. */\ntype WorkspaceAccountAction = WorkspaceAccountActionBase &\n\t({ href: string; onSelect?: never } | { href?: never; onSelect: () => void });\n\ntype WorkspaceAccountActionGroup = {\n\tid: string;\n\tlabel?: React.ReactNode;\n\tactions: readonly WorkspaceAccountAction[];\n};\n\n/** The signed-in person shown at the foot of the sidebar. */\ntype WorkspaceAccount = {\n\tname: string;\n\tsecondaryLabel?: string;\n\tavatarUrl?: string;\n\tavatarAlt?: string;\n\t/** Initials when there is no avatar; derived from `name` by default. */\n\tfallback?: string;\n\tactionGroups?: readonly WorkspaceAccountActionGroup[];\n};\n\ntype WorkspaceShellContextValue = {\n\t/** Opens the navigation drawer shown below the sidebar breakpoint. */\n\topenNav: () => void;\n};\n\nconst WorkspaceShellContext = React.createContext<WorkspaceShellContextValue>({ openNav: () => {} });\n\n/** The enclosing workspace shell. Outside one, `openNav` is a no-op. */\nfunction useWorkspaceShell() {\n\treturn React.useContext(WorkspaceShellContext);\n}\n\ntype WorkspaceSidebarRenderProps = {\n\t/** `rail` sits beside the content from the `3xl` container width up; `drawer` renders inside the mobile sheet. */\n\tmode: 'rail' | 'drawer';\n\t/** Icon-rail state. Always false in the drawer. */\n\tcollapsed: boolean;\n\tonCollapsedChange: (collapsed: boolean) => void;\n\t/** Closes the drawer. Call it after any navigation item is chosen. */\n\tonNavigate: () => void;\n};\n\ntype WorkspaceShellProps = {\n\t/** Rendered twice: once as the rail and once inside the navigation drawer. */\n\tsidebar: (props: WorkspaceSidebarRenderProps) => React.ReactNode;\n\tchildren: React.ReactNode;\n\t/** `data-slot` on the root, so hosts and tests can target a specific template. */\n\tslot?: string;\n\tdefaultSidebarCollapsed?: boolean;\n\t/**\n\t * Sits the workspace in a rounded, hairline-edged frame on a canvas one tier\n\t * darker than the content, for hosts that present it as an app window rather\n\t * than the whole page. `className` then lands on the canvas.\n\t */\n\tframed?: boolean;\n\tclassName?: string;\n};\n\n/**\n * Workspace layout shared by the application templates: a collapsible sidebar\n * rail beside the main region, a left drawer below the `3xl` container width,\n * a skip link, and one tooltip provider. The root is the `ws` container, so\n * every view sizes itself to the space it is given rather than the viewport.\n */\nfunction WorkspaceShell({\n\tsidebar,\n\tchildren,\n\tslot = 'workspace-shell',\n\tdefaultSidebarCollapsed = false,\n\tframed = false,\n\tclassName,\n}: WorkspaceShellProps) {\n\tconst [collapsed, setCollapsed] = React.useState(defaultSidebarCollapsed);\n\tconst [navOpen, setNavOpen] = React.useState(false);\n\tconst mainId = React.useId();\n\tconst context = React.useMemo<WorkspaceShellContextValue>(() => ({ openNav: () => setNavOpen(true) }), []);\n\tconst closeNav = React.useCallback(() => setNavOpen(false), []);\n\n\tconst shell = (\n\t\t<div\n\t\t\tdata-slot={slot}\n\t\t\tdata-framed={framed || undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'@container/ws relative flex h-full min-h-0 w-full overflow-hidden bg-background text-foreground',\n\t\t\t\tframed ? 'min-w-0 flex-1 rounded-xl border border-border shadow-xs' : className,\n\t\t\t)}\n\t\t>\n\t\t\t<a\n\t\t\t\thref={`#${mainId}`}\n\t\t\t\tclassName=\"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\"\n\t\t\t>\n\t\t\t\tSkip to main content\n\t\t\t</a>\n\t\t\t<div className=\"hidden h-full @3xl/ws:flex\">\n\t\t\t\t{sidebar({ mode: 'rail', collapsed, onCollapsedChange: setCollapsed, onNavigate: () => {} })}\n\t\t\t</div>\n\t\t\t<main id={mainId} tabIndex={-1} className=\"@container/view flex min-w-0 flex-1 outline-none\">\n\t\t\t\t{children}\n\t\t\t</main>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<WorkspaceShellContext.Provider value={context}>\n\t\t\t<TooltipProvider>\n\t\t\t\t{framed ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-slot=\"workspace-canvas\"\n\t\t\t\t\t\t// One tier past the sidebar so the frame edge reads against it: the page mixed toward the text colour\n\t\t\t\t\t\t// in light (about #f1f1f1 on the builtin theme, and preset-aware), and toward black in dark.\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'flex h-full min-h-0 w-full bg-[color-mix(in_oklab,var(--background),var(--foreground)_6%)] p-2 sm:p-3',\n\t\t\t\t\t\t\t'dark:bg-[color-mix(in_oklab,var(--background),black_35%)]',\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{shell}\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\tshell\n\t\t\t\t)}\n\t\t\t\t<Sheet open={navOpen} onOpenChange={setNavOpen}>\n\t\t\t\t\t<SheetContent side=\"left\" showClose={false} className=\"w-72 max-w-[85vw] gap-0 p-0 sm:max-w-72\">\n\t\t\t\t\t\t<SheetTitle className=\"sr-only\">Navigation</SheetTitle>\n\t\t\t\t\t\t{sidebar({ mode: 'drawer', collapsed: false, onCollapsedChange: setCollapsed, onNavigate: closeNav })}\n\t\t\t\t\t</SheetContent>\n\t\t\t\t</Sheet>\n\t\t\t</TooltipProvider>\n\t\t</WorkspaceShellContext.Provider>\n\t);\n}\n\nexport { useWorkspaceShell, WorkspaceShell, WorkspaceShellContext };\nexport type {\n\tWorkspaceAccount,\n\tWorkspaceAccountAction,\n\tWorkspaceAccountActionGroup,\n\tWorkspaceBrand,\n\tWorkspaceIcon,\n\tWorkspaceNavigationGroup,\n\tWorkspaceNavigationItem,\n\tWorkspaceShellContextValue,\n\tWorkspaceShellProps,\n\tWorkspaceSidebarRenderProps,\n};\n","'use client';\n\nimport { useDirection } from '@base-ui/react/direction-provider';\nimport { type LucideIcon, Menu, Search } from 'lucide-react';\nimport * as React from 'react';\n\nimport { formatCount } from '../../lib/intl';\nimport { useScrollFade } from '../../lib/use-scroll-fade';\nimport { cn } from '../../lib/utils';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip';\nimport { useWorkspaceShell } from './shell';\n\n/** Tactile press for custom controls: 0.96, never lower. */\nexport const pressClass = 'transition-transform duration-(--duration-fast) ease-out motion-safe:active:scale-[0.96]';\n\n/** Grows a small control's hit area to at least 40px without changing its box. */\nexport const hitAreaClass = \"relative before:absolute before:-inset-2 before:content-[''] pointer-coarse:before:-inset-2.5\";\n\nexport const focusRingClass = 'outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50';\n\nconst ICON_BUTTON_VARIANT = {\n\tghost: 'text-muted-foreground hover:bg-overlay-hover hover:text-foreground',\n\traised: 'bg-card text-foreground shadow-card hover:bg-muted',\n} as const;\n\nconst ICON_BUTTON_SIZE = {\n\tsm: 'size-6',\n\tmd: 'size-7',\n\tlg: 'size-8',\n} as const;\n\ntype IconButtonOptions = {\n\tvariant?: keyof typeof ICON_BUTTON_VARIANT;\n\tsize?: keyof typeof ICON_BUTTON_SIZE;\n\t/** Set false when neighbours sit closer than the extended hit area. */\n\textendHitArea?: boolean;\n\t/** For a menu trigger: it keeps its hover fill while the menu is open, so the menu reads as coming from it. */\n\tmenu?: boolean;\n};\n\n/**\n * The look of `TooltipIconButton`, for icon-only controls that render their own\n * element, such as a menu trigger. Hover state is instant; press scales to 0.96.\n */\nexport function iconButtonClass({ variant = 'ghost', size = 'md', extendHitArea = true, menu = false }: IconButtonOptions = {}) {\n\treturn cn(\n\t\t'grid shrink-0 cursor-pointer place-items-center rounded-md disabled:cursor-not-allowed disabled:opacity-40',\n\t\tICON_BUTTON_VARIANT[variant],\n\t\tICON_BUTTON_SIZE[size],\n\t\tpressClass,\n\t\tfocusRingClass,\n\t\textendHitArea && hitAreaClass,\n\t\tmenu && 'data-popup-open:bg-overlay-hover',\n\t);\n}\n\ntype TooltipIconButtonProps = Omit<React.ComponentProps<'button'>, 'aria-label'> &\n\tOmit<IconButtonOptions, 'menu'> & {\n\t\tlabel: string;\n\t\tside?: 'top' | 'right' | 'bottom' | 'left';\n\t};\n\n/**\n * Icon-only button with a matching tooltip and accessible name. Hover state is\n * instant; press scales to 0.96.\n */\nexport function TooltipIconButton({\n\tlabel,\n\tside = 'top',\n\tvariant,\n\tsize,\n\textendHitArea,\n\tclassName,\n\tchildren,\n\t...props\n}: TooltipIconButtonProps) {\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger\n\t\t\t\trender={\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\taria-label={label}\n\t\t\t\t\t\tclassName={cn(iconButtonClass({ variant, size, extendHitArea }), className)}\n\t\t\t\t\t\t{...props}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</button>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<TooltipContent side={side}>{label}</TooltipContent>\n\t\t</Tooltip>\n\t);\n}\n\n/** CSS colour for each non-neutral tone, for tints mixed at runtime. */\nexport const TONE_COLOR = {\n\tprimary: 'var(--primary)',\n\twarning: 'var(--warning)',\n\tviolet: 'var(--chart-3)',\n\tamber: 'var(--chart-4)',\n\tsuccess: 'var(--success)',\n\tdanger: 'var(--destructive)',\n\tinfo: 'var(--info)',\n} as const;\n\nexport type Tone = keyof typeof TONE_COLOR | 'neutral';\n\ntype ToneBadgeProps = {\n\ttone: Tone;\n\tchildren: React.ReactNode;\n\tonClick?: () => void;\n\tclassName?: string;\n};\n\n/**\n * Tone fills mixed from `--tone`. On a white page the fill carries the colour and the\n * border only defines the edge; dark keeps a fainter fill under a stronger border.\n * The light edge is translucent so it sits on any row tint, and where relative colours\n * work its chroma is capped first: a translucent edge of a tone outside sRGB (the info\n * blue) otherwise renders yellow at the rounded corners.\n */\nconst toneBadgeClass = cn(\n\t'[--tone-edge:color-mix(in_oklab,var(--tone)_25%,transparent)]',\n\t'supports-[color:oklch(from_red_l_c_h)]:[--tone-edge:color-mix(in_oklab,oklch(from_var(--tone)_l_min(c,0.12)_h)_25%,transparent)]',\n\t'border-(--tone-edge) bg-[color-mix(in_oklab,var(--tone)_14%,transparent)]',\n\t'text-[color-mix(in_oklab,var(--tone),var(--foreground)_32%)]',\n\t'dark:border-[color-mix(in_oklab,var(--tone)_35%,transparent)] dark:bg-[color-mix(in_oklab,var(--tone)_9%,transparent)]',\n);\n\n/** Small tinted label. Clickable when `onClick` is set. */\nexport function ToneBadge({ tone, children, onClick, className }: ToneBadgeProps) {\n\tconst color = tone === 'neutral' ? null : TONE_COLOR[tone];\n\tconst props = {\n\t\tclassName: cn(\n\t\t\t'inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-[5px] border px-1.5 text-xs [&_svg]:size-3',\n\t\t\tcolor ? toneBadgeClass : 'border-border bg-muted/60 text-muted-foreground',\n\t\t\tonClick && cn('cursor-pointer', pressClass, focusRingClass),\n\t\t\tclassName,\n\t\t),\n\t\tstyle: color ? ({ '--tone': color } as React.CSSProperties) : undefined,\n\t};\n\treturn onClick ? (\n\t\t<button type=\"button\" onClick={onClick} {...props}>\n\t\t\t{children}\n\t\t</button>\n\t) : (\n\t\t<span {...props}>{children}</span>\n\t);\n}\n\ntype SearchFieldProps = Omit<React.ComponentProps<'input'>, 'type'> & {\n\tlabel: string;\n\ttrailing?: React.ReactNode;\n\tinputRef?: React.Ref<HTMLInputElement>;\n};\n\n/** Compact search input with a leading glyph and a visually hidden label. */\nexport function SearchField({ label, trailing, inputRef, className, ...props }: SearchFieldProps) {\n\treturn (\n\t\t<label\n\t\t\tclassName={cn(\n\t\t\t\t'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',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Search aria-hidden=\"true\" className=\"size-3.5 shrink-0 text-muted-foreground\" />\n\t\t\t<span className=\"sr-only\">{label}</span>\n\t\t\t<input\n\t\t\t\tref={inputRef}\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName=\"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\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t\t{trailing}\n\t\t</label>\n\t);\n}\n\ntype ViewHeaderProps = {\n\ticon: LucideIcon;\n\ttitle: React.ReactNode;\n\tchildren?: React.ReactNode;\n\tdivider?: boolean;\n};\n\n/** Opens the navigation drawer; only rendered below the sidebar breakpoint. */\nexport function NavMenuButton() {\n\tconst { openNav } = useWorkspaceShell();\n\treturn (\n\t\t<TooltipIconButton label=\"Open navigation\" side=\"bottom\" className=\"-ms-1 text-foreground @3xl/ws:hidden\" onClick={openNav}>\n\t\t\t<Menu aria-hidden=\"true\" className=\"size-4\" />\n\t\t</TooltipIconButton>\n\t);\n}\n\n/**\n * View header at least 48px tall: icon and title on the left, actions on the\n * right. The title keeps a floor of 8rem, so on a narrow view the actions wrap\n * onto a second row instead of squeezing it to an ellipsis.\n */\nexport function ViewHeader({ icon: Icon, title, children, divider = true }: ViewHeaderProps) {\n\treturn (\n\t\t<header className={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')}>\n\t\t\t<NavMenuButton />\n\t\t\t<div className=\"flex min-w-0 flex-1 basis-32 items-center gap-1.5\">\n\t\t\t\t<Icon aria-hidden=\"true\" className=\"hidden size-3.5 shrink-0 text-muted-foreground @3xl/ws:block\" />\n\t\t\t\t<h1 title={typeof title === 'string' ? title : undefined} className=\"truncate text-sm font-medium text-foreground\">\n\t\t\t\t\t{title}\n\t\t\t\t</h1>\n\t\t\t</div>\n\t\t\t{children ? <div className=\"ms-auto flex shrink-0 items-center gap-2\">{children}</div> : null}\n\t\t</header>\n\t);\n}\n\ntype ViewFrameProps = {\n\ticon: LucideIcon;\n\ttitle: React.ReactNode;\n\t/** Header controls on the right. */\n\tactions?: React.ReactNode;\n\t/** Accessible name for the view region; defaults to the title when it is a string. */\n\tlabel?: string;\n\t/** Widest the content column grows. */\n\tmaxWidth?: string;\n\tclassName?: string;\n\tchildren: React.ReactNode;\n};\n\n/**\n * A full view: the 48px header over a scrolling, centred content column with\n * container-relative padding. Views keep their own scroll so the sidebar\n * never moves.\n */\nexport function ViewFrame({ icon, title, actions, label, maxWidth = 'max-w-6xl', className, children }: ViewFrameProps) {\n\treturn (\n\t\t<section aria-label={label ?? (typeof title === 'string' ? title : undefined)} className=\"flex min-h-0 min-w-0 flex-1 flex-col\">\n\t\t\t<ViewHeader icon={icon} title={title}>\n\t\t\t\t{actions}\n\t\t\t</ViewHeader>\n\t\t\t<div className=\"min-h-0 flex-1 overflow-y-auto\">\n\t\t\t\t<div className={cn('mx-auto flex w-full flex-col gap-6 px-4 py-5 @3xl/view:px-6 @3xl/view:py-6', maxWidth, className)}>{children}</div>\n\t\t\t</div>\n\t\t</section>\n\t);\n}\n\n/**\n * Sideways-scrolling row whose children keep their shadows. A scroll container\n * clips everything outside its padding box, which would shave the ring and\n * drop shadow off raised children; the matching negative margin and padding\n * give them room without moving the row.\n */\nexport const scrollRowClass = '-m-2 overflow-x-auto p-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden';\n\ntype FilterGroupProps<T extends string> = {\n\tlabel: string;\n\tvalue: T;\n\toptions: { value: T; label: string; count?: number; icon?: LucideIcon }[];\n\tonChange: (value: T) => void;\n\t/** Shows only icons in narrow containers; labels stay available to screen readers. */\n\tcompact?: boolean;\n\t/** Styles the pill row, e.g. a tinted track. */\n\tclassName?: string;\n\t/** Styles the scroll wrapper, e.g. to stop it shrinking in a toolbar. */\n\trootClassName?: string;\n\t/** Locale for the counts. Defaults to en-US. */\n\tlocale?: string;\n};\n\n/** Single-choice filter pills with optional counts; scrolls sideways when narrow. */\nexport function FilterGroup<T extends string>({ label, value, options, onChange, compact = false, className, rootClassName, locale }: FilterGroupProps<T>) {\n\tconst rtl = useDirection() === 'rtl';\n\tconst { ref, style } = useScrollFade<HTMLDivElement>();\n\treturn (\n\t\t<div ref={ref} style={style} className={cn(scrollRowClass, 'min-w-0', rootClassName)}>\n\t\t\t<div role=\"radiogroup\" aria-label={label} className={cn('flex w-max gap-1', className)}>\n\t\t\t\t{options.map((option, index) => {\n\t\t\t\t\tconst active = value === option.value;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\trole=\"radio\"\n\t\t\t\t\t\t\taria-checked={active}\n\t\t\t\t\t\t\ttabIndex={active ? 0 : -1}\n\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\tconst nextIndex = event.key === 'Home' ? 0\n\t\t\t\t\t\t\t\t\t: event.key === 'End' ? options.length - 1\n\t\t\t\t\t\t\t\t\t: event.key === (rtl ? 'ArrowLeft' : 'ArrowRight') || event.key === 'ArrowDown' ? (index + 1) % options.length\n\t\t\t\t\t\t\t\t\t: event.key === (rtl ? 'ArrowRight' : 'ArrowLeft') || event.key === 'ArrowUp' ? (index - 1 + options.length) % options.length\n\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\tif (nextIndex === undefined) return;\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\tevent.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]')[nextIndex]?.focus();\n\t\t\t\t\t\t\t\tonChange(options[nextIndex]!.value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonClick={() => onChange(option.value)}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'inline-flex h-7 shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2 text-[0.8125rem] pointer-coarse:h-9',\n\t\t\t\t\t\t\t\tpressClass,\n\t\t\t\t\t\t\t\tfocusRingClass,\n\t\t\t\t\t\t\t\tactive ? 'bg-card font-medium text-foreground shadow-card' : 'text-muted-foreground hover:text-foreground',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{option.icon ? <option.icon aria-hidden=\"true\" className=\"size-3.5 shrink-0\" /> : null}\n\t\t\t\t\t\t\t<span className={compact && option.icon ? 'sr-only @md/view:not-sr-only' : undefined}>{option.label}</span>\n\t\t\t\t\t\t\t{option.count === undefined ? null : (\n\t\t\t\t\t\t\t\t<span className={cn('text-xs tabular-nums', active ? 'text-muted-foreground' : 'text-subtle-foreground')}>{formatCount(option.count, locale)}</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\ntype SegmentedChoice<T extends string> = { value: T; label: string; icon?: LucideIcon };\n\ntype SegmentedProps<T extends string> = {\n\tlabel: string;\n\tvalue: T;\n\toptions: SegmentedChoice<T>[];\n\tonChange: (value: T) => void;\n\tclassName?: string;\n};\n\n/**\n * Two-to-four option segmented control. The track has a 6px radius and 2px\n * padding, so each segment is 4px (concentric with the track).\n */\nexport function Segmented<T extends string>({ label, value, options, onChange, className }: SegmentedProps<T>) {\n\treturn (\n\t\t<div role=\"radiogroup\" aria-label={label} className={cn('flex gap-0.5 rounded-sm bg-muted p-0.5', className)}>\n\t\t\t{options.map((option) => {\n\t\t\t\tconst Icon = option.icon;\n\t\t\t\tconst active = value === option.value;\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"radio\"\n\t\t\t\t\t\taria-checked={active}\n\t\t\t\t\t\taria-label={Icon ? option.label : undefined}\n\t\t\t\t\t\tonClick={() => onChange(option.value)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'grid h-7 flex-1 cursor-pointer place-items-center whitespace-nowrap rounded-[4px] px-2 text-[0.8125rem]',\n\t\t\t\t\t\t\tpressClass,\n\t\t\t\t\t\t\tfocusRingClass,\n\t\t\t\t\t\t\tactive ? 'bg-card font-medium text-foreground shadow-card' : 'text-muted-foreground hover:text-foreground',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{Icon ? <Icon aria-hidden=\"true\" className=\"size-3.5\" /> : option.label}\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}\n\n/**\n * Card surfaces whose full-bleed children (tinted strips, sticky columns,\n * table heads, canvas grids) must not cover the edge. `shadow-card` draws its\n * edge as an inset shadow in both modes, which keeps it safe from any clipping\n * ancestor but paints it beneath children, so the surface gets a 1px inset and\n * every child lives in `SurfaceBody`.\n */\nexport const surfaceInsetClass = 'overflow-hidden p-px';\n\nexport function SurfaceBody({ className, children, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div className={cn('relative h-full overflow-hidden rounded-[inherit]', className)} {...props}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\n/** Staggered entrance for a column of blocks: each child waits `step` ms longer. */\nexport function staggerStyle(index: number, step = 80): React.CSSProperties {\n\treturn { animationDelay: `${index * step}ms` };\n}\n\nexport const enterClass = 'animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] motion-reduce:animate-none';\n\n/**\n * Ref that toggles the DOM `inert` property. React 18 has no `inert` prop and\n * React 19 treats it as boolean, so setting the property works on both.\n */\nexport function useInert<T extends HTMLElement>(inert: boolean) {\n\treturn React.useCallback(\n\t\t(node: T | null) => {\n\t\t\tif (node) node.inert = inert;\n\t\t},\n\t\t[inert],\n\t);\n}\n","'use client';\n\nimport * as React from 'react';\n\nconst REDUCED_MOTION_QUERY = '(prefers-reduced-motion: reduce)';\n\nexport function prefersReducedMotion() {\n\treturn typeof window !== 'undefined' && Boolean(window.matchMedia?.(REDUCED_MOTION_QUERY).matches);\n}\n\nfunction subscribeReducedMotion(onChange: () => void) {\n\tconst query = typeof window === 'undefined' ? undefined : window.matchMedia?.(REDUCED_MOTION_QUERY);\n\tquery?.addEventListener('change', onChange);\n\treturn () => query?.removeEventListener('change', onChange);\n}\n\n/** Reduced-motion preference that renders `false` on the server and hydrates without a mismatch. */\nexport function useReducedMotion() {\n\treturn React.useSyncExternalStore(subscribeReducedMotion, prefersReducedMotion, () => false);\n}\n","'use client';\n\nimport { Minus, Plus, Scan } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { focusRingClass, pressClass, SurfaceBody, surfaceInsetClass, TooltipIconButton } from './primitives';\nimport { prefersReducedMotion } from './reduced-motion';\n\nexport type Viewport = { x: number; y: number; zoom: number };\n/** A rectangle in canvas units, e.g. where a node will settle. */\nexport type CanvasBox = { x: number; y: number; width: number; height: number };\n\ntype CanvasInset = { side: number; top: number; bottom: number };\n\nexport type CanvasViewportOptions = {\n\t/**\n\t * `width` fits the content's width and pins it to the top, for a column\n\t * layout that grows downwards. `contain` fits both axes and centres.\n\t */\n\tfit?: 'width' | 'contain';\n\t/** Content height in canvas units; `contain` needs it. */\n\tcontentHeight?: number;\n\t/** Top-left corner of the content in canvas units, when it doesn't start at the origin. */\n\tcontentOrigin?: { x: number; y: number };\n\tminZoom?: number;\n\tmaxZoom?: number;\n\t/**\n\t * Smallest zoom a `contain` fit may choose; below it the content stays\n\t * readable, centred horizontally and pinned to the top. Defaults to `minZoom`.\n\t */\n\tminFitZoom?: number;\n\t/** Room kept clear at the edges when fitting and revealing, e.g. for pinned controls. */\n\tinset?: CanvasInset;\n};\n\nconst ZOOM_STEP = 0.25;\nconst DEFAULT_INSET: CanvasInset = { side: 24, top: 64, bottom: 68 };\nconst EASE = {\n\tpan: '240ms cubic-bezier(0.5, 0, 0.1, 1)',\n\treveal: '600ms cubic-bezier(0.32, 0, 0.08, 1)',\n} as const;\n\n/** Elements marked with this attribute (and native controls) never start a pan or swallow wheel scrolling. */\nexport const NO_PAN_ATTRIBUTE = 'data-no-pan';\n/** Nodes that handle their own presses (select, drag) but still let the wheel pan and zoom over them. */\nexport const CANVAS_NODE_ATTRIBUTE = 'data-canvas-node';\nconst NO_PAN_SELECTOR = `button, a, input, textarea, select, [${NO_PAN_ATTRIBUTE}], [${CANVAS_NODE_ATTRIBUTE}]`;\n\nfunction zoomAround(view: Viewport, zoom: number, cx: number, cy: number): Viewport {\n\tconst px = (cx - view.x) / view.zoom;\n\tconst py = (cy - view.y) / view.zoom;\n\treturn { zoom, x: cx - px * zoom, y: cy - py * zoom };\n}\n\n/**\n * Pan and zoom state for a canvas: drag, pinch, wheel, ctrl/⌘-wheel,\n * keyboard, and zoom buttons, plus `reveal` to ease a node into view and\n * `fit` to frame the content again. The view keeps fitting its container\n * until the person pans or zooms. Transitions are skipped while dragging so\n * the canvas tracks the pointer 1:1.\n */\nexport function useCanvasViewport(contentWidth: number, options: CanvasViewportOptions = {}) {\n\tconst { fit: fitMode = 'width', contentHeight = 0, minZoom = 0.5, maxZoom = 2 } = options;\n\tconst minFitZoom = options.minFitZoom ?? minZoom;\n\tconst originX = options.contentOrigin?.x ?? 0;\n\tconst originY = options.contentOrigin?.y ?? 0;\n\tconst inset = options.inset ?? DEFAULT_INSET;\n\tconst { side, top, bottom } = inset;\n\tconst viewportRef = React.useRef<HTMLDivElement | null>(null);\n\t// The canvas may mount after the hook (e.g. once data loads), so effects follow the element itself.\n\tconst [element, setElement] = React.useState<HTMLDivElement | null>(null);\n\tconst attach = React.useCallback((node: HTMLDivElement | null) => {\n\t\tviewportRef.current = node;\n\t\tsetElement(node);\n\t}, []);\n\t/** Active pointers by id; one drags, two pinch. */\n\tconst pointers = React.useRef(new Map<number, { x: number; y: number }>());\n\tconst gesture = React.useRef<{ view: Viewport; x: number; y: number; distance: number } | null>(null);\n\tconst [view, setView] = React.useState<Viewport>({ x: side, y: top, zoom: 1 });\n\tconst [transition, setTransition] = React.useState<string>('none');\n\tconst [dragging, setDragging] = React.useState(false);\n\tconst viewRef = React.useRef(view);\n\tReact.useLayoutEffect(() => {\n\t\tviewRef.current = view;\n\t});\n\n\t/** Set once the person pans or zooms; until then the view keeps fitting its container. */\n\tconst touched = React.useRef(false);\n\t/** Whether the last press moved far enough to count as a pan rather than a click. */\n\tconst panned = React.useRef(false);\n\n\tconst clampZoom = React.useCallback((zoom: number) => Math.min(maxZoom, Math.max(minZoom, zoom)), [maxZoom, minZoom]);\n\n\tconst place = React.useCallback((update: (view: Viewport) => Viewport, ease: keyof typeof EASE | null) => {\n\t\tsetTransition(ease && !prefersReducedMotion() ? EASE[ease] : 'none');\n\t\tsetView(update);\n\t}, []);\n\n\tconst move = React.useCallback(\n\t\t(update: (view: Viewport) => Viewport, ease: keyof typeof EASE | null) => {\n\t\t\ttouched.current = true;\n\t\t\tplace(update, ease);\n\t\t},\n\t\t[place],\n\t);\n\n\tconst fitted = React.useCallback((): Viewport | null => {\n\t\tconst viewport = viewportRef.current;\n\t\tif (!viewport || viewport.clientWidth === 0 || contentWidth === 0) return null;\n\t\tconst width = viewport.clientWidth;\n\t\tconst availableWidth = width - side * 2;\n\t\tif (fitMode === 'width') {\n\t\t\tconst zoom = Math.max(minZoom, Math.min(1, Math.floor((availableWidth / contentWidth) * 20) / 20));\n\t\t\treturn { x: Math.max(side, Math.round((width - contentWidth * zoom) / 2)) - originX * zoom, y: top - originY * zoom, zoom };\n\t\t}\n\t\tconst availableHeight = viewport.clientHeight - top - bottom;\n\t\tconst fitZoom = Math.min(1, availableWidth / contentWidth, contentHeight ? availableHeight / contentHeight : 1);\n\t\tconst zoom = Math.max(minFitZoom, Math.floor(fitZoom * 20) / 20);\n\t\treturn {\n\t\t\t// Content wider than the view starts at the edge instead of being centred, which would cut off both sides with nothing to say there is more.\n\t\t\tx: Math.max(side, Math.round((width - contentWidth * zoom) / 2)) - originX * zoom,\n\t\t\ty: Math.round(top + Math.max(0, (availableHeight - contentHeight * zoom) / 2) - originY * zoom),\n\t\t\tzoom,\n\t\t};\n\t}, [bottom, contentHeight, contentWidth, fitMode, minFitZoom, minZoom, originX, originY, side, top]);\n\n\t// Keep fitting until the person takes over: at once as the canvas resizes (a panel opening, a\n\t// mobile tab revealing it), and eased when the content changes (data arriving, say).\n\tconst refit = React.useCallback(\n\t\t(ease: keyof typeof EASE | null) => {\n\t\t\tif (touched.current) return;\n\t\t\tconst next = fitted();\n\t\t\tif (next) place(() => next, ease);\n\t\t},\n\t\t[fitted, place],\n\t);\n\tconst latestRefit = React.useRef(refit);\n\tconst fittedElement = React.useRef<HTMLDivElement | null>(null);\n\tReact.useLayoutEffect(() => {\n\t\tlatestRefit.current = refit;\n\t\t// A new canvas fits at once; new content eases into its new frame.\n\t\tif (element) refit(fittedElement.current === element ? 'reveal' : null);\n\t\tfittedElement.current = element;\n\t}, [element, refit]);\n\tReact.useLayoutEffect(() => {\n\t\tif (!element) return;\n\t\tlet size = [element.clientWidth, element.clientHeight];\n\t\tconst observer = new ResizeObserver(() => {\n\t\t\t// The first callback reports the size we already have; skipping it keeps an eased refit running.\n\t\t\tif (size[0] === element.clientWidth && size[1] === element.clientHeight) return;\n\t\t\tsize = [element.clientWidth, element.clientHeight];\n\t\t\tlatestRefit.current(null);\n\t\t});\n\t\tobserver.observe(element);\n\t\treturn () => observer.disconnect();\n\t}, [element]);\n\n\t/** Keeps the current view and stops fitting, as a pan would; for edits the person makes to the content. */\n\tconst hold = React.useCallback(() => {\n\t\ttouched.current = true;\n\t}, []);\n\n\t/** Frames the content again and resumes fitting on resize. */\n\tconst fit = React.useCallback(() => {\n\t\tconst next = fitted();\n\t\tif (!next) return;\n\t\ttouched.current = false;\n\t\tplace(() => next, 'pan');\n\t}, [fitted, place]);\n\n\tconst zoomTo = React.useCallback(\n\t\t(zoom: number) => {\n\t\t\tconst viewport = viewportRef.current;\n\t\t\tif (!viewport) return;\n\t\t\tmove((current) => zoomAround(current, clampZoom(zoom), viewport.clientWidth / 2, viewport.clientHeight / 2), 'pan');\n\t\t},\n\t\t[clampZoom, move],\n\t);\n\n\t/**\n\t * Eases the view just enough to bring a node inside the canvas margins.\n\t * Pass a `CanvasBox` for a node that is still moving to where it will settle.\n\t */\n\tconst reveal = React.useCallback(\n\t\t(target: Element | CanvasBox) => {\n\t\t\tconst viewport = viewportRef.current;\n\t\t\tif (!viewport) return;\n\t\t\tconst frame = viewport.getBoundingClientRect();\n\t\t\tconst { x, y, zoom } = viewRef.current;\n\t\t\tconst rect =\n\t\t\t\ttarget instanceof Element\n\t\t\t\t\t? target.getBoundingClientRect()\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tleft: frame.left + x + target.x * zoom,\n\t\t\t\t\t\t\ttop: frame.top + y + target.y * zoom,\n\t\t\t\t\t\t\tright: frame.left + x + (target.x + target.width) * zoom,\n\t\t\t\t\t\t\tbottom: frame.top + y + (target.y + target.height) * zoom,\n\t\t\t\t\t\t};\n\t\t\tlet dx = 0;\n\t\t\tlet dy = 0;\n\t\t\tif (rect.right > frame.right - side) dx = frame.right - side - rect.right;\n\t\t\tif (rect.left + dx < frame.left + side) dx = frame.left + side - rect.left;\n\t\t\tif (rect.bottom > frame.bottom - bottom) dy = frame.bottom - bottom - rect.bottom;\n\t\t\tif (rect.top + dy < frame.top + side) dy = frame.top + side - rect.top;\n\t\t\tif (dx || dy) place((current) => ({ ...current, x: current.x + dx, y: current.y + dy }), 'reveal');\n\t\t},\n\t\t[bottom, place, side],\n\t);\n\n\tReact.useEffect(() => {\n\t\tif (!element) return;\n\t\tconst onWheel = (event: WheelEvent) => {\n\t\t\tif ((event.target as Element).closest(`[${NO_PAN_ATTRIBUTE}]`)) return;\n\t\t\tevent.preventDefault();\n\t\t\tif (event.ctrlKey || event.metaKey) {\n\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\tmove(\n\t\t\t\t\t(current) =>\n\t\t\t\t\t\tzoomAround(current, clampZoom(current.zoom * Math.exp(-event.deltaY * 0.01)), event.clientX - rect.left, event.clientY - rect.top),\n\t\t\t\t\tnull,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmove((current) => ({ ...current, x: current.x - event.deltaX, y: current.y - event.deltaY }), null);\n\t\t\t}\n\t\t};\n\t\telement.addEventListener('wheel', onWheel, { passive: false });\n\t\treturn () => element.removeEventListener('wheel', onWheel);\n\t}, [clampZoom, element, move]);\n\n\t/** Snapshot of the gesture origin: centroid and spread of the active pointers. */\n\tconst beginGesture = (current: Viewport) => {\n\t\tconst points = [...pointers.current.values()];\n\t\tconst x = points.reduce((sum, point) => sum + point.x, 0) / points.length;\n\t\tconst y = points.reduce((sum, point) => sum + point.y, 0) / points.length;\n\t\tconst distance = points.length > 1 ? Math.hypot(points[0]!.x - points[1]!.x, points[0]!.y - points[1]!.y) : 0;\n\t\tgesture.current = { view: current, x, y, distance };\n\t};\n\n\tconst handlers = {\n\t\tonPointerDown(event: React.PointerEvent<HTMLDivElement>) {\n\t\t\tif (event.button !== 0 || (event.target as Element).closest(NO_PAN_SELECTOR)) return;\n\t\t\tevent.currentTarget.setPointerCapture(event.pointerId);\n\t\t\tpointers.current.set(event.pointerId, { x: event.clientX, y: event.clientY });\n\t\t\tif (pointers.current.size === 1) panned.current = false;\n\t\t\tbeginGesture(viewRef.current);\n\t\t\tsetDragging(true);\n\t\t},\n\t\tonPointerMove(event: React.PointerEvent<HTMLDivElement>) {\n\t\t\tconst start = gesture.current;\n\t\t\tif (!start || !pointers.current.has(event.pointerId)) return;\n\t\t\t// No button held: the release happened somewhere we never heard about (a context menu, another window).\n\t\t\tif ((event.buttons & 1) === 0) {\n\t\t\t\thandlers.onPointerUp(event);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tpointers.current.set(event.pointerId, { x: event.clientX, y: event.clientY });\n\t\t\tconst points = [...pointers.current.values()];\n\t\t\tconst x = points.reduce((sum, point) => sum + point.x, 0) / points.length;\n\t\t\tconst y = points.reduce((sum, point) => sum + point.y, 0) / points.length;\n\t\t\tif (!panned.current && Math.hypot(x - start.x, y - start.y) < 3) return;\n\t\t\tpanned.current = true;\n\t\t\tconst next = { ...start.view, x: start.view.x + x - start.x, y: start.view.y + y - start.y };\n\t\t\tif (points.length < 2 || !start.distance) {\n\t\t\t\tmove(() => next, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst rect = event.currentTarget.getBoundingClientRect();\n\t\t\tconst scale = Math.hypot(points[0]!.x - points[1]!.x, points[0]!.y - points[1]!.y) / start.distance;\n\t\t\tmove(() => zoomAround(next, clampZoom(start.view.zoom * scale), x - rect.left, y - rect.top), null);\n\t\t},\n\t\tonPointerUp(event: React.PointerEvent<HTMLDivElement>) {\n\t\t\tif (!pointers.current.delete(event.pointerId)) return;\n\t\t\tif (pointers.current.size === 0) {\n\t\t\t\tgesture.current = null;\n\t\t\t\tsetDragging(false);\n\t\t\t} else {\n\t\t\t\t// Re-anchor so lifting one finger of a pinch continues as a pan without a jump.\n\t\t\t\tbeginGesture(viewRef.current);\n\t\t\t}\n\t\t},\n\t\tonKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n\t\t\tif (event.target !== event.currentTarget) return;\n\t\t\tconst step = event.shiftKey ? 120 : 40;\n\t\t\tconst moves: Record<string, [number, number]> = {\n\t\t\t\tArrowLeft: [step, 0],\n\t\t\t\tArrowRight: [-step, 0],\n\t\t\t\tArrowUp: [0, step],\n\t\t\t\tArrowDown: [0, -step],\n\t\t\t};\n\t\t\tconst delta = moves[event.key];\n\t\t\tif (delta) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove((current) => ({ ...current, x: current.x + delta[0], y: current.y + delta[1] }), 'pan');\n\t\t\t} else if (event.key === '+' || event.key === '=') zoomTo(view.zoom + ZOOM_STEP);\n\t\t\telse if (event.key === '-') zoomTo(view.zoom - ZOOM_STEP);\n\t\t\telse if (event.key === '0') zoomTo(1);\n\t\t},\n\t};\n\n\treturn {\n\t\t/** Read-only handle on the canvas element; attach it with `attach`. */\n\t\tviewportRef,\n\t\tattach,\n\t\tview,\n\t\ttransition,\n\t\tdragging,\n\t\thandlers: { ...handlers, onPointerCancel: handlers.onPointerUp, onLostPointerCapture: handlers.onPointerUp },\n\t\tzoomTo,\n\t\tzoomIn: () => zoomTo(view.zoom + ZOOM_STEP),\n\t\tzoomOut: () => zoomTo(view.zoom - ZOOM_STEP),\n\t\tcanZoomIn: view.zoom < maxZoom,\n\t\tcanZoomOut: view.zoom > minZoom,\n\t\tfit,\n\t\treveal,\n\t\thold,\n\t\t/** True when the last press panned; use it to ignore the click that ends a drag. */\n\t\twasPanned: () => panned.current,\n\t};\n}\n\nexport type CanvasViewport = ReturnType<typeof useCanvasViewport>;\n\ntype CanvasSurfaceProps = {\n\tviewport: CanvasViewport;\n\t/** Accessible name; say how to pan and zoom. */\n\tlabel: string;\n\tlayerRef?: React.Ref<HTMLDivElement>;\n\t/** Content in canvas coordinates; it pans and zooms with the view. */\n\tchildren: React.ReactNode;\n\t/** Controls pinned to the canvas edges, such as the zoom pill. */\n\toverlay?: React.ReactNode;\n\t/** A click on empty canvas, not the end of a pan, e.g. to clear a selection. */\n\tonPaneClick?: () => void;\n\tclassName?: string;\n};\n\n/**\n * The canvas card: a dotted grid that pans and zooms with a transformed layer\n * of nodes, and an overlay for pinned controls. Spread the viewport handlers\n * here once; mark interactive node parts with `NO_PAN_ATTRIBUTE`.\n */\nexport function CanvasSurface({ viewport, label, layerRef, children, overlay, onPaneClick, className }: CanvasSurfaceProps) {\n\tconst { view, transition } = viewport;\n\tconst eased = transition !== 'none';\n\t// Below half zoom every other dot drops out so the grid stays quiet.\n\tconst grid = 16 * view.zoom * (view.zoom < 0.5 ? 2 : 1);\n\treturn (\n\t\t<div\n\t\t\tref={viewport.attach}\n\t\t\t// A canvas is a diagram placed by physical offset, so it keeps one orientation in every language.\n\t\t\tdir=\"ltr\"\n\t\t\ttabIndex={0}\n\t\t\trole=\"region\"\n\t\t\taria-roledescription=\"canvas\"\n\t\t\taria-label={label}\n\t\t\t{...viewport.handlers}\n\t\t\tonClick={\n\t\t\t\tonPaneClick\n\t\t\t\t\t? (event) => {\n\t\t\t\t\t\t\tif (!viewport.wasPanned() && !(event.target as Element).closest(NO_PAN_SELECTOR)) onPaneClick();\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tclassName={cn(\n\t\t\t\t'h-full touch-none rounded-xl bg-card shadow-card select-none',\n\t\t\t\tsurfaceInsetClass,\n\t\t\t\tfocusRingClass,\n\t\t\t\tviewport.dragging ? 'cursor-grabbing' : 'cursor-grab',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<SurfaceBody>\n\t\t\t\t<div\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclassName=\"absolute inset-0\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundImage: 'radial-gradient(circle, color-mix(in oklab, var(--foreground) 13%, transparent) 1px, transparent 1.2px)',\n\t\t\t\t\t\tbackgroundSize: `${grid}px ${grid}px`,\n\t\t\t\t\t\tbackgroundPosition: `${view.x}px ${view.y}px`,\n\t\t\t\t\t\ttransition: eased ? `background-size ${transition}, background-position ${transition}` : 'none',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tref={layerRef}\n\t\t\t\t\tclassName=\"absolute top-0 start-0 will-change-transform\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\ttransform: `translate(${view.x}px, ${view.y}px) scale(${view.zoom})`,\n\t\t\t\t\t\ttransformOrigin: '0 0',\n\t\t\t\t\t\ttransition: eased ? `transform ${transition}` : 'none',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t\t{overlay}\n\t\t\t</SurfaceBody>\n\t\t</div>\n\t);\n}\n\n/** Floating zoom pill: out, the current percentage (resets to 100%), in, and an optional fit. */\nexport function CanvasZoomControls({ viewport, fit = false, className }: { viewport: CanvasViewport; fit?: boolean; className?: string }) {\n\tconst percent = Math.round(viewport.view.zoom * 100);\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-label=\"Zoom\"\n\t\t\tclassName={cn(\n\t\t\t\t'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',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<TooltipIconButton label=\"Zoom out\" extendHitArea={false} disabled={!viewport.canZoomOut} onClick={viewport.zoomOut}>\n\t\t\t\t<Minus aria-hidden=\"true\" className=\"size-3.5\" />\n\t\t\t</TooltipIconButton>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-label={`Zoom ${percent}%, reset to 100%`}\n\t\t\t\tonClick={() => viewport.zoomTo(1)}\n\t\t\t\tclassName={cn('h-7 w-12 cursor-pointer rounded-md text-[0.8125rem] text-foreground tabular-nums hover:bg-overlay-hover', pressClass, focusRingClass)}\n\t\t\t>\n\t\t\t\t{percent}%\n\t\t\t</button>\n\t\t\t<TooltipIconButton label=\"Zoom in\" extendHitArea={false} disabled={!viewport.canZoomIn} onClick={viewport.zoomIn}>\n\t\t\t\t<Plus aria-hidden=\"true\" className=\"size-3.5\" />\n\t\t\t</TooltipIconButton>\n\t\t\t{fit ? (\n\t\t\t\t<>\n\t\t\t\t\t<span aria-hidden=\"true\" className=\"mx-0.5 h-4 w-px bg-border\" />\n\t\t\t\t\t<TooltipIconButton label=\"Fit to view\" extendHitArea={false} onClick={viewport.fit}>\n\t\t\t\t\t\t<Scan aria-hidden=\"true\" className=\"size-3.5\" />\n\t\t\t\t\t</TooltipIconButton>\n\t\t\t\t</>\n\t\t\t) : null}\n\t\t</div>\n\t);\n}\n\n/* ------------------------------------------------------------------ *\n * Nodes\n * ------------------------------------------------------------------ */\n\n/** Shell radius; its 1px border and 3px inset make the inner card 10px (concentric). */\nexport const NODE_RADIUS = 'rounded-[14px]';\nconst INNER_RADIUS = 'rounded-[10px]';\n\nexport type NodeShellTone = 'plain' | 'new' | 'target';\n\ntype NodeShellProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n\tas?: 'div' | 'section';\n\t/** `new` marks parts added since the last save; `target` marks a valid drop target. */\n\ttone?: NodeShellTone;\n\tselected?: boolean;\n\t/** Painted between the bezel and the card, e.g. a loading glow. */\n\tunderlay?: React.ReactNode;\n\t/** Classes for the raised card, e.g. `flex-1` when the shell has a fixed height. */\n\tcardClassName?: string;\n\tinnerClassName?: string;\n\tchildren: React.ReactNode;\n};\n\nconst TINT: Partial<Record<NodeShellTone, React.CSSProperties>> = {\n\tnew: {\n\t\tborderColor: 'color-mix(in oklab, var(--primary) 40%, transparent)',\n\t\tbackgroundColor: 'color-mix(in oklab, var(--primary) 7%, var(--muted))',\n\t},\n\ttarget: {\n\t\tborderColor: 'color-mix(in oklab, var(--primary) 60%, transparent)',\n\t\tbackgroundColor: 'color-mix(in oklab, var(--primary) 14%, var(--muted))',\n\t},\n};\n\n/**\n * Double-framed canvas node: a quiet bezel around a raised card, with\n * concentric corners. Selected nodes get a primary edge and a soft halo.\n */\nexport function NodeShell({\n\tas: Element = 'div',\n\ttone = 'plain',\n\tselected = false,\n\tunderlay,\n\tcardClassName,\n\tinnerClassName,\n\tclassName,\n\tstyle,\n\tchildren,\n\t...props\n}: NodeShellProps) {\n\treturn (\n\t\t<Element\n\t\t\tdata-selected={selected || undefined}\n\t\t\tstyle={{ ...TINT[tone], ...style }}\n\t\t\tclassName={cn(\n\t\t\t\t'relative isolate flex flex-col border p-[3px] transition-[border-color,background-color,box-shadow] duration-(--duration-moderate) ease-out motion-reduce:transition-none',\n\t\t\t\tNODE_RADIUS,\n\t\t\t\ttone === 'plain' ? 'border-foreground/[0.07] bg-muted/80' : 'border-dashed',\n\t\t\t\tselected && 'border-primary/50 shadow-[0_0_0_3px_color-mix(in_oklab,var(--primary)_16%,transparent)]',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{underlay}\n\t\t\t<div className={cn(surfaceInsetClass, 'bg-card shadow-card', INNER_RADIUS, cardClassName)}>\n\t\t\t\t<SurfaceBody className={innerClassName}>{children}</SurfaceBody>\n\t\t\t</div>\n\t\t</Element>\n\t);\n}\n\n/** Small framed tile holding a node's primary-tinted icon. */\nexport function NodeIconTile({ icon: Icon }: { icon: React.ComponentType<{ className?: string; strokeWidth?: number }> }) {\n\treturn (\n\t\t<span aria-hidden=\"true\" className=\"grid size-[22px] shrink-0 place-items-center rounded-[6px] bg-card text-primary shadow-card\">\n\t\t\t<Icon className=\"size-3\" strokeWidth={2} />\n\t\t</span>\n\t);\n}\n\n/* ------------------------------------------------------------------ *\n * Wires\n * ------------------------------------------------------------------ */\n\nexport type WireTone = 'rest' | 'live' | 'warn';\nexport type WirePoint = [number, number];\n\nexport const WIRE_STROKE: Record<WireTone, string> = {\n\trest: 'color-mix(in oklab, var(--foreground) 20%, transparent)',\n\tlive: 'color-mix(in oklab, var(--primary) 55%, transparent)',\n\twarn: 'color-mix(in oklab, var(--warning) 70%, transparent)',\n};\n\n/** One decimal is below a device pixel at any zoom the canvas allows. */\nconst round = (value: number) => Math.round(value * 10) / 10;\n\n/** Cubic bezier between two anchors, leaving and entering along `axis`. */\nexport function wirePath(start: WirePoint, end: WirePoint, axis: 'horizontal' | 'vertical' = 'horizontal') {\n\tconst [x1, y1, x2, y2] = [start[0], start[1], end[0], end[1]].map(round) as [number, number, number, number];\n\tif (axis === 'vertical') {\n\t\tconst dy = round(Math.max(24, (y2 - y1) / 2));\n\t\treturn `M ${x1} ${y1} C ${x1} ${round(y1 + dy)}, ${x2} ${round(y2 - dy)}, ${x2} ${y2}`;\n\t}\n\tconst dx = round(Math.max(40, (x2 - x1) / 2));\n\treturn `M ${x1} ${y1} C ${round(x1 + dx)} ${y1}, ${round(x2 - dx)} ${y2}, ${x2} ${y2}`;\n}\n\ntype CanvasWireProps = {\n\tstart: WirePoint;\n\tend: WirePoint;\n\ttone?: WireTone;\n\taxis?: 'horizontal' | 'vertical';\n\t/** Marching dashes; pass only when motion is allowed. */\n\tanimated?: boolean;\n\t/** Draw the start anchor; turn off when several wires share one start. */\n\tstartDot?: boolean;\n\t/**\n\t * Ease to new anchors when the layout changes, alongside nodes that\n\t * transition their position. Browsers without CSS `d` support jump.\n\t */\n\tglide?: boolean;\n};\n\nconst 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)';\n\n/** Anchor dot; its position also lives in CSS so `glide` can ease it. */\nexport function WireDot({ at, glide = false, stroke }: { at: WirePoint; glide?: boolean; stroke?: string }) {\n\treturn (\n\t\t<circle\n\t\t\tcx={at[0]}\n\t\t\tcy={at[1]}\n\t\t\tr={3}\n\t\t\tfill=\"var(--card)\"\n\t\t\tstroke={stroke}\n\t\t\tstrokeWidth={stroke ? 1 : undefined}\n\t\t\tstyle={glide ? { cx: at[0], cy: at[1], transition: GLIDE } : undefined}\n\t\t/>\n\t);\n}\n\n/**\n * One wire with anchor dots. Render inside an SVG in layer coordinates.\n * `rest` wires are solid; `live` and `warn` wires are dashed.\n */\nexport function CanvasWire({ start, end, tone = 'rest', axis = 'horizontal', animated = false, startDot = true, glide = false }: CanvasWireProps) {\n\tconst d = wirePath(start, end, axis);\n\treturn (\n\t\t<g stroke={WIRE_STROKE[tone]} strokeWidth={1} className=\"transition-[stroke] duration-(--duration-moderate)\">\n\t\t\t<path\n\t\t\t\td={d}\n\t\t\t\tfill=\"none\"\n\t\t\t\tstrokeDasharray={tone === 'rest' ? undefined : '4 4'}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstyle={glide ? { d: `path(\"${d}\")`, transition: GLIDE } : undefined}\n\t\t\t>\n\t\t\t\t{animated ? <animate attributeName=\"stroke-dashoffset\" from=\"8\" to=\"0\" dur=\"0.5s\" repeatCount=\"indefinite\" /> : null}\n\t\t\t</path>\n\t\t\t{startDot ? <WireDot at={start} glide={glide} /> : null}\n\t\t\t<WireDot at={end} glide={glide} />\n\t\t</g>\n\t);\n}\n","'use client';\n\nimport { Building2, ChevronsUpDown, Monitor, Moon, Sun, SunMoon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { initials } from '../../lib/initials';\nimport { cn } from '../../lib/utils';\nimport { DropdownMenuTrigger } from '../dropdown-menu';\nimport { focusRingClass, Segmented } from './primitives';\n\nexport type WorkspaceTheme = 'light' | 'dark' | 'system';\n\nconst THEMES = [\n\t{ value: 'light', label: 'Light', icon: Sun },\n\t{ value: 'dark', label: 'Dark', icon: Moon },\n\t{ value: 'system', label: 'System', icon: Monitor },\n] satisfies { value: WorkspaceTheme; label: string; icon: typeof Sun }[];\n\n/** The appearance row every workspace menu carries: light, dark, or system. */\nexport function AppearanceRow({ value, onChange }: { value: WorkspaceTheme; onChange: (theme: WorkspaceTheme) => void }) {\n\treturn (\n\t\t<div className=\"flex items-center gap-2 px-2 py-1 text-sm\">\n\t\t\t<SunMoon aria-hidden=\"true\" className=\"size-3.5 text-muted-foreground\" />\n\t\t\t<span className=\"flex-1\">Appearance</span>\n\t\t\t<Segmented label=\"Appearance\" value={value} options={THEMES} onChange={onChange} />\n\t\t</div>\n\t);\n}\n\n/** Up to two initials for a name: \"Northwind Labs\" → \"NL\". Empty for a name with nothing to show; `SwitcherTrigger` then draws an icon. */\nexport function monogram(name: string) {\n\treturn initials(name) ?? '';\n}\n\ntype SwitcherTriggerProps = {\n\t/** Accessible name, e.g. \"Billing account: Northwind Labs\". */\n\tlabel: string;\n\t/** Name shown beside the glyph when the rail is expanded. */\n\tname: string;\n\t/** Tile content: an icon or a monogram. An empty value falls back to a building icon. */\n\tglyph: React.ReactNode;\n\tcollapsed: boolean;\n};\n\n/** Sidebar header trigger for a workspace or account switcher menu. */\nexport function SwitcherTrigger({ label, name, glyph, collapsed }: SwitcherTriggerProps) {\n\treturn (\n\t\t<DropdownMenuTrigger\n\t\t\taria-label={label}\n\t\t\tclassName={cn(\n\t\t\t\t'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',\n\t\t\t\tfocusRingClass,\n\t\t\t\tcollapsed ? 'w-8 justify-center px-0' : 'flex-1',\n\t\t\t)}\n\t\t>\n\t\t\t<span className=\"grid size-5 shrink-0 place-items-center rounded-md bg-foreground text-[0.5625rem] font-semibold text-background\">\n\t\t\t\t{glyph || <Building2 aria-hidden=\"true\" className=\"size-3\" />}\n\t\t\t</span>\n\t\t\t{collapsed ? null : (\n\t\t\t\t<>\n\t\t\t\t\t<span title={name} className=\"min-w-0 flex-1 truncate text-sm font-medium text-foreground\">\n\t\t\t\t\t\t<bdi>{name}</bdi>\n\t\t\t\t\t</span>\n\t\t\t\t\t<ChevronsUpDown aria-hidden=\"true\" className=\"size-3.5 shrink-0 text-muted-foreground\" />\n\t\t\t\t</>\n\t\t\t)}\n\t\t</DropdownMenuTrigger>\n\t);\n}\n","'use client';\n\nimport { Loader2, type LucideIcon, PanelLeft, X } from 'lucide-react';\nimport * as React from 'react';\n\nimport { formatCount } from '../../lib/intl';\nimport { cn } from '../../lib/utils';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip';\nimport { focusRingClass, TooltipIconButton } from './primitives';\n\nconst ROW = cn('relative flex h-8 cursor-pointer items-center rounded-md text-start text-sm pointer-coarse:h-10', focusRingClass);\n\n/**\n * Full-width row with a label, or a centred square matching the rail's icon\n * buttons. A rail badge stretches the square into a capsule: the glyph, then\n * the word, filling the rail's width so the word never overhangs the fill.\n */\nconst rowShape = (collapsed: boolean, badge = false) =>\n\tcollapsed\n\t\t? badge\n\t\t\t? 'h-auto w-full shrink-0 flex-col justify-center gap-0.5 py-1.5'\n\t\t\t: 'size-8 shrink-0 justify-center pointer-coarse:size-10'\n\t\t: 'w-full gap-2 px-2';\n\n/**\n * Labels a rail control with a tooltip while the sidebar is collapsed. A `tip`\n * adds a line under the label there, and is the whole tooltip when expanded.\n */\nfunction RailTip({ label, collapsed, tip, children }: { label: string; collapsed: boolean; tip?: React.ReactNode; children: React.ReactElement }) {\n\tif (!collapsed && !tip) return children;\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger render={children} />\n\t\t\t<TooltipContent side=\"right\">\n\t\t\t\t{collapsed ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t\t{tip ? <span className=\"block text-pretty text-muted-foreground\">{tip}</span> : null}\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\ttip\n\t\t\t\t)}\n\t\t\t</TooltipContent>\n\t\t</Tooltip>\n\t);\n}\n\ntype NavRowProps = {\n\tlabel: string;\n\tcollapsed: boolean;\n\tactive?: boolean;\n\t/** Leading glyph: an icon, or any node such as a monogram. */\n\tleading: React.ReactNode;\n\t/** Replaces the plain label, e.g. with shimmering text. */\n\tlabelNode?: React.ReactNode;\n\t/** Quiet trailing value such as a count. */\n\ttrailing?: React.ReactNode;\n\t/** Tooltip detail, e.g. what an agent waits on. Shown expanded too; replaces the truncation title. */\n\ttip?: React.ReactNode;\n\t/** A short word under the collapsed square's glyph, e.g. \"Approve\". The square stretches into a capsule to hold it. */\n\trailBadge?: React.ReactNode;\n\t/** Row tone when not active. */\n\tmuted?: boolean;\n\t/** Not choosable right now, e.g. while another row loads or policy forbids it. */\n\tdisabled?: boolean;\n\t/** Loading this row's destination; announced and shown in place of the trailing value. */\n\tbusy?: boolean;\n\tonClick?: () => void;\n\t/** Renders the row as a link to this address instead of a button. */\n\thref?: string;\n\t/** Renders the link through the host's router component. Default: a plain anchor. */\n\trenderLink?: (props: NavRowLinkProps) => React.ReactElement;\n};\n\n/** Props a link-mode row hands to `renderLink`. */\ntype NavRowLinkProps = Omit<React.ComponentProps<'a'>, 'href'> & { href: string };\n\n/**\n * One sidebar row. Focus reads through weight and a tinted fill, never a\n * coloured dot; hover is instant because rows are clicked constantly.\n */\nfunction NavRow({ label, collapsed, active, leading, labelNode, trailing, tip, railBadge, muted, disabled, busy, onClick, href, renderLink }: NavRowProps) {\n\tconst badge = collapsed ? railBadge : null;\n\tconst content = (\n\t\t<>\n\t\t\t{leading}\n\t\t\t{badge}\n\t\t\t{collapsed ? null : (\n\t\t\t\t<>\n\t\t\t\t\t<span title={tip ? undefined : label} className=\"min-w-0 flex-1 truncate\">\n\t\t\t\t\t\t<bdi>{labelNode ?? label}</bdi>\n\t\t\t\t\t</span>\n\t\t\t\t\t{busy ? <Loader2 aria-hidden=\"true\" className=\"size-3.5 shrink-0 text-muted-foreground motion-safe:animate-spin\" /> : trailing}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n\tconst tone = active\n\t\t? 'bg-sidebar-accent font-medium text-foreground'\n\t\t: muted\n\t\t\t? 'text-muted-foreground'\n\t\t\t: 'text-sidebar-foreground';\n\tconst shared = {\n\t\t'aria-label': collapsed ? label : undefined,\n\t\t'aria-current': active ? ('page' as const) : undefined,\n\t\t'aria-busy': busy || undefined,\n\t};\n\tlet row: React.ReactElement;\n\tif (href !== undefined) {\n\t\t// A disabled link stays focusable and announced, but does nothing.\n\t\tconst props: NavRowLinkProps = {\n\t\t\t...shared,\n\t\t\thref,\n\t\t\t'aria-disabled': disabled || undefined,\n\t\t\tonClick: (event) => {\n\t\t\t\tif (disabled) event.preventDefault();\n\t\t\t\telse onClick?.();\n\t\t\t},\n\t\t\tclassName: cn(\n\t\t\t\tROW,\n\t\t\t\trowShape(collapsed, Boolean(badge)),\n\t\t\t\t'no-underline',\n\t\t\t\tdisabled ? 'cursor-not-allowed opacity-50' : cn('hover:bg-overlay-hover', muted && !active && 'hover:text-foreground'),\n\t\t\t\ttone,\n\t\t\t),\n\t\t\tchildren: content,\n\t\t};\n\t\trow = renderLink ? renderLink(props) : <a {...props} />;\n\t} else {\n\t\trow = (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\t{...shared}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tonClick={onClick}\n\t\t\t\tclassName={cn(\n\t\t\t\t\tROW,\n\t\t\t\t\trowShape(collapsed, Boolean(badge)),\n\t\t\t\t\t'disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t\tactive ? tone : cn('enabled:hover:bg-overlay-hover', tone, muted && 'enabled:hover:text-foreground'),\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{content}\n\t\t\t</button>\n\t\t);\n\t}\n\treturn (\n\t\t<li className={collapsed ? 'flex justify-center' : undefined}>\n\t\t\t<RailTip label={label} collapsed={collapsed} tip={tip}>\n\t\t\t\t{row}\n\t\t\t</RailTip>\n\t\t</li>\n\t);\n}\n\nfunction NavIcon({ icon: Icon, active }: { icon: LucideIcon; active?: boolean }) {\n\treturn <Icon aria-hidden=\"true\" className={cn('size-3.5 shrink-0', active ? 'text-foreground' : 'text-muted-foreground')} />;\n}\n\n/**\n * Quiet trailing count for a nav row; hidden from assistive tech, which reads\n * the label instead. A number is grouped (`1,284`); pass a string to format it yourself.\n */\nfunction NavCount({ value, tone = 'muted', locale }: { value: React.ReactNode; tone?: 'muted' | 'warning' | 'danger'; locale?: string }) {\n\treturn (\n\t\t<span\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(\n\t\t\t\t'text-xs tabular-nums',\n\t\t\t\ttone === 'muted' && 'text-muted-foreground',\n\t\t\t\ttone === 'warning' && 'font-medium text-warning',\n\t\t\t\ttone === 'danger' && 'font-medium text-destructive',\n\t\t\t)}\n\t\t>\n\t\t\t{typeof value === 'number' ? formatCount(value, locale) : value}\n\t\t</span>\n\t);\n}\n\ntype NavSectionProps = {\n\t/** Visible heading above the rows; hidden in the icon rail. */\n\ttitle?: string;\n\tcollapsed: boolean;\n\t/** Optional control beside the heading, such as an add button. */\n\taction?: React.ReactNode;\n\tchildren: React.ReactNode;\n};\n\n/** A group of rows with an optional small heading. */\nfunction NavSection({ title, collapsed, action, children }: NavSectionProps) {\n\tconst headingId = React.useId();\n\treturn (\n\t\t<div className=\"flex w-full flex-col gap-1\">\n\t\t\t{/* In the icon rail a heading has nothing to show, so only an action keeps the row. */}\n\t\t\t{(title && !collapsed) || action ? (\n\t\t\t\t<div className={cn('flex h-7 items-center gap-2 ps-2', collapsed && 'justify-center ps-0')}>\n\t\t\t\t\t{collapsed || !title ? null : (\n\t\t\t\t\t\t<h2 id={headingId} className=\"flex-1 truncate text-xs text-muted-foreground\">\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t)}\n\t\t\t\t\t{action}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<ul\n\t\t\t\taria-labelledby={title && !collapsed ? headingId : undefined}\n\t\t\t\taria-label={title && collapsed ? title : undefined}\n\t\t\t\tclassName=\"flex flex-col gap-0.5\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n\ntype SidebarFrameProps = {\n\t/** Accessible name of the navigation landmark. */\n\tlabel: string;\n\t/** Workspace or account switcher at the top left. */\n\tmenu: React.ReactNode;\n\tcollapsed: boolean;\n\tonCollapsedChange?: (collapsed: boolean) => void;\n\tdrawer?: boolean;\n\t/** Closes the drawer. */\n\tonClose?: () => void;\n\tchildren: React.ReactNode;\n\t/** Pinned below the scrolling body, e.g. a notice or a promo card. */\n\tfooter?: React.ReactNode;\n\tclassName?: string;\n};\n\n/**\n * Sidebar chrome: a 48px header with the switcher and a collapse (or close)\n * control, a scrolling body, and an optional pinned footer. 224px wide, or a\n * 52px icon rail when collapsed.\n */\nfunction SidebarFrame({ label, menu, collapsed: collapsedProp, onCollapsedChange, drawer = false, onClose, children, footer, className }: SidebarFrameProps) {\n\tconst collapsed = !drawer && collapsedProp;\n\treturn (\n\t\t<aside\n\t\t\taria-label={label}\n\t\t\tdata-collapsed={collapsed || undefined}\n\t\t\tclassName={cn(\n\t\t\t\t'flex h-full shrink-0 flex-col bg-sidebar',\n\t\t\t\tdrawer ? 'w-full' : cn('border-e border-sidebar-border', collapsed ? 'w-[52px]' : 'w-56'),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<div className={cn('flex h-12 shrink-0 items-center gap-1 px-2.5', collapsed && 'justify-center px-0')}>\n\t\t\t\t{menu}\n\t\t\t\t{drawer ? (\n\t\t\t\t\t<TooltipIconButton label=\"Close navigation\" onClick={onClose}>\n\t\t\t\t\t\t<X aria-hidden=\"true\" className=\"size-3.5\" />\n\t\t\t\t\t</TooltipIconButton>\n\t\t\t\t) : collapsed ? null : (\n\t\t\t\t\t<TooltipIconButton label=\"Collapse sidebar\" aria-expanded onClick={() => onCollapsedChange?.(true)}>\n\t\t\t\t\t\t<PanelLeft aria-hidden=\"true\" className=\"size-3.5 rtl:-scale-x-100\" />\n\t\t\t\t\t</TooltipIconButton>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{/* -mt-1 pt-1 gives the first control's 3px focus ring room inside the scroll clip without moving anything. */}\n\t\t\t<div className={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')}>\n\t\t\t\t{collapsed ? (\n\t\t\t\t\t<TooltipIconButton label=\"Expand sidebar\" side=\"right\" size=\"lg\" aria-expanded={false} onClick={() => onCollapsedChange?.(false)}>\n\t\t\t\t\t\t<PanelLeft aria-hidden=\"true\" className=\"size-3.5 -scale-x-100 rtl:scale-x-100\" />\n\t\t\t\t\t</TooltipIconButton>\n\t\t\t\t) : null}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t\t{footer}\n\t\t</aside>\n\t);\n}\n\nexport { NavCount, NavIcon, NavRow, NavSection, RailTip, SidebarFrame };\nexport type { NavRowLinkProps, NavRowProps, NavSectionProps, SidebarFrameProps };\n","'use client';\n\nimport * as React from 'react';\n\nimport { graphemes } from '../../lib/intl';\nimport { cn } from '../../lib/utils';\n\nconst EXTENSION = /\\.[A-Za-z0-9]{1,8}$/;\n\n/** The text split into what the line gives up first and what it always keeps, or `null` when it is too short to bother. */\nfunction splitMiddle(text: string, tail: number | undefined): [head: string, end: string] | null {\n\tconst extension = EXTENSION.exec(text)?.[0];\n\tconst asked = tail ?? (extension ? extension.length + 4 : 8);\n\tconst keep = Number.isFinite(asked) ? Math.max(0, Math.floor(asked)) : 0;\n\t// A text is never longer in characters than in UTF-16 units, so a short one skips the segmenter.\n\tif (keep === 0 || text.length <= keep * 2) return null;\n\tconst pieces = graphemes(text);\n\tif (pieces.length <= keep * 2) return null;\n\treturn [pieces.slice(0, -keep).join(''), pieces.slice(-keep).join('')];\n}\n\ninterface MiddleTruncateProps {\n\ttext: string;\n\t/**\n\t * Characters that always stay visible at the end: the extension, version or last path segment. Defaults to the\n\t * extension plus four characters, or eight. `0` keeps none: an ordinary line that ends in an ellipsis.\n\t */\n\ttail?: number;\n\t/** The tooltip. Default: the whole text. Pass `false` when an ancestor already has a richer `title`, which a nested one would hide. */\n\ttitle?: string | false;\n\tclassName?: string;\n}\n\n/**\n * `MiddleTruncate` — one line that gives up its middle when it runs out of room, keeping the start and the end.\n * Names and keys differ at the end (`…edited_edited.HEIC`, `…/2025/09/14/`), so clipping only the end would make\n * different files read the same. The full text is the tooltip.\n *\n * A long text is drawn as two pieces, so the text itself is in the document once more, visually hidden: that copy is\n * what assistive tech reads and what a selection or copy picks up, so a copied name is the original string once. The\n * two visible pieces cannot be selected themselves. Graphemes are never cut, so an emoji or accent stays whole.\n */\nexport function MiddleTruncate({ text, tail, title = text, className }: MiddleTruncateProps) {\n\tconst parts = React.useMemo(() => splitMiddle(text, tail), [text, tail]);\n\tconst tooltip = title === false ? undefined : title;\n\t// `dir=\"auto\"` lays the pieces out in the text's own direction, so Arabic or Hebrew names stay in reading order.\n\t// `whitespace-pre` keeps a space at the cut (\"Đặng \" + \"Thị Ngọc Hân\") from collapsing away.\n\tif (!parts) {\n\t\treturn (\n\t\t\t<span dir=\"auto\" className={cn('block min-w-0 overflow-hidden text-ellipsis whitespace-pre', className)} title={tooltip}>\n\t\t\t\t{text}\n\t\t\t</span>\n\t\t);\n\t}\n\treturn (\n\t\t<span dir=\"auto\" className={cn('flex min-w-0 max-w-full', className)} title={tooltip}>\n\t\t\t<span className=\"sr-only\">{text}</span>\n\t\t\t<span aria-hidden=\"true\" className=\"min-w-0 overflow-hidden text-ellipsis whitespace-pre select-none\">\n\t\t\t\t{parts[0]}\n\t\t\t</span>\n\t\t\t{/* The tail never shrinks while the head can, but it never outgrows the line either: in a box narrower than the tail it clips instead of spilling over the neighbours. */}\n\t\t\t<span aria-hidden=\"true\" className=\"max-w-full shrink-0 overflow-hidden text-ellipsis whitespace-pre select-none\">\n\t\t\t\t{parts[1]}\n\t\t\t</span>\n\t\t</span>\n\t);\n}\n","'use client';\n\nimport type { LucideIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\nimport { focusRingClass, SurfaceBody, surfaceInsetClass, TONE_COLOR, ToneBadge, type Tone } from './primitives';\nimport { useScrollFade } from '../../lib/use-scroll-fade';\n\n/** A status as the UI shows it: a short label and the tone that colours it. */\nexport type Presentation = { label: string; tone: Tone; description?: string };\n\n/** Hairline dashed rule used between sections of one surface. */\nexport const dashedRule = 'border-dashed border-foreground/10';\n\n/** Header row and body row classes shared by every workspace table. */\n// `th` centres itself unless its row sets an explicit alignment, and `start` is not explicit, so the head names both directions.\nexport 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';\nexport const tableRowClass = 'border-t border-border align-middle [&_td]:px-4 [&_td]:py-2.5';\n/**\n * Heading row that opens a group of body rows, tinted like the header so the\n * break reads without a heavier line. Pair it with `<th scope=\"rowgroup\" colSpan>`.\n */\nexport const tableGroupRowClass =\n\t'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';\n\n/** A native select styled like the kit's inputs. */\nexport const nativeSelectClass = cn('h-8 rounded-md border border-border bg-card px-2 text-[0.8125rem] text-foreground shadow-2xs', focusRingClass);\n\n/**\n * Card around a table that scrolls sideways below `minWidth`, keeping the card\n * edge visible over full-bleed header rows. An edge fades while there is more\n * to scroll to, so a table cut off on a phone reads as scrollable.\n */\nexport function TableSurface({ children, className, minWidth = '40rem' }: { children: React.ReactNode; className?: string; minWidth?: string }) {\n\tconst { ref, style } = useScrollFade<HTMLDivElement>();\n\treturn (\n\t\t<div className={cn(surfaceInsetClass, 'rounded-xl bg-card shadow-card', className)}>\n\t\t\t<SurfaceBody>\n\t\t\t\t<div ref={ref} className=\"relative overflow-x-auto\" style={style}>\n\t\t\t\t\t<table className=\"w-full border-collapse text-[0.8125rem]\" style={{ minWidth }}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t</SurfaceBody>\n\t\t</div>\n\t);\n}\n\n/** Small tinted status label from a presentation map entry. */\nexport function StatusBadge({ presentation, className, children }: { presentation: Presentation; className?: string; children?: React.ReactNode }) {\n\treturn (\n\t\t<ToneBadge tone={presentation.tone} className={className}>\n\t\t\t{children}\n\t\t\t{presentation.label}\n\t\t</ToneBadge>\n\t);\n}\n\ntype PanelProps = Omit<React.ComponentProps<'section'>, 'title'> & {\n\ttitle?: React.ReactNode;\n\tdescription?: React.ReactNode;\n\t/** Controls on the right of the header. */\n\tactions?: React.ReactNode;\n\t/** Tinted strip under a dashed rule, for totals, notes, or secondary actions. */\n\tfooter?: React.ReactNode;\n\t/** Padding for the body; pass `p-0` for tables that run edge to edge. */\n\tbodyClassName?: string;\n};\n\n/**\n * The basic workspace surface: a card with an optional header, a body, and a\n * tinted footer strip. Full-bleed children never cover the card edge (see\n * `SurfaceBody`).\n */\nexport function Panel({ title, description, actions, footer, bodyClassName, className, children, ...props }: PanelProps) {\n\tconst headingId = React.useId();\n\treturn (\n\t\t<section aria-labelledby={title ? headingId : undefined} className={cn(surfaceInsetClass, 'rounded-xl bg-card shadow-card', className)} {...props}>\n\t\t\t<SurfaceBody className=\"flex flex-col\">\n\t\t\t\t{title || actions ? (\n\t\t\t\t\t<header className=\"flex flex-wrap items-start gap-x-3 gap-y-2 px-4 pt-3.5 pb-3\">\n\t\t\t\t\t\t<div className=\"min-w-0 flex-1 basis-48\">\n\t\t\t\t\t\t\t{title ? (\n\t\t\t\t\t\t\t\t<h2 id={headingId} className=\"text-sm font-medium text-foreground\">\n\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t{description ? <p className=\"mt-0.5 text-pretty text-[0.8125rem] text-muted-foreground\">{description}</p> : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{actions ? <div className=\"flex shrink-0 items-center gap-2\">{actions}</div> : null}\n\t\t\t\t\t</header>\n\t\t\t\t) : null}\n\t\t\t\t{children ? <div className={cn('min-w-0 flex-1 px-4 pb-4', !(title || actions) && 'pt-4', bodyClassName)}>{children}</div> : null}\n\t\t\t\t{footer ? <div className={cn('border-t bg-muted/50 px-4 py-2.5 text-xs text-muted-foreground', dashedRule)}>{footer}</div> : null}\n\t\t\t</SurfaceBody>\n\t\t</section>\n\t);\n}\n\n/**\n * Double frame: a quiet 3px bezel around a raised card. The bezel is 14px and\n * the card 11px, so the corners stay concentric.\n */\nexport function Bezel({ className, innerClassName, muted, children, ...props }: React.ComponentProps<'div'> & { innerClassName?: string; muted?: boolean }) {\n\treturn (\n\t\t<div className={cn('rounded-[14px] border border-foreground/[0.07] p-[3px]', muted ? 'bg-muted/40' : 'bg-muted/80', className)} {...props}>\n\t\t\t<div className={cn(surfaceInsetClass, 'h-full w-full rounded-[11px] bg-card shadow-card')}>\n\t\t\t\t<SurfaceBody className={innerClassName}>{children}</SurfaceBody>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\ntype StatTileProps = {\n\tlabel: React.ReactNode;\n\tvalue: React.ReactNode;\n\thint?: React.ReactNode;\n\ticon?: LucideIcon;\n\tclassName?: string;\n};\n\n/** Label over a large tabular figure, with an optional hint below. */\nexport function StatTile({ label, value, hint, icon: Icon, className }: StatTileProps) {\n\treturn (\n\t\t<div className={cn('flex min-w-0 flex-col gap-1', className)}>\n\t\t\t<span className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n\t\t\t\t{Icon ? <Icon aria-hidden=\"true\" className=\"size-3.5 shrink-0\" /> : null}\n\t\t\t\t{label}\n\t\t\t</span>\n\t\t\t<span className=\"text-xl font-semibold tracking-tight text-foreground tabular-nums [overflow-wrap:anywhere]\">{value}</span>\n\t\t\t{hint ? <span className=\"text-xs text-muted-foreground tabular-nums\">{hint}</span> : null}\n\t\t</div>\n\t);\n}\n\ntype KeyValueListProps = {\n\titems: { label: React.ReactNode; value: React.ReactNode; key?: string }[];\n\tclassName?: string;\n};\n\n/** Label and value rows separated by dashed rules. */\nexport function KeyValueList({ items, className }: KeyValueListProps) {\n\treturn (\n\t\t<dl className={cn('flex flex-col text-[0.8125rem]', className)}>\n\t\t\t{items.map((item, index) => (\n\t\t\t\t<div key={item.key ?? index} className={cn('flex items-baseline justify-between gap-4 py-2', index > 0 && cn('border-t', dashedRule))}>\n\t\t\t\t\t<dt className=\"text-muted-foreground\">{item.label}</dt>\n\t\t\t\t\t<dd className=\"min-w-0 text-end text-foreground tabular-nums [overflow-wrap:anywhere]\">{item.value}</dd>\n\t\t\t\t</div>\n\t\t\t))}\n\t\t</dl>\n\t);\n}\n\ntype EmptyStateProps = {\n\ticon: LucideIcon;\n\ttitle: React.ReactNode;\n\tdescription?: React.ReactNode;\n\taction?: React.ReactNode;\n\tclassName?: string;\n};\n\n/** Centred empty or blocked state with one next step. */\nexport function EmptyState({ icon: Icon, title, description, action, className }: EmptyStateProps) {\n\treturn (\n\t\t<div className={cn('flex flex-col items-center gap-3 px-6 py-10 text-center', className)}>\n\t\t\t<span className=\"grid size-9 place-items-center rounded-[10px] bg-card text-muted-foreground shadow-card\">\n\t\t\t\t<Icon aria-hidden=\"true\" className=\"size-4\" />\n\t\t\t</span>\n\t\t\t<div className=\"max-w-sm\">\n\t\t\t\t<p className=\"text-sm font-medium text-foreground\">{title}</p>\n\t\t\t\t{description ? <p className=\"mt-1 text-pretty text-[0.8125rem] text-muted-foreground\">{description}</p> : null}\n\t\t\t</div>\n\t\t\t{action}\n\t\t</div>\n\t);\n}\n\n/** Heading row between groups of panels inside a view. */\nexport function SectionHeading({ title, description, actions, id }: { title: React.ReactNode; description?: React.ReactNode; actions?: React.ReactNode; id?: string }) {\n\treturn (\n\t\t<div className=\"flex flex-wrap items-end justify-between gap-x-4 gap-y-2\">\n\t\t\t<div className=\"min-w-0\">\n\t\t\t\t<h2 id={id} className=\"text-[0.9375rem] font-medium tracking-tight text-foreground\">\n\t\t\t\t\t{title}\n\t\t\t\t</h2>\n\t\t\t\t{description ? <p className=\"mt-0.5 text-pretty text-[0.8125rem] text-muted-foreground\">{description}</p> : null}\n\t\t\t</div>\n\t\t\t{actions ? <div className=\"flex items-center gap-2\">{actions}</div> : null}\n\t\t</div>\n\t);\n}\n\n/** Tinted icon tile used as a leading glyph in rows and notices. */\nexport function IconTile({ icon: Icon, tone = 'neutral', className }: { icon: LucideIcon; tone?: Tone; className?: string }) {\n\tconst color = tone === 'neutral' ? undefined : TONE_COLOR[tone];\n\treturn (\n\t\t<span\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn('grid size-7 shrink-0 place-items-center rounded-lg', color ? null : 'bg-muted text-muted-foreground', className)}\n\t\t\tstyle={\n\t\t\t\tcolor\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tbackgroundColor: `color-mix(in oklab, ${color} 12%, transparent)`,\n\t\t\t\t\t\t\tcolor: `color-mix(in oklab, ${color}, var(--foreground) 25%)`,\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t>\n\t\t\t<Icon className=\"size-3.5\" />\n\t\t</span>\n\t);\n}\n","'use client';\n\nimport { AnimateView, type AnimateViewProps } from 'motion/react-animate-view';\nimport * as React from 'react';\n\nimport { useReducedMotion } from './reduced-motion';\n\n/**\n * React 19.3 ships `ViewTransition` and `addTransitionType`; older React keeps\n * working, just without these view swaps. Read at runtime so the template\n * builds against any React 18/19 host.\n */\nconst react = React as typeof React & {\n\tViewTransition?: unknown;\n\taddTransitionType?: (type: string) => void;\n};\nconst supported = typeof react.ViewTransition !== 'undefined';\n\n/** Timing for view swaps: short enough that the non-interruptible transition never blocks the next click. */\nconst VIEW_TRANSITION = { duration: 0.2, ease: [0.22, 1, 0.36, 1] } as const;\n\ntype ViewAnimationProps = AnimateViewProps & { children: React.ReactNode };\n\n/**\n * `AnimateView` for full-view swaps (route-like changes, list swaps, shared\n * elements). Renders children untouched when React lacks `ViewTransition`, and\n * zeroes durations under reduced motion because view-transition pseudo-elements\n * sit outside the app's reduced-motion CSS.\n */\nfunction ViewAnimation({ children, transition, ...props }: ViewAnimationProps) {\n\tconst reduced = useReducedMotion();\n\tif (!supported) return <>{children}</>;\n\treturn (\n\t\t<AnimateView {...props} transition={reduced ? { duration: 0 } : { ...VIEW_TRANSITION, ...transition }}>\n\t\t\t{children}\n\t\t</AnimateView>\n\t);\n}\n\n/**\n * Runs a state update as a view transition, tagging it with `types` (e.g. a\n * direction) that `enter`/`exit`/`update` functions can read.\n */\nfunction startViewTransition(update: () => void, ...types: string[]) {\n\tReact.startTransition(() => {\n\t\tif (supported) for (const type of types) react.addTransitionType?.(type);\n\t\tupdate();\n\t});\n}\n\nexport { ViewAnimation, startViewTransition };\n"],"mappings":";;;;;;;;;;;;;;AAwEA,MAAM,wBAAwBA,QAAM,cAA0C,EAAE,eAAe,CAAC,EAAE,CAAC;;AAGnG,SAAS,oBAAoB;CAC5B,OAAOA,QAAM,WAAW,qBAAqB;AAC9C;;;;;;;AAkCA,SAAS,eAAe,EACvB,SACA,UACA,OAAO,mBACP,0BAA0B,OAC1B,SAAS,OACT,aACuB;CACvB,MAAM,CAAC,WAAW,gBAAgBA,QAAM,SAAS,uBAAuB;CACxE,MAAM,CAAC,SAAS,cAAcA,QAAM,SAAS,KAAK;CAClD,MAAM,SAASA,QAAM,MAAM;CAC3B,MAAM,UAAUA,QAAM,eAA2C,EAAE,eAAe,WAAW,IAAI,EAAE,IAAI,CAAC,CAAC;CACzG,MAAM,WAAWA,QAAM,kBAAkB,WAAW,KAAK,GAAG,CAAC,CAAC;CAE9D,MAAM,QACL,qBAAC,OAAD;EACC,aAAW;EACX,eAAa,UAAU;EACvB,WAAW,GACV,mGACA,SAAS,6DAA6D,SACvE;YAND;GAQC,oBAAC,KAAD;IACC,MAAM,IAAI;IACV,WAAU;cACV;GAEE;GACH,oBAAC,OAAD;IAAK,WAAU;cACb,QAAQ;KAAE,MAAM;KAAQ;KAAW,mBAAmB;KAAc,kBAAkB,CAAC;IAAE,CAAC;GACvF;GACL,oBAAC,QAAD;IAAM,IAAI;IAAQ,UAAU;IAAI,WAAU;IACxC;GACI;EACF;;CAGN,OACC,oBAAC,sBAAsB,UAAvB;EAAgC,OAAO;YACtC,qBAAC,iBAAD,aACE,SACA,oBAAC,OAAD;GACC,aAAU;GAGV,WAAW,GACV,yGACA,6DACA,SACD;aAEC;EACG,KAEL,OAED,oBAAC,OAAD;GAAO,MAAM;GAAS,cAAc;aACnC,qBAAC,cAAD;IAAc,MAAK;IAAO,WAAW;IAAO,WAAU;cAAtD,CACC,oBAAC,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e,KAAI,IACxG;MACJ,UAAU,oBAAC,OAAD;GAAK,WAAU;aAA2B;EAAa,KAAI,IAClE;;AAEP;;AAGA,SAAgB,SAAS,EAAE,MAAM,MAAM,OAAO,WAAW,aAAoE;CAC5H,MAAM,QAAQ,SAAS,YAAY,SAAY,WAAW;CAC1D,OACC,oBAAC,QAAD;EACC,eAAY;EACZ,WAAW,GAAG,sDAAsD,QAAQ,OAAO,kCAAkC,SAAS;EAC9H,OACC,QACG;GACA,iBAAiB,uBAAuB,MAAM;GAC9C,OAAO,uBAAuB,MAAM;EACrC,IACC;YAGJ,oBAAC,MAAD,EAAM,WAAU,WAAY;CACvB;AAER;;;;;;;;;ACzMA,MAAM,QAAQC;AAId,MAAM,YAAY,OAAO,MAAM,mBAAmB;;AAGlD,MAAM,kBAAkB;CAAE,UAAU;CAAK,MAAM;EAAC;EAAM;EAAG;EAAM;CAAC;AAAE;;;;;;;AAUlE,SAAS,cAAc,EAAE,UAAU,YAAY,GAAG,SAA6B;CAC9E,MAAM,UAAU,iBAAiB;CACjC,IAAI,CAAC,WAAW,OAAO,gCAAG,SAAW;CACrC,OACC,oBAAC,aAAD;EAAa,GAAI;EAAO,YAAY,UAAU,EAAE,UAAU,EAAE,IAAI;GAAE,GAAG;GAAiB,GAAG;EAAW;EAClG;CACW;AAEf;;;;;AAMA,SAAS,oBAAoB,QAAoB,GAAG,OAAiB;CACpE,QAAM,sBAAsB;EAC3B,IAAI,WAAW,KAAK,MAAM,QAAQ,OAAO,MAAM,oBAAoB,IAAI;EACvE,OAAO;CACR,CAAC;AACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/compose-refs.ts
|
|
5
|
+
/** Points a ref at `node`, and returns the cleanup a callback ref handed back (React 19), if any. */
|
|
6
|
+
function assign(ref, node) {
|
|
7
|
+
if (typeof ref === "function") {
|
|
8
|
+
const cleanup = ref(node);
|
|
9
|
+
return typeof cleanup === "function" ? cleanup : void 0;
|
|
10
|
+
}
|
|
11
|
+
if (ref) ref.current = node;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Merges refs into one callback ref and keeps React 19's ref contract for each of them:
|
|
15
|
+
*
|
|
16
|
+
* - a callback ref that returns a cleanup function has that cleanup run on detach, and is never called with `null`;
|
|
17
|
+
* - any other callback ref is called with `null` on detach, and a ref object is set back to `null`.
|
|
18
|
+
*
|
|
19
|
+
* The merged ref only returns a cleanup when one of the refs did. React 18 does not run cleanups (and warns in
|
|
20
|
+
* development when a ref returns one), and with plain refs React 19 calls the merged ref again with `null`, which
|
|
21
|
+
* is how every plain ref gets detached.
|
|
22
|
+
*/
|
|
23
|
+
function mergeRefs(...refs) {
|
|
24
|
+
return (node) => {
|
|
25
|
+
if (node === null) {
|
|
26
|
+
for (const ref of refs) assign(ref, null);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const cleanups = refs.map((ref) => assign(ref, node));
|
|
30
|
+
if (!cleanups.some(Boolean)) return;
|
|
31
|
+
return () => {
|
|
32
|
+
refs.forEach((ref, index) => cleanups[index] ? cleanups[index]() : assign(ref, null));
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `mergeRefs` for a component that needs its own ref and also forwards the one it was given. The merged ref is
|
|
38
|
+
* memoized on the refs themselves, so React attaches it once and only again when a ref changes: passing a ref that
|
|
39
|
+
* is stable keeps it from being detached and attached on every render.
|
|
40
|
+
*/
|
|
41
|
+
function useMergedRefs(...refs) {
|
|
42
|
+
return useMemo(() => mergeRefs(...refs), refs);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { useMergedRefs as t };
|
|
47
|
+
//# sourceMappingURL=compose-refs-Mbma1O3M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-refs-Mbma1O3M.js","names":[],"sources":["../src/lib/compose-refs.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { MutableRefObject, Ref, RefCallback } from 'react';\n\ntype PossibleRef<T> = Ref<T> | undefined;\n\n/** Points a ref at `node`, and returns the cleanup a callback ref handed back (React 19), if any. */\nfunction assign<T>(ref: PossibleRef<T>, node: T | null): (() => void) | undefined {\n\tif (typeof ref === 'function') {\n\t\tconst cleanup = ref(node);\n\t\treturn typeof cleanup === 'function' ? cleanup : undefined;\n\t}\n\tif (ref) (ref as MutableRefObject<T | null>).current = node;\n\treturn undefined;\n}\n\n/**\n * Merges refs into one callback ref and keeps React 19's ref contract for each of them:\n *\n * - a callback ref that returns a cleanup function has that cleanup run on detach, and is never called with `null`;\n * - any other callback ref is called with `null` on detach, and a ref object is set back to `null`.\n *\n * The merged ref only returns a cleanup when one of the refs did. React 18 does not run cleanups (and warns in\n * development when a ref returns one), and with plain refs React 19 calls the merged ref again with `null`, which\n * is how every plain ref gets detached.\n */\nexport function mergeRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T> {\n\treturn (node) => {\n\t\tif (node === null) {\n\t\t\tfor (const ref of refs) assign(ref, null);\n\t\t\treturn;\n\t\t}\n\t\tconst cleanups = refs.map((ref) => assign(ref, node));\n\t\tif (!cleanups.some(Boolean)) return;\n\t\treturn () => {\n\t\t\trefs.forEach((ref, index) => (cleanups[index] ? cleanups[index]() : assign(ref, null)));\n\t\t};\n\t};\n}\n\n/**\n * `mergeRefs` for a component that needs its own ref and also forwards the one it was given. The merged ref is\n * memoized on the refs themselves, so React attaches it once and only again when a ref changes: passing a ref that\n * is stable keeps it from being detached and attached on every render.\n */\nexport function useMergedRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T> {\n\t// A component passes the same number of refs on every render, so the list of dependencies never changes length.\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\treturn useMemo(() => mergeRefs(...refs), refs);\n}\n"],"mappings":";;;;;AAMA,SAAS,OAAU,KAAqB,MAA0C;CACjF,IAAI,OAAO,QAAQ,YAAY;EAC9B,MAAM,UAAU,IAAI,IAAI;EACxB,OAAO,OAAO,YAAY,aAAa,UAAU;CAClD;CACA,IAAI,KAAK,AAAC,IAAmC,UAAU;AAExD;;;;;;;;;;;AAYA,SAAgB,UAAa,GAAG,MAAwC;CACvE,QAAQ,SAAS;EAChB,IAAI,SAAS,MAAM;GAClB,KAAK,MAAM,OAAO,MAAM,OAAO,KAAK,IAAI;GACxC;EACD;EACA,MAAM,WAAW,KAAK,KAAK,QAAQ,OAAO,KAAK,IAAI,CAAC;EACpD,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG;EAC7B,aAAa;GACZ,KAAK,SAAS,KAAK,UAAW,SAAS,SAAS,SAAS,MAAM,CAAC,IAAI,OAAO,KAAK,IAAI,CAAE;EACvF;CACD;AACD;;;;;;AAOA,SAAgB,cAAiB,GAAG,MAAwC;CAG3E,OAAO,cAAc,UAAU,GAAG,IAAI,GAAG,IAAI;AAC9C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
let react = require("react");
|
|
3
|
+
|
|
4
|
+
//#region src/lib/compose-refs.ts
|
|
5
|
+
/** Points a ref at `node`, and returns the cleanup a callback ref handed back (React 19), if any. */
|
|
6
|
+
function assign(ref, node) {
|
|
7
|
+
if (typeof ref === "function") {
|
|
8
|
+
const cleanup = ref(node);
|
|
9
|
+
return typeof cleanup === "function" ? cleanup : void 0;
|
|
10
|
+
}
|
|
11
|
+
if (ref) ref.current = node;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Merges refs into one callback ref and keeps React 19's ref contract for each of them:
|
|
15
|
+
*
|
|
16
|
+
* - a callback ref that returns a cleanup function has that cleanup run on detach, and is never called with `null`;
|
|
17
|
+
* - any other callback ref is called with `null` on detach, and a ref object is set back to `null`.
|
|
18
|
+
*
|
|
19
|
+
* The merged ref only returns a cleanup when one of the refs did. React 18 does not run cleanups (and warns in
|
|
20
|
+
* development when a ref returns one), and with plain refs React 19 calls the merged ref again with `null`, which
|
|
21
|
+
* is how every plain ref gets detached.
|
|
22
|
+
*/
|
|
23
|
+
function mergeRefs(...refs) {
|
|
24
|
+
return (node) => {
|
|
25
|
+
if (node === null) {
|
|
26
|
+
for (const ref of refs) assign(ref, null);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const cleanups = refs.map((ref) => assign(ref, node));
|
|
30
|
+
if (!cleanups.some(Boolean)) return;
|
|
31
|
+
return () => {
|
|
32
|
+
refs.forEach((ref, index) => cleanups[index] ? cleanups[index]() : assign(ref, null));
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `mergeRefs` for a component that needs its own ref and also forwards the one it was given. The merged ref is
|
|
38
|
+
* memoized on the refs themselves, so React attaches it once and only again when a ref changes: passing a ref that
|
|
39
|
+
* is stable keeps it from being detached and attached on every render.
|
|
40
|
+
*/
|
|
41
|
+
function useMergedRefs(...refs) {
|
|
42
|
+
return (0, react.useMemo)(() => mergeRefs(...refs), refs);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
Object.defineProperty(exports, 'useMergedRefs', {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () {
|
|
49
|
+
return useMergedRefs;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=compose-refs-uPrvNoiU.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-refs-uPrvNoiU.cjs","names":[],"sources":["../src/lib/compose-refs.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { MutableRefObject, Ref, RefCallback } from 'react';\n\ntype PossibleRef<T> = Ref<T> | undefined;\n\n/** Points a ref at `node`, and returns the cleanup a callback ref handed back (React 19), if any. */\nfunction assign<T>(ref: PossibleRef<T>, node: T | null): (() => void) | undefined {\n\tif (typeof ref === 'function') {\n\t\tconst cleanup = ref(node);\n\t\treturn typeof cleanup === 'function' ? cleanup : undefined;\n\t}\n\tif (ref) (ref as MutableRefObject<T | null>).current = node;\n\treturn undefined;\n}\n\n/**\n * Merges refs into one callback ref and keeps React 19's ref contract for each of them:\n *\n * - a callback ref that returns a cleanup function has that cleanup run on detach, and is never called with `null`;\n * - any other callback ref is called with `null` on detach, and a ref object is set back to `null`.\n *\n * The merged ref only returns a cleanup when one of the refs did. React 18 does not run cleanups (and warns in\n * development when a ref returns one), and with plain refs React 19 calls the merged ref again with `null`, which\n * is how every plain ref gets detached.\n */\nexport function mergeRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T> {\n\treturn (node) => {\n\t\tif (node === null) {\n\t\t\tfor (const ref of refs) assign(ref, null);\n\t\t\treturn;\n\t\t}\n\t\tconst cleanups = refs.map((ref) => assign(ref, node));\n\t\tif (!cleanups.some(Boolean)) return;\n\t\treturn () => {\n\t\t\trefs.forEach((ref, index) => (cleanups[index] ? cleanups[index]() : assign(ref, null)));\n\t\t};\n\t};\n}\n\n/**\n * `mergeRefs` for a component that needs its own ref and also forwards the one it was given. The merged ref is\n * memoized on the refs themselves, so React attaches it once and only again when a ref changes: passing a ref that\n * is stable keeps it from being detached and attached on every render.\n */\nexport function useMergedRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T> {\n\t// A component passes the same number of refs on every render, so the list of dependencies never changes length.\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\treturn useMemo(() => mergeRefs(...refs), refs);\n}\n"],"mappings":";;;;;AAMA,SAAS,OAAU,KAAqB,MAA0C;CACjF,IAAI,OAAO,QAAQ,YAAY;EAC9B,MAAM,UAAU,IAAI,IAAI;EACxB,OAAO,OAAO,YAAY,aAAa,UAAU;CAClD;CACA,IAAI,KAAK,AAAC,IAAmC,UAAU;AAExD;;;;;;;;;;;AAYA,SAAgB,UAAa,GAAG,MAAwC;CACvE,QAAQ,SAAS;EAChB,IAAI,SAAS,MAAM;GAClB,KAAK,MAAM,OAAO,MAAM,OAAO,KAAK,IAAI;GACxC;EACD;EACA,MAAM,WAAW,KAAK,KAAK,QAAQ,OAAO,KAAK,IAAI,CAAC;EACpD,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG;EAC7B,aAAa;GACZ,KAAK,SAAS,KAAK,UAAW,SAAS,SAAS,SAAS,MAAM,CAAC,IAAI,OAAO,KAAK,IAAI,CAAE;EACvF;CACD;AACD;;;;;;AAOA,SAAgB,cAAiB,GAAG,MAAwC;CAG3E,gCAAqB,UAAU,GAAG,IAAI,GAAG,IAAI;AAC9C"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as cn } from "./utils-BkMLyah9.js";
|
|
3
|
+
import { i as useSpringTiers } from "./tuning-BKVFsxLr.js";
|
|
4
|
+
import { useCallback, useEffect, useState } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
7
|
+
|
|
8
|
+
//#region src/lib/motion/fluid-highlight.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Base UI toggles a bare `data-highlighted` attribute; cmdk uses
|
|
11
|
+
* `data-selected="true"`; Toggle/ToggleGroup mark the active item with
|
|
12
|
+
* `data-pressed`. The `:not([...="false"])` guards cover components
|
|
13
|
+
* like multi-select that render the attribute explicitly as "false".
|
|
14
|
+
*/
|
|
15
|
+
const TARGET_SELECTOR = "[data-highlighted]:not([data-highlighted=\"false\"]), [data-selected=\"true\"], [data-pressed]:not([data-pressed=\"false\"])";
|
|
16
|
+
const OBSERVED_ATTRIBUTES = [
|
|
17
|
+
"data-highlighted",
|
|
18
|
+
"data-selected",
|
|
19
|
+
"data-pressed"
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Where `target` sits inside `container`, in the container's own unscaled pixels. Popups scale in from 95%, and a
|
|
23
|
+
* transform changes no attribute or size to re-measure on, so a rect read on the first frame is shrunken; dividing
|
|
24
|
+
* by the container's current scale gives the size and offset it settles at. Pass `box` when the caller has already
|
|
25
|
+
* measured the container.
|
|
26
|
+
*/
|
|
27
|
+
function unscaledRect(target, container, box = container.getBoundingClientRect()) {
|
|
28
|
+
const t = target.getBoundingClientRect();
|
|
29
|
+
const scaleX = box.width / container.offsetWidth || 1;
|
|
30
|
+
const scaleY = box.height / container.offsetHeight || 1;
|
|
31
|
+
return {
|
|
32
|
+
top: (t.top - box.top) / scaleY,
|
|
33
|
+
left: (t.left - box.left) / scaleX,
|
|
34
|
+
width: t.width / scaleX,
|
|
35
|
+
height: t.height / scaleY
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Track the highlighted descendant of `container` and return its rect in the
|
|
40
|
+
* container's padding-box coordinates. Updates on highlight changes, DOM
|
|
41
|
+
* mutations, and any nested scroll (scroll doesn't bubble, so capture).
|
|
42
|
+
*/
|
|
43
|
+
function useFluidHighlight(container) {
|
|
44
|
+
const [state, setState] = useState(null);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!container) return;
|
|
47
|
+
const update = () => {
|
|
48
|
+
const target = container.querySelector(TARGET_SELECTOR);
|
|
49
|
+
if (!target) {
|
|
50
|
+
setState((s) => s ? {
|
|
51
|
+
...s,
|
|
52
|
+
visible: false
|
|
53
|
+
} : s);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const offset = unscaledRect(target, container);
|
|
57
|
+
setState({
|
|
58
|
+
rect: {
|
|
59
|
+
...offset,
|
|
60
|
+
top: offset.top - container.clientTop + container.scrollTop,
|
|
61
|
+
left: offset.left - container.clientLeft
|
|
62
|
+
},
|
|
63
|
+
visible: true
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
update();
|
|
67
|
+
const observer = new MutationObserver(update);
|
|
68
|
+
observer.observe(container, {
|
|
69
|
+
attributes: true,
|
|
70
|
+
attributeFilter: OBSERVED_ATTRIBUTES,
|
|
71
|
+
childList: true,
|
|
72
|
+
subtree: true
|
|
73
|
+
});
|
|
74
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(update);
|
|
75
|
+
resizeObserver?.observe(container);
|
|
76
|
+
container.addEventListener("scroll", update, {
|
|
77
|
+
capture: true,
|
|
78
|
+
passive: true
|
|
79
|
+
});
|
|
80
|
+
return () => {
|
|
81
|
+
observer.disconnect();
|
|
82
|
+
resizeObserver?.disconnect();
|
|
83
|
+
container.removeEventListener("scroll", update, { capture: true });
|
|
84
|
+
};
|
|
85
|
+
}, [container]);
|
|
86
|
+
return state;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Traveling highlight for menu/list popups — slides under whichever item is
|
|
90
|
+
* `[data-highlighted]` (Base UI) or `[data-selected="true"]` (cmdk) instead of
|
|
91
|
+
* flashing a per-item background. Render as the first child of a `relative`
|
|
92
|
+
* container; positioned siblings paint on top. No props needed — it locates
|
|
93
|
+
* its own parent as the tracking container.
|
|
94
|
+
*
|
|
95
|
+
* Appears/fades instantly at the target; travel uses the dial-tunable fast
|
|
96
|
+
* spring tier. Reduced-motion renders an untransitioned fill.
|
|
97
|
+
*/
|
|
98
|
+
function FluidHighlight({ className, inset = 0 }) {
|
|
99
|
+
const [container, setContainer] = useState(null);
|
|
100
|
+
const state = useFluidHighlight(container);
|
|
101
|
+
const reduce = useReducedMotion();
|
|
102
|
+
const tier = useSpringTiers().fast;
|
|
103
|
+
const mountRef = useCallback((el) => {
|
|
104
|
+
setContainer(el?.offsetParent ?? el?.parentElement ?? null);
|
|
105
|
+
}, []);
|
|
106
|
+
const rect = state ? {
|
|
107
|
+
top: state.rect.top + inset,
|
|
108
|
+
left: state.rect.left + inset,
|
|
109
|
+
width: state.rect.width - inset * 2,
|
|
110
|
+
height: state.rect.height - inset * 2
|
|
111
|
+
} : null;
|
|
112
|
+
return /* @__PURE__ */ jsx(motion.span, {
|
|
113
|
+
ref: mountRef,
|
|
114
|
+
"aria-hidden": true,
|
|
115
|
+
className: cn("pointer-events-none absolute rounded-sm bg-accent", className),
|
|
116
|
+
initial: rect ? {
|
|
117
|
+
...rect,
|
|
118
|
+
opacity: 0
|
|
119
|
+
} : false,
|
|
120
|
+
animate: rect ? {
|
|
121
|
+
...rect,
|
|
122
|
+
opacity: state?.visible ? 1 : 0
|
|
123
|
+
} : { opacity: 0 },
|
|
124
|
+
transition: reduce ? { duration: 0 } : {
|
|
125
|
+
type: "spring",
|
|
126
|
+
visualDuration: tier.duration,
|
|
127
|
+
bounce: tier.bounce
|
|
128
|
+
}
|
|
129
|
+
}, state ? "tracking" : "idle");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
export { unscaledRect as n, FluidHighlight as t };
|
|
134
|
+
//# sourceMappingURL=fluid-highlight-CNELHV8o.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid-highlight-CNELHV8o.js","names":[],"sources":["../src/lib/motion/fluid-highlight.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useState } from 'react';\nimport { motion, useReducedMotion } from 'motion/react';\n\nimport { cn } from '../utils';\nimport { useSpringTiers } from './tuning';\n\ninterface Rect {\n\ttop: number;\n\tleft: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * Base UI toggles a bare `data-highlighted` attribute; cmdk uses\n * `data-selected=\"true\"`; Toggle/ToggleGroup mark the active item with\n * `data-pressed`. The `:not([...=\"false\"])` guards cover components\n * like multi-select that render the attribute explicitly as \"false\".\n */\nconst TARGET_SELECTOR =\n\t'[data-highlighted]:not([data-highlighted=\"false\"]), [data-selected=\"true\"], [data-pressed]:not([data-pressed=\"false\"])';\nconst OBSERVED_ATTRIBUTES = ['data-highlighted', 'data-selected', 'data-pressed'];\n\n/**\n * Where `target` sits inside `container`, in the container's own unscaled pixels. Popups scale in from 95%, and a\n * transform changes no attribute or size to re-measure on, so a rect read on the first frame is shrunken; dividing\n * by the container's current scale gives the size and offset it settles at. Pass `box` when the caller has already\n * measured the container.\n */\nexport function unscaledRect(target: Element, container: HTMLElement, box = container.getBoundingClientRect()): Rect {\n\tconst t = target.getBoundingClientRect();\n\tconst scaleX = box.width / container.offsetWidth || 1;\n\tconst scaleY = box.height / container.offsetHeight || 1;\n\treturn {\n\t\ttop: (t.top - box.top) / scaleY,\n\t\tleft: (t.left - box.left) / scaleX,\n\t\twidth: t.width / scaleX,\n\t\theight: t.height / scaleY,\n\t};\n}\n\n/**\n * Track the highlighted descendant of `container` and return its rect in the\n * container's padding-box coordinates. Updates on highlight changes, DOM\n * mutations, and any nested scroll (scroll doesn't bubble, so capture).\n */\nfunction useFluidHighlight(container: HTMLElement | null): { rect: Rect; visible: boolean } | null {\n\tconst [state, setState] = useState<{ rect: Rect; visible: boolean } | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!container) return;\n\n\t\tconst update = () => {\n\t\t\tconst target = container.querySelector<HTMLElement>(TARGET_SELECTOR);\n\t\t\tif (!target) {\n\t\t\t\tsetState((s) => (s ? { ...s, visible: false } : s));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Unscaled, or a popup still scaling in leaves the highlight at the shrunken size of its first frame.\n\t\t\tconst offset = unscaledRect(target, container);\n\t\t\tsetState({\n\t\t\t\trect: {\n\t\t\t\t\t...offset,\n\t\t\t\t\ttop: offset.top - container.clientTop + container.scrollTop,\n\t\t\t\t\tleft: offset.left - container.clientLeft,\n\t\t\t\t},\n\t\t\t\tvisible: true,\n\t\t\t});\n\t\t};\n\n\t\tupdate();\n\t\tconst observer = new MutationObserver(update);\n\t\tobserver.observe(container, {\n\t\t\tattributes: true,\n\t\t\tattributeFilter: OBSERVED_ATTRIBUTES,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t});\n\t\t// Re-measure on resize too — items can reflow without attribute changes.\n\t\t// ResizeObserver is absent in jsdom and some embedded webviews.\n\t\tconst resizeObserver =\n\t\t\ttypeof ResizeObserver === 'undefined' ? null : new ResizeObserver(update);\n\t\tresizeObserver?.observe(container);\n\t\tcontainer.addEventListener('scroll', update, { capture: true, passive: true });\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t\tresizeObserver?.disconnect();\n\t\t\tcontainer.removeEventListener('scroll', update, { capture: true });\n\t\t};\n\t}, [container]);\n\n\treturn state;\n}\n\n/**\n * Traveling highlight for menu/list popups — slides under whichever item is\n * `[data-highlighted]` (Base UI) or `[data-selected=\"true\"]` (cmdk) instead of\n * flashing a per-item background. Render as the first child of a `relative`\n * container; positioned siblings paint on top. No props needed — it locates\n * its own parent as the tracking container.\n *\n * Appears/fades instantly at the target; travel uses the dial-tunable fast\n * spring tier. Reduced-motion renders an untransitioned fill.\n */\nexport function FluidHighlight({ className, inset = 0 }: { className?: string; inset?: number }) {\n\t// offsetParent is the containing block this span is positioned against —\n\t// measuring the target in the same coordinate space keeps rect math exact\n\t// whether the container itself scrolls or sits inside scrolled content.\n\tconst [container, setContainer] = useState<HTMLElement | null>(null);\n\tconst state = useFluidHighlight(container);\n\tconst reduce = useReducedMotion();\n\tconst tier = useSpringTiers().fast;\n\n\t// Stable, so React doesn't detach and reattach it (and set state again) on every render.\n\tconst mountRef = useCallback((el: HTMLElement | null) => {\n\t\tsetContainer((el?.offsetParent as HTMLElement | null) ?? el?.parentElement ?? null);\n\t}, []);\n\n\tconst rect = state\n\t\t? {\n\t\t\t\ttop: state.rect.top + inset,\n\t\t\t\tleft: state.rect.left + inset,\n\t\t\t\twidth: state.rect.width - inset * 2,\n\t\t\t\theight: state.rect.height - inset * 2,\n\t\t\t}\n\t\t: null;\n\n\treturn (\n\t\t// Remount on idle→tracking so the pill fades in at the target instead of\n\t\t// sliding from (0,0) — `initial` only applies on mount.\n\t\t<motion.span\n\t\t\tkey={state ? 'tracking' : 'idle'}\n\t\t\tref={mountRef}\n\t\t\taria-hidden\n\t\t\tclassName={cn('pointer-events-none absolute rounded-sm bg-accent', className)}\n\t\t\tinitial={rect ? { ...rect, opacity: 0 } : false}\n\t\t\tanimate={rect ? { ...rect, opacity: state?.visible ? 1 : 0 } : { opacity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