@moldable-ai/ui 0.1.1 → 0.2.1
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/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-input.js +8 -6
- package/dist/components/chat/chat-panel.d.ts +5 -1
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +6 -2
- package/dist/components/chat/markdown.d.ts +9 -0
- package/dist/components/chat/markdown.d.ts.map +1 -0
- package/dist/components/chat/markdown.js +47 -0
- package/dist/components/chat/tool-handlers.d.ts.map +1 -1
- package/dist/components/chat/tool-handlers.js +21 -51
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +18 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +25 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +7 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +14 -0
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +1 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +28 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +28 -0
- package/dist/components/ui/button.d.ts +2 -3
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +5 -6
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +76 -0
- package/dist/components/ui/card.d.ts +8 -7
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +23 -14
- package/dist/components/ui/carousel.d.ts +20 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +91 -0
- package/dist/components/ui/chart.d.ts +41 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +132 -0
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/collapsible.d.ts +3 -3
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +11 -3
- package/dist/components/ui/command.d.ts +15 -15
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +29 -24
- package/dist/components/ui/context-menu.d.ts +26 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +51 -0
- package/dist/components/ui/dialog.d.ts +13 -17
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +32 -19
- package/dist/components/ui/drawer.d.ts +14 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +35 -0
- package/dist/components/ui/dropdown-menu.js +6 -6
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +34 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +76 -0
- package/dist/components/ui/form.d.ts +25 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +59 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +14 -0
- package/dist/components/ui/index.d.ts +35 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +35 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +63 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +21 -0
- package/dist/components/ui/input.d.ts +1 -2
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +4 -5
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +67 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +10 -0
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +3 -3
- package/dist/components/ui/menubar.d.ts +27 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +54 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +32 -0
- package/dist/components/ui/pagination.d.ts +14 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +30 -0
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +8 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +12 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +15 -0
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +9 -7
- package/dist/components/ui/select.d.ts +13 -11
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +35 -23
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +8 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +40 -0
- package/dist/components/ui/sidebar.d.ts +70 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +212 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +7 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +14 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +21 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +8 -0
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +4 -4
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +28 -0
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +1 -0
- package/dist/components/ui/textarea.d.ts +1 -2
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +4 -5
- package/dist/components/ui/toggle-group.d.ts +10 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +22 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +26 -0
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +48 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input.d.ts","sourceRoot":"","sources":["../../../src/components/chat/chat-input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"chat-input.d.ts","sourceRoot":"","sources":["../../../src/components/chat/chat-input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EAGT,SAAS,EACV,MAAM,OAAO,CAAA;AAKd,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAA;IAC5D,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;IACjD,YAAY,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAA;IAChD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,WAA+B,EAC/B,QAAQ,EACR,MAAM,EACN,OAAe,GAChB,EAAE,cAAc,2CAsFhB"}
|
|
@@ -23,14 +23,16 @@ export function ChatInput({ input, onInputChange, onSubmit, isResponding, placeh
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
// Show stop button only when streaming AND no input
|
|
27
|
+
const showStopButton = isResponding && !hasInput;
|
|
28
|
+
const handleButtonClick = (e) => {
|
|
29
|
+
// When rendered as stop button (type="button"), always call onStop
|
|
30
|
+
// Don't re-check conditions - trust the render decision to avoid race conditions
|
|
31
|
+
if (e.currentTarget.type === 'button') {
|
|
32
|
+
e.preventDefault();
|
|
29
33
|
onStop?.();
|
|
30
34
|
}
|
|
31
|
-
// If
|
|
35
|
+
// If type="submit", form handles submission
|
|
32
36
|
};
|
|
33
|
-
// Show stop button only when streaming AND no input
|
|
34
|
-
const showStopButton = isResponding && !hasInput;
|
|
35
37
|
return (_jsx("div", { className: cn('isolate w-full p-2'), "data-chat-input-wrapper": true, children: _jsx("div", { className: "mx-auto max-w-5xl", children: _jsx("form", { onSubmit: onSubmit, children: _jsxs("div", { className: cn('bg-background relative flex w-full flex-col rounded-3xl border', compact && 'h-14'), children: [_jsx("div", { className: cn('w-full px-5', compact ? 'py-4' : 'py-4 pr-14'), children: _jsx(Textarea, { ref: inputRef, value: input, placeholder: placeholder, onChange: onInputChange, onKeyDown: handleKeyDown, className: cn('max-h-32 min-h-[24px] resize-none rounded-none border-0 bg-transparent p-0 text-sm shadow-none focus:outline-none focus-visible:ring-0 focus-visible:ring-offset-0', compact && 'max-h-6 min-h-6') }) }), !compact && (_jsx("div", { className: "absolute bottom-3 right-3", children: _jsxs(Button, { type: showStopButton ? 'button' : 'submit', size: "icon", className: "bg-primary text-primary-foreground size-8 cursor-pointer rounded-full hover:opacity-70 disabled:opacity-30", disabled: !hasInput && !isResponding, onClick: handleButtonClick, children: [showStopButton ? (_jsx(Square, { className: "fill-primary-foreground size-4 animate-pulse" })) : (_jsx(ArrowUp, { className: "size-4" })), _jsx("span", { className: "sr-only", children: showStopButton ? 'Stop generating' : 'Send message' })] }) }))] }) }) }) }));
|
|
36
38
|
}
|
|
@@ -51,10 +51,14 @@ export interface ChatPanelProps {
|
|
|
51
51
|
className?: string;
|
|
52
52
|
/** Error from chat request */
|
|
53
53
|
error?: Error | null;
|
|
54
|
+
/** Whether API keys are missing */
|
|
55
|
+
missingApiKey?: boolean;
|
|
56
|
+
/** Callback to trigger API key setup */
|
|
57
|
+
onAddApiKey?: () => void;
|
|
54
58
|
}
|
|
55
59
|
/**
|
|
56
60
|
* Floating chat panel with model selector
|
|
57
61
|
*/
|
|
58
|
-
export declare function ChatPanel({ messages, status, input, onInputChange, onSubmit, onStop, onNewChat, models, selectedModel, onModelChange, reasoningEffortOptions, selectedReasoningEffort, onReasoningEffortChange, conversations, currentConversationId, onSelectConversation, onDeleteConversation, placeholder, welcomeMessage, isExpanded, onExpandedChange, className, error, }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export declare function ChatPanel({ messages, status, input, onInputChange, onSubmit, onStop, onNewChat, models, selectedModel, onModelChange, reasoningEffortOptions, selectedReasoningEffort, onReasoningEffortChange, conversations, currentConversationId, onSelectConversation, onDeleteConversation, placeholder, welcomeMessage, isExpanded, onExpandedChange, className, error, missingApiKey, onAddApiKey, }: ChatPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
59
63
|
export {};
|
|
60
64
|
//# sourceMappingURL=chat-panel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-panel.d.ts","sourceRoot":"","sources":["../../../src/components/chat/chat-panel.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAWd,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,kBAAkB,CAAA;AAClE,OAAO,EACL,KAAK,qBAAqB,EAE3B,MAAM,6BAA6B,CAAA;AAGpC,KAAK,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,CAAA;AAE/D,MAAM,WAAW,cAAc;I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b,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,WAA+B,EAC/B,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,aAAa,EACb,WAAW,GACZ,EAAE,cAAc,2CAgThB"}
|
|
@@ -15,7 +15,7 @@ import { AnimatePresence, motion } from 'framer-motion';
|
|
|
15
15
|
/**
|
|
16
16
|
* Floating chat panel with model selector
|
|
17
17
|
*/
|
|
18
|
-
export function ChatPanel({ messages, status, input, onInputChange, onSubmit, onStop, onNewChat, models, selectedModel, onModelChange, reasoningEffortOptions, selectedReasoningEffort, onReasoningEffortChange, conversations, currentConversationId, onSelectConversation, onDeleteConversation, placeholder = 'Ask anything...', welcomeMessage, isExpanded, onExpandedChange, className, error, }) {
|
|
18
|
+
export function ChatPanel({ messages, status, input, onInputChange, onSubmit, onStop, onNewChat, models, selectedModel, onModelChange, reasoningEffortOptions, selectedReasoningEffort, onReasoningEffortChange, conversations, currentConversationId, onSelectConversation, onDeleteConversation, placeholder = 'Ask anything...', welcomeMessage, isExpanded, onExpandedChange, className, error, missingApiKey, onAddApiKey, }) {
|
|
19
19
|
const inputRef = useRef(null);
|
|
20
20
|
const messagesEndRef = useRef(null);
|
|
21
21
|
const scrollAreaRef = useRef(null);
|
|
@@ -107,7 +107,11 @@ export function ChatPanel({ messages, status, input, onInputChange, onSubmit, on
|
|
|
107
107
|
selectedReasoningEffort &&
|
|
108
108
|
onReasoningEffortChange && (_jsx(ReasoningEffortSelector, { options: reasoningEffortOptions, selectedEffort: selectedReasoningEffort, onEffortChange: onReasoningEffortChange, disabled: isResponding }))] }), _jsxs("div", { className: "flex items-center gap-1", children: [conversations &&
|
|
109
109
|
conversations.length > 0 &&
|
|
110
|
-
onSelectConversation && (_jsx(ConversationHistory, { conversations: conversations, currentConversationId: currentConversationId, onSelect: onSelectConversation, onDelete: onDeleteConversation, disabled: isResponding })), _jsxs(TooltipProvider, { children: [messages.length > 0 && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", onClick: handleNewChat, disabled: isResponding, className: "text-muted-foreground hover:text-foreground", children: _jsx(Plus, { className: "size-4" }) }) }), _jsx(TooltipContent, { side: "bottom", children: _jsx("p", { children: "New chat" }) })] })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", onClick: () => onExpandedChange(false), className: "text-muted-foreground hover:text-foreground", children: _jsx(Minimize2, { className: "size-4" }) }) }), _jsx(TooltipContent, { side: "bottom", children: _jsx("p", { children: "Minimize" }) })] })] })] })] }), _jsx(ScrollArea, { ref: scrollAreaRef, className: "min-w-0 flex-1 px-2", children: _jsxs("div", { className: "min-w-0 space-y-4 py-4", children: [messages.length === 0 && welcomeMessage && (_jsx("div", { className: "bg-muted/50 text-muted-foreground mx-2 rounded-2xl p-4 text-sm", children: welcomeMessage })), _jsx(Messages, { messages: messages, status: status }),
|
|
110
|
+
onSelectConversation && (_jsx(ConversationHistory, { conversations: conversations, currentConversationId: currentConversationId, onSelect: onSelectConversation, onDelete: onDeleteConversation, disabled: isResponding })), _jsxs(TooltipProvider, { children: [messages.length > 0 && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", onClick: handleNewChat, disabled: isResponding, className: "text-muted-foreground hover:text-foreground", children: _jsx(Plus, { className: "size-4" }) }) }), _jsx(TooltipContent, { side: "bottom", children: _jsx("p", { children: "New chat" }) })] })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", onClick: () => onExpandedChange(false), className: "text-muted-foreground hover:text-foreground", children: _jsx(Minimize2, { className: "size-4" }) }) }), _jsx(TooltipContent, { side: "bottom", children: _jsx("p", { children: "Minimize" }) })] })] })] })] }), _jsx(ScrollArea, { ref: scrollAreaRef, className: "min-w-0 flex-1 px-2", children: _jsxs("div", { className: "min-w-0 space-y-4 py-4", children: [messages.length === 0 && welcomeMessage && (_jsx("div", { className: "bg-muted/50 text-muted-foreground mx-2 rounded-2xl p-4 text-sm", children: welcomeMessage })), _jsx(Messages, { messages: messages, status: status }), (missingApiKey ||
|
|
111
|
+
(error &&
|
|
112
|
+
error.message?.includes('API_KEY not configured'))) && (_jsxs("div", { className: "border-primary/30 bg-primary/5 mx-2 flex flex-col items-center gap-3 rounded-lg border p-4 text-center", children: [_jsx("div", { className: "bg-primary/10 flex size-10 items-center justify-center rounded-full", children: _jsx(AlertCircle, { className: "text-primary size-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-foreground font-medium", children: "API key required" }), _jsx("p", { className: "text-muted-foreground mt-1 text-sm", children: "Add an API key to start chatting with AI" })] }), onAddApiKey && (_jsx(Button, { onClick: onAddApiKey, size: "sm", className: "cursor-pointer", children: "Add API key" }))] })), error &&
|
|
113
|
+
status === 'error' &&
|
|
114
|
+
!error.message?.includes('API_KEY not configured') && (_jsxs("div", { className: "border-destructive/30 bg-destructive/10 text-destructive mx-2 flex items-start gap-2 rounded-lg border p-3 text-sm", children: [_jsx(AlertCircle, { className: "mt-0.5 size-4 shrink-0" }), _jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "font-medium", children: "Request failed" }), _jsx("p", { className: "text-destructive/80 mt-0.5 break-words", children: error.message || 'An unknown error occurred' })] })] })), _jsx("div", { ref: messagesEndRef })] }) })] }), _jsx("div", { className: "relative z-10", onClick: () => {
|
|
111
115
|
if (!isExpanded) {
|
|
112
116
|
onExpandedChange(true);
|
|
113
117
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type MarkdownProps = {
|
|
2
|
+
markdown: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
proseSize?: 'sm' | 'base' | 'lg';
|
|
5
|
+
};
|
|
6
|
+
declare function NonMemoizedMarkdown({ markdown, className, proseSize }: MarkdownProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Markdown: import("react").MemoExoticComponent<typeof NonMemoizedMarkdown>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/components/chat/markdown.tsx"],"names":[],"mappings":"AAMA,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CACjC,CAAA;AAwFD,iBAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAgB,EAAE,EAAE,aAAa,2CAyBpF;AAED,eAAO,MAAM,QAAQ,iEAMpB,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import ReactMarkdown from 'react-markdown';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import rehypeRaw from 'rehype-raw';
|
|
6
|
+
import remarkGfm from 'remark-gfm';
|
|
7
|
+
const components = {
|
|
8
|
+
img({ src, alt }) {
|
|
9
|
+
if (!src)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsx("span", { className: "flex justify-center", children: _jsx("img", { src: src, alt: alt ?? '', className: "h-auto max-w-full rounded-lg" }) }));
|
|
12
|
+
},
|
|
13
|
+
table({ children }) {
|
|
14
|
+
return (_jsx("table", { className: "border-collapse border px-3 py-1", children: children }));
|
|
15
|
+
},
|
|
16
|
+
th({ children }) {
|
|
17
|
+
return (_jsx("th", { className: "bg-muted border px-3 py-1 break-words", children: children }));
|
|
18
|
+
},
|
|
19
|
+
td({ children }) {
|
|
20
|
+
return _jsx("td", { className: "border px-3 py-1 break-words", children: children });
|
|
21
|
+
},
|
|
22
|
+
ol: ({ children, ...props }) => (_jsx("ol", { className: "ml-4 list-outside list-decimal", ...props, children: children })),
|
|
23
|
+
ul: ({ children, ...props }) => (_jsx("ul", { className: "ml-4 list-outside list-disc", ...props, children: children })),
|
|
24
|
+
li: ({ children, ...props }) => (_jsx("li", { className: "py-1", ...props, children: children })),
|
|
25
|
+
strong: ({ children, ...props }) => (_jsx("span", { className: "font-semibold", ...props, children: children })),
|
|
26
|
+
a: ({ children, href, ...props }) => (_jsx("a", { className: "font-bold hover:underline", href: href ?? '#', target: "_blank", rel: "noreferrer", ...props, children: children })),
|
|
27
|
+
pre: ({ children, ...props }) => (_jsx("pre", { className: "overflow-x-auto rounded-lg bg-muted/50 p-3 text-sm", ...props, children: children })),
|
|
28
|
+
code: ({ children, className, ...props }) => {
|
|
29
|
+
// Check if this is an inline code block (no className means inline)
|
|
30
|
+
const isInline = !className;
|
|
31
|
+
if (isInline) {
|
|
32
|
+
return (_jsx("code", { className: "rounded bg-muted px-1.5 py-0.5 text-sm font-mono", ...props, children: children }));
|
|
33
|
+
}
|
|
34
|
+
return (_jsx("code", { className: cn('font-mono text-sm', className), ...props, children: children }));
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
function NonMemoizedMarkdown({ markdown, className, proseSize = 'sm' }) {
|
|
38
|
+
const proseSizeClass = {
|
|
39
|
+
sm: 'prose-sm',
|
|
40
|
+
base: 'prose-base',
|
|
41
|
+
lg: 'prose-lg',
|
|
42
|
+
}[proseSize];
|
|
43
|
+
return (_jsx("div", { className: cn('prose w-full max-w-none dark:prose-invert', proseSizeClass, 'text-foreground', className), children: _jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], rehypePlugins: [rehypeRaw], components: components, children: markdown }) }));
|
|
44
|
+
}
|
|
45
|
+
export const Markdown = memo(NonMemoizedMarkdown, (prevProps, nextProps) => prevProps.markdown === nextProps.markdown &&
|
|
46
|
+
prevProps.className === nextProps.className &&
|
|
47
|
+
prevProps.proseSize === nextProps.proseSize);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-handlers.d.ts","sourceRoot":"","sources":["../../../src/components/chat/tool-handlers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-handlers.d.ts","sourceRoot":"","sources":["../../../src/components/chat/tool-handlers.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE5D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IAExB,YAAY,EAAE,MAAM,CAAA;IAEpB,MAAM,CAAC,EAAE,sBAAsB,CAAA;IAE/B,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,SAAS,CAAA;IAGhE,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,SAAS,CAAA;CAC9C,CAAA;AA0MD;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAm+B7D,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAgC5D"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { BookOpen, Check, CheckCheck,
|
|
3
|
+
import { BookOpen, Check, CheckCheck, Copy, Download, FileCode, FileText, FolderOpen, Globe, Plus, Search, Sparkles, Terminal, Trash2, X, } from 'lucide-react';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../ui/collapsible';
|
|
7
6
|
import { ThinkingTimelineMarker } from './thinking-timeline';
|
|
8
7
|
/**
|
|
9
8
|
* Code block component for displaying command output or file contents
|
|
@@ -64,30 +63,17 @@ function FileOperation({ operation, path, success = true, children, }) {
|
|
|
64
63
|
edit: 'Edited',
|
|
65
64
|
};
|
|
66
65
|
const Icon = icons[operation];
|
|
66
|
+
const fileName = getFileName(path);
|
|
67
67
|
return (_jsxs("div", { className: "my-1 min-w-0", children: [_jsxs("div", { className: cn('inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs', success
|
|
68
68
|
? 'bg-muted text-muted-foreground'
|
|
69
|
-
: 'bg-destructive/10 text-destructive'), children: [_jsx(Icon, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: labels[operation] }), _jsx("code", { className: "bg-background/50 min-w-0 truncate rounded px-1 font-mono",
|
|
69
|
+
: 'bg-destructive/10 text-destructive'), children: [_jsx(Icon, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: labels[operation] }), _jsx("code", { className: "bg-background/50 min-w-0 truncate rounded px-1 font-mono", title: path, children: fileName }), success ? (_jsx(Check, { className: "size-3 shrink-0 text-green-600" })) : (_jsx(X, { className: "size-3 shrink-0" }))] }), children] }));
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Extract just the filename from a path
|
|
73
73
|
*/
|
|
74
|
-
function
|
|
75
|
-
if (path.length <= maxLength)
|
|
76
|
-
return path;
|
|
74
|
+
function getFileName(path) {
|
|
77
75
|
const parts = path.split('/');
|
|
78
|
-
|
|
79
|
-
if (filename.length >= maxLength - 3) {
|
|
80
|
-
return '...' + filename.slice(-(maxLength - 3));
|
|
81
|
-
}
|
|
82
|
-
let result = filename;
|
|
83
|
-
for (let i = parts.length - 1; i >= 0; i--) {
|
|
84
|
-
const next = parts[i] + '/' + result;
|
|
85
|
-
if (next.length > maxLength - 3) {
|
|
86
|
-
return '.../' + result;
|
|
87
|
-
}
|
|
88
|
-
result = next;
|
|
89
|
-
}
|
|
90
|
-
return result;
|
|
76
|
+
return parts[parts.length - 1] || path;
|
|
91
77
|
}
|
|
92
78
|
/**
|
|
93
79
|
* Default tool handlers for Moldable tools
|
|
@@ -103,8 +89,8 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
103
89
|
if (!result.success) {
|
|
104
90
|
return (_jsx(FileOperation, { operation: "read", path: result.path || 'file', success: false }, toolCallId));
|
|
105
91
|
}
|
|
106
|
-
//
|
|
107
|
-
return (
|
|
92
|
+
// Show simple indicator for successful reads
|
|
93
|
+
return (_jsx(FileOperation, { operation: "read", path: result.path || 'file', success: true }, toolCallId));
|
|
108
94
|
},
|
|
109
95
|
},
|
|
110
96
|
writeFile: {
|
|
@@ -119,18 +105,18 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
119
105
|
const previewLines = lines.slice(0, 20);
|
|
120
106
|
const preview = previewLines.join('\n').slice(0, 1000);
|
|
121
107
|
const lineCount = lines.length;
|
|
122
|
-
return (_jsxs("div", { className: "my-1 min-w-0", children: [_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(FileText, { className: "size-3.5 shrink-0 animate-pulse" }), _jsx("span", { className: "shrink-0 font-medium", children: "Writing" }), _jsx("code", { className: "bg-background/50 min-w-0 truncate rounded px-1 font-mono", children: path ?
|
|
108
|
+
return (_jsxs("div", { className: "my-1 min-w-0", children: [_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(FileText, { className: "size-3.5 shrink-0 animate-pulse" }), _jsx("span", { className: "shrink-0 font-medium", children: "Writing" }), _jsx("code", { className: "bg-background/50 min-w-0 truncate rounded px-1 font-mono", children: path ? getFileName(path) : 'file' }), _jsxs("span", { className: "text-muted-foreground/70 shrink-0", children: ["(", lineCount, " line", lineCount !== 1 ? 's' : '', ")"] })] }), _jsx("div", { className: "mt-2", children: _jsx(CodeBlock, { maxHeight: 200, children: preview }) })] }));
|
|
123
109
|
}
|
|
124
110
|
// Fallback when content hasn't started streaming yet
|
|
125
|
-
return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(FileText, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Writing ", path ?
|
|
111
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(FileText, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Writing ", path ? getFileName(path) : 'file', "..."] })] }));
|
|
126
112
|
},
|
|
127
113
|
renderOutput: (output, toolCallId) => {
|
|
128
114
|
const result = (output ?? {});
|
|
129
115
|
if (!result.success) {
|
|
130
116
|
return (_jsx(FileOperation, { operation: "write", path: result.path || 'file', success: false }, toolCallId));
|
|
131
117
|
}
|
|
132
|
-
// Show
|
|
133
|
-
return (
|
|
118
|
+
// Show simple indicator for successful writes
|
|
119
|
+
return (_jsx(FileOperation, { operation: "write", path: result.path || 'file', success: true }, toolCallId));
|
|
134
120
|
},
|
|
135
121
|
},
|
|
136
122
|
listDirectory: {
|
|
@@ -147,7 +133,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
147
133
|
const entries = result.items
|
|
148
134
|
? result.items.map((i) => `${i.type === 'directory' ? '📁' : '📄'} ${i.name}`)
|
|
149
135
|
: result.entries || [];
|
|
150
|
-
return (_jsxs(
|
|
136
|
+
return (_jsxs("div", { className: cn('my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs', 'bg-muted text-muted-foreground'), children: [_jsx(FolderOpen, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: "Listed" }), _jsx("code", { className: "bg-background/50 min-w-0 truncate rounded px-1 font-mono", title: result.path, children: getFileName(result.path || 'directory') }), _jsxs("span", { className: "text-muted-foreground/70 shrink-0", children: ["(", entries.length, " items)"] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
|
|
151
137
|
},
|
|
152
138
|
},
|
|
153
139
|
fileExists: {
|
|
@@ -205,7 +191,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
205
191
|
inline: true,
|
|
206
192
|
renderLoading: (args) => {
|
|
207
193
|
const { path } = (args ?? {});
|
|
208
|
-
return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Trash2, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Deleting ", path ?
|
|
194
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Trash2, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Deleting ", path ? getFileName(path) : 'file', "..."] })] }));
|
|
209
195
|
},
|
|
210
196
|
renderOutput: (output, toolCallId) => {
|
|
211
197
|
const result = (output ?? {});
|
|
@@ -218,7 +204,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
218
204
|
inline: true,
|
|
219
205
|
renderLoading: (args) => {
|
|
220
206
|
const { path } = (args ?? {});
|
|
221
|
-
return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(FileCode, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Editing ", path ?
|
|
207
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(FileCode, { className: "size-3.5 shrink-0 animate-pulse" }), _jsxs("span", { className: "truncate", children: ["Editing ", path ? getFileName(path) : 'file', "..."] })] }));
|
|
222
208
|
},
|
|
223
209
|
renderOutput: (output, toolCallId) => {
|
|
224
210
|
const result = (output ?? {});
|
|
@@ -243,7 +229,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
243
229
|
// Handle raw content output (ripgrep format)
|
|
244
230
|
if (result.content && !result.matches) {
|
|
245
231
|
const lines = result.content.split('\n').filter(Boolean);
|
|
246
|
-
return (_jsxs(
|
|
232
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Search, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: "Search results" }), _jsxs("span", { className: "text-muted-foreground/70 shrink-0", children: ["(", lines.length, " lines)"] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
|
|
247
233
|
}
|
|
248
234
|
if (result.success === false || !result.matches?.length) {
|
|
249
235
|
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Search, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: "No matches found" })] }, toolCallId));
|
|
@@ -257,13 +243,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
257
243
|
}, {});
|
|
258
244
|
const fileCount = Object.keys(byFile).length;
|
|
259
245
|
const matchCount = result.totalMatches || result.matches.length;
|
|
260
|
-
return (_jsxs(
|
|
261
|
-
.slice(0, 10)
|
|
262
|
-
.map(([file, matches]) => (_jsxs("div", { children: [_jsx("div", { className: "text-muted-foreground mb-1 font-mono text-xs", children: truncatePath(file, 60) }), _jsxs(CodeBlock, { maxHeight: 150, children: [matches
|
|
263
|
-
.slice(0, 5)
|
|
264
|
-
.map((m) => `${m.line}: ${m.content}`)
|
|
265
|
-
.join('\n'), matches.length > 5 &&
|
|
266
|
-
`\n... and ${matches.length - 5} more`] })] }, file))), Object.keys(byFile).length > 10 && (_jsxs("div", { className: "text-muted-foreground text-xs", children: ["... and ", Object.keys(byFile).length - 10, " more files"] }))] }) })] }, toolCallId));
|
|
246
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Search, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: "Found" }), _jsxs("span", { className: "shrink-0", children: [matchCount, " match", matchCount !== 1 ? 'es' : '', " in ", fileCount, " file", fileCount !== 1 ? 's' : ''] }), result.truncated && (_jsx("span", { className: "shrink-0 text-amber-500", children: "(truncated)" })), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
|
|
267
247
|
},
|
|
268
248
|
},
|
|
269
249
|
globFileSearch: {
|
|
@@ -279,11 +259,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
279
259
|
if (result.success === false || !result.files?.length) {
|
|
280
260
|
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Search, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: "No files found" })] }, toolCallId));
|
|
281
261
|
}
|
|
282
|
-
return (_jsxs(
|
|
283
|
-
.slice(0, 50)
|
|
284
|
-
.map((f) => `📄 ${f}`)
|
|
285
|
-
.join('\n'), result.files.length > 50 &&
|
|
286
|
-
`\n... and ${result.files.length - 50} more files`] }) })] }, toolCallId));
|
|
262
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Search, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: "Found" }), _jsxs("span", { className: "shrink-0", children: [result.files.length, " file", result.files.length !== 1 ? 's' : ''] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
|
|
287
263
|
},
|
|
288
264
|
},
|
|
289
265
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -304,7 +280,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
304
280
|
if (result.success === false || !result.results?.length) {
|
|
305
281
|
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Globe, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: "No results found" })] }, toolCallId));
|
|
306
282
|
}
|
|
307
|
-
return (_jsxs(
|
|
283
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Globe, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: "Web search" }), _jsxs("span", { className: "shrink-0", children: [result.results.length, " result", result.results.length !== 1 ? 's' : ''] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
|
|
308
284
|
},
|
|
309
285
|
},
|
|
310
286
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -320,8 +296,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
320
296
|
if (result.success === false || !result.repositories?.length) {
|
|
321
297
|
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(BookOpen, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: result.error || 'No skill repositories configured' })] }, toolCallId));
|
|
322
298
|
}
|
|
323
|
-
return (_jsxs(
|
|
324
|
-
` +${repo.skills.length - 5} more`] })] })), repo.lastSync && (_jsxs("span", { children: ["Last sync:", ' ', new Date(repo.lastSync).toLocaleDateString()] }))] })] }, idx))) }) })] }, toolCallId));
|
|
299
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(BookOpen, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: "Skill Repositories" }), _jsxs("span", { className: "shrink-0", children: ["(", result.repositories.length, " repo", result.repositories.length !== 1 ? 's' : '', ")"] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
|
|
325
300
|
},
|
|
326
301
|
},
|
|
327
302
|
listAvailableSkills: {
|
|
@@ -339,12 +314,7 @@ export const DEFAULT_TOOL_HANDLERS = {
|
|
|
339
314
|
}
|
|
340
315
|
const available = result.available || [];
|
|
341
316
|
const selected = result.selected || [];
|
|
342
|
-
return (_jsxs(
|
|
343
|
-
const isSelected = selected.includes(skill);
|
|
344
|
-
return (_jsxs("span", { className: cn('inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium', isSelected
|
|
345
|
-
? 'bg-primary/10 text-primary'
|
|
346
|
-
: 'bg-muted text-muted-foreground'), children: [isSelected && _jsx(Check, { className: "size-2.5" }), skill] }, skill));
|
|
347
|
-
}) }), result.mode && (_jsxs("div", { className: "text-muted-foreground text-[10px]", children: ["Selection mode:", ' ', _jsx("span", { className: "font-medium", children: result.mode })] }))] }) })] }, toolCallId));
|
|
317
|
+
return (_jsxs("div", { className: "bg-muted text-muted-foreground my-1 inline-flex max-w-full items-center gap-2 rounded-md px-2 py-1 text-xs", children: [_jsx(Sparkles, { className: "size-3.5 shrink-0" }), _jsx("span", { className: "shrink-0 font-medium", children: result.repoName || 'Available Skills' }), _jsxs("span", { className: "shrink-0", children: ["(", selected.length, "/", available.length, " selected)"] }), _jsx(Check, { className: "size-3 shrink-0 text-green-600" })] }, toolCallId));
|
|
348
318
|
},
|
|
349
319
|
},
|
|
350
320
|
syncSkills: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
8
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/components/ui/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAE/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAEtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAQtD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAgBzD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAUzD;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
4
|
+
import { ChevronDownIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
function Accordion({ ...props }) {
|
|
7
|
+
return _jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
8
|
+
}
|
|
9
|
+
function AccordionItem({ className, ...props }) {
|
|
10
|
+
return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn('border-b last:border-b-0', className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
13
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium outline-none transition-all hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] }) }));
|
|
14
|
+
}
|
|
15
|
+
function AccordionContent({ className, children, ...props }) {
|
|
16
|
+
return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: _jsx("div", { className: cn('pb-4 pt-0', className), children: children }) }));
|
|
17
|
+
}
|
|
18
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OA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EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAO1D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,2CAO1D;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const alertVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
10
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,QAAA,MAAM,aAAa;;8EAclB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,2CASlE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAW7B;AAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
const alertVariants = cva('relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current', {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: 'bg-card text-card-foreground',
|
|
9
|
+
destructive: 'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
variant: 'default',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
function Alert({ className, variant, ...props }) {
|
|
17
|
+
return (_jsx("div", { "data-slot": "alert", role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function AlertTitle({ className, ...props }) {
|
|
20
|
+
return (_jsx("div", { "data-slot": "alert-title", className: cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function AlertDescription({ className, ...props }) {
|
|
23
|
+
return (_jsx("div", { "data-slot": "alert-description", className: cn('text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed', className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
2
|
+
declare function AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export { AspectRatio };
|
|
4
|
+
//# sourceMappingURL=aspect-ratio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aspect-ratio.d.ts","sourceRoot":"","sources":["../../../src/components/ui/aspect-ratio.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;AAEpE,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,2CAExD;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
4
|
+
function AspectRatio({ ...props }) {
|
|
5
|
+
return _jsx(AspectRatioPrimitive.Root, { "data-slot": "aspect-ratio", ...props });
|
|
6
|
+
}
|
|
7
|
+
export { AspectRatio };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
7
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAWnD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAQpD;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC,2CAWvD;AAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
function Avatar({ className, ...props }) {
|
|
6
|
+
return (_jsx(AvatarPrimitive.Root, { "data-slot": "avatar", className: cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
function AvatarImage({ className, ...props }) {
|
|
9
|
+
return (_jsx(AvatarPrimitive.Image, { "data-slot": "avatar-image", className: cn('aspect-square size-full', className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function AvatarFallback({ className, ...props }) {
|
|
12
|
+
return (_jsx(AvatarPrimitive.Fallback, { "data-slot": "avatar-fallback", className: cn('bg-muted flex size-full items-center justify-center rounded-full', className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,QAAA,MAAM,aAAa;;8EAmBlB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,EACP,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAC7B,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,2CAU3D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Breadcrumb({ ...props }: React.ComponentProps<'nav'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<'a'> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
12
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/ui/breadcrumb.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,UAAU,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAE5D;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAW1E;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAQ1E;AAED,iBAAS,cAAc,CAAC,EACtB,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,2CAUA;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAW5E;AAED,iBAAS,mBAAmB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAY5B;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAa9B;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
function Breadcrumb({ ...props }) {
|
|
7
|
+
return _jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
8
|
+
}
|
|
9
|
+
function BreadcrumbList({ className, ...props }) {
|
|
10
|
+
return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn('text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5', className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
13
|
+
return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn('inline-flex items-center gap-1.5', className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
16
|
+
const Comp = asChild ? Slot : 'a';
|
|
17
|
+
return (_jsx(Comp, { "data-slot": "breadcrumb-link", className: cn('hover:text-foreground transition-colors', className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
20
|
+
return (_jsx("span", { "data-slot": "breadcrumb-page", role: "link", "aria-disabled": "true", "aria-current": "page", className: cn('text-foreground font-normal', className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
23
|
+
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn('[&>svg]:size-3.5', className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
|
|
24
|
+
}
|
|
25
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
26
|
+
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn('flex size-9 items-center justify-center', className), ...props, children: [_jsx(MoreHorizontal, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
27
|
+
}
|
|
28
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|