@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,9 +1,9 @@
|
|
|
1
|
-
import { useMemo } from "react"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
5
|
-
import { Label } from "./label.js"
|
|
6
|
-
import { Separator } from "./separator.js"
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { Label } from "./label.js";
|
|
6
|
+
import { Separator } from "./separator.js";
|
|
7
7
|
|
|
8
8
|
function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
|
|
9
9
|
return (
|
|
@@ -11,11 +11,11 @@ function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
|
|
|
11
11
|
data-slot="field-set"
|
|
12
12
|
className={cn(
|
|
13
13
|
"flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
14
|
-
className
|
|
14
|
+
className,
|
|
15
15
|
)}
|
|
16
16
|
{...props}
|
|
17
17
|
/>
|
|
18
|
-
)
|
|
18
|
+
);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function FieldLegend({
|
|
@@ -29,11 +29,11 @@ function FieldLegend({
|
|
|
29
29
|
data-variant={variant}
|
|
30
30
|
className={cn(
|
|
31
31
|
"mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",
|
|
32
|
-
className
|
|
32
|
+
className,
|
|
33
33
|
)}
|
|
34
34
|
{...props}
|
|
35
35
|
/>
|
|
36
|
-
)
|
|
36
|
+
);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -42,30 +42,27 @@ function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
42
42
|
data-slot="field-group"
|
|
43
43
|
className={cn(
|
|
44
44
|
"group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",
|
|
45
|
-
className
|
|
45
|
+
className,
|
|
46
46
|
)}
|
|
47
47
|
{...props}
|
|
48
48
|
/>
|
|
49
|
-
)
|
|
49
|
+
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const fieldVariants = cva(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
responsive:
|
|
61
|
-
"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
62
|
-
},
|
|
52
|
+
const fieldVariants = cva("group/field flex w-full gap-2 data-[invalid=true]:text-destructive", {
|
|
53
|
+
variants: {
|
|
54
|
+
orientation: {
|
|
55
|
+
vertical: "flex-col *:w-full [&>.sr-only]:w-auto",
|
|
56
|
+
horizontal:
|
|
57
|
+
"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
58
|
+
responsive:
|
|
59
|
+
"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
63
60
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
)
|
|
61
|
+
},
|
|
62
|
+
defaultVariants: {
|
|
63
|
+
orientation: "vertical",
|
|
64
|
+
},
|
|
65
|
+
});
|
|
69
66
|
|
|
70
67
|
function Field({
|
|
71
68
|
className,
|
|
@@ -80,37 +77,31 @@ function Field({
|
|
|
80
77
|
className={cn(fieldVariants({ orientation }), className)}
|
|
81
78
|
{...props}
|
|
82
79
|
/>
|
|
83
|
-
)
|
|
80
|
+
);
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
87
84
|
return (
|
|
88
85
|
<div
|
|
89
86
|
data-slot="field-content"
|
|
90
|
-
className={cn(
|
|
91
|
-
"group/field-content flex flex-1 flex-col gap-0.5 leading-snug",
|
|
92
|
-
className
|
|
93
|
-
)}
|
|
87
|
+
className={cn("group/field-content flex flex-1 flex-col gap-0.5 leading-snug", className)}
|
|
94
88
|
{...props}
|
|
95
89
|
/>
|
|
96
|
-
)
|
|
90
|
+
);
|
|
97
91
|
}
|
|
98
92
|
|
|
99
|
-
function FieldLabel({
|
|
100
|
-
className,
|
|
101
|
-
...props
|
|
102
|
-
}: React.ComponentProps<typeof Label>) {
|
|
93
|
+
function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {
|
|
103
94
|
return (
|
|
104
95
|
<Label
|
|
105
96
|
data-slot="field-label"
|
|
106
97
|
className={cn(
|
|
107
98
|
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10",
|
|
108
99
|
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",
|
|
109
|
-
className
|
|
100
|
+
className,
|
|
110
101
|
)}
|
|
111
102
|
{...props}
|
|
112
103
|
/>
|
|
113
|
-
)
|
|
104
|
+
);
|
|
114
105
|
}
|
|
115
106
|
|
|
116
107
|
function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -119,11 +110,11 @@ function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
119
110
|
data-slot="field-label"
|
|
120
111
|
className={cn(
|
|
121
112
|
"flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",
|
|
122
|
-
className
|
|
113
|
+
className,
|
|
123
114
|
)}
|
|
124
115
|
{...props}
|
|
125
116
|
/>
|
|
126
|
-
)
|
|
117
|
+
);
|
|
127
118
|
}
|
|
128
119
|
|
|
129
120
|
function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
@@ -134,11 +125,11 @@ function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
|
134
125
|
"text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5",
|
|
135
126
|
"last:mt-0 nth-last-2:-mt-1",
|
|
136
127
|
"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
137
|
-
className
|
|
128
|
+
className,
|
|
138
129
|
)}
|
|
139
130
|
{...props}
|
|
140
131
|
/>
|
|
141
|
-
)
|
|
132
|
+
);
|
|
142
133
|
}
|
|
143
134
|
|
|
144
135
|
function FieldSeparator({
|
|
@@ -146,7 +137,7 @@ function FieldSeparator({
|
|
|
146
137
|
className,
|
|
147
138
|
...props
|
|
148
139
|
}: React.ComponentProps<"div"> & {
|
|
149
|
-
children?: React.ReactNode
|
|
140
|
+
children?: React.ReactNode;
|
|
150
141
|
}) {
|
|
151
142
|
return (
|
|
152
143
|
<div
|
|
@@ -154,7 +145,7 @@ function FieldSeparator({
|
|
|
154
145
|
data-content={!!children}
|
|
155
146
|
className={cn(
|
|
156
147
|
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
157
|
-
className
|
|
148
|
+
className,
|
|
158
149
|
)}
|
|
159
150
|
{...props}
|
|
160
151
|
>
|
|
@@ -168,7 +159,7 @@ function FieldSeparator({
|
|
|
168
159
|
</span>
|
|
169
160
|
)}
|
|
170
161
|
</div>
|
|
171
|
-
)
|
|
162
|
+
);
|
|
172
163
|
}
|
|
173
164
|
|
|
174
165
|
function FieldError({
|
|
@@ -177,37 +168,32 @@ function FieldError({
|
|
|
177
168
|
errors,
|
|
178
169
|
...props
|
|
179
170
|
}: React.ComponentProps<"div"> & {
|
|
180
|
-
errors?: Array<{ message?: string } | undefined
|
|
171
|
+
errors?: Array<{ message?: string } | undefined>;
|
|
181
172
|
}) {
|
|
182
173
|
const content = useMemo(() => {
|
|
183
174
|
if (children) {
|
|
184
|
-
return children
|
|
175
|
+
return children;
|
|
185
176
|
}
|
|
186
177
|
|
|
187
178
|
if (!errors?.length) {
|
|
188
|
-
return null
|
|
179
|
+
return null;
|
|
189
180
|
}
|
|
190
181
|
|
|
191
|
-
const uniqueErrors = [
|
|
192
|
-
...new Map(errors.map((error) => [error?.message, error])).values(),
|
|
193
|
-
]
|
|
182
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
|
|
194
183
|
|
|
195
184
|
if (uniqueErrors?.length == 1) {
|
|
196
|
-
return uniqueErrors[0]?.message
|
|
185
|
+
return uniqueErrors[0]?.message;
|
|
197
186
|
}
|
|
198
187
|
|
|
199
188
|
return (
|
|
200
189
|
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
201
|
-
{uniqueErrors.map(
|
|
202
|
-
(error, index) =>
|
|
203
|
-
error?.message && <li key={index}>{error.message}</li>
|
|
204
|
-
)}
|
|
190
|
+
{uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}
|
|
205
191
|
</ul>
|
|
206
|
-
)
|
|
207
|
-
}, [children, errors])
|
|
192
|
+
);
|
|
193
|
+
}, [children, errors]);
|
|
208
194
|
|
|
209
195
|
if (!content) {
|
|
210
|
-
return null
|
|
196
|
+
return null;
|
|
211
197
|
}
|
|
212
198
|
|
|
213
199
|
return (
|
|
@@ -219,7 +205,7 @@ function FieldError({
|
|
|
219
205
|
>
|
|
220
206
|
{content}
|
|
221
207
|
</div>
|
|
222
|
-
)
|
|
208
|
+
);
|
|
223
209
|
}
|
|
224
210
|
|
|
225
211
|
export {
|
|
@@ -233,4 +219,4 @@ export {
|
|
|
233
219
|
FieldSet,
|
|
234
220
|
FieldContent,
|
|
235
221
|
FieldTitle,
|
|
236
|
-
}
|
|
222
|
+
};
|
|
@@ -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 };
|