gladvn 0.2.35 → 0.2.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +2 -1
- package/scripts/strip-comments.ts +79 -0
- package/src/blocks/auth-form.tsx +34 -30
- package/src/blocks/auth-recovery.tsx +9 -13
- package/src/blocks/auth-split.tsx +46 -36
- package/src/blocks/settings.tsx +84 -117
- package/src/components/macro/alert-preset.tsx +3 -1
- package/src/components/macro/carousel-preset.tsx +0 -1
- package/src/components/macro/checkbox-preset.test.tsx +2 -2
- package/src/components/macro/checkbox-preset.tsx +1 -2
- package/src/components/macro/command-preset.tsx +1 -1
- package/src/components/macro/date-picker.tsx +5 -18
- package/src/components/macro/dialog-preset.tsx +5 -3
- package/src/components/macro/input-preset.tsx +0 -1
- package/src/components/macro/select-preset.tsx +1 -1
- package/src/components/macro/switch-preset.test.tsx +1 -1
- package/src/components/micro/accordion.test.tsx +6 -12
- package/src/components/micro/alert-dialog.tsx +0 -2
- package/src/components/micro/alert.test.tsx +5 -8
- package/src/components/micro/alert.tsx +0 -2
- package/src/components/micro/badge.test.tsx +5 -7
- package/src/components/micro/badge.tsx +1 -3
- package/src/components/micro/button.test.tsx +19 -26
- package/src/components/micro/button.tsx +3 -11
- package/src/components/micro/calendar.tsx +12 -13
- package/src/components/micro/card.test.tsx +3 -5
- package/src/components/micro/carousel.tsx +0 -1
- package/src/components/micro/chart.tsx +3 -2
- package/src/components/micro/checkbox.test.tsx +9 -18
- package/src/components/micro/combobox.tsx +1 -3
- package/src/components/micro/command.tsx +23 -11
- package/src/components/micro/context-menu.tsx +0 -2
- package/src/components/micro/dialog.test.tsx +6 -14
- package/src/components/micro/dialog.tsx +0 -2
- package/src/components/micro/drawer.tsx +0 -3
- package/src/components/micro/dropdown-menu.test.tsx +8 -14
- package/src/components/micro/dropdown-menu.tsx +0 -2
- package/src/components/micro/field.tsx +3 -3
- package/src/components/micro/hover-card.tsx +0 -2
- package/src/components/micro/input-group.tsx +9 -42
- package/src/components/micro/input.test.tsx +15 -24
- package/src/components/micro/navigation-menu.tsx +0 -2
- package/src/components/micro/popover.test.tsx +5 -9
- package/src/components/micro/progress.tsx +5 -1
- package/src/components/micro/select.test.tsx +5 -18
- package/src/components/micro/select.tsx +3 -5
- package/src/components/micro/separator.tsx +1 -1
- package/src/components/micro/sheet.test.tsx +6 -14
- package/src/components/micro/sheet.tsx +0 -2
- package/src/components/micro/sidebar.tsx +5 -6
- package/src/components/micro/sonner.tsx +0 -1
- package/src/components/micro/switch.test.tsx +9 -18
- package/src/components/micro/switch.tsx +1 -1
- package/src/components/micro/tabs.test.tsx +5 -11
- package/src/components/micro/theme-provider.tsx +0 -12
- package/src/components/micro/toggle-group.tsx +1 -12
- package/src/components/micro/tooltip.test.tsx +7 -12
- package/src/dev/App.tsx +6 -6
- package/src/dev/components/BlockViewer.tsx +15 -4
- package/src/dev/components/Container.tsx +20 -0
- package/src/dev/components/GladvnLogo.tsx +3 -9
- package/src/dev/components/code-highlighter.tsx +5 -3
- package/src/dev/components/showcase.tsx +116 -168
- package/src/dev/sections/buttons.tsx +4 -9
- package/src/dev/sections/display.tsx +68 -72
- package/src/dev/sections/feedback.tsx +304 -314
- package/src/dev/sections/forms.tsx +10 -14
- package/src/dev/sections/interactive.tsx +32 -32
- package/src/dev/sections/overview.tsx +2 -10
- package/src/dev/showcase/accordion.tsx +512 -554
- package/src/dev/showcase/alert-dialog.tsx +525 -565
- package/src/dev/showcase/alert.tsx +352 -402
- package/src/dev/showcase/aspect-ratio.tsx +167 -193
- package/src/dev/showcase/avatar.tsx +231 -269
- package/src/dev/showcase/badge.tsx +92 -140
- package/src/dev/showcase/breadcrumb.tsx +113 -135
- package/src/dev/showcase/button.tsx +140 -173
- package/src/dev/showcase/calendar.tsx +187 -237
- package/src/dev/showcase/card.tsx +229 -261
- package/src/dev/showcase/carousel.tsx +288 -315
- package/src/dev/showcase/chart.tsx +44 -50
- package/src/dev/showcase/checkbox.tsx +286 -330
- package/src/dev/showcase/collapsible.tsx +143 -160
- package/src/dev/showcase/combobox.tsx +327 -369
- package/src/dev/showcase/command.tsx +106 -120
- package/src/dev/showcase/context-menu.tsx +93 -107
- package/src/dev/showcase/dialog.tsx +585 -630
- package/src/dev/showcase/drawer.tsx +176 -196
- package/src/dev/showcase/dropdown-menu.tsx +183 -201
- package/src/dev/showcase/empty.tsx +232 -274
- package/src/dev/showcase/hover-card.tsx +153 -180
- package/src/dev/showcase/input-group.tsx +221 -253
- package/src/dev/showcase/input-otp.tsx +204 -250
- package/src/dev/showcase/input.tsx +246 -325
- package/src/dev/showcase/item.tsx +134 -152
- package/src/dev/showcase/kbd.tsx +149 -172
- package/src/dev/showcase/label.tsx +50 -68
- package/src/dev/showcase/menubar.tsx +194 -213
- package/src/dev/showcase/navigation-menu.tsx +119 -133
- package/src/dev/showcase/overview-components/ArchitectureSection.tsx +126 -0
- package/src/dev/showcase/overview-components/CodeBlock.tsx +50 -0
- package/src/dev/showcase/overview-components/ColorPaletteSection.tsx +44 -0
- package/src/dev/showcase/overview-components/DashboardPreview.tsx +159 -0
- package/src/dev/showcase/overview-components/FeatureGridSection.tsx +535 -0
- package/src/dev/showcase/overview-components/FooterCTA.tsx +137 -0
- package/src/dev/showcase/overview-components/HeroSection.tsx +65 -0
- package/src/dev/showcase/overview-components/PrinciplesSection.tsx +128 -0
- package/src/dev/showcase/overview.tsx +21 -1163
- package/src/dev/showcase/pagination.tsx +144 -190
- package/src/dev/showcase/popover.tsx +181 -196
- package/src/dev/showcase/progress.tsx +141 -189
- package/src/dev/showcase/radio-group.tsx +272 -332
- package/src/dev/showcase/resizable.tsx +119 -141
- package/src/dev/showcase/scroll-area.tsx +21 -36
- package/src/dev/showcase/select.tsx +262 -322
- package/src/dev/showcase/separator.tsx +75 -73
- package/src/dev/showcase/sheet.tsx +333 -361
- package/src/dev/showcase/sidebar.tsx +53 -59
- package/src/dev/showcase/skeleton.tsx +93 -112
- package/src/dev/showcase/slider.tsx +244 -296
- package/src/dev/showcase/sonner.tsx +251 -258
- package/src/dev/showcase/spinner.tsx +46 -67
- package/src/dev/showcase/switch.tsx +298 -362
- package/src/dev/showcase/table.tsx +76 -80
- package/src/dev/showcase/tabs.tsx +302 -355
- package/src/dev/showcase/textarea.tsx +240 -293
- package/src/dev/showcase/toast.tsx +48 -54
- package/src/dev/showcase/toggle-group.tsx +104 -129
- package/src/dev/showcase/toggle.tsx +82 -102
- package/src/dev/showcase/tooltip.tsx +173 -192
- package/src/dev/showcase/why.tsx +6 -12
- package/src/hooks/use-mobile.test.ts +3 -2
- package/src/lib/utils.test.ts +5 -4
|
@@ -21,25 +21,18 @@ import {
|
|
|
21
21
|
DocsCode,
|
|
22
22
|
DocsP,
|
|
23
23
|
ExampleGrid,
|
|
24
|
-
|
|
24
|
+
ShowcaseExample,
|
|
25
25
|
Showcase,
|
|
26
26
|
ShowcaseDocs
|
|
27
27
|
} from "../../dev/components/showcase";
|
|
28
28
|
import { type Size } from "../../lib/types";
|
|
29
29
|
|
|
30
|
-
// ──────────────────────────────────────────────────────────
|
|
31
|
-
// SECTION 2: Micro Content (không export)
|
|
32
|
-
// ──────────────────────────────────────────────────────────
|
|
33
30
|
function SheetMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
34
31
|
const [open, setOpen] = useState(false);
|
|
35
32
|
|
|
36
33
|
return (
|
|
37
|
-
<div className="space-y-10
|
|
38
|
-
|
|
39
|
-
<ExampleSection
|
|
40
|
-
label="Hướng trượt (Side)"
|
|
41
|
-
description="Sheet có thể trượt ra từ bốn cạnh: right (mặc định), left, top, bottom."
|
|
42
|
-
codeString={`<Sheet>
|
|
34
|
+
<div className="space-y-10">
|
|
35
|
+
<ShowcaseExample title="Hướng trượt (Side)" description="Sheet có thể trượt ra từ bốn cạnh: right (mặc định), left, top, bottom." code={`<Sheet>
|
|
43
36
|
<SheetTrigger
|
|
44
37
|
render={
|
|
45
38
|
<Button variant="outline" className="capitalize">
|
|
@@ -92,217 +85,210 @@ function SheetMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
92
85
|
</SheetFooter>
|
|
93
86
|
</SheetContent>
|
|
94
87
|
|
|
95
|
-
</Sheet>`}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</SheetTrigger>
|
|
88
|
+
</Sheet>`} preview={
|
|
89
|
+
<>
|
|
90
|
+
<div className="grid grid-cols-2 gap-2">
|
|
91
|
+
<Sheet>
|
|
92
|
+
<SheetTrigger
|
|
93
|
+
render={
|
|
94
|
+
<Button
|
|
95
|
+
variant="outline"
|
|
96
|
+
size={globalSize}
|
|
97
|
+
className="w-full"
|
|
98
|
+
/>
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
top
|
|
102
|
+
</SheetTrigger>
|
|
111
103
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
104
|
+
<SheetContent side="top">
|
|
105
|
+
<SheetHeader>
|
|
106
|
+
<SheetTitle>Edit Profile</SheetTitle>
|
|
107
|
+
<SheetDescription>
|
|
108
|
+
Thay đổi thông tin tài khoản của bạn và nhấn Lưu.
|
|
109
|
+
</SheetDescription>
|
|
110
|
+
</SheetHeader>
|
|
111
|
+
<div className="grid gap-4 py-4 px-4">
|
|
112
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
113
|
+
<Label htmlFor="name-top" className="text-right">
|
|
114
|
+
Tên
|
|
115
|
+
</Label>
|
|
116
|
+
<Input
|
|
117
|
+
id="name-top"
|
|
118
|
+
defaultValue="Pedro Duarte"
|
|
119
|
+
className="col-span-3"
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
<SheetFooter>
|
|
124
|
+
<SheetClose
|
|
125
|
+
render={<Button variant="outline" size={globalSize} />}
|
|
126
|
+
>
|
|
127
|
+
Huỷ
|
|
128
|
+
</SheetClose>
|
|
129
|
+
<Button size={globalSize}>Lưu thay đổi</Button>
|
|
130
|
+
</SheetFooter>
|
|
131
|
+
</SheetContent>
|
|
132
|
+
|
|
133
|
+
</Sheet>
|
|
142
134
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
</SheetTrigger>
|
|
135
|
+
<Sheet>
|
|
136
|
+
<SheetTrigger
|
|
137
|
+
render={
|
|
138
|
+
<Button
|
|
139
|
+
variant="outline"
|
|
140
|
+
size={globalSize}
|
|
141
|
+
className="w-full"
|
|
142
|
+
/>
|
|
143
|
+
}
|
|
144
|
+
>
|
|
145
|
+
right
|
|
146
|
+
</SheetTrigger>
|
|
156
147
|
|
|
157
|
-
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
148
|
+
<SheetContent side="right">
|
|
149
|
+
<SheetHeader>
|
|
150
|
+
<SheetTitle>Edit Profile</SheetTitle>
|
|
151
|
+
<SheetDescription>
|
|
152
|
+
Thay đổi thông tin tài khoản của bạn và nhấn Lưu.
|
|
153
|
+
</SheetDescription>
|
|
154
|
+
</SheetHeader>
|
|
155
|
+
<div className="grid gap-4 py-4 px-4">
|
|
156
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
157
|
+
<Label htmlFor="name-right" className="text-right">
|
|
158
|
+
Tên
|
|
159
|
+
</Label>
|
|
160
|
+
<Input
|
|
161
|
+
id="name-right"
|
|
162
|
+
defaultValue="Pedro Duarte"
|
|
163
|
+
className="col-span-3"
|
|
164
|
+
/>
|
|
165
|
+
</div>
|
|
166
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
167
|
+
<Label htmlFor="username-right" className="text-right">
|
|
168
|
+
Username
|
|
169
|
+
</Label>
|
|
170
|
+
<Input
|
|
171
|
+
id="username-right"
|
|
172
|
+
defaultValue="@peduarte"
|
|
173
|
+
className="col-span-3"
|
|
174
|
+
/>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
<SheetFooter>
|
|
178
|
+
<SheetClose
|
|
179
|
+
render={<Button variant="outline" size={globalSize} />}
|
|
180
|
+
>
|
|
181
|
+
Huỷ
|
|
182
|
+
</SheetClose>
|
|
183
|
+
<Button size={globalSize}>Lưu thay đổi</Button>
|
|
184
|
+
</SheetFooter>
|
|
185
|
+
</SheetContent>
|
|
186
|
+
|
|
187
|
+
</Sheet>
|
|
197
188
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
</SheetTrigger>
|
|
189
|
+
<Sheet>
|
|
190
|
+
<SheetTrigger
|
|
191
|
+
render={
|
|
192
|
+
<Button
|
|
193
|
+
variant="outline"
|
|
194
|
+
size={globalSize}
|
|
195
|
+
className="w-full"
|
|
196
|
+
/>
|
|
197
|
+
}
|
|
198
|
+
>
|
|
199
|
+
bottom
|
|
200
|
+
</SheetTrigger>
|
|
211
201
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
202
|
+
<SheetContent side="bottom">
|
|
203
|
+
<SheetHeader>
|
|
204
|
+
<SheetTitle>Edit Profile</SheetTitle>
|
|
205
|
+
<SheetDescription>
|
|
206
|
+
Thay đổi thông tin tài khoản của bạn và nhấn Lưu.
|
|
207
|
+
</SheetDescription>
|
|
208
|
+
</SheetHeader>
|
|
209
|
+
<div className="grid gap-4 py-4 px-4">
|
|
210
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
211
|
+
<Label htmlFor="name-bottom" className="text-right">
|
|
212
|
+
Tên
|
|
213
|
+
</Label>
|
|
214
|
+
<Input
|
|
215
|
+
id="name-bottom"
|
|
216
|
+
defaultValue="Pedro Duarte"
|
|
217
|
+
className="col-span-3"
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
<SheetFooter>
|
|
222
|
+
<SheetClose
|
|
223
|
+
render={<Button variant="outline" size={globalSize} />}
|
|
224
|
+
>
|
|
225
|
+
Huỷ
|
|
226
|
+
</SheetClose>
|
|
227
|
+
<Button size={globalSize}>Lưu thay đổi</Button>
|
|
228
|
+
</SheetFooter>
|
|
229
|
+
</SheetContent>
|
|
230
|
+
|
|
231
|
+
</Sheet>
|
|
242
232
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
</SheetTrigger>
|
|
233
|
+
<Sheet>
|
|
234
|
+
<SheetTrigger
|
|
235
|
+
render={
|
|
236
|
+
<Button
|
|
237
|
+
variant="outline"
|
|
238
|
+
size={globalSize}
|
|
239
|
+
className="w-full"
|
|
240
|
+
/>
|
|
241
|
+
}
|
|
242
|
+
>
|
|
243
|
+
left
|
|
244
|
+
</SheetTrigger>
|
|
256
245
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
246
|
+
<SheetContent side="left">
|
|
247
|
+
<SheetHeader>
|
|
248
|
+
<SheetTitle>Edit Profile</SheetTitle>
|
|
249
|
+
<SheetDescription>
|
|
250
|
+
Thay đổi thông tin tài khoản của bạn và nhấn Lưu.
|
|
251
|
+
</SheetDescription>
|
|
252
|
+
</SheetHeader>
|
|
253
|
+
<div className="grid gap-4 py-4 px-4">
|
|
254
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
255
|
+
<Label htmlFor="name-left" className="text-right">
|
|
256
|
+
Tên
|
|
257
|
+
</Label>
|
|
258
|
+
<Input
|
|
259
|
+
id="name-left"
|
|
260
|
+
defaultValue="Pedro Duarte"
|
|
261
|
+
className="col-span-3"
|
|
262
|
+
/>
|
|
263
|
+
</div>
|
|
264
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
265
|
+
<Label htmlFor="username-left" className="text-right">
|
|
266
|
+
Username
|
|
267
|
+
</Label>
|
|
268
|
+
<Input
|
|
269
|
+
id="username-left"
|
|
270
|
+
defaultValue="@peduarte"
|
|
271
|
+
className="col-span-3"
|
|
272
|
+
/>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
<SheetFooter>
|
|
276
|
+
<SheetClose
|
|
277
|
+
render={<Button variant="outline" size={globalSize} />}
|
|
278
|
+
>
|
|
279
|
+
Huỷ
|
|
280
|
+
</SheetClose>
|
|
281
|
+
<Button size={globalSize}>Lưu thay đổi</Button>
|
|
282
|
+
</SheetFooter>
|
|
283
|
+
</SheetContent>
|
|
284
|
+
|
|
285
|
+
</Sheet>
|
|
274
286
|
</div>
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
Username
|
|
278
|
-
</Label>
|
|
279
|
-
<Input
|
|
280
|
-
id="username-left"
|
|
281
|
-
defaultValue="@peduarte"
|
|
282
|
-
className="col-span-3"
|
|
283
|
-
/>
|
|
284
|
-
</div>
|
|
285
|
-
</div>
|
|
286
|
-
<SheetFooter>
|
|
287
|
-
<SheetClose
|
|
288
|
-
render={<Button variant="outline" size={globalSize} />}
|
|
289
|
-
>
|
|
290
|
-
Huỷ
|
|
291
|
-
</SheetClose>
|
|
292
|
-
<Button size={globalSize}>Lưu thay đổi</Button>
|
|
293
|
-
</SheetFooter>
|
|
294
|
-
</SheetContent>
|
|
295
|
-
|
|
296
|
-
</Sheet>
|
|
297
|
-
</div>
|
|
298
|
-
</ExampleSection>
|
|
287
|
+
</>
|
|
288
|
+
} />
|
|
299
289
|
|
|
300
|
-
{/* ── showCloseButton ── */}
|
|
301
290
|
<ExampleGrid>
|
|
302
|
-
<
|
|
303
|
-
label="Có nút đóng (mặc định)"
|
|
304
|
-
description="showCloseButton={true} — nút X tự động hiển thị ở góc trên phải."
|
|
305
|
-
codeString={`<Sheet>
|
|
291
|
+
<ShowcaseExample title="Có nút đóng (mặc định)" description="showCloseButton={true} — nút X tự động hiển thị ở góc trên phải." code={`<Sheet>
|
|
306
292
|
<SheetTrigger render={<Button variant="outline" />}>
|
|
307
293
|
<PanelRightIcon />
|
|
308
294
|
Mở Sheet
|
|
@@ -317,30 +303,28 @@ function SheetMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
317
303
|
</SheetHeader>
|
|
318
304
|
</SheetContent>
|
|
319
305
|
|
|
320
|
-
</Sheet>`}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
306
|
+
</Sheet>`} preview={
|
|
307
|
+
<>
|
|
308
|
+
<Sheet>
|
|
309
|
+
<SheetTrigger
|
|
310
|
+
render={<Button variant="outline" size={globalSize} />}
|
|
311
|
+
>
|
|
312
|
+
<PanelRightIcon aria-hidden="true" />
|
|
313
|
+
Mở Sheet
|
|
314
|
+
</SheetTrigger>
|
|
329
315
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
316
|
+
<SheetContent side="right">
|
|
317
|
+
<SheetHeader>
|
|
318
|
+
<SheetTitle>Có nút đóng</SheetTitle>
|
|
319
|
+
<SheetDescription>Nút X xuất hiện tự động.</SheetDescription>
|
|
320
|
+
</SheetHeader>
|
|
321
|
+
</SheetContent>
|
|
322
|
+
|
|
323
|
+
</Sheet>
|
|
324
|
+
</>
|
|
325
|
+
} />
|
|
339
326
|
|
|
340
|
-
<
|
|
341
|
-
label="Ẩn nút đóng"
|
|
342
|
-
description="showCloseButton={false} — dùng khi muốn tự control nút đóng bên trong nội dung."
|
|
343
|
-
codeString={`<Sheet>
|
|
327
|
+
<ShowcaseExample title="Ẩn nút đóng" description="showCloseButton={false} — dùng khi muốn tự control nút đóng bên trong nội dung." code={`<Sheet>
|
|
344
328
|
<SheetTrigger render={<Button variant="outline" />}>
|
|
345
329
|
<PanelRightIcon />
|
|
346
330
|
Không có X
|
|
@@ -367,47 +351,44 @@ function SheetMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
367
351
|
</SheetFooter>
|
|
368
352
|
</SheetContent>
|
|
369
353
|
|
|
370
|
-
</Sheet>`}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
354
|
+
</Sheet>`} preview={
|
|
355
|
+
<>
|
|
356
|
+
<Sheet>
|
|
357
|
+
<SheetTrigger
|
|
358
|
+
render={<Button variant="outline" size={globalSize} />}
|
|
359
|
+
>
|
|
360
|
+
<PanelRightIcon aria-hidden="true" />
|
|
361
|
+
Không có X
|
|
362
|
+
</SheetTrigger>
|
|
379
363
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
364
|
+
<SheetContent side="right" showCloseButton={false}>
|
|
365
|
+
<SheetHeader>
|
|
366
|
+
<SheetTitle>Ẩn nút đóng</SheetTitle>
|
|
367
|
+
<SheetDescription>
|
|
368
|
+
Consumer tự render nút đóng trong footer.
|
|
369
|
+
</SheetDescription>
|
|
370
|
+
</SheetHeader>
|
|
371
|
+
<SheetFooter>
|
|
372
|
+
<SheetClose
|
|
373
|
+
render={
|
|
374
|
+
<Button
|
|
375
|
+
variant="outline"
|
|
376
|
+
size={globalSize}
|
|
377
|
+
className="w-full"
|
|
378
|
+
/>
|
|
379
|
+
}
|
|
380
|
+
>
|
|
381
|
+
Đóng thủ công
|
|
382
|
+
</SheetClose>
|
|
383
|
+
</SheetFooter>
|
|
384
|
+
</SheetContent>
|
|
385
|
+
|
|
386
|
+
</Sheet>
|
|
387
|
+
</>
|
|
388
|
+
} />
|
|
404
389
|
</ExampleGrid>
|
|
405
390
|
|
|
406
|
-
{
|
|
407
|
-
<ExampleSection
|
|
408
|
-
label="Controlled State"
|
|
409
|
-
description="Quản lý trạng thái đóng/mở qua React state với open và onOpenChange."
|
|
410
|
-
codeString={`const [open, setOpen] = useState(false);
|
|
391
|
+
<ShowcaseExample title="Controlled State" description="Quản lý trạng thái đóng/mở qua React state với open và onOpenChange." code={`const [open, setOpen] = useState(false);
|
|
411
392
|
<div className="flex items-center gap-4">
|
|
412
393
|
<Sheet open={open} onOpenChange={setOpen}>
|
|
413
394
|
<SheetTrigger render={<Button variant="outline" />}>
|
|
@@ -440,49 +421,46 @@ function SheetMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
440
421
|
{open ? "Mở" : "Đóng"}
|
|
441
422
|
</strong>
|
|
442
423
|
</p>
|
|
443
|
-
</div>`}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
424
|
+
</div>`} preview={
|
|
425
|
+
<>
|
|
426
|
+
<div className="flex items-center gap-4">
|
|
427
|
+
<Sheet open={open} onOpenChange={setOpen}>
|
|
428
|
+
<SheetTrigger
|
|
429
|
+
render={<Button variant="outline" size={globalSize} />}
|
|
430
|
+
>
|
|
431
|
+
<SettingsIcon aria-hidden="true" />
|
|
432
|
+
Toggle Controlled
|
|
433
|
+
</SheetTrigger>
|
|
453
434
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
435
|
+
<SheetContent side="right">
|
|
436
|
+
<SheetHeader>
|
|
437
|
+
<SheetTitle>Controlled Mode</SheetTitle>
|
|
438
|
+
<SheetDescription>
|
|
439
|
+
Sheet được điều khiển hoàn toàn bởi React state.
|
|
440
|
+
</SheetDescription>
|
|
441
|
+
</SheetHeader>
|
|
442
|
+
<SheetFooter>
|
|
443
|
+
<Button size={globalSize} onClick={() => setOpen(false)}>
|
|
444
|
+
Đóng bằng state
|
|
445
|
+
</Button>
|
|
446
|
+
</SheetFooter>
|
|
447
|
+
</SheetContent>
|
|
448
|
+
|
|
449
|
+
</Sheet>
|
|
450
|
+
<p className="text-sm text-muted-foreground">
|
|
451
|
+
Trạng thái:{" "}
|
|
452
|
+
<strong
|
|
453
|
+
data-active={open ? "" : undefined}
|
|
454
|
+
className="data-active:text-primary"
|
|
455
|
+
>
|
|
456
|
+
{open ? "Mở" : "Đóng"}
|
|
457
|
+
</strong>
|
|
458
|
+
</p>
|
|
459
|
+
</div>
|
|
460
|
+
</>
|
|
461
|
+
} />
|
|
480
462
|
|
|
481
|
-
|
|
482
|
-
<ExampleSection
|
|
483
|
-
label="Use case — Filter Panel"
|
|
484
|
-
description="Sheet dùng làm bảng lọc dữ liệu bên phải — pattern phổ biến trong dashboard, table view."
|
|
485
|
-
codeString={`<Sheet>
|
|
463
|
+
<ShowcaseExample title="Use case — Filter Panel" description="Sheet dùng làm bảng lọc dữ liệu bên phải — pattern phổ biến trong dashboard, table view." code={`<Sheet>
|
|
486
464
|
<SheetTrigger render={<Button variant="outline" />}>
|
|
487
465
|
<FilterIcon />
|
|
488
466
|
Lọc dữ liệu
|
|
@@ -524,61 +502,59 @@ function SheetMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
524
502
|
</SheetFooter>
|
|
525
503
|
</SheetContent>
|
|
526
504
|
|
|
527
|
-
</Sheet>`}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
505
|
+
</Sheet>`} preview={
|
|
506
|
+
<>
|
|
507
|
+
<Sheet>
|
|
508
|
+
<SheetTrigger render={<Button variant="outline" size={globalSize} />}>
|
|
509
|
+
<FilterIcon aria-hidden="true" />
|
|
510
|
+
Lọc dữ liệu
|
|
511
|
+
</SheetTrigger>
|
|
534
512
|
|
|
535
|
-
|
|
536
|
-
|
|
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
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
513
|
+
<SheetContent side="right">
|
|
514
|
+
<SheetHeader>
|
|
515
|
+
<SheetTitle>Bộ lọc</SheetTitle>
|
|
516
|
+
<SheetDescription>
|
|
517
|
+
Tinh chỉnh kết quả hiển thị theo điều kiện.
|
|
518
|
+
</SheetDescription>
|
|
519
|
+
</SheetHeader>
|
|
520
|
+
<div className="flex flex-col gap-4 p-4">
|
|
521
|
+
<div className="flex flex-col gap-2">
|
|
522
|
+
<Label htmlFor="filter-status">Trạng thái</Label>
|
|
523
|
+
<Input id="filter-status" placeholder="Tất cả" />
|
|
524
|
+
</div>
|
|
525
|
+
<div className="flex flex-col gap-2">
|
|
526
|
+
<Label htmlFor="filter-date-from">Từ ngày</Label>
|
|
527
|
+
<Input id="filter-date-from" type="date" />
|
|
528
|
+
</div>
|
|
529
|
+
<div className="flex flex-col gap-2">
|
|
530
|
+
<Label htmlFor="filter-date-to">Đến ngày</Label>
|
|
531
|
+
<Input id="filter-date-to" type="date" />
|
|
532
|
+
</div>
|
|
533
|
+
</div>
|
|
534
|
+
<SheetFooter>
|
|
535
|
+
<SheetClose
|
|
536
|
+
render={<Button variant="outline" size={globalSize} />}
|
|
537
|
+
>
|
|
538
|
+
Xoá bộ lọc
|
|
539
|
+
</SheetClose>
|
|
540
|
+
<Button size={globalSize}>Áp dụng</Button>
|
|
541
|
+
</SheetFooter>
|
|
542
|
+
</SheetContent>
|
|
543
|
+
|
|
544
|
+
</Sheet>
|
|
545
|
+
</>
|
|
546
|
+
} />
|
|
568
547
|
</div>
|
|
569
548
|
);
|
|
570
549
|
}
|
|
571
550
|
|
|
572
|
-
// ──────────────────────────────────────────────────────────
|
|
573
|
-
// SECTION 3: Entry point (export default)
|
|
574
|
-
// ──────────────────────────────────────────────────────────
|
|
575
551
|
export default function SheetShowcase() {
|
|
576
552
|
const { size: globalSize } = useDevContext();
|
|
577
553
|
return (
|
|
578
554
|
<Showcase
|
|
579
555
|
title="Sheet"
|
|
580
556
|
description="Panel trượt từ cạnh màn hình — mở rộng Dialog để hiển thị nội dung bổ sung mà không rời trang."
|
|
581
|
-
|
|
557
|
+
guideline={
|
|
582
558
|
<ShowcaseDocs>
|
|
583
559
|
<DocsP>
|
|
584
560
|
<DocsCode>Sheet</DocsCode> là một variant của Dialog, nhưng thay vì
|
|
@@ -595,11 +571,7 @@ export default function SheetShowcase() {
|
|
|
595
571
|
</DocsP>
|
|
596
572
|
</ShowcaseDocs>
|
|
597
573
|
}
|
|
598
|
-
|
|
599
|
-
{
|
|
600
|
-
label: "Micro (Primitive)",
|
|
601
|
-
content: <SheetMicroShowcase globalSize={globalSize} /> },
|
|
602
|
-
]}
|
|
574
|
+
micro={{ content: <SheetMicroShowcase globalSize={globalSize} /> }}
|
|
603
575
|
/>
|
|
604
576
|
);
|
|
605
577
|
}
|