basalt-ui 0.4.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +70 -0
- package/CHANGELOG.md +210 -40
- package/LICENSE +201 -0
- package/README.md +421 -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/skills/basalt-app/SKILL.md +137 -0
- package/agent/skills/basalt-charts/SKILL.md +179 -0
- package/agent/skills/basalt-design/SKILL.md +249 -0
- package/agent/templates/CLAUDE-block.md.tpl +38 -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-ui.mjs +14 -0
- package/configs/check.yml +29 -0
- package/configs/lefthook.yml +25 -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 +292 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +889 -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 +386 -0
- package/dist/surfaces.d.ts.map +1 -0
- package/dist/surfaces.js +312 -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 +152 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +249 -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 +668 -0
- package/src/cli/help.test.ts +93 -0
- package/src/cli/index.ts +1535 -0
- package/src/cli/init-sync.test.ts +160 -0
- package/src/cli/placement-engine.test.ts +194 -0
- package/src/cli/tarball-parity.test.ts +44 -0
- package/src/cli/template-format.test.ts +64 -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 +508 -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 +369 -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,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: basalt-ui
|
|
3
|
+
description: Color, spacing, radius, and type discipline — route every value through the basalt-ui token system. Enforced by `basalt check-theme`.
|
|
4
|
+
paths:
|
|
5
|
+
- 'src/**'
|
|
6
|
+
- 'apps/**/src/**'
|
|
7
|
+
- 'packages/**/src/**'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Basalt Tokens — Color, Spacing, Radius, Type
|
|
11
|
+
|
|
12
|
+
basalt-ui ships one color/type/spacing/radius identity shared by the Mantine chrome and the visx
|
|
13
|
+
charts. The **identity is modern zinc** (see `docs/DESIGN-SPEC.md` in the basalt-ui repo) —
|
|
14
|
+
**cool-neutral zinc surfaces**
|
|
15
|
+
(Tailwind zinc family) on both light and dark, low-contrast panel lift on a slightly darker page,
|
|
16
|
+
depth via a whisper shadow + 1px ring (`shadow-card`) rather than a hairline border, carrying
|
|
17
|
+
**one saturated sky-blue accent**, split by ROLE: as INK (links, active-nav icon, chart
|
|
18
|
+
lines, focus ring) it is `#0077bd` light / `#8ec5ff` dark; as a FILLED SURFACE it is
|
|
19
|
+
`#0077bd` in BOTH schemes with a WHITE label (`--vx-accentFill`, never `--vx-accent`). Neutrals do ~90% of the
|
|
20
|
+
surface (60/30/10, pushed toward 90/10); the accent only points — primary CTA, focus, links, small
|
|
21
|
+
status pops — never floods. (Blueprint/Basalt zinc-charcoal are the historical hue-tuning
|
|
22
|
+
ancestors; `docs/DESIGN-SPEC.md` in the basalt-ui repo supersedes both — see its "Doctrine
|
|
23
|
+
inversions" section.) This
|
|
24
|
+
rule is the operational checklist; it is enforced mechanically by **`basalt check-theme`**
|
|
25
|
+
(wire it into `lint`: `oxlint . && basalt check-theme`). A violation fails the build. Escape hatch: a
|
|
26
|
+
`theme-allow` line comment (diff-visible, deliberate).
|
|
27
|
+
|
|
28
|
+
`check-theme` reads its config from your `package.json` `"basalt"` key
|
|
29
|
+
(`{ roots?, exempt?, spacingSteps?, forbiddenAccents? }`); set `roots` to your source dirs and `exempt`
|
|
30
|
+
to the files that legitimately define palette values.
|
|
31
|
+
|
|
32
|
+
## Filled surfaces — the fill band
|
|
33
|
+
|
|
34
|
+
A filled control is a SURFACE, not ink, and it does not invert across schemes. It is squeezed from
|
|
35
|
+
both sides at once: a **white label** needs ≥4.5:1 against the fill, and the control needs ≥3:1
|
|
36
|
+
against the page behind it — on BOTH pages. That leaves one narrow luminance band, so:
|
|
37
|
+
|
|
38
|
+
- **Every family's fill sits in that band** (`FILL` / `ACCENT` in the palette): the hue varies, the
|
|
39
|
+
luminance does not. Every filled surface therefore reads WHITE, on either page, at ~4.9:1.
|
|
40
|
+
- **Never fill with the ink accent.** `--vx-accent` is light on dark by design (it is read against
|
|
41
|
+
the page) — filling with it puts a white label on a light blue button. Fill with
|
|
42
|
+
`--vx-accentFill` / `--vx-fill-{family}`; label with `--vx-onAccent` / `--vx-on-{family}`.
|
|
43
|
+
- **Never decide a foreground yourself**, and do not trust Mantine's `autoContrast`: it resolves the
|
|
44
|
+
color once in JS, scheme-blindly, using a brightness heuristic that does not track WCAG contrast.
|
|
45
|
+
The theme emits `--vx-on-*` per scheme instead, and every filled control is bound to it.
|
|
46
|
+
- Hover is **derived** from the fill in CSS, so retuning a fill carries its hover along.
|
|
47
|
+
|
|
48
|
+
Retuning a fill OUTSIDE the band breaks its label. `theme/contrast.test.ts` fails the build on it.
|
|
49
|
+
|
|
50
|
+
## Color — never a raw literal
|
|
51
|
+
|
|
52
|
+
- **No raw `#hex` / `rgb()` / `rgba()` / `hsl()`** in scanned source. Route every color through the
|
|
53
|
+
palette: `VX.*` tokens (from `basalt-ui/tokens` or `basalt-ui/charts` — they are CSS vars, so they
|
|
54
|
+
work in components AND non-component files), or the Mantine theme (`color`/`c`/`bg` props, `theme.colors`).
|
|
55
|
+
Opacity via `alpha(token, a)` — never `rgba()` — so the hue keeps resolving per color scheme.
|
|
56
|
+
- **No off-identity Mantine accents.** `color`/`c`/`bg`/`backgroundColor` must not be
|
|
57
|
+
`teal`/`violet`/`grape`/`indigo`/`pink`. `createBasaltTheme` reskins _every_ Mantine accent to the
|
|
58
|
+
Basalt identity, so those names still render on-palette — but the guard rejects them because they
|
|
59
|
+
signal off-identity intent. Allowed accents: **`blue`** (the one earned identity hue — the
|
|
60
|
+
saturated sky accent), **`gray`** (neutral), and the status hues **`red`/`green`/`orange`/`yellow`**
|
|
61
|
+
(muted/forest, never raw Material/AntD). Categorical/series color goes through series tokens
|
|
62
|
+
(`defineSeries` → `seriesTokens`/`groupTokens`), never a Mantine accent prop. Success-button flips
|
|
63
|
+
and positive deltas use `color="green"` (forest green), not `teal` (vivid turquoise).
|
|
64
|
+
- **"Ink earns its color"** — default to neutral. A hue is justified only for trend, signal/status,
|
|
65
|
+
or genuine multi-series separation. A count badge is a signal → it may carry blue; a nav active-state
|
|
66
|
+
is UI chrome → it stays neutral (`NavCountBadge` already encodes this). Active nav renders a
|
|
67
|
+
**neutral surface fill** + plain text + a weight bump, never the accent — baked into the theme's
|
|
68
|
+
NavLink `--nl-*` defaults across every render path (including a router `<Link>` via `renderNavLink`).
|
|
69
|
+
- **Accent restraint, mechanically.** The accent lands on exactly the single primary CTA per view
|
|
70
|
+
(`variant="filled"`), focus rings, links, and small status pops — nowhere else. Routine/secondary
|
|
71
|
+
buttons use `variant="default"` (neutral); don't reach for a colored `variant="light"` (it reads
|
|
72
|
+
washed-out on the warm light canvas). Neutrals carry borders, large fills, and routine icons.
|
|
73
|
+
|
|
74
|
+
## Surfaces — one collapsed token set
|
|
75
|
+
|
|
76
|
+
The surface token set is **`bg` · `panel` · `elevated` · `subtle` · `border`**:
|
|
77
|
+
|
|
78
|
+
- `--vx-surface-bg` (`VX.surface.bg`) — the page background.
|
|
79
|
+
- `--vx-surface-panel` (`VX.surface.panel`) — the card/`Paper` background.
|
|
80
|
+
- `--vx-surface-elevated` (`VX.surface.elevated`) — a lifted surface (chart areas, tooltips).
|
|
81
|
+
- `--vx-surface-subtle` (`VX.surface.subtle`) — a faint hover/striped/track surface: a step
|
|
82
|
+
**below white on light** (`#f2f2f1`), **above panel on dark** (`#323239`). Used for Table
|
|
83
|
+
hover/striped rows, `Code`, the `SegmentedControl` track, and Tabs/Accordion/Menu hover.
|
|
84
|
+
- `--vx-surface-border` (`VX.surface.border`) — the single hairline border token.
|
|
85
|
+
|
|
86
|
+
The theme **collapses Mantine's raw ramp steps onto these tokens** (`cssVariablesResolver` plus
|
|
87
|
+
theme `styles`): light/dark border ramp steps → `--vx-surface-border`, light hover steps →
|
|
88
|
+
`--vx-surface-subtle`, card bg → `--vx-surface-panel`, `--app-shell-border-color` →
|
|
89
|
+
`--vx-surface-border`. So **every** Mantine component (AppShell, Table, Input, Divider, Tabs,
|
|
90
|
+
Popover, Accordion, cards) renders one border shade, one card background, and one radius
|
|
91
|
+
(`--vx-radius-card`). Never inline a surface color or reach for a raw ramp-step var
|
|
92
|
+
(`var(--mantine-color-gray-N)`) — the `off-system-surface-var` guard rejects it.
|
|
93
|
+
|
|
94
|
+
## Spacing & radius — prefer the scale token
|
|
95
|
+
|
|
96
|
+
- `baseTheme` owns the scales: `spacing` 10/12/16/20/32 → `xs…xl`, `radius` 2/4/8/16/32 → `xs…xl`.
|
|
97
|
+
**Use the token**, not the raw number, when a value equals a step: `p="md"` not `p={16}`,
|
|
98
|
+
`gap="sm"` not `gap={12}`, `radius="sm"` not `radius={4}`. The guard flags exact token-equals
|
|
99
|
+
(`p={16}`, any numeric `radius`).
|
|
100
|
+
- **Card radius has one source: `--vx-radius-card` (7px) = `VX.radiusCard`.** Every
|
|
101
|
+
card corner — the Mantine chrome (`Card`/`Paper`, `radius="md"`) and the Mantine-free `ChartCard`
|
|
102
|
+
(`var(--vx-radius-card)`) — resolves to this single token; cards must never diverge. Don't inline
|
|
103
|
+
a `borderRadius` on a surface (the `raw-surface` guard rejects it).
|
|
104
|
+
- **Dense by default.** The framework targets compact (Linear/Notion) surfaces — prefer the tighter
|
|
105
|
+
spacing step (`sm`/`xs`) for shell, nav, and card padding rather than `md`/`lg` air (see
|
|
106
|
+
basalt-mantine.md for the shipped dense defaults).
|
|
107
|
+
- **Sub-scale micro-spacing is legitimate and allowed raw** — `gap={2}`, `pl={4}`, `mt={6}` have no
|
|
108
|
+
token equivalent (the scale starts at 10). Use them freely for tight clusters; don't invent
|
|
109
|
+
micro-tokens or pepper `theme-allow`. One-off layout dims (`h={36}`, `w={64}`) are also fine raw.
|
|
110
|
+
- **Icons** size via the icon's own `size` prop (`size={16}`), not spacing tokens — that's not spacing.
|
|
111
|
+
|
|
112
|
+
## Type
|
|
113
|
+
|
|
114
|
+
- A shipped **three-font system**: `Nunito Sans Variable` (body), `Hubot Sans Variable` (headings,
|
|
115
|
+
brand, card titles — always `font-stretch: 88%`), `JetBrains Mono Variable` (all numerals,
|
|
116
|
+
micro-labels, kbd/badges, axis ticks). Fonts ship as exact-pinned `@fontsource-variable/*` deps,
|
|
117
|
+
`@import`ed in `styles.css`; the `--basalt-font-{sans,head,mono}` vars stay the override seam
|
|
118
|
+
(system-font fallback chains preserved). Type is carried by Mantine's `fontSizes` + `headings` +
|
|
119
|
+
the named `fontWeights` ladder (`fw="semibold"`, `fw="medium"`, …) and `fontFamilyMonospace` for
|
|
120
|
+
numbers. Don't hard-code `fontSize` in px on chrome; use `size`/`fz` tokens.
|
|
121
|
+
|
|
122
|
+
## `groupTokens` ↔ `paletteOptions.groups` — the prefix lockstep
|
|
123
|
+
|
|
124
|
+
`groupTokens(GROUP, MAP)` (from `basalt-ui/tokens` or `basalt-ui/charts`) generates `var(--vx-GROUP-key)`
|
|
125
|
+
refs assuming the same map is also handed to `BasaltProvider`'s `paletteOptions.groups` under the key
|
|
126
|
+
`` `${GROUP}-` `` (**with the trailing dash** — `paletteOptions.groups` is keyed by CSS-var _prefix_,
|
|
127
|
+
not by group name). Drift between the two — e.g. calling `groupTokens('activity', MAP)` but wiring
|
|
128
|
+
`paletteOptions={{ groups: { activity: MAP } }}` (missing the dash) — emits token refs that point at
|
|
129
|
+
CSS variables the palette stylesheet never declares: no tsc error, silent unstyled/transparent charts
|
|
130
|
+
at runtime. Derive both from one `GROUP` constant so they can't drift:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
// theme/series.ts
|
|
134
|
+
export const GROUP = 'activity'
|
|
135
|
+
export const colors = groupTokens(GROUP, SERIES) // -> var(--vx-activity-key)
|
|
136
|
+
export const paletteGroups = { [`${GROUP}-`]: SERIES } // -> { 'activity-': SERIES }
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```tsx
|
|
140
|
+
// main.tsx
|
|
141
|
+
<BasaltProvider paletteOptions={{ groups: paletteGroups }}>{/* app */}</BasaltProvider>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## When the guard fires
|
|
145
|
+
|
|
146
|
+
Fix the source, don't silence it — reach for the right token first. Only add `theme-allow` for a
|
|
147
|
+
genuine, documented exception (e.g. a third-party widget needing a literal). The palette-definition
|
|
148
|
+
files are listed in your `exempt` set so they don't self-trip.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: basalt-app
|
|
3
|
+
description: Scaffold or refresh a basalt-ui app — guided wrapper around 'basalt-ui init' (first-time scaffold) and 'basalt-ui sync' (drift-managed refresh). The whole agentic layer ships in the npm package — init places the skills, rules, CLAUDE block, and DESIGN.md; sync keeps the managed half fresh. Use when setting up basalt-ui in a new/existing app, wiring the provider/shell/vite preset, or when the doctrine feels missing.
|
|
4
|
+
when_to_use: User is adding basalt-ui to a new or existing app, asks how to set it up / scaffold it, wants to wire BasaltProvider / BasaltShell / the vite preset, refresh the shipped rules and DESIGN.md, or run a freshness check in CI. Also when /basalt-design reports no consumer DESIGN.md (the app isn't scaffolded yet).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
`/basalt-app` scaffolds a basalt-ui consumer and keeps its shipped doctrine fresh. It wraps the two
|
|
8
|
+
CLI subcommands — `basalt-ui init` (first run) and `basalt-ui sync` (refresh) — and explains the
|
|
9
|
+
wiring they don't do for you (provider, shell, vite). All of it via `bunx basalt-ui` (Bun runtime).
|
|
10
|
+
|
|
11
|
+
## One package, one command, one version
|
|
12
|
+
|
|
13
|
+
Everything ships in the `basalt-ui` npm package — components, toolchain presets, rules, skills,
|
|
14
|
+
templates. Becoming a consumer is exactly two steps:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
bun add basalt-ui
|
|
18
|
+
bunx basalt-ui init
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
There is no plugin and no marketplace. `init`/`sync` place every file with one of two modes, and
|
|
22
|
+
which mode a file gets answers a single question — **does Claude read it?**
|
|
23
|
+
|
|
24
|
+
| Mode | Files | Lifecycle |
|
|
25
|
+
| ----------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| **managed** | `.claude/rules/basalt-*.md`, `.claude/skills/basalt-*/SKILL.md`, the `CLAUDE.md` block | basalt owns it; `sync` refreshes it; a local edit is skipped and reported (`--force` overwrites); the sync diff is the review gate |
|
|
27
|
+
| **seed** | `DESIGN.md`, `.oxlintrc.json`, `.oxfmtrc.json`, `lefthook.yml`, `.github/workflows/check.yml`, optional scaffolds | written once, then yours forever; `sync` recreates it only when missing and never reports it |
|
|
28
|
+
|
|
29
|
+
Claude Code cannot load rules or skills from `node_modules` — that platform limit is the only
|
|
30
|
+
reason anything is copied. Everything a machine reads is a **reference** instead: the seeded
|
|
31
|
+
`.oxlintrc.json` and `lefthook.yml` just `extends` the presets inside
|
|
32
|
+
`node_modules/basalt-ui/configs/`, so the toolchain auto-updates with the package while you still
|
|
33
|
+
own the files.
|
|
34
|
+
|
|
35
|
+
## First-time scaffold: `bunx basalt-ui init`
|
|
36
|
+
|
|
37
|
+
`init` writes the repo-side doctrine and toolchain into a consumer (monorepo globs supported):
|
|
38
|
+
|
|
39
|
+
- `.claude/rules/basalt-*.md` — the twelve shipped rules (`basalt-tokens`, `basalt-charts`,
|
|
40
|
+
`basalt-mantine`, `basalt-router`, `basalt-query`, `basalt-state`, `basalt-forms`,
|
|
41
|
+
`basalt-notifications`, `basalt-commands`, `basalt-data`, `basalt-agent`, `basalt-content`),
|
|
42
|
+
managed verbatim.
|
|
43
|
+
- `.claude/skills/basalt-{app,charts,design}/SKILL.md` — the three skills (`/basalt-app`,
|
|
44
|
+
`/basalt-charts`, `/basalt-design`), managed verbatim, same path the rules take.
|
|
45
|
+
- A managed `<!-- basalt:begin --> ... <!-- basalt:end -->` block in `CLAUDE.md`: stack facts, the
|
|
46
|
+
**DESIGN.md-is-law** pointer, and the **frontend-design restraint override** (in a dashboard, the
|
|
47
|
+
bold move is calm — defer to `/basalt-design`, not generic "make it striking" instincts).
|
|
48
|
+
- A **thin** `DESIGN.md` seed (deltas only on top of the `basalt-*` rules): identity confirmation,
|
|
49
|
+
the series dictionary, app deviations. The CLAUDE block `@`-imports it, so it auto-loads.
|
|
50
|
+
- Toolchain seeds: `.oxlintrc.json` and `lefthook.yml` are `extends` stubs pointing into
|
|
51
|
+
`node_modules/basalt-ui/configs/`; `.oxfmtrc.json` is a starting copy (oxfmt has no `extends`);
|
|
52
|
+
`.github/workflows/check.yml` is a starting workflow. All four are yours after the first write.
|
|
53
|
+
- `.basalt/manifest.json` — a sha256 per managed file + the basalt-ui version that wrote it, so
|
|
54
|
+
`sync` can three-way diff and `doctor` can spot a stale install.
|
|
55
|
+
|
|
56
|
+
After `init`, do the runtime wiring (the CLI scaffolds files, not your app's composition):
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
// Provider — wraps MantineProvider, injects the --vx-* palette, bridges the Vx tokens
|
|
60
|
+
import { BasaltProvider } from 'basalt-ui'
|
|
61
|
+
;<BasaltProvider>{/* app */}</BasaltProvider>
|
|
62
|
+
|
|
63
|
+
// Shell — sidebar / mobile-nav / breadcrumbs / page-header; router-agnostic
|
|
64
|
+
import { BasaltShell, NavCountBadge, ThemeToggle } from 'basalt-ui'
|
|
65
|
+
// <ThemeToggle /> in globalActions — cycles light/dark/system on click, hover/focus reveals
|
|
66
|
+
// a direct-select popover. Animated (motion) sun/moon glyph, never a computer/monitor icon.
|
|
67
|
+
|
|
68
|
+
// Theme — start from the base, override deltas only
|
|
69
|
+
import { createBasaltTheme } from 'basalt-ui'
|
|
70
|
+
const theme = createBasaltTheme({
|
|
71
|
+
/* app deltas */
|
|
72
|
+
})
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
// vite.config.ts — the shipped preset (dedupe react + @mantine/*, strictPort, /api proxy, BASALT_LOCAL alias)
|
|
77
|
+
import { basaltViteConfig } from 'basalt-ui/vite'
|
|
78
|
+
export default basaltViteConfig({ port: 5173, apiTarget: 'http://localhost:3000' })
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```js
|
|
82
|
+
// Tailwind era is over — there is no Tailwind. Styles come from:
|
|
83
|
+
import 'basalt-ui/styles.css' // @layer basalt base styles, iOS input safety net, font stack
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Lint wires as `oxlint . && basalt-ui check-theme` — the theme guard is the teeth behind the token
|
|
87
|
+
doctrine. The consumer series file (`src/lib/series.ts` by default; configurable via
|
|
88
|
+
`basalt.seriesModulePath`) is the single guard-exempt palette source — see `/basalt-charts`.
|
|
89
|
+
|
|
90
|
+
## Refresh: `bunx basalt-ui sync`
|
|
91
|
+
|
|
92
|
+
`sync` re-applies shipped doctrine after a basalt-ui upgrade, three-way against
|
|
93
|
+
`.basalt/manifest.json`:
|
|
94
|
+
|
|
95
|
+
- **Unchanged since last write** → overwrite with the new version.
|
|
96
|
+
- **Locally edited** → show a diff and **skip** (preserves your edits) unless `--force`.
|
|
97
|
+
- **Missing** → recreate.
|
|
98
|
+
- `sync --check` makes no changes and exits non-zero on drift — wire it as a CI freshness gate so a
|
|
99
|
+
consumer can't silently fall behind the shipped rules.
|
|
100
|
+
|
|
101
|
+
Seeds (`DESIGN.md`, the toolchain files, the scaffolds) are never reconciled or drift-reported —
|
|
102
|
+
they are yours. The managed files (rules, skills, the CLAUDE block) are framework-owned and meant
|
|
103
|
+
to be overwritten; the sync diff is where you review a doctrine change before committing it.
|
|
104
|
+
|
|
105
|
+
## Precedence the scaffold establishes
|
|
106
|
+
|
|
107
|
+
After scaffolding, the doctrine resolves in this order (highest wins):
|
|
108
|
+
|
|
109
|
+
> consumer `DESIGN.md` (deltas) > shipped `basalt-*` rules > skills
|
|
110
|
+
|
|
111
|
+
So an app deviation goes in `DESIGN.md`; the universal law and its enforcement live in the
|
|
112
|
+
`basalt-*` rules; and the skills (`/basalt-design`, `/basalt-charts`) are the method that obeys
|
|
113
|
+
both.
|
|
114
|
+
|
|
115
|
+
## Checklist
|
|
116
|
+
|
|
117
|
+
- Ran `bun add basalt-ui && bunx basalt-ui init` — rules, skills, CLAUDE block, DESIGN.md all
|
|
118
|
+
present from the one package.
|
|
119
|
+
- `BasaltProvider` wraps the app; `createBasaltTheme` used for theme deltas; `basalt-ui/styles.css`
|
|
120
|
+
imported.
|
|
121
|
+
- `basaltViteConfig` adopted; `oxlint . && basalt-ui check-theme` is the lint command.
|
|
122
|
+
- A thin `DESIGN.md` (deltas) + the twelve `basalt-*` rules + the managed CLAUDE block are present.
|
|
123
|
+
- `src/lib/series.ts` exists as the one guard-exempt series source (for any app metric colors).
|
|
124
|
+
- `basalt-ui sync --check` wired in CI (recommended) to catch drift on future upgrades.
|
|
125
|
+
|
|
126
|
+
## Notes
|
|
127
|
+
|
|
128
|
+
- `init`, `sync`, and `check-theme` are all **real**. `sync` reconciles via a sha256 three-way diff
|
|
129
|
+
(`--check` is a CI drift gate, `--force` overwrites local edits); `check-theme` is the palette
|
|
130
|
+
guard; `doctor` verifies the installed basalt-ui version against the manifest. All via
|
|
131
|
+
`bunx basalt-ui …`.
|
|
132
|
+
- The framework ships **no** icon or notification dep — pass icons as `ReactNode` and wire toasts
|
|
133
|
+
yourself (e.g. `ThemeLabControls`' `copyIcon` / `onCopy`).
|
|
134
|
+
- The framework DOES ship `motion` (motion.dev, formerly framer-motion) as a bundled dependency —
|
|
135
|
+
animated chrome (`ThemeToggle` today) comes for free, no consumer dependency needed. Reach for
|
|
136
|
+
the shared `MOTION_DURATION` / `MOTION_SPRING` tokens for any new animated interaction rather
|
|
137
|
+
than inventing ad hoc durations/easings or a competing animation library.
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: basalt-charts
|
|
3
|
+
description: Add or extend a chart in a basalt-ui app — pick a kind vs go bespoke (Rule of Three), register a consumer series with defineSeries/groupTokens (since VX.series is app-side, not shipped), compose the visx primitives, and respect the @visx-only-in-charts + Mantine-free boundary. Use when adding a new chart, a new metric/series color, or extracting a repeated chart shape into a kind.
|
|
4
|
+
when_to_use: User wants to add a chart, restyle an existing one structurally, introduce a new metric/series and its color, extract a recurring chart shape into a reusable kind, or asks where chart series colors live / how to register them. The how-to companion to /basalt-design (which owns the aesthetic law).
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
`/basalt-charts` is the how-to for the chart system. `/basalt-design` owns the aesthetic law
|
|
8
|
+
(palette, restraint, the theme-lab loop) and the DESIGN.md precedence — read it for "what color /
|
|
9
|
+
how should this look". This skill answers "how do I wire it" with basalt-ui's `./charts` and
|
|
10
|
+
`./tokens` surfaces.
|
|
11
|
+
|
|
12
|
+
## The decision: kind vs bespoke (Rule of Three)
|
|
13
|
+
|
|
14
|
+
Before writing chart code, decide which of three paths you are on:
|
|
15
|
+
|
|
16
|
+
1. **Reuse a shipped kind.** basalt-ui ships `ZonedLine`, `Bars`, `StackedArea`, `Donut`,
|
|
17
|
+
`MultiLine`, `DualPanel`, `Heatmap`. If the shape matches, use it — props are declarative (data,
|
|
18
|
+
width/height, `getX`/`getY` accessors, zones/thresholds/refLines as plain arrays, `seriesLabel`,
|
|
19
|
+
`formatValue`). Done.
|
|
20
|
+
- **`MultiLine`** — N series on a shared y-axis: legend-hover dimming, per-series synced dots,
|
|
21
|
+
dashed companion (MA) lines, per-point markers (PR stars / status dots), zones + refLines,
|
|
22
|
+
fixed or auto domain (also covers z-score/σ charts via a fixed symmetric domain + zero
|
|
23
|
+
refLine). Replaces bespoke multi-line / relative-progression / training-load /
|
|
24
|
+
strength-composite / fitness-trends.
|
|
25
|
+
- **`DualPanel`** — top line-pane + bottom signed-histogram pane sharing ONE x-scale and ONE
|
|
26
|
+
cursor; optional fill-between two top lines, zones, refLines. Replaces bespoke divergence /
|
|
27
|
+
momentum.
|
|
28
|
+
- **`Heatmap`** — category×category intensity grid (`color-mix` alpha), per-cell tooltip,
|
|
29
|
+
optional gradient legend strip. Replaces bespoke time-of-day.
|
|
30
|
+
2. **Extract a new kind (second instance of a pattern).** When you are about to build the _second_
|
|
31
|
+
chart of a shape that has no shipped kind, extract a kind. Don't extract on the first; don't
|
|
32
|
+
wait past the third. A new kind lives in the consumer's chart kinds dir (or, if generic enough
|
|
33
|
+
to promote, gets contributed to basalt-ui `src/charts/kinds/`). Migrate both call sites onto it.
|
|
34
|
+
3. **Stay bespoke (genuinely unique).** A one-off dual-panel shape (e.g. MACD) composes the
|
|
35
|
+
primitives directly in the page's chart file — not in `kinds/`.
|
|
36
|
+
|
|
37
|
+
> Anti-pattern: a single `<Chart type="..." config={...} />` god-component that switches by kind.
|
|
38
|
+
> That is the Recharts trap. Prefer N small kinds. **If a chart doesn't fit the primitives, add a
|
|
39
|
+
> kind — don't loosen the primitives.**
|
|
40
|
+
|
|
41
|
+
A good kind's props: `data`, `width`, `height`, `chartId`, generic `getX`/`getY` accessors, zones /
|
|
42
|
+
thresholds / refLines arrays, `seriesLabel`, `formatValue`, optional `tooltipLabel`. Bespoke escape
|
|
43
|
+
hatches (`renderExtraTooltipRows`) are fine; they must not grow into a god-object config.
|
|
44
|
+
|
|
45
|
+
## Register a consumer series (VX.series is app-side)
|
|
46
|
+
|
|
47
|
+
The framework ships generic primitives and the framework palette (semantic / status / neutral /
|
|
48
|
+
surface) — **but not a domain series tree.** `VX.series` does not exist in basalt-ui; argo's
|
|
49
|
+
`SERIES`/`ACTIVITY`/`USAGE_*` maps stayed app-side. Each consumer rebuilds its own series in **one
|
|
50
|
+
guard-exempt file** (e.g. `src/lib/series.ts`), using the shipped extensibility helpers from
|
|
51
|
+
`basalt-ui/tokens`:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// src/lib/series.ts — the ONE file exempt from `basalt-ui check-theme` (it IS the palette source)
|
|
55
|
+
import { defineSeries, groupTokens, seriesTokens, buildPaletteCss } from 'basalt-ui/tokens'
|
|
56
|
+
|
|
57
|
+
// 1. Author the per-theme pairs (hue keeps identity, shifts shade across schemes).
|
|
58
|
+
const HEALTH = defineSeries({
|
|
59
|
+
hrv: { light: '#634DBF', dark: '#7C6BD6' }, // violet — lighter on dark to avoid glow
|
|
60
|
+
restingHr: { light: '#C22762', dark: '#E0639A' },
|
|
61
|
+
})
|
|
62
|
+
const WALKING = defineSeries({
|
|
63
|
+
intensityMin: { light: '#3F7D4F', dark: '#5FA372' }, // forest green — muted status hue
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
// 2. Turn the maps into namespaced token refs (var(--vx-health-hrv), ...).
|
|
67
|
+
// seriesTokens(map, prefix?) for a flat namespace; groupTokens(name, map) namespaces under name.
|
|
68
|
+
export const SERIES = {
|
|
69
|
+
...seriesTokens(HEALTH), // → { hrv: 'var(--vx-hrv)', restingHr: 'var(--vx-restingHr)' }
|
|
70
|
+
walking: groupTokens('walking', WALKING), // → { intensityMin: 'var(--vx-walking-intensityMin)', ... }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// 3. Feed the same maps into the palette CSS so the vars exist in both schemes.
|
|
74
|
+
export const PALETTE_CSS = buildPaletteCss({
|
|
75
|
+
groups: { health: HEALTH, walking: WALKING },
|
|
76
|
+
derived: ['--vx-hrv-area: 12%'], // optional scheme-independent derived vars
|
|
77
|
+
})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- `seriesTokens` / `groupTokens` are **exact-keyed**: a typo or a stale key fails `tsc`, so the
|
|
81
|
+
token surface can't silently drift from the palette data.
|
|
82
|
+
- `defineSeries` is the typed authoring entry — it returns the map (sugar; pairs feed both the CSS
|
|
83
|
+
and the tokens).
|
|
84
|
+
- Inject `PALETTE_CSS` once (BasaltProvider injects the framework palette; the consumer appends its
|
|
85
|
+
series CSS — or passes `injectPalette={false}` and head-injects both).
|
|
86
|
+
- Then charts read `SERIES.hrv`, never a hex. This is what keeps `basalt-ui check-theme` green.
|
|
87
|
+
|
|
88
|
+
Theme tuning of these series happens in the theme lab — pass them as `groups` to
|
|
89
|
+
`ThemeLabControls` (see `/basalt-design`).
|
|
90
|
+
|
|
91
|
+
## Compose the primitives (never hand-roll)
|
|
92
|
+
|
|
93
|
+
Every chart — kind or bespoke — composes the shipped primitives. The contract is social and
|
|
94
|
+
lint-backed; it is easier to compose them than to work around them.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import {
|
|
98
|
+
ChartCard,
|
|
99
|
+
ChartLegend,
|
|
100
|
+
AxisBottomDate,
|
|
101
|
+
AxisLeftNumeric,
|
|
102
|
+
HoverOverlay,
|
|
103
|
+
AreaGradient,
|
|
104
|
+
areaFillUrl,
|
|
105
|
+
ChartTooltip,
|
|
106
|
+
TooltipHeader,
|
|
107
|
+
TooltipRow,
|
|
108
|
+
useChartTooltip,
|
|
109
|
+
useHoverSync,
|
|
110
|
+
VX,
|
|
111
|
+
alpha,
|
|
112
|
+
} from 'basalt-ui/charts' // ./charts re-exports the token layer too
|
|
113
|
+
import { SERIES } from '../lib/series'
|
|
114
|
+
|
|
115
|
+
function HrvChart({ data, width, height }: HrvChartProps) {
|
|
116
|
+
const tip = useChartTooltip<HrvPoint>()
|
|
117
|
+
// ... scales ...
|
|
118
|
+
return (
|
|
119
|
+
<ChartCard title="HRV" info="7-day rolling">
|
|
120
|
+
<svg width={width} height={height}>
|
|
121
|
+
<AreaGradient id="hrv" color={SERIES.hrv} />
|
|
122
|
+
{/* ...LinePath fill={areaFillUrl('hrv')} stroke={SERIES.hrv}... */}
|
|
123
|
+
<AxisLeftNumeric scale={yScale} /* tokenized ticks */ />
|
|
124
|
+
<AxisBottomDate scale={xScale} />
|
|
125
|
+
<HoverOverlay {...tip.overlayProps} />
|
|
126
|
+
</svg>
|
|
127
|
+
<ChartLegend entries={[{ label: 'HRV', color: SERIES.hrv, shape: 'line' }]} />
|
|
128
|
+
<ChartTooltip {...tip.tooltipProps}>
|
|
129
|
+
<TooltipHeader>{/* date */}</TooltipHeader>
|
|
130
|
+
<TooltipRow swatch={SERIES.hrv} label="HRV" value={/* ... */} />
|
|
131
|
+
</ChartTooltip>
|
|
132
|
+
</ChartCard>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Never substitute: hand-rolled legend markup, a raw `<AxisLeft>`/`<AxisBottom>`, a direct
|
|
138
|
+
`@visx/tooltip` import, or an `rgba()` fill. Use `ChartLegend`, the tokenized axes, `ChartTooltip`,
|
|
139
|
+
and `alpha(token, a)`. Sparklines (`charts/sparklines/`) are the one exemption from the
|
|
140
|
+
Card/Legend/Tooltip composition — but they still use `VX.*` tokens.
|
|
141
|
+
|
|
142
|
+
## Cross-chart cursor sync
|
|
143
|
+
|
|
144
|
+
Wrap a group of date-aligned charts in `ChartHoverSync` (from `basalt-ui/charts`) to activate
|
|
145
|
+
cross-chart cursor sync — hovering one chart casts a ghost crosshair on every sibling. Without the
|
|
146
|
+
provider, `useHoverSync` runs per-chart only (and logs a dev warning):
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
import { ChartHoverSync } from 'basalt-ui/charts'
|
|
150
|
+
;<ChartHoverSync>
|
|
151
|
+
<ChartCard>…</ChartCard>
|
|
152
|
+
<ChartCard>…</ChartCard>
|
|
153
|
+
</ChartHoverSync>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Respect the boundary (oxlint-enforced)
|
|
157
|
+
|
|
158
|
+
- **`@visx/*` may only be imported inside chart files.** The shipped consumer oxlint preset bans
|
|
159
|
+
direct `@visx/*` outside `**/charts/**`. Need a raw visx primitive for a bespoke chart? Pull it
|
|
160
|
+
from basalt-ui's curated re-export in `basalt-ui/charts`, or keep the chart under a charts dir.
|
|
161
|
+
- **`./charts` and `./tokens` are Mantine-free** — zero `@mantine/*` imports. Keep new chart code
|
|
162
|
+
free of Mantine so a charts/tokens-only consumer never pulls Mantine in.
|
|
163
|
+
- **No raw color literals** anywhere except the one guard-exempt series file (and a deliberate
|
|
164
|
+
`theme-allow` line). `basalt-ui check-theme` is the teeth; run it before committing.
|
|
165
|
+
- **No raw visx axes.** `basalt-ui check-theme`'s `raw-visx-axis` guard fails the build on a raw
|
|
166
|
+
`<AxisLeft>`/`<AxisBottom>`/`<AxisRight>` inside any `/charts/` file — use the tokenized
|
|
167
|
+
`AxisLeftNumeric` / `AxisRightNumeric` / `AxisBottomDate` (escape via `theme-allow`).
|
|
168
|
+
|
|
169
|
+
## Checklist for a new chart
|
|
170
|
+
|
|
171
|
+
- Picked the right path: reused a kind / extracted on the second instance / stayed bespoke for a
|
|
172
|
+
true one-off.
|
|
173
|
+
- Any new metric color is a `{ light, dark }` pair in the consumer series file, exposed via
|
|
174
|
+
`seriesTokens`/`groupTokens`, and wired into `PALETTE_CSS` via `buildPaletteCss`.
|
|
175
|
+
- Charts read `SERIES.*` / `VX.*` — `basalt-ui check-theme` green, zero raw hex.
|
|
176
|
+
- Composed `ChartCard` / `ChartLegend` / tokenized axes / `ChartTooltip` — no hand-rolled markup,
|
|
177
|
+
no direct `@visx/tooltip`.
|
|
178
|
+
- `@visx/*` stays inside chart files; chart code imports no `@mantine/*`.
|
|
179
|
+
- Tuned both schemes via the theme lab where the hue needed it (defer to `/basalt-design`).
|