@nxgt/material 3.44.0 → 3.46.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 +43 -0
- package/README.md +8 -1
- package/dist/{async-slice-D9LAUgth.js → async-slice-DPM9l8dd.js} +2 -2
- package/dist/{button-b_kruV_L.js → button-DR_EdcfV.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-6O3t9GXt.js → chip-olzYjs30.js} +1 -1
- package/dist/{code-editor-BtDOgUET.js → code-editor-CCc-piPv.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-374m-OK8.js → code-language-items-mjN3a33n.js} +2 -2
- package/dist/{components-DMgim3_P.js → components-CfttRxBs.js} +15690 -14568
- package/dist/components.js +26 -26
- package/dist/{dialog-8Ua9uuJW.js → dialog-DOhEoEP2.js} +4 -4
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-DJEeT1XT.js → dropdown-menu-CFO3E-rO.js} +1 -1
- package/dist/editor.js +7 -7
- package/dist/{empty-state-CrhrmNqn.js → empty-state-CTX0gKR3.js} +1 -1
- package/dist/hooks.js +28 -40
- package/dist/{i18n-provider-hrtFm9jD.js → i18n-provider-BnVQVqAF.js} +1 -1
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-Cpke1tCf.js → icon-badge-BRys8Tuo.js} +1 -1
- package/dist/lib/components/ui/display/enrolment-card/enrolment-card.d.ts +12 -0
- package/dist/lib/components/ui/display/enrolment-card/index.d.ts +2 -0
- package/dist/lib/components/ui/display/enrolment-card/partials/enrolment-header.d.ts +14 -0
- package/dist/lib/components/ui/display/enrolment-card/partials/enrolment-verification.d.ts +15 -0
- package/dist/lib/components/ui/display/enrolment-card/types.d.ts +49 -0
- package/dist/lib/components/ui/display/enrolment-card/use-enrolment-card-labels.d.ts +3 -0
- package/dist/lib/components/ui/display/index.d.ts +2 -0
- package/dist/lib/components/ui/display/recovery-codes-status/index.d.ts +2 -0
- package/dist/lib/components/ui/display/recovery-codes-status/partials/recovery-count.d.ts +11 -0
- package/dist/lib/components/ui/display/recovery-codes-status/recovery-codes-status.d.ts +12 -0
- package/dist/lib/components/ui/display/recovery-codes-status/types.d.ts +44 -0
- package/dist/lib/components/ui/display/recovery-codes-status/use-recovery-codes-status-labels.d.ts +3 -0
- package/dist/lib/components/ui/feedback/alert/alert.d.ts +7 -1
- package/dist/lib/components/ui/feedback/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/index.d.ts +2 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-body.d.ts +15 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-footer.d.ts +22 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-header.d.ts +10 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/step-up-dialog.d.ts +16 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/types.d.ts +55 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/use-step-up-labels.d.ts +3 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/use-step-up-state.d.ts +12 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/use-title-focus.d.ts +5 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/index.d.ts +1 -0
- package/dist/lib/components/ui/fields/verification-code/describe-verification.d.ts +53 -0
- package/dist/lib/components/ui/fields/verification-code/index.d.ts +4 -0
- package/dist/lib/components/ui/fields/verification-code/partials/code-input.d.ts +12 -0
- package/dist/lib/components/ui/fields/verification-code/partials/code-message.d.ts +11 -0
- package/dist/lib/components/ui/fields/verification-code/partials/code-slots.d.ts +18 -0
- package/dist/lib/components/ui/fields/verification-code/partials/code-surface.d.ts +12 -0
- package/dist/lib/components/ui/fields/verification-code/partials/form-actions.d.ts +14 -0
- package/dist/lib/components/ui/fields/verification-code/partials/label-row.d.ts +10 -0
- package/dist/lib/components/ui/fields/verification-code/partials/locked-alert.d.ts +17 -0
- package/dist/lib/components/ui/fields/verification-code/partials/method-switch.d.ts +8 -0
- package/dist/lib/components/ui/fields/verification-code/partials/recovery-input.d.ts +7 -0
- package/dist/lib/components/ui/fields/verification-code/partials/resend-line.d.ts +10 -0
- package/dist/lib/components/ui/fields/verification-code/partials/status-line.d.ts +10 -0
- package/dist/lib/components/ui/fields/verification-code/throttle.d.ts +10 -0
- package/dist/lib/components/ui/fields/verification-code/types.d.ts +138 -0
- package/dist/lib/components/ui/fields/verification-code/use-answer-focus.d.ts +32 -0
- package/dist/lib/components/ui/fields/verification-code/use-code-entry.d.ts +43 -0
- package/dist/lib/components/ui/fields/verification-code/use-code-lock.d.ts +36 -0
- package/dist/lib/components/ui/fields/verification-code/use-code-resend.d.ts +29 -0
- package/dist/lib/components/ui/fields/verification-code/use-code-submit.d.ts +23 -0
- package/dist/lib/components/ui/fields/verification-code/use-entry-anchors.d.ts +6 -0
- package/dist/lib/components/ui/fields/verification-code/use-focus-on-switch.d.ts +7 -0
- package/dist/lib/components/ui/fields/verification-code/use-resend-focus.d.ts +20 -0
- package/dist/lib/components/ui/fields/verification-code/use-resend.d.ts +11 -0
- package/dist/lib/components/ui/fields/verification-code/use-short-reminder.d.ts +24 -0
- package/dist/lib/components/ui/fields/verification-code/use-stale-answer.d.ts +52 -0
- package/dist/lib/components/ui/fields/verification-code/use-throttle-focus.d.ts +16 -0
- package/dist/lib/components/ui/fields/verification-code/use-throttle.d.ts +10 -0
- package/dist/lib/components/ui/fields/verification-code/use-typed-value.d.ts +18 -0
- package/dist/lib/components/ui/fields/verification-code/use-verification-labels.d.ts +3 -0
- package/dist/lib/components/ui/fields/verification-code/verification-code.d.ts +11 -0
- package/dist/lib/components/ui/fields/verification-code/verification-lock-provider.d.ts +54 -0
- package/dist/lib/components/ui/overlays/dialog/dialog-parts.d.ts +8 -1
- package/dist/lib/i18n/resources/en/en.d.ts +52 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +52 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +52 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +52 -0
- package/dist/lib/i18n/resources/resources.d.ts +104 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +43 -43
- package/dist/map.js +4 -4
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-DPPmNtZB.js → public-BmA6r0EK.js} +6 -6
- package/dist/{rich-code-block-KQYR0qt3.js → rich-code-block-BgPtzSnv.js} +4 -4
- package/dist/{sortable-provider-hPPTMtJA.js → sortable-provider-CceARBYP.js} +1 -1
- package/dist/{spinner-Dd0os4cb.js → spinner-7orqNAEy.js} +1 -1
- package/dist/{stored-language-Blyb68vN.js → stored-language-BHmxU75w.js} +104 -0
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-BDRRkkiA.js → theme-toggle-_RJgLHs9.js} +1 -1
- package/dist/{toolbar-items-D3hw7XZE.js → toolbar-items-BCy6DMzb.js} +2 -2
- package/dist/{translate-material-CdJBbURx.js → translate-material-n0YBXLGp.js} +2 -2
- package/dist/{translator-38JuN_VD.js → translator-B_ue2XEg.js} +1 -1
- package/dist/{use-chat-composer-utGkZQ6X.js → use-chat-composer-FDmwZSua.js} +12 -12
- package/dist/{use-heading-spy-bTccmEMF.js → use-heading-spy-O6_EATtA.js} +43 -31
- package/dist/{use-material-translation-DLsfkMxp.js → use-material-translation-CkPcqI6q.js} +2 -2
- package/docs/README.md +1 -0
- package/docs/components/README.md +1 -1
- package/docs/components/buttons-and-actions.md +2 -1
- package/docs/components/data-display.md +90 -0
- package/docs/components/data-table-filter-and-lists.md +6 -2
- package/docs/components/feedback-and-status.md +113 -1
- package/docs/components/form-fields.md +163 -0
- package/docs/components/overlays-and-menus.md +3 -1
- package/docs/guides/two-factor.md +78 -0
- package/docs/previews/data-display-enrolmentcard.webp +0 -0
- package/docs/previews/data-display-recoverycodesstatus.webp +0 -0
- package/docs/previews/feedback-status-stepupdialog.webp +0 -0
- package/docs/previews/form-fields-verificationcode.webp +0 -0
- package/docs/roadmap.md +16 -0
- package/package.json +2 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { VerificationCodeIcons, VerificationCodeLabels, VerificationCodeProps, VerificationKind } from '../../fields/verification-code/types.js';
|
|
3
|
+
import { CardTitleElement } from '../../primitives/card/card.js';
|
|
4
|
+
/** The words of {@link RecoveryCodesStatus} itself, each overridable. */
|
|
5
|
+
export type RecoveryCodesStatusLabels = {
|
|
6
|
+
/** The title. "Recovery codes". */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Under the title: what the codes are for. */
|
|
9
|
+
description: string;
|
|
10
|
+
/** How many are left; an ICU message of `{count}`. */
|
|
11
|
+
remaining: (count: number) => string;
|
|
12
|
+
/** Said instead of the count when none is left. */
|
|
13
|
+
noneLeft: string;
|
|
14
|
+
/** The warning that goes with it. */
|
|
15
|
+
noneLeftHint: string;
|
|
16
|
+
/** The button, and the form's submit button. "New codes". */
|
|
17
|
+
newCodes: string;
|
|
18
|
+
/** Under the count: what making a new set does. */
|
|
19
|
+
newCodesHint: string;
|
|
20
|
+
};
|
|
21
|
+
export type RecoveryCodesStatusProps = Omit<ComponentProps<'div'>, 'title' | 'children'> & Pick<VerificationCodeProps, 'attemptsLeft' | 'locked' | 'error' | 'pending' | 'allowRecovery' | 'length'> & {
|
|
22
|
+
/** How many codes are left; `null` or left out when the count is not known. */
|
|
23
|
+
remaining?: number | null;
|
|
24
|
+
/**
|
|
25
|
+
* Asks for a new set. With `requireCode` it gets the code typed and what
|
|
26
|
+
* it is (the app's, or a recovery code); without, no argument. Show the
|
|
27
|
+
* new codes with {@link RecoveryCodes} once it succeeds.
|
|
28
|
+
*/
|
|
29
|
+
onRegenerate: (code?: string, options?: {
|
|
30
|
+
kind: VerificationKind;
|
|
31
|
+
}) => unknown;
|
|
32
|
+
/**
|
|
33
|
+
* Ask for a code before making a new set: a {@link VerificationCode}
|
|
34
|
+
* under the count. `false` draws a plain button. On by default.
|
|
35
|
+
*/
|
|
36
|
+
requireCode?: boolean;
|
|
37
|
+
title?: ReactNode;
|
|
38
|
+
/** The heading level of the title. `'h2'` by default. */
|
|
39
|
+
titleAs?: CardTitleElement;
|
|
40
|
+
/** Under the title. Overrides `labels.description`; `false` leaves it out. */
|
|
41
|
+
description?: ReactNode;
|
|
42
|
+
labels?: Partial<RecoveryCodesStatusLabels & VerificationCodeLabels>;
|
|
43
|
+
icons?: VerificationCodeIcons;
|
|
44
|
+
};
|
|
@@ -8,5 +8,11 @@ export type AlertProps = {
|
|
|
8
8
|
icon?: ReactNode;
|
|
9
9
|
title?: ReactNode;
|
|
10
10
|
description?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Buttons or links under the text (a "Continue" link, a "Retry" button),
|
|
13
|
+
* wrapping on a narrow screen. They are the host's; `Button` and
|
|
14
|
+
* `LinkButton` already keep a 44px target on a coarse pointer.
|
|
15
|
+
*/
|
|
16
|
+
actions?: ReactNode;
|
|
11
17
|
} & Omit<ComponentProps<'div'>, 'title' | 'description'> & AlertVariantProps;
|
|
12
|
-
export declare function Alert({ description, icon, title, className, variant, ...props }: AlertProps): import("react").JSX.Element;
|
|
18
|
+
export declare function Alert({ description, actions, icon, title, className, variant, ...props }: AlertProps): import("react").JSX.Element;
|
|
@@ -18,5 +18,6 @@ export * from './scroll-progress/index.js';
|
|
|
18
18
|
export * from './skeleton/index.js';
|
|
19
19
|
export * from './spinner/index.js';
|
|
20
20
|
export * from './step-dots/index.js';
|
|
21
|
+
export * from './step-up-dialog/index.js';
|
|
21
22
|
export * from './toast/index.js';
|
|
22
23
|
export * from './typing-indicator/index.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StepUpDialogProps } from '../types.js';
|
|
3
|
+
type Props = Pick<StepUpDialogProps, 'via' | 'requestError' | 'confirming' | 'attemptsLeft' | 'locked' | 'error' | 'retryAfter' | 'pending' | 'onSubmit' | 'onResend' | 'resent' | 'length' | 'allowRecovery' | 'icons'> & {
|
|
4
|
+
formId: string;
|
|
5
|
+
labels: NonNullable<StepUpDialogProps['labels']>;
|
|
6
|
+
/** What is said instead of the field (requesting, confirming). */
|
|
7
|
+
statusText: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* What sits between the title and the footer: the code form, or, when it is
|
|
11
|
+
* not there (a code still being requested, a request that failed, an
|
|
12
|
+
* accepted code), the status line or the alert that replaces it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function StepUpBody({ via, requestError, confirming, formId, labels, statusText, icons, ...code }: Props): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ButtonVariant } from '../../../actions/button/button.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** The id of the code form the Confirm button submits. */
|
|
4
|
+
formId: string;
|
|
5
|
+
cancelVariant: ButtonVariant;
|
|
6
|
+
cancelLabel: string;
|
|
7
|
+
confirmLabel: string;
|
|
8
|
+
/** An accepted code is being finished: both buttons are off. */
|
|
9
|
+
confirming: boolean;
|
|
10
|
+
pending?: boolean;
|
|
11
|
+
/** No field to answer (still requesting) or the code is held by a lock. */
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
/** The id of the lock note that explains a disabled Confirm. */
|
|
14
|
+
lockNoteId?: string;
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Cancel and Confirm on one row, even on a phone. Confirm is the form's
|
|
19
|
+
* submit button (`form={formId}`); a locked code leaves Cancel usable.
|
|
20
|
+
*/
|
|
21
|
+
export declare function StepUpFooter({ formId, cancelVariant, cancelLabel, confirmLabel, confirming, pending, disabled, lockNoteId, onCancel, }: Props): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** The title takes the focus on open and whenever the field goes. */
|
|
4
|
+
titleRef: RefObject<HTMLHeadingElement | null>;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/** The title (focusable by code, not by Tab) and the line under it. */
|
|
9
|
+
export declare function StepUpHeader({ titleRef, title, description }: Props): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StepUpDialogProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* "Confirm it's you": a dialog that asks for a one-time code before the app
|
|
4
|
+
* goes on with a sensitive action. It is presentational: it holds no state
|
|
5
|
+
* machine and fetches nothing, it shows the answer it is given through the
|
|
6
|
+
* props of {@link VerificationCode} (`via`, `attemptsLeft`, `locked`,
|
|
7
|
+
* `error`, `pending`, `resent`, `onSubmit`, `onResend`), which the app
|
|
8
|
+
* wires to its own model.
|
|
9
|
+
*
|
|
10
|
+
* The title takes the focus on open and whenever the field goes (a code
|
|
11
|
+
* being requested, a code accepted); the field takes it after a refusal; on
|
|
12
|
+
* close it goes back to what opened the dialog. Escape, a click outside and
|
|
13
|
+
* Cancel call `onCancel`, except while `confirming`. A locked code leaves
|
|
14
|
+
* Cancel usable.
|
|
15
|
+
*/
|
|
16
|
+
export declare function StepUpDialog({ open, onCancel, cancelVariant, via, destination, requestError, confirming, confirmedLabel, title, description, labels: labelOverrides, icons, ...code }: StepUpDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonVariant } from '../../actions/button/button.js';
|
|
3
|
+
import { VerificationCodeIcons, VerificationCodeLabels, VerificationCodeProps } from '../../fields/verification-code/types.js';
|
|
4
|
+
/** The words of {@link StepUpDialog} itself, each overridable. */
|
|
5
|
+
export type StepUpDialogLabels = {
|
|
6
|
+
/** The title. "Confirm it's you". */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Under the title while the code is still being requested. */
|
|
9
|
+
description: string;
|
|
10
|
+
/** Under the title for a code from an authenticator app. */
|
|
11
|
+
descriptionApp: string;
|
|
12
|
+
/** Under the title for an e-mailed code, with no destination to name. */
|
|
13
|
+
descriptionEmail: string;
|
|
14
|
+
/** Under the title for an e-mailed code; `destination` is the address as text. */
|
|
15
|
+
descriptionEmailTo: (destination: string) => string;
|
|
16
|
+
/** Said while the code is being requested. "Sending you a code…". */
|
|
17
|
+
requesting: string;
|
|
18
|
+
/** The Cancel button. */
|
|
19
|
+
cancel: string;
|
|
20
|
+
/** Said once the code was accepted and the host finishes its action. */
|
|
21
|
+
confirmed: string;
|
|
22
|
+
};
|
|
23
|
+
export type StepUpDialogProps = Pick<VerificationCodeProps, 'attemptsLeft' | 'locked' | 'error' | 'retryAfter' | 'pending' | 'onSubmit' | 'onResend' | 'resent' | 'length' | 'allowRecovery'> & {
|
|
24
|
+
open: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Escape, a click outside and Cancel call it, except while `confirming`.
|
|
27
|
+
* The host closes the dialog (`open`); focus goes back to what opened it.
|
|
28
|
+
*/
|
|
29
|
+
onCancel: () => void;
|
|
30
|
+
/** The Cancel button's variant. Default `'tonal'`; `'outlined'` restores the earlier look. */
|
|
31
|
+
cancelVariant?: ButtonVariant;
|
|
32
|
+
/**
|
|
33
|
+
* How the code was issued. Left out, the code is still being requested:
|
|
34
|
+
* the field is not drawn and a status line says so.
|
|
35
|
+
*/
|
|
36
|
+
via?: VerificationCodeProps['via'];
|
|
37
|
+
/** Where an e-mailed code went: the address, or any node. */
|
|
38
|
+
destination?: ReactNode;
|
|
39
|
+
/** The request for a code failed; shown as an alert in place of the field. */
|
|
40
|
+
requestError?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* The code was accepted and the host re-runs its action: the field goes,
|
|
43
|
+
* a status line shows `labels.confirmed` and Cancel is disabled until the
|
|
44
|
+
* host closes the dialog.
|
|
45
|
+
*/
|
|
46
|
+
confirming?: boolean;
|
|
47
|
+
/** The status line while `confirming`. Overrides `labels.confirmed`. */
|
|
48
|
+
confirmedLabel?: ReactNode;
|
|
49
|
+
/** The title. Overrides `labels.title`. */
|
|
50
|
+
title?: ReactNode;
|
|
51
|
+
/** Under the title. Overrides the text that follows `via`. */
|
|
52
|
+
description?: ReactNode;
|
|
53
|
+
labels?: Partial<StepUpDialogLabels & VerificationCodeLabels>;
|
|
54
|
+
icons?: VerificationCodeIcons;
|
|
55
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StepUpDialogProps } from './types.js';
|
|
2
|
+
type Input = Pick<StepUpDialogProps, 'via' | 'requestError' | 'confirming' | 'locked' | 'attemptsLeft'>;
|
|
3
|
+
/**
|
|
4
|
+
* Whether the code field is there (a code requested, no failed request,
|
|
5
|
+
* nothing accepted yet), and whether the code is held by a lock, which turns
|
|
6
|
+
* Confirm off: the one rule of {@link isHeld}, with the page-wide lock.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useStepUpState({ via, requestError, confirming, locked, attemptsLeft, }: Input): {
|
|
9
|
+
fieldShown: boolean;
|
|
10
|
+
held: boolean;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ref of the dialog's title, which takes the focus when the dialog is
|
|
3
|
+
* open and the field is not (a code being requested, a code accepted).
|
|
4
|
+
*/
|
|
5
|
+
export declare function useTitleFocus(open: boolean, fieldShown: boolean): import('react').RefObject<HTMLHeadingElement | null>;
|