tek-wallet 0.0.480 → 0.0.482

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.
@@ -78,7 +78,7 @@ var Activities = (0, react_1.forwardRef)(function (props, ref) {
78
78
  spaceBetween: 40,
79
79
  }, tabs: activityTypes === null || activityTypes === void 0 ? void 0 : activityTypes.map(function (type, index) {
80
80
  return ((0, jsx_runtime_1.jsx)(material_1.Tab, { label: type.name, value: index, "data-index": index, sx: {
81
- padding: "".concat(theme.mixins.customPadding.p16, " ").concat(theme.mixins.customPadding.p8),
81
+ padding: "".concat(theme.mixins.customPadding.p8, " ").concat(theme.mixins.customPadding.p16),
82
82
  minHeight: "unset",
83
83
  minWidth: "unset",
84
84
  textTransform: "capitalize",
@@ -63,10 +63,10 @@ function ActivityDetail(props) {
63
63
  }, [isIncrease, theme]);
64
64
  if (!activityData)
65
65
  return null;
66
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_a = activityData.currency_data) === null || _a === void 0 ? void 0 : _a.link, width: 64 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g6, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, fontSize: theme.typography.fontSize24, color: getAmountColor() }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: (_b = activityData.currency_data) === null || _b === void 0 ? void 0 : _b.name }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, formatDate_1.default)(activityData.date_created) }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
66
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g16, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { src: (_a = activityData.currency_data) === null || _a === void 0 ? void 0 : _a.link, width: 64 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g4, alignItems: "center" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, fontSize: theme.typography.fontSize24, color: getAmountColor() }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: " ".concat((_b = activityData.currency_data) === null || _b === void 0 ? void 0 : _b.name) }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: (0, formatDate_1.default)(activityData.date_created) }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
67
67
  fontSize: theme.typography.fontSize12,
68
68
  textTransform: "capitalize",
69
69
  color: getStatusColor(),
70
- }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { p: theme.mixins.gaps.g12, width: "100%" }), children: [isReceive && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: activityData === null || activityData === void 0 ? void 0 : activityData.from_address, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "From" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "right" }), children: activityData === null || activityData === void 0 ? void 0 : activityData.from_address })] }) })), isSend && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: activityData === null || activityData === void 0 ? void 0 : activityData.to_address, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "To" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "right" }), children: activityData === null || activityData === void 0 ? void 0 : activityData.to_address })] }) }))] })] }));
70
+ }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.paper), { p: theme.mixins.gaps.g12, width: "100%" }), children: [isReceive && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: activityData === null || activityData === void 0 ? void 0 : activityData.from_address, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "From" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "end" }), children: activityData === null || activityData === void 0 ? void 0 : activityData.from_address })] }) })), isSend && ((0, jsx_runtime_1.jsx)(CopyTextComponent_1.default, { value: activityData === null || activityData === void 0 ? void 0 : activityData.to_address, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.valueDescription), children: "To" }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { wordBreak: "break-all", textAlign: "end" }), children: activityData === null || activityData === void 0 ? void 0 : activityData.to_address })] }) }))] })] }));
71
71
  }
72
72
  exports.default = ActivityDetail;
@@ -43,7 +43,6 @@ function ActivityItem(props) {
43
43
  var sx = props.sx, data = props.data, rest = __rest(props, ["sx", "data"]);
44
44
  var theme = (0, material_1.useTheme)();
45
45
  var detailDrawerRef = (0, react_1.useRef)(null);
46
- var _c = (0, react_1.useState)(false), isOpenDetail = _c[0], setIsOpenDetail = _c[1];
47
46
  var activityData = (0, react_1.useMemo)(function () {
48
47
  if (!data)
49
48
  return undefined;
@@ -73,20 +72,11 @@ function ActivityItem(props) {
73
72
  var openDetail = (0, react_1.useCallback)(function () {
74
73
  var _a;
75
74
  (_a = detailDrawerRef.current) === null || _a === void 0 ? void 0 : _a.open();
76
- setIsOpenDetail(true);
77
75
  }, []);
78
76
  var closeDetail = (0, react_1.useCallback)(function (e) {
79
77
  var _a;
80
78
  e.stopPropagation();
81
79
  (_a = detailDrawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
82
- setTimeout(function () {
83
- setIsOpenDetail(false);
84
- }, 800);
85
- }, []);
86
- var onCloseDetail = (0, react_1.useCallback)(function () {
87
- setTimeout(function () {
88
- setIsOpenDetail(false);
89
- }, 800);
90
80
  }, []);
91
81
  var getStatusColor = (0, react_1.useCallback)(function () {
92
82
  switch (status) {
@@ -110,10 +100,10 @@ function ActivityItem(props) {
110
100
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { width: "100%" }, children: [(0, jsx_runtime_1.jsxs)(material_1.ListItemButton, __assign({ onClick: openDetail, sx: __assign(__assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8, backgroundColor: theme.palette.background.white16, borderRadius: theme.mixins.customRadius.r16, p: theme.mixins.customPadding.p12, flexGrow: "unset", boxShadow: theme.shadows[1] }), sx) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
111
101
  width: "fit-content",
112
102
  height: "fit-content",
113
- }, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: type === null || type === void 0 ? void 0 : type.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
103
+ }, children: (0, jsx_runtime_1.jsx)(Icon_1.default, { src: type === null || type === void 0 ? void 0 : type.link, width: 24 }) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", gap: theme.mixins.gaps.g2 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityTitle, children: type === null || type === void 0 ? void 0 : type.name }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: theme.mixins.activityDescription, children: descriptionElement }), status !== type_1.TransactionStatus.Success && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [status === type_1.TransactionStatus.Processing && (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 16 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
114
104
  fontSize: theme.typography.fontSize12,
115
105
  textTransform: "capitalize",
116
106
  color: getStatusColor(),
117
- }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { width: "fit-content", alignItems: "flex-end", ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor(), textAlign: "right" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: (_a = activityData.currency_data) === null || _a === void 0 ? void 0 : _a.name }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { textAlign: "right" }), children: (0, formatDate_1.default)(activityData.date_created) })] })] })), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, onClose: onCloseDetail, children: isOpenDetail && ((0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: (_b = activityData.transaction_type) === null || _b === void 0 ? void 0 : _b.name, children: (0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: activityData }) })) })] }));
107
+ }, children: status })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g2, width: "fit-content", alignItems: "flex-end", ml: "auto" }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.value), { fontWeight: theme.typography.fontWeightBold, color: getAmountColor(), textAlign: "right" }), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { start: isIncrease ? "+" : "-", value: activityData.amount, unit: " ".concat((_a = activityData.currency_data) === null || _a === void 0 ? void 0 : _a.name) }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.valueDescription), { textAlign: "right" }), children: (0, formatDate_1.default)(activityData.date_created) })] })] })), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: detailDrawerRef, children: (0, jsx_runtime_1.jsx)(ModalLayout_1.default, { onClose: closeDetail, title: (_b = activityData.transaction_type) === null || _b === void 0 ? void 0 : _b.name, children: (0, jsx_runtime_1.jsx)(ActivityDetail_1.default, { activityData: activityData }) }) })] }));
118
108
  }
119
109
  exports.default = ActivityItem;
@@ -60,7 +60,7 @@ var CopyTextComponent = function (_a) {
60
60
  var value = _a.value, iconSuccess = _a.iconSuccess, children = _a.children, hideTextMessage = _a.hideTextMessage, sx = _a.sx;
61
61
  var theme = (0, material_1.useTheme)();
62
62
  var _b = (0, react_1.useState)(false), showSuccess = _b[0], setShowSuccess = _b[1];
63
- var CopyTextComponent = function () { return __awaiter(void 0, void 0, void 0, function () {
63
+ var copyText = function () { return __awaiter(void 0, void 0, void 0, function () {
64
64
  var err_1;
65
65
  return __generator(this, function (_a) {
66
66
  switch (_a.label) {
@@ -82,25 +82,26 @@ var CopyTextComponent = function (_a) {
82
82
  }
83
83
  });
84
84
  }); };
85
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { onClick: CopyTextComponent, sx: __assign({ position: "relative", cursor: "pointer" }, sx), children: [children, (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
85
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { onClick: copyText, sx: __assign({ position: "relative", cursor: "pointer" }, sx), children: [children, (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
86
86
  display: "flex",
87
87
  alignItems: "center",
88
88
  justifyContent: "center",
89
89
  gap: theme.mixins.gaps.g4,
90
90
  opacity: showSuccess ? 1 : 0,
91
91
  position: "absolute",
92
- inset: "-0.125rem",
93
- backgroundColor: theme.palette.background.black64,
92
+ inset: 0,
93
+ transform: "translateY(-100%) scale(".concat(showSuccess ? 1 : 0, ")"),
94
+ transformOrigin: "center bottom",
95
+ backgroundColor: theme.palette.background.black,
94
96
  backdropFilter: "blur(12px)",
95
97
  borderRadius: theme.mixins.customRadius.r12,
96
- transition: "opacity 0.3s ease-in-out",
98
+ transition: "opacity 0.3s ease-in-out, transform 0.3s ease-in-out",
97
99
  }, children: [iconSuccess || ((0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("copied_check"), sx: {
98
100
  width: "1rem",
99
101
  height: "1rem",
100
102
  } })), !hideTextMessage && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
101
- color: "text.whiteText",
102
- display: "inline-block",
103
- fontSize: "0.8em",
103
+ color: theme.palette.text.white,
104
+ fontSize: theme.typography.fontSize12,
104
105
  }, children: "Copied" }))] })] }));
105
106
  };
106
107
  exports.default = CopyTextComponent;
@@ -6,5 +6,9 @@ interface CustomTooltipProps extends Omit<PopoverProps, "open"> {
6
6
  disabled?: boolean;
7
7
  className?: string;
8
8
  }
9
- declare const CustomTooltip: ({ trigger, children, disabled, anchorOrigin, anchorPosition, transformOrigin, ...rest }: CustomTooltipProps) => import("react/jsx-runtime").JSX.Element;
9
+ export interface CustomTooltipRef {
10
+ open: React.ReactEventHandler;
11
+ close: React.ReactEventHandler;
12
+ }
13
+ declare const CustomTooltip: React.ForwardRefExoticComponent<Omit<CustomTooltipProps, "ref"> & React.RefAttributes<CustomTooltipRef>>;
10
14
  export default CustomTooltip;
@@ -62,24 +62,30 @@ var jsx_runtime_1 = require("react/jsx-runtime");
62
62
  var React = __importStar(require("react"));
63
63
  var Popover_1 = __importDefault(require("@mui/material/Popover"));
64
64
  var material_1 = require("@mui/material");
65
- var CustomTooltip = function (_a) {
65
+ var CustomTooltip = React.forwardRef(function (_a, ref) {
66
66
  var trigger = _a.trigger, children = _a.children, disabled = _a.disabled, _b = _a.anchorOrigin, anchorOrigin = _b === void 0 ? {
67
67
  vertical: "bottom",
68
68
  horizontal: "center",
69
69
  } : _b, anchorPosition = _a.anchorPosition, transformOrigin = _a.transformOrigin, rest = __rest(_a, ["trigger", "children", "disabled", "anchorOrigin", "anchorPosition", "transformOrigin"]);
70
70
  var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
71
- var handleClick = function (event) {
71
+ var handleOpen = function (event) {
72
+ event.stopPropagation();
72
73
  setAnchorEl(event.currentTarget);
73
74
  };
74
75
  var handleClose = function () {
75
76
  setAnchorEl(null);
76
77
  };
78
+ React.useImperativeHandle(ref, function () { return ({
79
+ open: handleOpen,
80
+ close: handleClose,
81
+ }); });
77
82
  var open = Boolean(anchorEl);
78
83
  var id = open ? "simple-popover" : undefined;
79
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { component: "button", disabled: disabled, "aria-describedby": id, onClick: handleClick, sx: { textAlign: "left" }, children: trigger }), (0, jsx_runtime_1.jsx)(Popover_1.default, __assign({ id: id, open: open, anchorEl: anchorEl, onClose: handleClose, anchorOrigin: anchorOrigin, anchorPosition: anchorPosition, transformOrigin: transformOrigin, sx: {
84
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { component: "button", disabled: disabled, "aria-describedby": id, onClick: handleOpen, sx: { textAlign: "left" }, children: trigger }), (0, jsx_runtime_1.jsx)(Popover_1.default, __assign({ id: id, open: open, anchorEl: anchorEl, onClose: handleClose, anchorOrigin: anchorOrigin, anchorPosition: anchorPosition, transformOrigin: transformOrigin, sx: {
80
85
  "& .MuiPopover-paper": {
81
86
  backgroundColor: "transparent",
82
87
  },
83
88
  } }, rest, { children: children }))] }));
84
- };
89
+ });
90
+ CustomTooltip.displayName = "CustomTooltip";
85
91
  exports.default = CustomTooltip;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.480",
3
+ "version": "0.0.482",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",