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
@@ -16,88 +16,71 @@ import {
16
16
  DocsH3,
17
17
  DocsP,
18
18
  ExampleGrid,
19
- ExampleSection,
19
+ ShowcaseExample,
20
20
  Showcase,
21
21
  ShowcaseDocs
22
22
  } from "../../dev/components/showcase";
23
23
  import { type Size } from "../../lib/types";
24
24
 
25
- // ──────────────────────────────────────────────────────────
26
- // SECTION 1: Macro Content
27
- // ──────────────────────────────────────────────────────────
28
25
  function PaginationMacroShowcase({ globalSize }: { globalSize: Size }) {
29
26
  const [currentPage, setCurrentPage] = useState(1);
30
27
 
31
28
  return (
32
- <div className="space-y-10 mt-6">
29
+ <div className="space-y-10">
33
30
  <ExampleGrid>
34
- <ExampleSection
35
- label="Tiêu chuẩn (Standard)"
36
- description="Phân trang cơ bản với state điều khiển."
37
- codeString={`const [currentPage, setCurrentPage] = useState(1); return
31
+ <ShowcaseExample title="Tiêu chuẩn (Standard)" description="Phân trang cơ bản với state điều khiển." code={`const [currentPage, setCurrentPage] = useState(1); return
38
32
  (
39
33
  <PaginationPreset
40
34
  currentPage={currentPage}
41
35
  totalPages={10}
42
36
  onPageChange={setCurrentPage}
43
37
  />
44
- );`}
45
- >
46
- <PaginationPreset
47
- currentPage={currentPage}
48
- totalPages={10}
49
- onPageChange={setCurrentPage}
50
- size={globalSize}
51
- />
52
- </ExampleSection>
38
+ );`} preview={
39
+ <>
40
+ <PaginationPreset
41
+ currentPage={currentPage}
42
+ totalPages={10}
43
+ onPageChange={setCurrentPage}
44
+ size={globalSize}
45
+ />
46
+ </>
47
+ } />
53
48
 
54
- <ExampleSection
55
- label="Nhiều trang (Many Pages)"
56
- description="Tự động thêm dấu ba chấm (ellipsis) khi số trang lớn."
57
- codeString={`<PaginationPreset currentPage={50} totalPages={100} />
58
- `}
59
- >
60
- <PaginationPreset
61
- currentPage={50}
62
- totalPages={100}
63
- size={globalSize}
64
- />
65
- </ExampleSection>
49
+ <ShowcaseExample title="Nhiều trang (Many Pages)" description="Tự động thêm dấu ba chấm (ellipsis) khi số trang lớn." code={`<PaginationPreset currentPage={50} totalPages={100} />
50
+ `} preview={
51
+ <>
52
+ <PaginationPreset
53
+ currentPage={50}
54
+ totalPages={100}
55
+ size={globalSize}
56
+ />
57
+ </>
58
+ } />
66
59
  </ExampleGrid>
67
60
 
68
61
  <ExampleGrid>
69
- <ExampleSection
70
- label="Trang đầu tiên (First Page)"
71
- description="Nút Previous tự động bị mờ đi."
72
- codeString={`<PaginationPreset currentPage={1} totalPages={5} />
73
- `}
74
- >
75
- <PaginationPreset currentPage={1} totalPages={5} size={globalSize} />
76
- </ExampleSection>
62
+ <ShowcaseExample title="Trang đầu tiên (First Page)" description="Nút Previous tự động bị mờ đi." code={`<PaginationPreset currentPage={1} totalPages={5} />
63
+ `} preview={
64
+ <>
65
+ <PaginationPreset currentPage={1} totalPages={5} size={globalSize} />
66
+ </>
67
+ } />
77
68
 
78
- <ExampleSection
79
- label="Trang cuối cùng (Last Page)"
80
- description="Nút Next tự động bị mờ đi."
81
- codeString={`<PaginationPreset currentPage={5} totalPages={5} />
82
- `}
83
- >
84
- <PaginationPreset currentPage={5} totalPages={5} size={globalSize} />
85
- </ExampleSection>
69
+ <ShowcaseExample title="Trang cuối cùng (Last Page)" description="Nút Next tự động bị mờ đi." code={`<PaginationPreset currentPage={5} totalPages={5} />
70
+ `} preview={
71
+ <>
72
+ <PaginationPreset currentPage={5} totalPages={5} size={globalSize} />
73
+ </>
74
+ } />
86
75
  </ExampleGrid>
87
76
  </div>
88
77
  );
89
78
  }
90
79
 
91
- // ──────────────────────────────────────────────────────────
92
- // SECTION 2: Micro Content
93
- // ──────────────────────────────────────────────────────────
94
80
  function PaginationMicroShowcase({ globalSize }: { globalSize: Size }) {
95
81
  return (
96
- <div className="space-y-10 mt-6">
97
- <ExampleSection
98
- label="Cơ bản (Default)"
99
- description="Lắp ráp thủ công các item và link. Hỗ trợ prop size."
100
- codeString={`<Pagination>
82
+ <div className="space-y-10">
83
+ <ShowcaseExample title="Cơ bản (Default)" description="Lắp ráp thủ công các item và link. Hỗ trợ prop size." code={`<Pagination>
101
84
  <PaginationContent>
102
85
  <PaginationItem>
103
86
  <PaginationPrevious href="#" />
@@ -120,43 +103,40 @@ function PaginationMicroShowcase({ globalSize }: { globalSize: Size }) {
120
103
  <PaginationNext href="#" />
121
104
  </PaginationItem>
122
105
  </PaginationContent>
123
- </Pagination>`}
124
- >
125
- <Pagination>
126
- <PaginationContent>
127
- <PaginationItem>
128
- <PaginationPrevious href="#" size={globalSize} />
129
- </PaginationItem>
130
- <PaginationItem>
131
- <PaginationLink href="#" size={globalSize}>
132
- 1
133
- </PaginationLink>
134
- </PaginationItem>
135
- <PaginationItem>
136
- <PaginationLink href="#" isActive size={globalSize}>
137
- 2
138
- </PaginationLink>
139
- </PaginationItem>
140
- <PaginationItem>
141
- <PaginationLink href="#" size={globalSize}>
142
- 3
143
- </PaginationLink>
144
- </PaginationItem>
145
- <PaginationItem>
146
- <PaginationEllipsis />
147
- </PaginationItem>
148
- <PaginationItem>
149
- <PaginationNext href="#" size={globalSize} />
150
- </PaginationItem>
151
- </PaginationContent>
152
- </Pagination>
153
- </ExampleSection>
106
+ </Pagination>`} preview={
107
+ <>
108
+ <Pagination>
109
+ <PaginationContent>
110
+ <PaginationItem>
111
+ <PaginationPrevious href="#" size={globalSize} />
112
+ </PaginationItem>
113
+ <PaginationItem>
114
+ <PaginationLink href="#" size={globalSize}>
115
+ 1
116
+ </PaginationLink>
117
+ </PaginationItem>
118
+ <PaginationItem>
119
+ <PaginationLink href="#" isActive size={globalSize}>
120
+ 2
121
+ </PaginationLink>
122
+ </PaginationItem>
123
+ <PaginationItem>
124
+ <PaginationLink href="#" size={globalSize}>
125
+ 3
126
+ </PaginationLink>
127
+ </PaginationItem>
128
+ <PaginationItem>
129
+ <PaginationEllipsis />
130
+ </PaginationItem>
131
+ <PaginationItem>
132
+ <PaginationNext href="#" size={globalSize} />
133
+ </PaginationItem>
134
+ </PaginationContent>
135
+ </Pagination>
136
+ </>
137
+ } />
154
138
 
155
- <ExampleSection
156
- label="🧭 Use Case Comparison"
157
- description="So sánh nhanh khi nào dùng Micro và Macro."
158
- fullWidth
159
- codeString={`<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
139
+ <ShowcaseExample title="🧭 So sánh Use Case" description="So sánh nhanh khi nào dùng Micro và Macro." code={`<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
160
140
  {/* Story 1: Macro wins */}
161
141
  <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
162
142
  <div className="flex items-start gap-3">
@@ -226,117 +206,91 @@ function PaginationMicroShowcase({ globalSize }: { globalSize: Size }) {
226
206
  hiển thị pagination đặc biệt.
227
207
  </p>
228
208
  </div>
229
- </div>`}
230
- >
231
- <div className="grid grid-cols-1 gap-6 md:grid-cols-2">
232
- {/* Story 1: Macro wins */}
233
- <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
234
- <div className="flex items-start gap-3">
235
- <span className="mt-0.5 shrink-0 rounded-full bg-green-500/10 p-1.5 text-green-600">
236
- <svg
237
- xmlns="http://www.w3.org/2000/svg"
238
- className="size-4"
239
- viewBox="0 0 24 24"
240
- fill="none"
241
- stroke="currentColor"
242
- strokeWidth="2"
243
- strokeLinecap="round"
244
- strokeLinejoin="round"
245
- aria-hidden="true"
246
- >
247
- <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
248
- </svg>
249
- </span>
250
- <div>
251
- <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
252
- Story 1 · Dùng Macro
253
- </p>
254
- <h3 className="mt-0.5 text-sm font-semibold text-foreground">
255
- Xử lý tự động
256
- </h3>
257
- </div>
258
- </div>
259
- <p className="text-xs text-muted-foreground leading-relaxed">
260
- Dùng Preset khi bạn chỉ muốn truyền vào{" "}
261
- <DocsCode>currentPage</DocsCode> và{" "}
262
- <DocsCode>totalPages</DocsCode> để tự động sinh ra UI phân trang
263
- chuẩn xác (bao gồm dấu ba chấm).
264
- </p>
265
- </div>
209
+ </div>`} preview={
210
+ <>
211
+ <div className="grid grid-cols-1 gap-6 md:grid-cols-2">
212
+ <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
213
+ <div className="flex items-start gap-3">
214
+ <span className="mt-0.5 shrink-0 rounded-full bg-green-500/10 p-1.5 text-green-600">
215
+ <svg
216
+ xmlns="http://www.w3.org/2000/svg"
217
+ className="size-4"
218
+ viewBox="0 0 24 24"
219
+ fill="none"
220
+ stroke="currentColor"
221
+ strokeWidth="2"
222
+ strokeLinecap="round"
223
+ strokeLinejoin="round"
224
+ aria-hidden="true"
225
+ >
226
+ <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
227
+ </svg>
228
+ </span>
229
+ <div>
230
+ <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
231
+ Story 1 · Dùng Macro
232
+ </p>
233
+ <h3 className="mt-0.5 text-sm font-semibold text-foreground">
234
+ Xử tự động
235
+ </h3>
236
+ </div>
237
+ </div>
238
+ <p className="text-xs text-muted-foreground leading-relaxed">
239
+ Dùng Preset khi bạn chỉ muốn truyền vào{" "}
240
+ <DocsCode>currentPage</DocsCode> {" "}
241
+ <DocsCode>totalPages</DocsCode> để tự động sinh ra UI phân trang
242
+ chuẩn xác (bao gồm dấu ba chấm).
243
+ </p>
244
+ </div>
266
245
 
267
- {/* Story 2: Micro wins */}
268
- <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
269
- <div className="flex items-start gap-3">
270
- <span className="mt-0.5 shrink-0 rounded-full bg-blue-500/10 p-1.5 text-blue-600">
271
- <svg
272
- xmlns="http://www.w3.org/2000/svg"
273
- className="size-4"
274
- viewBox="0 0 24 24"
275
- fill="none"
276
- stroke="currentColor"
277
- strokeWidth="2"
278
- strokeLinecap="round"
279
- strokeLinejoin="round"
280
- aria-hidden="true"
281
- >
282
- <path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" />
283
- </svg>
284
- </span>
285
- <div>
286
- <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
287
- Story 2 · Dùng Micro
288
- </p>
289
- <h3 className="mt-0.5 text-sm font-semibold text-foreground">
290
- Tuỳ biến HTML / SEO
291
- </h3>
292
- </div>
293
- </div>
294
- <p className="text-xs text-muted-foreground leading-relaxed">
295
- Dùng Micro khi bạn muốn dùng <DocsCode>&lt;a&gt;</DocsCode> tag
296
- thực sự thay onClick (tốt cho SEO) hoặc khi bạn có luồng logic
297
- hiển thị pagination đặc biệt.
298
- </p>
299
- </div>
300
- </div>
301
- </ExampleSection>
246
+ <div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
247
+ <div className="flex items-start gap-3">
248
+ <span className="mt-0.5 shrink-0 rounded-full bg-blue-500/10 p-1.5 text-blue-600">
249
+ <svg
250
+ xmlns="http://www.w3.org/2000/svg"
251
+ className="size-4"
252
+ viewBox="0 0 24 24"
253
+ fill="none"
254
+ stroke="currentColor"
255
+ strokeWidth="2"
256
+ strokeLinecap="round"
257
+ strokeLinejoin="round"
258
+ aria-hidden="true"
259
+ >
260
+ <path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" />
261
+ </svg>
262
+ </span>
263
+ <div>
264
+ <p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
265
+ Story 2 · Dùng Micro
266
+ </p>
267
+ <h3 className="mt-0.5 text-sm font-semibold text-foreground">
268
+ Tuỳ biến HTML / SEO
269
+ </h3>
270
+ </div>
271
+ </div>
272
+ <p className="text-xs text-muted-foreground leading-relaxed">
273
+ Dùng Micro khi bạn muốn dùng <DocsCode>&lt;a&gt;</DocsCode> tag
274
+ thực sự thay vì onClick (tốt cho SEO) hoặc khi bạn luồng logic
275
+ hiển thị pagination đặc biệt.
276
+ </p>
277
+ </div>
278
+ </div>
279
+ </>
280
+ } />
302
281
  </div>
303
282
  );
304
283
  }
305
284
 
306
- // ──────────────────────────────────────────────────────────
307
- // SECTION 3: Entry point
308
- // ──────────────────────────────────────────────────────────
309
285
  export default function PaginationShowcase() {
310
286
  const { size: globalSize } = useDevContext();
311
287
  return (
312
288
  <Showcase
313
289
  title="Pagination"
314
290
  description="Thanh phân trang với điều hướng trước/sau, tự động rút gọn dấu ba chấm."
315
- generalConcept={
316
- <ShowcaseDocs>
317
- <DocsH3>Khi nào nên dùng Macro</DocsH3>
318
- <DocsP>
319
- <DocsCode>PaginationPreset</DocsCode> tự động tính toán số trang,
320
- dấu ba chấm (ellipsis) và vô hiệu hóa nút Prev/Next. Bạn chỉ cần
321
- truyền <DocsCode>currentPage</DocsCode> và{" "}
322
- <DocsCode>totalPages</DocsCode>.
323
- </DocsP>
324
- <DocsH3>Khi nào nên dùng Micro</DocsH3>
325
- <DocsP>
326
- Dùng <DocsCode>Pagination</DocsCode> khi bạn muốn tự kiểm soát cấu
327
- trúc HTML, thay đổi icon, hoặc dùng phân trang dạng tĩnh (như SEO
328
- link /page/1, /page/2) thay vì phụ thuộc vào React state.
329
- </DocsP>
330
- </ShowcaseDocs>
331
- }
332
- tabs={[
333
- {
334
- label: "Micro (Primitive)",
335
- content: <PaginationMicroShowcase globalSize={globalSize} /> },
336
- {
337
- label: "Macro (Preset)",
338
- content: <PaginationMacroShowcase globalSize={globalSize} /> },
339
- ]}
291
+
292
+ micro={{ content: <PaginationMicroShowcase globalSize={globalSize} /> }}
293
+ macro={{ content: <PaginationMacroShowcase globalSize={globalSize} /> }}
340
294
  />
341
295
  );
342
296
  }