@tap-payments/os-micro-frontend-shared 0.1.386-test.5 → 0.1.387

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 (53) hide show
  1. package/build/components/AnimatedSpinnerIcon/style.d.ts +1 -0
  2. package/build/components/Chip/style.d.ts +1 -0
  3. package/build/components/CountBadge/style.d.ts +1 -0
  4. package/build/components/Dialog/style.d.ts +1 -0
  5. package/build/components/FlippingCard/style.d.ts +1 -0
  6. package/build/components/ImageWrapper/ImageWrapper.d.ts +1 -0
  7. package/build/components/JSONViewer/style.d.ts +1 -0
  8. package/build/components/LeftPeekRightExpandingChip/style.d.ts +1 -0
  9. package/build/components/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.js +3 -2
  10. package/build/components/RightLeftExpandingCenterChip/style.d.ts +3 -4
  11. package/build/components/RightLeftExpandingCenterChip/style.js +2 -3
  12. package/build/components/SearchButton/styles.d.ts +1 -0
  13. package/build/components/StatusIcons/AuthIcons/style.d.ts +1 -0
  14. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +1 -0
  15. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +1 -0
  16. package/build/components/StatusIcons/SourceIcons/style.d.ts +1 -0
  17. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -0
  18. package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +1 -0
  19. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +1 -0
  20. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +1 -0
  21. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +1 -0
  22. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +1 -0
  23. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +1 -0
  24. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +1 -0
  25. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +1 -0
  26. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +1 -0
  27. package/build/components/TableCells/CustomCells/DueDateCell/DueDateCell.d.ts +1 -1
  28. package/build/components/TableCells/CustomCells/DueDateCell/DueDateCell.js +170 -12
  29. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +1 -0
  30. package/build/components/TableCells/CustomCells/DueDateCell/type.d.ts +2 -16
  31. package/build/components/TableCells/CustomCells/DueDateCell/utils.d.ts +0 -14
  32. package/build/components/TableCells/CustomCells/DueDateCell/utils.js +0 -48
  33. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +1 -0
  34. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +1 -0
  35. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +1 -0
  36. package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +1 -0
  37. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +1 -0
  38. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +1 -0
  39. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +1 -0
  40. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +1 -0
  41. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -0
  42. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +1 -0
  43. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +1 -0
  44. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +1 -0
  45. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +1 -0
  46. package/build/components/TableCells/CustomCells/style.d.ts +1 -0
  47. package/build/components/TableReports/components/DownloadButton/style.d.ts +1 -0
  48. package/build/components/TableReports/style.d.ts +1 -0
  49. package/build/components/VirtualTables/components/style.d.ts +1 -0
  50. package/build/constants/apps.js +1 -1
  51. package/package.json +3 -3
  52. package/build/components/TableCells/CustomCells/DueDateCell/useDueDate.d.ts +0 -2
  53. package/build/components/TableCells/CustomCells/DueDateCell/useDueDate.js +0 -20
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  type AnimatedSpinnerIconProps = {
3
4
  width?: string;
4
5
  height?: string;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  import { GetSourceAnimationFunction } from './type';
3
4
  export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
4
5
  variant?: import("./type").ChipVariant | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const AgreementImageWrapper: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DialogWrapper: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  declare const ImageWrapper: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const FOOTER_HEIGHT = 37;
3
4
  export declare const TITLE_BAR_HEIGHT = "32px";
4
5
  export declare const VIEWER_HEIGHT = 545;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  import type { SxProps, Theme } from '@mui/material/styles';
3
4
  export declare const CHIP_GAP = 3;
4
5
  export declare const DEFAULT_CHIP_MIN_WIDTH = 24;
@@ -10,8 +10,9 @@ 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';
13
14
  import { AnimatePresence } from 'framer-motion';
14
- import { CenterIconWrapper, ExpandedSection, PeekContainer, CenterChip, LeftPeekChip, RightPeekChip, LeftExpandIcon, RightExpandIcon, ExpandChip, CenterShiftWrapper, CenterContent, ExpandableContainer, ExpandableInner, ChipsContainer, CHIP_GAP, HoverBridge, } from './style';
15
+ import { CenterIconWrapper, ExpandedSection, PeekContainer, CenterChip, LeftPeekChip, RightPeekChip, LeftExpandIcon, RightExpandIcon, ExpandChip, CenterShiftWrapper, CenterContent, ExpandableContainer, ExpandableInner, tableCellSx, CHIP_GAP, HoverBridge, } from './style';
15
16
  import { useRightLeftExpandingCenterChip, DEFAULT_CHIP_MIN_WIDTH } from './useRightLeftExpandingCenterChip';
16
17
  /**
17
18
  * Component: RightLeftExpandingCenterChip
@@ -48,7 +49,7 @@ import { useRightLeftExpandingCenterChip, DEFAULT_CHIP_MIN_WIDTH } from './useRi
48
49
  function RightLeftExpandingCenterChip(_a) {
49
50
  var { leftIcons = [], rightIcons = [], centerIcon, expandableCenterRight, expandableCenterLeft, expandedZIndex = 1000 } = _a, props = __rest(_a, ["leftIcons", "rightIcons", "centerIcon", "expandableCenterRight", "expandableCenterLeft", "expandedZIndex"]);
50
51
  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 });
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: {
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: {
52
53
  borderRadius: (() => {
53
54
  const hasLeftExpanded = expandableCenterLeft && isHovering;
54
55
  const hasRightExpanded = expandableCenterRight && isHovering;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { type Theme } from '@mui/material/styles';
2
+ /// <reference types="react" />
3
+ import type { SxProps, Theme } from '@mui/material/styles';
3
4
  export declare const CHIP_GAP = 3;
4
5
  export declare const CenterIconWrapper: import("@emotion/styled").StyledComponent<{
5
6
  hidden?: boolean | undefined;
@@ -3412,6 +3413,4 @@ export declare const ExpandChip: import("@emotion/styled").StyledComponent<{
3412
3413
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
3413
3414
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
3414
3415
  } & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<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>, {}, {}>;
3416
+ export declare const tableCellSx: SxProps<Theme>;
@@ -1,4 +1,3 @@
1
- import Box from '@mui/material/Box';
2
1
  import { styled } from '@mui/material/styles';
3
2
  import { motion } from 'framer-motion';
4
3
  // Shared spacing between chips
@@ -119,7 +118,7 @@ export const RightPeekChip = styled(motion.div)(({ theme }) => (Object.assign(Ob
119
118
  // Chip for expanded icons (left/right lists)
120
119
  export const ExpandChip = styled(motion.div)(({ theme }) => (Object.assign(Object.assign({}, baseChipStyles(theme)), { minWidth: 24, flex: '0 0 auto', display: 'inline-flex' })));
121
120
  // Styles applied to the containing TableCell
122
- export const ChipsContainer = styled(Box)(() => ({
121
+ export const tableCellSx = {
123
122
  position: 'relative',
124
123
  overflow: 'visible',
125
124
  zIndex: 101,
@@ -127,4 +126,4 @@ export const ChipsContainer = styled(Box)(() => ({
127
126
  alignItems: 'center',
128
127
  justifyContent: 'center',
129
128
  minHeight: '20px',
130
- }));
129
+ };
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledInput: import("@emotion/styled").StyledComponent<{
3
4
  width?: string | number | undefined;
4
5
  height?: string | number | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const ErrorCodeLabel: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  import { TableMode } from '../../../../types/index.js';
3
4
  export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
5
  tableMode?: TableMode | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const AgreementCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledAgreementCardIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  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,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
4
5
  hidden?: boolean | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
3
4
  export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
4
5
  hidden?: boolean | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,3 +1,3 @@
1
1
  import { DueCellProps } from './type';
2
- declare function DueDateCell({ dueDate, expiryDate, ...props }: DueCellProps): import("react/jsx-runtime").JSX.Element | null;
2
+ declare function DueDateCell({ dueDate, expiryDate, remindedCount, isTextShown, ...props }: DueCellProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default DueDateCell;
@@ -9,20 +9,178 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx } from "react/jsx-runtime";
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';
13
19
  import { TableCell } from '../../../TableCells';
14
20
  import Tooltip from '../../../Tooltip';
15
- import { RightLeftExpandingCenterChip } from '../../../RightLeftExpandingCenterChip';
16
- import { DateIcon } from './style';
17
- import { useDueDate } from './useDueDate';
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';
18
24
  function DueDateCell(_a) {
19
- var { dueDate, expiryDate } = _a, props = __rest(_a, ["dueDate", "expiryDate"]);
20
- const { dueMeta, expiryMeta } = useDueDate(dueDate, expiryDate);
21
- if (!dueMeta && !expiryMeta)
22
- return null;
23
- const renderIcon = (meta) => (_jsx(Tooltip, Object.assign({ title: meta.label }, { children: _jsx(DateIcon, { src: meta.icon, alt: "icon" }) })));
24
- const centerIcon = dueMeta ? renderIcon(dueMeta) : expiryMeta ? renderIcon(expiryMeta) : null;
25
- const rightIcons = expiryMeta && dueMeta && dueDate ? [renderIcon(expiryMeta)] : [];
26
- return (_jsx(TableCell, Object.assign({}, props, { sx: { position: 'relative', overflow: 'visible' } }, { children: _jsx(RightLeftExpandingCenterChip, { sx: { justifyContent: 'flex-start' }, centerIcon: centerIcon, rightIcons: rightIcons }) })));
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 }))) }))] })) })))] })) })));
27
185
  }
28
186
  export default DueDateCell;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -2,20 +2,6 @@ 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;
5
7
  }
6
- export type DateInput = string | number | Date;
7
- interface DueMeta {
8
- icon: string;
9
- color: string;
10
- label: string;
11
- }
12
- interface ExpiryMeta {
13
- icon: string;
14
- isExpired: boolean;
15
- label: string;
16
- }
17
- export interface UseDueDateResult {
18
- dueMeta: DueMeta | null;
19
- expiryMeta: ExpiryMeta | null;
20
- }
21
- export {};
@@ -1,15 +1 @@
1
- import { Dayjs } from 'dayjs';
2
- import { Theme } from '@mui/material/styles';
3
- import { DateInput } from './type';
4
1
  export declare function formatDate(date?: number): string;
5
- export declare function buildDueMeta(due: Dayjs, now: Dayjs, theme: Theme): {
6
- icon: string;
7
- color: string;
8
- label: string;
9
- };
10
- export declare function buildExpiryMeta(expiry: Dayjs, now: Dayjs): {
11
- icon: string;
12
- isExpired: boolean;
13
- label: string;
14
- };
15
- export declare function isValidDate(input?: DateInput): boolean;
@@ -1,6 +1,4 @@
1
- import dayjs from 'dayjs';
2
1
  import { formatCellDate } from '../../../../utils/index.js';
3
- import { dueDateBlueIcon, dueDateRedIcon, dueDateGrayIcon, expiredIcon, timerBlueIcon } from '../../../../constants/index.js';
4
2
  export function formatDate(date) {
5
3
  return formatCellDate(date, {
6
4
  sameDay: '[Today at] h:mm A',
@@ -11,49 +9,3 @@ export function formatDate(date) {
11
9
  nextWeek: 'MMM DD, YYYY',
12
10
  });
13
11
  }
14
- export function buildDueMeta(due, now, theme) {
15
- if (due.isBefore(now, 'day')) {
16
- return {
17
- icon: dueDateRedIcon,
18
- color: theme.palette.error.main,
19
- label: formatDate(due.valueOf()),
20
- };
21
- }
22
- if (due.isAfter(now.add(2, 'day'), 'day')) {
23
- return {
24
- icon: dueDateGrayIcon,
25
- color: theme.palette.grey.A700,
26
- label: formatDate(due.valueOf()),
27
- };
28
- }
29
- return {
30
- icon: dueDateBlueIcon,
31
- color: theme.palette.info.dark,
32
- label: formatDate(due.valueOf()),
33
- };
34
- }
35
- export function buildExpiryMeta(expiry, now) {
36
- const expiryTimestamp = expiry.valueOf();
37
- if (expiry.isBefore(now)) {
38
- return {
39
- icon: expiredIcon,
40
- isExpired: true,
41
- label: `Expired on ${formatDate(expiryTimestamp)}`,
42
- };
43
- }
44
- const baseMeta = {
45
- icon: timerBlueIcon,
46
- isExpired: false,
47
- };
48
- const units = ['day', 'hour', 'minute', 'second'];
49
- for (const unit of units) {
50
- const diff = expiry.diff(now, unit);
51
- if (diff >= 1) {
52
- return Object.assign(Object.assign({}, baseMeta), { label: `${diff} ${unit}${diff > 1 ? 's' : ''} left` });
53
- }
54
- }
55
- return Object.assign(Object.assign({}, baseMeta), { label: 'Less than a second left' });
56
- }
57
- export function isValidDate(input) {
58
- return Boolean(input && dayjs(input).isValid());
59
- }
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const Button: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledDownloadFileImageWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
3
4
  isTextShown?: boolean | undefined;
4
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const ProductCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const RefundChargeCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const RefundCellContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
4
5
  export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
3
4
  export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
4
5
  hidden?: boolean | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<{
3
4
  width?: string | number | undefined;
4
5
  height?: string | number | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
3
4
  variant?: "Global" | "Regional" | "Local" | undefined;
4
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  export declare const Button: import("@emotion/styled").StyledComponent<{
3
4
  hidden?: boolean | undefined;
4
5
  color?: string | undefined;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  type ExportButtonProps = {
3
4
  notificationState?: {
4
5
  success: boolean;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  interface TableWrapperProps {
3
4
  showNoDataView?: boolean;
4
5
  }
@@ -28,7 +28,7 @@ export const BUSINESS_FUNCTIONS = {
28
28
  code: 'CREATE USERS',
29
29
  },
30
30
  updateWallet: {
31
- code: 'UPDATE WALLET',
31
+ code: 'UPDATE_WALLET',
32
32
  },
33
33
  };
34
34
  export const APP_CODES = {
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.386-test.5",
5
- "testVersion": 5,
4
+ "version": "0.1.387",
5
+ "testVersion": 0,
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
+ }
@@ -1,2 +0,0 @@
1
- import { DateInput, UseDueDateResult } from './type';
2
- export declare function useDueDate(dueDate?: DateInput, expiryDate?: DateInput): UseDueDateResult;
@@ -1,20 +0,0 @@
1
- import { useMemo } from 'react';
2
- import dayjs from 'dayjs';
3
- import { useTheme } from '@mui/material/styles';
4
- import { isValidDate, buildDueMeta, buildExpiryMeta } from './utils';
5
- export function useDueDate(dueDate, expiryDate) {
6
- const theme = useTheme();
7
- const dueMeta = useMemo(() => {
8
- if (!isValidDate(dueDate))
9
- return null;
10
- const now = dayjs();
11
- return buildDueMeta(dayjs(dueDate), now, theme);
12
- }, [dueDate, theme]);
13
- const expiryMeta = useMemo(() => {
14
- if (!isValidDate(expiryDate))
15
- return null;
16
- const now = dayjs();
17
- return buildExpiryMeta(dayjs(expiryDate), now);
18
- }, [expiryDate]);
19
- return { dueMeta, expiryMeta };
20
- }