@nxgt/material 3.100.1 → 3.103.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 (156) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +32 -2
  3. package/dist/{alert-dialog-DYzxchiS.js → alert-dialog-NFyAiSqc.js} +1 -1
  4. package/dist/{async-slice-drJyPvuM.js → async-slice-D35bX79S.js} +1 -1
  5. package/dist/{bubble-input-CQwVSoU3.js → bubble-input-BxI1WmNs.js} +17 -5
  6. package/dist/{button-GeIsUekU.js → button-Be7GZzF9.js} +2 -2
  7. package/dist/{calculator-BS4PAm6l.js → calculator-BGy1Q7rn.js} +261 -460
  8. package/dist/calculator-field.js +7 -7
  9. package/dist/{calculator-segment-CEdwE24M.js → calculator-segment-uixk6lBg.js} +1 -1
  10. package/dist/calculator.js +1 -1
  11. package/dist/charts.js +3 -3
  12. package/dist/{chip-BdEtFQ85.js → chip-3rWebZEM.js} +2 -2
  13. package/dist/{code-editor-BByXZOGy.js → code-editor-BqSVMfy-.js} +178 -177
  14. package/dist/code-editor.js +5 -5
  15. package/dist/{code-language-items-CSZX5zxD.js → code-language-items-Cf2LJVg2.js} +14 -5
  16. package/dist/components/ui/actions/action-card/action-card-tile.css +47 -0
  17. package/dist/components/ui/display/code/code-moonlight.css +10 -10
  18. package/dist/{components-BrZkSs3O.js → components-D2liJ9Yu.js} +17725 -17287
  19. package/dist/components.js +38 -37
  20. package/dist/{conversion-variant-DTQqAyDt.js → conversion-variant-clFZ6ZMJ.js} +5 -5
  21. package/dist/{currency-field-Dnju7ss2.js → currency-field-CBFEVNM1.js} +24 -23
  22. package/dist/{dialog-5_2__tu8.js → dialog-CrIIINTk.js} +3 -3
  23. package/dist/dnd.js +1 -1
  24. package/dist/{dropdown-menu-FdGC5kIP.js → dropdown-menu-BnfLWu8n.js} +1 -1
  25. package/dist/editor.js +9 -9
  26. package/dist/{empty-state-BoepPG5v.js → empty-state-CuUaCPY7.js} +1 -1
  27. package/dist/{field-blur-DkiZOVNV.js → field-blur-DMJwPLsg.js} +9 -9
  28. package/dist/field-blur-context-3rKussBQ.js +29 -0
  29. package/dist/{financial-variant-BhqJp5C-.js → financial-variant-BY_VCUuk.js} +5 -5
  30. package/dist/{hooks-C8MhL6hs.js → hooks-hHoZbL-4.js} +106 -61
  31. package/dist/hooks.js +6 -6
  32. package/dist/{hover-card-CmHJeBeY.js → hover-card-Do2-uzlF.js} +1 -1
  33. package/dist/i18n.js +3 -3
  34. package/dist/{icon-badge-LGUPQh_c.js → icon-badge-CHaVNEmb.js} +1 -1
  35. package/dist/{icon-button-BSVpO1jP.js → icon-button-BIAubLeJ.js} +1 -1
  36. package/dist/key-layout-D2goCDkD.js +31 -0
  37. package/dist/keypad.js +551 -0
  38. package/dist/label-DR-zZyGQ.js +47 -0
  39. package/dist/lib/components/ui/display/code/code-block-parts.d.ts +1 -1
  40. package/dist/lib/components/ui/display/code/code-block.d.ts +4 -1
  41. package/dist/lib/components/ui/display/code/languages.d.ts +2 -0
  42. package/dist/lib/components/ui/display/code/moonlight-tokens.d.ts +10 -10
  43. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-props.d.ts +73 -0
  44. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-rules.d.ts +12 -0
  45. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog.d.ts +5 -61
  46. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-footer.d.ts +12 -0
  47. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-phrase.d.ts +26 -0
  48. package/dist/lib/components/ui/feedback/confirm-dialog/use-confirm-action.d.ts +1 -1
  49. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  50. package/dist/lib/components/ui/layout/index.d.ts +1 -0
  51. package/dist/lib/components/ui/layout/panel-card/index.d.ts +1 -0
  52. package/dist/lib/components/ui/layout/panel-card/panel-card.d.ts +21 -0
  53. package/dist/lib/components/ui/selection/index.d.ts +1 -0
  54. package/dist/lib/components/ui/selection/status-menu/index.d.ts +3 -0
  55. package/dist/lib/components/ui/selection/status-menu/partials/status-confirm.d.ts +12 -0
  56. package/dist/lib/components/ui/selection/status-menu/partials/status-icon.d.ts +6 -0
  57. package/dist/lib/components/ui/selection/status-menu/partials/status-items.d.ts +18 -0
  58. package/dist/lib/components/ui/selection/status-menu/partials/status-menu-list.d.ts +14 -0
  59. package/dist/lib/components/ui/selection/status-menu/partials/status-sheet-row.d.ts +11 -0
  60. package/dist/lib/components/ui/selection/status-menu/partials/status-sheet.d.ts +21 -0
  61. package/dist/lib/components/ui/selection/status-menu/partials/status-trigger.d.ts +18 -0
  62. package/dist/lib/components/ui/selection/status-menu/status-menu-data.d.ts +12 -0
  63. package/dist/lib/components/ui/selection/status-menu/status-menu-form-field.d.ts +20 -0
  64. package/dist/lib/components/ui/selection/status-menu/status-menu.d.ts +13 -0
  65. package/dist/lib/components/ui/selection/status-menu/types.d.ts +76 -0
  66. package/dist/lib/components/ui/selection/status-menu/use-status-change.d.ts +18 -0
  67. package/dist/lib/components/ui/selection/status-menu/use-status-menu.d.ts +30 -0
  68. package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +1 -5
  69. package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +3 -49
  70. package/dist/lib/components/ui/widgets/keypad/cash-model.d.ts +16 -0
  71. package/dist/lib/components/ui/widgets/keypad/index.d.ts +5 -0
  72. package/dist/lib/components/ui/widgets/keypad/key-layout.d.ts +56 -0
  73. package/dist/lib/components/ui/widgets/keypad/keypad-binding.d.ts +32 -0
  74. package/dist/lib/components/ui/widgets/keypad/keypad-cash.d.ts +28 -0
  75. package/dist/lib/components/ui/widgets/keypad/keypad-display.d.ts +11 -0
  76. package/dist/lib/components/ui/widgets/keypad/keypad-entry.d.ts +39 -0
  77. package/dist/lib/components/ui/widgets/keypad/keypad-grid.d.ts +27 -0
  78. package/dist/lib/components/ui/widgets/{calculator/partials/calculator-key.d.ts → keypad/keypad-key.d.ts} +6 -3
  79. package/dist/lib/components/ui/widgets/keypad/keypad-layout.d.ts +19 -0
  80. package/dist/lib/components/ui/widgets/{calculator/partials → keypad}/keypad-navigation.d.ts +1 -1
  81. package/dist/lib/components/ui/widgets/keypad/keypad.d.ts +9 -0
  82. package/dist/lib/components/ui/widgets/keypad/keypad.types.d.ts +91 -0
  83. package/dist/lib/components/ui/widgets/keypad/use-keypad-cash.d.ts +14 -0
  84. package/dist/lib/components/ui/widgets/keypad/use-keypad-keyboard.d.ts +7 -0
  85. package/dist/lib/components/ui/widgets/keypad/use-keypad-number.d.ts +10 -0
  86. package/dist/lib/components/ui/widgets/keypad/use-keypad-quantity.d.ts +16 -0
  87. package/dist/lib/components/ui/widgets/keypad/use-keypad-value.d.ts +17 -0
  88. package/dist/lib/components/ui/widgets/keypad/use-keypad.d.ts +23 -0
  89. package/dist/lib/hooks/index.d.ts +2 -0
  90. package/dist/lib/hooks/use-barcode-scanner.d.ts +39 -0
  91. package/dist/lib/hooks/use-latched.d.ts +18 -0
  92. package/dist/lib/i18n/resources/en/en.d.ts +25 -0
  93. package/dist/lib/i18n/resources/en/material.json.d.ts +26 -1
  94. package/dist/lib/i18n/resources/fr/fr.d.ts +25 -0
  95. package/dist/lib/i18n/resources/fr/material.json.d.ts +26 -1
  96. package/dist/lib/i18n/resources/resources.d.ts +50 -0
  97. package/dist/lib/i18n/translator.d.ts +1 -1
  98. package/dist/lib/keypad/index.d.ts +20 -0
  99. package/dist/lib.js +1 -1
  100. package/dist/main.js +54 -53
  101. package/dist/map.js +9 -9
  102. package/dist/material.css +1 -1
  103. package/dist/pdf-reader.js +1 -1
  104. package/dist/{percent-field-DGlU_xii.js → percent-field-DU8eIMD3.js} +15 -14
  105. package/dist/{picker-surface-CGhqNR8a.js → picker-surface-XmA--JVI.js} +4 -4
  106. package/dist/{popover-ZxL7ktKk.js → popover-D8iHiAbl.js} +1 -1
  107. package/dist/{pos-types-BQ0QpYMp.js → pos-types-BEAY27Rm.js} +1 -1
  108. package/dist/{pos-variant-CKy8h_5i.js → pos-variant-ClGI92Lt.js} +25 -25
  109. package/dist/print.js +1 -1
  110. package/dist/{programmer-variant-CbHstE28.js → programmer-variant-Boq2O8hB.js} +30 -30
  111. package/dist/{public-D-tdOz4b.js → public-DOrXKmcL.js} +9 -9
  112. package/dist/{rich-code-block-CTPj1LuD.js → rich-code-block-Djj2XE_u.js} +18 -18
  113. package/dist/{scientific-variant-B8U9h3II.js → scientific-variant-BzF_aMQP.js} +8 -8
  114. package/dist/{sortable-provider-CSoWE7Ce.js → sortable-provider-DCZjsIIH.js} +2 -2
  115. package/dist/{spinner-ffuwBXHl.js → spinner-Cg0y_E_K.js} +1 -1
  116. package/dist/standard-layout-DTr9yy8Z.js +48 -0
  117. package/dist/{tabs-JgRq6ZJx.js → tabs-DpessV5s.js} +1 -1
  118. package/dist/{text-field-DURkIP-v.js → text-field-Dxk9lAKM.js} +16 -15
  119. package/dist/theme-picker.js +13 -13
  120. package/dist/{theme-toggle-n_Zg7JAA.js → theme-toggle-B6Jl5Kfn.js} +1 -1
  121. package/dist/{toolbar-items-IANZdcw4.js → toolbar-items-Cs1XrZsH.js} +4 -4
  122. package/dist/{translate-material-CMHUH5Ha.js → translate-material-Du0j0t97.js} +1 -1
  123. package/dist/{translator-9zA-Um3W.js → translator-BVs4n0Fz.js} +52 -2
  124. package/dist/use-calculator-keyboard-BZ1CA4Ut.js +222 -0
  125. package/dist/{use-chat-composer-BoIN7RCA.js → use-chat-composer-B4m3OEm1.js} +241 -240
  126. package/dist/{use-heading-spy-8o20PEZH.js → use-heading-spy-CO3_AtY9.js} +240 -142
  127. package/dist/{use-material-translation-CLNaMhUf.js → use-material-translation-uNc1FyC8.js} +1 -1
  128. package/dist/{use-return-focus-DWhbTGVe.js → use-return-focus-AfLRrUm-.js} +1 -1
  129. package/docs/README.md +1 -0
  130. package/docs/components/README.md +1 -0
  131. package/docs/components/buttons-and-actions.md +34 -2
  132. package/docs/components/data-display.md +4 -1
  133. package/docs/components/feedback-and-status.md +34 -0
  134. package/docs/components/navigation-and-layout.md +28 -0
  135. package/docs/components/rich-widgets.md +28 -0
  136. package/docs/components/selection-and-choice.md +120 -0
  137. package/docs/guides/calculator.md +1 -1
  138. package/docs/guides/cards-and-tiles.md +21 -24
  139. package/docs/guides/forms.md +1 -0
  140. package/docs/guides/helpers.md +78 -0
  141. package/docs/guides/keypad.md +225 -0
  142. package/docs/previews/data-display-codeblock.webp +0 -0
  143. package/docs/previews/data-display-codegroup.webp +0 -0
  144. package/docs/previews/data-display-jsonviewer.webp +0 -0
  145. package/docs/previews/navigation-layout-panelcard.webp +0 -0
  146. package/docs/previews/rich-widgets-keypad.webp +0 -0
  147. package/docs/previews/selection-choice-statusmenu.webp +0 -0
  148. package/docs/roadmap.md +21 -0
  149. package/docs/troubleshooting.md +63 -0
  150. package/lib/components/ui/actions/action-card/action-card-tile.css +47 -0
  151. package/lib/components/ui/display/code/code-moonlight.css +10 -10
  152. package/lib/components/ui/widgets/calculator/calculator.css +87 -0
  153. package/package.json +7 -2
  154. package/dist/field-blur-context-BLGgf_3z.js +0 -73
  155. package/dist/key-layout-cR79xfGE.js +0 -38
  156. package/dist/standard-layout-BuSRr3TY.js +0 -40
@@ -1,14 +1,16 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
- import { a as t, c as n, d as r, i, n as a, r as o, t as s, u as c } from "./alert-dialog-DYzxchiS.js";
3
- import { a as l } from "./button-GeIsUekU.js";
4
- import { i as u } from "./translate-material-CMHUH5Ha.js";
5
- import { t as d } from "./use-material-translation-CLNaMhUf.js";
6
- import { _ as f, g as p, h as m, t as h, v as g, y as _ } from "./date.utils-JTEIo3mM.js";
7
- import { useCallback as v, useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
8
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
9
- import { busySettler as E, busySettler as D, createSubmitGuard as O, createSubmitGuard as k } from "@nxgt/material-core/submit-guard";
2
+ import { a as t, c as n, d as r, i, n as a, r as o, t as s, u as c } from "./alert-dialog-NFyAiSqc.js";
3
+ import { t as l } from "./label-DR-zZyGQ.js";
4
+ import { a as u } from "./button-Be7GZzF9.js";
5
+ import { i as d } from "./translate-material-Du0j0t97.js";
6
+ import { t as f } from "./use-material-translation-uNc1FyC8.js";
7
+ import { _ as p, g as m, h, t as g, v as _, y as v } from "./date.utils-JTEIo3mM.js";
8
+ import { t as y } from "./input-CC2joTjB.js";
9
+ import { useCallback as b, useEffect as x, useId as S, useMemo as C, useRef as w, useState as T } from "react";
10
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
11
+ import { busySettler as k, busySettler as A, createSubmitGuard as j, createSubmitGuard as ee } from "@nxgt/material-core/submit-guard";
10
12
  //#region ../../node_modules/date-fns/locale/fr/_lib/formatDistance.js
11
- var A = {
13
+ var te = {
12
14
  lessThanXSeconds: {
13
15
  one: "moins d’une seconde",
14
16
  other: "moins de {{count}} secondes"
@@ -70,11 +72,11 @@ var A = {
70
72
  one: "presqu’un an",
71
73
  other: "presque {{count}} ans"
72
74
  }
73
- }, j = (e, t, n) => {
74
- let r, i = A[e];
75
+ }, ne = (e, t, n) => {
76
+ let r, i = te[e];
75
77
  return r = typeof i == "string" ? i : t === 1 ? i.one : i.other.replace("{{count}}", String(t)), n?.addSuffix ? n.comparison && n.comparison > 0 ? "dans " + r : "il y a " + r : r;
76
- }, M = {
77
- date: _({
78
+ }, re = {
79
+ date: v({
78
80
  formats: {
79
81
  full: "EEEE d MMMM y",
80
82
  long: "d MMMM y",
@@ -83,7 +85,7 @@ var A = {
83
85
  },
84
86
  defaultWidth: "full"
85
87
  }),
86
- time: _({
88
+ time: v({
87
89
  formats: {
88
90
  full: "HH:mm:ss zzzz",
89
91
  long: "HH:mm:ss z",
@@ -92,7 +94,7 @@ var A = {
92
94
  },
93
95
  defaultWidth: "full"
94
96
  }),
95
- dateTime: _({
97
+ dateTime: v({
96
98
  formats: {
97
99
  full: "{{date}} 'à' {{time}}",
98
100
  long: "{{date}} 'à' {{time}}",
@@ -101,18 +103,18 @@ var A = {
101
103
  },
102
104
  defaultWidth: "full"
103
105
  })
104
- }, N = {
106
+ }, M = {
105
107
  lastWeek: "eeee 'dernier à' p",
106
108
  yesterday: "'hier à' p",
107
109
  today: "'aujourd’hui à' p",
108
110
  tomorrow: "'demain à' p'",
109
111
  nextWeek: "eeee 'prochain à' p",
110
112
  other: "P"
111
- }, P = (e, t, n, r) => N[e], ee = {
113
+ }, N = (e, t, n, r) => M[e], P = {
112
114
  narrow: ["av. J.-C", "ap. J.-C"],
113
115
  abbreviated: ["av. J.-C", "ap. J.-C"],
114
116
  wide: ["avant Jésus-Christ", "après Jésus-Christ"]
115
- }, te = {
117
+ }, F = {
116
118
  narrow: [
117
119
  "T1",
118
120
  "T2",
@@ -131,7 +133,7 @@ var A = {
131
133
  "3ème trimestre",
132
134
  "4ème trimestre"
133
135
  ]
134
- }, F = {
136
+ }, I = {
135
137
  narrow: [
136
138
  "J",
137
139
  "F",
@@ -174,7 +176,7 @@ var A = {
174
176
  "novembre",
175
177
  "décembre"
176
178
  ]
177
- }, I = {
179
+ }, L = {
178
180
  narrow: [
179
181
  "D",
180
182
  "L",
@@ -211,7 +213,7 @@ var A = {
211
213
  "vendredi",
212
214
  "samedi"
213
215
  ]
214
- }, L = {
216
+ }, R = {
215
217
  narrow: {
216
218
  am: "AM",
217
219
  pm: "PM",
@@ -242,7 +244,7 @@ var A = {
242
244
  evening: "du soir",
243
245
  night: "du matin"
244
246
  }
245
- }, R = (e, t) => {
247
+ }, z = (e, t) => {
246
248
  let n = Number(e), r = t?.unit;
247
249
  if (n === 0) return "0";
248
250
  let i = [
@@ -253,48 +255,48 @@ var A = {
253
255
  "second"
254
256
  ], a;
255
257
  return a = n === 1 ? r && i.includes(r) ? "ère" : "er" : "ème", n + a;
256
- }, z = ["MMM", "MMMM"], B = {
257
- en: m,
258
+ }, B = ["MMM", "MMMM"], V = {
259
+ en: h,
258
260
  fr: {
259
261
  code: "fr",
260
- formatDistance: j,
261
- formatLong: M,
262
- formatRelative: P,
262
+ formatDistance: ne,
263
+ formatLong: re,
264
+ formatRelative: N,
263
265
  localize: {
264
- preprocessor: (e, t) => e.getDate() === 1 || !t.some((e) => e.isToken && z.includes(e.value)) ? t : t.map((e) => e.isToken && e.value === "do" ? {
266
+ preprocessor: (e, t) => e.getDate() === 1 || !t.some((e) => e.isToken && B.includes(e.value)) ? t : t.map((e) => e.isToken && e.value === "do" ? {
265
267
  isToken: !0,
266
268
  value: "d"
267
269
  } : e),
268
- ordinalNumber: R,
269
- era: g({
270
- values: ee,
270
+ ordinalNumber: z,
271
+ era: _({
272
+ values: P,
271
273
  defaultWidth: "wide"
272
274
  }),
273
- quarter: g({
274
- values: te,
275
+ quarter: _({
276
+ values: F,
275
277
  defaultWidth: "wide",
276
278
  argumentCallback: (e) => e - 1
277
279
  }),
278
- month: g({
279
- values: F,
280
- defaultWidth: "wide"
281
- }),
282
- day: g({
280
+ month: _({
283
281
  values: I,
284
282
  defaultWidth: "wide"
285
283
  }),
286
- dayPeriod: g({
284
+ day: _({
287
285
  values: L,
288
286
  defaultWidth: "wide"
287
+ }),
288
+ dayPeriod: _({
289
+ values: R,
290
+ defaultWidth: "wide"
289
291
  })
290
292
  },
291
293
  match: {
292
- ordinalNumber: p({
294
+ ordinalNumber: m({
293
295
  matchPattern: /^(\d+)(ième|ère|ème|er|e)?/i,
294
296
  parsePattern: /\d+/i,
295
297
  valueCallback: (e) => parseInt(e)
296
298
  }),
297
- era: f({
299
+ era: p({
298
300
  matchPatterns: {
299
301
  narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
300
302
  abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
@@ -304,7 +306,7 @@ var A = {
304
306
  parsePatterns: { any: [/^av/i, /^ap/i] },
305
307
  defaultParseWidth: "any"
306
308
  }),
307
- quarter: f({
309
+ quarter: p({
308
310
  matchPatterns: {
309
311
  narrow: /^T?[1234]/i,
310
312
  abbreviated: /^[1234](er|ème|e)? trim\.?/i,
@@ -320,7 +322,7 @@ var A = {
320
322
  defaultParseWidth: "any",
321
323
  valueCallback: (e) => e + 1
322
324
  }),
323
- month: f({
325
+ month: p({
324
326
  matchPatterns: {
325
327
  narrow: /^[jfmasond]/i,
326
328
  abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
@@ -359,7 +361,7 @@ var A = {
359
361
  },
360
362
  defaultParseWidth: "any"
361
363
  }),
362
- day: f({
364
+ day: p({
363
365
  matchPatterns: {
364
366
  narrow: /^[lmjvsd]/i,
365
367
  short: /^(di|lu|ma|me|je|ve|sa)/i,
@@ -389,7 +391,7 @@ var A = {
389
391
  },
390
392
  defaultParseWidth: "any"
391
393
  }),
392
- dayPeriod: f({
394
+ dayPeriod: p({
393
395
  matchPatterns: {
394
396
  narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
395
397
  any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
@@ -414,29 +416,29 @@ var A = {
414
416
  }
415
417
  }
416
418
  };
417
- function V() {
418
- let e = u()?.language ?? "en", t = b(() => B[e] ?? m, [e]);
419
+ function H() {
420
+ let e = d()?.language ?? "en", t = C(() => V[e] ?? h, [e]);
419
421
  return {
420
422
  language: e,
421
423
  locale: t,
422
- format: v((e, n) => h.format(e, n, t), [t])
424
+ format: b((e, n) => g.format(e, n, t), [t])
423
425
  };
424
426
  }
425
427
  //#endregion
426
428
  //#region lib/components/ui/feedback/alert-dialog/alert-dialog-actions.tsx
427
- function H({ className: t, ...n }) {
428
- return /* @__PURE__ */ w(c, {
429
- className: e(l({
429
+ function U({ className: t, ...n }) {
430
+ return /* @__PURE__ */ D(c, {
431
+ className: e(u({
430
432
  variant: n.variant,
431
433
  color: n.color
432
434
  }), t),
433
435
  ...n
434
436
  });
435
437
  }
436
- function U({ className: t, ...n }) {
437
- return /* @__PURE__ */ w(r, {
438
+ function W({ className: t, ...n }) {
439
+ return /* @__PURE__ */ D(r, {
438
440
  "data-variant": n.variant ?? "tonal",
439
- className: e(l({
441
+ className: e(u({
440
442
  variant: n.variant ?? "tonal",
441
443
  color: n.color
442
444
  }), t),
@@ -444,65 +446,75 @@ function U({ className: t, ...n }) {
444
446
  });
445
447
  }
446
448
  //#endregion
449
+ //#region lib/hooks/use-latched.ts
450
+ function G(e) {
451
+ let t = w(e);
452
+ return e != null && (t.current = e), t.current;
453
+ }
454
+ function K(e, t) {
455
+ let n = w(t);
456
+ return e && (n.current = t), e ? t : n.current;
457
+ }
458
+ //#endregion
447
459
  //#region lib/components/ui/feedback/confirm-dialog/action-refusal.ts
448
- var W = class extends Error {
460
+ var q = class extends Error {
449
461
  action;
450
462
  details;
451
463
  constructor(e, t) {
452
464
  super(e), this.name = "ActionRefusal", this.action = t.action, this.details = t.details;
453
465
  }
454
466
  };
455
- function G(e) {
456
- return e instanceof W || e instanceof Error && e.name === "ActionRefusal" && typeof e.action?.label == "string";
467
+ function J(e) {
468
+ return e instanceof q || e instanceof Error && e.name === "ActionRefusal" && typeof e.action?.label == "string";
457
469
  }
458
- function K(e) {
459
- return G(e) ? e.action : void 0;
470
+ function Y(e) {
471
+ return J(e) ? e.action : void 0;
460
472
  }
461
473
  //#endregion
462
474
  //#region lib/components/ui/feedback/confirm-dialog/confirm-refusal.tsx
463
- var q = "font-medium text-inherit underline underline-offset-2";
464
- function J({ action: e, close: t }) {
465
- return e.href && !e.onAction ? /* @__PURE__ */ w("a", {
466
- className: q,
475
+ var X = "font-medium text-inherit underline underline-offset-2";
476
+ function ie({ action: e, close: t }) {
477
+ return e.href && !e.onAction ? /* @__PURE__ */ D("a", {
478
+ className: X,
467
479
  href: e.href,
468
480
  onClick: t,
469
481
  children: e.label
470
- }) : /* @__PURE__ */ w("button", {
482
+ }) : /* @__PURE__ */ D("button", {
471
483
  type: "button",
472
- className: q,
484
+ className: X,
473
485
  onClick: () => {
474
486
  e.onAction?.(), t();
475
487
  },
476
488
  children: e.label
477
489
  });
478
490
  }
479
- function Y({ message: e, cause: t, close: n }) {
480
- return G(t) ? /* @__PURE__ */ T("div", {
491
+ function ae({ message: e, cause: t, close: n }) {
492
+ return J(t) ? /* @__PURE__ */ O("div", {
481
493
  className: "flex flex-col gap-1",
482
494
  children: [
483
- /* @__PURE__ */ w("span", { children: e }),
484
- t.details != null && /* @__PURE__ */ w("span", {
495
+ /* @__PURE__ */ D("span", { children: e }),
496
+ t.details != null && /* @__PURE__ */ D("span", {
485
497
  className: "text-muted-foreground",
486
498
  children: t.details
487
499
  }),
488
- /* @__PURE__ */ w("span", { children: /* @__PURE__ */ w(J, {
500
+ /* @__PURE__ */ D("span", { children: /* @__PURE__ */ D(ie, {
489
501
  action: t.action,
490
502
  close: n
491
503
  }) })
492
504
  ]
493
- }) : /* @__PURE__ */ w(C, { children: e });
505
+ }) : /* @__PURE__ */ D(E, { children: e });
494
506
  }
495
507
  //#endregion
496
508
  //#region lib/components/ui/feedback/confirm-dialog/confirm-alert.tsx
497
- function X({ message: e, cause: t, close: n, refusal: r }) {
498
- return /* @__PURE__ */ w("div", {
509
+ function oe({ message: e, cause: t, close: n, refusal: r }) {
510
+ return /* @__PURE__ */ D("div", {
499
511
  role: "alert",
500
512
  className: "text-sm text-error-text",
501
513
  children: r ? r({
502
514
  message: e,
503
515
  cause: t,
504
516
  close: n
505
- }) : /* @__PURE__ */ w(Y, {
517
+ }) : /* @__PURE__ */ D(ae, {
506
518
  message: e,
507
519
  cause: t,
508
520
  close: n
@@ -511,28 +523,97 @@ function X({ message: e, cause: t, close: n, refusal: r }) {
511
523
  }
512
524
  //#endregion
513
525
  //#region lib/components/ui/feedback/confirm-dialog/confirm-description.tsx
514
- function Z({ children: e, details: t }) {
515
- return typeof e == "string" && t == null ? /* @__PURE__ */ w(o, { children: e }) : /* @__PURE__ */ w(o, {
526
+ function se({ children: e, details: t }) {
527
+ return typeof e == "string" && t == null ? /* @__PURE__ */ D(o, { children: e }) : /* @__PURE__ */ D(o, {
516
528
  asChild: !0,
517
- children: /* @__PURE__ */ w("div", {
529
+ children: /* @__PURE__ */ D("div", {
518
530
  className: "space-y-2",
519
- children: t == null ? e : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", { children: e }), /* @__PURE__ */ w("div", { children: t })] })
531
+ children: t == null ? e : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("div", { children: e }), /* @__PURE__ */ D("div", { children: t })] })
520
532
  })
521
533
  });
522
534
  }
523
535
  //#endregion
524
536
  //#region lib/components/ui/feedback/confirm-dialog/confirm-dialog-rules.ts
525
- function ne(e) {
537
+ function ce(e) {
526
538
  return e === "destructive" ? "max-sm:flex-col" : void 0;
527
539
  }
528
- function re({ busy: e, confirmDisabled: t, lockOnRefusal: n, error: r }) {
540
+ function le({ busy: e, confirmDisabled: t, lockOnRefusal: n, error: r }) {
529
541
  return e || !!t || !!n && !!r;
530
542
  }
543
+ function ue(e, t, n = "exact") {
544
+ if (t === "") return !0;
545
+ if (n === "exact") return e === t;
546
+ let r = e.trim(), i = t.trim();
547
+ return n === "trim" ? r === i : r.toLowerCase() === i.toLowerCase();
548
+ }
549
+ //#endregion
550
+ //#region lib/components/ui/feedback/confirm-dialog/confirm-footer.tsx
551
+ function de({ variant: e, busy: t, disabled: n, cancelLabel: r, confirmLabel: a, cancelVariant: o, onConfirm: s }) {
552
+ let { t: c } = f();
553
+ return /* @__PURE__ */ O(i, {
554
+ className: ce(e),
555
+ children: [/* @__PURE__ */ D(W, {
556
+ disabled: t,
557
+ variant: o,
558
+ children: r ?? c("material.confirm-dialog.cancel", "Cancel")
559
+ }), /* @__PURE__ */ D(U, {
560
+ onClick: s,
561
+ color: e === "destructive" ? "error" : "primary",
562
+ disabled: n,
563
+ children: t ? c("material.confirm-dialog.processing", "Processing...") : a ?? c("material.confirm-dialog.confirm", "Confirm")
564
+ })]
565
+ });
566
+ }
567
+ //#endregion
568
+ //#region lib/components/ui/feedback/confirm-dialog/confirm-phrase.tsx
569
+ var Z = "\0phrase\0";
570
+ function fe({ phrase: e, value: t, onValueChange: n, onEnter: r, disabled: i, inputRef: a }) {
571
+ let { t: o } = f(), s = S(), [c, u = ""] = o("material.confirm-dialog.type-phrase", "Type {phrase} to confirm", { phrase: Z }).split(Z);
572
+ return /* @__PURE__ */ O("div", {
573
+ className: "grid gap-2",
574
+ "data-slot": "confirm-phrase",
575
+ children: [/* @__PURE__ */ O(l, {
576
+ htmlFor: s,
577
+ children: [
578
+ c,
579
+ /* @__PURE__ */ D("code", {
580
+ className: "rounded bg-muted px-1 py-0.5 font-mono text-sm select-all",
581
+ children: e
582
+ }),
583
+ u
584
+ ]
585
+ }), /* @__PURE__ */ D(y, {
586
+ id: s,
587
+ ref: a,
588
+ value: t,
589
+ disabled: i,
590
+ autoComplete: "off",
591
+ autoCapitalize: "off",
592
+ autoCorrect: "off",
593
+ spellCheck: !1,
594
+ onChange: (e) => n(e.target.value),
595
+ onKeyDown: (e) => {
596
+ e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), r());
597
+ }
598
+ })]
599
+ });
600
+ }
601
+ function pe(e, t, n) {
602
+ let r = w(null), [i, a] = T("");
603
+ return x(() => {
604
+ e || a("");
605
+ }, [e]), {
606
+ ref: r,
607
+ typed: i,
608
+ setTyped: a,
609
+ missing: !!t && !ue(i, t ?? "", n)
610
+ };
611
+ }
531
612
  //#endregion
532
613
  //#region lib/components/ui/feedback/confirm-dialog/use-confirm-action.ts
533
- function ie({ open: e, onOpenChange: t, onConfirm: n }) {
534
- let { t: r } = d(), [i, a] = S(!1), [o, s] = S(null), [c, l] = S(null);
535
- return y(() => {
614
+ function me({ open: e, onOpenChange: t, onConfirm: n }) {
615
+ let { t: r } = f(), [i, a] = T(!1), [o, s] = T(null), [c, l] = T(null);
616
+ return x(() => {
536
617
  e || (s(null), l(null));
537
618
  }, [e]), {
538
619
  pending: i,
@@ -553,9 +634,9 @@ function ie({ open: e, onOpenChange: t, onConfirm: n }) {
553
634
  }
554
635
  };
555
636
  }
556
- function ae(e) {
557
- let t = x(null);
558
- return y(() => {
637
+ function he(e) {
638
+ let t = w(null);
639
+ return x(() => {
559
640
  let n = t.current;
560
641
  if (!e || !n) return;
561
642
  let r = document.activeElement;
@@ -564,46 +645,63 @@ function ae(e) {
564
645
  }
565
646
  //#endregion
566
647
  //#region lib/components/ui/feedback/confirm-dialog/confirm-dialog.tsx
567
- function Q({ open: e, onOpenChange: r, title: o, description: c, details: l, confirmLabel: u, cancelLabel: f, cancelVariant: p, onConfirm: m, variant: h = "default", loading: g = !1, confirmDisabled: _, lockOnRefusal: v, refusal: y, onCloseAutoFocus: b }) {
568
- let { t: x } = d(), { pending: S, error: C, cause: E, handleOpenChange: D, handleConfirm: O } = ie({
569
- open: e,
570
- onOpenChange: r,
571
- onConfirm: m
572
- }), k = g || S;
573
- return /* @__PURE__ */ w(s, {
574
- open: e,
575
- onOpenChange: D,
576
- children: /* @__PURE__ */ T(a, {
577
- ref: ae(S),
578
- onCloseAutoFocus: b,
648
+ function Q(e) {
649
+ let { open: r, onOpenChange: i, onConfirm: o, loading: c = !1 } = e, l = K(r, {
650
+ title: e.title,
651
+ description: e.description,
652
+ details: e.details,
653
+ confirmLabel: e.confirmLabel,
654
+ cancelLabel: e.cancelLabel,
655
+ variant: e.variant ?? "default",
656
+ confirmPhrase: e.confirmPhrase
657
+ }), { pending: u, error: d, cause: f, handleOpenChange: p, handleConfirm: m } = me({
658
+ open: r,
659
+ onOpenChange: i,
660
+ onConfirm: o
661
+ }), h = c || u, g = he(u), _ = pe(r, l.confirmPhrase, e.confirmPhraseMatch ?? "exact"), v = le({
662
+ busy: h,
663
+ confirmDisabled: e.confirmDisabled || _.missing,
664
+ lockOnRefusal: e.lockOnRefusal,
665
+ error: d
666
+ });
667
+ return /* @__PURE__ */ D(s, {
668
+ open: r,
669
+ onOpenChange: p,
670
+ children: /* @__PURE__ */ O(a, {
671
+ ref: g,
672
+ onOpenAutoFocus: (e) => {
673
+ _.ref.current && (e.preventDefault(), _.ref.current.focus());
674
+ },
675
+ onCloseAutoFocus: e.onCloseAutoFocus,
579
676
  children: [
580
- /* @__PURE__ */ T(t, { children: [/* @__PURE__ */ w(n, { children: o }), /* @__PURE__ */ w(Z, {
581
- details: l,
582
- children: c
677
+ /* @__PURE__ */ O(t, { children: [/* @__PURE__ */ D(n, { children: l.title }), /* @__PURE__ */ D(se, {
678
+ details: l.details,
679
+ children: l.description
583
680
  })] }),
584
- C && /* @__PURE__ */ w(X, {
585
- message: C,
586
- cause: E,
587
- close: () => r(!1),
588
- refusal: y
681
+ l.confirmPhrase && /* @__PURE__ */ D(fe, {
682
+ phrase: l.confirmPhrase,
683
+ value: _.typed,
684
+ onValueChange: _.setTyped,
685
+ onEnter: () => {
686
+ v || m({ preventDefault() {} });
687
+ },
688
+ disabled: h,
689
+ inputRef: _.ref
690
+ }),
691
+ d && /* @__PURE__ */ D(oe, {
692
+ message: d,
693
+ cause: f,
694
+ close: () => i(!1),
695
+ refusal: e.refusal
589
696
  }),
590
- /* @__PURE__ */ T(i, {
591
- className: ne(h),
592
- children: [/* @__PURE__ */ w(U, {
593
- disabled: k,
594
- variant: p,
595
- children: f ?? x("material.confirm-dialog.cancel", "Cancel")
596
- }), /* @__PURE__ */ w(H, {
597
- onClick: O,
598
- color: h === "destructive" ? "error" : "primary",
599
- disabled: re({
600
- busy: k,
601
- confirmDisabled: _,
602
- lockOnRefusal: v,
603
- error: C
604
- }),
605
- children: k ? x("material.confirm-dialog.processing", "Processing...") : u ?? x("material.confirm-dialog.confirm", "Confirm")
606
- })]
697
+ /* @__PURE__ */ D(de, {
698
+ variant: l.variant,
699
+ busy: h,
700
+ disabled: v,
701
+ cancelLabel: l.cancelLabel,
702
+ confirmLabel: l.confirmLabel,
703
+ cancelVariant: e.cancelVariant,
704
+ onConfirm: m
607
705
  })
608
706
  ]
609
707
  })
@@ -611,38 +709,38 @@ function Q({ open: e, onOpenChange: r, title: o, description: c, details: l, con
611
709
  }
612
710
  //#endregion
613
711
  //#region lib/hooks/use-focus-on-mount.ts
614
- function oe(e = !0) {
615
- let t = x(null);
616
- return y(() => {
712
+ function ge(e = !0) {
713
+ let t = w(null);
714
+ return x(() => {
617
715
  e && t.current?.focus();
618
716
  }, [e]), t;
619
717
  }
620
718
  //#endregion
621
719
  //#region lib/hooks/use-submit-once.ts
622
720
  function $(e) {
623
- let [t] = S(O), [n] = S(() => E(t)), r = e !== void 0;
624
- return y(() => {
721
+ let [t] = T(j), [n] = T(() => k(t)), r = e !== void 0;
722
+ return x(() => {
625
723
  e !== void 0 && n(e);
626
- }, [e, n]), v((e, n) => t.once(e, {
724
+ }, [e, n]), b((e, n) => t.once(e, {
627
725
  settleSync: !r,
628
726
  ...n
629
727
  }), [t, r]);
630
728
  }
631
729
  //#endregion
632
730
  //#region lib/hooks/use-countdown.ts
633
- function se(e, { paused: t = !1, onExpire: n, key: r } = {}) {
634
- let [i, a] = S(e), [o, s] = S({
731
+ function _e(e, { paused: t = !1, onExpire: n, key: r } = {}) {
732
+ let [i, a] = T(e), [o, s] = T({
635
733
  duration: e,
636
734
  key: r
637
- }), c = x(e), l = x(n);
735
+ }), c = w(e), l = w(n);
638
736
  l.current = n;
639
737
  let u = o.duration !== e || o.key !== r;
640
738
  return u && (s({
641
739
  duration: e,
642
740
  key: r
643
- }), a(e)), y(() => {
741
+ }), a(e)), x(() => {
644
742
  c.current = e;
645
- }, [e, r]), y(() => {
743
+ }, [e, r]), x(() => {
646
744
  if (t || c.current <= 0) return;
647
745
  let e = Date.now() + c.current * 1e3, n = window.setInterval(() => {
648
746
  let t = Math.max(0, (e - Date.now()) / 1e3);
@@ -657,9 +755,9 @@ function se(e, { paused: t = !1, onExpire: n, key: r } = {}) {
657
755
  }
658
756
  //#endregion
659
757
  //#region lib/components/ui/feedback/unsaved-dialog/unsaved-dialog.tsx
660
- function ce({ open: e, onOpenChange: t, onLeave: n, title: r, description: i, stayLabel: a, leaveLabel: o }) {
661
- let { t: s } = d();
662
- return /* @__PURE__ */ w(Q, {
758
+ function ve({ open: e, onOpenChange: t, onLeave: n, title: r, description: i, stayLabel: a, leaveLabel: o }) {
759
+ let { t: s } = f();
760
+ return /* @__PURE__ */ D(Q, {
663
761
  open: e,
664
762
  onOpenChange: t,
665
763
  variant: "destructive",
@@ -672,10 +770,10 @@ function ce({ open: e, onOpenChange: t, onLeave: n, title: r, description: i, st
672
770
  }
673
771
  //#endregion
674
772
  //#region lib/hooks/use-heading-spy.ts
675
- var le = "0px 0px -65% 0px", ue = [0, 1];
676
- function de(e, t, n) {
677
- let r = n?.rootMargin ?? le, i = n?.threshold ?? ue;
678
- y(() => {
773
+ var ye = "0px 0px -65% 0px", be = [0, 1];
774
+ function xe(e, t, n) {
775
+ let r = n?.rootMargin ?? ye, i = n?.threshold ?? be;
776
+ x(() => {
679
777
  if (e.length === 0) return;
680
778
  let n = e.map((e) => document.getElementById(e)).filter((e) => e != null);
681
779
  if (n.length === 0) return;
@@ -696,4 +794,4 @@ function de(e, t, n) {
696
794
  ]);
697
795
  }
698
796
  //#endregion
699
- export { k as a, Q as c, K as d, H as f, D as i, W as l, V as m, ce as n, $ as o, U as p, se as r, oe as s, de as t, G as u };
797
+ export { ee as a, Q as c, Y as d, G as f, H as g, W as h, A as i, q as l, U as m, ve as n, $ as o, K as p, _e as r, ge as s, xe as t, J as u };
@@ -1,4 +1,4 @@
1
- import { i as e, t } from "./translate-material-CMHUH5Ha.js";
1
+ import { i as e, t } from "./translate-material-Du0j0t97.js";
2
2
  import { useCallback as n } from "react";
3
3
  //#region lib/i18n/use-material-translation.ts
4
4
  function r() {
@@ -1,6 +1,6 @@
1
1
  import { o as e, r as t } from "./dist-DVRQkaTK.js";
2
2
  import { i as n, n as r, r as i, t as a } from "./dist-DWZXlCZR.js";
3
- import { C as o, S as s, x as c } from "./spinner-ffuwBXHl.js";
3
+ import { C as o, S as s, x as c } from "./spinner-Cg0y_E_K.js";
4
4
  import { a as l, i as u, r as d } from "./dist-DHdUUM1w.js";
5
5
  import { c as f, i as p, l as m, o as h, r as g, s as ee } from "./in-dialog-D61Yeaol.js";
6
6
  import { r as te } from "./escape-owner-DpaP0lm1.js";