gladvn 0.2.33 → 0.2.34
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/package.json +1 -1
- package/src/blocks/auth-form.tsx +105 -0
- package/src/blocks/auth-recovery.tsx +5 -5
- package/src/blocks/auth-split.tsx +8 -8
- package/src/blocks/dashboard.tsx +162 -54
- package/src/blocks/settings.tsx +197 -68
- package/src/components/macro/field-preset.tsx +14 -17
- package/src/components/macro/input-preset.tsx +1 -1
- package/src/components/macro/textarea-preset.tsx +1 -1
- package/src/dev/App.tsx +192 -72
- package/src/dev/components/BlockViewer.tsx +136 -0
- package/src/dev/components/code-highlighter.tsx +17 -5
- package/src/dev/data.ts +40 -0
- package/src/dev/showcase/auth-form-block.tsx +13 -0
- package/src/dev/showcase/auth-recovery-block.tsx +13 -0
- package/src/dev/showcase/auth-split-block.tsx +13 -0
- package/src/dev/showcase/dashboard-block.tsx +77 -0
- package/src/dev/showcase/overview.tsx +53 -30
- package/src/dev/showcase/settings-block.tsx +13 -0
- package/src/blocks/auth-card.tsx +0 -104
- package/src/blocks/auth-dialog.tsx +0 -116
package/src/blocks/settings.tsx
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import { InfoIcon, TrashIcon } from "lucide-react";
|
|
2
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../components/micro/accordion";
|
|
3
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../components/micro/alert-dialog";
|
|
1
4
|
import { Button } from "../components/micro/button";
|
|
2
5
|
import { Input } from "../components/micro/input";
|
|
3
6
|
import { Label } from "../components/micro/label";
|
|
7
|
+
import { RadioGroup, RadioGroupItem } from "../components/micro/radio-group";
|
|
4
8
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../components/micro/select";
|
|
5
9
|
import { Separator } from "../components/micro/separator";
|
|
6
|
-
import {
|
|
10
|
+
import { Slider, SliderControl, SliderIndicator, SliderThumb, SliderTrack } from "../components/micro/slider";
|
|
11
|
+
import { Switch, SwitchThumb } from "../components/micro/switch";
|
|
12
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../components/micro/tabs";
|
|
13
|
+
import { Textarea } from "../components/micro/textarea";
|
|
14
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../components/micro/tooltip";
|
|
7
15
|
|
|
8
16
|
export default function SettingsBlock() {
|
|
9
17
|
return (
|
|
@@ -15,90 +23,211 @@ export default function SettingsBlock() {
|
|
|
15
23
|
</p>
|
|
16
24
|
</div>
|
|
17
25
|
<Separator className="my-6" />
|
|
18
|
-
|
|
19
|
-
<
|
|
26
|
+
|
|
27
|
+
<Tabs orientation="vertical" defaultValue="profile" className="flex flex-col md:flex-row gap-8">
|
|
20
28
|
<aside className="w-full md:w-64 shrink-0">
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
</nav>
|
|
29
|
+
<TabsList className="flex md:flex-col justify-start h-auto bg-transparent p-0 gap-2 w-full">
|
|
30
|
+
<TabsTrigger value="profile" className="w-full justify-start">Profile</TabsTrigger>
|
|
31
|
+
<TabsTrigger value="appearance" className="w-full justify-start">Appearance</TabsTrigger>
|
|
32
|
+
<TabsTrigger value="notifications" className="w-full justify-start">Notifications</TabsTrigger>
|
|
33
|
+
<TabsTrigger value="advanced" className="w-full justify-start">Advanced</TabsTrigger>
|
|
34
|
+
</TabsList>
|
|
28
35
|
</aside>
|
|
29
36
|
|
|
30
|
-
<div className="flex-1
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</div>
|
|
37
|
-
<Separator />
|
|
38
|
-
|
|
39
|
-
<div className="space-y-8">
|
|
40
|
-
<div className="space-y-2">
|
|
41
|
-
<Label htmlFor="username">Username</Label>
|
|
42
|
-
<Input id="username" placeholder="gladvn" defaultValue="johndoe" />
|
|
43
|
-
<p className="text-[13px] text-muted-foreground">
|
|
44
|
-
This is your public display name. It can be your real name or a pseudonym.
|
|
45
|
-
</p>
|
|
37
|
+
<div className="flex-1">
|
|
38
|
+
{/* PROFILE TAB */}
|
|
39
|
+
<TabsContent value="profile" className="mt-0">
|
|
40
|
+
<div className="space-y-4">
|
|
41
|
+
<h3 className="text-xl font-medium">Profile</h3>
|
|
42
|
+
<p className="text-sm text-muted-foreground">This is how others will see you on the site.</p>
|
|
46
43
|
</div>
|
|
44
|
+
<Separator className="my-6" />
|
|
45
|
+
|
|
46
|
+
<div className="flex flex-col gap-8">
|
|
47
|
+
<div className="flex flex-col gap-2">
|
|
48
|
+
<Label htmlFor="username">Username</Label>
|
|
49
|
+
<Input id="username" placeholder="gladvn" defaultValue="johndoe" />
|
|
50
|
+
<p className="text-[13px] text-muted-foreground">
|
|
51
|
+
This is your public display name. It can be your real name or a pseudonym.
|
|
52
|
+
</p>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div className="flex flex-col gap-2">
|
|
56
|
+
<Label htmlFor="email">Email</Label>
|
|
57
|
+
<Select defaultValue="m@example.com">
|
|
58
|
+
<SelectTrigger id="email">
|
|
59
|
+
<SelectValue placeholder="Select a verified email to display" />
|
|
60
|
+
</SelectTrigger>
|
|
61
|
+
<SelectContent>
|
|
62
|
+
<SelectItem value="m@example.com">m@example.com</SelectItem>
|
|
63
|
+
<SelectItem value="m@google.com">m@google.com</SelectItem>
|
|
64
|
+
<SelectItem value="m@support.com">m@support.com</SelectItem>
|
|
65
|
+
</SelectContent>
|
|
66
|
+
</Select>
|
|
67
|
+
<p className="text-[13px] text-muted-foreground">
|
|
68
|
+
You can manage verified email addresses in your email settings.
|
|
69
|
+
</p>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div className="flex flex-col gap-2">
|
|
73
|
+
<Label htmlFor="bio">Bio</Label>
|
|
74
|
+
<Textarea
|
|
75
|
+
id="bio"
|
|
76
|
+
placeholder="Tell us a little bit about yourself"
|
|
77
|
+
defaultValue="I own a computer."
|
|
78
|
+
className="min-h-[100px]"
|
|
79
|
+
/>
|
|
80
|
+
<p className="text-[13px] text-muted-foreground">
|
|
81
|
+
You can @mention other users and organizations to link to them.
|
|
82
|
+
</p>
|
|
83
|
+
</div>
|
|
47
84
|
|
|
48
|
-
|
|
49
|
-
<Label htmlFor="email">Email</Label>
|
|
50
|
-
<Select defaultValue="m@example.com">
|
|
51
|
-
<SelectTrigger id="email">
|
|
52
|
-
<SelectValue placeholder="Select a verified email to display" />
|
|
53
|
-
</SelectTrigger>
|
|
54
|
-
<SelectContent>
|
|
55
|
-
<SelectItem value="m@example.com">m@example.com</SelectItem>
|
|
56
|
-
<SelectItem value="m@google.com">m@google.com</SelectItem>
|
|
57
|
-
<SelectItem value="m@support.com">m@support.com</SelectItem>
|
|
58
|
-
</SelectContent>
|
|
59
|
-
</Select>
|
|
60
|
-
<p className="text-[13px] text-muted-foreground">
|
|
61
|
-
You can manage verified email addresses in your email settings.
|
|
62
|
-
</p>
|
|
85
|
+
<Button className="w-fit">Update profile</Button>
|
|
63
86
|
</div>
|
|
87
|
+
</TabsContent>
|
|
64
88
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
defaultValue="I own a computer."
|
|
71
|
-
/>
|
|
72
|
-
<p className="text-[13px] text-muted-foreground">
|
|
73
|
-
You can @mention other users and organizations to link to them.
|
|
74
|
-
</p>
|
|
89
|
+
{/* APPEARANCE TAB */}
|
|
90
|
+
<TabsContent value="appearance" className="mt-0">
|
|
91
|
+
<div className="space-y-4">
|
|
92
|
+
<h3 className="text-xl font-medium">Appearance</h3>
|
|
93
|
+
<p className="text-sm text-muted-foreground">Customize the look and feel of the application.</p>
|
|
75
94
|
</div>
|
|
76
|
-
|
|
77
|
-
|
|
95
|
+
<Separator className="my-6" />
|
|
96
|
+
|
|
97
|
+
<div className="flex flex-col gap-8">
|
|
98
|
+
<div className="flex flex-col gap-4">
|
|
99
|
+
<Label>Theme Preference</Label>
|
|
100
|
+
<RadioGroup defaultValue="light" className="flex flex-col gap-3">
|
|
101
|
+
<div className="flex items-center gap-2">
|
|
102
|
+
<RadioGroupItem value="light" id="theme-light" />
|
|
103
|
+
<Label htmlFor="theme-light" className="font-normal cursor-pointer">Light Theme</Label>
|
|
104
|
+
</div>
|
|
105
|
+
<div className="flex items-center gap-2">
|
|
106
|
+
<RadioGroupItem value="dark" id="theme-dark" />
|
|
107
|
+
<Label htmlFor="theme-dark" className="font-normal cursor-pointer">Dark Theme</Label>
|
|
108
|
+
</div>
|
|
109
|
+
<div className="flex items-center gap-2">
|
|
110
|
+
<RadioGroupItem value="system" id="theme-system" />
|
|
111
|
+
<Label htmlFor="theme-system" className="font-normal cursor-pointer">System Default</Label>
|
|
112
|
+
</div>
|
|
113
|
+
</RadioGroup>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div className="flex flex-col gap-4">
|
|
117
|
+
<div className="flex items-center gap-2">
|
|
118
|
+
<Label>Interface Scale</Label>
|
|
119
|
+
<TooltipProvider>
|
|
120
|
+
<Tooltip>
|
|
121
|
+
<TooltipTrigger render={<InfoIcon className="size-4 text-muted-foreground" />} />
|
|
122
|
+
<TooltipContent>Adjusts the overall size of UI elements</TooltipContent>
|
|
123
|
+
</Tooltip>
|
|
124
|
+
</TooltipProvider>
|
|
125
|
+
</div>
|
|
126
|
+
<div className="py-2 px-1">
|
|
127
|
+
<Slider defaultValue={50}>
|
|
128
|
+
<SliderControl>
|
|
129
|
+
<SliderTrack>
|
|
130
|
+
<SliderIndicator />
|
|
131
|
+
</SliderTrack>
|
|
132
|
+
<SliderThumb />
|
|
133
|
+
</SliderControl>
|
|
134
|
+
</Slider>
|
|
135
|
+
</div>
|
|
136
|
+
<p className="text-[13px] text-muted-foreground text-right">Medium (100%)</p>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<Button className="w-fit">Save preferences</Button>
|
|
140
|
+
</div>
|
|
141
|
+
</TabsContent>
|
|
142
|
+
|
|
143
|
+
{/* NOTIFICATIONS TAB */}
|
|
144
|
+
<TabsContent value="notifications" className="mt-0">
|
|
145
|
+
<div className="space-y-4">
|
|
146
|
+
<h3 className="text-xl font-medium">Notifications</h3>
|
|
147
|
+
<p className="text-sm text-muted-foreground">Configure how you receive alerts.</p>
|
|
148
|
+
</div>
|
|
149
|
+
<Separator className="my-6" />
|
|
150
|
+
|
|
151
|
+
<div className="flex flex-col gap-4">
|
|
78
152
|
<div className="flex items-center justify-between rounded-xl border border-border p-4">
|
|
79
|
-
<div className="
|
|
80
|
-
<Label className="text-base">Marketing emails</Label>
|
|
81
|
-
<p className="text-[13px] text-muted-foreground">
|
|
82
|
-
Receive emails about new products, features, and more.
|
|
83
|
-
</p>
|
|
153
|
+
<div className="flex flex-col gap-0.5">
|
|
154
|
+
<Label htmlFor="marketing-emails" className="text-base cursor-pointer">Marketing emails</Label>
|
|
155
|
+
<p className="text-[13px] text-muted-foreground">Receive emails about new products, features, and more.</p>
|
|
84
156
|
</div>
|
|
85
|
-
<Switch
|
|
157
|
+
<Switch id="marketing-emails">
|
|
158
|
+
<SwitchThumb />
|
|
159
|
+
</Switch>
|
|
86
160
|
</div>
|
|
87
161
|
<div className="flex items-center justify-between rounded-xl border border-border p-4">
|
|
88
|
-
<div className="
|
|
89
|
-
<Label className="text-base">Security emails</Label>
|
|
90
|
-
<p className="text-[13px] text-muted-foreground">
|
|
91
|
-
Receive emails about your account activity and security.
|
|
92
|
-
</p>
|
|
162
|
+
<div className="flex flex-col gap-0.5">
|
|
163
|
+
<Label htmlFor="security-emails" className="text-base cursor-pointer">Security emails</Label>
|
|
164
|
+
<p className="text-[13px] text-muted-foreground">Receive emails about your account activity and security.</p>
|
|
93
165
|
</div>
|
|
94
|
-
<Switch defaultChecked
|
|
166
|
+
<Switch id="security-emails" defaultChecked>
|
|
167
|
+
<SwitchThumb />
|
|
168
|
+
</Switch>
|
|
95
169
|
</div>
|
|
96
170
|
</div>
|
|
171
|
+
</TabsContent>
|
|
172
|
+
|
|
173
|
+
{/* ADVANCED TAB */}
|
|
174
|
+
<TabsContent value="advanced" className="mt-0">
|
|
175
|
+
<div className="space-y-4">
|
|
176
|
+
<h3 className="text-xl font-medium text-destructive">Advanced</h3>
|
|
177
|
+
<p className="text-sm text-muted-foreground">Danger zone and developer settings.</p>
|
|
178
|
+
</div>
|
|
179
|
+
<Separator className="my-6" />
|
|
180
|
+
|
|
181
|
+
<Accordion className="w-full">
|
|
182
|
+
<AccordionItem value="dev-mode">
|
|
183
|
+
<AccordionTrigger>Developer Mode</AccordionTrigger>
|
|
184
|
+
<AccordionContent>
|
|
185
|
+
Enable advanced debugging features and API access tokens in your dashboard.
|
|
186
|
+
<div className="mt-4">
|
|
187
|
+
<Button variant="outline" size="sm">Generate Token</Button>
|
|
188
|
+
</div>
|
|
189
|
+
</AccordionContent>
|
|
190
|
+
</AccordionItem>
|
|
191
|
+
<AccordionItem value="data-export">
|
|
192
|
+
<AccordionTrigger>Export Data</AccordionTrigger>
|
|
193
|
+
<AccordionContent>
|
|
194
|
+
Download a complete archive of all your personal data, posts, and settings in JSON format.
|
|
195
|
+
</AccordionContent>
|
|
196
|
+
</AccordionItem>
|
|
197
|
+
</Accordion>
|
|
198
|
+
|
|
199
|
+
<div className="mt-12 p-6 border border-destructive/20 bg-destructive/5 rounded-xl flex flex-col gap-4 items-start">
|
|
200
|
+
<div className="space-y-1">
|
|
201
|
+
<h4 className="font-semibold text-destructive">Delete Account</h4>
|
|
202
|
+
<p className="text-sm text-muted-foreground">Permanently delete your account and all associated data. This action cannot be undone.</p>
|
|
203
|
+
</div>
|
|
97
204
|
|
|
98
|
-
|
|
99
|
-
|
|
205
|
+
<AlertDialog>
|
|
206
|
+
<AlertDialogTrigger
|
|
207
|
+
render={
|
|
208
|
+
<Button color="destructive">
|
|
209
|
+
<TrashIcon className="size-4 mr-2" /> Delete Account
|
|
210
|
+
</Button>
|
|
211
|
+
}
|
|
212
|
+
/>
|
|
213
|
+
<AlertDialogContent>
|
|
214
|
+
<AlertDialogHeader>
|
|
215
|
+
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
|
|
216
|
+
<AlertDialogDescription>
|
|
217
|
+
This action cannot be undone. This will permanently delete your
|
|
218
|
+
account and remove your data from our servers.
|
|
219
|
+
</AlertDialogDescription>
|
|
220
|
+
</AlertDialogHeader>
|
|
221
|
+
<AlertDialogFooter>
|
|
222
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
223
|
+
<AlertDialogAction color="destructive">Yes, delete account</AlertDialogAction>
|
|
224
|
+
</AlertDialogFooter>
|
|
225
|
+
</AlertDialogContent>
|
|
226
|
+
</AlertDialog>
|
|
227
|
+
</div>
|
|
228
|
+
</TabsContent>
|
|
100
229
|
</div>
|
|
101
|
-
</
|
|
230
|
+
</Tabs>
|
|
102
231
|
</div>
|
|
103
232
|
);
|
|
104
233
|
}
|
|
@@ -41,23 +41,20 @@ const FieldPreset = React.forwardRef<
|
|
|
41
41
|
ref,
|
|
42
42
|
) => {
|
|
43
43
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</Field>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
44
|
+
<Field
|
|
45
|
+
ref={ref}
|
|
46
|
+
className={className}
|
|
47
|
+
error={!!errorMessage}
|
|
48
|
+
size={size}
|
|
49
|
+
{...fieldProps}
|
|
50
|
+
>
|
|
51
|
+
{label && <FieldLabel htmlFor={htmlFor}>{label}</FieldLabel>}
|
|
52
|
+
<FieldContent>{children}</FieldContent>
|
|
53
|
+
{description && <FieldDescription>{description}</FieldDescription>}
|
|
54
|
+
{showError && errorMessage && (
|
|
55
|
+
<FieldError>{errorMessage}</FieldError>
|
|
56
|
+
)}
|
|
57
|
+
</Field>
|
|
61
58
|
);
|
|
62
59
|
},
|
|
63
60
|
);
|
|
@@ -4,7 +4,7 @@ import React, { useState } from "react";
|
|
|
4
4
|
|
|
5
5
|
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
6
6
|
|
|
7
|
-
import { Input, InputProps } from "../../components/micro/input";
|
|
7
|
+
import { Input, type InputProps } from "../../components/micro/input";
|
|
8
8
|
import {
|
|
9
9
|
InputGroup,
|
|
10
10
|
InputGroupAddon,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
|
-
import { Textarea, TextareaProps } from "../../components/micro/textarea";
|
|
5
|
+
import { Textarea, type TextareaProps } from "../../components/micro/textarea";
|
|
6
6
|
import { FieldPreset } from "./field-preset";
|
|
7
7
|
|
|
8
8
|
export type TextareaPresetProps = Omit<TextareaProps, "className"> & {
|