@agents24/chat-react 0.5.0 → 0.5.2
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/README.md +90 -21
- package/compatibility.json +10 -10
- package/dist/chunk-SSUO4EPD.js +189 -0
- package/dist/chunk-SSUO4EPD.js.map +1 -0
- package/dist/chunk-ZCNHLFRB.js +108 -0
- package/dist/chunk-ZCNHLFRB.js.map +1 -0
- package/dist/index.cjs +112 -95
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +362 -68
- package/dist/index.js.map +1 -1
- package/dist/mcp-oauth.d.ts +13 -0
- package/dist/runtime/index.cjs +594 -0
- package/dist/runtime/index.cjs.map +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +458 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/input-contract.d.ts +20 -0
- package/dist/runtime/use-agent-chat-runtime.d.ts +83 -0
- package/dist/scaffold/app.d.ts +30 -0
- package/dist/scaffold/components/chat/chat-composer.d.ts +21 -0
- package/dist/scaffold/components/chat/chat-message.d.ts +21 -0
- package/dist/scaffold/components/chat/chat-shell.d.ts +8 -0
- package/dist/scaffold/components/chat/collapsible-user-message.d.ts +3 -0
- package/dist/scaffold/components/chat/external-link-dialog.d.ts +2 -0
- package/dist/scaffold/components/chat/identity-control.d.ts +4 -0
- package/dist/scaffold/components/chat/message-parts.d.ts +12 -0
- package/dist/scaffold/components/chat/theme-menu.d.ts +1 -0
- package/dist/scaffold/components/chat/thread-sidebar.d.ts +16 -0
- package/dist/scaffold/components/chat/timeline-loading.d.ts +7 -0
- package/dist/scaffold/components/chat/turn-outline.d.ts +4 -0
- package/dist/scaffold/components/theme-provider.d.ts +20 -0
- package/dist/scaffold/components/ui/attachment.d.ts +24 -0
- package/dist/scaffold/components/ui/bubble.d.ts +17 -0
- package/dist/scaffold/components/ui/button-group.d.ts +11 -0
- package/dist/scaffold/components/ui/button.d.ts +10 -0
- package/dist/scaffold/components/ui/dialog.d.ts +17 -0
- package/dist/scaffold/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/scaffold/components/ui/input.d.ts +3 -0
- package/dist/scaffold/components/ui/marker.d.ts +11 -0
- package/dist/scaffold/components/ui/message-scroller.d.ts +10 -0
- package/dist/scaffold/components/ui/message.d.ts +10 -0
- package/dist/scaffold/components/ui/popover.d.ts +6 -0
- package/dist/scaffold/components/ui/select.d.ts +8 -0
- package/dist/scaffold/components/ui/separator.d.ts +4 -0
- package/dist/scaffold/components/ui/sheet.d.ts +14 -0
- package/dist/scaffold/components/ui/sidebar.d.ts +69 -0
- package/dist/scaffold/components/ui/skeleton.d.ts +2 -0
- package/dist/scaffold/components/ui/textarea.d.ts +3 -0
- package/dist/scaffold/components/ui/tooltip.d.ts +15 -0
- package/dist/scaffold/hooks/use-mobile.d.ts +1 -0
- package/dist/scaffold/identity.d.ts +10 -0
- package/dist/scaffold/index.cjs +2270 -0
- package/dist/scaffold/index.cjs.map +1 -0
- package/dist/scaffold/index.d.ts +14 -0
- package/dist/scaffold/index.js +2244 -0
- package/dist/scaffold/index.js.map +1 -0
- package/dist/scaffold/lib/utils.d.ts +2 -0
- package/dist/styles.css +137 -378
- package/dist/types.d.ts +3 -13
- package/dist/ui/adapters.d.ts +1 -1
- package/dist/ui/agent-chat-actions.d.ts +12 -5
- package/dist/ui/agent-chat-composer.d.ts +2 -1
- package/dist/ui/agent-chat-context-compression-row.d.ts +5 -0
- package/dist/ui/agent-chat-context-status.d.ts +13 -0
- package/dist/ui/agent-chat-message.d.ts +7 -5
- package/dist/ui/agent-response-timeline.d.ts +29 -7
- package/dist/ui/ask-user-interaction-state.d.ts +20 -0
- package/dist/ui/ask-user-interaction.d.ts +8 -0
- package/dist/ui/index.cjs +1391 -271
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.js +2380 -65
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/tool-sessions.d.ts +70 -0
- package/dist/ui/use-audio-recorder.d.ts +8 -0
- package/package.json +27 -12
- package/scaffold/components.json +25 -0
- package/scaffold/manifest.json +28 -0
- package/scaffold/src/app.tsx +71 -0
- package/scaffold/src/chat.css +54 -0
- package/scaffold/src/components/chat/chat-composer.tsx +237 -0
- package/scaffold/src/components/chat/chat-message.tsx +76 -0
- package/scaffold/src/components/chat/chat-shell.tsx +257 -0
- package/scaffold/src/components/chat/collapsible-user-message.tsx +37 -0
- package/scaffold/src/components/chat/external-link-dialog.tsx +48 -0
- package/scaffold/src/components/chat/identity-control.tsx +69 -0
- package/scaffold/src/components/chat/message-parts.tsx +83 -0
- package/scaffold/src/components/chat/theme-menu.tsx +79 -0
- package/scaffold/src/components/chat/thread-sidebar.tsx +114 -0
- package/scaffold/src/components/chat/timeline-loading.ts +17 -0
- package/scaffold/src/components/chat/turn-outline.tsx +73 -0
- package/scaffold/src/components/theme-provider.tsx +91 -0
- package/scaffold/src/components/ui/attachment.tsx +204 -0
- package/scaffold/src/components/ui/bubble.tsx +125 -0
- package/scaffold/src/components/ui/button-group.tsx +83 -0
- package/scaffold/src/components/ui/button.tsx +65 -0
- package/scaffold/src/components/ui/dialog.tsx +171 -0
- package/scaffold/src/components/ui/dropdown-menu.tsx +271 -0
- package/scaffold/src/components/ui/input.tsx +19 -0
- package/scaffold/src/components/ui/marker.tsx +69 -0
- package/scaffold/src/components/ui/message-scroller.tsx +129 -0
- package/scaffold/src/components/ui/message.tsx +92 -0
- package/scaffold/src/components/ui/popover.tsx +40 -0
- package/scaffold/src/components/ui/select.tsx +92 -0
- package/scaffold/src/components/ui/separator.tsx +28 -0
- package/scaffold/src/components/ui/sheet.tsx +150 -0
- package/scaffold/src/components/ui/sidebar.tsx +677 -0
- package/scaffold/src/components/ui/skeleton.tsx +13 -0
- package/scaffold/src/components/ui/textarea.tsx +18 -0
- package/scaffold/src/components/ui/tooltip.tsx +56 -0
- package/scaffold/src/hooks/use-mobile.ts +24 -0
- package/scaffold/src/identity.ts +17 -0
- package/scaffold/src/index.css +222 -0
- package/scaffold/src/index.tsx +39 -0
- package/scaffold/src/lib/utils.ts +6 -0
- package/scaffold/styles.css +3 -0
- package/dist/chunk-CHAU7FNW.js +0 -140
- package/dist/chunk-CHAU7FNW.js.map +0 -1
- package/dist/chunk-LI67M74F.js +0 -445
- package/dist/chunk-LI67M74F.js.map +0 -1
- package/dist/chunk-R7WFL3YR.js +0 -1327
- package/dist/chunk-R7WFL3YR.js.map +0 -1
- package/dist/renderers.d.ts +0 -10
- package/dist/templates/agent-chat-app.d.ts +0 -18
- package/dist/templates/agent-chat-layout.d.ts +0 -77
- package/dist/templates/agent-chat-shell.d.ts +0 -37
- package/dist/templates/appearance-control.d.ts +0 -5
- package/dist/templates/index.cjs +0 -2600
- package/dist/templates/index.cjs.map +0 -1
- package/dist/templates/index.d.ts +0 -4
- package/dist/templates/index.js +0 -846
- package/dist/templates/index.js.map +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
2
|
+
import { Slot } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils"
|
|
5
|
+
import { Separator } from "./separator"
|
|
6
|
+
|
|
7
|
+
const buttonGroupVariants = cva(
|
|
8
|
+
"group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[>[data-variant=outline]]:*:data-[slot=input-group]:border-border has-[>[data-variant=outline]]:*:data-[slot=select-trigger]:border-border has-[>[data-variant=outline]]:[&>[data-slot=input-group]:has(:focus-visible)]:border-ring has-[>[data-variant=outline]]:[&>[data-slot=select-trigger]:focus-visible]:border-ring has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-4xl [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-variant=outline]]:[&>input]:border-border has-[>[data-variant=outline]]:[&>input:focus-visible]:border-ring",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
orientation: {
|
|
12
|
+
horizontal:
|
|
13
|
+
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-4xl!",
|
|
14
|
+
vertical:
|
|
15
|
+
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-4xl!",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
orientation: "horizontal",
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
function ButtonGroup({
|
|
25
|
+
className,
|
|
26
|
+
orientation,
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
role="group"
|
|
32
|
+
data-slot="button-group"
|
|
33
|
+
data-orientation={orientation}
|
|
34
|
+
className={cn(buttonGroupVariants({ orientation }), className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ButtonGroupText({
|
|
41
|
+
className,
|
|
42
|
+
asChild = false,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<"div"> & {
|
|
45
|
+
asChild?: boolean
|
|
46
|
+
}) {
|
|
47
|
+
const Comp = asChild ? Slot.Root : "div"
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Comp
|
|
51
|
+
className={cn(
|
|
52
|
+
"flex items-center gap-2 rounded-4xl border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function ButtonGroupSeparator({
|
|
61
|
+
className,
|
|
62
|
+
orientation = "vertical",
|
|
63
|
+
...props
|
|
64
|
+
}: React.ComponentProps<typeof Separator>) {
|
|
65
|
+
return (
|
|
66
|
+
<Separator
|
|
67
|
+
data-slot="button-group-separator"
|
|
68
|
+
orientation={orientation}
|
|
69
|
+
className={cn(
|
|
70
|
+
"relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto",
|
|
71
|
+
className
|
|
72
|
+
)}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
ButtonGroup,
|
|
80
|
+
ButtonGroupSeparator,
|
|
81
|
+
ButtonGroupText,
|
|
82
|
+
buttonGroupVariants,
|
|
83
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../lib/utils"
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
13
|
+
outline:
|
|
14
|
+
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30",
|
|
15
|
+
secondary:
|
|
16
|
+
"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
17
|
+
ghost:
|
|
18
|
+
"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
19
|
+
destructive:
|
|
20
|
+
"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
default:
|
|
25
|
+
"h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",
|
|
26
|
+
xs: "h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
|
|
27
|
+
sm: "h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
28
|
+
lg: "h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
29
|
+
icon: "size-9",
|
|
30
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
31
|
+
"icon-sm": "size-8",
|
|
32
|
+
"icon-lg": "size-10",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
size: "default",
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
function Button({
|
|
43
|
+
className,
|
|
44
|
+
variant = "default",
|
|
45
|
+
size = "default",
|
|
46
|
+
asChild = false,
|
|
47
|
+
...props
|
|
48
|
+
}: React.ComponentProps<"button"> &
|
|
49
|
+
VariantProps<typeof buttonVariants> & {
|
|
50
|
+
asChild?: boolean
|
|
51
|
+
}) {
|
|
52
|
+
const Comp = asChild ? Slot.Root : "button"
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Comp
|
|
56
|
+
data-slot="button"
|
|
57
|
+
data-variant={variant}
|
|
58
|
+
data-size={size}
|
|
59
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { Button, buttonVariants }
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Dialog as DialogPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../lib/utils"
|
|
7
|
+
import { Button } from "./button"
|
|
8
|
+
import { XIcon } from "lucide-react"
|
|
9
|
+
import { useThemePortalContainer } from "../theme-provider"
|
|
10
|
+
|
|
11
|
+
function Dialog({
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
14
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function DialogTrigger({
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
20
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function DialogPortal({
|
|
24
|
+
container,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
27
|
+
const themeContainer = useThemePortalContainer()
|
|
28
|
+
return <DialogPrimitive.Portal container={container || themeContainer || undefined} data-slot="dialog-portal" {...props} />
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function DialogClose({
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
34
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function DialogOverlay({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
|
41
|
+
return (
|
|
42
|
+
<DialogPrimitive.Overlay
|
|
43
|
+
data-slot="dialog-overlay"
|
|
44
|
+
className={cn(
|
|
45
|
+
"fixed inset-0 isolate z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function DialogContent({
|
|
54
|
+
className,
|
|
55
|
+
children,
|
|
56
|
+
showCloseButton = true,
|
|
57
|
+
...props
|
|
58
|
+
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
59
|
+
showCloseButton?: boolean
|
|
60
|
+
}) {
|
|
61
|
+
return (
|
|
62
|
+
<DialogPortal>
|
|
63
|
+
<DialogOverlay />
|
|
64
|
+
<DialogPrimitive.Content
|
|
65
|
+
data-slot="dialog-content"
|
|
66
|
+
className={cn(
|
|
67
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-4xl bg-popover p-6 text-sm text-popover-foreground shadow-xl ring-1 ring-foreground/5 duration-100 outline-none sm:max-w-md dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
68
|
+
className
|
|
69
|
+
)}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
{children}
|
|
73
|
+
{showCloseButton && (
|
|
74
|
+
<DialogPrimitive.Close data-slot="dialog-close" asChild>
|
|
75
|
+
<Button
|
|
76
|
+
variant="ghost"
|
|
77
|
+
className="absolute top-4 right-4 bg-secondary"
|
|
78
|
+
size="icon-sm"
|
|
79
|
+
>
|
|
80
|
+
<XIcon
|
|
81
|
+
/>
|
|
82
|
+
<span className="sr-only">Close</span>
|
|
83
|
+
</Button>
|
|
84
|
+
</DialogPrimitive.Close>
|
|
85
|
+
)}
|
|
86
|
+
</DialogPrimitive.Content>
|
|
87
|
+
</DialogPortal>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
data-slot="dialog-header"
|
|
95
|
+
className={cn("flex flex-col gap-1.5", className)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function DialogFooter({
|
|
102
|
+
className,
|
|
103
|
+
showCloseButton = false,
|
|
104
|
+
children,
|
|
105
|
+
...props
|
|
106
|
+
}: React.ComponentProps<"div"> & {
|
|
107
|
+
showCloseButton?: boolean
|
|
108
|
+
}) {
|
|
109
|
+
return (
|
|
110
|
+
<div
|
|
111
|
+
data-slot="dialog-footer"
|
|
112
|
+
className={cn(
|
|
113
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
114
|
+
className
|
|
115
|
+
)}
|
|
116
|
+
{...props}
|
|
117
|
+
>
|
|
118
|
+
{children}
|
|
119
|
+
{showCloseButton && (
|
|
120
|
+
<DialogPrimitive.Close asChild>
|
|
121
|
+
<Button variant="outline">Close</Button>
|
|
122
|
+
</DialogPrimitive.Close>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function DialogTitle({
|
|
129
|
+
className,
|
|
130
|
+
...props
|
|
131
|
+
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
132
|
+
return (
|
|
133
|
+
<DialogPrimitive.Title
|
|
134
|
+
data-slot="dialog-title"
|
|
135
|
+
className={cn(
|
|
136
|
+
"font-heading text-base leading-none font-medium",
|
|
137
|
+
className
|
|
138
|
+
)}
|
|
139
|
+
{...props}
|
|
140
|
+
/>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function DialogDescription({
|
|
145
|
+
className,
|
|
146
|
+
...props
|
|
147
|
+
}: React.ComponentProps<typeof DialogPrimitive.Description>) {
|
|
148
|
+
return (
|
|
149
|
+
<DialogPrimitive.Description
|
|
150
|
+
data-slot="dialog-description"
|
|
151
|
+
className={cn(
|
|
152
|
+
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
153
|
+
className
|
|
154
|
+
)}
|
|
155
|
+
{...props}
|
|
156
|
+
/>
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export {
|
|
161
|
+
Dialog,
|
|
162
|
+
DialogClose,
|
|
163
|
+
DialogContent,
|
|
164
|
+
DialogDescription,
|
|
165
|
+
DialogFooter,
|
|
166
|
+
DialogHeader,
|
|
167
|
+
DialogOverlay,
|
|
168
|
+
DialogPortal,
|
|
169
|
+
DialogTitle,
|
|
170
|
+
DialogTrigger,
|
|
171
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils"
|
|
5
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react"
|
|
6
|
+
import { useThemePortalContainer } from "../theme-provider"
|
|
7
|
+
|
|
8
|
+
function DropdownMenu({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
11
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function DropdownMenuPortal({
|
|
15
|
+
container,
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
18
|
+
const themeContainer = useThemePortalContainer()
|
|
19
|
+
return (
|
|
20
|
+
<DropdownMenuPrimitive.Portal container={container || themeContainer || undefined} data-slot="dropdown-menu-portal" {...props} />
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function DropdownMenuTrigger({
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
27
|
+
return (
|
|
28
|
+
<DropdownMenuPrimitive.Trigger
|
|
29
|
+
data-slot="dropdown-menu-trigger"
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function DropdownMenuContent({
|
|
36
|
+
className,
|
|
37
|
+
align = "start",
|
|
38
|
+
sideOffset = 4,
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
41
|
+
const themeContainer = useThemePortalContainer()
|
|
42
|
+
return (
|
|
43
|
+
<DropdownMenuPrimitive.Portal container={themeContainer || undefined}>
|
|
44
|
+
<DropdownMenuPrimitive.Content
|
|
45
|
+
data-slot="dropdown-menu-content"
|
|
46
|
+
sideOffset={sideOffset}
|
|
47
|
+
align={align}
|
|
48
|
+
className={cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-48 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-3xl bg-popover p-1.5 text-popover-foreground shadow-lg ring-1 ring-foreground/5 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
</DropdownMenuPrimitive.Portal>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function DropdownMenuGroup({
|
|
56
|
+
...props
|
|
57
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
58
|
+
return (
|
|
59
|
+
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function DropdownMenuItem({
|
|
64
|
+
className,
|
|
65
|
+
inset,
|
|
66
|
+
variant = "default",
|
|
67
|
+
...props
|
|
68
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
69
|
+
inset?: boolean
|
|
70
|
+
variant?: "default" | "destructive"
|
|
71
|
+
}) {
|
|
72
|
+
return (
|
|
73
|
+
<DropdownMenuPrimitive.Item
|
|
74
|
+
data-slot="dropdown-menu-item"
|
|
75
|
+
data-inset={inset}
|
|
76
|
+
data-variant={variant}
|
|
77
|
+
className={cn(
|
|
78
|
+
"group/dropdown-menu-item relative flex cursor-default items-center gap-2.5 rounded-2xl px-3 py-2 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function DropdownMenuCheckboxItem({
|
|
87
|
+
className,
|
|
88
|
+
children,
|
|
89
|
+
checked,
|
|
90
|
+
inset,
|
|
91
|
+
...props
|
|
92
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
93
|
+
inset?: boolean
|
|
94
|
+
}) {
|
|
95
|
+
return (
|
|
96
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
97
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
98
|
+
data-inset={inset}
|
|
99
|
+
className={cn(
|
|
100
|
+
"relative flex cursor-default items-center gap-2.5 rounded-2xl py-2 pr-8 pl-3 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
101
|
+
className
|
|
102
|
+
)}
|
|
103
|
+
checked={checked}
|
|
104
|
+
{...props}
|
|
105
|
+
>
|
|
106
|
+
<span
|
|
107
|
+
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
108
|
+
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
109
|
+
>
|
|
110
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
111
|
+
<CheckIcon
|
|
112
|
+
/>
|
|
113
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
114
|
+
</span>
|
|
115
|
+
{children}
|
|
116
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function DropdownMenuRadioGroup({
|
|
121
|
+
...props
|
|
122
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
123
|
+
return (
|
|
124
|
+
<DropdownMenuPrimitive.RadioGroup
|
|
125
|
+
data-slot="dropdown-menu-radio-group"
|
|
126
|
+
{...props}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function DropdownMenuRadioItem({
|
|
132
|
+
className,
|
|
133
|
+
children,
|
|
134
|
+
inset,
|
|
135
|
+
...props
|
|
136
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
137
|
+
inset?: boolean
|
|
138
|
+
}) {
|
|
139
|
+
return (
|
|
140
|
+
<DropdownMenuPrimitive.RadioItem
|
|
141
|
+
data-slot="dropdown-menu-radio-item"
|
|
142
|
+
data-inset={inset}
|
|
143
|
+
className={cn(
|
|
144
|
+
"relative flex cursor-default items-center gap-2.5 rounded-2xl py-2 pr-8 pl-3 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-9.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
145
|
+
className
|
|
146
|
+
)}
|
|
147
|
+
{...props}
|
|
148
|
+
>
|
|
149
|
+
<span
|
|
150
|
+
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
151
|
+
data-slot="dropdown-menu-radio-item-indicator"
|
|
152
|
+
>
|
|
153
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
154
|
+
<CheckIcon
|
|
155
|
+
/>
|
|
156
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
157
|
+
</span>
|
|
158
|
+
{children}
|
|
159
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function DropdownMenuLabel({
|
|
164
|
+
className,
|
|
165
|
+
inset,
|
|
166
|
+
...props
|
|
167
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
168
|
+
inset?: boolean
|
|
169
|
+
}) {
|
|
170
|
+
return (
|
|
171
|
+
<DropdownMenuPrimitive.Label
|
|
172
|
+
data-slot="dropdown-menu-label"
|
|
173
|
+
data-inset={inset}
|
|
174
|
+
className={cn(
|
|
175
|
+
"px-3 py-2.5 text-xs text-muted-foreground data-inset:pl-9.5",
|
|
176
|
+
className
|
|
177
|
+
)}
|
|
178
|
+
{...props}
|
|
179
|
+
/>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function DropdownMenuSeparator({
|
|
184
|
+
className,
|
|
185
|
+
...props
|
|
186
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
187
|
+
return (
|
|
188
|
+
<DropdownMenuPrimitive.Separator
|
|
189
|
+
data-slot="dropdown-menu-separator"
|
|
190
|
+
className={cn("-mx-1.5 my-1.5 h-px bg-border/50", className)}
|
|
191
|
+
{...props}
|
|
192
|
+
/>
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function DropdownMenuShortcut({
|
|
197
|
+
className,
|
|
198
|
+
...props
|
|
199
|
+
}: React.ComponentProps<"span">) {
|
|
200
|
+
return (
|
|
201
|
+
<span
|
|
202
|
+
data-slot="dropdown-menu-shortcut"
|
|
203
|
+
className={cn(
|
|
204
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
|
|
205
|
+
className
|
|
206
|
+
)}
|
|
207
|
+
{...props}
|
|
208
|
+
/>
|
|
209
|
+
)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function DropdownMenuSub({
|
|
213
|
+
...props
|
|
214
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
215
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function DropdownMenuSubTrigger({
|
|
219
|
+
className,
|
|
220
|
+
inset,
|
|
221
|
+
children,
|
|
222
|
+
...props
|
|
223
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
224
|
+
inset?: boolean
|
|
225
|
+
}) {
|
|
226
|
+
return (
|
|
227
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
228
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
229
|
+
data-inset={inset}
|
|
230
|
+
className={cn(
|
|
231
|
+
"flex cursor-default items-center gap-2 rounded-2xl px-3 py-2 text-sm font-medium outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
232
|
+
className
|
|
233
|
+
)}
|
|
234
|
+
{...props}
|
|
235
|
+
>
|
|
236
|
+
{children}
|
|
237
|
+
<ChevronRightIcon className="ml-auto" />
|
|
238
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function DropdownMenuSubContent({
|
|
243
|
+
className,
|
|
244
|
+
...props
|
|
245
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
246
|
+
return (
|
|
247
|
+
<DropdownMenuPrimitive.SubContent
|
|
248
|
+
data-slot="dropdown-menu-sub-content"
|
|
249
|
+
className={cn("z-50 min-w-36 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-3xl bg-popover p-1.5 text-popover-foreground shadow-lg ring-1 ring-foreground/5 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}
|
|
250
|
+
{...props}
|
|
251
|
+
/>
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export {
|
|
256
|
+
DropdownMenu,
|
|
257
|
+
DropdownMenuPortal,
|
|
258
|
+
DropdownMenuTrigger,
|
|
259
|
+
DropdownMenuContent,
|
|
260
|
+
DropdownMenuGroup,
|
|
261
|
+
DropdownMenuLabel,
|
|
262
|
+
DropdownMenuItem,
|
|
263
|
+
DropdownMenuCheckboxItem,
|
|
264
|
+
DropdownMenuRadioGroup,
|
|
265
|
+
DropdownMenuRadioItem,
|
|
266
|
+
DropdownMenuSeparator,
|
|
267
|
+
DropdownMenuShortcut,
|
|
268
|
+
DropdownMenuSub,
|
|
269
|
+
DropdownMenuSubTrigger,
|
|
270
|
+
DropdownMenuSubContent,
|
|
271
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../lib/utils"
|
|
4
|
+
|
|
5
|
+
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
6
|
+
return (
|
|
7
|
+
<input
|
|
8
|
+
type={type}
|
|
9
|
+
data-slot="input"
|
|
10
|
+
className={cn(
|
|
11
|
+
"h-9 w-full min-w-0 rounded-3xl border border-transparent bg-input/50 px-3 py-1 text-base transition-[color,box-shadow,background-color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
12
|
+
className
|
|
13
|
+
)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { Input }
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../lib/utils"
|
|
6
|
+
|
|
7
|
+
const markerVariants = cva(
|
|
8
|
+
"group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "",
|
|
13
|
+
separator:
|
|
14
|
+
"before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",
|
|
15
|
+
border: "border-b border-border pb-2",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
function Marker({
|
|
22
|
+
className,
|
|
23
|
+
variant = "default",
|
|
24
|
+
asChild = false,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<"div"> &
|
|
27
|
+
VariantProps<typeof markerVariants> & {
|
|
28
|
+
asChild?: boolean
|
|
29
|
+
}) {
|
|
30
|
+
const Comp = asChild ? Slot.Root : "div"
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Comp
|
|
34
|
+
data-slot="marker"
|
|
35
|
+
data-variant={variant}
|
|
36
|
+
className={cn(markerVariants({ variant, className }))}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function MarkerIcon({ className, ...props }: React.ComponentProps<"span">) {
|
|
43
|
+
return (
|
|
44
|
+
<span
|
|
45
|
+
data-slot="marker-icon"
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
className={cn(
|
|
48
|
+
"size-4 shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
49
|
+
className
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function MarkerContent({ className, ...props }: React.ComponentProps<"span">) {
|
|
57
|
+
return (
|
|
58
|
+
<span
|
|
59
|
+
data-slot="marker-content"
|
|
60
|
+
className={cn(
|
|
61
|
+
"min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { Marker, MarkerIcon, MarkerContent, markerVariants }
|