basalt-ui 2.15.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/MIGRATING.md +74 -12
  3. package/agent/agents/basalt-design-reviewer.md +1 -1
  4. package/agent/rules/basalt-mantine.md +1 -1
  5. package/configs/card-inset.test.ts +57 -0
  6. package/configs/oxlint-basalt.json +1 -1
  7. package/configs/oxlint-plugin.js +42 -18
  8. package/configs/oxlint-plugin.test.ts +37 -6
  9. package/dist/agent/chat/thread-message.js +1 -1
  10. package/dist/agent/chat/thread-outcome-card.js +1 -1
  11. package/dist/charts/ChartCard.js +1 -1
  12. package/dist/charts/chart-card.module.css +2 -2
  13. package/dist/cli/shot/board.js +1 -1
  14. package/dist/cli/shot/measure.d.ts +21 -2
  15. package/dist/cli/shot/measure.d.ts.map +1 -1
  16. package/dist/cli/shot/measure.js +20 -5
  17. package/dist/cli/shot/types.d.ts +3 -2
  18. package/dist/cli/shot/types.d.ts.map +1 -1
  19. package/dist/dashboard/settings-section.d.ts.map +1 -1
  20. package/dist/dashboard/settings-section.js +5 -2
  21. package/dist/dashboard/stat-card.js +12 -12
  22. package/dist/dashboard/stat-card.module.css +4 -4
  23. package/dist/dashboard/widget-header.module.css +3 -3
  24. package/dist/guard/guard-hook.d.ts.map +1 -1
  25. package/dist/guard/index.d.ts +4 -2
  26. package/dist/guard/index.d.ts.map +1 -1
  27. package/dist/guard/index.js +18 -4
  28. package/dist/guard/vx-names.d.ts.map +1 -1
  29. package/dist/guard/vx-names.js +1 -0
  30. package/dist/shell/app-mobile-nav.module.css +2 -2
  31. package/dist/shell/app-sidebar-account.js +1 -1
  32. package/dist/shell/app-sidebar.js +2 -2
  33. package/dist/shell/app-sidebar.module.css +8 -8
  34. package/dist/shell/index.js +5 -1
  35. package/dist/shell/page-bar.js +1 -1
  36. package/dist/table/data-table.d.ts.map +1 -1
  37. package/dist/table/data-table.js +3 -0
  38. package/dist/theme/index.d.ts.map +1 -1
  39. package/dist/theme/index.js +31 -21
  40. package/dist/tokens/core.d.ts +10 -4
  41. package/dist/tokens/core.d.ts.map +1 -1
  42. package/dist/tokens/core.js +16 -10
  43. package/dist/tokens/ctl-vars.d.ts +15 -0
  44. package/dist/tokens/ctl-vars.d.ts.map +1 -0
  45. package/dist/tokens/ctl-vars.js +22 -0
  46. package/dist/tokens/palette.d.ts +37 -29
  47. package/dist/tokens/palette.d.ts.map +1 -1
  48. package/dist/tokens/palette.js +32 -21
  49. package/dist/tokens/space-scale.d.ts +14 -0
  50. package/dist/tokens/space-scale.d.ts.map +1 -0
  51. package/dist/tokens/space-scale.js +10 -0
  52. package/llms.txt +2 -2
  53. package/package.json +1 -1
  54. package/src/agent/chat/thread-message.tsx +1 -1
  55. package/src/agent/chat/thread-outcome-card.tsx +2 -2
  56. package/src/charts/ChartCard.tsx +1 -1
  57. package/src/charts/chart-card.module.css +2 -2
  58. package/src/cli/shot/board.ts +1 -1
  59. package/src/cli/shot/measure.ts +33 -6
  60. package/src/cli/shot/types.ts +3 -2
  61. package/src/dashboard/settings-section.tsx +5 -2
  62. package/src/dashboard/stat-card.module.css +4 -4
  63. package/src/dashboard/stat-card.tsx +13 -13
  64. package/src/dashboard/widget-header.module.css +3 -3
  65. package/src/guard/guard-hook.ts +3 -1
  66. package/src/guard/index.ts +27 -13
  67. package/src/guard/vx-names.ts +1 -0
  68. package/src/shell/app-mobile-nav.module.css +2 -2
  69. package/src/shell/app-sidebar-account.tsx +1 -1
  70. package/src/shell/app-sidebar.module.css +8 -8
  71. package/src/shell/app-sidebar.tsx +2 -2
  72. package/src/shell/index.tsx +10 -4
  73. package/src/shell/page-bar.tsx +1 -1
  74. package/src/table/data-table.tsx +10 -4
  75. package/src/theme/__snapshots__/plain-theme.test.ts.snap +57 -45
  76. package/src/theme/ctl-theme.tsx +1 -1
  77. package/src/theme/index.ts +43 -23
  78. package/src/tokens/core.ts +16 -8
  79. package/src/tokens/ctl-vars.ts +32 -0
  80. package/src/tokens/palette.ts +40 -29
  81. package/src/tokens/space-scale.ts +13 -0
@@ -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": 15,
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": 8,
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": 15,
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": 15,
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": 8,
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": 8,
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": 7,
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-tight)"
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-tight)"}}",
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-tight)"},"label":{"display":"inline-flex","alignItems":"center","minHeight":"calc(var(--vx-space-control-height-ctl) * var(--mantine-scale) - 4px)"}}",
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": 15,
829
+ "fontSize": 13,
829
830
  },
830
831
  "itemTitle": {
831
832
  "color": "var(--vx-ink)",
832
- "fontSize": 15,
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": 8,
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.84375rem * var(--mantine-scale))",
886
+ "sm": "calc(0.8125rem * var(--mantine-scale))",
886
887
  "xl": "calc(1.125rem * var(--mantine-scale))",
887
- "xs": "calc(0.78125rem * var(--mantine-scale))",
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": "1.125rem",
913
- "sm": "0.8125rem",
914
- "xl": "1.625rem",
915
- "xs": "0.6875rem",
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": 15,
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": 11,
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": 15,
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": 15,
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": 11,
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": 11,
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": 10,
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-tight)"
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-tight)"}}",
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-tight)"},"label":{"display":"inline-flex","alignItems":"center","minHeight":"calc(var(--vx-space-control-height-ctl) * var(--mantine-scale) - 4px)"}}",
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": 15,
1927
+ "fontSize": 13,
1922
1928
  },
1923
1929
  "itemTitle": {
1924
1930
  "color": "var(--vx-ink)",
1925
- "fontSize": 15,
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": 11,
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.84375rem * var(--mantine-scale))",
1984
+ "sm": "calc(0.8125rem * var(--mantine-scale))",
1979
1985
  "xl": "calc(1.125rem * var(--mantine-scale))",
1980
- "xs": "calc(0.78125rem * var(--mantine-scale))",
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.28,
2020
+ "rowLineHeight": 1.47,
2010
2021
  "scale": {
2011
2022
  "lg": 16,
2012
- "md": 14,
2023
+ "md": 13,
2013
2024
  "sm": 10,
2014
- "xl": 21,
2015
- "xs": 9,
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": 10,
2055
- "cardInsetY": 9,
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": 10,
2167
+ "card": 13,
2156
2168
  "ctrl": 9,
2157
2169
  "fine": 7,
2158
- "floating": 11,
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.875rem",
2186
+ "md": "0.8125rem",
2175
2187
  "sm": "0.625rem",
2176
- "xl": "1.3125rem",
2177
- "xs": "0.5625rem",
2188
+ "xl": "1.1875rem",
2189
+ "xs": "0.375rem",
2178
2190
  },
2179
2191
  "variantColorResolver": {
2180
2192
  "fn":
@@ -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 13.5px option label — which
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
@@ -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)` (7px, see the
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` (7px).
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 body step on the ROOT, not just the label: the body element sizes itself from the
638
- // root's inherited line-height (which, left at the default 1.55, alone pushed rows to
639
- // ~37px). The tightened 1.35 keeps rows compact as the scale grows. Reads
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.md,
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.md, lineHeight: 'var(--vx-space-row-line-height)' },
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.card === RADIUS_STEP.tight + segmentedTrackInset`, see that constant's doc in
814
- // `tokens/palette.ts`), and `radius.card`/`RADIUS_STEP.tight` two lines below already track the
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.card },
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-tight)',
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.md,
936
+ fontSize: VX.text.sm,
929
937
  fontWeight: 600,
930
938
  color: 'var(--vx-ink)',
931
939
  },
932
940
  itemContent: {
933
- fontSize: VX.text.md,
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.md,
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 13.5px
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
- '--button-height-ctl': ctlHeight,
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 13.5px option label in every popover and sheet basalt draws. Every prefix here was
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
 
@@ -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.5, // delta badges, tooltip meta, dense chrome, StatCard labels
132
- sm: 13.5, // table/stat numerals, chart tooltip, legend
133
- md: 15, // BODY — nav rows, menu items, timeline, labels, prose; chart/card titles
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: 24, // the StatCard hero numeral (density pass: 31 → 24, tighter/less shouty)
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 `sm` -> `xs`, and the Section's gap steps `stackMd` -> `stackSm`.
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.xs}px`),
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) {