@catalystsoftware/ui 1.0.2 → 1.0.5
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/data/tailwind.config.js +261 -3821
- package/dist/components/catalyst-ui/buttons/burger.tsx +207 -0
- package/dist/components/catalyst-ui/core/data-display/timeline.tsx +210 -0
- package/dist/components/catalyst-ui/core/feedback/alert.tsx +491 -0
- package/dist/components/catalyst-ui/core/feedback/spinner-1.tsx +65 -0
- package/dist/components/catalyst-ui/core/feedback/toast.tsx +1857 -0
- package/dist/components/catalyst-ui/core/navigation/menu.tsx +164 -0
- package/dist/components/catalyst-ui/forms/toggle-class.tsx +176 -0
- package/dist/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +419 -0
- package/dist/components/catalyst-ui/hooks/use-counter.tsx +13 -0
- package/dist/components/catalyst-ui/hooks/use-event-listener.tsx +23 -0
- package/dist/components/catalyst-ui/hooks/use-export-markdown.tsx +47 -0
- package/dist/components/catalyst-ui/hooks/use-focus.tsx +17 -0
- package/dist/components/catalyst-ui/hooks/use-interval.tsx +23 -0
- package/dist/components/catalyst-ui/hooks/use-is-client.tsx +16 -0
- package/dist/components/catalyst-ui/hooks/use-media-query.tsx +19 -0
- package/dist/components/catalyst-ui/hooks/use-mobile.tsx +19 -0
- package/dist/components/catalyst-ui/hooks/use-resize-observer.tsx +81 -0
- package/dist/components/catalyst-ui/hooks/use-timeout.tsx +21 -0
- package/dist/components/catalyst-ui/hooks/use-timer.tsx +209 -0
- package/dist/components/catalyst-ui/hooks/use-toggle.tsx +12 -0
- package/dist/components/catalyst-ui/media/image.tsx +13 -0
- package/dist/components/catalyst-ui/overlays/dual-sidebar.tsx +4142 -0
- package/dist/components/catalyst-ui/overlays/sidebar-original.tsx +726 -0
- package/dist/components/catalyst-ui/primitives/accordion.tsx +250 -0
- package/dist/components/catalyst-ui/primitives/alert-dialog.tsx +126 -0
- package/dist/components/catalyst-ui/primitives/aspect-ratio.tsx +9 -0
- package/dist/components/catalyst-ui/primitives/avatar.tsx +296 -0
- package/dist/components/catalyst-ui/primitives/badge.tsx +57 -0
- package/dist/components/catalyst-ui/primitives/breadcrumb.tsx +101 -0
- package/dist/components/catalyst-ui/primitives/button.tsx +265 -0
- package/dist/components/catalyst-ui/primitives/calendar-v4.tsx +208 -0
- package/dist/components/catalyst-ui/primitives/calendar.tsx +295 -0
- package/dist/components/catalyst-ui/primitives/card.tsx +618 -0
- package/dist/components/catalyst-ui/primitives/carousel.tsx +238 -0
- package/dist/components/catalyst-ui/primitives/chart.tsx +347 -0
- package/dist/components/catalyst-ui/primitives/checkbox.tsx +225 -0
- package/dist/components/catalyst-ui/primitives/collapsible.tsx +212 -0
- package/dist/components/catalyst-ui/primitives/command.tsx +393 -0
- package/dist/components/catalyst-ui/primitives/context-menu.tsx +236 -0
- package/dist/components/catalyst-ui/primitives/dialog.tsx +471 -0
- package/dist/components/catalyst-ui/primitives/drawer.tsx +761 -0
- package/dist/components/catalyst-ui/primitives/dropdown-menu.tsx +290 -0
- package/dist/components/catalyst-ui/primitives/empty.tsx +104 -0
- package/dist/components/catalyst-ui/primitives/field.tsx +244 -0
- package/dist/components/catalyst-ui/primitives/hover-card.tsx +124 -0
- package/dist/components/catalyst-ui/primitives/input-otp.tsx +76 -0
- package/dist/components/catalyst-ui/primitives/input.tsx +64 -0
- package/dist/components/catalyst-ui/primitives/item.tsx +196 -0
- package/dist/components/catalyst-ui/primitives/kbd.tsx +75 -0
- package/dist/components/catalyst-ui/primitives/label.tsx +24 -0
- package/dist/components/catalyst-ui/primitives/navigation-menu.tsx +150 -0
- package/dist/components/catalyst-ui/primitives/pagination.tsx +198 -0
- package/dist/components/catalyst-ui/primitives/popover.tsx +232 -0
- package/dist/components/catalyst-ui/primitives/progress.tsx +34 -0
- package/dist/components/catalyst-ui/primitives/radio-group.tsx +43 -0
- package/dist/components/catalyst-ui/primitives/resizable.tsx +56 -0
- package/dist/components/catalyst-ui/primitives/select.tsx +155 -0
- package/dist/components/catalyst-ui/primitives/separator.tsx +74 -0
- package/dist/components/catalyst-ui/primitives/sheet.tsx +126 -0
- package/dist/components/catalyst-ui/primitives/skeleton.tsx +15 -0
- package/dist/components/catalyst-ui/primitives/slider.tsx +27 -0
- package/dist/components/catalyst-ui/primitives/switch.tsx +187 -0
- package/dist/components/catalyst-ui/primitives/tabs.tsx +335 -0
- package/dist/components/catalyst-ui/primitives/textarea.tsx +24 -0
- package/dist/components/catalyst-ui/primitives/toggle-group.tsx +55 -0
- package/dist/components/catalyst-ui/primitives/toggle.tsx +42 -0
- package/dist/components/catalyst-ui/primitives/tooltip.tsx +116 -0
- package/dist/components/catalyst-ui/utils/basic-auth.tsx +40 -0
- package/dist/components/catalyst-ui/utils/context-storage.tsx +19 -0
- package/dist/components/catalyst-ui/utils/cors-middleware.tsx +71 -0
- package/dist/components/catalyst-ui/utils/deferred-content.tsx +595 -0
- package/dist/components/catalyst-ui/utils/honeypot-middleware.tsx +38 -0
- package/dist/components/catalyst-ui/utils/incId.tsx +75 -0
- package/dist/components/catalyst-ui/utils/jwk-auth.tsx +36 -0
- package/dist/components/catalyst-ui/utils/request-id.tsx +14 -0
- package/dist/components/catalyst-ui/utils/secure-headers.tsx +37 -0
- package/dist/components/catalyst-ui/utils/server-timing.tsx +23 -0
- package/dist/components/catalyst-ui/utils/utils.ts +43 -0
- package/dist/components/catalyst-ui/utils/with-cookie.tsx +43 -0
- package/dist/components/catalyst-ui/x/accordian-x.tsx +428 -0
- package/dist/components/catalyst-ui/x/alert-x.tsx +413 -0
- package/dist/components/catalyst-ui/x/animated-text-x.tsx +2242 -0
- package/dist/components/catalyst-ui/x/avatar-x.tsx +515 -0
- package/dist/components/catalyst-ui/x/badge-x.tsx +670 -0
- package/dist/components/catalyst-ui/x/button-X.tsx +2857 -0
- package/dist/components/catalyst-ui/x/button-group-x.tsx +847 -0
- package/dist/components/catalyst-ui/x/calendar-x.tsx +1910 -0
- package/dist/components/catalyst-ui/x/card-x.tsx +2597 -0
- package/dist/components/catalyst-ui/x/checkbox-x.tsx +656 -0
- package/dist/components/catalyst-ui/x/collapsible-x.tsx +1360 -0
- package/dist/components/catalyst-ui/x/combobox-x.tsx +911 -0
- package/dist/components/catalyst-ui/x/data-table-x.tsx +1753 -0
- package/dist/components/catalyst-ui/x/date-picker-x.tsx +648 -0
- package/dist/components/catalyst-ui/x/dialog-x.tsx +659 -0
- package/dist/components/catalyst-ui/x/dropdown-menu-x.tsx +612 -0
- package/dist/components/catalyst-ui/x/hover-card-x.tsx +375 -0
- package/dist/components/catalyst-ui/x/icon-x.tsx +840 -0
- package/dist/components/catalyst-ui/x/input-mask-x.tsx +981 -0
- package/dist/components/catalyst-ui/x/input-otp-x.tsx +659 -0
- package/dist/components/catalyst-ui/x/loader-x.tsx +1757 -0
- package/dist/components/catalyst-ui/x/pagination-x.tsx +622 -0
- package/dist/components/catalyst-ui/x/popover-x.tsx +744 -0
- package/dist/components/catalyst-ui/x/radio-group-x.tsx +499 -0
- package/dist/components/catalyst-ui/x/select-x.tsx +1127 -0
- package/dist/components/catalyst-ui/x/sheet-x.tsx +668 -0
- package/dist/components/catalyst-ui/x/switch-x.tsx +681 -0
- package/dist/components/catalyst-ui/x/table-x.tsx +574 -0
- package/dist/components/catalyst-ui/x/tabs-x.tsx +839 -0
- package/dist/components/catalyst-ui/x/textarea-x.tsx +1263 -0
- package/dist/components/catalyst-ui/x/tooltip-x.tsx +396 -0
- package/dist/components/catalyst-ui/x/tracker-x.tsx +560 -0
- package/dist/data/bg-data.tsx +901 -0
- package/dist/data/buttons-data.tsx +2327 -0
- package/dist/data/charts-data.tsx +102 -0
- package/dist/data/chat-data.tsx +83 -0
- package/dist/data/code-data.tsx +1040 -0
- package/dist/data/comboboxes-data.tsx +1843 -0
- package/dist/data/command-data.tsx +1381 -0
- package/dist/data/core-data.tsx +15953 -0
- package/dist/data/crm-data.tsx +47 -0
- package/dist/data/data.tsx +159 -0
- package/dist/data/date-and-time-data.tsx +554 -0
- package/dist/data/dependencies.tsx +7 -0
- package/dist/data/ecommerce-data.tsx +1387 -0
- package/dist/data/forms-data.tsx +7890 -0
- package/dist/data/hooks-data.tsx +5487 -0
- package/dist/data/index.ts +34 -0
- package/dist/data/inputs-data.tsx +557 -0
- package/dist/data/interactive-data.tsx +5394 -0
- package/dist/data/lofi-data.tsx +18295 -0
- package/dist/data/marketing-data.tsx +2546 -0
- package/dist/data/media-data.tsx +1510 -0
- package/dist/data/motion-data.tsx +5801 -0
- package/dist/data/overlay-data.tsx +4136 -0
- package/dist/data/pdf-data.tsx +124 -0
- package/dist/data/pos-data.tsx +213 -0
- package/dist/data/postcss.config.js +6 -0
- package/dist/data/primitive-data.tsx +5170 -0
- package/dist/data/prompt-data.tsx +1226 -0
- package/dist/data/requiredLibs.ts +4 -0
- package/dist/data/sandbox-data.tsx +1 -0
- package/dist/data/sidebars-data.tsx +5421 -0
- package/dist/data/stacks-data.tsx +32 -0
- package/dist/data/table-data.tsx +706 -0
- package/dist/data/tailwind.config.js +270 -0
- package/dist/data/tailwind.config.ngin.js +3830 -0
- package/dist/data/tailwind.css +431 -0
- package/dist/data/tools-data.tsx +6910 -0
- package/dist/data/typography-data.tsx +2050 -0
- package/dist/data/utils-data.tsx +6500 -0
- package/dist/data/x-data.tsx +1171 -0
- package/dist/data.tsx +159 -0
- package/package.json +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -362
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip'
|
|
3
|
+
import { cn, Tooltip, TooltipProvider, TooltipTrigger, TooltipContent, tooltipContentVariants, Avatar, AvatarImage, AvatarFallback, Badge, Button, TsxSection } from '~/components/catalyst-ui'
|
|
4
|
+
import { InfoIcon, ChevronRightIcon, CalendarIcon, FileQuestionIcon } from 'lucide-react'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
type TooltipXType = {
|
|
8
|
+
tooltip?: 'default' | 'light' | 'noArrow' | 'error' | 'icon' | 'rounded' | 'content' | 'avatar' | 'badge'
|
|
9
|
+
variant?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const TooltipXContext = React.createContext<TooltipXType>({
|
|
13
|
+
tooltip: "default",
|
|
14
|
+
variant: "default",
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const useTooltipXContext = () => {
|
|
18
|
+
const context = React.useContext(AccordionContext)
|
|
19
|
+
if (!context) {
|
|
20
|
+
throw new Error("Accordion components must be used within Accordion")
|
|
21
|
+
}
|
|
22
|
+
return context
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function TooltipX({ tooltip = 'default', variant, arrow, rounded, ...props }: any) {
|
|
26
|
+
return (
|
|
27
|
+
<TooltipXContext.Provider value={{ variant, arrow, rounded }}>
|
|
28
|
+
<Tooltip {...props} />
|
|
29
|
+
</TooltipXContext.Provider>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function TooltipXTrigger({ ...props }: any) {
|
|
34
|
+
const { variant, arrow, rounded, tooltip } = useTooltipXContext()
|
|
35
|
+
|
|
36
|
+
switch (tooltip) {
|
|
37
|
+
default:
|
|
38
|
+
return <TooltipTrigger {...props} />
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function TooltipXContent({ children, ...props }: any) {
|
|
43
|
+
const { variant, arrow, rounded, tooltip } = useTooltipXContext()
|
|
44
|
+
|
|
45
|
+
switch (tooltip) {
|
|
46
|
+
case 'light':
|
|
47
|
+
return (
|
|
48
|
+
<TooltipContent
|
|
49
|
+
className={cn(tooltipContentVariants({ variant, arrow, rounded }), 'bg-neutral-200 text-neutral-950 dark:bg-neutral-50 [&_svg]:bg-neutral-200 [&_svg]:fill-neutral-200 dark:[&_svg]:bg-neutral-50 dark:[&_svg]:fill-neutral-50', props.className)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
</TooltipContent>
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
case 'noArrow':
|
|
57
|
+
return (
|
|
58
|
+
<TooltipContent
|
|
59
|
+
className={cn(tooltipContentVariants({ variant, arrow, rounded }), '[&_svg]:invisible', props.className)}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</TooltipContent>
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
case 'error':
|
|
67
|
+
return (
|
|
68
|
+
<TooltipContent
|
|
69
|
+
className={cn(tooltipContentVariants({ variant, arrow, rounded }), 'bg-destructive [&_svg]:bg-destructive [&_svg]:fill-destructive text-white', props.className)}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
{children}
|
|
73
|
+
</TooltipContent>
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
case 'icon':
|
|
77
|
+
return (
|
|
78
|
+
<TooltipContent
|
|
79
|
+
className={cn(tooltipContentVariants({ variant, arrow, rounded }), 'max-w-64 text-pretty', props.className)}
|
|
80
|
+
{...props}
|
|
81
|
+
>
|
|
82
|
+
<div className='flex items-center gap-1.5'>
|
|
83
|
+
<InfoIcon className='size-4' />
|
|
84
|
+
<p>{children}</p>
|
|
85
|
+
</div>
|
|
86
|
+
</TooltipContent>
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
case 'rounded':
|
|
90
|
+
return (
|
|
91
|
+
<TooltipContent
|
|
92
|
+
className={cn(tooltipContentVariants({ variant, arrow, rounded }), 'rounded-full', props.className)}
|
|
93
|
+
{...props}
|
|
94
|
+
>
|
|
95
|
+
{children}
|
|
96
|
+
</TooltipContent>
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
case 'content':
|
|
100
|
+
return (
|
|
101
|
+
<TooltipContent
|
|
102
|
+
className={cn(tooltipContentVariants({ variant, arrow, rounded }), 'max-w-64 py-3 text-pretty', props.className)}
|
|
103
|
+
{...props}
|
|
104
|
+
>
|
|
105
|
+
<div className='space-y-1'>
|
|
106
|
+
<div className='flex items-center gap-2'>
|
|
107
|
+
<InfoIcon className='size-4' />
|
|
108
|
+
<p className='text-sm font-medium'>{props.title}</p>
|
|
109
|
+
</div>
|
|
110
|
+
<p className='text-background/80'>{children}</p>
|
|
111
|
+
</div>
|
|
112
|
+
</TooltipContent>
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
case 'avatar':
|
|
116
|
+
return (
|
|
117
|
+
<TooltipContent className={cn(tooltipContentVariants({ variant, arrow, rounded }), props.className)} {...props}>
|
|
118
|
+
<div className='flex items-center gap-1.5'>
|
|
119
|
+
<Avatar className='size-5'>
|
|
120
|
+
<AvatarImage src={props.avatar} alt={props.name} />
|
|
121
|
+
<AvatarFallback className='text-xs'>{props.name?.[0]}</AvatarFallback>
|
|
122
|
+
</Avatar>
|
|
123
|
+
<p className='font-medium'>{props.name}</p>
|
|
124
|
+
</div>
|
|
125
|
+
</TooltipContent>
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
case 'badge':
|
|
129
|
+
return (
|
|
130
|
+
<TooltipContent className={cn(tooltipContentVariants({ variant, arrow, rounded }), props.className)} {...props}>
|
|
131
|
+
<div className='flex items-center gap-2'>
|
|
132
|
+
<p>{children}</p>
|
|
133
|
+
<Badge variant='secondary' className='px-1.5 py-px'>
|
|
134
|
+
{props.badgeText}
|
|
135
|
+
</Badge>
|
|
136
|
+
</div>
|
|
137
|
+
</TooltipContent>
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
default:
|
|
141
|
+
return <TooltipContent className={cn(tooltipContentVariants({ variant, arrow, rounded }), props.className)} {...props}>{children}</TooltipContent>
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function TooltipXDemo() {
|
|
146
|
+
return (
|
|
147
|
+
<TooltipProvider>
|
|
148
|
+
<div className="space-y-12 p-6 max-w-3xl mx-auto">
|
|
149
|
+
<div>
|
|
150
|
+
<h3 className="text-lg font-semibold mb-4">Default</h3>
|
|
151
|
+
<TooltipX>
|
|
152
|
+
<TooltipXTrigger asChild>
|
|
153
|
+
<Button variant='outline' size='sm'>Default</Button>
|
|
154
|
+
</TooltipXTrigger>
|
|
155
|
+
<TooltipXContent>
|
|
156
|
+
<p>This is a simple tooltip</p>
|
|
157
|
+
</TooltipXContent>
|
|
158
|
+
</TooltipX>
|
|
159
|
+
<TsxSection
|
|
160
|
+
title="TooltipX Default"
|
|
161
|
+
code={`<TooltipX>
|
|
162
|
+
<TooltipXTrigger asChild>
|
|
163
|
+
<Button variant='outline' size='sm'>Default</Button>
|
|
164
|
+
</TooltipXTrigger>
|
|
165
|
+
<TooltipXContent>
|
|
166
|
+
<p>This is a simple tooltip</p>
|
|
167
|
+
</TooltipXContent>
|
|
168
|
+
</TooltipX>`}
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<div>
|
|
173
|
+
<h3 className="text-lg font-semibold mb-4">Light</h3>
|
|
174
|
+
<TooltipX tooltip='light'>
|
|
175
|
+
<TooltipXTrigger asChild>
|
|
176
|
+
<Button variant='outline' size='sm'>Light</Button>
|
|
177
|
+
</TooltipXTrigger>
|
|
178
|
+
<TooltipXContent>
|
|
179
|
+
<p>This tooltip will be always light</p>
|
|
180
|
+
</TooltipXContent>
|
|
181
|
+
</TooltipX>
|
|
182
|
+
<TsxSection
|
|
183
|
+
title="TooltipX Light"
|
|
184
|
+
code={`<TooltipX tooltip='light'>
|
|
185
|
+
<TooltipXTrigger asChild>
|
|
186
|
+
<Button variant='outline' size='sm'>Light</Button>
|
|
187
|
+
</TooltipXTrigger>
|
|
188
|
+
<TooltipXContent>
|
|
189
|
+
<p>This tooltip will be always light</p>
|
|
190
|
+
</TooltipXContent>
|
|
191
|
+
</TooltipX>`}
|
|
192
|
+
/>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<div>
|
|
196
|
+
<h3 className="text-lg font-semibold mb-4">No Arrow</h3>
|
|
197
|
+
<TooltipX tooltip='noArrow'>
|
|
198
|
+
<TooltipXTrigger asChild>
|
|
199
|
+
<Button variant='outline' size='sm'>No arrow</Button>
|
|
200
|
+
</TooltipXTrigger>
|
|
201
|
+
<TooltipXContent>
|
|
202
|
+
<p>This tooltip don't have arrow</p>
|
|
203
|
+
</TooltipXContent>
|
|
204
|
+
</TooltipX>
|
|
205
|
+
<TsxSection
|
|
206
|
+
title="TooltipX No Arrow"
|
|
207
|
+
code={`<TooltipX tooltip='noArrow'>
|
|
208
|
+
<TooltipXTrigger asChild>
|
|
209
|
+
<Button variant='outline' size='sm'>No arrow</Button>
|
|
210
|
+
</TooltipXTrigger>
|
|
211
|
+
<TooltipXContent>
|
|
212
|
+
<p>This tooltip don't have arrow</p>
|
|
213
|
+
</TooltipXContent>
|
|
214
|
+
</TooltipX>`}
|
|
215
|
+
/>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<div>
|
|
219
|
+
<h3 className="text-lg font-semibold mb-4">Error</h3>
|
|
220
|
+
<TooltipX tooltip='error'>
|
|
221
|
+
<TooltipXTrigger asChild>
|
|
222
|
+
<Button variant='outline' size='sm'>Error</Button>
|
|
223
|
+
</TooltipXTrigger>
|
|
224
|
+
<TooltipXContent>
|
|
225
|
+
<p>This is an error tooltip</p>
|
|
226
|
+
</TooltipXContent>
|
|
227
|
+
</TooltipX>
|
|
228
|
+
<TsxSection
|
|
229
|
+
title="TooltipX Error"
|
|
230
|
+
code={`<TooltipX tooltip='error'>
|
|
231
|
+
<TooltipXTrigger asChild>
|
|
232
|
+
<Button variant='outline' size='sm'>Error</Button>
|
|
233
|
+
</TooltipXTrigger>
|
|
234
|
+
<TooltipXContent>
|
|
235
|
+
<p>This is an error tooltip</p>
|
|
236
|
+
</TooltipXContent>
|
|
237
|
+
</TooltipX>`}
|
|
238
|
+
/>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
<div>
|
|
242
|
+
<h3 className="text-lg font-semibold mb-4">Icon</h3>
|
|
243
|
+
<TooltipX tooltip='icon'>
|
|
244
|
+
<TooltipXTrigger asChild>
|
|
245
|
+
<Button variant='outline' size='sm'>Icon</Button>
|
|
246
|
+
</TooltipXTrigger>
|
|
247
|
+
<TooltipXContent>
|
|
248
|
+
This tooltip has an icon
|
|
249
|
+
</TooltipXContent>
|
|
250
|
+
</TooltipX>
|
|
251
|
+
<TsxSection
|
|
252
|
+
title="TooltipX Icon"
|
|
253
|
+
code={`<TooltipX tooltip='icon'>
|
|
254
|
+
<TooltipXTrigger asChild>
|
|
255
|
+
<Button variant='outline' size='sm'>Icon</Button>
|
|
256
|
+
</TooltipXTrigger>
|
|
257
|
+
<TooltipXContent>
|
|
258
|
+
This tooltip has an icon
|
|
259
|
+
</TooltipXContent>
|
|
260
|
+
</TooltipX>`}
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
<div>
|
|
265
|
+
<h3 className="text-lg font-semibold mb-4">Rounded</h3>
|
|
266
|
+
<TooltipX tooltip='rounded'>
|
|
267
|
+
<TooltipXTrigger asChild>
|
|
268
|
+
<Button variant='outline' size='sm'>Rounded</Button>
|
|
269
|
+
</TooltipXTrigger>
|
|
270
|
+
<TooltipXContent>
|
|
271
|
+
<p>This tooltip is rounded</p>
|
|
272
|
+
</TooltipXContent>
|
|
273
|
+
</TooltipX>
|
|
274
|
+
<TsxSection
|
|
275
|
+
title="TooltipX Rounded"
|
|
276
|
+
code={`<TooltipX tooltip='rounded'>
|
|
277
|
+
<TooltipXTrigger asChild>
|
|
278
|
+
<Button variant='outline' size='sm'>Rounded</Button>
|
|
279
|
+
</TooltipXTrigger>
|
|
280
|
+
<TooltipXContent>
|
|
281
|
+
<p>This tooltip is rounded</p>
|
|
282
|
+
</TooltipXContent>
|
|
283
|
+
</TooltipX>`}
|
|
284
|
+
/>
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<div>
|
|
288
|
+
<h3 className="text-lg font-semibold mb-4">Content</h3>
|
|
289
|
+
<TooltipX tooltip='content'>
|
|
290
|
+
<TooltipXTrigger asChild>
|
|
291
|
+
<Button variant='outline' size='sm'>Content</Button>
|
|
292
|
+
</TooltipXTrigger>
|
|
293
|
+
<TooltipXContent title='Accessibility First'>
|
|
294
|
+
Tooltips should supplement the UI, not hide critical information. Ensure all important content is visible without requiring tooltip interaction.
|
|
295
|
+
</TooltipXContent>
|
|
296
|
+
</TooltipX>
|
|
297
|
+
<TsxSection
|
|
298
|
+
title="TooltipX Content"
|
|
299
|
+
code={`<TooltipX tooltip='content'>
|
|
300
|
+
<TooltipXTrigger asChild>
|
|
301
|
+
<Button variant='outline' size='sm'>Content</Button>
|
|
302
|
+
</TooltipXTrigger>
|
|
303
|
+
<TooltipXContent title='Accessibility First'>
|
|
304
|
+
Tooltips should supplement the UI, not hide critical information.
|
|
305
|
+
</TooltipXContent>
|
|
306
|
+
</TooltipX>`}
|
|
307
|
+
/>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<div>
|
|
311
|
+
<h3 className="text-lg font-semibold mb-4">Avatar</h3>
|
|
312
|
+
<TooltipX tooltip='avatar'>
|
|
313
|
+
<TooltipXTrigger asChild>
|
|
314
|
+
<Button variant='outline' size='sm'>Avatar</Button>
|
|
315
|
+
</TooltipXTrigger>
|
|
316
|
+
<TooltipXContent avatar='https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-5.png' name='Hallie Richards' />
|
|
317
|
+
</TooltipX>
|
|
318
|
+
<TsxSection
|
|
319
|
+
title="TooltipX Avatar"
|
|
320
|
+
code={`<TooltipX tooltip='avatar'>
|
|
321
|
+
<TooltipXTrigger asChild>
|
|
322
|
+
<Button variant='outline' size='sm'>Avatar</Button>
|
|
323
|
+
</TooltipXTrigger>
|
|
324
|
+
<TooltipXContent
|
|
325
|
+
avatar='https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-5.png'
|
|
326
|
+
name='Hallie Richards'
|
|
327
|
+
/>
|
|
328
|
+
</TooltipX>`}
|
|
329
|
+
/>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
<div>
|
|
333
|
+
<h3 className="text-lg font-semibold mb-4">Badge</h3>
|
|
334
|
+
<TooltipX tooltip='badge'>
|
|
335
|
+
<TooltipXTrigger asChild>
|
|
336
|
+
<Button variant='outline' size='sm'>Badge</Button>
|
|
337
|
+
</TooltipXTrigger>
|
|
338
|
+
<TooltipXContent badgeText='Trending'>
|
|
339
|
+
Team plan: $99/month per user.
|
|
340
|
+
</TooltipXContent>
|
|
341
|
+
</TooltipX>
|
|
342
|
+
<TsxSection
|
|
343
|
+
title="TooltipX Badge"
|
|
344
|
+
code={`<TooltipX tooltip='badge'>
|
|
345
|
+
<TooltipXTrigger asChild>
|
|
346
|
+
<Button variant='outline' size='sm'>Badge</Button>
|
|
347
|
+
</TooltipXTrigger>
|
|
348
|
+
<TooltipXContent badgeText='Trending'>
|
|
349
|
+
Team plan: $99/month per user.
|
|
350
|
+
</TooltipXContent>
|
|
351
|
+
</TooltipX>`}
|
|
352
|
+
/>
|
|
353
|
+
</div>
|
|
354
|
+
|
|
355
|
+
<div>
|
|
356
|
+
<h3 className="text-lg font-semibold mb-4">Directions</h3>
|
|
357
|
+
<div className='flex flex-wrap gap-2'>
|
|
358
|
+
<TooltipX>
|
|
359
|
+
<TooltipXTrigger asChild>
|
|
360
|
+
<Button variant='outline' size='sm'>Left</Button>
|
|
361
|
+
</TooltipXTrigger>
|
|
362
|
+
<TooltipXContent side='left'>Tooltip on left</TooltipXContent>
|
|
363
|
+
</TooltipX>
|
|
364
|
+
<TooltipX>
|
|
365
|
+
<TooltipXTrigger asChild>
|
|
366
|
+
<Button variant='outline' size='sm'>Top</Button>
|
|
367
|
+
</TooltipXTrigger>
|
|
368
|
+
<TooltipXContent side='top'>Tooltip on top</TooltipXContent>
|
|
369
|
+
</TooltipX>
|
|
370
|
+
<TooltipX>
|
|
371
|
+
<TooltipXTrigger asChild>
|
|
372
|
+
<Button variant='outline' size='sm'>Bottom</Button>
|
|
373
|
+
</TooltipXTrigger>
|
|
374
|
+
<TooltipXContent side='bottom'>Tooltip on bottom</TooltipXContent>
|
|
375
|
+
</TooltipX>
|
|
376
|
+
<TooltipX>
|
|
377
|
+
<TooltipXTrigger asChild>
|
|
378
|
+
<Button variant='outline' size='sm'>Right</Button>
|
|
379
|
+
</TooltipXTrigger>
|
|
380
|
+
<TooltipXContent side='right'>Tooltip on right</TooltipXContent>
|
|
381
|
+
</TooltipX>
|
|
382
|
+
</div>
|
|
383
|
+
<TsxSection
|
|
384
|
+
title="TooltipX Directions"
|
|
385
|
+
code={`<TooltipX>
|
|
386
|
+
<TooltipXTrigger asChild>
|
|
387
|
+
<Button variant='outline' size='sm'>Left</Button>
|
|
388
|
+
</TooltipXTrigger>
|
|
389
|
+
<TooltipXContent side='left'>Tooltip on left</TooltipXContent>
|
|
390
|
+
</TooltipX>`}
|
|
391
|
+
/>
|
|
392
|
+
</div>
|
|
393
|
+
</div>
|
|
394
|
+
</TooltipProvider>
|
|
395
|
+
)
|
|
396
|
+
}
|