@tap-payments/os-micro-frontend-shared 0.0.61 → 0.0.65

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,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: '18.5px',
19
+ height: '18.5px',
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;
@@ -427,6 +430,7 @@ export declare const metaIcon: string;
427
430
  export declare const darkFilterIcon: string;
428
431
  export declare const homeIcon: string;
429
432
  export declare const lockIcon: string;
433
+ export declare const calenderIcon: string;
430
434
  export declare const autoCapturedIcon: string;
431
435
  export declare const autoVoidIcon: string;
432
436
  export declare const cancelledIcon: 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`;
@@ -431,6 +434,7 @@ export const metaIcon = `${lightUrl}/meta.svg`;
431
434
  export const darkFilterIcon = `${lightUrl}/darkFilterIcon.svg`;
432
435
  export const homeIcon = `${lightUrl}/home.svg`;
433
436
  export const lockIcon = `${lightUrl}/lockIcon.svg`;
437
+ export const calenderIcon = `${lightUrl}/Calendar.svg`;
434
438
  export const autoCapturedIcon = `${lightUrl}/status-v2/autoCapturedNoBG.svg`;
435
439
  export const autoVoidIcon = `${lightUrl}/status-v2/autoVoidNoBG.svg`;
436
440
  export const cancelledIcon = `${lightUrl}/status-v2/cancelledNoBG.svg`;
@@ -24,7 +24,7 @@ export declare const merchantsTableCellWidth: {
24
24
  readonly text: "120px";
25
25
  };
26
26
  readonly segments: {
27
- readonly default: "95px";
27
+ readonly default: "70px";
28
28
  readonly text: "180px";
29
29
  };
30
30
  readonly status: {
@@ -24,7 +24,7 @@ export const merchantsTableCellWidth = {
24
24
  text: '120px',
25
25
  },
26
26
  segments: {
27
- default: '95px',
27
+ default: '70px',
28
28
  text: '180px',
29
29
  },
30
30
  status: {
@@ -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.61",
4
+ "version": "0.0.65",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
7
7
  "module": "build/index.js",