@nxgt/material 3.92.0 → 3.93.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 (131) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +2 -2
  3. package/dist/{alert-dialog-Bz5PlYKp.js → alert-dialog-D37eph4I.js} +1 -1
  4. package/dist/{async-slice-veSVxKqt.js → async-slice-BSqwhAj-.js} +1 -1
  5. package/dist/{button-a3tH3pq4.js → button-CG9SBAT-.js} +1 -1
  6. package/dist/{calculator-BtuKV3PK.js → calculator-YD3I3y-I.js} +10 -10
  7. package/dist/calculator-field.js +6 -6
  8. package/dist/{calculator-segment-CyB9IhEq.js → calculator-segment-Cjec9zi7.js} +1 -1
  9. package/dist/calculator.js +1 -1
  10. package/dist/charts.js +3 -3
  11. package/dist/{chip-BwGvGx_S.js → chip-BbUSBl3i.js} +2 -2
  12. package/dist/{code-editor-BLkmEoCi.js → code-editor-ZEM7AAcs.js} +4 -4
  13. package/dist/code-editor.js +4 -4
  14. package/dist/{code-language-items-DhAC_tCs.js → code-language-items-CAuHPrHd.js} +2 -2
  15. package/dist/components/components.css +1 -0
  16. package/dist/components/ui/widgets/event-calendar/event-calendar-backdrop.css +43 -0
  17. package/dist/{components-DX4aHtgP.js → components-CuFTrmGy.js} +19654 -19043
  18. package/dist/components.js +38 -38
  19. package/dist/{conversion-variant-C4t7aH9d.js → conversion-variant-DmEtTCSP.js} +3 -3
  20. package/dist/{currency-field-D0UQb5pn.js → currency-field-CabGnVO9.js} +5 -5
  21. package/dist/{dialog-vQMypIOm.js → dialog-Jhpx6ulb.js} +3 -3
  22. package/dist/dnd.js +1 -1
  23. package/dist/{dropdown-menu-B2ctUFti.js → dropdown-menu-nl0Q3tQ2.js} +1 -1
  24. package/dist/editor.js +7 -7
  25. package/dist/{empty-state-Bs44jnWk.js → empty-state-mrJuqph3.js} +1 -1
  26. package/dist/{financial-variant-B5iZ3pYf.js → financial-variant-P8gFA9aI.js} +5 -5
  27. package/dist/{hooks-CJtRFDYD.js → hooks-CjSpziWf.js} +2 -2
  28. package/dist/hooks.js +2 -2
  29. package/dist/{hover-card-B8PYUsv_.js → hover-card-BNb1M8ij.js} +1 -1
  30. package/dist/i18n.js +3 -3
  31. package/dist/{icon-badge-YT98b2Vx.js → icon-badge-CVMHwdFm.js} +1 -1
  32. package/dist/{icon-button-BylI02aX.js → icon-button-Ch0PThsa.js} +1 -1
  33. package/dist/{input-group-CiayHfBN.js → input-group-CPMSQcBx.js} +1 -1
  34. package/dist/lib/components/ui/collections/day-grouped-list/index.d.ts +6 -0
  35. package/dist/lib/components/ui/display/entity-header/entity-metadata.d.ts +2 -0
  36. package/dist/lib/components/ui/display/event-chip/event-chip-badges.d.ts +21 -0
  37. package/dist/lib/components/ui/display/event-chip/event-chip-content.d.ts +5 -7
  38. package/dist/lib/components/ui/display/event-chip/event-chip-title.d.ts +9 -0
  39. package/dist/lib/components/ui/display/event-chip/event-chip.classes.d.ts +9 -0
  40. package/dist/lib/components/ui/display/event-chip/event-chip.d.ts +15 -2
  41. package/dist/lib/components/ui/fields/attributes/attribute-values-form-field-set/attribute-values-form-field-set.d.ts +1 -1
  42. package/dist/lib/components/ui/fields/choice-list/choice-list-control.d.ts +1 -1
  43. package/dist/lib/components/ui/fields/choice-list/choice-list-field.d.ts +1 -1
  44. package/dist/lib/components/ui/fields/choice-list/choice-list-focus.d.ts +6 -3
  45. package/dist/lib/components/ui/fields/choice-list/choice-list-form-field.d.ts +2 -2
  46. package/dist/lib/components/ui/fields/choice-list/choice-list-names.d.ts +2 -0
  47. package/dist/lib/components/ui/fields/choice-list/choice-list.utils.d.ts +2 -0
  48. package/dist/lib/components/ui/fields/choice-list/index.d.ts +1 -1
  49. package/dist/lib/components/ui/fields/choice-list/partials/choice-row.d.ts +9 -3
  50. package/dist/lib/components/ui/fields/choice-list/types.d.ts +20 -0
  51. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  52. package/dist/lib/components/ui/layout/record-page/record-details.d.ts +6 -6
  53. package/dist/lib/components/ui/widgets/event-calendar/backdrop.types.d.ts +75 -0
  54. package/dist/lib/components/ui/widgets/event-calendar/chrome.types.d.ts +12 -0
  55. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-context.d.ts +8 -1
  56. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-events.utils.d.ts +3 -1
  57. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-shell.d.ts +1 -1
  58. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.backdrop.d.ts +38 -0
  59. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.badges.d.ts +14 -0
  60. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.labels.d.ts +14 -1
  61. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.lanes.d.ts +9 -0
  62. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.read-only.d.ts +57 -0
  63. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.resources.d.ts +6 -1
  64. package/dist/lib/components/ui/widgets/event-calendar/index.d.ts +2 -1
  65. package/dist/lib/components/ui/widgets/event-calendar/partials/all-day-bars.d.ts +14 -0
  66. package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-bands.d.ts +11 -0
  67. package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-bar.d.ts +11 -0
  68. package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-cell.d.ts +13 -0
  69. package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-row.d.ts +8 -0
  70. package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-badge.d.ts +16 -0
  71. package/dist/lib/components/ui/widgets/event-calendar/partials/month-day-cell.d.ts +4 -1
  72. package/dist/lib/components/ui/widgets/event-calendar/partials/month-day-parts.d.ts +12 -1
  73. package/dist/lib/components/ui/widgets/event-calendar/partials/resource-header.d.ts +2 -1
  74. package/dist/lib/components/ui/widgets/event-calendar/partials/span-event.d.ts +3 -1
  75. package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-header-day.d.ts +3 -6
  76. package/dist/lib/components/ui/widgets/event-calendar/partials/zone-corner.d.ts +10 -2
  77. package/dist/lib/components/ui/widgets/event-calendar/template.types.d.ts +7 -2
  78. package/dist/lib/components/ui/widgets/event-calendar/types.d.ts +25 -13
  79. package/dist/lib/components/ui/widgets/event-calendar/use-backdrops.d.ts +8 -0
  80. package/dist/lib/components/ui/widgets/event-calendar/use-badges.d.ts +5 -0
  81. package/dist/lib/components/ui/widgets/event-calendar/use-event-calendar.d.ts +3 -2
  82. package/dist/lib/components/ui/widgets/event-calendar/use-month-day.d.ts +6 -1
  83. package/dist/lib/components/ui/widgets/event-calendar/use-time-column.d.ts +1 -0
  84. package/dist/lib/i18n/resources/en/en.d.ts +7 -0
  85. package/dist/lib/i18n/resources/en/material.json.d.ts +7 -0
  86. package/dist/lib/i18n/resources/fr/fr.d.ts +7 -0
  87. package/dist/lib/i18n/resources/fr/material.json.d.ts +7 -0
  88. package/dist/lib/i18n/resources/resources.d.ts +14 -0
  89. package/dist/lib/i18n/translator.d.ts +1 -1
  90. package/dist/lib.js +1 -1
  91. package/dist/main.js +54 -54
  92. package/dist/map.js +7 -7
  93. package/dist/material.css +1 -1
  94. package/dist/pdf-reader.js +1 -1
  95. package/dist/{percent-field-DuoZieW9.js → percent-field-TWyupyr_.js} +1 -1
  96. package/dist/{picker-surface-BKzM6TWN.js → picker-surface-CoNsDWxX.js} +4 -4
  97. package/dist/{popover-ukgGm5B6.js → popover-BA1U82Wk.js} +1 -1
  98. package/dist/{pos-types-BNXbls3v.js → pos-types-BQqv-kb6.js} +1 -1
  99. package/dist/{pos-variant-CZ3OZtPq.js → pos-variant-D043n5y8.js} +4 -4
  100. package/dist/print.js +1 -1
  101. package/dist/{programmer-variant-DVu-pYhB.js → programmer-variant-jneMqtLs.js} +2 -2
  102. package/dist/{public-DtXwn8bx.js → public-DgrbdeZj.js} +9 -9
  103. package/dist/{rich-code-block-DUaSLxLT.js → rich-code-block-CGNjHawR.js} +5 -5
  104. package/dist/{scientific-variant-Ku9feVN1.js → scientific-variant-1L7brNNT.js} +2 -2
  105. package/dist/{sortable-provider-DIb1HgZA.js → sortable-provider-DZLV_svg.js} +2 -2
  106. package/dist/{spinner-CHWFXCfd.js → spinner-CQqRWxAW.js} +1 -1
  107. package/dist/{tabs-BideU0Rb.js → tabs-DQTx3C8e.js} +1 -1
  108. package/dist/theme-picker.js +2 -2
  109. package/dist/{theme-toggle-DUQTEe1y.js → theme-toggle-3NQ3VmJH.js} +1 -1
  110. package/dist/{toolbar-items-azkXY5w2.js → toolbar-items-BYCdJGUf.js} +4 -4
  111. package/dist/{translate-material-d8Q5K5a_.js → translate-material-jxfcGlD5.js} +1 -1
  112. package/dist/{translator-CxyFsfO0.js → translator-6XuDmqUJ.js} +10 -0
  113. package/dist/{use-chat-composer-FACltVyX.js → use-chat-composer-1eb4I1kM.js} +16 -16
  114. package/dist/{use-heading-spy-DHd5TScW.js → use-heading-spy-CzPujlKr.js} +4 -4
  115. package/dist/{use-material-translation-DA5ECZfA.js → use-material-translation-BUPqNmAg.js} +1 -1
  116. package/dist/{use-return-focus-CAAvJ6p5.js → use-return-focus-B_enQxp5.js} +1 -1
  117. package/docs/README.md +1 -0
  118. package/docs/components/data-display.md +6 -1
  119. package/docs/components/data-table-filter-and-lists.md +3 -0
  120. package/docs/components/form-fields.md +38 -5
  121. package/docs/components/navigation-and-layout.md +1 -0
  122. package/docs/components/rich-widgets.md +58 -5
  123. package/docs/guides/event-calendar.md +163 -0
  124. package/docs/guides/forms.md +2 -1
  125. package/docs/guides/i18n.md +2 -0
  126. package/docs/previews/data-display-eventchip.webp +0 -0
  127. package/docs/previews/rich-widgets-eventcalendar.webp +0 -0
  128. package/docs/roadmap.md +12 -0
  129. package/lib/components/components.css +1 -0
  130. package/lib/components/ui/widgets/event-calendar/event-calendar-backdrop.css +43 -0
  131. package/package.json +1 -1
@@ -10,4 +10,4 @@ export type { ChoiceListFieldProps } from './types.js';
10
10
  * new one, with one call of `onAssignIds` (default: `onChange`) on mount.
11
11
  * `ChoiceListFormField` wires it to react-hook-form.
12
12
  */
13
- export declare function ChoiceListField({ value, onChange, onAssignIds, selection, rowLabel, reorderable, rowErrors, disabled, onBlur, ref, ...props }: ChoiceListFieldProps): import("react").JSX.Element;
13
+ export declare function ChoiceListField({ value, onChange, onAssignIds, selection, rowLabel, reorderable, rowErrors, rowDetail, rowDetailErrors, disabled, onBlur, ref, ...props }: ChoiceListFieldProps): import("react").JSX.Element;
@@ -10,6 +10,9 @@ export type ArrayError = {
10
10
  text?: {
11
11
  message?: string;
12
12
  };
13
+ explanation?: {
14
+ message?: string;
15
+ };
13
16
  } | undefined;
14
17
  };
15
18
  /**
@@ -43,7 +46,7 @@ export declare function useRefusedFocus(error: () => ArrayError | undefined, bla
43
46
  };
44
47
  /**
45
48
  * The handle React Hook Form gets as the `ref` of a row path
46
- * (`choices.<i>.text`): `setFocus` and `setError(…, { shouldFocus })` on that
47
- * path call its `focus()`, which goes to the row's text input.
49
+ * (`choices.<i>.text`, or `.explanation`): `setFocus` and `setError(…, { shouldFocus })` on that
50
+ * path call its `focus()`, which goes to the row's text input (the detail textarea for `.explanation`).
48
51
  */
49
- export declare function rowFocus(list: RefObject<Element | null>, position: number): FocusHandle;
52
+ export declare function rowFocus(list: RefObject<Element | null>, position: number, field?: 'text' | 'explanation'): FocusHandle;
@@ -1,6 +1,6 @@
1
1
  import { FieldValues, UseControllerProps } from 'react-hook-form';
2
2
  import { ChoiceListFieldProps } from './types.js';
3
- export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'onBlur'> & {
3
+ export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'rowDetailErrors' | 'onBlur'> & {
4
4
  /**
5
5
  * The built-in rules ask for one marked row at least. `false` lets a list
6
6
  * with none pass (a poll). Default true.
@@ -16,4 +16,4 @@ export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseController
16
16
  * way: `choices.2.text` under row 3, `choices` under the list. Ids given on
17
17
  * mount do not make the form dirty when a `FormProvider` is above.
18
18
  */
19
- export declare function ChoiceListFormField<T extends FieldValues>({ control, name, min, selection, requireCorrect, rowLabel, disabled, ...props }: ChoiceListFormFieldProps<T>): import("react").JSX.Element;
19
+ export declare function ChoiceListFormField<T extends FieldValues>({ control, name, min, selection, requireCorrect, rowLabel, disabled, rowDetail, ...props }: ChoiceListFormFieldProps<T>): import("react").JSX.Element;
@@ -5,6 +5,8 @@ type Translate = ReturnType<typeof useMaterialTranslation>['t'];
5
5
  export declare const defaultRowLabel: (t: Translate) => string;
6
6
  /** A row's text field label: "Answer 2". */
7
7
  export declare const textLabel: (label: string, position: number) => string;
8
+ /** A row's detail textarea label: "Explanation 2". */
9
+ export declare const detailLabel: (label: string | undefined, t: Translate, position: number) => string;
8
10
  /** The visible word beside the mark. */
9
11
  export declare const correctText: (t: Translate) => string;
10
12
  /** The mark's accessible name, which starts with its visible word. */
@@ -12,6 +12,8 @@ export declare function setCorrect(rows: readonly ChoiceRow[], id: string, corre
12
12
  /** The rows with one more at the end; in `single` it is marked when none is. */
13
13
  export declare function addChoice(rows: readonly ChoiceRow[], selection: ChoiceListSelection): ChoiceRow[];
14
14
  export declare function setText(rows: readonly ChoiceRow[], id: string, text: string): ChoiceRow[];
15
+ /** Sets a row's detail text, keeping its other fields. */
16
+ export declare function setExplanation(rows: readonly ChoiceRow[], id: string, explanation: string): ChoiceRow[];
15
17
  export declare const removeAt: (rows: readonly ChoiceRow[], index: number) => ChoiceRow[];
16
18
  export declare function moveRow(rows: readonly ChoiceRow[], from: number, to: number): ChoiceRow[];
17
19
  export type ChoiceListIssue = 'too-few' | 'too-many' | 'none-correct' | 'blank';
@@ -1,3 +1,3 @@
1
1
  export * from './choice-list-field.js';
2
2
  export * from './choice-list-form-field.js';
3
- export type { ChoiceListSelection, ChoiceRow } from './types.js';
3
+ export type { ChoiceListSelection, ChoiceRow, ChoiceRowDetail } from './types.js';
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ChoiceListSelection, ChoiceRow as Row } from '../types.js';
2
+ import { ChoiceListSelection, ChoiceRowDetail, ChoiceRow as Row } from '../types.js';
3
3
  export type ChoiceRowProps = {
4
4
  row: Row;
5
5
  position: number;
@@ -7,6 +7,11 @@ export type ChoiceRowProps = {
7
7
  selection: ChoiceListSelection;
8
8
  disabled?: boolean;
9
9
  error?: ReactNode;
10
+ /** The detail textarea under the row; absent: none. */
11
+ detail?: ChoiceRowDetail & {
12
+ name: string;
13
+ error?: ReactNode;
14
+ };
10
15
  names: {
11
16
  text: (position: number) => string;
12
17
  correctText: string;
@@ -14,6 +19,7 @@ export type ChoiceRowProps = {
14
19
  };
15
20
  onText: (text: string) => void;
16
21
  onCorrect: (correct: boolean) => void;
22
+ onDetail?: (explanation: string) => void;
17
23
  };
18
- /** One row's fields: the answer's text, then its mark. */
19
- export declare function ChoiceListRow({ row, position, radioName, selection, disabled, error, names, onText, onCorrect, }: ChoiceRowProps): import("react").JSX.Element;
24
+ /** One row's fields: the answer's text, its mark, then its detail when asked. */
25
+ export declare function ChoiceListRow({ row, position, radioName, selection, disabled, error, detail, names, onText, onCorrect, onDetail, }: ChoiceRowProps): import("react").JSX.Element;
@@ -6,6 +6,19 @@ export type ChoiceRow = {
6
6
  id: string;
7
7
  text: string;
8
8
  correct: boolean;
9
+ /**
10
+ * A detail about the choice (why it is right or wrong), edited when the
11
+ * list has `rowDetail`. Absent until a user types in it.
12
+ */
13
+ explanation?: string;
14
+ };
15
+ /** The optional detail textarea under each row (`ChoiceRow.explanation`). */
16
+ export type ChoiceRowDetail = {
17
+ /** The textarea's label, before the row's number. Default "Explanation", translated. */
18
+ label?: string;
19
+ placeholder?: string;
20
+ /** Limits the text and shows a counter. */
21
+ maxLength?: number;
9
22
  };
10
23
  /**
11
24
  * `single` marks one row (radios; marking a row unmarks the others) and
@@ -35,6 +48,13 @@ export type ChoiceListFieldProps = Omit<ComponentProps<'div'>, 'children' | 'onC
35
48
  error?: ReactNode;
36
49
  /** An error per row, by id: `{ [row.id]: 'Enter the answer' }`. */
37
50
  rowErrors?: Readonly<Record<string, ReactNode>>;
51
+ /**
52
+ * Adds a textarea under each row, stored as `ChoiceRow.explanation`
53
+ * (`true` for its defaults). Absent: no detail, rows unchanged.
54
+ */
55
+ rowDetail?: boolean | ChoiceRowDetail;
56
+ /** An error per row's detail, by id. */
57
+ rowDetailErrors?: Readonly<Record<string, ReactNode>>;
38
58
  /**
39
59
  * Called when the focus leaves the whole list, for a field used alone;
40
60
  * inside a `FieldBlur` the list's root is registered and this is not