@tap-payments/os-micro-frontend-shared 0.1.398-test.1 → 0.1.398-test.6
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.
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.d.ts +24 -2
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.js +48 -23
- package/build/components/TableCells/CustomCells/MarketPlaceCell/MarketPlaceCell.js +11 -12
- package/package.json +2 -2
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIconView.d.ts +0 -10
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIconView.js +0 -23
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusSheetView.d.ts +0 -9
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusSheetView.js +0 -9
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusTextView.d.ts +0 -10
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusTextView.js +0 -16
- package/build/components/StatusIcons/ChargeStatusIcon/type.d.ts +0 -24
- package/build/components/StatusIcons/ChargeStatusIcon/type.js +0 -1
|
@@ -1,2 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { SelectionProps } from '../../../types/index.js';
|
|
3
|
+
import { type ChargeStatus } from '../../TableCells';
|
|
4
|
+
export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge, isSheetViewShown, selectionProps, chipIndex, }: Readonly<{
|
|
5
|
+
chargeStatus?: ChargeStatus;
|
|
6
|
+
gatewayTooltip?: string;
|
|
7
|
+
showAuthorizedStatus?: boolean;
|
|
8
|
+
chargeTooltip?: string;
|
|
9
|
+
acquirerTooltip?: string;
|
|
10
|
+
errorCode?: string;
|
|
11
|
+
isTextShown?: boolean;
|
|
12
|
+
gatewayCode?: React.ReactNode;
|
|
13
|
+
acquirerCode?: React.ReactNode;
|
|
14
|
+
unCapturedStyles?: CSSProperties;
|
|
15
|
+
iconStyles?: CSSProperties;
|
|
16
|
+
iconWrapperStyles?: CSSProperties;
|
|
17
|
+
gatewayIconWrapperStyles?: CSSProperties;
|
|
18
|
+
gatewayContainerStyles?: CSSProperties;
|
|
19
|
+
gateWayIconStyles?: CSSProperties;
|
|
20
|
+
showBadge?: boolean;
|
|
21
|
+
isSheetViewShown?: boolean;
|
|
22
|
+
selectionProps?: SelectionProps;
|
|
23
|
+
chipIndex?: number;
|
|
24
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useTheme } from '@mui/material/styles';
|
|
3
|
+
import camelCase from 'lodash/camelCase';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import Tooltip from '../../Tooltip';
|
|
6
|
+
import { unCapturedStatuses } from '../../../constants/index.js';
|
|
7
|
+
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
4
8
|
import { capturedStatusesStyles, unCapturedStatusesStyles, statusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
5
|
-
import { StatusIcon } from '../../TableCells/CustomCells/style';
|
|
6
|
-
import {
|
|
7
|
-
import { ChargeStatusTextView } from './ChargeStatusTextView';
|
|
8
|
-
import { ChargeStatusIconView } from './ChargeStatusIconView';
|
|
9
|
+
import { StatusIcon, StatusIconWrapper, TextLabel } from '../../TableCells/CustomCells/style';
|
|
10
|
+
import { AcquirerContainerAnimationVariants, ErrorCodeLabel, ErrorCodeLabelAnimationVariants, ErrorCodeVariants, ErrorCodeWrapper, GateWayIcon, GatewayIconWrapper, GatewayIconWrapperAnimationTransition, GatewaysContainer, GatewaysContainerAnimationVariants, StatusTextLabel, UnCapturedBadge, UnCapturedContainer, errorCodeLabelAnimation, TextViewWrapper, } from './style';
|
|
9
11
|
export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge = true, isSheetViewShown = false, selectionProps = {}, chipIndex = 0, }) {
|
|
12
|
+
const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
|
|
13
|
+
const captureStatusStyle = chargeStatus ? capturedStatusesStyles[chargeStatus] : null;
|
|
14
|
+
const theme = useTheme();
|
|
10
15
|
const { t } = useTranslation();
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
unCapturedStatusStyle: unCapturedStyle,
|
|
17
|
-
captureStatusStyle: captureStyle,
|
|
18
|
-
chargeIcon: icon
|
|
19
|
-
};
|
|
20
|
-
}, [chargeStatus, iconWrapperStyles, iconStyles]);
|
|
21
|
-
const { chargeTooltipTitle, acquirerTooltipTitle, gatewayTooltipTitle } = useMemo(() => ({
|
|
22
|
-
chargeTooltipTitle: chargeTooltip && (_jsx(_Fragment, { children: _jsx("div", { children: chargeTooltip }) })),
|
|
23
|
-
acquirerTooltipTitle: acquirerTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Acquirer" }), _jsx("div", { children: acquirerTooltip })] })),
|
|
24
|
-
gatewayTooltipTitle: gatewayTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Gateway" }), _jsx("div", { children: gatewayTooltip })] }))
|
|
25
|
-
}), [chargeTooltip, acquirerTooltip, gatewayTooltip]);
|
|
16
|
+
const chargeTooltipTitle = chargeTooltip && (_jsx(_Fragment, { children: _jsx("div", { children: chargeTooltip }) }));
|
|
17
|
+
const acquirerTooltipTitle = acquirerTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Acquirer" }), _jsx("div", { children: acquirerTooltip })] }));
|
|
18
|
+
const gatewayTooltipTitle = gatewayTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Gateway" }), _jsx("div", { children: gatewayTooltip })] }));
|
|
19
|
+
const chargeIcon = chargeStatus && statusIcons[chargeStatus] && (_jsx("div", Object.assign({ "data-testid": "ChargeStatusIcon_ChargeIcon", style: Object.assign({ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '16px', height: '16px', borderRadius: unCapturedStatusStyle ? '50%' : '' }, iconWrapperStyles) }, { children: _jsx(StatusIcon, { src: statusIcons[chargeStatus], alt: "charge-icon", "data-testid": "ChargeStatusIcon_StatusIcon", style: Object.assign({ borderRadius: unCapturedStatusStyle ? '50%' : '', width: '16px', height: '16px' }, iconStyles) }) })));
|
|
26
20
|
if (isSheetViewShown) {
|
|
27
|
-
return (
|
|
21
|
+
return (_jsxs(TextViewWrapper, { children: [_jsxs(StatusChipWithCopy, Object.assign({ copyText: t(camelCase(chargeStatus)), chipIndex: chipIndex, selectionProps: selectionProps }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Gateway", chipIndex: 1, selectionProps: selectionProps }, { children: ["Gateway ", gatewayCode] }))), acquirerCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Acquirer", chipIndex: 2, selectionProps: selectionProps }, { children: ["Acquirer ", acquirerCode] })))] }))] }));
|
|
28
22
|
}
|
|
29
23
|
if (isTextShown) {
|
|
30
|
-
return (
|
|
24
|
+
return (_jsxs(TextViewWrapper, { children: [_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle }, { children: _jsxs(StatusTextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
|
|
25
|
+
background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
|
|
26
|
+
color: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark,
|
|
27
|
+
borderColor: `${(unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark}1A`,
|
|
28
|
+
} }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })) })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsx(Tooltip, Object.assign({ title: gatewayTooltipTitle }, { children: _jsxs(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
|
|
29
|
+
background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
|
|
30
|
+
color: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark,
|
|
31
|
+
} }, { children: ["Gateway ", gatewayCode] })) }))), acquirerCode && (_jsx(Tooltip, Object.assign({ title: acquirerTooltipTitle }, { children: _jsxs(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
|
|
32
|
+
background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
|
|
33
|
+
color: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark,
|
|
34
|
+
} }, { children: ["Acquirer ", acquirerCode] })) })))] }))] }));
|
|
31
35
|
}
|
|
32
|
-
return (_jsx(
|
|
36
|
+
return (_jsx(StatusIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_StatusIconWrapper", style: Object.assign({}, iconWrapperStyles) }, { children: (unCapturedStatuses === null || unCapturedStatuses === void 0 ? void 0 : unCapturedStatuses.includes(chargeStatus || '')) && (chargeTooltipTitle || acquirerTooltipTitle || gatewayTooltipTitle) ? (_jsxs(UnCapturedContainer, Object.assign({ "data-testid": "ChargeStatusIcon_UnCapturedContainer", whileHover: ['animate', 'fadeIn'], style: Object.assign(Object.assign({ left: '0' }, (showBadge && {
|
|
37
|
+
paddingInline: '12px',
|
|
38
|
+
border: '1px solid #F2F2F2',
|
|
39
|
+
borderRadius: '12px',
|
|
40
|
+
backgroundColor: '#fff',
|
|
41
|
+
})), unCapturedStyles) }, { children: [_jsx(UnCapturedBadge, Object.assign({ "data-testid": "ChargeStatusIcon_UnCapturedBadge", sx: {
|
|
42
|
+
borderRadius: '56px',
|
|
43
|
+
}, initial: {
|
|
44
|
+
background: 'transparent',
|
|
45
|
+
}, variants: {
|
|
46
|
+
animate: {
|
|
47
|
+
background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background,
|
|
48
|
+
},
|
|
49
|
+
} }, { children: _jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsxs(_Fragment, { children: [chargeIcon, _jsx(ErrorCodeWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_ErrorCodeWrapper", transition: {
|
|
50
|
+
animate: {
|
|
51
|
+
duration: 0.05,
|
|
52
|
+
},
|
|
53
|
+
}, variants: ErrorCodeLabelAnimationVariants, style: Object.assign({}, (errorCode && {
|
|
54
|
+
padding: '0 !important',
|
|
55
|
+
})) }, { children: _jsx(ErrorCodeLabel, Object.assign({ "data-testid": "ChargeStatusIcon_ErrorCodeLabel", sx: {
|
|
56
|
+
background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color,
|
|
57
|
+
}, transition: errorCodeLabelAnimation, variants: ErrorCodeVariants, initial: { opacity: 0 } }, { children: errorCode })) }))] }) })) })), _jsx(GatewaysContainer, Object.assign({ "data-testid": "ChargeStatusIcon_GatewaysContainer", transition: GatewayIconWrapperAnimationTransition, variants: GatewaysContainerAnimationVariants, style: gatewayContainerStyles, isVisible: !!gatewayTooltipTitle }, { children: gatewayTooltipTitle && (_jsx(Tooltip, Object.assign({ title: gatewayTooltipTitle }, { children: _jsx(GatewayIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_GatewayIconWrapper", style: Object.assign({ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background }, gatewayIconWrapperStyles) }, { children: _jsx(GateWayIcon, { src: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.gatewayIcon, alt: "gateway-icon", "data-testid": "ChargeStatusIcon_GatewayIcon", style: gateWayIconStyles }) })) }))) })), _jsx(GatewaysContainer, Object.assign({ "data-testid": "ChargeStatusIcon_GatewaysContainer", transition: GatewayIconWrapperAnimationTransition, variants: AcquirerContainerAnimationVariants, style: gatewayContainerStyles, isVisible: !!acquirerTooltipTitle }, { children: acquirerTooltipTitle && (_jsx(Tooltip, Object.assign({ title: acquirerTooltipTitle }, { children: _jsx(GatewayIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_AcquirerIconWrapper", style: Object.assign({ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background }, gatewayIconWrapperStyles) }, { children: _jsx(GateWayIcon, { src: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.acquirerIcon, alt: "acquirer-icon", "data-testid": "ChargeStatusIcon_AcquirerIcon", style: gateWayIconStyles }) })) }))) }))] }))) : (_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsx(StatusIconWrapper, { children: chargeIcon }) }))) })));
|
|
33
58
|
}
|
|
@@ -9,21 +9,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import Tooltip from '../../../Tooltip';
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
13
|
import TableCell from '../../TableCell';
|
|
15
|
-
import { Box } from '@mui/material';
|
|
14
|
+
import { Box, Typography } from '@mui/material';
|
|
16
15
|
import { marketPlaceBlueIcon } from '../../../../constants/index.js';
|
|
17
16
|
export default function MarketPlaceCell(_a) {
|
|
18
17
|
var { marketPlaceIcon, marketPlaceName } = _a, props = __rest(_a, ["marketPlaceIcon", "marketPlaceName"]);
|
|
19
18
|
const logo = marketPlaceIcon !== null && marketPlaceIcon !== void 0 ? marketPlaceIcon : (_jsx("img", { src: marketPlaceBlueIcon, alt: "marketplace", style: { maxWidth: '18px', maxHeight: '18px', objectFit: 'cover' } }));
|
|
20
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', gap: 1 } }, { children: marketPlaceName && (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', gap: 1 } }, { children: marketPlaceName && (_jsxs(_Fragment, { children: [_jsx(Box, Object.assign({ sx: {
|
|
20
|
+
width: '24px',
|
|
21
|
+
height: '24px',
|
|
22
|
+
border: '1px solid #F2F2F2',
|
|
23
|
+
borderRadius: '50%',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
} }, { children: logo })), _jsx(Typography, Object.assign({ sx: { fontSize: '14px', fontWeight: 400 } }, { children: marketPlaceName }))] })) })) })));
|
|
29
28
|
}
|
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.398-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.398-test.6",
|
|
5
|
+
"testVersion": 6,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ChargeStatusIconProps } from './type';
|
|
3
|
-
export interface ChargeStatusIconViewProps extends Pick<ChargeStatusIconProps, 'chargeStatus' | 'errorCode' | 'showBadge' | 'unCapturedStyles' | 'gatewayContainerStyles' | 'gatewayIconWrapperStyles' | 'gateWayIconStyles' | 'iconWrapperStyles' | 'gatewayCode' | 'acquirerCode' | 'gateWayIconStyles' | 'iconWrapperStyles' | 'unCapturedStyles'> {
|
|
4
|
-
chargeIcon: React.ReactNode;
|
|
5
|
-
chargeTooltipTitle?: React.ReactNode;
|
|
6
|
-
acquirerTooltipTitle?: React.ReactNode;
|
|
7
|
-
unCapturedStatusStyle?: any;
|
|
8
|
-
gatewayTooltipTitle?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare const ChargeStatusIconView: React.FC<ChargeStatusIconViewProps>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import camelCase from 'lodash/camelCase';
|
|
4
|
-
import Tooltip from '../../Tooltip';
|
|
5
|
-
import { unCapturedStatuses } from '../../../constants/index.js';
|
|
6
|
-
import { StatusIconWrapper } from '../../TableCells/CustomCells/style';
|
|
7
|
-
import { AcquirerContainerAnimationVariants, ErrorCodeLabel, ErrorCodeLabelAnimationVariants, ErrorCodeVariants, ErrorCodeWrapper, GateWayIcon, GatewayIconWrapper, GatewayIconWrapperAnimationTransition, GatewaysContainer, GatewaysContainerAnimationVariants, UnCapturedBadge, UnCapturedContainer, errorCodeLabelAnimation, } from './style';
|
|
8
|
-
export const ChargeStatusIconView = ({ chargeStatus, chargeIcon, chargeTooltipTitle, acquirerTooltipTitle, gatewayTooltipTitle, errorCode, showBadge = true, unCapturedStyles, unCapturedStatusStyle, gatewayContainerStyles, gatewayIconWrapperStyles, gateWayIconStyles, iconWrapperStyles, }) => {
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
const isUnCaptured = (unCapturedStatuses === null || unCapturedStatuses === void 0 ? void 0 : unCapturedStatuses.includes(chargeStatus || '')) &&
|
|
11
|
-
(chargeTooltipTitle || acquirerTooltipTitle || gatewayTooltipTitle);
|
|
12
|
-
if (isUnCaptured) {
|
|
13
|
-
return (_jsx(StatusIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_StatusIconWrapper", style: iconWrapperStyles }, { children: _jsxs(UnCapturedContainer, Object.assign({ "data-testid": "ChargeStatusIcon_UnCapturedContainer", whileHover: ['animate', 'fadeIn'], style: Object.assign(Object.assign({ left: '0' }, (showBadge && {
|
|
14
|
-
paddingInline: '12px',
|
|
15
|
-
border: '1px solid #F2F2F2',
|
|
16
|
-
borderRadius: '12px',
|
|
17
|
-
backgroundColor: '#fff',
|
|
18
|
-
})), unCapturedStyles) }, { children: [_jsx(UnCapturedBadge, Object.assign({ "data-testid": "ChargeStatusIcon_UnCapturedBadge", sx: { borderRadius: '56px' }, initial: { background: 'transparent' }, variants: {
|
|
19
|
-
animate: { background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background },
|
|
20
|
-
} }, { children: _jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsxs(_Fragment, { children: [chargeIcon, _jsx(ErrorCodeWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_ErrorCodeWrapper", transition: { animate: { duration: 0.05 } }, variants: ErrorCodeLabelAnimationVariants, style: Object.assign({}, (errorCode && { padding: '0 !important' })) }, { children: _jsx(ErrorCodeLabel, Object.assign({ "data-testid": "ChargeStatusIcon_ErrorCodeLabel", sx: { background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color }, transition: errorCodeLabelAnimation, variants: ErrorCodeVariants, initial: { opacity: 0 } }, { children: errorCode })) }))] }) })) })), _jsx(GatewaysContainer, Object.assign({ "data-testid": "ChargeStatusIcon_GatewaysContainer", transition: GatewayIconWrapperAnimationTransition, variants: GatewaysContainerAnimationVariants, style: gatewayContainerStyles, isVisible: !!gatewayTooltipTitle }, { children: gatewayTooltipTitle && (_jsx(Tooltip, Object.assign({ title: gatewayTooltipTitle }, { children: _jsx(GatewayIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_GatewayIconWrapper", style: Object.assign({ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background }, gatewayIconWrapperStyles) }, { children: _jsx(GateWayIcon, { src: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.gatewayIcon, alt: "gateway-icon", "data-testid": "ChargeStatusIcon_GatewayIcon", style: gateWayIconStyles }) })) }))) })), _jsx(GatewaysContainer, Object.assign({ "data-testid": "ChargeStatusIcon_GatewaysContainer", transition: GatewayIconWrapperAnimationTransition, variants: AcquirerContainerAnimationVariants, style: gatewayContainerStyles, isVisible: !!acquirerTooltipTitle }, { children: acquirerTooltipTitle && (_jsx(Tooltip, Object.assign({ title: acquirerTooltipTitle }, { children: _jsx(GatewayIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_AcquirerIconWrapper", style: Object.assign({ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background }, gatewayIconWrapperStyles) }, { children: _jsx(GateWayIcon, { src: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.acquirerIcon, alt: "acquirer-icon", "data-testid": "ChargeStatusIcon_AcquirerIcon", style: gateWayIconStyles }) })) }))) }))] })) })));
|
|
21
|
-
}
|
|
22
|
-
return (_jsx(StatusIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_StatusIconWrapper", style: iconWrapperStyles }, { children: _jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsx(StatusIconWrapper, { children: chargeIcon }) })) })));
|
|
23
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectionProps } from '../../../types/index.js';
|
|
3
|
-
import { ChargeStatusIconProps } from './type';
|
|
4
|
-
export interface ChargeStatusSheetViewProps extends Pick<ChargeStatusIconProps, 'chargeStatus' | 'errorCode' | 'gatewayCode' | 'acquirerCode'> {
|
|
5
|
-
chipIndex?: number;
|
|
6
|
-
selectionProps?: SelectionProps;
|
|
7
|
-
unCapturedStatusStyle?: any;
|
|
8
|
-
}
|
|
9
|
-
export declare const ChargeStatusSheetView: React.FC<ChargeStatusSheetViewProps>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import camelCase from 'lodash/camelCase';
|
|
4
|
-
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
5
|
-
import { TextViewWrapper } from './style';
|
|
6
|
-
export const ChargeStatusSheetView = ({ chargeStatus, errorCode, chipIndex = 0, selectionProps = {}, gatewayCode, acquirerCode, unCapturedStatusStyle, }) => {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
return (_jsxs(TextViewWrapper, { children: [_jsxs(StatusChipWithCopy, Object.assign({ copyText: t(camelCase(chargeStatus)), chipIndex: chipIndex, selectionProps: selectionProps }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Gateway", chipIndex: 1, selectionProps: selectionProps }, { children: ["Gateway ", gatewayCode] }))), acquirerCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Acquirer", chipIndex: 2, selectionProps: selectionProps }, { children: ["Acquirer ", acquirerCode] })))] }))] }));
|
|
9
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ChargeStatusIconProps } from './type';
|
|
3
|
-
export interface ChargeStatusTextViewProps extends Pick<ChargeStatusIconProps, 'chargeStatus' | 'errorCode' | 'gatewayCode' | 'acquirerCode'> {
|
|
4
|
-
gatewayTooltipTitle?: React.ReactNode;
|
|
5
|
-
acquirerTooltipTitle?: React.ReactNode;
|
|
6
|
-
chargeTooltipTitle?: React.ReactNode;
|
|
7
|
-
unCapturedStatusStyle: React.CSSProperties | null;
|
|
8
|
-
captureStatusStyle: React.CSSProperties | null;
|
|
9
|
-
}
|
|
10
|
-
export declare const ChargeStatusTextView: React.FC<ChargeStatusTextViewProps>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from '@mui/material/styles';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import camelCase from 'lodash/camelCase';
|
|
5
|
-
import Tooltip from '../../Tooltip';
|
|
6
|
-
import { TextLabel } from '../../TableCells/CustomCells/style';
|
|
7
|
-
import { TextViewWrapper, StatusTextLabel } from './style';
|
|
8
|
-
export const ChargeStatusTextView = ({ chargeStatus, chargeTooltipTitle, unCapturedStatusStyle, captureStatusStyle, errorCode, gatewayCode, gatewayTooltipTitle, acquirerCode, acquirerTooltipTitle, }) => {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
const { t } = useTranslation();
|
|
11
|
-
const commonStyles = {
|
|
12
|
-
background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
|
|
13
|
-
color: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark,
|
|
14
|
-
};
|
|
15
|
-
return (_jsxs(TextViewWrapper, { children: [_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle }, { children: _jsxs(StatusTextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: Object.assign(Object.assign({}, commonStyles), { borderColor: `${commonStyles.color}1A` }) }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })) })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsx(Tooltip, Object.assign({ title: gatewayTooltipTitle }, { children: _jsxs(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: commonStyles }, { children: ["Gateway ", gatewayCode] })) }))), acquirerCode && (_jsx(Tooltip, Object.assign({ title: acquirerTooltipTitle }, { children: _jsxs(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: commonStyles }, { children: ["Acquirer ", acquirerCode] })) })))] }))] }));
|
|
16
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
-
import { type ChargeStatus } from '../../TableCells';
|
|
3
|
-
import { SelectionProps } from '../../../types/index.js';
|
|
4
|
-
export interface ChargeStatusIconProps {
|
|
5
|
-
chargeStatus?: ChargeStatus;
|
|
6
|
-
gatewayTooltip?: string;
|
|
7
|
-
showAuthorizedStatus?: boolean;
|
|
8
|
-
chargeTooltip?: string;
|
|
9
|
-
acquirerTooltip?: string;
|
|
10
|
-
errorCode?: string;
|
|
11
|
-
isTextShown?: boolean;
|
|
12
|
-
gatewayCode?: ReactNode;
|
|
13
|
-
acquirerCode?: React.ReactNode;
|
|
14
|
-
unCapturedStyles?: CSSProperties;
|
|
15
|
-
iconStyles?: CSSProperties;
|
|
16
|
-
iconWrapperStyles?: CSSProperties;
|
|
17
|
-
gatewayIconWrapperStyles?: CSSProperties;
|
|
18
|
-
gatewayContainerStyles?: CSSProperties;
|
|
19
|
-
gateWayIconStyles?: CSSProperties;
|
|
20
|
-
showBadge?: boolean;
|
|
21
|
-
isSheetViewShown?: boolean;
|
|
22
|
-
selectionProps?: SelectionProps;
|
|
23
|
-
chipIndex?: number;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|