@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.
- package/CHANGELOG.md +40 -0
- package/README.md +37 -1
- package/dist/{alert-dialog-BfO_ri-N.js → alert-dialog-653apk3f.js} +8 -7
- package/dist/{async-slice-roMAJVzG.js → async-slice-CXLbQuOc.js} +1 -1
- package/dist/{bubble-input-B7BVd9fX.js → bubble-input-CQwVSoU3.js} +30 -29
- package/dist/{button-DgenqmpS.js → button-3op3rtZh.js} +5 -4
- package/dist/calculator-BaSMe0SK.js +1189 -0
- package/dist/calculator-announce-DRd2c6Dq.js +89 -0
- package/dist/calculator-context-BugcKuVG.js +10 -0
- package/dist/calculator-field.js +172 -0
- package/dist/calculator-panel-announce-AZSnZUSr.js +29 -0
- package/dist/calculator-segment-BlJE1LaS.js +22 -0
- package/dist/calculator.js +2 -0
- package/dist/charts.js +3 -3
- package/dist/{chip-CiDczNxO.js → chip-MuKDwtkG.js} +2 -2
- package/dist/{code-editor-CohlhFsA.js → code-editor-Bp2RrdNx.js} +13 -13
- package/dist/code-editor.js +37 -37
- package/dist/{code-language-items-Cs8GLYDp.js → code-language-items-B7WR5ua_.js} +19 -24
- package/dist/components/base-content.css +9 -4
- package/dist/components/ui/collections/server-table/server-table-phone-row.css +10 -3
- package/dist/{components-zJdfH4im.js → components-Ci3Zo8kC.js} +15837 -17245
- package/dist/components.js +37 -28
- package/dist/conversion-variant-BDFAxqe9.js +529 -0
- package/dist/copy-to-clipboard-Be5Ffvs_.js +7 -0
- package/dist/currency-B-r3ig11.js +16 -0
- package/dist/currency-field-BJ9rSrif.js +285 -0
- package/dist/{number.utils-BG_eEt5g.js → date.utils-DUvqcjan.js} +1 -7
- package/dist/dialog-Bm5LvVlB.js +166 -0
- package/dist/dist-BZe2evxL.js +139 -0
- package/dist/dist-CxhKjOYm.js +28 -0
- package/dist/dist-DHdUUM1w.js +241 -0
- package/dist/{dist-C4wtXCjf.js → dist-DOK3zo5C.js} +33 -32
- package/dist/dist-DWZXlCZR.js +182 -0
- package/dist/dist-DkQbkF9T.js +33 -0
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-CzR6JP31.js → dropdown-menu-xlZ6NYUA.js} +160 -159
- package/dist/editor.js +299 -298
- package/dist/{empty-state-DjHGMp5F.js → empty-state-C0kviQdW.js} +2 -2
- package/dist/{field-blur-CdASxjL7.js → field-blur-DkiZOVNV.js} +178 -180
- package/dist/{field-blur-context-kZ4SD7xu.js → field-blur-context-BLGgf_3z.js} +2 -2
- package/dist/financial-variant-BsZEa5sF.js +459 -0
- package/dist/{hooks-Dqq8O3Az.js → hooks-Dg94jPRq.js} +12 -12
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-BPKqte4a.js → hover-card-B1g55Hi6.js} +44 -43
- package/dist/i18n.js +3 -3
- package/dist/icon-badge-BcW66bRk.js +17 -0
- package/dist/{icon-button-Cr-DyDGg.js → icon-button-Cogxy1cy.js} +5 -4
- package/dist/{in-dialog-Vwkyp-M5.js → in-dialog-D61Yeaol.js} +2 -1
- package/dist/input-CC2joTjB.js +56 -0
- package/dist/key-layout-cR79xfGE.js +38 -0
- package/dist/lib/calculator/index.d.ts +16 -0
- package/dist/lib/calculator-field/index.d.ts +12 -0
- package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +2 -2
- package/dist/lib/components/ui/feedback/moment/moment-body.d.ts +17 -2
- package/dist/lib/components/ui/feedback/moment/moment-passive.d.ts +13 -0
- package/dist/lib/components/ui/feedback/moment/moment.d.ts +16 -2
- package/dist/lib/components/ui/fields/calculator-field/apply-calculated.d.ts +17 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-field-content.d.ts +16 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-field-trigger.d.ts +4 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-field.d.ts +12 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-field.types.d.ts +31 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-form-field.d.ts +4 -0
- package/dist/lib/components/ui/fields/calculator-field/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/calculator-field/use-calculator-field.d.ts +15 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/currency-field/currency-field.d.ts +7 -1
- package/dist/lib/components/ui/layout/app-shell/app-sidebar-context.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-announce.d.ts +27 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-clipboard.d.ts +19 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-context.d.ts +49 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-feedback.d.ts +18 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-keyboard.d.ts +30 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-storage.d.ts +17 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-variant-steps.d.ts +16 -0
- package/dist/lib/components/ui/widgets/calculator/calculator.d.ts +11 -0
- package/dist/lib/components/ui/widgets/calculator/calculator.selectors.d.ts +23 -0
- package/dist/lib/components/ui/widgets/calculator/calculator.slice.d.ts +1881 -0
- package/dist/lib/components/ui/widgets/calculator/currency.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/engine.d.ts +22 -0
- package/dist/lib/components/ui/widgets/calculator/index.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-announcer.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-display.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-key.d.ts +17 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +8 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-loading.d.ts +6 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-memory.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-panel-announce.d.ts +10 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-panel-body.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-screen.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-segment.d.ts +21 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-shell.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-switcher.d.ts +5 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-tape.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-tools.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/partials/keypad-navigation.d.ts +24 -0
- package/dist/lib/components/ui/widgets/calculator/types.d.ts +102 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-clipboard.d.ts +19 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-conversion.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-feedback.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-keyboard.d.ts +22 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-persistence.d.ts +14 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-pos.d.ts +25 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-press.d.ts +26 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-tape.d.ts +29 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-value.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-variant.d.ts +23 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator.d.ts +10 -0
- package/dist/lib/components/ui/widgets/calculator/use-engine-settings.d.ts +10 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-fields.d.ts +19 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-labels.d.ts +17 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-math.d.ts +31 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-names.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-panel.d.ts +7 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-rates.d.ts +29 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-result.d.ts +15 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-state.d.ts +36 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/use-conversion.d.ts +24 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-change.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-figures.d.ts +43 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-format.d.ts +12 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-loan-math.d.ts +14 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-loan.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-margin.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-math.d.ts +10 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-panel.d.ts +7 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-parts.d.ts +35 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-table.d.ts +7 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-vat.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +51 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-announce.d.ts +16 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-aside.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-display.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-fields.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-layout.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-line.d.ts +6 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-names.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-state.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-tender.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-ticket-data.d.ts +41 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-ticket.d.ts +5 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-totals.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-types.d.ts +76 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-vat.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-view.d.ts +28 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-announce.d.ts +19 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-base.d.ts +11 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-bitpad.d.ts +14 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-display.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-layout.d.ts +6 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-names.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-readouts.d.ts +14 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-reduce.d.ts +29 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-state.d.ts +22 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-toolbar.d.ts +5 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-word.d.ts +15 -0
- package/dist/lib/components/ui/widgets/calculator/variants/registry.d.ts +21 -0
- package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-layout.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-names.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-toolbar.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/standard/standard-layout.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/variant-loader.d.ts +34 -0
- package/dist/lib/components/ui/widgets/calculator/variants/variant-logic.d.ts +40 -0
- package/dist/lib/components/ui/widgets/calculator/variants/variant-types.d.ts +62 -0
- package/dist/lib/i18n/resources/en/en.d.ts +412 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +412 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +412 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +412 -0
- package/dist/lib/i18n/resources/resources.d.ts +824 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +4 -3
- package/dist/main.js +50 -40
- package/dist/map.js +66 -65
- package/dist/material.css +1 -1
- package/dist/native-select-w_FlBLHV.js +40 -0
- package/dist/number.utils-CSueQZcv.js +7 -0
- package/dist/pdf-reader.js +1 -1
- package/dist/percent-field-lahyDJDG.js +14 -0
- package/dist/picker-surface-CV09H7Nb.js +1220 -0
- package/dist/popover-Cd7DkND4.js +233 -0
- package/dist/pos-types-DKCkOTYy.js +49 -0
- package/dist/pos-variant-GrUfbTTP.js +603 -0
- package/dist/print.js +1 -1
- package/dist/programmer-variant-eKJNKENL.js +501 -0
- package/dist/programmer-word-CNCF7DJF.js +15 -0
- package/dist/{public-DC9VQw4Z.js → public-y6g4ddxd.js} +895 -892
- package/dist/{rich-code-block-DBSL9zEN.js → rich-code-block-CRQ0iyLb.js} +5 -5
- package/dist/scientific-variant-2y3UxAAU.js +149 -0
- package/dist/{sortable-provider-C4tk5esY.js → sortable-provider-DdiI3Fwk.js} +2 -2
- package/dist/{spinner-B2MubVWb.js → spinner-C1QIewWv.js} +133 -159
- package/dist/standard-layout-BuSRr3TY.js +40 -0
- package/dist/tabs-DzEqMb1W.js +383 -0
- package/dist/{icon-badge-B9uvDoyY.js → text-field-BAdY-kpO.js} +20 -34
- package/dist/theme-picker.js +3 -3
- package/dist/{theme-toggle-BInlu21G.js → theme-toggle-C_VeiiCm.js} +2 -2
- package/dist/toggle-FeCCJqbg.js +40 -0
- package/dist/{toggle-group-DXXlqid2.js → toggle-group-CVMxEpWi.js} +1 -1
- package/dist/{toolbar-items-CRJSx1MU.js → toolbar-items-D310xDuM.js} +333 -554
- package/dist/{translate-material-pVlPJ1v4.js → translate-material-BypJJ1l5.js} +1 -1
- package/dist/{translator-BoYCward.js → translator-DJkf4J7t.js} +824 -0
- package/dist/{typography-B6YMbCge.js → typography-CYEquVeb.js} +1 -1
- package/dist/{use-chat-composer-BvWQogJe.js → use-chat-composer-DMXu9E1O.js} +4198 -4600
- package/dist/{use-heading-spy-B_Z4ArDh.js → use-heading-spy-DJR8YYm6.js} +19 -19
- package/dist/{use-material-translation-CIS2n3RB.js → use-material-translation-CD6QoVal.js} +1 -1
- package/dist/{use-return-focus-DNQtADAR.js → use-return-focus-Cevw_6yq.js} +106 -105
- package/dist/useLatest-C2PnQEeD.js +8 -0
- package/docs/README.md +1 -0
- package/docs/components/feedback-and-status.md +10 -1
- package/docs/components/form-fields.md +1 -0
- package/docs/components/rich-widgets.md +108 -0
- package/docs/getting-started.md +1 -0
- package/docs/guides/calculator.md +468 -0
- package/docs/guides/forms.md +4 -2
- package/docs/guides/i18n.md +5 -0
- package/docs/previews/rich-widgets-calculator-conversion.webp +0 -0
- package/docs/previews/rich-widgets-calculator-point-of-sale.webp +0 -0
- package/docs/previews/rich-widgets-calculator.webp +0 -0
- package/docs/roadmap.md +9 -3
- package/docs/troubleshooting.md +134 -0
- package/lib/components/base-content.css +9 -4
- package/lib/components/ui/collections/server-table/server-table-phone-row.css +10 -3
- package/lib/components/ui/widgets/calculator/calculator-bands.css +146 -0
- package/lib/components/ui/widgets/calculator/calculator-display.css +83 -0
- package/lib/components/ui/widgets/calculator/calculator-keys.css +118 -0
- package/lib/components/ui/widgets/calculator/calculator-pos-ticket.css +185 -0
- package/lib/components/ui/widgets/calculator/calculator-pos.css +38 -0
- package/lib/components/ui/widgets/calculator/calculator-tape.css +71 -0
- package/lib/components/ui/widgets/calculator/calculator.css +97 -0
- package/lib/components/ui/widgets/calculator/variants/conversion/conversion.css +98 -0
- package/lib/components/ui/widgets/calculator/variants/financial/financial.css +162 -0
- package/lib/components/ui/widgets/calculator/variants/programmer/programmer.css +162 -0
- package/package.json +17 -3
- package/dist/dialog-AGsB3bv4.js +0 -219
- package/dist/dist-B7RjY7SL.js +0 -158
- 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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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] =
|
|
15
|
-
let { __scopeHoverCard: t, children:
|
|
16
|
-
prop:
|
|
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),
|
|
22
|
-
}, [
|
|
23
|
-
clearTimeout(
|
|
24
|
-
}, [
|
|
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(
|
|
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__ */ _(
|
|
37
|
-
...
|
|
38
|
-
children:
|
|
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:
|
|
43
|
-
return /* @__PURE__ */ _(
|
|
43
|
+
let { __scopeHoverCard: i, ...a } = e, o = E(O, i);
|
|
44
|
+
return /* @__PURE__ */ _(c, {
|
|
44
45
|
asChild: !0,
|
|
45
|
-
...w(
|
|
46
|
-
children: /* @__PURE__ */ _(
|
|
47
|
-
"data-state":
|
|
48
|
-
...
|
|
46
|
+
...w(i),
|
|
47
|
+
children: /* @__PURE__ */ _(n.a, {
|
|
48
|
+
"data-state": o.open ? "open" : "closed",
|
|
49
|
+
...a,
|
|
49
50
|
ref: t,
|
|
50
|
-
onPointerEnter:
|
|
51
|
-
onPointerLeave:
|
|
52
|
-
onFocus:
|
|
53
|
-
onBlur:
|
|
54
|
-
onTouchStart:
|
|
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:
|
|
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__ */ _(
|
|
63
|
-
present: n ||
|
|
64
|
-
children: /* @__PURE__ */ _(
|
|
63
|
+
children: /* @__PURE__ */ _(f, {
|
|
64
|
+
present: n || a.open,
|
|
65
|
+
children: /* @__PURE__ */ _(u, {
|
|
65
66
|
asChild: !0,
|
|
66
|
-
container:
|
|
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:
|
|
73
|
-
return /* @__PURE__ */ _(
|
|
74
|
-
present:
|
|
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":
|
|
77
|
+
"data-state": o.open ? "open" : "closed",
|
|
77
78
|
...a,
|
|
78
|
-
onPointerEnter:
|
|
79
|
-
onPointerLeave:
|
|
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:
|
|
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__ */ _(
|
|
106
|
+
}), /* @__PURE__ */ _(a, {
|
|
106
107
|
asChild: !0,
|
|
107
108
|
disableOutsidePointerEvents: !1,
|
|
108
109
|
onInteractOutside: u,
|
|
109
|
-
onEscapeKeyDown:
|
|
110
|
-
onPointerDownOutside:
|
|
111
|
-
onFocusOutside:
|
|
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__ */ _(
|
|
116
|
+
children: /* @__PURE__ */ _(o, {
|
|
116
117
|
...p,
|
|
117
118
|
...d,
|
|
118
|
-
onPointerDown:
|
|
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-
|
|
3
|
-
import { i as u, n as d, r as f, t as p } from "./translate-material-
|
|
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-
|
|
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,
|
|
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 =
|
|
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(
|
|
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(
|
|
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 {
|
|
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
|
|
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({
|
|
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,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,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 {};
|