@ciridae/ui-agent 0.3.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 (70) hide show
  1. package/README.md +19 -0
  2. package/dist/components/agentic/agent-plan.d.ts +27 -0
  3. package/dist/components/agentic/agent-plan.js +43 -0
  4. package/dist/components/agentic/agent-queue.d.ts +46 -0
  5. package/dist/components/agentic/agent-queue.js +53 -0
  6. package/dist/components/agentic/agent-task.d.ts +16 -0
  7. package/dist/components/agentic/agent-task.js +20 -0
  8. package/dist/components/agentic/approval-request.d.ts +24 -0
  9. package/dist/components/agentic/approval-request.js +57 -0
  10. package/dist/components/agentic/artifact.d.ts +24 -0
  11. package/dist/components/agentic/artifact.js +147 -0
  12. package/dist/components/agentic/attachments.d.ts +124 -0
  13. package/dist/components/agentic/attachments.js +591 -0
  14. package/dist/components/agentic/clipboard.d.ts +2 -0
  15. package/dist/components/agentic/clipboard.js +12 -0
  16. package/dist/components/agentic/code-block.d.ts +44 -0
  17. package/dist/components/agentic/code-block.js +182 -0
  18. package/dist/components/agentic/conversation.d.ts +25 -0
  19. package/dist/components/agentic/conversation.js +56 -0
  20. package/dist/components/agentic/file-tree.d.ts +24 -0
  21. package/dist/components/agentic/file-tree.js +56 -0
  22. package/dist/components/agentic/image.d.ts +9 -0
  23. package/dist/components/agentic/image.js +11 -0
  24. package/dist/components/agentic/inline-citation.d.ts +40 -0
  25. package/dist/components/agentic/inline-citation.js +111 -0
  26. package/dist/components/agentic/message-branch.d.ts +20 -0
  27. package/dist/components/agentic/message-branch.js +83 -0
  28. package/dist/components/agentic/message-response.css +242 -0
  29. package/dist/components/agentic/message-response.css.d.ts +2 -0
  30. package/dist/components/agentic/message.d.ts +29 -0
  31. package/dist/components/agentic/message.js +191 -0
  32. package/dist/components/agentic/model-selector.d.ts +39 -0
  33. package/dist/components/agentic/model-selector.js +47 -0
  34. package/dist/components/agentic/prompt-input-action-menu.d.ts +16 -0
  35. package/dist/components/agentic/prompt-input-action-menu.js +22 -0
  36. package/dist/components/agentic/prompt-input-command.d.ts +18 -0
  37. package/dist/components/agentic/prompt-input-command.js +25 -0
  38. package/dist/components/agentic/prompt-input-hover-card.d.ts +10 -0
  39. package/dist/components/agentic/prompt-input-hover-card.js +13 -0
  40. package/dist/components/agentic/prompt-input-select.d.ts +14 -0
  41. package/dist/components/agentic/prompt-input-select.js +19 -0
  42. package/dist/components/agentic/prompt-input-tabs.d.ts +17 -0
  43. package/dist/components/agentic/prompt-input-tabs.js +45 -0
  44. package/dist/components/agentic/prompt-input.d.ts +66 -0
  45. package/dist/components/agentic/prompt-input.js +227 -0
  46. package/dist/components/agentic/reasoning.d.ts +21 -0
  47. package/dist/components/agentic/reasoning.js +106 -0
  48. package/dist/components/agentic/run-checkpoint.d.ts +13 -0
  49. package/dist/components/agentic/run-checkpoint.js +19 -0
  50. package/dist/components/agentic/run-trace.d.ts +30 -0
  51. package/dist/components/agentic/run-trace.js +56 -0
  52. package/dist/components/agentic/sandbox.d.ts +24 -0
  53. package/dist/components/agentic/sandbox.js +33 -0
  54. package/dist/components/agentic/schema-display.d.ts +39 -0
  55. package/dist/components/agentic/schema-display.js +56 -0
  56. package/dist/components/agentic/shimmer.d.ts +11 -0
  57. package/dist/components/agentic/shimmer.js +16 -0
  58. package/dist/components/agentic/snippet.d.ts +18 -0
  59. package/dist/components/agentic/snippet.js +35 -0
  60. package/dist/components/agentic/sources.d.ts +16 -0
  61. package/dist/components/agentic/sources.js +130 -0
  62. package/dist/components/agentic/terminal.d.ts +24 -0
  63. package/dist/components/agentic/terminal.js +47 -0
  64. package/dist/components/agentic/tool.d.ts +25 -0
  65. package/dist/components/agentic/tool.js +73 -0
  66. package/dist/components/agentic/types.d.ts +172 -0
  67. package/dist/components/agentic/types.js +1 -0
  68. package/dist/components/agentic/web-preview.d.ts +25 -0
  69. package/dist/components/agentic/web-preview.js +33 -0
  70. package/package.json +179 -0
@@ -0,0 +1,242 @@
1
+ @import "katex/dist/katex.min.css";
2
+
3
+ @keyframes sd-fade-in {
4
+ from {
5
+ opacity: 0;
6
+ }
7
+ to {
8
+ opacity: 1;
9
+ }
10
+ }
11
+
12
+ @keyframes sd-blur-in {
13
+ from {
14
+ filter: blur(4px);
15
+ opacity: 0;
16
+ }
17
+ to {
18
+ filter: blur(0);
19
+ opacity: 1;
20
+ }
21
+ }
22
+
23
+ @keyframes sd-slide-up {
24
+ from {
25
+ opacity: 0;
26
+ transform: translateY(4px);
27
+ }
28
+ to {
29
+ opacity: 1;
30
+ transform: translateY(0);
31
+ }
32
+ }
33
+
34
+ [data-sd-animate] {
35
+ animation: var(--sd-animation, sd-fade-in) var(--sd-duration, var(--motion-duration-fast))
36
+ var(--sd-easing, var(--motion-ease-standard)) var(--sd-delay, 0ms) both;
37
+ }
38
+
39
+ .agentic-message-response {
40
+ color: var(--foreground);
41
+ font-size: 0.875rem;
42
+ line-height: 1.6;
43
+ max-width: 100%;
44
+ min-width: 0;
45
+ overflow-wrap: anywhere;
46
+ }
47
+
48
+ .agentic-message-response :where(h1, h2, h3, h4, h5, h6) {
49
+ color: var(--foreground);
50
+ font-family: var(--font-ciridae-display);
51
+ font-weight: var(--font-ciridae-heading-weight);
52
+ letter-spacing: 0;
53
+ line-height: 1.2;
54
+ margin-block: 1.25rem 0.5rem;
55
+ }
56
+
57
+ .agentic-message-response :where(h1) {
58
+ font-size: 1.35rem;
59
+ }
60
+
61
+ .agentic-message-response :where(h2) {
62
+ font-size: 1.2rem;
63
+ }
64
+
65
+ .agentic-message-response :where(h3) {
66
+ font-size: 1.05rem;
67
+ }
68
+
69
+ .agentic-message-response :where(h4, h5, h6) {
70
+ font-size: 0.95rem;
71
+ }
72
+
73
+ .agentic-message-response :where(p) {
74
+ margin-block: 0.75rem;
75
+ }
76
+
77
+ .agentic-message-response :where(ul, ol) {
78
+ margin-block: 0.75rem;
79
+ padding-inline-start: 1.25rem;
80
+ }
81
+
82
+ .agentic-message-response :where(ul) {
83
+ list-style: disc;
84
+ }
85
+
86
+ .agentic-message-response :where(ol) {
87
+ list-style: decimal;
88
+ }
89
+
90
+ .agentic-message-response :where(li) {
91
+ margin-block: 0.25rem;
92
+ padding-inline-start: 0.125rem;
93
+ }
94
+
95
+ .agentic-message-response :where(a) {
96
+ color: var(--foreground);
97
+ text-decoration-color: color-mix(in oklch, var(--foreground) 36%, transparent);
98
+ text-decoration-line: underline;
99
+ text-underline-offset: 0.18em;
100
+ }
101
+
102
+ .agentic-message-response :where(a:hover) {
103
+ text-decoration-color: var(--foreground);
104
+ }
105
+
106
+ .agentic-message-response :where(strong) {
107
+ font-weight: var(--font-ciridae-strong-weight);
108
+ }
109
+
110
+ .agentic-message-response :where(hr) {
111
+ border: 0;
112
+ border-block-start: 1px solid var(--border);
113
+ margin-block: 1rem;
114
+ }
115
+
116
+ .agentic-message-response :where(blockquote) {
117
+ border-inline-start: 2px solid var(--border);
118
+ color: var(--muted-foreground);
119
+ font-style: normal;
120
+ margin-block: 1rem;
121
+ padding-inline-start: 0.875rem;
122
+ }
123
+
124
+ .agentic-message-response :where(code),
125
+ .agentic-message-response :where(kbd),
126
+ .agentic-message-response :where(pre) {
127
+ font-family: var(--font-ciridae-mono);
128
+ font-variant-numeric: tabular-nums;
129
+ }
130
+
131
+ .agentic-message-response :where(:not(pre) > code),
132
+ .agentic-message-response [data-streamdown="inline-code"] {
133
+ background: var(--muted);
134
+ border: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
135
+ border-radius: var(--radius-sm);
136
+ color: var(--foreground);
137
+ display: inline-block;
138
+ font-size: 0.8125rem;
139
+ max-width: 100%;
140
+ overflow: hidden;
141
+ padding: 0.0625rem 0.3125rem;
142
+ text-overflow: ellipsis;
143
+ vertical-align: text-bottom;
144
+ white-space: nowrap;
145
+ }
146
+
147
+ .agentic-message-response [data-streamdown="mermaid-block"] {
148
+ background: color-mix(in oklch, var(--muted) 52%, transparent);
149
+ border: 1px solid var(--border);
150
+ border-radius: var(--radius-lg);
151
+ box-shadow: var(--shadow-xs);
152
+ margin-block: 1rem;
153
+ max-width: 100%;
154
+ overflow: hidden;
155
+ padding: 0.5rem;
156
+ }
157
+
158
+ .agentic-message-response [data-streamdown="mermaid-block-actions"] {
159
+ align-items: center;
160
+ background: color-mix(in oklch, var(--background) 88%, transparent);
161
+ border: 1px solid var(--border);
162
+ border-radius: var(--radius-md);
163
+ gap: 0.125rem;
164
+ min-height: 1.75rem;
165
+ padding: 0.125rem;
166
+ }
167
+
168
+ .agentic-message-response [data-streamdown="table-copy-button"],
169
+ .agentic-message-response [data-streamdown="table-download-button"],
170
+ .agentic-message-response [data-streamdown="mermaid-copy-button"],
171
+ .agentic-message-response [data-streamdown="mermaid-download-button"] {
172
+ align-items: center;
173
+ color: var(--muted-foreground);
174
+ display: inline-flex;
175
+ height: 1.5rem;
176
+ justify-content: center;
177
+ transition:
178
+ background-color var(--motion-duration-fast) var(--motion-ease-standard),
179
+ color var(--motion-duration-fast) var(--motion-ease-standard);
180
+ width: 1.5rem;
181
+ }
182
+
183
+ .agentic-message-response [data-streamdown="table-copy-button"]:hover,
184
+ .agentic-message-response [data-streamdown="table-download-button"]:hover,
185
+ .agentic-message-response [data-streamdown="mermaid-copy-button"]:hover,
186
+ .agentic-message-response [data-streamdown="mermaid-download-button"]:hover {
187
+ background: var(--accent);
188
+ color: var(--accent-foreground);
189
+ }
190
+
191
+ .agentic-message-response :where(table) {
192
+ border: 1px solid var(--border);
193
+ border-collapse: separate;
194
+ border-radius: var(--radius-md);
195
+ border-spacing: 0;
196
+ display: block;
197
+ margin-block: 1rem;
198
+ max-width: 100%;
199
+ overflow-x: auto;
200
+ width: max-content;
201
+ }
202
+
203
+ .agentic-message-response :where(thead) {
204
+ background: var(--muted);
205
+ color: var(--table-header-foreground);
206
+ }
207
+
208
+ .agentic-message-response :where(th, td) {
209
+ border-block-end: 1px solid var(--border);
210
+ font-size: 0.8125rem;
211
+ padding: 0.5rem 0.625rem;
212
+ text-align: start;
213
+ vertical-align: top;
214
+ }
215
+
216
+ .agentic-message-response :where(th) {
217
+ font-weight: var(--font-ciridae-metadata-weight);
218
+ }
219
+
220
+ .agentic-message-response :where(tr:last-child td) {
221
+ border-block-end: 0;
222
+ }
223
+
224
+ .agentic-message-response :where(.katex-display) {
225
+ overflow-x: auto;
226
+ overflow-y: hidden;
227
+ padding-block: 0.25rem;
228
+ }
229
+
230
+ .agentic-message-response [data-streamdown="mermaid"] {
231
+ background: var(--background);
232
+ border: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
233
+ border-radius: var(--radius-md);
234
+ color: var(--foreground);
235
+ padding: 1rem;
236
+ }
237
+
238
+ @media (prefers-reduced-motion: reduce) {
239
+ .agentic-message-response [data-sd-animate] {
240
+ animation: none !important;
241
+ }
242
+ }
@@ -0,0 +1,2 @@
1
+ declare const stylesheet: string;
2
+ export default stylesheet;
@@ -0,0 +1,29 @@
1
+ import type * as React from "react";
2
+ import { Streamdown } from "streamdown";
3
+ import { MessageBranch, MessageBranchContent, MessageBranchNext, MessageBranchPage, MessageBranchPrevious, MessageBranchSelector, type MessageBranchContentProps, type MessageBranchNextProps, type MessageBranchPageProps, type MessageBranchPreviousProps, type MessageBranchProps, type MessageBranchSelectorProps } from "@ciridae/ui-agent/message-branch";
4
+ import type { AgenticMessageRole } from "@ciridae/ui-agent/types";
5
+ import "@ciridae/ui-agent/message-response.css";
6
+ import { Button } from "@ciridae/ui/button";
7
+ type MessageProps = React.ComponentProps<"div"> & {
8
+ role: AgenticMessageRole;
9
+ };
10
+ type MessageContentProps = React.ComponentProps<"div"> & {
11
+ variant?: "default" | "bubble";
12
+ };
13
+ type MessageActionsProps = React.ComponentProps<"div">;
14
+ type MessageActionProps = React.ComponentProps<typeof Button> & {
15
+ label?: string;
16
+ tooltip?: string;
17
+ };
18
+ type MessageToolbarProps = React.ComponentProps<"div">;
19
+ type MessageResponseProps = React.ComponentProps<typeof Streamdown> & {
20
+ isStreaming?: boolean;
21
+ };
22
+ declare function Message({ className, role, ...props }: MessageProps): React.JSX.Element;
23
+ declare function MessageContent({ className, variant, ...props }: MessageContentProps): React.JSX.Element;
24
+ declare function MessageActions({ className, ...props }: MessageActionsProps): React.JSX.Element;
25
+ declare function MessageAction({ children, label, tooltip, variant, size, ...props }: MessageActionProps): React.JSX.Element;
26
+ declare const MessageResponse: React.MemoExoticComponent<({ animated, className, components, isStreaming, plugins, ...props }: MessageResponseProps) => React.JSX.Element>;
27
+ declare function MessageToolbar({ className, ...props }: MessageToolbarProps): React.JSX.Element;
28
+ export { Message, MessageAction, MessageActions, MessageBranch, MessageBranchContent, MessageBranchNext, MessageBranchPage, MessageBranchPrevious, MessageBranchSelector, MessageContent, MessageResponse, MessageToolbar, };
29
+ export type { MessageActionProps, MessageActionsProps, MessageBranchContentProps, MessageBranchNextProps, MessageBranchPageProps, MessageBranchPreviousProps, MessageBranchProps, MessageBranchSelectorProps, MessageContentProps, MessageProps, MessageResponseProps, MessageToolbarProps, };
@@ -0,0 +1,191 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cjk } from "@streamdown/cjk";
3
+ import { code } from "@streamdown/code";
4
+ import { math } from "@streamdown/math";
5
+ import { mermaid } from "@streamdown/mermaid";
6
+ import { createContext, memo, useContext, useEffect, useMemo, useState } from "react";
7
+ import { bundledLanguages } from "shiki";
8
+ import { Streamdown } from "streamdown";
9
+ import { CodeBlock, CodeBlockContent, CodeBlockCopyButton, CodeBlockHeader, CodeBlockTitle, } from "@ciridae/ui-agent/code-block";
10
+ import { MessageBranch, MessageBranchContent, MessageBranchNext, MessageBranchPage, MessageBranchPrevious, MessageBranchSelector, } from "@ciridae/ui-agent/message-branch";
11
+ import "@ciridae/ui-agent/message-response.css";
12
+ import { Button } from "@ciridae/ui/button";
13
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@ciridae/ui/tooltip";
14
+ import { cn } from "@ciridae/ui/utils";
15
+ import { css, cva } from "@ciridae/ui/styled-system/css";
16
+ const MessageResponseStreamingContext = createContext(false);
17
+ const streamdownPlugins = { cjk, code, math, mermaid };
18
+ const messageResponseComponents = {
19
+ code: MessageResponseCode,
20
+ };
21
+ const messageResponseAnimation = {
22
+ animation: "fade-in",
23
+ duration: 200,
24
+ easing: "var(--motion-ease-standard)",
25
+ sep: "word",
26
+ };
27
+ const messageClassName = css({
28
+ display: "flex",
29
+ flexDirection: "column",
30
+ gap: "gap.2",
31
+ width: "full",
32
+ "&[data-role='user']": {
33
+ alignItems: "flex-end",
34
+ },
35
+ "&[data-role='assistant']": {
36
+ alignItems: "flex-start",
37
+ },
38
+ "&[data-role='system']": {
39
+ alignItems: "flex-start",
40
+ paddingBlock: "spacing.1",
41
+ },
42
+ });
43
+ const messageContentVariants = cva({
44
+ base: {
45
+ fontSize: "sm",
46
+ lineHeight: "relaxed",
47
+ maxWidth: "full",
48
+ minWidth: 0,
49
+ ".group\\/message[data-role='user'] &": {
50
+ backgroundColor: "secondary",
51
+ borderColor: "border",
52
+ borderRadius: "lg",
53
+ borderStyle: "solid",
54
+ borderWidth: "default",
55
+ boxShadow: "xs",
56
+ color: "secondary.foreground",
57
+ maxWidth: "min(34rem, 78%)",
58
+ paddingBlock: "spacing.3",
59
+ paddingInline: "spacing.4",
60
+ },
61
+ ".group\\/message[data-role='assistant'] &": {
62
+ color: "foreground",
63
+ },
64
+ ".group\\/message[data-role='system'] &": {
65
+ backgroundColor: "muted/30",
66
+ borderColor: "border",
67
+ borderRadius: "md",
68
+ borderStyle: "solid",
69
+ borderWidth: "default",
70
+ color: "muted.foreground",
71
+ fontSize: "xs",
72
+ maxWidth: "full",
73
+ paddingBlock: "spacing.2",
74
+ paddingInline: "spacing.3",
75
+ },
76
+ },
77
+ variants: {
78
+ variant: {
79
+ default: {},
80
+ bubble: {
81
+ backgroundColor: "card",
82
+ borderColor: "border",
83
+ borderRadius: "lg",
84
+ borderStyle: "solid",
85
+ borderWidth: "default",
86
+ boxShadow: "xs",
87
+ color: "card.foreground",
88
+ paddingBlock: "spacing.3",
89
+ paddingInline: "spacing.4",
90
+ },
91
+ },
92
+ },
93
+ defaultVariants: {
94
+ variant: "default",
95
+ },
96
+ });
97
+ const messageActionsClassName = css({
98
+ alignItems: "center",
99
+ display: "flex",
100
+ gap: "gap.1",
101
+ });
102
+ const messageResponseCodeBlockClassName = css({
103
+ marginBlock: "spacing.4",
104
+ });
105
+ const messageResponseCodeTitleClassName = css({
106
+ color: "muted.foreground",
107
+ fontFamily: "mono",
108
+ fontSize: "xs",
109
+ });
110
+ const messageToolbarClassName = css({
111
+ alignItems: "center",
112
+ display: "flex",
113
+ gap: "gap.3",
114
+ justifyContent: "space-between",
115
+ marginTop: "spacing.1",
116
+ maxWidth: "full",
117
+ width: "full",
118
+ ".group\\/message[data-role='user'] &": {
119
+ marginLeft: "auto",
120
+ },
121
+ ".group\\/message[data-role='system'] &": {
122
+ maxWidth: "full",
123
+ },
124
+ });
125
+ function Message({ className, role, ...props }) {
126
+ return (_jsx("div", { "data-role": role, "data-slot": "message", className: cn("group/message", messageClassName, className), ...props }));
127
+ }
128
+ function MessageContent({ className, variant = "default", ...props }) {
129
+ return (_jsx("div", { "data-slot": "message-content", "data-variant": variant, className: cn(messageContentVariants({ variant }), className), ...props }));
130
+ }
131
+ function MessageActions({ className, ...props }) {
132
+ return (_jsx("div", { "data-slot": "message-actions", className: cn(messageActionsClassName, className), ...props }));
133
+ }
134
+ function MessageAction({ children, label, tooltip, variant = "ghost", size = "icon-sm", ...props }) {
135
+ const accessibleLabel = props["aria-label"] ?? label ?? tooltip;
136
+ const button = (_jsxs(Button, { "aria-label": accessibleLabel, size: size, type: "button", variant: variant, ...props, children: [children, label || tooltip ? _jsx("span", { className: "sr-only", children: label ?? tooltip }) : null] }));
137
+ if (!tooltip)
138
+ return button;
139
+ return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { children: _jsx("p", { children: tooltip }) })] }) }));
140
+ }
141
+ const MessageResponse = memo(function MessageResponse({ animated, className, components, isStreaming = false, plugins, ...props }) {
142
+ const prefersReducedMotion = usePrefersReducedMotion();
143
+ const resolvedAnimation = animated === true ? messageResponseAnimation : animated;
144
+ const resolvedComponents = useMemo(() => ({ ...messageResponseComponents, ...components }), [components]);
145
+ const resolvedPlugins = useMemo(() => ({ ...streamdownPlugins, ...plugins }), [plugins]);
146
+ return (_jsx(MessageResponseStreamingContext.Provider, { value: isStreaming, children: _jsx(Streamdown, { animated: prefersReducedMotion ? false : resolvedAnimation, className: cn("agentic-message-response", className), components: resolvedComponents, plugins: resolvedPlugins, ...props }) }));
147
+ });
148
+ MessageResponse.displayName = "MessageResponse";
149
+ function MessageResponseCode({ children, className, "data-block": dataBlock, ...props }) {
150
+ const isStreaming = useContext(MessageResponseStreamingContext);
151
+ if (!dataBlock) {
152
+ return (_jsx("code", { className: className, ...props, children: children }));
153
+ }
154
+ const language = getCodeLanguage(className);
155
+ const codeText = getCodeText(children);
156
+ return (_jsxs(CodeBlock, { code: codeText, language: language, className: messageResponseCodeBlockClassName, children: [_jsxs(CodeBlockHeader, { children: [_jsx(CodeBlockTitle, { className: messageResponseCodeTitleClassName, children: language }), _jsx(CodeBlockCopyButton, { size: "icon-sm" })] }), _jsx(CodeBlockContent, { streaming: isStreaming })] }));
157
+ }
158
+ function getCodeLanguage(className) {
159
+ const language = className?.match(/language-([^\s]+)/)?.[1];
160
+ if (language && isBundledLanguage(language))
161
+ return language;
162
+ return "tsx";
163
+ }
164
+ function isBundledLanguage(language) {
165
+ return language in bundledLanguages;
166
+ }
167
+ function getCodeText(children) {
168
+ if (typeof children === "string")
169
+ return children.replace(/\n$/, "");
170
+ if (typeof children === "number")
171
+ return String(children);
172
+ if (Array.isArray(children))
173
+ return children.map(getCodeText).join("");
174
+ return "";
175
+ }
176
+ function usePrefersReducedMotion() {
177
+ const [prefersReducedMotion, setPrefersReducedMotion] = useState(() => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches);
178
+ useEffect(() => {
179
+ if (typeof window === "undefined")
180
+ return;
181
+ const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
182
+ const handleChange = (event) => setPrefersReducedMotion(event.matches);
183
+ mediaQuery.addEventListener("change", handleChange);
184
+ return () => mediaQuery.removeEventListener("change", handleChange);
185
+ }, []);
186
+ return prefersReducedMotion;
187
+ }
188
+ function MessageToolbar({ className, ...props }) {
189
+ return (_jsx("div", { "data-slot": "message-toolbar", className: cn(messageToolbarClassName, className), ...props }));
190
+ }
191
+ export { Message, MessageAction, MessageActions, MessageBranch, MessageBranchContent, MessageBranchNext, MessageBranchPage, MessageBranchPrevious, MessageBranchSelector, MessageContent, MessageResponse, MessageToolbar, };
@@ -0,0 +1,39 @@
1
+ import type * as React from "react";
2
+ import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "@ciridae/ui/command";
3
+ import { Dialog, DialogContent, DialogTrigger } from "@ciridae/ui/dialog";
4
+ type ModelSelectorProps = React.ComponentProps<typeof Dialog>;
5
+ type ModelSelectorTriggerProps = React.ComponentProps<typeof DialogTrigger>;
6
+ type ModelSelectorContentProps = React.ComponentProps<typeof DialogContent> & {
7
+ title?: React.ReactNode;
8
+ };
9
+ type ModelSelectorDialogProps = React.ComponentProps<typeof CommandDialog>;
10
+ type ModelSelectorInputProps = React.ComponentProps<typeof CommandInput>;
11
+ type ModelSelectorListProps = React.ComponentProps<typeof CommandList>;
12
+ type ModelSelectorEmptyProps = React.ComponentProps<typeof CommandEmpty>;
13
+ type ModelSelectorGroupProps = React.ComponentProps<typeof CommandGroup>;
14
+ type ModelSelectorItemProps = React.ComponentProps<typeof CommandItem>;
15
+ type ModelSelectorShortcutProps = React.ComponentProps<typeof CommandShortcut>;
16
+ type ModelSelectorSeparatorProps = React.ComponentProps<typeof CommandSeparator>;
17
+ type ModelSelectorLogoProps = Omit<React.ComponentProps<"img">, "alt" | "src"> & {
18
+ alt?: string;
19
+ provider: string;
20
+ src?: string;
21
+ };
22
+ type ModelSelectorLogoGroupProps = React.ComponentProps<"div">;
23
+ type ModelSelectorNameProps = React.ComponentProps<"span">;
24
+ declare function ModelSelector(props: ModelSelectorProps): React.JSX.Element;
25
+ declare function ModelSelectorTrigger(props: ModelSelectorTriggerProps): React.JSX.Element;
26
+ declare function ModelSelectorContent({ children, className, title, ...props }: ModelSelectorContentProps): React.JSX.Element;
27
+ declare function ModelSelectorDialog(props: ModelSelectorDialogProps): React.JSX.Element;
28
+ declare function ModelSelectorInput({ className, ...props }: ModelSelectorInputProps): React.JSX.Element;
29
+ declare function ModelSelectorList(props: ModelSelectorListProps): React.JSX.Element;
30
+ declare function ModelSelectorEmpty(props: ModelSelectorEmptyProps): React.JSX.Element;
31
+ declare function ModelSelectorGroup(props: ModelSelectorGroupProps): React.JSX.Element;
32
+ declare function ModelSelectorItem(props: ModelSelectorItemProps): React.JSX.Element;
33
+ declare function ModelSelectorShortcut(props: ModelSelectorShortcutProps): React.JSX.Element;
34
+ declare function ModelSelectorSeparator(props: ModelSelectorSeparatorProps): React.JSX.Element;
35
+ declare function ModelSelectorLogo({ alt, className, provider, src, ...props }: ModelSelectorLogoProps): React.JSX.Element;
36
+ declare function ModelSelectorLogoGroup({ className, ...props }: ModelSelectorLogoGroupProps): React.JSX.Element;
37
+ declare function ModelSelectorName({ className, ...props }: ModelSelectorNameProps): React.JSX.Element;
38
+ export { ModelSelector, ModelSelectorContent, ModelSelectorDialog, ModelSelectorEmpty, ModelSelectorGroup, ModelSelectorInput, ModelSelectorItem, ModelSelectorList, ModelSelectorLogo, ModelSelectorLogoGroup, ModelSelectorName, ModelSelectorSeparator, ModelSelectorShortcut, ModelSelectorTrigger, };
39
+ export type { ModelSelectorContentProps, ModelSelectorDialogProps, ModelSelectorEmptyProps, ModelSelectorGroupProps, ModelSelectorInputProps, ModelSelectorItemProps, ModelSelectorListProps, ModelSelectorLogoGroupProps, ModelSelectorLogoProps, ModelSelectorNameProps, ModelSelectorProps, ModelSelectorSeparatorProps, ModelSelectorShortcutProps, ModelSelectorTriggerProps, };
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "@ciridae/ui/command";
3
+ import { Dialog, DialogContent, DialogTitle, DialogTrigger } from "@ciridae/ui/dialog";
4
+ import { cn } from "@ciridae/ui/utils";
5
+ function ModelSelector(props) {
6
+ return _jsx(Dialog, { ...props });
7
+ }
8
+ function ModelSelectorTrigger(props) {
9
+ return _jsx(DialogTrigger, { ...props });
10
+ }
11
+ function ModelSelectorContent({ children, className, title = "Model selector", ...props }) {
12
+ return (_jsxs(DialogContent, { "aria-describedby": undefined, className: cn("overflow-hidden p-0 sm:max-w-xl", className), ...props, children: [_jsx(DialogTitle, { className: "sr-only", children: title }), _jsx(Command, { className: "**:data-[slot=command-input-wrapper]:h-auto", children: children })] }));
13
+ }
14
+ function ModelSelectorDialog(props) {
15
+ return _jsx(CommandDialog, { ...props });
16
+ }
17
+ function ModelSelectorInput({ className, ...props }) {
18
+ return _jsx(CommandInput, { className: cn("h-auto py-3", className), ...props });
19
+ }
20
+ function ModelSelectorList(props) {
21
+ return _jsx(CommandList, { ...props });
22
+ }
23
+ function ModelSelectorEmpty(props) {
24
+ return _jsx(CommandEmpty, { ...props });
25
+ }
26
+ function ModelSelectorGroup(props) {
27
+ return _jsx(CommandGroup, { ...props });
28
+ }
29
+ function ModelSelectorItem(props) {
30
+ return _jsx(CommandItem, { ...props });
31
+ }
32
+ function ModelSelectorShortcut(props) {
33
+ return _jsx(CommandShortcut, { ...props });
34
+ }
35
+ function ModelSelectorSeparator(props) {
36
+ return _jsx(CommandSeparator, { ...props });
37
+ }
38
+ function ModelSelectorLogo({ alt, className, provider, src, ...props }) {
39
+ return (_jsx("img", { alt: alt ?? `${provider} logo`, className: cn("size-4 rounded-sm bg-background object-contain p-0.5 ring-1 ring-border", className), height: 16, src: src ?? `https://models.dev/logos/${provider}.svg`, width: 16, ...props }));
40
+ }
41
+ function ModelSelectorLogoGroup({ className, ...props }) {
42
+ return (_jsx("div", { "data-slot": "model-selector-logo-group", className: cn("flex shrink-0 items-center -space-x-1 [&>img]:rounded-full [&>img]:bg-background [&>img]:p-px [&>img]:ring-1", className), ...props }));
43
+ }
44
+ function ModelSelectorName({ className, ...props }) {
45
+ return (_jsx("span", { "data-slot": "model-selector-name", className: cn("min-w-0 flex-1 truncate text-left", className), ...props }));
46
+ }
47
+ export { ModelSelector, ModelSelectorContent, ModelSelectorDialog, ModelSelectorEmpty, ModelSelectorGroup, ModelSelectorInput, ModelSelectorItem, ModelSelectorList, ModelSelectorLogo, ModelSelectorLogoGroup, ModelSelectorName, ModelSelectorSeparator, ModelSelectorShortcut, ModelSelectorTrigger, };
@@ -0,0 +1,16 @@
1
+ import type * as React from "react";
2
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem } from "@ciridae/ui/dropdown-menu";
3
+ import { InputGroupButton } from "@ciridae/ui/input-group";
4
+ type PromptInputActionMenuProps = React.ComponentProps<typeof DropdownMenu>;
5
+ type PromptInputActionMenuTriggerProps = React.ComponentProps<typeof InputGroupButton> & {
6
+ label?: string;
7
+ tooltip?: string;
8
+ };
9
+ type PromptInputActionMenuContentProps = React.ComponentProps<typeof DropdownMenuContent>;
10
+ type PromptInputActionMenuItemProps = React.ComponentProps<typeof DropdownMenuItem>;
11
+ declare function PromptInputActionMenu(props: PromptInputActionMenuProps): React.JSX.Element;
12
+ declare function PromptInputActionMenuTrigger({ children, className, label, size, tooltip, variant, ...props }: PromptInputActionMenuTriggerProps): React.JSX.Element;
13
+ declare function PromptInputActionMenuContent({ className, sideOffset, ...props }: PromptInputActionMenuContentProps): React.JSX.Element;
14
+ declare function PromptInputActionMenuItem({ className, ...props }: PromptInputActionMenuItemProps): React.JSX.Element;
15
+ export { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, };
16
+ export type { PromptInputActionMenuContentProps, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTriggerProps, };
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { MoreHorizontalIcon } from "lucide-react";
3
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@ciridae/ui/dropdown-menu";
4
+ import { InputGroupButton } from "@ciridae/ui/input-group";
5
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@ciridae/ui/tooltip";
6
+ import { cn } from "@ciridae/ui/utils";
7
+ function PromptInputActionMenu(props) {
8
+ return _jsx(DropdownMenu, { ...props });
9
+ }
10
+ function PromptInputActionMenuTrigger({ children, className, label = "Open prompt actions", size = "icon-sm", tooltip = "Prompt actions", variant = "ghost", ...props }) {
11
+ const trigger = (_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(InputGroupButton, { "aria-label": label, "data-slot": "prompt-input-action-menu-trigger", size: size, variant: variant, className: cn("shrink-0 text-muted-foreground", className), ...props, children: children ?? _jsx(MoreHorizontalIcon, {}) }) }));
12
+ if (!tooltip)
13
+ return trigger;
14
+ return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: trigger }), _jsx(TooltipContent, { children: tooltip })] }) }));
15
+ }
16
+ function PromptInputActionMenuContent({ className, sideOffset = 6, ...props }) {
17
+ return (_jsx(DropdownMenuContent, { "data-slot": "prompt-input-action-menu-content", sideOffset: sideOffset, className: cn("min-w-52", className), ...props }));
18
+ }
19
+ function PromptInputActionMenuItem({ className, ...props }) {
20
+ return (_jsx(DropdownMenuItem, { "data-slot": "prompt-input-action-menu-item", className: cn("gap-2", className), ...props }));
21
+ }
22
+ export { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, };
@@ -0,0 +1,18 @@
1
+ import type * as React from "react";
2
+ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "@ciridae/ui/command";
3
+ type PromptInputCommandProps = React.ComponentProps<typeof Command>;
4
+ type PromptInputCommandInputProps = React.ComponentProps<typeof CommandInput>;
5
+ type PromptInputCommandListProps = React.ComponentProps<typeof CommandList>;
6
+ type PromptInputCommandEmptyProps = React.ComponentProps<typeof CommandEmpty>;
7
+ type PromptInputCommandGroupProps = React.ComponentProps<typeof CommandGroup>;
8
+ type PromptInputCommandItemProps = React.ComponentProps<typeof CommandItem>;
9
+ type PromptInputCommandSeparatorProps = React.ComponentProps<typeof CommandSeparator>;
10
+ declare function PromptInputCommand({ className, ...props }: PromptInputCommandProps): React.JSX.Element;
11
+ declare function PromptInputCommandInput(props: PromptInputCommandInputProps): React.JSX.Element;
12
+ declare function PromptInputCommandList({ className, ...props }: PromptInputCommandListProps): React.JSX.Element;
13
+ declare function PromptInputCommandEmpty(props: PromptInputCommandEmptyProps): React.JSX.Element;
14
+ declare function PromptInputCommandGroup(props: PromptInputCommandGroupProps): React.JSX.Element;
15
+ declare function PromptInputCommandItem({ className, ...props }: PromptInputCommandItemProps): React.JSX.Element;
16
+ declare function PromptInputCommandSeparator(props: PromptInputCommandSeparatorProps): React.JSX.Element;
17
+ export { PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, };
18
+ export type { PromptInputCommandEmptyProps, PromptInputCommandGroupProps, PromptInputCommandInputProps, PromptInputCommandItemProps, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparatorProps, };
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, } from "@ciridae/ui/command";
3
+ import { cn } from "@ciridae/ui/utils";
4
+ function PromptInputCommand({ className, ...props }) {
5
+ return (_jsx(Command, { "data-slot": "prompt-input-command", className: cn("rounded-md border bg-popover shadow-xs", className), ...props }));
6
+ }
7
+ function PromptInputCommandInput(props) {
8
+ return _jsx(CommandInput, { "data-slot": "prompt-input-command-input", ...props });
9
+ }
10
+ function PromptInputCommandList({ className, ...props }) {
11
+ return (_jsx(CommandList, { "data-slot": "prompt-input-command-list", className: cn("max-h-56", className), ...props }));
12
+ }
13
+ function PromptInputCommandEmpty(props) {
14
+ return _jsx(CommandEmpty, { "data-slot": "prompt-input-command-empty", ...props });
15
+ }
16
+ function PromptInputCommandGroup(props) {
17
+ return _jsx(CommandGroup, { "data-slot": "prompt-input-command-group", ...props });
18
+ }
19
+ function PromptInputCommandItem({ className, ...props }) {
20
+ return (_jsx(CommandItem, { "data-slot": "prompt-input-command-item", className: cn("gap-2", className), ...props }));
21
+ }
22
+ function PromptInputCommandSeparator(props) {
23
+ return _jsx(CommandSeparator, { "data-slot": "prompt-input-command-separator", ...props });
24
+ }
25
+ export { PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, };
@@ -0,0 +1,10 @@
1
+ import type * as React from "react";
2
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from "@ciridae/ui/hover-card";
3
+ type PromptInputHoverCardProps = React.ComponentProps<typeof HoverCard>;
4
+ type PromptInputHoverCardTriggerProps = React.ComponentProps<typeof HoverCardTrigger>;
5
+ type PromptInputHoverCardContentProps = React.ComponentProps<typeof HoverCardContent>;
6
+ declare function PromptInputHoverCard(props: PromptInputHoverCardProps): React.JSX.Element;
7
+ declare function PromptInputHoverCardTrigger(props: PromptInputHoverCardTriggerProps): React.JSX.Element;
8
+ declare function PromptInputHoverCardContent({ align, className, sideOffset, ...props }: PromptInputHoverCardContentProps): React.JSX.Element;
9
+ export { PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger };
10
+ export type { PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTriggerProps, };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from "@ciridae/ui/hover-card";
3
+ import { cn } from "@ciridae/ui/utils";
4
+ function PromptInputHoverCard(props) {
5
+ return _jsx(HoverCard, { ...props });
6
+ }
7
+ function PromptInputHoverCardTrigger(props) {
8
+ return _jsx(HoverCardTrigger, { "data-slot": "prompt-input-hover-card-trigger", ...props });
9
+ }
10
+ function PromptInputHoverCardContent({ align = "start", className, sideOffset = 6, ...props }) {
11
+ return (_jsx(HoverCardContent, { "data-slot": "prompt-input-hover-card-content", align: align, sideOffset: sideOffset, className: cn("w-72 p-3", className), ...props }));
12
+ }
13
+ export { PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger };