@nxgt/material 3.91.0 → 3.92.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 (86) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +1 -1
  3. package/dist/{alert-dialog-BFk4ye-3.js → alert-dialog-Bz5PlYKp.js} +1 -1
  4. package/dist/{async-slice-gGyfyUw2.js → async-slice-veSVxKqt.js} +1 -1
  5. package/dist/{button-C5OEq9bi.js → button-a3tH3pq4.js} +1 -1
  6. package/dist/{calculator-Dg_L6d3R.js → calculator-BtuKV3PK.js} +10 -10
  7. package/dist/calculator-field.js +6 -6
  8. package/dist/{calculator-segment-CvAaDqKf.js → calculator-segment-CyB9IhEq.js} +1 -1
  9. package/dist/calculator.js +1 -1
  10. package/dist/charts.js +3 -3
  11. package/dist/{chip-DOxFA4BI.js → chip-BwGvGx_S.js} +2 -2
  12. package/dist/{code-editor-tiAjhXW-.js → code-editor-BLkmEoCi.js} +4 -4
  13. package/dist/code-editor.js +4 -4
  14. package/dist/{code-language-items-CcdzQvLT.js → code-language-items-DhAC_tCs.js} +2 -2
  15. package/dist/{components-G0nEVa52.js → components-DX4aHtgP.js} +13259 -13104
  16. package/dist/components.js +38 -38
  17. package/dist/{conversion-variant-4gCdFWV-.js → conversion-variant-C4t7aH9d.js} +3 -3
  18. package/dist/{currency-field-CIqe7Wg4.js → currency-field-D0UQb5pn.js} +5 -5
  19. package/dist/{dialog-d6Kdf5wc.js → dialog-vQMypIOm.js} +3 -3
  20. package/dist/dnd.js +1 -1
  21. package/dist/{dropdown-menu-DO5kUvof.js → dropdown-menu-B2ctUFti.js} +1 -1
  22. package/dist/editor.js +7 -7
  23. package/dist/{empty-state-DQnICuun.js → empty-state-Bs44jnWk.js} +1 -1
  24. package/dist/{financial-variant-D80C1hVD.js → financial-variant-B5iZ3pYf.js} +5 -5
  25. package/dist/{hooks-C-yLDF39.js → hooks-CJtRFDYD.js} +2 -2
  26. package/dist/hooks.js +2 -2
  27. package/dist/{hover-card-DU3TAME4.js → hover-card-B8PYUsv_.js} +1 -1
  28. package/dist/i18n.js +3 -3
  29. package/dist/{icon-badge-BGczZ4Hc.js → icon-badge-YT98b2Vx.js} +1 -1
  30. package/dist/{icon-button-D0xjBCst.js → icon-button-BylI02aX.js} +1 -1
  31. package/dist/{input-group-CSlXMFxu.js → input-group-CiayHfBN.js} +1 -1
  32. package/dist/lib/components/ui/collections/day-grouped-list/day-grouped-list.d.ts +30 -2
  33. package/dist/lib/components/ui/collections/day-grouped-list/index.d.ts +1 -2
  34. package/dist/lib/components/ui/collections/day-grouped-list/partials/day-group-section.d.ts +17 -0
  35. package/dist/lib/components/ui/collections/day-grouped-list/use-day-groups.d.ts +24 -0
  36. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  37. package/dist/lib/components/ui/media/file-list/file-list-describe.d.ts +8 -0
  38. package/dist/lib/components/ui/media/file-list/file-list-field-row.d.ts +4 -1
  39. package/dist/lib/components/ui/media/file-list/file-list-field.d.ts +13 -0
  40. package/dist/lib/components/ui/media/file-list/index.d.ts +1 -1
  41. package/dist/lib/components/ui/media/file-list/partials/file-list-items.d.ts +5 -1
  42. package/dist/lib/components/ui/media/file-list/partials/file-list-move-buttons.d.ts +9 -0
  43. package/dist/lib/components/ui/media/file-list/partials/file-list-row-actions.d.ts +3 -1
  44. package/dist/lib/components/ui/media/file-list/types.d.ts +9 -0
  45. package/dist/lib/components/ui/media/file-list/use-file-list-field.d.ts +7 -1
  46. package/dist/lib/components/ui/media/file-list/use-file-list-move.d.ts +24 -0
  47. package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-item.d.ts +7 -0
  48. package/dist/lib/components/ui/widgets/editor/extensions/marks/compact-mark-buttons.d.ts +5 -1
  49. package/dist/lib/components/ui/widgets/editor/kit/editor-features.d.ts +2 -1
  50. package/dist/lib/components/ui/widgets/editor/kit/features/marks.d.ts +6 -1
  51. package/dist/lib/i18n/resources/en/en.d.ts +3 -0
  52. package/dist/lib/i18n/resources/en/material.json.d.ts +4 -1
  53. package/dist/lib/i18n/resources/fr/fr.d.ts +3 -0
  54. package/dist/lib/i18n/resources/fr/material.json.d.ts +4 -1
  55. package/dist/lib/i18n/resources/resources.d.ts +6 -0
  56. package/dist/lib/i18n/translator.d.ts +1 -1
  57. package/dist/lib.js +1 -1
  58. package/dist/main.js +54 -54
  59. package/dist/map.js +7 -7
  60. package/dist/pdf-reader.js +1 -1
  61. package/dist/{percent-field-DyJ2yOH4.js → percent-field-DuoZieW9.js} +1 -1
  62. package/dist/{picker-surface-CnlOKQ3D.js → picker-surface-BKzM6TWN.js} +4 -4
  63. package/dist/{popover-BevReSHi.js → popover-ukgGm5B6.js} +1 -1
  64. package/dist/{pos-types-BrZBX0Zg.js → pos-types-BNXbls3v.js} +1 -1
  65. package/dist/{pos-variant-G12HCSfQ.js → pos-variant-CZ3OZtPq.js} +4 -4
  66. package/dist/print.js +1 -1
  67. package/dist/{programmer-variant-WWLwTGRF.js → programmer-variant-DVu-pYhB.js} +2 -2
  68. package/dist/{public-C1a6wQ6o.js → public-DtXwn8bx.js} +9 -9
  69. package/dist/{rich-code-block-Dh9J-VZ8.js → rich-code-block-DUaSLxLT.js} +5 -5
  70. package/dist/{scientific-variant-BvutlF8a.js → scientific-variant-Ku9feVN1.js} +2 -2
  71. package/dist/{sortable-provider-BrA5tfJX.js → sortable-provider-DIb1HgZA.js} +2 -2
  72. package/dist/{spinner-JnLLiLIO.js → spinner-CHWFXCfd.js} +1 -1
  73. package/dist/{tabs-dXCZGShv.js → tabs-BideU0Rb.js} +1 -1
  74. package/dist/theme-picker.js +2 -2
  75. package/dist/{theme-toggle-BmcK6mXV.js → theme-toggle-DUQTEe1y.js} +1 -1
  76. package/dist/{toolbar-items-B-kMYsDT.js → toolbar-items-azkXY5w2.js} +4 -4
  77. package/dist/{translate-material-BmpcP1p1.js → translate-material-d8Q5K5a_.js} +1 -1
  78. package/dist/{translator-CfoXTrZd.js → translator-CxyFsfO0.js} +8 -2
  79. package/dist/{use-chat-composer-DFD_eF-r.js → use-chat-composer-FACltVyX.js} +32 -31
  80. package/dist/{use-heading-spy-BcNK1qvq.js → use-heading-spy-DHd5TScW.js} +4 -4
  81. package/dist/{use-material-translation-DoymV6IP.js → use-material-translation-DA5ECZfA.js} +1 -1
  82. package/dist/{use-return-focus-CLEnhfka.js → use-return-focus-CAAvJ6p5.js} +1 -1
  83. package/docs/components/data-table-filter-and-lists.md +32 -0
  84. package/docs/components/media-and-files.md +16 -0
  85. package/docs/components/rich-widgets.md +15 -0
  86. package/package.json +3 -3
@@ -0,0 +1,8 @@
1
+ import { NetworkUploadDisplayItem } from '../upload/network-upload-field/network-upload-item.js';
2
+ import { FileDescription } from './types.js';
3
+ /**
4
+ * The committed rows, named, sized and typed by `describe`; uploads are left
5
+ * alone. A described `href` that is not safe to link (`javascript:` …) is
6
+ * `null`, and the row then has no Download link.
7
+ */
8
+ export declare function describeItems(items: NetworkUploadDisplayItem[], describe?: (value: string) => FileDescription | null | undefined): NetworkUploadDisplayItem[];
@@ -1,4 +1,5 @@
1
1
  import { NetworkUploadDisplayItem } from '../upload/network-upload-field/network-upload-item.js';
2
+ import { FileListReorder } from './use-file-list-move.js';
2
3
  export type FileListFieldRowProps = {
3
4
  item: NetworkUploadDisplayItem;
4
5
  accept?: string;
@@ -6,5 +7,7 @@ export type FileListFieldRowProps = {
6
7
  onReplace: (item: NetworkUploadDisplayItem, file: File) => void;
7
8
  onRetry: (item: NetworkUploadDisplayItem) => void;
8
9
  onRemove: (item: NetworkUploadDisplayItem) => void;
10
+ /** Present when the field is reorderable. */
11
+ reorder?: FileListReorder;
9
12
  };
10
- export declare function FileListFieldRow({ item, accept, disabled, onReplace, onRetry, onRemove, }: FileListFieldRowProps): import("react").JSX.Element;
13
+ export declare function FileListFieldRow({ item, accept, disabled, onReplace, onRetry, onRemove, reorder, }: FileListFieldRowProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { NetworkUploadFieldProps } from '../upload/network-upload-field/network-upload-field.js';
3
+ import { FileDescription } from './types.js';
3
4
  type MultipleUploadProps = Extract<NetworkUploadFieldProps, {
4
5
  mode: 'multiple';
5
6
  }>;
@@ -7,6 +8,18 @@ export type FileListFieldProps = Omit<MultipleUploadProps, 'mode' | 'value'> & {
7
8
  value?: string[];
8
9
  required?: boolean;
9
10
  empty?: ReactNode;
11
+ /**
12
+ * Describes a kept value (an id, a key) so its row shows a name, a size
13
+ * and a type instead of the value: `describe={(id) => files[id]}`. Return
14
+ * `undefined` for a value you know nothing about. Called on every render,
15
+ * so keep it pure and cheap.
16
+ */
17
+ describe?: (value: string) => FileDescription | null | undefined;
18
+ /**
19
+ * Lets the user reorder the kept files with move up / move down buttons
20
+ * (reachable by keyboard); `onValueChange` receives the new order.
21
+ */
22
+ reorderable?: boolean;
10
23
  };
11
24
  export declare function FileListField(props: FileListFieldProps): import("react").JSX.Element;
12
25
  export {};
@@ -7,4 +7,4 @@ export * from './file-list-form-field.js';
7
7
  export type { FileListS3FieldProps } from './file-list-s3-field.js';
8
8
  export { FileListS3Field } from './file-list-s3-field.js';
9
9
  export * from './file-list-s3-form-field.js';
10
- export type { FileListItem } from './types.js';
10
+ export type { FileDescription, FileListItem } from './types.js';
@@ -1,14 +1,18 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { NetworkUploadDisplayItem } from '../../upload/network-upload-field/network-upload-item.js';
3
+ import { FileListReorder } from '../use-file-list-move.js';
3
4
  type Props = {
4
5
  items: NetworkUploadDisplayItem[];
5
6
  accept?: string;
6
7
  disabled?: boolean;
7
8
  empty?: ReactNode;
9
+ reorder?: FileListReorder;
10
+ /** Receives the list, so the focus can be put back after a move. */
11
+ listRef?: (node: HTMLUListElement | null) => void;
8
12
  onReplace: (item: NetworkUploadDisplayItem, file: File) => void;
9
13
  onRetry: (item: NetworkUploadDisplayItem) => void;
10
14
  onRemove: (item: NetworkUploadDisplayItem) => void;
11
15
  };
12
16
  /** The field's rows, or its empty message. */
13
- export declare function FileListItems({ items, empty, ...row }: Props): import("react").JSX.Element;
17
+ export declare function FileListItems({ items, empty, reorder, listRef, ...row }: Props): import("react").JSX.Element;
14
18
  export {};
@@ -0,0 +1,9 @@
1
+ import { NetworkUploadDisplayItem } from '../../upload/network-upload-field/network-upload-item.js';
2
+ import { FileListReorder } from '../use-file-list-move.js';
3
+ type Props = {
4
+ item: NetworkUploadDisplayItem;
5
+ reorder: FileListReorder;
6
+ };
7
+ /** A kept row's move up / move down buttons, disabled where it cannot move. */
8
+ export declare function FileListMoveButtons({ item, reorder }: Props): import("react").JSX.Element;
9
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { NetworkUploadDisplayItem } from '../../upload/network-upload-field/network-upload-item.js';
2
+ import { FileListReorder } from '../use-file-list-move.js';
2
3
  type Props = {
3
4
  item: NetworkUploadDisplayItem;
4
5
  accept?: string;
@@ -6,7 +7,8 @@ type Props = {
6
7
  onReplace: (item: NetworkUploadDisplayItem, file: File) => void;
7
8
  onRetry: (item: NetworkUploadDisplayItem) => void;
8
9
  onRemove: (item: NetworkUploadDisplayItem) => void;
10
+ reorder?: FileListReorder;
9
11
  };
10
12
  /** A row's trailing buttons: retry, download, replace (with its hidden input) and remove. */
11
- export declare function FileListRowActions({ item, accept, disabled, onReplace, onRetry, onRemove, }: Props): import("react").JSX.Element;
13
+ export declare function FileListRowActions({ item, accept, disabled, onReplace, onRetry, onRemove, reorder, }: Props): import("react").JSX.Element;
12
14
  export {};
@@ -15,3 +15,12 @@ export type FileListProps = {
15
15
  className?: string;
16
16
  'aria-label'?: string;
17
17
  };
18
+ /** What a file list field can show of a value it holds: only the value is stored. */
19
+ export type FileDescription = {
20
+ name?: string;
21
+ size?: number;
22
+ /** MIME type; an `image/*` type gets an image icon. */
23
+ type?: string;
24
+ /** Download link, when the value is not itself a URL. */
25
+ href?: string;
26
+ };
@@ -1,6 +1,6 @@
1
1
  import { FileListFieldProps } from './file-list-field.js';
2
2
  /** The ids, the accessible group and the upload state behind a file list field. */
3
- export declare function useFileListField({ required, value, className: _className, empty: _empty, ...props }: FileListFieldProps): {
3
+ export declare function useFileListField({ required, value, className: _className, empty: _empty, describe, reorderable, ...props }: FileListFieldProps): {
4
4
  inputId: string;
5
5
  inputRef: import('react').RefObject<HTMLInputElement | null>;
6
6
  helperId: string;
@@ -30,4 +30,10 @@ export declare function useFileListField({ required, value, className: _classNam
30
30
  handleItemRetry: (item: import('../upload/network-upload-field/network-upload-item.js').NetworkUploadDisplayItem) => void;
31
31
  handleItemRemove: (item: import('../upload/network-upload-field/network-upload-item.js').NetworkUploadDisplayItem) => void;
32
32
  };
33
+ displayItems: import('../upload/network-upload-field/network-upload-item.js').NetworkUploadDisplayItem[];
34
+ move: {
35
+ setRoot: (node: Element | null) => void;
36
+ message: string;
37
+ reorder: import('./use-file-list-move.js').FileListReorder | undefined;
38
+ };
33
39
  };
@@ -0,0 +1,24 @@
1
+ import { RowMoveDirection } from '@nxgt/material-core/repeatable-group';
2
+ import { NetworkUploadDisplayItem } from '../upload/network-upload-field/network-upload-item.js';
3
+ export type FileListReorder = {
4
+ disabled: boolean;
5
+ canMove: (item: NetworkUploadDisplayItem, direction: RowMoveDirection) => boolean;
6
+ onMove: (item: NetworkUploadDisplayItem, direction: RowMoveDirection) => void;
7
+ };
8
+ type Options = {
9
+ reorderable?: boolean;
10
+ disabled?: boolean;
11
+ kept: readonly string[] | undefined;
12
+ onValueChange?: (value: string[]) => void;
13
+ };
14
+ /**
15
+ * Reordering the kept files: which row can move where (the rules are
16
+ * `@nxgt/material-core`'s, shared with RepeatableGroup), the focus once the
17
+ * value changed, and what the polite live region says.
18
+ */
19
+ export declare function useFileListMove({ reorderable, disabled, kept, onValueChange, }: Options): {
20
+ setRoot: (node: Element | null) => void;
21
+ message: string;
22
+ reorder: FileListReorder | undefined;
23
+ };
24
+ export {};
@@ -4,6 +4,13 @@ export type NetworkUploadDisplayItem = {
4
4
  id: string;
5
5
  name: string;
6
6
  size?: number;
7
+ /** MIME type of a committed value, when the host described it. */
8
+ type?: string;
9
+ /**
10
+ * Download link of a committed value: the value itself when `undefined`,
11
+ * none when `null` (described with a link that is not safe).
12
+ */
13
+ href?: string | null;
7
14
  status: NetworkUploadItemStatus;
8
15
  progress?: number;
9
16
  file?: File;
@@ -1,5 +1,9 @@
1
1
  import { Editor } from '@tiptap/react';
2
- /** Bold, italic and strikethrough: the marks of a comment or a chat message. */
2
+ /**
3
+ * Bold, italic and strikethrough: the marks of a comment or a chat message.
4
+ * The strikethrough button is left out when the schema has no `strike` mark
5
+ * (`marks({ strike: false })`, or a starter kit configured with `strike: false`).
6
+ */
3
7
  export declare function CompactMarkButtons({ editor }: {
4
8
  editor: Editor;
5
9
  }): import("react").JSX.Element;
@@ -74,8 +74,9 @@ export declare const editorFeatures: {
74
74
  readonly markdownPaste: () => import('./types.js').EditorFeature & {
75
75
  key: string;
76
76
  };
77
- readonly marks: ({ compact }?: {
77
+ readonly marks: ({ compact, strike, }?: {
78
78
  compact?: boolean;
79
+ strike?: boolean;
79
80
  }) => import('./types.js').EditorFeature & {
80
81
  key: string;
81
82
  };
@@ -1,9 +1,14 @@
1
1
  /**
2
2
  * `compact` keeps the content's marks but shows only bold, italic and
3
3
  * strikethrough in the toolbar and bubble menu (comments, chat).
4
+ * `strike` (default `true`, compact and full editors alike) set to `false`
5
+ * leaves strikethrough out: no mark, no button, and no `~~` written to
6
+ * Markdown. Pasted or loaded Markdown with `~~x~~` does not throw: it reads as
7
+ * the plain text `x`, the markers dropped.
4
8
  */
5
- export declare const marks: ({ compact }?: {
9
+ export declare const marks: ({ compact, strike, }?: {
6
10
  compact?: boolean;
11
+ strike?: boolean;
7
12
  }) => import('../types.js').EditorFeature & {
8
13
  key: string;
9
14
  };
@@ -1336,6 +1336,9 @@ export declare const en: {
1336
1336
  remove: string;
1337
1337
  replace: string;
1338
1338
  retry: string;
1339
+ "move-up": string;
1340
+ "move-down": string;
1341
+ moved: string;
1339
1342
  };
1340
1343
  "inline-edit": {
1341
1344
  edit: string;
@@ -1325,7 +1325,10 @@ declare const _default: {
1325
1325
  "download": "Download",
1326
1326
  "remove": "Remove",
1327
1327
  "replace": "Replace",
1328
- "retry": "Retry"
1328
+ "retry": "Retry",
1329
+ "move-up": "Move {name} up",
1330
+ "move-down": "Move {name} down",
1331
+ "moved": "Moved {name} to position {to}"
1329
1332
  },
1330
1333
  "inline-edit": {
1331
1334
  "edit": "Edit",
@@ -1336,6 +1336,9 @@ export declare const fr: {
1336
1336
  remove: string;
1337
1337
  replace: string;
1338
1338
  retry: string;
1339
+ "move-up": string;
1340
+ "move-down": string;
1341
+ moved: string;
1339
1342
  };
1340
1343
  "inline-edit": {
1341
1344
  edit: string;
@@ -1325,7 +1325,10 @@ declare const _default: {
1325
1325
  "download": "Télécharger",
1326
1326
  "remove": "Retirer",
1327
1327
  "replace": "Remplacer",
1328
- "retry": "Réessayer"
1328
+ "retry": "Réessayer",
1329
+ "move-up": "Monter {name}",
1330
+ "move-down": "Descendre {name}",
1331
+ "moved": "{name} déplacé en position {to}"
1329
1332
  },
1330
1333
  "inline-edit": {
1331
1334
  "edit": "Modifier",
@@ -1334,6 +1334,9 @@ export declare const resources: {
1334
1334
  remove: string;
1335
1335
  replace: string;
1336
1336
  retry: string;
1337
+ "move-up": string;
1338
+ "move-down": string;
1339
+ moved: string;
1337
1340
  };
1338
1341
  "inline-edit": {
1339
1342
  edit: string;
@@ -4883,6 +4886,9 @@ export declare const resources: {
4883
4886
  remove: string;
4884
4887
  replace: string;
4885
4888
  retry: string;
4889
+ "move-up": string;
4890
+ "move-down": string;
4891
+ moved: string;
4886
4892
  };
4887
4893
  "inline-edit": {
4888
4894
  edit: string;