tek-wallet 0.0.121 → 0.0.123

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.
@@ -9,7 +9,6 @@ export type ChildPageLayoutRef = {
9
9
  showLoading: () => void;
10
10
  showSuccess: () => void;
11
11
  showError: () => void;
12
- showWarning: () => void;
13
12
  };
14
13
  declare const ChildPageLayout: import("react").ForwardRefExoticComponent<ChildPageLayoutProps & import("react").RefAttributes<ChildPageLayoutRef>>;
15
14
  export default ChildPageLayout;
@@ -37,9 +37,6 @@ var ChildPageLayout = (0, react_1.forwardRef)(function (props, ref) {
37
37
  showError: function () {
38
38
  setStatus(StatusDisplay_1.StatusDisplayType.Error);
39
39
  },
40
- showWarning: function () {
41
- setStatus(StatusDisplay_1.StatusDisplayType.Warning);
42
- },
43
40
  };
44
41
  });
45
42
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", backgroundImage: "url(".concat((0, getImage_1.default)("main_bg", "jpg"), ")"), backgroundSize: "cover", backgroundPosition: "center", backgroundRepeat: "no-repeat", height: "100dvh", width: "100vw" }, sx), children: [header && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
@@ -22,6 +22,7 @@ var Text_1 = __importDefault(require("../Text"));
22
22
  var material_1 = require("@mui/material");
23
23
  var BackHeader = function (props) {
24
24
  var router = (0, useCustomRouter_1.default)();
25
+ var theme = (0, material_1.useTheme)();
25
26
  var center = props.center, children = props.children, hideBack = props.hideBack;
26
27
  var back = function (e) {
27
28
  if (props.overrideBack) {
@@ -35,11 +36,6 @@ var BackHeader = function (props) {
35
36
  alignItems: "center",
36
37
  gap: "0.5rem",
37
38
  cursor: "pointer",
38
- }, onClick: back, children: [(0, jsx_runtime_1.jsx)(BackArrow_1.default, {}), " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { color: "whiteText.main" }, children: "Back" })] })), !!center && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
39
- position: "absolute",
40
- left: "50%",
41
- top: "50%",
42
- transform: "translate(-50%, -50%)",
43
- }, children: center })), children] }));
39
+ }, onClick: back, children: [(0, jsx_runtime_1.jsx)(BackArrow_1.default, {}), " ", (0, jsx_runtime_1.jsx)(Text_1.default, { sx: { color: theme.palette.text.white }, children: "Back" })] })), !!center && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign({}, theme.mixins.center), children: center })), children] }));
44
40
  };
45
41
  exports.default = BackHeader;
@@ -46,7 +46,7 @@ Button.Primary.displayName = "Button.Primary";
46
46
  Button.Secondary = function (props) {
47
47
  var sx = props.sx, rest = __rest(props, ["sx"]);
48
48
  var theme = (0, material_1.useTheme)();
49
- return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "contained", color: "secondary", sx: __assign({ borderRadius: theme.mixins.theBorderRadius.full }, sx) })));
49
+ return ((0, jsx_runtime_1.jsx)(Button, __assign({}, rest, { variant: "outlined", color: "secondary", sx: __assign({ borderRadius: theme.mixins.theBorderRadius.full }, sx) })));
50
50
  };
51
51
  Button.Secondary.displayName = "Button.Secondary";
52
52
  exports.default = Button;
@@ -21,6 +21,6 @@ var BackHeader_1 = __importDefault(require("../BackHeader"));
21
21
  var Text_1 = __importDefault(require("../Text"));
22
22
  var PageHeader = function (props) {
23
23
  var theme = (0, material_1.useTheme)();
24
- return ((0, jsx_runtime_1.jsx)(BackHeader_1.default, { overrideBack: props.overrideBack, sx: __assign({ display: "flex", alignItems: "center", height: "100%", position: "relative", paddingLeft: theme.mixins.pagePadding.paddingLeft, paddingRight: theme.mixins.pagePadding.paddingRight }, props.sx), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.headerTitle), { position: "absolute", left: "50%", top: "50%", transform: "translate(-50%, -50%)" }), children: props.title }) }));
24
+ return ((0, jsx_runtime_1.jsx)(BackHeader_1.default, { overrideBack: props.overrideBack, sx: __assign({ display: "flex", alignItems: "center", height: "100%", position: "relative", paddingLeft: theme.mixins.pagePadding.paddingLeft, paddingRight: theme.mixins.pagePadding.paddingRight }, props.sx), children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.headerTitle), theme.mixins.center), children: props.title }) }));
25
25
  };
26
26
  exports.default = PageHeader;
@@ -5,8 +5,6 @@ interface StatusDisplayProps {
5
5
  export declare enum StatusDisplayType {
6
6
  Success = "success",
7
7
  Error = "error",
8
- Warning = "warning",
9
- Info = "info",
10
8
  Loading = "loading",
11
9
  Normal = "normal"
12
10
  }
@@ -9,22 +9,25 @@ var cn_1 = __importDefault(require("../../../utils/cn"));
9
9
  var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
10
10
  var Image_1 = __importDefault(require("../Image"));
11
11
  var Text_1 = __importDefault(require("../Text"));
12
- var clsx_1 = __importDefault(require("clsx"));
12
+ var material_1 = require("@mui/material");
13
13
  var StatusDisplayType;
14
14
  (function (StatusDisplayType) {
15
15
  StatusDisplayType["Success"] = "success";
16
16
  StatusDisplayType["Error"] = "error";
17
- StatusDisplayType["Warning"] = "warning";
18
- StatusDisplayType["Info"] = "info";
19
17
  StatusDisplayType["Loading"] = "loading";
20
18
  StatusDisplayType["Normal"] = "normal";
21
19
  })(StatusDisplayType || (exports.StatusDisplayType = StatusDisplayType = {}));
22
20
  var StatusDisplay = function (props) {
23
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.default)("flex items-center gap-1", props.className), children: [(0, jsx_runtime_1.jsx)(Image_1.default, { src: (0, getIcon_1.default)("status_".concat(props.status), "gif"), sx: { width: "1.5rem", height: "1.5rem" } }), (0, jsx_runtime_1.jsx)(Text_1.default, { className: (0, clsx_1.default)("text-13", {
24
- "text-ui-text-error": props.status === StatusDisplayType.Error,
25
- "text-ui-text-warning": props.status === StatusDisplayType.Warning,
26
- "text-ui-text-success": props.status === StatusDisplayType.Success,
27
- "text-ui-text-loading": props.status === StatusDisplayType.Loading,
28
- }), children: props.status })] }));
21
+ var _a;
22
+ var theme = (0, material_1.useTheme)();
23
+ var statusColor = (_a = {},
24
+ _a[StatusDisplayType.Success] = theme.palette.text.successStatus,
25
+ _a[StatusDisplayType.Error] = theme.palette.text.errorStatus,
26
+ _a[StatusDisplayType.Loading] = theme.palette.text.loadingStatus,
27
+ _a[StatusDisplayType.Normal] = theme.palette.text.white,
28
+ _a);
29
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.default)("flex items-center gap-1", props.className), children: [(0, jsx_runtime_1.jsx)(Image_1.default, { src: (0, getIcon_1.default)("status_".concat(props.status), "gif"), sx: { width: "1.5rem", height: "1.5rem" } }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
30
+ color: statusColor[props.status],
31
+ }, children: props.status })] }));
29
32
  };
30
33
  exports.default = StatusDisplay;
@@ -73,14 +73,7 @@ var AuthView = function (props) {
73
73
  var _a;
74
74
  (_a = importWalletDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
75
75
  };
76
- return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Connect Wallet", overrideBack: props.onBack }), children: (0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem" }, props.sx), children: [(0, jsx_runtime_1.jsx)(Image_1.default, { src: (0, getIcon_1.default)("eth"), sx: {
77
- width: "80%",
78
- aspectRatio: "1",
79
- position: "fixed",
80
- top: "50%",
81
- left: "50%",
82
- transform: "translate(-50%, -50%)",
83
- } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
76
+ return ((0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { title: "Connect Wallet", overrideBack: props.onBack }), children: (0, jsx_runtime_1.jsxs)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem" }, props.sx), children: [(0, jsx_runtime_1.jsx)(Image_1.default, { src: (0, getIcon_1.default)("eth"), sx: __assign(__assign({ width: "80%", aspectRatio: "1" }, theme.mixins.center), { position: "fixed" }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
84
77
  display: "flex",
85
78
  flexDirection: "column",
86
79
  gap: "1rem",
@@ -5,13 +5,11 @@ var theme = (0, styles_1.createTheme)({
5
5
  palette: {
6
6
  primary: {
7
7
  main: "#ffffff",
8
- light: "rgba(255, 255, 255, 0.64)",
9
- dark: "rgba(255, 255, 255, 0.24)",
10
- contrastText: "#ff0000",
8
+ contrastText: "#000000",
11
9
  },
12
10
  secondary: {
13
- main: "#01FF00",
14
- contrastText: "#0000ff",
11
+ main: "#01FFFF29",
12
+ contrastText: "#01FFFF",
15
13
  },
16
14
  background: {
17
15
  white: "#ffffff",
@@ -27,6 +25,9 @@ var theme = (0, styles_1.createTheme)({
27
25
  white: "#ffffff",
28
26
  white64: "rgba(255, 255, 255, 0.64)",
29
27
  white24: "rgba(255, 255, 255, 0.24)",
28
+ successStatus: "#01FF00",
29
+ errorStatus: "#FE6565",
30
+ loadingStatus: "#01FFFF",
30
31
  },
31
32
  divider: "rgba(255, 255, 255, 0.16)",
32
33
  },
@@ -83,7 +84,13 @@ var theme = (0, styles_1.createTheme)({
83
84
  fontSize: "0.75rem",
84
85
  },
85
86
  theBorderRadius: {
86
- full: "100%",
87
+ full: "999px",
88
+ },
89
+ center: {
90
+ position: "absolute",
91
+ left: "50%",
92
+ top: "50%",
93
+ transform: "translate(-50%, -50%)",
87
94
  },
88
95
  },
89
96
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.121",
3
+ "version": "0.0.123",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,15 +0,0 @@
1
- import { GeneralProps } from "../../../types/ui";
2
- interface PageLayoutProps extends GeneralProps {
3
- header?: React.ReactNode;
4
- footer?: React.ReactNode;
5
- fullScreen?: boolean;
6
- }
7
- export type PageLayoutRef = {
8
- showNormal: () => void;
9
- showLoading: () => void;
10
- showSuccess: () => void;
11
- showError: () => void;
12
- showWarning: () => void;
13
- };
14
- declare const PageLayout: import("react").ForwardRefExoticComponent<PageLayoutProps & import("react").RefAttributes<PageLayoutRef>>;
15
- export default PageLayout;
@@ -1,84 +0,0 @@
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 react_1 = require("react");
19
- var StatusDisplay_1 = require("../../../components/ui/StatusDisplay");
20
- var StatusDisplay_2 = __importDefault(require("../../../components/ui/StatusDisplay"));
21
- var system_1 = require("@mui/system");
22
- var StyledPageLayout = (0, system_1.styled)("div")(function () { return ({
23
- height: "100%",
24
- width: "100%",
25
- position: "relative",
26
- }); });
27
- var StyledHeader = (0, system_1.styled)("div")(function () { return ({
28
- height: "3.125rem",
29
- width: "100%",
30
- position: "absolute",
31
- top: 0,
32
- left: 0,
33
- zIndex: 50,
34
- }); });
35
- var StyledContent = (0, system_1.styled)("div")(function (_a) {
36
- var hasHeader = _a.hasHeader, fullScreen = _a.fullScreen;
37
- return (__assign({ height: "100%", width: "100%", overflowX: "hidden", overflowY: "auto" }, (hasHeader &&
38
- !fullScreen && {
39
- paddingTop: "3.125rem",
40
- })));
41
- });
42
- var StyledFooter = (0, system_1.styled)("div")(function () { return ({
43
- height: "3rem",
44
- width: "100%",
45
- position: "absolute",
46
- bottom: 0,
47
- left: 0,
48
- zIndex: 50,
49
- }); });
50
- var StyledStatusOverlay = (0, system_1.styled)("div")(function () { return ({
51
- position: "absolute",
52
- inset: 0,
53
- display: "flex",
54
- alignItems: "center",
55
- justifyContent: "center",
56
- backgroundColor: "whiteText.main",
57
- zIndex: 50,
58
- }); });
59
- var PageLayout = (0, react_1.forwardRef)(function (props, ref) {
60
- var header = props.header, footer = props.footer, fullScreen = props.fullScreen, children = props.children, sx = props.sx;
61
- var _a = (0, react_1.useState)(StatusDisplay_1.StatusDisplayType.Normal), status = _a[0], setStatus = _a[1];
62
- (0, react_1.useImperativeHandle)(ref, function () {
63
- return {
64
- showNormal: function () {
65
- setStatus(StatusDisplay_1.StatusDisplayType.Normal);
66
- },
67
- showLoading: function () {
68
- setStatus(StatusDisplay_1.StatusDisplayType.Loading);
69
- },
70
- showSuccess: function () {
71
- setStatus(StatusDisplay_1.StatusDisplayType.Success);
72
- },
73
- showError: function () {
74
- setStatus(StatusDisplay_1.StatusDisplayType.Error);
75
- },
76
- showWarning: function () {
77
- setStatus(StatusDisplay_1.StatusDisplayType.Warning);
78
- },
79
- };
80
- });
81
- return ((0, jsx_runtime_1.jsxs)(StyledPageLayout, { sx: sx, children: [header && (0, jsx_runtime_1.jsx)(StyledHeader, { children: header }), (0, jsx_runtime_1.jsx)(StyledContent, { hasHeader: !!header, fullScreen: fullScreen, children: children }), footer && (0, jsx_runtime_1.jsx)(StyledFooter, { children: footer }), status !== StatusDisplay_1.StatusDisplayType.Normal && ((0, jsx_runtime_1.jsx)(StyledStatusOverlay, { children: (0, jsx_runtime_1.jsx)(StatusDisplay_2.default, { status: status }) }))] }));
82
- });
83
- PageLayout.displayName = "PageLayout";
84
- exports.default = PageLayout;