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
|
@@ -12,28 +12,22 @@ import {
|
|
|
12
12
|
DocsH3,
|
|
13
13
|
DocsP,
|
|
14
14
|
ExampleGrid,
|
|
15
|
-
|
|
15
|
+
ShowcaseExample,
|
|
16
16
|
Showcase,
|
|
17
17
|
ShowcaseDocs
|
|
18
18
|
} from "../../dev/components/showcase";
|
|
19
19
|
|
|
20
|
-
// ──────────────────────────────────────────────────────────
|
|
21
|
-
// SECTION 1: Macro Content
|
|
22
|
-
// ──────────────────────────────────────────────────────────
|
|
23
20
|
function TabsMacroShowcase() {
|
|
24
21
|
return (
|
|
25
|
-
<div className="space-y-10
|
|
22
|
+
<div className="space-y-10">
|
|
26
23
|
<ExampleGrid>
|
|
27
|
-
<
|
|
28
|
-
label="Tiêu chuẩn (Standard)"
|
|
29
|
-
description="Tabs cơ bản truyền qua mảng items."
|
|
30
|
-
codeString={`<TabsPreset
|
|
24
|
+
<ShowcaseExample title="Tiêu chuẩn (Standard)" description="Tabs cơ bản truyền qua mảng items." code={`<TabsPreset
|
|
31
25
|
defaultValue="account"
|
|
32
26
|
className="w-full"
|
|
33
27
|
items={[
|
|
34
28
|
{
|
|
35
29
|
value: "account",
|
|
36
|
-
title: "
|
|
30
|
+
title: "Tài khoản",
|
|
37
31
|
content: (
|
|
38
32
|
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
39
33
|
<h4 className="font-medium">Account</h4>
|
|
@@ -44,7 +38,7 @@ function TabsMacroShowcase() {
|
|
|
44
38
|
) },
|
|
45
39
|
{
|
|
46
40
|
value: "password",
|
|
47
|
-
title: "
|
|
41
|
+
title: "Mật khẩu",
|
|
48
42
|
content: (
|
|
49
43
|
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
50
44
|
<h4 className="font-medium">Password</h4>
|
|
@@ -54,42 +48,40 @@ function TabsMacroShowcase() {
|
|
|
54
48
|
</div>
|
|
55
49
|
) },
|
|
56
50
|
]}
|
|
57
|
-
/>`}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
51
|
+
/>`} preview={
|
|
52
|
+
<>
|
|
53
|
+
<TabsPreset
|
|
54
|
+
defaultValue="account"
|
|
55
|
+
className="w-full"
|
|
56
|
+
items={[
|
|
57
|
+
{
|
|
58
|
+
value: "account",
|
|
59
|
+
title: "Tài khoản",
|
|
60
|
+
content: (
|
|
61
|
+
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
62
|
+
<h4 className="font-medium">Account</h4>
|
|
63
|
+
<p className="text-sm text-muted-foreground">
|
|
64
|
+
Account settings here.
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
67
|
+
) },
|
|
68
|
+
{
|
|
69
|
+
value: "password",
|
|
70
|
+
title: "Mật khẩu",
|
|
71
|
+
content: (
|
|
72
|
+
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
73
|
+
<h4 className="font-medium">Password</h4>
|
|
74
|
+
<p className="text-sm text-muted-foreground">
|
|
75
|
+
Change your password here.
|
|
76
|
+
</p>
|
|
77
|
+
</div>
|
|
78
|
+
) },
|
|
79
|
+
]}
|
|
80
|
+
/>
|
|
81
|
+
</>
|
|
82
|
+
} />
|
|
88
83
|
|
|
89
|
-
<
|
|
90
|
-
label="Tab bị vô hiệu hóa (Disabled Tab)"
|
|
91
|
-
description="Tab không thể tương tác do thuộc tính disabled."
|
|
92
|
-
codeString={`<TabsPreset
|
|
84
|
+
<ShowcaseExample title="Tab bị vô hiệu hóa (Disabled Tab)" description="Tab không thể tương tác do thuộc tính disabled." code={`<TabsPreset
|
|
93
85
|
defaultValue="general"
|
|
94
86
|
className="w-full"
|
|
95
87
|
items={[
|
|
@@ -110,38 +102,35 @@ function TabsMacroShowcase() {
|
|
|
110
102
|
content: <></>,
|
|
111
103
|
disabled: true },
|
|
112
104
|
]}
|
|
113
|
-
/>`}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
105
|
+
/>`} preview={
|
|
106
|
+
<>
|
|
107
|
+
<TabsPreset
|
|
108
|
+
defaultValue="general"
|
|
109
|
+
className="w-full"
|
|
110
|
+
items={[
|
|
111
|
+
{
|
|
112
|
+
value: "general",
|
|
113
|
+
title: "General",
|
|
114
|
+
content: (
|
|
115
|
+
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
116
|
+
<h4 className="font-medium">General</h4>
|
|
117
|
+
<p className="text-sm text-muted-foreground">
|
|
118
|
+
General settings.
|
|
119
|
+
</p>
|
|
120
|
+
</div>
|
|
121
|
+
) },
|
|
122
|
+
{
|
|
123
|
+
value: "advanced",
|
|
124
|
+
title: "Advanced (Pro)",
|
|
125
|
+
content: <></>,
|
|
126
|
+
disabled: true },
|
|
127
|
+
]}
|
|
128
|
+
/>
|
|
129
|
+
</>
|
|
130
|
+
} />
|
|
138
131
|
</ExampleGrid>
|
|
139
132
|
|
|
140
|
-
<
|
|
141
|
-
label="Dạng đường viền (Line Variant)"
|
|
142
|
-
description="Sử dụng prop variant='line' để hiển thị tabs kiểu gạch chân (phong cách thanh điều hướng)."
|
|
143
|
-
fullWidth
|
|
144
|
-
codeString={`<div className="max-w-lg">
|
|
133
|
+
<ShowcaseExample title="Dạng đường viền (Line Variant)" description="Sử dụng prop variant='line' để hiển thị tabs kiểu gạch chân (phong cách thanh điều hướng)." code={`<div className="max-w-lg">
|
|
145
134
|
<TabsPreset
|
|
146
135
|
defaultValue="overview"
|
|
147
136
|
variant="line"
|
|
@@ -184,58 +173,55 @@ function TabsMacroShowcase() {
|
|
|
184
173
|
) },
|
|
185
174
|
]}
|
|
186
175
|
/>
|
|
187
|
-
</div>`}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
176
|
+
</div>`} preview={
|
|
177
|
+
<>
|
|
178
|
+
<div className="max-w-lg">
|
|
179
|
+
<TabsPreset
|
|
180
|
+
defaultValue="overview"
|
|
181
|
+
variant="line"
|
|
182
|
+
listClassName="w-full justify-start border-b border-b-border rounded-none px-0"
|
|
183
|
+
className="w-full"
|
|
184
|
+
items={[
|
|
185
|
+
{
|
|
186
|
+
value: "overview",
|
|
187
|
+
title: "Overview",
|
|
188
|
+
content: (
|
|
189
|
+
<div className="pt-4">
|
|
190
|
+
<h4 className="font-medium">Overview</h4>
|
|
191
|
+
<p className="text-sm text-muted-foreground">
|
|
192
|
+
High-level project statistics and activity feed.
|
|
193
|
+
</p>
|
|
194
|
+
</div>
|
|
195
|
+
) },
|
|
196
|
+
{
|
|
197
|
+
value: "analytics",
|
|
198
|
+
title: "Analytics",
|
|
199
|
+
content: (
|
|
200
|
+
<div className="pt-4">
|
|
201
|
+
<h4 className="font-medium">Analytics</h4>
|
|
202
|
+
<p className="text-sm text-muted-foreground">
|
|
203
|
+
Charts and data visualizations.
|
|
204
|
+
</p>
|
|
205
|
+
</div>
|
|
206
|
+
) },
|
|
207
|
+
{
|
|
208
|
+
value: "reports",
|
|
209
|
+
title: "Reports",
|
|
210
|
+
content: (
|
|
211
|
+
<div className="pt-4">
|
|
212
|
+
<h4 className="font-medium">Reports</h4>
|
|
213
|
+
<p className="text-sm text-muted-foreground">
|
|
214
|
+
Generated reports and exports.
|
|
215
|
+
</p>
|
|
216
|
+
</div>
|
|
217
|
+
) },
|
|
218
|
+
]}
|
|
219
|
+
/>
|
|
216
220
|
</div>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
value: "reports",
|
|
220
|
-
title: "Reports",
|
|
221
|
-
content: (
|
|
222
|
-
<div className="pt-4">
|
|
223
|
-
<h4 className="font-medium">Reports</h4>
|
|
224
|
-
<p className="text-sm text-muted-foreground">
|
|
225
|
-
Generated reports and exports.
|
|
226
|
-
</p>
|
|
227
|
-
</div>
|
|
228
|
-
) },
|
|
229
|
-
]}
|
|
230
|
-
/>
|
|
231
|
-
</div>
|
|
232
|
-
</ExampleSection>
|
|
221
|
+
</>
|
|
222
|
+
} />
|
|
233
223
|
|
|
234
|
-
<
|
|
235
|
-
label="Nội dung phức tạp (Complex Content)"
|
|
236
|
-
description="Hiển thị các component phức tạp như form bên trong nội dung tab."
|
|
237
|
-
fullWidth
|
|
238
|
-
codeString={`<div className="max-w-lg">
|
|
224
|
+
<ShowcaseExample title="Nội dung phức tạp (Complex Content)" description="Hiển thị các component phức tạp như form bên trong nội dung tab." code={`<div className="max-w-lg">
|
|
239
225
|
<TabsPreset
|
|
240
226
|
defaultValue="login"
|
|
241
227
|
className="w-full"
|
|
@@ -273,59 +259,54 @@ function TabsMacroShowcase() {
|
|
|
273
259
|
) },
|
|
274
260
|
]}
|
|
275
261
|
/>
|
|
276
|
-
</div>`}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
262
|
+
</div>`} preview={
|
|
263
|
+
<>
|
|
264
|
+
<div className="max-w-lg">
|
|
265
|
+
<TabsPreset
|
|
266
|
+
defaultValue="login"
|
|
267
|
+
className="w-full"
|
|
268
|
+
items={[
|
|
269
|
+
{
|
|
270
|
+
value: "login",
|
|
271
|
+
title: "Login",
|
|
272
|
+
content: (
|
|
273
|
+
<div className="rounded-xl border border-border bg-card p-6 mt-2 flex flex-col gap-4">
|
|
274
|
+
<div className="text-lg font-semibold">Welcome Back</div>
|
|
275
|
+
<div className="h-10 w-full bg-muted rounded-md" />
|
|
276
|
+
<div className="h-10 w-full bg-muted rounded-md" />
|
|
277
|
+
<button className="bg-primary text-primary-foreground h-10 rounded-md text-sm font-medium">
|
|
278
|
+
Sign In
|
|
279
|
+
</button>
|
|
280
|
+
</div>
|
|
281
|
+
) },
|
|
282
|
+
{
|
|
283
|
+
value: "register",
|
|
284
|
+
title: "Register",
|
|
285
|
+
content: (
|
|
286
|
+
<div className="rounded-xl border border-border bg-card p-6 mt-2 flex flex-col gap-4">
|
|
287
|
+
<div className="text-lg font-semibold">Create Account</div>
|
|
288
|
+
<div className="h-10 w-full bg-muted rounded-md" />
|
|
289
|
+
<div className="h-10 w-full bg-muted rounded-md" />
|
|
290
|
+
<div className="h-10 w-full bg-muted rounded-md" />
|
|
291
|
+
<button className="bg-primary text-primary-foreground h-10 rounded-md text-sm font-medium">
|
|
292
|
+
Sign Up
|
|
293
|
+
</button>
|
|
294
|
+
</div>
|
|
295
|
+
) },
|
|
296
|
+
]}
|
|
297
|
+
/>
|
|
308
298
|
</div>
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
/>
|
|
312
|
-
</div>
|
|
313
|
-
</ExampleSection>
|
|
299
|
+
</>
|
|
300
|
+
} />
|
|
314
301
|
</div>
|
|
315
302
|
);
|
|
316
303
|
}
|
|
317
304
|
|
|
318
|
-
// ──────────────────────────────────────────────────────────
|
|
319
|
-
// SECTION 2: Micro Content
|
|
320
|
-
// ──────────────────────────────────────────────────────────
|
|
321
305
|
function TabsMicroShowcase() {
|
|
322
306
|
return (
|
|
323
|
-
<div className="space-y-10
|
|
307
|
+
<div className="space-y-10">
|
|
324
308
|
<ExampleGrid>
|
|
325
|
-
<
|
|
326
|
-
label="Cơ bản (Default)"
|
|
327
|
-
description="Tabs nguyên thuỷ lắp ráp thủ công."
|
|
328
|
-
codeString={`<Tabs defaultValue="account" className="w-full">
|
|
309
|
+
<ShowcaseExample title="Cơ bản (Default)" description="Tabs nguyên thuỷ lắp ráp thủ công." code={`<Tabs defaultValue="account" className="w-full">
|
|
329
310
|
<TabsList className="w-full">
|
|
330
311
|
<TabsTrigger value="account">Account</TabsTrigger>
|
|
331
312
|
<TabsTrigger value="password">Password</TabsTrigger>
|
|
@@ -346,36 +327,34 @@ function TabsMicroShowcase() {
|
|
|
346
327
|
</p>
|
|
347
328
|
</div>
|
|
348
329
|
</TabsContent>
|
|
349
|
-
</Tabs>`}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
330
|
+
</Tabs>`} preview={
|
|
331
|
+
<>
|
|
332
|
+
<Tabs defaultValue="account" className="w-full">
|
|
333
|
+
<TabsList className="w-full">
|
|
334
|
+
<TabsTrigger value="account">Account</TabsTrigger>
|
|
335
|
+
<TabsTrigger value="password">Password</TabsTrigger>
|
|
336
|
+
</TabsList>
|
|
337
|
+
<TabsContent value="account">
|
|
338
|
+
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
339
|
+
<h4 className="font-medium">Account</h4>
|
|
340
|
+
<p className="text-sm text-muted-foreground">
|
|
341
|
+
Make changes to your account here.
|
|
342
|
+
</p>
|
|
343
|
+
</div>
|
|
344
|
+
</TabsContent>
|
|
345
|
+
<TabsContent value="password">
|
|
346
|
+
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
347
|
+
<h4 className="font-medium">Password</h4>
|
|
348
|
+
<p className="text-sm text-muted-foreground">
|
|
349
|
+
Change your password here.
|
|
350
|
+
</p>
|
|
351
|
+
</div>
|
|
352
|
+
</TabsContent>
|
|
353
|
+
</Tabs>
|
|
354
|
+
</>
|
|
355
|
+
} />
|
|
374
356
|
|
|
375
|
-
<
|
|
376
|
-
label="Kèm Icon (With Icons)"
|
|
377
|
-
description="Thêm icon tuỳ chỉnh vào bên trong Tab Trigger."
|
|
378
|
-
codeString={`<Tabs defaultValue="profile" className="w-full">
|
|
357
|
+
<ShowcaseExample title="Kèm Icon (With Icons)" description="Thêm icon tuỳ chỉnh vào bên trong Tab Trigger." code={`<Tabs defaultValue="profile" className="w-full">
|
|
379
358
|
<TabsList className="w-full">
|
|
380
359
|
<TabsTrigger value="profile">
|
|
381
360
|
<UserIcon data-icon="inline-start" />
|
|
@@ -402,44 +381,41 @@ function TabsMicroShowcase() {
|
|
|
402
381
|
</p>
|
|
403
382
|
</div>
|
|
404
383
|
</TabsContent>
|
|
405
|
-
</Tabs>`}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
384
|
+
</Tabs>`} preview={
|
|
385
|
+
<>
|
|
386
|
+
<Tabs defaultValue="profile" className="w-full">
|
|
387
|
+
<TabsList className="w-full">
|
|
388
|
+
<TabsTrigger value="profile">
|
|
389
|
+
<UserIcon data-icon="inline-start" />
|
|
390
|
+
Profile
|
|
391
|
+
</TabsTrigger>
|
|
392
|
+
<TabsTrigger value="notifications">
|
|
393
|
+
<BellIcon data-icon="inline-start" />
|
|
394
|
+
Notifications
|
|
395
|
+
</TabsTrigger>
|
|
396
|
+
</TabsList>
|
|
397
|
+
<TabsContent value="profile">
|
|
398
|
+
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
399
|
+
<h4 className="font-medium">Profile</h4>
|
|
400
|
+
<p className="text-sm text-muted-foreground">
|
|
401
|
+
Update your name, avatar and bio.
|
|
402
|
+
</p>
|
|
403
|
+
</div>
|
|
404
|
+
</TabsContent>
|
|
405
|
+
<TabsContent value="notifications">
|
|
406
|
+
<div className="rounded-xl border border-border bg-card p-4 mt-2">
|
|
407
|
+
<h4 className="font-medium">Notifications</h4>
|
|
408
|
+
<p className="text-sm text-muted-foreground">
|
|
409
|
+
Choose what notifications you receive.
|
|
410
|
+
</p>
|
|
411
|
+
</div>
|
|
412
|
+
</TabsContent>
|
|
413
|
+
</Tabs>
|
|
414
|
+
</>
|
|
415
|
+
} />
|
|
436
416
|
</ExampleGrid>
|
|
437
417
|
|
|
438
|
-
<
|
|
439
|
-
label="Dạng đường viền (Line Variant)"
|
|
440
|
-
description="Tabs có kiểu gạch chân (không nền)."
|
|
441
|
-
fullWidth
|
|
442
|
-
codeString={`<Tabs defaultValue="music" className="w-full max-w-lg">
|
|
418
|
+
<ShowcaseExample title="Dạng đường viền (Line Variant)" description="Tabs có kiểu gạch chân (không nền)." code={`<Tabs defaultValue="music" className="w-full max-w-lg">
|
|
443
419
|
<TabsList
|
|
444
420
|
variant="line"
|
|
445
421
|
className="w-full justify-start border-b border-b-border rounded-none px-0"
|
|
@@ -472,49 +448,46 @@ function TabsMicroShowcase() {
|
|
|
472
448
|
</p>
|
|
473
449
|
</div>
|
|
474
450
|
</TabsContent>
|
|
475
|
-
</Tabs>`}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
451
|
+
</Tabs>`} preview={
|
|
452
|
+
<>
|
|
453
|
+
<Tabs defaultValue="music" className="w-full max-w-lg">
|
|
454
|
+
<TabsList
|
|
455
|
+
variant="line"
|
|
456
|
+
className="w-full justify-start border-b border-b-border rounded-none px-0"
|
|
457
|
+
>
|
|
458
|
+
<TabsTrigger value="music">Music</TabsTrigger>
|
|
459
|
+
<TabsTrigger value="podcasts">Podcasts</TabsTrigger>
|
|
460
|
+
<TabsTrigger value="live">Live</TabsTrigger>
|
|
461
|
+
</TabsList>
|
|
462
|
+
<TabsContent value="music">
|
|
463
|
+
<div className="pt-4">
|
|
464
|
+
<h4 className="font-medium">Music Library</h4>
|
|
465
|
+
<p className="text-sm text-muted-foreground">
|
|
466
|
+
Your top played songs and albums.
|
|
467
|
+
</p>
|
|
468
|
+
</div>
|
|
469
|
+
</TabsContent>
|
|
470
|
+
<TabsContent value="podcasts">
|
|
471
|
+
<div className="pt-4">
|
|
472
|
+
<h4 className="font-medium">Podcasts</h4>
|
|
473
|
+
<p className="text-sm text-muted-foreground">
|
|
474
|
+
Episodes from your subscriptions.
|
|
475
|
+
</p>
|
|
476
|
+
</div>
|
|
477
|
+
</TabsContent>
|
|
478
|
+
<TabsContent value="live">
|
|
479
|
+
<div className="pt-4">
|
|
480
|
+
<h4 className="font-medium">Live Radio</h4>
|
|
481
|
+
<p className="text-sm text-muted-foreground">
|
|
482
|
+
Tune in to live broadcasts.
|
|
483
|
+
</p>
|
|
484
|
+
</div>
|
|
485
|
+
</TabsContent>
|
|
486
|
+
</Tabs>
|
|
487
|
+
</>
|
|
488
|
+
} />
|
|
512
489
|
|
|
513
|
-
<
|
|
514
|
-
label="Xếp dọc (Vertical Orientation)"
|
|
515
|
-
description="Sắp xếp danh sách tab theo chiều dọc bên trái và nội dung bên phải."
|
|
516
|
-
fullWidth
|
|
517
|
-
codeString={`<Tabs
|
|
490
|
+
<ShowcaseExample title="Xếp dọc (Vertical Orientation)" description="Sắp xếp danh sách tab theo chiều dọc bên trái và nội dung bên phải." code={`<Tabs
|
|
518
491
|
defaultValue="profile"
|
|
519
492
|
orientation="vertical"
|
|
520
493
|
className="w-full max-w-xl"
|
|
@@ -558,92 +531,66 @@ function TabsMicroShowcase() {
|
|
|
558
531
|
</p>
|
|
559
532
|
</div>
|
|
560
533
|
</TabsContent>
|
|
561
|
-
</Tabs>`}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
534
|
+
</Tabs>`} preview={
|
|
535
|
+
<>
|
|
536
|
+
<Tabs
|
|
537
|
+
defaultValue="profile"
|
|
538
|
+
orientation="vertical"
|
|
539
|
+
className="w-full max-w-xl"
|
|
540
|
+
>
|
|
541
|
+
<TabsList className="w-40 shrink-0">
|
|
542
|
+
<TabsTrigger value="profile">
|
|
543
|
+
<UserIcon data-icon="inline-start" />
|
|
544
|
+
Profile
|
|
545
|
+
</TabsTrigger>
|
|
546
|
+
<TabsTrigger value="notifications">
|
|
547
|
+
<BellIcon data-icon="inline-start" />
|
|
548
|
+
Notifications
|
|
549
|
+
</TabsTrigger>
|
|
550
|
+
<TabsTrigger value="billing">
|
|
551
|
+
<CreditCardIcon data-icon="inline-start" />
|
|
552
|
+
Billing
|
|
553
|
+
</TabsTrigger>
|
|
554
|
+
</TabsList>
|
|
555
|
+
<TabsContent value="profile">
|
|
556
|
+
<div className="rounded-xl border border-border bg-card p-4">
|
|
557
|
+
<h4 className="font-medium">Profile</h4>
|
|
558
|
+
<p className="text-sm text-muted-foreground">
|
|
559
|
+
Update your personal information and manage your public profile.
|
|
560
|
+
</p>
|
|
561
|
+
</div>
|
|
562
|
+
</TabsContent>
|
|
563
|
+
<TabsContent value="notifications">
|
|
564
|
+
<div className="rounded-xl border border-border bg-card p-4">
|
|
565
|
+
<h4 className="font-medium">Notifications</h4>
|
|
566
|
+
<p className="text-sm text-muted-foreground">
|
|
567
|
+
Choose what notifications you receive and how.
|
|
568
|
+
</p>
|
|
569
|
+
</div>
|
|
570
|
+
</TabsContent>
|
|
571
|
+
<TabsContent value="billing">
|
|
572
|
+
<div className="rounded-xl border border-border bg-card p-4">
|
|
573
|
+
<h4 className="font-medium">Billing</h4>
|
|
574
|
+
<p className="text-sm text-muted-foreground">
|
|
575
|
+
Manage your subscription and payment methods.
|
|
576
|
+
</p>
|
|
577
|
+
</div>
|
|
578
|
+
</TabsContent>
|
|
579
|
+
</Tabs>
|
|
580
|
+
</>
|
|
581
|
+
} />
|
|
608
582
|
</div>
|
|
609
583
|
);
|
|
610
584
|
}
|
|
611
585
|
|
|
612
|
-
// ──────────────────────────────────────────────────────────
|
|
613
|
-
// SECTION 3: Entry point
|
|
614
|
-
// ──────────────────────────────────────────────────────────
|
|
615
586
|
export default function TabsShowcase() {
|
|
616
587
|
return (
|
|
617
588
|
<Showcase
|
|
618
589
|
title="Tabs"
|
|
619
590
|
description="Tập hợp các tab panel được hiển thị lần lượt, chuyển đổi khi click vào tab tương ứng."
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
<DocsH3>Khi nào nên dùng Macro</DocsH3>
|
|
624
|
-
<DocsP>
|
|
625
|
-
<DocsCode>TabsPreset</DocsCode> là một component đóng gói sẵn,
|
|
626
|
-
nhận vào mảng <DocsCode>items</DocsCode> chứa thông tin cấu hình
|
|
627
|
-
của các tabs (value, title, content, disabled, ...). Thích hợp cho
|
|
628
|
-
các tab đơn giản, render từ dữ liệu cấu hình có sẵn.
|
|
629
|
-
</DocsP>
|
|
630
|
-
</ShowcaseDocs>
|
|
631
|
-
<ShowcaseDocs>
|
|
632
|
-
<DocsH3>Khi nào nên dùng Micro</DocsH3>
|
|
633
|
-
<DocsP>
|
|
634
|
-
Dùng <DocsCode>Tabs</DocsCode> và các thành phần con (
|
|
635
|
-
<DocsCode>TabsList</DocsCode>, <DocsCode>TabsTrigger</DocsCode>,{" "}
|
|
636
|
-
<DocsCode>TabsContent</DocsCode>) khi bạn muốn tự kiểm soát cấu
|
|
637
|
-
trúc HTML, muốn đính kèm Icon vào Trigger, hoặc xây dựng các dạng
|
|
638
|
-
Tab không theo khuôn mẫu (ví dụ: đặt List dọc, List rời rạc).
|
|
639
|
-
</DocsP>
|
|
640
|
-
</ShowcaseDocs>
|
|
641
|
-
</div>
|
|
642
|
-
}
|
|
643
|
-
tabs={[
|
|
644
|
-
{ label: "Micro (Primitive)", content: <TabsMicroShowcase /> },
|
|
645
|
-
{ label: "Macro (Preset)", content: <TabsMacroShowcase /> },
|
|
646
|
-
]}
|
|
591
|
+
|
|
592
|
+
micro={{ content: <TabsMicroShowcase /> }}
|
|
593
|
+
macro={{ content: <TabsMacroShowcase /> }}
|
|
647
594
|
/>
|
|
648
595
|
);
|
|
649
596
|
}
|