basalt-ui 2.21.0 → 2.22.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/CHANGELOG.md +33 -0
- package/MIGRATING.md +277 -12
- package/agent/agents/basalt-design-reviewer.md +1 -1
- package/agent/rules/basalt-tokens.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +1 -1
- package/agent/skills/basalt-design/references/anti-defaults.md +1 -1
- package/agent/skills/basalt-design/references/catalogue.md +1 -0
- package/dist/charts/BandStrip.d.ts.map +1 -1
- package/dist/charts/BandStrip.js +27 -3
- package/dist/charts/Bars.d.ts.map +1 -1
- package/dist/charts/Bars.js +5 -0
- package/dist/charts/CartesianChart.d.ts +8 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -1
- package/dist/charts/CartesianChart.js +8 -5
- package/dist/charts/ChartCard.d.ts +12 -3
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +29 -8
- package/dist/charts/DualPanel.d.ts.map +1 -1
- package/dist/charts/DualPanel.js +5 -8
- package/dist/charts/Heatmap.d.ts +12 -1
- package/dist/charts/Heatmap.d.ts.map +1 -1
- package/dist/charts/Heatmap.js +34 -5
- package/dist/charts/Lines.d.ts +3 -0
- package/dist/charts/Lines.d.ts.map +1 -1
- package/dist/charts/Lines.js +29 -6
- package/dist/charts/MirroredBars.d.ts.map +1 -1
- package/dist/charts/MirroredBars.js +4 -6
- package/dist/charts/Sparkline.d.ts +7 -1
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +39 -14
- package/dist/charts/StackedArea.d.ts +4 -1
- package/dist/charts/StackedArea.d.ts.map +1 -1
- package/dist/charts/StackedArea.js +9 -3
- package/dist/charts/band-fold.d.ts +20 -1
- package/dist/charts/band-fold.d.ts.map +1 -1
- package/dist/charts/band-fold.js +9 -0
- package/dist/charts/chart-box.module.css +19 -0
- package/dist/charts/chart-card.module.css +25 -0
- package/dist/charts/chart-legend.module.css +7 -0
- package/dist/charts/compile.d.ts +17 -6
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +145 -74
- package/dist/charts/labels.d.ts +15 -4
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +34 -10
- package/dist/charts/legend.d.ts +2 -0
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +7 -21
- package/dist/charts/marks.js +1 -1
- package/dist/charts/panel.d.ts +0 -6
- package/dist/charts/panel.d.ts.map +1 -1
- package/dist/charts/panel.js +1 -10
- package/dist/charts/ref-label.d.ts +26 -0
- package/dist/charts/ref-label.d.ts.map +1 -0
- package/dist/charts/ref-label.js +63 -0
- package/dist/charts/scales.d.ts +4 -1
- package/dist/charts/scales.d.ts.map +1 -1
- package/dist/charts/scales.js +14 -3
- package/dist/charts/sparkline.module.css +10 -11
- package/dist/charts/sparkline.module.css.d.ts +1 -2
- package/dist/charts/state.d.ts +2 -0
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +2 -1
- package/dist/charts/types.d.ts +14 -5
- package/dist/charts/types.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.d.ts +1 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +68 -4
- package/dist/cli/shot/capture.d.ts +21 -2
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +194 -32
- package/dist/cli/shot/detect.d.ts.map +1 -1
- package/dist/cli/shot/detect.js +14 -1
- package/dist/cli/shot/playwright.d.ts +5 -2
- package/dist/cli/shot/playwright.d.ts.map +1 -1
- package/dist/cli/shot/types.d.ts +2 -0
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/shot/types.js +2 -0
- package/dist/controls/controls.module.css +11 -1
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +1 -0
- package/dist/controls/sync-button.d.ts.map +1 -1
- package/dist/controls/sync-button.js +22 -3
- package/dist/controls/sync-button.module.css +34 -2
- package/dist/controls/sync-button.module.css.d.ts +1 -0
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +7 -8
- package/dist/dashboard/bar-list.module.css +53 -0
- package/dist/dashboard/bar-list.module.css.d.ts +1 -0
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +2 -0
- package/dist/dashboard/meter-model.d.ts +77 -3
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +88 -15
- package/dist/dashboard/meter-parts.d.ts +8 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +238 -71
- package/dist/dashboard/meter.d.ts +43 -60
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +20 -3
- package/dist/dashboard/meter.module.css +61 -0
- package/dist/dashboard/meter.module.css.d.ts +5 -0
- package/dist/dashboard/page-summary.d.ts +20 -0
- package/dist/dashboard/page-summary.d.ts.map +1 -0
- package/dist/dashboard/page-summary.js +28 -0
- package/dist/dashboard/page-summary.module.css +89 -0
- package/dist/dashboard/page-summary.module.css.d.ts +15 -0
- package/dist/dashboard/section.d.ts +25 -2
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +10 -5
- package/dist/dashboard/section.module.css +23 -0
- package/dist/dashboard/section.module.css.d.ts +1 -0
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +1 -1
- package/dist/dashboard/stat-card.d.ts +4 -2
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +7 -5
- package/dist/dashboard/stat-card.module.css +17 -0
- package/dist/dashboard/stat-strip.d.ts +7 -1
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +74 -46
- package/dist/dashboard/stat-strip.module.css +67 -20
- package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
- package/dist/dashboard/visual-slot.d.ts +7 -1
- package/dist/dashboard/visual-slot.d.ts.map +1 -1
- package/dist/dashboard/visual-slot.js +3 -1
- package/dist/guard/vx-names.d.ts.map +1 -1
- package/dist/guard/vx-names.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/styles.css +34 -2
- package/dist/theme/chrome-vars.d.ts +20 -5
- package/dist/theme/chrome-vars.d.ts.map +1 -1
- package/dist/theme/chrome-vars.js +46 -3
- package/dist/theme/controls.module.css +23 -0
- package/dist/theme/controls.module.css.d.ts +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +8 -20
- package/dist/tokens/core.d.ts +2 -1
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +6 -1
- package/dist/tokens/derive.d.ts +3 -1
- package/dist/tokens/derive.d.ts.map +1 -1
- package/dist/tokens/derive.js +16 -1
- package/dist/tokens/palette.d.ts +4 -0
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +4 -0
- package/dist/tokens/status-text.d.ts.map +1 -1
- package/dist/tokens/status-text.js +3 -1
- package/llms.txt +38 -20
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +33 -3
- package/src/charts/Bars.tsx +6 -0
- package/src/charts/CartesianChart.tsx +16 -3
- package/src/charts/ChartCard.tsx +34 -6
- package/src/charts/DualPanel.tsx +3 -6
- package/src/charts/Heatmap.tsx +54 -5
- package/src/charts/Lines.tsx +56 -10
- package/src/charts/MirroredBars.tsx +3 -5
- package/src/charts/Sparkline.tsx +50 -13
- package/src/charts/StackedArea.tsx +14 -4
- package/src/charts/band-fold.ts +31 -1
- package/src/charts/chart-box.module.css +19 -0
- package/src/charts/chart-card.module.css +25 -0
- package/src/charts/chart-legend.module.css +7 -0
- package/src/charts/compile.ts +210 -85
- package/src/charts/labels.ts +48 -14
- package/src/charts/legend.tsx +10 -20
- package/src/charts/marks.ts +1 -1
- package/src/charts/panel.tsx +1 -16
- package/src/charts/ref-label.ts +104 -0
- package/src/charts/scales.ts +22 -2
- package/src/charts/sparkline.module.css +10 -11
- package/src/charts/sparkline.module.css.d.ts +1 -2
- package/src/charts/state.tsx +3 -1
- package/src/charts/types.ts +14 -5
- package/src/cli/doctor-upgrade.ts +1 -1
- package/src/cli/init.ts +100 -3
- package/src/cli/shot/capture.ts +251 -32
- package/src/cli/shot/detect.ts +18 -1
- package/src/cli/shot/playwright.ts +2 -2
- package/src/cli/shot/types.ts +3 -0
- package/src/controls/controls.module.css +11 -1
- package/src/controls/filter-pill.tsx +2 -0
- package/src/controls/sync-button.module.css +34 -2
- package/src/controls/sync-button.module.css.d.ts +1 -0
- package/src/controls/sync-button.tsx +40 -4
- package/src/dashboard/bar-list.module.css +53 -0
- package/src/dashboard/bar-list.module.css.d.ts +1 -0
- package/src/dashboard/bar-list.tsx +78 -69
- package/src/dashboard/index.ts +1 -0
- package/src/dashboard/meter-model.ts +186 -20
- package/src/dashboard/meter-parts.tsx +285 -64
- package/src/dashboard/meter.module.css +61 -0
- package/src/dashboard/meter.module.css.d.ts +5 -0
- package/src/dashboard/meter.tsx +60 -10
- package/src/dashboard/page-summary.module.css +89 -0
- package/src/dashboard/page-summary.module.css.d.ts +15 -0
- package/src/dashboard/page-summary.tsx +95 -0
- package/src/dashboard/section.module.css +23 -0
- package/src/dashboard/section.module.css.d.ts +1 -0
- package/src/dashboard/section.tsx +59 -11
- package/src/dashboard/stat-card-parts.tsx +5 -1
- package/src/dashboard/stat-card.module.css +17 -0
- package/src/dashboard/stat-card.tsx +12 -6
- package/src/dashboard/stat-strip.module.css +67 -20
- package/src/dashboard/stat-strip.module.css.d.ts +4 -0
- package/src/dashboard/stat-strip.tsx +118 -72
- package/src/dashboard/visual-slot.ts +12 -3
- package/src/guard/vx-names.ts +2 -0
- package/src/index.ts +2 -0
- package/src/styles.css +34 -2
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +186 -60
- package/src/theme/chrome-vars.ts +77 -8
- package/src/theme/controls.module.css +23 -0
- package/src/theme/controls.module.css.d.ts +1 -0
- package/src/theme/index.ts +12 -25
- package/src/tokens/core.ts +4 -1
- package/src/tokens/derive.ts +32 -3
- package/src/tokens/palette.ts +4 -0
- package/src/tokens/status-text.ts +2 -0
|
@@ -200,6 +200,11 @@ html[data-mantine-color-scheme] .inputWrapper[data-variant='default']:not([data-
|
|
|
200
200
|
.actionIconRoot:disabled:not([data-loading]),
|
|
201
201
|
.actionIconRoot[data-disabled]:not([data-loading]) {
|
|
202
202
|
--ctrl-depth: 0 0 transparent;
|
|
203
|
+
|
|
204
|
+
/* One surface in both schemes. Mantine's disabled fill is a gray step that is the PANEL itself in
|
|
205
|
+
* dark, so a disabled Button there read as the subtle variant with dimmer text; an ink-mixed panel
|
|
206
|
+
* is visible on either page, and the state is told apart by more than ink. */
|
|
207
|
+
background: color-mix(in srgb, var(--vx-ink) 8%, var(--vx-surface-panel));
|
|
203
208
|
}
|
|
204
209
|
|
|
205
210
|
/*
|
|
@@ -318,6 +323,24 @@ html .tableRoot tbody tr:last-of-type {
|
|
|
318
323
|
border-bottom: none;
|
|
319
324
|
}
|
|
320
325
|
|
|
326
|
+
/*
|
|
327
|
+
* Badge status dot: a coloured `light` Badge is the neutral surface + ink word with a leading dot in the
|
|
328
|
+
* status colour (`badgeVars` writes the `--badge-dot*` vars; nothing here without them). The dot is a
|
|
329
|
+
* grid item, so the root takes two columns while it is shown. A section (left or right) replaces it.
|
|
330
|
+
*/
|
|
331
|
+
.badgeRoot[data-variant='light']:not([data-with-left-section], [data-with-right-section]) {
|
|
332
|
+
grid-template-columns: var(--badge-dot-cols, none);
|
|
333
|
+
column-gap: calc(0.25rem * var(--mantine-scale));
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.badgeRoot[data-variant='light']:not([data-with-left-section], [data-with-right-section])::before {
|
|
337
|
+
content: var(--badge-dot-content, none);
|
|
338
|
+
width: calc(0.375rem * var(--mantine-scale));
|
|
339
|
+
height: calc(0.375rem * var(--mantine-scale));
|
|
340
|
+
border-radius: 50%;
|
|
341
|
+
background: var(--badge-dot);
|
|
342
|
+
}
|
|
343
|
+
|
|
321
344
|
/*
|
|
322
345
|
* Badge leading glyph (`leftSection`): the state encoded by shape. 12px on a 20px chip, 4px gap
|
|
323
346
|
* (Mantine's own section margin is spacing.xs / 2 = 4), centred on the label.
|
package/src/theme/index.ts
CHANGED
|
@@ -86,7 +86,7 @@ import { CTL_HEIGHT_VARS } from '../tokens/ctl-vars'
|
|
|
86
86
|
import type { CtlHeightVar } from '../tokens/ctl-vars'
|
|
87
87
|
import { SIZE_CLASS_BREAKPOINTS } from '../tokens/size-classes'
|
|
88
88
|
import type { BasaltFontsConfig } from '../tokens/core'
|
|
89
|
-
import { onColor, onColorFor, inkVars, tabsVars } from './chrome-vars'
|
|
89
|
+
import { badgeVars, onColor, onColorFor, inkVars, tabsVars } from './chrome-vars'
|
|
90
90
|
import cardInsetClasses from './card-inset.module.css'
|
|
91
91
|
import controlsClasses from './controls.module.css'
|
|
92
92
|
import floatingClasses from './floating.module.css'
|
|
@@ -505,10 +505,12 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
505
505
|
},
|
|
506
506
|
}),
|
|
507
507
|
// Status chip (SPEC § 6.10): `light` + `tight`, neutral until `color=` opts in (the accent is
|
|
508
|
-
// never a status chip's default)
|
|
508
|
+
// never a status chip's default). The neutral surface + ink word is the chip; a named colour is
|
|
509
|
+
// a leading dot (`badgeVars`); a `leftSection` glyph is sized in `badgeSection`.
|
|
509
510
|
Badge: ext<typeof Badge>({
|
|
510
511
|
defaultProps: { variant: 'light', color: 'gray', radius: radius.tight },
|
|
511
|
-
classNames: { section: controlsClasses.badgeSection },
|
|
512
|
+
classNames: { root: controlsClasses.badgeRoot, section: controlsClasses.badgeSection },
|
|
513
|
+
vars: badgeVars,
|
|
512
514
|
}),
|
|
513
515
|
// Alert renders its title in the body font by default; bring it onto the head-font idiom
|
|
514
516
|
// (docs/DESIGN-SPEC.md §5) like every other titled surface. Radius/padding/color tint are
|
|
@@ -1081,8 +1083,8 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
1081
1083
|
// The tab-list bottom rule (and the inactive-tab hover underline) is a layout separator, not
|
|
1082
1084
|
// control chrome — it reads the divider token instead of the heavy gray-3/dark-4 line
|
|
1083
1085
|
// (controls.module.css; custom properties are stripped from `styles` objects). The active tab
|
|
1084
|
-
// underline
|
|
1085
|
-
// `color=` opts back in.
|
|
1086
|
+
// underline, outline border and pill fill take ink, not the accent (SPEC § 6.12; DESIGN-CORE
|
|
1087
|
+
// § Accent discipline); `color=` opts back in.
|
|
1086
1088
|
Tabs: ext<typeof Tabs>({
|
|
1087
1089
|
classNames: { root: controlsClasses.tabsRoot },
|
|
1088
1090
|
vars: tabsVars,
|
|
@@ -1257,28 +1259,13 @@ function buttonPaddingX(size: unknown): string | undefined {
|
|
|
1257
1259
|
}
|
|
1258
1260
|
|
|
1259
1261
|
/**
|
|
1260
|
-
* The inset on a Button's section side
|
|
1261
|
-
* `--button-padding-x / 1.5
|
|
1262
|
-
*
|
|
1263
|
-
*
|
|
1264
|
-
* compact-xl 12; `ctl` 6.67 → 8). Undefined sizes keep Mantine's own value.
|
|
1262
|
+
* The inset on a Button's section side EQUALS its text side, so an icon Button is balanced (Mantine
|
|
1263
|
+
* derives it as `--button-padding-x / 1.5`, which also left the icon side one step tighter than the
|
|
1264
|
+
* text side: 8/12, 12/16, 12/20). `ctl` has its own `--button-padding-x-ctl`; undefined sizes keep
|
|
1265
|
+
* Mantine's value.
|
|
1265
1266
|
*/
|
|
1266
|
-
const BUTTON_SECTION_X: Record<string, string> = {
|
|
1267
|
-
xs: 'var(--vx-space-stack-sm)',
|
|
1268
|
-
sm: 'var(--vx-space-stack-md)',
|
|
1269
|
-
md: 'var(--vx-space-stack-md)',
|
|
1270
|
-
lg: 'var(--vx-space-stack-lg)',
|
|
1271
|
-
xl: 'var(--vx-space-stack-xl)',
|
|
1272
|
-
ctl: 'var(--vx-space-stack-sm)',
|
|
1273
|
-
'compact-xs': 'var(--vx-space-stack-xs)',
|
|
1274
|
-
'compact-sm': 'var(--vx-space-stack-xs)',
|
|
1275
|
-
'compact-md': 'var(--vx-space-stack-sm)',
|
|
1276
|
-
'compact-lg': 'var(--vx-space-stack-sm)',
|
|
1277
|
-
'compact-xl': 'var(--vx-space-stack-md)',
|
|
1278
|
-
}
|
|
1279
1267
|
function buttonSectionX(size: unknown): string | undefined {
|
|
1280
|
-
|
|
1281
|
-
return step === undefined ? undefined : `calc(${step} * var(--mantine-scale))`
|
|
1268
|
+
return size === 'ctl' ? 'var(--button-padding-x-ctl)' : buttonPaddingX(size)
|
|
1282
1269
|
}
|
|
1283
1270
|
|
|
1284
1271
|
/**
|
package/src/tokens/core.ts
CHANGED
|
@@ -165,7 +165,6 @@ export const VX = {
|
|
|
165
165
|
// "dev slider/production JS defaultProps" gap as Timeline's `bulletSize` — see `deriveSpacing`'s
|
|
166
166
|
// doc in tokens/palette.ts).
|
|
167
167
|
legendGap: SPACE_STEP.chartLegendGap,
|
|
168
|
-
legendFontSize: TEXT.sm,
|
|
169
168
|
|
|
170
169
|
// The type scale (px numbers — see TEXT above). Use in inline styles and visx SVG props;
|
|
171
170
|
// use `var(--vx-text-*)` in CSS modules.
|
|
@@ -273,6 +272,8 @@ export const VX = {
|
|
|
273
272
|
bg: 'var(--vx-surface-bg)',
|
|
274
273
|
panel: 'var(--vx-surface-panel)',
|
|
275
274
|
panelHover: 'var(--vx-surface-panel-hover)',
|
|
275
|
+
rowHover: 'var(--vx-surface-row-hover)', // a hovered row on a panel, visible in both schemes
|
|
276
|
+
rowSelected: 'var(--vx-surface-row-selected)', // a selected row on a panel
|
|
276
277
|
elevated: 'var(--vx-surface-elevated)',
|
|
277
278
|
subtle: 'var(--vx-surface-subtle)',
|
|
278
279
|
overlay: 'var(--vx-surface-overlay)', // floating layer (menus, popovers, modals, drawers)
|
|
@@ -414,6 +415,8 @@ function frameworkPrimitives(side: Side, data: PaletteData): string {
|
|
|
414
415
|
decl('surface-bg', su.bg[side]),
|
|
415
416
|
decl('surface-panel', su.panel[side]),
|
|
416
417
|
decl('surface-panel-hover', su.panelHover[side]),
|
|
418
|
+
decl('surface-row-hover', su.rowHover[side]),
|
|
419
|
+
decl('surface-row-selected', su.rowSelected[side]),
|
|
417
420
|
decl('surface-elevated', su.elevated[side]),
|
|
418
421
|
decl('surface-subtle', su.subtle[side]),
|
|
419
422
|
decl('surface-overlay', su.overlay[side]),
|
package/src/tokens/derive.ts
CHANGED
|
@@ -279,8 +279,12 @@ export type SurfaceKey =
|
|
|
279
279
|
| 'field'
|
|
280
280
|
| 'border'
|
|
281
281
|
| 'hairline'
|
|
282
|
+
| RowSurfaceKey
|
|
282
283
|
|
|
283
|
-
|
|
284
|
+
/** The row surfaces: the panel mixed toward the ink, not a tone stop of their own. */
|
|
285
|
+
export type RowSurfaceKey = 'rowHover' | 'rowSelected'
|
|
286
|
+
|
|
287
|
+
const SURFACE_TONE: Record<Side, Record<Exclude<SurfaceKey, RowSurfaceKey>, number>> = {
|
|
284
288
|
light: {
|
|
285
289
|
bg: 93.45,
|
|
286
290
|
panel: 96.21,
|
|
@@ -303,6 +307,22 @@ const SURFACE_TONE: Record<Side, Record<SurfaceKey, number>> = {
|
|
|
303
307
|
},
|
|
304
308
|
}
|
|
305
309
|
|
|
310
|
+
// Ink share of a row surface, per scheme. Hover must clear the `panelHover` step's contrast against the
|
|
311
|
+
// panel (the dark step is the larger, 5.7 tones vs 2.1); selected sits one step above. Light stays
|
|
312
|
+
// shallow so tertiary text and status text keep their margin on a selected row.
|
|
313
|
+
const ROW_INK_MIX: Record<RowSurfaceKey, Record<Side, number>> = {
|
|
314
|
+
rowHover: { light: 0.05, dark: 0.07 },
|
|
315
|
+
rowSelected: { light: 0.075, dark: 0.09 },
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** `a` toward `b` by `t` per sRGB channel — the hex twin of `color-mix(in srgb, b t%, a)`. */
|
|
319
|
+
function mixHex(a: string, b: string, t: number): string {
|
|
320
|
+
const channel = (hex: string, i: number): number =>
|
|
321
|
+
Number.parseInt(hex.slice(1 + 2 * i, 3 + 2 * i), 16)
|
|
322
|
+
const out = [0, 1, 2].map((i) => Math.round(channel(a, i) * (1 - t) + channel(b, i) * t))
|
|
323
|
+
return `#${out.map((c) => c.toString(16).padStart(2, '0')).join('')}`
|
|
324
|
+
}
|
|
325
|
+
|
|
306
326
|
// Ink ramp tone stops (achromatic). NOT shifted by lightLevel/darkLevel — text tone stays stable
|
|
307
327
|
// while surfaces move around it.
|
|
308
328
|
export type InkKey = 'ink' | 'ink2' | 'muted' | 'faint'
|
|
@@ -311,7 +331,7 @@ const INK_TONE: Record<Side, Record<InkKey, number>> = {
|
|
|
311
331
|
// light `faint` is tone 44.5 so tertiary text clears WCAG AA (4.5:1) on every text surface
|
|
312
332
|
// (bg / panel / subtle / field); 48.44 landed at 4.23–4.31:1 on bg and subtle.
|
|
313
333
|
light: { ink: 15.16, ink2: 27.09, muted: 34.88, faint: 44.5 },
|
|
314
|
-
dark: { ink: 90.94, ink2: 88.12, muted: 84.91, faint:
|
|
334
|
+
dark: { ink: 90.94, ink2: 88.12, muted: 84.91, faint: 68.5 },
|
|
315
335
|
}
|
|
316
336
|
|
|
317
337
|
// ── Status/semantic — three baked hues, each with its own calibrated tone+chroma stop per scheme.
|
|
@@ -437,7 +457,7 @@ export function deriveTokensRaw(
|
|
|
437
457
|
}
|
|
438
458
|
|
|
439
459
|
const surface = {} as Record<SurfaceKey, ColorPair>
|
|
440
|
-
for (const key of Object.keys(SURFACE_TONE.light) as SurfaceKey[]) {
|
|
460
|
+
for (const key of Object.keys(SURFACE_TONE.light) as Exclude<SurfaceKey, RowSurfaceKey>[]) {
|
|
441
461
|
surface[key] = {
|
|
442
462
|
light: hctToHex({
|
|
443
463
|
hue: neutral.hue,
|
|
@@ -460,6 +480,15 @@ export function deriveTokensRaw(
|
|
|
460
480
|
}
|
|
461
481
|
}
|
|
462
482
|
|
|
483
|
+
// Row hover/selected: the panel one ink step along, so both read in both schemes (`panelHover`
|
|
484
|
+
// is LIGHTER than `panel` in light and vanishes on it). `row-surfaces.test.ts` pins the floor.
|
|
485
|
+
for (const key of Object.keys(ROW_INK_MIX) as RowSurfaceKey[]) {
|
|
486
|
+
surface[key] = {
|
|
487
|
+
light: mixHex(surface.panel.light, ink.ink.light, ROW_INK_MIX[key].light),
|
|
488
|
+
dark: mixHex(surface.panel.dark, ink.ink.dark, ROW_INK_MIX[key].dark),
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
463
492
|
const status = deriveStatusHexes(surface)
|
|
464
493
|
|
|
465
494
|
return {
|
package/src/tokens/palette.ts
CHANGED
|
@@ -1332,6 +1332,10 @@ function buildPaletteDataUncached(config: DeriveConfig) {
|
|
|
1332
1332
|
bg: DERIVED.surface.bg, // page background
|
|
1333
1333
|
panel: DERIVED.surface.panel, // cards, controls
|
|
1334
1334
|
panelHover: DERIVED.surface.panelHover,
|
|
1335
|
+
// Row hover / selected on a panel — the panel one ink step along (`derive.ts`), visible in both
|
|
1336
|
+
// schemes where `panelHover` (lighter than `panel` in light) is not.
|
|
1337
|
+
rowHover: DERIVED.surface.rowHover,
|
|
1338
|
+
rowSelected: DERIVED.surface.rowSelected,
|
|
1335
1339
|
// Elevated surface (chart area, `--mantine-color-default-hover`) — same lift as panel-hover.
|
|
1336
1340
|
elevated: DERIVED.surface.elevated,
|
|
1337
1341
|
border: DERIVED.surface.border, // "line" — strong border (layout/control chrome, NOT the card ring)
|