impact-ui 5.0.4-chatbot.1 → 5.0.5

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 (101) hide show
  1. package/dist/_virtual/index2.js +2 -2
  2. package/dist/_virtual/index3.js +2 -2
  3. package/dist/_virtual/index4.js +4 -2
  4. package/dist/_virtual/index5.js +3 -3
  5. package/dist/_virtual/index6.js +2 -4
  6. package/dist/components/Button/index.js +1 -1
  7. package/dist/components/Chatbot/Chatbot.types.d.ts +18 -191
  8. package/dist/components/Chatbot/Chatbot.types.d.ts.map +1 -1
  9. package/dist/components/Chatbot/chatBotFooter.d.ts +1 -1
  10. package/dist/components/Chatbot/chatBotFooter.d.ts.map +1 -1
  11. package/dist/components/Chatbot/chatBotFooter.js +4 -21
  12. package/dist/components/Chatbot/conversationScreen.d.ts +1 -1
  13. package/dist/components/Chatbot/conversationScreen.d.ts.map +1 -1
  14. package/dist/components/Chatbot/conversationScreen.js +3 -5
  15. package/dist/components/Chatbot/index.d.ts +2 -2
  16. package/dist/components/Chatbot/index.d.ts.map +1 -1
  17. package/dist/components/Chatbot/index.js +50 -100
  18. package/dist/components/Chatbot/newChatComponent.d.ts +1 -1
  19. package/dist/components/Chatbot/newChatComponent.d.ts.map +1 -1
  20. package/dist/components/Chatbot/newChatComponent.js +70 -387
  21. package/dist/components/DatePicker/DatePicker.types.d.ts +4 -0
  22. package/dist/components/DatePicker/DatePicker.types.d.ts.map +1 -1
  23. package/dist/components/DatePicker/datePickerInput.d.ts +2 -0
  24. package/dist/components/DatePicker/datePickerInput.d.ts.map +1 -1
  25. package/dist/components/DatePicker/datePickerInput.js +32 -2
  26. package/dist/components/DatePicker/index.d.ts.map +1 -1
  27. package/dist/components/DatePicker/index.js +5 -1
  28. package/dist/components/DatePicker/showMonthYearSelect.d.ts.map +1 -1
  29. package/dist/components/DatePicker/showMonthYearSelect.js +2 -0
  30. package/dist/components/DateRangePicker/index.js +1 -1
  31. package/dist/components/DateRangePicker/showMonthYearSelect.d.ts.map +1 -1
  32. package/dist/components/DateRangePicker/showMonthYearSelect.js +2 -0
  33. package/dist/components/Input/index.js +1 -1
  34. package/dist/components/Menu/IconMenuItem.js +1 -1
  35. package/dist/components/Menu/NestedMenuItem.js +1 -1
  36. package/dist/components/Menu/index.js +1 -1
  37. package/dist/components/Menu/nestedMenuItemsFromObject.js +1 -1
  38. package/dist/components/Select/Select.types.d.ts +7 -0
  39. package/dist/components/Select/Select.types.d.ts.map +1 -1
  40. package/dist/components/Select/index.d.ts.map +1 -1
  41. package/dist/components/Select/index.js +44 -26
  42. package/dist/components/TableV36/AgGridHeader.d.ts.map +1 -1
  43. package/dist/components/TableV36/AgGridHeader.js +107 -115
  44. package/dist/components/index.d.ts +1 -1
  45. package/dist/components/index.d.ts.map +1 -1
  46. package/dist/locales/de-DE.json.d.ts +0 -51
  47. package/dist/locales/de-DE.json.js +0 -51
  48. package/dist/locales/en-US.json.d.ts +0 -51
  49. package/dist/locales/en-US.json.js +0 -51
  50. package/dist/locales/es-ES.json.d.ts +0 -51
  51. package/dist/locales/es-ES.json.js +0 -51
  52. package/dist/mcp-component-registry.json +182 -256
  53. package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +10 -30
  54. package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
  55. package/dist/node_modules/prop-types/index.js +1 -1
  56. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  57. package/dist/node_modules/react-is/index.js +1 -1
  58. package/package.json +2 -2
  59. package/dist/_virtual/ArrowBack.js +0 -4
  60. package/dist/_virtual/AttachFileOutlined.js +0 -4
  61. package/dist/_virtual/ContentCopyOutlined.js +0 -4
  62. package/dist/_virtual/Menu.js +0 -4
  63. package/dist/_virtual/NorthRounded.js +0 -4
  64. package/dist/_virtual/RefreshOutlined.js +0 -4
  65. package/dist/_virtual/StopRounded.js +0 -4
  66. package/dist/_virtual/ThumbDownOutlined.js +0 -4
  67. package/dist/_virtual/ThumbUpOutlined.js +0 -4
  68. package/dist/_virtual/VolumeUpOutlined.js +0 -4
  69. package/dist/components/Chatbot/chatbotComposer.d.ts +0 -4
  70. package/dist/components/Chatbot/chatbotComposer.d.ts.map +0 -1
  71. package/dist/components/Chatbot/chatbotComposer.js +0 -226
  72. package/dist/components/Chatbot/chatbotGreetingHeader.d.ts +0 -4
  73. package/dist/components/Chatbot/chatbotGreetingHeader.d.ts.map +0 -1
  74. package/dist/components/Chatbot/chatbotGreetingHeader.js +0 -213
  75. package/dist/components/Chatbot/irisConversationThread.d.ts +0 -24
  76. package/dist/components/Chatbot/irisConversationThread.d.ts.map +0 -1
  77. package/dist/components/Chatbot/irisConversationThread.js +0 -470
  78. package/dist/components/Chatbot/irisGreetingBackdrop.d.ts +0 -5
  79. package/dist/components/Chatbot/irisGreetingBackdrop.d.ts.map +0 -1
  80. package/dist/components/Chatbot/irisGreetingBackdrop.js +0 -62
  81. package/dist/components/Chatbot/irisMenuListItem.d.ts +0 -11
  82. package/dist/components/Chatbot/irisMenuListItem.d.ts.map +0 -1
  83. package/dist/components/Chatbot/irisMenuListItem.js +0 -126
  84. package/dist/components/Chatbot/irisMenuScreen.d.ts +0 -4
  85. package/dist/components/Chatbot/irisMenuScreen.d.ts.map +0 -1
  86. package/dist/components/Chatbot/irisMenuScreen.js +0 -311
  87. package/dist/components/Chatbot/irisThinking.d.ts +0 -7
  88. package/dist/components/Chatbot/irisThinking.d.ts.map +0 -1
  89. package/dist/components/Chatbot/irisThinking.js +0 -219
  90. package/dist/node_modules/@mui/icons-material/ArrowBack.js +0 -17
  91. package/dist/node_modules/@mui/icons-material/AttachFileOutlined.js +0 -17
  92. package/dist/node_modules/@mui/icons-material/ContentCopyOutlined.js +0 -17
  93. package/dist/node_modules/@mui/icons-material/Menu.js +0 -17
  94. package/dist/node_modules/@mui/icons-material/NorthRounded.js +0 -17
  95. package/dist/node_modules/@mui/icons-material/RefreshOutlined.js +0 -17
  96. package/dist/node_modules/@mui/icons-material/StopRounded.js +0 -17
  97. package/dist/node_modules/@mui/icons-material/ThumbDownOutlined.js +0 -17
  98. package/dist/node_modules/@mui/icons-material/ThumbUpOutlined.js +0 -17
  99. package/dist/node_modules/@mui/icons-material/VolumeUpOutlined.js +0 -17
  100. package/dist/stories/chatBotApiMock.d.ts +0 -476
  101. package/dist/stories/chatBotApiMock.d.ts.map +0 -1
@@ -1,4 +0,0 @@
1
- import { IrisMenuScreenProps } from './Chatbot.types';
2
-
3
- export declare function IrisMenuScreen({ view, historyPanelData, artifacts, recentChatsPreviewCount, artifactsPreviewCount, footerText, onFooterLinkClick, onBackClick, onClose, onNewChatClick, onToggleCollapse, onMinimiseChatBot, isCollapsed, isFullWidth, dragHandleProps, onSelectConversation, onSelectArtifact, onViewMore, onFilterSelect, onChatMenuAction, onArtifactMenuAction, }: IrisMenuScreenProps): import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=irisMenuScreen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"irisMenuScreen.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/irisMenuScreen.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAIV,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AA6JzB,wBAAgB,cAAc,CAAC,EAC7B,IAAa,EACb,gBAAqB,EACrB,SAAc,EACd,uBAAuC,EACvC,qBAAqC,EACrC,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,WAAmB,EACnB,WAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,GACrB,EAAE,mBAAmB,2CAkKrB"}
@@ -1,311 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useMemo } from "react";
3
- import default_1 from "../../node_modules/@mui/icons-material/KeyboardArrowRight.js";
4
- import { FilterFunnel as FilterFunnel_default } from "../../node_modules/@impactsmartsuite/impact-icons/dist/index.js";
5
- import { Button } from "../Button/index.js";
6
- import { Menu } from "../Menu/index.js";
7
- import { Tooltip } from "../Tooltip/index.js";
8
- import { ChatBotFooter } from "./chatBotFooter.js";
9
- import { ChatbotGreetingHeader } from "./chatbotGreetingHeader.js";
10
- import { IrisMenuListItem } from "./irisMenuListItem.js";
11
- import { useTranslation } from "../../i18n/useTranslation.js";
12
- const PREVIEW_COUNT = 4;
13
- const FILTER_ICON_SIZE = 16;
14
- const FILTER_OPTIONS = [
15
- { value: "type", labelKey: "chatBot.irisMenu.filter.type" },
16
- { value: "status", labelKey: "chatBot.irisMenu.filter.status" },
17
- { value: "lastActivity", labelKey: "chatBot.irisMenu.filter.lastActivity" }
18
- ];
19
- function flattenHistory(data = []) {
20
- if (Array.isArray(data)) {
21
- return data.flatMap((group) => group.conversation_list || []);
22
- }
23
- const pinned = data.pinned || [];
24
- const fromGroups = (data.groups || []).flatMap((group) => group.conversation_list || []);
25
- const seen = /* @__PURE__ */ new Set();
26
- const result = [];
27
- [...pinned, ...fromGroups].forEach((item) => {
28
- const key = String(item.conversation_id ?? item.name ?? "");
29
- if (!key || seen.has(key)) return;
30
- seen.add(key);
31
- result.push(item);
32
- });
33
- return result;
34
- }
35
- function SectionFilterButton({
36
- section,
37
- isCollapsed = false,
38
- onFilterSelect
39
- }) {
40
- const { t } = useTranslation();
41
- const [anchorEl, setAnchorEl] = useState(null);
42
- const open = Boolean(anchorEl);
43
- return /* @__PURE__ */ jsxs("div", { className: "iris-menu-filter", children: [
44
- /* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.irisMenu.filter"), variant: "tertiary", children: /* @__PURE__ */ jsx(
45
- Button,
46
- {
47
- "aria-controls": open ? `iris-menu-filter-${section}` : void 0,
48
- "aria-expanded": open,
49
- "aria-haspopup": "true",
50
- "aria-label": t("chatBot.irisMenu.filter"),
51
- className: `iris-menu-filter-button${open ? " is-active" : ""}`,
52
- icon: /* @__PURE__ */ jsx(FilterFunnel_default, { height: FILTER_ICON_SIZE, width: FILTER_ICON_SIZE }),
53
- size: isCollapsed ? "small" : "large",
54
- type: "default",
55
- variant: "text",
56
- onClick: (event) => {
57
- setAnchorEl(open ? null : event.currentTarget);
58
- }
59
- }
60
- ) }),
61
- /* @__PURE__ */ jsx(
62
- Menu,
63
- {
64
- MenuProps: {
65
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
66
- transformOrigin: { vertical: "top", horizontal: "right" },
67
- slotProps: {
68
- root: { sx: { zIndex: 2e3 } },
69
- paper: {
70
- className: "iris-menu-filter-paper",
71
- style: { width: 182, minWidth: 180, maxWidth: 240 }
72
- }
73
- }
74
- },
75
- anchorEl,
76
- id: `iris-menu-filter-${section}`,
77
- open,
78
- options: FILTER_OPTIONS.map((option) => ({
79
- label: t(option.labelKey),
80
- value: option.value,
81
- onClick: () => {
82
- onFilterSelect == null ? void 0 : onFilterSelect(section, option.value);
83
- setAnchorEl(null);
84
- }
85
- })),
86
- onClose: () => setAnchorEl(null)
87
- }
88
- )
89
- ] });
90
- }
91
- function AccordionSection({
92
- section,
93
- title,
94
- expanded,
95
- onToggle,
96
- children,
97
- isCollapsed = false,
98
- onFilterSelect
99
- }) {
100
- const { t } = useTranslation();
101
- const panelId = `iris-menu-panel-${section}`;
102
- const headerId = `iris-menu-header-${section}`;
103
- return /* @__PURE__ */ jsxs("section", { className: `iris-menu-section${expanded ? " is-expanded" : ""}`, children: [
104
- /* @__PURE__ */ jsxs("div", { className: "iris-menu-section-header", children: [
105
- /* @__PURE__ */ jsxs("div", { className: "iris-menu-section-header-left", children: [
106
- /* @__PURE__ */ jsx(
107
- "div",
108
- {
109
- "aria-controls": panelId,
110
- "aria-expanded": expanded,
111
- "aria-label": expanded ? `${t("chatBot.irisMenu.collapse")} ${title}` : `${t("chatBot.irisMenu.expand")} ${title}`,
112
- className: `iris-menu-section-expand-icon${expanded ? " is-expanded" : ""}`,
113
- id: headerId,
114
- role: "button",
115
- tabIndex: 0,
116
- onClick: onToggle,
117
- onKeyDown: (event) => {
118
- if (event.key === "Enter" || event.key === " ") {
119
- event.preventDefault();
120
- onToggle();
121
- }
122
- },
123
- children: /* @__PURE__ */ jsx(default_1, {})
124
- }
125
- ),
126
- /* @__PURE__ */ jsx("h2", { className: "iris-menu-section-title", children: title })
127
- ] }),
128
- /* @__PURE__ */ jsx(
129
- SectionFilterButton,
130
- {
131
- isCollapsed,
132
- section,
133
- onFilterSelect
134
- }
135
- )
136
- ] }),
137
- expanded ? /* @__PURE__ */ jsx(
138
- "div",
139
- {
140
- "aria-labelledby": headerId,
141
- className: "iris-menu-section-body",
142
- id: panelId,
143
- role: "region",
144
- children
145
- }
146
- ) : null
147
- ] });
148
- }
149
- function IrisMenuScreen({
150
- view = "menu",
151
- historyPanelData = [],
152
- artifacts = [],
153
- recentChatsPreviewCount = PREVIEW_COUNT,
154
- artifactsPreviewCount = PREVIEW_COUNT,
155
- footerText,
156
- onFooterLinkClick,
157
- onBackClick,
158
- onClose,
159
- onNewChatClick,
160
- onToggleCollapse,
161
- onMinimiseChatBot,
162
- isCollapsed = false,
163
- isFullWidth = false,
164
- dragHandleProps,
165
- onSelectConversation,
166
- onSelectArtifact,
167
- onViewMore,
168
- onFilterSelect,
169
- onChatMenuAction,
170
- onArtifactMenuAction
171
- }) {
172
- const { t } = useTranslation();
173
- const [chatsExpanded, setChatsExpanded] = useState(true);
174
- const [artifactsExpanded, setArtifactsExpanded] = useState(true);
175
- const recentChats = useMemo(() => flattenHistory(historyPanelData), [historyPanelData]);
176
- const isListView = view === "recent-chats" || view === "artifacts";
177
- const headerTitle = view === "recent-chats" ? t("chatBot.irisMenu.recentChats") : view === "artifacts" ? t("chatBot.irisMenu.artifacts") : t("chatBot.irisMenu.title");
178
- const previewChats = recentChats.slice(0, recentChatsPreviewCount);
179
- const previewArtifacts = artifacts.slice(0, artifactsPreviewCount);
180
- const showChatsViewMore = recentChats.length > recentChatsPreviewCount;
181
- const showArtifactsViewMore = artifacts.length > artifactsPreviewCount;
182
- return /* @__PURE__ */ jsxs("div", { className: `iris-menu-screen${isCollapsed ? " is-collapsed" : ""}`, children: [
183
- /* @__PURE__ */ jsx(
184
- ChatbotGreetingHeader,
185
- {
186
- dragHandleProps,
187
- isCollapsed,
188
- isFullWidth,
189
- title: headerTitle,
190
- variant: isListView ? "list" : "menu",
191
- onBackClick,
192
- onClose,
193
- onMinimiseChatBot,
194
- onNewChatClick,
195
- onToggleCollapse
196
- }
197
- ),
198
- /* @__PURE__ */ jsx("main", { className: "iris-menu-main", children: view === "menu" ? /* @__PURE__ */ jsxs("div", { className: "iris-menu-content", children: [
199
- /* @__PURE__ */ jsxs(
200
- AccordionSection,
201
- {
202
- expanded: chatsExpanded,
203
- isCollapsed,
204
- section: "recentChats",
205
- title: t("chatBot.irisMenu.recentChats"),
206
- onFilterSelect,
207
- onToggle: () => setChatsExpanded((open) => !open),
208
- children: [
209
- /* @__PURE__ */ jsx("ul", { className: "iris-menu-list", children: previewChats.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
210
- IrisMenuListItem,
211
- {
212
- id: item.conversation_id ?? item.name ?? "chat",
213
- isCollapsed,
214
- label: item.name || String(item.conversation_id ?? ""),
215
- onAction: (action) => onChatMenuAction == null ? void 0 : onChatMenuAction(action, item),
216
- onSelect: () => onSelectConversation == null ? void 0 : onSelectConversation(item)
217
- }
218
- ) }, String(item.conversation_id ?? item.name))) }),
219
- previewChats.length === 0 ? /* @__PURE__ */ jsx("p", { className: "iris-menu-empty", children: t("chatBot.history.noConversations") }) : null,
220
- showChatsViewMore ? /* @__PURE__ */ jsx(
221
- Button,
222
- {
223
- className: "iris-menu-view-more",
224
- size: "small",
225
- variant: "url",
226
- onClick: () => onViewMore == null ? void 0 : onViewMore("recentChats"),
227
- children: t("chatBot.irisMenu.viewMore")
228
- }
229
- ) : null
230
- ]
231
- }
232
- ),
233
- /* @__PURE__ */ jsxs(
234
- AccordionSection,
235
- {
236
- expanded: artifactsExpanded,
237
- isCollapsed,
238
- section: "artifacts",
239
- title: t("chatBot.irisMenu.artifacts"),
240
- onFilterSelect,
241
- onToggle: () => setArtifactsExpanded((open) => !open),
242
- children: [
243
- /* @__PURE__ */ jsx("ul", { className: "iris-menu-list", children: previewArtifacts.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
244
- IrisMenuListItem,
245
- {
246
- id: item.id,
247
- isCollapsed,
248
- label: item.name,
249
- onAction: (action) => onArtifactMenuAction == null ? void 0 : onArtifactMenuAction(action, item),
250
- onSelect: () => onSelectArtifact == null ? void 0 : onSelectArtifact(item)
251
- }
252
- ) }, String(item.id))) }),
253
- previewArtifacts.length === 0 ? /* @__PURE__ */ jsx("p", { className: "iris-menu-empty", children: t("chatBot.irisMenu.noArtifacts") }) : null,
254
- showArtifactsViewMore ? /* @__PURE__ */ jsx(
255
- Button,
256
- {
257
- className: "iris-menu-view-more",
258
- size: "small",
259
- variant: "url",
260
- onClick: () => onViewMore == null ? void 0 : onViewMore("artifacts"),
261
- children: t("chatBot.irisMenu.viewMore")
262
- }
263
- ) : null
264
- ]
265
- }
266
- )
267
- ] }) : /* @__PURE__ */ jsxs("div", { className: "iris-menu-content iris-menu-content-list", children: [
268
- /* @__PURE__ */ jsxs("div", { className: "iris-menu-list-toolbar", children: [
269
- /* @__PURE__ */ jsx("h2", { className: "iris-menu-list-toolbar-title", children: headerTitle }),
270
- /* @__PURE__ */ jsx(
271
- SectionFilterButton,
272
- {
273
- section: view === "artifacts" ? "artifacts" : "recentChats",
274
- onFilterSelect
275
- }
276
- )
277
- ] }),
278
- /* @__PURE__ */ jsx("ul", { className: "iris-menu-list iris-menu-list-full", children: view === "artifacts" ? artifacts.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
279
- IrisMenuListItem,
280
- {
281
- id: item.id,
282
- isCollapsed,
283
- label: item.name,
284
- onAction: (action) => onArtifactMenuAction == null ? void 0 : onArtifactMenuAction(action, item),
285
- onSelect: () => onSelectArtifact == null ? void 0 : onSelectArtifact(item)
286
- }
287
- ) }, String(item.id))) : recentChats.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
288
- IrisMenuListItem,
289
- {
290
- id: item.conversation_id ?? item.name ?? "chat",
291
- isCollapsed,
292
- label: item.name || String(item.conversation_id ?? ""),
293
- onAction: (action) => onChatMenuAction == null ? void 0 : onChatMenuAction(action, item),
294
- onSelect: () => onSelectConversation == null ? void 0 : onSelectConversation(item)
295
- }
296
- ) }, String(item.conversation_id ?? item.name))) }),
297
- (view === "artifacts" ? artifacts : recentChats).length === 0 ? /* @__PURE__ */ jsx("p", { className: "iris-menu-empty", children: view === "artifacts" ? t("chatBot.irisMenu.noArtifacts") : t("chatBot.history.noConversations") }) : null
298
- ] }) }),
299
- /* @__PURE__ */ jsx(
300
- ChatBotFooter,
301
- {
302
- footerLinkLabel: onFooterLinkClick ? t("chatBot.footerLearnMore") : void 0,
303
- footerText,
304
- onFooterLinkClick
305
- }
306
- )
307
- ] });
308
- }
309
- export {
310
- IrisMenuScreen
311
- };
@@ -1,7 +0,0 @@
1
- import { IrisThinkingState } from './Chatbot.types';
2
-
3
- export interface IrisThinkingProps {
4
- thinking: IrisThinkingState;
5
- }
6
- export declare function IrisThinking({ thinking }: IrisThinkingProps): import("react/jsx-runtime").JSX.Element;
7
- //# sourceMappingURL=irisThinking.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"irisThinking.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/irisThinking.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,iBAAiB,CAAC;AAiK3E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAoI3D"}
@@ -1,219 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import default_1 from "../../node_modules/@mui/icons-material/KeyboardArrowDown.js";
4
- import default_1$1 from "../../node_modules/@mui/icons-material/KeyboardArrowRight.js";
5
- import { getAssetUrl } from "../../utils/assetBase.js";
6
- import { Tag } from "../Tag/index.js";
7
- import { useTranslation } from "../../i18n/useTranslation.js";
8
- const SPARKLE_SIZE = 20;
9
- const CHEVRON_SIZE = 16;
10
- const IrisAiIcon = getAssetUrl("icons/smartBotAlan.svg");
11
- function IrisAiSparkle({ size = SPARKLE_SIZE }) {
12
- return /* @__PURE__ */ jsx(
13
- "img",
14
- {
15
- alt: "",
16
- "aria-hidden": "true",
17
- className: "iris-thinking-sparkle",
18
- height: size,
19
- src: IrisAiIcon,
20
- width: size
21
- }
22
- );
23
- }
24
- function ThinkingDots() {
25
- return /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "iris-thinking-dots", children: [
26
- /* @__PURE__ */ jsx("span", {}),
27
- /* @__PURE__ */ jsx("span", {}),
28
- /* @__PURE__ */ jsx("span", {})
29
- ] });
30
- }
31
- function CompleteStepMarker() {
32
- return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "iris-thinking-step-marker is-complete", children: /* @__PURE__ */ jsxs("svg", { fill: "none", height: "20", viewBox: "0 0 20 20", width: "20", children: [
33
- /* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", fill: "#EBF7F1", opacity: "0.8", r: "8" }),
34
- /* @__PURE__ */ jsx(
35
- "path",
36
- {
37
- d: "M9.3 10.9L8.225 9.825C8.13334 9.73333 8.01667 9.6875 7.875 9.6875C7.73334 9.6875 7.61667 9.73333 7.525 9.825C7.43334 9.91666 7.3875 10.0333 7.3875 10.175C7.3875 10.3167 7.43334 10.4333 7.525 10.525L8.95 11.95C9.05 12.05 9.16667 12.1 9.3 12.1C9.43334 12.1 9.55 12.05 9.65 11.95L12.475 9.125C12.5667 9.03333 12.6125 8.91666 12.6125 8.775C12.6125 8.63333 12.5667 8.51666 12.475 8.425C12.3833 8.33333 12.2667 8.2875 12.125 8.2875C11.9833 8.2875 11.8667 8.33333 11.775 8.425L9.3 10.9ZM10 15C9.30834 15 8.65834 14.8687 8.05 14.6062C7.44167 14.3437 6.9125 13.9875 6.4625 13.5375C6.0125 13.0875 5.65625 12.5583 5.39375 11.95C5.13125 11.3417 5 10.6917 5 10C5 9.30833 5.13125 8.65833 5.39375 8.05C5.65625 7.44166 6.0125 6.9125 6.4625 6.4625C6.9125 6.0125 7.44167 5.65625 8.05 5.39375C8.65834 5.13125 9.30834 5 10 5C10.6917 5 11.3417 5.13125 11.95 5.39375C12.5583 5.65625 13.0875 6.0125 13.5375 6.4625C13.9875 6.9125 14.3438 7.44166 14.6063 8.05C14.8688 8.65833 15 9.30833 15 10C15 10.6917 14.8688 11.3417 14.6063 11.95C14.3438 12.5583 13.9875 13.0875 13.5375 13.5375C13.0875 13.9875 12.5583 14.3437 11.95 14.6062C11.3417 14.8687 10.6917 15 10 15Z",
38
- fill: "#3BB273"
39
- }
40
- )
41
- ] }) });
42
- }
43
- function StepMarker({ status }) {
44
- if (status === "complete") return /* @__PURE__ */ jsx(CompleteStepMarker, {});
45
- return /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "iris-thinking-step-marker is-active", children: [
46
- /* @__PURE__ */ jsx("span", { className: "iris-thinking-pop-halo" }),
47
- /* @__PURE__ */ jsx("span", { className: "iris-thinking-pop-dot" })
48
- ] });
49
- }
50
- function StepRow({
51
- step,
52
- isLast,
53
- onToggle
54
- }) {
55
- const [uncontrolledExpanded, setUncontrolledExpanded] = useState(false);
56
- const isControlled = typeof step.expanded === "boolean";
57
- const expanded = isControlled ? Boolean(step.expanded) : uncontrolledExpanded;
58
- const showChevron = Boolean(step.expandable);
59
- const showChip = Boolean(step.chip) && (step.status === "active" || expanded);
60
- const handleToggle = () => {
61
- if (!showChevron) return;
62
- const next = !expanded;
63
- if (!isControlled) setUncontrolledExpanded(next);
64
- onToggle == null ? void 0 : onToggle(step.id, next);
65
- };
66
- return /* @__PURE__ */ jsxs(
67
- "div",
68
- {
69
- className: `iris-thinking-step${step.status === "complete" ? " is-complete" : " is-active"}${isLast ? " is-last" : ""}`,
70
- children: [
71
- /* @__PURE__ */ jsxs("div", { className: "iris-thinking-step-rail", "aria-hidden": "true", children: [
72
- /* @__PURE__ */ jsx(StepMarker, { status: step.status }),
73
- !isLast ? /* @__PURE__ */ jsx("span", { className: "iris-thinking-step-connector" }) : null
74
- ] }),
75
- /* @__PURE__ */ jsxs("div", { className: "iris-thinking-step-body", children: [
76
- /* @__PURE__ */ jsxs("div", { className: "iris-thinking-step-row", children: [
77
- /* @__PURE__ */ jsx("p", { className: "iris-thinking-step-label", children: step.label }),
78
- showChevron ? /* @__PURE__ */ jsx(
79
- "button",
80
- {
81
- "aria-expanded": expanded,
82
- "aria-label": step.label,
83
- className: "iris-thinking-step-chevron",
84
- type: "button",
85
- onClick: handleToggle,
86
- children: /* @__PURE__ */ jsx(default_1$1, { sx: { fontSize: CHEVRON_SIZE } })
87
- }
88
- ) : null
89
- ] }),
90
- showChip && step.chip ? /* @__PURE__ */ jsx("div", { className: "iris-thinking-step-chip", children: /* @__PURE__ */ jsx("span", { children: step.chip }) }) : null
91
- ] })
92
- ]
93
- }
94
- );
95
- }
96
- function StepsList({
97
- steps,
98
- onToggleStep
99
- }) {
100
- if (steps.length === 0) return null;
101
- return /* @__PURE__ */ jsx("div", { className: "iris-thinking-steps", children: steps.map((step, index) => /* @__PURE__ */ jsx(
102
- StepRow,
103
- {
104
- isLast: index === steps.length - 1,
105
- step,
106
- onToggle: onToggleStep
107
- },
108
- step.id
109
- )) });
110
- }
111
- function SectionToggle({
112
- label,
113
- expanded,
114
- onToggle
115
- }) {
116
- return /* @__PURE__ */ jsxs(
117
- "button",
118
- {
119
- "aria-expanded": expanded,
120
- className: "iris-thinking-section-toggle",
121
- type: "button",
122
- onClick: onToggle,
123
- children: [
124
- /* @__PURE__ */ jsx("span", { className: "iris-thinking-section-toggle-label", children: label }),
125
- expanded ? /* @__PURE__ */ jsx(default_1, { sx: { fontSize: CHEVRON_SIZE } }) : /* @__PURE__ */ jsx(default_1$1, { sx: { fontSize: CHEVRON_SIZE } })
126
- ]
127
- }
128
- );
129
- }
130
- function IrisThinking({ thinking }) {
131
- const { t } = useTranslation();
132
- const phase = thinking.phase ?? "status";
133
- const steps = thinking.steps ?? [];
134
- const citations = thinking.citations ?? [];
135
- const completeCount = steps.filter((step) => step.status === "complete").length;
136
- const [localStepsExpanded, setLocalStepsExpanded] = useState(false);
137
- const [localCitationsExpanded, setLocalCitationsExpanded] = useState(false);
138
- const stepsExpanded = typeof thinking.stepsExpanded === "boolean" ? thinking.stepsExpanded : localStepsExpanded;
139
- const citationsExpanded = typeof thinking.citationsExpanded === "boolean" ? thinking.citationsExpanded : localCitationsExpanded;
140
- const liveTitle = thinking.title ?? (steps.length > 0 ? t("chatBot.irisThinking.progress", {
141
- current: completeCount,
142
- total: steps.length
143
- }) : t("chatBot.irisThinking.default"));
144
- const stepsLabel = thinking.stepsLabel ?? (steps.length > 0 ? t("chatBot.irisThinking.stepsLabel", {
145
- current: completeCount || steps.length,
146
- total: steps.length
147
- }) : t("chatBot.irisThinking.steps"));
148
- const citationsLabel = thinking.citationsLabel ?? (citations.length > 0 ? t("chatBot.irisThinking.citationsLabel", { count: citations.length }) : t("chatBot.irisThinking.citations"));
149
- const handleToggleSteps = () => {
150
- var _a;
151
- const next = !stepsExpanded;
152
- if (typeof thinking.stepsExpanded !== "boolean") setLocalStepsExpanded(next);
153
- (_a = thinking.onToggleSteps) == null ? void 0 : _a.call(thinking, next);
154
- };
155
- const handleToggleCitations = () => {
156
- var _a;
157
- const next = !citationsExpanded;
158
- if (typeof thinking.citationsExpanded !== "boolean") setLocalCitationsExpanded(next);
159
- (_a = thinking.onToggleCitations) == null ? void 0 : _a.call(thinking, next);
160
- };
161
- let body = null;
162
- if (phase === "status") {
163
- body = /* @__PURE__ */ jsxs("div", { className: "iris-thinking-status", children: [
164
- /* @__PURE__ */ jsx("span", { className: "iris-thinking-icon", children: /* @__PURE__ */ jsx(IrisAiSparkle, {}) }),
165
- /* @__PURE__ */ jsxs("div", { className: "iris-thinking-status-content", children: [
166
- thinking.statusLabel ? /* @__PURE__ */ jsx("span", { className: "iris-thinking-status-label", children: thinking.statusLabel }) : null,
167
- /* @__PURE__ */ jsx(ThinkingDots, {})
168
- ] })
169
- ] });
170
- } else if (phase === "steps") {
171
- body = /* @__PURE__ */ jsxs("div", { className: "iris-thinking-live", children: [
172
- /* @__PURE__ */ jsxs("div", { className: "iris-thinking-live-header", children: [
173
- /* @__PURE__ */ jsx("span", { className: "iris-thinking-icon", children: /* @__PURE__ */ jsx(IrisAiSparkle, {}) }),
174
- /* @__PURE__ */ jsx("p", { className: "iris-thinking-live-title", children: liveTitle })
175
- ] }),
176
- /* @__PURE__ */ jsx(StepsList, { steps, onToggleStep: thinking.onToggleStep })
177
- ] });
178
- } else {
179
- body = /* @__PURE__ */ jsxs("div", { className: "iris-thinking-complete", children: [
180
- steps.length > 0 || thinking.stepsLabel ? /* @__PURE__ */ jsxs("div", { className: "iris-thinking-complete-section", children: [
181
- /* @__PURE__ */ jsx(
182
- SectionToggle,
183
- {
184
- expanded: stepsExpanded,
185
- label: stepsLabel,
186
- onToggle: handleToggleSteps
187
- }
188
- ),
189
- stepsExpanded ? /* @__PURE__ */ jsx(StepsList, { steps, onToggleStep: thinking.onToggleStep }) : null
190
- ] }) : null,
191
- citations.length > 0 || thinking.citationsLabel ? /* @__PURE__ */ jsxs("div", { className: "iris-thinking-complete-section", children: [
192
- /* @__PURE__ */ jsx(
193
- SectionToggle,
194
- {
195
- expanded: citationsExpanded,
196
- label: citationsLabel,
197
- onToggle: handleToggleCitations
198
- }
199
- ),
200
- citationsExpanded ? /* @__PURE__ */ jsx("div", { className: "iris-thinking-citations", children: citations.map((group) => /* @__PURE__ */ jsxs("div", { className: "iris-thinking-citation-card", children: [
201
- /* @__PURE__ */ jsx("p", { className: "iris-thinking-citation-group", children: group.label }),
202
- /* @__PURE__ */ jsx("div", { className: "iris-thinking-citation-tags", children: group.tags.map((tag) => /* @__PURE__ */ jsx(Tag, { label: tag, size: "small", variant: "solid" }, `${group.id}-${tag}`)) })
203
- ] }, group.id)) }) : null
204
- ] }) : null
205
- ] });
206
- }
207
- return /* @__PURE__ */ jsx(
208
- "div",
209
- {
210
- "aria-label": t("chatBot.irisThinking"),
211
- "aria-live": phase === "complete" ? "off" : "polite",
212
- className: `iris-thinking iris-thinking--${phase}`,
213
- children: body
214
- }
215
- );
216
- }
217
- export {
218
- IrisThinking
219
- };
@@ -1,17 +0,0 @@
1
- import { __exports as ArrowBack } from "../../../_virtual/ArrowBack.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(ArrowBack, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = ArrowBack.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = ArrowBack.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"
14
- }), "ArrowBack");
15
- export {
16
- default_1 as default
17
- };
@@ -1,17 +0,0 @@
1
- import { __exports as AttachFileOutlined } from "../../../_virtual/AttachFileOutlined.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(AttachFileOutlined, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = AttachFileOutlined.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = AttachFileOutlined.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"
14
- }), "AttachFileOutlined");
15
- export {
16
- default_1 as default
17
- };
@@ -1,17 +0,0 @@
1
- import { __exports as ContentCopyOutlined } from "../../../_virtual/ContentCopyOutlined.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(ContentCopyOutlined, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = ContentCopyOutlined.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = ContentCopyOutlined.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"
14
- }), "ContentCopyOutlined");
15
- export {
16
- default_1 as default
17
- };
@@ -1,17 +0,0 @@
1
- import { __exports as Menu } from "../../../_virtual/Menu.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(Menu, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = Menu.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = Menu.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"
14
- }), "Menu");
15
- export {
16
- default_1 as default
17
- };
@@ -1,17 +0,0 @@
1
- import { __exports as NorthRounded } from "../../../_virtual/NorthRounded.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(NorthRounded, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = NorthRounded.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = NorthRounded.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M5.71 9.7c.39.39 1.02.39 1.41 0L11 5.83V21c0 .55.45 1 1 1s1-.45 1-1V5.83l3.88 3.88c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 2.7a.9959.9959 0 0 0-1.41 0L5.71 8.29c-.39.39-.39 1.03 0 1.41"
14
- }), "NorthRounded");
15
- export {
16
- default_1 as default
17
- };
@@ -1,17 +0,0 @@
1
- import { __exports as RefreshOutlined } from "../../../_virtual/RefreshOutlined.js";
2
- import require$$0 from "@babel/runtime/helpers/interopRequireDefault";
3
- import { __require as requireCreateSvgIcon } from "./utils/createSvgIcon.js";
4
- import require$$2 from "react/jsx-runtime";
5
- var _interopRequireDefault = require$$0;
6
- Object.defineProperty(RefreshOutlined, "__esModule", {
7
- value: true
8
- });
9
- var default_1 = RefreshOutlined.default = void 0;
10
- var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
11
- var _jsxRuntime = require$$2;
12
- default_1 = RefreshOutlined.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", {
13
- d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"
14
- }), "RefreshOutlined");
15
- export {
16
- default_1 as default
17
- };