@epam/ai-dial-conversation-stages 1.0.0-dev.502 → 1.0.0-dev.503

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 (2) hide show
  1. package/index.js +224 -179
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, CodeBlockTheme as n, Highlight as r, MIME_TYPE_EXT_MAP as i, MarkdownRenderer as a, RequestStatus as o, ResponseFormat as s, StageStatus as c, buildCssVars as l, copyToClipboard as u, mergeClasses as d, messageAttachmentToDisplayAttachment as f } from "@epam/ai-dial-chat-shared";
2
- import { DIAL_ICON_SIZE as p, DialEllipsisTooltip as m, DialGhostIconButton as h, DialInput as g, DialLinkButton as _, DialPopup as v, DialPrimaryButton as y, DialRadioGroup as b, DialSkeleton as x, DialSkeletonVariant as S, DialSlider as C, DialSpinner as w, DialTag as T, DialTooltip as E, ElementSize as D, PopupSize as O, RadioGroupOrientation as k } from "@epam/ai-dial-ui-kit";
3
- import { IconAlertCircle as A, IconCheck as j, IconChevronDown as M, IconChevronRight as N, IconChevronUp as P, IconCircleCheck as F, IconClipboard as I, IconCopy as L, IconDownload as ee, IconFile as R, IconFileTypeBmp as z, IconFileTypeCss as B, IconFileTypeCsv as V, IconFileTypeDoc as te, IconFileTypeDocx as ne, IconFileTypeHtml as re, IconFileTypeJpg as ie, IconFileTypeJs as H, IconFileTypeJsx as ae, IconFileTypePdf as oe, IconFileTypePhp as U, IconFileTypePng as se, IconFileTypePpt as ce, IconFileTypeRs as W, IconFileTypeSql as le, IconFileTypeSvg as ue, IconFileTypeTs as de, IconFileTypeTsx as fe, IconFileTypeTxt as pe, IconFileTypeVue as me, IconFileTypeXls as he, IconFileTypeXml as ge, IconFileTypeZip as _e, IconMusic as ve, IconPaperclip as ye, IconPhoto as be, IconReload as xe, IconTerminal2 as Se, IconVideo as Ce, IconX as we } from "@tabler/icons-react";
2
+ import { DIAL_ICON_SIZE as p, DialEllipsisTooltip as m, DialGhostIconButton as h, DialInput as g, DialLinkButton as _, DialPopup as v, DialPrimaryButton as y, DialRadioGroup as b, DialSkeleton as ee, DialSkeletonVariant as x, DialSlider as S, DialSpinner as C, DialTag as w, DialTooltip as T, ElementSize as E, PopupSize as D, RadioGroupOrientation as O } from "@epam/ai-dial-ui-kit";
3
+ import { IconAlertCircle as k, IconCheck as A, IconChevronDown as j, IconChevronRight as M, IconChevronUp as N, IconCircleCheck as P, IconClipboard as F, IconCopy as I, IconDownload as te, IconFile as L, IconFileTypeBmp as R, IconFileTypeCss as z, IconFileTypeCsv as B, IconFileTypeDoc as V, IconFileTypeDocx as ne, IconFileTypeHtml as re, IconFileTypeJpg as ie, IconFileTypeJs as H, IconFileTypeJsx as ae, IconFileTypePdf as U, IconFileTypePhp as W, IconFileTypePng as oe, IconFileTypePpt as se, IconFileTypeRs as ce, IconFileTypeSql as le, IconFileTypeSvg as ue, IconFileTypeTs as de, IconFileTypeTsx as fe, IconFileTypeTxt as pe, IconFileTypeVue as me, IconFileTypeXls as he, IconFileTypeXml as ge, IconFileTypeZip as _e, IconMusic as ve, IconPaperclip as ye, IconPhoto as be, IconReload as xe, IconTerminal2 as Se, IconVideo as Ce, IconX as we } from "@tabler/icons-react";
4
4
  import { memo as Te, useCallback as Ee, useEffect as De, useId as Oe, useMemo as ke, useRef as Ae, useState as G } from "react";
5
5
  import "react-dom";
6
6
  import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
@@ -40,24 +40,24 @@ var je = /* @__PURE__ */ function(e) {
40
40
  let t = e.lastIndexOf(".");
41
41
  return t > 0 ? e.slice(0, t) : e;
42
42
  }, Fe = (e) => {
43
- if (!e) return R;
43
+ if (!e) return L;
44
44
  if (e.startsWith("image/")) switch (e) {
45
45
  case "image/jpeg":
46
46
  case "image/jpg": return ie;
47
- case "image/png": return se;
47
+ case "image/png": return oe;
48
48
  case "image/svg+xml": return ue;
49
- case "image/bmp": return z;
49
+ case "image/bmp": return R;
50
50
  default: return be;
51
51
  }
52
52
  if (e.startsWith("video/")) return Ce;
53
53
  if (e.startsWith("audio/")) return ve;
54
54
  switch (e) {
55
- case "application/pdf": return oe;
55
+ case "application/pdf": return U;
56
56
  case "application/msword":
57
- case "application/vnd.ms-word": return te;
57
+ case "application/vnd.ms-word": return V;
58
58
  case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return ne;
59
- case "application/vnd.ms-powerpoint": return ce;
60
- case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return ce;
59
+ case "application/vnd.ms-powerpoint": return se;
60
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return se;
61
61
  case "application/vnd.ms-excel": return he;
62
62
  case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return he;
63
63
  case "application/zip":
@@ -66,7 +66,7 @@ var je = /* @__PURE__ */ function(e) {
66
66
  case "application/x-7z-compressed":
67
67
  case "application/gzip":
68
68
  case "application/x-tar": return _e;
69
- case "text/csv": return V;
69
+ case "text/csv": return B;
70
70
  case "text/plain": return pe;
71
71
  case "text/html":
72
72
  case "application/xhtml+xml": return re;
@@ -80,17 +80,17 @@ var je = /* @__PURE__ */ function(e) {
80
80
  case "application/typescript":
81
81
  case "text/typescript": return de;
82
82
  case "text/tsx": return fe;
83
- case "text/css": return B;
83
+ case "text/css": return z;
84
84
  case "text/x-php":
85
- case "application/x-php": return U;
85
+ case "application/x-php": return W;
86
86
  case "text/x-rustsrc":
87
- case "application/x-rust": return W;
87
+ case "application/x-rust": return ce;
88
88
  case "text/x-vue": return me;
89
- default: return R;
89
+ default: return L;
90
90
  }
91
91
  }, Ie = (e) => {
92
92
  let { type: n, contentType: r } = e;
93
- return n === t.Prompt ? Se : n === t.Pasted ? I : n === t.Image ? be : Fe(r ?? "");
93
+ return n === t.Prompt ? Se : n === t.Pasted ? F : n === t.Image ? be : Fe(r ?? "");
94
94
  }, Le = (e) => {
95
95
  let t = e.toLowerCase().split(";")[0].trim(), n = i[t];
96
96
  if (n) return n;
@@ -133,47 +133,59 @@ var je = /* @__PURE__ */ function(e) {
133
133
  visibleCount: 4,
134
134
  hiddenCount: e - 4
135
135
  }, Ve = ({ attachment: n, searchQuery: i = "", onRemove: a, onRetry: o, onExpand: s, onClick: c, isSelected: u, shouldAlwaysShowActions: f, labels: m, typeLabels: g, styles: _, showHoverDownloadIcon: v = !1, className: y }) => {
136
- let { removeLabel: b = "Remove attachment", retryLabel: C = "Retry upload", clickLabel: T = "Open attachment", expandLabel: E = "Expand pasted text", loadingLabel: O = "Loading attachment", uploadFailedStatusLabel: k = "Upload failed" } = m ?? {}, { colors: A, typography: j, roundedClassName: M = "rounded-xl" } = _ ?? {}, { id: N, name: P } = n, F = n.previewUrl ?? n.url, I = n.type === t.Pasted, L = I && s !== void 0, R = ke(() => I ? P : Pe(P), [I, P]), z = l({
137
- "--ci-card-border": A?.border,
138
- "--ci-card-bg": A?.background,
139
- "--ci-card-name": A?.nameText,
140
- "--ci-card-meta": A?.metaText
141
- }), { isLoading: B, isError: V, isImage: te, isAudio: ne, areActionsVisible: re, BottomIcon: ie, typeLabel: H, cardColorClass: ae, removeBtnClass: oe } = ke(() => ze(n, u ?? !1, f ?? !1, g), [
136
+ let { removeLabel: b = "Remove attachment", retryLabel: S = "Retry upload", clickLabel: w = "Open attachment", expandLabel: T = "Expand pasted text", loadingLabel: D = "Loading attachment", uploadFailedStatusLabel: O = "Upload failed" } = m ?? {}, { colors: k, typography: A, roundedClassName: j = "rounded-xl" } = _ ?? {}, { id: M, name: N } = n, P = n.previewUrl ?? n.url, F = n.type === t.Pasted, I = F && s !== void 0, L = ke(() => F ? N : Pe(N), [F, N]), R = l({
137
+ "--ci-card-border": k?.border,
138
+ "--ci-card-bg": k?.background,
139
+ "--ci-card-name": k?.nameText,
140
+ "--ci-card-meta": k?.metaText,
141
+ "--ci-card-border-error": k?.borderError,
142
+ "--ci-card-bg-selected": k?.backgroundSelected,
143
+ "--ci-card-border-selected": k?.borderSelected,
144
+ "--ci-card-bg-hover": k?.backgroundHover,
145
+ "--ci-loading-overlay-bg": k?.loadingOverlayBackground,
146
+ "--ci-card-action-color": k?.actionColor,
147
+ "--ci-card-remove-bg-hover": k?.actionBackgroundHover,
148
+ "--ci-card-focus-outline": k?.focusOutline,
149
+ "--ci-card-remove-bg": k?.removeBackground,
150
+ "--ci-card-remove-color": k?.removeColor,
151
+ "--ci-card-hover-icon-bg": k?.hoverIconBackground,
152
+ "--ci-card-hover-icon-color": k?.hoverIconColor
153
+ }), { isLoading: z, isError: B, isImage: V, isAudio: ne, areActionsVisible: re, BottomIcon: ie, typeLabel: H, cardColorClass: ae, removeBtnClass: U } = ke(() => ze(n, u ?? !1, f ?? !1, g), [
142
154
  n,
143
155
  u,
144
156
  f,
145
157
  g
146
- ]), U = c !== void 0 && !L && !B && !V, se = L || U, { imageRef: ce, imageLoadStatus: W } = Me({
147
- enabled: te,
148
- src: F
158
+ ]), W = c !== void 0 && !I && !z && !B, oe = I || W, { imageRef: se, imageLoadStatus: ce } = Me({
159
+ enabled: V,
160
+ src: P
149
161
  }), le = () => {
150
- L && s ? s(N) : U && c && c(N);
162
+ I && s ? s(M) : W && c && c(M);
151
163
  }, ue = (e) => {
152
164
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), le());
153
165
  };
154
166
  if (ne) return /* @__PURE__ */ J("div", {
155
- style: z,
156
- className: d("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", M, ae, y),
167
+ style: R,
168
+ className: d("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", j, ae, y),
157
169
  children: [/* @__PURE__ */ J("div", {
158
170
  className: "flex items-center justify-between gap-2",
159
171
  children: [/* @__PURE__ */ q("span", {
160
172
  title: n.name,
161
- className: d(j?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.name),
173
+ className: d(A?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.name),
162
174
  children: i ? /* @__PURE__ */ q(r, {
163
175
  text: n.name,
164
176
  query: i,
165
177
  maxLines: 1
166
178
  }) : n.name
167
179
  }), c && /* @__PURE__ */ q(h, {
168
- icon: /* @__PURE__ */ q(ee, {
180
+ icon: /* @__PURE__ */ q(te, {
169
181
  size: p.SM,
170
182
  "aria-hidden": !0
171
183
  }),
172
- size: D.Small,
173
- className: d("h-6 w-6 shrink-0 rounded", oe),
174
- "aria-label": T,
184
+ size: E.Small,
185
+ className: d("h-6 w-6 shrink-0 rounded", U),
186
+ "aria-label": w,
175
187
  onClick: (e) => {
176
- e.stopPropagation(), c(N);
188
+ e.stopPropagation(), c(M);
177
189
  }
178
190
  })]
179
191
  }), n.playUrl && /* @__PURE__ */ q("audio", {
@@ -184,29 +196,29 @@ var je = /* @__PURE__ */ function(e) {
184
196
  preload: "metadata"
185
197
  })]
186
198
  });
187
- let de = d("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", M, ae, !te && "flex-col gap-3 p-3", se && "cursor-pointer", y), fe = /* @__PURE__ */ J(K, { children: [
188
- te ? /* @__PURE__ */ J("div", {
199
+ let de = d("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", j, ae, !V && "flex-col gap-3 p-3", oe && "cursor-pointer", y), fe = /* @__PURE__ */ J(K, { children: [
200
+ V ? /* @__PURE__ */ J("div", {
189
201
  className: "relative h-full w-full overflow-hidden",
190
- children: [W !== je.Loaded && /* @__PURE__ */ q(x, {
191
- variant: S.Rectangular,
202
+ children: [ce !== je.Loaded && /* @__PURE__ */ q(ee, {
203
+ variant: x.Rectangular,
192
204
  width: "100%",
193
205
  height: "100%",
194
- active: W === je.Loading,
206
+ active: ce === je.Loading,
195
207
  overlay: /* @__PURE__ */ q(be, {
196
208
  size: p.LG,
197
- className: j?.placeholderIconClassName ?? "text-secondary",
209
+ className: A?.placeholderIconClassName ?? "text-secondary",
198
210
  "aria-hidden": !0
199
211
  }),
200
- className: d("absolute inset-0", M)
212
+ className: d("absolute inset-0", j)
201
213
  }), /* @__PURE__ */ q("img", {
202
- ref: ce,
203
- src: F,
204
- alt: P,
214
+ ref: se,
215
+ src: P,
216
+ alt: N,
205
217
  loading: "lazy",
206
218
  decoding: "async",
207
- className: d("h-full w-full object-cover transition-opacity duration-200", W === je.Loaded ? "opacity-100" : "opacity-0", M)
219
+ className: d("h-full w-full object-cover transition-opacity duration-200", ce === je.Loaded ? "opacity-100" : "opacity-0", j)
208
220
  })]
209
- }) : V ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J("div", {
221
+ }) : B ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J("div", {
210
222
  className: "flex flex-row items-center gap-1 overflow-hidden",
211
223
  children: [/* @__PURE__ */ q(ie, {
212
224
  size: p.SM,
@@ -214,30 +226,30 @@ var je = /* @__PURE__ */ function(e) {
214
226
  "aria-hidden": !0
215
227
  }), /* @__PURE__ */ q("span", {
216
228
  title: H,
217
- className: d(j?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.meta),
229
+ className: d(A?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.meta),
218
230
  children: H
219
231
  })]
220
232
  }), /* @__PURE__ */ q("div", {
221
233
  className: "min-w-0 flex-1",
222
234
  children: /* @__PURE__ */ q("div", {
223
- title: R,
224
- className: d(j?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", Y.name),
235
+ title: L,
236
+ className: d(A?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", Y.name),
225
237
  children: i ? /* @__PURE__ */ q(r, {
226
- text: R,
238
+ text: L,
227
239
  query: i,
228
240
  maxLines: 3
229
- }) : R
241
+ }) : L
230
242
  })
231
243
  })] }) : /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("div", {
232
244
  className: "min-w-0 flex-1",
233
245
  children: /* @__PURE__ */ q("div", {
234
- title: R,
235
- className: d(j?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", Y.name),
246
+ title: L,
247
+ className: d(A?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", Y.name),
236
248
  children: i ? /* @__PURE__ */ q(r, {
237
- text: R,
249
+ text: L,
238
250
  query: i,
239
251
  maxLines: 3
240
- }) : R
252
+ }) : L
241
253
  })
242
254
  }), /* @__PURE__ */ J("div", {
243
255
  className: "flex flex-row items-center gap-1 overflow-hidden",
@@ -247,15 +259,15 @@ var je = /* @__PURE__ */ function(e) {
247
259
  "aria-hidden": !0
248
260
  }), /* @__PURE__ */ q("span", {
249
261
  title: H,
250
- className: d(j?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.meta),
262
+ className: d(A?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.meta),
251
263
  children: H
252
264
  })]
253
265
  })] }),
254
- B && /* @__PURE__ */ q("span", {
255
- className: d("absolute inset-0 flex items-center justify-center", M, Y.loadingOverlay),
256
- children: /* @__PURE__ */ q(w, {
266
+ z && /* @__PURE__ */ q("span", {
267
+ className: d("absolute inset-0 flex items-center justify-center", j, Y.loadingOverlay),
268
+ children: /* @__PURE__ */ q(C, {
257
269
  size: 40,
258
- ariaLabel: O,
270
+ ariaLabel: D,
259
271
  className: "z-50"
260
272
  })
261
273
  }),
@@ -263,21 +275,21 @@ var je = /* @__PURE__ */ function(e) {
263
275
  role: "status",
264
276
  "aria-live": "polite",
265
277
  className: "sr-only",
266
- children: V ? k : ""
278
+ children: B ? O : ""
267
279
  }),
268
- !B && /* @__PURE__ */ J("div", {
280
+ !z && /* @__PURE__ */ J("div", {
269
281
  className: d("absolute end-1 top-1 flex gap-1 transition-opacity", re ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
270
282
  children: [
271
- V && o && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ q(h, {
283
+ B && o && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ q(h, {
272
284
  icon: /* @__PURE__ */ q(xe, {
273
285
  size: p.SM,
274
286
  "aria-hidden": !0
275
287
  }),
276
- size: D.Small,
277
- className: d("h-6 w-6 rounded", oe),
278
- "aria-label": C,
288
+ size: E.Small,
289
+ className: d("h-6 w-6 rounded", U),
290
+ "aria-label": S,
279
291
  onClick: (e) => {
280
- e.stopPropagation(), o(N);
292
+ e.stopPropagation(), o(M);
281
293
  }
282
294
  }),
283
295
  a && /* @__PURE__ */ q(h, {
@@ -285,14 +297,14 @@ var je = /* @__PURE__ */ function(e) {
285
297
  size: p.SM,
286
298
  "aria-hidden": !0
287
299
  }),
288
- size: D.Small,
289
- className: d("h-6 w-6 rounded", oe),
300
+ size: E.Small,
301
+ className: d("h-6 w-6 rounded", U),
290
302
  "aria-label": b,
291
303
  onClick: (e) => {
292
- e.stopPropagation(), a?.(N);
304
+ e.stopPropagation(), a?.(M);
293
305
  }
294
306
  }),
295
- v && !a && !V && /* @__PURE__ */ q(ee, {
307
+ v && !a && !B && /* @__PURE__ */ q(te, {
296
308
  size: p.SM,
297
309
  "aria-hidden": !0,
298
310
  className: d("h-6 w-6 rounded-lg p-1", Y.hoverDownloadIcon)
@@ -300,148 +312,181 @@ var je = /* @__PURE__ */ function(e) {
300
312
  ]
301
313
  })
302
314
  ] });
303
- return se ? /* @__PURE__ */ q("div", {
304
- style: z,
315
+ return oe ? /* @__PURE__ */ q("div", {
316
+ style: R,
305
317
  className: de,
306
318
  onClick: le,
307
319
  onKeyDown: ue,
308
320
  tabIndex: 0,
309
321
  role: "button",
310
- "aria-label": U ? T : L ? E : void 0,
322
+ "aria-label": W ? w : I ? T : void 0,
311
323
  children: fe
312
324
  }) : /* @__PURE__ */ q("div", {
313
- style: z,
325
+ style: R,
314
326
  className: de,
315
327
  children: fe
316
328
  });
317
329
  }, X = {
318
- tile: "_tile_488nu_1",
319
- tileLight: "_tileLight_488nu_12",
320
- tileError: "_tileError_488nu_16",
321
- nameText: "_nameText_488nu_23",
322
- typeText: "_typeText_488nu_24",
323
- retryIcon: "_retryIcon_488nu_36",
324
- hoverIcon: "_hoverIcon_488nu_40",
325
- track: "_track_488nu_45",
326
- indeterminateFill: "_indeterminateFill_488nu_49",
327
- "attachment-tile-indeterminate": "_attachment-tile-indeterminate_488nu_1"
330
+ tile: "_tile_1l1lz_1",
331
+ tileLight: "_tileLight_1l1lz_12",
332
+ tileError: "_tileError_1l1lz_16",
333
+ nameText: "_nameText_1l1lz_23",
334
+ typeText: "_typeText_1l1lz_24",
335
+ retryIcon: "_retryIcon_1l1lz_36",
336
+ hoverIcon: "_hoverIcon_1l1lz_40",
337
+ track: "_track_1l1lz_45",
338
+ indeterminateFill: "_indeterminateFill_1l1lz_49",
339
+ "attachment-tile-indeterminate": "_attachment-tile-indeterminate_1l1lz_1"
328
340
  }, He = {
329
341
  [e.Network]: "Upload failed · network error",
330
342
  [e.UnsupportedType]: "Upload failed · unsupported file type"
331
- }, Ue = ({ attachment: t, onClick: r, onRetry: i, labels: a, typeLabels: s, styles: c, theme: l = n.Dark, className: u }) => {
332
- let { clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", sizeLabel: g, uploadingLabel: _ = "Uploading", errorReasonLabels: v, genericErrorLabel: y = "Upload failed" } = a ?? {}, { nameClassName: b = "dial-caption-text", metaClassName: x = "dial-caption-text" } = c ?? {}, { id: S, name: C, status: w, errorReason: T } = t, E = w === o.Loading, O = w === o.Error, k = Oe(), A = O && (T && (v?.[T] ?? He[T]) || y), { BottomIcon: j, typeLabel: M } = ze(t, !1, !1, s), N = !O && !E && r !== void 0, P = O && !!i && T !== e.UnsupportedType, F = N || P ? "pe-5" : void 0, I = () => {
333
- N && r?.(t);
334
- }, L = (e) => {
335
- (e.key === "Enter" || e.key === " ") && N && (e.preventDefault(), I());
336
- }, R = d("group relative flex size-[84px] flex-col justify-between gap-1 overflow-hidden rounded-xl border p-1.5", X.tile, !O && l === n.Light && X.tileLight, O && X.tileError), z = /* @__PURE__ */ q("div", {
337
- title: C,
338
- className: d(b, "line-clamp-2 min-w-0 break-words", X.nameText, !O && F),
339
- children: C
340
- }), B = /* @__PURE__ */ J("div", {
341
- className: d("flex items-center gap-1 overflow-hidden", O && F),
342
- children: [/* @__PURE__ */ q(j, {
343
+ }, Ue = ({ attachment: t, onClick: r, onRetry: i, labels: a, typeLabels: s, styles: c, theme: u = n.Dark, className: f }) => {
344
+ let { clickLabel: m = "Download attachment", retryLabel: g = "Retry upload", sizeLabel: _, uploadingLabel: v = "Uploading", errorReasonLabels: y, genericErrorLabel: b = "Upload failed" } = a ?? {}, { nameClassName: ee = "dial-caption-text", metaClassName: x = "dial-caption-text", colors: S } = c ?? {}, C = l({
345
+ "--ci-tile-bg": S?.background,
346
+ "--ci-tile-border": S?.border,
347
+ "--ci-tile-border-hover": S?.borderHover,
348
+ "--ci-tile-focus-outline": S?.focusOutline,
349
+ "--ci-tile-bg-error": S?.backgroundError,
350
+ "--ci-tile-border-error": S?.borderError,
351
+ "--ci-tile-error-text": S?.errorText,
352
+ "--ci-tile-name-text": S?.nameText,
353
+ "--ci-tile-type-text": S?.typeText,
354
+ "--ci-tile-hover-icon-bg": S?.hoverIconBackground,
355
+ "--ci-tile-hover-icon-color": S?.hoverIconColor,
356
+ "--ci-tile-track-bg": S?.trackBackground,
357
+ "--ci-tile-fill-bg": S?.fillBackground
358
+ }), { id: w, name: T, status: D, errorReason: O } = t, k = D === o.Loading, A = D === o.Error, j = Oe(), M = A && (O && (y?.[O] ?? He[O]) || b), { BottomIcon: N, typeLabel: P } = ze(t, !1, !1, s), F = !A && !k && r !== void 0, I = A && !!i && O !== e.UnsupportedType, L = F || I ? "pe-5" : void 0, R = () => {
359
+ F && r?.(t);
360
+ }, z = (e) => {
361
+ (e.key === "Enter" || e.key === " ") && F && (e.preventDefault(), R());
362
+ }, B = d("group relative flex size-[84px] flex-col justify-between gap-1 overflow-hidden rounded-xl border p-1.5", X.tile, !A && u === n.Light && X.tileLight, A && X.tileError), V = /* @__PURE__ */ q("div", {
363
+ title: T,
364
+ className: d(ee, "line-clamp-2 min-w-0 break-words", X.nameText, !A && L),
365
+ children: T
366
+ }), ne = /* @__PURE__ */ J("div", {
367
+ className: d("flex items-center gap-1 overflow-hidden", A && L),
368
+ children: [/* @__PURE__ */ q(N, {
343
369
  size: 16,
344
370
  className: X.typeText,
345
371
  "aria-hidden": !0
346
372
  }), /* @__PURE__ */ q("span", {
347
373
  className: d(x, "truncate", X.typeText),
348
- children: g ? `${M} · ${g}` : M
374
+ children: _ ? `${P} · ${_}` : P
349
375
  })]
350
- }), V = /* @__PURE__ */ J(K, { children: [
351
- O ? /* @__PURE__ */ J(K, { children: [B, z] }) : /* @__PURE__ */ J(K, { children: [z, B] }),
352
- E && /* @__PURE__ */ q("div", {
376
+ }), re = /* @__PURE__ */ J(K, { children: [
377
+ A ? /* @__PURE__ */ J(K, { children: [ne, V] }) : /* @__PURE__ */ J(K, { children: [V, ne] }),
378
+ k && /* @__PURE__ */ q("div", {
353
379
  role: "progressbar",
354
- "aria-label": _,
380
+ "aria-label": v,
355
381
  className: d("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", X.track),
356
382
  children: /* @__PURE__ */ q("div", { className: d("h-full w-1/3 rounded-full", X.indeterminateFill) })
357
383
  }),
358
- N && /* @__PURE__ */ q(ee, {
384
+ F && /* @__PURE__ */ q(te, {
359
385
  size: p.SM,
360
386
  "aria-hidden": !0,
361
387
  className: d("absolute end-1 top-1 h-6 w-6 rounded-lg p-1 opacity-0 transition-opacity group-hover:opacity-100 mobile:opacity-100", X.hoverIcon)
362
388
  }),
363
- P && /* @__PURE__ */ q(h, {
389
+ I && /* @__PURE__ */ q(h, {
364
390
  icon: /* @__PURE__ */ q(xe, {
365
391
  size: p.SM,
366
392
  "aria-hidden": !0
367
393
  }),
368
- size: D.Small,
394
+ size: E.Small,
369
395
  className: d("absolute end-1 top-1 h-6 w-6 rounded-lg", X.retryIcon),
370
- "aria-label": m,
371
- "aria-describedby": A ? k : void 0,
396
+ "aria-label": g,
397
+ "aria-describedby": M ? j : void 0,
372
398
  onClick: (e) => {
373
- e.stopPropagation(), i(S);
399
+ e.stopPropagation(), i(w);
374
400
  }
375
401
  }),
376
- O && /* @__PURE__ */ q("span", {
377
- id: k,
402
+ A && /* @__PURE__ */ q("span", {
403
+ id: j,
378
404
  role: "status",
379
405
  "aria-live": "polite",
380
406
  className: "sr-only",
381
- children: A
407
+ children: M
382
408
  })
383
409
  ] });
384
410
  return /* @__PURE__ */ q("div", {
385
- className: d("inline-flex", u),
386
- children: N ? /* @__PURE__ */ q("div", {
411
+ className: d("inline-flex", f),
412
+ children: F ? /* @__PURE__ */ q("div", {
387
413
  role: "button",
388
414
  tabIndex: 0,
389
- "aria-label": f,
390
- onClick: I,
391
- onKeyDown: L,
392
- className: d(R, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
393
- children: V
415
+ "aria-label": m,
416
+ onClick: R,
417
+ onKeyDown: z,
418
+ style: C,
419
+ className: d(B, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
420
+ children: re
394
421
  }) : /* @__PURE__ */ q("div", {
395
- className: R,
396
- title: A || void 0,
397
- role: O ? "group" : void 0,
398
- "aria-describedby": O ? k : void 0,
399
- tabIndex: O ? 0 : void 0,
400
- children: V
422
+ className: B,
423
+ title: M || void 0,
424
+ role: A ? "group" : void 0,
425
+ "aria-describedby": A ? j : void 0,
426
+ tabIndex: A ? 0 : void 0,
427
+ style: C,
428
+ children: re
401
429
  })
402
430
  });
403
- }, We = { tile: "_tile_1s4d7_1" }, Ge = ({ count: e, onClick: t, ariaLabel: n, children: r, fontClassName: i = "dial-small-semi-text", className: a }) => /* @__PURE__ */ q("button", {
404
- type: "button",
405
- onClick: t,
406
- "aria-label": n ?? `Show ${e} more attachments`,
407
- className: d("flex size-[84px] items-center justify-center rounded-xl border", i, We.tile, a),
408
- children: r ?? /* @__PURE__ */ q("bdi", {
409
- dir: "ltr",
410
- children: `+${e}`
411
- })
412
- }), Z = {
431
+ }, We = { tile: "_tile_1s4d7_1" }, Ge = ({ count: e, onClick: t, ariaLabel: n, children: r, fontClassName: i = "dial-small-semi-text", className: a, colors: o }) => {
432
+ let s = l({
433
+ "--ci-more-tile-bg": o?.background,
434
+ "--ci-more-tile-border": o?.border,
435
+ "--ci-more-tile-color": o?.color,
436
+ "--ci-more-tile-bg-hover": o?.backgroundHover,
437
+ "--ci-more-tile-color-hover": o?.colorHover,
438
+ "--ci-more-tile-border-hover": o?.borderHover,
439
+ "--ci-more-tile-focus-outline": o?.focusOutline
440
+ });
441
+ return /* @__PURE__ */ q("button", {
442
+ type: "button",
443
+ onClick: t,
444
+ "aria-label": n ?? `Show ${e} more attachments`,
445
+ style: s,
446
+ className: d("flex size-[84px] items-center justify-center rounded-xl border", i, We.tile, a),
447
+ children: r ?? /* @__PURE__ */ q("bdi", {
448
+ dir: "ltr",
449
+ children: `+${e}`
450
+ })
451
+ });
452
+ }, Z = {
413
453
  container: "_container_7fktb_1",
414
454
  headerIcon: "_headerIcon_7fktb_6",
415
455
  headerLabel: "_headerLabel_7fktb_7",
416
456
  downloadAllButton: "_downloadAllButton_7fktb_8",
417
457
  imageTile: "_imageTile_7fktb_12"
418
- }, Ke = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, qe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: a, labels: s, typeLabels: c, styles: l, theme: u, className: f }) => {
419
- let { ariaLabel: m = "Attachments", clickLabel: g = "Download attachment", retryLabel: _ = "Retry upload", showLessLabel: v = "Show less", downloadAllLabel: y = "Download all", getHeaderLabel: b = (e) => Ke(e, "attachment") } = s ?? {}, { headerLabelClassName: x = "dial-tiny-semi-text" } = l ?? {}, [S, C] = G(!1), w = ke(() => Be(e.length, S), [e.length, S]);
458
+ }, Ke = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, qe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: a, labels: s, typeLabels: c, styles: u, theme: f, className: m }) => {
459
+ let { ariaLabel: g = "Attachments", clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", showLessLabel: y = "Show less", downloadAllLabel: b = "Download all", getHeaderLabel: ee = (e) => Ke(e, "attachment") } = s ?? {}, { headerLabelClassName: x = "dial-tiny-semi-text", colors: S } = u ?? {}, C = l({
460
+ "--ci-group-bg": S?.background,
461
+ "--ci-group-border": S?.border,
462
+ "--ci-group-text": S?.text
463
+ }), [w, T] = G(!1), E = ke(() => Be(e.length, w), [e.length, w]);
420
464
  if (e.length === 0) return null;
421
- let T = e.some((e) => e.type === t.Image), E = e.some((e) => e.type !== t.Image), D = T && E, O = e.length >= 5, k = D ? ye : T ? be : R, A = b(e.length), j = e.slice(0, w.visibleCount);
465
+ let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ? ye : D ? be : L, M = ee(e.length), P = e.slice(0, E.visibleCount);
422
466
  return /* @__PURE__ */ J("div", {
423
467
  role: "group",
424
- "aria-label": m,
425
- className: d("rounded-2xl border p-3", O ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Z.container, f),
468
+ "aria-label": g,
469
+ style: C,
470
+ className: d("rounded-2xl border p-3", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Z.container, m),
426
471
  children: [/* @__PURE__ */ J("div", {
427
472
  className: "mb-3 flex min-h-6 items-center gap-2",
428
473
  children: [
429
- /* @__PURE__ */ q(k, {
474
+ /* @__PURE__ */ q(j, {
430
475
  size: p.SM,
431
476
  className: d("shrink-0", Z.headerIcon),
432
477
  "aria-hidden": !0
433
478
  }),
434
479
  /* @__PURE__ */ q("span", {
435
480
  className: d(x, Z.headerLabel),
436
- children: A
481
+ children: M
437
482
  }),
438
483
  e.length >= 2 && (r || n) && /* @__PURE__ */ q(h, {
439
- icon: /* @__PURE__ */ q(ee, {
484
+ icon: /* @__PURE__ */ q(te, {
440
485
  size: p.SM,
441
486
  "aria-hidden": !0
442
487
  }),
443
488
  className: d("ms-auto h-6 w-6 rounded-lg", Z.downloadAllButton),
444
- "aria-label": y,
489
+ "aria-label": b,
445
490
  onClick: () => {
446
491
  let t = e.filter((e) => e.status === o.Idle);
447
492
  r ? r(t) : t.forEach((e) => n?.(e));
@@ -450,18 +495,18 @@ var je = /* @__PURE__ */ function(e) {
450
495
  ]
451
496
  }), /* @__PURE__ */ J("div", {
452
497
  role: "list",
453
- "aria-label": A,
454
- className: d("gap-3", O ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
498
+ "aria-label": M,
499
+ className: d("gap-3", A ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
455
500
  children: [
456
- j.map((e) => /* @__PURE__ */ q("div", {
501
+ P.map((e) => /* @__PURE__ */ q("div", {
457
502
  role: "listitem",
458
503
  children: e.type === t.Image ? /* @__PURE__ */ q(Ve, {
459
504
  attachment: e,
460
505
  onClick: n ? () => n(e) : void 0,
461
506
  onRetry: i,
462
507
  labels: {
463
- clickLabel: g,
464
- retryLabel: _
508
+ clickLabel: _,
509
+ retryLabel: v
465
510
  },
466
511
  typeLabels: c,
467
512
  styles: { roundedClassName: "rounded-xl" },
@@ -472,28 +517,28 @@ var je = /* @__PURE__ */ function(e) {
472
517
  onClick: n,
473
518
  onRetry: i,
474
519
  labels: {
475
- clickLabel: g,
476
- retryLabel: _,
520
+ clickLabel: _,
521
+ retryLabel: v,
477
522
  sizeLabel: a?.(e)
478
523
  },
479
524
  typeLabels: c,
480
- theme: u
525
+ theme: f
481
526
  })
482
527
  }, e.id)),
483
- w.layout === Ne.Collapsed && /* @__PURE__ */ q("div", {
528
+ E.layout === Ne.Collapsed && /* @__PURE__ */ q("div", {
484
529
  role: "listitem",
485
530
  children: /* @__PURE__ */ q(Ge, {
486
- count: w.hiddenCount,
487
- onClick: () => C(!0)
531
+ count: E.hiddenCount,
532
+ onClick: () => T(!0)
488
533
  })
489
534
  }),
490
- O && S && /* @__PURE__ */ q("div", {
535
+ A && w && /* @__PURE__ */ q("div", {
491
536
  role: "listitem",
492
537
  children: /* @__PURE__ */ q(Ge, {
493
538
  count: 0,
494
- onClick: () => C(!1),
495
- ariaLabel: v,
496
- children: /* @__PURE__ */ q(P, {
539
+ onClick: () => T(!1),
540
+ ariaLabel: y,
541
+ children: /* @__PURE__ */ q(N, {
497
542
  size: p.MD,
498
543
  "aria-hidden": !0
499
544
  })
@@ -510,7 +555,7 @@ Te(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: r = "dial-tiny-semi
510
555
  className: "flex flex-nowrap gap-1",
511
556
  children: e.map((e) => {
512
557
  let i = t === e.id;
513
- return /* @__PURE__ */ q(T, {
558
+ return /* @__PURE__ */ q(w, {
514
559
  label: e.label,
515
560
  selected: i,
516
561
  onClick: () => n(e.id),
@@ -562,7 +607,7 @@ var Ye = (e) => /* @__PURE__ */ q(y, { ...e }), Xe = ({ features: e, initialResp
562
607
  fieldTitle: c,
563
608
  labelClassName: Ze,
564
609
  elementId: "response-format",
565
- orientation: k.Column,
610
+ orientation: O.Column,
566
611
  activeRadioButton: t ?? s.Markdown,
567
612
  labelDescription: l,
568
613
  radioButtons: [{
@@ -583,7 +628,7 @@ var Ye = (e) => /* @__PURE__ */ q(y, { ...e }), Xe = ({ features: e, initialResp
583
628
  },
584
629
  onChange: (e) => a(e ?? "")
585
630
  }),
586
- e.temperature && /* @__PURE__ */ q(C, {
631
+ e.temperature && /* @__PURE__ */ q(S, {
587
632
  labelProps: {
588
633
  label: m,
589
634
  className: Ze,
@@ -599,7 +644,7 @@ var Ye = (e) => /* @__PURE__ */ q(y, { ...e }), Xe = ({ features: e, initialResp
599
644
  ]
600
645
  });
601
646
  Te(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: g = "Apply changes", saveDisabledTooltip: _ }) => {
602
- let { responseFormat: y, systemPrompt: b, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: D } = Xe({
647
+ let { responseFormat: y, systemPrompt: b, temperature: ee, canSubmit: x, setResponseFormat: S, setSystemPrompt: C, setTemperature: w, handleSubmit: E } = Xe({
603
648
  features: e,
604
649
  initialResponseFormat: t,
605
650
  initialSystemPrompt: n,
@@ -610,18 +655,18 @@ Te(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
610
655
  return /* @__PURE__ */ q(v, {
611
656
  open: !0,
612
657
  header: o,
613
- size: O.Sm,
658
+ size: D.Sm,
614
659
  onClose: a,
615
660
  className: "!bg-layer-2",
616
661
  footer: /* @__PURE__ */ q("div", {
617
662
  className: "flex justify-end px-6 py-4",
618
- children: /* @__PURE__ */ q(E, {
663
+ children: /* @__PURE__ */ q(T, {
619
664
  tooltip: _,
620
- hideTooltip: S || !_,
665
+ hideTooltip: x || !_,
621
666
  children: /* @__PURE__ */ q(Ye, {
622
667
  label: g,
623
- onClick: D,
624
- disabled: !S
668
+ onClick: E,
669
+ disabled: !x
625
670
  })
626
671
  })
627
672
  }),
@@ -629,10 +674,10 @@ Te(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
629
674
  features: e,
630
675
  responseFormat: y,
631
676
  systemPrompt: b,
632
- temperature: x,
633
- onResponseFormatChange: C,
634
- onSystemPromptChange: w,
635
- onTemperatureChange: T,
677
+ temperature: ee,
678
+ onResponseFormatChange: S,
679
+ onSystemPromptChange: C,
680
+ onTemperatureChange: w,
636
681
  responseFormatLabel: s,
637
682
  responseFormatHint: c,
638
683
  responseFormatMarkdownLabel: l,
@@ -656,13 +701,13 @@ var Q = {
656
701
  blockquote: "_blockquote_1yr1w_34",
657
702
  tableCell: "_tableCell_1yr1w_39",
658
703
  tableHeader: "_tableHeader_1yr1w_44"
659
- }, $e = ({ status: e, isLive: t }) => e ? e === c.Completed ? /* @__PURE__ */ q(F, {
704
+ }, $e = ({ status: e, isLive: t }) => e ? e === c.Completed ? /* @__PURE__ */ q(P, {
660
705
  size: p.MD,
661
706
  className: Q.iconSecondary
662
- }) : /* @__PURE__ */ q(A, {
707
+ }) : /* @__PURE__ */ q(k, {
663
708
  size: p.MD,
664
709
  className: Q.iconSecondary
665
- }) : t ? /* @__PURE__ */ q(w, { size: 20 }) : /* @__PURE__ */ q(A, {
710
+ }) : t ? /* @__PURE__ */ q(C, { size: 20 }) : /* @__PURE__ */ q(k, {
666
711
  size: p.MD,
667
712
  className: Q.iconSecondary
668
713
  }), et = ({ children: e, codeClassName: t, copyAriaLabel: n }) => {
@@ -676,8 +721,8 @@ var Q = {
676
721
  return /* @__PURE__ */ J("pre", {
677
722
  className: d("relative max-h-[300px] overflow-auto rounded border p-3 text-sm", Q.codeBlock),
678
723
  children: [/* @__PURE__ */ q(h, {
679
- size: D.Small,
680
- icon: q(r ? j : L, {
724
+ size: E.Small,
725
+ icon: q(r ? A : I, {
681
726
  size: p.SM,
682
727
  className: Q.iconSecondary
683
728
  }),
@@ -721,10 +766,10 @@ var Q = {
721
766
  type: "button",
722
767
  onClick: () => s((e) => !e),
723
768
  className: d("flex w-full cursor-pointer items-center gap-2 p-0", Q.collapseButton),
724
- children: [c, o ? /* @__PURE__ */ q(M, {
769
+ children: [c, o ? /* @__PURE__ */ q(j, {
725
770
  size: p.MD,
726
771
  className: Q.iconSecondary
727
- }) : /* @__PURE__ */ q(N, {
772
+ }) : /* @__PURE__ */ q(M, {
728
773
  size: p.MD,
729
774
  className: d(Q.iconSecondary, "rtl:scale-x-[-1]")
730
775
  })]
@@ -815,8 +860,8 @@ var Q = {
815
860
  children: [v.length > 0 && /* @__PURE__ */ J("div", { children: [/* @__PURE__ */ q(_, {
816
861
  className: rt.toggleButton,
817
862
  onClick: () => f((e) => !e),
818
- iconBefore: /* @__PURE__ */ q(j, { size: p.SM }),
819
- iconAfter: u ? /* @__PURE__ */ q(M, { size: 12 }) : /* @__PURE__ */ q(N, {
863
+ iconBefore: /* @__PURE__ */ q(A, { size: p.SM }),
864
+ iconAfter: u ? /* @__PURE__ */ q(j, { size: 12 }) : /* @__PURE__ */ q(M, {
820
865
  size: 12,
821
866
  className: "rtl:scale-x-[-1]"
822
867
  }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-conversation-stages",
3
3
  "description": "Panel for displaying agent processing stages during LLM response streaming",
4
- "version": "1.0.0-dev.502",
4
+ "version": "1.0.0-dev.503",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -19,9 +19,9 @@
19
19
  "peerDependencies": {
20
20
  "react": "^19.0.0",
21
21
  "@tabler/icons-react": "^3.0.0",
22
- "@epam/ai-dial-chat-shared": "1.0.0-dev.502",
22
+ "@epam/ai-dial-chat-shared": "1.0.0-dev.503",
23
23
  "@epam/ai-dial-ui-kit": "0.12.0-dev.28",
24
- "@epam/ai-dial-conversation-input": "1.0.0-dev.502"
24
+ "@epam/ai-dial-conversation-input": "1.0.0-dev.503"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",