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
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
DocsCode,
|
|
7
7
|
DocsP,
|
|
8
8
|
ExampleGrid,
|
|
9
|
-
|
|
9
|
+
ShowcaseExample,
|
|
10
10
|
Showcase,
|
|
11
11
|
ShowcaseDocs
|
|
12
12
|
} from "../../dev/components/showcase";
|
|
@@ -18,7 +18,7 @@ export default function BadgeShowcase() {
|
|
|
18
18
|
<Showcase
|
|
19
19
|
title="Badge"
|
|
20
20
|
description="Hiển thị nhãn trạng thái, phân loại hoặc đếm số lượng."
|
|
21
|
-
|
|
21
|
+
guideline={
|
|
22
22
|
<ShowcaseDocs>
|
|
23
23
|
<DocsP>
|
|
24
24
|
Dùng để làm nổi bật trạng thái, nhãn phân loại hoặc số lượng. Thường
|
|
@@ -27,57 +27,36 @@ export default function BadgeShowcase() {
|
|
|
27
27
|
</DocsP>
|
|
28
28
|
</ShowcaseDocs>
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
label: "Micro (Primitive)",
|
|
33
|
-
content: <BadgeMicroShowcase globalSize={globalSize} /> },
|
|
34
|
-
]}
|
|
30
|
+
micro={{ content: <BadgeMicroShowcase globalSize={globalSize} /> }}
|
|
35
31
|
/>
|
|
36
32
|
);
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
function BadgeMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
40
36
|
return (
|
|
41
|
-
<div className="space-y-10
|
|
42
|
-
|
|
43
|
-
<ExampleSection
|
|
44
|
-
label="Variants"
|
|
45
|
-
description="Tất cả các kiểu hiển thị hiện có."
|
|
46
|
-
codeString={`<Badge variant="solid">Solid</Badge>
|
|
37
|
+
<div className="space-y-10">
|
|
38
|
+
<ShowcaseExample title="Variants" description="Tất cả các kiểu hiển thị hiện có." code={`<Badge variant="solid">Solid</Badge>
|
|
47
39
|
<Badge variant="soft">Soft</Badge>
|
|
48
|
-
<Badge variant="outline">Outline</Badge>`}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</ExampleSection>
|
|
40
|
+
<Badge variant="outline">Outline</Badge>`} preview={
|
|
41
|
+
<>
|
|
42
|
+
<Badge variant="solid">Solid</Badge><Badge variant="soft">Soft</Badge><Badge variant="outline">Outline</Badge>
|
|
43
|
+
</>
|
|
44
|
+
} />
|
|
54
45
|
|
|
55
|
-
{/* ── Colors ── */}
|
|
56
46
|
<ExampleGrid>
|
|
57
|
-
<
|
|
58
|
-
label="Solid Colors"
|
|
59
|
-
description="Các màu semantic áp dụng cho Badge dạng Solid."
|
|
60
|
-
codeString={`<Badge color="primary">Primary</Badge>
|
|
47
|
+
<ShowcaseExample title="Solid Colors" description="Các màu semantic áp dụng cho Badge dạng Solid." code={`<Badge color="primary">Primary</Badge>
|
|
61
48
|
<Badge color="secondary">Secondary</Badge>
|
|
62
49
|
<Badge color="destructive">Destructive</Badge>
|
|
63
50
|
<Badge color="warning">Warning</Badge>
|
|
64
51
|
<Badge color="success">Success</Badge>
|
|
65
52
|
<Badge color="info">Info</Badge>
|
|
66
|
-
<Badge color="muted">Muted</Badge>`}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<Badge color="warning">Warning</Badge>
|
|
72
|
-
<Badge color="success">Success</Badge>
|
|
73
|
-
<Badge color="info">Info</Badge>
|
|
74
|
-
<Badge color="muted">Muted</Badge>
|
|
75
|
-
</ExampleSection>
|
|
53
|
+
<Badge color="muted">Muted</Badge>`} preview={
|
|
54
|
+
<>
|
|
55
|
+
<Badge color="primary">Primary</Badge><Badge color="secondary">Secondary</Badge><Badge color="destructive">Destructive</Badge><Badge color="warning">Warning</Badge><Badge color="success">Success</Badge><Badge color="info">Info</Badge><Badge color="muted">Muted</Badge>
|
|
56
|
+
</>
|
|
57
|
+
} />
|
|
76
58
|
|
|
77
|
-
<
|
|
78
|
-
label="Soft Colors"
|
|
79
|
-
description="Các màu semantic áp dụng cho Badge dạng Soft."
|
|
80
|
-
codeString={`<Badge variant="soft" color="primary">
|
|
59
|
+
<ShowcaseExample title="Soft Colors" description="Các màu semantic áp dụng cho Badge dạng Soft." code={`<Badge variant="soft" color="primary">
|
|
81
60
|
Primary
|
|
82
61
|
</Badge>
|
|
83
62
|
<Badge variant="soft" color="secondary">
|
|
@@ -97,37 +76,28 @@ function BadgeMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
97
76
|
</Badge>
|
|
98
77
|
<Badge variant="soft" color="muted">
|
|
99
78
|
Muted
|
|
100
|
-
</Badge>`}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</Badge>
|
|
120
|
-
<Badge variant="soft" color="muted">
|
|
121
|
-
Muted
|
|
122
|
-
</Badge>
|
|
123
|
-
</ExampleSection>
|
|
79
|
+
</Badge>`} preview={
|
|
80
|
+
<>
|
|
81
|
+
<Badge variant="soft" color="primary">
|
|
82
|
+
Primary
|
|
83
|
+
</Badge><Badge variant="soft" color="secondary">
|
|
84
|
+
Secondary
|
|
85
|
+
</Badge><Badge variant="soft" color="destructive">
|
|
86
|
+
Destructive
|
|
87
|
+
</Badge><Badge variant="soft" color="warning">
|
|
88
|
+
Warning
|
|
89
|
+
</Badge><Badge variant="soft" color="success">
|
|
90
|
+
Success
|
|
91
|
+
</Badge><Badge variant="soft" color="info">
|
|
92
|
+
Info
|
|
93
|
+
</Badge><Badge variant="soft" color="muted">
|
|
94
|
+
Muted
|
|
95
|
+
</Badge>
|
|
96
|
+
</>
|
|
97
|
+
} />
|
|
124
98
|
</ExampleGrid>
|
|
125
99
|
|
|
126
|
-
|
|
127
|
-
<ExampleSection
|
|
128
|
-
label="With Icons"
|
|
129
|
-
description="Badge kèm icon để bổ sung ngữ cảnh."
|
|
130
|
-
codeString={`<Badge color="success">
|
|
100
|
+
<ShowcaseExample title="With Icons" description="Badge kèm icon để bổ sung ngữ cảnh." code={`<Badge color="success">
|
|
131
101
|
<CheckIcon className="size-3.5" />
|
|
132
102
|
Approved
|
|
133
103
|
</Badge>
|
|
@@ -145,32 +115,26 @@ function BadgeMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
145
115
|
<Badge color="info" variant="outline">
|
|
146
116
|
<InfoIcon className="size-3.5" />
|
|
147
117
|
Draft
|
|
148
|
-
</Badge>`}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
</Badge>
|
|
166
|
-
</ExampleSection>
|
|
118
|
+
</Badge>`} preview={
|
|
119
|
+
<>
|
|
120
|
+
<Badge color="success">
|
|
121
|
+
<CheckIcon className="size-3.5" />
|
|
122
|
+
Approved
|
|
123
|
+
</Badge><Badge color="destructive">
|
|
124
|
+
<XIcon className="size-3.5" />
|
|
125
|
+
Rejected
|
|
126
|
+
</Badge><Badge color="warning" variant="soft">
|
|
127
|
+
<AlertTriangleIcon className="size-3.5" />
|
|
128
|
+
Pending
|
|
129
|
+
</Badge><Badge color="info" variant="outline">
|
|
130
|
+
<InfoIcon className="size-3.5" />
|
|
131
|
+
Draft
|
|
132
|
+
</Badge>
|
|
133
|
+
</>
|
|
134
|
+
} />
|
|
167
135
|
|
|
168
|
-
{/* ── Real-world Use Cases ── */}
|
|
169
136
|
<ExampleGrid>
|
|
170
|
-
<
|
|
171
|
-
label="Status Indicators"
|
|
172
|
-
description="Dùng để hiển thị trạng thái."
|
|
173
|
-
codeString={`<Badge color="success" variant="soft">
|
|
137
|
+
<ShowcaseExample title="Status Indicators" description="Dùng để hiển thị trạng thái." code={`<Badge color="success" variant="soft">
|
|
174
138
|
Active
|
|
175
139
|
</Badge>
|
|
176
140
|
<Badge color="secondary" variant="soft">
|
|
@@ -181,25 +145,20 @@ function BadgeMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
181
145
|
</Badge>
|
|
182
146
|
<Badge color="muted" variant="outline">
|
|
183
147
|
Archived
|
|
184
|
-
</Badge>`}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</ExampleSection>
|
|
199
|
-
<ExampleSection
|
|
200
|
-
label="Tags & Categories"
|
|
201
|
-
description="Dùng để hiển thị danh mục."
|
|
202
|
-
codeString={`<Badge variant="outline" color="primary">
|
|
148
|
+
</Badge>`} preview={
|
|
149
|
+
<>
|
|
150
|
+
<Badge color="success" variant="soft">
|
|
151
|
+
Active
|
|
152
|
+
</Badge><Badge color="secondary" variant="soft">
|
|
153
|
+
Inactive
|
|
154
|
+
</Badge><Badge color="destructive" variant="soft">
|
|
155
|
+
Expired
|
|
156
|
+
</Badge><Badge color="muted" variant="outline">
|
|
157
|
+
Archived
|
|
158
|
+
</Badge>
|
|
159
|
+
</>
|
|
160
|
+
} />
|
|
161
|
+
<ShowcaseExample title="Tags & Categories" description="Dùng để hiển thị danh mục." code={`<Badge variant="outline" color="primary">
|
|
203
162
|
React
|
|
204
163
|
</Badge>
|
|
205
164
|
<Badge variant="outline" color="secondary">
|
|
@@ -210,28 +169,22 @@ function BadgeMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
210
169
|
</Badge>
|
|
211
170
|
<Badge variant="outline" color="warning">
|
|
212
171
|
Vite
|
|
213
|
-
</Badge>`}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
</Badge>
|
|
227
|
-
</ExampleSection>
|
|
172
|
+
</Badge>`} preview={
|
|
173
|
+
<>
|
|
174
|
+
<Badge variant="outline" color="primary">
|
|
175
|
+
React
|
|
176
|
+
</Badge><Badge variant="outline" color="secondary">
|
|
177
|
+
TypeScript
|
|
178
|
+
</Badge><Badge variant="outline" color="info">
|
|
179
|
+
Tailwind
|
|
180
|
+
</Badge><Badge variant="outline" color="warning">
|
|
181
|
+
Vite
|
|
182
|
+
</Badge>
|
|
183
|
+
</>
|
|
184
|
+
} />
|
|
228
185
|
</ExampleGrid>
|
|
229
186
|
|
|
230
|
-
|
|
231
|
-
<ExampleSection
|
|
232
|
-
label="As Link"
|
|
233
|
-
description="Badge render dưới dạng thẻ a nhờ prop render."
|
|
234
|
-
codeString={`<Badge render={<a href="#" />}>Clickable Badge</Badge>
|
|
187
|
+
<ShowcaseExample title="As Link" description="Badge render dưới dạng thẻ a nhờ prop render." code={`<Badge render={<a href="#" />}>Clickable Badge</Badge>
|
|
235
188
|
|
|
236
189
|
<Badge color="secondary" render={<a href="#" />}>
|
|
237
190
|
Secondary Link
|
|
@@ -239,16 +192,15 @@ function BadgeMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
239
192
|
|
|
240
193
|
<Badge variant="outline" render={<a href="#" />}>
|
|
241
194
|
Outline Link
|
|
242
|
-
</Badge>`}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
</ExampleSection>
|
|
195
|
+
</Badge>`} preview={
|
|
196
|
+
<>
|
|
197
|
+
<Badge render={<a href="#" />}>Clickable Badge</Badge><Badge color="secondary" render={<a href="#" />}>
|
|
198
|
+
Secondary Link
|
|
199
|
+
</Badge><Badge variant="outline" render={<a href="#" />}>
|
|
200
|
+
Outline Link
|
|
201
|
+
</Badge>
|
|
202
|
+
</>
|
|
203
|
+
} />
|
|
252
204
|
</div>
|
|
253
205
|
);
|
|
254
206
|
}
|
|
@@ -20,75 +20,61 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
DocsP,
|
|
22
22
|
ExampleGrid,
|
|
23
|
-
|
|
23
|
+
ShowcaseExample,
|
|
24
24
|
Showcase,
|
|
25
25
|
ShowcaseDocs
|
|
26
26
|
} from "../../dev/components/showcase";
|
|
27
27
|
|
|
28
|
-
// ──────────────────────────────────────────────────────────
|
|
29
|
-
// SECTION 1: Macro Content
|
|
30
|
-
// ──────────────────────────────────────────────────────────
|
|
31
28
|
function BreadcrumbMacroShowcase() {
|
|
32
29
|
return (
|
|
33
|
-
<div className="space-y-10
|
|
30
|
+
<div className="space-y-10">
|
|
34
31
|
<ExampleGrid>
|
|
35
|
-
<
|
|
36
|
-
label="Tiêu chuẩn (Standard)"
|
|
37
|
-
description="Mảng điều hướng cơ bản."
|
|
38
|
-
codeString={`<BreadcrumbPreset
|
|
32
|
+
<ShowcaseExample title="Tiêu chuẩn (Standard)" description="Mảng điều hướng cơ bản." code={`<BreadcrumbPreset
|
|
39
33
|
items={[
|
|
40
34
|
{ label: "Trang chủ", href: "/" },
|
|
41
35
|
{ label: "Thành phần", href: "/components" },
|
|
42
36
|
{ label: "Breadcrumb" },
|
|
43
37
|
]}
|
|
44
|
-
/>`}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
/>`} preview={
|
|
39
|
+
<>
|
|
40
|
+
<BreadcrumbPreset
|
|
41
|
+
items={[
|
|
42
|
+
{ label: "Trang chủ", href: "/" },
|
|
43
|
+
{ label: "Thành phần", href: "/components" },
|
|
44
|
+
{ label: "Breadcrumb" },
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
</>
|
|
48
|
+
} />
|
|
54
49
|
|
|
55
|
-
<
|
|
56
|
-
label="Nhiều cấp (Deep Navigation)"
|
|
57
|
-
description="Đường dẫn dài hơn điển hình cho các trang lồng nhau."
|
|
58
|
-
codeString={`<BreadcrumbPreset
|
|
50
|
+
<ShowcaseExample title="Nhiều cấp (Deep Navigation)" description="Đường dẫn dài hơn điển hình cho các trang lồng nhau." code={`<BreadcrumbPreset
|
|
59
51
|
items={[
|
|
60
52
|
{ label: "Dashboard", href: "/dashboard" },
|
|
61
53
|
{ label: "Cài đặt", href: "/settings" },
|
|
62
54
|
{ label: "Tài khoản", href: "/settings/account" },
|
|
63
55
|
{ label: "Hóa đơn" },
|
|
64
56
|
]}
|
|
65
|
-
/>`}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
57
|
+
/>`} preview={
|
|
58
|
+
<>
|
|
59
|
+
<BreadcrumbPreset
|
|
60
|
+
items={[
|
|
61
|
+
{ label: "Dashboard", href: "/dashboard" },
|
|
62
|
+
{ label: "Cài đặt", href: "/settings" },
|
|
63
|
+
{ label: "Tài khoản", href: "/settings/account" },
|
|
64
|
+
{ label: "Hóa đơn" },
|
|
65
|
+
]}
|
|
66
|
+
/>
|
|
67
|
+
</>
|
|
68
|
+
} />
|
|
76
69
|
</ExampleGrid>
|
|
77
70
|
</div>
|
|
78
71
|
);
|
|
79
72
|
}
|
|
80
73
|
|
|
81
|
-
// ──────────────────────────────────────────────────────────
|
|
82
|
-
// SECTION 2: Micro Content
|
|
83
|
-
// ──────────────────────────────────────────────────────────
|
|
84
74
|
function BreadcrumbMicroShowcase() {
|
|
85
75
|
return (
|
|
86
|
-
<div className="space-y-10
|
|
87
|
-
<
|
|
88
|
-
label="Cơ bản (Default)"
|
|
89
|
-
description="Lắp ráp thủ công các item với dấu phân cách chevron mặc định."
|
|
90
|
-
fullWidth
|
|
91
|
-
codeString={`<Breadcrumb className="w-full max-w-lg">
|
|
76
|
+
<div className="space-y-10">
|
|
77
|
+
<ShowcaseExample title="Cơ bản (Default)" description="Lắp ráp thủ công các item với dấu phân cách chevron mặc định." code={`<Breadcrumb className="w-full max-w-lg">
|
|
92
78
|
<BreadcrumbList>
|
|
93
79
|
<BreadcrumbItem>
|
|
94
80
|
<BreadcrumbLink href="/">Trang chủ</BreadcrumbLink>
|
|
@@ -104,30 +90,28 @@ function BreadcrumbMicroShowcase() {
|
|
|
104
90
|
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
105
91
|
</BreadcrumbItem>
|
|
106
92
|
</BreadcrumbList>
|
|
107
|
-
</Breadcrumb>`}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
93
|
+
</Breadcrumb>`} preview={
|
|
94
|
+
<>
|
|
95
|
+
<Breadcrumb className="w-full max-w-lg">
|
|
96
|
+
<BreadcrumbList>
|
|
97
|
+
<BreadcrumbItem>
|
|
98
|
+
<BreadcrumbLink href="/">Trang chủ</BreadcrumbLink>
|
|
99
|
+
</BreadcrumbItem>
|
|
100
|
+
<BreadcrumbSeparator />
|
|
101
|
+
<BreadcrumbItem>
|
|
102
|
+
<BreadcrumbLink href="/components">Thành phần</BreadcrumbLink>
|
|
103
|
+
</BreadcrumbItem>
|
|
104
|
+
<BreadcrumbSeparator />
|
|
105
|
+
<BreadcrumbItem>
|
|
106
|
+
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
107
|
+
</BreadcrumbItem>
|
|
108
|
+
</BreadcrumbList>
|
|
109
|
+
</Breadcrumb>
|
|
110
|
+
</>
|
|
111
|
+
} />
|
|
125
112
|
|
|
126
113
|
<ExampleGrid>
|
|
127
|
-
<
|
|
128
|
-
label="Đổi dấu phân cách (Custom Separator)"
|
|
129
|
-
description="Truyền icon bất kỳ (VD: SlashIcon) vào bên trong BreadcrumbSeparator."
|
|
130
|
-
codeString={`<Breadcrumb className="w-full max-w-lg">
|
|
114
|
+
<ShowcaseExample title="Đổi dấu phân cách (Custom Separator)" description="Truyền icon bất kỳ (VD: SlashIcon) vào bên trong BreadcrumbSeparator." code={`<Breadcrumb className="w-full max-w-lg">
|
|
131
115
|
<BreadcrumbList>
|
|
132
116
|
<BreadcrumbItem>
|
|
133
117
|
<BreadcrumbLink href="/">Trang chủ</BreadcrumbLink>
|
|
@@ -147,33 +131,31 @@ function BreadcrumbMicroShowcase() {
|
|
|
147
131
|
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
148
132
|
</BreadcrumbItem>
|
|
149
133
|
</BreadcrumbList>
|
|
150
|
-
</Breadcrumb>`}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
134
|
+
</Breadcrumb>`} preview={
|
|
135
|
+
<>
|
|
136
|
+
<Breadcrumb className="w-full max-w-lg">
|
|
137
|
+
<BreadcrumbList>
|
|
138
|
+
<BreadcrumbItem>
|
|
139
|
+
<BreadcrumbLink href="/">Trang chủ</BreadcrumbLink>
|
|
140
|
+
</BreadcrumbItem>
|
|
141
|
+
<BreadcrumbSeparator>
|
|
142
|
+
<SlashIcon className="size-3.5" />
|
|
143
|
+
</BreadcrumbSeparator>
|
|
144
|
+
<BreadcrumbItem>
|
|
145
|
+
<BreadcrumbLink href="/components">Thành phần</BreadcrumbLink>
|
|
146
|
+
</BreadcrumbItem>
|
|
147
|
+
<BreadcrumbSeparator>
|
|
148
|
+
<SlashIcon className="size-3.5" />
|
|
149
|
+
</BreadcrumbSeparator>
|
|
150
|
+
<BreadcrumbItem>
|
|
151
|
+
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
152
|
+
</BreadcrumbItem>
|
|
153
|
+
</BreadcrumbList>
|
|
154
|
+
</Breadcrumb>
|
|
155
|
+
</>
|
|
156
|
+
} />
|
|
172
157
|
|
|
173
|
-
<
|
|
174
|
-
label="Dấu ba chấm (With Ellipsis)"
|
|
175
|
-
description="Sử dụng BreadcrumbEllipsis cùng DropdownMenu để giấu các đường dẫn trung gian."
|
|
176
|
-
codeString={`<Breadcrumb className="w-full max-w-lg">
|
|
158
|
+
<ShowcaseExample title="Dấu ba chấm (With Ellipsis)" description="Sử dụng BreadcrumbEllipsis cùng DropdownMenu để giấu các đường dẫn trung gian." code={`<Breadcrumb className="w-full max-w-lg">
|
|
177
159
|
<BreadcrumbList>
|
|
178
160
|
<BreadcrumbItem>
|
|
179
161
|
<BreadcrumbLink href="/">Trang chủ</BreadcrumbLink>
|
|
@@ -205,56 +187,54 @@ function BreadcrumbMicroShowcase() {
|
|
|
205
187
|
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
206
188
|
</BreadcrumbItem>
|
|
207
189
|
</BreadcrumbList>
|
|
208
|
-
</Breadcrumb>`}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
190
|
+
</Breadcrumb>`} preview={
|
|
191
|
+
<>
|
|
192
|
+
<Breadcrumb className="w-full max-w-lg">
|
|
193
|
+
<BreadcrumbList>
|
|
194
|
+
<BreadcrumbItem>
|
|
195
|
+
<BreadcrumbLink href="/">Trang chủ</BreadcrumbLink>
|
|
196
|
+
</BreadcrumbItem>
|
|
197
|
+
<BreadcrumbSeparator />
|
|
198
|
+
<BreadcrumbItem>
|
|
199
|
+
<DropdownMenu>
|
|
200
|
+
<DropdownMenuTrigger className="flex items-center gap-1 hover:text-foreground">
|
|
201
|
+
<BreadcrumbEllipsis className="h-4 w-4" />
|
|
202
|
+
<span className="sr-only">Toggle menu</span>
|
|
203
|
+
</DropdownMenuTrigger>
|
|
204
|
+
|
|
205
|
+
<DropdownMenuContent align="start">
|
|
206
|
+
<DropdownMenuItem>Tài liệu</DropdownMenuItem>
|
|
207
|
+
<DropdownMenuItem>Giao diện</DropdownMenuItem>
|
|
208
|
+
<DropdownMenuItem>GitHub</DropdownMenuItem>
|
|
209
|
+
</DropdownMenuContent>
|
|
210
|
+
|
|
211
|
+
</DropdownMenu>
|
|
212
|
+
</BreadcrumbItem>
|
|
213
|
+
<BreadcrumbSeparator />
|
|
214
|
+
<BreadcrumbItem>
|
|
215
|
+
<BreadcrumbLink href="/docs/components">
|
|
216
|
+
Thành phần
|
|
217
|
+
</BreadcrumbLink>
|
|
218
|
+
</BreadcrumbItem>
|
|
219
|
+
<BreadcrumbSeparator />
|
|
220
|
+
<BreadcrumbItem>
|
|
221
|
+
<BreadcrumbPage>Breadcrumb</BreadcrumbPage>
|
|
222
|
+
</BreadcrumbItem>
|
|
223
|
+
</BreadcrumbList>
|
|
224
|
+
</Breadcrumb>
|
|
225
|
+
</>
|
|
226
|
+
} />
|
|
244
227
|
</ExampleGrid>
|
|
245
228
|
</div>
|
|
246
229
|
);
|
|
247
230
|
}
|
|
248
231
|
|
|
249
|
-
// ──────────────────────────────────────────────────────────
|
|
250
|
-
// SECTION 3: Entry point
|
|
251
|
-
// ──────────────────────────────────────────────────────────
|
|
252
232
|
export default function BreadcrumbShowcase() {
|
|
253
233
|
return (
|
|
254
234
|
<Showcase
|
|
255
235
|
title="Breadcrumb"
|
|
256
236
|
description="Hiển thị đường dẫn điều hướng, giúp người dùng biết vị trí hiện tại trong hệ thống."
|
|
257
|
-
|
|
237
|
+
guideline={
|
|
258
238
|
<ShowcaseDocs>
|
|
259
239
|
<DocsP>
|
|
260
240
|
Dùng để hiển thị đường dẫn điều hướng, giúp người dùng nhận biết vị
|
|
@@ -263,10 +243,8 @@ export default function BreadcrumbShowcase() {
|
|
|
263
243
|
</DocsP>
|
|
264
244
|
</ShowcaseDocs>
|
|
265
245
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
{ label: "Macro (Preset)", content: <BreadcrumbMacroShowcase /> },
|
|
269
|
-
]}
|
|
246
|
+
micro={{ content: <BreadcrumbMicroShowcase /> }}
|
|
247
|
+
macro={{ content: <BreadcrumbMacroShowcase /> }}
|
|
270
248
|
/>
|
|
271
249
|
);
|
|
272
250
|
}
|