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
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  DocsP,
26
26
  ExampleGrid,
27
- ExampleSection,
27
+ ShowcaseExample,
28
28
  Showcase,
29
29
  ShowcaseDocs
30
30
  } from "../../dev/components/showcase";
@@ -33,15 +33,12 @@ function CommandMicroShowcase() {
33
33
  const [open, setOpen] = useState(false);
34
34
 
35
35
  return (
36
- <div className="space-y-10 mt-6">
36
+ <div className="space-y-10">
37
37
  <ExampleGrid>
38
- <ExampleSection
39
- label="Default"
40
- description="Bảng lệnh có thể tìm kiếm với các mục được nhóm."
41
- codeString={`<Command className="border border-border rounded-xl shadow-sm overflow-hidden bg-background w-full">
38
+ <ShowcaseExample title="Default" description="Bảng lệnh có thể tìm kiếm với các mục được nhóm." code={`<Command className="border border-border rounded-xl shadow-sm overflow-hidden bg-background w-full">
42
39
  <CommandInput placeholder="Type a command or search..." />
43
40
  <CommandList>
44
- <CommandEmpty>No results found.</CommandEmpty>
41
+ <CommandEmpty>Không tìm thấy kết quả.</CommandEmpty>
45
42
  <CommandGroup heading="Suggestions">
46
43
  <CommandItem>
47
44
  <CalendarIcon className="mr-2 h-4 w-4" />
@@ -49,7 +46,7 @@ function CommandMicroShowcase() {
49
46
  </CommandItem>
50
47
  <CommandItem>
51
48
  <SmileIcon className="mr-2 h-4 w-4" />
52
- <span>Search Emoji</span>
49
+ <span>Tìm kiếm Emoji</span>
53
50
  </CommandItem>
54
51
  <CommandItem disabled>
55
52
  <CalculatorIcon className="mr-2 h-4 w-4" />
@@ -60,7 +57,7 @@ function CommandMicroShowcase() {
60
57
  <CommandGroup heading="Settings">
61
58
  <CommandItem>
62
59
  <UserIcon className="mr-2 h-4 w-4" />
63
- <span>Profile</span>
60
+ <span>Hồ sơ</span>
64
61
  <CommandShortcut>⌘P</CommandShortcut>
65
62
  </CommandItem>
66
63
  <CommandItem>
@@ -70,69 +67,67 @@ function CommandMicroShowcase() {
70
67
  </CommandItem>
71
68
  <CommandItem>
72
69
  <SettingsIcon className="mr-2 h-4 w-4" />
73
- <span>Settings</span>
70
+ <span>Cài đặt</span>
74
71
  <CommandShortcut>⌘S</CommandShortcut>
75
72
  </CommandItem>
76
73
  </CommandGroup>
77
74
  </CommandList>
78
75
  </Command>
79
- `}
80
- >
81
- <Command className="border border-border rounded-xl shadow-sm overflow-hidden bg-background w-full">
82
- <CommandInput placeholder="Type a command or search..." />
83
- <CommandList>
84
- <CommandEmpty>No results found.</CommandEmpty>
85
- <CommandGroup heading="Suggestions">
86
- <CommandItem>
87
- <CalendarIcon className="mr-2 h-4 w-4" />
88
- <span>Calendar</span>
89
- </CommandItem>
90
- <CommandItem>
91
- <SmileIcon className="mr-2 h-4 w-4" />
92
- <span>Search Emoji</span>
93
- </CommandItem>
94
- <CommandItem disabled>
95
- <CalculatorIcon className="mr-2 h-4 w-4" />
96
- <span>Calculator</span>
97
- </CommandItem>
98
- </CommandGroup>
99
- <CommandSeparator />
100
- <CommandGroup heading="Settings">
101
- <CommandItem>
102
- <UserIcon className="mr-2 h-4 w-4" />
103
- <span>Profile</span>
104
- <CommandShortcut>⌘P</CommandShortcut>
105
- </CommandItem>
106
- <CommandItem>
107
- <CreditCardIcon className="mr-2 h-4 w-4" />
108
- <span>Billing</span>
109
- <CommandShortcut>⌘B</CommandShortcut>
110
- </CommandItem>
111
- <CommandItem>
112
- <SettingsIcon className="mr-2 h-4 w-4" />
113
- <span>Settings</span>
114
- <CommandShortcut>⌘S</CommandShortcut>
115
- </CommandItem>
116
- </CommandGroup>
117
- </CommandList>
118
- </Command>
119
- </ExampleSection>
76
+ `} preview={
77
+ <>
78
+ <Command className="border border-border rounded-xl shadow-sm overflow-hidden bg-background w-full">
79
+ <CommandInput placeholder="Type a command or search..." />
80
+ <CommandList>
81
+ <CommandEmpty>Không tìm thấy kết quả.</CommandEmpty>
82
+ <CommandGroup heading="Suggestions">
83
+ <CommandItem>
84
+ <CalendarIcon className="mr-2 h-4 w-4" />
85
+ <span>Calendar</span>
86
+ </CommandItem>
87
+ <CommandItem>
88
+ <SmileIcon className="mr-2 h-4 w-4" />
89
+ <span>Tìm kiếm Emoji</span>
90
+ </CommandItem>
91
+ <CommandItem disabled>
92
+ <CalculatorIcon className="mr-2 h-4 w-4" />
93
+ <span>Calculator</span>
94
+ </CommandItem>
95
+ </CommandGroup>
96
+ <CommandSeparator />
97
+ <CommandGroup heading="Settings">
98
+ <CommandItem>
99
+ <UserIcon className="mr-2 h-4 w-4" />
100
+ <span>Hồ sơ</span>
101
+ <CommandShortcut>⌘P</CommandShortcut>
102
+ </CommandItem>
103
+ <CommandItem>
104
+ <CreditCardIcon className="mr-2 h-4 w-4" />
105
+ <span>Billing</span>
106
+ <CommandShortcut>⌘B</CommandShortcut>
107
+ </CommandItem>
108
+ <CommandItem>
109
+ <SettingsIcon className="mr-2 h-4 w-4" />
110
+ <span>Cài đặt</span>
111
+ <CommandShortcut>⌘S</CommandShortcut>
112
+ </CommandItem>
113
+ </CommandGroup>
114
+ </CommandList>
115
+ </Command>
116
+ </>
117
+ } />
120
118
 
121
- <ExampleSection
122
- label="Flat List"
123
- description="Nhóm duy nhất không có tiêu đề."
124
- codeString={`<Command className="border border-border rounded-xl shadow-sm overflow-hidden bg-background w-full">
125
- <CommandInput placeholder="Search actions..." />
119
+ <ShowcaseExample title="Flat List" description="Nhóm duy nhất không có tiêu đề." code={`<Command className="border border-border rounded-xl shadow-sm overflow-hidden bg-background w-full">
120
+ <CommandInput placeholder="Tìm kiếm hành động..." />
126
121
  <CommandList>
127
122
  <CommandEmpty>No actions found.</CommandEmpty>
128
123
  <CommandGroup>
129
124
  <CommandItem>
130
125
  <UserIcon className="mr-2 h-4 w-4" />
131
- <span>View Profile</span>
126
+ <span>Xem hồ sơ</span>
132
127
  </CommandItem>
133
128
  <CommandItem>
134
129
  <SettingsIcon className="mr-2 h-4 w-4" />
135
- <span>Open Settings</span>
130
+ <span>Mở cài đặt</span>
136
131
  </CommandItem>
137
132
  <CommandItem>
138
133
  <CalendarIcon className="mr-2 h-4 w-4" />
@@ -145,45 +140,43 @@ function CommandMicroShowcase() {
145
140
  </CommandGroup>
146
141
  </CommandList>
147
142
  </Command>
148
- `}
149
- >
150
- <Command className="border border-border rounded-xl shadow-sm overflow-hidden bg-background w-full">
151
- <CommandInput placeholder="Search actions..." />
152
- <CommandList>
153
- <CommandEmpty>No actions found.</CommandEmpty>
154
- <CommandGroup>
155
- <CommandItem>
156
- <UserIcon className="mr-2 h-4 w-4" />
157
- <span>View Profile</span>
158
- </CommandItem>
159
- <CommandItem>
160
- <SettingsIcon className="mr-2 h-4 w-4" />
161
- <span>Open Settings</span>
162
- </CommandItem>
163
- <CommandItem>
164
- <CalendarIcon className="mr-2 h-4 w-4" />
165
- <span>Schedule Meeting</span>
166
- </CommandItem>
167
- <CommandItem>
168
- <CreditCardIcon className="mr-2 h-4 w-4" />
169
- <span>Manage Billing</span>
170
- </CommandItem>
171
- </CommandGroup>
172
- </CommandList>
173
- </Command>
174
- </ExampleSection>
143
+ `} preview={
144
+ <>
145
+ <Command className="border border-border rounded-xl shadow-sm overflow-hidden bg-background w-full">
146
+ <CommandInput placeholder="Tìm kiếm hành động..." />
147
+ <CommandList>
148
+ <CommandEmpty>No actions found.</CommandEmpty>
149
+ <CommandGroup>
150
+ <CommandItem>
151
+ <UserIcon className="mr-2 h-4 w-4" />
152
+ <span>Xem hồ sơ</span>
153
+ </CommandItem>
154
+ <CommandItem>
155
+ <SettingsIcon className="mr-2 h-4 w-4" />
156
+ <span>Mở cài đặt</span>
157
+ </CommandItem>
158
+ <CommandItem>
159
+ <CalendarIcon className="mr-2 h-4 w-4" />
160
+ <span>Schedule Meeting</span>
161
+ </CommandItem>
162
+ <CommandItem>
163
+ <CreditCardIcon className="mr-2 h-4 w-4" />
164
+ <span>Manage Billing</span>
165
+ </CommandItem>
166
+ </CommandGroup>
167
+ </CommandList>
168
+ </Command>
169
+ </>
170
+ } />
175
171
  </ExampleGrid>
176
172
 
177
- <ExampleSection
178
- label="Dialog Menu"
179
- description="Menu lệnh được hiển thị bên trong dialog."
180
- codeString={`<Button onClick={() => setOpen(true)}>
173
+ <ShowcaseExample title="Dialog Menu" description="Menu lệnh được hiển thị bên trong dialog." code={`<Button onClick={() => setOpen(true)}>
181
174
  Open Command Palette
182
175
  </Button>
183
176
  <CommandDialog open={open} onOpenChange={setOpen}>
184
177
  <CommandInput placeholder="Type a command or search..." />
185
178
  <CommandList>
186
- <CommandEmpty>No results found.</CommandEmpty>
179
+ <CommandEmpty>Không tìm thấy kết quả.</CommandEmpty>
187
180
  <CommandGroup heading="Suggestions">
188
181
  <CommandItem>
189
182
  <CalendarIcon className="mr-2 h-4 w-4" />
@@ -191,43 +184,40 @@ function CommandMicroShowcase() {
191
184
  </CommandItem>
192
185
  <CommandItem>
193
186
  <SmileIcon className="mr-2 h-4 w-4" />
194
- <span>Search Emoji</span>
187
+ <span>Tìm kiếm Emoji</span>
195
188
  </CommandItem>
196
189
  </CommandGroup>
197
190
  </CommandList>
198
- </CommandDialog>`}
199
- >
200
- <Button onClick={() => setOpen(true)}>Open Command Palette</Button>
201
- <CommandDialog open={open} onOpenChange={setOpen}>
202
- <CommandInput placeholder="Type a command or search..." />
203
- <CommandList>
204
- <CommandEmpty>No results found.</CommandEmpty>
205
- <CommandGroup heading="Suggestions">
206
- <CommandItem>
207
- <CalendarIcon className="mr-2 h-4 w-4" />
208
- <span>Calendar</span>
209
- </CommandItem>
210
- <CommandItem>
211
- <SmileIcon className="mr-2 h-4 w-4" />
212
- <span>Search Emoji</span>
213
- </CommandItem>
214
- </CommandGroup>
215
- </CommandList>
216
- </CommandDialog>
217
- </ExampleSection>
191
+ </CommandDialog>`} preview={
192
+ <>
193
+ <Button onClick={() => setOpen(true)}>Mở Command Palette</Button><CommandDialog open={open} onOpenChange={setOpen}>
194
+ <CommandInput placeholder="Type a command or search..." />
195
+ <CommandList>
196
+ <CommandEmpty>Không tìm thấy kết quả.</CommandEmpty>
197
+ <CommandGroup heading="Suggestions">
198
+ <CommandItem>
199
+ <CalendarIcon className="mr-2 h-4 w-4" />
200
+ <span>Calendar</span>
201
+ </CommandItem>
202
+ <CommandItem>
203
+ <SmileIcon className="mr-2 h-4 w-4" />
204
+ <span>Tìm kiếm Emoji</span>
205
+ </CommandItem>
206
+ </CommandGroup>
207
+ </CommandList>
208
+ </CommandDialog>
209
+ </>
210
+ } />
218
211
  </div>
219
212
  );
220
213
  }
221
214
 
222
- // ──────────────────────────────────────────────────────────
223
- // SECTION 3: Entry point
224
- // ──────────────────────────────────────────────────────────
225
215
  export default function CommandShowcase() {
226
216
  return (
227
217
  <Showcase
228
218
  title="Command"
229
219
  description="Command palette có tìm kiếm, kích hoạt bằng phím tắt (⌘K)."
230
- generalConcept={
220
+ guideline={
231
221
  <ShowcaseDocs>
232
222
  <DocsP>
233
223
  Dùng để tạo các bảng lệnh (command palette) hoặc menu chọn có khả
@@ -237,11 +227,7 @@ export default function CommandShowcase() {
237
227
  </DocsP>
238
228
  </ShowcaseDocs>
239
229
  }
240
- tabs={[
241
- {
242
- label: "Micro (Primitive)",
243
- content: <CommandMicroShowcase /> },
244
- ]}
230
+ micro={{ content: <CommandMicroShowcase /> }}
245
231
  />
246
232
  );
247
233
  }
@@ -19,25 +19,19 @@ import {
19
19
  } from "../../components/micro/context-menu";
20
20
  import {
21
21
  DocsP,
22
- ExampleSection,
22
+ ShowcaseExample,
23
23
  Showcase,
24
24
  ShowcaseDocs
25
25
  } from "../../dev/components/showcase";
26
26
 
27
- // ──────────────────────────────────────────────────────────
28
- // SECTION 2: Micro Content (không export)
29
- // ──────────────────────────────────────────────────────────
30
27
  function ContextMenuMicroShowcase() {
31
28
  const [showBookmarks, setShowBookmarks] = useState(true);
32
29
  const [showFullUrls, setShowFullUrls] = useState(false);
33
30
  const [person, setPerson] = useState("pedro");
34
31
 
35
32
  return (
36
- <div className="space-y-10 mt-6">
37
- <ExampleSection
38
- label="Full Context Menu"
39
- description="Nhấp chuột phải vào khu vực bên dưới để mở."
40
- codeString={`<ContextMenu>
33
+ <div className="space-y-10">
34
+ <ShowcaseExample title="Full Context Menu" description="Nhấp chuột phải vào khu vực bên dưới để mở." code={`<ContextMenu>
41
35
  <ContextMenuTrigger className="flex h-[150px] w-full max-w-[400px] items-center justify-center rounded-md border border-border border-dashed text-sm">
42
36
  Right click here
43
37
  </ContextMenuTrigger>
@@ -112,77 +106,75 @@ function ContextMenuMicroShowcase() {
112
106
  </ContextMenuGroup>
113
107
  </ContextMenuContent>
114
108
 
115
- </ContextMenu>`}
116
- >
117
- <ContextMenu>
118
- <ContextMenuTrigger className="flex h-[150px] w-full max-w-[400px] items-center justify-center rounded-md border border-border border-dashed text-sm">
119
- Right click here
120
- </ContextMenuTrigger>
109
+ </ContextMenu>`} preview={
110
+ <>
111
+ <ContextMenu>
112
+ <ContextMenuTrigger className="flex h-[150px] w-full max-w-[400px] items-center justify-center rounded-md border border-border border-dashed text-sm">
113
+ Right click here
114
+ </ContextMenuTrigger>
121
115
 
122
- <ContextMenuContent className="w-64">
123
- <ContextMenuItem inset>
124
- Back
125
- <ContextMenuShortcut>⌘[</ContextMenuShortcut>
126
- </ContextMenuItem>
127
- <ContextMenuItem inset disabled>
128
- Forward
129
- <ContextMenuShortcut>⌘]</ContextMenuShortcut>
130
- </ContextMenuItem>
131
- <ContextMenuItem inset>
132
- Reload
133
- <ContextMenuShortcut>⌘R</ContextMenuShortcut>
134
- </ContextMenuItem>
135
- <ContextMenuSub>
136
- <ContextMenuSubTrigger inset>More Tools</ContextMenuSubTrigger>
116
+ <ContextMenuContent className="w-64">
117
+ <ContextMenuItem inset>
118
+ Back
119
+ <ContextMenuShortcut>⌘[</ContextMenuShortcut>
120
+ </ContextMenuItem>
121
+ <ContextMenuItem inset disabled>
122
+ Forward
123
+ <ContextMenuShortcut>⌘]</ContextMenuShortcut>
124
+ </ContextMenuItem>
125
+ <ContextMenuItem inset>
126
+ Reload
127
+ <ContextMenuShortcut>⌘R</ContextMenuShortcut>
128
+ </ContextMenuItem>
129
+ <ContextMenuSub>
130
+ <ContextMenuSubTrigger inset>More Tools</ContextMenuSubTrigger>
137
131
 
138
- <ContextMenuSubContent className="w-48">
139
- <ContextMenuItem>
140
- Save Page As...
141
- <ContextMenuShortcut>⇧⌘S</ContextMenuShortcut>
142
- </ContextMenuItem>
143
- <ContextMenuItem>Create Shortcut...</ContextMenuItem>
144
- <ContextMenuItem>Name Window...</ContextMenuItem>
145
- <ContextMenuSeparator />
146
- <ContextMenuItem>Developer Tools</ContextMenuItem>
147
- </ContextMenuSubContent>
148
-
149
- </ContextMenuSub>
150
- <ContextMenuSeparator />
151
- <ContextMenuCheckboxItem
152
- checked={showBookmarks}
153
- onCheckedChange={setShowBookmarks}
154
- >
155
- Show Bookmarks Bar
156
- <ContextMenuShortcut>⌘⇧B</ContextMenuShortcut>
157
- </ContextMenuCheckboxItem>
158
- <ContextMenuCheckboxItem
159
- checked={showFullUrls}
160
- onCheckedChange={setShowFullUrls}
161
- >
162
- Show Full URLs
163
- </ContextMenuCheckboxItem>
164
- <ContextMenuSeparator />
165
- <ContextMenuGroup>
166
- <ContextMenuLabel inset>People</ContextMenuLabel>
167
- <ContextMenuSeparator />
168
- <ContextMenuRadioGroup value={person} onValueChange={setPerson}>
169
- <ContextMenuRadioItem value="pedro">
170
- Pedro Duarte
171
- </ContextMenuRadioItem>
172
- <ContextMenuRadioItem value="colm">
173
- Colm Tuite
174
- </ContextMenuRadioItem>
175
- </ContextMenuRadioGroup>
176
- </ContextMenuGroup>
177
- </ContextMenuContent>
178
-
179
- </ContextMenu>
180
- </ExampleSection>
132
+ <ContextMenuSubContent className="w-48">
133
+ <ContextMenuItem>
134
+ Save Page As...
135
+ <ContextMenuShortcut>⇧⌘S</ContextMenuShortcut>
136
+ </ContextMenuItem>
137
+ <ContextMenuItem>Create Shortcut...</ContextMenuItem>
138
+ <ContextMenuItem>Name Window...</ContextMenuItem>
139
+ <ContextMenuSeparator />
140
+ <ContextMenuItem>Developer Tools</ContextMenuItem>
141
+ </ContextMenuSubContent>
142
+
143
+ </ContextMenuSub>
144
+ <ContextMenuSeparator />
145
+ <ContextMenuCheckboxItem
146
+ checked={showBookmarks}
147
+ onCheckedChange={setShowBookmarks}
148
+ >
149
+ Show Bookmarks Bar
150
+ <ContextMenuShortcut>⌘⇧B</ContextMenuShortcut>
151
+ </ContextMenuCheckboxItem>
152
+ <ContextMenuCheckboxItem
153
+ checked={showFullUrls}
154
+ onCheckedChange={setShowFullUrls}
155
+ >
156
+ Show Full URLs
157
+ </ContextMenuCheckboxItem>
158
+ <ContextMenuSeparator />
159
+ <ContextMenuGroup>
160
+ <ContextMenuLabel inset>People</ContextMenuLabel>
161
+ <ContextMenuSeparator />
162
+ <ContextMenuRadioGroup value={person} onValueChange={setPerson}>
163
+ <ContextMenuRadioItem value="pedro">
164
+ Pedro Duarte
165
+ </ContextMenuRadioItem>
166
+ <ContextMenuRadioItem value="colm">
167
+ Colm Tuite
168
+ </ContextMenuRadioItem>
169
+ </ContextMenuRadioGroup>
170
+ </ContextMenuGroup>
171
+ </ContextMenuContent>
172
+
173
+ </ContextMenu>
174
+ </>
175
+ } />
181
176
 
182
- <ExampleSection
183
- label="Destructive Variant"
184
- description="Context menu với các action nguy hiểm hiển thị màu destructive."
185
- codeString={`<ContextMenu>
177
+ <ShowcaseExample title="Destructive Variant" description="Context menu với các action nguy hiểm hiển thị màu destructive." code={`<ContextMenu>
186
178
  <ContextMenuTrigger className="flex h-[100px] w-full max-w-[300px] items-center justify-center rounded-md border border-border border-dashed text-sm">
187
179
  Right click here
188
180
  </ContextMenuTrigger>
@@ -200,41 +192,39 @@ function ContextMenuMicroShowcase() {
200
192
  </ContextMenuItem>
201
193
  </ContextMenuContent>
202
194
 
203
- </ContextMenu>`}
204
- >
205
- <ContextMenu>
206
- <ContextMenuTrigger className="flex h-[100px] w-full max-w-[300px] items-center justify-center rounded-md border border-border border-dashed text-sm">
207
- Right click here
208
- </ContextMenuTrigger>
195
+ </ContextMenu>`} preview={
196
+ <>
197
+ <ContextMenu>
198
+ <ContextMenuTrigger className="flex h-[100px] w-full max-w-[300px] items-center justify-center rounded-md border border-border border-dashed text-sm">
199
+ Right click here
200
+ </ContextMenuTrigger>
209
201
 
210
- <ContextMenuContent className="w-52">
211
- <ContextMenuItem>
212
- Rename
213
- <ContextMenuShortcut>⌘R</ContextMenuShortcut>
214
- </ContextMenuItem>
215
- <ContextMenuItem>Duplicate</ContextMenuItem>
216
- <ContextMenuSeparator />
217
- <ContextMenuItem variant="destructive">
218
- Delete
219
- <ContextMenuShortcut>⌫</ContextMenuShortcut>
220
- </ContextMenuItem>
221
- </ContextMenuContent>
222
-
223
- </ContextMenu>
224
- </ExampleSection>
202
+ <ContextMenuContent className="w-52">
203
+ <ContextMenuItem>
204
+ Rename
205
+ <ContextMenuShortcut>⌘R</ContextMenuShortcut>
206
+ </ContextMenuItem>
207
+ <ContextMenuItem>Duplicate</ContextMenuItem>
208
+ <ContextMenuSeparator />
209
+ <ContextMenuItem variant="destructive">
210
+ Delete
211
+ <ContextMenuShortcut>⌫</ContextMenuShortcut>
212
+ </ContextMenuItem>
213
+ </ContextMenuContent>
214
+
215
+ </ContextMenu>
216
+ </>
217
+ } />
225
218
  </div>
226
219
  );
227
220
  }
228
221
 
229
- // ──────────────────────────────────────────────────────────
230
- // SECTION 3: Entry point (export default)
231
- // ──────────────────────────────────────────────────────────
232
222
  export default function ContextMenuShowcase() {
233
223
  return (
234
224
  <Showcase
235
225
  title="Context Menu"
236
226
  description="Menu ngữ cảnh hiển thị khi click chuột phải — dùng cho các hành động nhanh."
237
- generalConcept={
227
+ guideline={
238
228
  <ShowcaseDocs>
239
229
  <DocsP>
240
230
  Dùng để hiển thị danh sách các tuỳ chọn hoặc hành động liên quan tới
@@ -242,11 +232,7 @@ export default function ContextMenuShowcase() {
242
232
  </DocsP>
243
233
  </ShowcaseDocs>
244
234
  }
245
- tabs={[
246
- {
247
- label: "Micro (Primitive)",
248
- content: <ContextMenuMicroShowcase /> },
249
- ]}
235
+ micro={{ content: <ContextMenuMicroShowcase /> }}
250
236
  />
251
237
  );
252
238
  }