rujira.ui 1.0.0 → 1.0.2

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 (120) hide show
  1. package/lib/esm/wallets/providers/ton.js +1 -1
  2. package/package.json +8 -8
  3. package/src/wallets/providers/ton.ts +1 -1
  4. package/lib/cjs/assets/tokens/index.js +0 -21
  5. package/lib/cjs/components/AssetLabel.js +0 -9
  6. package/lib/cjs/components/balance/OmniBalance.js +0 -28
  7. package/lib/cjs/components/bridges/BuyModal.js +0 -8
  8. package/lib/cjs/components/bridges/DepositModal.js +0 -131
  9. package/lib/cjs/components/buttons/Button.js +0 -52
  10. package/lib/cjs/components/buttons/Popout.js +0 -63
  11. package/lib/cjs/components/buttons/TxButton.js +0 -171
  12. package/lib/cjs/components/buttons/__Popout.js +0 -39
  13. package/lib/cjs/components/cards/Card.js +0 -12
  14. package/lib/cjs/components/cards/GradientCard.js +0 -12
  15. package/lib/cjs/components/cards/ShareCard.js +0 -16
  16. package/lib/cjs/components/chart/RangeLiquidityChart.js +0 -118
  17. package/lib/cjs/components/footer/Footer.js +0 -15
  18. package/lib/cjs/components/header/Accounts.js +0 -129
  19. package/lib/cjs/components/header/Header.js +0 -197
  20. package/lib/cjs/components/header/Pending.js +0 -47
  21. package/lib/cjs/components/header/QuickLauncher.js +0 -15
  22. package/lib/cjs/components/header/ResolveLink.js +0 -17
  23. package/lib/cjs/components/icons/IconDenom.js +0 -391
  24. package/lib/cjs/components/icons/Icons.js +0 -350
  25. package/lib/cjs/components/icons/NetworkIcon.js +0 -44
  26. package/lib/cjs/components/icons/Networks.js +0 -145
  27. package/lib/cjs/components/icons/Wallets.js +0 -140
  28. package/lib/cjs/components/inputs/Checkbox.js +0 -15
  29. package/lib/cjs/components/inputs/DecimalInput.js +0 -53
  30. package/lib/cjs/components/inputs/DenomInput.js +0 -29
  31. package/lib/cjs/components/inputs/Input.js +0 -29
  32. package/lib/cjs/components/inputs/Numeric.js +0 -24
  33. package/lib/cjs/components/inputs/Radio.js +0 -15
  34. package/lib/cjs/components/inputs/Select.js +0 -32
  35. package/lib/cjs/components/inputs/SwapSelect.js +0 -85
  36. package/lib/cjs/components/inputs/Textarea.js +0 -28
  37. package/lib/cjs/components/inputs/Toggle.js +0 -17
  38. package/lib/cjs/components/loader/Loader.js +0 -9
  39. package/lib/cjs/components/logos/RujiraLogo.js +0 -10
  40. package/lib/cjs/components/notices/Warning.js +0 -14
  41. package/lib/cjs/components/numbers/Decimal.js +0 -30
  42. package/lib/cjs/components/numbers/Fiat.js +0 -22
  43. package/lib/cjs/components/pagination/Pagination.js +0 -15
  44. package/lib/cjs/components/progress/Progress.js +0 -13
  45. package/lib/cjs/components/slider/Slider.js +0 -9
  46. package/lib/cjs/components/table/SortItem.js +0 -52
  47. package/lib/cjs/context/GlobalModal.js +0 -48
  48. package/lib/cjs/helpers/index.js +0 -167
  49. package/lib/cjs/helpers/number.js +0 -8
  50. package/lib/cjs/hooks/useClickOutside.js +0 -22
  51. package/lib/cjs/hooks/useEventCallback.js +0 -14
  52. package/lib/cjs/hooks/useEventListener.js +0 -57
  53. package/lib/cjs/hooks/useIsTouchDevice.js +0 -20
  54. package/lib/cjs/hooks/useIsomorphicLayoutEffect.js +0 -18
  55. package/lib/cjs/hooks/useLocalStorage.js +0 -123
  56. package/lib/cjs/hooks/useQueryParam.js +0 -36
  57. package/lib/cjs/hooks/useWindowSize.js +0 -51
  58. package/lib/cjs/i18n/I18nProvider.js +0 -54
  59. package/lib/cjs/i18n/TranslationProvider.js +0 -10
  60. package/lib/cjs/i18n/config.js +0 -101
  61. package/lib/cjs/i18n/index.js +0 -16
  62. package/lib/cjs/i18n/locales/de/borrow.json +0 -50
  63. package/lib/cjs/i18n/locales/de/common.json +0 -107
  64. package/lib/cjs/i18n/locales/de/ecosystem.json +0 -56
  65. package/lib/cjs/i18n/locales/de/header.json +0 -86
  66. package/lib/cjs/i18n/locales/de/index.json +0 -57
  67. package/lib/cjs/i18n/locales/de/leagues.json +0 -20
  68. package/lib/cjs/i18n/locales/de/merge.json +0 -41
  69. package/lib/cjs/i18n/locales/de/portfolio.json +0 -97
  70. package/lib/cjs/i18n/locales/de/strategies.json +0 -159
  71. package/lib/cjs/i18n/locales/de/swap.json +0 -30
  72. package/lib/cjs/i18n/locales/de/trade.json +0 -188
  73. package/lib/cjs/i18n/locales/en/borrow.json +0 -50
  74. package/lib/cjs/i18n/locales/en/common.json +0 -107
  75. package/lib/cjs/i18n/locales/en/ecosystem.json +0 -56
  76. package/lib/cjs/i18n/locales/en/header.json +0 -86
  77. package/lib/cjs/i18n/locales/en/index.json +0 -57
  78. package/lib/cjs/i18n/locales/en/leagues.json +0 -20
  79. package/lib/cjs/i18n/locales/en/merge.json +0 -41
  80. package/lib/cjs/i18n/locales/en/portfolio.json +0 -97
  81. package/lib/cjs/i18n/locales/en/strategies.json +0 -159
  82. package/lib/cjs/i18n/locales/en/swap.json +0 -30
  83. package/lib/cjs/i18n/locales/en/trade.json +0 -188
  84. package/lib/cjs/i18n/useTranslation.js +0 -21
  85. package/lib/cjs/index.js +0 -70
  86. package/lib/cjs/package.json +0 -3
  87. package/lib/cjs/wallets/config/gaia.js +0 -51
  88. package/lib/cjs/wallets/config/index.js +0 -9
  89. package/lib/cjs/wallets/config/kujira.js +0 -62
  90. package/lib/cjs/wallets/config/noble.js +0 -47
  91. package/lib/cjs/wallets/config/osmo.js +0 -51
  92. package/lib/cjs/wallets/config/thor.js +0 -50
  93. package/lib/cjs/wallets/index.js +0 -19
  94. package/lib/cjs/wallets/providers/brave.js +0 -4
  95. package/lib/cjs/wallets/providers/coinbase.js +0 -4
  96. package/lib/cjs/wallets/providers/cosmos.js +0 -152
  97. package/lib/cjs/wallets/providers/ctrl.js +0 -125
  98. package/lib/cjs/wallets/providers/daodao.js +0 -12
  99. package/lib/cjs/wallets/providers/eip1193.js +0 -155
  100. package/lib/cjs/wallets/providers/eip6963.js +0 -20
  101. package/lib/cjs/wallets/providers/eip712.js +0 -63
  102. package/lib/cjs/wallets/providers/index.js +0 -62
  103. package/lib/cjs/wallets/providers/keplr.js +0 -82
  104. package/lib/cjs/wallets/providers/leap.js +0 -36
  105. package/lib/cjs/wallets/providers/ledger/Modal.js +0 -23
  106. package/lib/cjs/wallets/providers/ledger.js +0 -93
  107. package/lib/cjs/wallets/providers/metamask.js +0 -4
  108. package/lib/cjs/wallets/providers/okx.js +0 -79
  109. package/lib/cjs/wallets/providers/rabby.js +0 -4
  110. package/lib/cjs/wallets/providers/station.js +0 -6
  111. package/lib/cjs/wallets/providers/ton.js +0 -57
  112. package/lib/cjs/wallets/providers/tronlink.js +0 -58
  113. package/lib/cjs/wallets/providers/trust.js +0 -4
  114. package/lib/cjs/wallets/providers/utils.js +0 -32
  115. package/lib/cjs/wallets/providers/utxo.js +0 -107
  116. package/lib/cjs/wallets/providers/vulticonnect.js +0 -157
  117. package/lib/cjs/wallets/providers/vultisig.js +0 -45
  118. package/lib/cjs/wallets/providers/xaman.js +0 -70
  119. package/lib/cjs/wallets/storage.js +0 -58
  120. package/lib/esm/package.json +0 -3
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Select = Select;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const react_1 = require("react");
7
- const Icons_1 = require("../icons/Icons");
8
- function Select({ id, label, value, className, onChange, onSubmit, labelClassName, containerClassName, children, ...rest }) {
9
- (0, react_1.useEffect)(() => {
10
- const handleUserKeyPress = (event) => {
11
- const { keyCode } = event;
12
- if (keyCode === 13) {
13
- onSubmit?.();
14
- }
15
- };
16
- window.addEventListener("keydown", handleUserKeyPress);
17
- return () => {
18
- window.removeEventListener("keydown", handleUserKeyPress);
19
- };
20
- }, [onSubmit]);
21
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)({
22
- "select-container": true,
23
- [`${containerClassName}`]: containerClassName,
24
- }), children: [(0, jsx_runtime_1.jsx)("select", { ...rest, className: (0, clsx_1.default)({
25
- select: true,
26
- "select--nolabel": !label,
27
- [`${className}`]: className,
28
- }), id: id, value: value, onChange: onChange, children: children }), label && ((0, jsx_runtime_1.jsx)("label", { htmlFor: id, className: (0, clsx_1.default)({
29
- label: true,
30
- [`${labelClassName}`]: labelClassName,
31
- }), children: label })), (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, { className: "arrow" })] }));
32
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TokenSelect = exports.SwapSelect = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const react_1 = require("react");
7
- const rujira_js_1 = require("rujira.js");
8
- const helpers_1 = require("../../helpers");
9
- const i18n_1 = require("../../i18n");
10
- const AssetLabel_1 = require("../AssetLabel");
11
- const Button_1 = require("../buttons/Button");
12
- const IconDenom_1 = require("../icons/IconDenom");
13
- const Icons_1 = require("../icons/Icons");
14
- const NetworkIcon_1 = require("../icons/NetworkIcon");
15
- const Decimal_1 = require("../numbers/Decimal");
16
- const Fiat_1 = require("../numbers/Fiat");
17
- const DecimalInput_1 = require("./DecimalInput");
18
- const SwapSelect = ({ selected, options, onSelect, searchValue = "", amount, onChangeAmount, disabled, full, max, label, className, value, hideSelected = false, }) => {
19
- const { t } = (0, i18n_1.useTranslation)("common");
20
- const readonly = !onChangeAmount;
21
- const node = (0, react_1.useRef)(null);
22
- const srch = (0, react_1.useRef)(null);
23
- const [open, setOpen] = (0, react_1.useState)(false);
24
- const [search, setSearch] = (0, react_1.useState)(searchValue);
25
- const id = (0, react_1.useMemo)(() => (0, helpers_1.uuidv4)(), []);
26
- (0, react_1.useEffect)(() => {
27
- if (open) {
28
- document.addEventListener("mousedown", handleClickOutside);
29
- }
30
- else {
31
- document.removeEventListener("mousedown", handleClickOutside);
32
- }
33
- return () => {
34
- document.removeEventListener("mousedown", handleClickOutside);
35
- };
36
- }, [open]);
37
- (0, react_1.useEffect)(() => {
38
- const ref = srch.current;
39
- if (ref && open) {
40
- ref.focus();
41
- }
42
- if (!open) {
43
- setSearch("");
44
- }
45
- }, [open]);
46
- const handleClickOutside = (e) => {
47
- const ref = node.current;
48
- if (ref) {
49
- if (ref.contains(e.target)) {
50
- return;
51
- }
52
- }
53
- e.stopPropagation();
54
- e.stopImmediatePropagation();
55
- setOpen(false);
56
- return false;
57
- };
58
- return ((0, jsx_runtime_1.jsxs)("div", { ref: node, className: (0, clsx_1.default)({
59
- "swap-select condensed": true,
60
- "swap-select--open": open,
61
- "swap-select--full": full,
62
- "swap-select--disabled": disabled || options?.length === 0,
63
- "swap-select--haslabel": label,
64
- "swap-select--noselected": hideSelected,
65
- [`${className}`]: className,
66
- }), children: [label && ((0, jsx_runtime_1.jsx)("label", { className: "fs-16 fw-500 color-white", htmlFor: id, children: t(label) })), max !== undefined && ((0, jsx_runtime_1.jsx)(Button_1.Button, { className: "button--xsmall button--icon-right swap-select__max", label: t("max"), onClick: () => onChangeAmount && onChangeAmount(max), children: (0, jsx_runtime_1.jsx)(Decimal_1.Decimal, { amount: max, className: "fw-700" }) })), !hideSelected && ((0, jsx_runtime_1.jsxs)("div", { className: "swap-select__selected", onClick: () => options && !disabled && setOpen(true), children: [open ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "swap-select__search-icon", children: (0, jsx_runtime_1.jsx)(Icons_1.Glass, {}) }), (0, jsx_runtime_1.jsx)("input", { ref: srch, className: "swap-select__search", value: search, onChange: (e) => setSearch(e.currentTarget.value), autoComplete: "off" })] })) : selected ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(IconDenom_1.IconDenom, { denom: selected.metadata.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "flex wrap dir-c ai-s swap-select__symbol", children: (0, jsx_runtime_1.jsx)("span", { children: selected.metadata.symbol }) })] })) : ((0, jsx_runtime_1.jsx)("div", { className: "flex wrap swap-select__symbol", children: (0, jsx_runtime_1.jsx)("span", { className: "mr-1", children: "..." }) })), options && (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, {})] })), (0, jsx_runtime_1.jsxs)("div", { className: "swap-select__value", children: [(0, jsx_runtime_1.jsx)(DecimalInput_1.DecimalInput, { getInputRef: node, disabled: readonly || disabled, amount: amount, onAmountchange: (e) => onChangeAmount && onChangeAmount(e), id: id, className: (0, clsx_1.default)({
67
- "w-full swap-select__input": true,
68
- "has-value": value !== undefined,
69
- }), autoComplete: "off" }), value !== undefined && ((0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: value, symbol: "$", decimals: 8, className: "color-grey fs-14 ml-a" }))] }), open && options && ((0, jsx_runtime_1.jsxs)("div", { className: "swap-select__dropdown", children: [options
70
- .filter((v) => v.asset.metadata.symbol
71
- .toLowerCase()
72
- .includes(search.toLowerCase()))
73
- .map((a) => ((0, jsx_runtime_1.jsxs)("a", { onClick: () => {
74
- setOpen(false);
75
- onSelect && onSelect(a.asset);
76
- }, children: [(0, jsx_runtime_1.jsx)(IconDenom_1.IconDenom, { denom: a.asset.metadata.symbol }), a.asset.metadata.symbol, a.balance === undefined ? null : ((0, jsx_runtime_1.jsxs)("div", { className: "swap-select__balance fs-14 text-right", children: [(0, jsx_runtime_1.jsx)(Decimal_1.Decimal, { amount: a.balance, decimals: a.asset.metadata.decimals }), a.valueUsd !== undefined && a.valueUsd > 0n && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: a.valueUsd, symbol: "$", decimals: 8, className: "fs-12 color-white" })] }))] }))] }, a.asset.asset))), options.filter((v) => v.asset.metadata.symbol.toLowerCase().includes(search.toLowerCase())).length === 0 && (0, jsx_runtime_1.jsx)("a", { children: t("noResults") })] }))] }));
77
- };
78
- exports.SwapSelect = SwapSelect;
79
- const TokenSelect = ({ selected, className, onClick, network, address, }) => {
80
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, clsx_1.default)({
81
- "token-select condensed": true,
82
- [`${className}`]: className,
83
- }), onClick: onClick, children: (0, jsx_runtime_1.jsxs)("div", { className: "token-select__selected", children: [selected ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(IconDenom_1.IconDenom, { denom: selected.metadata.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "token-select__symbol", children: (0, jsx_runtime_1.jsx)(AssetLabel_1.AssetLabel, { asset: selected, Container: ({ children }) => ((0, jsx_runtime_1.jsx)("span", { className: "color-grey fs-14 fs-lg-16", children: children })) }) }), network && address && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(NetworkIcon_1.NetworkIcon, { network: network, className: "icon-denom ml-1" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex wrap dir-c ai-s token-select__symbol", children: [(0, jsx_runtime_1.jsx)("span", { children: (0, rujira_js_1.networkLabel)(network) }), (0, jsx_runtime_1.jsx)("span", { className: "fs-14 color-grey", children: address.substring(0, 6) + "…" + address.slice(-6) })] })] }))] })) : ((0, jsx_runtime_1.jsx)("div", { className: "token-select__symbol", children: "..." })), (0, jsx_runtime_1.jsx)(Icons_1.AngleDown, { className: "token-select__arrow" })] }) }));
84
- };
85
- exports.TokenSelect = TokenSelect;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Textarea = Textarea;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const react_1 = require("react");
7
- function Textarea({ id, label, value, className, onChange, onSubmit, disabled, labelClassName, containerClassName, placeholder, ...rest }) {
8
- (0, react_1.useEffect)(() => {
9
- const handleUserKeyPress = (event) => {
10
- const { keyCode } = event;
11
- if (keyCode === 13) {
12
- onSubmit?.();
13
- }
14
- };
15
- window.addEventListener("keydown", handleUserKeyPress);
16
- return () => {
17
- window.removeEventListener("keydown", handleUserKeyPress);
18
- };
19
- }, [onSubmit]);
20
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)({
21
- "input-container": true,
22
- "input-container--disabled": disabled,
23
- [`${containerClassName}`]: containerClassName,
24
- }), children: [(0, jsx_runtime_1.jsx)("textarea", { ...rest, className: (0, clsx_1.default)({ input: true, [`${className}`]: className }), id: id, value: value, onChange: onChange, placeholder: placeholder || label }), label && ((0, jsx_runtime_1.jsx)("label", { htmlFor: id, className: (0, clsx_1.default)({
25
- label: true,
26
- [`${labelClassName}`]: labelClassName,
27
- }), children: label && label }))] }));
28
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Toggle = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const Toggle = ({ label, labelOff, checked, className, id, onChange, children, ...rest }) => {
7
- const classes = (0, clsx_1.default)({
8
- [`toggle`]: true,
9
- [`${className}`]: className,
10
- });
11
- const handleChange = (e) => {
12
- if (onChange)
13
- onChange(e);
14
- };
15
- return ((0, jsx_runtime_1.jsxs)("label", { className: classes, htmlFor: id, children: [labelOff && labelOff !== "" && ((0, jsx_runtime_1.jsx)("span", { className: "toggle__label toggle__label--off", children: labelOff })), (0, jsx_runtime_1.jsx)("input", { id: id, type: "checkbox", onChange: handleChange, checked: checked, ...rest }), (0, jsx_runtime_1.jsx)("span", { className: "toggle__slider" }), label && label !== "" && (0, jsx_runtime_1.jsx)("span", { className: "toggle__label", children: label }), children] }));
16
- };
17
- exports.Toggle = Toggle;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Spinner = exports.Loader = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const Loader = ({ className }) => ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)({ loader: true, [`${className}`]: className }), children: [(0, jsx_runtime_1.jsx)("svg", { className: "loader__blob", viewBox: "0 0 500 500", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fill: "#CE18EC", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "2800ms", repeatCount: "indefinite", values: "M398,320.5Q332,391,247,396.5Q162,402,118.5,326Q75,250,125,184.5Q175,119,258.5,104.5Q342,90,403,170Q464,250,398,320.5Z;\n M431,347Q362,444,268.5,412Q175,380,94.5,315Q14,250,86,170.5Q158,91,265,65Q372,39,436,144.5Q500,250,431,347Z;\n M421.5,355Q372,460,248.5,463Q125,466,78.5,358Q32,250,94,168.5Q156,87,251,85Q346,83,408.5,166.5Q471,250,421.5,355Z;\n M382.5,342Q356,434,260.5,415Q165,396,93.5,323Q22,250,90.5,171.5Q159,93,259,76.5Q359,60,384,155Q409,250,382.5,342Z;\n M392,357Q374,464,250.5,463Q127,462,102.5,356Q78,250,114.5,164Q151,78,243.5,90Q336,102,373,176Q410,250,392,357Z;\n M413,340.5Q354,431,255.5,421.5Q157,412,119,331Q81,250,115.5,163Q150,76,254,69.5Q358,63,415,156.5Q472,250,413,340.5Z;\n M398,320.5Q332,391,247,396.5Q162,402,118.5,326Q75,250,125,184.5Q175,119,258.5,104.5Q342,90,403,170Q464,250,398,320.5Z;" }) }) }), (0, jsx_runtime_1.jsx)("svg", { className: "loader__blob", viewBox: "0 0 500 500", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fill: "#8535F4", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "3000ms", repeatCount: "indefinite", values: "M390,323.5Q335,397,244.5,407Q154,417,87.5,333.5Q21,250,83,159Q145,68,235.5,93Q326,118,385.5,184Q445,250,390,323.5Z;\n M388.44284,356.71939Q373.40992,463.43878,249.17148,464.61488Q124.93304,465.79098,81.27136,357.89549Q37.60969,250,90.26674,157.44284Q142.92379,64.88568,254.70496,56.66629Q366.48613,48.44691,384.98095,149.22345Q403.47577,250,388.44284,356.71939Z;\n M388.87386,333.816Q346.57737,417.63199,250.12159,417.26268Q153.6658,416.89337,92.342,333.44668Q31.01821,250,87.75683,158.62159Q144.49545,67.24317,258.11248,53.51365Q371.72952,39.78414,401.44993,144.89207Q431.17035,250,388.87386,333.816Z;\n M407.11178,321.2174Q331.96274,392.43479,239.55747,410.67856Q147.15219,428.92233,101.65993,339.46116Q56.16767,250,93.41459,146.54815Q130.66151,43.0963,250.06678,42.94411Q369.47205,42.79192,425.86644,146.39596Q482.26082,250,407.11178,321.2174Z;\n M418,346.5Q361,443,251.5,440Q142,437,100,343.5Q58,250,98,152.5Q138,55,242,69.5Q346,84,410.5,167Q475,250,418,346.5Z;\n M382.06447,321.8585Q333.27831,393.71699,229.42532,429.21934Q125.57233,464.72169,104.62028,357.36085Q83.66823,250,116.99449,163.79402Q150.32075,77.58805,244.05346,87.46776Q337.78617,97.34748,384.3184,173.67374Q430.85064,250,382.06447,321.8585Z;\n M390,323.5Q335,397,244.5,407Q154,417,87.5,333.5Q21,250,83,159Q145,68,235.5,93Q326,118,385.5,184Q445,250,390,323.5Z;" }) }) }), (0, jsx_runtime_1.jsx)("svg", { className: "loader__blob", viewBox: "0 0 500 500", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { fill: "#8535F4", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "2900ms", repeatCount: "indefinite", values: "M425.65286,345.08093Q360.09352,440.16185,251.07553,438.03057Q142.05755,435.89929,105.0018,342.94965Q67.94605,250,115.4964,175.04136Q163.04676,100.08273,256.04316,89.00719Q349.03956,77.93166,420.12589,163.96583Q491.21221,250,425.65286,345.08093Z;\n M430.21857,346.57286Q362.09714,443.14572,252.57286,439.04857Q143.04857,434.95143,117.58287,342.47571Q92.11716,250,128.08287,175Q164.04857,100,251.80571,97.38858Q339.56285,94.77715,418.95143,172.38858Q498.34,250,430.21857,346.57286Z;\n M410.5,356.5Q373,463,264.5,437.5Q156,412,86,331Q16,250,71.5,143.5Q127,37,227,77Q327,117,387.5,183.5Q448,250,410.5,356.5Z;\n M412.01351,346.40994Q360.89193,442.81988,266.01351,414.79737Q171.13509,386.77485,125.85573,318.38743Q80.57638,250,106.3107,148.04053Q132.04503,46.08105,234.06304,73.46848Q336.08105,100.85591,399.60807,175.42795Q463.13509,250,412.01351,346.40994Z;\n M391.35886,346Q361,442,257.95529,428.45324Q154.91058,414.90648,104.33899,332.45324Q53.76739,250,93.76242,149.50497Q133.75745,49.00994,237.4851,70.28726Q341.21274,91.56458,381.46523,170.78229Q421.71771,250,391.35886,346Z;\n M425.65286,345.08093Q360.09352,440.16185,251.07553,438.03057Q142.05755,435.89929,105.0018,342.94965Q67.94605,250,115.4964,175.04136Q163.04676,100.08273,256.04316,89.00719Q349.03956,77.93166,420.12589,163.96583Q491.21221,250,425.65286,345.08093Z;" }) }) }), (0, jsx_runtime_1.jsx)("svg", { className: "loader__spinner", viewBox: "0 0 24 24", stroke: "#fff", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsxs)("circle", { cx: "12", cy: "12", r: "9.5", fill: "none", strokeWidth: "3", strokeLinecap: "round", children: [(0, jsx_runtime_1.jsx)("animate", { attributeName: "stroke-dasharray", dur: "1.5s", calcMode: "spline", values: "0 150;42 150;42 150;42 150", keyTimes: "0;0.475;0.95;1", keySplines: "0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1", repeatCount: "indefinite" }), (0, jsx_runtime_1.jsx)("animate", { attributeName: "stroke-dashoffset", dur: "1.5s", calcMode: "spline", values: "0;-16;-59;-59", keyTimes: "0;0.475;0.95;1", keySplines: "0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1", repeatCount: "indefinite" })] }), (0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", type: "rotate", dur: "2s", values: "0 12 12;360 12 12", repeatCount: "indefinite" })] }) })] }));
7
- exports.Loader = Loader;
8
- const Spinner = ({ className }) => ((0, jsx_runtime_1.jsx)("div", { className: (0, clsx_1.default)({ spinner: true, [`${className}`]: className }), children: (0, jsx_runtime_1.jsx)("svg", { className: "spinner__spinner", viewBox: "0 0 24 24", stroke: "#fff", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsxs)("circle", { cx: "12", cy: "12", r: "9.5", fill: "none", strokeWidth: "3", strokeLinecap: "round", children: [(0, jsx_runtime_1.jsx)("animate", { attributeName: "stroke-dasharray", dur: "1.5s", calcMode: "spline", values: "0 150;42 150;42 150;42 150", keyTimes: "0;0.475;0.95;1", keySplines: "0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1", repeatCount: "indefinite" }), (0, jsx_runtime_1.jsx)("animate", { attributeName: "stroke-dashoffset", dur: "1.5s", calcMode: "spline", values: "0;-16;-59;-59", keyTimes: "0;0.475;0.95;1", keySplines: "0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1", repeatCount: "indefinite" })] }), (0, jsx_runtime_1.jsx)("animateTransform", { attributeName: "transform", type: "rotate", dur: "2s", values: "0 12 12;360 12 12", repeatCount: "indefinite" })] }) }) }));
9
- exports.Spinner = Spinner;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RujiraLogo = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const helpers_1 = require("../../helpers");
6
- const RujiraLogo = ({ textColor = "#fff", showText = true, animate = false, className, }) => {
7
- const id = (0, helpers_1.uuidv4)();
8
- return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${showText ? 3710 : 1000} 1000`, xmlns: "http://www.w3.org/2000/svg", className: className, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { x1: "97.12%", y1: "12.295%", x2: "15.952%", y2: "88.858%", id: id, children: [(0, jsx_runtime_1.jsx)("stop", { stopColor: "#D615EB", offset: "0%" }), (0, jsx_runtime_1.jsx)("stop", { stopColor: "#8436F5", offset: "100%" })] }) }), (0, jsx_runtime_1.jsxs)("g", { fill: "none", fillRule: "nonzero", children: [!animate ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M109.713 718.57c64.466 183.188 203.797 276.949 417.99 281.283 214.195 4.334 357.082-87.26 428.663-274.782 71.581-187.522 55.091-346.445-49.47-476.768C802.337 117.981 666.289 37.628 498.753 7.246 331.216-23.136 208.376 42.026 130.23 202.73c-78.145 160.705-84.984 332.652-20.517 515.84Z", fillOpacity: ".45", fill: "#CE18EC" }), (0, jsx_runtime_1.jsx)("path", { d: "M938.285 742.674c-81.778 172.834-217.066 249.65-405.863 230.445C343.625 953.916 193.193 867.5 81.127 713.868-30.94 560.238-26.902 413.177 93.242 272.686c120.143-140.491 271.08-228.424 452.81-263.8C727.782-26.489 859.03 43.756 939.8 219.623c80.768 175.866 80.264 350.216-1.515 523.05Z", fillOpacity: ".45", fill: "#8535F4" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { fill: "#CE18EC", fillOpacity: ".45", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "3897ms", repeatCount: "indefinite", values: "M908.65 772.515c-119.423 173.188-259.837 247.488-421.243 222.9C326 970.826 191.184 884.232 82.957 735.633-25.268 587.033-27.6 434.158 75.96 277.006 179.522 119.854 316.67 28.984 487.407 4.396c170.736-24.59 313.482 53.987 428.24 235.727 114.757 181.74 112.424 359.205-6.998 532.392Z;\n M905.657 701.408C781.589 850.992 630.329 930.883 451.876 941.082c-178.453 10.199-308.47-64.593-390.048-224.376-81.579-159.782-82.428-320.415-2.55-481.897C139.159 73.326 270.874-4.865 454.426.234c183.552 5.1 335.662 85.84 456.33 242.224 120.67 156.383 118.97 309.366-5.098 458.95Z;\n M938.285 742.674c-81.778 172.834-217.066 249.65-405.863 230.445C343.625 953.916 193.193 867.5 81.127 713.868-30.94 560.238-26.902 413.177 93.242 272.686c120.143-140.491 271.08-228.424 452.81-263.8C727.782-26.489 859.03 43.756 939.8 219.623c80.768 175.866 80.264 350.216-1.515 523.05Z;\n M909.194 698.092C791.124 849.094 646.258 945.89 474.596 988.48c-171.662 42.59-307.317-32.91-406.964-226.503-99.648-193.591-89.18-365.888 31.401-516.89C219.615 94.086 358.201 12.777 514.79 1.162c156.589-11.616 290.988 63.885 403.196 226.502 112.208 162.617 109.277 319.426-8.792 470.428Z;\n M908.65 772.515c-119.423 173.188-259.837 247.488-421.243 222.9C326 970.826 191.184 884.232 82.957 735.633-25.268 587.033-27.6 434.158 75.96 277.006 179.522 119.854 316.67 28.984 487.407 4.396c170.736-24.59 313.482 53.987 428.24 235.727 114.757 181.74 112.424 359.205-6.998 532.392Z;" }) }), (0, jsx_runtime_1.jsx)("path", { fill: "#8535F4", fillOpacity: ".45", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "2975ms", repeatCount: "indefinite", values: "M932.532 715.172C854.38 889.747 710.761 984.14 501.676 998.35 292.591 1012.56 146.943 925.27 64.73 736.486c-82.213-188.785-68.51-353.718 41.106-494.8C215.453 100.607 357.042 20.93 530.603 2.66c173.56-18.27 303.477 52.271 389.75 211.622 86.273 159.351 90.332 326.314 12.18 500.89Z;\n M885.654 705.273C746.066 828.795 579.708 919.904 386.58 978.599c-193.128 58.695-311.204-3.066-354.228-185.284-43.024-182.217-43.502-364.873-1.434-547.967C72.984 62.255 202.534-18.342 419.564 3.56c217.03 21.9 383.867 113.448 500.51 274.64 116.641 161.193 105.168 303.55-34.42 427.073Z;\n M962.274 793.5c-49.124 177.855-169.888 240.71-362.29 188.563-192.402-52.145-355.126-141.072-488.17-266.78C-21.23 589.572-36.069 440.585 67.296 268.318 170.66 96.052 333.896 6.659 557 .141c223.104-6.518 358.707 79.615 406.808 258.4 48.1 178.786 47.589 357.106-1.535 534.96Z;\n M897.318 638.271C761.297 778.402 603.636 888.36 424.336 968.141c-179.3 79.783-306.047 9.718-380.24-210.196-74.193-219.913-54.762-400.958 58.295-543.135C215.447 72.633 343.077 1.034 485.28.01c142.203-1.022 280.432 70.066 414.686 213.266 134.255 143.2 133.371 284.864-2.65 424.995Z;\n M932.532 715.172C854.38 889.747 710.761 984.14 501.676 998.35 292.591 1012.56 146.943 925.27 64.73 736.486c-82.213-188.785-68.51-353.718 41.106-494.8C215.453 100.607 357.042 20.93 530.603 2.66c173.56-18.27 303.477 52.271 389.75 211.622 86.273 159.351 90.332 326.314 12.18 500.89Z;" }) })] })), (0, jsx_runtime_1.jsxs)("g", { transform: "translate(49 24)", children: [(0, jsx_runtime_1.jsx)("circle", { fill: `url(#${id})`, cx: "475.5", cy: "475.5", r: "475.5" }), (0, jsx_runtime_1.jsx)("path", { d: "M475.5 57.011c-231.125 0-418.489 187.364-418.489 418.489 0 231.125 187.364 418.489 418.489 418.489 231.125 0 418.489-187.364 418.489-418.489 0-231.125-187.364-418.489-418.489-418.489Z", fill: "#1B1821" }), (0, jsx_runtime_1.jsx)("path", { d: "M460.284 232.995v159.944h-58.52l58.52 67.345h-68.973l-60.794-67.345h-45.61v67.345h-51.912V341.027h50.66l-50.66-56.12v-51.912h227.289Zm-152.396 51.912 48.766 56.12h51.718v-56.12H307.888Zm182.828 433.098v-51.912h88.39V542.628h-88.39v-51.912h227.289v51.912h-86.987v123.465h86.987v51.912H490.716Zm-257.721 0V598.748h51.912v67.345h93.716l29.75-29.155v-94.31H346.64v-51.912h113.644v166.96l-60.33 60.329H232.995Zm318.05-257.721-60.329-60.33V232.995h51.912v146.222l29.748 29.155h93.717V232.995h51.912v227.289h-166.96Z", fill: `url(#${id})` })] }), showText && ((0, jsx_runtime_1.jsx)("path", { d: "M1466.453 256.11c96.524 0 159.415 63.144 159.415 153.455 0 87.374-57.043 134.366-115.543 143.91l119.196 192.37h-98.719l-108.22-182.824h-84.827v182.825H1252.2V256.11h214.254Zm-11.697 75.626h-117v155.658h117c48.262 0 83.36-30.838 83.36-77.83 0-46.99-35.098-77.828-83.36-77.828ZM1926.077 751.71c141.25 0 210.775-80.446 210.775-201.848v-294.73h-86.357v292.535c0 77.522-43.178 127.985-124.418 127.985-81.969 0-125.155-50.463-125.155-127.985V255.132h-86.357v295.46c0 119.94 69.524 201.119 211.512 201.119ZM2209.279 937.439c94.103 0 164.133-52.144 164.133-163.783V255.132h-85.346v517.055c0 53.612-32.832 88.866-85.352 88.866-37.205 0-63.465-19.092-83.16-40.395l-39.398 65.366c34.29 36.727 78.788 51.415 129.123 51.415ZM2610.948 745.846V256.11h-84.067v489.736zM2977.695 256.11c96.523 0 159.414 63.144 159.414 153.455 0 87.374-57.042 134.366-115.535 143.91l119.188 192.37h-98.718l-108.22-182.824h-84.827v182.825h-85.556V256.11h214.254Zm-11.697 75.626h-117.001v155.658h117c48.262 0 83.361-30.838 83.361-77.83 0-46.99-35.099-77.828-83.36-77.828ZM3518.168 256.11l191.51 489.736h-97.216l-35.818-93.983h-223.67l-35.817 93.983h-97.216l191.51-489.736h106.717Zm-53.355 86.64-87.715 233.487h175.43l-87.715-233.487Z", fill: textColor }))] })] }));
9
- };
10
- exports.RujiraLogo = RujiraLogo;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Warning = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const Icons_1 = require("../icons/Icons");
7
- const Warning = ({ color, msg, dismiss, className, children, ...rest }) => {
8
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)({
9
- warning: true,
10
- [`warning--${color}`]: color,
11
- [`${className}`]: className,
12
- }), ...rest, children: [children || ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: color == "red" ? ((0, jsx_runtime_1.jsx)(Icons_1.ExclamationTriangle, { className: "warning__icon" })) : ((0, jsx_runtime_1.jsx)(Icons_1.ExclamationCircle, { className: "warning__icon" })) })), msg && (0, jsx_runtime_1.jsx)("span", { className: "warning__msg", children: msg }), dismiss && ((0, jsx_runtime_1.jsx)("button", { onClick: dismiss, className: "transparent warning__close", children: (0, jsx_runtime_1.jsx)(Icons_1.Xmark, {}) }))] }));
13
- };
14
- exports.Warning = Warning;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Decimal = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const helpers_1 = require("../../helpers");
7
- const Decimal = ({ amount, decimals = 8, round = 6, symbol, symbolLeft, padSymbol = true, className, onClick, as: Component = "div", symbolClassName, subscript, }) => {
8
- const dec = amount % BigInt(10 ** decimals);
9
- const int = BigInt(Math.round(Number(amount - dec) / 10 ** decimals));
10
- const padded = dec.toString().padStart(decimals, "0");
11
- let needsSubscript = false;
12
- if (int <= 0n && dec > 0n && round) {
13
- const padLength = decimals - dec.toString().length;
14
- if (padLength >= round) {
15
- needsSubscript = true;
16
- }
17
- }
18
- const truncated = subscript && needsSubscript ? (0, helpers_1.compress)(padded) : padded;
19
- const trimmed = truncated.substring(0, round);
20
- return ((0, jsx_runtime_1.jsxs)(Component, { className: (0, clsx_1.default)({
21
- decimal: true,
22
- "decimal--label-left": symbolLeft,
23
- "decimal--no-pad": !padSymbol,
24
- [`${className}`]: className,
25
- }), onClick: onClick, children: [(0, jsx_runtime_1.jsxs)("span", { className: "decimal__int", children: [(int || "0").toLocaleString(), round > 0 && (0, helpers_1.whatDecimalSeparator)()] }), dec.toString().length && round > 0 && ((0, jsx_runtime_1.jsx)("span", { className: "decimal__dec", children: trimmed })), symbol && ((0, jsx_runtime_1.jsx)("span", { className: (0, clsx_1.default)({
26
- decimal__symbol: true,
27
- [`${symbolClassName}`]: symbolClassName,
28
- }), children: symbol }))] }));
29
- };
30
- exports.Decimal = Decimal;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Fiat = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const helpers_1 = require("../../helpers");
7
- const Fiat = ({ amount, decimals = 2, symbol, className, symbolRight = false, padSymbol = true, symbolSmall = false, as: Component = "div", }) => {
8
- const dec = amount % BigInt(10 ** decimals);
9
- const int = BigInt(Math.floor(Number(amount - dec) / 10 ** decimals));
10
- const round = 2;
11
- return ((0, jsx_runtime_1.jsxs)(Component, { className: (0, clsx_1.default)({
12
- fiat: true,
13
- "fiat--symbol-right": symbolRight,
14
- [`${className}`]: className,
15
- }), children: [(0, jsx_runtime_1.jsxs)("span", { className: "fiat__int", children: [(int || "0").toLocaleString(), (0, helpers_1.whatDecimalSeparator)()] }), (0, jsx_runtime_1.jsx)("span", { className: "fiat__dec", children: dec.toString().padStart(decimals, "0").substring(0, round) }), symbol && ((0, jsx_runtime_1.jsx)("span", { className: (0, clsx_1.default)({
16
- fiat__symbol: true,
17
- "fiat__symbol--small": symbolSmall,
18
- "mr-0.5": padSymbol && !symbolRight,
19
- "ml-0.5": padSymbol && symbolRight,
20
- }), children: symbol }))] }));
21
- };
22
- exports.Fiat = Fiat;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Pagination = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const Button_1 = require("../buttons/Button");
7
- const Icons_1 = require("../icons/Icons");
8
- const Pagination = ({ className, buttonClassName, pageInfo, setAfter, setBefore }) => {
9
- const { hasNextPage, hasPreviousPage, endCursor, startCursor } = pageInfo;
10
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.clsx)({ pagination: true, [`${className}`]: className }), children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { className: buttonClassName, label: "Previous", disabled: !hasPreviousPage, onClick: () => startCursor && setBefore(startCursor), children: (0, jsx_runtime_1.jsx)(Icons_1.AngleLeft, {}) }), (0, jsx_runtime_1.jsx)(Button_1.Button, { className: (0, clsx_1.clsx)({
11
- "button--icon-right": true,
12
- [`${buttonClassName}`]: buttonClassName,
13
- }), label: "Next", disabled: !hasNextPage, onClick: () => endCursor && setAfter(endCursor), children: (0, jsx_runtime_1.jsx)(Icons_1.AngleRight, {}) })] }));
14
- };
15
- exports.Pagination = Pagination;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Progress = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const Progress = ({ percentage, height = 4, className, showLabels, label, labelMin = "0", labelMax = "100", }) => {
7
- if (percentage < 0)
8
- percentage = 0;
9
- if (percentage > 100)
10
- percentage = 100;
11
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)({ progress: true, [`${className}`]: className }), children: [(0, jsx_runtime_1.jsxs)("div", { className: "progress__height", children: [(0, jsx_runtime_1.jsx)("div", { className: "progress__track", style: { height: height } }), (0, jsx_runtime_1.jsx)("div", { className: "progress__percentage", style: { width: `${percentage}%` } })] }), showLabels && ((0, jsx_runtime_1.jsxs)("div", { className: "progress__labels", children: [(0, jsx_runtime_1.jsx)("div", { children: labelMin }), (0, jsx_runtime_1.jsx)("div", { style: { left: `${percentage}%` }, children: label || percentage }), (0, jsx_runtime_1.jsx)("div", { children: labelMax })] }))] }));
12
- };
13
- exports.Progress = Progress;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Slider = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_slider_1 = require("react-slider");
6
- const Slider = (props) => {
7
- return ((0, jsx_runtime_1.jsx)(react_slider_1.default, { ...props, className: "slider grow", trackClassName: "slider__track", thumbClassName: "slider__thumb" }));
8
- };
9
- exports.Slider = Slider;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSortContext = exports.SortDir = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const useQueryParam_1 = require("../../hooks/useQueryParam");
7
- const Icons_1 = require("../icons/Icons");
8
- var SortDir;
9
- (function (SortDir) {
10
- SortDir["Asc"] = "ASC";
11
- SortDir["Desc"] = "DESC";
12
- })(SortDir || (exports.SortDir = SortDir = {}));
13
- const createSortContext = (by, dir) => {
14
- const context = (0, react_1.createContext)([
15
- {
16
- sortBy: by,
17
- sortDir: SortDir.Asc,
18
- },
19
- {
20
- setSortBy: function () {
21
- throw new Error("Function not implemented.");
22
- },
23
- setSortDir: function () {
24
- throw new Error("Function not implemented.");
25
- },
26
- },
27
- ]);
28
- const useValues = () => {
29
- const [x] = (0, react_1.useContext)(context);
30
- return x;
31
- };
32
- const Provider = ({ children }) => {
33
- const [sortBy, setSortBy] = (0, useQueryParam_1.useQueryParam)("sortBy", by);
34
- const [sortDir, setSortDir] = (0, useQueryParam_1.useQueryParam)("sortDir", dir || SortDir.Asc);
35
- return ((0, jsx_runtime_1.jsx)(context.Provider, { value: [
36
- {
37
- sortBy,
38
- sortDir,
39
- },
40
- { setSortBy, setSortDir },
41
- ], children: children }));
42
- };
43
- const Item = ({ className, label, value, }) => {
44
- const [{ sortBy, sortDir }, { setSortBy, setSortDir }] = (0, react_1.useContext)(context);
45
- return ((0, jsx_runtime_1.jsx)("th", { children: (0, jsx_runtime_1.jsxs)("div", { className: `flex ai-c no-select pointer ${className || ""}`, onClick: () => {
46
- setSortDir(sortDir === SortDir.Asc ? SortDir.Desc : SortDir.Asc);
47
- sortBy !== value && setSortBy(value);
48
- }, children: [label, sortBy === value && sortDir === SortDir.Desc && ((0, jsx_runtime_1.jsx)(Icons_1.SortDown, { className: "color-white ml-0.5 w-2 h-a" })), sortBy === value && sortDir === SortDir.Asc && ((0, jsx_runtime_1.jsx)(Icons_1.SortUp, { className: "color-white ml-0.5 w-2 h-a" })), sortBy !== value && (0, jsx_runtime_1.jsx)(Icons_1.Sort, { className: "color-grey ml-0.5 w-2 h-a" })] }) }));
49
- };
50
- return { Provider, Item, useValues };
51
- };
52
- exports.createSortContext = createSortContext;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GlobalModal = exports.useGlobalModalContext = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const clsx_1 = require("clsx");
6
- const react_1 = require("motion/react");
7
- const react_2 = require("react");
8
- const react_dom_1 = require("react-dom");
9
- const Button_1 = require("../components/buttons/Button");
10
- const Icons_1 = require("../components/icons/Icons");
11
- const helpers_1 = require("../helpers");
12
- const react_tooltip_1 = require("react-tooltip");
13
- const i18n_1 = require("../i18n");
14
- const initialState = {
15
- showModal: () => { },
16
- hideModal: () => { },
17
- };
18
- const GlobalModalContext = (0, react_2.createContext)(initialState);
19
- const useGlobalModalContext = () => (0, react_2.useContext)(GlobalModalContext);
20
- exports.useGlobalModalContext = useGlobalModalContext;
21
- const ModalContent = ({ modalProps, hideModal, }) => {
22
- const { t } = (0, i18n_1.useTranslation)("common");
23
- return ((0, jsx_runtime_1.jsx)(react_1.motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, className: (0, clsx_1.default)({
24
- modal: true,
25
- [`${modalProps.className}`]: modalProps.className,
26
- }), onClick: () => (modalProps.backgroundClose ? hideModal() : null), children: (0, jsx_runtime_1.jsxs)(react_1.motion.div, { initial: { scale: 0.9 }, animate: { scale: 1 }, exit: { scale: 0.9 }, className: "modal__window", onClick: (e) => {
27
- e.stopPropagation();
28
- }, children: [modalProps.hideCloseButton !== true && ((0, jsx_runtime_1.jsxs)("button", { className: "transparent modal__close fs-12 color-white fw-600 flex ai-c mr-1 mb-1 hover-primary1", onClick: hideModal, children: [(0, jsx_runtime_1.jsx)(Icons_1.Xmark, { className: "w-2 h-a mr-1" }), t("close")] })), modalProps.title && ((0, jsx_runtime_1.jsx)("div", { className: "modal__header", children: (0, jsx_runtime_1.jsx)("h2", { children: modalProps.title }) })), modalProps.children && modalProps.children, modalProps.confirm && ((0, jsx_runtime_1.jsxs)("div", { className: "modal__footer mt-4 px-3 py-2 text-right", children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { className: "button--grey button--outline", onClick: hideModal, label: t("cancel") }), (0, jsx_runtime_1.jsx)(Button_1.Button, { className: "button ml-1", onClick: modalProps.confirm, label: t("confirm") })] })), (0, jsx_runtime_1.jsx)(react_tooltip_1.Tooltip, { id: "modal-tip", className: "tooltip" })] }) }));
29
- };
30
- const GlobalModal = ({ children, }) => {
31
- const [modalProps, setModalProps] = (0, react_2.useState)({});
32
- const showModal = (modalProps) => {
33
- document.body.style.overflow = "hidden";
34
- setModalProps(modalProps);
35
- };
36
- const hideModal = () => {
37
- document.body.style.overflow = "scroll";
38
- setModalProps({});
39
- };
40
- const dest = document.getElementById("modal");
41
- const renderComponent = () => {
42
- return dest
43
- ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)(i18n_1.TranslationProvider, { namespace: "common", children: (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: !(0, helpers_1.isEmpty)(modalProps) && ((0, jsx_runtime_1.jsx)(ModalContent, { modalProps: modalProps, hideModal: hideModal })) }) }), dest)
44
- : null;
45
- };
46
- return ((0, jsx_runtime_1.jsxs)(GlobalModalContext.Provider, { value: { showModal, hideModal }, children: [children, renderComponent()] }));
47
- };
48
- exports.GlobalModal = GlobalModal;
@@ -1,167 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bigIntToDecimalString = exports.floatToSubscript = exports.compress = exports.classApr = exports.formatApr = exports.nFormatterInt = exports.nFormatter = exports.uuidv4 = exports.isEmpty = exports.whatDecimalSeparator = exports.getLang = void 0;
4
- const getLang = () => {
5
- if (navigator.languages != undefined)
6
- return navigator.languages[0];
7
- return navigator.language;
8
- };
9
- exports.getLang = getLang;
10
- const whatDecimalSeparator = () => {
11
- const n = 1.1;
12
- const s = n.toLocaleString().substring(1, 2);
13
- return s;
14
- };
15
- exports.whatDecimalSeparator = whatDecimalSeparator;
16
- const isEmpty = (obj) => {
17
- for (const prop in obj) {
18
- if (Object.hasOwn(obj, prop)) {
19
- return false;
20
- }
21
- }
22
- return true;
23
- };
24
- exports.isEmpty = isEmpty;
25
- const uuidv4 = () => {
26
- return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^
27
- (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16));
28
- };
29
- exports.uuidv4 = uuidv4;
30
- const nFormatter = (bigint, digits, decimals = 8) => {
31
- const num = Number(bigint) / 10 ** decimals;
32
- const lookup = [
33
- { value: 1, symbol: "" },
34
- { value: 1e3, symbol: "k" },
35
- { value: 1e6, symbol: "M" },
36
- { value: 1e9, symbol: "B" },
37
- { value: 1e12, symbol: "T" },
38
- { value: 1e15, symbol: "P" },
39
- { value: 1e18, symbol: "E" },
40
- ];
41
- const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
42
- const item = lookup
43
- .slice()
44
- .reverse()
45
- .find(function (item) {
46
- return num >= item.value;
47
- });
48
- return item
49
- ? (num / item.value).toLocaleDecimal(digits).replace(rx, "$1") + item.symbol
50
- : num
51
- ? num.toLocaleDecimal(digits).replaceAll(/\.[0]+$/g, "")
52
- : "0";
53
- };
54
- exports.nFormatter = nFormatter;
55
- const nFormatterInt = (num, digits) => {
56
- const lookup = [
57
- { value: 1, symbol: "" },
58
- { value: 1e3, symbol: "k" },
59
- { value: 1e6, symbol: "M" },
60
- { value: 1e9, symbol: "G" },
61
- { value: 1e12, symbol: "T" },
62
- { value: 1e15, symbol: "P" },
63
- { value: 1e18, symbol: "E" },
64
- ];
65
- const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
66
- const item = lookup
67
- .slice()
68
- .reverse()
69
- .find(function (item) {
70
- return num >= item.value;
71
- });
72
- return item
73
- ? (num / item.value).toFixed(digits).replace(rx, "$1") + item.symbol
74
- : "0";
75
- };
76
- exports.nFormatterInt = nFormatterInt;
77
- const formatApr = (apr) => {
78
- if (!apr)
79
- return "—";
80
- if (apr.status === "SOON")
81
- return "Soon";
82
- if (apr.status === "NOT_APPLICABLE")
83
- return "N/A";
84
- if (apr.value === null)
85
- return "—";
86
- if (apr.value === undefined)
87
- return "—";
88
- return `${(0, exports.nFormatter)(apr.value, 2, 10)}%`;
89
- };
90
- exports.formatApr = formatApr;
91
- const classApr = (apr) => {
92
- if (!apr)
93
- return "color-grey";
94
- if (apr.status === "SOON")
95
- return "color-white";
96
- if (apr.status === "NOT_APPLICABLE")
97
- return "color-grey";
98
- if (apr.value === null)
99
- return "color-grey";
100
- if (apr.value === undefined)
101
- return "color-grey";
102
- if (apr.value >= 0n)
103
- return "color-teal";
104
- return "color-red";
105
- };
106
- exports.classApr = classApr;
107
- const compress = (v) => {
108
- if (v.match(/^0+$/))
109
- return "0";
110
- const matches = v.match(/^(0+)([0-9]+)/);
111
- if (!matches)
112
- return v;
113
- const count = matches[1].length;
114
- if (count <= 2)
115
- return v;
116
- const sub = {
117
- "0": "\u2080",
118
- "1": "\u2081",
119
- "2": "\u2082",
120
- "3": "\u2083",
121
- "4": "\u2084",
122
- "5": "\u2085",
123
- "6": "\u2086",
124
- "7": "\u2087",
125
- "8": "\u2088",
126
- "9": "\u2089",
127
- }[count];
128
- return "\u0030" + sub + matches[2];
129
- };
130
- exports.compress = compress;
131
- /**
132
- * Formats a float value, using subscript when necessary if the value is small.
133
- * @param floatValue The value to format.
134
- * @param rounding The number of digits to round the value too, before applying subscript compression if necessary.
135
- * This param can be greater than the fractionDigits, to ensure that very small numbers still get subscript compression.
136
- * @param fractionDigits The desired number of fractional digits in the final output, including the subscripting.
137
- */
138
- const floatToSubscript = (floatValue, rounding, fractionDigits) => {
139
- const separator = (0, exports.whatDecimalSeparator)();
140
- const formatted = floatValue.toLocaleString(undefined, {
141
- minimumFractionDigits: 0,
142
- maximumFractionDigits: rounding,
143
- });
144
- const [intPart, decimalPart] = formatted.split(separator);
145
- if (!decimalPart)
146
- return intPart + ".".padEnd(fractionDigits + 1, "0");
147
- const compressedDec = (0, exports.compress)(decimalPart);
148
- const trimmed = compressedDec.length >= fractionDigits
149
- ? compressedDec.substring(0, fractionDigits)
150
- : compressedDec.padEnd(fractionDigits, "0");
151
- return intPart + separator + trimmed;
152
- };
153
- exports.floatToSubscript = floatToSubscript;
154
- /**
155
- * A function that uses string manipulation to convert a bigint into a floating point number,
156
- * avoiding the floating points maths issues that sometimes arise when generating this number
157
- * mathematically.
158
- * @param value The value to convert into a floating point number, using the provided number of decimals.
159
- * @param decimals The exponent value to use in the conversion.
160
- */
161
- const bigIntToDecimalString = (value, decimals) => {
162
- const valueStr = value.toString().padStart(decimals + 1, "0");
163
- const integerPart = valueStr.slice(0, -decimals) || "0";
164
- const decimalPart = valueStr.slice(-decimals);
165
- return `${integerPart}.${decimalPart}`;
166
- };
167
- exports.bigIntToDecimalString = bigIntToDecimalString;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- // Add the method to the Number prototype
3
- Number.prototype.toLocaleDecimal = function (decimals = 0) {
4
- return this.toLocaleString(undefined, {
5
- maximumFractionDigits: decimals,
6
- minimumFractionDigits: decimals,
7
- });
8
- };
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useClickOutside = void 0;
4
- const react_1 = require("react");
5
- const useClickOutside = (callback) => {
6
- const ref = (0, react_1.useRef)(null);
7
- (0, react_1.useEffect)(() => {
8
- const handleClickOutside = (event) => {
9
- if (ref.current && !ref.current.contains(event.target)) {
10
- callback();
11
- }
12
- };
13
- document.addEventListener('mouseup', handleClickOutside);
14
- document.addEventListener('touchend', handleClickOutside);
15
- return () => {
16
- document.removeEventListener('mouseup', handleClickOutside);
17
- document.removeEventListener('touchend', handleClickOutside);
18
- };
19
- }, [callback]);
20
- return ref;
21
- };
22
- exports.useClickOutside = useClickOutside;