@tap-payments/os-micro-frontend-shared 0.1.402 → 0.1.404

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.
@@ -3,7 +3,7 @@ import { useState, memo } from 'react';
3
3
  import Box from '@mui/material/Box';
4
4
  import { HoverContainer, IconWrapper, PlusBadgeWrapper } from './style';
5
5
  import Tooltip from '../Tooltip';
6
- import { startCase } from 'lodash';
6
+ import startCase from 'lodash/startCase';
7
7
  function IconWithHoverOverlays({ mainIcon, overlayIcons }) {
8
8
  const [isHovering, setIsHovering] = useState(false);
9
9
  const handleMouseEnter = () => {
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { destinationStatusIcons } from './constant';
3
3
  import { StatusIcon, StatusIconWrapper, TextLabel } from './style';
4
4
  import Tooltip from '../../Tooltip';
5
- import { camelCase } from 'lodash';
5
+ import camelCase from 'lodash/camelCase';
6
6
  import { useTheme } from '@mui/material';
7
7
  import { t } from 'i18next';
8
8
  import StatusChipWithCopy from '../../StatusChipWithCopy';
@@ -1,15 +1,18 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Box from '@mui/material/Box';
3
3
  import { useTranslation } from 'react-i18next';
4
+ import camelCase from 'lodash/camelCase';
4
5
  import Tooltip from '../../../Tooltip';
5
6
  import { statusIcons, unCapturedStatusesStyles } from '../../../TableCells/CustomCells/StatusCell/constant';
6
7
  import { StatusIcon } from '../../../TableCells/CustomCells/style';
8
+ import { unCapturedStatuses } from '../../../../constants/index.js';
7
9
  import { ErrorChip, StatusIconWrapper } from './style';
8
10
  export function ChargeStatusIcon({ chargeStatus, chargeTooltip, errorCode, iconStyles, iconWrapperStyles }) {
9
11
  const { t } = useTranslation();
10
12
  const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
11
13
  const chargeIcon = chargeStatus && statusIcons[chargeStatus] && (_jsx(StatusIconWrapper, Object.assign({ style: iconWrapperStyles }, { children: _jsx(StatusIcon, { src: statusIcons[chargeStatus], alt: "charge-icon", style: Object.assign({ width: '16px', height: '16px' }, iconStyles) }) })));
14
+ const chargeTooltipTitle = chargeTooltip && (_jsx(_Fragment, { children: _jsx("div", { children: chargeTooltip }) }));
12
15
  if (!chargeStatus)
13
16
  return null;
14
- return (_jsx(Tooltip, Object.assign({ title: chargeTooltip !== null && chargeTooltip !== void 0 ? chargeTooltip : t(chargeStatus) }, { children: _jsxs(Box, Object.assign({ sx: { display: 'flex', gap: '6px', alignItems: 'center' } }, { children: [chargeIcon, errorCode && _jsx(ErrorChip, Object.assign({ style: { background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color } }, { children: errorCode }))] })) })));
17
+ return (_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsxs(Box, Object.assign({ sx: { display: 'flex', gap: '6px', alignItems: 'center' } }, { children: [chargeIcon, !!(unCapturedStatuses === null || unCapturedStatuses === void 0 ? void 0 : unCapturedStatuses.includes(chargeStatus || '')) && (_jsx(ErrorChip, Object.assign({ style: { background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color } }, { children: errorCode })))] })) })));
15
18
  }
@@ -1,11 +1,11 @@
1
- import { deletedStatusIcon, draftStatusIcon, createdStatusIcon, cancelledStatusIcon, expiredStatusIcon, paidStatusIcon, refundedStatusIcon, deliveredStatusIcon, viewedStatusIcon, savedStatusIcon, scheduledStatusIcon, pendingStatusIcon, } from '../../../../constants/index.js';
1
+ import { deletedStatusIcon, draftStatusIcon, createdStatusIcon, paidStatusIcon, refundedStatusIcon, deliveredStatusIcon, viewedStatusIcon, savedStatusIcon, scheduledStatusIcon, pendingStatusIcon, cancelledInvoiceIcon, expiredInvoiceIcon, } from '../../../../constants/index.js';
2
2
  export const statusIcons = {
3
3
  DELETED: deletedStatusIcon,
4
4
  DRAFT: draftStatusIcon,
5
5
  CREATED: createdStatusIcon,
6
- CANCELLED: cancelledStatusIcon,
7
- CANCELED: cancelledStatusIcon,
8
- EXPIRED: expiredStatusIcon,
6
+ CANCELLED: cancelledInvoiceIcon,
7
+ CANCELED: cancelledInvoiceIcon,
8
+ EXPIRED: expiredInvoiceIcon,
9
9
  PAID: paidStatusIcon,
10
10
  REFUNDED: refundedStatusIcon,
11
11
  DELIVERED: deliveredStatusIcon,
@@ -1,4 +1,5 @@
1
- import { capitalize, startCase } from 'lodash';
1
+ import capitalize from 'lodash/capitalize';
2
+ import startCase from 'lodash/startCase';
2
3
  export const removePrefixFromString = (str, prefix) => {
3
4
  if (!prefix) {
4
5
  return str;
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.402",
4
+ "version": "0.1.404",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",