@tap-payments/os-micro-frontend-shared 0.1.271-test.7 → 0.1.271-test.8

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.
@@ -4,5 +4,6 @@ interface CountryFlagProps extends BoxProps {
4
4
  countryCode?: string;
5
5
  currencyCode?: string;
6
6
  }
7
- declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<CountryFlagProps, "ref"> & import("react").RefAttributes<HTMLImageElement>>>;
7
+ declare function CountryFlag({ countryCode, currencyCode, ...props }: CountryFlagProps): import("react/jsx-runtime").JSX.Element;
8
+ declare const _default: import("react").MemoExoticComponent<typeof CountryFlag>;
8
9
  export default _default;
@@ -10,14 +10,14 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { memo, forwardRef } from 'react';
13
+ import { memo } from 'react';
14
14
  import Box from '@mui/material/Box';
15
15
  import { defaultCountryIcon, getCountriesIcon, getCurrenciesIcon } from '../../constants/index.js';
16
- const CountryFlag = forwardRef((_a, ref) => {
16
+ function CountryFlag(_a) {
17
17
  var _b;
18
- var { countryCode, currencyCode, width = 16 } = _a, props = __rest(_a, ["countryCode", "currencyCode", "width"]);
19
- return (_jsx(Box, Object.assign({ ref: ref, component: "img", src: (countryCode && getCountriesIcon(countryCode)) || (currencyCode && getCurrenciesIcon(currencyCode)) || defaultCountryIcon, width: width, alt: (_b = countryCode !== null && countryCode !== void 0 ? countryCode : currencyCode) !== null && _b !== void 0 ? _b : 'flag', loading: "lazy", onError: (e) => {
18
+ var { countryCode, currencyCode } = _a, props = __rest(_a, ["countryCode", "currencyCode"]);
19
+ return (_jsx(Box, Object.assign({}, props, { component: "img", src: (countryCode && getCountriesIcon(countryCode)) || (currencyCode && getCurrenciesIcon(currencyCode)) || defaultCountryIcon, width: props.width || 16, alt: (_b = countryCode !== null && countryCode !== void 0 ? countryCode : currencyCode) !== null && _b !== void 0 ? _b : 'flag', loading: "lazy", onError: (e) => {
20
20
  e.currentTarget.src = defaultCountryIcon;
21
- } }, props)));
22
- });
21
+ } })));
22
+ }
23
23
  export default memo(CountryFlag);
@@ -10,6 +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 { Box } from '@mui/material';
13
14
  import { TableCell } from '../../../TableCells';
14
15
  import Tooltip from '../../../Tooltip';
15
16
  import { CountryFlag, CurrencySymbol } from '../../../index.js';
@@ -18,6 +19,6 @@ import { ConversionTypeLabel, CurrencyInfo } from './components';
18
19
  const tableMode = 'default';
19
20
  function AmountCell(_a) {
20
21
  var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel"]);
21
- return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: _jsx(ConversionTypeLabel, { tableMode: tableMode, conversionType: conversionType }) })), currency && (_jsx(Tooltip, Object.assign({ title: _jsx(CurrencySymbol, { currency: currency }) }, { children: _jsx(CountryFlag, { currencyCode: currency }) }))), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency }) }))] }) })));
22
+ return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: _jsx(Box, { children: _jsx(ConversionTypeLabel, { tableMode: tableMode, conversionType: conversionType }) }) })), currency && (_jsx(Tooltip, Object.assign({ title: _jsx(CurrencySymbol, { currency: currency }) }, { children: _jsx(CountryFlag, { currencyCode: currency }) }))), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencyInfo, { tableMode: tableMode, amount: amount, currency: currency }) }))] }) })));
22
23
  }
23
24
  export default AmountCell;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  type: 'fx' | 'dcc' | undefined;
4
3
  selectAmount?: number;
@@ -8,5 +7,5 @@ type Props = {
8
7
  merchantAmount?: number;
9
8
  merchantCurrency?: string;
10
9
  };
11
- export declare const AmountConversionTooltipLabel: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
10
+ export declare const AmountConversionTooltipLabel: ({ type, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency, }: Props) => import("react/jsx-runtime").JSX.Element;
12
11
  export {};
@@ -2,12 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { conversionTypesLabels, formatAmountWithCurrency } from '../../../../../utils/index.js';
3
3
  import { CurrencySymbol } from '../../../../index.js';
4
4
  import { ConversionTooltip, ConversionTooltipRow } from '../style';
5
- import { forwardRef } from 'react';
6
- export const AmountConversionTooltipLabel = forwardRef(({ type, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency }, ref) => {
5
+ export const AmountConversionTooltipLabel = ({ type, selectAmount, selectCurrency, requestAmount, requestCurrency, merchantAmount, merchantCurrency, }) => {
7
6
  const customerSelectValue = formatAmountWithCurrency(selectAmount, selectCurrency);
8
7
  const chargeValue = formatAmountWithCurrency(requestAmount, requestCurrency);
9
8
  const settlementValue = formatAmountWithCurrency(merchantAmount, merchantCurrency);
10
- return (_jsxs(ConversionTooltip, Object.assign({ ref: ref, sx: { textAlign: 'right', justifyContent: 'flex-end' } }, { children: [_jsx("span", Object.assign({ style: {
9
+ return (_jsxs(ConversionTooltip, Object.assign({ sx: {
10
+ textAlign: 'right',
11
+ justifyContent: 'flex-end',
12
+ } }, { children: [_jsx("span", Object.assign({ style: {
11
13
  fontWeight: 'bold',
12
14
  } }, { children: type ? conversionTypesLabels[type] : '' })), _jsxs(ConversionTooltip, { children: [type !== 'fx' && (_jsxs(ConversionTooltipRow, { children: [_jsx("span", { children: "Customer Selected" }), ' ', _jsxs("span", { children: [_jsx(CurrencySymbol, { currency: selectCurrency }), " ", customerSelectValue.integerAmount, ".", customerSelectValue.decimalAmount] })] })), _jsxs(ConversionTooltipRow, { children: [_jsx("span", { children: "Charge" }), ' ', _jsxs("span", { children: [_jsx(CurrencySymbol, { currency: requestCurrency }), " ", chargeValue.integerAmount, ".", chargeValue.decimalAmount] })] }), _jsxs(ConversionTooltipRow, { children: [_jsx("span", { children: "Settlement" }), ' ', _jsxs("span", { children: [_jsx(CurrencySymbol, { currency: merchantCurrency }), " ", settlementValue.integerAmount, ".", settlementValue.decimalAmount] })] })] })] })));
13
- });
15
+ };
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { TableMode } from '../../../../../types/index.js';
3
2
  import { AmountCellProps } from '../type';
4
3
  interface ConversionTypeLabelProps extends Pick<AmountCellProps, 'conversionType'> {
5
4
  tableMode: TableMode;
6
5
  }
7
- export declare const ConversionTypeLabel: import("react").ForwardRefExoticComponent<ConversionTypeLabelProps & import("react").RefAttributes<HTMLSpanElement>>;
6
+ export declare const ConversionTypeLabel: ({ tableMode, conversionType }: ConversionTypeLabelProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export {};
@@ -1,8 +1,7 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ConversionBadge } from '../style';
3
- import { forwardRef } from 'react';
4
- export const ConversionTypeLabel = forwardRef(({ tableMode, conversionType }, ref) => {
3
+ export const ConversionTypeLabel = ({ tableMode, conversionType }) => {
5
4
  if (!conversionType)
6
5
  return _jsx(_Fragment, {});
7
- return (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type", ref: ref }, { children: conversionType })));
8
- });
6
+ return (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type" }, { children: conversionType })));
7
+ };
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
1
  import { TableMode } from '../../../../../types/index.js';
3
2
  import { AmountCellProps } from '../type';
4
3
  interface CurrencyInfoProps extends Pick<AmountCellProps, 'amount' | 'currency'> {
5
4
  tableMode: TableMode;
6
5
  }
7
- export declare const CurrencyInfo: import("react").ForwardRefExoticComponent<CurrencyInfoProps & import("react").RefAttributes<HTMLSpanElement>>;
6
+ export declare const CurrencyInfo: ({ tableMode, amount, currency }: CurrencyInfoProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export {};
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
2
  import { CurrencySymbol } from '../../../../index.js';
4
- import { formatAmountWithCurrency } from '../../../../../utils/index.js';
5
3
  import { CurrencySpan, DecimalSpan } from '../style';
6
- export const CurrencyInfo = forwardRef(({ tableMode, amount, currency }, ref) => {
4
+ import { formatAmountWithCurrency } from '../../../../../utils/index.js';
5
+ export const CurrencyInfo = ({ tableMode, amount, currency }) => {
7
6
  const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
8
- return (_jsx(CurrencySpan, Object.assign({ tableMode: tableMode, ref: ref }, { children: amount !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { children: _jsx(CurrencySymbol, { currency: currency, fontSize: 10 }) }), ' ', integerAmount, decimalAmount && (_jsxs(_Fragment, { children: [".", _jsx(DecimalSpan, { children: decimalAmount })] }))] })) : (_jsx("span", { children: "-" })) })));
9
- });
7
+ return (_jsx(CurrencySpan, Object.assign({ tableMode: tableMode }, { children: amount !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { children: _jsx(CurrencySymbol, { currency: currency, fontSize: 10 }) }), ' ', integerAmount, decimalAmount && (_jsxs(_Fragment, { children: [".", _jsx(DecimalSpan, { children: decimalAmount })] }))] })) : (_jsx("span", { children: "-" })) })));
8
+ };
@@ -9,10 +9,11 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import Box from '@mui/material/Box';
13
14
  import { StyledTooltip } from './styles';
14
15
  function Tooltip(_a) {
15
16
  var { className, title, placement = 'top', children } = _a, rest = __rest(_a, ["className", "title", "placement", "children"]);
16
- return (_jsx(StyledTooltip, Object.assign({ classes: { popper: className }, title: title, placement: placement, arrow: true }, rest, { children: children || _jsx(_Fragment, {}) })));
17
+ return (_jsx(StyledTooltip, Object.assign({ classes: { popper: className }, title: title, placement: placement, arrow: true }, rest, { children: _jsx(Box, Object.assign({ display: "flex", component: "span" }, { children: children })) })));
17
18
  }
18
19
  export default Tooltip;
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.271-test.7",
5
- "testVersion": 7,
4
+ "version": "0.1.271-test.8",
5
+ "testVersion": 8,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",