@nxgt/material 3.7.5 → 3.8.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 +50 -0
- package/README.md +39 -6
- package/bin/nxgt-theme.js +6 -0
- package/dist/{async-slice-o_fpqeGX.js → async-slice-DDjaJY_F.js} +2 -2
- package/dist/background--Bf_EbFR.js +159 -0
- package/dist/backgrounds/backgrounds.css +2 -0
- package/dist/backgrounds/css-react/moon.css +97 -0
- package/dist/backgrounds.js +3 -139
- package/dist/browser-only-DQ94lWF8.js +18 -0
- package/dist/bubble-input-B7BVd9fX.js +237 -0
- package/dist/{button--cF4gY14.js → button-DbfdITBB.js} +51 -57
- package/dist/charts.js +3 -3
- package/dist/{chip-D1B1dL77.js → chip-DpySRqCy.js} +2 -2
- package/dist/{client-only.utils-lQ7GqP8w.js → client-only.utils-3nHNzCki.js} +1 -1
- package/dist/{code-editor-0CdGwKDg.js → code-editor-BiA14xua.js} +7 -7
- package/dist/code-editor.js +6 -6
- package/dist/{code-language-items-CGARRbVm.js → code-language-items-C_dJ6GVs.js} +2 -2
- package/dist/components/theme-tokens.css +34 -35
- package/dist/components/tones/app-tones.css +2 -1
- package/dist/components/tones/containers.css +4 -1
- package/dist/components/tones/index.css +2 -0
- package/dist/components/tones/surface.css +1 -0
- package/dist/components/tones/tokens.css +8 -3
- package/dist/components/tones/zone-paint.css +15 -0
- package/dist/components/ui/feedback/toast/toast-tokens.css +1 -0
- package/dist/components/ui/layout/app-shell/activity-backdrop.css +26 -0
- package/dist/components/ui/layout/sidebar/sidebar-tokens.css +5 -2
- package/dist/components/ui/media/media-player/nxgt-media-player.css +7 -32
- package/dist/components/ui/primitives/field-box/field-box-tokens.css +5 -2
- package/dist/{components-CDrQCOsU.js → components-B9EIfMdd.js} +18622 -18531
- package/dist/components.js +24 -22
- package/dist/{dialog-DdJ1C4BR.js → dialog-CkIYpJXk.js} +55 -53
- package/dist/dist-B7RjY7SL.js +158 -0
- package/dist/dist-C4wtXCjf.js +593 -0
- package/dist/dist-DVRQkaTK.js +111 -0
- package/dist/dist-lmHmz_bu.js +419 -0
- package/dist/dnd.js +1 -1
- package/dist/dropdown-menu-BC5Tbhb9.js +908 -0
- package/dist/editor.js +527 -527
- package/dist/empty-state-s2CSjKXJ.js +126 -0
- package/dist/{escape-owner-B8k7DvFa.js → escape-owner-CripBce_.js} +2 -1
- package/dist/{field-blur-DFUazxsL.js → field-blur-DPLsMufs.js} +1 -1
- package/dist/{field-blur-context-Dw9ZAgBr.js → field-blur-context-1ZwJgsHE.js} +2 -2
- package/dist/has-text-content-Ds2dkHX_.js +10 -0
- package/dist/hooks.js +35 -33
- package/dist/{hover-card-D5iHS9q1.js → hover-card-Cox-tPDz.js} +41 -39
- package/dist/{i18n-provider-C6SBK_nO.js → i18n-provider-C6HhBw34.js} +1 -1
- package/dist/i18n.js +6 -6
- package/dist/{icon-badge-Bb5-73XP.js → icon-badge-q3Ve8gra.js} +3 -3
- package/dist/{icon-button-5A6Mrj6w.js → icon-button-DJcWpIhu.js} +2 -1
- package/dist/{in-dialog-AiwTD3DK.js → in-dialog-Vwkyp-M5.js} +6 -5
- package/dist/lib/backgrounds/background/available.d.ts +3 -3
- package/dist/lib/backgrounds/background/background.d.ts +7 -3
- package/dist/lib/backgrounds/background/types.d.ts +7 -1
- package/dist/lib/backgrounds/index.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-shell/activity-chrome.d.ts +17 -0
- package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +6 -4
- package/dist/lib/components/ui/layout/app-shell/backdrop-layer.d.ts +11 -0
- package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +17 -0
- package/dist/lib/components/ui/layout/app-shell/theme-backdrop.d.ts +6 -0
- package/dist/lib/components/ui/layout/app-shell/use-activity-backdrop.d.ts +18 -0
- package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +9 -0
- package/dist/lib/hooks/resolve-theme.d.ts +46 -1
- package/dist/lib/hooks/theme-store.d.ts +35 -4
- package/dist/lib/hooks/use-theme.d.ts +20 -4
- package/dist/lib/i18n/resources/en/en.d.ts +4 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +4 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +4 -0
- package/dist/lib/i18n/resources/resources.d.ts +8 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/theme-picker/index.d.ts +7 -0
- package/dist/lib/theme-picker/partials/mini-background.d.ts +10 -0
- package/dist/lib/theme-picker/partials/mode-control.d.ts +5 -0
- package/dist/lib/theme-picker/partials/theme-tile.d.ts +12 -0
- package/dist/lib/theme-picker/theme-label.d.ts +7 -0
- package/dist/lib/theme-picker/theme-picker.d.ts +25 -0
- package/dist/lib/themes/index.d.ts +14 -0
- package/dist/lib/themes/nxgt-theme-provider.d.ts +29 -0
- package/dist/lib/themes/nxgt-theme.d.ts +22 -0
- package/dist/lib/themes/theme-context.d.ts +28 -0
- package/dist/lib/themes/theme-value.d.ts +5 -0
- package/dist/lib/vite/index.d.ts +1 -1
- package/dist/lib.js +3 -3
- package/dist/main.js +43 -39
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/nxgt-theme-CgSb9Obl.js +37 -0
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-SsiazLEv.js → public-Ce30uvp0.js} +591 -587
- package/dist/read-storage-C2J90bNm.js +10 -0
- package/dist/{rich-code-block-CwNwQs5z.js → rich-code-block-C2Fp_FDU.js} +5 -5
- package/dist/{sortable-provider-BvD98s8Y.js → sortable-provider-pVaEZzty.js} +3 -3
- package/dist/{spinner-CtGCPza-.js → spinner-CsHcmcpF.js} +2 -2
- package/dist/{stored-language-Bb7yX5uE.js → stored-language-BeIKw3-K.js} +15 -15
- package/dist/styles.css +8 -1
- package/dist/theme-context-BagPvRcz.js +16 -0
- package/dist/theme-picker.js +118 -0
- package/dist/theme-store-CSl51uNH.js +91 -0
- package/dist/theme-toggle-C8os82b4.js +48 -0
- package/dist/themes.js +42 -0
- package/dist/toggle-group-j8zaxEg1.js +69 -0
- package/dist/{toolbar-items-DsDDD5AY.js → toolbar-items-CqHvlTU8.js} +443 -589
- package/dist/tooltip-rhbqNmr3.js +1064 -0
- package/dist/{translate-material-Bsjc4Tow.js → translate-material-CGZljjp1.js} +2 -2
- package/dist/{translator-or2y0JJB.js → translator-DCYO4Ij3.js} +3 -3
- package/dist/{use-background-activity-B8jLHNop.js → use-background-activity-KxQgelFF.js} +1 -1
- package/dist/{use-chat-composer-DZ01a16D.js → use-chat-composer-CDrgWGMM.js} +4684 -4886
- package/dist/{use-heading-spy-ByOQNnFZ.js → use-heading-spy-DXo6IOX9.js} +52 -121
- package/dist/{use-material-translation-hLQzOjF0.js → use-material-translation-DkxcLbLM.js} +2 -2
- package/dist/use-slice-reducer-BGkeGtML.js +42 -0
- package/dist/use-theme-Cd-aiDJo.js +31 -0
- package/docs/README.md +2 -1
- package/docs/components/foundations.md +39 -0
- package/docs/components/navigation-and-layout.md +3 -3
- package/docs/getting-started.md +1 -1
- package/docs/guides/app-shell.md +41 -6
- package/docs/guides/backgrounds.md +43 -7
- package/docs/guides/i18n.md +1 -1
- package/docs/guides/themes.md +103 -0
- package/docs/guides/theming.md +288 -84
- package/docs/guides/vite-plugin.md +26 -0
- package/docs/previews/backgrounds-background-from-theme.webp +0 -0
- package/docs/previews/backgrounds-geometry-more.webp +0 -0
- package/docs/previews/backgrounds-geometry.webp +0 -0
- package/docs/previews/backgrounds-illustrated-scenes.webp +0 -0
- package/docs/previews/backgrounds-light-more.webp +0 -0
- package/docs/previews/backgrounds-light.webp +0 -0
- package/docs/previews/backgrounds-material-more.webp +0 -0
- package/docs/previews/backgrounds-matrix.webp +0 -0
- package/docs/previews/backgrounds-moon.webp +0 -0
- package/docs/previews/backgrounds-motif-shapes.webp +0 -0
- package/docs/previews/backgrounds-motifs.webp +0 -0
- package/docs/previews/foundations-themes-themepicker.webp +0 -0
- package/docs/roadmap.md +25 -0
- package/docs/troubleshooting.md +35 -7
- package/lib/backgrounds/backgrounds.css +2 -0
- package/lib/backgrounds/css-react/moon.css +97 -0
- package/lib/components/theme-tokens.css +34 -35
- package/lib/components/tones/app-tones.css +2 -1
- package/lib/components/tones/containers.css +4 -1
- package/lib/components/tones/index.css +2 -0
- package/lib/components/tones/surface.css +1 -0
- package/lib/components/tones/tokens.css +8 -3
- package/lib/components/tones/zone-paint.css +15 -0
- package/lib/components/ui/feedback/toast/toast-tokens.css +1 -0
- package/lib/components/ui/layout/app-shell/activity-backdrop.css +26 -0
- package/lib/components/ui/layout/sidebar/sidebar-tokens.css +5 -2
- package/lib/components/ui/media/media-player/nxgt-media-player.css +7 -32
- package/lib/components/ui/primitives/field-box/field-box-tokens.css +5 -2
- package/lib/styles.css +8 -1
- package/lib/theme-picker/theme-picker-list.css +29 -0
- package/lib/theme-picker/theme-picker.css +192 -0
- package/lib/theme-picker/theme-tile-background.css +77 -0
- package/lib/theme-picker/theme-tile-textures-night.css +63 -0
- package/lib/theme-picker/theme-tile-textures.css +153 -0
- package/lib/themes/ambre.css +134 -0
- package/lib/themes/ardoise.css +133 -0
- package/lib/themes/bleumono.css +136 -0
- package/lib/themes/bluemoon.css +136 -0
- package/lib/themes/corail.css +136 -0
- package/lib/themes/foret.css +133 -0
- package/lib/themes/lavande.css +133 -0
- package/lib/themes/menthe.css +136 -0
- package/lib/themes/ocean.css +136 -0
- package/lib/themes/pink.css +134 -0
- package/lib/themes/prune.css +133 -0
- package/lib/themes/sable.css +133 -0
- package/lib/themes/slate.css +133 -0
- package/lib/themes/teal.css +137 -0
- package/package.json +30 -2
- package/dist/dropdown-menu-DWtgUVW7.js +0 -1490
- package/dist/empty-state-CRWLQ1sM.js +0 -191
- package/dist/tooltip-tmFoTU_d.js +0 -1582
- package/dist/use-slice-reducer-0r5dXnJe.js +0 -58
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @nxgt/material
|
|
2
2
|
|
|
3
|
+
## 3.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1377](https://github.com/softistx/nxgt-material/pull/1377) [`298d942`](https://github.com/softistx/nxgt-material/commit/298d9426760889742c1875fec8db46cd5c30a1fc) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `Background` draws the new `moon` preset (45 ids in `AVAILABLE_BACKGROUND_PRESETS`): a thin crescent in a tertiary halo among nine sparse stars, silver in dark and a faint multiplied crescent in light, halved in a container under 640 px wide, fading with `intensity`, with stars that twinkle when `animated` (and never under `prefers-reduced-motion`). Its stylesheet is `@nxgt/material/backgrounds/moon.css`, also in `backgrounds.css`. `Background` takes a `moon` prop (`position`, `phase`, `halo`) and reads the theme's. React only. The Blue moon theme now draws it, whole inside an ActivityLayout's content column.
|
|
8
|
+
|
|
9
|
+
- [#1374](https://github.com/softistx/nxgt-material/pull/1374) [`48760f4`](https://github.com/softistx/nxgt-material/commit/48760f4db88df316f35fb628767d5a4d5c36b2bf) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Theme stylesheets and zones. `@nxgt/material/themes/<name>.css` ships the 14 presets (`lavande`, `ocean`, `foret`, `ambre`, `ardoise`, `corail`, `menthe`, `prune`, `sable`, `slate`, `pink`, `bleumono`, `bluemoon`, `teal`), each under `[data-nxgt-theme="<name>"]` on `<html>` or on any element (a zone), with light and dark (`.dark`, `[data-theme="dark"]` on the zone or an ancestor). Import it after `styles.css`. An app that adds nothing keeps the Lavande tokens on `:root` (the page colours themselves change with the plain neutrals, see the migration note). For zones to work, `styles.css` now maps its colours and radius with `@theme inline` (a utility reads `var(--primary)` where it is used; the `--color-*` a page uses are still emitted), and the tone, field-box, toast and sidebar tokens that are derived from the theme's colours are re-declared on `[data-nxgt-theme]` too. A zone paints its own text (`color: var(--foreground)`), and a zone with a forced mode (`data-theme`) also its own background. See the migration note for the behaviour changes.
|
|
10
|
+
|
|
11
|
+
- [#1373](https://github.com/softistx/nxgt-material/pull/1373) [`224d117`](https://github.com/softistx/nxgt-material/commit/224d1174fa254ced227113ecef1f6994fa2ba657) Thanks [@SteveGT96](https://github.com/SteveGT96)! - The theme name in `useTheme()`. It gains `themeName` and `setThemeName(name)`: the name is stored under its own key, `nxgt-theme` (JSON, apart from the mode's `theme`), set as `data-nxgt-theme` on `<html>` (Lavande, the default, takes the attribute off), shared by every reader and followed across tabs. On the server and while hydrating it reads `lavande`, so there is no hydration mismatch. `@nxgt/material/hooks` also exports `ThemeName` (augmentable through `NxgtThemes`, like `AppTones`), `DEFAULT_THEME`, `resolveThemeName` and `applyThemeName`. An app that never calls `setThemeName` gets no `data-nxgt-theme` from this. The theming guide's boot-script section now uses `themeBootScript`, re-exported by `@nxgt/material/themes`.
|
|
12
|
+
|
|
13
|
+
- [#1378](https://github.com/softistx/nxgt-material/pull/1378) [`eb7dc52`](https://github.com/softistx/nxgt-material/commit/eb7dc52f0f15a104a921bf268cfc7325fce48673) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `ThemePicker`, in its own entry `@nxgt/material/theme-picker` (it reaches the toggle, the icons and the i18n bundles, which would swell `/themes`), with its own opt-in stylesheet, `@import "@nxgt/material/theme-picker.css"` after `styles.css` (about 3.3 KB gzipped, not part of `styles.css`): a radiogroup of theme tiles, each drawn in its own theme (three swatches and a mini background, from CSS, no inline style) beside the light / dark / system control. Arrow keys move the choice; the selected tile has the tint, start bar and primary-text look. Props: `themes` (default the provider's registry), `value` and `onValueChange` (controlled, else stored through the provider), `showMode`, `showBackground`, `layout` (`'grid'` or `'list'`). Names come from each theme's `label` in the current language; the new keys are `material.theme-picker.label` and `material.theme-picker.mode` (en and fr).
|
|
14
|
+
|
|
15
|
+
- [#1376](https://github.com/softistx/nxgt-material/pull/1376) [`770083b`](https://github.com/softistx/nxgt-material/commit/770083b0b68481bc7d8b08b67004a04811117b45) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `@nxgt/material/themes`: `NxgtThemeProvider` (at the root: the registry, the persisted theme name and `<html data-nxgt-theme>`, no element of its own), `NxgtTheme` (a zone in another theme, with `mode` and `asChild`), `useThemeContext`, `defineTheme`, the 14 presets and `ThemeName`. A `Background` from `@nxgt/material/backgrounds` with no props takes its `preset`, `tone`, `intensity`, `seed`, `motif`, `grain` and `animated` from the nearest theme; an explicit prop still wins. `ActivityLayout` draws the theme's background by default, in the backdrop layer with the frosted chrome (loaded on demand, so `@nxgt/material/components` does not grow); `backdrop` stays as the exception, a node overriding it for one screen. Under Lavande, or with no provider, the page differs only by its background (the migration note's fourth change) and the markup by one attribute, `data-slot="activity-content-header"` on the content header card (see the migration note for the `backdrop={false}` change). `NxgtThemes` lists all 14 preset names.
|
|
16
|
+
|
|
17
|
+
- [#1375](https://github.com/softistx/nxgt-material/pull/1375) [`6fb5eb0`](https://github.com/softistx/nxgt-material/commit/6fb5eb04e8663658a70d1bf40cbdda1689212886) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Generate an app's themes at build time. `nxgtMaterial({ themes: { entries, outDir?, types?, boot?, onWarning? } })` loads the app's `defineTheme()` modules with Vite's module runner, writes `<name>.css` and `nxgt-themes.d.ts` (the `AppTones` and `NxgtThemes` augmentation) when their bytes change, watches them in dev, and injects the theme boot script first in `<head>` for the CSP pass to hash. A new `nxgt-theme` command (`build`, `check`, `inspect`) does the same for non-Vite builds and CI: `check` exits 1 when a generated file is stale or a contrast pair fails; `.ts` entries run on Node 22.18 or newer, with no loader. It ships as a `bin` in both packages (`@nxgt/material-core/theme/cli`, Node only). Both warn when a tone is declared in one theme and missing from another. `@nxgt/material/vite` re-exports `NxgtMaterialThemesOptions`. The browser `/theme` entry does not grow.
|
|
18
|
+
|
|
19
|
+
- [#1380](https://github.com/softistx/nxgt-material/pull/1380) [`a9bd60d`](https://github.com/softistx/nxgt-material/commit/a9bd60df207145e4500f59cf203c568156c22c03) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Migration note for the themes release (four behaviour changes, no API removed):
|
|
20
|
+
|
|
21
|
+
- **A wrapper that overrides `--color-*` no longer recolours utilities.** `styles.css` now maps colours with `@theme inline`, so `bg-primary` reads `var(--primary)` where it is used, not a `--color-primary` computed once on `:root`. Setting `--color-primary` (or another `--color-*`) on a wrapper therefore leaves `bg-primary`, `text-primary-text` and the components below it unchanged. Set the token instead (`--primary` on the wrapper), or better, use a theme: `defineTheme()` and `@nxgt/material/themes/<name>.css` on `<html>` or on a `<NxgtTheme>` zone (see the theming guide, "From token overrides to a theme"). `--color-*` is still emitted, for app CSS that reads `var(--color-primary)`.
|
|
22
|
+
- **`ActivityLayout` `backdrop={false}` now draws a plain page.** It used to draw the built-in gradient. Leave `backdrop` out to keep the gradient (or the theme's background); pass a node to override it for one screen.
|
|
23
|
+
- **`class="dark"`, `data-theme="dark"` or a token such as `--primary:` on a sub-element (not `<html>`) now recolours the utilities below it.** Utilities used to read a colour computed once on `:root`; they now read the token where they sit. Search your app for those three on a non-root selector or element: a nested dark card or a scoped brand colour that used to change nothing now shows.
|
|
24
|
+
|
|
25
|
+
**The default page background is now white in light and a shared night in dark.** Lavande, like every preset, no longer tints the page at its colour: `--background` is `oklch(1 0 0)` in light (was `oklch(0.973 0.008 293.9)`, a lavender) and `oklch(0.15 0.026 273)` in dark (was `oklch(0.192 0.016 290.5)`), the same night for all themes; the dark card, muted, border and input layers are lifted from it by the same steps and keep a light tint of the theme. Set `neutrals: 'tinted'` on a theme to keep the tinted page (`defineTheme({ ..., neutrals: 'tinted' })`); an app that pins `--background` itself is unaffected.
|
|
26
|
+
|
|
27
|
+
An app that adds no theme and keeps no such override renders as before, apart from the page background (the fourth change) and one added attribute, `data-slot="activity-content-header"`, on `ActivityLayout`'s content header card.
|
|
28
|
+
|
|
29
|
+
- [#1392](https://github.com/softistx/nxgt-material/pull/1392) [`defd05a`](https://github.com/softistx/nxgt-material/commit/defd05a2489f16c841b2a2478fd4af2bb868c7e9) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Themes: plain neutrals by default. `defineTheme` takes `neutrals: 'plain' | 'tinted'` (default `'plain'`, merged through `extends`) and `generatePalette(seeds, neutrals?)` follows it. Plain: the page is pure white in light and one shared night, `oklch(0.15 0.026 273)`, in dark for every theme; the dark card, muted, border and input layers are lifted from the night (+0.040, +0.078, +0.109, +0.148) and keep a light tint of the theme, the light layers stay tinted, and the AA guarantee holds on the new surfaces (property tests run both settings). Tinted: the page tinted at the neutral hue, as before. All 14 presets, Lavande included, use the default, so `lib/components/theme-tokens.css` and `lib/themes/*.css` change; set `neutrals: 'tinted'` to keep a tinted page.
|
|
30
|
+
|
|
31
|
+
- [#1385](https://github.com/softistx/nxgt-material/pull/1385) [`fc63253`](https://github.com/softistx/nxgt-material/commit/fc632534c8f559e349ee89f279c591d0636d9bc3) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Themes: the first-visit mode, one writer for `<html data-nxgt-theme>`, and a stricter `defineTheme`.
|
|
32
|
+
|
|
33
|
+
- A theme's `colorScheme` is now the mode of a first visit (nothing stored). `themeBootScript` takes `schemes` (a theme name to its mode; the presets' are built in, so `bluemoon` opens dark) and keeps `defaultMode` as the app's own override; `nxgtMaterial({ themes })` fills `schemes` from your themes. `useTheme()` resolves an empty stored mode the same way, through `NxgtThemeProvider` (its new `defaultMode` prop, else the active theme's `colorScheme`) or `useTheme({ defaultMode })`, so the page, `useTheme().theme`, `CodeBlock` and `ThemeToggle` agree. Choosing `system` stores `"system"` when a first visit would not be `system`.
|
|
34
|
+
- `useTheme().themeName` reads the nearest provider or zone first, so under `<NxgtThemeProvider defaultTheme="ocean">` with nothing stored it is `ocean`.
|
|
35
|
+
- `NxgtThemeProvider` is the only writer of `<html data-nxgt-theme>` while mounted: `setThemeName` of a name it does not know is ignored (with a warning in development), a key cleared in another tab resolves to its default, and it leaves the boot script's attribute alone while hydrating.
|
|
36
|
+
- `defineTheme` throws a `ThemeDefinitionError` (`name`) naming an unknown top-level key, such as `seeds` for `colors`.
|
|
37
|
+
- `NxgtTheme` `mode` is `'dark'` only (a light zone in a dark page was never supported), and a `data-theme` you pass is kept when `mode` is left out.
|
|
38
|
+
- `@nxgt/material/themes` also exports `themeBootScript`, `THEME_BOOT_SCRIPT` and `ThemeDefinitionError`, so an app imports everything from material. `@nxgt/material-core/theme/boot` exports `DEFAULT_THEME_NAME` and `THEME_NAME_PATTERN`.
|
|
39
|
+
- A `.dark` or `[data-theme="dark"]` element below a theme zone now takes that theme's dark tokens (each theme's dark block gains `[data-nxgt-theme="x"] :is(.dark, [data-theme="dark"])`), not Lavande's; the nearest nested zone wins. Regenerate your own theme files (`nxgt-theme build`).
|
|
40
|
+
- The media player's glass drawer and lightbox keep their muted text colour.
|
|
41
|
+
- `@nxgt/material-core/backgrounds/activity` exports `observeBackgroundActivity` alone, so `@nxgt/material/components` no longer reaches the background engine at import.
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- [#1391](https://github.com/softistx/nxgt-material/pull/1391) [`cca157b`](https://github.com/softistx/nxgt-material/commit/cca157b684bf9732ceca7a826c061f8810fbd1c5) Thanks [@SteveGT96](https://github.com/SteveGT96)! - An `ActivityLayout` `backdrop` node that is a `Background` now keeps its discrete shapes whole, as the theme's background does: a shape that would be cut at the content column's edge or drawn under the app bar band is hidden instead.
|
|
46
|
+
|
|
47
|
+
- [#1394](https://github.com/softistx/nxgt-material/pull/1394) [`0138a76`](https://github.com/softistx/nxgt-material/commit/0138a76f5c3635cc0be14d2d3d9b09c57db285ba) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `setThemeName` now applies the new theme's mode to `<html>`. `NxgtThemeProvider` puts the resolved mode (`.dark` and `color-scheme`) on `<html>` once past hydration, so `setThemeName('bluemoon')` with no stored mode turns the page dark, and back to `ocean` light, without a `ThemeToggle` mounted (`ThemeToggle` applies it itself only when there is no provider). Without a provider, `useTheme()` also falls back to the stored library preset's `colorScheme`, as the boot script does; an app's own theme still needs the provider or `defaultMode`.
|
|
48
|
+
|
|
49
|
+
- [#1393](https://github.com/softistx/nxgt-material/pull/1393) [`044ac25`](https://github.com/softistx/nxgt-material/commit/044ac25d4724d624a5094cc8ee0896b38edef9e7) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `ActivityLayout` with `scroll="container"` and a backdrop: scrolling the content region no longer shifts the breadcrumb's band, which sits outside the region, so a shape is no longer hidden under a ghost band lower on the page.
|
|
50
|
+
- Updated dependencies [[`298d942`](https://github.com/softistx/nxgt-material/commit/298d9426760889742c1875fec8db46cd5c30a1fc), [`6fb5eb0`](https://github.com/softistx/nxgt-material/commit/6fb5eb04e8663658a70d1bf40cbdda1689212886), [`a9bd60d`](https://github.com/softistx/nxgt-material/commit/a9bd60df207145e4500f59cf203c568156c22c03), [`defd05a`](https://github.com/softistx/nxgt-material/commit/defd05a2489f16c841b2a2478fd4af2bb868c7e9), [`fc63253`](https://github.com/softistx/nxgt-material/commit/fc632534c8f559e349ee89f279c591d0636d9bc3)]:
|
|
51
|
+
- @nxgt/material-core@0.28.0
|
|
52
|
+
|
|
3
53
|
## 3.7.5
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ and [maps](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/maps.md) gu
|
|
|
91
91
|
|
|
92
92
|
The tarball is the built `dist/`, plus the Tailwind source stylesheet
|
|
93
93
|
(`lib/styles.css` and the component stylesheets it imports,
|
|
94
|
-
`lib/components/**/*.css`), `lib/map/map.css`, `lib/backgrounds/backgrounds.css`, `lib/galleries/galleries.css`, `lib/backgrounds/css/*.css`, `docs/` and, from the release
|
|
94
|
+
`lib/components/**/*.css`), `lib/map/map.css`, `lib/backgrounds/backgrounds.css`, `lib/galleries/galleries.css`, `lib/backgrounds/css/*.css`, `lib/themes/*.css`, `lib/theme-picker/*.css`, `docs/` and, from the release
|
|
95
95
|
after 2.6.1, `CHANGELOG.md`. There is no `postinstall` build.
|
|
96
96
|
|
|
97
97
|
## Setup
|
|
@@ -163,7 +163,9 @@ into a tarball. A missing sheet renders nothing, with no error and no fallback.
|
|
|
163
163
|
| `@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` 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)) |
|
|
164
164
|
| `@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)) |
|
|
165
165
|
| `@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)) |
|
|
166
|
-
| `@nxgt/material/
|
|
166
|
+
| `@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`, `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 |
|
|
167
|
+
| `@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)) |
|
|
168
|
+
| `@nxgt/material/backgrounds` | Background presets: `Background` (a superset of the `/components` one: `preset`, `animated`, `grain`, `seed`, `fill` and `motif`), `AVAILABLE_BACKGROUND_PRESETS` and `AvailableBackgroundPreset` (the 45 ids `Background` draws), `MoonOptions` (the `moon` prop), `MOTIF_SHAPES_ALL` (the 22 motif shapes), 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)) |
|
|
167
169
|
| `@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)) |
|
|
168
170
|
| `@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)) |
|
|
169
171
|
| `@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)) |
|
|
@@ -172,7 +174,7 @@ into a tarball. A missing sheet renders nothing, with no error and no fallback.
|
|
|
172
174
|
| `@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)) |
|
|
173
175
|
| `@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)) |
|
|
174
176
|
| `@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)) |
|
|
175
|
-
| `@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, 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)) |
|
|
177
|
+
| `@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)) |
|
|
176
178
|
| `@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)) |
|
|
177
179
|
| `@nxgt/material/hooks` | `useTheme`, `useIsClient`, `useIsMobile`, `useLocalizedDate`, `useCspNonce`, `useFocusOnMount`, `useSubmitOnce`, … ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/helpers.md#nxgtmaterialhooks)) |
|
|
178
180
|
| `@nxgt/material/dnd` | `@dnd-kit` primitives ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/helpers.md#nxgtmaterialdnd)) |
|
|
@@ -184,6 +186,35 @@ into a tarball. A missing sheet renders nothing, with no error and no fallback.
|
|
|
184
186
|
| `@nxgt/material/map.css` | leaflet's stylesheet, for the apps that use `./map`. Not part of `styles.css` |
|
|
185
187
|
| `@nxgt/material/galleries.css` | the Gallery's shaped tiles (`shape`, `preset="shaped"`): `clip-path: shape()` for twelve shapes, about 9 KB gzipped. Opt-in, not part of `styles.css`; without it a shaped tile keeps a rounded corner |
|
|
186
188
|
| `@nxgt/material/backgrounds.css` | every background preset's CSS, for the apps that use `./backgrounds`; `@nxgt/material/backgrounds/<preset>.css` loads one (the illustrated scenes share `backgrounds/illustrated.css`). Not part of `styles.css` |
|
|
189
|
+
| `@nxgt/material/theme-picker.css` | the tiles of `ThemePicker` (the mini backgrounds included), for the apps that use `@nxgt/material/theme-picker`. Import it after `styles.css`. Not part of `styles.css` |
|
|
190
|
+
| `@nxgt/material/themes/<name>.css` | one shipped theme (`lavande`, `ocean`, `foret`, `ambre`, `ardoise`, `corail`, `menthe`, `prune`, `sable`, `slate`, `pink`, `bleumono`, `bluemoon`, `teal`) under `[data-nxgt-theme="<name>"]`, on `<html>` or on a zone. Import it after `styles.css`. Not part of `styles.css`: the default Lavande stays in `:root` ([guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/theming.md#themes)) |
|
|
191
|
+
|
|
192
|
+
### Themes
|
|
193
|
+
|
|
194
|
+
Fourteen ready-made themes ship as stylesheets, and your own come from
|
|
195
|
+
`defineTheme()` ([Themes for your app](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/themes.md)). Import one after `styles.css`, name it on `<html>`
|
|
196
|
+
and let users choose:
|
|
197
|
+
|
|
198
|
+
```css
|
|
199
|
+
@import "@nxgt/material/styles.css";
|
|
200
|
+
@import "@nxgt/material/themes/ocean.css";
|
|
201
|
+
@import "@nxgt/material/theme-picker.css"; /* only with ThemePicker */
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```tsx
|
|
205
|
+
import { NxgtTheme, NxgtThemeProvider } from '@nxgt/material/themes';
|
|
206
|
+
import { ThemePicker } from '@nxgt/material/theme-picker';
|
|
207
|
+
|
|
208
|
+
<NxgtThemeProvider defaultTheme="ocean">
|
|
209
|
+
<ThemePicker />
|
|
210
|
+
<NxgtTheme theme="prune" mode="dark">a dark Prune zone</NxgtTheme>
|
|
211
|
+
</NxgtThemeProvider>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
The theme name is stored beside the mode (`useTheme().setThemeName`), and
|
|
215
|
+
`Background` and `ActivityLayout` draw the theme's background. A wrapper that
|
|
216
|
+
overrides `--color-*` no longer recolours utilities: use a theme or set
|
|
217
|
+
`--primary` ([migration](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/theming.md#from-token-overrides-to-a-theme)).
|
|
187
218
|
|
|
188
219
|
## Usage
|
|
189
220
|
|
|
@@ -352,7 +383,8 @@ Each area a consumer starts from has its own page under `docs/guides/`.
|
|
|
352
383
|
| --- | --- |
|
|
353
384
|
| [Forms](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/forms.md) | wiring fields to React Hook Form and Zod, composite values (contacts, opening hours), config-driven `Field`, server errors, what each field emits |
|
|
354
385
|
| [i18n](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/i18n.md) | adding your strings next to the package's, switching language, translated Zod messages, SSR without a text mismatch |
|
|
355
|
-
| [App shell](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/app-shell.md) | laying out an app with `ActivityLayout` (route changes cross-fade by default, `routeTransition={false}` opts out), its `items` (rendered as links; `linkComponent` to pass your own), the brand (`logo`, `name`, and `context` for the phone sheet's tenant line), the header's title, a route's `handle.title` as the page's `h1` in the app bar (`AppShellHandle`, `PageTitle`; it labels `<main>`, and `usePageTitleFocus()` focuses it after a navigation), and `AccountMenu`, the active entry and breadcrumbs (needs a data router; `breadcrumbRoot` replaces the home icon with a text link), the `<main>` landmark, the `h1` title, document scrolling, and a background preset behind the shell (`backdrop`) |
|
|
386
|
+
| [App shell](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/app-shell.md) | laying out an app with `ActivityLayout` (route changes cross-fade by default, `routeTransition={false}` opts out; it draws the theme's background, `backdrop` is the exception and `backdrop={false}` a plain page), its `items` (rendered as links; `linkComponent` to pass your own), the brand (`logo`, `name`, and `context` for the phone sheet's tenant line), the header's title, a route's `handle.title` as the page's `h1` in the app bar (`AppShellHandle`, `PageTitle`; it labels `<main>`, and `usePageTitleFocus()` focuses it after a navigation), and `AccountMenu`, the active entry and breadcrumbs (needs a data router; `breadcrumbRoot` replaces the home icon with a text link), the `<main>` landmark, the `h1` title, document scrolling, and a background preset behind the shell (`backdrop`) |
|
|
387
|
+
| [Themes for your app](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/themes.md) | defining app themes, generating their stylesheets and types with the Vite plugin's `themes` option or the `nxgt-theme` command, the CI check |
|
|
356
388
|
| [Theming](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/theming.md) | changing colours, radius or fonts, motion and corner tokens, dark mode, tones (the `data-tone` channel, app tones and the calm zone `data-density="calm"`), touch targets, using the compiled CSS without Tailwind |
|
|
357
389
|
| [Printing](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/printing.md) | producing PDFs with `@nxgt/material/print` and getting the file in one call (download, new tab, preview, server `Response`) — its own entry since 2.0.0, with optional peers, a bundling trap on SSR servers, and the `next.config.ts` a Next.js route handler (and `output: 'standalone'`) needs |
|
|
358
390
|
| [Maps](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/maps.md) | using `@nxgt/material/map` — browser-only, optional leaflet peers, `map.css` |
|
|
@@ -394,6 +426,7 @@ Not components: what the stylesheet gives any element.
|
|
|
394
426
|
| Preview | Component | What it does | @nxgt/material-vue |
|
|
395
427
|
| --- | --- | --- | --- |
|
|
396
428
|
| — | [`animate-*` classes](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/animations.md) | Tailwind 4 animations and their modifiers, pure CSS: `animate-fade-in-up animate-duration-500 animate-delay-200`, with the Material 3 springs by default. Entrances and exits, attention seekers, loops and ambient motion, stagger (`animate-stagger-100`), text reveals, scroll-driven animation (`animate-on-view`) and appear/disappear (`animate-appear-*`); under reduced motion a short fade, or no motion for loops and scroll. | — |
|
|
429
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/foundations-themes-themepicker.webp" width="120" alt="ThemePicker"> | [`ThemePicker`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/foundations.md#themepicker) (from `@nxgt/material/theme-picker`) | A radiogroup of theme tiles, each previewing its own theme (three swatches and a mini background, drawn by CSS) beside the light / dark / system control; `grid` or `list` layout, controlled or stored. | — |
|
|
397
430
|
|
|
398
431
|
### Primitives
|
|
399
432
|
|
|
@@ -568,7 +601,7 @@ Not components: what the stylesheet gives any element.
|
|
|
568
601
|
|
|
569
602
|
| Preview | Component | What it does | @nxgt/material-vue |
|
|
570
603
|
| --- | --- | --- | --- |
|
|
571
|
-
| <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; `backdrop` puts a `/backgrounds` preset behind it
|
|
604
|
+
| <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. See the [app shell guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/app-shell.md). | `ActivityLayout`, `ActivityContent`, `AppSidebar`, `AppHeader`, `AppBreadcrumb` |
|
|
572
605
|
| <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` |
|
|
573
606
|
| <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` |
|
|
574
607
|
| <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) |
|
|
@@ -585,7 +618,7 @@ Not components: what the stylesheet gives any element.
|
|
|
585
618
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-steps.webp" width="120" alt="Steps"> | [`Steps`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#steps), `StepsItem` | Numbered editorial steps that stay visible on every breakpoint. | `Steps`, `StepsItem` |
|
|
586
619
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-hero.webp" width="120" alt="Hero"> | [`Hero`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#hero) | Landing band with eyebrow, title, supporting copy and actions. | `Hero` |
|
|
587
620
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-doc.webp" width="120" alt="Doc"> | [`Doc`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#doc), `DocPage`, `DocTopbar`, `DocSidebar`, `DocToc`, `DocPager`, `DocSearch`, `DocChildCards`, `DocSeeAlso`, `DocEmpty`, `DocProgress` | Documentation site shell: sidebar from `md`, TOC rail from `xl`. Reading bar, copy-page / markdown, child cards, see also, and a 404 slot. Storybook `UI/Doc/Api` composes an API page from `DocPage`, `AnchorHeading`, `ApiOperation`, `ParamTable` and `CodeGroup`. | `Doc` (same parts) |
|
|
588
|
-
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-background.webp" width="120" alt="Background"> | [`Background`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#background) | Full-viewport gradient with blurred colour blobs; centres its children;
|
|
621
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/navigation-layout-background.webp" width="120" alt="Background"> | [`Background`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#background) | Full-viewport gradient with blurred colour blobs; centres its children; 45 presets on `/backgrounds`. | `Background` |
|
|
589
622
|
| — | [`NavigationRail`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/navigation-and-layout.md#navigationrail) | Placeholder: renders an empty rail container and takes no props yet. | `NavigationRail` |
|
|
590
623
|
|
|
591
624
|
### Overlays & menus
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r } from "./translator-
|
|
1
|
+
import { i as e, r as t, t as n } from "./stored-language-BeIKw3-K.js";
|
|
2
|
+
import { r } from "./translator-DCYO4Ij3.js";
|
|
3
3
|
import { t as i } from "./_baseIsEqual-C6ksIHya.js";
|
|
4
4
|
import { useMemo as a } from "react";
|
|
5
5
|
import { asyncThunkCreator as o, buildCreateSlice as s } from "@reduxjs/toolkit";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
|
+
import { t } from "./is-production-GLw59WU8.js";
|
|
3
|
+
import { a as n, t as r } from "./theme-context-BagPvRcz.js";
|
|
4
|
+
import { t as i } from "./compose-refs-DZ0iIVF-.js";
|
|
5
|
+
import { t as a } from "./use-background-activity-KxQgelFF.js";
|
|
6
|
+
import { createElement as o, memo as s, useId as c, useMemo as l, useRef as u } from "react";
|
|
7
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
|
+
import { SCENE_LAYER as m, buildBackgroundScene as h, presetLayers as g, resolveBackgroundPreset as _, svgIdPrefix as v } from "@nxgt/material-core/backgrounds";
|
|
9
|
+
//#region lib/backgrounds/background/available.ts
|
|
10
|
+
var y = [
|
|
11
|
+
"gradient",
|
|
12
|
+
"grain",
|
|
13
|
+
"mesh",
|
|
14
|
+
"aurora",
|
|
15
|
+
"spotlight",
|
|
16
|
+
"bokeh",
|
|
17
|
+
"rays",
|
|
18
|
+
"halo",
|
|
19
|
+
"plasma",
|
|
20
|
+
"glass",
|
|
21
|
+
"ripples",
|
|
22
|
+
"blobs",
|
|
23
|
+
"paper",
|
|
24
|
+
"linen",
|
|
25
|
+
"concrete",
|
|
26
|
+
"marble"
|
|
27
|
+
], b = [
|
|
28
|
+
"isometric",
|
|
29
|
+
"blueprint",
|
|
30
|
+
"dots",
|
|
31
|
+
"stripes",
|
|
32
|
+
"low-poly",
|
|
33
|
+
"topography",
|
|
34
|
+
"waves",
|
|
35
|
+
"hexagons",
|
|
36
|
+
"circuit",
|
|
37
|
+
"graph-paper",
|
|
38
|
+
"checker",
|
|
39
|
+
"diagonal-checker",
|
|
40
|
+
"chevrons"
|
|
41
|
+
], x = [
|
|
42
|
+
"shapes",
|
|
43
|
+
"confetti-grid",
|
|
44
|
+
"constellation",
|
|
45
|
+
"halftone",
|
|
46
|
+
"truchet",
|
|
47
|
+
"floating",
|
|
48
|
+
"scatter-icons",
|
|
49
|
+
"school",
|
|
50
|
+
"night-sky",
|
|
51
|
+
"bubbles",
|
|
52
|
+
"leaves",
|
|
53
|
+
"science",
|
|
54
|
+
"music",
|
|
55
|
+
"travel",
|
|
56
|
+
"sport",
|
|
57
|
+
"moon"
|
|
58
|
+
], S = [
|
|
59
|
+
...y,
|
|
60
|
+
...b,
|
|
61
|
+
...x
|
|
62
|
+
], C = /^(aria|data)-/, w = (e) => e === "class" ? "className" : C.test(e) ? e : e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), T = s(function e({ node: t }) {
|
|
63
|
+
let n = Object.fromEntries(Object.entries(t.attrs).map(([e, t]) => [w(e), t]));
|
|
64
|
+
return o(t.tag, n, ...(t.children ?? []).map((t, n) => /* @__PURE__ */ f(e, { node: t }, n)));
|
|
65
|
+
}), E = s(function({ preset: e, scene: t, grain: n }) {
|
|
66
|
+
return /* @__PURE__ */ p(d, { children: [g(e).map((e) => e === m ? t && /* @__PURE__ */ f("div", {
|
|
67
|
+
"data-scene": "",
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
children: /* @__PURE__ */ f(T, { node: t })
|
|
70
|
+
}, e) : /* @__PURE__ */ f("div", {
|
|
71
|
+
"data-layer": e,
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
}, e)), n && /* @__PURE__ */ f("div", {
|
|
74
|
+
"data-overlay": "grain",
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
children: /* @__PURE__ */ f(T, { node: n })
|
|
77
|
+
})] });
|
|
78
|
+
}), D = /* @__PURE__ */ e({ Background: () => P }), O = (e) => console.warn(e), k = Object.keys({
|
|
79
|
+
shapes: 1,
|
|
80
|
+
density: 1,
|
|
81
|
+
size: 1,
|
|
82
|
+
rotate: 1,
|
|
83
|
+
shapeFill: 1,
|
|
84
|
+
opacitySpread: 1
|
|
85
|
+
}).filter((e) => e !== "shapes");
|
|
86
|
+
function A(e) {
|
|
87
|
+
return k.map((t) => e?.[t]);
|
|
88
|
+
}
|
|
89
|
+
function j(e, t, n, r, i, a) {
|
|
90
|
+
if (e === "grain") return null;
|
|
91
|
+
let o = JSON.parse(i), s = {
|
|
92
|
+
...Object.fromEntries(k.map((e, t) => [e, o[t] ?? void 0])),
|
|
93
|
+
shapes: r === void 0 ? void 0 : r.split(",").filter(Boolean)
|
|
94
|
+
}, [c, l, u, d] = JSON.parse(a);
|
|
95
|
+
return h(e, {
|
|
96
|
+
idPrefix: t,
|
|
97
|
+
seed: n,
|
|
98
|
+
motif: s,
|
|
99
|
+
moon: {
|
|
100
|
+
...c == null || l == null ? {} : { position: {
|
|
101
|
+
x: c,
|
|
102
|
+
y: l
|
|
103
|
+
} },
|
|
104
|
+
...u == null ? {} : { phase: u },
|
|
105
|
+
...d == null ? {} : { halo: d }
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function M(e) {
|
|
110
|
+
return [
|
|
111
|
+
e?.position?.x,
|
|
112
|
+
e?.position?.y,
|
|
113
|
+
e?.phase,
|
|
114
|
+
e?.halo
|
|
115
|
+
].map((e) => e ?? null);
|
|
116
|
+
}
|
|
117
|
+
function N(e, t) {
|
|
118
|
+
return h("grain", {
|
|
119
|
+
idPrefix: `${e}-grain`,
|
|
120
|
+
seed: t
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function P({ children: e, ref: o, preset: s, tone: d, intensity: m, animated: h, grain: g, seed: y, motif: b, moon: x, fill: C = "viewport", ...w }) {
|
|
124
|
+
let T = n()?.background || r, D = s ?? T.preset, k = d ?? T.tone ?? r.tone, P = m ?? T.intensity ?? r.intensity, F = h ?? T.animated ?? !1, I = g ?? T.grain ?? !1, L = y ?? T.seed ?? 0, R = b ?? T.motif, z = x ?? T.moon, B = u(null), V = l(() => i(B, o), [o]), H = a(B, F), U = v(c()), W = _(D, S, t() ? void 0 : O), G = I || W === "grain", K = R?.shapes ? [...new Set(R.shapes)].sort().join(",") : void 0, q = JSON.stringify(A(R)), J = JSON.stringify(M(z)), Y = l(() => j(W, U, L, K, q, J), [
|
|
125
|
+
W,
|
|
126
|
+
U,
|
|
127
|
+
L,
|
|
128
|
+
K,
|
|
129
|
+
q,
|
|
130
|
+
J
|
|
131
|
+
]), X = l(() => G ? N(U, L) : null, [
|
|
132
|
+
G,
|
|
133
|
+
U,
|
|
134
|
+
L
|
|
135
|
+
]);
|
|
136
|
+
return /* @__PURE__ */ p("div", {
|
|
137
|
+
"data-slot": "background",
|
|
138
|
+
...w,
|
|
139
|
+
ref: V,
|
|
140
|
+
"data-background": W === "grain" ? "gradient" : W,
|
|
141
|
+
"data-preset": W,
|
|
142
|
+
"data-tone": k,
|
|
143
|
+
"data-intensity": P,
|
|
144
|
+
"data-fill": C === "container" ? C : void 0,
|
|
145
|
+
"data-animated": F ? "" : void 0,
|
|
146
|
+
"data-grain": G ? "" : void 0,
|
|
147
|
+
"data-paused": F && H ? "" : void 0,
|
|
148
|
+
children: [/* @__PURE__ */ f(E, {
|
|
149
|
+
preset: W,
|
|
150
|
+
scene: Y,
|
|
151
|
+
grain: X
|
|
152
|
+
}), /* @__PURE__ */ f("div", {
|
|
153
|
+
"data-slot": "background-content",
|
|
154
|
+
children: e
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
export { D as n, S as r, P as t };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* The `moon` preset: a thin crescent in a wide halo among a few stars. The
|
|
2
|
+
* scene drawn by core's `buildBackgroundScene` carries the geometry (the
|
|
3
|
+
* halo's gradient stops are `s3`, the crescent `k2`, the stars `k1` and
|
|
4
|
+
* `k2`); this file gives it a faint wash, the strength each intensity sets,
|
|
5
|
+
* and a silver moon in dark. Motion (opt-in, `animated`): the stars twinkle,
|
|
6
|
+
* 8 s a leg; the delay of each (`l1..l4`) is a class, so the markup holds no
|
|
7
|
+
* inline style. React only: nothing in the shared `css/` folder. */
|
|
8
|
+
@import "../css/scene.css";
|
|
9
|
+
|
|
10
|
+
@layer components {
|
|
11
|
+
[data-background="moon"] > [data-layer="wash"] {
|
|
12
|
+
position: absolute;
|
|
13
|
+
inset: 0;
|
|
14
|
+
background:
|
|
15
|
+
radial-gradient(
|
|
16
|
+
ellipse 70% 60% at 82% 14%,
|
|
17
|
+
color-mix(in oklab, var(--nxgt-bg-c3) var(--nxgt-bg-a1), transparent),
|
|
18
|
+
transparent 72%
|
|
19
|
+
),
|
|
20
|
+
radial-gradient(
|
|
21
|
+
ellipse 60% 55% at 12% 92%,
|
|
22
|
+
color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
|
|
23
|
+
transparent 70%
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-background="moon"] > [data-scene] {
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
container: nxgt-moon / inline-size;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* The scene is written for 0.8 at the default strength: subtle 0.47,
|
|
33
|
+
* vivid the full 1. The root class makes it (0,4,0), above the motif rule (0,3,0). */
|
|
34
|
+
[data-background="moon"] > [data-scene] > .mn :is(.mo, .mh) {
|
|
35
|
+
opacity: calc(var(--nxgt-bg-op) / 0.9);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* The scene has no viewBox (lengths are pixels, positions shares of the
|
|
39
|
+
* container): the moon and the stars draw past their own origin. */
|
|
40
|
+
[data-background="moon"] > [data-scene] .pt {
|
|
41
|
+
overflow: visible;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* A narrow container: half the size, so the moon stays whole in the top right corner. */
|
|
45
|
+
@container nxgt-moon (max-width: 640px) {
|
|
46
|
+
[data-background="moon"] > [data-scene] .mg .md {
|
|
47
|
+
transform: scale(0.5);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* In light the scene is multiplied into the page and the crescent is
|
|
52
|
+
* lighter still: a faint watermark. */
|
|
53
|
+
[data-background="moon"] > [data-scene] {
|
|
54
|
+
mix-blend-mode: multiply;
|
|
55
|
+
}
|
|
56
|
+
[data-background="moon"] > [data-scene] .md {
|
|
57
|
+
opacity: 0.55;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* In dark it adds nothing but light, and the moon is silver, lighter than the lifted tone. */
|
|
61
|
+
:is(.dark, [data-theme="dark"]) [data-background="moon"] > [data-scene],
|
|
62
|
+
[data-background="moon"]:is(.dark, [data-theme="dark"]) > [data-scene] {
|
|
63
|
+
mix-blend-mode: normal;
|
|
64
|
+
}
|
|
65
|
+
:is(.dark, [data-theme="dark"]) [data-background="moon"] > [data-scene] .md,
|
|
66
|
+
[data-background="moon"]:is(.dark, [data-theme="dark"]) > [data-scene] .md {
|
|
67
|
+
color: color-mix(in oklab, var(--nxgt-bg-c2) 30%, white);
|
|
68
|
+
opacity: 0.78;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
73
|
+
@keyframes nxgt-bg-moon-twinkle {
|
|
74
|
+
to {
|
|
75
|
+
opacity: 0.3;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@layer components {
|
|
80
|
+
[data-background="moon"][data-animated] > [data-scene] .tw {
|
|
81
|
+
animation: nxgt-bg-moon-twinkle 8s ease-in-out infinite alternate
|
|
82
|
+
var(--nxgt-bg-play, running);
|
|
83
|
+
}
|
|
84
|
+
[data-background="moon"][data-animated] > [data-scene] .l1 {
|
|
85
|
+
animation-delay: 0s;
|
|
86
|
+
}
|
|
87
|
+
[data-background="moon"][data-animated] > [data-scene] .l2 {
|
|
88
|
+
animation-delay: -2s;
|
|
89
|
+
}
|
|
90
|
+
[data-background="moon"][data-animated] > [data-scene] .l3 {
|
|
91
|
+
animation-delay: -4s;
|
|
92
|
+
}
|
|
93
|
+
[data-background="moon"][data-animated] > [data-scene] .l4 {
|
|
94
|
+
animation-delay: -6s;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
package/dist/backgrounds.js
CHANGED
|
@@ -1,139 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { createElement as r, memo as i, useId as a, useMemo as o, useRef as s } from "react";
|
|
5
|
-
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
-
import { BACKGROUND_INTENSITIES as d, BACKGROUND_PRESETS as f, BACKGROUND_TONES as p, MOTIF_SHAPES as m, MOTIF_SHAPES_ALL as h, SCENE_LAYER as g, SHIPPED_BACKGROUND_PRESETS as _, buildBackgroundScene as v, presetLayers as y, resolveBackgroundPreset as b, svgIdPrefix as x } from "@nxgt/material-core/backgrounds";
|
|
7
|
-
//#region lib/backgrounds/background/available.ts
|
|
8
|
-
var S = [
|
|
9
|
-
"gradient",
|
|
10
|
-
"grain",
|
|
11
|
-
"mesh",
|
|
12
|
-
"aurora",
|
|
13
|
-
"spotlight",
|
|
14
|
-
"bokeh",
|
|
15
|
-
"rays",
|
|
16
|
-
"halo",
|
|
17
|
-
"plasma",
|
|
18
|
-
"glass",
|
|
19
|
-
"ripples",
|
|
20
|
-
"blobs",
|
|
21
|
-
"paper",
|
|
22
|
-
"linen",
|
|
23
|
-
"concrete",
|
|
24
|
-
"marble"
|
|
25
|
-
], C = [
|
|
26
|
-
"isometric",
|
|
27
|
-
"blueprint",
|
|
28
|
-
"dots",
|
|
29
|
-
"stripes",
|
|
30
|
-
"low-poly",
|
|
31
|
-
"topography",
|
|
32
|
-
"waves",
|
|
33
|
-
"hexagons",
|
|
34
|
-
"circuit",
|
|
35
|
-
"graph-paper",
|
|
36
|
-
"checker",
|
|
37
|
-
"diagonal-checker",
|
|
38
|
-
"chevrons"
|
|
39
|
-
], w = [
|
|
40
|
-
"shapes",
|
|
41
|
-
"confetti-grid",
|
|
42
|
-
"constellation",
|
|
43
|
-
"halftone",
|
|
44
|
-
"truchet",
|
|
45
|
-
"floating",
|
|
46
|
-
"scatter-icons",
|
|
47
|
-
"school",
|
|
48
|
-
"night-sky",
|
|
49
|
-
"bubbles",
|
|
50
|
-
"leaves",
|
|
51
|
-
"science",
|
|
52
|
-
"music",
|
|
53
|
-
"travel",
|
|
54
|
-
"sport"
|
|
55
|
-
], T = [
|
|
56
|
-
...S,
|
|
57
|
-
...C,
|
|
58
|
-
...w
|
|
59
|
-
], E = /^(aria|data)-/, D = (e) => e === "class" ? "className" : E.test(e) ? e : e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), O = i(function e({ node: t }) {
|
|
60
|
-
let n = Object.fromEntries(Object.entries(t.attrs).map(([e, t]) => [D(e), t]));
|
|
61
|
-
return r(t.tag, n, ...(t.children ?? []).map((t, n) => /* @__PURE__ */ l(e, { node: t }, n)));
|
|
62
|
-
}), k = i(function({ preset: e, scene: t, grain: n }) {
|
|
63
|
-
return /* @__PURE__ */ u(c, { children: [y(e).map((e) => e === g ? t && /* @__PURE__ */ l("div", {
|
|
64
|
-
"data-scene": "",
|
|
65
|
-
"aria-hidden": "true",
|
|
66
|
-
children: /* @__PURE__ */ l(O, { node: t })
|
|
67
|
-
}, e) : /* @__PURE__ */ l("div", {
|
|
68
|
-
"data-layer": e,
|
|
69
|
-
"aria-hidden": "true"
|
|
70
|
-
}, e)), n && /* @__PURE__ */ l("div", {
|
|
71
|
-
"data-overlay": "grain",
|
|
72
|
-
"aria-hidden": "true",
|
|
73
|
-
children: /* @__PURE__ */ l(O, { node: n })
|
|
74
|
-
})] });
|
|
75
|
-
}), A = (e) => console.warn(e), j = Object.keys({
|
|
76
|
-
shapes: 1,
|
|
77
|
-
density: 1,
|
|
78
|
-
size: 1,
|
|
79
|
-
rotate: 1,
|
|
80
|
-
shapeFill: 1,
|
|
81
|
-
opacitySpread: 1
|
|
82
|
-
}).filter((e) => e !== "shapes");
|
|
83
|
-
function M(e) {
|
|
84
|
-
return j.map((t) => e?.[t]);
|
|
85
|
-
}
|
|
86
|
-
function N(e, t, n, r, i) {
|
|
87
|
-
if (e === "grain") return null;
|
|
88
|
-
let a = JSON.parse(i);
|
|
89
|
-
return v(e, {
|
|
90
|
-
idPrefix: t,
|
|
91
|
-
seed: n,
|
|
92
|
-
motif: {
|
|
93
|
-
...Object.fromEntries(j.map((e, t) => [e, a[t] ?? void 0])),
|
|
94
|
-
shapes: r === void 0 ? void 0 : r.split(",").filter(Boolean)
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
function P(e, t) {
|
|
99
|
-
return v("grain", {
|
|
100
|
-
idPrefix: `${e}-grain`,
|
|
101
|
-
seed: t
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
function F({ children: r, ref: i, preset: c = "gradient", tone: d = "primary", intensity: f = "default", animated: p = !1, grain: m = !1, seed: h = 0, motif: g, fill: _ = "viewport", ...v }) {
|
|
105
|
-
let y = s(null), S = o(() => t(y, i), [i]), C = n(y, p), w = x(a()), E = b(c, T, e() ? void 0 : A), D = m || E === "grain", O = g?.shapes ? [...new Set(g.shapes)].sort().join(",") : void 0, j = JSON.stringify(M(g)), F = o(() => N(E, w, h, O, j), [
|
|
106
|
-
E,
|
|
107
|
-
w,
|
|
108
|
-
h,
|
|
109
|
-
O,
|
|
110
|
-
j
|
|
111
|
-
]), I = o(() => D ? P(w, h) : null, [
|
|
112
|
-
D,
|
|
113
|
-
w,
|
|
114
|
-
h
|
|
115
|
-
]);
|
|
116
|
-
return /* @__PURE__ */ u("div", {
|
|
117
|
-
"data-slot": "background",
|
|
118
|
-
...v,
|
|
119
|
-
ref: S,
|
|
120
|
-
"data-background": E === "grain" ? "gradient" : E,
|
|
121
|
-
"data-preset": E,
|
|
122
|
-
"data-tone": d,
|
|
123
|
-
"data-intensity": f,
|
|
124
|
-
"data-fill": _ === "container" ? _ : void 0,
|
|
125
|
-
"data-animated": p ? "" : void 0,
|
|
126
|
-
"data-grain": D ? "" : void 0,
|
|
127
|
-
"data-paused": p && C ? "" : void 0,
|
|
128
|
-
children: [/* @__PURE__ */ l(k, {
|
|
129
|
-
preset: E,
|
|
130
|
-
scene: F,
|
|
131
|
-
grain: I
|
|
132
|
-
}), /* @__PURE__ */ l("div", {
|
|
133
|
-
"data-slot": "background-content",
|
|
134
|
-
children: r
|
|
135
|
-
})]
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
//#endregion
|
|
139
|
-
export { T as AVAILABLE_BACKGROUND_PRESETS, d as BACKGROUND_INTENSITIES, f as BACKGROUND_PRESETS, p as BACKGROUND_TONES, F as Background, m as MOTIF_SHAPES, h as MOTIF_SHAPES_ALL, _ as SHIPPED_BACKGROUND_PRESETS };
|
|
1
|
+
import { r as e, t } from "./background--Bf_EbFR.js";
|
|
2
|
+
import { BACKGROUND_INTENSITIES as n, BACKGROUND_PRESETS as r, BACKGROUND_TONES as i, MOTIF_SHAPES as a, MOTIF_SHAPES_ALL as o, SHIPPED_BACKGROUND_PRESETS as s } from "@nxgt/material-core/backgrounds";
|
|
3
|
+
export { e as AVAILABLE_BACKGROUND_PRESETS, n as BACKGROUND_INTENSITIES, r as BACKGROUND_PRESETS, i as BACKGROUND_TONES, t as Background, a as MOTIF_SHAPES, o as MOTIF_SHAPES_ALL, s as SHIPPED_BACKGROUND_PRESETS };
|