@agent-native/core 0.168.9 → 0.168.11
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/corpus/README.md +1 -1
- package/corpus/templates/clips/changelog/2026-08-19-desktop-settings-are-tighter-with-a-new-advanced-tab.md +6 -0
- package/corpus/templates/clips/desktop/README.md +79 -1
- package/corpus/templates/clips/desktop/components.json +20 -0
- package/corpus/templates/clips/desktop/package.json +10 -1
- package/corpus/templates/clips/desktop/src/app.tsx +1812 -1994
- package/corpus/templates/clips/desktop/src/components/ReadinessPanel.tsx +23 -65
- package/corpus/templates/clips/desktop/src/components/settings/settings-ui.tsx +399 -0
- package/corpus/templates/clips/desktop/src/components/ui/alert-dialog.tsx +166 -0
- package/corpus/templates/clips/desktop/src/components/ui/button.tsx +57 -0
- package/corpus/templates/clips/desktop/src/components/ui/empty.tsx +104 -0
- package/corpus/templates/clips/desktop/src/components/ui/input.tsx +22 -0
- package/corpus/templates/clips/desktop/src/components/ui/popover.tsx +38 -0
- package/corpus/templates/clips/desktop/src/components/ui/select.tsx +164 -0
- package/corpus/templates/clips/desktop/src/components/ui/skeleton.tsx +15 -0
- package/corpus/templates/clips/desktop/src/components/ui/spinner.tsx +17 -0
- package/corpus/templates/clips/desktop/src/components/ui/switch.tsx +27 -0
- package/corpus/templates/clips/desktop/src/components/ui/textarea.tsx +22 -0
- package/corpus/templates/clips/desktop/src/dev/browser-preview.ts +65 -0
- package/corpus/templates/clips/desktop/src/hooks/useSystemAccessRows.ts +128 -0
- package/corpus/templates/clips/desktop/src/hooks/useWhisperSettings.ts +0 -2
- package/corpus/templates/clips/desktop/src/lib/permission-status.ts +84 -0
- package/corpus/templates/clips/desktop/src/lib/rewind-status.ts +6 -5
- package/corpus/templates/clips/desktop/src/lib/settings-navigation.ts +18 -5
- package/corpus/templates/clips/desktop/src/lib/utils.ts +6 -0
- package/corpus/templates/clips/desktop/src/main.tsx +31 -4
- package/corpus/templates/clips/desktop/src/overlays/finalizing.tsx +2 -2
- package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +2 -2
- package/corpus/templates/clips/desktop/src/styles.css +75 -1427
- package/corpus/templates/clips/desktop/src/tailwind.css +282 -0
- package/corpus/templates/clips/desktop/tsconfig.json +4 -1
- package/corpus/templates/clips/desktop/vite.config.ts +7 -1
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +1 -0
- package/corpus/templates/content/app/global.css +5 -0
- package/corpus/templates/content/docs/solutions/2026-08-20-code-block-slash-production-regression-shape.md +492 -0
- package/corpus/templates/content/docs/solutions/2026-08-20-code-block-surface-background-shape.md +273 -0
- package/dist/deploy/build.js +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/action-routes.js +3 -2
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/request-origin.d.ts +6 -0
- package/dist/server/request-origin.js +12 -0
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/mcp-embed-headers.d.ts +1 -1
- package/dist/shared/mcp-embed-headers.js +10 -3
- package/package.json +1 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { buttonVariants } from "@/components/ui/button";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
const AlertDialog = AlertDialogPrimitive.Root;
|
|
8
|
+
|
|
9
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
10
|
+
|
|
11
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Enter-only animation, deliberately unlike the registry's default.
|
|
15
|
+
*
|
|
16
|
+
* Two reasons, and both are load-bearing:
|
|
17
|
+
*
|
|
18
|
+
* 1. The registry pairs `translate-x-[-50%]` with `slide-in-from-left-1/2`,
|
|
19
|
+
* which reads on a small tray window as the dialog flying in from the left
|
|
20
|
+
* edge rather than as a centred macOS alert. A fade plus `zoom-in-95` is the
|
|
21
|
+
* platform gesture this app should match.
|
|
22
|
+
* 2. Radix Presence keeps an exiting node mounted until `animationend` fires.
|
|
23
|
+
* A closed overlay that never gets that event stays on screen at
|
|
24
|
+
* `pointer-events: auto` and swallows every click in the window — the whole
|
|
25
|
+
* surface goes dead with nothing visibly wrong. No exit animation means
|
|
26
|
+
* Radix unmounts synchronously and that failure mode cannot happen.
|
|
27
|
+
*
|
|
28
|
+
* So: don't reintroduce `animate-out` / `slide-*` here from a registry diff.
|
|
29
|
+
*
|
|
30
|
+
* Three more deliberate divergences a registry sync must not revert: the
|
|
31
|
+
* overlay scrim is the toolkit's token-based `bg-background/45` (the
|
|
32
|
+
* registry's black scrim is a raw color and blacks out a small tray window),
|
|
33
|
+
* the content radius is unconditional `rounded-lg` (the tray is narrower
|
|
34
|
+
* than the `sm:` breakpoint the registry gates it behind), and the enter
|
|
35
|
+
* duration is 150ms rather than 200ms to match the tray's motion.
|
|
36
|
+
*/
|
|
37
|
+
const AlertDialogOverlay = React.forwardRef<
|
|
38
|
+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
39
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
40
|
+
>(({ className, ...props }, ref) => (
|
|
41
|
+
<AlertDialogPrimitive.Overlay
|
|
42
|
+
className={cn(
|
|
43
|
+
"fixed inset-0 z-50 bg-background/45 backdrop-blur-[1px] data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
{...props}
|
|
47
|
+
ref={ref}
|
|
48
|
+
/>
|
|
49
|
+
));
|
|
50
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
51
|
+
|
|
52
|
+
const AlertDialogContent = React.forwardRef<
|
|
53
|
+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
54
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
55
|
+
>(({ className, ...props }, ref) => (
|
|
56
|
+
<AlertDialogPortal>
|
|
57
|
+
<AlertDialogOverlay />
|
|
58
|
+
{/* Portaled outside any `data-tw-surface` ancestor, so it marks itself —
|
|
59
|
+
see the scoped preflight subset in tailwind.css. */}
|
|
60
|
+
<AlertDialogPrimitive.Content
|
|
61
|
+
data-tw-surface
|
|
62
|
+
ref={ref}
|
|
63
|
+
className={cn(
|
|
64
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-150 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
67
|
+
{...props}
|
|
68
|
+
/>
|
|
69
|
+
</AlertDialogPortal>
|
|
70
|
+
));
|
|
71
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
72
|
+
|
|
73
|
+
const AlertDialogHeader = ({
|
|
74
|
+
className,
|
|
75
|
+
...props
|
|
76
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
77
|
+
<div
|
|
78
|
+
className={cn(
|
|
79
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
80
|
+
className,
|
|
81
|
+
)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
86
|
+
|
|
87
|
+
const AlertDialogFooter = ({
|
|
88
|
+
className,
|
|
89
|
+
...props
|
|
90
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
91
|
+
<div
|
|
92
|
+
className={cn(
|
|
93
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
94
|
+
className,
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
100
|
+
|
|
101
|
+
const AlertDialogTitle = React.forwardRef<
|
|
102
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
103
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
104
|
+
>(({ className, ...props }, ref) => (
|
|
105
|
+
<AlertDialogPrimitive.Title
|
|
106
|
+
ref={ref}
|
|
107
|
+
className={cn("text-lg font-semibold", className)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
));
|
|
111
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
112
|
+
|
|
113
|
+
const AlertDialogDescription = React.forwardRef<
|
|
114
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
115
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
116
|
+
>(({ className, ...props }, ref) => (
|
|
117
|
+
<AlertDialogPrimitive.Description
|
|
118
|
+
ref={ref}
|
|
119
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
120
|
+
{...props}
|
|
121
|
+
/>
|
|
122
|
+
));
|
|
123
|
+
AlertDialogDescription.displayName =
|
|
124
|
+
AlertDialogPrimitive.Description.displayName;
|
|
125
|
+
|
|
126
|
+
const AlertDialogAction = React.forwardRef<
|
|
127
|
+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
128
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
129
|
+
>(({ className, ...props }, ref) => (
|
|
130
|
+
<AlertDialogPrimitive.Action
|
|
131
|
+
ref={ref}
|
|
132
|
+
className={cn(buttonVariants(), className)}
|
|
133
|
+
{...props}
|
|
134
|
+
/>
|
|
135
|
+
));
|
|
136
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
137
|
+
|
|
138
|
+
const AlertDialogCancel = React.forwardRef<
|
|
139
|
+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
140
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
141
|
+
>(({ className, ...props }, ref) => (
|
|
142
|
+
<AlertDialogPrimitive.Cancel
|
|
143
|
+
ref={ref}
|
|
144
|
+
className={cn(
|
|
145
|
+
buttonVariants({ variant: "outline" }),
|
|
146
|
+
"mt-2 sm:mt-0",
|
|
147
|
+
className,
|
|
148
|
+
)}
|
|
149
|
+
{...props}
|
|
150
|
+
/>
|
|
151
|
+
));
|
|
152
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
AlertDialog,
|
|
156
|
+
AlertDialogPortal,
|
|
157
|
+
AlertDialogOverlay,
|
|
158
|
+
AlertDialogTrigger,
|
|
159
|
+
AlertDialogContent,
|
|
160
|
+
AlertDialogHeader,
|
|
161
|
+
AlertDialogFooter,
|
|
162
|
+
AlertDialogTitle,
|
|
163
|
+
AlertDialogDescription,
|
|
164
|
+
AlertDialogAction,
|
|
165
|
+
AlertDialogCancel,
|
|
166
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive:
|
|
14
|
+
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
15
|
+
outline:
|
|
16
|
+
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
secondary:
|
|
18
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
20
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
default: "h-10 px-4 py-2",
|
|
24
|
+
sm: "h-9 rounded-md px-3",
|
|
25
|
+
lg: "h-11 rounded-md px-8",
|
|
26
|
+
icon: "h-10 w-10",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default",
|
|
31
|
+
size: "default",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export interface ButtonProps
|
|
37
|
+
extends
|
|
38
|
+
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
39
|
+
VariantProps<typeof buttonVariants> {
|
|
40
|
+
asChild?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
44
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
45
|
+
const Comp = asChild ? Slot : "button";
|
|
46
|
+
return (
|
|
47
|
+
<Comp
|
|
48
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
49
|
+
ref={ref}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
Button.displayName = "Button";
|
|
56
|
+
|
|
57
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
|
|
5
|
+
function Empty({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
data-slot="empty"
|
|
9
|
+
className={cn(
|
|
10
|
+
"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",
|
|
11
|
+
className,
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
data-slot="empty-header"
|
|
22
|
+
className={cn(
|
|
23
|
+
"flex max-w-sm flex-col items-center gap-2 text-center",
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const emptyMediaVariants = cva(
|
|
32
|
+
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
33
|
+
{
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
default: "bg-transparent",
|
|
37
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "default",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
function EmptyMedia({
|
|
47
|
+
className,
|
|
48
|
+
variant = "default",
|
|
49
|
+
...props
|
|
50
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
data-slot="empty-icon"
|
|
54
|
+
data-variant={variant}
|
|
55
|
+
className={cn(emptyMediaVariants({ variant, className }))}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
62
|
+
return (
|
|
63
|
+
<div
|
|
64
|
+
data-slot="empty-title"
|
|
65
|
+
className={cn("text-lg font-medium tracking-tight", className)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
data-slot="empty-description"
|
|
75
|
+
className={cn(
|
|
76
|
+
"text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
77
|
+
className,
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
85
|
+
return (
|
|
86
|
+
<div
|
|
87
|
+
data-slot="empty-content"
|
|
88
|
+
className={cn(
|
|
89
|
+
"flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",
|
|
90
|
+
className,
|
|
91
|
+
)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
Empty,
|
|
99
|
+
EmptyHeader,
|
|
100
|
+
EmptyTitle,
|
|
101
|
+
EmptyDescription,
|
|
102
|
+
EmptyContent,
|
|
103
|
+
EmptyMedia,
|
|
104
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
|
|
5
|
+
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
|
6
|
+
({ className, type, ...props }, ref) => {
|
|
7
|
+
return (
|
|
8
|
+
<input
|
|
9
|
+
type={type}
|
|
10
|
+
className={cn(
|
|
11
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 aria-invalid:border-destructive aria-invalid:ring-destructive/20 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
+
className,
|
|
13
|
+
)}
|
|
14
|
+
ref={ref}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
Input.displayName = "Input";
|
|
21
|
+
|
|
22
|
+
export { Input };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
|
|
6
|
+
const Popover = PopoverPrimitive.Root;
|
|
7
|
+
|
|
8
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
9
|
+
|
|
10
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
11
|
+
|
|
12
|
+
// Deliberate addition over the registry output: SettingsPopover renders its
|
|
13
|
+
// own titled close button, which needs the Radix Close primitive.
|
|
14
|
+
const PopoverClose = PopoverPrimitive.Close;
|
|
15
|
+
|
|
16
|
+
const PopoverContent = React.forwardRef<
|
|
17
|
+
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
18
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
19
|
+
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
20
|
+
<PopoverPrimitive.Portal>
|
|
21
|
+
{/* Portaled outside any `data-tw-surface` ancestor, so it marks itself —
|
|
22
|
+
see the scoped preflight subset in tailwind.css. */}
|
|
23
|
+
<PopoverPrimitive.Content
|
|
24
|
+
data-tw-surface
|
|
25
|
+
ref={ref}
|
|
26
|
+
align={align}
|
|
27
|
+
sideOffset={sideOffset}
|
|
28
|
+
className={cn(
|
|
29
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-[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 origin-[--radix-popover-content-transform-origin]",
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
</PopoverPrimitive.Portal>
|
|
35
|
+
));
|
|
36
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
37
|
+
|
|
38
|
+
export { Popover, PopoverAnchor, PopoverClose, PopoverTrigger, PopoverContent };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
+
// Tabler is this repo's icon set; the registry component ships Lucide.
|
|
3
|
+
import {
|
|
4
|
+
IconCheck as Check,
|
|
5
|
+
IconChevronDown as ChevronDown,
|
|
6
|
+
IconChevronUp as ChevronUp,
|
|
7
|
+
} from "@tabler/icons-react";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
|
|
10
|
+
import { cn } from "@/lib/utils";
|
|
11
|
+
|
|
12
|
+
const Select = SelectPrimitive.Root;
|
|
13
|
+
|
|
14
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
15
|
+
|
|
16
|
+
const SelectValue = SelectPrimitive.Value;
|
|
17
|
+
|
|
18
|
+
const SelectTrigger = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
20
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
21
|
+
>(({ className, children, ...props }, ref) => (
|
|
22
|
+
<SelectPrimitive.Trigger
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn(
|
|
25
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
<SelectPrimitive.Icon asChild>
|
|
32
|
+
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
33
|
+
</SelectPrimitive.Icon>
|
|
34
|
+
</SelectPrimitive.Trigger>
|
|
35
|
+
));
|
|
36
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
37
|
+
|
|
38
|
+
const SelectScrollUpButton = React.forwardRef<
|
|
39
|
+
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
40
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
41
|
+
>(({ className, ...props }, ref) => (
|
|
42
|
+
<SelectPrimitive.ScrollUpButton
|
|
43
|
+
ref={ref}
|
|
44
|
+
className={cn(
|
|
45
|
+
"flex cursor-default items-center justify-center py-1",
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
<ChevronUp className="h-4 w-4" />
|
|
51
|
+
</SelectPrimitive.ScrollUpButton>
|
|
52
|
+
));
|
|
53
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
54
|
+
|
|
55
|
+
const SelectScrollDownButton = React.forwardRef<
|
|
56
|
+
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
57
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
58
|
+
>(({ className, ...props }, ref) => (
|
|
59
|
+
<SelectPrimitive.ScrollDownButton
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={cn(
|
|
62
|
+
"flex cursor-default items-center justify-center py-1",
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
>
|
|
67
|
+
<ChevronDown className="h-4 w-4" />
|
|
68
|
+
</SelectPrimitive.ScrollDownButton>
|
|
69
|
+
));
|
|
70
|
+
SelectScrollDownButton.displayName =
|
|
71
|
+
SelectPrimitive.ScrollDownButton.displayName;
|
|
72
|
+
|
|
73
|
+
const SelectContent = React.forwardRef<
|
|
74
|
+
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
75
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
76
|
+
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
77
|
+
<SelectPrimitive.Portal>
|
|
78
|
+
<SelectPrimitive.Content
|
|
79
|
+
data-tw-surface
|
|
80
|
+
ref={ref}
|
|
81
|
+
className={cn(
|
|
82
|
+
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[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 origin-[--radix-select-content-transform-origin]",
|
|
83
|
+
position === "popper" &&
|
|
84
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
85
|
+
className,
|
|
86
|
+
)}
|
|
87
|
+
position={position}
|
|
88
|
+
{...props}
|
|
89
|
+
>
|
|
90
|
+
<SelectScrollUpButton />
|
|
91
|
+
<SelectPrimitive.Viewport
|
|
92
|
+
className={cn(
|
|
93
|
+
"p-1",
|
|
94
|
+
position === "popper" &&
|
|
95
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
96
|
+
)}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</SelectPrimitive.Viewport>
|
|
100
|
+
<SelectScrollDownButton />
|
|
101
|
+
</SelectPrimitive.Content>
|
|
102
|
+
</SelectPrimitive.Portal>
|
|
103
|
+
));
|
|
104
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
105
|
+
|
|
106
|
+
const SelectLabel = React.forwardRef<
|
|
107
|
+
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
108
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
109
|
+
>(({ className, ...props }, ref) => (
|
|
110
|
+
<SelectPrimitive.Label
|
|
111
|
+
ref={ref}
|
|
112
|
+
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
));
|
|
116
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
117
|
+
|
|
118
|
+
const SelectItem = React.forwardRef<
|
|
119
|
+
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
120
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
121
|
+
>(({ className, children, ...props }, ref) => (
|
|
122
|
+
<SelectPrimitive.Item
|
|
123
|
+
ref={ref}
|
|
124
|
+
className={cn(
|
|
125
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
126
|
+
className,
|
|
127
|
+
)}
|
|
128
|
+
{...props}
|
|
129
|
+
>
|
|
130
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
131
|
+
<SelectPrimitive.ItemIndicator>
|
|
132
|
+
<Check className="h-4 w-4" />
|
|
133
|
+
</SelectPrimitive.ItemIndicator>
|
|
134
|
+
</span>
|
|
135
|
+
|
|
136
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
137
|
+
</SelectPrimitive.Item>
|
|
138
|
+
));
|
|
139
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
140
|
+
|
|
141
|
+
const SelectSeparator = React.forwardRef<
|
|
142
|
+
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
143
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
144
|
+
>(({ className, ...props }, ref) => (
|
|
145
|
+
<SelectPrimitive.Separator
|
|
146
|
+
ref={ref}
|
|
147
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
148
|
+
{...props}
|
|
149
|
+
/>
|
|
150
|
+
));
|
|
151
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
Select,
|
|
155
|
+
SelectGroup,
|
|
156
|
+
SelectValue,
|
|
157
|
+
SelectTrigger,
|
|
158
|
+
SelectContent,
|
|
159
|
+
SelectLabel,
|
|
160
|
+
SelectItem,
|
|
161
|
+
SelectSeparator,
|
|
162
|
+
SelectScrollUpButton,
|
|
163
|
+
SelectScrollDownButton,
|
|
164
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "@/lib/utils";
|
|
2
|
+
|
|
3
|
+
function Skeleton({
|
|
4
|
+
className,
|
|
5
|
+
...props
|
|
6
|
+
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
className={cn("animate-pulse rounded-md bg-muted", className)}
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Skeleton };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Tabler is this repo's icon set; the generated component ships Lucide.
|
|
2
|
+
import { IconLoader2 } from "@tabler/icons-react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
|
|
6
|
+
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
|
|
7
|
+
return (
|
|
8
|
+
<IconLoader2
|
|
9
|
+
role="status"
|
|
10
|
+
aria-label="Loading"
|
|
11
|
+
className={cn("size-4 animate-spin", className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Spinner };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
|
|
6
|
+
const Switch = React.forwardRef<
|
|
7
|
+
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
|
9
|
+
>(({ className, ...props }, ref) => (
|
|
10
|
+
<SwitchPrimitives.Root
|
|
11
|
+
className={cn(
|
|
12
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
13
|
+
className,
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
ref={ref}
|
|
17
|
+
>
|
|
18
|
+
<SwitchPrimitives.Thumb
|
|
19
|
+
className={cn(
|
|
20
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
21
|
+
)}
|
|
22
|
+
/>
|
|
23
|
+
</SwitchPrimitives.Root>
|
|
24
|
+
));
|
|
25
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
26
|
+
|
|
27
|
+
export { Switch };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
|
|
5
|
+
const Textarea = React.forwardRef<
|
|
6
|
+
HTMLTextAreaElement,
|
|
7
|
+
React.ComponentProps<"textarea">
|
|
8
|
+
>(({ className, ...props }, ref) => {
|
|
9
|
+
return (
|
|
10
|
+
<textarea
|
|
11
|
+
className={cn(
|
|
12
|
+
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
13
|
+
className,
|
|
14
|
+
)}
|
|
15
|
+
ref={ref}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
Textarea.displayName = "Textarea";
|
|
21
|
+
|
|
22
|
+
export { Textarea };
|