@nxgt/material 3.100.1 → 3.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +32 -2
  3. package/dist/{alert-dialog-DYzxchiS.js → alert-dialog-NFyAiSqc.js} +1 -1
  4. package/dist/{async-slice-drJyPvuM.js → async-slice-D35bX79S.js} +1 -1
  5. package/dist/{bubble-input-CQwVSoU3.js → bubble-input-BxI1WmNs.js} +17 -5
  6. package/dist/{button-GeIsUekU.js → button-Be7GZzF9.js} +2 -2
  7. package/dist/{calculator-BS4PAm6l.js → calculator-BGy1Q7rn.js} +261 -460
  8. package/dist/calculator-field.js +7 -7
  9. package/dist/{calculator-segment-CEdwE24M.js → calculator-segment-uixk6lBg.js} +1 -1
  10. package/dist/calculator.js +1 -1
  11. package/dist/charts.js +3 -3
  12. package/dist/{chip-BdEtFQ85.js → chip-3rWebZEM.js} +2 -2
  13. package/dist/{code-editor-BByXZOGy.js → code-editor-BqSVMfy-.js} +178 -177
  14. package/dist/code-editor.js +5 -5
  15. package/dist/{code-language-items-CSZX5zxD.js → code-language-items-Cf2LJVg2.js} +14 -5
  16. package/dist/components/ui/actions/action-card/action-card-tile.css +47 -0
  17. package/dist/components/ui/display/code/code-moonlight.css +10 -10
  18. package/dist/{components-BrZkSs3O.js → components-D2liJ9Yu.js} +17725 -17287
  19. package/dist/components.js +38 -37
  20. package/dist/{conversion-variant-DTQqAyDt.js → conversion-variant-clFZ6ZMJ.js} +5 -5
  21. package/dist/{currency-field-Dnju7ss2.js → currency-field-CBFEVNM1.js} +24 -23
  22. package/dist/{dialog-5_2__tu8.js → dialog-CrIIINTk.js} +3 -3
  23. package/dist/dnd.js +1 -1
  24. package/dist/{dropdown-menu-FdGC5kIP.js → dropdown-menu-BnfLWu8n.js} +1 -1
  25. package/dist/editor.js +9 -9
  26. package/dist/{empty-state-BoepPG5v.js → empty-state-CuUaCPY7.js} +1 -1
  27. package/dist/{field-blur-DkiZOVNV.js → field-blur-DMJwPLsg.js} +9 -9
  28. package/dist/field-blur-context-3rKussBQ.js +29 -0
  29. package/dist/{financial-variant-BhqJp5C-.js → financial-variant-BY_VCUuk.js} +5 -5
  30. package/dist/{hooks-C8MhL6hs.js → hooks-hHoZbL-4.js} +106 -61
  31. package/dist/hooks.js +6 -6
  32. package/dist/{hover-card-CmHJeBeY.js → hover-card-Do2-uzlF.js} +1 -1
  33. package/dist/i18n.js +3 -3
  34. package/dist/{icon-badge-LGUPQh_c.js → icon-badge-CHaVNEmb.js} +1 -1
  35. package/dist/{icon-button-BSVpO1jP.js → icon-button-BIAubLeJ.js} +1 -1
  36. package/dist/key-layout-D2goCDkD.js +31 -0
  37. package/dist/keypad.js +551 -0
  38. package/dist/label-DR-zZyGQ.js +47 -0
  39. package/dist/lib/components/ui/display/code/code-block-parts.d.ts +1 -1
  40. package/dist/lib/components/ui/display/code/code-block.d.ts +4 -1
  41. package/dist/lib/components/ui/display/code/languages.d.ts +2 -0
  42. package/dist/lib/components/ui/display/code/moonlight-tokens.d.ts +10 -10
  43. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-props.d.ts +73 -0
  44. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-rules.d.ts +12 -0
  45. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog.d.ts +5 -61
  46. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-footer.d.ts +12 -0
  47. package/dist/lib/components/ui/feedback/confirm-dialog/confirm-phrase.d.ts +26 -0
  48. package/dist/lib/components/ui/feedback/confirm-dialog/use-confirm-action.d.ts +1 -1
  49. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  50. package/dist/lib/components/ui/layout/index.d.ts +1 -0
  51. package/dist/lib/components/ui/layout/panel-card/index.d.ts +1 -0
  52. package/dist/lib/components/ui/layout/panel-card/panel-card.d.ts +21 -0
  53. package/dist/lib/components/ui/selection/index.d.ts +1 -0
  54. package/dist/lib/components/ui/selection/status-menu/index.d.ts +3 -0
  55. package/dist/lib/components/ui/selection/status-menu/partials/status-confirm.d.ts +12 -0
  56. package/dist/lib/components/ui/selection/status-menu/partials/status-icon.d.ts +6 -0
  57. package/dist/lib/components/ui/selection/status-menu/partials/status-items.d.ts +18 -0
  58. package/dist/lib/components/ui/selection/status-menu/partials/status-menu-list.d.ts +14 -0
  59. package/dist/lib/components/ui/selection/status-menu/partials/status-sheet-row.d.ts +11 -0
  60. package/dist/lib/components/ui/selection/status-menu/partials/status-sheet.d.ts +21 -0
  61. package/dist/lib/components/ui/selection/status-menu/partials/status-trigger.d.ts +18 -0
  62. package/dist/lib/components/ui/selection/status-menu/status-menu-data.d.ts +12 -0
  63. package/dist/lib/components/ui/selection/status-menu/status-menu-form-field.d.ts +20 -0
  64. package/dist/lib/components/ui/selection/status-menu/status-menu.d.ts +13 -0
  65. package/dist/lib/components/ui/selection/status-menu/types.d.ts +76 -0
  66. package/dist/lib/components/ui/selection/status-menu/use-status-change.d.ts +18 -0
  67. package/dist/lib/components/ui/selection/status-menu/use-status-menu.d.ts +30 -0
  68. package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +1 -5
  69. package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +3 -49
  70. package/dist/lib/components/ui/widgets/keypad/cash-model.d.ts +16 -0
  71. package/dist/lib/components/ui/widgets/keypad/index.d.ts +5 -0
  72. package/dist/lib/components/ui/widgets/keypad/key-layout.d.ts +56 -0
  73. package/dist/lib/components/ui/widgets/keypad/keypad-binding.d.ts +32 -0
  74. package/dist/lib/components/ui/widgets/keypad/keypad-cash.d.ts +28 -0
  75. package/dist/lib/components/ui/widgets/keypad/keypad-display.d.ts +11 -0
  76. package/dist/lib/components/ui/widgets/keypad/keypad-entry.d.ts +39 -0
  77. package/dist/lib/components/ui/widgets/keypad/keypad-grid.d.ts +27 -0
  78. package/dist/lib/components/ui/widgets/{calculator/partials/calculator-key.d.ts → keypad/keypad-key.d.ts} +6 -3
  79. package/dist/lib/components/ui/widgets/keypad/keypad-layout.d.ts +19 -0
  80. package/dist/lib/components/ui/widgets/{calculator/partials → keypad}/keypad-navigation.d.ts +1 -1
  81. package/dist/lib/components/ui/widgets/keypad/keypad.d.ts +9 -0
  82. package/dist/lib/components/ui/widgets/keypad/keypad.types.d.ts +91 -0
  83. package/dist/lib/components/ui/widgets/keypad/use-keypad-cash.d.ts +14 -0
  84. package/dist/lib/components/ui/widgets/keypad/use-keypad-keyboard.d.ts +7 -0
  85. package/dist/lib/components/ui/widgets/keypad/use-keypad-number.d.ts +10 -0
  86. package/dist/lib/components/ui/widgets/keypad/use-keypad-quantity.d.ts +16 -0
  87. package/dist/lib/components/ui/widgets/keypad/use-keypad-value.d.ts +17 -0
  88. package/dist/lib/components/ui/widgets/keypad/use-keypad.d.ts +23 -0
  89. package/dist/lib/hooks/index.d.ts +2 -0
  90. package/dist/lib/hooks/use-barcode-scanner.d.ts +39 -0
  91. package/dist/lib/hooks/use-latched.d.ts +18 -0
  92. package/dist/lib/i18n/resources/en/en.d.ts +25 -0
  93. package/dist/lib/i18n/resources/en/material.json.d.ts +26 -1
  94. package/dist/lib/i18n/resources/fr/fr.d.ts +25 -0
  95. package/dist/lib/i18n/resources/fr/material.json.d.ts +26 -1
  96. package/dist/lib/i18n/resources/resources.d.ts +50 -0
  97. package/dist/lib/i18n/translator.d.ts +1 -1
  98. package/dist/lib/keypad/index.d.ts +20 -0
  99. package/dist/lib.js +1 -1
  100. package/dist/main.js +54 -53
  101. package/dist/map.js +9 -9
  102. package/dist/material.css +1 -1
  103. package/dist/pdf-reader.js +1 -1
  104. package/dist/{percent-field-DGlU_xii.js → percent-field-DU8eIMD3.js} +15 -14
  105. package/dist/{picker-surface-CGhqNR8a.js → picker-surface-XmA--JVI.js} +4 -4
  106. package/dist/{popover-ZxL7ktKk.js → popover-D8iHiAbl.js} +1 -1
  107. package/dist/{pos-types-BQ0QpYMp.js → pos-types-BEAY27Rm.js} +1 -1
  108. package/dist/{pos-variant-CKy8h_5i.js → pos-variant-ClGI92Lt.js} +25 -25
  109. package/dist/print.js +1 -1
  110. package/dist/{programmer-variant-CbHstE28.js → programmer-variant-Boq2O8hB.js} +30 -30
  111. package/dist/{public-D-tdOz4b.js → public-DOrXKmcL.js} +9 -9
  112. package/dist/{rich-code-block-CTPj1LuD.js → rich-code-block-Djj2XE_u.js} +18 -18
  113. package/dist/{scientific-variant-B8U9h3II.js → scientific-variant-BzF_aMQP.js} +8 -8
  114. package/dist/{sortable-provider-CSoWE7Ce.js → sortable-provider-DCZjsIIH.js} +2 -2
  115. package/dist/{spinner-ffuwBXHl.js → spinner-Cg0y_E_K.js} +1 -1
  116. package/dist/standard-layout-DTr9yy8Z.js +48 -0
  117. package/dist/{tabs-JgRq6ZJx.js → tabs-DpessV5s.js} +1 -1
  118. package/dist/{text-field-DURkIP-v.js → text-field-Dxk9lAKM.js} +16 -15
  119. package/dist/theme-picker.js +13 -13
  120. package/dist/{theme-toggle-n_Zg7JAA.js → theme-toggle-B6Jl5Kfn.js} +1 -1
  121. package/dist/{toolbar-items-IANZdcw4.js → toolbar-items-Cs1XrZsH.js} +4 -4
  122. package/dist/{translate-material-CMHUH5Ha.js → translate-material-Du0j0t97.js} +1 -1
  123. package/dist/{translator-9zA-Um3W.js → translator-BVs4n0Fz.js} +52 -2
  124. package/dist/use-calculator-keyboard-BZ1CA4Ut.js +222 -0
  125. package/dist/{use-chat-composer-BoIN7RCA.js → use-chat-composer-B4m3OEm1.js} +241 -240
  126. package/dist/{use-heading-spy-8o20PEZH.js → use-heading-spy-CO3_AtY9.js} +240 -142
  127. package/dist/{use-material-translation-CLNaMhUf.js → use-material-translation-uNc1FyC8.js} +1 -1
  128. package/dist/{use-return-focus-DWhbTGVe.js → use-return-focus-AfLRrUm-.js} +1 -1
  129. package/docs/README.md +1 -0
  130. package/docs/components/README.md +1 -0
  131. package/docs/components/buttons-and-actions.md +34 -2
  132. package/docs/components/data-display.md +4 -1
  133. package/docs/components/feedback-and-status.md +34 -0
  134. package/docs/components/navigation-and-layout.md +28 -0
  135. package/docs/components/rich-widgets.md +28 -0
  136. package/docs/components/selection-and-choice.md +120 -0
  137. package/docs/guides/calculator.md +1 -1
  138. package/docs/guides/cards-and-tiles.md +21 -24
  139. package/docs/guides/forms.md +1 -0
  140. package/docs/guides/helpers.md +78 -0
  141. package/docs/guides/keypad.md +225 -0
  142. package/docs/previews/data-display-codeblock.webp +0 -0
  143. package/docs/previews/data-display-codegroup.webp +0 -0
  144. package/docs/previews/data-display-jsonviewer.webp +0 -0
  145. package/docs/previews/navigation-layout-panelcard.webp +0 -0
  146. package/docs/previews/rich-widgets-keypad.webp +0 -0
  147. package/docs/previews/selection-choice-statusmenu.webp +0 -0
  148. package/docs/roadmap.md +21 -0
  149. package/docs/troubleshooting.md +63 -0
  150. package/lib/components/ui/actions/action-card/action-card-tile.css +47 -0
  151. package/lib/components/ui/display/code/code-moonlight.css +10 -10
  152. package/lib/components/ui/widgets/calculator/calculator.css +87 -0
  153. package/package.json +7 -2
  154. package/dist/field-blur-context-BLGgf_3z.js +0 -73
  155. package/dist/key-layout-cR79xfGE.js +0 -38
  156. package/dist/standard-layout-BuSRr3TY.js +0 -40
@@ -0,0 +1,73 @@
1
+ import { ReactNode } from 'react';
2
+ import { ButtonVariant } from '../../actions/button/button.js';
3
+ import { ConfirmRefusalContext } from './confirm-alert.js';
4
+ import { ConfirmPhraseMatch } from './confirm-dialog-rules.js';
5
+ export interface ConfirmDialogProps {
6
+ open: boolean;
7
+ onOpenChange: (open: boolean) => void;
8
+ title: string;
9
+ /**
10
+ * The text under the title. A string renders in a paragraph; any other node
11
+ * (several paragraphs, a list, a link) renders in a `div`, so block children
12
+ * are valid HTML. Either way it names the dialog (`aria-describedby`).
13
+ */
14
+ description: ReactNode;
15
+ /**
16
+ * A note under the description, for what the user should know before
17
+ * confirming (what else is affected, what cannot be undone). It is part of
18
+ * what describes the dialog.
19
+ */
20
+ details?: ReactNode;
21
+ confirmLabel?: string;
22
+ cancelLabel?: string;
23
+ /**
24
+ * The variant of the Cancel button. Default `'tonal'`; `'outlined'` or
25
+ * `'ghost'` restores the earlier look.
26
+ */
27
+ cancelVariant?: ButtonVariant;
28
+ /**
29
+ * Runs when the user confirms. The dialog stays open, with its buttons
30
+ * disabled, until the returned promise settles. It closes on success; on
31
+ * a throw or a rejection it stays open and shows the error's message, so
32
+ * the user can retry or cancel (or only cancel, with `lockOnRefusal`).
33
+ */
34
+ onConfirm: () => void | Promise<void>;
35
+ variant?: 'default' | 'destructive';
36
+ loading?: boolean;
37
+ /** Disables the confirm button, for example while an error of yours stands. */
38
+ confirmDisabled?: boolean;
39
+ /**
40
+ * Disables the confirm button once `onConfirm` has refused (thrown), so a
41
+ * retry that cannot succeed is not invited. Cancel stays. It clears when the
42
+ * dialog reopens. Off by default: the refused action may be retried.
43
+ */
44
+ lockOnRefusal?: boolean;
45
+ /**
46
+ * Renders the refusal inside the dialog's error alert instead of the plain
47
+ * message, so it can carry a link (to the records that block a delete, for
48
+ * example). Receives the message, what `onConfirm` threw and `close()`. The alert keeps `role="alert"`.
49
+ * By default an `ActionRefusal` thrown by `onConfirm` shows its details and
50
+ * its action under the message; any other error shows its message.
51
+ */
52
+ refusal?: (refusal: ConfirmRefusalContext) => ReactNode;
53
+ /**
54
+ * Asks the user to type this text before Confirm enables, for a deletion
55
+ * worth a second thought. A field labelled "Type {phrase} to confirm"
56
+ * (translated, the phrase in code style) takes the focus on open and starts
57
+ * empty each time the dialog opens; paste is allowed. Enter in it confirms
58
+ * only once it matches. Unset or empty: no field.
59
+ */
60
+ confirmPhrase?: string;
61
+ /**
62
+ * How the typed text is compared with `confirmPhrase`: `'exact'` (default),
63
+ * `'trim'` (spaces around the text ignored) or `'trim-case-insensitive'`.
64
+ */
65
+ confirmPhraseMatch?: ConfirmPhraseMatch;
66
+ /**
67
+ * Called as the dialog closes, before the focus goes back to what opened
68
+ * it. `event.preventDefault()` places the focus yourself, for example
69
+ * `ctx.focusTrigger()` of a ServerTable bulk action, whose button a redraw
70
+ * may have replaced.
71
+ */
72
+ onCloseAutoFocus?: (event: Event) => void;
73
+ }
@@ -15,3 +15,15 @@ export declare function confirmIsDisabled({ busy, confirmDisabled, lockOnRefusal
15
15
  lockOnRefusal?: boolean;
16
16
  error: string | null;
17
17
  }): boolean;
18
+ /**
19
+ * How the typed text is compared with `confirmPhrase`: `'exact'` (the
20
+ * default) character for character, `'trim'` ignoring spaces around the text,
21
+ * `'trim-case-insensitive'` ignoring those and the letter case.
22
+ */
23
+ export type ConfirmPhraseMatch = 'exact' | 'trim' | 'trim-case-insensitive';
24
+ /**
25
+ * Whether the typed text satisfies the phrase. An empty phrase never asks for
26
+ * anything (always true); the phrase itself is trimmed the same way as the
27
+ * input in the `trim` modes.
28
+ */
29
+ export declare function confirmPhraseMatches(typed: string, phrase: string, mode?: ConfirmPhraseMatch): boolean;
@@ -1,61 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { ButtonVariant } from '../../actions/button/button.js';
3
- import { ConfirmRefusalContext } from './confirm-alert.js';
4
- export type { ConfirmRefusalContext };
5
- export interface ConfirmDialogProps {
6
- open: boolean;
7
- onOpenChange: (open: boolean) => void;
8
- title: string;
9
- /**
10
- * The text under the title. A string renders in a paragraph; any other node
11
- * (several paragraphs, a list, a link) renders in a `div`, so block children
12
- * are valid HTML. Either way it names the dialog (`aria-describedby`).
13
- */
14
- description: ReactNode;
15
- /**
16
- * A note under the description, for what the user should know before
17
- * confirming (what else is affected, what cannot be undone). It is part of
18
- * what describes the dialog.
19
- */
20
- details?: ReactNode;
21
- confirmLabel?: string;
22
- cancelLabel?: string;
23
- /**
24
- * The variant of the Cancel button. Default `'tonal'`; `'outlined'` or
25
- * `'ghost'` restores the earlier look.
26
- */
27
- cancelVariant?: ButtonVariant;
28
- /**
29
- * Runs when the user confirms. The dialog stays open, with its buttons
30
- * disabled, until the returned promise settles. It closes on success; on
31
- * a throw or a rejection it stays open and shows the error's message, so
32
- * the user can retry or cancel (or only cancel, with `lockOnRefusal`).
33
- */
34
- onConfirm: () => void | Promise<void>;
35
- variant?: 'default' | 'destructive';
36
- loading?: boolean;
37
- /** Disables the confirm button, for example while an error of yours stands. */
38
- confirmDisabled?: boolean;
39
- /**
40
- * Disables the confirm button once `onConfirm` has refused (thrown), so a
41
- * retry that cannot succeed is not invited. Cancel stays. It clears when the
42
- * dialog reopens. Off by default: the refused action may be retried.
43
- */
44
- lockOnRefusal?: boolean;
45
- /**
46
- * Renders the refusal inside the dialog's error alert instead of the plain
47
- * message, so it can carry a link (to the records that block a delete, for
48
- * example). Receives the message, what `onConfirm` threw and `close()`. The alert keeps `role="alert"`.
49
- * By default an `ActionRefusal` thrown by `onConfirm` shows its details and
50
- * its action under the message; any other error shows its message.
51
- */
52
- refusal?: (refusal: ConfirmRefusalContext) => ReactNode;
53
- /**
54
- * Called as the dialog closes, before the focus goes back to what opened
55
- * it. `event.preventDefault()` places the focus yourself, for example
56
- * `ctx.focusTrigger()` of a ServerTable bulk action, whose button a redraw
57
- * may have replaced.
58
- */
59
- onCloseAutoFocus?: (event: Event) => void;
60
- }
61
- export declare function ConfirmDialog({ open, onOpenChange, title, description, details, confirmLabel, cancelLabel, cancelVariant, onConfirm, variant, loading, confirmDisabled, lockOnRefusal, refusal, onCloseAutoFocus, }: ConfirmDialogProps): import("react").JSX.Element;
1
+ import { ConfirmDialogProps } from './confirm-dialog-props.js';
2
+ export type { ConfirmRefusalContext } from './confirm-alert.js';
3
+ export type { ConfirmPhraseMatch } from './confirm-dialog-rules.js';
4
+ export type { ConfirmDialogProps };
5
+ export declare function ConfirmDialog(props: ConfirmDialogProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { MouseEvent } from 'react';
2
+ import { ButtonVariant } from '../../actions/button/button.js';
3
+ /** A confirm dialog's Cancel and Confirm buttons. */
4
+ export declare function ConfirmFooter({ variant, busy, disabled, cancelLabel, confirmLabel, cancelVariant, onConfirm, }: {
5
+ variant: 'default' | 'destructive';
6
+ busy: boolean;
7
+ disabled: boolean;
8
+ cancelLabel?: string;
9
+ confirmLabel?: string;
10
+ cancelVariant?: ButtonVariant;
11
+ onConfirm: (event: MouseEvent<HTMLButtonElement>) => void;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { Ref } from 'react';
2
+ import { ConfirmPhraseMatch } from './confirm-dialog-rules.js';
3
+ /**
4
+ * The "type the value to confirm" field of a `ConfirmDialog`: a label that
5
+ * shows the phrase in code style, and an input that takes any paste. The
6
+ * dialog owns the value; Enter is handed back only while it matches.
7
+ */
8
+ export declare function ConfirmPhraseField({ phrase, value, onValueChange, onEnter, disabled, inputRef, }: {
9
+ phrase: string;
10
+ value: string;
11
+ onValueChange: (value: string) => void;
12
+ onEnter: () => void;
13
+ disabled: boolean;
14
+ inputRef: Ref<HTMLInputElement>;
15
+ }): import("react").JSX.Element;
16
+ /**
17
+ * The typed text of a `ConfirmDialog`'s phrase field: it starts empty each
18
+ * time the dialog opens, `missing` says Confirm must wait, and `ref` is the
19
+ * input the dialog focuses on open.
20
+ */
21
+ export declare function useConfirmPhrase(open: boolean, phrase: string | undefined, match: ConfirmPhraseMatch): {
22
+ ref: import('react').RefObject<HTMLInputElement | null>;
23
+ typed: string;
24
+ setTyped: import('react').Dispatch<import('react').SetStateAction<string>>;
25
+ missing: boolean;
26
+ };
@@ -13,7 +13,7 @@ export declare function useConfirmAction({ open, onOpenChange, onConfirm, }: {
13
13
  error: string | null;
14
14
  cause: unknown;
15
15
  handleOpenChange: (value: boolean) => void;
16
- handleConfirm: (event: MouseEvent<HTMLButtonElement>) => Promise<void>;
16
+ handleConfirm: (event: Pick<MouseEvent, "preventDefault">) => Promise<void>;
17
17
  };
18
18
  /**
19
19
  * A ref for a modal's content that takes the focus while `pending`: the