@rynx-ai/ui 0.1.9
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 +37 -0
- package/dist/components/alert-dialog.d.ts +16 -0
- package/dist/components/alert-dialog.js +34 -0
- package/dist/components/button.d.ts +11 -0
- package/dist/components/button.js +34 -0
- package/dist/components/dialog.d.ts +16 -0
- package/dist/components/dialog.js +30 -0
- package/dist/components/dropdown-menu.d.ts +8 -0
- package/dist/components/dropdown-menu.js +14 -0
- package/dist/components/input.d.ts +2 -0
- package/dist/components/input.js +5 -0
- package/dist/components/interaction-question.d.ts +42 -0
- package/dist/components/interaction-question.js +79 -0
- package/dist/components/native-select.d.ts +7 -0
- package/dist/components/native-select.js +12 -0
- package/dist/components/scroll-area.d.ts +9 -0
- package/dist/components/scroll-area.js +11 -0
- package/dist/components/select.d.ts +14 -0
- package/dist/components/select.js +28 -0
- package/dist/components/tabs.d.ts +6 -0
- package/dist/components/tabs.js +13 -0
- package/dist/components/textarea.d.ts +2 -0
- package/dist/components/textarea.js +5 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/package.json +68 -0
- package/src/components/alert-dialog.tsx +162 -0
- package/src/components/button.tsx +63 -0
- package/src/components/dialog.tsx +137 -0
- package/src/components/dropdown-menu.tsx +57 -0
- package/src/components/input.tsx +19 -0
- package/src/components/interaction-question.tsx +364 -0
- package/src/components/native-select.tsx +57 -0
- package/src/components/scroll-area.tsx +84 -0
- package/src/components/select.tsx +191 -0
- package/src/components/tabs.tsx +53 -0
- package/src/components/textarea.tsx +16 -0
- package/src/index.ts +12 -0
- package/src/lib/utils.ts +6 -0
- package/styles/tailwind.css +31 -0
- package/styles/tokens.css +55 -0
- package/styles/utilities.css +55 -0
- package/styles.css +4 -0
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rynx-ai/ui",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"description": "Shared Rynx web design tokens and shadcn/Radix UI primitives.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/",
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"src",
|
|
14
|
+
"styles",
|
|
15
|
+
"styles.css"
|
|
16
|
+
],
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"./styles.css",
|
|
21
|
+
"./styles/*.css"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./components/*": {
|
|
29
|
+
"types": "./src/components/*.tsx",
|
|
30
|
+
"default": "./dist/components/*.js"
|
|
31
|
+
},
|
|
32
|
+
"./lib/*": {
|
|
33
|
+
"types": "./src/lib/*.ts",
|
|
34
|
+
"default": "./dist/lib/*.js"
|
|
35
|
+
},
|
|
36
|
+
"./hooks/*": {
|
|
37
|
+
"types": "./src/hooks/*.ts",
|
|
38
|
+
"default": "./dist/hooks/*.js"
|
|
39
|
+
},
|
|
40
|
+
"./styles.css": "./styles.css"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@radix-ui/react-alert-dialog": "^1.1.6",
|
|
44
|
+
"@radix-ui/react-dialog": "^1.1.6",
|
|
45
|
+
"@radix-ui/react-dropdown-menu": "^2.1.20",
|
|
46
|
+
"@radix-ui/react-scroll-area": "^1.2.15",
|
|
47
|
+
"@radix-ui/react-select": "^2.1.6",
|
|
48
|
+
"@radix-ui/react-slot": "^1.1.2",
|
|
49
|
+
"@radix-ui/react-tabs": "^1.1.3",
|
|
50
|
+
"class-variance-authority": "^0.7.1",
|
|
51
|
+
"clsx": "^2.1.1",
|
|
52
|
+
"lucide-react": "^0.475.0",
|
|
53
|
+
"tailwind-merge": "^3.0.2",
|
|
54
|
+
"tw-animate-css": "^1.4.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": "^19.0.0",
|
|
58
|
+
"react-dom": "^19.0.0",
|
|
59
|
+
"tailwindcss": "^4.0.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/react": "^19.0.0",
|
|
63
|
+
"@types/react-dom": "^19.0.0"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "rm -rf dist && tsc -p tsconfig.json"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
|
|
7
|
+
export function AlertDialog(props: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
8
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const AlertDialogTrigger = React.forwardRef<
|
|
12
|
+
React.ElementRef<typeof AlertDialogPrimitive.Trigger>,
|
|
13
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Trigger>
|
|
14
|
+
>((props, ref) => (
|
|
15
|
+
<AlertDialogPrimitive.Trigger ref={ref} data-slot="alert-dialog-trigger" {...props} />
|
|
16
|
+
));
|
|
17
|
+
AlertDialogTrigger.displayName = AlertDialogPrimitive.Trigger.displayName;
|
|
18
|
+
|
|
19
|
+
export function AlertDialogPortal(props: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
20
|
+
return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const AlertDialogOverlay = React.forwardRef<
|
|
24
|
+
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
26
|
+
>(({ className, ...props }, ref) => (
|
|
27
|
+
<AlertDialogPrimitive.Overlay
|
|
28
|
+
ref={ref}
|
|
29
|
+
data-slot="alert-dialog-overlay"
|
|
30
|
+
className={cn(
|
|
31
|
+
"fixed inset-0 z-50 bg-black/10 duration-100 supports-[backdrop-filter]:backdrop-blur-xs data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
));
|
|
37
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
38
|
+
|
|
39
|
+
export const AlertDialogContent = React.forwardRef<
|
|
40
|
+
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
41
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & {
|
|
42
|
+
size?: "default" | "sm";
|
|
43
|
+
}
|
|
44
|
+
>(({ className, size = "default", ...props }, ref) => (
|
|
45
|
+
<AlertDialogPortal>
|
|
46
|
+
<AlertDialogOverlay />
|
|
47
|
+
<AlertDialogPrimitive.Content
|
|
48
|
+
ref={ref}
|
|
49
|
+
data-slot="alert-dialog-content"
|
|
50
|
+
data-size={size}
|
|
51
|
+
className={cn(
|
|
52
|
+
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] min-w-0 -translate-x-1/2 -translate-y-1/2 grid-cols-1 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 [&>*]:min-w-0",
|
|
53
|
+
className,
|
|
54
|
+
)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
</AlertDialogPortal>
|
|
58
|
+
));
|
|
59
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
60
|
+
|
|
61
|
+
export function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
62
|
+
return (
|
|
63
|
+
<div
|
|
64
|
+
data-slot="alert-dialog-header"
|
|
65
|
+
className={cn(
|
|
66
|
+
"grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",
|
|
67
|
+
className,
|
|
68
|
+
)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
75
|
+
return (
|
|
76
|
+
<div
|
|
77
|
+
data-slot="alert-dialog-footer"
|
|
78
|
+
className={cn(
|
|
79
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
80
|
+
className,
|
|
81
|
+
)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">) {
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
data-slot="alert-dialog-media"
|
|
91
|
+
className={cn(
|
|
92
|
+
"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
|
|
93
|
+
className,
|
|
94
|
+
)}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const AlertDialogTitle = React.forwardRef<
|
|
101
|
+
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
102
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
103
|
+
>(({ className, ...props }, ref) => (
|
|
104
|
+
<AlertDialogPrimitive.Title
|
|
105
|
+
ref={ref}
|
|
106
|
+
data-slot="alert-dialog-title"
|
|
107
|
+
className={cn(
|
|
108
|
+
"text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
109
|
+
className,
|
|
110
|
+
)}
|
|
111
|
+
{...props}
|
|
112
|
+
/>
|
|
113
|
+
));
|
|
114
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
115
|
+
|
|
116
|
+
export const AlertDialogDescription = React.forwardRef<
|
|
117
|
+
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
118
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
119
|
+
>(({ className, ...props }, ref) => (
|
|
120
|
+
<AlertDialogPrimitive.Description
|
|
121
|
+
ref={ref}
|
|
122
|
+
data-slot="alert-dialog-description"
|
|
123
|
+
className={cn(
|
|
124
|
+
"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
125
|
+
className,
|
|
126
|
+
)}
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
));
|
|
130
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
131
|
+
|
|
132
|
+
export const AlertDialogAction = React.forwardRef<
|
|
133
|
+
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
134
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> &
|
|
135
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">
|
|
136
|
+
>(({ className, variant = "default", size = "default", ...props }, ref) => (
|
|
137
|
+
<Button variant={variant} size={size} asChild>
|
|
138
|
+
<AlertDialogPrimitive.Action
|
|
139
|
+
ref={ref}
|
|
140
|
+
data-slot="alert-dialog-action"
|
|
141
|
+
className={cn(className)}
|
|
142
|
+
{...props}
|
|
143
|
+
/>
|
|
144
|
+
</Button>
|
|
145
|
+
));
|
|
146
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
147
|
+
|
|
148
|
+
export const AlertDialogCancel = React.forwardRef<
|
|
149
|
+
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
150
|
+
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel> &
|
|
151
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">
|
|
152
|
+
>(({ className, variant = "outline", size = "default", ...props }, ref) => (
|
|
153
|
+
<Button variant={variant} size={size} asChild>
|
|
154
|
+
<AlertDialogPrimitive.Cancel
|
|
155
|
+
ref={ref}
|
|
156
|
+
data-slot="alert-dialog-cancel"
|
|
157
|
+
className={cn(className)}
|
|
158
|
+
{...props}
|
|
159
|
+
/>
|
|
160
|
+
</Button>
|
|
161
|
+
));
|
|
162
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
@@ -0,0 +1,63 @@
|
|
|
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.js";
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-lg border border-transparent bg-clip-padding text-sm font-medium transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 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
|
+
destructive:
|
|
14
|
+
"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",
|
|
15
|
+
outline:
|
|
16
|
+
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
17
|
+
secondary:
|
|
18
|
+
"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",
|
|
19
|
+
ghost:
|
|
20
|
+
"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
default:
|
|
25
|
+
"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
26
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
27
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
28
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
29
|
+
icon: "size-8",
|
|
30
|
+
"icon-xs":
|
|
31
|
+
"size-6 rounded-[min(var(--radius-md),10px)] [&_svg:not([class*='size-'])]:size-3",
|
|
32
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)]",
|
|
33
|
+
"icon-lg": "size-9",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: { variant: "default", size: "default" },
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export interface ButtonProps
|
|
41
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
42
|
+
VariantProps<typeof buttonVariants> {
|
|
43
|
+
asChild?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
47
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
48
|
+
const Comp = asChild ? Slot : "button";
|
|
49
|
+
return (
|
|
50
|
+
<Comp
|
|
51
|
+
ref={ref}
|
|
52
|
+
data-slot="button"
|
|
53
|
+
data-variant={variant ?? "default"}
|
|
54
|
+
data-size={size ?? "default"}
|
|
55
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
);
|
|
61
|
+
Button.displayName = "Button";
|
|
62
|
+
|
|
63
|
+
export { buttonVariants };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import { X } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
|
|
8
|
+
export function Dialog(props: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
9
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const DialogTrigger = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof DialogPrimitive.Trigger>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>
|
|
15
|
+
>((props, ref) => <DialogPrimitive.Trigger ref={ref} data-slot="dialog-trigger" {...props} />);
|
|
16
|
+
DialogTrigger.displayName = DialogPrimitive.Trigger.displayName;
|
|
17
|
+
|
|
18
|
+
export function DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
19
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const DialogClose = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof DialogPrimitive.Close>,
|
|
24
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>
|
|
25
|
+
>((props, ref) => <DialogPrimitive.Close ref={ref} data-slot="dialog-close" {...props} />);
|
|
26
|
+
DialogClose.displayName = DialogPrimitive.Close.displayName;
|
|
27
|
+
|
|
28
|
+
export const DialogOverlay = React.forwardRef<
|
|
29
|
+
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
30
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
31
|
+
>(({ className, ...props }, ref) => (
|
|
32
|
+
<DialogPrimitive.Overlay
|
|
33
|
+
ref={ref}
|
|
34
|
+
data-slot="dialog-overlay"
|
|
35
|
+
className={cn(
|
|
36
|
+
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-[backdrop-filter]:backdrop-blur-xs data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
));
|
|
42
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
43
|
+
|
|
44
|
+
export const DialogContent = React.forwardRef<
|
|
45
|
+
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
46
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
47
|
+
showCloseButton?: boolean;
|
|
48
|
+
}
|
|
49
|
+
>(({ className, children, showCloseButton = true, ...props }, ref) => (
|
|
50
|
+
<DialogPortal>
|
|
51
|
+
<DialogOverlay />
|
|
52
|
+
<DialogPrimitive.Content
|
|
53
|
+
ref={ref}
|
|
54
|
+
data-slot="dialog-content"
|
|
55
|
+
className={cn(
|
|
56
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full min-w-0 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 grid-cols-1 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 [&>*]:min-w-0",
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
{showCloseButton && (
|
|
63
|
+
<DialogPrimitive.Close data-slot="dialog-close" asChild>
|
|
64
|
+
<Button variant="ghost" size="icon-sm" className="absolute top-2 right-2">
|
|
65
|
+
<X aria-hidden="true" />
|
|
66
|
+
<span className="sr-only">Close</span>
|
|
67
|
+
</Button>
|
|
68
|
+
</DialogPrimitive.Close>
|
|
69
|
+
)}
|
|
70
|
+
</DialogPrimitive.Content>
|
|
71
|
+
</DialogPortal>
|
|
72
|
+
));
|
|
73
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
74
|
+
|
|
75
|
+
export function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
data-slot="dialog-header"
|
|
79
|
+
className={cn("flex flex-col gap-2", className)}
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function DialogFooter({
|
|
86
|
+
className,
|
|
87
|
+
showCloseButton = false,
|
|
88
|
+
children,
|
|
89
|
+
...props
|
|
90
|
+
}: React.ComponentProps<"div"> & { showCloseButton?: boolean }) {
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
data-slot="dialog-footer"
|
|
94
|
+
className={cn(
|
|
95
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
|
|
96
|
+
className,
|
|
97
|
+
)}
|
|
98
|
+
{...props}
|
|
99
|
+
>
|
|
100
|
+
{children}
|
|
101
|
+
{showCloseButton && (
|
|
102
|
+
<DialogPrimitive.Close asChild>
|
|
103
|
+
<Button variant="outline">Close</Button>
|
|
104
|
+
</DialogPrimitive.Close>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const DialogTitle = React.forwardRef<
|
|
111
|
+
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
112
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
113
|
+
>(({ className, ...props }, ref) => (
|
|
114
|
+
<DialogPrimitive.Title
|
|
115
|
+
ref={ref}
|
|
116
|
+
data-slot="dialog-title"
|
|
117
|
+
className={cn("text-base leading-none font-medium", className)}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
));
|
|
121
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
122
|
+
|
|
123
|
+
export const DialogDescription = React.forwardRef<
|
|
124
|
+
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
125
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
126
|
+
>(({ className, ...props }, ref) => (
|
|
127
|
+
<DialogPrimitive.Description
|
|
128
|
+
ref={ref}
|
|
129
|
+
data-slot="dialog-description"
|
|
130
|
+
className={cn(
|
|
131
|
+
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
132
|
+
className,
|
|
133
|
+
)}
|
|
134
|
+
{...props}
|
|
135
|
+
/>
|
|
136
|
+
));
|
|
137
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
|
|
6
|
+
export function DropdownMenu(props: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
7
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const DropdownMenuTrigger = React.forwardRef<
|
|
11
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Trigger>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>
|
|
13
|
+
>((props, ref) => (
|
|
14
|
+
<DropdownMenuPrimitive.Trigger ref={ref} data-slot="dropdown-menu-trigger" {...props} />
|
|
15
|
+
));
|
|
16
|
+
DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
|
|
17
|
+
|
|
18
|
+
export const DropdownMenuContent = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
20
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
21
|
+
>(({ className, sideOffset = 4, collisionPadding = 8, ...props }, ref) => (
|
|
22
|
+
<DropdownMenuPrimitive.Portal>
|
|
23
|
+
<DropdownMenuPrimitive.Content
|
|
24
|
+
ref={ref}
|
|
25
|
+
data-slot="dropdown-menu-content"
|
|
26
|
+
sideOffset={sideOffset}
|
|
27
|
+
collisionPadding={collisionPadding}
|
|
28
|
+
className={cn(
|
|
29
|
+
"cn-menu-translucent z-50 min-w-36 origin-[var(--radix-dropdown-menu-content-transform-origin)] overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
</DropdownMenuPrimitive.Portal>
|
|
35
|
+
));
|
|
36
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
37
|
+
|
|
38
|
+
export const DropdownMenuItem = React.forwardRef<
|
|
39
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
40
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
41
|
+
variant?: "default" | "destructive";
|
|
42
|
+
}
|
|
43
|
+
>(({ className, variant = "default", ...props }, ref) => (
|
|
44
|
+
<DropdownMenuPrimitive.Item
|
|
45
|
+
ref={ref}
|
|
46
|
+
data-slot="dropdown-menu-item"
|
|
47
|
+
data-variant={variant}
|
|
48
|
+
className={cn(
|
|
49
|
+
"relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
50
|
+
variant === "destructive" &&
|
|
51
|
+
"text-destructive focus:bg-destructive/10 focus:text-destructive dark:focus:bg-destructive/20",
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
));
|
|
57
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
|
|
5
|
+
export const Input = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
|
|
6
|
+
({ className, type, ...props }, ref) => (
|
|
7
|
+
<input
|
|
8
|
+
ref={ref}
|
|
9
|
+
type={type}
|
|
10
|
+
data-slot="input"
|
|
11
|
+
className={cn(
|
|
12
|
+
"h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 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/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
13
|
+
className,
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
),
|
|
18
|
+
);
|
|
19
|
+
Input.displayName = "Input";
|