@tap-payments/os-micro-frontend-shared 0.1.103-test.6 → 0.1.103-test.7-test.8-test.9
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/AmountStatusChip/style.js +0 -8
- package/build/components/AuthenticationTypeChip/AuthenticationTypeChip.d.ts +1 -1
- package/build/components/AuthenticationTypeChip/AuthenticationTypeChip.js +2 -2
- package/build/components/StatusChip/StatusChip.d.ts +1 -1
- package/build/components/StatusChip/StatusChip.js +3 -3
- package/build/components/StatusChip/style.d.ts +2 -0
- package/build/components/StatusChip/style.js +12 -3
- package/build/components/StatusChip/type.d.ts +2 -0
- package/build/components/StatusChipWithCopy/StatusChipWithCopy.d.ts +2 -1
- package/build/components/StatusChipWithCopy/StatusChipWithCopy.js +2 -2
- package/build/components/VirtualTables/components/TableRow.js +2 -1
- package/build/constants/table/cell/authenticationsTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/authenticationsTableCellWidth.js +1 -1
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +1 -1
- package/build/constants/table/cell/chargeTableCellWidth.js +1 -1
- package/package.json +2 -2
|
@@ -6,14 +6,6 @@ export const StyledAmountStatusChip = styled(StatusChipWithCopy)(() => ({
|
|
|
6
6
|
display: 'flex',
|
|
7
7
|
alignItems: 'center',
|
|
8
8
|
justifyContent: 'center',
|
|
9
|
-
transition: 'none !important',
|
|
10
|
-
animation: 'none !important',
|
|
11
|
-
transform: 'none !important',
|
|
12
|
-
'& *': {
|
|
13
|
-
transition: 'none !important',
|
|
14
|
-
animation: 'none !important',
|
|
15
|
-
transform: 'none !important',
|
|
16
|
-
},
|
|
17
9
|
}));
|
|
18
10
|
export const AmountLabel = styled('span')(() => ({
|
|
19
11
|
display: 'flex',
|
|
@@ -4,6 +4,6 @@ import { chipAuthenticationTypes } from './constants';
|
|
|
4
4
|
export interface AuthenticationTypeChipProps extends StatusChipWithCopyProps {
|
|
5
5
|
title: keyof typeof chipAuthenticationTypes;
|
|
6
6
|
}
|
|
7
|
-
declare function AuthenticationTypeChip({ title, ...rest }: AuthenticationTypeChipProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AuthenticationTypeChip({ title, ref, ...rest }: AuthenticationTypeChipProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare const _default: import("react").MemoExoticComponent<typeof AuthenticationTypeChip>;
|
|
9
9
|
export default _default;
|
|
@@ -14,8 +14,8 @@ import { memo } from 'react';
|
|
|
14
14
|
import StatusChipWithCopy from '../StatusChipWithCopy';
|
|
15
15
|
import { chipAuthenticationTypes } from './constants';
|
|
16
16
|
function AuthenticationTypeChip(_a) {
|
|
17
|
-
var { title } = _a, rest = __rest(_a, ["title"]);
|
|
17
|
+
var { title, ref } = _a, rest = __rest(_a, ["title", "ref"]);
|
|
18
18
|
const { text, styles } = chipAuthenticationTypes[title];
|
|
19
|
-
return (_jsx(StatusChipWithCopy, Object.assign({
|
|
19
|
+
return (_jsx(StatusChipWithCopy, Object.assign({ chipStyles: styles, ref: ref }, rest, { children: text })));
|
|
20
20
|
}
|
|
21
21
|
export default memo(AuthenticationTypeChip);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ChipProps } from './type';
|
|
2
|
-
declare const StatusChip: ({ children, unknownText, copyText, expandDirection, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const StatusChip: ({ children, unknownText, copyText, expandDirection, chipStyles, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default StatusChip;
|
|
@@ -16,9 +16,9 @@ import { AnimatePresence, motion } from 'framer-motion';
|
|
|
16
16
|
import { copyText as copyTextHandler } from '../../utils/index.js';
|
|
17
17
|
import { copyIcon, greenCheckIcon } from '../../constants/index.js';
|
|
18
18
|
import { ChipStyled, Wrapper, CopyWrapper } from './style';
|
|
19
|
-
import { emptyStatusChipColors } from '
|
|
19
|
+
import { emptyStatusChipColors } from '../../constants/index.js';
|
|
20
20
|
const StatusChip = (_a) => {
|
|
21
|
-
var { children, unknownText, copyText, expandDirection = 'right' } = _a, props = __rest(_a, ["children", "unknownText", "copyText", "expandDirection"]);
|
|
21
|
+
var { children, unknownText, copyText, expandDirection = 'right', chipStyles } = _a, props = __rest(_a, ["children", "unknownText", "copyText", "expandDirection", "chipStyles"]);
|
|
22
22
|
const [showCopy, setShowCopy] = useState(false);
|
|
23
23
|
const { t } = useTranslation();
|
|
24
24
|
const isSelected = props.isSelected;
|
|
@@ -41,7 +41,7 @@ const StatusChip = (_a) => {
|
|
|
41
41
|
const isCopyActive = isSelected && copyText;
|
|
42
42
|
return (_jsxs(motion.div, Object.assign({ style: { position: 'relative' }, animate: { zIndex: isSelected ? 3 : 0 } }, { children: [_jsx(ChipStyled, Object.assign({}, props, { sx: { visibility: 'hidden', pointerEvents: 'none' } }, { children: _jsx(Wrapper, { children: children }) })), _jsx(motion.div, Object.assign({ style: { position: 'absolute', top: 0, zIndex: isSelected ? 3 : 0 }, animate: {
|
|
43
43
|
left: isCopyActive && expandDirection === 'left' ? -12 : 0,
|
|
44
|
-
}, transition: { delay: isSelected ? 0 : 0.2, duration: 0.2 } }, { children: _jsx(ChipStyled, Object.assign({}, props, { isSelected: isSelected }, { children: _jsxs(motion.div, Object.assign({ layout: "size", style: { display: 'flex', gap: '4px' }, animate: {
|
|
44
|
+
}, transition: { delay: isSelected ? 0 : 0.2, duration: 0.2 } }, { children: _jsx(ChipStyled, Object.assign({}, props, { isSelected: isSelected }, chipStyles, { children: _jsxs(motion.div, Object.assign({ layout: "size", style: { display: 'flex', gap: '4px' }, animate: {
|
|
45
45
|
paddingRight: isCopyActive ? 12 : 0,
|
|
46
46
|
}, transition: { delay: isSelected ? 0 : 0.2, duration: 0.2 } }, { children: [_jsx(Wrapper, { children: children }), _jsx(AnimatePresence, { children: isCopyActive && (_jsx(CopyWrapper, { children: _jsx(motion.img, { initial: { opacity: 0, x: -5 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: -2 }, transition: { delay: 0.2, duration: 0.1 }, onClick: handleCopy, src: showCopy ? greenCheckIcon : copyIcon, style: {
|
|
47
47
|
height: 12,
|
|
@@ -12,6 +12,8 @@ export declare const ChipStyled: import("@emotion/styled").StyledComponent<impor
|
|
|
12
12
|
isSelected?: boolean | undefined;
|
|
13
13
|
copyText?: string | undefined;
|
|
14
14
|
expandDirection?: "left" | "right" | undefined;
|
|
15
|
+
chipStyles?: object | undefined;
|
|
16
|
+
disableAnimation?: boolean | undefined;
|
|
15
17
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
16
18
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
17
19
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & {
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import Box from '@mui/material/Box';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
export const ChipStyled = styled(Box, {
|
|
4
|
-
shouldForwardProp: (prop) => !['textColor', 'bgColor', 'borderColor', 'disabled', 'padding', 'maxWidth', 'isSelected'].includes(prop),
|
|
5
|
-
})(({ theme, isSelected, textColor = theme.palette.text.primary, bgColor = '#EFF1F2', borderColor = '#EFF1F2', disabled = false, padding, maxWidth, }) => {
|
|
6
|
-
return Object.assign({ display: 'flex', alignItems: 'center', gap: '4px', height: '18px', padding: padding || '0px 9.5px', borderRadius: '30px', border: `1px solid ${borderColor}`, backgroundColor: bgColor, color: textColor, cursor: disabled ? 'not-allowed' : 'pointer', opacity: disabled ? 0.5 : 1, whiteSpace: 'nowrap', fontSize: '11px', minWidth: '67px', maxWidth: maxWidth || 'none', width: 'fit-content', overflow: 'hidden', textOverflow: maxWidth ? 'ellipsis' : 'unset', boxSizing: 'border-box' }, (isSelected && {
|
|
4
|
+
shouldForwardProp: (prop) => !['textColor', 'bgColor', 'borderColor', 'disabled', 'padding', 'maxWidth', 'isSelected', 'disableAnimation'].includes(prop),
|
|
5
|
+
})(({ theme, isSelected, textColor = theme.palette.text.primary, bgColor = '#EFF1F2', borderColor = '#EFF1F2', disabled = false, padding, maxWidth, disableAnimation, }) => {
|
|
6
|
+
return Object.assign(Object.assign({ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '4px', height: '18px', padding: padding || '0px 9.5px', borderRadius: '30px', border: `1px solid ${borderColor}`, backgroundColor: bgColor, color: textColor, cursor: disabled ? 'not-allowed' : 'pointer', opacity: disabled ? 0.5 : 1, whiteSpace: 'nowrap', fontSize: '11px', minWidth: '67px', maxWidth: maxWidth || 'none', width: 'fit-content', overflow: 'hidden', textOverflow: maxWidth ? 'ellipsis' : 'unset', boxSizing: 'border-box' }, (isSelected && {
|
|
7
7
|
boxShadow: 'white 7px 0px 8px 2px',
|
|
8
|
+
})), (disableAnimation && {
|
|
9
|
+
transition: 'none !important',
|
|
10
|
+
animation: 'none !important',
|
|
11
|
+
transform: 'none !important',
|
|
12
|
+
'& *': {
|
|
13
|
+
transition: 'none !important',
|
|
14
|
+
animation: 'none !important',
|
|
15
|
+
transform: 'none !important',
|
|
16
|
+
},
|
|
8
17
|
}));
|
|
9
18
|
});
|
|
10
19
|
export const Wrapper = styled(Box)(() => ({
|
|
@@ -5,7 +5,8 @@ export interface StatusChipWithCopyProps extends StatusChipProps {
|
|
|
5
5
|
copyText?: string;
|
|
6
6
|
chipIndex: number;
|
|
7
7
|
selectionProps: SelectionProps;
|
|
8
|
+
chipStyles?: object;
|
|
8
9
|
}
|
|
9
|
-
declare function StatusChipWithCopy({ children, copyText, chipIndex, selectionProps: { onClick, rowIndex, colIndex, selectedId }, ...
|
|
10
|
+
declare function StatusChipWithCopy({ children, copyText, chipIndex, selectionProps: { onClick, rowIndex, colIndex, selectedId }, ...rest }: StatusChipWithCopyProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
declare const _default: import("react").MemoExoticComponent<typeof StatusChipWithCopy>;
|
|
11
12
|
export default _default;
|
|
@@ -14,9 +14,9 @@ import { memo, useMemo } from 'react';
|
|
|
14
14
|
import StatusChip from '../StatusChip';
|
|
15
15
|
import { checkIsSelected } from './utils';
|
|
16
16
|
function StatusChipWithCopy(_a) {
|
|
17
|
-
var { children, copyText, chipIndex, selectionProps: { onClick, rowIndex, colIndex, selectedId } } = _a,
|
|
17
|
+
var { children, copyText, chipIndex, selectionProps: { onClick, rowIndex, colIndex, selectedId } } = _a, rest = __rest(_a, ["children", "copyText", "chipIndex", "selectionProps"]);
|
|
18
18
|
const isSelected = useMemo(() => checkIsSelected({ rowIndex, colIndex, selectedId, chipIndex }), [rowIndex, colIndex, selectedId, chipIndex]);
|
|
19
|
-
return (_jsx(StatusChip, Object.assign({},
|
|
19
|
+
return (_jsx(StatusChip, Object.assign({}, rest, { copyText: copyText, onClick: (e) => {
|
|
20
20
|
onClick === null || onClick === void 0 ? void 0 : onClick(e, chipIndex);
|
|
21
21
|
}, isSelected: isSelected }, { children: children })));
|
|
22
22
|
}
|
|
@@ -53,9 +53,10 @@ function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = n
|
|
|
53
53
|
isPinnedEnd: column.pinned === 'end',
|
|
54
54
|
})
|
|
55
55
|
: {};
|
|
56
|
+
const isIndexColumn = column.pinned === 'start' && effectiveFirst;
|
|
56
57
|
return (_jsx(StyledCell, Object.assign({ component: "div", "data-testid": "TableRow_TableCell", "data-column-id": column.id, "data-column-width": column.width, "data-column-width-used": column.width, "data-column-align": column.align, "data-column-order": column.order, "data-column-header": typeof column.header === 'string' ? column.header : 'component', "data-column-sortable": !!column.sortable, "data-column-filterable": !!column.filter, isFirst: effectiveFirst, isLast: effectiveLast, onClick: (event) => {
|
|
57
58
|
onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(index, colIndex, event, column.pinned);
|
|
58
|
-
}, sx: Object.assign(Object.assign(Object.assign({ width: column.width, minWidth: column.width, textAlign: column.align, justifyContent: column.align === 'right' ? 'flex-end' : 'flex-start', cursor: onCellClick ? 'pointer' : 'default' }, selectionStyles), rowSelectionBorderStyles), column.cellStyle), isSheetView: isSheetView, isSelected: isCellSelected }, { children: isSheetView ? (_jsx(Box, Object.assign({ sx: { position: 'relative', zIndex: 1 } }, { children: renderCell(column, index, colIndex) }))) : (_jsx(_Fragment, { children: renderCell(column, index, colIndex) })) }), `${column.id}-${colIndex}`));
|
|
59
|
+
}, sx: Object.assign(Object.assign(Object.assign({ width: column.width, minWidth: column.width, textAlign: column.align, justifyContent: isIndexColumn ? 'center' : column.align === 'right' ? 'flex-end' : 'flex-start', cursor: onCellClick ? 'pointer' : 'default' }, selectionStyles), rowSelectionBorderStyles), column.cellStyle), isSheetView: isSheetView, isSelected: isCellSelected }, { children: isSheetView ? (_jsx(Box, Object.assign({ sx: { position: 'relative', zIndex: 1 } }, { children: renderCell(column, index, colIndex) }))) : (_jsx(_Fragment, { children: renderCell(column, index, colIndex) })) }), `${column.id}-${colIndex}`));
|
|
59
60
|
}) })), [columns, row, index, selectedCell, selectedColumn, selectedRow, onCellClick, isLastRow, selectedChip, isSheetView]);
|
|
60
61
|
return (_createElement(StyledTableRow, Object.assign({ "data-testid": "TableRow", onClick: rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick, showShadowHighlight: rowProps === null || rowProps === void 0 ? void 0 : rowProps.showShadowHighlight, showLoadedStyle: rowProps === null || rowProps === void 0 ? void 0 : rowProps.showLoadedStyle, component: "article" }, rowProps, { key: index, isSheetView: isSheetView }), content));
|
|
61
62
|
}
|
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.103-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.103-test.7-test.8-test.9",
|
|
5
|
+
"testVersion": 9,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|