gladvn 0.2.17 → 0.2.18

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 (313) hide show
  1. package/bin/cli.js +9 -6
  2. package/dist/components/macro/accordion-preset.d.ts.map +1 -1
  3. package/dist/components/macro/alert-dialog-preset.d.ts.map +1 -1
  4. package/dist/components/macro/alert-preset.d.ts.map +1 -1
  5. package/dist/components/macro/avatar-preset.d.ts.map +1 -1
  6. package/dist/components/macro/breadcrumb-preset.d.ts.map +1 -1
  7. package/dist/components/macro/card-preset.d.ts.map +1 -1
  8. package/dist/components/macro/carousel-preset.d.ts.map +1 -1
  9. package/dist/components/macro/checkbox-preset.d.ts.map +1 -1
  10. package/dist/components/macro/combobox-preset.d.ts.map +1 -1
  11. package/dist/components/macro/command-preset.d.ts +1 -1
  12. package/dist/components/macro/command-preset.d.ts.map +1 -1
  13. package/dist/components/macro/date-picker.d.ts.map +1 -1
  14. package/dist/components/macro/dialog-preset.d.ts.map +1 -1
  15. package/dist/components/macro/empty-preset.d.ts.map +1 -1
  16. package/dist/components/macro/field-preset.d.ts.map +1 -1
  17. package/dist/components/macro/input-otp-preset.d.ts +6 -0
  18. package/dist/components/macro/input-otp-preset.d.ts.map +1 -1
  19. package/dist/components/macro/input-preset.d.ts +1 -1
  20. package/dist/components/macro/input-preset.d.ts.map +1 -1
  21. package/dist/components/macro/pagination-preset.d.ts.map +1 -1
  22. package/dist/components/macro/progress-preset.d.ts.map +1 -1
  23. package/dist/components/macro/radio-group-preset.d.ts.map +1 -1
  24. package/dist/components/macro/select-preset.d.ts.map +1 -1
  25. package/dist/components/macro/slider-preset.d.ts.map +1 -1
  26. package/dist/components/macro/switch-preset.d.ts.map +1 -1
  27. package/dist/components/macro/tabs-preset.d.ts +1 -1
  28. package/dist/components/macro/tabs-preset.d.ts.map +1 -1
  29. package/dist/components/macro/textarea-preset.d.ts +1 -1
  30. package/dist/components/macro/textarea-preset.d.ts.map +1 -1
  31. package/dist/components/micro/accordion.d.ts +7 -0
  32. package/dist/components/micro/accordion.d.ts.map +1 -1
  33. package/dist/components/micro/alert-dialog.d.ts.map +1 -1
  34. package/dist/components/micro/alert.d.ts +7 -0
  35. package/dist/components/micro/alert.d.ts.map +1 -1
  36. package/dist/components/micro/aspect-ratio.d.ts +7 -0
  37. package/dist/components/micro/aspect-ratio.d.ts.map +1 -1
  38. package/dist/components/micro/avatar.d.ts.map +1 -1
  39. package/dist/components/micro/badge.d.ts +8 -1
  40. package/dist/components/micro/badge.d.ts.map +1 -1
  41. package/dist/components/micro/breadcrumb.d.ts +7 -0
  42. package/dist/components/micro/breadcrumb.d.ts.map +1 -1
  43. package/dist/components/micro/button.d.ts +8 -1
  44. package/dist/components/micro/button.d.ts.map +1 -1
  45. package/dist/components/micro/calendar.d.ts +2 -2
  46. package/dist/components/micro/calendar.d.ts.map +1 -1
  47. package/dist/components/micro/carousel.d.ts.map +1 -1
  48. package/dist/components/micro/chart.d.ts.map +1 -1
  49. package/dist/components/micro/checkbox.d.ts.map +1 -1
  50. package/dist/components/micro/collapsible.d.ts.map +1 -1
  51. package/dist/components/micro/combobox.d.ts.map +1 -1
  52. package/dist/components/micro/command.d.ts.map +1 -1
  53. package/dist/components/micro/context-menu.d.ts.map +1 -1
  54. package/dist/components/micro/dialog.d.ts.map +1 -1
  55. package/dist/components/micro/drawer.d.ts.map +1 -1
  56. package/dist/components/micro/dropdown-menu.d.ts.map +1 -1
  57. package/dist/components/micro/empty.d.ts +7 -0
  58. package/dist/components/micro/empty.d.ts.map +1 -1
  59. package/dist/components/micro/field.d.ts.map +1 -1
  60. package/dist/components/micro/hover-card.d.ts +1 -1
  61. package/dist/components/micro/hover-card.d.ts.map +1 -1
  62. package/dist/components/micro/input-group.d.ts.map +1 -1
  63. package/dist/components/micro/input-otp.d.ts.map +1 -1
  64. package/dist/components/micro/input.d.ts +7 -0
  65. package/dist/components/micro/input.d.ts.map +1 -1
  66. package/dist/components/micro/item.d.ts.map +1 -1
  67. package/dist/components/micro/label.d.ts.map +1 -1
  68. package/dist/components/micro/menubar.d.ts.map +1 -1
  69. package/dist/components/micro/navigation-menu.d.ts +8 -1
  70. package/dist/components/micro/navigation-menu.d.ts.map +1 -1
  71. package/dist/components/micro/pagination.d.ts.map +1 -1
  72. package/dist/components/micro/popover.d.ts.map +1 -1
  73. package/dist/components/micro/progress.d.ts.map +1 -1
  74. package/dist/components/micro/radio-group.d.ts.map +1 -1
  75. package/dist/components/micro/select.d.ts +1 -1
  76. package/dist/components/micro/select.d.ts.map +1 -1
  77. package/dist/components/micro/sheet.d.ts.map +1 -1
  78. package/dist/components/micro/sidebar.d.ts.map +1 -1
  79. package/dist/components/micro/skeleton.d.ts +7 -0
  80. package/dist/components/micro/skeleton.d.ts.map +1 -1
  81. package/dist/components/micro/slider.d.ts +7 -0
  82. package/dist/components/micro/slider.d.ts.map +1 -1
  83. package/dist/components/micro/sonner.d.ts.map +1 -1
  84. package/dist/components/micro/spinner.d.ts.map +1 -1
  85. package/dist/components/micro/switch.d.ts.map +1 -1
  86. package/dist/components/micro/table.d.ts.map +1 -1
  87. package/dist/components/micro/tabs.d.ts +1 -1
  88. package/dist/components/micro/tabs.d.ts.map +1 -1
  89. package/dist/components/micro/textarea.d.ts +7 -0
  90. package/dist/components/micro/textarea.d.ts.map +1 -1
  91. package/dist/components/micro/toggle-group.d.ts.map +1 -1
  92. package/dist/components/micro/toggle.d.ts.map +1 -1
  93. package/dist/components/micro/tooltip.d.ts +1 -1
  94. package/dist/components/micro/tooltip.d.ts.map +1 -1
  95. package/dist/dev/App.d.ts.map +1 -1
  96. package/dist/dev/components/code-highlighter.d.ts.map +1 -1
  97. package/dist/dev/components/dev-context.d.ts.map +1 -1
  98. package/dist/dev/components/showcase.d.ts +1 -1
  99. package/dist/dev/components/showcase.d.ts.map +1 -1
  100. package/dist/dev/data.d.ts.map +1 -1
  101. package/dist/dev/main.d.ts.map +1 -1
  102. package/dist/dev/sections/buttons.d.ts.map +1 -1
  103. package/dist/dev/sections/feedback.d.ts.map +1 -1
  104. package/dist/dev/sections/overview.d.ts.map +1 -1
  105. package/dist/dev/showcase/accordion.d.ts.map +1 -1
  106. package/dist/dev/showcase/alert-dialog.d.ts.map +1 -1
  107. package/dist/dev/showcase/alert.d.ts.map +1 -1
  108. package/dist/dev/showcase/aspect-ratio.d.ts.map +1 -1
  109. package/dist/dev/showcase/avatar.d.ts.map +1 -1
  110. package/dist/dev/showcase/breadcrumb.d.ts.map +1 -1
  111. package/dist/dev/showcase/button.d.ts.map +1 -1
  112. package/dist/dev/showcase/calendar.d.ts.map +1 -1
  113. package/dist/dev/showcase/card.d.ts.map +1 -1
  114. package/dist/dev/showcase/carousel.d.ts.map +1 -1
  115. package/dist/dev/showcase/chart.d.ts.map +1 -1
  116. package/dist/dev/showcase/checkbox.d.ts.map +1 -1
  117. package/dist/dev/showcase/collapsible.d.ts.map +1 -1
  118. package/dist/dev/showcase/combobox.d.ts.map +1 -1
  119. package/dist/dev/showcase/command.d.ts.map +1 -1
  120. package/dist/dev/showcase/context-menu.d.ts.map +1 -1
  121. package/dist/dev/showcase/dialog.d.ts.map +1 -1
  122. package/dist/dev/showcase/drawer.d.ts.map +1 -1
  123. package/dist/dev/showcase/dropdown-menu.d.ts.map +1 -1
  124. package/dist/dev/showcase/empty.d.ts.map +1 -1
  125. package/dist/dev/showcase/hover-card.d.ts.map +1 -1
  126. package/dist/dev/showcase/input-group.d.ts.map +1 -1
  127. package/dist/dev/showcase/input-otp.d.ts.map +1 -1
  128. package/dist/dev/showcase/input.d.ts.map +1 -1
  129. package/dist/dev/showcase/item.d.ts.map +1 -1
  130. package/dist/dev/showcase/kbd.d.ts.map +1 -1
  131. package/dist/dev/showcase/label.d.ts.map +1 -1
  132. package/dist/dev/showcase/menubar.d.ts.map +1 -1
  133. package/dist/dev/showcase/navigation-menu.d.ts.map +1 -1
  134. package/dist/dev/showcase/overview.d.ts.map +1 -1
  135. package/dist/dev/showcase/pagination.d.ts.map +1 -1
  136. package/dist/dev/showcase/popover.d.ts.map +1 -1
  137. package/dist/dev/showcase/progress.d.ts.map +1 -1
  138. package/dist/dev/showcase/radio-group.d.ts.map +1 -1
  139. package/dist/dev/showcase/resizable.d.ts.map +1 -1
  140. package/dist/dev/showcase/scroll-area.d.ts.map +1 -1
  141. package/dist/dev/showcase/select.d.ts.map +1 -1
  142. package/dist/dev/showcase/separator.d.ts.map +1 -1
  143. package/dist/dev/showcase/sheet.d.ts.map +1 -1
  144. package/dist/dev/showcase/sidebar.d.ts.map +1 -1
  145. package/dist/dev/showcase/skeleton.d.ts.map +1 -1
  146. package/dist/dev/showcase/slider.d.ts.map +1 -1
  147. package/dist/dev/showcase/sonner.d.ts.map +1 -1
  148. package/dist/dev/showcase/spinner.d.ts.map +1 -1
  149. package/dist/dev/showcase/switch.d.ts.map +1 -1
  150. package/dist/dev/showcase/table.d.ts.map +1 -1
  151. package/dist/dev/showcase/tabs.d.ts.map +1 -1
  152. package/dist/dev/showcase/textarea.d.ts.map +1 -1
  153. package/dist/dev/showcase/theme-provider.d.ts.map +1 -1
  154. package/dist/dev/showcase/toast.d.ts.map +1 -1
  155. package/dist/dev/showcase/toggle-group.d.ts.map +1 -1
  156. package/dist/dev/showcase/toggle.d.ts.map +1 -1
  157. package/dist/dev/showcase/tooltip.d.ts.map +1 -1
  158. package/dist/index.cjs.map +1 -1
  159. package/dist/index.js.map +1 -1
  160. package/dist/lib/utils.d.ts.map +1 -1
  161. package/package.json +3 -1
  162. package/scripts/format-codestrings.ts +87 -0
  163. package/scripts/organize-imports.ts +21 -0
  164. package/scripts/regex-format.cjs +67 -0
  165. package/scripts/tmp.tsx +25 -0
  166. package/src/components/macro/accordion-preset.test.tsx +1 -0
  167. package/src/components/macro/accordion-preset.tsx +2 -1
  168. package/src/components/macro/alert-dialog-preset.tsx +44 -43
  169. package/src/components/macro/alert-preset.tsx +7 -3
  170. package/src/components/macro/avatar-preset.tsx +2 -1
  171. package/src/components/macro/breadcrumb-preset.tsx +2 -1
  172. package/src/components/macro/card-preset.tsx +2 -1
  173. package/src/components/macro/carousel-preset.tsx +5 -2
  174. package/src/components/macro/checkbox-preset.test.tsx +1 -0
  175. package/src/components/macro/checkbox-preset.tsx +6 -2
  176. package/src/components/macro/combobox-preset.tsx +6 -3
  177. package/src/components/macro/command-preset.tsx +7 -3
  178. package/src/components/macro/date-picker.tsx +77 -59
  179. package/src/components/macro/dialog-preset.tsx +42 -38
  180. package/src/components/macro/empty-preset.tsx +2 -1
  181. package/src/components/macro/field-preset.test.tsx +1 -0
  182. package/src/components/macro/field-preset.tsx +2 -1
  183. package/src/components/macro/input-otp-preset.tsx +6 -2
  184. package/src/components/macro/input-preset.test.tsx +1 -0
  185. package/src/components/macro/input-preset.tsx +4 -2
  186. package/src/components/macro/pagination-preset.tsx +3 -1
  187. package/src/components/macro/progress-preset.test.tsx +1 -0
  188. package/src/components/macro/progress-preset.tsx +2 -1
  189. package/src/components/macro/radio-group-preset.tsx +4 -1
  190. package/src/components/macro/select-preset.tsx +35 -30
  191. package/src/components/macro/slider-preset.test.tsx +1 -0
  192. package/src/components/macro/slider-preset.tsx +4 -1
  193. package/src/components/macro/switch-preset.test.tsx +1 -0
  194. package/src/components/macro/switch-preset.tsx +4 -1
  195. package/src/components/macro/tabs-preset.test.tsx +1 -0
  196. package/src/components/macro/tabs-preset.tsx +4 -2
  197. package/src/components/macro/textarea-preset.test.tsx +1 -0
  198. package/src/components/macro/textarea-preset.tsx +4 -1
  199. package/src/components/micro/accordion.tsx +3 -2
  200. package/src/components/micro/alert-dialog.tsx +2 -1
  201. package/src/components/micro/alert.tsx +3 -2
  202. package/src/components/micro/aspect-ratio.tsx +2 -1
  203. package/src/components/micro/avatar.tsx +2 -1
  204. package/src/components/micro/badge.tsx +3 -3
  205. package/src/components/micro/breadcrumb.tsx +3 -2
  206. package/src/components/micro/button.test.tsx +1 -0
  207. package/src/components/micro/button.tsx +3 -3
  208. package/src/components/micro/calendar.tsx +10 -9
  209. package/src/components/micro/carousel.tsx +3 -2
  210. package/src/components/micro/chart.tsx +1 -0
  211. package/src/components/micro/checkbox.tsx +2 -2
  212. package/src/components/micro/collapsible.tsx +4 -2
  213. package/src/components/micro/combobox.tsx +41 -29
  214. package/src/components/micro/command.tsx +23 -16
  215. package/src/components/micro/context-menu.tsx +3 -2
  216. package/src/components/micro/dialog.tsx +2 -1
  217. package/src/components/micro/drawer.tsx +2 -1
  218. package/src/components/micro/dropdown-menu.tsx +3 -2
  219. package/src/components/micro/empty.tsx +2 -1
  220. package/src/components/micro/field.tsx +4 -3
  221. package/src/components/micro/hover-card.tsx +20 -19
  222. package/src/components/micro/input-group.tsx +2 -1
  223. package/src/components/micro/input-otp.tsx +3 -2
  224. package/src/components/micro/input.tsx +3 -2
  225. package/src/components/micro/item.tsx +1 -0
  226. package/src/components/micro/label.tsx +2 -1
  227. package/src/components/micro/menubar.tsx +2 -1
  228. package/src/components/micro/navigation-menu.tsx +18 -17
  229. package/src/components/micro/pagination.tsx +2 -1
  230. package/src/components/micro/popover.tsx +2 -1
  231. package/src/components/micro/progress.tsx +2 -1
  232. package/src/components/micro/radio-group.tsx +3 -3
  233. package/src/components/micro/select.tsx +5 -4
  234. package/src/components/micro/sheet.tsx +2 -1
  235. package/src/components/micro/sidebar.tsx +4 -1
  236. package/src/components/micro/skeleton.tsx +2 -1
  237. package/src/components/micro/slider.tsx +4 -1
  238. package/src/components/micro/sonner.tsx +2 -1
  239. package/src/components/micro/spinner.tsx +1 -2
  240. package/src/components/micro/switch.tsx +2 -2
  241. package/src/components/micro/table.tsx +2 -1
  242. package/src/components/micro/tabs.tsx +4 -3
  243. package/src/components/micro/textarea.tsx +2 -1
  244. package/src/components/micro/toggle-group.tsx +1 -0
  245. package/src/components/micro/toggle.tsx +1 -3
  246. package/src/components/micro/tooltip.tsx +9 -3
  247. package/src/dev/App.tsx +66 -41
  248. package/src/dev/components/code-highlighter.tsx +2 -1
  249. package/src/dev/components/dev-context.tsx +1 -0
  250. package/src/dev/components/showcase.tsx +13 -14
  251. package/src/dev/data.ts +206 -52
  252. package/src/dev/main.tsx +4 -4
  253. package/src/dev/sections/buttons.tsx +14 -12
  254. package/src/dev/sections/feedback.tsx +7 -2
  255. package/src/dev/sections/forms.tsx +11 -11
  256. package/src/dev/sections/overview.tsx +2 -1
  257. package/src/dev/showcase/accordion.tsx +399 -314
  258. package/src/dev/showcase/alert-dialog.tsx +387 -384
  259. package/src/dev/showcase/alert.tsx +271 -258
  260. package/src/dev/showcase/aspect-ratio.tsx +102 -105
  261. package/src/dev/showcase/avatar.tsx +216 -145
  262. package/src/dev/showcase/badge.tsx +78 -50
  263. package/src/dev/showcase/breadcrumb.tsx +88 -85
  264. package/src/dev/showcase/button.tsx +72 -96
  265. package/src/dev/showcase/calendar.tsx +41 -39
  266. package/src/dev/showcase/card.tsx +170 -148
  267. package/src/dev/showcase/carousel.tsx +239 -77
  268. package/src/dev/showcase/chart.tsx +5 -4
  269. package/src/dev/showcase/checkbox.tsx +206 -140
  270. package/src/dev/showcase/collapsible.tsx +108 -84
  271. package/src/dev/showcase/combobox.tsx +272 -199
  272. package/src/dev/showcase/command.tsx +31 -28
  273. package/src/dev/showcase/context-menu.tsx +94 -77
  274. package/src/dev/showcase/dialog.tsx +445 -424
  275. package/src/dev/showcase/drawer.tsx +142 -135
  276. package/src/dev/showcase/dropdown-menu.tsx +165 -161
  277. package/src/dev/showcase/empty.tsx +173 -158
  278. package/src/dev/showcase/hover-card.tsx +92 -52
  279. package/src/dev/showcase/input-group.tsx +193 -160
  280. package/src/dev/showcase/input-otp.tsx +109 -99
  281. package/src/dev/showcase/input.tsx +78 -42
  282. package/src/dev/showcase/item.tsx +101 -98
  283. package/src/dev/showcase/kbd.tsx +78 -62
  284. package/src/dev/showcase/label.tsx +16 -23
  285. package/src/dev/showcase/menubar.tsx +274 -251
  286. package/src/dev/showcase/navigation-menu.tsx +175 -170
  287. package/src/dev/showcase/overview.tsx +164 -148
  288. package/src/dev/showcase/pagination.tsx +101 -69
  289. package/src/dev/showcase/popover.tsx +113 -86
  290. package/src/dev/showcase/progress.tsx +99 -69
  291. package/src/dev/showcase/radio-group.tsx +217 -134
  292. package/src/dev/showcase/resizable.tsx +65 -55
  293. package/src/dev/showcase/scroll-area.tsx +32 -22
  294. package/src/dev/showcase/select.tsx +192 -136
  295. package/src/dev/showcase/separator.tsx +28 -24
  296. package/src/dev/showcase/sheet.tsx +182 -134
  297. package/src/dev/showcase/sidebar.tsx +9 -5
  298. package/src/dev/showcase/skeleton.tsx +54 -59
  299. package/src/dev/showcase/slider.tsx +158 -129
  300. package/src/dev/showcase/sonner.tsx +3 -5
  301. package/src/dev/showcase/spinner.tsx +22 -18
  302. package/src/dev/showcase/switch.tsx +207 -110
  303. package/src/dev/showcase/table.tsx +44 -32
  304. package/src/dev/showcase/tabs.tsx +272 -267
  305. package/src/dev/showcase/textarea.tsx +162 -116
  306. package/src/dev/showcase/theme-provider.tsx +596 -534
  307. package/src/dev/showcase/toast.tsx +37 -38
  308. package/src/dev/showcase/toggle-group.tsx +87 -39
  309. package/src/dev/showcase/toggle.tsx +36 -27
  310. package/src/dev/showcase/tooltip.tsx +154 -119
  311. package/src/lib/utils.test.ts +1 -0
  312. package/src/lib/utils.ts +1 -1
  313. package/src/styles/gladvn.css +1 -1
@@ -1,11 +1,5 @@
1
- import { useDevContext } from "../../dev/components/dev-context";
2
- import {
3
- DocsP,
4
- ExampleGrid,
5
- ExampleSection,
6
- Showcase,
7
- ShowcaseDocs,
8
- } from "../../dev/components/showcase";
1
+ import { useState } from "react";
2
+
9
3
  import {
10
4
  InfoIcon,
11
5
  LogOutIcon,
@@ -15,7 +9,6 @@ import {
15
9
  TrashIcon,
16
10
  XIcon,
17
11
  } from "lucide-react";
18
- import { useState } from "react";
19
12
 
20
13
  import { AlertDialogPreset } from "../../components/macro/alert-dialog-preset";
21
14
  import {
@@ -28,11 +21,19 @@ import {
28
21
  AlertDialogFooter,
29
22
  AlertDialogHeader,
30
23
  AlertDialogMedia,
24
+ AlertDialogPortal,
31
25
  AlertDialogTitle,
32
26
  AlertDialogTrigger,
33
- AlertDialogPortal,
34
27
  } from "../../components/micro/alert-dialog";
35
28
  import { Button } from "../../components/micro/button";
29
+ import { useDevContext } from "../../dev/components/dev-context";
30
+ import {
31
+ DocsP,
32
+ ExampleGrid,
33
+ ExampleSection,
34
+ Showcase,
35
+ ShowcaseDocs,
36
+ } from "../../dev/components/showcase";
36
37
  import { type Size } from "../../lib/types";
37
38
 
38
39
  // ──────────────────────────────────────────────────────────
@@ -48,19 +49,18 @@ function AlertDialogMacroShowcase({ globalSize }: { globalSize: Size }) {
48
49
  label="Hành Động Nguy Danger (Destructive)"
49
50
  description="Sử dụng actionColor='destructive' để tạo nút hành động nguy hiểm."
50
51
  codeString={`<AlertDialogPreset
51
- trigger={
52
- <Button variant="outline" color="destructive">
53
- Xoá Tài Khoản
54
- </Button>
55
- }
56
- title="Bạn có chắc chắn muốn xoá?"
57
- description="Hành động này không thể hoàn tác. Tài khoản và toàn bộ dữ liệu của bạn trên hệ thống sẽ bị xoá vĩnh viễn."
58
- cancelLabel="Huỷ"
59
- actionLabel="Xoá"
60
- actionColor="destructive"
61
- onAction={() => console.log("Deleted!")}
62
- />
63
- `}
52
+ trigger={
53
+ <Button variant="outline" color="destructive">
54
+ Xoá Tài Khoản
55
+ </Button>
56
+ }
57
+ title="Bạn có chắc chắn muốn xoá?"
58
+ description="Hành động này không thể hoàn tác. Tài khoản và toàn bộ dữ liệu của bạn trên hệ thống sẽ bị xoá vĩnh viễn."
59
+ cancelLabel="Huỷ"
60
+ actionLabel="Xoá"
61
+ actionColor="destructive"
62
+ onAction={() => console.log("Deleted!")}
63
+ />`}
64
64
  >
65
65
  <AlertDialogPreset
66
66
  size={globalSize}
@@ -82,18 +82,13 @@ function AlertDialogMacroShowcase({ globalSize }: { globalSize: Size }) {
82
82
  label="Xác Nhận Tiêu Chuẩn"
83
83
  description="Dialog xác nhận thông thường chỉ với Text."
84
84
  codeString={`<AlertDialogPreset
85
- trigger={
86
- <Button variant="outline">
87
- Đăng Xuất
88
- </Button>
89
- }
90
- title="Đăng xuất khỏi tài khoản?"
91
- description="Bạn sẽ cần nhập lại thông tin đăng nhập để truy cập vào tài khoản."
92
- cancelLabel="Ở Lại"
93
- actionLabel="Đăng Xuất"
94
- onAction={() => console.log("Logged out!")}
95
- />
96
- `}
85
+ trigger={<Button variant="outline">Đăng Xuất</Button>}
86
+ title="Đăng xuất khỏi tài khoản?"
87
+ description="Bạn sẽ cần nhập lại thông tin đăng nhập để truy cập vào tài khoản."
88
+ cancelLabel="Ở Lại"
89
+ actionLabel="Đăng Xuất"
90
+ onAction={() => console.log("Logged out!")}
91
+ />`}
97
92
  >
98
93
  <AlertDialogPreset
99
94
  size={globalSize}
@@ -116,24 +111,23 @@ function AlertDialogMacroShowcase({ globalSize }: { globalSize: Size }) {
116
111
  label="Kèm Media (Icon/Image)"
117
112
  description="Tự động chia cột Flexbox Side-by-Side khi truyền prop 'icon'."
118
113
  codeString={`<AlertDialogPreset
119
- trigger={
120
- <Button variant="outline" color="warning">
121
- Thu Hồi Quyền
122
- </Button>
123
- }
124
- icon={
125
- <div className="flex size-full items-center justify-center rounded-full bg-warning/10">
126
- <ShieldAlertIcon className="text-warning" />
127
- </div>
128
- }
129
- title="Thu hồi quyền truy cập API?"
130
- description="Tất cả các ứng dụng đang sử dụng API key này sẽ bị mất quyền truy cập ngay lập tức."
131
- cancelLabel="Giữ Lại"
132
- actionLabel="Thu Hồi"
133
- actionColor="warning"
134
- onAction={() => console.log("Revoked!")}
135
- />
136
- `}
114
+ trigger={
115
+ <Button variant="outline" color="warning">
116
+ Thu Hồi Quyền
117
+ </Button>
118
+ }
119
+ icon={
120
+ <div className="flex size-full items-center justify-center rounded-full bg-warning/10">
121
+ <ShieldAlertIcon className="text-warning" />
122
+ </div>
123
+ }
124
+ title="Thu hồi quyền truy cập API?"
125
+ description="Tất cả các ứng dụng đang sử dụng API key này sẽ bị mất quyền truy cập ngay lập tức."
126
+ cancelLabel="Giữ Lại"
127
+ actionLabel="Thu Hồi"
128
+ actionColor="warning"
129
+ onAction={() => console.log("Revoked!")}
130
+ />`}
137
131
  >
138
132
  <AlertDialogPreset
139
133
  size={globalSize}
@@ -214,26 +208,23 @@ return (
214
208
  label="Custom Button Variants"
215
209
  description="Tuỳ chỉnh variant cho cả nút Action (soft) và Cancel (ghost) thông qua actionVariant/cancelVariant."
216
210
  codeString={`<AlertDialogPreset
217
- trigger={
218
- <Button variant="outline">
219
- Custom Variants
220
- </Button>
221
- }
222
- icon={
223
- <div className="flex size-full items-center justify-center rounded-full bg-info/10">
224
- <MailWarningIcon className="text-info" />
225
- </div>
226
- }
227
- title="Gửi phản hồi?"
228
- description="Phản hồi của bạn sẽ được gửi ẩn danh tới đội ngũ phát triển."
229
- cancelLabel="Bỏ qua"
230
- cancelVariant="ghost"
231
- actionLabel="Gửi"
232
- actionColor="info"
233
- actionVariant="soft"
234
- onAction={() => console.log("Feedback sent!")}
235
- />
236
- `}
211
+ trigger={
212
+ <Button variant="outline">Custom Variants</Button>
213
+ }
214
+ icon={
215
+ <div className="flex size-full items-center justify-center rounded-full bg-info/10">
216
+ <MailWarningIcon className="text-info" />
217
+ </div>
218
+ }
219
+ title="Gửi phản hồi?"
220
+ description="Phản hồi của bạn sẽ được gửi ẩn danh tới đội ngũ phát triển."
221
+ cancelLabel="Bỏ qua"
222
+ cancelVariant="ghost"
223
+ actionLabel="Gửi"
224
+ actionColor="info"
225
+ actionVariant="soft"
226
+ onAction={() => console.log("Feedback sent!")}
227
+ />`}
237
228
  >
238
229
  <AlertDialogPreset
239
230
  size={globalSize}
@@ -262,25 +253,24 @@ return (
262
253
  label="Children (Nội dung bổ sung)"
263
254
  description="Prop children cho phép chèn thêm nội dung tuỳ ý vào phần Header."
264
255
  codeString={`<AlertDialogPreset
265
- trigger={
266
- <Button variant="outline" color="warning">
267
- Báo Cáo Lỗi
268
- </Button>
269
- }
270
- title="Báo cáo lỗi hệ thống"
271
- description="Vui lòng kiểm tra thông tin lỗi bên dưới trước khi gửi."
272
- cancelLabel="Huỷ"
273
- actionLabel="Gửi Báo Cáo"
274
- actionColor="warning"
275
- onAction={() => console.log("Report sent!")}
276
- >
277
- <div className="mt-2 rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-muted-foreground">
278
- <p>Error Code: ERR_NETWORK_TIMEOUT</p>
279
- <p>Timestamp: 2026-07-05T14:30:00Z</p>
280
- <p>Module: api/gateway</p>
281
- </div>
282
- </AlertDialogPreset>
283
- `}
256
+ trigger={
257
+ <Button variant="outline" color="warning">
258
+ Báo Cáo Lỗi
259
+ </Button>
260
+ }
261
+ title="Báo cáo lỗi hệ thống"
262
+ description="Vui lòng kiểm tra thông tin lỗi bên dưới trước khi gửi."
263
+ cancelLabel="Huỷ"
264
+ actionLabel="Gửi Báo Cáo"
265
+ actionColor="warning"
266
+ onAction={() => console.log("Report sent!")}
267
+ >
268
+ <div className="mt-2 rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-muted-foreground">
269
+ <p>Error Code: ERR_NETWORK_TIMEOUT</p>
270
+ <p>Timestamp: 2026-07-05T14:30:00Z</p>
271
+ <p>Module: api/gateway</p>
272
+ </div>
273
+ </AlertDialogPreset>`}
284
274
  >
285
275
  <AlertDialogPreset
286
276
  size={globalSize}
@@ -310,23 +300,20 @@ return (
310
300
  label="Giao Diện Nhỏ (Compact)"
311
301
  description="Khi dùng size='sm', nội dung sẽ được căn giữa và footer tự động dàn hàng ngang 2 cột."
312
302
  codeString={`<AlertDialogPreset
313
- size="sm"
314
- trigger={
315
- <Button variant="outline">
316
- Xác Nhận Nhanh
317
- </Button>
318
- }
319
- icon={
320
- <div className="flex size-full items-center justify-center rounded-full bg-muted">
321
- <InfoIcon />
322
- </div>
323
- }
324
- title="Xác nhận hành động?"
325
- description="Đây là dialog dạng nhỏ, phù hợp cho các thao tác nhanh với 2 nút nằm ngang."
326
- cancelLabel="Không"
327
- actionLabel="Có"
328
- />
329
- `}
303
+ size="sm"
304
+ trigger={
305
+ <Button variant="outline">Xác Nhận Nhanh</Button>
306
+ }
307
+ icon={
308
+ <div className="flex size-full items-center justify-center rounded-full bg-muted">
309
+ <InfoIcon />
310
+ </div>
311
+ }
312
+ title="Xác nhận hành động?"
313
+ description="Đây là dialog dạng nhỏ, phù hợp cho các thao tác nhanh với 2 nút nằm ngang."
314
+ cancelLabel="Không"
315
+ actionLabel=""
316
+ />`}
330
317
  >
331
318
  <AlertDialogPreset
332
319
  size="sm"
@@ -362,30 +349,30 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
362
349
  label="Sử dụng Cơ bản"
363
350
  description="Lắp ráp thủ công các khối Header, Title, Description, Footer."
364
351
  codeString={`<AlertDialog>
365
- <AlertDialogTrigger
366
- render={
367
- <Button variant="outline">
368
- Mở Dialog Trắng
369
- </Button>
370
- }
371
- />
372
- <AlertDialogPortal><AlertDialogContent>
373
- <AlertDialogHeader>
374
- <AlertDialogTitle>Cấu trúc nguyên thuỷ</AlertDialogTitle>
375
- <AlertDialogDescription>
376
- Không có bất kỳ layout "thần thánh" nào ép buộc ở đây. Các
377
- thành phần chỉ xếp dọc (flex-col) mặc định.
378
- </AlertDialogDescription>
379
- </AlertDialogHeader>
380
- <AlertDialogFooter>
381
- <AlertDialogCancel>Huỷ bỏ</AlertDialogCancel>
382
- <AlertDialogAction>
383
- Tiếp tục
384
- </AlertDialogAction>
385
- </AlertDialogFooter>
386
- </AlertDialogContent></AlertDialogPortal>
387
- </AlertDialog>
388
- `}
352
+ <AlertDialogTrigger
353
+ render={
354
+ <Button variant="outline">Mở Dialog Trắng</Button>
355
+ }
356
+ />
357
+ <AlertDialogPortal>
358
+ <AlertDialogContent>
359
+ <AlertDialogHeader>
360
+ <AlertDialogTitle>
361
+ Cấu trúc nguyên thuỷ
362
+ </AlertDialogTitle>
363
+ <AlertDialogDescription>
364
+ Không bất kỳ layout "thần thánh" nào ép buộc
365
+ ở đây. Các thành phần chỉ xếp dọc (flex-col) mặc
366
+ định.
367
+ </AlertDialogDescription>
368
+ </AlertDialogHeader>
369
+ <AlertDialogFooter>
370
+ <AlertDialogCancel>Huỷ bỏ</AlertDialogCancel>
371
+ <AlertDialogAction>Tiếp tục</AlertDialogAction>
372
+ </AlertDialogFooter>
373
+ </AlertDialogContent>
374
+ </AlertDialogPortal>
375
+ </AlertDialog>`}
389
376
  >
390
377
  <AlertDialog>
391
378
  <AlertDialogTrigger
@@ -422,34 +409,35 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
422
409
  label="Tự Do Custom Layout"
423
410
  description="Bởi vì Micro component rất 'dumb', bạn có thể tự chèn thẻ div, custom flexbox để làm ra bất kỳ giao diện nào."
424
411
  codeString={`<AlertDialog>
425
- <AlertDialogTrigger
426
- render={
427
- <Button variant="outline" color="warning">
428
- Giao Diện Custom
429
- </Button>
430
- }
431
- />
432
- <AlertDialogPortal><AlertDialogContent className="border-warning/50">
433
- <div className="flex flex-col-reverse items-center justify-center gap-4 py-4 sm:flex-row">
434
- <div className="size-16 rounded-lg bg-warning/20 border border-warning" />
435
- <AlertDialogHeader className="sm:text-left">
436
- <AlertDialogTitle className="text-warning">
437
- Cảnh báo Tùy chỉnh
438
- </AlertDialogTitle>
439
- <AlertDialogDescription>
440
- Icon đang nằm bên trái, hoặc có thể dời sang phải tuỳ ý bạn
441
- bạn đang kiểm soát HTML.
442
- </AlertDialogDescription>
443
- </AlertDialogHeader>
444
- </div>
445
- <AlertDialogFooter className="border-t-0 bg-transparent">
446
- <AlertDialogCancel className="w-full">
447
- Tôi đã hiểu
448
- </AlertDialogCancel>
449
- </AlertDialogFooter>
450
- </AlertDialogContent></AlertDialogPortal>
451
- </AlertDialog>
452
- `}
412
+ <AlertDialogTrigger
413
+ render={
414
+ <Button variant="outline" color="warning">
415
+ Giao Diện Custom
416
+ </Button>
417
+ }
418
+ />
419
+ <AlertDialogPortal>
420
+ <AlertDialogContent className="border-warning/50">
421
+ <div className="flex flex-col-reverse items-center justify-center gap-4 py-4 sm:flex-row">
422
+ <div className="size-16 rounded-lg bg-warning/20 border border-warning" />
423
+ <AlertDialogHeader className="sm:text-left">
424
+ <AlertDialogTitle className="text-warning">
425
+ Cảnh báo Tùy chỉnh
426
+ </AlertDialogTitle>
427
+ <AlertDialogDescription>
428
+ Icon đang nằm bên trái, hoặc có thể dời sang
429
+ phải tuỳ ý bạn vì bạn đang kiểm soát HTML.
430
+ </AlertDialogDescription>
431
+ </AlertDialogHeader>
432
+ </div>
433
+ <AlertDialogFooter className="border-t-0 bg-transparent">
434
+ <AlertDialogCancel className="w-full">
435
+ Tôi đã hiểu
436
+ </AlertDialogCancel>
437
+ </AlertDialogFooter>
438
+ </AlertDialogContent>
439
+ </AlertDialogPortal>
440
+ </AlertDialog>`}
453
441
  >
454
442
  <AlertDialog>
455
443
  <AlertDialogTrigger
@@ -493,35 +481,35 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
493
481
  label="AlertDialogMedia"
494
482
  description="Khối chứa Icon/Image, tự scale theo size của AlertDialogContent."
495
483
  codeString={`<AlertDialog>
496
- <AlertDialogTrigger
497
- render={
498
- <Button variant="outline">
499
- Với Media
500
- </Button>
501
- }
502
- />
503
- <AlertDialogPortal><AlertDialogContent>
504
- <div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
505
- <AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
506
- <ShieldAlertIcon className="text-warning" />
507
- </AlertDialogMedia>
508
- <AlertDialogHeader>
509
- <AlertDialogTitle>Cảnh báo bảo mật</AlertDialogTitle>
510
- <AlertDialogDescription>
511
- AlertDialogMedia khối div chứa icon, tự động scale kích
512
- thước theo data-size của AlertDialogContent.
513
- </AlertDialogDescription>
514
- </AlertDialogHeader>
515
- </div>
516
- <AlertDialogFooter>
517
- <AlertDialogCancel>Huỷ</AlertDialogCancel>
518
- <AlertDialogAction color="warning">
519
- Xác nhận
520
- </AlertDialogAction>
521
- </AlertDialogFooter>
522
- </AlertDialogContent></AlertDialogPortal>
523
- </AlertDialog>
524
- `}
484
+ <AlertDialogTrigger
485
+ render={<Button variant="outline">Với Media</Button>}
486
+ />
487
+ <AlertDialogPortal>
488
+ <AlertDialogContent>
489
+ <div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
490
+ <AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
491
+ <ShieldAlertIcon className="text-warning" />
492
+ </AlertDialogMedia>
493
+ <AlertDialogHeader>
494
+ <AlertDialogTitle>
495
+ Cảnh báo bảo mật
496
+ </AlertDialogTitle>
497
+ <AlertDialogDescription>
498
+ AlertDialogMedia là khối div chứa icon, tự
499
+ động scale kích thước theo data-size của
500
+ AlertDialogContent.
501
+ </AlertDialogDescription>
502
+ </AlertDialogHeader>
503
+ </div>
504
+ <AlertDialogFooter>
505
+ <AlertDialogCancel>Huỷ</AlertDialogCancel>
506
+ <AlertDialogAction color="warning">
507
+ Xác nhận
508
+ </AlertDialogAction>
509
+ </AlertDialogFooter>
510
+ </AlertDialogContent>
511
+ </AlertDialogPortal>
512
+ </AlertDialog>`}
525
513
  >
526
514
  <AlertDialog>
527
515
  <AlertDialogTrigger
@@ -561,33 +549,34 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
561
549
  label="AlertDialogClose"
562
550
  description="Primitive đóng dialog cơ bản, cho phép render bất kỳ element nào (không bị ép thành Button)."
563
551
  codeString={`<AlertDialog>
564
- <AlertDialogTrigger
565
- render={
566
- <Button variant="outline">
567
- Dialog Có Nút X
568
- </Button>
569
- }
570
- />
571
- <AlertDialogPortal><AlertDialogContent>
572
- <AlertDialogClose className="absolute top-3 right-3 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none">
573
- <XIcon className="size-4" />
574
- <span className="sr-only">Đóng</span>
575
- </AlertDialogClose>
576
- <AlertDialogHeader>
577
- <AlertDialogTitle>AlertDialogClose</AlertDialogTitle>
578
- <AlertDialogDescription>
579
- Khác với AlertDialogCancel (luôn render Button),
580
- AlertDialogClose bare-bone bạn có thể render icon X,
581
- link, hay bất kỳ thứ gì.
582
- </AlertDialogDescription>
583
- </AlertDialogHeader>
584
- <AlertDialogFooter>
585
- <AlertDialogCancel>Huỷ</AlertDialogCancel>
586
- <AlertDialogAction>Đồng ý</AlertDialogAction>
587
- </AlertDialogFooter>
588
- </AlertDialogContent></AlertDialogPortal>
589
- </AlertDialog>
590
- `}
552
+ <AlertDialogTrigger
553
+ render={
554
+ <Button variant="outline">Dialog Có Nút X</Button>
555
+ }
556
+ />
557
+ <AlertDialogPortal>
558
+ <AlertDialogContent>
559
+ <AlertDialogClose className="absolute top-3 right-3 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none">
560
+ <XIcon className="size-4" />
561
+ <span className="sr-only">Đóng</span>
562
+ </AlertDialogClose>
563
+ <AlertDialogHeader>
564
+ <AlertDialogTitle>
565
+ AlertDialogClose
566
+ </AlertDialogTitle>
567
+ <AlertDialogDescription>
568
+ Khác với AlertDialogCancel (luôn render Button),
569
+ AlertDialogClose bare-bone bạn có thể
570
+ render icon X, link, hay bất kỳ thứ gì.
571
+ </AlertDialogDescription>
572
+ </AlertDialogHeader>
573
+ <AlertDialogFooter>
574
+ <AlertDialogCancel>Huỷ</AlertDialogCancel>
575
+ <AlertDialogAction>Đồng ý</AlertDialogAction>
576
+ </AlertDialogFooter>
577
+ </AlertDialogContent>
578
+ </AlertDialogPortal>
579
+ </AlertDialog>`}
591
580
  >
592
581
  <AlertDialog>
593
582
  <AlertDialogTrigger
@@ -629,34 +618,38 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
629
618
  label="Action Colors"
630
619
  description="AlertDialogAction hỗ trợ prop color để thay đổi ngữ nghĩa hành động."
631
620
  codeString={`<AlertDialog>
632
- <AlertDialogTrigger
633
- render={
634
- <Button variant="outline" color="destructive">
635
- Xoá Tài Khoản
636
- </Button>
637
- }
638
- />
639
- <AlertDialogPortal><AlertDialogContent>
640
- <div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
641
- <AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
642
- <TrashIcon className="text-destructive" />
643
- </AlertDialogMedia>
644
- <AlertDialogHeader>
645
- <AlertDialogTitle>Xoá tài khoản vĩnh viễn?</AlertDialogTitle>
646
- <AlertDialogDescription>
647
- Tất cả dữ liệu sẽ bị xoá và không thể khôi phục.
648
- </AlertDialogDescription>
649
- </AlertDialogHeader>
650
- </div>
651
- <AlertDialogFooter>
652
- <AlertDialogCancel>Huỷ</AlertDialogCancel>
653
- <AlertDialogAction color="destructive">
654
- Xoá vĩnh viễn
655
- </AlertDialogAction>
656
- </AlertDialogFooter>
657
- </AlertDialogContent></AlertDialogPortal>
658
- </AlertDialog>
659
- `}
621
+ <AlertDialogTrigger
622
+ render={
623
+ <Button variant="outline" color="destructive">
624
+ Xoá Tài Khoản
625
+ </Button>
626
+ }
627
+ />
628
+ <AlertDialogPortal>
629
+ <AlertDialogContent>
630
+ <div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
631
+ <AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
632
+ <TrashIcon className="text-destructive" />
633
+ </AlertDialogMedia>
634
+ <AlertDialogHeader>
635
+ <AlertDialogTitle>
636
+ Xoá tài khoản vĩnh viễn?
637
+ </AlertDialogTitle>
638
+ <AlertDialogDescription>
639
+ Tất cả dữ liệu sẽ bị xoá và không thể khôi
640
+ phục.
641
+ </AlertDialogDescription>
642
+ </AlertDialogHeader>
643
+ </div>
644
+ <AlertDialogFooter>
645
+ <AlertDialogCancel>Huỷ</AlertDialogCancel>
646
+ <AlertDialogAction color="destructive">
647
+ Xoá vĩnh viễn
648
+ </AlertDialogAction>
649
+ </AlertDialogFooter>
650
+ </AlertDialogContent>
651
+ </AlertDialogPortal>
652
+ </AlertDialog>`}
660
653
  >
661
654
  <AlertDialog>
662
655
  <AlertDialogTrigger
@@ -697,40 +690,36 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
697
690
  label="Action & Cancel Variants"
698
691
  description="Tuỳ chỉnh variant cho cả Action (soft) và Cancel (ghost)."
699
692
  codeString={`<AlertDialog>
700
- <AlertDialogTrigger
701
- render={
702
- <Button variant="outline">
703
- Custom Variants
704
- </Button>
705
- }
706
- />
707
- <AlertDialogPortal><AlertDialogContent>
708
- <div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
709
- <AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
710
- <LogOutIcon />
711
- </AlertDialogMedia>
712
- <AlertDialogHeader>
713
- <AlertDialogTitle>Đăng xuất?</AlertDialogTitle>
714
- <AlertDialogDescription>
715
- Phiên đăng nhập của bạn sẽ kết thúc. Bạn cần nhập lại mật
716
- khẩu để quay lại.
717
- </AlertDialogDescription>
718
- </AlertDialogHeader>
719
- </div>
720
- <AlertDialogFooter>
721
- <AlertDialogCancel variant="ghost">
722
- Ở lại
723
- </AlertDialogCancel>
724
- <AlertDialogAction
725
- variant="soft"
726
- color="info"
727
- >
728
- Đăng xuất
729
- </AlertDialogAction>
730
- </AlertDialogFooter>
731
- </AlertDialogContent></AlertDialogPortal>
732
- </AlertDialog>
733
- `}
693
+ <AlertDialogTrigger
694
+ render={
695
+ <Button variant="outline">Custom Variants</Button>
696
+ }
697
+ />
698
+ <AlertDialogPortal>
699
+ <AlertDialogContent>
700
+ <div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
701
+ <AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
702
+ <LogOutIcon />
703
+ </AlertDialogMedia>
704
+ <AlertDialogHeader>
705
+ <AlertDialogTitle>Đăng xuất?</AlertDialogTitle>
706
+ <AlertDialogDescription>
707
+ Phiên đăng nhập của bạn sẽ kết thúc. Bạn cần
708
+ nhập lại mật khẩu để quay lại.
709
+ </AlertDialogDescription>
710
+ </AlertDialogHeader>
711
+ </div>
712
+ <AlertDialogFooter>
713
+ <AlertDialogCancel variant="ghost">
714
+ lại
715
+ </AlertDialogCancel>
716
+ <AlertDialogAction variant="soft" color="info">
717
+ Đăng xuất
718
+ </AlertDialogAction>
719
+ </AlertDialogFooter>
720
+ </AlertDialogContent>
721
+ </AlertDialogPortal>
722
+ </AlertDialog>`}
734
723
  >
735
724
  <AlertDialog>
736
725
  <AlertDialogTrigger
@@ -779,121 +768,135 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
779
768
  description="Các kịch bản thực tế giúp bạn quyết định nên dùng Micro hay Macro."
780
769
  fullWidth
781
770
  codeString={`<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
782
- {/* ── Story 1: Macro wins ── */}
783
- <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
784
- <div className="flex items-start gap-3">
785
- <span className="mt-0.5 shrink-0 rounded-full bg-green-500/10 p-1.5 text-green-600">
786
- <ShieldAlertIcon className="size-4" aria-hidden="true" />
787
- </span>
788
- <div>
789
- <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
790
- Story 1 · Dùng Macro
791
- </p>
792
- <h3 className="mt-0.5 text-sm font-semibold text-foreground">
793
- Xác nhận chuẩn mực với Icon
794
- </h3>
771
+ {/* ── Story 1: Macro wins ── */}
772
+ <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
773
+ <div className="flex items-start gap-3">
774
+ <span className="mt-0.5 shrink-0 rounded-full bg-green-500/10 p-1.5 text-green-600">
775
+ <ShieldAlertIcon
776
+ className="size-4"
777
+ aria-hidden="true"
778
+ />
779
+ </span>
780
+ <div>
781
+ <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
782
+ Story 1 · Dùng Macro
783
+ </p>
784
+ <h3 className="mt-0.5 text-sm font-semibold text-foreground">
785
+ Xác nhận chuẩn mực với Icon
786
+ </h3>
787
+ </div>
795
788
  </div>
796
- </div>
797
-
798
- <p className="text-xs text-muted-foreground leading-relaxed">
799
- Bạn cần làm một dialog xác nhận xoá với layout Side-by-Side
800
- (Icon nằm bên trái trên màn hình lớn, nằm ở trên cùng trên màn
801
- hình nhỏ).
802
- </p>
803
-
804
- <div className="rounded-lg bg-muted/50 p-3 flex justify-center">
805
- <AlertDialogPreset
806
- size="sm"
807
- trigger={
808
- <Button variant="outline" size="sm">
809
- Xem Demo
810
- </Button>
811
- }
812
- icon={
813
- <div className="flex size-full items-center justify-center rounded-full bg-muted">
814
- <InfoIcon />
815
- </div>
816
- }
817
- title="Xác nhận thao tác"
818
- description="Macro bọc mọi thứ vào một component duy nhất."
819
- cancelLabel="Huỷ"
820
- actionLabel="Tiếp tục"
821
- />
822
- </div>
823
789
 
824
- <div className="rounded-md border border-border border-green-500/20 bg-green-500/5 px-3 py-2">
825
- <p className="text-xs font-medium text-green-700 dark:text-green-400">
826
- Dùng <code className="font-mono">AlertDialogPreset</code>
827
- Viết đúng 1 element. Tự động xử lý Grid/Flex responsive siêu
828
- phức tạp.
790
+ <p className="text-xs text-muted-foreground leading-relaxed">
791
+ Bạn cần làm một dialog xác nhận xoá với layout
792
+ Side-by-Side (Icon nằm bên trái trên màn hình lớn,
793
+ nằm trên cùng trên màn hình nhỏ).
829
794
  </p>
830
- </div>
831
- </div>
832
-
833
- {/* ── Story 2: Micro wins ── */}
834
- <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
835
- <div className="flex items-start gap-3">
836
- <span className="mt-0.5 shrink-0 rounded-full bg-blue-500/10 p-1.5 text-blue-600">
837
- <MessageSquareWarningIcon
838
- className="size-4"
839
- aria-hidden="true"
840
- />
841
- </span>
842
- <div>
843
- <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
844
- Story 2 · Dùng Micro
845
- </p>
846
- <h3 className="mt-0.5 text-sm font-semibold text-foreground">
847
- Custom Layout độc lạ
848
- </h3>
849
- </div>
850
- </div>
851
-
852
- <p className="text-xs text-muted-foreground leading-relaxed">
853
- Designer yêu cầu một Modal có Layout đặc thù: Image bự ở trên
854
- cùng, Text ở dưới, Footer có 3 nút. Không có bất kỳ Preset nào
855
- support layout này.
856
- </p>
857
795
 
858
- <div className="rounded-lg bg-muted/50 p-3 flex justify-center">
859
- <AlertDialog>
860
- <AlertDialogTrigger
861
- render={
796
+ <div className="rounded-lg bg-muted/50 p-3 flex justify-center">
797
+ <AlertDialogPreset
798
+ size="sm"
799
+ trigger={
862
800
  <Button variant="outline" size="sm">
863
801
  Xem Demo
864
802
  </Button>
865
803
  }
804
+ icon={
805
+ <div className="flex size-full items-center justify-center rounded-full bg-muted">
806
+ <InfoIcon />
807
+ </div>
808
+ }
809
+ title="Xác nhận thao tác"
810
+ description="Macro bọc mọi thứ vào một component duy nhất."
811
+ cancelLabel="Huỷ"
812
+ actionLabel="Tiếp tục"
866
813
  />
867
- <AlertDialogPortal><AlertDialogContent size="sm">
868
- <div className="h-24 w-full rounded-md bg-muted flex items-center justify-center text-xs text-muted-foreground">
869
- Custom Image
870
- </div>
871
- <AlertDialogHeader>
872
- <AlertDialogTitle>Tùy biến 100%</AlertDialogTitle>
873
- </AlertDialogHeader>
874
- <AlertDialogFooter className="flex-col gap-2 sm:flex-col">
875
- <Button className="w-full">Action 1</Button>
876
- <Button color="secondary" variant="soft" className="w-full">
877
- Action 2
878
- </Button>
879
- <AlertDialogCancel className="w-full">
880
- Cancel
881
- </AlertDialogCancel>
882
- </AlertDialogFooter>
883
- </AlertDialogContent></AlertDialogPortal>
884
- </AlertDialog>
814
+ </div>
815
+
816
+ <div className="rounded-md border border-border border-green-500/20 bg-green-500/5 px-3 py-2">
817
+ <p className="text-xs font-medium text-green-700 dark:text-green-400">
818
+ ✅ Dùng{" "}
819
+ <code className="font-mono">
820
+ AlertDialogPreset
821
+ </code>{" "}
822
+ Viết đúng 1 element. Tự động xử lý Grid/Flex
823
+ responsive siêu phức tạp.
824
+ </p>
825
+ </div>
885
826
  </div>
886
827
 
887
- <div className="rounded-md border border-border border-blue-500/20 bg-blue-500/5 px-3 py-2">
888
- <p className="text-xs font-medium text-blue-700 dark:text-blue-400">
889
- ✅ Dùng <code className="font-mono">AlertDialog</code> (Micro) —
890
- Không bị ràng buộc bởi bất kỳ layout định sẵn nào. Lắp ráp thẻ
891
- tự do.
828
+ {/* ── Story 2: Micro wins ── */}
829
+ <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
830
+ <div className="flex items-start gap-3">
831
+ <span className="mt-0.5 shrink-0 rounded-full bg-blue-500/10 p-1.5 text-blue-600">
832
+ <MessageSquareWarningIcon
833
+ className="size-4"
834
+ aria-hidden="true"
835
+ />
836
+ </span>
837
+ <div>
838
+ <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
839
+ Story 2 · Dùng Micro
840
+ </p>
841
+ <h3 className="mt-0.5 text-sm font-semibold text-foreground">
842
+ Custom Layout độc lạ
843
+ </h3>
844
+ </div>
845
+ </div>
846
+
847
+ <p className="text-xs text-muted-foreground leading-relaxed">
848
+ Designer yêu cầu một Modal có Layout đặc thù: Image
849
+ bự ở trên cùng, Text ở dưới, Footer có 3 nút. Không
850
+ có bất kỳ Preset nào support layout này.
892
851
  </p>
852
+
853
+ <div className="rounded-lg bg-muted/50 p-3 flex justify-center">
854
+ <AlertDialog>
855
+ <AlertDialogTrigger
856
+ render={
857
+ <Button variant="outline" size="sm">
858
+ Xem Demo
859
+ </Button>
860
+ }
861
+ />
862
+ <AlertDialogPortal>
863
+ <AlertDialogContent size="sm">
864
+ <div className="h-24 w-full rounded-md bg-muted flex items-center justify-center text-xs text-muted-foreground">
865
+ Custom Image
866
+ </div>
867
+ <AlertDialogHeader>
868
+ <AlertDialogTitle>
869
+ Tùy biến 100%
870
+ </AlertDialogTitle>
871
+ </AlertDialogHeader>
872
+ <AlertDialogFooter className="flex-col gap-2 sm:flex-col">
873
+ <Button className="w-full">Action 1</Button>
874
+ <Button
875
+ color="secondary"
876
+ variant="soft"
877
+ className="w-full"
878
+ >
879
+ Action 2
880
+ </Button>
881
+ <AlertDialogCancel className="w-full">
882
+ Cancel
883
+ </AlertDialogCancel>
884
+ </AlertDialogFooter>
885
+ </AlertDialogContent>
886
+ </AlertDialogPortal>
887
+ </AlertDialog>
888
+ </div>
889
+
890
+ <div className="rounded-md border border-border border-blue-500/20 bg-blue-500/5 px-3 py-2">
891
+ <p className="text-xs font-medium text-blue-700 dark:text-blue-400">
892
+ ✅ Dùng{" "}
893
+ <code className="font-mono">AlertDialog</code>{" "}
894
+ (Micro) — Không bị ràng buộc bởi bất kỳ layout
895
+ định sẵn nào. Lắp ráp thẻ tự do.
896
+ </p>
897
+ </div>
893
898
  </div>
894
- </div>
895
- </div>
896
- `}
899
+ </div>`}
897
900
  >
898
901
  <div className="grid grid-cols-1 gap-6 md:grid-cols-2">
899
902
  {/* ── Story 1: Macro wins ── */}
@@ -913,9 +916,9 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
913
916
  </div>
914
917
 
915
918
  <p className="text-xs text-muted-foreground leading-relaxed">
916
- Bạn cần làm một dialog xác nhận xoá với layout Side-by-Side
917
- (Icon nằm bên trái trên màn hình lớn, nằm ở trên cùng trên màn
918
- hình nhỏ).
919
+ Bạn cần làm một dialog xác nhận xoá với layout Side-by-Side (Icon
920
+ nằm bên trái trên màn hình lớn, nằm ở trên cùng trên màn hình
921
+ nhỏ).
919
922
  </p>
920
923
 
921
924
  <div className="rounded-lg bg-muted/50 p-3 flex justify-center">