@nxgt/material 3.75.0 → 3.76.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 (239) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +37 -1
  3. package/dist/{alert-dialog-BfO_ri-N.js → alert-dialog-653apk3f.js} +8 -7
  4. package/dist/{async-slice-roMAJVzG.js → async-slice-CXLbQuOc.js} +1 -1
  5. package/dist/{bubble-input-B7BVd9fX.js → bubble-input-CQwVSoU3.js} +30 -29
  6. package/dist/{button-DgenqmpS.js → button-3op3rtZh.js} +5 -4
  7. package/dist/calculator-BaSMe0SK.js +1189 -0
  8. package/dist/calculator-announce-DRd2c6Dq.js +89 -0
  9. package/dist/calculator-context-BugcKuVG.js +10 -0
  10. package/dist/calculator-field.js +172 -0
  11. package/dist/calculator-panel-announce-AZSnZUSr.js +29 -0
  12. package/dist/calculator-segment-BlJE1LaS.js +22 -0
  13. package/dist/calculator.js +2 -0
  14. package/dist/charts.js +3 -3
  15. package/dist/{chip-CiDczNxO.js → chip-MuKDwtkG.js} +2 -2
  16. package/dist/{code-editor-CohlhFsA.js → code-editor-Bp2RrdNx.js} +13 -13
  17. package/dist/code-editor.js +37 -37
  18. package/dist/{code-language-items-Cs8GLYDp.js → code-language-items-B7WR5ua_.js} +19 -24
  19. package/dist/components/base-content.css +9 -4
  20. package/dist/components/ui/collections/server-table/server-table-phone-row.css +10 -3
  21. package/dist/{components-zJdfH4im.js → components-Ci3Zo8kC.js} +15837 -17245
  22. package/dist/components.js +37 -28
  23. package/dist/conversion-variant-BDFAxqe9.js +529 -0
  24. package/dist/copy-to-clipboard-Be5Ffvs_.js +7 -0
  25. package/dist/currency-B-r3ig11.js +16 -0
  26. package/dist/currency-field-BJ9rSrif.js +285 -0
  27. package/dist/{number.utils-BG_eEt5g.js → date.utils-DUvqcjan.js} +1 -7
  28. package/dist/dialog-Bm5LvVlB.js +166 -0
  29. package/dist/dist-BZe2evxL.js +139 -0
  30. package/dist/dist-CxhKjOYm.js +28 -0
  31. package/dist/dist-DHdUUM1w.js +241 -0
  32. package/dist/{dist-C4wtXCjf.js → dist-DOK3zo5C.js} +33 -32
  33. package/dist/dist-DWZXlCZR.js +182 -0
  34. package/dist/dist-DkQbkF9T.js +33 -0
  35. package/dist/dnd.js +1 -1
  36. package/dist/{dropdown-menu-CzR6JP31.js → dropdown-menu-xlZ6NYUA.js} +160 -159
  37. package/dist/editor.js +299 -298
  38. package/dist/{empty-state-DjHGMp5F.js → empty-state-C0kviQdW.js} +2 -2
  39. package/dist/{field-blur-CdASxjL7.js → field-blur-DkiZOVNV.js} +178 -180
  40. package/dist/{field-blur-context-kZ4SD7xu.js → field-blur-context-BLGgf_3z.js} +2 -2
  41. package/dist/financial-variant-BsZEa5sF.js +459 -0
  42. package/dist/{hooks-Dqq8O3Az.js → hooks-Dg94jPRq.js} +12 -12
  43. package/dist/hooks.js +2 -2
  44. package/dist/{hover-card-BPKqte4a.js → hover-card-B1g55Hi6.js} +44 -43
  45. package/dist/i18n.js +3 -3
  46. package/dist/icon-badge-BcW66bRk.js +17 -0
  47. package/dist/{icon-button-Cr-DyDGg.js → icon-button-Cogxy1cy.js} +5 -4
  48. package/dist/{in-dialog-Vwkyp-M5.js → in-dialog-D61Yeaol.js} +2 -1
  49. package/dist/input-CC2joTjB.js +56 -0
  50. package/dist/key-layout-cR79xfGE.js +38 -0
  51. package/dist/lib/calculator/index.d.ts +16 -0
  52. package/dist/lib/calculator-field/index.d.ts +12 -0
  53. package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +2 -2
  54. package/dist/lib/components/ui/feedback/moment/moment-body.d.ts +17 -2
  55. package/dist/lib/components/ui/feedback/moment/moment-passive.d.ts +13 -0
  56. package/dist/lib/components/ui/feedback/moment/moment.d.ts +16 -2
  57. package/dist/lib/components/ui/fields/calculator-field/apply-calculated.d.ts +17 -0
  58. package/dist/lib/components/ui/fields/calculator-field/calculator-field-content.d.ts +16 -0
  59. package/dist/lib/components/ui/fields/calculator-field/calculator-field-trigger.d.ts +4 -0
  60. package/dist/lib/components/ui/fields/calculator-field/calculator-field.d.ts +12 -0
  61. package/dist/lib/components/ui/fields/calculator-field/calculator-field.types.d.ts +31 -0
  62. package/dist/lib/components/ui/fields/calculator-field/calculator-form-field.d.ts +4 -0
  63. package/dist/lib/components/ui/fields/calculator-field/index.d.ts +3 -0
  64. package/dist/lib/components/ui/fields/calculator-field/use-calculator-field.d.ts +15 -0
  65. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  66. package/dist/lib/components/ui/fields/currency-field/currency-field.d.ts +7 -1
  67. package/dist/lib/components/ui/layout/app-shell/app-sidebar-context.d.ts +4 -0
  68. package/dist/lib/components/ui/widgets/calculator/calculator-announce.d.ts +27 -0
  69. package/dist/lib/components/ui/widgets/calculator/calculator-clipboard.d.ts +19 -0
  70. package/dist/lib/components/ui/widgets/calculator/calculator-context.d.ts +49 -0
  71. package/dist/lib/components/ui/widgets/calculator/calculator-feedback.d.ts +18 -0
  72. package/dist/lib/components/ui/widgets/calculator/calculator-keyboard.d.ts +30 -0
  73. package/dist/lib/components/ui/widgets/calculator/calculator-storage.d.ts +17 -0
  74. package/dist/lib/components/ui/widgets/calculator/calculator-variant-steps.d.ts +16 -0
  75. package/dist/lib/components/ui/widgets/calculator/calculator.d.ts +11 -0
  76. package/dist/lib/components/ui/widgets/calculator/calculator.selectors.d.ts +23 -0
  77. package/dist/lib/components/ui/widgets/calculator/calculator.slice.d.ts +1881 -0
  78. package/dist/lib/components/ui/widgets/calculator/currency.d.ts +9 -0
  79. package/dist/lib/components/ui/widgets/calculator/engine.d.ts +22 -0
  80. package/dist/lib/components/ui/widgets/calculator/index.d.ts +3 -0
  81. package/dist/lib/components/ui/widgets/calculator/partials/calculator-announcer.d.ts +2 -0
  82. package/dist/lib/components/ui/widgets/calculator/partials/calculator-display.d.ts +3 -0
  83. package/dist/lib/components/ui/widgets/calculator/partials/calculator-key.d.ts +17 -0
  84. package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +8 -0
  85. package/dist/lib/components/ui/widgets/calculator/partials/calculator-loading.d.ts +6 -0
  86. package/dist/lib/components/ui/widgets/calculator/partials/calculator-memory.d.ts +2 -0
  87. package/dist/lib/components/ui/widgets/calculator/partials/calculator-panel-announce.d.ts +10 -0
  88. package/dist/lib/components/ui/widgets/calculator/partials/calculator-panel-body.d.ts +9 -0
  89. package/dist/lib/components/ui/widgets/calculator/partials/calculator-screen.d.ts +4 -0
  90. package/dist/lib/components/ui/widgets/calculator/partials/calculator-segment.d.ts +21 -0
  91. package/dist/lib/components/ui/widgets/calculator/partials/calculator-shell.d.ts +9 -0
  92. package/dist/lib/components/ui/widgets/calculator/partials/calculator-switcher.d.ts +5 -0
  93. package/dist/lib/components/ui/widgets/calculator/partials/calculator-tape.d.ts +4 -0
  94. package/dist/lib/components/ui/widgets/calculator/partials/calculator-tools.d.ts +4 -0
  95. package/dist/lib/components/ui/widgets/calculator/partials/keypad-navigation.d.ts +24 -0
  96. package/dist/lib/components/ui/widgets/calculator/types.d.ts +102 -0
  97. package/dist/lib/components/ui/widgets/calculator/use-calculator-clipboard.d.ts +19 -0
  98. package/dist/lib/components/ui/widgets/calculator/use-calculator-conversion.d.ts +4 -0
  99. package/dist/lib/components/ui/widgets/calculator/use-calculator-feedback.d.ts +3 -0
  100. package/dist/lib/components/ui/widgets/calculator/use-calculator-keyboard.d.ts +22 -0
  101. package/dist/lib/components/ui/widgets/calculator/use-calculator-persistence.d.ts +14 -0
  102. package/dist/lib/components/ui/widgets/calculator/use-calculator-pos.d.ts +25 -0
  103. package/dist/lib/components/ui/widgets/calculator/use-calculator-press.d.ts +26 -0
  104. package/dist/lib/components/ui/widgets/calculator/use-calculator-tape.d.ts +29 -0
  105. package/dist/lib/components/ui/widgets/calculator/use-calculator-value.d.ts +9 -0
  106. package/dist/lib/components/ui/widgets/calculator/use-calculator-variant.d.ts +23 -0
  107. package/dist/lib/components/ui/widgets/calculator/use-calculator.d.ts +10 -0
  108. package/dist/lib/components/ui/widgets/calculator/use-engine-settings.d.ts +10 -0
  109. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-fields.d.ts +19 -0
  110. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-labels.d.ts +17 -0
  111. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-math.d.ts +31 -0
  112. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-names.d.ts +4 -0
  113. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-panel.d.ts +7 -0
  114. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-rates.d.ts +29 -0
  115. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-result.d.ts +15 -0
  116. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-state.d.ts +36 -0
  117. package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-variant.d.ts +3 -0
  118. package/dist/lib/components/ui/widgets/calculator/variants/conversion/use-conversion.d.ts +24 -0
  119. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-change.d.ts +4 -0
  120. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-figures.d.ts +43 -0
  121. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-format.d.ts +12 -0
  122. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-loan-math.d.ts +14 -0
  123. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-loan.d.ts +4 -0
  124. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-margin.d.ts +4 -0
  125. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-math.d.ts +10 -0
  126. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-panel.d.ts +7 -0
  127. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-parts.d.ts +35 -0
  128. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-table.d.ts +7 -0
  129. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-variant.d.ts +3 -0
  130. package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-vat.d.ts +4 -0
  131. package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +51 -0
  132. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-announce.d.ts +16 -0
  133. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-aside.d.ts +2 -0
  134. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-display.d.ts +2 -0
  135. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-fields.d.ts +2 -0
  136. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-layout.d.ts +9 -0
  137. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-line.d.ts +6 -0
  138. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-names.d.ts +2 -0
  139. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-state.d.ts +3 -0
  140. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-tender.d.ts +2 -0
  141. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-ticket-data.d.ts +41 -0
  142. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-ticket.d.ts +5 -0
  143. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-totals.d.ts +2 -0
  144. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-types.d.ts +76 -0
  145. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-variant.d.ts +3 -0
  146. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-vat.d.ts +2 -0
  147. package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-view.d.ts +28 -0
  148. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-announce.d.ts +19 -0
  149. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-base.d.ts +11 -0
  150. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-bitpad.d.ts +14 -0
  151. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-display.d.ts +9 -0
  152. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-layout.d.ts +6 -0
  153. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-names.d.ts +2 -0
  154. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-readouts.d.ts +14 -0
  155. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-reduce.d.ts +29 -0
  156. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-state.d.ts +22 -0
  157. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-toolbar.d.ts +5 -0
  158. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-variant.d.ts +3 -0
  159. package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-word.d.ts +15 -0
  160. package/dist/lib/components/ui/widgets/calculator/variants/registry.d.ts +21 -0
  161. package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-layout.d.ts +3 -0
  162. package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-names.d.ts +2 -0
  163. package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-toolbar.d.ts +2 -0
  164. package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-variant.d.ts +3 -0
  165. package/dist/lib/components/ui/widgets/calculator/variants/standard/standard-layout.d.ts +3 -0
  166. package/dist/lib/components/ui/widgets/calculator/variants/variant-loader.d.ts +34 -0
  167. package/dist/lib/components/ui/widgets/calculator/variants/variant-logic.d.ts +40 -0
  168. package/dist/lib/components/ui/widgets/calculator/variants/variant-types.d.ts +62 -0
  169. package/dist/lib/i18n/resources/en/en.d.ts +412 -0
  170. package/dist/lib/i18n/resources/en/material.json.d.ts +412 -0
  171. package/dist/lib/i18n/resources/fr/fr.d.ts +412 -0
  172. package/dist/lib/i18n/resources/fr/material.json.d.ts +412 -0
  173. package/dist/lib/i18n/resources/resources.d.ts +824 -0
  174. package/dist/lib/i18n/translator.d.ts +1 -1
  175. package/dist/lib.js +4 -3
  176. package/dist/main.js +50 -40
  177. package/dist/map.js +66 -65
  178. package/dist/material.css +1 -1
  179. package/dist/native-select-w_FlBLHV.js +40 -0
  180. package/dist/number.utils-CSueQZcv.js +7 -0
  181. package/dist/pdf-reader.js +1 -1
  182. package/dist/percent-field-lahyDJDG.js +14 -0
  183. package/dist/picker-surface-CV09H7Nb.js +1220 -0
  184. package/dist/popover-Cd7DkND4.js +233 -0
  185. package/dist/pos-types-DKCkOTYy.js +49 -0
  186. package/dist/pos-variant-GrUfbTTP.js +603 -0
  187. package/dist/print.js +1 -1
  188. package/dist/programmer-variant-eKJNKENL.js +501 -0
  189. package/dist/programmer-word-CNCF7DJF.js +15 -0
  190. package/dist/{public-DC9VQw4Z.js → public-y6g4ddxd.js} +895 -892
  191. package/dist/{rich-code-block-DBSL9zEN.js → rich-code-block-CRQ0iyLb.js} +5 -5
  192. package/dist/scientific-variant-2y3UxAAU.js +149 -0
  193. package/dist/{sortable-provider-C4tk5esY.js → sortable-provider-DdiI3Fwk.js} +2 -2
  194. package/dist/{spinner-B2MubVWb.js → spinner-C1QIewWv.js} +133 -159
  195. package/dist/standard-layout-BuSRr3TY.js +40 -0
  196. package/dist/tabs-DzEqMb1W.js +383 -0
  197. package/dist/{icon-badge-B9uvDoyY.js → text-field-BAdY-kpO.js} +20 -34
  198. package/dist/theme-picker.js +3 -3
  199. package/dist/{theme-toggle-BInlu21G.js → theme-toggle-C_VeiiCm.js} +2 -2
  200. package/dist/toggle-FeCCJqbg.js +40 -0
  201. package/dist/{toggle-group-DXXlqid2.js → toggle-group-CVMxEpWi.js} +1 -1
  202. package/dist/{toolbar-items-CRJSx1MU.js → toolbar-items-D310xDuM.js} +333 -554
  203. package/dist/{translate-material-pVlPJ1v4.js → translate-material-BypJJ1l5.js} +1 -1
  204. package/dist/{translator-BoYCward.js → translator-DJkf4J7t.js} +824 -0
  205. package/dist/{typography-B6YMbCge.js → typography-CYEquVeb.js} +1 -1
  206. package/dist/{use-chat-composer-BvWQogJe.js → use-chat-composer-DMXu9E1O.js} +4198 -4600
  207. package/dist/{use-heading-spy-B_Z4ArDh.js → use-heading-spy-DJR8YYm6.js} +19 -19
  208. package/dist/{use-material-translation-CIS2n3RB.js → use-material-translation-CD6QoVal.js} +1 -1
  209. package/dist/{use-return-focus-DNQtADAR.js → use-return-focus-Cevw_6yq.js} +106 -105
  210. package/dist/useLatest-C2PnQEeD.js +8 -0
  211. package/docs/README.md +1 -0
  212. package/docs/components/feedback-and-status.md +10 -1
  213. package/docs/components/form-fields.md +1 -0
  214. package/docs/components/rich-widgets.md +108 -0
  215. package/docs/getting-started.md +1 -0
  216. package/docs/guides/calculator.md +468 -0
  217. package/docs/guides/forms.md +4 -2
  218. package/docs/guides/i18n.md +5 -0
  219. package/docs/previews/rich-widgets-calculator-conversion.webp +0 -0
  220. package/docs/previews/rich-widgets-calculator-point-of-sale.webp +0 -0
  221. package/docs/previews/rich-widgets-calculator.webp +0 -0
  222. package/docs/roadmap.md +9 -3
  223. package/docs/troubleshooting.md +134 -0
  224. package/lib/components/base-content.css +9 -4
  225. package/lib/components/ui/collections/server-table/server-table-phone-row.css +10 -3
  226. package/lib/components/ui/widgets/calculator/calculator-bands.css +146 -0
  227. package/lib/components/ui/widgets/calculator/calculator-display.css +83 -0
  228. package/lib/components/ui/widgets/calculator/calculator-keys.css +118 -0
  229. package/lib/components/ui/widgets/calculator/calculator-pos-ticket.css +185 -0
  230. package/lib/components/ui/widgets/calculator/calculator-pos.css +38 -0
  231. package/lib/components/ui/widgets/calculator/calculator-tape.css +71 -0
  232. package/lib/components/ui/widgets/calculator/calculator.css +97 -0
  233. package/lib/components/ui/widgets/calculator/variants/conversion/conversion.css +98 -0
  234. package/lib/components/ui/widgets/calculator/variants/financial/financial.css +162 -0
  235. package/lib/components/ui/widgets/calculator/variants/programmer/programmer.css +162 -0
  236. package/package.json +17 -3
  237. package/dist/dialog-AGsB3bv4.js +0 -219
  238. package/dist/dist-B7RjY7SL.js +0 -158
  239. package/dist/dist-lmHmz_bu.js +0 -419
@@ -1,8 +1,9 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { o as t } from "./dist-DVRQkaTK.js";
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-B2MubVWb.js";
5
- import { t as p } from "./in-dialog-Vwkyp-M5.js";
3
+ import { i as n, r, t as i } from "./dist-DWZXlCZR.js";
4
+ import { S as a, d as o, f as s, l as c, p as l, x as u } from "./spinner-C1QIewWv.js";
5
+ import { a as d, i as f } from "./dist-DHdUUM1w.js";
6
+ import { t as p } from "./in-dialog-D61Yeaol.js";
6
7
  import { i as m } from "./escape-owner-DpaP0lm1.js";
7
8
  import * as h from "react";
8
9
  import { Activity as g } from "react";
@@ -11,19 +12,19 @@ import { jsx as _ } from "react/jsx-runtime";
11
12
  var v = Object.defineProperty, y = (e, t) => v(e, "name", {
12
13
  value: t,
13
14
  configurable: !0
14
- }), b, x = "HoverCard", [S, C] = r(x, [u]), w = u(), [T, E] = S(x), D = /* @__PURE__ */ y((e) => {
15
- let { __scopeHoverCard: t, children: r, open: i, defaultOpen: a, onOpenChange: o, openDelay: s = 700, closeDelay: c = 300 } = e, l = w(t), u = h.useRef(0), f = h.useRef(0), p = h.useRef(!1), m = h.useRef(!1), [g, v] = n({
16
- prop: i,
15
+ }), b, x = "HoverCard", [S, C] = d(x, [l]), w = l(), [T, E] = S(x), D = /* @__PURE__ */ y((e) => {
16
+ let { __scopeHoverCard: t, children: n, open: r, defaultOpen: a, onOpenChange: o, openDelay: c = 700, closeDelay: l = 300 } = e, u = w(t), d = h.useRef(0), f = h.useRef(0), p = h.useRef(!1), m = h.useRef(!1), [g, v] = i({
17
+ prop: r,
17
18
  defaultProp: a ?? !1,
18
19
  onChange: o,
19
20
  caller: x
20
21
  }), y = h.useCallback(() => {
21
- clearTimeout(f.current), u.current = window.setTimeout(() => v(!0), s);
22
- }, [s, v]), b = h.useCallback(() => {
23
- clearTimeout(u.current), !p.current && !m.current && (f.current = window.setTimeout(() => v(!1), c));
24
- }, [c, v]), S = h.useCallback(() => v(!1), [v]);
22
+ clearTimeout(f.current), d.current = window.setTimeout(() => v(!0), c);
23
+ }, [c, v]), b = h.useCallback(() => {
24
+ clearTimeout(d.current), !p.current && !m.current && (f.current = window.setTimeout(() => v(!1), l));
25
+ }, [l, v]), S = h.useCallback(() => v(!1), [v]);
25
26
  return h.useEffect(() => () => {
26
- clearTimeout(u.current), clearTimeout(f.current);
27
+ clearTimeout(d.current), clearTimeout(f.current);
27
28
  }, []), /* @__PURE__ */ _(T, {
28
29
  scope: t,
29
30
  open: g,
@@ -33,55 +34,55 @@ var v = Object.defineProperty, y = (e, t) => v(e, "name", {
33
34
  onDismiss: S,
34
35
  hasSelectionRef: p,
35
36
  isPointerDownOnContentRef: m,
36
- children: /* @__PURE__ */ _(d, {
37
- ...l,
38
- children: r
37
+ children: /* @__PURE__ */ _(s, {
38
+ ...u,
39
+ children: n
39
40
  })
40
41
  });
41
42
  }, "HoverCard"), O = "HoverCardTrigger", k = /* @__PURE__ */ h.forwardRef(/* @__PURE__ */ y(function(e, t) {
42
- let { __scopeHoverCard: n, ...r } = e, i = E(O, n);
43
- return /* @__PURE__ */ _(f, {
43
+ let { __scopeHoverCard: i, ...a } = e, o = E(O, i);
44
+ return /* @__PURE__ */ _(c, {
44
45
  asChild: !0,
45
- ...w(n),
46
- children: /* @__PURE__ */ _(a.a, {
47
- "data-state": i.open ? "open" : "closed",
48
- ...r,
46
+ ...w(i),
47
+ children: /* @__PURE__ */ _(n.a, {
48
+ "data-state": o.open ? "open" : "closed",
49
+ ...a,
49
50
  ref: t,
50
- onPointerEnter: o(e.onPointerEnter, L(i.onOpen)),
51
- onPointerLeave: o(e.onPointerLeave, L(i.onClose)),
52
- onFocus: o(e.onFocus, i.onOpen),
53
- onBlur: o(e.onBlur, i.onClose),
54
- onTouchStart: o(e.onTouchStart, (e) => e.preventDefault())
51
+ onPointerEnter: r(e.onPointerEnter, L(o.onOpen)),
52
+ onPointerLeave: r(e.onPointerLeave, L(o.onClose)),
53
+ onFocus: r(e.onFocus, o.onOpen),
54
+ onBlur: r(e.onBlur, o.onClose),
55
+ onTouchStart: r(e.onTouchStart, (e) => e.preventDefault())
55
56
  })
56
57
  });
57
58
  }, "HoverCardTrigger")), A = "HoverCardPortal", [j, M] = S(A, { forceMount: void 0 }), N = /* @__PURE__ */ y((e) => {
58
- let { __scopeHoverCard: t, forceMount: n, children: r, container: a } = e, o = E(A, t);
59
+ let { __scopeHoverCard: t, forceMount: n, children: r, container: i } = e, a = E(A, t);
59
60
  return /* @__PURE__ */ _(j, {
60
61
  scope: t,
61
62
  forceMount: n,
62
- children: /* @__PURE__ */ _(i, {
63
- present: n || o.open,
64
- children: /* @__PURE__ */ _(c, {
63
+ children: /* @__PURE__ */ _(f, {
64
+ present: n || a.open,
65
+ children: /* @__PURE__ */ _(u, {
65
66
  asChild: !0,
66
- container: a,
67
+ container: i,
67
68
  children: r
68
69
  })
69
70
  })
70
71
  });
71
72
  }, "HoverCardPortal"), P = "HoverCardContent", F = /* @__PURE__ */ h.forwardRef(/* @__PURE__ */ y(function(e, t) {
72
- let n = M(P, e.__scopeHoverCard), { forceMount: r = n.forceMount, ...a } = e, s = E(P, e.__scopeHoverCard);
73
- return /* @__PURE__ */ _(i, {
74
- present: r || s.open,
73
+ let n = M(P, e.__scopeHoverCard), { forceMount: i = n.forceMount, ...a } = e, o = E(P, e.__scopeHoverCard);
74
+ return /* @__PURE__ */ _(f, {
75
+ present: i || o.open,
75
76
  children: /* @__PURE__ */ _(I, {
76
- "data-state": s.open ? "open" : "closed",
77
+ "data-state": o.open ? "open" : "closed",
77
78
  ...a,
78
- onPointerEnter: o(e.onPointerEnter, L(s.onOpen)),
79
- onPointerLeave: o(e.onPointerLeave, L(s.onClose)),
79
+ onPointerEnter: r(e.onPointerEnter, L(o.onOpen)),
80
+ onPointerLeave: r(e.onPointerLeave, L(o.onClose)),
80
81
  ref: t
81
82
  })
82
83
  });
83
84
  }, "HoverCardContent")), I = /* @__PURE__ */ h.forwardRef(/* @__PURE__ */ y(function(e, n) {
84
- let { __scopeHoverCard: r, onEscapeKeyDown: i, onPointerDownOutside: a, onFocusOutside: c, onInteractOutside: u, ...d } = e, f = E(P, r), p = w(r), m = h.useRef(null), g = t(n, m), [v, x] = h.useState(!1);
85
+ let { __scopeHoverCard: i, onEscapeKeyDown: s, onPointerDownOutside: c, onFocusOutside: l, onInteractOutside: u, ...d } = e, f = E(P, i), p = w(i), m = h.useRef(null), g = t(n, m), [v, x] = h.useState(!1);
85
86
  return h.useEffect(() => {
86
87
  if (v) {
87
88
  let e = document.body;
@@ -102,20 +103,20 @@ var v = Object.defineProperty, y = (e, t) => v(e, "name", {
102
103
  }
103
104
  }, [f.isPointerDownOnContentRef, f.hasSelectionRef]), h.useEffect(() => {
104
105
  m.current && R(m.current).forEach((e) => e.setAttribute("tabindex", "-1"));
105
- }), /* @__PURE__ */ _(s, {
106
+ }), /* @__PURE__ */ _(a, {
106
107
  asChild: !0,
107
108
  disableOutsidePointerEvents: !1,
108
109
  onInteractOutside: u,
109
- onEscapeKeyDown: i,
110
- onPointerDownOutside: a,
111
- onFocusOutside: o(c, (e) => {
110
+ onEscapeKeyDown: s,
111
+ onPointerDownOutside: c,
112
+ onFocusOutside: r(l, (e) => {
112
113
  e.preventDefault();
113
114
  }),
114
115
  onDismiss: f.onDismiss,
115
- children: /* @__PURE__ */ _(l, {
116
+ children: /* @__PURE__ */ _(o, {
116
117
  ...p,
117
118
  ...d,
118
- onPointerDown: o(d.onPointerDown, (e) => {
119
+ onPointerDown: r(d.onPointerDown, (e) => {
119
120
  e.currentTarget.contains(e.target) && x(!0), f.hasSelectionRef.current = !1, f.isPointerDownOnContentRef.current = !0;
120
121
  }),
121
122
  ref: g,
package/dist/i18n.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./is-production-GLw59WU8.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-BoYCward.js";
3
- import { i as u, n as d, r as f, t as p } from "./translate-material-pVlPJ1v4.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-DJkf4J7t.js";
3
+ import { i as u, n as d, r as f, t as p } from "./translate-material-BypJJ1l5.js";
4
4
  import { o as m, t as h } from "./merge-BCZE6HGq.js";
5
- import { t as g } from "./use-material-translation-CIS2n3RB.js";
5
+ import { t as g } from "./use-material-translation-CD6QoVal.js";
6
6
  import { useCallback as _ } from "react";
7
7
  //#region lib/i18n/merge-resources.ts
8
8
  function v(e, t, n = "") {
@@ -0,0 +1,17 @@
1
+ import { t as e } from "./utils-BLfntITJ.js";
2
+ import { t } from "./icon-button-Cogxy1cy.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region lib/components/ui/actions/icon-button/icon-badge.tsx
5
+ function r({ children: r, className: i, ...a }) {
6
+ let o = !!(a["aria-label"] || a["aria-labelledby"]);
7
+ return /* @__PURE__ */ n(t, {
8
+ "aria-hidden": o ? void 0 : "true",
9
+ role: o ? "img" : void 0,
10
+ ...a,
11
+ asChild: !0,
12
+ className: e("cursor-default", i),
13
+ children: /* @__PURE__ */ n("span", { children: r })
14
+ });
15
+ }
16
+ //#endregion
17
+ export { r as t };
@@ -1,7 +1,8 @@
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-B2MubVWb.js";
4
+ import { n as i, t as a } from "./spinner-C1QIewWv.js";
5
+ import { t as o } from "./dist-DkQbkF9T.js";
5
6
  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
7
  import { t as m } from "./is-production-GLw59WU8.js";
7
8
  import { t as h } from "./button-group-context-CaP0X5p_.js";
@@ -191,7 +192,7 @@ var w = [
191
192
  color: "default",
192
193
  class: `${c.default} ${l.default} ${d.default} underline-offset-4 hover:underline hover:bg-foreground/10 active:bg-muted focus:bg-foreground/10`
193
194
  }
194
- ], T = i("inline-flex center gap-2 cursor-pointer whitespace-nowrap text-sm font-medium disabled:pointer-events-none [&_svg]:bg-transparent [&_svg]:text-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-(--btn-ic,1rem) shrink-0 [&_svg]:shrink-0", {
195
+ ], T = o("inline-flex center gap-2 cursor-pointer whitespace-nowrap text-sm font-medium disabled:pointer-events-none [&_svg]:bg-transparent [&_svg]:text-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-(--btn-ic,1rem) shrink-0 [&_svg]:shrink-0", {
195
196
  variants: {
196
197
  look: {
197
198
  btn: "nxgt-btn nxgt-morph-fill aria-invalid:[--btn-focus:var(--color-error)] aria-invalid:[--btn-line:var(--color-error)]",
@@ -256,7 +257,7 @@ function k(e, t) {
256
257
  };
257
258
  }
258
259
  function A({ variant: e, color: t }) {
259
- return /* @__PURE__ */ x(o, {
260
+ return /* @__PURE__ */ x(a, {
260
261
  variant: "2",
261
262
  color: e === "filled" ? "light" : t ?? (e === "ghost" ? "default" : "primary"),
262
263
  className: "absolute inset-0 m-auto size-(--btn-ic,1rem)"
@@ -391,7 +392,7 @@ function F({ variant: t, color: i, size: a, width: o, className: s, asChild: c,
391
392
  }
392
393
  function I({ tooltip: e, "aria-label": t, ...n }) {
393
394
  let r = t ?? (typeof e == "string" ? e : void 0);
394
- return e ? /* @__PURE__ */ x(a, {
395
+ return e ? /* @__PURE__ */ x(i, {
395
396
  content: e,
396
397
  children: /* @__PURE__ */ x(F, {
397
398
  "aria-label": r,
@@ -1,6 +1,7 @@
1
1
  import { n as e } from "./rolldown-runtime-BFFgcFxR.js";
2
2
  import { o as t } from "./dist-DVRQkaTK.js";
3
- import { l as n, n as r } from "./dist-lmHmz_bu.js";
3
+ import { i as n } from "./dist-DWZXlCZR.js";
4
+ import { n as r } from "./dist-DHdUUM1w.js";
4
5
  import * as i from "react";
5
6
  import { createContext as a, useContext as o, useEffect as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
6
7
  import { jsx as d } from "react/jsx-runtime";
@@ -0,0 +1,56 @@
1
+ import { t as e } from "./utils-BLfntITJ.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ //#region lib/components/ui/primitives/field-box/field-box.ts
4
+ var n = "nxgt-field-box", r = "nxgt-field-list", i = (e) => e ? "" : void 0;
5
+ function a(e) {
6
+ return {
7
+ "data-size": e.size,
8
+ "data-filled": i(e.filled),
9
+ "data-open": i(e.list?.open),
10
+ "data-list-side": e.list?.open ? e.list.side : void 0,
11
+ "data-focused": i(e.focused),
12
+ "data-invalid": i(e.invalid),
13
+ "data-disabled": i(e.disabled),
14
+ "data-readonly": i(e.readOnly)
15
+ };
16
+ }
17
+ var o = /* @__PURE__ */ new Set([
18
+ "checkbox",
19
+ "radio",
20
+ "file",
21
+ "range",
22
+ "color",
23
+ "hidden",
24
+ "button",
25
+ "submit",
26
+ "reset",
27
+ "image"
28
+ ]);
29
+ function s(e, t = "text") {
30
+ return e || (o.has(t) ? void 0 : " ");
31
+ }
32
+ //#endregion
33
+ //#region lib/components/ui/primitives/input/input-box.ts
34
+ var c = "selection:bg-primary selection:text-primary-foreground", l = [
35
+ "inline-flex gap-2 items-center h-11 max-h-full w-full min-w-0",
36
+ "px-2 py-1 text-base md:text-sm outline-none",
37
+ "placeholder:text-muted-foreground",
38
+ "file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-muted-foreground",
39
+ "disabled:pointer-events-none"
40
+ ], u = [
41
+ ...l,
42
+ c,
43
+ n
44
+ ], d = [...l, n], f = u;
45
+ function p({ className: n, type: r = "text", ...i }) {
46
+ return /* @__PURE__ */ t("input", {
47
+ type: r,
48
+ "data-slot": "input",
49
+ className: e(f, n),
50
+ "data-pw": i.name ?? "input",
51
+ ...i,
52
+ placeholder: s(i.placeholder, r)
53
+ });
54
+ }
55
+ //#endregion
56
+ export { s as a, a as c, d as i, f as n, n as o, u as r, r as s, p as t };
@@ -0,0 +1,38 @@
1
+ //#region lib/components/ui/widgets/calculator/variants/key-layout.ts
2
+ var e = (e, t) => ({
3
+ key: `material.calculator.keys.${e}`,
4
+ fallback: t
5
+ }), t = (t, n, r, i, a, o, s) => ({
6
+ id: t,
7
+ key: n,
8
+ glyph: r,
9
+ role: i,
10
+ name: e(a, o),
11
+ span: s
12
+ }), n = [
13
+ "zero",
14
+ "one",
15
+ "two",
16
+ "three",
17
+ "four",
18
+ "five",
19
+ "six",
20
+ "seven",
21
+ "eight",
22
+ "nine"
23
+ ], r = (e, r) => t(`d${e}`, String(e), String(e), "digit", n[e] ?? "zero", String(e), r), i = [
24
+ t("open", "(", "(", "bracket", "open-paren", "Open parenthesis", 2),
25
+ t("close", ")", ")", "bracket", "close-paren", "Close parenthesis", 2),
26
+ t("mc", "mc", "MC", "memory", "memory-clear", "Memory clear", 2),
27
+ t("mr", "mr", "MR", "memory", "memory-recall", "Memory recall", 2),
28
+ t("m+", "m+", "M+", "memory", "memory-add", "Add to memory", 2),
29
+ t("m-", "m-", "M−", "memory", "memory-subtract", "Subtract from memory", 2)
30
+ ], a = (e) => e.map((e) => ({
31
+ ...e,
32
+ span: (e.span ?? 1) * 3
33
+ })), o = (e, t) => t && e.alt ? {
34
+ ...e,
35
+ ...e.alt
36
+ } : e, s = (e) => e.sequence ?? [e.key];
37
+ //#endregion
38
+ export { s as a, t as i, r as n, e as o, o as r, a as s, i as t };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `@nxgt/material/calculator` — `Calculator`: a calculator with exact decimal
3
+ * arithmetic and the usual precedence (`2 + 3 × 4` is 14), a variant switcher,
4
+ * a tape of past results, a memory, the physical keyboard, copy and paste and
5
+ * a screen-reader announcement of each result. Standard, Scientific, point of
6
+ * sale, Financial, Conversion and Programmer are here.
7
+ *
8
+ * The engine is `@nxgt/material-core/calculator` (no `eval`, strict-CSP safe).
9
+ * Colours and shapes follow the theme and its dark mode through `styles.css`,
10
+ * so the stylesheet must be imported. The tape and the memory are kept in
11
+ * `localStorage` after mount unless `persist={false}`; haptics and sound are
12
+ * off unless `feedback` asks for them.
13
+ *
14
+ * Own entry, not exported from `./components` or `./main`.
15
+ */
16
+ export { CALCULATOR_VARIANTS, Calculator, type CalculatorConversionProps, type CalculatorCurrencyRates, type CalculatorFeedback, type CalculatorProps, type CalculatorRatesSource, type CalculatorVariant, } from '../components/ui/widgets/calculator/index.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `@nxgt/material/calculator-field` — `CalculatorField` and
3
+ * `CalculatorFormField`: a number field (a currency field with `currency`)
4
+ * whose button opens the calculator, seeded with its number, in a popover or
5
+ * a phone's bottom sheet. Apply writes the rounded result; Cancel and Escape
6
+ * keep the number. The calculator offers only Standard unless
7
+ * `calculatorVariants` lists more.
8
+ *
9
+ * Own entry, not exported from `./components`, `./main` or `./calculator`.
10
+ * The stylesheet must be imported, as for `Calculator`.
11
+ */
12
+ export { CalculatorField, type CalculatorFieldProps, type CalculatorFieldSurface, CalculatorFormField, } from '../components/ui/fields/calculator-field/index.js';
@@ -3839,8 +3839,8 @@ export declare function useFilterFieldConfig({ field, value, onChange, error, di
3839
3839
  role?: "application" | "dialog" | undefined | undefined;
3840
3840
  today?: Date | undefined;
3841
3841
  labels?: Partial<import('react-day-picker').Labels> | undefined;
3842
- components?: Partial<import('react-day-picker').CustomComponents> | undefined;
3843
3842
  month?: Date | undefined;
3843
+ components?: Partial<import('react-day-picker').CustomComponents> | undefined;
3844
3844
  locale?: Partial<import('react-day-picker').DayPickerLocale> | undefined;
3845
3845
  modifiers?: Record<string, import('react-day-picker').Matcher | import('react-day-picker').Matcher[] | undefined> | undefined;
3846
3846
  minDate?: Date | undefined;
@@ -3926,8 +3926,8 @@ export declare function useFilterFieldConfig({ field, value, onChange, error, di
3926
3926
  role?: "application" | "dialog" | undefined | undefined;
3927
3927
  today?: Date | undefined;
3928
3928
  labels?: Partial<import('react-day-picker').Labels> | undefined;
3929
- components?: Partial<import('react-day-picker').CustomComponents> | undefined;
3930
3929
  month?: Date | undefined;
3930
+ components?: Partial<import('react-day-picker').CustomComponents> | undefined;
3931
3931
  locale?: Partial<import('react-day-picker').DayPickerLocale> | undefined;
3932
3932
  modifiers?: Record<string, import('react-day-picker').Matcher | import('react-day-picker').Matcher[] | undefined> | undefined;
3933
3933
  minDate?: Date | undefined;
@@ -1,5 +1,20 @@
1
- import { ReactNode } from 'react';
2
- /** What a Moment shows: the picture, the title, the description (or the hint for assistive technology), the action and the close button. */
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ /** What a Moment says: the picture, the title and the description (or the hint for assistive technology). `modal={false}`: plain elements, there is no dialog around them. */
3
+ export declare function MomentText({ illustration, title, description, modal, }: {
4
+ illustration?: ReactNode;
5
+ title: ReactNode;
6
+ description?: ReactNode;
7
+ modal?: boolean;
8
+ }): import("react").JSX.Element;
9
+ /** The action and the close button. Non-modal: `onClose` closes (there is no dialog to) and `onActionClick` bubbles the action's click so a tap dismisses. */
10
+ export declare function MomentControls({ action, closeLabel, modal, onClose, onActionClick, }: {
11
+ action?: ReactNode;
12
+ closeLabel?: string;
13
+ modal?: boolean;
14
+ onClose?: () => void;
15
+ onActionClick?: (event: MouseEvent) => void;
16
+ }): import("react").JSX.Element;
17
+ /** What a modal Moment shows: the text, the action and the close button. */
3
18
  export declare function MomentBody({ illustration, title, description, action, closeLabel, }: {
4
19
  illustration?: ReactNode;
5
20
  title: ReactNode;
@@ -0,0 +1,13 @@
1
+ import { MomentProps } from './moment.js';
2
+ /** Calls `onOpenChange(false)` after `duration` ms while `open` (shared by both variants). */
3
+ export declare function useAutoDismiss(open: boolean, duration: number | undefined, onOpenChange: (open: boolean) => void): void;
4
+ /**
5
+ * The non-modal Moment: no dialog, no focus handling, no inert page. The
6
+ * full-screen wrapper and its `role="status"` live region are in the portal
7
+ * from the first client pass, and the content enters the region one effect
8
+ * later, so it is announced as it is added. The region holds the picture,
9
+ * title and description; the action and the close button sit beside it. The
10
+ * wrapper lets pointer events through, only the region, the action and the
11
+ * close button take them. Escape dismisses through a document listener.
12
+ */
13
+ export declare function PassiveMoment(props: Omit<MomentProps, 'modal'>): import('react').ReactPortal | null;
@@ -20,6 +20,18 @@ export interface MomentProps {
20
20
  /** Accessible name of the close button (translated by default). */
21
21
  closeLabel?: string;
22
22
  className?: string;
23
+ /**
24
+ * `false`: a non-modal announcement for an event the user did not trigger
25
+ * (a live update). Focus stays where it is (no move, no trap, no return),
26
+ * the page behind stays interactive (the backdrop lets taps through; only
27
+ * the text and the close button take them), and the content is announced
28
+ * politely through a `role="status"` live region instead of a dialog.
29
+ * Same visuals, `duration` and reduced motion. Escape dismisses it through
30
+ * a document listener that never moves focus. Give it a `duration`:
31
+ * nothing takes the user to it, so it should not stay. Default `true`: a
32
+ * modal dialog.
33
+ */
34
+ modal?: boolean;
23
35
  }
24
36
  /**
25
37
  * A transient full-screen announcement for a dramatic one-off event (a
@@ -28,6 +40,8 @@ export interface MomentProps {
28
40
  * it as it opens; focus moves into it and goes back to the element that had
29
41
  * it when it closes. Escape, a tap anywhere, the close button and the
30
42
  * `action` dismiss it, and so does `duration`. It fades in and its picture
31
- * pops in, none of it under `prefers-reduced-motion`.
43
+ * pops in, none of it under `prefers-reduced-motion`. With `modal={false}` it
44
+ * is a polite `role="status"` announcement instead: focus and the page behind
45
+ * are left alone.
32
46
  */
33
- export declare function Moment({ open, onOpenChange, duration, illustration, title, description, action, tone, closeLabel, className, }: MomentProps): import("react").JSX.Element;
47
+ export declare function Moment({ modal, ...props }: MomentProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ type Options = {
2
+ currency?: string;
3
+ fractionDigits?: number;
4
+ min?: number;
5
+ max?: number;
6
+ };
7
+ /**
8
+ * The number an exact calculator result becomes in the field: a currency
9
+ * amount is rounded half-up to the currency's decimals (`12.345` is `12.35`),
10
+ * any other number is the nearest one (it keeps what a `number` can hold),
11
+ * and `min` / `max` clamp it as typing does. `undefined` when `exact` is not
12
+ * a number.
13
+ */
14
+ export declare function applyCalculated(exact: string, { currency, fractionDigits, min, max }: Options): number | undefined;
15
+ /** A field number as the calculator's seed (`'12.5'`), or `undefined` when empty. */
16
+ export declare const seedOf: (value: number | null) => string | undefined;
17
+ export {};
@@ -0,0 +1,16 @@
1
+ import { CalculatorVariant } from '../../widgets/calculator/types.js';
2
+ /**
3
+ * The open calculator of a `CalculatorField`: the calculator seeded with the
4
+ * field's number, and Cancel / Apply under it. Escape closes (the surface does
5
+ * it) and keeps the number. It mounts when the surface opens, so every opening
6
+ * starts from the field's number again.
7
+ */
8
+ export declare function CalculatorFieldContent({ titleId, seed, variant, variants, onApply, onCancel, }: {
9
+ titleId: string;
10
+ seed: number | null;
11
+ variant?: CalculatorVariant;
12
+ variants?: readonly CalculatorVariant[];
13
+ /** Called with the display's exact value. */
14
+ onApply: (exact: string) => void;
15
+ onCancel: () => void;
16
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** The "Open calculator" button inside the field: 44px on a touch screen. */
2
+ export declare function CalculatorFieldTrigger({ disabled }: {
3
+ disabled?: boolean;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { CalculatorFieldProps } from './calculator-field.types.js';
2
+ /**
3
+ * A number field (a `CurrencyField` with `currency`) with an "Open
4
+ * calculator" button inside it. The button opens a calculator seeded with the
5
+ * field's number, in a popover from 768px wide and a bottom sheet below.
6
+ * Apply writes the result to the field (a currency amount rounded to the
7
+ * currency's decimals; `onExactValueChange` gets it unrounded); Cancel and
8
+ * Escape keep the number, and focus goes back to the button either way.
9
+ *
10
+ * Own entry, `@nxgt/material/calculator-field`: not exported from `./fields`.
11
+ */
12
+ export declare function CalculatorField({ currency, fractionDigits, calculatorVariant, calculatorVariants, surface, onExactValueChange, value, defaultValue, onChange, className, min, max, step, hideSteppers, suffix, ...field }: CalculatorFieldProps): import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { CalculatorVariant } from '../../widgets/calculator/types.js';
2
+ import { NumberFieldProps } from '../number-field/number-field.types.js';
3
+ /** Where the calculator opens: a popover from 768px wide, a bottom sheet below (`'auto'`). */
4
+ export type CalculatorFieldSurface = 'auto' | 'popover' | 'sheet';
5
+ /**
6
+ * `NumberFieldProps` plus the calculator's. With `currency` the field is a
7
+ * `CurrencyField`: `suffix`, `step`, `hideSteppers` and the typing-time `min`
8
+ * and `max` apply only without `currency` (Apply still holds a currency amount
9
+ * to `min` / `max`).
10
+ */
11
+ export type CalculatorFieldProps = NumberFieldProps & {
12
+ /**
13
+ * ISO 4217 code: the field is then a `CurrencyField` (the code after the
14
+ * amount) and Apply rounds to the currency's decimals. None: a
15
+ * `NumberField`.
16
+ */
17
+ currency?: string;
18
+ /** Decimals of a currency amount, 0 to 20; the currency's own by default. Needs `currency`. */
19
+ fractionDigits?: number;
20
+ /** The variant the calculator opens with. Defaults to `'standard'`. */
21
+ calculatorVariant?: CalculatorVariant;
22
+ /** The variants its switcher offers; one hides the switcher. Only Standard by default. */
23
+ calculatorVariants?: readonly CalculatorVariant[];
24
+ /** Where it opens. Defaults to `'auto'`. */
25
+ surface?: CalculatorFieldSurface;
26
+ /**
27
+ * Called on Apply with the exact decimal result (`'0.3'` for `0.1 + 0.2`),
28
+ * before it is rounded to the field's number.
29
+ */
30
+ onExactValueChange?: (value: string) => void;
31
+ };
@@ -0,0 +1,4 @@
1
+ import { UseControllerProps } from 'react-hook-form';
2
+ import { CalculatorFieldProps } from './calculator-field.types.js';
3
+ /** `CalculatorField` for React Hook Form: `control` and `name`; the value is `number | null`. */
4
+ export declare function CalculatorFormField<T extends Record<string, any>>({ control, name, ...props }: Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<CalculatorFieldProps, 'name' | 'value' | 'onChange'>): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { CalculatorField } from './calculator-field.js';
2
+ export type { CalculatorFieldProps, CalculatorFieldSurface, } from './calculator-field.types.js';
3
+ export { CalculatorFormField } from './calculator-form-field.js';
@@ -0,0 +1,15 @@
1
+ import { CalculatorFieldProps } from './calculator-field.types.js';
2
+ type Options = Pick<CalculatorFieldProps, 'value' | 'defaultValue' | 'onChange' | 'currency' | 'fractionDigits' | 'min' | 'max' | 'onExactValueChange'>;
3
+ /**
4
+ * The field's number (controlled or not), whether the calculator is open,
5
+ * and Apply: it rounds the exact result, tells `onExactValueChange` and
6
+ * `onChange`, and closes.
7
+ */
8
+ export declare function useCalculatorField({ value, defaultValue, onChange, currency, fractionDigits, min, max, onExactValueChange, }: Options): {
9
+ open: boolean;
10
+ setOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
11
+ current: number | null;
12
+ change: (next: number | null) => void;
13
+ apply: (exact: string) => void;
14
+ };
15
+ export {};