gladvn 0.2.17 → 0.2.18
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/bin/cli.js +9 -6
- package/dist/components/macro/accordion-preset.d.ts.map +1 -1
- package/dist/components/macro/alert-dialog-preset.d.ts.map +1 -1
- package/dist/components/macro/alert-preset.d.ts.map +1 -1
- package/dist/components/macro/avatar-preset.d.ts.map +1 -1
- package/dist/components/macro/breadcrumb-preset.d.ts.map +1 -1
- package/dist/components/macro/card-preset.d.ts.map +1 -1
- package/dist/components/macro/carousel-preset.d.ts.map +1 -1
- package/dist/components/macro/checkbox-preset.d.ts.map +1 -1
- package/dist/components/macro/combobox-preset.d.ts.map +1 -1
- package/dist/components/macro/command-preset.d.ts +1 -1
- package/dist/components/macro/command-preset.d.ts.map +1 -1
- package/dist/components/macro/date-picker.d.ts.map +1 -1
- package/dist/components/macro/dialog-preset.d.ts.map +1 -1
- package/dist/components/macro/empty-preset.d.ts.map +1 -1
- package/dist/components/macro/field-preset.d.ts.map +1 -1
- package/dist/components/macro/input-otp-preset.d.ts +6 -0
- package/dist/components/macro/input-otp-preset.d.ts.map +1 -1
- package/dist/components/macro/input-preset.d.ts +1 -1
- package/dist/components/macro/input-preset.d.ts.map +1 -1
- package/dist/components/macro/pagination-preset.d.ts.map +1 -1
- package/dist/components/macro/progress-preset.d.ts.map +1 -1
- package/dist/components/macro/radio-group-preset.d.ts.map +1 -1
- package/dist/components/macro/select-preset.d.ts.map +1 -1
- package/dist/components/macro/slider-preset.d.ts.map +1 -1
- package/dist/components/macro/switch-preset.d.ts.map +1 -1
- package/dist/components/macro/tabs-preset.d.ts +1 -1
- package/dist/components/macro/tabs-preset.d.ts.map +1 -1
- package/dist/components/macro/textarea-preset.d.ts +1 -1
- package/dist/components/macro/textarea-preset.d.ts.map +1 -1
- package/dist/components/micro/accordion.d.ts +7 -0
- package/dist/components/micro/accordion.d.ts.map +1 -1
- package/dist/components/micro/alert-dialog.d.ts.map +1 -1
- package/dist/components/micro/alert.d.ts +7 -0
- package/dist/components/micro/alert.d.ts.map +1 -1
- package/dist/components/micro/aspect-ratio.d.ts +7 -0
- package/dist/components/micro/aspect-ratio.d.ts.map +1 -1
- package/dist/components/micro/avatar.d.ts.map +1 -1
- package/dist/components/micro/badge.d.ts +8 -1
- package/dist/components/micro/badge.d.ts.map +1 -1
- package/dist/components/micro/breadcrumb.d.ts +7 -0
- package/dist/components/micro/breadcrumb.d.ts.map +1 -1
- package/dist/components/micro/button.d.ts +8 -1
- package/dist/components/micro/button.d.ts.map +1 -1
- package/dist/components/micro/calendar.d.ts +2 -2
- package/dist/components/micro/calendar.d.ts.map +1 -1
- package/dist/components/micro/carousel.d.ts.map +1 -1
- package/dist/components/micro/chart.d.ts.map +1 -1
- package/dist/components/micro/checkbox.d.ts.map +1 -1
- package/dist/components/micro/collapsible.d.ts.map +1 -1
- package/dist/components/micro/combobox.d.ts.map +1 -1
- package/dist/components/micro/command.d.ts.map +1 -1
- package/dist/components/micro/context-menu.d.ts.map +1 -1
- package/dist/components/micro/dialog.d.ts.map +1 -1
- package/dist/components/micro/drawer.d.ts.map +1 -1
- package/dist/components/micro/dropdown-menu.d.ts.map +1 -1
- package/dist/components/micro/empty.d.ts +7 -0
- package/dist/components/micro/empty.d.ts.map +1 -1
- package/dist/components/micro/field.d.ts.map +1 -1
- package/dist/components/micro/hover-card.d.ts +1 -1
- package/dist/components/micro/hover-card.d.ts.map +1 -1
- package/dist/components/micro/input-group.d.ts.map +1 -1
- package/dist/components/micro/input-otp.d.ts.map +1 -1
- package/dist/components/micro/input.d.ts +7 -0
- package/dist/components/micro/input.d.ts.map +1 -1
- package/dist/components/micro/item.d.ts.map +1 -1
- package/dist/components/micro/label.d.ts.map +1 -1
- package/dist/components/micro/menubar.d.ts.map +1 -1
- package/dist/components/micro/navigation-menu.d.ts +8 -1
- package/dist/components/micro/navigation-menu.d.ts.map +1 -1
- package/dist/components/micro/pagination.d.ts.map +1 -1
- package/dist/components/micro/popover.d.ts.map +1 -1
- package/dist/components/micro/progress.d.ts.map +1 -1
- package/dist/components/micro/radio-group.d.ts.map +1 -1
- package/dist/components/micro/select.d.ts +1 -1
- package/dist/components/micro/select.d.ts.map +1 -1
- package/dist/components/micro/sheet.d.ts.map +1 -1
- package/dist/components/micro/sidebar.d.ts.map +1 -1
- package/dist/components/micro/skeleton.d.ts +7 -0
- package/dist/components/micro/skeleton.d.ts.map +1 -1
- package/dist/components/micro/slider.d.ts +7 -0
- package/dist/components/micro/slider.d.ts.map +1 -1
- package/dist/components/micro/sonner.d.ts.map +1 -1
- package/dist/components/micro/spinner.d.ts.map +1 -1
- package/dist/components/micro/switch.d.ts.map +1 -1
- package/dist/components/micro/table.d.ts.map +1 -1
- package/dist/components/micro/tabs.d.ts +1 -1
- package/dist/components/micro/tabs.d.ts.map +1 -1
- package/dist/components/micro/textarea.d.ts +7 -0
- package/dist/components/micro/textarea.d.ts.map +1 -1
- package/dist/components/micro/toggle-group.d.ts.map +1 -1
- package/dist/components/micro/toggle.d.ts.map +1 -1
- package/dist/components/micro/tooltip.d.ts +1 -1
- package/dist/components/micro/tooltip.d.ts.map +1 -1
- package/dist/dev/App.d.ts.map +1 -1
- package/dist/dev/components/code-highlighter.d.ts.map +1 -1
- package/dist/dev/components/dev-context.d.ts.map +1 -1
- package/dist/dev/components/showcase.d.ts +1 -1
- package/dist/dev/components/showcase.d.ts.map +1 -1
- package/dist/dev/data.d.ts.map +1 -1
- package/dist/dev/main.d.ts.map +1 -1
- package/dist/dev/sections/buttons.d.ts.map +1 -1
- package/dist/dev/sections/feedback.d.ts.map +1 -1
- package/dist/dev/sections/overview.d.ts.map +1 -1
- package/dist/dev/showcase/accordion.d.ts.map +1 -1
- package/dist/dev/showcase/alert-dialog.d.ts.map +1 -1
- package/dist/dev/showcase/alert.d.ts.map +1 -1
- package/dist/dev/showcase/aspect-ratio.d.ts.map +1 -1
- package/dist/dev/showcase/avatar.d.ts.map +1 -1
- package/dist/dev/showcase/breadcrumb.d.ts.map +1 -1
- package/dist/dev/showcase/button.d.ts.map +1 -1
- package/dist/dev/showcase/calendar.d.ts.map +1 -1
- package/dist/dev/showcase/card.d.ts.map +1 -1
- package/dist/dev/showcase/carousel.d.ts.map +1 -1
- package/dist/dev/showcase/chart.d.ts.map +1 -1
- package/dist/dev/showcase/checkbox.d.ts.map +1 -1
- package/dist/dev/showcase/collapsible.d.ts.map +1 -1
- package/dist/dev/showcase/combobox.d.ts.map +1 -1
- package/dist/dev/showcase/command.d.ts.map +1 -1
- package/dist/dev/showcase/context-menu.d.ts.map +1 -1
- package/dist/dev/showcase/dialog.d.ts.map +1 -1
- package/dist/dev/showcase/drawer.d.ts.map +1 -1
- package/dist/dev/showcase/dropdown-menu.d.ts.map +1 -1
- package/dist/dev/showcase/empty.d.ts.map +1 -1
- package/dist/dev/showcase/hover-card.d.ts.map +1 -1
- package/dist/dev/showcase/input-group.d.ts.map +1 -1
- package/dist/dev/showcase/input-otp.d.ts.map +1 -1
- package/dist/dev/showcase/input.d.ts.map +1 -1
- package/dist/dev/showcase/item.d.ts.map +1 -1
- package/dist/dev/showcase/kbd.d.ts.map +1 -1
- package/dist/dev/showcase/label.d.ts.map +1 -1
- package/dist/dev/showcase/menubar.d.ts.map +1 -1
- package/dist/dev/showcase/navigation-menu.d.ts.map +1 -1
- package/dist/dev/showcase/overview.d.ts.map +1 -1
- package/dist/dev/showcase/pagination.d.ts.map +1 -1
- package/dist/dev/showcase/popover.d.ts.map +1 -1
- package/dist/dev/showcase/progress.d.ts.map +1 -1
- package/dist/dev/showcase/radio-group.d.ts.map +1 -1
- package/dist/dev/showcase/resizable.d.ts.map +1 -1
- package/dist/dev/showcase/scroll-area.d.ts.map +1 -1
- package/dist/dev/showcase/select.d.ts.map +1 -1
- package/dist/dev/showcase/separator.d.ts.map +1 -1
- package/dist/dev/showcase/sheet.d.ts.map +1 -1
- package/dist/dev/showcase/sidebar.d.ts.map +1 -1
- package/dist/dev/showcase/skeleton.d.ts.map +1 -1
- package/dist/dev/showcase/slider.d.ts.map +1 -1
- package/dist/dev/showcase/sonner.d.ts.map +1 -1
- package/dist/dev/showcase/spinner.d.ts.map +1 -1
- package/dist/dev/showcase/switch.d.ts.map +1 -1
- package/dist/dev/showcase/table.d.ts.map +1 -1
- package/dist/dev/showcase/tabs.d.ts.map +1 -1
- package/dist/dev/showcase/textarea.d.ts.map +1 -1
- package/dist/dev/showcase/theme-provider.d.ts.map +1 -1
- package/dist/dev/showcase/toast.d.ts.map +1 -1
- package/dist/dev/showcase/toggle-group.d.ts.map +1 -1
- package/dist/dev/showcase/toggle.d.ts.map +1 -1
- package/dist/dev/showcase/tooltip.d.ts.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/package.json +3 -1
- package/scripts/format-codestrings.ts +87 -0
- package/scripts/organize-imports.ts +21 -0
- package/scripts/regex-format.cjs +67 -0
- package/scripts/tmp.tsx +25 -0
- package/src/components/macro/accordion-preset.test.tsx +1 -0
- package/src/components/macro/accordion-preset.tsx +2 -1
- package/src/components/macro/alert-dialog-preset.tsx +44 -43
- package/src/components/macro/alert-preset.tsx +7 -3
- package/src/components/macro/avatar-preset.tsx +2 -1
- package/src/components/macro/breadcrumb-preset.tsx +2 -1
- package/src/components/macro/card-preset.tsx +2 -1
- package/src/components/macro/carousel-preset.tsx +5 -2
- package/src/components/macro/checkbox-preset.test.tsx +1 -0
- package/src/components/macro/checkbox-preset.tsx +6 -2
- package/src/components/macro/combobox-preset.tsx +6 -3
- package/src/components/macro/command-preset.tsx +7 -3
- package/src/components/macro/date-picker.tsx +77 -59
- package/src/components/macro/dialog-preset.tsx +42 -38
- package/src/components/macro/empty-preset.tsx +2 -1
- package/src/components/macro/field-preset.test.tsx +1 -0
- package/src/components/macro/field-preset.tsx +2 -1
- package/src/components/macro/input-otp-preset.tsx +6 -2
- package/src/components/macro/input-preset.test.tsx +1 -0
- package/src/components/macro/input-preset.tsx +4 -2
- package/src/components/macro/pagination-preset.tsx +3 -1
- package/src/components/macro/progress-preset.test.tsx +1 -0
- package/src/components/macro/progress-preset.tsx +2 -1
- package/src/components/macro/radio-group-preset.tsx +4 -1
- package/src/components/macro/select-preset.tsx +35 -30
- package/src/components/macro/slider-preset.test.tsx +1 -0
- package/src/components/macro/slider-preset.tsx +4 -1
- package/src/components/macro/switch-preset.test.tsx +1 -0
- package/src/components/macro/switch-preset.tsx +4 -1
- package/src/components/macro/tabs-preset.test.tsx +1 -0
- package/src/components/macro/tabs-preset.tsx +4 -2
- package/src/components/macro/textarea-preset.test.tsx +1 -0
- package/src/components/macro/textarea-preset.tsx +4 -1
- package/src/components/micro/accordion.tsx +3 -2
- package/src/components/micro/alert-dialog.tsx +2 -1
- package/src/components/micro/alert.tsx +3 -2
- package/src/components/micro/aspect-ratio.tsx +2 -1
- package/src/components/micro/avatar.tsx +2 -1
- package/src/components/micro/badge.tsx +3 -3
- package/src/components/micro/breadcrumb.tsx +3 -2
- package/src/components/micro/button.test.tsx +1 -0
- package/src/components/micro/button.tsx +3 -3
- package/src/components/micro/calendar.tsx +10 -9
- package/src/components/micro/carousel.tsx +3 -2
- package/src/components/micro/chart.tsx +1 -0
- package/src/components/micro/checkbox.tsx +2 -2
- package/src/components/micro/collapsible.tsx +4 -2
- package/src/components/micro/combobox.tsx +41 -29
- package/src/components/micro/command.tsx +23 -16
- package/src/components/micro/context-menu.tsx +3 -2
- package/src/components/micro/dialog.tsx +2 -1
- package/src/components/micro/drawer.tsx +2 -1
- package/src/components/micro/dropdown-menu.tsx +3 -2
- package/src/components/micro/empty.tsx +2 -1
- package/src/components/micro/field.tsx +4 -3
- package/src/components/micro/hover-card.tsx +20 -19
- package/src/components/micro/input-group.tsx +2 -1
- package/src/components/micro/input-otp.tsx +3 -2
- package/src/components/micro/input.tsx +3 -2
- package/src/components/micro/item.tsx +1 -0
- package/src/components/micro/label.tsx +2 -1
- package/src/components/micro/menubar.tsx +2 -1
- package/src/components/micro/navigation-menu.tsx +18 -17
- package/src/components/micro/pagination.tsx +2 -1
- package/src/components/micro/popover.tsx +2 -1
- package/src/components/micro/progress.tsx +2 -1
- package/src/components/micro/radio-group.tsx +3 -3
- package/src/components/micro/select.tsx +5 -4
- package/src/components/micro/sheet.tsx +2 -1
- package/src/components/micro/sidebar.tsx +4 -1
- package/src/components/micro/skeleton.tsx +2 -1
- package/src/components/micro/slider.tsx +4 -1
- package/src/components/micro/sonner.tsx +2 -1
- package/src/components/micro/spinner.tsx +1 -2
- package/src/components/micro/switch.tsx +2 -2
- package/src/components/micro/table.tsx +2 -1
- package/src/components/micro/tabs.tsx +4 -3
- package/src/components/micro/textarea.tsx +2 -1
- package/src/components/micro/toggle-group.tsx +1 -0
- package/src/components/micro/toggle.tsx +1 -3
- package/src/components/micro/tooltip.tsx +9 -3
- package/src/dev/App.tsx +66 -41
- package/src/dev/components/code-highlighter.tsx +2 -1
- package/src/dev/components/dev-context.tsx +1 -0
- package/src/dev/components/showcase.tsx +13 -14
- package/src/dev/data.ts +206 -52
- package/src/dev/main.tsx +4 -4
- package/src/dev/sections/buttons.tsx +14 -12
- package/src/dev/sections/feedback.tsx +7 -2
- package/src/dev/sections/forms.tsx +11 -11
- package/src/dev/sections/overview.tsx +2 -1
- package/src/dev/showcase/accordion.tsx +399 -314
- package/src/dev/showcase/alert-dialog.tsx +387 -384
- package/src/dev/showcase/alert.tsx +271 -258
- package/src/dev/showcase/aspect-ratio.tsx +102 -105
- package/src/dev/showcase/avatar.tsx +216 -145
- package/src/dev/showcase/badge.tsx +78 -50
- package/src/dev/showcase/breadcrumb.tsx +88 -85
- package/src/dev/showcase/button.tsx +72 -96
- package/src/dev/showcase/calendar.tsx +41 -39
- package/src/dev/showcase/card.tsx +170 -148
- package/src/dev/showcase/carousel.tsx +239 -77
- package/src/dev/showcase/chart.tsx +5 -4
- package/src/dev/showcase/checkbox.tsx +206 -140
- package/src/dev/showcase/collapsible.tsx +108 -84
- package/src/dev/showcase/combobox.tsx +272 -199
- package/src/dev/showcase/command.tsx +31 -28
- package/src/dev/showcase/context-menu.tsx +94 -77
- package/src/dev/showcase/dialog.tsx +445 -424
- package/src/dev/showcase/drawer.tsx +142 -135
- package/src/dev/showcase/dropdown-menu.tsx +165 -161
- package/src/dev/showcase/empty.tsx +173 -158
- package/src/dev/showcase/hover-card.tsx +92 -52
- package/src/dev/showcase/input-group.tsx +193 -160
- package/src/dev/showcase/input-otp.tsx +109 -99
- package/src/dev/showcase/input.tsx +78 -42
- package/src/dev/showcase/item.tsx +101 -98
- package/src/dev/showcase/kbd.tsx +78 -62
- package/src/dev/showcase/label.tsx +16 -23
- package/src/dev/showcase/menubar.tsx +274 -251
- package/src/dev/showcase/navigation-menu.tsx +175 -170
- package/src/dev/showcase/overview.tsx +164 -148
- package/src/dev/showcase/pagination.tsx +101 -69
- package/src/dev/showcase/popover.tsx +113 -86
- package/src/dev/showcase/progress.tsx +99 -69
- package/src/dev/showcase/radio-group.tsx +217 -134
- package/src/dev/showcase/resizable.tsx +65 -55
- package/src/dev/showcase/scroll-area.tsx +32 -22
- package/src/dev/showcase/select.tsx +192 -136
- package/src/dev/showcase/separator.tsx +28 -24
- package/src/dev/showcase/sheet.tsx +182 -134
- package/src/dev/showcase/sidebar.tsx +9 -5
- package/src/dev/showcase/skeleton.tsx +54 -59
- package/src/dev/showcase/slider.tsx +158 -129
- package/src/dev/showcase/sonner.tsx +3 -5
- package/src/dev/showcase/spinner.tsx +22 -18
- package/src/dev/showcase/switch.tsx +207 -110
- package/src/dev/showcase/table.tsx +44 -32
- package/src/dev/showcase/tabs.tsx +272 -267
- package/src/dev/showcase/textarea.tsx +162 -116
- package/src/dev/showcase/theme-provider.tsx +596 -534
- package/src/dev/showcase/toast.tsx +37 -38
- package/src/dev/showcase/toggle-group.tsx +87 -39
- package/src/dev/showcase/toggle.tsx +36 -27
- package/src/dev/showcase/tooltip.tsx +154 -119
- package/src/lib/utils.test.ts +1 -0
- package/src/lib/utils.ts +1 -1
- package/src/styles/gladvn.css +1 -1
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
DocsP,
|
|
4
|
-
ExampleGrid,
|
|
5
|
-
ExampleSection,
|
|
6
|
-
Showcase,
|
|
7
|
-
ShowcaseDocs,
|
|
8
|
-
} from "../../dev/components/showcase";
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
|
|
9
3
|
import {
|
|
10
4
|
InfoIcon,
|
|
11
5
|
LogOutIcon,
|
|
@@ -15,7 +9,6 @@ import {
|
|
|
15
9
|
TrashIcon,
|
|
16
10
|
XIcon,
|
|
17
11
|
} from "lucide-react";
|
|
18
|
-
import { useState } from "react";
|
|
19
12
|
|
|
20
13
|
import { AlertDialogPreset } from "../../components/macro/alert-dialog-preset";
|
|
21
14
|
import {
|
|
@@ -28,11 +21,19 @@ import {
|
|
|
28
21
|
AlertDialogFooter,
|
|
29
22
|
AlertDialogHeader,
|
|
30
23
|
AlertDialogMedia,
|
|
24
|
+
AlertDialogPortal,
|
|
31
25
|
AlertDialogTitle,
|
|
32
26
|
AlertDialogTrigger,
|
|
33
|
-
AlertDialogPortal,
|
|
34
27
|
} from "../../components/micro/alert-dialog";
|
|
35
28
|
import { Button } from "../../components/micro/button";
|
|
29
|
+
import { useDevContext } from "../../dev/components/dev-context";
|
|
30
|
+
import {
|
|
31
|
+
DocsP,
|
|
32
|
+
ExampleGrid,
|
|
33
|
+
ExampleSection,
|
|
34
|
+
Showcase,
|
|
35
|
+
ShowcaseDocs,
|
|
36
|
+
} from "../../dev/components/showcase";
|
|
36
37
|
import { type Size } from "../../lib/types";
|
|
37
38
|
|
|
38
39
|
// ──────────────────────────────────────────────────────────
|
|
@@ -48,19 +49,18 @@ function AlertDialogMacroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
48
49
|
label="Hành Động Nguy Danger (Destructive)"
|
|
49
50
|
description="Sử dụng actionColor='destructive' để tạo nút hành động nguy hiểm."
|
|
50
51
|
codeString={`<AlertDialogPreset
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`}
|
|
52
|
+
trigger={
|
|
53
|
+
<Button variant="outline" color="destructive">
|
|
54
|
+
Xoá Tài Khoản
|
|
55
|
+
</Button>
|
|
56
|
+
}
|
|
57
|
+
title="Bạn có chắc chắn muốn xoá?"
|
|
58
|
+
description="Hành động này không thể hoàn tác. Tài khoản và toàn bộ dữ liệu của bạn trên hệ thống sẽ bị xoá vĩnh viễn."
|
|
59
|
+
cancelLabel="Huỷ"
|
|
60
|
+
actionLabel="Xoá"
|
|
61
|
+
actionColor="destructive"
|
|
62
|
+
onAction={() => console.log("Deleted!")}
|
|
63
|
+
/>`}
|
|
64
64
|
>
|
|
65
65
|
<AlertDialogPreset
|
|
66
66
|
size={globalSize}
|
|
@@ -82,18 +82,13 @@ function AlertDialogMacroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
82
82
|
label="Xác Nhận Tiêu Chuẩn"
|
|
83
83
|
description="Dialog xác nhận thông thường chỉ với Text."
|
|
84
84
|
codeString={`<AlertDialogPreset
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
cancelLabel="Ở Lại"
|
|
93
|
-
actionLabel="Đăng Xuất"
|
|
94
|
-
onAction={() => console.log("Logged out!")}
|
|
95
|
-
/>
|
|
96
|
-
`}
|
|
85
|
+
trigger={<Button variant="outline">Đăng Xuất</Button>}
|
|
86
|
+
title="Đăng xuất khỏi tài khoản?"
|
|
87
|
+
description="Bạn sẽ cần nhập lại thông tin đăng nhập để truy cập vào tài khoản."
|
|
88
|
+
cancelLabel="Ở Lại"
|
|
89
|
+
actionLabel="Đăng Xuất"
|
|
90
|
+
onAction={() => console.log("Logged out!")}
|
|
91
|
+
/>`}
|
|
97
92
|
>
|
|
98
93
|
<AlertDialogPreset
|
|
99
94
|
size={globalSize}
|
|
@@ -116,24 +111,23 @@ function AlertDialogMacroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
116
111
|
label="Kèm Media (Icon/Image)"
|
|
117
112
|
description="Tự động chia cột Flexbox Side-by-Side khi truyền prop 'icon'."
|
|
118
113
|
codeString={`<AlertDialogPreset
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
`}
|
|
114
|
+
trigger={
|
|
115
|
+
<Button variant="outline" color="warning">
|
|
116
|
+
Thu Hồi Quyền
|
|
117
|
+
</Button>
|
|
118
|
+
}
|
|
119
|
+
icon={
|
|
120
|
+
<div className="flex size-full items-center justify-center rounded-full bg-warning/10">
|
|
121
|
+
<ShieldAlertIcon className="text-warning" />
|
|
122
|
+
</div>
|
|
123
|
+
}
|
|
124
|
+
title="Thu hồi quyền truy cập API?"
|
|
125
|
+
description="Tất cả các ứng dụng đang sử dụng API key này sẽ bị mất quyền truy cập ngay lập tức."
|
|
126
|
+
cancelLabel="Giữ Lại"
|
|
127
|
+
actionLabel="Thu Hồi"
|
|
128
|
+
actionColor="warning"
|
|
129
|
+
onAction={() => console.log("Revoked!")}
|
|
130
|
+
/>`}
|
|
137
131
|
>
|
|
138
132
|
<AlertDialogPreset
|
|
139
133
|
size={globalSize}
|
|
@@ -214,26 +208,23 @@ return (
|
|
|
214
208
|
label="Custom Button Variants"
|
|
215
209
|
description="Tuỳ chỉnh variant cho cả nút Action (soft) và Cancel (ghost) thông qua actionVariant/cancelVariant."
|
|
216
210
|
codeString={`<AlertDialogPreset
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
onAction={() => console.log("Feedback sent!")}
|
|
235
|
-
/>
|
|
236
|
-
`}
|
|
211
|
+
trigger={
|
|
212
|
+
<Button variant="outline">Custom Variants</Button>
|
|
213
|
+
}
|
|
214
|
+
icon={
|
|
215
|
+
<div className="flex size-full items-center justify-center rounded-full bg-info/10">
|
|
216
|
+
<MailWarningIcon className="text-info" />
|
|
217
|
+
</div>
|
|
218
|
+
}
|
|
219
|
+
title="Gửi phản hồi?"
|
|
220
|
+
description="Phản hồi của bạn sẽ được gửi ẩn danh tới đội ngũ phát triển."
|
|
221
|
+
cancelLabel="Bỏ qua"
|
|
222
|
+
cancelVariant="ghost"
|
|
223
|
+
actionLabel="Gửi"
|
|
224
|
+
actionColor="info"
|
|
225
|
+
actionVariant="soft"
|
|
226
|
+
onAction={() => console.log("Feedback sent!")}
|
|
227
|
+
/>`}
|
|
237
228
|
>
|
|
238
229
|
<AlertDialogPreset
|
|
239
230
|
size={globalSize}
|
|
@@ -262,25 +253,24 @@ return (
|
|
|
262
253
|
label="Children (Nội dung bổ sung)"
|
|
263
254
|
description="Prop children cho phép chèn thêm nội dung tuỳ ý vào phần Header."
|
|
264
255
|
codeString={`<AlertDialogPreset
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
>
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
</AlertDialogPreset
|
|
283
|
-
`}
|
|
256
|
+
trigger={
|
|
257
|
+
<Button variant="outline" color="warning">
|
|
258
|
+
Báo Cáo Lỗi
|
|
259
|
+
</Button>
|
|
260
|
+
}
|
|
261
|
+
title="Báo cáo lỗi hệ thống"
|
|
262
|
+
description="Vui lòng kiểm tra thông tin lỗi bên dưới trước khi gửi."
|
|
263
|
+
cancelLabel="Huỷ"
|
|
264
|
+
actionLabel="Gửi Báo Cáo"
|
|
265
|
+
actionColor="warning"
|
|
266
|
+
onAction={() => console.log("Report sent!")}
|
|
267
|
+
>
|
|
268
|
+
<div className="mt-2 rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-muted-foreground">
|
|
269
|
+
<p>Error Code: ERR_NETWORK_TIMEOUT</p>
|
|
270
|
+
<p>Timestamp: 2026-07-05T14:30:00Z</p>
|
|
271
|
+
<p>Module: api/gateway</p>
|
|
272
|
+
</div>
|
|
273
|
+
</AlertDialogPreset>`}
|
|
284
274
|
>
|
|
285
275
|
<AlertDialogPreset
|
|
286
276
|
size={globalSize}
|
|
@@ -310,23 +300,20 @@ return (
|
|
|
310
300
|
label="Giao Diện Nhỏ (Compact)"
|
|
311
301
|
description="Khi dùng size='sm', nội dung sẽ được căn giữa và footer tự động dàn hàng ngang 2 cột."
|
|
312
302
|
codeString={`<AlertDialogPreset
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
actionLabel="Có"
|
|
328
|
-
/>
|
|
329
|
-
`}
|
|
303
|
+
size="sm"
|
|
304
|
+
trigger={
|
|
305
|
+
<Button variant="outline">Xác Nhận Nhanh</Button>
|
|
306
|
+
}
|
|
307
|
+
icon={
|
|
308
|
+
<div className="flex size-full items-center justify-center rounded-full bg-muted">
|
|
309
|
+
<InfoIcon />
|
|
310
|
+
</div>
|
|
311
|
+
}
|
|
312
|
+
title="Xác nhận hành động?"
|
|
313
|
+
description="Đây là dialog dạng nhỏ, phù hợp cho các thao tác nhanh với 2 nút nằm ngang."
|
|
314
|
+
cancelLabel="Không"
|
|
315
|
+
actionLabel="Có"
|
|
316
|
+
/>`}
|
|
330
317
|
>
|
|
331
318
|
<AlertDialogPreset
|
|
332
319
|
size="sm"
|
|
@@ -362,30 +349,30 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
362
349
|
label="Sử dụng Cơ bản"
|
|
363
350
|
description="Lắp ráp thủ công các khối Header, Title, Description, Footer."
|
|
364
351
|
codeString={`<AlertDialog>
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
</
|
|
388
|
-
|
|
352
|
+
<AlertDialogTrigger
|
|
353
|
+
render={
|
|
354
|
+
<Button variant="outline">Mở Dialog Trắng</Button>
|
|
355
|
+
}
|
|
356
|
+
/>
|
|
357
|
+
<AlertDialogPortal>
|
|
358
|
+
<AlertDialogContent>
|
|
359
|
+
<AlertDialogHeader>
|
|
360
|
+
<AlertDialogTitle>
|
|
361
|
+
Cấu trúc nguyên thuỷ
|
|
362
|
+
</AlertDialogTitle>
|
|
363
|
+
<AlertDialogDescription>
|
|
364
|
+
Không có bất kỳ layout "thần thánh" nào ép buộc
|
|
365
|
+
ở đây. Các thành phần chỉ xếp dọc (flex-col) mặc
|
|
366
|
+
định.
|
|
367
|
+
</AlertDialogDescription>
|
|
368
|
+
</AlertDialogHeader>
|
|
369
|
+
<AlertDialogFooter>
|
|
370
|
+
<AlertDialogCancel>Huỷ bỏ</AlertDialogCancel>
|
|
371
|
+
<AlertDialogAction>Tiếp tục</AlertDialogAction>
|
|
372
|
+
</AlertDialogFooter>
|
|
373
|
+
</AlertDialogContent>
|
|
374
|
+
</AlertDialogPortal>
|
|
375
|
+
</AlertDialog>`}
|
|
389
376
|
>
|
|
390
377
|
<AlertDialog>
|
|
391
378
|
<AlertDialogTrigger
|
|
@@ -422,34 +409,35 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
422
409
|
label="Tự Do Custom Layout"
|
|
423
410
|
description="Bởi vì Micro component rất 'dumb', bạn có thể tự chèn thẻ div, custom flexbox để làm ra bất kỳ giao diện nào."
|
|
424
411
|
codeString={`<AlertDialog>
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
</
|
|
452
|
-
|
|
412
|
+
<AlertDialogTrigger
|
|
413
|
+
render={
|
|
414
|
+
<Button variant="outline" color="warning">
|
|
415
|
+
Giao Diện Custom
|
|
416
|
+
</Button>
|
|
417
|
+
}
|
|
418
|
+
/>
|
|
419
|
+
<AlertDialogPortal>
|
|
420
|
+
<AlertDialogContent className="border-warning/50">
|
|
421
|
+
<div className="flex flex-col-reverse items-center justify-center gap-4 py-4 sm:flex-row">
|
|
422
|
+
<div className="size-16 rounded-lg bg-warning/20 border border-warning" />
|
|
423
|
+
<AlertDialogHeader className="sm:text-left">
|
|
424
|
+
<AlertDialogTitle className="text-warning">
|
|
425
|
+
Cảnh báo Tùy chỉnh
|
|
426
|
+
</AlertDialogTitle>
|
|
427
|
+
<AlertDialogDescription>
|
|
428
|
+
Icon đang nằm bên trái, hoặc có thể dời sang
|
|
429
|
+
phải tuỳ ý bạn vì bạn đang kiểm soát HTML.
|
|
430
|
+
</AlertDialogDescription>
|
|
431
|
+
</AlertDialogHeader>
|
|
432
|
+
</div>
|
|
433
|
+
<AlertDialogFooter className="border-t-0 bg-transparent">
|
|
434
|
+
<AlertDialogCancel className="w-full">
|
|
435
|
+
Tôi đã hiểu
|
|
436
|
+
</AlertDialogCancel>
|
|
437
|
+
</AlertDialogFooter>
|
|
438
|
+
</AlertDialogContent>
|
|
439
|
+
</AlertDialogPortal>
|
|
440
|
+
</AlertDialog>`}
|
|
453
441
|
>
|
|
454
442
|
<AlertDialog>
|
|
455
443
|
<AlertDialogTrigger
|
|
@@ -493,35 +481,35 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
493
481
|
label="AlertDialogMedia"
|
|
494
482
|
description="Khối chứa Icon/Image, tự scale theo size của AlertDialogContent."
|
|
495
483
|
codeString={`<AlertDialog>
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
</
|
|
524
|
-
|
|
484
|
+
<AlertDialogTrigger
|
|
485
|
+
render={<Button variant="outline">Với Media</Button>}
|
|
486
|
+
/>
|
|
487
|
+
<AlertDialogPortal>
|
|
488
|
+
<AlertDialogContent>
|
|
489
|
+
<div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
|
|
490
|
+
<AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
|
|
491
|
+
<ShieldAlertIcon className="text-warning" />
|
|
492
|
+
</AlertDialogMedia>
|
|
493
|
+
<AlertDialogHeader>
|
|
494
|
+
<AlertDialogTitle>
|
|
495
|
+
Cảnh báo bảo mật
|
|
496
|
+
</AlertDialogTitle>
|
|
497
|
+
<AlertDialogDescription>
|
|
498
|
+
AlertDialogMedia là khối div chứa icon, tự
|
|
499
|
+
động scale kích thước theo data-size của
|
|
500
|
+
AlertDialogContent.
|
|
501
|
+
</AlertDialogDescription>
|
|
502
|
+
</AlertDialogHeader>
|
|
503
|
+
</div>
|
|
504
|
+
<AlertDialogFooter>
|
|
505
|
+
<AlertDialogCancel>Huỷ</AlertDialogCancel>
|
|
506
|
+
<AlertDialogAction color="warning">
|
|
507
|
+
Xác nhận
|
|
508
|
+
</AlertDialogAction>
|
|
509
|
+
</AlertDialogFooter>
|
|
510
|
+
</AlertDialogContent>
|
|
511
|
+
</AlertDialogPortal>
|
|
512
|
+
</AlertDialog>`}
|
|
525
513
|
>
|
|
526
514
|
<AlertDialog>
|
|
527
515
|
<AlertDialogTrigger
|
|
@@ -561,33 +549,34 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
561
549
|
label="AlertDialogClose"
|
|
562
550
|
description="Primitive đóng dialog cơ bản, cho phép render bất kỳ element nào (không bị ép thành Button)."
|
|
563
551
|
codeString={`<AlertDialog>
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
</
|
|
590
|
-
|
|
552
|
+
<AlertDialogTrigger
|
|
553
|
+
render={
|
|
554
|
+
<Button variant="outline">Dialog Có Nút X</Button>
|
|
555
|
+
}
|
|
556
|
+
/>
|
|
557
|
+
<AlertDialogPortal>
|
|
558
|
+
<AlertDialogContent>
|
|
559
|
+
<AlertDialogClose className="absolute top-3 right-3 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none">
|
|
560
|
+
<XIcon className="size-4" />
|
|
561
|
+
<span className="sr-only">Đóng</span>
|
|
562
|
+
</AlertDialogClose>
|
|
563
|
+
<AlertDialogHeader>
|
|
564
|
+
<AlertDialogTitle>
|
|
565
|
+
AlertDialogClose
|
|
566
|
+
</AlertDialogTitle>
|
|
567
|
+
<AlertDialogDescription>
|
|
568
|
+
Khác với AlertDialogCancel (luôn render Button),
|
|
569
|
+
AlertDialogClose là bare-bone — bạn có thể
|
|
570
|
+
render icon X, link, hay bất kỳ thứ gì.
|
|
571
|
+
</AlertDialogDescription>
|
|
572
|
+
</AlertDialogHeader>
|
|
573
|
+
<AlertDialogFooter>
|
|
574
|
+
<AlertDialogCancel>Huỷ</AlertDialogCancel>
|
|
575
|
+
<AlertDialogAction>Đồng ý</AlertDialogAction>
|
|
576
|
+
</AlertDialogFooter>
|
|
577
|
+
</AlertDialogContent>
|
|
578
|
+
</AlertDialogPortal>
|
|
579
|
+
</AlertDialog>`}
|
|
591
580
|
>
|
|
592
581
|
<AlertDialog>
|
|
593
582
|
<AlertDialogTrigger
|
|
@@ -629,34 +618,38 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
629
618
|
label="Action Colors"
|
|
630
619
|
description="AlertDialogAction hỗ trợ prop color để thay đổi ngữ nghĩa hành động."
|
|
631
620
|
codeString={`<AlertDialog>
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
621
|
+
<AlertDialogTrigger
|
|
622
|
+
render={
|
|
623
|
+
<Button variant="outline" color="destructive">
|
|
624
|
+
Xoá Tài Khoản
|
|
625
|
+
</Button>
|
|
626
|
+
}
|
|
627
|
+
/>
|
|
628
|
+
<AlertDialogPortal>
|
|
629
|
+
<AlertDialogContent>
|
|
630
|
+
<div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
|
|
631
|
+
<AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
|
|
632
|
+
<TrashIcon className="text-destructive" />
|
|
633
|
+
</AlertDialogMedia>
|
|
634
|
+
<AlertDialogHeader>
|
|
635
|
+
<AlertDialogTitle>
|
|
636
|
+
Xoá tài khoản vĩnh viễn?
|
|
637
|
+
</AlertDialogTitle>
|
|
638
|
+
<AlertDialogDescription>
|
|
639
|
+
Tất cả dữ liệu sẽ bị xoá và không thể khôi
|
|
640
|
+
phục.
|
|
641
|
+
</AlertDialogDescription>
|
|
642
|
+
</AlertDialogHeader>
|
|
643
|
+
</div>
|
|
644
|
+
<AlertDialogFooter>
|
|
645
|
+
<AlertDialogCancel>Huỷ</AlertDialogCancel>
|
|
646
|
+
<AlertDialogAction color="destructive">
|
|
647
|
+
Xoá vĩnh viễn
|
|
648
|
+
</AlertDialogAction>
|
|
649
|
+
</AlertDialogFooter>
|
|
650
|
+
</AlertDialogContent>
|
|
651
|
+
</AlertDialogPortal>
|
|
652
|
+
</AlertDialog>`}
|
|
660
653
|
>
|
|
661
654
|
<AlertDialog>
|
|
662
655
|
<AlertDialogTrigger
|
|
@@ -697,40 +690,36 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
697
690
|
label="Action & Cancel Variants"
|
|
698
691
|
description="Tuỳ chỉnh variant cho cả Action (soft) và Cancel (ghost)."
|
|
699
692
|
codeString={`<AlertDialog>
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
>
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
</AlertDialogFooter>
|
|
731
|
-
</AlertDialogContent></AlertDialogPortal>
|
|
732
|
-
</AlertDialog>
|
|
733
|
-
`}
|
|
693
|
+
<AlertDialogTrigger
|
|
694
|
+
render={
|
|
695
|
+
<Button variant="outline">Custom Variants</Button>
|
|
696
|
+
}
|
|
697
|
+
/>
|
|
698
|
+
<AlertDialogPortal>
|
|
699
|
+
<AlertDialogContent>
|
|
700
|
+
<div className="flex flex-col gap-1.5 sm:flex-row sm:gap-4">
|
|
701
|
+
<AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
|
|
702
|
+
<LogOutIcon />
|
|
703
|
+
</AlertDialogMedia>
|
|
704
|
+
<AlertDialogHeader>
|
|
705
|
+
<AlertDialogTitle>Đăng xuất?</AlertDialogTitle>
|
|
706
|
+
<AlertDialogDescription>
|
|
707
|
+
Phiên đăng nhập của bạn sẽ kết thúc. Bạn cần
|
|
708
|
+
nhập lại mật khẩu để quay lại.
|
|
709
|
+
</AlertDialogDescription>
|
|
710
|
+
</AlertDialogHeader>
|
|
711
|
+
</div>
|
|
712
|
+
<AlertDialogFooter>
|
|
713
|
+
<AlertDialogCancel variant="ghost">
|
|
714
|
+
Ở lại
|
|
715
|
+
</AlertDialogCancel>
|
|
716
|
+
<AlertDialogAction variant="soft" color="info">
|
|
717
|
+
Đăng xuất
|
|
718
|
+
</AlertDialogAction>
|
|
719
|
+
</AlertDialogFooter>
|
|
720
|
+
</AlertDialogContent>
|
|
721
|
+
</AlertDialogPortal>
|
|
722
|
+
</AlertDialog>`}
|
|
734
723
|
>
|
|
735
724
|
<AlertDialog>
|
|
736
725
|
<AlertDialogTrigger
|
|
@@ -779,121 +768,135 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
779
768
|
description="Các kịch bản thực tế giúp bạn quyết định nên dùng Micro hay Macro."
|
|
780
769
|
fullWidth
|
|
781
770
|
codeString={`<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
771
|
+
{/* ── Story 1: Macro wins ── */}
|
|
772
|
+
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
773
|
+
<div className="flex items-start gap-3">
|
|
774
|
+
<span className="mt-0.5 shrink-0 rounded-full bg-green-500/10 p-1.5 text-green-600">
|
|
775
|
+
<ShieldAlertIcon
|
|
776
|
+
className="size-4"
|
|
777
|
+
aria-hidden="true"
|
|
778
|
+
/>
|
|
779
|
+
</span>
|
|
780
|
+
<div>
|
|
781
|
+
<p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
782
|
+
Story 1 · Dùng Macro
|
|
783
|
+
</p>
|
|
784
|
+
<h3 className="mt-0.5 text-sm font-semibold text-foreground">
|
|
785
|
+
Xác nhận chuẩn mực với Icon
|
|
786
|
+
</h3>
|
|
787
|
+
</div>
|
|
795
788
|
</div>
|
|
796
|
-
</div>
|
|
797
|
-
|
|
798
|
-
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
799
|
-
Bạn cần làm một dialog xác nhận xoá với layout Side-by-Side
|
|
800
|
-
(Icon nằm bên trái trên màn hình lớn, nằm ở trên cùng trên màn
|
|
801
|
-
hình nhỏ).
|
|
802
|
-
</p>
|
|
803
|
-
|
|
804
|
-
<div className="rounded-lg bg-muted/50 p-3 flex justify-center">
|
|
805
|
-
<AlertDialogPreset
|
|
806
|
-
size="sm"
|
|
807
|
-
trigger={
|
|
808
|
-
<Button variant="outline" size="sm">
|
|
809
|
-
Xem Demo
|
|
810
|
-
</Button>
|
|
811
|
-
}
|
|
812
|
-
icon={
|
|
813
|
-
<div className="flex size-full items-center justify-center rounded-full bg-muted">
|
|
814
|
-
<InfoIcon />
|
|
815
|
-
</div>
|
|
816
|
-
}
|
|
817
|
-
title="Xác nhận thao tác"
|
|
818
|
-
description="Macro bọc mọi thứ vào một component duy nhất."
|
|
819
|
-
cancelLabel="Huỷ"
|
|
820
|
-
actionLabel="Tiếp tục"
|
|
821
|
-
/>
|
|
822
|
-
</div>
|
|
823
789
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
phức tạp.
|
|
790
|
+
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
791
|
+
Bạn cần làm một dialog xác nhận xoá với layout
|
|
792
|
+
Side-by-Side (Icon nằm bên trái trên màn hình lớn,
|
|
793
|
+
nằm ở trên cùng trên màn hình nhỏ).
|
|
829
794
|
</p>
|
|
830
|
-
</div>
|
|
831
|
-
</div>
|
|
832
|
-
|
|
833
|
-
{/* ── Story 2: Micro wins ── */}
|
|
834
|
-
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
835
|
-
<div className="flex items-start gap-3">
|
|
836
|
-
<span className="mt-0.5 shrink-0 rounded-full bg-blue-500/10 p-1.5 text-blue-600">
|
|
837
|
-
<MessageSquareWarningIcon
|
|
838
|
-
className="size-4"
|
|
839
|
-
aria-hidden="true"
|
|
840
|
-
/>
|
|
841
|
-
</span>
|
|
842
|
-
<div>
|
|
843
|
-
<p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
844
|
-
Story 2 · Dùng Micro
|
|
845
|
-
</p>
|
|
846
|
-
<h3 className="mt-0.5 text-sm font-semibold text-foreground">
|
|
847
|
-
Custom Layout độc lạ
|
|
848
|
-
</h3>
|
|
849
|
-
</div>
|
|
850
|
-
</div>
|
|
851
|
-
|
|
852
|
-
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
853
|
-
Designer yêu cầu một Modal có Layout đặc thù: Image bự ở trên
|
|
854
|
-
cùng, Text ở dưới, Footer có 3 nút. Không có bất kỳ Preset nào
|
|
855
|
-
support layout này.
|
|
856
|
-
</p>
|
|
857
795
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
796
|
+
<div className="rounded-lg bg-muted/50 p-3 flex justify-center">
|
|
797
|
+
<AlertDialogPreset
|
|
798
|
+
size="sm"
|
|
799
|
+
trigger={
|
|
862
800
|
<Button variant="outline" size="sm">
|
|
863
801
|
Xem Demo
|
|
864
802
|
</Button>
|
|
865
803
|
}
|
|
804
|
+
icon={
|
|
805
|
+
<div className="flex size-full items-center justify-center rounded-full bg-muted">
|
|
806
|
+
<InfoIcon />
|
|
807
|
+
</div>
|
|
808
|
+
}
|
|
809
|
+
title="Xác nhận thao tác"
|
|
810
|
+
description="Macro bọc mọi thứ vào một component duy nhất."
|
|
811
|
+
cancelLabel="Huỷ"
|
|
812
|
+
actionLabel="Tiếp tục"
|
|
866
813
|
/>
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
<AlertDialogCancel className="w-full">
|
|
880
|
-
Cancel
|
|
881
|
-
</AlertDialogCancel>
|
|
882
|
-
</AlertDialogFooter>
|
|
883
|
-
</AlertDialogContent></AlertDialogPortal>
|
|
884
|
-
</AlertDialog>
|
|
814
|
+
</div>
|
|
815
|
+
|
|
816
|
+
<div className="rounded-md border border-border border-green-500/20 bg-green-500/5 px-3 py-2">
|
|
817
|
+
<p className="text-xs font-medium text-green-700 dark:text-green-400">
|
|
818
|
+
✅ Dùng{" "}
|
|
819
|
+
<code className="font-mono">
|
|
820
|
+
AlertDialogPreset
|
|
821
|
+
</code>{" "}
|
|
822
|
+
— Viết đúng 1 element. Tự động xử lý Grid/Flex
|
|
823
|
+
responsive siêu phức tạp.
|
|
824
|
+
</p>
|
|
825
|
+
</div>
|
|
885
826
|
</div>
|
|
886
827
|
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
828
|
+
{/* ── Story 2: Micro wins ── */}
|
|
829
|
+
<div className="rounded-xl border border-border bg-card p-5 flex flex-col gap-4">
|
|
830
|
+
<div className="flex items-start gap-3">
|
|
831
|
+
<span className="mt-0.5 shrink-0 rounded-full bg-blue-500/10 p-1.5 text-blue-600">
|
|
832
|
+
<MessageSquareWarningIcon
|
|
833
|
+
className="size-4"
|
|
834
|
+
aria-hidden="true"
|
|
835
|
+
/>
|
|
836
|
+
</span>
|
|
837
|
+
<div>
|
|
838
|
+
<p className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">
|
|
839
|
+
Story 2 · Dùng Micro
|
|
840
|
+
</p>
|
|
841
|
+
<h3 className="mt-0.5 text-sm font-semibold text-foreground">
|
|
842
|
+
Custom Layout độc lạ
|
|
843
|
+
</h3>
|
|
844
|
+
</div>
|
|
845
|
+
</div>
|
|
846
|
+
|
|
847
|
+
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
848
|
+
Designer yêu cầu một Modal có Layout đặc thù: Image
|
|
849
|
+
bự ở trên cùng, Text ở dưới, Footer có 3 nút. Không
|
|
850
|
+
có bất kỳ Preset nào support layout này.
|
|
892
851
|
</p>
|
|
852
|
+
|
|
853
|
+
<div className="rounded-lg bg-muted/50 p-3 flex justify-center">
|
|
854
|
+
<AlertDialog>
|
|
855
|
+
<AlertDialogTrigger
|
|
856
|
+
render={
|
|
857
|
+
<Button variant="outline" size="sm">
|
|
858
|
+
Xem Demo
|
|
859
|
+
</Button>
|
|
860
|
+
}
|
|
861
|
+
/>
|
|
862
|
+
<AlertDialogPortal>
|
|
863
|
+
<AlertDialogContent size="sm">
|
|
864
|
+
<div className="h-24 w-full rounded-md bg-muted flex items-center justify-center text-xs text-muted-foreground">
|
|
865
|
+
Custom Image
|
|
866
|
+
</div>
|
|
867
|
+
<AlertDialogHeader>
|
|
868
|
+
<AlertDialogTitle>
|
|
869
|
+
Tùy biến 100%
|
|
870
|
+
</AlertDialogTitle>
|
|
871
|
+
</AlertDialogHeader>
|
|
872
|
+
<AlertDialogFooter className="flex-col gap-2 sm:flex-col">
|
|
873
|
+
<Button className="w-full">Action 1</Button>
|
|
874
|
+
<Button
|
|
875
|
+
color="secondary"
|
|
876
|
+
variant="soft"
|
|
877
|
+
className="w-full"
|
|
878
|
+
>
|
|
879
|
+
Action 2
|
|
880
|
+
</Button>
|
|
881
|
+
<AlertDialogCancel className="w-full">
|
|
882
|
+
Cancel
|
|
883
|
+
</AlertDialogCancel>
|
|
884
|
+
</AlertDialogFooter>
|
|
885
|
+
</AlertDialogContent>
|
|
886
|
+
</AlertDialogPortal>
|
|
887
|
+
</AlertDialog>
|
|
888
|
+
</div>
|
|
889
|
+
|
|
890
|
+
<div className="rounded-md border border-border border-blue-500/20 bg-blue-500/5 px-3 py-2">
|
|
891
|
+
<p className="text-xs font-medium text-blue-700 dark:text-blue-400">
|
|
892
|
+
✅ Dùng{" "}
|
|
893
|
+
<code className="font-mono">AlertDialog</code>{" "}
|
|
894
|
+
(Micro) — Không bị ràng buộc bởi bất kỳ layout
|
|
895
|
+
định sẵn nào. Lắp ráp thẻ tự do.
|
|
896
|
+
</p>
|
|
897
|
+
</div>
|
|
893
898
|
</div>
|
|
894
|
-
</div
|
|
895
|
-
</div>
|
|
896
|
-
`}
|
|
899
|
+
</div>`}
|
|
897
900
|
>
|
|
898
901
|
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
|
|
899
902
|
{/* ── Story 1: Macro wins ── */}
|
|
@@ -913,9 +916,9 @@ function AlertDialogMicroShowcase({ globalSize }: { globalSize: Size }) {
|
|
|
913
916
|
</div>
|
|
914
917
|
|
|
915
918
|
<p className="text-xs text-muted-foreground leading-relaxed">
|
|
916
|
-
Bạn cần làm một dialog xác nhận xoá với layout Side-by-Side
|
|
917
|
-
|
|
918
|
-
|
|
919
|
+
Bạn cần làm một dialog xác nhận xoá với layout Side-by-Side (Icon
|
|
920
|
+
nằm bên trái trên màn hình lớn, nằm ở trên cùng trên màn hình
|
|
921
|
+
nhỏ).
|
|
919
922
|
</p>
|
|
920
923
|
|
|
921
924
|
<div className="rounded-lg bg-muted/50 p-3 flex justify-center">
|