@nxgt/material 3.60.0 → 3.63.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 (114) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +3 -2
  3. package/dist/alert-dialog-RHm6WtQj.js +189 -0
  4. package/dist/{async-slice-HJY_VJjD.js → async-slice-DmX59NyA.js} +3 -4
  5. package/dist/{button-7BuUCGRm.js → button-DfS_amfQ.js} +1 -1
  6. package/dist/charts.js +3 -3
  7. package/dist/{chip-kQOrHlDX.js → chip-Cbndukko.js} +2 -2
  8. package/dist/{code-editor-Ckc9TTCM.js → code-editor-B0tN8Ha_.js} +11 -11
  9. package/dist/code-editor.js +54 -37
  10. package/dist/{code-language-items-rCPB0Xee.js → code-language-items-andgHKrM.js} +2 -2
  11. package/dist/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
  12. package/dist/{components-BSM-h5IQ.js → components-Cm2doOJS.js} +13090 -12957
  13. package/dist/components.js +28 -26
  14. package/dist/dialog-Bd7Hid2L.js +219 -0
  15. package/dist/dnd.js +1 -1
  16. package/dist/{dropdown-menu-CiobN1wi.js → dropdown-menu-_SyVmSuy.js} +1 -1
  17. package/dist/editor.js +707 -706
  18. package/dist/{empty-state-DA517HAb.js → empty-state-D-2ZMXXJ.js} +2 -2
  19. package/dist/escape-owner-DpaP0lm1.js +19 -0
  20. package/dist/{field-blur-DdvY0NQQ.js → field-blur-DyOByjzw.js} +1 -1
  21. package/dist/{field-blur-context-DbJQZkEB.js → field-blur-context-DPe5_Nv5.js} +1 -1
  22. package/dist/hooks-a7_exKWS.js +329 -0
  23. package/dist/hooks.js +8 -102
  24. package/dist/{hover-card-DPs9huSs.js → hover-card-D_0smKBQ.js} +2 -2
  25. package/dist/i18n.js +8 -10
  26. package/dist/{icon-badge-C646JTOI.js → icon-badge-CBCU3ySF.js} +14 -14
  27. package/dist/{icon-button-DvP0Gy3j.js → icon-button-hKHsWTAt.js} +1 -1
  28. package/dist/illustrations-game.js +2 -0
  29. package/dist/lib/components/ui/display/list-tile/list-tile.d.ts +6 -0
  30. package/dist/lib/components/ui/display/list-tile/partials/list-tile-classes.d.ts +3 -1
  31. package/dist/lib/components/ui/display/list-tile/partials/list-tile-line.d.ts +1 -1
  32. package/dist/lib/components/ui/display/list-tile/partials/list-tile-toggle.d.ts +1 -1
  33. package/dist/lib/components/ui/feedback/index.d.ts +1 -0
  34. package/dist/lib/components/ui/feedback/unsaved-dialog/index.d.ts +1 -0
  35. package/dist/lib/components/ui/feedback/unsaved-dialog/unsaved-dialog.d.ts +20 -0
  36. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  37. package/dist/lib/components/ui/fields/textarea-field/textarea-footer.d.ts +2 -1
  38. package/dist/lib/components/ui/layout/app-shell/activity-layout.types.d.ts +6 -3
  39. package/dist/lib/components/ui/layout/app-shell/index.d.ts +1 -1
  40. package/dist/lib/components/ui/layout/app-shell/route-transition.d.ts +20 -2
  41. package/dist/lib/components/ui/layout/app-shell/shapes-clear-content.d.ts +2 -1
  42. package/dist/lib/components/ui/widgets/code-editor/configure-monaco.d.ts +2 -0
  43. package/dist/lib/components/ui/widgets/education/questions/index.d.ts +3 -1
  44. package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
  45. package/dist/lib/components/ui/widgets/education/questions/partials/question-top.d.ts +6 -0
  46. package/dist/lib/components/ui/widgets/education/questions/question-long-text.d.ts +5 -0
  47. package/dist/lib/components/ui/widgets/education/questions/question-media-content.d.ts +24 -0
  48. package/dist/lib/components/ui/widgets/education/questions/question-media-helpers.d.ts +11 -0
  49. package/dist/lib/components/ui/widgets/education/questions/question-media-view.d.ts +18 -0
  50. package/dist/lib/components/ui/widgets/education/questions/question-media-view.types.d.ts +32 -0
  51. package/dist/lib/components/ui/widgets/education/questions/question-options.d.ts +2 -2
  52. package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
  53. package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
  54. package/dist/lib/components/ui/widgets/education/questions/types.d.ts +38 -1
  55. package/dist/lib/components/ui/widgets/education/questions/use-reload-focus.d.ts +13 -0
  56. package/dist/lib/hooks/drafts-store.d.ts +4 -0
  57. package/dist/lib/hooks/index.d.ts +4 -0
  58. package/dist/lib/hooks/unsaved-guard-rules.d.ts +30 -0
  59. package/dist/lib/hooks/use-drafts.d.ts +75 -0
  60. package/dist/lib/hooks/use-react-router-block.d.ts +11 -0
  61. package/dist/lib/hooks/use-unsaved-guard/guard-core.d.ts +30 -0
  62. package/dist/lib/hooks/use-unsaved-guard/index.d.ts +3 -0
  63. package/dist/lib/hooks/use-unsaved-guard/types.d.ts +63 -0
  64. package/dist/lib/hooks/use-unsaved-guard/use-discard-guard.d.ts +15 -0
  65. package/dist/lib/hooks/use-unsaved-guard/use-unsaved-guard.d.ts +19 -0
  66. package/dist/lib/i18n/resources/en/en.d.ts +20 -0
  67. package/dist/lib/i18n/resources/en/material.json.d.ts +21 -1
  68. package/dist/lib/i18n/resources/fr/fr.d.ts +20 -0
  69. package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -1
  70. package/dist/lib/i18n/resources/resources.d.ts +40 -0
  71. package/dist/lib/i18n/translator.d.ts +1 -1
  72. package/dist/lib/illustrations-game/index.d.ts +17 -0
  73. package/dist/lib.js +1 -1
  74. package/dist/main.js +42 -43
  75. package/dist/map.js +63 -63
  76. package/dist/material.css +1 -1
  77. package/dist/pdf-reader.js +1 -1
  78. package/dist/print.js +1 -2
  79. package/dist/{public-BYsrhyPW.js → public-D8JGp3PH.js} +823 -822
  80. package/dist/{rich-code-block-WJxDWPPY.js → rich-code-block-0R3bidsM.js} +5 -5
  81. package/dist/{sortable-provider-oPjlhlZo.js → sortable-provider-B75v53sB.js} +2 -2
  82. package/dist/{spinner-C5lObWXT.js → spinner-CAnpF3RK.js} +1 -1
  83. package/dist/theme-picker.js +2 -2
  84. package/dist/{theme-toggle-CPEq5JG-.js → theme-toggle-pQ5F602V.js} +1 -1
  85. package/dist/{toolbar-items-ByvXcMHm.js → toolbar-items-_ezD5B0r.js} +4 -4
  86. package/dist/translate-material-CvZK8_S6.js +96 -0
  87. package/dist/{stored-language-B-tiWZU2.js → translator-Caf-d96e.js} +2497 -8
  88. package/dist/{escape-owner-r57kuPjn.js → typography-CEK19bj8.js} +17 -34
  89. package/dist/{use-chat-composer-CzOVaIed.js → use-chat-composer-Dpvi_-CR.js} +5164 -5338
  90. package/dist/{use-heading-spy-BOtygPFu.js → use-heading-spy-mmcyEGmm.js} +186 -71
  91. package/dist/{use-material-translation-B5j3jZs7.js → use-material-translation-C_1cWRzW.js} +1 -2
  92. package/dist/use-return-focus-1ZIchrBM.js +269 -0
  93. package/docs/components/data-display.md +1 -0
  94. package/docs/components/feedback-and-status.md +23 -0
  95. package/docs/components/navigation-and-layout.md +5 -4
  96. package/docs/components/rich-widgets.md +73 -1
  97. package/docs/guides/app-shell.md +17 -0
  98. package/docs/guides/code-editor.md +8 -0
  99. package/docs/guides/csp.md +4 -0
  100. package/docs/guides/helpers.md +120 -0
  101. package/docs/guides/icon-motifs.md +3 -1
  102. package/docs/guides/illustrations.md +33 -1
  103. package/docs/guides/migrating-to-3.md +4 -2
  104. package/docs/guides/theming.md +13 -3
  105. package/docs/previews/feedback-status-illustration-game.webp +0 -0
  106. package/docs/previews/feedback-status-unsaveddialog.webp +0 -0
  107. package/docs/roadmap.md +1 -1
  108. package/docs/troubleshooting.md +9 -6
  109. package/lib/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
  110. package/package.json +7 -2
  111. package/dist/dialog-yfPkLqUQ.js +0 -482
  112. package/dist/i18n-provider-BehR6cU7.js +0 -79
  113. package/dist/translate-material-tUaLZUmT.js +0 -20
  114. package/dist/translator-B9XjUDRu.js +0 -2451
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
- import { t } from "./use-material-translation-B5j3jZs7.js";
3
- import { a as n } from "./escape-owner-r57kuPjn.js";
2
+ import { t } from "./use-material-translation-C_1cWRzW.js";
3
+ import { t as n } from "./typography-CEK19bj8.js";
4
4
  import { a as r, c as i, i as a, n as o, o as s, r as c, t as l, u } from "./state-scenes-BX03WmSu.js";
5
5
  import { Suspense as d } from "react";
6
6
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -0,0 +1,19 @@
1
+ import { t as e } from "./button-group-context-CaP0X5p_.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ //#region lib/components/ui/actions/button-group/button-group-reset.tsx
4
+ function n({ children: n }) {
5
+ return /* @__PURE__ */ t(e, {
6
+ value: void 0,
7
+ children: n
8
+ });
9
+ }
10
+ //#endregion
11
+ //#region lib/components/ui/overlays/dialog/escape-owner.ts
12
+ var r = /* @__PURE__ */ new WeakSet(), i = "data-escape-owner";
13
+ function a(e, t) {
14
+ let n = e.target?.closest?.(`[${i}]`);
15
+ !n || n === t || !t?.contains(n) || (r.add(e), e.preventDefault());
16
+ }
17
+ var o = (e) => r.has(e);
18
+ //#endregion
19
+ export { n as i, o as n, a as r, i as t };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./field-blur-context-DbJQZkEB.js";
1
+ import { t as e } from "./field-blur-context-DPe5_Nv5.js";
2
2
  import { t } from "./useEvent-2fKq-6w8.js";
3
3
  import n, { useCallback as r, useEffect as i, useRef as a } from "react";
4
4
  import { jsx as o } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { l as t } from "./dist-lmHmz_bu.js";
3
- import { a as n } from "./escape-owner-r57kuPjn.js";
3
+ import { t as n } from "./typography-CEK19bj8.js";
4
4
  import * as r from "react";
5
5
  import { createContext as i, use as a, useMemo as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -0,0 +1,329 @@
1
+ import { i as e } from "./translate-material-CvZK8_S6.js";
2
+ import { t } from "./number.utils-BG_eEt5g.js";
3
+ import { n } from "./use-heading-spy-mmcyEGmm.js";
4
+ import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
5
+ import { jsx as c } from "react/jsx-runtime";
6
+ import { useBlocker as l, useNavigate as u, useSearchParams as d } from "react-router";
7
+ import { createFormatters as f } from "@nxgt/material-core/print-format";
8
+ //#region lib/hooks/unsaved-guard-rules.ts
9
+ function p(e, t, n = {}) {
10
+ return e.pathname !== t.pathname || !n.ignoreSearch && e.search !== t.search;
11
+ }
12
+ function m({ dirty: e, released: t, context: n, leaves: r, ignoreSearch: i }) {
13
+ if (t || !e) return !1;
14
+ let { currentLocation: a, nextLocation: o } = n;
15
+ return r ? r(a, o) : p(a, o, { ignoreSearch: i });
16
+ }
17
+ //#endregion
18
+ //#region lib/hooks/use-allowed-transitions.ts
19
+ function h(e, t, n) {
20
+ return (t[e] || []).map((e) => {
21
+ let t = n[e];
22
+ return t ? {
23
+ targetStatus: e,
24
+ ...t
25
+ } : null;
26
+ }).filter((e) => e !== null);
27
+ }
28
+ //#endregion
29
+ //#region lib/hooks/drafts-store.ts
30
+ function g(e, t, n) {
31
+ let r = {};
32
+ try {
33
+ let i = e?.getItem(t);
34
+ if (!i) return r;
35
+ let a = JSON.parse(i);
36
+ if (!a || typeof a != "object" || Array.isArray(a)) return r;
37
+ for (let [e, t] of Object.entries(a)) if (typeof t == "string") try {
38
+ let i = n(t);
39
+ i !== void 0 && (r[e] = i);
40
+ } catch {}
41
+ } catch {}
42
+ return r;
43
+ }
44
+ function _(e, t, n, r) {
45
+ try {
46
+ let i = Object.keys(n);
47
+ if (i.length === 0) {
48
+ e?.removeItem(t);
49
+ return;
50
+ }
51
+ let a = {};
52
+ for (let e of i) a[e] = r(n[e]);
53
+ e?.setItem(t, JSON.stringify(a));
54
+ } catch {}
55
+ }
56
+ //#endregion
57
+ //#region lib/hooks/use-drafts.ts
58
+ function v() {
59
+ try {
60
+ return window.sessionStorage;
61
+ } catch {
62
+ return;
63
+ }
64
+ }
65
+ var y = (e) => JSON.parse(e);
66
+ function b(e) {
67
+ try {
68
+ return e === void 0 ? v() : typeof e == "function" ? e() : e;
69
+ } catch {
70
+ return;
71
+ }
72
+ }
73
+ function x(e, t) {
74
+ try {
75
+ b(t)?.removeItem(e);
76
+ } catch {}
77
+ }
78
+ function S(e, t = {}) {
79
+ let { serialize: n = JSON.stringify, parse: c = y, storage: l } = t, [u, d] = s({
80
+ key: e,
81
+ drafts: {},
82
+ loaded: !1
83
+ }), f = o(u), p = u.key === e, m = p ? u.drafts : C, h = p && u.loaded;
84
+ i(() => {
85
+ let t = g(b(l), e, c), n = f.current, r = {
86
+ key: e,
87
+ drafts: n.key === e ? {
88
+ ...t,
89
+ ...n.drafts
90
+ } : t,
91
+ loaded: !0
92
+ };
93
+ f.current = r, d(r);
94
+ }, [e]);
95
+ let v = r((t) => {
96
+ let r = b(l), i = f.current, a = i.key === e && i.loaded, o = {
97
+ key: e,
98
+ drafts: t(a ? i.drafts : g(r, e, c)),
99
+ loaded: a
100
+ };
101
+ _(r, e, o.drafts, n), f.current = o, d(o);
102
+ }, [e]), x = r((e, t) => v((n) => ({
103
+ ...n,
104
+ [e]: t
105
+ })), [v]), S = r((e) => v((t) => {
106
+ let { [e]: n, ...r } = t;
107
+ return r;
108
+ }), [v]), w = r(() => v(() => ({})), [v]);
109
+ return {
110
+ get: r((e) => m[e], [m]),
111
+ set: x,
112
+ drop: S,
113
+ clear: w,
114
+ keys: a(() => Object.keys(m), [m]),
115
+ loaded: h
116
+ };
117
+ }
118
+ var C = {};
119
+ //#endregion
120
+ //#region lib/hooks/use-formatters.ts
121
+ function w(t = {}) {
122
+ let n = e(), r = t.locale ?? n?.language ?? "en", { timeZone: i } = t;
123
+ return a(() => f({
124
+ locale: r,
125
+ timeZone: i
126
+ }), [r, i]);
127
+ }
128
+ //#endregion
129
+ //#region lib/hooks/use-navigation.ts
130
+ function T(e, t) {
131
+ let n = u();
132
+ return r(() => {
133
+ n(e, t);
134
+ }, [
135
+ n,
136
+ e,
137
+ t
138
+ ]);
139
+ }
140
+ function E(e) {
141
+ let t = u();
142
+ return a(() => e.map(({ to: e, options: n }) => () => {
143
+ t(e, n);
144
+ }), [t, e]);
145
+ }
146
+ //#endregion
147
+ //#region lib/hooks/use-number-formatter.ts
148
+ function D() {
149
+ let n = e(), i = r((e, r) => t(e, {
150
+ ...r,
151
+ language: n?.language
152
+ }), [n?.language]);
153
+ return {
154
+ formatCurrency: r((e, t) => i(e, {
155
+ ...t,
156
+ currency: t?.currency,
157
+ style: t?.currency ? "currency" : void 0
158
+ }), [i]),
159
+ formatNumber: i
160
+ };
161
+ }
162
+ //#endregion
163
+ //#region lib/hooks/use-options.ts
164
+ function O(e, { filter: t, value: n, label: r, expanded: i }) {
165
+ return e.filter((e) => e && (t?.(e) ?? !0)).map((e) => {
166
+ let t = typeof n == "function" ? n(e) : e[n]?.toString() ?? "", a = "";
167
+ return a = typeof r == "function" ? r(e) : Array.isArray(r) ? r.map((t) => e[t]).filter(Boolean).join(" ") : e[r]?.toString() ?? "", {
168
+ value: t,
169
+ label: a,
170
+ ...i ? e : {}
171
+ };
172
+ });
173
+ }
174
+ function k(e, t) {
175
+ let { filter: n, value: r, label: i, expanded: o } = t;
176
+ return a(() => O(e, {
177
+ filter: n,
178
+ value: r,
179
+ label: i,
180
+ expanded: o
181
+ }), [
182
+ e,
183
+ n,
184
+ r,
185
+ i,
186
+ o
187
+ ]);
188
+ }
189
+ function A(e) {
190
+ return e?.edges?.map((e) => e.node) ?? [];
191
+ }
192
+ //#endregion
193
+ //#region lib/hooks/use-react-router-block.ts
194
+ var j = (e) => {
195
+ let t = l(e);
196
+ return {
197
+ state: t.state,
198
+ proceed: () => t.state === "blocked" && t.proceed(),
199
+ reset: () => t.state === "blocked" && t.reset()
200
+ };
201
+ };
202
+ //#endregion
203
+ //#region lib/hooks/use-search-param.ts
204
+ function M(e) {
205
+ let [t, n] = d();
206
+ return a(() => t.get(e), [t, e]);
207
+ }
208
+ //#endregion
209
+ //#region lib/hooks/use-unsaved-guard/guard-core.ts
210
+ var N = (e) => typeof e == "function" ? e() : e;
211
+ function P(e) {
212
+ let t = !1, n, r = () => {
213
+ n !== void 0 && clearTimeout(n), n = void 0;
214
+ }, i = () => {
215
+ t = !1, r();
216
+ };
217
+ return {
218
+ release() {
219
+ t = !0, r(), n = setTimeout(i, 0);
220
+ },
221
+ rearm: i,
222
+ dispose: r,
223
+ shouldBlock(n, r) {
224
+ if (!m({
225
+ dirty: !0,
226
+ released: !1,
227
+ context: n,
228
+ ...r
229
+ })) return !1;
230
+ let a = t;
231
+ return i(), !a && N(e());
232
+ },
233
+ shouldWarnUnload() {
234
+ return !t && N(e());
235
+ }
236
+ };
237
+ }
238
+ function F(e, t) {
239
+ let n = (e) => {
240
+ t.shouldWarnUnload() && (e.preventDefault(), e.returnValue = "");
241
+ };
242
+ return e.addEventListener("beforeunload", n), () => e.removeEventListener("beforeunload", n);
243
+ }
244
+ async function I(e) {
245
+ if (!e) return !1;
246
+ try {
247
+ return await e() === !0;
248
+ } catch {
249
+ return !1;
250
+ }
251
+ }
252
+ //#endregion
253
+ //#region lib/hooks/use-unsaved-guard/use-discard-guard.tsx
254
+ function L(e, t = {}) {
255
+ let i = o(e);
256
+ i.current = e;
257
+ let [a, l] = s(null);
258
+ return {
259
+ close: r((e) => {
260
+ N(i.current) ? l(() => e) : e();
261
+ }, []),
262
+ dialog: /* @__PURE__ */ c(n, {
263
+ ...t,
264
+ open: a !== null,
265
+ onOpenChange: (e) => {
266
+ e || l(null);
267
+ },
268
+ onLeave: () => {
269
+ a?.();
270
+ }
271
+ })
272
+ };
273
+ }
274
+ //#endregion
275
+ //#region lib/hooks/use-unsaved-guard/use-unsaved-guard.tsx
276
+ function R(e) {
277
+ i(() => F(window, e), [e]);
278
+ }
279
+ function z(e, t) {
280
+ let [n, r] = s(!1), a = o(!1), c = o(e);
281
+ c.current = e;
282
+ let l = o(t);
283
+ return l.current = t, i(() => {
284
+ if (e.state !== "blocked") {
285
+ a.current = !1, r(!1);
286
+ return;
287
+ }
288
+ a.current || (a.current = !0, I(l.current).then((e) => {
289
+ e ? c.current.proceed() : r(!0);
290
+ }));
291
+ }, [e.state]), {
292
+ asking: n && e.state === "blocked",
293
+ setAsking: r,
294
+ blockerRef: c
295
+ };
296
+ }
297
+ function B(e, t) {
298
+ let { block: a, leaves: l, ignoreSearch: u, onBlock: d, ...f } = t, p = o(e);
299
+ p.current = e;
300
+ let [m] = s(() => P(() => p.current)), h = o(!1), { asking: g, setAsking: _, blockerRef: v } = z(a((e) => m.shouldBlock(e, {
301
+ leaves: l,
302
+ ignoreSearch: u
303
+ })), d);
304
+ R(m), i(() => m.dispose, [m]);
305
+ let y = typeof e == "boolean" ? e : void 0;
306
+ return i(() => {
307
+ y && m.rearm();
308
+ }, [y, m]), {
309
+ release: r(() => m.release(), [m]),
310
+ dialog: /* @__PURE__ */ c(n, {
311
+ ...f,
312
+ open: g,
313
+ onOpenChange: (e) => {
314
+ if (!e) {
315
+ if (_(!1), h.current) {
316
+ h.current = !1;
317
+ return;
318
+ }
319
+ v.current.reset();
320
+ }
321
+ },
322
+ onLeave: () => {
323
+ h.current = !0, v.current.proceed();
324
+ }
325
+ })
326
+ };
327
+ }
328
+ //#endregion
329
+ export { O as a, D as c, w as d, x as f, m as g, p as h, j as i, T as l, h as m, L as n, A as o, S as p, M as r, k as s, B as t, E as u };
package/dist/hooks.js CHANGED
@@ -1,102 +1,8 @@
1
- import { r as e } from "./i18n-provider-BehR6cU7.js";
2
- import { a as t, i as n, o as r, r as i, s as a } from "./theme-store-BdPp43cV.js";
3
- import { n as o, t as s } from "./use-theme-BCLireTd.js";
4
- import { t as c } from "./number.utils-BG_eEt5g.js";
5
- import { a as l, i as u, n as d, o as f, r as p, s as m, t as h } from "./use-heading-spy-BOtygPFu.js";
6
- import { r as g } from "./use-csp-nonce-ZKs9k-ov.js";
7
- import { t as _ } from "./use-mobile-BDro060N.js";
8
- import { t as v } from "./use-scroll-away-PQRFZkT2.js";
9
- import { useCallback as y, useMemo as b } from "react";
10
- import { useNavigate as x, useSearchParams as S } from "react-router";
11
- import { createFormatters as C } from "@nxgt/material-core/print-format";
12
- //#region lib/hooks/use-allowed-transitions.ts
13
- function w(e, t, n) {
14
- return (t[e] || []).map((e) => {
15
- let t = n[e];
16
- return t ? {
17
- targetStatus: e,
18
- ...t
19
- } : null;
20
- }).filter((e) => e !== null);
21
- }
22
- //#endregion
23
- //#region lib/hooks/use-formatters.ts
24
- function T(t = {}) {
25
- let n = e(), r = t.locale ?? n?.language ?? "en", { timeZone: i } = t;
26
- return b(() => C({
27
- locale: r,
28
- timeZone: i
29
- }), [r, i]);
30
- }
31
- //#endregion
32
- //#region lib/hooks/use-navigation.ts
33
- function E(e, t) {
34
- let n = x();
35
- return y(() => {
36
- n(e, t);
37
- }, [
38
- n,
39
- e,
40
- t
41
- ]);
42
- }
43
- function D(e) {
44
- let t = x();
45
- return b(() => e.map(({ to: e, options: n }) => () => {
46
- t(e, n);
47
- }), [t, e]);
48
- }
49
- //#endregion
50
- //#region lib/hooks/use-number-formatter.ts
51
- function O() {
52
- let t = e(), n = y((e, n) => c(e, {
53
- ...n,
54
- language: t?.language
55
- }), [t?.language]);
56
- return {
57
- formatCurrency: y((e, t) => n(e, {
58
- ...t,
59
- currency: t?.currency,
60
- style: t?.currency ? "currency" : void 0
61
- }), [n]),
62
- formatNumber: n
63
- };
64
- }
65
- //#endregion
66
- //#region lib/hooks/use-options.ts
67
- function k(e, { filter: t, value: n, label: r, expanded: i }) {
68
- return e.filter((e) => e && (t?.(e) ?? !0)).map((e) => {
69
- let t = typeof n == "function" ? n(e) : e[n]?.toString() ?? "", a = "";
70
- return a = typeof r == "function" ? r(e) : Array.isArray(r) ? r.map((t) => e[t]).filter(Boolean).join(" ") : e[r]?.toString() ?? "", {
71
- value: t,
72
- label: a,
73
- ...i ? e : {}
74
- };
75
- });
76
- }
77
- function A(e, t) {
78
- let { filter: n, value: r, label: i, expanded: a } = t;
79
- return b(() => k(e, {
80
- filter: n,
81
- value: r,
82
- label: i,
83
- expanded: a
84
- }), [
85
- e,
86
- n,
87
- r,
88
- i,
89
- a
90
- ]);
91
- }
92
- function j(e) {
93
- return e?.edges?.map((e) => e.node) ?? [];
94
- }
95
- //#endregion
96
- //#region lib/hooks/use-search-param.ts
97
- function M(e) {
98
- let [t, n] = S();
99
- return b(() => t.get(e), [t, e]);
100
- }
101
- //#endregion
102
- export { i as DEFAULT_THEME, n as applyResolvedTheme, t as applyThemeName, k as buildOptions, p as busySettler, u as createSubmitGuard, j as extractNode, r as resolveTheme, a as resolveThemeName, w as useAllowedTransitions, d as useCountdown, g as useCspNonce, f as useFocusOnMount, T as useFormatters, h as useHeadingSpy, o as useIsClient, _ as useIsMobile, m as useLocalizedDate, E as useNavigationHandler, D as useNavigationHandlers, O as useNumberFormatter, A as useOptions, v as useScrollAway, M as useSearchParam, l as useSubmitOnce, s as useTheme };
1
+ import { a as e, i as t, o as n, r, s as i } from "./theme-store-BdPp43cV.js";
2
+ import { n as a, t as o } from "./use-theme-BCLireTd.js";
3
+ import { a as s, c, d as l, o as u, r as d, s as f, t as p } from "./use-heading-spy-mmcyEGmm.js";
4
+ import { r as m } from "./use-csp-nonce-ZKs9k-ov.js";
5
+ import { t as h } from "./use-mobile-BDro060N.js";
6
+ import { t as g } from "./use-scroll-away-PQRFZkT2.js";
7
+ import { a as _, c as v, d as y, f as b, g as x, h as S, i as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M } from "./hooks-a7_exKWS.js";
8
+ export { r as DEFAULT_THEME, t as applyResolvedTheme, e as applyThemeName, _ as buildOptions, s as busySettler, b as clearDrafts, u as createSubmitGuard, D as extractNode, S as isLeaving, n as resolveTheme, i as resolveThemeName, x as shouldBlockNavigation, T as useAllowedTransitions, d as useCountdown, m as useCspNonce, E as useDiscardGuard, O as useDrafts, c as useFocusOnMount, y as useFormatters, p as useHeadingSpy, a as useIsClient, h as useIsMobile, l as useLocalizedDate, w as useNavigationHandler, M as useNavigationHandlers, v as useNumberFormatter, A as useOptions, C as useReactRouterBlock, g as useScrollAway, k as useSearchParam, f as useSubmitOnce, o as useTheme, j as useUnsavedGuard };
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { o as t } from "./dist-DVRQkaTK.js";
3
3
  import { a as n, c as r, i, l as a, s as o } from "./dist-lmHmz_bu.js";
4
- import { C as s, S as c, f as l, m as u, p as d, u as f } from "./spinner-C5lObWXT.js";
4
+ import { C as s, S as c, f as l, m as u, p as d, u as f } from "./spinner-CAnpF3RK.js";
5
5
  import { t as p } from "./in-dialog-Vwkyp-M5.js";
6
- import { i as m } from "./escape-owner-r57kuPjn.js";
6
+ import { i as m } from "./escape-owner-DpaP0lm1.js";
7
7
  import * as h from "react";
8
8
  import { Activity as g } from "react";
9
9
  import { jsx as _ } from "react/jsx-runtime";
package/dist/i18n.js CHANGED
@@ -1,10 +1,8 @@
1
1
  import { t as e } from "./is-production-GLw59WU8.js";
2
- import { a as t, i as n, n as r, r as i } from "./stored-language-B-tiWZU2.js";
3
- import { n as a, r as o, t as s } from "./i18n-provider-BehR6cU7.js";
4
- import { i as c, n as l, o as u, r as d, t as f } from "./translator-B9XjUDRu.js";
5
- import { o as p, t as m } from "./merge-BCZE6HGq.js";
6
- import { t as h } from "./translate-material-tUaLZUmT.js";
7
- import { t as g } from "./use-material-translation-B5j3jZs7.js";
2
+ import { c as t, d as n, i as r, l as i, n as a, o, r as s, t as c, u as l } from "./translator-Caf-d96e.js";
3
+ import { i as u, n as d, r as f, t as p } from "./translate-material-CvZK8_S6.js";
4
+ import { o as m, t as h } from "./merge-BCZE6HGq.js";
5
+ import { t as g } from "./use-material-translation-C_1cWRzW.js";
8
6
  import { useCallback as _ } from "react";
9
7
  //#region lib/i18n/merge-resources.ts
10
8
  function v(e, t, n = "") {
@@ -12,7 +10,7 @@ function v(e, t, n = "") {
12
10
  for (let i of Object.keys(t)) {
13
11
  if (!(i in e)) continue;
14
12
  let a = n ? `${n}.${i}` : i, o = e[i], s = t[i];
15
- p(o) && p(s) ? r.push(...v(o, s, a)) : r.push(a);
13
+ m(o) && m(s) ? r.push(...v(o, s, a)) : r.push(a);
16
14
  }
17
15
  return r;
18
16
  }
@@ -25,7 +23,7 @@ function b(e, t) {
25
23
  let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]), r = {};
26
24
  for (let i of n) {
27
25
  let n = e[i] ?? {}, a = t[i] ?? {};
28
- y(i, n, a), r[i] = m({}, n, a);
26
+ y(i, n, a), r[i] = h({}, n, a);
29
27
  }
30
28
  return r;
31
29
  }
@@ -33,7 +31,7 @@ function b(e, t) {
33
31
  //#region lib/i18n/use-typed-translation.ts
34
32
  function x(e) {
35
33
  return function() {
36
- let { language: t, changeLanguage: n } = a();
34
+ let { language: t, changeLanguage: n } = f();
37
35
  return {
38
36
  t: _((n, r) => e(n, r, () => t), [t]),
39
37
  i18n: {
@@ -44,4 +42,4 @@ function x(e) {
44
42
  };
45
43
  }
46
44
  //#endregion
47
- export { r as FALLBACK_LANGUAGE, c as FormatMessageError, s as I18nProvider, i as LANGUAGE_KEY, n as SUPPORTED_LANGUAGES, f as createTranslator, x as createTypedTranslation, u as formatMessage, l as getLanguage, b as mergeResources, t as resources, d as translate, h as translateMaterial, a as useI18nContext, g as useMaterialTranslation, o as useOptionalI18nContext };
45
+ export { t as FALLBACK_LANGUAGE, r as FormatMessageError, d as I18nProvider, i as LANGUAGE_KEY, l as SUPPORTED_LANGUAGES, c as createTranslator, x as createTypedTranslation, o as formatMessage, a as getLanguage, b as mergeResources, n as resources, s as translate, p as translateMaterial, f as useI18nContext, g as useMaterialTranslation, u as useOptionalI18nContext };
@@ -1,13 +1,13 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
- import { f as t } from "./dialog-yfPkLqUQ.js";
3
- import { a as n, i as r, n as i } from "./field-blur-context-DbJQZkEB.js";
4
- import { t as a } from "./icon-button-DvP0Gy3j.js";
2
+ import { a as t, i as n, n as r } from "./field-blur-context-DPe5_Nv5.js";
3
+ import { t as i } from "./icon-button-hKHsWTAt.js";
4
+ import { f as a } from "./dialog-Bd7Hid2L.js";
5
5
  import { isValidElement as o, useId as s } from "react";
6
6
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
7
  import { describedBy as u } from "@nxgt/material-core/described-by";
8
8
  //#region lib/components/ui/fields/text-field/text-field.tsx
9
- function d({ error: a, helperText: d, label: p, className: m, leading: h, trailing: g, ..._ }) {
10
- let v = i(), y = s(), b = s(), x = u(_["aria-describedby"], !!d && b), S = !!h && !o(h), C = !!g && !o(g), w = /* @__PURE__ */ l("div", {
9
+ function d({ error: i, helperText: d, label: p, className: m, leading: h, trailing: g, ..._ }) {
10
+ let v = r(), y = s(), b = s(), x = u(_["aria-describedby"], !!d && b), S = !!h && !o(h), C = !!g && !o(g), w = /* @__PURE__ */ l("div", {
11
11
  className: e("relative", {
12
12
  "*:first:size-8 *:first:absolute *:first:top-[calc(50%-16px)] *:first:left-1.5 [&_input]:pl-10 *:first:bg-muted/80 *:first:text-muted-foreground": !!h && !S,
13
13
  "*:last:size-8 *:last:absolute *:last:top-[calc(50%-16px)] *:last:right-1.5 *:last:pointer-coarse:size-11 *:last:pointer-coarse:top-[calc(50%-22px)] *:last:pointer-coarse:right-0 [&_input]:pr-.5 *:last:bg-muted/80 *:last:text-muted-foreground": !!g && !C,
@@ -19,8 +19,8 @@ function d({ error: a, helperText: d, label: p, className: m, leading: h, traili
19
19
  slot: "leading",
20
20
  children: h
21
21
  }) : h && h,
22
- /* @__PURE__ */ c(t, {
23
- "aria-invalid": a,
22
+ /* @__PURE__ */ c(a, {
23
+ "aria-invalid": i,
24
24
  ..._,
25
25
  id: _.id ?? y,
26
26
  "aria-describedby": x
@@ -35,15 +35,15 @@ function d({ error: a, helperText: d, label: p, className: m, leading: h, traili
35
35
  ref: v,
36
36
  "data-slot": "text-field",
37
37
  className: e("grid w-full content-start gap-1.5", m),
38
- children: [/* @__PURE__ */ c(r, {
38
+ children: [/* @__PURE__ */ c(n, {
39
39
  withAsterisk: _.required,
40
40
  htmlFor: _.id ?? y,
41
41
  children: p
42
42
  }), /* @__PURE__ */ l("div", {
43
43
  className: "flex flex-col gap-0.5",
44
- children: [w, d ? /* @__PURE__ */ c(n, {
44
+ children: [w, d ? /* @__PURE__ */ c(t, {
45
45
  id: b,
46
- error: a,
46
+ error: i,
47
47
  children: d
48
48
  }) : null]
49
49
  })]
@@ -59,10 +59,10 @@ function f({ slot: t, children: n }) {
59
59
  //#endregion
60
60
  //#region lib/components/ui/actions/icon-button/icon-badge.tsx
61
61
  function p({ children: t, className: n, ...r }) {
62
- let i = !!(r["aria-label"] || r["aria-labelledby"]);
63
- return /* @__PURE__ */ c(a, {
64
- "aria-hidden": i ? void 0 : "true",
65
- role: i ? "img" : void 0,
62
+ let a = !!(r["aria-label"] || r["aria-labelledby"]);
63
+ return /* @__PURE__ */ c(i, {
64
+ "aria-hidden": a ? void 0 : "true",
65
+ role: a ? "img" : void 0,
66
66
  ...r,
67
67
  asChild: !0,
68
68
  className: e("cursor-default", n),
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { n as t } from "./use-shape-morph-BKA_R5P5.js";
3
3
  import { n, t as r } from "./dist-DVRQkaTK.js";
4
- import { n as i, r as a, t as o } from "./spinner-C5lObWXT.js";
4
+ import { n as i, r as a, t as o } from "./spinner-CAnpF3RK.js";
5
5
  import { a as s, i as c, n as l, o as u, r as d, s as f, t as p } from "./use-click-lock-BZYtTmVt.js";
6
6
  import { t as m } from "./is-production-GLw59WU8.js";
7
7
  import { t as h } from "./button-group-context-CaP0X5p_.js";
@@ -0,0 +1,2 @@
1
+ import { GAME_SCENES as e, GAME_SCENE_IDS as t, GAME_SUGGESTED_ICONS as n } from "@nxgt/material-core/illustrations/game";
2
+ export { e as GAME_SCENES, t as GAME_SCENE_IDS, n as GAME_SUGGESTED_ICONS };
@@ -25,6 +25,12 @@ export type ListTileCommonProps = {
25
25
  * hover tint and the record-row layout of `chips`: dense lists of records.
26
26
  */
27
27
  variant?: 'tonal' | 'divided';
28
+ /**
29
+ * `variant="divided"` only: a 16px inline inset (M3's list-item padding) in
30
+ * place of the default 4px, for a list inside a `Card`. The hairlines on the
31
+ * `<li>` still run edge to edge. Ignored by the `tonal` variant.
32
+ */
33
+ inset?: boolean;
28
34
  /**
29
35
  * Render the tile inside a `<li>`, for a tile in a `<ul>` (or `<ol>`) you
30
36
  * own: the list announces its length, and `variant="divided"` draws its
@@ -10,9 +10,11 @@ type ListTileClassesOptions = {
10
10
  divided?: boolean;
11
11
  /** The record row: this box is a container for the `@md` and `@xl` layout. */
12
12
  dense?: boolean;
13
+ /** `divided` only: a 16px inline inset (`px-4`) in place of 4px (`px-1`). */
14
+ inset?: boolean;
13
15
  };
14
16
  /** The classes shared by the tile's three elements (link, button, div). */
15
- export declare function listTileClasses({ compact, selected, interactive, disabled, className, split, divided, dense, }: ListTileClassesOptions): string;
17
+ export declare function listTileClasses({ compact, selected, interactive, disabled, className, split, divided, dense, inset, }: ListTileClassesOptions): string;
16
18
  /**
17
19
  * The row of a tile with `actions` (its link, button or div): it fills the
18
20
  * tile's box except for the actions, and a link or button stretches over the
@@ -1,3 +1,3 @@
1
1
  import { ListTileCommonProps, ListTileLinkOrButtonProps } from '../list-tile.js';
2
2
  /** A link, a button or a plain tile, with or without `actions` beside it. */
3
- export declare function ListTileLine({ title, subtitle, leading, trailing, chips, variant, actions, className, selected, size, href, chevron, linkComponent: ownLink, disabled, onClick, ...props }: ListTileCommonProps & Omit<ListTileLinkOrButtonProps, 'toggle'>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
3
+ export declare function ListTileLine({ title, subtitle, leading, trailing, chips, variant, inset, actions, className, selected, size, href, chevron, linkComponent: ownLink, disabled, onClick, ...props }: ListTileCommonProps & Omit<ListTileLinkOrButtonProps, 'toggle'>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
@@ -16,5 +16,5 @@ type ListTileToggleRowProps = ListTileCommonProps & {
16
16
  * screen reader reads "Notifications, switch, on, Email and push" rather
17
17
  * than the row's whole text as the name.
18
18
  */
19
- export declare function ListTileToggleRow({ toggle, title, subtitle, leading, trailing, variant, selected, size, disabled, className, ...rootProps }: ListTileToggleRowProps): import("react").JSX.Element;
19
+ export declare function ListTileToggleRow({ toggle, title, subtitle, leading, trailing, variant, inset, selected, size, disabled, className, ...rootProps }: ListTileToggleRowProps): import("react").JSX.Element;
20
20
  export {};
@@ -22,3 +22,4 @@ export * from './step-dots/index.js';
22
22
  export * from './step-up-dialog/index.js';
23
23
  export * from './toast/index.js';
24
24
  export * from './typing-indicator/index.js';
25
+ export * from './unsaved-dialog/index.js';