tek-wallet 0.0.203 → 0.0.204

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.
@@ -0,0 +1,5 @@
1
+ import { GeneralProps } from "../../../types/ui";
2
+ interface AmountGroupAndChartProps extends GeneralProps {
3
+ }
4
+ declare const AmountGroupAndChart: (props: AmountGroupAndChartProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default AmountGroupAndChart;
@@ -0,0 +1,129 @@
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 framer_motion_1 = require("framer-motion");
20
+ var AnalyticGroup_1 = __importDefault(require("../AnalyticGroup"));
21
+ var TimeFilter_1 = __importDefault(require("../TimeFilter"));
22
+ var TimeFilter_2 = require("../TimeFilter");
23
+ var DelayMounted_1 = __importDefault(require("../DelayMounted"));
24
+ var material_1 = require("@mui/material");
25
+ var NeonLineChart_1 = __importDefault(require("../NeonLineChart"));
26
+ var Icon_1 = __importDefault(require("../Icon"));
27
+ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
28
+ var fakeSeries = [
29
+ {
30
+ name: "All",
31
+ data: [
32
+ 1003785.6864951615, 1003795.988344575, 1003827.997662396,
33
+ 1003899.7426850981, 1003891.7710159089, 1003810.6439517767,
34
+ 1003780.7195320514, 1003797.9506016063, 1003781.455378438,
35
+ 1003782.0072632281, 1003715.167883104, 1003724.9791682598,
36
+ 1003716.6018329085, 1003711.3282671372, 1003686.1868489254,
37
+ 1003625.4795220237, 1003584.3334449014, 1003498.9139435134,
38
+ 1003310.7825506503, 1003339.72584186, 1003334.3069939599,
39
+ 1003364.3540547496, 1003394.4011155394, 1003398.386950134,
40
+ 1003233.005474726, 1003185.2981006557, 1003165.7981714085,
41
+ ],
42
+ },
43
+ ];
44
+ var labels = [
45
+ "2025-03-04T08:10:17.311Z",
46
+ "2025-03-04T12:10:18.859Z",
47
+ "2025-03-04T16:10:19.118Z",
48
+ "2025-03-04T20:10:18.246Z",
49
+ "2025-03-05T00:10:18.371Z",
50
+ "2025-03-05T10:12:40.882Z",
51
+ "2025-03-05T14:12:42.832Z",
52
+ "2025-03-05T18:12:41.114Z",
53
+ "2025-03-05T22:12:40.544Z",
54
+ "2025-03-06T02:12:40.718Z",
55
+ "2025-03-08T10:35:52.596Z",
56
+ "2025-03-08T14:35:52.979Z",
57
+ "2025-03-08T16:01:31.209Z",
58
+ "2025-03-08T18:35:52.824Z",
59
+ "2025-03-08T22:35:52.901Z",
60
+ "2025-03-09T06:35:53.327Z",
61
+ "2025-03-09T10:35:52.682Z",
62
+ "2025-03-09T14:35:53.001Z",
63
+ "2025-03-09T18:35:52.886Z",
64
+ "2025-03-09T22:35:52.880Z",
65
+ "2025-03-10T03:43:34.153Z",
66
+ "2025-03-10T06:35:52.944Z",
67
+ "2025-03-10T10:35:52.253Z",
68
+ "2025-03-10T14:35:52.727Z",
69
+ "2025-03-10T18:35:52.865Z",
70
+ "2025-03-10T22:35:53.563Z",
71
+ "2025-03-11T04:16:45.409Z",
72
+ ];
73
+ var defaultTimeRange = TimeFilter_2.TimeFilterType.SEVEN_DAYS;
74
+ var variants = {
75
+ hidden: { opacity: 0, left: "-70%" },
76
+ visible: { opacity: 1, left: "0%" },
77
+ };
78
+ var AmountGroupAndChart = function (props) {
79
+ var _a = (0, react_1.useState)(false), expandAreaChart = _a[0], setExpandAreaChart = _a[1];
80
+ var _b = (0, react_1.useState)(), timeRangeData = _b[0], setTimeRangeData = _b[1];
81
+ var theme = (0, material_1.useTheme)();
82
+ var handleChangeTimeRange = function (data) {
83
+ setTimeRangeData(data);
84
+ };
85
+ var toggleExpand = function () {
86
+ setExpandAreaChart(!expandAreaChart);
87
+ };
88
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, props.sx), { width: "100%" }), children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { position: "relative" }), children: [(0, jsx_runtime_1.jsx)(AnalyticGroup_1.default, { timeRange: timeRangeData === null || timeRangeData === void 0 ? void 0 : timeRangeData.type }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
89
+ width: "100%",
90
+ position: "relative",
91
+ duration: "500ms",
92
+ aspectRatio: "1.47317073171",
93
+ zIndex: 10,
94
+ maxHeight: expandAreaChart ? "28rem" : "0",
95
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
96
+ position: "absolute",
97
+ right: 0,
98
+ left: 0,
99
+ bottom: 0,
100
+ duration: "500ms",
101
+ transform: !expandAreaChart
102
+ ? "translateY(0) translateX(25%) scale(0.5)"
103
+ : "none",
104
+ }, children: (0, jsx_runtime_1.jsx)(DelayMounted_1.default, { delay: 800, children: (0, jsx_runtime_1.jsx)(NeonLineChart_1.default, { showMinMaxValues: expandAreaChart, series: fakeSeries, categories: labels, sx: {
105
+ width: "100%",
106
+ height: "fit-content",
107
+ duration: "500ms",
108
+ transform: !expandAreaChart ? "-translate-y-[100%]" : "none",
109
+ my: theme.mixins.customMargin.m3,
110
+ } }) }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", bottom: 0 }, children: (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: "hidden", animate: expandAreaChart ? "visible" : "hidden", variants: variants, transition: {
111
+ opacity: {
112
+ duration: expandAreaChart ? 0.5 : 0.25,
113
+ ease: "linear",
114
+ delay: expandAreaChart ? 0.5 : 0,
115
+ },
116
+ left: {
117
+ duration: expandAreaChart ? 0.5 : 0.25,
118
+ ease: "linear",
119
+ delay: expandAreaChart ? 0.3 : 0,
120
+ },
121
+ }, children: (0, jsx_runtime_1.jsx)(TimeFilter_1.default, { hideAll: true, initialValue: defaultTimeRange, onChange: handleChangeTimeRange }) }) })] }), (0, jsx_runtime_1.jsx)(Icon_1.default, { sx: {
122
+ alignSelf: "center",
123
+ transition: "all 0.5s ease-in-out",
124
+ cursor: "pointer",
125
+ mt: theme.mixins.customMargin.m4,
126
+ transform: !expandAreaChart ? "rotate(180deg)" : "none",
127
+ }, width: 16, src: (0, getIcon_1.default)("bottom_arrow"), onClick: toggleExpand })] }) }));
128
+ };
129
+ exports.default = AmountGroupAndChart;
@@ -0,0 +1,6 @@
1
+ import { GeneralProps } from "../../../types/ui";
2
+ interface AnalyticGroupProps extends GeneralProps {
3
+ timeRange?: string;
4
+ }
5
+ declare const AnalyticGroup: (props: AnalyticGroupProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default AnalyticGroup;
@@ -0,0 +1,33 @@
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 Text_1 = __importDefault(require("../Text"));
19
+ var Formatter_1 = __importDefault(require("../Formatter"));
20
+ var Icon_1 = __importDefault(require("../Icon"));
21
+ var material_1 = require("@mui/material");
22
+ var getIcon_1 = __importDefault(require("../../../utils/getIcon"));
23
+ var AnalyticGroup = function (props) {
24
+ var theme = (0, material_1.useTheme)();
25
+ var sx = props.sx;
26
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({}, sx), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.fieldTitle), children: "Total Amount" }), (0, jsx_runtime_1.jsxs)(Text_1.default, { className: "flex items-baseline gap-1 text-24 font-semibold text-ui-text-white", sx: __assign(__assign({}, theme.mixins.row), theme.mixins.value), children: [(0, jsx_runtime_1.jsx)(Formatter_1.default, { value: 1000000 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: { fontWeight: "typography.fontWeight400", fontSize: "0.8em" }, children: "USD" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("bottom_arrow"), width: 8 })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g4, fontSize: theme.typography.fontSize12 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
27
+ fontWeight: "typography.fontWeight500",
28
+ leading: "typography.lineHeight140",
29
+ fontSize: "typography.fontSize14",
30
+ textTransform: "capitalize",
31
+ }, children: props.timeRange }), (0, jsx_runtime_1.jsx)(Icon_1.default, { src: (0, getIcon_1.default)("arrow_increase"), width: 12 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({ color: theme.palette.text.increase }, theme.mixins.value), { borderBottom: "1px dashed ".concat(theme.palette.text.increase) }), children: "5.63 (+3,22%)" })] })] }));
32
+ };
33
+ exports.default = AnalyticGroup;
@@ -0,0 +1,6 @@
1
+ import { GeneralProps } from "../../../types/ui";
2
+ interface DelayMountedPropsType extends GeneralProps {
3
+ delay?: number;
4
+ }
5
+ declare function DelayMounted({ children, delay }: DelayMountedPropsType): import("react/jsx-runtime").JSX.Element;
6
+ export default DelayMounted;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var jsx_runtime_1 = require("react/jsx-runtime");
4
+ var react_1 = require("react");
5
+ function DelayMounted(_a) {
6
+ var children = _a.children, _b = _a.delay, delay = _b === void 0 ? 1000 : _b;
7
+ var _c = (0, react_1.useState)(false), allowMount = _c[0], setAllowMount = _c[1];
8
+ (0, react_1.useEffect)(function () {
9
+ var timeout = setTimeout(function () {
10
+ setAllowMount(true);
11
+ }, delay);
12
+ return function () {
13
+ clearTimeout(timeout);
14
+ };
15
+ }, []);
16
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: allowMount && children });
17
+ }
18
+ exports.default = DelayMounted;
@@ -126,7 +126,7 @@ var DepositFunction = (0, react_1.forwardRef)(function (props, ref) {
126
126
  display: "flex",
127
127
  alignItems: "center",
128
128
  minHeight: "2rem",
129
- mb: theme.mixins.customMargin.p20,
129
+ mb: theme.mixins.customMargin.m20,
130
130
  }, overrideBack: handleBack, hideBack: currentStep === DepositStep.SELECT_TOKEN, center: DEPOSIT_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: close }) }), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
131
131
  autoHeight: true,
132
132
  spaceBetween: 32,
@@ -8,12 +8,11 @@ var jsx_runtime_1 = require("react/jsx-runtime");
8
8
  var getStandardNumber_1 = __importDefault(require("../../../utils/getStandardNumber"));
9
9
  var lengthFromDotToFirstNonZero_1 = __importDefault(require("../../../utils/lengthFromDotToFirstNonZero"));
10
10
  var CustomTooltip_1 = __importDefault(require("../CustomTooltip"));
11
- var cn_1 = __importDefault(require("../../../utils/cn"));
12
11
  var material_1 = require("@mui/material");
13
12
  var formatter_1 = __importDefault(require("../../../utils/formatter"));
14
13
  var Formatter = function (_a) {
15
14
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
16
- var value = _a.value, _o = _a.start, start = _o === void 0 ? "" : _o, _p = _a.unit, unit = _p === void 0 ? "" : _p, _q = _a.lengthValueAllowed, lengthValueAllowed = _q === void 0 ? 2 : _q, _r = _a.noUnitSpacing, noUnitSpacing = _r === void 0 ? false : _r, _s = _a.allowShowZero, allowShowZero = _s === void 0 ? false : _s, _t = _a.useCompact, useCompact = _t === void 0 ? true : _t, disableTooltip = _a.disableTooltip, isUnitStyle = _a.isUnitStyle, unitCustomStyle = _a.unitCustomStyle, disableAdjustUnitColor = _a.disableAdjustUnitColor, isLessThan = _a.isLessThan, overrideLessThanClass = _a.overrideLessThanClass, unitStyle = _a.unitStyle, _u = _a.useCompactOnThousand, useCompactOnThousand = _u === void 0 ? false : _u, startStyle = _a.startStyle, hideStart = _a.hideStart, hideUnit = _a.hideUnit, onClickUnit = _a.onClickUnit;
15
+ var value = _a.value, _o = _a.start, start = _o === void 0 ? "" : _o, _p = _a.unit, unit = _p === void 0 ? "" : _p, _q = _a.lengthValueAllowed, lengthValueAllowed = _q === void 0 ? 2 : _q, _r = _a.noUnitSpacing, noUnitSpacing = _r === void 0 ? false : _r, _s = _a.allowShowZero, allowShowZero = _s === void 0 ? false : _s, _t = _a.useCompact, useCompact = _t === void 0 ? true : _t, disableTooltip = _a.disableTooltip, isLessThan = _a.isLessThan, unitStyle = _a.unitStyle, _u = _a.useCompactOnThousand, useCompactOnThousand = _u === void 0 ? false : _u, startStyle = _a.startStyle, hideStart = _a.hideStart, hideUnit = _a.hideUnit, onClickUnit = _a.onClickUnit;
17
16
  var tokensRateState = {}.tokensRateState;
18
17
  var userInfo = {}.userInfo;
19
18
  // const { tokensRateState } = useRealtimeData();
@@ -39,16 +38,17 @@ var Formatter = function (_a) {
39
38
  var lessThan = numberDisplay > 0 && numberDisplay < 0.01 && isLessThan;
40
39
  return ((0, jsx_runtime_1.jsx)(CustomTooltip_1.default, { disabled: disableTooltip, trigger: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
41
40
  whiteSpace: "nowrap",
42
- }, children: numberDisplay === 0 && !allowShowZero ? ("--") : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [lessThan && ((0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.default)("relative -top-0.5 font-primary mr-0.5", overrideLessThanClass), children: "< " })), !(numberDisplay === 0) && !hideStart && ((0, jsx_runtime_1.jsx)("span", { className: "font-primary", style: startStyle, children: startDisplay })), !lessThan && numberDisplay > 0 && numberDisplay < 0.000001 ? ((0, jsx_runtime_1.jsxs)("span", { className: "font-primary", children: ["0.0", (0, jsx_runtime_1.jsx)("sub", { children: lengthFromDot }), formattedNumber.slice(2 + lengthFromDot, lengthValueAllowed - 2 + lengthFromDot)] })) : ((0, jsx_runtime_1.jsx)("span", { className: "font-primary", children: lessThan
41
+ }, children: numberDisplay === 0 && !allowShowZero ? ("--") : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [lessThan && ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", sx: {
42
+ position: "relative",
43
+ top: "-0.125rem",
44
+ mr: "0.125rem",
45
+ }, children: "< " })), !(numberDisplay === 0) && !hideStart && ((0, jsx_runtime_1.jsx)("span", { className: "font-primary", style: startStyle, children: startDisplay })), !lessThan && numberDisplay > 0 && numberDisplay < 0.000001 ? ((0, jsx_runtime_1.jsxs)("span", { className: "font-primary", children: ["0.0", (0, jsx_runtime_1.jsx)("sub", { children: lengthFromDot }), formattedNumber.slice(2 + lengthFromDot, lengthValueAllowed - 2 + lengthFromDot)] })) : ((0, jsx_runtime_1.jsx)("span", { className: "font-primary", children: lessThan
43
46
  ? "0.01"
44
47
  : (0, formatter_1.default)(isLessThan
45
48
  ? Number(numberDisplay).toFixed(2)
46
49
  : numberDisplay, useCompact, useCompactOnThousand, lengthValueAllowed) })), !hideUnit &&
47
50
  !!unitDisplay &&
48
51
  !noUnitSpacing &&
49
- !(numberDisplay === 0) && ((0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.default)("font-primary", unitCustomStyle, {
50
- "text-secondary": isUnitStyle,
51
- not_apply_adjust_color_tbk: disableAdjustUnitColor,
52
- }), style: unitStyle, onClick: onClickUnit, children: unitDisplay }))] })) }), children: (0, jsx_runtime_1.jsx)(Formatter, { disableTooltip: true, start: start, value: value, lengthValueAllowed: 12, useCompact: false, unit: unit, allowShowZero: true, disableAdjustUnitColor: true, hideStart: hideStart, hideUnit: hideUnit }) }));
52
+ !(numberDisplay === 0) && ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", style: unitStyle, onClick: onClickUnit, children: unitDisplay }))] })) }), children: (0, jsx_runtime_1.jsx)(Formatter, { disableTooltip: true, start: start, value: value, lengthValueAllowed: 12, useCompact: false, unit: unit, allowShowZero: true, disableAdjustUnitColor: true, hideStart: hideStart, hideUnit: hideUnit }) }));
53
53
  };
54
54
  exports.default = Formatter;
@@ -0,0 +1,12 @@
1
+ import { GeneralProps } from "../../../types/ui";
2
+ export interface NeonLineChartPropsTypes extends GeneralProps {
3
+ categories?: string[];
4
+ series?: Array<{
5
+ name: string;
6
+ data: any[];
7
+ }>;
8
+ showMinMaxValues?: boolean;
9
+ }
10
+ declare function NeonLineChart({ series, categories, showMinMaxValues, sx, }: NeonLineChartPropsTypes): import("react/jsx-runtime").JSX.Element;
11
+ declare const _default: import("react").MemoExoticComponent<typeof NeonLineChart>;
12
+ export default _default;
@@ -0,0 +1,179 @@
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 highcharts_1 = __importDefault(require("highcharts"));
20
+ var highcharts_react_official_1 = __importDefault(require("highcharts-react-official"));
21
+ var Formatter_1 = __importDefault(require("../Formatter"));
22
+ var Text_1 = __importDefault(require("../Text"));
23
+ var framer_motion_1 = require("framer-motion");
24
+ var useFormatter_1 = __importDefault(require("../../../hooks/useFormatter"));
25
+ var material_1 = require("@mui/material");
26
+ var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
27
+ function NeonLineChart(_a) {
28
+ var _b, _c, _d, _e;
29
+ var series = _a.series, categories = _a.categories, _f = _a.showMinMaxValues, showMinMaxValues = _f === void 0 ? false : _f, sx = _a.sx;
30
+ var chartComponentRef = (0, react_1.useRef)(null);
31
+ var formatValue = (0, useFormatter_1.default)().formatValue;
32
+ var theme = (0, material_1.useTheme)();
33
+ var options = {
34
+ title: {
35
+ text: "",
36
+ },
37
+ chart: {
38
+ backgroundColor: "transparent",
39
+ height: "".concat(180, "px"),
40
+ animation: true,
41
+ },
42
+ colors: ["#60D591"],
43
+ series: [
44
+ {
45
+ type: "line",
46
+ name: "",
47
+ data: (_c = (_b = series === null || series === void 0 ? void 0 : series[0]) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : [],
48
+ lineWidth: 2, // Line width
49
+ shadow: {
50
+ color: "#60D591", // Neon red glow
51
+ offsetX: 0,
52
+ offsetY: 0,
53
+ opacity: 1,
54
+ width: 15, // Glow width
55
+ },
56
+ },
57
+ ],
58
+ plotOptions: {
59
+ series: {
60
+ marker: {
61
+ enabled: false,
62
+ },
63
+ },
64
+ },
65
+ yAxis: {
66
+ visible: false,
67
+ },
68
+ xAxis: {
69
+ visible: false,
70
+ categories: categories,
71
+ },
72
+ legend: {
73
+ enabled: false,
74
+ },
75
+ tooltip: {
76
+ backgroundColor: "#00000055",
77
+ style: {
78
+ color: "#fff",
79
+ },
80
+ padding: 6,
81
+ formatter: function () {
82
+ var _a;
83
+ try {
84
+ if ((this === null || this === void 0 ? void 0 : this.y) === "") {
85
+ return null;
86
+ }
87
+ return "<div>\n <div style=\"font-size: 0.8em; \">".concat((0, formatDate_1.default)(this === null || this === void 0 ? void 0 : this.x), "</div> <br/>\n <div style=\"font-weight: 600; color: #60D591; font-size: 1.1em;\">").concat(formatValue(+((_a = this === null || this === void 0 ? void 0 : this.y) !== null && _a !== void 0 ? _a : 0)), "</div>\n </div>");
88
+ }
89
+ catch (err) {
90
+ console.error("🚀 ~ NeonLineChart ~ err:", err);
91
+ return null;
92
+ }
93
+ },
94
+ },
95
+ };
96
+ var data = (0, react_1.useMemo)(function () {
97
+ var _a, _b;
98
+ return (_b = (_a = series === null || series === void 0 ? void 0 : series[0]) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : [];
99
+ }, [((_d = series === null || series === void 0 ? void 0 : series[0]) === null || _d === void 0 ? void 0 : _d.data) && JSON.stringify((_e = series === null || series === void 0 ? void 0 : series[0]) === null || _e === void 0 ? void 0 : _e.data)]);
100
+ var chartLength = (0, react_1.useMemo)(function () {
101
+ try {
102
+ var length_1 = data === null || data === void 0 ? void 0 : data.length;
103
+ return length_1 !== null && length_1 !== void 0 ? length_1 : 0;
104
+ }
105
+ catch (_a) {
106
+ return -1;
107
+ }
108
+ }, [data]);
109
+ var maxValue = (0, react_1.useMemo)(function () {
110
+ try {
111
+ var max = Math.max.apply(Math, (data !== null && data !== void 0 ? data : []));
112
+ return max !== null && max !== void 0 ? max : -1;
113
+ }
114
+ catch (_a) {
115
+ return -1;
116
+ }
117
+ }, [data]);
118
+ var maxIndex = (0, react_1.useMemo)(function () {
119
+ try {
120
+ var index = data === null || data === void 0 ? void 0 : data.findLastIndex(function (e) { return e === maxValue; });
121
+ return index !== null && index !== void 0 ? index : -1;
122
+ }
123
+ catch (_a) {
124
+ return -1;
125
+ }
126
+ }, [maxValue]);
127
+ var minValue = (0, react_1.useMemo)(function () {
128
+ try {
129
+ var min = Math.min.apply(Math, (data !== null && data !== void 0 ? data : []));
130
+ return min !== null && min !== void 0 ? min : -1;
131
+ }
132
+ catch (_a) {
133
+ return -1;
134
+ }
135
+ }, [data]);
136
+ var minIndex = (0, react_1.useMemo)(function () {
137
+ try {
138
+ var index = data === null || data === void 0 ? void 0 : data.findLastIndex(function (e) { return e === minValue; });
139
+ return index !== null && index !== void 0 ? index : -1;
140
+ }
141
+ catch (_a) {
142
+ return -1;
143
+ }
144
+ }, [minValue]);
145
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative" }, sx), children: [showMinMaxValues && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { className: "absolute top-0 w-fit z-50", style: {
146
+ left: "".concat((maxIndex / chartLength) * 100, "%"),
147
+ }, initial: {
148
+ scale: 0,
149
+ translateX: "-50%",
150
+ opacity: 0,
151
+ origin: "50% center",
152
+ }, animate: {
153
+ scale: 1,
154
+ translateX: "-50%",
155
+ opacity: 1,
156
+ origin: "50% center",
157
+ }, transition: {
158
+ duration: 0.4,
159
+ ease: "easeInOut",
160
+ delay: 0.4,
161
+ }, children: (0, jsx_runtime_1.jsx)(Text_1.default, { className: "text-ui-text-white text-12 leading-140", children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: maxValue }) }) }), (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { className: "absolute bottom-0 w-fit z-50", style: {
162
+ left: "".concat((minIndex / chartLength) * 100, "%"),
163
+ }, initial: {
164
+ scale: 0,
165
+ translateX: "-50%",
166
+ opacity: 0,
167
+ origin: "50% center",
168
+ }, animate: {
169
+ scale: 1,
170
+ translateX: "-50%",
171
+ opacity: 1,
172
+ origin: "50% center",
173
+ }, transition: {
174
+ duration: 0.4,
175
+ ease: "easeInOut",
176
+ delay: 0.4,
177
+ }, children: (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.value), children: (0, jsx_runtime_1.jsx)(Formatter_1.default, { value: minValue }) }) })] })), (0, jsx_runtime_1.jsx)(highcharts_react_official_1.default, { highcharts: highcharts_1.default, options: options, ref: chartComponentRef })] }));
178
+ }
179
+ exports.default = (0, react_1.memo)(NeonLineChart);
@@ -0,0 +1 @@
1
+ export declare const getThePreviousWeekByDate: (date: Date) => Date;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getThePreviousWeekByDate = void 0;
4
+ var date_fns_1 = require("date-fns");
5
+ var getThePreviousWeekByDate = function (date) {
6
+ return (0, date_fns_1.sub)(date, {
7
+ days: 6,
8
+ });
9
+ };
10
+ exports.getThePreviousWeekByDate = getThePreviousWeekByDate;
@@ -0,0 +1 @@
1
+ export declare const getThisDateFromLastMonthDatePicker: (date: Date) => Date;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getThisDateFromLastMonthDatePicker = void 0;
4
+ var date_fns_1 = require("date-fns");
5
+ var getThisDateFromLastMonthDatePicker = function (date) {
6
+ return (0, date_fns_1.sub)(date, {
7
+ days: 29,
8
+ });
9
+ };
10
+ exports.getThisDateFromLastMonthDatePicker = getThisDateFromLastMonthDatePicker;
@@ -0,0 +1,19 @@
1
+ import { GeneralProps } from "../../../types/ui";
2
+ export declare enum TimeFilterType {
3
+ ALL = "all",
4
+ TODAY = "today",
5
+ SEVEN_DAYS = "7 days",
6
+ THIRTY_DAYS = "30 days"
7
+ }
8
+ export interface TimeFilterProps extends GeneralProps {
9
+ initialValue?: TimeFilterType;
10
+ onChange?: (value: TimeFilterData, event?: React.MouseEvent<HTMLElement>) => any;
11
+ hideAll?: boolean;
12
+ }
13
+ export interface TimeFilterData {
14
+ type: TimeFilterType;
15
+ startDate?: string;
16
+ endDate?: string;
17
+ }
18
+ declare const TimeFilter: ({ initialValue, onChange, hideAll, }: TimeFilterProps) => import("react/jsx-runtime").JSX.Element;
19
+ export default TimeFilter;
@@ -0,0 +1,122 @@
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
+ exports.TimeFilterType = void 0;
18
+ var jsx_runtime_1 = require("react/jsx-runtime");
19
+ var material_1 = require("@mui/material");
20
+ var react_1 = require("react");
21
+ var Text_1 = __importDefault(require("../Text"));
22
+ var date_fns_1 = require("date-fns");
23
+ var getMaxTime_1 = __importDefault(require("../../../utils/getMaxTime"));
24
+ var formatDate_1 = __importDefault(require("../../../utils/formatDate"));
25
+ var TimeFilterType;
26
+ (function (TimeFilterType) {
27
+ TimeFilterType["ALL"] = "all";
28
+ TimeFilterType["TODAY"] = "today";
29
+ TimeFilterType["SEVEN_DAYS"] = "7 days";
30
+ TimeFilterType["THIRTY_DAYS"] = "30 days";
31
+ })(TimeFilterType || (exports.TimeFilterType = TimeFilterType = {}));
32
+ var TimeFilter = function (_a) {
33
+ var _b = _a.initialValue, initialValue = _b === void 0 ? TimeFilterType.ALL : _b, onChange = _a.onChange, hideAll = _a.hideAll;
34
+ var theme = (0, material_1.useTheme)();
35
+ var _c = (0, react_1.useState)({
36
+ type: initialValue,
37
+ }), value = _c[0], setValue = _c[1];
38
+ var getTimeFilterData = function (type) {
39
+ var _a, _b, _c;
40
+ var newData = {
41
+ type: type,
42
+ };
43
+ switch (type) {
44
+ case TimeFilterType.TODAY:
45
+ var _d = (_a = (0, getMaxTime_1.default)(new Date().toISOString(), new Date().toISOString())) !== null && _a !== void 0 ? _a : {}, startDate = _d.startDate, endDate = _d.endDate;
46
+ newData.startDate = startDate;
47
+ newData.endDate = endDate;
48
+ break;
49
+ case TimeFilterType.SEVEN_DAYS: {
50
+ var today = new Date();
51
+ var sevenPreDay = (0, date_fns_1.subDays)(today, 7);
52
+ var _e = (_b = (0, getMaxTime_1.default)(sevenPreDay.toISOString(), today.toISOString())) !== null && _b !== void 0 ? _b : {}, startDate_1 = _e.startDate, endDate_1 = _e.endDate;
53
+ newData.startDate = startDate_1;
54
+ newData.endDate = endDate_1;
55
+ break;
56
+ }
57
+ case TimeFilterType.THIRTY_DAYS: {
58
+ var today = new Date();
59
+ var oneMonthPreDay = (0, date_fns_1.subDays)(today, 30);
60
+ var _f = (_c = (0, getMaxTime_1.default)(oneMonthPreDay.toISOString(), today.toISOString())) !== null && _c !== void 0 ? _c : {}, startDate_2 = _f.startDate, endDate_2 = _f.endDate;
61
+ newData.startDate = startDate_2;
62
+ newData.endDate = endDate_2;
63
+ break;
64
+ }
65
+ default: {
66
+ break;
67
+ }
68
+ }
69
+ return newData;
70
+ };
71
+ var handleChange = function (event, newValueArray) {
72
+ try {
73
+ var newValue = newValueArray === null || newValueArray === void 0 ? void 0 : newValueArray[0];
74
+ if (newValue === (value === null || value === void 0 ? void 0 : value.type))
75
+ return;
76
+ var newData = getTimeFilterData(newValue);
77
+ setValue(newData);
78
+ onChange === null || onChange === void 0 ? void 0 : onChange(newData, event);
79
+ }
80
+ catch (err) {
81
+ console.error("🚀 ~ err:", err);
82
+ }
83
+ };
84
+ var getTimeFilterLabel = function (dateData) {
85
+ try {
86
+ switch (dateData === null || dateData === void 0 ? void 0 : dateData.type) {
87
+ case TimeFilterType.TODAY:
88
+ return "".concat((0, formatDate_1.default)((dateData === null || dateData === void 0 ? void 0 : dateData.startDate) || ""));
89
+ case TimeFilterType.SEVEN_DAYS:
90
+ case TimeFilterType.THIRTY_DAYS:
91
+ return "".concat((0, formatDate_1.default)((dateData === null || dateData === void 0 ? void 0 : dateData.startDate) || ""), " - ").concat((0, formatDate_1.default)((dateData === null || dateData === void 0 ? void 0 : dateData.endDate) || ""));
92
+ default:
93
+ return null;
94
+ }
95
+ }
96
+ catch (err) {
97
+ console.error("🚀 ~ err:", err);
98
+ return null;
99
+ }
100
+ };
101
+ (0, react_1.useEffect)(function () {
102
+ if (!initialValue)
103
+ return;
104
+ var newData = getTimeFilterData(initialValue);
105
+ setValue(newData);
106
+ onChange === null || onChange === void 0 ? void 0 : onChange(newData);
107
+ }, []);
108
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g6 }), children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: getTimeFilterLabel(value) }), (0, jsx_runtime_1.jsx)(material_1.ToggleButtonGroup, { defaultValue: initialValue, onChange: handleChange, sx: { gap: theme.mixins.gaps.g8 }, children: Object.values(TimeFilterType).map(function (type) {
109
+ if (hideAll && type === TimeFilterType.ALL)
110
+ return null;
111
+ return ((0, jsx_runtime_1.jsx)(material_1.ToggleButton, { "aria-label": type, value: type, sx: {
112
+ p: 0,
113
+ border: "none",
114
+ }, children: (0, jsx_runtime_1.jsx)(material_1.Chip, { label: type, variant: "outlined", sx: {
115
+ textTransform: "capitalize",
116
+ leading: "typography.lineHeight100",
117
+ borderColor: "currentColor",
118
+ color: (value === null || value === void 0 ? void 0 : value.type) === type ? "text.white" : "text.white64",
119
+ }, onClick: function () { } }) }, type));
120
+ }) })] }));
121
+ };
122
+ exports.default = TimeFilter;
@@ -126,7 +126,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
126
126
  display: "flex",
127
127
  alignItems: "center",
128
128
  minHeight: "2rem",
129
- mb: theme.mixins.customMargin.p20,
129
+ mb: theme.mixins.customMargin.m20,
130
130
  }, overrideBack: handleBack, hideBack: currentStep === DepositStep.SELECT_TOKEN, center: DEPOSIT_STEP_NAME[currentStep], children: (0, jsx_runtime_1.jsx)(CloseModal_1.default, { sx: { marginLeft: "auto" }, onClick: close }) }), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperRef, swiperProps: {
131
131
  autoHeight: true,
132
132
  spaceBetween: 32,
@@ -61,6 +61,8 @@ var text = {
61
61
  successStatus: "#01FF00",
62
62
  errorStatus: "#FE6565",
63
63
  loadingStatus: "#01FFFF",
64
+ increase: "#01FF00",
65
+ decrease: "#FE6565",
64
66
  };
65
67
  var gaps = {
66
68
  g2: "0.125rem",
@@ -95,17 +97,17 @@ var customPadding = {
95
97
  p48: "3rem",
96
98
  };
97
99
  var customMargin = {
98
- p4: "0.25rem",
99
- p6: "0.375rem",
100
- p8: "0.5rem",
101
- p10: "0.625rem",
102
- p12: "0.75rem",
103
- p16: "1rem",
104
- p20: "1.25rem",
105
- p24: "1.5rem",
106
- p32: "2rem",
107
- p40: "2.5rem",
108
- p48: "3rem",
100
+ m4: "0.25rem",
101
+ m6: "0.375rem",
102
+ m8: "0.5rem",
103
+ m10: "0.625rem",
104
+ m12: "0.75rem",
105
+ m16: "1rem",
106
+ m20: "1.25rem",
107
+ m24: "1.5rem",
108
+ m32: "2rem",
109
+ m40: "2.5rem",
110
+ m48: "3rem",
109
111
  };
110
112
  var theBorderRadius = {
111
113
  full: "999px",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.203",
3
+ "version": "0.0.204",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -34,6 +34,9 @@
34
34
  "axios": "^1.8.4",
35
35
  "clsx": "^2.1.1",
36
36
  "date-fns": "^4.1.0",
37
+ "framer-motion": "^12.7.4",
38
+ "highcharts": "^12.2.0",
39
+ "highcharts-react-official": "^3.2.1",
37
40
  "html-to-image": "^1.11.13",
38
41
  "jsonwebtoken": "^9.0.2",
39
42
  "next": "^15.2.4",
@@ -1,2 +0,0 @@
1
- declare const cn: (...inputs: any[]) => string;
2
- export default cn;
package/dist/utils/cn.js DELETED
@@ -1,15 +0,0 @@
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
- var clsx_1 = __importDefault(require("clsx"));
7
- // import { twMerge } from "tailwind-merge";
8
- var cn = function () {
9
- var inputs = [];
10
- for (var _i = 0; _i < arguments.length; _i++) {
11
- inputs[_i] = arguments[_i];
12
- }
13
- return (0, clsx_1.default)(inputs);
14
- };
15
- exports.default = cn;