@nxgt/material 3.20.0 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/README.md +6 -4
- package/bin/nxgt-backdrop-sprite.js +15 -0
- package/dist/background-BtSZsTvY.js +286 -0
- package/dist/backgrounds/css-react/icons-quiet.css +5 -5
- package/dist/backgrounds/css-react/icons-tint.css +98 -0
- package/dist/backgrounds/css-react/icons.css +100 -33
- package/dist/backgrounds.js +1 -1
- package/dist/{celestial-scene-DaOsRFF3.js → celestial-scene-8Muu6f7O.js} +1 -1
- package/dist/components/background-shared.css +5 -0
- package/dist/components/components.css +4 -7
- package/dist/components/ui/display/chip/chip-parts.css +17 -30
- package/dist/components/ui/fields/attributes/attributes.css +3 -0
- package/dist/components/ui/layout/app-shell/activity-backdrop-shapes.css +1 -1
- package/dist/components/ui/layout/auth-card/auth-card-backdrop.css +30 -0
- package/dist/{components-SJxc3fpp.js → components-B0oezhGe.js} +13966 -13937
- package/dist/components.js +16 -16
- package/dist/editor.js +1 -1
- package/dist/{empty-state-CJh9f2pc.js → empty-state-lj7vjYWG.js} +1 -1
- package/dist/icon-sprites-CaYXzOL4.js +46 -0
- package/dist/icons-scene-M4HBeN2c.js +54 -0
- package/dist/{illustration-BmQmvW_4.js → illustration-B4_W-OUS.js} +2 -2
- package/dist/illustrations.js +1 -1
- package/dist/lib/backgrounds/background/partials/icons-check.d.ts +2 -2
- package/dist/lib/backgrounds/background/partials/icons-keys.d.ts +21 -1
- package/dist/lib/backgrounds/background/partials/icons-scene.d.ts +15 -6
- package/dist/lib/backgrounds/background/partials/use-icons-scene.d.ts +13 -8
- package/dist/lib/backgrounds/background/types.d.ts +26 -12
- package/dist/lib/backgrounds/index.d.ts +1 -1
- package/dist/lib/components/ui/dates/date-field/use-typed-date.d.ts +2 -2
- package/dist/lib/components/ui/dates/picker-trigger/typed-day.d.ts +7 -2
- package/dist/lib/components/ui/display/chip/partials/chip-dismiss-button.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +7 -2
- package/dist/lib/components/ui/layout/app-shell/shapes-clear-content.d.ts +10 -3
- package/dist/lib/components/ui/layout/app-shell/theme-backdrop.d.ts +3 -1
- package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +3 -3
- package/dist/lib/components/ui/layout/app-shell/watch-content.d.ts +28 -8
- package/dist/lib/components/ui/layout/auth-card/auth-card-backdrop.d.ts +23 -0
- package/dist/lib/components/ui/layout/auth-card/auth-card.d.ts +15 -1
- package/dist/lib/components/ui/primitives/icon/icon-sprites.d.ts +40 -1
- package/dist/lib/themes/define-theme.d.ts +8 -0
- package/dist/lib/themes/index.d.ts +2 -1
- package/dist/lib/vite/index.d.ts +1 -1
- package/dist/main.js +28 -28
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{public-DWuBn4t_.js → public-DAF5SCWH.js} +1 -1
- package/dist/{scene-options-CCy3V7XS.js → scene-options-2zNF3ZkQ.js} +4 -2
- package/dist/theme-picker.js +3 -3
- package/dist/themes.js +9 -4
- package/dist/{use-chat-composer-BBFuKNqC.js → use-chat-composer-B0ze1cU9.js} +3 -3
- package/docs/components/data-display.md +1 -1
- package/docs/components/date-and-time.md +8 -4
- package/docs/components/navigation-and-layout.md +22 -0
- package/docs/components/primitives.md +21 -0
- package/docs/guides/app-shell.md +9 -8
- package/docs/guides/backgrounds.md +214 -16
- package/docs/guides/icon-motifs.md +30 -12
- package/docs/guides/themes.md +25 -4
- package/docs/guides/theming.md +7 -0
- package/docs/guides/vite-plugin.md +26 -0
- package/docs/previews/backgrounds-background-from-theme.webp +0 -0
- package/docs/previews/backgrounds-icons.webp +0 -0
- package/docs/previews/backgrounds-matrix.webp +0 -0
- package/docs/previews/date-time-datefield.webp +0 -0
- package/docs/previews/date-time-daterangefield.webp +0 -0
- package/docs/previews/foundations-themes-icon-motifs.webp +0 -0
- package/docs/roadmap.md +6 -0
- package/docs/troubleshooting.md +80 -4
- package/lib/backgrounds/css-react/icons-quiet.css +5 -5
- package/lib/backgrounds/css-react/icons-tint.css +98 -0
- package/lib/backgrounds/css-react/icons.css +100 -33
- package/lib/components/background-shared.css +5 -0
- package/lib/components/components.css +4 -7
- package/lib/components/ui/display/chip/chip-parts.css +17 -30
- package/lib/components/ui/fields/attributes/attributes.css +3 -0
- package/lib/components/ui/layout/app-shell/activity-backdrop-shapes.css +1 -1
- package/lib/components/ui/layout/auth-card/auth-card-backdrop.css +30 -0
- package/package.json +8 -3
- package/dist/background-Ce7M5V42.js +0 -250
- package/dist/icon-sprites-FxHyqyhg.js +0 -30
- package/dist/icons-scene-BpIauJ5d.js +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# @nxgt/material
|
|
2
2
|
|
|
3
|
+
## 3.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1520](https://github.com/softistx/nxgt-material/pull/1520) [`a8bd7b0`](https://github.com/softistx/nxgt-material/commit/a8bd7b0e40fe89e73dc17dfd2870122248707656) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `AuthCard` takes a `backdrop` ([#1507](https://github.com/softistx/nxgt-material/issues/1507)): the nearest theme's background by default (nothing without a theme provider), a `Background` preset or any node when given, `false` for none. It is drawn in an absolute, `aria-hidden`, inert layer behind the page, and keeps clear of the brand row, the card and the page's surfaces, text and controls with the same pass as `ActivityLayout`'s (`keepClear`, `true` by default; `false` lets the shapes run under the card). The shapes that meet the content are dropped, never moved.
|
|
8
|
+
|
|
9
|
+
**Visual change:** an `AuthCard` under a theme provider now draws the theme's background. Pass `backdrop={false}` to keep the plain page.
|
|
10
|
+
|
|
11
|
+
- [#1578](https://github.com/softistx/nxgt-material/pull/1578) [`789d95e`](https://github.com/softistx/nxgt-material/commit/789d95e0ef86f03d7c83453355507e885906be29) Thanks [@SteveGT96](https://github.com/SteveGT96)! - The calm backdrop ([#1506](https://github.com/softistx/nxgt-material/issues/1506), [#1507](https://github.com/softistx/nxgt-material/issues/1507)), in one picture. The slices above carry the details; this is what changes for an app and how to get the old look back.
|
|
12
|
+
|
|
13
|
+
**Visual change, by default.**
|
|
14
|
+
|
|
15
|
+
- `Background preset="icons"` (and a theme that names it) draws shapes and about one icon in five, in **one** soft tint, at `medium` density, spread evenly over the frame, with the new radial shapes (`rays`, `dotted-ring`, `concentric`), in a weighted mix of five icon styles (light 3, thin 3, sharp-regular 2, sharp-light 2, duotone-thin 1). A glyph that meets a card, a table, a list, a text or a control is dropped, never moved.
|
|
16
|
+
- `AuthCard` draws the theme's background by default, with the brand and the card kept clear (`backdrop={false}` for the plain page).
|
|
17
|
+
- **Upgrade action:** an `IconSpritesProvider` without `servedStyles` → add `servedStyles` listing the sprite files you serve (or the reduced sprite); otherwise icons whose style you do not serve are blank. `edition="free"` is the shortcut for Free `regular` and `solid`: a style that is not served is dropped, and with none left the scene draws those two.
|
|
18
|
+
|
|
19
|
+
**The reduced sprite.** The backdrop no longer needs the full Font Awesome sheets: `npx nxgt-backdrop-sprite --pack school` (or `nxgtMaterial({ backdropSprite: { packs: ['school'] } })`) builds one sprite of a few KB from your own install, and `IconSpritesProvider backdropSprite` reads it. A pack or an icon list is required.
|
|
20
|
+
|
|
21
|
+
**Theme keys.** `defineTheme` accepts and checks the knobs in a theme's `background`, and each one reaches the scene: `iconMotif.layout: 'even'`, `iconMotif.colors` (`'one' | 'palette' | 'classic'`), a weighted `iconStyle` list (`[{ style, weight? }]`), `motif.icons { pack, style, ratio }` and `motif.density` (`'low' | 'medium' | 'high'` or a count from 1 to 600). `motif` is checked for every preset: an unknown key, a `layout` or `density` outside these lists, or a bad `motif.icons` is ignored and never throws (**4.0:** a strict error): core's `defineTheme(definition, { warn })` (new option) tells `warn`, and `@nxgt/material`'s `defineTheme` passes `console.warn` outside production; `definePlainTheme` ignores `motif.icons` like the other icon keys.
|
|
22
|
+
|
|
23
|
+
**The previous look.** Three props, in a theme the same keys: `<Background preset="icons" iconStyle="duotone-thin" iconMotif={{ layout: 'scatter', colors: 'classic' }} />`.
|
|
24
|
+
|
|
25
|
+
**Size.** The core `/backgrounds` entry weighs 25449 B gzipped (budget 25600 B) and the `/backgrounds/icons` builder about 2780 B (budget 3072 B); the theme budgets grew by about 256 B for the whole entry and 128 B for `/theme/define`.
|
|
26
|
+
|
|
27
|
+
Docs: the backgrounds guide (the mix, density, colours, families and weights, the drop rule, the reduced sprite, the sprites each style needs, the previous look, the theme keys), troubleshooting, the theming and themes guides, the core README and docs; the `nxgt-material` plugin's `compose-scenes` and `build-a-theme` skills teach the new defaults.
|
|
28
|
+
|
|
29
|
+
**Vite `base`.** `nxgtMaterial({ backdropSprite })` honours Vite's `base`: the file is still emitted under the plugin `base` (`dist/sprites/backdrop.svg`), while the dev server and the logged `backdropSprite` href carry Vite's `base` (`/app/sprites/backdrop.svg`).
|
|
30
|
+
|
|
31
|
+
- [#1544](https://github.com/softistx/nxgt-material/pull/1544) [`139a9da`](https://github.com/softistx/nxgt-material/commit/139a9da525e22110ac1de3873da8ea8f07225c59) Thanks [@SteveGT96](https://github.com/SteveGT96)! - The backdrop of `ActivityLayout` and `AuthCard` (the only two that run the pass; a bare `Background` never does) now drops every glyph whose box meets the content (8 px margin), never moving or resizing it. The content now includes the whole box of a card, a stat card, a table, a data grid, a list (`ul`, `ol`), an alert or a dialog, not only the text and controls inside, so no glyph is left half hidden at a card's edge. The server still renders every glyph; the drop happens after the first measure on the client (batched in one frame, boxes read before any write), with a 150 ms fade (none under reduced motion), and again on resize and when the content changes.
|
|
32
|
+
|
|
33
|
+
**Visual change:** the open areas keep their glyphs; the space behind and between cards and lists is empty.
|
|
34
|
+
|
|
35
|
+
- [#1541](https://github.com/softistx/nxgt-material/pull/1541) [`fc76acb`](https://github.com/softistx/nxgt-material/commit/fc76acb75cd997027d043af483265760096ea8b0) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Backgrounds, the calm mixed backdrop ([#1506](https://github.com/softistx/nxgt-material/issues/1506)): `preset="icons"` draws shapes and a few icons in one soft tint by default. **The default look of `preset="icons"` changes**; no prop is removed and the old look stays reachable by props.
|
|
36
|
+
|
|
37
|
+
- `motif.icons` (new, `{ pack?, style?, ratio }`, type `MotifIcons`) on `preset="shapes"`: each cell of an even, jittered grid is an icon with the probability `ratio`, else a motif shape (the calm default set, the radial ones counted twice so they show; sizes smaller and closer together than the plain preset's). `motif.density` counts shapes and icons together (`medium` unless set). Core draws the shapes; `iconCells()` of `@nxgt/material-core/backgrounds/icons` supplies the icons through the new `SceneOptions.iconCells`. Plain `shapes` scenes are byte-identical to before.
|
|
38
|
+
- `preset="icons"` is that mix by default: `ratio` 0.2, `medium` density, `iconMotif.layout: 'even'` (new, the default), `colors: 'one'`. Any other layout (`scatter`, `grid`, `constellation`, `drift`) draws icons only, as before.
|
|
39
|
+
- `iconMotif.colors` (new): `'one'` (default) the primary tone at low contrast, soft in dark, never bright, with the shapes at about 0.8 of it; `'palette'` primary, secondary and tertiary at the same contrast; `'classic'` the three tones at full strength. A class on the scene root (`ic-c-one`, `ic-c-palette`, `ic-c-classic`); the tint sets `color` and `--fa-primary-color`, so flat styles follow.
|
|
40
|
+
- `iconStyle` takes a weighted list `[{ style, weight? }]` (types `IconStyleMix`, `IconStyleWeight`). The default is light 3, thin 3, sharp-regular 2, sharp-light 2, duotone-thin 1 (it was duotone thin). A weighted list is cut to the sprites the app serves: the new `IconSpritesProvider` prop `servedStyles` lists the files (`edition="free"` serves `regular` and `solid`); the weights of what is left keep their proportions, and with nothing left the scene draws Free `regular` and `solid`. A plain style or list is never cut.
|
|
41
|
+
- To keep the look before this release: `<Background preset="icons" iconStyle="duotone-thin" iconMotif={{ layout: 'scatter', colors: 'classic' }} />`.
|
|
42
|
+
- Apps that serve only some Pro sprites (or none) should set `servedStyles` (or `edition="free"`) on their `IconSpritesProvider`: the new default draws five styles.
|
|
43
|
+
- Core: `buildIconScene` reads `servedStyles` and weighted styles too; new exports `iconCells`, `DEFAULT_STYLE_MIX`, `toningClasses`, `resolveStyleMix`, `IconCells`, `IconCell`, `IconColors`. `useServedStyles()` joins `useSpriteBase()` and `useIconEdition()`.
|
|
44
|
+
|
|
45
|
+
- [#1519](https://github.com/softistx/nxgt-material/pull/1519) [`3ff19d3`](https://github.com/softistx/nxgt-material/commit/3ff19d3dbbc351b9a3414f323eb9a5274d708d0f) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Backgrounds, the motif engine of the calm backdrop ([#1506](https://github.com/softistx/nxgt-material/issues/1506)): three radial shapes, an even layout and a `medium` density. No default changes: a scene drawn with the same seed and options as before is byte-identical.
|
|
46
|
+
|
|
47
|
+
- New motif shapes `rays` (eight spokes round an empty centre), `dotted-ring` (twelve dots on a circle) and `concentric` (three rings), appended to `MOTIF_SHAPES_ALL` (now 25) and to the `MotifShape` union. They are drawn item by item, so their stroke keeps a readable width at small sizes. The `checker` and `diagonal-checker` marks keep to the first 22 shapes.
|
|
48
|
+
- `motif.layout` (new, `shapes` only): `'scatter'` (default, as before) or `'even'`, a seeded, jittered grid over the whole frame with one item per cell: no empty corner, no cluster, the same scene for the same seed (SSR). New type `MotifLayout`. The sizes still come from `motif.size`; a size above 62 % of the cell's short side is brought down so a large item does not take its neighbours' place.
|
|
49
|
+
- `motif.density` also takes `'medium'` (about 160 items on the 1600 x 1000 scene, the count of the calm mix) or a number, the item count on that scene (up to 600, scaled with the frame's area). `low`, `default` and `high` keep their meaning. The presets with three rows (`halftone`, `truchet`, `constellation`, `confetti-grid`, `floating`) read `medium` and counts from 113 as `high` and counts under 66 as `low`; `moon` and the celestial presets draw `medium` and numbers as `default`. New types `MotifDensity` (widened) and `NamedDensity`.
|
|
50
|
+
|
|
51
|
+
- [#1545](https://github.com/softistx/nxgt-material/pull/1545) [`72f20b0`](https://github.com/softistx/nxgt-material/commit/72f20b044b8c6c18429a7f556f00e7c36e73f2bd) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Backgrounds, a reduced backdrop sprite ([#1506](https://github.com/softistx/nxgt-material/issues/1506)): the backdrop never needs the full Font Awesome sheets. One small SVG sprite holds only the pack's icon names in the styles you choose, built from your own `@fortawesome/*` install.
|
|
52
|
+
|
|
53
|
+
- New command `nxgt-backdrop-sprite` (a bin of `@nxgt/material`, also of `@nxgt/material-core`): `--pack` and `--icon` (one of them is required: there is no default pack, the command fails and shows the fix), `--style` (default: the backdrop's light, thin, sharp-regular, sharp-light and duotone-thin that the install has, else `regular` and `solid`), `--out` (default `public/sprites/backdrop.svg`), `--base` (default `/sprites/`), `--from`. It reads `@fortawesome/fontawesome-pro`, else `-free`, and prints the `IconSpritesProvider` value. One `<symbol id="<file>--<name>">` per name and style; a style that lacks a name takes the glyph of the next one. About 10–14 KB gzipped per pack with the five default Pro styles; a Free pack in `regular` and `solid` is about 3 KB gzipped. `--out` not under `--base` warns.
|
|
54
|
+
- `nxgtMaterial({ backdropSprite: { packs? | icons?, styles?, outFile?, base?, sources? } })` (`packs` or `icons` required; `true` is not accepted) in the Vite plugin: the same build at `vite build` (emitted under `base`) and served by the dev server. Core exports `buildBackdropSprite`, `backdropSpriteHref`, `runBackdropSprite`, `runBackdropSpriteCli` and the types `BackdropSpriteOptions` and `BackdropSpriteResult` from `/vite`.
|
|
55
|
+
- `IconSpritesProvider backdropSprite` (new): `"/sprites/backdrop.svg"`, or `{ href, styles }` whose styles count as served. `Background preset="icons"` then draws `<use href="/sprites/backdrop.svg#thin--book-open">` instead of the per-style sheets; `Icon` and `Illustration` still read `base`. New hook `useBackdropSprite()`. An href that is not root-relative throws `IconRefError` (`base`).
|
|
56
|
+
- Core: `IconSceneOptions.backdropSprite` (and `iconCells`), `backdropSymbolId` in `/backgrounds/icons`; `assertSafeScene` accepts `#file--name` ids in a sprite reference.
|
|
57
|
+
- Docs: the backgrounds guide lists the sprites each style needs, the command and the troubleshooting entry for blank icons.
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [[`789d95e`](https://github.com/softistx/nxgt-material/commit/789d95e0ef86f03d7c83453355507e885906be29), [`fc76acb`](https://github.com/softistx/nxgt-material/commit/fc76acb75cd997027d043af483265760096ea8b0), [`3ff19d3`](https://github.com/softistx/nxgt-material/commit/3ff19d3dbbc351b9a3414f323eb9a5274d708d0f), [`72f20b0`](https://github.com/softistx/nxgt-material/commit/72f20b044b8c6c18429a7f556f00e7c36e73f2bd)]:
|
|
62
|
+
- @nxgt/material-core@0.34.0
|
|
63
|
+
|
|
64
|
+
## 3.21.0
|
|
65
|
+
|
|
66
|
+
### Minor Changes
|
|
67
|
+
|
|
68
|
+
- [#1602](https://github.com/softistx/nxgt-material/pull/1602) [`800051d`](https://github.com/softistx/nxgt-material/commit/800051ddb782564801354793fe59c3a2bf9589c3) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `DateField` / `DateFormField` / `DateRangeField` keep a value outside `minDate`, `maxDate`, `disablePast` or `disableFuture` (one set from the form or typed) instead of moving it onto the bound's day with its time of day, which turned a moment after midnight into one 24 hours earlier and let a form rule pass; the form refuses it and the calendar still keeps the day unpickable. The `Chip` dismiss ✕ has its own 24x24 box (44x44 on a coarse pointer), so axe `target-size` passes; the glyph and the chip height are unchanged. Fixes [#1583](https://github.com/softistx/nxgt-material/issues/1583). Fixes [#1584](https://github.com/softistx/nxgt-material/issues/1584).
|
|
69
|
+
|
|
70
|
+
Migration: a typed date outside `minDate`/`maxDate`/`disablePast`/`disableFuture` is no longer moved to the nearest allowed day on blur. It is kept, and the form refuses it. If your schema has no min/max rule, add one (see date-and-time.md).
|
|
71
|
+
|
|
3
72
|
## 3.20.0
|
|
4
73
|
|
|
5
74
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -197,12 +197,12 @@ reads `duotone.svg`, the file that exists (it used to ask for the missing
|
|
|
197
197
|
| `@nxgt/material/draw` | Vector drawing: a scene of plain data or JSX primitives drawn as accessible, themeable SVG that is safe under a strict CSP and identical on the server and in the browser. `Drawing` (`DrawingProps`, `NodeHandlers`; `scene` or `w`/`h` with children; a `title` (with an optional long `description`, written as a `<desc>`) or `decorative`, enforced by the type), the primitives `Rect`, `Ellipse`, `Circle`, `Line`, `Polygon`, `Path` (takes `node`), `Text`, `Group` and `Image`, and the builders of `@nxgt/material-core/draw` re-exported by name (`scene`, `rect`, `ellipse`, `circle`, `line`, `polygon`, `path`, `text`, `group`, `image`, `linear`, `radial`, `pattern`, `hatch`, `tone`, `toSVG`, `compileScene`, `ROLES`, `DRAW_PALETTE`, and the types `Scene`, `DrawNode`, `Paint`, `Role`, `ToneRef`), plus Material 3 Expressive's shapes (`shape`, `morph`, `SHAPE_NAMES`, `toCubics`) and the layout helpers (`bbox`, `stack`, `grid`, `align`, `distribute`) re-exported by name. Colours are theme roles (`primary-container`, `on-surface`...) mapped to classes in `styles.css`, so import it. Interactive nodes are focusable `button`s with a focus ring; wrapped text is re-measured by the browser once mounted. **Its own entry, client-only** (render `Drawing` from a `'use client'` file; the builders and `toSVG` run anywhere), not in the barrel above ([drawing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md)) |
|
|
198
198
|
| `@nxgt/material/draw/sketch` | The sketchy, hand-drawn style for a drawing: `Sketch` (`seed`, `roughness`, `bowing`, `fill`: `hachure`, `cross-hatch`, `solid` or `none`, `hachureAngle`, `hachureGap`, `strokeWidth`) wraps a `Drawing`, or primitives inside one, and draws shapes as double wobbling strokes with hatched fills; `sketch(sceneOrNode, options)` does it to plain data for `toSVG`. Seeded, so the server and the client draw the same lines; ids, labels, focus rings and events keep working. **Its own entry, client-only** (render `Sketch` from a `'use client'` file), not in the barrel above ([drawing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md#sketch)) |
|
|
199
199
|
| `@nxgt/material/map` | Leaflet maps, markers, a location field — **its own entry, not in the barrel, and browser-only** ([maps guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/maps.md)) |
|
|
200
|
-
| `@nxgt/material/themes` | `NxgtThemeProvider` (the registry, the persisted theme name, `<html data-nxgt-theme>`, `defaultMode`; renders no element; `useTheme({ defaultMode })` takes the first-visit mode too), `NxgtTheme` (a zone in another theme, `mode`, `asChild`), `useThemeContext`, `defineTheme
|
|
200
|
+
| `@nxgt/material/themes` | `NxgtThemeProvider` (the registry, the persisted theme name, `<html data-nxgt-theme>`, `defaultMode`; renders no element; `useTheme({ defaultMode })` takes the first-visit mode too), `NxgtTheme` (a zone in another theme, `mode`, `asChild`), `useThemeContext`, `defineTheme` (a bad background `motif` key or value is dropped and warned about in development, 4.0: an error; core's own `defineTheme` warns only through `{ warn }`), `ThemeDefinitionError`, `themeBootScript` and `THEME_BOOT_SCRIPT` (with `ThemeBootOptions`), the 14 presets and `THEME_PRESETS`, `ThemeName` and `NxgtThemes` (augmentable), with the `NxgtThemeProps`, `NxgtThemeProviderProps`, `ThemeContextValue`, `Theme`, `ThemeDefinition` and `ThemeBackground` types ([guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/theming.md#the-provider-and-zones)). `Background` and `ActivityLayout` take their background from the nearest theme |
|
|
201
201
|
| `@nxgt/material/theme-picker` | `ThemePicker`, the theme and mode chooser (swatches and a mini background per theme; `themes`, `value`, `onValueChange`, `showMode`, `showBackground`, `layout`) and `ThemePickerProps`; its own entry so `/themes` stays small ([guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/theming.md#let-users-choose)) |
|
|
202
202
|
| `@nxgt/material/illustrations` | State illustrations: `Illustration` (`scene`: `empty`, `no-results`, `not-found`, `error`, `offline`, `success`, `welcome`, `forbidden`, `maintenance`, `invitation`, `sign-in`, `empty-inbox`, or an id of the `scenes` table it is given; `size`, `title`, `animated`, `hero`, `satellites`, `iconStyle`, `tone`, `duotone`) draws a hero icon on a Material 3 Expressive plate with satellites, from the Font Awesome sprites your app serves (no icon artwork ships); `IllustrationDefaults` (`icons`: `'suggested'` or a table, `iconStyle`, `sets`) opts a subtree's `EmptyState` and `ErrorState` into them; `ILLUSTRATION_SCENES`, `SUGGESTED_ICONS` and the types re-exported from `@nxgt/material-core/illustrations` (`SceneRow`, `SceneTable`), plus `IconStyleInput` and `IconStyleRef` (the `iconStyle` types: `{ family?, type? }` or one of the 37 sprite file names), `SceneId`, `RegisteredScene` and `IllustrationSceneRegistry`, the scene id type that an imported set's ids widen. `unauthorized` and `maintenance` states draw the `forbidden` and `maintenance` scenes. `EmptyState`, `ErrorState` and the `DataTable` empty row (`emptyIllustration`) also take `illustration` as a scene id or `true`. Colours are theme tones in `styles.css`; its own entry ([illustrations guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/illustrations.md)) |
|
|
203
203
|
| `@nxgt/material/illustrations/health` | The health scenes: `HEALTH_SCENES` (`patient-record`, `consultation`, `appointment`, `lab-sample`, `prescription`, `vaccination`, `hospitalisation`, `emergency`, `no-patients`, `lab-results`), `HEALTH_SCENE_IDS`, `HEALTH_SUGGESTED_ICONS`, `HealthScene`; register it with `<IllustrationDefaults sets={[HEALTH_SCENES]}>` so `<Illustration scene="patient-record" />` and `<EmptyState illustration="no-patients" />` work (or pass `scenes={HEALTH_SCENES}` to one `Illustration`); importing it adds the ids to `SceneId`. An app that does not import it does not carry it |
|
|
204
204
|
| `@nxgt/material/illustrations/education` | The education scenes: `EDUCATION_SCENES` (`classroom`, `homework`, `exam-grades`, `timetable`, `attendance`, `enrolment`, `library`, `graduation`, `no-students`, `report-card`), `EDUCATION_SCENE_IDS`, `EDUCATION_SUGGESTED_ICONS`, `EducationScene`; register it with `<IllustrationDefaults sets={[EDUCATION_SCENES]}>` so `<Illustration scene="classroom" />` and `<EmptyState illustration="no-students" />` work (or pass `scenes={EDUCATION_SCENES}` to one `Illustration`); importing it adds the ids to `SceneId`. An app that does not import it does not carry it |
|
|
205
|
-
| `@nxgt/material/backgrounds` | Background presets: `Background` (a superset of the `/components` one: `preset`, `animated`, `grain`, `seed`, `fill`, `motif`, and for `preset="icons"` `icons`, `iconStyle` and `iconMotif`), `AVAILABLE_BACKGROUND_PRESETS` and `AvailableBackgroundPreset` (the 50 ids `Background` draws), `MoonOptions` (the `moon` prop), `IconMotifOptions` (`iconMotif`, with `quiet`: a band the icons fade out of for text), `IconLayout`, `IconQuiet`, `SkyPreset` and `CelestialPreset` (the `sky` ids), `IconsInput` (`icons`), `IconStyleInput` and `IconStyleRef` (`iconStyle`: `{ family?, type? }` or one of the 37 sprite file names, completed by the editor, any other string is a type error), `sky` (`'moon'` or a celestial preset over any preset, also read from the theme's `background.sky`; the four celestial presets and `sky` share the opt-in `@nxgt/material/backgrounds/celestial.css`, also in `backgrounds.css`), `MOTIF_SHAPES_ALL` (the
|
|
205
|
+
| `@nxgt/material/backgrounds` | Background presets: `Background` (a superset of the `/components` one: `preset`, `animated`, `grain`, `seed`, `fill`, `motif`, and for `preset="icons"` `icons`, `iconStyle` and `iconMotif`), `AVAILABLE_BACKGROUND_PRESETS` and `AvailableBackgroundPreset` (the 50 ids `Background` draws), `MoonOptions` (the `moon` prop), `IconMotifOptions` (`iconMotif`, with `quiet`: a band the icons fade out of for text), `IconLayout`, `IconQuiet`, `SkyPreset` and `CelestialPreset` (the `sky` ids), `IconsInput` (`icons`), `IconStyleInput` and `IconStyleRef` (`iconStyle`: `{ family?, type? }` or one of the 37 sprite file names, completed by the editor, any other string is a type error), `sky` (`'moon'` or a celestial preset over any preset, also read from the theme's `background.sky`; the four celestial presets and `sky` share the opt-in `@nxgt/material/backgrounds/celestial.css`, also in `backgrounds.css`), `MOTIF_SHAPES_ALL` (the 25 motif shapes), the `MotifLayout` type, the types and tables (`BACKGROUND_PRESETS`, `BACKGROUND_TONES`, ...) re-exported from `@nxgt/material-core/backgrounds`; its own entry, with an opt-in stylesheet ([backgrounds guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/backgrounds.md)) |
|
|
206
206
|
| `@nxgt/material/editor` | The rich text editor: `DocumentEditor` and `DocumentEditorFormField` (with an `outline`, a block handle, focus mode, find and replace, `onUpload`, `onAssist` and `comments`), `CompactEditor` and `CompactEditorFormField`, `RichChatComposer`, `EditorRoot` and the parts (`EditorToolbar`, `EditorContent`, `EditorFooter`, `EditorAssistantPanel`, ...), `useEditor`, the kits (`documentKit`, `compactKit`, `chatKit`, `formNodesKit`), `withFeatures` / `withoutFeatures` and `defineFeature`, and the converters `toHtml`, `toJson`, `toMarkdown`, `fromMarkdown` and `looksLikeMarkdown` — **its own entry, and not in the barrel above**. **Client-only**: import it from a `'use client'` file; `/editor/viewer` is the server-safe one. The `.nxgt-prose` page styles ship in `styles.css` with the component CSS ([DocumentEditor](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#documenteditor)) |
|
|
207
207
|
| `@nxgt/material/editor/viewer` | `RichTextViewer`: shows a saved document (HTML, JSON or Markdown) read-only, **server-safe**, with no editor instance and no `'use client'` ([RichTextViewer](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#richtextviewer)) |
|
|
208
208
|
| `@nxgt/material/code-editor` | `CodeEditor`, `CodeEditorFormField` and `CodeDiff` on Monaco, their theme presets (`theme`: `'app'`, `'moonlight'`, `'soft'`, `CODE_THEMES`), `defineCodeTheme` for your own, the `CodeMarker` and `CodeMarkerSeverity` types of the `markers` prop, `CodeEditorHandle` (its `ref`), `CodeFile` (its `files`), and `configureMonaco` to bundle Monaco instead of loading it from the CDN. **Client-only**: import it from a `'use client'` file. They are no longer exported from the barrels (removed in 3.0; [guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/code-editor.md)) |
|
|
@@ -211,7 +211,7 @@ reads `duotone.svg`, the file that exists (it used to ask for the missing
|
|
|
211
211
|
| `@nxgt/material/media-hls` | `hlsStreaming()` (options `HlsStreamingOptions`, module type `HlsModule`), the HLS adapter for `MediaPlayer`'s `streaming` prop: `hls.js` (an optional peer) loaded lazily wherever the browser has MSE, native HLS otherwise (or with `preferNative`), its levels as the quality menu; its own entry ([streaming guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/media-streaming.md)) |
|
|
212
212
|
| `@nxgt/material/draw/animate` | Animation for `/draw`: `drawOn(scene)` traces strokes and `appear(scene)` fades nodes in, one after the next (`staggerSteps`; they add class names that `styles.css` animates, so a server renders them and there is no inline style); `useDrawingControls(ref)` replays, pauses, plays and finishes them (Web Animations); `morphScenes(a, b, t)`, `useSceneMorph(from, to, active)` and `MorphDrawing` (`from`, `to`, `active`) spring one scene into another. All stop under reduced motion and show the last frame; its own entry, client-only for the hooks ([drawing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md#animate), [reference](https://cdn.jsdelivr.net/npm/@nxgt/material-core@0/docs/draw.md#animation-nxgtmaterial-coredrawanimate)) |
|
|
213
213
|
| `@nxgt/material/draw/png` | `drawingToPng(sceneOrSvg, { scale?, background?, colorsFrom? })` and `downloadDrawingPng(source, fileName)` — a drawing (a scene, or a live `<svg>` such as `svgRef.current` of a `<Drawing ref={svgRef}>`) as a PNG `Blob` in the browser, with the page's theme colours resolved, `data:` images inlined and CORS errors named; its own entry, DOM only when called ([drawing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md#png), [reference](https://cdn.jsdelivr.net/npm/@nxgt/material-core@0/docs/draw.md#png-nxgtmaterial-coredrawpng)) |
|
|
214
|
-
| `@nxgt/material/vite` | build-time helpers for consumers: `nxgtMaterial()` (a strict CSP by hash or nonce, self-hosted fonts, a styles check, serves the pdf.js worker on the Vite 5–7 dev server, generates your app themes' stylesheets with `nxgtMaterial({ themes })` and the `nxgt-theme` bin: [Themes guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/themes.md), PDFs on a bundled server with `nxgtMaterial({ pdf: { bundle: true } })`: [Vite plugin guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/vite-plugin.md)), `pdfkitStandardFonts()` ([printing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/printing.md)), `cspAssetsInlineLimit`, a `build.assetsInlineLimit` that never inlines a font ([CSP guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/csp.md#katex-fonts)) |
|
|
214
|
+
| `@nxgt/material/vite` | build-time helpers for consumers: `nxgtMaterial()` (a strict CSP by hash or nonce, self-hosted fonts, a styles check, serves the pdf.js worker on the Vite 5–7 dev server, generates your app themes' stylesheets with `nxgtMaterial({ themes })` and the `nxgt-theme` bin: [Themes guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/themes.md), a reduced backdrop icon sprite from your Font Awesome install with `nxgtMaterial({ backdropSprite })` and the `nxgt-backdrop-sprite` bin, PDFs on a bundled server with `nxgtMaterial({ pdf: { bundle: true } })`: [Vite plugin guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/vite-plugin.md)), `pdfkitStandardFonts()` ([printing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/printing.md)), `cspAssetsInlineLimit`, a `build.assetsInlineLimit` that never inlines a font ([CSP guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/csp.md#katex-fonts)) |
|
|
215
215
|
| `@nxgt/material/next` | `withNxgtPrint(nextConfig)`: the `next.config.ts` a Next.js route handler that imports `/print` needs, `output: 'standalone'` included. Node only, no dependency on `next` ([printing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/printing.md#nextjs-serverexternalpackages-and-output-standalone)) |
|
|
216
216
|
| `@nxgt/material/hooks` | `useTheme`, `useIsClient`, `useIsMobile`, `useLocalizedDate`, `useCspNonce`, `useFocusOnMount`, `useSubmitOnce`, … ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/helpers.md#nxgtmaterialhooks)) |
|
|
217
217
|
| `@nxgt/material/dnd` | `@dnd-kit` primitives ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/helpers.md#nxgtmaterialdnd)) |
|
|
@@ -645,7 +645,7 @@ Not components: what the stylesheet gives any element.
|
|
|
645
645
|
| --- | --- | --- | --- |
|
|
646
646
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-appshell.webp" width="120" alt="ActivityLayout"> | [`ActivityLayout`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#activitylayout), `ActivityContent`, `AppSidebar`, `AppHeader`, `AppBreadcrumb`, `AppBreadcrumbItem`, `AppBreadcrumbSeparator` | App shell: sidebar built from `items`, a header with a mobile sheet, route breadcrumbs and a titled page; entries are real links, and `linkComponent` swaps the link; it draws the theme's background (Lavande's is the gradient), `backdrop` puts a `/backgrounds` preset behind it for one screen, and `backdrop={false}` draws a plain page. `ActivityContent` takes an `aside` side panel (beside the content from 1280px in CSS only, sticky under the app bar, a named `complementary` landmark, stacked below) and `width="form" \| "reading"` to cap the main column with the panel right beside it. See the [app shell guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/app-shell.md). | `ActivityLayout`, `ActivityContent`, `AppSidebar`, `AppHeader`, `AppBreadcrumb` |
|
|
647
647
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-accountmenu.webp" width="120" alt="AccountMenu"> | [`AccountMenu`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#accountmenu) | The app bar's avatar menu: named after the account, the name and e-mail, the app's links, then an optional Theme choice (`themeChoice`) and a destructive Sign out with a busy state. | `AccountMenu` |
|
|
648
|
-
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-authcard.webp" width="120" alt="AuthCard"> | [`AuthCard`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#authcard) | The frame of a signed-out page: one `main`, a centred card whose title is the `h1` (focusable on an end state), a status or alert notice, a brand and toolbar row, safe-area padding. | `AuthCard` |
|
|
648
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-authcard.webp" width="120" alt="AuthCard"> | [`AuthCard`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#authcard) | The frame of a signed-out page: one `main`, a centred card whose title is the `h1` (focusable on an end state), a status or alert notice, a brand and toolbar row, safe-area padding, an optional backdrop (the theme's by default) that keeps clear of the card. | `AuthCard` |
|
|
649
649
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-sidebar.webp" width="120" alt="Sidebar"> | [`Sidebar`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#sidebar), `SidebarHeader`, `SidebarContent`, `SidebarFooter`, `SidebarMenuItem`, `SidebarMenuLabel` | Collapsible navigation sidebar with icons, tooltips and active items. | `Sidebar` (same parts) |
|
|
650
650
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-topappbar.webp" width="120" alt="TopAppBar"> | [`TopAppBar`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#topappbar), `BottomAppBar` | Top bar surface, and a bottom bar of icon actions with an active state. | `TopAppBar`, `BottomAppBar` |
|
|
651
651
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-breadcrumb.webp" width="120" alt="Breadcrumb"> | [`Breadcrumb`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#breadcrumb), `BreadcrumbList`, `BreadcrumbItem`, `BreadcrumbLink`, `BreadcrumbPage`, `BreadcrumbSeparator`, `BreadcrumbEllipsis` | Breadcrumb primitives. | `Breadcrumb` (same parts) |
|
|
@@ -762,6 +762,8 @@ The ones that cost the most time. Every error message, with its fix, is in
|
|
|
762
762
|
| Components render unstyled, no console error | `@source "../node_modules/@nxgt/material/";` in your stylesheet |
|
|
763
763
|
| Toast or drawer unstyled | import `@nxgt/material/styles.css` (or `dist/material.css`) |
|
|
764
764
|
| `<Icon>` is blank | serve `public/assets/icons/sprites/<style>.svg` |
|
|
765
|
+
| `Background preset="icons"` draws its shapes but no icons, or `nxgt-backdrop-sprite` fails with `needs the icon packs your backdrops draw` | build the reduced sprite with the packs you draw (`npx nxgt-backdrop-sprite --pack school --out public/sprites/backdrop.svg --base /sprites/`) and pass the printed `backdropSprite` to `IconSpritesProvider`; or serve the per-style sheets ([blank backdrop](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/troubleshooting.md#backdrop-icons-are-blank-with-a-reduced-sprite), [missing packs](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/troubleshooting.md#backdropsprite-needs-the-icon-packs-your-backdrops-draw)) |
|
|
766
|
+
| `preset="icons"` looks different after 3.22, or its glyphs vanish near cards | the default is the calm mix (shapes and a few icons, one tint, medium density); for the old look pass `iconStyle="duotone-thin" iconMotif={{ layout: 'scatter', colors: 'classic' }}`; a glyph that meets a card, a list or text is dropped on purpose ([troubleshooting](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/troubleshooting.md#the-icons-backdrop-looks-different-after-322)) |
|
|
765
767
|
| `window is not defined` at server boot | load `@nxgt/material/map` through `import()` + `clientOnly` ([maps](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/maps.md#browser-only)) |
|
|
766
768
|
| `Cannot find package '@nxgt/material-core'` at server boot | add `@nxgt/material-core` wherever `@nxgt/material` is in `ssr.noExternal` or `--external` ([troubleshooting](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/troubleshooting.md#cannot-find-package-nxgtmaterial-core)) |
|
|
767
769
|
| `Cannot find package 'react-router'`, or `ERESOLVE` on `react` or `react-router`, after upgrading to 3.0 | `bun add react@^19.3 react-dom@^19.3 react-router@^8.5` ([troubleshooting](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/troubleshooting.md#cannot-find-package-react-router-after-upgrading-to-30)) |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// pnpm and bun link only a project's direct dependencies' bins, so the
|
|
3
|
+
// command ships here too; it is core's.
|
|
4
|
+
let cli;
|
|
5
|
+
try {
|
|
6
|
+
cli = await import('@nxgt/material-core/vite');
|
|
7
|
+
} catch (error) {
|
|
8
|
+
if (error?.code !== 'ERR_MODULE_NOT_FOUND') throw error;
|
|
9
|
+
console.error(
|
|
10
|
+
`@nxgt/material-core is not built or not installed: ${error.message}`,
|
|
11
|
+
);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
await cli.runBackdropSpriteCli();
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
|
+
import { t } from "./is-production-GLw59WU8.js";
|
|
3
|
+
import { a as n, i as r, n as i, r as a } from "./icon-sprites-CaYXzOL4.js";
|
|
4
|
+
import { a as o, t as s } from "./theme-context-Cofk6vgs.js";
|
|
5
|
+
import { t as c } from "./compose-refs-DZ0iIVF-.js";
|
|
6
|
+
import { t as l } from "./use-background-activity-KxQgelFF.js";
|
|
7
|
+
import { t as u } from "./scene-svg-DJKa5vsg.js";
|
|
8
|
+
import { n as d, r as f, t as p } from "./scene-options-2zNF3ZkQ.js";
|
|
9
|
+
import { Suspense as m, lazy as h, memo as g, useId as _, useMemo as v, useRef as y } from "react";
|
|
10
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
11
|
+
import { IconRefError as C, resolveIconStyles as w, resolveIcons as T } from "@nxgt/material-core/icons";
|
|
12
|
+
import { SCENE_LAYER as E, buildBackgroundScene as D, presetLayers as O, resolveBackgroundPreset as k, svgIdPrefix as ee } from "@nxgt/material-core/backgrounds";
|
|
13
|
+
//#region lib/backgrounds/background/available.ts
|
|
14
|
+
var A = [
|
|
15
|
+
"gradient",
|
|
16
|
+
"grain",
|
|
17
|
+
"mesh",
|
|
18
|
+
"aurora",
|
|
19
|
+
"spotlight",
|
|
20
|
+
"bokeh",
|
|
21
|
+
"rays",
|
|
22
|
+
"halo",
|
|
23
|
+
"plasma",
|
|
24
|
+
"glass",
|
|
25
|
+
"ripples",
|
|
26
|
+
"blobs",
|
|
27
|
+
"paper",
|
|
28
|
+
"linen",
|
|
29
|
+
"concrete",
|
|
30
|
+
"marble"
|
|
31
|
+
], j = [
|
|
32
|
+
"isometric",
|
|
33
|
+
"blueprint",
|
|
34
|
+
"dots",
|
|
35
|
+
"stripes",
|
|
36
|
+
"low-poly",
|
|
37
|
+
"topography",
|
|
38
|
+
"waves",
|
|
39
|
+
"hexagons",
|
|
40
|
+
"circuit",
|
|
41
|
+
"graph-paper",
|
|
42
|
+
"checker",
|
|
43
|
+
"diagonal-checker",
|
|
44
|
+
"chevrons"
|
|
45
|
+
], M = [
|
|
46
|
+
"shapes",
|
|
47
|
+
"confetti-grid",
|
|
48
|
+
"constellation",
|
|
49
|
+
"halftone",
|
|
50
|
+
"truchet",
|
|
51
|
+
"floating",
|
|
52
|
+
"scatter-icons",
|
|
53
|
+
"school",
|
|
54
|
+
"night-sky",
|
|
55
|
+
"bubbles",
|
|
56
|
+
"leaves",
|
|
57
|
+
"science",
|
|
58
|
+
"music",
|
|
59
|
+
"travel",
|
|
60
|
+
"sport",
|
|
61
|
+
"moon",
|
|
62
|
+
"icons"
|
|
63
|
+
], N = [
|
|
64
|
+
"eclipse",
|
|
65
|
+
"meteor-shower",
|
|
66
|
+
"ringed-planet",
|
|
67
|
+
"northern-lights"
|
|
68
|
+
], P = (e) => N.includes(e), F = [
|
|
69
|
+
...A,
|
|
70
|
+
...j,
|
|
71
|
+
...M,
|
|
72
|
+
...N
|
|
73
|
+
], I = h(() => import("./icons-scene-M4HBeN2c.js"));
|
|
74
|
+
function L(e) {
|
|
75
|
+
return /* @__PURE__ */ x("div", {
|
|
76
|
+
"data-scene": "",
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
children: /* @__PURE__ */ x(m, {
|
|
79
|
+
fallback: null,
|
|
80
|
+
children: /* @__PURE__ */ x(I, { ...e })
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region lib/backgrounds/background/partials/background-layers.tsx
|
|
86
|
+
var R = h(() => import("./celestial-scene-8Muu6f7O.js")), te = g(function({ preset: e, scene: t, grain: n, sky: r, icons: i, ...a }) {
|
|
87
|
+
return /* @__PURE__ */ S(b, { children: [
|
|
88
|
+
O(e).map((n) => n === E ? i ? /* @__PURE__ */ x(L, { ...i }, n) : P(e) ? /* @__PURE__ */ x("div", {
|
|
89
|
+
"data-scene": "",
|
|
90
|
+
"data-celestial": "",
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
children: /* @__PURE__ */ x(m, {
|
|
93
|
+
fallback: null,
|
|
94
|
+
children: /* @__PURE__ */ x(R, {
|
|
95
|
+
name: e,
|
|
96
|
+
as: "preset",
|
|
97
|
+
...a
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
}, n) : t && /* @__PURE__ */ x("div", {
|
|
101
|
+
"data-scene": "",
|
|
102
|
+
"aria-hidden": "true",
|
|
103
|
+
children: /* @__PURE__ */ x(u, { node: t })
|
|
104
|
+
}, n) : /* @__PURE__ */ x("div", {
|
|
105
|
+
"data-layer": n,
|
|
106
|
+
"aria-hidden": "true"
|
|
107
|
+
}, n)),
|
|
108
|
+
r && /* @__PURE__ */ x("div", {
|
|
109
|
+
"data-layer": "sky-scene",
|
|
110
|
+
"data-scene": "",
|
|
111
|
+
"data-celestial": "",
|
|
112
|
+
"aria-hidden": "true",
|
|
113
|
+
children: /* @__PURE__ */ x(m, {
|
|
114
|
+
fallback: null,
|
|
115
|
+
children: /* @__PURE__ */ x(R, {
|
|
116
|
+
name: r,
|
|
117
|
+
as: "sky",
|
|
118
|
+
base: e,
|
|
119
|
+
...a
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
}),
|
|
123
|
+
n && /* @__PURE__ */ x("div", {
|
|
124
|
+
"data-overlay": "grain",
|
|
125
|
+
"aria-hidden": "true",
|
|
126
|
+
children: /* @__PURE__ */ x(u, { node: n })
|
|
127
|
+
})
|
|
128
|
+
] });
|
|
129
|
+
});
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region lib/backgrounds/background/partials/icons-check.ts
|
|
132
|
+
function z(e, t) {
|
|
133
|
+
try {
|
|
134
|
+
e !== void 0 && T(e);
|
|
135
|
+
let n = Array.isArray(t) ? t.map((e) => e && typeof e == "object" && "style" in e ? e.style : e) : t && typeof t == "object" && "style" in t ? t.style : t;
|
|
136
|
+
return Array.isArray(n) && n.some((e) => !e) ? "an empty icon style" : (w(n), null);
|
|
137
|
+
} catch (e) {
|
|
138
|
+
if (e instanceof C) return e.message;
|
|
139
|
+
throw e;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region lib/backgrounds/background/partials/icons-keys.ts
|
|
144
|
+
var B = Object.keys({
|
|
145
|
+
layout: 1,
|
|
146
|
+
colors: 1,
|
|
147
|
+
sizeRange: 1,
|
|
148
|
+
rotation: 1,
|
|
149
|
+
duotone: 1,
|
|
150
|
+
secondaryOpacity: 1,
|
|
151
|
+
calm: 1,
|
|
152
|
+
quiet: 1
|
|
153
|
+
});
|
|
154
|
+
function V(e) {
|
|
155
|
+
return JSON.stringify(Object.fromEntries(B.flatMap((t) => e?.[t] === void 0 ? [] : [[t, e[t]]])));
|
|
156
|
+
}
|
|
157
|
+
var H = .2;
|
|
158
|
+
function U(e, t, n) {
|
|
159
|
+
let { icons: r, iconStyle: i, iconMotif: a, motif: o } = t, s = o?.icons, c = a?.layout, l = e === "shapes" ? !!s : e === "icons" && (c === void 0 || c === "even");
|
|
160
|
+
return {
|
|
161
|
+
wants: e === "icons" || e === "shapes" && !!s,
|
|
162
|
+
iconsKey: JSON.stringify(s?.pack ?? r ?? null),
|
|
163
|
+
styleKey: JSON.stringify(s?.style ?? i ?? null),
|
|
164
|
+
motifKey: V(a),
|
|
165
|
+
mixKey: JSON.stringify(l ? {
|
|
166
|
+
...o,
|
|
167
|
+
icons: { ratio: s?.ratio ?? H }
|
|
168
|
+
} : null),
|
|
169
|
+
servedKey: JSON.stringify(n ?? null)
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region lib/backgrounds/background/partials/use-icons-scene.ts
|
|
174
|
+
function W(e, { icons: o, iconStyle: s, iconMotif: c, motif: l, idPrefix: u, seed: d, animated: f }) {
|
|
175
|
+
let p = n(), m = a(), h = r(), g = i(), { wants: _, iconsKey: y, styleKey: b, motifKey: x, mixKey: S, servedKey: C } = U(e, {
|
|
176
|
+
icons: o,
|
|
177
|
+
iconStyle: s,
|
|
178
|
+
iconMotif: c,
|
|
179
|
+
motif: l
|
|
180
|
+
}, h), w = v(() => {
|
|
181
|
+
if (!_) return null;
|
|
182
|
+
let n = z(JSON.parse(y) ?? void 0, JSON.parse(b) ?? void 0);
|
|
183
|
+
return n && !t() && console.warn(`Background: icons cannot be drawn (${n}); drawing "${e === "icons" ? "scatter-icons" : e}" instead.`), n;
|
|
184
|
+
}, [
|
|
185
|
+
_,
|
|
186
|
+
e,
|
|
187
|
+
y,
|
|
188
|
+
b
|
|
189
|
+
]);
|
|
190
|
+
return {
|
|
191
|
+
preset: w && e === "icons" ? "scatter-icons" : e,
|
|
192
|
+
iconsScene: v(() => _ && !w ? {
|
|
193
|
+
seed: d,
|
|
194
|
+
idPrefix: u,
|
|
195
|
+
iconsKey: y,
|
|
196
|
+
styleKey: b,
|
|
197
|
+
motifKey: x,
|
|
198
|
+
mixKey: S,
|
|
199
|
+
servedKey: C,
|
|
200
|
+
spriteBase: p,
|
|
201
|
+
backdropSprite: g,
|
|
202
|
+
edition: m,
|
|
203
|
+
animated: f
|
|
204
|
+
} : void 0, [
|
|
205
|
+
_,
|
|
206
|
+
w,
|
|
207
|
+
d,
|
|
208
|
+
u,
|
|
209
|
+
y,
|
|
210
|
+
b,
|
|
211
|
+
x,
|
|
212
|
+
S,
|
|
213
|
+
C,
|
|
214
|
+
p,
|
|
215
|
+
g,
|
|
216
|
+
m,
|
|
217
|
+
f
|
|
218
|
+
])
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region lib/backgrounds/background/background.tsx
|
|
223
|
+
var G = /* @__PURE__ */ e({ Background: () => J }), K = (e) => console.warn(e);
|
|
224
|
+
function q(e, t, n, r, i, a) {
|
|
225
|
+
return e === "grain" ? null : D(e, f(t, n, r, i, a));
|
|
226
|
+
}
|
|
227
|
+
function ne(e, t) {
|
|
228
|
+
return D("grain", {
|
|
229
|
+
idPrefix: `${e}-grain`,
|
|
230
|
+
seed: t
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
function J({ children: e, ref: n, preset: r, tone: i, intensity: a, animated: u, grain: f, seed: m, motif: h, moon: g, sky: b, icons: C, iconStyle: w, iconMotif: T, fill: E = "viewport", ...D }) {
|
|
234
|
+
let O = o()?.background || s, A = r ?? O.preset, j = i ?? O.tone ?? s.tone, M = a ?? O.intensity ?? s.intensity, N = u ?? O.animated ?? !1, P = f ?? O.grain ?? !1, I = m ?? O.seed ?? 0, L = h ?? O.motif, R = g ?? O.moon, z = b ?? O.sky, B = y(null), V = v(() => c(B, n), [n]), H = l(B, N), U = ee(_()), { preset: G, iconsScene: J } = W(k(A, F, t() ? void 0 : K), {
|
|
235
|
+
icons: C ?? O.icons,
|
|
236
|
+
iconStyle: w ?? O.iconStyle,
|
|
237
|
+
iconMotif: T ?? O.iconMotif,
|
|
238
|
+
motif: L,
|
|
239
|
+
idPrefix: U,
|
|
240
|
+
seed: I,
|
|
241
|
+
animated: N
|
|
242
|
+
}), Y = P || G === "grain", X = L?.shapes ? [...new Set(L.shapes)].sort().join(",") : void 0, Z = JSON.stringify(d(L)), Q = JSON.stringify(p(R)), $ = J !== void 0, re = v(() => $ ? null : q(G, U, I, X, Z, Q), [
|
|
243
|
+
$,
|
|
244
|
+
G,
|
|
245
|
+
U,
|
|
246
|
+
I,
|
|
247
|
+
X,
|
|
248
|
+
Z,
|
|
249
|
+
Q
|
|
250
|
+
]), ie = v(() => Y ? ne(U, I) : null, [
|
|
251
|
+
Y,
|
|
252
|
+
U,
|
|
253
|
+
I
|
|
254
|
+
]);
|
|
255
|
+
return /* @__PURE__ */ S("div", {
|
|
256
|
+
"data-slot": "background",
|
|
257
|
+
...D,
|
|
258
|
+
ref: V,
|
|
259
|
+
"data-background": G === "grain" ? "gradient" : G,
|
|
260
|
+
"data-preset": G,
|
|
261
|
+
"data-tone": j,
|
|
262
|
+
"data-intensity": M,
|
|
263
|
+
"data-fill": E === "container" ? E : void 0,
|
|
264
|
+
"data-animated": N ? "" : void 0,
|
|
265
|
+
"data-grain": Y ? "" : void 0,
|
|
266
|
+
"data-sky": z,
|
|
267
|
+
"data-paused": N && H ? "" : void 0,
|
|
268
|
+
children: [/* @__PURE__ */ x(te, {
|
|
269
|
+
preset: G,
|
|
270
|
+
scene: re,
|
|
271
|
+
grain: ie,
|
|
272
|
+
sky: z,
|
|
273
|
+
idPrefix: U,
|
|
274
|
+
seed: I,
|
|
275
|
+
shapesKey: X,
|
|
276
|
+
scalarsKey: Z,
|
|
277
|
+
moonKey: Q,
|
|
278
|
+
icons: J
|
|
279
|
+
}), /* @__PURE__ */ x("div", {
|
|
280
|
+
"data-slot": "background-content",
|
|
281
|
+
children: e
|
|
282
|
+
})]
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
286
|
+
export { G as n, F as r, J as t };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* band is `--background-quiet` wide (42%), then the icons fade back in over
|
|
5
5
|
* 30%. `start` and `end` follow the reading direction. A mask, not a colour:
|
|
6
6
|
* the text underneath keeps the wash's own contrast. */
|
|
7
|
-
[data-background
|
|
7
|
+
[data-background] > [data-scene] > :is(.ic-q-start, .ic-q-end) {
|
|
8
8
|
--nxgt-quiet-to: to right;
|
|
9
9
|
-webkit-mask-image: linear-gradient(
|
|
10
10
|
var(--nxgt-quiet-to),
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
#000 calc(var(--background-quiet, 42%) + 30%)
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
-
[data-background
|
|
21
|
-
[data-background
|
|
20
|
+
[data-background] > [data-scene] > .ic-q-end,
|
|
21
|
+
[data-background] > [data-scene]:dir(rtl) > .ic-q-start {
|
|
22
22
|
--nxgt-quiet-to: to left;
|
|
23
23
|
}
|
|
24
|
-
[data-background
|
|
24
|
+
[data-background] > [data-scene]:dir(rtl) > .ic-q-end {
|
|
25
25
|
--nxgt-quiet-to: to right;
|
|
26
26
|
}
|
|
27
|
-
[data-background
|
|
27
|
+
[data-background] > [data-scene] > .ic-q-center {
|
|
28
28
|
-webkit-mask-image: linear-gradient(
|
|
29
29
|
to right,
|
|
30
30
|
#000 calc(50% - var(--background-quiet, 42%) / 2 - 30%),
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* The tint of the icons scene (`iconMotif.colors`, React only): a class on the
|
|
2
|
+
* scene root. `ic-c-one` (default) draws every glyph in the primary tone
|
|
3
|
+
* mixed toward transparent, a low contrast on any surface and a soft one in
|
|
4
|
+
* dark, never bright; `ic-c-palette` spreads primary, secondary and tertiary
|
|
5
|
+
* (`k1..k3`) at the same contrast; the rules out-rank icons.css's `.ic.k1..k3` tones; `ic-c-classic` has no rule here (icons.css
|
|
6
|
+
* gives the tones at full strength). The icons read `--fa-primary-color`
|
|
7
|
+
* (duotone and the sprites' paint) and `currentColor` (the flat styles), so the
|
|
8
|
+
* tint sets both. The motif shapes of the mix sit at 0.8 of the icons' tint. */
|
|
9
|
+
@layer components {
|
|
10
|
+
[data-background] > [data-scene] > :is(.ic-c-one, .ic-c-palette) {
|
|
11
|
+
--ic-soft: 46%;
|
|
12
|
+
}
|
|
13
|
+
:is(.dark, [data-theme="dark"])
|
|
14
|
+
[data-background]
|
|
15
|
+
> [data-scene]
|
|
16
|
+
> :is(.ic-c-one, .ic-c-palette),
|
|
17
|
+
[data-background]:is(.dark, [data-theme="dark"])
|
|
18
|
+
> [data-scene]
|
|
19
|
+
> :is(.ic-c-one, .ic-c-palette) {
|
|
20
|
+
--ic-soft: 44%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* One tint. */
|
|
24
|
+
[data-background] > [data-scene] > .ic-c-one .ic:is(.k1, .k2, .k3) {
|
|
25
|
+
--ic-tint: color-mix(
|
|
26
|
+
in oklab,
|
|
27
|
+
var(--nxgt-bg-t1) var(--ic-soft),
|
|
28
|
+
transparent
|
|
29
|
+
);
|
|
30
|
+
--fa-primary-color: var(--ic-tint);
|
|
31
|
+
--fa-secondary-color: var(--ic-tint);
|
|
32
|
+
color: var(--ic-tint);
|
|
33
|
+
}
|
|
34
|
+
[data-background] > [data-scene] > .ic-c-one :is(.k1, .k2, .k3):not(.ic) {
|
|
35
|
+
color: color-mix(
|
|
36
|
+
in oklab,
|
|
37
|
+
var(--nxgt-bg-t1) calc(var(--ic-soft) * 0.8),
|
|
38
|
+
transparent
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
[data-background] > [data-scene] > .ic-c-one :is(.ic-ln, .ic-dt) {
|
|
42
|
+
stroke: color-mix(in oklab, var(--nxgt-bg-t1) var(--ic-soft), transparent);
|
|
43
|
+
fill: none;
|
|
44
|
+
}
|
|
45
|
+
[data-background] > [data-scene] > .ic-c-one .ic-dt {
|
|
46
|
+
fill: color-mix(in oklab, var(--nxgt-bg-t1) var(--ic-soft), transparent);
|
|
47
|
+
stroke: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Three tints, the same contrast. */
|
|
51
|
+
[data-background] > [data-scene] > .ic-c-palette .ic.k1 {
|
|
52
|
+
--ic-tint: color-mix(
|
|
53
|
+
in oklab,
|
|
54
|
+
var(--nxgt-bg-c1) var(--ic-soft),
|
|
55
|
+
transparent
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
[data-background] > [data-scene] > .ic-c-palette .ic.k2 {
|
|
59
|
+
--ic-tint: color-mix(
|
|
60
|
+
in oklab,
|
|
61
|
+
var(--nxgt-bg-c2) var(--ic-soft),
|
|
62
|
+
transparent
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
[data-background] > [data-scene] > .ic-c-palette .ic.k3 {
|
|
66
|
+
--ic-tint: color-mix(
|
|
67
|
+
in oklab,
|
|
68
|
+
var(--nxgt-bg-c3) var(--ic-soft),
|
|
69
|
+
transparent
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
[data-background] > [data-scene] > .ic-c-palette .ic:is(.k1, .k2, .k3) {
|
|
73
|
+
--fa-primary-color: var(--ic-tint);
|
|
74
|
+
--fa-secondary-color: var(--ic-tint);
|
|
75
|
+
color: var(--ic-tint);
|
|
76
|
+
}
|
|
77
|
+
[data-background] > [data-scene] > .ic-c-palette .k1:not(.ic) {
|
|
78
|
+
color: color-mix(
|
|
79
|
+
in oklab,
|
|
80
|
+
var(--nxgt-bg-c1) calc(var(--ic-soft) * 0.8),
|
|
81
|
+
transparent
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
[data-background] > [data-scene] > .ic-c-palette .k2:not(.ic) {
|
|
85
|
+
color: color-mix(
|
|
86
|
+
in oklab,
|
|
87
|
+
var(--nxgt-bg-c2) calc(var(--ic-soft) * 0.8),
|
|
88
|
+
transparent
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
[data-background] > [data-scene] > .ic-c-palette .k3:not(.ic) {
|
|
92
|
+
color: color-mix(
|
|
93
|
+
in oklab,
|
|
94
|
+
var(--nxgt-bg-c3) calc(var(--ic-soft) * 0.8),
|
|
95
|
+
transparent
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|