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
|
@@ -7,22 +7,15 @@ import {
|
|
|
7
7
|
DocsCode,
|
|
8
8
|
DocsP,
|
|
9
9
|
ExampleGrid,
|
|
10
|
-
|
|
10
|
+
ShowcaseExample,
|
|
11
11
|
Showcase,
|
|
12
12
|
ShowcaseDocs
|
|
13
13
|
} from "../../dev/components/showcase";
|
|
14
14
|
|
|
15
|
-
// ──────────────────────────────────────────────────────────
|
|
16
|
-
// SECTION 1: Micro Content
|
|
17
|
-
// ──────────────────────────────────────────────────────────
|
|
18
15
|
function ResizableMicroShowcase() {
|
|
19
16
|
return (
|
|
20
|
-
<div className="space-y-10
|
|
21
|
-
|
|
22
|
-
<ExampleSection
|
|
23
|
-
label="Horizontal Split"
|
|
24
|
-
description="Kéo tay cầm để thay đổi kích thước bảng theo chiều ngang."
|
|
25
|
-
codeString={`<ResizablePanelGroup
|
|
17
|
+
<div className="space-y-10">
|
|
18
|
+
<ShowcaseExample title="Horizontal Split" description="Kéo tay cầm để thay đổi kích thước bảng theo chiều ngang." code={`<ResizablePanelGroup
|
|
26
19
|
orientation="horizontal"
|
|
27
20
|
className="max-w-md rounded-xl border border-border bg-card"
|
|
28
21
|
>
|
|
@@ -41,37 +34,34 @@ function ResizableMicroShowcase() {
|
|
|
41
34
|
</span>
|
|
42
35
|
</div>
|
|
43
36
|
</ResizablePanel>
|
|
44
|
-
</ResizablePanelGroup>`}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
37
|
+
</ResizablePanelGroup>`} preview={
|
|
38
|
+
<>
|
|
39
|
+
<ResizablePanelGroup
|
|
40
|
+
orientation="horizontal"
|
|
41
|
+
className="max-w-md rounded-xl border border-border bg-card"
|
|
42
|
+
>
|
|
43
|
+
<ResizablePanel defaultSize={50}>
|
|
44
|
+
<div className="flex h-[200px] items-center justify-center p-6">
|
|
45
|
+
<span className="font-semibold text-sm">Thanh bên (Sidebar)</span>
|
|
46
|
+
</div>
|
|
47
|
+
</ResizablePanel>
|
|
48
|
+
<ResizableHandle withHandle />
|
|
49
|
+
<ResizablePanel defaultSize={50}>
|
|
50
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
51
|
+
<span className="font-semibold text-sm">Nội dung</span>
|
|
52
|
+
</div>
|
|
53
|
+
</ResizablePanel>
|
|
54
|
+
</ResizablePanelGroup>
|
|
55
|
+
</>
|
|
56
|
+
} />
|
|
63
57
|
|
|
64
|
-
|
|
65
|
-
<ExampleSection
|
|
66
|
-
label="Vertical Split"
|
|
67
|
-
description='orientation="vertical" chia bảng theo chiều dọc.'
|
|
68
|
-
codeString={`<ResizablePanelGroup
|
|
58
|
+
<ShowcaseExample title="Vertical Split" description='orientation="vertical" chia bảng theo chiều dọc.' code={`<ResizablePanelGroup
|
|
69
59
|
orientation="vertical"
|
|
70
60
|
className="max-w-md rounded-xl border border-border bg-card"
|
|
71
61
|
>
|
|
72
62
|
<ResizablePanel defaultSize={50}>
|
|
73
63
|
<div className="flex h-[120px] items-center justify-center p-6">
|
|
74
|
-
<span className="font-semibold text-sm">
|
|
64
|
+
<span className="font-semibold text-sm">Trên</span>
|
|
75
65
|
</div>
|
|
76
66
|
</ResizablePanel>
|
|
77
67
|
<ResizableHandle withHandle />
|
|
@@ -82,86 +72,78 @@ function ResizableMicroShowcase() {
|
|
|
82
72
|
</span>
|
|
83
73
|
</div>
|
|
84
74
|
</ResizablePanel>
|
|
85
|
-
</ResizablePanelGroup>`}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
75
|
+
</ResizablePanelGroup>`} preview={
|
|
76
|
+
<>
|
|
77
|
+
<ResizablePanelGroup
|
|
78
|
+
orientation="vertical"
|
|
79
|
+
className="max-w-md rounded-xl border border-border bg-card"
|
|
80
|
+
>
|
|
81
|
+
<ResizablePanel defaultSize={50}>
|
|
82
|
+
<div className="flex h-[120px] items-center justify-center p-6">
|
|
83
|
+
<span className="font-semibold text-sm">Trên</span>
|
|
84
|
+
</div>
|
|
85
|
+
</ResizablePanel>
|
|
86
|
+
<ResizableHandle withHandle />
|
|
87
|
+
<ResizablePanel defaultSize={50}>
|
|
88
|
+
<div className="flex h-[120px] items-center justify-center p-6">
|
|
89
|
+
<span className="font-semibold text-sm">Dưới</span>
|
|
90
|
+
</div>
|
|
91
|
+
</ResizablePanel>
|
|
92
|
+
</ResizablePanelGroup>
|
|
93
|
+
</>
|
|
94
|
+
} />
|
|
104
95
|
|
|
105
|
-
{/* Handle variants */}
|
|
106
96
|
<ExampleGrid>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
</ResizablePanelGroup>
|
|
128
|
-
</ExampleSection>
|
|
97
|
+
<ShowcaseExample title="With Handle Grip" description="withHandle hiển thị thanh tay cầm trực quan ở giữa divider." code={`<ResizableHandle withHandle />`} preview={
|
|
98
|
+
<>
|
|
99
|
+
<ResizablePanelGroup
|
|
100
|
+
orientation="horizontal"
|
|
101
|
+
className="rounded-xl border border-border bg-card"
|
|
102
|
+
>
|
|
103
|
+
<ResizablePanel defaultSize={50}>
|
|
104
|
+
<div className="flex h-[120px] items-center justify-center p-4">
|
|
105
|
+
<span className="text-sm font-medium">Bảng A</span>
|
|
106
|
+
</div>
|
|
107
|
+
</ResizablePanel>
|
|
108
|
+
<ResizableHandle withHandle />
|
|
109
|
+
<ResizablePanel defaultSize={50}>
|
|
110
|
+
<div className="flex h-full items-center justify-center p-4">
|
|
111
|
+
<span className="text-sm font-medium">Bảng B</span>
|
|
112
|
+
</div>
|
|
113
|
+
</ResizablePanel>
|
|
114
|
+
</ResizablePanelGroup>
|
|
115
|
+
</>
|
|
116
|
+
} />
|
|
129
117
|
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</ResizablePanelGroup>
|
|
151
|
-
</ExampleSection>
|
|
118
|
+
<ShowcaseExample title="Plain Divider" description="Bỏ withHandle để chỉ hiển thị đường phân cách mỏng, không có visual grip." code={`<ResizableHandle />`} preview={
|
|
119
|
+
<>
|
|
120
|
+
<ResizablePanelGroup
|
|
121
|
+
orientation="horizontal"
|
|
122
|
+
className="rounded-xl border border-border bg-card"
|
|
123
|
+
>
|
|
124
|
+
<ResizablePanel defaultSize={50}>
|
|
125
|
+
<div className="flex h-[120px] items-center justify-center p-4">
|
|
126
|
+
<span className="text-sm font-medium">Bảng A</span>
|
|
127
|
+
</div>
|
|
128
|
+
</ResizablePanel>
|
|
129
|
+
<ResizableHandle />
|
|
130
|
+
<ResizablePanel defaultSize={50}>
|
|
131
|
+
<div className="flex h-full items-center justify-center p-4">
|
|
132
|
+
<span className="text-sm font-medium">Bảng B</span>
|
|
133
|
+
</div>
|
|
134
|
+
</ResizablePanel>
|
|
135
|
+
</ResizablePanelGroup>
|
|
136
|
+
</>
|
|
137
|
+
} />
|
|
152
138
|
</ExampleGrid>
|
|
153
139
|
|
|
154
|
-
|
|
155
|
-
<ExampleSection
|
|
156
|
-
label="Nested Layout"
|
|
157
|
-
description="Bố cục phức tạp với các nhóm có thể thay đổi kích thước lồng nhau."
|
|
158
|
-
codeString={`<ResizablePanelGroup
|
|
140
|
+
<ShowcaseExample title="Nested Layout" description="Bố cục phức tạp với các nhóm có thể thay đổi kích thước lồng nhau." code={`<ResizablePanelGroup
|
|
159
141
|
orientation="horizontal"
|
|
160
142
|
className="max-w-md rounded-xl border border-border bg-card"
|
|
161
143
|
>
|
|
162
144
|
<ResizablePanel defaultSize={25} minSize={15}>
|
|
163
145
|
<div className="flex h-[250px] items-center justify-center p-6">
|
|
164
|
-
<span className="font-semibold text-sm"
|
|
146
|
+
<span className="font-semibold text-sm">Điều hướng</span>
|
|
165
147
|
</div>
|
|
166
148
|
</ResizablePanel>
|
|
167
149
|
<ResizableHandle />
|
|
@@ -184,48 +166,46 @@ function ResizableMicroShowcase() {
|
|
|
184
166
|
</ResizablePanel>
|
|
185
167
|
</ResizablePanelGroup>
|
|
186
168
|
</ResizablePanel>
|
|
187
|
-
</ResizablePanelGroup>`}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
169
|
+
</ResizablePanelGroup>`} preview={
|
|
170
|
+
<>
|
|
171
|
+
<ResizablePanelGroup
|
|
172
|
+
orientation="horizontal"
|
|
173
|
+
className="max-w-md rounded-xl border border-border bg-card"
|
|
174
|
+
>
|
|
175
|
+
<ResizablePanel defaultSize={25} minSize={15}>
|
|
176
|
+
<div className="flex h-[250px] items-center justify-center p-6">
|
|
177
|
+
<span className="font-semibold text-sm">Điều hướng</span>
|
|
178
|
+
</div>
|
|
179
|
+
</ResizablePanel>
|
|
180
|
+
<ResizableHandle />
|
|
181
|
+
<ResizablePanel defaultSize={75}>
|
|
182
|
+
<ResizablePanelGroup orientation="vertical">
|
|
183
|
+
<ResizablePanel defaultSize={25} minSize={20}>
|
|
184
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
185
|
+
<span className="font-semibold text-sm">Thanh trên</span>
|
|
186
|
+
</div>
|
|
187
|
+
</ResizablePanel>
|
|
188
|
+
<ResizableHandle />
|
|
189
|
+
<ResizablePanel defaultSize={75}>
|
|
190
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
191
|
+
<span className="font-semibold text-sm">Nội dung chính</span>
|
|
192
|
+
</div>
|
|
193
|
+
</ResizablePanel>
|
|
194
|
+
</ResizablePanelGroup>
|
|
195
|
+
</ResizablePanel>
|
|
196
|
+
</ResizablePanelGroup>
|
|
197
|
+
</>
|
|
198
|
+
} />
|
|
216
199
|
</div>
|
|
217
200
|
);
|
|
218
201
|
}
|
|
219
202
|
|
|
220
|
-
// ──────────────────────────────────────────────────────────
|
|
221
|
-
// SECTION 2: Entry point
|
|
222
|
-
// ──────────────────────────────────────────────────────────
|
|
223
203
|
export default function ResizableShowcase() {
|
|
224
204
|
return (
|
|
225
205
|
<Showcase
|
|
226
206
|
title="Resizable"
|
|
227
207
|
description="Panel có thể thay đổi kích thước với hỗ trợ bàn phím, lồng nhau linh hoạt."
|
|
228
|
-
|
|
208
|
+
guideline={
|
|
229
209
|
<ShowcaseDocs>
|
|
230
210
|
<DocsP>
|
|
231
211
|
Resizable sử dụng thư viện{" "}
|
|
@@ -239,9 +219,7 @@ export default function ResizableShowcase() {
|
|
|
239
219
|
</DocsP>
|
|
240
220
|
</ShowcaseDocs>
|
|
241
221
|
}
|
|
242
|
-
|
|
243
|
-
{ label: "Micro (Primitive)", content: <ResizableMicroShowcase /> },
|
|
244
|
-
]}
|
|
222
|
+
micro={{ content: <ResizableMicroShowcase /> }}
|
|
245
223
|
/>
|
|
246
224
|
);
|
|
247
225
|
}
|
|
@@ -4,14 +4,11 @@ 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: Explicit Sub-components for Demo
|
|
14
|
-
// ──────────────────────────────────────────────────────────
|
|
15
12
|
function VerticalList() {
|
|
16
13
|
const items = [
|
|
17
14
|
"Tùy chọn 1",
|
|
@@ -75,17 +72,11 @@ function HorizontalList() {
|
|
|
75
72
|
);
|
|
76
73
|
}
|
|
77
74
|
|
|
78
|
-
// ──────────────────────────────────────────────────────────
|
|
79
|
-
// SECTION 2: Micro Content (Only Micro exists)
|
|
80
|
-
// ──────────────────────────────────────────────────────────
|
|
81
75
|
function ScrollAreaMicroShowcase() {
|
|
82
76
|
return (
|
|
83
|
-
<div className="space-y-10
|
|
77
|
+
<div className="space-y-10">
|
|
84
78
|
<ExampleGrid>
|
|
85
|
-
<
|
|
86
|
-
label="Cuộn dọc (Vertical)"
|
|
87
|
-
description="Danh sách các mục có thể cuộn từ trên xuống dưới."
|
|
88
|
-
codeString={`<ScrollArea className="h-72 w-full max-w-sm rounded-xl border border-border bg-card">
|
|
79
|
+
<ShowcaseExample title="Cuộn dọc (Vertical)" description="Danh sách các mục có thể cuộn từ trên xuống dưới." code={`<ScrollArea className="h-72 w-full max-w-sm rounded-xl border border-border bg-card">
|
|
89
80
|
<div className="p-4">
|
|
90
81
|
<h4 className="mb-4 text-sm font-medium leading-none">
|
|
91
82
|
Cài đặt hệ thống
|
|
@@ -101,17 +92,15 @@ function ScrollAreaMicroShowcase() {
|
|
|
101
92
|
</div>
|
|
102
93
|
{/* ... */}
|
|
103
94
|
</div>
|
|
104
|
-
</ScrollArea>`}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
95
|
+
</ScrollArea>`} preview={
|
|
96
|
+
<>
|
|
97
|
+
<ScrollArea className="h-72 w-full max-w-sm rounded-xl border border-border bg-card">
|
|
98
|
+
<VerticalList />
|
|
99
|
+
</ScrollArea>
|
|
100
|
+
</>
|
|
101
|
+
} />
|
|
110
102
|
|
|
111
|
-
<
|
|
112
|
-
label="Cuộn ngang (Horizontal)"
|
|
113
|
-
description="Trình bày danh sách phần tử nằm ngang (thường dùng cho ảnh, card)."
|
|
114
|
-
codeString={`<ScrollArea className="w-full max-w-sm whitespace-nowrap rounded-xl border border-border bg-card p-4">
|
|
103
|
+
<ShowcaseExample title="Cuộn ngang (Horizontal)" description="Trình bày danh sách phần tử nằm ngang (thường dùng cho ảnh, card)." code={`<ScrollArea className="w-full max-w-sm whitespace-nowrap rounded-xl border border-border bg-card p-4">
|
|
115
104
|
<div className="flex w-max space-x-4">
|
|
116
105
|
<div className="w-[150px] shrink-0">
|
|
117
106
|
<div className="aspect-[3/4] rounded-md bg-muted" />
|
|
@@ -128,27 +117,25 @@ function ScrollAreaMicroShowcase() {
|
|
|
128
117
|
{/* ... */}
|
|
129
118
|
</div>
|
|
130
119
|
<ScrollBar orientation="horizontal" />
|
|
131
|
-
</ScrollArea>`}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
</ScrollArea>`} preview={
|
|
121
|
+
<>
|
|
122
|
+
<ScrollArea className="w-full max-w-sm whitespace-nowrap rounded-xl border border-border bg-card">
|
|
123
|
+
<HorizontalList />
|
|
124
|
+
<ScrollBar orientation="horizontal" />
|
|
125
|
+
</ScrollArea>
|
|
126
|
+
</>
|
|
127
|
+
} />
|
|
138
128
|
</ExampleGrid>
|
|
139
129
|
</div>
|
|
140
130
|
);
|
|
141
131
|
}
|
|
142
132
|
|
|
143
|
-
// ──────────────────────────────────────────────────────────
|
|
144
|
-
// SECTION 3: Entry point
|
|
145
|
-
// ──────────────────────────────────────────────────────────
|
|
146
133
|
export default function ScrollAreaShowcase() {
|
|
147
134
|
return (
|
|
148
135
|
<Showcase
|
|
149
136
|
title="Scroll Area"
|
|
150
137
|
description="Khu vực nội dung có thanh cuộn tuỳ biến giao diện, đồng bộ trên mọi trình duyệt thay cho thanh cuộn mặc định."
|
|
151
|
-
|
|
138
|
+
guideline={
|
|
152
139
|
<ShowcaseDocs>
|
|
153
140
|
<DocsH3>Scroll Area (Khu vực cuộn)</DocsH3>
|
|
154
141
|
<DocsP>
|
|
@@ -159,9 +146,7 @@ export default function ScrollAreaShowcase() {
|
|
|
159
146
|
</DocsP>
|
|
160
147
|
</ShowcaseDocs>
|
|
161
148
|
}
|
|
162
|
-
|
|
163
|
-
{ label: "Micro (Primitive)", content: <ScrollAreaMicroShowcase /> },
|
|
164
|
-
]}
|
|
149
|
+
micro={{ content: <ScrollAreaMicroShowcase /> }}
|
|
165
150
|
/>
|
|
166
151
|
);
|
|
167
152
|
}
|