@tap-payments/os-micro-frontend-shared 0.1.308-test.1 → 0.1.308-test.2
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.
- package/build/components/StatusIcons/IssuerIcon/IssuerIcon.js +1 -2
- package/build/components/StatusIcons/SourceIcons/components/SourceIcon.d.ts +5 -4
- package/build/components/StatusIcons/SourceIcons/components/SourceIcon.js +3 -19
- package/build/components/StatusIcons/SourceIcons/style.d.ts +2 -3
- package/build/components/StatusIcons/SourceIcons/style.js +6 -2
- package/build/components/TableCells/CustomCells/BrandsCell/BrandsCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/BrandsCell/BrandsCell.js +2 -2
- package/build/components/TableCells/CustomCells/BrandsCell/type.d.ts +2 -1
- package/package.json +2 -2
|
@@ -5,6 +5,5 @@ import Tooltip from '../../Tooltip';
|
|
|
5
5
|
export default function IssuerIcon({ countryCode, isTextShown, cardNumber, bankName, tableMode }) {
|
|
6
6
|
const firstFourDigits = cardNumber === null || cardNumber === void 0 ? void 0 : cardNumber.slice(0, 4);
|
|
7
7
|
const lastFourDigits = cardNumber === null || cardNumber === void 0 ? void 0 : cardNumber.slice(-4);
|
|
8
|
-
return (_jsxs(IssuerIconContainer, Object.assign({ tableMode: tableMode }, { children: [countryCode && _jsx(GeographyIcon, { countryCode: countryCode, isTextShown: isTextShown }), firstFourDigits ||
|
|
9
|
-
(lastFourDigits && (_jsx(Tooltip, Object.assign({ title: `${bankName ? `Issuer - ${bankName}` : ''}` }, { children: _jsx(CardNumber, { children: `${firstFourDigits || ''} ${lastFourDigits || ''}` }) }))))] })));
|
|
8
|
+
return (_jsxs(IssuerIconContainer, Object.assign({ tableMode: tableMode }, { children: [countryCode && _jsx(GeographyIcon, { countryCode: countryCode, isTextShown: isTextShown }), _jsx(Tooltip, Object.assign({ title: `${bankName ? `Issuer - ${bankName}` : ''}` }, { children: _jsx(CardNumber, { children: `${firstFourDigits || ''} ${lastFourDigits || ''}` }) }))] })));
|
|
10
9
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
interface SourceIconProps extends BoxProps {
|
|
1
|
+
type SourceIconProps = {
|
|
3
2
|
source: string;
|
|
4
3
|
isTextShown?: boolean;
|
|
5
4
|
title?: string;
|
|
6
|
-
|
|
7
|
-
|
|
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(
|
|
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
|
-
|
|
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").
|
|
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 {
|
|
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(
|
|
32
|
+
export const StyledBadgeTextWrapper = styled('div')(() => ({
|
|
29
33
|
display: 'flex',
|
|
30
34
|
alignItems: 'center',
|
|
31
35
|
justifyContent: 'center',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BrandsCellProps } from './type';
|
|
2
|
-
export default function BrandsCell({ brand, verificationStatus, hideStatus, ...props }: BrandsCellProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function BrandsCell({ brand, verificationStatus, hideStatus, brandLogo, ...props }: BrandsCellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,7 @@ import TableCell from '../../TableCell';
|
|
|
16
16
|
import { BrandsWrapper, BrandsWrapperContent, Label } from './style';
|
|
17
17
|
import { verificationIcon } from './constants';
|
|
18
18
|
export default function BrandsCell(_a) {
|
|
19
|
-
var { brand, verificationStatus, hideStatus } = _a, props = __rest(_a, ["brand", "verificationStatus", "hideStatus"]);
|
|
19
|
+
var { brand, verificationStatus, hideStatus, brandLogo } = _a, props = __rest(_a, ["brand", "verificationStatus", "hideStatus", "brandLogo"]);
|
|
20
20
|
const icon = verificationIcon[verificationStatus !== null && verificationStatus !== void 0 ? verificationStatus : 'incomplete'];
|
|
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: [
|
|
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: [brandLogo, _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' } }))] }) })) })) })));
|
|
22
22
|
}
|
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.308-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.308-test.2",
|
|
5
|
+
"testVersion": 2,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|