@uipath/apollo-wind 2.68.0 → 2.70.0

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 (80) hide show
  1. package/dist/components/custom/chat-first-experience.cjs +3 -3
  2. package/dist/components/custom/chat-first-experience.js +3 -3
  3. package/dist/components/custom/demo-composer.cjs +80 -0
  4. package/dist/components/custom/demo-composer.d.ts +11 -0
  5. package/dist/components/custom/demo-composer.js +46 -0
  6. package/dist/components/custom/panel-flow.cjs +2 -2
  7. package/dist/components/custom/panel-flow.js +2 -2
  8. package/dist/components/ui/chat-composer.cjs +429 -0
  9. package/dist/components/ui/chat-composer.d.ts +157 -0
  10. package/dist/components/ui/chat-composer.js +359 -0
  11. package/dist/components/ui/citation.cjs +188 -0
  12. package/dist/components/ui/citation.d.ts +42 -0
  13. package/dist/components/ui/citation.js +148 -0
  14. package/dist/components/ui/code-block.cjs +375 -0
  15. package/dist/components/ui/code-block.d.ts +38 -0
  16. package/dist/components/ui/code-block.js +307 -0
  17. package/dist/components/ui/dropzone-overlay.cjs +142 -0
  18. package/dist/components/ui/dropzone-overlay.d.ts +27 -0
  19. package/dist/components/ui/dropzone-overlay.js +105 -0
  20. package/dist/components/ui/file-upload.cjs +5 -29
  21. package/dist/components/ui/file-upload.js +2 -26
  22. package/dist/components/ui/file-validation.cjs +91 -0
  23. package/dist/components/ui/file-validation.d.ts +24 -0
  24. package/dist/components/ui/file-validation.js +51 -0
  25. package/dist/components/ui/hover-card.cjs +15 -8
  26. package/dist/components/ui/hover-card.d.ts +4 -1
  27. package/dist/components/ui/hover-card.js +16 -9
  28. package/dist/components/ui/index.cjs +330 -198
  29. package/dist/components/ui/index.d.ts +12 -0
  30. package/dist/components/ui/index.js +12 -0
  31. package/dist/components/ui/input-group.cjs +1 -1
  32. package/dist/components/ui/input-group.d.ts +2 -1
  33. package/dist/components/ui/input-group.js +1 -1
  34. package/dist/components/ui/json-tree-view/JsonTree.cjs +2 -2
  35. package/dist/components/ui/json-tree-view/JsonTree.js +1 -1
  36. package/dist/components/ui/json-tree-view/index.cjs +26 -23
  37. package/dist/components/ui/json-tree-view/index.d.ts +2 -2
  38. package/dist/components/ui/json-tree-view/index.js +2 -2
  39. package/dist/components/ui/live-region.cjs +106 -0
  40. package/dist/components/ui/live-region.d.ts +31 -0
  41. package/dist/components/ui/live-region.js +72 -0
  42. package/dist/components/ui/loading-dots.cjs +95 -0
  43. package/dist/components/ui/loading-dots.d.ts +21 -0
  44. package/dist/components/ui/loading-dots.js +55 -0
  45. package/dist/components/ui/markdown.cjs +428 -0
  46. package/dist/components/ui/markdown.d.ts +55 -0
  47. package/dist/components/ui/markdown.js +378 -0
  48. package/dist/components/ui/message-actions.cjs +302 -0
  49. package/dist/components/ui/message-actions.d.ts +102 -0
  50. package/dist/components/ui/message-actions.js +241 -0
  51. package/dist/components/ui/message.cjs +1 -1
  52. package/dist/components/ui/message.d.ts +2 -0
  53. package/dist/components/ui/message.js +1 -1
  54. package/dist/components/ui/sources.cjs +175 -0
  55. package/dist/components/ui/sources.d.ts +44 -0
  56. package/dist/components/ui/sources.js +132 -0
  57. package/dist/components/ui/thinking-indicator.cjs +146 -0
  58. package/dist/components/ui/thinking-indicator.d.ts +38 -0
  59. package/dist/components/ui/thinking-indicator.js +106 -0
  60. package/dist/components/ui/tool-call.cjs +359 -0
  61. package/dist/components/ui/tool-call.d.ts +75 -0
  62. package/dist/components/ui/tool-call.js +301 -0
  63. package/dist/index.cjs +433 -253
  64. package/dist/index.d.ts +24 -0
  65. package/dist/index.js +13 -1
  66. package/dist/lib/index.cjs +8 -1
  67. package/dist/lib/index.d.ts +1 -0
  68. package/dist/lib/index.js +2 -1
  69. package/dist/lib/url.cjs +54 -0
  70. package/dist/lib/url.d.ts +8 -0
  71. package/dist/lib/url.js +17 -0
  72. package/dist/styles.css +363 -35
  73. package/dist/tailwind.utilities.css +21 -0
  74. package/package.json +7 -1
  75. package/dist/components/custom/chat-composer.cjs +0 -134
  76. package/dist/components/custom/chat-composer.d.ts +0 -14
  77. package/dist/components/custom/chat-composer.js +0 -100
  78. /package/dist/{components/ui/json-tree-view → lib}/clipboard.cjs +0 -0
  79. /package/dist/{components/ui/json-tree-view → lib}/clipboard.d.ts +0 -0
  80. /package/dist/{components/ui/json-tree-view → lib}/clipboard.js +0 -0
@@ -27,9 +27,9 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  ChatFirstExperience: ()=>ChatFirstExperience
28
28
  });
29
29
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
- const index_cjs_namespaceObject = require("../../lib/index.cjs");
31
- const external_chat_composer_cjs_namespaceObject = require("./chat-composer.cjs");
32
30
  const external_chat_prompt_suggestions_cjs_namespaceObject = require("./chat-prompt-suggestions.cjs");
31
+ const external_demo_composer_cjs_namespaceObject = require("./demo-composer.cjs");
32
+ const index_cjs_namespaceObject = require("../../lib/index.cjs");
33
33
  function ChatFirstExperience({ className, userName = 'David', subtitle = 'What should we work on today?', composerPlaceholder = 'I would like you to automate my', suggestions = [
34
34
  {
35
35
  id: '1',
@@ -65,7 +65,7 @@ function ChatFirstExperience({ className, userName = 'David', subtitle = 'What s
65
65
  })
66
66
  ]
67
67
  }),
68
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_chat_composer_cjs_namespaceObject.ChatComposer, {
68
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_demo_composer_cjs_namespaceObject.DemoComposer, {
69
69
  placeholder: composerPlaceholder,
70
70
  onSubmit: onSubmit
71
71
  }),
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { cn } from "../../lib/index.js";
3
- import { ChatComposer } from "./chat-composer.js";
4
2
  import { PromptSuggestions } from "./chat-prompt-suggestions.js";
3
+ import { DemoComposer } from "./demo-composer.js";
4
+ import { cn } from "../../lib/index.js";
5
5
  function ChatFirstExperience({ className, userName = 'David', subtitle = 'What should we work on today?', composerPlaceholder = 'I would like you to automate my', suggestions = [
6
6
  {
7
7
  id: '1',
@@ -37,7 +37,7 @@ function ChatFirstExperience({ className, userName = 'David', subtitle = 'What s
37
37
  })
38
38
  ]
39
39
  }),
40
- /*#__PURE__*/ jsx(ChatComposer, {
40
+ /*#__PURE__*/ jsx(DemoComposer, {
41
41
  placeholder: composerPlaceholder,
42
42
  onSubmit: onSubmit
43
43
  }),
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ DemoComposer: ()=>DemoComposer
28
+ });
29
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
30
+ const external_lucide_react_namespaceObject = require("lucide-react");
31
+ const chat_composer_cjs_namespaceObject = require("../ui/chat-composer.cjs");
32
+ const input_group_cjs_namespaceObject = require("../ui/input-group.cjs");
33
+ const index_cjs_namespaceObject = require("../../lib/index.cjs");
34
+ function DemoComposer({ className, placeholder, onSubmit }) {
35
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_composer_cjs_namespaceObject.ChatComposer, {
36
+ className: (0, index_cjs_namespaceObject.cn)('max-w-[800px] rounded-[32px] bg-surface-raised p-2', className),
37
+ onSubmit: (value)=>onSubmit?.(value.trim()),
38
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(chat_composer_cjs_namespaceObject.ChatComposerInputGroup, {
39
+ className: "rounded-[24px] border-border bg-surface future:rounded-[24px] future:border future:border-border future:bg-surface",
40
+ children: [
41
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_composer_cjs_namespaceObject.ChatComposerTextarea, {
42
+ placeholder: placeholder,
43
+ minRows: 3,
44
+ className: "px-1 pt-2"
45
+ }),
46
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(chat_composer_cjs_namespaceObject.ChatComposerToolbar, {
47
+ className: "border-t-0 px-3 pb-3",
48
+ children: [
49
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_composer_cjs_namespaceObject.ChatComposerAttachButton, {
50
+ size: "xs",
51
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Plus, {})
52
+ }),
53
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_group_cjs_namespaceObject.InputGroupButton, {
54
+ "aria-label": "Add workflow",
55
+ icon: true,
56
+ size: "xs",
57
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Workflow, {})
58
+ }),
59
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(input_group_cjs_namespaceObject.InputGroupButton, {
60
+ "aria-label": "Settings",
61
+ icon: true,
62
+ size: "xs",
63
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Settings2, {})
64
+ }),
65
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_composer_cjs_namespaceObject.ChatComposerSubmit, {
66
+ size: "xs"
67
+ })
68
+ ]
69
+ })
70
+ ]
71
+ })
72
+ });
73
+ }
74
+ exports.DemoComposer = __webpack_exports__.DemoComposer;
75
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
76
+ "DemoComposer"
77
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
78
+ Object.defineProperty(exports, '__esModule', {
79
+ value: true
80
+ });
@@ -0,0 +1,11 @@
1
+ export interface DemoComposerProps {
2
+ className?: string;
3
+ placeholder?: string;
4
+ /** Called with the trimmed draft when the user sends. */
5
+ onSubmit?: (value: string) => void;
6
+ }
7
+ /**
8
+ * The prototype screens' composer: `ChatComposer` in a raised shell. Only typing and sending work;
9
+ * the attach, workflow and settings buttons are there for the look.
10
+ */
11
+ export declare function DemoComposer({ className, placeholder, onSubmit }: DemoComposerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,46 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Plus, Settings2, Workflow } from "lucide-react";
3
+ import { ChatComposer, ChatComposerAttachButton, ChatComposerInputGroup, ChatComposerSubmit, ChatComposerTextarea, ChatComposerToolbar } from "../ui/chat-composer.js";
4
+ import { InputGroupButton } from "../ui/input-group.js";
5
+ import { cn } from "../../lib/index.js";
6
+ function DemoComposer({ className, placeholder, onSubmit }) {
7
+ return /*#__PURE__*/ jsx(ChatComposer, {
8
+ className: cn('max-w-[800px] rounded-[32px] bg-surface-raised p-2', className),
9
+ onSubmit: (value)=>onSubmit?.(value.trim()),
10
+ children: /*#__PURE__*/ jsxs(ChatComposerInputGroup, {
11
+ className: "rounded-[24px] border-border bg-surface future:rounded-[24px] future:border future:border-border future:bg-surface",
12
+ children: [
13
+ /*#__PURE__*/ jsx(ChatComposerTextarea, {
14
+ placeholder: placeholder,
15
+ minRows: 3,
16
+ className: "px-1 pt-2"
17
+ }),
18
+ /*#__PURE__*/ jsxs(ChatComposerToolbar, {
19
+ className: "border-t-0 px-3 pb-3",
20
+ children: [
21
+ /*#__PURE__*/ jsx(ChatComposerAttachButton, {
22
+ size: "xs",
23
+ children: /*#__PURE__*/ jsx(Plus, {})
24
+ }),
25
+ /*#__PURE__*/ jsx(InputGroupButton, {
26
+ "aria-label": "Add workflow",
27
+ icon: true,
28
+ size: "xs",
29
+ children: /*#__PURE__*/ jsx(Workflow, {})
30
+ }),
31
+ /*#__PURE__*/ jsx(InputGroupButton, {
32
+ "aria-label": "Settings",
33
+ icon: true,
34
+ size: "xs",
35
+ children: /*#__PURE__*/ jsx(Settings2, {})
36
+ }),
37
+ /*#__PURE__*/ jsx(ChatComposerSubmit, {
38
+ size: "xs"
39
+ })
40
+ ]
41
+ })
42
+ ]
43
+ })
44
+ });
45
+ }
46
+ export { DemoComposer };
@@ -30,7 +30,7 @@ __webpack_require__.d(__webpack_exports__, {
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
31
  const external_lucide_react_namespaceObject = require("lucide-react");
32
32
  const external_react_namespaceObject = require("react");
33
- const external_chat_composer_cjs_namespaceObject = require("./chat-composer.cjs");
33
+ const external_demo_composer_cjs_namespaceObject = require("./demo-composer.cjs");
34
34
  const avatar_cjs_namespaceObject = require("../ui/avatar.cjs");
35
35
  const collapsible_cjs_namespaceObject = require("../ui/collapsible.cjs");
36
36
  const tooltip_cjs_namespaceObject = require("../ui/tooltip.cjs");
@@ -338,7 +338,7 @@ function ExpandedPanel({ chatMessages, expandedContent, onClose }) {
338
338
  }),
339
339
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
340
340
  className: "pt-12",
341
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_chat_composer_cjs_namespaceObject.ChatComposer, {
341
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_demo_composer_cjs_namespaceObject.DemoComposer, {
342
342
  placeholder: "Ask me to help build your Flow"
343
343
  })
344
344
  })
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Bot, Brain, ChevronUp, Copy, House, MessageCircle, PanelRightOpen, RefreshCcw, Search, ThumbsDown, ThumbsUp, Workflow } from "lucide-react";
3
3
  import { useState } from "react";
4
- import { ChatComposer } from "./chat-composer.js";
4
+ import { DemoComposer } from "./demo-composer.js";
5
5
  import { Avatar, AvatarFallback } from "../ui/avatar.js";
6
6
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible.js";
7
7
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../ui/tooltip.js";
@@ -309,7 +309,7 @@ function ExpandedPanel({ chatMessages, expandedContent, onClose }) {
309
309
  }),
310
310
  /*#__PURE__*/ jsx("div", {
311
311
  className: "pt-12",
312
- children: /*#__PURE__*/ jsx(ChatComposer, {
312
+ children: /*#__PURE__*/ jsx(DemoComposer, {
313
313
  placeholder: "Ask me to help build your Flow"
314
314
  })
315
315
  })
@@ -0,0 +1,429 @@
1
+ "use strict";
2
+ "use client";
3
+ var __webpack_require__ = {};
4
+ (()=>{
5
+ __webpack_require__.d = (exports1, definition)=>{
6
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ get: definition[key]
9
+ });
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.r = (exports1)=>{
17
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
18
+ value: 'Module'
19
+ });
20
+ Object.defineProperty(exports1, '__esModule', {
21
+ value: true
22
+ });
23
+ };
24
+ })();
25
+ var __webpack_exports__ = {};
26
+ __webpack_require__.r(__webpack_exports__);
27
+ __webpack_require__.d(__webpack_exports__, {
28
+ DEFAULT_CHAT_COMPOSER_STRINGS: ()=>DEFAULT_CHAT_COMPOSER_STRINGS,
29
+ ChatComposerToolbar: ()=>ChatComposerToolbar,
30
+ chatComposerErrorVariants: ()=>chatComposerErrorVariants,
31
+ ChatComposerFooter: ()=>ChatComposerFooter,
32
+ ChatComposerAttachments: ()=>ChatComposerAttachments,
33
+ ChatComposerInputGroup: ()=>ChatComposerInputGroup,
34
+ ChatComposer: ()=>ChatComposer,
35
+ ChatComposerTextarea: ()=>ChatComposerTextarea,
36
+ chatComposerVariants: ()=>chatComposerVariants,
37
+ ChatComposerAttachButton: ()=>ChatComposerAttachButton,
38
+ useChatComposer: ()=>useChatComposer,
39
+ ChatComposerError: ()=>ChatComposerError,
40
+ ChatComposerSubmit: ()=>ChatComposerSubmit
41
+ });
42
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
43
+ const external_class_variance_authority_namespaceObject = require("class-variance-authority");
44
+ const external_lucide_react_namespaceObject = require("lucide-react");
45
+ const external_react_namespaceObject = require("react");
46
+ const index_cjs_namespaceObject = require("../../lib/index.cjs");
47
+ const external_attachment_cjs_namespaceObject = require("./attachment.cjs");
48
+ const external_button_cjs_namespaceObject = require("./button.cjs");
49
+ const external_file_validation_cjs_namespaceObject = require("./file-validation.cjs");
50
+ const external_input_group_cjs_namespaceObject = require("./input-group.cjs");
51
+ const DEFAULT_CHAT_COMPOSER_STRINGS = {
52
+ label: 'Message',
53
+ placeholder: 'Ask anything',
54
+ send: 'Send message',
55
+ stop: 'Stop generating',
56
+ attach: 'Attach files',
57
+ removeAttachment: (name)=>`Remove ${name}`,
58
+ dismissError: 'Dismiss'
59
+ };
60
+ const ChatComposerContext = /*#__PURE__*/ external_react_namespaceObject.createContext(null);
61
+ function useChatComposerInternal() {
62
+ const context = external_react_namespaceObject.useContext(ChatComposerContext);
63
+ if (!context) throw new Error('ChatComposer parts must be rendered inside <ChatComposer>.');
64
+ return context;
65
+ }
66
+ function useChatComposer() {
67
+ return useChatComposerInternal();
68
+ }
69
+ const chatComposerVariants = (0, external_class_variance_authority_namespaceObject.cva)('flex w-full min-w-0 flex-col', {
70
+ variants: {
71
+ density: {
72
+ comfortable: 'gap-2',
73
+ compact: 'gap-1.5'
74
+ }
75
+ },
76
+ defaultVariants: {
77
+ density: 'comfortable'
78
+ }
79
+ });
80
+ const NO_ATTACHMENTS = [];
81
+ const ChatComposer = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, children, value: valueProp, defaultValue, onValueChange, onSubmit, status = 'idle', onStop, disabled = false, submitDisabled = false, density, attachments = NO_ATTACHMENTS, onRemoveAttachment, strings, ...props }, ref)=>{
82
+ const resolvedDensity = density ?? 'comfortable';
83
+ const controlled = void 0 !== valueProp;
84
+ const [uncontrolledValue, setUncontrolledValue] = external_react_namespaceObject.useState(defaultValue ?? '');
85
+ const value = controlled ? valueProp : uncontrolledValue;
86
+ const fileInputRef = external_react_namespaceObject.useRef(null);
87
+ const onFilesRef = external_react_namespaceObject.useRef(void 0);
88
+ const attachmentsBusy = attachments.some(({ state })=>'uploading' === state || 'processing' === state);
89
+ const canSubmit = !disabled && !submitDisabled && !attachmentsBusy && 'idle' === status && ('' !== value.trim() || attachments.length > 0);
90
+ const setValue = external_react_namespaceObject.useCallback((next)=>{
91
+ if (!controlled) setUncontrolledValue(next);
92
+ onValueChange?.(next);
93
+ }, [
94
+ controlled,
95
+ onValueChange
96
+ ]);
97
+ const submit = external_react_namespaceObject.useCallback(()=>{
98
+ if (!canSubmit) return;
99
+ onSubmit?.(value, {
100
+ attachments
101
+ });
102
+ if (!controlled) setValue('');
103
+ }, [
104
+ canSubmit,
105
+ onSubmit,
106
+ value,
107
+ attachments,
108
+ controlled,
109
+ setValue
110
+ ]);
111
+ const openFilePicker = external_react_namespaceObject.useCallback(({ accept, multiple = true, onFiles })=>{
112
+ const input = fileInputRef.current;
113
+ if (!input) return;
114
+ input.accept = accept ?? '';
115
+ input.multiple = multiple;
116
+ onFilesRef.current = onFiles;
117
+ input.click();
118
+ }, []);
119
+ const text = external_react_namespaceObject.useMemo(()=>({
120
+ ...DEFAULT_CHAT_COMPOSER_STRINGS,
121
+ ...strings
122
+ }), [
123
+ strings
124
+ ]);
125
+ const context = external_react_namespaceObject.useMemo(()=>({
126
+ value,
127
+ setValue,
128
+ status,
129
+ density: resolvedDensity,
130
+ disabled,
131
+ strings: text,
132
+ attachments,
133
+ onRemoveAttachment,
134
+ onStop,
135
+ canSubmit,
136
+ submit,
137
+ openFilePicker
138
+ }), [
139
+ value,
140
+ setValue,
141
+ status,
142
+ resolvedDensity,
143
+ disabled,
144
+ text,
145
+ attachments,
146
+ onRemoveAttachment,
147
+ onStop,
148
+ canSubmit,
149
+ submit,
150
+ openFilePicker
151
+ ]);
152
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ChatComposerContext.Provider, {
153
+ value: context,
154
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("form", {
155
+ ref: ref,
156
+ "data-slot": "chat-composer",
157
+ "data-status": status,
158
+ "data-density": resolvedDensity,
159
+ "data-disabled": disabled ? '' : void 0,
160
+ className: (0, index_cjs_namespaceObject.cn)(chatComposerVariants({
161
+ density: resolvedDensity
162
+ }), className),
163
+ onSubmit: (event)=>{
164
+ event.preventDefault();
165
+ submit();
166
+ },
167
+ ...props,
168
+ children: [
169
+ children,
170
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
171
+ ref: fileInputRef,
172
+ type: "file",
173
+ hidden: true,
174
+ tabIndex: -1,
175
+ "data-slot": "chat-composer-file-input",
176
+ disabled: disabled,
177
+ onChange: (event)=>{
178
+ const files = Array.from(event.target.files ?? []);
179
+ event.target.value = '';
180
+ if (files.length > 0) onFilesRef.current?.(files);
181
+ }
182
+ })
183
+ ]
184
+ })
185
+ });
186
+ });
187
+ ChatComposer.displayName = 'ChatComposer';
188
+ const FOCUS_RING_CLASS = 'has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot][aria-invalid=true]]:has-[[data-slot=input-group-control]:focus-visible]:ring-error future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-2 future:has-[[data-slot=input-group-control]:focus-visible]:ring-offset-background';
189
+ const ChatComposerInputGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, disabled, invalid, error, ...props }, ref)=>{
190
+ const composer = useChatComposer();
191
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroup, {
192
+ ref: ref,
193
+ layout: "block",
194
+ disabled: disabled || composer.disabled,
195
+ invalid: invalid,
196
+ error: error,
197
+ className: (0, index_cjs_namespaceObject.cn)(FOCUS_RING_CLASS, invalid || error ? 'has-[[data-slot=input-group-control]:focus-visible]:ring-error' : 'has-[[data-slot=input-group-control]:focus-visible]:ring-ring future:has-[[data-slot=input-group-control]:focus-visible]:ring-primary', className),
198
+ ...props
199
+ });
200
+ });
201
+ ChatComposerInputGroup.displayName = 'ChatComposerInputGroup';
202
+ const ChatComposerTextarea = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, minRows, maxRows = 6, placeholder, disabled, onChange, onKeyDown, 'aria-label': ariaLabel, ...props }, ref)=>{
203
+ const composer = useChatComposer();
204
+ const rows = minRows ?? ('compact' === composer.density ? 1 : 2);
205
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupRow, {
206
+ className: (0, index_cjs_namespaceObject.cn)('has-[[data-slot=input-group-control]:focus-visible]:ring-0 has-[[data-slot=input-group-control]_:focus-visible]:ring-0', 'compact' === composer.density ? 'min-h-0 py-1 future:min-h-0' : 'py-2'),
207
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupTextarea, {
208
+ ref: ref,
209
+ rows: rows,
210
+ minRows: rows,
211
+ maxRows: maxRows,
212
+ "aria-label": ariaLabel ?? composer.strings.label,
213
+ placeholder: placeholder ?? composer.strings.placeholder,
214
+ disabled: disabled || composer.disabled,
215
+ value: composer.value,
216
+ onChange: (event)=>{
217
+ onChange?.(event);
218
+ composer.setValue(event.target.value);
219
+ },
220
+ onKeyDown: (event)=>{
221
+ onKeyDown?.(event);
222
+ if (event.defaultPrevented || 'Enter' !== event.key || event.shiftKey) return;
223
+ if (event.nativeEvent.isComposing || 229 === event.keyCode) return;
224
+ event.preventDefault();
225
+ composer.submit();
226
+ },
227
+ className: className,
228
+ ...props
229
+ })
230
+ });
231
+ });
232
+ ChatComposerTextarea.displayName = 'ChatComposerTextarea';
233
+ const ChatComposerToolbar = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>{
234
+ const { density } = useChatComposer();
235
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupBody, {
236
+ ref: ref,
237
+ "data-slot": "chat-composer-toolbar",
238
+ className: (0, index_cjs_namespaceObject.cn)('flex min-w-0 items-center gap-1', 'compact' === density ? 'px-1.5 py-1' : 'px-2 py-1.5', className),
239
+ ...props
240
+ });
241
+ });
242
+ ChatComposerToolbar.displayName = 'ChatComposerToolbar';
243
+ const ChatComposerAttachButton = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ accept, maxSize, maxFiles, multiple = true, onFiles, onClick, children, disabled, ...props }, ref)=>{
244
+ const composer = useChatComposerInternal();
245
+ const openPicker = ()=>{
246
+ const remaining = void 0 === maxFiles ? void 0 : Math.max(0, maxFiles - composer.attachments.length);
247
+ composer.openFilePicker({
248
+ accept: Array.isArray(accept) ? accept.join(',') : accept,
249
+ multiple,
250
+ onFiles: (files)=>{
251
+ const { accepted, rejected } = (0, external_file_validation_cjs_namespaceObject.validateFiles)(files, {
252
+ accept,
253
+ maxSize,
254
+ maxFiles: remaining
255
+ });
256
+ onFiles?.(accepted, rejected);
257
+ }
258
+ });
259
+ };
260
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
261
+ ref: ref,
262
+ "data-slot": "chat-composer-attach",
263
+ icon: true,
264
+ size: 'compact' === composer.density ? '3xs' : '2xs',
265
+ "aria-label": composer.strings.attach,
266
+ disabled: disabled || composer.disabled,
267
+ onClick: (event)=>{
268
+ onClick?.(event);
269
+ if (!event.defaultPrevented) openPicker();
270
+ },
271
+ ...props,
272
+ children: children ?? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Paperclip, {})
273
+ });
274
+ });
275
+ ChatComposerAttachButton.displayName = 'ChatComposerAttachButton';
276
+ const ChatComposerSubmit = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, onClick, children, disabled, ...props }, ref)=>{
277
+ const composer = useChatComposer();
278
+ const stoppable = 'streaming' === composer.status && void 0 !== composer.onStop;
279
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupButton, {
280
+ ref: ref,
281
+ "data-slot": "chat-composer-submit",
282
+ "data-status": composer.status,
283
+ type: stoppable ? 'button' : 'submit',
284
+ variant: stoppable ? 'ghost' : 'default',
285
+ icon: true,
286
+ size: 'compact' === composer.density ? '3xs' : '2xs',
287
+ "aria-label": stoppable ? composer.strings.stop : composer.strings.send,
288
+ disabled: disabled || composer.disabled || !stoppable && !composer.canSubmit,
289
+ onClick: (event)=>{
290
+ onClick?.(event);
291
+ if (stoppable && !event.defaultPrevented) composer.onStop?.();
292
+ },
293
+ className: (0, index_cjs_namespaceObject.cn)('ml-auto', className),
294
+ ...props,
295
+ children: children ?? (stoppable ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Square, {
296
+ className: "fill-current"
297
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ArrowUp, {}))
298
+ });
299
+ });
300
+ ChatComposerSubmit.displayName = 'ChatComposerSubmit';
301
+ const ChatComposerAttachments = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>{
302
+ const { attachments, onRemoveAttachment, strings, disabled, density } = useChatComposer();
303
+ if (0 === attachments.length) return null;
304
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_attachment_cjs_namespaceObject.AttachmentGroup, {
305
+ ref: ref,
306
+ "data-slot": "chat-composer-attachments",
307
+ className: (0, index_cjs_namespaceObject.cn)('compact' === density ? 'px-2 pt-1.5' : 'px-2.5 pt-2.5', className),
308
+ ...props,
309
+ children: attachments.map((attachment)=>{
310
+ const state = attachment.state ?? 'done';
311
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_attachment_cjs_namespaceObject.Attachment, {
312
+ size: 'compact' === density ? 'xs' : 'sm',
313
+ state: state,
314
+ "aria-busy": 'uploading' === state || 'processing' === state || void 0,
315
+ children: [
316
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_attachment_cjs_namespaceObject.AttachmentMedia, {
317
+ variant: attachment.previewUrl ? 'image' : 'icon',
318
+ children: attachment.previewUrl ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
319
+ src: attachment.previewUrl,
320
+ alt: ""
321
+ }) : attachment.icon ?? ('error' === state ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.CircleAlert, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.FileText, {}))
322
+ }),
323
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_attachment_cjs_namespaceObject.AttachmentContent, {
324
+ children: [
325
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_attachment_cjs_namespaceObject.AttachmentTitle, {
326
+ children: attachment.name
327
+ }),
328
+ attachment.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_attachment_cjs_namespaceObject.AttachmentDescription, {
329
+ children: attachment.description
330
+ })
331
+ ]
332
+ }),
333
+ onRemoveAttachment && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_attachment_cjs_namespaceObject.AttachmentActions, {
334
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_attachment_cjs_namespaceObject.AttachmentAction, {
335
+ "aria-label": strings.removeAttachment(attachment.name),
336
+ disabled: disabled,
337
+ onClick: ()=>onRemoveAttachment(attachment),
338
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {})
339
+ })
340
+ })
341
+ ]
342
+ }, attachment.id);
343
+ })
344
+ });
345
+ });
346
+ ChatComposerAttachments.displayName = 'ChatComposerAttachments';
347
+ const chatComposerErrorVariants = (0, external_class_variance_authority_namespaceObject.cva)("flex items-start gap-2 rounded-lg border px-3 py-2 text-xs leading-4 text-foreground [&>svg:not([class*='size-'])]:mt-px [&>svg:not([class*='size-'])]:size-3.5 [&>svg]:shrink-0", {
348
+ variants: {
349
+ variant: {
350
+ error: 'border-error/50 bg-error-background/25 [&>svg]:text-error',
351
+ warning: 'border-warning/50 bg-warning-background/25 [&>svg]:text-warning'
352
+ }
353
+ },
354
+ defaultVariants: {
355
+ variant: 'error'
356
+ }
357
+ });
358
+ const ChatComposerError = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, variant, onDismiss, children, ...props }, ref)=>{
359
+ const { strings } = useChatComposer();
360
+ const resolved = variant ?? 'error';
361
+ const Icon = 'warning' === resolved ? external_lucide_react_namespaceObject.TriangleAlert : external_lucide_react_namespaceObject.CircleAlert;
362
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
363
+ ref: ref,
364
+ role: "alert",
365
+ "data-slot": "chat-composer-error",
366
+ "data-variant": resolved,
367
+ className: (0, index_cjs_namespaceObject.cn)(chatComposerErrorVariants({
368
+ variant: resolved
369
+ }), className),
370
+ ...props,
371
+ children: [
372
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
373
+ "aria-hidden": "true"
374
+ }),
375
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
376
+ className: "min-w-0 flex-1",
377
+ children: children
378
+ }),
379
+ onDismiss && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
380
+ variant: "ghost",
381
+ size: "4xs",
382
+ icon: true,
383
+ "aria-label": strings.dismissError,
384
+ className: "-my-0.5 shrink-0",
385
+ onClick: onDismiss,
386
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {})
387
+ })
388
+ ]
389
+ });
390
+ });
391
+ ChatComposerError.displayName = 'ChatComposerError';
392
+ const ChatComposerFooter = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
393
+ ref: ref,
394
+ "data-slot": "chat-composer-footer",
395
+ className: (0, index_cjs_namespaceObject.cn)('px-1 text-center text-xs text-muted-foreground', className),
396
+ ...props
397
+ }));
398
+ ChatComposerFooter.displayName = 'ChatComposerFooter';
399
+ exports.ChatComposer = __webpack_exports__.ChatComposer;
400
+ exports.ChatComposerAttachButton = __webpack_exports__.ChatComposerAttachButton;
401
+ exports.ChatComposerAttachments = __webpack_exports__.ChatComposerAttachments;
402
+ exports.ChatComposerError = __webpack_exports__.ChatComposerError;
403
+ exports.ChatComposerFooter = __webpack_exports__.ChatComposerFooter;
404
+ exports.ChatComposerInputGroup = __webpack_exports__.ChatComposerInputGroup;
405
+ exports.ChatComposerSubmit = __webpack_exports__.ChatComposerSubmit;
406
+ exports.ChatComposerTextarea = __webpack_exports__.ChatComposerTextarea;
407
+ exports.ChatComposerToolbar = __webpack_exports__.ChatComposerToolbar;
408
+ exports.DEFAULT_CHAT_COMPOSER_STRINGS = __webpack_exports__.DEFAULT_CHAT_COMPOSER_STRINGS;
409
+ exports.chatComposerErrorVariants = __webpack_exports__.chatComposerErrorVariants;
410
+ exports.chatComposerVariants = __webpack_exports__.chatComposerVariants;
411
+ exports.useChatComposer = __webpack_exports__.useChatComposer;
412
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
413
+ "ChatComposer",
414
+ "ChatComposerAttachButton",
415
+ "ChatComposerAttachments",
416
+ "ChatComposerError",
417
+ "ChatComposerFooter",
418
+ "ChatComposerInputGroup",
419
+ "ChatComposerSubmit",
420
+ "ChatComposerTextarea",
421
+ "ChatComposerToolbar",
422
+ "DEFAULT_CHAT_COMPOSER_STRINGS",
423
+ "chatComposerErrorVariants",
424
+ "chatComposerVariants",
425
+ "useChatComposer"
426
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
427
+ Object.defineProperty(exports, '__esModule', {
428
+ value: true
429
+ });