tek-wallet 0.0.156 → 0.0.157
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/dist/components/ui/ConfirmByPasscode/index.d.ts +9 -0
- package/dist/components/ui/ConfirmByPasscode/index.js +143 -0
- package/dist/components/ui/ConfirmLayout/index.d.ts +8 -0
- package/dist/components/ui/ConfirmLayout/index.js +31 -0
- package/dist/components/ui/ConfirmLayout/type.d.ts +5 -0
- package/dist/components/ui/ConfirmLayout/type.js +9 -0
- package/dist/components/ui/DrawerComponent/index.d.ts +4 -5
- package/dist/components/ui/LineValue/index.d.ts +9 -0
- package/dist/components/ui/LineValue/index.js +26 -0
- package/dist/components/ui/LoadingLayout/index.d.ts +11 -0
- package/dist/components/ui/LoadingLayout/index.js +36 -0
- package/dist/components/ui/LockToken/index.d.ts +8 -0
- package/dist/components/ui/LockToken/index.js +34 -0
- package/dist/components/ui/LockToken/type.d.ts +4 -0
- package/dist/components/ui/LockToken/type.js +2 -0
- package/dist/components/ui/Text/index.js +3 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/theme/mui/theme.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
import { ActionConfirm } from "../ConfirmLayout/type";
|
|
3
|
+
import { DrawerComponentProps, DrawerComponentRef } from "../DrawerComponent";
|
|
4
|
+
interface ConfirmByPasscodeProps extends GeneralProps, DrawerComponentProps {
|
|
5
|
+
onConfirmSuccess?: (value: string) => any;
|
|
6
|
+
action: ActionConfirm;
|
|
7
|
+
}
|
|
8
|
+
declare const ConfirmByPasscode: import("react").ForwardRefExoticComponent<ConfirmByPasscodeProps & import("react").RefAttributes<DrawerComponentRef>>;
|
|
9
|
+
export default ConfirmByPasscode;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
48
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
49
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
50
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
51
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
52
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
53
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
57
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
58
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
59
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
60
|
+
function step(op) {
|
|
61
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
62
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
63
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
64
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
65
|
+
switch (op[0]) {
|
|
66
|
+
case 0: case 1: t = op; break;
|
|
67
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
68
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
69
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
70
|
+
default:
|
|
71
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
72
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
73
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
74
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
75
|
+
if (t[2]) _.ops.pop();
|
|
76
|
+
_.trys.pop(); continue;
|
|
77
|
+
}
|
|
78
|
+
op = body.call(thisArg, _);
|
|
79
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
80
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
84
|
+
var t = {};
|
|
85
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
86
|
+
t[p] = s[p];
|
|
87
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
88
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
89
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
90
|
+
t[p[i]] = s[p[i]];
|
|
91
|
+
}
|
|
92
|
+
return t;
|
|
93
|
+
};
|
|
94
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
95
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
96
|
+
};
|
|
97
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
98
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
99
|
+
var OTP_1 = __importStar(require("../../../components/ui/OTP"));
|
|
100
|
+
var react_1 = require("react");
|
|
101
|
+
var Text_1 = __importDefault(require("../../../components/ui/Text"));
|
|
102
|
+
var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
103
|
+
var ModalLayout_1 = __importDefault(require("../ModalLayout"));
|
|
104
|
+
var material_1 = require("@mui/material");
|
|
105
|
+
var LoadingLayout_1 = __importDefault(require("../LoadingLayout"));
|
|
106
|
+
var passcodeLength = 6;
|
|
107
|
+
var ConfirmByPasscode = (0, react_1.forwardRef)(function (props, ref) {
|
|
108
|
+
var action = props.action, onConfirmSuccess = props.onConfirmSuccess, onClose = props.onClose, rest = __rest(props, ["action", "onConfirmSuccess", "onClose"]);
|
|
109
|
+
var theme = (0, material_1.useTheme)();
|
|
110
|
+
var _a = (0, react_1.useState)(""), otp = _a[0], setOtp = _a[1];
|
|
111
|
+
var loadingRef = (0, react_1.useRef)(null);
|
|
112
|
+
var resetValue = function () {
|
|
113
|
+
setOtp("");
|
|
114
|
+
};
|
|
115
|
+
var handleClose = function () {
|
|
116
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
117
|
+
resetValue();
|
|
118
|
+
};
|
|
119
|
+
var handleOtpChange = function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
return __generator(this, function (_c) {
|
|
122
|
+
switch (_c.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
setOtp(value);
|
|
125
|
+
if (!(value.length === passcodeLength)) return [3 /*break*/, 2];
|
|
126
|
+
(_a = loadingRef.current) === null || _a === void 0 ? void 0 : _a.startLoading();
|
|
127
|
+
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
|
|
128
|
+
case 1:
|
|
129
|
+
_c.sent();
|
|
130
|
+
onConfirmSuccess === null || onConfirmSuccess === void 0 ? void 0 : onConfirmSuccess(value);
|
|
131
|
+
(_b = loadingRef.current) === null || _b === void 0 ? void 0 : _b.endLoading();
|
|
132
|
+
if (ref && typeof ref !== "function" && ref.current) {
|
|
133
|
+
ref.current.close();
|
|
134
|
+
}
|
|
135
|
+
_c.label = 2;
|
|
136
|
+
case 2: return [2 /*return*/];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}); };
|
|
140
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, __assign({ ref: ref }, rest, { onClose: handleClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { title: "Confirm", children: (0, jsx_runtime_1.jsx)(LoadingLayout_1.default, { initLoading: false, ref: loadingRef, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { justifyContent: "center", alignItems: "center", gap: "1rem", height: "100%" }), children: [(0, jsx_runtime_1.jsxs)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: ["Enter your passcode to confirm", " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { fontWeight: theme.typography.fontWeight600 }, children: action })] }), (0, jsx_runtime_1.jsx)(OTP_1.default, { value: otp, onChange: handleOtpChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD })] }) }) }) })));
|
|
141
|
+
});
|
|
142
|
+
ConfirmByPasscode.displayName = "ConfirmByPasscode";
|
|
143
|
+
exports.default = ConfirmByPasscode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
import { DrawerComponentProps, DrawerComponentRef } from "../DrawerComponent";
|
|
3
|
+
import { ActionConfirm } from "./type";
|
|
4
|
+
export interface ConfirmLayoutProps extends GeneralProps, DrawerComponentProps {
|
|
5
|
+
action: ActionConfirm;
|
|
6
|
+
}
|
|
7
|
+
declare const ConfirmLayout: import("react").ForwardRefExoticComponent<ConfirmLayoutProps & import("react").RefAttributes<DrawerComponentRef>>;
|
|
8
|
+
export default ConfirmLayout;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
20
|
+
var material_1 = require("@mui/material");
|
|
21
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
22
|
+
var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
|
|
23
|
+
var ModalLayout_1 = __importDefault(require("../ModalLayout"));
|
|
24
|
+
var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
25
|
+
var react_1 = require("react");
|
|
26
|
+
var ConfirmLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
27
|
+
var theme = (0, material_1.useTheme)();
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: ref, trigger: props.trigger, onOpen: props.onOpen, onClose: props.onClose, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { alignItems: "center", gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12 }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { width: 64, sx: {}, src: (0, getIcon_1.default)("wallet_logo") }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: "Confirm action" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: props.action })] }), props.children] }) }) }));
|
|
29
|
+
});
|
|
30
|
+
ConfirmLayout.displayName = "ConfirmLayout";
|
|
31
|
+
exports.default = ConfirmLayout;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionConfirm = void 0;
|
|
4
|
+
var ActionConfirm;
|
|
5
|
+
(function (ActionConfirm) {
|
|
6
|
+
ActionConfirm["WITHDRAW"] = "withdraw";
|
|
7
|
+
ActionConfirm["TRANSFER"] = "transfer";
|
|
8
|
+
ActionConfirm["LOCK"] = "lock";
|
|
9
|
+
})(ActionConfirm || (exports.ActionConfirm = ActionConfirm = {}));
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { GeneralProps } from "../../../types/ui";
|
|
2
|
-
import { ReactEventHandler } from "react";
|
|
1
|
+
import { GeneralProps, UnknownFunction } from "../../../types/ui";
|
|
3
2
|
export declare enum DRAWER_DIRECTION {
|
|
4
3
|
LEFT = "left",
|
|
5
4
|
RIGHT = "right"
|
|
6
5
|
}
|
|
7
|
-
interface DrawerComponentProps extends GeneralProps {
|
|
8
|
-
onOpen?:
|
|
9
|
-
onClose?:
|
|
6
|
+
export interface DrawerComponentProps extends GeneralProps {
|
|
7
|
+
onOpen?: UnknownFunction;
|
|
8
|
+
onClose?: UnknownFunction;
|
|
10
9
|
trigger?: React.ReactNode;
|
|
11
10
|
onToggle?: (status?: boolean) => unknown;
|
|
12
11
|
direction?: DRAWER_DIRECTION;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
interface LineValueProps extends GeneralProps {
|
|
4
|
+
field?: ReactNode;
|
|
5
|
+
value?: ReactNode;
|
|
6
|
+
valueDescription?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const LineValue: (props: LineValueProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default LineValue;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
20
|
+
var material_1 = require("@mui/material");
|
|
21
|
+
var LineValue = function (props) {
|
|
22
|
+
var theme = (0, material_1.useTheme)();
|
|
23
|
+
var field = props.field, value = props.value, valueDescription = props.valueDescription;
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.row), { alignItems: "start", gap: theme.mixins.gaps.g16 }), props.sx), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: field }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { alignItems: "end", gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: value }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: valueDescription })] })] }));
|
|
25
|
+
};
|
|
26
|
+
exports.default = LineValue;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
interface LoadingLayoutProps extends GeneralProps {
|
|
3
|
+
loadingMessage?: string;
|
|
4
|
+
initLoading?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface LoadingLayoutRef {
|
|
7
|
+
startLoading: () => void;
|
|
8
|
+
endLoading: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const LoadingLayout: import("react").ForwardRefExoticComponent<LoadingLayoutProps & import("react").RefAttributes<LoadingLayoutRef>>;
|
|
11
|
+
export default LoadingLayout;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var material_1 = require("@mui/material");
|
|
19
|
+
var Text_1 = __importDefault(require("../Text"));
|
|
20
|
+
var react_1 = require("react");
|
|
21
|
+
var LoadingLayout = (0, react_1.forwardRef)(function (props, ref) {
|
|
22
|
+
var _a = (0, react_1.useState)(props.initLoading), loading = _a[0], setLoading = _a[1];
|
|
23
|
+
var _b = props.loadingMessage, loadingMessage = _b === void 0 ? "Processing" : _b, children = props.children, sx = props.sx;
|
|
24
|
+
var theme = (0, material_1.useTheme)();
|
|
25
|
+
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
26
|
+
startLoading: function () {
|
|
27
|
+
setLoading(true);
|
|
28
|
+
},
|
|
29
|
+
endLoading: function () {
|
|
30
|
+
setLoading(false);
|
|
31
|
+
},
|
|
32
|
+
}); });
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({ position: "absolute", inset: 0, display: "flex", margin: "auto", color: "text.white" }, theme.mixins.whiteLoadingOverlay), { zIndex: 1000 }), children: loadingMessage }))] }));
|
|
34
|
+
});
|
|
35
|
+
LoadingLayout.displayName = "LoadingLayout";
|
|
36
|
+
exports.default = LoadingLayout;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GeneralProps } from "../../../types/ui";
|
|
2
|
+
import { ConfirmLayoutProps } from "../ConfirmLayout";
|
|
3
|
+
import { LockData } from "./type";
|
|
4
|
+
interface LockTokenProps extends GeneralProps, ConfirmLayoutProps {
|
|
5
|
+
lockData: LockData;
|
|
6
|
+
}
|
|
7
|
+
declare const LockToken: (props: LockTokenProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default LockToken;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var material_1 = require("@mui/material");
|
|
20
|
+
var Button_1 = __importDefault(require("../../ui/Button"));
|
|
21
|
+
var DrawerComponent_1 = __importDefault(require("../DrawerComponent"));
|
|
22
|
+
var ConfirmLayout_1 = __importDefault(require("../ConfirmLayout"));
|
|
23
|
+
var type_1 = require("../ConfirmLayout/type");
|
|
24
|
+
var LineValue_1 = __importDefault(require("../LineValue"));
|
|
25
|
+
var Formatter_1 = __importDefault(require("../Formatter"));
|
|
26
|
+
var ConfirmByPasscode_1 = __importDefault(require("../ConfirmByPasscode"));
|
|
27
|
+
var LockToken = function (props) {
|
|
28
|
+
var theme = (0, material_1.useTheme)();
|
|
29
|
+
var handleLockToken = function () {
|
|
30
|
+
console.warn("🚀 ~ handleLockToken ~ lockData:", props.lockData);
|
|
31
|
+
};
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ConfirmLayout_1.default, { action: type_1.ActionConfirm.LOCK, trigger: props.trigger, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16 }), children: [(0, jsx_runtime_1.jsx)(LineValue_1.default, { field: "Amount", value: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: props.lockData.amount, unit: props.lockData.tokenSlug }) }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: (0, jsx_runtime_1.jsx)(Button_1.default.Primary, { children: "Confirm" }), children: (0, jsx_runtime_1.jsx)(ConfirmByPasscode_1.default, { action: type_1.ActionConfirm.LOCK, onConfirmSuccess: handleLockToken }) })] }) }) }));
|
|
33
|
+
};
|
|
34
|
+
exports.default = LockToken;
|
|
@@ -24,11 +24,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
26
|
var react_1 = require("react");
|
|
27
|
-
var
|
|
28
|
-
var StyledText = (0, system_1.styled)("span")(function () { return ({}); });
|
|
27
|
+
var material_1 = require("@mui/material");
|
|
29
28
|
var Text = (0, react_1.forwardRef)(function (_a, ref) {
|
|
30
|
-
var children = _a.children, sx = _a.sx, rest = __rest(_a, ["children", "sx"]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
29
|
+
var children = _a.children, sx = _a.sx, tag = _a.tag, rest = __rest(_a, ["children", "sx", "tag"]);
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, __assign({ component: tag !== null && tag !== void 0 ? tag : "span", ref: ref, sx: sx }, rest, { children: children })));
|
|
32
31
|
});
|
|
33
32
|
Text.displayName = "Text";
|
|
34
33
|
exports.default = Text;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import tekWalletHandler from "./handlers";
|
|
|
3
3
|
import RequireConnect from "./components/ui/RequireConnect";
|
|
4
4
|
import GetWalletSeedPhrase from "./components/ui/GetWalletSeedPhrase";
|
|
5
5
|
import DepositFunction from "./components/ui/DepositFunction";
|
|
6
|
+
import LockToken from "./components/ui/LockToken";
|
|
6
7
|
import useWallet from "./hooks/useWallet";
|
|
7
8
|
export * from "./types/expose-type";
|
|
8
|
-
export { TekWalletProvider, tekWalletHandler, RequireConnect, GetWalletSeedPhrase, DepositFunction, useWallet, };
|
|
9
|
+
export { TekWalletProvider, tekWalletHandler, RequireConnect, GetWalletSeedPhrase, DepositFunction, useWallet, LockToken, };
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.useWallet = exports.DepositFunction = exports.GetWalletSeedPhrase = exports.RequireConnect = exports.tekWalletHandler = exports.TekWalletProvider = void 0;
|
|
20
|
+
exports.LockToken = exports.useWallet = exports.DepositFunction = exports.GetWalletSeedPhrase = exports.RequireConnect = exports.tekWalletHandler = exports.TekWalletProvider = void 0;
|
|
21
21
|
var TekWalletProvider_1 = __importDefault(require("./providers/TekWalletProvider"));
|
|
22
22
|
exports.TekWalletProvider = TekWalletProvider_1.default;
|
|
23
23
|
var handlers_1 = __importDefault(require("./handlers"));
|
|
@@ -28,6 +28,8 @@ var GetWalletSeedPhrase_1 = __importDefault(require("./components/ui/GetWalletSe
|
|
|
28
28
|
exports.GetWalletSeedPhrase = GetWalletSeedPhrase_1.default;
|
|
29
29
|
var DepositFunction_1 = __importDefault(require("./components/ui/DepositFunction"));
|
|
30
30
|
exports.DepositFunction = DepositFunction_1.default;
|
|
31
|
+
var LockToken_1 = __importDefault(require("./components/ui/LockToken"));
|
|
32
|
+
exports.LockToken = LockToken_1.default;
|
|
31
33
|
var useWallet_1 = __importDefault(require("./hooks/useWallet"));
|
|
32
34
|
exports.useWallet = useWallet_1.default;
|
|
33
35
|
__exportStar(require("./types/expose-type"), exports);
|
package/dist/theme/mui/theme.js
CHANGED
|
@@ -172,6 +172,16 @@ var theme = (0, styles_1.createTheme)({
|
|
|
172
172
|
fontSize: typography.fontSize12,
|
|
173
173
|
lineHeight: typography.leading140,
|
|
174
174
|
},
|
|
175
|
+
validationError: {
|
|
176
|
+
color: text.errorStatus,
|
|
177
|
+
fontWeight: typography.fontWeight400,
|
|
178
|
+
fontSize: typography.fontSize12,
|
|
179
|
+
lineHeight: typography.leading140,
|
|
180
|
+
},
|
|
181
|
+
whiteLoadingOverlay: {
|
|
182
|
+
backgroundColor: "background.white16",
|
|
183
|
+
backdropFilter: "blur(2px)",
|
|
184
|
+
},
|
|
175
185
|
},
|
|
176
186
|
});
|
|
177
187
|
exports.default = theme;
|