basalt-ui 0.4.2 → 1.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 +70 -0
- package/CHANGELOG.md +199 -41
- package/LICENSE +201 -0
- package/README.md +434 -160
- package/agent/rules/basalt-agent.md +395 -0
- package/agent/rules/basalt-charts.md +170 -0
- package/agent/rules/basalt-commands.md +320 -0
- package/agent/rules/basalt-content.md +390 -0
- package/agent/rules/basalt-data.md +237 -0
- package/agent/rules/basalt-forms.md +186 -0
- package/agent/rules/basalt-mantine.md +327 -0
- package/agent/rules/basalt-notifications.md +264 -0
- package/agent/rules/basalt-query.md +130 -0
- package/agent/rules/basalt-router.md +173 -0
- package/agent/rules/basalt-state.md +99 -0
- package/agent/rules/basalt-tokens.md +148 -0
- package/agent/templates/CLAUDE-block.md.tpl +35 -0
- package/agent/templates/DESIGN.md.tpl +71 -0
- package/agent/templates/__root.tpl +31 -0
- package/agent/templates/query-client.ts.tpl +12 -0
- package/bin/basalt.mjs +14 -0
- package/configs/check.yml +29 -0
- package/configs/lefthook.yml +21 -0
- package/configs/oxfmt.json +8 -0
- package/configs/oxlint-plugin.js +269 -0
- package/configs/oxlint-plugin.test.ts +107 -0
- package/configs/oxlint.json +116 -0
- package/configs/tsconfig.base.json +20 -0
- package/configs/tsconfig.node.json +8 -0
- package/configs/tsconfig.react-app.json +8 -0
- package/dist/agent/ai-sdk-transport.d.ts +85 -0
- package/dist/agent/ai-sdk-transport.d.ts.map +1 -0
- package/dist/agent/ai-sdk-transport.js +109 -0
- package/dist/agent/history.d.ts +55 -0
- package/dist/agent/history.d.ts.map +1 -0
- package/dist/agent/history.js +32 -0
- package/dist/agent/index.d.ts +53 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +23 -0
- package/dist/agent/outcome.d.ts +71 -0
- package/dist/agent/outcome.d.ts.map +1 -0
- package/dist/agent/outcome.js +30 -0
- package/dist/agent/part-list.d.ts +75 -0
- package/dist/agent/part-list.d.ts.map +1 -0
- package/dist/agent/part-list.js +127 -0
- package/dist/agent/parts.d.ts +91 -0
- package/dist/agent/parts.d.ts.map +1 -0
- package/dist/agent/parts.js +49 -0
- package/dist/agent/stick-to-bottom.d.ts +23 -0
- package/dist/agent/stick-to-bottom.d.ts.map +1 -0
- package/dist/agent/stick-to-bottom.js +73 -0
- package/dist/agent/thread.d.ts +124 -0
- package/dist/agent/thread.d.ts.map +1 -0
- package/dist/agent/thread.js +131 -0
- package/dist/agent/transport.d.ts +87 -0
- package/dist/agent/transport.d.ts.map +1 -0
- package/dist/agent/transport.js +21 -0
- package/dist/agent/use-agent-stream.d.ts +34 -0
- package/dist/agent/use-agent-stream.d.ts.map +1 -0
- package/dist/agent/use-agent-stream.js +56 -0
- package/dist/agent/use-agent-thread-runs.d.ts +72 -0
- package/dist/agent/use-agent-thread-runs.d.ts.map +1 -0
- package/dist/agent/use-agent-thread-runs.js +217 -0
- package/dist/agent-chat/composer.d.ts +18 -0
- package/dist/agent-chat/composer.d.ts.map +1 -0
- package/dist/agent-chat/composer.js +86 -0
- package/dist/agent-chat/index.d.ts +24 -0
- package/dist/agent-chat/index.d.ts.map +1 -0
- package/dist/agent-chat/index.js +15 -0
- package/dist/agent-chat/thread-detail-panel.d.ts +27 -0
- package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -0
- package/dist/agent-chat/thread-detail-panel.js +108 -0
- package/dist/agent-chat/thread-feed.d.ts +18 -0
- package/dist/agent-chat/thread-feed.d.ts.map +1 -0
- package/dist/agent-chat/thread-feed.js +42 -0
- package/dist/agent-chat/thread-message.d.ts +31 -0
- package/dist/agent-chat/thread-message.d.ts.map +1 -0
- package/dist/agent-chat/thread-message.js +128 -0
- package/dist/agent-chat/thread-outcome-card.d.ts +19 -0
- package/dist/agent-chat/thread-outcome-card.d.ts.map +1 -0
- package/dist/agent-chat/thread-outcome-card.js +120 -0
- package/dist/agent-chat/thread-workspace.d.ts +27 -0
- package/dist/agent-chat/thread-workspace.d.ts.map +1 -0
- package/dist/agent-chat/thread-workspace.js +95 -0
- package/dist/charts/hooks/useChartSize.d.ts +25 -0
- package/dist/charts/hooks/useChartSize.d.ts.map +1 -0
- package/dist/charts/hooks/useChartSize.js +8 -0
- package/dist/charts/hooks/useChartTooltip.d.ts +13 -0
- package/dist/charts/hooks/useChartTooltip.d.ts.map +1 -0
- package/dist/charts/hooks/useChartTooltip.js +26 -0
- package/dist/charts/hooks/useHoverSync.d.ts +30 -0
- package/dist/charts/hooks/useHoverSync.d.ts.map +1 -0
- package/dist/charts/hooks/useHoverSync.js +70 -0
- package/dist/charts/hover-context.d.ts +21 -0
- package/dist/charts/hover-context.d.ts.map +1 -0
- package/dist/charts/hover-context.js +12 -0
- package/dist/charts/hover-sync.d.ts +14 -0
- package/dist/charts/hover-sync.d.ts.map +1 -0
- package/dist/charts/hover-sync.js +17 -0
- package/dist/charts/index.d.ts +47 -0
- package/dist/charts/index.d.ts.map +1 -0
- package/dist/charts/index.js +129 -0
- package/dist/charts/kinds/Bars.d.ts +129 -0
- package/dist/charts/kinds/Bars.d.ts.map +1 -0
- package/dist/charts/kinds/Bars.js +467 -0
- package/dist/charts/kinds/Donut.d.ts +65 -0
- package/dist/charts/kinds/Donut.d.ts.map +1 -0
- package/dist/charts/kinds/Donut.js +158 -0
- package/dist/charts/kinds/DualPanel.d.ts +67 -0
- package/dist/charts/kinds/DualPanel.d.ts.map +1 -0
- package/dist/charts/kinds/DualPanel.js +326 -0
- package/dist/charts/kinds/Heatmap.d.ts +59 -0
- package/dist/charts/kinds/Heatmap.d.ts.map +1 -0
- package/dist/charts/kinds/Heatmap.js +175 -0
- package/dist/charts/kinds/MultiLine.d.ts +73 -0
- package/dist/charts/kinds/MultiLine.d.ts.map +1 -0
- package/dist/charts/kinds/MultiLine.js +275 -0
- package/dist/charts/kinds/StackedArea.d.ts +35 -0
- package/dist/charts/kinds/StackedArea.d.ts.map +1 -0
- package/dist/charts/kinds/StackedArea.js +151 -0
- package/dist/charts/kinds/ZonedLine.d.ts +94 -0
- package/dist/charts/kinds/ZonedLine.d.ts.map +1 -0
- package/dist/charts/kinds/ZonedLine.js +218 -0
- package/dist/charts/primitives/AreaGradient.d.ts +18 -0
- package/dist/charts/primitives/AreaGradient.d.ts.map +1 -0
- package/dist/charts/primitives/AreaGradient.js +13 -0
- package/dist/charts/primitives/Axes.d.ts +22 -0
- package/dist/charts/primitives/Axes.d.ts.map +1 -0
- package/dist/charts/primitives/Axes.js +79 -0
- package/dist/charts/primitives/ChartCard.d.ts +14 -0
- package/dist/charts/primitives/ChartCard.d.ts.map +1 -0
- package/dist/charts/primitives/ChartCard.js +144 -0
- package/dist/charts/primitives/ChartFrame.d.ts +70 -0
- package/dist/charts/primitives/ChartFrame.d.ts.map +1 -0
- package/dist/charts/primitives/ChartFrame.js +77 -0
- package/dist/charts/primitives/ChartLegend.d.ts +36 -0
- package/dist/charts/primitives/ChartLegend.d.ts.map +1 -0
- package/dist/charts/primitives/ChartLegend.js +234 -0
- package/dist/charts/primitives/ChartTooltip.d.ts +34 -0
- package/dist/charts/primitives/ChartTooltip.d.ts.map +1 -0
- package/dist/charts/primitives/ChartTooltip.js +134 -0
- package/dist/charts/primitives/Crosshair.d.ts +23 -0
- package/dist/charts/primitives/Crosshair.d.ts.map +1 -0
- package/dist/charts/primitives/Crosshair.js +21 -0
- package/dist/charts/primitives/HoverOverlay.d.ts +9 -0
- package/dist/charts/primitives/HoverOverlay.d.ts.map +1 -0
- package/dist/charts/primitives/HoverOverlay.js +21 -0
- package/dist/charts/primitives/ResponsiveChart.d.ts +45 -0
- package/dist/charts/primitives/ResponsiveChart.d.ts.map +1 -0
- package/dist/charts/primitives/ResponsiveChart.js +24 -0
- package/dist/charts/primitives/ZoneRects.d.ts +38 -0
- package/dist/charts/primitives/ZoneRects.d.ts.map +1 -0
- package/dist/charts/primitives/ZoneRects.js +30 -0
- package/dist/charts/series.d.ts +99 -0
- package/dist/charts/series.d.ts.map +1 -0
- package/dist/charts/series.js +55 -0
- package/dist/charts/sparklines/BarSparkline.d.ts +13 -0
- package/dist/charts/sparklines/BarSparkline.d.ts.map +1 -0
- package/dist/charts/sparklines/BarSparkline.js +33 -0
- package/dist/charts/sparklines/LineSparkline.d.ts +15 -0
- package/dist/charts/sparklines/LineSparkline.d.ts.map +1 -0
- package/dist/charts/sparklines/LineSparkline.js +39 -0
- package/dist/charts/sparklines/index.d.ts +3 -0
- package/dist/charts/sparklines/index.d.ts.map +1 -0
- package/dist/charts/sparklines/index.js +6 -0
- package/dist/charts/theme.d.ts +21 -0
- package/dist/charts/theme.d.ts.map +1 -0
- package/dist/charts/theme.js +30 -0
- package/dist/charts/utils/domain.d.ts +20 -0
- package/dist/charts/utils/domain.d.ts.map +1 -0
- package/dist/charts/utils/domain.js +7 -0
- package/dist/charts/utils/format.d.ts +5 -0
- package/dist/charts/utils/format.d.ts.map +1 -0
- package/dist/charts/utils/format.js +27 -0
- package/dist/charts/utils/ticks.d.ts +5 -0
- package/dist/charts/utils/ticks.d.ts.map +1 -0
- package/dist/charts/utils/ticks.js +18 -0
- package/dist/cli/index.d.ts +273 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +907 -0
- package/dist/commands/ShortcutsHelp.d.ts +17 -0
- package/dist/commands/ShortcutsHelp.d.ts.map +1 -0
- package/dist/commands/ShortcutsHelp.js +64 -0
- package/dist/commands/define-commands.d.ts +140 -0
- package/dist/commands/define-commands.d.ts.map +1 -0
- package/dist/commands/define-commands.js +26 -0
- package/dist/commands/define-overlays.d.ts +134 -0
- package/dist/commands/define-overlays.d.ts.map +1 -0
- package/dist/commands/define-overlays.js +53 -0
- package/dist/commands/index.d.ts +42 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +46 -0
- package/dist/commands/overlays-mount.d.ts +117 -0
- package/dist/commands/overlays-mount.d.ts.map +1 -0
- package/dist/commands/overlays-mount.js +116 -0
- package/dist/commands/projectors.d.ts +152 -0
- package/dist/commands/projectors.d.ts.map +1 -0
- package/dist/commands/projectors.js +87 -0
- package/dist/commands/shortcut-format.d.ts +48 -0
- package/dist/commands/shortcut-format.d.ts.map +1 -0
- package/dist/commands/shortcut-format.js +33 -0
- package/dist/commands/useCommandHotkeys.d.ts +14 -0
- package/dist/commands/useCommandHotkeys.d.ts.map +1 -0
- package/dist/commands/useCommandHotkeys.js +45 -0
- package/dist/connectivity/connectivity-indicator.d.ts +8 -0
- package/dist/connectivity/connectivity-indicator.d.ts.map +1 -0
- package/dist/connectivity/connectivity-indicator.js +203 -0
- package/dist/connectivity/connectivity-provider.d.ts +7 -0
- package/dist/connectivity/connectivity-provider.d.ts.map +1 -0
- package/dist/connectivity/connectivity-provider.js +125 -0
- package/dist/connectivity/index.d.ts +13 -0
- package/dist/connectivity/index.d.ts.map +1 -0
- package/dist/connectivity/index.js +8 -0
- package/dist/connectivity/types.d.ts +36 -0
- package/dist/connectivity/types.d.ts.map +1 -0
- package/dist/connectivity/types.js +0 -0
- package/dist/connectivity/use-connectivity.d.ts +3 -0
- package/dist/connectivity/use-connectivity.d.ts.map +1 -0
- package/dist/connectivity/use-connectivity.js +14 -0
- package/dist/content/article-actions.d.ts +39 -0
- package/dist/content/article-actions.d.ts.map +1 -0
- package/dist/content/article-actions.js +28 -0
- package/dist/content/article-card.d.ts +58 -0
- package/dist/content/article-card.d.ts.map +1 -0
- package/dist/content/article-card.js +76 -0
- package/dist/content/article-card.module.css +109 -0
- package/dist/content/article-card.module.css.d.ts +16 -0
- package/dist/content/article-filter-bar.d.ts +40 -0
- package/dist/content/article-filter-bar.d.ts.map +1 -0
- package/dist/content/article-filter-bar.js +56 -0
- package/dist/content/article-layout.d.ts +61 -0
- package/dist/content/article-layout.d.ts.map +1 -0
- package/dist/content/article-layout.js +71 -0
- package/dist/content/article-layout.module.css +131 -0
- package/dist/content/article-layout.module.css.d.ts +20 -0
- package/dist/content/article-model.d.ts +62 -0
- package/dist/content/article-model.d.ts.map +1 -0
- package/dist/content/article-model.js +41 -0
- package/dist/content/block-split.d.ts +24 -0
- package/dist/content/block-split.d.ts.map +1 -0
- package/dist/content/block-split.js +63 -0
- package/dist/content/callout-alert.d.ts +27 -0
- package/dist/content/callout-alert.d.ts.map +1 -0
- package/dist/content/callout-alert.js +59 -0
- package/dist/content/callout.d.ts +24 -0
- package/dist/content/callout.d.ts.map +1 -0
- package/dist/content/callout.js +59 -0
- package/dist/content/callout.module.css +77 -0
- package/dist/content/callout.module.css.d.ts +16 -0
- package/dist/content/code-block.d.ts +26 -0
- package/dist/content/code-block.d.ts.map +1 -0
- package/dist/content/code-block.js +41 -0
- package/dist/content/code-block.module.css +86 -0
- package/dist/content/code-block.module.css.d.ts +14 -0
- package/dist/content/copy-action.d.ts +29 -0
- package/dist/content/copy-action.d.ts.map +1 -0
- package/dist/content/copy-action.js +46 -0
- package/dist/content/fence-block.d.ts +19 -0
- package/dist/content/fence-block.d.ts.map +1 -0
- package/dist/content/fence-block.js +23 -0
- package/dist/content/glyphs.d.ts +18 -0
- package/dist/content/glyphs.d.ts.map +1 -0
- package/dist/content/glyphs.js +43 -0
- package/dist/content/guide.d.ts +47 -0
- package/dist/content/guide.d.ts.map +1 -0
- package/dist/content/guide.js +110 -0
- package/dist/content/guide.module.css +62 -0
- package/dist/content/guide.module.css.d.ts +13 -0
- package/dist/content/heading-anchor.d.ts +8 -0
- package/dist/content/heading-anchor.d.ts.map +1 -0
- package/dist/content/heading-anchor.js +23 -0
- package/dist/content/heading-components.d.ts +5 -0
- package/dist/content/heading-components.d.ts.map +1 -0
- package/dist/content/heading-components.js +41 -0
- package/dist/content/highlighter.d.ts +8 -0
- package/dist/content/highlighter.d.ts.map +1 -0
- package/dist/content/highlighter.js +85 -0
- package/dist/content/index.d.ts +45 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +43 -0
- package/dist/content/markdown-hast.d.ts +23 -0
- package/dist/content/markdown-hast.d.ts.map +1 -0
- package/dist/content/markdown-hast.js +48 -0
- package/dist/content/markdown.d.ts +68 -0
- package/dist/content/markdown.d.ts.map +1 -0
- package/dist/content/markdown.js +180 -0
- package/dist/content/mdx.d.ts +20 -0
- package/dist/content/mdx.d.ts.map +1 -0
- package/dist/content/mdx.js +64 -0
- package/dist/content/mermaid.d.ts +32 -0
- package/dist/content/mermaid.d.ts.map +1 -0
- package/dist/content/mermaid.js +70 -0
- package/dist/content/mermaid.module.css +20 -0
- package/dist/content/mermaid.module.css.d.ts +8 -0
- package/dist/content/prose.d.ts +29 -0
- package/dist/content/prose.d.ts.map +1 -0
- package/dist/content/prose.js +24 -0
- package/dist/content/prose.module.css +330 -0
- package/dist/content/prose.module.css.d.ts +12 -0
- package/dist/content/reading-progress.d.ts +20 -0
- package/dist/content/reading-progress.d.ts.map +1 -0
- package/dist/content/reading-progress.js +38 -0
- package/dist/content/reading-progress.module.css +22 -0
- package/dist/content/reading-progress.module.css.d.ts +9 -0
- package/dist/content/slug.d.ts +28 -0
- package/dist/content/slug.d.ts.map +1 -0
- package/dist/content/slug.js +28 -0
- package/dist/content/toc.d.ts +37 -0
- package/dist/content/toc.d.ts.map +1 -0
- package/dist/content/toc.js +134 -0
- package/dist/content/toc.module.css +51 -0
- package/dist/content/toc.module.css.d.ts +13 -0
- package/dist/content/url-hardening.d.ts +23 -0
- package/dist/content/url-hardening.d.ts.map +1 -0
- package/dist/content/url-hardening.js +23 -0
- package/dist/dashboard/delta-badge.d.ts +13 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -0
- package/dist/dashboard/delta-badge.js +45 -0
- package/dist/dashboard/empty-state.d.ts +15 -0
- package/dist/dashboard/empty-state.d.ts.map +1 -0
- package/dist/dashboard/empty-state.js +56 -0
- package/dist/dashboard/index.d.ts +5 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +16 -0
- package/dist/dashboard/settings-section.d.ts +24 -0
- package/dist/dashboard/settings-section.d.ts.map +1 -0
- package/dist/dashboard/settings-section.js +61 -0
- package/dist/dashboard/settings-section.module.css +23 -0
- package/dist/dashboard/settings-section.module.css.d.ts +10 -0
- package/dist/dashboard/stat-card.d.ts +18 -0
- package/dist/dashboard/stat-card.d.ts.map +1 -0
- package/dist/dashboard/stat-card.js +74 -0
- package/dist/data/data-table.d.ts +198 -0
- package/dist/data/data-table.d.ts.map +1 -0
- package/dist/data/data-table.js +342 -0
- package/dist/data/index.d.ts +34 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data/table.d.ts +24 -0
- package/dist/data/table.d.ts.map +1 -0
- package/dist/data/table.js +20 -0
- package/dist/data/virtual-list.d.ts +74 -0
- package/dist/data/virtual-list.d.ts.map +1 -0
- package/dist/data/virtual-list.js +86 -0
- package/dist/data/virtual.d.ts +20 -0
- package/dist/data/virtual.d.ts.map +1 -0
- package/dist/data/virtual.js +4 -0
- package/dist/forms/FormErrorSummary.d.ts +29 -0
- package/dist/forms/FormErrorSummary.d.ts.map +1 -0
- package/dist/forms/FormErrorSummary.js +28 -0
- package/dist/forms/create-form.d.ts +31 -0
- package/dist/forms/create-form.d.ts.map +1 -0
- package/dist/forms/create-form.js +18 -0
- package/dist/forms/field.d.ts +22 -0
- package/dist/forms/field.d.ts.map +1 -0
- package/dist/forms/field.js +9 -0
- package/dist/forms/index.d.ts +17 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +13 -0
- package/dist/forms/use-form-draft.d.ts +61 -0
- package/dist/forms/use-form-draft.d.ts.map +1 -0
- package/dist/forms/use-form-draft.js +55 -0
- package/dist/guard/guard-hook.d.ts +40 -0
- package/dist/guard/guard-hook.d.ts.map +1 -0
- package/dist/guard/guard-hook.js +55 -0
- package/dist/guard/index.d.ts +144 -0
- package/dist/guard/index.d.ts.map +1 -0
- package/dist/guard/index.js +315 -0
- package/dist/guard/types.d.ts +97 -0
- package/dist/guard/types.d.ts.map +1 -0
- package/dist/guard/types.js +0 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -0
- package/dist/motion/index.d.ts +29 -0
- package/dist/motion/index.d.ts.map +1 -0
- package/dist/motion/index.js +12 -0
- package/dist/notifications/bell.d.ts +12 -0
- package/dist/notifications/bell.d.ts.map +1 -0
- package/dist/notifications/bell.js +84 -0
- package/dist/notifications/center.d.ts +20 -0
- package/dist/notifications/center.d.ts.map +1 -0
- package/dist/notifications/center.js +144 -0
- package/dist/notifications/define-notifications.d.ts +97 -0
- package/dist/notifications/define-notifications.d.ts.map +1 -0
- package/dist/notifications/define-notifications.js +27 -0
- package/dist/notifications/index.d.ts +36 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +52 -0
- package/dist/notifications/notify.d.ts +92 -0
- package/dist/notifications/notify.d.ts.map +1 -0
- package/dist/notifications/notify.js +127 -0
- package/dist/notifications/overlay.d.ts +20 -0
- package/dist/notifications/overlay.d.ts.map +1 -0
- package/dist/notifications/overlay.js +12 -0
- package/dist/notifications/store.d.ts +120 -0
- package/dist/notifications/store.d.ts.map +1 -0
- package/dist/notifications/store.js +113 -0
- package/dist/provider/index.d.ts +93 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +106 -0
- package/dist/query/devtools.d.ts +21 -0
- package/dist/query/devtools.d.ts.map +1 -0
- package/dist/query/devtools.js +12 -0
- package/dist/query/index.d.ts +65 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +68 -0
- package/dist/register.d.ts +139 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +6 -0
- package/dist/router-tanstack/index.d.ts +74 -0
- package/dist/router-tanstack/index.d.ts.map +1 -0
- package/dist/router-tanstack/index.js +29 -0
- package/dist/router-tanstack/multi-search-param-store.d.ts +78 -0
- package/dist/router-tanstack/multi-search-param-store.d.ts.map +1 -0
- package/dist/router-tanstack/multi-search-param-store.js +35 -0
- package/dist/router-tanstack/search-param-store.d.ts +92 -0
- package/dist/router-tanstack/search-param-store.d.ts.map +1 -0
- package/dist/router-tanstack/search-param-store.js +26 -0
- package/dist/shell/account-types.d.ts +118 -0
- package/dist/shell/account-types.d.ts.map +1 -0
- package/dist/shell/account-types.js +0 -0
- package/dist/shell/app-breadcrumbs.d.ts +17 -0
- package/dist/shell/app-breadcrumbs.d.ts.map +1 -0
- package/dist/shell/app-breadcrumbs.js +39 -0
- package/dist/shell/app-header.module.css +73 -0
- package/dist/shell/app-header.module.css.d.ts +11 -0
- package/dist/shell/app-mobile-nav.d.ts +26 -0
- package/dist/shell/app-mobile-nav.d.ts.map +1 -0
- package/dist/shell/app-mobile-nav.js +106 -0
- package/dist/shell/app-mobile-nav.module.css +100 -0
- package/dist/shell/app-mobile-nav.module.css.d.ts +14 -0
- package/dist/shell/app-sidebar-account.d.ts +3 -0
- package/dist/shell/app-sidebar-account.d.ts.map +1 -0
- package/dist/shell/app-sidebar-account.js +84 -0
- package/dist/shell/app-sidebar.d.ts +56 -0
- package/dist/shell/app-sidebar.d.ts.map +1 -0
- package/dist/shell/app-sidebar.js +455 -0
- package/dist/shell/app-sidebar.module.css +414 -0
- package/dist/shell/app-sidebar.module.css.d.ts +34 -0
- package/dist/shell/index.d.ts +123 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +179 -0
- package/dist/shell/page-header.d.ts +13 -0
- package/dist/shell/page-header.d.ts.map +1 -0
- package/dist/shell/page-header.js +23 -0
- package/dist/shell/sidebar-search.d.ts +12 -0
- package/dist/shell/sidebar-search.d.ts.map +1 -0
- package/dist/shell/sidebar-search.js +62 -0
- package/dist/shell/sidebar-search.module.css +62 -0
- package/dist/shell/sidebar-search.module.css.d.ts +11 -0
- package/dist/state.d.ts +62 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +124 -0
- package/dist/styles.css +166 -0
- package/dist/surfaces.d.ts +376 -0
- package/dist/surfaces.d.ts.map +1 -0
- package/dist/surfaces.js +306 -0
- package/dist/theme/controls.module.css +143 -0
- package/dist/theme/controls.module.css.d.ts +17 -0
- package/dist/theme/floating.module.css +35 -0
- package/dist/theme/floating.module.css.d.ts +9 -0
- package/dist/theme/index.d.ts +22 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +733 -0
- package/dist/theme/nav-link.module.css +67 -0
- package/dist/theme/nav-link.module.css.d.ts +8 -0
- package/dist/theme/segmented-control.module.css +14 -0
- package/dist/theme/segmented-control.module.css.d.ts +8 -0
- package/dist/theme/timeline.module.css +29 -0
- package/dist/theme/timeline.module.css.d.ts +9 -0
- package/dist/theme-lab/index.d.ts +59 -0
- package/dist/theme-lab/index.d.ts.map +1 -0
- package/dist/theme-lab/index.js +263 -0
- package/dist/theme-toggle/index.d.ts +8 -0
- package/dist/theme-toggle/index.d.ts.map +1 -0
- package/dist/theme-toggle/index.js +155 -0
- package/dist/tokens/index.d.ts +151 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +246 -0
- package/dist/tokens/palette.d.ts +304 -0
- package/dist/tokens/palette.d.ts.map +1 -0
- package/dist/tokens/palette.js +186 -0
- package/dist/vite.d.ts +30 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +68 -0
- package/llms.txt +149 -0
- package/package.json +243 -46
- package/src/agent/ai-sdk-transport.ts +280 -0
- package/src/agent/history.ts +128 -0
- package/src/agent/index.ts +92 -0
- package/src/agent/outcome.ts +120 -0
- package/src/agent/part-list.tsx +292 -0
- package/src/agent/parts.ts +136 -0
- package/src/agent/stick-to-bottom.tsx +154 -0
- package/src/agent/thread.ts +312 -0
- package/src/agent/transport.ts +114 -0
- package/src/agent/use-agent-stream.ts +141 -0
- package/src/agent/use-agent-thread-runs.ts +440 -0
- package/src/agent-chat/composer.tsx +131 -0
- package/src/agent-chat/index.ts +35 -0
- package/src/agent-chat/thread-detail-panel.tsx +192 -0
- package/src/agent-chat/thread-feed.tsx +81 -0
- package/src/agent-chat/thread-message.tsx +251 -0
- package/src/agent-chat/thread-outcome-card.tsx +196 -0
- package/src/agent-chat/thread-workspace.tsx +179 -0
- package/src/charts/hooks/useChartSize.ts +31 -0
- package/src/charts/hooks/useChartTooltip.ts +31 -0
- package/src/charts/hooks/useHoverSync.ts +116 -0
- package/src/charts/hover-context.ts +28 -0
- package/src/charts/hover-sync.tsx +37 -0
- package/src/charts/index.ts +118 -0
- package/src/charts/kinds/Bars.tsx +634 -0
- package/src/charts/kinds/Donut.tsx +233 -0
- package/src/charts/kinds/DualPanel.tsx +432 -0
- package/src/charts/kinds/Heatmap.tsx +255 -0
- package/src/charts/kinds/MultiLine.tsx +376 -0
- package/src/charts/kinds/StackedArea.tsx +218 -0
- package/src/charts/kinds/ZonedLine.tsx +346 -0
- package/src/charts/primitives/AreaGradient.tsx +26 -0
- package/src/charts/primitives/Axes.tsx +97 -0
- package/src/charts/primitives/ChartCard.tsx +180 -0
- package/src/charts/primitives/ChartFrame.tsx +157 -0
- package/src/charts/primitives/ChartLegend.tsx +302 -0
- package/src/charts/primitives/ChartTooltip.tsx +158 -0
- package/src/charts/primitives/Crosshair.tsx +40 -0
- package/src/charts/primitives/HoverOverlay.tsx +24 -0
- package/src/charts/primitives/ResponsiveChart.tsx +64 -0
- package/src/charts/primitives/ZoneRects.tsx +67 -0
- package/src/charts/series.ts +163 -0
- package/src/charts/sparklines/BarSparkline.tsx +48 -0
- package/src/charts/sparklines/LineSparkline.tsx +57 -0
- package/src/charts/sparklines/index.ts +2 -0
- package/src/charts/theme.tsx +53 -0
- package/src/charts/utils/domain.test.ts +24 -0
- package/src/charts/utils/domain.ts +22 -0
- package/src/charts/utils/format.ts +27 -0
- package/src/charts/utils/ticks.ts +18 -0
- package/src/cli/check-theme.test.ts +658 -0
- package/src/cli/index.ts +1497 -0
- package/src/cli/init-sync.test.ts +160 -0
- package/src/commands/ShortcutsHelp.tsx +129 -0
- package/src/commands/define-commands.ts +184 -0
- package/src/commands/define-overlays.ts +197 -0
- package/src/commands/index.ts +86 -0
- package/src/commands/overlays-mount.tsx +301 -0
- package/src/commands/projectors.ts +267 -0
- package/src/commands/shortcut-format.ts +83 -0
- package/src/commands/useCommandHotkeys.ts +114 -0
- package/src/connectivity/connectivity-indicator.tsx +249 -0
- package/src/connectivity/connectivity-provider.tsx +186 -0
- package/src/connectivity/index.ts +18 -0
- package/src/connectivity/types.ts +39 -0
- package/src/connectivity/use-connectivity.ts +25 -0
- package/src/content/article-actions.test.ts +78 -0
- package/src/content/article-actions.ts +72 -0
- package/src/content/article-card.module.css +109 -0
- package/src/content/article-card.module.css.d.ts +16 -0
- package/src/content/article-card.tsx +173 -0
- package/src/content/article-filter-bar.tsx +88 -0
- package/src/content/article-layout.module.css +131 -0
- package/src/content/article-layout.module.css.d.ts +20 -0
- package/src/content/article-layout.tsx +167 -0
- package/src/content/article-model.test.ts +119 -0
- package/src/content/article-model.ts +110 -0
- package/src/content/block-split.test.ts +75 -0
- package/src/content/block-split.ts +102 -0
- package/src/content/callout-alert.ts +88 -0
- package/src/content/callout.module.css +77 -0
- package/src/content/callout.module.css.d.ts +16 -0
- package/src/content/callout.tsx +96 -0
- package/src/content/code-block.module.css +86 -0
- package/src/content/code-block.module.css.d.ts +14 -0
- package/src/content/code-block.tsx +82 -0
- package/src/content/copy-action.tsx +79 -0
- package/src/content/fence-block.tsx +39 -0
- package/src/content/glyphs.tsx +53 -0
- package/src/content/guide.module.css +62 -0
- package/src/content/guide.module.css.d.ts +13 -0
- package/src/content/guide.tsx +174 -0
- package/src/content/heading-anchor.tsx +54 -0
- package/src/content/heading-components.tsx +62 -0
- package/src/content/highlighter.ts +123 -0
- package/src/content/index.ts +60 -0
- package/src/content/markdown-hast.ts +80 -0
- package/src/content/markdown.tsx +346 -0
- package/src/content/mdx.tsx +127 -0
- package/src/content/mermaid.module.css +20 -0
- package/src/content/mermaid.module.css.d.ts +8 -0
- package/src/content/mermaid.tsx +124 -0
- package/src/content/prose.module.css +330 -0
- package/src/content/prose.module.css.d.ts +12 -0
- package/src/content/prose.tsx +53 -0
- package/src/content/reading-progress.module.css +22 -0
- package/src/content/reading-progress.module.css.d.ts +9 -0
- package/src/content/reading-progress.tsx +67 -0
- package/src/content/slug.test.ts +62 -0
- package/src/content/slug.ts +57 -0
- package/src/content/toc.module.css +51 -0
- package/src/content/toc.module.css.d.ts +13 -0
- package/src/content/toc.tsx +226 -0
- package/src/content/url-hardening.ts +46 -0
- package/src/dashboard/delta-badge.tsx +70 -0
- package/src/dashboard/empty-state.tsx +80 -0
- package/src/dashboard/index.ts +11 -0
- package/src/dashboard/settings-section.module.css +23 -0
- package/src/dashboard/settings-section.module.css.d.ts +10 -0
- package/src/dashboard/settings-section.tsx +118 -0
- package/src/dashboard/stat-card.tsx +105 -0
- package/src/data/data-table.tsx +695 -0
- package/src/data/index.ts +37 -0
- package/src/data/table.ts +46 -0
- package/src/data/virtual-list.tsx +180 -0
- package/src/data/virtual.ts +21 -0
- package/src/forms/FormErrorSummary.tsx +64 -0
- package/src/forms/create-form.ts +57 -0
- package/src/forms/field.ts +30 -0
- package/src/forms/index.ts +26 -0
- package/src/forms/use-form-draft.ts +170 -0
- package/src/guard/check-source.test.ts +834 -0
- package/src/guard/guard-hook.test.ts +173 -0
- package/src/guard/guard-hook.ts +122 -0
- package/src/guard/index.ts +510 -0
- package/src/guard/types.ts +117 -0
- package/src/index.ts +139 -0
- package/src/motion/index.ts +26 -0
- package/src/notifications/bell.tsx +108 -0
- package/src/notifications/center.tsx +245 -0
- package/src/notifications/define-notifications.ts +162 -0
- package/src/notifications/index.ts +79 -0
- package/src/notifications/notify.tsx +260 -0
- package/src/notifications/overlay.tsx +64 -0
- package/src/notifications/store.ts +287 -0
- package/src/provider/index.tsx +234 -0
- package/src/query/devtools.tsx +38 -0
- package/src/query/index.ts +129 -0
- package/src/register.ts +158 -0
- package/src/router-tanstack/index.ts +111 -0
- package/src/router-tanstack/multi-search-param-store.test.ts +56 -0
- package/src/router-tanstack/multi-search-param-store.ts +122 -0
- package/src/router-tanstack/search-param-store.ts +125 -0
- package/src/shell/account-types.ts +119 -0
- package/src/shell/app-breadcrumbs.tsx +90 -0
- package/src/shell/app-header.module.css +73 -0
- package/src/shell/app-header.module.css.d.ts +11 -0
- package/src/shell/app-mobile-nav.module.css +100 -0
- package/src/shell/app-mobile-nav.module.css.d.ts +14 -0
- package/src/shell/app-mobile-nav.tsx +146 -0
- package/src/shell/app-sidebar-account.tsx +142 -0
- package/src/shell/app-sidebar.module.css +414 -0
- package/src/shell/app-sidebar.module.css.d.ts +34 -0
- package/src/shell/app-sidebar.tsx +632 -0
- package/src/shell/index.tsx +343 -0
- package/src/shell/page-header.tsx +35 -0
- package/src/shell/sidebar-search.module.css +62 -0
- package/src/shell/sidebar-search.module.css.d.ts +11 -0
- package/src/shell/sidebar-search.tsx +80 -0
- package/src/state.ts +246 -0
- package/src/styles.css +166 -0
- package/src/styles.floor.test.ts +36 -0
- package/src/surfaces.ts +489 -0
- package/src/theme/border-coverage.test.ts +272 -0
- package/src/theme/contrast.test.ts +306 -0
- package/src/theme/controls.module.css +143 -0
- package/src/theme/controls.module.css.d.ts +17 -0
- package/src/theme/floating.module.css +35 -0
- package/src/theme/floating.module.css.d.ts +9 -0
- package/src/theme/index.ts +933 -0
- package/src/theme/nav-link.module.css +67 -0
- package/src/theme/nav-link.module.css.d.ts +8 -0
- package/src/theme/segmented-control.module.css +14 -0
- package/src/theme/segmented-control.module.css.d.ts +8 -0
- package/src/theme/shadow-surfaces.test.ts +421 -0
- package/src/theme/timeline.module.css +29 -0
- package/src/theme/timeline.module.css.d.ts +9 -0
- package/src/theme-lab/index.tsx +359 -0
- package/src/theme-lab/theme-lab.test.ts +60 -0
- package/src/theme-toggle/index.tsx +180 -0
- package/src/tokens/index.ts +363 -0
- package/src/tokens/palette.ts +288 -0
- package/src/vite.ts +122 -0
- package/src/index.css +0 -877
- package/src/starlight.css +0 -308
- package/tailwind.config.js +0 -78
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { Group } from '@visx/group'
|
|
2
|
+
import type { ReactNode } from 'react'
|
|
3
|
+
import { memo, useMemo } from 'react'
|
|
4
|
+
import {
|
|
5
|
+
ChartTooltip,
|
|
6
|
+
TooltipBody,
|
|
7
|
+
TooltipHeader,
|
|
8
|
+
TooltipRow,
|
|
9
|
+
useTooltipStyles,
|
|
10
|
+
} from '../primitives/ChartTooltip'
|
|
11
|
+
import { useChartTooltip } from '../hooks/useChartTooltip'
|
|
12
|
+
import { VX, alpha } from '../../tokens'
|
|
13
|
+
|
|
14
|
+
/** A single resolved heatmap cell — the unit the tooltip and hover operate on. */
|
|
15
|
+
type HeatmapCell = { row: string; col: string; value: number }
|
|
16
|
+
|
|
17
|
+
export type HeatmapProps<T> = {
|
|
18
|
+
data: T[]
|
|
19
|
+
width: number
|
|
20
|
+
height: number
|
|
21
|
+
chartId: string
|
|
22
|
+
/** Extracts the y-axis category (row) from a data point. */
|
|
23
|
+
getRow: (d: T) => string
|
|
24
|
+
/** Extracts the x-axis category (column) from a data point. */
|
|
25
|
+
getCol: (d: T) => string
|
|
26
|
+
/** Extracts the cell intensity value. */
|
|
27
|
+
getValue: (d: T) => number
|
|
28
|
+
/** Explicit y order; defaults to first-seen rows from data. */
|
|
29
|
+
rows?: string[]
|
|
30
|
+
/** Explicit x order; defaults to first-seen columns from data. */
|
|
31
|
+
cols?: string[]
|
|
32
|
+
/** Base hue token for the heat fill. Default VX.line. */
|
|
33
|
+
color?: string
|
|
34
|
+
/** Maps a value to a 0..1 intensity. Default value/max. */
|
|
35
|
+
intensity?: (value: number, max: number) => number
|
|
36
|
+
/** Gap (px) between cells. Default 2. */
|
|
37
|
+
cellGap?: number
|
|
38
|
+
/** Corner radius (px) of each cell. Default 2. */
|
|
39
|
+
cellRadius?: number
|
|
40
|
+
/** Formatter for the tooltip value. */
|
|
41
|
+
formatValue?: (v: number) => string
|
|
42
|
+
/** Label transform for a row category (axis + tooltip). */
|
|
43
|
+
rowLabel?: (row: string) => string
|
|
44
|
+
/** Label transform for a column category (axis + tooltip). */
|
|
45
|
+
colLabel?: (col: string) => string
|
|
46
|
+
/** Optional extra tooltip rows (rendered after the main row). */
|
|
47
|
+
renderTooltip?: (cell: HeatmapCell) => ReactNode
|
|
48
|
+
/** Optional gradient legend strip below the grid (faint → solid color). */
|
|
49
|
+
legend?: { min: string; max: string }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Build a first-seen-ordered list of unique keys from data via an accessor. */
|
|
53
|
+
function firstSeen<T>(data: T[], get: (d: T) => string): string[] {
|
|
54
|
+
const seen = new Set<string>()
|
|
55
|
+
const out: string[] = []
|
|
56
|
+
for (const d of data) {
|
|
57
|
+
const k = get(d)
|
|
58
|
+
if (!seen.has(k)) {
|
|
59
|
+
seen.add(k)
|
|
60
|
+
out.push(k)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return out
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Compound (row, col) cell key. A null byte can't appear in user category strings, so it never
|
|
67
|
+
// collides the way a space separator could — e.g. (row "a b", col "c") vs (row "a", col "b c").
|
|
68
|
+
const cellKey = (row: string, col: string): string => `${row}\u0000${col}`
|
|
69
|
+
|
|
70
|
+
// Category labels read like axis ticks (docs/DESIGN-SPEC.md §5: "ticks mono 10.5px faint") even
|
|
71
|
+
// though Heatmap renders them as plain <text> rather than through the Axis* primitives.
|
|
72
|
+
const LABEL_FONT_FAMILY = 'var(--basalt-font-mono)'
|
|
73
|
+
|
|
74
|
+
// Left gutter for row labels, bottom gutter for column labels, top breathing room.
|
|
75
|
+
const PAD_LEFT = 44
|
|
76
|
+
const PAD_BOTTOM = 24
|
|
77
|
+
const PAD_TOP = 8
|
|
78
|
+
// Height of the optional gradient legend strip (+ its label line).
|
|
79
|
+
const LEGEND_H = 8
|
|
80
|
+
const LEGEND_LABEL_H = 16
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Category × category intensity grid. Each cell is a rounded rect filled with the base
|
|
84
|
+
* color at an opacity derived from its value; empty cells stay a faint neutral track.
|
|
85
|
+
* Generalizes argo's day-of-week × hour-of-day heatmap. Categorical axes are rendered as
|
|
86
|
+
* plain themed `<text>` (cells are not date-categorical, so no useHoverSync / shared
|
|
87
|
+
* cursor) — per-cell hover drives the local tooltip directly.
|
|
88
|
+
*/
|
|
89
|
+
function HeatmapInner<T>(props: HeatmapProps<T>) {
|
|
90
|
+
const {
|
|
91
|
+
data,
|
|
92
|
+
width,
|
|
93
|
+
height,
|
|
94
|
+
chartId,
|
|
95
|
+
getRow,
|
|
96
|
+
getCol,
|
|
97
|
+
getValue,
|
|
98
|
+
rows: rowsProp,
|
|
99
|
+
cols: colsProp,
|
|
100
|
+
color = VX.line,
|
|
101
|
+
intensity = (value, max) => (max > 0 ? value / max : 0),
|
|
102
|
+
cellGap = 2,
|
|
103
|
+
cellRadius = 2,
|
|
104
|
+
formatValue = (v) => `${v}`,
|
|
105
|
+
rowLabel = (r) => r,
|
|
106
|
+
colLabel = (c) => c,
|
|
107
|
+
renderTooltip,
|
|
108
|
+
legend,
|
|
109
|
+
} = props
|
|
110
|
+
|
|
111
|
+
const tooltipStyles = useTooltipStyles()
|
|
112
|
+
const { tip, show, hide, tooltipRef } = useChartTooltip<HeatmapCell>()
|
|
113
|
+
|
|
114
|
+
const rows = useMemo(() => rowsProp ?? firstSeen(data, getRow), [rowsProp, data, getRow])
|
|
115
|
+
const cols = useMemo(() => colsProp ?? firstSeen(data, getCol), [colsProp, data, getCol])
|
|
116
|
+
|
|
117
|
+
// Lookup keyed by cellKey(row, col) → value for O(1) cell fill.
|
|
118
|
+
const { lookup, max } = useMemo(() => {
|
|
119
|
+
const map = new Map<string, number>()
|
|
120
|
+
let m = 0
|
|
121
|
+
for (const d of data) {
|
|
122
|
+
const v = getValue(d)
|
|
123
|
+
map.set(cellKey(getRow(d), getCol(d)), v)
|
|
124
|
+
if (v > m) m = v
|
|
125
|
+
}
|
|
126
|
+
return { lookup: map, max: m }
|
|
127
|
+
}, [data, getRow, getCol, getValue])
|
|
128
|
+
|
|
129
|
+
const legendH = legend ? LEGEND_H + LEGEND_LABEL_H : 0
|
|
130
|
+
const gridW = Math.max(0, width - PAD_LEFT)
|
|
131
|
+
const gridH = Math.max(0, height - PAD_TOP - PAD_BOTTOM - legendH)
|
|
132
|
+
const cellW = cols.length > 0 ? gridW / cols.length : 0
|
|
133
|
+
const cellH = rows.length > 0 ? gridH / rows.length : 0
|
|
134
|
+
const legendGradientId = `${chartId}-heat-legend`
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<div style={{ position: 'relative' }}>
|
|
138
|
+
<svg width={width} height={height}>
|
|
139
|
+
<Group left={PAD_LEFT} top={PAD_TOP}>
|
|
140
|
+
{rows.flatMap((row, ri) =>
|
|
141
|
+
cols.map((col, ci) => {
|
|
142
|
+
const value = lookup.get(cellKey(row, col))
|
|
143
|
+
const has = value !== undefined
|
|
144
|
+
const fill = has ? alpha(color, intensity(value, max)) : alpha(VX.neutral, 0.04)
|
|
145
|
+
return (
|
|
146
|
+
<rect
|
|
147
|
+
key={cellKey(row, col)}
|
|
148
|
+
x={ci * cellW + cellGap / 2}
|
|
149
|
+
y={ri * cellH + cellGap / 2}
|
|
150
|
+
width={Math.max(0, cellW - cellGap)}
|
|
151
|
+
height={Math.max(0, cellH - cellGap)}
|
|
152
|
+
rx={cellRadius}
|
|
153
|
+
fill={fill}
|
|
154
|
+
style={{ cursor: has ? 'pointer' : 'default' }}
|
|
155
|
+
onMouseMove={(e) => has && show({ row, col, value }, e)}
|
|
156
|
+
onMouseLeave={hide}
|
|
157
|
+
/>
|
|
158
|
+
)
|
|
159
|
+
}),
|
|
160
|
+
)}
|
|
161
|
+
</Group>
|
|
162
|
+
|
|
163
|
+
{/* Row labels (left). */}
|
|
164
|
+
<Group left={0} top={PAD_TOP}>
|
|
165
|
+
{rows.map((row, ri) => (
|
|
166
|
+
<text
|
|
167
|
+
key={row}
|
|
168
|
+
x={PAD_LEFT - 6}
|
|
169
|
+
y={ri * cellH + cellH / 2 + 4}
|
|
170
|
+
textAnchor="end"
|
|
171
|
+
fontSize={VX.axisFont}
|
|
172
|
+
fontFamily={LABEL_FONT_FAMILY}
|
|
173
|
+
fill={VX.faint}
|
|
174
|
+
>
|
|
175
|
+
{rowLabel(row)}
|
|
176
|
+
</text>
|
|
177
|
+
))}
|
|
178
|
+
</Group>
|
|
179
|
+
|
|
180
|
+
{/* Column labels (bottom). */}
|
|
181
|
+
<Group left={PAD_LEFT} top={PAD_TOP + gridH}>
|
|
182
|
+
{cols.map((col, ci) => (
|
|
183
|
+
<text
|
|
184
|
+
key={col}
|
|
185
|
+
x={ci * cellW + cellW / 2}
|
|
186
|
+
y={16}
|
|
187
|
+
textAnchor="middle"
|
|
188
|
+
fontSize={VX.axisFont}
|
|
189
|
+
fontFamily={LABEL_FONT_FAMILY}
|
|
190
|
+
fill={VX.faint}
|
|
191
|
+
>
|
|
192
|
+
{colLabel(col)}
|
|
193
|
+
</text>
|
|
194
|
+
))}
|
|
195
|
+
</Group>
|
|
196
|
+
|
|
197
|
+
{/* Optional gradient legend strip below the grid. */}
|
|
198
|
+
{legend && (
|
|
199
|
+
<Group left={PAD_LEFT} top={PAD_TOP + gridH + PAD_BOTTOM}>
|
|
200
|
+
<defs>
|
|
201
|
+
<linearGradient id={legendGradientId} x1="0" x2="1" y1="0" y2="0">
|
|
202
|
+
<stop offset="0%" stopColor={alpha(color, 0.08)} />
|
|
203
|
+
<stop offset="100%" stopColor={color} />
|
|
204
|
+
</linearGradient>
|
|
205
|
+
</defs>
|
|
206
|
+
<rect width={gridW} height={LEGEND_H} rx={2} fill={`url(#${legendGradientId})`} />
|
|
207
|
+
<text
|
|
208
|
+
x={0}
|
|
209
|
+
y={LEGEND_H + 12}
|
|
210
|
+
textAnchor="start"
|
|
211
|
+
fontSize={VX.axisFont}
|
|
212
|
+
fontFamily={LABEL_FONT_FAMILY}
|
|
213
|
+
fill={VX.faint}
|
|
214
|
+
>
|
|
215
|
+
{legend.min}
|
|
216
|
+
</text>
|
|
217
|
+
<text
|
|
218
|
+
x={gridW}
|
|
219
|
+
y={LEGEND_H + 12}
|
|
220
|
+
textAnchor="end"
|
|
221
|
+
fontSize={VX.axisFont}
|
|
222
|
+
fontFamily={LABEL_FONT_FAMILY}
|
|
223
|
+
fill={VX.faint}
|
|
224
|
+
>
|
|
225
|
+
{legend.max}
|
|
226
|
+
</text>
|
|
227
|
+
</Group>
|
|
228
|
+
)}
|
|
229
|
+
</svg>
|
|
230
|
+
|
|
231
|
+
<ChartTooltip tip={tip} tooltipRef={tooltipRef} styles={tooltipStyles}>
|
|
232
|
+
{tip !== null && (
|
|
233
|
+
<>
|
|
234
|
+
<TooltipHeader date={rowLabel(tip.data.row)} label={colLabel(tip.data.col)} />
|
|
235
|
+
<TooltipBody>
|
|
236
|
+
<TooltipRow
|
|
237
|
+
color={alpha(color, 0.9)}
|
|
238
|
+
shape="bar"
|
|
239
|
+
label="Value"
|
|
240
|
+
value={formatValue(tip.data.value)}
|
|
241
|
+
/>
|
|
242
|
+
{renderTooltip?.(tip.data)}
|
|
243
|
+
</TooltipBody>
|
|
244
|
+
</>
|
|
245
|
+
)}
|
|
246
|
+
</ChartTooltip>
|
|
247
|
+
</div>
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Hand-memoized: React Compiler does not process the shipped dist, so the hot Heatmap kind is
|
|
253
|
+
* wrapped in `React.memo` to retain auto-memoization (parity with ZonedLine / Bars).
|
|
254
|
+
*/
|
|
255
|
+
export const Heatmap = memo(HeatmapInner) as typeof HeatmapInner
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { curveMonotoneX } from '@visx/curve'
|
|
2
|
+
import { GridRows } from '@visx/grid'
|
|
3
|
+
import { Group } from '@visx/group'
|
|
4
|
+
import { scaleLinear, scalePoint } from '@visx/scale'
|
|
5
|
+
import { LinePath } from '@visx/shape'
|
|
6
|
+
import { memo, useMemo, useState } from 'react'
|
|
7
|
+
import type { ReactNode } from 'react'
|
|
8
|
+
import { AxisBottomDate, AxisLeftNumeric } from '../primitives/Axes'
|
|
9
|
+
import {
|
|
10
|
+
ChartTooltip,
|
|
11
|
+
TooltipBody,
|
|
12
|
+
TooltipHeader,
|
|
13
|
+
TooltipRow,
|
|
14
|
+
useTooltipStyles,
|
|
15
|
+
} from '../primitives/ChartTooltip'
|
|
16
|
+
import { ChartFrame, resolveLegend } from '../primitives/ChartFrame'
|
|
17
|
+
import { Crosshair, SeriesDot } from '../primitives/Crosshair'
|
|
18
|
+
import { HoverOverlay } from '../primitives/HoverOverlay'
|
|
19
|
+
import { ZoneRects } from '../primitives/ZoneRects'
|
|
20
|
+
import type { ZoneSpec } from '../primitives/ZoneRects'
|
|
21
|
+
import { useHoverSync } from '../hooks/useHoverSync'
|
|
22
|
+
import { deriveTooltipRows, LINE_OVERLAY_STROKE_WIDTH } from '../series'
|
|
23
|
+
import type { ChartLegendConfig, ChartSeries } from '../series'
|
|
24
|
+
import { VX } from '../../tokens'
|
|
25
|
+
import { padAutoLower } from '../utils/domain'
|
|
26
|
+
import { smartTicks, smartTicksEvery } from '../utils/ticks'
|
|
27
|
+
|
|
28
|
+
export type MultiLineProps<T> = {
|
|
29
|
+
data: T[]
|
|
30
|
+
/** Fixed height in pixels, forwarded to the internal `ChartFrame`. Default 240. */
|
|
31
|
+
height?: number
|
|
32
|
+
chartId: string
|
|
33
|
+
/** Extracts the x-axis category (date string) from a data point. */
|
|
34
|
+
getX: (d: T) => string
|
|
35
|
+
/** 1+ line series sharing one y-axis — the single source of truth for color, dash, legend, and
|
|
36
|
+
* tooltip rows. */
|
|
37
|
+
series: ChartSeries<T>[]
|
|
38
|
+
/** Fixed y-domain (e.g. [-2.5, 2.5]) or 'auto' to compute from all series. */
|
|
39
|
+
yDomain: [number, number] | 'auto'
|
|
40
|
+
/** When 'auto': upper bound is at least this value. */
|
|
41
|
+
yAutoMaxFloor?: number
|
|
42
|
+
/** When 'auto': lower bound is at most this value. Default 0. Pass `Infinity` to disable the
|
|
43
|
+
* forced zero baseline — the lower bound then pads DOWN from the raw data minimum instead. */
|
|
44
|
+
yAutoMinCeil?: number
|
|
45
|
+
/** When 'auto': padding multiplier applied away from the domain. Default 1.1. The lower bound
|
|
46
|
+
* always pads DOWN from `min(dataMin, yAutoMinCeil)` (never up, which would clip data) — see
|
|
47
|
+
* {@link padAutoLower}. */
|
|
48
|
+
yAutoPad?: number
|
|
49
|
+
/** Horizontal value-range overlays (target zones), rendered behind the lines on the left scale. */
|
|
50
|
+
zones?: ZoneSpec[]
|
|
51
|
+
/** Horizontal reference lines. Solid by default; set dashed: true for a dashed line. */
|
|
52
|
+
refLines?: { value: number; color: string; dashed?: boolean }[]
|
|
53
|
+
numTicksX?: number
|
|
54
|
+
numTicksY?: number
|
|
55
|
+
/** Tooltip + (per-series) value formatter. */
|
|
56
|
+
formatValue: (v: number) => string
|
|
57
|
+
/** Y-axis tick label formatter. Falls back to the scale's default. */
|
|
58
|
+
formatYTick?: (v: number) => string
|
|
59
|
+
/** Label shown at the right of the tooltip header (e.g. status badge). */
|
|
60
|
+
tooltipLabel?: (d: T) => { text: string; color: string } | null
|
|
61
|
+
/** Extra tooltip rows rendered after the per-series rows. */
|
|
62
|
+
renderExtraTooltipRows?: (d: T) => ReactNode
|
|
63
|
+
/** Marker glyph for per-point markers. Default 'circle'. */
|
|
64
|
+
markerShape?: 'circle' | 'star'
|
|
65
|
+
/** Legend config forwarded to `ChartFrame`; `false` disables the legend (sparkline escape).
|
|
66
|
+
* Default `{ placement: 'bottom' }`. */
|
|
67
|
+
legend?: ChartLegendConfig | false
|
|
68
|
+
/** Accessible text alternative, forwarded to `ChartFrame` as `aria-label` (+ `role="img"`). */
|
|
69
|
+
ariaLabel?: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const STAR_R = 6
|
|
73
|
+
|
|
74
|
+
/** Five-point star path centered at (cx, cy) with outer radius r. */
|
|
75
|
+
function starPath(cx: number, cy: number, r: number): string {
|
|
76
|
+
const inner = r * 0.4
|
|
77
|
+
const pts: string[] = []
|
|
78
|
+
for (let i = 0; i < 10; i++) {
|
|
79
|
+
const radius = i % 2 === 0 ? r : inner
|
|
80
|
+
const angle = (Math.PI / 5) * i - Math.PI / 2
|
|
81
|
+
pts.push(`${cx + radius * Math.cos(angle)},${cy + radius * Math.sin(angle)}`)
|
|
82
|
+
}
|
|
83
|
+
return `M${pts.join('L')}Z`
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* N series sharing one y-axis, with optional zones/reference lines, per-point markers
|
|
88
|
+
* (PR stars / status dots), a dashed companion line per series, legend-hover dimming, and a
|
|
89
|
+
* shared-cursor tooltip. Generalizes the multi-line argo charts (e1RM trend, relative
|
|
90
|
+
* progression, training load, fitness trends).
|
|
91
|
+
*
|
|
92
|
+
* Composes `ChartFrame` for measuring + the derived legend — `series` is the single array that
|
|
93
|
+
* drives the plotted lines, the legend, and the tooltip rows.
|
|
94
|
+
*
|
|
95
|
+
* X-axis is built from the full `data` array so the calendar is preserved even when a series
|
|
96
|
+
* has nulls; each series line skips null points (creating visual gaps).
|
|
97
|
+
*/
|
|
98
|
+
function MultiLineInner<T>(props: MultiLineProps<T>) {
|
|
99
|
+
const { series, chartId, height, legend, ariaLabel } = props
|
|
100
|
+
const [highlightedKey, setHighlightedKey] = useState<string | null>(null)
|
|
101
|
+
|
|
102
|
+
// Default line overlays to the redesign's 1.9px stroke (docs/DESIGN-SPEC.md §5) — applied once
|
|
103
|
+
// here so the plotted line, the derived legend swatch, and the derived tooltip row all agree.
|
|
104
|
+
const styledSeries = useMemo<ChartSeries<T>[]>(
|
|
105
|
+
() => series.map((s) => ({ ...s, strokeWidth: s.strokeWidth ?? LINE_OVERLAY_STROKE_WIDTH })),
|
|
106
|
+
[series],
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<ChartFrame
|
|
111
|
+
series={styledSeries}
|
|
112
|
+
chartId={chartId}
|
|
113
|
+
{...(height !== undefined && { height })}
|
|
114
|
+
{...(ariaLabel !== undefined && { ariaLabel })}
|
|
115
|
+
legend={resolveLegend(legend, {
|
|
116
|
+
highlighted: highlightedKey,
|
|
117
|
+
onHighlight: setHighlightedKey,
|
|
118
|
+
})}
|
|
119
|
+
>
|
|
120
|
+
{(plot) => (
|
|
121
|
+
<MultiLinePlot
|
|
122
|
+
{...props}
|
|
123
|
+
series={styledSeries}
|
|
124
|
+
plot={plot}
|
|
125
|
+
highlightedKey={highlightedKey}
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
128
|
+
</ChartFrame>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
type MultiLinePlotProps<T> = MultiLineProps<T> & {
|
|
133
|
+
plot: { width: number; height: number }
|
|
134
|
+
highlightedKey: string | null
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** The measured plot — split from {@link MultiLineInner} so its scale/hover-sync hooks only run
|
|
138
|
+
* once `ChartFrame` has resolved a non-empty plot rect (hooks can't run inside a conditionally
|
|
139
|
+
* invoked render-prop callback). */
|
|
140
|
+
function MultiLinePlot<T>(props: MultiLinePlotProps<T>) {
|
|
141
|
+
const {
|
|
142
|
+
data,
|
|
143
|
+
chartId,
|
|
144
|
+
getX,
|
|
145
|
+
series,
|
|
146
|
+
yDomain,
|
|
147
|
+
yAutoPad = 1.1,
|
|
148
|
+
yAutoMaxFloor,
|
|
149
|
+
yAutoMinCeil = 0,
|
|
150
|
+
zones = [],
|
|
151
|
+
refLines = [],
|
|
152
|
+
numTicksX,
|
|
153
|
+
numTicksY = 5,
|
|
154
|
+
formatValue,
|
|
155
|
+
formatYTick,
|
|
156
|
+
tooltipLabel,
|
|
157
|
+
renderExtraTooltipRows,
|
|
158
|
+
markerShape = 'circle',
|
|
159
|
+
plot,
|
|
160
|
+
highlightedKey,
|
|
161
|
+
} = props
|
|
162
|
+
|
|
163
|
+
// A series stays at full opacity when nothing is highlighted, when it IS the highlighted series,
|
|
164
|
+
// or when it is a companion of the highlighted series (its `parent` matches).
|
|
165
|
+
const dimOpacity = (s: ChartSeries<T>): number =>
|
|
166
|
+
highlightedKey === null || s.key === highlightedKey || s.parent === highlightedKey ? 1 : 0.25
|
|
167
|
+
|
|
168
|
+
const MARGIN = VX.margin
|
|
169
|
+
const xMax = plot.width - MARGIN.left - MARGIN.right
|
|
170
|
+
const yMax = plot.height - MARGIN.top - MARGIN.bottom
|
|
171
|
+
|
|
172
|
+
const xScale = useMemo(
|
|
173
|
+
() =>
|
|
174
|
+
scalePoint<string>({
|
|
175
|
+
// Full calendar — axis does not compress across nulls.
|
|
176
|
+
domain: data.map(getX),
|
|
177
|
+
range: [0, xMax],
|
|
178
|
+
padding: 0.3,
|
|
179
|
+
}),
|
|
180
|
+
[data, xMax, getX],
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
const yScale = useMemo(() => {
|
|
184
|
+
if (yDomain === 'auto') {
|
|
185
|
+
let dataMax = -Infinity
|
|
186
|
+
let dataMin = Infinity
|
|
187
|
+
for (const d of data) {
|
|
188
|
+
for (const s of series) {
|
|
189
|
+
const v = s.getValue(d)
|
|
190
|
+
if (v === null || v === undefined || Number.isNaN(v)) continue
|
|
191
|
+
if (v > dataMax) dataMax = v
|
|
192
|
+
if (v < dataMin) dataMin = v
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const safeMax = Number.isFinite(dataMax) ? dataMax : 0
|
|
196
|
+
const safeMin = Number.isFinite(dataMin) ? dataMin : 0
|
|
197
|
+
const upper = Math.max(safeMax, yAutoMaxFloor ?? safeMax) * yAutoPad
|
|
198
|
+
const lower = padAutoLower(Math.min(safeMin, yAutoMinCeil), yAutoPad)
|
|
199
|
+
return scaleLinear<number>({ domain: [lower, upper], range: [yMax, 0], nice: true })
|
|
200
|
+
}
|
|
201
|
+
return scaleLinear<number>({ domain: yDomain, range: [yMax, 0] })
|
|
202
|
+
}, [data, series, yDomain, yMax, yAutoPad, yAutoMaxFloor, yAutoMinCeil])
|
|
203
|
+
|
|
204
|
+
const tooltipStyles = useTooltipStyles()
|
|
205
|
+
const { tip, tooltipRef, syncedPoint, isDirectHover, handleMouse, handleLeave } = useHoverSync<T>(
|
|
206
|
+
{
|
|
207
|
+
data,
|
|
208
|
+
chartId,
|
|
209
|
+
getKey: getX,
|
|
210
|
+
xScale,
|
|
211
|
+
marginLeft: MARGIN.left,
|
|
212
|
+
},
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
const tickValues = useMemo(
|
|
216
|
+
() =>
|
|
217
|
+
numTicksX ? smartTicksEvery(data.map(getX), numTicksX) : smartTicks(data.map(getX), xMax),
|
|
218
|
+
[data, xMax, getX, numTicksX],
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
// Per-series valid points, computed once per (data, series) change — not re-walked inside the
|
|
222
|
+
// render map on every paint (parity with ZonedLine's single `valid` memo). Reused by the lines,
|
|
223
|
+
// the per-point markers, and the synced dots.
|
|
224
|
+
type LinePt = { __d: T; __y: number }
|
|
225
|
+
const seriesPts = useMemo(() => {
|
|
226
|
+
const out = new Map<string, LinePt[]>()
|
|
227
|
+
for (const s of series) {
|
|
228
|
+
const pts: LinePt[] = []
|
|
229
|
+
for (const d of data) {
|
|
230
|
+
const v = s.getValue(d)
|
|
231
|
+
if (v !== null && v !== undefined && !Number.isNaN(v)) pts.push({ __d: d, __y: v })
|
|
232
|
+
}
|
|
233
|
+
out.set(s.key, pts)
|
|
234
|
+
}
|
|
235
|
+
return out
|
|
236
|
+
}, [data, series])
|
|
237
|
+
|
|
238
|
+
const tooltipLbl = tip ? (tooltipLabel?.(tip.data) ?? null) : null
|
|
239
|
+
|
|
240
|
+
return (
|
|
241
|
+
<>
|
|
242
|
+
<svg width={plot.width} height={plot.height}>
|
|
243
|
+
<Group left={MARGIN.left} top={MARGIN.top}>
|
|
244
|
+
<GridRows scale={yScale} width={xMax} stroke={VX.grid} numTicks={numTicksY} />
|
|
245
|
+
|
|
246
|
+
<ZoneRects zones={zones} width={xMax} leftScale={yScale} />
|
|
247
|
+
|
|
248
|
+
{refLines.map((r, i) => (
|
|
249
|
+
<line
|
|
250
|
+
key={`ref-${i}`}
|
|
251
|
+
x1={0}
|
|
252
|
+
x2={xMax}
|
|
253
|
+
y1={yScale(r.value)}
|
|
254
|
+
y2={yScale(r.value)}
|
|
255
|
+
stroke={r.color}
|
|
256
|
+
strokeDasharray={r.dashed ? VX.dashArray : undefined}
|
|
257
|
+
/>
|
|
258
|
+
))}
|
|
259
|
+
|
|
260
|
+
{series.map((s) => {
|
|
261
|
+
const valid = seriesPts.get(s.key) ?? []
|
|
262
|
+
if (valid.length === 0) return null
|
|
263
|
+
return (
|
|
264
|
+
<LinePath<LinePt>
|
|
265
|
+
key={`line-${s.key}`}
|
|
266
|
+
data={valid}
|
|
267
|
+
x={(p) => xScale(getX(p.__d)) ?? 0}
|
|
268
|
+
y={(p) => yScale(p.__y)}
|
|
269
|
+
stroke={s.color}
|
|
270
|
+
strokeWidth={s.strokeWidth ?? VX.lineWidth}
|
|
271
|
+
strokeDasharray={s.dash === 'dashed' ? VX.dashArray : undefined}
|
|
272
|
+
strokeOpacity={dimOpacity(s)}
|
|
273
|
+
curve={curveMonotoneX}
|
|
274
|
+
/>
|
|
275
|
+
)
|
|
276
|
+
})}
|
|
277
|
+
|
|
278
|
+
{series.flatMap((s) => {
|
|
279
|
+
const getMarker = s.getMarker
|
|
280
|
+
if (!getMarker) return [] as ReactNode[]
|
|
281
|
+
const op = dimOpacity(s)
|
|
282
|
+
const markers: ReactNode[] = []
|
|
283
|
+
for (const p of seriesPts.get(s.key) ?? []) {
|
|
284
|
+
const m = getMarker(p.__d)
|
|
285
|
+
if (m === null) continue
|
|
286
|
+
const cx = xScale(getX(p.__d)) ?? 0
|
|
287
|
+
const cy = yScale(p.__y)
|
|
288
|
+
const color = m.color ?? s.color
|
|
289
|
+
const r = m.r ?? (markerShape === 'star' ? STAR_R : VX.dotR)
|
|
290
|
+
markers.push(
|
|
291
|
+
markerShape === 'star' ? (
|
|
292
|
+
<path
|
|
293
|
+
key={`mk-${s.key}-${getX(p.__d)}`}
|
|
294
|
+
d={starPath(cx, cy, r)}
|
|
295
|
+
fill={color}
|
|
296
|
+
stroke={VX.dotStroke}
|
|
297
|
+
strokeWidth={1.5}
|
|
298
|
+
fillOpacity={op}
|
|
299
|
+
strokeOpacity={op}
|
|
300
|
+
/>
|
|
301
|
+
) : (
|
|
302
|
+
<circle
|
|
303
|
+
key={`mk-${s.key}-${getX(p.__d)}`}
|
|
304
|
+
cx={cx}
|
|
305
|
+
cy={cy}
|
|
306
|
+
r={r}
|
|
307
|
+
fill={color}
|
|
308
|
+
stroke={VX.dotStroke}
|
|
309
|
+
strokeWidth={2}
|
|
310
|
+
fillOpacity={op}
|
|
311
|
+
strokeOpacity={op}
|
|
312
|
+
/>
|
|
313
|
+
),
|
|
314
|
+
)
|
|
315
|
+
}
|
|
316
|
+
return markers
|
|
317
|
+
})}
|
|
318
|
+
|
|
319
|
+
{syncedPoint &&
|
|
320
|
+
(() => {
|
|
321
|
+
const sx = xScale(getX(syncedPoint)) ?? 0
|
|
322
|
+
return (
|
|
323
|
+
<>
|
|
324
|
+
<Crosshair x={sx} top={0} bottom={yMax} />
|
|
325
|
+
{series.map((s) => {
|
|
326
|
+
const v = s.getValue(syncedPoint)
|
|
327
|
+
if (v === null || v === undefined || Number.isNaN(v)) return null
|
|
328
|
+
return <SeriesDot key={`dot-${s.key}`} cx={sx} cy={yScale(v)} color={s.color} />
|
|
329
|
+
})}
|
|
330
|
+
</>
|
|
331
|
+
)
|
|
332
|
+
})()}
|
|
333
|
+
|
|
334
|
+
<AxisLeftNumeric
|
|
335
|
+
scale={yScale}
|
|
336
|
+
numTicks={numTicksY}
|
|
337
|
+
{...(formatYTick !== undefined && { tickFormat: formatYTick })}
|
|
338
|
+
/>
|
|
339
|
+
<AxisBottomDate top={yMax} scale={xScale} tickValues={tickValues} />
|
|
340
|
+
|
|
341
|
+
<HoverOverlay width={xMax} height={yMax} onMove={handleMouse} onLeave={handleLeave} />
|
|
342
|
+
</Group>
|
|
343
|
+
</svg>
|
|
344
|
+
<ChartTooltip tip={isDirectHover ? tip : null} tooltipRef={tooltipRef} styles={tooltipStyles}>
|
|
345
|
+
{tip && isDirectHover && (
|
|
346
|
+
<>
|
|
347
|
+
<TooltipHeader
|
|
348
|
+
date={getX(tip.data)}
|
|
349
|
+
{...(tooltipLbl !== null && { label: tooltipLbl.text, labelColor: tooltipLbl.color })}
|
|
350
|
+
/>
|
|
351
|
+
<TooltipBody>
|
|
352
|
+
{deriveTooltipRows(series, tip.data, formatValue).map((row) => (
|
|
353
|
+
<TooltipRow
|
|
354
|
+
key={row.key}
|
|
355
|
+
color={row.color}
|
|
356
|
+
label={row.label}
|
|
357
|
+
value={row.value}
|
|
358
|
+
shape={row.shape}
|
|
359
|
+
dashed={row.dashed}
|
|
360
|
+
{...(row.strokeWidth !== undefined && { strokeWidth: row.strokeWidth })}
|
|
361
|
+
/>
|
|
362
|
+
))}
|
|
363
|
+
{renderExtraTooltipRows?.(tip.data)}
|
|
364
|
+
</TooltipBody>
|
|
365
|
+
</>
|
|
366
|
+
)}
|
|
367
|
+
</ChartTooltip>
|
|
368
|
+
</>
|
|
369
|
+
)
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Hand-memoized: React Compiler does not process the shipped dist, so the hot MultiLine kind is
|
|
374
|
+
* wrapped in `React.memo` to retain the auto-memoization it had as source (parity with ZonedLine).
|
|
375
|
+
*/
|
|
376
|
+
export const MultiLine = memo(MultiLineInner) as typeof MultiLineInner
|