@tap-payments/os-micro-frontend-shared 0.1.398-test.1 → 0.1.398-test.2

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 (31) hide show
  1. package/build/components/FilterDropdown/FilterDropdown.d.ts +11 -4
  2. package/build/components/FilterDropdown/FilterDropdown.js +18 -4
  3. package/build/components/FilterDropdown/style.js +1 -1
  4. package/build/components/MultiDatakeyDonut/MultiDatakeyDonut.d.ts +12 -0
  5. package/build/components/MultiDatakeyDonut/MultiDatakeyDonut.js +19 -0
  6. package/build/components/MultiDatakeyDonut/index.d.ts +1 -0
  7. package/build/components/MultiDatakeyDonut/index.js +1 -0
  8. package/build/components/MultiDatakeyDonut/style.d.ts +10 -0
  9. package/build/components/MultiDatakeyDonut/style.js +23 -0
  10. package/build/components/RangeCalender/RangeCalender.js +4 -2
  11. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.d.ts +24 -2
  12. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIcon.js +48 -23
  13. package/build/components/Widget/List.js +1 -1
  14. package/build/components/index.d.ts +1 -0
  15. package/build/components/index.js +1 -0
  16. package/build/constants/assets.d.ts +3 -0
  17. package/build/constants/assets.js +3 -0
  18. package/build/types/index.d.ts +1 -0
  19. package/build/types/index.js +1 -0
  20. package/build/types/toggleOptions.d.ts +2 -0
  21. package/build/utils/date.d.ts +4 -0
  22. package/build/utils/date.js +37 -0
  23. package/package.json +2 -2
  24. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIconView.d.ts +0 -10
  25. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusIconView.js +0 -23
  26. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusSheetView.d.ts +0 -9
  27. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusSheetView.js +0 -9
  28. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusTextView.d.ts +0 -10
  29. package/build/components/StatusIcons/ChargeStatusIcon/ChargeStatusTextView.js +0 -16
  30. package/build/components/StatusIcons/ChargeStatusIcon/type.d.ts +0 -24
  31. /package/build/{components/StatusIcons/ChargeStatusIcon/type.js → types/toggleOptions.js} +0 -0
@@ -1,10 +1,17 @@
1
- /// <reference types="react" />
2
- interface FilterDropdownProps {
3
- children?: React.ReactNode;
1
+ import { ReactNode } from 'react';
2
+ import { BoxProps } from '@mui/material/Box';
3
+ import { SxProps } from '@mui/material';
4
+ interface FilterDropdownProps extends BoxProps {
4
5
  onConfirm: () => void;
5
6
  onCancel: () => void;
6
7
  isOkayButDisabled?: boolean;
7
8
  isDisabled?: boolean;
9
+ icon?: string;
10
+ title?: string;
11
+ menuStyle?: SxProps;
12
+ hideTitle?: boolean;
13
+ renderButton?: ReactNode;
14
+ onOpenChange?: (isOpen: boolean) => void;
8
15
  }
9
- export default function FilterDropdown({ onConfirm, onCancel, isOkayButDisabled, children, isDisabled }: Readonly<FilterDropdownProps>): import("react/jsx-runtime").JSX.Element;
16
+ export default function FilterDropdown({ onConfirm, onCancel, isOkayButDisabled, children, isDisabled, icon, title, menuStyle, hideTitle, renderButton, onOpenChange, ...props }: Readonly<FilterDropdownProps>): import("react/jsx-runtime").JSX.Element;
10
17
  export {};
@@ -1,12 +1,24 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useState, useEffect } from 'react';
2
14
  import Box from '@mui/material/Box';
15
+ import ClickAwayListener from '@mui/material/ClickAwayListener';
3
16
  import { useTranslation } from 'react-i18next';
4
- import { useState, useEffect } from 'react';
5
- import { ClickAwayListener } from '@mui/material';
6
17
  import { darkFilterIcon } from '../../constants/index.js';
7
18
  import { Menu, CustomBackdrop } from '../index.js';
8
19
  import { CancelButton, FilterButton, Footer, OkayButton, TitleStyled } from './style';
9
- export default function FilterDropdown({ onConfirm, onCancel, isOkayButDisabled, children, isDisabled }) {
20
+ export default function FilterDropdown(_a) {
21
+ var { onConfirm, onCancel, isOkayButDisabled, children, isDisabled, icon, title, menuStyle, hideTitle = false, renderButton, onOpenChange } = _a, props = __rest(_a, ["onConfirm", "onCancel", "isOkayButDisabled", "children", "isDisabled", "icon", "title", "menuStyle", "hideTitle", "renderButton", "onOpenChange"]);
10
22
  const [anchorEl, setAnchorEl] = useState(null);
11
23
  const open = Boolean(anchorEl);
12
24
  const { t } = useTranslation();
@@ -32,12 +44,14 @@ export default function FilterDropdown({ onConfirm, onCancel, isOkayButDisabled,
32
44
  return;
33
45
  if (!open) {
34
46
  setAnchorEl(e.currentTarget);
47
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(true);
35
48
  return;
36
49
  }
37
50
  onClose();
38
51
  };
39
52
  const onClose = () => {
40
53
  setAnchorEl(null);
54
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
41
55
  onCancel();
42
56
  };
43
57
  const handleCancel = () => {
@@ -50,5 +64,5 @@ export default function FilterDropdown({ onConfirm, onCancel, isOkayButDisabled,
50
64
  onConfirm();
51
65
  onClose();
52
66
  };
53
- return (_jsx(ClickAwayListener, Object.assign({ onClickAway: handleCancel }, { children: _jsxs(Box, { children: [_jsx(FilterButton, Object.assign({ isActive: open, onClick: onOpen, sx: Object.assign({}, (isDisabled && { pointerEvents: 'none', opacity: 0.5 })) }, { children: _jsx(Box, { component: "img", src: darkFilterIcon, alt: "filter" }) })), _jsxs(Menu, Object.assign({ anchorEl: anchorEl, open: open, sx: { marginTop: '8px', marginBottom: '8px', width: 193 }, placement: "bottom-end" }, { children: [_jsx(TitleStyled, Object.assign({ component: "span" }, { children: t('filterBy') })), children, _jsxs(Footer, { children: [_jsx(CancelButton, Object.assign({ onClick: handleCancel }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ disabled: isOkayButDisabled, onClick: handleConfirm }, { children: t('okay') }))] })] })), open && _jsx(CustomBackdrop, { onClick: onClose })] }) })));
67
+ return (_jsx(ClickAwayListener, Object.assign({ onClickAway: handleCancel }, { children: _jsxs(Box, Object.assign({}, props, { children: [_jsx(FilterButton, Object.assign({ className: "filter-button", isActive: open, onClick: onOpen, sx: Object.assign({}, (isDisabled && Object.assign({ pointerEvents: 'none', opacity: 0.5 }, props.sx))) }, { children: renderButton !== null && renderButton !== void 0 ? renderButton : _jsx(Box, { component: "img", src: icon !== null && icon !== void 0 ? icon : darkFilterIcon, alt: "filter" }) })), _jsxs(Menu, Object.assign({ anchorEl: anchorEl, open: open, sx: Object.assign({ marginTop: '8px', marginBottom: '8px', width: 193 }, menuStyle), placement: "bottom-end" }, { children: [!hideTitle && _jsx(TitleStyled, Object.assign({ component: "span" }, { children: title !== null && title !== void 0 ? title : t('filterBy') })), children, _jsxs(Footer, { children: [_jsx(CancelButton, Object.assign({ onClick: handleCancel }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ disabled: isOkayButDisabled, onClick: handleConfirm }, { children: t('okay') }))] })] })), open && _jsx(CustomBackdrop, { onClick: onClose })] })) })));
54
68
  }
@@ -2,7 +2,7 @@ import Box from '@mui/material/Box';
2
2
  import { styled } from '@mui/material/styles';
3
3
  import Button from '@mui/material/Button';
4
4
  import { Text } from '../index.js';
5
- export const FilterButton = styled(Box, { shouldForwardProp: (props) => props !== 'isActive' })(({ theme, isActive }) => (Object.assign({ borderRadius: '4px', border: `1px solid ${theme.palette.divider}`, height: 32, width: 30, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', backgroundColor: theme.palette.common.white, ':hover': {
5
+ export const FilterButton = styled(Box, { shouldForwardProp: (props) => props !== 'isActive' })(({ theme, isActive }) => (Object.assign({ borderRadius: '4px', border: `1px solid ${theme.palette.divider}`, minHeight: 32, minWidth: 30, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', backgroundColor: theme.palette.common.white, ':hover': {
6
6
  opacity: 0.7,
7
7
  } }, (isActive && {
8
8
  boxShadow: `0px 0px 4px 0px ${theme.palette.info.dark}80`,
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ interface DonutProps {
3
+ size?: number;
4
+ chartData: Array<{
5
+ name: string;
6
+ value: number;
7
+ color: string;
8
+ }>;
9
+ chartInfo?: ReactNode;
10
+ }
11
+ export declare const MultiDatakeyDonut: ({ chartData, size, chartInfo }: DonutProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { ResponsiveContainer, PieChart, Pie, Cell } from 'recharts';
4
+ import { DonutWrapper, CenterOverlay, Empty } from './style';
5
+ export const MultiDatakeyDonut = ({ chartData, size = 170, chartInfo }) => {
6
+ const pieSegments = useMemo(() => {
7
+ const total = chartData.reduce((sum, d) => sum + d.value, 0) || 1;
8
+ let cumulative = 0;
9
+ return chartData.map((d) => {
10
+ const start = (cumulative / total) * 360;
11
+ const end = ((cumulative + d.value) / total) * 360;
12
+ cumulative += d.value;
13
+ return Object.assign(Object.assign({}, d), { startAngle: start, endAngle: end });
14
+ });
15
+ }, [chartData]);
16
+ const isEmpty = chartData.every((d) => d.value === 0);
17
+ return (_jsxs(DonutWrapper, Object.assign({ sx: { width: size, height: size } }, { children: [_jsx(ResponsiveContainer, { children: _jsxs(PieChart, { children: [_jsx(Pie, { data: [{ value: 100 }], dataKey: "value", cx: "50%", cy: "50%", innerRadius: "70%", outerRadius: "100%", fill: "#E5E7EB", stroke: "none", isAnimationActive: false }), !isEmpty &&
18
+ pieSegments.map((segment) => (_jsx(Pie, Object.assign({ data: [segment], dataKey: "value", cx: "50%", cy: "50%", innerRadius: "70%", outerRadius: "100%", startAngle: 90 - segment.startAngle, endAngle: 90 - segment.endAngle, cornerRadius: 0, stroke: "none", isAnimationActive: true, animationDuration: 800, style: { outline: 'none' } }, { children: _jsx(Cell, { fill: segment.color, tabIndex: -1 }, segment.name) }), segment.name)))] }) }), _jsx(CenterOverlay, { children: !chartInfo ? _jsx(Empty, { children: "----" }) : chartInfo })] })));
19
+ };
@@ -0,0 +1 @@
1
+ export * from './MultiDatakeyDonut';
@@ -0,0 +1 @@
1
+ export * from './MultiDatakeyDonut';
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export declare const DonutWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
+ export declare const CenterOverlay: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
6
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
7
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
+ export declare const Empty: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
10
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,23 @@
1
+ import { Box } from '@mui/material';
2
+ import { styled } from '@mui/material/styles';
3
+ export const DonutWrapper = styled(Box)(() => ({
4
+ width: '100%',
5
+ maxWidth: 500,
6
+ aspectRatio: '1',
7
+ position: 'relative',
8
+ }));
9
+ export const CenterOverlay = styled(Box)(({ theme }) => ({
10
+ position: 'absolute',
11
+ inset: 0,
12
+ display: 'flex',
13
+ flexDirection: 'column',
14
+ justifyContent: 'center',
15
+ alignItems: 'center',
16
+ pointerEvents: 'none',
17
+ gap: theme.spacing(1),
18
+ }));
19
+ export const Empty = styled(Box)(({ theme }) => ({
20
+ fontSize: 17,
21
+ fontWeight: 700,
22
+ color: '#CFD0D2',
23
+ }));
@@ -58,8 +58,10 @@ function RangeCalender({ defaultDate, onDateChange, mode = 'gregorian', onCalend
58
58
  onChangeTimezone === null || onChangeTimezone === void 0 ? void 0 : onChangeTimezone(selectedTimezone);
59
59
  };
60
60
  const getSelectedDate = () => {
61
- const startSelectedTime = dates[0].format('MMM D');
62
- const endSelectedTime = dates[1] ? dates[1].format('MMM D') : dates[0].format('MMM D');
61
+ const nowYear = dayjs().year();
62
+ const formatDate = (date) => (date.year === nowYear ? date.format('MMM D') : date.format('MMM D YYYY'));
63
+ const startSelectedTime = formatDate(dates[0]);
64
+ const endSelectedTime = dates[1] ? formatDate(dates[1]) : formatDate(dates[0]);
63
65
  return startSelectedTime === endSelectedTime && !noTimezone ? startSelectedTime : `${startSelectedTime} - ${endSelectedTime}`;
64
66
  };
65
67
  const onChange = (newDate) => {
@@ -1,2 +1,24 @@
1
- import { ChargeStatusIconProps } from './type';
2
- export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge, isSheetViewShown, selectionProps, chipIndex, }: Readonly<ChargeStatusIconProps>): import("react/jsx-runtime").JSX.Element;
1
+ import { CSSProperties } from 'react';
2
+ import { SelectionProps } from '../../../types/index.js';
3
+ import { type ChargeStatus } from '../../TableCells';
4
+ export declare function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge, isSheetViewShown, selectionProps, chipIndex, }: Readonly<{
5
+ chargeStatus?: ChargeStatus;
6
+ gatewayTooltip?: string;
7
+ showAuthorizedStatus?: boolean;
8
+ chargeTooltip?: string;
9
+ acquirerTooltip?: string;
10
+ errorCode?: string;
11
+ isTextShown?: boolean;
12
+ gatewayCode?: React.ReactNode;
13
+ acquirerCode?: React.ReactNode;
14
+ unCapturedStyles?: CSSProperties;
15
+ iconStyles?: CSSProperties;
16
+ iconWrapperStyles?: CSSProperties;
17
+ gatewayIconWrapperStyles?: CSSProperties;
18
+ gatewayContainerStyles?: CSSProperties;
19
+ gateWayIconStyles?: CSSProperties;
20
+ showBadge?: boolean;
21
+ isSheetViewShown?: boolean;
22
+ selectionProps?: SelectionProps;
23
+ chipIndex?: number;
24
+ }>): import("react/jsx-runtime").JSX.Element;
@@ -1,33 +1,58 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
2
+ import { useTheme } from '@mui/material/styles';
3
+ import camelCase from 'lodash/camelCase';
3
4
  import { useTranslation } from 'react-i18next';
5
+ import Tooltip from '../../Tooltip';
6
+ import { unCapturedStatuses } from '../../../constants/index.js';
7
+ import StatusChipWithCopy from '../../StatusChipWithCopy';
4
8
  import { capturedStatusesStyles, unCapturedStatusesStyles, statusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
5
- import { StatusIcon } from '../../TableCells/CustomCells/style';
6
- import { ChargeStatusSheetView } from './ChargeStatusSheetView';
7
- import { ChargeStatusTextView } from './ChargeStatusTextView';
8
- import { ChargeStatusIconView } from './ChargeStatusIconView';
9
+ import { StatusIcon, StatusIconWrapper, TextLabel } from '../../TableCells/CustomCells/style';
10
+ import { AcquirerContainerAnimationVariants, ErrorCodeLabel, ErrorCodeLabelAnimationVariants, ErrorCodeVariants, ErrorCodeWrapper, GateWayIcon, GatewayIconWrapper, GatewayIconWrapperAnimationTransition, GatewaysContainer, GatewaysContainerAnimationVariants, StatusTextLabel, UnCapturedBadge, UnCapturedContainer, errorCodeLabelAnimation, TextViewWrapper, } from './style';
9
11
  export function ChargeStatusIcon({ chargeStatus, gatewayTooltip, acquirerTooltip, chargeTooltip, errorCode, isTextShown, gatewayCode, acquirerCode, unCapturedStyles, iconStyles, iconWrapperStyles, gatewayIconWrapperStyles, gatewayContainerStyles, gateWayIconStyles, showBadge = true, isSheetViewShown = false, selectionProps = {}, chipIndex = 0, }) {
12
+ const unCapturedStatusStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
13
+ const captureStatusStyle = chargeStatus ? capturedStatusesStyles[chargeStatus] : null;
14
+ const theme = useTheme();
10
15
  const { t } = useTranslation();
11
- const { unCapturedStatusStyle, captureStatusStyle, chargeIcon } = useMemo(() => {
12
- const unCapturedStyle = chargeStatus ? unCapturedStatusesStyles[chargeStatus] : null;
13
- const captureStyle = chargeStatus ? capturedStatusesStyles[chargeStatus] : null;
14
- const icon = chargeStatus && statusIcons[chargeStatus] && (_jsx("div", Object.assign({ "data-testid": "ChargeStatusIcon_ChargeIcon", style: Object.assign({ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '16px', height: '16px', borderRadius: unCapturedStyle ? '50%' : '' }, iconWrapperStyles) }, { children: _jsx(StatusIcon, { src: statusIcons[chargeStatus], alt: "charge-icon", "data-testid": "ChargeStatusIcon_StatusIcon", style: Object.assign({ borderRadius: unCapturedStyle ? '50%' : '', width: '16px', height: '16px' }, iconStyles) }) })));
15
- return {
16
- unCapturedStatusStyle: unCapturedStyle,
17
- captureStatusStyle: captureStyle,
18
- chargeIcon: icon
19
- };
20
- }, [chargeStatus, iconWrapperStyles, iconStyles]);
21
- const { chargeTooltipTitle, acquirerTooltipTitle, gatewayTooltipTitle } = useMemo(() => ({
22
- chargeTooltipTitle: chargeTooltip && (_jsx(_Fragment, { children: _jsx("div", { children: chargeTooltip }) })),
23
- acquirerTooltipTitle: acquirerTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Acquirer" }), _jsx("div", { children: acquirerTooltip })] })),
24
- gatewayTooltipTitle: gatewayTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Gateway" }), _jsx("div", { children: gatewayTooltip })] }))
25
- }), [chargeTooltip, acquirerTooltip, gatewayTooltip]);
16
+ const chargeTooltipTitle = chargeTooltip && (_jsx(_Fragment, { children: _jsx("div", { children: chargeTooltip }) }));
17
+ const acquirerTooltipTitle = acquirerTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Acquirer" }), _jsx("div", { children: acquirerTooltip })] }));
18
+ const gatewayTooltipTitle = gatewayTooltip && (_jsxs(_Fragment, { children: [_jsx("div", { children: "Gateway" }), _jsx("div", { children: gatewayTooltip })] }));
19
+ const chargeIcon = chargeStatus && statusIcons[chargeStatus] && (_jsx("div", Object.assign({ "data-testid": "ChargeStatusIcon_ChargeIcon", style: Object.assign({ display: 'flex', alignItems: 'center', justifyContent: 'center', width: '16px', height: '16px', borderRadius: unCapturedStatusStyle ? '50%' : '' }, iconWrapperStyles) }, { children: _jsx(StatusIcon, { src: statusIcons[chargeStatus], alt: "charge-icon", "data-testid": "ChargeStatusIcon_StatusIcon", style: Object.assign({ borderRadius: unCapturedStatusStyle ? '50%' : '', width: '16px', height: '16px' }, iconStyles) }) })));
26
20
  if (isSheetViewShown) {
27
- return (_jsx(ChargeStatusSheetView, { chargeStatus: chargeStatus, errorCode: errorCode, chipIndex: chipIndex, selectionProps: selectionProps, gatewayCode: gatewayCode, acquirerCode: acquirerCode, unCapturedStatusStyle: unCapturedStatusStyle }));
21
+ return (_jsxs(TextViewWrapper, { children: [_jsxs(StatusChipWithCopy, Object.assign({ copyText: t(camelCase(chargeStatus)), chipIndex: chipIndex, selectionProps: selectionProps }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Gateway", chipIndex: 1, selectionProps: selectionProps }, { children: ["Gateway ", gatewayCode] }))), acquirerCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Acquirer", chipIndex: 2, selectionProps: selectionProps }, { children: ["Acquirer ", acquirerCode] })))] }))] }));
28
22
  }
29
23
  if (isTextShown) {
30
- return (_jsx(ChargeStatusTextView, { chargeStatus: chargeStatus, chargeTooltipTitle: chargeTooltipTitle, unCapturedStatusStyle: unCapturedStatusStyle, captureStatusStyle: captureStatusStyle, errorCode: errorCode, gatewayCode: gatewayCode, gatewayTooltipTitle: gatewayTooltipTitle, acquirerCode: acquirerCode, acquirerTooltipTitle: acquirerTooltipTitle }));
24
+ return (_jsxs(TextViewWrapper, { children: [_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle }, { children: _jsxs(StatusTextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
25
+ background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
26
+ color: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark,
27
+ borderColor: `${(unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark}1A`,
28
+ } }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })) })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsx(Tooltip, Object.assign({ title: gatewayTooltipTitle }, { children: _jsxs(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
29
+ background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
30
+ color: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark,
31
+ } }, { children: ["Gateway ", gatewayCode] })) }))), acquirerCode && (_jsx(Tooltip, Object.assign({ title: acquirerTooltipTitle }, { children: _jsxs(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: {
32
+ background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
33
+ color: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark,
34
+ } }, { children: ["Acquirer ", acquirerCode] })) })))] }))] }));
31
35
  }
32
- return (_jsx(ChargeStatusIconView, { chargeStatus: chargeStatus, chargeIcon: chargeIcon, chargeTooltipTitle: chargeTooltipTitle, acquirerTooltipTitle: acquirerTooltipTitle, gatewayTooltipTitle: gatewayTooltipTitle, errorCode: errorCode, showBadge: showBadge, unCapturedStyles: unCapturedStyles, unCapturedStatusStyle: unCapturedStatusStyle, gatewayContainerStyles: gatewayContainerStyles, gatewayIconWrapperStyles: gatewayIconWrapperStyles, gateWayIconStyles: gateWayIconStyles, iconWrapperStyles: iconWrapperStyles }));
36
+ return (_jsx(StatusIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_StatusIconWrapper", style: Object.assign({}, iconWrapperStyles) }, { children: (unCapturedStatuses === null || unCapturedStatuses === void 0 ? void 0 : unCapturedStatuses.includes(chargeStatus || '')) && (chargeTooltipTitle || acquirerTooltipTitle || gatewayTooltipTitle) ? (_jsxs(UnCapturedContainer, Object.assign({ "data-testid": "ChargeStatusIcon_UnCapturedContainer", whileHover: ['animate', 'fadeIn'], style: Object.assign(Object.assign({ left: '0' }, (showBadge && {
37
+ paddingInline: '12px',
38
+ border: '1px solid #F2F2F2',
39
+ borderRadius: '12px',
40
+ backgroundColor: '#fff',
41
+ })), unCapturedStyles) }, { children: [_jsx(UnCapturedBadge, Object.assign({ "data-testid": "ChargeStatusIcon_UnCapturedBadge", sx: {
42
+ borderRadius: '56px',
43
+ }, initial: {
44
+ background: 'transparent',
45
+ }, variants: {
46
+ animate: {
47
+ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background,
48
+ },
49
+ } }, { children: _jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsxs(_Fragment, { children: [chargeIcon, _jsx(ErrorCodeWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_ErrorCodeWrapper", transition: {
50
+ animate: {
51
+ duration: 0.05,
52
+ },
53
+ }, variants: ErrorCodeLabelAnimationVariants, style: Object.assign({}, (errorCode && {
54
+ padding: '0 !important',
55
+ })) }, { children: _jsx(ErrorCodeLabel, Object.assign({ "data-testid": "ChargeStatusIcon_ErrorCodeLabel", sx: {
56
+ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color,
57
+ }, transition: errorCodeLabelAnimation, variants: ErrorCodeVariants, initial: { opacity: 0 } }, { children: errorCode })) }))] }) })) })), _jsx(GatewaysContainer, Object.assign({ "data-testid": "ChargeStatusIcon_GatewaysContainer", transition: GatewayIconWrapperAnimationTransition, variants: GatewaysContainerAnimationVariants, style: gatewayContainerStyles, isVisible: !!gatewayTooltipTitle }, { children: gatewayTooltipTitle && (_jsx(Tooltip, Object.assign({ title: gatewayTooltipTitle }, { children: _jsx(GatewayIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_GatewayIconWrapper", style: Object.assign({ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background }, gatewayIconWrapperStyles) }, { children: _jsx(GateWayIcon, { src: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.gatewayIcon, alt: "gateway-icon", "data-testid": "ChargeStatusIcon_GatewayIcon", style: gateWayIconStyles }) })) }))) })), _jsx(GatewaysContainer, Object.assign({ "data-testid": "ChargeStatusIcon_GatewaysContainer", transition: GatewayIconWrapperAnimationTransition, variants: AcquirerContainerAnimationVariants, style: gatewayContainerStyles, isVisible: !!acquirerTooltipTitle }, { children: acquirerTooltipTitle && (_jsx(Tooltip, Object.assign({ title: acquirerTooltipTitle }, { children: _jsx(GatewayIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_AcquirerIconWrapper", style: Object.assign({ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background }, gatewayIconWrapperStyles) }, { children: _jsx(GateWayIcon, { src: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.acquirerIcon, alt: "acquirer-icon", "data-testid": "ChargeStatusIcon_AcquirerIcon", style: gateWayIconStyles }) })) }))) }))] }))) : (_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsx(StatusIconWrapper, { children: chargeIcon }) }))) })));
33
58
  }
@@ -18,6 +18,6 @@ import { useScrollWithShadow } from './useScrollWithShadow';
18
18
  function List(_a) {
19
19
  var { allowShadow = true, children } = _a, props = __rest(_a, ["allowShadow", "children"]);
20
20
  const { onScrollHandler, showShadow } = useScrollWithShadow();
21
- return (_jsxs(ListStyled, Object.assign({ component: "ul", "data-testid": "Widget_List", onScroll: onScrollHandler }, props, { children: [children, showShadow && allowShadow && (_jsx(Box, { component: "img", src: listShadowBg, sx: { width: '100%', position: 'fixed', bottom: 0, pointerEvents: 'none' } }))] })));
21
+ return (_jsxs(ListStyled, Object.assign({ component: "ul", "data-testid": "Widget_List", onScroll: onScrollHandler }, props, { children: [children, showShadow && allowShadow && (_jsx(Box, { component: "img", src: listShadowBg, sx: { width: '100%', position: 'fixed', bottom: 0, pointerEvents: 'none', right: 0, left: 0 } }))] })));
22
22
  }
23
23
  export default memo(List);
@@ -153,5 +153,6 @@ export * from './SalesChannelFilter';
153
153
  export * from './ReferenceTypeFilter';
154
154
  export * from './ListColumnFilter';
155
155
  export * from './VerificationIcon';
156
+ export * from './MultiDatakeyDonut';
156
157
  export { default as TreeDropdown } from './TreeDropdown';
157
158
  export * from './TreeDropdown';
@@ -153,5 +153,6 @@ export * from './SalesChannelFilter';
153
153
  export * from './ReferenceTypeFilter';
154
154
  export * from './ListColumnFilter';
155
155
  export * from './VerificationIcon';
156
+ export * from './MultiDatakeyDonut';
156
157
  export { default as TreeDropdown } from './TreeDropdown';
157
158
  export * from './TreeDropdown';
@@ -46,6 +46,7 @@ export declare const storedValueWalletIcon: string;
46
46
  export declare const buyNowPayLaterIcon: string;
47
47
  export declare const openBankingIcon: string;
48
48
  export declare const visaIcon: string;
49
+ export declare const redArrowDownIcon: string;
49
50
  export declare const completedIcon: string;
50
51
  export declare const chargeBackRequestedIcon: string;
51
52
  export declare const chargeBackIcon: string;
@@ -84,12 +85,14 @@ export declare const paidNoBgIcon: string;
84
85
  export declare const refunededNoBgIcon: string;
85
86
  export declare const deactivatedIcon: string;
86
87
  export declare const topUpIcon: string;
88
+ export declare const AIOverviewIcon: string;
87
89
  export declare const deMaximizeIcon: string;
88
90
  export declare const pendingFlag: string;
89
91
  export declare const ibanIcon: string;
90
92
  export declare const payoutIcon: string;
91
93
  export declare const releasedFlag: string;
92
94
  export declare const acceptedFlag: string;
95
+ export declare const clearIcon: string;
93
96
  export declare const unCapturedIcon: string;
94
97
  export declare const newWindowIcon: string;
95
98
  export declare const viewAllIcon: string;
@@ -51,6 +51,7 @@ export const storedValueWalletIcon = `${lightUrl}/storedValueWallet.svg`;
51
51
  export const buyNowPayLaterIcon = `${lightUrl}/buyNowPayLater.svg`;
52
52
  export const openBankingIcon = `${lightUrl}/openBanking.svg`;
53
53
  export const visaIcon = `${lightUrl}/visa.svg`;
54
+ export const redArrowDownIcon = `${lightUrl}/redArrowDownIcon.svg`;
54
55
  export const completedIcon = `${lightUrl}/completed.svg`;
55
56
  export const chargeBackRequestedIcon = `${lightUrl}/chargebackRequested.svg`;
56
57
  export const chargeBackIcon = `${lightUrl}/chargeback.svg`;
@@ -89,12 +90,14 @@ export const paidNoBgIcon = `${lightUrl}/paidStatusIcon.svg`;
89
90
  export const refunededNoBgIcon = `${lightUrl}/refundedStatusIcon.svg`;
90
91
  export const deactivatedIcon = `${lightUrl}/deactivatedIcon.svg`;
91
92
  export const topUpIcon = `${lightUrl}/topup.svg`;
93
+ export const AIOverviewIcon = `${lightUrl}/AIOverviewIcon.svg`;
92
94
  export const deMaximizeIcon = `${appBaseUrl}/demaximize.svg`;
93
95
  export const pendingFlag = `${lightUrl}/pendingFlag.svg`;
94
96
  export const ibanIcon = `${lightUrl}/ibanIcon.svg`;
95
97
  export const payoutIcon = `${lightUrl}/payoutIcon.svg`;
96
98
  export const releasedFlag = `${lightUrl}/releasedFlag.svg`;
97
99
  export const acceptedFlag = `${lightUrl}/acceptedFlag.svg`;
100
+ export const clearIcon = `${lightUrl}/clearIcon.svg`;
98
101
  export const unCapturedIcon = `${lightUrl}/status/unCaptured.svg`;
99
102
  export const newWindowIcon = `${appBaseUrl}/newWindow.svg`;
100
103
  export const viewAllIcon = `${appBaseUrl}/viewAll.svg`;
@@ -32,5 +32,6 @@ export * from './filter';
32
32
  export * from './utilities';
33
33
  export * from './reports';
34
34
  export * from './document';
35
+ export * from './toggleOptions';
35
36
  export * from './toast';
36
37
  export * from './flag';
@@ -32,5 +32,6 @@ export * from './filter';
32
32
  export * from './utilities';
33
33
  export * from './reports';
34
34
  export * from './document';
35
+ export * from './toggleOptions';
35
36
  export * from './toast';
36
37
  export * from './flag';
@@ -0,0 +1,2 @@
1
+ import { DATA_KEY } from '../constants/index.js';
2
+ export type DataKey = (typeof DATA_KEY)[keyof typeof DATA_KEY];
@@ -43,5 +43,9 @@ 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 getDateLabel: (from: Date, to: Date) => {
47
+ label: string;
48
+ isCustom: boolean;
49
+ };
46
50
  export declare const isValidDate: (date?: Date | string | number) => boolean;
47
51
  export {};
@@ -245,6 +245,43 @@ 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 getDateLabel = (from, to) => {
249
+ const start = dayjs(from).startOf('day');
250
+ const end = dayjs(to).endOf('day');
251
+ const today = dayjs().startOf('day');
252
+ const currentYear = today.year();
253
+ const diffDays = end.diff(start, 'day') + 1;
254
+ // Today / Yesterday
255
+ if (start.isToday() && end.isToday())
256
+ return { label: 'Today', isCustom: false };
257
+ if (start.isYesterday() && end.isYesterday())
258
+ return { label: 'Yesterday', isCustom: false };
259
+ // Last 7 days
260
+ if (diffDays === 7 && end.isSame(today, 'day'))
261
+ return { label: 'Last 7 days', isCustom: false };
262
+ // Last 30 days (inclusive)
263
+ if (diffDays === 31 && end.isSame(today, 'day'))
264
+ return { label: 'Last 30 days', isCustom: false };
265
+ // Full month
266
+ if (start.date() === 1 && end.date() === end.daysInMonth() && start.month() === end.month()) {
267
+ const monthLabel = start.year() === currentYear ? start.format('MMMM') : start.format('MMMM YYYY');
268
+ return { label: monthLabel, isCustom: false };
269
+ }
270
+ // Same day: show Month + Day
271
+ if (start.isSame(end, 'day')) {
272
+ const label = start.format(start.year() === currentYear ? 'MMM D' : 'MMM D YYYY');
273
+ return { label, isCustom: false };
274
+ }
275
+ // Custom range
276
+ const showStartYear = start.year() !== currentYear;
277
+ const showEndYear = end.year() !== currentYear;
278
+ const startLabel = start.format(`MMM D${showStartYear ? ' YYYY' : ''}`);
279
+ const endLabel = end.format(`MMM D${showEndYear ? ' YYYY' : ''}`);
280
+ return {
281
+ label: `${startLabel} – ${endLabel}`,
282
+ isCustom: true,
283
+ };
284
+ };
248
285
  export const isValidDate = (date) => {
249
286
  return dayjs(date).isValid();
250
287
  };
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.398-test.1",
5
- "testVersion": 1,
4
+ "version": "0.1.398-test.2",
5
+ "testVersion": 2,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { ChargeStatusIconProps } from './type';
3
- export interface ChargeStatusIconViewProps extends Pick<ChargeStatusIconProps, 'chargeStatus' | 'errorCode' | 'showBadge' | 'unCapturedStyles' | 'gatewayContainerStyles' | 'gatewayIconWrapperStyles' | 'gateWayIconStyles' | 'iconWrapperStyles' | 'gatewayCode' | 'acquirerCode' | 'gateWayIconStyles' | 'iconWrapperStyles' | 'unCapturedStyles'> {
4
- chargeIcon: React.ReactNode;
5
- chargeTooltipTitle?: React.ReactNode;
6
- acquirerTooltipTitle?: React.ReactNode;
7
- unCapturedStatusStyle?: any;
8
- gatewayTooltipTitle?: React.ReactNode;
9
- }
10
- export declare const ChargeStatusIconView: React.FC<ChargeStatusIconViewProps>;
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useTranslation } from 'react-i18next';
3
- import camelCase from 'lodash/camelCase';
4
- import Tooltip from '../../Tooltip';
5
- import { unCapturedStatuses } from '../../../constants/index.js';
6
- import { StatusIconWrapper } from '../../TableCells/CustomCells/style';
7
- import { AcquirerContainerAnimationVariants, ErrorCodeLabel, ErrorCodeLabelAnimationVariants, ErrorCodeVariants, ErrorCodeWrapper, GateWayIcon, GatewayIconWrapper, GatewayIconWrapperAnimationTransition, GatewaysContainer, GatewaysContainerAnimationVariants, UnCapturedBadge, UnCapturedContainer, errorCodeLabelAnimation, } from './style';
8
- export const ChargeStatusIconView = ({ chargeStatus, chargeIcon, chargeTooltipTitle, acquirerTooltipTitle, gatewayTooltipTitle, errorCode, showBadge = true, unCapturedStyles, unCapturedStatusStyle, gatewayContainerStyles, gatewayIconWrapperStyles, gateWayIconStyles, iconWrapperStyles, }) => {
9
- const { t } = useTranslation();
10
- const isUnCaptured = (unCapturedStatuses === null || unCapturedStatuses === void 0 ? void 0 : unCapturedStatuses.includes(chargeStatus || '')) &&
11
- (chargeTooltipTitle || acquirerTooltipTitle || gatewayTooltipTitle);
12
- if (isUnCaptured) {
13
- return (_jsx(StatusIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_StatusIconWrapper", style: iconWrapperStyles }, { children: _jsxs(UnCapturedContainer, Object.assign({ "data-testid": "ChargeStatusIcon_UnCapturedContainer", whileHover: ['animate', 'fadeIn'], style: Object.assign(Object.assign({ left: '0' }, (showBadge && {
14
- paddingInline: '12px',
15
- border: '1px solid #F2F2F2',
16
- borderRadius: '12px',
17
- backgroundColor: '#fff',
18
- })), unCapturedStyles) }, { children: [_jsx(UnCapturedBadge, Object.assign({ "data-testid": "ChargeStatusIcon_UnCapturedBadge", sx: { borderRadius: '56px' }, initial: { background: 'transparent' }, variants: {
19
- animate: { background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background },
20
- } }, { children: _jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsxs(_Fragment, { children: [chargeIcon, _jsx(ErrorCodeWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_ErrorCodeWrapper", transition: { animate: { duration: 0.05 } }, variants: ErrorCodeLabelAnimationVariants, style: Object.assign({}, (errorCode && { padding: '0 !important' })) }, { children: _jsx(ErrorCodeLabel, Object.assign({ "data-testid": "ChargeStatusIcon_ErrorCodeLabel", sx: { background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color }, transition: errorCodeLabelAnimation, variants: ErrorCodeVariants, initial: { opacity: 0 } }, { children: errorCode })) }))] }) })) })), _jsx(GatewaysContainer, Object.assign({ "data-testid": "ChargeStatusIcon_GatewaysContainer", transition: GatewayIconWrapperAnimationTransition, variants: GatewaysContainerAnimationVariants, style: gatewayContainerStyles, isVisible: !!gatewayTooltipTitle }, { children: gatewayTooltipTitle && (_jsx(Tooltip, Object.assign({ title: gatewayTooltipTitle }, { children: _jsx(GatewayIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_GatewayIconWrapper", style: Object.assign({ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background }, gatewayIconWrapperStyles) }, { children: _jsx(GateWayIcon, { src: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.gatewayIcon, alt: "gateway-icon", "data-testid": "ChargeStatusIcon_GatewayIcon", style: gateWayIconStyles }) })) }))) })), _jsx(GatewaysContainer, Object.assign({ "data-testid": "ChargeStatusIcon_GatewaysContainer", transition: GatewayIconWrapperAnimationTransition, variants: AcquirerContainerAnimationVariants, style: gatewayContainerStyles, isVisible: !!acquirerTooltipTitle }, { children: acquirerTooltipTitle && (_jsx(Tooltip, Object.assign({ title: acquirerTooltipTitle }, { children: _jsx(GatewayIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_AcquirerIconWrapper", style: Object.assign({ background: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background }, gatewayIconWrapperStyles) }, { children: _jsx(GateWayIcon, { src: unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.acquirerIcon, alt: "acquirer-icon", "data-testid": "ChargeStatusIcon_AcquirerIcon", style: gateWayIconStyles }) })) }))) }))] })) })));
21
- }
22
- return (_jsx(StatusIconWrapper, Object.assign({ "data-testid": "ChargeStatusIcon_StatusIconWrapper", style: iconWrapperStyles }, { children: _jsx(Tooltip, Object.assign({ title: chargeTooltipTitle !== null && chargeTooltipTitle !== void 0 ? chargeTooltipTitle : t(camelCase(chargeStatus)) }, { children: _jsx(StatusIconWrapper, { children: chargeIcon }) })) })));
23
- };
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { SelectionProps } from '../../../types/index.js';
3
- import { ChargeStatusIconProps } from './type';
4
- export interface ChargeStatusSheetViewProps extends Pick<ChargeStatusIconProps, 'chargeStatus' | 'errorCode' | 'gatewayCode' | 'acquirerCode'> {
5
- chipIndex?: number;
6
- selectionProps?: SelectionProps;
7
- unCapturedStatusStyle?: any;
8
- }
9
- export declare const ChargeStatusSheetView: React.FC<ChargeStatusSheetViewProps>;
@@ -1,9 +0,0 @@
1
- import { jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useTranslation } from 'react-i18next';
3
- import camelCase from 'lodash/camelCase';
4
- import StatusChipWithCopy from '../../StatusChipWithCopy';
5
- import { TextViewWrapper } from './style';
6
- export const ChargeStatusSheetView = ({ chargeStatus, errorCode, chipIndex = 0, selectionProps = {}, gatewayCode, acquirerCode, unCapturedStatusStyle, }) => {
7
- const { t } = useTranslation();
8
- return (_jsxs(TextViewWrapper, { children: [_jsxs(StatusChipWithCopy, Object.assign({ copyText: t(camelCase(chargeStatus)), chipIndex: chipIndex, selectionProps: selectionProps }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Gateway", chipIndex: 1, selectionProps: selectionProps }, { children: ["Gateway ", gatewayCode] }))), acquirerCode && (_jsxs(StatusChipWithCopy, Object.assign({ copyText: "Acquirer", chipIndex: 2, selectionProps: selectionProps }, { children: ["Acquirer ", acquirerCode] })))] }))] }));
9
- };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { ChargeStatusIconProps } from './type';
3
- export interface ChargeStatusTextViewProps extends Pick<ChargeStatusIconProps, 'chargeStatus' | 'errorCode' | 'gatewayCode' | 'acquirerCode'> {
4
- gatewayTooltipTitle?: React.ReactNode;
5
- acquirerTooltipTitle?: React.ReactNode;
6
- chargeTooltipTitle?: React.ReactNode;
7
- unCapturedStatusStyle: React.CSSProperties | null;
8
- captureStatusStyle: React.CSSProperties | null;
9
- }
10
- export declare const ChargeStatusTextView: React.FC<ChargeStatusTextViewProps>;
@@ -1,16 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useTheme } from '@mui/material/styles';
3
- import { useTranslation } from 'react-i18next';
4
- import camelCase from 'lodash/camelCase';
5
- import Tooltip from '../../Tooltip';
6
- import { TextLabel } from '../../TableCells/CustomCells/style';
7
- import { TextViewWrapper, StatusTextLabel } from './style';
8
- export const ChargeStatusTextView = ({ chargeStatus, chargeTooltipTitle, unCapturedStatusStyle, captureStatusStyle, errorCode, gatewayCode, gatewayTooltipTitle, acquirerCode, acquirerTooltipTitle, }) => {
9
- const theme = useTheme();
10
- const { t } = useTranslation();
11
- const commonStyles = {
12
- background: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.background) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.background) || 'transparent',
13
- color: (unCapturedStatusStyle === null || unCapturedStatusStyle === void 0 ? void 0 : unCapturedStatusStyle.color) || (captureStatusStyle === null || captureStatusStyle === void 0 ? void 0 : captureStatusStyle.color) || theme.palette.info.dark,
14
- };
15
- return (_jsxs(TextViewWrapper, { children: [_jsx(Tooltip, Object.assign({ title: chargeTooltipTitle }, { children: _jsxs(StatusTextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: Object.assign(Object.assign({}, commonStyles), { borderColor: `${commonStyles.color}1A` }) }, { children: [t(camelCase(chargeStatus)), " ", errorCode] })) })), unCapturedStatusStyle && (_jsxs(_Fragment, { children: [gatewayCode && (_jsx(Tooltip, Object.assign({ title: gatewayTooltipTitle }, { children: _jsxs(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: commonStyles }, { children: ["Gateway ", gatewayCode] })) }))), acquirerCode && (_jsx(Tooltip, Object.assign({ title: acquirerTooltipTitle }, { children: _jsxs(TextLabel, Object.assign({ "data-testid": "ChargeStatusIcon_isTextShown", "data-status": camelCase(chargeStatus), sx: commonStyles }, { children: ["Acquirer ", acquirerCode] })) })))] }))] }));
16
- };
@@ -1,24 +0,0 @@
1
- import { ReactNode, CSSProperties } from 'react';
2
- import { type ChargeStatus } from '../../TableCells';
3
- import { SelectionProps } from '../../../types/index.js';
4
- export interface ChargeStatusIconProps {
5
- chargeStatus?: ChargeStatus;
6
- gatewayTooltip?: string;
7
- showAuthorizedStatus?: boolean;
8
- chargeTooltip?: string;
9
- acquirerTooltip?: string;
10
- errorCode?: string;
11
- isTextShown?: boolean;
12
- gatewayCode?: ReactNode;
13
- acquirerCode?: React.ReactNode;
14
- unCapturedStyles?: CSSProperties;
15
- iconStyles?: CSSProperties;
16
- iconWrapperStyles?: CSSProperties;
17
- gatewayIconWrapperStyles?: CSSProperties;
18
- gatewayContainerStyles?: CSSProperties;
19
- gateWayIconStyles?: CSSProperties;
20
- showBadge?: boolean;
21
- isSheetViewShown?: boolean;
22
- selectionProps?: SelectionProps;
23
- chipIndex?: number;
24
- }