@tap-payments/os-micro-frontend-shared 0.1.31-test.22 → 0.1.31-test.23
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.
|
@@ -16,7 +16,7 @@ import { AnimatePresence, motion } from 'framer-motion';
|
|
|
16
16
|
import { copyText as copyTextHandler } from '../../utils/index.js';
|
|
17
17
|
import { blueCopyIcon, greenCheckIcon } from '../../constants/index.js';
|
|
18
18
|
import { unknownGeographyColors } from './constants';
|
|
19
|
-
import { ChipStyled, Wrapper } from './style';
|
|
19
|
+
import { ChipStyled, Wrapper, CopyWrapper } from './style';
|
|
20
20
|
const StatusChip = (_a) => {
|
|
21
21
|
var { children, unknownText, copyText } = _a, props = __rest(_a, ["children", "unknownText", "copyText"]);
|
|
22
22
|
const [showCopy, setShowCopy] = useState(false);
|
|
@@ -40,13 +40,10 @@ const StatusChip = (_a) => {
|
|
|
40
40
|
};
|
|
41
41
|
return (_jsxs(motion.div, Object.assign({ style: { position: 'relative' }, animate: { zIndex: isSelected ? 3 : 0 } }, { children: [_jsx(ChipStyled, Object.assign({}, props, { sx: { visibility: 'hidden', pointerEvents: 'none' } }, { children: _jsx(Wrapper, { children: children }) })), _jsx(ChipStyled, Object.assign({}, props, { isSelected: isSelected, style: { position: 'absolute', top: 0, left: 0, zIndex: isSelected ? 3 : 0 } }, { children: _jsxs(motion.div, Object.assign({ layout: "size", style: { display: 'flex', gap: '4px' }, animate: {
|
|
42
42
|
paddingRight: isSelected ? 12 : 0,
|
|
43
|
-
}, transition: { delay: !isSelected ? 0.2 : 0 } }, { children: [_jsx(Wrapper, { children: children }), _jsx(AnimatePresence, { children: isSelected && copyText && (_jsx(motion.img, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: handleCopy, src: showCopy ? greenCheckIcon : blueCopyIcon, style: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
right: 8,
|
|
49
|
-
top: 3.5,
|
|
50
|
-
} })) })] })) }))] })));
|
|
43
|
+
}, transition: { delay: !isSelected ? 0.2 : 0 } }, { children: [_jsx(Wrapper, { children: children }), _jsx(AnimatePresence, { children: isSelected && copyText && (_jsx(CopyWrapper, { children: _jsx(motion.img, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: handleCopy, src: showCopy ? greenCheckIcon : blueCopyIcon, style: {
|
|
44
|
+
height: 12,
|
|
45
|
+
width: 12,
|
|
46
|
+
objectFit: 'contain',
|
|
47
|
+
} }) })) })] })) }))] })));
|
|
51
48
|
};
|
|
52
49
|
export default StatusChip;
|
|
@@ -21,3 +21,6 @@ export declare const ChipStyled: import("@emotion/styled").StyledComponent<impor
|
|
|
21
21
|
export declare const Wrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
22
22
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
23
23
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
24
|
+
export declare const CopyWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
25
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
26
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -20,3 +20,14 @@ export const Wrapper = styled(Box)(() => ({
|
|
|
20
20
|
minWidth: 46,
|
|
21
21
|
textAlign: 'center',
|
|
22
22
|
}));
|
|
23
|
+
export const CopyWrapper = styled(Box)(() => ({
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
right: '8px',
|
|
26
|
+
top: 0,
|
|
27
|
+
height: '100%',
|
|
28
|
+
width: '12px',
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
}));
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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.31-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.31-test.23",
|
|
5
|
+
"testVersion": 23,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|