@catalystsoftware/ui 1.0.5 → 1.0.7

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.
Files changed (155) hide show
  1. package/dist/data/data.tsx +29 -29
  2. package/dist/data/tailwind.config.js +3821 -261
  3. package/dist/data.tsx +29 -29
  4. package/package.json +4 -3
  5. package/components/catalyst-ui/buttons/burger.tsx +0 -207
  6. package/components/catalyst-ui/core/data-display/timeline.tsx +0 -210
  7. package/components/catalyst-ui/core/feedback/alert.tsx +0 -491
  8. package/components/catalyst-ui/core/feedback/spinner-1.tsx +0 -65
  9. package/components/catalyst-ui/core/feedback/toast.tsx +0 -1857
  10. package/components/catalyst-ui/core/navigation/menu.tsx +0 -164
  11. package/components/catalyst-ui/forms/toggle-class.tsx +0 -176
  12. package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +0 -419
  13. package/components/catalyst-ui/hooks/use-counter.tsx +0 -13
  14. package/components/catalyst-ui/hooks/use-event-listener.tsx +0 -23
  15. package/components/catalyst-ui/hooks/use-export-markdown.tsx +0 -47
  16. package/components/catalyst-ui/hooks/use-focus.tsx +0 -17
  17. package/components/catalyst-ui/hooks/use-interval.tsx +0 -23
  18. package/components/catalyst-ui/hooks/use-is-client.tsx +0 -16
  19. package/components/catalyst-ui/hooks/use-media-query.tsx +0 -19
  20. package/components/catalyst-ui/hooks/use-mobile.tsx +0 -19
  21. package/components/catalyst-ui/hooks/use-resize-observer.tsx +0 -81
  22. package/components/catalyst-ui/hooks/use-timeout.tsx +0 -21
  23. package/components/catalyst-ui/hooks/use-timer.tsx +0 -209
  24. package/components/catalyst-ui/hooks/use-toggle.tsx +0 -12
  25. package/components/catalyst-ui/media/image.tsx +0 -13
  26. package/components/catalyst-ui/overlays/dual-sidebar.tsx +0 -4142
  27. package/components/catalyst-ui/overlays/sidebar-original.tsx +0 -726
  28. package/components/catalyst-ui/primitives/accordion.tsx +0 -250
  29. package/components/catalyst-ui/primitives/alert-dialog.tsx +0 -126
  30. package/components/catalyst-ui/primitives/aspect-ratio.tsx +0 -9
  31. package/components/catalyst-ui/primitives/avatar.tsx +0 -296
  32. package/components/catalyst-ui/primitives/badge.tsx +0 -57
  33. package/components/catalyst-ui/primitives/breadcrumb.tsx +0 -101
  34. package/components/catalyst-ui/primitives/button.tsx +0 -265
  35. package/components/catalyst-ui/primitives/calendar-v4.tsx +0 -208
  36. package/components/catalyst-ui/primitives/calendar.tsx +0 -295
  37. package/components/catalyst-ui/primitives/card.tsx +0 -618
  38. package/components/catalyst-ui/primitives/carousel.tsx +0 -238
  39. package/components/catalyst-ui/primitives/chart.tsx +0 -347
  40. package/components/catalyst-ui/primitives/checkbox.tsx +0 -225
  41. package/components/catalyst-ui/primitives/collapsible.tsx +0 -212
  42. package/components/catalyst-ui/primitives/command.tsx +0 -393
  43. package/components/catalyst-ui/primitives/context-menu.tsx +0 -236
  44. package/components/catalyst-ui/primitives/dialog.tsx +0 -471
  45. package/components/catalyst-ui/primitives/drawer.tsx +0 -761
  46. package/components/catalyst-ui/primitives/dropdown-menu.tsx +0 -290
  47. package/components/catalyst-ui/primitives/empty.tsx +0 -104
  48. package/components/catalyst-ui/primitives/field.tsx +0 -244
  49. package/components/catalyst-ui/primitives/hover-card.tsx +0 -124
  50. package/components/catalyst-ui/primitives/input-otp.tsx +0 -76
  51. package/components/catalyst-ui/primitives/input.tsx +0 -64
  52. package/components/catalyst-ui/primitives/item.tsx +0 -196
  53. package/components/catalyst-ui/primitives/kbd.tsx +0 -75
  54. package/components/catalyst-ui/primitives/label.tsx +0 -24
  55. package/components/catalyst-ui/primitives/navigation-menu.tsx +0 -150
  56. package/components/catalyst-ui/primitives/pagination.tsx +0 -198
  57. package/components/catalyst-ui/primitives/popover.tsx +0 -232
  58. package/components/catalyst-ui/primitives/progress.tsx +0 -34
  59. package/components/catalyst-ui/primitives/radio-group.tsx +0 -43
  60. package/components/catalyst-ui/primitives/resizable.tsx +0 -56
  61. package/components/catalyst-ui/primitives/select.tsx +0 -155
  62. package/components/catalyst-ui/primitives/separator.tsx +0 -74
  63. package/components/catalyst-ui/primitives/sheet.tsx +0 -126
  64. package/components/catalyst-ui/primitives/skeleton.tsx +0 -15
  65. package/components/catalyst-ui/primitives/slider.tsx +0 -27
  66. package/components/catalyst-ui/primitives/switch.tsx +0 -187
  67. package/components/catalyst-ui/primitives/tabs.tsx +0 -335
  68. package/components/catalyst-ui/primitives/textarea.tsx +0 -24
  69. package/components/catalyst-ui/primitives/toggle-group.tsx +0 -55
  70. package/components/catalyst-ui/primitives/toggle.tsx +0 -42
  71. package/components/catalyst-ui/primitives/tooltip.tsx +0 -116
  72. package/components/catalyst-ui/utils/basic-auth.tsx +0 -40
  73. package/components/catalyst-ui/utils/context-storage.tsx +0 -19
  74. package/components/catalyst-ui/utils/cors-middleware.tsx +0 -71
  75. package/components/catalyst-ui/utils/deferred-content.tsx +0 -595
  76. package/components/catalyst-ui/utils/honeypot-middleware.tsx +0 -38
  77. package/components/catalyst-ui/utils/incId.tsx +0 -75
  78. package/components/catalyst-ui/utils/jwk-auth.tsx +0 -36
  79. package/components/catalyst-ui/utils/request-id.tsx +0 -14
  80. package/components/catalyst-ui/utils/secure-headers.tsx +0 -37
  81. package/components/catalyst-ui/utils/server-timing.tsx +0 -23
  82. package/components/catalyst-ui/utils/utils.ts +0 -43
  83. package/components/catalyst-ui/utils/with-cookie.tsx +0 -43
  84. package/components/catalyst-ui/x/accordian-x.tsx +0 -428
  85. package/components/catalyst-ui/x/alert-x.tsx +0 -413
  86. package/components/catalyst-ui/x/animated-text-x.tsx +0 -2242
  87. package/components/catalyst-ui/x/avatar-x.tsx +0 -515
  88. package/components/catalyst-ui/x/badge-x.tsx +0 -670
  89. package/components/catalyst-ui/x/button-X.tsx +0 -2857
  90. package/components/catalyst-ui/x/button-group-x.tsx +0 -847
  91. package/components/catalyst-ui/x/calendar-x.tsx +0 -1910
  92. package/components/catalyst-ui/x/card-x.tsx +0 -2597
  93. package/components/catalyst-ui/x/checkbox-x.tsx +0 -656
  94. package/components/catalyst-ui/x/collapsible-x.tsx +0 -1360
  95. package/components/catalyst-ui/x/combobox-x.tsx +0 -911
  96. package/components/catalyst-ui/x/data-table-x.tsx +0 -1753
  97. package/components/catalyst-ui/x/date-picker-x.tsx +0 -648
  98. package/components/catalyst-ui/x/dialog-x.tsx +0 -659
  99. package/components/catalyst-ui/x/dropdown-menu-x.tsx +0 -612
  100. package/components/catalyst-ui/x/hover-card-x.tsx +0 -375
  101. package/components/catalyst-ui/x/icon-x.tsx +0 -840
  102. package/components/catalyst-ui/x/input-mask-x.tsx +0 -981
  103. package/components/catalyst-ui/x/input-otp-x.tsx +0 -659
  104. package/components/catalyst-ui/x/loader-x.tsx +0 -1757
  105. package/components/catalyst-ui/x/pagination-x.tsx +0 -622
  106. package/components/catalyst-ui/x/popover-x.tsx +0 -744
  107. package/components/catalyst-ui/x/radio-group-x.tsx +0 -499
  108. package/components/catalyst-ui/x/select-x.tsx +0 -1127
  109. package/components/catalyst-ui/x/sheet-x.tsx +0 -668
  110. package/components/catalyst-ui/x/switch-x.tsx +0 -681
  111. package/components/catalyst-ui/x/table-x.tsx +0 -574
  112. package/components/catalyst-ui/x/tabs-x.tsx +0 -839
  113. package/components/catalyst-ui/x/textarea-x.tsx +0 -1263
  114. package/components/catalyst-ui/x/tooltip-x.tsx +0 -396
  115. package/components/catalyst-ui/x/tracker-x.tsx +0 -560
  116. package/data/bg-data.tsx +0 -901
  117. package/data/buttons-data.tsx +0 -2327
  118. package/data/charts-data.tsx +0 -102
  119. package/data/chat-data.tsx +0 -83
  120. package/data/code-data.tsx +0 -1040
  121. package/data/comboboxes-data.tsx +0 -1843
  122. package/data/command-data.tsx +0 -1381
  123. package/data/core-data.tsx +0 -15953
  124. package/data/crm-data.tsx +0 -47
  125. package/data/data.tsx +0 -159
  126. package/data/date-and-time-data.tsx +0 -554
  127. package/data/dependencies.tsx +0 -7
  128. package/data/ecommerce-data.tsx +0 -1387
  129. package/data/forms-data.tsx +0 -7890
  130. package/data/hooks-data.tsx +0 -5487
  131. package/data/index.ts +0 -34
  132. package/data/inputs-data.tsx +0 -557
  133. package/data/interactive-data.tsx +0 -5394
  134. package/data/lofi-data.tsx +0 -18295
  135. package/data/marketing-data.tsx +0 -2546
  136. package/data/media-data.tsx +0 -1510
  137. package/data/motion-data.tsx +0 -5801
  138. package/data/overlay-data.tsx +0 -4136
  139. package/data/pdf-data.tsx +0 -124
  140. package/data/pos-data.tsx +0 -213
  141. package/data/postcss.config.js +0 -6
  142. package/data/primitive-data.tsx +0 -5170
  143. package/data/prompt-data.tsx +0 -1226
  144. package/data/requiredLibs.ts +0 -4
  145. package/data/sandbox-data.tsx +0 -1
  146. package/data/sidebars-data.tsx +0 -5421
  147. package/data/stacks-data.tsx +0 -32
  148. package/data/table-data.tsx +0 -706
  149. package/data/tailwind.config.js +0 -270
  150. package/data/tailwind.config.ngin.js +0 -3830
  151. package/data/tailwind.css +0 -431
  152. package/data/tools-data.tsx +0 -6910
  153. package/data/typography-data.tsx +0 -2050
  154. package/data/utils-data.tsx +0 -6500
  155. package/data/x-data.tsx +0 -1171
@@ -1,670 +0,0 @@
1
- import { Badge, cn, badgeVariants } from "~/components/catalyst-ui";
2
- import { useState, useId } from "react";
3
-
4
- /**
5
- * ★ ━━━━ ☆ ━━━━ BadgeX ━━━━ ☆ ━━━━ ★
6
- * type BadgeXType =
7
- * | 'Closable' | 'Selectable' | 'BadgeLink' // Interactive
8
- * | 'InProgress' | 'BadgeCompleted' | 'BadgePending' | 'BadgeFailed' | 'BadgeSuccessful' | 'BadgeBlocked' // Status
9
- * | 'Dot' | 'BadgeWithIcon' | 'BadgeGradient' | 'BadgeGradientOutline' | 'BadgeRounded' | 'BadgeAnimated' // Visual Styles
10
- * | 'BadgeSmall' | 'BadgeLarge' // Sizes
11
- * | 'BadgeNumber' | 'BadgeAvatar' | 'BadgeCart' // Specialized
12
- *
13
- * ★ ━━━━ ☆ ━━━━ USAGE ━━━━ ☆ ━━━━ ★
14
- *
15
- * ★ ━━━━━━━━━ Interactive Badges ━━━━━━━━━ ★
16
- * ```jsx
17
- * // Closable - Click X to close
18
- * <BadgeX badge="Closable" text="Click to close" />
19
- *
20
- * // Selectable - Click to toggle selection
21
- * <BadgeX
22
- * badge="Selectable"
23
- * text="Select me"
24
- * selectedText="Selected!"
25
- * />
26
- *
27
- * // Link - Clickable badge
28
- * <BadgeX badge="BadgeLink" text="View details" />
29
- * ```
30
- *
31
- * ★ ━━━━━━━━━ Status Indicators ━━━━━━━━━ ★
32
- * ```jsx
33
- * <BadgeX badge="InProgress" />
34
- * <BadgeX badge="BadgeCompleted" />
35
- * <BadgeX badge="BadgePending" />
36
- * <BadgeX badge="BadgeFailed" />
37
- * <BadgeX badge="BadgeSuccessful" />
38
- * <BadgeX badge="BadgeBlocked" />
39
- * ```
40
- *
41
- * ★ ━━━━━━━━━ Visual Styles ━━━━━━━━━ ★
42
- * ```jsx
43
- * // Dot Indicator
44
- * <BadgeX badge="Dot" />
45
- *
46
- * // With Icon
47
- * <BadgeX
48
- * badge="BadgeWithIcon"
49
- * text="Premium"
50
- * icon="★"
51
- * />
52
- *
53
- * // Gradient
54
- * <BadgeX badge="BadgeGradient" text="Premium" />
55
- *
56
- * // Gradient Outline
57
- * <BadgeX badge="BadgeGradientOutline" text="Special Offer" />
58
- *
59
- * // Rounded
60
- * <BadgeX badge="BadgeRounded" text="Rounded Style" />
61
- *
62
- * // Animated
63
- * <BadgeX
64
- * badge="BadgeAnimated"
65
- * text="🎉 Check out our new features! 🚀"
66
- * subText="New"
67
- * />
68
- * ```
69
- *
70
- * ★ ━━━━━━━━━ Size Variants ━━━━━━━━━ ★
71
- * ```jsx
72
- * <BadgeX badge="BadgeSmall" text="Small" />
73
- * <BadgeX text="Default Size" />
74
- * <BadgeX badge="BadgeLarge" text="Large" />
75
- * ```
76
- *
77
- * ★ ━━━━━━━━━ Specialized Badges ━━━━━━━━━ ★
78
- * ```jsx
79
- * // Number Badge
80
- * <BadgeX badge="BadgeNumber" text="99+" />
81
- *
82
- * // Avatar Badge
83
- * <BadgeX
84
- * badge="BadgeAvatar"
85
- * text="John Doe"
86
- * src="https://api.dicebear.com/7.x/avataaars/svg?seed=John"
87
- * />
88
- *
89
- * // Cart Notification (used with button)
90
- * <div className="relative">
91
- * <button className="p-2 border rounded-lg hover:bg-muted">
92
- * 🛒 Cart
93
- * <BadgeX
94
- * badge="BadgeCart"
95
- * text="3"
96
- * className="absolute -top-1 -right-1"
97
- * />
98
- * </button>
99
- * </div>
100
- * ```
101
- *
102
- * ★ ━━━━━━━━━ Custom Usage Example ━━━━━━━━━ ★
103
- * ```jsx
104
- * // Project Status Board
105
- * <div className="space-y-3">
106
- * <div className="flex items-center gap-2">
107
- * <BadgeX badge="BadgeCompleted" />
108
- * <span>Authentication Module</span>
109
- * </div>
110
- * <div className="flex items-center gap-2">
111
- * <BadgeX badge="InProgress" text="In Development" />
112
- * <span>Dashboard Analytics</span>
113
- * </div>
114
- * <div className="flex items-center gap-2">
115
- * <BadgeX badge="BadgePending" />
116
- * <span>API Integration</span>
117
- * </div>
118
- * </div>
119
- *
120
- * // Team Members Display
121
- * <div className="flex flex-wrap gap-3">
122
- * <BadgeX badge="BadgeAvatar" text="Alex Chen" />
123
- * <BadgeX badge="BadgeAvatar" text="Maria Garcia" />
124
- * <BadgeX
125
- * badge="BadgeWithIcon"
126
- * text="Admin"
127
- * icon="👑"
128
- * />
129
- * <BadgeX badge="BadgeLink" text="Add Member" />
130
- * </div>
131
- * ```
132
- *
133
- * ★ ━━━━━━━━━ Props ━━━━━━━━━ ★
134
- *
135
- * BadgeX Props:
136
- * - `badge`: BadgeXType - Specifies which variant to use
137
- * - `text`: string - Custom text content (overrides children)
138
- * - `selectedText`: string - Text to show when selected (for Selectable badge)
139
- * - `icon`: string | ReactNode - Icon to display (for BadgeWithIcon)
140
- * - `src`: string - Image source URL (for BadgeAvatar)
141
- * - `subText`: string - Secondary text (for BadgeAnimated)
142
- * - `className`: string - Additional CSS classes
143
- * - `variant`: 'default' | 'secondary' | 'destructive' | 'outline' - Underlying Catalyst UI variant
144
- * - `onClose`: () => void - Callback when closable badge is closed
145
- * - `onClick`: () => void - Click handler for interactive badges
146
- * - All other props are passed to the underlying Badge component
147
- *
148
- * ★ ━━━━━━━━━ Basic Usage ━━━━━━━━━ ★
149
- * ```javascript
150
- * import { BadgeX } from "./BadgeX";
151
- *
152
- * // Default badge
153
- * <BadgeX>Default</BadgeX>
154
- *
155
- * // Specific variant
156
- * <BadgeX badge="BadgeCompleted">Completed</BadgeX>
157
- *
158
- * // With custom text
159
- * <BadgeX badge="InProgress" text="Processing" />
160
- * ```
161
- *
162
- */
163
-
164
- export function BadgeX({ badge = 'default', children, ...props }: any) {
165
- switch (badge) {
166
- case 'Closable':
167
- return <BadgeClosable {...props} >{children}</BadgeClosable>;
168
- case 'Selectable':
169
- return <BadgeSelectable {...props} >{children}</BadgeSelectable>;
170
- case 'InProgress':
171
- return <BadgeInProgress {...props}>{children}</BadgeInProgress>;
172
- case 'Dot':
173
- return <BadgeDot {...props}>{children}</BadgeDot>;
174
- case 'BadgeBlocked':
175
- return <BadgeBlocked {...props}>{children}</BadgeBlocked>;
176
- case 'BadgeCompleted':
177
- return <BadgeCompleted {...props}>{children}</BadgeCompleted>;
178
- case 'BadgeStatusOnline':
179
- return <BadgeStatusOnline {...props}>{children}</BadgeStatusOnline>;
180
- case 'BadgeGradientOutline':
181
- return <BadgeGradientOutline {...props}>{children}</BadgeGradientOutline>;
182
- case 'BadgeLink':
183
- return <BadgeLink {...props}>{children}</BadgeLink>;
184
- case 'BadgeRounded':
185
- return <BadgeRounded {...props}>{children}</BadgeRounded>;
186
- case 'BadgeNumber':
187
- return <BadgeNumber {...props}>{children}</BadgeNumber>;
188
- case 'BadgeLarge':
189
- return <BadgeLarge {...props}>{children}</BadgeLarge>;
190
- case 'BadgeSmall':
191
- return <BadgeSmall {...props}>{children}</BadgeSmall>;
192
- case 'BadgeWithIcon':
193
- return <BadgeWithIcon {...props}>{children}</BadgeWithIcon>;
194
- case 'BadgeGradient':
195
- return <BadgeGradient {...props}>{children}</BadgeGradient>;
196
- case 'BadgePending':
197
- return <BadgePending {...props}>{children}</BadgePending>;
198
- case 'BadgeFailed':
199
- return <BadgeFailed {...props}>{children}</BadgeFailed>;
200
- case 'BadgeSuccessful':
201
- return <BadgeSuccessful {...props}>{children}</BadgeSuccessful>;
202
- case 'BadgeAvatar':
203
- return <BadgeAvatar {...props}>{children}</BadgeAvatar>;
204
- case 'BadgeCart':
205
- return <BadgeCart {...props}>{children}</BadgeCart>;
206
- case 'BadgeAnimated':
207
- return <BadgeAnimated {...props}>{children}</BadgeAnimated>;
208
- default:
209
- return <Badge {...props}>{children}</Badge>;
210
- }
211
- }
212
-
213
-
214
- const BadgeClosable = ({ text = "closeable", className, variant = 'closable', children, ...props }) => {
215
- const [isActive, setIsActive] = useState(true)
216
-
217
- if (!isActive) return null
218
-
219
- return (
220
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
221
- {children ? children : text}
222
- <button
223
- className='focus-visible:border-ring focus-visible:ring-ring/50 text-primary-foreground/60 hover:text-primary-foreground -my-px -ms-px -me-1.5 inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-[inherit] p-0 transition-[color,box-shadow] outline-none focus-visible:ring-[3px]'
224
- aria-label='Close'
225
- onClick={() => setIsActive(false)}
226
- >
227
- <span className='size-3' aria-hidden='true'>✗</span>
228
- </button>
229
- </Badge>
230
- )
231
- }
232
- const BadgeSelectable = ({ text = "Selectable", selectedText = "Selected", className, variant = 'selectable', children, ...props }) => {
233
- const [selected, setSelected] = useState(false)
234
- const id = useId()
235
- const badgeText = selected ? selectedText : text
236
- return (
237
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
238
- <input
239
- type="checkbox"
240
- id={id}
241
- className='peer sr-only'
242
- checked={selected}
243
- onChange={(e) => setSelected(e.target.checked)}
244
- />
245
- <span
246
- className='hidden size-3 text-green-600 peer-checked:block dark:text-green-400'
247
- aria-hidden='true'
248
- >
249
-
250
- </span>
251
- <label htmlFor={id} className='cursor-pointer select-none'>
252
- {children ? children : badgeText}
253
- </label>
254
- </Badge>
255
- )
256
- }
257
- const BadgeInProgress = ({ text = "In Progress", className, variant = 'in-progress', children, ...props }) => {
258
- return (
259
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
260
- <span className='size-1.5 rounded-full bg-amber-600 dark:bg-amber-400' aria-hidden='true' />
261
- {children ? children : text}
262
- </Badge>
263
- )
264
- }
265
- const BadgeDot = ({ text = "Dot Badge", className, variant = 'dot', children, ...props }) => {
266
- return (
267
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
268
- <span className='bg-primary size-2 rounded-full' aria-hidden='true' />
269
- {children ? children : text}
270
- </Badge>
271
- )
272
- }
273
- const BadgeBlocked = ({ text = "Blocked", className, variant = 'blocked', children, ...props }) => {
274
- return (
275
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
276
- <span className='bg-destructive size-1.5 rounded-full' aria-hidden='true' />
277
- {children ? children : text}
278
- </Badge>
279
- )
280
- }
281
- const BadgeCompleted = ({ text = "Completed", className, variant = 'completed', children, ...props }) => {
282
- return (
283
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
284
- <span className='size-1.5 rounded-full bg-green-600 dark:bg-green-400' aria-hidden='true' />
285
- {children ? children : text}
286
- </Badge>
287
- )
288
- }
289
- const BadgeStatusOnline = ({ text = "Online", className, variant = 'status-online', children, ...props }) => {
290
- return (
291
- <div className='relative w-fit' className={cn(badgeVariants({ variant, className }))} {...props}>
292
- {/* Your Avatar component here */}
293
- <Badge >
294
- <span className='sr-only'>
295
- {children ? children : text}
296
- </span>
297
- </Badge>
298
- </div>
299
- )
300
- }
301
- const BadgeGradientOutline = ({ text = "Gradient Outline", className, variant = 'gradient-outline', children, ...props }) => {
302
- return (
303
- <div className='flex items-center justify-center rounded-full bg-gradient-to-r from-indigo-500 to-pink-500 p-0.5'>
304
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
305
- {children ? children : text}
306
- </Badge>
307
- </div>
308
- )
309
- }
310
- const BadgeLink = ({ text = "Link", className, variant = 'link', children, ...props }) => {
311
- return (
312
- <Badge asChild className={cn(badgeVariants({ variant, className }))} {...props}>
313
- <a href='#'>
314
- {children ? children : text} <span className='size-3' aria-hidden='true'>→</span>
315
- </a>
316
- </Badge>
317
- )
318
- }
319
- const BadgeRounded = ({ text = "Rounded", className, variant = 'rounded', children, ...props }) => {
320
- return <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
321
- {children ? children : text}
322
- </Badge>
323
- }
324
- const BadgeNumber = ({ text = "8", className, variant = 'number', children, ...props }) => {
325
- return <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
326
- {children ? children : text}
327
- </Badge>
328
- }
329
- const BadgeLarge = ({ text = "Large", className, variant = 'large', children, ...props }) => {
330
- return <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
331
- {children ? children : text}
332
- </Badge>
333
- }
334
- const BadgeSmall = ({ text = "Small", className, variant = 'small', children, ...props }) => {
335
- return <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
336
- {children ? children : text}
337
- </Badge>
338
- }
339
- const BadgeWithIcon = ({ text = "With Icon", icon, className, variant = 'with-icon', children, ...props }) => {
340
- return (
341
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
342
- <span className='size-3' aria-hidden='true'>{icon ? icon : '★'}</span>
343
- {children ? children : text}
344
- </Badge>
345
- )
346
- }
347
- const BadgeGradient = ({ text = "Gradient", className, variant = 'gradient', children, ...props }) => {
348
- return (
349
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
350
- {children ? children : text}
351
- </Badge>
352
- )
353
- }
354
- const BadgePending = ({ text = "Pending", className, variant = 'pending', children, ...props }) => {
355
- return (
356
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
357
- <span className='size-3' aria-hidden='true'>⚠</span>
358
- {children ? children : text}
359
- </Badge>
360
- )
361
- }
362
- const BadgeFailed = ({ text = "Failed", className, variant = 'failed', children, ...props }) => {
363
- return (
364
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
365
- <span className='size-3' aria-hidden='true'>⊘</span>
366
- {children ? children : text}
367
- </Badge>
368
- )
369
- }
370
- const BadgeSuccessful = ({ text = "Successful", className, variant = 'successful', children, ...props }) => {
371
- return (
372
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
373
- <span className='size-3' aria-hidden='true'>✓</span>
374
- {children ? children : text}
375
- </Badge>
376
- )
377
- }
378
- const BadgeAvatar = ({ text = "Blocked", src = "https://cdn.shadcnstudio.com/ss-assets/avatar/avatar-5.png", className, variant = 'avatar', children, ...props }) => {
379
- return (
380
- <Badge className={cn(badgeVariants({ variant, className }))} {...props}>
381
- <img
382
- src={src}
383
- alt='Avatar'
384
- className='size-6 rounded-full'
385
- />
386
- {children ? children : text}
387
- </Badge>
388
- )
389
- }
390
- const BadgeCart = ({ text = "Cart", className, variant = 'cart', children, ...props }) => {
391
- return (
392
- <div className='relative w-fit' >
393
- {/* Your cart icon/avatar here */}
394
- <Badge className={cn(badgeVariants({ variant, className }))} {...props} >
395
- {children ? children : text}
396
- </Badge>
397
- </div>
398
- )
399
- }
400
- const BadgeAnimated = ({ text = "🎉 Amazing Features! 🪄", subText = 'New', className, variant = 'animated', children, ...props }) => {
401
- return (
402
- <Badge showBeam className={cn(badgeVariants({ variant, className }))} {...props}>
403
- <span className="bg-primary text-primary-foreground rounded-full px-1.5">
404
- {subText}
405
- </span>
406
- <span className="text-sm text-wrap">
407
- {children ? children : text}
408
- </span>
409
- </Badge>
410
- )
411
- }
412
-
413
-
414
- export function BadgeXDemo() {
415
- const [selectedBadges, setSelectedBadges] = useState({});
416
-
417
- return (
418
- <div className="p-8 max-w-7xl mx-auto bg-background">
419
- <header className="mb-12">
420
- <h1 className="text-4xl font-bold mb-2">BadgeX Demo</h1>
421
- <p className="text-muted-foreground">
422
- A comprehensive collection of badge variants built with Catalyst UI
423
- </p>
424
- </header>
425
-
426
- <div className="space-y-12">
427
- {/* Section 1: Interactive Badges */}
428
- <section>
429
- <h2 className="text-2xl font-semibold mb-6 pb-2 border-b">Interactive Badges</h2>
430
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
431
- <div className="space-y-4 p-4 border rounded-lg">
432
- <h3 className="font-medium">Closable</h3>
433
- <p className="text-sm text-muted-foreground mb-2">Click the X to close</p>
434
- <BadgeX badge="Closable" text="Click to close" />
435
- </div>
436
-
437
- <div className="space-y-4 p-4 border rounded-lg">
438
- <h3 className="font-medium">Selectable</h3>
439
- <p className="text-sm text-muted-foreground mb-2">Click to toggle selection</p>
440
- <BadgeX
441
- badge="Selectable"
442
- text="Select me"
443
- selectedText="Selected!"
444
- />
445
- </div>
446
-
447
- <div className="space-y-4 p-4 border rounded-lg">
448
- <h3 className="font-medium">Link</h3>
449
- <p className="text-sm text-muted-foreground mb-2">Clickable badge link</p>
450
- <BadgeX badge="BadgeLink" text="View details" />
451
- </div>
452
- </div>
453
- </section>
454
-
455
- {/* Section 2: Status Badges */}
456
- <section>
457
- <h2 className="text-2xl font-semibold mb-6 pb-2 border-b">Status Indicators</h2>
458
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
459
- <div className="space-y-4 p-4 border rounded-lg">
460
- <h3 className="font-medium">In Progress</h3>
461
- <BadgeX badge="InProgress" />
462
- </div>
463
-
464
- <div className="space-y-4 p-4 border rounded-lg">
465
- <h3 className="font-medium">Completed</h3>
466
- <BadgeX badge="BadgeCompleted" />
467
- </div>
468
-
469
- <div className="space-y-4 p-4 border rounded-lg">
470
- <h3 className="font-medium">Pending</h3>
471
- <BadgeX badge="BadgePending" />
472
- </div>
473
-
474
- <div className="space-y-4 p-4 border rounded-lg">
475
- <h3 className="font-medium">Failed</h3>
476
- <BadgeX badge="BadgeFailed" />
477
- </div>
478
-
479
- <div className="space-y-4 p-4 border rounded-lg">
480
- <h3 className="font-medium">Successful</h3>
481
- <BadgeX badge="BadgeSuccessful" />
482
- </div>
483
-
484
- <div className="space-y-4 p-4 border rounded-lg">
485
- <h3 className="font-medium">Blocked</h3>
486
- <BadgeX badge="BadgeBlocked" />
487
- </div>
488
- </div>
489
- </section>
490
-
491
- {/* Section 3: Visual Styles */}
492
- <section>
493
- <h2 className="text-2xl font-semibold mb-6 pb-2 border-b">Visual Styles</h2>
494
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
495
- <div className="space-y-4 p-4 border rounded-lg">
496
- <h3 className="font-medium">Dot Indicator</h3>
497
- <BadgeX badge="Dot" />
498
- </div>
499
-
500
- <div className="space-y-4 p-4 border rounded-lg">
501
- <h3 className="font-medium">With Icon</h3>
502
- <BadgeX
503
- badge="BadgeWithIcon"
504
- text="Premium"
505
- icon="★"
506
- />
507
- </div>
508
-
509
- <div className="space-y-4 p-4 border rounded-lg">
510
- <h3 className="font-medium">Gradient</h3>
511
- <BadgeX badge="BadgeGradient" text="Premium" />
512
- </div>
513
-
514
- <div className="space-y-4 p-4 border rounded-lg">
515
- <h3 className="font-medium">Gradient Outline</h3>
516
- <BadgeX badge="BadgeGradientOutline" text="Special Offer" />
517
- </div>
518
-
519
- <div className="space-y-4 p-4 border rounded-lg">
520
- <h3 className="font-medium">Rounded</h3>
521
- <BadgeX badge="BadgeRounded" text="Rounded Style" />
522
- </div>
523
-
524
- <div className="space-y-4 p-4 border rounded-lg">
525
- <h3 className="font-medium">Animated</h3>
526
- <BadgeX
527
- badge="BadgeAnimated"
528
- text="🎉 Check out our new features! 🚀"
529
- subText="New"
530
- />
531
- </div>
532
- </div>
533
- </section>
534
-
535
- {/* Section 4: Sizes */}
536
- <section>
537
- <h2 className="text-2xl font-semibold mb-6 pb-2 border-b">Size Variants</h2>
538
- <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
539
- <div className="space-y-4 p-4 border rounded-lg">
540
- <h3 className="font-medium">Small</h3>
541
- <BadgeX badge="BadgeSmall" text="Small" />
542
- </div>
543
-
544
- <div className="space-y-4 p-4 border rounded-lg">
545
- <h3 className="font-medium">Default</h3>
546
- <BadgeX text="Default Size" />
547
- </div>
548
-
549
- <div className="space-y-4 p-4 border rounded-lg">
550
- <h3 className="font-medium">Large</h3>
551
- <BadgeX badge="BadgeLarge" text="Large" />
552
- </div>
553
- </div>
554
- </section>
555
-
556
- {/* Section 5: Specialized Badges */}
557
- <section>
558
- <h2 className="text-2xl font-semibold mb-6 pb-2 border-b">Specialized</h2>
559
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
560
- <div className="space-y-4 p-4 border rounded-lg">
561
- <h3 className="font-medium">Number</h3>
562
- <BadgeX badge="BadgeNumber" text="99+" />
563
- </div>
564
-
565
- <div className="space-y-4 p-4 border rounded-lg">
566
- <h3 className="font-medium">Avatar</h3>
567
- <BadgeX
568
- badge="BadgeAvatar"
569
- text="John Doe"
570
- src="https://api.dicebear.com/7.x/avataaars/svg?seed=John"
571
- />
572
- </div>
573
-
574
- <div className="space-y-4 p-4 border rounded-lg">
575
- <h3 className="font-medium">Cart Notification</h3>
576
- <div className="relative">
577
- <button className="p-2 border rounded-lg hover:bg-muted">
578
- 🛒 Cart
579
- <BadgeX
580
- badge="BadgeCart"
581
- text="3"
582
- className="absolute -top-1 -right-1"
583
- />
584
- </button>
585
- </div>
586
- </div>
587
- </div>
588
- </section>
589
-
590
- {/* Section 6: Custom Example */}
591
- <section>
592
- <h2 className="text-2xl font-semibold mb-6 pb-2 border-b">Custom Usage Example</h2>
593
- <div className="p-6 border rounded-lg bg-card">
594
- <div className="mb-6">
595
- <h3 className="font-medium mb-4">Project Status Board</h3>
596
- <div className="space-y-3">
597
- <div className="flex items-center gap-2">
598
- <BadgeX badge="BadgeCompleted" />
599
- <span>Authentication Module</span>
600
- </div>
601
- <div className="flex items-center gap-2">
602
- <BadgeX badge="InProgress" text="In Development" />
603
- <span>Dashboard Analytics</span>
604
- </div>
605
- <div className="flex items-center gap-2">
606
- <BadgeX badge="BadgePending" />
607
- <span>API Integration</span>
608
- </div>
609
- <div className="flex items-center gap-2">
610
- <BadgeX badge="BadgeBlocked" />
611
- <span>Payment Gateway</span>
612
- </div>
613
- </div>
614
- </div>
615
-
616
- <div>
617
- <h3 className="font-medium mb-4">Team Members</h3>
618
- <div className="flex flex-wrap gap-3">
619
- <BadgeX badge="BadgeAvatar" text="Alex Chen" />
620
- <BadgeX badge="BadgeAvatar" text="Maria Garcia" />
621
- <BadgeX
622
- badge="BadgeWithIcon"
623
- text="Admin"
624
- icon="👑"
625
- />
626
- <BadgeX
627
- badge="BadgeLink"
628
- text="Add Member"
629
- />
630
- </div>
631
- </div>
632
- </div>
633
- </section>
634
-
635
- {/* Usage Instructions */}
636
- <section className="mt-12 p-6 border rounded-lg bg-muted/30">
637
- <h2 className="text-2xl font-semibold mb-4">Usage</h2>
638
- <div className="space-y-4">
639
- <div>
640
- <h3 className="font-medium mb-2">Basic Usage</h3>
641
- <pre className="bg-muted p-3 rounded text-sm overflow-x-auto">
642
- {`import { BadgeX } from "./BadgeX";
643
-
644
- // Default badge
645
- <BadgeX>Default</BadgeX>
646
-
647
- // Specific variant
648
- <BadgeX badge="BadgeCompleted">Completed</BadgeX>
649
-
650
- // With custom text
651
- <BadgeX badge="InProgress" text="Processing" />`}
652
- </pre>
653
- </div>
654
-
655
- <div>
656
- <h3 className="font-medium mb-2">Props</h3>
657
- <ul className="list-disc pl-5 space-y-1 text-sm">
658
- <li><code>badge</code>: Specifies which variant to use</li>
659
- <li><code>text</code>: Custom text content (overrides children)</li>
660
- <li><code>className</code>: Additional CSS classes</li>
661
- <li><code>variant</code>: Underlying Catalyst UI variant</li>
662
- <li>All other props are passed to the underlying Badge component</li>
663
- </ul>
664
- </div>
665
- </div>
666
- </section>
667
- </div>
668
- </div>
669
- );
670
- }