@tap-payments/os-micro-frontend-shared 0.1.290-test.1 → 0.1.290-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.
@@ -1,8 +1,9 @@
1
- import { BoxProps } from '@mui/material/Box';
2
- interface SourceIconProps extends BoxProps {
1
+ type SourceIconProps = {
3
2
  source: string;
4
3
  isTextShown?: boolean;
5
4
  title?: string;
6
- }
7
- export declare function SourceIcon({ source, isTextShown, title, ...props }: SourceIconProps): import("react/jsx-runtime").JSX.Element;
5
+ width?: number | string;
6
+ height?: number | string;
7
+ };
8
+ export declare function SourceIcon({ source, isTextShown, title, width, height }: SourceIconProps): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,29 +1,13 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import camelCase from 'lodash/camelCase';
14
3
  import { useTranslation } from 'react-i18next';
15
- import Box from '@mui/material/Box';
16
4
  import Tooltip from '../../../Tooltip';
17
5
  import { getPaymentMethodsIcon } from '../../../../constants/index.js';
18
- import { StyledBadgeTextWrapper, TextLabel } from '../style';
19
- export function SourceIcon(_a) {
20
- var { source, isTextShown, title } = _a, props = __rest(_a, ["source", "isTextShown", "title"]);
6
+ import { StyledBadgeTextWrapper, StyledSourceImage, TextLabel } from '../style';
7
+ export function SourceIcon({ source, isTextShown, title, width, height }) {
21
8
  const { t } = useTranslation();
22
9
  const ImageSrc = getPaymentMethodsIcon(source);
23
- if (isTextShown) {
24
- return (_jsx(Tooltip, Object.assign({ title: title }, { children: _jsx(StyledBadgeTextWrapper, Object.assign({ "data-testid": "SourceCell_BadgeTextWrapper" }, props, { children: _jsx(TextLabel, Object.assign({ "data-testid": "SourceCell_TextLabel", "data-source": source }, { children: t(camelCase(source)) })) })) })));
25
- }
26
- return (_jsx(Tooltip, Object.assign({ title: title }, { children: _jsx(Box, Object.assign({}, props, { component: "img", src: ImageSrc, alt: source, onError: (e) => {
10
+ return (_jsx(Tooltip, Object.assign({ title: title }, { children: isTextShown ? (_jsx(StyledBadgeTextWrapper, Object.assign({ "data-testid": "SourceCell_BadgeTextWrapper" }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "SourceCell_TextLabel", "data-source": source }, { children: t(camelCase(source)) })) }))) : (_jsx(StyledSourceImage, { src: ImageSrc, alt: source, width: width, height: height, onError: (e) => {
27
11
  e.currentTarget.src = getPaymentMethodsIcon('card');
28
12
  } })) })));
29
13
  }
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
+ export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
3
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
4
5
  hidden?: boolean | undefined;
5
6
  color?: string | undefined;
@@ -265,8 +266,6 @@ export declare const PaymentSourcesContainer: import("@emotion/styled").StyledCo
265
266
  sourcesCount: number;
266
267
  }, {}, {}>;
267
268
  export declare const TextLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
268
- export declare const StyledBadgeTextWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
269
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
270
- }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
269
+ export declare const StyledBadgeTextWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
271
270
  export declare const SourceIconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
272
271
  export declare const CardNumber: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,4 +1,4 @@
1
- import { Box, styled } from '@mui/material';
1
+ import { styled } from '@mui/material';
2
2
  import { motion } from 'framer-motion';
3
3
  export const StyledSourceCell = styled('span')(({ theme }) => ({
4
4
  display: 'flex',
@@ -6,6 +6,10 @@ export const StyledSourceCell = styled('span')(({ theme }) => ({
6
6
  justifyContent: 'flex-start',
7
7
  gap: theme.spacing(1),
8
8
  }));
9
+ export const StyledSourceImage = styled('img')(() => ({
10
+ maxWidth: '24px',
11
+ maxHeight: '16px',
12
+ }));
9
13
  export const PaymentSourcesContainer = styled(motion.span)(({ theme, sourcesCount }) => ({
10
14
  display: 'flex',
11
15
  alignItems: 'center',
@@ -25,7 +29,7 @@ export const TextLabel = styled('span')(({ theme }) => ({
25
29
  padding: '2px 0',
26
30
  color: theme.palette.text.primary,
27
31
  }));
28
- export const StyledBadgeTextWrapper = styled(Box)(() => ({
32
+ export const StyledBadgeTextWrapper = styled('div')(() => ({
29
33
  display: 'flex',
30
34
  alignItems: 'center',
31
35
  justifyContent: 'center',
@@ -10,14 +10,13 @@ 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 TableCell from '../../TableCell';
14
- import { BrandsWrapper, Label } from './style';
15
- import { verificationIcon } from './constants';
16
13
  import Tooltip from '../../../Tooltip';
17
- import { Box } from '@mui/material';
18
14
  import IconWithBadge from '../../../IconWithBadge';
15
+ import TableCell from '../../TableCell';
16
+ import { BrandsWrapper, BrandsWrapperContent, Label } from './style';
17
+ import { verificationIcon } from './constants';
19
18
  export default function BrandsCell(_a) {
20
19
  var { brand, verificationStatus, hideStatus } = _a, props = __rest(_a, ["brand", "verificationStatus", "hideStatus"]);
21
20
  const icon = verificationIcon[verificationStatus !== null && verificationStatus !== void 0 ? verificationStatus : 'incomplete'];
22
- return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Tooltip, Object.assign({ title: brand.name }, { children: _jsx(BrandsWrapper, Object.assign({ sx: { cursor: props.onClick ? 'pointer' : 'default' } }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden', width: '100%' } }, { children: [_jsx(IconWithBadge, { mainIcon: brand.logo, mainIconSize: 16, containerSize: 16, borderColor: "transparent" }), _jsx(Label, Object.assign({ sx: Object.assign({}, (!brand.name && { color: '#B1B1B1' })) }, { children: brand.name || 'Not Available' })), !hideStatus && (_jsx(IconWithBadge, { mainIcon: icon, mainIconSize: 10, containerSize: 10, borderColor: "transparent", containerSx: { marginLeft: 'auto' } }))] })) })) })) })));
21
+ return (_jsx(TableCell, Object.assign({}, props, { children: _jsx(Tooltip, Object.assign({ title: brand.name }, { children: _jsx(BrandsWrapper, Object.assign({ hasClick: !!props.onClick }, { children: _jsxs(BrandsWrapperContent, { children: [_jsx(IconWithBadge, { mainIcon: brand.logo, mainIconSize: 16, containerSize: 16, borderColor: "transparent" }), _jsx(Label, Object.assign({ brandName: brand.name }, { children: brand.name || 'Not Available' })), !hideStatus && (_jsx(IconWithBadge, { mainIcon: icon, mainIconSize: 10, containerSize: 10, borderColor: "transparent", containerSx: { marginLeft: 'auto' } }))] }) })) })) })));
23
22
  }
@@ -1,5 +1,12 @@
1
1
  /// <reference types="react" />
2
- export declare const BrandsWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
2
+ export declare const BrandsWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
3
+ hasClick?: boolean | undefined;
4
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const BrandsWrapperContent: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
3
8
  export declare const BrandName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
9
  export declare const VerificationIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
- export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
10
+ export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
11
+ brandName?: string | undefined;
12
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
@@ -1,12 +1,21 @@
1
1
  import { styled } from '@mui/material';
2
- export const BrandsWrapper = styled('div')(({ theme }) => ({
2
+ import Box from '@mui/material/Box';
3
+ export const BrandsWrapper = styled('div', { shouldForwardProp: (props) => !['hasClick'].includes(props) })(({ theme, hasClick }) => ({
3
4
  display: 'flex',
4
5
  alignItems: 'center',
5
6
  gap: theme.spacing(1),
6
7
  border: '1px solid #F2F2F2',
7
8
  borderRadius: '44px',
8
- padding: '4px 8px',
9
- lineHeight: '120%',
9
+ padding: '3.5px 5px',
10
+ height: '24px',
11
+ cursor: hasClick ? 'pointer' : 'default',
12
+ }));
13
+ export const BrandsWrapperContent = styled(Box)(() => ({
14
+ display: 'flex',
15
+ alignItems: 'center',
16
+ gap: '4px',
17
+ overflow: 'hidden',
18
+ width: '100%',
10
19
  }));
11
20
  export const BrandName = styled('div')(({ theme }) => ({
12
21
  fontSize: '14px',
@@ -17,13 +26,6 @@ export const VerificationIcon = styled('img')(() => ({
17
26
  width: '8px',
18
27
  height: '8px',
19
28
  }));
20
- export const Label = styled('p')(({ theme }) => ({
21
- fontSize: '14px',
22
- fontWeight: 400,
23
- color: theme.palette.text.primary,
24
- overflow: 'hidden',
25
- textOverflow: 'ellipsis',
26
- whiteSpace: 'nowrap',
27
- width: '74px',
28
- margin: '0',
29
- }));
29
+ export const Label = styled('p', { shouldForwardProp: (props) => !['brandName'].includes(props) })(({ theme, brandName }) => (Object.assign({ fontSize: '14px', fontWeight: 400, color: theme.palette.text.primary, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', width: '74px', margin: '0' }, (!brandName && {
30
+ color: '#B1B1B1',
31
+ }))));
@@ -10,15 +10,14 @@ 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 TableCell from '../../TableCell';
14
- import { EntityName, EntityWrapper, VerificationIcon, VerificationContainer } from './style';
15
- import { verificationIcon } from './constants';
16
13
  import Tooltip from '../../../Tooltip';
17
14
  import { CountryFlag } from '../../../index.js';
18
15
  import { getCountryNameByISO } from '../../../../utils/index.js';
19
- import { Box } from '@mui/material';
16
+ import TableCell from '../../TableCell';
17
+ import { EntityName, EntityWrapper, VerificationIcon, VerificationContainer, EntityWrapperContent } from './style';
18
+ import { verificationIcon } from './constants';
20
19
  export default function EntityCell(_a) {
21
20
  var { entity, country, verificationStatus, licenseNumber, hideStatus } = _a, props = __rest(_a, ["entity", "country", "verificationStatus", "licenseNumber", "hideStatus"]);
22
21
  const icon = verificationIcon[verificationStatus !== null && verificationStatus !== void 0 ? verificationStatus : 'incomplete'];
23
- return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: (props === null || props === void 0 ? void 0 : props.onClick) ? 'pointer' : 'default' } }, { children: _jsx(Tooltip, Object.assign({ title: entity }, { children: _jsx(EntityWrapper, Object.assign({ sx: { cursor: props.onClick ? 'pointer' : 'default' } }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden', width: '100%' } }, { children: [_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { countryCode: country }) })), _jsx(EntityName, Object.assign({ sx: Object.assign({}, (!licenseNumber && { color: '#B1B1B1' })) }, { children: licenseNumber || 'Not Available' })), !hideStatus && (_jsx(VerificationContainer, { children: _jsx(VerificationIcon, { src: icon }) }))] })) })) })) })));
22
+ return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: (props === null || props === void 0 ? void 0 : props.onClick) ? 'pointer' : 'default' } }, { children: _jsx(Tooltip, Object.assign({ title: entity }, { children: _jsx(EntityWrapper, Object.assign({ hasClick: !!(props === null || props === void 0 ? void 0 : props.onClick), licenseNumber: licenseNumber }, { children: _jsxs(EntityWrapperContent, { children: [_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { countryCode: country }) })), _jsx(EntityName, Object.assign({ licenseNumber: licenseNumber }, { children: licenseNumber || 'Not Available' })), !hideStatus && (_jsx(VerificationContainer, { children: _jsx(VerificationIcon, { src: icon }) }))] }) })) })) })));
24
23
  }
@@ -1,6 +1,14 @@
1
1
  /// <reference types="react" />
2
- export declare const EntityWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
2
+ export declare const EntityWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
3
+ licenseNumber?: string | undefined;
4
+ hasClick?: boolean | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const EntityWrapperContent: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
7
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
8
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
3
9
  export declare const EntityIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
- export declare const EntityName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const EntityName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
11
+ licenseNumber?: string | undefined;
12
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
13
  export declare const VerificationIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
6
14
  export declare const VerificationContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,27 +1,22 @@
1
1
  import { styled } from '@mui/material';
2
- export const EntityWrapper = styled('div')(({ theme }) => ({
2
+ import Box from '@mui/material/Box';
3
+ export const EntityWrapper = styled('div', { shouldForwardProp: (props) => !['licenseNumber', 'hasClick'].includes(props) })(({ theme, licenseNumber, hasClick }) => (Object.assign({ display: 'flex', alignItems: 'center', gap: theme.spacing(1), border: '1px solid #F2F2F2', borderRadius: '44px', padding: '3.5px 5px', height: '24px', cursor: hasClick ? 'pointer' : 'default' }, (licenseNumber && {
4
+ padding: '3.5px 8px',
5
+ }))));
6
+ export const EntityWrapperContent = styled(Box)(() => ({
3
7
  display: 'flex',
4
8
  alignItems: 'center',
5
- gap: theme.spacing(1),
6
- border: '1px solid #F2F2F2',
7
- borderRadius: '44px',
8
- padding: '4px 8px',
9
- lineHeight: '120%',
9
+ gap: '4px',
10
+ overflow: 'hidden',
11
+ width: '100%',
10
12
  }));
11
13
  export const EntityIcon = styled('img')(() => ({
12
14
  width: '16px',
13
15
  height: '11.73px',
14
16
  }));
15
- export const EntityName = styled('div')(({ theme }) => ({
16
- fontSize: '14px',
17
- fontWeight: 400,
18
- color: theme.palette.text.primary,
19
- overflow: 'hidden',
20
- textOverflow: 'ellipsis',
21
- whiteSpace: 'nowrap',
22
- maxWidth: '100%',
23
- margin: '0',
24
- }));
17
+ export const EntityName = styled('div', { shouldForwardProp: (props) => !['licenseNumber'].includes(props) })(({ theme, licenseNumber }) => (Object.assign({ fontSize: '14px', fontWeight: 400, color: theme.palette.text.primary, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', margin: '0', width: '84px' }, (!licenseNumber && {
18
+ color: '#B1B1B1',
19
+ }))));
25
20
  export const VerificationIcon = styled('img')(() => ({
26
21
  width: '10.5px',
27
22
  height: '10.5px',
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.290-test.1",
5
- "testVersion": 1,
4
+ "version": "0.1.290-test.3",
5
+ "testVersion": 3,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",