gladvn 0.2.35 → 0.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +1 -1
  2. package/package.json +2 -1
  3. package/scripts/strip-comments.ts +79 -0
  4. package/src/blocks/auth-form.tsx +34 -30
  5. package/src/blocks/auth-recovery.tsx +9 -13
  6. package/src/blocks/auth-split.tsx +46 -36
  7. package/src/blocks/settings.tsx +84 -117
  8. package/src/components/macro/alert-preset.tsx +3 -1
  9. package/src/components/macro/carousel-preset.tsx +0 -1
  10. package/src/components/macro/checkbox-preset.test.tsx +2 -2
  11. package/src/components/macro/checkbox-preset.tsx +1 -2
  12. package/src/components/macro/command-preset.tsx +1 -1
  13. package/src/components/macro/date-picker.tsx +5 -18
  14. package/src/components/macro/dialog-preset.tsx +5 -3
  15. package/src/components/macro/input-preset.tsx +0 -1
  16. package/src/components/macro/select-preset.tsx +1 -1
  17. package/src/components/macro/switch-preset.test.tsx +1 -1
  18. package/src/components/micro/accordion.test.tsx +6 -12
  19. package/src/components/micro/alert-dialog.tsx +0 -2
  20. package/src/components/micro/alert.test.tsx +5 -8
  21. package/src/components/micro/alert.tsx +0 -2
  22. package/src/components/micro/badge.test.tsx +5 -7
  23. package/src/components/micro/badge.tsx +1 -3
  24. package/src/components/micro/button.test.tsx +19 -26
  25. package/src/components/micro/button.tsx +3 -11
  26. package/src/components/micro/calendar.tsx +12 -13
  27. package/src/components/micro/card.test.tsx +3 -5
  28. package/src/components/micro/carousel.tsx +0 -1
  29. package/src/components/micro/chart.tsx +3 -2
  30. package/src/components/micro/checkbox.test.tsx +9 -18
  31. package/src/components/micro/combobox.tsx +1 -3
  32. package/src/components/micro/command.tsx +23 -11
  33. package/src/components/micro/context-menu.tsx +0 -2
  34. package/src/components/micro/dialog.test.tsx +6 -14
  35. package/src/components/micro/dialog.tsx +0 -2
  36. package/src/components/micro/drawer.tsx +0 -3
  37. package/src/components/micro/dropdown-menu.test.tsx +8 -14
  38. package/src/components/micro/dropdown-menu.tsx +0 -2
  39. package/src/components/micro/field.tsx +3 -3
  40. package/src/components/micro/hover-card.tsx +0 -2
  41. package/src/components/micro/input-group.tsx +9 -42
  42. package/src/components/micro/input.test.tsx +15 -24
  43. package/src/components/micro/navigation-menu.tsx +0 -2
  44. package/src/components/micro/popover.test.tsx +5 -9
  45. package/src/components/micro/progress.tsx +5 -1
  46. package/src/components/micro/select.test.tsx +5 -18
  47. package/src/components/micro/select.tsx +3 -5
  48. package/src/components/micro/separator.tsx +1 -1
  49. package/src/components/micro/sheet.test.tsx +6 -14
  50. package/src/components/micro/sheet.tsx +0 -2
  51. package/src/components/micro/sidebar.tsx +5 -6
  52. package/src/components/micro/sonner.tsx +0 -1
  53. package/src/components/micro/switch.test.tsx +9 -18
  54. package/src/components/micro/switch.tsx +1 -1
  55. package/src/components/micro/tabs.test.tsx +5 -11
  56. package/src/components/micro/theme-provider.tsx +0 -12
  57. package/src/components/micro/toggle-group.tsx +1 -12
  58. package/src/components/micro/tooltip.test.tsx +7 -12
  59. package/src/dev/App.tsx +6 -6
  60. package/src/dev/components/BlockViewer.tsx +15 -4
  61. package/src/dev/components/Container.tsx +20 -0
  62. package/src/dev/components/GladvnLogo.tsx +3 -9
  63. package/src/dev/components/code-highlighter.tsx +5 -3
  64. package/src/dev/components/showcase.tsx +116 -168
  65. package/src/dev/sections/buttons.tsx +4 -9
  66. package/src/dev/sections/display.tsx +68 -72
  67. package/src/dev/sections/feedback.tsx +304 -314
  68. package/src/dev/sections/forms.tsx +10 -14
  69. package/src/dev/sections/interactive.tsx +32 -32
  70. package/src/dev/sections/overview.tsx +2 -10
  71. package/src/dev/showcase/accordion.tsx +512 -554
  72. package/src/dev/showcase/alert-dialog.tsx +525 -565
  73. package/src/dev/showcase/alert.tsx +352 -402
  74. package/src/dev/showcase/aspect-ratio.tsx +167 -193
  75. package/src/dev/showcase/avatar.tsx +231 -269
  76. package/src/dev/showcase/badge.tsx +92 -140
  77. package/src/dev/showcase/breadcrumb.tsx +113 -135
  78. package/src/dev/showcase/button.tsx +140 -173
  79. package/src/dev/showcase/calendar.tsx +187 -237
  80. package/src/dev/showcase/card.tsx +229 -261
  81. package/src/dev/showcase/carousel.tsx +288 -315
  82. package/src/dev/showcase/chart.tsx +44 -50
  83. package/src/dev/showcase/checkbox.tsx +286 -330
  84. package/src/dev/showcase/collapsible.tsx +143 -160
  85. package/src/dev/showcase/combobox.tsx +327 -369
  86. package/src/dev/showcase/command.tsx +106 -120
  87. package/src/dev/showcase/context-menu.tsx +93 -107
  88. package/src/dev/showcase/dialog.tsx +585 -630
  89. package/src/dev/showcase/drawer.tsx +176 -196
  90. package/src/dev/showcase/dropdown-menu.tsx +183 -201
  91. package/src/dev/showcase/empty.tsx +232 -274
  92. package/src/dev/showcase/hover-card.tsx +153 -180
  93. package/src/dev/showcase/input-group.tsx +221 -253
  94. package/src/dev/showcase/input-otp.tsx +204 -250
  95. package/src/dev/showcase/input.tsx +246 -325
  96. package/src/dev/showcase/item.tsx +134 -152
  97. package/src/dev/showcase/kbd.tsx +149 -172
  98. package/src/dev/showcase/label.tsx +50 -68
  99. package/src/dev/showcase/menubar.tsx +194 -213
  100. package/src/dev/showcase/navigation-menu.tsx +119 -133
  101. package/src/dev/showcase/overview-components/ArchitectureSection.tsx +126 -0
  102. package/src/dev/showcase/overview-components/CodeBlock.tsx +50 -0
  103. package/src/dev/showcase/overview-components/ColorPaletteSection.tsx +44 -0
  104. package/src/dev/showcase/overview-components/DashboardPreview.tsx +159 -0
  105. package/src/dev/showcase/overview-components/FeatureGridSection.tsx +535 -0
  106. package/src/dev/showcase/overview-components/FooterCTA.tsx +137 -0
  107. package/src/dev/showcase/overview-components/HeroSection.tsx +65 -0
  108. package/src/dev/showcase/overview-components/PrinciplesSection.tsx +128 -0
  109. package/src/dev/showcase/overview.tsx +21 -1163
  110. package/src/dev/showcase/pagination.tsx +144 -190
  111. package/src/dev/showcase/popover.tsx +181 -196
  112. package/src/dev/showcase/progress.tsx +141 -189
  113. package/src/dev/showcase/radio-group.tsx +272 -332
  114. package/src/dev/showcase/resizable.tsx +119 -141
  115. package/src/dev/showcase/scroll-area.tsx +21 -36
  116. package/src/dev/showcase/select.tsx +262 -322
  117. package/src/dev/showcase/separator.tsx +75 -73
  118. package/src/dev/showcase/sheet.tsx +333 -361
  119. package/src/dev/showcase/sidebar.tsx +53 -59
  120. package/src/dev/showcase/skeleton.tsx +93 -112
  121. package/src/dev/showcase/slider.tsx +244 -296
  122. package/src/dev/showcase/sonner.tsx +251 -258
  123. package/src/dev/showcase/spinner.tsx +46 -67
  124. package/src/dev/showcase/switch.tsx +298 -362
  125. package/src/dev/showcase/table.tsx +76 -80
  126. package/src/dev/showcase/tabs.tsx +302 -355
  127. package/src/dev/showcase/textarea.tsx +240 -293
  128. package/src/dev/showcase/toast.tsx +48 -54
  129. package/src/dev/showcase/toggle-group.tsx +104 -129
  130. package/src/dev/showcase/toggle.tsx +82 -102
  131. package/src/dev/showcase/tooltip.tsx +173 -192
  132. package/src/dev/showcase/why.tsx +6 -12
  133. package/src/hooks/use-mobile.test.ts +3 -2
  134. package/src/lib/utils.test.ts +5 -4
@@ -18,7 +18,7 @@ import {
18
18
  DocsH3,
19
19
  DocsP,
20
20
  ExampleGrid,
21
- ExampleSection,
21
+ ShowcaseExample,
22
22
  Showcase,
23
23
  ShowcaseDocs
24
24
  } from "../../dev/components/showcase";
@@ -26,34 +26,29 @@ import { type Size } from "../../lib/types";
26
26
 
27
27
  function ItemMicroShowcase({ globalSize }: { globalSize: Size }) {
28
28
  return (
29
- <div className="space-y-10 mt-6">
29
+ <div className="space-y-10">
30
30
  <ExampleGrid>
31
- <ExampleSection
32
- label="Basic Content"
33
- description="Item cơ bản với tiêu đề và mô tả."
34
- codeString={`<Item className="w-full">
31
+ <ShowcaseExample title="Nội dung cơ bản" description="Item cơ bản với tiêu đề và mô tả." code={`<Item className="w-full">
35
32
  <ItemContent>
36
33
  <ItemTitle>Basic Item Content</ItemTitle>
37
34
  <ItemDescription>
38
- This item shows structured text.
35
+ Mục này hiển thị văn bản có cấu trúc.
39
36
  </ItemDescription>
40
37
  </ItemContent>
41
- </Item>`}
42
- >
43
- <Item size={globalSize} className="w-full">
44
- <ItemContent>
45
- <ItemTitle>Basic Item Content</ItemTitle>
46
- <ItemDescription>
47
- This item shows structured text.
48
- </ItemDescription>
49
- </ItemContent>
50
- </Item>
51
- </ExampleSection>
38
+ </Item>`} preview={
39
+ <>
40
+ <Item size={globalSize} className="w-full">
41
+ <ItemContent>
42
+ <ItemTitle>Basic Item Content</ItemTitle>
43
+ <ItemDescription>
44
+ Mục này hiển thị văn bản có cấu trúc.
45
+ </ItemDescription>
46
+ </ItemContent>
47
+ </Item>
48
+ </>
49
+ } />
52
50
 
53
- <ExampleSection
54
- label="With Media"
55
- description="Item kèm icon hoặc avatar."
56
- codeString={`<Item className="w-full">
51
+ <ShowcaseExample title="Có hình ảnh" description="Item kèm icon hoặc avatar." code={`<Item className="w-full">
57
52
  <ItemMedia className="bg-primary/10 text-primary rounded-md p-2">
58
53
  <UserIcon className="size-4" />
59
54
  </ItemMedia>
@@ -61,25 +56,23 @@ function ItemMicroShowcase({ globalSize }: { globalSize: Size }) {
61
56
  <ItemTitle>User Profile</ItemTitle>
62
57
  <ItemDescription>Manage your account</ItemDescription>
63
58
  </ItemContent>
64
- </Item>`}
65
- >
66
- <Item size={globalSize} className="w-full">
67
- <ItemMedia className="bg-primary/10 text-primary rounded-md p-2">
68
- <UserIcon className="size-4" />
69
- </ItemMedia>
70
- <ItemContent>
71
- <ItemTitle>User Profile</ItemTitle>
72
- <ItemDescription>Manage your account</ItemDescription>
73
- </ItemContent>
74
- </Item>
75
- </ExampleSection>
59
+ </Item>`} preview={
60
+ <>
61
+ <Item size={globalSize} className="w-full">
62
+ <ItemMedia className="bg-primary/10 text-primary rounded-md p-2">
63
+ <UserIcon className="size-4" />
64
+ </ItemMedia>
65
+ <ItemContent>
66
+ <ItemTitle>User Profile</ItemTitle>
67
+ <ItemDescription>Manage your account</ItemDescription>
68
+ </ItemContent>
69
+ </Item>
70
+ </>
71
+ } />
76
72
  </ExampleGrid>
77
73
 
78
74
  <ExampleGrid>
79
- <ExampleSection
80
- label="Variants"
81
- description="Các variant khác nhau: outline, muted."
82
- codeString={`<div className="flex flex-col gap-3 w-full">
75
+ <ShowcaseExample title="Variants" description="Các variant khác nhau: outline, muted." code={`<div className="flex flex-col gap-3 w-full">
83
76
  <Item variant="outline">
84
77
  <ItemContent>
85
78
  <ItemTitle>Outline Variant</ItemTitle>
@@ -90,26 +83,24 @@ function ItemMicroShowcase({ globalSize }: { globalSize: Size }) {
90
83
  <ItemTitle>Muted Variant</ItemTitle>
91
84
  </ItemContent>
92
85
  </Item>
93
- </div>`}
94
- >
95
- <div className="flex flex-col gap-3 w-full">
96
- <Item variant="outline" size={globalSize}>
97
- <ItemContent>
98
- <ItemTitle>Outline Variant</ItemTitle>
99
- </ItemContent>
100
- </Item>
101
- <Item variant="muted" size={globalSize}>
102
- <ItemContent>
103
- <ItemTitle>Muted Variant</ItemTitle>
104
- </ItemContent>
105
- </Item>
106
- </div>
107
- </ExampleSection>
86
+ </div>`} preview={
87
+ <>
88
+ <div className="flex flex-col gap-3 w-full">
89
+ <Item variant="outline" size={globalSize}>
90
+ <ItemContent>
91
+ <ItemTitle>Outline Variant</ItemTitle>
92
+ </ItemContent>
93
+ </Item>
94
+ <Item variant="muted" size={globalSize}>
95
+ <ItemContent>
96
+ <ItemTitle>Muted Variant</ItemTitle>
97
+ </ItemContent>
98
+ </Item>
99
+ </div>
100
+ </>
101
+ } />
108
102
 
109
- <ExampleSection
110
- label="Media Variants"
111
- description="ItemMedia hỗ trợ các variant riêng: icon và image."
112
- codeString={`<div className="flex flex-col gap-3 w-full">
103
+ <ShowcaseExample title="Loại hình ảnh" description="ItemMedia hỗ trợ các variant riêng: icon và image." code={`<div className="flex flex-col gap-3 w-full">
113
104
  <Item>
114
105
  <ItemMedia
115
106
  variant="icon"
@@ -129,32 +120,30 @@ function ItemMicroShowcase({ globalSize }: { globalSize: Size }) {
129
120
  <ItemTitle>Image Variant</ItemTitle>
130
121
  </ItemContent>
131
122
  </Item>
132
- </div>`}
133
- >
134
- <div className="flex flex-col gap-3 w-full">
135
- <Item size={globalSize}>
136
- <ItemMedia variant="icon" className="bg-primary/10 text-primary">
137
- <CheckIcon className="size-4" />
138
- </ItemMedia>
139
- <ItemContent>
140
- <ItemTitle>Icon Variant</ItemTitle>
141
- </ItemContent>
142
- </Item>
143
- <Item size={globalSize}>
144
- <ItemMedia variant="image" className="bg-muted">
145
- <UserIcon className="size-4 text-muted-foreground" />
146
- </ItemMedia>
147
- <ItemContent>
148
- <ItemTitle>Image Variant</ItemTitle>
149
- </ItemContent>
150
- </Item>
151
- </div>
152
- </ExampleSection>
123
+ </div>`} preview={
124
+ <>
125
+ <div className="flex flex-col gap-3 w-full">
126
+ <Item size={globalSize}>
127
+ <ItemMedia variant="icon" className="bg-primary/10 text-primary">
128
+ <CheckIcon className="size-4" />
129
+ </ItemMedia>
130
+ <ItemContent>
131
+ <ItemTitle>Icon Variant</ItemTitle>
132
+ </ItemContent>
133
+ </Item>
134
+ <Item size={globalSize}>
135
+ <ItemMedia variant="image" className="bg-muted">
136
+ <UserIcon className="size-4 text-muted-foreground" />
137
+ </ItemMedia>
138
+ <ItemContent>
139
+ <ItemTitle>Image Variant</ItemTitle>
140
+ </ItemContent>
141
+ </Item>
142
+ </div>
143
+ </>
144
+ } />
153
145
 
154
- <ExampleSection
155
- label="With Actions"
156
- description="Item có các nút hành động ở cuối (ItemActions)."
157
- codeString={`<Item className="w-full">
146
+ <ShowcaseExample title="Kèm nút thao tác" description="Item có các nút hành động ở cuối (ItemActions)." code={`<Item className="w-full">
158
147
  <ItemContent>
159
148
  <ItemTitle>Actionable Item</ItemTitle>
160
149
  </ItemContent>
@@ -174,28 +163,26 @@ function ItemMicroShowcase({ globalSize }: { globalSize: Size }) {
174
163
  <MoreVerticalIcon className="size-4" />
175
164
  </Button>
176
165
  </ItemActions>
177
- </Item>`}
178
- >
179
- <Item size={globalSize} className="w-full">
180
- <ItemContent>
181
- <ItemTitle>Actionable Item</ItemTitle>
182
- </ItemContent>
183
- <ItemActions>
184
- <Button variant="ghost" size="sm" className="size-8 p-0" iconOnly>
185
- <HeartIcon className="size-4" />
186
- </Button>
187
- <Button variant="ghost" size="sm" className="size-8 p-0" iconOnly>
188
- <MoreVerticalIcon className="size-4" />
189
- </Button>
190
- </ItemActions>
191
- </Item>
192
- </ExampleSection>
166
+ </Item>`} preview={
167
+ <>
168
+ <Item size={globalSize} className="w-full">
169
+ <ItemContent>
170
+ <ItemTitle>Actionable Item</ItemTitle>
171
+ </ItemContent>
172
+ <ItemActions>
173
+ <Button variant="ghost" size="sm" className="size-8 p-0" iconOnly>
174
+ <HeartIcon className="size-4" />
175
+ </Button>
176
+ <Button variant="ghost" size="sm" className="size-8 p-0" iconOnly>
177
+ <MoreVerticalIcon className="size-4" />
178
+ </Button>
179
+ </ItemActions>
180
+ </Item>
181
+ </>
182
+ } />
193
183
  </ExampleGrid>
194
184
 
195
- <ExampleSection
196
- label="Item Group"
197
- description="Nhóm các Item và phân cách bằng ItemSeparator."
198
- codeString={`<ItemGroup className="w-full max-w-sm mx-auto">
185
+ <ShowcaseExample title="Nhóm Item" description="Nhóm các Item và phân cách bằng ItemSeparator." code={`<ItemGroup className="w-full max-w-sm mx-auto">
199
186
  <Item>
200
187
  <ItemContent>
201
188
  <ItemTitle>Account Settings</ItemTitle>
@@ -211,37 +198,35 @@ function ItemMicroShowcase({ globalSize }: { globalSize: Size }) {
211
198
  <Item>
212
199
  <ItemContent>
213
200
  <ItemTitle className="text-destructive">
214
- Delete Account
201
+ Xóa tài khoản
215
202
  </ItemTitle>
216
203
  </ItemContent>
217
204
  </Item>
218
- </ItemGroup>`}
219
- >
220
- <ItemGroup className="w-full max-w-sm mx-auto">
221
- <Item size={globalSize}>
222
- <ItemContent>
223
- <ItemTitle>Account Settings</ItemTitle>
224
- </ItemContent>
225
- </Item>
226
- <ItemSeparator />
227
- <Item size={globalSize}>
228
- <ItemContent>
229
- <ItemTitle>Notification Preferences</ItemTitle>
230
- </ItemContent>
231
- </Item>
232
- <ItemSeparator />
233
- <Item size={globalSize}>
234
- <ItemContent>
235
- <ItemTitle className="text-destructive">Delete Account</ItemTitle>
236
- </ItemContent>
237
- </Item>
238
- </ItemGroup>
239
- </ExampleSection>
205
+ </ItemGroup>`} preview={
206
+ <>
207
+ <ItemGroup className="w-full max-w-sm mx-auto">
208
+ <Item size={globalSize}>
209
+ <ItemContent>
210
+ <ItemTitle>Account Settings</ItemTitle>
211
+ </ItemContent>
212
+ </Item>
213
+ <ItemSeparator />
214
+ <Item size={globalSize}>
215
+ <ItemContent>
216
+ <ItemTitle>Notification Preferences</ItemTitle>
217
+ </ItemContent>
218
+ </Item>
219
+ <ItemSeparator />
220
+ <Item size={globalSize}>
221
+ <ItemContent>
222
+ <ItemTitle className="text-destructive">Xóa tài khoản</ItemTitle>
223
+ </ItemContent>
224
+ </Item>
225
+ </ItemGroup>
226
+ </>
227
+ } />
240
228
 
241
- <ExampleSection
242
- label="With Header and Footer"
243
- description="Item phức tạp với ItemHeader và ItemFooter."
244
- codeString={`<Item className="w-full max-w-sm mx-auto flex-col items-start gap-2">
229
+ <ShowcaseExample title="Có Header và Footer" description="Item phức tạp với ItemHeader và ItemFooter." code={`<Item className="w-full max-w-sm mx-auto flex-col items-start gap-2">
245
230
  <ItemHeader className="text-xs text-muted-foreground">
246
231
  Order #12345
247
232
  </ItemHeader>
@@ -251,23 +236,24 @@ function ItemMicroShowcase({ globalSize }: { globalSize: Size }) {
251
236
  <ItemFooter className="text-xs text-success flex items-center gap-1">
252
237
  <CheckIcon className="size-3" /> Delivered
253
238
  </ItemFooter>
254
- </Item>`}
255
- >
256
- <Item
257
- size={globalSize}
258
- className="w-full max-w-sm mx-auto flex-col items-start gap-2"
259
- >
260
- <ItemHeader className="text-xs text-muted-foreground">
261
- Order #12345
262
- </ItemHeader>
263
- <ItemContent>
264
- <ItemTitle>Mechanical Keyboard v2</ItemTitle>
265
- </ItemContent>
266
- <ItemFooter className="text-xs text-success flex items-center gap-1">
267
- <CheckIcon className="size-3" /> Delivered
268
- </ItemFooter>
269
- </Item>
270
- </ExampleSection>
239
+ </Item>`} preview={
240
+ <>
241
+ <Item
242
+ size={globalSize}
243
+ className="w-full max-w-sm mx-auto flex-col items-start gap-2"
244
+ >
245
+ <ItemHeader className="text-xs text-muted-foreground">
246
+ Order #12345
247
+ </ItemHeader>
248
+ <ItemContent>
249
+ <ItemTitle>Mechanical Keyboard v2</ItemTitle>
250
+ </ItemContent>
251
+ <ItemFooter className="text-xs text-success flex items-center gap-1">
252
+ <CheckIcon className="size-3" /> Delivered
253
+ </ItemFooter>
254
+ </Item>
255
+ </>
256
+ } />
271
257
  </div>
272
258
  );
273
259
  }
@@ -278,7 +264,7 @@ export default function ItemShowcase() {
278
264
  <Showcase
279
265
  title="Item"
280
266
  description="Container linh hoạt cho danh sách hoặc khối nội dung có cấu trúc."
281
- generalConcept={
267
+ guideline={
282
268
  <ShowcaseDocs>
283
269
  <DocsH3>Item</DocsH3>
284
270
  <DocsP>
@@ -287,11 +273,7 @@ export default function ItemShowcase() {
287
273
  </DocsP>
288
274
  </ShowcaseDocs>
289
275
  }
290
- tabs={[
291
- {
292
- label: "Micro (Primitive)",
293
- content: <ItemMicroShowcase globalSize={globalSize} /> },
294
- ]}
276
+ micro={{ content: <ItemMicroShowcase globalSize={globalSize} /> }}
295
277
  />
296
278
  );
297
279
  }