@tap-payments/os-micro-frontend-shared 0.1.139-test.21 → 0.1.139-test.26

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,3 +1,3 @@
1
1
  import { AmountCellSheetProps } from './type';
2
- declare function AmountCell({ conversionType, amount, currency, selectionProps, chipIndex }: AmountCellSheetProps): import("react/jsx-runtime").JSX.Element;
3
- export default AmountCell;
2
+ declare function AmountCellSheet({ conversionType, amount, currency, selectionProps, chipIndex }: AmountCellSheetProps): import("react/jsx-runtime").JSX.Element;
3
+ export default AmountCellSheet;
@@ -3,8 +3,8 @@ import { StatusChipWithCopy } from '../../../index.js';
3
3
  import { formatAmountWithCurrency } from '../../../../utils/index.js';
4
4
  import { ConversionTypeLabel, CurrencyInfo } from './components';
5
5
  const tableMode = 'sheet';
6
- function AmountCell({ conversionType, amount, currency, selectionProps = {}, chipIndex = 0 }) {
6
+ function AmountCellSheet({ conversionType, amount, currency, selectionProps = {}, chipIndex = 0 }) {
7
7
  const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
8
8
  return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: chipIndex, copyText: amount ? `${integerAmount}.${decimalAmount}` : '-', selectionProps: selectionProps }, { children: [_jsx(ConversionTypeLabel, { tableMode: tableMode, conversionType: conversionType }), _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency })] })));
9
9
  }
10
- export default AmountCell;
10
+ export default AmountCellSheet;
@@ -1,3 +1,3 @@
1
1
  import { AmountCellProps } from './type';
2
- declare function AmountCell({ conversionType, amount, currency, tooltipLabel, amountTooltipLabel, ...props }: AmountCellProps): import("react/jsx-runtime").JSX.Element;
3
- export default AmountCell;
2
+ declare function AmountCellText({ conversionType, amount, currency, tooltipLabel, amountTooltipLabel, ...props }: AmountCellProps): import("react/jsx-runtime").JSX.Element;
3
+ export default AmountCellText;
@@ -16,8 +16,8 @@ import { CurrencyIcon } from '../../../index.js';
16
16
  import { AmountCellContainer } from './style';
17
17
  import { ConversionTypeLabel, CurrencyInfo } from './components';
18
18
  const tableMode = 'text';
19
- function AmountCell(_a) {
19
+ function AmountCellText(_a) {
20
20
  var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel"]);
21
21
  return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: _jsx(ConversionTypeLabel, { tableMode: tableMode, conversionType: conversionType }) })), _jsx(Tooltip, Object.assign({ title: _jsx(CurrencyIcon, { currency: currency }) }, { children: _jsx("span", {}) })), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency }) }))] }) })));
22
22
  }
23
- export default AmountCell;
23
+ export default AmountCellText;
@@ -1,5 +1,5 @@
1
1
  export { default as AmountCell } from './AmountCell';
2
+ export { AmountConversionTooltipLabel } from './components';
2
3
  export { default as AmountCellText } from './AmountCellText';
3
4
  export { default as AmountCellSheet } from './AmountCellSheet';
4
- export { AmountConversionTooltipLabel } from './components/AmountConversionTooltipLabel';
5
5
  export * from './style';
@@ -1,5 +1,5 @@
1
1
  export { default as AmountCell } from './AmountCell';
2
+ export { AmountConversionTooltipLabel } from './components';
2
3
  export { default as AmountCellText } from './AmountCellText';
3
4
  export { default as AmountCellSheet } from './AmountCellSheet';
4
- export { AmountConversionTooltipLabel } from './components/AmountConversionTooltipLabel';
5
5
  export * from './style';
@@ -1,3 +1,3 @@
1
- import type { CustomerCellProps } from '../type';
2
- declare function CustomerCell({ customerInitiated, children, isTimezoneIconShown, hasCustomerIcon, customerIcon, customerName, hideCustomerInitiatedIcon, hideTimezoneIcon, phone, email, id, tableMode, ...props }: Readonly<CustomerCellProps>): import("react/jsx-runtime").JSX.Element;
1
+ import type { CustomerCellProps } from './type';
2
+ declare function CustomerCell({ customerInitiated, children, isTimezoneIconShown, hasCustomerIcon, customerIcon, customerName, hideCustomerInitiatedIcon, hideTimezoneIcon, phone, email, id, ...props }: Readonly<CustomerCellProps>): import("react/jsx-runtime").JSX.Element;
3
3
  export default CustomerCell;
@@ -15,12 +15,12 @@ import { useTranslation } from 'react-i18next';
15
15
  import Tooltip from '../../../Tooltip';
16
16
  import { merchantInitiatedIcon, timezoneIcon } from '../../../../constants/index.js';
17
17
  import { getRandomGradientColor, isArabic } from '../../../../utils/index.js';
18
- import { StyledCustomerCell, StyledCustomerIcon, StyledCustomerIconContainer, StyledCustomerName } from './style';
19
18
  import { TableCell } from '../../../TableCells';
19
+ import { StyledCustomerCell, StyledCustomerIcon, StyledCustomerIconContainer, StyledCustomerName } from './style';
20
20
  import { AvatarStyled, StarBadgeWrapper } from '../style';
21
21
  function CustomerCell(_a) {
22
22
  var _b;
23
- var { customerInitiated, children, isTimezoneIconShown, hasCustomerIcon, customerIcon, customerName, hideCustomerInitiatedIcon, hideTimezoneIcon, phone, email, id, tableMode } = _a, props = __rest(_a, ["customerInitiated", "children", "isTimezoneIconShown", "hasCustomerIcon", "customerIcon", "customerName", "hideCustomerInitiatedIcon", "hideTimezoneIcon", "phone", "email", "id", "tableMode"]);
23
+ var { customerInitiated, children, isTimezoneIconShown, hasCustomerIcon, customerIcon, customerName, hideCustomerInitiatedIcon, hideTimezoneIcon, phone, email, id } = _a, props = __rest(_a, ["customerInitiated", "children", "isTimezoneIconShown", "hasCustomerIcon", "customerIcon", "customerName", "hideCustomerInitiatedIcon", "hideTimezoneIcon", "phone", "email", "id"]);
24
24
  const { t } = useTranslation();
25
25
  const customerInitiatedTooltip = customerInitiated === false ? t('merchantInitiated') : '';
26
26
  const isArabicCustomerName = isArabic(customerName);
@@ -38,9 +38,6 @@ function CustomerCell(_a) {
38
38
  return null;
39
39
  return (_jsx("div", Object.assign({ "data-testid": "CustomerCell_customerTooltip" }, { children: tooltipOptions.map(({ name, value }) => value && (_jsx("div", Object.assign({ "data-testid": `CustomerCell_customerTooltip_${name}` }, { children: name === 'Name' ? value : `${name}: ${value}` }), value))) })));
40
40
  }, [tooltipOptions]);
41
- if (tableMode === 'sheet') {
42
- return (_jsx(StyledCustomerName, Object.assign({ tableMode: tableMode, "data-testid": "CustomerCell_StyledCustomerName", "data-is-arabic": isArabicCustomerName }, { children: children })));
43
- }
44
41
  return (_jsx(TableCell, Object.assign({}, props, { "data-testid": "CustomerCell_TableCell" }, { children: _jsxs(StyledCustomerCell, Object.assign({ "data-testid": "CustomerCell_StyledCustomerCell" }, { children: [customerShownIcon, _jsx(Tooltip, Object.assign({ title: customerTooltip }, { children: _jsx(StyledCustomerName, Object.assign({ "data-testid": "CustomerCell_StyledCustomerName", "data-is-arabic": isArabicCustomerName }, { children: children })) })), !hideTimezoneIcon && (_jsx(StyledCustomerIconContainer, Object.assign({ "data-testid": "CustomerCell_StyledCustomerIconContainer" }, { children: isTimezoneIconShown && _jsx(StyledCustomerIcon, { src: timezoneIcon, "data-testid": "CustomerCell_StyledCustomerIcon" }) }))), !hideCustomerInitiatedIcon && (_jsx(Tooltip, Object.assign({ title: customerInitiatedTooltip }, { children: _jsx(StarBadgeWrapper, Object.assign({ "data-testid": "CustomerCell_StarBadgeWrapper", className: "geography-box", isShown: !!customerInitiatedTooltip }, { children: customerInitiatedTooltip && (_jsx("img", { "data-testid": "CustomerCell_merchantInitiatedIcon", src: merchantInitiatedIcon, alt: "merchant", style: {
45
42
  width: '16px',
46
43
  height: '16px',
@@ -0,0 +1,3 @@
1
+ import type { CustomerCellSheetProps } from './type';
2
+ declare function CustomerCellSheet({ children, customerName }: CustomerCellSheetProps): import("react/jsx-runtime").JSX.Element;
3
+ export default CustomerCellSheet;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { isArabic } from '../../../../utils/index.js';
3
+ import { StyledCustomerName } from './style';
4
+ function CustomerCellSheet({ children, customerName }) {
5
+ const isArabicCustomerName = isArabic(customerName);
6
+ return (_jsx(StyledCustomerName, Object.assign({ tableMode: "sheet", "data-testid": "CustomerCell_StyledCustomerName", "data-is-arabic": isArabicCustomerName }, { children: children })));
7
+ }
8
+ export default CustomerCellSheet;
@@ -1,2 +1,3 @@
1
1
  export { default as CustomerCell } from './CustomerCell';
2
+ export { default as CustomerCellSheet } from './CustomerCellSheet';
2
3
  export * from './type';
@@ -1,2 +1,3 @@
1
1
  export { default as CustomerCell } from './CustomerCell';
2
+ export { default as CustomerCellSheet } from './CustomerCellSheet';
2
3
  export * from './type';
@@ -1,4 +1,19 @@
1
+ import type { TableCellProps } from '@mui/material';
1
2
  export type TooltipOption = {
2
3
  name: string;
3
4
  value?: string;
4
5
  };
6
+ export interface CustomerCellProps extends TableCellProps {
7
+ customerInitiated?: boolean;
8
+ flagIcon?: string;
9
+ isTimezoneIconShown?: boolean;
10
+ hasCustomerIcon?: boolean;
11
+ customerIcon?: string;
12
+ customerName: string;
13
+ hideCustomerInitiatedIcon?: boolean;
14
+ hideTimezoneIcon?: boolean;
15
+ email?: string;
16
+ phone?: string;
17
+ id?: string;
18
+ }
19
+ export type CustomerCellSheetProps = Pick<CustomerCellProps, 'customerName' | 'children'>;
@@ -1,8 +1,8 @@
1
1
  import type React from 'react';
2
2
  import type { TableCellProps } from '@mui/material';
3
3
  import type { Charge, SelectionProps, TableMode } from '../../../types/index.js';
4
- import type { ActionType, FlagType } from './ActionCell';
5
4
  import { getGeographyBoxColor } from '../../../utils/index.js';
5
+ import type { ActionType, FlagType } from './ActionCell';
6
6
  export type GeographyBoxVariant = keyof ReturnType<typeof getGeographyBoxColor>;
7
7
  export type PaymentMethod = 'VISA' | 'card' | 'MASTERCARD' | 'APPLE_PAY' | 'KNET' | 'MADA';
8
8
  export interface DateCellProps extends TableCellProps {
@@ -22,20 +22,6 @@ export interface OrderCellProps extends TableCellProps {
22
22
  }>;
23
23
  tableMode?: TableMode;
24
24
  }
25
- export interface CustomerCellProps extends TableCellProps {
26
- customerInitiated?: boolean;
27
- flagIcon?: string;
28
- isTimezoneIconShown?: boolean;
29
- hasCustomerIcon?: boolean;
30
- customerIcon?: string;
31
- customerName: string;
32
- hideCustomerInitiatedIcon?: boolean;
33
- hideTimezoneIcon?: boolean;
34
- email?: string;
35
- phone?: string;
36
- id?: string;
37
- tableMode?: TableMode;
38
- }
39
25
  export interface SourceCellProps extends TableCellProps {
40
26
  geographyVariant?: 'G' | 'L' | 'R';
41
27
  flagIcon?: string;
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.139-test.21",
5
- "testVersion": 21,
4
+ "version": "0.1.139-test.26",
5
+ "testVersion": 26,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",