@catalystsoftware/ui 1.0.0

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 (157) hide show
  1. package/README.md +7 -0
  2. package/components/catalyst-ui/buttons/burger.tsx +207 -0
  3. package/components/catalyst-ui/core/data-display/timeline.tsx +210 -0
  4. package/components/catalyst-ui/core/feedback/alert.tsx +491 -0
  5. package/components/catalyst-ui/core/feedback/spinner-1.tsx +65 -0
  6. package/components/catalyst-ui/core/feedback/toast.tsx +1857 -0
  7. package/components/catalyst-ui/core/navigation/menu.tsx +164 -0
  8. package/components/catalyst-ui/forms/toggle-class.tsx +176 -0
  9. package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +419 -0
  10. package/components/catalyst-ui/hooks/use-counter.tsx +13 -0
  11. package/components/catalyst-ui/hooks/use-event-listener.tsx +23 -0
  12. package/components/catalyst-ui/hooks/use-export-markdown.tsx +47 -0
  13. package/components/catalyst-ui/hooks/use-focus.tsx +17 -0
  14. package/components/catalyst-ui/hooks/use-interval.tsx +23 -0
  15. package/components/catalyst-ui/hooks/use-is-client.tsx +16 -0
  16. package/components/catalyst-ui/hooks/use-media-query.tsx +19 -0
  17. package/components/catalyst-ui/hooks/use-mobile.tsx +19 -0
  18. package/components/catalyst-ui/hooks/use-resize-observer.tsx +81 -0
  19. package/components/catalyst-ui/hooks/use-timeout.tsx +21 -0
  20. package/components/catalyst-ui/hooks/use-timer.tsx +209 -0
  21. package/components/catalyst-ui/hooks/use-toggle.tsx +12 -0
  22. package/components/catalyst-ui/media/image.tsx +13 -0
  23. package/components/catalyst-ui/overlays/dual-sidebar.tsx +4142 -0
  24. package/components/catalyst-ui/overlays/sidebar-original.tsx +726 -0
  25. package/components/catalyst-ui/primitives/accordion.tsx +250 -0
  26. package/components/catalyst-ui/primitives/alert-dialog.tsx +126 -0
  27. package/components/catalyst-ui/primitives/aspect-ratio.tsx +9 -0
  28. package/components/catalyst-ui/primitives/avatar.tsx +296 -0
  29. package/components/catalyst-ui/primitives/badge.tsx +57 -0
  30. package/components/catalyst-ui/primitives/breadcrumb.tsx +101 -0
  31. package/components/catalyst-ui/primitives/button.tsx +265 -0
  32. package/components/catalyst-ui/primitives/calendar-v4.tsx +208 -0
  33. package/components/catalyst-ui/primitives/calendar.tsx +295 -0
  34. package/components/catalyst-ui/primitives/card.tsx +618 -0
  35. package/components/catalyst-ui/primitives/carousel.tsx +238 -0
  36. package/components/catalyst-ui/primitives/chart.tsx +347 -0
  37. package/components/catalyst-ui/primitives/checkbox.tsx +225 -0
  38. package/components/catalyst-ui/primitives/collapsible.tsx +212 -0
  39. package/components/catalyst-ui/primitives/command.tsx +393 -0
  40. package/components/catalyst-ui/primitives/context-menu.tsx +236 -0
  41. package/components/catalyst-ui/primitives/dialog.tsx +471 -0
  42. package/components/catalyst-ui/primitives/drawer.tsx +761 -0
  43. package/components/catalyst-ui/primitives/dropdown-menu.tsx +290 -0
  44. package/components/catalyst-ui/primitives/empty.tsx +104 -0
  45. package/components/catalyst-ui/primitives/field.tsx +244 -0
  46. package/components/catalyst-ui/primitives/hover-card.tsx +124 -0
  47. package/components/catalyst-ui/primitives/input-otp.tsx +76 -0
  48. package/components/catalyst-ui/primitives/input.tsx +64 -0
  49. package/components/catalyst-ui/primitives/item.tsx +196 -0
  50. package/components/catalyst-ui/primitives/kbd.tsx +75 -0
  51. package/components/catalyst-ui/primitives/label.tsx +24 -0
  52. package/components/catalyst-ui/primitives/navigation-menu.tsx +150 -0
  53. package/components/catalyst-ui/primitives/pagination.tsx +198 -0
  54. package/components/catalyst-ui/primitives/popover.tsx +232 -0
  55. package/components/catalyst-ui/primitives/progress.tsx +34 -0
  56. package/components/catalyst-ui/primitives/radio-group.tsx +43 -0
  57. package/components/catalyst-ui/primitives/resizable.tsx +56 -0
  58. package/components/catalyst-ui/primitives/select.tsx +155 -0
  59. package/components/catalyst-ui/primitives/separator.tsx +74 -0
  60. package/components/catalyst-ui/primitives/sheet.tsx +126 -0
  61. package/components/catalyst-ui/primitives/skeleton.tsx +15 -0
  62. package/components/catalyst-ui/primitives/slider.tsx +27 -0
  63. package/components/catalyst-ui/primitives/switch.tsx +187 -0
  64. package/components/catalyst-ui/primitives/tabs.tsx +335 -0
  65. package/components/catalyst-ui/primitives/textarea.tsx +24 -0
  66. package/components/catalyst-ui/primitives/toggle-group.tsx +55 -0
  67. package/components/catalyst-ui/primitives/toggle.tsx +42 -0
  68. package/components/catalyst-ui/primitives/tooltip.tsx +116 -0
  69. package/components/catalyst-ui/utils/basic-auth.tsx +40 -0
  70. package/components/catalyst-ui/utils/context-storage.tsx +19 -0
  71. package/components/catalyst-ui/utils/cors-middleware.tsx +71 -0
  72. package/components/catalyst-ui/utils/deferred-content.tsx +595 -0
  73. package/components/catalyst-ui/utils/honeypot-middleware.tsx +38 -0
  74. package/components/catalyst-ui/utils/incId.tsx +75 -0
  75. package/components/catalyst-ui/utils/jwk-auth.tsx +36 -0
  76. package/components/catalyst-ui/utils/request-id.tsx +14 -0
  77. package/components/catalyst-ui/utils/secure-headers.tsx +37 -0
  78. package/components/catalyst-ui/utils/server-timing.tsx +23 -0
  79. package/components/catalyst-ui/utils/utils.ts +43 -0
  80. package/components/catalyst-ui/utils/with-cookie.tsx +43 -0
  81. package/components/catalyst-ui/x/accordian-x.tsx +428 -0
  82. package/components/catalyst-ui/x/alert-x.tsx +413 -0
  83. package/components/catalyst-ui/x/animated-text-x.tsx +2242 -0
  84. package/components/catalyst-ui/x/avatar-x.tsx +515 -0
  85. package/components/catalyst-ui/x/badge-x.tsx +670 -0
  86. package/components/catalyst-ui/x/button-X.tsx +2857 -0
  87. package/components/catalyst-ui/x/button-group-x.tsx +847 -0
  88. package/components/catalyst-ui/x/calendar-x.tsx +1910 -0
  89. package/components/catalyst-ui/x/card-x.tsx +2597 -0
  90. package/components/catalyst-ui/x/checkbox-x.tsx +656 -0
  91. package/components/catalyst-ui/x/collapsible-x.tsx +1360 -0
  92. package/components/catalyst-ui/x/combobox-x.tsx +911 -0
  93. package/components/catalyst-ui/x/data-table-x.tsx +1753 -0
  94. package/components/catalyst-ui/x/date-picker-x.tsx +648 -0
  95. package/components/catalyst-ui/x/dialog-x.tsx +659 -0
  96. package/components/catalyst-ui/x/dropdown-menu-x.tsx +612 -0
  97. package/components/catalyst-ui/x/hover-card-x.tsx +375 -0
  98. package/components/catalyst-ui/x/icon-x.tsx +840 -0
  99. package/components/catalyst-ui/x/input-mask-x.tsx +981 -0
  100. package/components/catalyst-ui/x/input-otp-x.tsx +659 -0
  101. package/components/catalyst-ui/x/loader-x.tsx +1757 -0
  102. package/components/catalyst-ui/x/pagination-x.tsx +622 -0
  103. package/components/catalyst-ui/x/popover-x.tsx +744 -0
  104. package/components/catalyst-ui/x/radio-group-x.tsx +499 -0
  105. package/components/catalyst-ui/x/select-x.tsx +1127 -0
  106. package/components/catalyst-ui/x/sheet-x.tsx +668 -0
  107. package/components/catalyst-ui/x/switch-x.tsx +681 -0
  108. package/components/catalyst-ui/x/table-x.tsx +574 -0
  109. package/components/catalyst-ui/x/tabs-x.tsx +839 -0
  110. package/components/catalyst-ui/x/textarea-x.tsx +1263 -0
  111. package/components/catalyst-ui/x/tooltip-x.tsx +396 -0
  112. package/components/catalyst-ui/x/tracker-x.tsx +560 -0
  113. package/data/bg-data.tsx +901 -0
  114. package/data/buttons-data.tsx +2327 -0
  115. package/data/charts-data.tsx +102 -0
  116. package/data/chat-data.tsx +83 -0
  117. package/data/code-data.tsx +1040 -0
  118. package/data/comboboxes-data.tsx +1843 -0
  119. package/data/command-data.tsx +1381 -0
  120. package/data/core-data.tsx +15953 -0
  121. package/data/crm-data.tsx +47 -0
  122. package/data/data.tsx +159 -0
  123. package/data/date-and-time-data.tsx +554 -0
  124. package/data/dependencies.tsx +7 -0
  125. package/data/ecommerce-data.tsx +1387 -0
  126. package/data/forms-data.tsx +7890 -0
  127. package/data/hooks-data.tsx +5487 -0
  128. package/data/index.ts +34 -0
  129. package/data/inputs-data.tsx +557 -0
  130. package/data/interactive-data.tsx +5394 -0
  131. package/data/lofi-data.tsx +18295 -0
  132. package/data/marketing-data.tsx +2546 -0
  133. package/data/media-data.tsx +1510 -0
  134. package/data/motion-data.tsx +5801 -0
  135. package/data/overlay-data.tsx +4136 -0
  136. package/data/pdf-data.tsx +124 -0
  137. package/data/pos-data.tsx +213 -0
  138. package/data/postcss.config.js +6 -0
  139. package/data/primitive-data.tsx +5170 -0
  140. package/data/prompt-data.tsx +1226 -0
  141. package/data/requiredLibs.ts +4 -0
  142. package/data/sandbox-data.tsx +1 -0
  143. package/data/sidebars-data.tsx +5421 -0
  144. package/data/stacks-data.tsx +32 -0
  145. package/data/table-data.tsx +706 -0
  146. package/data/tailwind.config.js +3830 -0
  147. package/data/tailwind.config.ngin.js +3830 -0
  148. package/data/tailwind.css +431 -0
  149. package/data/tools-data.tsx +6910 -0
  150. package/data/typography-data.tsx +2050 -0
  151. package/data/utils-data.tsx +6500 -0
  152. package/data/x-data.tsx +1171 -0
  153. package/dist/index.d.ts +3 -0
  154. package/dist/index.d.ts.map +1 -0
  155. package/dist/index.js +30245 -0
  156. package/dist/index.js.map +362 -0
  157. package/package.json +50 -0
@@ -0,0 +1,499 @@
1
+ /**
2
+
3
+ const RadioGroupDemo = () => {
4
+ return (
5
+ <RadioGroup defaultValue='higher-secondary'>
6
+ <div className='flex items-center gap-2'>
7
+ <RadioGroupItem value='higher-secondary' id='higher-secondary' />
8
+ <Label htmlFor='higher-secondary'>Higher Secondary</Label>
9
+ </div>
10
+ <div className='flex items-center gap-2'>
11
+ <RadioGroupItem value='graduation' id='graduation' />
12
+ <Label htmlFor='graduation'>Graduation</Label>
13
+ </div>
14
+ <div className='flex items-center gap-2'>
15
+ <RadioGroupItem value='post-graduation' id='post-graduation' />
16
+ <Label htmlFor='post-graduation'>Post Graduation</Label>
17
+ </div>
18
+ </RadioGroup>
19
+ )
20
+ }
21
+
22
+ const RadioGroupHorizontalDemo = () => {
23
+ return (
24
+ <RadioGroup defaultValue='beginner' className='flex items-center gap-4'>
25
+ <div className='flex items-center gap-2'>
26
+ <RadioGroupItem value='beginner' id='beginner' />
27
+ <Label htmlFor='beginner'>Beginner</Label>
28
+ </div>
29
+ <div className='flex items-center gap-2'>
30
+ <RadioGroupItem value='intermediate' id='intermediate' />
31
+ <Label htmlFor='intermediate'>Intermediate</Label>
32
+ </div>
33
+ <div className='flex items-center gap-2'>
34
+ <RadioGroupItem value='advanced' id='advanced' />
35
+ <Label htmlFor='advanced'>Advanced</Label>
36
+ </div>
37
+ </RadioGroup>
38
+ )
39
+ }
40
+
41
+ const RadioGroupColorsDemo = () => {
42
+ return (
43
+ <RadioGroup defaultValue='destructive' className='flex items-center gap-4'>
44
+ <div className='flex items-center gap-2'>
45
+ <RadioGroupItem
46
+ value='destructive'
47
+ id='color-destructive'
48
+ className='border-destructive text-destructive [&_svg]:fill-destructive focus-visible:ring-destructive/20 focus-visible:border-destructive dark:focus-visible:ring-destructive/40'
49
+ />
50
+ <Label htmlFor='color-destructive'>Destructive</Label>
51
+ </div>
52
+ <div className='flex items-center gap-2'>
53
+ <RadioGroupItem
54
+ value='success'
55
+ id='color-success'
56
+ className='border-green-600 text-green-600 focus-visible:border-green-600 focus-visible:ring-green-600/20 dark:border-green-400 dark:text-green-400 dark:focus-visible:border-green-400 dark:focus-visible:ring-green-400/40 [&_svg]:fill-green-600 dark:[&_svg]:fill-green-400'
57
+ />
58
+ <Label htmlFor='color-success'>Success</Label>
59
+ </div>
60
+ <div className='flex items-center gap-2'>
61
+ <RadioGroupItem
62
+ value='info'
63
+ id='color-info'
64
+ className='border-sky-600 text-sky-600 focus-visible:border-sky-600 focus-visible:ring-sky-600/20 dark:border-sky-400 dark:text-sky-400 dark:focus-visible:border-sky-400 dark:focus-visible:ring-sky-400/40 [&_svg]:fill-sky-600 dark:[&_svg]:fill-sky-400'
65
+ />
66
+ <Label htmlFor='color-info'>Info</Label>
67
+ </div>
68
+ </RadioGroup>
69
+ )
70
+ }
71
+
72
+ const RadioGroupSizesDemo = () => {
73
+ return (
74
+ <RadioGroup defaultValue='default' className='flex items-center gap-4'>
75
+ <div className='flex items-center gap-2'>
76
+ <RadioGroupItem value='default' id='size-default' />
77
+ <Label htmlFor='size-default'>Default</Label>
78
+ </div>
79
+ <div className='flex items-center gap-2'>
80
+ <RadioGroupItem value='medium' id='size-medium' className='size-5 [&_svg]:size-3' />
81
+ <Label htmlFor='size-medium'>Medium</Label>
82
+ </div>
83
+ <div className='flex items-center gap-2'>
84
+ <RadioGroupItem value='large' id='size-large' className='size-6 [&_svg]:size-3.5' />
85
+ <Label htmlFor='size-large'>Large</Label>
86
+ </div>
87
+ </RadioGroup>
88
+ )
89
+ }
90
+
91
+ const RadioGroupDashedDemo = () => {
92
+ return (
93
+ <RadioGroup defaultValue='standard'>
94
+ <div className='flex items-center gap-2'>
95
+ <RadioGroupItem
96
+ value='standard'
97
+ id='standard'
98
+ className='border-primary focus-visible:border-primary border-dashed'
99
+ />
100
+ <Label htmlFor='standard'>Standard Shipping</Label>
101
+ </div>
102
+ <div className='flex items-center gap-2'>
103
+ <RadioGroupItem
104
+ value='express'
105
+ id='express'
106
+ className='border-primary focus-visible:border-primary border-dashed'
107
+ />
108
+ <Label htmlFor='express'>Express Delivery</Label>
109
+ </div>
110
+ <div className='flex items-center gap-2'>
111
+ <RadioGroupItem
112
+ value='overnight'
113
+ id='overnight'
114
+ className='border-primary focus-visible:border-primary border-dashed'
115
+ />
116
+ <Label htmlFor='overnight'>Overnight Shipping</Label>
117
+ </div>
118
+ </RadioGroup>
119
+ )
120
+ }
121
+
122
+ const RadioGroupSolidDemo = () => {
123
+ return (
124
+ <RadioGroup defaultValue='light'>
125
+ <div className='flex items-center gap-2'>
126
+ <RadioGroupItem
127
+ value='light'
128
+ id='theme-light'
129
+ className='text-primary-foreground data-[state=checked]:bg-primary! data-[state=checked]:border-primary data-[state=checked]:[&_svg]:fill-primary-foreground'
130
+ />
131
+ <Label htmlFor='theme-light'>Light Theme</Label>
132
+ </div>
133
+ <div className='flex items-center gap-2'>
134
+ <RadioGroupItem
135
+ value='dark'
136
+ id='theme-dark'
137
+ className='text-primary-foreground data-[state=checked]:bg-primary! data-[state=checked]:border-primary data-[state=checked]:[&_svg]:fill-primary-foreground'
138
+ />
139
+ <Label htmlFor='theme-dark'>Dark Theme</Label>
140
+ </div>
141
+ <div className='flex items-center gap-2'>
142
+ <RadioGroupItem
143
+ value='system'
144
+ id='theme-system'
145
+ className='text-primary-foreground data-[state=checked]:bg-primary! data-[state=checked]:border-primary data-[state=checked]:[&_svg]:fill-primary-foreground'
146
+ />
147
+ <Label htmlFor='theme-system'>System Default</Label>
148
+ </div>
149
+ </RadioGroup>
150
+ )
151
+ }
152
+
153
+ const RadioGroupDescriptionDemo = () => {
154
+ return (
155
+ <RadioGroup defaultValue='basic'>
156
+ <div className='flex gap-2'>
157
+ <RadioGroupItem value='basic' id='plan-basic' />
158
+ <div className='grid flex-1 space-y-2'>
159
+ <Label htmlFor='plan-basic'>Basic Plan</Label>
160
+ <p className='text-muted-foreground text-xs'>Perfect for individuals just getting started</p>
161
+ </div>
162
+ </div>
163
+ <div className='flex gap-2'>
164
+ <RadioGroupItem value='pro' id='plan-pro' />
165
+ <div className='grid flex-1 space-y-2'>
166
+ <Label htmlFor='plan-pro'>Pro Plan</Label>
167
+ <p className='text-muted-foreground text-xs'>Advanced features for power users and small teams</p>
168
+ </div>
169
+ </div>
170
+ <div className='flex gap-2'>
171
+ <RadioGroupItem value='enterprise' id='plan-enterprise' />
172
+ <div className='grid flex-1 space-y-2'>
173
+ <Label htmlFor='plan-enterprise'>Enterprise Plan</Label>
174
+ <p className='text-muted-foreground text-xs'>Custom solutions for large organizations</p>
175
+ </div>
176
+ </div>
177
+ </RadioGroup>
178
+ )
179
+ }
180
+
181
+ const RadioGroupChipDemo = () => {
182
+ const id = useId()
183
+
184
+ const items = [
185
+ { value: '1', label: 'Size: 6 (UK)' },
186
+ { value: '2', label: 'Size: 7 (UK)', disabled: true },
187
+ { value: '3', label: 'Size: 8 (UK)' },
188
+ { value: '4', label: 'Size: 9 (UK)' },
189
+ { value: '5', label: 'Size: 10 (UK)' }
190
+ ]
191
+
192
+ return (
193
+ <fieldset className='w-full max-w-96 space-y-4'>
194
+ <legend className='text-foreground text-sm leading-none font-medium'>Select Shoe Size: </legend>
195
+ <RadioGroup className='grid grid-cols-3 gap-2' defaultValue='1'>
196
+ {items.map(item => (
197
+ <label
198
+ key={`${id}-${item.value}`}
199
+ className='border-input has-data-[state=checked]:border-primary/80 has-focus-visible:border-ring has-focus-visible:ring-ring/50 relative flex flex-col items-center gap-3 rounded-md border px-2 py-3 text-center shadow-xs transition-[color,box-shadow] outline-none has-focus-visible:ring-[3px] has-data-disabled:cursor-not-allowed has-data-disabled:opacity-50'
200
+ >
201
+ <RadioGroupItem
202
+ id={`${id}-${item.value}`}
203
+ value={item.value}
204
+ className='sr-only after:absolute after:inset-0'
205
+ aria-label={`size-radio-${item.value}`}
206
+ disabled={item.disabled}
207
+ />
208
+ <p className='text-foreground text-sm leading-none font-medium'>{item.label}</p>
209
+ </label>
210
+ ))}
211
+ </RadioGroup>
212
+ </fieldset>
213
+ )
214
+ }
215
+
216
+ const RadioGroupListGroupDemo = () => {
217
+ const id = useId()
218
+
219
+ const items = [
220
+ { value: '1', label: 'Pro', price: '$39/mo' },
221
+ { value: '2', label: 'Team', price: '$69/mo' },
222
+ { value: '3', label: 'Enterprise', price: 'Custom' }
223
+ ]
224
+
225
+ return (
226
+ <RadioGroup className='w-full max-w-96 gap-0 -space-y-px rounded-md shadow-xs' defaultValue='2'>
227
+ {items.map(item => (
228
+ <div
229
+ key={`${id}-${item.value}`}
230
+ className='border-input has-data-[state=checked]:border-primary/50 has-data-[state=checked]:bg-accent relative flex flex-col gap-4 border p-4 outline-none first:rounded-t-md last:rounded-b-md has-data-[state=checked]:z-10'
231
+ >
232
+ <div className='flex items-center justify-between'>
233
+ <div className='flex items-center gap-2'>
234
+ <RadioGroupItem
235
+ id={`${id}-${item.value}`}
236
+ value={item.value}
237
+ className='after:absolute after:inset-0'
238
+ aria-label={`plan-radio-${item.value}`}
239
+ aria-describedby={`${`${id}-${item.value}`}-price`}
240
+ />
241
+ <Label className='inline-flex items-center' htmlFor={`${id}-${item.value}`}>
242
+ {item.label}
243
+ {item.value === '2' && <Badge className='rounded-sm px-1.5 py-px text-xs'>Best Seller</Badge>}
244
+ </Label>
245
+ </div>
246
+ <div id={`${`${id}-${item.value}`}-price`} className='text-muted-foreground text-xs leading-[inherit]'>
247
+ {item.price}
248
+ </div>
249
+ </div>
250
+ </div>
251
+ ))}
252
+ </RadioGroup>
253
+ )
254
+ }
255
+
256
+ const RadioGroupSplitListGroupDemo = () => {
257
+ const id = useId()
258
+
259
+ const items = [
260
+ { value: '1', label: 'Pro', price: '$39/mo' },
261
+ { value: '2', label: 'Team', price: '$69/mo' },
262
+ { value: '3', label: 'Enterprise', price: 'Custom' }
263
+ ]
264
+
265
+ return (
266
+ <RadioGroup className='w-full max-w-96 gap-0 space-y-2 rounded-md *:rounded-full' defaultValue='2'>
267
+ {items.map(item => (
268
+ <div
269
+ key={`${id}-${item.value}`}
270
+ className='border-input has-data-[state=checked]:bg-primary has-data-[state=checked]:text-primary-foreground relative flex flex-col gap-4 border p-4 outline-none has-data-[state=checked]:z-10'
271
+ >
272
+ <div className='group flex items-center justify-between'>
273
+ <div className='flex items-center gap-2'>
274
+ <RadioGroupItem
275
+ id={`${id}-${item.value}`}
276
+ value={item.value}
277
+ aria-label={`plan-radio-${item.value}`}
278
+ className='text-primary bg-accent data-[state=checked]:bg-primary-foreground! data-[state=checked]:border-primary-foreground data-[state=checked]:[&_svg]:fill-primary after:absolute after:inset-0'
279
+ aria-describedby={`${`${id}-${item.value}`}-price`}
280
+ />
281
+ <Label className='inline-flex items-center' htmlFor={`${id}-${item.value}`}>
282
+ {item.label}
283
+ {item.value === '2' && (
284
+ <Badge
285
+ variant='outline'
286
+ className='rounded-sm border-green-500 bg-green-500/10 px-1.5 py-px text-xs text-green-500'
287
+ >
288
+ Best Seller
289
+ </Badge>
290
+ )}
291
+ </Label>
292
+ </div>
293
+ <div
294
+ id={`${`${id}-${item.value}`}-price`}
295
+ className='group-has-checked:text-primary-foreground text-xs leading-[inherit]'
296
+ >
297
+ {item.price}
298
+ </div>
299
+ </div>
300
+ </div>
301
+ ))}
302
+ </RadioGroup>
303
+ )
304
+ }
305
+
306
+ const RadioGroupCardRadioDemo = () => {
307
+ const id = useId()
308
+
309
+ return (
310
+ <RadioGroup className='w-full max-w-96 gap-2' defaultValue='1'>
311
+ <div className='border-input has-data-[state=checked]:border-primary/50 relative flex w-full items-center gap-2 rounded-md border p-4 shadow-xs outline-none'>
312
+ <RadioGroupItem
313
+ value='1'
314
+ id={`${id}-1`}
315
+ aria-label='plan-radio-basic'
316
+ aria-describedby={`${id}-1-description`}
317
+ className='size-5 after:absolute after:inset-0 [&_svg]:size-3'
318
+ />
319
+ <div className='grid grow gap-2'>
320
+ <Label htmlFor={`${id}-1`} className='justify-between'>
321
+ Basic <span className='text-muted-foreground text-xs leading-[inherit] font-normal'>Free</span>
322
+ </Label>
323
+ <p id={`${id}-1-description`} className='text-muted-foreground text-xs'>
324
+ Get 1 project with 1 teams members.
325
+ </p>
326
+ </div>
327
+ </div>
328
+
329
+ <div className='border-input has-data-[state=checked]:border-primary/50 relative flex w-full items-center gap-2 rounded-md border p-4 shadow-xs outline-none'>
330
+ <RadioGroupItem
331
+ value='2'
332
+ id={`${id}-2`}
333
+ aria-describedby={`${id}-2-description`}
334
+ className='size-5 after:absolute after:inset-0 [&_svg]:size-3'
335
+ />
336
+ <div className='grid grow gap-2'>
337
+ <Label htmlFor={`${id}-2`} className='justify-between'>
338
+ Premium <span className='text-muted-foreground text-xs leading-[inherit] font-normal'>$5.00</span>
339
+ </Label>
340
+ <p id={`${id}-2-description`} className='text-muted-foreground text-xs'>
341
+ Get 5 projects with 5 team members.
342
+ </p>
343
+ </div>
344
+ </div>
345
+ </RadioGroup>
346
+ )
347
+ }
348
+
349
+ const RadioGroupCardRadioWithBorderDemo = () => {
350
+ const id = useId()
351
+
352
+ return (
353
+ <RadioGroup className='w-full max-w-96 gap-2' defaultValue='1'>
354
+ <div className='border-input has-data-[state=checked]:border-primary/50 has-focus-visible:border-ring has-focus-visible:ring-ring/50 relative w-full rounded-md border p-3 shadow-xs transition-[color,box-shadow] outline-none has-focus-visible:ring-[3px]'>
355
+ <RadioGroupItem
356
+ value='1'
357
+ id={`${id}-1`}
358
+ className='sr-only'
359
+ aria-label='plan-radio-basic'
360
+ aria-describedby={`${id}-1-description`}
361
+ />
362
+
363
+ <Label htmlFor={`${id}-1`} className='text-foreground flex flex-col items-start after:absolute after:inset-0'>
364
+ <div className='flex w-full items-center justify-between'>
365
+ <span>Basic</span>
366
+ <span className='text-muted-foreground text-xs leading-[inherit] font-normal'>Free</span>
367
+ </div>
368
+ <p id={`${id}-1-description`} className='text-muted-foreground text-xs'>
369
+ Get 1 project with 1 teams members.
370
+ </p>
371
+ </Label>
372
+ </div>
373
+
374
+ <div className='border-input has-data-[state=checked]:border-primary/50 has-focus-visible:border-ring has-focus-visible:ring-ring/50 relative w-full rounded-md border p-3 shadow-xs transition-[color,box-shadow] outline-none has-focus-visible:ring-[3px]'>
375
+ <RadioGroupItem
376
+ value='2'
377
+ id={`${id}-2`}
378
+ className='sr-only'
379
+ aria-label='plan-radio-premium'
380
+ aria-describedby={`${id}-2-description`}
381
+ />
382
+
383
+ <Label htmlFor={`${id}-2`} className='text-foreground flex flex-col items-start after:absolute after:inset-0'>
384
+ <div className='flex w-full items-center justify-between'>
385
+ <span>Premium</span>
386
+ <span className='text-muted-foreground text-xs leading-[inherit] font-normal'>$5.00</span>
387
+ </div>
388
+ <p id={`${id}-2-description`} className='text-muted-foreground text-xs'>
389
+ Get 5 projects with 5 team members.
390
+ </p>
391
+ </Label>
392
+ </div>
393
+ </RadioGroup>
394
+ )
395
+ }
396
+
397
+ const RadioGroupCardVerticalRadioDemo = () => {
398
+ const id = useId()
399
+
400
+ return (
401
+ <RadioGroup className='w-full max-w-96 justify-items-center sm:grid-cols-2' defaultValue='1'>
402
+ <div className='border-input has-data-[state=checked]:border-primary/50 relative flex w-full max-w-50 flex-col items-center gap-3 rounded-md border p-4 shadow-xs outline-none'>
403
+ <RadioGroupItem
404
+ value='1'
405
+ id={`${id}-1`}
406
+ className='order-1 size-5 after:absolute after:inset-0 [&_svg]:size-3'
407
+ aria-describedby={`${id}-1-description`}
408
+ aria-label='plan-radio-basic'
409
+ />
410
+ <div className='grid grow justify-items-center gap-2'>
411
+ <UserIcon />
412
+ <Label htmlFor={`${id}-1`} className='justify-center'>
413
+ Basic
414
+ </Label>
415
+ <p id={`${id}-1-description`} className='text-muted-foreground text-center text-xs'>
416
+ Get 1 project with 1 teams members.
417
+ </p>
418
+ </div>
419
+ </div>
420
+ <div className='border-input has-data-[state=checked]:border-primary/50 relative flex w-full max-w-50 flex-col items-center gap-3 rounded-md border p-4 shadow-xs outline-none'>
421
+ <RadioGroupItem
422
+ value='2'
423
+ id={`${id}-2`}
424
+ className='order-1 size-5 after:absolute after:inset-0 [&_svg]:size-3'
425
+ aria-describedby={`${id}-2-description`}
426
+ aria-label='plan-radio-premium'
427
+ />
428
+ <div className='grid grow justify-items-center gap-2'>
429
+ <CrownIcon />
430
+ <Label htmlFor={`${id}-2`} className='justify-center'>
431
+ Premium
432
+ </Label>
433
+ <p id={`${id}-2-description`} className='text-muted-foreground text-center text-xs'>
434
+ Get 5 projects with 5 team members.
435
+ </p>
436
+ </div>
437
+ </div>
438
+ </RadioGroup>
439
+ )
440
+ }
441
+
442
+ const RadioGroupAnimatedDemo = () => {
443
+ return (
444
+ <RadioGroup defaultValue='realtime'>
445
+ <div className='flex items-center gap-2'>
446
+ <RadioGroupItem value='realtime' id='notifications-realtime' />
447
+ <Label htmlFor='notifications-realtime'>Real-time</Label>
448
+ </div>
449
+ <div className='flex items-center gap-2'>
450
+ <RadioGroupItem value='daily' id='notifications-daily' />
451
+ <Label htmlFor='notifications-daily'>Daily Digest</Label>
452
+ </div>
453
+ <div className='flex items-center gap-2'>
454
+ <RadioGroupItem value='none' id='notifications-none' />
455
+ <Label htmlFor='notifications-none'>No Notifications</Label>
456
+ </div>
457
+ </RadioGroup>
458
+ )
459
+ }
460
+
461
+ const RadioGroupAnimatedInsetDemo = () => {
462
+ return (
463
+ <RadioGroupPrimitive.Root data-slot='radio-group' defaultValue='english' className='grid gap-3'>
464
+ <div className='flex items-center gap-2'>
465
+ <RadioGroupPrimitive.Item
466
+ value='english'
467
+ id='lang-english'
468
+ data-slot='radio-group-item'
469
+ className='border-input focus-visible:border-ring focus-visible:ring-ring/50 text-primary-foreground [&_svg]:fill-primary-foreground data-[state=checked]:border-primary data-[state=checked]:bg-primary! relative aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow,border] outline-none focus-visible:ring-[3px] [&_svg]:size-4 data-[state=checked]:[&_svg]:size-2'
470
+ >
471
+ <CircleIcon className='fill-primary absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 transition-all duration-500' />
472
+ </RadioGroupPrimitive.Item>
473
+ <Label htmlFor='lang-english'>English</Label>
474
+ </div>
475
+ <div className='flex items-center gap-2'>
476
+ <RadioGroupPrimitive.Item
477
+ value='spanish'
478
+ id='lang-spanish'
479
+ data-slot='radio-group-item'
480
+ className='border-input focus-visible:border-ring focus-visible:ring-ring/50 text-primary-foreground [&_svg]:fill-primary-foreground data-[state=checked]:border-primary data-[state=checked]:bg-primary! relative aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow,border] outline-none focus-visible:ring-[3px] [&_svg]:size-4 data-[state=checked]:[&_svg]:size-2'
481
+ >
482
+ <CircleIcon className='fill-primary absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 transition-all duration-500' />
483
+ </RadioGroupPrimitive.Item>
484
+ <Label htmlFor='lang-spanish'>Español</Label>
485
+ </div>
486
+ <div className='flex items-center gap-2'>
487
+ <RadioGroupPrimitive.Item
488
+ value='french'
489
+ id='lang-french'
490
+ data-slot='radio-group-item'
491
+ className='border-input focus-visible:border-ring focus-visible:ring-ring/50 text-primary-foreground [&_svg]:fill-primary-foreground data-[state=checked]:border-primary data-[state=checked]:bg-primary! relative aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow,border] outline-none focus-visible:ring-[3px] [&_svg]:size-4 data-[state=checked]:[&_svg]:size-2'
492
+ >
493
+ <CircleIcon className='fill-primary absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 transition-all duration-500' />
494
+ </RadioGroupPrimitive.Item>
495
+ <Label htmlFor='lang-french'>Français</Label>
496
+ </div>
497
+ </RadioGroupPrimitive.Root>
498
+ )
499
+ } */