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.
- package/README.md +1 -1
- package/package.json +2 -1
- package/scripts/strip-comments.ts +79 -0
- package/src/blocks/auth-form.tsx +34 -30
- package/src/blocks/auth-recovery.tsx +9 -13
- package/src/blocks/auth-split.tsx +46 -36
- package/src/blocks/settings.tsx +84 -117
- package/src/components/macro/alert-preset.tsx +3 -1
- package/src/components/macro/carousel-preset.tsx +0 -1
- package/src/components/macro/checkbox-preset.test.tsx +2 -2
- package/src/components/macro/checkbox-preset.tsx +1 -2
- package/src/components/macro/command-preset.tsx +1 -1
- package/src/components/macro/date-picker.tsx +5 -18
- package/src/components/macro/dialog-preset.tsx +5 -3
- package/src/components/macro/input-preset.tsx +0 -1
- package/src/components/macro/select-preset.tsx +1 -1
- package/src/components/macro/switch-preset.test.tsx +1 -1
- package/src/components/micro/accordion.test.tsx +6 -12
- package/src/components/micro/alert-dialog.tsx +0 -2
- package/src/components/micro/alert.test.tsx +5 -8
- package/src/components/micro/alert.tsx +0 -2
- package/src/components/micro/badge.test.tsx +5 -7
- package/src/components/micro/badge.tsx +1 -3
- package/src/components/micro/button.test.tsx +19 -26
- package/src/components/micro/button.tsx +3 -11
- package/src/components/micro/calendar.tsx +12 -13
- package/src/components/micro/card.test.tsx +3 -5
- package/src/components/micro/carousel.tsx +0 -1
- package/src/components/micro/chart.tsx +3 -2
- package/src/components/micro/checkbox.test.tsx +9 -18
- package/src/components/micro/combobox.tsx +1 -3
- package/src/components/micro/command.tsx +23 -11
- package/src/components/micro/context-menu.tsx +0 -2
- package/src/components/micro/dialog.test.tsx +6 -14
- package/src/components/micro/dialog.tsx +0 -2
- package/src/components/micro/drawer.tsx +0 -3
- package/src/components/micro/dropdown-menu.test.tsx +8 -14
- package/src/components/micro/dropdown-menu.tsx +0 -2
- package/src/components/micro/field.tsx +3 -3
- package/src/components/micro/hover-card.tsx +0 -2
- package/src/components/micro/input-group.tsx +9 -42
- package/src/components/micro/input.test.tsx +15 -24
- package/src/components/micro/navigation-menu.tsx +0 -2
- package/src/components/micro/popover.test.tsx +5 -9
- package/src/components/micro/progress.tsx +5 -1
- package/src/components/micro/select.test.tsx +5 -18
- package/src/components/micro/select.tsx +3 -5
- package/src/components/micro/separator.tsx +1 -1
- package/src/components/micro/sheet.test.tsx +6 -14
- package/src/components/micro/sheet.tsx +0 -2
- package/src/components/micro/sidebar.tsx +5 -6
- package/src/components/micro/sonner.tsx +0 -1
- package/src/components/micro/switch.test.tsx +9 -18
- package/src/components/micro/switch.tsx +1 -1
- package/src/components/micro/tabs.test.tsx +5 -11
- package/src/components/micro/theme-provider.tsx +0 -12
- package/src/components/micro/toggle-group.tsx +1 -12
- package/src/components/micro/tooltip.test.tsx +7 -12
- package/src/dev/App.tsx +6 -6
- package/src/dev/components/BlockViewer.tsx +15 -4
- package/src/dev/components/Container.tsx +20 -0
- package/src/dev/components/GladvnLogo.tsx +3 -9
- package/src/dev/components/code-highlighter.tsx +5 -3
- package/src/dev/components/showcase.tsx +116 -168
- package/src/dev/sections/buttons.tsx +4 -9
- package/src/dev/sections/display.tsx +68 -72
- package/src/dev/sections/feedback.tsx +304 -314
- package/src/dev/sections/forms.tsx +10 -14
- package/src/dev/sections/interactive.tsx +32 -32
- package/src/dev/sections/overview.tsx +2 -10
- package/src/dev/showcase/accordion.tsx +512 -554
- package/src/dev/showcase/alert-dialog.tsx +525 -565
- package/src/dev/showcase/alert.tsx +352 -402
- package/src/dev/showcase/aspect-ratio.tsx +167 -193
- package/src/dev/showcase/avatar.tsx +231 -269
- package/src/dev/showcase/badge.tsx +92 -140
- package/src/dev/showcase/breadcrumb.tsx +113 -135
- package/src/dev/showcase/button.tsx +140 -173
- package/src/dev/showcase/calendar.tsx +187 -237
- package/src/dev/showcase/card.tsx +229 -261
- package/src/dev/showcase/carousel.tsx +288 -315
- package/src/dev/showcase/chart.tsx +44 -50
- package/src/dev/showcase/checkbox.tsx +286 -330
- package/src/dev/showcase/collapsible.tsx +143 -160
- package/src/dev/showcase/combobox.tsx +327 -369
- package/src/dev/showcase/command.tsx +106 -120
- package/src/dev/showcase/context-menu.tsx +93 -107
- package/src/dev/showcase/dialog.tsx +585 -630
- package/src/dev/showcase/drawer.tsx +176 -196
- package/src/dev/showcase/dropdown-menu.tsx +183 -201
- package/src/dev/showcase/empty.tsx +232 -274
- package/src/dev/showcase/hover-card.tsx +153 -180
- package/src/dev/showcase/input-group.tsx +221 -253
- package/src/dev/showcase/input-otp.tsx +204 -250
- package/src/dev/showcase/input.tsx +246 -325
- package/src/dev/showcase/item.tsx +134 -152
- package/src/dev/showcase/kbd.tsx +149 -172
- package/src/dev/showcase/label.tsx +50 -68
- package/src/dev/showcase/menubar.tsx +194 -213
- package/src/dev/showcase/navigation-menu.tsx +119 -133
- package/src/dev/showcase/overview-components/ArchitectureSection.tsx +126 -0
- package/src/dev/showcase/overview-components/CodeBlock.tsx +50 -0
- package/src/dev/showcase/overview-components/ColorPaletteSection.tsx +44 -0
- package/src/dev/showcase/overview-components/DashboardPreview.tsx +159 -0
- package/src/dev/showcase/overview-components/FeatureGridSection.tsx +535 -0
- package/src/dev/showcase/overview-components/FooterCTA.tsx +137 -0
- package/src/dev/showcase/overview-components/HeroSection.tsx +65 -0
- package/src/dev/showcase/overview-components/PrinciplesSection.tsx +128 -0
- package/src/dev/showcase/overview.tsx +21 -1163
- package/src/dev/showcase/pagination.tsx +144 -190
- package/src/dev/showcase/popover.tsx +181 -196
- package/src/dev/showcase/progress.tsx +141 -189
- package/src/dev/showcase/radio-group.tsx +272 -332
- package/src/dev/showcase/resizable.tsx +119 -141
- package/src/dev/showcase/scroll-area.tsx +21 -36
- package/src/dev/showcase/select.tsx +262 -322
- package/src/dev/showcase/separator.tsx +75 -73
- package/src/dev/showcase/sheet.tsx +333 -361
- package/src/dev/showcase/sidebar.tsx +53 -59
- package/src/dev/showcase/skeleton.tsx +93 -112
- package/src/dev/showcase/slider.tsx +244 -296
- package/src/dev/showcase/sonner.tsx +251 -258
- package/src/dev/showcase/spinner.tsx +46 -67
- package/src/dev/showcase/switch.tsx +298 -362
- package/src/dev/showcase/table.tsx +76 -80
- package/src/dev/showcase/tabs.tsx +302 -355
- package/src/dev/showcase/textarea.tsx +240 -293
- package/src/dev/showcase/toast.tsx +48 -54
- package/src/dev/showcase/toggle-group.tsx +104 -129
- package/src/dev/showcase/toggle.tsx +82 -102
- package/src/dev/showcase/tooltip.tsx +173 -192
- package/src/dev/showcase/why.tsx +6 -12
- package/src/hooks/use-mobile.test.ts +3 -2
- package/src/lib/utils.test.ts +5 -4
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
DocsP,
|
|
26
26
|
ExampleGrid,
|
|
27
|
-
|
|
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
|
|
36
|
+
<div className="space-y-10">
|
|
37
37
|
<ExampleGrid>
|
|
38
|
-
<
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
<
|
|
122
|
-
|
|
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>
|
|
126
|
+
<span>Xem hồ sơ</span>
|
|
132
127
|
</CommandItem>
|
|
133
128
|
<CommandItem>
|
|
134
129
|
<SettingsIcon className="mr-2 h-4 w-4" />
|
|
135
|
-
<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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
<
|
|
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>
|
|
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>
|
|
187
|
+
<span>Tìm kiếm Emoji</span>
|
|
195
188
|
</CommandItem>
|
|
196
189
|
</CommandGroup>
|
|
197
190
|
</CommandList>
|
|
198
|
-
</CommandDialog>`}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
37
|
-
<
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
<
|
|
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
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
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
|
-
|
|
246
|
-
{
|
|
247
|
-
label: "Micro (Primitive)",
|
|
248
|
-
content: <ContextMenuMicroShowcase /> },
|
|
249
|
-
]}
|
|
235
|
+
micro={{ content: <ContextMenuMicroShowcase /> }}
|
|
250
236
|
/>
|
|
251
237
|
);
|
|
252
238
|
}
|