@tap-payments/os-micro-frontend-shared 0.1.382 → 0.1.383

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,23 +1,22 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo, useState } from 'react';
3
- import { CopyImage, Icon, Text, Tooltip } from '../../../index.js';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import toast from 'react-hot-toast';
4
+ import { Icon } from '../../../index.js';
4
5
  import { gadientLink } from '../../../../constants/index.js';
5
6
  import { copyText } from '../../../../utils/index.js';
6
- import { Chip, TooltipWrapper } from './style';
7
+ import { Chip } from './style';
7
8
  function LinkCell({ url }) {
8
- const [isCopyActive, setIsCopyActive] = useState(false);
9
9
  const onClick = () => {
10
- setIsCopyActive(true);
11
- copyText(url);
12
- const timer = setTimeout(() => {
13
- setIsCopyActive(false);
14
- }, 2000);
15
- return () => {
16
- clearTimeout(timer);
17
- };
10
+ try {
11
+ copyText(url);
12
+ toast.success('Copied!');
13
+ }
14
+ catch (_a) {
15
+ toast.error('Failed to copy');
16
+ }
18
17
  };
19
18
  if (!url)
20
19
  return null;
21
- return (_jsx(Tooltip, Object.assign({ title: _jsxs(TooltipWrapper, { children: [_jsx(Text, Object.assign({ noWrap: true, sx: { fontSize: 12 } }, { children: url })), _jsx(CopyImage, { isCopyActive: isCopyActive, onClick: onClick })] }) }, { children: _jsx(Chip, { children: _jsx(Icon, { src: gadientLink, alt: "link" }) }) })));
20
+ return (_jsx(Chip, Object.assign({ onClick: onClick }, { children: _jsx(Icon, { src: gadientLink, alt: "link" }) })));
22
21
  }
23
22
  export default memo(LinkCell);
@@ -2,6 +2,3 @@
2
2
  export declare const Chip: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
3
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
4
  }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
5
- export declare const TooltipWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -10,10 +10,3 @@ export const Chip = styled(Box)(({ theme }) => ({
10
10
  border: `1px solid ${theme.palette.divider}`,
11
11
  cursor: 'pointer',
12
12
  }));
13
- export const TooltipWrapper = styled(Box)(() => ({
14
- display: 'flex',
15
- alignItems: 'center',
16
- justifyContent: 'center',
17
- fontSize: '12px',
18
- gap: '4px',
19
- }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.382",
4
+ "version": "0.1.383",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",