@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
@@ -0,0 +1,29 @@
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 { buildIllustration as i } from "@nxgt/material-core/illustrations";
6
+ import { platePath as a } from "@nxgt/material-core/illustrations/plates";
7
+ //#region lib/illustrations/plated-illustration.tsx
8
+ function o({ spec: o, idPrefix: s, base: c, edition: l }) {
9
+ let u = t(() => i(o, {
10
+ idPrefix: s,
11
+ spriteBase: c,
12
+ plates: a,
13
+ ...l === "free" ? { mapIcon: r } : {}
14
+ }), [
15
+ o,
16
+ s,
17
+ c,
18
+ l
19
+ ]);
20
+ return /* @__PURE__ */ n(e, { node: t(() => ({
21
+ ...u,
22
+ attrs: {
23
+ ...u.attrs,
24
+ "data-plated": ""
25
+ }
26
+ }), [u]) });
27
+ }
28
+ //#endregion
29
+ export { o as default };
@@ -16,7 +16,7 @@ import { t as be } from "./useEvent-2fKq-6w8.js";
16
16
  import { n as xe, t as Se } from "./toggle-group-j8zaxEg1.js";
17
17
  import { n as Ce } from "./use-slice-reducer-BGkeGtML.js";
18
18
  import { r as we } from "./use-csp-nonce-ZKs9k-ov.js";
19
- import { n as Te, t as Ee } from "./empty-state-COAV2d-R.js";
19
+ import { n as Te, t as Ee } from "./empty-state-SeAg2TOX.js";
20
20
  import { t as De } from "./client-only.utils-3nHNzCki.js";
21
21
  import { t as Oe } from "./use-scroll-away-PQRFZkT2.js";
22
22
  import { ArrowLeft as ke, BookOpenText as Ae, ChevronDown as je, ChevronLeft as Me, ChevronRight as Ne, ChevronUp as Pe, Download as Fe, Eraser as Ie, FileText as Le, FileWarning as Re, FileX2 as ze, Highlighter as Be, KeyRound as Ve, LayoutGrid as He, List as Ue, Loader2 as We, Maximize as Ge, MessageSquareText as Ke, Minimize as qe, MoreVertical as Je, MousePointer2 as Ye, MoveHorizontal as Xe, PanelLeft as Ze, Pen as Qe, PencilLine as $e, Printer as et, RotateCw as tt, Search as nt, StickyNote as rt, Type as it, Underline as at, Undo2 as ot, Volume2 as st, X as ct, XIcon as lt, ZoomIn as ut, ZoomOut as dt } from "lucide-react";
@@ -1,93 +1,106 @@
1
1
  import { t as e } from "./utils-Bcd2Z3ea.js";
2
- import { createContext as t, createElement as n, useContext as r, useMemo as i } from "react";
3
- import { jsx as a } from "react/jsx-runtime";
4
- import { STATE_ACCENT as o, STATE_ILLUSTRATIONS as s } from "@nxgt/material-core/states";
2
+ import { t } from "./is-production-GLw59WU8.js";
3
+ import { createContext as n, createElement as r, lazy as i, useContext as a, useMemo as o } from "react";
4
+ import { jsx as s } from "react/jsx-runtime";
5
+ import { STATE_ACCENT as c, STATE_ILLUSTRATIONS as l } from "@nxgt/material-core/states";
5
6
  //#region lib/components/ui/feedback/state-frame/illustration-defaults.tsx
6
- var c = t(null);
7
- function l({ icons: e, iconStyle: t, sets: n, children: r }) {
8
- let o = h(n);
9
- return /* @__PURE__ */ a(c, {
10
- value: i(() => ({
7
+ var u = n(null);
8
+ function d({ icons: e, iconStyle: t, sets: n, children: r }) {
9
+ let i = _(n);
10
+ return /* @__PURE__ */ s(u, {
11
+ value: o(() => ({
11
12
  icons: e,
12
13
  iconStyle: t,
13
- sets: o
14
+ sets: i
14
15
  }), [
15
16
  e,
16
17
  t,
17
- o
18
+ i
18
19
  ]),
19
20
  children: r
20
21
  });
21
22
  }
22
- function u() {
23
- return r(c);
23
+ function f() {
24
+ return a(u);
24
25
  }
25
- function d(e, t) {
26
+ function p(e, t) {
26
27
  let n = e?.icons;
27
28
  return n === "suggested" ? {} : n?.[t];
28
29
  }
29
- var f = /* @__PURE__ */ new WeakMap(), p = 0, m = (e) => {
30
- let t = f.get(e);
31
- return t === void 0 ? (p += 1, f.set(e, p), p) : t;
30
+ var m = /* @__PURE__ */ new WeakMap(), h = 0, g = (e) => {
31
+ let t = m.get(e);
32
+ return t === void 0 ? (h += 1, m.set(e, h), h) : t;
32
33
  };
33
- function h(e) {
34
- let t = e?.map(m).join();
35
- return i(() => e, [t]);
34
+ function _(e) {
35
+ let t = e?.map(g).join();
36
+ return o(() => e, [t]);
36
37
  }
37
- function g(e, t) {
38
+ function v(e, t) {
38
39
  return e?.sets?.find((e) => Object.keys(e).includes(t));
39
40
  }
40
41
  //#endregion
41
42
  //#region lib/components/ui/feedback/state-frame/state-tones.ts
42
- var _ = "[stroke-linecap:round] [stroke-linejoin:round]", v = {
43
+ var y = "[stroke-linecap:round] [stroke-linejoin:round]", b = {
43
44
  primary: "fill-primary",
44
45
  error: "fill-error",
45
46
  warning: "fill-warning",
46
47
  info: "fill-info",
47
48
  neutral: "fill-muted-foreground"
48
- }, y = {
49
+ }, x = {
49
50
  primary: "fill-primary/15",
50
51
  error: "fill-error/15",
51
52
  warning: "fill-warning/15",
52
53
  info: "fill-info/15",
53
54
  neutral: "fill-muted-foreground/15"
54
- }, b = {
55
+ }, S = {
55
56
  primary: "bg-primary/10 text-primary-text",
56
57
  error: "bg-error/10 text-error",
57
58
  warning: "bg-warning/10 text-warning",
58
59
  info: "bg-info/10 text-info",
59
60
  neutral: "border border-border bg-background text-foreground"
60
61
  };
61
- function x(e, t) {
62
+ function C(e, t) {
62
63
  switch (e) {
63
64
  case "surface": return "fill-muted stroke-none";
64
- case "outline": return `fill-none stroke-muted-foreground/60 stroke-2 ${_}`;
65
- case "accent": return `${v[t]} stroke-none`;
66
- case "accent-soft": return `${y[t]} stroke-none`;
65
+ case "outline": return `fill-none stroke-muted-foreground/60 stroke-2 ${y}`;
66
+ case "accent": return `${b[t]} stroke-none`;
67
+ case "accent-soft": return `${x[t]} stroke-none`;
67
68
  case "muted": return "fill-muted-foreground/15 stroke-none";
68
69
  }
69
70
  }
70
71
  //#endregion
71
72
  //#region lib/components/ui/feedback/state-frame/state-illustration.tsx
72
- function S({ kind: t, className: r, ...i }) {
73
- let { viewBox: c, shapes: l } = s[t], u = o[t];
74
- return /* @__PURE__ */ a("svg", {
73
+ function w({ kind: t, className: n, ...i }) {
74
+ let { viewBox: a, shapes: o } = l[t], u = c[t];
75
+ return /* @__PURE__ */ s("svg", {
75
76
  "data-slot": "state-illustration",
76
- viewBox: c,
77
+ viewBox: a,
77
78
  "aria-hidden": "true",
78
79
  focusable: "false",
79
- className: e("h-auto w-40 shrink-0", r),
80
+ className: e("h-auto w-40 shrink-0", n),
80
81
  ...i,
81
- children: l.map((e, t) => n(e.el, {
82
+ children: o.map((e, t) => r(e.el, {
82
83
  key: t,
83
- className: x(e.tone, u),
84
+ className: C(e.tone, u),
84
85
  ...e.attrs
85
86
  }))
86
87
  });
87
88
  }
88
89
  //#endregion
90
+ //#region lib/illustrations/lazy-chunk.ts
91
+ var T = /* @__PURE__ */ new Set();
92
+ function E(e, n, r) {
93
+ return i(async () => {
94
+ try {
95
+ return { default: await n() };
96
+ } catch (n) {
97
+ return !t() && !T.has(e) && (T.add(e), console.warn(`Illustration: the "${e}" chunk failed to load (${n instanceof Error ? n.message : String(n)}). Drawing the built-in art instead.`)), { default: r };
98
+ }
99
+ });
100
+ }
101
+ //#endregion
89
102
  //#region lib/components/ui/feedback/state-frame/state-scenes.ts
90
- var C = [
103
+ var D = [
91
104
  "empty",
92
105
  "no-results",
93
106
  "not-found",
@@ -100,7 +113,7 @@ var C = [
100
113
  "invitation",
101
114
  "sign-in",
102
115
  "empty-inbox"
103
- ], w = {
116
+ ], O = {
104
117
  empty: "empty",
105
118
  search: "no-results",
106
119
  "not-found": "not-found",
@@ -109,10 +122,10 @@ var C = [
109
122
  offline: "offline",
110
123
  maintenance: "maintenance"
111
124
  };
112
- function T(e, t) {
113
- return typeof e == "string" && (C.includes(e) || !!t?.some((t) => Object.keys(t).includes(e)));
125
+ function k(e, t) {
126
+ return typeof e == "string" && (D.includes(e) || !!t?.some((t) => Object.keys(t).includes(e)));
114
127
  }
115
- var E = {
128
+ var A = {
116
129
  empty: "empty",
117
130
  "no-results": "search",
118
131
  "not-found": "not-found",
@@ -127,4 +140,4 @@ var E = {
127
140
  "empty-inbox": "empty"
128
141
  };
129
142
  //#endregion
130
- export { b as a, g as c, S as i, u as l, w as n, l as o, T as r, d as s, E as t };
143
+ export { w as a, p as c, E as i, v as l, O as n, S as o, k as r, d as s, A as t, f as u };
@@ -1,95 +1,96 @@
1
1
  import { t as e } from "./utils-Bcd2Z3ea.js";
2
2
  import { a as t, i as n, n as r, o as i, r as a, t as o } from "./bubble-input-B7BVd9fX.js";
3
3
  import { t as s } from "./use-material-translation-DkxcLbLM.js";
4
- import { n as c } from "./icon-sprites-CZ3vcD7P.js";
5
- import { t as l } from "./use-theme-DMcyJ52N.js";
6
- import { a as u, r as d } from "./theme-context-Cofk6vgs.js";
7
- import { t as f } from "./theme-toggle-oU-fh6WE.js";
8
- import { n as p, t as m } from "./nxgt-theme-ZS945iMP.js";
9
- import { Check as h } from "lucide-react";
10
- import { useContext as g } from "react";
11
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
12
- import { ICON_PACKS as y, IconRefError as b, resolveIconStyles as x, resolveIcons as S, spriteHref as C } from "@nxgt/material-core/icons";
13
- import { THEME_PRESETS as w } from "@nxgt/material-core/theme/presets";
4
+ import { n as c, r as l } from "./icon-sprites-FxHyqyhg.js";
5
+ import { t as u } from "./use-theme-DMcyJ52N.js";
6
+ import { a as d, r as f } from "./theme-context-Cofk6vgs.js";
7
+ import { t as p } from "./theme-toggle-oU-fh6WE.js";
8
+ import { n as m, t as h } from "./nxgt-theme-ZS945iMP.js";
9
+ import { Check as g } from "lucide-react";
10
+ import { useContext as _ } from "react";
11
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
12
+ import { ICON_PACKS as b, IconRefError as x, resolveIconStyles as S, resolveIcons as C, spriteHref as w } from "@nxgt/material-core/icons";
13
+ import { freeIcon as T } from "@nxgt/material-core/icons/free";
14
+ import { THEME_PRESETS as E } from "@nxgt/material-core/theme/presets";
14
15
  //#region lib/theme-picker/partials/mode-control.tsx
15
- function T() {
16
+ function D() {
16
17
  let { t: e } = s();
17
- return /* @__PURE__ */ v("fieldset", {
18
+ return /* @__PURE__ */ y("fieldset", {
18
19
  "data-slot": "theme-picker-mode",
19
20
  className: "m-0 flex min-w-0 items-center justify-between gap-3 border-0 p-0",
20
21
  children: [
21
- /* @__PURE__ */ _("legend", {
22
+ /* @__PURE__ */ v("legend", {
22
23
  className: "sr-only",
23
24
  children: e("material.theme-picker.mode", "Mode")
24
25
  }),
25
- /* @__PURE__ */ _("span", {
26
+ /* @__PURE__ */ v("span", {
26
27
  "aria-hidden": !0,
27
28
  className: "text-sm font-medium text-muted-foreground",
28
29
  children: e("material.theme-picker.mode", "Mode")
29
30
  }),
30
- /* @__PURE__ */ _(f, {})
31
+ /* @__PURE__ */ v(p, {})
31
32
  ]
32
33
  });
33
34
  }
34
35
  //#endregion
35
36
  //#region lib/theme-picker/partials/tile-icons.ts
36
- var E = 4;
37
- function D(e, t) {
37
+ var O = 4;
38
+ function k(e, t, n = "pro") {
38
39
  try {
39
- let n = x(e.iconStyle), r = e.icons ?? "school";
40
- return S(r), (typeof r == "string" ? y[r] : r).slice(0, E).map((e, r) => {
41
- let [i] = S([e], n[r % n.length]);
42
- return C(i, t);
40
+ let r = S(e.iconStyle), i = e.icons ?? "school";
41
+ return C(i), (typeof i == "string" ? b[i] : i).slice(0, O).map((e, i) => {
42
+ let [a] = C([e], r[i % r.length]), o = a;
43
+ return w(n === "free" ? T(o) : o, t);
43
44
  });
44
45
  } catch (e) {
45
- if (e instanceof b) return [];
46
+ if (e instanceof x) return [];
46
47
  throw e;
47
48
  }
48
49
  }
49
50
  //#endregion
50
51
  //#region lib/theme-picker/partials/mini-background.tsx
51
- function O({ background: e }) {
52
- let t = e ? e.preset : "none", n = c(), r = e && t === "icons" ? D(e, n) : [];
53
- return /* @__PURE__ */ _("span", {
52
+ function A({ background: e }) {
53
+ let t = e ? e.preset : "none", n = l(), r = c(), i = e && t === "icons" ? k(e, n, r) : [];
54
+ return /* @__PURE__ */ v("span", {
54
55
  "aria-hidden": !0,
55
56
  "data-slot": "theme-tile-background",
56
57
  "data-preset": t,
57
58
  "data-tone": e ? e.tone ?? "primary" : "none",
58
59
  "data-intensity": e ? e.intensity ?? "default" : "none",
59
- children: r.map((e, t) => /* @__PURE__ */ _("svg", {
60
+ children: i.map((e, t) => /* @__PURE__ */ v("svg", {
60
61
  "aria-hidden": "true",
61
62
  "data-slot": "theme-tile-icon",
62
63
  "data-n": t + 1,
63
- children: /* @__PURE__ */ _("use", { href: e })
64
+ children: /* @__PURE__ */ v("use", { href: e })
64
65
  }, `${t}-${e}`))
65
66
  });
66
67
  }
67
68
  //#endregion
68
69
  //#region lib/theme-picker/partials/theme-tile.tsx
69
- function k({ theme: e, label: r, showBackground: s, background: c }) {
70
- let l = /* @__PURE__ */ _(m, {
70
+ function j({ theme: e, label: r, showBackground: s, background: c }) {
71
+ let l = /* @__PURE__ */ v(h, {
71
72
  theme: e,
72
73
  asChild: !0,
73
- children: /* @__PURE__ */ v(i, {
74
+ children: /* @__PURE__ */ y(i, {
74
75
  "data-slot": "theme-tile",
75
76
  children: [
76
- s && /* @__PURE__ */ _(O, { background: c }),
77
- /* @__PURE__ */ v("span", {
77
+ s && /* @__PURE__ */ v(A, { background: c }),
78
+ /* @__PURE__ */ y("span", {
78
79
  "data-slot": "theme-tile-swatches",
79
80
  "aria-hidden": !0,
80
81
  children: [
81
- /* @__PURE__ */ _("i", { "data-swatch": "primary" }),
82
- /* @__PURE__ */ _("i", { "data-swatch": "secondary" }),
83
- /* @__PURE__ */ _("i", { "data-swatch": "tertiary" })
82
+ /* @__PURE__ */ v("i", { "data-swatch": "primary" }),
83
+ /* @__PURE__ */ v("i", { "data-swatch": "secondary" }),
84
+ /* @__PURE__ */ v("i", { "data-swatch": "tertiary" })
84
85
  ]
85
86
  }),
86
- /* @__PURE__ */ _("span", {
87
+ /* @__PURE__ */ v("span", {
87
88
  "data-slot": "theme-tile-label",
88
89
  children: r
89
90
  }),
90
- /* @__PURE__ */ _(a, {
91
+ /* @__PURE__ */ v(a, {
91
92
  asChild: !0,
92
- children: /* @__PURE__ */ _(h, {
93
+ children: /* @__PURE__ */ v(g, {
93
94
  "aria-hidden": !0,
94
95
  "data-slot": "theme-tile-check"
95
96
  })
@@ -97,14 +98,14 @@ function k({ theme: e, label: r, showBackground: s, background: c }) {
97
98
  ]
98
99
  })
99
100
  });
100
- return /* @__PURE__ */ _(t, {
101
+ return /* @__PURE__ */ v(t, {
101
102
  value: e.name,
102
- ...o(l, /* @__PURE__ */ _(n, {}))
103
+ ...o(l, /* @__PURE__ */ v(n, {}))
103
104
  });
104
105
  }
105
106
  //#endregion
106
107
  //#region lib/theme-picker/theme-label.ts
107
- function A(e, t) {
108
+ function M(e, t) {
108
109
  let { label: n, name: r } = e;
109
110
  if (typeof n == "string") return n;
110
111
  if (n) {
@@ -115,28 +116,28 @@ function A(e, t) {
115
116
  }
116
117
  //#endregion
117
118
  //#region lib/theme-picker/theme-picker.tsx
118
- function j({ themes: t, value: n, onValueChange: i, showMode: a = !0, showBackground: o = !0, layout: c = "grid", className: f, ...m }) {
119
- let { t: h, language: y } = s(), b = g(d), { themeName: x, setThemeName: S } = l(), C = u()?.name ?? x, E = t ?? b ?? w;
120
- return /* @__PURE__ */ v("div", {
119
+ function N({ themes: t, value: n, onValueChange: i, showMode: a = !0, showBackground: o = !0, layout: c = "grid", className: l, ...p }) {
120
+ let { t: h, language: g } = s(), b = _(f), { themeName: x, setThemeName: S } = u(), C = d()?.name ?? x, w = t ?? b ?? E;
121
+ return /* @__PURE__ */ y("div", {
121
122
  "data-slot": "theme-picker",
122
123
  "data-layout": c,
123
- className: e("flex flex-col gap-4", f),
124
- ...m,
125
- children: [/* @__PURE__ */ _(r, {
124
+ className: e("flex flex-col gap-4", l),
125
+ ...p,
126
+ children: [/* @__PURE__ */ v(r, {
126
127
  "data-slot": "theme-picker-group",
127
128
  "aria-label": h("material.theme-picker.label", "Theme"),
128
129
  value: n ?? C,
129
130
  onValueChange: (e) => {
130
131
  n === void 0 && S(e), i?.(e);
131
132
  },
132
- children: E.map((e) => /* @__PURE__ */ _(k, {
133
+ children: w.map((e) => /* @__PURE__ */ v(j, {
133
134
  theme: e,
134
- label: A(e, y),
135
+ label: M(e, g),
135
136
  showBackground: o,
136
- background: p(e.name, e).background
137
+ background: m(e.name, e).background
137
138
  }, e.name))
138
- }), a && /* @__PURE__ */ _(T, {})]
139
+ }), a && /* @__PURE__ */ v(D, {})]
139
140
  });
140
141
  }
141
142
  //#endregion
142
- export { j as ThemePicker };
143
+ export { N as ThemePicker };