impact-nova 3.0.0-alpha.17 → 3.0.0-alpha.19

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 (111) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +15 -0
  2. package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.d.ts +2 -0
  3. package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.js +15 -14
  4. package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.d.ts +10 -0
  5. package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.js +17 -0
  6. package/dist/components/data/ag-grid-react/cell-renderers/index.d.ts +45 -7
  7. package/dist/components/data/ag-grid-react/cell-renderers/index.js +70 -58
  8. package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.d.ts +5 -11
  9. package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.js +127 -51
  10. package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -56
  11. package/dist/components/data/ag-grid-react/index.d.ts +2 -1
  12. package/dist/components/data/ag-grid-react/index.js +315 -296
  13. package/dist/components/data/ag-grid-react/list-drag-grid-options.d.ts +14 -1
  14. package/dist/components/data/ag-grid-react/list-drag-grid-options.js +95 -31
  15. package/dist/components/data/ag-grid-react/list-drag-preview-card.d.ts +4 -0
  16. package/dist/components/data/ag-grid-react/list-drag-preview-card.js +14 -0
  17. package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.d.ts +20 -0
  18. package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.js +42 -0
  19. package/dist/components/data/ag-grid-react/list-find-highlight.d.ts +6 -0
  20. package/dist/components/data/ag-grid-react/list-find-highlight.js +7 -0
  21. package/dist/components/data/ag-grid-react/numeric-column-header-alignment.d.ts +9 -0
  22. package/dist/components/data/ag-grid-react/numeric-column-header-alignment.js +67 -0
  23. package/dist/components/data/ag-grid-react/process-backend-columndefs.d.ts +10 -2
  24. package/dist/components/data/ag-grid-react/process-backend-columndefs.js +84 -0
  25. package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.d.ts +10 -2
  26. package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.js +130 -107
  27. package/dist/components/data/ag-grid-react/use-list-drag-preview.d.ts +4 -1
  28. package/dist/components/data/ag-grid-react/use-list-drag-preview.js +131 -32
  29. package/dist/components/data/ag-grid-react/use-list-find.d.ts +36 -0
  30. package/dist/components/data/ag-grid-react/use-list-row-drop-zones.d.ts +2 -0
  31. package/dist/components/data/ag-grid-react/use-list-row-drop-zones.js +60 -41
  32. package/dist/components/data/data-table/data-table-list-header.js +1 -1
  33. package/dist/components/data/data-table/data-table-overlay.d.ts +6 -0
  34. package/dist/components/data/data-table/data-table-overlay.js +18 -0
  35. package/dist/components/data/data-table/data-table.types.d.ts +1 -0
  36. package/dist/components/data/data-table/index.d.ts +3 -0
  37. package/dist/components/data/data-table/index.js +67 -63
  38. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
  39. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
  40. package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.d.ts +2 -0
  41. package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.js +16 -0
  42. package/dist/components/data/scenario-comparison/index.d.ts +3 -0
  43. package/dist/components/data/scenario-comparison/index.js +6 -0
  44. package/dist/components/data/scenario-comparison/scenario-comparison-column.d.ts +12 -0
  45. package/dist/components/data/scenario-comparison/scenario-comparison-column.js +172 -0
  46. package/dist/components/data/scenario-comparison/scenario-comparison-label.d.ts +6 -0
  47. package/dist/components/data/scenario-comparison/scenario-comparison-label.js +64 -0
  48. package/dist/components/data/scenario-comparison/scenario-comparison.d.ts +5 -0
  49. package/dist/components/data/scenario-comparison/scenario-comparison.js +127 -0
  50. package/dist/components/data/scenario-comparison/scenario-comparison.types.d.ts +56 -0
  51. package/dist/components/data/scenario-comparison/scenario-comparison.variants.d.ts +7 -0
  52. package/dist/components/data/scenario-comparison/scenario-comparison.variants.js +29 -0
  53. package/dist/components/data-display/badge/index.d.ts +2 -0
  54. package/dist/components/data-display/badge/index.js +4 -2
  55. package/dist/components/data-display/badge/trophy-icon.d.ts +6 -0
  56. package/dist/components/data-display/badge/trophy-icon.js +28 -0
  57. package/dist/components/feedback/find-bar/collect-find-matches.d.ts +35 -0
  58. package/dist/components/feedback/find-bar/collect-find-matches.js +68 -0
  59. package/dist/components/feedback/find-bar/find-bar-shortcuts.d.ts +5 -0
  60. package/dist/components/feedback/find-bar/find-bar-shortcuts.js +27 -0
  61. package/dist/components/feedback/find-bar/find-bar.d.ts +7 -0
  62. package/dist/components/feedback/find-bar/find-bar.js +266 -0
  63. package/dist/components/feedback/find-bar/find-bar.types.d.ts +32 -0
  64. package/dist/components/feedback/find-bar/index.d.ts +4 -0
  65. package/dist/components/feedback/find-bar/index.js +11 -0
  66. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  67. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  68. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  69. package/dist/components/flows/iris-chat/iris-chat-composer.js +213 -184
  70. package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +1 -0
  71. package/dist/components/flows/iris-chat/iris-chat-icons.js +23 -10
  72. package/dist/components/flows/iris-chat/iris-chat.variants.js +4 -4
  73. package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.d.ts +6 -0
  74. package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.js +23 -0
  75. package/dist/components/forms/choice-card/choice-card-compare-scroll.d.ts +4 -0
  76. package/dist/components/forms/choice-card/choice-card-compare-scroll.js +6 -0
  77. package/dist/components/forms/choice-card/choice-card.d.ts +13 -2
  78. package/dist/components/forms/choice-card/choice-card.js +432 -342
  79. package/dist/components/forms/choice-card/choice-card.types.d.ts +9 -2
  80. package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
  81. package/dist/components/forms/select/components/Submenu.js +3 -2
  82. package/dist/components/primitives/tabs/folder-tab-path.d.ts +6 -0
  83. package/dist/components/primitives/tabs/folder-tab-path.js +16 -0
  84. package/dist/components/primitives/tabs/tabs.js +178 -112
  85. package/dist/components/primitives/tabs/tabs.types.d.ts +1 -1
  86. package/dist/i18n/defaultMessages.d.ts +19 -0
  87. package/dist/i18n/defaultMessages.js +54 -38
  88. package/dist/i18n/impact-nova-i18n-defaults.d.ts +5 -0
  89. package/dist/i18n/impact-nova-i18n-defaults.js +4 -9
  90. package/dist/i18n/index.d.ts +1 -1
  91. package/dist/i18n/locales/de.js +17 -1
  92. package/dist/i18n/locales/es.js +17 -1
  93. package/dist/i18n/locales/hi.js +17 -1
  94. package/dist/i18n/locales/kn.js +17 -1
  95. package/dist/impact-nova-components.css +189 -14
  96. package/dist/impact-nova-tokens.scss +2 -0
  97. package/dist/impact-nova.css +1 -1
  98. package/dist/index.d.ts +1 -0
  99. package/dist/index.js +621 -607
  100. package/dist/lib/virtualized/index.d.ts +2 -0
  101. package/dist/lib/virtualized/index.js +35 -31
  102. package/dist/lib/virtualized/list-index.d.ts +5 -0
  103. package/dist/lib/virtualized/list-index.js +13 -0
  104. package/dist/lib/virtualized/read-infinite-query-list.d.ts +14 -0
  105. package/dist/lib/virtualized/read-infinite-query-list.js +12 -0
  106. package/dist/lib/virtualized/types.d.ts +4 -2
  107. package/dist/lib/virtualized/useRowState.js +60 -56
  108. package/dist/lib/virtualized/useVirtualizedList.d.ts +5 -0
  109. package/dist/llms/rules/installation.js +1 -1
  110. package/dist/llms/rules/requirements.js +1 -1
  111. package/package.json +1 -1
@@ -2,17 +2,17 @@ import { jsx as r, jsxs as h, Fragment as z } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
3
  import { Person as G, Monitor as U, PriorityAlert as q, Locked as O, Reset as B } from "impact-nova-icons";
4
4
  import { cn as p } from "../../../lib/utils.js";
5
+ import { Kbd as $ } from "../../primitives/kbd/kbd.js";
6
+ import { keybindingToString as H } from "../../primitives/kbd/keybinding-display.js";
5
7
  import { OverflowTooltip as A } from "../../feedback/tooltip/overflow-tooltip.js";
6
- import { ModuleRegistry as $, AllCommunityModule as H } from "ag-grid-community";
7
- import { AllEnterpriseModule as V } from "ag-grid-enterprise";
8
- import { DataTable as J, DataTableContent as Q } from "../../data/data-table/data-table.js";
8
+ import { ModuleRegistry as V, AllCommunityModule as J } from "ag-grid-community";
9
+ import { AllEnterpriseModule as Q } from "ag-grid-enterprise";
10
+ import { DataTable as X, DataTableContent as Y } from "../../data/data-table/data-table.js";
9
11
  import { AG_CELL_NO_PADDING as F } from "../../data/ag-grid-react/cell-renderers/index.js";
10
- import { Kbd as X } from "../../primitives/kbd/kbd.js";
11
- import { keybindingToString as Y } from "../../primitives/kbd/keybinding-display.js";
12
12
  import { useCommandPalette as Z } from "./use-command-palette.js";
13
13
  import { COMMAND_SOURCE_LABELS as m, keybindingFromEvent as W, isReservedShortcut as ee } from "./utils.js";
14
14
  import { BadgeCellRenderer as te } from "../../data/ag-grid-react/cell-renderers/badge-cell-renderer.js";
15
- $.registerModules([H, V]);
15
+ V.registerModules([J, Q]);
16
16
  function re(a) {
17
17
  const t = a.data;
18
18
  return t ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
@@ -69,7 +69,7 @@ function ne(a) {
69
69
  "flex items-center justify-end h-full w-full text-end",
70
70
  t.customisable ? "cursor-pointer" : "cursor-default opacity-70"
71
71
  ),
72
- children: /* @__PURE__ */ r(X, { keybinding: t.keybinding, size: "sm" })
72
+ children: /* @__PURE__ */ r($, { keybinding: t.keybinding, size: "sm" })
73
73
  }
74
74
  ) : t.customisable ? /* @__PURE__ */ r(
75
75
  "button",
@@ -133,7 +133,7 @@ function le({
133
133
  description: e.description || "",
134
134
  category: e.category || "General",
135
135
  keybinding: i,
136
- keybindingDisplay: i ? Y(i) : "",
136
+ keybindingDisplay: i ? H(i) : "",
137
137
  scope: e.scope,
138
138
  source: D,
139
139
  sourceColor: T ? "primary" : "neutral",
@@ -278,10 +278,10 @@ function le({
278
278
  u?.type === "conflict" ? /* @__PURE__ */ r(q, { className: "h-3.5 w-3.5 shrink-0" }) : u?.type === "reserved" ? /* @__PURE__ */ r(O, { className: "h-3.5 w-3.5 shrink-0" }) : c ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
279
279
  /* @__PURE__ */ r("span", { children: u ? u.text : L })
280
280
  ] }) : null;
281
- return /* @__PURE__ */ h(J, { className: p("flex flex-col w-full h-full border-t-0", a), children: [
281
+ return /* @__PURE__ */ h(X, { className: p("flex flex-col w-full h-full border-t-0", a), children: [
282
282
  s ? s(E) : E,
283
283
  /* @__PURE__ */ r(
284
- Q,
284
+ Y,
285
285
  {
286
286
  rowData: y,
287
287
  columnDefs: I,
@@ -6,8 +6,8 @@ import { cn as o } from "../../../lib/utils.js";
6
6
  import { MultiColorFilter as F, Cross as P, InfoBadge as u } from "impact-nova-icons";
7
7
  import { Button as D } from "../../primitives/button/button.js";
8
8
  import { Tooltip as c, TooltipTrigger as f, TooltipContent as h } from "../../feedback/tooltip/tooltip.js";
9
- import { OverflowTooltip as S } from "../../feedback/tooltip/overflow-tooltip.js";
10
- import { Kbd as j } from "../../primitives/kbd/kbd.js";
9
+ import { Kbd as S } from "../../primitives/kbd/kbd.js";
10
+ import { OverflowTooltip as j } from "../../feedback/tooltip/overflow-tooltip.js";
11
11
  import { useImpactNovaI18n as v } from "../../../i18n/use-impact-nova-i18n.js";
12
12
  import { useOverlayHostDismissNestedLayersOnNavigation as I } from "../../../lib/overlay/overlay-portal-context.js";
13
13
  import { preventDismissOnTooltipOutside as x } from "../../../lib/overlay/prevent-dismiss-on-tooltip-outside.js";
@@ -145,14 +145,14 @@ const O = ({
145
145
  ),
146
146
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1 min-w-0", children: [
147
147
  /* @__PURE__ */ e(
148
- S,
148
+ j,
149
149
  {
150
150
  triggerClassName: "truncate font-['Manrope'] block min-w-0",
151
151
  content: t.tooltipKeybinding ? /* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
152
152
  t.label,
153
153
  " ",
154
154
  /* @__PURE__ */ e(
155
- j,
155
+ S,
156
156
  {
157
157
  keybinding: t.tooltipKeybinding,
158
158
  size: "sm"
@@ -1,254 +1,283 @@
1
- import { jsxs as s, jsx as t, Fragment as ge } from "react/jsx-runtime";
2
- import { useRef as C, useState as D, useEffect as Ce } from "react";
3
- import { ChevronRight as be } from "impact-nova-icons";
4
- import { ButtonIconTooltip as p } from "../../feedback/tooltip/button-icon-tooltip.js";
5
- import { Button as f } from "../../primitives/button/button.js";
6
- import { DropdownMenu as H, DropdownMenuTrigger as J, DropdownMenuContent as Q, DropdownMenuItem as X, DropdownMenuRadioGroup as ye, DropdownMenuRadioItem as ve } from "../../feedback/dropdown-menu/dropdown-menu.js";
7
- import { useImpactNovaI18n as xe } from "../../../i18n/use-impact-nova-i18n.js";
8
- import { useControllableState as Y } from "@radix-ui/react-use-controllable-state";
9
- import { createComponent as we } from "../../../lib/primitives/create-component.js";
10
- import { cn as Ie } from "../../../lib/utils.js";
11
- import { useIrisChatOptional as De } from "./iris-chat-context.js";
12
- import { readIrisChatComposerLayout as ke } from "./iris-chat-window-chrome.js";
13
- import { IrisChatAddIcon as Z, IrisChatAttachIcon as ze, IrisChatMicIcon as Re, IrisChatStopIcon as Ne, IrisChatSendIcon as Le } from "./iris-chat-icons.js";
14
- import { IrisChatAttachment as Se } from "./iris-chat-thread.js";
15
- import { IrisChatComposerVoiceCapture as Fe } from "./IrisChatComposerVoiceCapture.js";
16
- import { startComposerSpeechRecognition as Ae } from "./iris-chat-speech.js";
17
- import { irisChatComposerVariants as Ke } from "./iris-chat.variants.js";
18
- const Me = [
1
+ import { jsxs as s, jsx as t, Fragment as ze } from "react/jsx-runtime";
2
+ import { useRef as C, useState as g, useEffect as j } from "react";
3
+ import { ChevronRight as De } from "impact-nova-icons";
4
+ import { ButtonIconTooltip as d } from "../../feedback/tooltip/button-icon-tooltip.js";
5
+ import { Button as p } from "../../primitives/button/button.js";
6
+ import { DropdownMenu as Z, DropdownMenuTrigger as ee, DropdownMenuContent as te, DropdownMenuItem as re, DropdownMenuRadioGroup as Re, DropdownMenuRadioItem as Ne } from "../../feedback/dropdown-menu/dropdown-menu.js";
7
+ import { useImpactNovaI18n as ke } from "../../../i18n/use-impact-nova-i18n.js";
8
+ import { useControllableState as ae } from "@radix-ui/react-use-controllable-state";
9
+ import { createComponent as Le } from "../../../lib/primitives/create-component.js";
10
+ import { cn as ne } from "../../../lib/utils.js";
11
+ import { useIrisChatOptional as Ee } from "./iris-chat-context.js";
12
+ import { readIrisChatComposerLayout as Se } from "./iris-chat-window-chrome.js";
13
+ import { IrisChatComposerExpandIcon as Fe, IrisChatAddIcon as ie, IrisChatAttachIcon as Pe, IrisChatMicIcon as Me, IrisChatStopIcon as Oe, IrisChatSendIcon as Ue } from "./iris-chat-icons.js";
14
+ import { syncIrisChatComposerTextareaHeight as je, readIrisChatComposerExpandOffered as Ke } from "./sync-iris-chat-composer-textarea.js";
15
+ import { IrisChatAttachment as Te } from "./iris-chat-thread.js";
16
+ import { IrisChatComposerVoiceCapture as Ae } from "./IrisChatComposerVoiceCapture.js";
17
+ import { startComposerSpeechRecognition as $e } from "./iris-chat-speech.js";
18
+ import { irisChatComposerVariants as Be } from "./iris-chat.variants.js";
19
+ const _e = [
19
20
  { label: "Auto", value: "auto" },
20
21
  { label: "Fast", value: "fast" }
21
- ], Ze = we(
22
+ ], ct = Le(
22
23
  "IrisChatComposer",
23
24
  ({
24
- className: a,
25
- value: i,
26
- defaultValue: ee = "",
27
- onValueChange: te,
28
- pending: b = !1,
29
- placeholder: y,
30
- model: re,
31
- defaultModel: ne = "auto",
32
- onModelChange: ae,
33
- models: O = Me,
34
- onSend: ie,
25
+ className: n,
26
+ value: o,
27
+ defaultValue: se = "",
28
+ onValueChange: oe,
29
+ pending: x = !1,
30
+ placeholder: le,
31
+ model: ce,
32
+ defaultModel: de = "auto",
33
+ onModelChange: pe,
34
+ models: K = _e,
35
+ onSend: ue,
35
36
  onStop: T,
36
- onAddClick: P,
37
+ onAddClick: A,
37
38
  onAttachClick: $,
38
- onAttach: se,
39
- onMicClick: z,
40
- speechRecognitionLocale: oe,
39
+ onAttach: he,
40
+ onMicClick: D,
41
+ speechRecognitionLocale: me,
41
42
  onSpeechNotice: B
42
- }, le) => {
43
- const { t: r } = xe(), v = De(), c = v ? ke({
44
- isWindowPlacement: v.isWindowPlacement,
45
- placement: v.placement,
46
- frame: v.frame
47
- }) : "stacked", [ce, R] = Y({
48
- prop: i,
49
- defaultProp: ee,
50
- onChange: te
51
- }), [N, ue] = Y({
52
- prop: re,
53
- defaultProp: ne,
54
- onChange: ae
55
- }), _ = C(null), u = C(null), d = C(!1), W = C({}), [x, L] = D(!1), [V, G] = D(
43
+ }, fe) => {
44
+ const { t: r } = ke(), y = Ee(), R = y ? Se({
45
+ isWindowPlacement: y.isWindowPlacement,
46
+ placement: y.placement,
47
+ frame: y.frame
48
+ }) : "stacked", [Ce, _] = ae({
49
+ prop: o,
50
+ defaultProp: se,
51
+ onChange: oe
52
+ }), [N, ge] = ae({
53
+ prop: ce,
54
+ defaultProp: de,
55
+ onChange: pe
56
+ }), W = C(null), k = C(null), u = C(null), h = C(!1), V = C({}), [w, L] = g(!1), [G, H] = g(
56
57
  null
57
- ), [w, S] = D([]), [h, F] = D({});
58
- W.current = h;
59
- const l = ce ?? "", q = C(l);
60
- q.current = l;
61
- const A = l.trim().length > 0 || w.length > 0, de = (e) => {
62
- if ((e.kind === "permission" || e.messageKey === "speechNetwork" || e.messageKey === "speechError") && (d.current = !1, L(!1), u.current?.abort(), u.current = null), B) {
58
+ ), [b, E] = g([]), [m, S] = g({}), [l, q] = g(!1), [J, be] = g(!1);
59
+ V.current = m;
60
+ const i = Ce ?? "", Q = C(i);
61
+ Q.current = i;
62
+ const F = i.trim().length > 0 || b.length > 0, ve = (e) => {
63
+ if ((e.kind === "permission" || e.messageKey === "speechNetwork" || e.messageKey === "speechError") && (h.current = !1, L(!1), u.current?.abort(), u.current = null), B) {
63
64
  B(e);
64
65
  return;
65
66
  }
66
- G(e);
67
- }, he = (e) => {
68
- const n = _.current;
69
- n && (n.accept = e, n.value = "", n.click());
70
- }, K = (e) => {
67
+ H(e);
68
+ }, xe = (e) => {
69
+ const a = W.current;
70
+ a && (a.accept = e, a.value = "", a.click());
71
+ }, P = (e) => {
71
72
  if (!e?.length)
72
73
  return;
73
- const n = Array.from(e);
74
- se?.(n), S((o) => [...o, ...n]), F((o) => {
75
- const g = {};
76
- for (const m of n)
77
- m.type.startsWith("image/") && (g[k(m)] = URL.createObjectURL(m));
78
- return { ...o, ...g };
74
+ const a = Array.from(e);
75
+ he?.(a), E((c) => [...c, ...a]), S((c) => {
76
+ const v = {};
77
+ for (const f of a)
78
+ f.type.startsWith("image/") && (v[z(f)] = URL.createObjectURL(f));
79
+ return { ...c, ...v };
79
80
  });
80
81
  }, M = (e) => {
81
82
  if ($) {
82
83
  $();
83
84
  return;
84
85
  }
85
- he(e);
86
- }, U = () => {
87
- d.current = !1, u.current?.stop(), u.current = null, L(!1);
88
- }, me = () => {
89
- if (z) {
90
- z();
86
+ xe(e);
87
+ }, O = () => {
88
+ h.current = !1, u.current?.stop(), u.current = null, L(!1);
89
+ }, ye = () => {
90
+ if (D) {
91
+ D();
91
92
  return;
92
93
  }
93
- if (x) {
94
- U();
94
+ if (w) {
95
+ O();
95
96
  return;
96
97
  }
97
- G(null), d.current = !0;
98
- const e = Ae({
99
- locale: oe ?? "",
100
- readBaseText: () => q.current,
101
- shouldContinueListening: () => d.current,
102
- onDraftChange: R,
98
+ H(null), h.current = !0;
99
+ const e = $e({
100
+ locale: me ?? "",
101
+ readBaseText: () => Q.current,
102
+ shouldContinueListening: () => h.current,
103
+ onDraftChange: _,
103
104
  onListeningChange: L,
104
- onNotice: de
105
+ onNotice: ve
105
106
  });
106
- e || (d.current = !1), u.current = e;
107
+ e || (h.current = !1), u.current = e;
107
108
  };
108
- Ce(
109
+ j(
109
110
  () => () => {
110
- d.current = !1, u.current?.stop(), Object.values(W.current).forEach((e) => URL.revokeObjectURL(e));
111
+ h.current = !1, u.current?.stop(), Object.values(V.current).forEach((e) => URL.revokeObjectURL(e));
111
112
  },
112
113
  []
113
- );
114
- const pe = () => {
115
- Object.values(h).forEach((e) => URL.revokeObjectURL(e)), F({}), S([]);
116
- }, j = () => {
117
- !A || b || (ie?.(l.trim(), w), pe());
114
+ ), j(() => {
115
+ i.trim() || q(!1);
116
+ }, [i]), j(() => {
117
+ je(k.current, l), be(
118
+ Ke(
119
+ k.current,
120
+ l,
121
+ i.split(`
122
+ `).length
123
+ )
124
+ );
125
+ }, [i, l, R, b.length]);
126
+ const X = le ?? r("irisChat.askAnything"), we = () => {
127
+ Object.values(m).forEach((e) => URL.revokeObjectURL(e)), S({}), E([]);
128
+ }, Y = () => {
129
+ !F || x || (ue?.(i.trim(), b), we());
118
130
  };
119
131
  return /* @__PURE__ */ s(
120
132
  "form",
121
133
  {
122
- ref: le,
134
+ ref: fe,
123
135
  "data-component": "iris-chat-composer",
124
- "data-layout": c,
125
- "data-pending": b ? "" : void 0,
126
- "data-listening": x ? "" : void 0,
127
- className: Ie(
128
- Ke({ layout: c }),
129
- A && "iris-edge-wash-shell--menu iris-edge-wash-shell--fluid",
130
- a
136
+ "data-layout": R,
137
+ "data-pending": x ? "" : void 0,
138
+ "data-listening": w ? "" : void 0,
139
+ className: ne(
140
+ Be({ layout: R }),
141
+ "relative z-0",
142
+ F && "iris-edge-wash-shell--menu iris-edge-wash-shell--fluid",
143
+ n
131
144
  ),
132
145
  onDragOver: (e) => {
133
146
  e.dataTransfer.types.includes("Files") && e.preventDefault();
134
147
  },
135
148
  onDrop: (e) => {
136
- e.dataTransfer.files.length && (e.preventDefault(), K(e.dataTransfer.files));
149
+ e.dataTransfer.files.length && (e.preventDefault(), P(e.dataTransfer.files));
137
150
  },
138
151
  onPaste: (e) => {
139
- const n = Ue(e.clipboardData);
140
- n.length && (e.preventDefault(), K(n));
152
+ const a = We(e.clipboardData);
153
+ a.length && (e.preventDefault(), P(a));
141
154
  },
142
155
  onKeyDown: (e) => {
143
156
  if (e.key === "Escape") {
144
- if (x) {
145
- e.preventDefault(), U();
157
+ if (w) {
158
+ e.preventDefault(), O();
146
159
  return;
147
160
  }
148
- b && (e.preventDefault(), T?.());
161
+ x && (e.preventDefault(), T?.());
149
162
  }
150
163
  },
151
164
  onSubmit: (e) => {
152
- e.preventDefault(), j();
165
+ e.preventDefault(), Y();
153
166
  },
154
167
  children: [
155
- x && !z ? /* @__PURE__ */ t(Fe, { transcript: l, onStop: U }) : /* @__PURE__ */ s(ge, { children: [
156
- w.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", "data-testid": "iris-chat-composer-attachments", children: w.map((e, n) => {
157
- const o = k(e, n);
168
+ w && !D ? /* @__PURE__ */ t(Ae, { transcript: i, onStop: O }) : /* @__PURE__ */ s(ze, { children: [
169
+ b.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", "data-testid": "iris-chat-composer-attachments", children: b.map((e, a) => {
170
+ const c = z(e, a);
158
171
  return /* @__PURE__ */ t(
159
- Se,
172
+ Te,
160
173
  {
161
174
  name: e.name,
162
175
  kind: e.type.startsWith("image/") ? "image" : "file",
163
176
  sizeLabel: e.size < 1024 ? `${e.size} B` : `${Math.round(e.size / 1024)} KB`,
164
- previewUrl: h[k(e)] ?? h[o],
177
+ previewUrl: m[z(e)] ?? m[c],
165
178
  onRemove: () => {
166
- const g = k(e), m = h[g] ?? h[o];
167
- m && URL.revokeObjectURL(m), F((E) => {
168
- const I = { ...E };
169
- return delete I[g], delete I[o], I;
170
- }), S((E) => E.filter((I, fe) => fe !== n));
179
+ const v = z(e), f = m[v] ?? m[c];
180
+ f && URL.revokeObjectURL(f), S((U) => {
181
+ const I = { ...U };
182
+ return delete I[v], delete I[c], I;
183
+ }), E((U) => U.filter((I, Ie) => Ie !== a));
171
184
  }
172
185
  },
173
- o
186
+ c
174
187
  );
175
188
  }) }) : null,
176
- c === "stacked" || c === "stackedCompact" ? /* @__PURE__ */ t(
177
- "textarea",
178
- {
179
- id: "iris-chat-composer-input",
180
- "data-testid": "iris-chat-composer-input",
181
- rows: c === "stackedCompact" ? 1 : 2,
182
- value: l,
183
- placeholder: y ?? r("irisChat.askAnything"),
184
- "aria-label": y ?? r("irisChat.askAnything"),
185
- className: "max-h-24 min-h-8 w-full resize-none bg-transparent text-sm font-medium leading-5 text-content outline-none placeholder:text-content-empty",
186
- onChange: (e) => R(e.target.value),
187
- onKeyDown: (e) => {
188
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), j());
189
+ /* @__PURE__ */ s("div", { className: "relative min-w-0 w-full", children: [
190
+ (J || l) && /* @__PURE__ */ t(
191
+ d,
192
+ {
193
+ label: r(l ? "irisChat.collapsePrompt" : "irisChat.expandPrompt"),
194
+ children: /* @__PURE__ */ t(
195
+ p,
196
+ {
197
+ type: "button",
198
+ variant: "ghost",
199
+ size: "icon",
200
+ className: "absolute end-0 top-0 z-10 size-7 rounded-lg text-content-secondary",
201
+ "aria-label": r(l ? "irisChat.collapsePrompt" : "irisChat.expandPrompt"),
202
+ "data-testid": "iris-chat-composer-expand",
203
+ onClick: () => q((e) => !e),
204
+ children: /* @__PURE__ */ t(
205
+ Fe,
206
+ {
207
+ size: 14,
208
+ className: l ? "rotate-180" : void 0
209
+ }
210
+ )
211
+ }
212
+ )
189
213
  }
190
- }
191
- ) : null,
214
+ ),
215
+ /* @__PURE__ */ t(
216
+ "textarea",
217
+ {
218
+ ref: k,
219
+ id: "iris-chat-composer-input",
220
+ "data-testid": "iris-chat-composer-input",
221
+ rows: 1,
222
+ value: i,
223
+ placeholder: X,
224
+ "aria-label": X,
225
+ className: ne(
226
+ "min-h-8 w-full resize-none bg-transparent py-0 text-sm font-medium leading-5 text-content outline-none placeholder:text-content-empty",
227
+ J || l ? "pe-9" : void 0
228
+ ),
229
+ onChange: (e) => _(e.target.value),
230
+ onKeyDown: (e) => {
231
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Y());
232
+ }
233
+ }
234
+ )
235
+ ] }),
192
236
  /* @__PURE__ */ s("div", { className: "flex min-w-0 w-full items-center justify-between gap-1 [&_button[data-size=icon]]:size-8 [&_button[data-size=icon]_svg]:size-4", children: [
193
- /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-center", children: [
237
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 shrink-0 items-center", children: [
194
238
  /* @__PURE__ */ t(
195
239
  "input",
196
240
  {
197
- ref: _,
241
+ ref: W,
198
242
  type: "file",
199
243
  hidden: !0,
200
244
  multiple: !0,
201
245
  "data-testid": "iris-chat-attach-input",
202
- onChange: (e) => K(e.target.files)
246
+ onChange: (e) => P(e.target.files)
203
247
  }
204
248
  ),
205
- P ? /* @__PURE__ */ t(p, { label: r("irisChat.add"), children: /* @__PURE__ */ t(
206
- f,
249
+ A ? /* @__PURE__ */ t(d, { label: r("irisChat.add"), children: /* @__PURE__ */ t(
250
+ p,
207
251
  {
208
252
  type: "button",
209
253
  variant: "ghost",
210
254
  size: "icon",
211
255
  "aria-label": r("irisChat.add"),
212
- onClick: P,
213
- children: /* @__PURE__ */ t(Z, {})
256
+ onClick: A,
257
+ children: /* @__PURE__ */ t(ie, {})
214
258
  }
215
- ) }) : /* @__PURE__ */ s(H, { children: [
216
- /* @__PURE__ */ t(p, { label: r("irisChat.add"), children: /* @__PURE__ */ t(J, { asChild: !0, children: /* @__PURE__ */ t(f, { type: "button", variant: "ghost", size: "icon", "aria-label": r("irisChat.add"), children: /* @__PURE__ */ t(Z, {}) }) }) }),
217
- /* @__PURE__ */ s(Q, { align: "start", children: [
218
- /* @__PURE__ */ t(X, { onSelect: () => M("*/*"), children: r("irisChat.attachFile") }),
219
- /* @__PURE__ */ t(X, { onSelect: () => M("image/*"), children: r("irisChat.attachImage") })
259
+ ) }) : /* @__PURE__ */ s(Z, { children: [
260
+ /* @__PURE__ */ t(d, { label: r("irisChat.add"), children: /* @__PURE__ */ t(ee, { asChild: !0, children: /* @__PURE__ */ t(p, { type: "button", variant: "ghost", size: "icon", "aria-label": r("irisChat.add"), children: /* @__PURE__ */ t(ie, {}) }) }) }),
261
+ /* @__PURE__ */ s(te, { align: "start", children: [
262
+ /* @__PURE__ */ t(re, { onSelect: () => M("*/*"), children: r("irisChat.attachFile") }),
263
+ /* @__PURE__ */ t(re, { onSelect: () => M("image/*"), children: r("irisChat.attachImage") })
220
264
  ] })
221
265
  ] }),
222
- /* @__PURE__ */ t(p, { label: r("irisChat.attach"), children: /* @__PURE__ */ t(
223
- f,
266
+ /* @__PURE__ */ t(d, { label: r("irisChat.attach"), children: /* @__PURE__ */ t(
267
+ p,
224
268
  {
225
269
  type: "button",
226
270
  variant: "ghost",
227
271
  size: "icon",
228
272
  "aria-label": r("irisChat.attach"),
229
273
  onClick: () => M("*/*"),
230
- children: /* @__PURE__ */ t(ze, {})
231
- }
232
- ) }),
233
- c === "inline" ? /* @__PURE__ */ t(
234
- "input",
235
- {
236
- id: "iris-chat-composer-input",
237
- "data-testid": "iris-chat-composer-input",
238
- value: l,
239
- placeholder: y ?? r("irisChat.askAnything"),
240
- "aria-label": y ?? r("irisChat.askAnything"),
241
- className: "ms-1 h-8 min-w-0 flex-1 overflow-hidden bg-transparent py-0 text-sm font-medium leading-8 text-content outline-none placeholder:text-content-empty",
242
- onChange: (e) => R(e.target.value),
243
- onKeyDown: (e) => {
244
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), j());
245
- }
274
+ children: /* @__PURE__ */ t(Pe, {})
246
275
  }
247
- ) : null
276
+ ) })
248
277
  ] }),
249
278
  /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-0.5", children: [
250
- /* @__PURE__ */ s(H, { children: [
251
- /* @__PURE__ */ t(J, { asChild: !0, children: /* @__PURE__ */ s(
279
+ /* @__PURE__ */ s(Z, { children: [
280
+ /* @__PURE__ */ t(ee, { asChild: !0, children: /* @__PURE__ */ s(
252
281
  "button",
253
282
  {
254
283
  type: "button",
@@ -256,33 +285,33 @@ const Me = [
256
285
  className: "flex h-8 max-w-24 shrink-0 items-center gap-0.5 truncate rounded-lg bg-secondary px-2 text-sm font-medium capitalize leading-none text-content",
257
286
  "aria-label": r("irisChat.model"),
258
287
  children: [
259
- O.find((e) => e.value === N)?.label ?? N,
260
- /* @__PURE__ */ t(be, { size: 16, className: "rotate-90" })
288
+ K.find((e) => e.value === N)?.label ?? N,
289
+ /* @__PURE__ */ t(De, { size: 16, className: "rotate-90" })
261
290
  ]
262
291
  }
263
292
  ) }),
264
- /* @__PURE__ */ t(Q, { align: "end", children: /* @__PURE__ */ t(
265
- ye,
293
+ /* @__PURE__ */ t(te, { align: "end", children: /* @__PURE__ */ t(
294
+ Re,
266
295
  {
267
296
  value: N,
268
- onValueChange: ue,
269
- children: O.map((e) => /* @__PURE__ */ t(ve, { value: e.value, children: e.label }, e.value))
297
+ onValueChange: ge,
298
+ children: K.map((e) => /* @__PURE__ */ t(Ne, { value: e.value, children: e.label }, e.value))
270
299
  }
271
300
  ) })
272
301
  ] }),
273
- /* @__PURE__ */ t(p, { label: r("irisChat.mic"), children: /* @__PURE__ */ t(
274
- f,
302
+ /* @__PURE__ */ t(d, { label: r("irisChat.mic"), children: /* @__PURE__ */ t(
303
+ p,
275
304
  {
276
305
  type: "button",
277
306
  variant: "ghost",
278
307
  size: "icon",
279
308
  "aria-label": r("irisChat.mic"),
280
- onClick: me,
281
- children: /* @__PURE__ */ t(Re, {})
309
+ onClick: ye,
310
+ children: /* @__PURE__ */ t(Me, {})
282
311
  }
283
312
  ) }),
284
- b ? /* @__PURE__ */ t(p, { label: r("irisChat.stop"), children: /* @__PURE__ */ t(
285
- f,
313
+ x ? /* @__PURE__ */ t(d, { label: r("irisChat.stop"), children: /* @__PURE__ */ t(
314
+ p,
286
315
  {
287
316
  type: "button",
288
317
  variant: "default",
@@ -291,10 +320,10 @@ const Me = [
291
320
  "data-testid": "iris-chat-stop",
292
321
  className: "rounded-full",
293
322
  onClick: T,
294
- children: /* @__PURE__ */ t(Ne, { size: 16 })
323
+ children: /* @__PURE__ */ t(Oe, { size: 16 })
295
324
  }
296
- ) }) : A ? /* @__PURE__ */ t(p, { label: r("irisChat.send"), children: /* @__PURE__ */ t(
297
- f,
325
+ ) }) : F ? /* @__PURE__ */ t(d, { label: r("irisChat.send"), children: /* @__PURE__ */ t(
326
+ p,
298
327
  {
299
328
  type: "submit",
300
329
  variant: "default",
@@ -302,24 +331,24 @@ const Me = [
302
331
  "aria-label": r("irisChat.send"),
303
332
  "data-testid": "iris-chat-send",
304
333
  className: "rounded-full",
305
- children: /* @__PURE__ */ t(Le, { size: 16 })
334
+ children: /* @__PURE__ */ t(Ue, { size: 16 })
306
335
  }
307
336
  ) }) : null
308
337
  ] })
309
338
  ] })
310
339
  ] }),
311
- V ? /* @__PURE__ */ t("p", { className: "px-1 text-xs text-destructive", role: "alert", children: r(`irisChat.${V.messageKey}`) }) : null
340
+ G ? /* @__PURE__ */ t("p", { className: "px-1 text-xs text-destructive", role: "alert", children: r(`irisChat.${G.messageKey}`) }) : null
312
341
  ]
313
342
  }
314
343
  );
315
344
  }
316
345
  );
317
- function k(a, i = 0) {
318
- return `${a.name}:${a.size}:${a.lastModified}:${i}`;
346
+ function z(n, o = 0) {
347
+ return `${n.name}:${n.size}:${n.lastModified}:${o}`;
319
348
  }
320
- function Ue(a) {
321
- return a ? a.files.length ? Array.from(a.files) : Array.from(a.items).filter((i) => i.kind === "file").map((i) => i.getAsFile()).filter((i) => !!i) : [];
349
+ function We(n) {
350
+ return n ? n.files.length ? Array.from(n.files) : Array.from(n.items).filter((o) => o.kind === "file").map((o) => o.getAsFile()).filter((o) => !!o) : [];
322
351
  }
323
352
  export {
324
- Ze as IrisChatComposer
353
+ ct as IrisChatComposer
325
354
  };
@@ -15,5 +15,6 @@ export declare function IrisChatDislikeIcon({ size, className }: IconProps): imp
15
15
  export declare function IrisChatCopyIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
16
16
  export declare function IrisChatCheckIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
17
17
  export declare function IrisChatRetryIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function IrisChatComposerExpandIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
18
19
  export declare function IrisChatSpeakIcon({ size, className }: IconProps): import("react/jsx-runtime").JSX.Element;
19
20
  export {};