@stokr/components-library 3.0.72-beta.7 → 3.0.73

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.
@@ -1,39 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import React__default, { useState } from "react";
2
+ import React__default from "react";
3
3
  import { CopyToClipboard } from "react-copy-to-clipboard";
4
4
  import { CopyToClipboard as CopyToClipboard2 } from "react-copy-to-clipboard";
5
- import { Tooltip } from "react-tippy";
6
- import { CopyToClipboardButton } from "../components/CryptoAddress/CryptoAddress.styles.js";
7
- const copyTextToClipboard = async (text, onCopy, onError) => {
8
- try {
9
- if (navigator.clipboard && window.isSecureContext) {
10
- await navigator.clipboard.writeText(text);
11
- if (onCopy) onCopy(text, true);
12
- return true;
13
- } else {
14
- const textArea = document.createElement("textarea");
15
- textArea.value = text;
16
- textArea.style.position = "fixed";
17
- textArea.style.left = "-999999px";
18
- textArea.style.top = "-999999px";
19
- document.body.appendChild(textArea);
20
- textArea.focus();
21
- textArea.select();
22
- const successful = document.execCommand("copy");
23
- document.body.removeChild(textArea);
24
- if (successful) {
25
- if (onCopy) onCopy(text, true);
26
- return true;
27
- } else {
28
- if (onError) onError(new Error("Failed to copy text"));
29
- return false;
30
- }
31
- }
32
- } catch (error) {
33
- if (onError) onError(error);
34
- return false;
35
- }
36
- };
5
+ import { copyTextToClipboard } from "./copy-text-to-clipboard.js";
6
+ import { CopyToClipboardTooltip } from "../components/CopyToClipboardTooltip/CopyToClipboardTooltip.js";
37
7
  const withCopyToClipboard = (WrappedComponent, options = {}) => {
38
8
  const { textProp = "text", onCopyProp = "onCopy", onErrorProp = "onError" } = options;
39
9
  return function CopyToClipboardWrapper(props) {
@@ -67,25 +37,11 @@ const useCopyToClipboard = (text) => {
67
37
  );
68
38
  return { copy, copied };
69
39
  };
70
- const CopyToClipBoardTooltip = ({ value, buttonStyle }) => {
71
- const [copied, setCopied] = useState(false);
72
- return /* @__PURE__ */ jsx(
73
- Tooltip,
74
- {
75
- position: "top",
76
- title: copied ? "Copied to clipboard!" : "Click to copy to clipboard.",
77
- theme: "light",
78
- arrow: true,
79
- hideOnClick: false,
80
- onHidden: () => setCopied(false),
81
- duration: 200,
82
- children: /* @__PURE__ */ jsx(CopyToClipboard, { text: value, onCopy: () => setCopied(true), children: /* @__PURE__ */ jsx(CopyToClipboardButton, { style: buttonStyle }) })
83
- }
84
- );
85
- };
40
+ const CopyToClipBoardTooltip = CopyToClipboardTooltip;
86
41
  export {
87
42
  CopyToClipBoardTooltip,
88
43
  CopyToClipboard2 as CopyToClipboard,
44
+ CopyToClipboardTooltip,
89
45
  copyTextToClipboard,
90
46
  useCopyToClipboard,
91
47
  withCopyToClipboard
@@ -4,6 +4,8 @@ import BitcoinLogo from "../static/images/currency/bitcoin-logo.png.js";
4
4
  import BMN2Logo from "../static/images/currency/bmn2-logo.png.js";
5
5
  import ETHLogo from "../static/images/currency/eth_logo.svg.js";
6
6
  import USDTLogo from "../static/images/currency/usdt-logo.png.js";
7
+ import USDLogo from "../static/images/currency/usd.svg.js";
8
+ import EURLogo from "../static/images/currency/eur.svg.js";
7
9
  import { formatDisplayNumber } from "./fix-decimals.js";
8
10
  const CURRENCY_CONFIG = {
9
11
  tether: ["USDT", 2],
@@ -88,6 +90,12 @@ const getCurrencyIcon = (currency, customIcon) => {
88
90
  case "eth":
89
91
  case "eth-fb":
90
92
  return ETHLogo;
93
+ case "usd":
94
+ case "usd-in-kind":
95
+ return USDLogo;
96
+ case "euro":
97
+ case "eur":
98
+ return EURLogo;
91
99
  default:
92
100
  return null;
93
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "3.0.72-beta.7",
3
+ "version": "3.0.73",
4
4
  "description": "STOKR - Components Library",
5
5
  "author": "Bilal Hodzic <bilal@stokr.io>",
6
6
  "license": "MIT",
@@ -54,6 +54,7 @@
54
54
  "serve": "npx http-server ./storybook-static -p 9009"
55
55
  },
56
56
  "dependencies": {
57
+ "@floating-ui/react": "^0.27.20",
57
58
  "@lottiefiles/dotlottie-react": "^0.19.4",
58
59
  "axios": "^1.13.5",
59
60
  "country-flag-icons": "^1.6.17",
@@ -81,7 +82,6 @@
81
82
  "react-select": "^5.7.0",
82
83
  "react-slick": "^0.31.0",
83
84
  "react-table": "^7.8.0",
84
- "react-tippy": "^1.4.0",
85
85
  "slick-carousel": "^1.8.1",
86
86
  "yup": "^1.0.0"
87
87
  },