gladvn 0.2.36 → 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 +1 -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
|
@@ -3,22 +3,17 @@ import {
|
|
|
3
3
|
DocsCode,
|
|
4
4
|
DocsH3,
|
|
5
5
|
DocsP,
|
|
6
|
-
|
|
6
|
+
DocsUl,
|
|
7
|
+
DocsLi,
|
|
8
|
+
ShowcaseExample,
|
|
7
9
|
Showcase,
|
|
8
10
|
ShowcaseDocs
|
|
9
11
|
} from "../../dev/components/showcase";
|
|
10
12
|
|
|
11
|
-
// ──────────────────────────────────────────────────────────
|
|
12
|
-
// SECTION 1: Micro Content (Only Micro exists)
|
|
13
|
-
// ──────────────────────────────────────────────────────────
|
|
14
13
|
function SeparatorMicroShowcase() {
|
|
15
14
|
return (
|
|
16
|
-
<div className="space-y-10
|
|
17
|
-
<
|
|
18
|
-
label="Ngang (Horizontal)"
|
|
19
|
-
description="Sử dụng để phân tách các khối nội dung từ trên xuống dưới."
|
|
20
|
-
fullWidth
|
|
21
|
-
codeString={`<div className="w-full max-w-sm rounded-lg border border-border bg-card p-6">
|
|
15
|
+
<div className="space-y-10">
|
|
16
|
+
<ShowcaseExample title="Ngang (Horizontal)" description="Sử dụng để phân tách các khối nội dung từ trên xuống dưới." code={`<div className="w-full max-w-sm rounded-lg border border-border bg-card p-6">
|
|
22
17
|
<div className="space-y-1">
|
|
23
18
|
<h4 className="text-sm font-medium leading-none">
|
|
24
19
|
Gladvn UI
|
|
@@ -31,88 +26,82 @@ function SeparatorMicroShowcase() {
|
|
|
31
26
|
<div className="text-sm text-muted-foreground">
|
|
32
27
|
Cập nhật lần cuối: Hôm nay
|
|
33
28
|
</div>
|
|
34
|
-
</div>`}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
</div>`} preview={
|
|
30
|
+
<>
|
|
31
|
+
<div className="w-full max-w-sm rounded-lg border border-border bg-card p-6">
|
|
32
|
+
<div className="space-y-1">
|
|
33
|
+
<h4 className="text-sm font-medium leading-none">Gladvn UI</h4>
|
|
34
|
+
<p className="text-sm text-muted-foreground">
|
|
35
|
+
Bộ UI Component mã nguồn mở.
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
<Separator className="my-4" />
|
|
39
|
+
<div className="text-sm text-muted-foreground">
|
|
40
|
+
Cập nhật lần cuối: Hôm nay
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</>
|
|
44
|
+
} />
|
|
49
45
|
|
|
50
|
-
<
|
|
51
|
-
label="Dọc (Vertical)"
|
|
52
|
-
description="Sử dụng để phân tách các mục nằm ngang (như menu, thanh công cụ)."
|
|
53
|
-
codeString={`<div className="flex h-5 items-center space-x-4 text-sm">
|
|
46
|
+
<ShowcaseExample title="Dọc (Vertical)" description="Sử dụng để phân tách các mục nằm ngang (như menu, thanh công cụ)." code={`<div className="flex h-5 items-center space-x-4 text-sm">
|
|
54
47
|
<div className="font-medium hover:underline cursor-pointer">
|
|
55
48
|
Blog
|
|
56
49
|
</div>
|
|
57
|
-
<Separator orientation="vertical" />
|
|
50
|
+
<Separator orientation="vertical" className="h-5" />
|
|
58
51
|
<div className="font-medium hover:underline cursor-pointer">
|
|
59
52
|
Tài liệu
|
|
60
53
|
</div>
|
|
61
|
-
<Separator orientation="vertical" />
|
|
54
|
+
<Separator orientation="vertical" className="h-5" />
|
|
62
55
|
<div className="font-medium hover:underline cursor-pointer">
|
|
63
56
|
Mã nguồn
|
|
64
57
|
</div>
|
|
65
|
-
</div>`}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
description='Semantic (mặc định) được screen reader đọc. Truyền aria-hidden="true" khi Separator chỉ mang tính trang trí thuần.'
|
|
82
|
-
codeString={`{/* Semantic — screen reader đọc được */}
|
|
58
|
+
</div>`} preview={
|
|
59
|
+
<>
|
|
60
|
+
<div className="flex h-5 items-center space-x-4 text-sm">
|
|
61
|
+
<div className="font-medium hover:underline cursor-pointer">Blog</div>
|
|
62
|
+
<Separator orientation="vertical" className="h-5" />
|
|
63
|
+
<div className="font-medium hover:underline cursor-pointer">
|
|
64
|
+
Tài liệu
|
|
65
|
+
</div>
|
|
66
|
+
<Separator orientation="vertical" className="h-5" />
|
|
67
|
+
<div className="font-medium hover:underline cursor-pointer">
|
|
68
|
+
Mã nguồn
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</>
|
|
72
|
+
} />
|
|
73
|
+
<ShowcaseExample title="Decorative vs Semantic" description='Semantic (mặc định) được screen reader đọc. Truyền aria-hidden="true" khi Separator chỉ mang tính trang trí thuần.' code={`{/* Semantic — screen reader đọc được */}
|
|
83
74
|
<Separator />
|
|
84
75
|
|
|
85
76
|
{/* Decorative — chỉ là đường kẻ trực quan */}
|
|
86
|
-
<Separator aria-hidden="true" />`}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
77
|
+
<Separator aria-hidden="true" />`} preview={
|
|
78
|
+
<>
|
|
79
|
+
<div className="flex flex-col gap-6 w-full max-w-sm">
|
|
80
|
+
<div>
|
|
81
|
+
<p className="text-xs text-muted-foreground mb-2">
|
|
82
|
+
Semantic (mặc định — screen reader nhận ra)
|
|
83
|
+
</p>
|
|
84
|
+
<Separator />
|
|
85
|
+
</div>
|
|
86
|
+
<div>
|
|
87
|
+
<p className="text-xs text-muted-foreground mb-2">
|
|
88
|
+
Decorative — <code className="text-xs">aria-hidden="true"</code>
|
|
89
|
+
</p>
|
|
90
|
+
<Separator aria-hidden="true" />
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</>
|
|
94
|
+
} />
|
|
103
95
|
</div>
|
|
104
96
|
);
|
|
105
97
|
}
|
|
106
98
|
|
|
107
|
-
// ──────────────────────────────────────────────────────────
|
|
108
|
-
// SECTION 3: Entry point
|
|
109
|
-
// ──────────────────────────────────────────────────────────
|
|
110
99
|
export default function SeparatorShowcase() {
|
|
111
100
|
return (
|
|
112
101
|
<Showcase
|
|
113
102
|
title="Separator"
|
|
114
103
|
description="Thành phần phân cách trực quan hoặc ngữ nghĩa giữa các khối nội dung (Đường kẻ)."
|
|
115
|
-
|
|
104
|
+
guideline={
|
|
116
105
|
<ShowcaseDocs>
|
|
117
106
|
<DocsH3>Separator (Phân cách)</DocsH3>
|
|
118
107
|
<DocsP>
|
|
@@ -120,11 +109,24 @@ export default function SeparatorShowcase() {
|
|
|
120
109
|
nó chỉ là một đường kẻ phân tách giao diện. Mặc định là đường kẻ
|
|
121
110
|
ngang (<DocsCode>orientation="horizontal"</DocsCode>).
|
|
122
111
|
</DocsP>
|
|
112
|
+
|
|
113
|
+
<div className="mt-6 rounded-lg border border-amber-500/20 bg-amber-500/10 p-4">
|
|
114
|
+
<h4 className="mb-2 text-sm font-semibold text-amber-900 dark:text-amber-400">⚠️ Lưu ý quan trọng về Layout (Auto Layout/Flexbox)</h4>
|
|
115
|
+
<p className="mb-3 text-sm text-amber-900/90 dark:text-amber-200/90">
|
|
116
|
+
Separator rất "nhạy cảm" với cấu trúc flex bên ngoài. Nếu bạn thấy đường kẻ "biến mất" (kích thước bị bóp về 0px), hãy chú ý:
|
|
117
|
+
</p>
|
|
118
|
+
<DocsUl className="mb-0 text-sm text-amber-900/90 dark:text-amber-200/90">
|
|
119
|
+
<DocsLi>
|
|
120
|
+
<strong>Horizontal (Kẻ ngang):</strong> Component này mặc định chỉ cấp `h-px`. Vì là thẻ block nên nó tự giãn full ngang, tuy nhiên nếu ném vào <DocsCode className="bg-transparent border-amber-500/30">flex-row</DocsCode> tự do mà không set flex basis, width sẽ bị ép thành <DocsCode className="bg-transparent border-amber-500/30">0px</DocsCode>. Hãy bổ sung <DocsCode className="bg-transparent border-amber-500/30">w-full</DocsCode> hoặc <DocsCode className="bg-transparent border-amber-500/30">flex-1</DocsCode> nếu cần thiết.
|
|
121
|
+
</DocsLi>
|
|
122
|
+
<DocsLi>
|
|
123
|
+
<strong>Vertical (Kẻ dọc):</strong> Component chỉ cung cấp `w-px`. Nó hoàn toàn <strong>KHÔNG</strong> tự nội suy chiều cao (no self-stretch, no h-full). Do đó, bạn <strong>BẮT BUỘC</strong> phải truyền chiều cao rõ ràng từ bên ngoài thông qua <DocsCode className="bg-transparent border-amber-500/30">className</DocsCode> (Ví dụ: <DocsCode className="bg-transparent border-amber-500/30">h-5</DocsCode>, <DocsCode className="bg-transparent border-amber-500/30">h-full</DocsCode>, hoặc <DocsCode className="bg-transparent border-amber-500/30">self-stretch</DocsCode>).
|
|
124
|
+
</DocsLi>
|
|
125
|
+
</DocsUl>
|
|
126
|
+
</div>
|
|
123
127
|
</ShowcaseDocs>
|
|
124
128
|
}
|
|
125
|
-
|
|
126
|
-
{ label: "Micro (Primitive)", content: <SeparatorMicroShowcase /> },
|
|
127
|
-
]}
|
|
129
|
+
micro={{ content: <SeparatorMicroShowcase /> }}
|
|
128
130
|
/>
|
|
129
131
|
);
|
|
130
132
|
}
|