@tap-payments/os-micro-frontend-shared 0.1.363 → 0.1.364

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.
@@ -1,3 +1,3 @@
1
1
  import { BalanceCellProps } from './type';
2
- declare function RefundStatusCell({ status, date, refundTooltip, isTextShown, gatewayTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, unCapturedTooltip, timezone, refundTooltipLabel, ...props }: BalanceCellProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function RefundStatusCell({ status, date, refundTooltip, isTextShown, gatewayTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, unCapturedTooltip, timezone, refundTooltipLabel, refundIcon, ...props }: BalanceCellProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default RefundStatusCell;
@@ -22,7 +22,7 @@ import { TextLabel, StatusCellContainer } from '../style';
22
22
  import { IconWrapper } from './style';
23
23
  import { unCapturedStatuses } from '../../../../constants/index.js';
24
24
  function RefundStatusCell(_a) {
25
- var { status, date, refundTooltip, isTextShown, gatewayTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, unCapturedTooltip, timezone, refundTooltipLabel } = _a, props = __rest(_a, ["status", "date", "refundTooltip", "isTextShown", "gatewayTooltip", "acquirerTooltip", "errorCode", "acquirerCode", "gatewayCode", "unCapturedTooltip", "timezone", "refundTooltipLabel"]);
25
+ var { status, date, refundTooltip, isTextShown, gatewayTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, unCapturedTooltip, timezone, refundTooltipLabel, refundIcon } = _a, props = __rest(_a, ["status", "date", "refundTooltip", "isTextShown", "gatewayTooltip", "acquirerTooltip", "errorCode", "acquirerCode", "gatewayCode", "unCapturedTooltip", "timezone", "refundTooltipLabel", "refundIcon"]);
26
26
  const { t } = useTranslation();
27
27
  const refundStyles = useRefundStyles();
28
28
  const formatDate = useCallback((dateMs) => dayjs(dateMs).format('MMM D, YYYY'), []);
@@ -31,6 +31,6 @@ function RefundStatusCell(_a) {
31
31
  overflow: 'visible',
32
32
  } }, { children: _jsx(StatusCellContainer, { children: _jsx(IconWrapper, Object.assign({ width: isTextShown ? 'auto' : '36px', sx: Object.assign({}, (isUncaptured && {
33
33
  border: 'none',
34
- })) }, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: date ? formatDate(date) : t(camelCase(status)) }, { children: _jsx(TextLabel, Object.assign({ sx: Object.assign({}, (refundStyles[status] ? refundStyles[status] : refundStyles.PENDING)) }, { children: t(camelCase(status)) })) }))) : (_jsx(RefundStatus, { status: status, refundTooltip: refundTooltip, date: date, gatewayTooltip: gatewayTooltip, unCapturedTooltip: unCapturedTooltip, acquirerTooltip: acquirerTooltip, errorCode: errorCode, acquirerCode: acquirerCode, gatewayCode: gatewayCode, timezone: timezone, refundTooltipLabel: refundTooltipLabel })) })) }) })));
34
+ })) }, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: date ? formatDate(date) : t(camelCase(status)) }, { children: _jsx(TextLabel, Object.assign({ sx: Object.assign({}, (refundStyles[status] ? refundStyles[status] : refundStyles.PENDING)) }, { children: t(camelCase(status)) })) }))) : (_jsx(RefundStatus, { status: status, refundTooltip: refundTooltip, date: date, gatewayTooltip: gatewayTooltip, unCapturedTooltip: unCapturedTooltip, acquirerTooltip: acquirerTooltip, errorCode: errorCode, acquirerCode: acquirerCode, gatewayCode: gatewayCode, timezone: timezone, refundTooltipLabel: refundTooltipLabel, refundIcon: refundIcon })) })) }) })));
35
35
  }
36
36
  export default RefundStatusCell;
@@ -1,2 +1,2 @@
1
1
  import { BalanceCellProps } from '../type';
2
- export default function RefundStatus({ status, refundTooltip, refundTooltipLabel, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }: Partial<BalanceCellProps>): import("react/jsx-runtime").JSX.Element;
2
+ export default function RefundStatus({ status, refundIcon, refundTooltip, refundTooltipLabel, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }: Partial<BalanceCellProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
2
3
  import { useTheme } from '@mui/material/styles';
3
4
  import { motion } from 'framer-motion';
4
5
  import { useTranslation } from 'react-i18next';
@@ -8,13 +9,18 @@ import { changeDateTimezone } from '../../../../../utils/index.js';
8
9
  import { RefundStateIcon } from './RefundStateIcon';
9
10
  import { refundStatusLabels } from '../constant';
10
11
  import { RefundCellContainer, PartialIcon, PercentageContainer, DateContainer } from '../style';
11
- export default function RefundStatus({ status, refundTooltip, refundTooltipLabel, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }) {
12
+ export default function RefundStatus({ status, refundIcon, refundTooltip, refundTooltipLabel, date, gatewayTooltip, unCapturedTooltip, acquirerTooltip, errorCode, acquirerCode, gatewayCode, timezone, }) {
12
13
  const theme = useTheme();
13
14
  const { t } = useTranslation();
14
15
  const formattedDate = changeDateTimezone(new Date(Number(date)), {
15
16
  currentTimezone: ACCEPTANCE_TIMEZONE,
16
17
  targetTimezone: timezone === null || timezone === void 0 ? void 0 : timezone.offset,
17
18
  });
19
+ const refundIconSrc = useMemo(() => {
20
+ if (refundIcon)
21
+ return refundIcon;
22
+ return status === 'REFUNDED' ? refundedIcon : refundSettledIcon;
23
+ }, [status, refundIcon]);
18
24
  if (!['REFUNDED', 'PAID_OUT'].includes(status !== null && status !== void 0 ? status : '')) {
19
25
  return (_jsx(RefundStateIcon, { status: status, refundTooltip: refundTooltip, gatewayTooltip: gatewayTooltip, unCapturedTooltip: unCapturedTooltip, acquirerTooltip: acquirerTooltip, errorCode: errorCode, acquirerCode: acquirerCode, gatewayCode: gatewayCode }));
20
26
  }
@@ -27,7 +33,7 @@ export default function RefundStatus({ status, refundTooltip, refundTooltipLabel
27
33
  })) }, { children: [_jsx(PartialIcon, { sx: Object.assign({}, (!date && {
28
34
  width: '16px',
29
35
  height: '16px',
30
- })), src: status === 'REFUNDED' ? refundedIcon : refundSettledIcon, alt: "refunded" }), _jsx(motion.div, Object.assign({ style: {
36
+ })), src: refundIconSrc, alt: "refunded" }), _jsx(motion.div, Object.assign({ style: {
31
37
  display: 'none',
32
38
  alignItems: 'center',
33
39
  justifyContent: 'center',
@@ -15,4 +15,5 @@ export interface BalanceCellProps extends TableCellProps {
15
15
  unCapturedTooltip?: string;
16
16
  timezone: Timezone | null;
17
17
  refundTooltipLabel?: string;
18
+ refundIcon?: string;
18
19
  }
@@ -558,6 +558,7 @@ export declare const blackMobileBatteryIcon: string;
558
558
  export declare const blackMobileSignalIcon: string;
559
559
  export declare const emptyMobileWifiIcon: string;
560
560
  export declare const deemaWithLabel: string;
561
+ export declare const chargeBackWhiteIcon: string;
561
562
  export declare const blackUnLinkIcon: string;
562
563
  export declare const sortDescArrowIcon: string;
563
564
  export declare const sortAscArrowIcon: string;
@@ -566,6 +566,7 @@ export const blackMobileBatteryIcon = `${lightUrl}/blackMobileBatteryIcon.svg`;
566
566
  export const blackMobileSignalIcon = `${lightUrl}/blackMobileSignalIcon.svg`;
567
567
  export const emptyMobileWifiIcon = `${lightUrl}/emptyMobileWifiIcon.svg`;
568
568
  export const deemaWithLabel = `${lightUrl}/deemaWithLabel.svg`;
569
+ export const chargeBackWhiteIcon = `${lightUrl}/chargeBackWhiteIcon.svg`;
569
570
  export const blackUnLinkIcon = `${lightUrl}/blackUnLinkIcon.svg`;
570
571
  export const sortDescArrowIcon = `${lightUrl}/sortDescArrowIcon.svg`;
571
572
  export const sortAscArrowIcon = `${lightUrl}/sortAscArrowIcon.svg`;
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.1.363",
4
+ "version": "0.1.364",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",