@vadimcomanescu/nadicode-design-system 2.0.7 → 2.0.8
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.
- package/.agents/skills/seed/SKILL.md +17 -8
- package/.agents/skills/seed/contract.md +5 -5
- package/.agents/skills/seed/intent-map.md +3 -3
- package/.agents/skills/seed/recipes/agents-chat.md +44 -20
- package/.agents/skills/seed/references/blocks.md +5 -2
- package/.agents/skills/seed/references/components.md +22 -2
- package/.agents/skills/seed/references/dashboard-patterns.md +12 -12
- package/.agents/skills/seed/references/nextjs.md +20 -80
- package/.agents/skills/seed/references/tokens.md +57 -248
- package/README.md +43 -215
- package/contracts/block-props-schemas.json +2186 -0
- package/contracts/component-props-schemas.json +8322 -0
- package/contracts/consumer-contract.json +178 -0
- package/contracts/consumer-intent-map.json +707 -0
- package/contracts/message-catalog-contract.json +820 -0
- package/contracts/page-kit-props-schemas.json +1894 -0
- package/contracts/public-surface-registry.json +6162 -0
- package/contracts/public-surface-registry.schema.json +227 -0
- package/contracts/release-governance-baseline.json +850 -0
- package/contracts/spec-manifest.json +46 -0
- package/dist/catalog.json +284 -81
- package/dist/chunk-4IGBBIYW.js +47 -0
- package/dist/chunk-4WPZ6T7V.js +186 -0
- package/dist/{chunk-OHOOQUVJ.js → chunk-C7WHMSF3.js} +2 -1
- package/dist/{chunk-4K3PATUT.js → chunk-EEL4RAPC.js} +13 -1
- package/dist/{chunk-ILIHQ2KZ.js → chunk-EK43W2Y6.js} +16 -10
- package/dist/{chunk-IDKZEPWK.js → chunk-FV2G6SAF.js} +6 -5
- package/dist/chunk-HWHJ6IRQ.js +78 -0
- package/dist/{chunk-AUSYEAIJ.js → chunk-I66XWYSS.js} +32 -8
- package/dist/chunk-JDJY4ABS.js +60 -0
- package/dist/{chunk-GV4PKHG4.js → chunk-KWILREVQ.js} +2 -2
- package/dist/{chunk-WI37ZYIF.js → chunk-M4XKO45H.js} +13 -1
- package/dist/{chunk-6N6CSJVE.js → chunk-OJ7OO3QB.js} +2 -2
- package/dist/{chunk-ZHTQF2KI.js → chunk-OSNTB6RY.js} +29 -22
- package/dist/{chunk-GMMPLZLC.js → chunk-PDSQC6VE.js} +1 -1
- package/dist/chunk-QQOWC53X.js +98 -0
- package/dist/chunk-VJ5VD4UT.js +91 -0
- package/dist/{chunk-TUKZKU72.js → chunk-ZKLB5N3Q.js} +1 -1
- package/dist/components/blocks/AgentConversationBlock.d.ts +6 -1
- package/dist/components/blocks/AgentConversationBlock.js +44 -42
- package/dist/components/blocks/AgentRunOverviewBlock.js +1 -1
- package/dist/components/blocks/AgentWorkbenchBlock.d.ts +5 -1
- package/dist/components/blocks/AgentWorkbenchBlock.js +47 -46
- package/dist/components/blocks/AuthLayout.js +2 -2
- package/dist/components/blocks/BannerBlock.js +38 -38
- package/dist/components/blocks/CallToActionBlock.js +2 -2
- package/dist/components/blocks/ChangelogBlock.js +39 -39
- package/dist/components/blocks/ChartBlock.js +38 -38
- package/dist/components/blocks/ChartCollectionBlock.js +1 -1
- package/dist/components/blocks/ChatLayout.d.ts +4 -1
- package/dist/components/blocks/ChatLayout.js +39 -39
- package/dist/components/blocks/CodeBlock.js +2 -2
- package/dist/components/blocks/ContactBlock.js +2 -2
- package/dist/components/blocks/CreateBlock.js +39 -39
- package/dist/components/blocks/DataGridBlock.js +40 -40
- package/dist/components/blocks/DirectoryBlock.js +43 -43
- package/dist/components/blocks/FAQBlock.js +38 -38
- package/dist/components/blocks/FeatureBlock.js +38 -38
- package/dist/components/blocks/GalleryBlock.js +38 -38
- package/dist/components/blocks/HeaderBlock.js +38 -38
- package/dist/components/blocks/HeroBlock.js +41 -41
- package/dist/components/blocks/HeroSectionBlock.js +55 -59
- package/dist/components/blocks/IntegrationsBlock.js +40 -40
- package/dist/components/blocks/InteractiveAreaChartBlock.js +38 -38
- package/dist/components/blocks/KanbanDemoBlock.js +3 -3
- package/dist/components/blocks/LoginBlock.js +2 -2
- package/dist/components/blocks/LogoCloud.js +2 -13
- package/dist/components/blocks/NavUser.js +42 -42
- package/dist/components/blocks/NotFoundBlock.js +41 -41
- package/dist/components/blocks/OnboardingBlock.js +38 -38
- package/dist/components/blocks/PricingBlock.js +4 -4
- package/dist/components/blocks/ProcessFlowBlock.js +2 -2
- package/dist/components/blocks/SettingsLayout.js +42 -42
- package/dist/components/blocks/SignUpBlock.js +1 -1
- package/dist/components/blocks/SocialProofBlock.js +4 -3
- package/dist/components/blocks/StatsBlock.js +38 -38
- package/dist/components/blocks/StatsMarketingBlock.js +2 -2
- package/dist/components/blocks/TestimonialsBlock.js +2 -1
- package/dist/components/blocks/TwoFactorChallengeBlock.js +38 -38
- package/dist/components/blocks/TwoFactorSetupBlock.js +41 -41
- package/dist/components/blocks/VoiceAgentCard.d.ts +3 -1
- package/dist/components/blocks/VoiceAgentCard.js +7 -76
- package/dist/components/blocks/WizardBlock.js +39 -39
- package/dist/components/blocks/user/InviteUserModal.js +38 -38
- package/dist/components/logos/index.js +2 -2
- package/dist/components/page-kits/AgentsChatPageKit.js +59 -58
- package/dist/components/page-kits/AnalyticsPageKit.js +44 -44
- package/dist/components/page-kits/BlogContentPageKit.js +43 -43
- package/dist/components/page-kits/CheckoutPageKit.js +41 -41
- package/dist/components/page-kits/CompanySuitePageKit.js +47 -47
- package/dist/components/page-kits/CrudFormPageKit.js +44 -44
- package/dist/components/page-kits/CrudListDetailPageKit.js +44 -44
- package/dist/components/page-kits/DashboardPageKit.js +44 -44
- package/dist/components/page-kits/KanbanBoardPageKit.js +47 -47
- package/dist/components/page-kits/LandingPageKit.js +50 -49
- package/dist/components/page-kits/LoginPageKit.js +2 -2
- package/dist/components/page-kits/MarketingShellPageKit.js +40 -40
- package/dist/components/page-kits/NavigationShellPageKit.js +42 -42
- package/dist/components/page-kits/OnboardingPageKit.js +44 -44
- package/dist/components/page-kits/PricingPageKit.js +46 -46
- package/dist/components/page-kits/ProfileSettingsPageKit.js +2 -2
- package/dist/components/page-kits/ServiceSuitePageKit.js +47 -46
- package/dist/components/page-kits/SignupPageKit.js +2 -2
- package/dist/components/page-kits/SuccessPageKit.js +38 -38
- package/dist/components/page-kits/TeamSettingsPageKit.js +45 -45
- package/dist/components/page-kits/TwoFactorPageKit.js +41 -41
- package/dist/components/page-kits/VerifyEmailPageKit.js +38 -38
- package/dist/components/page-kits/VoiceAgentsPageKit.js +80 -76
- package/dist/components/ui/Accordion.js +38 -38
- package/dist/components/ui/AgentMessageBubble.d.ts +20 -4
- package/dist/components/ui/AgentMessageBubble.js +39 -39
- package/dist/components/ui/AgentStatus.d.ts +1 -1
- package/dist/components/ui/AgentStatus.js +5 -10
- package/dist/components/ui/AgentTerminal.d.ts +4 -1
- package/dist/components/ui/AgentTerminal.js +3 -1
- package/dist/components/ui/AgentTimeline.d.ts +2 -2
- package/dist/components/ui/AgentTimeline.js +15 -6
- package/dist/components/ui/AnimatedDialog.js +38 -38
- package/dist/components/ui/AnimatedSheet.js +38 -38
- package/dist/components/ui/ApprovalCard.js +1 -1
- package/dist/components/ui/Breadcrumb.js +38 -38
- package/dist/components/ui/Calendar.js +38 -38
- package/dist/components/ui/Carousel.js +38 -38
- package/dist/components/ui/ChatActions.d.ts +14 -0
- package/dist/components/ui/ChatActions.js +52 -0
- package/dist/components/ui/ChatBranch.d.ts +18 -0
- package/dist/components/ui/ChatBranch.js +84 -0
- package/dist/components/ui/ChatChainOfThought.d.ts +25 -0
- package/dist/components/ui/ChatChainOfThought.js +99 -0
- package/dist/components/ui/ChatConfirmation.d.ts +37 -0
- package/dist/components/ui/ChatConfirmation.js +115 -0
- package/dist/components/ui/ChatGreeting.d.ts +18 -0
- package/dist/components/ui/ChatGreeting.js +80 -0
- package/dist/components/ui/ChatMessage.d.ts +40 -0
- package/dist/components/ui/ChatMessage.js +96 -0
- package/dist/components/ui/ChatPlan.d.ts +29 -0
- package/dist/components/ui/ChatPlan.js +86 -0
- package/dist/components/ui/ChatPromptInput.d.ts +32 -0
- package/dist/components/ui/ChatPromptInput.js +193 -0
- package/dist/components/ui/ChatPromptInputAttachments.d.ts +9 -0
- package/dist/components/ui/ChatPromptInputAttachments.js +145 -0
- package/dist/components/ui/ChatQueue.d.ts +32 -0
- package/dist/components/ui/ChatQueue.js +93 -0
- package/dist/components/ui/ChatReasoning.d.ts +20 -0
- package/dist/components/ui/ChatReasoning.js +91 -0
- package/dist/components/ui/ChatResponse.d.ts +14 -0
- package/dist/components/ui/ChatResponse.js +25 -0
- package/dist/components/ui/ChatShimmer.d.ts +23 -0
- package/dist/components/ui/ChatShimmer.js +6 -0
- package/dist/components/ui/ChatSources.d.ts +30 -0
- package/dist/components/ui/ChatSources.js +113 -0
- package/dist/components/ui/ChatSuggestion.d.ts +13 -0
- package/dist/components/ui/ChatSuggestion.js +41 -0
- package/dist/components/ui/ChatThinkingMessage.d.ts +12 -0
- package/dist/components/ui/ChatThinkingMessage.js +55 -0
- package/dist/components/ui/ChatToolCall.d.ts +41 -0
- package/dist/components/ui/ChatToolCall.js +192 -0
- package/dist/components/ui/CheckStatus.d.ts +1 -1
- package/dist/components/ui/Checkbox.js +38 -38
- package/dist/components/ui/CheckoutForm.js +38 -38
- package/dist/components/ui/CheckoutFormDemo.js +38 -38
- package/dist/components/ui/Combobox.js +38 -38
- package/dist/components/ui/Command.js +38 -38
- package/dist/components/ui/ContextMenu.js +38 -38
- package/dist/components/ui/Conversation.d.ts +21 -0
- package/dist/components/ui/Conversation.js +196 -0
- package/dist/components/ui/ConversationThread.d.ts +8 -2
- package/dist/components/ui/ConversationThread.js +34 -16
- package/dist/components/ui/DataTable.js +40 -40
- package/dist/components/ui/DatePicker.js +38 -38
- package/dist/components/ui/DateRangePicker.js +38 -38
- package/dist/components/ui/Dialog.js +38 -38
- package/dist/components/ui/DropdownMenu.js +39 -39
- package/dist/components/ui/FileUpload.js +38 -38
- package/dist/components/ui/InputOTP.js +38 -38
- package/dist/components/ui/KanbanBoard.js +2 -2
- package/dist/components/ui/LanguageSwitcher.js +38 -38
- package/dist/components/ui/Menubar.js +38 -38
- package/dist/components/ui/NavigationMenu.js +38 -38
- package/dist/components/ui/NotificationCenter.js +38 -38
- package/dist/components/ui/Pagination.js +38 -38
- package/dist/components/ui/RadioGroup.js +38 -38
- package/dist/components/ui/Resizable.js +38 -38
- package/dist/components/ui/SearchCommand.js +38 -38
- package/dist/components/ui/Select.js +38 -38
- package/dist/components/ui/SettingsModal.js +38 -38
- package/dist/components/ui/Sheet.js +38 -38
- package/dist/components/ui/Sidebar.js +41 -41
- package/dist/components/ui/StyleToggle.js +1 -1
- package/dist/components/ui/TagInput.js +38 -38
- package/dist/components/ui/ThemeToggle.js +39 -39
- package/dist/components/ui/ThinkingIndicator.d.ts +3 -1
- package/dist/components/ui/ThinkingIndicator.js +2 -1
- package/dist/components/ui/Toast.js +38 -38
- package/dist/components/ui/Toaster.js +38 -38
- package/dist/components/ui/ToolCallCard.d.ts +1 -1
- package/dist/components/ui/ToolCallCard.js +5 -1
- package/dist/components/ui/TreeView.js +38 -38
- package/dist/components/ui/charts/index.js +1 -1
- package/dist/components/ui/icons/index.js +38 -38
- package/dist/components/ui/text-effects/index.js +2 -2
- package/dist/hooks/use-scroll-to-bottom.d.ts +13 -0
- package/dist/hooks/use-scroll-to-bottom.js +2 -0
- package/dist/index.js +43 -43
- package/dist/internal/local-image-assets.d.ts +12 -0
- package/dist/messages/en.js +1 -1
- package/dist/messages/it.js +1 -1
- package/dist/test/PublicSeedTestProvider.js +2 -2
- package/dist/test/simulate-ime-composition.d.ts +54 -0
- package/dist/test/simulate-ime-composition.js +55 -0
- package/eslint-rules/nadicode/config.js +2 -0
- package/eslint-rules/nadicode/index.js +4 -0
- package/eslint-rules/nadicode/rules/no-deprecated-ds-import.js +77 -0
- package/eslint-rules/nadicode/rules/no-forbidden-page-kit-import.js +99 -0
- package/eslint-rules/nadicode/rules/no-unregistered-glass.js +2 -0
- package/package.json +103 -6
- package/scripts/ds-check.mjs +94 -73
- package/dist/chunk-MLUSJTS2.js +0 -107
- package/dist/chunk-TZXZFSD2.js +0 -33
- package/dist/{chunk-MX5FUFQR.js → chunk-7A2RXKGH.js} +2 -2
- package/dist/{chunk-5DKCZWC6.js → chunk-CQEUNASC.js} +1 -1
- package/dist/{chunk-RMLS2QUC.js → chunk-HZERHGBT.js} +1 -1
- package/dist/{chunk-WAVU744B.js → chunk-IXQGKJU4.js} +3 -3
- package/dist/{chunk-4HRVRW2X.js → chunk-J2DCQDXO.js} +2 -2
- package/dist/{chunk-6MFAZU4B.js → chunk-RGE5OQMZ.js} +1 -1
- package/dist/{chunk-PJNHVPHF.js → chunk-TYP2MR3Q.js} +1 -1
- package/dist/{chunk-TS2JSPQR.js → chunk-U4GYSYGN.js} +1 -1
- package/dist/{chunk-EJNF6JLL.js → chunk-VEO56RH4.js} +1 -1
- package/dist/{chunk-AURJQZC4.js → chunk-VNNAL4A6.js} +1 -1
- package/dist/{chunk-5PORR6LE.js → chunk-XTASI4IY.js} +1 -1
- package/dist/{chunk-E4L6LR6P.js → chunk-Z233ZQZE.js} +1 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { StopIcon } from '../../chunk-ZU2GYVAP.js';
|
|
3
|
+
import { SendIcon } from '../../chunk-CRZ2JE24.js';
|
|
4
|
+
import '../../chunk-ASKFAYYR.js';
|
|
5
|
+
import { cn } from '../../chunk-QYZT24TS.js';
|
|
6
|
+
import { createContext, useState, useRef, useCallback, useContext } from 'react';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var ChatPromptContext = createContext(null);
|
|
10
|
+
function useChatPrompt() {
|
|
11
|
+
const ctx = useContext(ChatPromptContext);
|
|
12
|
+
if (!ctx) throw new Error("ChatPromptInput compound components must be used within <ChatPromptInput>");
|
|
13
|
+
return ctx;
|
|
14
|
+
}
|
|
15
|
+
function ChatPromptInput({
|
|
16
|
+
status,
|
|
17
|
+
onSubmit,
|
|
18
|
+
onStop,
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
ref
|
|
22
|
+
}) {
|
|
23
|
+
const [, setIsComposing] = useState(false);
|
|
24
|
+
const composingRef = useRef(false);
|
|
25
|
+
const textareaNodeRef = useRef(null);
|
|
26
|
+
const registerTextarea = useCallback(
|
|
27
|
+
(node) => {
|
|
28
|
+
textareaNodeRef.current = node;
|
|
29
|
+
},
|
|
30
|
+
[]
|
|
31
|
+
);
|
|
32
|
+
const submit = useCallback(() => {
|
|
33
|
+
const value = textareaNodeRef.current?.value.trim();
|
|
34
|
+
if (!value) return;
|
|
35
|
+
onSubmit(value);
|
|
36
|
+
if (textareaNodeRef.current) {
|
|
37
|
+
textareaNodeRef.current.value = "";
|
|
38
|
+
}
|
|
39
|
+
}, [onSubmit]);
|
|
40
|
+
const stop = useCallback(() => {
|
|
41
|
+
onStop?.();
|
|
42
|
+
}, [onStop]);
|
|
43
|
+
const handleFormSubmit = useCallback(
|
|
44
|
+
(e) => {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
if (status === "streaming" || status === "submitted") {
|
|
47
|
+
stop();
|
|
48
|
+
} else {
|
|
49
|
+
submit();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
[status, submit, stop]
|
|
53
|
+
);
|
|
54
|
+
const handleSetIsComposing = useCallback((v) => {
|
|
55
|
+
setIsComposing(v);
|
|
56
|
+
}, []);
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
58
|
+
ChatPromptContext.Provider,
|
|
59
|
+
{
|
|
60
|
+
value: {
|
|
61
|
+
status,
|
|
62
|
+
composingRef,
|
|
63
|
+
setIsComposing: handleSetIsComposing,
|
|
64
|
+
registerTextarea,
|
|
65
|
+
submit,
|
|
66
|
+
stop
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ jsx(
|
|
69
|
+
"form",
|
|
70
|
+
{
|
|
71
|
+
ref,
|
|
72
|
+
onSubmit: handleFormSubmit,
|
|
73
|
+
className: cn(
|
|
74
|
+
"flex flex-col gap-2 rounded-2xl border border-border bg-surface p-3 glass-panel",
|
|
75
|
+
className
|
|
76
|
+
),
|
|
77
|
+
children
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function ChatPromptInputTextarea({
|
|
84
|
+
placeholder,
|
|
85
|
+
className,
|
|
86
|
+
"aria-label": ariaLabel,
|
|
87
|
+
ref
|
|
88
|
+
}) {
|
|
89
|
+
const { status, composingRef, setIsComposing, registerTextarea, submit, stop } = useChatPrompt();
|
|
90
|
+
const handleKeyDown = useCallback(
|
|
91
|
+
(e) => {
|
|
92
|
+
if (e.key === "Escape") {
|
|
93
|
+
stop();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (e.key === "Enter" && !e.shiftKey && !composingRef.current && !e.nativeEvent.isComposing) {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
if (status === "streaming" || status === "submitted") {
|
|
99
|
+
stop();
|
|
100
|
+
} else {
|
|
101
|
+
submit();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
[composingRef, status, submit, stop]
|
|
106
|
+
);
|
|
107
|
+
const mergedRef = useCallback(
|
|
108
|
+
(node) => {
|
|
109
|
+
registerTextarea(node);
|
|
110
|
+
if (typeof ref === "function") ref(node);
|
|
111
|
+
else if (ref && typeof ref === "object")
|
|
112
|
+
ref.current = node;
|
|
113
|
+
},
|
|
114
|
+
[registerTextarea, ref]
|
|
115
|
+
);
|
|
116
|
+
const handleCompositionStart = useCallback(() => {
|
|
117
|
+
composingRef.current = true;
|
|
118
|
+
setIsComposing(true);
|
|
119
|
+
}, [composingRef, setIsComposing]);
|
|
120
|
+
const handleCompositionEnd = useCallback(() => {
|
|
121
|
+
requestAnimationFrame(() => {
|
|
122
|
+
composingRef.current = false;
|
|
123
|
+
setIsComposing(false);
|
|
124
|
+
});
|
|
125
|
+
}, [composingRef, setIsComposing]);
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
"textarea",
|
|
128
|
+
{
|
|
129
|
+
ref: mergedRef,
|
|
130
|
+
rows: 1,
|
|
131
|
+
placeholder,
|
|
132
|
+
"aria-label": ariaLabel ?? placeholder,
|
|
133
|
+
onKeyDown: handleKeyDown,
|
|
134
|
+
onCompositionStart: handleCompositionStart,
|
|
135
|
+
onCompositionEnd: handleCompositionEnd,
|
|
136
|
+
className: cn(
|
|
137
|
+
"w-full resize-none bg-transparent text-sm text-text-primary placeholder:text-text-tertiary",
|
|
138
|
+
"focus:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-offset-0 rounded-lg",
|
|
139
|
+
"field-sizing-content",
|
|
140
|
+
className
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
function ChatPromptInputToolbar({
|
|
146
|
+
children,
|
|
147
|
+
className
|
|
148
|
+
}) {
|
|
149
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-between gap-2", className), children });
|
|
150
|
+
}
|
|
151
|
+
function ChatPromptInputActions({
|
|
152
|
+
children,
|
|
153
|
+
className
|
|
154
|
+
}) {
|
|
155
|
+
return /* @__PURE__ */ jsx("div", { className: cn("ml-auto flex items-center gap-1", className), children });
|
|
156
|
+
}
|
|
157
|
+
function ChatPromptInputSubmit({ className }) {
|
|
158
|
+
const { status, stop } = useChatPrompt();
|
|
159
|
+
const isActive = status === "streaming" || status === "submitted";
|
|
160
|
+
if (isActive) {
|
|
161
|
+
return /* @__PURE__ */ jsx(
|
|
162
|
+
"button",
|
|
163
|
+
{
|
|
164
|
+
type: "button",
|
|
165
|
+
onClick: stop,
|
|
166
|
+
"aria-label": "Stop generation",
|
|
167
|
+
className: cn(
|
|
168
|
+
"inline-flex h-8 w-8 min-h-10 min-w-10 items-center justify-center rounded-full",
|
|
169
|
+
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
170
|
+
"transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
171
|
+
className
|
|
172
|
+
),
|
|
173
|
+
children: /* @__PURE__ */ jsx(StopIcon, { size: 16 })
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
return /* @__PURE__ */ jsx(
|
|
178
|
+
"button",
|
|
179
|
+
{
|
|
180
|
+
type: "submit",
|
|
181
|
+
"aria-label": "Send message",
|
|
182
|
+
className: cn(
|
|
183
|
+
"inline-flex h-8 w-8 min-h-10 min-w-10 items-center justify-center rounded-full",
|
|
184
|
+
"bg-primary text-primary-foreground hover:bg-primary/90",
|
|
185
|
+
"transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
186
|
+
className
|
|
187
|
+
),
|
|
188
|
+
children: /* @__PURE__ */ jsx(SendIcon, { size: 16 })
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export { ChatPromptInput, ChatPromptInputActions, ChatPromptInputSubmit, ChatPromptInputTextarea, ChatPromptInputToolbar };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface ChatPromptInputAttachmentsProps {
|
|
3
|
+
onFilesChange: (files: File[]) => void;
|
|
4
|
+
accept?: string;
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function ChatPromptInputAttachments({ onFilesChange, accept, multiple, children, className, }: ChatPromptInputAttachmentsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { XCircleIcon } from '../../chunk-PSVQ7ZNX.js';
|
|
3
|
+
import { PaperclipIcon } from '../../chunk-WKRIKCJC.js';
|
|
4
|
+
import '../../chunk-ASKFAYYR.js';
|
|
5
|
+
import { cn } from '../../chunk-QYZT24TS.js';
|
|
6
|
+
import { useState, useRef, useCallback } from 'react';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function ChatPromptInputAttachments({
|
|
10
|
+
onFilesChange,
|
|
11
|
+
accept,
|
|
12
|
+
multiple = true,
|
|
13
|
+
children,
|
|
14
|
+
className
|
|
15
|
+
}) {
|
|
16
|
+
const [files, setFiles] = useState([]);
|
|
17
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
18
|
+
const fileInputRef = useRef(null);
|
|
19
|
+
const addFiles = useCallback(
|
|
20
|
+
(newFiles) => {
|
|
21
|
+
const updated = [...files, ...newFiles];
|
|
22
|
+
setFiles(updated);
|
|
23
|
+
onFilesChange(updated);
|
|
24
|
+
},
|
|
25
|
+
[files, onFilesChange]
|
|
26
|
+
);
|
|
27
|
+
const removeFile = useCallback(
|
|
28
|
+
(index) => {
|
|
29
|
+
const updated = files.filter((_, i) => i !== index);
|
|
30
|
+
setFiles(updated);
|
|
31
|
+
onFilesChange(updated);
|
|
32
|
+
},
|
|
33
|
+
[files, onFilesChange]
|
|
34
|
+
);
|
|
35
|
+
const handleFileInput = useCallback(
|
|
36
|
+
(e) => {
|
|
37
|
+
if (e.target.files) {
|
|
38
|
+
addFiles(Array.from(e.target.files));
|
|
39
|
+
}
|
|
40
|
+
e.target.value = "";
|
|
41
|
+
},
|
|
42
|
+
[addFiles]
|
|
43
|
+
);
|
|
44
|
+
const handleDragOver = useCallback((e) => {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
setIsDragging(true);
|
|
48
|
+
}, []);
|
|
49
|
+
const handleDragLeave = useCallback((e) => {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
setIsDragging(false);
|
|
53
|
+
}, []);
|
|
54
|
+
const handleDrop = useCallback(
|
|
55
|
+
(e) => {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
setIsDragging(false);
|
|
59
|
+
if (e.dataTransfer.files) {
|
|
60
|
+
addFiles(Array.from(e.dataTransfer.files));
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
[addFiles]
|
|
64
|
+
);
|
|
65
|
+
const openFilePicker = useCallback(() => {
|
|
66
|
+
fileInputRef.current?.click();
|
|
67
|
+
}, []);
|
|
68
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
69
|
+
/* @__PURE__ */ jsxs(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
"data-drop-zone": true,
|
|
73
|
+
onDragOver: handleDragOver,
|
|
74
|
+
onDragLeave: handleDragLeave,
|
|
75
|
+
onDrop: handleDrop,
|
|
76
|
+
className: cn(
|
|
77
|
+
"relative",
|
|
78
|
+
isDragging && "ring-2 ring-accent ring-offset-2 rounded-lg"
|
|
79
|
+
),
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
"input",
|
|
83
|
+
{
|
|
84
|
+
ref: fileInputRef,
|
|
85
|
+
type: "file",
|
|
86
|
+
accept,
|
|
87
|
+
multiple,
|
|
88
|
+
onChange: handleFileInput,
|
|
89
|
+
"aria-label": "Attach files",
|
|
90
|
+
className: "sr-only"
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
"button",
|
|
95
|
+
{
|
|
96
|
+
type: "button",
|
|
97
|
+
onClick: openFilePicker,
|
|
98
|
+
"aria-label": "Attach files",
|
|
99
|
+
className: "inline-flex min-h-10 min-w-10 items-center justify-center rounded-full text-text-tertiary hover:text-text-secondary transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",
|
|
100
|
+
children: /* @__PURE__ */ jsx(PaperclipIcon, { size: 18 })
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
children
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
files.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: files.map((file, index) => /* @__PURE__ */ jsxs(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
className: "group relative flex items-center gap-1.5 rounded-lg border border-border bg-surface/60 px-2 py-1 text-xs text-text-secondary",
|
|
111
|
+
children: [
|
|
112
|
+
file.type.startsWith("image/") ? /* @__PURE__ */ jsx("div", { className: "h-6 w-6 rounded bg-muted overflow-hidden shrink-0", children: /* @__PURE__ */ jsx(FilePreview, { file }) }) : /* @__PURE__ */ jsx(PaperclipIcon, { size: 14, className: "shrink-0 text-text-tertiary" }),
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: "truncate max-w-[120px]", children: file.name }),
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
"button",
|
|
116
|
+
{
|
|
117
|
+
type: "button",
|
|
118
|
+
onClick: () => removeFile(index),
|
|
119
|
+
"aria-label": `Remove ${file.name}`,
|
|
120
|
+
className: "ml-1 inline-flex min-h-10 min-w-10 items-center justify-center rounded-full text-text-tertiary hover:text-destructive transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",
|
|
121
|
+
children: /* @__PURE__ */ jsx(XCircleIcon, { size: 14 })
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
`${file.name}-${index}`
|
|
127
|
+
)) })
|
|
128
|
+
] });
|
|
129
|
+
}
|
|
130
|
+
function FilePreview({ file }) {
|
|
131
|
+
const src = typeof URL !== "undefined" ? URL.createObjectURL(file) : "";
|
|
132
|
+
return /* @__PURE__ */ jsx(
|
|
133
|
+
"img",
|
|
134
|
+
{
|
|
135
|
+
src,
|
|
136
|
+
alt: file.name,
|
|
137
|
+
className: "h-full w-full object-cover",
|
|
138
|
+
onLoad: () => {
|
|
139
|
+
if (src) URL.revokeObjectURL(src);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export { ChatPromptInputAttachments };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface ChatQueueProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function ChatQueue({ children, className }: ChatQueueProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export interface ChatQueueSectionProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function ChatQueueSection({ children, className, defaultOpen, }: ChatQueueSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function ChatQueueSectionTrigger({ children, className, }: {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function ChatQueueSectionContent({ children, className, }: {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export interface ChatQueueItemProps {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
completed?: boolean;
|
|
24
|
+
badge?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function ChatQueueItem({ children, completed, badge, className, }: ChatQueueItemProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export interface ChatQueueItemIndicatorProps {
|
|
29
|
+
completed?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function ChatQueueItemIndicator({ completed, className, }: ChatQueueItemIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '../../chunk-VJIL7W55.js';
|
|
3
|
+
import { CircleIcon } from '../../chunk-GCUTJI7M.js';
|
|
4
|
+
import { CheckIcon } from '../../chunk-CXACRCZ4.js';
|
|
5
|
+
import { ChevronDownIcon } from '../../chunk-HJBXUXTD.js';
|
|
6
|
+
import '../../chunk-ASKFAYYR.js';
|
|
7
|
+
import { cn } from '../../chunk-QYZT24TS.js';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
function ChatQueue({ children, className }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: cn("space-y-2", className), children });
|
|
12
|
+
}
|
|
13
|
+
function ChatQueueSection({
|
|
14
|
+
children,
|
|
15
|
+
className,
|
|
16
|
+
defaultOpen = false
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
Collapsible,
|
|
20
|
+
{
|
|
21
|
+
defaultOpen,
|
|
22
|
+
className: cn("rounded-lg border border-border", className),
|
|
23
|
+
children
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function ChatQueueSectionTrigger({
|
|
28
|
+
children,
|
|
29
|
+
className
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsxs(
|
|
32
|
+
CollapsibleTrigger,
|
|
33
|
+
{
|
|
34
|
+
className: cn(
|
|
35
|
+
"flex w-full min-h-10 items-center gap-1.5 px-3 py-2",
|
|
36
|
+
"text-sm font-medium text-text-primary",
|
|
37
|
+
"hover:bg-surface/80 transition-colors",
|
|
38
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent rounded-lg",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx("span", { children }),
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
ChevronDownIcon,
|
|
45
|
+
{
|
|
46
|
+
size: 14,
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
className: "ml-auto transition-transform [[data-state=open]>&]:rotate-180"
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function ChatQueueSectionContent({
|
|
56
|
+
children,
|
|
57
|
+
className
|
|
58
|
+
}) {
|
|
59
|
+
return /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: cn("space-y-0.5 border-t border-border px-3 py-2", className), children }) });
|
|
60
|
+
}
|
|
61
|
+
function ChatQueueItem({
|
|
62
|
+
children,
|
|
63
|
+
completed = false,
|
|
64
|
+
badge,
|
|
65
|
+
className
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ jsxs(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
"data-slot": "queue-item",
|
|
71
|
+
className: cn(
|
|
72
|
+
"flex items-center gap-2 rounded-md px-2 py-1 text-sm",
|
|
73
|
+
completed ? "line-through text-text-tertiary opacity-60" : "text-text-secondary",
|
|
74
|
+
className
|
|
75
|
+
),
|
|
76
|
+
children: [
|
|
77
|
+
children,
|
|
78
|
+
!!badge && /* @__PURE__ */ jsx("span", { className: "ml-auto shrink-0 rounded bg-surface px-1.5 py-0.5 text-[10px] font-mono text-text-tertiary", children: badge })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function ChatQueueItemIndicator({
|
|
84
|
+
completed = false,
|
|
85
|
+
className
|
|
86
|
+
}) {
|
|
87
|
+
if (completed) {
|
|
88
|
+
return /* @__PURE__ */ jsx(CheckIcon, { size: 14, "aria-hidden": "true", className: cn("text-success shrink-0", className) });
|
|
89
|
+
}
|
|
90
|
+
return /* @__PURE__ */ jsx(CircleIcon, { size: 14, "aria-hidden": "true", className: cn("text-text-tertiary shrink-0", className) });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { ChatQueue, ChatQueueItem, ChatQueueItemIndicator, ChatQueueSection, ChatQueueSectionContent, ChatQueueSectionTrigger };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode, type Ref } from 'react';
|
|
2
|
+
export interface ChatReasoningProps {
|
|
3
|
+
isStreaming: boolean;
|
|
4
|
+
autoCloseDelay?: number;
|
|
5
|
+
duration?: number;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
10
|
+
}
|
|
11
|
+
export declare function ChatReasoning({ isStreaming, autoCloseDelay, duration, defaultOpen, children, className, ref, }: ChatReasoningProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export interface ChatReasoningTriggerProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function ChatReasoningTrigger({ className }: ChatReasoningTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export interface ChatReasoningContentProps {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function ChatReasoningContent({ children, className, }: ChatReasoningContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { ChatShimmer } from '../../chunk-JDJY4ABS.js';
|
|
3
|
+
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '../../chunk-VJIL7W55.js';
|
|
4
|
+
import '../../chunk-PD2YEH3H.js';
|
|
5
|
+
import '../../chunk-CRY67BIF.js';
|
|
6
|
+
import '../../chunk-HJC6U46F.js';
|
|
7
|
+
import { ChevronDownIcon } from '../../chunk-HJBXUXTD.js';
|
|
8
|
+
import '../../chunk-ASKFAYYR.js';
|
|
9
|
+
import { cn } from '../../chunk-QYZT24TS.js';
|
|
10
|
+
import { createContext, useState, useRef, useEffect, useContext } from 'react';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
var ChatReasoningContext = createContext({
|
|
14
|
+
isStreaming: false
|
|
15
|
+
});
|
|
16
|
+
function ChatReasoning({
|
|
17
|
+
isStreaming,
|
|
18
|
+
autoCloseDelay = 1e3,
|
|
19
|
+
duration,
|
|
20
|
+
defaultOpen = false,
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
ref
|
|
24
|
+
}) {
|
|
25
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
26
|
+
const timerRef = useRef(void 0);
|
|
27
|
+
const wasStreamingRef = useRef(isStreaming);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (wasStreamingRef.current && !isStreaming) {
|
|
30
|
+
timerRef.current = setTimeout(() => {
|
|
31
|
+
setOpen(false);
|
|
32
|
+
}, autoCloseDelay);
|
|
33
|
+
}
|
|
34
|
+
wasStreamingRef.current = isStreaming;
|
|
35
|
+
return () => {
|
|
36
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
37
|
+
};
|
|
38
|
+
}, [isStreaming, autoCloseDelay]);
|
|
39
|
+
return /* @__PURE__ */ jsx(ChatReasoningContext.Provider, { value: { isStreaming, duration }, children: /* @__PURE__ */ jsx(
|
|
40
|
+
Collapsible,
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
open,
|
|
44
|
+
onOpenChange: setOpen,
|
|
45
|
+
className: cn("rounded-lg border border-border/60", className),
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
) });
|
|
49
|
+
}
|
|
50
|
+
function ChatReasoningTrigger({ className }) {
|
|
51
|
+
const { isStreaming, duration } = useContext(ChatReasoningContext);
|
|
52
|
+
const durationText = duration != null ? `${(duration / 1e3).toFixed(1)}s` : null;
|
|
53
|
+
return /* @__PURE__ */ jsxs(
|
|
54
|
+
CollapsibleTrigger,
|
|
55
|
+
{
|
|
56
|
+
className: cn(
|
|
57
|
+
"flex w-full items-center gap-2 px-3 py-2 text-xs transition-colors hover:bg-surface/60 rounded-lg",
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
ChevronDownIcon,
|
|
63
|
+
{
|
|
64
|
+
size: 14,
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
className: "text-text-tertiary transition-transform [[data-state=open]>&]:rotate-180"
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
isStreaming ? /* @__PURE__ */ jsx(ChatShimmer, { className: "text-text-secondary", children: "Thinking..." }) : /* @__PURE__ */ jsx("span", { className: "text-text-secondary", children: "Reasoning" }),
|
|
70
|
+
!!durationText && !isStreaming && /* @__PURE__ */ jsx("span", { className: "ml-auto text-text-tertiary", children: durationText })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function ChatReasoningContent({
|
|
76
|
+
children,
|
|
77
|
+
className
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
CollapsibleContent,
|
|
81
|
+
{
|
|
82
|
+
className: cn(
|
|
83
|
+
"border-t border-border/40 px-3 py-2 text-xs text-text-secondary",
|
|
84
|
+
className
|
|
85
|
+
),
|
|
86
|
+
children
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { ChatReasoning, ChatReasoningContent, ChatReasoningTrigger };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
2
|
+
import { Streamdown } from 'streamdown';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
|
+
export interface ChatResponseProps extends Omit<ComponentProps<typeof Streamdown>, 'mode' | 'isAnimating' | 'ref'> {
|
|
5
|
+
/** True while the response is still streaming. */
|
|
6
|
+
isStreaming?: boolean;
|
|
7
|
+
ref?: Ref<HTMLDivElement>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Streaming-safe markdown rendering via `streamdown`.
|
|
11
|
+
* Handles unterminated code fences, partial syntax, and streaming content
|
|
12
|
+
* growth without layout breaks.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ChatResponse({ children, isStreaming, className, ref, ...props }: ChatResponseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { cn } from '../../chunk-QYZT24TS.js';
|
|
3
|
+
import { Streamdown } from 'streamdown';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function ChatResponse({
|
|
7
|
+
children,
|
|
8
|
+
isStreaming = false,
|
|
9
|
+
className,
|
|
10
|
+
ref,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("prose prose-sm dark:prose-invert max-w-none [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className), children: /* @__PURE__ */ jsx(
|
|
14
|
+
Streamdown,
|
|
15
|
+
{
|
|
16
|
+
mode: isStreaming ? "streaming" : "static",
|
|
17
|
+
isAnimating: isStreaming,
|
|
18
|
+
parseIncompleteMarkdown: isStreaming,
|
|
19
|
+
...props,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
) });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { ChatResponse };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
2
|
+
export interface ChatShimmerProps {
|
|
3
|
+
/** Text content to shimmer. */
|
|
4
|
+
children: string;
|
|
5
|
+
/** HTML element type to render (default: "span"). */
|
|
6
|
+
as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Animation cycle duration in seconds. */
|
|
9
|
+
duration?: number;
|
|
10
|
+
/** Pixel spread per character for the highlight sweep. */
|
|
11
|
+
spread?: number;
|
|
12
|
+
ref?: Ref<HTMLElement>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ChatShimmer - CSS background-clip sliding highlight sweep on text.
|
|
16
|
+
*
|
|
17
|
+
* Used by ChatReasoning trigger ("Thinking" label) and ChatPlan title
|
|
18
|
+
* to indicate active streaming. Falls back to static text when
|
|
19
|
+
* prefers-reduced-motion is active.
|
|
20
|
+
*/
|
|
21
|
+
declare function ChatShimmerInner({ children, as: Component, className, duration, spread, ref, }: ChatShimmerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const ChatShimmer: import("react").MemoExoticComponent<typeof ChatShimmerInner>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface ChatSourcesProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function ChatSources({ children, className, defaultOpen, }: ChatSourcesProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export interface ChatSourcesTriggerProps {
|
|
9
|
+
count: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function ChatSourcesTrigger({ count, className }: ChatSourcesTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function ChatSourcesContent({ children, className, }: {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface ChatSourceProps {
|
|
18
|
+
title: string;
|
|
19
|
+
url: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function ChatSource({ title, url, description, className }: ChatSourceProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export interface ChatInlineCitationProps {
|
|
25
|
+
index: number;
|
|
26
|
+
href?: string;
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function ChatInlineCitation({ index, href, onClick, className, }: ChatInlineCitationProps): import("react/jsx-runtime").JSX.Element;
|