basalt-ui 2.13.2 → 2.13.3
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 +8 -0
- package/MIGRATING.md +16 -12
- package/dist/provider/create-router.d.ts +9 -4
- package/dist/provider/create-router.d.ts.map +1 -1
- package/dist/provider/create-router.js +1 -19
- package/dist/provider/error-fallback.module.css +4 -15
- package/dist/provider/error-fallback.module.css.d.ts +0 -1
- package/dist/provider/fallback.module.css +37 -0
- package/dist/provider/fallback.module.css.d.ts +11 -0
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +2 -1
- package/dist/provider/route-defaults.d.ts +10 -0
- package/dist/provider/route-defaults.d.ts.map +1 -0
- package/dist/provider/route-defaults.js +25 -0
- package/dist/provider/route-defaults.module.css +39 -0
- package/dist/provider/route-defaults.module.css.d.ts +10 -0
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/src/provider/create-router.tsx +2 -36
- package/src/provider/error-fallback.module.css +4 -15
- package/src/provider/error-fallback.module.css.d.ts +0 -1
- package/src/provider/fallback.module.css +37 -0
- package/src/provider/fallback.module.css.d.ts +11 -0
- package/src/provider/index.tsx +2 -1
- package/src/provider/route-defaults.module.css +39 -0
- package/src/provider/route-defaults.module.css.d.ts +10 -0
- package/src/provider/route-defaults.tsx +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [2.13.3](https://github.com/jkrumm/basalt-ui/compare/v2.13.2...v2.13.3) (2026-10-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* router default screens render without a provider ([8391f36](https://github.com/jkrumm/basalt-ui/commit/8391f36d81ca53e7f7bc4a4912b59e98bc7c833f))
|
|
7
|
+
* share the fallback styling, move the router defaults to their own module ([9efda55](https://github.com/jkrumm/basalt-ui/commit/9efda55175531a3f4f3b39c9c77bab350bd82a1f))
|
|
8
|
+
|
|
1
9
|
## [2.13.2](https://github.com/jkrumm/basalt-ui/compare/v2.13.1...v2.13.2) (2026-10-16)
|
|
2
10
|
|
|
3
11
|
|
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 | 2.13.1 | 2.13.2 | 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 | 2.13.2 | 2.13.3 | 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.3 — the router defaults need no provider
|
|
1050
|
+
|
|
1051
|
+
- **Behaviour: the default pending, error and not-found screens of `createBasaltRouter` / `basaltRouterOptions` are plain HTML, not Mantine components.** They render at the route that failed — above `BasaltProvider` for a root-level error or a pathless-layout provider — where Mantine threw "MantineProvider was not found". Same copy, "Try again" still calls `reset`; the spinner is an `<output>` (implicit `status`), the error `role="alert"`; the look matches the token look (`--vx-*` with literal fallbacks), not pixel-for-pixel. **What you lose:** theming through `components.Loader` / `components.Button` `defaultProps`, and `.mantine-Loader-root` / `.mantine-Button-root` selectors, no longer reach these screens. **Opt-out:** pass your own `defaultPendingComponent` / `defaultErrorComponent` / `defaultNotFoundComponent` (after the spread) for Mantine screens.
|
|
1052
|
+
|
|
1049
1053
|
## 2.13.2 — followers draw the cursor dots, a dashed line keeps its key
|
|
1050
1054
|
|
|
1051
1055
|
### Charts — a follower draws the cursor dots, a dashed line keeps its key, one dot mark per `getMarker` series
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `basaltRouterOptions` / `createBasaltRouter` — the router + QueryClient wiring (V2-SPEC § 2). One
|
|
3
|
+
* `QueryClient` per call (so an SSR entry gets one per request), carried on `context.queryClient`,
|
|
4
|
+
* plus the router defaults basalt owns: intent preloading with Query-owned freshness, scroll restoration, the
|
|
5
|
+
* pending / error / not-found components, and the route view transition (direction from the
|
|
6
|
+
* `BasaltShell` nav order, V2-SPEC § 5).
|
|
7
|
+
*/
|
|
1
8
|
import type { QueryClient, QueryClientConfig } from '@tanstack/react-query';
|
|
2
9
|
import { Router } from '@tanstack/react-router';
|
|
3
|
-
import type { AnyRoute,
|
|
10
|
+
import type { AnyRoute, RouterHistory } from '@tanstack/react-router';
|
|
4
11
|
import type { RouterHook } from '../telemetry.js';
|
|
12
|
+
import { ErrorComponent, NotFoundComponent, PendingComponent } from './route-defaults.js';
|
|
5
13
|
import { routeViewTransition } from './route-transition.js';
|
|
6
14
|
/** The root route's context: `createRootRouteWithContext<BasaltRouterContext>()`. */
|
|
7
15
|
export type BasaltRouterContext = {
|
|
@@ -22,9 +30,6 @@ declare const basaltRouterBrand: unique symbol;
|
|
|
22
30
|
export type BasaltRouter<TRouteTree extends AnyRoute = any> = BasaltRouterBase<TRouteTree> & {
|
|
23
31
|
readonly [basaltRouterBrand]: true;
|
|
24
32
|
};
|
|
25
|
-
declare function PendingComponent(): import("react").JSX.Element;
|
|
26
|
-
declare function ErrorComponent({ error, reset }: ErrorComponentProps): import("react").JSX.Element;
|
|
27
|
-
declare function NotFoundComponent(): import("react").JSX.Element;
|
|
28
33
|
/** The options `createBasaltRouter` owns. Each is `never` on it: basalt's, not a consumer knob. */
|
|
29
34
|
type ManagedKeys = Exclude<keyof BasaltRouterOptions, 'context'>;
|
|
30
35
|
/** `queryClient` and `__basalt` are basalt's: a consumer's would be replaced, so the type rejects them. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-router.d.ts","sourceRoot":"","sources":["../../src/provider/create-router.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-router.d.ts","sourceRoot":"","sources":["../../src/provider/create-router.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Center, Loader, Stack, Text } from "@mantine/core";
|
|
3
1
|
import { Router, createRouter } from "@tanstack/react-router";
|
|
4
|
-
import { toErrorMessage } from "../common/errors.js";
|
|
5
2
|
import { makeQueryClient } from "../query-client.js";
|
|
3
|
+
import { ErrorComponent, NotFoundComponent, PendingComponent } from "./route-defaults.js";
|
|
6
4
|
import {
|
|
7
5
|
guardViewTransitionRejections,
|
|
8
6
|
routeViewTransition,
|
|
9
7
|
supportsViewTransitionTypes
|
|
10
8
|
} from "./route-transition.js";
|
|
11
|
-
function PendingComponent() {
|
|
12
|
-
return /* @__PURE__ */ jsx(Center, { py: "xl", children: /* @__PURE__ */ jsx(Loader, { size: "sm" }) });
|
|
13
|
-
}
|
|
14
|
-
function ErrorComponent({ error, reset }) {
|
|
15
|
-
return /* @__PURE__ */ jsxs(Stack, { align: "flex-start", gap: "xs", p: "md", children: [
|
|
16
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, children: "Something went wrong" }),
|
|
17
|
-
/* @__PURE__ */ jsx(Text, { c: "dimmed", size: "sm", children: toErrorMessage(error) }),
|
|
18
|
-
/* @__PURE__ */ jsx(Button, { size: "compact-sm", variant: "default", onClick: reset, children: "Try again" })
|
|
19
|
-
] });
|
|
20
|
-
}
|
|
21
|
-
function NotFoundComponent() {
|
|
22
|
-
return /* @__PURE__ */ jsxs(Stack, { gap: 4, p: "md", children: [
|
|
23
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, children: "Page not found" }),
|
|
24
|
-
/* @__PURE__ */ jsx(Text, { c: "dimmed", size: "sm", children: "This address does not match any page." })
|
|
25
|
-
] });
|
|
26
|
-
}
|
|
27
9
|
function basaltRouterOptions(options = {}) {
|
|
28
10
|
return buildRouterOptions(options);
|
|
29
11
|
}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
/* The boundary renders ABOVE MantineProvider, so its fallback is plain HTML styled here
|
|
2
|
-
Mantine primitive, no inline style object (hidden-inline-style).
|
|
1
|
+
/* The boundary renders ABOVE MantineProvider, so its fallback is plain HTML styled here and in the
|
|
2
|
+
shared fallback.module.css — no Mantine primitive, no inline style object (hidden-inline-style). */
|
|
3
3
|
.root {
|
|
4
4
|
max-width: 32rem;
|
|
5
5
|
margin: 0 auto;
|
|
6
|
-
padding: var(--vx-space-stack-xl);
|
|
6
|
+
padding: var(--vx-space-stack-xl, 2rem);
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
|
-
gap: var(--vx-space-stack-md);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.reload {
|
|
13
|
-
align-self: flex-start;
|
|
14
|
-
font: inherit;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
padding: var(--vx-space-stack-xs) var(--vx-space-stack-md);
|
|
17
|
-
border: 1px solid var(--vx-divider);
|
|
18
|
-
border-radius: var(--vx-radius-ctrl);
|
|
19
|
-
background: transparent;
|
|
20
|
-
color: inherit;
|
|
9
|
+
gap: var(--vx-space-stack-md, 1rem);
|
|
21
10
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* The plain-HTML fallback vocabulary shared by RootBoundary's fallback and the router's default
|
|
2
|
+
screens: both render where Mantine may be absent, so neither can use a Mantine primitive. Every
|
|
3
|
+
--vx-* read carries a literal fallback, so they look right with the provider, with only
|
|
4
|
+
tokens.css, or with nothing. */
|
|
5
|
+
.stack {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
gap: var(--vx-space-stack-xs, 0.5rem);
|
|
10
|
+
padding: var(--vx-space-stack-md, 1rem);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.title {
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.text {
|
|
19
|
+
margin: 0;
|
|
20
|
+
font-size: var(--vx-text-sm, 0.875rem);
|
|
21
|
+
color: var(--vx-ink2, inherit);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.action {
|
|
25
|
+
align-self: flex-start;
|
|
26
|
+
min-width: 2.75rem;
|
|
27
|
+
min-height: 2.75rem;
|
|
28
|
+
font: inherit;
|
|
29
|
+
font-size: var(--vx-text-sm, 0.875rem);
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
padding: 0.25rem var(--vx-space-stack-md, 0.75rem);
|
|
32
|
+
border: 1px solid currentColor;
|
|
33
|
+
border: 1px solid var(--vx-divider, color-mix(in srgb, currentColor 25%, transparent));
|
|
34
|
+
border-radius: var(--vx-radius-ctrl, 6px);
|
|
35
|
+
background: transparent;
|
|
36
|
+
color: inherit;
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly stack: string
|
|
7
|
+
readonly title: string
|
|
8
|
+
readonly text: string
|
|
9
|
+
readonly action: string
|
|
10
|
+
}
|
|
11
|
+
export default classes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAMzD,OAAO,EAAE,SAAS,EAAwD,MAAM,OAAO,CAAA;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.tsx"],"names":[],"mappings":"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"}
|
package/dist/provider/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { QueryClientProvider } from "@tanstack/react-query";
|
|
|
5
5
|
import { RouterProvider, useRouter } from "@tanstack/react-router";
|
|
6
6
|
import { Component, Suspense, lazy, useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import fallbackClasses from "./error-fallback.module.css";
|
|
8
|
+
import sharedFallback from "./fallback.module.css";
|
|
8
9
|
import { cssVariablesResolver } from "../theme/index.js";
|
|
9
10
|
import { useLabTheme } from "./lab-theme.js";
|
|
10
11
|
import { buildDensityCss, buildFontsCss, buildPaletteCss, buildRadiusCss } from "../tokens/core.js";
|
|
@@ -38,7 +39,7 @@ function DefaultErrorFallback() {
|
|
|
38
39
|
"button",
|
|
39
40
|
{
|
|
40
41
|
type: "button",
|
|
41
|
-
className:
|
|
42
|
+
className: sharedFallback.action,
|
|
42
43
|
onClick: () => window.location.reload(),
|
|
43
44
|
children: "Reload page"
|
|
44
45
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The router's default pending / error / not-found screens. Provider-free on purpose: a route's
|
|
3
|
+
* screen renders at the route that failed, which can sit above `BasaltProvider` (a root-level error,
|
|
4
|
+
* or a pathless-layout provider), so no Mantine primitive. Wired by `createBasaltRouter`.
|
|
5
|
+
*/
|
|
6
|
+
import type { ErrorComponentProps } from '@tanstack/react-router';
|
|
7
|
+
export declare function PendingComponent(): import("react").JSX.Element;
|
|
8
|
+
export declare function ErrorComponent({ error, reset }: ErrorComponentProps): import("react").JSX.Element;
|
|
9
|
+
export declare function NotFoundComponent(): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=route-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-defaults.d.ts","sourceRoot":"","sources":["../../src/provider/route-defaults.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAKjE,wBAAgB,gBAAgB,gCAM/B;AAGD,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,mBAAmB,+BAUnE;AAED,wBAAgB,iBAAiB,gCAOhC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { toErrorMessage } from "../common/errors.js";
|
|
3
|
+
import fallback from "./fallback.module.css";
|
|
4
|
+
import classes from "./route-defaults.module.css";
|
|
5
|
+
function PendingComponent() {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", { className: classes.center, children: /* @__PURE__ */ jsx("output", { className: classes.spinner, "aria-label": "Loading" }) });
|
|
7
|
+
}
|
|
8
|
+
function ErrorComponent({ error, reset }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { className: fallback.stack, role: "alert", children: [
|
|
10
|
+
/* @__PURE__ */ jsx("p", { className: fallback.title, children: "Something went wrong" }),
|
|
11
|
+
/* @__PURE__ */ jsx("p", { className: fallback.text, children: toErrorMessage(error) }),
|
|
12
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: fallback.action, onClick: reset, children: "Try again" })
|
|
13
|
+
] });
|
|
14
|
+
}
|
|
15
|
+
function NotFoundComponent() {
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", { className: classes.notFound, children: [
|
|
17
|
+
/* @__PURE__ */ jsx("p", { className: fallback.title, children: "Page not found" }),
|
|
18
|
+
/* @__PURE__ */ jsx("p", { className: fallback.text, children: "This address does not match any page." })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
ErrorComponent,
|
|
23
|
+
NotFoundComponent,
|
|
24
|
+
PendingComponent
|
|
25
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* The router's default screens render at the route that failed, which can be ABOVE BasaltProvider.
|
|
2
|
+
Shared stack/title/text/action live in fallback.module.css; same literal-fallback rule. */
|
|
3
|
+
.center {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
padding: var(--vx-space-stack-xl, 2rem) 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.spinner {
|
|
10
|
+
width: 1.25rem;
|
|
11
|
+
height: 1.25rem;
|
|
12
|
+
border: 2px solid currentColor;
|
|
13
|
+
border-top-color: currentColor;
|
|
14
|
+
border: 2px solid color-mix(in srgb, currentColor 20%, transparent);
|
|
15
|
+
border-top-color: var(--vx-accent, currentColor);
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
animation: spin 0.8s linear infinite;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes spin {
|
|
21
|
+
to {
|
|
22
|
+
transform: rotate(360deg);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* A static ring is still a loading mark; the aria-label carries the state. */
|
|
27
|
+
@media (prefers-reduced-motion: reduce) {
|
|
28
|
+
.spinner {
|
|
29
|
+
animation: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Not-found is a statement, not an error with an action: its own column, no flex-start alignment. */
|
|
34
|
+
.notFound {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
gap: 4px;
|
|
38
|
+
padding: var(--vx-space-stack-md, 1rem);
|
|
39
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly center: string
|
|
7
|
+
readonly spinner: string
|
|
8
|
+
readonly notFound: string
|
|
9
|
+
}
|
|
10
|
+
export default classes
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v2.13.
|
|
1
|
+
# basalt-ui v2.13.3
|
|
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.13.
|
|
16
|
+
Version: 2.13.3
|
|
17
17
|
|
|
18
18
|
## basalt-ui
|
|
19
19
|
Import: import { ... } from 'basalt-ui'
|
package/package.json
CHANGED
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
* pending / error / not-found components, and the route view transition (direction from the
|
|
6
6
|
* `BasaltShell` nav order, V2-SPEC § 5).
|
|
7
7
|
*/
|
|
8
|
-
import { Button, Center, Loader, Stack, Text } from '@mantine/core'
|
|
9
8
|
import type { QueryClient, QueryClientConfig } from '@tanstack/react-query'
|
|
10
9
|
import { Router, createRouter } from '@tanstack/react-router'
|
|
11
|
-
import type { AnyRoute,
|
|
12
|
-
import { toErrorMessage } from '../common/errors'
|
|
10
|
+
import type { AnyRoute, RouterHistory } from '@tanstack/react-router'
|
|
13
11
|
import { makeQueryClient } from '../query-client'
|
|
14
12
|
import type { RouterHook } from '../telemetry'
|
|
13
|
+
import { ErrorComponent, NotFoundComponent, PendingComponent } from './route-defaults'
|
|
15
14
|
import {
|
|
16
15
|
guardViewTransitionRejections,
|
|
17
16
|
routeViewTransition,
|
|
@@ -49,39 +48,6 @@ export type BasaltRouter<
|
|
|
49
48
|
readonly [basaltRouterBrand]: true
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
function PendingComponent() {
|
|
53
|
-
return (
|
|
54
|
-
<Center py="xl">
|
|
55
|
-
<Loader size="sm" />
|
|
56
|
-
</Center>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function ErrorComponent({ error, reset }: ErrorComponentProps) {
|
|
61
|
-
return (
|
|
62
|
-
<Stack align="flex-start" gap="xs" p="md">
|
|
63
|
-
<Text fw={600}>Something went wrong</Text>
|
|
64
|
-
<Text c="dimmed" size="sm">
|
|
65
|
-
{toErrorMessage(error)}
|
|
66
|
-
</Text>
|
|
67
|
-
<Button size="compact-sm" variant="default" onClick={reset}>
|
|
68
|
-
Try again
|
|
69
|
-
</Button>
|
|
70
|
-
</Stack>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function NotFoundComponent() {
|
|
75
|
-
return (
|
|
76
|
-
<Stack gap={4} p="md">
|
|
77
|
-
<Text fw={600}>Page not found</Text>
|
|
78
|
-
<Text c="dimmed" size="sm">
|
|
79
|
-
This address does not match any page.
|
|
80
|
-
</Text>
|
|
81
|
-
</Stack>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
51
|
/** The options `createBasaltRouter` owns. Each is `never` on it: basalt's, not a consumer knob. */
|
|
86
52
|
type ManagedKeys = Exclude<keyof BasaltRouterOptions, 'context'>
|
|
87
53
|
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
/* The boundary renders ABOVE MantineProvider, so its fallback is plain HTML styled here
|
|
2
|
-
Mantine primitive, no inline style object (hidden-inline-style).
|
|
1
|
+
/* The boundary renders ABOVE MantineProvider, so its fallback is plain HTML styled here and in the
|
|
2
|
+
shared fallback.module.css — no Mantine primitive, no inline style object (hidden-inline-style). */
|
|
3
3
|
.root {
|
|
4
4
|
max-width: 32rem;
|
|
5
5
|
margin: 0 auto;
|
|
6
|
-
padding: var(--vx-space-stack-xl);
|
|
6
|
+
padding: var(--vx-space-stack-xl, 2rem);
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
|
-
gap: var(--vx-space-stack-md);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.reload {
|
|
13
|
-
align-self: flex-start;
|
|
14
|
-
font: inherit;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
padding: var(--vx-space-stack-xs) var(--vx-space-stack-md);
|
|
17
|
-
border: 1px solid var(--vx-divider);
|
|
18
|
-
border-radius: var(--vx-radius-ctrl);
|
|
19
|
-
background: transparent;
|
|
20
|
-
color: inherit;
|
|
9
|
+
gap: var(--vx-space-stack-md, 1rem);
|
|
21
10
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* The plain-HTML fallback vocabulary shared by RootBoundary's fallback and the router's default
|
|
2
|
+
screens: both render where Mantine may be absent, so neither can use a Mantine primitive. Every
|
|
3
|
+
--vx-* read carries a literal fallback, so they look right with the provider, with only
|
|
4
|
+
tokens.css, or with nothing. */
|
|
5
|
+
.stack {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
gap: var(--vx-space-stack-xs, 0.5rem);
|
|
10
|
+
padding: var(--vx-space-stack-md, 1rem);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.title {
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.text {
|
|
19
|
+
margin: 0;
|
|
20
|
+
font-size: var(--vx-text-sm, 0.875rem);
|
|
21
|
+
color: var(--vx-ink2, inherit);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.action {
|
|
25
|
+
align-self: flex-start;
|
|
26
|
+
min-width: 2.75rem;
|
|
27
|
+
min-height: 2.75rem;
|
|
28
|
+
font: inherit;
|
|
29
|
+
font-size: var(--vx-text-sm, 0.875rem);
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
padding: 0.25rem var(--vx-space-stack-md, 0.75rem);
|
|
32
|
+
border: 1px solid currentColor;
|
|
33
|
+
border: 1px solid var(--vx-divider, color-mix(in srgb, currentColor 25%, transparent));
|
|
34
|
+
border-radius: var(--vx-radius-ctrl, 6px);
|
|
35
|
+
background: transparent;
|
|
36
|
+
color: inherit;
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly stack: string
|
|
7
|
+
readonly title: string
|
|
8
|
+
readonly text: string
|
|
9
|
+
readonly action: string
|
|
10
|
+
}
|
|
11
|
+
export default classes
|
package/src/provider/index.tsx
CHANGED
|
@@ -22,6 +22,7 @@ import type { AnyRouter } from '@tanstack/react-router'
|
|
|
22
22
|
import { Component, Suspense, lazy, useEffect, useMemo, useRef, useState } from 'react'
|
|
23
23
|
import type { ErrorInfo, ReactNode } from 'react'
|
|
24
24
|
import fallbackClasses from './error-fallback.module.css'
|
|
25
|
+
import sharedFallback from './fallback.module.css'
|
|
25
26
|
import { cssVariablesResolver } from '../theme'
|
|
26
27
|
import { useLabTheme } from './lab-theme'
|
|
27
28
|
import { buildDensityCss, buildFontsCss, buildPaletteCss, buildRadiusCss } from '../tokens/core'
|
|
@@ -142,7 +143,7 @@ function DefaultErrorFallback(): ReactNode {
|
|
|
142
143
|
/>
|
|
143
144
|
<button
|
|
144
145
|
type="button"
|
|
145
|
-
className={
|
|
146
|
+
className={sharedFallback.action}
|
|
146
147
|
onClick={() => window.location.reload()}
|
|
147
148
|
>
|
|
148
149
|
Reload page
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* The router's default screens render at the route that failed, which can be ABOVE BasaltProvider.
|
|
2
|
+
Shared stack/title/text/action live in fallback.module.css; same literal-fallback rule. */
|
|
3
|
+
.center {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
padding: var(--vx-space-stack-xl, 2rem) 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.spinner {
|
|
10
|
+
width: 1.25rem;
|
|
11
|
+
height: 1.25rem;
|
|
12
|
+
border: 2px solid currentColor;
|
|
13
|
+
border-top-color: currentColor;
|
|
14
|
+
border: 2px solid color-mix(in srgb, currentColor 20%, transparent);
|
|
15
|
+
border-top-color: var(--vx-accent, currentColor);
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
animation: spin 0.8s linear infinite;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes spin {
|
|
21
|
+
to {
|
|
22
|
+
transform: rotate(360deg);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* A static ring is still a loading mark; the aria-label carries the state. */
|
|
27
|
+
@media (prefers-reduced-motion: reduce) {
|
|
28
|
+
.spinner {
|
|
29
|
+
animation: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Not-found is a statement, not an error with an action: its own column, no flex-start alignment. */
|
|
34
|
+
.notFound {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
gap: 4px;
|
|
38
|
+
padding: var(--vx-space-stack-md, 1rem);
|
|
39
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly center: string
|
|
7
|
+
readonly spinner: string
|
|
8
|
+
readonly notFound: string
|
|
9
|
+
}
|
|
10
|
+
export default classes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The router's default pending / error / not-found screens. Provider-free on purpose: a route's
|
|
3
|
+
* screen renders at the route that failed, which can sit above `BasaltProvider` (a root-level error,
|
|
4
|
+
* or a pathless-layout provider), so no Mantine primitive. Wired by `createBasaltRouter`.
|
|
5
|
+
*/
|
|
6
|
+
import type { ErrorComponentProps } from '@tanstack/react-router'
|
|
7
|
+
import { toErrorMessage } from '../common/errors'
|
|
8
|
+
import fallback from './fallback.module.css'
|
|
9
|
+
import classes from './route-defaults.module.css'
|
|
10
|
+
|
|
11
|
+
export function PendingComponent() {
|
|
12
|
+
return (
|
|
13
|
+
<div className={classes.center}>
|
|
14
|
+
<output className={classes.spinner} aria-label="Loading" />
|
|
15
|
+
</div>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// No log here: `defaultOnCatch` (create-router.tsx) already reports every route error.
|
|
20
|
+
export function ErrorComponent({ error, reset }: ErrorComponentProps) {
|
|
21
|
+
return (
|
|
22
|
+
<div className={fallback.stack} role="alert">
|
|
23
|
+
<p className={fallback.title}>Something went wrong</p>
|
|
24
|
+
<p className={fallback.text}>{toErrorMessage(error)}</p>
|
|
25
|
+
<button type="button" className={fallback.action} onClick={reset}>
|
|
26
|
+
Try again
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function NotFoundComponent() {
|
|
33
|
+
return (
|
|
34
|
+
<div className={classes.notFound}>
|
|
35
|
+
<p className={fallback.title}>Page not found</p>
|
|
36
|
+
<p className={fallback.text}>This address does not match any page.</p>
|
|
37
|
+
</div>
|
|
38
|
+
)
|
|
39
|
+
}
|