@tap-payments/os-micro-frontend-shared 0.1.70-test.29 → 0.1.70-test.30-test.31

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.
@@ -63,7 +63,7 @@ function CaptureAutoIcon({ voidPercentage, capturePercentage, captureCount, auto
63
63
  return _jsx(CaptureTextLabel, { children: t('captured') });
64
64
  }
65
65
  return captureStatus;
66
- }, [isTextShown, captureStatus]);
66
+ }, [isTextShown, captureStatus, isSheetViewShown, selectionProps]);
67
67
  return (captureContent && (_jsx("div", Object.assign({ style: {
68
68
  zIndex: 12,
69
69
  } }, { children: captureContent }))));
@@ -1,3 +1,3 @@
1
1
  import { BalanceCellProps } from './type';
2
- declare function VoidAutoIcon({ voidPercentage, capturePercentage, voidCount, autoType, captureAmount, voidAmount, currency, isTextShown, remainingAmount, }: BalanceCellProps): import("react/jsx-runtime").JSX.Element | null;
2
+ declare function VoidAutoIcon({ voidPercentage, capturePercentage, voidCount, autoType, captureAmount, voidAmount, currency, isTextShown, isSheetViewShown, selectionProps, remainingAmount, }: BalanceCellProps): import("react/jsx-runtime").JSX.Element | null;
3
3
  export default VoidAutoIcon;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback } from 'react';
2
+ import { useCallback, useMemo } from 'react';
3
3
  import { useTheme } from '@mui/material/styles';
4
4
  import { motion } from 'framer-motion';
5
5
  import { useTranslation } from 'react-i18next';
@@ -11,7 +11,8 @@ import { formatAmount, formatAmountWithCurrency } from '../../../utils/index.js'
11
11
  import { autoIcons } from './constant';
12
12
  import { AutoIconWrapper, BalanceCellContainer, PercentageContainer, PiePercentage, AutoIconImage } from './style';
13
13
  import { formatPercentage } from './utils';
14
- function VoidAutoIcon({ voidPercentage, capturePercentage, voidCount, autoType, captureAmount, voidAmount, currency, isTextShown, remainingAmount, }) {
14
+ import StatusChipWithCopy from '../../StatusChipWithCopy';
15
+ function VoidAutoIcon({ voidPercentage, capturePercentage, voidCount, autoType, captureAmount, voidAmount, currency, isTextShown, isSheetViewShown, selectionProps = {}, remainingAmount, }) {
15
16
  var _a;
16
17
  const isFullyUsed = Number(capturePercentage) + Number(voidPercentage) === 100 || remainingAmount <= 0;
17
18
  const theme = useTheme();
@@ -59,7 +60,15 @@ function VoidAutoIcon({ voidPercentage, capturePercentage, voidCount, autoType,
59
60
  },
60
61
  } }, { children: _jsxs(StyledBadge, Object.assign({ compact: true, variant: BadgeVariants.NEUTRAL }, { children: [voidCount, "x"] })) })))] })) }))) : autoType === 'VOID' && !isFullyUsed ? (_jsx(Tooltip, Object.assign({ title: generateAutoTooltip('Void') }, { children: _jsx(AutoIconWrapper, { children: _jsx(AutoIconImage, { src: (_a = autoIcons.VOID) === null || _a === void 0 ? void 0 : _a.icon, alt: "auto" }) }) }))) : null;
61
62
  const voidStatus = voidPercentage === 100 ? (_jsx(Tooltip, Object.assign({ title: t('void') }, { children: _jsx(AutoIconWrapper, { children: _jsx(AutoIconImage, { src: voidedIcon, alt: "void" }) }) }))) : (autoVoidStatus);
62
- const voidContent = isTextShown && voidStatus ? _jsx(VoidTextLabel, { children: t('void') }) : voidStatus;
63
+ const voidContent = useMemo(() => {
64
+ if (isSheetViewShown && voidStatus) {
65
+ return (_jsx(StatusChipWithCopy, Object.assign({ chipIndex: 5, copyText: t('void'), selectionProps: selectionProps }, { children: t('void') })));
66
+ }
67
+ if (isTextShown && voidStatus) {
68
+ return _jsx(VoidTextLabel, { children: t('void') });
69
+ }
70
+ return voidStatus;
71
+ }, [isTextShown, voidStatus, isSheetViewShown, selectionProps]);
63
72
  return voidContent ? _jsx("div", Object.assign({ style: { zIndex: 11 } }, { children: voidContent })) : null;
64
73
  }
65
74
  export default VoidAutoIcon;
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.70-test.29",
5
- "testVersion": 29,
4
+ "version": "0.1.70-test.30-test.31",
5
+ "testVersion": 31,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",