gladvn 0.2.35 → 0.2.37
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 +1 -1
- package/package.json +2 -1
- package/scripts/strip-comments.ts +79 -0
- package/src/blocks/auth-form.tsx +34 -30
- package/src/blocks/auth-recovery.tsx +9 -13
- package/src/blocks/auth-split.tsx +46 -36
- package/src/blocks/settings.tsx +84 -117
- package/src/components/macro/alert-preset.tsx +3 -1
- package/src/components/macro/carousel-preset.tsx +0 -1
- package/src/components/macro/checkbox-preset.test.tsx +2 -2
- package/src/components/macro/checkbox-preset.tsx +1 -2
- package/src/components/macro/command-preset.tsx +1 -1
- package/src/components/macro/date-picker.tsx +5 -18
- package/src/components/macro/dialog-preset.tsx +5 -3
- package/src/components/macro/input-preset.tsx +0 -1
- package/src/components/macro/select-preset.tsx +1 -1
- package/src/components/macro/switch-preset.test.tsx +1 -1
- package/src/components/micro/accordion.test.tsx +6 -12
- package/src/components/micro/alert-dialog.tsx +0 -2
- package/src/components/micro/alert.test.tsx +5 -8
- package/src/components/micro/alert.tsx +0 -2
- package/src/components/micro/badge.test.tsx +5 -7
- package/src/components/micro/badge.tsx +1 -3
- package/src/components/micro/button.test.tsx +19 -26
- package/src/components/micro/button.tsx +3 -11
- package/src/components/micro/calendar.tsx +12 -13
- package/src/components/micro/card.test.tsx +3 -5
- package/src/components/micro/carousel.tsx +0 -1
- package/src/components/micro/chart.tsx +3 -2
- package/src/components/micro/checkbox.test.tsx +9 -18
- package/src/components/micro/combobox.tsx +1 -3
- package/src/components/micro/command.tsx +23 -11
- package/src/components/micro/context-menu.tsx +0 -2
- package/src/components/micro/dialog.test.tsx +6 -14
- package/src/components/micro/dialog.tsx +0 -2
- package/src/components/micro/drawer.tsx +0 -3
- package/src/components/micro/dropdown-menu.test.tsx +8 -14
- package/src/components/micro/dropdown-menu.tsx +0 -2
- package/src/components/micro/field.tsx +3 -3
- package/src/components/micro/hover-card.tsx +0 -2
- package/src/components/micro/input-group.tsx +9 -42
- package/src/components/micro/input.test.tsx +15 -24
- package/src/components/micro/navigation-menu.tsx +0 -2
- package/src/components/micro/popover.test.tsx +5 -9
- package/src/components/micro/progress.tsx +5 -1
- package/src/components/micro/select.test.tsx +5 -18
- package/src/components/micro/select.tsx +3 -5
- package/src/components/micro/separator.tsx +1 -1
- package/src/components/micro/sheet.test.tsx +6 -14
- package/src/components/micro/sheet.tsx +0 -2
- package/src/components/micro/sidebar.tsx +5 -6
- package/src/components/micro/sonner.tsx +0 -1
- package/src/components/micro/switch.test.tsx +9 -18
- package/src/components/micro/switch.tsx +1 -1
- package/src/components/micro/tabs.test.tsx +5 -11
- package/src/components/micro/theme-provider.tsx +0 -12
- package/src/components/micro/toggle-group.tsx +1 -12
- package/src/components/micro/tooltip.test.tsx +7 -12
- package/src/dev/App.tsx +6 -6
- package/src/dev/components/BlockViewer.tsx +15 -4
- package/src/dev/components/Container.tsx +20 -0
- package/src/dev/components/GladvnLogo.tsx +3 -9
- package/src/dev/components/code-highlighter.tsx +5 -3
- package/src/dev/components/showcase.tsx +116 -168
- package/src/dev/sections/buttons.tsx +4 -9
- package/src/dev/sections/display.tsx +68 -72
- package/src/dev/sections/feedback.tsx +304 -314
- package/src/dev/sections/forms.tsx +10 -14
- package/src/dev/sections/interactive.tsx +32 -32
- package/src/dev/sections/overview.tsx +2 -10
- package/src/dev/showcase/accordion.tsx +512 -554
- package/src/dev/showcase/alert-dialog.tsx +525 -565
- package/src/dev/showcase/alert.tsx +352 -402
- package/src/dev/showcase/aspect-ratio.tsx +167 -193
- package/src/dev/showcase/avatar.tsx +231 -269
- package/src/dev/showcase/badge.tsx +92 -140
- package/src/dev/showcase/breadcrumb.tsx +113 -135
- package/src/dev/showcase/button.tsx +140 -173
- package/src/dev/showcase/calendar.tsx +187 -237
- package/src/dev/showcase/card.tsx +229 -261
- package/src/dev/showcase/carousel.tsx +288 -315
- package/src/dev/showcase/chart.tsx +44 -50
- package/src/dev/showcase/checkbox.tsx +286 -330
- package/src/dev/showcase/collapsible.tsx +143 -160
- package/src/dev/showcase/combobox.tsx +327 -369
- package/src/dev/showcase/command.tsx +106 -120
- package/src/dev/showcase/context-menu.tsx +93 -107
- package/src/dev/showcase/dialog.tsx +585 -630
- package/src/dev/showcase/drawer.tsx +176 -196
- package/src/dev/showcase/dropdown-menu.tsx +183 -201
- package/src/dev/showcase/empty.tsx +232 -274
- package/src/dev/showcase/hover-card.tsx +153 -180
- package/src/dev/showcase/input-group.tsx +221 -253
- package/src/dev/showcase/input-otp.tsx +204 -250
- package/src/dev/showcase/input.tsx +246 -325
- package/src/dev/showcase/item.tsx +134 -152
- package/src/dev/showcase/kbd.tsx +149 -172
- package/src/dev/showcase/label.tsx +50 -68
- package/src/dev/showcase/menubar.tsx +194 -213
- package/src/dev/showcase/navigation-menu.tsx +119 -133
- package/src/dev/showcase/overview-components/ArchitectureSection.tsx +126 -0
- package/src/dev/showcase/overview-components/CodeBlock.tsx +50 -0
- package/src/dev/showcase/overview-components/ColorPaletteSection.tsx +44 -0
- package/src/dev/showcase/overview-components/DashboardPreview.tsx +159 -0
- package/src/dev/showcase/overview-components/FeatureGridSection.tsx +535 -0
- package/src/dev/showcase/overview-components/FooterCTA.tsx +137 -0
- package/src/dev/showcase/overview-components/HeroSection.tsx +65 -0
- package/src/dev/showcase/overview-components/PrinciplesSection.tsx +128 -0
- package/src/dev/showcase/overview.tsx +21 -1163
- package/src/dev/showcase/pagination.tsx +144 -190
- package/src/dev/showcase/popover.tsx +181 -196
- package/src/dev/showcase/progress.tsx +141 -189
- package/src/dev/showcase/radio-group.tsx +272 -332
- package/src/dev/showcase/resizable.tsx +119 -141
- package/src/dev/showcase/scroll-area.tsx +21 -36
- package/src/dev/showcase/select.tsx +262 -322
- package/src/dev/showcase/separator.tsx +75 -73
- package/src/dev/showcase/sheet.tsx +333 -361
- package/src/dev/showcase/sidebar.tsx +53 -59
- package/src/dev/showcase/skeleton.tsx +93 -112
- package/src/dev/showcase/slider.tsx +244 -296
- package/src/dev/showcase/sonner.tsx +251 -258
- package/src/dev/showcase/spinner.tsx +46 -67
- package/src/dev/showcase/switch.tsx +298 -362
- package/src/dev/showcase/table.tsx +76 -80
- package/src/dev/showcase/tabs.tsx +302 -355
- package/src/dev/showcase/textarea.tsx +240 -293
- package/src/dev/showcase/toast.tsx +48 -54
- package/src/dev/showcase/toggle-group.tsx +104 -129
- package/src/dev/showcase/toggle.tsx +82 -102
- package/src/dev/showcase/tooltip.tsx +173 -192
- package/src/dev/showcase/why.tsx +6 -12
- package/src/hooks/use-mobile.test.ts +3 -2
- package/src/lib/utils.test.ts +5 -4
|
@@ -78,9 +78,7 @@ export default function FormsSection() {
|
|
|
78
78
|
/>
|
|
79
79
|
</SectionHeader>
|
|
80
80
|
|
|
81
|
-
{/* Masonry layout */}
|
|
82
81
|
<div className="columns-1 md:columns-2 gap-6 space-y-6 [&>div]:break-inside-avoid">
|
|
83
|
-
{/* 1. TEXT FIELDS */}
|
|
84
82
|
<div className="rounded-2xl border border-border bg-card/40 p-6 shadow-sm transition-all hover:shadow-md flex flex-col gap-5">
|
|
85
83
|
<div className="flex items-center gap-3 mb-2">
|
|
86
84
|
<div className="flex size-10 items-center justify-center rounded-xl bg-primary/10 text-primary">
|
|
@@ -104,7 +102,7 @@ export default function FormsSection() {
|
|
|
104
102
|
<Input
|
|
105
103
|
id="tf-input"
|
|
106
104
|
size={globalSize}
|
|
107
|
-
placeholder="
|
|
105
|
+
placeholder="Nhập giá trị..."
|
|
108
106
|
/>
|
|
109
107
|
</FieldContent>
|
|
110
108
|
</Field>
|
|
@@ -121,7 +119,7 @@ export default function FormsSection() {
|
|
|
121
119
|
id="tf-textarea"
|
|
122
120
|
size={globalSize}
|
|
123
121
|
rows={3}
|
|
124
|
-
placeholder="
|
|
122
|
+
placeholder="Viết gì đó..."
|
|
125
123
|
/>
|
|
126
124
|
</FieldContent>
|
|
127
125
|
</Field>
|
|
@@ -169,7 +167,6 @@ export default function FormsSection() {
|
|
|
169
167
|
</div>
|
|
170
168
|
</div>
|
|
171
169
|
|
|
172
|
-
{/* 2. PICKERS & DROPDOWNS */}
|
|
173
170
|
<div className="rounded-2xl border border-border bg-card/40 p-6 shadow-sm transition-all hover:shadow-md flex flex-col gap-5">
|
|
174
171
|
<div className="flex items-center gap-3 mb-2">
|
|
175
172
|
<div className="flex size-10 items-center justify-center rounded-xl bg-success/10 text-success">
|
|
@@ -189,7 +186,7 @@ export default function FormsSection() {
|
|
|
189
186
|
<FieldContent>
|
|
190
187
|
<Select>
|
|
191
188
|
<SelectTrigger size={globalSize}>
|
|
192
|
-
<SelectValue placeholder="
|
|
189
|
+
<SelectValue placeholder="Chọn framework..." />
|
|
193
190
|
</SelectTrigger>
|
|
194
191
|
<SelectContent>
|
|
195
192
|
<SelectItem value="next">Next.js</SelectItem>
|
|
@@ -209,7 +206,7 @@ export default function FormsSection() {
|
|
|
209
206
|
<FieldContent>
|
|
210
207
|
<Select>
|
|
211
208
|
<SelectTrigger size={globalSize}>
|
|
212
|
-
<SelectValue placeholder="
|
|
209
|
+
<SelectValue placeholder="Chọn trái cây..." />
|
|
213
210
|
</SelectTrigger>
|
|
214
211
|
<SelectContent>
|
|
215
212
|
<SelectGroup>
|
|
@@ -233,7 +230,7 @@ export default function FormsSection() {
|
|
|
233
230
|
<FieldContent>
|
|
234
231
|
<SelectPreset
|
|
235
232
|
size={globalSize}
|
|
236
|
-
placeholder="
|
|
233
|
+
placeholder="Danh sách..."
|
|
237
234
|
options={[
|
|
238
235
|
{ value: "1", label: "Option 1" },
|
|
239
236
|
{ value: "2", label: "Option 2" },
|
|
@@ -275,7 +272,7 @@ export default function FormsSection() {
|
|
|
275
272
|
</FieldDescription>
|
|
276
273
|
<FieldContent>
|
|
277
274
|
<Combobox>
|
|
278
|
-
<ComboboxInput placeholder="
|
|
275
|
+
<ComboboxInput placeholder="Tìm framework..." />
|
|
279
276
|
<ComboboxContent>
|
|
280
277
|
<ComboboxList>
|
|
281
278
|
<ComboboxItem value="react">React</ComboboxItem>
|
|
@@ -289,7 +286,6 @@ export default function FormsSection() {
|
|
|
289
286
|
</div>
|
|
290
287
|
</div>
|
|
291
288
|
|
|
292
|
-
{/* 3. TOGGLES & SELECTORS */}
|
|
293
289
|
<div className="rounded-2xl border border-border bg-card/40 p-6 shadow-sm transition-all hover:shadow-md flex flex-col gap-5">
|
|
294
290
|
<div className="flex items-center gap-3 mb-2">
|
|
295
291
|
<div className="flex size-10 items-center justify-center rounded-xl bg-info/10 text-info">
|
|
@@ -504,7 +500,7 @@ export default function FormsSection() {
|
|
|
504
500
|
id="err-input-username"
|
|
505
501
|
size={globalSize}
|
|
506
502
|
aria-invalid
|
|
507
|
-
placeholder="
|
|
503
|
+
placeholder="VD: john_doe"
|
|
508
504
|
/>
|
|
509
505
|
</FieldContent>
|
|
510
506
|
<FieldError
|
|
@@ -524,7 +520,7 @@ export default function FormsSection() {
|
|
|
524
520
|
<InputGroupInput
|
|
525
521
|
id="err-group"
|
|
526
522
|
aria-invalid
|
|
527
|
-
placeholder="
|
|
523
|
+
placeholder="tên người dùng"
|
|
528
524
|
/>
|
|
529
525
|
</InputGroup>
|
|
530
526
|
</FieldContent>
|
|
@@ -538,7 +534,7 @@ export default function FormsSection() {
|
|
|
538
534
|
<FieldContent>
|
|
539
535
|
<Select>
|
|
540
536
|
<SelectTrigger size={globalSize} aria-invalid>
|
|
541
|
-
<SelectValue placeholder="
|
|
537
|
+
<SelectValue placeholder="Lựa chọn không hợp lệ..." />
|
|
542
538
|
</SelectTrigger>
|
|
543
539
|
<SelectContent>
|
|
544
540
|
<SelectItem value="1">Pro Plan</SelectItem>
|
|
@@ -564,7 +560,7 @@ export default function FormsSection() {
|
|
|
564
560
|
size={globalSize}
|
|
565
561
|
aria-invalid
|
|
566
562
|
>
|
|
567
|
-
<SelectValue placeholder="
|
|
563
|
+
<SelectValue placeholder="Chọn tuỳ chọn..." />
|
|
568
564
|
</SelectTrigger>
|
|
569
565
|
<SelectContent></SelectContent>
|
|
570
566
|
</Select>
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
TabsList,
|
|
8
8
|
TabsTrigger,
|
|
9
9
|
} from "../../components/micro/tabs";
|
|
10
|
-
import { SectionHeader,
|
|
10
|
+
import { SectionHeader, ShowcaseExample } from "../../dev/components/showcase";
|
|
11
11
|
|
|
12
12
|
export default function InteractiveSection() {
|
|
13
13
|
const [tab, setTab] = useState("preview");
|
|
@@ -15,37 +15,37 @@ export default function InteractiveSection() {
|
|
|
15
15
|
<div className="space-y-5">
|
|
16
16
|
<SectionHeader title="Interactive" description="Tabs, Tooltips, Switch" />
|
|
17
17
|
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
18
|
+
<ShowcaseExample title="Tabs" preview={<>
|
|
19
|
+
<Tabs value={tab} onValueChange={setTab}>
|
|
20
|
+
<TabsList>
|
|
21
|
+
<TabsTrigger value="preview">Preview</TabsTrigger>
|
|
22
|
+
<TabsTrigger value="code">Code</TabsTrigger>
|
|
23
|
+
<TabsTrigger value="props">Props</TabsTrigger>
|
|
24
|
+
</TabsList>
|
|
25
|
+
<TabsContent value="preview" className="pt-4">
|
|
26
|
+
<Button color="success">Lưu thay đổi</Button>
|
|
27
|
+
</TabsContent>
|
|
28
|
+
<TabsContent value="code" className="pt-4">
|
|
29
|
+
<pre className="text-xs bg-muted rounded-md p-3 overflow-x-auto">
|
|
30
|
+
{`<Button color="success">Lưu thay đổi</Button>`}
|
|
31
|
+
</pre>
|
|
32
|
+
</TabsContent>
|
|
33
|
+
<TabsContent value="props" className="pt-4">
|
|
34
|
+
<div className="text-xs text-muted-foreground space-y-1">
|
|
35
|
+
<div>
|
|
36
|
+
<code>variant</code> — solid | outline | soft | ghost | link
|
|
37
|
+
</div>
|
|
38
|
+
<div>
|
|
39
|
+
<code>color</code> — primary | secondary | destructive | warning
|
|
40
|
+
| success | info | tertiary
|
|
41
|
+
</div>
|
|
42
|
+
<div>
|
|
43
|
+
<code>size</code> — sm | md | lg
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</TabsContent>
|
|
47
|
+
</Tabs>
|
|
48
|
+
</>} />
|
|
49
49
|
</div>
|
|
50
50
|
);
|
|
51
51
|
}
|
|
@@ -45,15 +45,13 @@ export default function OverviewSection() {
|
|
|
45
45
|
const handleCopy = () => {
|
|
46
46
|
navigator.clipboard.writeText("npm i gladvn");
|
|
47
47
|
setCopied(true);
|
|
48
|
-
toast.success("
|
|
48
|
+
toast.success("Đã copy lệnh vào clipboard");
|
|
49
49
|
setTimeout(() => setCopied(false), 2000);
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<div className="space-y-6 overflow-hidden">
|
|
54
|
-
{/* Bento Grid */}
|
|
55
54
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 md:gap-6">
|
|
56
|
-
{/* 🌟 Hero Banner - Span 2 cols */}
|
|
57
55
|
<div
|
|
58
56
|
className="md:col-span-2 row-span-2 relative overflow-hidden rounded-2xl border border-border bg-card/40 p-6 md:p-8 shadow-sm transition-all hover:shadow-md hover:bg-card/60 group opacity-0 animate-fade-up"
|
|
59
57
|
style={{ animationDelay: "0ms" }}
|
|
@@ -82,9 +80,7 @@ export default function OverviewSection() {
|
|
|
82
80
|
</p>
|
|
83
81
|
</div>
|
|
84
82
|
|
|
85
|
-
{/* Component Collage */}
|
|
86
83
|
<div className="relative h-[240px] mt-8 w-full">
|
|
87
|
-
{/* Floating elements */}
|
|
88
84
|
<div className="absolute top-0 right-4 lg:right-12 hover:-translate-y-1 transition-transform duration-300 animate-float-slow">
|
|
89
85
|
<Card className="w-[220px] shadow-xl bg-background/80 backdrop-blur-md border-primary/20">
|
|
90
86
|
<CardHeader className="p-4 pb-2">
|
|
@@ -110,7 +106,7 @@ export default function OverviewSection() {
|
|
|
110
106
|
</div>
|
|
111
107
|
<Select defaultValue="system">
|
|
112
108
|
<SelectTrigger size="sm">
|
|
113
|
-
<SelectValue placeholder="
|
|
109
|
+
<SelectValue placeholder="Giao diện" />
|
|
114
110
|
</SelectTrigger>
|
|
115
111
|
<SelectContent>
|
|
116
112
|
<SelectItem value="light">Light</SelectItem>
|
|
@@ -131,7 +127,6 @@ export default function OverviewSection() {
|
|
|
131
127
|
</div>
|
|
132
128
|
</div>
|
|
133
129
|
|
|
134
|
-
{/* 📦 Quick Example - Span 1 col */}
|
|
135
130
|
<div
|
|
136
131
|
className="md:col-span-1 rounded-2xl border border-border bg-card/40 p-6 shadow-sm transition-all hover:shadow-md hover:-translate-y-1 group flex flex-col justify-between opacity-0 animate-fade-up"
|
|
137
132
|
style={{ animationDelay: "100ms" }}
|
|
@@ -170,7 +165,6 @@ export default function OverviewSection() {
|
|
|
170
165
|
</Button>
|
|
171
166
|
</div>
|
|
172
167
|
|
|
173
|
-
{/* 📊 Stats Grid - Span 1 col, 2x2 grid inside */}
|
|
174
168
|
<div
|
|
175
169
|
className="md:col-span-1 grid grid-cols-2 gap-4 opacity-0 animate-fade-up"
|
|
176
170
|
style={{ animationDelay: "200ms" }}
|
|
@@ -201,7 +195,6 @@ export default function OverviewSection() {
|
|
|
201
195
|
})}
|
|
202
196
|
</div>
|
|
203
197
|
|
|
204
|
-
{/* 🎨 Color Tokens - Span 3 cols */}
|
|
205
198
|
<div
|
|
206
199
|
className="md:col-span-3 rounded-2xl border border-border bg-card/40 p-6 shadow-sm transition-all hover:shadow-md group opacity-0 animate-fade-up"
|
|
207
200
|
style={{ animationDelay: "300ms" }}
|
|
@@ -229,7 +222,6 @@ export default function OverviewSection() {
|
|
|
229
222
|
</div>
|
|
230
223
|
</div>
|
|
231
224
|
|
|
232
|
-
{/* 📚 Architecture Cheatsheet - Span 3 cols */}
|
|
233
225
|
<div
|
|
234
226
|
className="md:col-span-3 rounded-2xl border border-border bg-card/40 p-6 shadow-sm transition-all hover:shadow-md group opacity-0 animate-fade-up"
|
|
235
227
|
style={{ animationDelay: "400ms" }}
|