tek-wallet 0.0.481 → 0.0.483

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",
@@ -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,27 @@ 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
+ top: 0,
93
+ left: "50%",
94
+ transform: "translate(-50%, -100%) scale(".concat(showSuccess ? 1 : 0, ")"),
95
+ transformOrigin: "center bottom",
96
+ backgroundColor: theme.palette.background.black,
94
97
  backdropFilter: "blur(12px)",
95
98
  borderRadius: theme.mixins.customRadius.r12,
96
- transition: "opacity 0.3s ease-in-out",
99
+ transition: "opacity 0.3s ease-in-out, transform 0.3s ease-in-out",
97
100
  }, children: [iconSuccess || ((0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("copied_check"), sx: {
98
101
  width: "1rem",
99
102
  height: "1rem",
100
103
  } })), !hideTextMessage && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
101
- color: "text.whiteText",
102
- display: "inline-block",
103
- fontSize: "0.8em",
104
+ color: theme.palette.text.successStatus,
105
+ fontSize: "1em",
104
106
  }, children: "Copied" }))] })] }));
105
107
  };
106
108
  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.481",
3
+ "version": "0.0.483",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",