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
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
DocsP,
|
|
15
15
|
ExampleGrid,
|
|
16
|
-
|
|
16
|
+
ShowcaseExample,
|
|
17
17
|
Showcase,
|
|
18
18
|
ShowcaseDocs
|
|
19
19
|
} from "../../dev/components/showcase";
|
|
@@ -22,27 +22,27 @@ import { cn } from "../../lib/utils";
|
|
|
22
22
|
const SLIDES = [
|
|
23
23
|
{
|
|
24
24
|
id: 1,
|
|
25
|
-
title: "
|
|
25
|
+
title: "Giao diện Hiện đại",
|
|
26
26
|
desc: "Crafting beautiful interfaces with tailwind.",
|
|
27
27
|
bg: "bg-gradient-to-tr from-violet-500 to-purple-500" },
|
|
28
28
|
{
|
|
29
29
|
id: 2,
|
|
30
|
-
title: "
|
|
30
|
+
title: "Tương tác Mượt mà",
|
|
31
31
|
desc: "Fluid animations and micro-interactions.",
|
|
32
32
|
bg: "bg-gradient-to-tr from-pink-500 to-rose-500" },
|
|
33
33
|
{
|
|
34
34
|
id: 3,
|
|
35
|
-
title: "
|
|
35
|
+
title: "Dễ tuỳ chỉnh",
|
|
36
36
|
desc: "Easily adapt to your brand.",
|
|
37
37
|
bg: "bg-gradient-to-tr from-blue-500 to-cyan-500" },
|
|
38
38
|
{
|
|
39
39
|
id: 4,
|
|
40
|
-
title: "
|
|
40
|
+
title: "Mặc định Accessible",
|
|
41
41
|
desc: "Keyboard navigation out of the box.",
|
|
42
42
|
bg: "bg-gradient-to-tr from-emerald-500 to-teal-500" },
|
|
43
43
|
{
|
|
44
44
|
id: 5,
|
|
45
|
-
title: "Dark Mode
|
|
45
|
+
title: "Hỗ trợ Dark Mode",
|
|
46
46
|
desc: "Looks stunning on dark and light mode.",
|
|
47
47
|
bg: "bg-gradient-to-tr from-amber-500 to-orange-500" },
|
|
48
48
|
];
|
|
@@ -109,17 +109,11 @@ function ControlledCarouselDemo() {
|
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
// ──────────────────────────────────────────────────────────
|
|
113
|
-
// SECTION 1: Macro Content
|
|
114
|
-
// ──────────────────────────────────────────────────────────
|
|
115
112
|
function CarouselMacroShowcase() {
|
|
116
113
|
return (
|
|
117
|
-
<div className="space-y-10
|
|
114
|
+
<div className="space-y-10">
|
|
118
115
|
<ExampleGrid>
|
|
119
|
-
<
|
|
120
|
-
label="Tiêu chuẩn (Standard)"
|
|
121
|
-
description="Băng chuyền cơ bản nhất với cầu trượt."
|
|
122
|
-
codeString={`<CarouselPreset
|
|
116
|
+
<ShowcaseExample title="Tiêu chuẩn (Standard)" description="Băng chuyền cơ bản nhất với cầu trượt." code={`<CarouselPreset
|
|
123
117
|
items={[
|
|
124
118
|
{
|
|
125
119
|
id: "std-1",
|
|
@@ -155,47 +149,45 @@ function CarouselMacroShowcase() {
|
|
|
155
149
|
</div>
|
|
156
150
|
) },
|
|
157
151
|
]}
|
|
158
|
-
/>`}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
152
|
+
/>`} preview={
|
|
153
|
+
<>
|
|
154
|
+
<div className="w-full max-w-sm px-12">
|
|
155
|
+
<CarouselPreset
|
|
156
|
+
items={[
|
|
157
|
+
{
|
|
158
|
+
id: "std-1",
|
|
159
|
+
content: (
|
|
160
|
+
<div className="p-1 border border-border rounded-xl">
|
|
161
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
162
|
+
<span className="text-4xl font-semibold">1</span>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
) },
|
|
166
|
+
{
|
|
167
|
+
id: "std-2",
|
|
168
|
+
content: (
|
|
169
|
+
<div className="p-1 border border-border rounded-xl">
|
|
170
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
171
|
+
<span className="text-4xl font-semibold">2</span>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
) },
|
|
175
|
+
{
|
|
176
|
+
id: "std-3",
|
|
177
|
+
content: (
|
|
178
|
+
<div className="p-1 border border-border rounded-xl">
|
|
179
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
180
|
+
<span className="text-4xl font-semibold">3</span>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
) },
|
|
184
|
+
]}
|
|
185
|
+
/>
|
|
186
|
+
</div>
|
|
187
|
+
</>
|
|
188
|
+
} />
|
|
194
189
|
|
|
195
|
-
<
|
|
196
|
-
label="Thư viện ảnh (Image Gallery)"
|
|
197
|
-
description="Sử dụng hình ảnh thực làm nội dung slide."
|
|
198
|
-
codeString={`<CarouselPreset
|
|
190
|
+
<ShowcaseExample title="Thư viện ảnh (Image Gallery)" description="Sử dụng hình ảnh thực làm nội dung slide." code={`<CarouselPreset
|
|
199
191
|
items={[
|
|
200
192
|
{
|
|
201
193
|
id: "img-1",
|
|
@@ -225,49 +217,47 @@ function CarouselMacroShowcase() {
|
|
|
225
217
|
/>
|
|
226
218
|
) },
|
|
227
219
|
]}
|
|
228
|
-
/>`}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
220
|
+
/>`} preview={
|
|
221
|
+
<>
|
|
222
|
+
<div className="w-full max-w-sm px-12">
|
|
223
|
+
<CarouselPreset
|
|
224
|
+
items={[
|
|
225
|
+
{
|
|
226
|
+
id: "img-1",
|
|
227
|
+
content: (
|
|
228
|
+
<img
|
|
229
|
+
src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop"
|
|
230
|
+
alt="Slide 1"
|
|
231
|
+
className="rounded-xl object-cover"
|
|
232
|
+
/>
|
|
233
|
+
) },
|
|
234
|
+
{
|
|
235
|
+
id: "img-2",
|
|
236
|
+
content: (
|
|
237
|
+
<img
|
|
238
|
+
src="https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?q=80&w=600&h=400&auto=format&fit=crop"
|
|
239
|
+
alt="Slide 2"
|
|
240
|
+
className="rounded-xl object-cover"
|
|
241
|
+
/>
|
|
242
|
+
) },
|
|
243
|
+
{
|
|
244
|
+
id: "img-3",
|
|
245
|
+
content: (
|
|
246
|
+
<img
|
|
247
|
+
src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop"
|
|
248
|
+
alt="Slide 3"
|
|
249
|
+
className="rounded-xl object-cover"
|
|
250
|
+
/>
|
|
251
|
+
) },
|
|
252
|
+
]}
|
|
253
|
+
/>
|
|
254
|
+
</div>
|
|
255
|
+
</>
|
|
256
|
+
} />
|
|
264
257
|
</ExampleGrid>
|
|
265
258
|
|
|
266
259
|
<ExampleGrid>
|
|
267
|
-
<
|
|
268
|
-
label="Vòng lặp vô hạn (Loop Enabled)"
|
|
269
|
-
description="Chỉ hiển thị dấu chấm (ẩn mũi tên)."
|
|
270
|
-
codeString={`<CarouselPreset
|
|
260
|
+
<ShowcaseExample title="Vòng lặp vô hạn (Loop Enabled)" description="Chỉ hiển thị dấu chấm (ẩn mũi tên)." code={`<CarouselPreset
|
|
271
261
|
opts={{ loop: true }}
|
|
272
262
|
showArrows={false}
|
|
273
263
|
items={[
|
|
@@ -305,49 +295,47 @@ function CarouselMacroShowcase() {
|
|
|
305
295
|
</div>
|
|
306
296
|
) },
|
|
307
297
|
]}
|
|
308
|
-
/>`}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
298
|
+
/>`} preview={
|
|
299
|
+
<>
|
|
300
|
+
<div className="w-full max-w-sm">
|
|
301
|
+
<CarouselPreset
|
|
302
|
+
opts={{ loop: true }}
|
|
303
|
+
showArrows={false}
|
|
304
|
+
items={[
|
|
305
|
+
{
|
|
306
|
+
id: "loop-1",
|
|
307
|
+
content: (
|
|
308
|
+
<div className="p-1 border border-border rounded-xl">
|
|
309
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-violet-500 to-purple-500 rounded-lg text-white">
|
|
310
|
+
<span className="text-4xl font-semibold">1</span>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
) },
|
|
314
|
+
{
|
|
315
|
+
id: "loop-2",
|
|
316
|
+
content: (
|
|
317
|
+
<div className="p-1 border border-border rounded-xl">
|
|
318
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-pink-500 to-rose-500 rounded-lg text-white">
|
|
319
|
+
<span className="text-4xl font-semibold">2</span>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
) },
|
|
323
|
+
{
|
|
324
|
+
id: "loop-3",
|
|
325
|
+
content: (
|
|
326
|
+
<div className="p-1 border border-border rounded-xl">
|
|
327
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-blue-500 to-cyan-500 rounded-lg text-white">
|
|
328
|
+
<span className="text-4xl font-semibold">3</span>
|
|
329
|
+
</div>
|
|
330
|
+
</div>
|
|
331
|
+
) },
|
|
332
|
+
]}
|
|
333
|
+
/>
|
|
334
|
+
</div>
|
|
335
|
+
</>
|
|
336
|
+
} />
|
|
346
337
|
|
|
347
|
-
<
|
|
348
|
-
label="Chỉ mũi tên (Arrows Only)"
|
|
349
|
-
description="Mũi tên điều hướng không có dấu chấm."
|
|
350
|
-
codeString={`<CarouselPreset
|
|
338
|
+
<ShowcaseExample title="Chỉ mũi tên (Arrows Only)" description="Mũi tên điều hướng không có dấu chấm." code={`<CarouselPreset
|
|
351
339
|
showDots={false}
|
|
352
340
|
items={[
|
|
353
341
|
{
|
|
@@ -384,50 +372,48 @@ function CarouselMacroShowcase() {
|
|
|
384
372
|
</div>
|
|
385
373
|
) },
|
|
386
374
|
]}
|
|
387
|
-
/>`}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
375
|
+
/>`} preview={
|
|
376
|
+
<>
|
|
377
|
+
<div className="w-full max-w-sm px-12">
|
|
378
|
+
<CarouselPreset
|
|
379
|
+
showDots={false}
|
|
380
|
+
items={[
|
|
381
|
+
{
|
|
382
|
+
id: "arr-1",
|
|
383
|
+
content: (
|
|
384
|
+
<div className="p-1 border border-border rounded-xl">
|
|
385
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
386
|
+
<span className="text-4xl font-semibold">A</span>
|
|
387
|
+
</div>
|
|
388
|
+
</div>
|
|
389
|
+
) },
|
|
390
|
+
{
|
|
391
|
+
id: "arr-2",
|
|
392
|
+
content: (
|
|
393
|
+
<div className="p-1 border border-border rounded-xl">
|
|
394
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
395
|
+
<span className="text-4xl font-semibold">B</span>
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
) },
|
|
399
|
+
{
|
|
400
|
+
id: "arr-3",
|
|
401
|
+
content: (
|
|
402
|
+
<div className="p-1 border border-border rounded-xl">
|
|
403
|
+
<div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
|
|
404
|
+
<span className="text-4xl font-semibold">C</span>
|
|
405
|
+
</div>
|
|
406
|
+
</div>
|
|
407
|
+
) },
|
|
408
|
+
]}
|
|
409
|
+
/>
|
|
410
|
+
</div>
|
|
411
|
+
</>
|
|
412
|
+
} />
|
|
424
413
|
</ExampleGrid>
|
|
425
414
|
|
|
426
415
|
<ExampleGrid>
|
|
427
|
-
<
|
|
428
|
-
label="Điều khiển từ bên ngoài (Controlled Mode)"
|
|
429
|
-
description="Sử dụng biến state React để điều khiển slide."
|
|
430
|
-
codeString={`const [index, setIndex] = useState(0);
|
|
416
|
+
<ShowcaseExample title="Điều khiển từ bên ngoài (Controlled Mode)" description="Sử dụng biến state React để điều khiển slide." code={`const [index, setIndex] = useState(0);
|
|
431
417
|
|
|
432
418
|
return (
|
|
433
419
|
<CarouselPreset
|
|
@@ -435,15 +421,13 @@ return (
|
|
|
435
421
|
onIndexChange={setIndex}
|
|
436
422
|
items={[...]}
|
|
437
423
|
/>
|
|
438
|
-
);`}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
424
|
+
);`} preview={
|
|
425
|
+
<>
|
|
426
|
+
<ControlledCarouselDemo />
|
|
427
|
+
</>
|
|
428
|
+
} />
|
|
442
429
|
|
|
443
|
-
<
|
|
444
|
-
label="Theo chiều dọc (Vertical Orientation)"
|
|
445
|
-
description="Băng chuyền macro cuộn theo chiều dọc."
|
|
446
|
-
codeString={`<CarouselPreset
|
|
430
|
+
<ShowcaseExample title="Theo chiều dọc (Vertical Orientation)" description="Băng chuyền macro cuộn theo chiều dọc." code={`<CarouselPreset
|
|
447
431
|
className="w-full"
|
|
448
432
|
orientation="vertical"
|
|
449
433
|
contentClassName="h-[300px]"
|
|
@@ -471,55 +455,50 @@ return (
|
|
|
471
455
|
</div>
|
|
472
456
|
) },
|
|
473
457
|
]}
|
|
474
|
-
/>`}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
458
|
+
/>`} preview={
|
|
459
|
+
<>
|
|
460
|
+
<div className="w-full max-w-sm px-12 py-12 flex justify-center">
|
|
461
|
+
<CarouselPreset
|
|
462
|
+
className="w-full"
|
|
463
|
+
orientation="vertical"
|
|
464
|
+
contentClassName="h-[300px]"
|
|
465
|
+
itemClassName="basis-[250px]"
|
|
466
|
+
items={[
|
|
467
|
+
{
|
|
468
|
+
id: "v1",
|
|
469
|
+
content: (
|
|
470
|
+
<div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
|
|
471
|
+
A
|
|
472
|
+
</div>
|
|
473
|
+
) },
|
|
474
|
+
{
|
|
475
|
+
id: "v2",
|
|
476
|
+
content: (
|
|
477
|
+
<div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
|
|
478
|
+
B
|
|
479
|
+
</div>
|
|
480
|
+
) },
|
|
481
|
+
{
|
|
482
|
+
id: "v3",
|
|
483
|
+
content: (
|
|
484
|
+
<div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
|
|
485
|
+
C
|
|
486
|
+
</div>
|
|
487
|
+
) },
|
|
488
|
+
]}
|
|
489
|
+
/>
|
|
490
|
+
</div>
|
|
491
|
+
</>
|
|
492
|
+
} />
|
|
508
493
|
</ExampleGrid>
|
|
509
494
|
</div>
|
|
510
495
|
);
|
|
511
496
|
}
|
|
512
497
|
|
|
513
|
-
// ──────────────────────────────────────────────────────────
|
|
514
|
-
// SECTION 2: Micro Content
|
|
515
|
-
// ──────────────────────────────────────────────────────────
|
|
516
498
|
function CarouselMicroShowcase() {
|
|
517
499
|
return (
|
|
518
|
-
<div className="space-y-10
|
|
519
|
-
<
|
|
520
|
-
label="Hero Banner (Overlay Navigation)"
|
|
521
|
-
description="Mũi tên kính mờ nằm đè trên Banner, chỉ hiện khi hover. Dấu chấm nằm sát mép dưới."
|
|
522
|
-
codeString={`<Carousel
|
|
500
|
+
<div className="space-y-10">
|
|
501
|
+
<ShowcaseExample title="Hero Banner (Overlay Navigation)" description="Mũi tên kính mờ nằm đè trên Banner, chỉ hiện khi hover. Dấu chấm nằm sát mép dưới." code={`<Carousel
|
|
523
502
|
opts={{ loop: true }}
|
|
524
503
|
className="group relative w-full overflow-hidden rounded-2xl shadow-xl"
|
|
525
504
|
>
|
|
@@ -533,49 +512,47 @@ function CarouselMicroShowcase() {
|
|
|
533
512
|
<div className="absolute bottom-4 left-0 right-0 z-10">
|
|
534
513
|
<CarouselDots className="[&>[data-slot=carousel-dot][data-active]]:bg-white [&>[data-slot=carousel-dot]]:bg-white/40" />
|
|
535
514
|
</div>
|
|
536
|
-
</Carousel>`}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
515
|
+
</Carousel>`} preview={
|
|
516
|
+
<>
|
|
517
|
+
<div className="mx-auto w-full max-w-4xl">
|
|
518
|
+
<Carousel
|
|
519
|
+
opts={{ loop: true }}
|
|
520
|
+
className="group relative w-full overflow-hidden rounded-2xl shadow-xl border border-border/50"
|
|
521
|
+
>
|
|
522
|
+
<CarouselContent className="-ml-4">
|
|
523
|
+
{SLIDES.map((slide) => (
|
|
524
|
+
<CarouselItem key={slide.id} className="pl-4">
|
|
525
|
+
<div
|
|
526
|
+
className={cn(
|
|
527
|
+
"flex aspect-[21/9] flex-col items-center justify-center p-6 text-center text-white",
|
|
528
|
+
slide.bg,
|
|
529
|
+
)}
|
|
530
|
+
>
|
|
531
|
+
<h3 className="mb-2 text-3xl font-bold tracking-tight sm:text-5xl">
|
|
532
|
+
{slide.title}
|
|
533
|
+
</h3>
|
|
534
|
+
<p className="max-w-md text-sm text-white/80 sm:text-lg">
|
|
535
|
+
{slide.desc}
|
|
536
|
+
</p>
|
|
537
|
+
</div>
|
|
538
|
+
</CarouselItem>
|
|
539
|
+
))}
|
|
540
|
+
</CarouselContent>
|
|
562
541
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
542
|
+
<div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-between p-4 transition-opacity duration-300 sm:p-6 opacity-0 group-hover:opacity-100">
|
|
543
|
+
<CarouselPrevious className="pointer-events-auto backdrop-blur-md bg-background/30 hover:bg-background/50 border-white/20 text-white" />
|
|
544
|
+
<CarouselNext className="pointer-events-auto backdrop-blur-md bg-background/30 hover:bg-background/50 border-white/20 text-white" />
|
|
545
|
+
</div>
|
|
567
546
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
547
|
+
<div className="absolute bottom-4 left-0 right-0 z-10">
|
|
548
|
+
<CarouselDots className="[&>[data-slot=carousel-dot][data-active]]:bg-white [&>[data-slot=carousel-dot]]:bg-white/40 hover:[&>[data-slot=carousel-dot]]:bg-white/60" />
|
|
549
|
+
</div>
|
|
550
|
+
</Carousel>
|
|
551
|
+
</div>
|
|
552
|
+
</>
|
|
553
|
+
} />
|
|
574
554
|
|
|
575
|
-
<
|
|
576
|
-
label="Nhiều phần tử trên 1 slide (Product Gallery)"
|
|
577
|
-
description="Hiển thị nhiều Card (vd: basis-1/2, lg:basis-1/3) trên cùng một Slide của Băng chuyền."
|
|
578
|
-
codeString={`<div className="mx-auto w-full max-w-5xl px-12">
|
|
555
|
+
<ShowcaseExample title="Nhiều phần tử trên 1 slide (Product Gallery)" description="Hiển thị nhiều Card (vd: basis-1/2, lg:basis-1/3) trên cùng một Slide của Băng chuyền." code={`<div className="mx-auto w-full max-w-5xl px-12">
|
|
579
556
|
<Carousel
|
|
580
557
|
opts={{ align: "start" }}
|
|
581
558
|
className="w-full relative"
|
|
@@ -615,60 +592,58 @@ function CarouselMicroShowcase() {
|
|
|
615
592
|
<CarouselPrevious className="absolute -left-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
|
|
616
593
|
<CarouselNext className="absolute -right-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
|
|
617
594
|
</Carousel>
|
|
618
|
-
</div>`}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
595
|
+
</div>`} preview={
|
|
596
|
+
<>
|
|
597
|
+
<div className="mx-auto w-full max-w-5xl px-12">
|
|
598
|
+
<Carousel opts={{ align: "start" }} className="w-full relative">
|
|
599
|
+
<CarouselContent className="-ml-4">
|
|
600
|
+
{Array.from({ length: 10 }).map((_, index) => (
|
|
601
|
+
<CarouselItem
|
|
602
|
+
key={index}
|
|
603
|
+
className="pl-4 md:basis-1/2 lg:basis-1/3"
|
|
604
|
+
>
|
|
605
|
+
<div className="p-1">
|
|
606
|
+
<Card className="overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1">
|
|
607
|
+
<div className="aspect-4/3 bg-muted flex items-center justify-center relative group">
|
|
608
|
+
<span className="text-4xl font-black text-muted-foreground/30 transition-transform duration-500 group-hover:scale-110">
|
|
609
|
+
0{index + 1}
|
|
610
|
+
</span>
|
|
611
|
+
<div className="absolute inset-0 bg-linear-to-t from-black/60 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 flex items-end p-4">
|
|
612
|
+
<span className="text-white font-medium">
|
|
613
|
+
View Item {index + 1}
|
|
614
|
+
</span>
|
|
615
|
+
</div>
|
|
616
|
+
</div>
|
|
617
|
+
<CardContent className="p-4">
|
|
618
|
+
<div className="text-sm font-medium text-muted-foreground mb-1">
|
|
619
|
+
Category
|
|
620
|
+
</div>
|
|
621
|
+
<h4 className="font-semibold text-lg leading-none">
|
|
622
|
+
Featured Item {index + 1}
|
|
623
|
+
</h4>
|
|
624
|
+
</CardContent>
|
|
625
|
+
</Card>
|
|
626
|
+
</div>
|
|
627
|
+
</CarouselItem>
|
|
628
|
+
))}
|
|
629
|
+
</CarouselContent>
|
|
653
630
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
631
|
+
<CarouselPrevious className="absolute -left-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
|
|
632
|
+
<CarouselNext className="absolute -right-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
|
|
633
|
+
</Carousel>
|
|
634
|
+
</div>
|
|
635
|
+
</>
|
|
636
|
+
} />
|
|
659
637
|
</div>
|
|
660
638
|
);
|
|
661
639
|
}
|
|
662
640
|
|
|
663
|
-
// ──────────────────────────────────────────────────────────
|
|
664
|
-
// SECTION 3: Entry point
|
|
665
|
-
// ──────────────────────────────────────────────────────────
|
|
666
641
|
export default function CarouselShowcase() {
|
|
667
642
|
return (
|
|
668
643
|
<Showcase
|
|
669
644
|
title="Carousel"
|
|
670
645
|
description="Băng chuyền vuốt chuyển động cao cấp được xây dựng bằng Embla."
|
|
671
|
-
|
|
646
|
+
guideline={
|
|
672
647
|
<ShowcaseDocs>
|
|
673
648
|
<DocsP>
|
|
674
649
|
Dùng để duyệt qua một tập hợp các nội dung (như hình ảnh, thẻ bài,
|
|
@@ -677,10 +652,8 @@ export default function CarouselShowcase() {
|
|
|
677
652
|
</DocsP>
|
|
678
653
|
</ShowcaseDocs>
|
|
679
654
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
{ label: "Macro (Preset)", content: <CarouselMacroShowcase /> },
|
|
683
|
-
]}
|
|
655
|
+
micro={{ content: <CarouselMicroShowcase /> }}
|
|
656
|
+
macro={{ content: <CarouselMacroShowcase /> }}
|
|
684
657
|
/>
|
|
685
658
|
);
|
|
686
659
|
}
|