basalt-ui 2.7.0 → 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 CHANGED
@@ -21,7 +21,7 @@ and `./package.json` are **not exports** (`llms.txt` still ships in the tarball
21
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
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
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 |
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
25
  | `basalt-ui/table` | mantine-coupled | BasaltDataTable and createColumnHelper: a data table over TanStack Table v9, rendered with Mantine (renamed from ./data/table) |
26
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
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 |
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
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
+
1
11
  # [2.7.0](https://github.com/jkrumm/basalt-ui/compare/v2.6.1...v2.7.0) (2026-10-15)
2
12
 
3
13
 
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 | 2.7.0 | 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,15 @@ 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
+
995
1004
  ## 2.7.0 — table row actions, checkbox bindings, typed field errors
996
1005
 
997
1006
  - `BasaltDataTable` takes `rowActions` (argo friction row 48): typed data in `BarActionItem`'s
@@ -20,6 +20,7 @@ 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
 
@@ -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. [basalt/ai-sdk-major]
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]
@@ -24,12 +24,12 @@ A control has one home and takes its state from a store field; the home sets its
24
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):
@@ -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, and the legend swatch. */
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;AASzC,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,kDAAkD;IAClD,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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Ac,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,YAAY,CAwOd"}
@@ -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;
@@ -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 ChartSeries<T>[];
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,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AM,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"}
@@ -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.color,
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.color,
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
  *
@@ -1 +1 @@
1
- {"version":3,"file":"define-overlays.d.ts","sourceRoot":"","sources":["../../src/commands/define-overlays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AA+BvC;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,IAAI,CAUnD;AAID;;;;;;;;GAQG;AAEH,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACjD,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,iDAAiD;IACjD,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAA;CAChC,CAAA;AAED;;;;;;;GAOG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AAIrD,wEAAwE;AACxE,KAAK,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,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AAC;CAAE,GACtF,CAAC,GACD,KAAK,CAAA;AAET;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;;;;;;;OAWG;SACE,CAAC,SAAS,UAAU,OAAO,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI;IAehE;;;;;OAKG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;aACM,IAAI;CAGd,CAAA"}
@@ -92,6 +92,8 @@ const overlays = {
92
92
  * Open a registered overlay by key. Resolves the Overlay spec from the runtime stash and calls
93
93
  * modals.open() with the rendered body. The props type is inferred from the registered overlay.
94
94
  *
95
+ * Needs the key registered first: `defineOverlays` plus the `BasaltRegister` `overlays` augmentation.
96
+ *
95
97
  * `overlays.open('nonexistent', …)` is a tsc error when BasaltRegister.overlays is augmented.
96
98
  * Un-augmented: OverlayKey = never → effectively uncallable.
97
99
  *
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * ./commands — the command bus, overlay controller, shortcuts help and the notification registry.
3
3
  *
4
+ * Two seams need registering first: `emit(kind)` only accepts kinds registered in `defineNotifications`,
5
+ * and a form dialog is a `defineOverlays` entry opened with `overlays.open('id', props)`; both
6
+ * register their keys through the `declare module 'basalt-ui'` augmentation (see each factory).
7
+ *
4
8
  * `BasaltProvider` mounts modals, Spotlight, hotkeys and notifications; this barrel is only what
5
9
  * an app declares and calls.
6
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -2,6 +2,9 @@
2
2
  * defineNotifications — const-generic factory for typed notification kind registries.
3
3
  * Mirrors the defineSeries pattern from ./tokens (const-generic, identity passthrough).
4
4
  *
5
+ * `emit` only accepts kinds registered here first: call `defineNotifications` and augment
6
+ * `BasaltRegister.notifications` before emitting.
7
+ *
5
8
  * Consumer augments BasaltRegister.notifications with the spec map type, then uses the typed
6
9
  * `emit` helper which resolves the registered kind at compile-time. An unknown kind is a tsc error.
7
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"define-notifications.d.ts","sourceRoot":"","sources":["../../../src/commands/notifications/define-notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AACjE,OAAO,KAAK,EAAE,qBAA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,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,GACrE,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAA;AAEvF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,gBAAgB,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAYtF;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,qBAAqB,GACzB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,SAAS,CAIhD"}
@@ -248,7 +248,7 @@ export declare const SURFACES: {
248
248
  readonly skill: readonly ["basalt-app"];
249
249
  readonly guardKinds: readonly [];
250
250
  readonly pluginRules: readonly [];
251
- readonly description: "defineCommands (typed command bus), defineOverlays/overlays, setColorScheme, toggleSidebar, ShortcutsHelp, defineNotifications/emit/NotificationBell (folded in from ./notifications); BasaltProvider mounts Spotlight, Modals and Notifications";
251
+ readonly description: "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";
252
252
  readonly optionalPeers: readonly ["@tanstack/react-hotkeys"];
253
253
  readonly forbiddenImports: readonly [];
254
254
  };
package/dist/surfaces.js CHANGED
@@ -209,7 +209,7 @@ const SURFACES = {
209
209
  skill: ["basalt-app"],
210
210
  guardKinds: [],
211
211
  pluginRules: [],
212
- description: "defineCommands (typed command bus), defineOverlays/overlays, setColorScheme, toggleSidebar, ShortcutsHelp, defineNotifications/emit/NotificationBell (folded in from ./notifications); BasaltProvider mounts Spotlight, Modals and Notifications",
212
+ description: "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",
213
213
  optionalPeers: ["@tanstack/react-hotkeys"],
214
214
  forbiddenImports: []
215
215
  },
@@ -339,6 +339,10 @@ export type BasaltDataTableProps<T extends RowData> = BasaltProps & SlotStylesPr
339
339
  * whenever the array identity changes. A `renderCard` projection owns its own card, so the
340
340
  * column renders in the table body only.
341
341
  *
342
+ * State-dependent actions keep that array stable and read the state per row: put it in
343
+ * `disabled(row)` / `loading(row)` (state in a ref or the row itself), or `useMemo` the array
344
+ * keyed on exactly that state.
345
+ *
342
346
  * @example
343
347
  * const ROW_ACTIONS: DataTableRowAction<Row>[] = [
344
348
  * { key: 'edit', label: 'Edit', icon: <IconEdit />, onClick: (row) => edit(row) },
@@ -1 +1 @@
1
- {"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/table/data-table.tsx"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAIV,kBAAkB,EAGlB,eAAe,EAEf,OAAO,EACP,iBAAiB,EACjB,YAAY,EAEb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAgD,SAAS,EAAa,MAAM,OAAO,CAAA;AAI/F,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAOnE,OAAO,KAAK,EAAE,SAAS,EAAiB,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAahF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAU9D,OAAO,KAAK,EAAE,eAAe,EAAuC,MAAM,kBAAkB,CAAA;AA8B5F,0GAA0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AAW,CAAC,MAAM,CAAC,CAkBtB;AAoRD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,OAAO,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,+BAwrBhF"}
@@ -15,4 +15,5 @@
15
15
  */
16
16
  export { BasaltDataTable } from './data-table.js';
17
17
  export { createColumnHelper } from './table-features.js';
18
+ export type { DataTableRowAction } from './data-table.js';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/table/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA"}
package/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # basalt-ui v2.7.0
1
+ # basalt-ui v2.7.1
2
2
  # Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets
3
3
  #
4
4
  # Entry points: use the exact import specifier below; do not guess.
@@ -13,7 +13,7 @@
13
13
  # A subpath's `Install:` line is its required peers; `OptionalPeers:` are import()-only, install on use.
14
14
 
15
15
  Package: basalt-ui
16
- Version: 2.7.0
16
+ Version: 2.7.1
17
17
 
18
18
  ## basalt-ui
19
19
  Import: import { ... } from 'basalt-ui'
@@ -311,7 +311,7 @@ Install: bun add @mantine/form@^9.7.0
311
311
 
312
312
  ## basalt-ui/commands
313
313
  Import: import { ... } from 'basalt-ui/commands'
314
- Description: defineCommands (typed command bus), defineOverlays/overlays, setColorScheme, toggleSidebar, ShortcutsHelp, defineNotifications/emit/NotificationBell (folded in from ./notifications); BasaltProvider mounts Spotlight, Modals and Notifications
314
+ Description: 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
315
315
  Layer: mantine-coupled
316
316
  Rule: basalt-batteries
317
317
  Signature: NotificationBell(props: NotificationBellProps): JSX.Element
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basalt-ui",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets",
5
5
  "keywords": [
6
6
  "charts",
@@ -18,6 +18,7 @@ import { defaultFormatX, defaultNumberFormat, engineRow, seriesRow, visibleSerie
18
18
  import { barMark, emphasis, lineMark, markersOf, thinFill } from './marks'
19
19
  import { PanelRung, chartHeightOf, paneX, paneY, rowsOf } from './panel'
20
20
  import type { PaneBuilder, PanelInput, PanelPlan } from './panel'
21
+ import type { SignedSeries } from './legend'
21
22
  import { xScaleFor } from './scales'
22
23
  import { rowX } from './types'
23
24
  import type { CartesianChartProps, ChartSeries, PlotContext, PlotRow } from './types'
@@ -57,7 +58,7 @@ export type DualPanelLine<T> = Pick<
57
58
  export type DualPanelBar<T> = {
58
59
  label: string
59
60
  getValue: (d: T) => number | null
60
- /** The fill above zero, and the legend swatch. */
61
+ /** The fill above zero; the legend swatch splits positive | negative (one entry, one toggle). */
61
62
  positive: string
62
63
  /** The fill below zero. */
63
64
  negative: string
@@ -149,15 +150,16 @@ export function DualPanel<T, X extends Date | number = Date | number>(
149
150
  () => series.map((s) => ({ ...s, mark: 'line' as const })),
150
151
  [series],
151
152
  )
152
- const barSeries = useMemo<ChartSeries<T>>(
153
+ const barSeries = useMemo<SignedSeries<T>>(
153
154
  () => ({
154
155
  key: BAR_KEY,
155
156
  label: bar.label,
156
157
  color: bar.positive,
158
+ colorNegative: bar.negative,
157
159
  mark: 'bar',
158
160
  getValue: bar.getValue,
159
161
  }),
160
- [bar.label, bar.positive, bar.getValue],
162
+ [bar.label, bar.positive, bar.negative, bar.getValue],
161
163
  )
162
164
  const all = useMemo(() => [...lines, barSeries], [lines, barSeries])
163
165
  const topFormat = top?.format ?? defaultNumberFormat
@@ -69,11 +69,22 @@ const buttonStyle: CSSProperties = {
69
69
  }
70
70
  const noteStyle: CSSProperties = { color: VX.axis }
71
71
 
72
+ /**
73
+ * A legend entry that may be a sign-coloured bar: `colorNegative` is the below-zero colour and the
74
+ * swatch splits `color` | `colorNegative`. Only `DualPanel`'s bar sets it; the entry stays one
75
+ * toggle, so the sign halves hide together.
76
+ */
77
+ export type SignedSeries<T> = ChartSeries<T> & { colorNegative?: string | undefined }
78
+
72
79
  type SwatchStyle = Pick<
73
- ChartSeries<never>,
74
- 'color' | 'mark' | 'dash' | 'strokeOpacity' | 'fillOpacity'
80
+ SignedSeries<never>,
81
+ 'color' | 'colorNegative' | 'mark' | 'dash' | 'strokeOpacity' | 'fillOpacity'
75
82
  >
76
83
 
84
+ /** A swatch fill: the series colour, or a hard-stop split for a sign-coloured bar. */
85
+ const swatchFill = (s: SwatchStyle): string =>
86
+ s.colorNegative ? `linear-gradient(90deg, ${s.color} 50%, ${s.colorNegative} 50%)` : s.color
87
+
77
88
  function Swatch({ s, mode }: { s: SwatchStyle; mode: LegendMode }): ReactElement {
78
89
  if (mode === 'auto')
79
90
  return (
@@ -92,7 +103,7 @@ function Swatch({ s, mode }: { s: SwatchStyle; mode: LegendMode }): ReactElement
92
103
  height: 8,
93
104
  // theme-allow raw-surface — a legend dot is a circle, not a surface corner
94
105
  borderRadius: '50%',
95
- background: s.color,
106
+ background: swatchFill(s),
96
107
  opacity: s.fillOpacity ?? 1,
97
108
  flex: 'none',
98
109
  }}
@@ -123,7 +134,7 @@ function Swatch({ s, mode }: { s: SwatchStyle; mode: LegendMode }): ReactElement
123
134
  height: 10,
124
135
  // theme-allow raw-surface — swatch geometry, not a surface corner
125
136
  borderRadius: 2,
126
- background: s.color,
137
+ background: swatchFill(s),
127
138
  opacity: s.fillOpacity ?? 1,
128
139
  flex: 'none',
129
140
  }}
@@ -132,7 +143,7 @@ function Swatch({ s, mode }: { s: SwatchStyle; mode: LegendMode }): ReactElement
132
143
  }
133
144
 
134
145
  export type ChartLegendProps<T> = {
135
- series: readonly ChartSeries<T>[]
146
+ series: readonly SignedSeries<T>[]
136
147
  hidden: ReadonlySet<string>
137
148
  mode: LegendMode
138
149
  groups: boolean
@@ -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
@@ -338,6 +341,8 @@ export const overlays = {
338
341
  * Open a registered overlay by key. Resolves the Overlay spec from the runtime stash and calls
339
342
  * modals.open() with the rendered body. The props type is inferred from the registered overlay.
340
343
  *
344
+ * Needs the key registered first: `defineOverlays` plus the `BasaltRegister` `overlays` augmentation.
345
+ *
341
346
  * `overlays.open('nonexistent', …)` is a tsc error when BasaltRegister.overlays is augmented.
342
347
  * Un-augmented: OverlayKey = never → effectively uncallable.
343
348
  *
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * ./commands — the command bus, overlay controller, shortcuts help and the notification registry.
3
3
  *
4
+ * Two seams need registering first: `emit(kind)` only accepts kinds registered in `defineNotifications`,
5
+ * and a form dialog is a `defineOverlays` entry opened with `overlays.open('id', props)`; both
6
+ * register their keys through the `declare module 'basalt-ui'` augmentation (see each factory).
7
+ *
4
8
  * `BasaltProvider` mounts modals, Spotlight, hotkeys and notifications; this barrel is only what
5
9
  * an app declares and calls.
6
10
  *
@@ -2,6 +2,9 @@
2
2
  * defineNotifications — const-generic factory for typed notification kind registries.
3
3
  * Mirrors the defineSeries pattern from ./tokens (const-generic, identity passthrough).
4
4
  *
5
+ * `emit` only accepts kinds registered here first: call `defineNotifications` and augment
6
+ * `BasaltRegister.notifications` before emitting.
7
+ *
5
8
  * Consumer augments BasaltRegister.notifications with the spec map type, then uses the typed
6
9
  * `emit` helper which resolves the registered kind at compile-time. An unknown kind is a tsc error.
7
10
  *
package/src/surfaces.ts CHANGED
@@ -409,7 +409,7 @@ export const SURFACES = {
409
409
  guardKinds: [],
410
410
  pluginRules: [],
411
411
  description:
412
- 'defineCommands (typed command bus), defineOverlays/overlays, setColorScheme, toggleSidebar, ShortcutsHelp, defineNotifications/emit/NotificationBell (folded in from ./notifications); BasaltProvider mounts Spotlight, Modals and Notifications',
412
+ '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',
413
413
  optionalPeers: ['@tanstack/react-hotkeys'],
414
414
  forbiddenImports: [],
415
415
  },
@@ -781,6 +781,10 @@ export type BasaltDataTableProps<T extends RowData> = BasaltProps &
781
781
  * whenever the array identity changes. A `renderCard` projection owns its own card, so the
782
782
  * column renders in the table body only.
783
783
  *
784
+ * State-dependent actions keep that array stable and read the state per row: put it in
785
+ * `disabled(row)` / `loading(row)` (state in a ref or the row itself), or `useMemo` the array
786
+ * keyed on exactly that state.
787
+ *
784
788
  * @example
785
789
  * const ROW_ACTIONS: DataTableRowAction<Row>[] = [
786
790
  * { key: 'edit', label: 'Edit', icon: <IconEdit />, onClick: (row) => edit(row) },
@@ -16,3 +16,5 @@
16
16
 
17
17
  export { BasaltDataTable } from './data-table'
18
18
  export { createColumnHelper } from './table-features'
19
+ // The element type of `rowActions`, for a module-level constant.
20
+ export type { DataTableRowAction } from './data-table'