@nxgt/material 3.9.0 → 3.10.1

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 (39) 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-DiaPdu-E.js → components-fqz7csN3.js} +11627 -11582
  6. package/dist/components.js +16 -16
  7. package/dist/editor.js +1 -1
  8. package/dist/{empty-state-COAV2d-R.js → empty-state-BOZWBC5q.js} +1 -1
  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-Hj-Q9se9.js +91 -0
  12. package/dist/illustrations.js +1 -1
  13. package/dist/lib/backgrounds/background/partials/icons-scene.d.ts +3 -1
  14. package/dist/lib/components/ui/fields/country-field/country-field.d.ts +8 -3
  15. package/dist/lib/components/ui/fields/country-field/country-options.d.ts +6 -3
  16. package/dist/lib/components/ui/fields/country-field/iso-countries.d.ts +17 -0
  17. package/dist/lib/components/ui/fields/postal-address/utils.d.ts +1 -1
  18. package/dist/lib/components/ui/primitives/icon/icon-sprites.d.ts +13 -1
  19. package/dist/lib/illustrations/plated-illustration.d.ts +3 -1
  20. package/dist/lib/illustrations/use-illustration.d.ts +1 -0
  21. package/dist/lib/theme-picker/partials/tile-icons.d.ts +2 -1
  22. package/dist/main.js +28 -28
  23. package/dist/pdf-reader.js +1 -1
  24. package/dist/plated-illustration-B7fcgOED.js +22 -0
  25. package/dist/{public-DGvtAz7M.js → public-Cl4dLDHQ.js} +1 -1
  26. package/dist/theme-picker.js +53 -52
  27. package/dist/{use-chat-composer-CkEPJo5I.js → use-chat-composer-UHlGFSm0.js} +4240 -4235
  28. package/docs/components/form-fields.md +10 -4
  29. package/docs/components/overlays-and-menus.md +4 -1
  30. package/docs/components/primitives.md +14 -0
  31. package/docs/guides/backgrounds.md +1 -1
  32. package/docs/guides/icon-motifs.md +36 -8
  33. package/docs/guides/illustrations.md +1 -1
  34. package/docs/troubleshooting.md +14 -2
  35. package/package.json +2 -2
  36. package/dist/background-CAWV_qSk.js +0 -247
  37. package/dist/icons-scene-bA7I4wdP.js +0 -24
  38. package/dist/illustration-DfPJtkFY.js +0 -86
  39. package/dist/plated-illustration-C3z0hP9U.js +0 -19
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @nxgt/material
2
2
 
3
+ ## 3.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1440](https://github.com/softistx/nxgt-material/pull/1440) [`90f764c`](https://github.com/softistx/nxgt-material/commit/90f764c1d593d4a888561e13f68b41154957577f) Thanks [@SteveGT96](https://github.com/SteveGT96)! - The open list of `Combobox`, `ComboboxField` and `ComboboxFormField` takes pointer clicks inside a modal `Dialog`, `Sheet` or `Drawer` again. Fixes [#1438](https://github.com/softistx/nxgt-material/issues/1438): a modal layer's Radix sets `pointer-events: none` on the body, the list is portaled to it and inherited that, so the hit test landed on `<html>` and an option could not be picked with the mouse or a touch (keyboard worked). The list now sets `pointer-events: auto` on its popup.
8
+
9
+ - [#1443](https://github.com/softistx/nxgt-material/pull/1443) [`b4fe86e`](https://github.com/softistx/nxgt-material/commit/b4fe86e1f971d6be474b2638d582896e0fd1304d) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `IconSpritesProvider` takes `edition: 'pro' | 'free'` (default `'pro'`, nothing changes). Fixes [#1437](https://github.com/softistx/nxgt-material/issues/1437): an app that serves Font Awesome Free (`solid.svg`, `regular.svg` and `brands.svg` only) set `edition="free"` and the library's own duotone icons (the app shell menu, `AccountMenu`, `LanguageSwitcher`, `LoadMoreButton`, the data table's pagination…) no longer draw blank. Below a free provider every `Icon`, `Illustration`, icon `Background` and `ThemePicker` tile draws any style Free lacks (duotone, light, thin, `sharp-*`…) from `solid.svg` (`regular` and `brands` stay), and renames the Pro-only names the library asks for (`chevrons-left`, `sparkles`, `backpack`, `wifi-slash`…) to their Free twin. The workaround of serving `solid.svg` as `duotone.svg` is no longer needed; `useIconEdition()` reads the edition. Core: a new `@nxgt/material-core/icons/free` entry (`freeIcon`, `FREE_ICON_ALIASES`, the type `IconEdition`) and a `mapIcon` option on `buildIllustration` and `buildIconScene`.
10
+ - Updated dependencies [[`b4fe86e`](https://github.com/softistx/nxgt-material/commit/b4fe86e1f971d6be474b2638d582896e0fd1304d)]:
11
+ - @nxgt/material-core@0.29.1
12
+
13
+ ## 3.10.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#1434](https://github.com/softistx/nxgt-material/pull/1434) [`32a544f`](https://github.com/softistx/nxgt-material/commit/32a544f7738b7ab6425ac7027a62234b60a868ce) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `CountryField`, `CountryFormField` and `countryOptions` offer every officially assigned ISO 3166-1 alpha-2 country (249) by default, not only the phone list. Fixes [#1431](https://github.com/softistx/nxgt-material/issues/1431): `CM` or `MQ` can now be picked. Names come from `Intl.DisplayNames` in the language of `I18nProvider` ("Cameroun", "Martinique" in French), falling back to the code where it is unavailable, and the list is sorted by that name with `Intl.Collator`. The `countries` prop now also takes plain ISO codes (`countries={['CM', 'FR']}`); `PhoneCountry[]` still works and keeps its own `name`. `countryOptions(countries?, language?)` takes the same codes and an optional language. `PhoneField` and `PHONE_COUNTRIES` are unchanged. Behaviour change: a `CountryField` with no `countries` now lists 249 countries instead of 24, sorted by name instead of in the phone list's order.
18
+
3
19
  ## 3.9.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -163,7 +163,24 @@ import { Icon, IconSpritesProvider } from '@nxgt/material/components';
163
163
  // → /static/icons/solid.svg#atom
164
164
  ```
165
165
 
166
- `useSpriteBase()` reads the base. `family="duotone"` with `type="solid"` now
166
+ Serving **Font Awesome Free** (only `solid.svg`, `regular.svg` and `brands.svg`)?
167
+ Say so once and nothing else changes in your code:
168
+
169
+ ```tsx
170
+ <IconSpritesProvider base="/static/icons/" edition="free">
171
+ <AppShell menu={[{ label: 'Home', icon: 'house', url: '/' }]} />
172
+ </IconSpritesProvider>
173
+ // the menu's duotone icon → /static/icons/solid.svg#house
174
+ ```
175
+
176
+ With `edition="free"` every `Icon`, illustration and icon background below it
177
+ draws a style Free lacks (duotone, light, thin, `sharp-*`…) from `solid.svg`
178
+ (`regular` and `brands` stay), and the Pro-only names the library asks for
179
+ (`chevrons-left`, `sparkles`, `backpack`…) as their Free twin. The default
180
+ `edition="pro"` changes nothing. A nested provider without an `edition` keeps its parent's. The old workaround, serving `solid.svg` under
181
+ the name `duotone.svg`, is no longer needed.
182
+
183
+ `useSpriteBase()` reads the base, `useIconEdition()` the edition. `family="duotone"` with `type="solid"` now
167
184
  reads `duotone.svg`, the file that exists (it used to ask for the missing
168
185
  `duotone-solid.svg`). The reference helpers (`spriteHref`, `resolveIcons`) are in
169
186
  [`@nxgt/material-core/icons`](https://cdn.jsdelivr.net/npm/@nxgt/material-core@0/docs/icons.md).
@@ -0,0 +1,249 @@
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
+ });
150
+ function B(e) {
151
+ return JSON.stringify(Object.fromEntries(z.flatMap((t) => e?.[t] === void 0 ? [] : [[t, e[t]]])));
152
+ }
153
+ //#endregion
154
+ //#region lib/backgrounds/background/partials/use-icons-scene.ts
155
+ function V(e, { icons: i, iconStyle: a, iconMotif: o, seed: s, animated: c }) {
156
+ let l = r(), u = n(), d = JSON.stringify(i ?? null), f = JSON.stringify(a ?? null), p = B(o), m = h(() => {
157
+ if (e !== "icons") return null;
158
+ let n = R(JSON.parse(d) ?? void 0, JSON.parse(f) ?? void 0);
159
+ return n && !t() && console.warn(`Background: icons cannot be drawn (${n}); drawing "scatter-icons" instead.`), n;
160
+ }, [
161
+ e,
162
+ d,
163
+ f
164
+ ]) ? "scatter-icons" : e;
165
+ return {
166
+ preset: m,
167
+ iconsScene: h(() => m === "icons" ? {
168
+ seed: s,
169
+ iconsKey: d,
170
+ styleKey: f,
171
+ motifKey: p,
172
+ spriteBase: l,
173
+ edition: u,
174
+ animated: c
175
+ } : void 0, [
176
+ m,
177
+ s,
178
+ d,
179
+ f,
180
+ p,
181
+ l,
182
+ u,
183
+ c
184
+ ])
185
+ };
186
+ }
187
+ //#endregion
188
+ //#region lib/backgrounds/background/background.tsx
189
+ var H = /* @__PURE__ */ e({ Background: () => K }), U = (e) => console.warn(e);
190
+ function W(e, t, n, r, i, a) {
191
+ return e === "grain" ? null : w(e, u(t, n, r, i, a));
192
+ }
193
+ function G(e, t) {
194
+ return w("grain", {
195
+ idPrefix: `${e}-grain`,
196
+ seed: t
197
+ });
198
+ }
199
+ 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 }) {
200
+ 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), {
201
+ icons: S ?? k.icons,
202
+ iconStyle: C ?? k.iconStyle,
203
+ iconMotif: w ?? k.iconMotif,
204
+ seed: I,
205
+ animated: P
206
+ }), 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, $), [
207
+ Y,
208
+ J,
209
+ I,
210
+ Z,
211
+ Q,
212
+ $
213
+ ]), re = h(() => X ? G(J, I) : null, [
214
+ X,
215
+ J,
216
+ I
217
+ ]);
218
+ return /* @__PURE__ */ y("div", {
219
+ "data-slot": "background",
220
+ ...O,
221
+ ref: K,
222
+ "data-background": Y === "grain" ? "gradient" : Y,
223
+ "data-preset": Y,
224
+ "data-tone": j,
225
+ "data-intensity": M,
226
+ "data-fill": T === "container" ? T : void 0,
227
+ "data-animated": P ? "" : void 0,
228
+ "data-grain": X ? "" : void 0,
229
+ "data-sky": B,
230
+ "data-paused": P && q ? "" : void 0,
231
+ children: [/* @__PURE__ */ v(L, {
232
+ preset: Y,
233
+ scene: ne,
234
+ grain: re,
235
+ sky: B,
236
+ idPrefix: J,
237
+ seed: I,
238
+ shapesKey: Z,
239
+ scalarsKey: Q,
240
+ moonKey: $,
241
+ icons: te
242
+ }), /* @__PURE__ */ v("div", {
243
+ "data-slot": "background-content",
244
+ children: e
245
+ })]
246
+ });
247
+ }
248
+ //#endregion
249
+ export { H as n, N as r, K as t };
@@ -1,3 +1,3 @@
1
- import { r as e, t } from "./background-CAWV_qSk.js";
1
+ import { r as e, t } from "./background-cEqcZQ3v.js";
2
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
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 };