@nxgt/material 3.37.0 → 3.38.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 (85) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -1
  3. package/dist/{async-slice-BNI_F0jz.js → async-slice-DqjtOYlO.js} +2 -2
  4. package/dist/{button-CB4nSAMd.js → button-D52ron-a.js} +1 -1
  5. package/dist/charts.js +3 -3
  6. package/dist/{chip-B6m3yagf.js → chip-0XYwSp9o.js} +1 -1
  7. package/dist/{code-editor-BdiufnpC.js → code-editor-BetIXpJ6.js} +4 -4
  8. package/dist/code-editor.js +4 -4
  9. package/dist/{code-language-items-v5Rnq425.js → code-language-items-C7prxl_7.js} +2 -2
  10. package/dist/components/components.css +2 -0
  11. package/dist/components/ui/collections/server-table/server-table-phone-row.css +189 -0
  12. package/dist/{components-mqgqmfvj.js → components-NoCZ44Ri.js} +20396 -20186
  13. package/dist/components.js +15 -15
  14. package/dist/{dialog-DR9rACzY.js → dialog-BCsT_aLo.js} +1 -1
  15. package/dist/dnd.js +1 -1
  16. package/dist/{dropdown-menu-CpSnRXd-.js → dropdown-menu-Crt5QvTr.js} +1 -1
  17. package/dist/editor.js +7 -7
  18. package/dist/{empty-state-DMr94lsF.js → empty-state-DFWq2CWB.js} +1 -1
  19. package/dist/hooks.js +2 -2
  20. package/dist/{i18n-provider-A4mI4vc1.js → i18n-provider-C0RBM8rH.js} +1 -1
  21. package/dist/i18n.js +5 -5
  22. package/dist/{icon-badge-DXEBeS1y.js → icon-badge-XBoBIt_R.js} +1 -1
  23. package/dist/lib/components/ui/collections/data-table/data-table-list-slots.d.ts +12 -0
  24. package/dist/lib/components/ui/collections/data-table/internal.d.ts +1 -0
  25. package/dist/lib/components/ui/collections/data-table/partials/layouts/data-table-list-bar.d.ts +11 -1
  26. package/dist/lib/components/ui/collections/data-table/select-checkbox.d.ts +9 -1
  27. package/dist/lib/components/ui/collections/filter/internal.d.ts +1 -0
  28. package/dist/lib/components/ui/collections/server-table/partials/server-table-band-classes.d.ts +10 -0
  29. package/dist/lib/components/ui/collections/server-table/partials/server-table-band.d.ts +13 -2
  30. package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk-buttons.d.ts +6 -2
  31. package/dist/lib/components/ui/collections/server-table/partials/server-table-bulk.d.ts +10 -0
  32. package/dist/lib/components/ui/collections/server-table/partials/server-table-phone-row.d.ts +17 -0
  33. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  34. package/dist/lib/components/ui/layout/app-shell/activity-column.d.ts +2 -2
  35. package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +1 -1
  36. package/dist/lib/components/ui/layout/app-shell/activity-layout.types.d.ts +18 -1
  37. package/dist/lib/components/ui/layout/app-shell/app-breadcrumb.d.ts +20 -4
  38. package/dist/lib/components/ui/layout/app-shell/header-context.d.ts +10 -0
  39. package/dist/lib/components/ui/layout/app-shell/header-title.d.ts +5 -1
  40. package/dist/lib/components/ui/layout/app-shell/page-title.d.ts +21 -2
  41. package/dist/lib/components/ui/selection/chip-group-field/chip-group-columns.d.ts +3 -0
  42. package/dist/lib/components/ui/selection/chip-group-field/chip-group-field.d.ts +28 -5
  43. package/dist/lib/components/ui/selection/chip-group-field/chip-group-field.types.d.ts +17 -0
  44. package/dist/lib/components/ui/selection/chip-group-field/partials/chip-group-option.d.ts +7 -3
  45. package/dist/lib/components/ui/selection/chip-group-field/partials/chip-group-sections.d.ts +13 -0
  46. package/dist/lib/components/ui/selection/choice-group/choice-key-target.d.ts +1 -1
  47. package/dist/lib/components/ui/selection/choice-group/choice-press.d.ts +2 -0
  48. package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +3 -1
  49. package/dist/lib/components/ui/selection/choice-group/use-choice-group.d.ts +2 -0
  50. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-events.utils.d.ts +11 -1
  51. package/dist/lib/i18n/resources/en/en.d.ts +1 -0
  52. package/dist/lib/i18n/resources/en/material.json.d.ts +2 -1
  53. package/dist/lib/i18n/resources/fr/fr.d.ts +1 -0
  54. package/dist/lib/i18n/resources/fr/material.json.d.ts +2 -1
  55. package/dist/lib/i18n/resources/resources.d.ts +2 -0
  56. package/dist/lib/i18n/translator.d.ts +1 -1
  57. package/dist/lib.js +1 -1
  58. package/dist/main.js +21 -21
  59. package/dist/map.js +4 -4
  60. package/dist/material.css +1 -1
  61. package/dist/pdf-reader.js +1 -1
  62. package/dist/print.js +2 -2
  63. package/dist/{public-BdJCVnGS.js → public-CWIpzLzO.js} +6 -6
  64. package/dist/{rich-code-block-Bwhfhu7J.js → rich-code-block-C4aBv4cA.js} +4 -4
  65. package/dist/{sortable-provider-BshacF8v.js → sortable-provider-0uBi0zcP.js} +3 -2
  66. package/dist/{spinner-CKlDba5I.js → spinner-CuxEwO0d.js} +1 -1
  67. package/dist/{stored-language-CfQGHLq9.js → stored-language-D8aemZhx.js} +4 -2
  68. package/dist/theme-picker.js +2 -2
  69. package/dist/{theme-toggle--Zcf5AM8.js → theme-toggle-ik5nV1P5.js} +1 -1
  70. package/dist/{toolbar-items-B1W-uVHS.js → toolbar-items-C97E5HRa.js} +2 -2
  71. package/dist/{translate-material-xDh10aWZ.js → translate-material-B84ufMSF.js} +2 -2
  72. package/dist/{translator-BbOZntEF.js → translator-Bq8UHmvu.js} +1 -1
  73. package/dist/{use-chat-composer-C82hvxm4.js → use-chat-composer-DmDcEGp4.js} +2310 -2184
  74. package/dist/{use-heading-spy-DXYCeegh.js → use-heading-spy-BgG7Q47k.js} +1 -1
  75. package/dist/{use-material-translation-BK2YYCY3.js → use-material-translation-CiYhVc39.js} +2 -2
  76. package/docs/components/data-table-filter-and-lists.md +55 -2
  77. package/docs/components/navigation-and-layout.md +4 -2
  78. package/docs/components/selection-and-choice.md +67 -3
  79. package/docs/guides/app-shell.md +91 -2
  80. package/docs/guides/cards-and-tiles.md +5 -0
  81. package/docs/guides/i18n.md +1 -1
  82. package/docs/roadmap.md +5 -1
  83. package/lib/components/components.css +2 -0
  84. package/lib/components/ui/collections/server-table/server-table-phone-row.css +189 -0
  85. package/package.json +1 -1
@@ -16,8 +16,12 @@ export declare function HeaderTitle({ children, shrinks, }: {
16
16
  * The app bar's titles: the leading `headerTitle`, then the page's title (a
17
17
  * route's `handle.title`, the page's `h1`) after a thin rule when both are set.
18
18
  */
19
- export declare function AppBarTitles({ headerTitle, pageTitle, titleId, }: {
19
+ export declare function AppBarTitles({ headerTitle, pageTitle, pageTitleAfter, headerContext, titleId, }: {
20
20
  headerTitle?: ReactNode;
21
21
  pageTitle?: ReactNode;
22
+ /** The slot right after the page's title, outside its `h1`. */
23
+ pageTitleAfter?: ReactNode;
24
+ /** The small muted context line after the title, from `md` up. */
25
+ headerContext?: ReactNode;
22
26
  titleId?: string;
23
27
  }): import("react").JSX.Element;
@@ -13,6 +13,14 @@ export type PageTitle<Data = unknown> = ReactNode | ((match: UIMatch<Data>) => R
13
13
  export type AppShellHandle<Data = unknown> = {
14
14
  breadcrumb?: (match: UIMatch<Data>) => ReactNode;
15
15
  title?: PageTitle<Data>;
16
+ /**
17
+ * A node rendered right after the page's title in the app bar, outside its
18
+ * `h1` (a record's `Switcher`). A node, or a function of the matched route
19
+ * returning one, as `title` is. The deepest route declaring one wins; the
20
+ * `ActivityLayout` `titleAfter` prop wins over it. Ignored while the bar
21
+ * shows no page title.
22
+ */
23
+ titleAfter?: PageTitle<Data>;
16
24
  };
17
25
  /**
18
26
  * The title of the deepest matched route that declares a `handle.title`, or
@@ -20,6 +28,11 @@ export type AppShellHandle<Data = unknown> = {
20
28
  * anything: the title is in the server HTML, with no client-side effect.
21
29
  */
22
30
  export declare function resolvePageTitle(matches: UIMatch[]): ReactNode;
31
+ /**
32
+ * The `handle.titleAfter` of the deepest matched route that declares one, or
33
+ * `undefined`: resolved like {@link resolvePageTitle}, from the matches.
34
+ */
35
+ export declare function resolvePageTitleAfter(matches: UIMatch[]): ReactNode;
23
36
  /**
24
37
  * The `id` of the page's title in the app bar, or `undefined` when the bar
25
38
  * shows none. `ActivityContent` leaves its own large title out while it does
@@ -28,9 +41,11 @@ export declare function resolvePageTitle(matches: UIMatch[]): ReactNode;
28
41
  */
29
42
  export declare const PageTitleContext: import('react').Context<string | undefined>;
30
43
  /** The layout's page title and the `id` its `h1` and `<main>`'s label share. */
31
- export declare function usePageTitleScope(): {
44
+ export declare function usePageTitleScope(titleAfter?: ReactNode, headerContext?: ReactNode): {
32
45
  pageTitle: ReactNode;
33
46
  titleId: string | undefined;
47
+ pageTitleAfter: ReactNode;
48
+ headerContext: ReactNode;
34
49
  };
35
50
  /** The part of `document` {@link pageStartTarget} reads. */
36
51
  type FocusRoot = Pick<Document, 'getElementById' | 'querySelector'>;
@@ -71,8 +86,12 @@ export declare function usePageTitle(): ReactNode;
71
86
  * leading title does, #629); the accessible name is the content itself.
72
87
  * The display face is `--font-display`, the body face without it.
73
88
  */
74
- export declare function PageHeading({ children, id, }: {
89
+ export declare function PageHeading({ children, id, after, context, }: {
75
90
  children?: ReactNode;
76
91
  id?: string;
92
+ /** The slot right after the title, outside the `h1`: it never truncates, the title does. */
93
+ after?: ReactNode;
94
+ /** The small muted context line (the tenant), last in the row, from `md` up. */
95
+ context?: ReactNode;
77
96
  }): import("react").JSX.Element | null;
78
97
  export {};
@@ -0,0 +1,3 @@
1
+ import { ChipGroupColumns } from './chip-group-field.types.js';
2
+ /** The grid classes of `columns`: a number is the same at every width. */
3
+ export declare function chipGroupColumnClasses(columns: ChipGroupColumns): string;
@@ -1,10 +1,31 @@
1
1
  import { ChipSize } from '../../display/chip/chip.variants.js';
2
2
  import { ChoiceGroupBase, ChoiceSelection } from '../choice-group/choice-group.types.js';
3
- import { ChipGroupOption } from './chip-group-field.types.js';
4
- export type { ChipGroupOption };
5
- export type ChipGroupFieldProps = ChoiceGroupBase & ChoiceSelection & {
6
- options: ChipGroupOption[];
3
+ import { ChipGroupColumns, ChipGroupOption, ChipGroupSection } from './chip-group-field.types.js';
4
+ export type { ChipGroupColumns, ChipGroupOption, ChipGroupSection };
5
+ type ChipGroupFieldBase = ChoiceGroupBase & ChoiceSelection & {
7
6
  size?: ChipSize;
7
+ /**
8
+ * Lays the chips out in equal-width columns (`4`, or one count per
9
+ * breakpoint: `{ base: 2, md: 4 }`). Up and Down then move by row. Left
10
+ * unset, the chips flow and wrap.
11
+ */
12
+ columns?: ChipGroupColumns;
13
+ /**
14
+ * Prints a disabled option's `disabledReason` under its chip, so a touch
15
+ * user sees it too. Default `true`; `false` leaves it to the tooltip and
16
+ * the accessible description.
17
+ */
18
+ showDisabledReason?: boolean;
19
+ };
20
+ export type ChipGroupFieldProps = ChipGroupFieldBase & {
21
+ /** The chips, in one flow. Give `options` or `groups`. */
22
+ options?: ChipGroupOption[];
23
+ /**
24
+ * Titled runs of options in one group: each is a `group` named by its
25
+ * heading, and the arrow keys run through all of them in order. Wins over
26
+ * `options` when both are given.
27
+ */
28
+ groups?: ChipGroupSection[];
8
29
  };
9
30
  /**
10
31
  * Chips that choose: one (`type="single"`, the default; a `radiogroup` of
@@ -12,6 +33,8 @@ export type ChipGroupFieldProps = ChoiceGroupBase & ChoiceSelection & {
12
33
  * (`type="multiple"`; a `group` of `checkbox` chips, arrows move the focus,
13
34
  * Space toggles). Enter does nothing, so it never submits a form. A disabled
14
35
  * option, or any unchosen one once `max` is reached, stays focusable and
15
- * says why. The `ref` reaches the chip that holds the tab stop.
36
+ * says why: a disabled option's `disabledReason` is printed under the chip
37
+ * and tied to it by `aria-describedby`. `columns` draws an even grid and
38
+ * `groups` titled sections. The `ref` reaches the chip that holds the tab stop.
16
39
  */
17
40
  export declare function ChipGroupField(props: ChipGroupFieldProps): import("react").JSX.Element;
@@ -6,3 +6,20 @@ export type ChipGroupOption = ChoiceOption & {
6
6
  /** Shown after the label and added to its accessible name. */
7
7
  count?: number;
8
8
  };
9
+ /** A titled run of options, such as "Morning" or "Afternoon". */
10
+ export type ChipGroupSection = {
11
+ /** The heading, and the accessible name of the section's `group`. */
12
+ label: string;
13
+ options: ChipGroupOption[];
14
+ };
15
+ /**
16
+ * Equal-width columns: one number for every width, or one per breakpoint
17
+ * (`sm` 40rem, `md` 48rem, `lg` 64rem), each holding until the next. Counts
18
+ * run from 1 to 12.
19
+ */
20
+ export type ChipGroupColumns = number | {
21
+ base?: number;
22
+ sm?: number;
23
+ md?: number;
24
+ lg?: number;
25
+ };
@@ -10,13 +10,17 @@ export type ChipGroupChipProps = {
10
10
  dataPw: string;
11
11
  /** The field's `name`, on every chip: a lookup by name finds the group. */
12
12
  name?: string;
13
+ /** The chips sit in grid cells: each fills its cell and centres its text. */
14
+ columns?: boolean;
15
+ /** Print a disabled option's reason under the chip. */
16
+ showReason?: boolean;
13
17
  };
14
18
  /**
15
19
  * One chip of a `ChipGroupField`: a `Chip` with the group's role (`radio` or
16
20
  * `checkbox`), `aria-checked`, and the tab stop. A chosen chip swaps its icon
17
21
  * for the chip's own check, so the choice never relies on colour alone. The
18
- * disabled reason (or the description) is its tooltip, and both are read out
19
- * through `aria-describedby`.
22
+ * disabled reason is printed under it (`showReason`, else it is the tooltip),
23
+ * and the reason and the description are read out through `aria-describedby`.
20
24
  */
21
- export declare function ChipGroupChip({ group, option, index, size, dataPw, name, }: ChipGroupChipProps): import("react").JSX.Element;
25
+ export declare function ChipGroupChip({ group, option, index, size, dataPw, name, columns, showReason, }: ChipGroupChipProps): import("react").JSX.Element;
22
26
  export {};
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { ChipGroupOption, ChipGroupSection } from '../chip-group-field.types.js';
3
+ /**
4
+ * The titled sections of a `ChipGroupField`: each a `group` named by its
5
+ * heading, its chips in a wrapping row or the field's grid. The chips keep
6
+ * the field-wide index, so one arrow-key sequence runs through all of them.
7
+ */
8
+ export declare function ChipGroupSections({ groupId, sections, gridClasses, renderChip, }: {
9
+ groupId: string;
10
+ sections: ChipGroupSection[];
11
+ gridClasses?: string;
12
+ renderChip: (option: ChipGroupOption, index: number) => ReactNode;
13
+ }): import("react").JSX.Element[];
@@ -7,4 +7,4 @@ import { ChoiceOption } from './choice-group.types.js';
7
7
  * items wrap, as RadioGroup's do. Answers the index the focus moved to,
8
8
  * or `null` when it did not move.
9
9
  */
10
- export declare function choiceKeyTarget(event: KeyboardEvent<HTMLElement>, items: (HTMLElement | null)[], options: ChoiceOption[], disabled?: boolean): number | null;
10
+ export declare function choiceKeyTarget(event: KeyboardEvent<HTMLElement>, items: (HTMLElement | null)[], options: ChoiceOption[], disabled?: boolean, grid?: boolean): number | null;
@@ -6,6 +6,8 @@ export type ChoiceContext = {
6
6
  selection: ChoiceSelection;
7
7
  disabled?: boolean;
8
8
  max?: number;
9
+ /** Up and Down move by row, the options being laid out in a grid. */
10
+ grid?: boolean;
9
11
  };
10
12
  /**
11
13
  * Presses option `index`: a no-op when the group is disabled, or the option
@@ -5,7 +5,9 @@ import { ChoiceGroupBase, ChoiceOption, ChoiceSelection } from './choice-group.t
5
5
  * left for the root element. The field takes its own props (`options`,
6
6
  * `size`, `columns`...) out first and passes the common rest.
7
7
  */
8
- export declare function useChoiceGroupField(props: ChoiceGroupBase<HTMLButtonElement> & ChoiceSelection, options: ChoiceOption[]): {
8
+ export declare function useChoiceGroupField(props: ChoiceGroupBase<HTMLButtonElement> & ChoiceSelection, options: ChoiceOption[], layout?: {
9
+ grid?: boolean;
10
+ }): {
9
11
  group: {
10
12
  groupId: string;
11
13
  ids: {
@@ -8,6 +8,8 @@ type CallerAria = {
8
8
  export type UseChoiceGroupOptions<E extends HTMLElement = HTMLElement> = Pick<ChoiceGroupBase<E>, 'label' | 'helperText' | 'error' | 'required' | 'disabled' | 'id' | 'max' | 'min' | 'orientation' | 'ref'> & {
9
9
  options: ChoiceOption[];
10
10
  selection: ChoiceSelection;
11
+ /** The items sit in rows and columns: Up and Down move by row. */
12
+ grid?: boolean;
11
13
  /** The caller's own aria props, which win over the generated ones. */
12
14
  aria?: CallerAria;
13
15
  };
@@ -10,5 +10,15 @@ export declare function toAllDayEvent(event: CalendarEvent, day: Date): Calendar
10
10
  export declare function moveEventToDay(event: CalendarEvent, day: Date): CalendarEvent;
11
11
  export declare function moveEventToDateTime(event: CalendarEvent, dateTime: Date): CalendarEvent;
12
12
  export declare function resizeEventEnd(event: CalendarEvent, end: Date): CalendarEvent;
13
- export declare function layoutTimedEvents(events: CalendarEvent[], day: Date, startHour: number, endHour: number): LaidOutEvent[];
13
+ /** The shortest an event is drawn, in px: WCAG 2.5.8's 24px target. */
14
+ export declare const MIN_EVENT_HEIGHT = 24;
15
+ /** The minutes an event draws over at least, at `hourHeight` px an hour. */
16
+ export declare function minEventMinutes(hourHeight: number): number;
17
+ /**
18
+ * Lays the day's timed events out in columns. A short event is drawn at least
19
+ * `MIN_EVENT_HEIGHT` tall, so it takes the room of `minMinutes` (default: its
20
+ * real duration): one that would then run into the next in its column gets a
21
+ * column of its own, and two targets never overlap.
22
+ */
23
+ export declare function layoutTimedEvents(events: CalendarEvent[], day: Date, startHour: number, endHour: number, minMinutes?: number): LaidOutEvent[];
14
24
  export declare function isToday(day: Date, now?: Date): boolean;
@@ -2076,6 +2076,7 @@ export declare const en: {
2076
2076
  "error-hint": string;
2077
2077
  "bulk-action": string;
2078
2078
  "bulk-action-name": string;
2079
+ "bulk-more": string;
2079
2080
  };
2080
2081
  "list-empty": {
2081
2082
  clear: string;
@@ -2065,7 +2065,8 @@ declare const _default: {
2065
2065
  "error": "Could not load the list",
2066
2066
  "error-hint": "Check your connection, then try again.",
2067
2067
  "bulk-action": "{label} ({count})",
2068
- "bulk-action-name": "{label} {count, plural, one {# row} other {# rows}}"
2068
+ "bulk-action-name": "{label} {count, plural, one {# row} other {# rows}}",
2069
+ "bulk-more": "More"
2069
2070
  },
2070
2071
  "list-empty": {
2071
2072
  "clear": "Clear search and filters"
@@ -2076,6 +2076,7 @@ export declare const fr: {
2076
2076
  "error-hint": string;
2077
2077
  "bulk-action": string;
2078
2078
  "bulk-action-name": string;
2079
+ "bulk-more": string;
2079
2080
  };
2080
2081
  "list-empty": {
2081
2082
  clear: string;
@@ -2065,7 +2065,8 @@ declare const _default: {
2065
2065
  "error": "Impossible de charger la liste",
2066
2066
  "error-hint": "Vérifiez votre connexion, puis réessayez.",
2067
2067
  "bulk-action": "{label} ({count})",
2068
- "bulk-action-name": "{label} : {count, plural, one {# ligne} other {# lignes}}"
2068
+ "bulk-action-name": "{label} : {count, plural, one {# ligne} other {# lignes}}",
2069
+ "bulk-more": "Plus"
2069
2070
  },
2070
2071
  "list-empty": {
2071
2072
  "clear": "Effacer la recherche et les filtres"
@@ -2074,6 +2074,7 @@ export declare const resources: {
2074
2074
  "error-hint": string;
2075
2075
  "bulk-action": string;
2076
2076
  "bulk-action-name": string;
2077
+ "bulk-more": string;
2077
2078
  };
2078
2079
  "list-empty": {
2079
2080
  clear: string;
@@ -4888,6 +4889,7 @@ export declare const resources: {
4888
4889
  "error-hint": string;
4889
4890
  "bulk-action": string;
4890
4891
  "bulk-action-name": string;
4892
+ "bulk-more": string;
4891
4893
  };
4892
4894
  "list-empty": {
4893
4895
  clear: string;