basalt-ui 1.19.1 → 1.21.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 (129) hide show
  1. package/AGENTS.md +19 -1
  2. package/CHANGELOG.md +39 -0
  3. package/MIGRATING.md +326 -0
  4. package/README.md +87 -9
  5. package/agent/rules/basalt-app.md +84 -0
  6. package/agent/rules/basalt-charts.md +32 -17
  7. package/agent/rules/basalt-content.md +4 -0
  8. package/agent/rules/basalt-mantine.md +25 -10
  9. package/agent/rules/basalt-router.md +79 -15
  10. package/agent/rules/basalt-state.md +21 -3
  11. package/agent/rules/basalt-tokens.md +132 -6
  12. package/agent/skills/basalt-app/SKILL.md +45 -6
  13. package/agent/skills/basalt-charts/SKILL.md +5 -3
  14. package/agent/templates/CLAUDE-block.md.tpl +11 -5
  15. package/configs/check.yml +11 -4
  16. package/configs/lefthook.yml +59 -7
  17. package/configs/oxlint-plugin.js +633 -30
  18. package/configs/oxlint-plugin.test.ts +594 -15
  19. package/configs/oxlint.json +10 -1
  20. package/dist/agent/stick-to-bottom.js +1 -1
  21. package/dist/agent-chat/thread-detail-panel.js +1 -1
  22. package/dist/agent-chat/thread-message.js +2 -2
  23. package/dist/agent-chat/tool-chip.js +1 -1
  24. package/dist/charts/kinds/Bars.d.ts +1 -1
  25. package/dist/charts/kinds/Bars.d.ts.map +1 -1
  26. package/dist/charts/kinds/Donut.d.ts +1 -1
  27. package/dist/charts/kinds/Donut.d.ts.map +1 -1
  28. package/dist/charts/kinds/Donut.js +1 -1
  29. package/dist/charts/kinds/DualPanel.d.ts +1 -1
  30. package/dist/charts/kinds/DualPanel.d.ts.map +1 -1
  31. package/dist/charts/kinds/Heatmap.d.ts +1 -1
  32. package/dist/charts/kinds/Heatmap.d.ts.map +1 -1
  33. package/dist/charts/kinds/MultiLine.d.ts +1 -1
  34. package/dist/charts/kinds/MultiLine.d.ts.map +1 -1
  35. package/dist/charts/kinds/StackedArea.d.ts +1 -1
  36. package/dist/charts/kinds/StackedArea.d.ts.map +1 -1
  37. package/dist/charts/kinds/ZonedLine.d.ts +1 -1
  38. package/dist/charts/kinds/ZonedLine.d.ts.map +1 -1
  39. package/dist/charts/primitives/ChartLegend.js +2 -2
  40. package/dist/charts/primitives/ChartTooltip.js +1 -1
  41. package/dist/cli/index.d.ts +146 -20
  42. package/dist/cli/index.d.ts.map +1 -1
  43. package/dist/cli/index.js +901 -101
  44. package/dist/cli/toolchain-wiring.test.d.ts +2 -0
  45. package/dist/cli/toolchain-wiring.test.d.ts.map +1 -0
  46. package/dist/cli/waiver-audit.test.d.ts +2 -0
  47. package/dist/cli/waiver-audit.test.d.ts.map +1 -0
  48. package/dist/dashboard/delta-badge.js +2 -2
  49. package/dist/dashboard/stat-card.js +1 -1
  50. package/dist/data/virtual-list.js +5 -5
  51. package/dist/guard/index.d.ts +101 -2
  52. package/dist/guard/index.d.ts.map +1 -1
  53. package/dist/guard/index.js +474 -62
  54. package/dist/guard/types.d.ts +25 -5
  55. package/dist/guard/types.d.ts.map +1 -1
  56. package/dist/register.d.ts +25 -0
  57. package/dist/register.d.ts.map +1 -1
  58. package/dist/router-tanstack/multi-search-param-store.d.ts +13 -0
  59. package/dist/router-tanstack/multi-search-param-store.d.ts.map +1 -1
  60. package/dist/router-tanstack/multi-search-param-store.js +4 -1
  61. package/dist/router-tanstack/search-param-store.d.ts +29 -5
  62. package/dist/router-tanstack/search-param-store.d.ts.map +1 -1
  63. package/dist/router-tanstack/search-param-store.js +31 -3
  64. package/dist/router-tanstack/search-param-store.test.d.ts +2 -0
  65. package/dist/router-tanstack/search-param-store.test.d.ts.map +1 -0
  66. package/dist/shell/app-mobile-nav.module.css +11 -3
  67. package/dist/shell/index.d.ts +12 -5
  68. package/dist/shell/index.d.ts.map +1 -1
  69. package/dist/shell/index.js +24 -6
  70. package/dist/surfaces.d.ts +1 -1
  71. package/dist/surfaces.js +1 -1
  72. package/dist/tokens/index.d.ts +5 -3
  73. package/dist/tokens/index.d.ts.map +1 -1
  74. package/dist/tokens/index.js +7 -1
  75. package/dist/tokens/palette.d.ts +35 -27
  76. package/dist/tokens/palette.d.ts.map +1 -1
  77. package/dist/tokens/palette.js +24 -18
  78. package/dist/tokens/text-scale.test.d.ts +2 -0
  79. package/dist/tokens/text-scale.test.d.ts.map +1 -0
  80. package/dist/tokens.css +21 -17
  81. package/dist/vite-color-mix.js +2 -2
  82. package/dist/vite.d.ts +24 -2
  83. package/dist/vite.d.ts.map +1 -1
  84. package/dist/vite.js +54 -13
  85. package/llms.txt +3 -3
  86. package/package.json +4 -3
  87. package/src/agent/stick-to-bottom.tsx +1 -1
  88. package/src/agent-chat/thread-detail-panel.tsx +1 -1
  89. package/src/agent-chat/thread-message.tsx +3 -3
  90. package/src/agent-chat/tool-chip.tsx +1 -1
  91. package/src/charts/kinds/Bars.tsx +1 -1
  92. package/src/charts/kinds/Donut.tsx +3 -2
  93. package/src/charts/kinds/DualPanel.tsx +2 -2
  94. package/src/charts/kinds/Heatmap.tsx +1 -1
  95. package/src/charts/kinds/MultiLine.tsx +1 -1
  96. package/src/charts/kinds/StackedArea.tsx +1 -1
  97. package/src/charts/kinds/ZonedLine.tsx +1 -1
  98. package/src/charts/primitives/ChartLegend.tsx +2 -2
  99. package/src/charts/primitives/ChartTooltip.tsx +1 -1
  100. package/src/cli/index.ts +1614 -164
  101. package/src/cli/init-sync.test.ts +21 -3
  102. package/src/cli/template-ledger.test.ts +1 -1
  103. package/src/cli/tokens-css.test.ts +27 -14
  104. package/src/cli/toolchain-wiring.test.ts +856 -0
  105. package/src/cli/waiver-audit.test.ts +131 -0
  106. package/src/dashboard/delta-badge.tsx +3 -3
  107. package/src/dashboard/stat-card.tsx +1 -1
  108. package/src/data/virtual-list.tsx +8 -8
  109. package/src/guard/check-source.test.ts +1104 -12
  110. package/src/guard/index.ts +1106 -103
  111. package/src/guard/types.ts +29 -4
  112. package/src/register.ts +32 -0
  113. package/src/router-tanstack/multi-search-param-store.ts +16 -1
  114. package/src/router-tanstack/search-param-store.test.ts +135 -0
  115. package/src/router-tanstack/search-param-store.ts +90 -8
  116. package/src/shell/app-mobile-nav.module.css +11 -3
  117. package/src/shell/app-mobile-nav.tsx +1 -1
  118. package/src/shell/index.test.tsx +52 -0
  119. package/src/shell/index.tsx +64 -13
  120. package/src/surfaces.ts +1 -1
  121. package/src/theme/density-relations.test.ts +8 -5
  122. package/src/theme/spacing.test.ts +2 -0
  123. package/src/theme-toggle/index.tsx +2 -2
  124. package/src/tokens/index.ts +28 -3
  125. package/src/tokens/palette.ts +24 -18
  126. package/src/tokens/text-scale.test.ts +51 -0
  127. package/src/vite-color-mix.ts +2 -2
  128. package/src/vite.test.ts +125 -6
  129. package/src/vite.ts +148 -20
@@ -615,7 +615,7 @@ type VirtualizedTranscriptProps = {
615
615
  */
616
616
  function NonVirtualizedRows({ rows, height }: VirtualizedTranscriptProps): JSX.Element {
617
617
  return (
618
- // theme-allow — degrade target owns its own scroll node, same as the real virtualizer below.
618
+ // theme-allow raw-scroll-container — degrade target owns its own scroll node, same as the real virtualizer below.
619
619
  <Box style={{ height, overflow: 'auto' }}>
620
620
  <Stack gap="sm">
621
621
  {rows.map((row) => (
@@ -895,7 +895,7 @@ const LazyVirtualizedRows = lazy(() =>
895
895
  })
896
896
 
897
897
  return (
898
- // theme-allow — TanStack Virtual measures/scrolls this element (never nest in BasaltStickToBottom, see ./virtualize).
898
+ // theme-allow raw-scroll-container — TanStack Virtual measures/scrolls this element (never nest in BasaltStickToBottom, see ./virtualize).
899
899
  <Box ref={parentRef} style={{ height, overflow: 'auto' }}>
900
900
  <Box style={{ height: virtualizer.getTotalSize(), position: 'relative' }}>
901
901
  {virtualizer.getVirtualItems().map((virtualItem) => {
@@ -938,7 +938,7 @@ const LazyVirtualizedRows = lazy(() =>
938
938
  * flash without paying that cost — it settles state before any row has meaningfully mounted.
939
939
  */
940
940
  function VirtualizeSuspenseFallback({ height }: { readonly height: number | string }): JSX.Element {
941
- // theme-allow — placeholder owns its own scroll node, matching the real virtualizer's shape.
941
+ // theme-allow raw-scroll-container — placeholder owns its own scroll node, matching the real virtualizer's shape.
942
942
  return <Box style={{ height, overflow: 'auto' }} />
943
943
  }
944
944
 
@@ -138,7 +138,7 @@ export function ToolChip({
138
138
  width: 6,
139
139
  height: 6,
140
140
  flexShrink: 0,
141
- borderRadius: '50%', // theme-allow: a 6px state dot is a circle, not a surface corner — no radius token expresses it
141
+ borderRadius: '50%', // theme-allow raw-surface — a 6px state dot is a circle, not a surface corner
142
142
  backgroundColor: dotToken,
143
143
  }}
144
144
  />
@@ -125,7 +125,7 @@ export type BarsProps<T> = {
125
125
  /** Legend config forwarded to `CartesianChart`; `false` disables the legend (sparkline escape).
126
126
  * Default `{ placement: 'bottom' }`. */
127
127
  legend?: ChartLegendConfig | false
128
- /** Accessible text alternative, forwarded as `aria-label` (+ `role="img"`). */
128
+ /** Accessible text alternative, forwarded as `aria-label` (+ `role="group"`). */
129
129
  ariaLabel?: string
130
130
  /** Forwarded to `CartesianChart` — see `ChartPending`'s JSDoc for the three-state rationale. */
131
131
  isPending?: boolean
@@ -50,7 +50,7 @@ export type DonutProps<K extends string = SeriesKey> = {
50
50
  centerContent?: ReactNode
51
51
  innerRatio?: number
52
52
  padAngle?: number
53
- /** Accessible text alternative, forwarded to `ChartFrame` as `aria-label` (+ `role="img"`). */
53
+ /** Accessible text alternative, forwarded to `ChartFrame` as `aria-label` (+ `role="group"`). */
54
54
  ariaLabel?: string
55
55
  /** Forwarded to `ChartFrame` — see `ChartPending`'s JSDoc for the three-state rationale. */
56
56
  isPending?: boolean
@@ -208,7 +208,8 @@ function DonutPlot<K extends string = SeriesKey>(props: DonutPlotProps<K>) {
208
208
  style={{
209
209
  position: 'absolute',
210
210
  inset: 0,
211
- display: 'flex', // theme-allow: centering over the donut hole — charts/ is Mantine-free, so Center is unavailable here
211
+ // Centering over the donut hole; charts/ is Mantine-free, so Center is unavailable here.
212
+ display: 'flex',
212
213
  alignItems: 'center',
213
214
  justifyContent: 'center',
214
215
  pointerEvents: 'none',
@@ -94,7 +94,7 @@ export type DualPanelProps<T> = {
94
94
  /** Legend config forwarded to `ChartFrame`; `false` disables the legend (sparkline escape).
95
95
  * Default `{ placement: 'bottom' }`. */
96
96
  legend?: ChartLegendConfig | false
97
- /** Accessible text alternative, forwarded to `ChartFrame` as `aria-label` (+ `role="img"`). */
97
+ /** Accessible text alternative, forwarded to `ChartFrame` as `aria-label` (+ `role="group"`). */
98
98
  ariaLabel?: string
99
99
  /** Forwarded to `ChartFrame` — see `ChartPending`'s JSDoc for the three-state rationale. */
100
100
  isPending?: boolean
@@ -521,7 +521,7 @@ function DualPanelPlot<T>(props: DualPanelPlotProps<T>) {
521
521
  </>
522
522
  )}
523
523
 
524
- {/* theme-allow basalt/hand-rolled-plot: TWO panes over one x scale is not a single
524
+ {/* theme-allow-file basalt/hand-rolled-plot: TWO panes over one x scale is not a single
525
525
  cartesian plot, so `CartesianChart` (one plot rect, one or two y axes) cannot express
526
526
  it. This file therefore assembles the plot itself — but from the SAME parts every
527
527
  other chart gets: `ChartFrame`, `autoMargin` + `probeAxisLabels`, `useChartCursor`,
@@ -53,7 +53,7 @@ export type HeatmapProps<T> = {
53
53
  renderTooltip?: (cell: HeatmapCell) => ReactNode
54
54
  /** Optional gradient legend strip below the grid (faint → solid color). */
55
55
  legend?: { min: string; max: string }
56
- /** Accessible text alternative, forwarded to `ChartFrame` as `aria-label` (+ `role="img"`). */
56
+ /** Accessible text alternative, forwarded to `ChartFrame` as `aria-label` (+ `role="group"`). */
57
57
  ariaLabel?: string
58
58
  /** Forwarded to `ChartFrame` — see `ChartPending`'s JSDoc for the three-state rationale. */
59
59
  isPending?: boolean
@@ -52,7 +52,7 @@ export type MultiLineProps<T> = {
52
52
  /** Legend config forwarded to `CartesianChart`; `false` disables the legend (sparkline escape).
53
53
  * Default `{ placement: 'bottom' }`. */
54
54
  legend?: ChartLegendConfig | false
55
- /** Accessible text alternative, forwarded to `CartesianChart` as `aria-label` (+ `role="img"`). */
55
+ /** Accessible text alternative, forwarded to `CartesianChart` as `aria-label` (+ `role="group"`). */
56
56
  ariaLabel?: string
57
57
  /** Forwarded to `CartesianChart` — see `ChartPending`'s JSDoc for the three-state rationale. */
58
58
  isPending?: boolean
@@ -33,7 +33,7 @@ export type StackedAreaProps<T> = {
33
33
  /** Legend config forwarded to `CartesianChart`; `false` disables the legend (sparkline escape).
34
34
  * Default `{ placement: 'bottom' }`. */
35
35
  legend?: ChartLegendConfig | false
36
- /** Accessible text alternative, forwarded as `aria-label` (+ `role="img"`). */
36
+ /** Accessible text alternative, forwarded as `aria-label` (+ `role="group"`). */
37
37
  ariaLabel?: string
38
38
  /** Forwarded to `CartesianChart` — see `ChartPending`'s JSDoc for the three-state rationale. */
39
39
  isPending?: boolean
@@ -73,7 +73,7 @@ export type ZonedLineProps<T> = {
73
73
  /** Legend config forwarded to `CartesianChart`; `false` disables the legend (sparkline escape).
74
74
  * Default `{ placement: 'bottom' }`. */
75
75
  legend?: ChartLegendConfig | false
76
- /** Accessible text alternative, forwarded to `CartesianChart` as `aria-label` (+ `role="img"`). */
76
+ /** Accessible text alternative, forwarded to `CartesianChart` as `aria-label` (+ `role="group"`). */
77
77
  ariaLabel?: string
78
78
  /** Forwarded to `CartesianChart` — see `ChartPending`'s JSDoc for the three-state rationale. */
79
79
  isPending?: boolean
@@ -158,7 +158,7 @@ function LegendSwatch({ item, idPrefix }: { item: LegendEntry; idPrefix: string
158
158
  style={{
159
159
  width: 11,
160
160
  height: 11,
161
- borderRadius: 3, // theme-allow: sub-scale legend-swatch corner, below the 4px radius floor
161
+ borderRadius: 3, // theme-allow raw-surface — sub-scale legend-swatch corner, below the 4px radius floor
162
162
  backgroundColor: item.color,
163
163
  opacity: item.fillOpacity ?? 0.7,
164
164
  flexShrink: 0,
@@ -211,7 +211,7 @@ function LegendChildSwatch({ item }: { item: LegendEntry }) {
211
211
  style={{
212
212
  width: 10,
213
213
  height: 10,
214
- borderRadius: 2, // theme-allow: sub-scale legend-swatch corner, below the 4px radius floor
214
+ borderRadius: 2, // theme-allow raw-surface — sub-scale legend-swatch corner, below the 4px radius floor
215
215
  backgroundColor: item.color,
216
216
  opacity: item.fillOpacity ?? 0.7,
217
217
  flexShrink: 0,
@@ -121,7 +121,7 @@ export function TooltipRow({
121
121
  style={{
122
122
  width: 8,
123
123
  height: 8,
124
- borderRadius: 2, // theme-allow: sub-scale tooltip micro-corner, below the 4px radius floor
124
+ borderRadius: 2, // theme-allow raw-surface — sub-scale tooltip micro-corner, below the 4px radius floor
125
125
  backgroundColor: color,
126
126
  flexShrink: 0,
127
127
  }}