basalt-ui 1.19.0 → 1.20.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 (83) hide show
  1. package/AGENTS.md +15 -1
  2. package/CHANGELOG.md +27 -0
  3. package/MIGRATING.md +228 -0
  4. package/README.md +53 -9
  5. package/agent/rules/basalt-app.md +43 -0
  6. package/agent/rules/basalt-charts.md +26 -14
  7. package/agent/rules/basalt-mantine.md +25 -10
  8. package/agent/rules/basalt-router.md +22 -10
  9. package/agent/rules/basalt-tokens.md +75 -6
  10. package/agent/skills/basalt-app/SKILL.md +42 -6
  11. package/configs/check.yml +11 -4
  12. package/configs/lefthook.yml +21 -2
  13. package/configs/oxlint-plugin.js +515 -25
  14. package/configs/oxlint-plugin.test.ts +383 -10
  15. package/configs/oxlint.json +10 -1
  16. package/dist/agent/stick-to-bottom.js +1 -1
  17. package/dist/agent-chat/thread-detail-panel.js +1 -1
  18. package/dist/agent-chat/thread-message.js +2 -2
  19. package/dist/agent-chat/tool-chip.js +1 -1
  20. package/dist/charts/kinds/Donut.d.ts.map +1 -1
  21. package/dist/charts/kinds/Donut.js +1 -1
  22. package/dist/charts/primitives/ChartLegend.js +2 -2
  23. package/dist/charts/primitives/ChartTooltip.js +1 -1
  24. package/dist/cli/index.d.ts +107 -15
  25. package/dist/cli/index.d.ts.map +1 -1
  26. package/dist/cli/index.js +610 -72
  27. package/dist/cli/toolchain-wiring.test.d.ts +2 -0
  28. package/dist/cli/toolchain-wiring.test.d.ts.map +1 -0
  29. package/dist/dashboard/delta-badge.js +2 -2
  30. package/dist/dashboard/stat-card.js +1 -1
  31. package/dist/data/virtual-list.js +5 -5
  32. package/dist/guard/index.d.ts +56 -2
  33. package/dist/guard/index.d.ts.map +1 -1
  34. package/dist/guard/index.js +326 -59
  35. package/dist/guard/types.d.ts +25 -5
  36. package/dist/guard/types.d.ts.map +1 -1
  37. package/dist/register.d.ts +25 -0
  38. package/dist/register.d.ts.map +1 -1
  39. package/dist/shell/app-mobile-nav.d.ts.map +1 -1
  40. package/dist/shell/app-mobile-nav.js +14 -14
  41. package/dist/shell/app-mobile-nav.module.css +44 -11
  42. package/dist/shell/app-mobile-nav.module.css.d.ts +1 -1
  43. package/dist/surfaces.d.ts +1 -1
  44. package/dist/surfaces.js +1 -1
  45. package/dist/tokens/index.d.ts +3 -3
  46. package/dist/tokens/index.d.ts.map +1 -1
  47. package/dist/tokens/index.js +2 -0
  48. package/dist/tokens/palette.d.ts +35 -27
  49. package/dist/tokens/palette.d.ts.map +1 -1
  50. package/dist/tokens/palette.js +24 -18
  51. package/dist/tokens.css +19 -17
  52. package/dist/vite-color-mix.js +2 -2
  53. package/llms.txt +3 -3
  54. package/package.json +4 -3
  55. package/src/agent/stick-to-bottom.tsx +1 -1
  56. package/src/agent-chat/thread-detail-panel.tsx +1 -1
  57. package/src/agent-chat/thread-message.tsx +3 -3
  58. package/src/agent-chat/tool-chip.tsx +1 -1
  59. package/src/charts/kinds/Donut.tsx +2 -1
  60. package/src/charts/primitives/ChartLegend.tsx +2 -2
  61. package/src/charts/primitives/ChartTooltip.tsx +1 -1
  62. package/src/cli/index.ts +1070 -99
  63. package/src/cli/init-sync.test.ts +19 -3
  64. package/src/cli/tokens-css.test.ts +27 -14
  65. package/src/cli/toolchain-wiring.test.ts +694 -0
  66. package/src/dashboard/delta-badge.tsx +3 -3
  67. package/src/dashboard/stat-card.tsx +1 -1
  68. package/src/data/virtual-list.tsx +8 -8
  69. package/src/guard/check-source.test.ts +663 -11
  70. package/src/guard/index.ts +727 -94
  71. package/src/guard/types.ts +29 -4
  72. package/src/register.ts +32 -0
  73. package/src/shell/app-mobile-nav.module.css +44 -11
  74. package/src/shell/app-mobile-nav.module.css.d.ts +1 -1
  75. package/src/shell/app-mobile-nav.test.tsx +34 -0
  76. package/src/shell/app-mobile-nav.tsx +16 -5
  77. package/src/surfaces.ts +1 -1
  78. package/src/theme/density-relations.test.ts +8 -5
  79. package/src/theme/spacing.test.ts +2 -0
  80. package/src/theme-toggle/index.tsx +2 -2
  81. package/src/tokens/index.ts +5 -3
  82. package/src/tokens/palette.ts +24 -18
  83. package/src/vite-color-mix.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basalt-ui",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "Opinionated framework for Mantine-based React apps — theme, app shell, visx charts, toolchain presets",
5
5
  "keywords": [
6
6
  "charts",
@@ -37,7 +37,8 @@
37
37
  "llms.txt",
38
38
  "AGENTS.md",
39
39
  "README.md",
40
- "CHANGELOG.md"
40
+ "CHANGELOG.md",
41
+ "MIGRATING.md"
41
42
  ],
42
43
  "type": "module",
43
44
  "sideEffects": [
@@ -131,7 +132,7 @@
131
132
  },
132
133
  "scripts": {
133
134
  "build": "tsup && tsc --emitDeclarationOnly --declarationMap && bun scripts/copy-assets.mjs && bun scripts/gen-tokens-css.mjs && bun scripts/fix-esm-extensions.mjs",
134
- "typecheck": "tsc --noEmit",
135
+ "typecheck": "tsc --noEmit && tsc -p tests/layout/tsconfig.json",
135
136
  "test": "cd ../.. && bun test packages/basalt-ui",
136
137
  "pack-test": "bash scripts/pack-test.sh",
137
138
  "prepack": "bun run build",
@@ -39,7 +39,7 @@ type WrapperProps = {
39
39
  /** Plain scrollable container rendered when use-stick-to-bottom peer is absent. */
40
40
  function PlainContainerFallback({ children, className, style }: WrapperProps): JSX.Element {
41
41
  const props: { className?: string; style?: CSSProperties } = {
42
- // theme-allow — scroll anchoring needs a real scrollable node it owns, not a ScrollArea.
42
+ // theme-allow raw-scroll-container — scroll anchoring needs a real scrollable node it owns, not a ScrollArea.
43
43
  style: { overflowY: 'auto', ...style },
44
44
  }
45
45
  if (className !== undefined) props.className = className
@@ -135,7 +135,7 @@ export function ThreadDetailPanel({
135
135
  <BasaltStickToBottom
136
136
  style={{
137
137
  height: '100%',
138
- // theme-allow — BasaltStickToBottom owns this scroll node (see stick-to-bottom.tsx).
138
+ // theme-allow raw-scroll-container — BasaltStickToBottom owns this scroll node (see stick-to-bottom.tsx).
139
139
  overflowY: 'auto',
140
140
  padding: 'var(--vx-space-agent-transcript-inset)',
141
141
  }}
@@ -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
  />
@@ -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',
@@ -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
  }}