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
|
@@ -3,98 +3,87 @@ import {
|
|
|
3
3
|
DocsH3,
|
|
4
4
|
DocsP,
|
|
5
5
|
ExampleGrid,
|
|
6
|
-
|
|
6
|
+
ShowcaseExample,
|
|
7
7
|
Showcase,
|
|
8
8
|
ShowcaseDocs
|
|
9
9
|
} from "../../dev/components/showcase";
|
|
10
10
|
|
|
11
11
|
const commonRatios = [
|
|
12
|
-
{ label: "16:9", ratio: 16 / 9, desc: "
|
|
13
|
-
{ label: "4:3", ratio: 4 / 3, desc: "
|
|
14
|
-
{ label: "1:1", ratio: 1, desc: "
|
|
15
|
-
{ label: "21:9", ratio: 21 / 9, desc: "
|
|
16
|
-
{ label: "3:2", ratio: 3 / 2, desc: "
|
|
17
|
-
{ label: "9:16", ratio: 9 / 16, desc: "
|
|
12
|
+
{ label: "16:9", ratio: 16 / 9, desc: "Màn hình rộng — video, hero banner" },
|
|
13
|
+
{ label: "4:3", ratio: 4 / 3, desc: "Cổ điển — bài thuyết trình, TV cũ" },
|
|
14
|
+
{ label: "1:1", ratio: 1, desc: "Vuông — avatar, mạng xã hội" },
|
|
15
|
+
{ label: "21:9", ratio: 21 / 9, desc: "Siêu rộng — điện ảnh, toàn cảnh" },
|
|
16
|
+
{ label: "3:2", ratio: 3 / 2, desc: "Nhiếp ảnh — chuẩn DSLR" },
|
|
17
|
+
{ label: "9:16", ratio: 9 / 16, desc: "Chân dung — di động, story" },
|
|
18
18
|
];
|
|
19
19
|
|
|
20
20
|
function AspectRatioMicroShowcase() {
|
|
21
21
|
return (
|
|
22
|
-
<div className="space-y-10
|
|
23
|
-
{/* ── Common Ratios ── */}
|
|
22
|
+
<div className="space-y-10">
|
|
24
23
|
<ExampleGrid>
|
|
25
|
-
<
|
|
26
|
-
label="16:9"
|
|
27
|
-
description="Widescreen — dùng cho video, hero banner"
|
|
28
|
-
codeString={`<AspectRatio
|
|
24
|
+
<ShowcaseExample title="16:9" description="Widescreen — dùng cho video, hero banner" code={`<AspectRatio
|
|
29
25
|
ratio={16 / 9}
|
|
30
26
|
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-border w-full"
|
|
31
27
|
>
|
|
32
28
|
<span className="text-foreground font-mono text-lg font-semibold">
|
|
33
29
|
16:9
|
|
34
30
|
</span>
|
|
35
|
-
</AspectRatio>`}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
</AspectRatio>`} preview={
|
|
32
|
+
<>
|
|
33
|
+
<AspectRatio
|
|
34
|
+
ratio={16 / 9}
|
|
35
|
+
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-border w-full"
|
|
36
|
+
>
|
|
37
|
+
<span className="text-foreground font-mono text-lg font-semibold">
|
|
38
|
+
16:9
|
|
39
|
+
</span>
|
|
40
|
+
</AspectRatio>
|
|
41
|
+
</>
|
|
42
|
+
} />
|
|
46
43
|
|
|
47
|
-
<
|
|
48
|
-
label="4:3"
|
|
49
|
-
description="Classic — bài thuyết trình, TV cũ"
|
|
50
|
-
codeString={`<AspectRatio
|
|
44
|
+
<ShowcaseExample title="4:3" description="Classic — bài thuyết trình, TV cũ" code={`<AspectRatio
|
|
51
45
|
ratio={4 / 3}
|
|
52
46
|
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-border w-full"
|
|
53
47
|
>
|
|
54
48
|
<span className="text-foreground font-mono text-lg font-semibold">
|
|
55
49
|
4:3
|
|
56
50
|
</span>
|
|
57
|
-
</AspectRatio>`}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
</AspectRatio>`} preview={
|
|
52
|
+
<>
|
|
53
|
+
<AspectRatio
|
|
54
|
+
ratio={4 / 3}
|
|
55
|
+
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-border w-full"
|
|
56
|
+
>
|
|
57
|
+
<span className="text-foreground font-mono text-lg font-semibold">
|
|
58
|
+
4:3
|
|
59
|
+
</span>
|
|
60
|
+
</AspectRatio>
|
|
61
|
+
</>
|
|
62
|
+
} />
|
|
68
63
|
|
|
69
|
-
<
|
|
70
|
-
label="1:1"
|
|
71
|
-
description="Vuông — avatar, social media"
|
|
72
|
-
codeString={`<AspectRatio
|
|
64
|
+
<ShowcaseExample title="1:1" description="Vuông — avatar, social media" code={`<AspectRatio
|
|
73
65
|
ratio={1}
|
|
74
66
|
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-border w-full"
|
|
75
67
|
>
|
|
76
68
|
<span className="text-foreground font-mono text-lg font-semibold">
|
|
77
69
|
1:1
|
|
78
70
|
</span>
|
|
79
|
-
</AspectRatio>`}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
</AspectRatio>`} preview={
|
|
72
|
+
<>
|
|
73
|
+
<AspectRatio
|
|
74
|
+
ratio={1}
|
|
75
|
+
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-border w-full"
|
|
76
|
+
>
|
|
77
|
+
<span className="text-foreground font-mono text-lg font-semibold">
|
|
78
|
+
1:1
|
|
79
|
+
</span>
|
|
80
|
+
</AspectRatio>
|
|
81
|
+
</>
|
|
82
|
+
} />
|
|
90
83
|
</ExampleGrid>
|
|
91
84
|
|
|
92
|
-
{/* ── With Image ── */}
|
|
93
85
|
<ExampleGrid>
|
|
94
|
-
<
|
|
95
|
-
label="16:9 Image"
|
|
96
|
-
description="Tỷ lệ khung hình hạn chế hình ảnh 16:9."
|
|
97
|
-
codeString={`<AspectRatio
|
|
86
|
+
<ShowcaseExample title="16:9 Image" description="Tỷ lệ khung hình hạn chế hình ảnh 16:9." code={`<AspectRatio
|
|
98
87
|
ratio={16 / 9}
|
|
99
88
|
className="rounded-xl overflow-hidden w-full"
|
|
100
89
|
>
|
|
@@ -103,24 +92,22 @@ function AspectRatioMicroShowcase() {
|
|
|
103
92
|
alt="Landscape photo"
|
|
104
93
|
className="w-full h-full object-cover"
|
|
105
94
|
/>
|
|
106
|
-
</AspectRatio>`}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
95
|
+
</AspectRatio>`} preview={
|
|
96
|
+
<>
|
|
97
|
+
<AspectRatio
|
|
98
|
+
ratio={16 / 9}
|
|
99
|
+
className="rounded-xl overflow-hidden w-full"
|
|
100
|
+
>
|
|
101
|
+
<img
|
|
102
|
+
src="https://images.unsplash.com/photo-1588345921523-c2dcdb7f1dcd?w=800&dpr=2&q=80"
|
|
103
|
+
alt="Landscape photo"
|
|
104
|
+
className="w-full h-full object-cover"
|
|
105
|
+
/>
|
|
106
|
+
</AspectRatio>
|
|
107
|
+
</>
|
|
108
|
+
} />
|
|
119
109
|
|
|
120
|
-
<
|
|
121
|
-
label="1:1 Image"
|
|
122
|
-
description="Tỷ lệ khung hình vuông cho avatar hoặc social post."
|
|
123
|
-
codeString={`<AspectRatio
|
|
110
|
+
<ShowcaseExample title="1:1 Image" description="Tỷ lệ khung hình vuông cho avatar hoặc social post." code={`<AspectRatio
|
|
124
111
|
ratio={1}
|
|
125
112
|
className="rounded-xl overflow-hidden w-full"
|
|
126
113
|
>
|
|
@@ -129,24 +116,21 @@ function AspectRatioMicroShowcase() {
|
|
|
129
116
|
alt="Square cropped photo"
|
|
130
117
|
className="w-full h-full object-cover"
|
|
131
118
|
/>
|
|
132
|
-
</AspectRatio>`}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
119
|
+
</AspectRatio>`} preview={
|
|
120
|
+
<>
|
|
121
|
+
<AspectRatio ratio={1} className="rounded-xl overflow-hidden w-full">
|
|
122
|
+
<img
|
|
123
|
+
src="https://images.unsplash.com/photo-1588345921523-c2dcdb7f1dcd?w=800&dpr=2&q=80"
|
|
124
|
+
alt="Square cropped photo"
|
|
125
|
+
className="w-full h-full object-cover"
|
|
126
|
+
/>
|
|
127
|
+
</AspectRatio>
|
|
128
|
+
</>
|
|
129
|
+
} />
|
|
142
130
|
</ExampleGrid>
|
|
143
131
|
|
|
144
|
-
{/* ── Map / Embed placeholder ── */}
|
|
145
132
|
<ExampleGrid>
|
|
146
|
-
<
|
|
147
|
-
label="Video Embed"
|
|
148
|
-
description="Duy trì tỷ lệ 16:9 cho video nhúng."
|
|
149
|
-
codeString={`<AspectRatio
|
|
133
|
+
<ShowcaseExample title="Video Embed" description="Duy trì tỷ lệ 16:9 cho video nhúng." code={`<AspectRatio
|
|
150
134
|
ratio={16 / 9}
|
|
151
135
|
className="rounded-xl overflow-hidden bg-muted border border-border w-full"
|
|
152
136
|
>
|
|
@@ -167,34 +151,32 @@ function AspectRatioMicroShowcase() {
|
|
|
167
151
|
iframe / video
|
|
168
152
|
</span>
|
|
169
153
|
</div>
|
|
170
|
-
</AspectRatio>`}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
154
|
+
</AspectRatio>`} preview={
|
|
155
|
+
<>
|
|
156
|
+
<AspectRatio
|
|
157
|
+
ratio={16 / 9}
|
|
158
|
+
className="rounded-xl overflow-hidden bg-muted border border-border w-full"
|
|
159
|
+
>
|
|
160
|
+
<div className="w-full h-full flex flex-col items-center justify-center gap-2 text-muted-foreground">
|
|
161
|
+
<svg
|
|
162
|
+
width="48"
|
|
163
|
+
height="48"
|
|
164
|
+
viewBox="0 0 24 24"
|
|
165
|
+
fill="none"
|
|
166
|
+
stroke="currentColor"
|
|
167
|
+
strokeWidth="1.5"
|
|
168
|
+
strokeLinecap="round"
|
|
169
|
+
strokeLinejoin="round"
|
|
170
|
+
>
|
|
171
|
+
<polygon points="5 3 19 12 5 21 5 3" />
|
|
172
|
+
</svg>
|
|
173
|
+
<span className="text-xs font-mono">iframe / video</span>
|
|
174
|
+
</div>
|
|
175
|
+
</AspectRatio>
|
|
176
|
+
</>
|
|
177
|
+
} />
|
|
193
178
|
|
|
194
|
-
<
|
|
195
|
-
label="Map Embed"
|
|
196
|
-
description="Duy trì tỷ lệ 4:3 cho bản đồ nhúng."
|
|
197
|
-
codeString={`<AspectRatio
|
|
179
|
+
<ShowcaseExample title="Map Embed" description="Duy trì tỷ lệ 4:3 cho bản đồ nhúng." code={`<AspectRatio
|
|
198
180
|
ratio={4 / 3}
|
|
199
181
|
className="rounded-xl overflow-hidden bg-muted border border-border w-full"
|
|
200
182
|
>
|
|
@@ -217,98 +199,92 @@ function AspectRatioMicroShowcase() {
|
|
|
217
199
|
map / iframe
|
|
218
200
|
</span>
|
|
219
201
|
</div>
|
|
220
|
-
</AspectRatio>`}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
202
|
+
</AspectRatio>`} preview={
|
|
203
|
+
<>
|
|
204
|
+
<AspectRatio
|
|
205
|
+
ratio={4 / 3}
|
|
206
|
+
className="rounded-xl overflow-hidden bg-muted border border-border w-full"
|
|
207
|
+
>
|
|
208
|
+
<div className="w-full h-full flex flex-col items-center justify-center gap-2 text-muted-foreground">
|
|
209
|
+
<svg
|
|
210
|
+
width="48"
|
|
211
|
+
height="48"
|
|
212
|
+
viewBox="0 0 24 24"
|
|
213
|
+
fill="none"
|
|
214
|
+
stroke="currentColor"
|
|
215
|
+
strokeWidth="1.5"
|
|
216
|
+
strokeLinecap="round"
|
|
217
|
+
strokeLinejoin="round"
|
|
218
|
+
>
|
|
219
|
+
<polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6" />
|
|
220
|
+
<line x1="8" y1="2" x2="8" y2="18" />
|
|
221
|
+
<line x1="16" y1="6" x2="16" y2="22" />
|
|
222
|
+
</svg>
|
|
223
|
+
<span className="text-xs font-mono">map / iframe</span>
|
|
224
|
+
</div>
|
|
225
|
+
</AspectRatio>
|
|
226
|
+
</>
|
|
227
|
+
} />
|
|
245
228
|
</ExampleGrid>
|
|
246
229
|
|
|
247
|
-
{/* ── Custom Ratio ── */}
|
|
248
230
|
<ExampleGrid>
|
|
249
|
-
<
|
|
250
|
-
label="Ratio 2.35"
|
|
251
|
-
description="Custom ratio 2.35"
|
|
252
|
-
codeString={`<AspectRatio
|
|
231
|
+
<ShowcaseExample title="Ratio 2.35" description="Custom ratio 2.35" code={`<AspectRatio
|
|
253
232
|
ratio={2.35}
|
|
254
233
|
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-dashed border-border w-full"
|
|
255
234
|
>
|
|
256
235
|
<span className="text-muted-foreground font-mono text-sm">
|
|
257
236
|
ratio={2.35}
|
|
258
237
|
</span>
|
|
259
|
-
</AspectRatio>`}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
description="Custom ratio 1.85"
|
|
273
|
-
codeString={`<AspectRatio
|
|
238
|
+
</AspectRatio>`} preview={
|
|
239
|
+
<>
|
|
240
|
+
<AspectRatio
|
|
241
|
+
ratio={2.35}
|
|
242
|
+
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-dashed border-border w-full"
|
|
243
|
+
>
|
|
244
|
+
<span className="text-muted-foreground font-mono text-sm">
|
|
245
|
+
ratio={2.35}
|
|
246
|
+
</span>
|
|
247
|
+
</AspectRatio>
|
|
248
|
+
</>
|
|
249
|
+
} />
|
|
250
|
+
<ShowcaseExample title="Ratio 1.85" description="Custom ratio 1.85" code={`<AspectRatio
|
|
274
251
|
ratio={1.85}
|
|
275
252
|
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-dashed border-border w-full"
|
|
276
253
|
>
|
|
277
254
|
<span className="text-muted-foreground font-mono text-sm">
|
|
278
255
|
ratio={1.85}
|
|
279
256
|
</span>
|
|
280
|
-
</AspectRatio>`}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
description="Custom ratio 0.8"
|
|
294
|
-
codeString={`<AspectRatio
|
|
257
|
+
</AspectRatio>`} preview={
|
|
258
|
+
<>
|
|
259
|
+
<AspectRatio
|
|
260
|
+
ratio={1.85}
|
|
261
|
+
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-dashed border-border w-full"
|
|
262
|
+
>
|
|
263
|
+
<span className="text-muted-foreground font-mono text-sm">
|
|
264
|
+
ratio={1.85}
|
|
265
|
+
</span>
|
|
266
|
+
</AspectRatio>
|
|
267
|
+
</>
|
|
268
|
+
} />
|
|
269
|
+
<ShowcaseExample title="Ratio 0.8" description="Custom ratio 0.8" code={`<AspectRatio
|
|
295
270
|
ratio={0.8}
|
|
296
271
|
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-dashed border-border w-full"
|
|
297
272
|
>
|
|
298
273
|
<span className="text-muted-foreground font-mono text-sm">
|
|
299
274
|
ratio={0.8}
|
|
300
275
|
</span>
|
|
301
|
-
</AspectRatio>`}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
276
|
+
</AspectRatio>`} preview={
|
|
277
|
+
<>
|
|
278
|
+
<AspectRatio
|
|
279
|
+
ratio={0.8}
|
|
280
|
+
className="bg-muted rounded-xl overflow-hidden flex items-center justify-center border border-dashed border-border w-full"
|
|
281
|
+
>
|
|
282
|
+
<span className="text-muted-foreground font-mono text-sm">
|
|
283
|
+
ratio={0.8}
|
|
284
|
+
</span>
|
|
285
|
+
</AspectRatio>
|
|
286
|
+
</>
|
|
287
|
+
} />
|
|
312
288
|
</ExampleGrid>
|
|
313
289
|
</div>
|
|
314
290
|
);
|
|
@@ -319,7 +295,7 @@ export default function AspectRatioShowcase() {
|
|
|
319
295
|
<Showcase
|
|
320
296
|
title="Aspect Ratio"
|
|
321
297
|
description="Hiển thị nội dung theo tỷ lệ mong muốn. Hữu ích cho hình ảnh, video, bản đồ và phương tiện nhúng."
|
|
322
|
-
|
|
298
|
+
guideline={
|
|
323
299
|
<ShowcaseDocs>
|
|
324
300
|
<DocsH3>Aspect Ratio</DocsH3>
|
|
325
301
|
<DocsP>
|
|
@@ -328,9 +304,7 @@ export default function AspectRatioShowcase() {
|
|
|
328
304
|
</DocsP>
|
|
329
305
|
</ShowcaseDocs>
|
|
330
306
|
}
|
|
331
|
-
|
|
332
|
-
{ label: "Micro (Primitive)", content: <AspectRatioMicroShowcase /> },
|
|
333
|
-
]}
|
|
307
|
+
micro={{ content: <AspectRatioMicroShowcase /> }}
|
|
334
308
|
/>
|
|
335
309
|
);
|
|
336
310
|
}
|