basalt-ui 2.13.0 → 2.13.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/CHANGELOG.md +12 -0
- package/MIGRATING.md +23 -12
- package/dist/router-tanstack/nav.d.ts +5 -0
- package/dist/router-tanstack/nav.d.ts.map +1 -1
- package/dist/router-tanstack/use-nav.d.ts +4 -2
- package/dist/router-tanstack/use-nav.d.ts.map +1 -1
- package/dist/router-tanstack/use-nav.js +55 -18
- package/dist/shell/app-breadcrumbs.d.ts +1 -3
- package/dist/shell/app-breadcrumbs.d.ts.map +1 -1
- package/dist/shell/app-breadcrumbs.js +1 -6
- package/dist/shell/index.d.ts +14 -5
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +6 -29
- package/dist/shell/nav-types.d.ts +7 -0
- package/dist/shell/nav-types.d.ts.map +1 -1
- package/dist/shell/page-aside.d.ts +4 -2
- package/dist/shell/page-aside.d.ts.map +1 -1
- package/dist/shell/page-aside.js +41 -23
- package/dist/shell/page-bar.d.ts +1 -1
- package/dist/shell/page-bar.d.ts.map +1 -1
- package/dist/shell/page-bar.js +39 -33
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/router-tanstack/nav.ts +5 -0
- package/src/router-tanstack/use-nav.ts +116 -76
- package/src/shell/app-breadcrumbs.tsx +1 -12
- package/src/shell/index.tsx +22 -55
- package/src/shell/nav-types.ts +8 -0
- package/src/shell/page-aside.tsx +59 -26
- package/src/shell/page-bar.tsx +63 -59
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [2.13.1](https://github.com/jkrumm/basalt-ui/compare/v2.13.0...v2.13.1) (2026-10-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* give the layout ShellFixture a real breadcrumb ([2d24459](https://github.com/jkrumm/basalt-ui/commit/2d244599d0f6c904d39082f9b6d2f911ef3e2a5e))
|
|
7
|
+
* own-key badge compare, flat anchor cache and breadcrumb tests ([a53f295](https://github.com/jkrumm/basalt-ui/commit/a53f295caff8831fc1a68b6dbbe3db5b3902635b))
|
|
8
|
+
* require ShellFrame activeCrumb and harden nav and aside tests ([f3ede67](https://github.com/jkrumm/basalt-ui/commit/f3ede67dbb8401919e9d0998d3299bd35ebf89f9))
|
|
9
|
+
* restore matchMedia after the PageAside ownership tests ([861c1fe](https://github.com/jkrumm/basalt-ui/commit/861c1fe73780c7485e90a20df78c2e225d94961d))
|
|
10
|
+
* stable nav anchors, narrow shell contexts and single-claimant PageAside ([8dbff8a](https://github.com/jkrumm/basalt-ui/commit/8dbff8a38d789d81e3853df298532e0d97d7bfb2))
|
|
11
|
+
* stop naming the removed useNav in shell comments ([f874df4](https://github.com/jkrumm/basalt-ui/commit/f874df4331fbfa9b14d4f1fbe055154bd18dee0a))
|
|
12
|
+
|
|
1
13
|
# [2.13.0](https://github.com/jkrumm/basalt-ui/compare/v2.12.0...v2.13.0) (2026-10-16)
|
|
2
14
|
|
|
3
15
|
|
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 | 2.7.1 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.13.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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — |
|
|
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 | 2.7.2 | 2.7.3 | 2.8.0 | 2.8.1 | 2.9.0 | 2.9.1 | 2.10.0 | 2.11.0 | 2.11.1 | 2.12.0 | 2.13.0 | 2.13.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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BandSpan.absentFraction` + `absentState` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `BasaltProvider` embedded mode, `spotlight` (§ 2.8.0) | — | — | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | `doctor`: CSS + forced dropped subpaths, `oxlint-floor`, Start wiring (§ 2.8.0) | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — |
|
|
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) | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | § 1.x compatibility layer removed | — | — | — | — | — | — | — | — |
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
@@ -1046,6 +1046,10 @@ The `basalt-ui/router-tanstack` subpath is **removed** in 2.x, not moved: an imp
|
|
|
1046
1046
|
_Nothing yet. Author the next section under this heading as `## Unreleased — <title>`; the
|
|
1047
1047
|
release renames it and opens a new one here._
|
|
1048
1048
|
|
|
1049
|
+
## 2.13.1
|
|
1050
|
+
|
|
1051
|
+
_Nothing to migrate in this release._
|
|
1052
|
+
|
|
1049
1053
|
## 2.13.0 — router options, search stores, and a theme that reaches no component it configures
|
|
1050
1054
|
|
|
1051
1055
|
### `basaltRouterOptions`, router passthrough, telemetry correctness
|
|
@@ -1069,6 +1073,13 @@ release renames it and opens a new one here._
|
|
|
1069
1073
|
- **`buildSearchStore` is gone.** It was an internal pass-through of `createSearchStore`, never exported from `basalt-ui/state`; nothing public changes. **Opt-out: none needed.**
|
|
1070
1074
|
- **Dev warning:** a URL-lane field read on a route none of whose matched `validateSearch` runs this store (directly or composed) warns once per field — another store or a hand-rolled schema owns the param. **Opt-out: none; wire `validateSearch: store.validateSearch`, or spread it into your own.**
|
|
1071
1075
|
|
|
1076
|
+
### Stable nav anchors, narrow shell contexts, one PageAside owner
|
|
1077
|
+
|
|
1078
|
+
- **Nav links no longer remount on navigation.** Each destination keeps one anchor component for the life of its `defineNav` config, so the sidebar, mobile bar and breadcrumb `<a>` nodes survive a route change and keyboard focus stays on the link you activated. **Requirement:** call `defineNav` at module scope. A `defineNav` inside a component is a new config every render and remounts the links as before. **Opt-out: none** (a test that relied on a fresh node per navigation must re-query).
|
|
1079
|
+
- **An inline `badges={{ … }}` of numbers or strings is fine.** `useNav` compares badges shallowly per id, so a literal rebuilt every render no longer rebuilds the sections; the "hoist or memoize" guidance is gone. A JSX `ReactNode` badge is a new element every render and still rebuilds them: memoize that one.
|
|
1080
|
+
- **A second concurrent `PageAside` warns in development.** The newest committed claimant (tree and commit order) owns the region, and the fold is keyed to the claimant, so an outgoing aside releasing no longer resets the fold the incoming one published. Render one `PageAside` per page. **Opt-out: none.**
|
|
1081
|
+
- **Internal:** `ShellFrame` takes a required `activeCrumb`, and `AppBreadcrumbs` loses its never-produced `parentHref` prop.
|
|
1082
|
+
|
|
1072
1083
|
### the theme reaches no Mantine component it configures
|
|
1073
1084
|
|
|
1074
1085
|
- **`createBasaltTheme` no longer value-imports the ~45 Mantine components it configures.** No consumer change; the produced theme is byte-identical. An app stops shipping the components the theme only configured (`AppShell*`, `Pagination*`, `Stepper*`, `Timeline*`, `MultiSelect`, `PasswordInput`, `Chip`, `Progress*`, `NavLink`, `Breadcrumbs`, …) — Mantine's `X.extend()` is `identity`, but calling it pulled each component module into every bundle. **Measured:** an embedded `<BasaltProvider spotlight={false}>` with no defines, peers bundled and every chunk counted, dropped from 166959 B to 54735 B gzip; `createBasaltTheme()` alone is 14420 B (`scripts/check-budgets.ts` gates both; the embedded ceiling went 168500 → 55300). **Equivalence:** `createBasaltTheme` was compared against the pre-change tree (0c4aeb1a) across default, density −3/0/+3, radius −5/0/+5 and derive options, invoking every `vars` / `classNames` / `styles` / `variantColorResolver` over sizes × variants × states × schemes: 12 pass, and a one-key mutation of the baseline failed all 12. Re-run it by checking out that commit in a worktree, installing, and importing both `createBasaltTheme`s in one test; `src/theme/plain-theme.test.ts` now snapshots the same resolver outputs. **Opt-out: none.**
|
|
@@ -115,6 +115,11 @@ export type NavGroupId<G> = G extends ReadonlyArray<{
|
|
|
115
115
|
id: infer I;
|
|
116
116
|
}> ? I : never;
|
|
117
117
|
export type NavTabId<G> = NavItemId<G> | NavGroupId<G>;
|
|
118
|
+
/**
|
|
119
|
+
* The resolved definition `defineNav` returns. Call `defineNav` at module scope: the shell caches
|
|
120
|
+
* each destination's anchor per config object, so one built inside a component remounts the links
|
|
121
|
+
* on every render.
|
|
122
|
+
*/
|
|
118
123
|
export type NavConfig<G extends ReadonlyArray<AnyNavGroup>, T extends ReadonlyArray<NavTabId<G>>> = {
|
|
119
124
|
groups: G;
|
|
120
125
|
mobile?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AAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC1C,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAMxD;AAED;;;;GAIG;AACH,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,gBAAgB,CAAC,WAAW,CAAC,GAC9D,qCAAqC,GACrC,CAAC,CAAA;AAaL;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,KAAK,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;CAAE,EACtD,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAChC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAM5C;AAED,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACtD,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { MobileNavConfig, SidebarSection } from '../shell/nav-types.js';
|
|
2
|
+
import type { ActiveCrumb, MobileNavConfig, SidebarSection } from '../shell/nav-types.js';
|
|
3
3
|
import type { AnyNavGroup, AnyNavItem, NavConfig, NavItemId, NavTabId } from './nav.js';
|
|
4
4
|
export type UseNavOptions<G extends ReadonlyArray<AnyNavGroup>> = {
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@ export type UseNavOptions<G extends ReadonlyArray<AnyNavGroup>> = {
|
|
|
8
8
|
* Anything else becomes `item.badge` (desktop only).
|
|
9
9
|
*/
|
|
10
10
|
badges?: Partial<Record<NavItemId<G>, number | ReactNode>>;
|
|
11
|
-
/** Override active detection entirely. */
|
|
11
|
+
/** Override active detection entirely. Keep it stable (module scope or memoized). */
|
|
12
12
|
isActive?: (item: AnyNavItem & {
|
|
13
13
|
id: NavItemId<G>;
|
|
14
14
|
}) => boolean;
|
|
@@ -18,6 +18,8 @@ export type UseNavOptions<G extends ReadonlyArray<AnyNavGroup>> = {
|
|
|
18
18
|
export type ResolvedNav = {
|
|
19
19
|
sections: SidebarSection[];
|
|
20
20
|
mobileNav: MobileNavConfig;
|
|
21
|
+
/** The breadcrumb for the one active destination; `undefined` when nothing matches. */
|
|
22
|
+
activeCrumb: ActiveCrumb | undefined;
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
23
25
|
* Resolve a nav definition against the live router into `BasaltShell`'s internal `ShellFrame`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-nav.d.ts","sourceRoot":"","sources":["../../src/router-tanstack/use-nav.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAqC,SAAS,EAAE,MAAM,OAAO,CAAA;AAEzE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"use-nav.d.ts","sourceRoot":"","sources":["../../src/router-tanstack/use-nav.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAqC,SAAS,EAAE,MAAM,OAAO,CAAA;AAEzE,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EAGf,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEpF,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,aAAa,CAAC,WAAW,CAAC,IAAI;IAChE;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IAC1D,qFAAqF;IACrF,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG;QAAE,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;KAAE,KAAK,OAAO,CAAA;IAC/D,gBAAgB,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAA;CAC5C,CAAA;AA8BD,yGAAyG;AACzG,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,SAAS,EAAE,eAAe,CAAA;IAC1B,uFAAuF;IACvF,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;CACrC,CAAA;AA8ED;;;GAGG;AACH,wBAAgB,MAAM,CACpB,KAAK,CAAC,CAAC,SAAS,aAAa,CAAC,WAAW,CAAC,EAC1C,KAAK,CAAC,CAAC,SAAS,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC1C,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,WAAW,CA+H/D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement, forwardRef, useMemo } from "react";
|
|
1
|
+
import { createElement, forwardRef, useMemo, useState } from "react";
|
|
2
2
|
import { Link, useMatchRoute, useRouterState } from "@tanstack/react-router";
|
|
3
3
|
import { flattenNav } from "./nav-stash.js";
|
|
4
4
|
const OverriddenAnchor = forwardRef((props, ref) => {
|
|
@@ -16,12 +16,58 @@ const OverriddenAnchor = forwardRef((props, ref) => {
|
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
OverriddenAnchor.displayName = "OverriddenAnchor";
|
|
19
|
+
const anchorCache = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
function anchorFor(config, item, overridden) {
|
|
21
|
+
let byMode = anchorCache.get(config);
|
|
22
|
+
if (!byMode) anchorCache.set(config, byMode = /* @__PURE__ */ new Map());
|
|
23
|
+
let byId = byMode.get(overridden);
|
|
24
|
+
if (!byId) byMode.set(overridden, byId = /* @__PURE__ */ new Map());
|
|
25
|
+
const cached = byId.get(item.id);
|
|
26
|
+
if (cached) return cached;
|
|
27
|
+
const Anchor = (props) => createElement(Link, {
|
|
28
|
+
...item.link,
|
|
29
|
+
activeOptions: { exact: true, includeSearch: true },
|
|
30
|
+
...overridden && {
|
|
31
|
+
_asChild: OverriddenAnchor,
|
|
32
|
+
"data-basalt-current": props["aria-current"]
|
|
33
|
+
},
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
byId.set(item.id, Anchor);
|
|
37
|
+
return Anchor;
|
|
38
|
+
}
|
|
39
|
+
const NO_BADGES = {};
|
|
40
|
+
function shallowEqual(a = NO_BADGES, b = NO_BADGES) {
|
|
41
|
+
if (a === b) return true;
|
|
42
|
+
const keys = Object.keys(a);
|
|
43
|
+
return keys.length === Object.keys(b).length && keys.every((k) => Object.hasOwn(b, k) && Object.is(a[k], b[k]));
|
|
44
|
+
}
|
|
45
|
+
function crumbOf(config, winnerId, overridden) {
|
|
46
|
+
const find = (items, section, parent) => {
|
|
47
|
+
for (const item of items) {
|
|
48
|
+
if (item.id === winnerId) {
|
|
49
|
+
const parentCrumb = parent && {
|
|
50
|
+
parent: parent.label,
|
|
51
|
+
parentAnchor: anchorFor(config, parent, overridden)
|
|
52
|
+
};
|
|
53
|
+
return { section, page: item.label, ...parentCrumb };
|
|
54
|
+
}
|
|
55
|
+
const nested = item.children && find(item.children, section, item);
|
|
56
|
+
if (nested) return nested;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
for (const group of config.groups) {
|
|
60
|
+
const found = find(group.items, group.label);
|
|
61
|
+
if (found) return found;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
19
64
|
function useNav(config, opts) {
|
|
20
65
|
const matchRoute = useMatchRoute();
|
|
21
66
|
const href = useRouterState({ select: (s) => s.location.href });
|
|
22
|
-
const badges = opts?.badges;
|
|
67
|
+
const [badges, setBadges] = useState(opts?.badges);
|
|
68
|
+
if (!shallowEqual(badges, opts?.badges)) setBadges(opts?.badges);
|
|
23
69
|
const isActiveOverride = opts?.isActive;
|
|
24
|
-
const
|
|
70
|
+
const resolved = useMemo(() => {
|
|
25
71
|
const badgeOf = (id) => badges?.[id];
|
|
26
72
|
const matchOf = (item) => isActiveOverride?.(item) ?? Boolean(
|
|
27
73
|
matchRoute({
|
|
@@ -49,16 +95,9 @@ function useNav(config, opts) {
|
|
|
49
95
|
const ancestor = winnerTo !== void 0 && matched && winnerTo.startsWith(`${item.link.to}/`);
|
|
50
96
|
return { active: false, ancestor };
|
|
51
97
|
};
|
|
98
|
+
const overridden = isActiveOverride !== void 0;
|
|
52
99
|
const toSidebarItem = (item) => {
|
|
53
|
-
const Anchor = (
|
|
54
|
-
...item.link,
|
|
55
|
-
activeOptions: { exact: true, includeSearch: true },
|
|
56
|
-
...isActiveOverride !== void 0 && {
|
|
57
|
-
_asChild: OverriddenAnchor,
|
|
58
|
-
"data-basalt-current": props["aria-current"]
|
|
59
|
-
},
|
|
60
|
-
...props
|
|
61
|
-
});
|
|
100
|
+
const Anchor = anchorFor(config, item, overridden);
|
|
62
101
|
const badge = badgeOf(item.id);
|
|
63
102
|
const children = item.children?.map(toSidebarItem);
|
|
64
103
|
const { active, ancestor } = resolveState(item);
|
|
@@ -67,10 +106,7 @@ function useNav(config, opts) {
|
|
|
67
106
|
label: item.label,
|
|
68
107
|
icon: item.icon,
|
|
69
108
|
Anchor,
|
|
70
|
-
// Exactly one destination
|
|
71
|
-
// Rolling that up into a mobile SLOT (any descendant active → the slot reads active) is
|
|
72
|
-
// still `projectMobileNav`'s job, which reads `children` for that. `ancestor` is the
|
|
73
|
-
// desktop-only middle state: a matched item that sits on the winner's path but isn't it.
|
|
109
|
+
// Exactly one destination reads `active`; `projectMobileNav` rolls it up into mobile slots.
|
|
74
110
|
active,
|
|
75
111
|
...ancestor && { ancestor },
|
|
76
112
|
...item.short !== void 0 && { short: item.short },
|
|
@@ -80,7 +116,7 @@ function useNav(config, opts) {
|
|
|
80
116
|
...children !== void 0 && { children }
|
|
81
117
|
};
|
|
82
118
|
};
|
|
83
|
-
|
|
119
|
+
const sections = config.groups.map((group) => ({
|
|
84
120
|
label: group.label,
|
|
85
121
|
items: group.items.map(toSidebarItem),
|
|
86
122
|
...group.icon !== void 0 && { icon: group.icon },
|
|
@@ -88,6 +124,7 @@ function useNav(config, opts) {
|
|
|
88
124
|
...group.defaultCollapsed !== void 0 && { defaultCollapsed: group.defaultCollapsed },
|
|
89
125
|
...group.mobile !== void 0 && { mobile: group.mobile }
|
|
90
126
|
}));
|
|
127
|
+
return { sections, activeCrumb: crumbOf(config, winnerId, overridden) };
|
|
91
128
|
}, [config, matchRoute, href, badges, isActiveOverride]);
|
|
92
129
|
const mobile = config.mobile;
|
|
93
130
|
const getScrollElement = opts?.getScrollElement;
|
|
@@ -105,7 +142,7 @@ function useNav(config, opts) {
|
|
|
105
142
|
...getScrollElement !== void 0 && { getScrollElement }
|
|
106
143
|
};
|
|
107
144
|
}, [config, mobile, getScrollElement]);
|
|
108
|
-
return {
|
|
145
|
+
return { ...resolved, mobileNav };
|
|
109
146
|
}
|
|
110
147
|
export {
|
|
111
148
|
useNav
|
|
@@ -9,9 +9,7 @@ export type AppBreadcrumbsProps = BasaltProps & {
|
|
|
9
9
|
* client-side. basalt still owns every pixel of the crumb — the anchor only hosts the label.
|
|
10
10
|
*/
|
|
11
11
|
parentAnchor?: NavAnchor | undefined;
|
|
12
|
-
/** Parent item href — the no-router fallback; ignored when `parentAnchor` is present. */
|
|
13
|
-
parentHref?: string | undefined;
|
|
14
12
|
page?: string;
|
|
15
13
|
};
|
|
16
|
-
export declare function AppBreadcrumbs({ section, parent, parentAnchor,
|
|
14
|
+
export declare function AppBreadcrumbs({ section, parent, parentAnchor, page, className, style, }: AppBreadcrumbsProps): import("react").JSX.Element | null;
|
|
17
15
|
//# sourceMappingURL=app-breadcrumbs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/shell/app-breadcrumbs.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAkBlD,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACpC,
|
|
1
|
+
{"version":3,"file":"app-breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/shell/app-breadcrumbs.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAkBlD,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,KAAK,GACN,EAAE,mBAAmB,sCAkDrB"}
|
|
@@ -15,7 +15,6 @@ function AppBreadcrumbs({
|
|
|
15
15
|
section,
|
|
16
16
|
parent,
|
|
17
17
|
parentAnchor,
|
|
18
|
-
parentHref,
|
|
19
18
|
page,
|
|
20
19
|
className,
|
|
21
20
|
style
|
|
@@ -38,11 +37,7 @@ function AppBreadcrumbs({
|
|
|
38
37
|
/* @__PURE__ */ jsx(Anchor, { style: crumbStyle, underline: "never", component: parentAnchor, truncate: true, children: parent }),
|
|
39
38
|
/* @__PURE__ */ jsx(Text, { style: separatorStyle, children: "/" })
|
|
40
39
|
] }),
|
|
41
|
-
parent && !parentAnchor &&
|
|
42
|
-
/* @__PURE__ */ jsx(Anchor, { style: crumbStyle, underline: "never", href: parentHref, truncate: true, children: parent }),
|
|
43
|
-
/* @__PURE__ */ jsx(Text, { style: separatorStyle, children: "/" })
|
|
44
|
-
] }),
|
|
45
|
-
parent && !parentAnchor && !parentHref && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
parent && !parentAnchor && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
41
|
/* @__PURE__ */ jsx(Text, { style: crumbStyle, truncate: true, children: parent }),
|
|
47
42
|
/* @__PURE__ */ jsx(Text, { style: separatorStyle, children: "/" })
|
|
48
43
|
] })
|
package/dist/shell/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { BasaltProps } from '../common/props.js';
|
|
|
3
3
|
import type { GlobalAction } from '../controls/actions.js';
|
|
4
4
|
import type { AccountMenuItem, BasaltAccountProps } from './account-types.js';
|
|
5
5
|
import type { SidebarSearchActions, SidebarSearchConfig } from './sidebar-search.js';
|
|
6
|
-
import type { MobileNavConfig, NavAnchor, SidebarBlock, SidebarSection } from './nav-types.js';
|
|
6
|
+
import type { ActiveCrumb, MobileNavConfig, NavAnchor, SidebarBlock, SidebarSection } from './nav-types.js';
|
|
7
7
|
import type { UseNavOptions } from '../router-tanstack/use-nav.js';
|
|
8
8
|
import type { AnyNavGroup, NavConfig, NavTabId } from '../router-tanstack/nav.js';
|
|
9
9
|
export { AppSidebar, type AppSidebarProps } from './app-sidebar.js';
|
|
@@ -74,7 +74,8 @@ export type ShellBaseProps = BasaltProps & {
|
|
|
74
74
|
* the rest fold into the header's single kebab (`mobile: 'bar' | 'more' | 'hidden'`, see
|
|
75
75
|
* `GlobalAction`). That kebab is the SAME one `PageBar`'s ROW 1 opens — a route whose bar has
|
|
76
76
|
* row-1 actions (or `filtersEnd`) lends it, any other route gets it from the shell. An
|
|
77
|
-
* `ActionGroup` a consumer mounts in some other home never inherits these rows.
|
|
77
|
+
* `ActionGroup` a consumer mounts in some other home never inherits these rows. Keep the array
|
|
78
|
+
* stable (module scope or memoized): a new one every render re-derives the header and kebab.
|
|
78
79
|
*/
|
|
79
80
|
globalActions?: GlobalAction[];
|
|
80
81
|
/**
|
|
@@ -159,9 +160,15 @@ export type BasaltShellProps<G extends ReadonlyArray<AnyNavGroup>, T extends Rea
|
|
|
159
160
|
/**
|
|
160
161
|
* The `defineNav` definition — the ONE nav, resolved against the router here: the sidebar, the
|
|
161
162
|
* mobile bar (its tuning rides `defineNav`'s `mobile`) and the breadcrumb all derive from it.
|
|
162
|
-
* Alongside it: `badges` (a `number` becomes `item.count`, anything else `item.badge`;
|
|
163
|
-
*
|
|
164
|
-
*
|
|
163
|
+
* Alongside it: `badges` (a `number` becomes `item.count`, anything else `item.badge`; an
|
|
164
|
+
* inline `{ … }` literal is fine for numbers and strings, but a JSX `ReactNode` value is a new
|
|
165
|
+
* element every render and rebuilds the sections — memoize it), `isActive` (override active
|
|
166
|
+
* detection) and `getScrollElement` (the mobile bar's scroll container).
|
|
167
|
+
*
|
|
168
|
+
* Define `nav` at module scope: its anchors are cached per config object, so a `defineNav`
|
|
169
|
+
* call inside a component is a new config every render and remounts the links again.
|
|
170
|
+
* `isActive` must likewise be a module-scope or memoized function; a new one every render
|
|
171
|
+
* rebuilds the sections.
|
|
165
172
|
*/
|
|
166
173
|
nav: NavConfig<G, T>;
|
|
167
174
|
};
|
|
@@ -177,6 +184,8 @@ export type ShellFrameProps = ShellBaseProps & {
|
|
|
177
184
|
sections: SidebarSection[];
|
|
178
185
|
/** Mobile bar tuning; every field optional (see `projectMobileNav`'s zero-config fallback). */
|
|
179
186
|
mobileNav?: MobileNavConfig;
|
|
187
|
+
/** The breadcrumb for the active destination, resolved by the nav resolver. */
|
|
188
|
+
activeCrumb: ActiveCrumb | undefined;
|
|
180
189
|
};
|
|
181
190
|
/**
|
|
182
191
|
* @internal Renders resolved `sections`; consumers use `BasaltShell nav` instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAiB,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAYlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACjF,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAiB,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAYlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACjF,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACf,MAAM,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAO9E,OAAO,EAAE,UAAU,EAAE,KAAK,e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41,7 @@ import { PAGE_BAR_HEIGHT_VAR, useInPageBarShell } from "./page-bar.js";
|
|
|
41
41
|
import { PageAside } from "./page-aside.js";
|
|
42
42
|
import { useSizeClass as useSizeClass2 } from "./use-size-class.js";
|
|
43
43
|
import { PageTitle } from "./page-title.js";
|
|
44
|
-
|
|
45
|
-
for (const section of sections) {
|
|
46
|
-
const found = findActiveWithParent(section.items);
|
|
47
|
-
if (found)
|
|
48
|
-
return {
|
|
49
|
-
section: section.label,
|
|
50
|
-
parent: found.parent,
|
|
51
|
-
parentAnchor: found.parentAnchor,
|
|
52
|
-
parentHref: found.parentHref,
|
|
53
|
-
page: found.page
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return void 0;
|
|
57
|
-
}
|
|
58
|
-
function findActiveWithParent(items, parentLabel, parentAnchor, parentHref) {
|
|
59
|
-
for (const item of items) {
|
|
60
|
-
if (item.children) {
|
|
61
|
-
const found = findActiveWithParent(item.children, item.label, item.Anchor, item.href);
|
|
62
|
-
if (found) return found;
|
|
63
|
-
}
|
|
64
|
-
if (item.active) return { parent: parentLabel, parentAnchor, parentHref, page: item.label };
|
|
65
|
-
}
|
|
66
|
-
return void 0;
|
|
67
|
-
}
|
|
44
|
+
const NO_ACTIONS = [];
|
|
68
45
|
const COLLAPSE_VERSION = 1;
|
|
69
46
|
const collapseStores = /* @__PURE__ */ new Map();
|
|
70
47
|
function collapseStore(key) {
|
|
@@ -77,20 +54,21 @@ function collapseStore(key) {
|
|
|
77
54
|
function BasaltShell(props) {
|
|
78
55
|
assertRequiredProps("BasaltShell", props, ["brand", "nav"]);
|
|
79
56
|
const { nav, badges, isActive, getScrollElement, ...rest } = props;
|
|
80
|
-
const { sections, mobileNav } = useNav(nav, {
|
|
57
|
+
const { sections, mobileNav, activeCrumb } = useNav(nav, {
|
|
81
58
|
...badges !== void 0 && { badges },
|
|
82
59
|
...isActive !== void 0 && { isActive },
|
|
83
60
|
...getScrollElement !== void 0 && { getScrollElement }
|
|
84
61
|
});
|
|
85
|
-
return /* @__PURE__ */ jsx(ShellFrame, { ...rest, sections, mobileNav });
|
|
62
|
+
return /* @__PURE__ */ jsx(ShellFrame, { ...rest, sections, mobileNav, activeCrumb });
|
|
86
63
|
}
|
|
87
64
|
function ShellFrame(props) {
|
|
88
|
-
return /* @__PURE__ */ jsx(PageBarProvider, { globalActions: props.globalActions ??
|
|
65
|
+
return /* @__PURE__ */ jsx(PageBarProvider, { globalActions: props.globalActions ?? NO_ACTIONS, children: /* @__PURE__ */ jsx(AsideProvider, { children: /* @__PURE__ */ jsx(ShellBody, { ...props }) }) });
|
|
89
66
|
}
|
|
90
67
|
function ShellBody({
|
|
91
68
|
brand,
|
|
92
69
|
sections,
|
|
93
70
|
mobileNav,
|
|
71
|
+
activeCrumb,
|
|
94
72
|
globalActions,
|
|
95
73
|
sidebarBlocks,
|
|
96
74
|
settingsMenuItems,
|
|
@@ -146,7 +124,6 @@ function ShellBody({
|
|
|
146
124
|
registerSidebarToggle(toggleCollapse);
|
|
147
125
|
return () => registerSidebarToggle(null);
|
|
148
126
|
}, [toggleCollapse]);
|
|
149
|
-
const activeCrumb = findActiveCrumb(sections);
|
|
150
127
|
const extraMoreRows = accountRowCount(account) + (settingsMenuItems?.length ?? 0) + blockRowCount(sidebarBlocks);
|
|
151
128
|
const model = useMemo(
|
|
152
129
|
() => projectMobileNav(sections, { config: mobileNav, extraMoreRows }),
|
|
@@ -183,7 +160,7 @@ function ShellBody({
|
|
|
183
160
|
/* @__PURE__ */ jsx("div", { className: brandClasses.zone, "data-collapsed": collapsed || void 0, children: /* @__PURE__ */ jsx(AppBrand, { brand, collapsed, onToggleCollapse: toggleCollapse }) }),
|
|
184
161
|
/* @__PURE__ */ jsx("div", { className: headerClasses.lead, children: /* @__PURE__ */ jsx(AppBreadcrumbs, { ...activeCrumb }) }),
|
|
185
162
|
/* @__PURE__ */ jsx(PageBarOutlet, { className: headerClasses.pageBar }),
|
|
186
|
-
/* @__PURE__ */ jsx(HeaderGlobalActions, { actions: globalActions ??
|
|
163
|
+
/* @__PURE__ */ jsx(HeaderGlobalActions, { actions: globalActions ?? NO_ACTIONS })
|
|
187
164
|
] }) }),
|
|
188
165
|
/* @__PURE__ */ jsx(AppShell.Navbar, { p: 0, children: /* @__PURE__ */ jsx(
|
|
189
166
|
AppSidebar,
|
|
@@ -210,4 +210,11 @@ export type MobileNavConfig = {
|
|
|
210
210
|
*/
|
|
211
211
|
getScrollElement?: () => HTMLElement | null;
|
|
212
212
|
};
|
|
213
|
+
/** The breadcrumb for the one active destination (the nav resolver builds it; the header renders it). */
|
|
214
|
+
export type ActiveCrumb = {
|
|
215
|
+
section: string;
|
|
216
|
+
parent?: string | undefined;
|
|
217
|
+
parentAnchor?: NavAnchor | undefined;
|
|
218
|
+
page: string;
|
|
219
|
+
};
|
|
213
220
|
//# sourceMappingURL=nav-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nav-types.d.ts","sourceRoot":"","sources":["../../src/shell/nav-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAElD,6FAA6F;AAC7F,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE1D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;IAC9C,kGAAkG;IAClG,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,SAAS,CAAA;AAE5D,gCAAgC;A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,CAAA;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAEL,6EAA6E;AAC7E,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,CAAA;AAEvD,MAAM,MAAM,eAAe,GAAG;IAC5B,wFAAwF;IACxF,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAA;CAC5C,CAAA;AAED,yGAAyG;AACzG,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,YAAY,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACpC,IAAI,EAAE,MAAM,CAAA;CACb,CAAA"}
|
|
@@ -11,8 +11,10 @@ type AsideRegion = {
|
|
|
11
11
|
claimed: boolean;
|
|
12
12
|
/** The claiming page's fold state, published back so the shell can size the region. */
|
|
13
13
|
folded: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/** Registers the claimant `id`; the returned release ignores everything but that id. */
|
|
15
|
+
claim: (id: string) => () => void;
|
|
16
|
+
/** Publishes `id`'s fold. Only the current owner's counts (see `AsideProvider`). */
|
|
17
|
+
publishFolded: (id: string, folded: boolean) => void;
|
|
16
18
|
/**
|
|
17
19
|
* Bumped by `requestClose` — never 0 again once a close has been requested, so `PageAside` can
|
|
18
20
|
* treat "changed since mount" as "fold now" without a ref of its own. `ShellBody` is the one
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-aside.d.ts","sourceRoot":"","sources":["../../src/shell/page-aside.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-aside.d.ts","sourceRoot":"","sources":["../../src/shell/page-aside.tsx"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AASnE,KAAK,WAAW,GAAG;IACjB;4BACwB;IACxB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAC3C,mGAAmG;IACnG,OAAO,EAAE,OAAO,CAAA;IAChB,uFAAuF;IACvF,OAAO,EAAE,OAAO,CAAA;IAChB,uFAAuF;IACvF,MAAM,EAAE,OAAO,CAAA;IACf,wFAAwF;IACxF,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,IAAI,CAAA;IACjC,oFAAoF;IACpF,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IACpD;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,8FAA8F;IAC9F,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB,CAAA;AAgBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CA0D9E;AAED;mDACmD;AACnD,wBAAgB,cAAc,IAAI,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC,CAGzF;AAED;;;;;GAKG;AACH,eAAO,MA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