@tap-payments/os-micro-frontend-shared 0.1.90-test.20 → 0.1.90-test.21
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/AuthorizedIcon/AuthorizedIcon.d.ts +4 -2
- package/build/components/StatusIcons/AuthorizedIcon/AuthorizedIcon.js +9 -4
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.d.ts +2 -1
- package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.js +2 -2
- package/package.json +2 -2
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type AuthorizedStatusType } from '../../TableCells';
|
|
3
|
-
import { TableMode } from '../../../types/index.js';
|
|
3
|
+
import { SelectionProps, TableMode } from '../../../types/index.js';
|
|
4
4
|
type AuthorizedIconProps = {
|
|
5
5
|
iconStyles?: React.CSSProperties;
|
|
6
6
|
authorizedStatus?: AuthorizedStatusType;
|
|
7
7
|
isTextShown?: boolean;
|
|
8
8
|
tableMode?: TableMode;
|
|
9
|
+
chipIndex?: number;
|
|
10
|
+
selectionProps?: SelectionProps;
|
|
9
11
|
};
|
|
10
|
-
export declare const AuthorizedIcon: ({ authorizedStatus, isTextShown, iconStyles, tableMode }: AuthorizedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const AuthorizedIcon: ({ authorizedStatus, isTextShown, iconStyles, tableMode, chipIndex, selectionProps }: AuthorizedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -6,10 +6,15 @@ import Tooltip from '../../Tooltip';
|
|
|
6
6
|
import { authorizedStatusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
7
7
|
import Icon from '../../Icon';
|
|
8
8
|
import { TextLabel } from '../../TableCells/CustomCells/style';
|
|
9
|
-
|
|
9
|
+
import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
10
|
+
export const AuthorizedIcon = ({ authorizedStatus, isTextShown, iconStyles, tableMode, chipIndex = 0, selectionProps = {} }) => {
|
|
10
11
|
const { t } = useTranslation();
|
|
11
12
|
const theme = useTheme();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const status = t(camelCase(authorizedStatus));
|
|
14
|
+
if (tableMode === 'sheet') {
|
|
15
|
+
return (_jsx(StatusChipWithCopy, Object.assign({ copyText: status, chipIndex: chipIndex, selectionProps: selectionProps }, { children: status })));
|
|
16
|
+
}
|
|
17
|
+
return (_jsx(Tooltip, Object.assign({ title: status }, { children: isTextShown ? (_jsx(TextLabel, Object.assign({ "data-testid": "StatusCell_AuthorizedStatusLabel", sx: {
|
|
18
|
+
color: theme.palette.info.dark,
|
|
19
|
+
} }, { children: status }))) : (_jsx(Icon, { src: authorizedStatusIcons[authorizedStatus], alt: "authorized-icon", "data-testid": "StatusCell_AuthorizedStatusIcon", sx: iconStyles })) })));
|
|
15
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { SelectionProps } from '../../../types/index.js';
|
|
3
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, }: Readonly<{
|
|
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
5
|
chargeStatus?: ChargeStatus;
|
|
6
6
|
gatewayTooltip?: string;
|
|
7
7
|
showAuthorizedStatus?: boolean;
|
|
@@ -20,4 +20,5 @@ export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquire
|
|
|
20
20
|
showBadge?: boolean;
|
|
21
21
|
isSheetViewShown?: boolean;
|
|
22
22
|
selectionProps?: SelectionProps;
|
|
23
|
+
chipIndex?: number;
|
|
23
24
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,7 @@ import StatusChipWithCopy from '../../StatusChipWithCopy';
|
|
|
8
8
|
import { capturedStatusesStyles, unCapturedStatusesStyles, statusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
9
9
|
import { StatusIcon, StatusIconWrapper, TextLabel } from '../../TableCells/CustomCells/style';
|
|
10
10
|
import { AcquirerContainerAnimationVariants, ErrorCodeLabel, ErrorCodeLabelAnimationVariants, ErrorCodeVariants, ErrorCodeWrapper, GateWayIcon, GatewayIconWrapper, GatewayIconWrapperAnimationTransition, GatewaysContainer, GatewaysContainerAnimationVariants, StatusTextLabel, UnCapturedBadge, UnCapturedContainer, errorCodeLabelAnimation, TextViewWrapper, } from './style';
|
|
11
|
-
export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge = true, isSheetViewShown = false, selectionProps = {}, }) {
|
|
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
12
|
const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
|
|
13
13
|
const captureStatusStyle = chargeStatus ? capturedStatusesStyles[chargeStatus] : null;
|
|
14
14
|
const theme = useTheme();
|
|
@@ -18,7 +18,7 @@ export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip
|
|
|
18
18
|
const gatewayTooltipTitle = gatewayTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Gateway" }), _jsx("div", { children: gatewayTooltip })] }));
|
|
19
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) }) })));
|
|
20
20
|
if (isSheetViewShown) {
|
|
21
|
-
return (_jsxs(TextViewWrapper, { children: [_jsxs(StatusChipWithCopy, Object.assign({ copyText: t(camelCase(chargeStatus)), chipIndex:
|
|
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] })))] }))] }));
|
|
22
22
|
}
|
|
23
23
|
if (isTextShown) {
|
|
24
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: {
|
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.90-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.90-test.21",
|
|
5
|
+
"testVersion": 21,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|