@tap-payments/os-micro-frontend-shared 0.1.320 → 0.1.322

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,3 +1,3 @@
1
1
  import { ChipProps } from './type';
2
- declare const StatusChip: ({ children, unknownText, copyText, expandDirection, chipStyles, containerStyles, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const StatusChip: ({ children, unknownText, copyText, expandDirection, chipStyles, containerStyles, fullWidth, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default StatusChip;
@@ -18,7 +18,7 @@ import { copyIcon, greenCheckIcon } from '../../constants/index.js';
18
18
  import { ChipStyled, Wrapper, CopyWrapper } from './style';
19
19
  import { emptyStatusChipColors } from '../../constants/index.js';
20
20
  const StatusChip = (_a) => {
21
- var { children, unknownText, copyText, expandDirection = 'right', chipStyles, containerStyles } = _a, props = __rest(_a, ["children", "unknownText", "copyText", "expandDirection", "chipStyles", "containerStyles"]);
21
+ var { children, unknownText, copyText, expandDirection = 'right', chipStyles, containerStyles, fullWidth = false } = _a, props = __rest(_a, ["children", "unknownText", "copyText", "expandDirection", "chipStyles", "containerStyles", "fullWidth"]);
22
22
  const [showCopy, setShowCopy] = useState(false);
23
23
  const { t } = useTranslation();
24
24
  const isSelected = props.isSelected;
@@ -39,9 +39,9 @@ const StatusChip = (_a) => {
39
39
  }
40
40
  };
41
41
  const isCopyActive = isSelected && copyText;
42
- return (_jsxs(motion.div, Object.assign({ style: Object.assign({ position: 'relative' }, containerStyles), 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: {
42
+ return (_jsxs(motion.div, Object.assign({ style: Object.assign(Object.assign({ position: 'relative' }, containerStyles), { width: fullWidth ? '100%' : 'auto' }), animate: { zIndex: isSelected ? 3 : 0 } }, { children: [_jsx(ChipStyled, Object.assign({}, props, { sx: { visibility: 'hidden', pointerEvents: 'none', width: fullWidth ? '100%' : 'auto' } }, { children: _jsx(Wrapper, { children: children }) })), _jsx(motion.div, Object.assign({ style: { position: 'absolute', top: 0, zIndex: isSelected ? 3 : 0, width: fullWidth ? '100%' : 'auto' }, animate: {
43
43
  left: isCopyActive && expandDirection === 'left' ? -12 : 0,
44
- }, transition: { delay: isSelected ? 0 : 0.3, 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: {
44
+ }, transition: { delay: isSelected ? 0 : 0.3, duration: 0.2 } }, { children: _jsx(ChipStyled, Object.assign({}, props, { isSelected: isSelected, sx: { width: fullWidth ? '100%' : 'auto' } }, chipStyles, { children: _jsxs(motion.div, Object.assign({ layout: "size", style: { display: 'flex', gap: '4px', maxWidth: fullWidth ? '100%' : 'auto' }, animate: {
45
45
  paddingRight: isCopyActive ? 12 : 0,
46
46
  }, transition: { delay: isSelected ? 0 : 0.3, duration: 0.2 } }, { children: [_jsx(Wrapper, Object.assign({ "data-is-arabic": typeof children === 'string' && isArabic(children) }, { 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: { duration: 0.1 }, onClick: handleCopy, src: showCopy ? greenCheckIcon : copyIcon, style: {
47
47
  height: 12,
@@ -16,6 +16,7 @@ export declare const ChipStyled: import("@emotion/styled").StyledComponent<impor
16
16
  chipStyles?: object | undefined;
17
17
  disableAnimation?: boolean | undefined;
18
18
  containerStyles?: object | undefined;
19
+ fullWidth?: boolean | undefined;
19
20
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
20
21
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
21
22
  }, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & {
@@ -17,11 +17,13 @@ export const ChipStyled = styled(Box, {
17
17
  }));
18
18
  });
19
19
  export const Wrapper = styled(Box)(() => ({
20
- display: 'flex',
21
- alignItems: 'center',
22
- justifyContent: 'center',
23
20
  gap: '4px',
24
21
  textAlign: 'center',
22
+ overflow: 'hidden',
23
+ textOverflow: 'ellipsis',
24
+ whiteSpace: 'nowrap',
25
+ minWidth: 0,
26
+ flex: 1,
25
27
  }));
26
28
  export const CopyWrapper = styled(Box)(() => ({
27
29
  position: 'absolute',
@@ -15,4 +15,5 @@ export type ChipProps = PropsWithChildren<{
15
15
  chipStyles?: object;
16
16
  disableAnimation?: boolean;
17
17
  containerStyles?: object;
18
+ fullWidth?: boolean;
18
19
  } & BoxProps>;
@@ -6,6 +6,7 @@ export interface StatusChipWithCopyProps extends StatusChipProps {
6
6
  chipIndex: number;
7
7
  selectionProps: SelectionProps;
8
8
  chipStyles?: object;
9
+ fullWidth?: boolean;
9
10
  }
10
11
  declare function StatusChipWithCopy({ children, copyText, chipIndex, selectionProps: { onClick, rowIndex, colIndex, selectedId }, ...rest }: StatusChipWithCopyProps): import("react/jsx-runtime").JSX.Element;
11
12
  declare const _default: import("react").MemoExoticComponent<typeof StatusChipWithCopy>;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
13
  import Box from '@mui/material/Box';
14
14
  import { formatAmount } from '../../../../utils/index.js';
15
15
  import { CurrencySymbol, StatusGroupChips } from '../../../index.js';
@@ -20,7 +20,7 @@ function DestinationCellSheet(_a) {
20
20
  const formattedDestAmount = formatAmount((dest === null || dest === void 0 ? void 0 : dest.amount) || 0);
21
21
  return {
22
22
  key: `destination-${(dest === null || dest === void 0 ? void 0 : dest.id) || index}`,
23
- content: (_jsxs(_Fragment, { children: [_jsxs("div", { children: [dest === null || dest === void 0 ? void 0 : dest.id, " |"] }), _jsx(CurrencySymbol, { currency: dest === null || dest === void 0 ? void 0 : dest.currency }), _jsxs("span", { children: [formattedDestAmount.integerAmount, ".", formattedDestAmount.decimalAmount] })] })),
23
+ content: (_jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', gap: '4px' } }, { children: [_jsxs("div", { children: [dest === null || dest === void 0 ? void 0 : dest.id, " |"] }), _jsx(CurrencySymbol, { currency: dest === null || dest === void 0 ? void 0 : dest.currency }), _jsxs("span", { children: [formattedDestAmount.integerAmount, ".", formattedDestAmount.decimalAmount] })] }))),
24
24
  chipIndex: index,
25
25
  selectionProps: selectionProps !== null && selectionProps !== void 0 ? selectionProps : {},
26
26
  copyText: `${formattedDestAmount.integerAmount}.${formattedDestAmount.decimalAmount}`,
@@ -71,7 +71,7 @@ function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = n
71
71
  })
72
72
  : {};
73
73
  const isIndexColumn = column.pinned === 'start' && effectiveFirst;
74
- 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: handleCellClick(colIndex, column.pinned), 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}`));
74
+ 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: handleCellClick(colIndex, column.pinned), 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, width: '100%' } }, { children: renderCell(column, index, colIndex) }))) : (_jsx(_Fragment, { children: renderCell(column, index, colIndex) })) }), `${column.id}-${colIndex}`));
75
75
  }) }));
76
76
  }, [
77
77
  columns,
@@ -1001,4 +1001,5 @@ export declare const MF_APPS_MAPPER: Readonly<{
1001
1001
  TERMINALS: "TERMINALS";
1002
1002
  BILLING: "BILLING";
1003
1003
  ACCOUNT: "ACCOUNT";
1004
+ BUSINESS: "BUSINESS";
1004
1005
  }>;
@@ -485,4 +485,5 @@ export const MF_APPS_MAPPER = Object.freeze({
485
485
  TERMINALS: 'TERMINALS',
486
486
  BILLING: 'BILLING',
487
487
  ACCOUNT: 'ACCOUNT',
488
+ BUSINESS: 'BUSINESS',
488
489
  });
@@ -0,0 +1 @@
1
+ export declare const BUSINESS_COUNTRIES: string[];
@@ -0,0 +1 @@
1
+ export const BUSINESS_COUNTRIES = ['SA', 'KW', 'AE', 'BH', 'QA', 'OM', 'EG', 'JO', 'LB'];
@@ -17,3 +17,4 @@ export * from './rate';
17
17
  export * from './reports';
18
18
  export * from './document';
19
19
  export * from './authentication';
20
+ export * from './country';
@@ -17,3 +17,4 @@ export * from './rate';
17
17
  export * from './reports';
18
18
  export * from './document';
19
19
  export * from './authentication';
20
+ export * from './country';
@@ -132,7 +132,7 @@ export type MFWidgetBaseProps = {
132
132
  theme: Theme;
133
133
  };
134
134
  timezone: {
135
- current?: Timezone | null;
136
- default?: Timezone;
135
+ current: Timezone | null;
136
+ default: Timezone | null;
137
137
  };
138
138
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.320",
4
+ "version": "0.1.322",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",