@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.
@@ -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, sheetViewChipStyles, } from '../../TableCells/CustomCells/StatusCell/constant';
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 ? sheetViewChipStyles[chargeStatus] : null;
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
- const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '', refundCount, iconStyles }) => {
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,
@@ -13,7 +13,7 @@ export declare const statusIcons: {
13
13
  UNKNOWN: string;
14
14
  AUTHORIZED: string;
15
15
  };
16
- export declare const sheetViewChipStyles: {
16
+ export declare const chargeSheetViewChipStyles: {
17
17
  CAPTURED: {
18
18
  color: string;
19
19
  background: string;
@@ -13,7 +13,7 @@ export const statusIcons = {
13
13
  UNKNOWN: unknownIcon,
14
14
  AUTHORIZED: authorizedIcon,
15
15
  };
16
- export const sheetViewChipStyles = {
16
+ export const chargeSheetViewChipStyles = {
17
17
  CAPTURED: {
18
18
  color: '#1F88D0',
19
19
  background: '#1F88D01A',
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.260",
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 version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
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 ",