basalt-ui 1.40.3 → 2.0.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/AGENTS.md +50 -45
- package/CHANGELOG.md +543 -513
- package/MIGRATING.md +969 -37
- package/README.md +172 -367
- package/agent/rules/basalt-batteries.md +19 -74
- package/agent/rules/basalt-charts.md +21 -95
- package/agent/rules/basalt-controls.md +23 -131
- package/agent/rules/basalt-mantine.md +26 -99
- package/agent/rules/basalt-state.md +21 -103
- package/agent/rules/basalt-tokens.md +33 -114
- package/agent/skills/basalt-app/SKILL.md +229 -72
- package/agent/skills/basalt-charts/SKILL.md +23 -57
- package/agent/skills/basalt-design/SKILL.md +12 -70
- package/agent/templates/AGENTS-block.md.tpl +30 -0
- package/agent/templates/DESIGN.md.tpl +2 -2
- package/agent/templates/__root.tpl +9 -16
- package/agent/templates/main.tpl +21 -0
- package/agent/templates/nav.tpl +18 -0
- package/configs/check.yml +1 -1
- package/configs/oxlint-basalt.json +4 -10
- package/configs/oxlint-plugin.js +468 -847
- package/configs/oxlint-plugin.test.ts +662 -710
- package/configs/oxlint.json +10 -2
- package/dist/agent/ai-sdk-transport.d.ts +19 -7
- package/dist/agent/ai-sdk-transport.d.ts.map +1 -1
- package/dist/agent/ai-sdk-transport.js +10 -7
- package/dist/{agent-chat → agent/chat}/composer.d.ts +16 -16
- package/dist/agent/chat/composer.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/composer.js +10 -9
- package/dist/{agent-chat → agent/chat}/message-affordances.d.ts +7 -6
- package/dist/agent/chat/message-affordances.d.ts.map +1 -0
- package/dist/agent/chat/relative-time.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-feed-row.d.ts +18 -16
- package/dist/agent/chat/thread-feed-row.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-feed-row.js +12 -11
- package/dist/{agent-chat → agent/chat}/thread-feed.d.ts +8 -8
- package/dist/agent/chat/thread-feed.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-feed.js +12 -10
- package/dist/{agent-chat → agent/chat}/thread-message.d.ts +12 -9
- package/dist/agent/chat/thread-message.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-message.js +15 -13
- package/dist/{agent-chat → agent/chat}/thread-outcome-card.d.ts +2 -2
- package/dist/agent/chat/thread-outcome-card.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-outcome-card.js +3 -3
- package/dist/{agent-chat → agent/chat}/tool-chip.d.ts +5 -5
- package/dist/agent/chat/tool-chip.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/tool-chip.js +4 -4
- package/dist/agent/chat/use-keyboard-inset.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/use-keyboard-inset.js +1 -1
- package/dist/{agent-chat → agent/chat}/virtualize.d.ts +7 -7
- package/dist/agent/chat/virtualize.d.ts.map +1 -0
- package/dist/agent/error.d.ts +31 -0
- package/dist/agent/error.d.ts.map +1 -0
- package/dist/agent/error.js +18 -0
- package/dist/agent/foreign.d.ts +3 -2
- package/dist/agent/foreign.d.ts.map +1 -1
- package/dist/agent/history.d.ts +2 -36
- package/dist/agent/history.d.ts.map +1 -1
- package/dist/agent/history.js +0 -32
- package/dist/agent/id.d.ts +4 -5
- package/dist/agent/id.d.ts.map +1 -1
- package/dist/agent/index.d.ts +19 -52
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +10 -32
- package/dist/agent/outcome.d.ts +3 -14
- package/dist/agent/outcome.d.ts.map +1 -1
- package/dist/agent/outcome.js +0 -30
- package/dist/agent/part-list.d.ts +3 -3
- package/dist/agent/part-list.d.ts.map +1 -1
- package/dist/agent/parts.d.ts +23 -24
- package/dist/agent/parts.d.ts.map +1 -1
- package/dist/agent/run-committer.d.ts +23 -0
- package/dist/agent/run-committer.d.ts.map +1 -0
- package/dist/agent/run-committer.js +41 -0
- package/dist/agent/run-records.d.ts +77 -0
- package/dist/agent/run-records.d.ts.map +1 -0
- package/dist/agent/run-records.js +69 -0
- package/dist/agent/thread.d.ts +23 -47
- package/dist/agent/thread.d.ts.map +1 -1
- package/dist/agent/thread.js +3 -134
- package/dist/agent/transport.d.ts +6 -69
- package/dist/agent/transport.d.ts.map +1 -1
- package/dist/agent/transport.js +0 -18
- package/dist/agent/use-agent-thread-runs.d.ts +63 -26
- package/dist/agent/use-agent-thread-runs.d.ts.map +1 -1
- package/dist/agent/use-agent-thread-runs.js +202 -66
- package/dist/charts/BandStrip.d.ts +46 -0
- package/dist/charts/BandStrip.d.ts.map +1 -0
- package/dist/charts/BandStrip.js +151 -0
- package/dist/charts/Bars.d.ts +19 -0
- package/dist/charts/Bars.d.ts.map +1 -0
- package/dist/charts/Bars.js +77 -0
- package/dist/charts/CartesianChart.d.ts +57 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -0
- package/dist/charts/CartesianChart.js +121 -0
- package/dist/charts/ChartCard.d.ts +34 -0
- package/dist/charts/ChartCard.d.ts.map +1 -0
- package/dist/charts/ChartCard.js +115 -0
- package/dist/charts/Donut.d.ts +25 -0
- package/dist/charts/Donut.d.ts.map +1 -0
- package/dist/charts/Donut.js +191 -0
- package/dist/charts/DualPanel.d.ts +47 -0
- package/dist/charts/DualPanel.d.ts.map +1 -0
- package/dist/charts/DualPanel.js +214 -0
- package/dist/charts/Heatmap.d.ts +41 -0
- package/dist/charts/Heatmap.d.ts.map +1 -0
- package/dist/charts/Heatmap.js +216 -0
- package/dist/charts/Lines.d.ts +11 -0
- package/dist/charts/Lines.d.ts.map +1 -0
- package/dist/charts/Lines.js +114 -0
- package/dist/charts/MirroredBars.d.ts +44 -0
- package/dist/charts/MirroredBars.d.ts.map +1 -0
- package/dist/charts/MirroredBars.js +190 -0
- package/dist/charts/Sparkline.d.ts +22 -0
- package/dist/charts/Sparkline.d.ts.map +1 -0
- package/dist/charts/Sparkline.js +129 -0
- package/dist/charts/StackedArea.d.ts +15 -0
- package/dist/charts/StackedArea.d.ts.map +1 -0
- package/dist/charts/StackedArea.js +46 -0
- package/dist/charts/box.d.ts +38 -0
- package/dist/charts/box.d.ts.map +1 -0
- package/dist/charts/box.js +72 -0
- package/dist/charts/card-context.d.ts +3 -0
- package/dist/charts/card-context.d.ts.map +1 -0
- package/dist/charts/card-context.js +7 -0
- package/dist/charts/chart-box.module.css +64 -0
- package/{src/content/article-card.module.css.d.ts → dist/charts/chart-box.module.css.d.ts} +5 -9
- package/dist/charts/chart-card.module.css +25 -0
- package/dist/{dashboard/widget-grid.module.css.d.ts → charts/chart-card.module.css.d.ts} +1 -3
- package/dist/charts/chart-legend.module.css +38 -0
- package/{src/dashboard/widget-grid.module.css.d.ts → dist/charts/chart-legend.module.css.d.ts} +3 -3
- package/dist/charts/compile.d.ts +62 -0
- package/dist/charts/compile.d.ts.map +1 -0
- package/dist/charts/compile.js +386 -0
- package/dist/charts/cursor.d.ts +50 -0
- package/dist/charts/cursor.d.ts.map +1 -0
- package/dist/charts/cursor.js +157 -0
- package/dist/charts/curves.d.ts +12 -0
- package/dist/charts/curves.d.ts.map +1 -0
- package/dist/charts/curves.js +86 -0
- package/dist/charts/donut.module.css +54 -0
- package/dist/{content/article-card.module.css.d.ts → charts/donut.module.css.d.ts} +2 -9
- package/dist/charts/host.d.ts +17 -0
- package/dist/charts/host.d.ts.map +1 -0
- package/dist/charts/host.js +35 -0
- package/dist/charts/index.d.ts +18 -53
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/index.js +17 -189
- package/dist/charts/legend.d.ts +23 -0
- package/dist/charts/legend.d.ts.map +1 -0
- package/dist/charts/legend.js +160 -0
- package/dist/charts/marks.d.ts +25 -0
- package/dist/charts/marks.d.ts.map +1 -0
- package/dist/charts/marks.js +128 -0
- package/dist/charts/panel.d.ts +56 -0
- package/dist/charts/panel.d.ts.map +1 -0
- package/dist/charts/panel.js +123 -0
- package/dist/charts/scales.d.ts +44 -0
- package/dist/charts/scales.d.ts.map +1 -0
- package/dist/charts/scales.js +163 -0
- package/dist/charts/sizing.d.ts +12 -0
- package/dist/charts/sizing.d.ts.map +1 -0
- package/dist/charts/sizing.js +33 -0
- package/dist/charts/state.d.ts +17 -0
- package/dist/charts/state.d.ts.map +1 -0
- package/dist/charts/state.js +53 -0
- package/dist/charts/theme.d.ts +38 -19
- package/dist/charts/theme.d.ts.map +1 -1
- package/dist/charts/theme.js +48 -26
- package/dist/charts/types.d.ts +227 -0
- package/dist/charts/types.d.ts.map +1 -0
- package/dist/charts/types.js +4 -0
- package/dist/cli/audit-allows.d.ts +4 -17
- package/dist/cli/audit-allows.d.ts.map +1 -1
- package/dist/cli/config.d.ts +14 -43
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.d.ts +31 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -0
- package/dist/cli/doctor-upgrade.js +269 -0
- package/dist/cli/doctor.d.ts +13 -26
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +79 -8
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +2 -4
- package/dist/cli/index.d.ts +68 -135
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +89 -76
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +43 -27
- package/dist/cli/sync.d.ts +5 -21
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +4 -6
- package/dist/cli/tokens-css.d.ts +7 -28
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/commands/ShortcutsHelp.d.ts.map +1 -1
- package/dist/commands/ShortcutsHelp.js +4 -5
- package/dist/commands/define-commands.d.ts +15 -31
- package/dist/commands/define-commands.d.ts.map +1 -1
- package/dist/commands/define-commands.js +1 -11
- package/dist/commands/define-overlays.d.ts +5 -19
- package/dist/commands/define-overlays.d.ts.map +1 -1
- package/dist/commands/define-overlays.js +3 -11
- package/dist/commands/index.d.ts +10 -40
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +9 -46
- package/dist/{notifications → commands/notifications}/bell.d.ts +1 -1
- package/dist/commands/notifications/bell.d.ts.map +1 -0
- package/dist/{notifications → commands/notifications}/center.d.ts +2 -2
- package/dist/commands/notifications/center.d.ts.map +1 -0
- package/dist/{notifications → commands/notifications}/center.js +2 -2
- package/dist/{notifications → commands/notifications}/define-notifications.d.ts +3 -3
- package/dist/commands/notifications/define-notifications.d.ts.map +1 -0
- package/dist/commands/notifications/notify.d.ts +44 -0
- package/dist/commands/notifications/notify.d.ts.map +1 -0
- package/dist/commands/notifications/notify.js +79 -0
- package/dist/{notifications → commands/notifications}/store.d.ts +2 -0
- package/dist/commands/notifications/store.d.ts.map +1 -0
- package/dist/{notifications → commands/notifications}/store.js +4 -0
- package/dist/commands/projectors.d.ts +1 -131
- package/dist/commands/projectors.d.ts.map +1 -1
- package/dist/commands/projectors.js +2 -73
- package/dist/commands/shell-bridge.d.ts +3 -3
- package/dist/commands/shortcut-format.d.ts +5 -4
- package/dist/commands/shortcut-format.d.ts.map +1 -1
- package/dist/common/errors.d.ts +3 -3
- package/dist/common/use-measured-widths.d.ts.map +1 -1
- package/dist/common/use-measured-widths.js +5 -3
- package/dist/common/validate.d.ts +2 -2
- package/dist/content/article-layout.d.ts.map +1 -1
- package/dist/content/article-layout.js +3 -3
- package/dist/content/article-model.d.ts +1 -46
- package/dist/content/article-model.d.ts.map +1 -1
- package/dist/content/article-model.js +1 -29
- package/dist/content/copy-action.d.ts +1 -1
- package/dist/content/glyphs.d.ts +1 -1
- package/dist/content/index.d.ts +11 -41
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +3 -35
- package/dist/content/markdown.d.ts +1 -1
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content/mermaid.d.ts.map +1 -1
- package/dist/content/mermaid.js +7 -7
- package/dist/content/slug.d.ts +1 -8
- package/dist/content/slug.d.ts.map +1 -1
- package/dist/content/slug.js +1 -8
- package/dist/content/url-hardening.d.ts +2 -2
- package/dist/content/url-hardening.d.ts.map +1 -1
- package/dist/content/url-hardening.js +2 -0
- package/dist/controls/actions.d.ts +16 -1
- package/dist/controls/actions.d.ts.map +1 -1
- package/dist/controls/enum-filter.d.ts +1 -1
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/filter-context.d.ts.map +1 -1
- package/dist/controls/filter-context.js +3 -1
- package/dist/controls/filter-set.js +4 -6
- package/dist/controls/form-layout.d.ts +1 -1
- package/dist/controls/form-layout.d.ts.map +1 -1
- package/dist/controls/form-layout.js +1 -1
- package/dist/controls/glyphs.d.ts +0 -2
- package/dist/controls/glyphs.d.ts.map +1 -1
- package/dist/controls/glyphs.js +0 -7
- package/dist/controls/index.d.ts +12 -17
- package/dist/controls/index.d.ts.map +1 -1
- package/dist/controls/index.js +5 -39
- package/dist/controls/multi-select-filter.d.ts +4 -3
- package/dist/controls/multi-select-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.d.ts +4 -3
- package/dist/controls/number-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.js +3 -1
- package/dist/controls/range-filter.d.ts +4 -3
- package/dist/controls/range-filter.d.ts.map +1 -1
- package/dist/controls/search-filter.d.ts +4 -3
- package/dist/controls/search-filter.d.ts.map +1 -1
- package/dist/controls/search-filter.js +19 -14
- package/dist/controls/select-filter.d.ts +4 -3
- package/dist/controls/select-filter.d.ts.map +1 -1
- package/dist/controls/sync-button.d.ts.map +1 -1
- package/dist/controls/sync-button.js +12 -15
- package/dist/controls/toggle-filter.d.ts +4 -3
- package/dist/controls/toggle-filter.d.ts.map +1 -1
- package/dist/controls/uncontrolled.d.ts +12 -0
- package/dist/controls/uncontrolled.d.ts.map +1 -0
- package/dist/controls/view-tabs.d.ts +2 -2
- package/dist/controls/view-tabs.d.ts.map +1 -1
- package/dist/controls-dates/index.d.ts +0 -1
- package/dist/controls-dates/index.d.ts.map +1 -1
- package/dist/dashboard/index.d.ts +7 -9
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +3 -23
- package/dist/dashboard/section.d.ts +4 -6
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +4 -10
- package/dist/dashboard/stat-card.d.ts +4 -4
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +3 -3
- package/dist/dashboard/widget-header.module.css +9 -7
- package/dist/dev-dock.d.ts.map +1 -1
- package/dist/dev-dock.js +6 -1
- package/dist/format/date.d.ts +0 -34
- package/dist/format/date.d.ts.map +1 -1
- package/dist/format/date.js +0 -54
- package/dist/format/index.d.ts +7 -22
- package/dist/format/index.d.ts.map +1 -1
- package/dist/format/index.js +2 -43
- package/dist/format/number.d.ts +3 -14
- package/dist/format/number.d.ts.map +1 -1
- package/dist/format/number.js +0 -13
- package/dist/format/shared.d.ts +2 -3
- package/dist/format/shared.d.ts.map +1 -1
- package/dist/forms/index.d.ts +0 -11
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/forms/index.js +1 -14
- package/dist/guard/index.d.ts +6 -21
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +27 -115
- package/dist/guard/types.d.ts +7 -18
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +16 -48
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -117
- package/dist/provider/create-router.d.ts +44 -0
- package/dist/provider/create-router.d.ts.map +1 -0
- package/dist/provider/create-router.js +62 -0
- package/dist/provider/hotkeys.d.ts +8 -0
- package/dist/provider/hotkeys.d.ts.map +1 -0
- package/dist/provider/hotkeys.js +50 -0
- package/dist/provider/index.d.ts +33 -110
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +182 -82
- package/dist/provider/lab-theme.d.ts.map +1 -1
- package/dist/provider/route-transition.d.ts +76 -0
- package/dist/provider/route-transition.d.ts.map +1 -0
- package/dist/provider/route-transition.js +98 -0
- package/dist/provider/spotlight-actions.d.ts +10 -0
- package/dist/provider/spotlight-actions.d.ts.map +1 -0
- package/dist/provider/spotlight-actions.js +55 -0
- package/dist/provider/test-router.d.ts +6 -0
- package/dist/provider/test-router.d.ts.map +1 -0
- package/dist/provider/test-router.js +18 -0
- package/dist/query-client.d.ts +4 -20
- package/dist/query-client.d.ts.map +1 -1
- package/dist/query-client.js +2 -2
- package/dist/router-tanstack/index.d.ts +18 -64
- package/dist/router-tanstack/index.d.ts.map +1 -1
- package/dist/router-tanstack/index.js +2 -16
- package/dist/router-tanstack/nav.d.ts +12 -1
- package/dist/router-tanstack/nav.d.ts.map +1 -1
- package/dist/router-tanstack/nav.js +8 -1
- package/dist/router-tanstack/search-store.d.ts +1 -1
- package/dist/router-tanstack/search-store.d.ts.map +1 -1
- package/dist/router-tanstack/use-nav.d.ts +8 -9
- package/dist/router-tanstack/use-nav.d.ts.map +1 -1
- package/dist/router-tanstack/use-nav.js +20 -1
- package/dist/shell/app-mobile-nav.d.ts.map +1 -1
- package/dist/shell/app-sidebar.js +1 -1
- package/dist/shell/index.d.ts +31 -10
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +14 -3
- package/dist/shell/page-aside.d.ts +2 -2
- package/dist/shell/page-aside.d.ts.map +1 -1
- package/dist/shell/page-aside.js +31 -12
- package/dist/shell/page-bar.d.ts +2 -2
- package/dist/shell/page-bar.d.ts.map +1 -1
- package/dist/shell/page-bar.js +1 -1
- package/dist/state.d.ts +10 -12
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +4 -6
- package/dist/styles.css +107 -7
- package/dist/surfaces.d.ts +28 -103
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +54 -143
- package/dist/{data → table}/data-table-state.d.ts +1 -1
- package/dist/table/data-table-state.d.ts.map +1 -0
- package/dist/{data → table}/data-table-state.js +4 -3
- package/dist/{data → table}/data-table.d.ts +28 -49
- package/dist/table/data-table.d.ts.map +1 -0
- package/dist/{data → table}/data-table.js +74 -60
- package/dist/table/index.d.ts +18 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/{data/table.js → table/index.js} +1 -1
- package/dist/table/query-branch.d.ts.map +1 -0
- package/dist/table/table-features.d.ts +69 -0
- package/dist/table/table-features.d.ts.map +1 -0
- package/dist/table/table-features.js +49 -0
- package/dist/telemetry.d.ts +77 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +33 -0
- package/dist/theme/index.d.ts +10 -21
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +3 -14
- package/dist/theme/theme-toggle.d.ts.map +1 -1
- package/dist/theme/theme-toggle.js +7 -33
- package/dist/theme/theme-toggle.module.css +30 -0
- package/dist/theme/theme-toggle.module.css.d.ts +10 -0
- package/dist/theme-lab/derive-controls.d.ts.map +1 -1
- package/dist/theme-lab/derive-controls.js +5 -3
- package/dist/theme-lab/derive-state.d.ts.map +1 -1
- package/dist/theme-lab/derive-state.js +2 -1
- package/dist/tokens/core.d.ts +360 -0
- package/dist/tokens/core.d.ts.map +1 -0
- package/dist/tokens/core.js +708 -0
- package/dist/tokens/derive.d.ts +1 -1
- package/dist/tokens/derive.d.ts.map +1 -1
- package/dist/tokens/index.d.ts +5 -373
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +8 -700
- package/dist/tokens/palette.d.ts +2 -6
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +1 -4
- package/dist/vite.d.ts +4 -3
- package/dist/vite.d.ts.map +1 -1
- package/llms.txt +43 -85
- package/package.json +77 -170
- package/src/agent/ai-sdk-transport.ts +57 -37
- package/src/{agent-chat → agent/chat}/composer.tsx +29 -30
- package/src/{agent-chat → agent/chat}/message-affordances.ts +8 -5
- package/src/{agent-chat → agent/chat}/thread-feed-row.tsx +30 -35
- package/src/{agent-chat → agent/chat}/thread-feed.tsx +40 -35
- package/src/{agent-chat → agent/chat}/thread-message.tsx +37 -35
- package/src/{agent-chat → agent/chat}/thread-outcome-card.tsx +5 -5
- package/src/{agent-chat → agent/chat}/tool-chip.tsx +12 -12
- package/src/{agent-chat → agent/chat}/use-keyboard-inset.ts +1 -1
- package/src/{agent-chat → agent/chat}/virtualize.ts +5 -5
- package/src/agent/error.ts +43 -0
- package/src/agent/foreign.ts +3 -2
- package/src/agent/history.ts +2 -107
- package/src/agent/id.ts +4 -5
- package/src/agent/index.ts +23 -112
- package/src/agent/outcome.ts +3 -56
- package/src/agent/part-list.tsx +3 -3
- package/src/agent/parts.ts +23 -22
- package/src/agent/run-committer.ts +64 -0
- package/src/agent/run-records.ts +147 -0
- package/src/agent/thread.ts +24 -231
- package/src/agent/transport.ts +6 -96
- package/src/agent/use-agent-thread-runs.ts +364 -199
- package/src/charts/BandStrip.tsx +276 -0
- package/src/charts/Bars.tsx +141 -0
- package/src/charts/CartesianChart.tsx +206 -0
- package/src/charts/ChartCard.tsx +178 -0
- package/src/charts/Donut.tsx +256 -0
- package/src/charts/DualPanel.tsx +326 -0
- package/src/charts/Heatmap.tsx +282 -0
- package/src/charts/Lines.tsx +151 -0
- package/src/charts/MirroredBars.tsx +303 -0
- package/src/charts/Sparkline.tsx +176 -0
- package/src/charts/StackedArea.tsx +80 -0
- package/src/charts/box.tsx +96 -0
- package/src/charts/card-context.ts +11 -0
- package/src/charts/chart-box.module.css +64 -0
- package/src/charts/chart-box.module.css.d.ts +12 -0
- package/src/charts/chart-card.module.css +25 -0
- package/src/charts/chart-card.module.css.d.ts +8 -0
- package/src/charts/chart-legend.module.css +38 -0
- package/src/charts/chart-legend.module.css.d.ts +10 -0
- package/src/charts/compile.ts +585 -0
- package/src/charts/cursor.ts +282 -0
- package/src/charts/curves.ts +111 -0
- package/src/charts/donut.module.css +54 -0
- package/src/charts/donut.module.css.d.ts +9 -0
- package/src/charts/host.tsx +60 -0
- package/src/charts/index.ts +41 -178
- package/src/charts/legend.tsx +204 -0
- package/src/charts/marks.ts +201 -0
- package/src/charts/panel.tsx +227 -0
- package/src/charts/scales.ts +237 -0
- package/src/charts/sizing.ts +47 -0
- package/src/charts/state.tsx +80 -0
- package/src/charts/theme.ts +65 -0
- package/src/charts/types.ts +242 -0
- package/src/cli/audit-allows.ts +8 -30
- package/src/cli/config.ts +14 -43
- package/src/cli/doctor-upgrade.ts +392 -0
- package/src/cli/doctor.ts +120 -68
- package/src/cli/help.ts +2 -4
- package/src/cli/index.ts +161 -276
- package/src/cli/init.ts +60 -37
- package/src/cli/sync.ts +13 -45
- package/src/cli/tokens-css.ts +7 -28
- package/src/commands/ShortcutsHelp.tsx +8 -9
- package/src/commands/define-commands.ts +16 -43
- package/src/commands/define-overlays.ts +12 -36
- package/src/commands/index.ts +11 -94
- package/src/{notifications → commands/notifications}/bell.tsx +2 -2
- package/src/{notifications → commands/notifications}/center.tsx +7 -5
- package/src/{notifications → commands/notifications}/define-notifications.ts +3 -3
- package/src/commands/notifications/notify.tsx +158 -0
- package/src/{notifications → commands/notifications}/store.ts +10 -2
- package/src/commands/projectors.ts +5 -225
- package/src/commands/shell-bridge.ts +5 -5
- package/src/commands/shortcut-format.ts +5 -4
- package/src/common/errors.ts +3 -3
- package/src/common/use-measured-widths.ts +6 -3
- package/src/common/validate.ts +2 -2
- package/src/content/article-layout.tsx +37 -38
- package/src/content/article-model.ts +1 -84
- package/src/content/copy-action.tsx +1 -1
- package/src/content/glyphs.tsx +1 -1
- package/src/content/index.ts +12 -83
- package/src/content/markdown.tsx +4 -3
- package/src/content/mermaid.tsx +9 -7
- package/src/content/slug.ts +1 -16
- package/src/content/url-hardening.ts +8 -2
- package/src/controls/actions.tsx +24 -1
- package/src/controls/enum-filter.tsx +1 -1
- package/src/controls/filter-context.tsx +3 -1
- package/src/controls/filter-set.tsx +5 -7
- package/src/controls/form-layout.tsx +2 -2
- package/src/controls/glyphs.tsx +0 -10
- package/src/controls/index.ts +13 -64
- package/src/controls/multi-select-filter.tsx +5 -4
- package/src/controls/number-filter.tsx +8 -4
- package/src/controls/range-filter.tsx +5 -4
- package/src/controls/search-filter.tsx +25 -19
- package/src/controls/select-filter.tsx +5 -4
- package/src/controls/sync-button.tsx +18 -20
- package/src/controls/toggle-filter.tsx +5 -4
- package/src/controls/uncontrolled.ts +12 -0
- package/src/controls/view-tabs.tsx +3 -3
- package/src/controls-dates/date-range-picker.tsx +1 -1
- package/src/controls-dates/index.ts +0 -1
- package/src/dashboard/index.ts +7 -48
- package/src/dashboard/section.tsx +11 -40
- package/src/dashboard/stat-card.tsx +14 -16
- package/src/dashboard/widget-header.module.css +9 -7
- package/src/dev-dock.tsx +14 -27
- package/src/format/date.ts +2 -92
- package/src/format/index.ts +7 -53
- package/src/format/number.ts +3 -26
- package/src/format/shared.ts +2 -3
- package/src/forms/index.ts +0 -23
- package/src/guard/index.ts +37 -192
- package/src/guard/types.ts +6 -19
- package/src/index.ts +30 -282
- package/src/provider/create-router.tsx +138 -0
- package/src/provider/hotkeys.ts +70 -0
- package/src/provider/index.tsx +260 -230
- package/src/provider/lab-theme.ts +3 -2
- package/src/provider/route-transition.ts +199 -0
- package/src/provider/spotlight-actions.tsx +69 -0
- package/src/provider/test-router.tsx +25 -0
- package/src/query-client.ts +4 -22
- package/src/router-tanstack/index.ts +18 -112
- package/src/router-tanstack/nav.ts +28 -2
- package/src/router-tanstack/search-store.ts +9 -2
- package/src/router-tanstack/use-nav.ts +47 -13
- package/src/shell/app-mobile-nav.tsx +3 -2
- package/src/shell/app-sidebar.tsx +1 -1
- package/src/shell/aside-docking.ts +1 -1
- package/src/shell/index.tsx +61 -20
- package/src/shell/page-aside.tsx +47 -23
- package/src/shell/page-bar.tsx +3 -3
- package/src/shell/page-title.tsx +1 -1
- package/src/state.ts +11 -37
- package/src/styles.css +107 -7
- package/src/surfaces.ts +56 -151
- package/src/{data → table}/data-table-state.ts +5 -4
- package/src/{data → table}/data-table.tsx +170 -161
- package/src/table/index.ts +18 -0
- package/src/table/table-features.ts +102 -0
- package/src/telemetry.ts +110 -0
- package/src/theme/index.ts +22 -47
- package/src/theme/theme-toggle.module.css +30 -0
- package/src/theme/theme-toggle.module.css.d.ts +10 -0
- package/src/theme/theme-toggle.tsx +15 -43
- package/src/theme-lab/derive-controls.tsx +5 -3
- package/src/theme-lab/derive-state.ts +2 -1
- package/src/tokens/core.ts +1163 -0
- package/src/tokens/derive.ts +1 -1
- package/src/tokens/index.ts +14 -1181
- package/src/tokens/palette.ts +3 -7
- package/src/vite.ts +3 -3
- package/agent/templates/CLAUDE-block.md.tpl +0 -40
- package/agent/templates/query-client.ts.tpl +0 -26
- package/dist/agent/adapter.d.ts +0 -150
- package/dist/agent/adapter.d.ts.map +0 -1
- package/dist/agent/adapter.js +0 -482
- package/dist/agent/use-agent-stream.d.ts +0 -35
- package/dist/agent/use-agent-stream.d.ts.map +0 -1
- package/dist/agent/use-agent-stream.js +0 -59
- package/dist/agent-chat/composer.d.ts.map +0 -1
- package/dist/agent-chat/index.d.ts +0 -31
- package/dist/agent-chat/index.d.ts.map +0 -1
- package/dist/agent-chat/index.js +0 -19
- package/dist/agent-chat/message-affordances.d.ts.map +0 -1
- package/dist/agent-chat/relative-time.d.ts.map +0 -1
- package/dist/agent-chat/thread-detail-panel.d.ts +0 -28
- package/dist/agent-chat/thread-detail-panel.d.ts.map +0 -1
- package/dist/agent-chat/thread-detail-panel.js +0 -115
- package/dist/agent-chat/thread-feed-row.d.ts.map +0 -1
- package/dist/agent-chat/thread-feed.d.ts.map +0 -1
- package/dist/agent-chat/thread-message.d.ts.map +0 -1
- package/dist/agent-chat/thread-outcome-card.d.ts.map +0 -1
- package/dist/agent-chat/thread-workspace.d.ts +0 -44
- package/dist/agent-chat/thread-workspace.d.ts.map +0 -1
- package/dist/agent-chat/thread-workspace.js +0 -153
- package/dist/agent-chat/tool-chip.d.ts.map +0 -1
- package/dist/agent-chat/use-keyboard-inset.d.ts.map +0 -1
- package/dist/agent-chat/virtualize.d.ts.map +0 -1
- package/dist/charts/cursor/resolve.d.ts +0 -75
- package/dist/charts/cursor/resolve.d.ts.map +0 -1
- package/dist/charts/cursor/resolve.js +0 -91
- package/dist/charts/cursor/scope.d.ts +0 -20
- package/dist/charts/cursor/scope.d.ts.map +0 -1
- package/dist/charts/cursor/scope.js +0 -20
- package/dist/charts/cursor/store.d.ts +0 -35
- package/dist/charts/cursor/store.d.ts.map +0 -1
- package/dist/charts/cursor/store.js +0 -25
- package/dist/charts/cursor/touch-pin.d.ts +0 -45
- package/dist/charts/cursor/touch-pin.d.ts.map +0 -1
- package/dist/charts/cursor/touch-pin.js +0 -79
- package/dist/charts/hooks/use-discrete-cursor.d.ts +0 -66
- package/dist/charts/hooks/use-discrete-cursor.d.ts.map +0 -1
- package/dist/charts/hooks/use-discrete-cursor.js +0 -198
- package/dist/charts/hooks/use-hysteresis.d.ts +0 -18
- package/dist/charts/hooks/use-hysteresis.d.ts.map +0 -1
- package/dist/charts/hooks/use-hysteresis.js +0 -12
- package/dist/charts/hooks/useBandPlot.d.ts +0 -145
- package/dist/charts/hooks/useBandPlot.d.ts.map +0 -1
- package/dist/charts/hooks/useBandPlot.js +0 -178
- package/dist/charts/hooks/useChartCursor.d.ts +0 -75
- package/dist/charts/hooks/useChartCursor.d.ts.map +0 -1
- package/dist/charts/hooks/useChartCursor.js +0 -200
- package/dist/charts/hooks/useChartSize.d.ts +0 -29
- package/dist/charts/hooks/useChartSize.d.ts.map +0 -1
- package/dist/charts/hooks/useChartSize.js +0 -8
- package/dist/charts/kinds/BandStrip.d.ts +0 -132
- package/dist/charts/kinds/BandStrip.d.ts.map +0 -1
- package/dist/charts/kinds/BandStrip.js +0 -241
- package/dist/charts/kinds/Bars.d.ts +0 -141
- package/dist/charts/kinds/Bars.d.ts.map +0 -1
- package/dist/charts/kinds/Bars.js +0 -343
- package/dist/charts/kinds/Donut.d.ts +0 -77
- package/dist/charts/kinds/Donut.d.ts.map +0 -1
- package/dist/charts/kinds/Donut.js +0 -245
- package/dist/charts/kinds/DualPanel.d.ts +0 -111
- package/dist/charts/kinds/DualPanel.d.ts.map +0 -1
- package/dist/charts/kinds/DualPanel.js +0 -471
- package/dist/charts/kinds/Heatmap.d.ts +0 -85
- package/dist/charts/kinds/Heatmap.d.ts.map +0 -1
- package/dist/charts/kinds/Heatmap.js +0 -243
- package/dist/charts/kinds/MirroredBars.d.ts +0 -98
- package/dist/charts/kinds/MirroredBars.d.ts.map +0 -1
- package/dist/charts/kinds/MirroredBars.js +0 -292
- package/dist/charts/kinds/MultiLine.d.ts +0 -87
- package/dist/charts/kinds/MultiLine.d.ts.map +0 -1
- package/dist/charts/kinds/MultiLine.js +0 -176
- package/dist/charts/kinds/StackedArea.d.ts +0 -73
- package/dist/charts/kinds/StackedArea.d.ts.map +0 -1
- package/dist/charts/kinds/StackedArea.js +0 -135
- package/dist/charts/kinds/ZonedLine.d.ts +0 -97
- package/dist/charts/kinds/ZonedLine.d.ts.map +0 -1
- package/dist/charts/kinds/ZonedLine.js +0 -155
- package/dist/charts/kinds/band-chrome.d.ts +0 -31
- package/dist/charts/kinds/band-chrome.d.ts.map +0 -1
- package/dist/charts/kinds/band-chrome.js +0 -71
- package/dist/charts/kinds/donut-layout.d.ts +0 -47
- package/dist/charts/kinds/donut-layout.d.ts.map +0 -1
- package/dist/charts/kinds/donut-layout.js +0 -52
- package/dist/charts/layout/auto-margin.d.ts +0 -122
- package/dist/charts/layout/auto-margin.d.ts.map +0 -1
- package/dist/charts/layout/auto-margin.js +0 -81
- package/dist/charts/layout/end-labels.d.ts +0 -64
- package/dist/charts/layout/end-labels.d.ts.map +0 -1
- package/dist/charts/layout/end-labels.js +0 -76
- package/dist/charts/layout/log-ticks.d.ts +0 -27
- package/dist/charts/layout/log-ticks.d.ts.map +0 -1
- package/dist/charts/layout/log-ticks.js +0 -42
- package/dist/charts/primitives/AreaGradient.d.ts +0 -18
- package/dist/charts/primitives/AreaGradient.d.ts.map +0 -1
- package/dist/charts/primitives/AreaGradient.js +0 -13
- package/dist/charts/primitives/Axes.d.ts +0 -83
- package/dist/charts/primitives/Axes.d.ts.map +0 -1
- package/dist/charts/primitives/Axes.js +0 -168
- package/dist/charts/primitives/CartesianChart.d.ts +0 -257
- package/dist/charts/primitives/CartesianChart.d.ts.map +0 -1
- package/dist/charts/primitives/CartesianChart.js +0 -549
- package/dist/charts/primitives/ChartCard.d.ts +0 -66
- package/dist/charts/primitives/ChartCard.d.ts.map +0 -1
- package/dist/charts/primitives/ChartCard.js +0 -143
- package/dist/charts/primitives/ChartFrame.d.ts +0 -156
- package/dist/charts/primitives/ChartFrame.d.ts.map +0 -1
- package/dist/charts/primitives/ChartFrame.js +0 -241
- package/dist/charts/primitives/ChartLegend.d.ts +0 -67
- package/dist/charts/primitives/ChartLegend.d.ts.map +0 -1
- package/dist/charts/primitives/ChartLegend.js +0 -292
- package/dist/charts/primitives/ChartPending.d.ts +0 -113
- package/dist/charts/primitives/ChartPending.d.ts.map +0 -1
- package/dist/charts/primitives/ChartPending.js +0 -117
- package/dist/charts/primitives/ChartTooltip.d.ts +0 -59
- package/dist/charts/primitives/ChartTooltip.d.ts.map +0 -1
- package/dist/charts/primitives/ChartTooltip.js +0 -197
- package/dist/charts/primitives/Crosshair.d.ts +0 -26
- package/dist/charts/primitives/Crosshair.d.ts.map +0 -1
- package/dist/charts/primitives/Crosshair.js +0 -23
- package/dist/charts/primitives/HatchPattern.d.ts +0 -31
- package/dist/charts/primitives/HatchPattern.d.ts.map +0 -1
- package/dist/charts/primitives/HatchPattern.js +0 -31
- package/dist/charts/primitives/HoverOverlay.d.ts +0 -45
- package/dist/charts/primitives/HoverOverlay.d.ts.map +0 -1
- package/dist/charts/primitives/HoverOverlay.js +0 -72
- package/dist/charts/primitives/HoverOverlay.module.css +0 -13
- package/dist/charts/primitives/HoverOverlay.module.css.d.ts +0 -8
- package/dist/charts/primitives/XZoneRects.d.ts +0 -54
- package/dist/charts/primitives/XZoneRects.d.ts.map +0 -1
- package/dist/charts/primitives/XZoneRects.js +0 -65
- package/dist/charts/primitives/ZoneRects.d.ts +0 -38
- package/dist/charts/primitives/ZoneRects.d.ts.map +0 -1
- package/dist/charts/primitives/ZoneRects.js +0 -30
- package/dist/charts/primitives/chart-card-context.d.ts +0 -33
- package/dist/charts/primitives/chart-card-context.d.ts.map +0 -1
- package/dist/charts/primitives/chart-card-context.js +0 -18
- package/dist/charts/primitives/chart-frame-layout.d.ts +0 -185
- package/dist/charts/primitives/chart-frame-layout.d.ts.map +0 -1
- package/dist/charts/primitives/chart-frame-layout.js +0 -175
- package/dist/charts/primitives/chart-layout.d.ts +0 -112
- package/dist/charts/primitives/chart-layout.d.ts.map +0 -1
- package/dist/charts/primitives/chart-layout.js +0 -175
- package/dist/charts/primitives/chart-tier.d.ts +0 -16
- package/dist/charts/primitives/chart-tier.d.ts.map +0 -1
- package/dist/charts/primitives/chart-tier.js +0 -44
- package/dist/charts/primitives/legend-disclosure.d.ts +0 -27
- package/dist/charts/primitives/legend-disclosure.d.ts.map +0 -1
- package/dist/charts/primitives/legend-disclosure.js +0 -153
- package/dist/charts/series.d.ts +0 -189
- package/dist/charts/series.d.ts.map +0 -1
- package/dist/charts/series.js +0 -84
- package/dist/charts/sparklines/BarSparkline.d.ts +0 -37
- package/dist/charts/sparklines/BarSparkline.d.ts.map +0 -1
- package/dist/charts/sparklines/BarSparkline.js +0 -53
- package/dist/charts/sparklines/LineSparkline.d.ts +0 -15
- package/dist/charts/sparklines/LineSparkline.d.ts.map +0 -1
- package/dist/charts/sparklines/LineSparkline.js +0 -51
- package/dist/charts/sparklines/index.d.ts +0 -3
- package/dist/charts/sparklines/index.d.ts.map +0 -1
- package/dist/charts/sparklines/index.js +0 -6
- package/dist/charts/utils/domain.d.ts +0 -35
- package/dist/charts/utils/domain.d.ts.map +0 -1
- package/dist/charts/utils/domain.js +0 -12
- package/dist/charts/utils/format.d.ts +0 -8
- package/dist/charts/utils/format.d.ts.map +0 -1
- package/dist/charts/utils/format.js +0 -20
- package/dist/charts/utils/measure-text.d.ts +0 -25
- package/dist/charts/utils/measure-text.d.ts.map +0 -1
- package/dist/charts/utils/measure-text.js +0 -64
- package/dist/charts/utils/ticks.d.ts +0 -103
- package/dist/charts/utils/ticks.d.ts.map +0 -1
- package/dist/charts/utils/ticks.js +0 -92
- package/dist/commands/overlays-mount.d.ts +0 -122
- package/dist/commands/overlays-mount.d.ts.map +0 -1
- package/dist/commands/overlays-mount.js +0 -125
- package/dist/commands/useCommandHotkeys.d.ts +0 -14
- package/dist/commands/useCommandHotkeys.d.ts.map +0 -1
- package/dist/commands/useCommandHotkeys.js +0 -45
- package/dist/content/article-actions.d.ts +0 -39
- package/dist/content/article-actions.d.ts.map +0 -1
- package/dist/content/article-actions.js +0 -28
- package/dist/content/article-card.d.ts +0 -58
- package/dist/content/article-card.d.ts.map +0 -1
- package/dist/content/article-card.js +0 -79
- package/dist/content/article-card.module.css +0 -111
- package/dist/content/mdx.d.ts +0 -20
- package/dist/content/mdx.d.ts.map +0 -1
- package/dist/content/mdx.js +0 -64
- package/dist/controls/compare-filter.d.ts +0 -42
- package/dist/controls/compare-filter.d.ts.map +0 -1
- package/dist/controls/compare-filter.js +0 -38
- package/dist/controls/slider-control.d.ts +0 -36
- package/dist/controls/slider-control.d.ts.map +0 -1
- package/dist/controls/slider-control.js +0 -64
- package/dist/dashboard/widget-grid.d.ts +0 -27
- package/dist/dashboard/widget-grid.d.ts.map +0 -1
- package/dist/dashboard/widget-grid.js +0 -40
- package/dist/dashboard/widget-grid.module.css +0 -69
- package/dist/data/data-table-state.d.ts.map +0 -1
- package/dist/data/data-table.d.ts.map +0 -1
- package/dist/data/query-branch.d.ts.map +0 -1
- package/dist/data/table.d.ts +0 -24
- package/dist/data/table.d.ts.map +0 -1
- package/dist/data/virtual-list.d.ts +0 -133
- package/dist/data/virtual-list.d.ts.map +0 -1
- package/dist/data/virtual-list.js +0 -157
- package/dist/data/virtual.d.ts +0 -21
- package/dist/data/virtual.d.ts.map +0 -1
- package/dist/data/virtual.js +0 -4
- package/dist/forms/FormErrorSummary.d.ts +0 -30
- package/dist/forms/FormErrorSummary.d.ts.map +0 -1
- package/dist/forms/FormErrorSummary.js +0 -30
- package/dist/forms/use-field-array.d.ts +0 -60
- package/dist/forms/use-field-array.d.ts.map +0 -1
- package/dist/forms/use-field-array.js +0 -20
- package/dist/forms/use-form-draft.d.ts +0 -76
- package/dist/forms/use-form-draft.d.ts.map +0 -1
- package/dist/forms/use-form-draft.js +0 -92
- package/dist/forms/use-form-submit.d.ts +0 -88
- package/dist/forms/use-form-submit.d.ts.map +0 -1
- package/dist/forms/use-form-submit.js +0 -63
- package/dist/notifications/bell.d.ts.map +0 -1
- package/dist/notifications/center.d.ts.map +0 -1
- package/dist/notifications/define-notifications.d.ts.map +0 -1
- package/dist/notifications/index.d.ts +0 -40
- package/dist/notifications/index.d.ts.map +0 -1
- package/dist/notifications/index.js +0 -54
- package/dist/notifications/mount-guard.d.ts +0 -8
- package/dist/notifications/mount-guard.d.ts.map +0 -1
- package/dist/notifications/mount-guard.js +0 -18
- package/dist/notifications/notify.d.ts +0 -149
- package/dist/notifications/notify.d.ts.map +0 -1
- package/dist/notifications/notify.js +0 -171
- package/dist/notifications/store.d.ts.map +0 -1
- package/dist/provider/connectivity-indicator.d.ts +0 -13
- package/dist/provider/connectivity-indicator.d.ts.map +0 -1
- package/dist/provider/connectivity-indicator.js +0 -205
- package/dist/provider/connectivity-provider.d.ts +0 -7
- package/dist/provider/connectivity-provider.d.ts.map +0 -1
- package/dist/provider/connectivity-provider.js +0 -128
- package/dist/provider/connectivity-types.d.ts +0 -36
- package/dist/provider/connectivity-types.d.ts.map +0 -1
- package/dist/provider/use-connectivity.d.ts +0 -3
- package/dist/provider/use-connectivity.d.ts.map +0 -1
- package/dist/provider/use-connectivity.js +0 -14
- package/dist/query-devtools.d.ts +0 -21
- package/dist/query-devtools.d.ts.map +0 -1
- package/dist/query-devtools.js +0 -13
- package/src/agent/adapter.ts +0 -945
- package/src/agent/use-agent-stream.ts +0 -154
- package/src/agent-chat/index.ts +0 -54
- package/src/agent-chat/thread-detail-panel.tsx +0 -201
- package/src/agent-chat/thread-workspace.tsx +0 -279
- package/src/charts/cursor/resolve.ts +0 -198
- package/src/charts/cursor/scope.tsx +0 -35
- package/src/charts/cursor/store.ts +0 -58
- package/src/charts/cursor/touch-pin.ts +0 -138
- package/src/charts/hooks/use-discrete-cursor.ts +0 -335
- package/src/charts/hooks/use-hysteresis.ts +0 -26
- package/src/charts/hooks/useBandPlot.ts +0 -383
- package/src/charts/hooks/useChartCursor.ts +0 -367
- package/src/charts/hooks/useChartSize.ts +0 -35
- package/src/charts/kinds/BandStrip.tsx +0 -449
- package/src/charts/kinds/Bars.tsx +0 -589
- package/src/charts/kinds/Donut.tsx +0 -368
- package/src/charts/kinds/DualPanel.tsx +0 -712
- package/src/charts/kinds/Heatmap.tsx +0 -396
- package/src/charts/kinds/MirroredBars.tsx +0 -469
- package/src/charts/kinds/MultiLine.tsx +0 -322
- package/src/charts/kinds/StackedArea.tsx +0 -267
- package/src/charts/kinds/ZonedLine.tsx +0 -301
- package/src/charts/kinds/band-chrome.tsx +0 -91
- package/src/charts/kinds/donut-layout.ts +0 -82
- package/src/charts/layout/auto-margin.ts +0 -242
- package/src/charts/layout/end-labels.ts +0 -135
- package/src/charts/layout/log-ticks.ts +0 -90
- package/src/charts/primitives/AreaGradient.tsx +0 -26
- package/src/charts/primitives/Axes.tsx +0 -271
- package/src/charts/primitives/CartesianChart.tsx +0 -1002
- package/src/charts/primitives/ChartCard.tsx +0 -280
- package/src/charts/primitives/ChartFrame.tsx +0 -493
- package/src/charts/primitives/ChartLegend.tsx +0 -422
- package/src/charts/primitives/ChartPending.tsx +0 -243
- package/src/charts/primitives/ChartTooltip.tsx +0 -265
- package/src/charts/primitives/Crosshair.tsx +0 -43
- package/src/charts/primitives/HatchPattern.tsx +0 -55
- package/src/charts/primitives/HoverOverlay.module.css +0 -13
- package/src/charts/primitives/HoverOverlay.module.css.d.ts +0 -8
- package/src/charts/primitives/HoverOverlay.tsx +0 -109
- package/src/charts/primitives/XZoneRects.tsx +0 -132
- package/src/charts/primitives/ZoneRects.tsx +0 -67
- package/src/charts/primitives/chart-card-context.ts +0 -46
- package/src/charts/primitives/chart-frame-layout.ts +0 -430
- package/src/charts/primitives/chart-layout.ts +0 -318
- package/src/charts/primitives/chart-tier.tsx +0 -76
- package/src/charts/primitives/legend-disclosure.tsx +0 -178
- package/src/charts/series.ts +0 -276
- package/src/charts/sparklines/BarSparkline.tsx +0 -94
- package/src/charts/sparklines/LineSparkline.tsx +0 -71
- package/src/charts/sparklines/index.ts +0 -2
- package/src/charts/theme.tsx +0 -53
- package/src/charts/utils/domain.ts +0 -41
- package/src/charts/utils/format.ts +0 -19
- package/src/charts/utils/measure-text.ts +0 -109
- package/src/charts/utils/ticks.ts +0 -239
- package/src/commands/overlays-mount.tsx +0 -333
- package/src/commands/useCommandHotkeys.ts +0 -114
- package/src/content/article-actions.ts +0 -72
- package/src/content/article-card.module.css +0 -111
- package/src/content/article-card.tsx +0 -174
- package/src/content/mdx.tsx +0 -127
- package/src/controls/compare-filter.tsx +0 -81
- package/src/controls/slider-control.tsx +0 -159
- package/src/dashboard/widget-grid.module.css +0 -69
- package/src/dashboard/widget-grid.tsx +0 -146
- package/src/data/table.ts +0 -39
- package/src/data/virtual-list.tsx +0 -356
- package/src/data/virtual.ts +0 -26
- package/src/forms/FormErrorSummary.tsx +0 -71
- package/src/forms/use-field-array.ts +0 -94
- package/src/forms/use-form-draft.ts +0 -262
- package/src/forms/use-form-submit.ts +0 -199
- package/src/notifications/index.ts +0 -88
- package/src/notifications/mount-guard.ts +0 -38
- package/src/notifications/notify.tsx +0 -379
- package/src/provider/connectivity-indicator.tsx +0 -267
- package/src/provider/connectivity-provider.tsx +0 -189
- package/src/provider/connectivity-types.ts +0 -42
- package/src/provider/use-connectivity.ts +0 -26
- package/src/query-devtools.tsx +0 -40
- /package/dist/{agent-chat → agent/chat}/message-affordances.js +0 -0
- /package/dist/{agent-chat → agent/chat}/relative-time.d.ts +0 -0
- /package/dist/{agent-chat → agent/chat}/relative-time.js +0 -0
- /package/dist/{agent-chat → agent/chat}/use-keyboard-inset.d.ts +0 -0
- /package/dist/{agent-chat → agent/chat}/virtualize.js +0 -0
- /package/dist/{notifications → commands/notifications}/bell.js +0 -0
- /package/dist/{notifications → commands/notifications}/define-notifications.js +0 -0
- /package/dist/{provider/connectivity-types.js → controls/uncontrolled.js} +0 -0
- /package/dist/{data → table}/data-table.module.css +0 -0
- /package/dist/{data → table}/data-table.module.css.d.ts +0 -0
- /package/dist/{data → table}/query-branch.d.ts +0 -0
- /package/dist/{data → table}/query-branch.js +0 -0
- /package/src/{agent-chat → agent/chat}/relative-time.ts +0 -0
- /package/src/{data → table}/data-table.module.css +0 -0
- /package/src/{data → table}/data-table.module.css.d.ts +0 -0
- /package/src/{data → table}/query-branch.ts +0 -0
package/src/commands/index.ts
CHANGED
|
@@ -1,107 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ./commands — command bus, overlay controller,
|
|
3
|
-
* live keybindings, and composable overlay mount for basalt-ui apps.
|
|
2
|
+
* ./commands — the command bus, overlay controller, shortcuts help and the notification registry.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Install with: bun add @mantine/modals @mantine/spotlight @mantine/notifications @tanstack/react-hotkeys
|
|
9
|
-
* Also import the Spotlight styles in main.tsx (the layered bundle — the unlayered one outranks
|
|
10
|
-
* basalt's `@layer basalt` styles regardless of specificity): import '@mantine/spotlight/styles.layer.css'
|
|
4
|
+
* `BasaltProvider` mounts modals, Spotlight, hotkeys and notifications; this barrel is only what
|
|
5
|
+
* an app declares and calls.
|
|
11
6
|
*
|
|
12
7
|
* @example
|
|
13
|
-
*
|
|
14
|
-
* import { defineCommands } from 'basalt-ui/commands'
|
|
8
|
+
* import { defineCommands, defineNotifications, emit } from 'basalt-ui/commands'
|
|
15
9
|
* export const COMMANDS = defineCommands({
|
|
16
10
|
* 'file:save': { label: 'Save', group: 'File', shortcut: 'Mod+S', run: () => save() },
|
|
17
11
|
* })
|
|
18
12
|
* declare module 'basalt-ui' {
|
|
19
13
|
* interface BasaltRegister { commands: typeof COMMANDS }
|
|
20
14
|
* }
|
|
21
|
-
*
|
|
22
|
-
* // main.tsx — mount composable overlays:
|
|
23
|
-
* import { BasaltOverlays } from 'basalt-ui/commands'
|
|
24
|
-
* import '@mantine/spotlight/styles.layer.css'
|
|
25
|
-
* <BasaltProvider><BasaltOverlays><App /></BasaltOverlays></BasaltProvider>
|
|
26
|
-
*
|
|
27
|
-
* // usage.ts — run a command:
|
|
28
|
-
* import { runCommand } from 'basalt-ui/commands'
|
|
29
|
-
* runCommand('file:save')
|
|
30
|
-
*
|
|
31
|
-
* // usage.ts — the registry-free confirm dialog:
|
|
32
|
-
* import { overlays } from 'basalt-ui/commands'
|
|
33
|
-
* const ok = await overlays.confirm({ title: 'Discard draft?', onConfirm: () => reset() })
|
|
34
|
-
* overlays.confirmDelete({ subject: 'item', count: 3, onConfirm: () => removeSelected() })
|
|
35
|
-
*
|
|
36
|
-
* // Mounting ModalsProvider yourself instead of letting <BasaltOverlays> do it:
|
|
37
|
-
* import { registerModalsProvider } from 'basalt-ui/commands'
|
|
38
|
-
* useEffect(() => registerModalsProvider(), [])
|
|
39
|
-
*
|
|
40
|
-
* // Open/close Spotlight programmatically:
|
|
41
|
-
* import { openSpotlight, closeSpotlight } from 'basalt-ui/commands'
|
|
42
|
-
* openSpotlight()
|
|
43
15
|
*/
|
|
44
16
|
|
|
45
|
-
|
|
46
|
-
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
runCommand,
|
|
50
|
-
type Command,
|
|
51
|
-
type CommandMap,
|
|
52
|
-
type CommandId,
|
|
53
|
-
type CommandRunContext,
|
|
54
|
-
} from './define-commands'
|
|
55
|
-
|
|
56
|
-
// ── defineOverlays + defineOverlay + overlays controller ─────────────────────
|
|
57
|
-
export {
|
|
58
|
-
defineOverlays,
|
|
59
|
-
defineOverlay,
|
|
60
|
-
overlays,
|
|
61
|
-
registerModalsProvider,
|
|
62
|
-
type Overlay,
|
|
63
|
-
type OverlayMap,
|
|
64
|
-
type OverlayKey,
|
|
65
|
-
type ConfirmOptions,
|
|
66
|
-
type ConfirmDeleteOptions,
|
|
67
|
-
} from './define-overlays'
|
|
68
|
-
|
|
69
|
-
// ── Projectors ────────────────────────────────────────────────────────────────
|
|
70
|
-
export {
|
|
71
|
-
toSpotlightActions,
|
|
72
|
-
toRouteActions,
|
|
73
|
-
toShortcutList,
|
|
74
|
-
toHotkeyBindings,
|
|
75
|
-
type RouteActionItem,
|
|
76
|
-
type RouteActionSection,
|
|
77
|
-
type ToRouteActionsOptions,
|
|
78
|
-
type ShortcutEntry,
|
|
79
|
-
type HotkeyBinding,
|
|
80
|
-
} from './projectors'
|
|
81
|
-
|
|
82
|
-
// ── Imperative shell handles (setColorScheme/toggleSidebar) ──────────────────
|
|
83
|
-
export {
|
|
84
|
-
setColorScheme,
|
|
85
|
-
toggleSidebar,
|
|
86
|
-
type ColorScheme,
|
|
87
|
-
type ColorSchemeSetter,
|
|
88
|
-
type SidebarToggle,
|
|
89
|
-
} from './shell-bridge'
|
|
90
|
-
|
|
91
|
-
// ── Shortcut format utils ─────────────────────────────────────────────────────
|
|
92
|
-
export { parseShortcut, detectMac, formatShortcutDisplay } from './shortcut-format'
|
|
93
|
-
|
|
94
|
-
// ── useCommandHotkeys hook ────────────────────────────────────────────────────
|
|
95
|
-
export { useCommandHotkeys } from './useCommandHotkeys'
|
|
96
|
-
|
|
97
|
-
// ── ShortcutsHelp ─────────────────────────────────────────────────────────────
|
|
98
|
-
export { ShortcutsHelp, type ShortcutsHelpProps } from './ShortcutsHelp'
|
|
17
|
+
export { defineCommands, type Command } from './define-commands'
|
|
18
|
+
export { defineOverlays, overlays } from './define-overlays'
|
|
19
|
+
export { setColorScheme, toggleSidebar } from './shell-bridge'
|
|
20
|
+
export { ShortcutsHelp } from './ShortcutsHelp'
|
|
99
21
|
|
|
100
|
-
// ──
|
|
101
|
-
export {
|
|
102
|
-
|
|
103
|
-
type BasaltOverlaysProps,
|
|
104
|
-
basaltSpotlight,
|
|
105
|
-
openSpotlight,
|
|
106
|
-
closeSpotlight,
|
|
107
|
-
} from './overlays-mount'
|
|
22
|
+
// ── Notifications (folded in from `./notifications`) ──────────────────────────
|
|
23
|
+
export { defineNotifications, emit } from './notifications/define-notifications'
|
|
24
|
+
export { NotificationBell } from './notifications/bell'
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* marked read when interacted with inside the center.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
* import { NotificationBell } from 'basalt-ui/
|
|
10
|
+
* import { NotificationBell } from 'basalt-ui/commands'
|
|
11
11
|
*
|
|
12
12
|
* // In the shell's globalActions prop:
|
|
13
13
|
* <BasaltShell
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { ActionIcon, Indicator, Popover } from '@mantine/core'
|
|
19
19
|
import { useDisclosure } from '@mantine/hooks'
|
|
20
20
|
import { useRef } from 'react'
|
|
21
|
-
import type { BasaltProps } from '
|
|
21
|
+
import type { BasaltProps } from '../../common/props'
|
|
22
22
|
import { useNotificationHistory } from './store'
|
|
23
23
|
import { NOTIFICATION_POPOVER_WIDTH, NotificationCenter } from './center'
|
|
24
24
|
|
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
* removed outright. Actionable items render a button resolved from the notifications registry, so a
|
|
10
10
|
* notification can navigate or open a modal even after a reload. Consumes useNotificationHistory.
|
|
11
11
|
*
|
|
12
|
+
* Internal: `NotificationBell` mounts it; `basalt-ui/commands` does not export it.
|
|
13
|
+
*
|
|
12
14
|
* @example
|
|
13
|
-
* import { NotificationCenter } from '
|
|
15
|
+
* import { NotificationCenter } from './center'
|
|
14
16
|
* <NotificationCenter />
|
|
15
17
|
*/
|
|
16
18
|
import { useState } from 'react'
|
|
@@ -25,9 +27,9 @@ import {
|
|
|
25
27
|
Stack,
|
|
26
28
|
Text,
|
|
27
29
|
} from '@mantine/core'
|
|
28
|
-
import type { BasaltProps } from '
|
|
29
|
-
import { cx } from '
|
|
30
|
-
import { VX } from '
|
|
30
|
+
import type { BasaltProps } from '../../common/props'
|
|
31
|
+
import { cx } from '../../common/props'
|
|
32
|
+
import { VX } from '../../tokens'
|
|
31
33
|
import { resolveAction } from './define-notifications'
|
|
32
34
|
import { useNotificationHistory } from './store'
|
|
33
35
|
import type { NotificationHistoryItem, NotificationIntent } from './store'
|
|
@@ -174,7 +176,7 @@ export type NotificationCenterProps = BasaltProps & {
|
|
|
174
176
|
* its own container.
|
|
175
177
|
*
|
|
176
178
|
* @example
|
|
177
|
-
* import { NOTIFICATION_POPOVER_WIDTH, NotificationCenter } from '
|
|
179
|
+
* import { NOTIFICATION_POPOVER_WIDTH, NotificationCenter } from './center'
|
|
178
180
|
*
|
|
179
181
|
* <Popover width={NOTIFICATION_POPOVER_WIDTH}>
|
|
180
182
|
* <Popover.Dropdown>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* // notifications.ts (app-side)
|
|
15
|
-
* import { defineNotifications } from 'basalt-ui/
|
|
15
|
+
* import { defineNotifications } from 'basalt-ui/commands'
|
|
16
16
|
* export const NOTIFICATIONS = defineNotifications({
|
|
17
17
|
* 'upload:success': { intent: 'success', toMessage: (p: { name: string }) => `Uploaded ${p.name}` },
|
|
18
18
|
* 'upload:error': { intent: 'error', toMessage: (_: unknown) => 'Upload failed' },
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
* }
|
|
23
23
|
*
|
|
24
24
|
* // usage.ts
|
|
25
|
-
* import { emit } from 'basalt-ui/
|
|
25
|
+
* import { emit } from 'basalt-ui/commands'
|
|
26
26
|
* emit('upload:success', { name: 'photo.jpg' }) // ✓ typed, and the payload shape is checked
|
|
27
27
|
* emit('upload:success', 'nope') // ✗ tsc error — wrong payload shape
|
|
28
28
|
* emit('nonexistent', {}) // ✗ tsc error — unregistered kind
|
|
29
29
|
*/
|
|
30
30
|
import type { ReactNode } from 'react'
|
|
31
|
-
import type { Slot } from '
|
|
31
|
+
import type { Slot } from '../../register'
|
|
32
32
|
import { notify } from './notify'
|
|
33
33
|
import type { NotifyOptions, NotificationIntent } from './notify'
|
|
34
34
|
import type { NotificationActionRef } from './store'
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* notify — core toast helper wrapping @mantine/notifications.
|
|
3
|
+
*
|
|
4
|
+
* Maps intent → Mantine color name, sets per-intent aria role and autoClose defaults,
|
|
5
|
+
* records every toast into the module-level history store, and applies two-layer dedup:
|
|
6
|
+
* 1. Mantine id-dedup (passing the same id to notifications.show is a no-op on screen)
|
|
7
|
+
* 2. dedupKey window — module-level Map prevents duplicate keys within 1500ms
|
|
8
|
+
*
|
|
9
|
+
* Internal: consumers reach it through `emit` (`defineNotifications`).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* notify({ intent: 'success', message: 'Saved' })
|
|
13
|
+
* notify({ intent: 'error', message: 'Failed', title: 'Upload error', autoClose: false })
|
|
14
|
+
*/
|
|
15
|
+
import type { ReactNode } from 'react'
|
|
16
|
+
import { notifications } from '@mantine/notifications'
|
|
17
|
+
import { add, has } from './store'
|
|
18
|
+
import type { NotificationIntent, NotificationActionRef } from './store'
|
|
19
|
+
|
|
20
|
+
export type { NotificationIntent }
|
|
21
|
+
|
|
22
|
+
// ── Intent → Mantine color + defaults ────────────────────────────────────────
|
|
23
|
+
|
|
24
|
+
const INTENT_COLOR: Record<NotificationIntent, string> = {
|
|
25
|
+
success: 'green',
|
|
26
|
+
error: 'red',
|
|
27
|
+
warning: 'yellow',
|
|
28
|
+
info: 'blue',
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Aria role per intent.
|
|
33
|
+
* 'alert' = assertive (error/warning: must be announced immediately)
|
|
34
|
+
* 'status' = polite (success/info: waits for a natural pause)
|
|
35
|
+
*/
|
|
36
|
+
const INTENT_ROLE: Record<NotificationIntent, 'alert' | 'status'> = {
|
|
37
|
+
error: 'alert',
|
|
38
|
+
warning: 'alert',
|
|
39
|
+
success: 'status',
|
|
40
|
+
info: 'status',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Per-intent default autoClose (ms). false = until-dismissed. */
|
|
44
|
+
const INTENT_AUTO_CLOSE: Record<NotificationIntent, number | false> = {
|
|
45
|
+
success: 2000,
|
|
46
|
+
info: 3000,
|
|
47
|
+
warning: 5000,
|
|
48
|
+
error: false,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ── Two-layer dedup — dedupKey window ────────────────────────────────────────
|
|
52
|
+
|
|
53
|
+
const DEDUP_WINDOW_MS = 1500
|
|
54
|
+
/** dedupKey → when it was recorded, and the id that recording returned. */
|
|
55
|
+
const dedupKeyTimestamps = new Map<string, { at: number; id: string }>()
|
|
56
|
+
|
|
57
|
+
/** Drop entries past the window, so a long-lived page with many distinct keys never grows the map. */
|
|
58
|
+
function pruneDedupKeys(now: number): void {
|
|
59
|
+
for (const [key, { at }] of dedupKeyTimestamps) {
|
|
60
|
+
if (now - at >= DEDUP_WINDOW_MS) dedupKeyTimestamps.delete(key)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The id recorded for `dedupKey` inside the window, or `undefined` when this call is a first. */
|
|
65
|
+
function recentIdForKey(dedupKey: string): string | undefined {
|
|
66
|
+
const last = dedupKeyTimestamps.get(dedupKey)
|
|
67
|
+
if (last === undefined || Date.now() - last.at >= DEDUP_WINDOW_MS) return undefined
|
|
68
|
+
return last.id
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ── ID generation ─────────────────────────────────────────────────────────────
|
|
72
|
+
|
|
73
|
+
let seq = 0
|
|
74
|
+
function nextId(): string {
|
|
75
|
+
return `basalt-${Date.now()}-${++seq}`
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** History stores serializable text: a string or number survives, any other node is dropped. */
|
|
79
|
+
function historyText(node: ReactNode): string | undefined {
|
|
80
|
+
if (typeof node === 'string') return node
|
|
81
|
+
if (typeof node === 'number') return String(node)
|
|
82
|
+
return undefined
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ── NotifyOptions ─────────────────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
export type NotifyOptions = {
|
|
88
|
+
intent?: NotificationIntent
|
|
89
|
+
message: ReactNode
|
|
90
|
+
title?: ReactNode
|
|
91
|
+
icon?: ReactNode
|
|
92
|
+
autoClose?: number | false
|
|
93
|
+
id?: string
|
|
94
|
+
dedupKey?: string
|
|
95
|
+
/**
|
|
96
|
+
* A serializable action ref — gives the recorded item an action button in the notification
|
|
97
|
+
* center. Usually attached automatically by `emit()` from the kind's spec; pass it directly
|
|
98
|
+
* only when calling `notify()` for an action registered in the notifications registry.
|
|
99
|
+
*/
|
|
100
|
+
action?: NotificationActionRef
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ── notify ────────────────────────────────────────────────────────────────────
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Show a toast and record it to the notification history. Only string / number `message` and
|
|
107
|
+
* `title` are recorded; any other node shows in the toast but the history keeps `''` (message) or
|
|
108
|
+
* no title.
|
|
109
|
+
* Returns the notification id (string).
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* const id = notify({ intent: 'success', message: 'Profile saved', title: 'Success' })
|
|
113
|
+
* const id = notify({ intent: 'error', message: <b>Failed</b>, autoClose: false })
|
|
114
|
+
*/
|
|
115
|
+
export function notify(opts: NotifyOptions): string {
|
|
116
|
+
const { intent = 'info', message, title, icon, autoClose, id, dedupKey, action } = opts
|
|
117
|
+
|
|
118
|
+
// Two-layer dedup: dedupKey window guard — a hit returns the id the first call recorded.
|
|
119
|
+
if (dedupKey !== undefined) {
|
|
120
|
+
const recorded = recentIdForKey(dedupKey)
|
|
121
|
+
if (recorded !== undefined) return recorded
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const resolvedId = id ?? nextId()
|
|
125
|
+
if (dedupKey !== undefined) {
|
|
126
|
+
pruneDedupKeys(Date.now())
|
|
127
|
+
dedupKeyTimestamps.set(dedupKey, { at: Date.now(), id: resolvedId })
|
|
128
|
+
}
|
|
129
|
+
const color = INTENT_COLOR[intent]
|
|
130
|
+
const role = INTENT_ROLE[intent]
|
|
131
|
+
const resolvedAutoClose = autoClose !== undefined ? autoClose : INTENT_AUTO_CLOSE[intent]
|
|
132
|
+
|
|
133
|
+
notifications.show({
|
|
134
|
+
id: resolvedId,
|
|
135
|
+
message,
|
|
136
|
+
title: title ?? undefined,
|
|
137
|
+
color,
|
|
138
|
+
icon: icon ?? undefined,
|
|
139
|
+
autoClose: resolvedAutoClose,
|
|
140
|
+
role,
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
// An explicit id already in the history is the same notification re-shown: Mantine updates it on
|
|
144
|
+
// screen, and the history keeps its one record.
|
|
145
|
+
if (id !== undefined && has(id)) return resolvedId
|
|
146
|
+
|
|
147
|
+
const titleText = historyText(title)
|
|
148
|
+
add({
|
|
149
|
+
id: resolvedId,
|
|
150
|
+
intent,
|
|
151
|
+
...(titleText !== undefined && { title: titleText }),
|
|
152
|
+
message: historyText(message) ?? '',
|
|
153
|
+
createdAt: Date.now(),
|
|
154
|
+
...(action !== undefined && { action }),
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
return resolvedId
|
|
158
|
+
}
|
|
@@ -8,13 +8,16 @@
|
|
|
8
8
|
* Module-level add/markRead/markAllRead/clear are callable from notify() (not hook-scoped), and
|
|
9
9
|
* useNotificationHistory() exposes the reactive slice to components.
|
|
10
10
|
*
|
|
11
|
+
* Internal: `basalt-ui/commands` publishes only `NotificationBell`, `defineNotifications` and `emit`;
|
|
12
|
+
* everything here is reached through them.
|
|
13
|
+
*
|
|
11
14
|
* @example
|
|
12
15
|
* // Module-level (non-React):
|
|
13
|
-
* import { add, markRead, markAllRead, clear } from '
|
|
16
|
+
* import { add, markRead, markAllRead, clear } from './store'
|
|
14
17
|
* add({ id: 'x', intent: 'success', message: 'Done', createdAt: Date.now() })
|
|
15
18
|
*
|
|
16
19
|
* // React:
|
|
17
|
-
* import { useNotificationHistory } from '
|
|
20
|
+
* import { useNotificationHistory } from './store'
|
|
18
21
|
* const { items, unreadCount, markRead, markAllRead, clear } = useNotificationHistory()
|
|
19
22
|
*/
|
|
20
23
|
import { useSyncExternalStore } from 'react'
|
|
@@ -153,6 +156,11 @@ if (typeof window !== 'undefined') {
|
|
|
153
156
|
|
|
154
157
|
// ── Module-level public API ───────────────────────────────────────────────────
|
|
155
158
|
|
|
159
|
+
/** Whether the history already holds an item with this id. */
|
|
160
|
+
export function has(id: string): boolean {
|
|
161
|
+
return state.some((item) => item.id === id)
|
|
162
|
+
}
|
|
163
|
+
|
|
156
164
|
/**
|
|
157
165
|
* Add a notification to the history store (ring-buffer capped at 50).
|
|
158
166
|
* Called by notify() — safe to call outside React.
|
|
@@ -1,183 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* projectors — project the active command registry into
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* All functions read the runtime stash (populated by defineCommands) — they do NOT read the
|
|
6
|
-
* type-erased BasaltRegister slot. They are safe to call before any commands are registered
|
|
7
|
-
* (returns empty array).
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* // In BasaltOverlays, pass toSpotlightActions() to Spotlight:
|
|
11
|
-
* <Spotlight store={basaltSpotlight[0]} actions={toSpotlightActions()} shortcut="mod + K" />
|
|
12
|
-
*
|
|
13
|
-
* // Render a shortcut reference list:
|
|
14
|
-
* const shortcuts = toShortcutList() // [{ id, label, shortcut, group? }, ...]
|
|
15
|
-
*
|
|
16
|
-
* // Opt-in: drive your own useHotkeys() call (useCommandHotkeys uses the imperative manager API instead):
|
|
17
|
-
* const bindings = toHotkeyBindings()
|
|
18
|
-
* useHotkeys(bindings)
|
|
19
|
-
*/
|
|
20
|
-
import type { SpotlightActionData } from '@mantine/spotlight'
|
|
21
|
-
import type { ReactNode } from 'react'
|
|
22
|
-
import { getActiveCommands, runCommand } from './define-commands'
|
|
23
|
-
import type { CommandId } from './define-commands'
|
|
24
|
-
import { formatShortcutDisplay, detectMac } from './shortcut-format'
|
|
25
|
-
|
|
26
|
-
// ── UseHotkeyDefinition (re-typed locally to avoid peer import at module level) ──
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Shape of a single entry in the array passed to useHotkeys().
|
|
30
|
-
* Mirrors UseHotkeyDefinition from @tanstack/react-hotkeys — typed locally so
|
|
31
|
-
* projectors.ts has no hard import on the optional peer.
|
|
32
|
-
*/
|
|
33
|
-
export type HotkeyBinding = {
|
|
34
|
-
hotkey: string
|
|
35
|
-
/**
|
|
36
|
-
* Callback invoked when the hotkey fires. Widened to match @tanstack/react-hotkeys'
|
|
37
|
-
* HotkeyCallback signature — `(event: KeyboardEvent, context?: unknown) => void` — so
|
|
38
|
-
* consumers can pass toHotkeyBindings() directly to useHotkeys() without a tsc error.
|
|
39
|
-
* The implementations produced by toHotkeyBindings() only use the zero-arg form internally.
|
|
40
|
-
*/
|
|
41
|
-
callback: (event: KeyboardEvent, context?: unknown) => void
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// ── toSpotlightActions ────────────────────────────────────────────────────────
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Project the active command registry into a Mantine Spotlight `SpotlightActionData[]` array.
|
|
48
|
-
* Commands where `when()` returns false are excluded from the list.
|
|
49
|
-
*
|
|
50
|
-
* Reads a one-time snapshot of the runtime command stash at call time — commands registered AFTER
|
|
51
|
-
* this is called (lazy/code-split) won't appear. Register all commands at module load before
|
|
52
|
-
* mounting <BasaltOverlays>.
|
|
53
|
-
*
|
|
54
|
-
* When onTrigger is provided it is called INSTEAD OF runCommand (put runCommand(id) inside your
|
|
55
|
-
* onTrigger if you want it to fire); without onTrigger, runCommand(id) fires directly.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* // Close the palette then run the command:
|
|
59
|
-
* const actions = toSpotlightActions((id) => { spotlight.close(); runCommand(id) })
|
|
60
|
-
*
|
|
61
|
-
* // Default: just runs the command directly
|
|
62
|
-
* const actions = toSpotlightActions()
|
|
63
|
-
*/
|
|
64
|
-
export function toSpotlightActions(onTrigger?: (id: CommandId) => void): SpotlightActionData[] {
|
|
65
|
-
const cmds = getActiveCommands()
|
|
66
|
-
const actions: SpotlightActionData[] = []
|
|
67
|
-
|
|
68
|
-
for (const [id, cmd] of Object.entries(cmds)) {
|
|
69
|
-
// Skip commands gated behind a false when() predicate
|
|
70
|
-
if (cmd.when !== undefined && !cmd.when()) continue
|
|
71
|
-
|
|
72
|
-
const action: SpotlightActionData = {
|
|
73
|
-
id,
|
|
74
|
-
label: cmd.label,
|
|
75
|
-
leftSection: cmd.icon,
|
|
76
|
-
keywords: [cmd.group ?? '', id].join(' ').trim(),
|
|
77
|
-
onClick: () => {
|
|
78
|
-
// id is the actual stash key (string from Object.entries), narrowed to CommandId for the typed callback
|
|
79
|
-
if (onTrigger !== undefined) {
|
|
80
|
-
onTrigger(id as CommandId)
|
|
81
|
-
} else {
|
|
82
|
-
runCommand(id as CommandId)
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
}
|
|
86
|
-
if (cmd.shortcut !== undefined) {
|
|
87
|
-
// detectMac() is SSR-safe (returns false when navigator is unavailable)
|
|
88
|
-
action.description = formatShortcutDisplay(cmd.shortcut, detectMac())
|
|
89
|
-
}
|
|
90
|
-
if (cmd.group !== undefined) action.group = cmd.group
|
|
91
|
-
actions.push(action)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return actions
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// ── toRouteActions ────────────────────────────────────────────────────────────
|
|
98
|
-
|
|
99
|
-
export type RouteActionItem = {
|
|
100
|
-
label: string
|
|
101
|
-
href?: string
|
|
102
|
-
icon?: ReactNode
|
|
103
|
-
disabled?: boolean
|
|
104
|
-
children?: RouteActionItem[]
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export type RouteActionSection = {
|
|
108
|
-
/** Section label — the root segment of each item's breadcrumb-trail label. */
|
|
109
|
-
label: string
|
|
110
|
-
/** Section icon — inherited as the leftSection by items/children that have no icon of their own. */
|
|
111
|
-
icon?: ReactNode
|
|
112
|
-
items: RouteActionItem[]
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export type ToRouteActionsOptions = {
|
|
116
|
-
/** Navigate to a route href — e.g. `(href) => router.navigate({ to: href })`. */
|
|
117
|
-
onNavigate: (href: string) => void
|
|
118
|
-
/** Prefix for generated action ids so they never collide with command ids. Default 'route:'. */
|
|
119
|
-
idPrefix?: string
|
|
120
|
-
/**
|
|
121
|
-
* Spotlight group for every produced action (e.g. 'Pages'). Omit for an ungrouped, flat list.
|
|
122
|
-
* Unlike the nav section (which becomes part of the breadcrumb label), this is a single kind
|
|
123
|
-
* bucket across all routes.
|
|
124
|
-
*/
|
|
125
|
-
group?: string
|
|
126
|
-
/** Separator between breadcrumb segments in the action label. Default ' › '. */
|
|
127
|
-
separator?: string
|
|
128
|
-
/**
|
|
129
|
-
* Node rendered on the right of every action — e.g. a kind badge (`<Badge>Page</Badge>`). Lets
|
|
130
|
-
* the palette distinguish pages from commands at a glance regardless of grouping.
|
|
131
|
-
*/
|
|
132
|
-
rightSection?: ReactNode
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Project a nav model (sections → items → nested children) into Mantine Spotlight
|
|
137
|
-
* page-navigation actions. Pass the result to <BasaltOverlays spotlightActions={…}> so the palette
|
|
138
|
-
* lists Pages alongside Commands.
|
|
139
|
-
*
|
|
140
|
-
* Each action's label is the full breadcrumb trail from the section down to the item
|
|
141
|
-
* (e.g. `Overview › Dashboard › Sessions`), so a result is self-describing. Disabled items and
|
|
142
|
-
* items without an href are skipped. An item/child without its own icon inherits the nearest
|
|
143
|
-
* ancestor's (section → parent item), so sub-routes carry the parent's icon in the palette while
|
|
144
|
-
* staying icon-less in a sidebar that renders them against a rail. Optionally assign one `group`
|
|
145
|
-
* (a kind bucket like 'Pages') and a `rightSection` (a kind badge) to every action. Reads a static
|
|
146
|
-
* snapshot — routes are static, so build it once.
|
|
147
|
-
*
|
|
148
|
-
* Structurally compatible with the shell's SidebarSection[] — pass your existing nav model directly.
|
|
2
|
+
* projectors — project the active command registry into the shortcut reference list that
|
|
3
|
+
* `ShortcutsHelp` renders. Reads the runtime stash (populated by `defineCommands`), not the
|
|
4
|
+
* type-erased `BasaltRegister` slot; safe to call before any commands are registered.
|
|
149
5
|
*/
|
|
150
|
-
|
|
151
|
-
sections: RouteActionSection[],
|
|
152
|
-
options: ToRouteActionsOptions,
|
|
153
|
-
): SpotlightActionData[] {
|
|
154
|
-
const { onNavigate, idPrefix = 'route:', separator = ' › ', group, rightSection } = options
|
|
155
|
-
const actions: SpotlightActionData[] = []
|
|
156
|
-
|
|
157
|
-
const walk = (items: RouteActionItem[], trail: string[], inheritedIcon?: ReactNode): void => {
|
|
158
|
-
for (const item of items) {
|
|
159
|
-
const itemTrail = [...trail, item.label]
|
|
160
|
-
const icon = item.icon ?? inheritedIcon
|
|
161
|
-
if (!item.disabled && item.href !== undefined) {
|
|
162
|
-
const href = item.href
|
|
163
|
-
const action: SpotlightActionData = {
|
|
164
|
-
id: `${idPrefix}${href}`,
|
|
165
|
-
label: itemTrail.join(separator),
|
|
166
|
-
leftSection: icon,
|
|
167
|
-
keywords: [...itemTrail, href].join(' '),
|
|
168
|
-
onClick: () => onNavigate(href),
|
|
169
|
-
}
|
|
170
|
-
if (group !== undefined) action.group = group
|
|
171
|
-
if (rightSection !== undefined) action.rightSection = rightSection
|
|
172
|
-
actions.push(action)
|
|
173
|
-
}
|
|
174
|
-
if (item.children !== undefined) walk(item.children, itemTrail, icon)
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
for (const section of sections) walk(section.items, [section.label], section.icon)
|
|
179
|
-
return actions
|
|
180
|
-
}
|
|
6
|
+
import { getActiveCommands } from './define-commands'
|
|
181
7
|
|
|
182
8
|
// ── ShortcutEntry ─────────────────────────────────────────────────────────────
|
|
183
9
|
|
|
@@ -198,7 +24,7 @@ export type ShortcutEntry = {
|
|
|
198
24
|
*
|
|
199
25
|
* Reads a one-time snapshot of the runtime command stash at call time — commands registered AFTER
|
|
200
26
|
* this is called (lazy/code-split) won't appear. Register all commands at module load before
|
|
201
|
-
*
|
|
27
|
+
* rendering `ShortcutsHelp`.
|
|
202
28
|
*
|
|
203
29
|
* @example
|
|
204
30
|
* const shortcuts = toShortcutList()
|
|
@@ -219,49 +45,3 @@ export function toShortcutList(): ShortcutEntry[] {
|
|
|
219
45
|
|
|
220
46
|
return result
|
|
221
47
|
}
|
|
222
|
-
|
|
223
|
-
// ── toHotkeyBindings ──────────────────────────────────────────────────────────
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Project the active command registry into a `UseHotkeyDefinition[]` bindings array — the exact
|
|
227
|
-
* shape accepted by `useHotkeys` from `@tanstack/react-hotkeys`.
|
|
228
|
-
*
|
|
229
|
-
* Commands without a `shortcut` field are skipped. Commands where `when()` returns false are
|
|
230
|
-
* included in the bindings but their callback is a no-op (the command is gated at call time, not
|
|
231
|
-
* at registration time — this avoids hook-count churn when `when()` toggles).
|
|
232
|
-
*
|
|
233
|
-
* Reads a one-time snapshot of the runtime command stash.
|
|
234
|
-
*
|
|
235
|
-
* NOTE: the built-in useCommandHotkeys() does NOT call this function. It uses the imperative
|
|
236
|
-
* getHotkeyManager() API from @tanstack/react-hotkeys directly (register/unregister per
|
|
237
|
-
* mount/unmount cycle). toHotkeyBindings() is an opt-in convenience projector for consumers
|
|
238
|
-
* who want to drive their own useHotkeys([...]) call — it is not on the path that
|
|
239
|
-
* useCommandHotkeys() takes.
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* import { useHotkeys } from '@tanstack/react-hotkeys'
|
|
243
|
-
* import { toHotkeyBindings } from 'basalt-ui/commands'
|
|
244
|
-
*
|
|
245
|
-
* function MyHotkeys() {
|
|
246
|
-
* useHotkeys(toHotkeyBindings())
|
|
247
|
-
* }
|
|
248
|
-
*/
|
|
249
|
-
export function toHotkeyBindings(): HotkeyBinding[] {
|
|
250
|
-
const cmds = getActiveCommands()
|
|
251
|
-
const bindings: HotkeyBinding[] = []
|
|
252
|
-
|
|
253
|
-
for (const [id, cmd] of Object.entries(cmds)) {
|
|
254
|
-
if (cmd.shortcut === undefined) continue
|
|
255
|
-
|
|
256
|
-
bindings.push({
|
|
257
|
-
hotkey: cmd.shortcut,
|
|
258
|
-
callback: () => {
|
|
259
|
-
// Respect the when() gate at execution time (not registration time)
|
|
260
|
-
if (cmd.when !== undefined && !cmd.when()) return
|
|
261
|
-
void runCommand(id as CommandId)
|
|
262
|
-
},
|
|
263
|
-
})
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return bindings
|
|
267
|
-
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* basalt registers BOTH setters itself — `BasaltProvider` calls {@link registerColorSchemeSetter}
|
|
17
17
|
* from inside `MantineProvider` (`provider/index.tsx`'s `BasaltBridge`), `BasaltShell` calls
|
|
18
|
-
* {@link registerSidebarToggle} (`shell/index.tsx`'s `
|
|
18
|
+
* {@link registerSidebarToggle} (`shell/index.tsx`'s `ShellBody`) — so a consumer's own
|
|
19
19
|
* `commands.tsx` needs no `__root.tsx` wiring at all, unlike argo's hand-rolled version: mount
|
|
20
20
|
* `BasaltProvider`/`BasaltShell` once, and `setColorScheme`/`toggleSidebar` just work.
|
|
21
21
|
*
|
|
@@ -50,8 +50,8 @@ export function registerSidebarToggle(toggle: SidebarToggle | null): void {
|
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Set the color scheme from outside the React tree. A no-op (with a dev-only console warning)
|
|
53
|
-
* when no `BasaltProvider` is mounted yet — the same "not wired" shape
|
|
54
|
-
* `overlays.open` already
|
|
53
|
+
* when no `BasaltProvider` is mounted yet — the same "not wired" shape
|
|
54
|
+
* `overlays.open` already uses for an unregistered id.
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
57
|
* setColorScheme('dark')
|
|
@@ -59,7 +59,7 @@ export function registerSidebarToggle(toggle: SidebarToggle | null): void {
|
|
|
59
59
|
export function setColorScheme(scheme: ColorScheme): void {
|
|
60
60
|
if (colorSchemeSetterRef === null) {
|
|
61
61
|
if (process.env['NODE_ENV'] !== 'production') {
|
|
62
|
-
// eslint-disable-next-line no-console -- dev-only diagnostic
|
|
62
|
+
// eslint-disable-next-line no-console -- dev-only diagnostic
|
|
63
63
|
console.warn('[basalt] setColorScheme: no BasaltProvider is mounted yet')
|
|
64
64
|
}
|
|
65
65
|
return
|
|
@@ -77,7 +77,7 @@ export function setColorScheme(scheme: ColorScheme): void {
|
|
|
77
77
|
export function toggleSidebar(): void {
|
|
78
78
|
if (sidebarToggleRef === null) {
|
|
79
79
|
if (process.env['NODE_ENV'] !== 'production') {
|
|
80
|
-
// eslint-disable-next-line no-console -- dev-only diagnostic
|
|
80
|
+
// eslint-disable-next-line no-console -- dev-only diagnostic
|
|
81
81
|
console.warn('[basalt] toggleSidebar: no BasaltShell is mounted yet')
|
|
82
82
|
}
|
|
83
83
|
return
|