basalt-ui 2.6.1 → 2.7.1
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/AGENTS.md +15 -15
- package/CHANGELOG.md +26 -0
- package/MIGRATING.md +47 -12
- package/agent/rules/basalt-batteries.md +3 -3
- package/agent/rules/basalt-controls.md +3 -3
- package/agent/skills/basalt-app/SKILL.md +44 -0
- package/configs/oxlint-plugin.js +48 -0
- package/configs/oxlint-plugin.test.ts +82 -0
- package/dist/charts/DualPanel.d.ts +1 -1
- package/dist/charts/DualPanel.d.ts.map +1 -1
- package/dist/charts/DualPanel.js +2 -1
- package/dist/charts/legend.d.ts +9 -1
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +3 -2
- package/dist/commands/define-overlays.d.ts +5 -0
- package/dist/commands/define-overlays.d.ts.map +1 -1
- package/dist/commands/define-overlays.js +2 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/notifications/define-notifications.d.ts +3 -0
- package/dist/commands/notifications/define-notifications.d.ts.map +1 -1
- package/dist/controls/form-layout.d.ts +15 -6
- package/dist/controls/form-layout.d.ts.map +1 -1
- package/dist/forms/field.d.ts +42 -2
- package/dist/forms/field.d.ts.map +1 -1
- package/dist/forms/field.js +2 -2
- package/dist/forms/index.d.ts +4 -5
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/surfaces.d.ts +2 -2
- package/dist/surfaces.js +2 -2
- package/dist/table/data-table.d.ts +37 -0
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +100 -17
- package/dist/table/index.d.ts +1 -0
- package/dist/table/index.d.ts.map +1 -1
- package/llms.txt +238 -5
- package/package.json +1 -1
- package/src/charts/DualPanel.tsx +5 -3
- package/src/charts/legend.tsx +16 -5
- package/src/commands/define-overlays.ts +5 -0
- package/src/commands/index.ts +4 -0
- package/src/commands/notifications/define-notifications.ts +3 -0
- package/src/controls/form-layout.tsx +15 -6
- package/src/forms/field.ts +78 -3
- package/src/forms/index.ts +4 -5
- package/src/surfaces.ts +2 -2
- package/src/table/data-table.tsx +175 -17
- package/src/table/index.ts +2 -0
package/AGENTS.md
CHANGED
|
@@ -13,21 +13,21 @@ Everything else is internal: `./guard`, `./theme-lab`, `./data/virtual`, `./toke
|
|
|
13
13
|
and `./package.json` are **not exports** (`llms.txt` still ships in the tarball as a file;
|
|
14
14
|
`basalt-ui tokens:css` emits the token stylesheet).
|
|
15
15
|
|
|
16
|
-
| Subpath | Layer | Purpose
|
|
17
|
-
| -------------------------- | --------------- |
|
|
18
|
-
| `basalt-ui` | mantine-coupled | Wiring (`BasaltProvider`, `createBasaltTheme`, `createBasaltRouter`, `unwrap`), shell + nav (`BasaltShell`, `PageBar`, `PageAside`, `PageTitle`, `ThemeToggle`, `defineNav`/`navGroup`/`navTarget`/`flattenNav`, `useBasaltNav`, `useSizeClass`, `useCoarsePointer`), dashboard (`Section`, `WidgetHeader`, `StatCard`, `StatGroup`, `DeltaBadge`, `EmptyState`, `SettingsSection`/`SettingsRow`/`DangerZone`). Reaches no subpath-required peer.
|
|
19
|
-
| `basalt-ui/charts` | headless | CartesianChart (the TanStack Charts rung), the Lines and Bars kinds, ChartCard and the shared chartCursor (Mantine-free; @tanstack/charts + d3-scale peers)
|
|
20
|
-
| `basalt-ui/tokens` | headless | VX token refs, buildPaletteCss, defineSeries, seriesTokens, groupTokens, alpha (Mantine-free)
|
|
21
|
-
| `basalt-ui/vite` | build-tooling | basaltViteConfig(opts) — Vite preset for basalt-ui consumer apps; basaltAppPlugin(opts) — PWA head, manifest, and icon metadata derived from the token palette
|
|
22
|
-
| `basalt-ui/format` | headless | integer/money/percent/durationClock/relativeTime/weekday/km/kcal — Intl-backed, Mantine-free, React-free formatting; the chart layer formats through the same implementation
|
|
23
|
-
| `basalt-ui/forms` | mantine-coupled | Mantine form layer: useBasaltForm + inputProps/fieldKey (two calls — a spread `key` is a React 19 warning), on @mantine/form
|
|
24
|
-
| `basalt-ui/commands` | mantine-coupled | defineCommands (typed command bus), defineOverlays/overlays, setColorScheme, toggleSidebar, ShortcutsHelp, defineNotifications/emit/NotificationBell (folded in from ./notifications); BasaltProvider mounts Spotlight, Modals and Notifications
|
|
25
|
-
| `basalt-ui/table` | mantine-coupled | BasaltDataTable and createColumnHelper: a data table over TanStack Table v9, rendered with Mantine (renamed from ./data/table)
|
|
26
|
-
| `basalt-ui/agent` | mantine-coupled | Streaming-chat surface: aiSdkTransport, useAgentThreadRuns, parseAgentPart, the open part-registry types, the consumer-owned thread contracts (AgentThread/ThreadsStore/ChatMessage), and the Mantine chat UI folded in from ./agent-chat (ThreadFeed, ThreadFeedRow, Composer, ToolChip). motion is subpath-required: the chat UI imports it eagerly
|
|
27
|
-
| `basalt-ui/content` | mantine-coupled | Prose (article/chat typography), Callout, TableOfContents, Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY — `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust="untrusted"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering — settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) — the content/prose surface
|
|
28
|
-
| `basalt-ui/controls` | mantine-coupled | The control tier (docs/CONTROLS-SPEC.md §3): FilterSet (nowrap row + measured +N fold + the mobile Filters (n) sheet), RangeFilter
|
|
29
|
-
| `basalt-ui/controls-dates` | mantine-coupled | DateRangePicker — the @mantine/dates implementation of RangeFilter's customPicker seam. Its own subpath because @mantine/dates is an optional peer and basaltViteConfig pre-bundles the whole @mantine scope, so a consumer without the peer (linewatch) must never resolve it: nothing under src/controls may import it, statically or lazily (docs/CONTROLS-SPEC.md §3).
|
|
30
|
-
| `basalt-ui/state` | headless | field.enum/multi/range/number/boolean/string (the store field vocabulary), createSearchStore (typed URL > localStorage > fallback store), createLocalStore (the router-free store), createPersistedState (versioned localStorage)
|
|
16
|
+
| Subpath | Layer | Purpose |
|
|
17
|
+
| -------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| `basalt-ui` | mantine-coupled | Wiring (`BasaltProvider`, `createBasaltTheme`, `createBasaltRouter`, `unwrap`), shell + nav (`BasaltShell`, `PageBar`, `PageAside`, `PageTitle`, `ThemeToggle`, `defineNav`/`navGroup`/`navTarget`/`flattenNav`, `useBasaltNav`, `useSizeClass`, `useCoarsePointer`), dashboard (`Section`, `WidgetHeader`, `StatCard`, `StatGroup`, `DeltaBadge`, `EmptyState`, `SettingsSection`/`SettingsRow`/`DangerZone`). Reaches no subpath-required peer. |
|
|
19
|
+
| `basalt-ui/charts` | headless | CartesianChart (the TanStack Charts rung), the Lines and Bars kinds, ChartCard and the shared chartCursor (Mantine-free; @tanstack/charts + d3-scale peers) |
|
|
20
|
+
| `basalt-ui/tokens` | headless | VX token refs, buildPaletteCss, defineSeries, seriesTokens, groupTokens, alpha (Mantine-free) |
|
|
21
|
+
| `basalt-ui/vite` | build-tooling | basaltViteConfig(opts) — Vite preset for basalt-ui consumer apps; basaltAppPlugin(opts) — PWA head, manifest, and icon metadata derived from the token palette |
|
|
22
|
+
| `basalt-ui/format` | headless | integer/money/percent/durationClock/relativeTime/weekday/km/kcal — Intl-backed, Mantine-free, React-free formatting; the chart layer formats through the same implementation |
|
|
23
|
+
| `basalt-ui/forms` | mantine-coupled | Mantine form layer: useBasaltForm + inputProps/fieldKey (two calls — a spread `key` is a React 19 warning), on @mantine/form |
|
|
24
|
+
| `basalt-ui/commands` | mantine-coupled | defineCommands (typed command bus), defineOverlays/overlays (a form dialog is a registered overlay opened with overlays.open), setColorScheme, toggleSidebar, ShortcutsHelp, defineNotifications/emit/NotificationBell (emit only accepts kinds registered in defineNotifications; folded in from ./notifications); BasaltProvider mounts Spotlight, Modals and Notifications |
|
|
25
|
+
| `basalt-ui/table` | mantine-coupled | BasaltDataTable and createColumnHelper: a data table over TanStack Table v9, rendered with Mantine (renamed from ./data/table) |
|
|
26
|
+
| `basalt-ui/agent` | mantine-coupled | Streaming-chat surface: aiSdkTransport, useAgentThreadRuns, parseAgentPart, the open part-registry types, the consumer-owned thread contracts (AgentThread/ThreadsStore/ChatMessage), and the Mantine chat UI folded in from ./agent-chat (ThreadFeed, ThreadFeedRow, Composer, ToolChip). motion is subpath-required: the chat UI imports it eagerly |
|
|
27
|
+
| `basalt-ui/content` | mantine-coupled | Prose (article/chat typography), Callout, TableOfContents, Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY — `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust="untrusted"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering — settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) — the content/prose surface |
|
|
28
|
+
| `basalt-ui/controls` | mantine-coupled | The control tier (docs/CONTROLS-SPEC.md §3). Exports: `FilterSet` (nowrap row + measured +N fold + the mobile Filters (n) sheet), `RangeFilter`/`SelectFilter`/`MultiSelectFilter`/`NumberFilter`/`SearchFilter`/`ToggleFilter` (each bound to a FieldHandle — no value/onChange/size, law C2/C5; `NumberFilter` is the field.number lane, a radio list over `options` or a stepper without), `ViewTabs`, `SyncButton` with the `BarAction`/`GlobalAction` types, and the form layout `FormRow`/`FormGroup` (moved here from ./forms in 1.36.0 — `FormRow` is law C1’s form row and needs no @mantine/form). THREE surfaces, picked by the home and never by a prop: pill in a PageBar row, sheet in the mobile Filters (n) drawer, panel in a PageAside body — where every control renders an inspector/facet ROW instead of a chip (docs/ASIDE-SPEC.md §3); the counts/max props on `MultiSelectFilter` render the Foundry facet list there. Every control owns its own desktop/mobile swap in CSS (C9) and renders size="ctl" internally. Resolves and renders with NO @mantine/dates installed — the custom date picker is injected through RangeFilter.customPicker from ./controls-dates. |
|
|
29
|
+
| `basalt-ui/controls-dates` | mantine-coupled | DateRangePicker — the @mantine/dates implementation of RangeFilter's customPicker seam. Its own subpath because @mantine/dates is an optional peer and basaltViteConfig pre-bundles the whole @mantine scope, so a consumer without the peer (linewatch) must never resolve it: nothing under src/controls may import it, statically or lazily (docs/CONTROLS-SPEC.md §3). |
|
|
30
|
+
| `basalt-ui/state` | headless | field.enum/multi/range/number/boolean/string (the store field vocabulary), createSearchStore (typed URL > localStorage > fallback store), createLocalStore (the router-free store), createPersistedState (versioned localStorage) |
|
|
31
31
|
|
|
32
32
|
Also published, but not JS subpaths: `basalt-ui/styles.css` (the one stylesheet: `@layer mantine, basalt;`, then `@import`s of `@mantine/{core,notifications,spotlight}/styles.layer.css`, then basalt's own layer) and `basalt-ui/configs/*` (raw oxlint / tsconfig / lefthook / oxfmt presets).
|
|
33
33
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## [2.7.1](https://github.com/jkrumm/basalt-ui/compare/v2.7.0...v2.7.1) (2026-10-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* document the form dialog and notification seams in the shipped layer ([5836d52](https://github.com/jkrumm/basalt-ui/commit/5836d52579f6d20781823fffd74e6d444084ff73))
|
|
7
|
+
* name the form dialog and notification seams in the commands description ([8ec0ef0](https://github.com/jkrumm/basalt-ui/commit/8ec0ef043019271f8379e72edec47209e3bff0f1))
|
|
8
|
+
* scope the signed swatch to the DualPanel bar and harden its tests ([c840048](https://github.com/jkrumm/basalt-ui/commit/c840048e2f6b2a125650b9bc49b8b35f40421041))
|
|
9
|
+
* signed bar legends get a split swatch and DataTableRowAction is exported ([6602b3c](https://github.com/jkrumm/basalt-ui/commit/6602b3c86f4d5229f98c834ea4c68e42f8a70a5d))
|
|
10
|
+
|
|
11
|
+
# [2.7.0](https://github.com/jkrumm/basalt-ui/compare/v2.6.1...v2.7.0) (2026-10-15)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* every export named in llms.txt and d.ts headers exists, with props ([7bc783f](https://github.com/jkrumm/basalt-ui/commit/7bc783f0c19330a3e2d22ae3eec5cbbfd8e75ec6))
|
|
17
|
+
* make the doc-name check fail closed and test the props block ([44c0f00](https://github.com/jkrumm/basalt-ui/commit/44c0f00f08efce122bca079358ad396dc5bbc976))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* a typed per-row action seam on BasaltDataTable ([23cc77b](https://github.com/jkrumm/basalt-ui/commit/23cc77be8b2581a8142dd1325912be7568d0b89e))
|
|
23
|
+
* checkbox and switch bindings and typed field errors in basalt-ui/forms ([0041e51](https://github.com/jkrumm/basalt-ui/commit/0041e511d8895fb6f14c856c772aad06240e8964))
|
|
24
|
+
* rowActions loading, per-row names and a sharper row-action lint ([1e0fa59](https://github.com/jkrumm/basalt-ui/commit/1e0fa59f7779dd6b58185bf7cf4451c2704d47fe))
|
|
25
|
+
* type the checkbox binding strictly and export InputProps ([a3538ab](https://github.com/jkrumm/basalt-ui/commit/a3538abeb028f8585c93c01c1d9aa50350a6eeaf))
|
|
26
|
+
|
|
1
27
|
## [2.6.1](https://github.com/jkrumm/basalt-ui/compare/v2.6.0...v2.6.1) (2026-10-15)
|
|
2
28
|
|
|
3
29
|
|
package/MIGRATING.md
CHANGED
|
@@ -66,18 +66,18 @@ There is one row per SURFACE, not per export, and a surface earns a row once any
|
|
|
66
66
|
shipped lefthook preset both changed in 1.30.0 with no row that owned them — which is how a
|
|
67
67
|
consumer read this index, found nothing, and diffed a KPI row that had silently gone 4-up → 2-up.
|
|
68
68
|
|
|
69
|
-
| Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | Unreleased |
|
|
70
|
-
| ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
71
|
-
| **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
72
|
-
| **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
73
|
-
| **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
74
|
-
| **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
75
|
-
| **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
76
|
-
| **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
77
|
-
| **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
78
|
-
| **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
79
|
-
| **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
80
|
-
| **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
69
|
+
| Surface | 1.27.0 | 1.28.0 | 1.29.0 | 1.30.0 | 1.30.1 | 1.30.2 | 1.31.0 | 1.32.0 | 1.32.1 | 1.33.0 | 1.34.0 | 1.34.1 | 1.35.0 | 1.36.0 | 1.36.1 | 1.37.0 | 1.37.1 | 1.38.0 | 1.38.1 | 1.39.0 | 1.40.0 | 1.40.1 | 1.40.2 | 1.40.3 | 1.41.0 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.1.0 | 2.2.0 | 2.3.0 | 2.4.0 | 2.5.0 | 2.6.0 | 2.6.1 | 2.7.0 | 2.7.1 | Unreleased |
|
|
70
|
+
| ----------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------- | ------ | ------ | -------------------------------------------------------------------------------------------- | ------ | ------ | ------ | ------ | ------ | ----------------------------------------------- | ------ | ------ | ------ | ------ | ------------------------------------------------------------ | ---------- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
71
|
+
| **tokens** (`./tokens`) | — | `--vx-divider` → `rgba()` on both schemes (§ Shell) | `--vx-space-touch-target` added (§ Additions) | eight spacing numbers (§ Chrome) | — | — | `--vx-hit` replaces the touch vars; `SIZE_CLASSES` (§ 1.31.0) | — | `SIZE_CLASSES`/`CONTAINER_CLASSES` actually exported (§ Fixes) | `CONTAINER_GRID_BREAKPOINTS`; `raw-breakpoint` trusts it (§ 1.33.0) | `CONTAINER_KEYS` (§ 1.34.0) | — | — | — | — | — | — | — | | `appShellInset` 20 → 16 (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
72
|
+
| **charts** (`./charts`) | — | phone tier, `curve`, formatters, `state`, log axis (§ preamble) | `ChartState.empty: string`, `AxisBottomNumeric` (§ Additions) | responsive `height`, `legend.maxRows` (§ Charts) | `height` reaches the kinds; `maxRows` beats the `fill` fit (§ Charts) | — | container-class tier + `height` keys (§ 1.31.0) | — | `ResponsiveChartHeight` `sm` → key (§ Container recipes) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
73
|
+
| **shell** (`.`) | — | scrollport, region seams, **the brand left the sidebar** (§§ scrollport, brand, Shell) | `PageTitle`, `BasaltDevDock`, `useBreakpoint` (§ Additions) | More popover, aside pill, the responsive gutter, `useBasaltSpacing` (§ Chrome) | — | — | `theme.breakpoints` derived, `useSizeClass`, `data-basalt-host`, `useBreakpoint` on notice (§ 1.31.0) | `useBreakpoint` removal → 1.33.0; `useSizeClass` is shell-only (§ 1.32.0) | shell-less `shell/` gutter, `AppShell` breakpoints, `useSizeClass` for overlays (§§ Shell-less, `useSizeClass`) | — | `useBreakpoint` removed (§ 1.34.0) | — | — | `useCoarsePointer()` (§ `useCoarsePointer()`) | — | — | — | — | | content gutter 16, block 8 from `sm` (§ 1.38.1) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
74
|
+
| **controls** (`./controls`) | `NumberFilter`, `field.number` (§ Controls) | sheet renders panel rows; `PanelRow`, `SliderControl` (§ `basalt-ui/controls`) | — | — | — | — | — | — | — | `NumberFilter clearable`; `createSearchStore` `resets` (§ State and controls) | — | — | — | `FormSection`/`FormRow`/`FormGroup`/`FormActions` move here (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
75
|
+
| **forms** (`./forms`) | — | `field` → `inputProps`, **`inputProps` drops `key`**, the layout tier (§ `inputProps`) | `field` DELETED — and the `--fix` recipe no longer works (§ Consolidation) | — | — | — | — | — | `FormGroup` row no longer stretches (§ Fixes) | — | — | — | — | the layout + `useForm`/`schemaResolver` deprecated, removed 1.37.0 (§ The form layout moves) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
76
|
+
| **data** (`./data/table`) | — | root is a `<div>`, row selection, `getItemKey` required (§ `basalt-ui/data`) | `./data` + `./query` + `./connectivity` dropped (§ Consolidation) | — | — | — | — | — | `renderCard` documented (§ `renderCard`) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
77
|
+
| **dashboard** (`.`) | `StatCard`: `unit`, `breakdown`, delta format (§ `StatCard`) | `StatGroup`, `WidgetGrid`, query-aware `StatCard` — additive | — | **the column law keys on the CONTAINER; `cols={4}` is 2-up at `sm`** (§ Dashboard) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
78
|
+
| **toolchain** (`./configs/*`) | — | — | the shipped lefthook preset's `check-theme` BROKE — the CLI resolver stopped ascending (§ CLI) | the preset's default bin, and the `root:` recipe (§ Toolchain) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
79
|
+
| **CLI** (`basalt-ui`) | — | — | **resolver stops relocating; `doctor` loses 6 of 10 checks** (§ CLI) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | the managed block moves `CLAUDE.md` → `AGENTS.md` (§ 1.41.0) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
80
|
+
| **guards** | five rules → `error` (§ Guards) | six new ids at `warn` (§ preamble) | `query-dual-import` retired in 1.29.1 (§ Guards) | four rules → `error` (§ Guards) | — | — | — | `raw-breakpoint`: the container-grid answer, `error` at 1.33.0 (§ 1.32.0) | `FormRow`/`FormGroup` homes in both lanes; `basalt-main` dropped (§ Fixes) | C1 + breakpoint pairs → `error`; `unknown-vx-token` `warn` (§ Guards) | — | — | — | `unknown-vx-token` → `error`; the token factories throw (§ Guards) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — |
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
@@ -992,6 +992,41 @@ optional, subpath-required peers.
|
|
|
992
992
|
_Nothing yet. Author the next section under this heading as `## Unreleased — <title>`; the
|
|
993
993
|
release renames it and opens a new one here._
|
|
994
994
|
|
|
995
|
+
## 2.7.1 — signed bar legend, DataTableRowAction export
|
|
996
|
+
|
|
997
|
+
- `DualPanel`'s bar legend entry is a split swatch (`positive` | `negative`) instead of the positive
|
|
998
|
+
colour alone (argo friction row 52) — a visual change on every `DualPanel`, since the bar is
|
|
999
|
+
always sign-coloured. Still one entry and one toggle: the sign halves hide together, because a
|
|
1000
|
+
sign is a property of a datum, not a series. No prop changes; plain `Bars` is unaffected.
|
|
1001
|
+
- `DataTableRowAction<T>` is now actually exported from `basalt-ui/table` (argo friction row 53);
|
|
1002
|
+
§ 2.7.0 said it was, and it was not (TS2305).
|
|
1003
|
+
|
|
1004
|
+
## 2.7.0 — table row actions, checkbox bindings, typed field errors
|
|
1005
|
+
|
|
1006
|
+
- `BasaltDataTable` takes `rowActions` (argo friction row 48): typed data in `BarActionItem`'s
|
|
1007
|
+
vocabulary — `{ key, label, icon?, onClick(row), danger?, disabled?(row), loading?(row) }`. The table appends a
|
|
1008
|
+
trailing, end-pinned, header-less column (sr-only "Actions") and renders an icon button for one
|
|
1009
|
+
action with an `icon`, an overflow menu (`Row actions`) otherwise. A click never reaches
|
|
1010
|
+
`onRowActivate`. The column renders in the table body only; a `renderCard` card owns its own.
|
|
1011
|
+
A disabled or loading action never fires. Each trigger is named per row (`Row N actions`, or
|
|
1012
|
+
`rowLabel(row)` when given). Pass a stable `rowActions` reference (module constant or `useMemo`).
|
|
1013
|
+
`DataTableRowAction<T>` is exported beside `DataTableFacet` from the module; no value export is added.
|
|
1014
|
+
- `basalt/control-outside-home` now also flags a Mantine `Menu`/`ActionIcon` inside a column
|
|
1015
|
+
`cell`/`display` renderer, and the `basalt-controls` Homes rule names `rowActions`. Existing
|
|
1016
|
+
hand-rolled action cells will start to report: move them to `rowActions`, or waive with
|
|
1017
|
+
`theme-allow control-outside-home`.
|
|
1018
|
+
- On notice (adopt-or-delete): named consumers are argo's `strength-tracker/components/workouts-table.tsx`
|
|
1019
|
+
(Edit + Delete) and `body-composition/components/skinfold-history-table.tsx` (Delete); neither
|
|
1020
|
+
has migrated yet. Their delete icons pass `loading`, which `loading(row)` now models.
|
|
1021
|
+
- `basalt-ui/forms`: `inputProps(form, path, { type: 'checkbox' })` binds a boolean field to Mantine
|
|
1022
|
+
`Checkbox`/`Switch` (`defaultChecked` + `onChange` in the default uncontrolled mode, `checked` under
|
|
1023
|
+
`mode: 'controlled'`). It type-checks only on a literal path whose value is a boolean (dot paths,
|
|
1024
|
+
array indices, optional/nullable booleans included). Additive.
|
|
1025
|
+
- `inputProps(...).error` narrowed from `any` to `ReactNode` (the key is always present, `undefined`
|
|
1026
|
+
on a clean field). Read a field error there instead of `form.errors.x` (TS4111), and pass it to
|
|
1027
|
+
`FormRow error` for a raw control. Code that treated it as `any` (a string method call, a
|
|
1028
|
+
`Record` index) now needs a narrowing. The new `InputProps` type is exported from `basalt-ui/forms`.
|
|
1029
|
+
|
|
995
1030
|
## 2.6.1 — per-bar legend shades
|
|
996
1031
|
|
|
997
1032
|
- `Bars`: a legend swatch now wears the shade its bars draw. It samples `barOpacity(firstRow, key)`,
|
|
@@ -20,10 +20,11 @@ paths:
|
|
|
20
20
|
|
|
21
21
|
- Wrap every API-client `queryFn` response in `unwrap()` from `basalt-ui` (it throws on the error branch and on `null` data); a mock returning plain data needs none, and the lint sees only an inline `queryFn` calling `fetch(`. [basalt/query-fn-unwrap]
|
|
22
22
|
- The client comes from `createBasaltRouter`; extend it via its `query:` option. [type createBasaltRouter]
|
|
23
|
+
- Register every kind in `defineNotifications` (augment `BasaltRegister` `notifications`) before calling `emit('kind', payload)`; an unregistered kind is a type error. [type emit]
|
|
23
24
|
|
|
24
25
|
## Forms
|
|
25
26
|
|
|
26
|
-
- A field is two calls: `key={fieldKey(form, path)}` and `{...inputProps(form, path)}`, from `basalt-ui/forms`. [basalt/forms-field-key]
|
|
27
|
+
- A field is two calls: `key={fieldKey(form, path)}` and `{...inputProps(form, path)}`, from `basalt-ui/forms`. [basalt/forms-field-key] A boolean field (`Checkbox`/`Switch`) adds `{ type: 'checkbox' }`; read a field error as `inputProps(form, path).error`, never `form.errors.x` (TS4111), and hand it to `FormRow error` only for a raw control. [type inputProps]
|
|
27
28
|
- `useBasaltForm` takes a Standard Schema validator, not a `ZodSchema`. [type useBasaltForm]
|
|
28
29
|
|
|
29
30
|
## Table
|
|
@@ -37,6 +38,5 @@ paths:
|
|
|
37
38
|
## Agent
|
|
38
39
|
|
|
39
40
|
- Chat uses `basalt-ui/agent` (`useAgentThreadRuns`, `ThreadFeed`, `Composer`); never `useChat` or `Chat` from `@ai-sdk/react`. [basalt/agent-no-raw-usechat]
|
|
40
|
-
- Keep `ai` and `@ai-sdk/*` on one major across packages
|
|
41
|
+
- Keep `ai` and `@ai-sdk/*` on one major across packages; an intentional split is waived with `basalt-agent-allow`, never `theme-allow`. [basalt/ai-sdk-major]
|
|
41
42
|
- End every switch over `AgentPart` with `default: return part satisfies never`. [type AgentPart]
|
|
42
|
-
- An intentional `ai` major split is waived with `basalt-agent-allow`, never `theme-allow`. [basalt/ai-sdk-major]
|
|
@@ -21,15 +21,15 @@ A control has one home and takes its state from a store field; the home sets its
|
|
|
21
21
|
|
|
22
22
|
## Homes
|
|
23
23
|
|
|
24
|
-
- A control lives in exactly one home: a `PageBar` slot (`actions`, `sync`, `filters`, `filtersEnd`, `tabs`), a `Section` slot (`actions`, `tabs`), a `WidgetHeader`/`ChartCard`/`StatCard`/`BasaltDataTable` `actions` slot, or a form row (`SettingsRow.control`, `FormRow`, `FormGroup`). [basalt/control-outside-home]
|
|
24
|
+
- A control lives in exactly one home: a `PageBar` slot (`actions`, `sync`, `filters`, `filtersEnd`, `tabs`), a `Section` slot (`actions`, `tabs`), a `WidgetHeader`/`ChartCard`/`StatCard`/`BasaltDataTable` `actions` slot, or a form row (`SettingsRow.control`, `FormRow`, `FormGroup`). A per-row action is `BasaltDataTable rowActions` (typed data: `label`, `icon`, `onClick(row)`, `danger`, `disabled(row)`), never a `Menu`/`ActionIcon` in a column `cell`/`display` renderer. [basalt/control-outside-home]
|
|
25
25
|
- A raw Mantine selection control (`Select`, `SegmentedControl`, …) in a home slot is a filter without a `field`. [basalt/hand-rolled-filter] [check-theme raw-selection-control]
|
|
26
26
|
- A basalt filter outside a slot, `FilterSet`, `PageAside` or form row has no home. [basalt/bound-control-outside-home]
|
|
27
|
-
- `PageBar` `actions` holds at most 5 entries with exactly one `primary`. [type PageBar]
|
|
28
|
-
- A `Section` holds at most 3 `actions`. [type Section]
|
|
27
|
+
- `PageBar` `actions` holds at most 5 entries with exactly one `primary`; a `Section` holds at most 3 `actions`. [type PageBar] [type Section]
|
|
29
28
|
- A control in a home slot carries no `size`, `w`, `fullWidth`, `visibleFrom` or `hiddenFrom`; the home sizes it. [basalt/control-size-literal]
|
|
30
29
|
- Never render the same control twice under `visibleFrom`/`hiddenFrom`; the control swaps itself in CSS. [basalt/responsive-twin]
|
|
31
30
|
- A section, card or table title is a `WidgetHeader`; no in-body `<Title order={1|2}>`. [basalt/in-body-page-title]
|
|
32
31
|
- An overlay rendered by the parent lives in a file named `*-{modal,drawer,popover,panel,form}.tsx`, or opts out with `theme-allow-file control-outside-home — overlay`. [basalt/control-outside-home]
|
|
32
|
+
- A form dialog is a `defineOverlays` entry (augment `BasaltRegister` `overlays`) opened with `overlays.open('id', props)` from a row action; its component lives in a `*-modal.tsx`. [type overlays]
|
|
33
33
|
|
|
34
34
|
## Binding
|
|
35
35
|
|
|
@@ -83,6 +83,50 @@ export const Revenue = ({ rows }: { rows: Row[] }) => (
|
|
|
83
83
|
)
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
## Add a form dialog
|
|
87
|
+
|
|
88
|
+
A form dialog is a `defineOverlays` entry opened from a `BasaltDataTable` row action; success is an `emit` of a kind registered in `defineNotifications`. The form component lives in a `*-modal.tsx`:
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
// @check
|
|
92
|
+
import { Button, TextInput } from '@mantine/core'
|
|
93
|
+
import { defineNotifications, defineOverlays, emit, overlays } from 'basalt-ui/commands'
|
|
94
|
+
import { fieldKey, inputProps, useBasaltForm } from 'basalt-ui/forms'
|
|
95
|
+
|
|
96
|
+
export const NOTIFICATIONS = defineNotifications({
|
|
97
|
+
'item:saved': { intent: 'success', toMessage: (p: { name: string }) => `Saved ${p.name}` },
|
|
98
|
+
})
|
|
99
|
+
function ItemForm({ name }: { name: string }) {
|
|
100
|
+
const form = useBasaltForm({ initialValues: { name } })
|
|
101
|
+
const save = form.onSubmit((v) => {
|
|
102
|
+
overlays.close() // after the mutation succeeds
|
|
103
|
+
emit('item:saved', { name: v.name })
|
|
104
|
+
})
|
|
105
|
+
return (
|
|
106
|
+
<form onSubmit={save}>
|
|
107
|
+
<TextInput key={fieldKey(form, 'name')} {...inputProps(form, 'name')} label="Name" />
|
|
108
|
+
<Button type="submit">Save</Button>
|
|
109
|
+
</form>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
export const OVERLAYS = defineOverlays({
|
|
113
|
+
'item:edit': { title: 'Edit item', render: (p: { name: string }) => <ItemForm name={p.name} /> },
|
|
114
|
+
})
|
|
115
|
+
declare module 'basalt-ui' {
|
|
116
|
+
interface BasaltRegister {
|
|
117
|
+
notifications: typeof NOTIFICATIONS
|
|
118
|
+
overlays: typeof OVERLAYS
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// BasaltDataTable rowActions entry
|
|
122
|
+
export const editAction = {
|
|
123
|
+
key: 'edit',
|
|
124
|
+
label: 'Edit',
|
|
125
|
+
icon: <i />,
|
|
126
|
+
onClick: (row: { name: string }) => overlays.open('item:edit', { name: row.name }),
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
86
130
|
## Stream a slow section
|
|
87
131
|
|
|
88
132
|
The shell holds no promise; the loader returns the slow promise unawaited (settled, so a failure renders the chart's error state), and the fallback is the same chart pending (it fills the final box):
|
package/configs/oxlint-plugin.js
CHANGED
|
@@ -2527,6 +2527,41 @@ const CONTROL_OUTSIDE_HOME_MESSAGE =
|
|
|
2527
2527
|
'(Modal/Drawer/Popover/Menu) and a form (@mantine/form) are the declared non-homes and never ' +
|
|
2528
2528
|
`report. ${SHELL_LESS_HOME_HINT} (basalt/control-outside-home)`
|
|
2529
2529
|
|
|
2530
|
+
const ROW_ACTION_IN_CELL_MESSAGE =
|
|
2531
|
+
'A Mantine `Menu`/`ActionIcon` inside a column `cell`/`display` renderer is a per-row action with ' +
|
|
2532
|
+
'no home. Pass `BasaltDataTable rowActions={[{ key, label, icon, onClick: (row) => … }]}` — the ' +
|
|
2533
|
+
'table renders the trailing, pinned actions column, keyboard access and the no-row-activation ' +
|
|
2534
|
+
'guard itself. (basalt/control-outside-home)'
|
|
2535
|
+
|
|
2536
|
+
/** Tags that, in a column `cell` renderer, are a hand-rolled row action. */
|
|
2537
|
+
const ROW_ACTION_TAGS = new Set(['Menu', 'ActionIcon'])
|
|
2538
|
+
|
|
2539
|
+
/** An `ActionIcon` under a `Menu` is that menu's trigger: the `Menu` reports, once, for the pair. */
|
|
2540
|
+
const ROW_MENU_TAGS = new Set(['Menu'])
|
|
2541
|
+
|
|
2542
|
+
/**
|
|
2543
|
+
* True when `node` sits inside a function that is the value of a `cell:` property (a column def).
|
|
2544
|
+
* Only an INLINE renderer is seen: `cell: renderActions` (a reference to a function declared
|
|
2545
|
+
* elsewhere) is a cross-reference no single-file AST walk resolves — the same declared limit as
|
|
2546
|
+
* the rule's cross-file C1 gap.
|
|
2547
|
+
*/
|
|
2548
|
+
function insideCellRenderer(node) {
|
|
2549
|
+
let current = node.parent
|
|
2550
|
+
for (let depth = 0; current !== null && current !== undefined; depth++) {
|
|
2551
|
+
if (depth > ANCESTRY_MAX_DEPTH || current.type === 'Program') return false
|
|
2552
|
+
if (
|
|
2553
|
+
current.type === 'Property' &&
|
|
2554
|
+
(current.key?.name ?? current.key?.value) === 'cell' &&
|
|
2555
|
+
(current.value?.type === 'ArrowFunctionExpression' ||
|
|
2556
|
+
current.value?.type === 'FunctionExpression')
|
|
2557
|
+
) {
|
|
2558
|
+
return true
|
|
2559
|
+
}
|
|
2560
|
+
current = current.parent
|
|
2561
|
+
}
|
|
2562
|
+
return false
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2530
2565
|
/**
|
|
2531
2566
|
* The cross-file half of C1, and the one rule here that is openly a HEURISTIC: "this control has
|
|
2532
2567
|
* no home" is a claim about layout intent, which no AST can see. That is why it sat in grace from
|
|
@@ -2582,9 +2617,22 @@ const controlOutsideHome = {
|
|
|
2582
2617
|
name: node.name,
|
|
2583
2618
|
captured: slots.capture(node),
|
|
2584
2619
|
hosted: hasAncestorTag(node, CONTROL_HOST_TAGS),
|
|
2620
|
+
inCell: insideCellRenderer(node),
|
|
2621
|
+
inMenu: jsxTagName(node.name) !== 'Menu' && hasAncestorTag(node, ROW_MENU_TAGS),
|
|
2585
2622
|
})
|
|
2586
2623
|
},
|
|
2587
2624
|
'Program:exit'() {
|
|
2625
|
+
// Row actions first: a table file that imports `@mantine/form` or defines a basalt control
|
|
2626
|
+
// still hosts column cells, so neither file-level exemption applies to them. An already-homed
|
|
2627
|
+
// element (a form row, a menu dropdown, a slot) is still not a row action.
|
|
2628
|
+
for (const { node, name, captured, hosted, inCell, inMenu } of candidates) {
|
|
2629
|
+
if (!inCell || hosted || inMenu) continue
|
|
2630
|
+
const tag = resolveMantineTag(name, mantineImports)
|
|
2631
|
+
if (tag === undefined || !ROW_ACTION_TAGS.has(tag)) continue
|
|
2632
|
+
if (slots.resolve(captured) || slots.inSubtreeHome(captured)) continue
|
|
2633
|
+
if (hasThemeAllow(context, node, 'control-outside-home')) continue
|
|
2634
|
+
context.report({ node, message: ROW_ACTION_IN_CELL_MESSAGE })
|
|
2635
|
+
}
|
|
2588
2636
|
if (importsMantineForm || owner.isOwner()) return
|
|
2589
2637
|
for (const { node, name, captured, hosted } of candidates) {
|
|
2590
2638
|
const tag = resolveMantineTag(name, mantineImports)
|
|
@@ -1957,6 +1957,88 @@ describe('basalt/control-outside-home', () => {
|
|
|
1957
1957
|
expect(rules).toContain('control-outside-home')
|
|
1958
1958
|
})
|
|
1959
1959
|
|
|
1960
|
+
describe('a hand-rolled row action in a column cell', () => {
|
|
1961
|
+
const TABLE_IMPORT = `import { createColumnHelper } from 'basalt-ui/table'\n`
|
|
1962
|
+
const cell = (body: string) =>
|
|
1963
|
+
`${TABLE_IMPORT}${MANTINE_IMPORT}const col = createColumnHelper<Row>()\n` +
|
|
1964
|
+
`export const columns = [col.display({ id: 'a', cell: ({ row }) => ${body} })]\n`
|
|
1965
|
+
|
|
1966
|
+
it('flags a Mantine Menu in a col.display cell', () => {
|
|
1967
|
+
const { code, rules } = run(
|
|
1968
|
+
`import { Menu } from '@mantine/core'\n${cell('<Menu><Menu.Target><span /></Menu.Target></Menu>').replace(MANTINE_IMPORT, '')}`,
|
|
1969
|
+
)
|
|
1970
|
+
expect(code).toBe(1)
|
|
1971
|
+
expect(rules).toContain('control-outside-home')
|
|
1972
|
+
})
|
|
1973
|
+
|
|
1974
|
+
it('flags a Mantine ActionIcon in a cell renderer', () => {
|
|
1975
|
+
const { rules } = run(
|
|
1976
|
+
`import { ActionIcon } from '@mantine/core'\n${cell('<ActionIcon aria-label="x" />').replace(MANTINE_IMPORT, '')}`,
|
|
1977
|
+
)
|
|
1978
|
+
expect(rules).toContain('control-outside-home')
|
|
1979
|
+
})
|
|
1980
|
+
|
|
1981
|
+
it('does NOT flag a Menu outside a cell renderer', () => {
|
|
1982
|
+
const { rules } = run(
|
|
1983
|
+
`import { Menu } from '@mantine/core'\nexport const C = () => <Menu><Menu.Target><span /></Menu.Target></Menu>\n`,
|
|
1984
|
+
)
|
|
1985
|
+
expect(rules).not.toContain('control-outside-home')
|
|
1986
|
+
})
|
|
1987
|
+
|
|
1988
|
+
it('reports a hand-rolled Menu + ActionIcon trigger once, not twice', () => {
|
|
1989
|
+
const { output } = run(
|
|
1990
|
+
`import { ActionIcon, Menu } from '@mantine/core'\n${TABLE_IMPORT}const col = createColumnHelper<Row>()\n` +
|
|
1991
|
+
`export const columns = [col.display({ id: 'a', cell: () => (\n` +
|
|
1992
|
+
` <Menu><Menu.Target><ActionIcon aria-label="x" /></Menu.Target></Menu>\n) })]\n`,
|
|
1993
|
+
)
|
|
1994
|
+
expect(output.match(/\(basalt\/control-outside-home\)/g)).toHaveLength(1)
|
|
1995
|
+
})
|
|
1996
|
+
|
|
1997
|
+
it('does NOT flag an ActionIcon already homed in a form row inside a cell', () => {
|
|
1998
|
+
const { rules } = run(
|
|
1999
|
+
`import { ActionIcon } from '@mantine/core'\nimport { FormRow } from 'basalt-ui/controls'\n${TABLE_IMPORT}` +
|
|
2000
|
+
`const col = createColumnHelper<Row>()\nexport const columns = [col.display({ id: 'a', cell: () => (\n` +
|
|
2001
|
+
` <FormRow label="L"><ActionIcon aria-label="x" /></FormRow>\n) })]\n`,
|
|
2002
|
+
)
|
|
2003
|
+
expect(rules).not.toContain('control-outside-home')
|
|
2004
|
+
})
|
|
2005
|
+
|
|
2006
|
+
it('does NOT flag one under a Menu.Dropdown inside a cell', () => {
|
|
2007
|
+
const { rules } = run(
|
|
2008
|
+
`import { ActionIcon } from '@mantine/core'\n${TABLE_IMPORT}const col = createColumnHelper<Row>()\n` +
|
|
2009
|
+
`export const columns = [col.display({ id: 'a', cell: () => (\n` +
|
|
2010
|
+
` <Menu.Dropdown><ActionIcon aria-label="x" /></Menu.Dropdown>\n) })]\n`,
|
|
2011
|
+
)
|
|
2012
|
+
expect(rules).not.toContain('control-outside-home')
|
|
2013
|
+
})
|
|
2014
|
+
|
|
2015
|
+
it('still flags in a file that imports @mantine/form', () => {
|
|
2016
|
+
const { rules } = run(
|
|
2017
|
+
`import { useForm } from '@mantine/form'\nimport { ActionIcon } from '@mantine/core'\n${TABLE_IMPORT}` +
|
|
2018
|
+
`const col = createColumnHelper<Row>()\nexport const columns = [col.display({ id: 'a', cell: () => <ActionIcon aria-label="x" /> })]\n`,
|
|
2019
|
+
)
|
|
2020
|
+
expect(rules).toContain('control-outside-home')
|
|
2021
|
+
})
|
|
2022
|
+
|
|
2023
|
+
it('does not see a cell renderer passed by reference (declared single-file limit)', () => {
|
|
2024
|
+
const { rules } = run(
|
|
2025
|
+
`import { ActionIcon } from '@mantine/core'\n${TABLE_IMPORT}const col = createColumnHelper<Row>()\n` +
|
|
2026
|
+
`const renderActions = () => <ActionIcon aria-label="x" />\n` +
|
|
2027
|
+
`export const columns = [col.display({ id: 'a', cell: renderActions })]\n`,
|
|
2028
|
+
)
|
|
2029
|
+
expect(rules).not.toContain('control-outside-home')
|
|
2030
|
+
})
|
|
2031
|
+
|
|
2032
|
+
it('honours a theme-allow waiver', () => {
|
|
2033
|
+
const { rules } = run(
|
|
2034
|
+
`import { ActionIcon } from '@mantine/core'\n${TABLE_IMPORT}const col = createColumnHelper<Row>()\n` +
|
|
2035
|
+
`export const columns = [col.display({ id: 'a', cell: () => (\n` +
|
|
2036
|
+
` // theme-allow control-outside-home — a one-off\n <ActionIcon aria-label="x" />\n) })]\n`,
|
|
2037
|
+
)
|
|
2038
|
+
expect(rules).not.toContain('control-outside-home')
|
|
2039
|
+
})
|
|
2040
|
+
})
|
|
2041
|
+
|
|
1960
2042
|
it('does NOT flag one under a member-expression non-home (Menu.Dropdown)', () => {
|
|
1961
2043
|
const { rules } = run(
|
|
1962
2044
|
`${MANTINE_IMPORT}export const C = () => <Menu.Dropdown><Select data={[]} /></Menu.Dropdown>\n`,
|
|
@@ -6,7 +6,7 @@ export type DualPanelLine<T> = Pick<ChartSeries<T>, 'key' | 'label' | 'color' |
|
|
|
6
6
|
export type DualPanelBar<T> = {
|
|
7
7
|
label: string;
|
|
8
8
|
getValue: (d: T) => number | null;
|
|
9
|
-
/** The fill above zero
|
|
9
|
+
/** The fill above zero; the legend swatch splits positive | negative (one entry, one toggle). */
|
|
10
10
|
positive: string;
|
|
11
11
|
/** The fill below zero. */
|
|
12
12
|
negative: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DualPanel.d.ts","sourceRoot":"","sources":["../../src/charts/DualPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"DualPanel.d.ts","sourceRoot":"","sources":["../../src/charts/DualPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAUzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAA;AAcrF,uBAAuB;AACvB,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,IAAI,CACjC,WAAW,CAAC,CAAC,CAAC,EACZ,KAAK,GACL,OAAO,GACP,OAAO,GACP,UAAU,GACV,aAAa,GACb,SAAS,GACT,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,aAAa,GACb,eAAe,GACf,WAAW,CACd,CAAA;AAED,mEAAmE;AACnE,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAA;IACjC,iGAAiG;IACjG,QAAQ,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,6EAA6E;IAC7E,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC7B,sDAAsD;IACtD,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IACnD,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IACvD;2BACuB;IACvB,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAAA;IACvD,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,IAAI,IAAI,CAC3E,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,EACvB,WAAW,GACX,MAAM,GACN,GAAG,GACH,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,aAAa,GACb,kBAAkB,GAClB,SAAS,GACT,WAAW,GACX,OAAO,CACV,GAAG;IACF,4BAA4B;IAC5B,MAAM,EAAE,SAAS,aAAa,CAAC,CAAC,CAAC,EAAE,CAAA;IACnC;6FACyF;IACzF,GAAG,CAAC,EACA;QACE,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAAA;QACvD,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;QAC5C,uDAAuD;QACvD,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;KACpD,GACD,SAAS,CAAA;IACb;;;OAGG;IACH,WAAW,CAAC,EACR;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAC1E,SAAS,CAAA;IACb,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;IACpB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,CAAA;AAiBD,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,EAClE,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,YAAY,CAwOd"}
|
package/dist/charts/DualPanel.js
CHANGED
|
@@ -53,10 +53,11 @@ function DualPanel(props) {
|
|
|
53
53
|
key: BAR_KEY,
|
|
54
54
|
label: bar.label,
|
|
55
55
|
color: bar.positive,
|
|
56
|
+
colorNegative: bar.negative,
|
|
56
57
|
mark: "bar",
|
|
57
58
|
getValue: bar.getValue
|
|
58
59
|
}),
|
|
59
|
-
[bar.label, bar.positive, bar.getValue]
|
|
60
|
+
[bar.label, bar.positive, bar.negative, bar.getValue]
|
|
60
61
|
);
|
|
61
62
|
const all = useMemo(() => [...lines, barSeries], [lines, barSeries]);
|
|
62
63
|
const topFormat = top?.format ?? defaultNumberFormat;
|
package/dist/charts/legend.d.ts
CHANGED
|
@@ -10,8 +10,16 @@ import type { ChartSeries } from './types.js';
|
|
|
10
10
|
export type LegendMode = 'dots' | 'chips' | 'auto';
|
|
11
11
|
/** The entries a series list derives, in display order (by role when `groups`). */
|
|
12
12
|
export declare function legendEntries<T>(series: readonly ChartSeries<T>[], groups: boolean): ChartSeries<T>[][];
|
|
13
|
+
/**
|
|
14
|
+
* A legend entry that may be a sign-coloured bar: `colorNegative` is the below-zero colour and the
|
|
15
|
+
* swatch splits `color` | `colorNegative`. Only `DualPanel`'s bar sets it; the entry stays one
|
|
16
|
+
* toggle, so the sign halves hide together.
|
|
17
|
+
*/
|
|
18
|
+
export type SignedSeries<T> = ChartSeries<T> & {
|
|
19
|
+
colorNegative?: string | undefined;
|
|
20
|
+
};
|
|
13
21
|
export type ChartLegendProps<T> = {
|
|
14
|
-
series: readonly
|
|
22
|
+
series: readonly SignedSeries<T>[];
|
|
15
23
|
hidden: ReadonlySet<string>;
|
|
16
24
|
mode: LegendMode;
|
|
17
25
|
groups: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/charts/legend.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAA;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,6FAA6F;AAC7F,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAUlD,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,CAAC,EAC7B,MAAM,EAAE,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,EACjC,MAAM,EAAE,OAAO,GACd,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAMpB;
|
|
1
|
+
{"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/charts/legend.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAA;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,6FAA6F;AAC7F,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAUlD,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,CAAC,EAC7B,MAAM,EAAE,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,EACjC,MAAM,EAAE,OAAO,GACd,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAMpB;AAuCD;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG;IAAE,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAoErF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,MAAM,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAA;IAClC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAmE9E"}
|
package/dist/charts/legend.js
CHANGED
|
@@ -43,6 +43,7 @@ const buttonStyle = {
|
|
|
43
43
|
borderRadius: VX.radiusCtrl
|
|
44
44
|
};
|
|
45
45
|
const noteStyle = { color: VX.axis };
|
|
46
|
+
const swatchFill = (s) => s.colorNegative ? `linear-gradient(90deg, ${s.color} 50%, ${s.colorNegative} 50%)` : s.color;
|
|
46
47
|
function Swatch({ s, mode }) {
|
|
47
48
|
if (mode === "auto")
|
|
48
49
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -60,7 +61,7 @@ function Swatch({ s, mode }) {
|
|
|
60
61
|
height: 8,
|
|
61
62
|
// theme-allow raw-surface — a legend dot is a circle, not a surface corner
|
|
62
63
|
borderRadius: "50%",
|
|
63
|
-
background: s
|
|
64
|
+
background: swatchFill(s),
|
|
64
65
|
opacity: s.fillOpacity ?? 1,
|
|
65
66
|
flex: "none"
|
|
66
67
|
}
|
|
@@ -91,7 +92,7 @@ function Swatch({ s, mode }) {
|
|
|
91
92
|
height: 10,
|
|
92
93
|
// theme-allow raw-surface — swatch geometry, not a surface corner
|
|
93
94
|
borderRadius: 2,
|
|
94
|
-
background: s
|
|
95
|
+
background: swatchFill(s),
|
|
95
96
|
opacity: s.fillOpacity ?? 1,
|
|
96
97
|
flex: "none"
|
|
97
98
|
}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* `overlays` imperative controller — unknown keys are tsc errors. The type slot gives the
|
|
6
6
|
* compile-time key union; the module-level stash gives the runtime values.
|
|
7
7
|
*
|
|
8
|
+
* A form dialog is an entry whose `render` returns the form; open it from a row action with
|
|
9
|
+
* `overlays.open('id', props)` and put its component in a `*-modal.tsx`.
|
|
10
|
+
*
|
|
8
11
|
* Uses @mantine/modals under the hood. ModalsProvider must be mounted (BasaltProvider does this).
|
|
9
12
|
*
|
|
10
13
|
* @example
|
|
@@ -189,6 +192,8 @@ export declare const overlays: {
|
|
|
189
192
|
* Open a registered overlay by key. Resolves the Overlay spec from the runtime stash and calls
|
|
190
193
|
* modals.open() with the rendered body. The props type is inferred from the registered overlay.
|
|
191
194
|
*
|
|
195
|
+
* Needs the key registered first: `defineOverlays` plus the `BasaltRegister` `overlays` augmentation.
|
|
196
|
+
*
|
|
192
197
|
* `overlays.open('nonexistent', …)` is a tsc error when BasaltRegister.overlays is augmented.
|
|
193
198
|
* Un-augmented: OverlayKey = never → effectively uncallable.
|
|
194
199
|
*
|