@tap-payments/os-micro-frontend-shared 0.0.260 → 0.0.261
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.js +2 -2
- package/build/components/StatusIcons/RefundIcon/RefundIcon.d.ts +3 -1
- package/build/components/StatusIcons/RefundIcon/RefundIcon.js +6 -1
- package/build/components/TableCells/CustomCells/StatusCell/constant.d.ts +1 -1
- package/build/components/TableCells/CustomCells/StatusCell/constant.js +1 -1
- package/package.json +2 -2
|
@@ -5,13 +5,13 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
import Tooltip from '../../Tooltip';
|
|
6
6
|
import { unCapturedStatuses } from '../../../constants/index.js';
|
|
7
7
|
import { AcquirerContainerAnimationVariants, ErrorCodeLabel, ErrorCodeLabelAnimationVariants, ErrorCodeVariants, ErrorCodeWrapper, GateWayIcon, GatewayIconWrapper, GatewayIconWrapperAnimationTransition, GatewaysContainer, GatewaysContainerAnimationVariants, StatusTextLabel, UnCapturedBadge, UnCapturedContainer, errorCodeLabelAnimation, TextViewWrapper, } from './style';
|
|
8
|
-
import { capturedStatusesStyles, unCapturedStatusesStyles, statusIcons,
|
|
8
|
+
import { capturedStatusesStyles, unCapturedStatusesStyles, statusIcons, chargeSheetViewChipStyles, } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
9
9
|
import { StatusIcon, StatusIconWrapper, TextLabel } from '../../TableCells/CustomCells/style';
|
|
10
10
|
import StatusChip from '../../StatusChip';
|
|
11
11
|
export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, tableMode, showBadge = true, }) {
|
|
12
12
|
const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
|
|
13
13
|
const captureStatusStyle = chargeStatus ? capturedStatusesStyles[chargeStatus] : null;
|
|
14
|
-
const sheetViewStatusStyle = chargeStatus ?
|
|
14
|
+
const sheetViewStatusStyle = chargeStatus ? chargeSheetViewChipStyles[chargeStatus] : null;
|
|
15
15
|
const theme = useTheme();
|
|
16
16
|
const { t } = useTranslation();
|
|
17
17
|
const chargeTooltipTitle = chargeTooltip && (_jsx(_Fragment, { children: _jsx("div", { children: chargeTooltip }) }));
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type RefundStatusType } from '../../TableCells';
|
|
3
|
+
import { TableMode } from '../../../types/index.js';
|
|
3
4
|
type RefundIconProps = {
|
|
4
5
|
iconStyles?: React.CSSProperties;
|
|
5
6
|
refundStatus?: RefundStatusType;
|
|
6
7
|
refundTooltip?: React.ReactNode;
|
|
7
8
|
refundCount?: number;
|
|
8
9
|
isTextShown?: boolean;
|
|
10
|
+
tableMode?: TableMode;
|
|
9
11
|
};
|
|
10
|
-
declare const RefundIcon: ({ isTextShown, refundStatus, refundTooltip, refundCount, iconStyles }: RefundIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const RefundIcon: ({ isTextShown, refundStatus, refundTooltip, refundCount, iconStyles, tableMode }: RefundIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export default RefundIcon;
|
|
@@ -8,7 +8,8 @@ import { MultiRefundContainer, MultiRefundIcon, RefundsCountBadge } from '../../
|
|
|
8
8
|
import { StatusIcon } from '../../TableCells/CustomCells/style';
|
|
9
9
|
import { StatusTextLabel } from '../../TableCells/CustomCells/InvoiceStatusCell/style';
|
|
10
10
|
import { refundStatusIcons, refundStyles } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
11
|
-
|
|
11
|
+
import StatusChip from '../../StatusChip';
|
|
12
|
+
const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '', refundCount, iconStyles, tableMode }) => {
|
|
12
13
|
const { t } = useTranslation();
|
|
13
14
|
const theme = useTheme();
|
|
14
15
|
const refundCountBadge = (_jsxs(RefundsCountBadge, Object.assign({ "data-testid": "StatusCell_RefundsCountBadge", initial: { width: 0, opacity: 0, padding: '0px' }, transition: {
|
|
@@ -32,6 +33,10 @@ const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '',
|
|
|
32
33
|
},
|
|
33
34
|
} }, { children: [refundCount, "x"] })));
|
|
34
35
|
const refundCountShown = (refundCount || 0) > 1;
|
|
36
|
+
if (tableMode === 'sheet') {
|
|
37
|
+
const { color, backgroundColor } = refundStyles[refundStatus];
|
|
38
|
+
return _jsx(StatusChip, { textColor: color, bgColor: backgroundColor });
|
|
39
|
+
}
|
|
35
40
|
return (_jsx(_Fragment, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: _jsx("div", { children: _jsx("div", { children: refundTooltip }) }) }, { children: _jsx(StatusTextLabel, Object.assign({ "data-testid": "StatusCell_RefundStatusLabel", sx: {
|
|
36
41
|
color: refundStyles[refundStatus].color,
|
|
37
42
|
backgroundColor: refundStyles[refundStatus].backgroundColor,
|
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.0.
|
|
4
|
+
"version": "0.0.261",
|
|
5
5
|
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
],
|
|
61
61
|
"scripts": {
|
|
62
62
|
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
63
|
-
"push": "npm
|
|
63
|
+
"push": "npm run ts:build && npm publish --access public",
|
|
64
64
|
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
65
65
|
"dev": "vite",
|
|
66
66
|
"build": "tsc -b && vite build ",
|