@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.
- package/README.md +7 -0
- package/components/catalyst-ui/buttons/burger.tsx +207 -0
- package/components/catalyst-ui/core/data-display/timeline.tsx +210 -0
- package/components/catalyst-ui/core/feedback/alert.tsx +491 -0
- package/components/catalyst-ui/core/feedback/spinner-1.tsx +65 -0
- package/components/catalyst-ui/core/feedback/toast.tsx +1857 -0
- package/components/catalyst-ui/core/navigation/menu.tsx +164 -0
- package/components/catalyst-ui/forms/toggle-class.tsx +176 -0
- package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +419 -0
- package/components/catalyst-ui/hooks/use-counter.tsx +13 -0
- package/components/catalyst-ui/hooks/use-event-listener.tsx +23 -0
- package/components/catalyst-ui/hooks/use-export-markdown.tsx +47 -0
- package/components/catalyst-ui/hooks/use-focus.tsx +17 -0
- package/components/catalyst-ui/hooks/use-interval.tsx +23 -0
- package/components/catalyst-ui/hooks/use-is-client.tsx +16 -0
- package/components/catalyst-ui/hooks/use-media-query.tsx +19 -0
- package/components/catalyst-ui/hooks/use-mobile.tsx +19 -0
- package/components/catalyst-ui/hooks/use-resize-observer.tsx +81 -0
- package/components/catalyst-ui/hooks/use-timeout.tsx +21 -0
- package/components/catalyst-ui/hooks/use-timer.tsx +209 -0
- package/components/catalyst-ui/hooks/use-toggle.tsx +12 -0
- package/components/catalyst-ui/media/image.tsx +13 -0
- package/components/catalyst-ui/overlays/dual-sidebar.tsx +4142 -0
- package/components/catalyst-ui/overlays/sidebar-original.tsx +726 -0
- package/components/catalyst-ui/primitives/accordion.tsx +250 -0
- package/components/catalyst-ui/primitives/alert-dialog.tsx +126 -0
- package/components/catalyst-ui/primitives/aspect-ratio.tsx +9 -0
- package/components/catalyst-ui/primitives/avatar.tsx +296 -0
- package/components/catalyst-ui/primitives/badge.tsx +57 -0
- package/components/catalyst-ui/primitives/breadcrumb.tsx +101 -0
- package/components/catalyst-ui/primitives/button.tsx +265 -0
- package/components/catalyst-ui/primitives/calendar-v4.tsx +208 -0
- package/components/catalyst-ui/primitives/calendar.tsx +295 -0
- package/components/catalyst-ui/primitives/card.tsx +618 -0
- package/components/catalyst-ui/primitives/carousel.tsx +238 -0
- package/components/catalyst-ui/primitives/chart.tsx +347 -0
- package/components/catalyst-ui/primitives/checkbox.tsx +225 -0
- package/components/catalyst-ui/primitives/collapsible.tsx +212 -0
- package/components/catalyst-ui/primitives/command.tsx +393 -0
- package/components/catalyst-ui/primitives/context-menu.tsx +236 -0
- package/components/catalyst-ui/primitives/dialog.tsx +471 -0
- package/components/catalyst-ui/primitives/drawer.tsx +761 -0
- package/components/catalyst-ui/primitives/dropdown-menu.tsx +290 -0
- package/components/catalyst-ui/primitives/empty.tsx +104 -0
- package/components/catalyst-ui/primitives/field.tsx +244 -0
- package/components/catalyst-ui/primitives/hover-card.tsx +124 -0
- package/components/catalyst-ui/primitives/input-otp.tsx +76 -0
- package/components/catalyst-ui/primitives/input.tsx +64 -0
- package/components/catalyst-ui/primitives/item.tsx +196 -0
- package/components/catalyst-ui/primitives/kbd.tsx +75 -0
- package/components/catalyst-ui/primitives/label.tsx +24 -0
- package/components/catalyst-ui/primitives/navigation-menu.tsx +150 -0
- package/components/catalyst-ui/primitives/pagination.tsx +198 -0
- package/components/catalyst-ui/primitives/popover.tsx +232 -0
- package/components/catalyst-ui/primitives/progress.tsx +34 -0
- package/components/catalyst-ui/primitives/radio-group.tsx +43 -0
- package/components/catalyst-ui/primitives/resizable.tsx +56 -0
- package/components/catalyst-ui/primitives/select.tsx +155 -0
- package/components/catalyst-ui/primitives/separator.tsx +74 -0
- package/components/catalyst-ui/primitives/sheet.tsx +126 -0
- package/components/catalyst-ui/primitives/skeleton.tsx +15 -0
- package/components/catalyst-ui/primitives/slider.tsx +27 -0
- package/components/catalyst-ui/primitives/switch.tsx +187 -0
- package/components/catalyst-ui/primitives/tabs.tsx +335 -0
- package/components/catalyst-ui/primitives/textarea.tsx +24 -0
- package/components/catalyst-ui/primitives/toggle-group.tsx +55 -0
- package/components/catalyst-ui/primitives/toggle.tsx +42 -0
- package/components/catalyst-ui/primitives/tooltip.tsx +116 -0
- package/components/catalyst-ui/utils/basic-auth.tsx +40 -0
- package/components/catalyst-ui/utils/context-storage.tsx +19 -0
- package/components/catalyst-ui/utils/cors-middleware.tsx +71 -0
- package/components/catalyst-ui/utils/deferred-content.tsx +595 -0
- package/components/catalyst-ui/utils/honeypot-middleware.tsx +38 -0
- package/components/catalyst-ui/utils/incId.tsx +75 -0
- package/components/catalyst-ui/utils/jwk-auth.tsx +36 -0
- package/components/catalyst-ui/utils/request-id.tsx +14 -0
- package/components/catalyst-ui/utils/secure-headers.tsx +37 -0
- package/components/catalyst-ui/utils/server-timing.tsx +23 -0
- package/components/catalyst-ui/utils/utils.ts +43 -0
- package/components/catalyst-ui/utils/with-cookie.tsx +43 -0
- package/components/catalyst-ui/x/accordian-x.tsx +428 -0
- package/components/catalyst-ui/x/alert-x.tsx +413 -0
- package/components/catalyst-ui/x/animated-text-x.tsx +2242 -0
- package/components/catalyst-ui/x/avatar-x.tsx +515 -0
- package/components/catalyst-ui/x/badge-x.tsx +670 -0
- package/components/catalyst-ui/x/button-X.tsx +2857 -0
- package/components/catalyst-ui/x/button-group-x.tsx +847 -0
- package/components/catalyst-ui/x/calendar-x.tsx +1910 -0
- package/components/catalyst-ui/x/card-x.tsx +2597 -0
- package/components/catalyst-ui/x/checkbox-x.tsx +656 -0
- package/components/catalyst-ui/x/collapsible-x.tsx +1360 -0
- package/components/catalyst-ui/x/combobox-x.tsx +911 -0
- package/components/catalyst-ui/x/data-table-x.tsx +1753 -0
- package/components/catalyst-ui/x/date-picker-x.tsx +648 -0
- package/components/catalyst-ui/x/dialog-x.tsx +659 -0
- package/components/catalyst-ui/x/dropdown-menu-x.tsx +612 -0
- package/components/catalyst-ui/x/hover-card-x.tsx +375 -0
- package/components/catalyst-ui/x/icon-x.tsx +840 -0
- package/components/catalyst-ui/x/input-mask-x.tsx +981 -0
- package/components/catalyst-ui/x/input-otp-x.tsx +659 -0
- package/components/catalyst-ui/x/loader-x.tsx +1757 -0
- package/components/catalyst-ui/x/pagination-x.tsx +622 -0
- package/components/catalyst-ui/x/popover-x.tsx +744 -0
- package/components/catalyst-ui/x/radio-group-x.tsx +499 -0
- package/components/catalyst-ui/x/select-x.tsx +1127 -0
- package/components/catalyst-ui/x/sheet-x.tsx +668 -0
- package/components/catalyst-ui/x/switch-x.tsx +681 -0
- package/components/catalyst-ui/x/table-x.tsx +574 -0
- package/components/catalyst-ui/x/tabs-x.tsx +839 -0
- package/components/catalyst-ui/x/textarea-x.tsx +1263 -0
- package/components/catalyst-ui/x/tooltip-x.tsx +396 -0
- package/components/catalyst-ui/x/tracker-x.tsx +560 -0
- package/data/bg-data.tsx +901 -0
- package/data/buttons-data.tsx +2327 -0
- package/data/charts-data.tsx +102 -0
- package/data/chat-data.tsx +83 -0
- package/data/code-data.tsx +1040 -0
- package/data/comboboxes-data.tsx +1843 -0
- package/data/command-data.tsx +1381 -0
- package/data/core-data.tsx +15953 -0
- package/data/crm-data.tsx +47 -0
- package/data/data.tsx +159 -0
- package/data/date-and-time-data.tsx +554 -0
- package/data/dependencies.tsx +7 -0
- package/data/ecommerce-data.tsx +1387 -0
- package/data/forms-data.tsx +7890 -0
- package/data/hooks-data.tsx +5487 -0
- package/data/index.ts +34 -0
- package/data/inputs-data.tsx +557 -0
- package/data/interactive-data.tsx +5394 -0
- package/data/lofi-data.tsx +18295 -0
- package/data/marketing-data.tsx +2546 -0
- package/data/media-data.tsx +1510 -0
- package/data/motion-data.tsx +5801 -0
- package/data/overlay-data.tsx +4136 -0
- package/data/pdf-data.tsx +124 -0
- package/data/pos-data.tsx +213 -0
- package/data/postcss.config.js +6 -0
- package/data/primitive-data.tsx +5170 -0
- package/data/prompt-data.tsx +1226 -0
- package/data/requiredLibs.ts +4 -0
- package/data/sandbox-data.tsx +1 -0
- package/data/sidebars-data.tsx +5421 -0
- package/data/stacks-data.tsx +32 -0
- package/data/table-data.tsx +706 -0
- package/data/tailwind.config.js +3830 -0
- package/data/tailwind.config.ngin.js +3830 -0
- package/data/tailwind.css +431 -0
- package/data/tools-data.tsx +6910 -0
- package/data/typography-data.tsx +2050 -0
- package/data/utils-data.tsx +6500 -0
- package/data/x-data.tsx +1171 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30245 -0
- package/dist/index.js.map +362 -0
- package/package.json +50 -0
|
@@ -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
|
+
}
|