@nxgt/material 2.15.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/README.md +9 -4
  3. package/dist/{_Uint8Array-QCcRMhXd.js → _Uint8Array-C7apDrb7.js} +1 -1
  4. package/dist/{_overRest-C21ZmKyH.js → _overRest-CCAbV-eT.js} +1 -1
  5. package/dist/async-slice-Cuekts5f.js +459 -0
  6. package/dist/{blockDiagram-BEXU5L5S-BozTHxCb.js → blockDiagram-BEXU5L5S-K2MjXCm9.js} +2 -2
  7. package/dist/{chunk-3FUC2YCW-zWkkqKwC.js → chunk-3FUC2YCW-6KyD6CAZ.js} +2 -2
  8. package/dist/{chunk-7M6MHVWA-CGHIsno5.js → chunk-7M6MHVWA-CNWcBB_6.js} +1 -1
  9. package/dist/{chunk-GNY47TPC-BWB3R7nr.js → chunk-GNY47TPC-DdqgSBxM.js} +4 -4
  10. package/dist/{chunk-NETBCI7D-DwmNwFxb.js → chunk-NETBCI7D-ZnunhYtw.js} +1 -1
  11. package/dist/{chunk-Z7XXMR3K-0DGn7Rxi.js → chunk-Z7XXMR3K-C8MhuVIi.js} +1 -1
  12. package/dist/{classDiagram-v2-NBCMYWYE-BERam5ND.js → classDiagram-v2-NBCMYWYE-ByUAGkfa.js} +2 -2
  13. package/dist/components/components.css +1 -0
  14. package/dist/components/print-only.css +44 -0
  15. package/dist/{components-B-xPQ6XX.js → components-CIYQrI45.js} +59481 -58962
  16. package/dist/components.js +6 -6
  17. package/dist/{dagre-6A5THRUB-CnIZQoNt.js → dagre-6A5THRUB-C2vz5UY9.js} +64 -64
  18. package/dist/{diagram-22UHCM2B-DN4-okl5.js → diagram-22UHCM2B-DREk9ku4.js} +2 -2
  19. package/dist/{diagram-3UASUU5V-DcrNf7TY.js → diagram-3UASUU5V-CYkPaos5.js} +1 -1
  20. package/dist/dnd.js +1 -1
  21. package/dist/{elk-276RUBZZ-B7yctkbs.js → elk-276RUBZZ-CK4KoCtK.js} +3 -3
  22. package/dist/{erDiagram-OPXOYQCR-BVrTNrkn.js → erDiagram-OPXOYQCR-CTfn8QUl.js} +2 -2
  23. package/dist/{field-blur-DDfQkuSJ.js → field-blur-3RW0mJb2.js} +2 -2
  24. package/dist/{flowDiagram-KWPJA3E3-BKxvqo0x.js → flowDiagram-KWPJA3E3-CDzuzre6.js} +3 -3
  25. package/dist/{ganttDiagram-FUAMR5RP-Cv9W4LOS.js → ganttDiagram-FUAMR5RP-Ci-9ZJz5.js} +1 -1
  26. package/dist/{graphlib-CbcZi5bx.js → graphlib-DxjKaXeR.js} +42 -42
  27. package/dist/hooks.js +38 -26
  28. package/dist/{i18n-provider-D5hkauu6.js → i18n-provider-Dv9ZSmgO.js} +1 -1
  29. package/dist/i18n.js +6 -6
  30. package/dist/{isArrayLikeObject-COiPdhFP.js → isArrayLikeObject-H8k6W51O.js} +3 -3
  31. package/dist/{isEmpty-B7UlCLih.js → isEmpty-B0Bavg-e.js} +9 -9
  32. package/dist/{journeyDiagram-ZHPQQLJL-BwSv9L1j.js → journeyDiagram-ZHPQQLJL-CwFYd51O.js} +1 -1
  33. package/dist/lib/components/ui/actions/copy-button/use-copy-status.d.ts +13 -0
  34. package/dist/lib/components/ui/display/chip/chip.d.ts +18 -3
  35. package/dist/lib/components/ui/display/chip/chip.variants.d.ts +10 -0
  36. package/dist/lib/components/ui/display/chip/index.d.ts +1 -0
  37. package/dist/lib/components/ui/display/chip/partials/chip-dismiss-button.d.ts +3 -1
  38. package/dist/lib/components/ui/display/enrolment-secret/enrolment-secret.d.ts +30 -0
  39. package/dist/lib/components/ui/display/enrolment-secret/index.d.ts +2 -0
  40. package/dist/lib/components/ui/display/enrolment-secret/use-enrolment-secret-labels.d.ts +11 -0
  41. package/dist/lib/components/ui/display/index.d.ts +2 -0
  42. package/dist/lib/components/ui/display/recovery-codes/index.d.ts +4 -0
  43. package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-actions.d.ts +14 -0
  44. package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-confirm.d.ts +13 -0
  45. package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-list.d.ts +5 -0
  46. package/dist/lib/components/ui/display/recovery-codes/recovery-codes.d.ts +8 -0
  47. package/dist/lib/components/ui/display/recovery-codes/types.d.ts +64 -0
  48. package/dist/lib/components/ui/display/recovery-codes/use-recovery-codes-labels.d.ts +7 -0
  49. package/dist/lib/components/ui/fields/form-section/form-section-classes.d.ts +30 -0
  50. package/dist/lib/components/ui/fields/form-section/form-section.d.ts +25 -0
  51. package/dist/lib/components/ui/fields/form-section/index.d.ts +1 -0
  52. package/dist/lib/components/ui/fields/index.d.ts +1 -0
  53. package/dist/lib/components/ui/forms/index.d.ts +1 -0
  54. package/dist/lib/components/ui/forms/use-code-resolver.d.ts +42 -0
  55. package/dist/lib/components/ui/layout/auth-card/auth-card-notice.d.ts +18 -0
  56. package/dist/lib/components/ui/layout/auth-card/auth-card.d.ts +35 -0
  57. package/dist/lib/components/ui/layout/auth-card/index.d.ts +1 -0
  58. package/dist/lib/components/ui/layout/index.d.ts +1 -0
  59. package/dist/lib/components/ui/selection/select-field/select-field.d.ts +5 -2
  60. package/dist/lib/hooks/index.d.ts +2 -0
  61. package/dist/lib/hooks/use-focus-on-mount.d.ts +24 -0
  62. package/dist/lib/hooks/use-submit-once.d.ts +32 -0
  63. package/dist/lib/i18n/resources/en/en.d.ts +21 -0
  64. package/dist/lib/i18n/resources/en/material.json.d.ts +22 -1
  65. package/dist/lib/i18n/resources/fr/fr.d.ts +21 -0
  66. package/dist/lib/i18n/resources/fr/material.json.d.ts +22 -1
  67. package/dist/lib/i18n/resources/resources.d.ts +42 -0
  68. package/dist/lib/i18n/translator.d.ts +1 -1
  69. package/dist/lib/lib/index.d.ts +1 -0
  70. package/dist/lib.js +58 -102
  71. package/dist/main.js +16 -16
  72. package/dist/map.js +22 -22
  73. package/dist/material.css +1 -1
  74. package/dist/{merge-KEf_u3Zy.js → merge-Js8537dg.js} +4 -4
  75. package/dist/{mermaid.core-D_eXACPr.js → mermaid.core-DW7UlwJu.js} +21 -21
  76. package/dist/{mindmap-definition-NLK3R4M7-GMAPXP2T.js → mindmap-definition-NLK3R4M7-CsLyIyEF.js} +2 -2
  77. package/dist/{pieDiagram-5QR66LMP--qZHRFqG.js → pieDiagram-5QR66LMP-C-dfffj5.js} +1 -1
  78. package/dist/print.js +2 -2
  79. package/dist/{quadrantDiagram-O4NWA36T-BxFGymBB.js → quadrantDiagram-O4NWA36T-DZ0TivLD.js} +1 -1
  80. package/dist/{requirementDiagram-PLB6GJNP-D4aL7HiM.js → requirementDiagram-PLB6GJNP-3brF-h1L.js} +2 -2
  81. package/dist/{sankeyDiagram-IPEJSGJF-zX1FL2aL.js → sankeyDiagram-IPEJSGJF-BY-LLyiZ.js} +1 -1
  82. package/dist/{sortable-provider-C8mr3XP2.js → sortable-provider-CUT5Wfdl.js} +1 -1
  83. package/dist/{stateDiagram-v2-GCMORJYK-CDm1mDv2.js → stateDiagram-v2-GCMORJYK-BGavr7Nm.js} +2 -2
  84. package/dist/{stored-language-g121Yv0w.js → stored-language-BKoohv2_.js} +44 -2
  85. package/dist/{swimlanes-2SLR337P-DNwIhCCu.js → swimlanes-2SLR337P-B6Fkr7-U.js} +3 -3
  86. package/dist/{swimlanesDiagram-TC7HE7FX-BaR9zAzq.js → swimlanesDiagram-TC7HE7FX-Dt6Tqj4h.js} +3 -3
  87. package/dist/{timeline-definition-EJHVYXUP-B6Xd8Spe.js → timeline-definition-EJHVYXUP-CE-3KwYd.js} +1 -1
  88. package/dist/{translate-material-D3Hp_AI5.js → translate-material-CCJg3yfc.js} +2 -2
  89. package/dist/{translator-BMFC0lBV.js → translator-DEde7BKz.js} +1 -1
  90. package/dist/{use-heading-spy-wlOv87q3.js → use-heading-spy-XkSExwoT.js} +67 -59
  91. package/dist/{use-material-translation-BGFp1yXp.js → use-material-translation-Cndoq_iK.js} +2 -2
  92. package/dist/{usecaseDiagram-POWQR4AR-XW5of8Kj.js → usecaseDiagram-POWQR4AR-CPOCe5We.js} +2 -2
  93. package/dist/{xychartDiagram-PMCCYNJV-DTV6AzhO.js → xychartDiagram-PMCCYNJV-Cleaihn8.js} +1 -1
  94. package/docs/components/README.md +3 -3
  95. package/docs/components/data-display.md +111 -2
  96. package/docs/components/data-table-filter-and-lists.md +5 -2
  97. package/docs/components/form-fields.md +78 -0
  98. package/docs/components/navigation-and-layout.md +51 -0
  99. package/docs/components/selection-and-choice.md +2 -1
  100. package/docs/guides/forms.md +111 -0
  101. package/docs/guides/helpers.md +81 -0
  102. package/docs/guides/i18n.md +17 -0
  103. package/docs/guides/printing.md +27 -0
  104. package/docs/previews/data-display-enrolmentsecret.webp +0 -0
  105. package/docs/previews/data-display-recoverycodes.webp +0 -0
  106. package/docs/previews/form-fields-formsection.webp +0 -0
  107. package/docs/previews/navigation-layout-authcard.webp +0 -0
  108. package/docs/roadmap.md +48 -15
  109. package/docs/troubleshooting.md +112 -0
  110. package/lib/components/components.css +1 -0
  111. package/lib/components/print-only.css +44 -0
  112. package/package.json +2 -2
  113. package/dist/async-slice-TBZ6Taw2.js +0 -411
@@ -0,0 +1,64 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ /** The heading levels the title may take. */
3
+ export type RecoveryCodesTitleElement = 'h2' | 'h3' | 'h4';
4
+ /** Every built-in string of {@link RecoveryCodes}, each overridable. */
5
+ export type RecoveryCodesLabels = {
6
+ /** Names the list of codes. "Recovery codes". */
7
+ list: string;
8
+ /** The copy button. "Copy codes". */
9
+ copy: string;
10
+ /** Announced once the codes are on the clipboard. "Codes copied". */
11
+ copied: string;
12
+ /** Announced when the clipboard refused them. "Copy failed". */
13
+ copyFailed: string;
14
+ /** The download button. "Download". */
15
+ download: string;
16
+ /** The print button. "Print". */
17
+ print: string;
18
+ /** The confirmation's label. "I have saved these codes". */
19
+ saved: string;
20
+ /** Under the confirmation once "Done" was pressed before it was ticked. */
21
+ savedRequired: string;
22
+ /** The button that calls `onDone`. "Done". */
23
+ done: string;
24
+ };
25
+ export type RecoveryCodesProps = Omit<ComponentProps<'div'>, 'title'> & {
26
+ /** The one-time codes, in the order they are shown and saved. */
27
+ codes: readonly string[];
28
+ /** The card's heading. "Recovery codes" by default. */
29
+ title?: ReactNode;
30
+ /** The heading element; `'h2'` by default. */
31
+ titleAs?: RecoveryCodesTitleElement;
32
+ /** A line under the title. */
33
+ description?: ReactNode;
34
+ /**
35
+ * A warning above the codes; a built-in one by default ("Each code works
36
+ * once…"). `false` hides it. Not printed.
37
+ */
38
+ warning?: ReactNode;
39
+ /**
40
+ * Moves the focus to the title once shown, as the codes replaced what the
41
+ * user acted on. Default `true`.
42
+ */
43
+ focusTitle?: boolean;
44
+ /** The downloaded file's name. Default `"recovery-codes.txt"`. */
45
+ fileName?: string;
46
+ /**
47
+ * The file's first line (the account the codes belong to); the title's
48
+ * text when it is a string, else "Recovery codes".
49
+ */
50
+ fileHeading?: string;
51
+ /** The file's second line; the warning's text when it is a string. */
52
+ fileNote?: string;
53
+ /**
54
+ * Called by the "Done" button, which is shown only when this is given and
55
+ * calls it only once the confirmation is ticked.
56
+ */
57
+ onDone?: () => void;
58
+ /** The confirmation, controlled; uncontrolled when left out. */
59
+ saved?: boolean;
60
+ /** Called when the confirmation is ticked or unticked. */
61
+ onSavedChange?: (saved: boolean) => void;
62
+ /** Overrides for the built-in strings. */
63
+ labels?: Partial<RecoveryCodesLabels>;
64
+ };
@@ -0,0 +1,7 @@
1
+ import { RecoveryCodesLabels } from './types';
2
+ /** The built-in title and warning, and the labels with their overrides. */
3
+ export declare function useRecoveryCodesLabels(overrides?: Partial<RecoveryCodesLabels>): {
4
+ labels: RecoveryCodesLabels;
5
+ title: string;
6
+ warning: string;
7
+ };
@@ -0,0 +1,30 @@
1
+ /** The heading elements a FormSection's title can render as. */
2
+ export type FormSectionTitleElement = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
3
+ /**
4
+ * The section: a whole row of the form's grid (`.form-grid-layout`
5
+ * `[data-slot="form-fields"]`), and a container of its own, so its fields
6
+ * take columns by the section's width, inside a form or standalone.
7
+ */
8
+ export declare const formSectionRootClass = "@container col-span-full flex w-full min-w-0 flex-col gap-2";
9
+ /**
10
+ * The rule between two sections: a top border on a section that follows
11
+ * another one, never on the first.
12
+ */
13
+ export declare const formSectionSeparatedClass = "[[data-slot=form-section]+&]:mt-2 [[data-slot=form-section]+&]:border-t [[data-slot=form-section]+&]:pt-4";
14
+ /** The title and the actions, which wrap under the title on a phone. */
15
+ export declare const formSectionHeaderClass = "flex min-w-0 flex-wrap items-center justify-between gap-2";
16
+ /**
17
+ * Set apart from the fields' labels, which read as titles: small, semibold,
18
+ * uppercase and muted. `text-muted-foreground` reads 4.5:1 on the form's
19
+ * background in both themes.
20
+ */
21
+ export declare const formSectionTitleClass = "min-w-0 break-words font-semibold text-muted-foreground text-sm uppercase tracking-wide";
22
+ export declare const formSectionActionsClass = "flex flex-wrap items-center gap-2";
23
+ export declare const formSectionDescriptionClass = "break-words text-muted-foreground text-sm";
24
+ /**
25
+ * The fields: one column on a phone, then the form grid's own columns. The
26
+ * form grid's wide-field rules (a switch, a textarea, chips, files, rich
27
+ * text on a row of their own) are descendant selectors under
28
+ * `[data-slot="form-fields"]`, so they still reach the fields in here.
29
+ */
30
+ export declare const formSectionFieldsClass = "grid min-w-0 grid-cols-1 place-items-start gap-2 @2xl:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4";
@@ -0,0 +1,25 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { FormSectionTitleElement } from './form-section-classes';
3
+ export type { FormSectionTitleElement } from './form-section-classes';
4
+ export type FormSectionProps = Omit<ComponentProps<'div'>, 'title'> & {
5
+ /** The section's heading. */
6
+ title: ReactNode;
7
+ /**
8
+ * The heading element; `'h2'` by default (a section under the page's
9
+ * `h1`). Pass `'h3'` when the form already sits under an `h2`.
10
+ */
11
+ titleAs?: FormSectionTitleElement;
12
+ /** A line under the title, tied to the group with `aria-describedby`. */
13
+ description?: ReactNode;
14
+ /** Controls beside the title (e.g. "Add"), wrapping under it on a phone. */
15
+ actions?: ReactNode;
16
+ /** A rule above the section when it follows another FormSection. Default `true`. */
17
+ separated?: boolean;
18
+ };
19
+ /**
20
+ * A titled section of a form: a heading, an optional description and
21
+ * actions, then its fields. Inside `.form-grid-layout`'s
22
+ * `[data-slot="form-fields"]` it takes a whole row and lays its fields out
23
+ * in the form's columns; one column on a phone.
24
+ */
25
+ export declare function FormSection({ title, titleAs: Title, description, actions, separated, className, children, ...props }: FormSectionProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './form-section';
@@ -5,6 +5,7 @@ export * from './country-field';
5
5
  export * from './currency-field';
6
6
  export * from './email-field';
7
7
  export * from './field';
8
+ export * from './form-section';
8
9
  export * from './inline-edit';
9
10
  export * from './input-group-field';
10
11
  export * from './number-field';
@@ -1 +1,2 @@
1
1
  export * from './form-field';
2
+ export * from './use-code-resolver';
@@ -0,0 +1,42 @@
1
+ import { CodeIssue } from '@nxgt/material-core/code-errors';
2
+ import { FieldValues, Resolver } from 'react-hook-form';
3
+ import { z } from 'zod';
4
+ import { Language, Translate } from '../../../i18n/types';
5
+ export { type CodeErrorMap, type CodeIssue, createCodeErrorMap, defaultCodeOf, isEmptyRequired, } from '@nxgt/material-core/code-errors';
6
+ export type CodeResolverOptions = {
7
+ /**
8
+ * The app's translator, `createTranslator(mergeResources(resources,
9
+ * appResources))`: it words the codes (`translate(code, params,
10
+ * language)`; a key it returns verbatim has no words) and is handed to
11
+ * `zodLocaleError`, so the app's `material.zod.*` overrides apply. Without
12
+ * it, every issue is worded by the package's own zod messages. Pass a
13
+ * stable function (module scope): a new one re-creates the resolver.
14
+ */
15
+ translate?: Translate<any>;
16
+ /**
17
+ * Which code an issue carries. Defaults to `defaultCodeOf`: a custom
18
+ * issue's `params.code`. Pass a stable function.
19
+ */
20
+ codeOf?: (issue: CodeIssue) => string | undefined;
21
+ /**
22
+ * The language to word the errors in. Defaults to `I18nProvider`'s, else
23
+ * what `zodLocaleError` reads by default (the stored language).
24
+ */
25
+ language?: Language;
26
+ };
27
+ /**
28
+ * A react-hook-form resolver for a zod 4 `schema` whose errors are worded in
29
+ * the page's language: a refinement carrying a code in `params.code`
30
+ * (`.refine(isFree, { params: { code: 'errors.taken' } })`) reads as the
31
+ * app's words for that code, and every other issue as the package's zod
32
+ * messages (`zodLocaleError`) — zod's own are English only. One resolver
33
+ * per schema and language, not one per render: switching the language
34
+ * re-words the errors on the next validation.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * const resolver = useCodeResolver(schema, { translate });
39
+ * const form = useForm({ resolver, defaultValues });
40
+ * ```
41
+ */
42
+ export declare function useCodeResolver<Input extends FieldValues, Output>(schema: z.ZodType<Output, Input>, { translate, codeOf, language: languageOption }?: CodeResolverOptions): Resolver<Input, unknown, Output>;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { AuthCardNoticeTone } from './auth-card';
3
+ type AuthCardNoticeProps = {
4
+ notice: ReactNode;
5
+ tone: AuthCardNoticeTone;
6
+ /** Whether there is a notice to show. */
7
+ shown: boolean;
8
+ };
9
+ /**
10
+ * The notice above the form. A polite status is announced when its text
11
+ * changes inside a live region that was already in the page, so that region
12
+ * is always rendered and a non-error notice goes into it. It takes no room
13
+ * while empty (`empty:-mb-4` cancels the card's gap; `display: none` would
14
+ * take it out of the accessibility tree). An error is an `alert`, inserted on
15
+ * demand: that is announced reliably.
16
+ */
17
+ export declare function AuthCardNotice({ notice, tone, shown }: AuthCardNoticeProps): import("react").JSX.Element;
18
+ export {};
@@ -0,0 +1,35 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ /** The notice's colour, and its role: `error` is an alert, the rest a status. */
3
+ export type AuthCardNoticeTone = 'info' | 'success' | 'warning' | 'error';
4
+ export type AuthCardProps = Omit<ComponentProps<'main'>, 'title'> & {
5
+ /** The page's `h1`, at the top of the card. */
6
+ title: ReactNode;
7
+ /** A line under the title. */
8
+ description?: ReactNode;
9
+ /** A notice above the content: an expired link, a signed-out message. */
10
+ notice?: ReactNode;
11
+ /** `'info'` by default; `'error'` makes the notice an alert, the others a status. */
12
+ noticeTone?: AuthCardNoticeTone;
13
+ /**
14
+ * Moves the focus to the title once shown: for an end state that replaced
15
+ * the form the user acted on ("Check your inbox"), so a screen reader reads
16
+ * it and the keyboard goes on from there.
17
+ */
18
+ focusTitle?: boolean;
19
+ /** The left of the row above the card: a logo, the product's name. */
20
+ brand?: ReactNode;
21
+ /** The right of that row: a language switcher, a theme toggle. */
22
+ toolbar?: ReactNode;
23
+ /** Above that row: an update notice, a maintenance banner. */
24
+ banner?: ReactNode;
25
+ /** Under the card: links to the terms, to help. */
26
+ footer?: ReactNode;
27
+ /** The form. */
28
+ children: ReactNode;
29
+ };
30
+ /**
31
+ * The frame of a signed-out page (sign in, sign up, a reset link): one
32
+ * `main`, a centred card whose title is the page's `h1`, a row above it for
33
+ * the brand and a toolbar, padded clear of a phone's notch and home bar.
34
+ */
35
+ export declare function AuthCard({ title, description, notice, noticeTone, focusTitle, brand, toolbar, banner, footer, className, children, ...props }: AuthCardProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './auth-card';
@@ -1,5 +1,6 @@
1
1
  export * from './app-bar';
2
2
  export * from './app-shell';
3
+ export * from './auth-card';
3
4
  export * from './background';
4
5
  export * from './breadcrumb';
5
6
  export * from './doc';
@@ -13,8 +13,11 @@ export type SelectFieldProps = {
13
13
  options: SelectOption[];
14
14
  className?: string;
15
15
  renderOption?: (option: SelectOption) => ReactNode;
16
+ /** Names the trigger by another element's id, when `label` is not shown. */
17
+ 'aria-labelledby'?: string;
16
18
  } & ComponentProps<typeof Select>;
17
- export declare function SelectField({ value, error, helperText, label, options, placeholder, className, renderOption, ...props }: SelectFieldProps): import("react").JSX.Element;
18
- export declare function SelectFieldTrigger({ value, error, helperText, label, placeholder, required, className, name, }: Pick<SelectFieldProps, 'error' | 'helperText' | 'label' | 'placeholder' | 'value' | 'required' | 'name'> & {
19
+ export declare function SelectField({ value, error, helperText, label, options, placeholder, className, renderOption, 'aria-labelledby': ariaLabelledby, ...props }: SelectFieldProps): import("react").JSX.Element;
20
+ export declare function SelectFieldTrigger({ value, error, helperText, label, placeholder, required, className, name, ariaLabelledby, }: Pick<SelectFieldProps, 'error' | 'helperText' | 'label' | 'placeholder' | 'value' | 'required' | 'name'> & {
19
21
  className?: string;
22
+ ariaLabelledby?: string;
20
23
  }): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  export * from './resolve-theme';
2
2
  export * from './use-allowed-transitions';
3
3
  export { useCspNonce } from './use-csp-nonce';
4
+ export * from './use-focus-on-mount';
4
5
  export * from './use-formatters';
5
6
  export * from './use-heading-spy';
6
7
  export * from './use-is-client';
@@ -10,4 +11,5 @@ export * from './use-navigation';
10
11
  export * from './use-number-formatter';
11
12
  export * from './use-options';
12
13
  export * from './use-search-param';
14
+ export * from './use-submit-once';
13
15
  export * from './use-theme';
@@ -0,0 +1,24 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * A ref whose element takes focus once mounted, and again whenever `focus`
4
+ * turns true. Put it on the heading of what replaced the content the user
5
+ * acted on — a wizard's new step, an end state ("Message sent") — so a
6
+ * screen reader reads it and the keyboard goes on from there instead of from
7
+ * the top of the page.
8
+ *
9
+ * The element needs `tabIndex={-1}` unless it is natively focusable (a
10
+ * button, a link, a field): a heading is not.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * function Done() {
15
+ * const title = useFocusOnMount<HTMLHeadingElement>();
16
+ * return (
17
+ * <h2 ref={title} tabIndex={-1}>
18
+ * Message sent
19
+ * </h2>
20
+ * );
21
+ * }
22
+ * ```
23
+ */
24
+ export declare function useFocusOnMount<T extends HTMLElement>(focus?: boolean): RefObject<T | null>;
@@ -0,0 +1,32 @@
1
+ import { SubmitGuard } from '@nxgt/material-core/submit-guard';
2
+ export { busySettler, createSubmitGuard, type SubmitGuard, type SubmitOnceOptions, } from '@nxgt/material-core/submit-guard';
3
+ /**
4
+ * One submit in flight for a form: wraps the submit handler so a second
5
+ * click, or Enter, before the first request ends is dropped. A disabled or
6
+ * `loading` button only stops clicks once it has rendered, and never Enter
7
+ * in a field.
8
+ *
9
+ * When the guard opens again:
10
+ * - **The handler returns the request's promise**: when it ends, fulfilled
11
+ * or rejected (the rejection still reaches the caller).
12
+ * - **`busy` is passed** (a router's navigation state): once it was true and
13
+ * is false again — for the run that was on its way when it rose, never a
14
+ * newer one. A handler that returns no promise then waits for `busy`.
15
+ * - **Neither**: a handler that returns no promise (it returned early, or
16
+ * did its work synchronously) opens it at once.
17
+ *
18
+ * So return the request's promise, or pass `busy`.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * const submitOnce = useSubmitOnce();
23
+ * const { handleSubmit } = useForm<Values>();
24
+ * // react-hook-form's handleSubmit returns a promise: the guard opens again
25
+ * // when `save` ends.
26
+ * <form onSubmit={submitOnce(handleSubmit(save))}>…</form>
27
+ *
28
+ * // A request tracked by a flag instead (a router's navigation state):
29
+ * const submitOnce = useSubmitOnce(navigation.state !== 'idle');
30
+ * ```
31
+ */
32
+ export declare function useSubmitOnce(busy?: boolean): SubmitGuard['once'];
@@ -1272,5 +1272,26 @@ export declare const en: {
1272
1272
  truncated: string;
1273
1273
  content: string;
1274
1274
  };
1275
+ "enrolment-secret": {
1276
+ "qr-label": string;
1277
+ "open-app": string;
1278
+ manual: string;
1279
+ "secret-label": string;
1280
+ copy: string;
1281
+ copied: string;
1282
+ };
1283
+ "recovery-codes": {
1284
+ title: string;
1285
+ warning: string;
1286
+ list: string;
1287
+ copy: string;
1288
+ copied: string;
1289
+ "copy-failed": string;
1290
+ download: string;
1291
+ print: string;
1292
+ saved: string;
1293
+ "saved-required": string;
1294
+ done: string;
1295
+ };
1275
1296
  };
1276
1297
  };
@@ -351,7 +351,7 @@ declare const _default: {
351
351
  "go-to-first-page": "Go to first page",
352
352
  "go-to-last-page": "Go to last page",
353
353
  "rows-per-page": "Rows per page",
354
- "rows-selected": "{count} of {total} {count, plural, =0 {row selected} one {row selected} other {rows selected} }",
354
+ "rows-selected": "{count, plural, =0 {No rows selected} one {# row selected} other {# rows selected}} of {total}",
355
355
  "page-of": "Page {page} of {total}",
356
356
  "label": "Pagination",
357
357
  "range": "{from}–{to} of {total}",
@@ -1261,6 +1261,27 @@ declare const _default: {
1261
1261
  "download": "Download",
1262
1262
  "truncated": "Showing the first {size} of this file.",
1263
1263
  "content": "Contents of {name}"
1264
+ },
1265
+ "enrolment-secret": {
1266
+ "qr-label": "QR code to scan with your authenticator app",
1267
+ "open-app": "Open in your authenticator app",
1268
+ "manual": "Or type this key in the app:",
1269
+ "secret-label": "Setup key",
1270
+ "copy": "Copy the key",
1271
+ "copied": "Key copied"
1272
+ },
1273
+ "recovery-codes": {
1274
+ "title": "Recovery codes",
1275
+ "warning": "Each code works once. Keep them somewhere safe: they are shown only now.",
1276
+ "list": "Recovery codes",
1277
+ "copy": "Copy codes",
1278
+ "copied": "Codes copied",
1279
+ "copy-failed": "Copy failed",
1280
+ "download": "Download",
1281
+ "print": "Print",
1282
+ "saved": "I have saved these codes",
1283
+ "saved-required": "Tick the box once your codes are safe",
1284
+ "done": "Done"
1264
1285
  }
1265
1286
  }
1266
1287
  ;
@@ -1272,5 +1272,26 @@ export declare const fr: {
1272
1272
  truncated: string;
1273
1273
  content: string;
1274
1274
  };
1275
+ "enrolment-secret": {
1276
+ "qr-label": string;
1277
+ "open-app": string;
1278
+ manual: string;
1279
+ "secret-label": string;
1280
+ copy: string;
1281
+ copied: string;
1282
+ };
1283
+ "recovery-codes": {
1284
+ title: string;
1285
+ warning: string;
1286
+ list: string;
1287
+ copy: string;
1288
+ copied: string;
1289
+ "copy-failed": string;
1290
+ download: string;
1291
+ print: string;
1292
+ saved: string;
1293
+ "saved-required": string;
1294
+ done: string;
1295
+ };
1275
1296
  };
1276
1297
  };
@@ -351,7 +351,7 @@ declare const _default: {
351
351
  "go-to-first-page": "Aller à la première page",
352
352
  "go-to-last-page": "Aller à la dernière page",
353
353
  "rows-per-page": "Lignes par page",
354
- "rows-selected": "{count} sur {total} {count, plural, =0 {ligne sélectionnée} one {ligne sélectionnée} other {lignes sélectionnées} }",
354
+ "rows-selected": "{count, plural, =0 {Aucune ligne sélectionnée} one {# ligne sélectionnée} other {# lignes sélectionnées}} sur {total}",
355
355
  "page-of": "Page {page} sur {total}",
356
356
  "label": "Pagination",
357
357
  "range": "{from}–{to} sur {total}",
@@ -1261,6 +1261,27 @@ declare const _default: {
1261
1261
  "download": "Télécharger",
1262
1262
  "truncated": "Seuls les premiers {size} de ce fichier sont affichés.",
1263
1263
  "content": "Contenu de {name}"
1264
+ },
1265
+ "enrolment-secret": {
1266
+ "qr-label": "Code QR à scanner avec votre application d'authentification",
1267
+ "open-app": "Ouvrir dans votre application d'authentification",
1268
+ "manual": "Ou saisissez cette clé dans l'application :",
1269
+ "secret-label": "Clé de configuration",
1270
+ "copy": "Copier la clé",
1271
+ "copied": "Clé copiée"
1272
+ },
1273
+ "recovery-codes": {
1274
+ "title": "Codes de récupération",
1275
+ "warning": "Chaque code ne sert qu'une fois. Gardez-les en lieu sûr : ils ne sont affichés que maintenant.",
1276
+ "list": "Codes de récupération",
1277
+ "copy": "Copier les codes",
1278
+ "copied": "Codes copiés",
1279
+ "copy-failed": "Échec de la copie",
1280
+ "download": "Télécharger",
1281
+ "print": "Imprimer",
1282
+ "saved": "J'ai enregistré ces codes",
1283
+ "saved-required": "Cochez la case une fois vos codes en lieu sûr",
1284
+ "done": "Terminé"
1264
1285
  }
1265
1286
  }
1266
1287
  ;
@@ -1270,6 +1270,27 @@ export declare const resources: {
1270
1270
  truncated: string;
1271
1271
  content: string;
1272
1272
  };
1273
+ "enrolment-secret": {
1274
+ "qr-label": string;
1275
+ "open-app": string;
1276
+ manual: string;
1277
+ "secret-label": string;
1278
+ copy: string;
1279
+ copied: string;
1280
+ };
1281
+ "recovery-codes": {
1282
+ title: string;
1283
+ warning: string;
1284
+ list: string;
1285
+ copy: string;
1286
+ copied: string;
1287
+ "copy-failed": string;
1288
+ download: string;
1289
+ print: string;
1290
+ saved: string;
1291
+ "saved-required": string;
1292
+ done: string;
1293
+ };
1273
1294
  };
1274
1295
  };
1275
1296
  fr: {
@@ -2537,6 +2558,27 @@ export declare const resources: {
2537
2558
  truncated: string;
2538
2559
  content: string;
2539
2560
  };
2561
+ "enrolment-secret": {
2562
+ "qr-label": string;
2563
+ "open-app": string;
2564
+ manual: string;
2565
+ "secret-label": string;
2566
+ copy: string;
2567
+ copied: string;
2568
+ };
2569
+ "recovery-codes": {
2570
+ title: string;
2571
+ warning: string;
2572
+ list: string;
2573
+ copy: string;
2574
+ copied: string;
2575
+ "copy-failed": string;
2576
+ download: string;
2577
+ print: string;
2578
+ saved: string;
2579
+ "saved-required": string;
2580
+ done: string;
2581
+ };
2540
2582
  };
2541
2583
  };
2542
2584
  };