@tap-payments/os-micro-frontend-shared 0.1.381-test.3 → 0.1.381-test.4
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.
|
@@ -17,7 +17,7 @@ import Dropdown from '../../../DropdownMenu';
|
|
|
17
17
|
import Tooltip from '../../../Tooltip';
|
|
18
18
|
import { TableCell } from '../../../TableCells';
|
|
19
19
|
import StyledBadge, { BadgeVariants } from '../../../CountBadge';
|
|
20
|
-
import { jsonBlackIcon } from '../../../../constants/index.js';
|
|
20
|
+
import { idIcon, jsonBlackIcon } from '../../../../constants/index.js';
|
|
21
21
|
import ActionIconsVariants from './components/ActionIconsVariants';
|
|
22
22
|
import { actionIcons, colorToVariant, flags } from './constant';
|
|
23
23
|
import { useActionCell } from './hooks/useActionCell';
|
|
@@ -71,7 +71,7 @@ export const ActionCell = memo((_a) => {
|
|
|
71
71
|
},
|
|
72
72
|
opacity: 1,
|
|
73
73
|
},
|
|
74
|
-
} }, { children: _jsxs(StyledBadge, Object.assign({ compact: true, variant: colorToVariant[(_c = flags[flag]) === null || _c === void 0 ? void 0 : _c.color] || BadgeVariants.ORANGE, "data-testid": "ActionCell_StyledBadge" }, { children: [flagsCount, "x"] })) })))] })) }))) })), showIdButton && _jsx(IDButton, {
|
|
74
|
+
} }, { children: _jsxs(StyledBadge, Object.assign({ compact: true, variant: colorToVariant[(_c = flags[flag]) === null || _c === void 0 ? void 0 : _c.color] || BadgeVariants.ORANGE, "data-testid": "ActionCell_StyledBadge" }, { children: [flagsCount, "x"] })) })))] })) }))) })), showIdButton && _jsx(IDButton, { id: rowId || row.id, icon: idIcon }), _jsxs("div", Object.assign({ "data-testid": "ActionCell_IconsContainer", style: {
|
|
75
75
|
display: 'flex',
|
|
76
76
|
alignItems: 'center',
|
|
77
77
|
justifyContent: 'center',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface IDButtonI {
|
|
3
|
-
|
|
3
|
+
icon: string;
|
|
4
|
+
id?: string;
|
|
4
5
|
}
|
|
5
|
-
declare function IDButton({
|
|
6
|
+
declare function IDButton({ icon, id }: IDButtonI): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
declare const _default: import("react").MemoExoticComponent<typeof IDButton>;
|
|
7
8
|
export default _default;
|
|
@@ -6,14 +6,14 @@ import Tooltip from '../../../Tooltip';
|
|
|
6
6
|
import { greenCheckIcon, idIcon } from '../../../../constants/index.js';
|
|
7
7
|
import { copyText } from '../../../../utils/index.js';
|
|
8
8
|
import { RowId, Button } from './style';
|
|
9
|
-
function IDButton({
|
|
9
|
+
function IDButton({ icon, id }) {
|
|
10
10
|
const [showCopy, setShowCopy] = useState(false);
|
|
11
11
|
const [isHover, setIsHover] = useState(false);
|
|
12
12
|
const { t } = useTranslation();
|
|
13
13
|
const handleCopyRowId = () => {
|
|
14
|
-
if (
|
|
14
|
+
if (id) {
|
|
15
15
|
setShowCopy(true);
|
|
16
|
-
copyText(
|
|
16
|
+
copyText(id);
|
|
17
17
|
const timer = setTimeout(() => {
|
|
18
18
|
setShowCopy(false);
|
|
19
19
|
}, 2000);
|
|
@@ -39,6 +39,6 @@ function IDButton({ rowId }) {
|
|
|
39
39
|
opacity: isHover ? 1 : 0,
|
|
40
40
|
}, exit: {
|
|
41
41
|
opacity: 0,
|
|
42
|
-
}, transition: { delay: isHover ? 0.3 : 0, duration: isHover ? 0.3 : 0.1 } }, { children:
|
|
42
|
+
}, transition: { delay: isHover ? 0.3 : 0, duration: isHover ? 0.3 : 0.1 } }, { children: id }))), _jsx(Box, { component: "img", src: showCopy ? greenCheckIcon : idIcon, alt: "id" })] })) })) })));
|
|
43
43
|
}
|
|
44
44
|
export default memo(IDButton);
|
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.381-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.381-test.4",
|
|
5
|
+
"testVersion": 4,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|