basalt-ui 2.21.0 → 2.23.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 +60 -0
- package/MIGRATING.md +452 -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 +73 -3
- package/dist/charts/Bars.d.ts.map +1 -1
- package/dist/charts/Bars.js +6 -0
- package/dist/charts/CartesianChart.d.ts +10 -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 +39 -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 +14 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +101 -22
- 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 +38 -1
- package/dist/charts/band-fold.d.ts.map +1 -1
- package/dist/charts/band-fold.js +18 -1
- package/dist/charts/chart-box.module.css +19 -0
- package/dist/charts/chart-card.module.css +25 -0
- package/dist/charts/chart-dates.d.ts +12 -0
- package/dist/charts/chart-dates.d.ts.map +1 -0
- package/dist/charts/chart-dates.js +16 -0
- package/dist/charts/chart-legend.module.css +7 -0
- package/dist/charts/compile.d.ts +25 -6
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +152 -72
- package/dist/charts/date-tick-format.d.ts +5 -5
- package/dist/charts/date-tick-format.d.ts.map +1 -1
- package/dist/charts/date-tick-format.js +3 -7
- package/dist/charts/labels.d.ts +21 -6
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +52 -17
- 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 +43 -0
- package/dist/charts/ref-label.d.ts.map +1 -0
- package/dist/charts/ref-label.js +75 -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 +13 -17
- 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 +5 -2
- package/dist/charts/types.d.ts +18 -8
- 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 +202 -36
- package/dist/cli/shot/detect.d.ts.map +1 -1
- package/dist/cli/shot/detect.js +17 -1
- package/dist/cli/shot/playwright.d.ts +13 -2
- package/dist/cli/shot/playwright.d.ts.map +1 -1
- package/dist/cli/shot/playwright.js +5 -1
- package/dist/cli/shot/types.d.ts +4 -0
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/shot/types.js +2 -0
- package/dist/cli/tokens-css.d.ts +5 -7
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/cli/tokens-css.js +11 -12
- 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 +6 -1
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +15 -8
- package/dist/dashboard/bar-list.module.css +83 -0
- package/dist/dashboard/bar-list.module.css.d.ts +1 -0
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +2 -2
- 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 +84 -5
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +100 -15
- package/dist/dashboard/meter-parts.d.ts +9 -1
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +276 -74
- package/dist/dashboard/meter.d.ts +54 -65
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +21 -4
- package/dist/dashboard/meter.module.css +76 -0
- package/dist/dashboard/meter.module.css.d.ts +6 -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/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +1 -1
- 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 +36 -0
- package/dist/dashboard/stat-group.module.css +7 -0
- package/dist/dashboard/stat-strip.d.ts +22 -6
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +104 -60
- package/dist/dashboard/stat-strip.module.css +122 -53
- 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/index.d.ts.map +1 -1
- package/dist/guard/index.js +0 -5
- 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 +43 -4
- 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 +37 -0
- package/dist/theme/controls.module.css.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +18 -27
- package/dist/theme/status-verdict.d.ts.map +1 -1
- package/dist/theme/status-verdict.js +9 -1
- 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 +11 -10
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +11 -10
- package/dist/tokens/status-text.d.ts.map +1 -1
- package/dist/tokens/status-text.js +3 -1
- package/llms.txt +42 -22
- package/package.json +1 -1
- package/src/charts/BandStrip.tsx +83 -3
- package/src/charts/Bars.tsx +7 -0
- package/src/charts/CartesianChart.tsx +18 -3
- package/src/charts/ChartCard.tsx +54 -13
- 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 +135 -25
- package/src/charts/StackedArea.tsx +14 -4
- package/src/charts/band-fold.ts +50 -1
- package/src/charts/chart-box.module.css +19 -0
- package/src/charts/chart-card.module.css +25 -0
- package/src/charts/chart-dates.ts +30 -0
- package/src/charts/chart-legend.module.css +7 -0
- package/src/charts/compile.ts +253 -87
- package/src/charts/date-tick-format.ts +10 -13
- package/src/charts/labels.ts +81 -26
- 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 +131 -0
- package/src/charts/scales.ts +22 -2
- package/src/charts/sparkline.module.css +13 -17
- package/src/charts/sparkline.module.css.d.ts +1 -2
- package/src/charts/state.tsx +9 -4
- package/src/charts/types.ts +18 -8
- package/src/cli/doctor-upgrade.ts +1 -1
- package/src/cli/init.ts +100 -3
- package/src/cli/shot/capture.ts +266 -35
- package/src/cli/shot/detect.ts +18 -1
- package/src/cli/shot/playwright.ts +20 -4
- package/src/cli/shot/types.ts +5 -0
- package/src/cli/tokens-css.ts +18 -20
- 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 +83 -0
- package/src/dashboard/bar-list.module.css.d.ts +1 -0
- package/src/dashboard/bar-list.tsx +107 -69
- package/src/dashboard/delta-badge.tsx +6 -2
- package/src/dashboard/index.ts +1 -0
- package/src/dashboard/meter-model.ts +207 -24
- package/src/dashboard/meter-parts.tsx +349 -67
- package/src/dashboard/meter.module.css +76 -0
- package/src/dashboard/meter.module.css.d.ts +6 -0
- package/src/dashboard/meter.tsx +72 -18
- 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/query-state.tsx +1 -1
- 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 +36 -0
- package/src/dashboard/stat-card.tsx +12 -6
- package/src/dashboard/stat-group.module.css +7 -0
- package/src/dashboard/stat-strip.module.css +122 -53
- package/src/dashboard/stat-strip.module.css.d.ts +4 -0
- package/src/dashboard/stat-strip.tsx +176 -91
- package/src/dashboard/visual-slot.ts +12 -3
- package/src/guard/index.ts +0 -5
- package/src/guard/vx-names.ts +2 -0
- package/src/index.ts +2 -0
- package/src/styles.css +43 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +200 -68
- package/src/theme/chrome-vars.ts +77 -8
- package/src/theme/controls.module.css +37 -0
- package/src/theme/controls.module.css.d.ts +2 -0
- package/src/theme/index.ts +22 -32
- package/src/theme/status-verdict.tsx +5 -1
- package/src/tokens/core.ts +4 -1
- package/src/tokens/derive.ts +32 -3
- package/src/tokens/palette.ts +11 -10
- package/src/tokens/status-text.ts +2 -0
package/src/theme/chrome-vars.ts
CHANGED
|
@@ -110,12 +110,17 @@ export function inkVars(props: {
|
|
|
110
110
|
return INK_BY_VARIANT[variant as keyof typeof INK_BY_VARIANT] ?? {}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/** The selected `pills` Tab: one ink step over the panel, the same neutral the SegmentedControl indicator uses. */
|
|
114
|
+
const PILL_FILL = 'color-mix(in srgb, var(--vx-ink) 12%, var(--vx-surface-panel))'
|
|
115
|
+
|
|
113
116
|
/**
|
|
114
|
-
* Tabs vars: the
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
117
|
+
* Tabs vars: the selected tab reads by ink and weight, never the accent (SPEC § 6.12; DESIGN-CORE
|
|
118
|
+
* § Accent discipline). `default` and `outline` paint their active underline/border from
|
|
119
|
+
* `--tabs-color`, so that is ink; `pills` fills the tab with it, so the fill is an ink-mixed panel
|
|
120
|
+
* and the label (`--tabs-text-color`) is ink, not the on-accent white. An explicit `color=` opts out
|
|
121
|
+
* of all three and keeps the on-color text var. The return type lists `--tabs-text-color` and
|
|
122
|
+
* `--tabs-radius` because Mantine's `TabsCssVariables` type declares only `--tabs-color` /
|
|
123
|
+
* `--tabs-radius` while Tabs' OWN varsResolver writes `--tabs-text-color` (an upstream type gap).
|
|
119
124
|
*/
|
|
120
125
|
export function tabsVars(
|
|
121
126
|
theme: MantineTheme,
|
|
@@ -125,12 +130,76 @@ export function tabsVars(
|
|
|
125
130
|
autoContrast?: boolean | undefined
|
|
126
131
|
},
|
|
127
132
|
): { root: Record<'--tabs-color' | '--tabs-radius' | '--tabs-text-color', string | undefined> } {
|
|
128
|
-
|
|
133
|
+
if (hasExplicitColor(props.color)) {
|
|
134
|
+
return {
|
|
135
|
+
root: {
|
|
136
|
+
'--tabs-text-color': onColorFor(theme, props),
|
|
137
|
+
'--tabs-color': undefined,
|
|
138
|
+
'--tabs-radius': undefined,
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const pills = props.variant === 'pills'
|
|
129
143
|
return {
|
|
130
144
|
root: {
|
|
131
|
-
'--tabs-text-color': onColorFor(theme, props),
|
|
132
|
-
'--tabs-color':
|
|
145
|
+
'--tabs-text-color': pills ? INK : onColorFor(theme, props),
|
|
146
|
+
'--tabs-color': pills ? PILL_FILL : INK,
|
|
133
147
|
'--tabs-radius': undefined,
|
|
134
148
|
},
|
|
135
149
|
}
|
|
136
150
|
}
|
|
151
|
+
|
|
152
|
+
/** The dot's colour: a theme colour's fill, an indexed shade's own var (`red.6`), or the caller's literal (hex, var). */
|
|
153
|
+
function dotColor(theme: MantineTheme, color: string): string {
|
|
154
|
+
if (Object.hasOwn(theme.colors, color)) return `var(--mantine-color-${color}-filled)`
|
|
155
|
+
const [name, shade] = color.split('.')
|
|
156
|
+
if (
|
|
157
|
+
name !== undefined &&
|
|
158
|
+
shade !== undefined &&
|
|
159
|
+
/^\d$/.test(shade) &&
|
|
160
|
+
Object.hasOwn(theme.colors, name)
|
|
161
|
+
) {
|
|
162
|
+
return `var(--mantine-color-${name}-${shade})`
|
|
163
|
+
}
|
|
164
|
+
return color
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Badge vars (SPEC § 6.10): the status chip is the neutral surface with an ink word, and a named
|
|
169
|
+
* colour is a leading status dot, not a tinted slab (W36 r3/r6 "tinted status Badges"). Only the
|
|
170
|
+
* `light` variant (the theme default); `filled`, `outline`, `dot` and `default` keep their meaning —
|
|
171
|
+
* a `filled` accent count is the one tinted-chrome case that stays. Any colour the caller gives (theme name, indexed shade, hex, var) becomes the dot; `gray` is the
|
|
172
|
+
* no-signal chip. A `leftSection` glyph replaces the dot.
|
|
173
|
+
*/
|
|
174
|
+
export function badgeVars(
|
|
175
|
+
theme: MantineTheme,
|
|
176
|
+
props: { color?: string | null | undefined; variant?: string | undefined },
|
|
177
|
+
): {
|
|
178
|
+
root: Record<
|
|
179
|
+
'--badge-bg' | '--badge-color' | '--badge-dot' | '--badge-dot-content' | '--badge-dot-cols',
|
|
180
|
+
string | undefined
|
|
181
|
+
>
|
|
182
|
+
} {
|
|
183
|
+
const none = {
|
|
184
|
+
'--badge-bg': undefined,
|
|
185
|
+
'--badge-color': undefined,
|
|
186
|
+
'--badge-dot': undefined,
|
|
187
|
+
'--badge-dot-content': undefined,
|
|
188
|
+
'--badge-dot-cols': undefined,
|
|
189
|
+
}
|
|
190
|
+
if ((props.variant ?? 'light') !== 'light') return { root: none }
|
|
191
|
+
const name = props.color ?? 'gray'
|
|
192
|
+
const dot = name === 'gray' ? undefined : dotColor(theme, name)
|
|
193
|
+
return {
|
|
194
|
+
root: {
|
|
195
|
+
...none,
|
|
196
|
+
'--badge-bg': SUBTLE,
|
|
197
|
+
'--badge-color': INK,
|
|
198
|
+
...(dot !== undefined && {
|
|
199
|
+
'--badge-dot': dot,
|
|
200
|
+
'--badge-dot-content': "''",
|
|
201
|
+
'--badge-dot-cols': 'auto 1fr',
|
|
202
|
+
}),
|
|
203
|
+
},
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -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,30 @@ html .tableRoot tbody tr:last-of-type {
|
|
|
318
323
|
border-bottom: none;
|
|
319
324
|
}
|
|
320
325
|
|
|
326
|
+
/* A status word is the text as written ("Healthy"), not Mantine's UPPERCASE default; a caller who wants
|
|
327
|
+
* a micro-caption passes `tt="uppercase"`, which is inline and wins. `html` outranks Mantine's class. */
|
|
328
|
+
html .badgeRoot {
|
|
329
|
+
text-transform: none;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/*
|
|
333
|
+
* Badge status dot: a coloured `light` Badge is the neutral surface + ink word with a leading dot in the
|
|
334
|
+
* status colour (`badgeVars` writes the `--badge-dot*` vars; nothing here without them). The dot is a
|
|
335
|
+
* grid item, so the root takes two columns while it is shown. A section (left or right) replaces it.
|
|
336
|
+
*/
|
|
337
|
+
.badgeRoot[data-variant='light']:not([data-with-left-section], [data-with-right-section]) {
|
|
338
|
+
grid-template-columns: var(--badge-dot-cols, none);
|
|
339
|
+
column-gap: calc(0.25rem * var(--mantine-scale));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.badgeRoot[data-variant='light']:not([data-with-left-section], [data-with-right-section])::before {
|
|
343
|
+
content: var(--badge-dot-content, none);
|
|
344
|
+
width: calc(0.375rem * var(--mantine-scale));
|
|
345
|
+
height: calc(0.375rem * var(--mantine-scale));
|
|
346
|
+
border-radius: 50%;
|
|
347
|
+
background: var(--badge-dot);
|
|
348
|
+
}
|
|
349
|
+
|
|
321
350
|
/*
|
|
322
351
|
* Badge leading glyph (`leftSection`): the state encoded by shape. 12px on a 20px chip, 4px gap
|
|
323
352
|
* (Mantine's own section margin is spacing.xs / 2 = 4), centred on the label.
|
|
@@ -336,3 +365,11 @@ html .tableRoot tbody tr:last-of-type {
|
|
|
336
365
|
.badgeSection img {
|
|
337
366
|
object-fit: contain;
|
|
338
367
|
}
|
|
368
|
+
|
|
369
|
+
/*
|
|
370
|
+
* Alert: an inline Code inside it sits one nested step (3px) under the Alert's own radius
|
|
371
|
+
* (craft-1/nested-radius-step). The Code theme reads `--basalt-code-radius`; the Alert supplies it.
|
|
372
|
+
*/
|
|
373
|
+
.alertRoot {
|
|
374
|
+
--basalt-code-radius: max(0px, calc(var(--alert-radius, var(--vx-radius-ctrl)) - 3px));
|
|
375
|
+
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
declare const classes: {
|
|
6
6
|
readonly inputWrapper: string
|
|
7
7
|
readonly input: string
|
|
8
|
+
readonly alertRoot: string
|
|
8
9
|
readonly buttonRoot: string
|
|
9
10
|
readonly actionIconRoot: string
|
|
10
11
|
readonly checkboxCardRoot: string
|
|
@@ -13,6 +14,7 @@ declare const classes: {
|
|
|
13
14
|
readonly accordionItem: string
|
|
14
15
|
readonly tabsRoot: string
|
|
15
16
|
readonly tableRoot: string
|
|
17
|
+
readonly badgeRoot: string
|
|
16
18
|
readonly badgeSection: string
|
|
17
19
|
}
|
|
18
20
|
export default classes
|
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,16 +505,19 @@ 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
|
|
515
517
|
// already on-system (defaultRadius 'md' control tier + the variant color resolver), so only
|
|
516
518
|
// the title font is overridden.
|
|
517
519
|
Alert: ext<typeof Alert>({
|
|
520
|
+
classNames: { root: controlsClasses.alertRoot },
|
|
518
521
|
styles: {
|
|
519
522
|
title: {
|
|
520
523
|
fontFamily: 'var(--basalt-font-head)',
|
|
@@ -773,11 +776,11 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
773
776
|
// label that no longer fits its equal share truncates instead of forcing the column wide.
|
|
774
777
|
//
|
|
775
778
|
// The track's padding is `SPACE_FIXED.segmentedTrackInset`, a plain literal — NOT a
|
|
776
|
-
// `--vx-space-*` var — because it is density-EXEMPT
|
|
777
|
-
//
|
|
778
|
-
//
|
|
779
|
-
//
|
|
780
|
-
//
|
|
779
|
+
// `--vx-space-*` var — because it is density-EXEMPT (see that constant's doc in
|
|
780
|
+
// `tokens/palette.ts`). The INDICATOR radius is the track's per-instance radius (`--sc-radius`,
|
|
781
|
+
// which Mantine sets on the root from the `radius` prop) minus 3 px: exact concentricity would
|
|
782
|
+
// be track − inset (2 px), but `craft-1/nested-radius-step` wants nested surfaces ≥ 3 px apart
|
|
783
|
+
// and that lint step wins. A custom `radius` therefore nests too.
|
|
781
784
|
SegmentedControl: ext<typeof SegmentedControl>({
|
|
782
785
|
defaultProps: { radius: radius.ctrl },
|
|
783
786
|
classNames: {
|
|
@@ -816,7 +819,8 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
816
819
|
// ink-12% fill sat one shade from the track and read as a hover state.
|
|
817
820
|
boxShadow: 'var(--vx-shadow-raised)',
|
|
818
821
|
outline: '1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)',
|
|
819
|
-
|
|
822
|
+
// Track radius − 3 px: craft-1/nested-radius-step beats exact concentricity.
|
|
823
|
+
borderRadius: 'max(0px, calc(var(--sc-radius, var(--vx-radius-ctrl)) - 3px))',
|
|
820
824
|
},
|
|
821
825
|
// Conditionally spread the WHOLE key (never a present `label: undefined`) — the package
|
|
822
826
|
// builds under `exactOptionalPropertyTypes`, which treats a key present-but-`undefined` as
|
|
@@ -1038,7 +1042,8 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
1038
1042
|
styles: {
|
|
1039
1043
|
root: {
|
|
1040
1044
|
backgroundColor: 'color-mix(in srgb, var(--vx-ink) 7%, transparent)',
|
|
1041
|
-
|
|
1045
|
+
// An Alert re-points the var (`controls.module.css`) so a nested Code steps down.
|
|
1046
|
+
borderRadius: 'var(--basalt-code-radius, var(--vx-radius-tight))',
|
|
1042
1047
|
},
|
|
1043
1048
|
},
|
|
1044
1049
|
}),
|
|
@@ -1081,8 +1086,8 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
1081
1086
|
// The tab-list bottom rule (and the inactive-tab hover underline) is a layout separator, not
|
|
1082
1087
|
// control chrome — it reads the divider token instead of the heavy gray-3/dark-4 line
|
|
1083
1088
|
// (controls.module.css; custom properties are stripped from `styles` objects). The active tab
|
|
1084
|
-
// underline
|
|
1085
|
-
// `color=` opts back in.
|
|
1089
|
+
// underline, outline border and pill fill take ink, not the accent (SPEC § 6.12; DESIGN-CORE
|
|
1090
|
+
// § Accent discipline); `color=` opts back in.
|
|
1086
1091
|
Tabs: ext<typeof Tabs>({
|
|
1087
1092
|
classNames: { root: controlsClasses.tabsRoot },
|
|
1088
1093
|
vars: tabsVars,
|
|
@@ -1257,28 +1262,13 @@ function buttonPaddingX(size: unknown): string | undefined {
|
|
|
1257
1262
|
}
|
|
1258
1263
|
|
|
1259
1264
|
/**
|
|
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.
|
|
1265
|
+
* The inset on a Button's section side EQUALS its text side, so an icon Button is balanced (Mantine
|
|
1266
|
+
* derives it as `--button-padding-x / 1.5`, which also left the icon side one step tighter than the
|
|
1267
|
+
* text side: 8/12, 12/16, 12/20). `ctl` has its own `--button-padding-x-ctl`; undefined sizes keep
|
|
1268
|
+
* Mantine's value.
|
|
1265
1269
|
*/
|
|
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
1270
|
function buttonSectionX(size: unknown): string | undefined {
|
|
1280
|
-
|
|
1281
|
-
return step === undefined ? undefined : `calc(${step} * var(--mantine-scale))`
|
|
1271
|
+
return size === 'ctl' ? 'var(--button-padding-x-ctl)' : buttonPaddingX(size)
|
|
1282
1272
|
}
|
|
1283
1273
|
|
|
1284
1274
|
/**
|
|
@@ -23,7 +23,11 @@ export function StatusVerdict({ color, word, phrase, className, style }: StatusV
|
|
|
23
23
|
return (
|
|
24
24
|
<span className={cx(classes.verdict, className)} {...(style !== undefined && { style })}>
|
|
25
25
|
<StatusDot color={color} />
|
|
26
|
-
<span
|
|
26
|
+
<span
|
|
27
|
+
data-verdict-word=""
|
|
28
|
+
title={phrase ?? word}
|
|
29
|
+
{...(phrase !== undefined && { 'aria-hidden': true })}
|
|
30
|
+
>
|
|
27
31
|
{word}
|
|
28
32
|
</span>
|
|
29
33
|
{phrase !== undefined && <span className={classes.hidden}>{phrase}</span>}
|
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
|
@@ -240,7 +240,9 @@ export const RADIUS_STEP = {
|
|
|
240
240
|
floating: DEFAULT_RADIUS_VALUES.floating, // 11
|
|
241
241
|
/** SegmentedControl's active indicator, Kbd, Code — one step below the control radius. */
|
|
242
242
|
tight: DEFAULT_RADIUS_VALUES.tight, // 5
|
|
243
|
-
/** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius.
|
|
243
|
+
/** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius. (No
|
|
244
|
+
* longer the SegmentedControl indicator: that is the track radius − 3 px, the nested-radius lint
|
|
245
|
+
* step, set in `theme/index.ts`.) */
|
|
244
246
|
fine: DEFAULT_RADIUS_VALUES.fine, // 4
|
|
245
247
|
/** The Mantine `radius` scale's `xs` step — independent of both anchors. */
|
|
246
248
|
scaleXs: 2,
|
|
@@ -840,15 +842,10 @@ export const SPACE_FIXED = {
|
|
|
840
842
|
readingProgressHeight: 2,
|
|
841
843
|
/** SegmentedControl track's optical inset (`styles.root` padding) — moved OUT of `SPACE_STEP` and
|
|
842
844
|
* exempted from the density knob because it is load-bearing for the nested-corner law
|
|
843
|
-
* (docs/DESIGN-SPEC.md §4)
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
*
|
|
847
|
-
* clamps to 0 against `ctrl` 1) — a density-tracking inset would break concentricity in both directions (verified: this
|
|
848
|
-
* inset's own value, HAD it stayed density-tracking, resolves via `scaleSpace(2, level, multiplier)`
|
|
849
|
-
* to 1 at density's floor level -3 and 3 at its ceiling level +3 — the widest swing `deriveSpacing`'s
|
|
850
|
-
* `[-3, 3]` range can produce) for no compensating benefit, since the two radii it sits between
|
|
851
|
-
* never move independently of each other. */
|
|
845
|
+
* (docs/DESIGN-SPEC.md §4). The indicator radius is the track radius − 3 px (the nested-radius
|
|
846
|
+
* lint step wins over exact concentricity, which would be track − inset), so the inset no longer
|
|
847
|
+
* sets a corner; it stays fixed because a density-tracking inset (1 at density -3, 3 at +3 via
|
|
848
|
+
* `scaleSpace(2, level, multiplier)`) would make the track's optical weight swing for no benefit. */
|
|
852
849
|
segmentedTrackInset: 2,
|
|
853
850
|
} as const
|
|
854
851
|
|
|
@@ -1332,6 +1329,10 @@ function buildPaletteDataUncached(config: DeriveConfig) {
|
|
|
1332
1329
|
bg: DERIVED.surface.bg, // page background
|
|
1333
1330
|
panel: DERIVED.surface.panel, // cards, controls
|
|
1334
1331
|
panelHover: DERIVED.surface.panelHover,
|
|
1332
|
+
// Row hover / selected on a panel — the panel one ink step along (`derive.ts`), visible in both
|
|
1333
|
+
// schemes where `panelHover` (lighter than `panel` in light) is not.
|
|
1334
|
+
rowHover: DERIVED.surface.rowHover,
|
|
1335
|
+
rowSelected: DERIVED.surface.rowSelected,
|
|
1335
1336
|
// Elevated surface (chart area, `--mantine-color-default-hover`) — same lift as panel-hover.
|
|
1336
1337
|
elevated: DERIVED.surface.elevated,
|
|
1337
1338
|
border: DERIVED.surface.border, // "line" — strong border (layout/control chrome, NOT the card ring)
|