@nocoo/basalt 3.1.0 → 3.2.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 (77) hide show
  1. package/ai/DESIGN.md +108 -46
  2. package/ai/USAGE.md +1 -1
  3. package/ai/registry.json +115 -73
  4. package/dist/charts/config.d.ts +1 -1
  5. package/dist/charts/config.js +1 -1
  6. package/dist/charts/config.js.map +1 -1
  7. package/dist/charts/heatmap-matrix.js +2 -2
  8. package/dist/charts/heatmap-matrix.js.map +1 -1
  9. package/dist/charts/sparkline.js +1 -1
  10. package/dist/charts/sparkline.js.map +1 -1
  11. package/dist/charts/stat-card.js +1 -1
  12. package/dist/charts/stat-card.js.map +1 -1
  13. package/dist/components/alert-dialog.js +4 -4
  14. package/dist/components/alert-dialog.js.map +1 -1
  15. package/dist/components/approval-card.js +5 -6
  16. package/dist/components/approval-card.js.map +1 -1
  17. package/dist/components/avatar.js +1 -1
  18. package/dist/components/avatar.js.map +1 -1
  19. package/dist/components/chat-bubble.js +1 -1
  20. package/dist/components/chat-bubble.js.map +1 -1
  21. package/dist/components/chat-header.js +1 -1
  22. package/dist/components/chat-header.js.map +1 -1
  23. package/dist/components/chat-inbox.js +1 -1
  24. package/dist/components/chat-inbox.js.map +1 -1
  25. package/dist/components/chat-markdown.js +1 -1
  26. package/dist/components/chat-markdown.js.map +1 -1
  27. package/dist/components/chat-message.js +1 -1
  28. package/dist/components/chat-message.js.map +1 -1
  29. package/dist/components/code.js +4 -3
  30. package/dist/components/code.js.map +1 -1
  31. package/dist/components/context-cards.js +5 -5
  32. package/dist/components/context-cards.js.map +1 -1
  33. package/dist/components/dialog.js +2 -2
  34. package/dist/components/dialog.js.map +1 -1
  35. package/dist/components/diff-table.js +2 -2
  36. package/dist/components/diff-table.js.map +1 -1
  37. package/dist/components/input-area.js +1 -1
  38. package/dist/components/input-area.js.map +1 -1
  39. package/dist/components/layer-card.d.ts +6 -4
  40. package/dist/components/layer-card.js +60 -71
  41. package/dist/components/layer-card.js.map +1 -1
  42. package/dist/components/loader.js +1 -1
  43. package/dist/components/loader.js.map +1 -1
  44. package/dist/components/page-header.d.ts +2 -2
  45. package/dist/components/page-header.js +7 -7
  46. package/dist/components/page-header.js.map +1 -1
  47. package/dist/components/recommendation-card.js +2 -2
  48. package/dist/components/recommendation-card.js.map +1 -1
  49. package/dist/components/section-rule.js +1 -1
  50. package/dist/components/section-rule.js.map +1 -1
  51. package/dist/components/select.js +1 -1
  52. package/dist/components/select.js.map +1 -1
  53. package/dist/components/sheet.js +3 -3
  54. package/dist/components/sheet.js.map +1 -1
  55. package/dist/components/sidebar.js +2 -2
  56. package/dist/components/sidebar.js.map +1 -1
  57. package/dist/components/skeleton-line.js +1 -1
  58. package/dist/components/skeleton-line.js.map +1 -1
  59. package/dist/components/stat-strip.js +1 -1
  60. package/dist/components/stat-strip.js.map +1 -1
  61. package/dist/components/table.d.ts +2 -0
  62. package/dist/components/table.js +10 -12
  63. package/dist/components/table.js.map +1 -1
  64. package/dist/components/tabs.js +1 -1
  65. package/dist/components/tabs.js.map +1 -1
  66. package/dist/components/tag-badge.js +1 -1
  67. package/dist/components/tag-badge.js.map +1 -1
  68. package/dist/components/text.js +2 -2
  69. package/dist/components/text.js.map +1 -1
  70. package/dist/components/thinking.js +1 -1
  71. package/dist/components/thinking.js.map +1 -1
  72. package/dist/components/tool-chips.js +2 -2
  73. package/dist/components/tool-chips.js.map +1 -1
  74. package/dist/styles/standalone.css +119 -85
  75. package/dist/styles/tailwind.css +1 -0
  76. package/dist/styles/tokens.css +82 -39
  77. package/package.json +1 -1
package/ai/DESIGN.md CHANGED
@@ -46,12 +46,22 @@ or content surface. Card and layout boundaries use their own four-step roles:
46
46
  | Large | `--basalt-space-card-lg` | `--basalt-space-layout-lg` | `1.5rem` | 24px |
47
47
  | Extra large | `--basalt-space-card-xl` | `--basalt-space-layout-xl` | `2rem` | 32px |
48
48
 
49
- Card padding defaults to medium. LayerCard header/footer insets are 16px horizontal
50
- and 12px vertical; Body/Well use 16px. `padding="sm|md|lg|xl"` selects unstructured
49
+ Card padding defaults to medium. LayerCard headers flow into Body by default:
50
+ 16px horizontal/top insets, no bottom inset and an 8px internal gap, without a divider.
51
+ `Header divided` uses 16px on all sides and a bottom rule. Disclosure headers
52
+ (`Header asChild`) keep 16px horizontal / 12px vertical insets and show their
53
+ bottom rule only when open. Footer keeps 16px horizontal / 12px vertical insets;
54
+ Body/Well use 16px. `padding="sm|md|lg|xl"` selects unstructured
51
55
  card padding; structured cards keep their slot-owned insets. Compact composite
52
56
  card panels use the same 16/12px panel aliases. Their internal buttons and rows
53
57
  keep control spacing; do not stretch action rows to the card scale.
54
58
 
59
+ Compact card/panel headers (`CodeBlock` header, `ContextCards` chunk header and
60
+ `LayerCard.Header asChild`) share a 44px single-line reference height: a 20px line
61
+ box plus 12px vertical panel inset on each side. Header action buttons use
62
+ `size="sm"` and `-my-basalt-space-sm` so they never inflate the header bar.
63
+ Wrapping and enlarged text may grow the header; do not impose a fixed height.
64
+
55
65
  Layout grids default to medium (16px). ContentIsland owns 16px insets on mobile,
56
66
  24px on tablets and 24px vertical / 32px horizontal from 1024px. The catalog shell
57
67
  keeps 8px outside the island on mobile and 12px from 768px. Ordinary application
@@ -67,19 +77,26 @@ small floating menus have separate inset contracts.
67
77
  Form rhythm distinguishes a field from a group: label/control/hint spacing stays
68
78
  8px, related fields use 16px layout gaps, and separate sections use 24px. A form's
69
79
  stack owns those gaps; individual Field components do not add outer margins.
70
- DialogFooter owns 16px separation from content and keeps 8px between its actions.
71
- Do not add a matching margin at every caller or enlarge controls to open a form.
80
+ DialogFooter, AlertDialogFooter and SheetFooter own 16px separation from content
81
+ and keep 8px between actions. Do not add a matching margin at every caller or
82
+ enlarge controls to open a form.
72
83
 
73
84
  Metric cards use the shared `StatCard`, not a hand-built Header/Body split. A single
74
85
  16px inset owns the title, value, comparison and supporting chart; 12px separates
75
86
  the heading, metric and content groups, and 4px separates value/supporting text.
76
87
  Keep the comparison next to the metric in reading order, before the chart. Icons
77
- are small unboxed heading cues, not a second painted surface. Values use tabular
78
- display numerals and wrap naturally. Compact trend plots use 4rem geometry, not
79
- `flex-1` to fill the card; analytical charts with axes remain separate surfaces.
88
+ are small unboxed heading cues, not a second painted surface. `StatCard` titles
89
+ use 14px (`text-basalt-base`); primary metric numerals in `StatCard`, `StatStrip`
90
+ and dashboard KPIs use 24px (`text-basalt-3xl`), tabular alignment and natural
91
+ wrapping. Compact trend plots use 4rem geometry, not `flex-1` to fill the card;
92
+ analytical charts with axes remain separate surfaces.
80
93
  Show the time window and disclose a nonzero line-chart scale. Bar charts keep
81
94
  their zero baseline. Metric cards have no internal divider or decorative border.
82
95
 
96
+ Action horizontal insets use `--basalt-space-control-x-sm` (10px),
97
+ `--basalt-space-control-x` (12px) and `--basalt-space-control-x-lg` (16px).
98
+ Vertical padding and icon gaps stay compact; Select uses the shared control gap.
99
+ TagBadge uses 6px horizontal padding at `sm` and 8px at `md`.
83
100
  All nonzero padding, margin and gaps use the appropriate category scale or aliases.
84
101
  Zero, auto margins and hairline seams are structural exceptions, not new density
85
102
  levels. Negative margins may cancel an owned boundary, not invent a new gap.
@@ -140,7 +157,7 @@ The shared classes calculate natural size as follows:
140
157
  Descriptions, wrapping and actions can make a banner taller.
141
158
  - Action rows: 22px text line (`--basalt-line-row`) + 6px vertical padding each
142
159
  side = 34px. Body prose/code retain the 20px line box. Compound inputs own one
143
- outer border; inset children do not add another. Segmented tracks keep 12px text
160
+ outer border; inset children do not add another. Segmented tracks keep 14px text
144
161
  on a 20px line box: 30px items + 2px track inset per side = 34px.
145
162
  - Sidebar destination and disclosure rows use the same 22px line box with 8px
146
163
  vertical padding, yielding 38px reference rows without changing shared controls.
@@ -165,12 +182,26 @@ interaction contracts; do not change their containment as a global workaround.
165
182
  - Radius choices: `--basalt-radius-sm` (.25rem), `-md` (.5rem), `-lg` (.75rem)
166
183
  and `-full` (pill/circle); `none` and `inherit` are structural choices. Widget,
167
184
  card and island aliases reference those choices; no per-component radii.
168
- - Typography uses `--basalt-text-*` and `--basalt-leading-*`. Ordinary text is
169
- at least 11px reference, body/action 14px, code content 12px (`text-basalt-sm`),
170
- code panel titles 13px (`text-basalt-code`). Display headings use
171
- the shared larger scale. Do not shrink text to fit a fixed box.
172
- - Surfaces preserve the matte L0/L1/L2/L3 hierarchy. Controls use the
173
- surface-relative control fill. Hover uses `--basalt-hover`,
185
+ - Typography is positional, not component-specific. Use only the four font-size
186
+ tokens below, with `--basalt-leading-*` for line boxes. Do not shrink text to
187
+ fit a fixed box or introduce responsive intermediate sizes.
188
+
189
+ | Tier | Reference | Token / utility | Roles |
190
+ | --- | --- | --- | --- |
191
+ | Auxiliary | 12px / `.75rem` | `--basalt-text-sm` / `text-basalt-sm` | Badges, table column headers, field hints/errors, sidebar uppercase group/partition labels, secondary metadata, chart axes/legends/tooltips, inline code and code block source (`font-mono`) |
192
+ | Body | 14px / `.875rem` | `--basalt-text-base` / `text-basalt-base` | Body prose, all interactive controls and option rows (including ApprovalCard, RecommendationCard, Table cells and ContextCards), card/panel titles (LayerCard.Header, CodeBlock title, ContextCards header, StatCard title, Popover title and Empty title), PageHeader descriptions and modal/sheet descriptions (DialogDescription, AlertDialogDescription and SheetDescription) |
193
+ | Section | 18px / `1.125rem` | `--basalt-text-xl` / `text-basalt-xl` | Section/category h2/h3 headings, SectionRule variant="heading" h2, modal/drawer titles (DialogTitle, AlertDialogTitle and SheetTitle) |
194
+ | Page / metric | 24px / `1.5rem` | `--basalt-text-3xl` / `text-basalt-3xl` | Page main title (PageHeader h1) and primary KPI numerals (StatCard value, StatStrip value and dashboard metrics) |
195
+
196
+ The only independent display-scale exemptions are LandingPage
197
+ (`src/styles/landing.css`), LoginPage (`src/pages/LoginPage.tsx`) and the 404
198
+ display in NotFound (`src/pages/NotFound.tsx`, `text-basalt-10xl` only). Every
199
+ other `src/` font-size class must use one of the four canonical utilities.
200
+ - Surfaces preserve the matte L0/L1/L2/L3 hierarchy. LayerCard adds a subtle
201
+ `ring-1 ring-basalt-border/50` perimeter; `outlined` strengthens it. Headers
202
+ use 14px medium-weight foreground text with tight tracking. Controls contrast
203
+ with their parent: document/surface roots use `--basalt-secondary`, while cards
204
+ and deeper surfaces use `--basalt-bright` for their control fill. Hover uses `--basalt-hover`,
174
205
  `--basalt-primary-hover` or `--basalt-destructive-hover`, not caller opacity.
175
206
  - Semantic states, tags, data series and brand imagery may choose semantic
176
207
  palettes; keep foreground/background pairs and verify both themes. Centralize
@@ -184,12 +215,13 @@ interaction contracts; do not change their containment as a global workaround.
184
215
  lightness in dark mode), never the darker decorative `accent` or `muted` fill.
185
216
  Do not add decorative side bars, selection outlines, shadows or pseudo-element
186
217
  frames. Navigation uses foreground contrast and medium weight alongside fill;
187
- existing semantic checkmarks and tab underlines remain. Both primary and
188
- secondary text retain at least 4.5:1 contrast.
189
- - Hover is transient and follows the configured primary. `--basalt-hover` and
190
- `--basalt-hover-end` are complete CSS colors, mixed against the theme popover
191
- surface at 9.6%/4.8% in light mode and 16%/9.6% in dark mode. Moving menu and command
192
- highlights use a subtle gradient between them, without decorative borders.
218
+ existing semantic checkmarks and tab underlines remain. Underline tabs use
219
+ active foreground text and the bottom indicator only, without a rounded box
220
+ or selected background. Both primary and secondary text retain at least 4.5:1 contrast.
221
+ - Hover is transient and follows the configured primary. `--basalt-hover` is
222
+ a complete CSS color, mixed against `--basalt-surface-elevated` at 18% primary
223
+ in both light and dark modes. Moving menu and command highlights use
224
+ this uniform matte fill, without gradients or decorative borders.
193
225
  SegmentControl and ToggleGroup selected items use `--basalt-primary` and its
194
226
  contrast-corrected foreground; they are accent controls, not neutral navigation.
195
227
  Neutral row selection retains its independent selected tokens.
@@ -207,16 +239,20 @@ interaction contracts; do not change their containment as a global workaround.
207
239
  so overflow and collapsed groups cannot clip it. Disabled controls retain
208
240
  subdued opacity and cannot become moving-hover targets; selection never lowers
209
241
  opacity or mutes its primary label.
210
- - SidebarPartition is a major section label (12px, semibold, uppercase, 16px top
211
- spacing). SidebarGroup is a compact disclosure label (11px, semibold, uppercase,
212
- 22px line box, 8px inset, 12px group separation), not a destination or
213
- hover-highlight target. Ordinary sidebar destinations use 14px text and 8px
214
- row insets. Groups preserve keyboard expansion and chevron motion; collapsed
215
- rails omit labels. Icons stay centered on the 68px collapsed rail, and the brand
242
+ - SidebarPartition is a major section label (12px / `text-basalt-sm`, semibold,
243
+ uppercase, 16px top spacing). SidebarGroup is a compact disclosure label
244
+ (12px / `text-basalt-sm`, semibold, uppercase, 22px line box, 8px inset, 12px
245
+ group separation), not a destination or hover-highlight target. Ordinary sidebar
246
+ destinations use 14px (`text-basalt-base`) text and 8px row insets. Groups preserve
247
+ keyboard expansion and chevron motion; collapsed rails omit labels. Icons stay centered on the 68px collapsed rail, and the brand
216
248
  mark keeps the same center when expanded. Do not trade that axis for a global
217
249
  left-edge alignment.
218
250
  - Content wells use the actual surface hierarchy, not selected tokens or muted
219
251
  fills. Skeletons, progress tracks and decorative code marks may remain subdued.
252
+ Skeleton shimmer uses foreground at 10% opacity so it remains visible in both themes.
253
+ - The first eight numbered chart tokens resolve to distinct colors in both themes;
254
+ supplementary series use matte HSL values independently of the control accent.
255
+ Sparkline bars use uniform full opacity, never positional dimming.
220
256
 
221
257
  ## Motion and performance
222
258
 
@@ -259,19 +295,20 @@ catalog states and source viewers. Do not add a second `main`, viewport height,
259
295
  page background, wrapper card or page padding inside the island. A bounded chat
260
296
  workspace can use `h-full min-h-0`; it must not create a nested viewport.
261
297
 
262
- Every catalog route uses the same ShowcasePage header: 30px display titles,
263
- 16px descriptions on a 24px line box, 8px title separation and a 65ch maximum
264
- reading width. Page sections use 24px separation regardless of route category.
265
- The standalone PageHeader API retains its size choices for consumers, but catalog
266
- pages do not override the shared scale. ShowcasePage marks `variant="document"`
267
- for the library index, category guides, component documentation and source viewers.
298
+ Every catalog route uses the same ShowcasePage header: 24px main titles
299
+ (`text-basalt-3xl`), 14px descriptions (`text-basalt-base`) on a 20px line box,
300
+ 8px title separation and a 65ch maximum reading width. Page sections use 24px
301
+ separation regardless of route category. PageHeader size choices must preserve
302
+ the same positional font sizes; catalog pages do not override the shared scale.
303
+ ShowcasePage marks `variant="document"` for the library index, category guides,
304
+ component documentation and source viewers.
268
305
  The shell owns the complete breadcrumb trail from Dashboard through the library,
269
306
  category and component to the current route. Ancestors are links; the current
270
307
  route appears once as nonlinked text with aria-current. Source views include their
271
308
  component parent. Narrow headers keep every segment reachable by scrolling the
272
309
  breadcrumb region without overflowing the page.
273
- Document sections use `SectionRule variant="heading"`: 20px sentence-case
274
- headings without the compact dashed rule. Component previews retain their own
310
+ Document sections use `SectionRule variant="heading"`: 18px (`text-basalt-xl`)
311
+ sentence-case headings without the compact dashed rule. Component previews retain their own
275
312
  scope; document typography must not cascade into copied controls. Headers have
276
313
  natural height, no scenic wrappers, negative insets or fixed empty openings.
277
314
 
@@ -286,8 +323,10 @@ category uses LayerCard.Header above its grid, not individual cards per componen
286
323
  Its light surface is white-toned; dark mode uses the same surface hierarchy rather
287
324
  than a fixed white fill.
288
325
 
289
- Cards with headings use `LayerCard.Header` and `LayerCard.Body`; use one Body for
290
- related content with a shared internal gap, not a padded Body for every line.
326
+ Cards with distinct heading/body regions use `LayerCard.Header` and
327
+ `LayerCard.Body`; use one Body for related content with a shared internal gap,
328
+ not a padded Body for every line. Short overview prose blocks may keep their
329
+ heading and text in one unstructured card inset without Header/Body slots.
291
330
  Structured roots and slots must not receive extra outer padding or margins.
292
331
  Unstructured cards select `padding` rather than overriding it with utilities.
293
332
  Do not paint a fixed surface onto LayerCard or recreate cards with rounded,
@@ -295,6 +334,21 @@ painted divs. Use library controls and tables instead of rebuilding their spacin
295
334
  focus, selection and motion in page CSS. Semantic color overrides and purposeful
296
335
  chart/canvas geometry remain separate from shared control geometry.
297
336
 
337
+ ### Island hierarchy
338
+
339
+ The shell is L0 (`--basalt-background`). `ContentIsland` is the L1 gray canvas
340
+ (`--basalt-card`); its first `LayerCard` islands are L2 (`--basalt-secondary`),
341
+ white-toned in light mode and elevated in both themes.
342
+
343
+ Inside `ShowcasePage` / `ContentIsland`, only structural chrome sits directly on
344
+ L1: `PageHeader`, `SectionRule` headings, and top-level navigation tabs or filter
345
+ bars that are not attached to a single card. All substantive content blocks MUST
346
+ be encapsulated inside L2 `LayerCard` islands: rationales, guidelines, lists,
347
+ forms, interactive demos, tables, and empty or loading states. A region heading
348
+ does not make its content a surface. Revealed filter forms belong in a `LayerCard`,
349
+ not directly on the L1 canvas. Keep page and region headings outside the content
350
+ islands rather than wrapping the whole page in another card.
351
+
298
352
  ### Alignment hierarchy
299
353
 
300
354
  Alignment is local to a meaningful scope, not a requirement that every text node
@@ -309,20 +363,25 @@ start at the page edge. Establish the outer rail before composing the inner one:
309
363
 
310
364
  Related text keeps its rail across sorting, selection and missing optional icons.
311
365
  Numeric headings and values share the end rail; a sort glyph sits inward of that
312
- label rather than pushing it away from the values. Reserve the same glyph slot
366
+ label with a 4px gap rather than pushing it away from the values. Reserve the same glyph slot
313
367
  for Keep, Add and Remove instead of indenting only changed rows. Ordinary button
314
368
  padding is not a table-header inset. Preserve the focus target through a shared
315
369
  header control rather than compensating with negative page margins.
316
370
 
317
- Table cells keep 8px horizontal / 6px vertical insets and 36px reference rows.
371
+ Table cells keep 12px horizontal / 8px vertical insets and 40px reference rows.
372
+ Headers use medium weight and 0.04em tracking. Body rows have a subtle bottom
373
+ hairline except the last row; the native separate-border layout paints that
374
+ hairline on cells as well. Striping is off by default; `Table striped` opts into
375
+ alternating current-surface row fills, independently of hover and selection.
318
376
  An edge attached to a panel uses `--basalt-space-table-edge` (the panel's 16px
319
- horizontal inset), independently of the space between columns. The owner of the
320
- column structure marks the actual edge cells; DOM first/last-child selectors
321
- cannot infer that boundary across rowSpan. DataTable owns this through
322
- `edge="attached"`; native Table compositions use `ps-basalt-table-edge` and
323
- `pe-basalt-table-edge` only on the corresponding edge cells. A full-width cell
324
- uses both. Row fills and header rules remain full width, and nested tables keep
325
- their own insets. An already inset table retains the default cell spacing.
377
+ horizontal inset), independently of the space between columns. DataTable owns
378
+ this through `edge="attached"`; native Table compositions can use
379
+ `ps-basalt-table-edge` and `pe-basalt-table-edge` on the corresponding edge cells.
380
+ A full-width cell uses both. Simple tables without rowSpan or nested tables may
381
+ instead opt into automatic first/last-cell alignment through a wrapper marked
382
+ `data-basalt-table-container` and `data-edge="attached"`. The column owner must
383
+ mark actual edge cells explicitly for rowSpan or nested tables. Row fills and
384
+ header rules remain full width. An already inset table retains the default cell spacing.
326
385
  TableCaption owns its 16px horizontal and 12px vertical panel insets, without an
327
386
  outside margin. Its text must not touch an enclosing table frame's bottom edge.
328
387
 
@@ -379,7 +438,10 @@ to recreate ordinary actions, selects or inputs.
379
438
  `bun run design:check` scans library components/helpers and catalog examples,
380
439
  including CSS, for raw spacing/type/radius/motion values, fixed action overrides
381
440
  and inline design repairs. The landing route's own CSS is exempt from the spacing,
382
- radius and type rules and still keeps motion tokens. It derives dashboard page requirements from App routes
441
+ radius and type rules and still keeps motion tokens. Noncanonical Basalt font-size
442
+ classes are rejected, including responsive and important variants; only NotFound's
443
+ `text-basalt-10xl` and LoginPage's independent scale are exempt from the source
444
+ font-size check. It derives dashboard page requirements from App routes
383
445
  and checks template ownership, duplicate slot spacing, recreated card surfaces,
384
446
  ordinary native controls in pages and page-level control padding overrides.
385
447
  It rejects compact control padding on content panels, raw application disclosures,
package/ai/USAGE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Basalt AI & Machine Usage Guide
2
2
 
3
- This document describes how AI code assistants, automated agents, and developers can consume `@nocoo/basalt` (v3.1.0).
3
+ This document describes how AI code assistants, automated agents, and developers can consume `@nocoo/basalt` (v3.2.0).
4
4
 
5
5
  ---
6
6