@tap-payments/os-micro-frontend-shared 0.1.90-test.23 → 0.1.90-test.27

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,15 @@
1
1
  /// <reference types="react" />
2
2
  import { type RefundStatusType } from '../../TableCells';
3
+ import { SelectionProps } 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
+ isSheetViewShown?: boolean;
11
+ chipIndex?: number;
12
+ selectionProps?: SelectionProps;
9
13
  };
10
- declare const RefundIcon: ({ isTextShown, refundStatus, refundTooltip, refundCount, iconStyles }: RefundIconProps) => import("react/jsx-runtime").JSX.Element;
14
+ declare const RefundIcon: ({ isTextShown, refundStatus, refundTooltip, refundCount, iconStyles, isSheetViewShown, chipIndex, selectionProps, }: RefundIconProps) => import("react/jsx-runtime").JSX.Element;
11
15
  export default RefundIcon;
@@ -1,4 +1,4 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import camelCase from 'lodash/camelCase';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import Tooltip from '../../Tooltip';
@@ -8,9 +8,15 @@ 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 StatusChipWithCopy from '../../StatusChipWithCopy';
12
+ const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '', refundCount, iconStyles, isSheetViewShown, chipIndex = 0, selectionProps = {}, }) => {
12
13
  const { t } = useTranslation();
13
14
  const theme = useTheme();
15
+ const refundCountShown = (refundCount || 0) > 1;
16
+ const status = t(camelCase(refundStatus));
17
+ if (isSheetViewShown) {
18
+ return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, selectionProps: selectionProps, copyText: status }, { children: [status, " ", refundCountShown ? `${refundCount}x` : null] })));
19
+ }
14
20
  const refundCountBadge = (_jsxs(RefundsCountBadge, Object.assign({ "data-testid": "StatusCell_RefundsCountBadge", initial: { width: 0, opacity: 0, padding: '0px' }, transition: {
15
21
  animate: {
16
22
  duration: 0.5,
@@ -31,8 +37,8 @@ const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '',
31
37
  opacity: 1,
32
38
  },
33
39
  } }, { children: [refundCount, "x"] })));
34
- const refundCountShown = (refundCount || 0) > 1;
35
- 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: {
40
+ if (isTextShown) {
41
+ return (_jsx(Tooltip, Object.assign({ title: _jsx("div", { children: _jsx("div", { children: refundTooltip }) }) }, { children: _jsx(StatusTextLabel, Object.assign({ "data-testid": "StatusCell_RefundStatusLabel", sx: {
36
42
  color: refundStyles[refundStatus].color,
37
43
  backgroundColor: refundStyles[refundStatus].backgroundColor,
38
44
  width: '90px',
@@ -41,11 +47,13 @@ const RefundIcon = ({ isTextShown, refundStatus = 'PENDING', refundTooltip = '',
41
47
  boxShadow: theme.shadows[4],
42
48
  gap: theme.spacing(0.5),
43
49
  },
44
- } }, { children: [t(camelCase(refundStatus)), " ", refundCountShown ? refundCountBadge : null] })) })) }))) : (_jsx(Tooltip, Object.assign({ title: _jsx("div", { children: _jsx("div", { children: refundTooltip }) }) }, { children: refundCountShown ? (_jsxs(MultiRefundContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", variants: {
45
- animate: {
46
- boxShadow: theme.shadows[4],
47
- gap: theme.spacing(0.5),
48
- },
49
- } }, { children: [_jsx(MultiRefundIcon, { src: refundSettledIcon, alt: "multi-refunded-icon", "data-testid": "StatusCell_MultiRefundIcon" }), refundCountBadge] }))) : (_jsx(StatusIcon, { src: refundStatusIcons[refundStatus], alt: "refunded-icon", "data-testid": "StatusCell_RefundStatusIcon", style: iconStyles })) }))) }));
50
+ } }, { children: [status, " ", refundCountShown ? refundCountBadge : null] })) })) })));
51
+ }
52
+ return (_jsx(Tooltip, Object.assign({ title: _jsx("div", { children: _jsx("div", { children: refundTooltip }) }) }, { children: refundCountShown ? (_jsxs(MultiRefundContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", variants: {
53
+ animate: {
54
+ boxShadow: theme.shadows[4],
55
+ gap: theme.spacing(0.5),
56
+ },
57
+ } }, { children: [_jsx(MultiRefundIcon, { src: refundSettledIcon, alt: "multi-refunded-icon", "data-testid": "StatusCell_MultiRefundIcon" }), refundCountBadge] }))) : (_jsx(StatusIcon, { src: refundStatusIcons[refundStatus], alt: "refunded-icon", "data-testid": "StatusCell_RefundStatusIcon", style: iconStyles })) })));
50
58
  };
51
59
  export default RefundIcon;
@@ -12,7 +12,7 @@ export declare const destinationsTableCellWidth: {
12
12
  readonly created: {
13
13
  readonly default: "170px";
14
14
  readonly text: "170px";
15
- readonly sheet: "170px";
15
+ readonly sheet: "130px";
16
16
  };
17
17
  readonly receipt: {
18
18
  readonly default: "85px";
@@ -87,7 +87,7 @@ export declare const destinationsTableCellWidth: {
87
87
  readonly actions: {
88
88
  readonly default: "100px";
89
89
  readonly text: "100px";
90
- readonly sheet: "100px";
90
+ readonly sheet: "85px";
91
91
  };
92
92
  readonly destination: {
93
93
  readonly default: "100px";
@@ -159,4 +159,14 @@ export declare const destinationsTableCellWidth: {
159
159
  readonly text: "150px";
160
160
  readonly sheet: "100px";
161
161
  };
162
+ readonly payout_status: {
163
+ readonly default: "120px";
164
+ readonly text: "120px";
165
+ readonly sheet: "120px";
166
+ };
167
+ readonly reference_transfer: {
168
+ readonly default: "350px";
169
+ readonly text: "350px";
170
+ readonly sheet: "350px";
171
+ };
162
172
  };
@@ -12,7 +12,7 @@ export const destinationsTableCellWidth = {
12
12
  created: {
13
13
  default: '170px',
14
14
  text: '170px',
15
- sheet: '170px',
15
+ sheet: '130px',
16
16
  },
17
17
  receipt: {
18
18
  default: '85px',
@@ -87,7 +87,7 @@ export const destinationsTableCellWidth = {
87
87
  actions: {
88
88
  default: '100px',
89
89
  text: '100px',
90
- sheet: '100px',
90
+ sheet: '85px',
91
91
  },
92
92
  destination: {
93
93
  default: '100px',
@@ -159,4 +159,14 @@ export const destinationsTableCellWidth = {
159
159
  text: '150px',
160
160
  sheet: '100px',
161
161
  },
162
+ payout_status: {
163
+ default: '120px',
164
+ text: '120px',
165
+ sheet: '120px',
166
+ },
167
+ reference_transfer: {
168
+ default: '350px',
169
+ text: '350px',
170
+ sheet: '350px',
171
+ },
162
172
  };
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.23",
5
- "testVersion": 23,
4
+ "version": "0.1.90-test.27",
5
+ "testVersion": 27,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",