@epam/ai-dial-attachment-input 1.0.0-dev.464 → 1.0.0-dev.471

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":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentGroup/AttachmentGroup.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAczE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA4IpD,CAAC"}
1
+ {"version":3,"file":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentGroup/AttachmentGroup.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAczE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAqJpD,CAAC"}
package/index.js CHANGED
@@ -412,77 +412,78 @@ var Y = /* @__PURE__ */ function(e) {
412
412
  headerLabel: "_headerLabel_4zxg9_7",
413
413
  downloadAllButton: "_downloadAllButton_4zxg9_8",
414
414
  imageTile: "_imageTile_4zxg9_12"
415
- }, Te = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ee = ({ attachments: e, onAttachmentClick: n, onRetry: r, getSizeLabel: i, ariaLabel: o = "Attachments", clickLabel: u = "Download attachment", retryLabel: d = "Retry upload", showLessLabel: f = "Show less", downloadAllLabel: p = "Download all", theme: h, className: v }) => {
416
- let [y, b] = G(!1), x = se(() => be(e.length, y), [e.length, y]);
415
+ }, Te = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ee = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: o, ariaLabel: u = "Attachments", clickLabel: d = "Download attachment", retryLabel: f = "Retry upload", showLessLabel: p = "Show less", downloadAllLabel: h = "Download all", theme: v, className: y }) => {
416
+ let [b, x] = G(!1), S = se(() => be(e.length, b), [e.length, b]);
417
417
  if (e.length === 0) return null;
418
- let S = e.some((e) => e.type === t.Image), C = e.some((e) => e.type !== t.Image), w = S && C, T = e.length >= 5, E = w ? V : S ? H : _, D = Te(e.length, "attachment"), O = e.slice(0, x.visibleCount);
418
+ let C = e.some((e) => e.type === t.Image), w = e.some((e) => e.type !== t.Image), T = C && w, E = e.length >= 5, D = T ? V : C ? H : _, O = Te(e.length, "attachment"), k = e.slice(0, S.visibleCount);
419
419
  return /* @__PURE__ */ J("div", {
420
420
  role: "group",
421
- "aria-label": o,
422
- className: s("rounded-2xl border p-3", T ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, v),
421
+ "aria-label": u,
422
+ className: s("rounded-2xl border p-3", E ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, y),
423
423
  children: [/* @__PURE__ */ J("div", {
424
424
  className: "mb-3 flex min-h-6 items-center gap-2",
425
425
  children: [
426
- /* @__PURE__ */ q(E, {
426
+ /* @__PURE__ */ q(D, {
427
427
  size: c.SM,
428
428
  className: s("shrink-0", $.headerIcon),
429
429
  "aria-hidden": !0
430
430
  }),
431
431
  /* @__PURE__ */ q("span", {
432
432
  className: s("dial-tiny-semi-text", $.headerLabel),
433
- children: D
433
+ children: O
434
434
  }),
435
- e.length >= 2 && n && /* @__PURE__ */ q(l, {
435
+ e.length >= 2 && (r || n) && /* @__PURE__ */ q(l, {
436
436
  icon: /* @__PURE__ */ q(g, {
437
437
  size: c.SM,
438
438
  "aria-hidden": !0
439
439
  }),
440
440
  className: s("ms-auto h-6 w-6 rounded-lg", $.downloadAllButton),
441
- "aria-label": p,
441
+ "aria-label": h,
442
442
  onClick: () => {
443
- e.filter((e) => e.status === a.Idle).forEach((e) => n?.(e));
443
+ let t = e.filter((e) => e.status === a.Idle);
444
+ r ? r(t) : t.forEach((e) => n?.(e));
444
445
  }
445
446
  })
446
447
  ]
447
448
  }), /* @__PURE__ */ J("div", {
448
449
  role: "list",
449
- "aria-label": D,
450
- className: s("gap-3", T ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
450
+ "aria-label": O,
451
+ className: s("gap-3", E ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
451
452
  children: [
452
- O.map((e) => /* @__PURE__ */ q("div", {
453
+ k.map((e) => /* @__PURE__ */ q("div", {
453
454
  role: "listitem",
454
455
  children: e.type === t.Image ? /* @__PURE__ */ q(he, {
455
456
  attachment: e,
456
457
  onClick: n ? () => n(e) : void 0,
457
- onRetry: r,
458
- clickLabel: u,
459
- retryLabel: d,
458
+ onRetry: i,
459
+ clickLabel: d,
460
+ retryLabel: f,
460
461
  roundedClassName: "rounded-xl",
461
462
  showHoverDownloadIcon: !0,
462
463
  className: s("size-[84px]", $.imageTile)
463
464
  }) : /* @__PURE__ */ q(Se, {
464
465
  attachment: e,
465
- sizeLabel: i?.(e),
466
+ sizeLabel: o?.(e),
466
467
  onClick: n,
467
- onRetry: r,
468
- clickLabel: u,
469
- retryLabel: d,
470
- theme: h
468
+ onRetry: i,
469
+ clickLabel: d,
470
+ retryLabel: f,
471
+ theme: v
471
472
  })
472
473
  }, e.id)),
473
- x.layout === _e.Collapsed && /* @__PURE__ */ q("div", {
474
+ S.layout === _e.Collapsed && /* @__PURE__ */ q("div", {
474
475
  role: "listitem",
475
476
  children: /* @__PURE__ */ q(we, {
476
- count: x.hiddenCount,
477
- onClick: () => b(!0)
477
+ count: S.hiddenCount,
478
+ onClick: () => x(!0)
478
479
  })
479
480
  }),
480
- T && y && /* @__PURE__ */ q("div", {
481
+ E && b && /* @__PURE__ */ q("div", {
481
482
  role: "listitem",
482
483
  children: /* @__PURE__ */ q(we, {
483
484
  count: 0,
484
- onClick: () => b(!1),
485
- ariaLabel: f,
485
+ onClick: () => x(!1),
486
+ ariaLabel: p,
486
487
  children: /* @__PURE__ */ q(m, {
487
488
  size: c.MD,
488
489
  "aria-hidden": !0
@@ -5,6 +5,12 @@ export interface AttachmentGroupProps {
5
5
  attachments: DisplayAttachment[];
6
6
  /** Called when the user clicks/activates a previewable image tile or a file row (downloads it). */
7
7
  onAttachmentClick?: (attachment: DisplayAttachment) => void;
8
+ /**
9
+ * Called with every currently downloadable attachment when the user
10
+ * activates the "download all" header action. Falls back to invoking
11
+ * `onAttachmentClick` once per downloadable attachment when omitted.
12
+ */
13
+ onDownloadAll?: (attachments: DisplayAttachment[]) => void;
8
14
  /** Called when the user retries a failed upload. */
9
15
  onRetry?: (id: string) => void;
10
16
  /** Resolves the human-readable size label for an attachment, when derivable. Omitted from display when absent. */
@@ -1 +1 @@
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,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
+ {"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"}
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.464",
4
+ "version": "1.0.0-dev.471",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,8 +17,8 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@epam/ai-dial-chat-shared": "1.0.0-dev.464",
21
- "@epam/ai-dial-ui-kit": "0.12.0-dev.25",
20
+ "@epam/ai-dial-chat-shared": "1.0.0-dev.471",
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"
24
24
  },