@epam/ai-dial-conversation-stages 1.1.0-dev.298 → 1.1.0-dev.299

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":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAUxE,gJAAgJ;AAChJ,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAyOlD,CAAC"}
1
+ {"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAUxE,gJAAgJ;AAChJ,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA+OlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StageIcon.d.ts","sourceRoot":"","sources":["../../../src/components/StageIcon/StageIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4GAA4G;IAC5G,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8FAA8F;AAC9F,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8BxC,CAAC"}
1
+ {"version":3,"file":"StageIcon.d.ts","sourceRoot":"","sources":["../../../src/components/StageIcon/StageIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAOxD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4GAA4G;IAC5G,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8FAA8F;AAC9F,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAgCxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StageItem.d.ts","sourceRoot":"","sources":["../../../src/components/StageItem/StageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAMnC,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kHAAkH;IAClH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,6EAA6E;AAC7E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA0HxC,CAAC"}
1
+ {"version":3,"file":"StageItem.d.ts","sourceRoot":"","sources":["../../../src/components/StageItem/StageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAQvD,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAMnC,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,kHAAkH;IAClH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,6EAA6E;AAC7E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA+HxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StageCodeBlock.d.ts","sourceRoot":"","sources":["../../../src/components/StageMarkdownContent/StageCodeBlock.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,UAAU,KAAK;IACb,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,mEAAmE;AACnE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,CA0DpC,CAAC"}
1
+ {"version":3,"file":"StageCodeBlock.d.ts","sourceRoot":"","sources":["../../../src/components/StageMarkdownContent/StageCodeBlock.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,UAAU,KAAK;IACb,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,mEAAmE;AACnE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,CA4DpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AAyInC,+FAA+F;AAC/F,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA+D5C,CAAC"}
1
+ {"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AA8InC,+FAA+F;AAC/F,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA+D5C,CAAC"}
package/index.js CHANGED
@@ -1,33 +1,33 @@
1
1
  import { MarkdownRenderer as e, StageStatus as t, buildCssVars as n, copyToClipboard as r, mergeClasses as i } from "@epam/ai-dial-chat-shared";
2
- import { DIAL_ICON_SIZE as a, ElementSize as o, EllipsisTooltip as s, GhostIconButton as c, LinkButton as l, Spinner as u } from "@epam/ai-dial-ui-kit";
3
- import { IconAlertCircle as d, IconCheck as f, IconChevronDown as p, IconChevronRight as m, IconCopy as h } from "@tabler/icons-react";
4
- import { memo as g, useCallback as _, useEffect as v, useRef as y, useState as b } from "react";
5
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
2
+ import { DIAL_ICON_SIZE as a, DIAL_KIT_ICON_STROKE as o, ElementSize as s, EllipsisTooltip as c, GhostIconButton as l, LinkButton as u, Spinner as d } from "@epam/ai-dial-ui-kit";
3
+ import { IconAlertCircle as f, IconCheck as p, IconChevronDown as m, IconChevronRight as h, IconCopy as g } from "@tabler/icons-react";
4
+ import { memo as _, useCallback as v, useEffect as y, useRef as b, useState as x } from "react";
5
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
6
6
  //#region src/utils/stage-name.ts
7
- var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e) => {
7
+ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /:\s*$/, O = (e) => {
8
8
  let t = e ?? "";
9
- w.lastIndex = 0;
9
+ T.lastIndex = 0;
10
10
  let n, r = null, i = -1, a = 0;
11
- for (; n = w.exec(t);) {
12
- let e = n[0].slice(1, -1), t = T.exec(e);
11
+ for (; n = T.exec(t);) {
12
+ let e = n[0].slice(1, -1), t = E.exec(e);
13
13
  if (t) {
14
14
  r = t, i = n.index, a = n[0].length;
15
15
  break;
16
16
  }
17
17
  }
18
18
  return {
19
- name: (r && i >= 0 ? t.slice(0, i) + t.slice(i + a) : t).replace(E, "").trim().replace(/ {2,}/g, " "),
19
+ name: (r && i >= 0 ? t.slice(0, i) + t.slice(i + a) : t).replace(D, "").trim().replace(/ {2,}/g, " "),
20
20
  durationLabel: r ? `${r[1]}s` : void 0
21
21
  };
22
- }, O = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), k = (e) => e >= 60 ? `${Math.floor(e / 60)}m ${Math.round(e % 60)}s` : `${e.toFixed(1)}s`, A = (e) => {
22
+ }, k = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), A = (e) => e >= 60 ? `${Math.floor(e / 60)}m ${Math.round(e % 60)}s` : `${e.toFixed(1)}s`, j = (e) => {
23
23
  if (!e) return;
24
24
  let t = /^(\d+(?:\.\d+)?)s$/.exec(e);
25
25
  return t ? parseFloat(t[1]) : void 0;
26
- }, j = (e) => [...e].reverse().find((e) => e.status == null), M = (e, t) => e.findIndex((e) => e.index === t.index) + 1, N = (e) => {
26
+ }, M = (e) => [...e].reverse().find((e) => e.status == null), N = (e, t) => e.findIndex((e) => e.index === t.index) + 1, P = (e) => {
27
27
  let t = [], n = 0;
28
28
  for (; n < e.length;) {
29
- let r = e[n], i = D(r.name).name, a = n + 1;
30
- for (; a < e.length && D(e[a].name).name === i;) a += 1;
29
+ let r = e[n], i = O(r.name).name, a = n + 1;
30
+ for (; a < e.length && O(e[a].name).name === i;) a += 1;
31
31
  let o = e.slice(n, a);
32
32
  o.length > 1 ? t.push({
33
33
  key: r.index,
@@ -39,7 +39,7 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
39
39
  }), n = a;
40
40
  }
41
41
  return t;
42
- }, P = {
42
+ }, F = {
43
43
  panel: "_panel_vd48n_1",
44
44
  row: "_row_vd48n_5",
45
45
  collapseButton: "_collapseButton_vd48n_9",
@@ -57,47 +57,50 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
57
57
  codeInline: "_codeInline_vd48n_62",
58
58
  blockquote: "_blockquote_vd48n_68",
59
59
  tableCell: "_tableCell_vd48n_73"
60
- }, F = ({ status: e, isLive: n, runningLabel: r = "Running", failedLabel: i = "Failed" }) => n ? /* @__PURE__ */ S(u, {
60
+ }, I = ({ status: e, isLive: n, runningLabel: r = "Running", failedLabel: i = "Failed" }) => n ? /* @__PURE__ */ C(d, {
61
61
  size: 16,
62
62
  ariaLabel: r
63
- }) : e === t.Failed ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(d, {
63
+ }) : e === t.Failed ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(f, {
64
64
  size: a.MD,
65
- className: P.iconError,
66
- "aria-hidden": !0
67
- }), /* @__PURE__ */ S("span", {
65
+ className: F.iconError,
66
+ "aria-hidden": !0,
67
+ stroke: o
68
+ }), /* @__PURE__ */ C("span", {
68
69
  className: "sr-only",
69
70
  children: i
70
- })] }) : /* @__PURE__ */ S(f, {
71
+ })] }) : /* @__PURE__ */ C(p, {
71
72
  size: a.SM,
72
- className: P.iconCompleted,
73
- "aria-hidden": !0
74
- }), I = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: s }) => {
75
- let [l, u] = b(!1), d = y(null);
76
- v(() => () => {
77
- d.current != null && clearTimeout(d.current);
73
+ className: F.iconCompleted,
74
+ "aria-hidden": !0,
75
+ stroke: o
76
+ }), L = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: c }) => {
77
+ let [u, d] = x(!1), f = b(null);
78
+ y(() => () => {
79
+ f.current != null && clearTimeout(f.current);
78
80
  }, []);
79
- let p = _(() => {
80
- r(typeof e == "string" ? e : String(e ?? "")), d.current && clearTimeout(d.current), u(!0), d.current = setTimeout(() => u(!1), 2e3);
81
+ let m = v(() => {
82
+ r(typeof e == "string" ? e : String(e ?? "")), f.current && clearTimeout(f.current), d(!0), f.current = setTimeout(() => d(!1), 2e3);
81
83
  }, [e]);
82
- return /* @__PURE__ */ C("pre", {
83
- className: i("relative max-h-[300px] overflow-auto rounded border p-3", n, P.codeBlock),
84
- children: [/* @__PURE__ */ S(c, {
85
- size: o.Small,
86
- icon: S(l ? f : h, {
84
+ return /* @__PURE__ */ w("pre", {
85
+ className: i("relative max-h-[300px] overflow-auto rounded border p-3", n, F.codeBlock),
86
+ children: [/* @__PURE__ */ C(l, {
87
+ size: s.Small,
88
+ icon: C(u ? p : g, {
87
89
  size: a.SM,
88
- className: P.iconSecondary
90
+ className: F.iconSecondary,
91
+ stroke: o
89
92
  }),
90
- "aria-label": s,
91
- onClick: p,
93
+ "aria-label": c,
94
+ onClick: m,
92
95
  className: "absolute end-2 top-2"
93
- }), /* @__PURE__ */ S("code", {
96
+ }), /* @__PURE__ */ C("code", {
94
97
  className: t,
95
98
  children: e
96
99
  })]
97
100
  });
98
- }, L = g(({ content: t, typography: n, copyAriaLabel: r = "Copy" }) => {
99
- let a = "mb-1.5 last:mb-0", o = i(n?.headingClassName ?? "dial-small-semi-text", P.stageContent, a);
100
- return /* @__PURE__ */ S(e, {
101
+ }, R = _(({ content: t, typography: n, copyAriaLabel: r = "Copy" }) => {
102
+ let a = "mb-1.5 last:mb-0", o = i(n?.headingClassName ?? "dial-small-semi-text", F.stageContent, a);
103
+ return /* @__PURE__ */ C(e, {
101
104
  content: t,
102
105
  classNames: {
103
106
  h1: o,
@@ -106,154 +109,158 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
106
109
  h4: o,
107
110
  h5: o,
108
111
  h6: o,
109
- p: i(n?.contentClassName ?? "dial-tiny-text", P.stageContent, "mb-1.5"),
110
- ul: i(n?.contentClassName ?? "dial-tiny-text", P.stageContent, a),
111
- ol: i(n?.contentClassName ?? "dial-tiny-text", P.stageContent, a),
112
- strong: i(n?.strongClassName ?? n?.contentClassName ?? "dial-tiny-text", P.stageContent),
113
- codeInline: P.codeInline,
114
- blockquote: i(n?.contentClassName ?? "dial-tiny-text", P.blockquote, a),
115
- link: i(n?.contentClassName ?? "dial-tiny-text", P.stageContent),
116
- tableCell: i(n?.contentClassName ?? "dial-tiny-text", P.tableCell)
112
+ p: i(n?.contentClassName ?? "dial-tiny-text", F.stageContent, "mb-1.5"),
113
+ ul: i(n?.contentClassName ?? "dial-tiny-text", F.stageContent, a),
114
+ ol: i(n?.contentClassName ?? "dial-tiny-text", F.stageContent, a),
115
+ strong: i(n?.strongClassName ?? n?.contentClassName ?? "dial-tiny-text", F.stageContent),
116
+ codeInline: F.codeInline,
117
+ blockquote: i(n?.contentClassName ?? "dial-tiny-text", F.blockquote, a),
118
+ link: i(n?.contentClassName ?? "dial-tiny-text", F.stageContent),
119
+ tableCell: i(n?.contentClassName ?? "dial-tiny-text", F.tableCell)
117
120
  },
118
- components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */ S(I, {
121
+ components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */ C(L, {
119
122
  codeClassName: t,
120
123
  blockClassName: n?.codeBlockClassName,
121
124
  copyAriaLabel: r,
122
125
  children: e
123
- }) : /* @__PURE__ */ S("code", {
124
- className: i("inline-block px-1.5 py-1", n?.codeClassName ?? "dial-code-text rounded-md", P.codeInline),
126
+ }) : /* @__PURE__ */ C("code", {
127
+ className: i("inline-block px-1.5 py-1", n?.codeClassName ?? "dial-code-text rounded-md", F.codeInline),
125
128
  children: e
126
129
  }) }
127
130
  });
128
- }), R = ({ stage: e, isLive: n, typography: r, labels: o, nameOverride: c }) => {
129
- let [l, u] = b(!1), { copyAriaLabel: d = "Copy stage content", runningAriaLabel: f, failedAriaLabel: h } = o ?? {}, { name: g, durationLabel: _ } = D(e.name), v = c ?? g, y = !c && O(g), w = e.status === t.Failed, T = !!e.content, E = /* @__PURE__ */ C(x, { children: [
130
- /* @__PURE__ */ S("span", {
131
+ }), z = ({ stage: e, isLive: n, typography: r, labels: s, nameOverride: l }) => {
132
+ let [u, d] = x(!1), { copyAriaLabel: f = "Copy stage content", runningAriaLabel: p, failedAriaLabel: g } = s ?? {}, { name: _, durationLabel: v } = O(e.name), y = l ?? _, b = !l && k(_), T = e.status === t.Failed, E = !!e.content, D = /* @__PURE__ */ w(S, { children: [
133
+ /* @__PURE__ */ C("span", {
131
134
  className: "flex flex-none items-center",
132
- children: /* @__PURE__ */ S(F, {
135
+ children: /* @__PURE__ */ C(I, {
133
136
  status: e.status,
134
137
  isLive: n,
135
- runningLabel: f,
136
- failedLabel: h
138
+ runningLabel: p,
139
+ failedLabel: g
137
140
  })
138
141
  }),
139
- /* @__PURE__ */ S("span", {
140
- className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", P.stageName, w && P.stageNameFailed, y && P.monoName),
141
- children: /* @__PURE__ */ S(s, { text: v || e.status || "" })
142
+ /* @__PURE__ */ C("span", {
143
+ className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", F.stageName, T && F.stageNameFailed, b && F.monoName),
144
+ children: /* @__PURE__ */ C(c, { text: y || e.status || "" })
142
145
  }),
143
- e.tag && /* @__PURE__ */ S("span", {
144
- className: i("flex-none", r?.tagClassName ?? "dial-tiny-lead-text", P.tag),
146
+ e.tag && /* @__PURE__ */ C("span", {
147
+ className: i("flex-none", r?.tagClassName ?? "dial-tiny-lead-text", F.tag),
145
148
  children: e.tag
146
149
  }),
147
- _ && /* @__PURE__ */ S("span", {
148
- className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", P.duration),
149
- children: _
150
+ v && /* @__PURE__ */ C("span", {
151
+ className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", F.duration),
152
+ children: v
150
153
  }),
151
- T && /* @__PURE__ */ S("span", {
152
- className: i("flex-none", P.iconSecondary),
153
- children: l ? /* @__PURE__ */ S(p, {
154
+ E && /* @__PURE__ */ C("span", {
155
+ className: i("flex-none", F.iconSecondary),
156
+ children: u ? /* @__PURE__ */ C(m, {
154
157
  size: a.SM,
155
- "aria-hidden": !0
156
- }) : /* @__PURE__ */ S(m, {
158
+ "aria-hidden": !0,
159
+ stroke: o
160
+ }) : /* @__PURE__ */ C(h, {
157
161
  size: a.SM,
158
162
  className: "rtl:scale-x-[-1]",
159
- "aria-hidden": !0
163
+ "aria-hidden": !0,
164
+ stroke: o
160
165
  })
161
166
  })
162
- ] }), k = i("flex w-full items-center gap-2 px-2 py-1.5", P.row);
163
- return T ? /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("div", {
164
- className: k,
165
- children: /* @__PURE__ */ S("button", {
167
+ ] }), A = i("flex w-full items-center gap-2 px-2 py-1.5", F.row);
168
+ return E ? /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("div", {
169
+ className: A,
170
+ children: /* @__PURE__ */ C("button", {
166
171
  type: "button",
167
- onClick: () => u((e) => !e),
168
- "aria-expanded": l,
172
+ onClick: () => d((e) => !e),
173
+ "aria-expanded": u,
169
174
  className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-start",
170
- children: E
175
+ children: D
171
176
  })
172
- }), /* @__PURE__ */ S("div", {
173
- className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", l ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
174
- children: /* @__PURE__ */ S("div", {
177
+ }), /* @__PURE__ */ C("div", {
178
+ className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", u ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
179
+ children: /* @__PURE__ */ C("div", {
175
180
  className: "overflow-hidden",
176
- children: /* @__PURE__ */ S("div", {
181
+ children: /* @__PURE__ */ C("div", {
177
182
  className: "mt-2 flex flex-col gap-3 py-1 ps-8",
178
- children: e.content && /* @__PURE__ */ S("div", {
183
+ children: e.content && /* @__PURE__ */ C("div", {
179
184
  className: "max-h-[300px] overflow-y-auto",
180
- children: /* @__PURE__ */ S(L, {
185
+ children: /* @__PURE__ */ C(R, {
181
186
  content: e.content,
182
187
  typography: r,
183
- copyAriaLabel: d
188
+ copyAriaLabel: f
184
189
  })
185
190
  })
186
191
  })
187
192
  })
188
- })] }) : /* @__PURE__ */ S("div", {
189
- className: k,
190
- children: E
193
+ })] }) : /* @__PURE__ */ C("div", {
194
+ className: A,
195
+ children: D
191
196
  });
192
- }, z = ({ row: e, isLive: n, typography: r, labels: o }) => {
193
- let { runningAriaLabel: c, failedAriaLabel: l, attemptLabel: u = (e) => `Attempt ${e}` } = o ?? {}, [d, f] = b(!1), h = e.attempts?.some((e) => e.status === t.Failed), g = (e.attempts || []).reduce((e, t) => {
194
- let { durationLabel: n } = D(t.name);
195
- return e + (A(n) ?? 0);
196
- }, 0), _ = g > 0 ? k(g) : void 0;
197
- return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("button", {
197
+ }, B = ({ row: e, isLive: n, typography: r, labels: s }) => {
198
+ let { runningAriaLabel: l, failedAriaLabel: u, attemptLabel: d = (e) => `Attempt ${e}` } = s ?? {}, [f, p] = x(!1), g = e.attempts?.some((e) => e.status === t.Failed), _ = (e.attempts || []).reduce((e, t) => {
199
+ let { durationLabel: n } = O(t.name);
200
+ return e + (j(n) ?? 0);
201
+ }, 0), v = _ > 0 ? A(_) : void 0;
202
+ return /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("button", {
198
203
  type: "button",
199
- onClick: () => f((e) => !e),
200
- "aria-expanded": d,
201
- className: i("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start", P.collapseButton, P.row),
204
+ onClick: () => p((e) => !e),
205
+ "aria-expanded": f,
206
+ className: i("flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start", F.collapseButton, F.row),
202
207
  children: [
203
- /* @__PURE__ */ S("span", {
208
+ /* @__PURE__ */ C("span", {
204
209
  className: "flex flex-none items-center",
205
- children: /* @__PURE__ */ S(F, {
206
- status: h ? t.Failed : t.Completed,
210
+ children: /* @__PURE__ */ C(I, {
211
+ status: g ? t.Failed : t.Completed,
207
212
  isLive: n,
208
- runningLabel: c,
209
- failedLabel: l
213
+ runningLabel: l,
214
+ failedLabel: u
210
215
  })
211
216
  }),
212
- /* @__PURE__ */ S("span", {
213
- className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", P.stageName, h && P.stageNameFailed),
214
- children: /* @__PURE__ */ S(s, { text: e.name })
215
- }),
216
217
  /* @__PURE__ */ C("span", {
217
- className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", P.count),
218
+ className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", F.stageName, g && F.stageNameFailed),
219
+ children: /* @__PURE__ */ C(c, { text: e.name })
220
+ }),
221
+ /* @__PURE__ */ w("span", {
222
+ className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", F.count),
218
223
  children: ["×", e.attempts?.length ?? 0]
219
224
  }),
220
- _ && /* @__PURE__ */ S("span", {
221
- className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", P.duration),
222
- children: _
225
+ v && /* @__PURE__ */ C("span", {
226
+ className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", F.duration),
227
+ children: v
223
228
  }),
224
- /* @__PURE__ */ S("span", {
225
- className: i("flex-none", P.iconSecondary),
226
- children: d ? /* @__PURE__ */ S(p, {
229
+ /* @__PURE__ */ C("span", {
230
+ className: i("flex-none", F.iconSecondary),
231
+ children: f ? /* @__PURE__ */ C(m, {
227
232
  size: a.SM,
228
- "aria-hidden": !0
229
- }) : /* @__PURE__ */ S(m, {
233
+ "aria-hidden": !0,
234
+ stroke: o
235
+ }) : /* @__PURE__ */ C(h, {
230
236
  size: a.SM,
231
237
  className: "rtl:scale-x-[-1]",
232
- "aria-hidden": !0
238
+ "aria-hidden": !0,
239
+ stroke: o
233
240
  })
234
241
  })
235
242
  ]
236
- }), /* @__PURE__ */ S("div", {
237
- className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", d ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
238
- children: /* @__PURE__ */ S("div", {
243
+ }), /* @__PURE__ */ C("div", {
244
+ className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", f ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
245
+ children: /* @__PURE__ */ C("div", {
239
246
  className: "overflow-hidden",
240
- children: /* @__PURE__ */ S("ul", {
247
+ children: /* @__PURE__ */ C("ul", {
241
248
  role: "list",
242
249
  className: "mt-1 flex flex-col gap-0.5 ps-6",
243
- children: e.attempts?.map((t, i) => /* @__PURE__ */ S("li", {
250
+ children: e.attempts?.map((t, i) => /* @__PURE__ */ C("li", {
244
251
  role: "listitem",
245
- children: /* @__PURE__ */ S(R, {
252
+ children: /* @__PURE__ */ C(z, {
246
253
  stage: t,
247
- nameOverride: u(i + 1),
254
+ nameOverride: d(i + 1),
248
255
  isLive: n && t.index === e.attempts?.[e.attempts.length - 1]?.index,
249
256
  typography: r,
250
- labels: o
257
+ labels: s
251
258
  })
252
259
  }, t.index))
253
260
  })
254
261
  })
255
262
  })] });
256
- }, B = ({ stages: e, isStreaming: t, className: r, styles: a, labels: o }) => {
263
+ }, V = ({ stages: e, isStreaming: t, className: r, styles: a, labels: o }) => {
257
264
  let { colors: s, typography: c } = a ?? {}, l = n({
258
265
  "--cs-text": s?.text,
259
266
  "--cs-row-hover": s?.rowHoverColor,
@@ -270,24 +277,24 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
270
277
  "--cs-code-border": s?.codeBorderColor,
271
278
  "--cs-code-text": s?.codeTextColor,
272
279
  "--cs-border": s?.borderColor
273
- }), u = t ? j(e) : void 0, d = N(e);
274
- return /* @__PURE__ */ S("div", {
280
+ }), u = t ? M(e) : void 0, d = P(e);
281
+ return /* @__PURE__ */ C("div", {
275
282
  style: l,
276
- className: i("w-full", P.panel, r),
277
- children: /* @__PURE__ */ S("ul", {
283
+ className: i("w-full", F.panel, r),
284
+ children: /* @__PURE__ */ C("ul", {
278
285
  role: "list",
279
286
  className: "flex w-full flex-col gap-0.5 ps-5",
280
- children: d.map((e) => e.stage ? /* @__PURE__ */ S("li", {
287
+ children: d.map((e) => e.stage ? /* @__PURE__ */ C("li", {
281
288
  role: "listitem",
282
- children: /* @__PURE__ */ S(R, {
289
+ children: /* @__PURE__ */ C(z, {
283
290
  stage: e.stage,
284
291
  isLive: u?.index === e.stage.index,
285
292
  typography: c,
286
293
  labels: o
287
294
  })
288
- }, e.key) : /* @__PURE__ */ S("li", {
295
+ }, e.key) : /* @__PURE__ */ C("li", {
289
296
  role: "listitem",
290
- children: /* @__PURE__ */ S(z, {
297
+ children: /* @__PURE__ */ C(B, {
291
298
  row: e,
292
299
  isLive: u?.index === e.attempts?.[e.attempts.length - 1].index,
293
300
  typography: c,
@@ -296,163 +303,166 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
296
303
  }, e.key))
297
304
  })
298
305
  });
299
- }, V = {
306
+ }, H = {
300
307
  toggleButton: "_toggleButton_1sa5v_1",
301
308
  executedLabel: "_executedLabel_1sa5v_13",
302
309
  stepsCount: "_stepsCount_1sa5v_17",
303
310
  doneIcon: "_doneIcon_1sa5v_22",
304
311
  failedText: "_failedText_1sa5v_26",
305
312
  liveName: "_liveName_1sa5v_30"
306
- }, H = ({ stages: e, isStreaming: r, labels: o, className: c, styles: d }) => {
307
- let { executedLabel: h = "Executed", stepsLabel: g = () => "steps", failedCountLabel: _ = (e) => `${e} failed`, runningStepLabel: x = (e, t) => `Step ${e} of ${t}`, runningAriaLabel: w = "Running", copyAriaLabel: T, failedAriaLabel: E, attemptLabel: O } = o ?? {}, [N, P] = b(r), F = y(r);
308
- v(() => {
309
- F.current && !r && P(!1), F.current = r;
313
+ }, U = ({ stages: e, isStreaming: r, labels: s, className: l, styles: f }) => {
314
+ let { executedLabel: g = "Executed", stepsLabel: _ = () => "steps", failedCountLabel: v = (e) => `${e} failed`, runningStepLabel: S = (e, t) => `Step ${e} of ${t}`, runningAriaLabel: T = "Running", copyAriaLabel: E, failedAriaLabel: D, attemptLabel: k } = s ?? {}, [P, F] = x(r), I = b(r);
315
+ y(() => {
316
+ I.current && !r && F(!1), I.current = r;
310
317
  }, [r]);
311
- let { colors: I, panel: L } = d ?? {}, R = d?.typography ?? { fontClassName: "dial-small-text" }, z = n({
312
- "--cs-cg-label": I?.labelColor,
313
- "--cs-cg-label-hover": I?.labelHoverColor,
314
- "--cs-cg-steps-count": I?.stepsCountColor,
315
- "--cs-cg-done": I?.doneColor,
316
- "--cs-cg-failed": I?.failedColor,
317
- "--cs-text": L?.text,
318
- "--cs-row-hover": L?.rowHoverColor,
319
- "--cs-button-bg": L?.collapsedButtonBg,
320
- "--cs-stage-text": L?.stageTextColor,
321
- "--cs-failed-text": L?.failedColor,
322
- "--cs-tag-text": L?.tagTextColor,
323
- "--cs-count-text": L?.countTextColor,
324
- "--cs-duration-text": L?.durationTextColor,
325
- "--cs-icon-secondary": L?.iconSecondaryColor,
326
- "--cs-icon-completed": L?.iconCompletedColor,
327
- "--cs-icon-error": L?.iconErrorColor,
328
- "--cs-code-bg": L?.codeBg,
329
- "--cs-code-border": L?.codeBorderColor,
330
- "--cs-code-text": L?.codeTextColor,
331
- "--cs-border": L?.borderColor
318
+ let { colors: L, panel: R } = f ?? {}, z = f?.typography ?? { fontClassName: "dial-small-text" }, B = n({
319
+ "--cs-cg-label": L?.labelColor,
320
+ "--cs-cg-label-hover": L?.labelHoverColor,
321
+ "--cs-cg-steps-count": L?.stepsCountColor,
322
+ "--cs-cg-done": L?.doneColor,
323
+ "--cs-cg-failed": L?.failedColor,
324
+ "--cs-text": R?.text,
325
+ "--cs-row-hover": R?.rowHoverColor,
326
+ "--cs-button-bg": R?.collapsedButtonBg,
327
+ "--cs-stage-text": R?.stageTextColor,
328
+ "--cs-failed-text": R?.failedColor,
329
+ "--cs-tag-text": R?.tagTextColor,
330
+ "--cs-count-text": R?.countTextColor,
331
+ "--cs-duration-text": R?.durationTextColor,
332
+ "--cs-icon-secondary": R?.iconSecondaryColor,
333
+ "--cs-icon-completed": R?.iconCompletedColor,
334
+ "--cs-icon-error": R?.iconErrorColor,
335
+ "--cs-code-bg": R?.codeBg,
336
+ "--cs-code-border": R?.codeBorderColor,
337
+ "--cs-code-text": R?.codeTextColor,
338
+ "--cs-border": R?.borderColor
332
339
  });
333
340
  if (e.length === 0) return null;
334
- let H = {
335
- copyAriaLabel: T,
336
- runningAriaLabel: w,
337
- failedAriaLabel: E,
338
- attemptLabel: O
341
+ let U = {
342
+ copyAriaLabel: E,
343
+ runningAriaLabel: T,
344
+ failedAriaLabel: D,
345
+ attemptLabel: k
339
346
  };
340
- if (e.length === 1) return /* @__PURE__ */ S(B, {
347
+ if (e.length === 1) return /* @__PURE__ */ C(V, {
341
348
  stages: e,
342
349
  isStreaming: r,
343
- className: c,
350
+ className: l,
344
351
  styles: {
345
- colors: L,
346
- typography: d?.typography
352
+ colors: R,
353
+ typography: f?.typography
347
354
  },
348
- labels: H
355
+ labels: U
349
356
  });
350
- let U = e.some((e) => e.status === t.Failed), W = e.reduce((e, t) => {
351
- let { durationLabel: n } = D(t.name);
352
- return e + (A(n) ?? 0);
353
- }, 0), G = W > 0 ? k(W) : void 0, K = r ? j(e) : void 0, q;
357
+ let W = e.some((e) => e.status === t.Failed), G = e.reduce((e, t) => {
358
+ let { durationLabel: n } = O(t.name);
359
+ return e + (j(n) ?? 0);
360
+ }, 0), K = G > 0 ? A(G) : void 0, q = r ? M(e) : void 0, J;
354
361
  if (r) {
355
- let t = K ? M(e, K) : e.length, n = K ? D(K.name).name : "";
356
- q = /* @__PURE__ */ C("span", {
362
+ let t = q ? N(e, q) : e.length, n = q ? O(q.name).name : "";
363
+ J = /* @__PURE__ */ w("span", {
357
364
  role: "status",
358
365
  "aria-live": "polite",
359
366
  className: "flex min-w-0 items-center gap-2",
360
367
  children: [
361
- /* @__PURE__ */ S("span", {
368
+ /* @__PURE__ */ C("span", {
362
369
  className: "flex flex-none items-center",
363
- children: /* @__PURE__ */ S(u, {
370
+ children: /* @__PURE__ */ C(d, {
364
371
  size: 14,
365
- ariaLabel: w
372
+ ariaLabel: T
366
373
  })
367
374
  }),
368
- /* @__PURE__ */ S("span", {
369
- className: i("flex-none whitespace-nowrap", R.fontClassName, V.liveName),
370
- children: x(t, e.length)
375
+ /* @__PURE__ */ C("span", {
376
+ className: i("flex-none whitespace-nowrap", z.fontClassName, H.liveName),
377
+ children: S(t, e.length)
371
378
  }),
372
- n && /* @__PURE__ */ S("span", {
373
- className: i("min-w-0 max-w-[22rem] truncate", R.fontClassName, V.executedLabel),
374
- children: /* @__PURE__ */ S(s, { text: n })
379
+ n && /* @__PURE__ */ C("span", {
380
+ className: i("min-w-0 max-w-[22rem] truncate", z.fontClassName, H.executedLabel),
381
+ children: /* @__PURE__ */ C(c, { text: n })
375
382
  })
376
383
  ]
377
384
  });
378
- } else if (U) {
385
+ } else if (W) {
379
386
  let n = e.filter((e) => e.status === t.Failed).length;
380
- q = /* @__PURE__ */ C("span", {
387
+ J = /* @__PURE__ */ w("span", {
381
388
  className: "inline-flex items-center gap-1",
382
389
  children: [
383
- /* @__PURE__ */ C("span", {
384
- className: i(R.fontClassName, V.executedLabel),
390
+ /* @__PURE__ */ w("span", {
391
+ className: i(z.fontClassName, H.executedLabel),
385
392
  children: [
386
- h,
393
+ g,
387
394
  " ",
388
395
  e.length,
389
396
  " ",
390
- g(e.length)
397
+ _(e.length)
391
398
  ]
392
399
  }),
393
- /* @__PURE__ */ S("span", {
394
- className: i(R.fontClassName, V.failedText),
395
- children: _(n)
400
+ /* @__PURE__ */ C("span", {
401
+ className: i(z.fontClassName, H.failedText),
402
+ children: v(n)
396
403
  }),
397
- G && /* @__PURE__ */ S("span", {
398
- className: i(R.fontClassName, V.stepsCount),
399
- children: G
404
+ K && /* @__PURE__ */ C("span", {
405
+ className: i(z.fontClassName, H.stepsCount),
406
+ children: K
400
407
  })
401
408
  ]
402
409
  });
403
- } else q = /* @__PURE__ */ C("span", {
410
+ } else J = /* @__PURE__ */ w("span", {
404
411
  className: "inline-flex items-center gap-1",
405
412
  children: [
406
- /* @__PURE__ */ S(f, {
413
+ /* @__PURE__ */ C(p, {
407
414
  size: a.SM,
408
- className: V.doneIcon,
409
- "aria-hidden": !0
415
+ className: H.doneIcon,
416
+ "aria-hidden": !0,
417
+ stroke: o
410
418
  }),
411
- /* @__PURE__ */ C("span", {
412
- className: i(R.fontClassName, V.executedLabel),
419
+ /* @__PURE__ */ w("span", {
420
+ className: i(z.fontClassName, H.executedLabel),
413
421
  children: [
414
- h,
422
+ g,
415
423
  " ",
416
424
  e.length,
417
425
  " ",
418
- g(e.length)
426
+ _(e.length)
419
427
  ]
420
428
  }),
421
- G && /* @__PURE__ */ S("span", {
422
- className: i(R.fontClassName, V.stepsCount),
423
- children: G
429
+ K && /* @__PURE__ */ C("span", {
430
+ className: i(z.fontClassName, H.stepsCount),
431
+ children: K
424
432
  })
425
433
  ]
426
434
  });
427
- return /* @__PURE__ */ C("div", {
428
- style: z,
429
- className: i("flex w-full flex-col gap-1", c),
430
- children: [/* @__PURE__ */ S(l, {
431
- className: V.toggleButton,
435
+ return /* @__PURE__ */ w("div", {
436
+ style: B,
437
+ className: i("flex w-full flex-col gap-1", l),
438
+ children: [/* @__PURE__ */ C(u, {
439
+ className: H.toggleButton,
432
440
  textClassName: "min-w-0",
433
- onClick: () => P((e) => !e),
434
- "aria-expanded": N,
435
- iconAfter: N ? /* @__PURE__ */ S(p, {
441
+ onClick: () => F((e) => !e),
442
+ "aria-expanded": P,
443
+ iconAfter: P ? /* @__PURE__ */ C(m, {
436
444
  size: 12,
437
- "aria-hidden": !0
438
- }) : /* @__PURE__ */ S(m, {
445
+ "aria-hidden": !0,
446
+ stroke: o
447
+ }) : /* @__PURE__ */ C(h, {
439
448
  size: 12,
440
449
  className: "rtl:scale-x-[-1]",
441
- "aria-hidden": !0
450
+ "aria-hidden": !0,
451
+ stroke: o
442
452
  }),
443
- label: q
444
- }), /* @__PURE__ */ S("div", {
445
- className: i("grid transition-[grid-template-rows] duration-300 ease-in-out", N ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
446
- children: /* @__PURE__ */ S("div", {
453
+ label: J
454
+ }), /* @__PURE__ */ C("div", {
455
+ className: i("grid transition-[grid-template-rows] duration-300 ease-in-out", P ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
456
+ children: /* @__PURE__ */ C("div", {
447
457
  className: "overflow-hidden",
448
- children: /* @__PURE__ */ S(B, {
458
+ children: /* @__PURE__ */ C(V, {
449
459
  stages: e,
450
460
  isStreaming: r,
451
461
  styles: {
452
- colors: L,
453
- typography: d?.typography
462
+ colors: R,
463
+ typography: f?.typography
454
464
  },
455
- labels: H,
465
+ labels: U,
456
466
  className: "pt-1"
457
467
  })
458
468
  })
@@ -460,4 +470,4 @@ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e)
460
470
  });
461
471
  };
462
472
  //#endregion
463
- export { H as CollapsedGroup, B as StagesPanel };
473
+ export { U as CollapsedGroup, V as StagesPanel };
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.1.0-dev.298",
4
+ "version": "1.1.0-dev.299",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -19,8 +19,8 @@
19
19
  "peerDependencies": {
20
20
  "react": "^19.0.0",
21
21
  "@tabler/icons-react": "^3.0.0",
22
- "@epam/ai-dial-chat-shared": "1.1.0-dev.298",
23
- "@epam/ai-dial-ui-kit": "^0.14.0-dev.13"
22
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.299",
23
+ "@epam/ai-dial-ui-kit": "^0.14.0-dev.15"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",