@tap-payments/os-micro-frontend-shared 0.0.59 → 0.0.62

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,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import dayjs from 'dayjs';
4
+ import Box from '@mui/material/Box';
4
5
  import { getCurrencyCodeFlag, getLocalizedUnitLabel } from '../../../utils/index.js';
5
6
  import { DATA_KEY } from '../../../constants/index.js';
6
7
  import { TooltipContainer, TimeTypography, ValueTypography, CurrencyBox, CurrencyText, CurrencyIcon } from '../styles';
@@ -15,7 +16,7 @@ const ChartTooltip = ({ active, payload, dateRange, selectedCurrency }) => {
15
16
  const point = payload[0];
16
17
  const localizedUnitLabel = getLocalizedUnitLabel(point === null || point === void 0 ? void 0 : point.dataKey, point === null || point === void 0 ? void 0 : point.value);
17
18
  const formattedDate = ((_a = point === null || point === void 0 ? void 0 : point.payload) === null || _a === void 0 ? void 0 : _a.date) && getFormattedDateWithTimezone((_b = point === null || point === void 0 ? void 0 : point.payload) === null || _b === void 0 ? void 0 : _b.date, isSingleDay, (_c = point === null || point === void 0 ? void 0 : point.payload) === null || _c === void 0 ? void 0 : _c.hour);
18
- return (_jsxs(TooltipContainer, Object.assign({ className: "chart-tooltip" }, { children: [_jsx(TimeTypography, { children: formattedDate !== null && formattedDate !== void 0 ? formattedDate : (_d = point === null || point === void 0 ? void 0 : point.payload) === null || _d === void 0 ? void 0 : _d.date }), _jsxs(ValueTypography, { children: [(point === null || point === void 0 ? void 0 : point.dataKey) === DATA_KEY.AMOUNT && (_jsxs(CurrencyBox, { children: [_jsx(CurrencyIcon, { src: getCurrencyCodeFlag(selectedCurrency), alt: `${selectedCurrency} flag` }), _jsx(CurrencyText, { children: selectedCurrency })] })), `${getTooltipFormattedValue(point, t(localizedUnitLabel), selectedCurrency)}`] })] })));
19
+ return (_jsxs(TooltipContainer, Object.assign({ className: "chart-tooltip" }, { children: [_jsx(TimeTypography, { children: formattedDate !== null && formattedDate !== void 0 ? formattedDate : (_d = point === null || point === void 0 ? void 0 : point.payload) === null || _d === void 0 ? void 0 : _d.date }), _jsxs(ValueTypography, { children: [(point === null || point === void 0 ? void 0 : point.dataKey) === DATA_KEY.AMOUNT && (_jsxs(CurrencyBox, { children: [_jsx(CurrencyIcon, { src: getCurrencyCodeFlag(selectedCurrency), alt: `${selectedCurrency} flag` }), _jsx(CurrencyText, { children: selectedCurrency })] })), _jsx(Box, { children: `${getTooltipFormattedValue(point, t(localizedUnitLabel), selectedCurrency)}` })] })] })));
19
20
  }
20
21
  return null;
21
22
  };
@@ -22,6 +22,7 @@ export const TimeTypography = styled(Typography)({
22
22
  export const ValueTypography = styled(Typography)({
23
23
  display: 'flex',
24
24
  alignItems: 'center',
25
+ gap: '5px',
25
26
  fontWeight: 600,
26
27
  color: '#4B4847',
27
28
  fontSize: 11,
@@ -34,7 +35,6 @@ export const CurrencyBox = styled(Box)({
34
35
  alignItems: 'center',
35
36
  height: '100%',
36
37
  gap: '2.6px',
37
- marginLeft: '5px',
38
38
  maxHeight: '19px',
39
39
  });
40
40
  export const CurrencyText = styled(Typography)({
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import type { StatusButtonProps } from './type';
3
- declare function StatusButton({ variant, badgeCount, icon, label, dropdownOptions, onButtonBodyClick, ...props }: StatusButtonProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function StatusButton({ variant, badgeCount, icon, label, dropdownOptions, onButtonBodyClick, showDropdownIcon, ...props }: StatusButtonProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof StatusButton>;
5
5
  export default _default;
@@ -19,7 +19,7 @@ import { ChevronContainer, Label, LabelWrapper, StatusIcon, StyledDropdown, stat
19
19
  import { statusButtonIcons } from './constant';
20
20
  function StatusButton(_a) {
21
21
  var _b, _c;
22
- var { variant = 'inActive', badgeCount, icon, label, dropdownOptions, onButtonBodyClick } = _a, props = __rest(_a, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "onButtonBodyClick"]);
22
+ var { variant = 'inActive', badgeCount, icon, label, dropdownOptions, onButtonBodyClick, showDropdownIcon } = _a, props = __rest(_a, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "onButtonBodyClick", "showDropdownIcon"]);
23
23
  const [anchorEl, setAnchorEl] = useState(null);
24
24
  const buttonRef = useRef(null);
25
25
  const [lastActiveStatus, setLastActiveStatus] = useState((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status);
@@ -29,7 +29,7 @@ function StatusButton(_a) {
29
29
  setAnchorEl(null);
30
30
  };
31
31
  const Button = statusButtonVariants[variant];
32
- const hasDropdown = dropdownOptions && dropdownOptions.length > 0;
32
+ const hasDropdown = (dropdownOptions && dropdownOptions.length > 0) || showDropdownIcon;
33
33
  const statusIcon = icon ? _jsx(StatusIcon, { icon: icon, variant: variant, src: statusButtonIcons[icon], alt: `${icon}-icon` }) : null;
34
34
  const statusBadge = badgeCount && !Number.isNaN(convertToNumber(badgeCount)) ? (_jsx(StyledBadge, Object.assign({ variant: variant === 'active' ? BadgeVariants.ACTIVE : BadgeVariants.INACTIVE }, { children: formatNumber(Number(badgeCount)) }))) : null;
35
35
  const dropdownIcon = hasDropdown ? _jsx(ChevronIcon, { isActive: variant === 'active' }) : null;
@@ -10,6 +10,7 @@ export interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'childr
10
10
  hasDropdown?: boolean;
11
11
  icon?: StatusButtonIcon;
12
12
  label?: ReactNode | null;
13
+ showDropdownIcon?: boolean;
13
14
  totalCount?: number;
14
15
  onButtonBodyClick?: (status: TableHeaderStatus) => void;
15
16
  dropdownOptions?: Array<MenuItemI & {
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { acceptanceAppIcon, acceptanceAppDisabledIcon, payoutsAppIcon, payoutAppDisabledIcon } from '../../../../constants/index.js';
13
+ import { acceptanceAppIcon, acceptanceDisabledRoundedIcon, payoutsAppIcon, payoutDisabledRoundedIcon } from '../../../../constants/index.js';
14
14
  import Tooltip from '../../../Tooltip';
15
15
  import TableCell from '../../TableCell';
16
16
  import { AppsWrapper, IconWrapper } from './style';
@@ -18,5 +18,5 @@ export default function ApplicationStatusCell(_a) {
18
18
  var { acceptance, payout } = _a, props = __rest(_a, ["acceptance", "payout"]);
19
19
  const isAcceptanceEnabled = (acceptance === null || acceptance === void 0 ? void 0 : acceptance.toLowerCase()) === 'enabled';
20
20
  const isPayoutEnabled = (payout === null || payout === void 0 ? void 0 : payout.toLowerCase()) === 'enabled';
21
- return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AppsWrapper, { children: [_jsx(Tooltip, Object.assign({ title: 'Acceptance' }, { children: _jsxs(IconWrapper, { children: [_jsx("img", { src: isAcceptanceEnabled ? acceptanceAppIcon : acceptanceAppDisabledIcon, alt: acceptance }), ' '] }) }), acceptance), _jsx(Tooltip, Object.assign({ title: 'Payouts' }, { children: _jsx(IconWrapper, { children: _jsx("img", { src: isPayoutEnabled ? payoutsAppIcon : payoutAppDisabledIcon, alt: payout }) }) }), payout)] }) })));
21
+ return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AppsWrapper, { children: [_jsx(Tooltip, Object.assign({ title: 'Acceptance' }, { children: _jsxs(IconWrapper, { children: [_jsx("img", { src: isAcceptanceEnabled ? acceptanceAppIcon : acceptanceDisabledRoundedIcon, alt: acceptance }), ' '] }) }), acceptance), _jsx(Tooltip, Object.assign({ title: 'Payouts' }, { children: _jsx(IconWrapper, { children: _jsx("img", { src: isPayoutEnabled ? payoutsAppIcon : payoutDisabledRoundedIcon, alt: payout }) }) }), payout)] }) })));
22
22
  }
@@ -6,23 +6,17 @@ export const AppsWrapper = styled('div')(({ theme }) => ({
6
6
  borderRadius: '44px',
7
7
  lineHeight: '120%',
8
8
  }));
9
- export const IconWrapper = styled(Box)(() => ({
9
+ export const IconWrapper = styled(Box)(({ theme }) => ({
10
10
  display: 'flex',
11
11
  alignItems: 'center',
12
12
  justifyContent: 'center',
13
- width: '24px',
14
- height: '24px',
15
- borderRadius: '8px',
16
- cursor: 'pointer',
17
- boxSizing: 'border-box',
18
- '&.colored': {
19
- border: 'none',
20
- width: '24px',
21
- height: '24px',
22
- },
13
+ width: '23px',
14
+ height: '23px',
15
+ borderRadius: '50%',
16
+ border: `1px solid ${theme.palette.divider}`,
23
17
  img: {
24
- maxWidth: '24px',
25
- maxHeight: '24px',
26
- display: 'block',
18
+ width: '20px',
19
+ height: '20px',
20
+ borderRadius: '50%',
27
21
  },
28
22
  }));
@@ -20,5 +20,5 @@ export default function EntityCell(_a) {
20
20
  var { entity, country, verificationStatus, licenseNumber } = _a, props = __rest(_a, ["entity", "country", "verificationStatus", "licenseNumber"]);
21
21
  const countryIcon = getCountriesIcon(country);
22
22
  const icon = verificationIcon[verificationStatus !== null && verificationStatus !== void 0 ? verificationStatus : 'incomplete'];
23
- return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: 'pointer' } }, { children: _jsx(Tooltip, Object.assign({ title: licenseNumber }, { children: _jsx(EntityWrapper, { children: entity ? (_jsxs(EntityContainer, { children: [_jsxs(EntityInfoContainer, { children: [_jsx(Icon, { src: countryIcon, sx: { width: '16px', height: '11.73' } }), _jsx(EntityName, { children: entity })] }), _jsx(VerificationContainer, { children: _jsx(VerificationIcon, { src: icon }) })] })) : (_jsx(EmptyCell, { children: "Not Available" })) }) })) })));
23
+ return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: 'pointer' } }, { children: _jsx(Tooltip, Object.assign({ title: entity }, { children: _jsx(EntityWrapper, { children: licenseNumber ? (_jsxs(EntityContainer, { children: [_jsxs(EntityInfoContainer, { children: [_jsx(Icon, { src: countryIcon, sx: { width: '16px', height: '11.73' } }), _jsx(EntityName, { children: licenseNumber })] }), _jsx(VerificationContainer, { children: _jsx(VerificationIcon, { src: icon }) })] })) : (_jsx(EmptyCell, { children: "Not Available" })) }) })) })));
24
24
  }
@@ -1,2 +1,2 @@
1
1
  import { IndividualCellProps } from './type';
2
- export default function IndividualsCell({ id, status, count, ...props }: IndividualCellProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function IndividualsCell({ id, status, count, name, ...props }: IndividualCellProps): import("react/jsx-runtime").JSX.Element;
@@ -15,7 +15,7 @@ import { verificationIcons } from './constants';
15
15
  import { IndividualsWrapper, IndividualName, VerificationIcon, Count, IndividualContainer, VerificationContainer, EmptyCell } from './style';
16
16
  import Tooltip from '../../../Tooltip';
17
17
  export default function IndividualsCell(_a) {
18
- var { id, status, count } = _a, props = __rest(_a, ["id", "status", "count"]);
18
+ var { id, status, count, name } = _a, props = __rest(_a, ["id", "status", "count", "name"]);
19
19
  const icon = verificationIcons[status !== null && status !== void 0 ? status : 'incomplete'];
20
- return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: 'pointer' } }, { children: _jsx(IndividualsWrapper, { children: id ? (_jsxs(IndividualContainer, { children: [_jsx(Tooltip, Object.assign({ title: id }, { children: _jsx(IndividualName, { children: id }) })), _jsxs(VerificationContainer, { children: [_jsx(VerificationIcon, { src: icon }), count > 1 && (_jsx("div", { children: _jsxs(Count, { children: ["+", count] }) }))] })] })) : (_jsx(EmptyCell, { children: "Not Available" })) }) })));
20
+ return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: 'pointer' } }, { children: _jsx(IndividualsWrapper, { children: id ? (_jsxs(IndividualContainer, { children: [_jsx(Tooltip, Object.assign({ title: name }, { children: _jsx(IndividualName, { children: id }) })), _jsxs(VerificationContainer, { children: [_jsx(VerificationIcon, { src: icon }), count > 1 && (_jsx("div", { children: _jsxs(Count, { children: ["+", count] }) }))] })] })) : (_jsx(EmptyCell, { children: "Not Available" })) }) })));
21
21
  }
@@ -3,4 +3,5 @@ export type IndividualCellProps = TableCellProps & {
3
3
  id: string;
4
4
  status: 'incomplete' | 'complete' | 'reviewed' | 'verified';
5
5
  count: number;
6
+ name: string;
6
7
  };
@@ -24,7 +24,7 @@ function SegmentsCell(_a) {
24
24
  const theme = useTheme();
25
25
  const segments = useMemo(() => Object.keys(segmentsIcons).filter((key) => !!props[key]), [props]);
26
26
  const ReferenceSources = useMemo(() => segments.map((segment, index) => {
27
- const sourceTooltip = `${startCase(segment)} - ${props[segment]}`;
27
+ const sourceTooltip = `${props[segment]}`;
28
28
  return (_jsx(Tooltip, Object.assign({ onOpen: () => {
29
29
  setIsTooltipOpen(true);
30
30
  }, onClose: () => {
@@ -61,7 +61,7 @@ function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columns
61
61
  const { header, id, align, headerStyle, sortable, filter } = column;
62
62
  const isFirst = id === columns[0].id;
63
63
  const isLast = id === columns[columns.length - 1].id;
64
- return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_TableHeader_StyledCell", "data-column-id": column.id, "data-column-width": column.width, "data-column-width-used": column.width, "data-column-align": column.align, "data-column-order": column.order, "data-column-header": typeof column.header === 'string' ? column.header : 'component', "data-column-sortable": !!column.sortable, "data-column-filterable": !!column.filter, isFirst: isFirst, isLast: isLast, sx: Object.assign({ paddingInline: '0.6875rem', paddingLeft: isFirst ? '0' : '0.6875rem', paddingRight: isLast ? '0' : '0.6875rem', display: 'flex', gap: theme.spacing(0.5), alignItems: 'baseline', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: column.width, textAlign: align, overflow: 'unset' }, headerStyle) }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "TableHeader_columns_header" }, { children: header && (_jsx("span", Object.assign({ style: { textOverflow: 'ellipsis', width: '80%', overflow: 'hidden' }, "data-testid": "VirtualTable_TableHeader_StyledCell_header_text" }, { children: header }))) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter)), sortable && _jsx(ColumnIcon, { onClick: sortable ? handleClick : undefined, src: columnIcon, alt: "column-icon", "data-id": id })] }), `${id}-${colIndex}`));
64
+ return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_TableHeader_StyledCell", "data-column-id": column.id, "data-column-width": column.width, "data-column-width-used": column.width, "data-column-align": column.align, "data-column-order": column.order, "data-column-header": typeof column.header === 'string' ? column.header : 'component', "data-column-sortable": !!column.sortable, "data-column-filterable": !!column.filter, isFirst: isFirst, isLast: isLast, sx: Object.assign({ paddingInline: '0.6875rem', paddingLeft: isFirst ? '0' : '0.6875rem', paddingRight: isLast ? '0' : '0.6875rem', display: 'flex', gap: theme.spacing(0.5), alignItems: 'baseline', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: column.width, textAlign: align, overflow: 'unset' }, headerStyle) }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "TableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && (_jsx("span", Object.assign({ style: { textOverflow: 'ellipsis', width: '80%', overflow: 'hidden' }, "data-testid": "VirtualTable_TableHeader_StyledCell_header_text" }, { children: header }))) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter)), sortable && _jsx(ColumnIcon, { onClick: sortable ? handleClick : undefined, src: columnIcon, alt: "column-icon", "data-id": id })] }), `${id}-${colIndex}`));
65
65
  }) })), _jsx(Dropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: [
66
66
  {
67
67
  label: 'Sort A-Z',
@@ -103,6 +103,7 @@ export declare const blueZigzagCheckIcon: string;
103
103
  export declare const greenZigzagCheckIcon: string;
104
104
  export declare const dimmedZigzagCheckIcon: string;
105
105
  export declare const marketPlaceBlueIcon: string;
106
+ export declare const marketPlaceBlackIcon: string;
106
107
  export declare const marketPlaceDimmedIcon: string;
107
108
  export declare const moneyOutIcon: string;
108
109
  export declare const moneyOutDimmedIcon: string;
@@ -132,6 +133,8 @@ export declare const newReceiptIcon: string;
132
133
  export declare const acceptanceAppIcon: string;
133
134
  export declare const acceptanceAppDisabledIcon: string;
134
135
  export declare const payoutAppDisabledIcon: string;
136
+ export declare const payoutDisabledRoundedIcon: string;
137
+ export declare const acceptanceDisabledRoundedIcon: string;
135
138
  export declare const authenticationAppIcon: string;
136
139
  export declare const walletAppIcon: string;
137
140
  export declare const payoutsAppIcon: string;
@@ -104,6 +104,7 @@ export const blueZigzagCheckIcon = `${lightUrl}/blueCheckIconZigzag.svg`;
104
104
  export const greenZigzagCheckIcon = `${lightUrl}/greenCheckIconZigzag.svg`;
105
105
  export const dimmedZigzagCheckIcon = `${lightUrl}/dimmedCheckIconZigzag.svg`;
106
106
  export const marketPlaceBlueIcon = `${lightUrl}/marketPlaceBlue.svg`;
107
+ export const marketPlaceBlackIcon = `${lightUrl}/marketplaceBlackIcon.svg`;
107
108
  export const marketPlaceDimmedIcon = `${lightUrl}/marketPlaceDimmed.svg`;
108
109
  export const moneyOutIcon = `${lightUrl}/moneyOut.svg`;
109
110
  export const moneyOutDimmedIcon = `${lightUrl}/moneyOutDimmed.svg`;
@@ -133,6 +134,8 @@ export const newReceiptIcon = `${lightUrl}/newReceiptIcon.svg`;
133
134
  export const acceptanceAppIcon = `${lightUrl}/other/acceptance.svg`;
134
135
  export const acceptanceAppDisabledIcon = `${lightUrl}/other/acceptanceAppIconDisabled.svg`;
135
136
  export const payoutAppDisabledIcon = `${lightUrl}/other/payoutsAppIconDisabled.svg`;
137
+ export const payoutDisabledRoundedIcon = `${lightUrl}/payoutDisabledRounded.svg`;
138
+ export const acceptanceDisabledRoundedIcon = `${lightUrl}/acceptanceDisabledRounded.svg`;
136
139
  export const authenticationAppIcon = `${lightUrl}/other/AuthenticationApp.svg`;
137
140
  export const walletAppIcon = `${lightUrl}/other/walletApp.svg`;
138
141
  export const payoutsAppIcon = `${lightUrl}/other/payouts.svg`;
@@ -9,7 +9,7 @@ export interface Merchant {
9
9
  display_name: string;
10
10
  }
11
11
  export type VerificationStatus = 'incomplete' | 'complete' | 'reviewed' | 'verified';
12
- export type MerchantStatus = 'completed' | 'all';
12
+ export type MerchantStatus = 'completed' | 'all' | 'country';
13
13
  export interface BusinessMerchant {
14
14
  id: string;
15
15
  status: MerchantStatus;
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.59",
4
+ "version": "0.0.62",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
7
7
  "module": "build/index.js",