@octanejs/shadcn 0.0.52 → 0.0.54
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
|
@@ -20,23 +20,22 @@ import type { HostProps } from '../../../lib/types';
|
|
|
20
20
|
import { ChevronRightIcon, MoreHorizontalIcon } from '@octanejs/lucide';
|
|
21
21
|
|
|
22
22
|
export function Breadcrumb({ className, ...props }: HostProps<'nav'>) {
|
|
23
|
-
return
|
|
24
|
-
aria-label="breadcrumb"
|
|
25
|
-
|
|
26
|
-
className={cn(className)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>;
|
|
23
|
+
return (
|
|
24
|
+
<nav aria-label="breadcrumb" data-slot="breadcrumb" className={cn(className)} {...props} />
|
|
25
|
+
);
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
export function BreadcrumbList<T extends object>({ className, ...props }: BreadcrumbsProps<T>) {
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
return (
|
|
30
|
+
<BreadcrumbsPrimitive
|
|
31
|
+
data-slot="breadcrumb-list"
|
|
32
|
+
className={cn(
|
|
33
|
+
'flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground',
|
|
34
|
+
className,
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
export function BreadcrumbItem({
|
|
@@ -45,56 +44,66 @@ export function BreadcrumbItem({
|
|
|
45
44
|
separatorClassName,
|
|
46
45
|
...props
|
|
47
46
|
}: BreadcrumbProps & { separatorClassName?: string }) {
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
return (
|
|
48
|
+
<BreadcrumbPrimitive
|
|
49
|
+
data-slot="breadcrumb-item"
|
|
50
|
+
className={cn('inline-flex items-center gap-1', className)}
|
|
51
|
+
{...props}
|
|
52
|
+
>
|
|
53
|
+
{composeRenderProps(children, (children, { isCurrent }: BreadcrumbRenderProps) => (
|
|
54
|
+
<>
|
|
55
|
+
{children}
|
|
56
|
+
{!isCurrent && (
|
|
57
|
+
<span
|
|
58
|
+
data-slot="breadcrumb-separator"
|
|
59
|
+
role="presentation"
|
|
60
|
+
aria-hidden="true"
|
|
61
|
+
className={cn('[&>svg]:size-3.5', separatorClassName)}
|
|
62
|
+
>
|
|
63
|
+
<ChevronRightIcon />
|
|
64
|
+
</span>
|
|
65
|
+
)}
|
|
66
|
+
</>
|
|
67
|
+
))}
|
|
68
|
+
</BreadcrumbPrimitive>
|
|
69
|
+
);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
export function BreadcrumbLink({ className, render, ...props }: LinkProps) {
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
return (
|
|
74
|
+
<LinkPrimitive
|
|
75
|
+
data-slot="breadcrumb-link"
|
|
76
|
+
className={cn('transition-colors hover:text-foreground', className)}
|
|
77
|
+
render={render}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
export function BreadcrumbPage({ className, ...props }: HostProps<'span'>) {
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
return (
|
|
85
|
+
<span
|
|
86
|
+
data-slot="breadcrumb-page"
|
|
87
|
+
role="link"
|
|
88
|
+
aria-disabled="true"
|
|
89
|
+
aria-current="page"
|
|
90
|
+
className={cn('font-normal text-foreground', className)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
export function BreadcrumbEllipsis({ className, ...props }: HostProps<'span'>) {
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
return (
|
|
98
|
+
<span
|
|
99
|
+
data-slot="breadcrumb-ellipsis"
|
|
100
|
+
role="presentation"
|
|
101
|
+
aria-hidden="true"
|
|
102
|
+
className={cn('flex size-5 items-center justify-center [&>svg]:size-4', className)}
|
|
103
|
+
{...props}
|
|
104
|
+
>
|
|
105
|
+
<MoreHorizontalIcon />
|
|
106
|
+
<span className="sr-only">More</span>
|
|
107
|
+
</span>
|
|
108
|
+
);
|
|
100
109
|
}
|
|
@@ -22,25 +22,32 @@ import type {
|
|
|
22
22
|
import { cn } from 'cn';
|
|
23
23
|
|
|
24
24
|
export const buttonVariants = cva(
|
|
25
|
-
|
|
25
|
+
"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",
|
|
26
26
|
{
|
|
27
27
|
variants: {
|
|
28
28
|
variant: {
|
|
29
29
|
default: 'bg-primary text-primary-foreground hover:bg-primary/80',
|
|
30
|
-
outline:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
outline:
|
|
31
|
+
'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',
|
|
32
|
+
secondary:
|
|
33
|
+
'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',
|
|
34
|
+
ghost:
|
|
35
|
+
'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
|
|
36
|
+
destructive:
|
|
37
|
+
'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',
|
|
34
38
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
35
39
|
},
|
|
36
40
|
size: {
|
|
37
|
-
default:
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
default:
|
|
42
|
+
'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
43
|
+
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",
|
|
44
|
+
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",
|
|
40
45
|
lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
41
46
|
icon: 'size-8',
|
|
42
|
-
'icon-xs':
|
|
43
|
-
|
|
47
|
+
'icon-xs':
|
|
48
|
+
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
49
|
+
'icon-sm':
|
|
50
|
+
'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',
|
|
44
51
|
'icon-lg': 'size-9',
|
|
45
52
|
},
|
|
46
53
|
},
|
|
@@ -1,73 +1,87 @@
|
|
|
1
1
|
import { cn } from 'cn';
|
|
2
2
|
import type { HostProps } from '../../../lib/types';
|
|
3
3
|
|
|
4
|
-
export function Card({
|
|
4
|
+
export function Card({
|
|
5
|
+
className,
|
|
6
|
+
size = 'default',
|
|
7
|
+
...props
|
|
8
|
+
}: HostProps<'div'> & {
|
|
5
9
|
size?: 'default' | 'sm';
|
|
6
10
|
}) {
|
|
7
|
-
return
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
data-slot="card"
|
|
14
|
+
data-size={size}
|
|
15
|
+
className={cn(
|
|
16
|
+
'group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
export function CardHeader({ className, ...props }: HostProps<'div'>) {
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
data-slot="card-header"
|
|
28
|
+
className={cn(
|
|
29
|
+
'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)',
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
export function CardTitle({ className, ...props }: HostProps<'div'>) {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
data-slot="card-title"
|
|
41
|
+
className={cn(
|
|
42
|
+
'text-base leading-snug font-medium group-data-[size=sm]/card:text-sm',
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
38
48
|
}
|
|
39
49
|
|
|
40
50
|
export function CardDescription({ className, ...props }: HostProps<'div'>) {
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
data-slot="card-description"
|
|
54
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
46
58
|
}
|
|
47
59
|
|
|
48
60
|
export function CardAction({ className, ...props }: HostProps<'div'>) {
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
data-slot="card-action"
|
|
64
|
+
className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
54
68
|
}
|
|
55
69
|
|
|
56
70
|
export function CardContent({ className, ...props }: HostProps<'div'>) {
|
|
57
|
-
return
|
|
58
|
-
data-slot="card-content"
|
|
59
|
-
|
|
60
|
-
{...props}
|
|
61
|
-
/>;
|
|
71
|
+
return (
|
|
72
|
+
<div data-slot="card-content" className={cn('px-(--card-spacing)', className)} {...props} />
|
|
73
|
+
);
|
|
62
74
|
}
|
|
63
75
|
|
|
64
76
|
export function CardFooter({ className, ...props }: HostProps<'div'>) {
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
data-slot="card-footer"
|
|
80
|
+
className={cn(
|
|
81
|
+
'flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)',
|
|
82
|
+
className,
|
|
83
|
+
)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
73
87
|
}
|
|
@@ -15,23 +15,29 @@ import { cn } from 'cn';
|
|
|
15
15
|
import { CheckIcon } from '@octanejs/lucide';
|
|
16
16
|
|
|
17
17
|
export function Checkbox({ className, children, ...props }: CheckboxProps) {
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
18
|
+
return (
|
|
19
|
+
<CheckboxPrimitive
|
|
20
|
+
data-slot="checkbox"
|
|
21
|
+
className={cn(
|
|
22
|
+
'peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 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 aria-invalid:aria-checked:border-primary data-focus-visible:border-ring data-focus-visible:ring-3 data-focus-visible:ring-ring/50 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:data-invalid:border-destructive/50 dark:data-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-selected:border-primary data-selected:bg-primary data-selected:text-primary-foreground data-invalid:data-selected:border-primary dark:data-selected:bg-primary',
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
{composeRenderProps(
|
|
28
|
+
children,
|
|
29
|
+
(children, { isSelected, isIndeterminate }: CheckboxRenderProps) => (
|
|
30
|
+
<>
|
|
31
|
+
<span
|
|
32
|
+
data-slot="checkbox-indicator"
|
|
33
|
+
className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
|
|
34
|
+
>
|
|
35
|
+
{(isSelected || isIndeterminate) && <CheckIcon />}
|
|
36
|
+
</span>
|
|
37
|
+
{children}
|
|
38
|
+
</>
|
|
39
|
+
),
|
|
40
|
+
)}
|
|
41
|
+
</CheckboxPrimitive>
|
|
42
|
+
);
|
|
37
43
|
}
|
|
@@ -18,35 +18,44 @@ export function DialogTrigger({ ...props }: DialogTriggerPrimitiveProps) {
|
|
|
18
18
|
return <DialogTriggerPrimitive data-slot="dialog-trigger" {...props} />;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function DialogClose({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
export function DialogClose({
|
|
22
|
+
className,
|
|
23
|
+
variant = 'outline',
|
|
24
|
+
size = 'default',
|
|
25
|
+
...props
|
|
26
|
+
}: Record<string, any>) {
|
|
27
|
+
return (
|
|
28
|
+
<Button
|
|
29
|
+
slot="close"
|
|
30
|
+
data-slot="dialog-close"
|
|
31
|
+
variant={variant}
|
|
32
|
+
size={size}
|
|
33
|
+
className={cn(className)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
33
37
|
}
|
|
34
38
|
|
|
35
|
-
export function DialogOverlay({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
export function DialogOverlay({
|
|
40
|
+
className,
|
|
41
|
+
children,
|
|
42
|
+
...props
|
|
43
|
+
}: Omit<ModalOverlayPrimitiveProps, 'className' | 'children'> & {
|
|
39
44
|
className?: string;
|
|
40
45
|
children: OctaneNode;
|
|
41
46
|
}) {
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
return (
|
|
48
|
+
<ModalOverlayPrimitive
|
|
49
|
+
data-slot="dialog-overlay"
|
|
50
|
+
className={cn(
|
|
51
|
+
'fixed inset-0 isolate z-50 bg-black/10 duration-100 data-entering:animate-in data-entering:fade-in-0 data-exiting:animate-out data-exiting:fade-out-0 supports-backdrop-filter:backdrop-blur-xs',
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
>
|
|
56
|
+
{children}
|
|
57
|
+
</ModalOverlayPrimitive>
|
|
58
|
+
);
|
|
50
59
|
}
|
|
51
60
|
|
|
52
61
|
export function Dialog({
|
|
@@ -55,76 +64,87 @@ export function Dialog({
|
|
|
55
64
|
showCloseButton = true,
|
|
56
65
|
isDismissable = true,
|
|
57
66
|
...props
|
|
58
|
-
}: Omit<ModalOverlayPrimitiveProps, 'className' | 'children'> &
|
|
59
|
-
Record<string, any>,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
}: Omit<ModalOverlayPrimitiveProps, 'className' | 'children'> &
|
|
68
|
+
Pick<Record<string, any>, 'isDismissable'> & {
|
|
69
|
+
className?: string;
|
|
70
|
+
children: OctaneNode;
|
|
71
|
+
showCloseButton?: boolean;
|
|
72
|
+
}) {
|
|
73
|
+
return (
|
|
74
|
+
<DialogOverlay isDismissable={isDismissable} {...props}>
|
|
75
|
+
<ModalPrimitive
|
|
76
|
+
data-slot="dialog-content"
|
|
77
|
+
className={cn(
|
|
78
|
+
'fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-entering:animate-in data-entering:fade-in-0 data-entering:zoom-in-95 data-exiting:animate-out data-exiting:fade-out-0 data-exiting:zoom-out-95 sm:max-w-sm',
|
|
79
|
+
className,
|
|
80
|
+
)}
|
|
81
|
+
>
|
|
82
|
+
<DialogPrimitive
|
|
83
|
+
data-slot="dialog"
|
|
84
|
+
className="[display:inherit] [gap:inherit] outline-none"
|
|
85
|
+
>
|
|
86
|
+
{children}
|
|
87
|
+
{showCloseButton && (
|
|
88
|
+
<DialogClose variant="ghost" className="absolute top-2 right-2" size="icon-sm">
|
|
89
|
+
<XIcon />
|
|
90
|
+
<span className="sr-only">Close</span>
|
|
91
|
+
</DialogClose>
|
|
92
|
+
)}
|
|
93
|
+
</DialogPrimitive>
|
|
94
|
+
</ModalPrimitive>
|
|
95
|
+
</DialogOverlay>
|
|
96
|
+
);
|
|
84
97
|
}
|
|
85
98
|
|
|
86
99
|
export function DialogHeader({ className, ...props }: HostProps<'div'>) {
|
|
87
|
-
return
|
|
88
|
-
data-slot="dialog-header"
|
|
89
|
-
|
|
90
|
-
{...props}
|
|
91
|
-
/>;
|
|
100
|
+
return (
|
|
101
|
+
<div data-slot="dialog-header" className={cn('flex flex-col gap-2', className)} {...props} />
|
|
102
|
+
);
|
|
92
103
|
}
|
|
93
104
|
|
|
94
|
-
export function DialogFooter({
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
export function DialogFooter({
|
|
106
|
+
className,
|
|
107
|
+
showCloseButton = false,
|
|
108
|
+
children,
|
|
109
|
+
...props
|
|
110
|
+
}: HostProps<'div'> & {
|
|
97
111
|
showCloseButton?: boolean;
|
|
98
112
|
}) {
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
return (
|
|
114
|
+
<div
|
|
115
|
+
data-slot="dialog-footer"
|
|
116
|
+
className={cn(
|
|
117
|
+
'-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end',
|
|
118
|
+
className,
|
|
119
|
+
)}
|
|
120
|
+
{...props}
|
|
121
|
+
>
|
|
122
|
+
{children}
|
|
123
|
+
{showCloseButton && <DialogClose variant="outline">Close</DialogClose>}
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
110
126
|
}
|
|
111
127
|
|
|
112
128
|
export function DialogTitle({ className, ...props }: Omit<Record<string, any>, 'slot'>) {
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
return (
|
|
130
|
+
<Heading
|
|
131
|
+
slot="title"
|
|
132
|
+
data-slot="dialog-title"
|
|
133
|
+
className={cn('text-base leading-none font-medium', className)}
|
|
134
|
+
{...props}
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
119
137
|
}
|
|
120
138
|
|
|
121
139
|
export function DialogDescription({ className, ...props }: Omit<HostProps<'div'>, 'slot'>) {
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
140
|
+
return (
|
|
141
|
+
<div
|
|
142
|
+
data-slot="dialog-description"
|
|
143
|
+
className={cn(
|
|
144
|
+
'text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',
|
|
145
|
+
className,
|
|
146
|
+
)}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
130
150
|
}
|