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
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useReducer, useState } from "react";
|
|
3
|
-
import { cx } from "../../common/props.js";
|
|
4
|
-
import { VX } from "../../tokens/index.js";
|
|
5
|
-
import { WidgetHeader } from "../../dashboard/widget-header.js";
|
|
6
|
-
import { useChartSize } from "../hooks/useChartSize.js";
|
|
7
|
-
import { useHysteresis } from "../hooks/use-hysteresis.js";
|
|
8
|
-
import { ChartCardContext, legendSlotReducer } from "./chart-card-context.js";
|
|
9
|
-
import { ChartEmpty, ChartError, ChartPending, resolveChartState } from "./ChartPending.js";
|
|
10
|
-
const CARD_SHORT_HEIGHT = 280;
|
|
11
|
-
const SHORT_EXIT_SLACK = 24;
|
|
12
|
-
const cardStyle = {
|
|
13
|
-
display: "flex",
|
|
14
|
-
flexDirection: "column",
|
|
15
|
-
minHeight: 0,
|
|
16
|
-
containerType: "inline-size",
|
|
17
|
-
containerName: "basalt-card",
|
|
18
|
-
borderRadius: VX.radiusCard,
|
|
19
|
-
boxShadow: VX.shadowCard,
|
|
20
|
-
backgroundColor: VX.surface.panel
|
|
21
|
-
};
|
|
22
|
-
const bodyClipStyle = {
|
|
23
|
-
// Clip the chart body to the card's bottom corners — a chart with its own square edges would
|
|
24
|
-
// otherwise poke past the card's border-radius. Only the bottom corners: the body's top edge is
|
|
25
|
-
// interior, sitting under the (unclipped) header. Trade-off: a chart tooltip that overflows the
|
|
26
|
-
// card bounds is clipped too; the kinds keep tooltips inside the plot area, so this is fine in
|
|
27
|
-
// practice — a consumer rendering an oversized/edge tooltip should portal it out of the card.
|
|
28
|
-
borderBottomLeftRadius: VX.radiusCard,
|
|
29
|
-
borderBottomRightRadius: VX.radiusCard,
|
|
30
|
-
overflow: "hidden",
|
|
31
|
-
flex: "1 1 auto",
|
|
32
|
-
minHeight: 0,
|
|
33
|
-
// A column, so a `ChartFrame` inside can grow into the body a stretched grid row hands the card.
|
|
34
|
-
display: "flex",
|
|
35
|
-
flexDirection: "column",
|
|
36
|
-
padding: "2px var(--vx-space-card-inset-x, 0.8125rem) var(--vx-space-card-inset-y, 0.6875rem)"
|
|
37
|
-
};
|
|
38
|
-
const headerWrapStyle = {
|
|
39
|
-
padding: "var(--vx-space-card-inset-y, 0.6875rem) var(--vx-space-card-inset-x, 0.8125rem) 4px"
|
|
40
|
-
};
|
|
41
|
-
const headerWrapShortStyle = {
|
|
42
|
-
padding: "4px var(--vx-space-card-inset-x, 0.8125rem) 4px"
|
|
43
|
-
};
|
|
44
|
-
function ChartCard({
|
|
45
|
-
title,
|
|
46
|
-
icon,
|
|
47
|
-
subtitle,
|
|
48
|
-
info,
|
|
49
|
-
value,
|
|
50
|
-
delta,
|
|
51
|
-
deltaPeriod,
|
|
52
|
-
deltaPolarity,
|
|
53
|
-
count,
|
|
54
|
-
actions,
|
|
55
|
-
state,
|
|
56
|
-
placeholderHeight = 240,
|
|
57
|
-
stateAction,
|
|
58
|
-
className,
|
|
59
|
-
classNames,
|
|
60
|
-
style,
|
|
61
|
-
children
|
|
62
|
-
}) {
|
|
63
|
-
const [legendSlot, setLegendSlot] = useState(null);
|
|
64
|
-
const { ref: sizeRef, height: measuredHeight } = useChartSize();
|
|
65
|
-
const resolvedState = resolveChartState({ ...state !== void 0 && { state } });
|
|
66
|
-
const hasHeader = title !== void 0 || info !== void 0 || value !== void 0 || actions !== void 0 || icon !== void 0 || count !== void 0;
|
|
67
|
-
const short = useHysteresis(
|
|
68
|
-
(wasShort) => measuredHeight > 0 && measuredHeight < (wasShort ? CARD_SHORT_HEIGHT + SHORT_EXIT_SLACK : CARD_SHORT_HEIGHT),
|
|
69
|
-
false
|
|
70
|
-
);
|
|
71
|
-
const [legendClaimants, dispatchLegendSlot] = useReducer(legendSlotReducer, []);
|
|
72
|
-
const context = useMemo(
|
|
73
|
-
() => ({ legendSlot, inCard: true, short, legendClaimants, dispatchLegendSlot }),
|
|
74
|
-
[legendSlot, short, legendClaimants]
|
|
75
|
-
);
|
|
76
|
-
return /* @__PURE__ */ jsx(ChartCardContext.Provider, { value: context, children: /* @__PURE__ */ jsxs(
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
ref: sizeRef,
|
|
80
|
-
className: cx(classNames?.root, className),
|
|
81
|
-
style: { ...cardStyle, ...style },
|
|
82
|
-
...resolvedState === "pending" && { "aria-busy": "true" },
|
|
83
|
-
...short && { "data-basalt-card-short": "" },
|
|
84
|
-
children: [
|
|
85
|
-
hasHeader && /* @__PURE__ */ jsxs(
|
|
86
|
-
"div",
|
|
87
|
-
{
|
|
88
|
-
...classNames?.header !== void 0 && { className: classNames.header },
|
|
89
|
-
style: short ? headerWrapShortStyle : headerWrapStyle,
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ jsx(
|
|
92
|
-
WidgetHeader,
|
|
93
|
-
{
|
|
94
|
-
tier: "widget",
|
|
95
|
-
title: title ?? "",
|
|
96
|
-
...icon !== void 0 && { icon },
|
|
97
|
-
...subtitle !== void 0 && { subtitle },
|
|
98
|
-
...info !== void 0 && { info },
|
|
99
|
-
...value !== void 0 && { value },
|
|
100
|
-
...delta !== void 0 && { delta },
|
|
101
|
-
...deltaPeriod !== void 0 && { deltaPeriod },
|
|
102
|
-
...deltaPolarity !== void 0 && { deltaPolarity },
|
|
103
|
-
...count !== void 0 && { count },
|
|
104
|
-
...actions !== void 0 && {
|
|
105
|
-
actions: /* @__PURE__ */ jsx("span", { "data-basalt-tier": "widget", children: actions })
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
/* @__PURE__ */ jsx("div", { ref: setLegendSlot, "data-basalt-legend-slot": "" })
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
),
|
|
113
|
-
/* @__PURE__ */ jsx(
|
|
114
|
-
"div",
|
|
115
|
-
{
|
|
116
|
-
...classNames?.body !== void 0 && { className: classNames.body },
|
|
117
|
-
style: bodyClipStyle,
|
|
118
|
-
children: resolvedState === "pending" ? /* @__PURE__ */ jsx(ChartPending, { width: "100%", height: placeholderHeight }) : resolvedState === "error" ? /* @__PURE__ */ jsx(
|
|
119
|
-
ChartError,
|
|
120
|
-
{
|
|
121
|
-
width: "100%",
|
|
122
|
-
height: placeholderHeight,
|
|
123
|
-
error: state?.error,
|
|
124
|
-
action: stateAction
|
|
125
|
-
}
|
|
126
|
-
) : resolvedState === "empty" ? /* @__PURE__ */ jsx(
|
|
127
|
-
ChartEmpty,
|
|
128
|
-
{
|
|
129
|
-
width: "100%",
|
|
130
|
-
height: placeholderHeight,
|
|
131
|
-
...typeof state?.empty === "string" && { label: state.empty },
|
|
132
|
-
action: stateAction
|
|
133
|
-
}
|
|
134
|
-
) : children
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
) });
|
|
140
|
-
}
|
|
141
|
-
export {
|
|
142
|
-
ChartCard
|
|
143
|
-
};
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { BasaltProps } from '../../common/props.js';
|
|
3
|
-
import type { ChartLegendConfig, LegendPlacement, SeriesStyle } from '../series.js';
|
|
4
|
-
import type { ResponsiveChartHeight } from './chart-frame-layout.js';
|
|
5
|
-
import type { ChartState } from './ChartPending.js';
|
|
6
|
-
/** Re-exported for `ChartFrame.test.tsx` and any other consumer that previously reached these
|
|
7
|
-
* through `ChartFrame` — the layout math itself lives in `./chart-frame-layout` (pure, DOM-free). */
|
|
8
|
-
export { legendEntryCap, resolveLegendRollup, resolvePlotRect } from './chart-frame-layout.js';
|
|
9
|
-
export type { ResponsiveChartHeight } from './chart-frame-layout.js';
|
|
10
|
-
/** Legend configuration for {@link ChartFrame}. Omit entirely (or pass `{}`) for the default
|
|
11
|
-
* bottom-placed legend; pass `false` only for the sparkline exemption. */
|
|
12
|
-
export type ChartFrameLegend = {
|
|
13
|
-
/** Default 'bottom'. */
|
|
14
|
-
placement?: LegendPlacement;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Removed in 1.32.0 — the legend now fits by measured width every time and folds
|
|
17
|
-
* overflow into an `All N` disclosure (`docs/CHARTS-SPEC.md` §8); drop the prop.
|
|
18
|
-
*
|
|
19
|
-
* Until then an explicit value still WINS OUTRIGHT over the measured fit, and it counts ENTRIES,
|
|
20
|
-
* not rows: `maxRows: 3` on a 7-entry legend renders three entries. Under `fill` the PLOT yields
|
|
21
|
-
* the height ({@link resolvePlotRect}'s `legendWins`).
|
|
22
|
-
*/
|
|
23
|
-
maxRows?: number;
|
|
24
|
-
/** Visually separate role: series | overlay | reference. */
|
|
25
|
-
groups?: boolean;
|
|
26
|
-
/** Hover-dim wiring lifted from the kind — optional. */
|
|
27
|
-
highlighted?: string | null;
|
|
28
|
-
onHighlight?: (key: string | null) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Clicking a legend entry hides that series. Defaults to true whenever there is more than one
|
|
31
|
-
* entry to toggle between — hiding the only series a chart draws is never useful. The hidden
|
|
32
|
-
* key set reaches the marks through the `children` render prop, so a hidden series leaves the
|
|
33
|
-
* plot, the tooltip, and the auto domain together (`docs/CHARTS-SPEC.md` §5).
|
|
34
|
-
*/
|
|
35
|
-
toggle?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Internal escape hatch for a kind that never wants its legend portalled into a `ChartCard`
|
|
38
|
-
* header, whatever the placement — `Donut` sets this (`docs/waves/PLAN.md` wave 3, P1-4): its
|
|
39
|
-
* side/bottom legend is the ring's only key, so it must stay under or beside the ring rather than
|
|
40
|
-
* follow every other frame's default of claiming an available header slot. `false` keeps the
|
|
41
|
-
* legend in its own band regardless of `placement`; omitted (default) behaves as today. Not
|
|
42
|
-
* something a consumer composing a kind's own `legend` prop can reach — kinds compose `ChartFrame`
|
|
43
|
-
* directly to set it.
|
|
44
|
-
*/
|
|
45
|
-
headerSlot?: boolean;
|
|
46
|
-
};
|
|
47
|
-
export type ChartFrameProps = BasaltProps & {
|
|
48
|
-
/** Series identity — drives the derived legend. Pass the SAME array the kind draws + tooltips from. */
|
|
49
|
-
series: readonly SeriesStyle[];
|
|
50
|
-
/**
|
|
51
|
-
* Height in pixels, or one per container step. Used when neither `aspectRatio` nor `fill` is set.
|
|
52
|
-
* Default: derived from the measured width and container class (`resolveChartLayout`). Inside a
|
|
53
|
-
* `ChartCard` the resulting height is a MINIMUM — the frame grows into a taller card body. Passing it WITH `fill` is a wiring mistake, not a fallback — `fill` wins and
|
|
54
|
-
* this is never read, which now warns once in dev (`common/errors.ts`' `ignoredProp`).
|
|
55
|
-
*
|
|
56
|
-
* `{ base: 180, wide: 260 }` is the declarative escape from a page of fixed-height charts: the
|
|
57
|
-
* `regular`/`wide` steps are compared against the frame's own MEASURED width, not the viewport,
|
|
58
|
-
* so a chart squeezed by a `PageAside` gets the short height on a desktop too. A plain number is
|
|
59
|
-
* an override and stays supported ({@link resolveFrameHeight}); one that leaves the plot under
|
|
60
|
-
* `VX.minPlotHeight` warns once in dev.
|
|
61
|
-
*/
|
|
62
|
-
height?: number | ResponsiveChartHeight;
|
|
63
|
-
/** height = Math.round(containerWidth / aspectRatio). Ignored when `fill` is set — which warns
|
|
64
|
-
* once in dev, for the same reason `height` does. */
|
|
65
|
-
aspectRatio?: number;
|
|
66
|
-
/** Fill the parent flex/grid cell's measured height instead of a fixed/derived one. */
|
|
67
|
-
fill?: boolean;
|
|
68
|
-
/** First-frame width floor before the container is measured. Default 200. */
|
|
69
|
-
minWidth?: number;
|
|
70
|
-
/** Namespaces `ChartLegend`'s `split` swatch clipPath ids across multiple charts on one page. */
|
|
71
|
-
chartId?: string;
|
|
72
|
-
/** `false` only for the sparkline exemption — every other chart gets a legend by default. */
|
|
73
|
-
legend?: ChartFrameLegend | false;
|
|
74
|
-
/**
|
|
75
|
-
* The query behind this chart hasn't resolved yet. Renders `ChartPending` (see its JSDoc for the
|
|
76
|
-
* three-state "nothing to draw" rationale) over the full plot rect in place of `children`,
|
|
77
|
-
* suppresses the legend entirely (a legend naming a series with nothing yet to point at is its
|
|
78
|
-
* own small lie), and marks the outer container `aria-busy="true"`.
|
|
79
|
-
*
|
|
80
|
-
* An alias for `state={{ pending: true }}` and staying that way — it predates {@link ChartState}
|
|
81
|
-
* and every kind forwards it.
|
|
82
|
-
*/
|
|
83
|
-
isPending?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* The three "nothing to draw" states in one prop — the shape a query result already has. Wins
|
|
86
|
-
* over `isPending`, which stays a supported alias for `state={{ pending: true }}`. Precedence is
|
|
87
|
-
* pending → error → empty ({@link resolveChartState}); each renders its own placeholder over the
|
|
88
|
-
* full plot rect in place of `children` and suppresses the legend, and only `pending` marks the
|
|
89
|
-
* container `aria-busy`.
|
|
90
|
-
*/
|
|
91
|
-
state?: ChartState;
|
|
92
|
-
/**
|
|
93
|
-
* Accessible text alternative for the chart, applied as `aria-label` (+ `role="group"`) on the
|
|
94
|
-
* outer container so screen readers announce something other than an unlabeled graphic. Every
|
|
95
|
-
* kind composing `ChartFrame` should accept and forward this from its own props.
|
|
96
|
-
*
|
|
97
|
-
* MUST stay `role="group"`, never `role="img"`. Per the ARIA spec, every descendant of an
|
|
98
|
-
* `role="img"` element is presentational, which erases the `HoverOverlay`'s `role="slider"` from
|
|
99
|
-
* the accessibility tree entirely — a screen reader announces the label and then the
|
|
100
|
-
* keyboard-scrubbable slider underneath it is simply unreachable, silently, with no error
|
|
101
|
-
* anywhere. `role="group"` announces the same label while keeping descendants exposed. Do not
|
|
102
|
-
* "simplify" this back to `img` — it looks like a no-op refactor and it is not.
|
|
103
|
-
*/
|
|
104
|
-
ariaLabel?: string;
|
|
105
|
-
/** Draw the SVG marks given the plot rect that already excludes the legend band, plus the set
|
|
106
|
-
* of series keys the legend has toggled off. */
|
|
107
|
-
children: (plot: PlotRect) => ReactNode;
|
|
108
|
-
};
|
|
109
|
-
/** What `ChartFrame` hands its child: the resolved plot rect plus legend-toggle state. */
|
|
110
|
-
export type PlotRect = {
|
|
111
|
-
width: number;
|
|
112
|
-
height: number;
|
|
113
|
-
hidden: ReadonlySet<string>;
|
|
114
|
-
/** Whether THIS frame's legend is currently portalled into a `ChartCard` header slot — a chart
|
|
115
|
-
* composing `ChartFrame` (e.g. `CartesianChart`'s end labels, R2C-10) reads this to skip a
|
|
116
|
-
* band-legend-only affordance once the header already names every series for free. */
|
|
117
|
-
legendInHeader: boolean;
|
|
118
|
-
};
|
|
119
|
-
/** A kind's own hover-dim wiring, merged into the resolved `ChartFrameLegend`. Kinds without
|
|
120
|
-
* per-series highlight state (single-series `ZonedLine`, `DualPanel`) omit this. */
|
|
121
|
-
export type ChartFrameLegendHover = {
|
|
122
|
-
highlighted: string | null;
|
|
123
|
-
onHighlight: (key: string | null) => void;
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* Merges a kind's consumer-facing {@link ChartLegendConfig} (the `legend` prop every kind exposes)
|
|
127
|
-
* with the kind's own hover-dim wiring into the `ChartFrame`-facing {@link ChartFrameLegend}. This
|
|
128
|
-
* is the one merge every kind performs: consumer `placement`/`groups`/`maxRows` (or the defaults)
|
|
129
|
-
* plus the kind's `highlighted`/`onHighlight`, which a consumer may not set directly.
|
|
130
|
-
* `config === false` disables the legend regardless of `hover` (the sparkline escape).
|
|
131
|
-
*
|
|
132
|
-
* A single-entry legend is pure noise — it only ever restates the chart's own title ("— BTC
|
|
133
|
-
* price" under a chart already titled "BTC price"), costs a legend row of vertical space, and its
|
|
134
|
-
* one toggle can blank the whole plot. So when `seriesCount` is passed, is `<= 1`, AND the caller
|
|
135
|
-
* passed no explicit config (`undefined` — NOT `{}`, which is a deliberate opt-in), the legend is
|
|
136
|
-
* suppressed automatically. `config === undefined` is the load-bearing check: a kind that composes
|
|
137
|
-
* `ChartFrame` directly without threading `seriesCount` through (e.g. `DualPanel`) simply omits
|
|
138
|
-
* the third argument and keeps today's behaviour.
|
|
139
|
-
*/
|
|
140
|
-
export declare function resolveLegend(config: ChartLegendConfig | false | undefined, hover?: ChartFrameLegendHover, seriesCount?: number): ChartFrameLegend | false;
|
|
141
|
-
/**
|
|
142
|
-
* The measuring, legend-owning shell every non-sparkline chart composes. Supersedes
|
|
143
|
-
* `ResponsiveChart`'s job and adds the two things it lacked: it observes height (via
|
|
144
|
-
* `useChartSize`, which already measures it) and it reserves the legend band out of the plot
|
|
145
|
-
* rect via a second, independent `useChartSize` on the legend's own wrapper div. The legend
|
|
146
|
-
* `<div>` wraps (`ChartLegend`'s `flexWrap`), so its measured band grows as entries wrap and the
|
|
147
|
-
* plot shrinks accordingly — the plot can never overlap the legend because the legend's measured
|
|
148
|
-
* band is always subtracted first. It also can never shrink to nothing: {@link resolvePlotRect}
|
|
149
|
-
* floors it at `VX.minPlotHeight` and the frame grows, or under `fill` the legend rolls up
|
|
150
|
-
* ({@link legendEntryCap}).
|
|
151
|
-
*
|
|
152
|
-
* Layout-only: it does not know lines from bars (that stays in the kind), so it is not a
|
|
153
|
-
* Recharts god-component. Render the child only when the resolved plot rect is non-empty.
|
|
154
|
-
*/
|
|
155
|
-
export declare function ChartFrame({ series, height, aspectRatio, fill, minWidth, chartId, legend, ariaLabel, isPending, state, className, style, children, }: ChartFrameProps): ReactNode;
|
|
156
|
-
//# sourceMappingURL=ChartFrame.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChartFrame.d.ts","sourceRoot":"","sources":["../../../src/charts/primitives/ChartFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAarD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIhF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAIjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD;qGACqG;AACrG,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3F,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAIjE;0EAC0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,wBAAwB;IACxB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC1C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,uGAAuG;IACvG,MAAM,EAAE,SAAS,WAAW,EAAE,CAAA;IAC9B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAAA;IACvC;yDACqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uFAAuF;IACvF,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,gBAAgB,GAAG,KAAK,CAAA;IACjC;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;oDACgD;IAChD,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,SAAS,CAAA;CACxC,CAAA;AAED,0FAA0F;AAC1F,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3B;;0FAEsF;IACtF,cAAc,EAAE,OAAO,CAAA;CACxB,CAAA;AAcD;oFACoF;AACpF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,iBAAiB,GAAG,KAAK,GAAG,SAAS,EAC7C,KAAK,CAAC,EAAE,qBAAqB,EAC7B,WAAW,CAAC,EAAE,MAAM,GACnB,gBAAgB,GAAG,KAAK,CAU1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,MAAM,EACN,WAAW,EACX,IAAY,EACZ,QAA4B,EAC5B,OAAO,EACP,MAAW,EACX,SAAS,EACT,SAAiB,EACjB,KAAK,EACL,SAAS,EACT,KAAK,EACL,QAAQ,GACT,EAAE,eAAe,GAAG,SAAS,CA6Q7B"}
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useContext, useId, useLayoutEffect, useMemo, useState } from "react";
|
|
3
|
-
import { createPortal } from "react-dom";
|
|
4
|
-
import {
|
|
5
|
-
deprecatedProp,
|
|
6
|
-
ignoredProp,
|
|
7
|
-
legendSlotContention,
|
|
8
|
-
plotBelowFloor
|
|
9
|
-
} from "../../common/errors.js";
|
|
10
|
-
import { useCoarsePointer } from "../../common/use-media-query.js";
|
|
11
|
-
import { reportOnce, useValidateProps } from "../../common/validate.js";
|
|
12
|
-
import { SizeClassHintContext, useSizeClass } from "../../shell/use-size-class.js";
|
|
13
|
-
import { VX } from "../../tokens/index.js";
|
|
14
|
-
import { useChartSize } from "../hooks/useChartSize.js";
|
|
15
|
-
import { deriveLegend } from "../series.js";
|
|
16
|
-
import { ChartCardContext } from "./chart-card-context.js";
|
|
17
|
-
import { resolveChartLayout, resolveFrameClass } from "./chart-layout.js";
|
|
18
|
-
import { resolveFrameHeight, resolveLegendRollup, resolvePlotRect } from "./chart-frame-layout.js";
|
|
19
|
-
import { ChartTierProvider, useViewportHeight } from "./chart-tier.js";
|
|
20
|
-
import { ChartLegend } from "./ChartLegend.js";
|
|
21
|
-
import { ChartEmpty, ChartError, ChartPending, resolveChartState } from "./ChartPending.js";
|
|
22
|
-
import { legendEntryCap, resolveLegendRollup as resolveLegendRollup2, resolvePlotRect as resolvePlotRect2 } from "./chart-frame-layout.js";
|
|
23
|
-
const DEFAULT_MIN_WIDTH = 200;
|
|
24
|
-
const outerStyle = (fill, vertical) => ({
|
|
25
|
-
width: "100%",
|
|
26
|
-
height: fill ? "100%" : void 0,
|
|
27
|
-
display: "flex",
|
|
28
|
-
flexDirection: vertical ? "row" : "column"
|
|
29
|
-
});
|
|
30
|
-
const legendWrapperStyle = (vertical) => ({
|
|
31
|
-
flexShrink: 0,
|
|
32
|
-
width: vertical ? void 0 : "100%"
|
|
33
|
-
});
|
|
34
|
-
function resolveLegend(config, hover, seriesCount) {
|
|
35
|
-
if (config === false) return false;
|
|
36
|
-
if (config === void 0 && seriesCount !== void 0 && seriesCount <= 1) return false;
|
|
37
|
-
return {
|
|
38
|
-
placement: config?.placement ?? "bottom",
|
|
39
|
-
...config?.groups !== void 0 && { groups: config.groups },
|
|
40
|
-
...config?.maxRows !== void 0 && { maxRows: config.maxRows },
|
|
41
|
-
...config?.toggle !== void 0 && { toggle: config.toggle },
|
|
42
|
-
...hover !== void 0 && { highlighted: hover.highlighted, onHighlight: hover.onHighlight }
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function ChartFrame({
|
|
46
|
-
series,
|
|
47
|
-
height,
|
|
48
|
-
aspectRatio,
|
|
49
|
-
fill = false,
|
|
50
|
-
minWidth = DEFAULT_MIN_WIDTH,
|
|
51
|
-
chartId,
|
|
52
|
-
legend = {},
|
|
53
|
-
ariaLabel,
|
|
54
|
-
isPending = false,
|
|
55
|
-
state,
|
|
56
|
-
className,
|
|
57
|
-
style,
|
|
58
|
-
children
|
|
59
|
-
}) {
|
|
60
|
-
const { ref: containerRef, width: containerW, height: containerH } = useChartSize();
|
|
61
|
-
const { ref: legendRef, width: legendW, height: legendH } = useChartSize();
|
|
62
|
-
const { ref: slotRef, width: slotMeasuredW } = useChartSize();
|
|
63
|
-
const {
|
|
64
|
-
inCard,
|
|
65
|
-
legendSlot,
|
|
66
|
-
short: cardShort,
|
|
67
|
-
legendClaimants,
|
|
68
|
-
dispatchLegendSlot
|
|
69
|
-
} = useContext(ChartCardContext);
|
|
70
|
-
const frameId = useId();
|
|
71
|
-
const [slotSeedW, setSlotSeedW] = useState(0);
|
|
72
|
-
const placement = legend === false ? "bottom" : legend.placement ?? "bottom";
|
|
73
|
-
const vertical = placement === "left" || placement === "right";
|
|
74
|
-
const wantsHeaderSlot = legendSlot !== null && legend !== false && legend.headerSlot !== false && !vertical;
|
|
75
|
-
const resolvedState = resolveChartState({ ...state !== void 0 && { state }, isPending });
|
|
76
|
-
const legendVisible = legend !== false && resolvedState === null;
|
|
77
|
-
const ownsSlot = wantsHeaderSlot && legendClaimants[0] === frameId;
|
|
78
|
-
const slotDenied = wantsHeaderSlot && !ownsSlot && legendClaimants.includes(frameId);
|
|
79
|
-
useLayoutEffect(() => {
|
|
80
|
-
if (!wantsHeaderSlot) return void 0;
|
|
81
|
-
dispatchLegendSlot({ type: "claim", id: frameId });
|
|
82
|
-
return () => dispatchLegendSlot({ type: "release", id: frameId });
|
|
83
|
-
}, [wantsHeaderSlot, frameId, dispatchLegendSlot]);
|
|
84
|
-
useLayoutEffect(() => {
|
|
85
|
-
if (slotDenied && legendVisible) reportOnce("ChartFrame", legendSlotContention("ChartFrame"));
|
|
86
|
-
}, [slotDenied, legendVisible]);
|
|
87
|
-
useLayoutEffect(() => {
|
|
88
|
-
if (!ownsSlot || legendSlot === null) return void 0;
|
|
89
|
-
setSlotSeedW(legendSlot.getBoundingClientRect().width);
|
|
90
|
-
slotRef(legendSlot);
|
|
91
|
-
return () => {
|
|
92
|
-
slotRef(null);
|
|
93
|
-
setSlotSeedW(0);
|
|
94
|
-
};
|
|
95
|
-
}, [ownsSlot, legendSlot, slotRef]);
|
|
96
|
-
const viewportClass = useSizeClass();
|
|
97
|
-
const sizeClass = useContext(SizeClassHintContext) === void 0 ? "medium" : viewportClass;
|
|
98
|
-
const coarse = useCoarsePointer();
|
|
99
|
-
const viewportH = useViewportHeight();
|
|
100
|
-
const [hidden, setHidden] = useState(() => /* @__PURE__ */ new Set());
|
|
101
|
-
const toggleKey = useCallback((key) => {
|
|
102
|
-
setHidden((prev) => {
|
|
103
|
-
const next = new Set(prev);
|
|
104
|
-
if (next.has(key)) next.delete(key);
|
|
105
|
-
else next.add(key);
|
|
106
|
-
return next;
|
|
107
|
-
});
|
|
108
|
-
}, []);
|
|
109
|
-
useValidateProps(
|
|
110
|
-
"ChartFrame",
|
|
111
|
-
() => [
|
|
112
|
-
fill && height !== void 0 ? ignoredProp(
|
|
113
|
-
"ChartFrame",
|
|
114
|
-
"height",
|
|
115
|
-
"`fill` is set \u2014 a fill frame takes its parent cell's measured height. Pass one or the other."
|
|
116
|
-
) : null,
|
|
117
|
-
fill && aspectRatio !== void 0 ? ignoredProp(
|
|
118
|
-
"ChartFrame",
|
|
119
|
-
"aspectRatio",
|
|
120
|
-
"`fill` is set \u2014 a fill frame takes its parent cell's measured height. Pass one or the other."
|
|
121
|
-
) : null
|
|
122
|
-
],
|
|
123
|
-
[fill, height, aspectRatio]
|
|
124
|
-
);
|
|
125
|
-
const legendItems = legend === false ? [] : deriveLegend(series);
|
|
126
|
-
useValidateProps(
|
|
127
|
-
"ChartFrame",
|
|
128
|
-
() => (
|
|
129
|
-
// A cap covering every entry rolls nothing up — it is how `Donut` states "never roll up".
|
|
130
|
-
legend !== false && legend.maxRows !== void 0 && legend.maxRows < legendItems.length ? deprecatedProp(
|
|
131
|
-
"ChartFrame",
|
|
132
|
-
"legend.maxRows",
|
|
133
|
-
"nothing (the legend fits by measured width)",
|
|
134
|
-
"1.32.0",
|
|
135
|
-
`Its UNIT changed from rows to entries: \`maxRows: ${legend.maxRows}\` is now read as a cap of ${legend.maxRows} legend ENTRIES (not rows), with the rest folded into an \`All N\` disclosure. An explicit value still wins this release.`
|
|
136
|
-
) : null
|
|
137
|
-
),
|
|
138
|
-
[legend, legendItems.length]
|
|
139
|
-
);
|
|
140
|
-
const statedHeight = height === void 0 ? void 0 : resolveFrameHeight(height, resolveFrameClass({ frameW: containerW, sizeClass }));
|
|
141
|
-
const slotW = ownsSlot ? Math.max(slotMeasuredW, slotSeedW) : 0;
|
|
142
|
-
const groups = legend !== false && legend.groups === true;
|
|
143
|
-
const legendKey = legendItems.map((item) => `${item.key}\0${item.label}\0${item.role ?? ""}\0${item.note ?? ""}`).join("");
|
|
144
|
-
const layout = useMemo(
|
|
145
|
-
() => resolveChartLayout({
|
|
146
|
-
frameW: containerW,
|
|
147
|
-
slotW,
|
|
148
|
-
viewportH,
|
|
149
|
-
legendItems,
|
|
150
|
-
sizeClass,
|
|
151
|
-
coarse,
|
|
152
|
-
cardShort,
|
|
153
|
-
groups,
|
|
154
|
-
...statedHeight !== void 0 && { override: { height: statedHeight } }
|
|
155
|
-
}),
|
|
156
|
-
// `legendItems` is a fresh array per render; `legendKey` is its identity.
|
|
157
|
-
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
158
|
-
[containerW, slotW, viewportH, legendKey, sizeClass, coarse, cardShort, groups, statedHeight]
|
|
159
|
-
);
|
|
160
|
-
const fit = layout.legend.mode === "dots" || layout.legend.mode === "chips" ? layout.legend : null;
|
|
161
|
-
const legendMode = fit?.mode;
|
|
162
|
-
const showLegend = legendVisible && fit !== null;
|
|
163
|
-
const inHeader = showLegend && ownsSlot && fit?.where === "header";
|
|
164
|
-
const sideLegendWidth = showLegend && vertical ? legendW : 0;
|
|
165
|
-
const topBottomLegendHeight = showLegend && !vertical && !inHeader ? legendH : 0;
|
|
166
|
-
const computedHeight = aspectRatio !== void 0 ? Math.round(containerW / aspectRatio) : layout.height;
|
|
167
|
-
const grows = inCard && !fill;
|
|
168
|
-
const resolvedHeight = fill ? containerH : grows ? Math.max(computedHeight, containerH) : computedHeight;
|
|
169
|
-
const cardMinHeight = Math.max(computedHeight, VX.minPlotHeight + topBottomLegendHeight);
|
|
170
|
-
useValidateProps(
|
|
171
|
-
"ChartFrame",
|
|
172
|
-
() => typeof height === "number" && !fill && aspectRatio === void 0 && height - topBottomLegendHeight < VX.minPlotHeight ? plotBelowFloor("ChartFrame", height, VX.minPlotHeight) : null,
|
|
173
|
-
[height, fill, aspectRatio, topBottomLegendHeight]
|
|
174
|
-
);
|
|
175
|
-
const togglable = legend !== false && (legend.toggle ?? legendItems.length > 1);
|
|
176
|
-
const { maxRows, legendWins } = resolveLegendRollup({
|
|
177
|
-
...legend !== false && legend.maxRows !== void 0 && { statedMaxRows: legend.maxRows },
|
|
178
|
-
...!vertical && fit !== null && fit.overflow > 0 && { fittedMaxRows: fit.visible },
|
|
179
|
-
fillBand: showLegend && fill && !inHeader && !vertical,
|
|
180
|
-
items: legendItems,
|
|
181
|
-
containerW,
|
|
182
|
-
available: resolvedHeight - VX.minPlotHeight
|
|
183
|
-
});
|
|
184
|
-
const plot = resolvePlotRect({
|
|
185
|
-
containerW,
|
|
186
|
-
resolvedHeight,
|
|
187
|
-
minWidth,
|
|
188
|
-
sideLegendWidth,
|
|
189
|
-
topBottomLegendHeight,
|
|
190
|
-
...legendWins && { legendWins }
|
|
191
|
-
});
|
|
192
|
-
const legendNode = legend === false || resolvedState !== null || !showLegend ? null : /* @__PURE__ */ jsx("div", { ref: legendRef, style: legendWrapperStyle(vertical), children: /* @__PURE__ */ jsx(
|
|
193
|
-
ChartLegend,
|
|
194
|
-
{
|
|
195
|
-
items: legendItems,
|
|
196
|
-
placement,
|
|
197
|
-
hidden,
|
|
198
|
-
...togglable && { onToggle: toggleKey },
|
|
199
|
-
...chartId !== void 0 && { chartId },
|
|
200
|
-
...legend.groups !== void 0 && { groups: legend.groups },
|
|
201
|
-
...maxRows !== void 0 && { maxRows },
|
|
202
|
-
...legendMode !== void 0 && { mode: legendMode },
|
|
203
|
-
...legend.highlighted !== void 0 && { highlighted: legend.highlighted },
|
|
204
|
-
...legend.onHighlight !== void 0 && { onHighlight: legend.onHighlight }
|
|
205
|
-
}
|
|
206
|
-
) });
|
|
207
|
-
return /* @__PURE__ */ jsx(ChartTierProvider, { containerClass: layout.containerClass, children: /* @__PURE__ */ jsxs(
|
|
208
|
-
"div",
|
|
209
|
-
{
|
|
210
|
-
ref: containerRef,
|
|
211
|
-
...className !== void 0 && { className },
|
|
212
|
-
style: {
|
|
213
|
-
...outerStyle(fill, vertical),
|
|
214
|
-
...grows && { flex: "1 1 0", minHeight: cardMinHeight },
|
|
215
|
-
...style
|
|
216
|
-
},
|
|
217
|
-
...ariaLabel !== void 0 && { role: "group", "aria-label": ariaLabel },
|
|
218
|
-
...resolvedState === "pending" && { "aria-busy": "true" },
|
|
219
|
-
children: [
|
|
220
|
-
inHeader && legendNode !== null && legendSlot !== null && createPortal(legendNode, legendSlot),
|
|
221
|
-
!inHeader && legendNode !== null && (placement === "top" || placement === "left") && legendNode,
|
|
222
|
-
plot.width > 0 && plot.height > 0 && (resolvedState === "pending" ? /* @__PURE__ */ jsx(ChartPending, { width: plot.width, height: plot.height }) : resolvedState === "error" ? /* @__PURE__ */ jsx(ChartError, { width: plot.width, height: plot.height, error: state?.error }) : resolvedState === "empty" ? /* @__PURE__ */ jsx(
|
|
223
|
-
ChartEmpty,
|
|
224
|
-
{
|
|
225
|
-
width: plot.width,
|
|
226
|
-
height: plot.height,
|
|
227
|
-
...typeof state?.empty === "string" && { label: state.empty }
|
|
228
|
-
}
|
|
229
|
-
) : children({ ...plot, hidden, legendInHeader: inHeader })),
|
|
230
|
-
!inHeader && legendNode !== null && (placement === "bottom" || placement === "right") && legendNode
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
) });
|
|
234
|
-
}
|
|
235
|
-
export {
|
|
236
|
-
ChartFrame,
|
|
237
|
-
legendEntryCap,
|
|
238
|
-
resolveLegend,
|
|
239
|
-
resolveLegendRollup2 as resolveLegendRollup,
|
|
240
|
-
resolvePlotRect2 as resolvePlotRect
|
|
241
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { BasaltProps } from '../../common/props.js';
|
|
2
|
-
import type { SeriesRole, LegendPlacement } from '../series.js';
|
|
3
|
-
export type LegendEntry = {
|
|
4
|
-
key: string;
|
|
5
|
-
label: string;
|
|
6
|
-
color: string;
|
|
7
|
-
secondColor?: string;
|
|
8
|
-
strokeWidth?: number;
|
|
9
|
-
shape?: 'line' | 'bar' | 'split' | 'splitLine';
|
|
10
|
-
/** Render line-style swatches as dashed (only applies to 'line' / 'splitLine'). */
|
|
11
|
-
dashed?: boolean;
|
|
12
|
-
/** bar swatch opacity — honored instead of a hardcoded value, so it cannot lie about the fill. */
|
|
13
|
-
fillOpacity?: number;
|
|
14
|
-
/** line/splitLine swatch stroke opacity — parity with `fillOpacity` above, so a dimmed
|
|
15
|
-
* companion line's swatch cannot lie about its own opacity either. */
|
|
16
|
-
strokeOpacity?: number;
|
|
17
|
-
/** Drives `groups` rendering (series → hairline divider → overlay → reference). */
|
|
18
|
-
role?: SeriesRole;
|
|
19
|
-
/** Companions folded under this entry via `parent` (`deriveLegend`) — rendered as compact,
|
|
20
|
-
* subordinate sub-entries beside the parent's label instead of vanishing. */
|
|
21
|
-
children?: LegendEntry[];
|
|
22
|
-
/** Short qualifier rendered after the label in muted text — e.g. a flat-at-zero series that is
|
|
23
|
-
* invisible in the plot. */
|
|
24
|
-
note?: string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Shared legend for all non-sparkline charts. `highlighted`/`onHighlight` are optional — omit for
|
|
28
|
-
* static legends without hover interactivity. `chartId` namespaces `split` clipPath ids so two
|
|
29
|
-
* legends on the same page never collide. `groups` renders series → hairline divider → overlay →
|
|
30
|
-
* reference bands instead of one flat smear. `maxRows` caps the number of rendered ENTRIES and
|
|
31
|
-
* rolls the remainder into an `All N` disclosure chip — it is an entry count, not a row count, in
|
|
32
|
-
* spite of the name (`entries.slice(0, cap)` below is the whole of it). `ChartFrame` derives the
|
|
33
|
-
* cap from the measured fit (`resolveChartLayout().legend`); a caller-stated value wins.
|
|
34
|
-
*
|
|
35
|
-
* `onToggle` makes an entry a real toggle: clicking it hides the series in the plot, the tooltip,
|
|
36
|
-
* and the auto y-domain together (`ChartFrame` owns the `hidden` set — see `docs/CHARTS-SPEC.md`
|
|
37
|
-
* §5). A hidden entry is announced via `aria-pressed`.
|
|
38
|
-
*
|
|
39
|
-
* **The rollup is a disclosure, not a label.** `All N` is a `<button>` carrying `aria-expanded`
|
|
40
|
-
* that opens EVERY entry, toggles included, in a popover under the chip on a fine pointer and a
|
|
41
|
-
* bottom sheet on a coarse one. Both are fixed-position and portalled, so opening one never grows
|
|
42
|
-
* the legend band or moves the plot. Escape, an outside press, a scroll or a resize closes it, and
|
|
43
|
-
* focus returns to the chip on every close.
|
|
44
|
-
*/
|
|
45
|
-
export declare function ChartLegend({ items, highlighted, onHighlight, hidden, onToggle, chartId, placement, groups, maxRows, mode, className, style, }: BasaltProps & {
|
|
46
|
-
items: LegendEntry[];
|
|
47
|
-
highlighted?: string | null;
|
|
48
|
-
onHighlight?: (key: string | null) => void;
|
|
49
|
-
/** Keys currently toggled off. */
|
|
50
|
-
hidden?: ReadonlySet<string>;
|
|
51
|
-
/** Present = entries are clickable toggles. */
|
|
52
|
-
onToggle?: (key: string) => void;
|
|
53
|
-
chartId?: string;
|
|
54
|
-
placement?: LegendPlacement;
|
|
55
|
-
groups?: boolean;
|
|
56
|
-
maxRows?: number;
|
|
57
|
-
/**
|
|
58
|
-
* `'dots'` collapses every VISIBLE entry to a plain color dot with no label (the name still
|
|
59
|
-
* reaches assistive tech via `aria-label`) — `resolveChartLayout`'s header-slot legend forces
|
|
60
|
-
* this for a short `ChartCard` (wave 11, `docs/CHARTS-SPEC.md` §5) so the legend band's height and
|
|
61
|
-
* width both shrink before it eats plot space. The `All N` disclosure panel is unaffected: it
|
|
62
|
-
* always shows the full swatch + label, `mode` only governs the inline row. Default `'chips'`
|
|
63
|
-
* (today's swatch + label rendering) for every other caller.
|
|
64
|
-
*/
|
|
65
|
-
mode?: 'dots' | 'chips';
|
|
66
|
-
}): import("react").JSX.Element;
|
|
67
|
-
//# sourceMappingURL=ChartLegend.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../../src/charts/primitives/ChartLegend.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAK5D,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,CAAA;IAC9C,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,kGAAkG;IAClG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;0EACsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mFAAmF;IACnF,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB;iFAC6E;IAC7E,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB;gCAC4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAsOD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,WAAkB,EAClB,WAAW,EACX,MAAkB,EAClB,QAAQ,EACR,OAAY,EACZ,SAAoB,EACpB,MAAc,EACd,OAAO,EACP,IAAc,EACd,SAAS,EACT,KAAK,GACN,EAAE,WAAW,GAAG;IACf,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC1C,kCAAkC;IAClC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC5B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACxB,+BA2GA"}
|