@nxgt/material 2.16.0 → 2.17.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 (106) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +9 -4
  3. package/dist/{_Uint8Array-CjLUgWgf.js → _Uint8Array-C7apDrb7.js} +1 -1
  4. package/dist/{_overRest-HfSwfmH1.js → _overRest-CCAbV-eT.js} +1 -1
  5. package/dist/async-slice-Cuekts5f.js +459 -0
  6. package/dist/{blockDiagram-BEXU5L5S-DSNWJcbS.js → blockDiagram-BEXU5L5S-K2MjXCm9.js} +2 -2
  7. package/dist/{chunk-3FUC2YCW-CcZvlyvW.js → chunk-3FUC2YCW-6KyD6CAZ.js} +2 -2
  8. package/dist/{chunk-7M6MHVWA-21OdxoBq.js → chunk-7M6MHVWA-CNWcBB_6.js} +1 -1
  9. package/dist/{chunk-GNY47TPC-BZdgq2LF.js → chunk-GNY47TPC-DdqgSBxM.js} +4 -4
  10. package/dist/{chunk-NETBCI7D-CAgvlb0w.js → chunk-NETBCI7D-ZnunhYtw.js} +1 -1
  11. package/dist/{chunk-Z7XXMR3K-BSXPgLtN.js → chunk-Z7XXMR3K-C8MhuVIi.js} +1 -1
  12. package/dist/{classDiagram-v2-NBCMYWYE-D_BHO1iT.js → classDiagram-v2-NBCMYWYE-ByUAGkfa.js} +2 -2
  13. package/dist/components/components.css +1 -0
  14. package/dist/components/print-only.css +44 -0
  15. package/dist/{components-Bkdm6jn6.js → components-CIYQrI45.js} +59379 -58878
  16. package/dist/components.js +6 -6
  17. package/dist/{dagre-6A5THRUB-CsnftAPx.js → dagre-6A5THRUB-C2vz5UY9.js} +64 -64
  18. package/dist/{diagram-22UHCM2B-D0yPa8vo.js → diagram-22UHCM2B-DREk9ku4.js} +2 -2
  19. package/dist/{diagram-3UASUU5V-f8LIX2sj.js → diagram-3UASUU5V-CYkPaos5.js} +1 -1
  20. package/dist/dnd.js +1 -1
  21. package/dist/{elk-276RUBZZ-DI8bDQAL.js → elk-276RUBZZ-CK4KoCtK.js} +3 -3
  22. package/dist/{erDiagram-OPXOYQCR-BGHFtxmB.js → erDiagram-OPXOYQCR-CTfn8QUl.js} +2 -2
  23. package/dist/{field-blur-C-5K6U1F.js → field-blur-3RW0mJb2.js} +2 -2
  24. package/dist/{flowDiagram-KWPJA3E3-CnFLTW-3.js → flowDiagram-KWPJA3E3-CDzuzre6.js} +3 -3
  25. package/dist/{ganttDiagram-FUAMR5RP-B5uyVKE4.js → ganttDiagram-FUAMR5RP-Ci-9ZJz5.js} +1 -1
  26. package/dist/{graphlib-BqO9Go2u.js → graphlib-DxjKaXeR.js} +42 -42
  27. package/dist/hooks.js +38 -26
  28. package/dist/{i18n-provider-C3SlA4J0.js → i18n-provider-Dv9ZSmgO.js} +1 -1
  29. package/dist/i18n.js +6 -6
  30. package/dist/{isArrayLikeObject-83P1fvEs.js → isArrayLikeObject-H8k6W51O.js} +3 -3
  31. package/dist/{isEmpty-C2z3Hypl.js → isEmpty-B0Bavg-e.js} +9 -9
  32. package/dist/{journeyDiagram-ZHPQQLJL-CKtbGcVT.js → journeyDiagram-ZHPQQLJL-CwFYd51O.js} +1 -1
  33. package/dist/lib/components/ui/actions/copy-button/use-copy-status.d.ts +13 -0
  34. package/dist/lib/components/ui/display/enrolment-secret/enrolment-secret.d.ts +30 -0
  35. package/dist/lib/components/ui/display/enrolment-secret/index.d.ts +2 -0
  36. package/dist/lib/components/ui/display/enrolment-secret/use-enrolment-secret-labels.d.ts +11 -0
  37. package/dist/lib/components/ui/display/index.d.ts +2 -0
  38. package/dist/lib/components/ui/display/recovery-codes/index.d.ts +4 -0
  39. package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-actions.d.ts +14 -0
  40. package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-confirm.d.ts +13 -0
  41. package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-list.d.ts +5 -0
  42. package/dist/lib/components/ui/display/recovery-codes/recovery-codes.d.ts +8 -0
  43. package/dist/lib/components/ui/display/recovery-codes/types.d.ts +64 -0
  44. package/dist/lib/components/ui/display/recovery-codes/use-recovery-codes-labels.d.ts +7 -0
  45. package/dist/lib/components/ui/fields/form-section/form-section-classes.d.ts +30 -0
  46. package/dist/lib/components/ui/fields/form-section/form-section.d.ts +25 -0
  47. package/dist/lib/components/ui/fields/form-section/index.d.ts +1 -0
  48. package/dist/lib/components/ui/fields/index.d.ts +1 -0
  49. package/dist/lib/components/ui/forms/index.d.ts +1 -0
  50. package/dist/lib/components/ui/forms/use-code-resolver.d.ts +42 -0
  51. package/dist/lib/components/ui/layout/auth-card/auth-card-notice.d.ts +18 -0
  52. package/dist/lib/components/ui/layout/auth-card/auth-card.d.ts +35 -0
  53. package/dist/lib/components/ui/layout/auth-card/index.d.ts +1 -0
  54. package/dist/lib/components/ui/layout/index.d.ts +1 -0
  55. package/dist/lib/hooks/index.d.ts +2 -0
  56. package/dist/lib/hooks/use-focus-on-mount.d.ts +24 -0
  57. package/dist/lib/hooks/use-submit-once.d.ts +32 -0
  58. package/dist/lib/i18n/resources/en/en.d.ts +21 -0
  59. package/dist/lib/i18n/resources/en/material.json.d.ts +21 -0
  60. package/dist/lib/i18n/resources/fr/fr.d.ts +21 -0
  61. package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -0
  62. package/dist/lib/i18n/resources/resources.d.ts +42 -0
  63. package/dist/lib/i18n/translator.d.ts +1 -1
  64. package/dist/lib/lib/index.d.ts +1 -0
  65. package/dist/lib.js +58 -102
  66. package/dist/main.js +16 -16
  67. package/dist/map.js +22 -22
  68. package/dist/material.css +1 -1
  69. package/dist/{merge-CZIEHTTe.js → merge-Js8537dg.js} +4 -4
  70. package/dist/{mermaid.core-Cp75fWA9.js → mermaid.core-DW7UlwJu.js} +21 -21
  71. package/dist/{mindmap-definition-NLK3R4M7-CFYIlEfW.js → mindmap-definition-NLK3R4M7-CsLyIyEF.js} +2 -2
  72. package/dist/{pieDiagram-5QR66LMP-CjvtBYDr.js → pieDiagram-5QR66LMP-C-dfffj5.js} +1 -1
  73. package/dist/print.js +2 -2
  74. package/dist/{quadrantDiagram-O4NWA36T-DPj8ndqA.js → quadrantDiagram-O4NWA36T-DZ0TivLD.js} +1 -1
  75. package/dist/{requirementDiagram-PLB6GJNP-DjVFwRJg.js → requirementDiagram-PLB6GJNP-3brF-h1L.js} +2 -2
  76. package/dist/{sankeyDiagram-IPEJSGJF-63wsgHUY.js → sankeyDiagram-IPEJSGJF-BY-LLyiZ.js} +1 -1
  77. package/dist/{sortable-provider-Chbn1x1i.js → sortable-provider-CUT5Wfdl.js} +1 -1
  78. package/dist/{stateDiagram-v2-GCMORJYK-DNc8m371.js → stateDiagram-v2-GCMORJYK-BGavr7Nm.js} +2 -2
  79. package/dist/{stored-language-DPqzxRmf.js → stored-language-BKoohv2_.js} +42 -0
  80. package/dist/{swimlanes-2SLR337P-B7_gOJxx.js → swimlanes-2SLR337P-B6Fkr7-U.js} +3 -3
  81. package/dist/{swimlanesDiagram-TC7HE7FX-tqlBrGuu.js → swimlanesDiagram-TC7HE7FX-Dt6Tqj4h.js} +3 -3
  82. package/dist/{timeline-definition-EJHVYXUP-DIA9CBZK.js → timeline-definition-EJHVYXUP-CE-3KwYd.js} +1 -1
  83. package/dist/{translate-material-CqB-j9WD.js → translate-material-CCJg3yfc.js} +2 -2
  84. package/dist/{translator-DTl9h__E.js → translator-DEde7BKz.js} +1 -1
  85. package/dist/{use-heading-spy-C1KA3PrF.js → use-heading-spy-XkSExwoT.js} +67 -59
  86. package/dist/{use-material-translation-DMa4Xrnd.js → use-material-translation-Cndoq_iK.js} +2 -2
  87. package/dist/{usecaseDiagram-POWQR4AR-FMjCkoxs.js → usecaseDiagram-POWQR4AR-CPOCe5We.js} +2 -2
  88. package/dist/{xychartDiagram-PMCCYNJV-B76HOkCh.js → xychartDiagram-PMCCYNJV-Cleaihn8.js} +1 -1
  89. package/docs/components/README.md +3 -3
  90. package/docs/components/data-display.md +101 -0
  91. package/docs/components/form-fields.md +78 -0
  92. package/docs/components/navigation-and-layout.md +51 -0
  93. package/docs/guides/forms.md +111 -0
  94. package/docs/guides/helpers.md +81 -0
  95. package/docs/guides/i18n.md +17 -0
  96. package/docs/guides/printing.md +27 -0
  97. package/docs/previews/data-display-enrolmentsecret.webp +0 -0
  98. package/docs/previews/data-display-recoverycodes.webp +0 -0
  99. package/docs/previews/form-fields-formsection.webp +0 -0
  100. package/docs/previews/navigation-layout-authcard.webp +0 -0
  101. package/docs/roadmap.md +15 -0
  102. package/docs/troubleshooting.md +72 -0
  103. package/lib/components/components.css +1 -0
  104. package/lib/components/print-only.css +44 -0
  105. package/package.json +2 -2
  106. package/dist/async-slice-CsE3hkCD.js +0 -411
@@ -1,9 +1,9 @@
1
- import { _ as e, a as t, f as n, g as r, i, o as a, v as o, y as s } from "./translator-DTl9h__E.js";
2
- import { a as c, o as l } from "./_overRest-HfSwfmH1.js";
3
- import { A as u, C as d, O as f, b as p, v as m, x as ee, y as h } from "./async-slice-CsE3hkCD.js";
4
- import { d as te, n as ne } from "./_Uint8Array-CjLUgWgf.js";
5
- import { n as re, r as ie, t as g } from "./isArrayLikeObject-83P1fvEs.js";
6
- import { i as _, n as ae, t as v } from "./isEmpty-C2z3Hypl.js";
1
+ import { _ as e, a as t, f as n, g as r, i, o as a, v as o, y as s } from "./translator-DEde7BKz.js";
2
+ import { a as c, o as l } from "./_overRest-CCAbV-eT.js";
3
+ import { A as u, C as d, M as f, S as p, T as m, b as h, x as g } from "./async-slice-Cuekts5f.js";
4
+ import { d as ee, n as te } from "./_Uint8Array-C7apDrb7.js";
5
+ import { n as ne, r as re, t as _ } from "./isArrayLikeObject-H8k6W51O.js";
6
+ import { i as ie, n as ae, t as v } from "./isEmpty-B0Bavg-e.js";
7
7
  //#region ../../node_modules/lodash-es/noop.js
8
8
  function oe() {}
9
9
  //#endregion
@@ -48,8 +48,8 @@ function T(e, t, n, r) {
48
48
  }
49
49
  //#endregion
50
50
  //#region ../../node_modules/lodash-es/_baseIsMatch.js
51
- var se = 1, ce = 2;
52
- function le(e, t, n, r) {
51
+ var E = 1, se = 2;
52
+ function ce(e, t, n, r) {
53
53
  var i = n.length, a = i, o = !r;
54
54
  if (e == null) return !a;
55
55
  for (e = Object(e); i--;) {
@@ -62,53 +62,53 @@ function le(e, t, n, r) {
62
62
  if (o && s[2]) {
63
63
  if (l === void 0 && !(c in e)) return !1;
64
64
  } else {
65
- var d = new ne();
65
+ var d = new te();
66
66
  if (r) var f = r(l, u, c, e, t, d);
67
- if (!(f === void 0 ? m(u, l, se | ce, r, d) : f)) return !1;
67
+ if (!(f === void 0 ? h(u, l, E | se, r, d) : f)) return !1;
68
68
  }
69
69
  }
70
70
  return !0;
71
71
  }
72
72
  //#endregion
73
73
  //#region ../../node_modules/lodash-es/_isStrictComparable.js
74
- function E(t) {
74
+ function D(t) {
75
75
  return t === t && !e(t);
76
76
  }
77
77
  //#endregion
78
78
  //#region ../../node_modules/lodash-es/_getMatchData.js
79
- function ue(e) {
80
- for (var t = u(e), n = t.length; n--;) {
79
+ function le(e) {
80
+ for (var t = f(e), n = t.length; n--;) {
81
81
  var r = t[n], i = e[r];
82
82
  t[n] = [
83
83
  r,
84
84
  i,
85
- E(i)
85
+ D(i)
86
86
  ];
87
87
  }
88
88
  return t;
89
89
  }
90
90
  //#endregion
91
91
  //#region ../../node_modules/lodash-es/_matchesStrictComparable.js
92
- function D(e, t) {
92
+ function O(e, t) {
93
93
  return function(n) {
94
94
  return n != null && n[e] === t && (t !== void 0 || e in Object(n));
95
95
  };
96
96
  }
97
97
  //#endregion
98
98
  //#region ../../node_modules/lodash-es/_baseMatches.js
99
- function O(e) {
100
- var t = ue(e);
101
- return t.length == 1 && t[0][2] ? D(t[0][0], t[0][1]) : function(n) {
102
- return n === e || le(n, e, t);
99
+ function ue(e) {
100
+ var t = le(e);
101
+ return t.length == 1 && t[0][2] ? O(t[0][0], t[0][1]) : function(n) {
102
+ return n === e || ce(n, e, t);
103
103
  };
104
104
  }
105
105
  //#endregion
106
106
  //#region ../../node_modules/lodash-es/_baseMatchesProperty.js
107
107
  var k = 1, A = 2;
108
108
  function j(e, t) {
109
- return n(e) && E(t) ? D(a(e), t) : function(n) {
109
+ return n(e) && D(t) ? O(a(e), t) : function(n) {
110
110
  var r = i(n, e);
111
- return r === void 0 && r === t ? ae(n, e) : m(t, r, k | A);
111
+ return r === void 0 && r === t ? ae(n, e) : h(t, r, k | A);
112
112
  };
113
113
  }
114
114
  //#endregion
@@ -133,19 +133,19 @@ function P(e) {
133
133
  //#endregion
134
134
  //#region ../../node_modules/lodash-es/_baseIteratee.js
135
135
  function F(e) {
136
- return typeof e == "function" ? e : e == null ? l : typeof e == "object" ? o(e) ? j(e[0], e[1]) : O(e) : P(e);
136
+ return typeof e == "function" ? e : e == null ? l : typeof e == "object" ? o(e) ? j(e[0], e[1]) : ue(e) : P(e);
137
137
  }
138
138
  //#endregion
139
139
  //#region ../../node_modules/lodash-es/_baseForOwn.js
140
140
  function I(e, t) {
141
- return e && re(e, t, u);
141
+ return e && ne(e, t, f);
142
142
  }
143
143
  //#endregion
144
144
  //#region ../../node_modules/lodash-es/_createBaseEach.js
145
145
  function L(e, t) {
146
146
  return function(n, r) {
147
147
  if (n == null) return n;
148
- if (!te(n)) return e(n, r);
148
+ if (!ee(n)) return e(n, r);
149
149
  for (var i = n.length, a = t ? i : -1, o = Object(n); (t ? a-- : ++a < i) && r(o[a], a, o) !== !1;);
150
150
  return n;
151
151
  };
@@ -180,7 +180,7 @@ function H(e, t) {
180
180
  //#endregion
181
181
  //#region ../../node_modules/lodash-es/filter.js
182
182
  function U(e, t) {
183
- return (o(e) ? f : H)(e, F(t, 3));
183
+ return (o(e) ? u : H)(e, F(t, 3));
184
184
  }
185
185
  //#endregion
186
186
  //#region ../../node_modules/lodash-es/_baseValues.js
@@ -192,7 +192,7 @@ function de(e, t) {
192
192
  //#endregion
193
193
  //#region ../../node_modules/lodash-es/values.js
194
194
  function W(e) {
195
- return e == null ? [] : de(e, u(e));
195
+ return e == null ? [] : de(e, f(e));
196
196
  }
197
197
  //#endregion
198
198
  //#region ../../node_modules/lodash-es/isUndefined.js
@@ -214,30 +214,30 @@ function K(e, t, n) {
214
214
  }
215
215
  //#endregion
216
216
  //#region ../../node_modules/lodash-es/_createSet.js
217
- var pe = d && 1 / h(new d([, -0]))[1] == Infinity ? function(e) {
218
- return new d(e);
217
+ var pe = m && 1 / g(new m([, -0]))[1] == Infinity ? function(e) {
218
+ return new m(e);
219
219
  } : oe, me = 200;
220
220
  function he(e, t, n) {
221
221
  var r = -1, i = w, a = e.length, o = !0, s = [], c = s;
222
222
  if (n) o = !1, i = z;
223
223
  else if (a >= me) {
224
224
  var l = t ? null : pe(e);
225
- if (l) return h(l);
226
- o = !1, i = p, c = new ee();
225
+ if (l) return g(l);
226
+ o = !1, i = p, c = new d();
227
227
  } else c = t ? [] : s;
228
228
  outer: for (; ++r < a;) {
229
- var u = e[r], d = t ? t(u) : u;
230
- if (u = n || u !== 0 ? u : 0, o && d === d) {
231
- for (var f = c.length; f--;) if (c[f] === d) continue outer;
232
- t && c.push(d), s.push(u);
233
- } else i(c, d, n) || (c !== s && c.push(d), s.push(u));
229
+ var u = e[r], f = t ? t(u) : u;
230
+ if (u = n || u !== 0 ? u : 0, o && f === f) {
231
+ for (var m = c.length; m--;) if (c[m] === f) continue outer;
232
+ t && c.push(f), s.push(u);
233
+ } else i(c, f, n) || (c !== s && c.push(f), s.push(u));
234
234
  }
235
235
  return s;
236
236
  }
237
237
  //#endregion
238
238
  //#region ../../node_modules/lodash-es/union.js
239
- var ge = ie(function(e) {
240
- return he(_(e, 1, g, !0));
239
+ var ge = re(function(e) {
240
+ return he(ie(e, 1, _, !0));
241
241
  }), _e = "\0", q = "\0", J = "", Y = class {
242
242
  constructor(e = {}) {
243
243
  this._isDirected = !Object.prototype.hasOwnProperty.call(e, "directed") || e.directed, this._isMultigraph = Object.prototype.hasOwnProperty.call(e, "multigraph") ? e.multigraph : !1, this._isCompound = Object.prototype.hasOwnProperty.call(e, "compound") ? e.compound : !1, this._label = void 0, this._defaultNodeLabelFn = c(void 0), this._defaultEdgeLabelFn = c(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[q] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
@@ -264,7 +264,7 @@ var ge = ie(function(e) {
264
264
  return this._nodeCount;
265
265
  }
266
266
  nodes() {
267
- return u(this._nodes);
267
+ return f(this._nodes);
268
268
  }
269
269
  sources() {
270
270
  var e = this;
@@ -298,7 +298,7 @@ var ge = ie(function(e) {
298
298
  var t = (e) => this.removeEdge(this._edgeObjs[e]);
299
299
  delete this._nodes[e], this._isCompound && (this._removeFromParentsChildList(e), delete this._parent[e], V(this.children(e), (e) => {
300
300
  this.setParent(e);
301
- }), delete this._children[e]), V(u(this._in[e]), t), delete this._in[e], delete this._preds[e], V(u(this._out[e]), t), delete this._out[e], delete this._sucs[e], --this._nodeCount;
301
+ }), delete this._children[e]), V(f(this._in[e]), t), delete this._in[e], delete this._preds[e], V(f(this._out[e]), t), delete this._out[e], delete this._sucs[e], --this._nodeCount;
302
302
  }
303
303
  return this;
304
304
  }
@@ -324,17 +324,17 @@ var ge = ie(function(e) {
324
324
  children(e) {
325
325
  if (G(e) && (e = q), this._isCompound) {
326
326
  var t = this._children[e];
327
- if (t) return u(t);
327
+ if (t) return f(t);
328
328
  } else if (e === q) return this.nodes();
329
329
  else if (this.hasNode(e)) return [];
330
330
  }
331
331
  predecessors(e) {
332
332
  var t = this._preds[e];
333
- if (t) return u(t);
333
+ if (t) return f(t);
334
334
  }
335
335
  successors(e) {
336
336
  var t = this._sucs[e];
337
- if (t) return u(t);
337
+ if (t) return f(t);
338
338
  }
339
339
  neighbors(e) {
340
340
  var t = this.predecessors(e);
package/dist/hooks.js CHANGED
@@ -1,11 +1,12 @@
1
- import { r as e } from "./i18n-provider-C3SlA4J0.js";
2
- import { l as t, n, o as r, r as i, s as a, t as o, u as s } from "./use-heading-spy-C1KA3PrF.js";
3
- import { L as c, t as l } from "./number.utils-BiBN2hWJ.js";
4
- import { useCallback as u, useMemo as d } from "react";
5
- import { useNavigate as f, useSearchParams as p } from "react-router";
6
- import { createFormatters as m } from "@nxgt/material-core/print-format";
1
+ import { r as e } from "./i18n-provider-Dv9ZSmgO.js";
2
+ import { c as t, d as n, i as r, n as i, r as a, s as o, t as s, u as c } from "./use-heading-spy-XkSExwoT.js";
3
+ import { L as l, t as u } from "./number.utils-BiBN2hWJ.js";
4
+ import { useCallback as d, useEffect as f, useMemo as p, useState as m } from "react";
5
+ import { useNavigate as h, useSearchParams as g } from "react-router";
6
+ import { createFormatters as _ } from "@nxgt/material-core/print-format";
7
+ import { busySettler as v, busySettler as y, createSubmitGuard as b, createSubmitGuard as x } from "@nxgt/material-core/submit-guard";
7
8
  //#region lib/hooks/use-allowed-transitions.ts
8
- function h(e, t, n) {
9
+ function S(e, t, n) {
9
10
  return (t[e] || []).map((e) => {
10
11
  let t = n[e];
11
12
  return t ? {
@@ -16,18 +17,18 @@ function h(e, t, n) {
16
17
  }
17
18
  //#endregion
18
19
  //#region lib/hooks/use-formatters.ts
19
- function g(t = {}) {
20
+ function C(t = {}) {
20
21
  let n = e(), r = t.locale ?? n?.language ?? "en", { timeZone: i } = t;
21
- return d(() => m({
22
+ return p(() => _({
22
23
  locale: r,
23
24
  timeZone: i
24
25
  }), [r, i]);
25
26
  }
26
27
  //#endregion
27
28
  //#region lib/hooks/use-navigation.ts
28
- function _(e, t) {
29
- let n = f();
30
- return u(() => {
29
+ function w(e, t) {
30
+ let n = h();
31
+ return d(() => {
31
32
  n(e, t);
32
33
  }, [
33
34
  n,
@@ -35,21 +36,21 @@ function _(e, t) {
35
36
  t
36
37
  ]);
37
38
  }
38
- function v(e) {
39
- let t = f();
40
- return d(() => e.map(({ to: e, options: n }) => () => {
39
+ function T(e) {
40
+ let t = h();
41
+ return p(() => e.map(({ to: e, options: n }) => () => {
41
42
  t(e, n);
42
43
  }), [t, e]);
43
44
  }
44
45
  //#endregion
45
46
  //#region lib/hooks/use-number-formatter.ts
46
- function y() {
47
- let t = e(), n = u((e, n) => l(e, {
47
+ function E() {
48
+ let t = e(), n = d((e, n) => u(e, {
48
49
  ...n,
49
50
  language: t?.language
50
51
  }), [t?.language]);
51
52
  return {
52
- formatCurrency: u((e, t) => n(e, {
53
+ formatCurrency: d((e, t) => n(e, {
53
54
  ...t,
54
55
  currency: t?.currency,
55
56
  style: t?.currency ? "currency" : void 0
@@ -59,7 +60,7 @@ function y() {
59
60
  }
60
61
  //#endregion
61
62
  //#region lib/hooks/use-options.ts
62
- function b(e, { filter: t, value: n, label: r, expanded: i }) {
63
+ function D(e, { filter: t, value: n, label: r, expanded: i }) {
63
64
  return e.filter((e) => e && (t?.(e) ?? !0)).map((e) => {
64
65
  let t = typeof n == "function" ? n(e) : e[n]?.toString() ?? "", a = "";
65
66
  return a = typeof r == "function" ? r(e) : Array.isArray(r) ? r.map((t) => e[t]).filter(Boolean).join(" ") : e[r]?.toString() ?? "", {
@@ -69,9 +70,9 @@ function b(e, { filter: t, value: n, label: r, expanded: i }) {
69
70
  };
70
71
  });
71
72
  }
72
- function x(e, t) {
73
+ function O(e, t) {
73
74
  let { filter: n, value: r, label: i, expanded: a } = t;
74
- return d(() => b(e, {
75
+ return p(() => D(e, {
75
76
  filter: n,
76
77
  value: r,
77
78
  label: i,
@@ -84,14 +85,25 @@ function x(e, t) {
84
85
  a
85
86
  ]);
86
87
  }
87
- function S(e) {
88
+ function k(e) {
88
89
  return e?.edges?.map((e) => e.node) ?? [];
89
90
  }
90
91
  //#endregion
91
92
  //#region lib/hooks/use-search-param.ts
92
- function C(e) {
93
- let [t, n] = p();
94
- return d(() => t.get(e), [t, e]);
93
+ function A(e) {
94
+ let [t, n] = g();
95
+ return p(() => t.get(e), [t, e]);
95
96
  }
96
97
  //#endregion
97
- export { t as applyResolvedTheme, b as buildOptions, S as extractNode, s as resolveTheme, h as useAllowedTransitions, r as useCspNonce, g as useFormatters, o as useHeadingSpy, c as useIsClient, i as useIsMobile, n as useLocalizedDate, _ as useNavigationHandler, v as useNavigationHandlers, y as useNumberFormatter, x as useOptions, C as useSearchParam, a as useTheme };
98
+ //#region lib/hooks/use-submit-once.ts
99
+ function j(e) {
100
+ let [t] = m(x), [n] = m(() => y(t)), r = e !== void 0;
101
+ return f(() => {
102
+ e !== void 0 && n(e);
103
+ }, [e, n]), d((e, n) => t.once(e, {
104
+ settleSync: !r,
105
+ ...n
106
+ }), [t, r]);
107
+ }
108
+ //#endregion
109
+ export { c as applyResolvedTheme, D as buildOptions, v as busySettler, b as createSubmitGuard, k as extractNode, n as resolveTheme, S as useAllowedTransitions, o as useCspNonce, i as useFocusOnMount, C as useFormatters, s as useHeadingSpy, l as useIsClient, r as useIsMobile, a as useLocalizedDate, w as useNavigationHandler, T as useNavigationHandlers, E as useNumberFormatter, O as useOptions, A as useSearchParam, j as useSubmitOnce, t as useTheme };
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, t as n } from "./stored-language-DPqzxRmf.js";
1
+ import { a as e, i as t, t as n } from "./stored-language-BKoohv2_.js";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
3
  import { createContext as i, useCallback as a, useContext as o, useMemo as s, useState as c } from "react";
4
4
  //#region lib/i18n/i18n-provider.tsx
package/dist/i18n.js CHANGED
@@ -1,9 +1,9 @@
1
- import { a as e, i as t, o as n, r } from "./stored-language-DPqzxRmf.js";
2
- import { n as i, r as a, t as o } from "./i18n-provider-C3SlA4J0.js";
3
- import { n as s, r as c, t as l } from "./translator-DTl9h__E.js";
4
- import { o as u, t as d } from "./merge-CZIEHTTe.js";
5
- import { t as f } from "./translate-material-CqB-j9WD.js";
6
- import { t as p } from "./use-material-translation-DMa4Xrnd.js";
1
+ import { a as e, i as t, o as n, r } from "./stored-language-BKoohv2_.js";
2
+ import { n as i, r as a, t as o } from "./i18n-provider-Dv9ZSmgO.js";
3
+ import { n as s, r as c, t as l } from "./translator-DEde7BKz.js";
4
+ import { o as u, t as d } from "./merge-Js8537dg.js";
5
+ import { t as f } from "./translate-material-CCJg3yfc.js";
6
+ import { t as p } from "./use-material-translation-Cndoq_iK.js";
7
7
  import { useCallback as m } from "react";
8
8
  //#region lib/i18n/merge-resources.ts
9
9
  function h(e, t, n = "") {
@@ -1,6 +1,6 @@
1
- import { x as e } from "./translator-DTl9h__E.js";
2
- import { i as t, o as n, t as r } from "./_overRest-HfSwfmH1.js";
3
- import { d as i } from "./_Uint8Array-CjLUgWgf.js";
1
+ import { x as e } from "./translator-DEde7BKz.js";
2
+ import { i as t, o as n, t as r } from "./_overRest-CCAbV-eT.js";
3
+ import { d as i } from "./_Uint8Array-C7apDrb7.js";
4
4
  //#region ../../node_modules/lodash-es/_baseRest.js
5
5
  function a(e, i) {
6
6
  return t(r(e, i, n), e + "");
@@ -1,6 +1,6 @@
1
- import { C as e, o as t, s as n, v as r } from "./translator-DTl9h__E.js";
2
- import { S as i, j as a, k as o } from "./async-slice-CsE3hkCD.js";
3
- import { a as s, c, d as l, f as u, l as d, p as f, u as p } from "./_Uint8Array-CjLUgWgf.js";
1
+ import { C as e, o as t, s as n, v as r } from "./translator-DEde7BKz.js";
2
+ import { N as i, j as a, w as o } from "./async-slice-Cuekts5f.js";
3
+ import { a as s, c, d as l, f as u, l as d, p as f, u as p } from "./_Uint8Array-C7apDrb7.js";
4
4
  //#region ../../node_modules/lodash-es/_isFlattenable.js
5
5
  var m = e ? e.isConcatSpreadable : void 0;
6
6
  function h(e) {
@@ -9,10 +9,10 @@ function h(e) {
9
9
  //#endregion
10
10
  //#region ../../node_modules/lodash-es/_baseFlatten.js
11
11
  function g(e, t, n, r, i) {
12
- var a = -1, s = e.length;
13
- for (n ||= h, i ||= []; ++a < s;) {
14
- var c = e[a];
15
- t > 0 && n(c) ? t > 1 ? g(c, t - 1, n, r, i) : o(i, c) : r || (i[i.length] = c);
12
+ var o = -1, s = e.length;
13
+ for (n ||= h, i ||= []; ++o < s;) {
14
+ var c = e[o];
15
+ t > 0 && n(c) ? t > 1 ? g(c, t - 1, n, r, i) : a(i, c) : r || (i[i.length] = c);
16
16
  }
17
17
  return i;
18
18
  }
@@ -43,9 +43,9 @@ var b = "[object Map]", x = "[object Set]", S = Object.prototype.hasOwnProperty;
43
43
  function C(e) {
44
44
  if (e == null) return !0;
45
45
  if (l(e) && (r(e) || typeof e == "string" || typeof e.splice == "function" || c(e) || s(e) || d(e))) return !e.length;
46
- var t = i(e);
46
+ var t = o(e);
47
47
  if (t == b || t == x) return !e.size;
48
- if (p(e)) return !a(e).length;
48
+ if (p(e)) return !i(e).length;
49
49
  for (var n in e) if (S.call(e, n)) return !1;
50
50
  return !0;
51
51
  }
@@ -1,4 +1,4 @@
1
- import { ct as e } from "./components-Bkdm6jn6.js";
1
+ import { ct as e } from "./components-CIYQrI45.js";
2
2
  import { t } from "./src-CsLQInsN.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-BAad7w_K.js";
4
4
  import { H as r, U as i, a, c as o, q as s, v as c, w as l, x as u, y as d } from "./chunk-O7XYJQB3-BChweQ_V.js";
@@ -0,0 +1,13 @@
1
+ /** Where a copy stands: nothing to say, on the clipboard, or refused. */
2
+ export type CopyStatus = 'idle' | 'copied' | 'failed';
3
+ /** How long `copied` / `failed` stays before the status is idle again. */
4
+ export declare const COPY_STATUS_RESET_MS = 1500;
5
+ /**
6
+ * Copies a text and remembers the outcome for a moment, for a polite status
7
+ * region to announce: what `CopyButton` and `RecoveryCodes` share. Nothing
8
+ * is set after unmount.
9
+ */
10
+ export declare function useCopyStatus(resetMs?: number): {
11
+ status: CopyStatus;
12
+ copy: (text: string) => Promise<void>;
13
+ };
@@ -0,0 +1,30 @@
1
+ import { ComponentProps } from 'react';
2
+ export type EnrolmentSecretProps = Omit<ComponentProps<'div'>, 'children'> & {
3
+ /** The `otpauth://` URI: the QR code's content and the link's target (a link only for an `otpauth:` scheme). */
4
+ uri: string;
5
+ /** The secret, typed by hand when the code cannot be scanned. */
6
+ secret: string;
7
+ /** Shows the QR code. Default `true`. */
8
+ showQrCode?: boolean;
9
+ /** The QR code's width and height, in pixels. Default `192`. */
10
+ qrSize?: number;
11
+ /** The QR code's accessible name. */
12
+ qrLabel?: string;
13
+ /** The link that opens the URI in an authenticator app on the same device. */
14
+ openAppLabel?: string;
15
+ /** The line before the secret. */
16
+ manualLabel?: string;
17
+ /** Names the group around the secret and its copy button. */
18
+ secretLabel?: string;
19
+ /** The copy button's accessible name. */
20
+ copyLabel?: string;
21
+ /** Announced once the secret is on the clipboard. */
22
+ copiedLabel?: string;
23
+ };
24
+ /**
25
+ * A TOTP enrolment: the QR code of the `otpauth://` URI, the URI as a link
26
+ * (a phone cannot scan its own screen; an authenticator app on it opens the
27
+ * link), and the secret in groups of four, to type or copy. The QR code sits
28
+ * beside the rest when the component is 28rem wide or more, above it on a phone.
29
+ */
30
+ export declare function EnrolmentSecret({ uri, secret, showQrCode, qrSize, qrLabel, openAppLabel, manualLabel, secretLabel, copyLabel, copiedLabel, className, ...props }: EnrolmentSecretProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { groupSecret } from '@nxgt/material-core/two-factor';
2
+ export * from './enrolment-secret';
@@ -0,0 +1,11 @@
1
+ /** The texts an `EnrolmentSecret` shows, each one overridable by a prop. */
2
+ export type EnrolmentSecretLabels = {
3
+ qr: string;
4
+ openApp: string;
5
+ manual: string;
6
+ secret: string;
7
+ copy: string;
8
+ copied: string;
9
+ };
10
+ /** The built-in labels, with the given overrides on top. */
11
+ export declare function useEnrolmentSecretLabels(overrides: Partial<Record<keyof EnrolmentSecretLabels, string | undefined>>): EnrolmentSecretLabels;
@@ -10,6 +10,7 @@ export * from './chip';
10
10
  export * from './code';
11
11
  export * from './count-badge';
12
12
  export * from './description';
13
+ export * from './enrolment-secret';
13
14
  export * from './entity-header';
14
15
  export * from './event-chip';
15
16
  export * from './figure';
@@ -18,6 +19,7 @@ export * from './markdown';
18
19
  export * from './metrics';
19
20
  export * from './param-table';
20
21
  export * from './qrcode';
22
+ export * from './recovery-codes';
21
23
  export * from './stat-card';
22
24
  export * from './status-indicator';
23
25
  export * from './summary-data';
@@ -0,0 +1,4 @@
1
+ export type { DownloadTextOptions, RecoveryCodesTextOptions, } from '@nxgt/material-core/two-factor';
2
+ export { downloadText, recoveryCodesText, } from '@nxgt/material-core/two-factor';
3
+ export * from './recovery-codes';
4
+ export type { RecoveryCodesLabels, RecoveryCodesProps, RecoveryCodesTitleElement, } from './types';
@@ -0,0 +1,14 @@
1
+ import { RecoveryCodesLabels } from '../types';
2
+ type Props = {
3
+ codes: readonly string[];
4
+ labels: RecoveryCodesLabels;
5
+ fileName: string;
6
+ fileHeading: string;
7
+ fileNote?: string;
8
+ };
9
+ /**
10
+ * Copy, download and print. The copy's outcome is announced by a polite
11
+ * status region of its own, so it needs no Toaster mounted.
12
+ */
13
+ export declare function RecoveryCodesActions({ codes, labels, fileName, fileHeading, fileNote, }: Props): import("react").JSX.Element;
14
+ export {};
@@ -0,0 +1,13 @@
1
+ import { RecoveryCodesLabels } from '../types';
2
+ type Props = {
3
+ labels: RecoveryCodesLabels;
4
+ saved?: boolean;
5
+ onSavedChange?: (saved: boolean) => void;
6
+ onDone?: () => void;
7
+ };
8
+ /**
9
+ * "I have saved these codes", then "Done". "Done" before the box is ticked
10
+ * moves the focus to it, marks it invalid and says why under it.
11
+ */
12
+ export declare function RecoveryCodesConfirm({ labels, saved: controlled, onSavedChange, onDone, }: Props): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,5 @@
1
+ /** The codes, one per item, in a grid that never runs off a phone. */
2
+ export declare function RecoveryCodesList({ codes, label, }: {
3
+ codes: readonly string[];
4
+ label: string;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { RecoveryCodesProps } from './types';
2
+ /**
3
+ * One-time recovery codes, shown once: a list, copy, download, print (the
4
+ * card alone), and an "I have saved these codes" confirmation before "Done".
5
+ * Guarding the page against leaving before it is ticked is the app's, with
6
+ * its router: `saved` and `onSavedChange` say when.
7
+ */
8
+ export declare function RecoveryCodes({ codes, title, titleAs, description, warning, focusTitle, fileName, fileHeading, fileNote, onDone, saved, onSavedChange, labels: overrides, className, ...props }: RecoveryCodesProps): import("react").JSX.Element;
@@ -0,0 +1,64 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ /** The heading levels the title may take. */
3
+ export type RecoveryCodesTitleElement = 'h2' | 'h3' | 'h4';
4
+ /** Every built-in string of {@link RecoveryCodes}, each overridable. */
5
+ export type RecoveryCodesLabels = {
6
+ /** Names the list of codes. "Recovery codes". */
7
+ list: string;
8
+ /** The copy button. "Copy codes". */
9
+ copy: string;
10
+ /** Announced once the codes are on the clipboard. "Codes copied". */
11
+ copied: string;
12
+ /** Announced when the clipboard refused them. "Copy failed". */
13
+ copyFailed: string;
14
+ /** The download button. "Download". */
15
+ download: string;
16
+ /** The print button. "Print". */
17
+ print: string;
18
+ /** The confirmation's label. "I have saved these codes". */
19
+ saved: string;
20
+ /** Under the confirmation once "Done" was pressed before it was ticked. */
21
+ savedRequired: string;
22
+ /** The button that calls `onDone`. "Done". */
23
+ done: string;
24
+ };
25
+ export type RecoveryCodesProps = Omit<ComponentProps<'div'>, 'title'> & {
26
+ /** The one-time codes, in the order they are shown and saved. */
27
+ codes: readonly string[];
28
+ /** The card's heading. "Recovery codes" by default. */
29
+ title?: ReactNode;
30
+ /** The heading element; `'h2'` by default. */
31
+ titleAs?: RecoveryCodesTitleElement;
32
+ /** A line under the title. */
33
+ description?: ReactNode;
34
+ /**
35
+ * A warning above the codes; a built-in one by default ("Each code works
36
+ * once…"). `false` hides it. Not printed.
37
+ */
38
+ warning?: ReactNode;
39
+ /**
40
+ * Moves the focus to the title once shown, as the codes replaced what the
41
+ * user acted on. Default `true`.
42
+ */
43
+ focusTitle?: boolean;
44
+ /** The downloaded file's name. Default `"recovery-codes.txt"`. */
45
+ fileName?: string;
46
+ /**
47
+ * The file's first line (the account the codes belong to); the title's
48
+ * text when it is a string, else "Recovery codes".
49
+ */
50
+ fileHeading?: string;
51
+ /** The file's second line; the warning's text when it is a string. */
52
+ fileNote?: string;
53
+ /**
54
+ * Called by the "Done" button, which is shown only when this is given and
55
+ * calls it only once the confirmation is ticked.
56
+ */
57
+ onDone?: () => void;
58
+ /** The confirmation, controlled; uncontrolled when left out. */
59
+ saved?: boolean;
60
+ /** Called when the confirmation is ticked or unticked. */
61
+ onSavedChange?: (saved: boolean) => void;
62
+ /** Overrides for the built-in strings. */
63
+ labels?: Partial<RecoveryCodesLabels>;
64
+ };
@@ -0,0 +1,7 @@
1
+ import { RecoveryCodesLabels } from './types';
2
+ /** The built-in title and warning, and the labels with their overrides. */
3
+ export declare function useRecoveryCodesLabels(overrides?: Partial<RecoveryCodesLabels>): {
4
+ labels: RecoveryCodesLabels;
5
+ title: string;
6
+ warning: string;
7
+ };