gladvn 0.2.36 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/scripts/strip-comments.ts +79 -0
- package/src/blocks/auth-form.tsx +34 -30
- package/src/blocks/auth-recovery.tsx +9 -13
- package/src/blocks/auth-split.tsx +46 -36
- package/src/blocks/settings.tsx +84 -117
- package/src/components/macro/alert-preset.tsx +3 -1
- package/src/components/macro/carousel-preset.tsx +0 -1
- package/src/components/macro/checkbox-preset.test.tsx +2 -2
- package/src/components/macro/checkbox-preset.tsx +1 -2
- package/src/components/macro/command-preset.tsx +1 -1
- package/src/components/macro/date-picker.tsx +5 -18
- package/src/components/macro/dialog-preset.tsx +5 -3
- package/src/components/macro/input-preset.tsx +0 -1
- package/src/components/macro/select-preset.tsx +1 -1
- package/src/components/macro/switch-preset.test.tsx +1 -1
- package/src/components/micro/accordion.test.tsx +6 -12
- package/src/components/micro/alert-dialog.tsx +0 -2
- package/src/components/micro/alert.test.tsx +5 -8
- package/src/components/micro/alert.tsx +0 -2
- package/src/components/micro/badge.test.tsx +5 -7
- package/src/components/micro/badge.tsx +1 -3
- package/src/components/micro/button.test.tsx +19 -26
- package/src/components/micro/button.tsx +3 -11
- package/src/components/micro/calendar.tsx +12 -13
- package/src/components/micro/card.test.tsx +3 -5
- package/src/components/micro/carousel.tsx +0 -1
- package/src/components/micro/chart.tsx +3 -2
- package/src/components/micro/checkbox.test.tsx +9 -18
- package/src/components/micro/combobox.tsx +1 -3
- package/src/components/micro/command.tsx +23 -11
- package/src/components/micro/context-menu.tsx +0 -2
- package/src/components/micro/dialog.test.tsx +6 -14
- package/src/components/micro/dialog.tsx +0 -2
- package/src/components/micro/drawer.tsx +0 -3
- package/src/components/micro/dropdown-menu.test.tsx +8 -14
- package/src/components/micro/dropdown-menu.tsx +0 -2
- package/src/components/micro/field.tsx +3 -3
- package/src/components/micro/hover-card.tsx +0 -2
- package/src/components/micro/input-group.tsx +9 -42
- package/src/components/micro/input.test.tsx +15 -24
- package/src/components/micro/navigation-menu.tsx +0 -2
- package/src/components/micro/popover.test.tsx +5 -9
- package/src/components/micro/progress.tsx +5 -1
- package/src/components/micro/select.test.tsx +5 -18
- package/src/components/micro/select.tsx +3 -5
- package/src/components/micro/separator.tsx +1 -1
- package/src/components/micro/sheet.test.tsx +6 -14
- package/src/components/micro/sheet.tsx +0 -2
- package/src/components/micro/sidebar.tsx +5 -6
- package/src/components/micro/sonner.tsx +0 -1
- package/src/components/micro/switch.test.tsx +9 -18
- package/src/components/micro/switch.tsx +1 -1
- package/src/components/micro/tabs.test.tsx +5 -11
- package/src/components/micro/theme-provider.tsx +0 -12
- package/src/components/micro/toggle-group.tsx +1 -12
- package/src/components/micro/tooltip.test.tsx +7 -12
- package/src/dev/App.tsx +6 -6
- package/src/dev/components/BlockViewer.tsx +15 -4
- package/src/dev/components/Container.tsx +20 -0
- package/src/dev/components/GladvnLogo.tsx +3 -9
- package/src/dev/components/code-highlighter.tsx +5 -3
- package/src/dev/components/showcase.tsx +116 -168
- package/src/dev/sections/buttons.tsx +4 -9
- package/src/dev/sections/display.tsx +68 -72
- package/src/dev/sections/feedback.tsx +304 -314
- package/src/dev/sections/forms.tsx +10 -14
- package/src/dev/sections/interactive.tsx +32 -32
- package/src/dev/sections/overview.tsx +2 -10
- package/src/dev/showcase/accordion.tsx +512 -554
- package/src/dev/showcase/alert-dialog.tsx +525 -565
- package/src/dev/showcase/alert.tsx +352 -402
- package/src/dev/showcase/aspect-ratio.tsx +167 -193
- package/src/dev/showcase/avatar.tsx +231 -269
- package/src/dev/showcase/badge.tsx +92 -140
- package/src/dev/showcase/breadcrumb.tsx +113 -135
- package/src/dev/showcase/button.tsx +140 -173
- package/src/dev/showcase/calendar.tsx +187 -237
- package/src/dev/showcase/card.tsx +229 -261
- package/src/dev/showcase/carousel.tsx +288 -315
- package/src/dev/showcase/chart.tsx +44 -50
- package/src/dev/showcase/checkbox.tsx +286 -330
- package/src/dev/showcase/collapsible.tsx +143 -160
- package/src/dev/showcase/combobox.tsx +327 -369
- package/src/dev/showcase/command.tsx +106 -120
- package/src/dev/showcase/context-menu.tsx +93 -107
- package/src/dev/showcase/dialog.tsx +585 -630
- package/src/dev/showcase/drawer.tsx +176 -196
- package/src/dev/showcase/dropdown-menu.tsx +183 -201
- package/src/dev/showcase/empty.tsx +232 -274
- package/src/dev/showcase/hover-card.tsx +153 -180
- package/src/dev/showcase/input-group.tsx +221 -253
- package/src/dev/showcase/input-otp.tsx +204 -250
- package/src/dev/showcase/input.tsx +246 -325
- package/src/dev/showcase/item.tsx +134 -152
- package/src/dev/showcase/kbd.tsx +149 -172
- package/src/dev/showcase/label.tsx +50 -68
- package/src/dev/showcase/menubar.tsx +194 -213
- package/src/dev/showcase/navigation-menu.tsx +119 -133
- package/src/dev/showcase/overview-components/ArchitectureSection.tsx +126 -0
- package/src/dev/showcase/overview-components/CodeBlock.tsx +50 -0
- package/src/dev/showcase/overview-components/ColorPaletteSection.tsx +44 -0
- package/src/dev/showcase/overview-components/DashboardPreview.tsx +159 -0
- package/src/dev/showcase/overview-components/FeatureGridSection.tsx +535 -0
- package/src/dev/showcase/overview-components/FooterCTA.tsx +137 -0
- package/src/dev/showcase/overview-components/HeroSection.tsx +65 -0
- package/src/dev/showcase/overview-components/PrinciplesSection.tsx +128 -0
- package/src/dev/showcase/overview.tsx +21 -1163
- package/src/dev/showcase/pagination.tsx +144 -190
- package/src/dev/showcase/popover.tsx +181 -196
- package/src/dev/showcase/progress.tsx +141 -189
- package/src/dev/showcase/radio-group.tsx +272 -332
- package/src/dev/showcase/resizable.tsx +119 -141
- package/src/dev/showcase/scroll-area.tsx +21 -36
- package/src/dev/showcase/select.tsx +262 -322
- package/src/dev/showcase/separator.tsx +75 -73
- package/src/dev/showcase/sheet.tsx +333 -361
- package/src/dev/showcase/sidebar.tsx +53 -59
- package/src/dev/showcase/skeleton.tsx +93 -112
- package/src/dev/showcase/slider.tsx +244 -296
- package/src/dev/showcase/sonner.tsx +251 -258
- package/src/dev/showcase/spinner.tsx +46 -67
- package/src/dev/showcase/switch.tsx +298 -362
- package/src/dev/showcase/table.tsx +76 -80
- package/src/dev/showcase/tabs.tsx +302 -355
- package/src/dev/showcase/textarea.tsx +240 -293
- package/src/dev/showcase/toast.tsx +48 -54
- package/src/dev/showcase/toggle-group.tsx +104 -129
- package/src/dev/showcase/toggle.tsx +82 -102
- package/src/dev/showcase/tooltip.tsx +173 -192
- package/src/dev/showcase/why.tsx +6 -12
- package/src/hooks/use-mobile.test.ts +3 -2
- package/src/lib/utils.test.ts +5 -4
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "../../components/micro/sidebar";
|
|
11
11
|
import {
|
|
12
12
|
DocsP,
|
|
13
|
-
|
|
13
|
+
ShowcaseExample,
|
|
14
14
|
Showcase,
|
|
15
15
|
ShowcaseDocs
|
|
16
16
|
} from "../../dev/components/showcase";
|
|
@@ -20,12 +20,8 @@ function SidebarMicroShowcase() {
|
|
|
20
20
|
useSidebarToggle("expanded");
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<div className="space-y-10
|
|
24
|
-
<
|
|
25
|
-
label="Dumb Component Architecture"
|
|
26
|
-
description="Sidebar không có transition width, sử dụng display: none để ẩn ngay lập tức, không gây hiệu ứng giật khung."
|
|
27
|
-
fullWidth
|
|
28
|
-
codeString={`const { sidebarRef, toggleSidebar, defaultState } = useSidebarToggle("expanded");
|
|
23
|
+
<div className="space-y-10">
|
|
24
|
+
<ShowcaseExample title="Dumb Component Architecture" description="Sidebar không có transition width, sử dụng display: none để ẩn ngay lập tức, không gây hiệu ứng giật khung." code={`const { sidebarRef, toggleSidebar, defaultState } = useSidebarToggle("expanded");
|
|
29
25
|
|
|
30
26
|
return (
|
|
31
27
|
<div className="flex h-[500px] w-full">
|
|
@@ -46,60 +42,58 @@ return (
|
|
|
46
42
|
<button onClick={toggleSidebar}>Toggle Sidebar</button>
|
|
47
43
|
</main>
|
|
48
44
|
</div>
|
|
49
|
-
);`}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<SidebarLogo icon={<Package2Icon />} text="Acme Corp" />
|
|
45
|
+
);`} preview={
|
|
46
|
+
<>
|
|
47
|
+
<div className="rounded-xl border border-border overflow-hidden flex h-[500px] w-full bg-background">
|
|
48
|
+
<Sidebar
|
|
49
|
+
ref={sidebarRef}
|
|
50
|
+
defaultState={defaultState}
|
|
51
|
+
expandedWidth={300}
|
|
52
|
+
>
|
|
53
|
+
<SidebarLogo icon={<Package2Icon />} text="Acme Corp" />
|
|
59
54
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</div>
|
|
55
|
+
<div className="flex-1 py-2 flex flex-col gap-4">
|
|
56
|
+
<div className="flex flex-col gap-1">
|
|
57
|
+
<SidebarLabel icon={<FolderIcon />} text="Projects" />
|
|
58
|
+
<SidebarMenuItemList>
|
|
59
|
+
<SidebarMenuItem text="Active Projects" />
|
|
60
|
+
<SidebarMenuItem text="Archived Projects" />
|
|
61
|
+
<SidebarMenuItem text="Templates" />
|
|
62
|
+
</SidebarMenuItemList>
|
|
63
|
+
</div>
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
<div className="flex flex-col gap-1">
|
|
66
|
+
<SidebarLabel icon={<UserIcon />} text="Team" />
|
|
67
|
+
<SidebarMenuItemList>
|
|
68
|
+
<SidebarMenuItem text="Members" />
|
|
69
|
+
<SidebarMenuItem text="Permissions" />
|
|
70
|
+
</SidebarMenuItemList>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
79
73
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</Sidebar>
|
|
74
|
+
<div className="p-2 border-t border-sidebar-border mt-auto">
|
|
75
|
+
<SidebarLabel icon={<SettingsIcon />} text="Cài đặt" />
|
|
76
|
+
</div>
|
|
77
|
+
</Sidebar>
|
|
85
78
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
79
|
+
<main className="flex-1 flex flex-col bg-muted/10 p-6">
|
|
80
|
+
<h1 className="text-xl font-bold">Main Application</h1>
|
|
81
|
+
<p className="text-muted-foreground mt-4">
|
|
82
|
+
Hãy bấm menu State ở phía trên cùng, hoặc bấm nút Toggle bên dưới
|
|
83
|
+
để chuyển qua lại giữa Expanded và Collapsed.
|
|
84
|
+
</p>
|
|
85
|
+
<div className="mt-6">
|
|
86
|
+
<button
|
|
87
|
+
className="px-4 py-2 bg-primary text-primary-foreground rounded-md shadow hover:bg-primary/90 transition-colors"
|
|
88
|
+
onClick={toggleSidebar}
|
|
89
|
+
>
|
|
90
|
+
Toggle Sidebar (Direct DOM Mutation)
|
|
91
|
+
</button>
|
|
92
|
+
</div>
|
|
93
|
+
</main>
|
|
94
|
+
</div>
|
|
95
|
+
</>
|
|
96
|
+
} />
|
|
103
97
|
</div>
|
|
104
98
|
);
|
|
105
99
|
}
|
|
@@ -109,7 +103,7 @@ export default function SidebarShowcase() {
|
|
|
109
103
|
<Showcase
|
|
110
104
|
title="Sidebar (Ultra Primitive)"
|
|
111
105
|
description="Sidebar nguyên thuỷ nhất, chỉ nhận context state, CSS thuần tuý đóng mở tức thì."
|
|
112
|
-
|
|
106
|
+
guideline={
|
|
113
107
|
<ShowcaseDocs>
|
|
114
108
|
<DocsP>
|
|
115
109
|
Sidebar tối giản chỉ dùng CSS và DOM attribute để chuyển trạng thái
|
|
@@ -118,7 +112,7 @@ export default function SidebarShowcase() {
|
|
|
118
112
|
</DocsP>
|
|
119
113
|
</ShowcaseDocs>
|
|
120
114
|
}
|
|
121
|
-
|
|
115
|
+
micro={{ content: <SidebarMicroShowcase /> }}
|
|
122
116
|
/>
|
|
123
117
|
);
|
|
124
118
|
}
|
|
@@ -4,45 +4,36 @@ import {
|
|
|
4
4
|
DocsH3,
|
|
5
5
|
DocsP,
|
|
6
6
|
ExampleGrid,
|
|
7
|
-
|
|
7
|
+
ShowcaseExample,
|
|
8
8
|
Showcase,
|
|
9
9
|
ShowcaseDocs
|
|
10
10
|
} from "../../dev/components/showcase";
|
|
11
11
|
|
|
12
|
-
// ──────────────────────────────────────────────────────────
|
|
13
|
-
// SECTION 1: Micro Content (Only Micro exists)
|
|
14
|
-
// ──────────────────────────────────────────────────────────
|
|
15
12
|
function SkeletonMicroShowcase() {
|
|
16
13
|
return (
|
|
17
|
-
<div className="space-y-10
|
|
18
|
-
<
|
|
19
|
-
label="Hình dáng cơ bản (Basic Shapes)"
|
|
20
|
-
description="Thay đổi hình dạng thông qua các class Tailwind: w-..., h-..., rounded-full, v.v."
|
|
21
|
-
fullWidth
|
|
22
|
-
codeString={`<div className="flex flex-wrap items-center gap-6 w-full p-4 border border-border rounded-lg bg-card">
|
|
14
|
+
<div className="space-y-10">
|
|
15
|
+
<ShowcaseExample title="Hình dáng cơ bản (Basic Shapes)" description="Thay đổi hình dạng thông qua các class Tailwind: w-..., h-..., rounded-full, v.v." code={`<div className="flex flex-wrap items-center gap-6 w-full p-4 border border-border rounded-lg bg-card">
|
|
23
16
|
<Skeleton className="h-4 w-48" />
|
|
24
17
|
<Skeleton className="h-4 w-32" />
|
|
25
18
|
<Skeleton className="h-4 w-64" />
|
|
26
19
|
<Skeleton className="size-12 rounded-full" />
|
|
27
20
|
<Skeleton className="h-24 w-40 rounded-xl" />
|
|
28
21
|
<Skeleton className="h-10 w-24 rounded-md" />
|
|
29
|
-
</div>`}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
</div>`} preview={
|
|
23
|
+
<>
|
|
24
|
+
<div className="flex flex-wrap items-center gap-6 w-full p-4 border border-border rounded-lg bg-card">
|
|
25
|
+
<Skeleton className="h-4 w-48" />
|
|
26
|
+
<Skeleton className="h-4 w-32" />
|
|
27
|
+
<Skeleton className="h-4 w-64" />
|
|
28
|
+
<Skeleton className="size-12 rounded-full" />
|
|
29
|
+
<Skeleton className="h-24 w-40 rounded-xl" />
|
|
30
|
+
<Skeleton className="h-10 w-24 rounded-md" />
|
|
31
|
+
</div>
|
|
32
|
+
</>
|
|
33
|
+
} />
|
|
40
34
|
|
|
41
35
|
<ExampleGrid>
|
|
42
|
-
<
|
|
43
|
-
label="Card Profile"
|
|
44
|
-
description="Khung xương mô phỏng ảnh đại diện, tên người dùng và số liệu."
|
|
45
|
-
codeString={`<div className="space-y-6 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
36
|
+
<ShowcaseExample title="Card Profile" description="Khung xương mô phỏng ảnh đại diện, tên người dùng và số liệu." code={`<div className="space-y-6 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
46
37
|
<div className="flex items-center space-x-4">
|
|
47
38
|
<Skeleton className="h-12 w-12 rounded-full" />
|
|
48
39
|
<div className="space-y-2">
|
|
@@ -54,27 +45,25 @@ function SkeletonMicroShowcase() {
|
|
|
54
45
|
<Skeleton className="h-24 rounded-xl" />
|
|
55
46
|
<Skeleton className="h-24 rounded-xl" />
|
|
56
47
|
</div>
|
|
57
|
-
</div>`}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
48
|
+
</div>`} preview={
|
|
49
|
+
<>
|
|
50
|
+
<div className="space-y-6 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
51
|
+
<div className="flex items-center space-x-4">
|
|
52
|
+
<Skeleton className="h-12 w-12 rounded-full" />
|
|
53
|
+
<div className="space-y-2">
|
|
54
|
+
<Skeleton className="h-4 w-[200px]" />
|
|
55
|
+
<Skeleton className="h-4 w-[150px]" />
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<div className="grid grid-cols-2 gap-4">
|
|
59
|
+
<Skeleton className="h-24 rounded-xl" />
|
|
60
|
+
<Skeleton className="h-24 rounded-xl" />
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</>
|
|
64
|
+
} />
|
|
73
65
|
|
|
74
|
-
<
|
|
75
|
-
label="Article / Blog Post"
|
|
76
|
-
description="Khung xương mô phỏng các đoạn văn bản (text blocks)."
|
|
77
|
-
codeString={`<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
66
|
+
<ShowcaseExample title="Article / Blog Post" description="Khung xương mô phỏng các đoạn văn bản (text blocks)." code={`<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
78
67
|
<Skeleton className="h-6 w-3/4" />
|
|
79
68
|
<Skeleton className="h-4 w-full" />
|
|
80
69
|
<Skeleton className="h-4 w-full" />
|
|
@@ -83,26 +72,24 @@ function SkeletonMicroShowcase() {
|
|
|
83
72
|
<Skeleton className="h-4 w-full" />
|
|
84
73
|
<Skeleton className="h-4 w-4/5" />
|
|
85
74
|
<Skeleton className="h-4 w-2/3" />
|
|
86
|
-
</div>`}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
75
|
+
</div>`} preview={
|
|
76
|
+
<>
|
|
77
|
+
<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
78
|
+
<Skeleton className="h-6 w-3/4" />
|
|
79
|
+
<Skeleton className="h-4 w-full" />
|
|
80
|
+
<Skeleton className="h-4 w-full" />
|
|
81
|
+
<Skeleton className="h-4 w-5/6" />
|
|
82
|
+
<div className="pt-2" />
|
|
83
|
+
<Skeleton className="h-4 w-full" />
|
|
84
|
+
<Skeleton className="h-4 w-4/5" />
|
|
85
|
+
<Skeleton className="h-4 w-2/3" />
|
|
86
|
+
</div>
|
|
87
|
+
</>
|
|
88
|
+
} />
|
|
99
89
|
</ExampleGrid>
|
|
100
90
|
|
|
101
91
|
<ExampleGrid>
|
|
102
|
-
<
|
|
103
|
-
label="List Items / Table Rows"
|
|
104
|
-
description="Sử dụng vòng lặp hoặc nhiều thẻ lặp lại để mô phỏng danh sách."
|
|
105
|
-
codeString={`<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
92
|
+
<ShowcaseExample title="List Items / Table Rows" description="Sử dụng vòng lặp hoặc nhiều thẻ lặp lại để mô phỏng danh sách." code={`<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
106
93
|
<div className="flex items-center space-x-4">
|
|
107
94
|
<Skeleton className="h-8 w-8 rounded-full" />
|
|
108
95
|
<div className="space-y-2">
|
|
@@ -124,37 +111,35 @@ function SkeletonMicroShowcase() {
|
|
|
124
111
|
<Skeleton className="h-3 w-[90px]" />
|
|
125
112
|
</div>
|
|
126
113
|
</div>
|
|
127
|
-
</div>`}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
114
|
+
</div>`} preview={
|
|
115
|
+
<>
|
|
116
|
+
<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
117
|
+
<div className="flex items-center space-x-4">
|
|
118
|
+
<Skeleton className="h-8 w-8 rounded-full" />
|
|
119
|
+
<div className="space-y-2">
|
|
120
|
+
<Skeleton className="h-3 w-[180px]" />
|
|
121
|
+
<Skeleton className="h-3 w-[100px]" />
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<div className="flex items-center space-x-4">
|
|
125
|
+
<Skeleton className="h-8 w-8 rounded-full" />
|
|
126
|
+
<div className="space-y-2">
|
|
127
|
+
<Skeleton className="h-3 w-[150px]" />
|
|
128
|
+
<Skeleton className="h-3 w-[120px]" />
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
<div className="flex items-center space-x-4">
|
|
132
|
+
<Skeleton className="h-8 w-8 rounded-full" />
|
|
133
|
+
<div className="space-y-2">
|
|
134
|
+
<Skeleton className="h-3 w-[170px]" />
|
|
135
|
+
<Skeleton className="h-3 w-[90px]" />
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</>
|
|
140
|
+
} />
|
|
153
141
|
|
|
154
|
-
<
|
|
155
|
-
label="Media / Image Placeholder"
|
|
156
|
-
description="Khung xương lớn mô phỏng hình ảnh hoặc video player."
|
|
157
|
-
codeString={`<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
142
|
+
<ShowcaseExample title="Media / Image Placeholder" description="Khung xương lớn mô phỏng hình ảnh hoặc video player." code={`<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
158
143
|
<Skeleton className="h-48 w-full rounded-md" />
|
|
159
144
|
<div className="flex justify-between items-center pt-2">
|
|
160
145
|
<div className="space-y-2">
|
|
@@ -163,33 +148,31 @@ function SkeletonMicroShowcase() {
|
|
|
163
148
|
</div>
|
|
164
149
|
<Skeleton className="h-8 w-16 rounded-md" />
|
|
165
150
|
</div>
|
|
166
|
-
</div>`}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
151
|
+
</div>`} preview={
|
|
152
|
+
<>
|
|
153
|
+
<div className="space-y-4 w-full max-w-sm rounded-lg border border-border bg-card p-4">
|
|
154
|
+
<Skeleton className="h-48 w-full rounded-md" />
|
|
155
|
+
<div className="flex justify-between items-center pt-2">
|
|
156
|
+
<div className="space-y-2">
|
|
157
|
+
<Skeleton className="h-4 w-[150px]" />
|
|
158
|
+
<Skeleton className="h-3 w-[100px]" />
|
|
159
|
+
</div>
|
|
160
|
+
<Skeleton className="h-8 w-16 rounded-md" />
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</>
|
|
164
|
+
} />
|
|
179
165
|
</ExampleGrid>
|
|
180
166
|
</div>
|
|
181
167
|
);
|
|
182
168
|
}
|
|
183
169
|
|
|
184
|
-
// ──────────────────────────────────────────────────────────
|
|
185
|
-
// SECTION 3: Entry point
|
|
186
|
-
// ──────────────────────────────────────────────────────────
|
|
187
170
|
export default function SkeletonShowcase() {
|
|
188
171
|
return (
|
|
189
172
|
<Showcase
|
|
190
173
|
title="Skeleton"
|
|
191
174
|
description="Thành phần tạo ra hiệu ứng nhấp nháy, mô phỏng bố cục hiển thị để giữ chỗ (placeholder) trong khi chờ dữ liệu đang tải."
|
|
192
|
-
|
|
175
|
+
guideline={
|
|
193
176
|
<ShowcaseDocs>
|
|
194
177
|
<DocsH3>Skeleton (Khung xương)</DocsH3>
|
|
195
178
|
<DocsP>
|
|
@@ -200,9 +183,7 @@ export default function SkeletonShowcase() {
|
|
|
200
183
|
</DocsP>
|
|
201
184
|
</ShowcaseDocs>
|
|
202
185
|
}
|
|
203
|
-
|
|
204
|
-
{ label: "Micro (Primitive)", content: <SkeletonMicroShowcase /> },
|
|
205
|
-
]}
|
|
186
|
+
micro={{ content: <SkeletonMicroShowcase /> }}
|
|
206
187
|
/>
|
|
207
188
|
);
|
|
208
189
|
}
|