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
|
@@ -29,7 +29,7 @@ import { Progress } from "../../components/micro/progress";
|
|
|
29
29
|
import { Skeleton } from "../../components/micro/skeleton";
|
|
30
30
|
import { Toaster } from "../../components/micro/sonner";
|
|
31
31
|
import { Spinner } from "../../components/micro/spinner";
|
|
32
|
-
import { SectionHeader,
|
|
32
|
+
import { SectionHeader, ShowcaseExample } from "../../dev/components/showcase";
|
|
33
33
|
|
|
34
34
|
export default function FeedbackSection() {
|
|
35
35
|
const [progress1, setProgress1] = useState(25);
|
|
@@ -43,334 +43,324 @@ export default function FeedbackSection() {
|
|
|
43
43
|
description="Alert, Progress, Skeleton, Spinner, Sonner, Empty"
|
|
44
44
|
/>
|
|
45
45
|
|
|
46
|
-
{/* Toaster provider for this section */}
|
|
47
46
|
<Toaster position="bottom-right" />
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</ShowcaseBlock>
|
|
48
|
+
<ShowcaseExample title="Alert" preview={<>
|
|
49
|
+
<div className="space-y-3">
|
|
50
|
+
<Alert color="info">
|
|
51
|
+
<InfoIcon />
|
|
52
|
+
<AlertTitle>Info</AlertTitle>
|
|
53
|
+
<AlertDescription>
|
|
54
|
+
Phiên đăng nhập của bạn sẽ hết hạn sau 10 phút.
|
|
55
|
+
</AlertDescription>
|
|
56
|
+
</Alert>
|
|
57
|
+
<Alert color="success">
|
|
58
|
+
<CheckCircle2Icon />
|
|
59
|
+
<AlertTitle>Success</AlertTitle>
|
|
60
|
+
<AlertDescription>
|
|
61
|
+
Các thay đổi đã được lưu thành công.
|
|
62
|
+
</AlertDescription>
|
|
63
|
+
</Alert>
|
|
64
|
+
<Alert color="warning">
|
|
65
|
+
<TriangleAlertIcon />
|
|
66
|
+
<AlertTitle>Warning</AlertTitle>
|
|
67
|
+
<AlertDescription>
|
|
68
|
+
Hành động này không thể hoàn tác đâu nhé.
|
|
69
|
+
</AlertDescription>
|
|
70
|
+
</Alert>
|
|
71
|
+
<Alert color="destructive">
|
|
72
|
+
<XCircleIcon />
|
|
73
|
+
<AlertTitle>Error</AlertTitle>
|
|
74
|
+
<AlertDescription>
|
|
75
|
+
Lỗi kết nối đến máy chủ.
|
|
76
|
+
</AlertDescription>
|
|
77
|
+
</Alert>
|
|
78
|
+
</div>
|
|
79
|
+
</>} />
|
|
82
80
|
|
|
83
81
|
<div className="grid gap-5 sm:grid-cols-2">
|
|
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
|
-
</ShowcaseBlock>
|
|
82
|
+
<ShowcaseExample title="Progress" preview={<>
|
|
83
|
+
<div className="space-y-4">
|
|
84
|
+
<Progress value={progress1} size="sm" />
|
|
85
|
+
<Progress value={progress2} size="md" />
|
|
86
|
+
<Progress value={progress3} size="lg" />
|
|
87
|
+
<div className="flex gap-2 pt-1">
|
|
88
|
+
<Button
|
|
89
|
+
size="sm"
|
|
90
|
+
variant="outline"
|
|
91
|
+
onClick={() => {
|
|
92
|
+
setProgress1(Math.max(0, progress1 - 10));
|
|
93
|
+
setProgress2(Math.max(0, progress2 - 10));
|
|
94
|
+
setProgress3(Math.max(0, progress3 - 10));
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
− 10%
|
|
98
|
+
</Button>
|
|
99
|
+
<Button
|
|
100
|
+
size="sm"
|
|
101
|
+
variant="outline"
|
|
102
|
+
onClick={() => {
|
|
103
|
+
setProgress1(Math.min(100, progress1 + 10));
|
|
104
|
+
setProgress2(Math.min(100, progress2 + 10));
|
|
105
|
+
setProgress3(Math.min(100, progress3 + 10));
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
+ 10%
|
|
109
|
+
</Button>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</>} />
|
|
116
113
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
</ShowcaseBlock>
|
|
114
|
+
<ShowcaseExample title="Skeleton" preview={<>
|
|
115
|
+
<div className="space-y-3">
|
|
116
|
+
<div className="flex items-center gap-3">
|
|
117
|
+
<Skeleton className="size-10 rounded-full" />
|
|
118
|
+
<div className="space-y-2 flex-1">
|
|
119
|
+
<Skeleton className="h-3.5 w-1/3" />
|
|
120
|
+
<Skeleton className="h-3 w-1/2" />
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
<Skeleton className="h-28 w-full rounded-lg" />
|
|
124
|
+
<div className="space-y-2">
|
|
125
|
+
<Skeleton className="h-3 w-full" />
|
|
126
|
+
<Skeleton className="h-3 w-5/6" />
|
|
127
|
+
<Skeleton className="h-3 w-4/6" />
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</>} />
|
|
135
131
|
</div>
|
|
136
132
|
|
|
137
133
|
<div className="grid gap-5 sm:grid-cols-2">
|
|
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
|
-
</ShowcaseBlock>
|
|
134
|
+
<ShowcaseExample title="Spinner" preview={<>
|
|
135
|
+
<div className="space-y-4">
|
|
136
|
+
<div className="flex items-center gap-6">
|
|
137
|
+
<div className="flex flex-col items-center gap-2">
|
|
138
|
+
<Spinner size="sm" />
|
|
139
|
+
<span className="text-xs text-muted-foreground">sm</span>
|
|
140
|
+
</div>
|
|
141
|
+
<div className="flex flex-col items-center gap-2">
|
|
142
|
+
<Spinner size="md" />
|
|
143
|
+
<span className="text-xs text-muted-foreground">md</span>
|
|
144
|
+
</div>
|
|
145
|
+
<div className="flex flex-col items-center gap-2">
|
|
146
|
+
<Spinner size="lg" />
|
|
147
|
+
<span className="text-xs text-muted-foreground">lg</span>
|
|
148
|
+
</div>
|
|
149
|
+
<div className="flex flex-col items-center gap-2">
|
|
150
|
+
<Spinner className="size-8 text-primary" />
|
|
151
|
+
<span className="text-xs text-muted-foreground">custom</span>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
<div className="flex items-center gap-3">
|
|
155
|
+
<Button size="sm" disabled variant="outline">
|
|
156
|
+
<Spinner size="sm" />
|
|
157
|
+
Loading…
|
|
158
|
+
</Button>
|
|
159
|
+
<Button size="md" variant="outline" disabled>
|
|
160
|
+
<Spinner size="md" />
|
|
161
|
+
Please wait
|
|
162
|
+
</Button>
|
|
163
|
+
<Button size="lg" variant="outline" disabled>
|
|
164
|
+
<Spinner size="lg" />
|
|
165
|
+
Processing
|
|
166
|
+
</Button>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</>} />
|
|
175
170
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
</div>
|
|
228
|
-
</div>
|
|
171
|
+
<ShowcaseExample title="Sonner (Toast)" preview={<>
|
|
172
|
+
<div className="space-y-6">
|
|
173
|
+
<div className="space-y-3">
|
|
174
|
+
<div>
|
|
175
|
+
<h4 className="text-sm font-medium">States</h4>
|
|
176
|
+
<p className="text-xs text-muted-foreground">
|
|
177
|
+
Các loại toast cơ bản.
|
|
178
|
+
</p>
|
|
179
|
+
</div>
|
|
180
|
+
<div className="flex flex-wrap gap-2">
|
|
181
|
+
<Button
|
|
182
|
+
size="sm"
|
|
183
|
+
variant="outline"
|
|
184
|
+
onClick={() => toast("Sự kiện đã được tạo")}
|
|
185
|
+
>
|
|
186
|
+
Default
|
|
187
|
+
</Button>
|
|
188
|
+
<Button
|
|
189
|
+
size="sm"
|
|
190
|
+
variant="outline"
|
|
191
|
+
color="success"
|
|
192
|
+
onClick={() => toast.success("Lưu thay đổi thành công")}
|
|
193
|
+
>
|
|
194
|
+
Success
|
|
195
|
+
</Button>
|
|
196
|
+
<Button
|
|
197
|
+
size="sm"
|
|
198
|
+
variant="outline"
|
|
199
|
+
color="info"
|
|
200
|
+
onClick={() => toast.info("Hết hạn phiên sau 10 phút")}
|
|
201
|
+
>
|
|
202
|
+
Info
|
|
203
|
+
</Button>
|
|
204
|
+
<Button
|
|
205
|
+
size="sm"
|
|
206
|
+
variant="outline"
|
|
207
|
+
color="warning"
|
|
208
|
+
onClick={() => toast.warning("Sắp hết dung lượng lưu trữ")}
|
|
209
|
+
>
|
|
210
|
+
Warning
|
|
211
|
+
</Button>
|
|
212
|
+
<Button
|
|
213
|
+
size="sm"
|
|
214
|
+
variant="outline"
|
|
215
|
+
color="destructive"
|
|
216
|
+
onClick={() => toast.error("Lưu thay đổi thất bại")}
|
|
217
|
+
>
|
|
218
|
+
Error
|
|
219
|
+
</Button>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
229
222
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
</div>
|
|
223
|
+
<div className="space-y-3">
|
|
224
|
+
<div>
|
|
225
|
+
<h4 className="text-sm font-medium">Interactivity</h4>
|
|
226
|
+
<p className="text-xs text-muted-foreground">
|
|
227
|
+
Toasts with actions, cancel options, or explicit close
|
|
228
|
+
buttons.
|
|
229
|
+
</p>
|
|
230
|
+
</div>
|
|
231
|
+
<div className="flex flex-wrap gap-2">
|
|
232
|
+
<Button
|
|
233
|
+
size="sm"
|
|
234
|
+
variant="outline"
|
|
235
|
+
onClick={() =>
|
|
236
|
+
toast("Bạn có thể tự đóng toast này", {
|
|
237
|
+
closeButton: true,
|
|
238
|
+
})
|
|
239
|
+
}
|
|
240
|
+
>
|
|
241
|
+
With Close Button
|
|
242
|
+
</Button>
|
|
243
|
+
<Button
|
|
244
|
+
size="sm"
|
|
245
|
+
variant="outline"
|
|
246
|
+
onClick={() =>
|
|
247
|
+
toast("Đã tải file lên", {
|
|
248
|
+
description:
|
|
249
|
+
"image.png has been uploaded to your gallery.",
|
|
250
|
+
action: { label: "View", onClick: () => {} },
|
|
251
|
+
})
|
|
252
|
+
}
|
|
253
|
+
>
|
|
254
|
+
With Action
|
|
255
|
+
</Button>
|
|
256
|
+
<Button
|
|
257
|
+
size="sm"
|
|
258
|
+
variant="outline"
|
|
259
|
+
onClick={() =>
|
|
260
|
+
toast("Xác nhận xoá", {
|
|
261
|
+
description: "Are you sure you want to delete this file?",
|
|
262
|
+
action: {
|
|
263
|
+
label: "Delete",
|
|
264
|
+
onClick: () => toast.error("Đã xoá file"),
|
|
265
|
+
},
|
|
266
|
+
cancel: {
|
|
267
|
+
label: "Cancel",
|
|
268
|
+
onClick: () => toast.info("Đã huỷ hành động"),
|
|
269
|
+
},
|
|
270
|
+
})
|
|
271
|
+
}
|
|
272
|
+
>
|
|
273
|
+
With Cancel
|
|
274
|
+
</Button>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
285
277
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
</ShowcaseBlock>
|
|
278
|
+
<div className="space-y-3">
|
|
279
|
+
<div>
|
|
280
|
+
<h4 className="text-sm font-medium">Advanced</h4>
|
|
281
|
+
<p className="text-xs text-muted-foreground">
|
|
282
|
+
Promises and custom positions.
|
|
283
|
+
</p>
|
|
284
|
+
</div>
|
|
285
|
+
<div className="flex flex-wrap gap-2">
|
|
286
|
+
<Button
|
|
287
|
+
size="sm"
|
|
288
|
+
variant="outline"
|
|
289
|
+
onClick={() => {
|
|
290
|
+
const promise = new Promise((resolve) =>
|
|
291
|
+
setTimeout(resolve, 2000),
|
|
292
|
+
);
|
|
293
|
+
toast.promise(promise, {
|
|
294
|
+
loading: "Loading data...",
|
|
295
|
+
success: "Data loaded successfully",
|
|
296
|
+
error: "Failed to load data",
|
|
297
|
+
});
|
|
298
|
+
}}
|
|
299
|
+
>
|
|
300
|
+
Promise
|
|
301
|
+
</Button>
|
|
302
|
+
<Button
|
|
303
|
+
size="sm"
|
|
304
|
+
variant="outline"
|
|
305
|
+
onClick={() =>
|
|
306
|
+
toast("Toast ở giữa phía trên", { position: "top-center" })
|
|
307
|
+
}
|
|
308
|
+
>
|
|
309
|
+
Top Center Position
|
|
310
|
+
</Button>
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
</>} />
|
|
324
315
|
</div>
|
|
325
316
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
</Empty>
|
|
317
|
+
<ShowcaseExample title="Empty" preview={<>
|
|
318
|
+
<div className="grid gap-5 sm:grid-cols-3">
|
|
319
|
+
<Empty className="border border-border">
|
|
320
|
+
<EmptyHeader>
|
|
321
|
+
<EmptyMedia variant="icon">
|
|
322
|
+
<InboxIcon />
|
|
323
|
+
</EmptyMedia>
|
|
324
|
+
<EmptyTitle>No messages</EmptyTitle>
|
|
325
|
+
<EmptyDescription>
|
|
326
|
+
Your inbox is empty. New messages will appear here.
|
|
327
|
+
</EmptyDescription>
|
|
328
|
+
</EmptyHeader>
|
|
329
|
+
</Empty>
|
|
340
330
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
331
|
+
<Empty className="border border-border">
|
|
332
|
+
<EmptyHeader>
|
|
333
|
+
<EmptyMedia variant="icon">
|
|
334
|
+
<SearchIcon />
|
|
335
|
+
</EmptyMedia>
|
|
336
|
+
<EmptyTitle>No results found</EmptyTitle>
|
|
337
|
+
<EmptyDescription>
|
|
338
|
+
Try adjusting your search or filter criteria.
|
|
339
|
+
</EmptyDescription>
|
|
340
|
+
</EmptyHeader>
|
|
341
|
+
<EmptyContent>
|
|
342
|
+
<Button size="sm" variant="outline">
|
|
343
|
+
Clear filters
|
|
344
|
+
</Button>
|
|
345
|
+
</EmptyContent>
|
|
346
|
+
</Empty>
|
|
357
347
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
348
|
+
<Empty className="border border-border">
|
|
349
|
+
<EmptyHeader>
|
|
350
|
+
<EmptyMedia variant="icon">
|
|
351
|
+
<FileX2Icon />
|
|
352
|
+
</EmptyMedia>
|
|
353
|
+
<EmptyTitle>No documents</EmptyTitle>
|
|
354
|
+
<EmptyDescription>
|
|
355
|
+
Get started by creating your first document.
|
|
356
|
+
</EmptyDescription>
|
|
357
|
+
</EmptyHeader>
|
|
358
|
+
<EmptyContent>
|
|
359
|
+
<Button size="sm">Create document</Button>
|
|
360
|
+
</EmptyContent>
|
|
361
|
+
</Empty>
|
|
362
|
+
</div>
|
|
363
|
+
</>} />
|
|
374
364
|
</div>
|
|
375
365
|
);
|
|
376
366
|
}
|