basalt-ui 2.14.0 → 2.16.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 +69 -0
- package/MIGRATING.md +81 -13
- package/agent/agents/basalt-design-reviewer.md +83 -0
- package/agent/rules/basalt-batteries.md +1 -2
- package/agent/rules/basalt-charts.md +1 -1
- package/agent/rules/basalt-controls.md +3 -3
- package/agent/rules/basalt-mantine.md +2 -3
- package/agent/rules/basalt-state.md +1 -2
- package/agent/rules/basalt-tokens.md +1 -3
- package/agent/skills/basalt-design/SKILL.md +26 -8
- package/agent/templates/AGENTS-block.md.tpl +7 -0
- package/configs/card-inset.test.ts +57 -0
- package/configs/oxlint-basalt.json +1 -1
- package/configs/oxlint-plugin.js +81 -20
- package/configs/oxlint-plugin.test.ts +85 -6
- package/dist/agent/chat/thread-message.js +1 -1
- package/dist/agent/chat/thread-outcome-card.js +1 -1
- package/dist/charts/ChartCard.js +1 -1
- package/dist/charts/chart-card.module.css +2 -2
- package/dist/charts/legend.d.ts +4 -4
- package/dist/cli/board-freshness.d.ts +25 -0
- package/dist/cli/board-freshness.d.ts.map +1 -0
- package/dist/cli/board-freshness.js +88 -0
- package/dist/cli/doctor.d.ts +2 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +3 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +9 -3
- package/dist/cli/index.d.ts +15 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +57 -7
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +6 -1
- package/dist/cli/shot/board.d.ts +5 -0
- package/dist/cli/shot/board.d.ts.map +1 -0
- package/dist/cli/shot/board.js +96 -0
- package/dist/cli/shot/capture.d.ts +59 -0
- package/dist/cli/shot/capture.d.ts.map +1 -0
- package/dist/cli/shot/capture.js +473 -0
- package/dist/cli/shot/index.d.ts +45 -0
- package/dist/cli/shot/index.d.ts.map +1 -0
- package/dist/cli/shot/index.js +289 -0
- package/dist/cli/shot/measure.d.ts +47 -0
- package/dist/cli/shot/measure.d.ts.map +1 -0
- package/dist/cli/shot/measure.js +191 -0
- package/dist/cli/shot/playwright.d.ts +101 -0
- package/dist/cli/shot/playwright.d.ts.map +1 -0
- package/dist/cli/shot/playwright.js +60 -0
- package/dist/cli/shot/serve.d.ts +6 -0
- package/dist/cli/shot/serve.d.ts.map +1 -0
- package/dist/cli/shot/serve.js +33 -0
- package/dist/cli/shot/types.d.ts +98 -0
- package/dist/cli/shot/types.d.ts.map +1 -0
- package/dist/cli/shot/types.js +17 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +2 -1
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +5 -2
- package/dist/dashboard/stat-card.js +12 -12
- package/dist/dashboard/stat-card.module.css +4 -4
- package/dist/dashboard/widget-header.module.css +3 -3
- package/dist/guard/guard-hook.d.ts.map +1 -1
- package/dist/guard/index.d.ts +4 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +18 -4
- package/dist/guard/vx-names.d.ts.map +1 -1
- package/dist/guard/vx-names.js +1 -0
- package/dist/shell/app-mobile-nav.module.css +2 -2
- package/dist/shell/app-sidebar-account.js +1 -1
- package/dist/shell/app-sidebar.js +2 -2
- package/dist/shell/app-sidebar.module.css +8 -8
- package/dist/shell/index.js +5 -1
- package/dist/shell/page-bar.js +1 -1
- package/dist/surfaces.d.ts +2 -0
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +2 -0
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +3 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +31 -21
- package/dist/tokens/core.d.ts +10 -4
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +16 -10
- package/dist/tokens/ctl-vars.d.ts +15 -0
- package/dist/tokens/ctl-vars.d.ts.map +1 -0
- package/dist/tokens/ctl-vars.js +22 -0
- package/dist/tokens/palette.d.ts +37 -29
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +32 -21
- package/dist/tokens/space-scale.d.ts +14 -0
- package/dist/tokens/space-scale.d.ts.map +1 -0
- package/dist/tokens/space-scale.js +10 -0
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/agent/chat/thread-message.tsx +1 -1
- package/src/agent/chat/thread-outcome-card.tsx +2 -2
- package/src/charts/ChartCard.tsx +1 -1
- package/src/charts/chart-card.module.css +2 -2
- package/src/charts/legend.tsx +4 -4
- package/src/cli/board-freshness.ts +132 -0
- package/src/cli/doctor.ts +10 -1
- package/src/cli/help.ts +14 -2
- package/src/cli/index.ts +80 -10
- package/src/cli/init.ts +8 -1
- package/src/cli/shot/board.ts +154 -0
- package/src/cli/shot/capture.ts +650 -0
- package/src/cli/shot/index.ts +362 -0
- package/src/cli/shot/measure.ts +252 -0
- package/src/cli/shot/playwright.ts +152 -0
- package/src/cli/shot/serve.ts +35 -0
- package/src/cli/shot/types.ts +92 -0
- package/src/cli/sync.ts +2 -1
- package/src/dashboard/settings-section.tsx +5 -2
- package/src/dashboard/stat-card.module.css +4 -4
- package/src/dashboard/stat-card.tsx +13 -13
- package/src/dashboard/widget-header.module.css +3 -3
- package/src/guard/guard-hook.ts +3 -1
- package/src/guard/index.ts +27 -13
- package/src/guard/vx-names.ts +1 -0
- package/src/shell/app-mobile-nav.module.css +2 -2
- package/src/shell/app-sidebar-account.tsx +1 -1
- package/src/shell/app-sidebar.module.css +8 -8
- package/src/shell/app-sidebar.tsx +2 -2
- package/src/shell/index.tsx +10 -4
- package/src/shell/page-bar.tsx +1 -1
- package/src/surfaces.ts +5 -0
- package/src/table/data-table.tsx +10 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +57 -45
- package/src/theme/ctl-theme.tsx +1 -1
- package/src/theme/index.ts +43 -23
- package/src/tokens/core.ts +16 -8
- package/src/tokens/ctl-vars.ts +32 -0
- package/src/tokens/palette.ts +40 -29
- package/src/tokens/space-scale.ts +13 -0
package/src/tokens/core.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* Grounded in argo `packages/charts/src/{tokens,palette,theme-vars,utils/color}.ts`.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
import { denseCtlBlock } from './ctl-vars'
|
|
12
13
|
import {
|
|
13
14
|
buildPaletteData,
|
|
14
15
|
RADIUS,
|
|
@@ -94,6 +95,8 @@ export const alpha = (token: string, a: number): string =>
|
|
|
94
95
|
* Type is a token axis like color / spacing / radius / motion: a single edit point, never a
|
|
95
96
|
* hardcoded literal at a call site. Every font-size in the framework resolves to a step here.
|
|
96
97
|
*
|
|
98
|
+
* `TEXT_LINE` (below) pins the two dense rungs to grid-aligned line boxes.
|
|
99
|
+
*
|
|
97
100
|
* Two representations are DERIVED from this one object, so they cannot drift:
|
|
98
101
|
* • `VX.text.*` — plain numbers, for inline `style` objects and visx SVG props (React appends
|
|
99
102
|
* `px`; SVG presentation attributes can't resolve `var()`, so a ref string would break charts).
|
|
@@ -128,17 +131,21 @@ export const alpha = (token: string, a: number): string =>
|
|
|
128
131
|
const TEXT = {
|
|
129
132
|
nano: 10, // engraved/graphic label INSIDE a drawn object (a plate face, a dial, a chip) — never UI copy or prose
|
|
130
133
|
micro: 11, // mono uppercase micro-label (table th, Menu.Label, sidebar/section headers, axis ticks)
|
|
131
|
-
xs: 12
|
|
132
|
-
sm: 13
|
|
133
|
-
md: 15, // BODY —
|
|
134
|
+
xs: 12, // delta badges, tooltip meta, dense chrome, StatCard labels — 16px line (`TEXT_LINE.xs`)
|
|
135
|
+
sm: 13, // DENSE ROWS — table cells, nav rows, list/event rows, menu items; numerals, tooltip, legend — 20px line (`TEXT_LINE.sm`)
|
|
136
|
+
md: 15, // BODY — prose and form labels; chart/card titles
|
|
134
137
|
lg: 16, // breadcrumb current — ALSO the iOS input floor (do not lower)
|
|
135
138
|
xl: 18, // section titles
|
|
136
139
|
h2: 21, // article-density Prose h2 (docs/CONTENT-SPEC.md §5)
|
|
137
|
-
kpi:
|
|
140
|
+
kpi: 22, // the StatCard hero numeral (mono 500; 31 → 24 → 22, tighter/less shouty)
|
|
138
141
|
h1: 26, // article-density Prose h1 (docs/CONTENT-SPEC.md §5)
|
|
139
142
|
display: 30, // a numeral read at arm's length (a keypad readout, a timer, a kiosk figure) — not a heading
|
|
140
143
|
} as const
|
|
141
144
|
|
|
145
|
+
/** Grid-aligned line boxes (px) for the two dense rungs — `theme/index.ts` re-expresses them as the
|
|
146
|
+
* Mantine `lineHeights` `xs`/`sm`, so a `<Text size="sm">` row is a 20px box and a meta line 16px. */
|
|
147
|
+
export const TEXT_LINE = { xs: 16, sm: 20 } as const
|
|
148
|
+
|
|
142
149
|
export const VX = {
|
|
143
150
|
// Non-color sizing constants
|
|
144
151
|
// Stroke WEIGHTS, not spacing — deliberately fixed, never density-tracking (see
|
|
@@ -489,6 +496,7 @@ function spaceDecls(space: SpaceValues): string[] {
|
|
|
489
496
|
decl('space-control-height-tag', pxRem(space.anchors.controlHeightTag)),
|
|
490
497
|
decl('space-control-height-widget', pxRem(space.anchors.controlHeightWidget)),
|
|
491
498
|
decl('space-control-height-ctl', pxRem(space.anchors.controlHeightCtl)),
|
|
499
|
+
decl('space-control-height-dense', pxRem(space.anchors.controlHeightDense)),
|
|
492
500
|
decl('space-stack-xs', `${space.anchors.stackXs}px`),
|
|
493
501
|
decl('space-stack-sm', `${space.anchors.stackSm}px`),
|
|
494
502
|
decl('space-stack-md', `${space.anchors.stackMd}px`),
|
|
@@ -911,7 +919,7 @@ const coarseHitBlock = `@media (pointer: coarse) {\n :root {\n --vx-hit: ${H
|
|
|
911
919
|
* (`appShellInsetMobile`), and the card ladder INSIDE that gutter never moved — card insets stayed
|
|
912
920
|
* `xs`/`sm` and a `Section`'s gaps stayed `stackMd` at every width — so a 390px phone still read
|
|
913
921
|
* "content spacing too big" after the gutter fix. Two rungs close it: the card's horizontal inset
|
|
914
|
-
* steps `
|
|
922
|
+
* steps `md` -> `sm`, and the Section's gap steps `stackMd` -> `stackSm`.
|
|
915
923
|
*
|
|
916
924
|
* Why it lives HERE and not in the three CSS files that consume it: two of those three sites are
|
|
917
925
|
* INLINE styles in TSX (`dashboard/stat-card.tsx`, `charts/primitives/ChartCard.tsx`), and an
|
|
@@ -932,7 +940,7 @@ const coarseHitBlock = `@media (pointer: coarse) {\n :root {\n --vx-hit: ${H
|
|
|
932
940
|
*/
|
|
933
941
|
function spaceMobileDecls(space: SpaceValues): string[] {
|
|
934
942
|
return [
|
|
935
|
-
decl('space-card-inset-x', `${space.scale.
|
|
943
|
+
decl('space-card-inset-x', `${space.scale.sm}px`),
|
|
936
944
|
decl('space-section-gap', `${space.anchors.stackSm}px`),
|
|
937
945
|
]
|
|
938
946
|
}
|
|
@@ -997,8 +1005,8 @@ export function buildPaletteCss(
|
|
|
997
1005
|
// consumer never receives the base pair the block exists to override.
|
|
998
1006
|
const rootBlock =
|
|
999
1007
|
only === 'core'
|
|
1000
|
-
? `:root {\n${derived}\n}\n${coarseHitBlock}`
|
|
1001
|
-
: `:root {\n${derived}\n}\n${mobileLadderBlock(DEFAULT_SPACE_VALUES)}\n${coarseHitBlock}`
|
|
1008
|
+
? `:root {\n${derived}\n}\n${coarseHitBlock}\n${denseCtlBlock()}`
|
|
1009
|
+
: `:root {\n${derived}\n}\n${mobileLadderBlock(DEFAULT_SPACE_VALUES)}\n${coarseHitBlock}\n${denseCtlBlock()}`
|
|
1002
1010
|
|
|
1003
1011
|
// The legacy shape — kept verbatim, and only reachable when the caller asked for nothing.
|
|
1004
1012
|
if (opts.scheme === undefined && opts.defaultScheme === undefined && !opts.mediaFallback) {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Mantine size vars that carry the `ctl` tier's HEIGHT — one list, read by `ctlSizeVars`
|
|
3
|
+
* (`theme/index.ts`, which sets each to the `ctl` height) and by {@link denseCtlBlock} (which
|
|
4
|
+
* restates each at the dense height for `[data-basalt-dense]`). Mantine substitutes these where they
|
|
5
|
+
* are declared (`:root`), so the dense tier cannot re-point the token alone.
|
|
6
|
+
*/
|
|
7
|
+
export const CTL_HEIGHT_VARS = [
|
|
8
|
+
'--button-height-ctl',
|
|
9
|
+
'--input-height-ctl',
|
|
10
|
+
'--ai-size-ctl',
|
|
11
|
+
'--badge-height-ctl',
|
|
12
|
+
] as const
|
|
13
|
+
|
|
14
|
+
export type CtlHeightVar = (typeof CTL_HEIGHT_VARS)[number]
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The dense-tier rule (SPEC D6), emitted beside `coarseHitBlock` in the palette CSS. A scope that
|
|
18
|
+
* carries `data-basalt-dense` re-points the `ctl` height at `--vx-space-control-height-dense` at
|
|
19
|
+
* FINE pointers only; a coarse pointer keeps the `ctl` height and the 44px hit overlay.
|
|
20
|
+
*/
|
|
21
|
+
export function denseCtlBlock(): string {
|
|
22
|
+
const height = 'calc(var(--vx-space-control-height-dense) * var(--mantine-scale))'
|
|
23
|
+
const decls = CTL_HEIGHT_VARS.map((name) => ` ${name}: ${height};`).join('\n')
|
|
24
|
+
return [
|
|
25
|
+
'@media (pointer: fine) {',
|
|
26
|
+
' [data-basalt-dense] {',
|
|
27
|
+
' --vx-space-control-height-ctl: var(--vx-space-control-height-dense);',
|
|
28
|
+
decls,
|
|
29
|
+
' }',
|
|
30
|
+
'}',
|
|
31
|
+
].join('\n')
|
|
32
|
+
}
|
package/src/tokens/palette.ts
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* `STATUS.excellent`/`STATUS.neutral`) stays hand-authored, unchanged.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
+
import { SPACE_SCALE_LEVEL0 } from './space-scale'
|
|
32
33
|
import { DEFAULT_DERIVE_CONFIG, deriveTokens, isDefaultDeriveConfig } from './derive'
|
|
33
34
|
import type { DeriveConfig } from './derive'
|
|
34
35
|
import type { ColorPair } from './core'
|
|
@@ -172,10 +173,10 @@ export const RADIUS_LEVEL_RANGE = { min: -5, max: 5 } as const
|
|
|
172
173
|
/**
|
|
173
174
|
* Derive the two radius anchors (`card`/`ctrl`) and their dependent offsets from a single integer
|
|
174
175
|
* `level` (`docs/DESIGN-SPEC.md` §4) — the radius analog of `deriveTokens`'s color knobs. `level: 0`
|
|
175
|
-
* reproduces the shipped identity exactly (`card:
|
|
176
|
+
* reproduces the shipped identity exactly (`card: 10, ctrl: 6, floating: 11, tight: 5, fine: 4`,
|
|
176
177
|
* locked by `theme/radius.test.ts`).
|
|
177
178
|
*
|
|
178
|
-
* The law: `card =
|
|
179
|
+
* The law: `card = 10 + level`, `ctrl = 6 + level`, both clamped to `≥ 0`; every offset then follows
|
|
179
180
|
* its anchor — `floating = card + 1`, `tight = ctrl - 1`, `fine = ctrl - 2` — each ALSO clamped to
|
|
180
181
|
* `≥ 0` (so an aggressive negative level flattens the smaller tiers to square before the larger
|
|
181
182
|
* ones). The three independent Mantine-scale stops (`RADIUS_STEP.scaleXs/scaleLg/scaleXl`) are not
|
|
@@ -194,7 +195,7 @@ export function deriveRadius(level: number): RadiusValues {
|
|
|
194
195
|
`deriveRadius: level must be an integer in [${RADIUS_LEVEL_RANGE.min}, ${RADIUS_LEVEL_RANGE.max}], got ${level}`,
|
|
195
196
|
)
|
|
196
197
|
}
|
|
197
|
-
const card = clampRadius(
|
|
198
|
+
const card = clampRadius(10 + level)
|
|
198
199
|
const ctrl = clampRadius(6 + level)
|
|
199
200
|
return {
|
|
200
201
|
card,
|
|
@@ -236,7 +237,7 @@ export const RADIUS = {
|
|
|
236
237
|
export const RADIUS_STEP = {
|
|
237
238
|
/** Tooltip / Popover / Modal / Notification (`docs/DESIGN-SPEC.md` §5 floating tier) — one step
|
|
238
239
|
* above the card radius. */
|
|
239
|
-
floating: DEFAULT_RADIUS_VALUES.floating, //
|
|
240
|
+
floating: DEFAULT_RADIUS_VALUES.floating, // 11
|
|
240
241
|
/** SegmentedControl's active indicator, Kbd, Code — one step below the control radius. */
|
|
241
242
|
tight: DEFAULT_RADIUS_VALUES.tight, // 5
|
|
242
243
|
/** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius. */
|
|
@@ -317,10 +318,16 @@ const SPACE_ANCHORS_BASE = {
|
|
|
317
318
|
* 32, up from 30. At 30 this tier was the ONLY chrome number in the shell that did not agree with
|
|
318
319
|
* its neighbours: the sidebar search trigger is 32 (`sidebarSearchTriggerHeight`), a sidebar block
|
|
319
320
|
* row is 32 (`sidebarBlockRowHeight`), and a NavLink row resolves to ~32 (`2 * rowInsetY +
|
|
320
|
-
* rowLineHeight * text.
|
|
321
|
+
* rowLineHeight * text.sm`, 12 + 1.54 * 13 = 32.02) — so a `size="ctl"` button sitting beside any of them read 2px short
|
|
321
322
|
* and the whole band looked unresolved. 32 lands the entire chrome tier on ONE number, which is
|
|
322
323
|
* also the smallest square that still holds a 16px icon with a 8px surround. */
|
|
323
324
|
controlHeightCtl: 32,
|
|
325
|
+
/** The DENSE control tier (`docs/waves/design-parity/SPEC.md` § 5, D6) — INTERNAL, no public export.
|
|
326
|
+
* `BasaltDataTable`'s toolbar and `FilterSet` rows re-point the `ctl` tier's size vars at this
|
|
327
|
+
* (`styles.css`, `[data-basalt-dense]`) at FINE pointers only, so a search, its filter pills and the
|
|
328
|
+
* actions share one row at 1440. A coarse pointer keeps `ctl` and the 44px hit overlay. Floored at
|
|
329
|
+
* 24px in {@link deriveSpacing} (WCAG 2.5.8). */
|
|
330
|
+
controlHeightDense: 28,
|
|
324
331
|
} as const
|
|
325
332
|
|
|
326
333
|
/**
|
|
@@ -338,13 +345,7 @@ const SPACE_ANCHORS_BASE = {
|
|
|
338
345
|
* control tier IS the `md` stop, hence `defaultRadius: 'md'` — no such relation exists here). Base
|
|
339
346
|
* table for {@link deriveSpacing}.
|
|
340
347
|
*/
|
|
341
|
-
const SPACE_SCALE_BASE =
|
|
342
|
-
xs: 11,
|
|
343
|
-
sm: 13,
|
|
344
|
-
md: 18,
|
|
345
|
-
lg: 20,
|
|
346
|
-
xl: 26,
|
|
347
|
-
} as const
|
|
348
|
+
const SPACE_SCALE_BASE = SPACE_SCALE_LEVEL0
|
|
348
349
|
|
|
349
350
|
/**
|
|
350
351
|
* Density-tracking, genuine one-offs — named insets that fit neither the anchor vertical rhythm/
|
|
@@ -659,6 +660,11 @@ const SPACE_STEP_BASE = {
|
|
|
659
660
|
* (`shell/app-brand.module.css`), so the page gutter is free to be a gutter. The header's
|
|
660
661
|
* breadcrumb, the page-bar band and Main all land on this one number. */
|
|
661
662
|
appShellInset: 16,
|
|
663
|
+
/** The page gutter at the EXPANDED size class only — a TRIAL (`docs/waves/design-parity/SPEC.md`
|
|
664
|
+
* D7): the reference measures 24 at 1440, and 16 was a deliberate earlier choice down from 20, so
|
|
665
|
+
* the wider gutter applies where the evidence is and is reverted by setting this to
|
|
666
|
+
* `appShellInset` (one line). Medium keeps `appShellInset`, compact keeps `appShellInsetMobile`. */
|
|
667
|
+
appShellInsetExpanded: 24,
|
|
662
668
|
/** The page gutter BELOW `sm` — the phone half of `appShellInset` above. A separate entry rather
|
|
663
669
|
* than one responsive value for the same reason `appShellNavbarWidth` is one: there is no sidebar
|
|
664
670
|
* seam to align to on a phone, so the number is answering a different question (how much of a
|
|
@@ -762,7 +768,7 @@ const SPACE_STEP_BASE = {
|
|
|
762
768
|
// it never moved, so a 390px phone still read "content spacing too big" after the gutter fix.
|
|
763
769
|
//
|
|
764
770
|
// Each value is deliberately the rung of an existing ladder rather than a fresh literal: the card
|
|
765
|
-
// inset IS `SPACE_SCALE.
|
|
771
|
+
// inset IS `SPACE_SCALE.sm`/`.md` (12/16; the compact horizontal step is `.sm`) (which is what `StatCard`/`ChartCard` spelled as
|
|
766
772
|
// `--mantine-spacing-xs`/`-sm` before they were named here) and the Section gap IS
|
|
767
773
|
// `SPACE.stackMd`. Naming them buys the ROLE, not a new number — a role the `< sm` override can
|
|
768
774
|
// then re-point without touching the scale every other consumer of `xs`/`sm` reads.
|
|
@@ -776,10 +782,10 @@ const SPACE_STEP_BASE = {
|
|
|
776
782
|
* must render identically (a StatCard and a ChartCard sit in the same grid row). Does NOT step
|
|
777
783
|
* below `sm`: the phone is short of WIDTH, and shaving the vertical inset of a card that already
|
|
778
784
|
* hugs its content buys a few pixels at the cost of the card's own breathing room. */
|
|
779
|
-
cardInsetY:
|
|
785
|
+
cardInsetY: 12,
|
|
780
786
|
/** Card inset, HORIZONTAL — same two files, same must-match reason. This IS the half that steps
|
|
781
|
-
*
|
|
782
|
-
cardInsetX:
|
|
787
|
+
* in a compact container (to `SPACE_SCALE.sm`, 12), because horizontal is where a 390px viewport is short. */
|
|
788
|
+
cardInsetX: 16,
|
|
783
789
|
/** `dashboard/section.module.css`'s header→body and body-child gap — a page-level GROUPING
|
|
784
790
|
* rhythm, which is why it reads the stack scale rather than the card-inset one. Steps to
|
|
785
791
|
* `SPACE.stackSm` below `sm`. Distinct from `sidebarSectionGap` above, which is the gap between
|
|
@@ -834,10 +840,11 @@ export const SPACE_FIXED = {
|
|
|
834
840
|
readingProgressHeight: 2,
|
|
835
841
|
/** SegmentedControl track's optical inset (`styles.root` padding) — moved OUT of `SPACE_STEP` and
|
|
836
842
|
* exempted from the density knob because it is load-bearing for the nested-corner law
|
|
837
|
-
* (docs/DESIGN-SPEC.md §4): `RADIUS.
|
|
838
|
-
* 2
|
|
839
|
-
*
|
|
840
|
-
*
|
|
843
|
+
* (docs/DESIGN-SPEC.md §4): `RADIUS.ctrl === RADIUS_STEP.fine + segmentedTrackInset` (`6 = 4 +
|
|
844
|
+
* 2`; the track takes the control radius, the indicator the `fine` tier). `RADIUS.ctrl`/
|
|
845
|
+
* `RADIUS_STEP.fine` both shift together under the RADIUS knob (`ctrl = 6 + level`, `fine = ctrl
|
|
846
|
+
* - 2`), so their difference is exactly 2 regardless of that knob (down to level -4; at -5 `fine`
|
|
847
|
+
* clamps to 0 against `ctrl` 1) — a density-tracking inset would break concentricity in both directions (verified: this
|
|
841
848
|
* inset's own value, HAD it stayed density-tracking, resolves via `scaleSpace(2, level, multiplier)`
|
|
842
849
|
* to 1 at density's floor level -3 and 3 at its ceiling level +3 — the widest swing `deriveSpacing`'s
|
|
843
850
|
* `[-3, 3]` range can produce) for no compensating benefit, since the two radii it sits between
|
|
@@ -984,15 +991,15 @@ const ROW_LINE_HEIGHT_STEP = 1 / 30
|
|
|
984
991
|
* still overrides `--vx-space-sticky-header-clearance`. Documented on the `./content` surface too
|
|
985
992
|
* (`docs/CONTENT-SPEC.md` §5), not only here.
|
|
986
993
|
*
|
|
987
|
-
* `rowLineHeight` is the ONE exception to the multiplier entirely: `1.
|
|
994
|
+
* `rowLineHeight` is the ONE exception to the multiplier entirely: `1.54 + ROW_LINE_HEIGHT_STEP *
|
|
988
995
|
* level`, ADDITIVE, its own gentler, INDEPENDENT coefficient (see {@link ROW_LINE_HEIGHT_STEP}'s own
|
|
989
996
|
* doc for why it must stay independent of `multiplier`). It carries the NavLink row's
|
|
990
|
-
* `lineHeight: '1.
|
|
991
|
-
* but the multiplier law would overshoot it — `1.
|
|
997
|
+
* `lineHeight: '1.54'` (`theme/index.ts`, load-bearing for row height) along with the row's padding,
|
|
998
|
+
* but the multiplier law would overshoot it — `1.54 * 1.3` at level +3 is already a much larger
|
|
992
999
|
* relative move than the padding it accompanies, well past the readable line-height range. The
|
|
993
|
-
* additive step instead lands `1.
|
|
994
|
-
* to 2 decimals (`Math.round(x * 100) / 100`) to avoid floating-point noise (`1.
|
|
995
|
-
* ROW_LINE_HEIGHT_STEP * 3` is not exactly `1.
|
|
1000
|
+
* additive step instead lands `1.44`..`1.64` across the full range, a proportionate nudge. Rounded
|
|
1001
|
+
* to 2 decimals (`Math.round(x * 100) / 100`) to avoid floating-point noise (`1.54 +
|
|
1002
|
+
* ROW_LINE_HEIGHT_STEP * 3` is not exactly `1.64` in raw IEEE-754 arithmetic).
|
|
996
1003
|
*
|
|
997
1004
|
* `SPACE_FIXED` is NEVER part of this law — see that constant's own doc for why.
|
|
998
1005
|
*
|
|
@@ -1073,6 +1080,7 @@ export function deriveSpacing(level: number): SpaceValues {
|
|
|
1073
1080
|
anchors.controlHeightTag = Math.max(18, anchors.controlHeightTag)
|
|
1074
1081
|
anchors.controlHeightWidget = Math.max(22, anchors.controlHeightWidget)
|
|
1075
1082
|
anchors.controlHeightCtl = Math.max(28, anchors.controlHeightCtl)
|
|
1083
|
+
anchors.controlHeightDense = Math.max(24, anchors.controlHeightDense)
|
|
1076
1084
|
|
|
1077
1085
|
const mappedStep = mapSpaceGroup(SPACE_STEP_BASE, level, multiplier)
|
|
1078
1086
|
// WCAG 2.5.8 minimum interactive-target size — see this function's doc for why the trigger's
|
|
@@ -1108,7 +1116,7 @@ export function deriveSpacing(level: number): SpaceValues {
|
|
|
1108
1116
|
step,
|
|
1109
1117
|
// Additive, gentler, INDEPENDENT law than the multiplier — see `ROW_LINE_HEIGHT_STEP`'s own doc
|
|
1110
1118
|
// for why it must NOT be computed from `multiplier`.
|
|
1111
|
-
rowLineHeight: Math.round((1.
|
|
1119
|
+
rowLineHeight: Math.round((1.54 + ROW_LINE_HEIGHT_STEP * level) * 100) / 100,
|
|
1112
1120
|
}
|
|
1113
1121
|
}
|
|
1114
1122
|
|
|
@@ -1137,7 +1145,7 @@ export const SPACE_SCALE = DEFAULT_SPACE_VALUES.scale
|
|
|
1137
1145
|
* doc (third bullet) for why. */
|
|
1138
1146
|
export const SPACE_STEP = DEFAULT_SPACE_VALUES.step
|
|
1139
1147
|
|
|
1140
|
-
/** NavLink row line-height at the shipped identity (`1.
|
|
1148
|
+
/** NavLink row line-height at the shipped identity (`1.54`, a 20px line at `sm`) — `deriveSpacing(0)`'s `rowLineHeight`,
|
|
1141
1149
|
* UNCHANGED from the shipped identity (locked by `theme/spacing.test.ts`). */
|
|
1142
1150
|
export const ROW_LINE_HEIGHT = DEFAULT_SPACE_VALUES.rowLineHeight
|
|
1143
1151
|
|
|
@@ -1207,7 +1215,10 @@ function buildPaletteDataUncached(config: DeriveConfig) {
|
|
|
1207
1215
|
const NEUTRAL = {
|
|
1208
1216
|
line: { light: BP.gray[0], dark: BP.gray[4] }, // primary line
|
|
1209
1217
|
line2: { light: BP.gray[1], dark: BP.gray[2] }, // secondary line
|
|
1210
|
-
|
|
1218
|
+
// Axis ticks / small chart labels at 10–11px: the DERIVED `faint` ink (opaque, tone stops in
|
|
1219
|
+
// `derive.ts`'s `INK_TONE`, ≥ 4.5:1 on every text surface), not an ink-at-60% alpha — that
|
|
1220
|
+
// measured 4.06:1 on the light panel (`docs/waves/design-parity/w31/s4-baseline.md`, Craft 5).
|
|
1221
|
+
axis: DERIVED.ink.faint,
|
|
1211
1222
|
axisStroke: { light: inkRgba(inkLight, 0.12), dark: 'rgba(255, 255, 255, 0.12)' },
|
|
1212
1223
|
grid: { light: inkRgba(inkLight, 0.07), dark: 'rgba(255, 255, 255, 0.06)' },
|
|
1213
1224
|
crosshair: { light: inkRgba(inkLight, 0.32), dark: 'rgba(255, 255, 255, 0.42)' },
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Mantine `spacing` size-scale at level 0, in its own dependency-free module so the headless
|
|
3
|
+
* guard core (`guard/index.ts`, which runs on every Write/Edit) can read the SAME constant the token
|
|
4
|
+
* layer derives from without dragging `derive.ts`/`hct.ts`'s colour math in. `tokens/palette.ts`
|
|
5
|
+
* documents the scale's role (`SPACE_SCALE_BASE`); this file only owns the numbers.
|
|
6
|
+
*/
|
|
7
|
+
export const SPACE_SCALE_LEVEL0 = {
|
|
8
|
+
xs: 8,
|
|
9
|
+
sm: 12,
|
|
10
|
+
md: 16,
|
|
11
|
+
lg: 20,
|
|
12
|
+
xl: 24,
|
|
13
|
+
} as const
|