@nxgt/material 3.45.0 → 3.47.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 (149) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +10 -3
  3. package/dist/{async-slice-D9LAUgth.js → async-slice-DlvKCKAa.js} +2 -2
  4. package/dist/{button-b_kruV_L.js → button-yaltbQmC.js} +1 -1
  5. package/dist/charts.js +3 -3
  6. package/dist/{chip-6O3t9GXt.js → chip-BqWbbr1b.js} +1 -1
  7. package/dist/{code-editor-BtDOgUET.js → code-editor-C9qBNoYb.js} +4 -4
  8. package/dist/code-editor.js +4 -4
  9. package/dist/{code-language-items-374m-OK8.js → code-language-items-DAHtfQ7W.js} +2 -2
  10. package/dist/{components-BG-BTfJP.js → components-DFPy96C3.js} +16282 -14755
  11. package/dist/components.js +26 -26
  12. package/dist/{dialog-8Ua9uuJW.js → dialog-CCCcnTIx.js} +4 -4
  13. package/dist/dnd.js +1 -1
  14. package/dist/{dropdown-menu-DJEeT1XT.js → dropdown-menu-Df8785nt.js} +1 -1
  15. package/dist/editor.js +7 -7
  16. package/dist/{empty-state-CrhrmNqn.js → empty-state-DcF4TBzi.js} +1 -1
  17. package/dist/hooks.js +28 -40
  18. package/dist/{i18n-provider-hrtFm9jD.js → i18n-provider-C0fB0sEL.js} +1 -1
  19. package/dist/i18n.js +5 -5
  20. package/dist/{icon-badge-Cpke1tCf.js → icon-badge-aJ22mKGh.js} +1 -1
  21. package/dist/lib/components/ui/display/enrolment-card/enrolment-card.d.ts +12 -0
  22. package/dist/lib/components/ui/display/enrolment-card/index.d.ts +2 -0
  23. package/dist/lib/components/ui/display/enrolment-card/partials/enrolment-header.d.ts +14 -0
  24. package/dist/lib/components/ui/display/enrolment-card/partials/enrolment-verification.d.ts +15 -0
  25. package/dist/lib/components/ui/display/enrolment-card/types.d.ts +49 -0
  26. package/dist/lib/components/ui/display/enrolment-card/use-enrolment-card-labels.d.ts +3 -0
  27. package/dist/lib/components/ui/display/index.d.ts +2 -0
  28. package/dist/lib/components/ui/display/recovery-codes-status/index.d.ts +2 -0
  29. package/dist/lib/components/ui/display/recovery-codes-status/partials/recovery-count.d.ts +11 -0
  30. package/dist/lib/components/ui/display/recovery-codes-status/recovery-codes-status.d.ts +12 -0
  31. package/dist/lib/components/ui/display/recovery-codes-status/types.d.ts +44 -0
  32. package/dist/lib/components/ui/display/recovery-codes-status/use-recovery-codes-status-labels.d.ts +3 -0
  33. package/dist/lib/components/ui/display/timeline/index.d.ts +1 -1
  34. package/dist/lib/components/ui/display/timeline/partials/timeline-day-heading.d.ts +14 -0
  35. package/dist/lib/components/ui/display/timeline/partials/timeline-empty.d.ts +8 -0
  36. package/dist/lib/components/ui/display/timeline/partials/timeline-groups.d.ts +22 -0
  37. package/dist/lib/components/ui/display/timeline/partials/timeline-item-body.d.ts +13 -0
  38. package/dist/lib/components/ui/display/timeline/partials/timeline-item-card.d.ts +5 -0
  39. package/dist/lib/components/ui/display/timeline/partials/timeline-item-rail.d.ts +8 -0
  40. package/dist/lib/components/ui/display/timeline/partials/timeline-item-time.d.ts +12 -0
  41. package/dist/lib/components/ui/display/timeline/partials/timeline-skeleton.d.ts +4 -0
  42. package/dist/lib/components/ui/display/timeline/timeline-item.d.ts +13 -2
  43. package/dist/lib/components/ui/display/timeline/timeline-marker.d.ts +12 -0
  44. package/dist/lib/components/ui/display/timeline/timeline-rows.d.ts +23 -0
  45. package/dist/lib/components/ui/display/timeline/timeline.d.ts +32 -2
  46. package/dist/lib/components/ui/display/timeline/types.d.ts +6 -0
  47. package/dist/lib/components/ui/feedback/alert/alert.d.ts +7 -1
  48. package/dist/lib/components/ui/feedback/index.d.ts +1 -0
  49. package/dist/lib/components/ui/feedback/step-up-dialog/index.d.ts +2 -0
  50. package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-body.d.ts +15 -0
  51. package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-footer.d.ts +22 -0
  52. package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-header.d.ts +10 -0
  53. package/dist/lib/components/ui/feedback/step-up-dialog/step-up-dialog.d.ts +16 -0
  54. package/dist/lib/components/ui/feedback/step-up-dialog/types.d.ts +55 -0
  55. package/dist/lib/components/ui/feedback/step-up-dialog/use-step-up-labels.d.ts +3 -0
  56. package/dist/lib/components/ui/feedback/step-up-dialog/use-step-up-state.d.ts +12 -0
  57. package/dist/lib/components/ui/feedback/step-up-dialog/use-title-focus.d.ts +5 -0
  58. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  59. package/dist/lib/components/ui/fields/index.d.ts +1 -0
  60. package/dist/lib/components/ui/fields/verification-code/describe-verification.d.ts +53 -0
  61. package/dist/lib/components/ui/fields/verification-code/index.d.ts +4 -0
  62. package/dist/lib/components/ui/fields/verification-code/partials/code-input.d.ts +12 -0
  63. package/dist/lib/components/ui/fields/verification-code/partials/code-message.d.ts +11 -0
  64. package/dist/lib/components/ui/fields/verification-code/partials/code-slots.d.ts +18 -0
  65. package/dist/lib/components/ui/fields/verification-code/partials/code-surface.d.ts +12 -0
  66. package/dist/lib/components/ui/fields/verification-code/partials/form-actions.d.ts +14 -0
  67. package/dist/lib/components/ui/fields/verification-code/partials/label-row.d.ts +10 -0
  68. package/dist/lib/components/ui/fields/verification-code/partials/locked-alert.d.ts +17 -0
  69. package/dist/lib/components/ui/fields/verification-code/partials/method-switch.d.ts +8 -0
  70. package/dist/lib/components/ui/fields/verification-code/partials/recovery-input.d.ts +7 -0
  71. package/dist/lib/components/ui/fields/verification-code/partials/resend-line.d.ts +10 -0
  72. package/dist/lib/components/ui/fields/verification-code/partials/status-line.d.ts +10 -0
  73. package/dist/lib/components/ui/fields/verification-code/throttle.d.ts +10 -0
  74. package/dist/lib/components/ui/fields/verification-code/types.d.ts +138 -0
  75. package/dist/lib/components/ui/fields/verification-code/use-answer-focus.d.ts +32 -0
  76. package/dist/lib/components/ui/fields/verification-code/use-code-entry.d.ts +43 -0
  77. package/dist/lib/components/ui/fields/verification-code/use-code-lock.d.ts +36 -0
  78. package/dist/lib/components/ui/fields/verification-code/use-code-resend.d.ts +29 -0
  79. package/dist/lib/components/ui/fields/verification-code/use-code-submit.d.ts +23 -0
  80. package/dist/lib/components/ui/fields/verification-code/use-entry-anchors.d.ts +6 -0
  81. package/dist/lib/components/ui/fields/verification-code/use-focus-on-switch.d.ts +7 -0
  82. package/dist/lib/components/ui/fields/verification-code/use-resend-focus.d.ts +20 -0
  83. package/dist/lib/components/ui/fields/verification-code/use-resend.d.ts +11 -0
  84. package/dist/lib/components/ui/fields/verification-code/use-short-reminder.d.ts +24 -0
  85. package/dist/lib/components/ui/fields/verification-code/use-stale-answer.d.ts +52 -0
  86. package/dist/lib/components/ui/fields/verification-code/use-throttle-focus.d.ts +16 -0
  87. package/dist/lib/components/ui/fields/verification-code/use-throttle.d.ts +10 -0
  88. package/dist/lib/components/ui/fields/verification-code/use-typed-value.d.ts +18 -0
  89. package/dist/lib/components/ui/fields/verification-code/use-verification-labels.d.ts +3 -0
  90. package/dist/lib/components/ui/fields/verification-code/verification-code.d.ts +11 -0
  91. package/dist/lib/components/ui/fields/verification-code/verification-lock-provider.d.ts +54 -0
  92. package/dist/lib/components/ui/layout/stepper/partials/header-nav.d.ts +10 -0
  93. package/dist/lib/components/ui/layout/stepper/partials/header-segments.d.ts +6 -0
  94. package/dist/lib/components/ui/layout/stepper/partials/header-summary.d.ts +12 -0
  95. package/dist/lib/components/ui/layout/stepper/partials/stepper-content.d.ts +8 -0
  96. package/dist/lib/components/ui/layout/stepper/partials/stepper-step-text.d.ts +13 -0
  97. package/dist/lib/components/ui/layout/stepper/stepper-connector.d.ts +6 -0
  98. package/dist/lib/components/ui/layout/stepper/stepper-header.d.ts +12 -0
  99. package/dist/lib/components/ui/layout/stepper/stepper-icon.d.ts +5 -0
  100. package/dist/lib/components/ui/layout/stepper/stepper-layout.d.ts +25 -0
  101. package/dist/lib/components/ui/layout/stepper/stepper-step.d.ts +9 -2
  102. package/dist/lib/components/ui/layout/stepper/stepper.d.ts +13 -3
  103. package/dist/lib/components/ui/overlays/dialog/dialog-parts.d.ts +8 -1
  104. package/dist/lib/i18n/resources/en/en.d.ts +59 -0
  105. package/dist/lib/i18n/resources/en/material.json.d.ts +61 -2
  106. package/dist/lib/i18n/resources/fr/fr.d.ts +59 -0
  107. package/dist/lib/i18n/resources/fr/material.json.d.ts +61 -2
  108. package/dist/lib/i18n/resources/resources.d.ts +118 -0
  109. package/dist/lib/i18n/translator.d.ts +1 -1
  110. package/dist/lib.js +1 -1
  111. package/dist/main.js +43 -43
  112. package/dist/map.js +4 -4
  113. package/dist/material.css +1 -1
  114. package/dist/pdf-reader.js +1 -1
  115. package/dist/print.js +2 -2
  116. package/dist/{public-DPPmNtZB.js → public-zVb_Nq_D.js} +6 -6
  117. package/dist/{rich-code-block-KQYR0qt3.js → rich-code-block-DMWZZJma.js} +4 -4
  118. package/dist/{sortable-provider-hPPTMtJA.js → sortable-provider-DstbgMVf.js} +1 -1
  119. package/dist/{spinner-Dd0os4cb.js → spinner-C4CgDEYm.js} +1 -1
  120. package/dist/{stored-language-Blyb68vN.js → stored-language-IaL1Ftn_.js} +122 -4
  121. package/dist/styles.css +8 -0
  122. package/dist/theme-picker.js +2 -2
  123. package/dist/{theme-toggle-BDRRkkiA.js → theme-toggle-CGW2_K54.js} +1 -1
  124. package/dist/{toolbar-items-D3hw7XZE.js → toolbar-items-CsLGJMEJ.js} +2 -2
  125. package/dist/{translate-material-CdJBbURx.js → translate-material-v9u-e7Kd.js} +2 -2
  126. package/dist/{translator-38JuN_VD.js → translator-Dk4_qE6U.js} +1 -1
  127. package/dist/{use-chat-composer-utGkZQ6X.js → use-chat-composer-Brcb5f7r.js} +12 -12
  128. package/dist/{use-heading-spy-bTccmEMF.js → use-heading-spy-DjKixjLm.js} +43 -31
  129. package/dist/{use-material-translation-DLsfkMxp.js → use-material-translation-DOkTaWK_.js} +2 -2
  130. package/docs/README.md +1 -0
  131. package/docs/components/README.md +1 -1
  132. package/docs/components/buttons-and-actions.md +2 -1
  133. package/docs/components/data-display.md +133 -4
  134. package/docs/components/feedback-and-status.md +113 -1
  135. package/docs/components/form-fields.md +163 -0
  136. package/docs/components/navigation-and-layout.md +66 -23
  137. package/docs/components/overlays-and-menus.md +3 -1
  138. package/docs/guides/i18n.md +4 -1
  139. package/docs/guides/ssr.md +3 -1
  140. package/docs/guides/two-factor.md +78 -0
  141. package/docs/previews/data-display-enrolmentcard.webp +0 -0
  142. package/docs/previews/data-display-recoverycodesstatus.webp +0 -0
  143. package/docs/previews/data-display-timeline.webp +0 -0
  144. package/docs/previews/feedback-status-stepupdialog.webp +0 -0
  145. package/docs/previews/form-fields-verificationcode.webp +0 -0
  146. package/docs/previews/navigation-layout-stepper.webp +0 -0
  147. package/docs/roadmap.md +30 -0
  148. package/lib/styles.css +8 -0
  149. 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
+ };
@@ -0,0 +1,3 @@
1
+ import { RecoveryCodesStatusLabels } from './types.js';
2
+ /** The built-in words (English or the active language), with their overrides. */
3
+ export declare function useRecoveryCodesStatusLabels(overrides?: Partial<RecoveryCodesStatusLabels>): RecoveryCodesStatusLabels;
@@ -5,4 +5,4 @@ export type { TimelineProps } from './timeline.js';
5
5
  export { Timeline } from './timeline.js';
6
6
  export type { TimelineItemProps } from './timeline-item.js';
7
7
  export { TimelineItem } from './timeline-item.js';
8
- export type { TimelineItemData, TimelineTimestamp, TimelineTone, } from './types.js';
8
+ export type { TimelineItemData, TimelineLayout, TimelineTimestamp, TimelineTone, } from './types.js';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The heading that opens a day: "Today", "Yesterday", a weekday or a date,
3
+ * read in `timeZone` when given so a server and a browser label it alike,
4
+ * and the day's count (read as "3 events"). Its `id` is what the day's items
5
+ * point to with `aria-describedby`.
6
+ */
7
+ export declare function TimelineDayHeading({ id, date, count, now, timeZone, level, }: {
8
+ id: string;
9
+ date: Date;
10
+ count: number;
11
+ now?: Date;
12
+ timeZone?: string;
13
+ level: 2 | 3 | 4 | 5 | 6;
14
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ /** The loading skeleton, or the empty message, of a Timeline with no items to list. */
3
+ export declare function TimelineEmpty({ loading, label, empty, className, }: {
4
+ loading: boolean;
5
+ label: string;
6
+ empty?: ReactNode;
7
+ className?: string;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ import { TimelineRow } from '../timeline-rows.js';
3
+ import { TimelineLayout } from '../types.js';
4
+ /**
5
+ * The rows of the list, flat: the items and, when days show, a day heading
6
+ * before each run, rendered inside the run's first item, ahead of its content
7
+ * (a list may only hold `<li>`s, so a presentational row between them would
8
+ * fail axe's `list` rule). The heading never wraps the items, so an item keeps
9
+ * its parent and its key when the headings appear after mount, and its state
10
+ * with them. Every item of the run points to the heading with
11
+ * `aria-describedby`, which keeps the group named for assistive technology
12
+ * without a nested list.
13
+ */
14
+ export declare function TimelineGroups({ rows, baseId, layout, now, timeZone, headingLevel, total, }: {
15
+ rows: TimelineRow[];
16
+ baseId: string;
17
+ layout: TimelineLayout;
18
+ now?: Date;
19
+ timeZone?: string;
20
+ headingLevel: 2 | 3 | 4 | 5 | 6;
21
+ total: number;
22
+ }): ReactNode[];
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { TimelineItemData, TimelineTone } from '../types.js';
3
+ /** The title, time, description and children of an item, in its text column. */
4
+ export declare function TimelineItemBody({ item, time, isLast, auto, flip, card, tone, row, }: {
5
+ item: TimelineItemData;
6
+ time: ReactNode;
7
+ isLast: boolean;
8
+ auto: boolean;
9
+ flip: boolean;
10
+ card: boolean;
11
+ tone: TimelineTone;
12
+ row: string;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /** The card behind an item that has `children`: a rounded surface with a tone bar on its start side (its end side when flipped). */
2
+ export declare function TimelineItemCard({ isLast, flip, }: {
3
+ isLast: boolean;
4
+ flip: boolean;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { TimelineItemData } from '../types.js';
2
+ /** The marker and the connector below it, in the item's first column. */
3
+ export declare function TimelineItemRail({ item, isLast, auto, row, }: {
4
+ item: TimelineItemData;
5
+ isLast: boolean;
6
+ auto: boolean;
7
+ row: string;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * The time of an item. In the wide layout it leaves the flow and sits across
4
+ * the rail from the card, `--timeline-time-gap` (set on the item) beyond the
5
+ * card's edge, on the logical side that faces the rail, so it mirrors in RTL.
6
+ */
7
+ export declare function TimelineItemTime({ children, auto, flip, card, }: {
8
+ children: ReactNode;
9
+ auto: boolean;
10
+ flip: boolean;
11
+ card: boolean;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** The loading rows: a marker, its rail and two lines of text, three times. */
2
+ export declare function TimelineSkeleton({ isLast }: {
3
+ isLast: boolean;
4
+ }): import("react").JSX.Element;
@@ -1,7 +1,18 @@
1
- import { TimelineItemData } from './types.js';
1
+ import { ReactNode } from 'react';
2
+ import { TimelineItemData, TimelineLayout } from './types.js';
2
3
  export type TimelineItemProps = {
3
4
  item: TimelineItemData;
4
5
  isLast?: boolean;
6
+ /** See `Timeline`. Default `auto`. */
7
+ layout?: TimelineLayout;
8
+ /** Position in the list: from the wide breakpoint on, odd ones sit on the start side. */
9
+ index?: number;
10
+ /** The reference instant for the relative time (as `RelativeTime`). Default: now. */
11
+ now?: Date;
12
+ /** The id of the element that names the group this item belongs to (a day heading). */
13
+ describedBy?: string;
14
+ /** A day heading rendered first, across the item's whole width. */
15
+ heading?: ReactNode;
5
16
  className?: string;
6
17
  };
7
- export declare function TimelineItem({ item, isLast, className, }: TimelineItemProps): import("react").JSX.Element;
18
+ export declare function TimelineItem({ item, isLast, layout, index, now, describedBy, heading, className, }: TimelineItemProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { ShapeTone } from '../shape/shape-tones.js';
3
+ import { TimelineItemData, TimelineTone } from './types.js';
4
+ export declare function toneChannel(tone: TimelineTone): ShapeTone;
5
+ /**
6
+ * The marker of an item: its tone's shape in the tone's container (never the
7
+ * solid saturated colour) holding the icon, or a dot; an avatar replaces it.
8
+ */
9
+ export declare function TimelineMarker({ item, className, }: {
10
+ item: TimelineItemData;
11
+ className?: string;
12
+ }): ReactNode;
@@ -0,0 +1,23 @@
1
+ import { TimelineItemData } from './types.js';
2
+ /** One row of the flat list: a day header, or an item (with the day it sits in). */
3
+ export type TimelineRow = {
4
+ kind: 'day';
5
+ group: number;
6
+ date: Date;
7
+ count: number;
8
+ } | {
9
+ kind: 'item';
10
+ item: TimelineItemData;
11
+ /** Position in the whole list. */
12
+ index: number;
13
+ /** The day header that labels it; unset before any dated item. */
14
+ group?: number;
15
+ };
16
+ /**
17
+ * The items in the order given, with a day header before each run of
18
+ * consecutive items on the same calendar day in `timeZone` (default: the
19
+ * runtime's). The list is not sorted: a day that comes back later opens a new
20
+ * run. An item without a valid `timestamp` stays in the run before it; those
21
+ * before any dated item have no header.
22
+ */
23
+ export declare function buildRows(items: TimelineItemData[], timeZone?: string, withDays?: boolean): TimelineRow[];
@@ -1,10 +1,40 @@
1
1
  import { ReactNode } from 'react';
2
- import { TimelineItemData } from './types.js';
2
+ import { TimelineItemData, TimelineLayout } from './types.js';
3
3
  export type TimelineProps = {
4
4
  items: TimelineItemData[];
5
5
  loading?: boolean;
6
6
  empty?: ReactNode;
7
+ /**
8
+ * Opens each day with a heading ("Today", "Yesterday", the date: a
9
+ * `DaySeparator`) and its count. Days are runs of the same local day in
10
+ * `timestamp`, in the order given. The list stays one flat `<ol>` and each
11
+ * heading sits inside the first item of its day, so an item keeps its parent
12
+ * and its state when the headings appear; each item
13
+ * points to its day with `aria-describedby`.
14
+ */
15
+ grouped?: boolean;
16
+ /** The level of the day headings, 2 to 6. Default 3. */
17
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
18
+ /**
19
+ * `auto` (default) alternates the two sides once the Timeline's own
20
+ * container is 48rem wide, whatever the viewport, and is one rail below;
21
+ * `rail` never alternates. `auto` measures its own container, so its
22
+ * parent needs a definite width (a block, a grid cell, `w-96`): in a
23
+ * shrink-to-fit parent (`w-fit`, an inline flex item) it collapses to 0
24
+ * wide. Use `rail` there.
25
+ */
26
+ layout?: TimelineLayout;
27
+ /**
28
+ * The IANA zone (`'America/Toronto'`) the days of `grouped` are cut in.
29
+ * Default: the runtime's. With `now`, the day headings also render on the
30
+ * server; without both, there are none on the server and on the first client
31
+ * render, and they appear once mounted (the items do not remount), so the
32
+ * two never differ.
33
+ */
34
+ timeZone?: string;
35
+ /** The reference instant for "Today" and "Yesterday" (as `RelativeTime`). Default: now. */
36
+ now?: Date;
7
37
  className?: string;
8
38
  'aria-label'?: string;
9
39
  };
10
- export declare function Timeline({ items, loading, empty, className, 'aria-label': ariaLabel, }: TimelineProps): import("react").JSX.Element;
40
+ export declare function Timeline({ items, loading, empty, grouped, headingLevel, layout, timeZone, now, className, 'aria-label': ariaLabel, }: TimelineProps): import("react").JSX.Element;
@@ -12,3 +12,9 @@ export type TimelineItemData = {
12
12
  tone?: TimelineTone;
13
13
  children?: ReactNode;
14
14
  };
15
+ /**
16
+ * `auto` (default): one rail, and two sides alternating once the Timeline's
17
+ * own container is wide (from 48rem); it needs a parent with a definite
18
+ * width. `rail`: always one rail.
19
+ */
20
+ export type TimelineLayout = 'auto' | 'rail';
@@ -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,2 @@
1
+ export * from './step-up-dialog.js';
2
+ export type { StepUpDialogLabels, StepUpDialogProps } from './types.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,3 @@
1
+ import { StepUpDialogLabels } from './types.js';
2
+ /** The built-in words (English or the active language), with their overrides. */
3
+ export declare function useStepUpLabels(overrides?: Partial<StepUpDialogLabels>): StepUpDialogLabels;
@@ -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>;