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.
Files changed (134) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -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
@@ -27,59 +27,47 @@ import {
27
27
  DocsCode,
28
28
  DocsP,
29
29
  ExampleGrid,
30
- ExampleSection,
30
+ ShowcaseExample,
31
31
  Showcase,
32
32
  ShowcaseDocs
33
33
  } from "../../dev/components/showcase";
34
34
 
35
- // ──────────────────────────────────────────────────────────
36
- // SECTION 2: Micro Content (không export)
37
- // ──────────────────────────────────────────────────────────
38
35
  function KbdMicroShowcase() {
39
36
  return (
40
- <div className="space-y-10 mt-6">
41
- {/* ── Kbd đơn ── */}
37
+ <div className="space-y-10">
42
38
  <ExampleGrid>
43
- <ExampleSection
44
- label="Kbd — Phím đơn"
45
- description="Hiển thị một phím bàn phím riêng lẻ dùng thẻ <kbd> semantic."
46
- codeString={`<p className="text-sm text-muted-foreground">
39
+ <ShowcaseExample title="Kbd — Phím đơn" description="Hiển thị một phím bàn phím riêng lẻ dùng thẻ <kbd> semantic." code={`<p className="text-sm text-muted-foreground">
47
40
  Press <Kbd>⌘</Kbd> <Kbd>K</Kbd> to open search.
48
- </p>`}
49
- >
50
- <p className="text-sm text-muted-foreground">
51
- Press <Kbd>⌘</Kbd> <Kbd>K</Kbd> to open search.
52
- </p>
53
- </ExampleSection>
41
+ </p>`} preview={
42
+ <>
43
+ <p className="text-sm text-muted-foreground">
44
+ Press <Kbd>⌘</Kbd> <Kbd>K</Kbd> to open search.
45
+ </p>
46
+ </>
47
+ } />
54
48
 
55
- <ExampleSection
56
- label="KbdGroup — Tổ hợp phím"
57
- description="Nhóm nhiều phím cạnh nhau với khoảng cách đều. Dùng khi biểu diễn tổ hợp phím như Ctrl+Shift+P."
58
- codeString={`<p className="text-sm text-muted-foreground flex items-center gap-2">
49
+ <ShowcaseExample title="KbdGroup — Tổ hợp phím" description="Nhóm nhiều phím cạnh nhau với khoảng cách đều. Dùng khi biểu diễn tổ hợp phím như Ctrl+Shift+P." code={`<p className="text-sm text-muted-foreground flex items-center gap-2">
59
50
  Open Command Palette
60
51
  <KbdGroup>
61
52
  <Kbd>⌘</Kbd>
62
53
  <Kbd>⇧</Kbd>
63
54
  <Kbd>P</Kbd>
64
55
  </KbdGroup>
65
- </p>`}
66
- >
67
- <p className="text-sm text-muted-foreground flex items-center gap-2">
68
- Open Command Palette
69
- <KbdGroup>
70
- <Kbd>⌘</Kbd>
71
- <Kbd>⇧</Kbd>
72
- <Kbd>P</Kbd>
73
- </KbdGroup>
74
- </p>
75
- </ExampleSection>
56
+ </p>`} preview={
57
+ <>
58
+ <p className="text-sm text-muted-foreground flex items-center gap-2">
59
+ Open Command Palette
60
+ <KbdGroup>
61
+ <Kbd>⌘</Kbd>
62
+ <Kbd>⇧</Kbd>
63
+ <Kbd>P</Kbd>
64
+ </KbdGroup>
65
+ </p>
66
+ </>
67
+ } />
76
68
  </ExampleGrid>
77
69
 
78
- {/* ── Ký tự & Symbols ── */}
79
- <ExampleSection
80
- label="Ký tự & Symbols"
81
- description="Kbd có thể chứa ký tự Unicode, chữ cái, số hoặc tên phím dài."
82
- codeString={`<div className="flex flex-wrap items-center gap-2">
70
+ <ShowcaseExample title="Ký tự & Symbols" description="Kbd có thể chứa ký tự Unicode, chữ cái, số hoặc tên phím dài." code={`<div className="flex flex-wrap items-center gap-2">
83
71
  <Kbd>Ctrl</Kbd>
84
72
  <Kbd>Alt</Kbd>
85
73
  <Kbd>⌘</Kbd>
@@ -90,27 +78,24 @@ function KbdMicroShowcase() {
90
78
  <Kbd>Esc</Kbd>
91
79
  <Kbd>F1</Kbd>
92
80
  <Kbd>→</Kbd>
93
- </div>`}
94
- >
95
- <div className="flex flex-wrap items-center gap-2">
96
- <Kbd>Ctrl</Kbd>
97
- <Kbd>Alt</Kbd>
98
- <Kbd>⌘</Kbd>
99
- <Kbd>⇧</Kbd>
100
- <Kbd>⌫</Kbd>
101
- <Kbd>↵</Kbd>
102
- <Kbd>Tab</Kbd>
103
- <Kbd>Esc</Kbd>
104
- <Kbd>F1</Kbd>
105
- <Kbd>→</Kbd>
106
- </div>
107
- </ExampleSection>
81
+ </div>`} preview={
82
+ <>
83
+ <div className="flex flex-wrap items-center gap-2">
84
+ <Kbd>Ctrl</Kbd>
85
+ <Kbd>Alt</Kbd>
86
+ <Kbd>⌘</Kbd>
87
+ <Kbd>⇧</Kbd>
88
+ <Kbd>⌫</Kbd>
89
+ <Kbd>↵</Kbd>
90
+ <Kbd>Tab</Kbd>
91
+ <Kbd>Esc</Kbd>
92
+ <Kbd>F1</Kbd>
93
+ <Kbd>→</Kbd>
94
+ </div>
95
+ </>
96
+ } />
108
97
 
109
- {/* ── Kbd trong Tooltip ── */}
110
- <ExampleSection
111
- label="Kbd trong Tooltip"
112
- description="Kbd tự đổi màu khi nằm trong TooltipContent — màu nền sáng trên nền tối của tooltip, không cần thêm class."
113
- codeString={`<TooltipProvider>
98
+ <ShowcaseExample title="Kbd trong Tooltip" description="Kbd tự đổi màu khi nằm trong TooltipContent — màu nền sáng trên nền tối của tooltip, không cần thêm class." code={`<TooltipProvider>
114
99
  <Tooltip>
115
100
  <TooltipTrigger
116
101
  render={
@@ -124,52 +109,49 @@ function KbdMicroShowcase() {
124
109
  <Kbd>S</Kbd>
125
110
  </TooltipContent>
126
111
  </Tooltip>
127
- </TooltipProvider>`}
128
- >
129
- <div className="flex items-center gap-3">
130
- <TooltipProvider>
131
- <Tooltip>
132
- <TooltipTrigger
133
- render={
134
- <Button variant="outline" iconOnly>
135
- <SaveIcon aria-hidden="true" />
136
- </Button>
137
- }
138
- />
139
-
140
- <TooltipContent>
141
- Lưu tài liệu <Kbd>⌘</Kbd>
142
- <Kbd>S</Kbd>
143
- </TooltipContent>
144
-
145
- </Tooltip>
146
- </TooltipProvider>
112
+ </TooltipProvider>`} preview={
113
+ <>
114
+ <div className="flex items-center gap-3">
115
+ <TooltipProvider>
116
+ <Tooltip>
117
+ <TooltipTrigger
118
+ render={
119
+ <Button variant="outline" iconOnly>
120
+ <SaveIcon aria-hidden="true" />
121
+ </Button>
122
+ }
123
+ />
124
+
125
+ <TooltipContent>
126
+ Lưu tài liệu <Kbd>⌘</Kbd>
127
+ <Kbd>S</Kbd>
128
+ </TooltipContent>
129
+
130
+ </Tooltip>
131
+ </TooltipProvider>
147
132
 
148
- <TooltipProvider>
149
- <Tooltip>
150
- <TooltipTrigger
151
- render={
152
- <Button variant="outline" iconOnly>
153
- <CopyIcon aria-hidden="true" />
154
- </Button>
155
- }
156
- />
157
-
158
- <TooltipContent>
159
- Sao chép <Kbd>⌘</Kbd>
160
- <Kbd>C</Kbd>
161
- </TooltipContent>
162
-
163
- </Tooltip>
164
- </TooltipProvider>
165
- </div>
166
- </ExampleSection>
133
+ <TooltipProvider>
134
+ <Tooltip>
135
+ <TooltipTrigger
136
+ render={
137
+ <Button variant="outline" iconOnly>
138
+ <CopyIcon aria-hidden="true" />
139
+ </Button>
140
+ }
141
+ />
142
+
143
+ <TooltipContent>
144
+ Sao chép <Kbd>⌘</Kbd>
145
+ <Kbd>C</Kbd>
146
+ </TooltipContent>
147
+
148
+ </Tooltip>
149
+ </TooltipProvider>
150
+ </div>
151
+ </>
152
+ } />
167
153
 
168
- {/* ── Use case thực tế: Menu với shortcuts ── */}
169
- <ExampleSection
170
- label="Use case — Menu với Keyboard Shortcut"
171
- description="Kbd dùng trong DropdownMenuItem để hiển thị phím tắt bên cạnh label — pattern phổ biến trong text editor, IDE, Figma."
172
- codeString={`<DropdownMenuItem>
154
+ <ShowcaseExample title="Use case Menu với Keyboard Shortcut" description="Kbd dùng trong DropdownMenuItem để hiển thị phím tắt bên cạnh label — pattern phổ biến trong text editor, IDE, Figma." code={`<DropdownMenuItem>
173
155
  <FileIcon />
174
156
  New File
175
157
  <KbdGroup className="ml-auto">
@@ -185,93 +167,88 @@ function KbdMicroShowcase() {
185
167
  <Kbd>⌘</Kbd>
186
168
  <Kbd>S</Kbd>
187
169
  </KbdGroup>
188
- </DropdownMenuItem>`}
189
- >
190
- <DropdownMenu>
191
- <DropdownMenuTrigger
192
- render={<Button variant="outline">File menu</Button>}
193
- />
194
-
195
- <DropdownMenuContent className="w-56">
196
- <DropdownMenuItem>
197
- <FilePlusIcon aria-hidden="true" />
198
- New File
199
- <KbdGroup className="ml-auto">
200
- <Kbd>⌘</Kbd>
201
- <Kbd>N</Kbd>
202
- </KbdGroup>
203
- </DropdownMenuItem>
204
- <DropdownMenuItem>
205
- <FolderOpenIcon aria-hidden="true" />
206
- Open...
207
- <KbdGroup className="ml-auto">
208
- <Kbd>⌘</Kbd>
209
- <Kbd>O</Kbd>
210
- </KbdGroup>
211
- </DropdownMenuItem>
212
- <DropdownMenuSeparator />
213
- <DropdownMenuItem>
214
- <SaveIcon aria-hidden="true" />
215
- Save
216
- <KbdGroup className="ml-auto">
217
- <Kbd>⌘</Kbd>
218
- <Kbd>S</Kbd>
219
- </KbdGroup>
220
- </DropdownMenuItem>
221
- <DropdownMenuItem>
222
- <FileIcon aria-hidden="true" />
223
- Save As...
224
- <KbdGroup className="ml-auto">
225
- <Kbd>⌘</Kbd>
226
- <Kbd>⇧</Kbd>
227
- <Kbd>S</Kbd>
228
- </KbdGroup>
229
- </DropdownMenuItem>
230
- </DropdownMenuContent>
231
-
232
- </DropdownMenu>
233
- </ExampleSection>
170
+ </DropdownMenuItem>`} preview={
171
+ <>
172
+ <DropdownMenu>
173
+ <DropdownMenuTrigger
174
+ render={<Button variant="outline">File menu</Button>}
175
+ />
176
+
177
+ <DropdownMenuContent className="w-56">
178
+ <DropdownMenuItem>
179
+ <FilePlusIcon aria-hidden="true" />
180
+ New File
181
+ <KbdGroup className="ml-auto">
182
+ <Kbd>⌘</Kbd>
183
+ <Kbd>N</Kbd>
184
+ </KbdGroup>
185
+ </DropdownMenuItem>
186
+ <DropdownMenuItem>
187
+ <FolderOpenIcon aria-hidden="true" />
188
+ Open...
189
+ <KbdGroup className="ml-auto">
190
+ <Kbd>⌘</Kbd>
191
+ <Kbd>O</Kbd>
192
+ </KbdGroup>
193
+ </DropdownMenuItem>
194
+ <DropdownMenuSeparator />
195
+ <DropdownMenuItem>
196
+ <SaveIcon aria-hidden="true" />
197
+ Save
198
+ <KbdGroup className="ml-auto">
199
+ <Kbd>⌘</Kbd>
200
+ <Kbd>S</Kbd>
201
+ </KbdGroup>
202
+ </DropdownMenuItem>
203
+ <DropdownMenuItem>
204
+ <FileIcon aria-hidden="true" />
205
+ Save As...
206
+ <KbdGroup className="ml-auto">
207
+ <Kbd>⌘</Kbd>
208
+ <Kbd>⇧</Kbd>
209
+ <Kbd>S</Kbd>
210
+ </KbdGroup>
211
+ </DropdownMenuItem>
212
+ </DropdownMenuContent>
213
+
214
+ </DropdownMenu>
215
+ </>
216
+ } />
234
217
 
235
- {/* ── Gợi ý inline trong form ── */}
236
- <ExampleSection
237
- label="Gợi ý inline trong văn bản"
238
- description="Kbd dùng inline trong đoạn văn bản để gợi ý phím tắt — phổ biến trong help text, onboarding, documentation."
239
- codeString={`<p className="text-sm text-muted-foreground">
218
+ <ShowcaseExample title="Gợi ý inline trong văn bản" description="Kbd dùng inline trong đoạn văn bản để gợi ý phím tắt — phổ biến trong help text, onboarding, documentation." code={`<p className="text-sm text-muted-foreground">
240
219
  Nhấn <Kbd>Enter</Kbd> để gửi, hoặc{" "}
241
220
  <KbdGroup>
242
221
  <Kbd>⇧</Kbd>
243
222
  <Kbd>Enter</Kbd>
244
223
  </KbdGroup>{" "}
245
224
  để xuống dòng.
246
- </p>`}
247
- >
248
- <div className="space-y-3">
249
- <p className="text-sm text-muted-foreground">
250
- Nhấn <Kbd>Enter</Kbd> để gửi, hoặc{" "}
251
- <KbdGroup>
252
- <Kbd>⇧</Kbd>
253
- <Kbd>Enter</Kbd>
254
- </KbdGroup>{" "}
255
- để xuống dòng.
256
- </p>
257
- <p className="text-sm text-muted-foreground">
258
- Dùng <Kbd>Tab</Kbd> để chuyển trường, <Kbd>Esc</Kbd> để huỷ.
259
- </p>
260
- </div>
261
- </ExampleSection>
225
+ </p>`} preview={
226
+ <>
227
+ <div className="space-y-3">
228
+ <p className="text-sm text-muted-foreground">
229
+ Nhấn <Kbd>Enter</Kbd> để gửi, hoặc{" "}
230
+ <KbdGroup>
231
+ <Kbd>⇧</Kbd>
232
+ <Kbd>Enter</Kbd>
233
+ </KbdGroup>{" "}
234
+ để xuống dòng.
235
+ </p>
236
+ <p className="text-sm text-muted-foreground">
237
+ Dùng <Kbd>Tab</Kbd> để chuyển trường, <Kbd>Esc</Kbd> để huỷ.
238
+ </p>
239
+ </div>
240
+ </>
241
+ } />
262
242
  </div>
263
243
  );
264
244
  }
265
245
 
266
- // ──────────────────────────────────────────────────────────
267
- // SECTION 3: Entry point (export default)
268
- // ──────────────────────────────────────────────────────────
269
246
  export default function KbdShowcase() {
270
247
  return (
271
248
  <Showcase
272
249
  title="Keyboard Shortcut"
273
250
  description="Hiển thị phím tắt bàn phím dạng inline với thẻ HTML semantic <kbd>."
274
- generalConcept={
251
+ guideline={
275
252
  <ShowcaseDocs>
276
253
  <DocsP>
277
254
  <DocsCode>Kbd</DocsCode> dùng thẻ HTML semantic{" "}
@@ -286,7 +263,7 @@ export default function KbdShowcase() {
286
263
  </DocsP>
287
264
  </ShowcaseDocs>
288
265
  }
289
- tabs={[{ label: "Micro (Primitive)", content: <KbdMicroShowcase /> }]}
266
+ micro={{ content: <KbdMicroShowcase /> }}
290
267
  />
291
268
  );
292
269
  }
@@ -3,60 +3,48 @@ import { useDevContext } from "../../dev/components/dev-context";
3
3
  import {
4
4
  DocsCode,
5
5
  DocsP,
6
- ExampleSection,
6
+ ShowcaseExample,
7
7
  Showcase,
8
8
  ShowcaseDocs
9
9
  } from "../../dev/components/showcase";
10
10
  import { type Size } from "../../lib/types";
11
11
 
12
- // ──────────────────────────────────────────────────────────
13
- // SECTION 2: Micro Content (không export)
14
- // ──────────────────────────────────────────────────────────
15
12
  function LabelMicroShowcase({ globalSize }: { globalSize: Size }) {
16
13
  return (
17
- <div className="space-y-10 mt-6">
18
- <ExampleSection
19
- label="Default"
20
- description="Cách sử dụng nhãn tiêu chuẩn."
21
- codeString={`<Label htmlFor="terms">Accept terms and conditions</Label>`}
22
- >
23
- <Label htmlFor="terms" size={globalSize}>
24
- Accept terms and conditions
25
- </Label>
26
- </ExampleSection>
14
+ <div className="space-y-10">
15
+ <ShowcaseExample title="Default" description="Cách sử dụng nhãn tiêu chuẩn." code={`<Label htmlFor="terms">Chấp nhận điều khoản và điều kiện</Label>`} preview={
16
+ <>
17
+ <Label htmlFor="terms" size={globalSize}>
18
+ Chấp nhận điều khoản và điều kiện
19
+ </Label>
20
+ </>
21
+ } />
27
22
 
28
- <ExampleSection
29
- label="Disabled"
30
- description="Trạng thái bị vô hiệu hóa khi nằm trong group bị vô hiệu."
31
- codeString={`<div data-disabled="true" className="group">
32
- <Label htmlFor="disabled">This label is disabled</Label>
33
- </div>`}
34
- >
35
- <div data-disabled="true" className="group">
36
- <Label htmlFor="disabled" size={globalSize}>
37
- This label is disabled
38
- </Label>
39
- </div>
40
- </ExampleSection>
23
+ <ShowcaseExample title="Disabled" description="Trạng thái bị vô hiệu hóa khi nằm trong group bị vô hiệu." code={`<div data-disabled="true" className="group">
24
+ <Label htmlFor="disabled">Nhãn này đã bị khóa</Label>
25
+ </div>`} preview={
26
+ <>
27
+ <div data-disabled="true" className="group">
28
+ <Label htmlFor="disabled" size={globalSize}>
29
+ Nhãn này đã bị khóa
30
+ </Label>
31
+ </div>
32
+ </>
33
+ } />
41
34
 
42
- <ExampleSection
43
- label="Error State"
44
- description="Hiển thị màu đỏ khi nằm trong group bị lỗi (data-invalid)."
45
- codeString={`<div data-invalid="true" className="group">
46
- <Label htmlFor="error">Email is required</Label>
47
- </div>`}
48
- >
49
- <div data-invalid="true" className="group">
50
- <Label htmlFor="error" size={globalSize}>
51
- Email is required
52
- </Label>
53
- </div>
54
- </ExampleSection>
35
+ <ShowcaseExample title="Error State" description="Hiển thị màu đỏ khi nằm trong group bị lỗi (data-invalid)." code={`<div data-invalid="true" className="group">
36
+ <Label htmlFor="error">Email là bắt buộc</Label>
37
+ </div>`} preview={
38
+ <>
39
+ <div data-invalid="true" className="group">
40
+ <Label htmlFor="error" size={globalSize}>
41
+ Email là bắt buộc
42
+ </Label>
43
+ </div>
44
+ </>
45
+ } />
55
46
 
56
- <ExampleSection
57
- label="With Peer Input"
58
- description="Phản hồi trạng thái disabled của input liền kề (dùng class peer)."
59
- codeString={`<div className="flex items-center gap-2">
47
+ <ShowcaseExample title="With Peer Input" description="Phản hồi trạng thái disabled của input liền kề (dùng class peer)." code={`<div className="flex items-center gap-2">
60
48
  <input
61
49
  type="checkbox"
62
50
  disabled
@@ -64,36 +52,34 @@ function LabelMicroShowcase({ globalSize }: { globalSize: Size }) {
64
52
  className="peer w-4 h-4"
65
53
  />
66
54
  <Label htmlFor="peer-disabled">
67
- Disabled by peer checkbox
55
+ Bị khóa bởi peer checkbox
68
56
  </Label>
69
- </div>`}
70
- >
71
- <div className="flex items-center gap-2">
72
- <input
73
- type="checkbox"
74
- disabled
75
- id="peer-disabled"
76
- className="peer w-4 h-4"
77
- />
78
- <Label htmlFor="peer-disabled" size={globalSize}>
79
- Disabled by peer checkbox
80
- </Label>
81
- </div>
82
- </ExampleSection>
57
+ </div>`} preview={
58
+ <>
59
+ <div className="flex items-center gap-2">
60
+ <input
61
+ type="checkbox"
62
+ disabled
63
+ id="peer-disabled"
64
+ className="peer w-4 h-4"
65
+ />
66
+ <Label htmlFor="peer-disabled" size={globalSize}>
67
+ Bị khóa bởi peer checkbox
68
+ </Label>
69
+ </div>
70
+ </>
71
+ } />
83
72
  </div>
84
73
  );
85
74
  }
86
75
 
87
- // ──────────────────────────────────────────────────────────
88
- // SECTION 3: Entry point (export default)
89
- // ──────────────────────────────────────────────────────────
90
76
  export default function LabelShowcase() {
91
77
  const { size: globalSize } = useDevContext();
92
78
  return (
93
79
  <Showcase
94
80
  title="Label"
95
81
  description="Nhãn gắn với form control, cải thiện accessibility."
96
- generalConcept={
82
+ guideline={
97
83
  <ShowcaseDocs>
98
84
  <DocsP>
99
85
  Label được sử dụng để gắn nhãn cho các trường nhập liệu form. Nó cải
@@ -103,11 +89,7 @@ export default function LabelShowcase() {
103
89
  </DocsP>
104
90
  </ShowcaseDocs>
105
91
  }
106
- tabs={[
107
- {
108
- label: "Micro (Primitive)",
109
- content: <LabelMicroShowcase globalSize={globalSize} /> },
110
- ]}
92
+ micro={{ content: <LabelMicroShowcase globalSize={globalSize} /> }}
111
93
  />
112
94
  );
113
95
  }