@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,659 +0,0 @@
1
- import React from 'react'
2
- import * as DialogPrimitive from "@radix-ui/react-dialog"
3
- import { X, AlertTriangle, CheckCircle, Info, Mail } from "lucide-react"
4
- import { cn } from "~/components/catalyst-ui"
5
- import { Dialog, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, useDialogContext, dialogContentVariants } from "~/components/catalyst-ui"
6
- import { Avatar, AvatarImage, AvatarFallback } from "~/components/catalyst-ui"
7
- import { ScrollArea } from "~/components/catalyst-ui"
8
- import type { LucideIcon } from "lucide-react"
9
-
10
-
11
- /**
12
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ DialogX ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
13
- * ★ ━━━━ ☆ ━━━━ ━━━━ ☆ ━━━━ ★
14
- * type DialogType = 'default' | 'alert' | 'alertWithIcon' | 'alertDestructive' | 'terms' | 'subscribe' | 'referEarn' | 'rating' | 'otpVerification' | 'signUp' | 'signIn' | 'inviteFriends'
15
- *
16
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Default Dialog ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
17
- * ```jsx
18
- * <DialogX>
19
- * <DialogXTrigger>Open Dialog</DialogXTrigger>
20
- * <DialogXContent>
21
- * <DialogXHeader>
22
- * <DialogXTitle>Dialog Title</DialogXTitle>
23
- * <DialogXDescription>
24
- * This is a default dialog description.
25
- * </DialogXDescription>
26
- * </DialogXHeader>
27
- * <DialogXFooter>
28
- * <Button>Cancel</Button>
29
- * <Button>Confirm</Button>
30
- * </DialogXFooter>
31
- * </DialogXContent>
32
- * </DialogX>
33
- * ```
34
- *
35
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Alert Dialog ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
36
- * ```jsx
37
- * <DialogX dialog="alert">
38
- * <DialogXTrigger>Open Alert</DialogXTrigger>
39
- * <DialogXContent>
40
- * <DialogXHeader>
41
- * <DialogXTitle>Are you sure?</DialogXTitle>
42
- * <DialogXDescription>
43
- * This action cannot be undone.
44
- * </DialogXDescription>
45
- * </DialogXHeader>
46
- * <DialogXFooter>
47
- * <Button variant="outline">Cancel</Button>
48
- * <Button>Continue</Button>
49
- * </DialogXFooter>
50
- * </DialogXContent>
51
- * </DialogX>
52
- * ```
53
- *
54
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Alert with Icon ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
55
- * ```jsx
56
- * <DialogX dialog="alertWithIcon">
57
- * <DialogXTrigger>Open Alert with Icon</DialogXTrigger>
58
- * <DialogXContent>
59
- * <DialogXHeader icon={CheckCircle}>
60
- * <DialogXTitle>Success!</DialogXTitle>
61
- * <DialogXDescription>
62
- * Your action was completed successfully.
63
- * </DialogXDescription>
64
- * </DialogXHeader>
65
- * <DialogXFooter>
66
- * <Button>OK</Button>
67
- * </DialogXFooter>
68
- * </DialogXContent>
69
- * </DialogX>
70
- * ```
71
- *
72
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Destructive Alert ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
73
- * ```jsx
74
- * <DialogX dialog="alertDestructive">
75
- * <DialogXTrigger>Open Destructive Alert</DialogXTrigger>
76
- * <DialogXContent>
77
- * <DialogXHeader>
78
- * <DialogXTitle>Delete Account</DialogXTitle>
79
- * <DialogXDescription>
80
- * Are you sure you want to delete your account? This action cannot be undone.
81
- * </DialogXDescription>
82
- * </DialogXHeader>
83
- * <DialogXFooter>
84
- * <Button variant="outline">Cancel</Button>
85
- * <Button variant="destructive">Delete</Button>
86
- * </DialogXFooter>
87
- * </DialogXContent>
88
- * </DialogX>
89
- * ```
90
- *
91
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Terms & Conditions ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
92
- * ```jsx
93
- * <DialogX dialog="terms">
94
- * <DialogXTrigger>View Terms</DialogXTrigger>
95
- * <DialogXContent>
96
- * <DialogXHeader>
97
- * <DialogXTitle>Terms & Conditions</DialogXTitle>
98
- * </DialogXHeader>
99
- * <DialogXDescription>
100
- * <ScrollArea className="h-64">
101
- * <p className="text-sm">
102
- * {/* Long terms content here * /}
103
- * </p>
104
- * </ScrollArea>
105
- * </DialogXDescription>
106
- * <DialogXFooter>
107
- * <Button variant="outline">Decline</Button>
108
- * <Button>Accept</Button>
109
- * </DialogXFooter>
110
- * </DialogXContent>
111
- * </DialogX>
112
- * ```
113
- *
114
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Subscribe Dialog ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
115
- * ```jsx
116
- * <DialogX dialog="subscribe">
117
- * <DialogXTrigger>Subscribe</DialogXTrigger>
118
- * <DialogXContent>
119
- * <DialogXHeader icon={Mail}>
120
- * <DialogXTitle>Subscribe to Newsletter</DialogXTitle>
121
- * <DialogXDescription>
122
- * Get the latest updates and news delivered to your inbox.
123
- * </DialogXDescription>
124
- * </DialogXHeader>
125
- * {/* Email input field * /}
126
- * <DialogXFooter>
127
- * <Button>Subscribe</Button>
128
- * </DialogXFooter>
129
- * </DialogXContent>
130
- * </DialogX>
131
- * ```
132
- *
133
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Sign Up Dialog ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
134
- * ```jsx
135
- * <DialogX dialog="signUp">
136
- * <DialogXTrigger>Sign Up</DialogXTrigger>
137
- * <DialogXContent>
138
- * <DialogXHeader icon={Mail}>
139
- * <DialogXTitle>Create Account</DialogXTitle>
140
- * <DialogXDescription>
141
- * Join our community today!
142
- * </DialogXDescription>
143
- * </DialogXHeader>
144
- * {/* Sign up form fields * /}
145
- * <DialogXFooter>
146
- * <Button variant="outline">Cancel</Button>
147
- * <Button>Sign Up</Button>
148
- * </DialogXFooter>
149
- * </DialogXContent>
150
- * </DialogX>
151
- * ```
152
- *
153
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Sign In Dialog ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
154
- * ```jsx
155
- * <DialogX dialog="signIn">
156
- * <DialogXTrigger>Sign In</DialogXTrigger>
157
- * <DialogXContent>
158
- * <DialogXHeader icon={Mail}>
159
- * <DialogXTitle>Welcome Back</DialogXTitle>
160
- * <DialogXDescription>
161
- * Sign in to your account to continue.
162
- * </DialogXDescription>
163
- * </DialogXHeader>
164
- * {/* Sign in form fields * /}
165
- * <DialogXFooter>
166
- * <Button variant="outline">Cancel</Button>
167
- * <Button>Sign In</Button>
168
- * </DialogXFooter>
169
- * </DialogXContent>
170
- * </DialogX>
171
- * ```
172
- *
173
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Props ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
174
- * - DialogX Props:
175
- * - `dialog`: DialogType - The type of dialog to render
176
- * - `open`: boolean - Controlled open state
177
- * - `onOpenChange`: (open: boolean) => void - Callback when open state changes
178
- * - `defaultOpen`: boolean - Default open state
179
- * - `modal`: boolean - Whether the dialog is modal (default: true)
180
- *
181
- * - DialogXContent Props:
182
- * - `className`: string - Additional CSS classes
183
- * - `showCloseButton`: boolean - Whether to show close button (default: true)
184
- * - `children`: ReactNode - Dialog content
185
- *
186
- * - DialogXHeader Props:
187
- * - `className`: string - Additional CSS classes
188
- * - `icon`: LucideIcon - Icon component for icon-based dialogs
189
- * - `children`: ReactNode - Header content
190
- *
191
- * - DialogXFooter Props:
192
- * - `className`: string - Additional CSS classes
193
- * - `children`: ReactNode - Footer content
194
- *
195
- * - DialogXTitle Props:
196
- * - `className`: string - Additional CSS classes
197
- * - `children`: ReactNode - Title content
198
- *
199
- * - DialogXDescription Props:
200
- * - `className`: string - Additional CSS classes
201
- * - `children`: ReactNode - Description content
202
- *
203
- * - DialogXTrigger Props:
204
- * - `asChild`: boolean - Whether to merge props (default: false)
205
- * - `children`: ReactNode - Trigger element
206
- *
207
- * - DialogXClose Props:
208
- * - `asChild`: boolean - Whether to merge props (default: false)
209
- * - `children`: ReactNode - Close element
210
- *
211
- * - DialogXOverlay Props:
212
- * - `className`: string - Additional CSS classes
213
- *
214
- * - DialogXPortal Props:
215
- * - `children`: ReactNode - Portal content
216
- *
217
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Special Features ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
218
- * - **Gradient Backgrounds**: SignUp (green gradient), SignIn (sky gradient)
219
- * - **Custom Overlays**: Themed overlays for different dialog types
220
- * - **Icon Support**: Built-in icon display with background styling
221
- * - **Scroll Areas**: Built-in scroll areas for content-heavy dialogs (Terms)
222
- * - **Responsive Design**: Adaptive layouts for mobile and desktop
223
- * - **Accessibility**: Full ARIA support and keyboard navigation
224
- *
225
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Usage Notes ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
226
- * 1. Always wrap DialogXTrigger and DialogXContent inside DialogX
227
- * 2. Use the appropriate dialog type for your use case
228
- * 3. Customize icons by passing LucideIcon components to DialogXHeader
229
- * 4. Disable close button with `showCloseButton={false}` on DialogXContent
230
- * 5. The component automatically applies appropriate styling based on dialog type
231
- *
232
- * ★ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━ Available Icons ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ☆ ━━━━━━━━━━━━━━ ★
233
- * ```typescript
234
- * // Import from lucide-react
235
- * import {
236
- * CheckCircle,
237
- * AlertTriangle,
238
- * Info,
239
- * Mail,
240
- * X
241
- * } from "lucide-react"
242
- *
243
- * // Usage in DialogXHeader
244
- * <DialogXHeader icon={CheckCircle}>
245
- * ```
246
- *
247
- */
248
-
249
- type DialogType = 'default' | 'alert' | 'alertWithIcon' | 'alertDestructive' | 'terms' | 'subscribe' | 'referEarn' | 'rating' | 'otpVerification' | 'signUp' | 'signIn' | 'inviteFriends'
250
-
251
- const DialogXContext = React.createContext<DialogType>('default')
252
-
253
- export function DialogX({ dialog = 'default', ...props }: any) {
254
- return (
255
- <DialogXContext.Provider value={dialog}>
256
- <Dialog {...props} />
257
- </DialogXContext.Provider>
258
- )
259
- }
260
-
261
- export function DialogXTrigger({ ...props }: any) {
262
- const dialogType = React.useContext(DialogXContext)
263
-
264
- switch (dialogType) {
265
- default:
266
- return <DialogTrigger {...props} />
267
- }
268
- }
269
-
270
- export function DialogXClose({ ...props }: any) {
271
- const dialogType = React.useContext(DialogXContext)
272
-
273
- switch (dialogType) {
274
- default:
275
- return <DialogClose {...props} />
276
- }
277
- }
278
-
279
- export function DialogXContent({ ...props }: any) {
280
- const dialogType = React.useContext(DialogXContext)
281
- const { variant } = useDialogContext()
282
-
283
- switch (dialogType) {
284
- case 'alert':
285
- return (
286
- <DialogPrimitive.Portal>
287
- <DialogPrimitive.Overlay
288
- className={cn(
289
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50"
290
- )}
291
- />
292
- <DialogPrimitive.Content
293
- className={cn(dialogContentVariants({ variant }), props.className)}
294
- {...props}
295
- >
296
- {props.children}
297
- {props.showCloseButton !== false && (
298
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
299
- <X />
300
- <span className="sr-only">Close</span>
301
- </DialogPrimitive.Close>
302
- )}
303
- </DialogPrimitive.Content>
304
- </DialogPrimitive.Portal>
305
- )
306
-
307
- case 'alertWithIcon':
308
- return (
309
- <DialogPrimitive.Portal>
310
- <DialogPrimitive.Overlay
311
- className={cn(
312
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50"
313
- )}
314
- />
315
- <DialogPrimitive.Content
316
- className={cn(dialogContentVariants({ variant }), props.className)}
317
- {...props}
318
- >
319
- {props.children}
320
- {props.showCloseButton !== false && (
321
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
322
- <X />
323
- <span className="sr-only">Close</span>
324
- </DialogPrimitive.Close>
325
- )}
326
- </DialogPrimitive.Content>
327
- </DialogPrimitive.Portal>
328
- )
329
-
330
- case 'alertDestructive':
331
- return (
332
- <DialogPrimitive.Portal>
333
- <DialogPrimitive.Overlay
334
- className={cn(
335
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50"
336
- )}
337
- />
338
- <DialogPrimitive.Content
339
- className={cn(dialogContentVariants({ variant }), props.className)}
340
- {...props}
341
- >
342
- {props.children}
343
- {props.showCloseButton !== false && (
344
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
345
- <X />
346
- <span className="sr-only">Close</span>
347
- </DialogPrimitive.Close>
348
- )}
349
- </DialogPrimitive.Content>
350
- </DialogPrimitive.Portal>
351
- )
352
-
353
- case 'terms':
354
- return (
355
- <DialogPrimitive.Portal>
356
- <DialogPrimitive.Overlay
357
- className={cn(
358
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50"
359
- )}
360
- />
361
- <DialogPrimitive.Content
362
- className={cn(
363
- "bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-0 rounded-lg border p-0 shadow-lg duration-200 sm:max-h-[min(600px,80vh)] sm:max-w-md",
364
- props.className
365
- )}
366
- {...props}
367
- >
368
- {props.children}
369
- {props.showCloseButton !== false && (
370
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
371
- <X />
372
- <span className="sr-only">Close</span>
373
- </DialogPrimitive.Close>
374
- )}
375
- </DialogPrimitive.Content>
376
- </DialogPrimitive.Portal>
377
- )
378
-
379
- case 'subscribe':
380
- return (
381
- <DialogPrimitive.Portal>
382
- <DialogPrimitive.Overlay
383
- className={cn(
384
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50"
385
- )}
386
- />
387
- <DialogPrimitive.Content
388
- className={cn(
389
- "bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
390
- props.className
391
- )}
392
- {...props}
393
- >
394
- {props.children}
395
- {props.showCloseButton !== false && (
396
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
397
- <X />
398
- <span className="sr-only">Close</span>
399
- </DialogPrimitive.Close>
400
- )}
401
- </DialogPrimitive.Content>
402
- </DialogPrimitive.Portal>
403
- )
404
-
405
- case 'signUp':
406
- return (
407
- <DialogPrimitive.Portal>
408
- <DialogPrimitive.Overlay
409
- className={cn(
410
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50"
411
- )}
412
- />
413
- <DialogPrimitive.Content
414
- className={cn(
415
- "to-card bg-gradient-to-b from-green-100 to-40% [background-size:100%_101%] 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-sm dark:from-green-900",
416
- props.className
417
- )}
418
- {...props}
419
- >
420
- {props.children}
421
- {props.showCloseButton !== false && (
422
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
423
- <X />
424
- <span className="sr-only">Close</span>
425
- </DialogPrimitive.Close>
426
- )}
427
- </DialogPrimitive.Content>
428
- </DialogPrimitive.Portal>
429
- )
430
-
431
- case 'signIn':
432
- return (
433
- <DialogPrimitive.Portal>
434
- <DialogPrimitive.Overlay
435
- className={cn(
436
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50"
437
- )}
438
- />
439
- <DialogPrimitive.Content
440
- className={cn(
441
- "to-card bg-gradient-to-b from-sky-100 to-40% [background-size:100%_101%] 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-sm dark:from-sky-900",
442
- props.className
443
- )}
444
- {...props}
445
- >
446
- {props.children}
447
- {props.showCloseButton !== false && (
448
- <DialogPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
449
- <X />
450
- <span className="sr-only">Close</span>
451
- </DialogPrimitive.Close>
452
- )}
453
- </DialogPrimitive.Content>
454
- </DialogPrimitive.Portal>
455
- )
456
-
457
- default:
458
- return <DialogContent {...props} />
459
- }
460
- }
461
-
462
- export function DialogXHeader({ ...props }: any) {
463
- const dialogType = React.useContext(DialogXContext)
464
- const Icon = props.icon
465
-
466
- switch (dialogType) {
467
- case 'alertWithIcon':
468
- return (
469
- <div className={cn("flex flex-col gap-2 text-center sm:text-left", props.className)} {...props}>
470
- <div className='mb-4 flex size-9 items-center justify-center rounded-full bg-sky-600/10 sm:mx-0 dark:bg-sky-400/10'>
471
- {Icon && <Icon className='size-4.5 text-sky-600 dark:text-sky-400' />}
472
- </div>
473
- {props.children}
474
- </div>
475
- )
476
-
477
- case 'alertDestructive':
478
- return (
479
- <div className={cn("flex flex-col gap-2 items-center", props.className)} {...props}>
480
- <div className='bg-destructive/10 mx-auto mb-2 flex size-12 items-center justify-center rounded-full'>
481
- <AlertTriangle className='text-destructive size-6' />
482
- </div>
483
- {props.children}
484
- </div>
485
- )
486
-
487
- case 'terms':
488
- return (
489
- <div className={cn("contents space-y-0 text-left", props.className)}>
490
- {props.children}
491
- </div>
492
- )
493
-
494
- case 'subscribe':
495
- case 'signUp':
496
- case 'signIn':
497
- case 'inviteFriends':
498
- return (
499
- <div className={cn("flex flex-col gap-2 items-center", props.className)} {...props}>
500
- {Icon && (
501
- <div className='mb-4 flex size-12 items-center justify-center rounded-full bg-sky-600/10 sm:mx-0 dark:bg-sky-400/10'>
502
- <Icon className='size-6 text-sky-600 dark:text-sky-400' />
503
- </div>
504
- )}
505
- {props.children}
506
- </div>
507
- )
508
-
509
- default:
510
- return <DialogHeader {...props} />
511
- }
512
- }
513
-
514
- export function DialogXFooter({ ...props }: any) {
515
- const dialogType = React.useContext(DialogXContext)
516
-
517
- switch (dialogType) {
518
- case 'terms':
519
- return (
520
- <div className={cn("px-6 pb-4 sm:justify-end flex flex-col-reverse gap-2 sm:flex-row", props.className)} {...props}>
521
- {props.children}
522
- </div>
523
- )
524
-
525
- case 'signUp':
526
- case 'signIn':
527
- return (
528
- <div className={cn("space-y-2 pt-4 sm:flex-col flex flex-col-reverse gap-2", props.className)} {...props}>
529
- {props.children}
530
- </div>
531
- )
532
-
533
- default:
534
- return <DialogFooter {...props} />
535
- }
536
- }
537
-
538
- export function DialogXTitle({ ...props }: any) {
539
- const dialogType = React.useContext(DialogXContext)
540
-
541
- switch (dialogType) {
542
- case 'terms':
543
- return (
544
- <DialogPrimitive.Title
545
- className={cn("border-b px-6 py-4 text-lg leading-none font-semibold", props.className)}
546
- {...props}
547
- />
548
- )
549
-
550
- case 'subscribe':
551
- case 'signUp':
552
- case 'signIn':
553
- case 'inviteFriends':
554
- return (
555
- <DialogPrimitive.Title
556
- className={cn("text-xl leading-none font-semibold", props.className)}
557
- {...props}
558
- />
559
- )
560
-
561
- case 'alertDestructive':
562
- return (
563
- <DialogPrimitive.Title
564
- className={cn("text-lg leading-none font-semibold text-center", props.className)}
565
- {...props}
566
- />
567
- )
568
-
569
- default:
570
- return <DialogTitle {...props} />
571
- }
572
- }
573
-
574
- export function DialogXDescription({ ...props }: any) {
575
- const dialogType = React.useContext(DialogXContext)
576
-
577
- switch (dialogType) {
578
- case 'terms':
579
- return (
580
- <div className={cn('text-muted-foreground px-6 py-4 text-sm', props.className)}>
581
- {props.children}
582
- </div>
583
- )
584
-
585
- case 'subscribe':
586
- case 'signUp':
587
- case 'signIn':
588
- case 'inviteFriends':
589
- return (
590
- <DialogPrimitive.Description
591
- className={cn("text-muted-foreground text-base", props.className)}
592
- {...props}
593
- />
594
- )
595
-
596
- case 'alertDestructive':
597
- return (
598
- <DialogPrimitive.Description
599
- className={cn("text-muted-foreground text-sm text-center", props.className)}
600
- {...props}
601
- />
602
- )
603
-
604
- default:
605
- return <DialogDescription {...props} />
606
- }
607
- }
608
-
609
- export function DialogXPortal({ ...props }: any) {
610
- const dialogType = React.useContext(DialogXContext)
611
-
612
- switch (dialogType) {
613
- default:
614
- return <DialogPortal {...props} />
615
- }
616
- }
617
-
618
-
619
- export function DialogXOverlay({ ...props }: any) {
620
- const dialogType = React.useContext(DialogXContext)
621
-
622
- switch (dialogType) {
623
- case 'barbieFartDust':
624
- return (
625
- <DialogPrimitive.Overlay
626
- className={cn(
627
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-pink-300/50 backdrop-blur-sm",
628
- props.className
629
- )}
630
- {...props}
631
- />
632
- )
633
-
634
- case 'signUp':
635
- return (
636
- <DialogPrimitive.Overlay
637
- className={cn(
638
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-green-500/20 backdrop-blur-sm",
639
- props.className
640
- )}
641
- {...props}
642
- />
643
- )
644
-
645
- case 'signIn':
646
- return (
647
- <DialogPrimitive.Overlay
648
- className={cn(
649
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-sky-500/20 backdrop-blur-sm",
650
- props.className
651
- )}
652
- {...props}
653
- />
654
- )
655
-
656
- default:
657
- return <DialogOverlay {...props} />
658
- }
659
- }