impact-nova 3.0.0-alpha.7 → 3.0.0-alpha.9

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 (103) hide show
  1. package/README.md +1 -1
  2. package/dist/components/data/expandable-list-item/sku-picker-chrome.d.ts +4 -0
  3. package/dist/components/data/expandable-list-item/sku-picker-chrome.js +37 -42
  4. package/dist/components/data-display/stereo-scatter/index.d.ts +2 -0
  5. package/dist/components/data-display/stereo-scatter/index.js +10 -0
  6. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.d.ts +41 -0
  7. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.js +178 -0
  8. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.d.ts +14 -0
  9. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.js +29 -0
  10. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.d.ts +23 -0
  11. package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.js +80 -0
  12. package/dist/components/data-display/stereo-scatter/internals/stereo-engine.d.ts +120 -0
  13. package/dist/components/data-display/stereo-scatter/internals/stereo-engine.js +519 -0
  14. package/dist/components/data-display/stereo-scatter/internals/stereo-math.d.ts +64 -0
  15. package/dist/components/data-display/stereo-scatter/internals/stereo-math.js +129 -0
  16. package/dist/components/data-display/stereo-scatter/internals/stereo-model.d.ts +37 -0
  17. package/dist/components/data-display/stereo-scatter/internals/stereo-model.js +71 -0
  18. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.d.ts +33 -0
  19. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.js +19 -0
  20. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.d.ts +4 -0
  21. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.js +19 -0
  22. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.d.ts +2 -0
  23. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.js +75 -0
  24. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.d.ts +2 -0
  25. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.js +149 -0
  26. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.d.ts +13 -0
  27. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.js +93 -0
  28. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.d.ts +2 -0
  29. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.js +62 -0
  30. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.d.ts +3 -0
  31. package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.js +41 -0
  32. package/dist/components/data-display/stereo-scatter/stereo-scatter.d.ts +12 -0
  33. package/dist/components/data-display/stereo-scatter/stereo-scatter.js +107 -0
  34. package/dist/components/data-display/stereo-scatter/stereo-scatter.stories-data.d.ts +11 -0
  35. package/dist/components/data-display/stereo-scatter/stereo-scatter.types.d.ts +69 -0
  36. package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.d.ts +13 -0
  37. package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.js +42 -0
  38. package/dist/components/feedback/tooltip/button-icon-tooltip.d.ts +3 -1
  39. package/dist/components/feedback/tooltip/button-icon-tooltip.js +22 -19
  40. package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.d.ts +5 -0
  41. package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.js +73 -0
  42. package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.d.ts +3 -0
  43. package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.js +25 -0
  44. package/dist/components/flows/iris-chat/index.d.ts +3 -1
  45. package/dist/components/flows/iris-chat/index.js +58 -53
  46. package/dist/components/flows/iris-chat/iris-chat-chrome.d.ts +39 -0
  47. package/dist/components/flows/iris-chat/iris-chat-chrome.js +325 -0
  48. package/dist/components/flows/iris-chat/iris-chat-close-animation.d.ts +12 -0
  49. package/dist/components/flows/iris-chat/iris-chat-close-animation.js +21 -0
  50. package/dist/components/flows/iris-chat/iris-chat-composer.js +266 -238
  51. package/dist/components/flows/iris-chat/iris-chat-context.d.ts +13 -0
  52. package/dist/components/flows/iris-chat/iris-chat-context.js +14 -10
  53. package/dist/components/flows/iris-chat/iris-chat-copy-feedback.d.ts +4 -0
  54. package/dist/components/flows/iris-chat/iris-chat-copy-feedback.js +16 -0
  55. package/dist/components/flows/iris-chat/iris-chat-frame.d.ts +31 -0
  56. package/dist/components/flows/iris-chat/iris-chat-frame.js +79 -0
  57. package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +1 -0
  58. package/dist/components/flows/iris-chat/iris-chat-icons.js +28 -15
  59. package/dist/components/flows/iris-chat/iris-chat-launch-animation.d.ts +11 -0
  60. package/dist/components/flows/iris-chat/iris-chat-launch-animation.js +35 -0
  61. package/dist/components/flows/iris-chat/iris-chat-markdown.js +70 -50
  62. package/dist/components/flows/iris-chat/iris-chat-menu.js +91 -86
  63. package/dist/components/flows/iris-chat/iris-chat-speech.d.ts +52 -0
  64. package/dist/components/flows/iris-chat/iris-chat-speech.js +121 -0
  65. package/dist/components/flows/iris-chat/iris-chat-thread.d.ts +3 -0
  66. package/dist/components/flows/iris-chat/iris-chat-thread.js +241 -190
  67. package/dist/components/flows/iris-chat/iris-chat-window-chrome.d.ts +30 -0
  68. package/dist/components/flows/iris-chat/iris-chat-window-chrome.js +34 -0
  69. package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.d.ts +14 -0
  70. package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.js +15 -0
  71. package/dist/components/flows/iris-chat/iris-chat-window-geometry.d.ts +12 -0
  72. package/dist/components/flows/iris-chat/iris-chat-window-geometry.js +113 -0
  73. package/dist/components/flows/iris-chat/iris-chat-window-handles.d.ts +6 -0
  74. package/dist/components/flows/iris-chat/iris-chat-window-handles.js +50 -0
  75. package/dist/components/flows/iris-chat/iris-chat-window-shell.d.ts +8 -0
  76. package/dist/components/flows/iris-chat/iris-chat-window-shell.js +37 -0
  77. package/dist/components/flows/iris-chat/iris-chat.d.ts +3 -39
  78. package/dist/components/flows/iris-chat/iris-chat.js +22 -330
  79. package/dist/components/flows/iris-chat/iris-chat.types.d.ts +18 -0
  80. package/dist/components/flows/iris-chat/iris-chat.variants.d.ts +3 -3
  81. package/dist/components/flows/iris-chat/iris-chat.variants.js +21 -16
  82. package/dist/components/flows/iris-chat/use-iris-chat-root.d.ts +26 -0
  83. package/dist/components/flows/iris-chat/use-iris-chat-root.js +140 -0
  84. package/dist/components/forms/choice-card/choice-card.d.ts +1 -0
  85. package/dist/components/forms/choice-card/choice-card.js +183 -186
  86. package/dist/components/layout/header/header.js +1 -0
  87. package/dist/form-react/Fields/SelectField.js +66 -57
  88. package/dist/form-react/Fields/VirtualizedListField.js +140 -96
  89. package/dist/form-react/index.d.ts +1 -1
  90. package/dist/form-react/types/fields.types.d.ts +27 -0
  91. package/dist/form-react/types/reactHookForm.types.d.ts +18 -1
  92. package/dist/i18n/defaultMessages.d.ts +37 -0
  93. package/dist/i18n/defaultMessages.js +54 -18
  94. package/dist/i18n/index.d.ts +1 -1
  95. package/dist/i18n/locales/de.js +36 -0
  96. package/dist/i18n/locales/es.js +36 -0
  97. package/dist/i18n/locales/hi.js +36 -0
  98. package/dist/i18n/locales/kn.js +36 -0
  99. package/dist/impact-nova-components.css +19 -0
  100. package/dist/impact-nova.css +1 -1
  101. package/dist/llms/rules/installation.js +1 -1
  102. package/dist/llms/rules/requirements.js +1 -1
  103. package/package.json +5 -1
@@ -1,70 +1,85 @@
1
- import { jsxs as o, jsx as e, Fragment as W } from "react/jsx-runtime";
2
- import { useState as x } from "react";
3
- import { Cross as U, ChevronRight as z } from "impact-nova-icons";
4
- import { Popover as K, PopoverTrigger as H, PopoverContent as L, PopoverHeader as R, PopoverTitle as V, PopoverBody as q } from "../../feedback/popover/popover.js";
5
- import { ButtonIconTooltip as g } from "../../feedback/tooltip/button-icon-tooltip.js";
6
- import { Alert as J, AlertIcon as Q, AlertTitle as X, AlertDescription as Y } from "../../feedback/alert/alert.js";
7
- import { Button as p } from "../../primitives/button/button.js";
8
- import { IrisAlanGradientIcon as _ } from "../../primitives/iris/iris-alan-gradient-icon.js";
9
- import { useImpactNovaI18n as b } from "../../../i18n/use-impact-nova-i18n.js";
10
- import { createComponent as d } from "../../../lib/primitives/create-component.js";
11
- import { cn as c } from "../../../lib/utils.js";
12
- import { IrisChatLikeIcon as Z, IrisChatDislikeIcon as E, IrisChatCopyIcon as $, IrisChatSpeakIcon as ee, IrisChatRetryIcon as te, IrisChatAttachIcon as ae, IrisChatSuggestIcon as re } from "./iris-chat-icons.js";
13
- import { useIrisChatOptional as se } from "./iris-chat-context.js";
14
- import { irisChatMessageVariants as ie } from "./iris-chat.variants.js";
15
- import { readIrisGreetingPeriod as ne, readIrisGreetingMark as oe, readIrisGreetingMessageKey as le } from "./read-iris-greeting-period.js";
16
- const we = d(
1
+ import { jsxs as l, jsx as e, Fragment as J } from "react/jsx-runtime";
2
+ import { useState as x, useRef as Q, useEffect as X } from "react";
3
+ import { Cross as Z, ChevronRight as P } from "impact-nova-icons";
4
+ import { Popover as $, PopoverTrigger as ee, PopoverContent as te, PopoverHeader as ae, PopoverTitle as re, PopoverBody as se } from "../../feedback/popover/popover.js";
5
+ import { ButtonIconTooltip as C } from "../../feedback/tooltip/button-icon-tooltip.js";
6
+ import { Alert as ie, AlertIcon as ne, AlertTitle as oe, AlertDescription as le } from "../../feedback/alert/alert.js";
7
+ import { Button as u } from "../../primitives/button/button.js";
8
+ import { IrisAlanGradientIcon as T } from "../../primitives/iris/iris-alan-gradient-icon.js";
9
+ import { useImpactNovaI18n as v } from "../../../i18n/use-impact-nova-i18n.js";
10
+ import { createComponent as m } from "../../../lib/primitives/create-component.js";
11
+ import { cn as o } from "../../../lib/utils.js";
12
+ import { IrisChatLikeIcon as ce, IrisChatDislikeIcon as D, IrisChatCheckIcon as de, IrisChatCopyIcon as me, IrisChatSpeakIcon as he, IrisChatRetryIcon as pe, IrisChatAttachIcon as ue, IrisChatSuggestIcon as fe } from "./iris-chat-icons.js";
13
+ import { irisChatActionIconPressClassName as N, irisChatCopySuccessClassName as be, writeIrisChatClipboardText as ge, IRIS_CHAT_COPY_FEEDBACK_MS as xe } from "./iris-chat-copy-feedback.js";
14
+ import { readIrisChatActionsSpeakText as Ce, cancelPlainTextSpeech as Ie, speakPlainText as ke } from "./iris-chat-speech.js";
15
+ import { useIrisChatOptional as Ne } from "./iris-chat-context.js";
16
+ import { readIrisChatGreetingCompact as ve, readIrisChatGreetingShowSubtitle as we, readIrisChatGreetingIconSize as ye } from "./iris-chat-window-chrome.js";
17
+ import { irisChatMessageVariants as ze } from "./iris-chat.variants.js";
18
+ import { readIrisGreetingPeriod as _e, readIrisGreetingMark as Ae, readIrisGreetingMessageKey as Se } from "./read-iris-greeting-period.js";
19
+ const Je = m(
17
20
  "IrisChatGreeting",
18
- ({ className: s, name: a, greeting: t, subtitle: r, children: n, mark: l }, u) => {
19
- const { t: f } = b(), C = se(), m = C?.placement === "minimized" || C?.placement === "composer", I = ne(), w = l ?? oe(), i = t ?? f(le(I)), k = m ? "text-lg font-semibold leading-6 text-content" : "text-[26px] font-semibold leading-[46.8px] text-content", v = m ? "bg-clip-text text-lg font-extrabold leading-6 text-transparent" : "bg-clip-text text-[26px] font-extrabold leading-[46.8px] text-transparent";
20
- return /* @__PURE__ */ o(
21
+ ({ className: s, name: a, greeting: t, subtitle: r, children: n, mark: d }, b) => {
22
+ const { t: f } = v(), c = Ne(), h = c != null ? ve({
23
+ isWindowPlacement: c.isWindowPlacement,
24
+ placement: c.placement,
25
+ frame: c.frame
26
+ }) : !1, I = c != null ? we({
27
+ isWindowPlacement: c.isWindowPlacement,
28
+ frame: c.frame
29
+ }) : !0, z = c != null ? ye({
30
+ isWindowPlacement: c.isWindowPlacement,
31
+ placement: c.placement,
32
+ frame: c.frame,
33
+ compact: h
34
+ }) : h ? 56 : 84, y = _e(), _ = d ?? Ae(), A = t ?? f(Se(y)), i = h ? "text-lg font-semibold leading-6 text-content" : "text-[26px] font-semibold leading-[46.8px] text-content", g = h ? "bg-clip-text text-lg font-extrabold leading-6 text-transparent" : "bg-clip-text text-[26px] font-extrabold leading-[46.8px] text-transparent";
35
+ return /* @__PURE__ */ l(
21
36
  "div",
22
37
  {
23
- ref: u,
38
+ ref: b,
24
39
  "data-component": "iris-chat-greeting",
25
- "data-compact": m ? "" : void 0,
26
- className: c(
40
+ "data-compact": h ? "" : void 0,
41
+ className: o(
27
42
  "relative flex flex-col items-center justify-center text-center",
28
- m ? "gap-1.5 py-4" : "gap-2 py-8",
43
+ h ? "gap-1.5 py-2" : "gap-2 py-8",
29
44
  "bg-[radial-gradient(ellipse_80%_70%_at_50%_45%,var(--color-iris-menu-surface-from),transparent_70%),radial-gradient(ellipse_70%_50%_at_50%_85%,color-mix(in_srgb,var(--color-iris-control-glow-cyan)_16%,transparent),transparent_72%)]",
30
45
  s
31
46
  ),
32
47
  children: [
33
- /* @__PURE__ */ e(_, { size: m ? 56 : 84 }),
34
- /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center justify-center gap-1", children: [
35
- /* @__PURE__ */ e("p", { className: k, children: i }),
48
+ /* @__PURE__ */ e(T, { size: z }),
49
+ /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center justify-center gap-1", children: [
50
+ /* @__PURE__ */ e("p", { className: i, children: A }),
36
51
  a ? /* @__PURE__ */ e(
37
52
  "p",
38
53
  {
39
- className: v,
54
+ className: g,
40
55
  style: {
41
56
  backgroundImage: "linear-gradient(90deg, var(--color-header-bot-gradient-orange), var(--color-header-bot-gradient-purple))"
42
57
  },
43
58
  children: a
44
59
  }
45
60
  ) : null,
46
- /* @__PURE__ */ e("span", { "aria-hidden": !0, className: m ? "text-base" : "text-[23px]", children: w })
61
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, className: h ? "text-base" : "text-[23px]", children: _ })
47
62
  ] }),
48
- /* @__PURE__ */ e(
63
+ I ? /* @__PURE__ */ e(
49
64
  "p",
50
65
  {
51
- className: m ? "max-w-[20rem] text-sm font-medium leading-5 text-content-caption" : "text-base font-medium leading-5 text-content-caption",
66
+ className: h ? "max-w-[20rem] text-sm font-medium leading-5 text-content-caption" : "text-base font-medium leading-5 text-content-caption",
52
67
  children: r ?? f("irisChat.greetingSubtitle")
53
68
  }
54
- ),
69
+ ) : null,
55
70
  n
56
71
  ]
57
72
  }
58
73
  );
59
74
  }
60
- ), ze = d("IrisChatSuggestions", ({ className: s, children: a, ...t }, r) => {
61
- const { t: n } = b();
62
- return /* @__PURE__ */ o(
75
+ ), Qe = m("IrisChatSuggestions", ({ className: s, children: a, ...t }, r) => {
76
+ const { t: n } = v();
77
+ return /* @__PURE__ */ l(
63
78
  "div",
64
79
  {
65
80
  ref: r,
66
81
  "data-component": "iris-chat-suggestions",
67
- className: c(
82
+ className: o(
68
83
  "flex flex-col gap-2 bg-[radial-gradient(ellipse_at_center,color-mix(in_srgb,var(--color-iris-control-glow-cyan)_12%,transparent),transparent_72%)] pb-6",
69
84
  s
70
85
  ),
@@ -75,77 +90,77 @@ const we = d(
75
90
  ]
76
91
  }
77
92
  );
78
- }), _e = d(
93
+ }), Xe = m(
79
94
  "IrisChatSuggestion",
80
- ({ className: s, children: a, type: t = "button", ...r }, n) => /* @__PURE__ */ o(
95
+ ({ className: s, children: a, type: t = "button", ...r }, n) => /* @__PURE__ */ l(
81
96
  "button",
82
97
  {
83
98
  ref: n,
84
99
  type: t,
85
100
  "data-component": "iris-chat-suggestion",
86
- className: c(
101
+ className: o(
87
102
  "flex h-8 items-center gap-1 rounded-md px-2 text-start text-sm font-medium leading-5 text-content-secondary hover:bg-accent",
88
103
  s
89
104
  ),
90
105
  ...r,
91
106
  children: [
92
- /* @__PURE__ */ e(re, { size: 14 }),
107
+ /* @__PURE__ */ e(fe, { size: 14 }),
93
108
  /* @__PURE__ */ e("span", { className: "truncate", children: a })
94
109
  ]
95
110
  }
96
111
  )
97
- ), Ae = d("IrisChatWorkflows", ({ className: s, children: a, onShowMore: t, ...r }, n) => {
98
- const { t: l } = b();
99
- return /* @__PURE__ */ o(
112
+ ), Ze = m("IrisChatWorkflows", ({ className: s, children: a, onShowMore: t, ...r }, n) => {
113
+ const { t: d } = v();
114
+ return /* @__PURE__ */ l(
100
115
  "div",
101
116
  {
102
117
  ref: n,
103
118
  "data-component": "iris-chat-workflows",
104
- className: c("flex flex-col gap-2 pb-6", s),
119
+ className: o("flex flex-col gap-2 pb-6", s),
105
120
  ...r,
106
121
  children: [
107
- /* @__PURE__ */ e("p", { className: "text-xs font-medium capitalize leading-4 text-content-secondary", children: l("irisChat.suggestedWorkflows") }),
122
+ /* @__PURE__ */ e("p", { className: "text-xs font-medium capitalize leading-4 text-content-secondary", children: d("irisChat.suggestedWorkflows") }),
108
123
  /* @__PURE__ */ e("div", { className: "flex flex-col", children: a }),
109
- t ? /* @__PURE__ */ o(
110
- p,
124
+ t ? /* @__PURE__ */ l(
125
+ u,
111
126
  {
112
127
  type: "button",
113
128
  variant: "link",
114
129
  className: "h-auto justify-start px-0 text-sm",
115
130
  onClick: t,
116
131
  children: [
117
- l("irisChat.showMore"),
118
- /* @__PURE__ */ e(z, { size: 16, className: "rotate-90" })
132
+ d("irisChat.showMore"),
133
+ /* @__PURE__ */ e(P, { size: 16, className: "rotate-90" })
119
134
  ]
120
135
  }
121
136
  ) : null
122
137
  ]
123
138
  }
124
139
  );
125
- }), Se = d(
140
+ }), $e = m(
126
141
  "IrisChatWorkflow",
127
- ({ className: s, title: a, description: t, type: r = "button", ...n }, l) => /* @__PURE__ */ o(
142
+ ({ className: s, title: a, description: t, type: r = "button", ...n }, d) => /* @__PURE__ */ l(
128
143
  "button",
129
144
  {
130
- ref: l,
145
+ ref: d,
131
146
  type: r,
132
147
  "data-component": "iris-chat-workflow",
133
- className: c(
148
+ className: o(
134
149
  "flex items-center gap-2 rounded-md py-2 text-start hover:bg-accent",
135
150
  s
136
151
  ),
137
152
  ...n,
138
153
  children: [
139
- /* @__PURE__ */ e(_, { size: 16 }),
140
- /* @__PURE__ */ o("span", { className: "min-w-0 flex-1", children: [
154
+ /* @__PURE__ */ e(T, { size: 16 }),
155
+ /* @__PURE__ */ l("span", { className: "min-w-0 flex-1", children: [
141
156
  /* @__PURE__ */ e("span", { className: "block truncate text-sm font-medium text-content", children: a }),
142
157
  t ? /* @__PURE__ */ e("span", { className: "block truncate text-xs text-content-caption", children: t }) : null
143
158
  ] }),
144
- /* @__PURE__ */ e(z, { size: 16, className: "text-content-secondary" })
159
+ /* @__PURE__ */ e(P, { size: 16, className: "text-content-secondary" })
145
160
  ]
146
161
  }
147
162
  )
148
- ), Te = d(
163
+ ), et = m(
149
164
  "IrisChatThread",
150
165
  ({ className: s, ...a }, t) => /* @__PURE__ */ e(
151
166
  "div",
@@ -155,37 +170,37 @@ const we = d(
155
170
  role: "log",
156
171
  "aria-live": "polite",
157
172
  "aria-relevant": "additions",
158
- className: c("flex min-w-0 w-full flex-col gap-4 py-4", s),
173
+ className: o("flex min-w-0 w-full flex-col gap-4 py-4", s),
159
174
  ...a
160
175
  }
161
176
  )
162
- ), je = d(
177
+ ), tt = m(
163
178
  "IrisChatDay",
164
179
  ({ className: s, children: a, ...t }, r) => /* @__PURE__ */ e(
165
180
  "div",
166
181
  {
167
182
  ref: r,
168
183
  "data-component": "iris-chat-day",
169
- className: c("flex justify-center", s),
184
+ className: o("flex justify-center", s),
170
185
  ...t,
171
186
  children: /* @__PURE__ */ e("span", { className: "rounded-full bg-secondary px-3 py-1 text-xs font-medium text-content-secondary", children: a })
172
187
  }
173
188
  )
174
- ), Pe = d(
189
+ ), at = m(
175
190
  "IrisChatMessage",
176
- ({ className: s, role: a, time: t, framed: r, children: n, ...l }, u) => /* @__PURE__ */ e(
191
+ ({ className: s, role: a, time: t, framed: r, children: n, ...d }, b) => /* @__PURE__ */ e(
177
192
  "article",
178
193
  {
179
- ref: u,
194
+ ref: b,
180
195
  "data-component": "iris-chat-message",
181
196
  "data-role": a,
182
- className: c(
197
+ className: o(
183
198
  "flex min-w-0 w-full flex-col gap-1",
184
199
  a === "user" ? "items-end" : "items-start",
185
200
  s
186
201
  ),
187
- ...l,
188
- children: /* @__PURE__ */ o("div", { "data-slot": "bubble", className: ie({ role: a, framed: r }), children: [
202
+ ...d,
203
+ children: /* @__PURE__ */ l("div", { "data-slot": "bubble", className: ze({ role: a, framed: r }), children: [
189
204
  n,
190
205
  t ? /* @__PURE__ */ e(
191
206
  "time",
@@ -197,118 +212,137 @@ const we = d(
197
212
  ] })
198
213
  }
199
214
  )
200
- ), ce = ["notAsked", "tone", "incorrect", "other"], Ee = d(
215
+ ), Pe = ["notAsked", "tone", "incorrect", "other"], rt = m(
201
216
  "IrisChatActions",
202
217
  ({
203
218
  className: s,
204
219
  liked: a,
205
220
  disliked: t,
206
221
  copyText: r,
207
- onLike: n,
208
- onDislike: l,
209
- onCopy: u,
210
- onRetry: f,
211
- onSpeak: C,
212
- onFeedback: m,
213
- ...I
214
- }, w) => {
215
- const { t: i } = b(), [k, v] = x(!1), [N, y] = x(!1), [G, A] = x(!1), [S, F] = x("notAsked"), [T, j] = x(""), [M, P] = x(!1), O = {
222
+ speakText: n,
223
+ speechLocale: d,
224
+ onLike: b,
225
+ onDislike: f,
226
+ onCopy: c,
227
+ onRetry: h,
228
+ onSpeak: I,
229
+ onSpeechNotice: z,
230
+ onFeedback: y,
231
+ ..._
232
+ }, A) => {
233
+ const { t: i } = v(), [g, W] = x(!1), [R, S] = x(!1), k = Q(null);
234
+ X(
235
+ () => () => {
236
+ k.current !== null && window.clearTimeout(k.current);
237
+ },
238
+ []
239
+ );
240
+ const [w, E] = x(!1), [K, G] = x(!1), [O, U] = x("notAsked"), [j, F] = x(""), [H, B] = x(!1), L = {
216
241
  notAsked: i("irisChat.feedbackNotAsked"),
217
242
  tone: i("irisChat.feedbackTone"),
218
243
  incorrect: i("irisChat.feedbackIncorrect"),
219
244
  other: i("irisChat.feedbackOther")
220
- }, B = () => {
221
- r && navigator.clipboard?.writeText(r).catch(() => {
222
- }), u?.(), v(!0), window.setTimeout(() => v(!1), 1600);
223
- }, D = () => {
224
- if (C) {
225
- C();
245
+ }, M = Ce({ speakText: n, copyText: r }), V = M.length > 0 || !!I, Y = () => {
246
+ (async () => {
247
+ if (!r) {
248
+ c?.();
249
+ return;
250
+ }
251
+ await ge(r) && (c?.(), W(!0), S(!0), k.current !== null && window.clearTimeout(k.current), k.current = window.setTimeout(() => {
252
+ W(!1), S(!1), k.current = null;
253
+ }, xe));
254
+ })();
255
+ }, q = () => {
256
+ if (I) {
257
+ I();
226
258
  return;
227
259
  }
228
- if (!r || typeof window.speechSynthesis > "u")
229
- return;
230
- if (N) {
231
- window.speechSynthesis.cancel(), y(!1);
260
+ if (w) {
261
+ Ie(), E(!1);
232
262
  return;
233
263
  }
234
- const h = new SpeechSynthesisUtterance(r);
235
- h.onend = () => y(!1), h.onerror = () => y(!1), window.speechSynthesis.speak(h), y(!0);
264
+ ke({
265
+ text: n ?? r ?? "",
266
+ locale: d,
267
+ onSpeakingChange: E,
268
+ onNotice: z
269
+ });
236
270
  };
237
- return /* @__PURE__ */ o(
271
+ return /* @__PURE__ */ l(
238
272
  "div",
239
273
  {
240
- ref: w,
274
+ ref: A,
241
275
  "data-component": "iris-chat-actions",
242
- className: c("flex items-center gap-0.5", s),
243
- ...I,
276
+ className: o("flex items-center gap-0.5", s),
277
+ ..._,
244
278
  children: [
245
- /* @__PURE__ */ e(g, { label: i("irisChat.like"), children: /* @__PURE__ */ e(
246
- p,
279
+ /* @__PURE__ */ e(C, { label: i("irisChat.like"), children: /* @__PURE__ */ e(
280
+ u,
247
281
  {
248
282
  type: "button",
249
283
  variant: "ghost",
250
284
  size: "icon",
251
285
  "aria-label": i("irisChat.like"),
252
286
  "aria-pressed": a,
253
- className: c(a && "text-brand"),
254
- onClick: n,
255
- children: /* @__PURE__ */ e(Z, { size: 16 })
287
+ className: o(N, a && "text-brand bg-brand-subtle"),
288
+ onClick: b,
289
+ children: /* @__PURE__ */ e(ce, { size: 16 })
256
290
  }
257
291
  ) }),
258
- m ? /* @__PURE__ */ o(
259
- K,
292
+ y ? /* @__PURE__ */ l(
293
+ $,
260
294
  {
261
- open: G,
262
- onOpenChange: (h) => {
263
- A(h), h || (P(!1), j(""));
295
+ open: K,
296
+ onOpenChange: (p) => {
297
+ G(p), p || (B(!1), F(""));
264
298
  },
265
299
  children: [
266
- /* @__PURE__ */ e(g, { label: i("irisChat.dislike"), children: /* @__PURE__ */ e(H, { asChild: !0, children: /* @__PURE__ */ e(
267
- p,
300
+ /* @__PURE__ */ e(C, { label: i("irisChat.dislike"), children: /* @__PURE__ */ e(ee, { asChild: !0, children: /* @__PURE__ */ e(
301
+ u,
268
302
  {
269
303
  type: "button",
270
304
  variant: "ghost",
271
305
  size: "icon",
272
306
  "aria-label": i("irisChat.dislike"),
273
307
  "aria-pressed": t,
274
- className: c(t && "text-brand"),
275
- onClick: l,
276
- children: /* @__PURE__ */ e(E, { size: 16 })
308
+ className: o(N, t && "text-brand bg-brand-subtle"),
309
+ onClick: f,
310
+ children: /* @__PURE__ */ e(D, { size: 16 })
277
311
  }
278
312
  ) }) }),
279
- /* @__PURE__ */ e(L, { align: "start", side: "top", className: "w-[320px] rounded-xl p-4", children: M ? /* @__PURE__ */ e("p", { className: "text-sm font-medium text-content", children: i("irisChat.feedbackThanks") }) : /* @__PURE__ */ o(W, { children: [
280
- /* @__PURE__ */ e(R, { className: "mb-3", children: /* @__PURE__ */ e(V, { className: "text-sm font-semibold", children: i("irisChat.feedbackTitle") }) }),
281
- /* @__PURE__ */ o(q, { className: "flex flex-col gap-3", children: [
282
- /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: ce.map((h) => /* @__PURE__ */ e(
313
+ /* @__PURE__ */ e(te, { align: "start", side: "top", className: "w-[320px] rounded-xl p-4", children: H ? /* @__PURE__ */ e("p", { className: "text-sm font-medium text-content", children: i("irisChat.feedbackThanks") }) : /* @__PURE__ */ l(J, { children: [
314
+ /* @__PURE__ */ e(ae, { className: "mb-3", children: /* @__PURE__ */ e(re, { className: "text-sm font-semibold", children: i("irisChat.feedbackTitle") }) }),
315
+ /* @__PURE__ */ l(se, { className: "flex flex-col gap-3", children: [
316
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: Pe.map((p) => /* @__PURE__ */ e(
283
317
  "button",
284
318
  {
285
319
  type: "button",
286
- className: c(
320
+ className: o(
287
321
  "rounded-full border px-3 py-1 text-xs font-medium",
288
- S === h ? "border-brand bg-brand-subtle text-brand" : "border-stroke-subtle text-content"
322
+ O === p ? "border-brand bg-brand-subtle text-brand" : "border-stroke-subtle text-content"
289
323
  ),
290
- onClick: () => F(h),
291
- children: O[h]
324
+ onClick: () => U(p),
325
+ children: L[p]
292
326
  },
293
- h
327
+ p
294
328
  )) }),
295
329
  /* @__PURE__ */ e(
296
330
  "textarea",
297
331
  {
298
- value: T,
332
+ value: j,
299
333
  placeholder: i("irisChat.feedbackPlaceholder"),
300
334
  className: "min-h-16 w-full resize-none rounded-lg border border-stroke-subtle bg-transparent px-3 py-2 text-sm outline-none",
301
- onChange: (h) => j(h.target.value)
335
+ onChange: (p) => F(p.target.value)
302
336
  }
303
337
  ),
304
338
  /* @__PURE__ */ e(
305
- p,
339
+ u,
306
340
  {
307
341
  type: "button",
308
342
  size: "sm",
309
343
  className: "self-end",
310
344
  onClick: () => {
311
- m({ reason: S, details: T }), P(!0), window.setTimeout(() => A(!1), 1200);
345
+ y({ reason: O, details: j }), B(!0), window.setTimeout(() => G(!1), 1200);
312
346
  },
313
347
  children: i("irisChat.feedbackSubmit")
314
348
  }
@@ -317,139 +351,156 @@ const we = d(
317
351
  ] }) })
318
352
  ]
319
353
  }
320
- ) : /* @__PURE__ */ e(g, { label: i("irisChat.dislike"), children: /* @__PURE__ */ e(
321
- p,
354
+ ) : /* @__PURE__ */ e(C, { label: i("irisChat.dislike"), children: /* @__PURE__ */ e(
355
+ u,
322
356
  {
323
357
  type: "button",
324
358
  variant: "ghost",
325
359
  size: "icon",
326
360
  "aria-label": i("irisChat.dislike"),
327
361
  "aria-pressed": t,
328
- className: c(t && "text-brand"),
329
- onClick: l,
330
- children: /* @__PURE__ */ e(E, { size: 16 })
362
+ className: o(N, t && "text-brand bg-brand-subtle"),
363
+ onClick: f,
364
+ children: /* @__PURE__ */ e(D, { size: 16 })
331
365
  }
332
366
  ) }),
333
- r || u ? /* @__PURE__ */ e(g, { label: i(k ? "irisChat.copied" : "irisChat.copy"), children: /* @__PURE__ */ e(
334
- p,
367
+ r || c ? /* @__PURE__ */ e(
368
+ C,
335
369
  {
336
- type: "button",
337
- variant: "ghost",
338
- size: "icon",
339
- "aria-label": i(k ? "irisChat.copied" : "irisChat.copy"),
340
- "data-testid": "iris-chat-copy",
341
- onClick: B,
342
- children: /* @__PURE__ */ e($, { size: 16 })
370
+ label: i(g ? "irisChat.copied" : "irisChat.copy"),
371
+ open: R,
372
+ onOpenChange: S,
373
+ children: /* @__PURE__ */ e(
374
+ u,
375
+ {
376
+ type: "button",
377
+ variant: "ghost",
378
+ size: "icon",
379
+ "aria-label": i(g ? "irisChat.copied" : "irisChat.copy"),
380
+ "data-testid": "iris-chat-copy",
381
+ "data-copied": g ? "" : void 0,
382
+ className: o(
383
+ N,
384
+ g && be
385
+ ),
386
+ onClick: Y,
387
+ children: g ? /* @__PURE__ */ e(de, { size: 16 }) : /* @__PURE__ */ e(me, { size: 16 })
388
+ }
389
+ )
343
390
  }
344
- ) }) : null,
345
- /* @__PURE__ */ e(g, { label: i(N ? "irisChat.stopSpeaking" : "irisChat.speak"), children: /* @__PURE__ */ e(
346
- p,
391
+ ) : null,
392
+ V ? /* @__PURE__ */ e(C, { label: i(w ? "irisChat.stopSpeaking" : "irisChat.speak"), children: /* @__PURE__ */ e(
393
+ u,
347
394
  {
348
395
  type: "button",
349
396
  variant: "ghost",
350
397
  size: "icon",
351
- "aria-label": i(N ? "irisChat.stopSpeaking" : "irisChat.speak"),
352
- "aria-pressed": N,
353
- onClick: D,
354
- children: /* @__PURE__ */ e(ee, { size: 16 })
398
+ "aria-label": i(w ? "irisChat.stopSpeaking" : "irisChat.speak"),
399
+ "aria-pressed": w,
400
+ "data-testid": "iris-chat-speak",
401
+ disabled: !I && M.length === 0,
402
+ className: o(N, w && "text-brand bg-brand-subtle"),
403
+ onClick: q,
404
+ children: /* @__PURE__ */ e(he, { size: 16 })
355
405
  }
356
- ) }),
357
- f ? /* @__PURE__ */ e(g, { label: i("irisChat.retry"), children: /* @__PURE__ */ e(
358
- p,
406
+ ) }) : null,
407
+ h ? /* @__PURE__ */ e(C, { label: i("irisChat.retry"), children: /* @__PURE__ */ e(
408
+ u,
359
409
  {
360
410
  type: "button",
361
411
  variant: "ghost",
362
412
  size: "icon",
363
413
  "aria-label": i("irisChat.retry"),
364
414
  "data-testid": "iris-chat-retry",
365
- onClick: f,
366
- children: /* @__PURE__ */ e(te, { size: 16 })
415
+ className: N,
416
+ onClick: h,
417
+ children: /* @__PURE__ */ e(pe, { size: 16 })
367
418
  }
368
419
  ) }) : null
369
420
  ]
370
421
  }
371
422
  );
372
423
  }
373
- ), Ge = d(
424
+ ), st = m(
374
425
  "IrisChatFollowUps",
375
426
  ({ className: s, ...a }, t) => /* @__PURE__ */ e(
376
427
  "div",
377
428
  {
378
429
  ref: t,
379
430
  "data-component": "iris-chat-follow-ups",
380
- className: c("flex w-full flex-col overflow-hidden rounded-xl border border-stroke-subtle", s),
431
+ className: o("flex w-full flex-col overflow-hidden rounded-xl border border-stroke-subtle", s),
381
432
  ...a
382
433
  }
383
434
  )
384
- ), Fe = d(
435
+ ), it = m(
385
436
  "IrisChatFollowUp",
386
- ({ className: s, children: a, type: t = "button", ...r }, n) => /* @__PURE__ */ o(
437
+ ({ className: s, children: a, type: t = "button", ...r }, n) => /* @__PURE__ */ l(
387
438
  "button",
388
439
  {
389
440
  ref: n,
390
441
  type: t,
391
442
  "data-component": "iris-chat-follow-up",
392
- className: c(
443
+ className: o(
393
444
  "flex w-full items-center justify-between gap-3 border-b border-stroke-subtle px-3 py-2.5 text-start text-sm last:border-b-0 hover:bg-accent",
394
445
  s
395
446
  ),
396
447
  ...r,
397
448
  children: [
398
- /* @__PURE__ */ o("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
399
- /* @__PURE__ */ e(_, { size: 14 }),
449
+ /* @__PURE__ */ l("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
450
+ /* @__PURE__ */ e(T, { size: 14 }),
400
451
  /* @__PURE__ */ e("span", { className: "min-w-0 whitespace-normal", children: a })
401
452
  ] }),
402
- /* @__PURE__ */ e(z, { size: 16, className: "shrink-0 text-content-secondary" })
453
+ /* @__PURE__ */ e(P, { size: 16, className: "shrink-0 text-content-secondary" })
403
454
  ]
404
455
  }
405
456
  )
406
- ), Me = d(
457
+ ), nt = m(
407
458
  "IrisChatAttachment",
408
- ({ className: s, name: a, kind: t = "file", sizeLabel: r, previewUrl: n, onRemove: l }, u) => {
409
- const { t: f } = b();
410
- return /* @__PURE__ */ o(
459
+ ({ className: s, name: a, kind: t = "file", sizeLabel: r, previewUrl: n, onRemove: d }, b) => {
460
+ const { t: f } = v();
461
+ return /* @__PURE__ */ l(
411
462
  "div",
412
463
  {
413
- ref: u,
464
+ ref: b,
414
465
  "data-component": "iris-chat-attachment",
415
466
  "data-kind": t,
416
- className: c(
467
+ className: o(
417
468
  "flex max-w-full items-center gap-2 rounded-xl bg-canvas-elevated px-2 py-1.5 text-xs text-content",
418
469
  s
419
470
  ),
420
471
  children: [
421
- t === "image" && n ? /* @__PURE__ */ e("img", { src: n, alt: "", className: "size-10 shrink-0 rounded-lg object-cover" }) : /* @__PURE__ */ e(ae, { size: 14 }),
422
- /* @__PURE__ */ o("span", { className: "min-w-0", children: [
472
+ t === "image" && n ? /* @__PURE__ */ e("img", { src: n, alt: "", className: "size-10 shrink-0 rounded-lg object-cover" }) : /* @__PURE__ */ e(ue, { size: 14 }),
473
+ /* @__PURE__ */ l("span", { className: "min-w-0", children: [
423
474
  /* @__PURE__ */ e("span", { className: "block truncate font-medium", children: a }),
424
475
  r ? /* @__PURE__ */ e("span", { className: "block text-content-caption", children: r }) : null
425
476
  ] }),
426
- l ? /* @__PURE__ */ e(g, { label: f("irisChat.removeAttachment"), children: /* @__PURE__ */ e(
427
- p,
477
+ d ? /* @__PURE__ */ e(C, { label: f("irisChat.removeAttachment"), children: /* @__PURE__ */ e(
478
+ u,
428
479
  {
429
480
  type: "button",
430
481
  variant: "ghost",
431
482
  size: "icon",
432
483
  className: "size-6",
433
484
  "aria-label": f("irisChat.removeAttachment"),
434
- onClick: l,
435
- children: /* @__PURE__ */ e(U, { size: 12 })
485
+ onClick: d,
486
+ children: /* @__PURE__ */ e(Z, { size: 12 })
436
487
  }
437
488
  ) }) : null
438
489
  ]
439
490
  }
440
491
  );
441
492
  }
442
- ), Oe = d(
493
+ ), ot = m(
443
494
  "IrisChatError",
444
495
  ({ className: s, title: a, description: t, onRetry: r }, n) => {
445
- const { t: l } = b();
446
- return /* @__PURE__ */ e("div", { ref: n, "data-component": "iris-chat-error", className: c("w-full", s), children: /* @__PURE__ */ o(J, { variant: "error", children: [
447
- /* @__PURE__ */ e(Q, { variant: "error" }),
448
- /* @__PURE__ */ o("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
449
- /* @__PURE__ */ e(X, { children: a ?? l("irisChat.generationError") }),
450
- /* @__PURE__ */ e(Y, { children: t ?? l("irisChat.generationErrorBody") }),
496
+ const { t: d } = v();
497
+ return /* @__PURE__ */ e("div", { ref: n, "data-component": "iris-chat-error", className: o("w-full", s), children: /* @__PURE__ */ l(ie, { variant: "error", children: [
498
+ /* @__PURE__ */ e(ne, { variant: "error" }),
499
+ /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
500
+ /* @__PURE__ */ e(oe, { children: a ?? d("irisChat.generationError") }),
501
+ /* @__PURE__ */ e(le, { children: t ?? d("irisChat.generationErrorBody") }),
451
502
  r ? /* @__PURE__ */ e(
452
- p,
503
+ u,
453
504
  {
454
505
  type: "button",
455
506
  size: "sm",
@@ -457,13 +508,13 @@ const we = d(
457
508
  className: "w-fit",
458
509
  "data-testid": "iris-chat-error-retry",
459
510
  onClick: r,
460
- children: l("irisChat.retry")
511
+ children: d("irisChat.retry")
461
512
  }
462
513
  ) : null
463
514
  ] })
464
515
  ] }) });
465
516
  }
466
- ), Be = d(
517
+ ), lt = m(
467
518
  "IrisChatChip",
468
519
  ({ className: s, type: a = "button", variant: t = "default", ...r }, n) => /* @__PURE__ */ e(
469
520
  "button",
@@ -472,7 +523,7 @@ const we = d(
472
523
  type: a,
473
524
  "data-component": "iris-chat-chip",
474
525
  "data-variant": t,
475
- className: c(
526
+ className: o(
476
527
  "rounded-full px-3 py-1.5 text-sm font-medium leading-5 disabled:pointer-events-none disabled:opacity-50",
477
528
  t === "outline" ? "border border-stroke bg-canvas text-content hover:bg-accent" : "border border-stroke-subtle bg-secondary text-content hover:bg-accent",
478
529
  s
@@ -482,18 +533,18 @@ const we = d(
482
533
  )
483
534
  );
484
535
  export {
485
- Ee as IrisChatActions,
486
- Me as IrisChatAttachment,
487
- Be as IrisChatChip,
488
- je as IrisChatDay,
489
- Oe as IrisChatError,
490
- Fe as IrisChatFollowUp,
491
- Ge as IrisChatFollowUps,
492
- we as IrisChatGreeting,
493
- Pe as IrisChatMessage,
494
- _e as IrisChatSuggestion,
495
- ze as IrisChatSuggestions,
496
- Te as IrisChatThread,
497
- Se as IrisChatWorkflow,
498
- Ae as IrisChatWorkflows
536
+ rt as IrisChatActions,
537
+ nt as IrisChatAttachment,
538
+ lt as IrisChatChip,
539
+ tt as IrisChatDay,
540
+ ot as IrisChatError,
541
+ it as IrisChatFollowUp,
542
+ st as IrisChatFollowUps,
543
+ Je as IrisChatGreeting,
544
+ at as IrisChatMessage,
545
+ Xe as IrisChatSuggestion,
546
+ Qe as IrisChatSuggestions,
547
+ et as IrisChatThread,
548
+ $e as IrisChatWorkflow,
549
+ Ze as IrisChatWorkflows
499
550
  };