@tap-payments/os-micro-frontend-shared 0.0.84 → 0.0.88

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.
@@ -554,9 +554,9 @@ export declare const Icon: import("@emotion/styled").StyledComponent<{
554
554
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
555
555
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
556
556
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
557
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
557
558
  src?: string | undefined;
558
559
  alt?: string | undefined;
559
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
560
560
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
561
561
  useMap?: string | undefined;
562
562
  loading?: "eager" | "lazy" | undefined;
@@ -25,4 +25,7 @@ export declare const actionIcons: {
25
25
  reverse: string;
26
26
  destination: string;
27
27
  invoice: string;
28
+ users: string;
29
+ brand: string;
30
+ clipboard: string;
28
31
  };
@@ -1,5 +1,5 @@
1
1
  import { BadgeVariants } from '../../../CountBadge';
2
- import { flagIcon, clockIcon, disputeIcon, redFlagIcon, cancelledIcon, closedFlagIcon, orangeFlagIcon, refundInitiatedIcon, viewInvoiceIcon, reverseActionIcon, voidedIcon, capturedDropdownIcon, destinationReversedTableIcon, } from '../../../../constants/index.js';
2
+ import { flagIcon, clockIcon, disputeIcon, redFlagIcon, cancelledIcon, closedFlagIcon, orangeFlagIcon, refundInitiatedIcon, viewInvoiceIcon, reverseActionIcon, voidedIcon, capturedDropdownIcon, destinationReversedTableIcon, brandPlaceholderIcon, usersIcon, clipboardIcon, } from '../../../../constants/index.js';
3
3
  export const flags = {
4
4
  GRAY: { icon: closedFlagIcon, color: '#CFCFCF' },
5
5
  ORANGE: { icon: orangeFlagIcon, color: '#FFD503' },
@@ -21,4 +21,7 @@ export const actionIcons = {
21
21
  reverse: reverseActionIcon,
22
22
  destination: destinationReversedTableIcon,
23
23
  invoice: viewInvoiceIcon,
24
+ users: usersIcon,
25
+ brand: brandPlaceholderIcon,
26
+ clipboard: clipboardIcon,
24
27
  };
@@ -12,7 +12,7 @@ export declare function useActionCell({ actions, isDropdownShown, onCloseDropdow
12
12
  label: string;
13
13
  onClick: (e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void;
14
14
  onRightClick?: ((e: React.MouseEvent<HTMLLIElement, MouseEvent>) => void) | undefined;
15
- icon: "reverse" | "refund" | "destination" | "cancel" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice";
15
+ icon: "brand" | "users" | "reverse" | "refund" | "destination" | "cancel" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | "clipboard";
16
16
  isLoading?: boolean | undefined;
17
17
  isError?: boolean | undefined;
18
18
  isSuccess?: boolean | undefined;
@@ -269,9 +269,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
269
269
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
270
270
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
271
271
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
272
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
272
273
  src?: string | undefined;
273
274
  alt?: string | undefined;
274
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
275
275
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
276
276
  useMap?: string | undefined;
277
277
  loading?: "eager" | "lazy" | undefined;
@@ -280,5 +280,5 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
280
280
  sizes?: string | undefined;
281
281
  srcSet?: string | undefined;
282
282
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
283
- icon?: "reverse" | "refund" | "destination" | "cancel" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | undefined;
283
+ icon?: "brand" | "users" | "reverse" | "refund" | "destination" | "cancel" | "capture" | "flag" | "dispute" | "void" | "clock" | "invoice" | "clipboard" | undefined;
284
284
  }, {}, {}>;
@@ -273,9 +273,9 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
273
273
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
274
274
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
275
275
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
276
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
276
277
  src?: string | undefined;
277
278
  alt?: string | undefined;
278
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
279
279
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
280
280
  useMap?: string | undefined;
281
281
  loading?: "eager" | "lazy" | undefined;
@@ -262,9 +262,9 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
262
262
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
263
263
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
264
264
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
265
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
265
266
  src?: string | undefined;
266
267
  alt?: string | undefined;
267
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
268
268
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
269
269
  useMap?: string | undefined;
270
270
  loading?: "eager" | "lazy" | undefined;
@@ -79,6 +79,8 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
79
79
  };
80
80
  return (_jsx(InfiniteLoader, Object.assign({ isItemLoaded: (index) => index !== lastItemIndex, itemCount: tableItemsCount, loadMoreItems: handleOnLoadMoreItems, threshold: threshold }, { children: ({ onItemsRendered }) => (_jsx(AutoSizer, { children: ({ height, width }) => (_jsx(StyledVirtualList, Object.assign({ listRef: listRef, height: height, width: fixedWidth || width, itemCount: tableItemsCount, itemSize: () => rowHeight, itemData: currentItemData, onItemsRendered: onItemsRendered, overscanCount: TABLE_LIST_OVER_SCAN, setBackdropVisibility: setShowBackdrop, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, useIsScrolling: true, onScroll: handleScrollCallback, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, style: {
81
81
  overflowX: isPinned ? 'hidden' : 'auto',
82
+ paddingBottom: '12px',
83
+ backgroundColor: isPinned ? 'transparent' : theme.palette.background.default,
82
84
  } }, { children: ListItemWrapper }))) })) })));
83
85
  }, [
84
86
  itemsCount,
@@ -112,7 +114,7 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
112
114
  minWidth: 'fit-content',
113
115
  } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_PinnedStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(columnsData, containerKey, true, columnsWidth) })) }))] })) })));
114
116
  };
115
- return (_jsxs(_Fragment, { children: [_jsxs(TableContainer, { children: [showNoDataView ? (_jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView }, { children: _jsx(TableWrapper, Object.assign({ isSheetView: true, "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: tableBodyStyles }, { children: _jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }) })) }))) : (_jsxs(SheetViewVirtualTableWrapper, { children: [renderPinnedColumn('start', pinnedStartColumnsData, pinnedStartColumnsWidth, pinnedStartColumns), _jsx(MainTableWrapper, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_UnpinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: handleColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
117
+ return (_jsxs(_Fragment, { children: [_jsxs(TableContainer, { children: [showNoDataView ? (_jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView }, { children: _jsx(TableWrapper, Object.assign({ isSheetView: true, "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: tableBodyStyles }, { children: _jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }) })) }))) : (_jsxs(SheetViewVirtualTableWrapper, { children: [renderPinnedColumn('start', pinnedStartColumnsData, pinnedStartColumnsWidth, pinnedStartColumns), _jsx(MainTableWrapper, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_UnpinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: handleColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
116
118
  width: '100%',
117
119
  minWidth: 'fit-content',
118
120
  } }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_ScrollableStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(unpinnedColumnsData, 'scrollable', false) })) }))] })) })) })), renderPinnedColumn('end', pinnedEndColumnsData, pinnedEndColumnsWidth, [...pinnedStartColumns, ...pinnedEndColumns])] })), !showNoDataView && areTotalRowsNotFillingHeight && !isFetchingNextPage && (_jsx(TableLastItem, { height: (itemsCount + 1) * TABLE_ROW_HEIGHT, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode, "data-testid": "SheetViewVirtualTable_TableLastItem" }))] }), _jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
@@ -86,6 +86,7 @@ export const MainTableWrapper = styled('div', {
86
86
  marginLeft: hasPinnedStart ? '0' : '32px',
87
87
  marginRight: hasPinnedEnd ? '0' : '32px',
88
88
  position: 'relative',
89
+ scrollbarWidth: 'auto',
89
90
  }));
90
91
  export const UnpinnedTableHeaderWrapper = styled('div')({
91
92
  flexShrink: 0,
@@ -56,15 +56,10 @@ function ListItemWrapper(_a) {
56
56
  const lastRowContent = _jsx(LastRowContent, { isLoadingRow: isLoadingRow });
57
57
  const isLastRow = isLoadingRow || (areAllRowsLoaded && index === lastItemIndex + 1);
58
58
  if (isPinned && isLastRow) {
59
- return _jsx(Box, { sx: { height: isSheetView ? SHEET_VIEW_TABLE_ROW_HEIGHT : TABLE_ROW_HEIGHT, backgroundColor: '#F6F8FACC' } });
59
+ return (_jsx(Box, { sx: Object.assign(Object.assign({}, (isSheetView ? { minHeight: SHEET_VIEW_TABLE_ROW_HEIGHT } : { height: TABLE_ROW_HEIGHT })), { backgroundColor: '#F6F8FACC' }) }));
60
60
  }
61
61
  if (isLastRow) {
62
- return (_jsx(Box, Object.assign({ sx: {
63
- height: isSheetView ? SHEET_VIEW_TABLE_ROW_HEIGHT : TABLE_ROW_HEIGHT,
64
- display: 'flex',
65
- justifyContent: 'center',
66
- alignItems: 'center',
67
- } }, { children: _jsx(Box, Object.assign({ sx: {
62
+ return (_jsx(Box, Object.assign({ sx: Object.assign(Object.assign({}, (isSheetView ? { minHeight: SHEET_VIEW_TABLE_ROW_HEIGHT } : { height: TABLE_ROW_HEIGHT })), { display: 'flex', justifyContent: 'center', alignItems: 'center' }) }, { children: _jsx(Box, Object.assign({ sx: {
68
63
  backgroundColor: '#F6F8FACC',
69
64
  display: 'flex',
70
65
  justifyContent: 'center',
@@ -41,6 +41,7 @@ export declare const StyledTableBox: import("@emotion/styled").StyledComponent<i
41
41
  }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
42
42
  showBackgroundColor: boolean;
43
43
  showNoDataView: boolean;
44
+ scrollable?: boolean | undefined;
44
45
  }, {}, {}>;
45
46
  export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
46
47
  width?: string | number | undefined;
@@ -305,9 +306,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
305
306
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
306
307
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
307
308
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
309
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
308
310
  src?: string | undefined;
309
311
  alt?: string | undefined;
310
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
311
312
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
312
313
  useMap?: string | undefined;
313
314
  loading?: "eager" | "lazy" | undefined;
@@ -82,8 +82,8 @@ export const StyledTableRow = styled(MUITableRow, {
82
82
  },
83
83
  }))))));
84
84
  export const StyledTableBox = styled(Box, {
85
- shouldForwardProp: (prop) => prop !== 'showBackgroundColor' && prop !== 'showNoDataView',
86
- })(({ theme, showBackgroundColor, showNoDataView }) => ({
85
+ shouldForwardProp: (prop) => prop !== 'showBackgroundColor' && prop !== 'showNoDataView' && prop !== 'scrollable',
86
+ })(({ theme, showBackgroundColor, showNoDataView, scrollable }) => ({
87
87
  position: 'relative',
88
88
  backgroundColor: showBackgroundColor ? theme.palette.background.default : 'transparent',
89
89
  height: '100%',
@@ -91,6 +91,24 @@ export const StyledTableBox = styled(Box, {
91
91
  paddingBottom: showBackgroundColor ? '52px' : '0',
92
92
  display: 'flex',
93
93
  flexDirection: 'column',
94
+ '&:hover': {
95
+ scrollbarWidth: scrollable ? 'auto' : 'none',
96
+ },
97
+ '&::-webkit-scrollbar': {
98
+ display: 'block',
99
+ height: '13px',
100
+ },
101
+ '&::-webkit-scrollbar-track': {
102
+ background: 'white',
103
+ border: '1px solid #F2F2F2',
104
+ },
105
+ '&::-webkit-scrollbar-thumb': {
106
+ backgroundColor: '#DADCDF',
107
+ borderRadius: '32px',
108
+ border: '3px solid transparent',
109
+ backgroundClip: 'content-box',
110
+ minHeight: '20px',
111
+ },
94
112
  }));
95
113
  export const ActionIcon = styled(motion.img)(() => ({
96
114
  width: '24px',
@@ -351,6 +351,8 @@ export declare const agreementInstallmentIcon: string;
351
351
  export declare const agreementSavedCardIcon: string;
352
352
  export declare const agreementSubscriptionIcon: string;
353
353
  export declare const brandPlaceholderIcon: string;
354
+ export declare const usersIcon: string;
355
+ export declare const clipboardIcon: string;
354
356
  export declare const noAgreementIcon: string;
355
357
  export declare const getPaymentMethodsIcon: (source: string) => string;
356
358
  export declare const getCountriesIcon: (source: string) => string;
@@ -352,6 +352,8 @@ export const agreementInstallmentIcon = `${lightUrl}/status/InstallmentAgreement
352
352
  export const agreementSavedCardIcon = `${lightUrl}/status/CardAgreementIcon.svg`;
353
353
  export const agreementSubscriptionIcon = `${lightUrl}/status/SubscriptionAgreementIcon.svg`;
354
354
  export const brandPlaceholderIcon = `${lightUrl}/brandPlaceholder.svg`;
355
+ export const usersIcon = `${lightUrl}/users-icons.svg`;
356
+ export const clipboardIcon = `${lightUrl}/Board-Icons.svg`;
355
357
  export const noAgreementIcon = `${appBaseUrl}/No Agreement.svg`;
356
358
  export const getPaymentMethodsIcon = (source) => `${lightUrl}/payment-method/v2/${source}.svg`;
357
359
  export const getCountriesIcon = (source) => `${lightUrl}/country/${source}.svg`;
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.84",
4
+ "version": "0.0.88",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
7
7
  "module": "build/index.js",