@nxgt/material 3.10.0 → 3.10.2

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +18 -1
  3. package/dist/background-cEqcZQ3v.js +249 -0
  4. package/dist/backgrounds.js +1 -1
  5. package/dist/{components-D5d2rflJ.js → components-BkF9N-Yx.js} +5 -5
  6. package/dist/components.js +16 -16
  7. package/dist/editor.js +1 -1
  8. package/dist/empty-state-SeAg2TOX.js +117 -0
  9. package/dist/{icon-sprites-CZ3vcD7P.js → icon-sprites-FxHyqyhg.js} +18 -5
  10. package/dist/icons-scene-BpIauJ5d.js +27 -0
  11. package/dist/illustration-BfHRpVzM.js +97 -0
  12. package/dist/illustrations.js +2 -2
  13. package/dist/lib/backgrounds/background/partials/icons-scene.d.ts +3 -1
  14. package/dist/lib/components/ui/feedback/state-frame/state-scene-illustration.d.ts +4 -2
  15. package/dist/lib/components/ui/primitives/icon/icon-sprites.d.ts +13 -1
  16. package/dist/lib/illustrations/lazy-chunk.d.ts +9 -0
  17. package/dist/lib/illustrations/plated-illustration.d.ts +3 -1
  18. package/dist/lib/illustrations/use-illustration.d.ts +1 -0
  19. package/dist/lib/theme-picker/partials/tile-icons.d.ts +2 -1
  20. package/dist/main.js +28 -28
  21. package/dist/pdf-reader.js +1 -1
  22. package/dist/plated-illustration-iNO6KYTL.js +29 -0
  23. package/dist/{public-DGvtAz7M.js → public-CtpsxV4I.js} +1 -1
  24. package/dist/{state-scenes-Be9w_3an.js → state-scenes-SGNyZjTz.js} +53 -40
  25. package/dist/theme-picker.js +53 -52
  26. package/dist/{use-chat-composer-CkEPJo5I.js → use-chat-composer-nWWfVyrK.js} +4240 -4235
  27. package/docs/components/overlays-and-menus.md +4 -1
  28. package/docs/components/primitives.md +14 -0
  29. package/docs/guides/backgrounds.md +1 -1
  30. package/docs/guides/icon-motifs.md +36 -8
  31. package/docs/guides/illustrations.md +13 -1
  32. package/docs/previews/feedback-status-circularprogress.webp +0 -0
  33. package/docs/previews/feedback-status-hydrateloading.webp +0 -0
  34. package/docs/previews/feedback-status-notifications.webp +0 -0
  35. package/docs/previews/feedback-status-progress.webp +0 -0
  36. package/docs/previews/feedback-status-skeleton.webp +0 -0
  37. package/docs/previews/feedback-status-spinner.webp +0 -0
  38. package/docs/previews/feedback-status-typingindicator.webp +0 -0
  39. package/docs/troubleshooting.md +27 -2
  40. package/package.json +2 -2
  41. package/dist/background-CAWV_qSk.js +0 -247
  42. package/dist/empty-state-COAV2d-R.js +0 -98
  43. package/dist/icons-scene-bA7I4wdP.js +0 -24
  44. package/dist/illustration-DfPJtkFY.js +0 -86
  45. package/dist/plated-illustration-C3z0hP9U.js +0 -19
@@ -158,7 +158,10 @@ instead of capping; it does not pin the header or footer.
158
158
 
159
159
  `DialogContent` does not render a close button by itself — add `DialogClose`.
160
160
  It ignores outside clicks that land on an open `Combobox` list, so a combobox
161
- inside a dialog works. On open it moves focus into the dialog: to its first
161
+ inside a dialog works. The list (`Combobox`, `ComboboxField`,
162
+ `ComboboxFormField`, `CountryField`) is portaled to `<body>`, where a modal
163
+ layer sets `pointer-events: none`, so it sets `pointer-events: auto` itself:
164
+ in a `Dialog`, a `Sheet` or a `Drawer` an option is picked by mouse or touch. On open it moves focus into the dialog: to its first
162
165
  control, or to the content itself when it has none. An `onOpenAutoFocus` of
163
166
  yours that calls `event.preventDefault()` keeps focus off that control (then
164
167
  focus what you want yourself): a modal dialog then focuses its content, as the
@@ -448,6 +448,20 @@ import { Icon, IconSpritesProvider } from '@nxgt/material/components';
448
448
  // → /static/icons/solid.svg#bell
449
449
  ```
450
450
 
451
+ `IconSpritesProvider` also takes `edition: 'pro' | 'free'` (default `'pro'`; a
452
+ nested provider without one keeps its parent's). `edition="free"` is for apps
453
+ that serve Font Awesome Free's `solid.svg`, `regular.svg` and `brands.svg` only:
454
+ every `Icon`, `Illustration` and icon `Background` below it draws any other
455
+ style (the default duotone included) from `solid.svg`, and renames a Pro-only
456
+ name to its Free twin (`chevrons-left` to `angles-left`). `useIconEdition()` reads it.
457
+
458
+ ```tsx
459
+ <IconSpritesProvider base="/static/icons/" edition="free">
460
+ <Icon name="bell" />
461
+ </IconSpritesProvider>;
462
+ // → /static/icons/solid.svg#bell
463
+ ```
464
+
451
465
  **Storybook:** `Primitives/Icon` · **Vue:** `Icon`
452
466
 
453
467
  ---
@@ -326,7 +326,7 @@ them. The theme picker draws a small tile for a theme with a celestial preset.
326
326
 
327
327
  `preset="icons"` scatters Font Awesome icons over a faint wash. The library ships **no icon artwork**: each icon is a
328
328
  `<use>` of a sprite file your app serves (`/assets/icons/sprites/` by default; `IconSpritesProvider base="/static/icons/"`
329
- moves it, as for `Icon`). Font Awesome Pro is licensed to you, not to this package. The [icon motifs guide](icon-motifs.md) puts icons, skies, illustrations and themes together.
329
+ moves it, as for `Icon`; `edition="free"` draws the Free sheets, see the [Free edition](icon-motifs.md#the-free-edition)). Font Awesome Pro is licensed to you, not to this package. The [icon motifs guide](icon-motifs.md) puts icons, skies, illustrations and themes together.
330
330
 
331
331
  ```tsx
332
332
  import '@nxgt/material/backgrounds/icons.css'; // or backgrounds.css
@@ -17,7 +17,7 @@ Free works the same way.
17
17
  | You have | Serve | Use |
18
18
  | --- | --- | --- |
19
19
  | the Pro 7.3 pack | one sheet per style you draw, in `public/assets/icons/sprites/`: `duotone-thin.svg` (the default look), `duotone.svg`, `solid.svg`, `sharp-solid.svg`… A non-classic family is `<family>-<style>.svg` | the defaults |
20
- | Font Awesome Free | `solid.svg`, `regular.svg` and `brands.svg` from `@fortawesome/fontawesome-free/sprites/`, copied to the same folder | `iconStyle="solid"` (and `iconStyle="solid"` on an `Illustration`) |
20
+ | Font Awesome Free | `solid.svg`, `regular.svg` and `brands.svg` from `@fortawesome/fontawesome-free/sprites/`, copied to the same folder | `<IconSpritesProvider base="…" edition="free">` once at the root ([Free edition](#the-free-edition)) |
21
21
 
22
22
  The Free icons are CC BY 4.0: credit Font Awesome where you show them (the
23
23
  previews below are drawn with the Free `solid` sheet, Font Awesome Free 7.3.1,
@@ -175,19 +175,47 @@ a sheet that is not served draws nothing and the tile keeps its wash.
175
175
 
176
176
  See [themes](themes.md#icon-motifs-in-a-theme).
177
177
 
178
+ ## The Free edition
179
+
180
+ Font Awesome Free has three sheets, `solid`, `regular` and `brands`, and none
181
+ for duotone, light, thin or the other families. Tell the provider once:
182
+
183
+ ```tsx
184
+ <IconSpritesProvider base="/static/icons/" edition="free">
185
+ <App />
186
+ </IconSpritesProvider>
187
+ ```
188
+
189
+ Below it, in every `Icon` (so the app shell's menu, `AccountMenu`,
190
+ `LanguageSwitcher`, `LoadMoreButton`, the data table's pagination…), every
191
+ `Illustration` and state illustration, every `Background preset="icons"` and
192
+ every theme tile:
193
+
194
+ - a style Free lacks is drawn from `solid.svg`: the default duotone, `thin`,
195
+ `light`, `sharp-*` and every other family. `regular` and `brands` stay;
196
+ - a Pro-only name is renamed to its Free twin, the same one in every place
197
+ (the table below, plus `chevrons-*` to `angles-*`, `badge-check` to
198
+ `circle-check`, `loader` to `spinner`).
199
+
200
+ The default is `edition="pro"`, and nothing changes for Pro. A nested
201
+ `IconSpritesProvider` without an `edition` keeps its parent's. The workaround of
202
+ serving a copy of `solid.svg` as `duotone.svg` is no longer needed. A name of
203
+ your own that Free lacks is not renamed: pass its Free name. The `regular`
204
+ sheet of Free holds fewer names than `solid`: draw an icon it lacks in `solid`.
205
+
178
206
  ## Free fallbacks for Pro-only names
179
207
 
180
- Most suggested names exist in Font Awesome Free. These do not, and stand in
181
- with a Free neighbour when you serve the Free sheets (pass `hero`, `satellites`
182
- or `icons` with the Free name):
208
+ Most suggested names exist in Font Awesome Free. These do not. With
209
+ `edition="free"` they stand in with the Free neighbour below on their own; with
210
+ another setup, pass `hero`, `satellites` or `icons` with the Free name:
183
211
 
184
212
  | Where | Pro-only name | A Free neighbour |
185
213
  | --- | --- | --- |
186
- | `school` pack | `backpack` | `bag-shopping` |
214
+ | `school` pack | `backpack` | `school` |
187
215
  | `nature` pack | `flower` | `seedling` |
188
- | base scenes | `sparkles`, `wifi-slash`, `cloud-slash`, `party-horn`, `hand-wave`, `lock-keyhole`, `traffic-cone` | `star`, `wifi`, `cloud`, `gift`, `hand`, `lock`, `triangle-exclamation` |
189
- | health scenes | `folder-user`, `clipboard-medical`, `calendar-clock`, `siren-on` | `folder`, `clipboard`, `calendar-check`, `triangle-exclamation` |
190
- | education scenes | `backpack`, `clipboard-list-check`, `books`, `file-chart-column` | `bag-shopping`, `clipboard-check`, `book`, `file-lines` |
216
+ | base scenes | `sparkles`, `wifi-slash`, `cloud-slash`, `party-horn`, `hand-wave`, `lock-keyhole`, `traffic-cone` | `wand-magic-sparkles`, `wifi`, `cloud`, `gift`, `hand`, `lock`, `triangle-exclamation` |
217
+ | health scenes | `folder-user`, `clipboard-medical`, `calendar-clock`, `siren-on` | `folder`, `notes-medical`, `calendar-check`, `truck-medical` |
218
+ | education scenes | `backpack`, `clipboard-list-check`, `books`, `file-chart-column` | `school`, `clipboard-check`, `book`, `file-lines` |
191
219
 
192
220
  ## Where to go next
193
221
 
@@ -41,6 +41,13 @@ with `data-scene`, `data-size` and `data-animated`). A bad icon name or style
41
41
  never crashes the page: outside production it warns once in the console, and
42
42
  the scene's built-in art is drawn instead.
43
43
 
44
+ Two data attributes say what was drawn, for a test or a style:
45
+ `data-plated` is on the `<svg>` once the plate has drawn (the disc that stands
46
+ in while the chunk loads has none), and `data-fallback` is on the built-in art
47
+ that stands in when the scene cannot be drawn (a bad icon, or a chunk that
48
+ failed to load). On an `EmptyState` or `ErrorState` it is on the box
49
+ (`data-slot="illustration"`) or the `<svg>` inside it.
50
+
44
51
  The sprites are read from `/assets/icons/sprites/`, or from the base of the
45
52
  nearest `IconSpritesProvider`. An icon whose name the sprite does not hold is
46
53
  blank: keep to names every style you use has (the suggested ones are the
@@ -51,6 +58,11 @@ arrives, in a box of the same size, so the page does not move. A streaming
51
58
  server render includes the plate; `renderToString` sends the disc and the
52
59
  browser draws the plate once the chunk has loaded.
53
60
 
61
+ If a chunk fails to load (a flaky network, or a tab kept open across a deploy
62
+ whose old hashed files are gone), the illustration draws the built-in art of the
63
+ scene's kind instead of throwing: the page, and the `EmptyState` around it,
64
+ stay. There is no retry; outside production the console warns once.
65
+
54
66
  ## Use them in the states
55
67
 
56
68
  `EmptyState`, `ErrorState` and the `DataTable` empty row draw today's built-in
@@ -132,7 +144,7 @@ import { EmptyState } from '@nxgt/material/components';
132
144
  Importing the entry adds the ids to `SceneId`; `EDUCATION_SUGGESTED_ICONS` lists
133
145
  the icon names the set draws, hero first. Some of them (`backpack`,
134
146
  `clipboard-list-check`, `books`, `file-chart-column`) are Font Awesome Pro
135
- icons: serve a Pro sprite, or pass `icons` with Free neighbours.
147
+ icons: serve a Pro sprite, or set `edition="free"` on `IconSpritesProvider`, which draws their Free twins (see the [Free edition](icon-motifs.md#the-free-edition)).
136
148
 
137
149
  ## Turn them on for an app
138
150
 
@@ -95,6 +95,7 @@ words in your error.
95
95
  - [A toast covers the form's button on a phone](#a-toast-covers-the-forms-button-on-a-phone)
96
96
  - [A toast never goes away after a tap](#a-toast-never-goes-away-after-a-tap)
97
97
  - [A toast's action cannot be clicked while a dialog is open](#a-toasts-action-cannot-be-clicked-while-a-dialog-is-open)
98
+ - [A combobox option cannot be clicked in a dialog, sheet or drawer](#a-combobox-option-cannot-be-clicked-in-a-dialog-sheet-or-drawer)
98
99
  - [`toasts.success(message, { action })` shows no action button](#toastssuccessmessage--action--shows-no-action-button)
99
100
  - [An accessibility audit reports low contrast on a toast's action](#an-accessibility-audit-reports-low-contrast-on-a-toasts-action)
100
101
  - [A `Banner` is not announced while a dialog is open](#a-banner-is-not-announced-while-a-dialog-is-open)
@@ -424,6 +425,7 @@ words in your error.
424
425
  **Illustrations**
425
426
 
426
427
  - [`Illustration: … Drawing the built-in art instead.`](#illustration--drawing-the-built-in-art-instead)
428
+ - [`Failed to fetch dynamically imported module` from an empty state or an illustration](#failed-to-fetch-dynamically-imported-module-from-an-empty-state-or-an-illustration)
427
429
 
428
430
  - [Reporting a bug](#reporting-a-bug)
429
431
 
@@ -783,13 +785,13 @@ public/assets/icons/sprites/solid.svg ← <Icon name="atom" type="solid" />
783
785
  public/assets/icons/sprites/sharp-solid.svg ← <Icon name="atom" family="sharp" type="solid" />
784
786
  ```
785
787
 
786
- Serve one sheet per style you use, from your own Font Awesome Pro kit.
788
+ Serve one sheet per style you use, from your own Font Awesome Pro kit. With Font Awesome Free (`solid.svg`, `regular.svg`, `brands.svg`), set `edition="free"` on `IconSpritesProvider`: the library's own icons (the app shell menu, `AccountMenu`, pagination…) are duotone, and they then draw from `solid.svg`.
787
789
 
788
790
  ### A background, an illustration or a theme tile draws no icons
789
791
 
790
792
  **When:** `Background preset="icons"`, an `Illustration`, an `EmptyState` with an `illustration`, or a `ThemePicker` tile shows its wash or its plate and no icons. The network tab shows a `404` for `/assets/icons/sprites/duotone-thin.svg` (the default style), or for the sheet of the `iconStyle` you chose. No error is thrown.
791
793
  **Why:** these icons are `<use>` references to sprite sheets your app serves; the library ships none (the Font Awesome licence does not allow it). The default style is `duotone-thin`, so a Free-only app, which has `solid.svg`, `regular.svg` and `brands.svg`, draws nothing until it asks for a Free style. A name the sheet does not hold is blank too, such as `backpack` or `books`, which exist in Pro only. A theme tile with no icons keeps its wash: that is the intended fallback, not a bug.
792
- **Fix:** serve the sheet (or move the base with `IconSpritesProvider`), or choose a style you serve, and give Free names where you have only Free:
794
+ **Fix:** serve the sheet (or move the base with `IconSpritesProvider`). With only the Free sheets, say so: `<IconSpritesProvider base="/assets/icons/sprites/" edition="free">` draws every style Free lacks from `solid.svg` and the Pro-only names as their Free twin, so the app shell's menu, `AccountMenu` and the rest need nothing else (do not copy `solid.svg` to `duotone.svg`). Or choose a style you serve, and give Free names:
793
795
 
794
796
  ```tsx
795
797
  // Free sprites copied to public/assets/icons/sprites/solid.svg
@@ -1746,6 +1748,17 @@ counted a pointer down on a toast as outside the dialog.
1746
1748
  inside the `Toaster` as inside, so the action runs and the dialog stays open.
1747
1749
  Sonner's own `Toaster` keeps the old behaviour.
1748
1750
 
1751
+ ### A combobox option cannot be clicked in a dialog, sheet or drawer
1752
+
1753
+ **When:** a `ComboboxField`, `ComboboxFormField` or `Combobox` inside a modal
1754
+ `Dialog`, `Sheet` or `Drawer` opens its list and shows the options, but a mouse
1755
+ or touch click on one does nothing (a test reports `<html> intercepts pointer
1756
+ events`); the keyboard picks.
1757
+ **Why:** a modal layer sets `pointer-events: none` on `<body>`, and the list,
1758
+ portaled there, inherited it.
1759
+ **Fix:** update `@nxgt/material`: the list sets `pointer-events: auto`.
1760
+ `SelectFormField` was the workaround meanwhile.
1761
+
1749
1762
  ### `toasts.success(message, { action })` shows no action button
1750
1763
 
1751
1764
  **When:** a preset is called the way sonner's own `toast.success` is, with a
@@ -7221,6 +7234,18 @@ import { HEALTH_SCENES } from '@nxgt/material/illustrations/health';
7221
7234
  <Illustration scene="patient-record" scenes={HEALTH_SCENES} iconStyle="duotone-light" />;
7222
7235
  ```
7223
7236
 
7237
+ ### `Failed to fetch dynamically imported module` from an empty state or an illustration
7238
+
7239
+ **When:** a page that shows an `EmptyState`, an `ErrorState`, a `DataTable` empty state or an `Illustration` with a scene loses its content to the error boundary, with `Failed to fetch dynamically imported module` (or `error loading dynamically imported module`) naming an illustration chunk. Seen on a flaky network, and in a tab kept open across a deploy whose old hashed chunk is gone. Versions before the release that carries this fix (3.10.0 and earlier).
7240
+ **Why:** the scene and the plate load on demand, and a rejected import was not caught inside the component, so it reached the route's error boundary.
7241
+ **Fix:** upgrade to the release that carries the fix. A failed illustration chunk then draws the built-in art of the state's kind (no retry), and outside production the console warns once with `Illustration: the "…" chunk failed to load`. In a test, `data-fallback` marks the built-in art and `data-plated` marks a drawn plate:
7242
+
7243
+ ```tsx
7244
+ expect(container.querySelector('[data-fallback]')).not.toBeNull();
7245
+ ```
7246
+
7247
+ Before upgrading, precaching the illustration chunks in the service worker narrows the window.
7248
+
7224
7249
  ---
7225
7250
 
7226
7251
  ## Reporting a bug
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "3.10.0",
3
+ "version": "3.10.2",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -353,7 +353,7 @@
353
353
  "docs:previews": "rm -rf node_modules/.cache/nxgt-preview-free/missing && NXGT_PREVIEW_FREE=1 vitest run --project previews && bun .storybook/preview-free-report.ts"
354
354
  },
355
355
  "dependencies": {
356
- "@nxgt/material-core": "^0.29.0",
356
+ "@nxgt/material-core": "^0.29.1",
357
357
  "@base-ui/react": "^1.6.0",
358
358
  "@dnd-kit/core": "^6.3.1",
359
359
  "@dnd-kit/sortable": "^10.0.0",
@@ -1,247 +0,0 @@
1
- import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
2
- import { t } from "./is-production-GLw59WU8.js";
3
- import { n } from "./icon-sprites-CZ3vcD7P.js";
4
- import { a as r, t as i } from "./theme-context-Cofk6vgs.js";
5
- import { t as a } from "./compose-refs-DZ0iIVF-.js";
6
- import { t as o } from "./use-background-activity-KxQgelFF.js";
7
- import { t as s } from "./scene-svg-DJKa5vsg.js";
8
- import { n as c, r as l, t as u } from "./scene-options-CCy3V7XS.js";
9
- import { Suspense as d, lazy as f, memo as p, useId as ee, useMemo as m, useRef as h } from "react";
10
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
11
- import { IconRefError as y, resolveIconStyles as b, resolveIcons as x } from "@nxgt/material-core/icons";
12
- import { SCENE_LAYER as S, buildBackgroundScene as C, presetLayers as w, resolveBackgroundPreset as T, svgIdPrefix as E } from "@nxgt/material-core/backgrounds";
13
- //#region lib/backgrounds/background/available.ts
14
- var D = [
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
- ], O = [
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
- ], k = [
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
- ], A = [
64
- "eclipse",
65
- "meteor-shower",
66
- "ringed-planet",
67
- "northern-lights"
68
- ], j = (e) => A.includes(e), M = [
69
- ...D,
70
- ...O,
71
- ...k,
72
- ...A
73
- ], N = f(() => import("./icons-scene-bA7I4wdP.js"));
74
- function P(e) {
75
- return /* @__PURE__ */ _("div", {
76
- "data-scene": "",
77
- "aria-hidden": "true",
78
- children: /* @__PURE__ */ _(d, {
79
- fallback: null,
80
- children: /* @__PURE__ */ _(N, { ...e })
81
- })
82
- });
83
- }
84
- //#endregion
85
- //#region lib/backgrounds/background/partials/background-layers.tsx
86
- var F = f(() => import("./celestial-scene-DaOsRFF3.js")), I = p(function({ preset: e, scene: t, grain: n, sky: r, icons: i, ...a }) {
87
- return /* @__PURE__ */ v(g, { children: [
88
- w(e).map((n) => n === S ? i ? /* @__PURE__ */ _(P, { ...i }, n) : j(e) ? /* @__PURE__ */ _("div", {
89
- "data-scene": "",
90
- "data-celestial": "",
91
- "aria-hidden": "true",
92
- children: /* @__PURE__ */ _(d, {
93
- fallback: null,
94
- children: /* @__PURE__ */ _(F, {
95
- name: e,
96
- as: "preset",
97
- ...a
98
- })
99
- })
100
- }, n) : t && /* @__PURE__ */ _("div", {
101
- "data-scene": "",
102
- "aria-hidden": "true",
103
- children: /* @__PURE__ */ _(s, { node: t })
104
- }, n) : /* @__PURE__ */ _("div", {
105
- "data-layer": n,
106
- "aria-hidden": "true"
107
- }, n)),
108
- r && /* @__PURE__ */ _("div", {
109
- "data-layer": "sky-scene",
110
- "data-scene": "",
111
- "data-celestial": "",
112
- "aria-hidden": "true",
113
- children: /* @__PURE__ */ _(d, {
114
- fallback: null,
115
- children: /* @__PURE__ */ _(F, {
116
- name: r,
117
- as: "sky",
118
- base: e,
119
- ...a
120
- })
121
- })
122
- }),
123
- n && /* @__PURE__ */ _("div", {
124
- "data-overlay": "grain",
125
- "aria-hidden": "true",
126
- children: /* @__PURE__ */ _(s, { node: n })
127
- })
128
- ] });
129
- });
130
- //#endregion
131
- //#region lib/backgrounds/background/partials/icons-check.ts
132
- function L(e, t) {
133
- try {
134
- return e !== void 0 && x(e), b(t), null;
135
- } catch (e) {
136
- if (e instanceof y) return e.message;
137
- throw e;
138
- }
139
- }
140
- //#endregion
141
- //#region lib/backgrounds/background/partials/icons-keys.ts
142
- var R = Object.keys({
143
- layout: 1,
144
- sizeRange: 1,
145
- rotation: 1,
146
- duotone: 1,
147
- secondaryOpacity: 1,
148
- calm: 1
149
- });
150
- function z(e) {
151
- return JSON.stringify(Object.fromEntries(R.flatMap((t) => e?.[t] === void 0 ? [] : [[t, e[t]]])));
152
- }
153
- //#endregion
154
- //#region lib/backgrounds/background/partials/use-icons-scene.ts
155
- function B(e, { icons: r, iconStyle: i, iconMotif: a, seed: o, animated: s }) {
156
- let c = n(), l = JSON.stringify(r ?? null), u = JSON.stringify(i ?? null), d = z(a), f = m(() => {
157
- if (e !== "icons") return null;
158
- let n = L(JSON.parse(l) ?? void 0, JSON.parse(u) ?? void 0);
159
- return n && !t() && console.warn(`Background: icons cannot be drawn (${n}); drawing "scatter-icons" instead.`), n;
160
- }, [
161
- e,
162
- l,
163
- u
164
- ]) ? "scatter-icons" : e;
165
- return {
166
- preset: f,
167
- iconsScene: m(() => f === "icons" ? {
168
- seed: o,
169
- iconsKey: l,
170
- styleKey: u,
171
- motifKey: d,
172
- spriteBase: c,
173
- animated: s
174
- } : void 0, [
175
- f,
176
- o,
177
- l,
178
- u,
179
- d,
180
- c,
181
- s
182
- ])
183
- };
184
- }
185
- //#endregion
186
- //#region lib/backgrounds/background/background.tsx
187
- var V = /* @__PURE__ */ e({ Background: () => G }), H = (e) => console.warn(e);
188
- function U(e, t, n, r, i, a) {
189
- return e === "grain" ? null : C(e, l(t, n, r, i, a));
190
- }
191
- function W(e, t) {
192
- return C("grain", {
193
- idPrefix: `${e}-grain`,
194
- seed: t
195
- });
196
- }
197
- function G({ children: e, ref: n, preset: s, tone: l, intensity: d, animated: f, grain: p, seed: g, motif: y, moon: b, sky: x, icons: S, iconStyle: C, iconMotif: w, fill: D = "viewport", ...O }) {
198
- let k = r()?.background || i, A = s ?? k.preset, j = l ?? k.tone ?? i.tone, N = d ?? k.intensity ?? i.intensity, P = f ?? k.animated ?? !1, F = p ?? k.grain ?? !1, L = g ?? k.seed ?? 0, R = y ?? k.motif, z = b ?? k.moon, V = x ?? k.sky, G = h(null), K = m(() => a(G, n), [n]), q = o(G, P), J = E(ee()), { preset: Y, iconsScene: te } = B(T(A, M, t() ? void 0 : H), {
199
- icons: S ?? k.icons,
200
- iconStyle: C ?? k.iconStyle,
201
- iconMotif: w ?? k.iconMotif,
202
- seed: L,
203
- animated: P
204
- }), X = F || Y === "grain", Z = R?.shapes ? [...new Set(R.shapes)].sort().join(",") : void 0, Q = JSON.stringify(c(R)), $ = JSON.stringify(u(z)), ne = m(() => U(Y, J, L, Z, Q, $), [
205
- Y,
206
- J,
207
- L,
208
- Z,
209
- Q,
210
- $
211
- ]), re = m(() => X ? W(J, L) : null, [
212
- X,
213
- J,
214
- L
215
- ]);
216
- return /* @__PURE__ */ v("div", {
217
- "data-slot": "background",
218
- ...O,
219
- ref: K,
220
- "data-background": Y === "grain" ? "gradient" : Y,
221
- "data-preset": Y,
222
- "data-tone": j,
223
- "data-intensity": N,
224
- "data-fill": D === "container" ? D : void 0,
225
- "data-animated": P ? "" : void 0,
226
- "data-grain": X ? "" : void 0,
227
- "data-sky": V,
228
- "data-paused": P && q ? "" : void 0,
229
- children: [/* @__PURE__ */ _(I, {
230
- preset: Y,
231
- scene: ne,
232
- grain: re,
233
- sky: V,
234
- idPrefix: J,
235
- seed: L,
236
- shapesKey: Z,
237
- scalarsKey: Q,
238
- moonKey: $,
239
- icons: te
240
- }), /* @__PURE__ */ _("div", {
241
- "data-slot": "background-content",
242
- children: e
243
- })]
244
- });
245
- }
246
- //#endregion
247
- export { V as n, M as r, G as t };
@@ -1,98 +0,0 @@
1
- import { t as e } from "./utils-Bcd2Z3ea.js";
2
- import { t } from "./use-material-translation-DkxcLbLM.js";
3
- import { i as n } from "./escape-owner-CripBce_.js";
4
- import { a as r, i, l as a, n as o, r as s, s as c } from "./state-scenes-Be9w_3an.js";
5
- import { AlertCircle as l, Construction as u, FileQuestion as d, PackageOpen as f, Search as p, ShieldAlert as m, WifiOff as h } from "lucide-react";
6
- import { Suspense as g, lazy as _ } from "react";
7
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
8
- import { STATE_ACCENT as b, STATE_ICON as x, stateCopy as S } from "@nxgt/material-core/states";
9
- //#region lib/components/ui/feedback/state-frame/state-icon.tsx
10
- var C = {
11
- "package-open": f,
12
- search: p,
13
- "file-question": d,
14
- "shield-alert": m,
15
- "alert-circle": l,
16
- "wifi-off": h,
17
- construction: u
18
- };
19
- function w({ kind: e }) {
20
- let t = C[x[e]];
21
- return /* @__PURE__ */ v(t, { "aria-hidden": "true" });
22
- }
23
- //#endregion
24
- //#region lib/components/ui/feedback/state-frame/state-scene-illustration.tsx
25
- var T = _(async () => ({ default: (await import("./illustration-DfPJtkFY.js").then((e) => e.n)).Illustration }));
26
- function E({ scene: e, size: t }) {
27
- return /* @__PURE__ */ v(g, {
28
- fallback: /* @__PURE__ */ v("div", {
29
- "data-slot": "illustration",
30
- "data-size": t,
31
- "aria-hidden": "true"
32
- }),
33
- children: /* @__PURE__ */ v(T, {
34
- scene: e,
35
- size: t
36
- })
37
- });
38
- }
39
- //#endregion
40
- //#region lib/components/ui/feedback/state-frame/state-frame.tsx
41
- function D({ kind: t, size: l = "default", illustration: u, icon: d, title: f, headingLevel: p, description: m, actions: h, className: g, children: _, ...x }) {
42
- let S = l === "inline", C = l === "compact" || S, T = e("flex shrink-0 items-center justify-center rounded", r[b[t]], S ? "size-8 rounded-full [&_svg]:size-4" : C ? "size-10 [&_svg]:size-5" : "size-16 [&_svg]:size-7"), D = a(), O = u === !0 || s(u, D?.sets) ? s(u, D?.sets) ? u : o[t] : null, k = u == null && d == null && l === "default" ? c(D, o[t]) : void 0, A = S ? null : O ?? (k ? o[t] : null), j = null;
43
- return j = u === !1 ? null : A ? /* @__PURE__ */ v(E, {
44
- scene: A,
45
- size: C ? "sm" : "md"
46
- }) : u != null && u !== !0 && !s(u, D?.sets) ? u : d == null ? C ? /* @__PURE__ */ v("div", {
47
- className: T,
48
- children: /* @__PURE__ */ v(w, { kind: t })
49
- }) : /* @__PURE__ */ v(i, { kind: t }) : /* @__PURE__ */ v("div", {
50
- className: T,
51
- children: d
52
- }), /* @__PURE__ */ y("div", {
53
- "data-kind": t,
54
- "data-size": l,
55
- className: e("flex text-foreground", S ? "flex-row items-center gap-3 px-3 py-2.5 text-start" : "flex-col items-center justify-center text-center", !S && (C ? "gap-3 px-4 py-6" : "min-h-[22rem] gap-5 p-8"), g),
56
- ...x,
57
- children: [
58
- j,
59
- (f != null || m != null) && /* @__PURE__ */ y("div", {
60
- className: e("flex flex-col", S ? "min-w-0 flex-1 gap-0.5" : "max-w-sm gap-2"),
61
- children: [f != null && /* @__PURE__ */ v(n, {
62
- as: p ? `h${p}` : void 0,
63
- variant: S ? "normal" : C ? "title-medium" : "headline-small",
64
- className: e("tracking-tight text-balance", S && "font-medium"),
65
- children: f
66
- }), m != null && /* @__PURE__ */ v(n, {
67
- variant: S ? "body-small" : "body-medium",
68
- className: "text-pretty",
69
- children: m
70
- })]
71
- }),
72
- _,
73
- h != null && /* @__PURE__ */ v("div", {
74
- className: e("flex flex-wrap items-center gap-2", S ? "shrink-0" : "mt-1 justify-center"),
75
- children: h
76
- })
77
- ]
78
- });
79
- }
80
- //#endregion
81
- //#region lib/components/ui/feedback/empty-state/empty-state.tsx
82
- function O({ kind: e = "empty", size: n = "default", illustration: r, icon: i, title: a, description: o, action: s, ...c }) {
83
- let l = S(e, "empty-state"), { t: u } = t(), d = o ?? (a == null ? u(l.descriptionKey, l.description) : void 0);
84
- return /* @__PURE__ */ v(D, {
85
- "data-slot": "empty-state",
86
- "data-variant": e,
87
- kind: e,
88
- size: n,
89
- illustration: r,
90
- icon: i,
91
- title: a ?? u(l.titleKey, l.title),
92
- description: d,
93
- actions: s,
94
- ...c
95
- });
96
- }
97
- //#endregion
98
- export { D as n, O as t };
@@ -1,24 +0,0 @@
1
- import { t as e } from "./scene-svg-DJKa5vsg.js";
2
- import { useMemo as t } from "react";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { buildIconScene as r } from "@nxgt/material-core/backgrounds/icons";
5
- //#region lib/backgrounds/background/partials/icons-scene.tsx
6
- function i({ seed: i, iconsKey: a, styleKey: o, motifKey: s, spriteBase: c, animated: l }) {
7
- return /* @__PURE__ */ n(e, { node: t(() => r({
8
- seed: i,
9
- icons: JSON.parse(a) ?? void 0,
10
- iconStyle: JSON.parse(o) ?? void 0,
11
- iconMotif: JSON.parse(s),
12
- spriteBase: c,
13
- animated: l
14
- }), [
15
- i,
16
- a,
17
- o,
18
- s,
19
- c,
20
- l
21
- ]) });
22
- }
23
- //#endregion
24
- export { i as default };