@catalystsoftware/ui 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/data/tailwind.config.js +261 -3821
  2. package/dist/components/catalyst-ui/buttons/burger.tsx +207 -0
  3. package/dist/components/catalyst-ui/core/data-display/timeline.tsx +210 -0
  4. package/dist/components/catalyst-ui/core/feedback/alert.tsx +491 -0
  5. package/dist/components/catalyst-ui/core/feedback/spinner-1.tsx +65 -0
  6. package/dist/components/catalyst-ui/core/feedback/toast.tsx +1857 -0
  7. package/dist/components/catalyst-ui/core/navigation/menu.tsx +164 -0
  8. package/dist/components/catalyst-ui/forms/toggle-class.tsx +176 -0
  9. package/dist/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +419 -0
  10. package/dist/components/catalyst-ui/hooks/use-counter.tsx +13 -0
  11. package/dist/components/catalyst-ui/hooks/use-event-listener.tsx +23 -0
  12. package/dist/components/catalyst-ui/hooks/use-export-markdown.tsx +47 -0
  13. package/dist/components/catalyst-ui/hooks/use-focus.tsx +17 -0
  14. package/dist/components/catalyst-ui/hooks/use-interval.tsx +23 -0
  15. package/dist/components/catalyst-ui/hooks/use-is-client.tsx +16 -0
  16. package/dist/components/catalyst-ui/hooks/use-media-query.tsx +19 -0
  17. package/dist/components/catalyst-ui/hooks/use-mobile.tsx +19 -0
  18. package/dist/components/catalyst-ui/hooks/use-resize-observer.tsx +81 -0
  19. package/dist/components/catalyst-ui/hooks/use-timeout.tsx +21 -0
  20. package/dist/components/catalyst-ui/hooks/use-timer.tsx +209 -0
  21. package/dist/components/catalyst-ui/hooks/use-toggle.tsx +12 -0
  22. package/dist/components/catalyst-ui/media/image.tsx +13 -0
  23. package/dist/components/catalyst-ui/overlays/dual-sidebar.tsx +4142 -0
  24. package/dist/components/catalyst-ui/overlays/sidebar-original.tsx +726 -0
  25. package/dist/components/catalyst-ui/primitives/accordion.tsx +250 -0
  26. package/dist/components/catalyst-ui/primitives/alert-dialog.tsx +126 -0
  27. package/dist/components/catalyst-ui/primitives/aspect-ratio.tsx +9 -0
  28. package/dist/components/catalyst-ui/primitives/avatar.tsx +296 -0
  29. package/dist/components/catalyst-ui/primitives/badge.tsx +57 -0
  30. package/dist/components/catalyst-ui/primitives/breadcrumb.tsx +101 -0
  31. package/dist/components/catalyst-ui/primitives/button.tsx +265 -0
  32. package/dist/components/catalyst-ui/primitives/calendar-v4.tsx +208 -0
  33. package/dist/components/catalyst-ui/primitives/calendar.tsx +295 -0
  34. package/dist/components/catalyst-ui/primitives/card.tsx +618 -0
  35. package/dist/components/catalyst-ui/primitives/carousel.tsx +238 -0
  36. package/dist/components/catalyst-ui/primitives/chart.tsx +347 -0
  37. package/dist/components/catalyst-ui/primitives/checkbox.tsx +225 -0
  38. package/dist/components/catalyst-ui/primitives/collapsible.tsx +212 -0
  39. package/dist/components/catalyst-ui/primitives/command.tsx +393 -0
  40. package/dist/components/catalyst-ui/primitives/context-menu.tsx +236 -0
  41. package/dist/components/catalyst-ui/primitives/dialog.tsx +471 -0
  42. package/dist/components/catalyst-ui/primitives/drawer.tsx +761 -0
  43. package/dist/components/catalyst-ui/primitives/dropdown-menu.tsx +290 -0
  44. package/dist/components/catalyst-ui/primitives/empty.tsx +104 -0
  45. package/dist/components/catalyst-ui/primitives/field.tsx +244 -0
  46. package/dist/components/catalyst-ui/primitives/hover-card.tsx +124 -0
  47. package/dist/components/catalyst-ui/primitives/input-otp.tsx +76 -0
  48. package/dist/components/catalyst-ui/primitives/input.tsx +64 -0
  49. package/dist/components/catalyst-ui/primitives/item.tsx +196 -0
  50. package/dist/components/catalyst-ui/primitives/kbd.tsx +75 -0
  51. package/dist/components/catalyst-ui/primitives/label.tsx +24 -0
  52. package/dist/components/catalyst-ui/primitives/navigation-menu.tsx +150 -0
  53. package/dist/components/catalyst-ui/primitives/pagination.tsx +198 -0
  54. package/dist/components/catalyst-ui/primitives/popover.tsx +232 -0
  55. package/dist/components/catalyst-ui/primitives/progress.tsx +34 -0
  56. package/dist/components/catalyst-ui/primitives/radio-group.tsx +43 -0
  57. package/dist/components/catalyst-ui/primitives/resizable.tsx +56 -0
  58. package/dist/components/catalyst-ui/primitives/select.tsx +155 -0
  59. package/dist/components/catalyst-ui/primitives/separator.tsx +74 -0
  60. package/dist/components/catalyst-ui/primitives/sheet.tsx +126 -0
  61. package/dist/components/catalyst-ui/primitives/skeleton.tsx +15 -0
  62. package/dist/components/catalyst-ui/primitives/slider.tsx +27 -0
  63. package/dist/components/catalyst-ui/primitives/switch.tsx +187 -0
  64. package/dist/components/catalyst-ui/primitives/tabs.tsx +335 -0
  65. package/dist/components/catalyst-ui/primitives/textarea.tsx +24 -0
  66. package/dist/components/catalyst-ui/primitives/toggle-group.tsx +55 -0
  67. package/dist/components/catalyst-ui/primitives/toggle.tsx +42 -0
  68. package/dist/components/catalyst-ui/primitives/tooltip.tsx +116 -0
  69. package/dist/components/catalyst-ui/utils/basic-auth.tsx +40 -0
  70. package/dist/components/catalyst-ui/utils/context-storage.tsx +19 -0
  71. package/dist/components/catalyst-ui/utils/cors-middleware.tsx +71 -0
  72. package/dist/components/catalyst-ui/utils/deferred-content.tsx +595 -0
  73. package/dist/components/catalyst-ui/utils/honeypot-middleware.tsx +38 -0
  74. package/dist/components/catalyst-ui/utils/incId.tsx +75 -0
  75. package/dist/components/catalyst-ui/utils/jwk-auth.tsx +36 -0
  76. package/dist/components/catalyst-ui/utils/request-id.tsx +14 -0
  77. package/dist/components/catalyst-ui/utils/secure-headers.tsx +37 -0
  78. package/dist/components/catalyst-ui/utils/server-timing.tsx +23 -0
  79. package/dist/components/catalyst-ui/utils/utils.ts +43 -0
  80. package/dist/components/catalyst-ui/utils/with-cookie.tsx +43 -0
  81. package/dist/components/catalyst-ui/x/accordian-x.tsx +428 -0
  82. package/dist/components/catalyst-ui/x/alert-x.tsx +413 -0
  83. package/dist/components/catalyst-ui/x/animated-text-x.tsx +2242 -0
  84. package/dist/components/catalyst-ui/x/avatar-x.tsx +515 -0
  85. package/dist/components/catalyst-ui/x/badge-x.tsx +670 -0
  86. package/dist/components/catalyst-ui/x/button-X.tsx +2857 -0
  87. package/dist/components/catalyst-ui/x/button-group-x.tsx +847 -0
  88. package/dist/components/catalyst-ui/x/calendar-x.tsx +1910 -0
  89. package/dist/components/catalyst-ui/x/card-x.tsx +2597 -0
  90. package/dist/components/catalyst-ui/x/checkbox-x.tsx +656 -0
  91. package/dist/components/catalyst-ui/x/collapsible-x.tsx +1360 -0
  92. package/dist/components/catalyst-ui/x/combobox-x.tsx +911 -0
  93. package/dist/components/catalyst-ui/x/data-table-x.tsx +1753 -0
  94. package/dist/components/catalyst-ui/x/date-picker-x.tsx +648 -0
  95. package/dist/components/catalyst-ui/x/dialog-x.tsx +659 -0
  96. package/dist/components/catalyst-ui/x/dropdown-menu-x.tsx +612 -0
  97. package/dist/components/catalyst-ui/x/hover-card-x.tsx +375 -0
  98. package/dist/components/catalyst-ui/x/icon-x.tsx +840 -0
  99. package/dist/components/catalyst-ui/x/input-mask-x.tsx +981 -0
  100. package/dist/components/catalyst-ui/x/input-otp-x.tsx +659 -0
  101. package/dist/components/catalyst-ui/x/loader-x.tsx +1757 -0
  102. package/dist/components/catalyst-ui/x/pagination-x.tsx +622 -0
  103. package/dist/components/catalyst-ui/x/popover-x.tsx +744 -0
  104. package/dist/components/catalyst-ui/x/radio-group-x.tsx +499 -0
  105. package/dist/components/catalyst-ui/x/select-x.tsx +1127 -0
  106. package/dist/components/catalyst-ui/x/sheet-x.tsx +668 -0
  107. package/dist/components/catalyst-ui/x/switch-x.tsx +681 -0
  108. package/dist/components/catalyst-ui/x/table-x.tsx +574 -0
  109. package/dist/components/catalyst-ui/x/tabs-x.tsx +839 -0
  110. package/dist/components/catalyst-ui/x/textarea-x.tsx +1263 -0
  111. package/dist/components/catalyst-ui/x/tooltip-x.tsx +396 -0
  112. package/dist/components/catalyst-ui/x/tracker-x.tsx +560 -0
  113. package/dist/data/bg-data.tsx +901 -0
  114. package/dist/data/buttons-data.tsx +2327 -0
  115. package/dist/data/charts-data.tsx +102 -0
  116. package/dist/data/chat-data.tsx +83 -0
  117. package/dist/data/code-data.tsx +1040 -0
  118. package/dist/data/comboboxes-data.tsx +1843 -0
  119. package/dist/data/command-data.tsx +1381 -0
  120. package/dist/data/core-data.tsx +15953 -0
  121. package/dist/data/crm-data.tsx +47 -0
  122. package/dist/data/data.tsx +159 -0
  123. package/dist/data/date-and-time-data.tsx +554 -0
  124. package/dist/data/dependencies.tsx +7 -0
  125. package/dist/data/ecommerce-data.tsx +1387 -0
  126. package/dist/data/forms-data.tsx +7890 -0
  127. package/dist/data/hooks-data.tsx +5487 -0
  128. package/dist/data/index.ts +34 -0
  129. package/dist/data/inputs-data.tsx +557 -0
  130. package/dist/data/interactive-data.tsx +5394 -0
  131. package/dist/data/lofi-data.tsx +18295 -0
  132. package/dist/data/marketing-data.tsx +2546 -0
  133. package/dist/data/media-data.tsx +1510 -0
  134. package/dist/data/motion-data.tsx +5801 -0
  135. package/dist/data/overlay-data.tsx +4136 -0
  136. package/dist/data/pdf-data.tsx +124 -0
  137. package/dist/data/pos-data.tsx +213 -0
  138. package/dist/data/postcss.config.js +6 -0
  139. package/dist/data/primitive-data.tsx +5170 -0
  140. package/dist/data/prompt-data.tsx +1226 -0
  141. package/dist/data/requiredLibs.ts +4 -0
  142. package/dist/data/sandbox-data.tsx +1 -0
  143. package/dist/data/sidebars-data.tsx +5421 -0
  144. package/dist/data/stacks-data.tsx +32 -0
  145. package/dist/data/table-data.tsx +706 -0
  146. package/dist/data/tailwind.config.js +270 -0
  147. package/dist/data/tailwind.config.ngin.js +3830 -0
  148. package/dist/data/tailwind.css +431 -0
  149. package/dist/data/tools-data.tsx +6910 -0
  150. package/dist/data/typography-data.tsx +2050 -0
  151. package/dist/data/utils-data.tsx +6500 -0
  152. package/dist/data/x-data.tsx +1171 -0
  153. package/dist/data.tsx +159 -0
  154. package/package.json +1 -1
  155. package/dist/index.d.ts +0 -3
  156. package/dist/index.d.ts.map +0 -1
  157. package/dist/index.js.map +0 -362
@@ -0,0 +1,659 @@
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
+ }