@stokr/components-library 3.0.72 → 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.
@@ -7,7 +7,7 @@ const Chip = ({ children, isActive = false, onClick = () => {
7
7
  }, tooltip = null, tooltipProps, ...props }) => {
8
8
  return /* @__PURE__ */ jsxs(StyledChip, { onClick, isActive, ...props, children: [
9
9
  /* @__PURE__ */ jsx(ChipText, { children }),
10
- tooltip && /* @__PURE__ */ jsx(InfoIcon, { title: tooltip, position: "top", noMarginLeft: true, noMarginRight: true, ...tooltipProps })
10
+ tooltip && /* @__PURE__ */ jsx(InfoIcon, { title: tooltip, position: "top", noMarginLeft: true, noMarginRight: true, tooltipProps })
11
11
  ] });
12
12
  };
13
13
  Chip.propTypes = {
@@ -0,0 +1,47 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { Tooltip } from "../Tooltip/Tooltip.js";
4
+ import { CopyToClipboardButton } from "../CryptoAddress/CryptoAddress.styles.js";
5
+ import { copyTextToClipboard } from "../../utils/copy-text-to-clipboard.js";
6
+ import { CopyTrigger } from "./CopyToClipboardTooltip.styles.js";
7
+ const CopyToClipboardTooltip = ({
8
+ value,
9
+ buttonStyle,
10
+ onCopy,
11
+ children,
12
+ copiedLabel = "Copied to clipboard!",
13
+ idleLabel = "Click to copy to clipboard.",
14
+ resetAfter = 1500
15
+ }) => {
16
+ const [copyNonce, setCopyNonce] = useState(0);
17
+ const copied = copyNonce > 0;
18
+ useEffect(() => {
19
+ if (!copyNonce) return void 0;
20
+ const timer = setTimeout(() => setCopyNonce(0), resetAfter);
21
+ return () => clearTimeout(timer);
22
+ }, [copyNonce, resetAfter]);
23
+ const copy = (event) => {
24
+ event.preventDefault();
25
+ event.stopPropagation();
26
+ copyTextToClipboard(value, () => {
27
+ setCopyNonce((n) => n + 1);
28
+ onCopy?.(value);
29
+ });
30
+ };
31
+ return /* @__PURE__ */ jsx(Tooltip, { placement: "top", content: copied ? copiedLabel : idleLabel, interactive: false, children: /* @__PURE__ */ jsx(
32
+ CopyTrigger,
33
+ {
34
+ role: "button",
35
+ tabIndex: 0,
36
+ "aria-label": idleLabel,
37
+ onClick: copy,
38
+ onKeyDown: (event) => {
39
+ if (event.key === "Enter" || event.key === " ") copy(event);
40
+ },
41
+ children: children || /* @__PURE__ */ jsx(CopyToClipboardButton, { style: buttonStyle })
42
+ }
43
+ ) });
44
+ };
45
+ export {
46
+ CopyToClipboardTooltip
47
+ };
@@ -0,0 +1,16 @@
1
+ import styled from "styled-components";
2
+ const CopyTrigger = styled.span`
3
+ display: inline-flex;
4
+ align-items: center;
5
+ cursor: pointer;
6
+ line-height: 0;
7
+
8
+ &:focus-visible {
9
+ outline: 2px solid currentColor;
10
+ outline-offset: 2px;
11
+ border-radius: 2px;
12
+ }
13
+ `;
14
+ export {
15
+ CopyTrigger
16
+ };
@@ -1,25 +1,13 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import React__default, { useState } from "react";
2
+ import React__default from "react";
3
3
  import PropTypes from "prop-types";
4
- import { Tooltip } from "react-tippy";
5
- import { CopyToClipboard } from "react-copy-to-clipboard";
6
- import { Container, DataWrapper, CheckMark, Head, Title, Status, TitleSide, AddressWrap, Address, Body, DataBox, Value, Equal, InfoBox, OptionsWrapper, CopyToClipboardButton } from "./CryptoAddress.styles.js";
4
+ import { Tooltip } from "../Tooltip/Tooltip.js";
5
+ import { CopyToClipboardTooltip } from "../CopyToClipboardTooltip/CopyToClipboardTooltip.js";
6
+ import { Container, DataWrapper, CheckMark, Head, Title, Status, TitleSide, AddressWrap, Address, Body, DataBox, Value, Equal, InfoBox, OptionsWrapper } from "./CryptoAddress.styles.js";
7
7
  import stdin_default$1 from "./RadioWrap.js";
8
8
  import stdin_default$2 from "./ComponentWrap.js";
9
9
  import getShortAddress from "../../utils/get-short-address.js";
10
- const copyToClipBoard = (value, isCopied, setCopy) => /* @__PURE__ */ jsx(
11
- Tooltip,
12
- {
13
- position: "top",
14
- title: isCopied ? "Copied to clipboard!" : "Click to copy to clipboard.",
15
- theme: "light",
16
- arrow: true,
17
- hideOnClick: false,
18
- onHidden: () => setCopy(false),
19
- duration: 200,
20
- children: /* @__PURE__ */ jsx(CopyToClipboard, { text: value, onCopy: () => setCopy(true), children: /* @__PURE__ */ jsx(CopyToClipboardButton, {}) })
21
- }
22
- );
10
+ const copyToClipBoard = (value) => /* @__PURE__ */ jsx(CopyToClipboardTooltip, { value });
23
11
  const defaultData = {
24
12
  value: "",
25
13
  unit: "",
@@ -57,7 +45,6 @@ const CryptoAddress = ({
57
45
  dataValueStyle,
58
46
  valueChildMarginLeft
59
47
  }) => {
60
- const [copiedAddressToClipboard, setCopiedAddressToClipboard] = useState(false);
61
48
  return /* @__PURE__ */ jsx(Container, { style: containerStyle, children: /* @__PURE__ */ jsx(stdin_default$1, { radio, hide: radio && radio.hide, children: /* @__PURE__ */ jsx(stdin_default$2, { wrapped, borderTop, borderBottom: !noBorderBottom && borderBottom, children: /* @__PURE__ */ jsxs(DataWrapper, { withOptions: !!sideOptions, style: wrapperStyle, children: [
62
49
  radio && !radio.hide && /* @__PURE__ */ jsx(CheckMark, {}),
63
50
  /* @__PURE__ */ jsxs(Head, { noBody, noHead, flexHead, style: headStyle, children: [
@@ -67,8 +54,8 @@ const CryptoAddress = ({
67
54
  ] }),
68
55
  /* @__PURE__ */ jsxs(TitleSide, { children: [
69
56
  address && /* @__PURE__ */ jsxs(AddressWrap, { children: [
70
- /* @__PURE__ */ jsx(Tooltip, { position: "top", title: address, theme: "light", arrow: true, duration: 200, children: /* @__PURE__ */ jsx(Address, { children: getShortAddress(address) }) }),
71
- /* @__PURE__ */ jsx("div", { onClick: (e) => e.preventDefault(), children: copyToClipBoard(address, copiedAddressToClipboard, setCopiedAddressToClipboard) })
57
+ /* @__PURE__ */ jsx(Tooltip, { placement: "top", content: address, children: /* @__PURE__ */ jsx(Address, { children: getShortAddress(address) }) }),
58
+ /* @__PURE__ */ jsx("div", { onClick: (e) => e.preventDefault(), children: copyToClipBoard(address) })
72
59
  ] }),
73
60
  src && /* @__PURE__ */ jsx("img", { src, alt: "project logo", height: "50", width: 100, style: { objectFit: "contain" } })
74
61
  ] })
@@ -77,19 +64,8 @@ const CryptoAddress = ({
77
64
  /* @__PURE__ */ jsxs(DataBox, { style: dataBoxStyle, children: [
78
65
  data.value && /* @__PURE__ */ jsxs(Value, { fontSize, style: dataValueStyle, childMarginLeft: valueChildMarginLeft, children: [
79
66
  data.unit && `${data.unit} `,
80
- data.shortAddress ? /* @__PURE__ */ jsx(
81
- Tooltip,
82
- {
83
- position: "top",
84
- title: data.value,
85
- theme: "light",
86
- arrow: true,
87
- duration: 200,
88
- style: { margin: 0 },
89
- children: getShortAddress(data.value)
90
- }
91
- ) : data.value,
92
- data.tooltip && /* @__PURE__ */ jsx("div", { children: copyToClipBoard(data.value, copiedAddressToClipboard, setCopiedAddressToClipboard) })
67
+ data.shortAddress ? /* @__PURE__ */ jsx(Tooltip, { placement: "top", content: data.value, children: getShortAddress(data.value) }) : data.value,
68
+ data.tooltip && /* @__PURE__ */ jsx("div", { children: copyToClipBoard(data.value) })
93
69
  ] }),
94
70
  data.eqValue && /* @__PURE__ */ jsxs(Equal, { fontSize: eqValueFontSize, style: { eqValueStyle }, children: [
95
71
  "= ",
@@ -1,12 +1,34 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import DOMPurify from "dompurify";
3
- import PropTypes from "prop-types";
4
- import { useId } from "react";
5
3
  import parse from "html-react-parser";
6
- import { Tooltip } from "react-tippy";
7
- import { colors } from "../../styles/colors.js";
8
4
  import { IoniconsStyles } from "../../styles/ioniconsStyles.js";
9
- import { Container, ArrowColorGlobalStyle, Icon } from "./InfoIcon.styles.js";
5
+ import { Tooltip } from "../Tooltip/Tooltip.js";
6
+ import { Container, Icon } from "./InfoIcon.styles.js";
7
+ const DEAD_TIPPY_PROPS = [
8
+ "animation",
9
+ "animateFill",
10
+ "arrowSize",
11
+ "distance",
12
+ "duration",
13
+ "followCursor",
14
+ "hideOnClick",
15
+ "inertia",
16
+ "interactiveBorder",
17
+ "offset",
18
+ "onHidden",
19
+ "onRequestClose",
20
+ "onShow",
21
+ "onShown",
22
+ "popperOptions",
23
+ "rawTemplate",
24
+ "size",
25
+ "sticky",
26
+ "stickyDuration",
27
+ "tag",
28
+ "touchHold",
29
+ "unmountHTMLWhenHide",
30
+ "useContext"
31
+ ];
10
32
  const InfoIcon = ({
11
33
  title = null,
12
34
  html = null,
@@ -14,67 +36,56 @@ const InfoIcon = ({
14
36
  noMargin = false,
15
37
  noMarginLeft = false,
16
38
  noMarginRight = false,
17
- noIcon,
18
- disabled,
19
- fullWidth,
39
+ noIcon = false,
40
+ disabled = false,
41
+ fullWidth = false,
20
42
  arrow = true,
21
- arrowColor = colors.blue,
22
- theme = "light",
43
+ showArrow,
44
+ arrowColor,
45
+ theme,
23
46
  trigger,
24
47
  outline = false,
25
48
  containerStyle,
26
- ...props
49
+ tooltipProps,
50
+ children,
51
+ style,
52
+ ...rest
27
53
  }) => {
28
- const htmlContent = typeof html === "string" ? parse(DOMPurify.sanitize(html)) : html;
29
- const instanceToken = `info-${useId().replace(/[^a-zA-Z0-9]/g, "")}`;
30
- const tippyTheme = arrowColor ? `${theme} ${instanceToken}` : theme;
54
+ const content = html != null ? typeof html === "string" ? parse(DOMPurify.sanitize(html)) : html : title;
55
+ const containerProps = {};
56
+ Object.keys(rest).forEach((key) => {
57
+ if (DEAD_TIPPY_PROPS.includes(key)) {
58
+ return;
59
+ }
60
+ containerProps[key] = rest[key];
61
+ });
31
62
  return /* @__PURE__ */ jsxs(Fragment, { children: [
32
63
  /* @__PURE__ */ jsx(IoniconsStyles, {}),
33
- /* @__PURE__ */ jsxs(
64
+ /* @__PURE__ */ jsx(
34
65
  Container,
35
66
  {
36
67
  noMargin,
37
68
  noMarginLeft,
38
69
  noMarginRight,
39
70
  fullWidth,
40
- style: containerStyle,
41
- children: [
42
- arrowColor && /* @__PURE__ */ jsx(ArrowColorGlobalStyle, { themeName: instanceToken, color: arrowColor }),
43
- /* @__PURE__ */ jsx(
44
- Tooltip,
45
- {
46
- ...props,
47
- position,
48
- title,
49
- trigger,
50
- html: htmlContent,
51
- useContext: htmlContent != null,
52
- theme: tippyTheme,
53
- arrow: arrowColor ? true : arrow,
54
- duration: 200,
55
- disabled,
56
- children: noIcon ? props.children : /* @__PURE__ */ jsx(Icon, { outline })
57
- }
58
- )
59
- ]
71
+ style: { ...style, ...containerStyle },
72
+ ...containerProps,
73
+ children: /* @__PURE__ */ jsx(
74
+ Tooltip,
75
+ {
76
+ content,
77
+ placement: position,
78
+ disabled,
79
+ showArrow: showArrow ?? arrow,
80
+ arrowColor,
81
+ ...tooltipProps,
82
+ children: noIcon ? children : /* @__PURE__ */ jsx(Icon, { outline })
83
+ }
84
+ )
60
85
  }
61
86
  )
62
87
  ] });
63
88
  };
64
- InfoIcon.propTypes = {
65
- title: PropTypes.string,
66
- html: PropTypes.node,
67
- position: PropTypes.oneOf(["top", "bottom", "left", "right"]),
68
- noMargin: PropTypes.bool,
69
- noMarginLeft: PropTypes.bool,
70
- noMarginRight: PropTypes.bool,
71
- outline: PropTypes.bool,
72
- children: PropTypes.node,
73
- theme: PropTypes.string,
74
- trigger: PropTypes.oneOf(["click", "focus"]),
75
- arrow: PropTypes.bool,
76
- arrowColor: PropTypes.string
77
- };
78
89
  export {
79
90
  InfoIcon,
80
91
  Container as InfoIconContainer,
@@ -1,21 +1,8 @@
1
- import styled, { createGlobalStyle } from "styled-components";
1
+ import styled from "styled-components";
2
2
  import theme from "../../styles/theme.js";
3
- const ArrowColorGlobalStyle = createGlobalStyle`
4
- .tippy-popper[x-placement^='top'] .tippy-tooltip.${(props) => props.themeName}-theme [x-arrow] {
5
- border-top-color: ${(props) => props.color} !important;
6
- }
7
- .tippy-popper[x-placement^='bottom'] .tippy-tooltip.${(props) => props.themeName}-theme [x-arrow] {
8
- border-bottom-color: ${(props) => props.color} !important;
9
- }
10
- .tippy-popper[x-placement^='left'] .tippy-tooltip.${(props) => props.themeName}-theme [x-arrow] {
11
- border-left-color: ${(props) => props.color} !important;
12
- }
13
- .tippy-popper[x-placement^='right'] .tippy-tooltip.${(props) => props.themeName}-theme [x-arrow] {
14
- border-right-color: ${(props) => props.color} !important;
15
- }
16
- `;
3
+ const CONTAINER_OWN_PROPS = ["noMargin", "noMarginLeft", "noMarginRight", "fullWidth"];
17
4
  const Container = styled.div.withConfig({
18
- shouldForwardProp: (props) => !["noMargin", "noMarginLeft", "noMarginRight", "fullWidth"].includes(props)
5
+ shouldForwardProp: (prop) => !CONTAINER_OWN_PROPS.includes(prop)
19
6
  })`
20
7
  display: inline-block;
21
8
  vertical-align: middle;
@@ -23,37 +10,20 @@ const Container = styled.div.withConfig({
23
10
  font-size: 0;
24
11
  line-height: 0;
25
12
 
26
- ${(props) => props.noMargin && `
27
- margin: 0;
28
- `}
29
- ${(props) => props.noMarginLeft && `
30
- margin-left: 0;
31
- `}
32
- ${(props) => props.noMarginRight && `
33
- margin-right: 0;
34
- `}
13
+ ${(props) => props.noMargin && `margin: 0;`}
14
+ ${(props) => props.noMarginLeft && `margin-left: 0;`}
15
+ ${(props) => props.noMarginRight && `margin-right: 0;`}
35
16
 
36
17
  ${(props) => props.fullWidth && `
37
18
  width: 100%;
38
19
  height: 100%;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
39
23
  `}
40
-
41
- & > div {
42
- position: relative;
43
- display: inline-block !important;
44
-
45
- ${(props) => props.fullWidth && `
46
- width: 100%;
47
- height: 100%;
48
- display: flex !important;
49
- align-content: center;
50
- flex-wrap: wrap;
51
- justify-content: center;
52
- `}
53
- }
54
24
  `;
55
25
  const Icon = styled.i.withConfig({
56
- shouldForwardProp: (props) => !["outline"].includes(props)
26
+ shouldForwardProp: (prop) => prop !== "outline"
57
27
  }).attrs((props) => ({
58
28
  className: props.outline ? "ion ion-md-information-circle-outline" : "ion ion-md-information-circle"
59
29
  }))`
@@ -64,7 +34,6 @@ const Icon = styled.i.withConfig({
64
34
  vertical-align: middle;
65
35
  font-size: 16px;
66
36
  line-height: 16px;
67
- vertical-align: middle;
68
37
  color: ${() => theme.cGrey2};
69
38
  transition: color 0.2s;
70
39
 
@@ -73,7 +42,6 @@ const Icon = styled.i.withConfig({
73
42
  }
74
43
  `;
75
44
  export {
76
- ArrowColorGlobalStyle,
77
45
  Container,
78
46
  Icon
79
47
  };
@@ -1,11 +1,9 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
2
+ import "react";
3
3
  import styled from "styled-components";
4
4
  import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
5
5
  import { colors } from "../../styles/colors.js";
6
- import { CopyToClipboard } from "react-copy-to-clipboard";
7
- import { Tooltip } from "react-tippy";
8
- import { CopyToClipboardButton } from "../CryptoAddress/CryptoAddress.styles.js";
6
+ import { CopyToClipboardTooltip } from "../CopyToClipboardTooltip/CopyToClipboardTooltip.js";
9
7
  import stdin_default from "../QRCode/QRCode.js";
10
8
  import { SectionTitle } from "../SectionTitle/SectionTitle.styles.js";
11
9
  import { StatusDot } from "../StatusDot/StatusDot.js";
@@ -110,26 +108,6 @@ const AddressDescription = styled.p`
110
108
  text-align: center;
111
109
  color: ${colors.grey2};
112
110
  `;
113
- const CopyToClipBoardTooltip = ({ value, buttonStyle, onCopy }) => {
114
- const [copied, setCopied] = useState(false);
115
- const handleCopy = () => {
116
- setCopied(true);
117
- if (onCopy) onCopy(value);
118
- };
119
- return /* @__PURE__ */ jsx(
120
- Tooltip,
121
- {
122
- position: "top",
123
- title: copied ? "Copied to clipboard!" : "Click to copy to clipboard",
124
- theme: "light",
125
- arrow: true,
126
- hideOnClick: false,
127
- onHidden: () => setCopied(false),
128
- duration: 200,
129
- children: /* @__PURE__ */ jsx(CopyToClipboard, { text: value, onCopy: handleCopy, children: /* @__PURE__ */ jsx(CopyToClipboardButton, { style: buttonStyle }) })
130
- }
131
- );
132
- };
133
111
  const PaymentDisplay = ({
134
112
  amount,
135
113
  currency = "BTC",
@@ -181,7 +159,7 @@ const PaymentDisplay = ({
181
159
  /* @__PURE__ */ jsx(AmountCurrency, { style: amountTextStyle, children: currency })
182
160
  ] }),
183
161
  showCopyIcons && /* @__PURE__ */ jsx(
184
- CopyToClipBoardTooltip,
162
+ CopyToClipboardTooltip,
185
163
  {
186
164
  value: amount.toString(),
187
165
  buttonStyle: copyButtonStyle || { height: 22, width: 22 },
@@ -197,7 +175,7 @@ const PaymentDisplay = ({
197
175
  /* @__PURE__ */ jsxs(AddressRow, { children: [
198
176
  /* @__PURE__ */ jsx(AddressText, { style: addressTextStyle, children: address }),
199
177
  showCopyIcons && /* @__PURE__ */ jsx(
200
- CopyToClipBoardTooltip,
178
+ CopyToClipboardTooltip,
201
179
  {
202
180
  value: address,
203
181
  buttonStyle: copyButtonStyle || { height: 16, width: 16 },
@@ -96,7 +96,7 @@ const StatusTag = ({
96
96
  )
97
97
  ] }) });
98
98
  if (tooltip) {
99
- return /* @__PURE__ */ jsx(InfoIcon, { title: tooltip, position: "top", noIcon: true, noMarginLeft: true, noMarginRight: true, ...tooltipProps, children: content });
99
+ return /* @__PURE__ */ jsx(InfoIcon, { title: tooltip, position: "top", noIcon: true, noMarginLeft: true, noMarginRight: true, tooltipProps, children: content });
100
100
  }
101
101
  return content;
102
102
  };
@@ -6,7 +6,7 @@ import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js
6
6
  import { Container, TitleContainer, PendingCounter, Title, Subtitle } from "./ToDoList.styles.js";
7
7
  import stdin_default from "./ToDoListTask.js";
8
8
  import { Icon } from "./ToDoListTask.styles.js";
9
- import { Tooltip } from "react-tippy";
9
+ import { Tooltip } from "../Tooltip/Tooltip.js";
10
10
  const ToDoTaskState = {
11
11
  REJECTED: "rejected",
12
12
  DENIED: "rejected",
@@ -98,14 +98,9 @@ const ToDoList = ({
98
98
  /* @__PURE__ */ jsx(
99
99
  Tooltip,
100
100
  {
101
- position: "right",
102
- title: "Before you invest you must have registered the wallet that can hold your purchased securities. Click below and register it to proceed with your investment.",
103
- theme: "light",
104
- arrow: true,
105
- duration: 200,
106
- size: 40,
107
- style: { cursor: "help", fontSize: 16 },
108
- children: /* @__PURE__ */ jsx(TooltipIcon, { onClick: (e) => e.preventDefault() })
101
+ placement: "right",
102
+ content: "Before you invest you must have registered the wallet that can hold your purchased securities. Click below and register it to proceed with your investment.",
103
+ children: /* @__PURE__ */ jsx(TooltipIcon, { onClick: (e) => e.preventDefault(), style: { fontSize: 16 } })
109
104
  }
110
105
  )
111
106
  ] }) }),
@@ -1,7 +1,7 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import React__default from "react";
3
3
  import PropTypes from "prop-types";
4
- import { Tooltip } from "react-tippy";
4
+ import { Tooltip } from "../Tooltip/Tooltip.js";
5
5
  import { Container, IconContainer, Icon, Content, TitleContainer, Title, State } from "./ToDoListTask.styles.js";
6
6
  import { TooltipIcon } from "../Icon/Icon.style.js";
7
7
  import setRedirectCookie from "../../utils/set-redirect-cookie.js";
@@ -42,7 +42,7 @@ const ToDoTask = ({
42
42
  /* @__PURE__ */ jsxs(Content, { children: [
43
43
  /* @__PURE__ */ jsxs(TitleContainer, { children: [
44
44
  /* @__PURE__ */ jsx(Title, { link: link || openModal, state, children: title }),
45
- tooltip && /* @__PURE__ */ jsx(Tooltip, { position: "right", title: tooltip, theme: "light", arrow: true, duration: 200, children: /* @__PURE__ */ jsx(TooltipIcon, { onClick: (e) => e.preventDefault() }) })
45
+ tooltip && /* @__PURE__ */ jsx(Tooltip, { placement: "right", content: tooltip, children: /* @__PURE__ */ jsx(TooltipIcon, { onClick: (e) => e.preventDefault() }) })
46
46
  ] }),
47
47
  message ? /* @__PURE__ */ jsx(State, { children: message }) : ""
48
48
  ] })
@@ -53,7 +53,7 @@ const ToDoTask = ({
53
53
  /* @__PURE__ */ jsxs(Content, { children: [
54
54
  /* @__PURE__ */ jsxs(TitleContainer, { children: [
55
55
  /* @__PURE__ */ jsx(Title, { state, children: title }),
56
- tooltip && /* @__PURE__ */ jsx(Tooltip, { position: "right", title: tooltip, theme: "light", arrow: true, duration: 200, children: /* @__PURE__ */ jsx(TooltipIcon, { onClick: (e) => e.preventDefault() }) })
56
+ tooltip && /* @__PURE__ */ jsx(Tooltip, { placement: "right", content: tooltip, children: /* @__PURE__ */ jsx(TooltipIcon, { onClick: (e) => e.preventDefault() }) })
57
57
  ] }),
58
58
  message ? /* @__PURE__ */ jsx(State, { children: message }) : ""
59
59
  ] })
@@ -0,0 +1,143 @@
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
+ import { useState, useRef, isValidElement, cloneElement, useEffect, useLayoutEffect } from "react";
3
+ import { useFloating, autoUpdate, offset, flip, shift, arrow, useInteractions, useHover, safePolygon, useFocus, useClick, useDismiss, useRole, useTransitionStyles, useMergeRefs, FloatingPortal, FloatingArrow } from "@floating-ui/react";
4
+ import theme from "../../styles/theme.js";
5
+ import { TriggerWrapper, Bubble } from "./Tooltip.styles.js";
6
+ const useIsomorphicLayoutEffect = typeof document === "undefined" ? useEffect : useLayoutEffect;
7
+ const PLACEMENTS = ["top", "bottom", "left", "right"];
8
+ const FORWARD_REF = /* @__PURE__ */ Symbol.for("react.forward_ref");
9
+ const MEMO = /* @__PURE__ */ Symbol.for("react.memo");
10
+ const acceptsDomRef = (type) => {
11
+ if (typeof type === "string") return true;
12
+ const tag = type?.$$typeof;
13
+ if (tag === FORWARD_REF) return true;
14
+ if (tag === MEMO) return acceptsDomRef(type.type);
15
+ return false;
16
+ };
17
+ const ARROW_WIDTH = 12;
18
+ const ARROW_HEIGHT = 6;
19
+ const GAP = 4;
20
+ const Tooltip = ({
21
+ content,
22
+ children,
23
+ placement = "bottom",
24
+ disabled = false,
25
+ delay = { open: 100, close: 0 },
26
+ showArrow = true,
27
+ arrowColor,
28
+ maxWidth = 260,
29
+ interactive = false,
30
+ open: controlledOpen,
31
+ onOpenChange,
32
+ reference,
33
+ className,
34
+ style,
35
+ zIndex = 9999
36
+ }) => {
37
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
38
+ const arrowRef = useRef(null);
39
+ const isControlled = controlledOpen !== void 0;
40
+ const open = isControlled ? !!controlledOpen : uncontrolledOpen;
41
+ const hasContent = content !== null && content !== void 0 && content !== "";
42
+ const inert = disabled || !hasContent;
43
+ const safePlacement = PLACEMENTS.includes(placement) ? placement : "bottom";
44
+ const { refs, floatingStyles, context } = useFloating({
45
+ open,
46
+ onOpenChange: (next) => {
47
+ if (!isControlled) setUncontrolledOpen(next);
48
+ onOpenChange?.(next);
49
+ },
50
+ placement: safePlacement,
51
+ whileElementsMounted: autoUpdate,
52
+ middleware: [
53
+ offset(ARROW_HEIGHT + GAP),
54
+ flip({ fallbackAxisSideDirection: "start", padding: 8 }),
55
+ shift({ padding: 8 }),
56
+ // eslint-disable-next-line react-hooks/refs -- floating-ui's documented arrow API takes the ref object itself, it is not read during render
57
+ showArrow ? arrow({ element: arrowRef, padding: 6 }) : null
58
+ ].filter(Boolean)
59
+ });
60
+ const hadVirtualReference = useRef(false);
61
+ useIsomorphicLayoutEffect(() => {
62
+ if (reference) {
63
+ hadVirtualReference.current = true;
64
+ refs.setPositionReference(reference);
65
+ return;
66
+ }
67
+ if (hadVirtualReference.current) {
68
+ hadVirtualReference.current = false;
69
+ refs.setPositionReference(null);
70
+ refs.setReference(refs.domReference.current);
71
+ }
72
+ }, [reference, refs]);
73
+ const interactive_ = !inert && !isControlled;
74
+ const { getReferenceProps, getFloatingProps } = useInteractions([
75
+ useHover(context, {
76
+ enabled: interactive_,
77
+ delay,
78
+ mouseOnly: true,
79
+ move: false,
80
+ handleClose: interactive ? safePolygon({ blockPointerEvents: false }) : null
81
+ }),
82
+ useFocus(context, { enabled: interactive_, visibleOnly: true }),
83
+ // Touch has no hover: tap toggles. `ignoreMouse` avoids double-firing with hover.
84
+ // `keyboardHandlers: false` — Enter/Space would otherwise toggle the tooltip shut
85
+ // when a keyboard user activates the trigger (focus already governs visibility).
86
+ useClick(context, { enabled: interactive_, ignoreMouse: true, keyboardHandlers: false }),
87
+ // `ancestorScroll: false` — autoUpdate already keeps the bubble anchored while
88
+ // scrolling, and dismissing on scroll leaves a stationary pointer unable to reopen.
89
+ useDismiss(context, { enabled: !inert && !isControlled, ancestorScroll: false }),
90
+ useRole(context, { role: "tooltip" })
91
+ ]);
92
+ const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {
93
+ duration: 200,
94
+ initial: { opacity: 0 }
95
+ });
96
+ const candidate = isValidElement(children) ? children : null;
97
+ const childRef = (candidate?.props?.ref ?? candidate?.ref) || null;
98
+ const mergedRef = useMergeRefs([refs.setReference, childRef]);
99
+ const childProps = candidate?.props;
100
+ const childIsDisabled = !!childProps?.disabled || childProps?.["aria-disabled"] === true;
101
+ const childTakesRef = !!candidate && acceptsDomRef(candidate.type);
102
+ const child = candidate && childTakesRef && !childIsDisabled ? candidate : null;
103
+ if (inert) return /* @__PURE__ */ jsx(Fragment, { children });
104
+ let trigger = null;
105
+ if (child) {
106
+ trigger = cloneElement(child, {
107
+ ...getReferenceProps({ ...child.props, ref: mergedRef })
108
+ });
109
+ } else if (children != null) {
110
+ trigger = /* @__PURE__ */ jsx(TriggerWrapper, { ref: refs.setReference, ...getReferenceProps(), children });
111
+ }
112
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
113
+ trigger,
114
+ isMounted && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsxs(
115
+ Bubble,
116
+ {
117
+ ref: refs.setFloating,
118
+ className,
119
+ $maxWidth: maxWidth,
120
+ $interactive: interactive,
121
+ style: { ...style, ...floatingStyles, ...transitionStyles, zIndex },
122
+ ...getFloatingProps(),
123
+ children: [
124
+ content,
125
+ showArrow && /* @__PURE__ */ jsx(
126
+ FloatingArrow,
127
+ {
128
+ ref: arrowRef,
129
+ context,
130
+ width: ARROW_WIDTH,
131
+ height: ARROW_HEIGHT,
132
+ tipRadius: 1,
133
+ fill: arrowColor || theme.cPrimary
134
+ }
135
+ )
136
+ ]
137
+ }
138
+ ) })
139
+ ] });
140
+ };
141
+ export {
142
+ Tooltip
143
+ };
@@ -0,0 +1,32 @@
1
+ import styled from "styled-components";
2
+ import { colors } from "../../styles/colors.js";
3
+ const TriggerWrapper = styled.span`
4
+ display: inline-flex;
5
+ `;
6
+ const Bubble = styled.div`
7
+ box-sizing: border-box;
8
+ /* Matches react-tippy: .tippy-popper was pointer-events:none unless interactive. */
9
+ pointer-events: ${({ $interactive }) => $interactive ? "auto" : "none"};
10
+ width: max-content;
11
+ max-width: ${({ $maxWidth }) => typeof $maxWidth === "number" ? `${$maxWidth}px` : $maxWidth};
12
+ padding: 12px;
13
+ border-radius: 10px;
14
+ background: ${colors.white};
15
+ color: ${colors.black};
16
+ font-size: 14px;
17
+ line-height: 18px;
18
+ font-weight: 400;
19
+ letter-spacing: 0.4px;
20
+ text-align: center;
21
+ word-break: break-word;
22
+ /* tippy.css supplied these; without them macOS subpixel AA renders noticeably heavier. */
23
+ -webkit-font-smoothing: antialiased;
24
+ -moz-osx-font-smoothing: grayscale;
25
+ box-shadow:
26
+ 0 0 12px 8px rgba(0, 0, 0, 0.03),
27
+ 0 0 6px 3px rgba(0, 0, 0, 0.02);
28
+ `;
29
+ export {
30
+ Bubble,
31
+ TriggerWrapper
32
+ };
package/dist/index.js CHANGED
@@ -31,6 +31,9 @@ import { Header } from "./components/Header/Header.js";
31
31
  import { Icon2 } from "./components/Icon/Icon2.js";
32
32
  import { Icon, TooltipIcon, iconsMap } from "./components/Icon/Icon.style.js";
33
33
  import { InfoIcon } from "./components/InfoIcon/InfoIcon.js";
34
+ import { Tooltip } from "./components/Tooltip/Tooltip.js";
35
+ import { Bubble } from "./components/Tooltip/Tooltip.styles.js";
36
+ import { CopyToClipboardTooltip } from "./components/CopyToClipboardTooltip/CopyToClipboardTooltip.js";
34
37
  import { Input } from "./components/Input/Input.js";
35
38
  import { SearchInput } from "./components/Input/SearchInput.js";
36
39
  import { DatePickerInput } from "./components/Input/DatePickerInput.js";
@@ -128,7 +131,7 @@ import { alias, getAmountBucket, getTokenBucket, hasOptedIn, identify, initAnaly
128
131
  import { checkSaleTimeLeft } from "./utils/check-sale-time-left.js";
129
132
  import { checkTodoStatus } from "./utils/check-todo-status.js";
130
133
  import { generateCoreChecklistTasks, getVerifyIdentityChecklist } from "./utils/checklistGenerator.js";
131
- import { CopyToClipBoardTooltip, copyTextToClipboard, useCopyToClipboard, withCopyToClipboard } from "./utils/copyToClipboard.js";
134
+ import { CopyToClipBoardTooltip, useCopyToClipboard, withCopyToClipboard } from "./utils/copyToClipboard.js";
132
135
  import { cooldownHOC, useComponentVisible, useContainerSize, useCooldown, useMobileView, usePrevious } from "./utils/customHooks.js";
133
136
  import { fixDecimals, formatDisplayNumber } from "./utils/fix-decimals.js";
134
137
  import { CURRENCY_CONFIG, formatAmountForDisplay, formatCurrencyValue, getCurrencyConfig, getCurrencyIcon, getCurrencySymbol, getLiquidAssetIcon, getProjectCurrencySign } from "./utils/formatCurrencyValue.js";
@@ -153,102 +156,103 @@ import { default as default2 } from "./styles/fonts.js";
153
156
  import { GlobalStyle } from "./styles/global.js";
154
157
  import { IoniconsStyles } from "./styles/ioniconsStyles.js";
155
158
  import { default as default3 } from "./styles/grid.js";
156
- import { default as default4 } from "./styles/reactTippy.js";
157
- import { DisplayOnBreakpoint, getMedia, default as default5, rwdMax, sizes } from "./styles/rwd.js";
158
- import { default as default6 } from "./styles/semanticUi.js";
159
- import { default as default7 } from "./styles/spacing.js";
160
- import { default as default8 } from "./styles/theme.js";
159
+ import { reactTippyStyle } from "./styles/reactTippy.js";
160
+ import { DisplayOnBreakpoint, getMedia, default as default4, rwdMax, sizes } from "./styles/rwd.js";
161
+ import { default as default5 } from "./styles/semanticUi.js";
162
+ import { default as default6 } from "./styles/spacing.js";
163
+ import { default as default7 } from "./styles/theme.js";
161
164
  import { BASE_COLOR_HEX, BASE_FONT_SIZE, BASE_MARGIN, BASE_MARGIN_2X_PX, BASE_MARGIN_PX, BLUE_BASE_HEX, BLUE_BASE_RELEASED_HEX, CAPITAL_ANIMATION_LENGTH, COLUMN, DESKTOP_MEDIA, GRAY_BASE_HEX, GRAY_DEEP_HEX, GRAY_SECONDARY_HEX, GREEN, MAX_WIDTH, PHONE_MEDIA, RED_BASE_HEX, RED_BASE_RELEASE_HEX, SLIDER_HEIGHT, SLIDER_MOBILE_HEIGHT, SLIDER_TABLET_HEIGHT, TABLET_MEDIA, WHITE_HEX } from "./constants/style.js";
162
165
  import { LoanActivityTypes, ProfessionalInvestorStatuses, ProjectStates, ProjectStatus, ProjectTypes, TransactionTypes, USInvestorAcreditationStatuses, UserTypes, emailRegex, transactionTypeDisplayNames, walletTypes } from "./constants/globalVariables.js";
163
- import { default as default9 } from "./components/SvgIcons/AdminBadgeSvg.js";
166
+ import { default as default8 } from "./components/SvgIcons/AdminBadgeSvg.js";
164
167
  import { Arrow } from "./components/icons/Arrow.js";
165
168
  import { ArrowSimple } from "./components/icons/ArrowSimple.js";
166
169
  import { BackButtonIcon, StyledBackButton, StyledBackButtonExternal, StyledWindowBackButton } from "./components/BackButton/BackButton.styles.js";
167
170
  import { Breakdown } from "./components/breakdown/Breakdown.js";
168
- import { default as default10 } from "./components/SvgIcons/CameraSvg.js";
169
- import { default as default11 } from "./components/SvgIcons/CapsLockSvg.js";
171
+ import { default as default9 } from "./components/SvgIcons/CameraSvg.js";
172
+ import { default as default10 } from "./components/SvgIcons/CapsLockSvg.js";
170
173
  import { Check } from "./components/icons/Check.js";
171
- import { default as default12 } from "./components/2FA/Connect2FA.js";
174
+ import { default as default11 } from "./components/2FA/Connect2FA.js";
172
175
  import { ContainerWithLine } from "./components/RegisterConfirmModal/RegisterConfirmModal.styles.js";
173
176
  import { CopyToClipboard } from "react-copy-to-clipboard";
174
- import { default as default13 } from "./components/SvgIcons/DocumentBackSvg.js";
175
- import { default as default14 } from "./components/SvgIcons/DocumentSmallSvg.js";
176
- import { default as default15 } from "./components/SvgIcons/DocumentSvg.js";
177
- import { default as default16 } from "./components/2FA/enable-2fa-flow.js";
178
- import { default as default17 } from "./components/2FA/EnterCode.js";
179
- import { default as default18 } from "./components/SvgIcons/EthSvg.js";
180
- import { default as default19 } from "./components/SvgIcons/EurSvg.js";
181
- import { default as default20 } from "./components/SvgIcons/FaceScanIconSvg.js";
177
+ import { default as default12 } from "./components/SvgIcons/DocumentBackSvg.js";
178
+ import { default as default13 } from "./components/SvgIcons/DocumentSmallSvg.js";
179
+ import { default as default14 } from "./components/SvgIcons/DocumentSvg.js";
180
+ import { default as default15 } from "./components/2FA/enable-2fa-flow.js";
181
+ import { default as default16 } from "./components/2FA/EnterCode.js";
182
+ import { default as default17 } from "./components/SvgIcons/EthSvg.js";
183
+ import { default as default18 } from "./components/SvgIcons/EurSvg.js";
184
+ import { default as default19 } from "./components/SvgIcons/FaceScanIconSvg.js";
182
185
  import { Facebook } from "./components/icons/Facebook.js";
183
186
  import { FaqContent, FaqDropdownIcon, FaqItem, FaqItems, FaqText, FaqTitle } from "./components/FAQ/FAQ.styles.js";
184
187
  import * as Flags from "country-flag-icons/react/3x2";
185
- import { default as default21 } from "./components/Footer/Footer.js";
186
- import { default as default22, getFooterGroups } from "./components/Footer/FooterLayout.js";
187
- import { default as default23 } from "./components/Footer/FooterMenu.js";
188
+ import { default as default20 } from "./components/Footer/Footer.js";
189
+ import { default as default21, getFooterGroups } from "./components/Footer/FooterLayout.js";
190
+ import { default as default22 } from "./components/Footer/FooterMenu.js";
188
191
  import { FormContainer, FormError, FormField, FormInfo } from "./components/Form/Form.styles.js";
189
- import { default as default24 } from "./components/SvgIcons/FourSvg.js";
190
- import { default as default25 } from "./components/SvgIcons/Glassess.js";
192
+ import { default as default23 } from "./components/SvgIcons/FourSvg.js";
193
+ import { default as default24 } from "./components/SvgIcons/Glassess.js";
191
194
  import { HeaderHo } from "./components/headerHo/HeaderHo.js";
192
195
  import { FieldLabel, FieldValue } from "./components/IdentityInfo/IdentityInfo.styles.js";
193
196
  import { Info } from "./components/icons/Info.js";
194
197
  import { Container as Container2, Icon as Icon3 } from "./components/InfoIcon/InfoIcon.styles.js";
195
198
  import { Label, InputWrap, Wrapper as Wrapper2 } from "./components/Input/Input.styles.js";
196
199
  import { Instagram } from "./components/icons/Instagram.js";
197
- import { default as default26 } from "./components/2FA/InstallAuthApp.js";
200
+ import { default as default25 } from "./components/2FA/InstallAuthApp.js";
198
201
  import { LatestUpdateWrapper } from "./components/LatestUpdate/LatestUpdate.styles.js";
199
202
  import { LinkIcon } from "./components/icons/LinkIcon.js";
200
203
  import { LinkText, Scroll, StyledTab, StyledTabs, TabsWrapper } from "./components/TabsNav/TabsNav.styles.js";
201
204
  import { LinkedIn } from "./components/icons/LinkedIn.js";
202
- import { default as default27 } from "./components/2FA/login-with-otp-flow.js";
205
+ import { default as default26 } from "./components/2FA/login-with-otp-flow.js";
203
206
  import { Logo } from "./components/logo/Logo.js";
204
- import { default as default28 } from "./components/SvgIcons/LogoSvg.js";
205
- import { default as default29 } from "./components/2FA/main-flow.js";
207
+ import { default as default27 } from "./components/SvgIcons/LogoSvg.js";
208
+ import { default as default28 } from "./components/2FA/main-flow.js";
206
209
  import { Medium } from "./components/icons/Medium.js";
207
210
  import { ModalBack, Box, ModalClose, Dimmer, ModalInner, ModalInnerSmartContractAddress, ModalInnerWithBorder, ModalLink, ModalLinkWrap, ModalRoot, ModalScroll } from "./components/Modal/Modal.styles.js";
208
- import { default as default30 } from "./components/SvgIcons/OneSvg.js";
209
- import { default as default31 } from "./components/SvgIcons/PassportSvg.js";
211
+ import { default as default29 } from "./components/SvgIcons/OneSvg.js";
212
+ import { default as default30 } from "./components/SvgIcons/PassportSvg.js";
210
213
  import { Reddit } from "./components/icons/Reddit.js";
211
- import { default as default32 } from "./components/SvgIcons/RefreshSvg.js";
212
- import { default as default33 } from "./components/taxId/register-taxid.js";
213
- import { default as default34 } from "./components/taxId/complete.js";
214
- import { default as default35 } from "./components/taxId/flow.js";
215
- import { default as default36 } from "./components/2FA/ResetCode.js";
214
+ import { default as default31 } from "./components/SvgIcons/RefreshSvg.js";
215
+ import { default as default32 } from "./components/taxId/register-taxid.js";
216
+ import { default as default33 } from "./components/taxId/complete.js";
217
+ import { default as default34 } from "./components/taxId/flow.js";
218
+ import { default as default35 } from "./components/2FA/ResetCode.js";
216
219
  import { SelectContainer, SelectControl, SelectIcon, SelectMenu, SelectMenuList, SelectOption, SelectValueContainer, SelectWrapper } from "./components/Input/Select.styles.js";
217
220
  import { Share } from "./components/icons/Share.js";
218
221
  import { Snackbar } from "./components/Snackbar/Snackbar.js";
219
222
  import { SnackbarContext, SnackbarProvider } from "./components/Snackbar/SnackbarProvider.js";
220
- import { default as default37 } from "./components/SvgIcons/SocialFacebook.js";
221
- import { default as default38 } from "./components/SvgIcons/SocialInstagram.js";
222
- import { default as default39 } from "./components/SvgIcons/SocialLinkedIn.js";
223
- import { default as default40 } from "./components/SvgIcons/SocialMedium.js";
224
- import { default as default41 } from "./components/SvgIcons/SocialReddit.js";
225
- import { default as default42 } from "./components/SvgIcons/SocialTelegram.js";
226
- import { default as default43 } from "./components/SvgIcons/SocialTwitter.js";
227
- import { default as default44 } from "./components/SvgIcons/SocialYoutube.js";
223
+ import { default as default36 } from "./components/SvgIcons/SocialFacebook.js";
224
+ import { default as default37 } from "./components/SvgIcons/SocialInstagram.js";
225
+ import { default as default38 } from "./components/SvgIcons/SocialLinkedIn.js";
226
+ import { default as default39 } from "./components/SvgIcons/SocialMedium.js";
227
+ import { default as default40 } from "./components/SvgIcons/SocialReddit.js";
228
+ import { default as default41 } from "./components/SvgIcons/SocialTelegram.js";
229
+ import { default as default42 } from "./components/SvgIcons/SocialTwitter.js";
230
+ import { default as default43 } from "./components/SvgIcons/SocialYoutube.js";
228
231
  import { StyledReactTable, Styles, TableWrap } from "./components/AdminDashboard/Table/Table.styles.js";
229
232
  import { SuccessModal, SuccessModal as SuccessModal2, showProgress, showSuccess } from "./components/Modal/SuccessModal/SuccessModal.js";
230
- import { default as default45 } from "./components/2FA/Sucess2FA.js";
233
+ import { default as default44 } from "./components/2FA/Sucess2FA.js";
231
234
  import { Tab } from "./components/Tabs/Tabs.styles.js";
232
- import { default as default46 } from "./components/TabsNav/TabNav.js";
235
+ import { default as default45 } from "./components/TabsNav/TabNav.js";
233
236
  import { Telegram } from "./components/icons/Telegram.js";
234
- import { default as default47 } from "./components/SvgIcons/ThreeSvg.js";
237
+ import { default as default46 } from "./components/SvgIcons/ThreeSvg.js";
235
238
  import { Twitter } from "./components/icons/Twitter.js";
236
- import { default as default48 } from "./components/SvgIcons/TwoSidedDocumentSvg.js";
237
- import { default as default49 } from "./components/SvgIcons/TwoSvg.js";
238
- import { default as default50 } from "./components/SvgIcons/UpdateDefaultSvg.js";
239
- import { default as default51 } from "./components/SvgIcons/UpdateHardSvg.js";
240
- import { default as default52 } from "./components/SvgIcons/UpdateSoftSvg.js";
241
- import { default as default53 } from "./components/SvgIcons/UploadSvg.js";
242
- import { default as default54 } from "./components/SvgIcons/VerifiedBadge.js";
239
+ import { default as default47 } from "./components/SvgIcons/TwoSidedDocumentSvg.js";
240
+ import { default as default48 } from "./components/SvgIcons/TwoSvg.js";
241
+ import { default as default49 } from "./components/SvgIcons/UpdateDefaultSvg.js";
242
+ import { default as default50 } from "./components/SvgIcons/UpdateHardSvg.js";
243
+ import { default as default51 } from "./components/SvgIcons/UpdateSoftSvg.js";
244
+ import { default as default52 } from "./components/SvgIcons/UploadSvg.js";
245
+ import { default as default53 } from "./components/SvgIcons/VerifiedBadge.js";
243
246
  import { X } from "./components/icons/X.js";
244
247
  import { Youtube } from "./components/icons/Youtube.js";
248
+ import { copyTextToClipboard } from "./utils/copy-text-to-clipboard.js";
245
249
  import { format } from "date-fns";
246
250
  import { getAnalyticsIngestUrl, getBackofficeAppUrl } from "./utils/app-urls-analytics-backoffice.js";
247
251
  import { getConfig, resetRuntimeConfig } from "./runtime-config.js";
248
252
  import { useSnackbar } from "./components/Snackbar/useSnackbar.js";
249
253
  export {
250
254
  AccountBalance,
251
- default9 as AdminBadgeSvg,
255
+ default8 as AdminBadgeSvg,
252
256
  AgreementItem,
253
257
  AnimatedSpan,
254
258
  AnnouncementTitleMain,
@@ -278,8 +282,8 @@ export {
278
282
  CAPITAL_ANIMATION_LENGTH,
279
283
  COLUMN,
280
284
  CURRENCY_CONFIG,
281
- default10 as CameraSvg,
282
- default11 as CapsLockSvg,
285
+ default9 as CameraSvg,
286
+ default10 as CapsLockSvg,
283
287
  Card,
284
288
  CardHeader,
285
289
  CardHeaderRegular,
@@ -304,7 +308,7 @@ export {
304
308
  ComponentScroll,
305
309
  ComponentWrapper,
306
310
  ConfirmModal,
307
- default12 as Connect2FA,
311
+ default11 as Connect2FA,
308
312
  Container,
309
313
  ContainerWithLine,
310
314
  ContentInnerFull,
@@ -315,6 +319,7 @@ export {
315
319
  Copy,
316
320
  CopyToClipBoardTooltip,
317
321
  CopyToClipboard,
322
+ CopyToClipboardTooltip,
318
323
  CountrySelect,
319
324
  CryptoAddress,
320
325
  CryptoAddressDetails,
@@ -330,19 +335,19 @@ export {
330
335
  DetailsSection,
331
336
  DetailsToggle,
332
337
  DisplayOnBreakpoint,
333
- default13 as DocumentBackSvg,
334
- default14 as DocumentSmallSvg,
335
- default15 as DocumentSvg,
338
+ default12 as DocumentBackSvg,
339
+ default13 as DocumentSmallSvg,
340
+ default14 as DocumentSvg,
336
341
  DoubleButtons,
337
342
  ENTROPY_MEDIUM,
338
343
  ENTROPY_WEAK,
339
- default16 as Enable2FAFlow,
340
- default17 as EnterCode,
344
+ default15 as Enable2FAFlow,
345
+ default16 as EnterCode,
341
346
  ErrorMessage,
342
- default18 as EthSvg,
343
- default19 as EurSvg,
347
+ default17 as EthSvg,
348
+ default18 as EurSvg,
344
349
  FAQ,
345
- default20 as FaceScanIconSvg,
350
+ default19 as FaceScanIconSvg,
346
351
  Facebook,
347
352
  FaqContent,
348
353
  FaqDropdownIcon,
@@ -354,22 +359,22 @@ export {
354
359
  Flags,
355
360
  FlexContainer,
356
361
  FlexGrid,
357
- default21 as Footer,
358
- default22 as FooterLayout,
359
- default23 as FooterMenu,
362
+ default20 as Footer,
363
+ default21 as FooterLayout,
364
+ default22 as FooterMenu,
360
365
  ForgotPasswordModal,
361
366
  Form,
362
367
  FormContainer,
363
368
  FormError,
364
369
  FormField,
365
370
  FormInfo,
366
- default24 as FourSvg,
371
+ default23 as FourSvg,
367
372
  GRAY_BASE_HEX,
368
373
  GRAY_DEEP_HEX,
369
374
  GRAY_SECONDARY_HEX,
370
375
  GREEN,
371
376
  GlareButton,
372
- default25 as Glassess,
377
+ default24 as Glassess,
373
378
  GlobalStyle,
374
379
  Header,
375
380
  HeaderHo,
@@ -397,7 +402,7 @@ export {
397
402
  InputWrap,
398
403
  Wrapper2 as InputWrapper,
399
404
  Instagram,
400
- default26 as InstallAuthApp,
405
+ default25 as InstallAuthApp,
401
406
  InvestmentStat,
402
407
  IoniconsStyles,
403
408
  Item,
@@ -416,12 +421,12 @@ export {
416
421
  LoadingDots,
417
422
  LoanActivityTypes,
418
423
  LoginModal,
419
- default27 as LoginWithOTPFlow,
424
+ default26 as LoginWithOTPFlow,
420
425
  Logo,
421
- default28 as LogoSvg,
426
+ default27 as LogoSvg,
422
427
  LottieAnimation,
423
428
  MAX_WIDTH,
424
- default29 as Main2FAFlow,
429
+ default28 as Main2FAFlow,
425
430
  MainMenu,
426
431
  Medium,
427
432
  MemoCryptoAddress,
@@ -445,7 +450,7 @@ export {
445
450
  NotificationCounter,
446
451
  Number,
447
452
  NumberWithContainer,
448
- default30 as OneSvg,
453
+ default29 as OneSvg,
449
454
  OptionLabel,
450
455
  OtpInput,
451
456
  Outer,
@@ -456,7 +461,7 @@ export {
456
461
  PageWrapper,
457
462
  Pagination,
458
463
  PaginationControls,
459
- default31 as PassportSvg,
464
+ default30 as PassportSvg,
460
465
  PaymentDetailsCard,
461
466
  PaymentDisplay,
462
467
  PaymentModal,
@@ -480,14 +485,14 @@ export {
480
485
  ReactTableWrapper,
481
486
  Reddit,
482
487
  RefreshButton,
483
- default32 as RefreshSvg,
488
+ default31 as RefreshSvg,
484
489
  RegisterConfirmModal,
485
490
  RegisterModal,
486
- default33 as RegisterTaxId,
487
- default34 as RegisterTaxIdComplete,
488
- default35 as RegisterTaxIdFlow,
491
+ default32 as RegisterTaxId,
492
+ default33 as RegisterTaxIdComplete,
493
+ default34 as RegisterTaxIdFlow,
489
494
  RequestDataBox,
490
- default36 as ResetCode,
495
+ default35 as ResetCode,
491
496
  ResetConfirmModal,
492
497
  ResetPasswordModal,
493
498
  RouterWrapper,
@@ -517,14 +522,14 @@ export {
517
522
  Snackbar,
518
523
  SnackbarContext,
519
524
  SnackbarProvider,
520
- default37 as SocialFacebook,
521
- default38 as SocialInstagram,
522
- default39 as SocialLinkedIn,
523
- default40 as SocialMedium,
524
- default41 as SocialReddit,
525
- default42 as SocialTelegram,
526
- default43 as SocialTwitter,
527
- default44 as SocialYoutube,
525
+ default36 as SocialFacebook,
526
+ default37 as SocialInstagram,
527
+ default38 as SocialLinkedIn,
528
+ default39 as SocialMedium,
529
+ default40 as SocialReddit,
530
+ default41 as SocialTelegram,
531
+ default42 as SocialTwitter,
532
+ default43 as SocialYoutube,
528
533
  SpanButton,
529
534
  StatusBadge,
530
535
  StatusDot,
@@ -547,11 +552,11 @@ export {
547
552
  Styles,
548
553
  SuccessModal,
549
554
  SuccessModal2 as SuccessModalComponent,
550
- default45 as Sucess2FA,
555
+ default44 as Sucess2FA,
551
556
  Switch,
552
557
  TABLET_MEDIA,
553
558
  Tab,
554
- default46 as TabNav,
559
+ default45 as TabNav,
555
560
  Table,
556
561
  TableFilterDropdown,
557
562
  TableWrap,
@@ -566,7 +571,7 @@ export {
566
571
  TextButton,
567
572
  TextLink,
568
573
  Textarea,
569
- default47 as ThreeSvg,
574
+ default46 as ThreeSvg,
570
575
  ThumbH,
571
576
  ThumbV,
572
577
  Timeline,
@@ -577,6 +582,8 @@ export {
577
582
  ToDoTask,
578
583
  ToDoTaskMessage,
579
584
  ToDoTaskState,
585
+ Tooltip,
586
+ Bubble as TooltipBubble,
580
587
  TooltipIcon,
581
588
  TrackH,
582
589
  TrackV,
@@ -584,16 +591,16 @@ export {
584
591
  TransactionInfo,
585
592
  TransactionTypes,
586
593
  Twitter,
587
- default48 as TwoSidedDocumentSvg,
588
- default49 as TwoSvg,
594
+ default47 as TwoSidedDocumentSvg,
595
+ default48 as TwoSvg,
589
596
  USInvestorAcreditationStatuses,
590
- default50 as UpdateDefaultSvg,
591
- default51 as UpdateHardSvg,
592
- default52 as UpdateSoftSvg,
593
- default53 as UploadSvg,
597
+ default49 as UpdateDefaultSvg,
598
+ default50 as UpdateHardSvg,
599
+ default51 as UpdateSoftSvg,
600
+ default52 as UploadSvg,
594
601
  UppercaseText,
595
602
  UserTypes,
596
- default54 as VerifiedBadge,
603
+ default53 as VerifiedBadge,
597
604
  WHITE_HEX,
598
605
  Wrap,
599
606
  Wrapper,
@@ -654,24 +661,24 @@ export {
654
661
  optIn,
655
662
  optOut,
656
663
  pathnameIfSameOrigin,
657
- default4 as reactTippyStyle,
664
+ reactTippyStyle,
658
665
  reset,
659
666
  resetRuntimeConfig,
660
667
  resolveCopy,
661
- default5 as rwd,
668
+ default4 as rwd,
662
669
  rwdMax,
663
670
  saveAs,
664
671
  scrollToElement,
665
- default6 as semanticUiStyle,
672
+ default5 as semanticUiStyle,
666
673
  setCopySource,
667
674
  setUserProperties,
668
675
  showAccountLockedModal,
669
676
  showProgress,
670
677
  showSuccess,
671
678
  sizes,
672
- default7 as spacing,
679
+ default6 as spacing,
673
680
  t,
674
- default8 as theme,
681
+ default7 as theme,
675
682
  timeEvent,
676
683
  track,
677
684
  transactionTypeDisplayNames,
@@ -1,10 +1,8 @@
1
1
  import { createGlobalStyle } from "styled-components";
2
- import "react-tippy/dist/tippy.css";
3
2
  import "react-day-picker/style.css";
4
3
  import { colors } from "./colors.js";
5
4
  import fontFaces from "./fonts.js";
6
5
  import semanticUiStyle from "./semanticUi.js";
7
- import reactTippyStyle from "./reactTippy.js";
8
6
  import ioniconsCss from "../static/fonts/Ionicons/ionicons.min.css.js";
9
7
  const GlobalStyle = createGlobalStyle`
10
8
  ${fontFaces}
@@ -66,7 +64,6 @@ const GlobalStyle = createGlobalStyle`
66
64
  }
67
65
 
68
66
  ${semanticUiStyle}
69
- ${reactTippyStyle}
70
67
  `;
71
68
  export {
72
69
  GlobalStyle,
@@ -1,40 +1,5 @@
1
1
  import { css } from "styled-components";
2
- import { colors } from "./colors.js";
3
- const reactTippyStyle = css`
4
- .tippy-popper {
5
- .tippy-tooltip {
6
- border-radius: 10px;
7
- font-size: 11px;
8
- line-height: 14px;
9
- letter-spacing: 0.4px;
10
- padding: 12px;
11
- word-break: break-word;
12
- }
13
-
14
- .tippy-tooltip.light-theme {
15
- box-shadow:
16
- 0 0 12px 8px rgba(0, 0, 0, 0.03),
17
- 0 0 6px 3px rgba(0, 0, 0, 0.02);
18
- }
19
-
20
- &[x-placement^='top'] [x-arrow] {
21
- border-top-color: ${colors.blue}!important;
22
- }
23
-
24
- &[x-placement^='bottom'] [x-arrow] {
25
- border-bottom-color: ${colors.blue}!important;
26
- }
27
-
28
- &[x-placement^='left'] [x-arrow] {
29
- border-left-color: ${colors.blue}!important;
30
- }
31
-
32
- &[x-placement^='right'] [x-arrow] {
33
- border-right-color: ${colors.blue}!important;
34
- }
35
- }
36
- `;
2
+ const reactTippyStyle = css``;
37
3
  export {
38
- reactTippyStyle as default,
39
4
  reactTippyStyle
40
5
  };
@@ -0,0 +1,42 @@
1
+ const copyViaTextarea = (text) => {
2
+ const previouslyFocused = document.activeElement;
3
+ const textArea = document.createElement("textarea");
4
+ textArea.value = text;
5
+ textArea.setAttribute("readonly", "");
6
+ textArea.style.position = "fixed";
7
+ textArea.style.left = "-999999px";
8
+ textArea.style.top = "-999999px";
9
+ document.body.appendChild(textArea);
10
+ try {
11
+ textArea.focus();
12
+ textArea.select();
13
+ return document.execCommand("copy");
14
+ } finally {
15
+ textArea.remove();
16
+ previouslyFocused?.focus?.();
17
+ }
18
+ };
19
+ const copyTextToClipboard = async (text, onCopy, onError) => {
20
+ if (navigator.clipboard && window.isSecureContext) {
21
+ try {
22
+ await navigator.clipboard.writeText(text);
23
+ onCopy?.(text, true);
24
+ return true;
25
+ } catch {
26
+ }
27
+ }
28
+ try {
29
+ if (copyViaTextarea(text)) {
30
+ onCopy?.(text, true);
31
+ return true;
32
+ }
33
+ onError?.(new Error("Failed to copy text"));
34
+ return false;
35
+ } catch (error) {
36
+ onError?.(error);
37
+ return false;
38
+ }
39
+ };
40
+ export {
41
+ copyTextToClipboard
42
+ };
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "3.0.72",
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
  },