@tap-payments/os-micro-frontend-shared 0.1.90-test.21 → 0.1.90-test.4

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.
@@ -12,5 +12,8 @@ const ImageWrapper = styled(motion.span)(({ theme, order }) => ({
12
12
  display: 'flex',
13
13
  alignItems: 'center',
14
14
  justifyContent: 'center',
15
+ '&:hover': {
16
+ boxShadow: '7px 0px 8px 0px #F2F2F2',
17
+ },
15
18
  }));
16
19
  export default ImageWrapper;
@@ -1,13 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { type AuthorizedStatusType } from '../../TableCells';
3
- import { SelectionProps, TableMode } from '../../../types/index.js';
3
+ import { 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;
11
9
  };
12
- export declare const AuthorizedIcon: ({ authorizedStatus, isTextShown, iconStyles, tableMode, chipIndex, selectionProps }: AuthorizedIconProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const AuthorizedIcon: ({ authorizedStatus, isTextShown, iconStyles, tableMode }: AuthorizedIconProps) => import("react/jsx-runtime").JSX.Element;
13
11
  export {};
@@ -6,15 +6,10 @@ 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
- import StatusChipWithCopy from '../../StatusChipWithCopy';
10
- export const AuthorizedIcon = ({ authorizedStatus, isTextShown, iconStyles, tableMode, chipIndex = 0, selectionProps = {} }) => {
9
+ export const AuthorizedIcon = ({ authorizedStatus, isTextShown, iconStyles, tableMode }) => {
11
10
  const { t } = useTranslation();
12
11
  const theme = useTheme();
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 })) })));
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 })) })));
20
15
  };
@@ -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, chipIndex, }: Readonly<{
4
+ export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge, isSheetViewShown, selectionProps, }: Readonly<{
5
5
  chargeStatus?: ChargeStatus;
6
6
  gatewayTooltip?: string;
7
7
  showAuthorizedStatus?: boolean;
@@ -20,5 +20,4 @@ export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquire
20
20
  showBadge?: boolean;
21
21
  isSheetViewShown?: boolean;
22
22
  selectionProps?: SelectionProps;
23
- chipIndex?: number;
24
23
  }>): 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 = {}, chipIndex = 0, }) {
11
+ export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge = true, isSheetViewShown = false, selectionProps = {}, }) {
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: 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] })))] }))] }));
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] })))] }))] }));
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: {
@@ -16,8 +16,33 @@ import { verificationIcon } from './constants';
16
16
  import Tooltip from '../../../Tooltip';
17
17
  import { Box } from '@mui/material';
18
18
  import IconWithBadge from '../../../IconWithBadge';
19
+ import { motion } from 'framer-motion';
19
20
  export default function BrandsCell(_a) {
20
21
  var { brand, verificationStatus, hideStatus } = _a, props = __rest(_a, ["brand", "verificationStatus", "hideStatus"]);
21
22
  const icon = verificationIcon[verificationStatus !== null && verificationStatus !== void 0 ? verificationStatus : 'incomplete'];
22
- return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(BrandsWrapper, Object.assign({ sx: { cursor: props.onClick ? 'pointer' : 'default' } }, { children: _jsx(Tooltip, Object.assign({ title: brand.name }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden', width: '100%' } }, { children: [_jsx(IconWithBadge, { mainIcon: brand.logo, mainIconSize: 16, containerSize: 16, borderColor: "transparent" }), _jsx(Label, Object.assign({ sx: Object.assign({}, (!brand.name && { color: '#B1B1B1' })) }, { children: brand.name || 'Not Available' })), !hideStatus && (_jsx(IconWithBadge, { mainIcon: icon, mainIconSize: 10, containerSize: 10, borderColor: "transparent", containerSx: { marginLeft: 'auto' } }))] })) })) })) })));
23
+ return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(BrandsWrapper, Object.assign({ sx: { cursor: props.onClick ? 'pointer' : 'default' } }, { children: _jsx(Tooltip, Object.assign({ title: brand.name }, { children: _jsx(motion.div, Object.assign({ style: {
24
+ alignItems: 'center',
25
+ justifyContent: 'center',
26
+ gap: '4px',
27
+ width: 0,
28
+ display: 'none',
29
+ }, initial: { width: 0, opacity: 0 }, transition: {
30
+ animate: {
31
+ duration: 0.5,
32
+ },
33
+ fadeIn: {
34
+ duration: 0.2,
35
+ },
36
+ }, variants: {
37
+ animate: {
38
+ width: 'auto',
39
+ display: 'flex',
40
+ },
41
+ fadeIn: {
42
+ transition: {
43
+ delay: 0.5,
44
+ },
45
+ opacity: 1,
46
+ },
47
+ } }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden', width: '100%' } }, { children: [_jsx(IconWithBadge, { mainIcon: brand.logo, mainIconSize: 16, containerSize: 16, borderColor: "transparent" }), _jsx(Label, Object.assign({ sx: Object.assign({}, (!brand.name && { color: '#B1B1B1' })) }, { children: brand.name || 'Not Available' })), !hideStatus && (_jsx(IconWithBadge, { mainIcon: icon, mainIconSize: 10, containerSize: 10, borderColor: "transparent", containerSx: { marginLeft: 'auto' } }))] })) })) })) })) })));
23
48
  }
@@ -13,6 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import Tooltip from '../../../Tooltip';
14
14
  import { ImageWrapper } from '../../../index.js';
15
15
  import { TableCell } from '../../../TableCells';
16
+ import { openUrl } from '../../../../utils/index.js';
16
17
  import { ChannelTextLabel, ChannelTextWrapper, salesChannelAnimation, SalesChannelsContainer, StyledSourceCell, StyledSourceImage } from './style';
17
18
  function SalesChannelCell(_a) {
18
19
  var _b;
@@ -25,7 +26,8 @@ function SalesChannelCell(_a) {
25
26
  width: isTextShown ? '70px' : '36px',
26
27
  cursor: 'pointer',
27
28
  }, onClick: () => {
28
- window.open(channel.address, '_blank');
29
+ if (channel === null || channel === void 0 ? void 0 : channel.address)
30
+ openUrl(channel.address);
29
31
  } }, { children: isTextShown ? (_jsx(ChannelTextWrapper, { children: _jsx(ChannelTextLabel, { children: channelCode }) })) : (_jsx(StyledSourceImage, { src: channel.logo, alt: channelCode })) })) }), `${channel}-${index}`));
30
32
  });
31
33
  const salesChannelsCount = (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.length) || 0;
@@ -540,5 +540,3 @@ export declare const blackMobileSignalIcon: string;
540
540
  export declare const emptyMobileWifiIcon: string;
541
541
  export declare const deemaWithLabel: string;
542
542
  export declare const blackUnLinkIcon: string;
543
- export declare const sortDescArrowIcon: string;
544
- export declare const sortAscArrowIcon: string;
@@ -544,5 +544,3 @@ export const blackMobileSignalIcon = `${lightUrl}/blackMobileSignalIcon.svg`;
544
544
  export const emptyMobileWifiIcon = `${lightUrl}/emptyMobileWifiIcon.svg`;
545
545
  export const deemaWithLabel = `${lightUrl}/deemaWithLabel.svg`;
546
546
  export const blackUnLinkIcon = `${lightUrl}/blackUnLinkIcon.svg`;
547
- export const sortDescArrowIcon = `${lightUrl}/sortDescArrowIcon.svg`;
548
- export const sortAscArrowIcon = `${lightUrl}/sortAscArrowIcon.svg`;
@@ -17,7 +17,7 @@ export declare const destinationsTableCellWidth: {
17
17
  readonly receipt: {
18
18
  readonly default: "85px";
19
19
  readonly text: "150px";
20
- readonly sheet: "165px";
20
+ readonly sheet: "150px";
21
21
  };
22
22
  readonly reference: {
23
23
  readonly default: "95px";
@@ -47,7 +47,7 @@ export declare const destinationsTableCellWidth: {
47
47
  readonly device: {
48
48
  readonly default: "150px";
49
49
  readonly text: "250px";
50
- readonly sheet: "235px";
50
+ readonly sheet: "250px";
51
51
  };
52
52
  readonly source: {
53
53
  readonly default: "114px";
@@ -62,7 +62,7 @@ export declare const destinationsTableCellWidth: {
62
62
  readonly payment_agreement: {
63
63
  readonly default: "50px";
64
64
  readonly text: "250px";
65
- readonly sheet: "165px";
65
+ readonly sheet: "250px";
66
66
  };
67
67
  readonly amount: {
68
68
  readonly default: "195px";
@@ -81,8 +81,8 @@ export declare const destinationsTableCellWidth: {
81
81
  };
82
82
  readonly merchant: {
83
83
  readonly default: "100px";
84
- readonly text: "150px";
85
- readonly sheet: "215px";
84
+ readonly text: "180px";
85
+ readonly sheet: "180px";
86
86
  };
87
87
  readonly actions: {
88
88
  readonly default: "100px";
@@ -109,54 +109,4 @@ export declare const destinationsTableCellWidth: {
109
109
  readonly text: "116px";
110
110
  readonly sheet: "116px";
111
111
  };
112
- readonly payment_initiated: {
113
- readonly default: "150px";
114
- readonly text: "150px";
115
- readonly sheet: "150px";
116
- };
117
- readonly payment_issuers: {
118
- readonly default: "150px";
119
- readonly text: "150px";
120
- readonly sheet: "350px";
121
- };
122
- readonly card_number: {
123
- readonly default: "120px";
124
- readonly text: "120px";
125
- readonly sheet: "155px";
126
- };
127
- readonly card_no: {
128
- readonly default: "120px";
129
- readonly text: "120px";
130
- readonly sheet: "200px";
131
- };
132
- readonly payment_type: {
133
- readonly default: "150px";
134
- readonly text: "150px";
135
- readonly sheet: "120px";
136
- };
137
- readonly payment_method: {
138
- readonly default: "150px";
139
- readonly text: "150px";
140
- readonly sheet: "145px";
141
- };
142
- readonly payment_scheme: {
143
- readonly default: "150px";
144
- readonly text: "150px";
145
- readonly sheet: "145px";
146
- };
147
- readonly auth_status: {
148
- readonly default: "150px";
149
- readonly text: "150px";
150
- readonly sheet: "165px";
151
- };
152
- readonly auth_type: {
153
- readonly default: "150px";
154
- readonly text: "150px";
155
- readonly sheet: "155px";
156
- };
157
- readonly eci: {
158
- readonly default: "150px";
159
- readonly text: "150px";
160
- readonly sheet: "100px";
161
- };
162
112
  };
@@ -17,7 +17,7 @@ export const destinationsTableCellWidth = {
17
17
  receipt: {
18
18
  default: '85px',
19
19
  text: '150px',
20
- sheet: '165px',
20
+ sheet: '150px',
21
21
  },
22
22
  reference: {
23
23
  default: '95px',
@@ -47,7 +47,7 @@ export const destinationsTableCellWidth = {
47
47
  device: {
48
48
  default: '150px',
49
49
  text: '250px',
50
- sheet: '235px',
50
+ sheet: '250px',
51
51
  },
52
52
  source: {
53
53
  default: '114px',
@@ -62,7 +62,7 @@ export const destinationsTableCellWidth = {
62
62
  payment_agreement: {
63
63
  default: '50px',
64
64
  text: '250px',
65
- sheet: '165px',
65
+ sheet: '250px',
66
66
  },
67
67
  amount: {
68
68
  default: '195px',
@@ -81,8 +81,8 @@ export const destinationsTableCellWidth = {
81
81
  },
82
82
  merchant: {
83
83
  default: '100px',
84
- text: '150px',
85
- sheet: '215px',
84
+ text: '180px',
85
+ sheet: '180px',
86
86
  },
87
87
  actions: {
88
88
  default: '100px',
@@ -109,54 +109,4 @@ export const destinationsTableCellWidth = {
109
109
  text: '116px',
110
110
  sheet: '116px',
111
111
  },
112
- payment_initiated: {
113
- default: '150px',
114
- text: '150px',
115
- sheet: '150px',
116
- },
117
- payment_issuers: {
118
- default: '150px',
119
- text: '150px',
120
- sheet: '350px',
121
- },
122
- card_number: {
123
- default: '120px',
124
- text: '120px',
125
- sheet: '155px',
126
- },
127
- card_no: {
128
- default: '120px',
129
- text: '120px',
130
- sheet: '200px',
131
- },
132
- payment_type: {
133
- default: '150px',
134
- text: '150px',
135
- sheet: '120px',
136
- },
137
- payment_method: {
138
- default: '150px',
139
- text: '150px',
140
- sheet: '145px',
141
- },
142
- payment_scheme: {
143
- default: '150px',
144
- text: '150px',
145
- sheet: '145px',
146
- },
147
- auth_status: {
148
- default: '150px',
149
- text: '150px',
150
- sheet: '165px',
151
- },
152
- auth_type: {
153
- default: '150px',
154
- text: '150px',
155
- sheet: '155px',
156
- },
157
- eci: {
158
- default: '150px',
159
- text: '150px',
160
- sheet: '100px',
161
- },
162
112
  };
@@ -94,16 +94,6 @@ export declare const refundTableCellWidth: {
94
94
  readonly text: "195px";
95
95
  readonly sheet: "180px";
96
96
  };
97
- readonly payouts: {
98
- readonly default: "195px";
99
- readonly text: "195px";
100
- readonly sheet: "300px";
101
- };
102
- readonly reason: {
103
- readonly default: "170px";
104
- readonly text: "240px";
105
- readonly sheet: "160px";
106
- };
107
97
  readonly destinations: {
108
98
  readonly default: "70px";
109
99
  readonly text: "240px";
@@ -192,7 +182,7 @@ export declare const refundTableCellWidth: {
192
182
  readonly charge_meta: {
193
183
  readonly default: "100px";
194
184
  readonly text: "100px";
195
- readonly sheet: "250px";
185
+ readonly sheet: "100px";
196
186
  };
197
187
  readonly brand: {
198
188
  readonly default: "116px";
@@ -94,16 +94,6 @@ export const refundTableCellWidth = {
94
94
  text: '195px',
95
95
  sheet: '180px',
96
96
  },
97
- payouts: {
98
- default: '195px',
99
- text: '195px',
100
- sheet: '300px',
101
- },
102
- reason: {
103
- default: '170px',
104
- text: '240px',
105
- sheet: '160px',
106
- },
107
97
  destinations: {
108
98
  default: '70px',
109
99
  text: '240px',
@@ -192,7 +182,7 @@ export const refundTableCellWidth = {
192
182
  charge_meta: {
193
183
  default: '100px',
194
184
  text: '100px',
195
- sheet: '250px',
185
+ sheet: '100px',
196
186
  },
197
187
  brand: {
198
188
  default: '116px',
@@ -1 +1,2 @@
1
1
  export declare const openNewTab: (url: string, target?: string) => void;
2
+ export declare const openUrl: (url: string) => void;
@@ -6,3 +6,13 @@ export const openNewTab = (url, target = '_blank') => {
6
6
  link.click();
7
7
  link.remove();
8
8
  };
9
+ export const openUrl = (url) => {
10
+ const isUrl = /^https?:\/\//i.test(url);
11
+ if (isUrl) {
12
+ window.open(url, '_blank', 'noopener,noreferrer');
13
+ }
14
+ else {
15
+ const newUrl = 'about:blank?' + encodeURIComponent(url);
16
+ window.open(newUrl, '_blank', 'noopener,noreferrer');
17
+ }
18
+ };
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.4",
5
+ "testVersion": 4,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",