@townco/ui 0.1.0 → 0.1.3
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/core/hooks/use-chat-input.d.ts +17 -17
- package/dist/core/hooks/use-chat-input.js +64 -55
- package/dist/core/hooks/use-chat-messages.d.ts +11 -11
- package/dist/core/hooks/use-chat-messages.js +121 -114
- package/dist/core/hooks/use-chat-session.d.ts +5 -5
- package/dist/core/hooks/use-chat-session.js +78 -80
- package/dist/core/hooks/use-media-query.d.ts +5 -5
- package/dist/core/hooks/use-media-query.js +38 -38
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/schemas/chat.d.ts +83 -56
- package/dist/core/schemas/chat.js +27 -25
- package/dist/core/store/chat-store.d.ts +28 -22
- package/dist/core/store/chat-store.js +59 -50
- package/dist/gui/components/Button.d.ts +23 -7
- package/dist/gui/components/Button.js +40 -27
- package/dist/gui/components/Card.d.ts +26 -7
- package/dist/gui/components/Card.js +54 -8
- package/dist/gui/components/ChatHeader.d.ts +58 -31
- package/dist/gui/components/ChatHeader.js +171 -66
- package/dist/gui/components/ChatInput.d.ts +58 -36
- package/dist/gui/components/ChatInput.js +191 -121
- package/dist/gui/components/ChatInterface.d.ts +9 -6
- package/dist/gui/components/ChatInterface.js +162 -90
- package/dist/gui/components/ChatLayout.d.ts +71 -41
- package/dist/gui/components/ChatLayout.js +214 -87
- package/dist/gui/components/ChatPanelTabContent.d.ts +18 -9
- package/dist/gui/components/ChatPanelTabContent.js +88 -10
- package/dist/gui/components/ChatPreview.d.ts +9 -6
- package/dist/gui/components/ChatPreview.js +212 -162
- package/dist/gui/components/ChatSecondaryPanel.d.ts +14 -11
- package/dist/gui/components/ChatSecondaryPanel.js +115 -38
- package/dist/gui/components/ChatSidebar.d.ts +26 -13
- package/dist/gui/components/ChatSidebar.js +48 -14
- package/dist/gui/components/ChatStatus.d.ts +4 -2
- package/dist/gui/components/ChatStatus.js +45 -34
- package/dist/gui/components/ChatView.d.ts +5 -3
- package/dist/gui/components/ChatView.js +38 -9
- package/dist/gui/components/ConfigPanel.d.ts +16 -12
- package/dist/gui/components/ConfigPanel.js +218 -41
- package/dist/gui/components/Conversation.d.ts +17 -14
- package/dist/gui/components/Conversation.js +143 -83
- package/dist/gui/components/Dialog.d.ts +57 -11
- package/dist/gui/components/Dialog.js +84 -8
- package/dist/gui/components/DropdownMenu.d.ts +101 -20
- package/dist/gui/components/DropdownMenu.js +161 -14
- package/dist/gui/components/HeightTransition.d.ts +12 -7
- package/dist/gui/components/HeightTransition.js +88 -77
- package/dist/gui/components/Input.d.ts +13 -6
- package/dist/gui/components/Input.js +27 -16
- package/dist/gui/components/InputBox.d.ts +19 -12
- package/dist/gui/components/InputBox.js +86 -14
- package/dist/gui/components/Label.d.ts +7 -1
- package/dist/gui/components/Label.js +12 -2
- package/dist/gui/components/MarkdownRenderer.d.ts +6 -4
- package/dist/gui/components/MarkdownRenderer.js +178 -81
- package/dist/gui/components/Message.d.ts +25 -18
- package/dist/gui/components/Message.js +44 -23
- package/dist/gui/components/MessageContent.d.ts +29 -22
- package/dist/gui/components/MessageContent.js +157 -85
- package/dist/gui/components/PlaygroundLayout.d.ts +9 -5
- package/dist/gui/components/PlaygroundLayout.js +43 -12
- package/dist/gui/components/Reasoning.d.ts +30 -24
- package/dist/gui/components/Reasoning.js +187 -60
- package/dist/gui/components/Response.d.ts +11 -9
- package/dist/gui/components/Response.js +229 -90
- package/dist/gui/components/Select.d.ts +69 -10
- package/dist/gui/components/Select.js +118 -12
- package/dist/gui/components/Sonner.d.ts +3 -1
- package/dist/gui/components/Sonner.js +29 -18
- package/dist/gui/components/StatusBar.d.ts +9 -5
- package/dist/gui/components/StatusBar.js +56 -9
- package/dist/gui/components/Tabs.d.ts +24 -4
- package/dist/gui/components/Tabs.js +32 -4
- package/dist/gui/components/Task.d.ts +28 -24
- package/dist/gui/components/Task.js +164 -31
- package/dist/gui/components/Textarea.d.ts +15 -7
- package/dist/gui/components/Textarea.js +63 -46
- package/dist/gui/components/ThinkingBlock.d.ts +20 -10
- package/dist/gui/components/ThinkingBlock.js +134 -35
- package/dist/gui/components/TodoList.d.ts +12 -10
- package/dist/gui/components/TodoList.js +22 -7
- package/dist/gui/components/TodoListItem.d.ts +9 -6
- package/dist/gui/components/TodoListItem.js +18 -4
- package/dist/gui/components/index.d.ts +59 -8
- package/dist/gui/components/index.js +42 -8
- package/dist/gui/lib/utils.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.test.js +0 -1
- package/dist/sdk/client/acp-client.d.ts +88 -76
- package/dist/sdk/client/acp-client.js +215 -217
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/schemas/agent.d.ts +111 -64
- package/dist/sdk/schemas/agent.js +24 -24
- package/dist/sdk/schemas/message.d.ts +245 -147
- package/dist/sdk/schemas/message.js +40 -40
- package/dist/sdk/schemas/session.d.ts +219 -135
- package/dist/sdk/schemas/session.js +27 -27
- package/dist/sdk/transports/http.d.ts +55 -55
- package/dist/sdk/transports/http.js +472 -469
- package/dist/sdk/transports/stdio.d.ts +20 -20
- package/dist/sdk/transports/stdio.js +289 -286
- package/dist/sdk/transports/types.d.ts +42 -42
- package/dist/sdk/transports/websocket.d.ts +12 -12
- package/dist/sdk/transports/websocket.js +52 -46
- package/dist/tui/components/ChatView.d.ts +4 -2
- package/dist/tui/components/ChatView.js +51 -18
- package/dist/tui/components/GameOfLife.js +64 -35
- package/dist/tui/components/InputBox.d.ts +18 -11
- package/dist/tui/components/InputBox.js +70 -10
- package/dist/tui/components/MessageList.d.ts +4 -2
- package/dist/tui/components/MessageList.js +37 -10
- package/dist/tui/components/MultiSelect.d.ts +15 -9
- package/dist/tui/components/MultiSelect.js +116 -69
- package/dist/tui/components/ReadlineInput.d.ts +12 -6
- package/dist/tui/components/ReadlineInput.js +252 -237
- package/dist/tui/components/SingleSelect.d.ts +15 -9
- package/dist/tui/components/SingleSelect.js +84 -43
- package/dist/tui/components/StatusBar.d.ts +11 -6
- package/dist/tui/components/StatusBar.js +102 -67
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/package.json +2 -3
|
@@ -1,87 +1,147 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
-
export const Conversation = React.forwardRef(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
5
|
+
export const Conversation = React.forwardRef(
|
|
6
|
+
(
|
|
7
|
+
{
|
|
8
|
+
autoScroll = true,
|
|
9
|
+
isStreaming = false,
|
|
10
|
+
scrollBehavior = "smooth",
|
|
11
|
+
scrollThreshold = 100,
|
|
12
|
+
showScrollButton = true,
|
|
13
|
+
scrollButton,
|
|
14
|
+
className,
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
ref,
|
|
19
|
+
) => {
|
|
20
|
+
const containerRef = useRef(null);
|
|
21
|
+
const [isNearBottom, setIsNearBottom] = useState(true);
|
|
22
|
+
const [showButton, setShowButton] = useState(false);
|
|
23
|
+
const lastScrollTopRef = useRef(0);
|
|
24
|
+
// Combine refs
|
|
25
|
+
React.useImperativeHandle(ref, () => {
|
|
26
|
+
if (!containerRef.current) {
|
|
27
|
+
throw new Error("Container ref not initialized");
|
|
28
|
+
}
|
|
29
|
+
return containerRef.current;
|
|
30
|
+
});
|
|
31
|
+
// Check if user is near bottom of scroll area
|
|
32
|
+
const checkScrollPosition = useCallback(() => {
|
|
33
|
+
const container = containerRef.current;
|
|
34
|
+
if (!container) return;
|
|
35
|
+
const { scrollTop, scrollHeight, clientHeight } = container;
|
|
36
|
+
const distanceFromBottom = scrollHeight - scrollTop - clientHeight;
|
|
37
|
+
const nearBottom = distanceFromBottom < scrollThreshold;
|
|
38
|
+
setIsNearBottom(nearBottom);
|
|
39
|
+
setShowButton(!nearBottom && showScrollButton);
|
|
40
|
+
lastScrollTopRef.current = scrollTop;
|
|
41
|
+
}, [scrollThreshold, showScrollButton]);
|
|
42
|
+
// Scroll to bottom
|
|
43
|
+
const scrollToBottom = useCallback(
|
|
44
|
+
(behavior = scrollBehavior) => {
|
|
45
|
+
const container = containerRef.current;
|
|
46
|
+
if (!container) return;
|
|
47
|
+
container.scrollTo({
|
|
48
|
+
top: container.scrollHeight,
|
|
49
|
+
behavior,
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
[scrollBehavior],
|
|
53
|
+
);
|
|
54
|
+
// Auto-scroll when new content appears and user is near bottom
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!autoScroll) return;
|
|
57
|
+
const container = containerRef.current;
|
|
58
|
+
if (!container) return;
|
|
59
|
+
// Always scroll during streaming if user is near bottom
|
|
60
|
+
if (isStreaming && isNearBottom) {
|
|
61
|
+
scrollToBottom("auto");
|
|
62
|
+
}
|
|
63
|
+
// Scroll on new messages if near bottom
|
|
64
|
+
else if (!isStreaming && isNearBottom) {
|
|
65
|
+
scrollToBottom();
|
|
66
|
+
}
|
|
67
|
+
}, [autoScroll, isStreaming, isNearBottom, scrollToBottom]);
|
|
68
|
+
// Set up scroll listener
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
const container = containerRef.current;
|
|
71
|
+
if (!container) return;
|
|
72
|
+
const handleScroll = () => {
|
|
73
|
+
checkScrollPosition();
|
|
74
|
+
};
|
|
75
|
+
container.addEventListener("scroll", handleScroll, { passive: true });
|
|
76
|
+
// Check initial position
|
|
77
|
+
checkScrollPosition();
|
|
78
|
+
return () => {
|
|
79
|
+
container.removeEventListener("scroll", handleScroll);
|
|
80
|
+
};
|
|
81
|
+
}, [checkScrollPosition]);
|
|
82
|
+
// Watch for resize events
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
const container = containerRef.current;
|
|
85
|
+
if (!container) return;
|
|
86
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
87
|
+
if (isNearBottom && autoScroll) {
|
|
88
|
+
scrollToBottom("auto");
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
resizeObserver.observe(container);
|
|
92
|
+
return () => {
|
|
93
|
+
resizeObserver.disconnect();
|
|
94
|
+
};
|
|
95
|
+
}, [isNearBottom, autoScroll, scrollToBottom]);
|
|
96
|
+
return _jsxs("div", {
|
|
97
|
+
className: "relative flex-1",
|
|
98
|
+
children: [
|
|
99
|
+
_jsx("div", {
|
|
100
|
+
ref: containerRef,
|
|
101
|
+
className: cn(
|
|
102
|
+
"h-full overflow-y-auto overflow-x-hidden",
|
|
103
|
+
"scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent",
|
|
104
|
+
className,
|
|
105
|
+
),
|
|
106
|
+
...props,
|
|
107
|
+
children: _jsx("div", {
|
|
108
|
+
className: "flex flex-col gap-4 px-4 py-4",
|
|
109
|
+
children: children,
|
|
110
|
+
}),
|
|
111
|
+
}),
|
|
112
|
+
showButton &&
|
|
113
|
+
_jsx("div", {
|
|
114
|
+
className: "absolute bottom-4 left-1/2 -translate-x-1/2 z-10",
|
|
115
|
+
children:
|
|
116
|
+
scrollButton ||
|
|
117
|
+
_jsxs("button", {
|
|
118
|
+
type: "button",
|
|
119
|
+
onClick: () => scrollToBottom(),
|
|
120
|
+
className:
|
|
121
|
+
"px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2",
|
|
122
|
+
"aria-label": "Scroll to bottom",
|
|
123
|
+
children: [
|
|
124
|
+
_jsx("svg", {
|
|
125
|
+
className: "w-4 h-4",
|
|
126
|
+
fill: "none",
|
|
127
|
+
stroke: "currentColor",
|
|
128
|
+
viewBox: "0 0 24 24",
|
|
129
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
130
|
+
role: "img",
|
|
131
|
+
"aria-label": "Down arrow",
|
|
132
|
+
children: _jsx("path", {
|
|
133
|
+
strokeLinecap: "round",
|
|
134
|
+
strokeLinejoin: "round",
|
|
135
|
+
strokeWidth: 2,
|
|
136
|
+
d: "M19 14l-7 7m0 0l-7-7m7 7V3",
|
|
137
|
+
}),
|
|
138
|
+
}),
|
|
139
|
+
"Scroll to bottom",
|
|
140
|
+
],
|
|
141
|
+
}),
|
|
142
|
+
}),
|
|
143
|
+
],
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
);
|
|
87
147
|
Conversation.displayName = "Conversation";
|
|
@@ -1,19 +1,65 @@
|
|
|
1
1
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
-
declare const DialogTrigger: React.ForwardRefExoticComponent<
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<
|
|
5
|
+
DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>
|
|
6
|
+
>;
|
|
5
7
|
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
-
declare const DialogClose: React.ForwardRefExoticComponent<
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
declare const DialogClose: React.ForwardRefExoticComponent<
|
|
9
|
+
DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>
|
|
10
|
+
>;
|
|
11
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<
|
|
12
|
+
Omit<
|
|
13
|
+
DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>,
|
|
14
|
+
"ref"
|
|
15
|
+
> &
|
|
16
|
+
React.RefAttributes<HTMLDivElement>
|
|
17
|
+
>;
|
|
18
|
+
declare const DialogContent: React.ForwardRefExoticComponent<
|
|
19
|
+
Omit<
|
|
20
|
+
DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>,
|
|
21
|
+
"ref"
|
|
22
|
+
> &
|
|
23
|
+
React.RefAttributes<HTMLDivElement>
|
|
24
|
+
>;
|
|
9
25
|
declare const DialogHeader: {
|
|
10
|
-
|
|
11
|
-
|
|
26
|
+
({
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
12
31
|
};
|
|
13
32
|
declare const DialogFooter: {
|
|
14
|
-
|
|
15
|
-
|
|
33
|
+
({
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<
|
|
40
|
+
Omit<
|
|
41
|
+
DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>,
|
|
42
|
+
"ref"
|
|
43
|
+
> &
|
|
44
|
+
React.RefAttributes<HTMLHeadingElement>
|
|
45
|
+
>;
|
|
46
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<
|
|
47
|
+
Omit<
|
|
48
|
+
DialogPrimitive.DialogDescriptionProps &
|
|
49
|
+
React.RefAttributes<HTMLParagraphElement>,
|
|
50
|
+
"ref"
|
|
51
|
+
> &
|
|
52
|
+
React.RefAttributes<HTMLParagraphElement>
|
|
53
|
+
>;
|
|
54
|
+
export {
|
|
55
|
+
Dialog,
|
|
56
|
+
DialogPortal,
|
|
57
|
+
DialogOverlay,
|
|
58
|
+
DialogClose,
|
|
59
|
+
DialogTrigger,
|
|
60
|
+
DialogContent,
|
|
61
|
+
DialogHeader,
|
|
62
|
+
DialogFooter,
|
|
63
|
+
DialogTitle,
|
|
64
|
+
DialogDescription,
|
|
16
65
|
};
|
|
17
|
-
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
-
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
-
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
@@ -1,22 +1,98 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
2
|
import { X } from "lucide-react";
|
|
4
3
|
import * as React from "react";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
+
|
|
6
7
|
const Dialog = DialogPrimitive.Root;
|
|
7
8
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
9
|
const DialogPortal = DialogPrimitive.Portal;
|
|
9
10
|
const DialogClose = DialogPrimitive.Close;
|
|
10
|
-
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) =>
|
|
11
|
+
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) =>
|
|
12
|
+
_jsx(DialogPrimitive.Overlay, {
|
|
13
|
+
ref: ref,
|
|
14
|
+
className: cn(
|
|
15
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
16
|
+
className,
|
|
17
|
+
),
|
|
18
|
+
...props,
|
|
19
|
+
}),
|
|
20
|
+
);
|
|
11
21
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
12
|
-
const DialogContent = React.forwardRef(
|
|
22
|
+
const DialogContent = React.forwardRef(
|
|
23
|
+
({ className, children, ...props }, ref) =>
|
|
24
|
+
_jsxs(DialogPortal, {
|
|
25
|
+
children: [
|
|
26
|
+
_jsx(DialogOverlay, {}),
|
|
27
|
+
_jsxs(DialogPrimitive.Content, {
|
|
28
|
+
ref: ref,
|
|
29
|
+
className: cn(
|
|
30
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
31
|
+
className,
|
|
32
|
+
),
|
|
33
|
+
...props,
|
|
34
|
+
children: [
|
|
35
|
+
children,
|
|
36
|
+
_jsxs(DialogPrimitive.Close, {
|
|
37
|
+
className:
|
|
38
|
+
"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
39
|
+
children: [
|
|
40
|
+
_jsx(X, { className: "h-4 w-4" }),
|
|
41
|
+
_jsx("span", { className: "sr-only", children: "Close" }),
|
|
42
|
+
],
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
13
49
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
14
|
-
const DialogHeader = ({ className, ...props }) =>
|
|
50
|
+
const DialogHeader = ({ className, ...props }) =>
|
|
51
|
+
_jsx("div", {
|
|
52
|
+
className: cn(
|
|
53
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
54
|
+
className,
|
|
55
|
+
),
|
|
56
|
+
...props,
|
|
57
|
+
});
|
|
15
58
|
DialogHeader.displayName = "DialogHeader";
|
|
16
|
-
const DialogFooter = ({ className, ...props }) =>
|
|
59
|
+
const DialogFooter = ({ className, ...props }) =>
|
|
60
|
+
_jsx("div", {
|
|
61
|
+
className: cn(
|
|
62
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
63
|
+
className,
|
|
64
|
+
),
|
|
65
|
+
...props,
|
|
66
|
+
});
|
|
17
67
|
DialogFooter.displayName = "DialogFooter";
|
|
18
|
-
const DialogTitle = React.forwardRef(({ className, ...props }, ref) =>
|
|
68
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) =>
|
|
69
|
+
_jsx(DialogPrimitive.Title, {
|
|
70
|
+
ref: ref,
|
|
71
|
+
className: cn(
|
|
72
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
73
|
+
className,
|
|
74
|
+
),
|
|
75
|
+
...props,
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
19
78
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
20
|
-
const DialogDescription = React.forwardRef(({ className, ...props }, ref) =>
|
|
79
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) =>
|
|
80
|
+
_jsx(DialogPrimitive.Description, {
|
|
81
|
+
ref: ref,
|
|
82
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
83
|
+
...props,
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
21
86
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
22
|
-
export {
|
|
87
|
+
export {
|
|
88
|
+
Dialog,
|
|
89
|
+
DialogPortal,
|
|
90
|
+
DialogOverlay,
|
|
91
|
+
DialogClose,
|
|
92
|
+
DialogTrigger,
|
|
93
|
+
DialogContent,
|
|
94
|
+
DialogHeader,
|
|
95
|
+
DialogFooter,
|
|
96
|
+
DialogTitle,
|
|
97
|
+
DialogDescription,
|
|
98
|
+
};
|
|
@@ -1,27 +1,108 @@
|
|
|
1
1
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
-
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<
|
|
5
|
-
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<
|
|
5
|
+
DropdownMenuPrimitive.DropdownMenuTriggerProps &
|
|
6
|
+
React.RefAttributes<HTMLButtonElement>
|
|
7
|
+
>;
|
|
8
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<
|
|
9
|
+
DropdownMenuPrimitive.DropdownMenuGroupProps &
|
|
10
|
+
React.RefAttributes<HTMLDivElement>
|
|
11
|
+
>;
|
|
6
12
|
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
13
|
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
-
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<
|
|
15
|
+
DropdownMenuPrimitive.DropdownMenuRadioGroupProps &
|
|
16
|
+
React.RefAttributes<HTMLDivElement>
|
|
17
|
+
>;
|
|
18
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<
|
|
19
|
+
Omit<
|
|
20
|
+
DropdownMenuPrimitive.DropdownMenuSubTriggerProps &
|
|
21
|
+
React.RefAttributes<HTMLDivElement>,
|
|
22
|
+
"ref"
|
|
23
|
+
> & {
|
|
24
|
+
inset?: boolean;
|
|
25
|
+
} & React.RefAttributes<HTMLDivElement>
|
|
26
|
+
>;
|
|
27
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<
|
|
28
|
+
Omit<
|
|
29
|
+
DropdownMenuPrimitive.DropdownMenuSubContentProps &
|
|
30
|
+
React.RefAttributes<HTMLDivElement>,
|
|
31
|
+
"ref"
|
|
32
|
+
> &
|
|
33
|
+
React.RefAttributes<HTMLDivElement>
|
|
34
|
+
>;
|
|
35
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<
|
|
36
|
+
Omit<
|
|
37
|
+
DropdownMenuPrimitive.DropdownMenuContentProps &
|
|
38
|
+
React.RefAttributes<HTMLDivElement>,
|
|
39
|
+
"ref"
|
|
40
|
+
> &
|
|
41
|
+
React.RefAttributes<HTMLDivElement>
|
|
42
|
+
>;
|
|
43
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<
|
|
44
|
+
Omit<
|
|
45
|
+
DropdownMenuPrimitive.DropdownMenuItemProps &
|
|
46
|
+
React.RefAttributes<HTMLDivElement>,
|
|
47
|
+
"ref"
|
|
48
|
+
> & {
|
|
49
|
+
inset?: boolean;
|
|
50
|
+
} & React.RefAttributes<HTMLDivElement>
|
|
51
|
+
>;
|
|
52
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<
|
|
53
|
+
Omit<
|
|
54
|
+
DropdownMenuPrimitive.DropdownMenuCheckboxItemProps &
|
|
55
|
+
React.RefAttributes<HTMLDivElement>,
|
|
56
|
+
"ref"
|
|
57
|
+
> &
|
|
58
|
+
React.RefAttributes<HTMLDivElement>
|
|
59
|
+
>;
|
|
60
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<
|
|
61
|
+
Omit<
|
|
62
|
+
DropdownMenuPrimitive.DropdownMenuRadioItemProps &
|
|
63
|
+
React.RefAttributes<HTMLDivElement>,
|
|
64
|
+
"ref"
|
|
65
|
+
> &
|
|
66
|
+
React.RefAttributes<HTMLDivElement>
|
|
67
|
+
>;
|
|
68
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<
|
|
69
|
+
Omit<
|
|
70
|
+
DropdownMenuPrimitive.DropdownMenuLabelProps &
|
|
71
|
+
React.RefAttributes<HTMLDivElement>,
|
|
72
|
+
"ref"
|
|
73
|
+
> & {
|
|
74
|
+
inset?: boolean;
|
|
75
|
+
} & React.RefAttributes<HTMLDivElement>
|
|
76
|
+
>;
|
|
77
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<
|
|
78
|
+
Omit<
|
|
79
|
+
DropdownMenuPrimitive.DropdownMenuSeparatorProps &
|
|
80
|
+
React.RefAttributes<HTMLDivElement>,
|
|
81
|
+
"ref"
|
|
82
|
+
> &
|
|
83
|
+
React.RefAttributes<HTMLDivElement>
|
|
84
|
+
>;
|
|
23
85
|
declare const DropdownMenuShortcut: {
|
|
24
|
-
|
|
25
|
-
|
|
86
|
+
({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
displayName: string;
|
|
91
|
+
};
|
|
92
|
+
export {
|
|
93
|
+
DropdownMenu,
|
|
94
|
+
DropdownMenuTrigger,
|
|
95
|
+
DropdownMenuContent,
|
|
96
|
+
DropdownMenuItem,
|
|
97
|
+
DropdownMenuCheckboxItem,
|
|
98
|
+
DropdownMenuRadioItem,
|
|
99
|
+
DropdownMenuLabel,
|
|
100
|
+
DropdownMenuSeparator,
|
|
101
|
+
DropdownMenuShortcut,
|
|
102
|
+
DropdownMenuGroup,
|
|
103
|
+
DropdownMenuPortal,
|
|
104
|
+
DropdownMenuSub,
|
|
105
|
+
DropdownMenuSubContent,
|
|
106
|
+
DropdownMenuSubTrigger,
|
|
107
|
+
DropdownMenuRadioGroup,
|
|
26
108
|
};
|
|
27
|
-
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|