@tap-payments/os-micro-frontend-shared 0.1.141 → 0.1.143

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,4 +19,6 @@ export declare const statusButtonIcons: {
19
19
  paidOut: string;
20
20
  scheduled: string;
21
21
  checked: string;
22
+ dashedChecked: string;
23
+ deactivated: string;
22
24
  };
@@ -1,4 +1,4 @@
1
- import { initiatedIcon, abandonedIcon, cancelledIcon, reportsIcon, searchIcon, chevronDownIcon, unAuthorizedIcon, settlementInitiatedIcon, unCapturedIcon, capturedIcon, authorizedIcon, openFlagIcon, closedFlagIcon, reverseActionIcon, authenticatedIcon, unauthenticatedIcon, paidOutFilterIcon, scheduledFilterIcon, completedBlackIcon,
1
+ import { initiatedIcon, abandonedIcon, cancelledIcon, reportsIcon, searchIcon, chevronDownIcon, unAuthorizedIcon, settlementInitiatedIcon, unCapturedIcon, capturedIcon, authorizedIcon, openFlagIcon, closedFlagIcon, reverseActionIcon, authenticatedIcon, unauthenticatedIcon, paidOutFilterIcon, scheduledFilterIcon, completedBlackIcon, dashedCheckIcon, deactivatedIcon,
2
2
  // trashBinIcon,
3
3
  } from '../../constants/index.js';
4
4
  export const statusButtonIcons = {
@@ -22,4 +22,6 @@ export const statusButtonIcons = {
22
22
  paidOut: paidOutFilterIcon,
23
23
  scheduled: scheduledFilterIcon,
24
24
  checked: completedBlackIcon,
25
+ dashedChecked: dashedCheckIcon,
26
+ deactivated: deactivatedIcon,
25
27
  };
@@ -21,7 +21,7 @@ export declare const CountBadge: import("@emotion/styled").StyledComponent<impor
21
21
  }, {}, {}>;
22
22
  export declare const StatusIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
23
23
  variant: StatusButtonVariant;
24
- icon?: "search" | "scheduled" | "paidOut" | "reversed" | "checked" | "initiated" | "captured" | "unCaptured" | "inProgress" | "abandoned" | "cancelled" | "authorized" | "unauthenticated" | "authenticated" | "unSettled" | "reports" | "chevronDown" | "unAuthorized" | "openFlag" | "closedFlag" | undefined;
24
+ icon?: "search" | "scheduled" | "paidOut" | "reversed" | "checked" | "initiated" | "captured" | "unCaptured" | "inProgress" | "abandoned" | "cancelled" | "authorized" | "unauthenticated" | "authenticated" | "unSettled" | "reports" | "chevronDown" | "unAuthorized" | "openFlag" | "closedFlag" | "dashedChecked" | "deactivated" | undefined;
25
25
  }, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
26
26
  export declare const StyledFilterName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
27
27
  export declare const StyledDropdown: import("@emotion/styled").StyledComponent<import("../DropdownMenu").IProps & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { TextAndLang } from '../../../../types/index.js';
3
3
  type TerminalsBrandCellProps = {
4
- name: TextAndLang[];
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 TerminalsBrandCell: (props: TerminalsBrandCellProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
2
3
  import { useTranslation } from 'react-i18next';
3
4
  import Stack from '@mui/material/Stack';
4
5
  import Typography from '@mui/material/Typography';
@@ -7,12 +8,12 @@ import { getNameText } from '../../../../utils/index.js';
7
8
  const TerminalsBrandCell = (props) => {
8
9
  const { name, icon, displayRules } = props;
9
10
  const { i18n } = useTranslation();
11
+ const brandName = useMemo(() => (name ? getNameText(name, i18n.language) : null), [name, i18n.language]);
10
12
  if (!name && !icon)
11
13
  return null;
12
- const { showIcon, showLabel } = displayRules;
13
- const brandName = name ? getNameText(name, i18n.language) : '';
14
- const displayLabel = showLabel && !!brandName;
14
+ const { showIcon = true, showLabel = true } = displayRules || {};
15
15
  const displayIcon = showIcon && !!icon;
16
+ const displayLabel = showLabel;
16
17
  if (!displayIcon && !displayLabel)
17
18
  return null;
18
19
  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 })) })))] })));
@@ -2,7 +2,7 @@
2
2
  import { StackProps } from '@mui/material/Stack';
3
3
  import { TextAndLang } from '../../../../types/index.js';
4
4
  type TerminalsPlatformCellProps = StackProps & {
5
- name: TextAndLang[];
5
+ name?: TextAndLang[];
6
6
  icon?: React.ReactNode;
7
7
  displayRules?: {
8
8
  showIcon?: boolean;
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { memo } from 'react';
13
+ import { memo, useMemo } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import Stack from '@mui/material/Stack';
16
16
  import Typography from '@mui/material/Typography';
@@ -20,10 +20,10 @@ import { getNameText } from '../../../../utils/index.js';
20
20
  const TerminalsPlatformCell = (_a) => {
21
21
  var { name, icon, displayRules } = _a, props = __rest(_a, ["name", "icon", "displayRules"]);
22
22
  const { i18n } = useTranslation();
23
+ const platformName = useMemo(() => (name ? getNameText(name, i18n.language) : null), [name, i18n.language]);
23
24
  const { showIcon = true, showLabel = true } = displayRules || {};
24
- const platformName = getNameText(name, i18n.language);
25
25
  const displayIcon = showIcon && !!icon;
26
- const displayLabel = showLabel || !!platformName;
26
+ const displayLabel = showLabel;
27
27
  if (!displayIcon && !displayLabel)
28
28
  return null;
29
29
  return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsPlatformCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, props, { 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" }))) })) })))] })));
@@ -72,6 +72,8 @@ export declare const percentage100Icon: string;
72
72
  export declare const maximizeIcon: string;
73
73
  export declare const minimizeIcon: string;
74
74
  export declare const closeIcon: string;
75
+ export declare const dashedCheckIcon: string;
76
+ export declare const deactivatedIcon: string;
75
77
  export declare const topUpIcon: string;
76
78
  export declare const deMaximizeIcon: string;
77
79
  export declare const pendingFlag: string;
@@ -77,6 +77,8 @@ export const percentage100Icon = `${lightUrl}/percentage100.svg`;
77
77
  export const maximizeIcon = `${lightUrl}/maximize.svg`;
78
78
  export const minimizeIcon = `${lightUrl}/minimize.svg`;
79
79
  export const closeIcon = `${lightUrl}/close.svg`;
80
+ export const dashedCheckIcon = `${lightUrl}/dashedCheckIcon.svg`;
81
+ export const deactivatedIcon = `${lightUrl}/deactivatedIcon.svg`;
80
82
  export const topUpIcon = `${lightUrl}/topup.svg`;
81
83
  export const deMaximizeIcon = `${appBaseUrl}/demaximize.svg`;
82
84
  export const pendingFlag = `${lightUrl}/pendingFlag.svg`;
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.141",
4
+ "version": "0.1.143",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",