@octanejs/shadcn 0.0.52 → 0.0.53
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/package.json +9 -9
- package/src/bases/base-ui/ui/accordion.tsrx +3 -1
- package/src/bases/base-ui/ui/alert-dialog.tsrx +6 -5
- package/src/bases/base-ui/ui/alert.tsrx +3 -2
- package/src/bases/base-ui/ui/aspect-ratio.tsrx +5 -3
- package/src/bases/base-ui/ui/badge.tsrx +2 -1
- package/src/bases/base-ui/ui/breadcrumb.tsrx +4 -4
- package/src/bases/base-ui/ui/button.tsrx +17 -10
- package/src/bases/base-ui/ui/context-menu.tsrx +37 -29
- package/src/bases/base-ui/ui/dialog.tsrx +6 -4
- package/src/bases/base-ui/ui/dropdown-menu.tsrx +37 -29
- package/src/bases/base-ui/ui/empty.tsrx +1 -1
- package/src/bases/base-ui/ui/field.tsrx +17 -11
- package/src/bases/base-ui/ui/hover-card.tsrx +15 -16
- package/src/bases/base-ui/ui/item.tsrx +3 -2
- package/src/bases/base-ui/ui/kbd.tsrx +1 -1
- package/src/bases/base-ui/ui/menubar.tsrx +38 -34
- package/src/bases/base-ui/ui/native-select.tsrx +3 -4
- package/src/bases/base-ui/ui/navigation-menu.tsrx +113 -87
- package/src/bases/base-ui/ui/pagination.tsrx +6 -2
- package/src/bases/base-ui/ui/popover.tsrx +15 -16
- package/src/bases/base-ui/ui/radio-group.tsrx +1 -3
- package/src/bases/base-ui/ui/scroll-area.tsrx +33 -27
- package/src/bases/base-ui/ui/select.tsrx +138 -106
- package/src/bases/base-ui/ui/sheet.tsrx +6 -4
- package/src/bases/base-ui/ui/sidebar.tsrx +65 -44
- package/src/bases/base-ui/ui/slider.tsrx +1 -3
- package/src/bases/base-ui/ui/tabs.tsrx +1 -1
- package/src/bases/base-ui/ui/toggle-group.tsrx +3 -3
- package/src/bases/base-ui/ui/toggle.tsrx +3 -2
- package/src/bases/base-ui/ui/tooltip.tsrx +17 -17
- package/src/bases/radix/ui/accordion.tsrx +3 -1
- package/src/bases/radix/ui/alert-dialog.tsrx +1 -1
- package/src/bases/radix/ui/alert.tsrx +15 -14
- package/src/bases/radix/ui/badge.tsrx +2 -1
- package/src/bases/radix/ui/button.tsrx +17 -10
- package/src/bases/radix/ui/context-menu.tsrx +20 -10
- package/src/bases/radix/ui/dropdown-menu.tsrx +16 -9
- package/src/bases/radix/ui/empty.tsrx +1 -1
- package/src/bases/radix/ui/field.tsrx +17 -11
- package/src/bases/radix/ui/item.tsrx +3 -2
- package/src/bases/radix/ui/menubar.tsrx +17 -14
- package/src/bases/radix/ui/native-select.tsrx +8 -8
- package/src/bases/radix/ui/navigation-menu.tsrx +2 -3
- package/src/bases/radix/ui/pagination.tsrx +6 -2
- package/src/bases/radix/ui/radio-group.tsrx +1 -3
- package/src/bases/radix/ui/scroll-area.tsrx +8 -2
- package/src/bases/radix/ui/select.tsrx +10 -5
- package/src/bases/radix/ui/sidebar.tsrx +61 -42
- package/src/bases/radix/ui/slider.tsrx +9 -7
- package/src/bases/radix/ui/tabs.tsrx +11 -5
- package/src/bases/radix/ui/toggle.tsrx +3 -2
- package/src/bases/radix/ui/tooltip.tsrx +2 -1
- package/src/bases/react-aria/ui/accordion.tsrx +58 -47
- package/src/bases/react-aria/ui/alert-dialog.tsrx +118 -92
- package/src/bases/react-aria/ui/alert.tsrx +39 -32
- package/src/bases/react-aria/ui/aspect-ratio.tsrx +12 -8
- package/src/bases/react-aria/ui/avatar.tsrx +73 -57
- package/src/bases/react-aria/ui/badge.tsrx +19 -12
- package/src/bases/react-aria/ui/breadcrumb.tsrx +66 -57
- package/src/bases/react-aria/ui/button.tsrx +17 -10
- package/src/bases/react-aria/ui/card.tsrx +63 -49
- package/src/bases/react-aria/ui/checkbox.tsrx +25 -19
- package/src/bases/react-aria/ui/dialog.tsrx +103 -83
- package/src/bases/react-aria/ui/empty.tsrx +58 -44
- package/src/bases/react-aria/ui/field.tsrx +142 -100
- package/src/bases/react-aria/ui/input.tsrx +2 -3
- package/src/bases/react-aria/ui/item.tsrx +98 -78
- package/src/bases/react-aria/ui/kbd.tsrx +1 -1
- package/src/bases/react-aria/ui/label.tsrx +12 -10
- package/src/bases/react-aria/ui/native-select.tsrx +38 -30
- package/src/bases/react-aria/ui/pagination.tsrx +76 -60
- package/src/bases/react-aria/ui/popover.tsrx +32 -22
- package/src/bases/react-aria/ui/radio-group.tsrx +30 -23
- package/src/bases/react-aria/ui/scroll-area.tsrx +12 -8
- package/src/bases/react-aria/ui/sheet.tsrx +92 -73
- package/src/bases/react-aria/ui/skeleton.tsrx +7 -5
- package/src/bases/react-aria/ui/slider.tsrx +44 -38
- package/src/bases/react-aria/ui/switch.tsrx +28 -20
- package/src/bases/react-aria/ui/table.tsrx +67 -51
- package/src/bases/react-aria/ui/tabs.tsrx +40 -31
- package/src/bases/react-aria/ui/textarea.tsrx +2 -3
- package/src/bases/react-aria/ui/toggle.tsrx +11 -8
|
@@ -6,12 +6,13 @@ import { cn } from 'cn';
|
|
|
6
6
|
import type { DivProps } from '../../../lib/types';
|
|
7
7
|
|
|
8
8
|
export const alertVariants = cva(
|
|
9
|
-
|
|
9
|
+
"group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
13
|
default: 'bg-card text-card-foreground',
|
|
14
|
-
destructive:
|
|
14
|
+
destructive:
|
|
15
|
+
'bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current',
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
18
|
defaultVariants: {
|
|
@@ -33,10 +34,10 @@ export function Alert({ className, variant, ...props }: AlertProps) @{
|
|
|
33
34
|
/>
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
export function AlertTitle({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
>) @{
|
|
37
|
+
export function AlertTitle({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: { className?: string } & Record<string, unknown>) @{
|
|
40
41
|
<div
|
|
41
42
|
data-slot="alert-title"
|
|
42
43
|
className={cn(
|
|
@@ -47,10 +48,10 @@ export function AlertTitle({ className, ...props }: { className?: string } & Rec
|
|
|
47
48
|
/>
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
export function AlertDescription({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
>) @{
|
|
51
|
+
export function AlertDescription({
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}: { className?: string } & Record<string, unknown>) @{
|
|
54
55
|
<div
|
|
55
56
|
data-slot="alert-description"
|
|
56
57
|
className={cn(
|
|
@@ -61,9 +62,9 @@ export function AlertDescription({ className, ...props }: { className?: string }
|
|
|
61
62
|
/>
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
export function AlertAction({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
>) @{
|
|
65
|
+
export function AlertAction({
|
|
66
|
+
className,
|
|
67
|
+
...props
|
|
68
|
+
}: { className?: string } & Record<string, unknown>) @{
|
|
68
69
|
<div data-slot="alert-action" className={cn('absolute top-2 right-2', className)} {...props} />
|
|
69
70
|
}
|
|
@@ -14,7 +14,8 @@ export const badgeVariants = cva(
|
|
|
14
14
|
variant: {
|
|
15
15
|
default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
|
|
16
16
|
secondary: 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',
|
|
17
|
-
destructive:
|
|
17
|
+
destructive:
|
|
18
|
+
'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',
|
|
18
19
|
outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
|
|
19
20
|
ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
|
|
20
21
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
@@ -11,25 +11,32 @@ import { cn } from 'cn';
|
|
|
11
11
|
import type { HostProps } from '../../../lib/types';
|
|
12
12
|
|
|
13
13
|
export const buttonVariants = cva(
|
|
14
|
-
|
|
14
|
+
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
15
15
|
{
|
|
16
16
|
variants: {
|
|
17
17
|
variant: {
|
|
18
18
|
default: 'bg-primary text-primary-foreground hover:bg-primary/80',
|
|
19
|
-
outline:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
outline:
|
|
20
|
+
'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
|
|
21
|
+
secondary:
|
|
22
|
+
'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
23
|
+
ghost:
|
|
24
|
+
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
|
|
25
|
+
destructive:
|
|
26
|
+
'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
|
|
23
27
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
24
28
|
},
|
|
25
29
|
size: {
|
|
26
|
-
default:
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
default:
|
|
31
|
+
'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
32
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
33
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
29
34
|
lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
30
35
|
icon: 'size-8',
|
|
31
|
-
'icon-xs':
|
|
32
|
-
|
|
36
|
+
'icon-xs':
|
|
37
|
+
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
38
|
+
'icon-sm':
|
|
39
|
+
'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
33
40
|
'icon-lg': 'size-9',
|
|
34
41
|
},
|
|
35
42
|
},
|
|
@@ -40,7 +40,10 @@ export function ContextMenuRadioGroup(props: Record<string, unknown>) @{
|
|
|
40
40
|
<ContextMenuPrimitive.RadioGroup data-slot="context-menu-radio-group" {...props} />
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export function ContextMenuContent({
|
|
43
|
+
export function ContextMenuContent({
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}: Props & {
|
|
44
47
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
45
48
|
}) {
|
|
46
49
|
return createElement(
|
|
@@ -57,7 +60,12 @@ export function ContextMenuContent({ className, ...props }: Props & {
|
|
|
57
60
|
);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
export function ContextMenuItem({
|
|
63
|
+
export function ContextMenuItem({
|
|
64
|
+
className,
|
|
65
|
+
inset,
|
|
66
|
+
variant = 'default',
|
|
67
|
+
...props
|
|
68
|
+
}: Props & {
|
|
61
69
|
inset?: boolean;
|
|
62
70
|
variant?: 'default' | 'destructive';
|
|
63
71
|
}) @{
|
|
@@ -66,7 +74,7 @@ export function ContextMenuItem({ className, inset, variant = 'default', ...prop
|
|
|
66
74
|
data-inset={inset}
|
|
67
75
|
data-variant={variant}
|
|
68
76
|
className={cn(
|
|
69
|
-
|
|
77
|
+
"group/context-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 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 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
|
|
70
78
|
className,
|
|
71
79
|
)}
|
|
72
80
|
{...props}
|
|
@@ -80,7 +88,7 @@ export function ContextMenuSubTrigger(props: Props & { inset?: boolean }) @{
|
|
|
80
88
|
data-slot="context-menu-sub-trigger"
|
|
81
89
|
data-inset={inset}
|
|
82
90
|
className={cn(
|
|
83
|
-
|
|
91
|
+
"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 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",
|
|
84
92
|
className,
|
|
85
93
|
)}
|
|
86
94
|
{...rest}
|
|
@@ -101,17 +109,19 @@ export function ContextMenuSubContent({ className, ...props }: Props) @{
|
|
|
101
109
|
/>
|
|
102
110
|
}
|
|
103
111
|
|
|
104
|
-
export function ContextMenuCheckboxItem(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
export function ContextMenuCheckboxItem(
|
|
113
|
+
props: Props & {
|
|
114
|
+
checked?: boolean | 'indeterminate';
|
|
115
|
+
inset?: boolean;
|
|
116
|
+
},
|
|
117
|
+
) @{
|
|
108
118
|
const { className, children: _children, checked, inset, ...rest } = props;
|
|
109
119
|
|
|
110
120
|
<ContextMenuPrimitive.CheckboxItem
|
|
111
121
|
data-slot="context-menu-checkbox-item"
|
|
112
122
|
data-inset={inset}
|
|
113
123
|
className={cn(
|
|
114
|
-
|
|
124
|
+
"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 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",
|
|
115
125
|
className,
|
|
116
126
|
)}
|
|
117
127
|
checked={checked}
|
|
@@ -133,7 +143,7 @@ export function ContextMenuRadioItem(props: Props & { inset?: boolean }) @{
|
|
|
133
143
|
data-slot="context-menu-radio-item"
|
|
134
144
|
data-inset={inset}
|
|
135
145
|
className={cn(
|
|
136
|
-
|
|
146
|
+
"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 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",
|
|
137
147
|
className,
|
|
138
148
|
)}
|
|
139
149
|
{...rest}
|
|
@@ -53,7 +53,12 @@ export function DropdownMenuGroup(props: Record<string, unknown>) @{
|
|
|
53
53
|
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
export function DropdownMenuItem({
|
|
56
|
+
export function DropdownMenuItem({
|
|
57
|
+
className,
|
|
58
|
+
inset,
|
|
59
|
+
variant = 'default',
|
|
60
|
+
...props
|
|
61
|
+
}: Props & {
|
|
57
62
|
inset?: boolean;
|
|
58
63
|
variant?: 'default' | 'destructive';
|
|
59
64
|
}) @{
|
|
@@ -62,24 +67,26 @@ export function DropdownMenuItem({ className, inset, variant = 'default', ...pro
|
|
|
62
67
|
data-inset={inset}
|
|
63
68
|
data-variant={variant}
|
|
64
69
|
className={cn(
|
|
65
|
-
|
|
70
|
+
"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",
|
|
66
71
|
className,
|
|
67
72
|
)}
|
|
68
73
|
{...props}
|
|
69
74
|
/>
|
|
70
75
|
}
|
|
71
76
|
|
|
72
|
-
export function DropdownMenuCheckboxItem(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
export function DropdownMenuCheckboxItem(
|
|
78
|
+
props: Props & {
|
|
79
|
+
checked?: boolean | 'indeterminate';
|
|
80
|
+
inset?: boolean;
|
|
81
|
+
},
|
|
82
|
+
) @{
|
|
76
83
|
const { className, children: _children, checked, inset, ...rest } = props;
|
|
77
84
|
|
|
78
85
|
<DropdownMenuPrimitive.CheckboxItem
|
|
79
86
|
data-slot="dropdown-menu-checkbox-item"
|
|
80
87
|
data-inset={inset}
|
|
81
88
|
className={cn(
|
|
82
|
-
|
|
89
|
+
"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",
|
|
83
90
|
className,
|
|
84
91
|
)}
|
|
85
92
|
checked={checked}
|
|
@@ -108,7 +115,7 @@ export function DropdownMenuRadioItem(props: Props & { inset?: boolean }) @{
|
|
|
108
115
|
data-slot="dropdown-menu-radio-item"
|
|
109
116
|
data-inset={inset}
|
|
110
117
|
className={cn(
|
|
111
|
-
|
|
118
|
+
"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",
|
|
112
119
|
className,
|
|
113
120
|
)}
|
|
114
121
|
{...rest}
|
|
@@ -167,7 +174,7 @@ export function DropdownMenuSubTrigger(props: Props & { inset?: boolean }) @{
|
|
|
167
174
|
data-slot="dropdown-menu-sub-trigger"
|
|
168
175
|
data-inset={inset}
|
|
169
176
|
className={cn(
|
|
170
|
-
|
|
177
|
+
"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",
|
|
171
178
|
className,
|
|
172
179
|
)}
|
|
173
180
|
{...rest}
|
|
@@ -32,7 +32,7 @@ export const emptyMediaVariants = cva(
|
|
|
32
32
|
variants: {
|
|
33
33
|
variant: {
|
|
34
34
|
default: 'bg-transparent',
|
|
35
|
-
icon:
|
|
35
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
defaultVariants: {
|
|
@@ -23,7 +23,11 @@ export function FieldSet({ className, ...props }: Props) @{
|
|
|
23
23
|
/>
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export function FieldLegend({
|
|
26
|
+
export function FieldLegend({
|
|
27
|
+
className,
|
|
28
|
+
variant = 'legend',
|
|
29
|
+
...props
|
|
30
|
+
}: Props & {
|
|
27
31
|
variant?: 'legend' | 'label';
|
|
28
32
|
}) @{
|
|
29
33
|
<legend
|
|
@@ -54,8 +58,10 @@ export const fieldVariants = cva(
|
|
|
54
58
|
variants: {
|
|
55
59
|
orientation: {
|
|
56
60
|
vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',
|
|
57
|
-
horizontal:
|
|
58
|
-
|
|
61
|
+
horizontal:
|
|
62
|
+
'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',
|
|
63
|
+
responsive:
|
|
64
|
+
'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',
|
|
59
65
|
},
|
|
60
66
|
},
|
|
61
67
|
defaultVariants: {
|
|
@@ -64,7 +70,11 @@ export const fieldVariants = cva(
|
|
|
64
70
|
},
|
|
65
71
|
);
|
|
66
72
|
|
|
67
|
-
export function Field({
|
|
73
|
+
export function Field({
|
|
74
|
+
className,
|
|
75
|
+
orientation = 'vertical',
|
|
76
|
+
...props
|
|
77
|
+
}: Props & {
|
|
68
78
|
orientation?: VariantProps<typeof fieldVariants>['orientation'];
|
|
69
79
|
}) @{
|
|
70
80
|
<div
|
|
@@ -156,19 +166,15 @@ export function FieldError(props: Props & { errors?: Array<{ message?: string }
|
|
|
156
166
|
const errors = props.errors;
|
|
157
167
|
if (!errors?.length) return null;
|
|
158
168
|
|
|
159
|
-
const uniqueErrors = [
|
|
160
|
-
...new Map(errors.map((error) => [error?.message, error])).values(),
|
|
161
|
-
];
|
|
169
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
|
|
162
170
|
|
|
163
171
|
if (uniqueErrors?.length == 1) return uniqueErrors[0]?.message;
|
|
164
172
|
|
|
165
173
|
return createElement(
|
|
166
174
|
'ul',
|
|
167
175
|
{ className: 'ml-4 flex list-disc flex-col gap-1' },
|
|
168
|
-
uniqueErrors.map(
|
|
169
|
-
(
|
|
170
|
-
? createElement('li', { key: index }, error.message)
|
|
171
|
-
: null,
|
|
176
|
+
uniqueErrors.map((error, index) =>
|
|
177
|
+
error?.message ? createElement('li', { key: index }, error.message) : null,
|
|
172
178
|
),
|
|
173
179
|
);
|
|
174
180
|
});
|
|
@@ -93,8 +93,9 @@ export const itemMediaVariants = cva(
|
|
|
93
93
|
variants: {
|
|
94
94
|
variant: {
|
|
95
95
|
default: 'bg-transparent',
|
|
96
|
-
icon:
|
|
97
|
-
image:
|
|
96
|
+
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
97
|
+
image:
|
|
98
|
+
'size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover',
|
|
98
99
|
},
|
|
99
100
|
},
|
|
100
101
|
defaultVariants: {
|
|
@@ -71,7 +71,12 @@ export function MenubarContent({
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
export function MenubarItem({
|
|
74
|
+
export function MenubarItem({
|
|
75
|
+
className,
|
|
76
|
+
inset,
|
|
77
|
+
variant = 'default',
|
|
78
|
+
...props
|
|
79
|
+
}: Props & {
|
|
75
80
|
inset?: boolean;
|
|
76
81
|
variant?: 'default' | 'destructive';
|
|
77
82
|
}) @{
|
|
@@ -80,17 +85,19 @@ export function MenubarItem({ className, inset, variant = 'default', ...props }:
|
|
|
80
85
|
data-inset={inset}
|
|
81
86
|
data-variant={variant}
|
|
82
87
|
className={cn(
|
|
83
|
-
|
|
88
|
+
"group/menubar-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!",
|
|
84
89
|
className,
|
|
85
90
|
)}
|
|
86
91
|
{...props}
|
|
87
92
|
/>
|
|
88
93
|
}
|
|
89
94
|
|
|
90
|
-
export function MenubarCheckboxItem(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
export function MenubarCheckboxItem(
|
|
96
|
+
props: Props & {
|
|
97
|
+
checked?: boolean | 'indeterminate';
|
|
98
|
+
inset?: boolean;
|
|
99
|
+
},
|
|
100
|
+
) @{
|
|
94
101
|
const { className, children: _children, checked, inset, ...rest } = props;
|
|
95
102
|
|
|
96
103
|
<MenubarPrimitive.CheckboxItem
|
|
@@ -103,9 +110,7 @@ export function MenubarCheckboxItem(props: Props & {
|
|
|
103
110
|
checked={checked}
|
|
104
111
|
{...rest}
|
|
105
112
|
>
|
|
106
|
-
<span
|
|
107
|
-
className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4"
|
|
108
|
-
>
|
|
113
|
+
<span className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
|
|
109
114
|
<MenubarPrimitive.ItemIndicator>
|
|
110
115
|
<CheckIcon />
|
|
111
116
|
</MenubarPrimitive.ItemIndicator>
|
|
@@ -121,14 +126,12 @@ export function MenubarRadioItem(props: Props & { inset?: boolean }) @{
|
|
|
121
126
|
data-slot="menubar-radio-item"
|
|
122
127
|
data-inset={inset}
|
|
123
128
|
className={cn(
|
|
124
|
-
|
|
129
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 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",
|
|
125
130
|
className,
|
|
126
131
|
)}
|
|
127
132
|
{...rest}
|
|
128
133
|
>
|
|
129
|
-
<span
|
|
130
|
-
className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4"
|
|
131
|
-
>
|
|
134
|
+
<span className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
|
|
132
135
|
<MenubarPrimitive.ItemIndicator>
|
|
133
136
|
<CheckIcon />
|
|
134
137
|
</MenubarPrimitive.ItemIndicator>
|
|
@@ -176,7 +179,7 @@ export function MenubarSubTrigger(props: Props & { inset?: boolean }) @{
|
|
|
176
179
|
data-slot="menubar-sub-trigger"
|
|
177
180
|
data-inset={inset}
|
|
178
181
|
className={cn(
|
|
179
|
-
|
|
182
|
+
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
180
183
|
className,
|
|
181
184
|
)}
|
|
182
185
|
{...rest}
|
|
@@ -32,10 +32,10 @@ export function NativeSelect({ className, size = 'default', ...props }: NativeSe
|
|
|
32
32
|
</div>
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export function NativeSelectOption({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
>) @{
|
|
35
|
+
export function NativeSelectOption({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: { className?: string } & Record<string, unknown>) @{
|
|
39
39
|
<option
|
|
40
40
|
data-slot="native-select-option"
|
|
41
41
|
className={cn('bg-[Canvas] text-[CanvasText]', className)}
|
|
@@ -43,10 +43,10 @@ export function NativeSelectOption({ className, ...props }: { className?: string
|
|
|
43
43
|
/>
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export function NativeSelectOptGroup({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
>) @{
|
|
46
|
+
export function NativeSelectOptGroup({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: { className?: string } & Record<string, unknown>) @{
|
|
50
50
|
<optgroup
|
|
51
51
|
data-slot="native-select-optgroup"
|
|
52
52
|
className={cn('bg-[Canvas] text-[CanvasText]', className)}
|
|
@@ -58,8 +58,7 @@ export function NavigationMenuTrigger(props: Props) @{
|
|
|
58
58
|
className={cn(navigationMenuTriggerStyle(), 'group', className)}
|
|
59
59
|
{...rest}
|
|
60
60
|
>
|
|
61
|
-
{props.children}
|
|
62
|
-
{' '}
|
|
61
|
+
{props.children}{' '}
|
|
63
62
|
<ChevronDownIcon
|
|
64
63
|
className="relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180"
|
|
65
64
|
aria-hidden="true"
|
|
@@ -95,7 +94,7 @@ export function NavigationMenuLink({ className, ...props }: Props) @{
|
|
|
95
94
|
<NavigationMenuPrimitive.Link
|
|
96
95
|
data-slot="navigation-menu-link"
|
|
97
96
|
className={cn(
|
|
98
|
-
|
|
97
|
+
"flex items-center gap-2 rounded-lg p-2 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-md data-active:bg-muted/50 data-active:hover:bg-muted data-active:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
99
98
|
className,
|
|
100
99
|
)}
|
|
101
100
|
{...props}
|
|
@@ -83,7 +83,11 @@ export function PaginationPrevious({
|
|
|
83
83
|
</PaginationLink>
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
export function PaginationNext({
|
|
86
|
+
export function PaginationNext({
|
|
87
|
+
className,
|
|
88
|
+
text = 'Next',
|
|
89
|
+
...props
|
|
90
|
+
}: PaginationLinkProps & {
|
|
87
91
|
text?: string;
|
|
88
92
|
}) @{
|
|
89
93
|
<PaginationLink
|
|
@@ -102,7 +106,7 @@ export function PaginationEllipsis({ className, ...props }: Props) @{
|
|
|
102
106
|
aria-hidden="true"
|
|
103
107
|
data-slot="pagination-ellipsis"
|
|
104
108
|
className={cn(
|
|
105
|
-
|
|
109
|
+
"flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
106
110
|
className,
|
|
107
111
|
)}
|
|
108
112
|
{...props}
|
|
@@ -29,9 +29,7 @@ export function RadioGroupItem({ className, ...props }: Props) @{
|
|
|
29
29
|
data-slot="radio-group-indicator"
|
|
30
30
|
className="relative flex items-center justify-center"
|
|
31
31
|
>
|
|
32
|
-
<CircleIcon
|
|
33
|
-
className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary"
|
|
34
|
-
/>
|
|
32
|
+
<CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" />
|
|
35
33
|
</RadioGroupPrimitive.Indicator>
|
|
36
34
|
</RadioGroupPrimitive.Item>
|
|
37
35
|
}
|
|
@@ -16,13 +16,19 @@ export function ScrollArea(props: Props) @{
|
|
|
16
16
|
<ScrollAreaPrimitive.Viewport
|
|
17
17
|
data-slot="scroll-area-viewport"
|
|
18
18
|
className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
|
|
19
|
-
>
|
|
19
|
+
>
|
|
20
|
+
{props.children}
|
|
21
|
+
</ScrollAreaPrimitive.Viewport>
|
|
20
22
|
<ScrollBar />
|
|
21
23
|
<ScrollAreaPrimitive.Corner />
|
|
22
24
|
</ScrollAreaPrimitive.Root>
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
export function ScrollBar({
|
|
27
|
+
export function ScrollBar({
|
|
28
|
+
className,
|
|
29
|
+
orientation = 'vertical',
|
|
30
|
+
...props
|
|
31
|
+
}: Props & {
|
|
26
32
|
orientation?: 'vertical' | 'horizontal';
|
|
27
33
|
}) @{
|
|
28
34
|
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
@@ -27,7 +27,12 @@ export function SelectValue(props: Record<string, unknown>) @{
|
|
|
27
27
|
<SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export function SelectTrigger({
|
|
30
|
+
export function SelectTrigger({
|
|
31
|
+
className,
|
|
32
|
+
size = 'default',
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}: Props & {
|
|
31
36
|
size?: 'sm' | 'default';
|
|
32
37
|
}) {
|
|
33
38
|
return createElement(
|
|
@@ -36,7 +41,7 @@ export function SelectTrigger({ className, size = 'default', children, ...props
|
|
|
36
41
|
'data-slot': 'select-trigger',
|
|
37
42
|
'data-size': size,
|
|
38
43
|
className: cn(
|
|
39
|
-
|
|
44
|
+
"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",
|
|
40
45
|
className,
|
|
41
46
|
),
|
|
42
47
|
...props,
|
|
@@ -109,7 +114,7 @@ export function SelectItem({ className, children, ...props }: Props) {
|
|
|
109
114
|
{
|
|
110
115
|
'data-slot': 'select-item',
|
|
111
116
|
className: cn(
|
|
112
|
-
|
|
117
|
+
"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",
|
|
113
118
|
className,
|
|
114
119
|
),
|
|
115
120
|
...props,
|
|
@@ -142,7 +147,7 @@ export function SelectScrollUpButton({ className, ...props }: Props) @{
|
|
|
142
147
|
<SelectPrimitive.ScrollUpButton
|
|
143
148
|
data-slot="select-scroll-up-button"
|
|
144
149
|
className={cn(
|
|
145
|
-
|
|
150
|
+
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
146
151
|
className,
|
|
147
152
|
)}
|
|
148
153
|
{...props}
|
|
@@ -155,7 +160,7 @@ export function SelectScrollDownButton({ className, ...props }: Props) @{
|
|
|
155
160
|
<SelectPrimitive.ScrollDownButton
|
|
156
161
|
data-slot="select-scroll-down-button"
|
|
157
162
|
className={cn(
|
|
158
|
-
|
|
163
|
+
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
159
164
|
className,
|
|
160
165
|
)}
|
|
161
166
|
{...props}
|