@momo-webplatform/mobase 0.0.38 → 0.0.40
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/package.json +2 -1
- package/publish/cjs/components/Callout/Callout.js +46 -0
- package/publish/cjs/components/Callout/index.js +5 -0
- package/publish/cjs/components/Dialog/Dialog.js +34 -8
- package/publish/cjs/components/DialogQr/DialogQr.js +98 -0
- package/publish/cjs/components/DialogQr/index.js +5 -0
- package/publish/cjs/components/SearchBar/SearchBar.js +48 -0
- package/publish/cjs/components/SearchBar/index.js +5 -0
- package/publish/cjs/components/TextButton/TextButton.js +63 -0
- package/publish/cjs/components/TextButton/index.js +5 -0
- package/publish/cjs/components/Toast/Toast.js +12 -11
- package/publish/cjs/components/Toast/index.js +4 -12
- package/publish/cjs/components/Toast/toaster.js +4 -4
- package/publish/cjs/components/Toast/{use-toast.js → useToast.js} +4 -2
- package/publish/cjs/index.js +5 -0
- package/publish/cjs/tsconfig.lib.tsbuildinfo +1 -1
- package/publish/esm/components/Callout/Callout.d.ts +19 -0
- package/publish/esm/components/Callout/Callout.js +43 -0
- package/publish/esm/components/Callout/index.d.ts +1 -0
- package/publish/esm/components/Callout/index.js +1 -0
- package/publish/esm/components/Dialog/Dialog.d.ts +4 -0
- package/publish/esm/components/Dialog/Dialog.js +34 -8
- package/publish/esm/components/DialogQr/DialogQr.d.ts +33 -0
- package/publish/esm/components/DialogQr/DialogQr.js +91 -0
- package/publish/esm/components/DialogQr/index.d.ts +1 -0
- package/publish/esm/components/DialogQr/index.js +1 -0
- package/publish/esm/components/SearchBar/SearchBar.d.ts +7 -0
- package/publish/esm/components/SearchBar/SearchBar.js +45 -0
- package/publish/esm/components/SearchBar/index.d.ts +1 -0
- package/publish/esm/components/SearchBar/index.js +1 -0
- package/publish/esm/components/TextButton/TextButton.d.ts +22 -0
- package/publish/esm/components/TextButton/TextButton.js +36 -0
- package/publish/esm/components/TextButton/index.d.ts +2 -0
- package/publish/esm/components/TextButton/index.js +1 -0
- package/publish/esm/components/Toast/Toast.d.ts +1 -1
- package/publish/esm/components/Toast/Toast.js +13 -12
- package/publish/esm/components/Toast/index.d.ts +1 -2
- package/publish/esm/components/Toast/index.js +1 -2
- package/publish/esm/components/Toast/toaster.js +3 -3
- package/publish/esm/components/Toast/{use-toast.d.ts → useToast.d.ts} +1 -1
- package/publish/esm/components/Toast/{use-toast.js → useToast.js} +4 -2
- package/publish/esm/index.d.ts +5 -0
- package/publish/esm/index.js +5 -0
- package/publish/esm/tsconfig.lib.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-webplatform/mobase",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"description": "Mobase is the UI framework upon we build product experiences at MoMo.vn, base on Radix primitives, and Tailwind CSS.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "next dev",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"nextra": "^2.13.2",
|
|
81
81
|
"nextra-theme-docs": "^2.13.2",
|
|
82
82
|
"postcss": "^8.4.33",
|
|
83
|
+
"qrcode.react": "1.0.1",
|
|
83
84
|
"react": "^18.2.0",
|
|
84
85
|
"react-day-picker": "^8.10.0",
|
|
85
86
|
"react-docgen-typescript": "^2.2.2",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Callout = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const utils_1 = require("../../helpers/utils");
|
|
8
|
+
const outline_1 = require("@heroicons/react/24/outline");
|
|
9
|
+
const TextButton_1 = require("../TextButton");
|
|
10
|
+
const calloutVariants = (0, class_variance_authority_1.cva)("px-3 py-2 rounded-md border flex items-center space-x-2 text-gray-700 text-sm ", {
|
|
11
|
+
variants: {
|
|
12
|
+
typeDiv: {
|
|
13
|
+
neutral: "bg-gray-50 border-gray-300 ",
|
|
14
|
+
error: "bg-red-50 border-red-300",
|
|
15
|
+
success: "bg-green-50 border-green-300",
|
|
16
|
+
warning: "bg-yellow-50 border-yellow-300",
|
|
17
|
+
info: "bg-blue-50 border-blue-300",
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
true: "text-gray-400 bg-gray-50 opacity-55 pointer-events-none border-gray-300",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
typeDiv: "neutral",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const iconVariants = (0, class_variance_authority_1.cva)("w-5 h-5 shrink-0 border-none p-0 ", {
|
|
28
|
+
variants: {
|
|
29
|
+
typeIcon: {
|
|
30
|
+
neutral: "text-gray-700",
|
|
31
|
+
error: "text-red-700",
|
|
32
|
+
success: "text-green-700",
|
|
33
|
+
warning: "text-yellow-700",
|
|
34
|
+
info: "text-blue-700",
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
true: "text-gray-400",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
typeIcon: "neutral",
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
exports.Callout = (0, react_1.forwardRef)(({ type = "neutral", message = "", withAction = false, onClickAction, className, disabled, actionClassName, ...props }, ref) => {
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: (0, utils_1.cn)("", className, calloutVariants({ typeDiv: type, disabled })), ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center space-x-2", children: [(0, jsx_runtime_1.jsx)(outline_1.InformationCircleIcon, { className: (0, utils_1.cn)(iconVariants({ typeIcon: type, disabled })), width: 20, height: 20 }), (0, jsx_runtime_1.jsx)("div", { children: "B\u1EA1n c\u1EA7n cho ph\u00E9p website s\u1EED d\u1EE5ng th\u00F4ng tin v\u1ECB tr\u00ED \u0111\u1EC3 s\u1EED d\u1EE5ng t\u00EDnh n\u0103ng n\u00E0y" })] }), withAction && ((0, jsx_runtime_1.jsx)(TextButton_1.TextButton, { variant: "primary", onClick: () => onClickAction?.(), className: (0, utils_1.cn)("", actionClassName), isDisabled: disabled, children: withAction }))] }));
|
|
46
|
+
});
|
|
@@ -28,7 +28,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
28
28
|
const React = __importStar(require("react"));
|
|
29
29
|
const DialogPrimitive = __importStar(require("@radix-ui/react-dialog"));
|
|
30
30
|
const utils_1 = require("../../helpers/utils");
|
|
31
|
-
const solid_1 = require("@heroicons/react/
|
|
31
|
+
const solid_1 = require("@heroicons/react/20/solid");
|
|
32
32
|
const Dialog = DialogPrimitive.Root;
|
|
33
33
|
exports.Dialog = Dialog;
|
|
34
34
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
@@ -40,11 +40,37 @@ exports.DialogClose = DialogClose;
|
|
|
40
40
|
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(DialogPrimitive.Overlay, { ref: ref, className: (0, utils_1.cn)("fixed inset-0 z-50 bg-black/60 !duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
|
|
41
41
|
exports.DialogOverlay = DialogOverlay;
|
|
42
42
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
43
|
-
const DialogContent = React.forwardRef(({ className, isRightCloseButton, size = "md", position = "center", isFull = false, children, ...props }, ref) =>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
const DialogContent = React.forwardRef(({ className, isRightCloseButton, size = "md", position = "center", height = "auto", isFull = false, children, ...props }, ref) => {
|
|
44
|
+
const classNames = {
|
|
45
|
+
base: "fixed z-50 flex border bg-background shadow-lg sm:rounded-lg bg-white text-gray-900 w-full max-w-[calc(-64px_+_100vw)] max-h-[calc(-64px_+_100vh)] flex-col",
|
|
46
|
+
center: "left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",
|
|
47
|
+
bottom: "!duration-300 bottom-0 sm:bottom-1/2 left-1/2 rounded-t-lg sm:translate-y-1/2 data-[state=closed]:animate-out -translate-x-1/2 data-[state=open]:animate-in data-[state=open]:slide-in-from-left-1/2 ease-in-out data-[state=open]:slide-in-from-bottom-2/3 data-[state=closed]:slide-out-to-bottom-2/3 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 max-w-full max-h-[calc(-32px_+_100vh)] sm:max-h-[calc(-64px_+_100vh)]",
|
|
48
|
+
left: "!duration-300 max-h-screen !h-full rounded-r-lg sm:rounded-l-none top-0 data-[state=open]:animate-in data-[state=open]:slide-in-from-left data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left ease-in-out",
|
|
49
|
+
right: "!duration-300 !h-full rounded-l-lg sm:rounded-r-none max-h-screen top-0 right-0 data-[state=open]:animate-in data-[state=open]:slide-in-from-right data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right ease-in-out",
|
|
50
|
+
};
|
|
51
|
+
const sizeClassNames = {
|
|
52
|
+
sm: "w-80 sm:w-80",
|
|
53
|
+
md: "w-[512px] sm:w-[512px]",
|
|
54
|
+
lg: "w-[672px] sm:w-[672px]",
|
|
55
|
+
xl: "w-[1024px] sm:-[1024px]",
|
|
56
|
+
};
|
|
57
|
+
const heightClassNames = {
|
|
58
|
+
auto: "h-auto sm:h-auto",
|
|
59
|
+
small: "h-[480px] sm:h-[480px]",
|
|
60
|
+
large: "h-[640px] sm:h-[640px]",
|
|
61
|
+
full: "h-full",
|
|
62
|
+
};
|
|
63
|
+
const classNamesDialogContent = [
|
|
64
|
+
classNames.base,
|
|
65
|
+
classNames[position],
|
|
66
|
+
sizeClassNames[size],
|
|
67
|
+
heightClassNames[height],
|
|
68
|
+
isFull &&
|
|
69
|
+
"h-full max-h-screen max-w-full w-full rounded-none sm:rounded-lg sm:max-h-[calc(-64px_+_100vh)]",
|
|
70
|
+
className,
|
|
71
|
+
];
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(DialogPortal, { children: [(0, jsx_runtime_1.jsx)(DialogOverlay, {}), (0, jsx_runtime_1.jsxs)(DialogPrimitive.Content, { ref: ref, className: (0, utils_1.cn)(...classNamesDialogContent), ...props, children: [children, (0, jsx_runtime_1.jsxs)(DialogPrimitive.Close, { className: (0, utils_1.cn)("absolute md:top-4 top-2 focus:outline-none focus:ring-0 disabled:pointer-events-none data-[state=open]:bg-gray-100 data-[state=open]:text-gray-700 text-gray-900 w-8 h-8 flex justify-center items-center rounded-full before:opacity-0 hover:before:opacity-100 before:transition-opacity before:z-[-1] before:content-[''] before:absolute before:inset-0 before:rounded-full before:select-none before:left-0 before:top-0 before:bg-gray-200 left-3 md:left-auto md:right-4", isRightCloseButton && "left-auto right-3 md:right-4"), title: "\u0110\u00F3ng", children: [(0, jsx_runtime_1.jsx)(solid_1.XMarkIcon, { className: "h-5 w-5 text-gray-900" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Close" })] })] })] }));
|
|
73
|
+
});
|
|
48
74
|
exports.DialogContent = DialogContent;
|
|
49
75
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
50
76
|
const DialogHeader = ({ className, ...props }) => ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("dialog-header py-2 md:py-4 h-12 md:h-16 px-10 md:px-12 items-center justify-center flex border-b border-gray-200 w-full shrink-0", className), ...props }));
|
|
@@ -56,9 +82,9 @@ DialogBody.displayName = "DialogBody";
|
|
|
56
82
|
const DialogFooter = ({ className, isDivider = true, ...props }) => ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("dialog-footer flex sm:flex-row justify-center [&>*]:basis-1/2 [&>*]:sm:basis-auto sm:justify-end space-x-2 px-6 pb-4 shrink-0", isDivider && "border-gray-200 border-t py-4", className), ...props }));
|
|
57
83
|
exports.DialogFooter = DialogFooter;
|
|
58
84
|
DialogFooter.displayName = "DialogFooter";
|
|
59
|
-
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(DialogPrimitive.Title, { ref: ref, className: (0, utils_1.cn)("text-base font-
|
|
85
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(DialogPrimitive.Title, { ref: ref, className: (0, utils_1.cn)("text-base font-semibold line-clamp-1 max-w-full", className), ...props })));
|
|
60
86
|
exports.DialogTitle = DialogTitle;
|
|
61
87
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
62
|
-
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(DialogPrimitive.Description, { ref: ref, className: (0, utils_1.cn)("text-sm text-
|
|
88
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(DialogPrimitive.Description, { ref: ref, className: (0, utils_1.cn)("text-sm text-gray-700", className), ...props })));
|
|
63
89
|
exports.DialogDescription = DialogDescription;
|
|
64
90
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DialogQr = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const Dialog_1 = require("../Dialog");
|
|
9
|
+
const qrcode_react_1 = __importDefault(require("qrcode.react"));
|
|
10
|
+
const utils_1 = require("../../helpers/utils");
|
|
11
|
+
const QRCodeScan = ({ img = "", children, isQrForAll }) => {
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "qrcode__scan__container", children: (0, jsx_runtime_1.jsxs)("div", { className: "qrcode__scan", children: [(0, jsx_runtime_1.jsx)("div", { className: "qrcode__gradient", children: (0, jsx_runtime_1.jsx)("img", { alt: "step 1", className: "img-fluid", src: "https://homepage.momocdn.net/jk/momo2020/img/qrcode/qrcode-gradient.png" }) }), (0, jsx_runtime_1.jsx)("div", { className: "qrcode__border", children: (0, jsx_runtime_1.jsx)("img", { alt: "step 2", className: "img-fluid", src: "https://homepage.momocdn.net/jk/momo2020/img/qrcode/border-qrcode.svg" }) }), (0, jsx_runtime_1.jsx)("div", { className: "qrcode__image p-4", children: img ? ((0, jsx_runtime_1.jsx)("img", { alt: "step 3", className: "img-fluid d-block mx-auto", src: img, loading: "lazy" })) : (children) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "mt-4 text-sm text-white", children: isQrForAll ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: "https://homepage.momocdn.net/img/momo-upload-api-231211171009-638379114093056419.png", width: 255, height: 32, className: "mx-auto", alt: "QR all" }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3", children: "Nh\u1EADn ti\u1EC1n t\u1EEB m\u1ECDi V\u00ED \u0110i\u1EC7n T\u1EED v\u00E0 Ng\u00E2n H\u00E0ng" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: "mr-1 inline h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v1m6 11h2m-6 0h-2v4m0-11v3m0 0h.01M12 12h4.01M16 20h4M4 12h4m12 0h.01M5 8h2a1 1 0 001-1V5a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1zm12 0h2a1 1 0 001-1V5a1 1 0 00-1-1h-2a1 1 0 00-1 1v2a1 1 0 001 1zM5 20h2a1 1 0 001-1v-2a1 1 0 00-1-1H5a1 1 0 00-1 1v2a1 1 0 001 1z" }) }), "S\u1EED d\u1EE5ng App MoMo ho\u1EB7c", (0, jsx_runtime_1.jsx)("br", {}), "\u1EE9ng d\u1EE5ng Camera h\u1ED7 tr\u1EE3 QR code \u0111\u1EC3 qu\u00E9t m\u00E3."] })) }), (0, jsx_runtime_1.jsx)("style", { children: `
|
|
13
|
+
.qrcode__scan__container {
|
|
14
|
+
padding: 15px;
|
|
15
|
+
background-color: white;
|
|
16
|
+
width: 280px;
|
|
17
|
+
height: 280px;
|
|
18
|
+
border-radius: 20px;
|
|
19
|
+
border-radius: 15px;
|
|
20
|
+
margin: 0 auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.qrcode__image {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.qrcode__image img {
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.qrcode__scan {
|
|
32
|
+
width: 245px;
|
|
33
|
+
height: 245px;
|
|
34
|
+
margin: 0 auto;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
background-color: white;
|
|
37
|
+
position: relative;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.qrcode__border {
|
|
44
|
+
position: absolute;
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
top: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
z-index: 5;
|
|
50
|
+
opacity: 0.9;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.qrcode__gradient {
|
|
55
|
+
position: absolute;
|
|
56
|
+
opacity: 0.6;
|
|
57
|
+
width: 98%;
|
|
58
|
+
height: 98%;
|
|
59
|
+
top: 1%;
|
|
60
|
+
left: 1%;
|
|
61
|
+
z-index: 6;
|
|
62
|
+
// pointer-events: none;
|
|
63
|
+
transform: translate3d(0, -110%, 0);
|
|
64
|
+
animation: QRCodeScan 3s infinite cubic-bezier(0.45, 0.03, 0.81, 0.63);
|
|
65
|
+
|
|
66
|
+
backface-visibility: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@keyframes QRCodeScan {
|
|
70
|
+
0% {
|
|
71
|
+
transform: translate3d(0, -110%, 0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
90% {
|
|
75
|
+
transform: translate3d(0, 30%, 0);
|
|
76
|
+
}
|
|
77
|
+
100% {
|
|
78
|
+
transform: translate3d(0, 30%, 0);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
` })] }));
|
|
82
|
+
};
|
|
83
|
+
const DialogQr = ({ className, children, title, shortTitle, qrImage, qrLink, logoQr, isQrForAll = false, ...props }) => {
|
|
84
|
+
return ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { ...props, children: (0, jsx_runtime_1.jsx)(Dialog_1.DialogContent, { className: (0, utils_1.cn)("md:max-w-2xl lg:max-w-3xl h-auto md:max-h-screen max-h-screen overflow-hidden [&>button>svg]:text-white border-0", className), size: "xl", isRightCloseButton: true, children: (0, jsx_runtime_1.jsx)(Dialog_1.DialogBody, { className: "p-0", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-row flex-wrap", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-full flex-none md:w-5/12 hidden sm:block", children: children || ((0, jsx_runtime_1.jsxs)("div", { className: "px-5 text-sm py-8 grid grid-cols-1 gap-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-nowrap items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-none", children: (0, jsx_runtime_1.jsx)("img", { className: "w-20", loading: "lazy", src: "https://homepage.momocdn.net/images/s/momo-upload-api-200917091602-637359309621891617.png", alt: "Step 1" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 pl-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "step font-semibold text-gray-800 ", children: "B\u01B0\u1EDBc 1 :" }), (0, jsx_runtime_1.jsx)("div", { className: "mt-1 text-gray-500 ", children: isQrForAll
|
|
85
|
+
? "Mở app MoMo hoặc ứng dụng ngân hàng/ví điện tử chấp nhận mã vạch từ QR Đa Năng"
|
|
86
|
+
: "Mở ứng dụng camera mặc định hoặc ứng dụng hỗ trợ QR code của bạn" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-nowrap items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-none", children: (0, jsx_runtime_1.jsx)("img", { className: "w-20 ", loading: "lazy", src: "https://homepage.momocdn.net/images/s/momo-upload-api-200917091443-637359308837905996.png", alt: "Step 2" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 pl-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "step font-semibold text-gray-800 ", children: "B\u01B0\u1EDBc 2 :" }), (0, jsx_runtime_1.jsx)("div", { className: "mt-1 text-gray-500 ", children: "Qu\u00E9t m\u00E3 QR Code theo h\u00ECnh b\u00EAn ph\u1EA3i" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-nowrap items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-none", children: (0, jsx_runtime_1.jsx)("img", { className: "w-20 ", loading: "lazy", src: "https://homepage.momocdn.net/images/s/momo-upload-api-200917090146-637359301062519803.png", alt: "Step 3" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 pl-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "step font-semibold text-gray-800 ", children: "B\u01B0\u1EDBc 3 :" }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-1 text-gray-500 ", children: ["B\u1EA5m v\u00E0o th\u00F4ng b\u00E1o hi\u1EC3n th\u1ECB \u0111\u1EC3 t\u1EA3i \u1EE9ng d\u1EE5ng ho\u1EB7c", " ", shortTitle || "Truy cập ngay"] })] })] })] })) }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full items-center justify-center md:w-7/12 h-auto", style: {
|
|
87
|
+
background: "url(https://homepage.momocdn.net/jk/momo2020/img/intro/qrcode-pattern.png) 10px 10px no-repeat,linear-gradient(to top,#c1177c,#e11b90)",
|
|
88
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "px-5 py-10 text-center", children: [title && ((0, jsx_runtime_1.jsx)("h4", { className: "mb-5 text-base font-semibold text-white", children: title })), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [isQrForAll && ((0, jsx_runtime_1.jsx)("div", { className: "absolute -top-2 left-1/2 z-[5] -translate-x-1/2", children: (0, jsx_runtime_1.jsx)("img", { src: "https://homepage.momocdn.net/fileuploads/svg/momo-file-231211170324.svg", alt: "Title QR all" }) })), (0, jsx_runtime_1.jsx)(QRCodeScan, { img: qrImage, isQrForAll: isQrForAll, children: qrLink && ((0, jsx_runtime_1.jsx)(qrcode_react_1.default, { value: qrLink, size: 215, renderAs: "svg", imageSettings: {
|
|
89
|
+
src: `${logoQr ||
|
|
90
|
+
"https://homepage.momocdn.net/pwa/images/logoMomox50.png"}`,
|
|
91
|
+
x: null,
|
|
92
|
+
y: null,
|
|
93
|
+
height: 50,
|
|
94
|
+
width: 50,
|
|
95
|
+
excavate: true,
|
|
96
|
+
}, level: "H" })) })] })] }) })] }) }) }) }));
|
|
97
|
+
};
|
|
98
|
+
exports.DialogQr = DialogQr;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchBar = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const solid_1 = require("@heroicons/react/20/solid");
|
|
7
|
+
const outline_1 = require("@heroicons/react/24/outline");
|
|
8
|
+
const utils_1 = require("../../helpers/utils");
|
|
9
|
+
exports.SearchBar = (0, react_1.forwardRef)(({ disabled, className, inputClassName, size, onChange, onFocus, onClickClear, value, defaultValue, type = "text", ...restProps }, ref) => {
|
|
10
|
+
const [clearable, setClearable] = (0, react_1.useState)(false);
|
|
11
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
12
|
+
const handleShowClearButton = (inputValue) => {
|
|
13
|
+
if (inputValue && !clearable) {
|
|
14
|
+
setClearable(true);
|
|
15
|
+
}
|
|
16
|
+
if (!inputValue && clearable) {
|
|
17
|
+
setClearable(false);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const onChangeFactory = (event) => {
|
|
21
|
+
handleShowClearButton(event.target.value);
|
|
22
|
+
onChange?.(event);
|
|
23
|
+
};
|
|
24
|
+
const onFocusFactory = (event) => {
|
|
25
|
+
handleShowClearButton(event.target.value);
|
|
26
|
+
onFocus?.(event);
|
|
27
|
+
};
|
|
28
|
+
const handleClear = () => {
|
|
29
|
+
const inputTarget = rootRef.current?.querySelector("input");
|
|
30
|
+
if (!inputTarget)
|
|
31
|
+
return;
|
|
32
|
+
onClickClear?.(inputTarget.value);
|
|
33
|
+
inputTarget.value = "";
|
|
34
|
+
inputTarget.focus();
|
|
35
|
+
setClearable(false);
|
|
36
|
+
};
|
|
37
|
+
(0, react_1.useEffect)(() => {
|
|
38
|
+
handleShowClearButton(defaultValue || value);
|
|
39
|
+
}, [value, defaultValue]);
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)(className), ref: rootRef, children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative flex items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 shrink-0 text-gray-500 duration-200 ", children: (0, jsx_runtime_1.jsx)(solid_1.MagnifyingGlassIcon, { className: "w-4 h-4 text-gray-500" }) }), (0, jsx_runtime_1.jsx)("input", { disabled: disabled, type: type, ref: ref, className: (0, utils_1.cn)("mobase-text-input-box text-gray-900 h-10 bg-white w-full transition-all text-sm rounded-md border border-gray-400 placeholder:text-gray-500 px-9 focus:border-pink-500 disabled:bg-gray-50 disabled:border-gray-300 disabled:pointer-events-none block disabled:opacity-50", inputClassName), onChange: onChangeFactory, onFocus: onFocusFactory, value: value, defaultValue: defaultValue, ...restProps }), clearable && ((0, jsx_runtime_1.jsx)("button", { "aria-label": "button", type: "button", className: "absolute right-3 top-1/2 -translate-y-1/2 shrink-0 cursor-pointer text-gray-500 duration-200 hover:opacity-70 disabled:pointer-events-none", disabled: disabled, onClick: handleClear, children: (0, jsx_runtime_1.jsx)(outline_1.XCircleIcon, { strokeWidth: 2, width: 20, height: 20 }) }))] }), (0, jsx_runtime_1.jsx)("style", { children: `
|
|
41
|
+
.mobase-text-input-box:hover {
|
|
42
|
+
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-gray-400) / 1) inset;
|
|
43
|
+
}
|
|
44
|
+
.mobase-text-input-box:focus {
|
|
45
|
+
box-shadow: 0px 0px 0px 1px rgb(var(--mobase-pink-500) / 1) inset;
|
|
46
|
+
}
|
|
47
|
+
` })] }));
|
|
48
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchBar = void 0;
|
|
4
|
+
var SearchBar_1 = require("./SearchBar");
|
|
5
|
+
Object.defineProperty(exports, "SearchBar", { enumerable: true, get: function () { return SearchBar_1.SearchBar; } });
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.textButtonVariants = exports.TextButton = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const React = __importStar(require("react"));
|
|
29
|
+
const react_slot_1 = require("@radix-ui/react-slot");
|
|
30
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
31
|
+
const utils_1 = require("../../helpers/utils");
|
|
32
|
+
// /dwd
|
|
33
|
+
const textButtonVariants = (0, class_variance_authority_1.cva)("inline-flex items-center justify-center whitespace-nowrap font-semibold transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed border border-transparent flex-nowrap", {
|
|
34
|
+
variants: {
|
|
35
|
+
/**
|
|
36
|
+
* Determines style variation of Button component.
|
|
37
|
+
*/
|
|
38
|
+
variant: {
|
|
39
|
+
default: "text-blue-700 hover:underline hover:bg-blue-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline",
|
|
40
|
+
primary: "text-pink-500 hover:underline hover:bg-pink-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline",
|
|
41
|
+
secondary: "text-gray-700 hover:underline hover:text-blue-700 hover:bg-blue-50 disabled:bg-transparent disabled:text-gray-400 disabled:no-underline",
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* Determines size variation of Button component.
|
|
45
|
+
*/
|
|
46
|
+
size: {
|
|
47
|
+
default: "text-sm",
|
|
48
|
+
lg: "text-base",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: "default",
|
|
53
|
+
size: "default",
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
exports.textButtonVariants = textButtonVariants;
|
|
57
|
+
const TextButton = React.forwardRef(({ className, variant = "default", size = "default", asChild = false, isDisabled = false, ...props }, ref) => {
|
|
58
|
+
const Comp = asChild ? react_slot_1.Slot : "button";
|
|
59
|
+
const buttonClassName = (0, utils_1.cn)(textButtonVariants({ variant, size, className }));
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)(Comp, { className: buttonClassName, disabled: isDisabled, ref: ref, ...props, children: props.children }));
|
|
61
|
+
});
|
|
62
|
+
exports.TextButton = TextButton;
|
|
63
|
+
TextButton.displayName = "TextButton";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextButton = void 0;
|
|
4
|
+
var TextButton_1 = require("./TextButton");
|
|
5
|
+
Object.defineProperty(exports, "TextButton", { enumerable: true, get: function () { return TextButton_1.TextButton; } });
|
|
@@ -28,36 +28,37 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
28
28
|
const React = __importStar(require("react"));
|
|
29
29
|
const ToastPrimitives = __importStar(require("@radix-ui/react-toast"));
|
|
30
30
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
31
|
-
const lucide_react_1 = require("lucide-react");
|
|
32
31
|
const utils_1 = require("../../helpers/utils");
|
|
32
|
+
const solid_1 = require("@heroicons/react/20/solid");
|
|
33
33
|
const ToastProvider = ToastPrimitives.Provider;
|
|
34
34
|
exports.ToastProvider = ToastProvider;
|
|
35
|
-
const ToastViewport = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Viewport, { ref: ref, className: (0, utils_1.cn)("fixed
|
|
35
|
+
const ToastViewport = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Viewport, { ref: ref, className: (0, utils_1.cn)("fixed bottom-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 left-0 sm:right-0 sm:left-auto sm:top-0 sm:bottom-auto sm:flex-col md:max-w-[420px]", className), ...props })));
|
|
36
36
|
exports.ToastViewport = ToastViewport;
|
|
37
37
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
38
|
-
const toastVariants = (0, class_variance_authority_1.cva)("group pointer-events-auto relative
|
|
38
|
+
const toastVariants = (0, class_variance_authority_1.cva)("group pointer-events-auto relative w-full overflow-hidden rounded-md border py-4 pr-10 pl-10 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-bottom-full data-[state=open]:sm:slide-in-from-top-full bg-white text-gray-900 border border-gray-200 border-l-4", {
|
|
39
39
|
variants: {
|
|
40
40
|
variant: {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
sucess: "border-l-green-500",
|
|
42
|
+
warning: "border-l-yellow-500",
|
|
43
|
+
error: "border-l-red-500",
|
|
43
44
|
},
|
|
44
45
|
},
|
|
45
46
|
defaultVariants: {
|
|
46
|
-
variant: "
|
|
47
|
+
variant: "sucess",
|
|
47
48
|
},
|
|
48
49
|
});
|
|
49
|
-
const Toast = React.forwardRef(({ className, variant, ...props }, ref) => {
|
|
50
|
-
return ((0, jsx_runtime_1.
|
|
50
|
+
const Toast = React.forwardRef(({ className, variant = "sucess", children, ...props }, ref) => {
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)(ToastPrimitives.Root, { ref: ref, className: (0, utils_1.cn)(toastVariants({ variant }), className), ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "w-5 h-5 flex items-center justify-center absolute top-4 left-3", children: [variant === "sucess" && ((0, jsx_runtime_1.jsx)(solid_1.CheckCircleIcon, { className: "w-5 h-5 text-green-500" })), variant === "warning" && ((0, jsx_runtime_1.jsx)(solid_1.ExclamationTriangleIcon, { className: "w-5 h-5 text-yellow-500" })), variant === "error" && ((0, jsx_runtime_1.jsx)(solid_1.InformationCircleIcon, { className: "w-5 h-5 text-red-500" }))] }), children] }));
|
|
51
52
|
});
|
|
52
53
|
exports.Toast = Toast;
|
|
53
54
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
54
|
-
const ToastAction = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Action, { ref: ref, className: (0, utils_1.cn)("inline-flex
|
|
55
|
+
const ToastAction = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Action, { ref: ref, className: (0, utils_1.cn)("inline-flex shrink-0 items-center justify-center bg-transparent text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-0 focus:ring-ring focus:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 text-blue-600 hover:underline mt-2", className), ...props })));
|
|
55
56
|
exports.ToastAction = ToastAction;
|
|
56
57
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
57
|
-
const ToastClose = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Close, { ref: ref, className: (0, utils_1.cn)("absolute right-2 top-2 rounded-md
|
|
58
|
+
const ToastClose = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Close, { ref: ref, className: (0, utils_1.cn)("absolute right-2 top-2 rounded-md transition-opacity hover:opacity-70 focus:opacity-100 focus:outline-none focus:ring-2 text-gray-800 w-8 h-8 flex items-center justify-center", className), "toast-close": "", ...props, children: (0, jsx_runtime_1.jsx)(solid_1.XMarkIcon, { className: "h-5 w-5" }) })));
|
|
58
59
|
exports.ToastClose = ToastClose;
|
|
59
60
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
60
|
-
const ToastTitle = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Title, { ref: ref, className: (0, utils_1.cn)("text-
|
|
61
|
+
const ToastTitle = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Title, { ref: ref, className: (0, utils_1.cn)("text-base font-semibold leading-tight", className), ...props })));
|
|
61
62
|
exports.ToastTitle = ToastTitle;
|
|
62
63
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
63
64
|
const ToastDescription = React.forwardRef(({ className, ...props }, ref) => ((0, jsx_runtime_1.jsx)(ToastPrimitives.Description, { ref: ref, className: (0, utils_1.cn)("text-sm opacity-90", className), ...props })));
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Toaster = exports.toast = exports.useToast =
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
Object.defineProperty(exports, "Toast", { enumerable: true, get: function () { return Toast_1.Toast; } });
|
|
8
|
-
Object.defineProperty(exports, "ToastTitle", { enumerable: true, get: function () { return Toast_1.ToastTitle; } });
|
|
9
|
-
Object.defineProperty(exports, "ToastDescription", { enumerable: true, get: function () { return Toast_1.ToastDescription; } });
|
|
10
|
-
Object.defineProperty(exports, "ToastClose", { enumerable: true, get: function () { return Toast_1.ToastClose; } });
|
|
11
|
-
Object.defineProperty(exports, "ToastAction", { enumerable: true, get: function () { return Toast_1.ToastAction; } });
|
|
12
|
-
var use_toast_1 = require("./use-toast");
|
|
13
|
-
Object.defineProperty(exports, "useToast", { enumerable: true, get: function () { return use_toast_1.useToast; } });
|
|
14
|
-
Object.defineProperty(exports, "toast", { enumerable: true, get: function () { return use_toast_1.toast; } });
|
|
3
|
+
exports.Toaster = exports.toast = exports.useToast = void 0;
|
|
4
|
+
var useToast_1 = require("./useToast");
|
|
5
|
+
Object.defineProperty(exports, "useToast", { enumerable: true, get: function () { return useToast_1.useToast; } });
|
|
6
|
+
Object.defineProperty(exports, "toast", { enumerable: true, get: function () { return useToast_1.toast; } });
|
|
15
7
|
var toaster_1 = require("./toaster");
|
|
16
8
|
Object.defineProperty(exports, "Toaster", { enumerable: true, get: function () { return toaster_1.Toaster; } });
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Toaster = void 0;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const Toast_1 = require("
|
|
7
|
-
const
|
|
6
|
+
const Toast_1 = require("./Toast");
|
|
7
|
+
const useToast_1 = require("./useToast");
|
|
8
8
|
function Toaster() {
|
|
9
|
-
const { toasts } = (0,
|
|
9
|
+
const { toasts } = (0, useToast_1.useToast)();
|
|
10
10
|
return ((0, jsx_runtime_1.jsxs)(Toast_1.ToastProvider, { children: [toasts.map(function ({ id, title, description, action, ...props }) {
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)(Toast_1.Toast, { ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid gap-
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(Toast_1.Toast, { ...props, children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid gap-2", children: [title && (0, jsx_runtime_1.jsx)(Toast_1.ToastTitle, { children: title }), description && ((0, jsx_runtime_1.jsx)(Toast_1.ToastDescription, { children: description }))] }), action, (0, jsx_runtime_1.jsx)(Toast_1.ToastClose, {})] }, id));
|
|
12
12
|
}), (0, jsx_runtime_1.jsx)(Toast_1.ToastViewport, {})] }));
|
|
13
13
|
}
|
|
14
14
|
exports.Toaster = Toaster;
|
|
@@ -48,7 +48,7 @@ const addToRemoveQueue = (toastId) => {
|
|
|
48
48
|
toastTimeouts.delete(toastId);
|
|
49
49
|
dispatch({
|
|
50
50
|
type: "REMOVE_TOAST",
|
|
51
|
-
toastId
|
|
51
|
+
toastId,
|
|
52
52
|
});
|
|
53
53
|
}, TOAST_REMOVE_DELAY);
|
|
54
54
|
toastTimeouts.set(toastId, timeout);
|
|
@@ -98,6 +98,8 @@ const reducer = (state, action) => {
|
|
|
98
98
|
...state,
|
|
99
99
|
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
|
100
100
|
};
|
|
101
|
+
default:
|
|
102
|
+
return state;
|
|
101
103
|
}
|
|
102
104
|
};
|
|
103
105
|
exports.reducer = reducer;
|
|
@@ -129,7 +131,7 @@ function toast({ ...props }) {
|
|
|
129
131
|
},
|
|
130
132
|
});
|
|
131
133
|
return {
|
|
132
|
-
id
|
|
134
|
+
id,
|
|
133
135
|
dismiss,
|
|
134
136
|
update,
|
|
135
137
|
};
|
package/publish/cjs/index.js
CHANGED
|
@@ -19,12 +19,15 @@ __exportStar(require("./components/Breadcrumb"), exports);
|
|
|
19
19
|
__exportStar(require("./components/Button"), exports);
|
|
20
20
|
__exportStar(require("./components/Checkbox"), exports);
|
|
21
21
|
__exportStar(require("./components/Dialog"), exports);
|
|
22
|
+
__exportStar(require("./components/DialogQr"), exports);
|
|
22
23
|
__exportStar(require("./components/AlertDialog"), exports);
|
|
23
24
|
__exportStar(require("./components/IconButton"), exports);
|
|
24
25
|
__exportStar(require("./components/Pagination"), exports);
|
|
25
26
|
__exportStar(require("./components/Popover"), exports);
|
|
26
27
|
__exportStar(require("./components/Tabs"), exports);
|
|
27
28
|
__exportStar(require("./components/TextArea"), exports);
|
|
29
|
+
__exportStar(require("./components/Toast"), exports);
|
|
30
|
+
__exportStar(require("./components/TextButton"), exports);
|
|
28
31
|
__exportStar(require("./components/Tooltip"), exports);
|
|
29
32
|
__exportStar(require("./components/TextInput"), exports);
|
|
30
33
|
__exportStar(require("./components/Stepper"), exports);
|
|
@@ -37,5 +40,7 @@ __exportStar(require("./components/Footer"), exports);
|
|
|
37
40
|
__exportStar(require("./components/Card"), exports);
|
|
38
41
|
__exportStar(require("./components/Command"), exports);
|
|
39
42
|
__exportStar(require("./components/Combobox"), exports);
|
|
43
|
+
__exportStar(require("./components/Callout"), exports);
|
|
44
|
+
__exportStar(require("./components/SearchBar"), exports);
|
|
40
45
|
__exportStar(require("./mobase-tw-plugin"), exports);
|
|
41
46
|
__exportStar(require("./site"), exports);
|