@robomous/ui-core 0.1.1 → 0.2.0
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 +15 -7
- package/dist/{primitives → components}/alert.js +1 -1
- package/dist/{primitives → components}/badge.js +1 -1
- package/dist/{primitives → components}/button.d.ts +1 -1
- package/dist/{primitives → components}/button.js +4 -1
- package/dist/{primitives → components}/card.d.ts +1 -1
- package/dist/{primitives → components}/card.js +2 -2
- package/dist/{primitives → components}/combobox.js +3 -3
- package/dist/{primitives → components}/dialog.js +1 -1
- package/dist/{primitives → components}/dropdown-menu.js +11 -6
- package/dist/{primitives → components}/field.js +2 -4
- package/dist/{primitives → components}/input-group.js +1 -1
- package/dist/{primitives → components}/input.js +1 -1
- package/dist/{primitives → components}/label.js +1 -1
- package/dist/components/progress.js +7 -0
- package/dist/{primitives → components}/select.d.ts +3 -1
- package/dist/{primitives → components}/select.js +6 -4
- package/dist/{primitives → components}/separator.js +1 -1
- package/dist/{primitives → components}/sheet.js +1 -1
- package/dist/{primitives → components}/skeleton.js +1 -1
- package/dist/{primitives → components}/sonner.js +17 -12
- package/dist/{primitives → components}/table.d.ts +1 -1
- package/dist/{primitives → components}/table.js +3 -3
- package/dist/{primitives → components}/tabs.js +1 -1
- package/dist/{primitives → components}/textarea.js +1 -1
- package/dist/{primitives → components}/tooltip.js +1 -1
- package/dist/gates/index.d.ts +28 -0
- package/dist/gates/index.js +142 -0
- package/dist/index.d.ts +31 -32
- package/dist/index.js +32 -33
- package/dist/{tokens.d.ts → theme/tokens.d.ts} +5 -5
- package/dist/{tokens.js → theme/tokens.js} +12 -12
- package/package.json +23 -12
- package/{shadcn → src/components}/alert.tsx +14 -21
- package/src/{primitives → components}/badge.tsx +15 -21
- package/src/{primitives → components}/button.tsx +13 -10
- package/{shadcn → src/components}/card.tsx +16 -31
- package/src/{primitives → components}/combobox.test.tsx +15 -2
- package/src/{primitives → components}/combobox.tsx +45 -74
- package/src/{primitives/primitives.test.tsx → components/components.test.tsx} +106 -69
- package/src/{primitives → components}/dialog.tsx +31 -54
- package/src/{primitives → components}/dropdown-menu.tsx +51 -65
- package/src/{primitives → components}/field.tsx +48 -62
- package/src/{primitives → components}/input-group.tsx +37 -49
- package/{shadcn → src/components}/input.tsx +5 -5
- package/{shadcn → src/components}/label.tsx +7 -10
- package/src/{primitives → components}/progress.tsx +7 -6
- package/{shadcn → src/components}/select.tsx +39 -41
- package/{shadcn → src/components}/separator.tsx +7 -7
- package/src/{primitives → components}/sheet.tsx +27 -44
- package/{shadcn → src/components}/skeleton.tsx +3 -3
- package/src/{primitives → components}/sonner.test.tsx +12 -4
- package/src/components/sonner.tsx +67 -0
- package/{shadcn → src/components}/table.tsx +17 -44
- package/{shadcn → src/components}/tabs.tsx +16 -26
- package/{shadcn → src/components}/textarea.tsx +5 -5
- package/{shadcn → src/components}/tooltip.tsx +12 -16
- package/src/gates/design.test.ts +188 -0
- package/src/gates/index.test.ts +11 -0
- package/src/gates/index.ts +165 -0
- package/src/gates/tokens.test.ts +215 -0
- package/src/harness.test.tsx +1 -1
- package/src/index.ts +63 -33
- package/src/theme/imports.test.ts +160 -0
- package/src/{statusTone.test.ts → theme/statusTone.test.ts} +5 -1
- package/src/{styles.css → theme/styles.css} +45 -31
- package/src/theme/tailwind.css +646 -0
- package/src/{tokens.test.ts → theme/tokens.test.ts} +30 -23
- package/src/{tokens.ts → theme/tokens.ts} +12 -12
- package/components.json +0 -13
- package/dist/lib/button.d.ts +0 -1
- package/dist/lib/button.js +0 -4
- package/dist/lib/cn.d.ts +0 -18
- package/dist/lib/cn.js +0 -21
- package/dist/lib/menu.d.ts +0 -1
- package/dist/lib/menu.js +0 -16
- package/dist/lib/progress.d.ts +0 -3
- package/dist/lib/progress.js +0 -6
- package/dist/lib/select.d.ts +0 -1
- package/dist/lib/select.js +0 -3
- package/dist/primitives/progress.js +0 -7
- package/gates/canonical.test.mjs +0 -71
- package/gates/extensions.test.mjs +0 -373
- package/gates/index.d.mts +0 -51
- package/gates/index.mjs +0 -514
- package/gates/tokens.test.mjs +0 -276
- package/shadcn/README.md +0 -13
- package/shadcn/badge.tsx +0 -49
- package/shadcn/button.tsx +0 -67
- package/shadcn/combobox.tsx +0 -299
- package/shadcn/dialog.tsx +0 -166
- package/shadcn/dropdown-menu.tsx +0 -267
- package/shadcn/field.tsx +0 -236
- package/shadcn/input-group.tsx +0 -154
- package/shadcn/progress.tsx +0 -29
- package/shadcn/sheet.tsx +0 -145
- package/shadcn/sonner.tsx +0 -49
- package/src/lib/button.ts +0 -4
- package/src/lib/cn.test.ts +0 -33
- package/src/lib/cn.ts +0 -23
- package/src/lib/menu.ts +0 -16
- package/src/lib/progress.ts +0 -6
- package/src/lib/select.ts +0 -4
- package/src/primitives/alert.tsx +0 -76
- package/src/primitives/card.tsx +0 -103
- package/src/primitives/input.tsx +0 -19
- package/src/primitives/label.tsx +0 -22
- package/src/primitives/select.tsx +0 -192
- package/src/primitives/separator.tsx +0 -28
- package/src/primitives/skeleton.tsx +0 -13
- package/src/primitives/sonner.tsx +0 -65
- package/src/primitives/table.tsx +0 -114
- package/src/primitives/tabs.tsx +0 -88
- package/src/primitives/textarea.tsx +0 -18
- package/src/primitives/tooltip.tsx +0 -57
- /package/dist/{primitives → components}/alert.d.ts +0 -0
- /package/dist/{primitives → components}/badge.d.ts +0 -0
- /package/dist/{primitives → components}/combobox.d.ts +0 -0
- /package/dist/{primitives → components}/dialog.d.ts +0 -0
- /package/dist/{primitives → components}/dropdown-menu.d.ts +0 -0
- /package/dist/{primitives → components}/field.d.ts +0 -0
- /package/dist/{primitives → components}/input-group.d.ts +0 -0
- /package/dist/{primitives → components}/input.d.ts +0 -0
- /package/dist/{primitives → components}/label.d.ts +0 -0
- /package/dist/{primitives → components}/progress.d.ts +0 -0
- /package/dist/{primitives → components}/separator.d.ts +0 -0
- /package/dist/{primitives → components}/sheet.d.ts +0 -0
- /package/dist/{primitives → components}/skeleton.d.ts +0 -0
- /package/dist/{primitives → components}/sonner.d.ts +0 -0
- /package/dist/{primitives → components}/tabs.d.ts +0 -0
- /package/dist/{primitives → components}/textarea.d.ts +0 -0
- /package/dist/{primitives → components}/tooltip.d.ts +0 -0
- /package/dist/{statusTone.d.ts → theme/statusTone.d.ts} +0 -0
- /package/dist/{statusTone.js → theme/statusTone.js} +0 -0
- /package/src/{statusTone.ts → theme/statusTone.ts} +0 -0
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Dialog as DialogPrimitive } from "radix-ui"
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
5
|
-
import { Button } from "./button.js"
|
|
6
|
-
import { XIcon } from "lucide-react"
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
import { XIcon } from "lucide-react";
|
|
7
7
|
|
|
8
|
-
function Dialog({
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
11
|
-
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
8
|
+
function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
9
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props} />;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
function DialogTrigger({
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
17
|
-
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
12
|
+
function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
13
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
function DialogPortal({
|
|
21
|
-
...props
|
|
22
|
-
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
23
|
-
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
16
|
+
function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
17
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
function DialogClose({
|
|
27
|
-
...props
|
|
28
|
-
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
29
|
-
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
20
|
+
function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
21
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
|
|
30
22
|
}
|
|
31
23
|
|
|
32
24
|
function DialogOverlay({
|
|
@@ -38,11 +30,11 @@ function DialogOverlay({
|
|
|
38
30
|
data-slot="dialog-overlay"
|
|
39
31
|
className={cn(
|
|
40
32
|
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
41
|
-
className
|
|
33
|
+
className,
|
|
42
34
|
)}
|
|
43
35
|
{...props}
|
|
44
36
|
/>
|
|
45
|
-
)
|
|
37
|
+
);
|
|
46
38
|
}
|
|
47
39
|
|
|
48
40
|
function DialogContent({
|
|
@@ -51,7 +43,7 @@ function DialogContent({
|
|
|
51
43
|
showCloseButton = true,
|
|
52
44
|
...props
|
|
53
45
|
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
54
|
-
showCloseButton?: boolean
|
|
46
|
+
showCloseButton?: boolean;
|
|
55
47
|
}) {
|
|
56
48
|
return (
|
|
57
49
|
<DialogPortal>
|
|
@@ -60,37 +52,28 @@ function DialogContent({
|
|
|
60
52
|
data-slot="dialog-content"
|
|
61
53
|
className={cn(
|
|
62
54
|
"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-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-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",
|
|
63
|
-
className
|
|
55
|
+
className,
|
|
64
56
|
)}
|
|
65
57
|
{...props}
|
|
66
58
|
>
|
|
67
59
|
{children}
|
|
68
60
|
{showCloseButton && (
|
|
69
61
|
<DialogPrimitive.Close data-slot="dialog-close" asChild>
|
|
70
|
-
<Button
|
|
71
|
-
|
|
72
|
-
className="absolute top-2 right-2"
|
|
73
|
-
size="icon-sm"
|
|
74
|
-
>
|
|
75
|
-
<XIcon
|
|
76
|
-
/>
|
|
62
|
+
<Button variant="ghost" className="absolute top-2 right-2" size="icon-sm">
|
|
63
|
+
<XIcon />
|
|
77
64
|
<span className="sr-only">Close</span>
|
|
78
65
|
</Button>
|
|
79
66
|
</DialogPrimitive.Close>
|
|
80
67
|
)}
|
|
81
68
|
</DialogPrimitive.Content>
|
|
82
69
|
</DialogPortal>
|
|
83
|
-
)
|
|
70
|
+
);
|
|
84
71
|
}
|
|
85
72
|
|
|
86
73
|
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
87
74
|
return (
|
|
88
|
-
<div
|
|
89
|
-
|
|
90
|
-
className={cn("flex flex-col gap-2", className)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
)
|
|
75
|
+
<div data-slot="dialog-header" className={cn("flex flex-col gap-2", className)} {...props} />
|
|
76
|
+
);
|
|
94
77
|
}
|
|
95
78
|
|
|
96
79
|
function DialogFooter({
|
|
@@ -99,14 +82,14 @@ function DialogFooter({
|
|
|
99
82
|
children,
|
|
100
83
|
...props
|
|
101
84
|
}: React.ComponentProps<"div"> & {
|
|
102
|
-
showCloseButton?: boolean
|
|
85
|
+
showCloseButton?: boolean;
|
|
103
86
|
}) {
|
|
104
87
|
return (
|
|
105
88
|
<div
|
|
106
89
|
data-slot="dialog-footer"
|
|
107
90
|
className={cn(
|
|
108
91
|
"-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",
|
|
109
|
-
className
|
|
92
|
+
className,
|
|
110
93
|
)}
|
|
111
94
|
{...props}
|
|
112
95
|
>
|
|
@@ -117,23 +100,17 @@ function DialogFooter({
|
|
|
117
100
|
</DialogPrimitive.Close>
|
|
118
101
|
)}
|
|
119
102
|
</div>
|
|
120
|
-
)
|
|
103
|
+
);
|
|
121
104
|
}
|
|
122
105
|
|
|
123
|
-
function DialogTitle({
|
|
124
|
-
className,
|
|
125
|
-
...props
|
|
126
|
-
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
106
|
+
function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
127
107
|
return (
|
|
128
108
|
<DialogPrimitive.Title
|
|
129
109
|
data-slot="dialog-title"
|
|
130
|
-
className={cn(
|
|
131
|
-
"font-heading text-base leading-none font-medium",
|
|
132
|
-
className
|
|
133
|
-
)}
|
|
110
|
+
className={cn("font-heading text-base leading-none font-medium", className)}
|
|
134
111
|
{...props}
|
|
135
112
|
/>
|
|
136
|
-
)
|
|
113
|
+
);
|
|
137
114
|
}
|
|
138
115
|
|
|
139
116
|
function DialogDescription({
|
|
@@ -145,11 +122,11 @@ function DialogDescription({
|
|
|
145
122
|
data-slot="dialog-description"
|
|
146
123
|
className={cn(
|
|
147
124
|
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
148
|
-
className
|
|
125
|
+
className,
|
|
149
126
|
)}
|
|
150
127
|
{...props}
|
|
151
128
|
/>
|
|
152
|
-
)
|
|
129
|
+
);
|
|
153
130
|
}
|
|
154
131
|
|
|
155
132
|
export {
|
|
@@ -163,4 +140,4 @@ export {
|
|
|
163
140
|
DialogPortal,
|
|
164
141
|
DialogTitle,
|
|
165
142
|
DialogTrigger,
|
|
166
|
-
}
|
|
143
|
+
};
|
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui"
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
5
|
-
import { CheckIcon, ChevronRightIcon } from "lucide-react"
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
6
6
|
|
|
7
|
-
function DropdownMenu({
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
10
|
-
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
7
|
+
function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
8
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
function DropdownMenuPortal({
|
|
14
12
|
...props
|
|
15
13
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
16
|
-
return
|
|
17
|
-
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
18
|
-
)
|
|
14
|
+
return <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
function DropdownMenuTrigger({
|
|
22
18
|
...props
|
|
23
19
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
24
|
-
return
|
|
25
|
-
<DropdownMenuPrimitive.Trigger
|
|
26
|
-
data-slot="dropdown-menu-trigger"
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
)
|
|
20
|
+
return <DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
30
21
|
}
|
|
31
22
|
|
|
23
|
+
// A menu sizes to its items, not to its trigger — behind an icon-sized button
|
|
24
|
+
// the trigger width is a 128px ceiling that wraps every longer item; min-w-32
|
|
25
|
+
// survives as the floor it was meant to be. And it leaves on the frame it is
|
|
26
|
+
// dismissed: while an exit animation runs, the dismissable layer stays mounted
|
|
27
|
+
// and swallows the press that should open the next menu.
|
|
32
28
|
function DropdownMenuContent({
|
|
33
29
|
className,
|
|
34
30
|
align = "start",
|
|
@@ -41,19 +37,18 @@ function DropdownMenuContent({
|
|
|
41
37
|
data-slot="dropdown-menu-content"
|
|
42
38
|
sideOffset={sideOffset}
|
|
43
39
|
align={align}
|
|
44
|
-
className={cn(
|
|
40
|
+
className={cn(
|
|
41
|
+
"z-50 max-h-(--radix-dropdown-menu-content-available-height) w-auto min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
45
44
|
{...props}
|
|
46
45
|
/>
|
|
47
46
|
</DropdownMenuPrimitive.Portal>
|
|
48
|
-
)
|
|
47
|
+
);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
function DropdownMenuGroup({
|
|
52
|
-
...props
|
|
53
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
54
|
-
return (
|
|
55
|
-
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
56
|
-
)
|
|
50
|
+
function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
51
|
+
return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
function DropdownMenuItem({
|
|
@@ -62,8 +57,8 @@ function DropdownMenuItem({
|
|
|
62
57
|
variant = "default",
|
|
63
58
|
...props
|
|
64
59
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
65
|
-
inset?: boolean
|
|
66
|
-
variant?: "default" | "destructive"
|
|
60
|
+
inset?: boolean;
|
|
61
|
+
variant?: "default" | "destructive";
|
|
67
62
|
}) {
|
|
68
63
|
return (
|
|
69
64
|
<DropdownMenuPrimitive.Item
|
|
@@ -72,11 +67,11 @@ function DropdownMenuItem({
|
|
|
72
67
|
data-variant={variant}
|
|
73
68
|
className={cn(
|
|
74
69
|
"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 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",
|
|
75
|
-
className
|
|
70
|
+
className,
|
|
76
71
|
)}
|
|
77
72
|
{...props}
|
|
78
73
|
/>
|
|
79
|
-
)
|
|
74
|
+
);
|
|
80
75
|
}
|
|
81
76
|
|
|
82
77
|
function DropdownMenuCheckboxItem({
|
|
@@ -86,7 +81,7 @@ function DropdownMenuCheckboxItem({
|
|
|
86
81
|
inset,
|
|
87
82
|
...props
|
|
88
83
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
89
|
-
inset?: boolean
|
|
84
|
+
inset?: boolean;
|
|
90
85
|
}) {
|
|
91
86
|
return (
|
|
92
87
|
<DropdownMenuPrimitive.CheckboxItem
|
|
@@ -94,7 +89,7 @@ function DropdownMenuCheckboxItem({
|
|
|
94
89
|
data-inset={inset}
|
|
95
90
|
className={cn(
|
|
96
91
|
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
97
|
-
className
|
|
92
|
+
className,
|
|
98
93
|
)}
|
|
99
94
|
checked={checked}
|
|
100
95
|
{...props}
|
|
@@ -104,24 +99,18 @@ function DropdownMenuCheckboxItem({
|
|
|
104
99
|
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
105
100
|
>
|
|
106
101
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
107
|
-
<CheckIcon
|
|
108
|
-
/>
|
|
102
|
+
<CheckIcon />
|
|
109
103
|
</DropdownMenuPrimitive.ItemIndicator>
|
|
110
104
|
</span>
|
|
111
105
|
{children}
|
|
112
106
|
</DropdownMenuPrimitive.CheckboxItem>
|
|
113
|
-
)
|
|
107
|
+
);
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
function DropdownMenuRadioGroup({
|
|
117
111
|
...props
|
|
118
112
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
119
|
-
return
|
|
120
|
-
<DropdownMenuPrimitive.RadioGroup
|
|
121
|
-
data-slot="dropdown-menu-radio-group"
|
|
122
|
-
{...props}
|
|
123
|
-
/>
|
|
124
|
-
)
|
|
113
|
+
return <DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
|
|
125
114
|
}
|
|
126
115
|
|
|
127
116
|
function DropdownMenuRadioItem({
|
|
@@ -130,7 +119,7 @@ function DropdownMenuRadioItem({
|
|
|
130
119
|
inset,
|
|
131
120
|
...props
|
|
132
121
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
133
|
-
inset?: boolean
|
|
122
|
+
inset?: boolean;
|
|
134
123
|
}) {
|
|
135
124
|
return (
|
|
136
125
|
<DropdownMenuPrimitive.RadioItem
|
|
@@ -138,7 +127,7 @@ function DropdownMenuRadioItem({
|
|
|
138
127
|
data-inset={inset}
|
|
139
128
|
className={cn(
|
|
140
129
|
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
141
|
-
className
|
|
130
|
+
className,
|
|
142
131
|
)}
|
|
143
132
|
{...props}
|
|
144
133
|
>
|
|
@@ -147,13 +136,12 @@ function DropdownMenuRadioItem({
|
|
|
147
136
|
data-slot="dropdown-menu-radio-item-indicator"
|
|
148
137
|
>
|
|
149
138
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
150
|
-
<CheckIcon
|
|
151
|
-
/>
|
|
139
|
+
<CheckIcon />
|
|
152
140
|
</DropdownMenuPrimitive.ItemIndicator>
|
|
153
141
|
</span>
|
|
154
142
|
{children}
|
|
155
143
|
</DropdownMenuPrimitive.RadioItem>
|
|
156
|
-
)
|
|
144
|
+
);
|
|
157
145
|
}
|
|
158
146
|
|
|
159
147
|
function DropdownMenuLabel({
|
|
@@ -161,7 +149,7 @@ function DropdownMenuLabel({
|
|
|
161
149
|
inset,
|
|
162
150
|
...props
|
|
163
151
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
164
|
-
inset?: boolean
|
|
152
|
+
inset?: boolean;
|
|
165
153
|
}) {
|
|
166
154
|
return (
|
|
167
155
|
<DropdownMenuPrimitive.Label
|
|
@@ -169,11 +157,11 @@ function DropdownMenuLabel({
|
|
|
169
157
|
data-inset={inset}
|
|
170
158
|
className={cn(
|
|
171
159
|
"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",
|
|
172
|
-
className
|
|
160
|
+
className,
|
|
173
161
|
)}
|
|
174
162
|
{...props}
|
|
175
163
|
/>
|
|
176
|
-
)
|
|
164
|
+
);
|
|
177
165
|
}
|
|
178
166
|
|
|
179
167
|
function DropdownMenuSeparator({
|
|
@@ -186,29 +174,24 @@ function DropdownMenuSeparator({
|
|
|
186
174
|
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
187
175
|
{...props}
|
|
188
176
|
/>
|
|
189
|
-
)
|
|
177
|
+
);
|
|
190
178
|
}
|
|
191
179
|
|
|
192
|
-
function DropdownMenuShortcut({
|
|
193
|
-
className,
|
|
194
|
-
...props
|
|
195
|
-
}: React.ComponentProps<"span">) {
|
|
180
|
+
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
|
196
181
|
return (
|
|
197
182
|
<span
|
|
198
183
|
data-slot="dropdown-menu-shortcut"
|
|
199
184
|
className={cn(
|
|
200
185
|
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
|
|
201
|
-
className
|
|
186
|
+
className,
|
|
202
187
|
)}
|
|
203
188
|
{...props}
|
|
204
189
|
/>
|
|
205
|
-
)
|
|
190
|
+
);
|
|
206
191
|
}
|
|
207
192
|
|
|
208
|
-
function DropdownMenuSub({
|
|
209
|
-
...props
|
|
210
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
211
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
|
193
|
+
function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
194
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
212
195
|
}
|
|
213
196
|
|
|
214
197
|
function DropdownMenuSubTrigger({
|
|
@@ -217,7 +200,7 @@ function DropdownMenuSubTrigger({
|
|
|
217
200
|
children,
|
|
218
201
|
...props
|
|
219
202
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
220
|
-
inset?: boolean
|
|
203
|
+
inset?: boolean;
|
|
221
204
|
}) {
|
|
222
205
|
return (
|
|
223
206
|
<DropdownMenuPrimitive.SubTrigger
|
|
@@ -225,14 +208,14 @@ function DropdownMenuSubTrigger({
|
|
|
225
208
|
data-inset={inset}
|
|
226
209
|
className={cn(
|
|
227
210
|
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
228
|
-
className
|
|
211
|
+
className,
|
|
229
212
|
)}
|
|
230
213
|
{...props}
|
|
231
214
|
>
|
|
232
215
|
{children}
|
|
233
216
|
<ChevronRightIcon className="ml-auto" />
|
|
234
217
|
</DropdownMenuPrimitive.SubTrigger>
|
|
235
|
-
)
|
|
218
|
+
);
|
|
236
219
|
}
|
|
237
220
|
|
|
238
221
|
function DropdownMenuSubContent({
|
|
@@ -242,10 +225,13 @@ function DropdownMenuSubContent({
|
|
|
242
225
|
return (
|
|
243
226
|
<DropdownMenuPrimitive.SubContent
|
|
244
227
|
data-slot="dropdown-menu-sub-content"
|
|
245
|
-
className={cn(
|
|
228
|
+
className={cn(
|
|
229
|
+
"z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 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-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",
|
|
230
|
+
className,
|
|
231
|
+
)}
|
|
246
232
|
{...props}
|
|
247
233
|
/>
|
|
248
|
-
)
|
|
234
|
+
);
|
|
249
235
|
}
|
|
250
236
|
|
|
251
237
|
export {
|
|
@@ -264,4 +250,4 @@ export {
|
|
|
264
250
|
DropdownMenuSub,
|
|
265
251
|
DropdownMenuSubTrigger,
|
|
266
252
|
DropdownMenuSubContent,
|
|
267
|
-
}
|
|
253
|
+
};
|