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/shell/index.tsx
CHANGED
|
@@ -390,9 +390,9 @@ function ShellBody({
|
|
|
390
390
|
// `appShellInset` / `appShellInsetMobile` pair (see their entries in `tokens/palette.ts`).
|
|
391
391
|
//
|
|
392
392
|
// On a 390px phone that is 8 a side instead of 13 — 10px more line width, and 10px less vertical
|
|
393
|
-
// chrome, since `padding` is Main's vertical inset too. From `sm` up it is
|
|
394
|
-
//
|
|
395
|
-
//
|
|
393
|
+
// chrome, since `padding` is Main's vertical inset too. From `sm` up it is 16, and 24 from the
|
|
394
|
+
// expanded class (`appShellInsetExpanded`, a trial: SPEC D7). The gutter is not aligned to the
|
|
395
|
+
// sidebar's nav-icon column (x=20); the header's brand zone aligns to that column on its own.
|
|
396
396
|
//
|
|
397
397
|
// VERIFIED against the installed Mantine 9.3 source, because both props take the object by a
|
|
398
398
|
// DIFFERENT road and both had to be checked:
|
|
@@ -406,7 +406,13 @@ function ShellBody({
|
|
|
406
406
|
// `calc(0.5rem * var(--mantine-scale))` — rather than looked up, which is exactly why these are
|
|
407
407
|
// numbers: a spacing KEY resolves to `var(--mantine-spacing-sm)` and hands the gutter back to
|
|
408
408
|
// Mantine's own scale, which is where the 13px came from.
|
|
409
|
-
|
|
409
|
+
//
|
|
410
|
+
// `md` is the expanded class's boundary (`SIZE_CLASS_BREAKPOINTS`): the gutter widens there only.
|
|
411
|
+
const inset = {
|
|
412
|
+
base: step.appShellInsetMobile,
|
|
413
|
+
sm: step.appShellInset,
|
|
414
|
+
md: step.appShellInsetExpanded,
|
|
415
|
+
}
|
|
410
416
|
const aside = useAsideRegion()
|
|
411
417
|
const sizeClass = useSizeClass()
|
|
412
418
|
const [storedCollapsed, setStoredCollapsed, collapseIsSet] = collapseStore(storageKey)()
|
package/src/shell/page-bar.tsx
CHANGED
|
@@ -486,7 +486,7 @@ export function PageBar({
|
|
|
486
486
|
</div>
|
|
487
487
|
)}
|
|
488
488
|
{hasPills && (
|
|
489
|
-
<div className={classes.pills} data-basalt-page-bar-line="pills">
|
|
489
|
+
<div className={classes.pills} data-basalt-page-bar-line="pills" data-basalt-dense>
|
|
490
490
|
{filters !== undefined && (
|
|
491
491
|
<div className={classes.filters}>
|
|
492
492
|
<CtlSlot>{filters}</CtlSlot>
|
package/src/surfaces.ts
CHANGED
|
@@ -655,6 +655,11 @@ export const SKILL_NAMES = [
|
|
|
655
655
|
),
|
|
656
656
|
] as const satisfies readonly SkillName[]
|
|
657
657
|
|
|
658
|
+
// ── PROJECTION 1c — AGENT_NAMES ───────────────────────────────────────────────────────────────────
|
|
659
|
+
|
|
660
|
+
/** The shipped subagents (`agent/agents/<name>.md`), installed at `.claude/agents/`. */
|
|
661
|
+
export const AGENT_NAMES = ['basalt-design-reviewer'] as const
|
|
662
|
+
|
|
658
663
|
// ── Token-layer-boundary-via-plugin membership ────────────────────────────────────────────────────
|
|
659
664
|
|
|
660
665
|
/**
|
package/src/table/data-table.tsx
CHANGED
|
@@ -1008,15 +1008,20 @@ const TABLE_TOOLBAR_STYLE: CSSProperties = { flex: '0 1 auto', minWidth: 0 }
|
|
|
1008
1008
|
* narrow one, for the same one-word query. A stated width also makes the toolbar's own minimum width
|
|
1009
1009
|
* knowable, which is what lets it wrap under the title below `sm` with no media query.
|
|
1010
1010
|
*
|
|
1011
|
-
*
|
|
1012
|
-
* is available and lets it shrink where it is not, floored at `12ch` (a legible
|
|
1013
|
-
* search glyph) and capped at `100%` so it can never be the box that outgrows its
|
|
1014
|
-
* `
|
|
1011
|
+
* The field states a BASIS and a `width`, both `SEARCH_WIDTH`: `flex: 0 1 <SEARCH_WIDTH>px` holds it
|
|
1012
|
+
* at 220px wherever 220 is available and lets it shrink where it is not, floored at `12ch` (a legible
|
|
1013
|
+
* query plus the search glyph) and capped at `100%` so it can never be the box that outgrows its
|
|
1014
|
+
* column. The `width` is the field's intrinsic contribution: the toolbar is sized by its items'
|
|
1015
|
+
* max-content, and an input's own (~196px) came out short of the basis, which wrapped the facet pills
|
|
1016
|
+
* under the search at 1440. It is no floor — `min-width: 12ch` is. A literal `w={220}` in a 302px
|
|
1017
|
+
* column was half of the overflow above.
|
|
1015
1018
|
*/
|
|
1016
1019
|
const SEARCH_WIDTH = 220
|
|
1017
1020
|
/** How long the global search waits after the last keystroke before filtering. */
|
|
1018
1021
|
const SEARCH_DEBOUNCE_MS = 250
|
|
1019
1022
|
const TABLE_SEARCH_STYLE: CSSProperties = {
|
|
1023
|
+
// `width` as well as the basis — see the `SEARCH_WIDTH` JSDoc.
|
|
1024
|
+
width: SEARCH_WIDTH,
|
|
1020
1025
|
flex: `0 1 ${SEARCH_WIDTH}px`,
|
|
1021
1026
|
minWidth: '12ch',
|
|
1022
1027
|
maxWidth: '100%',
|
|
@@ -2022,6 +2027,7 @@ export function BasaltDataTable<T extends RowData>(props: BasaltDataTableProps<T
|
|
|
2022
2027
|
<CtlSlot>
|
|
2023
2028
|
<Group
|
|
2024
2029
|
className={cx(classNames?.toolbar)}
|
|
2030
|
+
data-basalt-dense
|
|
2025
2031
|
gap="xs"
|
|
2026
2032
|
wrap="wrap"
|
|
2027
2033
|
align="center"
|
|
@@ -451,7 +451,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
451
451
|
},
|
|
452
452
|
"item": {
|
|
453
453
|
"borderRadius": "var(--vx-radius-ctrl)",
|
|
454
|
-
"fontSize":
|
|
454
|
+
"fontSize": 13,
|
|
455
455
|
"padding": "var(--vx-space-row-inset-y) var(--vx-space-row-inset-x)",
|
|
456
456
|
},
|
|
457
457
|
"label": {
|
|
@@ -476,7 +476,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
476
476
|
"aria-label": "Close",
|
|
477
477
|
"data-basalt-hit": true,
|
|
478
478
|
},
|
|
479
|
-
"radius":
|
|
479
|
+
"radius": 11,
|
|
480
480
|
},
|
|
481
481
|
"styles": {
|
|
482
482
|
"content": {
|
|
@@ -499,12 +499,12 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
499
499
|
},
|
|
500
500
|
"styles": {
|
|
501
501
|
"label": {
|
|
502
|
-
"fontSize":
|
|
502
|
+
"fontSize": 13,
|
|
503
503
|
"lineHeight": "var(--vx-space-row-line-height)",
|
|
504
504
|
},
|
|
505
505
|
"root": {
|
|
506
506
|
"borderRadius": "var(--vx-radius-ctrl)",
|
|
507
|
-
"fontSize":
|
|
507
|
+
"fontSize": 13,
|
|
508
508
|
"lineHeight": "var(--vx-space-row-line-height)",
|
|
509
509
|
"padding": "var(--vx-space-row-inset-y) var(--vx-space-row-inset-x)",
|
|
510
510
|
},
|
|
@@ -530,7 +530,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
530
530
|
},
|
|
531
531
|
"Notification": {
|
|
532
532
|
"defaultProps": {
|
|
533
|
-
"radius":
|
|
533
|
+
"radius": 11,
|
|
534
534
|
},
|
|
535
535
|
"styles": {
|
|
536
536
|
"root": {
|
|
@@ -602,7 +602,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
602
602
|
},
|
|
603
603
|
"Popover": {
|
|
604
604
|
"defaultProps": {
|
|
605
|
-
"radius":
|
|
605
|
+
"radius": 11,
|
|
606
606
|
},
|
|
607
607
|
"styles": {
|
|
608
608
|
"dropdown": {
|
|
@@ -675,7 +675,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
675
675
|
"label": undefined,
|
|
676
676
|
},
|
|
677
677
|
"defaultProps": {
|
|
678
|
-
"radius":
|
|
678
|
+
"radius": 6,
|
|
679
679
|
},
|
|
680
680
|
"styles": {
|
|
681
681
|
"fn":
|
|
@@ -688,7 +688,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
688
688
|
indicator: {
|
|
689
689
|
boxShadow: "var(--vx-shadow-raised)",
|
|
690
690
|
outline: "1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)",
|
|
691
|
-
borderRadius: "var(--vx-radius-
|
|
691
|
+
borderRadius: "var(--vx-radius-fine)"
|
|
692
692
|
},
|
|
693
693
|
...props.size === "ctl" ? {
|
|
694
694
|
label: {
|
|
@@ -703,11 +703,11 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
703
703
|
"outputs": [
|
|
704
704
|
{
|
|
705
705
|
"probes": 2020,
|
|
706
|
-
"result": "{"root":{"backgroundColor":"color-mix(in srgb, var(--vx-ink) 8%, transparent)","padding":"2px","minWidth":"max-content"},"indicator":{"boxShadow":"var(--vx-shadow-raised)","outline":"1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)","borderRadius":"var(--vx-radius-
|
|
706
|
+
"result": "{"root":{"backgroundColor":"color-mix(in srgb, var(--vx-ink) 8%, transparent)","padding":"2px","minWidth":"max-content"},"indicator":{"boxShadow":"var(--vx-shadow-raised)","outline":"1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)","borderRadius":"var(--vx-radius-fine)"}}",
|
|
707
707
|
},
|
|
708
708
|
{
|
|
709
709
|
"probes": 288,
|
|
710
|
-
"result": "{"root":{"backgroundColor":"color-mix(in srgb, var(--vx-ink) 8%, transparent)","padding":"2px","minWidth":"max-content"},"indicator":{"boxShadow":"var(--vx-shadow-raised)","outline":"1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)","borderRadius":"var(--vx-radius-
|
|
710
|
+
"result": "{"root":{"backgroundColor":"color-mix(in srgb, var(--vx-ink) 8%, transparent)","padding":"2px","minWidth":"max-content"},"indicator":{"boxShadow":"var(--vx-shadow-raised)","outline":"1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)","borderRadius":"var(--vx-radius-fine)"},"label":{"display":"inline-flex","alignItems":"center","minHeight":"calc(var(--vx-space-control-height-ctl) * var(--mantine-scale) - 4px)"}}",
|
|
711
711
|
},
|
|
712
712
|
],
|
|
713
713
|
},
|
|
@@ -760,6 +760,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
760
760
|
},
|
|
761
761
|
"styles": {
|
|
762
762
|
"td": {
|
|
763
|
+
"fontSize": 13,
|
|
763
764
|
"height": 40,
|
|
764
765
|
},
|
|
765
766
|
"th": {
|
|
@@ -825,11 +826,11 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
825
826
|
"styles": {
|
|
826
827
|
"itemContent": {
|
|
827
828
|
"color": "var(--vx-muted)",
|
|
828
|
-
"fontSize":
|
|
829
|
+
"fontSize": 13,
|
|
829
830
|
},
|
|
830
831
|
"itemTitle": {
|
|
831
832
|
"color": "var(--vx-ink)",
|
|
832
|
-
"fontSize":
|
|
833
|
+
"fontSize": 13,
|
|
833
834
|
"fontWeight": 600,
|
|
834
835
|
},
|
|
835
836
|
},
|
|
@@ -861,7 +862,7 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
861
862
|
},
|
|
862
863
|
"Tooltip": {
|
|
863
864
|
"defaultProps": {
|
|
864
|
-
"radius":
|
|
865
|
+
"radius": 11,
|
|
865
866
|
},
|
|
866
867
|
"styles": {
|
|
867
868
|
"arrow": {
|
|
@@ -882,9 +883,9 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
882
883
|
"fontSizes": {
|
|
883
884
|
"lg": "calc(1rem * var(--mantine-scale))",
|
|
884
885
|
"md": "calc(0.9375rem * var(--mantine-scale))",
|
|
885
|
-
"sm": "calc(0.
|
|
886
|
+
"sm": "calc(0.8125rem * var(--mantine-scale))",
|
|
886
887
|
"xl": "calc(1.125rem * var(--mantine-scale))",
|
|
887
|
-
"xs": "calc(0.
|
|
888
|
+
"xs": "calc(0.75rem * var(--mantine-scale))",
|
|
888
889
|
},
|
|
889
890
|
"fontWeights": {
|
|
890
891
|
"bold": "700",
|
|
@@ -896,6 +897,10 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
896
897
|
"fontFamily": "var(--basalt-font-head, var(--basalt-font-sans, ui-sans-serif, sans-serif))",
|
|
897
898
|
"fontWeight": "550",
|
|
898
899
|
},
|
|
900
|
+
"lineHeights": {
|
|
901
|
+
"sm": "1.5385",
|
|
902
|
+
"xs": "1.3333",
|
|
903
|
+
},
|
|
899
904
|
"luminanceThreshold": 0.45,
|
|
900
905
|
"primaryColor": "blue",
|
|
901
906
|
"primaryShade": 6,
|
|
@@ -909,10 +914,10 @@ exports[`createBasaltTheme() shape and resolver output default 1`] = `
|
|
|
909
914
|
"respectReducedMotion": true,
|
|
910
915
|
"spacing": {
|
|
911
916
|
"lg": "1.25rem",
|
|
912
|
-
"md": "
|
|
913
|
-
"sm": "0.
|
|
914
|
-
"xl": "1.
|
|
915
|
-
"xs": "0.
|
|
917
|
+
"md": "1rem",
|
|
918
|
+
"sm": "0.75rem",
|
|
919
|
+
"xl": "1.5rem",
|
|
920
|
+
"xs": "0.5rem",
|
|
916
921
|
},
|
|
917
922
|
"variantColorResolver": {
|
|
918
923
|
"fn":
|
|
@@ -1544,7 +1549,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1544
1549
|
},
|
|
1545
1550
|
"item": {
|
|
1546
1551
|
"borderRadius": "var(--vx-radius-ctrl)",
|
|
1547
|
-
"fontSize":
|
|
1552
|
+
"fontSize": 13,
|
|
1548
1553
|
"padding": "var(--vx-space-row-inset-y) var(--vx-space-row-inset-x)",
|
|
1549
1554
|
},
|
|
1550
1555
|
"label": {
|
|
@@ -1569,7 +1574,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1569
1574
|
"aria-label": "Close",
|
|
1570
1575
|
"data-basalt-hit": true,
|
|
1571
1576
|
},
|
|
1572
|
-
"radius":
|
|
1577
|
+
"radius": 14,
|
|
1573
1578
|
},
|
|
1574
1579
|
"styles": {
|
|
1575
1580
|
"content": {
|
|
@@ -1592,12 +1597,12 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1592
1597
|
},
|
|
1593
1598
|
"styles": {
|
|
1594
1599
|
"label": {
|
|
1595
|
-
"fontSize":
|
|
1600
|
+
"fontSize": 13,
|
|
1596
1601
|
"lineHeight": "var(--vx-space-row-line-height)",
|
|
1597
1602
|
},
|
|
1598
1603
|
"root": {
|
|
1599
1604
|
"borderRadius": "var(--vx-radius-ctrl)",
|
|
1600
|
-
"fontSize":
|
|
1605
|
+
"fontSize": 13,
|
|
1601
1606
|
"lineHeight": "var(--vx-space-row-line-height)",
|
|
1602
1607
|
"padding": "var(--vx-space-row-inset-y) var(--vx-space-row-inset-x)",
|
|
1603
1608
|
},
|
|
@@ -1623,7 +1628,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1623
1628
|
},
|
|
1624
1629
|
"Notification": {
|
|
1625
1630
|
"defaultProps": {
|
|
1626
|
-
"radius":
|
|
1631
|
+
"radius": 14,
|
|
1627
1632
|
},
|
|
1628
1633
|
"styles": {
|
|
1629
1634
|
"root": {
|
|
@@ -1695,7 +1700,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1695
1700
|
},
|
|
1696
1701
|
"Popover": {
|
|
1697
1702
|
"defaultProps": {
|
|
1698
|
-
"radius":
|
|
1703
|
+
"radius": 14,
|
|
1699
1704
|
},
|
|
1700
1705
|
"styles": {
|
|
1701
1706
|
"dropdown": {
|
|
@@ -1768,7 +1773,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1768
1773
|
"label": undefined,
|
|
1769
1774
|
},
|
|
1770
1775
|
"defaultProps": {
|
|
1771
|
-
"radius":
|
|
1776
|
+
"radius": 9,
|
|
1772
1777
|
},
|
|
1773
1778
|
"styles": {
|
|
1774
1779
|
"fn":
|
|
@@ -1781,7 +1786,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1781
1786
|
indicator: {
|
|
1782
1787
|
boxShadow: "var(--vx-shadow-raised)",
|
|
1783
1788
|
outline: "1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)",
|
|
1784
|
-
borderRadius: "var(--vx-radius-
|
|
1789
|
+
borderRadius: "var(--vx-radius-fine)"
|
|
1785
1790
|
},
|
|
1786
1791
|
...props.size === "ctl" ? {
|
|
1787
1792
|
label: {
|
|
@@ -1796,11 +1801,11 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1796
1801
|
"outputs": [
|
|
1797
1802
|
{
|
|
1798
1803
|
"probes": 2020,
|
|
1799
|
-
"result": "{"root":{"backgroundColor":"color-mix(in srgb, var(--vx-ink) 8%, transparent)","padding":"2px","minWidth":"max-content"},"indicator":{"boxShadow":"var(--vx-shadow-raised)","outline":"1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)","borderRadius":"var(--vx-radius-
|
|
1804
|
+
"result": "{"root":{"backgroundColor":"color-mix(in srgb, var(--vx-ink) 8%, transparent)","padding":"2px","minWidth":"max-content"},"indicator":{"boxShadow":"var(--vx-shadow-raised)","outline":"1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)","borderRadius":"var(--vx-radius-fine)"}}",
|
|
1800
1805
|
},
|
|
1801
1806
|
{
|
|
1802
1807
|
"probes": 288,
|
|
1803
|
-
"result": "{"root":{"backgroundColor":"color-mix(in srgb, var(--vx-ink) 8%, transparent)","padding":"2px","minWidth":"max-content"},"indicator":{"boxShadow":"var(--vx-shadow-raised)","outline":"1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)","borderRadius":"var(--vx-radius-
|
|
1808
|
+
"result": "{"root":{"backgroundColor":"color-mix(in srgb, var(--vx-ink) 8%, transparent)","padding":"2px","minWidth":"max-content"},"indicator":{"boxShadow":"var(--vx-shadow-raised)","outline":"1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)","borderRadius":"var(--vx-radius-fine)"},"label":{"display":"inline-flex","alignItems":"center","minHeight":"calc(var(--vx-space-control-height-ctl) * var(--mantine-scale) - 4px)"}}",
|
|
1804
1809
|
},
|
|
1805
1810
|
],
|
|
1806
1811
|
},
|
|
@@ -1853,6 +1858,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1853
1858
|
},
|
|
1854
1859
|
"styles": {
|
|
1855
1860
|
"td": {
|
|
1861
|
+
"fontSize": 13,
|
|
1856
1862
|
"height": 32,
|
|
1857
1863
|
},
|
|
1858
1864
|
"th": {
|
|
@@ -1918,11 +1924,11 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1918
1924
|
"styles": {
|
|
1919
1925
|
"itemContent": {
|
|
1920
1926
|
"color": "var(--vx-muted)",
|
|
1921
|
-
"fontSize":
|
|
1927
|
+
"fontSize": 13,
|
|
1922
1928
|
},
|
|
1923
1929
|
"itemTitle": {
|
|
1924
1930
|
"color": "var(--vx-ink)",
|
|
1925
|
-
"fontSize":
|
|
1931
|
+
"fontSize": 13,
|
|
1926
1932
|
"fontWeight": 600,
|
|
1927
1933
|
},
|
|
1928
1934
|
},
|
|
@@ -1954,7 +1960,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1954
1960
|
},
|
|
1955
1961
|
"Tooltip": {
|
|
1956
1962
|
"defaultProps": {
|
|
1957
|
-
"radius":
|
|
1963
|
+
"radius": 14,
|
|
1958
1964
|
},
|
|
1959
1965
|
"styles": {
|
|
1960
1966
|
"arrow": {
|
|
@@ -1975,9 +1981,9 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1975
1981
|
"fontSizes": {
|
|
1976
1982
|
"lg": "calc(1rem * var(--mantine-scale))",
|
|
1977
1983
|
"md": "calc(0.9375rem * var(--mantine-scale))",
|
|
1978
|
-
"sm": "calc(0.
|
|
1984
|
+
"sm": "calc(0.8125rem * var(--mantine-scale))",
|
|
1979
1985
|
"xl": "calc(1.125rem * var(--mantine-scale))",
|
|
1980
|
-
"xs": "calc(0.
|
|
1986
|
+
"xs": "calc(0.75rem * var(--mantine-scale))",
|
|
1981
1987
|
},
|
|
1982
1988
|
"fontWeights": {
|
|
1983
1989
|
"bold": "700",
|
|
@@ -1989,12 +1995,17 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
1989
1995
|
"fontFamily": "var(--basalt-font-head, var(--basalt-font-sans, ui-sans-serif, sans-serif))",
|
|
1990
1996
|
"fontWeight": "550",
|
|
1991
1997
|
},
|
|
1998
|
+
"lineHeights": {
|
|
1999
|
+
"sm": "1.5385",
|
|
2000
|
+
"xs": "1.3333",
|
|
2001
|
+
},
|
|
1992
2002
|
"luminanceThreshold": 0.45,
|
|
1993
2003
|
"other": {
|
|
1994
2004
|
"basaltDensity": {
|
|
1995
2005
|
"anchors": {
|
|
1996
2006
|
"controlHeight": 34,
|
|
1997
2007
|
"controlHeightCtl": 28,
|
|
2008
|
+
"controlHeightDense": 24,
|
|
1998
2009
|
"controlHeightTag": 18,
|
|
1999
2010
|
"controlHeightWidget": 22,
|
|
2000
2011
|
"inputHeight": 34,
|
|
@@ -2006,13 +2017,13 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
2006
2017
|
"stackXl": 18,
|
|
2007
2018
|
"stackXs": 3,
|
|
2008
2019
|
},
|
|
2009
|
-
"rowLineHeight": 1.
|
|
2020
|
+
"rowLineHeight": 1.47,
|
|
2010
2021
|
"scale": {
|
|
2011
2022
|
"lg": 16,
|
|
2012
|
-
"md":
|
|
2023
|
+
"md": 13,
|
|
2013
2024
|
"sm": 10,
|
|
2014
|
-
"xl":
|
|
2015
|
-
"xs":
|
|
2025
|
+
"xl": 19,
|
|
2026
|
+
"xs": 6,
|
|
2016
2027
|
},
|
|
2017
2028
|
"step": {
|
|
2018
2029
|
"agentCodeInset": 6,
|
|
@@ -2029,6 +2040,7 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
2029
2040
|
"appShellHeaderHeight": 35,
|
|
2030
2041
|
"appShellHeaderLeadMin": 77,
|
|
2031
2042
|
"appShellInset": 13,
|
|
2043
|
+
"appShellInsetExpanded": 19,
|
|
2032
2044
|
"appShellInsetMobile": 6,
|
|
2033
2045
|
"appShellNavbarRailWidth": 38,
|
|
2034
2046
|
"appShellNavbarWidth": 205,
|
|
@@ -2051,8 +2063,8 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
2051
2063
|
"calloutInsetX": 11,
|
|
2052
2064
|
"calloutInsetY": 8,
|
|
2053
2065
|
"calloutTitleRowGap": 6,
|
|
2054
|
-
"cardInsetX":
|
|
2055
|
-
"cardInsetY":
|
|
2066
|
+
"cardInsetX": 13,
|
|
2067
|
+
"cardInsetY": 10,
|
|
2056
2068
|
"chartDotR": 4,
|
|
2057
2069
|
"chartLegendGap": 18,
|
|
2058
2070
|
"chartMarginBottom": 24,
|
|
@@ -2152,10 +2164,10 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
2152
2164
|
"vibrancy": 0,
|
|
2153
2165
|
},
|
|
2154
2166
|
"basaltRadius": {
|
|
2155
|
-
"card":
|
|
2167
|
+
"card": 13,
|
|
2156
2168
|
"ctrl": 9,
|
|
2157
2169
|
"fine": 7,
|
|
2158
|
-
"floating":
|
|
2170
|
+
"floating": 14,
|
|
2159
2171
|
"tight": 8,
|
|
2160
2172
|
},
|
|
2161
2173
|
},
|
|
@@ -2171,10 +2183,10 @@ exports[`createBasaltTheme() shape and resolver output all knobs 1`] = `
|
|
|
2171
2183
|
"respectReducedMotion": true,
|
|
2172
2184
|
"spacing": {
|
|
2173
2185
|
"lg": "1rem",
|
|
2174
|
-
"md": "0.
|
|
2186
|
+
"md": "0.8125rem",
|
|
2175
2187
|
"sm": "0.625rem",
|
|
2176
|
-
"xl": "1.
|
|
2177
|
-
"xs": "0.
|
|
2188
|
+
"xl": "1.1875rem",
|
|
2189
|
+
"xs": "0.375rem",
|
|
2178
2190
|
},
|
|
2179
2191
|
"variantColorResolver": {
|
|
2180
2192
|
"fn":
|
package/src/theme/ctl-theme.tsx
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* applicable" (the spec's own hedge) resolves to "not applicable" here.
|
|
17
17
|
*
|
|
18
18
|
* **Radio / Checkbox / Switch and their `.Group`s, and the one consequence worth stating.** These
|
|
19
|
-
* three default to Mantine's `sm` — a 20px indicator beside the tier's
|
|
19
|
+
* three default to Mantine's `sm` — a 20px indicator beside the tier's 13px option label — which
|
|
20
20
|
* is what every filter popover and the mobile sheet rendered. They are here rather than fixed in a
|
|
21
21
|
* CSS module because their geometry is a Mantine SIZE (five vars for a Switch alone), so the tier
|
|
22
22
|
* reaches them the same way it reaches Button and Input: through `-ctl` vars in
|
package/src/theme/index.ts
CHANGED
|
@@ -81,7 +81,9 @@ import {
|
|
|
81
81
|
import type { PaletteData, RadiusValues, SpaceValues } from '../tokens/palette'
|
|
82
82
|
import { DEFAULT_DERIVE_CONFIG, isDefaultDeriveConfig, resolveDeriveConfig } from '../tokens/derive'
|
|
83
83
|
import type { DeriveConfig } from '../tokens/derive'
|
|
84
|
-
import { pxRem, VX } from '../tokens/core'
|
|
84
|
+
import { pxRem, TEXT_LINE, VX } from '../tokens/core'
|
|
85
|
+
import { CTL_HEIGHT_VARS } from '../tokens/ctl-vars'
|
|
86
|
+
import type { CtlHeightVar } from '../tokens/ctl-vars'
|
|
85
87
|
import { SIZE_CLASS_BREAKPOINTS } from '../tokens/size-classes'
|
|
86
88
|
import type { BasaltFontsConfig } from '../tokens/core'
|
|
87
89
|
import controlsClasses from './controls.module.css'
|
|
@@ -467,7 +469,7 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
467
469
|
// buttons ≥28px sit at ~6px). `radius.md` = 0.375rem = 6px, mirrored by `--vx-radius-ctrl` — every
|
|
468
470
|
// control without its own explicit `radius` prop (Button, ActionIcon, TextInput, NumberInput,
|
|
469
471
|
// PasswordInput, Select, Textarea) falls back to this default. Card/Paper bypass this scale
|
|
470
|
-
// entirely — they resolve straight to `var(--vx-radius-card)` (
|
|
472
|
+
// entirely — they resolve straight to `var(--vx-radius-card)` (10px, see the
|
|
471
473
|
// `components.Card`/`Paper` overrides below).
|
|
472
474
|
defaultRadius: 'md',
|
|
473
475
|
// Named weight ladder (v9 fontWeights).
|
|
@@ -485,6 +487,11 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
485
487
|
lg: rem(VX.text.lg),
|
|
486
488
|
xl: rem(VX.text.xl),
|
|
487
489
|
},
|
|
490
|
+
// Dense rungs get grid-aligned line boxes (13/20, 12/16); md and up keep Mantine's ratios.
|
|
491
|
+
lineHeights: {
|
|
492
|
+
xs: lineRatio(TEXT_LINE.xs, VX.text.xs),
|
|
493
|
+
sm: lineRatio(TEXT_LINE.sm, VX.text.sm),
|
|
494
|
+
},
|
|
488
495
|
// Deliberate, OWNED spacing + radius scales — the single edit point, not inherited Mantine
|
|
489
496
|
// defaults. Denser than Mantine's stock lg/xl for a tighter, data-driven surface. 10 12 16 18 24.
|
|
490
497
|
// Reads `spacing.scale`, NOT `spacing.anchors` — a scale stop tracks density independently of
|
|
@@ -538,7 +545,7 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
538
545
|
// resolves to the SAME three tokens:
|
|
539
546
|
// • background → `--vx-surface-panel` (the panel surface, NOT the page body).
|
|
540
547
|
// • depth → `--vx-shadow-card` (whisper shadow + ring, replaces `withBorder`).
|
|
541
|
-
// • radius → `--vx-radius-card` (
|
|
548
|
+
// • radius → `--vx-radius-card` (10px).
|
|
542
549
|
// This is the single source the user's "strict surface across components" demands; the
|
|
543
550
|
// `raw-surface` guard then stops consumers re-overriding any of it inline.
|
|
544
551
|
Card: ext<typeof Card>({
|
|
@@ -634,19 +641,20 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
634
641
|
// `--nl-padding` var), so the spec padding is forced inline here, where it wins
|
|
635
642
|
// deterministically on every render path.
|
|
636
643
|
padding: 'var(--vx-space-row-inset-y) var(--vx-space-row-inset-x)',
|
|
637
|
-
// The
|
|
638
|
-
// root's inherited line-height (which, left at the default 1.55, alone
|
|
639
|
-
// ~37px). The
|
|
644
|
+
// The dense-row step (`sm`) on the ROOT, not just the label: the body element sizes
|
|
645
|
+
// itself from the root's inherited line-height (which, left at the default 1.55, alone
|
|
646
|
+
// pushed rows to ~37px). The row line-height (1.54, a 20px line at 13px) keeps rows
|
|
647
|
+
// compact as the scale grows. Reads
|
|
640
648
|
// `--vx-space-row-line-height` (density-tracking, ADDITIVE law — see `deriveSpacing`'s
|
|
641
649
|
// doc in `tokens/palette.ts` for why this one differs from the padding's multiplier).
|
|
642
|
-
fontSize: VX.text.
|
|
650
|
+
fontSize: VX.text.sm,
|
|
643
651
|
lineHeight: 'var(--vx-space-row-line-height)',
|
|
644
652
|
// Nav rows sit in the 5-6px radius tier (docs/DESIGN-SPEC.md §4), not square.
|
|
645
653
|
borderRadius: 'var(--vx-radius-ctrl)',
|
|
646
654
|
},
|
|
647
655
|
// Mantine pins the label at `font-size-sm` explicitly, so the root value alone
|
|
648
656
|
// doesn't reach it.
|
|
649
|
-
label: { fontSize: VX.text.
|
|
657
|
+
label: { fontSize: VX.text.sm, lineHeight: 'var(--vx-space-row-line-height)' },
|
|
650
658
|
},
|
|
651
659
|
}),
|
|
652
660
|
// Field idiom (docs/DESIGN-SPEC.md §5): field surface + `shadow-raised` depth + faint placeholder,
|
|
@@ -810,12 +818,12 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
810
818
|
//
|
|
811
819
|
// The track's padding is `SPACE_FIXED.segmentedTrackInset`, a plain literal — NOT a
|
|
812
820
|
// `--vx-space-*` var — because it is density-EXEMPT: it is load-bearing for the nested-corner
|
|
813
|
-
// law (`RADIUS.
|
|
814
|
-
// `tokens/palette.ts`), and `radius.
|
|
821
|
+
// law (`RADIUS.ctrl === RADIUS_STEP.fine + segmentedTrackInset`, see that constant's doc in
|
|
822
|
+
// `tokens/palette.ts`), and `radius.ctrl`/`RADIUS_STEP.fine` below already track the
|
|
815
823
|
// RADIUS knob together, so the inset between them must stay fixed at exactly 2 regardless of
|
|
816
824
|
// density.
|
|
817
825
|
SegmentedControl: ext<typeof SegmentedControl>({
|
|
818
|
-
defaultProps: { radius: radius.
|
|
826
|
+
defaultProps: { radius: radius.ctrl },
|
|
819
827
|
classNames: {
|
|
820
828
|
label: segmentedControlClasses.label,
|
|
821
829
|
control: segmentedControlClasses.control,
|
|
@@ -852,7 +860,7 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
852
860
|
// ink-12% fill sat one shade from the track and read as a hover state.
|
|
853
861
|
boxShadow: 'var(--vx-shadow-raised)',
|
|
854
862
|
outline: '1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)',
|
|
855
|
-
borderRadius: 'var(--vx-radius-
|
|
863
|
+
borderRadius: 'var(--vx-radius-fine)',
|
|
856
864
|
},
|
|
857
865
|
// Conditionally spread the WHOLE key (never a present `label: undefined`) — the package
|
|
858
866
|
// builds under `exactOptionalPropertyTypes`, which treats a key present-but-`undefined` as
|
|
@@ -925,12 +933,12 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
925
933
|
},
|
|
926
934
|
styles: {
|
|
927
935
|
itemTitle: {
|
|
928
|
-
fontSize: VX.text.
|
|
936
|
+
fontSize: VX.text.sm,
|
|
929
937
|
fontWeight: 600,
|
|
930
938
|
color: 'var(--vx-ink)',
|
|
931
939
|
},
|
|
932
940
|
itemContent: {
|
|
933
|
-
fontSize: VX.text.
|
|
941
|
+
fontSize: VX.text.sm,
|
|
934
942
|
color: 'var(--vx-muted)',
|
|
935
943
|
},
|
|
936
944
|
},
|
|
@@ -983,7 +991,7 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
983
991
|
boxShadow: 'var(--vx-shadow-overlay)',
|
|
984
992
|
},
|
|
985
993
|
item: {
|
|
986
|
-
fontSize: VX.text.
|
|
994
|
+
fontSize: VX.text.sm,
|
|
987
995
|
borderRadius: 'var(--vx-radius-ctrl)',
|
|
988
996
|
padding: 'var(--vx-space-row-inset-y) var(--vx-space-row-inset-x)',
|
|
989
997
|
},
|
|
@@ -1099,7 +1107,7 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
|
|
|
1099
1107
|
textTransform: 'uppercase',
|
|
1100
1108
|
color: 'var(--vx-faint)',
|
|
1101
1109
|
},
|
|
1102
|
-
td: { height: spacing.step.tableRowHeight },
|
|
1110
|
+
td: { height: spacing.step.tableRowHeight, fontSize: VX.text.sm },
|
|
1103
1111
|
},
|
|
1104
1112
|
}),
|
|
1105
1113
|
// The v9 thumb indicator is a center dot painted in the TRACK color — over the remapped
|
|
@@ -1314,7 +1322,7 @@ const CTL_NUMBER_CHEVRON_SIZE = 10
|
|
|
1314
1322
|
const CTL_NUMBER_RIGHT_SECTION_WIDTH = 17
|
|
1315
1323
|
/**
|
|
1316
1324
|
* The `ctl` tier's Radio/Checkbox indicator box, in px — 16, the SAME square
|
|
1317
|
-
* `theme/icon-slot.module.css` gives every icon in the tier, and for the same reason: a
|
|
1325
|
+
* `theme/icon-slot.module.css` gives every icon in the tier, and for the same reason: a 13px
|
|
1318
1326
|
* option label needs a mark it reads as part of the row rather than as a control beside it. Mantine's
|
|
1319
1327
|
* default is `sm` (20px) and its `md` is 24px, both of which made the popover a column of controls
|
|
1320
1328
|
* (the sheet/panel forms found the same thing and went further — `docs/CONTROLS-SPEC.md` §3's
|
|
@@ -1392,14 +1400,12 @@ const CTL_SLIDER_TRACK_SIZE = 6
|
|
|
1392
1400
|
* (`docs/CONTROLS-SPEC.md` §2.1) is the same 30px as the buttons beside it — Mantine's tallest
|
|
1393
1401
|
* shipped Badge is 32px `xl`, and none of its tiers is 30.
|
|
1394
1402
|
*/
|
|
1395
|
-
function ctlSizeVars(): Record<string, string> {
|
|
1403
|
+
function ctlSizeVars(): Record<string, string> & Record<CtlHeightVar, string> {
|
|
1396
1404
|
const ctlHeight = 'calc(var(--vx-space-control-height-ctl) * var(--mantine-scale))'
|
|
1397
1405
|
return {
|
|
1398
|
-
|
|
1406
|
+
...heightVars(ctlHeight),
|
|
1399
1407
|
'--button-padding-x-ctl': `calc(${pxRem(CTL_PADDING_X)} * var(--mantine-scale))`,
|
|
1400
|
-
'--input-height-ctl': ctlHeight,
|
|
1401
1408
|
'--input-padding-y-ctl': `calc(${pxRem(CTL_INPUT_PADDING_Y)} * var(--mantine-scale))`,
|
|
1402
|
-
'--ai-size-ctl': ctlHeight,
|
|
1403
1409
|
'--ai-size-icon': 'calc(var(--vx-space-control-height-widget) * var(--mantine-scale))',
|
|
1404
1410
|
// A shorthand pair (`<y> <x>`), the shape SegmentedControl's own `--sc-padding-*` vars take.
|
|
1405
1411
|
// `y` stays a bare literal (the label's own box height is now enforced by the `size === 'ctl'`
|
|
@@ -1410,7 +1416,6 @@ function ctlSizeVars(): Record<string, string> {
|
|
|
1410
1416
|
'--combobox-chevron-size-ctl': pxRem(CTL_CHEVRON_SIZE),
|
|
1411
1417
|
'--ni-chevron-size-ctl': pxRem(CTL_NUMBER_CHEVRON_SIZE),
|
|
1412
1418
|
'--ni-right-section-width-ctl': `calc(${pxRem(CTL_NUMBER_RIGHT_SECTION_WIDTH)} * var(--mantine-scale))`,
|
|
1413
|
-
'--badge-height-ctl': ctlHeight,
|
|
1414
1419
|
'--badge-padding-x-ctl': `calc(${pxRem(CTL_PADDING_X)} * var(--mantine-scale))`,
|
|
1415
1420
|
'--badge-fz-ctl': `calc(${pxRem(VX.text.xs)} * var(--mantine-scale))`,
|
|
1416
1421
|
// `= VX.text.sm` per `docs/CONTROLS-SPEC.md` §5 — same `calc(<rem> * var(--mantine-scale))`
|
|
@@ -1418,7 +1423,7 @@ function ctlSizeVars(): Record<string, string> {
|
|
|
1418
1423
|
'--mantine-font-size-ctl': `calc(${pxRem(VX.text.sm)} * var(--mantine-scale))`,
|
|
1419
1424
|
'--mantine-line-height-ctl': 'var(--mantine-line-height-sm)',
|
|
1420
1425
|
// Radio / Checkbox / Switch — the three components whose DEFAULT (`sm`, a 20px indicator) sat
|
|
1421
|
-
// beside a
|
|
1426
|
+
// beside a 13px option label in every popover and sheet basalt draws. Every prefix here was
|
|
1422
1427
|
// read out of the installed `@mantine/core` source, and `ctl-tier-coverage.test.ts` now scans
|
|
1423
1428
|
// those three components too, so a future minor that adds a `getSize` call fails the build
|
|
1424
1429
|
// instead of resolving the new var to its initial value. Note there is NO
|
|
@@ -1438,6 +1443,21 @@ function ctlSizeVars(): Record<string, string> {
|
|
|
1438
1443
|
}
|
|
1439
1444
|
}
|
|
1440
1445
|
|
|
1446
|
+
/** Every `ctl` height var set to one value — typed over {@link CTL_HEIGHT_VARS} so a var added to the
|
|
1447
|
+
* list cannot be missing from the tier. */
|
|
1448
|
+
function heightVars(height: string): Record<CtlHeightVar, string> {
|
|
1449
|
+
return Object.fromEntries(CTL_HEIGHT_VARS.map((name) => [name, height])) as Record<
|
|
1450
|
+
CtlHeightVar,
|
|
1451
|
+
string
|
|
1452
|
+
>
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/** A px line box as the unitless ratio Mantine's `lineHeights` take, to 4 decimals (like
|
|
1456
|
+
* `rowLineHeight`, which rounds to 2) so the emitted var carries no float noise. */
|
|
1457
|
+
function lineRatio(linePx: number, fontPx: number): string {
|
|
1458
|
+
return String(Math.round((linePx / fontPx) * 10000) / 10000)
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1441
1461
|
/** `radius` knob: an integer level, so an out-of-range value is a tsc error (V2-SPEC §3). */
|
|
1442
1462
|
export type BasaltRadiusLevel = -5 | -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5
|
|
1443
1463
|
|