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
|
@@ -22,22 +22,16 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
DocsP,
|
|
24
24
|
ExampleGrid,
|
|
25
|
-
|
|
25
|
+
ShowcaseExample,
|
|
26
26
|
Showcase,
|
|
27
27
|
ShowcaseDocs
|
|
28
28
|
} from "../../dev/components/showcase";
|
|
29
29
|
|
|
30
|
-
// ──────────────────────────────────────────────────────────
|
|
31
|
-
// SECTION 1: Macro Content
|
|
32
|
-
// ──────────────────────────────────────────────────────────
|
|
33
30
|
function EmptyMacroShowcase() {
|
|
34
31
|
return (
|
|
35
|
-
<div className="space-y-10
|
|
32
|
+
<div className="space-y-10">
|
|
36
33
|
<ExampleGrid>
|
|
37
|
-
<
|
|
38
|
-
label="Tiêu chuẩn (Standard)"
|
|
39
|
-
description="Đầy đủ icon, title, description, action button."
|
|
40
|
-
codeString={`<EmptyPreset
|
|
34
|
+
<ShowcaseExample title="Tiêu chuẩn (Standard)" description="Đầy đủ icon, title, description, action button." code={`<EmptyPreset
|
|
41
35
|
icon={
|
|
42
36
|
<FolderOpenIcon className="size-4 text-muted-foreground" />
|
|
43
37
|
}
|
|
@@ -45,78 +39,69 @@ function EmptyMacroShowcase() {
|
|
|
45
39
|
description="Create your first project to get started."
|
|
46
40
|
action={<Button>New Project</Button>}
|
|
47
41
|
className="w-full min-h-[280px]"
|
|
48
|
-
/>`}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
/>`} preview={
|
|
43
|
+
<>
|
|
44
|
+
<EmptyPreset
|
|
45
|
+
icon={<FolderOpenIcon className="size-4 text-muted-foreground" />}
|
|
46
|
+
title="No projects yet"
|
|
47
|
+
description="Create your first project to get started."
|
|
48
|
+
action={<Button>New Project</Button>}
|
|
49
|
+
className="w-full min-h-[280px]"
|
|
50
|
+
/>
|
|
51
|
+
</>
|
|
52
|
+
} />
|
|
58
53
|
|
|
59
|
-
<
|
|
60
|
-
label="Không có Icon (Without Icon)"
|
|
61
|
-
description="Bỏ prop icon — phù hợp khi không cần hình ảnh minh họa."
|
|
62
|
-
codeString={`<EmptyPreset
|
|
54
|
+
<ShowcaseExample title="Không có Icon (Without Icon)" description="Bỏ prop icon — phù hợp khi không cần hình ảnh minh họa." code={`<EmptyPreset
|
|
63
55
|
title="No notifications"
|
|
64
56
|
description="You're all caught up. Check back later."
|
|
65
57
|
action={<Button variant="outline">Refresh</Button>}
|
|
66
58
|
className="w-full min-h-[280px]"
|
|
67
|
-
/>`}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
/>`} preview={
|
|
60
|
+
<>
|
|
61
|
+
<EmptyPreset
|
|
62
|
+
title="No notifications"
|
|
63
|
+
description="You're all caught up. Check back later."
|
|
64
|
+
action={<Button variant="outline">Refresh</Button>}
|
|
65
|
+
className="w-full min-h-[280px]"
|
|
66
|
+
/>
|
|
67
|
+
</>
|
|
68
|
+
} />
|
|
76
69
|
</ExampleGrid>
|
|
77
70
|
|
|
78
71
|
<ExampleGrid>
|
|
79
|
-
<
|
|
80
|
-
label="Không có Nút (Without Action)"
|
|
81
|
-
description="Chỉ hiển thị trạng thái, không yêu cầu hành động."
|
|
82
|
-
codeString={`<EmptyPreset
|
|
72
|
+
<ShowcaseExample title="Không có Nút (Without Action)" description="Chỉ hiển thị trạng thái, không yêu cầu hành động." code={`<EmptyPreset
|
|
83
73
|
icon={
|
|
84
74
|
<InboxIcon className="size-4 text-muted-foreground" />
|
|
85
75
|
}
|
|
86
76
|
title="No messages"
|
|
87
77
|
description="Messages from your team will appear here."
|
|
88
78
|
className="w-full min-h-[240px]"
|
|
89
|
-
/>`}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
/>`} preview={
|
|
80
|
+
<>
|
|
81
|
+
<EmptyPreset
|
|
82
|
+
icon={<InboxIcon className="size-4 text-muted-foreground" />}
|
|
83
|
+
title="No messages"
|
|
84
|
+
description="Messages from your team will appear here."
|
|
85
|
+
className="w-full min-h-[240px]"
|
|
86
|
+
/>
|
|
87
|
+
</>
|
|
88
|
+
} />
|
|
98
89
|
|
|
99
|
-
<
|
|
100
|
-
label="Tối giản (Minimal)"
|
|
101
|
-
description="Chỉ có tiêu đề."
|
|
102
|
-
codeString={`<EmptyPreset
|
|
90
|
+
<ShowcaseExample title="Tối giản (Minimal)" description="Chỉ có tiêu đề." code={`<EmptyPreset
|
|
103
91
|
title="Nothing here yet"
|
|
104
92
|
className="w-full min-h-[240px]"
|
|
105
|
-
/>`}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
/>`} preview={
|
|
94
|
+
<>
|
|
95
|
+
<EmptyPreset
|
|
96
|
+
title="Nothing here yet"
|
|
97
|
+
className="w-full min-h-[240px]"
|
|
98
|
+
/>
|
|
99
|
+
</>
|
|
100
|
+
} />
|
|
112
101
|
</ExampleGrid>
|
|
113
102
|
|
|
114
103
|
<ExampleGrid>
|
|
115
|
-
<
|
|
116
|
-
label="Kết quả tìm kiếm trống"
|
|
117
|
-
description="Pattern phổ biến khi tìm kiếm không ra kết quả."
|
|
118
|
-
fullWidth
|
|
119
|
-
codeString={`<EmptyPreset
|
|
104
|
+
<ShowcaseExample title="Kết quả tìm kiếm trống" description="Pattern phổ biến khi tìm kiếm không ra kết quả." code={`<EmptyPreset
|
|
120
105
|
icon={
|
|
121
106
|
<SearchIcon className="size-4 text-muted-foreground" />
|
|
122
107
|
}
|
|
@@ -129,29 +114,26 @@ function EmptyMacroShowcase() {
|
|
|
129
114
|
</div>
|
|
130
115
|
}
|
|
131
116
|
className="w-full min-h-[240px]"
|
|
132
|
-
/>`}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
117
|
+
/>`} preview={
|
|
118
|
+
<>
|
|
119
|
+
<div className="w-full max-w-md">
|
|
120
|
+
<EmptyPreset
|
|
121
|
+
icon={<SearchIcon className="size-4 text-muted-foreground" />}
|
|
122
|
+
title={`No results for "invoice"`}
|
|
123
|
+
description="Try a different search term or clear all active filters."
|
|
124
|
+
action={
|
|
125
|
+
<div className="flex gap-2">
|
|
126
|
+
<Button variant="outline">Clear filters</Button>
|
|
127
|
+
<Button>Browse all</Button>
|
|
128
|
+
</div>
|
|
129
|
+
}
|
|
130
|
+
className="w-full min-h-[240px]"
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
</>
|
|
134
|
+
} />
|
|
149
135
|
|
|
150
|
-
<
|
|
151
|
-
label="Danh sách tài liệu (Document State)"
|
|
152
|
-
description="Description chứa liên kết HTML."
|
|
153
|
-
fullWidth
|
|
154
|
-
codeString={`<EmptyPreset
|
|
136
|
+
<ShowcaseExample title="Danh sách tài liệu (Document State)" description="Description chứa liên kết HTML." code={`<EmptyPreset
|
|
155
137
|
icon={
|
|
156
138
|
<FileTextIcon className="size-4 text-muted-foreground" />
|
|
157
139
|
}
|
|
@@ -164,39 +146,34 @@ function EmptyMacroShowcase() {
|
|
|
164
146
|
}
|
|
165
147
|
action={<Button>Upload Document</Button>}
|
|
166
148
|
className="w-full min-h-[240px]"
|
|
167
|
-
/>`}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
149
|
+
/>`} preview={
|
|
150
|
+
<>
|
|
151
|
+
<div className="w-full max-w-md">
|
|
152
|
+
<EmptyPreset
|
|
153
|
+
icon={<FileTextIcon className="size-4 text-muted-foreground" />}
|
|
154
|
+
title="No documents"
|
|
155
|
+
description={
|
|
156
|
+
<>
|
|
157
|
+
Upload or create your first document.{" "}
|
|
158
|
+
<a href="#">Learn more</a>.
|
|
159
|
+
</>
|
|
160
|
+
}
|
|
161
|
+
action={<Button>Upload Document</Button>}
|
|
162
|
+
className="w-full min-h-[240px]"
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
</>
|
|
166
|
+
} />
|
|
184
167
|
</ExampleGrid>
|
|
185
168
|
</div>
|
|
186
169
|
);
|
|
187
170
|
}
|
|
188
171
|
|
|
189
|
-
// ──────────────────────────────────────────────────────────
|
|
190
|
-
// SECTION 2: Micro Content
|
|
191
|
-
// ──────────────────────────────────────────────────────────
|
|
192
172
|
function EmptyMicroShowcase() {
|
|
193
173
|
return (
|
|
194
|
-
<div className="space-y-10
|
|
174
|
+
<div className="space-y-10">
|
|
195
175
|
<ExampleGrid>
|
|
196
|
-
<
|
|
197
|
-
label="Cơ bản (Default)"
|
|
198
|
-
description="Trạng thái trống cơ bản với cấu trúc thủ công."
|
|
199
|
-
codeString={`<Empty className="w-full min-h-[280px]">
|
|
176
|
+
<ShowcaseExample title="Cơ bản (Default)" description="Trạng thái trống cơ bản với cấu trúc thủ công." code={`<Empty className="w-full min-h-[280px]">
|
|
200
177
|
<EmptyHeader>
|
|
201
178
|
<EmptyTitle>No customers found</EmptyTitle>
|
|
202
179
|
<EmptyDescription>
|
|
@@ -211,30 +188,28 @@ function EmptyMicroShowcase() {
|
|
|
211
188
|
</Button>
|
|
212
189
|
</EmptyAction>
|
|
213
190
|
</EmptyContent>
|
|
214
|
-
</Empty>`}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
191
|
+
</Empty>`} preview={
|
|
192
|
+
<>
|
|
193
|
+
<Empty className="w-full min-h-[280px]">
|
|
194
|
+
<EmptyHeader>
|
|
195
|
+
<EmptyTitle>No customers found</EmptyTitle>
|
|
196
|
+
<EmptyDescription>
|
|
197
|
+
Get started by adding your first customer.
|
|
198
|
+
</EmptyDescription>
|
|
199
|
+
</EmptyHeader>
|
|
200
|
+
<EmptyContent>
|
|
201
|
+
<EmptyAction>
|
|
202
|
+
<Button>
|
|
203
|
+
<PlusIcon className="mr-2" />
|
|
204
|
+
Add Customer
|
|
205
|
+
</Button>
|
|
206
|
+
</EmptyAction>
|
|
207
|
+
</EmptyContent>
|
|
208
|
+
</Empty>
|
|
209
|
+
</>
|
|
210
|
+
} />
|
|
233
211
|
|
|
234
|
-
<
|
|
235
|
-
label="Kèm Icon nền màu (Icon Variant)"
|
|
236
|
-
description="Dùng EmptyMedia variant='icon' để hiển thị background mờ cho Icon."
|
|
237
|
-
codeString={`<Empty className="w-full min-h-[280px]">
|
|
212
|
+
<ShowcaseExample title="Kèm Icon nền màu (Icon Variant)" description="Dùng EmptyMedia variant='icon' để hiển thị background mờ cho Icon." code={`<Empty className="w-full min-h-[280px]">
|
|
238
213
|
<EmptyHeader>
|
|
239
214
|
<EmptyMedia variant="icon">
|
|
240
215
|
<FolderOpenIcon className="size-4 text-muted-foreground" />
|
|
@@ -252,57 +227,53 @@ function EmptyMicroShowcase() {
|
|
|
252
227
|
</Button>
|
|
253
228
|
</EmptyAction>
|
|
254
229
|
</EmptyContent>
|
|
255
|
-
</Empty>`}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
230
|
+
</Empty>`} preview={
|
|
231
|
+
<>
|
|
232
|
+
<Empty className="w-full min-h-[280px]">
|
|
233
|
+
<EmptyHeader>
|
|
234
|
+
<EmptyMedia variant="icon">
|
|
235
|
+
<FolderOpenIcon className="size-4 text-muted-foreground" />
|
|
236
|
+
</EmptyMedia>
|
|
237
|
+
<EmptyTitle>No projects</EmptyTitle>
|
|
238
|
+
<EmptyDescription>
|
|
239
|
+
You don't have any active projects.
|
|
240
|
+
</EmptyDescription>
|
|
241
|
+
</EmptyHeader>
|
|
242
|
+
<EmptyContent>
|
|
243
|
+
<EmptyAction>
|
|
244
|
+
<Button>
|
|
245
|
+
<PlusIcon className="mr-2" />
|
|
246
|
+
New Project
|
|
247
|
+
</Button>
|
|
248
|
+
</EmptyAction>
|
|
249
|
+
</EmptyContent>
|
|
250
|
+
</Empty>
|
|
251
|
+
</>
|
|
252
|
+
} />
|
|
277
253
|
</ExampleGrid>
|
|
278
254
|
|
|
279
255
|
<ExampleGrid>
|
|
280
|
-
<
|
|
281
|
-
label="Chỉ văn bản (Text Only)"
|
|
282
|
-
description="Không icon, không action."
|
|
283
|
-
codeString={`<Empty className="w-full min-h-[200px]">
|
|
256
|
+
<ShowcaseExample title="Chỉ văn bản (Text Only)" description="Không icon, không action." code={`<Empty className="w-full min-h-[200px]">
|
|
284
257
|
<EmptyHeader>
|
|
285
258
|
<EmptyTitle>No results</EmptyTitle>
|
|
286
259
|
<EmptyDescription>
|
|
287
260
|
Try adjusting your filters or search terms.
|
|
288
261
|
</EmptyDescription>
|
|
289
262
|
</EmptyHeader>
|
|
290
|
-
</Empty>`}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
263
|
+
</Empty>`} preview={
|
|
264
|
+
<>
|
|
265
|
+
<Empty className="w-full min-h-[200px]">
|
|
266
|
+
<EmptyHeader>
|
|
267
|
+
<EmptyTitle>No results</EmptyTitle>
|
|
268
|
+
<EmptyDescription>
|
|
269
|
+
Try adjusting your filters or search terms.
|
|
270
|
+
</EmptyDescription>
|
|
271
|
+
</EmptyHeader>
|
|
272
|
+
</Empty>
|
|
273
|
+
</>
|
|
274
|
+
} />
|
|
301
275
|
|
|
302
|
-
<
|
|
303
|
-
label="Link bên trong mô tả (Link in Description)"
|
|
304
|
-
description="EmptyDescription tự động style thẻ <a> bên trong."
|
|
305
|
-
codeString={`<Empty className="w-full min-h-[200px]">
|
|
276
|
+
<ShowcaseExample title="Link bên trong mô tả (Link in Description)" description="EmptyDescription tự động style thẻ <a> bên trong." code={`<Empty className="w-full min-h-[200px]">
|
|
306
277
|
<EmptyHeader>
|
|
307
278
|
<EmptyMedia variant="icon">
|
|
308
279
|
<InboxIcon className="size-4 text-muted-foreground" />
|
|
@@ -313,28 +284,25 @@ function EmptyMicroShowcase() {
|
|
|
313
284
|
in our <a href="#">documentation</a>.
|
|
314
285
|
</EmptyDescription>
|
|
315
286
|
</EmptyHeader>
|
|
316
|
-
</Empty>`}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
287
|
+
</Empty>`} preview={
|
|
288
|
+
<>
|
|
289
|
+
<Empty className="w-full min-h-[200px]">
|
|
290
|
+
<EmptyHeader>
|
|
291
|
+
<EmptyMedia variant="icon">
|
|
292
|
+
<InboxIcon className="size-4 text-muted-foreground" />
|
|
293
|
+
</EmptyMedia>
|
|
294
|
+
<EmptyTitle>No messages yet</EmptyTitle>
|
|
295
|
+
<EmptyDescription>
|
|
296
|
+
Messages from your team will appear here. Learn more in our{" "}
|
|
297
|
+
<a href="#">documentation</a>.
|
|
298
|
+
</EmptyDescription>
|
|
299
|
+
</EmptyHeader>
|
|
300
|
+
</Empty>
|
|
301
|
+
</>
|
|
302
|
+
} />
|
|
331
303
|
</ExampleGrid>
|
|
332
304
|
|
|
333
|
-
<
|
|
334
|
-
label="Cấu trúc tùy chỉnh nâng cao"
|
|
335
|
-
description="Nút xóa bộ lọc nằm tách biệt khỏi hành động chính."
|
|
336
|
-
fullWidth
|
|
337
|
-
codeString={`<div className="w-full max-w-md">
|
|
305
|
+
<ShowcaseExample title="Cấu trúc tùy chỉnh nâng cao" description="Nút xóa bộ lọc nằm tách biệt khỏi hành động chính." code={`<div className="w-full max-w-md">
|
|
338
306
|
<Empty className="w-full min-h-[240px]">
|
|
339
307
|
<EmptyHeader>
|
|
340
308
|
<EmptyMedia variant="icon">
|
|
@@ -353,34 +321,30 @@ function EmptyMicroShowcase() {
|
|
|
353
321
|
</EmptyAction>
|
|
354
322
|
</EmptyContent>
|
|
355
323
|
</Empty>
|
|
356
|
-
</div>`}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
324
|
+
</div>`} preview={
|
|
325
|
+
<>
|
|
326
|
+
<div className="w-full max-w-md">
|
|
327
|
+
<Empty className="w-full min-h-[240px]">
|
|
328
|
+
<EmptyHeader>
|
|
329
|
+
<EmptyMedia variant="icon">
|
|
330
|
+
<SearchIcon className="size-4 text-muted-foreground" />
|
|
331
|
+
</EmptyMedia>
|
|
332
|
+
<EmptyTitle>No results for "invoice"</EmptyTitle>
|
|
333
|
+
<EmptyDescription>
|
|
334
|
+
Try a different search term or clear all filters.
|
|
335
|
+
</EmptyDescription>
|
|
336
|
+
</EmptyHeader>
|
|
337
|
+
<EmptyContent>
|
|
338
|
+
<EmptyAction>
|
|
339
|
+
<Button variant="outline">Clear filters</Button>
|
|
340
|
+
</EmptyAction>
|
|
341
|
+
</EmptyContent>
|
|
342
|
+
</Empty>
|
|
343
|
+
</div>
|
|
344
|
+
</>
|
|
345
|
+
} />
|
|
377
346
|
|
|
378
|
-
|
|
379
|
-
<ExampleSection
|
|
380
|
-
label="🧭 Use Case Comparison"
|
|
381
|
-
description="Các kịch bản thực tế giúp bạn quyết định nên dùng Micro hay Macro."
|
|
382
|
-
fullWidth
|
|
383
|
-
codeString={`<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
347
|
+
<ShowcaseExample title="🧭 So sánh Use Case" description="Các kịch bản thực tế giúp bạn quyết định nên dùng Micro hay Macro." code={`<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
384
348
|
{/* ── Story 1: Macro wins ── */}
|
|
385
349
|
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
386
350
|
<div className="flex items-start gap-3">
|
|
@@ -430,67 +394,63 @@ function EmptyMicroShowcase() {
|
|
|
430
394
|
thêm nội dung phụ như danh sách liên kết.
|
|
431
395
|
</p>
|
|
432
396
|
</div>
|
|
433
|
-
</div>`}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
</div>
|
|
397
|
+
</div>`} preview={
|
|
398
|
+
<>
|
|
399
|
+
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
400
|
+
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
401
|
+
<div className="flex items-start gap-3">
|
|
402
|
+
<span className="mt-0.5 shrink-0 rounded-full bg-green-500/10 p-1.5 text-green-600">
|
|
403
|
+
<CheckCircle2Icon className="size-4" aria-hidden="true" />
|
|
404
|
+
</span>
|
|
405
|
+
<div>
|
|
406
|
+
<p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
407
|
+
Story 1 · Dùng Macro
|
|
408
|
+
</p>
|
|
409
|
+
<h3 className="mt-0.5 text-sm font-semibold text-foreground">
|
|
410
|
+
Giao diện trống tiêu chuẩn
|
|
411
|
+
</h3>
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
415
|
+
Dùng <code>EmptyPreset</code> khi bạn chỉ cần một cấu trúc trạng
|
|
416
|
+
thái trống mặc định, bao gồm icon, tiêu đề, mô tả và nút hành
|
|
417
|
+
động. Giúp rút ngắn code đáng kể.
|
|
418
|
+
</p>
|
|
419
|
+
</div>
|
|
457
420
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
421
|
+
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
422
|
+
<div className="flex items-start gap-3">
|
|
423
|
+
<span className="mt-0.5 shrink-0 rounded-full bg-blue-500/10 p-1.5 text-blue-600">
|
|
424
|
+
<LayersIcon className="size-4" aria-hidden="true" />
|
|
425
|
+
</span>
|
|
426
|
+
<div>
|
|
427
|
+
<p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
428
|
+
Story 2 · Dùng Micro
|
|
429
|
+
</p>
|
|
430
|
+
<h3 className="mt-0.5 text-sm font-semibold text-foreground">
|
|
431
|
+
Bố cục tuỳ biến phức tạp
|
|
432
|
+
</h3>
|
|
433
|
+
</div>
|
|
434
|
+
</div>
|
|
435
|
+
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
436
|
+
Dùng các thành phần con khi cần render SVG animation tuỳ chỉnh,
|
|
437
|
+
hoán đổi vị trí của phần mô tả hoặc nút, thêm nội dung phụ như
|
|
438
|
+
danh sách liên kết.
|
|
439
|
+
</p>
|
|
440
|
+
</div>
|
|
441
|
+
</div>
|
|
442
|
+
</>
|
|
443
|
+
} />
|
|
481
444
|
</div>
|
|
482
445
|
);
|
|
483
446
|
}
|
|
484
447
|
|
|
485
|
-
// ──────────────────────────────────────────────────────────
|
|
486
|
-
// SECTION 3: Entry point
|
|
487
|
-
// ──────────────────────────────────────────────────────────
|
|
488
448
|
export default function EmptyShowcase() {
|
|
489
449
|
return (
|
|
490
450
|
<Showcase
|
|
491
451
|
title="Empty"
|
|
492
452
|
description="Trạng thái trống hiển thị khi không có dữ liệu, chưa có nội dung, hoặc tìm kiếm không ra kết quả."
|
|
493
|
-
|
|
453
|
+
guideline={
|
|
494
454
|
<ShowcaseDocs>
|
|
495
455
|
<DocsP>
|
|
496
456
|
Dùng để thông báo cho người dùng rằng không có dữ liệu để hiển thị ở
|
|
@@ -499,10 +459,8 @@ export default function EmptyShowcase() {
|
|
|
499
459
|
</DocsP>
|
|
500
460
|
</ShowcaseDocs>
|
|
501
461
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
{ label: "Macro (Preset)", content: <EmptyMacroShowcase /> },
|
|
505
|
-
]}
|
|
462
|
+
micro={{ content: <EmptyMicroShowcase /> }}
|
|
463
|
+
macro={{ content: <EmptyMacroShowcase /> }}
|
|
506
464
|
/>
|
|
507
465
|
);
|
|
508
466
|
}
|