@tap-payments/os-micro-frontend-shared 0.1.15 → 0.1.16

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.
Files changed (24) hide show
  1. package/build/components/Chip/Chip.d.ts +1 -1
  2. package/build/components/Chip/style.js +12 -12
  3. package/build/components/TableCells/CustomCells/TerminalsBrandCell/TerminalsBrandCell.d.ts +12 -0
  4. package/build/components/TableCells/CustomCells/TerminalsBrandCell/TerminalsBrandCell.js +20 -0
  5. package/build/components/TableCells/CustomCells/TerminalsBrandCell/index.d.ts +1 -0
  6. package/build/components/TableCells/CustomCells/TerminalsBrandCell/index.js +1 -0
  7. package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.d.ts +12 -0
  8. package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.js +19 -0
  9. package/build/components/TableCells/CustomCells/TerminalsPlatformCell/index.d.ts +1 -0
  10. package/build/components/TableCells/CustomCells/TerminalsPlatformCell/index.js +1 -0
  11. package/build/components/TableCells/CustomCells/index.d.ts +2 -0
  12. package/build/components/TableCells/CustomCells/index.js +2 -0
  13. package/build/components/TooltipChip/TooltipChip.d.ts +14 -0
  14. package/build/components/TooltipChip/TooltipChip.js +20 -0
  15. package/build/components/TooltipChip/index.d.ts +1 -0
  16. package/build/components/TooltipChip/index.js +1 -0
  17. package/build/components/TooltipChip/style.d.ts +9 -0
  18. package/build/components/TooltipChip/style.js +7 -0
  19. package/build/components/index.d.ts +1 -0
  20. package/build/components/index.js +1 -0
  21. package/build/constants/table/cell/terminalsTableCellWidth.d.ts +3 -3
  22. package/build/constants/table/cell/terminalsTableCellWidth.js +3 -3
  23. package/build/types/user.d.ts +0 -2
  24. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { ChipProps } from './type';
3
- declare const Chip: import("react").ForwardRefExoticComponent<Omit<ChipProps, "ref"> & import("react").RefAttributes<import("@mui/types").OverridableComponent<import("@mui/system").BoxTypeMap<{}, "div", import("@mui/material").Theme>>>>;
3
+ declare const Chip: import("react").FC<ChipProps>;
4
4
  export default Chip;
@@ -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 = 'text', 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',
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { TextAndLang } from '../../../../types/index.js';
3
+ type TerminalsBrandCellProps = {
4
+ name: TextAndLang[];
5
+ icon?: React.ReactNode;
6
+ displayRules: {
7
+ showIcon: boolean;
8
+ showLabel: boolean;
9
+ };
10
+ };
11
+ declare const TerminalsBrandCell: (props: TerminalsBrandCellProps) => import("react/jsx-runtime").JSX.Element | null;
12
+ export default TerminalsBrandCell;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTranslation } from 'react-i18next';
3
+ import Stack from '@mui/material/Stack';
4
+ import Typography from '@mui/material/Typography';
5
+ import { Chip, Tooltip } from '../../../index.js';
6
+ import { getNameText } from '../../../../utils/index.js';
7
+ const TerminalsBrandCell = (props) => {
8
+ const { name, icon, displayRules } = props;
9
+ const { i18n } = useTranslation();
10
+ if (!name && !icon)
11
+ return null;
12
+ const { showIcon, showLabel } = displayRules;
13
+ const brandName = name ? getNameText(name, i18n.language) : '';
14
+ const displayLabel = showLabel && !!brandName;
15
+ const displayIcon = showIcon && !!icon;
16
+ if (!displayIcon && !displayLabel)
17
+ return null;
18
+ return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsBrandCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, { children: [displayIcon && (_jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: brandName }, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, { children: brandName })) })))] })));
19
+ };
20
+ export default TerminalsBrandCell;
@@ -0,0 +1 @@
1
+ export { default as TerminalsBrandCell } from './TerminalsBrandCell';
@@ -0,0 +1 @@
1
+ export { default as TerminalsBrandCell } from './TerminalsBrandCell';
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { TextAndLang } from '../../../../types/index.js';
3
+ type TerminalsPlatformCellProps = {
4
+ name: TextAndLang[];
5
+ icon?: React.ReactNode;
6
+ displayRules?: {
7
+ showIcon?: boolean;
8
+ showLabel?: boolean;
9
+ };
10
+ };
11
+ declare const _default: import("react").MemoExoticComponent<({ name, icon, displayRules }: TerminalsPlatformCellProps) => import("react/jsx-runtime").JSX.Element | null>;
12
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import Stack from '@mui/material/Stack';
5
+ import Typography from '@mui/material/Typography';
6
+ import Box from '@mui/material/Box';
7
+ import { Chip, Tooltip } from '../../../index.js';
8
+ import { getNameText } from '../../../../utils/index.js';
9
+ const TerminalsPlatformCell = ({ name, icon, displayRules }) => {
10
+ const { i18n } = useTranslation();
11
+ const { showIcon = true, showLabel = true } = displayRules || {};
12
+ const platformName = getNameText(name, i18n.language);
13
+ const displayIcon = showIcon && !!icon;
14
+ const displayLabel = showLabel || !!platformName;
15
+ if (!displayIcon && !displayLabel)
16
+ return null;
17
+ return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsPlatformCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, { children: [displayIcon && (_jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon }))), displayLabel && (_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" }))) })) })))] })));
18
+ };
19
+ export default memo(TerminalsPlatformCell);
@@ -0,0 +1 @@
1
+ export { default as TerminalsPlatformCell } from './TerminalsPlatformCell';
@@ -0,0 +1 @@
1
+ export { default as TerminalsPlatformCell } from './TerminalsPlatformCell';
@@ -44,5 +44,7 @@ export * from './MarketPlaceCell';
44
44
  export * from './IndividualsCell';
45
45
  export * from './BrandsCell';
46
46
  export * from './SalesChannelCell';
47
+ export * from './TerminalsBrandCell';
48
+ export * from './TerminalsPlatformCell';
47
49
  export * from './type';
48
50
  export * from './style';
@@ -44,5 +44,7 @@ export * from './MarketPlaceCell';
44
44
  export * from './IndividualsCell';
45
45
  export * from './BrandsCell';
46
46
  export * from './SalesChannelCell';
47
+ export * from './TerminalsBrandCell';
48
+ export * from './TerminalsPlatformCell';
47
49
  export * from './type';
48
50
  export * from './style';
@@ -0,0 +1,14 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import Tooltip from '../Tooltip';
3
+ import { type ChipProps } from '../Chip';
4
+ type TooltipChipProps = PropsWithChildren<{
5
+ title: React.ReactNode;
6
+ variant?: ChipProps['variant'];
7
+ slotProps?: {
8
+ tooltip?: React.ComponentProps<typeof Tooltip>;
9
+ chip?: Partial<ChipProps>;
10
+ };
11
+ children: React.ReactNode;
12
+ }>;
13
+ declare const TooltipChip: ({ title, slotProps, children }: TooltipChipProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default TooltipChip;
@@ -0,0 +1,20 @@
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
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import Tooltip from '../Tooltip';
14
+ import { StyledChip } from './style';
15
+ const TooltipChip = ({ title, slotProps = {}, children }) => {
16
+ const { chip = {}, tooltip = {} } = slotProps;
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({ height: 24, display: 'inline-flex', color: 'text.primary' }, chipSx) }, { children: children })) })));
19
+ };
20
+ export default TooltipChip;
@@ -0,0 +1 @@
1
+ export { default as TooltipChip } from './TooltipChip';
@@ -0,0 +1 @@
1
+ export { default as TooltipChip } from './TooltipChip';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledChip: import("@emotion/styled").StyledComponent<{
3
+ variant?: import("../Chip").ChipVariant | undefined;
4
+ icon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactDOM | null | undefined;
5
+ } & import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & {
8
+ children?: import("react").ReactNode;
9
+ } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -0,0 +1,7 @@
1
+ import { styled } from '@mui/material/styles';
2
+ import { Chip } from '../Chip';
3
+ export const StyledChip = styled(Chip)(({ theme }) => ({
4
+ color: theme.palette.text.primary,
5
+ '&.CustomVariant_text': { height: 24 },
6
+ display: 'inline-flex',
7
+ }));
@@ -96,3 +96,4 @@ export { default as RangeCalender } from './RangeCalender';
96
96
  export { default as AppServices } from './AppServices';
97
97
  export { default as ScrollLoader } from './ScrollLoader';
98
98
  export * from './ScrollLoader';
99
+ export * from './TooltipChip';
@@ -96,3 +96,4 @@ export { default as RangeCalender } from './RangeCalender';
96
96
  export { default as AppServices } from './AppServices';
97
97
  export { default as ScrollLoader } from './ScrollLoader';
98
98
  export * from './ScrollLoader';
99
+ export * from './TooltipChip';
@@ -1,8 +1,8 @@
1
1
  export declare const terminalsTableCellWidth: {
2
2
  readonly device: {
3
- readonly default: "180px";
4
- readonly text: "180px";
5
- readonly sheet: "180px";
3
+ readonly default: "120px";
4
+ readonly text: "120px";
5
+ readonly sheet: "120px";
6
6
  };
7
7
  readonly terminalId: {
8
8
  readonly default: "100px";
@@ -1,8 +1,8 @@
1
1
  export const terminalsTableCellWidth = {
2
2
  device: {
3
- default: '180px',
4
- text: '180px',
5
- sheet: '180px',
3
+ default: '120px',
4
+ text: '120px',
5
+ sheet: '120px',
6
6
  },
7
7
  terminalId: {
8
8
  default: '100px',
@@ -78,8 +78,6 @@ export interface Segment {
78
78
  };
79
79
  };
80
80
  };
81
- is_business_segment?: boolean;
82
- is_segment_has_more_than_one_merchant?: boolean;
83
81
  }
84
82
  interface SegmentUserName {
85
83
  first: string;
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.15",
4
+ "version": "0.1.16",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",