@nxgt/material 3.62.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 (92) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -1
  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 +5 -5
  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-TDDUQ1Y0.js → components-Cm2doOJS.js} +14345 -14224
  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 +3 -3
  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/lib/components/ui/feedback/index.d.ts +1 -0
  29. package/dist/lib/components/ui/feedback/unsaved-dialog/index.d.ts +1 -0
  30. package/dist/lib/components/ui/feedback/unsaved-dialog/unsaved-dialog.d.ts +20 -0
  31. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  32. package/dist/lib/components/ui/fields/textarea-field/textarea-footer.d.ts +2 -1
  33. package/dist/lib/components/ui/widgets/education/questions/index.d.ts +3 -1
  34. package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
  35. package/dist/lib/components/ui/widgets/education/questions/partials/question-top.d.ts +6 -0
  36. package/dist/lib/components/ui/widgets/education/questions/question-long-text.d.ts +5 -0
  37. package/dist/lib/components/ui/widgets/education/questions/question-media-content.d.ts +24 -0
  38. package/dist/lib/components/ui/widgets/education/questions/question-media-helpers.d.ts +11 -0
  39. package/dist/lib/components/ui/widgets/education/questions/question-media-view.d.ts +18 -0
  40. package/dist/lib/components/ui/widgets/education/questions/question-media-view.types.d.ts +32 -0
  41. package/dist/lib/components/ui/widgets/education/questions/question-options.d.ts +2 -2
  42. package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
  43. package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
  44. package/dist/lib/components/ui/widgets/education/questions/types.d.ts +38 -1
  45. package/dist/lib/components/ui/widgets/education/questions/use-reload-focus.d.ts +13 -0
  46. package/dist/lib/hooks/index.d.ts +3 -0
  47. package/dist/lib/hooks/unsaved-guard-rules.d.ts +30 -0
  48. package/dist/lib/hooks/use-react-router-block.d.ts +11 -0
  49. package/dist/lib/hooks/use-unsaved-guard/guard-core.d.ts +30 -0
  50. package/dist/lib/hooks/use-unsaved-guard/index.d.ts +3 -0
  51. package/dist/lib/hooks/use-unsaved-guard/types.d.ts +63 -0
  52. package/dist/lib/hooks/use-unsaved-guard/use-discard-guard.d.ts +15 -0
  53. package/dist/lib/hooks/use-unsaved-guard/use-unsaved-guard.d.ts +19 -0
  54. package/dist/lib/i18n/resources/en/en.d.ts +20 -0
  55. package/dist/lib/i18n/resources/en/material.json.d.ts +21 -1
  56. package/dist/lib/i18n/resources/fr/fr.d.ts +20 -0
  57. package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -1
  58. package/dist/lib/i18n/resources/resources.d.ts +40 -0
  59. package/dist/lib/i18n/translator.d.ts +1 -1
  60. package/dist/lib.js +1 -1
  61. package/dist/main.js +42 -43
  62. package/dist/map.js +63 -63
  63. package/dist/material.css +1 -1
  64. package/dist/pdf-reader.js +1 -1
  65. package/dist/print.js +1 -2
  66. package/dist/{public-BYsrhyPW.js → public-D8JGp3PH.js} +823 -822
  67. package/dist/{rich-code-block-WJxDWPPY.js → rich-code-block-0R3bidsM.js} +5 -5
  68. package/dist/{sortable-provider-oPjlhlZo.js → sortable-provider-B75v53sB.js} +2 -2
  69. package/dist/{spinner-C5lObWXT.js → spinner-CAnpF3RK.js} +1 -1
  70. package/dist/theme-picker.js +2 -2
  71. package/dist/{theme-toggle-CPEq5JG-.js → theme-toggle-pQ5F602V.js} +1 -1
  72. package/dist/{toolbar-items-ByvXcMHm.js → toolbar-items-_ezD5B0r.js} +4 -4
  73. package/dist/translate-material-CvZK8_S6.js +96 -0
  74. package/dist/{stored-language-B-tiWZU2.js → translator-Caf-d96e.js} +2497 -8
  75. package/dist/{escape-owner-r57kuPjn.js → typography-CEK19bj8.js} +17 -34
  76. package/dist/{use-chat-composer-CzOVaIed.js → use-chat-composer-Dpvi_-CR.js} +5164 -5338
  77. package/dist/{use-heading-spy-BOtygPFu.js → use-heading-spy-mmcyEGmm.js} +186 -71
  78. package/dist/{use-material-translation-B5j3jZs7.js → use-material-translation-C_1cWRzW.js} +1 -2
  79. package/dist/use-return-focus-1ZIchrBM.js +269 -0
  80. package/docs/components/feedback-and-status.md +23 -0
  81. package/docs/components/navigation-and-layout.md +4 -3
  82. package/docs/components/rich-widgets.md +73 -1
  83. package/docs/guides/helpers.md +63 -0
  84. package/docs/guides/theming.md +13 -3
  85. package/docs/previews/feedback-status-unsaveddialog.webp +0 -0
  86. package/lib/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
  87. package/package.json +1 -1
  88. package/dist/dialog-yfPkLqUQ.js +0 -482
  89. package/dist/hooks-CGnqFngB.js +0 -187
  90. package/dist/i18n-provider-BehR6cU7.js +0 -79
  91. package/dist/translate-material-tUaLZUmT.js +0 -20
  92. 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,8 +1,8 @@
1
1
  import { a as e, i as t, o as n, r, s as i } from "./theme-store-BdPp43cV.js";
2
2
  import { n as a, t as o } from "./use-theme-BCLireTd.js";
3
- import { a as s, i as c, n as l, o as u, r as d, s as f, t as p } from "./use-heading-spy-BOtygPFu.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
4
  import { r as m } from "./use-csp-nonce-ZKs9k-ov.js";
5
5
  import { t as h } from "./use-mobile-BDro060N.js";
6
6
  import { t as g } from "./use-scroll-away-PQRFZkT2.js";
7
- import { a as _, c as v, d as y, i as b, l as x, n as S, o as C, r as w, s as T, t as E, u as D } from "./hooks-CGnqFngB.js";
8
- export { r as DEFAULT_THEME, t as applyResolvedTheme, e as applyThemeName, S as buildOptions, d as busySettler, x as clearDrafts, c as createSubmitGuard, w as extractNode, n as resolveTheme, i as resolveThemeName, y as useAllowedTransitions, l as useCountdown, m as useCspNonce, D as useDrafts, u as useFocusOnMount, v as useFormatters, p as useHeadingSpy, a as useIsClient, h as useIsMobile, f as useLocalizedDate, C as useNavigationHandler, T as useNavigationHandlers, _ as useNumberFormatter, b as useOptions, g as useScrollAway, E as useSearchParam, s as useSubmitOnce, o as useTheme };
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";
@@ -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';
@@ -0,0 +1 @@
1
+ export * from './unsaved-dialog.js';
@@ -0,0 +1,20 @@
1
+ export interface UnsavedDialogProps {
2
+ open: boolean;
3
+ onOpenChange: (open: boolean) => void;
4
+ /** Runs on "Leave". The dialog closes after it. */
5
+ onLeave: () => void | Promise<void>;
6
+ /** Default: "Leave without saving?" (translated). */
7
+ title?: string;
8
+ /** Default: the unsaved changes will be lost (translated). */
9
+ description?: string;
10
+ /** Default: "Stay" (translated). */
11
+ stayLabel?: string;
12
+ /** Default: "Leave" (translated). */
13
+ leaveLabel?: string;
14
+ }
15
+ /**
16
+ * "Leave without saving?": a destructive ConfirmDialog whose default focus is
17
+ * Stay, so Enter keeps the work. `useUnsavedGuard` and `useDiscardGuard` render
18
+ * it; use it directly for a guard of your own.
19
+ */
20
+ export declare function UnsavedDialog({ open, onOpenChange, onLeave, title, description, stayLabel, leaveLabel, }: UnsavedDialogProps): import("react").JSX.Element;