@tap-payments/os-micro-frontend-shared 0.1.332 → 0.1.333

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.
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { StackProps } from '@mui/material/Stack';
3
+ import { TypographyProps } from '@mui/material/Typography';
4
+ import { ChipProps, Tooltip } from '../../../index.js';
5
+ import { TextAndLang } from '../../../../types/index.js';
6
+ export type TextWithChipCell<T extends React.ElementType = 'div'> = StackProps<T> & {
7
+ name?: TextAndLang[];
8
+ icon?: React.ReactNode;
9
+ namePlaceholder?: React.ReactNode;
10
+ showIcon?: boolean;
11
+ showLabel?: boolean;
12
+ slotsProps?: {
13
+ tooltip?: Partial<React.ComponentProps<typeof Tooltip>>;
14
+ chip?: Partial<ChipProps>;
15
+ chipsTooltip?: Partial<React.ComponentProps<typeof Tooltip>>;
16
+ label?: Partial<TypographyProps>;
17
+ labelTooltip?: Partial<React.ComponentProps<typeof Tooltip>>;
18
+ };
19
+ };
20
+ declare const _default: React.MemoExoticComponent<(props: TextWithChipCell<"div">) => import("react/jsx-runtime").JSX.Element | null>;
21
+ export default _default;
@@ -0,0 +1,31 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { memo, useMemo } from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import Stack from '@mui/material/Stack';
16
+ import Typography from '@mui/material/Typography';
17
+ import Box from '@mui/material/Box';
18
+ import { Chip, Tooltip } from '../../../index.js';
19
+ import { getNameText } from '../../../../utils/index.js';
20
+ const TextWithChipCell = (props) => {
21
+ const { name, icon, namePlaceholder = 'Unavailable', showIcon = true, showLabel = true, slotsProps } = props, restProps = __rest(props, ["name", "icon", "namePlaceholder", "showIcon", "showLabel", "slotsProps"]);
22
+ const { i18n } = useTranslation();
23
+ const formattedName = useMemo(() => (name ? getNameText(name, i18n.language) : null), [name, i18n.language]);
24
+ const { tooltip = {}, chip = {}, chipsTooltip = {}, label = {}, labelTooltip = {} } = slotsProps || {};
25
+ const displayIcon = showIcon && !!icon;
26
+ const displayLabel = showLabel;
27
+ if (!displayIcon && !displayLabel)
28
+ return null;
29
+ return (_jsxs(Stack, Object.assign({ direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, restProps, { children: [displayIcon && (_jsx(Tooltip, Object.assign({ title: formattedName ? `Platform: ${formattedName}` : null }, tooltip, chipsTooltip, { children: _jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, chip, { children: icon })) }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: formattedName }, tooltip, labelTooltip, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, label, { children: formattedName || (_jsx(Box, Object.assign({ component: "span", sx: { opacity: 0.2 } }, { children: namePlaceholder }))) })) })))] })));
30
+ };
31
+ export default memo(TextWithChipCell);
@@ -0,0 +1,2 @@
1
+ export { default as TextWithChipCell } from './TextWithChipCell';
2
+ export * from './TextWithChipCell';
@@ -0,0 +1,2 @@
1
+ export { default as TextWithChipCell } from './TextWithChipCell';
2
+ export * from './TextWithChipCell';
@@ -43,8 +43,6 @@ export * from './MarketPlaceCell';
43
43
  export * from './IndividualsCell';
44
44
  export * from './BrandsCell';
45
45
  export * from './SalesChannelCell';
46
- export * from './TerminalsBrandCell';
47
- export * from './TerminalsPlatformCell';
48
46
  export * from './AppsCell';
49
47
  export * from './type';
50
48
  export * from './style';
@@ -53,3 +51,4 @@ export * from './PaymentAgreementCell';
53
51
  export * from './ProviderCell';
54
52
  export * from './PurposeCell';
55
53
  export * from './LinkCell';
54
+ export * from './TextWithChipCell';
@@ -43,8 +43,6 @@ export * from './MarketPlaceCell';
43
43
  export * from './IndividualsCell';
44
44
  export * from './BrandsCell';
45
45
  export * from './SalesChannelCell';
46
- export * from './TerminalsBrandCell';
47
- export * from './TerminalsPlatformCell';
48
46
  export * from './AppsCell';
49
47
  export * from './type';
50
48
  export * from './style';
@@ -53,3 +51,4 @@ export * from './PaymentAgreementCell';
53
51
  export * from './ProviderCell';
54
52
  export * from './PurposeCell';
55
53
  export * from './LinkCell';
54
+ export * from './TextWithChipCell';
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.332",
4
+ "version": "0.1.333",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
@@ -1,12 +0,0 @@
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;
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { useTranslation } from 'react-i18next';
4
- import Stack from '@mui/material/Stack';
5
- import Typography from '@mui/material/Typography';
6
- import { Chip, Tooltip } from '../../../index.js';
7
- import { getNameText } from '../../../../utils/index.js';
8
- const TerminalsBrandCell = (props) => {
9
- const { name, icon, displayRules } = props;
10
- const { i18n } = useTranslation();
11
- const brandName = useMemo(() => (name ? getNameText(name, i18n.language) : null), [name, i18n.language]);
12
- if (!name && !icon)
13
- return null;
14
- const { showIcon = true, showLabel = true } = displayRules || {};
15
- const displayIcon = showIcon && !!icon;
16
- const displayLabel = showLabel;
17
- if (!displayIcon && !displayLabel)
18
- return null;
19
- return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsBrandCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, { children: [displayIcon && (_jsx(Tooltip, Object.assign({ title: brandName ? `Brand: ${brandName}` : null }, { children: _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 })) })))] })));
20
- };
21
- export default TerminalsBrandCell;
@@ -1 +0,0 @@
1
- export { default as TerminalsBrandCell } from './TerminalsBrandCell';
@@ -1 +0,0 @@
1
- export { default as TerminalsBrandCell } from './TerminalsBrandCell';
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { StackProps } from '@mui/material/Stack';
3
- import { TextAndLang } from '../../../../types/index.js';
4
- type TerminalsPlatformCellProps = StackProps & {
5
- name?: TextAndLang[];
6
- icon?: React.ReactNode;
7
- displayRules?: {
8
- showIcon?: boolean;
9
- showLabel?: boolean;
10
- };
11
- };
12
- declare const _default: import("react").MemoExoticComponent<({ name, icon, displayRules, ...props }: TerminalsPlatformCellProps) => import("react/jsx-runtime").JSX.Element | null>;
13
- export default _default;
@@ -1,31 +0,0 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { memo, useMemo } from 'react';
14
- import { useTranslation } from 'react-i18next';
15
- import Stack from '@mui/material/Stack';
16
- import Typography from '@mui/material/Typography';
17
- import Box from '@mui/material/Box';
18
- import { Chip, Tooltip } from '../../../index.js';
19
- import { getNameText } from '../../../../utils/index.js';
20
- const TerminalsPlatformCell = (_a) => {
21
- var { name, icon, displayRules } = _a, props = __rest(_a, ["name", "icon", "displayRules"]);
22
- const { i18n } = useTranslation();
23
- const platformName = useMemo(() => (name ? getNameText(name, i18n.language) : null), [name, i18n.language]);
24
- const { showIcon = true, showLabel = true } = displayRules || {};
25
- const displayIcon = showIcon && !!icon;
26
- const displayLabel = showLabel;
27
- if (!displayIcon && !displayLabel)
28
- return null;
29
- return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsPlatformCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, props, { children: [displayIcon && (_jsx(Tooltip, Object.assign({ title: platformName ? `Platform: ${platformName}` : null }, { children: _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" }))) })) })))] })));
30
- };
31
- export default memo(TerminalsPlatformCell);
@@ -1 +0,0 @@
1
- export { default as TerminalsPlatformCell } from './TerminalsPlatformCell';
@@ -1 +0,0 @@
1
- export { default as TerminalsPlatformCell } from './TerminalsPlatformCell';