@tap-payments/os-micro-frontend-shared 0.1.14-test.6 → 0.1.14-test.7

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.
@@ -19,18 +19,18 @@ export const ChipStyled = styled(forwardRef((props, ref) => {
19
19
  return _jsx(Box, Object.assign({ ref: ref }, restProps, { className: calcClassName }));
20
20
  }), {
21
21
  shouldForwardProp: (prop) => prop !== 'icon',
22
- })(({ theme, icon }) => {
23
- return Object.assign(Object.assign({ border: `1px solid ${theme.palette.divider}`, borderRadius: '30px', backgroundColor: theme.palette.background.paper, display: 'flex', alignItems: 'center', justifyContent: 'center' }, (icon && { justifyContent: 'flex-start', gap: theme.spacing(1) })), { '&.CustomVariant_text': {
24
- padding: `${theme.spacing(0.75)} ${theme.spacing(1)}`,
25
- height: '30px',
26
- maxWidth: '150px',
27
- }, '&.CustomVariant_circular': {
28
- height: 24,
29
- width: 24,
30
- }, '&.CustomVariant_pill-icon': {
31
- height: 24,
32
- width: 36,
33
- } });
22
+ })(({ theme, variant, icon }) => {
23
+ return Object.assign(Object.assign(Object.assign(Object.assign({ border: `1px solid ${theme.palette.divider}`, borderRadius: '30px', backgroundColor: theme.palette.background.paper, display: 'flex', alignItems: 'center', justifyContent: 'center' }, (icon && { justifyContent: 'flex-start', gap: theme.spacing(1) })), (variant === 'text' && {
24
+ padding: `${theme.spacing(0.75)} ${theme.spacing(1)}`,
25
+ height: '30px',
26
+ maxWidth: '150px',
27
+ })), (variant === 'circular' && {
28
+ height: 24,
29
+ width: 24,
30
+ })), (variant === 'pill-icon' && {
31
+ height: 24,
32
+ width: 36,
33
+ }));
34
34
  });
35
35
  export const StyledSourceCell = styled('span')(({ theme }) => ({
36
36
  display: 'flex',
@@ -3,9 +3,9 @@ import { TextAndLang } from '../../../../types/index.js';
3
3
  type TerminalsPlatformCellProps = {
4
4
  name: TextAndLang[];
5
5
  icon?: React.ReactNode;
6
- displayRules: {
7
- showIcon: boolean;
8
- showLabel: boolean;
6
+ displayRules?: {
7
+ showIcon?: boolean;
8
+ showLabel?: boolean;
9
9
  };
10
10
  };
11
11
  declare const _default: import("react").MemoExoticComponent<({ name, icon, displayRules }: TerminalsPlatformCellProps) => import("react/jsx-runtime").JSX.Element>;
@@ -8,7 +8,7 @@ import { Chip, TableCell, Tooltip } from '../../../index.js';
8
8
  import { getNameText } from '../../../../utils/index.js';
9
9
  const TerminalsPlatformCell = ({ name, icon, displayRules }) => {
10
10
  const { i18n } = useTranslation();
11
- const { showIcon, showLabel } = displayRules;
11
+ const { showIcon = true, showLabel = true } = displayRules || {};
12
12
  const platformName = getNameText(name, i18n.language);
13
13
  const displayIcon = showIcon && !!icon;
14
14
  return (_jsx(TableCell, { children: _jsxs(Stack, Object.assign({ "data-testid": "sdf", direction: "row", alignItems: "center", spacing: 1 }, { children: [displayIcon && (_jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon }))), showLabel && (_jsx(Tooltip, Object.assign({ title: platformName }, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, { children: platformName || (_jsx(Box, Object.assign({ component: "span", sx: { opacity: 0.2 } }, { children: "Unavailable" }))) })) })))] })) }));
@@ -15,6 +15,6 @@ import { StyledChip } from './style';
15
15
  const TooltipChip = ({ title, slotProps = {}, children }) => {
16
16
  const { chip = {}, tooltip = {} } = slotProps;
17
17
  const { sx: chipSx } = chip, chipProps = __rest(chip, ["sx"]);
18
- return (_jsx(Tooltip, Object.assign({}, tooltip, { title: title }, { children: _jsx(StyledChip, Object.assign({}, chipProps, { sx: Object.assign({ '&.CustomVariant_text': { height: 24 }, display: 'inline-flex', color: 'text.primary' }, chipSx) }, { children: children })) })));
18
+ return (_jsx(Tooltip, Object.assign({}, tooltip, { title: title }, { children: _jsx(StyledChip, Object.assign({}, chipProps, { sx: Object.assign({ height: 24, display: 'inline-flex', color: 'text.primary' }, chipSx) }, { children: children })) })));
19
19
  };
20
20
  export default TooltipChip;
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.14-test.6",
5
- "testVersion": 6,
4
+ "version": "0.1.14-test.7",
5
+ "testVersion": 7,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",