@tap-payments/os-micro-frontend-shared 0.1.90-test.21 → 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,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.21",
5
- "testVersion": 21,
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",