@tap-payments/os-micro-frontend-shared 0.1.47 → 0.1.48-test.1
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/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/style.js +0 -2
- package/build/components/StatusIcons/SourceIcons/SourceIcons.js +3 -6
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.js +4 -1
- package/package.json +3 -3
|
@@ -20,7 +20,6 @@ function RightLeftExpandingCenterChip(_a) {
|
|
|
20
20
|
return (_jsx(Box, Object.assign({}, props, { "data-testid": "RightLeftExpandingCenterChipBox", sx: tableCellSx }, { children: _jsx(CenterShiftWrapper, Object.assign({ "data-testid": "CenterShiftWrapper", initial: false, style: { x: shiftX } }, { children: _jsxs(CenterIconWrapper, Object.assign({ "data-testid": "CenterIconWrapper", ref: centerWrapRef, onMouseLeave: handleMouseLeave }, { children: [_jsxs(PeekContainer, Object.assign({ "data-testid": "PeekContainer" }, { children: [_jsx(AnimatePresence, Object.assign({ initial: false }, { children: leftIcons.length > 0 && (_jsx(LeftPeekChip, { "data-testid": "LeftPeekChip", initial: { opacity: 0, scale: 0.95, x: -4 }, animate: isHovering ? { opacity: 0, scale: 0.9, x: -6 } : { opacity: 1, scale: 1, x: -5 }, exit: { opacity: 0, scale: 0.95, x: -4 }, transition: { duration: 0.18, ease: 'easeOut' } }, "left-peek")) })), _jsx(CenterChip, Object.assign({ "data-testid": "CenterChip", ref: centerChipRef, onMouseEnter: handleMouseEnter, style: {
|
|
21
21
|
borderRadius: expandableCenter && isHovering ? '12px 0 0 12px' : '12px',
|
|
22
22
|
borderRight: expandableCenter && isHovering ? 'none' : undefined,
|
|
23
|
-
paddingInlineEnd: '2px',
|
|
24
23
|
} }, { children: _jsx(CenterContent, Object.assign({ "data-testid": "CenterContent", ref: centerContentRef }, { children: centerIcon })) })), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: expandableCenter && (_jsx(ExpandableContainer, Object.assign({ "data-testid": "ExpandableContainer", style: {
|
|
25
24
|
width: expandedMV,
|
|
26
25
|
position: 'absolute',
|
|
@@ -30,6 +29,7 @@ function RightLeftExpandingCenterChip(_a) {
|
|
|
30
29
|
zIndex: 1,
|
|
31
30
|
opacity: isHovering ? 1 : 0,
|
|
32
31
|
pointerEvents: isHovering ? 'auto' : 'none',
|
|
32
|
+
paddingRight: '2px',
|
|
33
33
|
}, initial: false, transition: { duration: 0.2, ease: 'easeOut' } }, { children: _jsx(ExpandableInner, Object.assign({ "data-testid": "ExpandableInner", ref: expandableInnerRef }, { children: expandableCenter })) }))) })), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: rightIcons.length > 0 && (_jsx(RightPeekChip, { "data-testid": "RightPeekChip", initial: { opacity: 0, scale: 0.95, x: 4 }, animate: isHovering ? { opacity: 0, scale: 0.9, x: 6 } : { opacity: 1, scale: 1, x: 5 }, exit: { opacity: 0, scale: 0.95, x: 4 }, transition: { duration: 0.18, ease: 'easeOut' } }, "right-peek")) }))] })), isHovering && leftIcons.length > 0 && (_jsx(HoverBridge, { "data-testid": "LeftHoverBridge", side: "left", style: { width: leftHoverWidth, right: `calc(100% - ${anchors.left}px)`, zIndex: expandedZIndex, pointerEvents: 'auto' } })), isHovering && rightIcons.length > 0 && (_jsx(HoverBridge, { "data-testid": "RightHoverBridge", side: "right", style: { width: rightHoverWidth, left: `${anchors.right}px`, zIndex: expandedZIndex, pointerEvents: 'auto' } })), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: leftIcons.length > 0 && (_jsx(ExpandedSection, Object.assign({ "data-testid": "LeftExpandedSection", side: "left", style: {
|
|
34
34
|
right: `calc(100% - ${anchors.left}px)`,
|
|
35
35
|
top: '50%',
|
|
@@ -29,7 +29,6 @@ export const LeftExpandIcon = styled(motion.span)(({ theme }) => ({
|
|
|
29
29
|
fontSize: '10px',
|
|
30
30
|
lineHeight: 1,
|
|
31
31
|
color: theme.palette.text.secondary,
|
|
32
|
-
fontWeight: 'bold',
|
|
33
32
|
userSelect: 'none',
|
|
34
33
|
}));
|
|
35
34
|
export const RightExpandIcon = styled(motion.span)(({ theme }) => ({
|
|
@@ -44,7 +43,6 @@ export const RightExpandIcon = styled(motion.span)(({ theme }) => ({
|
|
|
44
43
|
fontSize: '10px',
|
|
45
44
|
lineHeight: 1,
|
|
46
45
|
color: theme.palette.text.secondary,
|
|
47
|
-
fontWeight: 'bold',
|
|
48
46
|
userSelect: 'none',
|
|
49
47
|
}));
|
|
50
48
|
export const ExpandedSection = styled(motion.div)(({ side }) => (Object.assign(Object.assign(Object.assign({ position: 'absolute', display: 'flex', alignItems: 'center' }, (side === 'left' ? { right: '100%', flexDirection: 'row-reverse', transformOrigin: 'right center' } : {})), (side === 'right' ? { left: '100%', flexDirection: 'row', transformOrigin: 'left center' } : {})), { top: '50%', transform: 'translateY(-50%)', gap: 0, pointerEvents: 'auto', overflow: 'visible' })));
|
|
@@ -16,16 +16,13 @@ export function SourceIcons({ payment, card, isTextShown, firstIcon }) {
|
|
|
16
16
|
const method = payment === null || payment === void 0 ? void 0 : payment.method;
|
|
17
17
|
const scheme = payment === null || payment === void 0 ? void 0 : payment.scheme;
|
|
18
18
|
if (((_a = getPaymentMethodKey(method)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = getPaymentMethodKey(scheme)) === null || _b === void 0 ? void 0 : _b.toLowerCase())) {
|
|
19
|
-
initialSources.push(...[getPaymentMethodKey(
|
|
19
|
+
initialSources.push(...[getPaymentMethodKey(type), getPaymentMethodKey(method)]);
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
-
initialSources.push(...[getPaymentMethodKey(
|
|
22
|
+
initialSources.push(...[getPaymentMethodKey(type), getPaymentMethodKey(method), getPaymentMethodKey(scheme)]);
|
|
23
23
|
}
|
|
24
24
|
return initialSources;
|
|
25
25
|
}, [payment]);
|
|
26
|
-
const firstIconSource = useMemo(() => {
|
|
27
|
-
return _jsx(SourceIcon, { source: firstIcon, isTextShown: isTextShown, title: t(camelCase(firstIcon)) }, firstIcon);
|
|
28
|
-
}, [firstIcon, isTextShown, t]);
|
|
29
26
|
const paymentSources = useMemo(() => {
|
|
30
27
|
var _a, _b;
|
|
31
28
|
return (_b = (_a = sources()) === null || _a === void 0 ? void 0 : _a.filter((s) => !!s && s !== firstIcon)) === null || _b === void 0 ? void 0 : _b.map((source, index, sourcesList) => {
|
|
@@ -34,5 +31,5 @@ export function SourceIcons({ payment, card, isTextShown, firstIcon }) {
|
|
|
34
31
|
return (_jsx(SourceIcon, { source: source, isTextShown: isTextShown, title: index === 0 && source === 'Wallet' ? walletTooltip : sourceTooltip }, `${source}-${index}`));
|
|
35
32
|
});
|
|
36
33
|
}, [sources, payment, card, isTextShown, t, firstIcon]);
|
|
37
|
-
return (_jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: 0.5 }, { children: [
|
|
34
|
+
return (_jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: 0.5 }, { children: [paymentSources, (card === null || card === void 0 ? void 0 : card.last_four) && _jsxs(CardNumber, { children: ["\u00B7\u00B7\u00B7 ", card === null || card === void 0 ? void 0 : card.last_four] })] })));
|
|
38
35
|
}
|
|
@@ -45,6 +45,9 @@ function DestinationCell(_a) {
|
|
|
45
45
|
justifyContent: 'flex-start',
|
|
46
46
|
height: 'auto',
|
|
47
47
|
} }, { children: destinationsCount > 1 ? (_jsxs("div", { children: ["Destination ", (_c = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _c === void 0 ? void 0 : _c.id, " - ", _jsx(CurrencyIcon, { currency: (_d = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _d === void 0 ? void 0 : _d.currency }), ' ', firstDestinationFormattedAmount.integerAmount, ".", firstDestinationFormattedAmount.decimalAmount, " +", destinationsCount - 1] })) : (_jsxs("div", { children: ["Destination ", (_e = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _e === void 0 ? void 0 : _e.id, " - ", _jsx(CurrencyIcon, { currency: (_f = destinations === null || destinations === void 0 ? void 0 : destinations[0]) === null || _f === void 0 ? void 0 : _f.currency }), " ", formattedAmount.integerAmount, ".", formattedAmount.decimalAmount] })) })));
|
|
48
|
-
return (_jsx(Box, Object.assign({
|
|
48
|
+
return (_jsx(Box, Object.assign({ sx: {
|
|
49
|
+
width: 'fit-content',
|
|
50
|
+
overflow: 'visible',
|
|
51
|
+
} }, props, { children: _jsx(Tooltip, Object.assign({ title: destinationsTooltip }, { children: !isTextShown ? (_jsxs(StyledDestinationCell, Object.assign({ tableMode: tableMode }, { children: [_jsx(StyledDestinationIcon, { src: destinationSolidIcon, pointLeft: iconDirection === 'left' }), destinationsCount > 1 && (_jsx(DestinationCellContainer, Object.assign({ destinationsCount: 1 }, { children: _jsx(DestinationCount, { children: destinationsCount }) })))] }))) : (textView) })) })));
|
|
49
52
|
}
|
|
50
53
|
export default DestinationCell;
|
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.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.48-test.1",
|
|
5
|
+
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -131,4 +131,4 @@
|
|
|
131
131
|
"publishConfig": {
|
|
132
132
|
"registry": "https://registry.npmjs.org/"
|
|
133
133
|
}
|
|
134
|
-
}
|
|
134
|
+
}
|