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,112 +12,93 @@ 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
|
import { type Size } from "../../lib/types";
|
|
20
20
|
|
|
21
|
-
// ──────────────────────────────────────────────────────────
|
|
22
|
-
// SECTION 1: Macro Content
|
|
23
|
-
// ──────────────────────────────────────────────────────────
|
|
24
21
|
function ProgressMacroShowcase({ globalSize }: { globalSize: Size }) {
|
|
25
22
|
return (
|
|
26
|
-
<div className="space-y-10
|
|
23
|
+
<div className="space-y-10">
|
|
27
24
|
<ExampleGrid>
|
|
28
|
-
<
|
|
29
|
-
label="Tiêu chuẩn (Standard)"
|
|
30
|
-
description="Thanh tiến trình cơ bản nhất."
|
|
31
|
-
codeString={`<div className="w-full max-w-sm">
|
|
25
|
+
<ShowcaseExample title="Tiêu chuẩn (Standard)" description="Thanh tiến trình cơ bản nhất." code={`<div className="w-full max-w-sm">
|
|
32
26
|
<ProgressPreset value={60} />
|
|
33
|
-
</div>`}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
</div>`} preview={
|
|
28
|
+
<>
|
|
29
|
+
<div className="w-full max-w-sm">
|
|
30
|
+
<ProgressPreset size={globalSize} value={60} />
|
|
31
|
+
</div>
|
|
32
|
+
</>
|
|
33
|
+
} />
|
|
39
34
|
|
|
40
|
-
<
|
|
41
|
-
label="Vô định (Indeterminate)"
|
|
42
|
-
description="Khi không truyền giá trị, thanh sẽ chạy hoạt ảnh liên tục."
|
|
43
|
-
codeString={`<div className="w-full max-w-sm">
|
|
35
|
+
<ShowcaseExample title="Vô định (Indeterminate)" description="Khi không truyền giá trị, thanh sẽ chạy hoạt ảnh liên tục." code={`<div className="w-full max-w-sm">
|
|
44
36
|
<ProgressPreset />
|
|
45
|
-
</div>`}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
</div>`} preview={
|
|
38
|
+
<>
|
|
39
|
+
<div className="w-full max-w-sm">
|
|
40
|
+
<ProgressPreset size={globalSize} />
|
|
41
|
+
</div>
|
|
42
|
+
</>
|
|
43
|
+
} />
|
|
51
44
|
</ExampleGrid>
|
|
52
45
|
|
|
53
|
-
<
|
|
54
|
-
label="Kèm Nhãn & Giá trị (With Label & Value)"
|
|
55
|
-
description="Tự động căn lề nhãn và hiển thị phần trăm."
|
|
56
|
-
codeString={`<div className="w-full max-w-sm">
|
|
46
|
+
<ShowcaseExample title="Kèm Nhãn & Giá trị (With Label & Value)" description="Tự động căn lề nhãn và hiển thị phần trăm." code={`<div className="w-full max-w-sm">
|
|
57
47
|
<ProgressPreset
|
|
58
48
|
value={85}
|
|
59
49
|
label="Đang tải lên hệ thống..."
|
|
60
50
|
showValue
|
|
61
51
|
/>
|
|
62
|
-
</div>`}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
52
|
+
</div>`} preview={
|
|
53
|
+
<>
|
|
54
|
+
<div className="w-full max-w-sm">
|
|
55
|
+
<ProgressPreset
|
|
56
|
+
size={globalSize}
|
|
57
|
+
value={85}
|
|
58
|
+
label="Đang tải lên hệ thống..."
|
|
59
|
+
showValue
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</>
|
|
63
|
+
} />
|
|
73
64
|
</div>
|
|
74
65
|
);
|
|
75
66
|
}
|
|
76
67
|
|
|
77
|
-
// ──────────────────────────────────────────────────────────
|
|
78
|
-
// SECTION 2: Micro Content
|
|
79
|
-
// ──────────────────────────────────────────────────────────
|
|
80
68
|
function ProgressMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
81
69
|
return (
|
|
82
|
-
<div className="space-y-10
|
|
70
|
+
<div className="space-y-10">
|
|
83
71
|
<ExampleGrid>
|
|
84
|
-
<
|
|
85
|
-
label="Chỉ Thanh tiến trình (Core)"
|
|
86
|
-
description="Thanh tiến trình micro, lắp ráp thủ công (không có label)."
|
|
87
|
-
codeString={`<Progress value={60} className="w-full max-w-sm">
|
|
72
|
+
<ShowcaseExample title="Chỉ Thanh tiến trình (Core)" description="Thanh tiến trình micro, lắp ráp thủ công (không có label)." code={`<Progress value={60} className="w-full max-w-sm">
|
|
88
73
|
<ProgressTrack>
|
|
89
74
|
<ProgressIndicator />
|
|
90
75
|
</ProgressTrack>
|
|
91
|
-
</Progress>`}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
76
|
+
</Progress>`} preview={
|
|
77
|
+
<>
|
|
78
|
+
<Progress value={60} size={globalSize} className="w-full max-w-sm">
|
|
79
|
+
<ProgressTrack>
|
|
80
|
+
<ProgressIndicator />
|
|
81
|
+
</ProgressTrack>
|
|
82
|
+
</Progress>
|
|
83
|
+
</>
|
|
84
|
+
} />
|
|
99
85
|
|
|
100
|
-
<
|
|
101
|
-
label="Tuỳ chỉnh màu sắc (Custom Color)"
|
|
102
|
-
description="Can thiệp trực tiếp vào ProgressIndicator để đổi màu."
|
|
103
|
-
codeString={`<Progress value={45} className="w-full max-w-sm">
|
|
86
|
+
<ShowcaseExample title="Tuỳ chỉnh màu sắc (Custom Color)" description="Can thiệp trực tiếp vào ProgressIndicator để đổi màu." code={`<Progress value={45} className="w-full max-w-sm">
|
|
104
87
|
<ProgressTrack>
|
|
105
88
|
<ProgressIndicator className="bg-red-500" />
|
|
106
89
|
</ProgressTrack>
|
|
107
|
-
</Progress>`}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
90
|
+
</Progress>`} preview={
|
|
91
|
+
<>
|
|
92
|
+
<Progress value={45} size={globalSize} className="w-full max-w-sm">
|
|
93
|
+
<ProgressTrack>
|
|
94
|
+
<ProgressIndicator className="bg-red-500" />
|
|
95
|
+
</ProgressTrack>
|
|
96
|
+
</Progress>
|
|
97
|
+
</>
|
|
98
|
+
} />
|
|
115
99
|
</ExampleGrid>
|
|
116
100
|
|
|
117
|
-
<
|
|
118
|
-
label="Tự lắp ráp Nhãn (Compositional with Label)"
|
|
119
|
-
description="Sử dụng các bộ phận cấu thành để hiển thị nhãn và giá trị theo ý muốn."
|
|
120
|
-
codeString={`<Progress value={45} className="w-full max-w-sm">
|
|
101
|
+
<ShowcaseExample title="Tự lắp ráp Nhãn (Compositional with Label)" description="Sử dụng các bộ phận cấu thành để hiển thị nhãn và giá trị theo ý muốn." code={`<Progress value={45} className="w-full max-w-sm">
|
|
121
102
|
<div className="flex items-center justify-between mb-1.5">
|
|
122
103
|
<ProgressLabel className="font-medium text-muted-foreground">
|
|
123
104
|
Đang tải xuống...
|
|
@@ -127,26 +108,23 @@ function ProgressMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
127
108
|
<ProgressTrack>
|
|
128
109
|
<ProgressIndicator />
|
|
129
110
|
</ProgressTrack>
|
|
130
|
-
</Progress>`}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
111
|
+
</Progress>`} preview={
|
|
112
|
+
<>
|
|
113
|
+
<Progress value={45} size={globalSize} className="w-full max-w-sm">
|
|
114
|
+
<div className="flex items-center justify-between mb-1.5">
|
|
115
|
+
<ProgressLabel className="font-medium text-muted-foreground">
|
|
116
|
+
Đang tải xuống...
|
|
117
|
+
</ProgressLabel>
|
|
118
|
+
<ProgressValue className="font-mono" />
|
|
119
|
+
</div>
|
|
120
|
+
<ProgressTrack>
|
|
121
|
+
<ProgressIndicator />
|
|
122
|
+
</ProgressTrack>
|
|
123
|
+
</Progress>
|
|
124
|
+
</>
|
|
125
|
+
} />
|
|
144
126
|
|
|
145
|
-
<
|
|
146
|
-
label="🧭 Use Case Comparison"
|
|
147
|
-
description="So sánh nhanh khi nào dùng Micro và Macro."
|
|
148
|
-
fullWidth
|
|
149
|
-
codeString={`<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
127
|
+
<ShowcaseExample title="🧭 So sánh Use Case" description="So sánh nhanh khi nào dùng Micro và Macro." code={`<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
150
128
|
{/* Story 1: Macro wins */}
|
|
151
129
|
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
152
130
|
<div className="flex items-start gap-3">
|
|
@@ -214,114 +192,88 @@ function ProgressMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
214
192
|
màu của indicator.
|
|
215
193
|
</p>
|
|
216
194
|
</div>
|
|
217
|
-
</div>`}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
</div>
|
|
195
|
+
</div>`} preview={
|
|
196
|
+
<>
|
|
197
|
+
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
198
|
+
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
199
|
+
<div className="flex items-start gap-3">
|
|
200
|
+
<span className="mt-0.5 shrink-0 rounded-full bg-green-500/10 p-1.5 text-green-600">
|
|
201
|
+
<svg
|
|
202
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
203
|
+
className="size-4"
|
|
204
|
+
viewBox="0 0 24 24"
|
|
205
|
+
fill="none"
|
|
206
|
+
stroke="currentColor"
|
|
207
|
+
strokeWidth="2"
|
|
208
|
+
strokeLinecap="round"
|
|
209
|
+
strokeLinejoin="round"
|
|
210
|
+
aria-hidden="true"
|
|
211
|
+
>
|
|
212
|
+
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
|
|
213
|
+
</svg>
|
|
214
|
+
</span>
|
|
215
|
+
<div>
|
|
216
|
+
<p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
217
|
+
Story 1 · Dùng Macro
|
|
218
|
+
</p>
|
|
219
|
+
<h3 className="mt-0.5 text-sm font-semibold text-foreground">
|
|
220
|
+
Sử dụng đơn giản
|
|
221
|
+
</h3>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
225
|
+
Dùng Preset khi bạn muốn hiển thị nhanh thanh tiến trình có kèm
|
|
226
|
+
label và giá trị phần trăm theo layout mặc định.
|
|
227
|
+
</p>
|
|
228
|
+
</div>
|
|
252
229
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
230
|
+
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
231
|
+
<div className="flex items-start gap-3">
|
|
232
|
+
<span className="mt-0.5 shrink-0 rounded-full bg-blue-500/10 p-1.5 text-blue-600">
|
|
233
|
+
<svg
|
|
234
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
235
|
+
className="size-4"
|
|
236
|
+
viewBox="0 0 24 24"
|
|
237
|
+
fill="none"
|
|
238
|
+
stroke="currentColor"
|
|
239
|
+
strokeWidth="2"
|
|
240
|
+
strokeLinecap="round"
|
|
241
|
+
strokeLinejoin="round"
|
|
242
|
+
aria-hidden="true"
|
|
243
|
+
>
|
|
244
|
+
<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" />
|
|
245
|
+
</svg>
|
|
246
|
+
</span>
|
|
247
|
+
<div>
|
|
248
|
+
<p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
249
|
+
Story 2 · Dùng Micro
|
|
250
|
+
</p>
|
|
251
|
+
<h3 className="mt-0.5 text-sm font-semibold text-foreground">
|
|
252
|
+
Layout tuỳ chỉnh
|
|
253
|
+
</h3>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
257
|
+
Dùng Micro khi bạn muốn thay đổi cấu trúc hiển thị (ví dụ: đặt
|
|
258
|
+
label dưới thanh tiến trình) hoặc đổi màu của indicator.
|
|
259
|
+
</p>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</>
|
|
263
|
+
} />
|
|
287
264
|
</div>
|
|
288
265
|
);
|
|
289
266
|
}
|
|
290
267
|
|
|
291
|
-
// ──────────────────────────────────────────────────────────
|
|
292
|
-
// SECTION 3: Entry point
|
|
293
|
-
// ──────────────────────────────────────────────────────────
|
|
294
268
|
export default function ProgressShowcase() {
|
|
295
269
|
const { size: globalSize } = useDevContext();
|
|
296
270
|
return (
|
|
297
271
|
<Showcase
|
|
298
|
-
title="
|
|
272
|
+
title="Tiến trình"
|
|
299
273
|
description="Thanh chỉ báo cho biết tiến độ hoàn thành của một công việc hoặc nhiệm vụ kéo dài."
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
<DocsP>
|
|
304
|
-
<DocsCode>ProgressPreset</DocsCode> là một component đóng gói sẵn.
|
|
305
|
-
Nó tự động hiển thị nhãn (label) và phần trăm (value) lên trên thanh
|
|
306
|
-
tiến trình chỉ với các prop đơn giản, tiết kiệm thời gian code.
|
|
307
|
-
</DocsP>
|
|
308
|
-
<DocsH3>Khi nào nên dùng Micro</DocsH3>
|
|
309
|
-
<DocsP>
|
|
310
|
-
Dùng <DocsCode>Progress</DocsCode> nguyên thủy khi bạn muốn tự tùy
|
|
311
|
-
chỉnh hoàn toàn bố cục (ví dụ: đặt label ở bên dưới thanh thay vì
|
|
312
|
-
bên trên, đổi màu thanh indicator dựa trên giá trị, hoặc bỏ nhãn
|
|
313
|
-
hoàn toàn).
|
|
314
|
-
</DocsP>
|
|
315
|
-
</ShowcaseDocs>
|
|
316
|
-
}
|
|
317
|
-
tabs={[
|
|
318
|
-
{
|
|
319
|
-
label: "Micro (Primitive)",
|
|
320
|
-
content: <ProgressMicroShowcase globalSize={globalSize} /> },
|
|
321
|
-
{
|
|
322
|
-
label: "Macro (Preset)",
|
|
323
|
-
content: <ProgressMacroShowcase globalSize={globalSize} /> },
|
|
324
|
-
]}
|
|
274
|
+
|
|
275
|
+
micro={{ content: <ProgressMicroShowcase globalSize={globalSize} /> }}
|
|
276
|
+
macro={{ content: <ProgressMacroShowcase globalSize={globalSize} /> }}
|
|
325
277
|
/>
|
|
326
278
|
);
|
|
327
279
|
}
|