basalt-ui 1.41.0 → 2.0.1
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 +46 -43
- package/CHANGELOG.md +542 -518
- package/MIGRATING.md +964 -37
- package/README.md +171 -366
- 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 +16 -26
- package/agent/templates/DESIGN.md.tpl +1 -1
- package/agent/templates/__root.tpl +9 -16
- package/agent/templates/main.tpl +21 -0
- package/agent/templates/nav.tpl +18 -0
- package/configs/oxlint-basalt.json +4 -10
- package/configs/oxlint-plugin.js +465 -844
- package/configs/oxlint-plugin.test.ts +661 -709
- 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/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 +18 -43
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +6 -0
- package/dist/cli/doctor-upgrade.d.ts +43 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -0
- package/dist/cli/doctor-upgrade.js +314 -0
- package/dist/cli/doctor.d.ts +14 -29
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +58 -9
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +2 -4
- package/dist/cli/index.d.ts +48 -172
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +39 -132
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +43 -37
- package/dist/cli/sync.d.ts +5 -21
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +4 -23
- 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/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 +80 -173
- 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/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 +26 -43
- package/src/cli/doctor-upgrade.ts +457 -0
- package/src/cli/doctor.ts +89 -72
- package/src/cli/help.ts +2 -4
- package/src/cli/index.ts +100 -384
- package/src/cli/init.ts +60 -51
- package/src/cli/sync.ts +13 -68
- 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/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 +36 -191
- 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/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
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
import { Switch } from '@mantine/core'
|
|
14
14
|
import { useId } from 'react'
|
|
15
15
|
import type { ReactNode } from 'react'
|
|
16
|
-
import type { BasaltProps } from '../common/props'
|
|
17
16
|
import { assertRequiredProps } from '../common/validate'
|
|
18
|
-
import type {
|
|
17
|
+
import type { FieldHandle } from '../state'
|
|
18
|
+
import type { BooleanField } from '../state/fields'
|
|
19
19
|
import { useFilterRegistration, useFilterSurface } from './filter-context'
|
|
20
20
|
import { FilterPill } from './filter-pill'
|
|
21
21
|
import { PanelRow } from './panel-row'
|
|
22
|
+
import type { UncontrolledProps } from './uncontrolled'
|
|
22
23
|
|
|
23
|
-
export type ToggleFilterProps =
|
|
24
|
+
export type ToggleFilterProps = UncontrolledProps & {
|
|
24
25
|
readonly field: FieldHandle<BooleanField>
|
|
25
26
|
readonly label: string
|
|
26
27
|
readonly icon?: ReactNode
|
|
@@ -28,7 +29,7 @@ export type ToggleFilterProps = BasaltProps & {
|
|
|
28
29
|
|
|
29
30
|
export function ToggleFilter(props: ToggleFilterProps): ReactNode {
|
|
30
31
|
// F-ERR-1 — without this a missing `field` surfaces as `undefined is not an object
|
|
31
|
-
// (evaluating 'field.use')`, caught by `
|
|
32
|
+
// (evaluating 'field.use')`, caught by `RootBoundary`.
|
|
32
33
|
assertRequiredProps('ToggleFilter', props, ['field'], {
|
|
33
34
|
field: 'bind it to a store field (`store.field.<name>`), never a value/onChange pair.',
|
|
34
35
|
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BasaltProps } from '../common/props'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Law C2 as named slots: a basalt filter or tab owns its value through `field`, so `value`,
|
|
5
|
+
* `onChange` and `size` are typed `never` — the compile error names the mistake instead of
|
|
6
|
+
* reporting an unknown prop (`docs/V2-SPEC.md` §3).
|
|
7
|
+
*/
|
|
8
|
+
export type UncontrolledProps = BasaltProps & {
|
|
9
|
+
value?: never
|
|
10
|
+
onChange?: never
|
|
11
|
+
size?: never
|
|
12
|
+
}
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
import { SegmentedControl, Select } from '@mantine/core'
|
|
31
31
|
import type { ReactNode } from 'react'
|
|
32
32
|
import { cx } from '../common/props'
|
|
33
|
-
import type { BasaltProps } from '../common/props'
|
|
34
33
|
import { assertRequiredProps } from '../common/validate'
|
|
35
34
|
import type { EnumField, FieldHandle } from '../state'
|
|
36
35
|
import classes from './controls.module.css'
|
|
37
36
|
import { useFilterSurface } from './filter-context'
|
|
38
37
|
import { useControlName } from './filter-sheet'
|
|
39
38
|
import { PanelChoice, PanelRow, useTrackFits } from './panel-row'
|
|
39
|
+
import type { UncontrolledProps } from './uncontrolled'
|
|
40
40
|
|
|
41
41
|
/** Past three options the phone form is a `Select`, not a track. */
|
|
42
42
|
const PHONE_TRACK_MAX = 3
|
|
@@ -48,7 +48,7 @@ export type ViewTabsOption<T extends string> = {
|
|
|
48
48
|
readonly only?: 'sm-up' | 'sm-down'
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export type ViewTabsProps<T extends string> =
|
|
51
|
+
export type ViewTabsProps<T extends string> = UncontrolledProps & {
|
|
52
52
|
readonly field: FieldHandle<EnumField<T>>
|
|
53
53
|
/** Defaults to `field.options` (every declared value, labelled by `store.labels()`). */
|
|
54
54
|
readonly options?: readonly ViewTabsOption<T>[]
|
|
@@ -64,7 +64,7 @@ export type ViewTabsProps<T extends string> = BasaltProps & {
|
|
|
64
64
|
|
|
65
65
|
export function ViewTabs<T extends string>(props: ViewTabsProps<T>): ReactNode {
|
|
66
66
|
// F-ERR-1 — without this a missing `field` surfaces as `undefined is not an object
|
|
67
|
-
// (evaluating 'field.use')`, caught by `
|
|
67
|
+
// (evaluating 'field.use')`, caught by `RootBoundary`.
|
|
68
68
|
assertRequiredProps('ViewTabs', props, ['field'], {
|
|
69
69
|
field: 'bind it to a store field (`store.field.<name>`), never a value/onChange pair.',
|
|
70
70
|
})
|
|
@@ -29,7 +29,7 @@ import type { RangeCustomPickerProps } from '../controls/range-filter'
|
|
|
29
29
|
|
|
30
30
|
export function DateRangePicker(props: RangeCustomPickerProps): ReactNode {
|
|
31
31
|
// F-ERR-1 — without this a missing `value` surfaces as `undefined is not an object
|
|
32
|
-
// (evaluating 'value.from')`, caught by `
|
|
32
|
+
// (evaluating 'value.from')`, caught by `RootBoundary`.
|
|
33
33
|
assertRequiredProps('DateRangePicker', props, ['value'], {
|
|
34
34
|
value: "pass `{ from, to }` — usually injected by `RangeFilter`'s `customPicker`.",
|
|
35
35
|
})
|
package/src/dashboard/index.ts
CHANGED
|
@@ -1,48 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type WidgetHeaderTitleProps,
|
|
9
|
-
} from './widget-header'
|
|
10
|
-
export { DeltaBadge, type DeltaBadgeProps, type DeltaPolarity } from './delta-badge'
|
|
11
|
-
export { Section, type SectionProps, type SectionSlot } from './section'
|
|
12
|
-
export {
|
|
13
|
-
StatCard,
|
|
14
|
-
type StatCardBreakdownRow,
|
|
15
|
-
type StatCardProps,
|
|
16
|
-
type StatCardSlot,
|
|
17
|
-
type StatCardTone,
|
|
18
|
-
} from './stat-card'
|
|
19
|
-
export {
|
|
20
|
-
WidgetGrid,
|
|
21
|
-
type WidgetGridCols,
|
|
22
|
-
type WidgetGridItemProps,
|
|
23
|
-
type WidgetGridProps,
|
|
24
|
-
} from './widget-grid'
|
|
25
|
-
export { StatGroup, type StatGroupCols, type StatGroupProps } from './stat-group'
|
|
26
|
-
export { EmptyState, type EmptyStateProps, type EmptyStateSlot } from './empty-state'
|
|
27
|
-
export {
|
|
28
|
-
SettingsSection,
|
|
29
|
-
type SettingsSectionProps,
|
|
30
|
-
type SettingsSectionSlot,
|
|
31
|
-
SettingsRow,
|
|
32
|
-
type SettingsRowProps,
|
|
33
|
-
type SettingsRowSlot,
|
|
34
|
-
DangerZone,
|
|
35
|
-
type DangerZoneProps,
|
|
36
|
-
} from './settings-section'
|
|
37
|
-
export {
|
|
38
|
-
QueryState,
|
|
39
|
-
type QueryStateProps,
|
|
40
|
-
type QueryStateLike,
|
|
41
|
-
type QueryStateSlot,
|
|
42
|
-
type QueryStateTier,
|
|
43
|
-
type QueryEmptyCopy,
|
|
44
|
-
LoadingState,
|
|
45
|
-
type LoadingStateProps,
|
|
46
|
-
ErrorState,
|
|
47
|
-
type ErrorStateProps,
|
|
48
|
-
} from './query-state'
|
|
1
|
+
export { WidgetHeader } from './widget-header'
|
|
2
|
+
export { DeltaBadge } from './delta-badge'
|
|
3
|
+
export { Section } from './section'
|
|
4
|
+
export { StatCard, type StatCardBreakdownRow, type StatCardTone } from './stat-card'
|
|
5
|
+
export { StatGroup } from './stat-group'
|
|
6
|
+
export { EmptyState } from './empty-state'
|
|
7
|
+
export { SettingsSection, SettingsRow, DangerZone } from './settings-section'
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* `actions` and `tabs` are two separate `CtlSlot`-wrapped fragments rendered in the header row
|
|
14
14
|
* (C1/C5) via `WidgetHeader`'s single `actions` slot; `tabs` hides while the section is collapsed.
|
|
15
|
-
* `Section` holds ≤3 actions (C6) —
|
|
16
|
-
* title (the AST guard lands in wave 6).
|
|
15
|
+
* `Section` holds ≤3 actions (C6) — a fourth is a tsc error (the `SectionActions` type).
|
|
17
16
|
*
|
|
18
17
|
* `collapsible` state persists via `createPersistedState('basalt:section:<persistKey>')` when
|
|
19
18
|
* `persistKey` is given, else it is local `useState` — the header always stays drawn, only the body
|
|
@@ -46,15 +45,15 @@
|
|
|
46
45
|
* <UsageChart />
|
|
47
46
|
* </Section>
|
|
48
47
|
*/
|
|
49
|
-
import {
|
|
48
|
+
import { useId } from 'react'
|
|
50
49
|
import type { ReactNode } from 'react'
|
|
51
50
|
import { cx } from '../common/props'
|
|
52
51
|
import type { BasaltProps, SlotStylesProps } from '../common/props'
|
|
53
52
|
import { BASALT_PREFIX } from '../common/errors'
|
|
54
53
|
import { useValidateProps } from '../common/validate'
|
|
55
54
|
import { CtlSlot } from '../theme'
|
|
56
|
-
import { BarActionSlot
|
|
57
|
-
import type {
|
|
55
|
+
import { BarActionSlot } from '../controls/actions'
|
|
56
|
+
import type { SectionActions } from '../controls/actions'
|
|
58
57
|
import { useFilterSurface } from '../controls/filter-context'
|
|
59
58
|
import { QueryState } from './query-state'
|
|
60
59
|
import type { QueryEmptyCopy, QueryStateLike } from './query-state'
|
|
@@ -79,12 +78,10 @@ export type SectionProps = Omit<WidgetHeaderProps, 'tier' | 'classNames' | 'acti
|
|
|
79
78
|
BasaltProps &
|
|
80
79
|
SlotStylesProps<SectionSlot> & {
|
|
81
80
|
/**
|
|
82
|
-
* Header actions
|
|
83
|
-
*
|
|
84
|
-
* kebab below `sm` — or an opaque `ReactNode` a caller drew itself, rendered verbatim. The ≤3
|
|
85
|
-
* budget (C6) is checked against whichever form is given.
|
|
81
|
+
* Header actions as typed data (law C15), projected through the SAME row `PageBar` uses — one
|
|
82
|
+
* kebab below `sm`. At most three: a fourth is a tsc error (law C6, `docs/V2-SPEC.md` §3).
|
|
86
83
|
*/
|
|
87
|
-
actions?:
|
|
84
|
+
actions?: SectionActions
|
|
88
85
|
/**
|
|
89
86
|
* The section's async result. Given one, the BODY renders through `QueryState` at the section
|
|
90
87
|
* tier — pending / error-with-retry / empty each REPLACE `children`, data renders them — while
|
|
@@ -122,27 +119,6 @@ export type SectionProps = Omit<WidgetHeaderProps, 'tier' | 'classNames' | 'acti
|
|
|
122
119
|
children: ReactNode
|
|
123
120
|
}
|
|
124
121
|
|
|
125
|
-
/**
|
|
126
|
-
* ≤3 actions is C6 (docs/CONTROLS-SPEC.md §1) — the AST guard (`basalt/page-bar-budget`) lands in
|
|
127
|
-
* wave 6; this is the dev-only stopgap so the budget is visible before the lint rule exists.
|
|
128
|
-
*
|
|
129
|
-
* Returns the message rather than logging it, because it is a {@link useValidateProps} check now:
|
|
130
|
-
* it used to `console.warn` straight from the render body, which said it again on every keystroke
|
|
131
|
-
* that re-rendered the page. The title is IN the message on purpose — the dedup key is
|
|
132
|
-
* `${component} ${message}`, so two over-budget sections only both get heard because they name
|
|
133
|
-
* themselves.
|
|
134
|
-
*/
|
|
135
|
-
function actionBudgetMessage(title: string, actions: SlotActions): string | null {
|
|
136
|
-
// Both arms of the union are counted, and the typed one is counted EXACTLY: `Children.count` over
|
|
137
|
-
// a `BarAction[]` would report the array's length as one child.
|
|
138
|
-
const count = isBarActionList(actions) ? actions.length : Children.count(actions)
|
|
139
|
-
if (count <= 3) return null
|
|
140
|
-
return (
|
|
141
|
-
`${BASALT_PREFIX} Section "${title}": ${count} actions exceeds the ≤3 budget ` +
|
|
142
|
-
'(docs/CONTROLS-SPEC.md C6) — move the rest behind a menu.'
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
122
|
function ChevronToggle({
|
|
147
123
|
open,
|
|
148
124
|
onToggle,
|
|
@@ -196,13 +172,9 @@ export function Section({
|
|
|
196
172
|
}: SectionProps) {
|
|
197
173
|
const { title } = headerProps
|
|
198
174
|
|
|
199
|
-
//
|
|
200
|
-
// `
|
|
201
|
-
//
|
|
202
|
-
// 1. A `persistKey` with nothing to fold writes a localStorage key nobody ever reads back — the
|
|
203
|
-
// shape a consumer lands on after deleting `collapsible` and leaving the key behind.
|
|
204
|
-
// 2. More than three header actions (C6). This used to `console.warn` from the render body, so a
|
|
205
|
-
// page that re-rendered on every keystroke reprinted it every keystroke.
|
|
175
|
+
// A `persistKey` with nothing to fold writes a localStorage key nobody ever reads back — the
|
|
176
|
+
// shape a consumer lands on after deleting `collapsible` and leaving the key behind. It renders
|
|
177
|
+
// fine, which is what puts it in `useValidateProps` rather than in `assertRequiredProps`.
|
|
206
178
|
useValidateProps(
|
|
207
179
|
'Section',
|
|
208
180
|
() => [
|
|
@@ -210,9 +182,8 @@ export function Section({
|
|
|
210
182
|
? `${BASALT_PREFIX} Section "${title}": \`persistKey\` is set but \`collapsible\` is ` +
|
|
211
183
|
'false — there is no fold to persist. Add `collapsible`, or drop `persistKey`.'
|
|
212
184
|
: null,
|
|
213
|
-
actions === undefined ? null : actionBudgetMessage(title, actions),
|
|
214
185
|
],
|
|
215
|
-
[persistKey, collapsible, title
|
|
186
|
+
[persistKey, collapsible, title],
|
|
216
187
|
)
|
|
217
188
|
|
|
218
189
|
const [open, setOpen] = usePersistedOrLocal({
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* carries them as a muted line, and `info` puts "how this number is computed" behind the glyph
|
|
20
20
|
* beside the title instead of inside the heading's accessible name.
|
|
21
21
|
*
|
|
22
|
-
* `src/dashboard` stays
|
|
23
|
-
* here. Pass
|
|
22
|
+
* `src/dashboard` stays chart-free — `sparkline` is a plain `ReactNode` slot, never a chart import
|
|
23
|
+
* here. Pass your own sparkline at the call site (basalt ships no `Sparkline` kind in 2.0.0).
|
|
24
24
|
*
|
|
25
25
|
* `query` hands the card's pending/error/empty branch to `QueryState` at the `'section'` tier,
|
|
26
26
|
* rendered under the header rather than over it — the title row is chrome and must not flicker.
|
|
@@ -39,15 +39,14 @@
|
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* import { StatCard } from 'basalt-ui'
|
|
42
|
-
* import { LineSparkline } from 'basalt-ui/charts'
|
|
43
42
|
*
|
|
44
43
|
* // `sparkline` is a RENDER PROP over the slot's measured box, so full-bleed is genuinely the
|
|
45
|
-
* // card's width — no
|
|
44
|
+
* // card's width — no measuring wrapper component, no hardcoded pixel value.
|
|
46
45
|
* <StatCard
|
|
47
46
|
* title="Active Users"
|
|
48
47
|
* value="12,483"
|
|
49
48
|
* delta={4.2}
|
|
50
|
-
* sparkline={({ width, height }) => <
|
|
49
|
+
* sparkline={({ width, height }) => <MySparkline data={history} width={width} height={height} />}
|
|
51
50
|
* />
|
|
52
51
|
*
|
|
53
52
|
* @example
|
|
@@ -59,7 +58,7 @@
|
|
|
59
58
|
* delta={4.2}
|
|
60
59
|
* sparklinePlacement="right"
|
|
61
60
|
* sparkline={({ width, height }) => (
|
|
62
|
-
* <
|
|
61
|
+
* <MySparkline data={history} width={width} height={height} ariaLabel="Active users trend" />
|
|
63
62
|
* )}
|
|
64
63
|
* />
|
|
65
64
|
*
|
|
@@ -152,9 +151,9 @@ const SPARKLINE_RIGHT_HEIGHT = 26
|
|
|
152
151
|
/**
|
|
153
152
|
* The measured box a `sparkline` render prop receives.
|
|
154
153
|
*
|
|
155
|
-
*
|
|
154
|
+
* An SVG sparkline takes `width`/`height` as NUMBERS (they are SVG attributes — an
|
|
156
155
|
* svg cannot size itself from CSS and then scale its scales), so "full bleed" was never expressible
|
|
157
|
-
* as a `ReactNode`: the caller had to guess a pixel width, or write its own
|
|
156
|
+
* as a `ReactNode`: the caller had to guess a pixel width, or write its own measuring wrapper
|
|
158
157
|
* component. Four consumers wrote that wrapper; two of them hardcoded a width and drew a sparkline
|
|
159
158
|
* that stopped short of the card edge on every viewport but the one they built on.
|
|
160
159
|
*/
|
|
@@ -164,9 +163,8 @@ export type StatCardSparklineSize = {
|
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
/**
|
|
167
|
-
* Measures a slot and re-measures on resize. Plain `ResizeObserver
|
|
168
|
-
*
|
|
169
|
-
* wraps `@visx/responsive`.
|
|
166
|
+
* Measures a slot and re-measures on resize. Plain `ResizeObserver`: `src/dashboard/**` is
|
|
167
|
+
* Mantine-coupled and chart-FREE (see the module doc).
|
|
170
168
|
*
|
|
171
169
|
* The `undefined` guard is for the test DOM — happy-dom ships no `ResizeObserver`, and the one-shot
|
|
172
170
|
* measure above it is what keeps a mounted card rendering its sparkline there.
|
|
@@ -266,14 +264,14 @@ export type StatCardProps = BasaltProps &
|
|
|
266
264
|
/**
|
|
267
265
|
* Optional trend visual. Either a node, or a RENDER PROP receiving the slot's measured box.
|
|
268
266
|
*
|
|
269
|
-
* Prefer the render prop for
|
|
267
|
+
* Prefer the render prop for any SVG sparkline: those take numeric `width`/`height`
|
|
270
268
|
* (SVG attributes), so a plain node has to hardcode a width, and a hardcoded width is not
|
|
271
269
|
* full-bleed on any viewport but the one it was typed on. With `sparklinePlacement="bleed"` the
|
|
272
270
|
* measured width is the card's own inner width including the bled inset; with `'right'` it is the
|
|
273
271
|
* fixed 72×26 slot (see {@link SPARKLINE_RIGHT_WIDTH} for why that one is not measured).
|
|
274
272
|
*
|
|
275
273
|
* @example
|
|
276
|
-
* sparkline={({ width, height }) => <
|
|
274
|
+
* sparkline={({ width, height }) => <MySparkline data={history} width={width} height={height} />}
|
|
277
275
|
*/
|
|
278
276
|
sparkline?: ReactNode | ((size: StatCardSparklineSize) => ReactNode)
|
|
279
277
|
/** Where `sparkline` sits. `'bleed'` (default) is today's full-width row bled to the card edges;
|
|
@@ -314,8 +312,8 @@ export function StatCard({
|
|
|
314
312
|
const isRender = typeof sparkline === 'function'
|
|
315
313
|
const bleeds = sparklinePlacement === 'bleed'
|
|
316
314
|
// Only a render prop needs a measurement; a plain node sizes itself.
|
|
317
|
-
const
|
|
318
|
-
const measured: StatCardSparklineSize = { width:
|
|
315
|
+
const { ref: slotRef, width: slotWidth } = useSlotWidth(isRender)
|
|
316
|
+
const measured: StatCardSparklineSize = { width: slotWidth, height: SPARKLINE_RIGHT_HEIGHT }
|
|
319
317
|
|
|
320
318
|
// A `<dl>`, not a table and not a stack of divs: each row IS a term and its value, which is the
|
|
321
319
|
// one semantic that survives a reader meeting the card out of context.
|
|
@@ -350,7 +348,7 @@ export function StatCard({
|
|
|
350
348
|
const sparklineNode: ReactNode =
|
|
351
349
|
sparkline === undefined ? null : (
|
|
352
350
|
<div
|
|
353
|
-
ref={
|
|
351
|
+
ref={slotRef}
|
|
354
352
|
className={cx(
|
|
355
353
|
bleeds ? classes.sparklineBleed : classes.sparklineRight,
|
|
356
354
|
classNames?.sparkline,
|
|
@@ -345,26 +345,28 @@
|
|
|
345
345
|
/*
|
|
346
346
|
* The same fold, triggered by the CARD'S OWN HEIGHT instead of its width (wave 8's header-economy
|
|
347
347
|
* law) — a short-but-wide chart card (a KPI-style plot with little vertical room) still needs the
|
|
348
|
-
* subtitle line back.
|
|
349
|
-
* auto-height card collapses it to 0
|
|
350
|
-
*
|
|
348
|
+
* subtitle line back. A height cannot be a `@container` query: `container-type: size` on an
|
|
349
|
+
* auto-height card collapses it to 0. So the hook is a selector on markup that is already in the
|
|
350
|
+
* server HTML (W10 SSR contract): a chart that states a small `height` marks its box
|
|
351
|
+
* `data-basalt-chart-short`, and the card matches it with `:has`. A card whose body is not a chart
|
|
352
|
+
* is measured instead (`ChartCard`'s ResizeObserver, under 280px) and sets `data-basalt-card-short`.
|
|
351
353
|
*/
|
|
352
|
-
[data-basalt-card-short] .subtitle {
|
|
354
|
+
:is([data-basalt-card-short], [data-basalt-chart-card]:has([data-basalt-chart-short])) .subtitle {
|
|
353
355
|
display: none;
|
|
354
356
|
}
|
|
355
357
|
|
|
356
|
-
[data-basalt-card-short] .foldGlyph {
|
|
358
|
+
:is([data-basalt-card-short], [data-basalt-chart-card]:has([data-basalt-chart-short])) .foldGlyph {
|
|
357
359
|
display: inline-flex;
|
|
358
360
|
}
|
|
359
361
|
|
|
360
|
-
[data-basalt-card-short] .foldNote {
|
|
362
|
+
:is([data-basalt-card-short], [data-basalt-chart-card]:has([data-basalt-chart-short])) .foldNote {
|
|
361
363
|
display: block;
|
|
362
364
|
}
|
|
363
365
|
|
|
364
366
|
/* A short card's KPI numeral is the header's own tallest line (the merged title row has no other
|
|
365
367
|
* source of height once the subtitle folds) — the same floor the width `cqi` clamp already uses,
|
|
366
368
|
* so a short card never introduces a THIRD value size. */
|
|
367
|
-
[data-basalt-card-short] .value {
|
|
369
|
+
:is([data-basalt-card-short], [data-basalt-chart-card]:has([data-basalt-chart-short])) .value {
|
|
368
370
|
font-size: var(--vx-text-lg);
|
|
369
371
|
}
|
|
370
372
|
|
package/src/dev-dock.tsx
CHANGED
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* from argo's `components/dev-dock.tsx` (91 lines) — same three-tool shape, same "only renders the
|
|
7
|
-
* ACTIVE panel" contract: the launcher (which tool is open) lives wherever the consumer puts it —
|
|
8
|
-
* a `SettingsMenuItem` per tool with `active` set to the currently-open one (C5's
|
|
9
|
-
* `SettingsMenuItem.active`) is the seeded pattern — this component owns only the render.
|
|
2
|
+
* The dev dock — mounted by `BasaltProvider` behind a literal `NODE_ENV` check and not exported
|
|
3
|
+
* from the barrel (V2-SPEC § 2). A fixed bottom drawer hosting the Router devtools, the Query
|
|
4
|
+
* devtools panel and the theme lab; it renders only the ACTIVE panel, and the provider's three
|
|
5
|
+
* `dev.*` Spotlight commands choose which.
|
|
10
6
|
*
|
|
11
|
-
* Every dependency is an OPTIONAL peer
|
|
12
|
-
* `
|
|
13
|
-
* `@tanstack/react-query-devtools` or `@tanstack/react-router` unless a consumer actually opens
|
|
14
|
-
* that tool — same discipline as `BasaltQueryDevtools` (`query-devtools.tsx`) and
|
|
15
|
-
* `ThemeLabControls`'s own `React.lazy` wrapper here. In production this returns `null`
|
|
16
|
-
* immediately, before any dynamic import fires.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* import { BasaltDevDock, type BasaltDevDockTool } from 'basalt-ui'
|
|
20
|
-
* import { useState } from 'react'
|
|
21
|
-
* import { useRouter } from '@tanstack/react-router'
|
|
22
|
-
*
|
|
23
|
-
* function DevTools() {
|
|
24
|
-
* const [tool, setTool] = useState<BasaltDevDockTool | null>(null)
|
|
25
|
-
* const router = useRouter()
|
|
26
|
-
* return <BasaltDevDock tool={tool} onClose={() => setTool(null)} router={router} />
|
|
27
|
-
* }
|
|
28
|
-
* // wire the launchers as settings-menu entries with `active: tool === 'router'` etc.
|
|
7
|
+
* Every dependency is an OPTIONAL peer loaded through `import()` when its tool opens, so neither
|
|
8
|
+
* devtools package is required until then. In production this returns `null` before any import.
|
|
29
9
|
*/
|
|
30
|
-
import { lazy, Suspense } from 'react'
|
|
10
|
+
import { lazy, Suspense, useEffect } from 'react'
|
|
31
11
|
import type { ReactNode } from 'react'
|
|
32
12
|
import { Box, CloseButton, Flex, Group, Text } from '@mantine/core'
|
|
33
13
|
import type { BasaltProps } from './common/props'
|
|
14
|
+
import { applyOverrides, loadOverrides } from './theme-lab/boot'
|
|
34
15
|
import type { ThemeLabControlsProps } from './theme-lab'
|
|
35
16
|
|
|
36
17
|
/** Which panel is open. `null` renders nothing (the dock is unmounted, not hidden). */
|
|
@@ -98,6 +79,12 @@ export function BasaltDevDock({
|
|
|
98
79
|
className,
|
|
99
80
|
style,
|
|
100
81
|
}: BasaltDevDockProps): ReactNode {
|
|
82
|
+
// The theme lab owns only the editing UI — re-apply persisted overrides at boot so a tuning
|
|
83
|
+
// session survives a refresh, whether or not the dock is open.
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (process.env['NODE_ENV'] === 'production') return
|
|
86
|
+
applyOverrides(loadOverrides())
|
|
87
|
+
}, [])
|
|
101
88
|
if (process.env['NODE_ENV'] === 'production') return null
|
|
102
89
|
if (tool === null) return null
|
|
103
90
|
|
package/src/format/date.ts
CHANGED
|
@@ -1,70 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Date/time/duration formatting
|
|
3
|
-
*
|
|
4
|
-
* The rest (`clock`/`weekday`/`relativeTime`/`duration`/`durationClock`) are new, seeded from argo
|
|
5
|
-
* consumers (`features/{walking-pad,reading,astro-window,garmin-health}/{formatters,format,
|
|
2
|
+
* Date/time/duration formatting (`clock`/`weekday`/`relativeTime`/`duration`/`durationClock`),
|
|
3
|
+
* seeded from argo consumers (`features/{walking-pad,reading,astro-window,garmin-health}/{formatters,format,
|
|
6
4
|
* formulas}.ts` — read those files' own JSDoc for the exact call sites this generalizes).
|
|
7
5
|
*/
|
|
8
6
|
import { dateFormat, NON_FINITE, toDate } from './shared'
|
|
9
7
|
import type { LocaleOption } from './shared'
|
|
10
8
|
|
|
11
|
-
const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
|
12
|
-
const SHORT_DAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
|
|
13
|
-
|
|
14
|
-
/** Axis-friendly short date: DD.MM. A non-finite or invalid date prints {@link NON_FINITE}. */
|
|
15
|
-
export function fmtAxisDate(value: unknown): string {
|
|
16
|
-
if (typeof value === 'number' && !Number.isFinite(value)) return NON_FINITE
|
|
17
|
-
if (value instanceof Date) {
|
|
18
|
-
if (Number.isNaN(value.getTime())) return NON_FINITE
|
|
19
|
-
const dd = String(value.getDate()).padStart(2, '0')
|
|
20
|
-
const mm = String(value.getMonth() + 1).padStart(2, '0')
|
|
21
|
-
return `${dd}.${mm}`
|
|
22
|
-
}
|
|
23
|
-
const s = String(value ?? '')
|
|
24
|
-
const match = s.match(/(\d{4})-(\d{2})-(\d{2})/)
|
|
25
|
-
if (match) return `${match[3]}.${match[2]}`
|
|
26
|
-
return s
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Tooltip-friendly long date: "Mon Apr 21 2026". A non-finite or invalid date prints
|
|
30
|
-
* {@link NON_FINITE}. */
|
|
31
|
-
export function fmtTooltipDate(date: unknown): string {
|
|
32
|
-
if (typeof date === 'number' && !Number.isFinite(date)) return NON_FINITE
|
|
33
|
-
if (date instanceof Date) {
|
|
34
|
-
if (Number.isNaN(date.getTime())) return NON_FINITE
|
|
35
|
-
return `${SHORT_DAYS[date.getDay()]} ${MONTHS[date.getMonth()]} ${date.getDate()} ${date.getFullYear()}`
|
|
36
|
-
}
|
|
37
|
-
const s = String(date ?? '')
|
|
38
|
-
const match = s.match(/(\d{4})-(\d{2})-(\d{2})/)
|
|
39
|
-
if (!match) return s
|
|
40
|
-
const d = new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]))
|
|
41
|
-
return `${SHORT_DAYS[d.getDay()]} ${MONTHS[d.getMonth()]} ${d.getDate()} ${d.getFullYear()}`
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export type ClockOptions = LocaleOption & {
|
|
45
|
-
/** IANA zone (`'Europe/Vienna'`). Default the runtime's own zone — the same "local" argo's
|
|
46
|
-
* `d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })` call sites meant. */
|
|
47
|
-
timeZone?: string
|
|
48
|
-
/** Render `:ss` too. Default false. */
|
|
49
|
-
seconds?: boolean
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** A local clock reading — `"09:41"`. Seeds: `m365-explorer/explorer-page.tsx`,
|
|
53
|
-
* `walking-pad/session-history.tsx` (both `toLocaleTimeString([...], { hour: '2-digit', minute:
|
|
54
|
-
* '2-digit' })`). A non-finite/unparseable input prints {@link NON_FINITE}. */
|
|
55
|
-
export function clock(value: Date | number | string, options: ClockOptions = {}): string {
|
|
56
|
-
const date = toDate(value)
|
|
57
|
-
if (date === null) return NON_FINITE
|
|
58
|
-
const { locale, timeZone, seconds = false } = options
|
|
59
|
-
return dateFormat(locale, {
|
|
60
|
-
hour: '2-digit',
|
|
61
|
-
minute: '2-digit',
|
|
62
|
-
...(seconds && { second: '2-digit' }),
|
|
63
|
-
hour12: false,
|
|
64
|
-
...(timeZone !== undefined && { timeZone }),
|
|
65
|
-
}).format(date)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
9
|
export type WeekdayOptions = LocaleOption & {
|
|
69
10
|
/** `Intl.DateTimeFormat`'s own weekday widths. Default `'short'` (`"Mon"`). */
|
|
70
11
|
format?: 'short' | 'long' | 'narrow'
|
|
@@ -139,37 +80,6 @@ export function relativeTime(
|
|
|
139
80
|
return relativeTimeFormat(locale).format(Math.round(diffMs / unit.ms), unit.unit)
|
|
140
81
|
}
|
|
141
82
|
|
|
142
|
-
export type DurationUnit = 'seconds' | 'minutes'
|
|
143
|
-
|
|
144
|
-
export type DurationOptions = {
|
|
145
|
-
/** Unit of the input value. Default `'seconds'`. */
|
|
146
|
-
unit?: DurationUnit
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Human duration — `"1h 02m"`, `"5m"`, `"42s"`. Minutes zero-pad once an hour is present (`"1h
|
|
151
|
-
* 02m"`, a clock-reading convention); alone they don't (`"5m"`). Seconds show only under a minute
|
|
152
|
-
* (`"42s"`). A non-finite value prints {@link NON_FINITE}.
|
|
153
|
-
*
|
|
154
|
-
* The one signature standing in for argo's four duration spellings: `walking-pad/
|
|
155
|
-
* formatters.ts#formatDuration` (seconds, `<60s` → `"Ns"` — this IS that shape),
|
|
156
|
-
* `reading/format.ts#formatReadTime` (seconds, no `<60s` branch, floors at `"0m"` — pass a value
|
|
157
|
-
* `>= 60` and the shapes match), `astro-window/formulas.ts#fmtMinutes` (minutes as input — pass
|
|
158
|
-
* `{ unit: 'minutes' }`). The fourth, `walking-pad/formatters.ts#formatDurationClock` (`h:mm:ss`),
|
|
159
|
-
* is {@link durationClock} below, not this.
|
|
160
|
-
*/
|
|
161
|
-
export function duration(value: number, options: DurationOptions = {}): string {
|
|
162
|
-
if (!Number.isFinite(value)) return NON_FINITE
|
|
163
|
-
const { unit = 'seconds' } = options
|
|
164
|
-
const totalSeconds = Math.max(0, Math.round(unit === 'minutes' ? value * 60 : value))
|
|
165
|
-
if (totalSeconds < 60) return `${totalSeconds}s`
|
|
166
|
-
const totalMinutes = Math.round(totalSeconds / 60)
|
|
167
|
-
const h = Math.floor(totalMinutes / 60)
|
|
168
|
-
const m = totalMinutes % 60
|
|
169
|
-
if (h === 0) return `${m}m`
|
|
170
|
-
return `${h}h ${String(m).padStart(2, '0')}m`
|
|
171
|
-
}
|
|
172
|
-
|
|
173
83
|
/** Clock-style duration — `"1:02:03"`, `"04:12"`. Seeded from `walking-pad/
|
|
174
84
|
* formatters.ts#formatDurationClock`. A non-finite value prints {@link NON_FINITE}. */
|
|
175
85
|
export function durationClock(seconds: number): string {
|
package/src/format/index.ts
CHANGED
|
@@ -2,68 +2,22 @@
|
|
|
2
2
|
* `basalt-ui/format` — Mantine-free, React-free `Intl`-backed formatting. One implementation for
|
|
3
3
|
* numbers/percentages/money, dates/times/durations and the two measurement units argo needed
|
|
4
4
|
* (`km`/`kcal`) — replacing argo's `features/*\/{formatters,formulas,format}.ts` (~350 of 643
|
|
5
|
-
* lines across four duration spellings) and the chart layer's own
|
|
6
|
-
*
|
|
5
|
+
* lines across four duration spellings) and the 1.x chart layer's own formatters (2.0's charts
|
|
6
|
+
* import the internals directly).
|
|
7
7
|
*
|
|
8
8
|
* Every formatter takes `(value, opts?)`; `locale` on every `opts` defaults to `undefined` —
|
|
9
9
|
* `Intl`'s own "use the runtime's locale". Every non-finite/unparseable input prints the same
|
|
10
10
|
* {@link NON_FINITE} em dash rather than `"NaN"` or throwing.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
* import { money, percent,
|
|
13
|
+
* import { money, percent, durationClock, weekday, relativeTime } from 'basalt-ui/format'
|
|
14
14
|
*
|
|
15
15
|
* money(1234, { currency: 'USD' }) // "$1,234"
|
|
16
16
|
* percent(0.42) // "42%"
|
|
17
|
-
*
|
|
17
|
+
* durationClock(3_723) // "1:02:03"
|
|
18
18
|
* weekday('2026-09-02') // "Wed"
|
|
19
19
|
* relativeTime(Date.now() - 3_600_000) // "1 hour ago"
|
|
20
20
|
*/
|
|
21
|
-
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type DeltaPctOptions,
|
|
25
|
-
fmtCompact,
|
|
26
|
-
type FmtCompactOptions,
|
|
27
|
-
fmtCurrency,
|
|
28
|
-
type FmtCurrencyOptions,
|
|
29
|
-
fmtInt,
|
|
30
|
-
fmtPercent,
|
|
31
|
-
type FmtPercentOptions,
|
|
32
|
-
integer,
|
|
33
|
-
type LocaleOption,
|
|
34
|
-
money,
|
|
35
|
-
NON_FINITE,
|
|
36
|
-
percent,
|
|
37
|
-
} from './number'
|
|
38
|
-
export {
|
|
39
|
-
clock,
|
|
40
|
-
type ClockOptions,
|
|
41
|
-
duration,
|
|
42
|
-
durationClock,
|
|
43
|
-
type DurationOptions,
|
|
44
|
-
type DurationUnit,
|
|
45
|
-
fmtAxisDate,
|
|
46
|
-
fmtTooltipDate,
|
|
47
|
-
relativeTime,
|
|
48
|
-
type RelativeTimeOptions,
|
|
49
|
-
weekday,
|
|
50
|
-
type WeekdayOptions,
|
|
51
|
-
} from './date'
|
|
52
|
-
export { kcal, type KcalOptions, km, type KmOptions } from './measure'
|
|
53
|
-
|
|
54
|
-
import { fmtCompact, fmtCurrency, fmtInt, fmtPercent } from './number'
|
|
55
|
-
import { fmtAxisDate, fmtTooltipDate } from './date'
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Every shipped chart-facing formatter under one name, so a chart can be handed the whole set
|
|
59
|
-
* (`format={formatters.compact}`). Unchanged shape from `charts/utils/format.ts` — this is the
|
|
60
|
-
* SAME object, not a second one, so an existing `formatters.x` call site keeps working verbatim.
|
|
61
|
-
*/
|
|
62
|
-
export const formatters = {
|
|
63
|
-
compact: fmtCompact,
|
|
64
|
-
percent: fmtPercent,
|
|
65
|
-
currency: fmtCurrency,
|
|
66
|
-
int: fmtInt,
|
|
67
|
-
axisDate: fmtAxisDate,
|
|
68
|
-
tooltipDate: fmtTooltipDate,
|
|
69
|
-
} as const
|
|
21
|
+
export { integer, money, percent } from './number'
|
|
22
|
+
export { durationClock, relativeTime, weekday } from './date'
|
|
23
|
+
export { kcal, km } from './measure'
|