@epam/ai-dial-attachment-input 1.0.0-dev.484 → 1.0.0-dev.486

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 (56) hide show
  1. package/components/AttachmentCard/AttachmentCard.d.ts +2 -1
  2. package/components/AttachmentCard/AttachmentCard.d.ts.map +1 -1
  3. package/components/AttachmentFileRow/AttachmentFileRow.d.ts +1 -1
  4. package/components/AttachmentFileRow/AttachmentFileRow.d.ts.map +1 -1
  5. package/components/AttachmentGroup/AttachmentGroup.d.ts +1 -1
  6. package/components/AttachmentGroup/AttachmentGroup.d.ts.map +1 -1
  7. package/components/AttachmentMoreTile/AttachmentMoreTile.d.ts +1 -1
  8. package/components/AttachmentMoreTile/AttachmentMoreTile.d.ts.map +1 -1
  9. package/components/AttachmentTray/AttachmentTray.d.ts +2 -1
  10. package/components/AttachmentTray/AttachmentTray.d.ts.map +1 -1
  11. package/components/FileDndOverlay/FileDndOverlay.d.ts +2 -1
  12. package/components/FileDndOverlay/FileDndOverlay.d.ts.map +1 -1
  13. package/constants/attachment-group.d.ts +5 -0
  14. package/constants/attachment-group.d.ts.map +1 -0
  15. package/constants/upload.d.ts +1 -0
  16. package/constants/upload.d.ts.map +1 -1
  17. package/hooks/useLazyImageLoad.d.ts +5 -0
  18. package/hooks/useLazyImageLoad.d.ts.map +1 -1
  19. package/index.css +1 -1
  20. package/index.d.ts +8 -14
  21. package/index.d.ts.map +1 -1
  22. package/index.js +266 -247
  23. package/models/{AttachmentCard.d.ts → attachment-card.d.ts} +47 -14
  24. package/models/attachment-card.d.ts.map +1 -0
  25. package/models/{AttachmentFileRow.d.ts → attachment-file-row.d.ts} +21 -7
  26. package/models/attachment-file-row.d.ts.map +1 -0
  27. package/models/{AttachmentGroup.d.ts → attachment-group.d.ts} +41 -11
  28. package/models/attachment-group.d.ts.map +1 -0
  29. package/models/{AttachmentMoreTile.d.ts → attachment-more-tile.d.ts} +3 -1
  30. package/models/attachment-more-tile.d.ts.map +1 -0
  31. package/models/{AttachmentTray.d.ts → attachment-tray.d.ts} +14 -9
  32. package/models/attachment-tray.d.ts.map +1 -0
  33. package/models/file-dnd-overlay.d.ts +41 -0
  34. package/models/file-dnd-overlay.d.ts.map +1 -0
  35. package/package.json +2 -2
  36. package/utils/attachment.d.ts +45 -0
  37. package/utils/attachment.d.ts.map +1 -0
  38. package/models/AttachmentCard.d.ts.map +0 -1
  39. package/models/AttachmentFileRow.d.ts.map +0 -1
  40. package/models/AttachmentGroup.d.ts.map +0 -1
  41. package/models/AttachmentMoreTile.d.ts.map +0 -1
  42. package/models/AttachmentTray.d.ts.map +0 -1
  43. package/models/FileDndOverlay.d.ts +0 -24
  44. package/models/FileDndOverlay.d.ts.map +0 -1
  45. package/utils/attachment-mime.d.ts +0 -20
  46. package/utils/attachment-mime.d.ts.map +0 -1
  47. package/utils/generateAttachmentId.d.ts +0 -6
  48. package/utils/generateAttachmentId.d.ts.map +0 -1
  49. package/utils/getAttachmentCardState.d.ts +0 -17
  50. package/utils/getAttachmentCardState.d.ts.map +0 -1
  51. package/utils/getAttachmentGroupLayout.d.ts +0 -23
  52. package/utils/getAttachmentGroupLayout.d.ts.map +0 -1
  53. package/utils/getAttachmentIcon.d.ts +0 -8
  54. package/utils/getAttachmentIcon.d.ts.map +0 -1
  55. package/utils/getNameWithoutExtension.d.ts +0 -5
  56. package/utils/getNameWithoutExtension.d.ts.map +0 -1
@@ -1,4 +1,26 @@
1
1
  import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
+ import { Icon } from '@tabler/icons-react';
3
+ /** Derived display state an AttachmentCard/AttachmentFileRow needs to render a given attachment. */
4
+ export interface AttachmentCardState {
5
+ /** Whether the attachment is currently uploading. */
6
+ isLoading: boolean;
7
+ /** Whether the attachment's upload failed. */
8
+ isError: boolean;
9
+ /** Whether the attachment should render as a previewable image tile. */
10
+ isImage: boolean;
11
+ /** Whether the attachment should render as an audio player tile. */
12
+ isAudio: boolean;
13
+ /** Whether action buttons (remove/retry) should always be shown, not just on hover/focus. */
14
+ areActionsVisible: boolean;
15
+ /** Icon component representing the attachment's type. */
16
+ BottomIcon: Icon;
17
+ /** Human-readable type/status label rendered next to `BottomIcon`. */
18
+ typeLabel: string;
19
+ /** CSS class(es) applied to the card for its current color state (error/selected/type). */
20
+ cardColorClass: string;
21
+ /** CSS class(es) applied to the remove/retry action buttons for the current state. */
22
+ removeBtnClass: string;
23
+ }
2
24
  /** CSS custom-property overrides for the `AttachmentCard` component. */
3
25
  export interface AttachmentCardColors {
4
26
  /** Card border color in the default state. */
@@ -19,11 +41,29 @@ export interface AttachmentCardTypography {
19
41
  /** Utility class applied to the placeholder icon shown while the image is loading. Defaults to `'text-secondary'`. */
20
42
  placeholderIconClassName?: string;
21
43
  }
44
+ /** Combined style overrides (colors, typography, and shape) for the `AttachmentCard` component. */
45
+ export interface AttachmentCardStyles {
46
+ /** Color overrides applied as CSS custom properties. */
47
+ colors?: AttachmentCardColors;
48
+ /** Typography overrides for text elements inside the card. */
49
+ typography?: AttachmentCardTypography;
50
+ /** Tailwind border-radius utility class applied to the card and its inner layers (e.g. `'rounded'`, `'rounded-lg'`). Defaults to `'rounded-xl'`. */
51
+ roundedClassName?: string;
52
+ }
53
+ /** Localised accessible labels for the `AttachmentCard` component. */
54
+ export interface AttachmentCardLabels {
55
+ /** Accessible label for the remove button. Defaults to `'Remove attachment'`. */
56
+ removeLabel?: string;
57
+ /** Accessible label for the retry button (error state only). Defaults to `'Retry upload'`. */
58
+ retryLabel?: string;
59
+ /** Accessible label applied to the card root when it is interactive via `onClick`. Defaults to `'Open attachment'`. */
60
+ clickLabel?: string;
61
+ }
22
62
  /** Props accepted by the `AttachmentCard` component. */
23
63
  export interface AttachmentCardProps {
24
64
  /** The attachment data to display. */
25
65
  attachment: DisplayAttachment;
26
- /** Current search query — when set, matches in the file name are highlighted. */
66
+ /** Current search query — when set, matches in the file name are highlighted. Defaults to `''`. */
27
67
  searchQuery?: string;
28
68
  /** Called when the user activates the remove button. */
29
69
  onRemove?: (id: string) => void;
@@ -35,27 +75,20 @@ export interface AttachmentCardProps {
35
75
  isSelected?: boolean;
36
76
  /** Forces action buttons to be always visible regardless of hover/focus state. */
37
77
  shouldAlwaysShowActions?: boolean;
38
- /** Accessible label for the remove button. */
39
- removeLabel?: string;
40
- /** Accessible label for the retry button (error state only). */
41
- retryLabel?: string;
42
78
  /** Called when the user clicks or keyboard-activates the card. Receives the attachment `id`. */
43
79
  onClick?: (id: string) => void;
44
- /** Accessible label applied to the card root when it is interactive via `onClick`. Defaults to `'Open attachment'`. */
45
- clickLabel?: string;
46
- /** Color overrides applied as CSS custom properties. */
47
- colors?: AttachmentCardColors;
48
- /** Typography overrides for text elements inside the card. */
49
- typography?: AttachmentCardTypography;
50
- /** Tailwind border-radius utility class applied to the card and its inner layers (e.g. `'rounded'`, `'rounded-lg'`). */
51
- roundedClassName?: string;
80
+ /** Localised accessible labels for the remove/retry actions and the interactive card root. */
81
+ labels?: AttachmentCardLabels;
82
+ /** Color, typography, and shape overrides for the card. */
83
+ styles?: AttachmentCardStyles;
52
84
  /**
53
85
  * Shows a small decorative download-icon overlay on hover/focus, on top of
54
86
  * the existing whole-card click-to-download interaction. Opt-in so the
55
87
  * composer (which uses remove/retry actions, not download) is unaffected.
88
+ * Defaults to `false`.
56
89
  */
57
90
  showHoverDownloadIcon?: boolean;
58
91
  /** Extra class name(s) merged onto the root element. */
59
92
  className?: string;
60
93
  }
61
- //# sourceMappingURL=AttachmentCard.d.ts.map
94
+ //# sourceMappingURL=attachment-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-card.d.ts","sourceRoot":"","sources":["../../src/models/attachment-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhD,oGAAoG;AACpG,MAAM,WAAW,mBAAmB;I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H;IACvH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,gGAAgG;IAChG,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,8FAA8F;IAC9F,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1,18 +1,32 @@
1
1
  import { CodeBlockTheme, DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
+ /** Localised labels for the `AttachmentFileRow` component. */
3
+ export interface AttachmentFileRowLabels {
4
+ /** Accessible label for the download action. Defaults to `'Download attachment'`. */
5
+ clickLabel?: string;
6
+ /** Accessible label for the retry action. Defaults to `'Retry upload'`. */
7
+ retryLabel?: string;
8
+ /** Human-readable size text (e.g. `'2.4 MB'`), appended after the type label in the meta line (`'.pdf · 2.4 MB'`) when derivable; omitted from the meta line if absent. */
9
+ sizeLabel?: string;
10
+ }
11
+ /** Style overrides for the `AttachmentFileRow` component. */
12
+ export interface AttachmentFileRowStyles {
13
+ /** Typography class applied to the file name text. Defaults to `'dial-caption-text'`. */
14
+ nameClassName?: string;
15
+ /** Typography class applied to the bottom meta label (file type / status). Defaults to `'dial-caption-text'`. */
16
+ metaClassName?: string;
17
+ }
2
18
  /** Props accepted by the `AttachmentFileRow` component. */
3
19
  export interface AttachmentFileRowProps {
4
20
  /** The non-previewable attachment this row represents. */
5
21
  attachment: DisplayAttachment;
6
- /** Byte size, when derivable; omitted from the meta line if absent. */
7
- sizeLabel?: string;
8
22
  /** Called when the user clicks the row or its download button. */
9
23
  onClick?: (attachment: DisplayAttachment) => void;
10
24
  /** Called when the user retries a failed upload. */
11
25
  onRetry?: (id: string) => void;
12
- /** Accessible label for the download action. Defaults to `'Download attachment'`. */
13
- clickLabel?: string;
14
- /** Accessible label for the retry action. Defaults to `'Retry upload'`. */
15
- retryLabel?: string;
26
+ /** Localised labels for the download/retry actions and size text. */
27
+ labels?: AttachmentFileRowLabels;
28
+ /** Style overrides for the file name and meta label text. */
29
+ styles?: AttachmentFileRowStyles;
16
30
  /**
17
31
  * Tile surface color theme, matching the markdown code block's own
18
32
  * light/dark surface (never plain white). Defaults to `'dark'`.
@@ -21,4 +35,4 @@ export interface AttachmentFileRowProps {
21
35
  /** Extra class name(s) merged onto the root element. */
22
36
  className?: string;
23
37
  }
24
- //# sourceMappingURL=AttachmentFileRow.d.ts.map
38
+ //# sourceMappingURL=attachment-file-row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-file-row.d.ts","sourceRoot":"","sources":["../../src/models/attachment-file-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,8DAA8D;AAC9D,MAAM,WAAW,uBAAuB;IACtC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2KAA2K;IAC3K,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6DAA6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iHAAiH;IACjH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,2DAA2D;AAC3D,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,UAAU,EAAE,iBAAiB,CAAC;IAC9B,kEAAkE;IAClE,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,qEAAqE;IACrE,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,6DAA6D;IAC7D,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1,4 +1,40 @@
1
1
  import { CodeBlockTheme, DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
+ /** How the unified attachment tile grid should render for a given total attachment count. */
3
+ export declare enum AttachmentTilesLayout {
4
+ /** No attachments. */
5
+ None = "none",
6
+ /** Below the collapse threshold, or expanded: every tile shown. */
7
+ AllVisible = "all-visible",
8
+ /** At/above the collapse threshold, not yet expanded: a few tiles + a "+N" tile. */
9
+ Collapsed = "collapsed"
10
+ }
11
+ /** Rendering plan for the unified attachment tile grid. */
12
+ export interface AttachmentTilesPlan {
13
+ /** Which rendering mode the grid should use. */
14
+ layout: AttachmentTilesLayout;
15
+ /** Number of tiles to actually render. */
16
+ visibleCount: number;
17
+ /** Number of attachments hidden behind the "+N" tile (0 unless `layout` is `Collapsed`). */
18
+ hiddenCount: number;
19
+ }
20
+ /** Localised accessible labels for the `AttachmentGroup` component. */
21
+ export interface AttachmentGroupLabels {
22
+ /** Accessible label for the group region. Defaults to `'Attachments'`. */
23
+ ariaLabel?: string;
24
+ /** Accessible label for each tile/row's click action. Defaults to `'Download attachment'`. */
25
+ clickLabel?: string;
26
+ /** Accessible label for each row's retry action. Defaults to `'Retry upload'`. */
27
+ retryLabel?: string;
28
+ /** Label for the "show less" header action, shown once the group has been expanded via the "+N" tile. Defaults to `'Show less'`. */
29
+ showLessLabel?: string;
30
+ /** Label for the "download all" header action, shown whenever the group has 2+ attachments. Defaults to `'Download all'`. */
31
+ downloadAllLabel?: string;
32
+ }
33
+ /** Style overrides for the `AttachmentGroup` component. */
34
+ export interface AttachmentGroupStyles {
35
+ /** Typography class applied to the header's attachment-count label. Defaults to `'dial-tiny-semi-text'`. */
36
+ headerLabelClassName?: string;
37
+ }
2
38
  /** Props accepted by the `AttachmentGroup` component. */
3
39
  export interface AttachmentGroupProps {
4
40
  /** The message's full attachment list (images and files together). */
@@ -15,16 +51,10 @@ export interface AttachmentGroupProps {
15
51
  onRetry?: (id: string) => void;
16
52
  /** Resolves the human-readable size label for an attachment, when derivable. Omitted from display when absent. */
17
53
  getSizeLabel?: (attachment: DisplayAttachment) => string | undefined;
18
- /** Accessible label for the group region. */
19
- ariaLabel?: string;
20
- /** Accessible label for each tile/row's click action. Defaults to `'Download attachment'`. */
21
- clickLabel?: string;
22
- /** Accessible label for each row's retry action. Defaults to `'Retry upload'`. */
23
- retryLabel?: string;
24
- /** Label for the "show less" header action, shown once the group has been expanded via the "+N" tile. Defaults to `'Show less'`. */
25
- showLessLabel?: string;
26
- /** Label for the "download all" header action, shown whenever the group has 2+ attachments. Defaults to `'Download all'`. */
27
- downloadAllLabel?: string;
54
+ /** Localised accessible labels for the group region and its actions. */
55
+ labels?: AttachmentGroupLabels;
56
+ /** Style overrides for the header label. */
57
+ styles?: AttachmentGroupStyles;
28
58
  /**
29
59
  * File tile surface color theme, matching the markdown code block's own
30
60
  * light/dark surface (never plain white). Forwarded to each
@@ -34,4 +64,4 @@ export interface AttachmentGroupProps {
34
64
  /** Extra class name(s) merged onto the root element. */
35
65
  className?: string;
36
66
  }
37
- //# sourceMappingURL=AttachmentGroup.d.ts.map
67
+ //# sourceMappingURL=attachment-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-group.d.ts","sourceRoot":"","sources":["../../src/models/attachment-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,6FAA6F;AAC7F,oBAAY,qBAAqB;IAC/B,sBAAsB;IACtB,IAAI,SAAS;IACb,mEAAmE;IACnE,UAAU,gBAAgB;IAC1B,oFAAoF;IACpF,SAAS,cAAc;CACxB;AAED,2DAA2D;AAC3D,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,MAAM,EAAE,qBAAqB,CAAC;IAC9B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,4FAA4F;IAC5F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,uEAAuE;AACvE,MAAM,WAAW,qBAAqB;IACpC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oIAAoI;IACpI,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6HAA6H;IAC7H,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,2DAA2D;AAC3D,MAAM,WAAW,qBAAqB;IACpC,4GAA4G;IAC5G,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,mGAAmG;IACnG,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAC3D,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,kHAAkH;IAClH,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;IACrE,wEAAwE;IACxE,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -12,7 +12,9 @@ export interface AttachmentMoreTileProps {
12
12
  ariaLabel?: string;
13
13
  /** Overrides the default `"+N"` content, e.g. a collapse icon for the "show less" placeholder tile. */
14
14
  children?: ReactNode;
15
+ /** Typography class applied to the tile's text/icon content. Defaults to `'dial-small-semi-text'`. */
16
+ fontClassName?: string;
15
17
  /** Extra class name(s) merged onto the root element. */
16
18
  className?: string;
17
19
  }
18
- //# sourceMappingURL=AttachmentMoreTile.d.ts.map
20
+ //# sourceMappingURL=attachment-more-tile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-more-tile.d.ts","sourceRoot":"","sources":["../../src/models/attachment-more-tile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,4DAA4D;AAC5D,MAAM,WAAW,uBAAuB;IACtC,yGAAyG;IACzG,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,sGAAsG;IACtG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1,4 +1,15 @@
1
1
  import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
+ /** Localised accessible labels for the `AttachmentTray` component. */
3
+ export interface AttachmentTrayLabels {
4
+ /** Accessible label for the tray region. Defaults to `'Attached files'`. */
5
+ ariaLabel?: string;
6
+ /** Accessible label for each card's remove button. */
7
+ removeLabel?: string;
8
+ /** Accessible label for each card's retry button (error state only). */
9
+ retryLabel?: string;
10
+ /** Accessible label forwarded to each card's root when it is interactive. When omitted, the card's own default (`'Open attachment'`) applies. */
11
+ clickLabel?: string;
12
+ }
2
13
  /** Props accepted by the `AttachmentTray` component. */
3
14
  export interface AttachmentTrayProps {
4
15
  /** The list of attachments to display. */
@@ -9,17 +20,11 @@ export interface AttachmentTrayProps {
9
20
  onRetry?: (id: string) => void;
10
21
  /** Called when the user clicks a pasted-text card to expand its content back into the input. */
11
22
  onExpand?: (id: string) => void;
12
- /** Accessible label for the tray region. */
13
- ariaLabel?: string;
14
- /** Accessible label for each card's remove button. */
15
- removeLabel?: string;
16
- /** Accessible label for each card's retry button (error state only). */
17
- retryLabel?: string;
18
23
  /** Called when the user clicks or keyboard-activates an attachment card. Receives the full `DisplayAttachment` object. */
19
24
  onAttachmentClick?: (attachment: DisplayAttachment) => void;
20
- /** Accessible label forwarded to each card's root when it is interactive. When omitted, the card's own default (`'Open attachment'`) applies. */
21
- clickLabel?: string;
25
+ /** Localised accessible labels for the tray region and each card's interactive elements. */
26
+ labels?: AttachmentTrayLabels;
22
27
  /** Extra class name(s) merged onto the root element. */
23
28
  className?: string;
24
29
  }
25
- //# sourceMappingURL=AttachmentTray.d.ts.map
30
+ //# sourceMappingURL=attachment-tray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-tray.d.ts","sourceRoot":"","sources":["../../src/models/attachment-tray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,sEAAsE;AACtE,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iJAAiJ;IACjJ,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,0HAA0H;IAC1H,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D,4FAA4F;IAC5F,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,41 @@
1
+ /** CSS custom-property overrides for the `FileDndOverlay` component. */
2
+ export interface FileDndOverlayColors {
3
+ /** Overlay background color. */
4
+ background?: string;
5
+ /** Icon color in the allowed state. */
6
+ icon?: string;
7
+ /** Icon color in the denied state (`isAttachmentsAllowed={false}`). */
8
+ deniedIcon?: string;
9
+ }
10
+ /** Typography overrides for the `FileDndOverlay` component. */
11
+ export interface FileDndOverlayTypography {
12
+ /** CSS class applied to the title. Defaults to `'heading-3 font-semibold'`. */
13
+ titleClassName?: string;
14
+ /** CSS class applied to the subtitle. Defaults to `'dial-small-text'`. */
15
+ subtitleClassName?: string;
16
+ }
17
+ /** Style overrides for the `FileDndOverlay` component. */
18
+ export interface FileDndOverlayStyles {
19
+ /** Color overrides applied as CSS custom properties. */
20
+ colors?: FileDndOverlayColors;
21
+ /** Typography overrides applied to the title and subtitle. */
22
+ typography?: FileDndOverlayTypography;
23
+ }
24
+ /** Props accepted by the `FileDndOverlay` component. */
25
+ export interface FileDndOverlayProps {
26
+ /** When `true`, the full-screen overlay is rendered. */
27
+ isVisible: boolean;
28
+ /**
29
+ * When `false`, the overlay renders a denied state: `IconFileX` in error color,
30
+ * `cursor-not-allowed`, and drops are suppressed (not forwarded to the document).
31
+ * Defaults to `true`.
32
+ */
33
+ isAttachmentsAllowed?: boolean;
34
+ /** Title text rendered below the icon. Defaults differ by state: `'Attach files'` when allowed, `'No attachments allowed'` when denied. */
35
+ title?: string;
36
+ /** Subtitle text rendered below the title. Defaults differ by state: `'Drop files here to attach them to message'` when allowed, `"Attachments can't be added to message"` when denied. */
37
+ subtitle?: string;
38
+ /** Style overrides for the icon, title, and subtitle. */
39
+ styles?: FileDndOverlayStyles;
40
+ }
41
+ //# sourceMappingURL=file-dnd-overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-dnd-overlay.d.ts","sourceRoot":"","sources":["../../src/models/file-dnd-overlay.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,+DAA+D;AAC/D,MAAM,WAAW,wBAAwB;IACvC,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,wBAAwB,CAAC;CACvC;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,2IAA2I;IAC3I,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2LAA2L;IAC3L,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-attachment-input",
3
3
  "description": "File attachment input components with upload validation, drag-and-drop, and progress tracking",
4
- "version": "1.0.0-dev.484",
4
+ "version": "1.0.0-dev.486",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,7 +17,7 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@epam/ai-dial-chat-shared": "1.0.0-dev.484",
20
+ "@epam/ai-dial-chat-shared": "1.0.0-dev.486",
21
21
  "@epam/ai-dial-ui-kit": "0.12.0-dev.28",
22
22
  "@tabler/icons-react": "^3.44.0",
23
23
  "react": "^19.0.0"
@@ -0,0 +1,45 @@
1
+ import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
+ import { Icon } from '@tabler/icons-react';
3
+ import { AttachmentCardState } from '../models/attachment-card';
4
+ import { AttachmentTilesPlan } from '../models/attachment-group';
5
+ /**
6
+ * Generates a unique identifier for an attachment, combining the current
7
+ * timestamp with a random alphanumeric suffix.
8
+ */
9
+ export declare const generateAttachmentId: () => string;
10
+ /**
11
+ * Returns the provided name without its trailing file extension.
12
+ */
13
+ export declare const getNameWithoutExtension: (name: string) => string;
14
+ /**
15
+ * Converts an array of MIME type strings (including wildcards) into a
16
+ * comma-separated human-readable label string.
17
+ *
18
+ * Examples:
19
+ * `['application/pdf', 'image/jpeg']` → `'PDF, JPEG'`
20
+ * `['image/*', 'text/csv']` → `'Image files, CSV'`
21
+ */
22
+ export declare const mimeTypesToExtensionLabels: (types: string[]) => string;
23
+ /**
24
+ * Returns `true` when `mimeType` matches at least one entry in `allowedTypes`.
25
+ *
26
+ * Matching rules:
27
+ * - Exact match: `'application/pdf'` allows `'application/pdf'`.
28
+ * - Wildcard prefix: `'image/*'` allows any `'image/...'` MIME type.
29
+ *
30
+ * Returns `false` when `allowedTypes` is empty (no attachment types allowed).
31
+ */
32
+ export declare const isMimeTypeAllowed: (mimeType: string, allowedTypes: string[]) => boolean;
33
+ /**
34
+ * Returns the appropriate Tabler icon component for a given MIME content type.
35
+ * Broad category checks (`startsWith`) run first; then a specific MIME switch
36
+ * covers as many known file types as possible. Falls back to `IconFile`.
37
+ */
38
+ export declare const getAttachmentIcon: (contentType: string) => Icon;
39
+ /** Derives a bare file extension (no leading dot) from a MIME type, e.g. `'application/pdf'` -> `'pdf'`. */
40
+ export declare const getExtFromContentType: (contentType: string) => string | undefined;
41
+ /** Derives the display state (icons, labels, color classes) an AttachmentCard/AttachmentFileRow needs to render a given attachment. */
42
+ export declare const getAttachmentCardState: (attachment: DisplayAttachment, isSelected: boolean, shouldAlwaysShowActions: boolean) => AttachmentCardState;
43
+ /** Decides how the unified tile grid should render for `totalCount` attachments, given whether the group is expanded. */
44
+ export declare const getAttachmentTilesPlan: (totalCount: number, isExpanded: boolean) => AttachmentTilesPlan;
45
+ //# sourceMappingURL=attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/utils/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAqChD,OAAO,KAAK,EAAE,mBAAmB,EAAE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.ts","sourceRoot":"","sources":["../../src/models/AttachmentFileRow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,2DAA2D;AAC3D,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,UAAU,EAAE,iBAAiB,CAAC;IAC9B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../src/models/AttachmentGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,mGAAmG;IACnG,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAC3D,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,kHAAkH;IAClH,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;IACrE,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oIAAoI;IACpI,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6HAA6H;IAC7H,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AttachmentMoreTile.d.ts","sourceRoot":"","sources":["../../src/models/AttachmentMoreTile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,4DAA4D;AAC5D,MAAM,WAAW,uBAAuB;IACtC,yGAAyG;IACzG,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AttachmentTray.d.ts","sourceRoot":"","sources":["../../src/models/AttachmentTray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0HAA0H;IAC1H,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D,iJAAiJ;IACjJ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -1,24 +0,0 @@
1
- /** Props accepted by the `FileDndOverlay` component. */
2
- export interface FileDndOverlayProps {
3
- /** When `true`, the full-screen overlay is rendered. */
4
- isVisible: boolean;
5
- /**
6
- * When `false`, the overlay renders a denied state: `IconFileX` in error color,
7
- * `cursor-not-allowed`, and drops are suppressed (not forwarded to the document).
8
- * Defaults to `true`.
9
- */
10
- isAttachmentsAllowed?: boolean;
11
- /** Title text rendered below the icon. Defaults differ by state: `'Attach files'` when allowed, `'No attachments allowed'` when denied. */
12
- title?: string;
13
- /** Subtitle text rendered below the title. Defaults differ by state: `'Drop files here to attach them to message'` when allowed, `"Attachments can't be added to message"` when denied. */
14
- subtitle?: string;
15
- /** Tailwind class(es) applied to the icon in the allowed state. Defaults to `'text-accent-primary'`. */
16
- iconClassName?: string;
17
- /** Tailwind class(es) applied to the icon in the denied state (`isAttachmentsAllowed={false}`). Defaults to `'text-error'`. */
18
- deniedIconClassName?: string;
19
- /** Tailwind class(es) applied to the title. Defaults to `'heading-3'`. */
20
- titleClassName?: string;
21
- /** Tailwind class(es) applied to the subtitle. Defaults to `'dial-small-text'`. */
22
- subtitleClassName?: string;
23
- }
24
- //# sourceMappingURL=FileDndOverlay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileDndOverlay.d.ts","sourceRoot":"","sources":["../../src/models/FileDndOverlay.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,2IAA2I;IAC3I,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2LAA2L;IAC3L,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+HAA+H;IAC/H,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
@@ -1,20 +0,0 @@
1
- /**
2
- * Converts an array of MIME type strings (including wildcards) into a
3
- * comma-separated human-readable label string.
4
- *
5
- * Examples:
6
- * `['application/pdf', 'image/jpeg']` → `'PDF, JPEG'`
7
- * `['image/*', 'text/csv']` → `'Image files, CSV'`
8
- */
9
- export declare const mimeTypesToExtensionLabels: (types: string[]) => string;
10
- /**
11
- * Returns `true` when `mimeType` matches at least one entry in `allowedTypes`.
12
- *
13
- * Matching rules:
14
- * - Exact match: `'application/pdf'` allows `'application/pdf'`.
15
- * - Wildcard prefix: `'image/*'` allows any `'image/...'` MIME type.
16
- *
17
- * Returns `false` when `allowedTypes` is empty (no attachment types allowed).
18
- */
19
- export declare const isMimeTypeAllowed: (mimeType: string, allowedTypes: string[]) => boolean;
20
- //# sourceMappingURL=attachment-mime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attachment-mime.d.ts","sourceRoot":"","sources":["../../src/utils/attachment-mime.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,MAAM,EAAE,KAAG,MAU5D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,EAChB,cAAc,MAAM,EAAE,KACrB,OAUF,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Generates a unique identifier for an attachment, combining the current
3
- * timestamp with a random alphanumeric suffix.
4
- */
5
- export declare const generateAttachmentId: () => string;
6
- //# sourceMappingURL=generateAttachmentId.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateAttachmentId.d.ts","sourceRoot":"","sources":["../../src/utils/generateAttachmentId.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,MACgB,CAAC"}
@@ -1,17 +0,0 @@
1
- import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
- import { Icon } from '@tabler/icons-react';
3
- export interface AttachmentCardState {
4
- isLoading: boolean;
5
- isError: boolean;
6
- isImage: boolean;
7
- isAudio: boolean;
8
- areActionsVisible: boolean;
9
- BottomIcon: Icon;
10
- typeLabel: string;
11
- cardColorClass: string;
12
- removeBtnClass: string;
13
- }
14
- /** Derives a bare file extension (no leading dot) from a MIME type, e.g. `'application/pdf'` -> `'pdf'`. */
15
- export declare const getExtFromContentType: (contentType: string) => string | undefined;
16
- export declare const getAttachmentCardState: (attachment: DisplayAttachment, isSelected: boolean, shouldAlwaysShowActions: boolean) => AttachmentCardState;
17
- //# sourceMappingURL=getAttachmentCardState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAttachmentCardState.d.ts","sourceRoot":"","sources":["../../src/utils/getAttachmentCardState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAKhD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,IAAI,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAUD,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,MAAM,GAAG,SAUX,CAAC;AAuBF,eAAO,MAAM,sBAAsB,GACjC,YAAY,iBAAiB,EAC7B,YAAY,OAAO,EACnB,yBAAyB,OAAO,KAC/B,mBAkCF,CAAC"}
@@ -1,23 +0,0 @@
1
- /** How the unified attachment tile grid should render for a given total attachment count. */
2
- export declare enum AttachmentTilesLayout {
3
- /** No attachments. */
4
- None = "none",
5
- /** Below the collapse threshold, or expanded: every tile shown. */
6
- AllVisible = "all-visible",
7
- /** At/above the collapse threshold, not yet expanded: a few tiles + a "+N" tile. */
8
- Collapsed = "collapsed"
9
- }
10
- export interface AttachmentTilesPlan {
11
- layout: AttachmentTilesLayout;
12
- /** Number of tiles to actually render. */
13
- visibleCount: number;
14
- /** Number of attachments hidden behind the "+N" tile (0 unless `layout` is `Collapsed`). */
15
- hiddenCount: number;
16
- }
17
- /** Total attachment count at/above which the grid collapses behind a "+N" tile by default. */
18
- export declare const ATTACHMENT_COLLAPSE_THRESHOLD = 5;
19
- /** Number of tiles shown before the "+N" tile while collapsed. */
20
- export declare const ATTACHMENT_COLLAPSED_VISIBLE_COUNT = 4;
21
- /** Decides how the unified tile grid should render for `totalCount` attachments, given whether the group is expanded. */
22
- export declare const getAttachmentTilesPlan: (totalCount: number, isExpanded: boolean) => AttachmentTilesPlan;
23
- //# sourceMappingURL=getAttachmentGroupLayout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAttachmentGroupLayout.d.ts","sourceRoot":"","sources":["../../src/utils/getAttachmentGroupLayout.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,oBAAY,qBAAqB;IAC/B,sBAAsB;IACtB,IAAI,SAAS;IACb,mEAAmE;IACnE,UAAU,gBAAgB;IAC1B,oFAAoF;IACpF,SAAS,cAAc;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,4FAA4F;IAC5F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,8FAA8F;AAC9F,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,kEAAkE;AAClE,eAAO,MAAM,kCAAkC,IAAI,CAAC;AAEpD,yHAAyH;AACzH,eAAO,MAAM,sBAAsB,GACjC,YAAY,MAAM,EAClB,YAAY,OAAO,KAClB,mBAoBF,CAAC"}
@@ -1,8 +0,0 @@
1
- import { Icon } from '@tabler/icons-react';
2
- /**
3
- * Returns the appropriate Tabler icon component for a given MIME content type.
4
- * Broad category checks (`startsWith`) run first; then a specific MIME switch
5
- * covers as many known file types as possible. Falls back to `IconFile`.
6
- */
7
- export declare const getAttachmentIcon: (contentType: string) => Icon;
8
- //# sourceMappingURL=getAttachmentIcon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAttachmentIcon.d.ts","sourceRoot":"","sources":["../../src/utils/getAttachmentIcon.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,KAAG,IA0FvD,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Returns the provided name without its trailing file extension.
3
- */
4
- export declare const getNameWithoutExtension: (name: string) => string;
5
- //# sourceMappingURL=getNameWithoutExtension.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getNameWithoutExtension.d.ts","sourceRoot":"","sources":["../../src/utils/getNameWithoutExtension.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,MAGtD,CAAC"}