@tap-payments/os-micro-frontend-shared 0.1.226 → 0.1.228-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.
- package/build/components/Autocomplete/Autocomplete.d.ts +10 -0
- package/build/components/Autocomplete/Autocomplete.js +33 -0
- package/build/components/Autocomplete/index.d.ts +2 -0
- package/build/components/Autocomplete/index.js +1 -0
- package/build/components/Autocomplete/style.d.ts +4 -0
- package/build/components/Autocomplete/style.js +47 -0
- package/build/components/Chip/style.d.ts +0 -1
- package/build/components/CountBadge/style.d.ts +0 -1
- package/build/components/Dialog/style.d.ts +0 -1
- package/build/components/FlippingCard/style.d.ts +0 -1
- package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
- package/build/components/JSONViewer/style.d.ts +0 -1
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
- package/build/components/SearchButton/styles.d.ts +0 -1
- package/build/components/StatusBar/StatusBar.d.ts +3 -1
- package/build/components/StatusBar/StatusBar.js +3 -3
- package/build/components/StatusButton/StatusButton.js +2 -2
- package/build/components/StatusButton/type.d.ts +2 -1
- package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
- package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/style.d.ts +0 -1
- package/build/components/VirtualTables/components/style.d.ts +0 -1
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/constants/apps.js +3 -3
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.js +1 -0
- package/build/types/tsUtils.d.ts +4 -0
- package/build/types/tsUtils.js +1 -0
- package/build/utils/date.d.ts +4 -0
- package/build/utils/date.js +21 -0
- package/package.json +3 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutocompleteRenderInputParams, AutocompleteProps as MuiAutocompleteProps } from '@mui/material/Autocomplete';
|
|
3
|
+
import { TextFieldProps } from '@mui/material/TextField';
|
|
4
|
+
import { MakeOptional } from '../../types/index.js';
|
|
5
|
+
export type AutocompleteProps<Value = string, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType = 'div'> = {
|
|
6
|
+
label?: TextFieldProps['label'];
|
|
7
|
+
textFieldProps?: TextFieldProps | ((params: AutocompleteRenderInputParams) => TextFieldProps);
|
|
8
|
+
} & MakeOptional<MuiAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>, 'renderInput'>;
|
|
9
|
+
declare const Autocomplete: <Value = string, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends React.ElementType<any, keyof React.JSX.IntrinsicElements> = "div">(props: AutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default Autocomplete;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { useCallback } from 'react';
|
|
14
|
+
import MuiAutocomplete from '@mui/material/Autocomplete';
|
|
15
|
+
import Box from '@mui/material/Box';
|
|
16
|
+
import { PopperStyled, AutocompleteTextFieldStyled as TextField } from './style';
|
|
17
|
+
import { blackRightArrowIcon } from '../../constants/index.js';
|
|
18
|
+
const Autocomplete = (props) => {
|
|
19
|
+
const { options, value, onChange, label, renderInput, slotProps, textFieldProps } = props, rest = __rest(props, ["options", "value", "onChange", "label", "renderInput", "slotProps", "textFieldProps"]);
|
|
20
|
+
const defaultRenderInput = useCallback((params) => {
|
|
21
|
+
const fieldProps = typeof textFieldProps === 'function' ? textFieldProps(params) : textFieldProps;
|
|
22
|
+
return _jsx(TextField, Object.assign({}, params, fieldProps, { label: label }));
|
|
23
|
+
}, [textFieldProps, label]);
|
|
24
|
+
return (_jsx(MuiAutocomplete, Object.assign({ options: options, value: value, onChange: onChange, popupIcon: _jsx(Box, { component: "img", src: blackRightArrowIcon, sx: { transform: 'rotate(90deg)' }, width: 8, alt: "close" }), renderInput: renderInput || defaultRenderInput, PopperComponent: PopperStyled }, rest, { slotProps: Object.assign(Object.assign({}, slotProps), { popper: Object.assign({ modifiers: [
|
|
25
|
+
{
|
|
26
|
+
name: 'offset',
|
|
27
|
+
options: {
|
|
28
|
+
offset: [0, 4],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
] }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.popper) }) })));
|
|
32
|
+
};
|
|
33
|
+
export default Autocomplete;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Autocomplete } from './Autocomplete';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import TextField from '@mui/material/TextField';
|
|
3
|
+
export declare const AutocompleteTextFieldStyled: typeof TextField;
|
|
4
|
+
export declare const PopperStyled: import("react").ForwardRefExoticComponent<import("@mui/material/Popper").PopperProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
3
|
+
import TextField from '@mui/material/TextField';
|
|
4
|
+
import Popper from '@mui/material/Popper';
|
|
5
|
+
export const AutocompleteTextFieldStyled = styled(TextField)({
|
|
6
|
+
'& .MuiInputBase-root': {
|
|
7
|
+
paddingTop: 13,
|
|
8
|
+
paddingBottom: 13,
|
|
9
|
+
borderRadius: 4,
|
|
10
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
11
|
+
borderWidth: 1,
|
|
12
|
+
borderStyle: 'solid',
|
|
13
|
+
borderColor: '#F2F2F2',
|
|
14
|
+
},
|
|
15
|
+
'&:hover': {
|
|
16
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
17
|
+
borderColor: '#F2F2F2',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
'&.Mui-focused': {
|
|
21
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
22
|
+
borderColor: '#1F88D0',
|
|
23
|
+
boxShadow: '0px 0px 4px 0px #1F88D080',
|
|
24
|
+
},
|
|
25
|
+
'&:hover': {
|
|
26
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
27
|
+
borderColor: '#1F88D0',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
[`& .${autocompleteClasses.input}`]: {
|
|
32
|
+
fontSize: 11,
|
|
33
|
+
paddingTop: 0,
|
|
34
|
+
paddingBottom: 0,
|
|
35
|
+
paddingLeft: 0,
|
|
36
|
+
},
|
|
37
|
+
[`& .${autocompleteClasses.endAdornment}`]: {
|
|
38
|
+
marginRight: 8,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
export const PopperStyled = styled(Popper)({
|
|
43
|
+
fontSize: 11,
|
|
44
|
+
borderRadius: '8px',
|
|
45
|
+
border: '1px solid #F2F2F2',
|
|
46
|
+
boxShadow: '0px 2px 56px 0px #20232B24',
|
|
47
|
+
});
|
|
@@ -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,11 +1,13 @@
|
|
|
1
1
|
import { TableHeaderStatus } from '../../types/index.js';
|
|
2
2
|
import { AvailableStatus } from './type';
|
|
3
|
+
import { SxProps } from '@mui/material';
|
|
3
4
|
interface StatusBarProps<IStatus extends TableHeaderStatus | TableHeaderStatus[] = undefined> {
|
|
4
5
|
status?: IStatus;
|
|
5
6
|
availableStatuses?: AvailableStatus<IStatus>[];
|
|
6
7
|
isFilteredIdsShown?: boolean;
|
|
7
8
|
onStatusChange?: (status?: IStatus) => void;
|
|
9
|
+
buttonSx?: SxProps;
|
|
8
10
|
}
|
|
9
|
-
declare function StatusBar<IStatus extends TableHeaderStatus | TableHeaderStatus[] = undefined>({ isFilteredIdsShown, availableStatuses, status, onStatusChange, }: Readonly<StatusBarProps<IStatus>>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function StatusBar<IStatus extends TableHeaderStatus | TableHeaderStatus[] = undefined>({ isFilteredIdsShown, availableStatuses, status, onStatusChange, buttonSx, }: Readonly<StatusBarProps<IStatus>>): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
declare const _default: typeof StatusBar;
|
|
11
13
|
export default _default;
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
14
14
|
import { Fragment, memo, useCallback } from 'react';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
16
|
import StatusButton from '../StatusButton';
|
|
17
|
-
function StatusBar({ isFilteredIdsShown, availableStatuses, status, onStatusChange, }) {
|
|
17
|
+
function StatusBar({ isFilteredIdsShown, availableStatuses, status, onStatusChange, buttonSx, }) {
|
|
18
18
|
const { t } = useTranslation();
|
|
19
19
|
const getButtonStatus = useCallback((buttonStatus) => {
|
|
20
20
|
return buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive';
|
|
@@ -33,7 +33,7 @@ function StatusBar({ isFilteredIdsShown, availableStatuses, status, onStatusChan
|
|
|
33
33
|
if (!Array.isArray(s.status)) {
|
|
34
34
|
handleStatusChange(s.status);
|
|
35
35
|
}
|
|
36
|
-
} })));
|
|
36
|
+
}, buttonSx: buttonSx })));
|
|
37
37
|
}
|
|
38
38
|
const statusItems = s.status;
|
|
39
39
|
if (!statusItems)
|
|
@@ -47,7 +47,7 @@ function StatusBar({ isFilteredIdsShown, availableStatuses, status, onStatusChan
|
|
|
47
47
|
status: stat === null || stat === void 0 ? void 0 : stat.value,
|
|
48
48
|
icon: stat.icon,
|
|
49
49
|
onClick: () => handleStatusChange(stat.value),
|
|
50
|
-
})) })) }, (_c = formattedStatuses[0]) === null || _c === void 0 ? void 0 : _c.value));
|
|
50
|
+
})), buttonSx: buttonSx })) }, (_c = formattedStatuses[0]) === null || _c === void 0 ? void 0 : _c.value));
|
|
51
51
|
}) }));
|
|
52
52
|
}
|
|
53
53
|
export default memo(StatusBar);
|
|
@@ -19,7 +19,7 @@ import { ChevronContainer, Label, LabelWrapper, StyledStatusIcon, StyledDropdown
|
|
|
19
19
|
import { statusButtonIcons } from './constant';
|
|
20
20
|
const StatusButton = memo((props) => {
|
|
21
21
|
var _a;
|
|
22
|
-
const { variant = 'inActive', badgeCount, icon, label, dropdownOptions, selectedStatus: initialStatus, onButtonBodyClick, iconMapper = statusButtonIcons } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "selectedStatus", "onButtonBodyClick", "iconMapper"]);
|
|
22
|
+
const { variant = 'inActive', badgeCount, icon, label, dropdownOptions, selectedStatus: initialStatus, onButtonBodyClick, iconMapper = statusButtonIcons, buttonSx } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "selectedStatus", "onButtonBodyClick", "iconMapper", "buttonSx"]);
|
|
23
23
|
const [buttonClicks, setButtonClicks] = useState(0);
|
|
24
24
|
const { t } = useTranslation();
|
|
25
25
|
const buttonRef = useRef(null);
|
|
@@ -75,6 +75,6 @@ const StatusButton = memo((props) => {
|
|
|
75
75
|
const menuItems = useMemo(() => (dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((item) => (Object.assign(Object.assign({}, item), { onClick: handleMenuItemClick(item) })))) || [], [dropdownOptions, handleMenuItemClick]);
|
|
76
76
|
const ButtonComponent = statusButtonVariants[variant];
|
|
77
77
|
const displayLabel = selectedStatus ? t(selectedStatus) : label;
|
|
78
|
-
return (_jsxs(_Fragment, { children: [_jsx(ButtonComponent, Object.assign({ "data-testid": "StatusButton" }, restProps, { ref: buttonRef, onClick: handleButtonClick, sx: Object.assign({}, (hasDropdown && { paddingInlineEnd: '27px' })) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, displayLabel, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] }) })), isDropdownOpen && hasDropdown && (_jsx(StyledDropdown, { open: isDropdownOpen, onClose: handleDropdownClose, anchorEl: anchorEl, menuItems: menuItems }))] }));
|
|
78
|
+
return (_jsxs(_Fragment, { children: [_jsx(ButtonComponent, Object.assign({ "data-testid": "StatusButton" }, restProps, { ref: buttonRef, onClick: handleButtonClick, sx: Object.assign(Object.assign({}, (hasDropdown && { paddingInlineEnd: '27px' })), buttonSx) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, displayLabel, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] }) })), isDropdownOpen && hasDropdown && (_jsx(StyledDropdown, { open: isDropdownOpen, onClose: handleDropdownClose, anchorEl: anchorEl, menuItems: menuItems }))] }));
|
|
79
79
|
});
|
|
80
80
|
export default StatusButton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { type ButtonProps } from '@mui/material';
|
|
2
|
+
import { SxProps, type ButtonProps } from '@mui/material';
|
|
3
3
|
import { TableHeaderStatus } from '../../types/index.js';
|
|
4
4
|
import { type StatusButtonVariant } from './style';
|
|
5
5
|
import { MenuItemI } from '../DropdownMenu';
|
|
@@ -29,6 +29,7 @@ export interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'childr
|
|
|
29
29
|
dropdownOptions?: Array<MenuItemI & {
|
|
30
30
|
status: TableHeaderStatus;
|
|
31
31
|
}>;
|
|
32
|
+
buttonSx?: SxProps;
|
|
32
33
|
}
|
|
33
34
|
export interface ChevronIconProps {
|
|
34
35
|
isActive?: boolean;
|
|
@@ -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 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 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 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 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 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 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 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>, {}>;
|
package/build/constants/apps.js
CHANGED
|
@@ -371,11 +371,11 @@ export const APP_DIMENSIONS = {
|
|
|
371
371
|
maxHeight: '100vh',
|
|
372
372
|
},
|
|
373
373
|
[APP_CODES.reports.code]: {
|
|
374
|
-
width:
|
|
375
|
-
minWidth:
|
|
374
|
+
width: 700,
|
|
375
|
+
minWidth: 700,
|
|
376
376
|
maxWidth: 'unset',
|
|
377
377
|
maxHeight: 'unset',
|
|
378
|
-
height:
|
|
378
|
+
height: 652,
|
|
379
379
|
},
|
|
380
380
|
[APP_CODES.billing.code]: {
|
|
381
381
|
minWidth: 856,
|
|
@@ -564,3 +564,4 @@ export const inActiveGreyIcon = `${lightUrl}/inActiveGreyIcon.svg`;
|
|
|
564
564
|
export const terminalLinkVideo = `${videosUrl}/terminal_link.mp4`;
|
|
565
565
|
export const bluePlusIcon = `${lightUrl}/bluePlusIcon.svg`;
|
|
566
566
|
export const blackSettingsVariant2Icon = `${lightUrl}/blackSettingsVariant2Icon.svg`;
|
|
567
|
+
export const exclamationWhiteIcon = `${lightUrl}/exclamationWhite.svg`;
|
package/build/types/index.d.ts
CHANGED
package/build/types/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/utils/date.d.ts
CHANGED
|
@@ -38,3 +38,7 @@ export declare const generatePastYearList: (length?: number) => {
|
|
|
38
38
|
label: number;
|
|
39
39
|
}[];
|
|
40
40
|
export declare function secondsToTimeString(seconds: number): string;
|
|
41
|
+
type TimeUnit = 'seconds' | 'minutes' | 'hours' | 'days';
|
|
42
|
+
export declare function isWithinTimeAgo(timestampMs: number, amount: number, unit?: TimeUnit): boolean;
|
|
43
|
+
export declare const formatRelativeTimeWithinHour: (timestampMs: number) => string;
|
|
44
|
+
export {};
|
package/build/utils/date.js
CHANGED
|
@@ -216,3 +216,24 @@ export function secondsToTimeString(seconds) {
|
|
|
216
216
|
}
|
|
217
217
|
return `${pad(minutes)}:${pad(secondsValue)}`;
|
|
218
218
|
}
|
|
219
|
+
export function isWithinTimeAgo(timestampMs, amount, unit = 'seconds') {
|
|
220
|
+
const unitSeconds = {
|
|
221
|
+
seconds: 1,
|
|
222
|
+
minutes: 60,
|
|
223
|
+
hours: 3600,
|
|
224
|
+
days: 86400,
|
|
225
|
+
};
|
|
226
|
+
const now = Date.now();
|
|
227
|
+
const diffSeconds = (now - timestampMs) / 1000;
|
|
228
|
+
return diffSeconds < amount * unitSeconds[unit];
|
|
229
|
+
}
|
|
230
|
+
export const formatRelativeTimeWithinHour = (timestampMs) => {
|
|
231
|
+
const now = Date.now();
|
|
232
|
+
const diffSeconds = Math.floor((now - timestampMs) / 1000);
|
|
233
|
+
const diffMinutes = Math.floor(diffSeconds / 60);
|
|
234
|
+
if (isWithinTimeAgo(timestampMs, 60, 'seconds'))
|
|
235
|
+
return 'just now';
|
|
236
|
+
if (isWithinTimeAgo(timestampMs, 60, 'minutes'))
|
|
237
|
+
return `${diffMinutes} min${diffMinutes === 1 ? '' : 's'} ago`;
|
|
238
|
+
return '1 hour ago'; // fallback for > 59 mins
|
|
239
|
+
};
|
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.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.228-test.1",
|
|
5
|
+
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -163,4 +163,4 @@
|
|
|
163
163
|
"publishConfig": {
|
|
164
164
|
"registry": "https://registry.npmjs.org/"
|
|
165
165
|
}
|
|
166
|
-
}
|
|
166
|
+
}
|