@tap-payments/os-micro-frontend-shared 0.1.90-test.20 → 0.1.90-test.22

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,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
- export const AuthorizedIcon = ({ authorizedStatus, isTextShown, iconStyles, tableMode }) => {
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
- return (_jsx(Tooltip, Object.assign({ title: tableMode === 'sheet' ? '' : t(camelCase(authorizedStatus)) }, { children: isTextShown ? (_jsx(TextLabel, Object.assign({ "data-testid": "StatusCell_AuthorizedStatusLabel", sx: Object.assign({ color: theme.palette.info.dark }, (tableMode === 'sheet' && {
13
- height: '18px',
14
- })) }, { children: t(camelCase(authorizedStatus)) }))) : (_jsx(Icon, { src: authorizedStatusIcons[authorizedStatus], alt: "authorized-icon", "data-testid": "StatusCell_AuthorizedStatusIcon", sx: iconStyles })) })));
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: 0, 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] })))] }))] }));
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: {
@@ -1,5 +1,8 @@
1
- import { DestinationStatus } from '../../../types/index.js';
2
- export declare function DestinationIcon({ status, isTextShown, }: Readonly<{
1
+ import { DestinationStatus, SelectionProps } from '../../../types/index.js';
2
+ export declare function DestinationIcon({ status, isTextShown, isSheetViewShown, chipIndex, selectionProps, }: Readonly<{
3
3
  status: DestinationStatus;
4
4
  isTextShown?: boolean;
5
+ isSheetViewShown?: boolean;
6
+ chipIndex?: number;
7
+ selectionProps?: SelectionProps;
5
8
  }>): import("react/jsx-runtime").JSX.Element;
@@ -5,10 +5,18 @@ import Tooltip from '../../Tooltip';
5
5
  import { camelCase } from 'lodash';
6
6
  import { useTheme } from '@mui/material';
7
7
  import { t } from 'i18next';
8
- export function DestinationIcon({ status, isTextShown, }) {
8
+ import StatusChipWithCopy from '../../StatusChipWithCopy';
9
+ export function DestinationIcon({ status, isTextShown, isSheetViewShown, chipIndex = 0, selectionProps = {}, }) {
9
10
  const theme = useTheme();
10
- return isTextShown && destinationStatusIcons[status] ? (_jsx(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(status), sx: {
11
- background: '#1F88D00D',
12
- color: status === 'PROCESSED' ? theme.palette.info.dark : theme.palette.common.black,
13
- } }, { children: t(camelCase(status)) }))) : (_jsx(StatusIconWrapper, Object.assign({ className: "destination-status" }, { children: status && destinationStatusIcons[status] && (_jsx(Tooltip, Object.assign({ title: t(camelCase(status)) }, { children: _jsx(StatusIcon, { src: destinationStatusIcons[status], alt: "destination-icon" }) }))) })));
11
+ const statusText = t(camelCase(status));
12
+ if (isSheetViewShown && destinationStatusIcons[status]) {
13
+ return (_jsx(StatusChipWithCopy, Object.assign({ copyText: statusText, chipIndex: chipIndex, selectionProps: selectionProps }, { children: statusText })));
14
+ }
15
+ if (isTextShown && destinationStatusIcons[status]) {
16
+ return (_jsx(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(status), sx: {
17
+ background: '#1F88D00D',
18
+ color: status === 'PROCESSED' ? theme.palette.info.dark : theme.palette.common.black,
19
+ } }, { children: statusText })));
20
+ }
21
+ return (_jsx(StatusIconWrapper, Object.assign({ className: "destination-status" }, { children: status && destinationStatusIcons[status] && (_jsx(Tooltip, Object.assign({ title: t(camelCase(status)) }, { children: _jsx(StatusIcon, { src: destinationStatusIcons[status], alt: "destination-icon" }) }))) })));
14
22
  }
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.20",
5
- "testVersion": 20,
4
+ "version": "0.1.90-test.22",
5
+ "testVersion": 22,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",