@srcroot/ui 0.0.55 → 0.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -151
- package/dist/index.d.ts +0 -0
- package/dist/index.js +120 -93
- package/package.json +7 -2
- package/src/registry/analytics/google-analytics.tsx +36 -39
- package/src/registry/analytics/google-tag-manager.tsx +62 -65
- package/src/registry/analytics/meta-pixel.tsx +44 -47
- package/src/registry/analytics/microsoft-clarity.tsx +31 -34
- package/src/registry/analytics/tiktok-pixel.tsx +34 -37
- package/src/registry/lib/utils.ts +0 -0
- package/src/registry/themes/v3/blue.css +157 -157
- package/src/registry/themes/v3/glass.css +153 -153
- package/src/registry/themes/v3/gray.css +157 -157
- package/src/registry/themes/v3/green.css +157 -157
- package/src/registry/themes/v3/neutral.css +157 -157
- package/src/registry/themes/v3/orange.css +157 -157
- package/src/registry/themes/v3/rose.css +157 -157
- package/src/registry/themes/v3/slate.css +157 -157
- package/src/registry/themes/v3/stone.css +157 -157
- package/src/registry/themes/v3/violet.css +186 -186
- package/src/registry/themes/v3/zinc.css +157 -157
- package/src/registry/themes/v4/blue.css +184 -184
- package/src/registry/themes/v4/glass.css +180 -180
- package/src/registry/themes/v4/gray.css +184 -184
- package/src/registry/themes/v4/green.css +184 -184
- package/src/registry/themes/v4/neutral.css +184 -184
- package/src/registry/themes/v4/orange.css +184 -184
- package/src/registry/themes/v4/rose.css +184 -184
- package/src/registry/themes/v4/slate.css +184 -184
- package/src/registry/themes/v4/stone.css +184 -184
- package/src/registry/themes/v4/violet.css +184 -184
- package/src/registry/themes/v4/zinc.css +184 -184
- package/src/registry/ui/accordion.tsx +164 -165
- package/src/registry/ui/alert-dialog.tsx +213 -214
- package/src/registry/ui/alert.tsx +73 -76
- package/src/registry/ui/aspect-ratio.tsx +44 -47
- package/src/registry/ui/avatar.tsx +96 -97
- package/src/registry/ui/badge.tsx +52 -55
- package/src/registry/ui/breadcrumb.tsx +147 -150
- package/src/registry/ui/button-group.tsx +64 -67
- package/src/registry/ui/button.tsx +71 -72
- package/src/registry/ui/calendar.tsx +514 -515
- package/src/registry/ui/card.tsx +88 -91
- package/src/registry/ui/carousel.tsx +214 -214
- package/src/registry/ui/chart.tsx +373 -373
- package/src/registry/ui/chatbot.tsx +86 -13
- package/src/registry/ui/checkbox.tsx +93 -94
- package/src/registry/ui/collapsible.tsx +107 -108
- package/src/registry/ui/combobox.tsx +171 -171
- package/src/registry/ui/command.tsx +300 -300
- package/src/registry/ui/container.tsx +44 -47
- package/src/registry/ui/context-menu.tsx +221 -221
- package/src/registry/ui/date-picker.tsx +228 -228
- package/src/registry/ui/dialog.tsx +269 -270
- package/src/registry/ui/drawer.tsx +10 -4
- package/src/registry/ui/dropdown-menu.tsx +529 -530
- package/src/registry/ui/empty-state.tsx +0 -2
- package/src/registry/ui/file-upload.tsx +0 -0
- package/src/registry/ui/floating-dock.tsx +0 -0
- package/src/registry/ui/form-field.tsx +91 -94
- package/src/registry/ui/google-analytics.tsx +38 -0
- package/src/registry/ui/google-tag-manager.tsx +64 -0
- package/src/registry/ui/hover-card.tsx +223 -223
- package/src/registry/ui/image.tsx +144 -147
- package/src/registry/ui/input-group.tsx +82 -85
- package/src/registry/ui/input.tsx +125 -125
- package/src/registry/ui/kbd.tsx +60 -63
- package/src/registry/ui/label.tsx +36 -37
- package/src/registry/ui/loading-spinner.tsx +108 -111
- package/src/registry/ui/map.tsx +0 -0
- package/src/registry/ui/marquee.tsx +2 -0
- package/src/registry/ui/menubar.tsx +246 -246
- package/src/registry/ui/meta-pixel.tsx +46 -0
- package/src/registry/ui/microsoft-clarity.tsx +33 -0
- package/src/registry/ui/native-select.tsx +49 -52
- package/src/registry/ui/otp-input.tsx +163 -155
- package/src/registry/ui/pagination.tsx +149 -152
- package/src/registry/ui/patterns.tsx +28 -0
- package/src/registry/ui/popover.tsx +226 -227
- package/src/registry/ui/progress.tsx +51 -52
- package/src/registry/ui/radio.tsx +99 -102
- package/src/registry/ui/resizable.tsx +314 -314
- package/src/registry/ui/scroll-animation.tsx +45 -0
- package/src/registry/ui/scroll-area.tsx +121 -122
- package/src/registry/ui/scroll-to-top.tsx +0 -0
- package/src/registry/ui/search.tsx +162 -150
- package/src/registry/ui/select.tsx +292 -293
- package/src/registry/ui/separator.tsx +46 -47
- package/src/registry/ui/sheet.tsx +6 -3
- package/src/registry/ui/sidebar.tsx +628 -628
- package/src/registry/ui/skeleton.tsx +26 -29
- package/src/registry/ui/slider.tsx +196 -197
- package/src/registry/ui/slot.tsx +69 -72
- package/src/registry/ui/star-rating.tsx +146 -134
- package/src/registry/ui/switch.tsx +72 -73
- package/src/registry/ui/table-of-contents.tsx +96 -96
- package/src/registry/ui/table.tsx +138 -139
- package/src/registry/ui/tabs.tsx +124 -125
- package/src/registry/ui/text.tsx +61 -64
- package/src/registry/ui/textarea.tsx +41 -42
- package/src/registry/ui/theme-switcher.tsx +66 -66
- package/src/registry/ui/tiktok-pixel.tsx +36 -0
- package/src/registry/ui/toast.tsx +97 -98
- package/src/registry/ui/toggle-group.tsx +129 -129
- package/src/registry/ui/toggle.tsx +72 -72
- package/src/registry/ui/tooltip.tsx +143 -144
- package/src/registry/ui/whatsapp.tsx +0 -0
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export { AspectRatio }
|
|
47
|
-
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "@/lib/utils"
|
|
3
|
+
|
|
4
|
+
interface AspectRatioProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* The aspect ratio (width / height)
|
|
7
|
+
* @default 1
|
|
8
|
+
*/
|
|
9
|
+
ratio?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* AspectRatio component to maintain consistent dimensions
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // 16:9 video aspect ratio
|
|
17
|
+
* <AspectRatio ratio={16 / 9}>
|
|
18
|
+
* <img src="..." className="object-cover w-full h-full" />
|
|
19
|
+
* </AspectRatio>
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Square
|
|
23
|
+
* <AspectRatio ratio={1}>
|
|
24
|
+
* <div className="bg-muted" />
|
|
25
|
+
* </AspectRatio>
|
|
26
|
+
*/
|
|
27
|
+
const AspectRatio = React.forwardRef<HTMLDivElement, AspectRatioProps>(
|
|
28
|
+
({ className, ratio = 1, style, children, ...props }, ref) => (
|
|
29
|
+
<div
|
|
30
|
+
ref={ref}
|
|
31
|
+
className={cn("relative w-full", className)}
|
|
32
|
+
style={{
|
|
33
|
+
paddingBottom: `${100 / ratio}%`,
|
|
34
|
+
...style,
|
|
35
|
+
}}
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
<div className="absolute inset-0">{children}</div>
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
)
|
|
42
|
+
AspectRatio.displayName = "AspectRatio"
|
|
43
|
+
|
|
44
|
+
export { AspectRatio }
|
|
@@ -1,97 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
const avatarVariants = cva(
|
|
8
|
-
"relative flex shrink-0 overflow-hidden rounded-full",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
size: {
|
|
12
|
-
sm: "h-8 w-8 text-xs",
|
|
13
|
-
default: "h-10 w-10 text-sm",
|
|
14
|
-
lg: "h-12 w-12 text-base",
|
|
15
|
-
xl: "h-16 w-16 text-lg",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: {
|
|
19
|
-
size: "default",
|
|
20
|
-
},
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
type AvatarVariants = VariantProps<typeof avatarVariants>
|
|
25
|
-
|
|
26
|
-
interface AvatarProps extends AvatarVariants {
|
|
27
|
-
className?: string
|
|
28
|
-
children?: React.ReactNode
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Avatar component with image and fallback
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* <Avatar>
|
|
36
|
-
* <AvatarImage src="/avatar.jpg" alt="User" />
|
|
37
|
-
* <AvatarFallback>JD</AvatarFallback>
|
|
38
|
-
* </Avatar>
|
|
39
|
-
*/
|
|
40
|
-
const Avatar = React.forwardRef<HTMLSpanElement, AvatarProps>(
|
|
41
|
-
({ className, size, ...props }, ref) => (
|
|
42
|
-
<span
|
|
43
|
-
ref={ref}
|
|
44
|
-
className={cn(avatarVariants({ size, className }))}
|
|
45
|
-
{...props}
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
)
|
|
49
|
-
Avatar.displayName = "Avatar"
|
|
50
|
-
|
|
51
|
-
interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
52
|
-
onLoadingStatusChange?: (status: "loading" | "loaded" | "error") => void
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const AvatarImage = React.forwardRef<HTMLImageElement, AvatarImageProps>(
|
|
56
|
-
({ className, onLoadingStatusChange, ...props }, ref) => {
|
|
57
|
-
const [status, setStatus] = React.useState<"loading" | "loaded" | "error">("loading")
|
|
58
|
-
|
|
59
|
-
React.useEffect(() => {
|
|
60
|
-
onLoadingStatusChange?.(status)
|
|
61
|
-
}, [status, onLoadingStatusChange])
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<img
|
|
65
|
-
ref={ref}
|
|
66
|
-
className={cn(
|
|
67
|
-
"aspect-square h-full w-full object-cover",
|
|
68
|
-
status === "loading" && "opacity-0",
|
|
69
|
-
status === "error" && "hidden",
|
|
70
|
-
className
|
|
71
|
-
)}
|
|
72
|
-
onLoad={() => setStatus("loaded")}
|
|
73
|
-
onError={() => setStatus("error")}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
AvatarImage.displayName = "AvatarImage"
|
|
80
|
-
|
|
81
|
-
const AvatarFallback = React.forwardRef<
|
|
82
|
-
HTMLSpanElement,
|
|
83
|
-
React.HTMLAttributes<HTMLSpanElement>
|
|
84
|
-
>(({ className, ...props }, ref) => (
|
|
85
|
-
<span
|
|
86
|
-
ref={ref}
|
|
87
|
-
className={cn(
|
|
88
|
-
"flex h-full w-full items-center justify-center rounded-full bg-muted font-medium",
|
|
89
|
-
className
|
|
90
|
-
)}
|
|
91
|
-
{...props}
|
|
92
|
-
/>
|
|
93
|
-
))
|
|
94
|
-
AvatarFallback.displayName = "AvatarFallback"
|
|
95
|
-
|
|
96
|
-
export { Avatar, AvatarImage, AvatarFallback, avatarVariants }
|
|
97
|
-
|
|
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"
|
|
6
|
+
|
|
7
|
+
const avatarVariants = cva(
|
|
8
|
+
"relative flex shrink-0 overflow-hidden rounded-full",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
sm: "h-8 w-8 text-xs",
|
|
13
|
+
default: "h-10 w-10 text-sm",
|
|
14
|
+
lg: "h-12 w-12 text-base",
|
|
15
|
+
xl: "h-16 w-16 text-lg",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: "default",
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
type AvatarVariants = VariantProps<typeof avatarVariants>
|
|
25
|
+
|
|
26
|
+
interface AvatarProps extends AvatarVariants {
|
|
27
|
+
className?: string
|
|
28
|
+
children?: React.ReactNode
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Avatar component with image and fallback
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <Avatar>
|
|
36
|
+
* <AvatarImage src="/avatar.jpg" alt="User" />
|
|
37
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
38
|
+
* </Avatar>
|
|
39
|
+
*/
|
|
40
|
+
const Avatar = React.forwardRef<HTMLSpanElement, AvatarProps>(
|
|
41
|
+
({ className, size, ...props }, ref) => (
|
|
42
|
+
<span
|
|
43
|
+
ref={ref}
|
|
44
|
+
className={cn(avatarVariants({ size, className }))}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
Avatar.displayName = "Avatar"
|
|
50
|
+
|
|
51
|
+
interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
52
|
+
onLoadingStatusChange?: (status: "loading" | "loaded" | "error") => void
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const AvatarImage = React.forwardRef<HTMLImageElement, AvatarImageProps>(
|
|
56
|
+
({ className, onLoadingStatusChange, ...props }, ref) => {
|
|
57
|
+
const [status, setStatus] = React.useState<"loading" | "loaded" | "error">("loading")
|
|
58
|
+
|
|
59
|
+
React.useEffect(() => {
|
|
60
|
+
onLoadingStatusChange?.(status)
|
|
61
|
+
}, [status, onLoadingStatusChange])
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<img
|
|
65
|
+
ref={ref}
|
|
66
|
+
className={cn(
|
|
67
|
+
"aspect-square h-full w-full object-cover",
|
|
68
|
+
status === "loading" && "opacity-0",
|
|
69
|
+
status === "error" && "hidden",
|
|
70
|
+
className
|
|
71
|
+
)}
|
|
72
|
+
onLoad={() => setStatus("loaded")}
|
|
73
|
+
onError={() => setStatus("error")}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
AvatarImage.displayName = "AvatarImage"
|
|
80
|
+
|
|
81
|
+
const AvatarFallback = React.forwardRef<
|
|
82
|
+
HTMLSpanElement,
|
|
83
|
+
React.HTMLAttributes<HTMLSpanElement>
|
|
84
|
+
>(({ className, ...props }, ref) => (
|
|
85
|
+
<span
|
|
86
|
+
ref={ref}
|
|
87
|
+
className={cn(
|
|
88
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted font-medium",
|
|
89
|
+
className
|
|
90
|
+
)}
|
|
91
|
+
{...props}
|
|
92
|
+
/>
|
|
93
|
+
))
|
|
94
|
+
AvatarFallback.displayName = "AvatarFallback"
|
|
95
|
+
|
|
96
|
+
export { Avatar, AvatarImage, AvatarFallback, avatarVariants }
|
|
@@ -1,55 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"border-transparent bg-
|
|
14
|
-
|
|
15
|
-
"border-transparent bg-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Badge
|
|
53
|
-
|
|
54
|
-
export { Badge, badgeVariants }
|
|
55
|
-
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const badgeVariants = cva(
|
|
6
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default:
|
|
11
|
+
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
12
|
+
secondary:
|
|
13
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
14
|
+
destructive:
|
|
15
|
+
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
16
|
+
outline: "text-foreground",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "default",
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
interface BadgeProps
|
|
26
|
+
extends React.HTMLAttributes<HTMLSpanElement>,
|
|
27
|
+
VariantProps<typeof badgeVariants> { }
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Badge component for status indicators
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Default badge
|
|
34
|
+
* <Badge>New</Badge>
|
|
35
|
+
*
|
|
36
|
+
* // Destructive variant
|
|
37
|
+
* <Badge variant="destructive">Error</Badge>
|
|
38
|
+
*/
|
|
39
|
+
const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(
|
|
40
|
+
({ className, variant, ...props }, ref) => {
|
|
41
|
+
return (
|
|
42
|
+
<span
|
|
43
|
+
ref={ref}
|
|
44
|
+
className={cn(badgeVariants({ variant }), className)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
Badge.displayName = "Badge"
|
|
51
|
+
|
|
52
|
+
export { Badge, badgeVariants }
|