@tap-payments/os-micro-frontend-shared 0.1.243-test.1 → 0.1.243-test.3

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.
@@ -11,7 +11,7 @@ const Menu = ({ selectedCurrency, option, closeDropdown, handleSelectOption }) =
11
11
  handleSelectOption(option.value, option === null || option === void 0 ? void 0 : option.currency);
12
12
  }
13
13
  closeDropdown();
14
- } }, { children: [_jsx(EnglishAmount, Object.assign({ showBottomPadding: true, showWarning: false }, { children: t(option.name) })), _jsxs(DropDownChargeGapColumn, { children: [_jsxs(StyledIconRowContainer, Object.assign({ marginRightAuto: true }, { children: [_jsx(CurrencyCountryFlag, { code: (_a = option === null || option === void 0 ? void 0 : option.currency) !== null && _a !== void 0 ? _a : selectedCurrency }), _jsx(StyledCurrency, { children: (_b = option === null || option === void 0 ? void 0 : option.currency) !== null && _b !== void 0 ? _b : selectedCurrency })] })), _jsx(StyledTextAmount, Object.assign({ showWarning: false }, { children: intlCurrency(option.value || 0, (_c = option === null || option === void 0 ? void 0 : option.currency) !== null && _c !== void 0 ? _c : selectedCurrency) }))] })] })));
14
+ } }, { children: [_jsx(EnglishAmount, Object.assign({ showBottomPadding: true, showWarning: false }, { children: t(option.name) })), _jsxs(DropDownChargeGapColumn, { children: [_jsxs(StyledIconRowContainer, Object.assign({ marginRightAuto: true }, { children: [_jsx(CurrencyCountryFlag, { code: (_a = option === null || option === void 0 ? void 0 : option.currency) !== null && _a !== void 0 ? _a : selectedCurrency, width: "0.76rem" }), _jsx(StyledCurrency, { children: (_b = option === null || option === void 0 ? void 0 : option.currency) !== null && _b !== void 0 ? _b : selectedCurrency })] })), _jsx(StyledTextAmount, Object.assign({ showWarning: false }, { children: intlCurrency(option.value || 0, (_c = option === null || option === void 0 ? void 0 : option.currency) !== null && _c !== void 0 ? _c : selectedCurrency) }))] })] })));
15
15
  };
16
16
  function ActionMenuDropDown({ menuAnchor, showDropDown, selectedCurrency, options, closeDropdown, handleSelectOption }) {
17
17
  if (options.length <= 1)
@@ -15,6 +15,6 @@ function ActionMenuItem({ showWarning, selectedCurrency, onAmountChange, amount,
15
15
  iconRef.current.click();
16
16
  }
17
17
  };
18
- return (_jsxs(_Fragment, { children: [_jsxs(Charge, { children: [_jsx(EnglishAmount, Object.assign({ showBottomPadding: true, showWarning: showWarning }, { children: t('amount') })), _jsxs(StyledIconRowContainer, Object.assign({ limited: true, paddingTop: true, onClick: onClickMissingDiv }, { children: [_jsx(CurrencyCountryFlag, { code: selectedCurrency }), _jsx(StyledCurrency, { children: _jsx(CurrencyIcon, { currency: selectedCurrency }) }), !showWarning && showDropdownIcon && (_jsx(StyledDropDownIcon, { src: !showDropDown ? blueDropdownArrowIcon : greyDropdownIcon, alt: "drop-down icon", currencyPadding: true }))] }))] }), _jsx(StyledMissingDiv, { ref: iconRef, onClick: toggleDropDown }), isLoading ? (_jsx(Skeleton, { variant: "text", width: "100%", height: "100%" })) : (_jsx(StyledAmount, { disabled: disabled, placeholder: currencyConfig[selectedCurrency] ? '0.000' : '0.00', onValueChange: onAmountChange, value: amount, decimalsLimit: (_a = currencyConfig[selectedCurrency]) !== null && _a !== void 0 ? _a : 2, showWarning: showWarning || false, decimalScale: (_b = currencyConfig[selectedCurrency]) !== null && _b !== void 0 ? _b : 2, autoFocus: true }))] }));
18
+ return (_jsxs(_Fragment, { children: [_jsxs(Charge, { children: [_jsx(EnglishAmount, Object.assign({ showBottomPadding: true, showWarning: showWarning }, { children: t('amount') })), _jsxs(StyledIconRowContainer, Object.assign({ limited: true, paddingTop: true, onClick: onClickMissingDiv }, { children: [_jsx(CurrencyCountryFlag, { code: selectedCurrency, width: "0.76rem" }), _jsx(StyledCurrency, { children: _jsx(CurrencyIcon, { currency: selectedCurrency }) }), !showWarning && showDropdownIcon && (_jsx(StyledDropDownIcon, { src: !showDropDown ? blueDropdownArrowIcon : greyDropdownIcon, alt: "drop-down icon", currencyPadding: true }))] }))] }), _jsx(StyledMissingDiv, { ref: iconRef, onClick: toggleDropDown }), isLoading ? (_jsx(Skeleton, { variant: "text", width: "100%", height: "100%" })) : (_jsx(StyledAmount, { disabled: disabled, placeholder: currencyConfig[selectedCurrency] ? '0.000' : '0.00', onValueChange: onAmountChange, value: amount, decimalsLimit: (_a = currencyConfig[selectedCurrency]) !== null && _a !== void 0 ? _a : 2, showWarning: showWarning || false, decimalScale: (_b = currencyConfig[selectedCurrency]) !== null && _b !== void 0 ? _b : 2, autoFocus: true }))] }));
19
19
  }
20
20
  export default ActionMenuItem;
@@ -2,4 +2,4 @@ export declare const GeographyIcon: ({ geographyVariant, countryCode, isTextShow
2
2
  geographyVariant?: "G" | "L" | "R" | undefined;
3
3
  countryCode?: string | undefined;
4
4
  isTextShown?: boolean | undefined;
5
- }) => import("react/jsx-runtime").JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import CountryFlag from '../../CountryFlag';
3
3
  import Tooltip from '../../Tooltip';
4
- import { GeographyBox } from './style';
5
4
  const geographyMap = {
6
5
  G: 'Global',
7
6
  R: 'Regional',
@@ -12,8 +11,7 @@ export const GeographyIcon = ({ geographyVariant, countryCode, isTextShown, }) =
12
11
  const tooltip = geographyTooltip || countryCode
13
12
  ? `${geographyTooltip || ''} ${geographyTooltip && countryCode ? `-` : ''} ${countryCode ? `${countryCode}` : ''}`
14
13
  : undefined;
15
- const icon = countryCode && _jsx(CountryFlag, { code: countryCode });
16
- return (_jsx(Tooltip, Object.assign({ title: tooltip }, { children: _jsx(GeographyBox, Object.assign({ variant: geographyVariant ? geographyMap[geographyVariant] : undefined, className: "geography-box", "data-testid": "SourceCell_GeographyBox", sx: {
17
- visibility: 'visible',
18
- } }, { children: isTextShown ? null : icon })) })));
14
+ if (isTextShown || !countryCode)
15
+ return null;
16
+ return (_jsx(Tooltip, Object.assign({ title: tooltip }, { children: _jsx(CountryFlag, { code: countryCode }) })));
19
17
  };
@@ -16,15 +16,11 @@ import { TableCell } from '../../../TableCells';
16
16
  import { walletIcon } from '../../../../constants/index.js';
17
17
  import { getCountryNameByISO } from '../../../../utils/index.js';
18
18
  import { WalletCellContainer, WalletIcon, WalletIdContainer, WalletWrapper } from './style';
19
- import { GeographyBox, StatusIconWrapper } from '../style';
20
19
  function WalletCell(_a) {
21
20
  var { walletId, country, showCountry = true } = _a, props = __rest(_a, ["walletId", "country", "showCountry"]);
22
- const icon = country && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { code: country, sx: { padding: '1px' } }) })));
23
21
  return (_jsx(TableCell, Object.assign({ style: {
24
22
  textAlign: 'center',
25
23
  overflow: 'visible',
26
- } }, props, { children: _jsxs(WalletCellContainer, { children: [showCountry && (_jsx(StatusIconWrapper, { children: _jsx(Tooltip, Object.assign({ title: country ? getCountryNameByISO(country) : '' }, { children: _jsx(GeographyBox, Object.assign({ sx: {
27
- visibility: 'visible',
28
- }, variant: undefined }, { children: icon })) })) })), _jsxs(WalletWrapper, { children: [_jsx(WalletIcon, { src: walletIcon, alt: "wallet-icon" }), walletId && _jsxs(WalletIdContainer, { children: ["\u00B7\u00B7\u00B7\u00B7 ", walletId === null || walletId === void 0 ? void 0 : walletId.substring(((walletId === null || walletId === void 0 ? void 0 : walletId.length) || 0) - 4)] })] })] }) })));
24
+ } }, props, { children: _jsxs(WalletCellContainer, { children: [showCountry && country && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { code: country }) }))), _jsxs(WalletWrapper, { children: [_jsx(WalletIcon, { src: walletIcon, alt: "wallet-icon" }), walletId && _jsxs(WalletIdContainer, { children: ["\u00B7\u00B7\u00B7\u00B7 ", walletId === null || walletId === void 0 ? void 0 : walletId.substring(((walletId === null || walletId === void 0 ? void 0 : walletId.length) || 0) - 4)] })] })] }) })));
29
25
  }
30
26
  export default WalletCell;
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.243-test.1",
5
- "testVersion": 1,
4
+ "version": "0.1.243-test.3",
5
+ "testVersion": 3,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",