@catalystsoftware/ui 1.0.5 → 1.0.6
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/data/data.tsx +29 -29
- package/dist/data/tailwind.config.js +3821 -261
- package/dist/data.tsx +29 -29
- package/package.json +4 -3
- package/components/catalyst-ui/buttons/burger.tsx +0 -207
- package/components/catalyst-ui/core/data-display/timeline.tsx +0 -210
- package/components/catalyst-ui/core/feedback/alert.tsx +0 -491
- package/components/catalyst-ui/core/feedback/spinner-1.tsx +0 -65
- package/components/catalyst-ui/core/feedback/toast.tsx +0 -1857
- package/components/catalyst-ui/core/navigation/menu.tsx +0 -164
- package/components/catalyst-ui/forms/toggle-class.tsx +0 -176
- package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +0 -419
- package/components/catalyst-ui/hooks/use-counter.tsx +0 -13
- package/components/catalyst-ui/hooks/use-event-listener.tsx +0 -23
- package/components/catalyst-ui/hooks/use-export-markdown.tsx +0 -47
- package/components/catalyst-ui/hooks/use-focus.tsx +0 -17
- package/components/catalyst-ui/hooks/use-interval.tsx +0 -23
- package/components/catalyst-ui/hooks/use-is-client.tsx +0 -16
- package/components/catalyst-ui/hooks/use-media-query.tsx +0 -19
- package/components/catalyst-ui/hooks/use-mobile.tsx +0 -19
- package/components/catalyst-ui/hooks/use-resize-observer.tsx +0 -81
- package/components/catalyst-ui/hooks/use-timeout.tsx +0 -21
- package/components/catalyst-ui/hooks/use-timer.tsx +0 -209
- package/components/catalyst-ui/hooks/use-toggle.tsx +0 -12
- package/components/catalyst-ui/media/image.tsx +0 -13
- package/components/catalyst-ui/overlays/dual-sidebar.tsx +0 -4142
- package/components/catalyst-ui/overlays/sidebar-original.tsx +0 -726
- package/components/catalyst-ui/primitives/accordion.tsx +0 -250
- package/components/catalyst-ui/primitives/alert-dialog.tsx +0 -126
- package/components/catalyst-ui/primitives/aspect-ratio.tsx +0 -9
- package/components/catalyst-ui/primitives/avatar.tsx +0 -296
- package/components/catalyst-ui/primitives/badge.tsx +0 -57
- package/components/catalyst-ui/primitives/breadcrumb.tsx +0 -101
- package/components/catalyst-ui/primitives/button.tsx +0 -265
- package/components/catalyst-ui/primitives/calendar-v4.tsx +0 -208
- package/components/catalyst-ui/primitives/calendar.tsx +0 -295
- package/components/catalyst-ui/primitives/card.tsx +0 -618
- package/components/catalyst-ui/primitives/carousel.tsx +0 -238
- package/components/catalyst-ui/primitives/chart.tsx +0 -347
- package/components/catalyst-ui/primitives/checkbox.tsx +0 -225
- package/components/catalyst-ui/primitives/collapsible.tsx +0 -212
- package/components/catalyst-ui/primitives/command.tsx +0 -393
- package/components/catalyst-ui/primitives/context-menu.tsx +0 -236
- package/components/catalyst-ui/primitives/dialog.tsx +0 -471
- package/components/catalyst-ui/primitives/drawer.tsx +0 -761
- package/components/catalyst-ui/primitives/dropdown-menu.tsx +0 -290
- package/components/catalyst-ui/primitives/empty.tsx +0 -104
- package/components/catalyst-ui/primitives/field.tsx +0 -244
- package/components/catalyst-ui/primitives/hover-card.tsx +0 -124
- package/components/catalyst-ui/primitives/input-otp.tsx +0 -76
- package/components/catalyst-ui/primitives/input.tsx +0 -64
- package/components/catalyst-ui/primitives/item.tsx +0 -196
- package/components/catalyst-ui/primitives/kbd.tsx +0 -75
- package/components/catalyst-ui/primitives/label.tsx +0 -24
- package/components/catalyst-ui/primitives/navigation-menu.tsx +0 -150
- package/components/catalyst-ui/primitives/pagination.tsx +0 -198
- package/components/catalyst-ui/primitives/popover.tsx +0 -232
- package/components/catalyst-ui/primitives/progress.tsx +0 -34
- package/components/catalyst-ui/primitives/radio-group.tsx +0 -43
- package/components/catalyst-ui/primitives/resizable.tsx +0 -56
- package/components/catalyst-ui/primitives/select.tsx +0 -155
- package/components/catalyst-ui/primitives/separator.tsx +0 -74
- package/components/catalyst-ui/primitives/sheet.tsx +0 -126
- package/components/catalyst-ui/primitives/skeleton.tsx +0 -15
- package/components/catalyst-ui/primitives/slider.tsx +0 -27
- package/components/catalyst-ui/primitives/switch.tsx +0 -187
- package/components/catalyst-ui/primitives/tabs.tsx +0 -335
- package/components/catalyst-ui/primitives/textarea.tsx +0 -24
- package/components/catalyst-ui/primitives/toggle-group.tsx +0 -55
- package/components/catalyst-ui/primitives/toggle.tsx +0 -42
- package/components/catalyst-ui/primitives/tooltip.tsx +0 -116
- package/components/catalyst-ui/utils/basic-auth.tsx +0 -40
- package/components/catalyst-ui/utils/context-storage.tsx +0 -19
- package/components/catalyst-ui/utils/cors-middleware.tsx +0 -71
- package/components/catalyst-ui/utils/deferred-content.tsx +0 -595
- package/components/catalyst-ui/utils/honeypot-middleware.tsx +0 -38
- package/components/catalyst-ui/utils/incId.tsx +0 -75
- package/components/catalyst-ui/utils/jwk-auth.tsx +0 -36
- package/components/catalyst-ui/utils/request-id.tsx +0 -14
- package/components/catalyst-ui/utils/secure-headers.tsx +0 -37
- package/components/catalyst-ui/utils/server-timing.tsx +0 -23
- package/components/catalyst-ui/utils/utils.ts +0 -43
- package/components/catalyst-ui/utils/with-cookie.tsx +0 -43
- package/components/catalyst-ui/x/accordian-x.tsx +0 -428
- package/components/catalyst-ui/x/alert-x.tsx +0 -413
- package/components/catalyst-ui/x/animated-text-x.tsx +0 -2242
- package/components/catalyst-ui/x/avatar-x.tsx +0 -515
- package/components/catalyst-ui/x/badge-x.tsx +0 -670
- package/components/catalyst-ui/x/button-X.tsx +0 -2857
- package/components/catalyst-ui/x/button-group-x.tsx +0 -847
- package/components/catalyst-ui/x/calendar-x.tsx +0 -1910
- package/components/catalyst-ui/x/card-x.tsx +0 -2597
- package/components/catalyst-ui/x/checkbox-x.tsx +0 -656
- package/components/catalyst-ui/x/collapsible-x.tsx +0 -1360
- package/components/catalyst-ui/x/combobox-x.tsx +0 -911
- package/components/catalyst-ui/x/data-table-x.tsx +0 -1753
- package/components/catalyst-ui/x/date-picker-x.tsx +0 -648
- package/components/catalyst-ui/x/dialog-x.tsx +0 -659
- package/components/catalyst-ui/x/dropdown-menu-x.tsx +0 -612
- package/components/catalyst-ui/x/hover-card-x.tsx +0 -375
- package/components/catalyst-ui/x/icon-x.tsx +0 -840
- package/components/catalyst-ui/x/input-mask-x.tsx +0 -981
- package/components/catalyst-ui/x/input-otp-x.tsx +0 -659
- package/components/catalyst-ui/x/loader-x.tsx +0 -1757
- package/components/catalyst-ui/x/pagination-x.tsx +0 -622
- package/components/catalyst-ui/x/popover-x.tsx +0 -744
- package/components/catalyst-ui/x/radio-group-x.tsx +0 -499
- package/components/catalyst-ui/x/select-x.tsx +0 -1127
- package/components/catalyst-ui/x/sheet-x.tsx +0 -668
- package/components/catalyst-ui/x/switch-x.tsx +0 -681
- package/components/catalyst-ui/x/table-x.tsx +0 -574
- package/components/catalyst-ui/x/tabs-x.tsx +0 -839
- package/components/catalyst-ui/x/textarea-x.tsx +0 -1263
- package/components/catalyst-ui/x/tooltip-x.tsx +0 -396
- package/components/catalyst-ui/x/tracker-x.tsx +0 -560
- package/data/bg-data.tsx +0 -901
- package/data/buttons-data.tsx +0 -2327
- package/data/charts-data.tsx +0 -102
- package/data/chat-data.tsx +0 -83
- package/data/code-data.tsx +0 -1040
- package/data/comboboxes-data.tsx +0 -1843
- package/data/command-data.tsx +0 -1381
- package/data/core-data.tsx +0 -15953
- package/data/crm-data.tsx +0 -47
- package/data/data.tsx +0 -159
- package/data/date-and-time-data.tsx +0 -554
- package/data/dependencies.tsx +0 -7
- package/data/ecommerce-data.tsx +0 -1387
- package/data/forms-data.tsx +0 -7890
- package/data/hooks-data.tsx +0 -5487
- package/data/index.ts +0 -34
- package/data/inputs-data.tsx +0 -557
- package/data/interactive-data.tsx +0 -5394
- package/data/lofi-data.tsx +0 -18295
- package/data/marketing-data.tsx +0 -2546
- package/data/media-data.tsx +0 -1510
- package/data/motion-data.tsx +0 -5801
- package/data/overlay-data.tsx +0 -4136
- package/data/pdf-data.tsx +0 -124
- package/data/pos-data.tsx +0 -213
- package/data/postcss.config.js +0 -6
- package/data/primitive-data.tsx +0 -5170
- package/data/prompt-data.tsx +0 -1226
- package/data/requiredLibs.ts +0 -4
- package/data/sandbox-data.tsx +0 -1
- package/data/sidebars-data.tsx +0 -5421
- package/data/stacks-data.tsx +0 -32
- package/data/table-data.tsx +0 -706
- package/data/tailwind.config.js +0 -270
- package/data/tailwind.config.ngin.js +0 -3830
- package/data/tailwind.css +0 -431
- package/data/tools-data.tsx +0 -6910
- package/data/typography-data.tsx +0 -2050
- package/data/utils-data.tsx +0 -6500
- package/data/x-data.tsx +0 -1171
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
-
import { cn } from "~/components/catalyst-ui"
|
|
5
|
-
import { Avatar, AvatarImage, AvatarFallback, Badge, Button } from "~/components/catalyst-ui"
|
|
6
|
-
import { InfoIcon, CalendarIcon, FileQuestionIcon, ChevronRightIcon } from "lucide-react"
|
|
7
|
-
|
|
8
|
-
const hoverCardContentVariants = cva(
|
|
9
|
-
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
default: "bg-popover text-popover-foreground",
|
|
14
|
-
light: "bg-neutral-200 text-neutral-950 dark:bg-neutral-50",
|
|
15
|
-
error: "bg-destructive text-white border-destructive",
|
|
16
|
-
dark: "bg-neutral-900 text-white dark:bg-neutral-950 border-neutral-800",
|
|
17
|
-
},
|
|
18
|
-
rounded: {
|
|
19
|
-
default: "rounded-md",
|
|
20
|
-
full: "rounded-full",
|
|
21
|
-
none: "rounded-none",
|
|
22
|
-
},
|
|
23
|
-
arrow: {
|
|
24
|
-
true: "",
|
|
25
|
-
false: "[&_svg]:invisible",
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
defaultVariants: {
|
|
29
|
-
variant: "default",
|
|
30
|
-
rounded: "default",
|
|
31
|
-
arrow: true,
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
type HoverCardType = 'default' | 'media' | 'stats' | 'project' | 'alert' | 'tasks'
|
|
37
|
-
|
|
38
|
-
type HoverCardVariantContextValue = VariantProps<typeof hoverCardContentVariants> & {
|
|
39
|
-
align?: 'start' | 'center' | 'end'
|
|
40
|
-
sideOffset?: number
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const HoverCardXContext = React.createContext<HoverCardType>('default')
|
|
44
|
-
const HoverCardVariantContext = React.createContext<HoverCardVariantContextValue>({})
|
|
45
|
-
|
|
46
|
-
export function HoverCardX({
|
|
47
|
-
children,
|
|
48
|
-
hovercard = 'default',
|
|
49
|
-
variant,
|
|
50
|
-
rounded,
|
|
51
|
-
arrow,
|
|
52
|
-
align = "center",
|
|
53
|
-
sideOffset = 4,
|
|
54
|
-
...props
|
|
55
|
-
}: HoverCardPrimitive.HoverCardProps & { hovercard?: HoverCardType } & HoverCardVariantContextValue) {
|
|
56
|
-
return (
|
|
57
|
-
<HoverCardXContext.Provider value={hovercard}>
|
|
58
|
-
<HoverCardVariantContext.Provider value={{ variant, rounded, arrow, align, sideOffset }}>
|
|
59
|
-
<HoverCardPrimitive.Root {...props}>
|
|
60
|
-
{children}
|
|
61
|
-
</HoverCardPrimitive.Root>
|
|
62
|
-
</HoverCardVariantContext.Provider>
|
|
63
|
-
</HoverCardXContext.Provider>
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function HoverCardXTrigger({ children, ...props }: any) {
|
|
68
|
-
const hovercardType = React.useContext(HoverCardXContext)
|
|
69
|
-
|
|
70
|
-
switch (hovercardType) {
|
|
71
|
-
default:
|
|
72
|
-
return (
|
|
73
|
-
<HoverCardPrimitive.Trigger {...props}>
|
|
74
|
-
{children}
|
|
75
|
-
</HoverCardPrimitive.Trigger>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function HoverCardXContent({ children, className, ...props }: any) {
|
|
81
|
-
const hovercardType = React.useContext(HoverCardXContext)
|
|
82
|
-
const { variant, rounded, arrow, align, sideOffset } = React.useContext(HoverCardVariantContext)
|
|
83
|
-
|
|
84
|
-
switch (hovercardType) {
|
|
85
|
-
case 'media':
|
|
86
|
-
return (
|
|
87
|
-
<HoverCardPrimitive.Content
|
|
88
|
-
align={align}
|
|
89
|
-
sideOffset={sideOffset}
|
|
90
|
-
className={cn(
|
|
91
|
-
hoverCardContentVariants({ variant, rounded, arrow }),
|
|
92
|
-
className
|
|
93
|
-
)}
|
|
94
|
-
{...props}
|
|
95
|
-
>
|
|
96
|
-
<div className='space-y-2'>
|
|
97
|
-
<img
|
|
98
|
-
src={props.image}
|
|
99
|
-
alt={props.imageAlt || 'Content image'}
|
|
100
|
-
className='w-full rounded'
|
|
101
|
-
/>
|
|
102
|
-
<div className='space-y-1'>
|
|
103
|
-
<p className='text-sm font-medium'>{props.title}</p>
|
|
104
|
-
<p className='text-muted-foreground text-xs'>
|
|
105
|
-
{children}
|
|
106
|
-
{props.link && (
|
|
107
|
-
<a
|
|
108
|
-
href={props.link}
|
|
109
|
-
target='_blank'
|
|
110
|
-
rel='noopener noreferrer'
|
|
111
|
-
className='hover:text-foreground flex w-fit underline'
|
|
112
|
-
>
|
|
113
|
-
Read more
|
|
114
|
-
<ChevronRightIcon className='size-4' />
|
|
115
|
-
</a>
|
|
116
|
-
)}
|
|
117
|
-
</p>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
</HoverCardPrimitive.Content>
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
case 'stats':
|
|
124
|
-
return (
|
|
125
|
-
<HoverCardPrimitive.Content
|
|
126
|
-
align={align}
|
|
127
|
-
sideOffset={sideOffset}
|
|
128
|
-
className={cn(
|
|
129
|
-
hoverCardContentVariants({ variant, rounded, arrow }),
|
|
130
|
-
'w-fit',
|
|
131
|
-
className
|
|
132
|
-
)}
|
|
133
|
-
{...props}
|
|
134
|
-
>
|
|
135
|
-
<div className='flex items-center gap-1.5'>
|
|
136
|
-
<div className='flex flex-col gap-1'>
|
|
137
|
-
<div className='text-sm font-medium'>{props.label}</div>
|
|
138
|
-
<div className='text-xl font-semibold'>{props.value}</div>
|
|
139
|
-
<div className='text-muted-foreground text-xs'>{props.subtitle}</div>
|
|
140
|
-
</div>
|
|
141
|
-
{props.avatar && (
|
|
142
|
-
<Avatar className='size-10'>
|
|
143
|
-
<AvatarImage src={props.avatar} alt={props.avatarAlt} />
|
|
144
|
-
<AvatarFallback className='text-xs'>{props.avatarFallback}</AvatarFallback>
|
|
145
|
-
</Avatar>
|
|
146
|
-
)}
|
|
147
|
-
</div>
|
|
148
|
-
</HoverCardPrimitive.Content>
|
|
149
|
-
)
|
|
150
|
-
|
|
151
|
-
case 'project':
|
|
152
|
-
return (
|
|
153
|
-
<HoverCardPrimitive.Content
|
|
154
|
-
align={align}
|
|
155
|
-
sideOffset={sideOffset}
|
|
156
|
-
className={cn(
|
|
157
|
-
hoverCardContentVariants({ variant, rounded, arrow }),
|
|
158
|
-
className
|
|
159
|
-
)}
|
|
160
|
-
{...props}
|
|
161
|
-
>
|
|
162
|
-
<div className='space-y-3'>
|
|
163
|
-
<div className='flex items-center justify-between gap-2 text-sm font-semibold'>
|
|
164
|
-
<span>{props.title}</span>
|
|
165
|
-
<span>{props.progress}%</span>
|
|
166
|
-
</div>
|
|
167
|
-
<div className='bg-secondary relative h-2 w-full overflow-hidden rounded-full'>
|
|
168
|
-
<div
|
|
169
|
-
className='bg-primary h-full transition-all'
|
|
170
|
-
style={{ width: `${props.progress}%` }}
|
|
171
|
-
/>
|
|
172
|
-
</div>
|
|
173
|
-
<p className='text-sm'>{children}</p>
|
|
174
|
-
{props.startDate && (
|
|
175
|
-
<div className='text-muted-foreground flex items-center gap-2 text-xs'>
|
|
176
|
-
<CalendarIcon className='size-4' />
|
|
177
|
-
<span>{props.startDate}</span>
|
|
178
|
-
</div>
|
|
179
|
-
)}
|
|
180
|
-
{props.avatars && props.avatars.length > 0 && (
|
|
181
|
-
<div className='flex -space-x-2'>
|
|
182
|
-
{props.avatars.map((avatar: any, index: number) => (
|
|
183
|
-
<Avatar key={index} className='ring-background ring-2'>
|
|
184
|
-
<AvatarImage src={avatar.src} alt={avatar.name} />
|
|
185
|
-
<AvatarFallback className='text-xs'>{avatar.fallback}</AvatarFallback>
|
|
186
|
-
</Avatar>
|
|
187
|
-
))}
|
|
188
|
-
{props.moreCount && (
|
|
189
|
-
<Avatar className='ring-background ring-2'>
|
|
190
|
-
<AvatarFallback className='text-xs'>+{props.moreCount}</AvatarFallback>
|
|
191
|
-
</Avatar>
|
|
192
|
-
)}
|
|
193
|
-
</div>
|
|
194
|
-
)}
|
|
195
|
-
</div>
|
|
196
|
-
</HoverCardPrimitive.Content>
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
case 'alert':
|
|
200
|
-
return (
|
|
201
|
-
<HoverCardPrimitive.Content
|
|
202
|
-
align={align}
|
|
203
|
-
sideOffset={sideOffset}
|
|
204
|
-
className={cn(
|
|
205
|
-
hoverCardContentVariants({ variant, rounded, arrow }),
|
|
206
|
-
'w-72',
|
|
207
|
-
className
|
|
208
|
-
)}
|
|
209
|
-
{...props}
|
|
210
|
-
>
|
|
211
|
-
<div className='flex flex-col items-center text-center'>
|
|
212
|
-
<span className='bg-destructive/10 mb-2.5 flex size-12 items-center justify-center rounded-full'>
|
|
213
|
-
<FileQuestionIcon className='text-destructive size-6' />
|
|
214
|
-
</span>
|
|
215
|
-
<div className='mb-1 text-lg font-medium'>{props.title}</div>
|
|
216
|
-
<p className='text-sm'>{children}</p>
|
|
217
|
-
</div>
|
|
218
|
-
</HoverCardPrimitive.Content>
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
case 'tasks':
|
|
222
|
-
return (
|
|
223
|
-
<HoverCardPrimitive.Content
|
|
224
|
-
align={align}
|
|
225
|
-
sideOffset={sideOffset}
|
|
226
|
-
className={cn(
|
|
227
|
-
hoverCardContentVariants({ variant, rounded, arrow }),
|
|
228
|
-
'w-72',
|
|
229
|
-
className
|
|
230
|
-
)}
|
|
231
|
-
{...props}
|
|
232
|
-
>
|
|
233
|
-
<div className='space-y-4'>
|
|
234
|
-
<p className='text-lg font-semibold'>{props.title}</p>
|
|
235
|
-
<ul className='space-y-2.5'>
|
|
236
|
-
{props.tasks && props.tasks.map((task: any, index: number) => (
|
|
237
|
-
<li key={index} className='flex items-start gap-4'>
|
|
238
|
-
<Avatar>
|
|
239
|
-
<AvatarImage src={task.image} alt={task.name} />
|
|
240
|
-
<AvatarFallback>{task.fallback}</AvatarFallback>
|
|
241
|
-
</Avatar>
|
|
242
|
-
<div className='flex flex-1 flex-col'>
|
|
243
|
-
<div className='text-sm font-medium'>{task.name}</div>
|
|
244
|
-
<p className='text-muted-foreground text-xs'>{task.designation}</p>
|
|
245
|
-
</div>
|
|
246
|
-
<span className='text-muted-foreground text-sm'>{task.percentage}%</span>
|
|
247
|
-
</li>
|
|
248
|
-
))}
|
|
249
|
-
</ul>
|
|
250
|
-
</div>
|
|
251
|
-
</HoverCardPrimitive.Content>
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
default:
|
|
255
|
-
return (
|
|
256
|
-
<HoverCardPrimitive.Content
|
|
257
|
-
align={align}
|
|
258
|
-
sideOffset={sideOffset}
|
|
259
|
-
className={cn(
|
|
260
|
-
hoverCardContentVariants({ variant, rounded, arrow }),
|
|
261
|
-
className
|
|
262
|
-
)}
|
|
263
|
-
{...props}
|
|
264
|
-
>
|
|
265
|
-
{children}
|
|
266
|
-
</HoverCardPrimitive.Content>
|
|
267
|
-
)
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
export function HoverCardXDemo() {
|
|
272
|
-
const avatars = [
|
|
273
|
-
{ src: 'https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-1.png', name: 'John Doe', fallback: 'JD' },
|
|
274
|
-
{ src: 'https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-2.png', name: 'Jane Smith', fallback: 'JS' },
|
|
275
|
-
{ src: 'https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-3.png', name: 'Bob Johnson', fallback: 'BJ' }
|
|
276
|
-
]
|
|
277
|
-
|
|
278
|
-
const tasks = [
|
|
279
|
-
{ name: 'John Doe', designation: 'Frontend Developer', image: 'https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-1.png', fallback: 'JD', percentage: 85 },
|
|
280
|
-
{ name: 'Jane Smith', designation: 'Backend Developer', image: 'https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-2.png', fallback: 'JS', percentage: 92 },
|
|
281
|
-
{ name: 'Bob Johnson', designation: 'UI Designer', image: 'https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-3.png', fallback: 'BJ', percentage: 78 }
|
|
282
|
-
]
|
|
283
|
-
|
|
284
|
-
return (
|
|
285
|
-
<div className='space-y-12 p-6 max-w-3xl mx-auto'>
|
|
286
|
-
<div>
|
|
287
|
-
<h3 className='text-lg font-semibold mb-4'>Default</h3>
|
|
288
|
-
<HoverCardX openDelay={0} closeDelay={0}>
|
|
289
|
-
<HoverCardXTrigger asChild>
|
|
290
|
-
<Button variant='link'>Hover Card Default</Button>
|
|
291
|
-
</HoverCardXTrigger>
|
|
292
|
-
<HoverCardXContent>
|
|
293
|
-
<p>This is a default hover card with simple content.</p>
|
|
294
|
-
</HoverCardXContent>
|
|
295
|
-
</HoverCardX>
|
|
296
|
-
</div>
|
|
297
|
-
|
|
298
|
-
<div>
|
|
299
|
-
<h3 className='text-lg font-semibold mb-4'>Media</h3>
|
|
300
|
-
<HoverCardX hovercard='media' openDelay={0} closeDelay={0}>
|
|
301
|
-
<HoverCardXTrigger asChild>
|
|
302
|
-
<Button variant='link'>Hover Card Media</Button>
|
|
303
|
-
</HoverCardXTrigger>
|
|
304
|
-
<HoverCardXContent
|
|
305
|
-
image='https://lp-cms-production.imgix.net/2021-01/GettyRF_450207051.jpg?width=232'
|
|
306
|
-
title='About Himalayas'
|
|
307
|
-
link='https://en.wikipedia.org/wiki/Himalayas'
|
|
308
|
-
>
|
|
309
|
-
The Great Himalayan mountain ranges in the Indian sub-continent region.
|
|
310
|
-
</HoverCardXContent>
|
|
311
|
-
</HoverCardX>
|
|
312
|
-
</div>
|
|
313
|
-
|
|
314
|
-
<div>
|
|
315
|
-
<h3 className='text-lg font-semibold mb-4'>Stats</h3>
|
|
316
|
-
<HoverCardX hovercard='stats' openDelay={0} closeDelay={0}>
|
|
317
|
-
<HoverCardXTrigger asChild>
|
|
318
|
-
<Button variant='link'>Hover Card Stats</Button>
|
|
319
|
-
</HoverCardXTrigger>
|
|
320
|
-
<HoverCardXContent
|
|
321
|
-
label='Total page views'
|
|
322
|
-
value='89,400'
|
|
323
|
-
subtitle='21% ↗︎ than last month'
|
|
324
|
-
avatar='https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-5.png'
|
|
325
|
-
avatarAlt='Hallie Richards'
|
|
326
|
-
avatarFallback='HR'
|
|
327
|
-
/>
|
|
328
|
-
</HoverCardX>
|
|
329
|
-
</div>
|
|
330
|
-
|
|
331
|
-
<div>
|
|
332
|
-
<h3 className='text-lg font-semibold mb-4'>Project</h3>
|
|
333
|
-
<HoverCardX hovercard='project' openDelay={0} closeDelay={0}>
|
|
334
|
-
<HoverCardXTrigger asChild>
|
|
335
|
-
<Button variant='link'>Hover Card Project</Button>
|
|
336
|
-
</HoverCardXTrigger>
|
|
337
|
-
<HoverCardXContent
|
|
338
|
-
title='Resume project completion'
|
|
339
|
-
progress={25}
|
|
340
|
-
startDate='Started in December 2024'
|
|
341
|
-
avatars={avatars}
|
|
342
|
-
moreCount={6}
|
|
343
|
-
>
|
|
344
|
-
Developing platform where ai will generate resume automatically Ai
|
|
345
|
-
</HoverCardXContent>
|
|
346
|
-
</HoverCardX>
|
|
347
|
-
</div>
|
|
348
|
-
|
|
349
|
-
<div>
|
|
350
|
-
<h3 className='text-lg font-semibold mb-4'>Alert</h3>
|
|
351
|
-
<HoverCardX hovercard='alert' openDelay={0} closeDelay={0}>
|
|
352
|
-
<HoverCardXTrigger asChild>
|
|
353
|
-
<Button variant='link'>Hover Card Alert</Button>
|
|
354
|
-
</HoverCardXTrigger>
|
|
355
|
-
<HoverCardXContent title='File is corrupted'>
|
|
356
|
-
It might have some virus or something that might be harmful for your device.
|
|
357
|
-
</HoverCardXContent>
|
|
358
|
-
</HoverCardX>
|
|
359
|
-
</div>
|
|
360
|
-
|
|
361
|
-
<div>
|
|
362
|
-
<h3 className='text-lg font-semibold mb-4'>Tasks</h3>
|
|
363
|
-
<HoverCardX hovercard='tasks' openDelay={0} closeDelay={0}>
|
|
364
|
-
<HoverCardXTrigger asChild>
|
|
365
|
-
<Button variant='link'>Hover Card Tasks</Button>
|
|
366
|
-
</HoverCardXTrigger>
|
|
367
|
-
<HoverCardXContent
|
|
368
|
-
title="Today's task completion"
|
|
369
|
-
tasks={tasks}
|
|
370
|
-
/>
|
|
371
|
-
</HoverCardX>
|
|
372
|
-
</div>
|
|
373
|
-
</div>
|
|
374
|
-
)
|
|
375
|
-
}
|