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,3 +1,5 @@
1
+ import { useState } from "react";
2
+
1
3
  import { CarouselPreset } from "../../components/macro/carousel-preset";
2
4
  import { Card, CardContent } from "../../components/micro/card";
3
5
  import {
@@ -16,7 +18,6 @@ import {
16
18
  ShowcaseDocs,
17
19
  } from "../../dev/components/showcase";
18
20
  import { cn } from "../../lib/utils";
19
- import { useState } from "react";
20
21
 
21
22
  const SLIDES = [
22
23
  {
@@ -127,12 +128,45 @@ function CarouselMacroShowcase() {
127
128
  label="Tiêu chuẩn (Standard)"
128
129
  description="Băng chuyền cơ bản nhất với cầu trượt."
129
130
  codeString={`<CarouselPreset
130
- items={[
131
- { id: "std-1", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">1</span></div></div> },
132
- { id: "std-2", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">2</span></div></div> },
133
- { id: "std-3", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">3</span></div></div> },
134
- ]}
135
- />`}
131
+ items={[
132
+ {
133
+ id: "std-1",
134
+ content: (
135
+ <div className="p-1 border border-border rounded-xl">
136
+ <div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
137
+ <span className="text-4xl font-semibold">
138
+ 1
139
+ </span>
140
+ </div>
141
+ </div>
142
+ ),
143
+ },
144
+ {
145
+ id: "std-2",
146
+ content: (
147
+ <div className="p-1 border border-border rounded-xl">
148
+ <div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
149
+ <span className="text-4xl font-semibold">
150
+ 2
151
+ </span>
152
+ </div>
153
+ </div>
154
+ ),
155
+ },
156
+ {
157
+ id: "std-3",
158
+ content: (
159
+ <div className="p-1 border border-border rounded-xl">
160
+ <div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
161
+ <span className="text-4xl font-semibold">
162
+ 3
163
+ </span>
164
+ </div>
165
+ </div>
166
+ ),
167
+ },
168
+ ]}
169
+ />`}
136
170
  >
137
171
  <div className="w-full max-w-sm px-12">
138
172
  <CarouselPreset
@@ -176,12 +210,39 @@ function CarouselMacroShowcase() {
176
210
  label="Thư viện ảnh (Image Gallery)"
177
211
  description="Sử dụng hình ảnh thực làm nội dung slide."
178
212
  codeString={`<CarouselPreset
179
- items={[
180
- { id: "img-1", content: <img src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop" alt="Slide 1" className="rounded-xl object-cover" /> },
181
- { id: "img-2", content: <img src="https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?q=80&w=600&h=400&auto=format&fit=crop" alt="Slide 2" className="rounded-xl object-cover" /> },
182
- { id: "img-3", content: <img src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop" alt="Slide 3" className="rounded-xl object-cover" /> },
183
- ]}
184
- />`}
213
+ items={[
214
+ {
215
+ id: "img-1",
216
+ content: (
217
+ <img
218
+ src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop"
219
+ alt="Slide 1"
220
+ className="rounded-xl object-cover"
221
+ />
222
+ ),
223
+ },
224
+ {
225
+ id: "img-2",
226
+ content: (
227
+ <img
228
+ src="https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?q=80&w=600&h=400&auto=format&fit=crop"
229
+ alt="Slide 2"
230
+ className="rounded-xl object-cover"
231
+ />
232
+ ),
233
+ },
234
+ {
235
+ id: "img-3",
236
+ content: (
237
+ <img
238
+ src="https://images.unsplash.com/photo-1707343843437-caacff5cfa74?q=80&w=600&h=400&auto=format&fit=crop"
239
+ alt="Slide 3"
240
+ className="rounded-xl object-cover"
241
+ />
242
+ ),
243
+ },
244
+ ]}
245
+ />`}
185
246
  >
186
247
  <div className="w-full max-w-sm px-12">
187
248
  <CarouselPreset
@@ -227,14 +288,47 @@ function CarouselMacroShowcase() {
227
288
  label="Vòng lặp vô hạn (Loop Enabled)"
228
289
  description="Chỉ hiển thị dấu chấm (ẩn mũi tên)."
229
290
  codeString={`<CarouselPreset
230
- opts={{ loop: true }}
231
- showArrows={false}
232
- items={[
233
- { id: "loop-1", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-violet-500 to-purple-500 rounded-lg text-white"><span className="text-4xl font-semibold">1</span></div></div> },
234
- { id: "loop-2", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-pink-500 to-rose-500 rounded-lg text-white"><span className="text-4xl font-semibold">2</span></div></div> },
235
- { id: "loop-3", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-blue-500 to-cyan-500 rounded-lg text-white"><span className="text-4xl font-semibold">3</span></div></div> },
236
- ]}
237
- />`}
291
+ opts={{ loop: true }}
292
+ showArrows={false}
293
+ items={[
294
+ {
295
+ id: "loop-1",
296
+ content: (
297
+ <div className="p-1 border border-border rounded-xl">
298
+ <div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-violet-500 to-purple-500 rounded-lg text-white">
299
+ <span className="text-4xl font-semibold">
300
+ 1
301
+ </span>
302
+ </div>
303
+ </div>
304
+ ),
305
+ },
306
+ {
307
+ id: "loop-2",
308
+ content: (
309
+ <div className="p-1 border border-border rounded-xl">
310
+ <div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-pink-500 to-rose-500 rounded-lg text-white">
311
+ <span className="text-4xl font-semibold">
312
+ 2
313
+ </span>
314
+ </div>
315
+ </div>
316
+ ),
317
+ },
318
+ {
319
+ id: "loop-3",
320
+ content: (
321
+ <div className="p-1 border border-border rounded-xl">
322
+ <div className="flex aspect-square items-center justify-center p-6 bg-gradient-to-tr from-blue-500 to-cyan-500 rounded-lg text-white">
323
+ <span className="text-4xl font-semibold">
324
+ 3
325
+ </span>
326
+ </div>
327
+ </div>
328
+ ),
329
+ },
330
+ ]}
331
+ />`}
238
332
  >
239
333
  <div className="w-full max-w-sm">
240
334
  <CarouselPreset
@@ -280,13 +374,46 @@ function CarouselMacroShowcase() {
280
374
  label="Chỉ mũi tên (Arrows Only)"
281
375
  description="Mũi tên điều hướng không có dấu chấm."
282
376
  codeString={`<CarouselPreset
283
- showDots={false}
284
- items={[
285
- { id: "arr-1", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">A</span></div></div> },
286
- { id: "arr-2", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">B</span></div></div> },
287
- { id: "arr-3", content: <div className="p-1 border border-border rounded-xl"><div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg"><span className="text-4xl font-semibold">C</span></div></div> },
288
- ]}
289
- />`}
377
+ showDots={false}
378
+ items={[
379
+ {
380
+ id: "arr-1",
381
+ content: (
382
+ <div className="p-1 border border-border rounded-xl">
383
+ <div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
384
+ <span className="text-4xl font-semibold">
385
+ A
386
+ </span>
387
+ </div>
388
+ </div>
389
+ ),
390
+ },
391
+ {
392
+ id: "arr-2",
393
+ content: (
394
+ <div className="p-1 border border-border rounded-xl">
395
+ <div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
396
+ <span className="text-4xl font-semibold">
397
+ B
398
+ </span>
399
+ </div>
400
+ </div>
401
+ ),
402
+ },
403
+ {
404
+ id: "arr-3",
405
+ content: (
406
+ <div className="p-1 border border-border rounded-xl">
407
+ <div className="flex aspect-square items-center justify-center p-6 bg-muted/20 rounded-lg">
408
+ <span className="text-4xl font-semibold">
409
+ C
410
+ </span>
411
+ </div>
412
+ </div>
413
+ ),
414
+ },
415
+ ]}
416
+ />`}
290
417
  >
291
418
  <div className="w-full max-w-sm px-12">
292
419
  <CarouselPreset
@@ -349,16 +476,37 @@ return (
349
476
  label="Theo chiều dọc (Vertical Orientation)"
350
477
  description="Băng chuyền macro cuộn theo chiều dọc."
351
478
  codeString={`<CarouselPreset
352
- className="w-full"
353
- orientation="vertical"
354
- contentClassName="h-[300px]"
355
- itemClassName="basis-[250px]"
356
- items={[
357
- { id: "v1", content: <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">A</div> },
358
- { id: "v2", content: <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">B</div> },
359
- { id: "v3", content: <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">C</div> },
360
- ]}
361
- />`}
479
+ className="w-full"
480
+ orientation="vertical"
481
+ contentClassName="h-[300px]"
482
+ itemClassName="basis-[250px]"
483
+ items={[
484
+ {
485
+ id: "v1",
486
+ content: (
487
+ <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
488
+ A
489
+ </div>
490
+ ),
491
+ },
492
+ {
493
+ id: "v2",
494
+ content: (
495
+ <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
496
+ B
497
+ </div>
498
+ ),
499
+ },
500
+ {
501
+ id: "v3",
502
+ content: (
503
+ <div className="h-full w-full border border-border rounded-xl flex items-center justify-center bg-muted/20 text-4xl font-semibold">
504
+ C
505
+ </div>
506
+ ),
507
+ },
508
+ ]}
509
+ />`}
362
510
  >
363
511
  <div className="w-full max-w-sm px-12 py-12 flex justify-center">
364
512
  <CarouselPreset
@@ -409,18 +557,21 @@ function CarouselMicroShowcase() {
409
557
  <ExampleSection
410
558
  label="Hero Banner (Overlay Navigation)"
411
559
  description="Mũi tên kính mờ nằm đè trên Banner, chỉ hiện khi hover. Dấu chấm nằm sát mép dưới."
412
- codeString={`<Carousel opts={{ loop: true }} className="group relative w-full overflow-hidden rounded-2xl shadow-xl">
413
- <CarouselContent className="-ml-4">
414
- <CarouselItem className="pl-4">...</CarouselItem>
415
- </CarouselContent>
416
- <div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-between p-4 opacity-0 transition-opacity duration-300 group-hover:opacity-100">
417
- <CarouselPrevious className="pointer-events-auto bg-background/50 backdrop-blur-md" />
418
- <CarouselNext className="pointer-events-auto bg-background/50 backdrop-blur-md" />
419
- </div>
420
- <div className="absolute bottom-4 left-0 right-0 z-10">
421
- <CarouselDots className="[&>[data-slot=carousel-dot][data-active]]:bg-white [&>[data-slot=carousel-dot]]:bg-white/40" />
422
- </div>
423
- </Carousel>`}
560
+ codeString={`<Carousel
561
+ opts={{ loop: true }}
562
+ className="group relative w-full overflow-hidden rounded-2xl shadow-xl"
563
+ >
564
+ <CarouselContent className="-ml-4">
565
+ <CarouselItem className="pl-4">...</CarouselItem>
566
+ </CarouselContent>
567
+ <div className="pointer-events-none absolute inset-0 z-10 flex items-center justify-between p-4 opacity-0 transition-opacity duration-300 group-hover:opacity-100">
568
+ <CarouselPrevious className="pointer-events-auto bg-background/50 backdrop-blur-md" />
569
+ <CarouselNext className="pointer-events-auto bg-background/50 backdrop-blur-md" />
570
+ </div>
571
+ <div className="absolute bottom-4 left-0 right-0 z-10">
572
+ <CarouselDots className="[&>[data-slot=carousel-dot][data-active]]:bg-white [&>[data-slot=carousel-dot]]:bg-white/40" />
573
+ </div>
574
+ </Carousel>`}
424
575
  >
425
576
  <div className="mx-auto w-full max-w-4xl">
426
577
  <Carousel
@@ -463,35 +614,46 @@ function CarouselMicroShowcase() {
463
614
  label="Nhiều phần tử trên 1 slide (Product Gallery)"
464
615
  description="Hiển thị nhiều Card (vd: basis-1/2, lg:basis-1/3) trên cùng một Slide của Băng chuyền."
465
616
  codeString={`<div className="mx-auto w-full max-w-5xl px-12">
466
- <Carousel opts={{ align: "start" }} className="w-full relative">
467
- <CarouselContent className="-ml-4">
468
- {Array.from({ length: 10 }).map((_, index) => (
469
- <CarouselItem key={index} className="pl-4 md:basis-1/2 lg:basis-1/3">
470
- <div className="p-1">
471
- <Card className="overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1">
472
- <div className="aspect-4/3 bg-muted flex items-center justify-center relative group">
473
- <span className="text-4xl font-black text-muted-foreground/30 transition-transform duration-500 group-hover:scale-110">
474
- 0{index + 1}
475
- </span>
476
- <div className="absolute inset-0 bg-linear-to-t from-black/60 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 flex items-end p-4">
477
- <span className="text-white font-medium">View Item {index + 1}</span>
617
+ <Carousel
618
+ opts={{ align: "start" }}
619
+ className="w-full relative"
620
+ >
621
+ <CarouselContent className="-ml-4">
622
+ {Array.from({ length: 10 }).map((_, index) => (
623
+ <CarouselItem
624
+ key={index}
625
+ className="pl-4 md:basis-1/2 lg:basis-1/3"
626
+ >
627
+ <div className="p-1">
628
+ <Card className="overflow-hidden transition-all duration-300 hover:shadow-lg hover:-translate-y-1">
629
+ <div className="aspect-4/3 bg-muted flex items-center justify-center relative group">
630
+ <span className="text-4xl font-black text-muted-foreground/30 transition-transform duration-500 group-hover:scale-110">
631
+ 0{index + 1}
632
+ </span>
633
+ <div className="absolute inset-0 bg-linear-to-t from-black/60 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100 flex items-end p-4">
634
+ <span className="text-white font-medium">
635
+ View Item {index + 1}
636
+ </span>
637
+ </div>
478
638
  </div>
479
- </div>
480
- <CardContent className="p-4">
481
- <div className="text-sm font-medium text-muted-foreground mb-1">Category</div>
482
- <h4 className="font-semibold text-lg leading-none">Featured Item {index + 1}</h4>
483
- </CardContent>
484
- </Card>
485
- </div>
486
- </CarouselItem>
487
- ))}
488
- </CarouselContent>
639
+ <CardContent className="p-4">
640
+ <div className="text-sm font-medium text-muted-foreground mb-1">
641
+ Category
642
+ </div>
643
+ <h4 className="font-semibold text-lg leading-none">
644
+ Featured Item {index + 1}
645
+ </h4>
646
+ </CardContent>
647
+ </Card>
648
+ </div>
649
+ </CarouselItem>
650
+ ))}
651
+ </CarouselContent>
489
652
 
490
- <CarouselPrevious className="absolute -left-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
491
- <CarouselNext className="absolute -right-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
492
- </Carousel>
493
- </div>
494
- `}
653
+ <CarouselPrevious className="absolute -left-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
654
+ <CarouselNext className="absolute -right-12 top-1/2 -translate-y-1/2 border-border shadow-sm hover:bg-accent" />
655
+ </Carousel>
656
+ </div>`}
495
657
  >
496
658
  <div className="mx-auto w-full max-w-5xl px-12">
497
659
  <Carousel opts={{ align: "start" }} className="w-full relative">
@@ -23,10 +23,11 @@ export default function ChartShowcase() {
23
23
  generalConcept={
24
24
  <ShowcaseDocs>
25
25
  <DocsP>
26
- Component wrapper cho thư viện <DocsCode>Recharts</DocsCode>. Cung cấp{" "}
27
- <DocsCode>ChartContainer</DocsCode> để cấu hình theme màu sắc,{" "}
28
- <DocsCode>ChartTooltip</DocsCode> và <DocsCode>ChartLegend</DocsCode>{" "}
29
- để hiển thị thông tin bổ sung khi hover.
26
+ Component wrapper cho thư viện <DocsCode>Recharts</DocsCode>. Cung
27
+ cấp <DocsCode>ChartContainer</DocsCode> để cấu hình theme màu sắc,{" "}
28
+ <DocsCode>ChartTooltip</DocsCode> và{" "}
29
+ <DocsCode>ChartLegend</DocsCode> để hiển thị thông tin bổ sung khi
30
+ hover.
30
31
  </DocsP>
31
32
  </ShowcaseDocs>
32
33
  }