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.
Files changed (134) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -1
  3. package/scripts/strip-comments.ts +79 -0
  4. package/src/blocks/auth-form.tsx +34 -30
  5. package/src/blocks/auth-recovery.tsx +9 -13
  6. package/src/blocks/auth-split.tsx +46 -36
  7. package/src/blocks/settings.tsx +84 -117
  8. package/src/components/macro/alert-preset.tsx +3 -1
  9. package/src/components/macro/carousel-preset.tsx +0 -1
  10. package/src/components/macro/checkbox-preset.test.tsx +2 -2
  11. package/src/components/macro/checkbox-preset.tsx +1 -2
  12. package/src/components/macro/command-preset.tsx +1 -1
  13. package/src/components/macro/date-picker.tsx +5 -18
  14. package/src/components/macro/dialog-preset.tsx +5 -3
  15. package/src/components/macro/input-preset.tsx +0 -1
  16. package/src/components/macro/select-preset.tsx +1 -1
  17. package/src/components/macro/switch-preset.test.tsx +1 -1
  18. package/src/components/micro/accordion.test.tsx +6 -12
  19. package/src/components/micro/alert-dialog.tsx +0 -2
  20. package/src/components/micro/alert.test.tsx +5 -8
  21. package/src/components/micro/alert.tsx +0 -2
  22. package/src/components/micro/badge.test.tsx +5 -7
  23. package/src/components/micro/badge.tsx +1 -3
  24. package/src/components/micro/button.test.tsx +19 -26
  25. package/src/components/micro/button.tsx +3 -11
  26. package/src/components/micro/calendar.tsx +12 -13
  27. package/src/components/micro/card.test.tsx +3 -5
  28. package/src/components/micro/carousel.tsx +0 -1
  29. package/src/components/micro/chart.tsx +3 -2
  30. package/src/components/micro/checkbox.test.tsx +9 -18
  31. package/src/components/micro/combobox.tsx +1 -3
  32. package/src/components/micro/command.tsx +23 -11
  33. package/src/components/micro/context-menu.tsx +0 -2
  34. package/src/components/micro/dialog.test.tsx +6 -14
  35. package/src/components/micro/dialog.tsx +0 -2
  36. package/src/components/micro/drawer.tsx +0 -3
  37. package/src/components/micro/dropdown-menu.test.tsx +8 -14
  38. package/src/components/micro/dropdown-menu.tsx +0 -2
  39. package/src/components/micro/field.tsx +3 -3
  40. package/src/components/micro/hover-card.tsx +0 -2
  41. package/src/components/micro/input-group.tsx +9 -42
  42. package/src/components/micro/input.test.tsx +15 -24
  43. package/src/components/micro/navigation-menu.tsx +0 -2
  44. package/src/components/micro/popover.test.tsx +5 -9
  45. package/src/components/micro/progress.tsx +5 -1
  46. package/src/components/micro/select.test.tsx +5 -18
  47. package/src/components/micro/select.tsx +3 -5
  48. package/src/components/micro/separator.tsx +1 -1
  49. package/src/components/micro/sheet.test.tsx +6 -14
  50. package/src/components/micro/sheet.tsx +0 -2
  51. package/src/components/micro/sidebar.tsx +5 -6
  52. package/src/components/micro/sonner.tsx +0 -1
  53. package/src/components/micro/switch.test.tsx +9 -18
  54. package/src/components/micro/switch.tsx +1 -1
  55. package/src/components/micro/tabs.test.tsx +5 -11
  56. package/src/components/micro/theme-provider.tsx +0 -12
  57. package/src/components/micro/toggle-group.tsx +1 -12
  58. package/src/components/micro/tooltip.test.tsx +7 -12
  59. package/src/dev/App.tsx +6 -6
  60. package/src/dev/components/BlockViewer.tsx +15 -4
  61. package/src/dev/components/Container.tsx +20 -0
  62. package/src/dev/components/GladvnLogo.tsx +3 -9
  63. package/src/dev/components/code-highlighter.tsx +5 -3
  64. package/src/dev/components/showcase.tsx +116 -168
  65. package/src/dev/sections/buttons.tsx +4 -9
  66. package/src/dev/sections/display.tsx +68 -72
  67. package/src/dev/sections/feedback.tsx +304 -314
  68. package/src/dev/sections/forms.tsx +10 -14
  69. package/src/dev/sections/interactive.tsx +32 -32
  70. package/src/dev/sections/overview.tsx +2 -10
  71. package/src/dev/showcase/accordion.tsx +512 -554
  72. package/src/dev/showcase/alert-dialog.tsx +525 -565
  73. package/src/dev/showcase/alert.tsx +352 -402
  74. package/src/dev/showcase/aspect-ratio.tsx +167 -193
  75. package/src/dev/showcase/avatar.tsx +231 -269
  76. package/src/dev/showcase/badge.tsx +92 -140
  77. package/src/dev/showcase/breadcrumb.tsx +113 -135
  78. package/src/dev/showcase/button.tsx +140 -173
  79. package/src/dev/showcase/calendar.tsx +187 -237
  80. package/src/dev/showcase/card.tsx +229 -261
  81. package/src/dev/showcase/carousel.tsx +288 -315
  82. package/src/dev/showcase/chart.tsx +44 -50
  83. package/src/dev/showcase/checkbox.tsx +286 -330
  84. package/src/dev/showcase/collapsible.tsx +143 -160
  85. package/src/dev/showcase/combobox.tsx +327 -369
  86. package/src/dev/showcase/command.tsx +106 -120
  87. package/src/dev/showcase/context-menu.tsx +93 -107
  88. package/src/dev/showcase/dialog.tsx +585 -630
  89. package/src/dev/showcase/drawer.tsx +176 -196
  90. package/src/dev/showcase/dropdown-menu.tsx +183 -201
  91. package/src/dev/showcase/empty.tsx +232 -274
  92. package/src/dev/showcase/hover-card.tsx +153 -180
  93. package/src/dev/showcase/input-group.tsx +221 -253
  94. package/src/dev/showcase/input-otp.tsx +204 -250
  95. package/src/dev/showcase/input.tsx +246 -325
  96. package/src/dev/showcase/item.tsx +134 -152
  97. package/src/dev/showcase/kbd.tsx +149 -172
  98. package/src/dev/showcase/label.tsx +50 -68
  99. package/src/dev/showcase/menubar.tsx +194 -213
  100. package/src/dev/showcase/navigation-menu.tsx +119 -133
  101. package/src/dev/showcase/overview-components/ArchitectureSection.tsx +126 -0
  102. package/src/dev/showcase/overview-components/CodeBlock.tsx +50 -0
  103. package/src/dev/showcase/overview-components/ColorPaletteSection.tsx +44 -0
  104. package/src/dev/showcase/overview-components/DashboardPreview.tsx +159 -0
  105. package/src/dev/showcase/overview-components/FeatureGridSection.tsx +535 -0
  106. package/src/dev/showcase/overview-components/FooterCTA.tsx +137 -0
  107. package/src/dev/showcase/overview-components/HeroSection.tsx +65 -0
  108. package/src/dev/showcase/overview-components/PrinciplesSection.tsx +128 -0
  109. package/src/dev/showcase/overview.tsx +21 -1163
  110. package/src/dev/showcase/pagination.tsx +144 -190
  111. package/src/dev/showcase/popover.tsx +181 -196
  112. package/src/dev/showcase/progress.tsx +141 -189
  113. package/src/dev/showcase/radio-group.tsx +272 -332
  114. package/src/dev/showcase/resizable.tsx +119 -141
  115. package/src/dev/showcase/scroll-area.tsx +21 -36
  116. package/src/dev/showcase/select.tsx +262 -322
  117. package/src/dev/showcase/separator.tsx +75 -73
  118. package/src/dev/showcase/sheet.tsx +333 -361
  119. package/src/dev/showcase/sidebar.tsx +53 -59
  120. package/src/dev/showcase/skeleton.tsx +93 -112
  121. package/src/dev/showcase/slider.tsx +244 -296
  122. package/src/dev/showcase/sonner.tsx +251 -258
  123. package/src/dev/showcase/spinner.tsx +46 -67
  124. package/src/dev/showcase/switch.tsx +298 -362
  125. package/src/dev/showcase/table.tsx +76 -80
  126. package/src/dev/showcase/tabs.tsx +302 -355
  127. package/src/dev/showcase/textarea.tsx +240 -293
  128. package/src/dev/showcase/toast.tsx +48 -54
  129. package/src/dev/showcase/toggle-group.tsx +104 -129
  130. package/src/dev/showcase/toggle.tsx +82 -102
  131. package/src/dev/showcase/tooltip.tsx +173 -192
  132. package/src/dev/showcase/why.tsx +6 -12
  133. package/src/hooks/use-mobile.test.ts +3 -2
  134. package/src/lib/utils.test.ts +5 -4
@@ -21,25 +21,18 @@ import {
21
21
  DocsCode,
22
22
  DocsP,
23
23
  ExampleGrid,
24
- ExampleSection,
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 mt-6">
38
- {/* ── Sides ── */}
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
- <div className="grid grid-cols-2 gap-2">
98
- {/* top */}
99
- <Sheet>
100
- <SheetTrigger
101
- render={
102
- <Button
103
- variant="outline"
104
- size={globalSize}
105
- className="w-full"
106
- />
107
- }
108
- >
109
- top
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
- <SheetContent side="top">
113
- <SheetHeader>
114
- <SheetTitle>Edit Profile</SheetTitle>
115
- <SheetDescription>
116
- Thay đổi thông tin tài khoản của bạn và nhấn Lưu.
117
- </SheetDescription>
118
- </SheetHeader>
119
- <div className="grid gap-4 py-4 px-4">
120
- <div className="grid grid-cols-4 items-center gap-4">
121
- <Label htmlFor="name-top" className="text-right">
122
- Tên
123
- </Label>
124
- <Input
125
- id="name-top"
126
- defaultValue="Pedro Duarte"
127
- className="col-span-3"
128
- />
129
- </div>
130
- </div>
131
- <SheetFooter>
132
- <SheetClose
133
- render={<Button variant="outline" size={globalSize} />}
134
- >
135
- Huỷ
136
- </SheetClose>
137
- <Button size={globalSize}>Lưu thay đổi</Button>
138
- </SheetFooter>
139
- </SheetContent>
140
-
141
- </Sheet>
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
- {/* right */}
144
- <Sheet>
145
- <SheetTrigger
146
- render={
147
- <Button
148
- variant="outline"
149
- size={globalSize}
150
- className="w-full"
151
- />
152
- }
153
- >
154
- right
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
- <SheetContent side="right">
158
- <SheetHeader>
159
- <SheetTitle>Edit Profile</SheetTitle>
160
- <SheetDescription>
161
- Thay đổi thông tin tài khoản của bạn và nhấn Lưu.
162
- </SheetDescription>
163
- </SheetHeader>
164
- <div className="grid gap-4 py-4 px-4">
165
- <div className="grid grid-cols-4 items-center gap-4">
166
- <Label htmlFor="name-right" className="text-right">
167
- Tên
168
- </Label>
169
- <Input
170
- id="name-right"
171
- defaultValue="Pedro Duarte"
172
- className="col-span-3"
173
- />
174
- </div>
175
- <div className="grid grid-cols-4 items-center gap-4">
176
- <Label htmlFor="username-right" className="text-right">
177
- Username
178
- </Label>
179
- <Input
180
- id="username-right"
181
- defaultValue="@peduarte"
182
- className="col-span-3"
183
- />
184
- </div>
185
- </div>
186
- <SheetFooter>
187
- <SheetClose
188
- render={<Button variant="outline" size={globalSize} />}
189
- >
190
- Huỷ
191
- </SheetClose>
192
- <Button size={globalSize}>Lưu thay đổi</Button>
193
- </SheetFooter>
194
- </SheetContent>
195
-
196
- </Sheet>
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
- {/* bottom */}
199
- <Sheet>
200
- <SheetTrigger
201
- render={
202
- <Button
203
- variant="outline"
204
- size={globalSize}
205
- className="w-full"
206
- />
207
- }
208
- >
209
- bottom
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
- <SheetContent side="bottom">
213
- <SheetHeader>
214
- <SheetTitle>Edit Profile</SheetTitle>
215
- <SheetDescription>
216
- Thay đổi thông tin tài khoản của bạn và nhấn Lưu.
217
- </SheetDescription>
218
- </SheetHeader>
219
- <div className="grid gap-4 py-4 px-4">
220
- <div className="grid grid-cols-4 items-center gap-4">
221
- <Label htmlFor="name-bottom" className="text-right">
222
- Tên
223
- </Label>
224
- <Input
225
- id="name-bottom"
226
- defaultValue="Pedro Duarte"
227
- className="col-span-3"
228
- />
229
- </div>
230
- </div>
231
- <SheetFooter>
232
- <SheetClose
233
- render={<Button variant="outline" size={globalSize} />}
234
- >
235
- Huỷ
236
- </SheetClose>
237
- <Button size={globalSize}>Lưu thay đổi</Button>
238
- </SheetFooter>
239
- </SheetContent>
240
-
241
- </Sheet>
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
- {/* left */}
244
- <Sheet>
245
- <SheetTrigger
246
- render={
247
- <Button
248
- variant="outline"
249
- size={globalSize}
250
- className="w-full"
251
- />
252
- }
253
- >
254
- left
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
- <SheetContent side="left">
258
- <SheetHeader>
259
- <SheetTitle>Edit Profile</SheetTitle>
260
- <SheetDescription>
261
- Thay đổi thông tin tài khoản của bạn và nhấn Lưu.
262
- </SheetDescription>
263
- </SheetHeader>
264
- <div className="grid gap-4 py-4 px-4">
265
- <div className="grid grid-cols-4 items-center gap-4">
266
- <Label htmlFor="name-left" className="text-right">
267
- Tên
268
- </Label>
269
- <Input
270
- id="name-left"
271
- defaultValue="Pedro Duarte"
272
- className="col-span-3"
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
- <div className="grid grid-cols-4 items-center gap-4">
276
- <Label htmlFor="username-left" className="text-right">
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
- <ExampleSection
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
- <Sheet>
323
- <SheetTrigger
324
- render={<Button variant="outline" size={globalSize} />}
325
- >
326
- <PanelRightIcon aria-hidden="true" />
327
- Mở Sheet
328
- </SheetTrigger>
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
- <SheetContent side="right">
331
- <SheetHeader>
332
- <SheetTitle>Có nút đóng</SheetTitle>
333
- <SheetDescription>Nút X xuất hiện tự động.</SheetDescription>
334
- </SheetHeader>
335
- </SheetContent>
336
-
337
- </Sheet>
338
- </ExampleSection>
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
- <ExampleSection
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
- <Sheet>
373
- <SheetTrigger
374
- render={<Button variant="outline" size={globalSize} />}
375
- >
376
- <PanelRightIcon aria-hidden="true" />
377
- Không có X
378
- </SheetTrigger>
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
- <SheetContent side="right" showCloseButton={false}>
381
- <SheetHeader>
382
- <SheetTitle>Ẩn nút đóng</SheetTitle>
383
- <SheetDescription>
384
- Consumer tự render nút đóng trong footer.
385
- </SheetDescription>
386
- </SheetHeader>
387
- <SheetFooter>
388
- <SheetClose
389
- render={
390
- <Button
391
- variant="outline"
392
- size={globalSize}
393
- className="w-full"
394
- />
395
- }
396
- >
397
- Đóng thủ công
398
- </SheetClose>
399
- </SheetFooter>
400
- </SheetContent>
401
-
402
- </Sheet>
403
- </ExampleSection>
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
- {/* ── Controlled ── */}
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
- <div className="flex items-center gap-4">
446
- <Sheet open={open} onOpenChange={setOpen}>
447
- <SheetTrigger
448
- render={<Button variant="outline" size={globalSize} />}
449
- >
450
- <SettingsIcon aria-hidden="true" />
451
- Toggle Controlled
452
- </SheetTrigger>
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
- <SheetContent side="right">
455
- <SheetHeader>
456
- <SheetTitle>Controlled Mode</SheetTitle>
457
- <SheetDescription>
458
- Sheet được điều khiển hoàn toàn bởi React state.
459
- </SheetDescription>
460
- </SheetHeader>
461
- <SheetFooter>
462
- <Button size={globalSize} onClick={() => setOpen(false)}>
463
- Đóng bằng state
464
- </Button>
465
- </SheetFooter>
466
- </SheetContent>
467
-
468
- </Sheet>
469
- <p className="text-sm text-muted-foreground">
470
- Trạng thái:{" "}
471
- <strong
472
- data-active={open ? "" : undefined}
473
- className="data-active:text-primary"
474
- >
475
- {open ? "Mở" : "Đóng"}
476
- </strong>
477
- </p>
478
- </div>
479
- </ExampleSection>
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
- {/* ── Real-world: Filter Panel ── */}
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
- <Sheet>
530
- <SheetTrigger render={<Button variant="outline" size={globalSize} />}>
531
- <FilterIcon aria-hidden="true" />
532
- Lọc dữ liệu
533
- </SheetTrigger>
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
- <SheetContent side="right">
536
- <SheetHeader>
537
- <SheetTitle>Bộ lọc</SheetTitle>
538
- <SheetDescription>
539
- Tinh chỉnh kết quả hiển thị theo điều kiện.
540
- </SheetDescription>
541
- </SheetHeader>
542
- <div className="flex flex-col gap-4 p-4">
543
- <div className="flex flex-col gap-2">
544
- <Label htmlFor="filter-status">Trạng thái</Label>
545
- <Input id="filter-status" placeholder="Tất cả" />
546
- </div>
547
- <div className="flex flex-col gap-2">
548
- <Label htmlFor="filter-date-from">Từ ngày</Label>
549
- <Input id="filter-date-from" type="date" />
550
- </div>
551
- <div className="flex flex-col gap-2">
552
- <Label htmlFor="filter-date-to">Đến ngày</Label>
553
- <Input id="filter-date-to" type="date" />
554
- </div>
555
- </div>
556
- <SheetFooter>
557
- <SheetClose
558
- render={<Button variant="outline" size={globalSize} />}
559
- >
560
- Xoá bộ lọc
561
- </SheetClose>
562
- <Button size={globalSize}>Áp dụng</Button>
563
- </SheetFooter>
564
- </SheetContent>
565
-
566
- </Sheet>
567
- </ExampleSection>
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
- generalConcept={
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
- tabs={[
599
- {
600
- label: "Micro (Primitive)",
601
- content: <SheetMicroShowcase globalSize={globalSize} /> },
602
- ]}
574
+ micro={{ content: <SheetMicroShowcase globalSize={globalSize} /> }}
603
575
  />
604
576
  );
605
577
  }