@adea-ai/ui 0.12.0 → 0.12.1
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/dist/components/account-drawer.d.ts +1 -1
- package/dist/components/account-drawer.js +12 -12
- package/dist/components/on-screen-controls.js +12 -12
- package/dist/components/scene-settings.d.ts +3 -3
- package/dist/components/scene-settings.js +11 -11
- package/dist/components/theme-provider.d.ts +1 -1
- package/dist/components/theme-provider.js +2 -2
- package/dist/components/theme-toggle.js +8 -8
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.js +15 -15
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +19 -19
- package/dist/components/ui/card.d.ts +1 -1
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/dialog.d.ts +4 -4
- package/dist/components/ui/dialog.js +10 -10
- package/dist/components/ui/drawer.d.ts +5 -5
- package/dist/components/ui/drawer.js +26 -26
- package/dist/components/ui/dropdown-menu.d.ts +5 -5
- package/dist/components/ui/dropdown-menu.js +12 -12
- package/dist/components/ui/empty.d.ts +7 -7
- package/dist/components/ui/empty.js +11 -11
- package/dist/components/ui/field.d.ts +12 -12
- package/dist/components/ui/field.js +22 -22
- package/dist/components/ui/input.d.ts +2 -2
- package/dist/components/ui/input.js +3 -3
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/label.js +3 -3
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.js +6 -6
- package/dist/components/ui/separator.d.ts +1 -1
- package/dist/components/ui/separator.js +5 -5
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.js +2 -2
- package/dist/components/ui/spinner.d.ts +2 -2
- package/dist/components/ui/spinner.js +3 -3
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.js +5 -5
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/tabs.js +13 -13
- package/dist/components/ui/toggle-group.d.ts +6 -6
- package/dist/components/ui/toggle-group.js +13 -13
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/toggle.js +11 -11
- package/dist/components/ui/tooltip.d.ts +3 -3
- package/dist/components/ui/tooltip.js +5 -5
- package/dist/components/version-dialog.d.ts +1 -1
- package/dist/components/version-dialog.js +33 -33
- package/dist/components/workspace-brand.js +1 -1
- package/dist/components/workspace-logo.d.ts +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.js +19 -19
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/lib/version-notes.js +18 -18
- package/package.json +9 -9
- package/src/components/account-drawer.tsx +27 -27
- package/src/components/on-screen-controls.tsx +45 -45
- package/src/components/scene-settings.tsx +55 -55
- package/src/components/theme-provider.tsx +7 -7
- package/src/components/theme-toggle.tsx +20 -20
- package/src/components/ui/badge.tsx +20 -20
- package/src/components/ui/button.tsx +24 -24
- package/src/components/ui/card.tsx +6 -6
- package/src/components/ui/dialog.tsx +24 -24
- package/src/components/ui/drawer.tsx +55 -55
- package/src/components/ui/dropdown-menu.tsx +39 -39
- package/src/components/ui/empty.tsx +25 -25
- package/src/components/ui/field.tsx +55 -55
- package/src/components/ui/input.tsx +7 -7
- package/src/components/ui/label.tsx +7 -7
- package/src/components/ui/radio-group.tsx +9 -9
- package/src/components/ui/separator.tsx +7 -7
- package/src/components/ui/skeleton.tsx +5 -5
- package/src/components/ui/spinner.tsx +6 -6
- package/src/components/ui/switch.tsx +8 -8
- package/src/components/ui/tabs.tsx +21 -21
- package/src/components/ui/toggle-group.tsx +25 -25
- package/src/components/ui/toggle.tsx +15 -15
- package/src/components/ui/tooltip.tsx +13 -13
- package/src/components/version-dialog.tsx +113 -113
- package/src/components/workspace-brand.tsx +4 -4
- package/src/components/workspace-logo.tsx +2 -2
- package/src/index.tsx +19 -19
- package/src/lib/utils.ts +3 -3
- package/src/lib/version-notes.ts +23 -23
- package/src/styles/conventional-workspace.css +26 -26
- package/src/styles/globals.css +2 -2
- package/src/styles/theme.css +1 -1
- package/src/styles/workspace-shell.css +2 -2
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { cva, type VariantProps } from
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
2
|
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { cn } from '#lib/utils'
|
|
4
4
|
|
|
5
|
-
function Empty({ className, ...props }: React.ComponentProps<
|
|
5
|
+
function Empty({ className, ...props }: React.ComponentProps<'div'>) {
|
|
6
6
|
return (
|
|
7
7
|
<div
|
|
8
8
|
data-slot="empty"
|
|
9
9
|
className={cn(
|
|
10
|
-
|
|
10
|
+
'flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance',
|
|
11
11
|
className
|
|
12
12
|
)}
|
|
13
13
|
{...props}
|
|
14
14
|
/>
|
|
15
|
-
)
|
|
15
|
+
)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function EmptyHeader({ className, ...props }: React.ComponentProps<
|
|
18
|
+
function EmptyHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
19
19
|
return (
|
|
20
20
|
<div
|
|
21
21
|
data-slot="empty-header"
|
|
22
|
-
className={cn(
|
|
22
|
+
className={cn('flex max-w-sm flex-col items-center gap-2', className)}
|
|
23
23
|
{...props}
|
|
24
24
|
/>
|
|
25
|
-
)
|
|
25
|
+
)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const emptyMediaVariants = cva(
|
|
29
|
-
|
|
29
|
+
'mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
|
|
30
30
|
{
|
|
31
31
|
variants: {
|
|
32
32
|
variant: {
|
|
33
|
-
default:
|
|
33
|
+
default: 'bg-transparent',
|
|
34
34
|
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
defaultVariants: {
|
|
38
|
-
variant:
|
|
38
|
+
variant: 'default',
|
|
39
39
|
},
|
|
40
40
|
}
|
|
41
|
-
)
|
|
41
|
+
)
|
|
42
42
|
|
|
43
43
|
function EmptyMedia({
|
|
44
44
|
className,
|
|
45
|
-
variant =
|
|
45
|
+
variant = 'default',
|
|
46
46
|
...props
|
|
47
|
-
}: React.ComponentProps<
|
|
47
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>) {
|
|
48
48
|
return (
|
|
49
49
|
<div
|
|
50
50
|
data-slot="empty-icon"
|
|
@@ -52,43 +52,43 @@ function EmptyMedia({
|
|
|
52
52
|
className={cn(emptyMediaVariants({ variant, className }))}
|
|
53
53
|
{...props}
|
|
54
54
|
/>
|
|
55
|
-
)
|
|
55
|
+
)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
function EmptyTitle({ className, ...props }: React.ComponentProps<
|
|
58
|
+
function EmptyTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
59
59
|
return (
|
|
60
60
|
<div
|
|
61
61
|
data-slot="empty-title"
|
|
62
|
-
className={cn(
|
|
62
|
+
className={cn('text-sm font-medium tracking-tight', className)}
|
|
63
63
|
{...props}
|
|
64
64
|
/>
|
|
65
|
-
)
|
|
65
|
+
)
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function EmptyDescription({ className, ...props }: React.ComponentProps<
|
|
68
|
+
function EmptyDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
69
69
|
return (
|
|
70
70
|
<div
|
|
71
71
|
data-slot="empty-description"
|
|
72
72
|
className={cn(
|
|
73
|
-
|
|
73
|
+
'text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
|
74
74
|
className
|
|
75
75
|
)}
|
|
76
76
|
{...props}
|
|
77
77
|
/>
|
|
78
|
-
)
|
|
78
|
+
)
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
function EmptyContent({ className, ...props }: React.ComponentProps<
|
|
81
|
+
function EmptyContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
82
82
|
return (
|
|
83
83
|
<div
|
|
84
84
|
data-slot="empty-content"
|
|
85
85
|
className={cn(
|
|
86
|
-
|
|
86
|
+
'flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance',
|
|
87
87
|
className
|
|
88
88
|
)}
|
|
89
89
|
{...props}
|
|
90
90
|
/>
|
|
91
|
-
)
|
|
91
|
+
)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia }
|
|
94
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia }
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import { useMemo } from
|
|
4
|
-
import { cva, type VariantProps } from
|
|
3
|
+
import { useMemo } from 'react'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { Label } from
|
|
8
|
-
import { Separator } from
|
|
6
|
+
import { cn } from '#lib/utils'
|
|
7
|
+
import { Label } from '#components/ui/label'
|
|
8
|
+
import { Separator } from '#components/ui/separator'
|
|
9
9
|
|
|
10
|
-
function FieldSet({ className, ...props }: React.ComponentProps<
|
|
10
|
+
function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {
|
|
11
11
|
return (
|
|
12
12
|
<fieldset
|
|
13
13
|
data-slot="field-set"
|
|
14
14
|
className={cn(
|
|
15
|
-
|
|
15
|
+
'flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',
|
|
16
16
|
className
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
20
|
-
)
|
|
20
|
+
)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function FieldLegend({
|
|
24
24
|
className,
|
|
25
|
-
variant =
|
|
25
|
+
variant = 'legend',
|
|
26
26
|
...props
|
|
27
|
-
}: React.ComponentProps<
|
|
27
|
+
}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {
|
|
28
28
|
return (
|
|
29
29
|
<legend
|
|
30
30
|
data-slot="field-legend"
|
|
31
31
|
data-variant={variant}
|
|
32
32
|
className={cn(
|
|
33
|
-
|
|
33
|
+
'mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base',
|
|
34
34
|
className
|
|
35
35
|
)}
|
|
36
36
|
{...props}
|
|
37
37
|
/>
|
|
38
|
-
)
|
|
38
|
+
)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
function FieldGroup({ className, ...props }: React.ComponentProps<
|
|
41
|
+
function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
42
42
|
return (
|
|
43
43
|
<div
|
|
44
44
|
data-slot="field-group"
|
|
45
45
|
className={cn(
|
|
46
|
-
|
|
46
|
+
'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',
|
|
47
47
|
className
|
|
48
48
|
)}
|
|
49
49
|
{...props}
|
|
50
50
|
/>
|
|
51
|
-
)
|
|
51
|
+
)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const fieldVariants = cva(
|
|
54
|
+
const fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-destructive', {
|
|
55
55
|
variants: {
|
|
56
56
|
orientation: {
|
|
57
|
-
vertical:
|
|
57
|
+
vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',
|
|
58
58
|
horizontal:
|
|
59
|
-
|
|
59
|
+
'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',
|
|
60
60
|
responsive:
|
|
61
|
-
|
|
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
62
|
},
|
|
63
63
|
},
|
|
64
64
|
defaultVariants: {
|
|
65
|
-
orientation:
|
|
65
|
+
orientation: 'vertical',
|
|
66
66
|
},
|
|
67
|
-
})
|
|
67
|
+
})
|
|
68
68
|
|
|
69
69
|
function Field({
|
|
70
70
|
className,
|
|
71
|
-
orientation =
|
|
71
|
+
orientation = 'vertical',
|
|
72
72
|
...props
|
|
73
|
-
}: React.ComponentProps<
|
|
73
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {
|
|
74
74
|
return (
|
|
75
75
|
<div
|
|
76
76
|
role="group"
|
|
@@ -79,17 +79,17 @@ function Field({
|
|
|
79
79
|
className={cn(fieldVariants({ orientation }), className)}
|
|
80
80
|
{...props}
|
|
81
81
|
/>
|
|
82
|
-
)
|
|
82
|
+
)
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
function FieldContent({ className, ...props }: React.ComponentProps<
|
|
85
|
+
function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
86
86
|
return (
|
|
87
87
|
<div
|
|
88
88
|
data-slot="field-content"
|
|
89
|
-
className={cn(
|
|
89
|
+
className={cn('group/field-content flex flex-1 flex-col gap-0.5 leading-snug', className)}
|
|
90
90
|
{...props}
|
|
91
91
|
/>
|
|
92
|
-
)
|
|
92
|
+
)
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {
|
|
@@ -97,56 +97,56 @@ function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>)
|
|
|
97
97
|
<Label
|
|
98
98
|
data-slot="field-label"
|
|
99
99
|
className={cn(
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
'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',
|
|
101
|
+
'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
|
|
102
102
|
className
|
|
103
103
|
)}
|
|
104
104
|
{...props}
|
|
105
105
|
/>
|
|
106
|
-
)
|
|
106
|
+
)
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
function FieldTitle({ className, ...props }: React.ComponentProps<
|
|
109
|
+
function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
110
110
|
return (
|
|
111
111
|
<div
|
|
112
112
|
data-slot="field-label"
|
|
113
113
|
className={cn(
|
|
114
|
-
|
|
114
|
+
'flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50',
|
|
115
115
|
className
|
|
116
116
|
)}
|
|
117
117
|
{...props}
|
|
118
118
|
/>
|
|
119
|
-
)
|
|
119
|
+
)
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
function FieldDescription({ className, ...props }: React.ComponentProps<
|
|
122
|
+
function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
123
123
|
return (
|
|
124
124
|
<p
|
|
125
125
|
data-slot="field-description"
|
|
126
126
|
className={cn(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
'text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5',
|
|
128
|
+
'last:mt-0 nth-last-2:-mt-1',
|
|
129
|
+
'[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
|
130
130
|
className
|
|
131
131
|
)}
|
|
132
132
|
{...props}
|
|
133
133
|
/>
|
|
134
|
-
)
|
|
134
|
+
)
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
function FieldSeparator({
|
|
138
138
|
children,
|
|
139
139
|
className,
|
|
140
140
|
...props
|
|
141
|
-
}: React.ComponentProps<
|
|
142
|
-
children?: React.ReactNode
|
|
141
|
+
}: React.ComponentProps<'div'> & {
|
|
142
|
+
children?: React.ReactNode
|
|
143
143
|
}) {
|
|
144
144
|
return (
|
|
145
145
|
<div
|
|
146
146
|
data-slot="field-separator"
|
|
147
147
|
data-content={!!children}
|
|
148
148
|
className={cn(
|
|
149
|
-
|
|
149
|
+
'relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2',
|
|
150
150
|
className
|
|
151
151
|
)}
|
|
152
152
|
{...props}
|
|
@@ -161,7 +161,7 @@ function FieldSeparator({
|
|
|
161
161
|
</span>
|
|
162
162
|
)}
|
|
163
163
|
</div>
|
|
164
|
-
)
|
|
164
|
+
)
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
function FieldError({
|
|
@@ -169,45 +169,45 @@ function FieldError({
|
|
|
169
169
|
children,
|
|
170
170
|
errors,
|
|
171
171
|
...props
|
|
172
|
-
}: React.ComponentProps<
|
|
173
|
-
errors?: Array<{ message?: string } | undefined
|
|
172
|
+
}: React.ComponentProps<'div'> & {
|
|
173
|
+
errors?: Array<{ message?: string } | undefined>
|
|
174
174
|
}) {
|
|
175
175
|
const content = useMemo(() => {
|
|
176
176
|
if (children) {
|
|
177
|
-
return children
|
|
177
|
+
return children
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
if (!errors?.length) {
|
|
181
|
-
return null
|
|
181
|
+
return null
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]
|
|
184
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]
|
|
185
185
|
|
|
186
186
|
if (uniqueErrors?.length == 1) {
|
|
187
|
-
return uniqueErrors[0]?.message
|
|
187
|
+
return uniqueErrors[0]?.message
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
return (
|
|
191
191
|
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
192
192
|
{uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}
|
|
193
193
|
</ul>
|
|
194
|
-
)
|
|
195
|
-
}, [children, errors])
|
|
194
|
+
)
|
|
195
|
+
}, [children, errors])
|
|
196
196
|
|
|
197
197
|
if (!content) {
|
|
198
|
-
return null
|
|
198
|
+
return null
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
return (
|
|
202
202
|
<div
|
|
203
203
|
role="alert"
|
|
204
204
|
data-slot="field-error"
|
|
205
|
-
className={cn(
|
|
205
|
+
className={cn('text-sm font-normal text-destructive', className)}
|
|
206
206
|
{...props}
|
|
207
207
|
>
|
|
208
208
|
{content}
|
|
209
209
|
</div>
|
|
210
|
-
)
|
|
210
|
+
)
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
export {
|
|
@@ -221,4 +221,4 @@ export {
|
|
|
221
221
|
FieldSet,
|
|
222
222
|
FieldContent,
|
|
223
223
|
FieldTitle,
|
|
224
|
-
}
|
|
224
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { Input as InputPrimitive } from
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Input as InputPrimitive } from '@base-ui/react/input'
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from '#lib/utils'
|
|
5
5
|
|
|
6
|
-
function Input({ className, type, ...props }: React.ComponentProps<
|
|
6
|
+
function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
|
|
7
7
|
return (
|
|
8
8
|
<InputPrimitive
|
|
9
9
|
type={type}
|
|
10
10
|
data-slot="input"
|
|
11
11
|
className={cn(
|
|
12
|
-
|
|
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
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
17
|
-
)
|
|
17
|
+
)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export { Input }
|
|
20
|
+
export { Input }
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
3
|
+
import * as React from 'react'
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '#lib/utils'
|
|
6
6
|
|
|
7
|
-
function Label({ className, ...props }: React.ComponentProps<
|
|
7
|
+
function Label({ className, ...props }: React.ComponentProps<'label'>) {
|
|
8
8
|
return (
|
|
9
9
|
<label
|
|
10
10
|
data-slot="label"
|
|
11
11
|
className={cn(
|
|
12
|
-
|
|
12
|
+
'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',
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
17
|
-
)
|
|
17
|
+
)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export { Label }
|
|
20
|
+
export { Label }
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import { Radio as RadioPrimitive } from
|
|
4
|
-
import { RadioGroup as RadioGroupPrimitive } from
|
|
3
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio'
|
|
4
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from '#lib/utils'
|
|
7
7
|
|
|
8
8
|
function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
|
|
9
9
|
return (
|
|
10
10
|
<RadioGroupPrimitive
|
|
11
11
|
data-slot="radio-group"
|
|
12
|
-
className={cn(
|
|
12
|
+
className={cn('grid w-full gap-2', className)}
|
|
13
13
|
{...props}
|
|
14
14
|
/>
|
|
15
|
-
)
|
|
15
|
+
)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
|
|
@@ -20,7 +20,7 @@ function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
|
|
|
20
20
|
<RadioPrimitive.Root
|
|
21
21
|
data-slot="radio-group-item"
|
|
22
22
|
className={cn(
|
|
23
|
-
|
|
23
|
+
'group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 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 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary',
|
|
24
24
|
className
|
|
25
25
|
)}
|
|
26
26
|
{...props}
|
|
@@ -32,7 +32,7 @@ function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
|
|
|
32
32
|
<span className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" />
|
|
33
33
|
</RadioPrimitive.Indicator>
|
|
34
34
|
</RadioPrimitive.Root>
|
|
35
|
-
)
|
|
35
|
+
)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export { RadioGroup, RadioGroupItem }
|
|
38
|
+
export { RadioGroup, RadioGroupItem }
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import { Separator as SeparatorPrimitive } from
|
|
3
|
+
import { Separator as SeparatorPrimitive } from '@base-ui/react/separator'
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '#lib/utils'
|
|
6
6
|
|
|
7
|
-
function Separator({ className, orientation =
|
|
7
|
+
function Separator({ className, orientation = 'horizontal', ...props }: SeparatorPrimitive.Props) {
|
|
8
8
|
return (
|
|
9
9
|
<SeparatorPrimitive
|
|
10
10
|
data-slot="separator"
|
|
11
11
|
orientation={orientation}
|
|
12
12
|
className={cn(
|
|
13
|
-
|
|
13
|
+
'shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch',
|
|
14
14
|
className
|
|
15
15
|
)}
|
|
16
16
|
{...props}
|
|
17
17
|
/>
|
|
18
|
-
)
|
|
18
|
+
)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export { Separator }
|
|
21
|
+
export { Separator }
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { cn } from
|
|
1
|
+
import { cn } from '#lib/utils'
|
|
2
2
|
|
|
3
|
-
function Skeleton({ className, ...props }: React.ComponentProps<
|
|
3
|
+
function Skeleton({ className, ...props }: React.ComponentProps<'div'>) {
|
|
4
4
|
return (
|
|
5
5
|
<div
|
|
6
6
|
data-slot="skeleton"
|
|
7
|
-
className={cn(
|
|
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 }
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { LoaderCircle } from
|
|
2
|
-
import type { ComponentProps } from
|
|
3
|
-
import { cn } from
|
|
1
|
+
import { LoaderCircle } from 'lucide-react'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
import { cn } from '#lib/utils'
|
|
4
4
|
|
|
5
5
|
function Spinner({ className, ...props }: ComponentProps<typeof LoaderCircle>) {
|
|
6
6
|
return (
|
|
7
7
|
<LoaderCircle
|
|
8
8
|
role="status"
|
|
9
9
|
aria-label="Loading"
|
|
10
|
-
className={cn(
|
|
10
|
+
className={cn('animate-spin', className)}
|
|
11
11
|
{...props}
|
|
12
12
|
/>
|
|
13
|
-
)
|
|
13
|
+
)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export { Spinner }
|
|
16
|
+
export { Spinner }
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import { Switch as SwitchPrimitive } from
|
|
3
|
+
import { Switch as SwitchPrimitive } from '@base-ui/react/switch'
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '#lib/utils'
|
|
6
6
|
|
|
7
7
|
function Switch({
|
|
8
8
|
className,
|
|
9
|
-
size =
|
|
9
|
+
size = 'default',
|
|
10
10
|
...props
|
|
11
11
|
}: SwitchPrimitive.Root.Props & {
|
|
12
|
-
size?:
|
|
12
|
+
size?: 'sm' | 'default'
|
|
13
13
|
}) {
|
|
14
14
|
return (
|
|
15
15
|
<SwitchPrimitive.Root
|
|
16
16
|
data-slot="switch"
|
|
17
17
|
data-size={size}
|
|
18
18
|
className={cn(
|
|
19
|
-
|
|
19
|
+
'peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50',
|
|
20
20
|
className
|
|
21
21
|
)}
|
|
22
22
|
{...props}
|
|
@@ -26,7 +26,7 @@ function Switch({
|
|
|
26
26
|
className="pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
|
|
27
27
|
/>
|
|
28
28
|
</SwitchPrimitive.Root>
|
|
29
|
-
)
|
|
29
|
+
)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export { Switch }
|
|
32
|
+
export { Switch }
|