@srcroot/ui 0.0.61 → 0.0.62
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/index.js +1 -1
- package/package.json +1 -1
- package/src/registry/analytics/google-analytics.tsx +25 -23
- package/src/registry/analytics/google-tag-manager.tsx +54 -49
- package/src/registry/analytics/meta-pixel.tsx +29 -25
- package/src/registry/analytics/microsoft-clarity.tsx +19 -17
- package/src/registry/analytics/tiktok-pixel.tsx +15 -13
- package/src/registry/ui/alert.tsx +50 -48
- package/src/registry/ui/aspect-ratio.tsx +27 -25
- package/src/registry/ui/badge.tsx +40 -37
- package/src/registry/ui/breadcrumb.tsx +106 -106
- package/src/registry/ui/button-group.tsx +52 -46
- package/src/registry/ui/card.tsx +68 -58
- package/src/registry/ui/container.tsx +34 -31
- package/src/registry/ui/empty-state.tsx +32 -30
- package/src/registry/ui/form-field.tsx +79 -68
- package/src/registry/ui/image.tsx +128 -120
- package/src/registry/ui/input-group.tsx +78 -72
- package/src/registry/ui/kbd.tsx +46 -44
- package/src/registry/ui/loading-spinner.tsx +84 -80
- package/src/registry/ui/marquee.tsx +43 -45
- package/src/registry/ui/native-select.tsx +42 -40
- package/src/registry/ui/pagination.tsx +115 -101
- package/src/registry/ui/radio.tsx +96 -66
- package/src/registry/ui/skeleton.tsx +15 -14
- package/src/registry/ui/slot.tsx +56 -55
- package/src/registry/ui/text.tsx +42 -41
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
import { Slot } from "@/components/ui/slot";
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Breadcrumb navigation component
|
|
7
|
-
*
|
|
9
|
+
*
|
|
8
10
|
* @example
|
|
9
11
|
* <Breadcrumb>
|
|
10
12
|
* <BreadcrumbList>
|
|
@@ -20,128 +22,126 @@ import { Slot } from "@/components/ui/slot"
|
|
|
20
22
|
*/
|
|
21
23
|
|
|
22
24
|
const Breadcrumb = React.forwardRef<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
>(({ ...props }, ref) =>
|
|
26
|
-
|
|
27
|
-
))
|
|
28
|
-
Breadcrumb.displayName = "Breadcrumb"
|
|
25
|
+
HTMLElement,
|
|
26
|
+
React.HTMLAttributes<HTMLElement>
|
|
27
|
+
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
|
|
28
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
29
29
|
|
|
30
30
|
const BreadcrumbList = React.forwardRef<
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
HTMLOListElement,
|
|
32
|
+
React.OlHTMLAttributes<HTMLOListElement>
|
|
33
33
|
>(({ className, ...props }, ref) => (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
))
|
|
43
|
-
BreadcrumbList.displayName = "BreadcrumbList"
|
|
34
|
+
<ol
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={cn(
|
|
37
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
));
|
|
43
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
44
44
|
|
|
45
45
|
const BreadcrumbItem = React.forwardRef<
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
HTMLLIElement,
|
|
47
|
+
React.LiHTMLAttributes<HTMLLIElement>
|
|
48
48
|
>(({ className, ...props }, ref) => (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
))
|
|
55
|
-
BreadcrumbItem.displayName = "BreadcrumbItem"
|
|
49
|
+
<li
|
|
50
|
+
ref={ref}
|
|
51
|
+
className={cn("inline-flex items-center gap-1.5", className)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
));
|
|
55
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
56
56
|
|
|
57
57
|
interface BreadcrumbLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
58
|
-
|
|
58
|
+
asChild?: boolean;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const BreadcrumbLink = React.forwardRef<HTMLAnchorElement, BreadcrumbLinkProps>(
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
({ asChild, className, children, ...props }, ref) => {
|
|
63
|
+
const Comp = asChild ? Slot : "a";
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
)
|
|
76
|
-
BreadcrumbLink.displayName = "BreadcrumbLink"
|
|
65
|
+
return (
|
|
66
|
+
<Comp
|
|
67
|
+
ref={ref}
|
|
68
|
+
className={cn("transition-colors hover:text-foreground", className)}
|
|
69
|
+
{...props}
|
|
70
|
+
>
|
|
71
|
+
{children}
|
|
72
|
+
</Comp>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
77
77
|
|
|
78
78
|
const BreadcrumbPage = React.forwardRef<
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
HTMLSpanElement,
|
|
80
|
+
React.HTMLAttributes<HTMLSpanElement>
|
|
81
81
|
>(({ className, ...props }, ref) => (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
))
|
|
91
|
-
BreadcrumbPage.displayName = "BreadcrumbPage"
|
|
82
|
+
<span
|
|
83
|
+
ref={ref}
|
|
84
|
+
role="link"
|
|
85
|
+
aria-disabled="true"
|
|
86
|
+
aria-current="page"
|
|
87
|
+
className={cn("font-normal text-foreground", className)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
));
|
|
91
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
92
92
|
|
|
93
93
|
const BreadcrumbSeparator = ({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
children,
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
97
|
}: React.LiHTMLAttributes<HTMLLIElement>) => (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
)
|
|
117
|
-
BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
|
|
98
|
+
<li
|
|
99
|
+
role="presentation"
|
|
100
|
+
aria-hidden="true"
|
|
101
|
+
className={cn("[&>svg]:h-3.5 [&>svg]:w-3.5", className)}
|
|
102
|
+
{...props}
|
|
103
|
+
>
|
|
104
|
+
{children || (
|
|
105
|
+
<svg
|
|
106
|
+
className="h-4 w-4"
|
|
107
|
+
fill="none"
|
|
108
|
+
viewBox="0 0 24 24"
|
|
109
|
+
stroke="currentColor"
|
|
110
|
+
strokeWidth={2}
|
|
111
|
+
>
|
|
112
|
+
<path strokeLinecap="round" strokeLinejoin="round" d="M9 5l7 7-7 7" />
|
|
113
|
+
</svg>
|
|
114
|
+
)}
|
|
115
|
+
</li>
|
|
116
|
+
);
|
|
117
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
118
118
|
|
|
119
119
|
const BreadcrumbEllipsis = ({
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
122
|
}: React.HTMLAttributes<HTMLSpanElement>) => (
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
)
|
|
137
|
-
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis"
|
|
123
|
+
<span
|
|
124
|
+
role="presentation"
|
|
125
|
+
aria-hidden="true"
|
|
126
|
+
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
|
127
|
+
{...props}
|
|
128
|
+
>
|
|
129
|
+
<svg className="h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
|
|
130
|
+
<circle cx="12" cy="12" r="1" />
|
|
131
|
+
<circle cx="19" cy="12" r="1" />
|
|
132
|
+
<circle cx="5" cy="12" r="1" />
|
|
133
|
+
</svg>
|
|
134
|
+
<span className="sr-only">More</span>
|
|
135
|
+
</span>
|
|
136
|
+
);
|
|
137
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
138
138
|
|
|
139
139
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
140
|
+
Breadcrumb,
|
|
141
|
+
BreadcrumbList,
|
|
142
|
+
BreadcrumbItem,
|
|
143
|
+
BreadcrumbLink,
|
|
144
|
+
BreadcrumbPage,
|
|
145
|
+
BreadcrumbSeparator,
|
|
146
|
+
BreadcrumbEllipsis,
|
|
147
|
+
};
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
4
6
|
|
|
5
7
|
const buttonGroupVariants = cva("inline-flex", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
variants: {
|
|
9
|
+
orientation: {
|
|
10
|
+
horizontal: "flex-row",
|
|
11
|
+
vertical: "flex-col",
|
|
12
|
+
},
|
|
13
|
+
attached: {
|
|
14
|
+
true: "",
|
|
15
|
+
false: "gap-2",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
compoundVariants: [
|
|
19
|
+
{
|
|
20
|
+
orientation: "horizontal",
|
|
21
|
+
attached: true,
|
|
22
|
+
className:
|
|
23
|
+
"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px",
|
|
15
24
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
orientation: "vertical",
|
|
25
|
-
attached: true,
|
|
26
|
-
className:
|
|
27
|
-
"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px",
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
defaultVariants: {
|
|
31
|
-
orientation: "horizontal",
|
|
32
|
-
attached: true,
|
|
25
|
+
{
|
|
26
|
+
orientation: "vertical",
|
|
27
|
+
attached: true,
|
|
28
|
+
className:
|
|
29
|
+
"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px",
|
|
33
30
|
},
|
|
34
|
-
|
|
31
|
+
],
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
orientation: "horizontal",
|
|
34
|
+
attached: true,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
35
37
|
|
|
36
38
|
interface ButtonGroupProps
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
extends
|
|
40
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
41
|
+
VariantProps<typeof buttonGroupVariants> {}
|
|
39
42
|
|
|
40
43
|
/**
|
|
41
44
|
* ButtonGroup to group buttons together
|
|
42
|
-
*
|
|
45
|
+
*
|
|
43
46
|
* @example
|
|
44
47
|
* <ButtonGroup>
|
|
45
48
|
* <Button>Left</Button>
|
|
@@ -48,17 +51,20 @@ interface ButtonGroupProps
|
|
|
48
51
|
* </ButtonGroup>
|
|
49
52
|
*/
|
|
50
53
|
const ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
({ className, orientation, attached, ...props }, ref) => {
|
|
55
|
+
return (
|
|
56
|
+
<div
|
|
57
|
+
ref={ref}
|
|
58
|
+
role="group"
|
|
59
|
+
className={cn(
|
|
60
|
+
buttonGroupVariants({ orientation, attached }),
|
|
61
|
+
className,
|
|
62
|
+
)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
);
|
|
68
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
63
69
|
|
|
64
|
-
export { ButtonGroup, buttonGroupVariants }
|
|
70
|
+
export { ButtonGroup, buttonGroupVariants };
|
package/src/registry/ui/card.tsx
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Card component - Container with header, content, and footer
|
|
6
|
-
*
|
|
8
|
+
*
|
|
7
9
|
* @example
|
|
8
10
|
* <Card>
|
|
9
11
|
* <CardHeader>
|
|
@@ -15,74 +17,82 @@ import { cn } from "@/lib/utils"
|
|
|
15
17
|
* </Card>
|
|
16
18
|
*/
|
|
17
19
|
|
|
18
|
-
const Card = React.forwardRef<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
const Card = React.forwardRef<
|
|
21
|
+
HTMLDivElement,
|
|
22
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
23
|
+
>(({ className, ...props }, ref) => (
|
|
24
|
+
<div
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={cn(
|
|
27
|
+
"rounded-xl border bg-card text-card-foreground shadow",
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
));
|
|
33
|
+
Card.displayName = "Card";
|
|
31
34
|
|
|
32
35
|
const CardHeader = React.forwardRef<
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
HTMLDivElement,
|
|
37
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
35
38
|
>(({ className, ...props }, ref) => (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
))
|
|
42
|
-
CardHeader.displayName = "CardHeader"
|
|
39
|
+
<div
|
|
40
|
+
ref={ref}
|
|
41
|
+
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
));
|
|
45
|
+
CardHeader.displayName = "CardHeader";
|
|
43
46
|
|
|
44
47
|
const CardTitle = React.forwardRef<
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
HTMLHeadingElement,
|
|
49
|
+
React.HTMLAttributes<HTMLHeadingElement>
|
|
47
50
|
>(({ className, ...props }, ref) => (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
))
|
|
54
|
-
CardTitle.displayName = "CardTitle"
|
|
51
|
+
<h3
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={cn("font-semibold leading-none tracking-tight", className)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
));
|
|
57
|
+
CardTitle.displayName = "CardTitle";
|
|
55
58
|
|
|
56
59
|
const CardDescription = React.forwardRef<
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
HTMLParagraphElement,
|
|
61
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
59
62
|
>(({ className, ...props }, ref) => (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
))
|
|
66
|
-
CardDescription.displayName = "CardDescription"
|
|
63
|
+
<p
|
|
64
|
+
ref={ref}
|
|
65
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
));
|
|
69
|
+
CardDescription.displayName = "CardDescription";
|
|
67
70
|
|
|
68
71
|
const CardContent = React.forwardRef<
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
HTMLDivElement,
|
|
73
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
71
74
|
>(({ className, ...props }, ref) => (
|
|
72
|
-
|
|
73
|
-
))
|
|
74
|
-
CardContent.displayName = "CardContent"
|
|
75
|
+
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
76
|
+
));
|
|
77
|
+
CardContent.displayName = "CardContent";
|
|
75
78
|
|
|
76
79
|
const CardFooter = React.forwardRef<
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
HTMLDivElement,
|
|
81
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
79
82
|
>(({ className, ...props }, ref) => (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
))
|
|
86
|
-
CardFooter.displayName = "CardFooter"
|
|
83
|
+
<div
|
|
84
|
+
ref={ref}
|
|
85
|
+
className={cn("flex items-center p-6 pt-0", className)}
|
|
86
|
+
{...props}
|
|
87
|
+
/>
|
|
88
|
+
));
|
|
89
|
+
CardFooter.displayName = "CardFooter";
|
|
87
90
|
|
|
88
|
-
export {
|
|
91
|
+
export {
|
|
92
|
+
Card,
|
|
93
|
+
CardHeader,
|
|
94
|
+
CardFooter,
|
|
95
|
+
CardTitle,
|
|
96
|
+
CardDescription,
|
|
97
|
+
CardContent,
|
|
98
|
+
};
|
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
4
6
|
|
|
5
7
|
const containerVariants = cva("mx-auto w-full px-4", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
size: "xl",
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
sm: "max-w-screen-sm",
|
|
11
|
+
md: "max-w-screen-md",
|
|
12
|
+
lg: "max-w-screen-lg",
|
|
13
|
+
xl: "max-w-screen-xl",
|
|
14
|
+
"2xl": "max-w-screen-2xl",
|
|
15
|
+
full: "max-w-full",
|
|
18
16
|
},
|
|
19
|
-
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: "xl",
|
|
20
|
+
},
|
|
21
|
+
});
|
|
20
22
|
|
|
21
23
|
interface ContainerProps
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
extends
|
|
25
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
26
|
+
VariantProps<typeof containerVariants> {}
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* Container for max-width layouts
|
|
27
|
-
*
|
|
30
|
+
*
|
|
28
31
|
* @example
|
|
29
32
|
* <Container size="lg">Content</Container>
|
|
30
33
|
*/
|
|
31
34
|
const Container = React.forwardRef<HTMLDivElement, ContainerProps>(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
Container.displayName = "Container"
|
|
35
|
+
({ className, size, ...props }, ref) => {
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
ref={ref}
|
|
39
|
+
className={cn(containerVariants({ size }), className)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
Container.displayName = "Container";
|
|
43
46
|
|
|
44
|
-
export { Container, containerVariants }
|
|
47
|
+
export { Container, containerVariants };
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
2
4
|
|
|
3
5
|
interface EmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
icon?: React.ElementType;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
action?: React.ReactNode;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export function EmptyState({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
icon: Icon,
|
|
14
|
+
title,
|
|
15
|
+
description,
|
|
16
|
+
action,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
17
19
|
}: EmptyStateProps) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</div>
|
|
30
|
-
)}
|
|
31
|
-
<h3 className="text-lg font-semibold tracking-tight">{title}</h3>
|
|
32
|
-
<p className="text-muted-foreground text-sm max-w-sm mt-2 mb-6">
|
|
33
|
-
{description}
|
|
34
|
-
</p>
|
|
35
|
-
{action && <div>{action}</div>}
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
className={cn(
|
|
23
|
+
"flex flex-col items-center justify-center py-12 text-center border-2 border-dashed rounded-lg bg-muted/5",
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
>
|
|
28
|
+
{Icon && (
|
|
29
|
+
<div className="flex h-20 w-20 items-center justify-center rounded-full bg-muted/50 mb-4">
|
|
30
|
+
<Icon className="h-10 w-10 text-muted-foreground" />
|
|
36
31
|
</div>
|
|
37
|
-
|
|
32
|
+
)}
|
|
33
|
+
<h3 className="text-lg font-semibold tracking-tight">{title}</h3>
|
|
34
|
+
<p className="text-muted-foreground text-sm max-w-sm mt-2 mb-6">
|
|
35
|
+
{description}
|
|
36
|
+
</p>
|
|
37
|
+
{action && <div>{action}</div>}
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
38
40
|
}
|