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,933 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basalt Mantine theme.
|
|
3
|
+
*
|
|
4
|
+
* Grounded in argo `apps/dashboard/src/theme.ts`, reskinned to the 2026-07 zinc redesign
|
|
5
|
+
* (`docs/DESIGN-SPEC.md`): a `createTheme` base bound to the Basalt zinc palette so the Mantine
|
|
6
|
+
* chrome shares the charts' identity, plus a `cssVariablesResolver` that binds Mantine's surface
|
|
7
|
+
* system to the same `--vx-*` variables the charts use, so chrome and charts draw from one
|
|
8
|
+
* scheme-reactive identity.
|
|
9
|
+
*
|
|
10
|
+
* Every Mantine accent (red/teal/yellow/…) is overridden with a Basalt family, so existing
|
|
11
|
+
* `color="teal"`-style props become on-palette with zero call-site changes.
|
|
12
|
+
*
|
|
13
|
+
* theme.ts is allowed to import the pure palette DATA from `../tokens` — the Mantine-free
|
|
14
|
+
* boundary applies to `src/charts/**` and `src/tokens/**`, not to this `./` root layer. The
|
|
15
|
+
* resolver's hex fallbacks are GENERATED from the same `SURFACE` / `NEUTRAL` pairs the token
|
|
16
|
+
* layer emits, so there is no hand-duplicated hex to drift.
|
|
17
|
+
*/
|
|
18
|
+
import {
|
|
19
|
+
Accordion,
|
|
20
|
+
ActionIcon,
|
|
21
|
+
Alert,
|
|
22
|
+
Badge,
|
|
23
|
+
Breadcrumbs,
|
|
24
|
+
Button,
|
|
25
|
+
Card,
|
|
26
|
+
Checkbox,
|
|
27
|
+
CheckboxCard,
|
|
28
|
+
Chip,
|
|
29
|
+
Code,
|
|
30
|
+
Combobox,
|
|
31
|
+
createTheme,
|
|
32
|
+
defaultVariantColorsResolver,
|
|
33
|
+
Drawer,
|
|
34
|
+
getPrimaryShade,
|
|
35
|
+
Indicator,
|
|
36
|
+
Input,
|
|
37
|
+
Kbd,
|
|
38
|
+
Menu,
|
|
39
|
+
mergeThemeOverrides,
|
|
40
|
+
Modal,
|
|
41
|
+
NavLink,
|
|
42
|
+
Notification,
|
|
43
|
+
NumberInput,
|
|
44
|
+
Pagination,
|
|
45
|
+
Paper,
|
|
46
|
+
PasswordInput,
|
|
47
|
+
PillsInput,
|
|
48
|
+
Popover,
|
|
49
|
+
Progress,
|
|
50
|
+
Radio,
|
|
51
|
+
RadioCard,
|
|
52
|
+
rem,
|
|
53
|
+
Select,
|
|
54
|
+
SegmentedControl,
|
|
55
|
+
Stepper,
|
|
56
|
+
Switch,
|
|
57
|
+
Table,
|
|
58
|
+
Tabs,
|
|
59
|
+
Textarea,
|
|
60
|
+
TextInput,
|
|
61
|
+
Timeline,
|
|
62
|
+
Tooltip,
|
|
63
|
+
} from '@mantine/core'
|
|
64
|
+
import type {
|
|
65
|
+
CSSVariablesResolver,
|
|
66
|
+
MantineColorsTuple,
|
|
67
|
+
MantineTheme,
|
|
68
|
+
MantineThemeOverride,
|
|
69
|
+
VariantColorsResolver,
|
|
70
|
+
} from '@mantine/core'
|
|
71
|
+
import { ACCENT, BP, FILL, INK, NEUTRAL, SURFACE } from '../tokens/palette'
|
|
72
|
+
import { VX } from '../tokens'
|
|
73
|
+
import controlsClasses from './controls.module.css'
|
|
74
|
+
import floatingClasses from './floating.module.css'
|
|
75
|
+
import navLinkClasses from './nav-link.module.css'
|
|
76
|
+
import segmentedControlClasses from './segmented-control.module.css'
|
|
77
|
+
import timelineClasses from './timeline.module.css'
|
|
78
|
+
|
|
79
|
+
// Basalt families are 5 stops dark→light. Expand to a 10-shade Mantine tuple (light→dark).
|
|
80
|
+
function hexToRgb(h: string): [number, number, number] {
|
|
81
|
+
const n = Number.parseInt(h.slice(1), 16)
|
|
82
|
+
return [(n >> 16) & 255, (n >> 8) & 255, n & 255]
|
|
83
|
+
}
|
|
84
|
+
function mix(a: string, b: string, t: number): string {
|
|
85
|
+
const A = hexToRgb(a)
|
|
86
|
+
const B = hexToRgb(b)
|
|
87
|
+
const c = A.map((v, i) => Math.round(v + (B[i]! - v) * t))
|
|
88
|
+
return `#${c.map((v) => v.toString(16).padStart(2, '0')).join('')}`
|
|
89
|
+
}
|
|
90
|
+
function ramp10(stops: readonly string[]): MantineColorsTuple {
|
|
91
|
+
const lite = stops.toReversed() // light→dark
|
|
92
|
+
const out: string[] = []
|
|
93
|
+
for (let i = 0; i < 10; i++) {
|
|
94
|
+
const pos = (i / 9) * (lite.length - 1)
|
|
95
|
+
const lo = Math.floor(pos)
|
|
96
|
+
const hi = Math.min(lo + 1, lite.length - 1)
|
|
97
|
+
out.push(mix(lite[lo]!, lite[hi]!, pos - lo))
|
|
98
|
+
}
|
|
99
|
+
out[0] = mix(out[0]!, '#ffffff', 0.5) // extra-light tint for light-variant backgrounds
|
|
100
|
+
return out as unknown as MantineColorsTuple
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Pin specific indices of an already-built 10-shade tuple to exact hex values.
|
|
105
|
+
*
|
|
106
|
+
* `ramp10` linearly interpolates a 5-stop family across 10 fractional positions — that can only
|
|
107
|
+
* land EXACTLY on a raw family stop at the two extremes (index 0 / 9), never at an arbitrary
|
|
108
|
+
* middle index. Two indices of the blue family must be EXACT spec hexes, so both are pinned after
|
|
109
|
+
* the ramp is built (the rest still reads as one coherent sky-blue scale):
|
|
110
|
+
*
|
|
111
|
+
* • index 6 = `primaryShade` → `ACCENT.accentFill` (`#0077bd`). Mantine derives
|
|
112
|
+
* `--mantine-color-blue-filled` from it, i.e. every filled control's surface.
|
|
113
|
+
* • index 4 → `ACCENT.accent.dark` (`#8ec5ff`). Mantine HARDCODES the dark-scheme
|
|
114
|
+
* `--mantine-color-{c}-text` to shade 4 (not to `primaryShade`), so this is what keeps the
|
|
115
|
+
* accent LIGHT when it is used as ink on dark — the other half of the ink/surface split.
|
|
116
|
+
*/
|
|
117
|
+
function pinShades(
|
|
118
|
+
tuple: MantineColorsTuple,
|
|
119
|
+
overrides: Record<number, string>,
|
|
120
|
+
): MantineColorsTuple {
|
|
121
|
+
const out = [...tuple] as string[]
|
|
122
|
+
for (const [i, hex] of Object.entries(overrides)) out[Number(i)] = hex
|
|
123
|
+
return out as unknown as MantineColorsTuple
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Basalt zinc dark-surface ramp at the indices Mantine reads:
|
|
127
|
+
// text=dark[0], dimmed=dark[2], border=dark[4], hover=dark[5], surface=dark[6], body=dark[7].
|
|
128
|
+
// Mirrors tokens `INK.*.dark` (text ramp) + `SURFACE.*.dark` (surfaces) — keep in lockstep. The
|
|
129
|
+
// resolver re-pins dark-4 to --vx-surface-border, so [4] is the strong-hairline ("line") fallback.
|
|
130
|
+
const basaltDark: MantineColorsTuple = [
|
|
131
|
+
'#e5e5e5', // text (= INK.ink.dark)
|
|
132
|
+
'#dddddd', // emphasis body (= INK.ink2.dark)
|
|
133
|
+
'#d4d4d4', // dimmed (= INK.muted.dark = NEUTRAL.neutral.dark)
|
|
134
|
+
'#a1a1a1', // faint (= INK.faint.dark)
|
|
135
|
+
'#3f3f46', // border fallback ("line"; resolver pins dark-4 → --vx-surface-border)
|
|
136
|
+
'#333338', // hover (= SURFACE.panelHover.dark)
|
|
137
|
+
'#27272a', // surface (panel) (= SURFACE.panel.dark)
|
|
138
|
+
'#232326', // body (page bg) (= SURFACE.bg.dark)
|
|
139
|
+
'#18181b', // deeper than body (= BP.darkGray[0])
|
|
140
|
+
'#09090b', // darkest extreme
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* ON-COLOR: the foreground for a filled surface, decided in CSS. THE fix for Mantine's
|
|
145
|
+
* scheme-blind, contrast-blind `autoContrast`.
|
|
146
|
+
*
|
|
147
|
+
* Mantine picks the filled-variant text color ONCE, in JS, via `parseThemeColor({ color, theme })`
|
|
148
|
+
* — with NO `colorScheme` argument, so it resolves against the LIGHT `primaryShade` and bakes a
|
|
149
|
+
* static `color: var(--mantine-color-white)` into the element, while the BACKGROUND it pairs that
|
|
150
|
+
* with (`--mantine-color-{c}-filled`) stays a scheme-reactive CSS var. It gets away with it
|
|
151
|
+
* upstream only because Mantine's default `primaryShade` is `{ light: 6, dark: 8 }` — DARKER on
|
|
152
|
+
* dark, so white happens to stay right. It is luck, not logic: point `primaryShade.dark` at a
|
|
153
|
+
* lighter shade (as Basalt originally did) and every filled control in dark mode turns white-on-
|
|
154
|
+
* light. And even in one scheme the pick is wrong, because `isLightColor` is a BT.601 BRIGHTNESS
|
|
155
|
+
* test that does not track WCAG contrast — it handed white to lime `#97ba2e` at 2.24:1.
|
|
156
|
+
*
|
|
157
|
+
* Basalt removes the JS decision entirely. A fill is now scheme-INDEPENDENT and sits in a
|
|
158
|
+
* luminance band chosen so a WHITE label always clears AA (see `FILL` / `ACCENT` in
|
|
159
|
+
* tokens/palette.ts), so the on-color is a token, not a computation. `--vx-on-{color}` is emitted
|
|
160
|
+
* per color and resolves in pure CSS at paint time — the same discipline the rest of the `--vx-*`
|
|
161
|
+
* system follows. It is still MEASURED here (`legibleOn`) rather than hardcoded to white, so a
|
|
162
|
+
* consumer that retunes a family outside the band still gets the legible foreground.
|
|
163
|
+
*
|
|
164
|
+
* The palette already KNEW the answer: `ACCENT.onAccent` ("text on an accent fill") existed, and
|
|
165
|
+
* `Composer`'s send button hand-wired `color: var(--vx-onAccent)` — which was the ONLY reason that
|
|
166
|
+
* one control stayed legible while every generic Mantine control did not. The token was right;
|
|
167
|
+
* nothing bound the chrome to it. It is bound now (see `accentBridge` / `familyBridge`), and the
|
|
168
|
+
* Composer no longer needs the override.
|
|
169
|
+
*
|
|
170
|
+
* Fix: never let a foreground be decided in JS. `--vx-on-{color}` is emitted per color under BOTH
|
|
171
|
+
* scheme blocks of `cssVariablesResolver` (each resolved against the shade that scheme actually
|
|
172
|
+
* paints), so the foreground resolves in pure CSS at paint time — the same discipline the rest of
|
|
173
|
+
* the `--vx-*` system already follows. `basaltVariantColorResolver` re-points every filled variant
|
|
174
|
+
* at it, and the components that bypass the variant resolver (Checkbox / Radio / Tabs / Pagination /
|
|
175
|
+
* Stepper / Indicator / Timeline all call Mantine's `getContrastColor` directly) are re-pointed at
|
|
176
|
+
* it too, in `components` below. Regression-locked by `contrast.test.ts`.
|
|
177
|
+
*/
|
|
178
|
+
function onColor(theme: MantineTheme, color: string | undefined): string | undefined {
|
|
179
|
+
const name = color ?? theme.primaryColor
|
|
180
|
+
if (!Object.prototype.hasOwnProperty.call(theme.colors, name)) return undefined // hex / `blue.5`
|
|
181
|
+
return `var(--vx-on-${name})`
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The on-color for a component that bypasses the variant resolver and calls Mantine's
|
|
186
|
+
* `getContrastColor` directly. `undefined` (autoContrast off, or a hex / indexed color) leaves
|
|
187
|
+
* Mantine's own value in place — `mergeVars` strips undefined before merging.
|
|
188
|
+
*/
|
|
189
|
+
function onColorFor(
|
|
190
|
+
theme: MantineTheme,
|
|
191
|
+
props: { color?: string | undefined; autoContrast?: boolean | undefined },
|
|
192
|
+
): string | undefined {
|
|
193
|
+
const autoContrast = props.autoContrast ?? theme.autoContrast
|
|
194
|
+
return autoContrast ? onColor(theme, props.color) : undefined
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** WCAG 2.x relative luminance. */
|
|
198
|
+
function relativeLuminance(hex: string): number {
|
|
199
|
+
const channels = hexToRgb(hex).map((c) => {
|
|
200
|
+
const s = c / 255
|
|
201
|
+
return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
202
|
+
})
|
|
203
|
+
return 0.2126 * channels[0]! + 0.7152 * channels[1]! + 0.0722 * channels[2]!
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** WCAG 2.x contrast ratio. */
|
|
207
|
+
function contrastRatio(a: string, b: string): number {
|
|
208
|
+
const [hi, lo] = [relativeLuminance(a), relativeLuminance(b)].toSorted((x, y) => y - x)
|
|
209
|
+
return (hi! + 0.05) / (lo! + 0.05)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The legible foreground for `background` — decided by MEASURED contrast, never by a brightness
|
|
214
|
+
* heuristic. (Mantine picks via `isLightColor`, a BT.601 brightness test against
|
|
215
|
+
* `luminanceThreshold`, which does not track WCAG contrast: it hands white to saturated mid-tones
|
|
216
|
+
* like lime `#97ba2e` at 2.24:1.) Since `contrast(bg, white) * contrast(bg, black)` is a constant
|
|
217
|
+
* (~17.9 for this black), taking the larger of the two is also the AA-optimal choice, and floors
|
|
218
|
+
* every pairing at ~4.2:1.
|
|
219
|
+
*/
|
|
220
|
+
function legibleOn(background: string, theme: MantineTheme): string {
|
|
221
|
+
return contrastRatio(background, theme.white) >= contrastRatio(background, theme.black)
|
|
222
|
+
? 'var(--mantine-color-white)'
|
|
223
|
+
: 'var(--mantine-color-black)'
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** The `--vx-on-*` block for one scheme: contrast-picked against the shade THAT scheme fills with. */
|
|
227
|
+
function onColorVars(theme: MantineTheme, colorScheme: 'light' | 'dark'): Record<string, string> {
|
|
228
|
+
const shade = getPrimaryShade(theme, colorScheme)
|
|
229
|
+
const vars: Record<string, string> = {}
|
|
230
|
+
for (const [name, tuple] of Object.entries(theme.colors)) {
|
|
231
|
+
if (!Array.isArray(tuple)) continue // virtual color — resolves per scheme on its own
|
|
232
|
+
const filled = tuple[shade]
|
|
233
|
+
if (typeof filled !== 'string') continue
|
|
234
|
+
// The accent already HAS a declared on-color in the palette (`ACCENT.onAccent`, the spec's
|
|
235
|
+
// "text on an accent fill") — the token stays the single source, so a palette retune moves the
|
|
236
|
+
// chrome with it. Everything else is a generic surface with no declared foreground: measure it.
|
|
237
|
+
vars[`--vx-on-${name}`] =
|
|
238
|
+
name === theme.primaryColor
|
|
239
|
+
? `var(--vx-onAccent, ${ACCENT.onAccent[colorScheme]})`
|
|
240
|
+
: legibleOn(filled, theme)
|
|
241
|
+
}
|
|
242
|
+
return vars
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Keep the `light` variant legible in BOTH schemes — the enforcement seam for badges/controls.
|
|
247
|
+
*
|
|
248
|
+
* Mantine resolves the light-variant BACKGROUND to `--mantine-color-{c}-1`. Basalt's `ramp10`
|
|
249
|
+
* only lightens shade 0, so shade 1 stays a fully saturated mid-tone — i.e. the light background
|
|
250
|
+
* renders VIVID, not a faint tint, and the colored text can't sit on it (green measured 2.91:1 in
|
|
251
|
+
* light mode; dark mode was fine at ~9:1 because Mantine uses a proper dark tint there). The text
|
|
252
|
+
* was never the problem, so white text wouldn't help — it'd be invisible on the tint.
|
|
253
|
+
*
|
|
254
|
+
* Fix: rebuild the light background as a faint mix of the variant's OWN text color
|
|
255
|
+
* (`--mantine-color-{c}-light-color`, which is itself scheme-reactive — dark ink in light mode,
|
|
256
|
+
* light ink in dark mode). A mix of that ink over the surface is therefore a pale tint under
|
|
257
|
+
* dark text on light, and a dim tint under light text on dark: one expression, identical logic
|
|
258
|
+
* both ways, always high-contrast. `filled` (autoContrast) / `outline` / `subtle` keep Mantine's
|
|
259
|
+
* defaults. Only plain theme-palette color names are remapped; hex / indexed colors fall through.
|
|
260
|
+
*
|
|
261
|
+
* The background mix is pinned at 13% — the spec's status-tint idiom (`docs/DESIGN-SPEC.md` §2:
|
|
262
|
+
* "status tint bg (delta badges): color-mix(in srgb, <status> 13%, transparent)"), which this
|
|
263
|
+
* resolver is the single implementation of (Badge's `light` variant IS the status-tint idiom).
|
|
264
|
+
*/
|
|
265
|
+
const basaltVariantColorResolver: VariantColorsResolver = (input) => {
|
|
266
|
+
const resolved = defaultVariantColorsResolver(input)
|
|
267
|
+
const colorName = input.color ?? input.theme.primaryColor
|
|
268
|
+
const on = onColor(input.theme, colorName)
|
|
269
|
+
if (on === undefined) return resolved // hex / indexed color — bg is scheme-static, Mantine is right
|
|
270
|
+
|
|
271
|
+
// `filled`: swap Mantine's JS-baked, scheme-blind white for the scheme-reactive on-color.
|
|
272
|
+
if (input.variant === 'filled') {
|
|
273
|
+
const autoContrast = input.autoContrast ?? input.theme.autoContrast
|
|
274
|
+
return autoContrast ? { ...resolved, color: on } : resolved
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (input.variant !== 'light') return resolved
|
|
278
|
+
const ink = `var(--mantine-color-${colorName}-light-color)`
|
|
279
|
+
return {
|
|
280
|
+
...resolved,
|
|
281
|
+
background: `color-mix(in srgb, ${ink} 13%, transparent)`,
|
|
282
|
+
hover: `color-mix(in srgb, ${ink} 20%, transparent)`,
|
|
283
|
+
color: ink,
|
|
284
|
+
border: 'none',
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Basalt base theme — Mantine `createTheme` bound to the Basalt zinc palette.
|
|
290
|
+
*
|
|
291
|
+
* Inputs keep `size: 'md'` for GEOMETRY (42px height, padding), while their FONT-SIZE is floored
|
|
292
|
+
* at 16px by the `styles.css` rule — Safari zooms the viewport when a focused input computes below
|
|
293
|
+
* 16px. Splitting the two is deliberate: pinning `size: 'lg'` to reach a 16px font would drag a
|
|
294
|
+
* 50px input height along with it. The floor is `max(16px, …)`, so it never clamps a deliberately
|
|
295
|
+
* LARGER input down, and — being a CSS floor on the element rather than a per-component
|
|
296
|
+
* `defaultProps` — it covers every input Mantine ships (Autocomplete, MultiSelect, TagsInput,
|
|
297
|
+
* PinInput, …) plus any consumer that passes an explicit `size="xs"`. Enumerating components in
|
|
298
|
+
* `defaultProps` could never do that; the previous attempt missed seven of them.
|
|
299
|
+
*/
|
|
300
|
+
export const baseTheme: MantineThemeOverride = createTheme({
|
|
301
|
+
primaryColor: 'blue',
|
|
302
|
+
// ONE shade in both schemes — a filled control is a SURFACE, and the accent surface is the same
|
|
303
|
+
// hex either way (see `ACCENT.accentFill`). The scheme-inverting half of the accent lives in
|
|
304
|
+
// Mantine's dark `--mantine-color-{c}-text`, which is hardcoded to shade 4 = `ACCENT.accent.dark`.
|
|
305
|
+
primaryShade: 6,
|
|
306
|
+
autoContrast: true,
|
|
307
|
+
luminanceThreshold: 0.45,
|
|
308
|
+
// Force the `light` variant to a faint, AA-legible tint in both schemes (see resolver above).
|
|
309
|
+
variantColorResolver: basaltVariantColorResolver,
|
|
310
|
+
white: '#ffffff',
|
|
311
|
+
black: '#18181b',
|
|
312
|
+
// The three-font system (docs/DESIGN-SPEC.md §3): Nunito Sans body / Hubot Sans condensed
|
|
313
|
+
// headings / JetBrains Mono for numerals + micro-labels. The `--basalt-font-*` vars stay the
|
|
314
|
+
// override seam (shipped in styles.css, with system-font fallback chains).
|
|
315
|
+
fontFamily: 'var(--basalt-font-sans, ui-sans-serif, system-ui, sans-serif)',
|
|
316
|
+
fontFamilyMonospace: "var(--basalt-font-mono, ui-monospace, 'SF Mono', Menlo, monospace)",
|
|
317
|
+
headings: {
|
|
318
|
+
fontFamily: 'var(--basalt-font-head, var(--basalt-font-sans, ui-sans-serif, sans-serif))',
|
|
319
|
+
fontWeight: '550',
|
|
320
|
+
},
|
|
321
|
+
// Control radius tier (docs/DESIGN-SPEC.md §4: inputs, search, buttons, segmented track, icon
|
|
322
|
+
// buttons ≥28px sit at ~6px). `radius.md` = 0.375rem = 6px, mirrored by `--vx-radius-ctrl` — every
|
|
323
|
+
// control without its own explicit `radius` prop (Button, ActionIcon, TextInput, NumberInput,
|
|
324
|
+
// PasswordInput, Select, Textarea) falls back to this default. Card/Paper bypass this scale
|
|
325
|
+
// entirely — they resolve straight to `var(--vx-radius-card)` (7px, see the
|
|
326
|
+
// `components.Card`/`Paper` overrides below).
|
|
327
|
+
defaultRadius: 'md',
|
|
328
|
+
// Named weight ladder (v9 fontWeights).
|
|
329
|
+
fontWeights: { regular: '400', medium: '500', semibold: '600', bold: '700' },
|
|
330
|
+
// The OWNED type scale — Mantine's xs…xl re-expressed from the single `VX.text` ladder
|
|
331
|
+
// (`tokens/index.ts`), so `<Text size="sm">` and a `--vx-text-sm` CSS module read the same step.
|
|
332
|
+
// Passed through Mantine's `rem()` (→ `calc(Xrem * var(--mantine-scale))`) rather than raw px, so
|
|
333
|
+
// the component surface honors the user's browser font-size and Mantine's own scale factor —
|
|
334
|
+
// the px numbers in `VX.text` exist only for inline styles and visx SVG, which can't take `var()`.
|
|
335
|
+
// `md` is the body step. Mantine's default ladder (12/14/16/18/20) is now fully replaced.
|
|
336
|
+
fontSizes: {
|
|
337
|
+
xs: rem(VX.text.xs),
|
|
338
|
+
sm: rem(VX.text.sm),
|
|
339
|
+
md: rem(VX.text.md),
|
|
340
|
+
lg: rem(VX.text.lg),
|
|
341
|
+
xl: rem(VX.text.xl),
|
|
342
|
+
},
|
|
343
|
+
// Deliberate, OWNED spacing + radius scales — the single edit point, not inherited Mantine
|
|
344
|
+
// defaults. Denser than Mantine's stock lg/xl for a tighter, data-driven surface. 10 12 16 18 24.
|
|
345
|
+
spacing: { xs: '0.625rem', sm: '0.75rem', md: '1rem', lg: '1.125rem', xl: '1.5rem' },
|
|
346
|
+
// 2 4 6 16 32 — the size scale; `md` (6px) is the control-radius default (`defaultRadius: 'md'`,
|
|
347
|
+
// inputs/buttons). Card/Paper/Popover/Modal/Notification read `--vx-radius-*` directly instead
|
|
348
|
+
// (7px cards / 6px controls), so the larger steps of this scale no longer mirror either token.
|
|
349
|
+
radius: { xs: '0.125rem', sm: '0.25rem', md: '0.375rem', lg: '1rem', xl: '2rem' },
|
|
350
|
+
// Shade 6 (= `primaryShade`) is pinned to the FILL BAND for every family, so the JS ramp and the
|
|
351
|
+
// `--vx-fill-*` tokens hold the SAME hex. That keeps `-filled` / `-text`(light) / `-outline`
|
|
352
|
+
// internally consistent, and lets the on-color be measured straight off the tuple (below).
|
|
353
|
+
colors: {
|
|
354
|
+
dark: basaltDark,
|
|
355
|
+
gray: pinShades(ramp10(BP.gray), { 6: FILL.gray }),
|
|
356
|
+
blue: pinShades(ramp10(BP.blue), { 4: ACCENT.accent.dark, 6: ACCENT.accentFill.light }),
|
|
357
|
+
cyan: pinShades(ramp10(BP.cerulean), { 6: FILL.cyan }),
|
|
358
|
+
teal: pinShades(ramp10(BP.turquoise), { 6: FILL.teal }),
|
|
359
|
+
green: pinShades(ramp10(BP.forest), { 6: FILL.green }),
|
|
360
|
+
lime: pinShades(ramp10(BP.lime), { 6: FILL.lime }),
|
|
361
|
+
yellow: pinShades(ramp10(BP.gold), { 6: FILL.yellow }),
|
|
362
|
+
orange: pinShades(ramp10(BP.orange), { 6: FILL.orange }),
|
|
363
|
+
red: pinShades(ramp10(BP.red), { 6: FILL.red }),
|
|
364
|
+
pink: pinShades(ramp10(BP.rose), { 6: FILL.pink }),
|
|
365
|
+
grape: pinShades(ramp10(BP.violet), { 6: FILL.grape }),
|
|
366
|
+
violet: pinShades(ramp10(BP.violet), { 6: FILL.violet }),
|
|
367
|
+
indigo: pinShades(ramp10(BP.indigo), { 6: FILL.indigo }),
|
|
368
|
+
},
|
|
369
|
+
components: {
|
|
370
|
+
// Depth = `shadow-card` (a whisper shadow + a 1px ring baked into the SAME value) — never a
|
|
371
|
+
// separate `border` property (docs/DESIGN-SPEC.md doctrine inversion #1). Cards carry no
|
|
372
|
+
// `withBorder` at all; the ring lives inside `--vx-shadow-card`.
|
|
373
|
+
// ONE card identity, enforced at the theme so NO component can diverge. Every card-like
|
|
374
|
+
// surface — Mantine `Card`, a bare `Paper` used as a card, and the Mantine-free `ChartCard` —
|
|
375
|
+
// resolves to the SAME three tokens:
|
|
376
|
+
// • background → `--vx-surface-panel` (the panel surface, NOT the page body).
|
|
377
|
+
// • depth → `--vx-shadow-card` (whisper shadow + ring, replaces `withBorder`).
|
|
378
|
+
// • radius → `--vx-radius-card` (10px).
|
|
379
|
+
// This is the single source the user's "strict surface across components" demands; the
|
|
380
|
+
// `raw-surface` guard then stops consumers re-overriding any of it inline.
|
|
381
|
+
Card: Card.extend({
|
|
382
|
+
styles: {
|
|
383
|
+
root: {
|
|
384
|
+
backgroundColor: 'var(--vx-surface-panel)',
|
|
385
|
+
boxShadow: 'var(--vx-shadow-card)',
|
|
386
|
+
borderRadius: 'var(--vx-radius-card)',
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
}),
|
|
390
|
+
Paper: Paper.extend({
|
|
391
|
+
styles: {
|
|
392
|
+
root: {
|
|
393
|
+
backgroundColor: 'var(--vx-surface-panel)',
|
|
394
|
+
boxShadow: 'var(--vx-shadow-card)',
|
|
395
|
+
borderRadius: 'var(--vx-radius-card)',
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
}),
|
|
399
|
+
// Mantine's default Badge radius is a full 1000px pill; the spec's delta/status badges sit at
|
|
400
|
+
// radius 6 (docs/DESIGN-SPEC.md §4/§5). Count badges (radius 5) are a distinct, smaller-radius
|
|
401
|
+
// usage left to the call site (`radius={5}` prop) since Badge has no state to key off here.
|
|
402
|
+
Badge: Badge.extend({ defaultProps: { radius: 6 } }),
|
|
403
|
+
// Alert renders its title in the body font by default; bring it onto the head-font idiom
|
|
404
|
+
// (docs/DESIGN-SPEC.md §5) like every other titled surface. Radius/padding/color tint are
|
|
405
|
+
// already on-system (defaultRadius 'md' control tier + the variant color resolver), so only
|
|
406
|
+
// the title font is overridden.
|
|
407
|
+
Alert: Alert.extend({
|
|
408
|
+
styles: {
|
|
409
|
+
title: {
|
|
410
|
+
fontFamily: 'var(--basalt-font-head)',
|
|
411
|
+
fontWeight: 550,
|
|
412
|
+
fontStretch: '88%',
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
}),
|
|
416
|
+
// "Ink earns its color" — a nav selection is UI state, not the identity accent on the LABEL.
|
|
417
|
+
// The active item is panel bg + `shadow-card` (forced here at the THEME level via NavLink's
|
|
418
|
+
// `--nl-*` vars, so it holds for every render path — including a consumer's router `<Link>`
|
|
419
|
+
// via `renderNavLink`, which never sees the shell CSS module); the active ICON is
|
|
420
|
+
// accent-colored via `nav-link.module.css` (targets the `[data-position='left']` leftSection,
|
|
421
|
+
// which the flat `vars`/`styles` API can't express conditionally on `[data-active]`).
|
|
422
|
+
NavLink: NavLink.extend({
|
|
423
|
+
vars: () => ({
|
|
424
|
+
root: {
|
|
425
|
+
'--nl-bg': 'var(--vx-surface-panel)',
|
|
426
|
+
'--nl-color': 'var(--vx-ink)',
|
|
427
|
+
'--nl-hover': 'color-mix(in srgb, var(--vx-ink) 6%, transparent)',
|
|
428
|
+
},
|
|
429
|
+
children: {},
|
|
430
|
+
}),
|
|
431
|
+
// Dense, rounded nav rows — applied at the THEME level so they survive EVERY render path,
|
|
432
|
+
// including a consumer's router `<Link>` via `renderNavLink`, which never sees the shell CSS
|
|
433
|
+
// module (the module's `.link` only reaches the shell's own fallback `<NavLink>`). Same
|
|
434
|
+
// reasoning as the `--nl-*` fill above: layout is single-sourced here, not in two places.
|
|
435
|
+
// The active-weight/shadow/icon-accent state selectors can't live in `styles` (flat inline
|
|
436
|
+
// props only) — they're in nav-link.module.css, wired via `classNames` so they reach the
|
|
437
|
+
// same every-render-path scope.
|
|
438
|
+
classNames: { root: navLinkClasses.root },
|
|
439
|
+
styles: {
|
|
440
|
+
root: {
|
|
441
|
+
// Row geometry (docs/DESIGN-SPEC.md §5): 6px 10px padding lands ~29-30px rows. Mantine
|
|
442
|
+
// v9 hardcodes NavLink padding (`8px var(--mantine-spacing-sm)` — there is NO
|
|
443
|
+
// `--nl-padding` var), so the spec padding is forced inline here, where it wins
|
|
444
|
+
// deterministically on every render path.
|
|
445
|
+
padding: '6px 10px',
|
|
446
|
+
// The body step on the ROOT, not just the label: the body element sizes itself from the
|
|
447
|
+
// root's inherited line-height (which, left at the default 1.55, alone pushed rows to
|
|
448
|
+
// ~37px). The tightened 1.35 keeps rows compact as the scale grows.
|
|
449
|
+
fontSize: VX.text.md,
|
|
450
|
+
lineHeight: '1.35',
|
|
451
|
+
// Nav rows sit in the 5-6px radius tier (docs/DESIGN-SPEC.md §4), not square.
|
|
452
|
+
borderRadius: 6,
|
|
453
|
+
},
|
|
454
|
+
// Mantine pins the label at `font-size-sm` explicitly, so the root value alone
|
|
455
|
+
// doesn't reach it.
|
|
456
|
+
label: { fontSize: VX.text.md, lineHeight: '1.35' },
|
|
457
|
+
},
|
|
458
|
+
}),
|
|
459
|
+
// Field idiom (docs/DESIGN-SPEC.md §5): field surface + `shadow-card` depth + faint placeholder,
|
|
460
|
+
// accent border + subtle accent ring on focus — see controls.module.css. The two slots carry
|
|
461
|
+
// different halves of it: the `wrapper` is where Mantine declares the `--input-*` vars, the
|
|
462
|
+
// `input` is the box that actually paints the surface (bg + radius) and therefore the only
|
|
463
|
+
// legal home for the shadow's ring. Theming the base `Input` covers
|
|
464
|
+
// TextInput/NumberInput/PasswordInput/Select/Textarea, which all render it internally (only
|
|
465
|
+
// `size` needs per-component defaults, since each resolves its own).
|
|
466
|
+
Input: Input.extend({
|
|
467
|
+
defaultProps: { size: 'md' },
|
|
468
|
+
classNames: { wrapper: controlsClasses.inputWrapper, input: controlsClasses.input },
|
|
469
|
+
}),
|
|
470
|
+
TextInput: TextInput.extend({ defaultProps: { size: 'md' } }),
|
|
471
|
+
NumberInput: NumberInput.extend({ defaultProps: { size: 'md' } }),
|
|
472
|
+
PasswordInput: PasswordInput.extend({ defaultProps: { size: 'md' } }),
|
|
473
|
+
Select: Select.extend({ defaultProps: { size: 'md' } }),
|
|
474
|
+
Textarea: Textarea.extend({ defaultProps: { size: 'md' } }),
|
|
475
|
+
// PillsInput (MultiSelect/TagsInput's outer field) renders `InputBase` internally but under
|
|
476
|
+
// its OWN `__staticSelector: 'PillsInput'`, so it never reads `theme.components.Input` — the
|
|
477
|
+
// field idiom above never reached it. `PillsInput.classes === InputBase.classes`, so the SAME
|
|
478
|
+
// part names apply here; reusing both control classes picks up the exact `[data-variant]` rules
|
|
479
|
+
// in controls.module.css for free, no new CSS needed. Both slots are required — `wrapper` alone
|
|
480
|
+
// would land the vars but leave the field flat, since the depth lives on `input`.
|
|
481
|
+
PillsInput: PillsInput.extend({
|
|
482
|
+
classNames: { wrapper: controlsClasses.inputWrapper, input: controlsClasses.input },
|
|
483
|
+
}),
|
|
484
|
+
// Button / ActionIcon (`default` variant): same `shadow-card` depth as every other control
|
|
485
|
+
// surface (docs/DESIGN-SPEC.md §5: "search trigger … panel + shadow-card", "icon button …
|
|
486
|
+
// panel + shadow-card"; doctrine inversion #1). Background already resolves through the shared
|
|
487
|
+
// `--mantine-color-default` var (→ `--vx-surface-panel`, see cssVariablesResolver below) and
|
|
488
|
+
// the border through `--mantine-color-default-border` (→ transparent, same resolver) — neither
|
|
489
|
+
// component had a `.extend()` block at all before this, which is why they never picked up
|
|
490
|
+
// either. Only the shadow needs adding here, in controls.module.css: Mantine's own
|
|
491
|
+
// `[data-variant='default']` rule never declares a `box-shadow`, so no specificity fight is
|
|
492
|
+
// needed to win one. `filled`/`subtle`/`light` variants are untouched — scoped by attribute
|
|
493
|
+
// selector in the CSS, not here.
|
|
494
|
+
Button: Button.extend({ classNames: { root: controlsClasses.buttonRoot } }),
|
|
495
|
+
ActionIcon: ActionIcon.extend({ classNames: { root: controlsClasses.actionIconRoot } }),
|
|
496
|
+
// CheckboxCard / RadioCard (`withBorder`, true by default): same live regression as Button/
|
|
497
|
+
// ActionIcon before this pass — Mantine ships `border: 1px solid transparent` as the BASE
|
|
498
|
+
// `[data-with-border]` declaration, but its own `:where([data-mantine-color-scheme=…])` block
|
|
499
|
+
// re-colors that to gray-3/dark-4 (pinned to `--vx-surface-border` by the strict-surface lever
|
|
500
|
+
// below), landing a real, flat hairline with no shadow at all — the exact "flat and edgeless"
|
|
501
|
+
// symptom, just via a different mechanism (`[data-with-border]`, not the `default`-variant
|
|
502
|
+
// border var). `.checkboxCardRoot[data-with-border]` / `.radioCardRoot[data-with-border]` are
|
|
503
|
+
// real attribute selectors ((0,2,0)) — Mantine's own rule wraps the same attribute in `:where()`
|
|
504
|
+
// (0 specificity, landing at (0,1,0) total), so no `html[…]` prefix fight is needed here either.
|
|
505
|
+
// Neither component sets a background of its own, so panel bg is added alongside the shadow —
|
|
506
|
+
// the same panel-bg + shadow-card + no-border triad as Card/Paper.
|
|
507
|
+
CheckboxCard: CheckboxCard.extend({
|
|
508
|
+
classNames: { card: controlsClasses.checkboxCardRoot },
|
|
509
|
+
}),
|
|
510
|
+
RadioCard: RadioCard.extend({
|
|
511
|
+
classNames: { card: controlsClasses.radioCardRoot },
|
|
512
|
+
}),
|
|
513
|
+
// Chip: unlike Button/Input, Chip has no literal `variant="default"` — its OWN default (no
|
|
514
|
+
// `variant` prop passed) resolves internally to `variant: 'filled'` (Chip's neutral/unselected
|
|
515
|
+
// look, NOT a "loud" filled color — `light`/`outline` are the other two Chip variants). The
|
|
516
|
+
// unchecked `filled`-variant label already ships a transparent border (`gray-1`/`dark-5` tint,
|
|
517
|
+
// no shadow) — borderless but flat, the same symptom as CheckboxCard/RadioCard above. The class
|
|
518
|
+
// is wired conditionally (function-form `classNames`, same pattern as the `vars` on-color
|
|
519
|
+
// re-points below) so it NEVER reaches a consumer-chosen `light`/`outline` Chip.
|
|
520
|
+
Chip: Chip.extend({
|
|
521
|
+
classNames: (_theme, props) =>
|
|
522
|
+
(props.variant ?? 'filled') === 'filled' ? { label: controlsClasses.chipLabel } : {},
|
|
523
|
+
}),
|
|
524
|
+
// Track = ink-6% tint, radius 7, 2px padding; active segment = panel bg + `shadow-ctrl`,
|
|
525
|
+
// radius 5. `--sc-radius`/`--sc-color` don't reach the root track background (Mantine
|
|
526
|
+
// hardcodes that to a raw gray step), so it's forced via `styles.root` same as Card/Paper.
|
|
527
|
+
// The active-only ink label color + weight can't live in the flat `styles.label` object
|
|
528
|
+
// (applies to every option regardless of state), so it's in segmented-control.module.css
|
|
529
|
+
// instead — same pattern as NavLink's active-icon accent.
|
|
530
|
+
SegmentedControl: SegmentedControl.extend({
|
|
531
|
+
defaultProps: { radius: 7 },
|
|
532
|
+
classNames: { label: segmentedControlClasses.label },
|
|
533
|
+
styles: {
|
|
534
|
+
root: {
|
|
535
|
+
backgroundColor: 'color-mix(in srgb, var(--vx-ink) 6%, transparent)',
|
|
536
|
+
padding: 2,
|
|
537
|
+
},
|
|
538
|
+
indicator: {
|
|
539
|
+
backgroundColor: 'var(--vx-surface-panel)',
|
|
540
|
+
boxShadow: 'var(--vx-shadow-ctrl)',
|
|
541
|
+
borderRadius: 5,
|
|
542
|
+
},
|
|
543
|
+
},
|
|
544
|
+
}),
|
|
545
|
+
// Track = ink-8%; leader/section fill colors are a per-usage `color` prop (left to consumers).
|
|
546
|
+
Progress: Progress.extend({
|
|
547
|
+
defaultProps: { size: 6, radius: 4 },
|
|
548
|
+
styles: {
|
|
549
|
+
root: { backgroundColor: 'color-mix(in srgb, var(--vx-ink) 8%, transparent)' },
|
|
550
|
+
},
|
|
551
|
+
}),
|
|
552
|
+
// Activity-feed idiom: 20-24px bullet, hairline connecting line (not Mantine's heavy default),
|
|
553
|
+
// head-weight title, muted body — zero call-site work for an on-spec Timeline. `bulletSize`/
|
|
554
|
+
// `lineWidth` land through Timeline's OWN `varsResolver` (real component vars, not our `styles`
|
|
555
|
+
// object), so they aren't subject to the custom-property stripping below. The bullet's
|
|
556
|
+
// panel/hairline/accent-active treatment and the line's divider color ARE custom-property
|
|
557
|
+
// declarations / state-selectors — both unreachable from a flat `styles` object (same
|
|
558
|
+
// reasoning as SegmentedControl's active-label rule and NavLink's active-icon rule) — so they
|
|
559
|
+
// live in `timeline.module.css` instead. `TimelineItem` renders through the PARENT Timeline's
|
|
560
|
+
// style context (`ctx.getStyles`), so `item`/`itemBullet`/`itemTitle`/`itemContent` are all
|
|
561
|
+
// themed from this ONE extend — no separate `TimelineItem` override needed.
|
|
562
|
+
Timeline: Timeline.extend({
|
|
563
|
+
defaultProps: { bulletSize: 22, lineWidth: 1 },
|
|
564
|
+
// The active bullet's icon sits on the accent fill — on-color, not a baked white (see above).
|
|
565
|
+
vars: (theme, props) => ({ root: { '--tl-icon-color': onColorFor(theme, props) } }),
|
|
566
|
+
classNames: {
|
|
567
|
+
item: timelineClasses.item,
|
|
568
|
+
itemBullet: timelineClasses.itemBullet,
|
|
569
|
+
},
|
|
570
|
+
styles: {
|
|
571
|
+
itemTitle: {
|
|
572
|
+
fontSize: VX.text.md,
|
|
573
|
+
fontWeight: 600,
|
|
574
|
+
color: 'var(--vx-ink)',
|
|
575
|
+
},
|
|
576
|
+
itemContent: {
|
|
577
|
+
fontSize: VX.text.md,
|
|
578
|
+
color: 'var(--vx-muted)',
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
}),
|
|
582
|
+
// ── Floating layer (docs/DESIGN-SPEC.md §5) ─────────────────────────────────────────────
|
|
583
|
+
// ONE idiom for every detached surface: overlay surface + a REAL 1px `--vx-surface-border`
|
|
584
|
+
// border + the overlay elevation shadow. The border must be a real `border` property (never
|
|
585
|
+
// "ring in the shadow" like cards): Mantine's arrow is a rotated square that draws
|
|
586
|
+
// `1px solid var(--popover-border-color)` and inherits the dropdown's background — with
|
|
587
|
+
// `border: 'none'` on the dropdown the arrow rendered as a broken floating diamond edge.
|
|
588
|
+
// (`--popover-border-color` resolves to gray-2/dark-4, both pinned to `--vx-surface-border`
|
|
589
|
+
// by the resolver below, so dropdown and arrow always share the same edge color.)
|
|
590
|
+
|
|
591
|
+
// Tooltip is a standalone floating primitive (not Popover-based) — themed directly. Its arrow
|
|
592
|
+
// ships border-less (`border: 0`), so the same edge is applied inline to keep the ring closed.
|
|
593
|
+
Tooltip: Tooltip.extend({
|
|
594
|
+
defaultProps: { radius: 8 },
|
|
595
|
+
styles: {
|
|
596
|
+
tooltip: {
|
|
597
|
+
backgroundColor: 'var(--vx-surface-overlay)',
|
|
598
|
+
color: 'var(--vx-ink)',
|
|
599
|
+
border: '1px solid var(--vx-surface-border)',
|
|
600
|
+
boxShadow: 'var(--vx-shadow-overlay)',
|
|
601
|
+
},
|
|
602
|
+
arrow: { border: '1px solid var(--vx-surface-border)' },
|
|
603
|
+
},
|
|
604
|
+
}),
|
|
605
|
+
// Popover is the shared floating primitive underneath Menu (Menu renders `<Popover>`
|
|
606
|
+
// internally with no `radius`/`shadow` of its own), so theming it here covers both.
|
|
607
|
+
Popover: Popover.extend({
|
|
608
|
+
defaultProps: { radius: 8 },
|
|
609
|
+
styles: {
|
|
610
|
+
dropdown: {
|
|
611
|
+
backgroundColor: 'var(--vx-surface-overlay)',
|
|
612
|
+
border: '1px solid var(--vx-surface-border)',
|
|
613
|
+
boxShadow: 'var(--vx-shadow-overlay)',
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
}),
|
|
617
|
+
// Menu rows: 13px, radius 6, ghost ink-6% hover (floating.module.css — custom properties are
|
|
618
|
+
// stripped from `styles` objects, and Menu's internal Popover does NOT consume
|
|
619
|
+
// `components.Popover.styles`, so the dropdown surface is repeated here). Menu.Label = the
|
|
620
|
+
// mono micro-label idiom; dividers use the layout-divider token.
|
|
621
|
+
Menu: Menu.extend({
|
|
622
|
+
classNames: { item: floatingClasses.menuItem },
|
|
623
|
+
styles: {
|
|
624
|
+
dropdown: {
|
|
625
|
+
backgroundColor: 'var(--vx-surface-overlay)',
|
|
626
|
+
border: '1px solid var(--vx-surface-border)',
|
|
627
|
+
boxShadow: 'var(--vx-shadow-overlay)',
|
|
628
|
+
},
|
|
629
|
+
item: { fontSize: VX.text.md, borderRadius: 6, padding: '6px 10px' },
|
|
630
|
+
label: {
|
|
631
|
+
fontFamily: 'var(--basalt-font-mono)',
|
|
632
|
+
fontSize: VX.text.micro,
|
|
633
|
+
fontWeight: 500,
|
|
634
|
+
letterSpacing: '0.06em',
|
|
635
|
+
textTransform: 'uppercase',
|
|
636
|
+
color: 'var(--vx-faint)',
|
|
637
|
+
},
|
|
638
|
+
divider: { borderColor: 'var(--vx-divider)' },
|
|
639
|
+
},
|
|
640
|
+
}),
|
|
641
|
+
// Combobox is the floating primitive underneath Select/Autocomplete/MultiSelect — like Menu,
|
|
642
|
+
// it doesn't consume `components.Popover.styles`, so the overlay dropdown idiom is repeated.
|
|
643
|
+
Combobox: Combobox.extend({
|
|
644
|
+
styles: {
|
|
645
|
+
dropdown: {
|
|
646
|
+
backgroundColor: 'var(--vx-surface-overlay)',
|
|
647
|
+
border: '1px solid var(--vx-surface-border)',
|
|
648
|
+
boxShadow: 'var(--vx-shadow-overlay)',
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
}),
|
|
652
|
+
// Modal/Drawer: overlay surface + overlay shadow on the content. The header goes transparent —
|
|
653
|
+
// Mantine paints it `--mantine-color-body`, which read as a grey band over the overlay
|
|
654
|
+
// surface. Title = head font; close button = the ghost idiom (floating.module.css).
|
|
655
|
+
Modal: Modal.extend({
|
|
656
|
+
defaultProps: { radius: 8 },
|
|
657
|
+
classNames: { close: floatingClasses.closeButton },
|
|
658
|
+
styles: {
|
|
659
|
+
content: {
|
|
660
|
+
backgroundColor: 'var(--vx-surface-overlay)',
|
|
661
|
+
boxShadow: 'var(--vx-shadow-overlay)',
|
|
662
|
+
},
|
|
663
|
+
header: { backgroundColor: 'transparent' },
|
|
664
|
+
title: {
|
|
665
|
+
fontFamily: 'var(--basalt-font-head)',
|
|
666
|
+
fontWeight: 550,
|
|
667
|
+
fontStretch: '88%',
|
|
668
|
+
},
|
|
669
|
+
},
|
|
670
|
+
}),
|
|
671
|
+
Drawer: Drawer.extend({
|
|
672
|
+
classNames: { close: floatingClasses.closeButton },
|
|
673
|
+
styles: {
|
|
674
|
+
content: {
|
|
675
|
+
backgroundColor: 'var(--vx-surface-overlay)',
|
|
676
|
+
boxShadow: 'var(--vx-shadow-overlay)',
|
|
677
|
+
},
|
|
678
|
+
header: { backgroundColor: 'transparent' },
|
|
679
|
+
title: {
|
|
680
|
+
fontFamily: 'var(--basalt-font-head)',
|
|
681
|
+
fontWeight: 550,
|
|
682
|
+
fontStretch: '88%',
|
|
683
|
+
},
|
|
684
|
+
},
|
|
685
|
+
}),
|
|
686
|
+
// Kbd/Code share the ink-tint idiom (docs/DESIGN-SPEC.md §2: "segmented-control track /
|
|
687
|
+
// count-badge bg: ink 6–8%") — mono, ink-7% bg, radius 5.
|
|
688
|
+
// Flat mono chip (mock's ⌘K badge) — Mantine's default Kbd draws a 3px "keyboard key" bottom
|
|
689
|
+
// border that reads as a heavy off-system rule, so the border goes entirely.
|
|
690
|
+
Kbd: Kbd.extend({
|
|
691
|
+
styles: {
|
|
692
|
+
root: {
|
|
693
|
+
backgroundColor: 'color-mix(in srgb, var(--vx-ink) 7%, transparent)',
|
|
694
|
+
border: 'none',
|
|
695
|
+
color: 'var(--vx-ink2)',
|
|
696
|
+
borderRadius: 5,
|
|
697
|
+
},
|
|
698
|
+
},
|
|
699
|
+
}),
|
|
700
|
+
Code: Code.extend({
|
|
701
|
+
styles: {
|
|
702
|
+
root: {
|
|
703
|
+
backgroundColor: 'color-mix(in srgb, var(--vx-ink) 7%, transparent)',
|
|
704
|
+
borderRadius: 5,
|
|
705
|
+
},
|
|
706
|
+
},
|
|
707
|
+
}),
|
|
708
|
+
// Header cells become a micro-label (mono, uppercase, faint) — numeral/tabular styling for
|
|
709
|
+
// body cells is a per-table call-site concern, left to consumers. `--table-border-color`
|
|
710
|
+
// drives row separators AND the opt-in `withTableBorder` outer border — both drop to the
|
|
711
|
+
// hairline (Mantine's default reads gray-3/dark-4 = the STRONG line, too heavy in a card).
|
|
712
|
+
Table: Table.extend({
|
|
713
|
+
classNames: { table: controlsClasses.tableRoot },
|
|
714
|
+
styles: {
|
|
715
|
+
th: {
|
|
716
|
+
fontFamily: 'var(--basalt-font-mono)',
|
|
717
|
+
fontSize: VX.text.micro,
|
|
718
|
+
fontWeight: 500,
|
|
719
|
+
letterSpacing: '0.06em',
|
|
720
|
+
textTransform: 'uppercase',
|
|
721
|
+
color: 'var(--vx-faint)',
|
|
722
|
+
},
|
|
723
|
+
},
|
|
724
|
+
}),
|
|
725
|
+
// The v9 thumb indicator is a center dot painted in the TRACK color — over the remapped
|
|
726
|
+
// neutral track it read as an artifact, so it's disabled: clean track, plain thumb, accent
|
|
727
|
+
// fill when checked (`--switch-color` defaults to the primary filled shade = the accent).
|
|
728
|
+
Switch: Switch.extend({ defaultProps: { withThumbIndicator: false } }),
|
|
729
|
+
// The tab-list bottom rule (and the inactive-tab hover underline) is a layout separator, not
|
|
730
|
+
// control chrome — it reads the divider token instead of the heavy gray-3/dark-4 line
|
|
731
|
+
// (controls.module.css; custom properties are stripped from `styles` objects). The active tab
|
|
732
|
+
// underline keeps `--tabs-color` (accent) untouched.
|
|
733
|
+
Tabs: Tabs.extend({
|
|
734
|
+
classNames: { root: controlsClasses.tabsRoot },
|
|
735
|
+
// The on-color re-point (see below). Cast: Mantine's `TabsCssVariables` type declares only
|
|
736
|
+
// `--tabs-color` / `--tabs-radius`, yet Tabs' OWN varsResolver writes `--tabs-text-color` —
|
|
737
|
+
// an upstream type gap, so the var it actually paints the active tab with is otherwise
|
|
738
|
+
// unreachable from the theme.
|
|
739
|
+
vars: (theme, props) =>
|
|
740
|
+
({ root: { '--tabs-text-color': onColorFor(theme, props) } }) as unknown as {
|
|
741
|
+
root: Record<'--tabs-color' | '--tabs-radius', string | undefined>
|
|
742
|
+
},
|
|
743
|
+
}),
|
|
744
|
+
|
|
745
|
+
// ── ON-COLOR re-points (see the ON-COLOR doctrine above) ────────────────────────────────
|
|
746
|
+
// These components never reach `variantColorResolver` — each calls Mantine's `getContrastColor`
|
|
747
|
+
// straight from its own `varsResolver`, so each bakes the same scheme-blind white into its ONE
|
|
748
|
+
// foreground var. Theme `vars` merge AFTER a component's own `varsResolver` (Mantine
|
|
749
|
+
// `useStyles`), so re-pointing that var here wins on every render path. Without this, a dark-mode
|
|
750
|
+
// Checkbox/Radio paints a white checkmark on the light accent fill — invisible.
|
|
751
|
+
Checkbox: Checkbox.extend({
|
|
752
|
+
vars: (theme, props) => ({
|
|
753
|
+
root: {
|
|
754
|
+
// `iconColor` is an explicit call-site override, and `outline` paints the mark in the
|
|
755
|
+
// color itself on a transparent box — neither is an on-color surface.
|
|
756
|
+
'--checkbox-icon-color':
|
|
757
|
+
props.iconColor || props.variant === 'outline' ? undefined : onColorFor(theme, props),
|
|
758
|
+
},
|
|
759
|
+
}),
|
|
760
|
+
}),
|
|
761
|
+
Radio: Radio.extend({
|
|
762
|
+
vars: (theme, props) => ({
|
|
763
|
+
root: {
|
|
764
|
+
'--radio-icon-color':
|
|
765
|
+
props.iconColor || props.variant === 'outline' ? undefined : onColorFor(theme, props),
|
|
766
|
+
},
|
|
767
|
+
}),
|
|
768
|
+
}),
|
|
769
|
+
Pagination: Pagination.extend({
|
|
770
|
+
vars: (theme, props) => ({
|
|
771
|
+
root: { '--pagination-active-color': onColorFor(theme, props) },
|
|
772
|
+
}),
|
|
773
|
+
}),
|
|
774
|
+
Stepper: Stepper.extend({
|
|
775
|
+
vars: (theme, props) => ({ root: { '--stepper-icon-color': onColorFor(theme, props) } }),
|
|
776
|
+
}),
|
|
777
|
+
Indicator: Indicator.extend({
|
|
778
|
+
vars: (theme, props) => ({ root: { '--indicator-text-color': onColorFor(theme, props) } }),
|
|
779
|
+
}),
|
|
780
|
+
// Accordion (default variant): hairline separators between items only — the color retune AND
|
|
781
|
+
// the last item's outer border-bottom drop both live in controls.module.css.
|
|
782
|
+
Accordion: Accordion.extend({ classNames: { item: controlsClasses.accordionItem } }),
|
|
783
|
+
// Parents faint, separator line-colored — the current-page treatment (head font, weight) is a
|
|
784
|
+
// shell-level concern (AppBreadcrumbs), not this generic Mantine primitive.
|
|
785
|
+
Breadcrumbs: Breadcrumbs.extend({
|
|
786
|
+
styles: {
|
|
787
|
+
breadcrumb: { color: 'var(--vx-faint)' },
|
|
788
|
+
separator: { color: 'var(--vx-surface-border)' },
|
|
789
|
+
},
|
|
790
|
+
}),
|
|
791
|
+
// Card idiom — same panel + shadow-card as every other surface.
|
|
792
|
+
Notification: Notification.extend({
|
|
793
|
+
defaultProps: { radius: 8 },
|
|
794
|
+
styles: {
|
|
795
|
+
root: {
|
|
796
|
+
backgroundColor: 'var(--vx-surface-panel)',
|
|
797
|
+
boxShadow: 'var(--vx-shadow-card)',
|
|
798
|
+
},
|
|
799
|
+
},
|
|
800
|
+
}),
|
|
801
|
+
},
|
|
802
|
+
})
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Bind Mantine's surface system to the SAME `--vx-*` variables the charts use, so chrome and
|
|
806
|
+
* charts draw from one set of scheme-reactive surfaces.
|
|
807
|
+
*
|
|
808
|
+
* These bindings MUST live in the `light`/`dark` blocks, not the scheme-independent `variables`
|
|
809
|
+
* block: Mantine declares the surface vars under the `[data-mantine-color-scheme]` selector, which
|
|
810
|
+
* outranks a `:root` rule — so a `variables` binding loses to Mantine's per-scheme default. The
|
|
811
|
+
* light/dark blocks are injected under the same scheme selector, at matching specificity, after.
|
|
812
|
+
* (The `--vx-*` refs are themselves scheme-resolved; the per-scheme hex fallbacks guard a brief
|
|
813
|
+
* window before the palette CSS injects.)
|
|
814
|
+
*
|
|
815
|
+
* The hex fallbacks are generated from the `SURFACE` / `NEUTRAL` / `INK` palette pairs (not
|
|
816
|
+
* hand-typed), so they cannot drift from the values the token layer emits for the same `--vx-*`
|
|
817
|
+
* names.
|
|
818
|
+
*/
|
|
819
|
+
/**
|
|
820
|
+
* Bridge Mantine's PRIMARY-color vars onto the `--vx-*` accent tokens — the second half of the
|
|
821
|
+
* single-source rule (surfaces are already bridged below).
|
|
822
|
+
*
|
|
823
|
+
* Without this, the accent is DUAL-SOURCED: the `--vx-*` layer (charts, links, nav icons, focus
|
|
824
|
+
* ring) reads CSS custom properties, while the Mantine chrome (buttons, switches, checkboxes, tabs,
|
|
825
|
+
* badges) reads `theme.colors.blue`, a JS hex ramp baked at module load. The two happened to hold
|
|
826
|
+
* the same hue, so the split was invisible — until you retune one. It is exactly why the theme lab
|
|
827
|
+
* appeared broken: overriding `--vx-accent` on `<html>` restyled the charts and left every button
|
|
828
|
+
* untouched, because no Mantine var pointed at it.
|
|
829
|
+
*
|
|
830
|
+
* `getThemeColor(color, theme)` resolves a plain theme color to `var(--mantine-color-{c}-filled)`,
|
|
831
|
+
* so overriding that ONE var reaches the variant resolver's filled background AND every component
|
|
832
|
+
* that fills from its own varsResolver (Checkbox, Radio, Switch, Tabs, Timeline, Stepper,
|
|
833
|
+
* Indicator, Pagination). The `-text` / `-outline` / `-light-color` vars are the accent's INK role
|
|
834
|
+
* and bridge to `--vx-accent`, which is why they still invert across schemes while the fill does not.
|
|
835
|
+
*
|
|
836
|
+
* The `var(--vx-…, <hex>)` fallbacks are generated from the same `ACCENT` pairs the token layer
|
|
837
|
+
* emits, so they cannot drift, and they cover the window before the palette <style> lands
|
|
838
|
+
* (`injectPalette={false}`).
|
|
839
|
+
*/
|
|
840
|
+
function accentBridge(theme: MantineTheme, side: 'light' | 'dark'): Record<string, string> {
|
|
841
|
+
const c = theme.primaryColor
|
|
842
|
+
return {
|
|
843
|
+
[`--mantine-color-${c}-filled`]: `var(--vx-accentFill, ${ACCENT.accentFill[side]})`,
|
|
844
|
+
[`--mantine-color-${c}-filled-hover`]: `var(--vx-accentFillHover, ${ACCENT.accentFillHover[side]})`,
|
|
845
|
+
[`--mantine-color-${c}-text`]: `var(--vx-accent, ${ACCENT.accent[side]})`,
|
|
846
|
+
[`--mantine-color-${c}-outline`]: `var(--vx-accent, ${ACCENT.accent[side]})`,
|
|
847
|
+
[`--mantine-color-${c}-light-color`]: `var(--vx-accent, ${ACCENT.accent[side]})`,
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* The same bridge for the NON-primary families — the rest of the chrome, single-sourced.
|
|
853
|
+
*
|
|
854
|
+
* Scheme-independent (a fill does not invert), so one map serves both blocks. Only the FILL roles
|
|
855
|
+
* are bridged: `-text` / `-outline` / `-light-color` are INK roles read against the page, and
|
|
856
|
+
* Mantine already resolves those correctly per scheme (dark `-text` is hardcoded to shade 4, a
|
|
857
|
+
* light step; light `-text` chains to `-filled`, so it follows this bridge for free).
|
|
858
|
+
*
|
|
859
|
+
* `dark` is deliberately not a member — `color="dark"` is a near-black surface by intent, not a
|
|
860
|
+
* band color, and forcing it into the band would turn it into a mid grey.
|
|
861
|
+
*/
|
|
862
|
+
function familyBridge(): Record<string, string> {
|
|
863
|
+
const vars: Record<string, string> = {}
|
|
864
|
+
for (const [name, hex] of Object.entries(FILL)) {
|
|
865
|
+
vars[`--mantine-color-${name}-filled`] = `var(--vx-fill-${name}, ${hex})`
|
|
866
|
+
vars[`--mantine-color-${name}-filled-hover`] =
|
|
867
|
+
`var(--vx-fillHover-${name}, color-mix(in srgb, ${hex} 88%, #000))`
|
|
868
|
+
}
|
|
869
|
+
return vars
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export const cssVariablesResolver: CSSVariablesResolver = (theme) => ({
|
|
873
|
+
variables: {},
|
|
874
|
+
light: {
|
|
875
|
+
...onColorVars(theme, 'light'),
|
|
876
|
+
...familyBridge(),
|
|
877
|
+
...accentBridge(theme, 'light'),
|
|
878
|
+
'--mantine-color-body': `var(--vx-surface-bg, ${SURFACE.bg.light})`, // page background
|
|
879
|
+
'--mantine-color-default': `var(--vx-surface-panel, ${SURFACE.panel.light})`, // cards / default controls
|
|
880
|
+
'--mantine-color-default-hover': `var(--vx-surface-elevated, ${SURFACE.elevated.light})`,
|
|
881
|
+
// THE central lever for doctrine inversion #1 on CONTROLS (docs/DESIGN-SPEC.md §8): depth is
|
|
882
|
+
// `shadow-card`, never a hairline, for every `variant="default"` control — not just Card/Paper.
|
|
883
|
+
// `defaultVariantColorsResolver`'s `variant === 'default'` branch reads this ONE var for every
|
|
884
|
+
// component that uses it (Button, ActionIcon, Chip, CheckboxCard, RadioCard, …), so pointing it
|
|
885
|
+
// at `transparent` kills the stock 1px hairline everywhere at once. `transparent`, not `border:
|
|
886
|
+
// none` — the 1px border BOX stays, so focus/error can recolor the same box with no layout
|
|
887
|
+
// shift and `[data-error]` still wins a visible border.
|
|
888
|
+
'--mantine-color-default-border': 'transparent',
|
|
889
|
+
'--mantine-color-dimmed': `var(--vx-neutral, ${NEUTRAL.neutral.light})`, // secondary / muted text
|
|
890
|
+
'--mantine-color-text': `var(--vx-ink, ${INK.ink.light})`, // primary body/heading text
|
|
891
|
+
'--app-shell-border-color': `var(--vx-surface-border, ${SURFACE.border.light})`,
|
|
892
|
+
// THE strict-surface lever. Mantine components do NOT chain border/surface colors through
|
|
893
|
+
// `--mantine-color-default-*`; each hardcodes a RAW ramp step (`--mantine-color-gray-{2,3,4}`
|
|
894
|
+
// on light) directly — which is why AppShell/Table/Input/Divider/Tabs/Popover/Accordion borders
|
|
895
|
+
// render an off-system color while cards use the hairline. Collapse the border-class ramp
|
|
896
|
+
// steps onto the ONE "line" token so EVERY component's border is identical and the agent
|
|
897
|
+
// cannot reintroduce a divergent border. (Hover/subtle BG steps are handled below.)
|
|
898
|
+
'--mantine-color-gray-2': `var(--vx-surface-border, ${SURFACE.border.light})`,
|
|
899
|
+
'--mantine-color-gray-3': `var(--vx-surface-border, ${SURFACE.border.light})`,
|
|
900
|
+
'--mantine-color-gray-4': `var(--vx-surface-border, ${SURFACE.border.light})`,
|
|
901
|
+
// Hover/subtle/striped/track surfaces read `gray-0/1` raw → the dedicated subtle token (a faint
|
|
902
|
+
// step below panel, so hover is actually visible). Dark hover uses the `basaltDark` dark-5/6/7
|
|
903
|
+
// steps, already on-identity.
|
|
904
|
+
'--mantine-color-gray-0': `var(--vx-surface-subtle, ${SURFACE.subtle.light})`,
|
|
905
|
+
'--mantine-color-gray-1': `var(--vx-surface-subtle, ${SURFACE.subtle.light})`,
|
|
906
|
+
},
|
|
907
|
+
dark: {
|
|
908
|
+
...onColorVars(theme, 'dark'),
|
|
909
|
+
...familyBridge(),
|
|
910
|
+
...accentBridge(theme, 'dark'),
|
|
911
|
+
'--mantine-color-body': `var(--vx-surface-bg, ${SURFACE.bg.dark})`,
|
|
912
|
+
'--mantine-color-default': `var(--vx-surface-panel, ${SURFACE.panel.dark})`,
|
|
913
|
+
'--mantine-color-default-hover': `var(--vx-surface-elevated, ${SURFACE.elevated.dark})`,
|
|
914
|
+
// See the light block above — same lever, both schemes.
|
|
915
|
+
'--mantine-color-default-border': 'transparent',
|
|
916
|
+
'--mantine-color-dimmed': `var(--vx-neutral, ${NEUTRAL.neutral.dark})`,
|
|
917
|
+
'--mantine-color-text': `var(--vx-ink, ${INK.ink.dark})`,
|
|
918
|
+
'--app-shell-border-color': `var(--vx-surface-border, ${SURFACE.border.dark})`,
|
|
919
|
+
// Dark components read `--mantine-color-dark-4` (border) raw. The `basaltDark` tuple already
|
|
920
|
+
// sets dark-4, but to a slightly lighter step than the hairline token, so layout borders read
|
|
921
|
+
// marginally heavier than card borders. Pin dark-4 to the SAME "line" token for parity.
|
|
922
|
+
'--mantine-color-dark-4': `var(--vx-surface-border, ${SURFACE.border.dark})`,
|
|
923
|
+
},
|
|
924
|
+
})
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Build the Basalt theme, optionally merged with consumer overrides. Overrides win on conflict
|
|
928
|
+
* (Mantine `mergeThemeOverrides` is last-wins), so a consumer can retune any field without
|
|
929
|
+
* forking the base.
|
|
930
|
+
*/
|
|
931
|
+
export function createBasaltTheme(overrides?: MantineThemeOverride): MantineThemeOverride {
|
|
932
|
+
return overrides ? mergeThemeOverrides(baseTheme, overrides) : baseTheme
|
|
933
|
+
}
|