@nxgt/material 3.21.0 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +6 -4
  3. package/bin/nxgt-backdrop-sprite.js +15 -0
  4. package/dist/background-BtSZsTvY.js +286 -0
  5. package/dist/backgrounds/css-react/icons-quiet.css +5 -5
  6. package/dist/backgrounds/css-react/icons-tint.css +98 -0
  7. package/dist/backgrounds/css-react/icons.css +100 -33
  8. package/dist/backgrounds.js +1 -1
  9. package/dist/{celestial-scene-DaOsRFF3.js → celestial-scene-8Muu6f7O.js} +1 -1
  10. package/dist/components/background-shared.css +5 -0
  11. package/dist/components/components.css +4 -7
  12. package/dist/components/ui/fields/attributes/attributes.css +3 -0
  13. package/dist/components/ui/layout/app-shell/activity-backdrop-shapes.css +1 -1
  14. package/dist/components/ui/layout/auth-card/auth-card-backdrop.css +30 -0
  15. package/dist/{components-CbD5WNVO.js → components-B0oezhGe.js} +10424 -10394
  16. package/dist/components.js +16 -16
  17. package/dist/editor.js +1 -1
  18. package/dist/{empty-state-CJh9f2pc.js → empty-state-lj7vjYWG.js} +1 -1
  19. package/dist/icon-sprites-CaYXzOL4.js +46 -0
  20. package/dist/icons-scene-M4HBeN2c.js +54 -0
  21. package/dist/{illustration-BmQmvW_4.js → illustration-B4_W-OUS.js} +2 -2
  22. package/dist/illustrations.js +1 -1
  23. package/dist/lib/backgrounds/background/partials/icons-check.d.ts +2 -2
  24. package/dist/lib/backgrounds/background/partials/icons-keys.d.ts +21 -1
  25. package/dist/lib/backgrounds/background/partials/icons-scene.d.ts +15 -6
  26. package/dist/lib/backgrounds/background/partials/use-icons-scene.d.ts +13 -8
  27. package/dist/lib/backgrounds/background/types.d.ts +26 -12
  28. package/dist/lib/backgrounds/index.d.ts +1 -1
  29. package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +7 -2
  30. package/dist/lib/components/ui/layout/app-shell/shapes-clear-content.d.ts +10 -3
  31. package/dist/lib/components/ui/layout/app-shell/theme-backdrop.d.ts +3 -1
  32. package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +3 -3
  33. package/dist/lib/components/ui/layout/app-shell/watch-content.d.ts +28 -8
  34. package/dist/lib/components/ui/layout/auth-card/auth-card-backdrop.d.ts +23 -0
  35. package/dist/lib/components/ui/layout/auth-card/auth-card.d.ts +15 -1
  36. package/dist/lib/components/ui/primitives/icon/icon-sprites.d.ts +40 -1
  37. package/dist/lib/themes/define-theme.d.ts +8 -0
  38. package/dist/lib/themes/index.d.ts +2 -1
  39. package/dist/lib/vite/index.d.ts +1 -1
  40. package/dist/main.js +28 -28
  41. package/dist/material.css +1 -1
  42. package/dist/pdf-reader.js +1 -1
  43. package/dist/{public-DWuBn4t_.js → public-DAF5SCWH.js} +1 -1
  44. package/dist/{scene-options-CCy3V7XS.js → scene-options-2zNF3ZkQ.js} +4 -2
  45. package/dist/theme-picker.js +3 -3
  46. package/dist/themes.js +9 -4
  47. package/dist/{use-chat-composer-BBFuKNqC.js → use-chat-composer-B0ze1cU9.js} +3 -3
  48. package/docs/components/navigation-and-layout.md +22 -0
  49. package/docs/components/primitives.md +21 -0
  50. package/docs/guides/app-shell.md +9 -8
  51. package/docs/guides/backgrounds.md +214 -16
  52. package/docs/guides/icon-motifs.md +30 -12
  53. package/docs/guides/themes.md +25 -4
  54. package/docs/guides/theming.md +7 -0
  55. package/docs/guides/vite-plugin.md +26 -0
  56. package/docs/previews/backgrounds-background-from-theme.webp +0 -0
  57. package/docs/previews/backgrounds-icons.webp +0 -0
  58. package/docs/previews/backgrounds-matrix.webp +0 -0
  59. package/docs/previews/foundations-themes-icon-motifs.webp +0 -0
  60. package/docs/roadmap.md +6 -0
  61. package/docs/troubleshooting.md +46 -3
  62. package/lib/backgrounds/css-react/icons-quiet.css +5 -5
  63. package/lib/backgrounds/css-react/icons-tint.css +98 -0
  64. package/lib/backgrounds/css-react/icons.css +100 -33
  65. package/lib/components/background-shared.css +5 -0
  66. package/lib/components/components.css +4 -7
  67. package/lib/components/ui/fields/attributes/attributes.css +3 -0
  68. package/lib/components/ui/layout/app-shell/activity-backdrop-shapes.css +1 -1
  69. package/lib/components/ui/layout/auth-card/auth-card-backdrop.css +30 -0
  70. package/package.json +8 -3
  71. package/dist/background-Ce7M5V42.js +0 -250
  72. package/dist/icon-sprites-FxHyqyhg.js +0 -30
  73. package/dist/icons-scene-BpIauJ5d.js +0 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "3.21.0",
3
+ "version": "3.22.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -12,7 +12,8 @@
12
12
  },
13
13
  "type": "module",
14
14
  "bin": {
15
- "nxgt-theme": "./bin/nxgt-theme.js"
15
+ "nxgt-theme": "./bin/nxgt-theme.js",
16
+ "nxgt-backdrop-sprite": "./bin/nxgt-backdrop-sprite.js"
16
17
  },
17
18
  "files": [
18
19
  "bin",
@@ -324,6 +325,10 @@
324
325
  "style": "./lib/backgrounds/css-react/icons-quiet.css",
325
326
  "default": "./lib/backgrounds/css-react/icons-quiet.css"
326
327
  },
328
+ "./backgrounds/icons-tint.css": {
329
+ "style": "./lib/backgrounds/css-react/icons-tint.css",
330
+ "default": "./lib/backgrounds/css-react/icons-tint.css"
331
+ },
327
332
  "./backgrounds/illustrated.css": {
328
333
  "style": "./lib/backgrounds/css-react/illustrated.css",
329
334
  "default": "./lib/backgrounds/css-react/illustrated.css"
@@ -357,7 +362,7 @@
357
362
  "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"
358
363
  },
359
364
  "dependencies": {
360
- "@nxgt/material-core": "^0.33.0",
365
+ "@nxgt/material-core": "^0.34.0",
361
366
  "@base-ui/react": "^1.6.0",
362
367
  "@dnd-kit/core": "^6.3.1",
363
368
  "@dnd-kit/sortable": "^10.0.0",
@@ -1,250 +0,0 @@
1
- import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
2
- import { t } from "./is-production-GLw59WU8.js";
3
- import { n, r } from "./icon-sprites-FxHyqyhg.js";
4
- import { a as i, t as a } from "./theme-context-Cofk6vgs.js";
5
- import { t as o } from "./compose-refs-DZ0iIVF-.js";
6
- import { t as s } from "./use-background-activity-KxQgelFF.js";
7
- import { t as c } from "./scene-svg-DJKa5vsg.js";
8
- import { n as l, r as u, t as d } from "./scene-options-CCy3V7XS.js";
9
- import { Suspense as f, lazy as p, memo as m, useId as ee, useMemo as h, useRef as g } from "react";
10
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
11
- import { IconRefError as b, resolveIconStyles as x, resolveIcons as S } from "@nxgt/material-core/icons";
12
- import { SCENE_LAYER as C, buildBackgroundScene as w, presetLayers as T, resolveBackgroundPreset as E, svgIdPrefix as D } from "@nxgt/material-core/backgrounds";
13
- //#region lib/backgrounds/background/available.ts
14
- var O = [
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
- ], k = [
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
- ], A = [
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
- ], j = [
64
- "eclipse",
65
- "meteor-shower",
66
- "ringed-planet",
67
- "northern-lights"
68
- ], M = (e) => j.includes(e), N = [
69
- ...O,
70
- ...k,
71
- ...A,
72
- ...j
73
- ], P = p(() => import("./icons-scene-BpIauJ5d.js"));
74
- function F(e) {
75
- return /* @__PURE__ */ v("div", {
76
- "data-scene": "",
77
- "aria-hidden": "true",
78
- children: /* @__PURE__ */ v(f, {
79
- fallback: null,
80
- children: /* @__PURE__ */ v(P, { ...e })
81
- })
82
- });
83
- }
84
- //#endregion
85
- //#region lib/backgrounds/background/partials/background-layers.tsx
86
- var I = p(() => import("./celestial-scene-DaOsRFF3.js")), L = m(function({ preset: e, scene: t, grain: n, sky: r, icons: i, ...a }) {
87
- return /* @__PURE__ */ y(_, { children: [
88
- T(e).map((n) => n === C ? i ? /* @__PURE__ */ v(F, { ...i }, n) : M(e) ? /* @__PURE__ */ v("div", {
89
- "data-scene": "",
90
- "data-celestial": "",
91
- "aria-hidden": "true",
92
- children: /* @__PURE__ */ v(f, {
93
- fallback: null,
94
- children: /* @__PURE__ */ v(I, {
95
- name: e,
96
- as: "preset",
97
- ...a
98
- })
99
- })
100
- }, n) : t && /* @__PURE__ */ v("div", {
101
- "data-scene": "",
102
- "aria-hidden": "true",
103
- children: /* @__PURE__ */ v(c, { node: t })
104
- }, n) : /* @__PURE__ */ v("div", {
105
- "data-layer": n,
106
- "aria-hidden": "true"
107
- }, n)),
108
- r && /* @__PURE__ */ v("div", {
109
- "data-layer": "sky-scene",
110
- "data-scene": "",
111
- "data-celestial": "",
112
- "aria-hidden": "true",
113
- children: /* @__PURE__ */ v(f, {
114
- fallback: null,
115
- children: /* @__PURE__ */ v(I, {
116
- name: r,
117
- as: "sky",
118
- base: e,
119
- ...a
120
- })
121
- })
122
- }),
123
- n && /* @__PURE__ */ v("div", {
124
- "data-overlay": "grain",
125
- "aria-hidden": "true",
126
- children: /* @__PURE__ */ v(c, { node: n })
127
- })
128
- ] });
129
- });
130
- //#endregion
131
- //#region lib/backgrounds/background/partials/icons-check.ts
132
- function R(e, t) {
133
- try {
134
- return e !== void 0 && S(e), x(t), null;
135
- } catch (e) {
136
- if (e instanceof b) return e.message;
137
- throw e;
138
- }
139
- }
140
- //#endregion
141
- //#region lib/backgrounds/background/partials/icons-keys.ts
142
- var z = Object.keys({
143
- layout: 1,
144
- sizeRange: 1,
145
- rotation: 1,
146
- duotone: 1,
147
- secondaryOpacity: 1,
148
- calm: 1,
149
- quiet: 1
150
- });
151
- function B(e) {
152
- return JSON.stringify(Object.fromEntries(z.flatMap((t) => e?.[t] === void 0 ? [] : [[t, e[t]]])));
153
- }
154
- //#endregion
155
- //#region lib/backgrounds/background/partials/use-icons-scene.ts
156
- function V(e, { icons: i, iconStyle: a, iconMotif: o, seed: s, animated: c }) {
157
- let l = r(), u = n(), d = JSON.stringify(i ?? null), f = JSON.stringify(a ?? null), p = B(o), m = h(() => {
158
- if (e !== "icons") return null;
159
- let n = R(JSON.parse(d) ?? void 0, JSON.parse(f) ?? void 0);
160
- return n && !t() && console.warn(`Background: icons cannot be drawn (${n}); drawing "scatter-icons" instead.`), n;
161
- }, [
162
- e,
163
- d,
164
- f
165
- ]) ? "scatter-icons" : e;
166
- return {
167
- preset: m,
168
- iconsScene: h(() => m === "icons" ? {
169
- seed: s,
170
- iconsKey: d,
171
- styleKey: f,
172
- motifKey: p,
173
- spriteBase: l,
174
- edition: u,
175
- animated: c
176
- } : void 0, [
177
- m,
178
- s,
179
- d,
180
- f,
181
- p,
182
- l,
183
- u,
184
- c
185
- ])
186
- };
187
- }
188
- //#endregion
189
- //#region lib/backgrounds/background/background.tsx
190
- var H = /* @__PURE__ */ e({ Background: () => K }), U = (e) => console.warn(e);
191
- function W(e, t, n, r, i, a) {
192
- return e === "grain" ? null : w(e, u(t, n, r, i, a));
193
- }
194
- function G(e, t) {
195
- return w("grain", {
196
- idPrefix: `${e}-grain`,
197
- seed: t
198
- });
199
- }
200
- function K({ children: e, ref: n, preset: r, tone: c, intensity: u, animated: f, grain: p, seed: m, motif: _, moon: b, sky: x, icons: S, iconStyle: C, iconMotif: w, fill: T = "viewport", ...O }) {
201
- let k = i()?.background || a, A = r ?? k.preset, j = c ?? k.tone ?? a.tone, M = u ?? k.intensity ?? a.intensity, P = f ?? k.animated ?? !1, F = p ?? k.grain ?? !1, I = m ?? k.seed ?? 0, R = _ ?? k.motif, z = b ?? k.moon, B = x ?? k.sky, H = g(null), K = h(() => o(H, n), [n]), q = s(H, P), J = D(ee()), { preset: Y, iconsScene: te } = V(E(A, N, t() ? void 0 : U), {
202
- icons: S ?? k.icons,
203
- iconStyle: C ?? k.iconStyle,
204
- iconMotif: w ?? k.iconMotif,
205
- seed: I,
206
- animated: P
207
- }), X = F || Y === "grain", Z = R?.shapes ? [...new Set(R.shapes)].sort().join(",") : void 0, Q = JSON.stringify(l(R)), $ = JSON.stringify(d(z)), ne = h(() => W(Y, J, I, Z, Q, $), [
208
- Y,
209
- J,
210
- I,
211
- Z,
212
- Q,
213
- $
214
- ]), re = h(() => X ? G(J, I) : null, [
215
- X,
216
- J,
217
- I
218
- ]);
219
- return /* @__PURE__ */ y("div", {
220
- "data-slot": "background",
221
- ...O,
222
- ref: K,
223
- "data-background": Y === "grain" ? "gradient" : Y,
224
- "data-preset": Y,
225
- "data-tone": j,
226
- "data-intensity": M,
227
- "data-fill": T === "container" ? T : void 0,
228
- "data-animated": P ? "" : void 0,
229
- "data-grain": X ? "" : void 0,
230
- "data-sky": B,
231
- "data-paused": P && q ? "" : void 0,
232
- children: [/* @__PURE__ */ v(L, {
233
- preset: Y,
234
- scene: ne,
235
- grain: re,
236
- sky: B,
237
- idPrefix: J,
238
- seed: I,
239
- shapesKey: Z,
240
- scalarsKey: Q,
241
- moonKey: $,
242
- icons: te
243
- }), /* @__PURE__ */ v("div", {
244
- "data-slot": "background-content",
245
- children: e
246
- })]
247
- });
248
- }
249
- //#endregion
250
- export { H as n, N as r, K as t };
@@ -1,30 +0,0 @@
1
- import { createContext as e, useContext as t } from "react";
2
- import { jsx as n } from "react/jsx-runtime";
3
- import { DEFAULT_SPRITE_BASE as r, IconRefError as i, isSafeSpriteBase as a } from "@nxgt/material-core/icons";
4
- //#region lib/components/ui/primitives/icon/icon-sprites.tsx
5
- var o = e(r), s = e("pro");
6
- function c({ base: e, edition: t, children: r }) {
7
- if (!a(e)) throw new i("base", `IconSpritesProvider: ${JSON.stringify(e)} is not root-relative: use a path such as "/assets/icons/sprites/".`);
8
- return /* @__PURE__ */ n(o, {
9
- value: e,
10
- children: /* @__PURE__ */ n(u, {
11
- edition: t,
12
- children: r
13
- })
14
- });
15
- }
16
- function l() {
17
- return t(o);
18
- }
19
- function u({ edition: e, children: r }) {
20
- let i = t(s);
21
- return /* @__PURE__ */ n(s, {
22
- value: e ?? i,
23
- children: r
24
- });
25
- }
26
- function d() {
27
- return t(s);
28
- }
29
- //#endregion
30
- export { d as n, l as r, c as t };
@@ -1,27 +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 { freeIcon as r } from "@nxgt/material-core/icons/free";
5
- import { buildIconScene as i } from "@nxgt/material-core/backgrounds/icons";
6
- //#region lib/backgrounds/background/partials/icons-scene.tsx
7
- function a({ seed: a, iconsKey: o, styleKey: s, motifKey: c, spriteBase: l, edition: u, animated: d }) {
8
- return /* @__PURE__ */ n(e, { node: t(() => i({
9
- seed: a,
10
- icons: JSON.parse(o) ?? void 0,
11
- iconStyle: JSON.parse(s) ?? void 0,
12
- iconMotif: JSON.parse(c),
13
- spriteBase: l,
14
- animated: d,
15
- ...u === "free" ? { mapIcon: r } : {}
16
- }), [
17
- a,
18
- o,
19
- s,
20
- c,
21
- l,
22
- u,
23
- d
24
- ]) });
25
- }
26
- //#endregion
27
- export { a as default };