@robomous/ui-core 0.1.0 → 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 +19 -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 +4 -4
- package/dist/{primitives → components}/dialog.js +1 -1
- package/dist/{primitives → components}/dropdown-menu.js +12 -7
- 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 +7 -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 +40 -40
- 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 -190
- 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,10 +1,10 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
5
|
-
import { Button } from "./button.js"
|
|
6
|
-
import { Input } from "./input.js"
|
|
7
|
-
import { Textarea } from "./textarea.js"
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
import { Input } from "./input.js";
|
|
7
|
+
import { Textarea } from "./textarea.js";
|
|
8
8
|
|
|
9
9
|
function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
10
10
|
return (
|
|
@@ -13,11 +13,11 @@ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
13
13
|
role="group"
|
|
14
14
|
className={cn(
|
|
15
15
|
"group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
|
|
16
|
-
className
|
|
16
|
+
className,
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
20
|
-
)
|
|
20
|
+
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const inputGroupAddonVariants = cva(
|
|
@@ -25,10 +25,8 @@ const inputGroupAddonVariants = cva(
|
|
|
25
25
|
{
|
|
26
26
|
variants: {
|
|
27
27
|
align: {
|
|
28
|
-
"inline-start":
|
|
29
|
-
|
|
30
|
-
"inline-end":
|
|
31
|
-
"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
28
|
+
"inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
|
29
|
+
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
32
30
|
"block-start":
|
|
33
31
|
"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
34
32
|
"block-end":
|
|
@@ -38,8 +36,8 @@ const inputGroupAddonVariants = cva(
|
|
|
38
36
|
defaultVariants: {
|
|
39
37
|
align: "inline-start",
|
|
40
38
|
},
|
|
41
|
-
}
|
|
42
|
-
)
|
|
39
|
+
},
|
|
40
|
+
);
|
|
43
41
|
|
|
44
42
|
function InputGroupAddon({
|
|
45
43
|
className,
|
|
@@ -54,32 +52,28 @@ function InputGroupAddon({
|
|
|
54
52
|
className={cn(inputGroupAddonVariants({ align }), className)}
|
|
55
53
|
onClick={(e) => {
|
|
56
54
|
if ((e.target as HTMLElement).closest("button")) {
|
|
57
|
-
return
|
|
55
|
+
return;
|
|
58
56
|
}
|
|
59
|
-
e.currentTarget.parentElement?.querySelector("input")?.focus()
|
|
57
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
60
58
|
}}
|
|
61
59
|
{...props}
|
|
62
60
|
/>
|
|
63
|
-
)
|
|
61
|
+
);
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
const inputGroupButtonVariants = cva(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"icon-xs":
|
|
74
|
-
"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
|
75
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
defaultVariants: {
|
|
79
|
-
size: "xs",
|
|
64
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
65
|
+
variants: {
|
|
66
|
+
size: {
|
|
67
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
68
|
+
sm: "",
|
|
69
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
|
70
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
80
71
|
},
|
|
81
|
-
}
|
|
82
|
-
|
|
72
|
+
},
|
|
73
|
+
defaultVariants: {
|
|
74
|
+
size: "xs",
|
|
75
|
+
},
|
|
76
|
+
});
|
|
83
77
|
|
|
84
78
|
function InputGroupButton({
|
|
85
79
|
className,
|
|
@@ -97,7 +91,7 @@ function InputGroupButton({
|
|
|
97
91
|
className={cn(inputGroupButtonVariants({ size }), className)}
|
|
98
92
|
{...props}
|
|
99
93
|
/>
|
|
100
|
-
)
|
|
94
|
+
);
|
|
101
95
|
}
|
|
102
96
|
|
|
103
97
|
function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
|
|
@@ -105,43 +99,37 @@ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
|
|
|
105
99
|
<span
|
|
106
100
|
className={cn(
|
|
107
101
|
"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
108
|
-
className
|
|
102
|
+
className,
|
|
109
103
|
)}
|
|
110
104
|
{...props}
|
|
111
105
|
/>
|
|
112
|
-
)
|
|
106
|
+
);
|
|
113
107
|
}
|
|
114
108
|
|
|
115
|
-
function InputGroupInput({
|
|
116
|
-
className,
|
|
117
|
-
...props
|
|
118
|
-
}: React.ComponentProps<"input">) {
|
|
109
|
+
function InputGroupInput({ className, ...props }: React.ComponentProps<"input">) {
|
|
119
110
|
return (
|
|
120
111
|
<Input
|
|
121
112
|
data-slot="input-group-control"
|
|
122
113
|
className={cn(
|
|
123
114
|
"flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
|
|
124
|
-
className
|
|
115
|
+
className,
|
|
125
116
|
)}
|
|
126
117
|
{...props}
|
|
127
118
|
/>
|
|
128
|
-
)
|
|
119
|
+
);
|
|
129
120
|
}
|
|
130
121
|
|
|
131
|
-
function InputGroupTextarea({
|
|
132
|
-
className,
|
|
133
|
-
...props
|
|
134
|
-
}: React.ComponentProps<"textarea">) {
|
|
122
|
+
function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
135
123
|
return (
|
|
136
124
|
<Textarea
|
|
137
125
|
data-slot="input-group-control"
|
|
138
126
|
className={cn(
|
|
139
127
|
"flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
|
|
140
|
-
className
|
|
128
|
+
className,
|
|
141
129
|
)}
|
|
142
130
|
{...props}
|
|
143
131
|
/>
|
|
144
|
-
)
|
|
132
|
+
);
|
|
145
133
|
}
|
|
146
134
|
|
|
147
135
|
export {
|
|
@@ -151,4 +139,4 @@ export {
|
|
|
151
139
|
InputGroupText,
|
|
152
140
|
InputGroupInput,
|
|
153
141
|
InputGroupTextarea,
|
|
154
|
-
}
|
|
142
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "cn";
|
|
4
4
|
|
|
5
5
|
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
6
6
|
return (
|
|
@@ -9,11 +9,11 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
|
|
9
9
|
data-slot="input"
|
|
10
10
|
className={cn(
|
|
11
11
|
"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",
|
|
12
|
-
className
|
|
12
|
+
className,
|
|
13
13
|
)}
|
|
14
14
|
{...props}
|
|
15
15
|
/>
|
|
16
|
-
)
|
|
16
|
+
);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export { Input }
|
|
19
|
+
export { Input };
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Label as LabelPrimitive } from "radix-ui"
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Label as LabelPrimitive } from "radix-ui";
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "cn";
|
|
5
5
|
|
|
6
|
-
function Label({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
6
|
+
function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
10
7
|
return (
|
|
11
8
|
<LabelPrimitive.Root
|
|
12
9
|
data-slot="label"
|
|
13
10
|
className={cn(
|
|
14
11
|
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
15
|
-
className
|
|
12
|
+
className,
|
|
16
13
|
)}
|
|
17
14
|
{...props}
|
|
18
15
|
/>
|
|
19
|
-
)
|
|
16
|
+
);
|
|
20
17
|
}
|
|
21
18
|
|
|
22
|
-
export { Label }
|
|
19
|
+
export { Label };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Progress as ProgressPrimitive } from "radix-ui"
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "cn";
|
|
5
5
|
|
|
6
6
|
function Progress({
|
|
7
7
|
className,
|
|
@@ -11,9 +11,10 @@ function Progress({
|
|
|
11
11
|
return (
|
|
12
12
|
<ProgressPrimitive.Root
|
|
13
13
|
data-slot="progress"
|
|
14
|
+
value={value}
|
|
14
15
|
className={cn(
|
|
15
16
|
"relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",
|
|
16
|
-
className
|
|
17
|
+
className,
|
|
17
18
|
)}
|
|
18
19
|
{...props}
|
|
19
20
|
>
|
|
@@ -23,7 +24,7 @@ function Progress({
|
|
|
23
24
|
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
24
25
|
/>
|
|
25
26
|
</ProgressPrimitive.Root>
|
|
26
|
-
)
|
|
27
|
+
);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
export { Progress }
|
|
30
|
+
export { Progress };
|
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
import { Select as SelectPrimitive } from "radix-ui"
|
|
1
|
+
"use client";
|
|
3
2
|
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
|
|
8
|
+
|
|
9
|
+
function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
10
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function SelectGroup({
|
|
14
|
-
className,
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
13
|
+
function SelectGroup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
17
14
|
return (
|
|
18
15
|
<SelectPrimitive.Group
|
|
19
16
|
data-slot="select-group"
|
|
20
17
|
className={cn("scroll-my-1 p-1", className)}
|
|
21
18
|
{...props}
|
|
22
19
|
/>
|
|
23
|
-
)
|
|
20
|
+
);
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
function SelectValue({
|
|
27
|
-
...props
|
|
28
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
29
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
23
|
+
function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
24
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
function SelectTrigger({
|
|
33
28
|
className,
|
|
34
29
|
size = "default",
|
|
30
|
+
multiline = false,
|
|
35
31
|
children,
|
|
36
32
|
...props
|
|
37
33
|
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
38
|
-
size?: "sm" | "default"
|
|
34
|
+
size?: "sm" | "default";
|
|
35
|
+
/** Let the closed trigger grow to its value instead of clamping it to one line. */
|
|
36
|
+
multiline?: boolean;
|
|
39
37
|
}) {
|
|
40
38
|
return (
|
|
41
39
|
<SelectPrimitive.Trigger
|
|
@@ -43,7 +41,9 @@ function SelectTrigger({
|
|
|
43
41
|
data-size={size}
|
|
44
42
|
className={cn(
|
|
45
43
|
"flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 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",
|
|
46
|
-
|
|
44
|
+
multiline &&
|
|
45
|
+
"data-[size=default]:h-auto min-h-8 *:data-[slot=select-value]:line-clamp-none",
|
|
46
|
+
className,
|
|
47
47
|
)}
|
|
48
48
|
{...props}
|
|
49
49
|
>
|
|
@@ -52,7 +52,7 @@ function SelectTrigger({
|
|
|
52
52
|
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
53
53
|
</SelectPrimitive.Icon>
|
|
54
54
|
</SelectPrimitive.Trigger>
|
|
55
|
-
)
|
|
55
|
+
);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function SelectContent({
|
|
@@ -67,7 +67,12 @@ function SelectContent({
|
|
|
67
67
|
<SelectPrimitive.Content
|
|
68
68
|
data-slot="select-content"
|
|
69
69
|
data-align-trigger={position === "item-aligned"}
|
|
70
|
-
className={cn(
|
|
70
|
+
className={cn(
|
|
71
|
+
"relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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",
|
|
72
|
+
position === "popper" &&
|
|
73
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
74
|
+
className,
|
|
75
|
+
)}
|
|
71
76
|
position={position}
|
|
72
77
|
align={align}
|
|
73
78
|
{...props}
|
|
@@ -77,7 +82,7 @@ function SelectContent({
|
|
|
77
82
|
data-position={position}
|
|
78
83
|
className={cn(
|
|
79
84
|
"data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
|
|
80
|
-
position === "popper" && ""
|
|
85
|
+
position === "popper" && "",
|
|
81
86
|
)}
|
|
82
87
|
>
|
|
83
88
|
{children}
|
|
@@ -85,20 +90,17 @@ function SelectContent({
|
|
|
85
90
|
<SelectScrollDownButton />
|
|
86
91
|
</SelectPrimitive.Content>
|
|
87
92
|
</SelectPrimitive.Portal>
|
|
88
|
-
)
|
|
93
|
+
);
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
function SelectLabel({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
96
|
+
function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
95
97
|
return (
|
|
96
98
|
<SelectPrimitive.Label
|
|
97
99
|
data-slot="select-label"
|
|
98
100
|
className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
|
|
99
101
|
{...props}
|
|
100
102
|
/>
|
|
101
|
-
)
|
|
103
|
+
);
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
function SelectItem({
|
|
@@ -111,7 +113,7 @@ function SelectItem({
|
|
|
111
113
|
data-slot="select-item"
|
|
112
114
|
className={cn(
|
|
113
115
|
"relative flex w-full 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 not-data-[variant=destructive]: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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
114
|
-
className
|
|
116
|
+
className,
|
|
115
117
|
)}
|
|
116
118
|
{...props}
|
|
117
119
|
>
|
|
@@ -122,7 +124,7 @@ function SelectItem({
|
|
|
122
124
|
</span>
|
|
123
125
|
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
124
126
|
</SelectPrimitive.Item>
|
|
125
|
-
)
|
|
127
|
+
);
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
function SelectSeparator({
|
|
@@ -135,7 +137,7 @@ function SelectSeparator({
|
|
|
135
137
|
className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
|
|
136
138
|
{...props}
|
|
137
139
|
/>
|
|
138
|
-
)
|
|
140
|
+
);
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
function SelectScrollUpButton({
|
|
@@ -147,14 +149,13 @@ function SelectScrollUpButton({
|
|
|
147
149
|
data-slot="select-scroll-up-button"
|
|
148
150
|
className={cn(
|
|
149
151
|
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
150
|
-
className
|
|
152
|
+
className,
|
|
151
153
|
)}
|
|
152
154
|
{...props}
|
|
153
155
|
>
|
|
154
|
-
<ChevronUpIcon
|
|
155
|
-
/>
|
|
156
|
+
<ChevronUpIcon />
|
|
156
157
|
</SelectPrimitive.ScrollUpButton>
|
|
157
|
-
)
|
|
158
|
+
);
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
function SelectScrollDownButton({
|
|
@@ -166,14 +167,13 @@ function SelectScrollDownButton({
|
|
|
166
167
|
data-slot="select-scroll-down-button"
|
|
167
168
|
className={cn(
|
|
168
169
|
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
169
|
-
className
|
|
170
|
+
className,
|
|
170
171
|
)}
|
|
171
172
|
{...props}
|
|
172
173
|
>
|
|
173
|
-
<ChevronDownIcon
|
|
174
|
-
/>
|
|
174
|
+
<ChevronDownIcon />
|
|
175
175
|
</SelectPrimitive.ScrollDownButton>
|
|
176
|
-
)
|
|
176
|
+
);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
export {
|
|
@@ -187,4 +187,4 @@ export {
|
|
|
187
187
|
SelectSeparator,
|
|
188
188
|
SelectTrigger,
|
|
189
189
|
SelectValue,
|
|
190
|
-
}
|
|
190
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
5
5
|
|
|
6
|
-
import { cn } from "
|
|
6
|
+
import { cn } from "cn";
|
|
7
7
|
|
|
8
8
|
function Separator({
|
|
9
9
|
className,
|
|
@@ -18,11 +18,11 @@ function Separator({
|
|
|
18
18
|
orientation={orientation}
|
|
19
19
|
className={cn(
|
|
20
20
|
"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
|
|
21
|
-
className
|
|
21
|
+
className,
|
|
22
22
|
)}
|
|
23
23
|
{...props}
|
|
24
24
|
/>
|
|
25
|
-
)
|
|
25
|
+
);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export { Separator }
|
|
28
|
+
export { Separator };
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as SheetPrimitive } 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
8
|
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
9
|
-
return <SheetPrimitive.Root data-slot="sheet" {...props}
|
|
9
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function SheetTrigger({
|
|
13
|
-
...props
|
|
14
|
-
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
15
|
-
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
12
|
+
function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
13
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
function SheetClose({
|
|
19
|
-
...props
|
|
20
|
-
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
21
|
-
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
16
|
+
function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
17
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
22
18
|
}
|
|
23
19
|
|
|
24
|
-
function SheetPortal({
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
27
|
-
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
20
|
+
function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
21
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
28
22
|
}
|
|
29
23
|
|
|
30
24
|
function SheetOverlay({
|
|
@@ -36,11 +30,11 @@ function SheetOverlay({
|
|
|
36
30
|
data-slot="sheet-overlay"
|
|
37
31
|
className={cn(
|
|
38
32
|
"fixed inset-0 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",
|
|
39
|
-
className
|
|
33
|
+
className,
|
|
40
34
|
)}
|
|
41
35
|
{...props}
|
|
42
36
|
/>
|
|
43
|
-
)
|
|
37
|
+
);
|
|
44
38
|
}
|
|
45
39
|
|
|
46
40
|
function SheetContent({
|
|
@@ -50,8 +44,8 @@ function SheetContent({
|
|
|
50
44
|
showCloseButton = true,
|
|
51
45
|
...props
|
|
52
46
|
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
53
|
-
side?: "top" | "right" | "bottom" | "left"
|
|
54
|
-
showCloseButton?: boolean
|
|
47
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
48
|
+
showCloseButton?: boolean;
|
|
55
49
|
}) {
|
|
56
50
|
return (
|
|
57
51
|
<SheetPortal>
|
|
@@ -61,27 +55,22 @@ function SheetContent({
|
|
|
61
55
|
data-side={side}
|
|
62
56
|
className={cn(
|
|
63
57
|
"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",
|
|
64
|
-
className
|
|
58
|
+
className,
|
|
65
59
|
)}
|
|
66
60
|
{...props}
|
|
67
61
|
>
|
|
68
62
|
{children}
|
|
69
63
|
{showCloseButton && (
|
|
70
64
|
<SheetPrimitive.Close data-slot="sheet-close" asChild>
|
|
71
|
-
<Button
|
|
72
|
-
|
|
73
|
-
className="absolute top-3 right-3"
|
|
74
|
-
size="icon-sm"
|
|
75
|
-
>
|
|
76
|
-
<XIcon
|
|
77
|
-
/>
|
|
65
|
+
<Button variant="ghost" className="absolute top-3 right-3" size="icon-sm">
|
|
66
|
+
<XIcon />
|
|
78
67
|
<span className="sr-only">Close</span>
|
|
79
68
|
</Button>
|
|
80
69
|
</SheetPrimitive.Close>
|
|
81
70
|
)}
|
|
82
71
|
</SheetPrimitive.Content>
|
|
83
72
|
</SheetPortal>
|
|
84
|
-
)
|
|
73
|
+
);
|
|
85
74
|
}
|
|
86
75
|
|
|
87
76
|
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -91,7 +80,7 @@ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
91
80
|
className={cn("flex flex-col gap-0.5 p-4", className)}
|
|
92
81
|
{...props}
|
|
93
82
|
/>
|
|
94
|
-
)
|
|
83
|
+
);
|
|
95
84
|
}
|
|
96
85
|
|
|
97
86
|
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -101,23 +90,17 @@ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
101
90
|
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
102
91
|
{...props}
|
|
103
92
|
/>
|
|
104
|
-
)
|
|
93
|
+
);
|
|
105
94
|
}
|
|
106
95
|
|
|
107
|
-
function SheetTitle({
|
|
108
|
-
className,
|
|
109
|
-
...props
|
|
110
|
-
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
96
|
+
function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
111
97
|
return (
|
|
112
98
|
<SheetPrimitive.Title
|
|
113
99
|
data-slot="sheet-title"
|
|
114
|
-
className={cn(
|
|
115
|
-
"font-heading text-base font-medium text-foreground",
|
|
116
|
-
className
|
|
117
|
-
)}
|
|
100
|
+
className={cn("font-heading text-base font-medium text-foreground", className)}
|
|
118
101
|
{...props}
|
|
119
102
|
/>
|
|
120
|
-
)
|
|
103
|
+
);
|
|
121
104
|
}
|
|
122
105
|
|
|
123
106
|
function SheetDescription({
|
|
@@ -130,7 +113,7 @@ function SheetDescription({
|
|
|
130
113
|
className={cn("text-sm text-muted-foreground", className)}
|
|
131
114
|
{...props}
|
|
132
115
|
/>
|
|
133
|
-
)
|
|
116
|
+
);
|
|
134
117
|
}
|
|
135
118
|
|
|
136
119
|
export {
|
|
@@ -142,4 +125,4 @@ export {
|
|
|
142
125
|
SheetFooter,
|
|
143
126
|
SheetTitle,
|
|
144
127
|
SheetDescription,
|
|
145
|
-
}
|
|
128
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn } from "
|
|
1
|
+
import { cn } from "cn";
|
|
2
2
|
|
|
3
3
|
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
4
4
|
return (
|
|
@@ -7,7 +7,7 @@ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
7
7
|
className={cn("animate-pulse rounded-md bg-muted", className)}
|
|
8
8
|
{...props}
|
|
9
9
|
/>
|
|
10
|
-
)
|
|
10
|
+
);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export { Skeleton }
|
|
13
|
+
export { Skeleton };
|