@ape.swap/bonds-sdk 1.0.61 → 1.0.62

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.
Files changed (124) hide show
  1. package/dist/components/uikit/Button/Button.d.ts +4 -0
  2. package/dist/components/uikit/Button/Button.js +91 -0
  3. package/dist/components/uikit/Button/IconButton.d.ts +4 -0
  4. package/dist/components/uikit/Button/IconButton.js +33 -0
  5. package/dist/components/uikit/Button/index.d.ts +2 -0
  6. package/dist/components/uikit/Button/index.js +2 -0
  7. package/dist/components/uikit/Button/styles.d.ts +3 -0
  8. package/dist/components/uikit/Button/styles.js +30 -0
  9. package/dist/components/uikit/Button/types.d.ts +46 -0
  10. package/dist/components/uikit/Button/types.js +37 -0
  11. package/dist/components/uikit/Checkbox/index.d.ts +4 -0
  12. package/dist/components/uikit/Checkbox/index.js +46 -0
  13. package/dist/components/uikit/Checkbox/types.d.ts +11 -0
  14. package/dist/components/uikit/Checkbox/types.js +5 -0
  15. package/dist/components/uikit/Dropdown/Dropdown.d.ts +4 -0
  16. package/dist/components/uikit/Dropdown/Dropdown.js +58 -0
  17. package/dist/components/uikit/Dropdown/DropdownItem.d.ts +4 -0
  18. package/dist/components/uikit/Dropdown/DropdownItem.js +47 -0
  19. package/dist/components/uikit/Dropdown/index.d.ts +3 -0
  20. package/dist/components/uikit/Dropdown/index.js +2 -0
  21. package/dist/components/uikit/Dropdown/styles.d.ts +4 -0
  22. package/dist/components/uikit/Dropdown/styles.js +16 -0
  23. package/dist/components/uikit/Dropdown/types.d.ts +58 -0
  24. package/dist/components/uikit/Dropdown/types.js +22 -0
  25. package/dist/components/uikit/Flex/index.d.ts +3 -0
  26. package/dist/components/uikit/Flex/index.js +29 -0
  27. package/dist/components/uikit/Input/Input.d.ts +4 -0
  28. package/dist/components/uikit/Input/Input.js +72 -0
  29. package/dist/components/uikit/Input/NumericInput.d.ts +10 -0
  30. package/dist/components/uikit/Input/NumericInput.js +35 -0
  31. package/dist/components/uikit/Input/StyledInput.d.ts +11 -0
  32. package/dist/components/uikit/Input/StyledInput.js +37 -0
  33. package/dist/components/uikit/Input/index.d.ts +3 -0
  34. package/dist/components/uikit/Input/index.js +3 -0
  35. package/dist/components/uikit/Link/index.d.ts +9 -0
  36. package/dist/components/uikit/Link/index.js +29 -0
  37. package/dist/components/uikit/Modal/ModalFooter.d.ts +4 -0
  38. package/dist/components/uikit/Modal/ModalFooter.js +32 -0
  39. package/dist/components/uikit/Modal/ModalHeader.d.ts +4 -0
  40. package/dist/components/uikit/Modal/ModalHeader.js +31 -0
  41. package/dist/components/uikit/Modal/index.d.ts +4 -0
  42. package/dist/components/uikit/Modal/index.js +55 -0
  43. package/dist/components/uikit/Modal/styles.d.ts +3 -0
  44. package/dist/components/uikit/Modal/styles.js +62 -0
  45. package/dist/components/uikit/Modal/types.d.ts +17 -0
  46. package/dist/components/uikit/Modal/types.js +1 -0
  47. package/dist/components/uikit/Select/Select.d.ts +4 -0
  48. package/dist/components/uikit/Select/Select.js +61 -0
  49. package/dist/components/uikit/Select/SelectItem.d.ts +4 -0
  50. package/dist/components/uikit/Select/SelectItem.js +40 -0
  51. package/dist/components/uikit/Select/index.d.ts +2 -0
  52. package/dist/components/uikit/Select/index.js +2 -0
  53. package/dist/components/uikit/Select/styles.d.ts +4 -0
  54. package/dist/components/uikit/Select/styles.js +50 -0
  55. package/dist/components/uikit/Select/types.d.ts +55 -0
  56. package/dist/components/uikit/Select/types.js +37 -0
  57. package/dist/components/uikit/Skeleton/index.d.ts +4 -0
  58. package/dist/components/uikit/Skeleton/index.js +31 -0
  59. package/dist/components/uikit/Skeleton/styles.d.ts +5 -0
  60. package/dist/components/uikit/Skeleton/styles.js +40 -0
  61. package/dist/components/uikit/Skeleton/types.d.ts +18 -0
  62. package/dist/components/uikit/Skeleton/types.js +10 -0
  63. package/dist/components/uikit/Spinner/apeSpinner.json +2764 -0
  64. package/dist/components/uikit/Spinner/index.d.ts +5 -0
  65. package/dist/components/uikit/Spinner/index.js +20 -0
  66. package/dist/components/uikit/SwiperDots/index.d.ts +6 -0
  67. package/dist/components/uikit/SwiperDots/index.js +14 -0
  68. package/dist/components/uikit/Tabs/Tab.d.ts +4 -0
  69. package/dist/components/uikit/Tabs/Tab.js +34 -0
  70. package/dist/components/uikit/Tabs/TabPanel.d.ts +4 -0
  71. package/dist/components/uikit/Tabs/TabPanel.js +29 -0
  72. package/dist/components/uikit/Tabs/Tabs.d.ts +4 -0
  73. package/dist/components/uikit/Tabs/Tabs.js +67 -0
  74. package/dist/components/uikit/Tabs/index.d.ts +2 -0
  75. package/dist/components/uikit/Tabs/index.js +2 -0
  76. package/dist/components/uikit/Tabs/styles.d.ts +3 -0
  77. package/dist/components/uikit/Tabs/styles.js +40 -0
  78. package/dist/components/uikit/Tabs/types.d.ts +54 -0
  79. package/dist/components/uikit/Tabs/types.js +22 -0
  80. package/dist/components/uikit/Tag/ListTag.d.ts +4 -0
  81. package/dist/components/uikit/Tag/ListTag.js +20 -0
  82. package/dist/components/uikit/Tag/Tag.d.ts +4 -0
  83. package/dist/components/uikit/Tag/Tag.js +42 -0
  84. package/dist/components/uikit/Tag/index.d.ts +3 -0
  85. package/dist/components/uikit/Tag/index.js +2 -0
  86. package/dist/components/uikit/Tag/styles.d.ts +5 -0
  87. package/dist/components/uikit/Tag/styles.js +44 -0
  88. package/dist/components/uikit/Tag/types.d.ts +48 -0
  89. package/dist/components/uikit/Tag/types.js +34 -0
  90. package/dist/components/uikit/Text/index.d.ts +4 -0
  91. package/dist/components/uikit/Text/index.js +35 -0
  92. package/dist/components/uikit/Text/types.d.ts +23 -0
  93. package/dist/components/uikit/Text/types.js +13 -0
  94. package/dist/components/uikit/Toggle/index.d.ts +4 -0
  95. package/dist/components/uikit/Toggle/index.js +63 -0
  96. package/dist/components/uikit/Toggle/styles.d.ts +3 -0
  97. package/dist/components/uikit/Toggle/styles.js +39 -0
  98. package/dist/components/uikit/Toggle/types.d.ts +31 -0
  99. package/dist/components/uikit/Toggle/types.js +17 -0
  100. package/dist/components/uikit/Tooltip/index.d.ts +4 -0
  101. package/dist/components/uikit/Tooltip/index.js +66 -0
  102. package/dist/components/uikit/Tooltip/styles.d.ts +4 -0
  103. package/dist/components/uikit/Tooltip/styles.js +60 -0
  104. package/dist/components/uikit/Tooltip/types.d.ts +17 -0
  105. package/dist/components/uikit/Tooltip/types.js +8 -0
  106. package/dist/components/uikit/TutorialModal/index.d.ts +4 -0
  107. package/dist/components/uikit/TutorialModal/index.js +52 -0
  108. package/dist/components/uikit/TutorialModal/styles.d.ts +8 -0
  109. package/dist/components/uikit/TutorialModal/styles.js +86 -0
  110. package/dist/components/uikit/TutorialModal/types.d.ts +22 -0
  111. package/dist/components/uikit/TutorialModal/types.js +1 -0
  112. package/dist/components/uikit/TutorialModal/useTutorialModal.d.ts +6 -0
  113. package/dist/components/uikit/TutorialModal/useTutorialModal.js +20 -0
  114. package/dist/components/uikit/index.d.ts +18 -0
  115. package/dist/components/uikit/index.js +20 -0
  116. package/dist/contexts/ModalContext.d.ts +14 -0
  117. package/dist/contexts/ModalContext.js +78 -0
  118. package/dist/hooks/useIsAbond.d.ts +3 -0
  119. package/dist/hooks/useIsAbond.js +10 -0
  120. package/dist/hooks/useModal.d.ts +3 -0
  121. package/dist/hooks/useModal.js +39 -0
  122. package/dist/utils/numbers.d.ts +5 -0
  123. package/dist/utils/numbers.js +111 -0
  124. package/package.json +7 -1
@@ -0,0 +1,63 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
24
+ import { useState, useEffect, useRef, useCallback } from 'react';
25
+ import { Box } from 'theme-ui';
26
+ import { Button } from '../Button';
27
+ import { sizes, togglePadding, fontSizes } from './types';
28
+ import styles from './styles';
29
+ import Text from '../Text';
30
+ var isBrowser = typeof window === 'object';
31
+ var Toggle = function (_a) {
32
+ var checked = _a.checked, labels = _a.labels, _b = _a.size, size = _b === void 0 ? sizes.MEDIUM : _b, className = _a.className, props = __rest(_a, ["checked", "labels", "size", "className"]);
33
+ var inputRef = useRef(null);
34
+ var leftRef = useRef(null);
35
+ var rightRef = useRef(null);
36
+ var _c = useState(checked), isChecked = _c[0], setIsChecked = _c[1];
37
+ var _d = useState({}), activeStyle = _d[0], setActiveStyle = _d[1];
38
+ var getActiveStyles = useCallback(function () {
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
40
+ return isBrowser
41
+ ? {
42
+ width: ((_d = (_c = (_b = (_a = (isChecked && size ? rightRef : leftRef)) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect) === null || _c === void 0 ? void 0 : _c.call(_b)) === null || _d === void 0 ? void 0 : _d.width) || 'fit-content',
43
+ left: isChecked && (rightRef === null || rightRef === void 0 ? void 0 : rightRef.current)
44
+ ? ((_g = (_f = (_e = rightRef === null || rightRef === void 0 ? void 0 : rightRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect) === null || _f === void 0 ? void 0 : _f.call(_e)) === null || _g === void 0 ? void 0 : _g.x) -
45
+ ((_l = (_k = (_j = (_h = rightRef === null || rightRef === void 0 ? void 0 : rightRef.current) === null || _h === void 0 ? void 0 : _h.parentNode) === null || _j === void 0 ? void 0 : _j.getBoundingClientRect) === null || _k === void 0 ? void 0 : _k.call(_j)) === null || _l === void 0 ? void 0 : _l.x)
46
+ : 0,
47
+ }
48
+ : {
49
+ right: isChecked ? 0 : undefined,
50
+ left: isChecked ? undefined : 0,
51
+ };
52
+ }, [isChecked, size]);
53
+ useEffect(function () {
54
+ setActiveStyle(function () { return getActiveStyles(); });
55
+ }, [getActiveStyles]);
56
+ var handleClick = function () {
57
+ var _a;
58
+ setIsChecked(!isChecked);
59
+ (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
60
+ };
61
+ return (_jsxs(Box, __assign({ className: className, sx: styles.container }, { children: [_jsx(Box, __assign({ ref: leftRef, sx: __assign(__assign({}, styles.switch), { background: 'white3', color: 'primaryButtonDisable', px: togglePadding[size].x, py: togglePadding[size].y, fontSize: fontSizes[size] }), onClick: handleClick }, { children: _jsx(Text, __assign({ variant: "sm", sx: { fontSize: fontSizes[size] }, weight: "bold" }, { children: labels[0] })) })), _jsx(Box, __assign({ ref: rightRef, sx: __assign(__assign({}, styles.switch), { background: 'white3', color: 'primaryButtonDisable', px: togglePadding[size].x, py: togglePadding[size].y, fontSize: fontSizes[size] }), onClick: handleClick }, { children: _jsx(Text, __assign({ variant: "sm", sx: { fontSize: fontSizes[size] }, weight: "bold" }, { children: labels[1] })) })), _jsx(Button, __assign({ sx: __assign(__assign(__assign({}, styles.button), activeStyle), { fontSize: fontSizes[size], px: togglePadding[size].x, py: togglePadding[size].y }) }, { children: isChecked ? labels[1] : labels[0] })), _jsx("input", __assign({ type: "checkbox", ref: inputRef, checked: isChecked, "aria-hidden": "true", tabIndex: -1 }, props, { sx: styles.input }))] })));
62
+ };
63
+ export default Toggle;
@@ -0,0 +1,3 @@
1
+ import { ThemeUIStyleObject } from 'theme-ui';
2
+ declare const styles: Record<string, ThemeUIStyleObject>;
3
+ export default styles;
@@ -0,0 +1,39 @@
1
+ var styles = {
2
+ container: {
3
+ display: 'flex',
4
+ borderRadius: '10px',
5
+ background: 'white3',
6
+ width: 'fit-content',
7
+ position: 'relative',
8
+ justifyItems: 'center',
9
+ },
10
+ switch: {
11
+ borderRadius: '10px',
12
+ px: '14px',
13
+ py: '9px',
14
+ cursor: 'pointer',
15
+ '&:hover': {
16
+ filter: '20%',
17
+ },
18
+ },
19
+ button: {
20
+ position: 'absolute',
21
+ border: 0,
22
+ top: 0,
23
+ height: '100%',
24
+ transition: 'left 0.2s linear',
25
+ textTransform: 'none',
26
+ '&:hover': {
27
+ filter: 'none',
28
+ },
29
+ },
30
+ input: {
31
+ bottom: 0,
32
+ left: 0,
33
+ position: 'absolute',
34
+ opacity: 0,
35
+ pointerEvents: 'none',
36
+ width: '100%',
37
+ },
38
+ };
39
+ export default styles;
@@ -0,0 +1,31 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ export declare enum sizes {
3
+ SMALL = "sm",
4
+ MEDIUM = "md",
5
+ LARGE = "lg"
6
+ }
7
+ export declare const togglePadding: {
8
+ sm: {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ md: {
13
+ x: number;
14
+ y: number;
15
+ };
16
+ lg: {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ };
21
+ export declare const fontSizes: {
22
+ sm: number;
23
+ md: number;
24
+ lg: number;
25
+ };
26
+ export type sizeProps = `${sizes}`;
27
+ export interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
28
+ checked?: boolean;
29
+ labels: [string, string];
30
+ size?: sizeProps;
31
+ }
@@ -0,0 +1,17 @@
1
+ var _a, _b;
2
+ export var sizes;
3
+ (function (sizes) {
4
+ sizes["SMALL"] = "sm";
5
+ sizes["MEDIUM"] = "md";
6
+ sizes["LARGE"] = "lg";
7
+ })(sizes || (sizes = {}));
8
+ export var togglePadding = (_a = {},
9
+ _a[sizes.SMALL] = { x: 4, y: 2 },
10
+ _a[sizes.MEDIUM] = { x: 6, y: 3 },
11
+ _a[sizes.LARGE] = { x: 8, y: 4 },
12
+ _a);
13
+ export var fontSizes = (_b = {},
14
+ _b[sizes.SMALL] = 0,
15
+ _b[sizes.MEDIUM] = 1,
16
+ _b[sizes.LARGE] = 2,
17
+ _b);
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { TooltipProps } from './types';
3
+ declare const TooltipBubble: React.FC<TooltipProps>;
4
+ export default TooltipBubble;
@@ -0,0 +1,66 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ var _a;
24
+ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
25
+ import { Box } from 'theme-ui';
26
+ import { placements } from './types';
27
+ import style, { container } from './styles';
28
+ var placementStyles = (_a = {},
29
+ _a[placements.BOTTOMLEFT] = {
30
+ top: 'calc(100% + 15px)',
31
+ left: 0,
32
+ },
33
+ _a[placements.BOTTOMRIGHT] = {
34
+ top: 'calc(100% + 15px)',
35
+ right: 0,
36
+ },
37
+ _a[placements.TOPLEFT] = {
38
+ bottom: 'calc(100% + 15px)',
39
+ left: 0,
40
+ },
41
+ _a[placements.TOPRIGHT] = {
42
+ bottom: 'calc(100% + 15px)',
43
+ right: 0,
44
+ },
45
+ _a[placements.ONLYCONTAINERRIGHT] = {
46
+ top: 'calc(100% + 15px)',
47
+ right: 0,
48
+ },
49
+ _a);
50
+ var TooltipBubble = function (_a) {
51
+ var width = _a.width, _b = _a.placement, placement = _b === void 0 ? placements.BOTTOMRIGHT : _b, body = _a.body, backgroundColor = _a.backgroundColor, hideTooltip = _a.hideTooltip, children = _a.children, transformTip = _a.transformTip, props = __rest(_a, ["width", "placement", "body", "backgroundColor", "hideTooltip", "children", "transformTip"]);
52
+ var backgroundColorStyle = backgroundColor
53
+ ? {
54
+ backgroundColor: backgroundColor,
55
+ '&:before': {
56
+ borderBottomColor: placement === placements.BOTTOMLEFT || placement === placements.BOTTOMRIGHT ? backgroundColor : undefined,
57
+ borderTopColor: placement === placements.TOPLEFT || placement === placements.TOPRIGHT ? backgroundColor : undefined,
58
+ },
59
+ }
60
+ : {};
61
+ var handleClick = function (event) {
62
+ event.stopPropagation();
63
+ };
64
+ return (_jsxs(Box, __assign({ sx: container(hideTooltip), onClick: handleClick }, { children: [_jsx(Box, __assign({ sx: __assign({ position: 'absolute' }, (placementStyles[placement] || {})) }, { children: _jsx(Box, __assign({ sx: __assign(__assign(__assign(__assign({ position: 'relative' }, style.default), style[placement]), backgroundColorStyle), { width: width, transform: transformTip }) }, props, { children: body })) })), children] })));
65
+ };
66
+ export default TooltipBubble;
@@ -0,0 +1,4 @@
1
+ import { ThemeUIStyleObject } from 'theme-ui';
2
+ export declare const container: (hide?: boolean) => ThemeUIStyleObject;
3
+ declare const styles: Record<string, ThemeUIStyleObject>;
4
+ export default styles;
@@ -0,0 +1,60 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var baseStyle = {
13
+ p: 9,
14
+ borderRadius: 'normal',
15
+ background: 'white2',
16
+ width: 'max-content',
17
+ zIndex: 'modal',
18
+ boxShadow: "0px 0px 30px rgb(200,200,200, .4)",
19
+ };
20
+ var baseDirectionArrow = {
21
+ content: '""',
22
+ display: 'block',
23
+ width: 0,
24
+ border: '12px solid transparent',
25
+ };
26
+ var topArrow = __assign(__assign({ bottom: 0 }, baseDirectionArrow), { borderBottom: 0, borderTopWidth: '15px', borderTopStyle: 'solid', transform: 'translate(-50%, calc(100%))' });
27
+ var bottomArrow = __assign(__assign({ top: 0 }, baseDirectionArrow), { borderTop: 0, borderBottomWidth: '15px', borderBottomStyle: 'solid', transform: 'translate(-50%, calc(-100%))' });
28
+ export var container = function (hide) { return ({
29
+ position: 'relative',
30
+ display: 'inline-block',
31
+ '& > div:first-of-type': {
32
+ display: 'none',
33
+ },
34
+ '&:hover > div:first-of-type': {
35
+ display: hide ? 'none' : 'block',
36
+ },
37
+ }); };
38
+ var styles = {
39
+ default: __assign({ color: 'text', fontSize: 0, lineHeight: '18px', fontWeight: 'normal' }, baseStyle),
40
+ bottomRight: {
41
+ '&::before': __assign(__assign({ position: 'absolute' }, bottomArrow), { right: '3%', borderBottomColor: 'white2' }),
42
+ },
43
+ bottomLeft: {
44
+ '&::before': __assign(__assign({ position: 'absolute' }, bottomArrow), { left: 'calc(3% + 15px)', borderBottomColor: 'white2' }),
45
+ },
46
+ topRight: {
47
+ '&::before': __assign(__assign({ position: 'absolute' }, topArrow), { right: '3%', borderTopColor: 'white2' }),
48
+ },
49
+ topLeft: {
50
+ '&::before': __assign(__assign({ position: 'absolute' }, topArrow), { left: 'calc(3% + 15px)', borderTopColor: 'white2' }),
51
+ },
52
+ onlyContainerRight: {
53
+ '&::before': {
54
+ position: 'absolute',
55
+ right: '3%',
56
+ borderBottomColor: 'white2',
57
+ },
58
+ },
59
+ };
60
+ export default styles;
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { BoxProps } from 'theme-ui';
3
+ export declare enum placements {
4
+ TOPRIGHT = "topRight",
5
+ TOPLEFT = "topLeft",
6
+ BOTTOMRIGHT = "bottomRight",
7
+ BOTTOMLEFT = "bottomLeft",
8
+ ONLYCONTAINERRIGHT = "onlyContainerRight"
9
+ }
10
+ export type placementProps = `${placements}`;
11
+ export interface TooltipProps extends BoxProps {
12
+ width?: string;
13
+ placement?: placementProps;
14
+ body: ReactNode;
15
+ hideTooltip?: boolean;
16
+ transformTip?: string;
17
+ }
@@ -0,0 +1,8 @@
1
+ export var placements;
2
+ (function (placements) {
3
+ placements["TOPRIGHT"] = "topRight";
4
+ placements["TOPLEFT"] = "topLeft";
5
+ placements["BOTTOMRIGHT"] = "bottomRight";
6
+ placements["BOTTOMLEFT"] = "bottomLeft";
7
+ placements["ONLYCONTAINERRIGHT"] = "onlyContainerRight";
8
+ })(placements || (placements = {}));
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { TModalProps } from './types';
3
+ declare const TutorialModal: React.FC<TModalProps>;
4
+ export default TutorialModal;
@@ -0,0 +1,52 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
+ if (ar || !(i in from)) {
15
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
+ ar[i] = from[i];
17
+ }
18
+ }
19
+ return to.concat(ar || Array.prototype.slice.call(from));
20
+ };
21
+ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
22
+ import { useState } from 'react';
23
+ import { Box } from 'theme-ui';
24
+ import { styles, dynamicStyles } from './styles';
25
+ import { Button, Flex, Modal, Text } from '../../uikit';
26
+ import { useIsAbond } from '../../../hooks/useIsAbond';
27
+ var Circle = function (_a) {
28
+ var index = _a.index, goToStep = _a.goToStep, isActive = _a.isActive;
29
+ return (_jsx(Flex, { sx: dynamicStyles.allCircle({ isActive: isActive }), onClick: goToStep }, "circle-".concat(index)));
30
+ };
31
+ var TutorialModal = function (_a) {
32
+ var type = _a.type, title = _a.title, description = _a.description, children = _a.children, onDismiss = _a.onDismiss, t = _a.t, isConnected = _a.isConnected;
33
+ var _b = useState(0), step = _b[0], setStep = _b[1];
34
+ var slideNumber = isConnected ? step + 1 : step;
35
+ var isAbond = useIsAbond();
36
+ var handleNext = function () {
37
+ setStep(step + 1);
38
+ };
39
+ var renderChildren = function () {
40
+ return children === null || children === void 0 ? void 0 : children.map(function (element, i) { return (_jsx(Flex, { children: step === i && (_jsx(Flex, __assign({ sx: { width: '100%', flexWrap: 'wrap', mt: ['15px', '15px', '15px', '30px'] } }, { children: element }))) }, i)); });
41
+ };
42
+ var renderDots = function () {
43
+ return __spreadArray([], Array(children === null || children === void 0 ? void 0 : children.length), true).map(function (_, index) { return (_jsx(Circle, { index: index, goToStep: function () { return setStep(index); }, isActive: index === step }, index)); });
44
+ };
45
+ return (_jsx(Modal, __assign({ zIndex: 101, onDismiss: onDismiss, sx: {
46
+ width: ['280px', '280px', '280px', '873px'],
47
+ minWidth: ['280px', '280px', '280px', '873px'],
48
+ height: ['', '', '', '500px'],
49
+ overflow: 'visible',
50
+ } }, { children: _jsxs(Flex, __assign({ className: "tutorial-modal", sx: styles.modalCon }, { children: [_jsx(Flex, __assign({ width: 22, onClick: onDismiss, sx: { cursor: 'pointer', position: 'absolute', right: '20px' } }, { children: _jsx(Text, { children: "x" }) })), _jsxs(Flex, __assign({ sx: styles.contentBody }, { children: [_jsx(Box, { sx: dynamicStyles.showApe({ slideNumber: slideNumber, type: type, isAbond: isAbond }) }), _jsxs(Flex, __assign({ sx: __assign(__assign({}, styles.rightCon), { maxWidth: ['', '', '', '55%'] }) }, { children: [_jsxs(Flex, __assign({ sx: styles.right }, { children: [_jsxs(Flex, __assign({ sx: styles.modalHeader }, { children: [_jsx(Text, __assign({ sx: styles.title }, { children: t("".concat(title)) })), _jsx(Text, __assign({ sx: styles.description }, { children: t("".concat(description)) }))] })), renderChildren()] })), _jsxs(Flex, __assign({ sx: __assign(__assign({}, styles.modalFooter), { alignItems: ['center', 'center', 'center', 'flex-start'] }) }, { children: [_jsx(Flex, __assign({ sx: styles.circles }, { children: renderDots() })), _jsx(Button, __assign({ onClick: step >= ((children === null || children === void 0 ? void 0 : children.length) || 0) - 1 ? onDismiss : handleNext, sx: styles.readyBtn }, { children: step >= ((children === null || children === void 0 ? void 0 : children.length) || 0) - 1 ? t("I'm Ready") : t('Next') }))] }))] }))] }))] })) })));
51
+ };
52
+ export default TutorialModal;
@@ -0,0 +1,8 @@
1
+ import { ThemeUIStyleObject } from 'theme-ui';
2
+ export declare const dynamicStyles: Record<'showApe' | 'allCircle', (props: {
3
+ slideNumber?: number;
4
+ type?: string;
5
+ isActive?: boolean;
6
+ isAbond?: boolean;
7
+ }) => ThemeUIStyleObject>;
8
+ export declare const styles: Record<'modalCon' | 'contentBody' | 'rightCon' | 'right' | 'modalHeader' | 'title' | 'description' | 'circles' | 'readyBtn' | 'modalFooter', ThemeUIStyleObject>;
@@ -0,0 +1,86 @@
1
+ export var dynamicStyles = {
2
+ showApe: function (_a) {
3
+ var slideNumber = _a.slideNumber, type = _a.type, isAbond = _a.isAbond;
4
+ return ({
5
+ alignSelf: ['center', 'center', ''],
6
+ width: ['200px', '200px', '200px', '340px'],
7
+ height: ['200px', '200px', '200px', '340px'],
8
+ background: isAbond
9
+ ? "url(images/tutorial-modals/abond/".concat(type, "-").concat(slideNumber, ".svg)")
10
+ : "url(images/tutorial-modals/".concat(type, "-").concat(slideNumber, ".svg)"),
11
+ backgroundRepeat: 'no-repeat',
12
+ backgroundPosition: 'center',
13
+ backgroundSize: 'cover',
14
+ });
15
+ },
16
+ allCircle: function (_a) {
17
+ var isActive = _a.isActive;
18
+ return ({
19
+ width: '8px',
20
+ height: '8px',
21
+ background: isActive ? 'home.title' : 'white4',
22
+ borderRadius: '50%',
23
+ mr: '10px',
24
+ cursor: 'pointer',
25
+ '&.last-child': {
26
+ mr: 0,
27
+ },
28
+ });
29
+ },
30
+ };
31
+ export var styles = {
32
+ modalCon: {
33
+ height: '100%',
34
+ },
35
+ contentBody: {
36
+ flexDirection: ['column', 'column', 'column', 'row'],
37
+ width: '100%',
38
+ alignItems: 'center',
39
+ height: '100%',
40
+ justifyContent: ['', '', '', 'space-between'],
41
+ },
42
+ rightCon: {
43
+ width: '100%',
44
+ flexDirection: 'column',
45
+ flex: 1,
46
+ mr: ['', '', '', '10px'],
47
+ },
48
+ right: {
49
+ flexDirection: 'column',
50
+ height: '100%',
51
+ minHeight: '270px',
52
+ },
53
+ modalHeader: {
54
+ flexDirection: ['column'],
55
+ },
56
+ title: {
57
+ fontWeight: 700,
58
+ fontSize: ['18px', '18px', '18px', '24px'],
59
+ lineHeight: ['22px', '22px', '22px', '36px'],
60
+ textTransform: ['capitalize', 'capitalize', 'capitalize', 'uppercase'],
61
+ mt: ['10px'],
62
+ },
63
+ description: {
64
+ fontWeight: 400,
65
+ fontSize: '12px',
66
+ lineHeight: '18px',
67
+ textTransform: 'none',
68
+ opacity: 0.5,
69
+ mt: ['7px', '7px', '7px', 0],
70
+ },
71
+ circles: {
72
+ justifyContent: 'space-between',
73
+ alignItems: 'center',
74
+ padding: ['8px', '8px', '8px', '8px 8px 8px 0px'],
75
+ },
76
+ readyBtn: {
77
+ mt: '10px',
78
+ textTransform: 'uppercase',
79
+ height: '40px',
80
+ width: ['100%', '100%', '100%', '240px'],
81
+ },
82
+ modalFooter: {
83
+ flexDirection: 'column',
84
+ justifyContent: 'center',
85
+ },
86
+ };
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ export type ActionHandler = () => void;
3
+ export interface TModalProps {
4
+ t: (key: string) => string;
5
+ onDismiss: ActionHandler;
6
+ type: string;
7
+ title: string;
8
+ description?: string;
9
+ children: React.ReactNode[];
10
+ isConnected: boolean;
11
+ width?: string;
12
+ }
13
+ export interface CountProps {
14
+ index: number;
15
+ goToStep: ActionHandler;
16
+ isActive: boolean;
17
+ }
18
+ export interface ShowApeType {
19
+ slideNumber?: number;
20
+ type?: string;
21
+ isAbond?: boolean;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { TModalProps } from './types';
2
+ interface ReturnType {
3
+ onPresentTutorialModal: () => void;
4
+ }
5
+ declare const useTutorialModal: ({ type, children, title, description, onDismiss, t, isConnected, width, }: TModalProps) => ReturnType;
6
+ export default useTutorialModal;
@@ -0,0 +1,20 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "theme-ui/jsx-runtime";
13
+ import useModal from '../../../hooks/useModal';
14
+ import TutorialModal from '.';
15
+ var useTutorialModal = function (_a) {
16
+ var type = _a.type, children = _a.children, title = _a.title, description = _a.description, onDismiss = _a.onDismiss, t = _a.t, isConnected = _a.isConnected, width = _a.width;
17
+ var onPresentTutorialModal = useModal(_jsx(TutorialModal, __assign({ type: type, title: title, description: description, onDismiss: onDismiss, t: t, isConnected: isConnected, width: width }, { children: children })), true, false, 'TutorialModal')[0];
18
+ return { onPresentTutorialModal: onPresentTutorialModal };
19
+ };
20
+ export default useTutorialModal;
@@ -0,0 +1,18 @@
1
+ export { default as Svg } from './Svg';
2
+ export { default as Flex } from './Flex';
3
+ export { default as Text } from './Text';
4
+ export { default as Skeleton } from './Skeleton';
5
+ export { default as Modal } from './Modal';
6
+ export { default as CheckBox } from './Checkbox';
7
+ export { default as Tooltip } from './Tooltip';
8
+ export { default as TutorialModal } from './TutorialModal';
9
+ export { default as Spinner } from './Spinner';
10
+ export { default as Link } from './Link';
11
+ export { default as Toggle } from './Toggle';
12
+ export { default as SwiperDots } from './SwiperDots';
13
+ export { Button, IconButton } from './Button';
14
+ export { Select, SelectItem } from './Select';
15
+ export { NumericInput, Input, StyledInput } from './Input';
16
+ export { Tabs, Tab } from './Tabs';
17
+ export { Tag, ListTag } from './Tag';
18
+ export { Dropdown, DropdownItem } from './Dropdown';
@@ -0,0 +1,20 @@
1
+ // Defaults
2
+ export { default as Svg } from './Svg';
3
+ export { default as Flex } from './Flex';
4
+ export { default as Text } from './Text';
5
+ export { default as Skeleton } from './Skeleton';
6
+ export { default as Modal } from './Modal';
7
+ export { default as CheckBox } from './Checkbox';
8
+ export { default as Tooltip } from './Tooltip';
9
+ export { default as TutorialModal } from './TutorialModal';
10
+ export { default as Spinner } from './Spinner';
11
+ export { default as Link } from './Link';
12
+ export { default as Toggle } from './Toggle';
13
+ export { default as SwiperDots } from './SwiperDots';
14
+ // Exports
15
+ export { Button, IconButton } from './Button';
16
+ export { Select, SelectItem } from './Select';
17
+ export { NumericInput, Input, StyledInput } from './Input';
18
+ export { Tabs, Tab } from './Tabs';
19
+ export { Tag, ListTag } from './Tag';
20
+ export { Dropdown, DropdownItem } from './Dropdown';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface ModalsContext {
3
+ nodeId: string[];
4
+ modalNode: React.ReactNode[];
5
+ setModalNode: React.Dispatch<React.SetStateAction<React.ReactNode[]>>;
6
+ onPresent: (node: React.ReactNode, newNodeId: string, clearModalStack: boolean) => void;
7
+ handleClose: () => void;
8
+ setCloseOnOverlayClick: React.Dispatch<React.SetStateAction<boolean>>;
9
+ }
10
+ export declare const Context: React.Context<ModalsContext>;
11
+ declare const ModalProvider: ({ children }: {
12
+ children: React.ReactNode;
13
+ }) => React.JSX.Element;
14
+ export default ModalProvider;