@epam/ai-dial-attachment-input 1.1.0-dev.11 → 1.1.0-dev.17

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAMxE,8GAA8G;AAC9G,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAgFlD,CAAC"}
1
+ {"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAMxE,8GAA8G;AAC9G,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAkFlD,CAAC"}
@@ -4,13 +4,17 @@ import { AttachmentCardLabels, AttachmentCardStyles } from '../../../models/atta
4
4
  interface AudioAttachmentProps {
5
5
  attachment: DisplayAttachment;
6
6
  searchQuery?: string;
7
+ /** Called when the user clicks the card body — opens the attachment canvas. */
7
8
  onClick?: (id: string) => void;
8
- shouldAlwaysShowActions?: boolean;
9
+ /** Called when the user clicks the download button. */
10
+ onDownload?: (id: string) => void;
11
+ /** Called when the user clicks the remove button. */
12
+ onRemove?: (id: string) => void;
9
13
  labels?: AttachmentCardLabels;
10
14
  styles?: AttachmentCardStyles;
11
15
  cssVars?: CSSProperties;
12
16
  }
13
- /** Square tile for a single audio attachment inside the composer tray. */
17
+ /** Widescreen tile for a single audio attachment inside the composer tray. */
14
18
  export declare const AudioAttachment: FC<AudioAttachmentProps>;
15
19
  export {};
16
20
  //# sourceMappingURL=Audio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Audio.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Audio.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAIzC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AACD,0EAA0E;AAC1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAyDpD,CAAC"}
1
+ {"version":3,"file":"Audio.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Audio.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AACnE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAIzC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uDAAuD;IACvD,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,8EAA8E;AAC9E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAuFpD,CAAC"}
package/index.js CHANGED
@@ -165,33 +165,51 @@ var ue = 5, de = 4, fe = "flex size-[84px] items-center justify-center rounded-x
165
165
  }),
166
166
  className: X.hoverIcon,
167
167
  ...e
168
- }), De = ({ attachment: e, searchQuery: t = "", onClick: r, labels: i, styles: a, cssVars: s }) => {
169
- let { clickLabel: c = "Open attachment" } = i ?? {}, { typography: l, className: u } = a ?? {};
168
+ }), De = ({ attachment: e, searchQuery: t = "", onClick: r, onDownload: i, onRemove: a, labels: s, styles: c, cssVars: l }) => {
169
+ let { clickLabel: u = "Open attachment", downloadLabel: d = "Download attachment", removeLabel: f = "Remove attachment" } = s ?? {}, { typography: p, className: m } = c ?? {}, h = () => {
170
+ r?.(e.id);
171
+ };
170
172
  return /* @__PURE__ */ q("div", {
171
- style: s,
172
- className: o("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", u),
173
- children: [/* @__PURE__ */ q("div", {
174
- className: "flex items-center justify-between gap-2",
175
- children: [/* @__PURE__ */ K("span", {
173
+ style: l,
174
+ ...r == null ? {} : {
175
+ role: "button",
176
+ tabIndex: 0,
177
+ "aria-label": u,
178
+ onClick: h,
179
+ onKeyDown: (e) => {
180
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
181
+ }
182
+ },
183
+ className: o("group relative flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", r && "cursor-pointer", (i || a) && "pe-8", m),
184
+ children: [
185
+ /* @__PURE__ */ K("span", {
176
186
  title: e.name,
177
- className: o(l?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
187
+ className: o(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
178
188
  children: t ? /* @__PURE__ */ K(n, {
179
189
  text: e.name,
180
190
  query: t,
181
191
  maxLines: 1
182
192
  }) : e.name
183
- }), r && /* @__PURE__ */ K(we, {
184
- ariaLabel: c,
185
- onClick: r,
193
+ }),
194
+ e.playUrl && /* @__PURE__ */ K("audio", {
195
+ controls: !0,
196
+ src: e.playUrl,
197
+ "aria-label": e.name,
198
+ className: "w-full",
199
+ preload: "metadata",
200
+ onClick: (e) => e.stopPropagation()
201
+ }),
202
+ i && /* @__PURE__ */ K(we, {
203
+ ariaLabel: d,
204
+ onClick: i,
186
205
  id: e.id
187
- })]
188
- }), e.playUrl && /* @__PURE__ */ K("audio", {
189
- controls: !0,
190
- src: e.playUrl,
191
- "aria-label": e.name,
192
- className: "w-full",
193
- preload: "metadata"
194
- })]
206
+ }),
207
+ a && /* @__PURE__ */ K(Ee, {
208
+ ariaLabel: f,
209
+ onClick: a,
210
+ id: e.id
211
+ })
212
+ ]
195
213
  });
196
214
  }, Oe = {
197
215
  [e.Network]: "Upload failed · network error",
@@ -362,6 +380,8 @@ var ue = 5, de = 4, fe = "flex size-[84px] items-center justify-center rounded-x
362
380
  attachment: e,
363
381
  labels: l,
364
382
  onClick: s,
383
+ onDownload: c,
384
+ onRemove: r,
365
385
  searchQuery: n,
366
386
  styles: d,
367
387
  cssVars: h
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.1.0-dev.11",
4
+ "version": "1.1.0-dev.17",
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.1.0-dev.11",
20
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.17",
21
21
  "@epam/ai-dial-ui-kit": "0.12.0-dev.36",
22
22
  "@tabler/icons-react": "^3.44.0",
23
23
  "react": "^19.0.0"