@tap-payments/os-micro-frontend-shared 0.1.387 → 0.1.389-test.1

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 (60) hide show
  1. package/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
  2. package/build/components/Chip/style.d.ts +0 -1
  3. package/build/components/CountBadge/style.d.ts +0 -1
  4. package/build/components/Dialog/style.d.ts +0 -1
  5. package/build/components/FlippingCard/style.d.ts +0 -1
  6. package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
  7. package/build/components/JSONViewer/style.d.ts +0 -1
  8. package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
  9. package/build/components/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.js +2 -3
  10. package/build/components/RightLeftExpandingCenterChip/style.d.ts +4 -3
  11. package/build/components/RightLeftExpandingCenterChip/style.js +3 -2
  12. package/build/components/SearchButton/styles.d.ts +0 -1
  13. package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
  14. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
  15. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
  16. package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
  17. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
  18. package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +0 -1
  19. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
  20. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
  21. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
  22. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
  23. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
  24. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
  25. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
  26. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
  27. package/build/components/TableCells/CustomCells/DueDateCell/DueDateCell.d.ts +1 -1
  28. package/build/components/TableCells/CustomCells/DueDateCell/DueDateCell.js +14 -170
  29. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
  30. package/build/components/TableCells/CustomCells/DueDateCell/type.d.ts +0 -2
  31. package/build/components/TableCells/CustomCells/DueDateCell/utils.d.ts +8 -0
  32. package/build/components/TableCells/CustomCells/DueDateCell/utils.js +43 -1
  33. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
  34. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
  35. package/build/components/TableCells/CustomCells/InvoiceStatusCell/ChargeStatusIcon.d.ts +11 -0
  36. package/build/components/TableCells/CustomCells/InvoiceStatusCell/ChargeStatusIcon.js +14 -0
  37. package/build/components/TableCells/CustomCells/InvoiceStatusCell/InvoiceStatusCell.d.ts +1 -1
  38. package/build/components/TableCells/CustomCells/InvoiceStatusCell/InvoiceStatusCell.js +29 -59
  39. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +2 -1
  40. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.js +18 -0
  41. package/build/components/TableCells/CustomCells/InvoiceStatusCell/type.d.ts +1 -0
  42. package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
  43. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
  44. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
  45. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
  46. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
  47. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
  48. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
  49. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
  50. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
  51. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
  52. package/build/components/TableCells/CustomCells/style.d.ts +0 -1
  53. package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
  54. package/build/components/TableReports/style.d.ts +0 -1
  55. package/build/components/VirtualTables/components/style.d.ts +0 -1
  56. package/build/constants/apps.d.ts +0 -1
  57. package/build/constants/apps.js +0 -14
  58. package/build/utils/date.d.ts +1 -0
  59. package/build/utils/date.js +3 -0
  60. package/package.json +3 -3
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  type AnimatedSpinnerIconProps = {
4
3
  width?: string;
5
4
  height?: string;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import { GetSourceAnimationFunction } from './type';
4
3
  export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
5
4
  variant?: import("./type").ChipVariant | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AgreementImageWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DialogWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  declare const ImageWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const FOOTER_HEIGHT = 37;
4
3
  export declare const TITLE_BAR_HEIGHT = "32px";
5
4
  export declare const VIEWER_HEIGHT = 545;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import type { SxProps, Theme } from '@mui/material/styles';
4
3
  export declare const CHIP_GAP = 3;
5
4
  export declare const DEFAULT_CHIP_MIN_WIDTH = 24;
@@ -10,9 +10,8 @@ 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 Box from '@mui/material/Box';
14
13
  import { AnimatePresence } from 'framer-motion';
15
- import { CenterIconWrapper, ExpandedSection, PeekContainer, CenterChip, LeftPeekChip, RightPeekChip, LeftExpandIcon, RightExpandIcon, ExpandChip, CenterShiftWrapper, CenterContent, ExpandableContainer, ExpandableInner, tableCellSx, CHIP_GAP, HoverBridge, } from './style';
14
+ import { CenterIconWrapper, ExpandedSection, PeekContainer, CenterChip, LeftPeekChip, RightPeekChip, LeftExpandIcon, RightExpandIcon, ExpandChip, CenterShiftWrapper, CenterContent, ExpandableContainer, ExpandableInner, ChipsContainer, CHIP_GAP, HoverBridge, } from './style';
16
15
  import { useRightLeftExpandingCenterChip, DEFAULT_CHIP_MIN_WIDTH } from './useRightLeftExpandingCenterChip';
17
16
  /**
18
17
  * Component: RightLeftExpandingCenterChip
@@ -49,7 +48,7 @@ import { useRightLeftExpandingCenterChip, DEFAULT_CHIP_MIN_WIDTH } from './useRi
49
48
  function RightLeftExpandingCenterChip(_a) {
50
49
  var { leftIcons = [], rightIcons = [], centerIcon, expandableCenterRight, expandableCenterLeft, expandedZIndex = 1000 } = _a, props = __rest(_a, ["leftIcons", "rightIcons", "centerIcon", "expandableCenterRight", "expandableCenterLeft", "expandedZIndex"]);
51
50
  const { isHovering, handleMouseEnter, handleMouseLeave, centerWrapRef, centerContentRef, centerChipRef, anchors, leftChipRefs, rightChipRefs, leftOffsets, rightOffsets, expandableRightInnerRef, expandableLeftInnerRef, expandedRightMV, expandedLeftMV, shiftX, rightShift, leftShift, leftHoverWidth, rightHoverWidth, } = useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerIcon, expandableCenterRight, expandableCenterLeft });
52
- return (_jsx(Box, Object.assign({}, props, { "data-testid": "RightLeftExpandingCenterChipBox", sx: tableCellSx }, { children: _jsx(CenterShiftWrapper, Object.assign({ "data-testid": "CenterShiftWrapper", initial: false, style: { x: shiftX } }, { children: _jsxs(CenterIconWrapper, Object.assign({ "data-testid": "CenterIconWrapper", ref: centerWrapRef, onMouseLeave: handleMouseLeave }, { children: [_jsxs(PeekContainer, Object.assign({ "data-testid": "PeekContainer" }, { children: [_jsx(AnimatePresence, Object.assign({ initial: false }, { children: leftIcons.length > 0 && (_jsx(LeftPeekChip, { "data-testid": "LeftPeekChip", initial: { opacity: 0, scale: 0.95, x: -4 }, animate: isHovering ? { opacity: 0, scale: 0.9, x: -6 } : { opacity: 1, scale: 1, x: -5 }, exit: { opacity: 0, scale: 0.95, x: -4 }, transition: { duration: 0.18, ease: 'easeOut' } }, "left-peek")) })), _jsx(CenterChip, Object.assign({ "data-testid": "CenterChip", ref: centerChipRef, onMouseEnter: handleMouseEnter, style: {
51
+ return (_jsx(ChipsContainer, Object.assign({}, props, { "data-testid": "RightLeftExpandingCenterChipBox" }, { children: _jsx(CenterShiftWrapper, Object.assign({ "data-testid": "CenterShiftWrapper", initial: false, style: { x: shiftX } }, { children: _jsxs(CenterIconWrapper, Object.assign({ "data-testid": "CenterIconWrapper", ref: centerWrapRef, onMouseLeave: handleMouseLeave }, { children: [_jsxs(PeekContainer, Object.assign({ "data-testid": "PeekContainer" }, { children: [_jsx(AnimatePresence, Object.assign({ initial: false }, { children: leftIcons.length > 0 && (_jsx(LeftPeekChip, { "data-testid": "LeftPeekChip", initial: { opacity: 0, scale: 0.95, x: -4 }, animate: isHovering ? { opacity: 0, scale: 0.9, x: -6 } : { opacity: 1, scale: 1, x: -5 }, exit: { opacity: 0, scale: 0.95, x: -4 }, transition: { duration: 0.18, ease: 'easeOut' } }, "left-peek")) })), _jsx(CenterChip, Object.assign({ "data-testid": "CenterChip", ref: centerChipRef, onMouseEnter: handleMouseEnter, style: {
53
52
  borderRadius: (() => {
54
53
  const hasLeftExpanded = expandableCenterLeft && isHovering;
55
54
  const hasRightExpanded = expandableCenterRight && isHovering;
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
- import type { SxProps, Theme } from '@mui/material/styles';
2
+ import { type Theme } from '@mui/material/styles';
4
3
  export declare const CHIP_GAP = 3;
5
4
  export declare const CenterIconWrapper: import("@emotion/styled").StyledComponent<{
6
5
  hidden?: boolean | undefined;
@@ -3413,4 +3412,6 @@ export declare const ExpandChip: import("@emotion/styled").StyledComponent<{
3413
3412
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
3414
3413
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
3415
3414
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
3416
- export declare const tableCellSx: SxProps<Theme>;
3415
+ export declare const ChipsContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3416
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
3417
+ }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
@@ -1,3 +1,4 @@
1
+ import Box from '@mui/material/Box';
1
2
  import { styled } from '@mui/material/styles';
2
3
  import { motion } from 'framer-motion';
3
4
  // Shared spacing between chips
@@ -118,7 +119,7 @@ export const RightPeekChip = styled(motion.div)(({ theme }) => (Object.assign(Ob
118
119
  // Chip for expanded icons (left/right lists)
119
120
  export const ExpandChip = styled(motion.div)(({ theme }) => (Object.assign(Object.assign({}, baseChipStyles(theme)), { minWidth: 24, flex: '0 0 auto', display: 'inline-flex' })));
120
121
  // Styles applied to the containing TableCell
121
- export const tableCellSx = {
122
+ export const ChipsContainer = styled(Box)(() => ({
122
123
  position: 'relative',
123
124
  overflow: 'visible',
124
125
  zIndex: 101,
@@ -126,4 +127,4 @@ export const tableCellSx = {
126
127
  alignItems: 'center',
127
128
  justifyContent: 'center',
128
129
  minHeight: '20px',
129
- };
130
+ }));
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledInput: import("@emotion/styled").StyledComponent<{
4
3
  width?: string | number | undefined;
5
4
  height?: string | number | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const ErrorCodeLabel: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import { TableMode } from '../../../../types/index.js';
4
3
  export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
5
4
  tableMode?: TableMode | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AgreementCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledAgreementCardIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const CardContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
3
  export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,3 +1,3 @@
1
1
  import { DueCellProps } from './type';
2
- declare function DueDateCell({ dueDate, expiryDate, remindedCount, isTextShown, ...props }: DueCellProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function DueDateCell({ dueDate, expiryDate, ...props }: DueCellProps): import("react/jsx-runtime").JSX.Element | null;
3
3
  export default DueDateCell;
@@ -9,178 +9,22 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useEffect, useRef, useState } from 'react';
14
- import { useTheme } from '@mui/material/styles';
15
- import dayjs from 'dayjs';
16
- import { motion } from 'framer-motion';
17
- import { useTranslation } from 'react-i18next';
18
- import StyledBadge, { BadgeVariants } from '../../../CountBadge';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { useMemo } from 'react';
19
14
  import { TableCell } from '../../../TableCells';
20
15
  import Tooltip from '../../../Tooltip';
21
- import { dueDateBlueIcon, dueDateRedIcon, timerBlueIcon, expiredIcon, dueDateGrayIcon, remindedRedIcon } from '../../../../constants/index.js';
22
- import { DueDateCellContainer, DateIcon, ReminderTextLabel, ExpiredTextLabel } from './style';
23
- import { formatDate } from './utils';
16
+ import { RightLeftExpandingCenterChip } from '../../../RightLeftExpandingCenterChip';
17
+ import { DateIcon } from './style';
18
+ import { buildDueMeta, buildExpiryMeta } from './utils';
24
19
  function DueDateCell(_a) {
25
- var { dueDate, expiryDate, remindedCount, isTextShown } = _a, props = __rest(_a, ["dueDate", "expiryDate", "remindedCount", "isTextShown"]);
26
- const theme = useTheme();
27
- const dueDateRef = useRef(null);
28
- const expiryRef = useRef(null);
29
- const [dueDateRefClientWidth, setDueDateRefClientWidth] = useState(0);
30
- const [expiryRefClientWidth, setReminderRefClientWidth] = useState(0);
31
- useEffect(() => {
32
- var _a, _b;
33
- setDueDateRefClientWidth((_a = dueDateRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth);
34
- setReminderRefClientWidth((_b = expiryRef === null || expiryRef === void 0 ? void 0 : expiryRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth);
35
- }, [isTextShown]);
36
- const { t } = useTranslation();
37
- const isDueDatePassed = dayjs(dueDate).isBefore(dayjs(), 'day');
38
- const isDueDateAfterTomorrow = dayjs(dueDate).isAfter(dayjs().add(2, 'day'), 'day');
39
- let icon = dueDateBlueIcon;
40
- let color = theme.palette.info.dark;
41
- const date = formatDate(dayjs(dueDate).valueOf());
42
- let backgroundColor = theme.palette.custom['200'];
43
- if (isDueDatePassed) {
44
- icon = dueDateRedIcon;
45
- color = theme.palette.error.main;
46
- backgroundColor = theme.palette.custom['300'];
47
- }
48
- else if (isDueDateAfterTomorrow) {
49
- icon = dueDateGrayIcon;
50
- color = theme.palette.grey.A700;
51
- backgroundColor = theme.palette.custom['400'];
52
- }
53
- let expiryDateTimeLeft = dayjs(expiryDate).diff(dayjs(), 'day');
54
- let expiryDateTimeLeftText = 'days';
55
- const isExpired = dayjs(expiryDate).isBefore(dayjs(), 'second');
56
- if (expiryDateTimeLeft < 1) {
57
- expiryDateTimeLeft = dayjs(expiryDate).diff(dayjs(), 'hour');
58
- expiryDateTimeLeftText = 'hours';
59
- }
60
- if (expiryDateTimeLeft < 1) {
61
- expiryDateTimeLeft = dayjs(expiryDate).diff(dayjs(), 'minute');
62
- expiryDateTimeLeftText = 'minutes';
63
- }
64
- if (expiryDateTimeLeft < 1) {
65
- expiryDateTimeLeft = dayjs(expiryDate).diff(dayjs(), 'second');
66
- expiryDateTimeLeftText = 'seconds';
67
- }
68
- const isExpiryLeftTimeMoreThanOneDay = dayjs(expiryDate).diff(dayjs(), 'day') > 1;
69
- const expiryDateTimestamp = dayjs(expiryDate).valueOf();
70
- const timeLeftLabel = isExpiryLeftTimeMoreThanOneDay ? formatDate(expiryDateTimestamp) : `${expiryDateTimeLeft} ${expiryDateTimeLeftText} left`;
71
- const expiredDate = formatDate(expiryDateTimestamp);
72
- const expiredDateLabel = `Expired on ${expiredDate}`;
73
- const shownLabel = isExpired ? expiredDateLabel : timeLeftLabel;
74
- const isRemindedExpansionShown = remindedCount > 1;
75
- const reminderLeftOffset = (dueDateRefClientWidth || 0) + (expiryRefClientWidth || 0);
76
- return (_jsx(TableCell, Object.assign({}, props, { sx: {
77
- position: 'relative',
78
- overflow: 'visible',
79
- } }, { children: _jsxs("div", Object.assign({ style: {
80
- display: 'flex',
81
- alignItems: 'center',
82
- justifyContent: 'flex-start',
83
- gap: '8px',
84
- overflow: 'visible',
85
- } }, { children: [!!dueDate && (_jsx(Tooltip, Object.assign({ title: isTextShown ? '' : date }, { children: _jsxs(DueDateCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", ref: dueDateRef, sx: Object.assign({ zIndex: 28, position: 'absolute', overflow: 'visible' }, (isTextShown && { paddingInline: theme.spacing(1) })), background: backgroundColor, variants: {
86
- animate: Object.assign({}, (!isTextShown && { boxShadow: theme.shadows[4], paddingInlineEnd: theme.spacing(1) })),
87
- } }, { children: [isTextShown ? (_jsx("span", Object.assign({ style: {
88
- color,
89
- } }, { children: isDueDatePassed ? 'Past Due' : `Due ${date}` }))) : (_jsx(DateIcon, { src: icon, alt: "icon" })), !isTextShown && (_jsx(motion.div, Object.assign({ style: {
90
- display: 'none',
91
- alignItems: 'center',
92
- justifyContent: 'center',
93
- gap: '4px',
94
- width: 0,
95
- }, initial: { width: 0, opacity: 0 }, transition: {
96
- animate: {
97
- duration: 0.5,
98
- },
99
- fadeIn: {
100
- duration: 0.2,
101
- },
102
- }, variants: {
103
- animate: {
104
- width: 'auto',
105
- display: 'flex',
106
- },
107
- fadeIn: {
108
- transition: {
109
- delay: 0.5,
110
- },
111
- opacity: 1,
112
- },
113
- } }, { children: date && _jsxs("span", Object.assign({ style: { color } }, { children: [date, " "] })) })))] })) }))), expiryDate && (_jsx(Tooltip, Object.assign({ title: isTextShown ? '' : shownLabel }, { children: _jsxs(DueDateCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", ref: expiryRef, sx: Object.assign({ zIndex: 27, position: 'absolute', left: isTextShown ? (dueDateRefClientWidth || 0) + 8 : '32px' }, (isTextShown && { paddingInline: theme.spacing(1) })), background: isExpired ? theme.palette.custom['100'] : theme.palette.custom['50'], variants: {
114
- animate: Object.assign({}, (!isTextShown && { boxShadow: theme.shadows[4], paddingInlineEnd: theme.spacing(1) })),
115
- } }, { children: [isTextShown ? (_jsx(ExpiredTextLabel, Object.assign({ sx: {
116
- color: isExpired ? theme.palette.custom[500] : theme.palette.info.dark,
117
- background: isExpired ? `${theme.palette.custom[500]}0d` : `${theme.palette.info.dark}0d`,
118
- } }, { children: isExpired ? 'Expired' : `Expiry ${shownLabel}` }))) : (_jsx(DateIcon, { src: isExpired ? expiredIcon : timerBlueIcon, alt: "icon" })), !isTextShown && (_jsx(motion.div, Object.assign({ style: {
119
- display: 'none',
120
- alignItems: 'center',
121
- justifyContent: 'center',
122
- gap: '4px',
123
- width: 0,
124
- }, initial: { width: 0, opacity: 0 }, transition: {
125
- animate: {
126
- duration: 0.5,
127
- },
128
- fadeIn: {
129
- duration: 0.2,
130
- },
131
- }, variants: {
132
- animate: {
133
- width: 'auto',
134
- display: 'flex',
135
- },
136
- fadeIn: {
137
- transition: {
138
- delay: 0.5,
139
- },
140
- opacity: 1,
141
- },
142
- } }, { children: shownLabel && _jsx("span", Object.assign({ style: { color: isExpired ? theme.palette.custom[500] : theme.palette.info.dark } }, { children: shownLabel })) })))] })) }))), remindedCount > 0 && (_jsx(Tooltip, Object.assign({ title: t('reminded') }, { children: _jsxs(DueDateCellContainer, Object.assign({ whileHover: isRemindedExpansionShown ? ['animate', 'fadeIn'] : [], animate: "start", sx: {
143
- zIndex: 26,
144
- left: isTextShown ? reminderLeftOffset + (reminderLeftOffset ? 16 : 0) : '64px',
145
- position: 'absolute',
146
- overflow: 'visible',
147
- border: `1px solid ${theme.palette.error.main}1A`,
148
- paddingInline: isTextShown ? theme.spacing(1) : theme.spacing(0.5),
149
- }, background: isTextShown ? theme.palette.common.white : theme.palette.custom['600'], variants: {
150
- animate: {
151
- boxShadow: theme.shadows[4],
152
- },
153
- } }, { children: [isTextShown ? (_jsx(ReminderTextLabel, { children: "Reminder" })) : (_jsx(DateIcon, { sx: {
154
- width: '14px',
155
- height: '14px',
156
- }, src: remindedRedIcon, alt: "icon" })), _jsx(motion.div, Object.assign({ style: {
157
- display: 'none',
158
- alignItems: 'center',
159
- justifyContent: 'center',
160
- gap: '4px',
161
- width: 0,
162
- }, initial: { width: 0, opacity: 0 }, transition: {
163
- animate: {
164
- duration: 0.5,
165
- },
166
- fadeIn: {
167
- duration: 0.2,
168
- },
169
- }, variants: {
170
- animate: {
171
- width: 'auto',
172
- display: 'flex',
173
- },
174
- fadeIn: {
175
- transition: {
176
- delay: 0.5,
177
- },
178
- opacity: 1,
179
- },
180
- } }, { children: isRemindedExpansionShown && (_jsx(StyledBadge, Object.assign({ variant: BadgeVariants.DEFAULT, style: {
181
- background: theme.palette.error.main,
182
- fontWeight: 'bold',
183
- color: theme.palette.common.white,
184
- } }, { children: remindedCount }))) }))] })) })))] })) })));
20
+ var { dueDate, expiryDate } = _a, props = __rest(_a, ["dueDate", "expiryDate"]);
21
+ const dueMeta = useMemo(() => buildDueMeta(dueDate), [dueDate]);
22
+ const expiryMeta = useMemo(() => buildExpiryMeta(expiryDate), [expiryDate]);
23
+ const renderIcon = (meta) => (_jsx(Tooltip, Object.assign({ title: meta.label }, { children: _jsx(DateIcon, { src: meta.icon, alt: "icon" }) })));
24
+ const centerIcon = useMemo(() => (dueMeta ? renderIcon(dueMeta) : expiryMeta ? renderIcon(expiryMeta) : null), [dueMeta, expiryMeta]);
25
+ const rightIcons = useMemo(() => (expiryMeta && dueMeta ? [renderIcon(expiryMeta)] : []), [dueMeta, expiryMeta]);
26
+ if (!dueMeta && !expiryMeta)
27
+ return null;
28
+ return (_jsx(TableCell, Object.assign({}, props, { sx: { position: 'relative', overflow: 'visible' } }, { children: _jsx(RightLeftExpandingCenterChip, { sx: { justifyContent: 'flex-start' }, centerIcon: centerIcon, rightIcons: rightIcons }) })));
185
29
  }
186
30
  export default DueDateCell;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -2,6 +2,4 @@ import { TableCellProps } from '@mui/material';
2
2
  export interface DueCellProps extends TableCellProps {
3
3
  dueDate?: string | Date;
4
4
  expiryDate?: string | Date;
5
- remindedCount: number;
6
- isTextShown?: boolean;
7
5
  }
@@ -1 +1,9 @@
1
1
  export declare function formatDate(date?: number): string;
2
+ export declare function buildDueMeta(dueDate?: Date | string): {
3
+ icon: string;
4
+ label: string;
5
+ } | null;
6
+ export declare function buildExpiryMeta(expiryDate?: Date | string): {
7
+ icon: string;
8
+ label: string;
9
+ } | null;
@@ -1,4 +1,6 @@
1
- import { formatCellDate } from '../../../../utils/index.js';
1
+ import dayjs from 'dayjs';
2
+ import { formatCellDate, isValidDate } from '../../../../utils/index.js';
3
+ import { dueDateBlueIcon, dueDateRedIcon, dueDateGrayIcon, expiredIcon, timerBlueIcon } from '../../../../constants/index.js';
2
4
  export function formatDate(date) {
3
5
  return formatCellDate(date, {
4
6
  sameDay: '[Today at] h:mm A',
@@ -9,3 +11,43 @@ export function formatDate(date) {
9
11
  nextWeek: 'MMM DD, YYYY',
10
12
  });
11
13
  }
14
+ export function buildDueMeta(dueDate) {
15
+ if (!isValidDate(dueDate))
16
+ return null;
17
+ let icon = dueDateBlueIcon;
18
+ if (dayjs(dueDate).isBefore(dayjs(), 'day')) {
19
+ icon = dueDateRedIcon;
20
+ }
21
+ else if (dayjs(dueDate).isAfter(dayjs().add(2, 'day'), 'day')) {
22
+ icon = dueDateGrayIcon;
23
+ }
24
+ return { icon, label: formatDate(dayjs(dueDate).valueOf()) };
25
+ }
26
+ export function buildExpiryMeta(expiryDate) {
27
+ if (!isValidDate(expiryDate))
28
+ return null;
29
+ let expiryDateTimeLeft = dayjs(expiryDate).diff(dayjs(), 'day');
30
+ let expiryDateTimeLeftText = 'days';
31
+ const isExpired = dayjs(expiryDate).isBefore(dayjs(), 'second');
32
+ if (expiryDateTimeLeft < 1) {
33
+ expiryDateTimeLeft = dayjs(expiryDate).diff(dayjs(), 'hour');
34
+ expiryDateTimeLeftText = 'hours';
35
+ }
36
+ if (expiryDateTimeLeft < 1) {
37
+ expiryDateTimeLeft = dayjs(expiryDate).diff(dayjs(), 'minute');
38
+ expiryDateTimeLeftText = 'minutes';
39
+ }
40
+ if (expiryDateTimeLeft < 1) {
41
+ expiryDateTimeLeft = dayjs(expiryDate).diff(dayjs(), 'second');
42
+ expiryDateTimeLeftText = 'seconds';
43
+ }
44
+ const isExpiryLeftTimeMoreThanOneDay = dayjs(expiryDate).diff(dayjs(), 'day') > 1;
45
+ const expiryDateTimestamp = dayjs(expiryDate).valueOf();
46
+ const timeLeftLabel = isExpiryLeftTimeMoreThanOneDay
47
+ ? formatDate(expiryDateTimestamp) // Use your custom formatDate function
48
+ : `${expiryDateTimeLeft} ${expiryDateTimeLeftText} left`;
49
+ const expiredDateLabel = `Expired on ${formatDate(expiryDateTimestamp)}`; // Use your function here too
50
+ const label = isExpired ? expiredDateLabel : timeLeftLabel;
51
+ const icon = isExpired ? expiredIcon : timerBlueIcon;
52
+ return { icon, label };
53
+ }
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -0,0 +1,11 @@
1
+ import { CSSProperties } from 'react';
2
+ import { type ChargeStatus } from '../../../TableCells';
3
+ interface SmallChargeStatusIconProps {
4
+ chargeStatus?: ChargeStatus;
5
+ chargeTooltip?: string;
6
+ errorCode?: string;
7
+ iconStyles?: CSSProperties;
8
+ iconWrapperStyles?: CSSProperties;
9
+ }
10
+ export declare function ChargeStatusIcon({ chargeStatus, chargeTooltip, errorCode, iconStyles, iconWrapperStyles }: Readonly<SmallChargeStatusIconProps>): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Box from '@mui/material/Box';
3
+ import { useTranslation } from 'react-i18next';
4
+ import Tooltip from '../../../Tooltip';
5
+ import { statusIcons } from '../../../TableCells/CustomCells/StatusCell/constant';
6
+ import { StatusIcon } from '../../../TableCells/CustomCells/style';
7
+ import { ErrorChip, StatusIconWrapper } from './style';
8
+ export function ChargeStatusIcon({ chargeStatus, chargeTooltip, errorCode, iconStyles, iconWrapperStyles }) {
9
+ const { t } = useTranslation();
10
+ if (!chargeStatus)
11
+ return null;
12
+ const chargeIcon = 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) }) })));
13
+ 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, { children: errorCode })] })) })));
14
+ }
@@ -1,2 +1,2 @@
1
1
  import { DueCellProps } from './type';
2
- export default function InvoiceStatusCell({ status, date, viewsCount, chargeStatus, errorCode, chargeTooltip, isTextShown, ...props }: DueCellProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function InvoiceStatusCell({ status, date, viewsCount, chargeStatus, errorCode, chargeTooltip, remindedCount, ...props }: DueCellProps): import("react/jsx-runtime").JSX.Element;
@@ -9,81 +9,51 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import dayjs from 'dayjs';
15
- import { motion } from 'framer-motion';
16
- import camelCase from 'lodash/camelCase';
17
- import capitalize from 'lodash/capitalize';
18
15
  import { useTheme } from '@mui/material/styles';
19
16
  import StyledBadge, { BadgeVariants } from '../../../CountBadge';
20
17
  import Tooltip from '../../../Tooltip';
21
18
  import { TableCell } from '../../../TableCells';
22
19
  import { formatDate } from '../../../TableCells/CustomCells/DueDateCell/utils';
23
20
  import { chargeStatusIcons } from '../../../TableCells/CustomCells/AuthenticationStatusCell/constant';
24
- import { ChargeStatusIcon } from '../../../StatusIcons';
25
21
  import { statusIcons } from './constant';
26
- import { DueDateCellContainer, DateIcon, StatusTextLabel } from './style';
22
+ import { DateIcon } from './style';
27
23
  import { invoiceStatusStyles } from './utils';
28
- import { StatusIconWrapper } from '../style';
24
+ import { ChargeStatusIcon } from './ChargeStatusIcon';
25
+ import { Box } from '@mui/material';
26
+ import { remindedRedIcon } from '../../../../constants/index.js';
27
+ import { RightLeftExpandingCenterChip } from '../../../RightLeftExpandingCenterChip';
29
28
  export default function InvoiceStatusCell(_a) {
30
- var { status, date, viewsCount, chargeStatus, errorCode, chargeTooltip, isTextShown } = _a, props = __rest(_a, ["status", "date", "viewsCount", "chargeStatus", "errorCode", "chargeTooltip", "isTextShown"]);
31
- const theme = useTheme();
29
+ var { status, date, viewsCount, chargeStatus, errorCode, chargeTooltip, remindedCount = 0 } = _a, props = __rest(_a, ["status", "date", "viewsCount", "chargeStatus", "errorCode", "chargeTooltip", "remindedCount"]);
32
30
  const { t } = useTranslation();
31
+ const theme = useTheme();
33
32
  const icon = status ? statusIcons[status] : null;
34
33
  const statusStyles = invoiceStatusStyles(status);
35
- const showExpansion = viewsCount !== 0 && !!viewsCount && status === 'VIEWED';
36
34
  const statusTooltip = `${t((status === null || status === void 0 ? void 0 : status.toLowerCase()) || '')} ${formatDate(dayjs(date).valueOf())}`;
37
35
  return (_jsx(TableCell, Object.assign({}, props, { sx: {
38
36
  position: 'relative',
39
37
  overflow: 'visible',
40
- } }, { children: _jsxs("div", Object.assign({ style: {
41
- display: 'flex',
42
- alignItems: 'center',
43
- justifyContent: 'flex-start',
44
- gap: '8px',
45
- overflow: 'visible',
46
- } }, { children: [_jsx(Tooltip, Object.assign({ title: t(statusTooltip || '') }, { children: _jsx(DueDateCellContainer, Object.assign({ whileHover: showExpansion ? ['animate', 'fadeIn'] : [], animate: "start", sx: Object.assign({ zIndex: 25, position: 'absolute' }, (isTextShown && {
47
- border: `1px solid ${statusStyles.color}1A`,
48
- })), variants: {
49
- animate: Object.assign({}, (showExpansion && {
50
- boxShadow: theme.shadows[4],
51
- })),
52
- }, background: statusStyles.background }, { children: (icon || (isTextShown && status)) && (_jsxs(_Fragment, { children: [isTextShown ? (_jsx(StatusTextLabel, Object.assign({ sx: {
53
- color: statusStyles.color,
54
- } }, { children: capitalize(status) }))) : (icon && _jsx(DateIcon, { src: icon, alt: "icon" })), _jsx(motion.div, Object.assign({ style: {
55
- alignItems: 'center',
56
- justifyContent: 'center',
57
- gap: '4px',
58
- display: 'none',
59
- width: 0,
60
- }, initial: { width: 0, opacity: 0 }, transition: {
61
- animate: {
62
- duration: 0.5,
63
- },
64
- fadeIn: {
65
- duration: 0.2,
66
- },
67
- }, variants: {
68
- animate: {
69
- width: 'auto',
70
- display: 'flex',
71
- },
72
- fadeIn: {
73
- transition: {
74
- delay: 0.5,
75
- },
76
- opacity: 1,
77
- },
78
- } }, { children: showExpansion && (_jsx(StyledBadge, Object.assign({ variant: BadgeVariants.DEFAULT, style: {
79
- color: '#fff',
80
- backgroundColor: statusStyles.color,
81
- } }, { children: viewsCount }))) }))] })) })) })), _jsx(StatusIconWrapper, Object.assign({ sx: {
82
- position: 'absolute',
83
- left: isTextShown ? '88px' : '32px',
84
- width: isTextShown ? '65px' : '24px',
85
- } }, { children: chargeStatus && chargeStatusIcons[chargeStatus] && (_jsx(_Fragment, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: t(camelCase(chargeStatus)) }, { children: _jsx(StatusTextLabel, Object.assign({ sx: {
86
- color: invoiceStatusStyles('VIEWED').color,
87
- backgroundColor: `${invoiceStatusStyles('VIEWED').color}0d`,
88
- } }, { children: capitalize(chargeStatus) })) }))) : (_jsx(ChargeStatusIcon, { chargeStatus: chargeStatus, errorCode: errorCode, chargeTooltip: chargeTooltip })) })) }))] })) })));
38
+ } }, { children: _jsx(RightLeftExpandingCenterChip, { sx: { justifyContent: 'flex-start' }, centerIcon: _jsx(Tooltip, Object.assign({ title: t(statusTooltip || '') }, { children: _jsxs("div", Object.assign({ style: {
39
+ display: 'flex',
40
+ alignItems: 'center',
41
+ gap: '6px',
42
+ } }, { children: [icon && _jsx(DateIcon, { src: icon, alt: "status icon" }), !!viewsCount && status === 'VIEWED' && (_jsx(StyledBadge, Object.assign({ variant: BadgeVariants.DEFAULT, style: {
43
+ color: '#fff',
44
+ backgroundColor: statusStyles.color,
45
+ } }, { children: viewsCount })))] })) })), leftIcons: !!remindedCount
46
+ ? [
47
+ _jsx(Tooltip, Object.assign({ title: t('reminded') }, { children: _jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '6px' } }, { children: [_jsx(DateIcon, { sx: {
48
+ width: '14px',
49
+ height: '14px',
50
+ }, src: remindedRedIcon, alt: "icon" }), _jsx(StyledBadge, Object.assign({ variant: BadgeVariants.DEFAULT, style: {
51
+ background: theme.palette.error.main,
52
+ fontWeight: 'bold',
53
+ color: theme.palette.common.white,
54
+ } }, { children: remindedCount }))] })) })),
55
+ ]
56
+ : undefined, rightIcons: chargeStatus && chargeStatusIcons[chargeStatus]
57
+ ? [_jsx(ChargeStatusIcon, { chargeStatus: chargeStatus, errorCode: errorCode, chargeTooltip: chargeTooltip })]
58
+ : undefined }) })));
89
59
  }
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -266,3 +265,5 @@ export declare const DueDateCellContainer: import("@emotion/styled").StyledCompo
266
265
  }, {}, {}>;
267
266
  export declare const DateIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
268
267
  export declare const StatusTextLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
268
+ export declare const ErrorChip: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
269
+ export declare const StatusIconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -30,3 +30,21 @@ export const StatusTextLabel = styled('div')(() => ({
30
30
  padding: '4.5px 8px',
31
31
  borderRadius: '24px',
32
32
  }));
33
+ export const ErrorChip = styled('div')(({ theme }) => ({
34
+ color: theme.palette.common.white,
35
+ background: theme.palette.error.main,
36
+ fontSize: '0.6rem',
37
+ fontWeight: 600,
38
+ borderRadius: '16px',
39
+ padding: '2px 8px',
40
+ display: 'flex',
41
+ alignItems: 'center',
42
+ justifyContent: 'center',
43
+ }));
44
+ export const StatusIconWrapper = styled('div')(() => ({
45
+ display: 'flex',
46
+ alignItems: 'center',
47
+ justifyContent: 'center',
48
+ width: '16px',
49
+ height: '16px',
50
+ }));
@@ -12,4 +12,5 @@ export interface DueCellProps extends TableCellProps {
12
12
  gatewayTooltip?: string;
13
13
  errorCode?: string;
14
14
  isTextShown?: boolean;
15
+ remindedCount?: number;
15
16
  }
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledDownloadFileImageWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
3
  isTextShown?: boolean | undefined;
5
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const ProductCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const RefundChargeCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const RefundCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
5
4
  export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
4
3
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
5
4
  hidden?: boolean | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<{
4
3
  width?: string | number | undefined;
5
4
  height?: string | number | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
4
3
  variant?: "Global" | "Regional" | "Local" | undefined;
5
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  type ExportButtonProps = {
4
3
  notificationState?: {
5
4
  success: boolean;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  interface TableWrapperProps {
4
3
  showNoDataView?: boolean;
5
4
  }
@@ -1009,4 +1009,3 @@ export declare const APP_ICONS: {
1009
1009
  toolbarIconUrl: string;
1010
1010
  }[];
1011
1011
  export declare const excludedApps: string[];
1012
- export declare const MF_APPS_MAPPER: ReadonlySet<string>;
@@ -490,17 +490,3 @@ export const APP_ICONS = [
490
490
  },
491
491
  ];
492
492
  export const excludedApps = ['login'];
493
- export const MF_APPS_MAPPER = new Set([
494
- APP_CODES.terminals.code,
495
- APP_CODES.billing.code,
496
- APP_CODES.account.code,
497
- APP_CODES.business.code,
498
- APP_CODES.payouts.code,
499
- APP_CODES.reports.code,
500
- APP_CODES.leads.code,
501
- APP_CODES.wallet.code,
502
- APP_CODES.acceptance.code,
503
- APP_CODES.authentication.code,
504
- APP_CODES.protect.code,
505
- APP_CODES.tokens.code,
506
- ]);
@@ -43,4 +43,5 @@ export declare function isWithinTimeAgo(timestampMs: number, amount: number, uni
43
43
  export declare const formatRelativeTimeWithinHour: (timestampMs: number) => string;
44
44
  export declare const isTodayDate: (date: string | Date) => boolean;
45
45
  export declare const isYesterdayDate: (date: string | Date) => boolean;
46
+ export declare const isValidDate: (date?: Date | string | number) => boolean;
46
47
  export {};
@@ -245,3 +245,6 @@ export const formatRelativeTimeWithinHour = (timestampMs) => {
245
245
  };
246
246
  export const isTodayDate = (date) => dayjs(date).isToday();
247
247
  export const isYesterdayDate = (date) => dayjs(date).isYesterday();
248
+ export const isValidDate = (date) => {
249
+ return dayjs(date).isValid();
250
+ };
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.387",
5
- "testVersion": 0,
4
+ "version": "0.1.389-test.1",
5
+ "testVersion": 1,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -164,4 +164,4 @@
164
164
  "publishConfig": {
165
165
  "registry": "https://registry.npmjs.org/"
166
166
  }
167
- }
167
+ }