@tap-payments/os-micro-frontend-shared 0.0.97 → 0.0.99

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 (29) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +12 -12
  3. package/build/components/DropdownMenu/DropdownMenu.d.ts +1 -1
  4. package/build/components/DropdownMenu/DropdownMenu.js +3 -3
  5. package/build/components/DropdownMenu/type.d.ts +1 -0
  6. package/build/components/MultiSelectStatusButton/MultiSelectStatusButton.d.ts +5 -0
  7. package/build/components/MultiSelectStatusButton/MultiSelectStatusButton.js +97 -0
  8. package/build/components/MultiSelectStatusButton/index.d.ts +3 -0
  9. package/build/components/MultiSelectStatusButton/index.js +2 -0
  10. package/build/components/MultiSelectStatusButton/style.d.ts +41 -0
  11. package/build/components/MultiSelectStatusButton/style.js +71 -0
  12. package/build/components/MultiSelectStatusButton/type.d.ts +14 -0
  13. package/build/components/MultiSelectStatusButton/type.js +1 -0
  14. package/build/components/SearchButton/styles.d.ts +1 -1
  15. package/build/components/StatusBar/StatusBar.d.ts +6 -1
  16. package/build/components/StatusBar/StatusBar.js +62 -26
  17. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +1 -1
  18. package/build/components/TableCells/CustomCells/SourceMergedCell/style.d.ts +1 -1
  19. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +1 -1
  20. package/build/components/TableHeader_V2/components/StatusButtons/ChevronIcon.d.ts +1 -1
  21. package/build/components/TableHeader_V2/components/StatusButtons/ChevronIcon.js +4 -2
  22. package/build/components/TableHeader_V2/components/StatusButtons/style.js +1 -0
  23. package/build/components/TableHeader_V2/components/StatusButtons/type.d.ts +3 -0
  24. package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.js +18 -31
  25. package/build/components/VirtualTable/style.d.ts +1 -1
  26. package/build/components/index.d.ts +1 -0
  27. package/build/components/index.js +1 -0
  28. package/build/types/table.d.ts +1 -1
  29. package/package.json +132 -132
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Tap Payments
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tap Payments
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # os-micro-frontend-shared
2
-
3
- ## Publishing Workflow
4
-
5
- 1. Update version in package.json
6
- 2. Commit changes
7
- 3. Create and push a tag:
8
-
9
- ```bash
10
- npm version patch # or minor, major
11
- git push origin main --tags
12
- ```
1
+ # os-micro-frontend-shared
2
+
3
+ ## Publishing Workflow
4
+
5
+ 1. Update version in package.json
6
+ 2. Commit changes
7
+ 3. Create and push a tag:
8
+
9
+ ```bash
10
+ npm version patch # or minor, major
11
+ git push origin main --tags
12
+ ```
@@ -1,3 +1,3 @@
1
1
  import { IProps } from './type';
2
- declare function Dropdown({ open, menuItems, anchorEl, onClose, selected, ...props }: IProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function Dropdown({ open, menuItems, anchorEl, onClose, selected, allowShadows, ...props }: IProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default Dropdown;
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Divider, Box, useTheme } from '@mui/material';
14
14
  import { StyledListItemText, StyledMenu, StyledListItemIcon, StyledMenuItem } from './styles';
15
15
  function Dropdown(_a) {
16
- var { open, menuItems, anchorEl, onClose, selected } = _a, props = __rest(_a, ["open", "menuItems", "anchorEl", "onClose", "selected"]);
16
+ var { open, menuItems, anchorEl, onClose, selected, allowShadows = true } = _a, props = __rest(_a, ["open", "menuItems", "anchorEl", "onClose", "selected", "allowShadows"]);
17
17
  const theme = useTheme();
18
18
  return (_jsx(StyledMenu, Object.assign({ open: open, anchorEl: anchorEl, onClose: onClose, onContextMenu: (e) => {
19
19
  e.preventDefault();
@@ -27,7 +27,7 @@ function Dropdown(_a) {
27
27
  item.onClick(e);
28
28
  }, onContextMenu: item.onRightClick, selected: item.selected, sx: Object.assign({ '&:hover': {
29
29
  backgroundColor: 'transparent',
30
- boxShadow: theme.shadows[10],
30
+ boxShadow: allowShadows ? theme.shadows[10] : 'none',
31
31
  '& .sandbox-Icon': {
32
32
  display: 'none',
33
33
  },
@@ -36,7 +36,7 @@ function Dropdown(_a) {
36
36
  },
37
37
  } }, (idx === selected && {
38
38
  backgroundColor: 'transparent',
39
- boxShadow: theme.shadows[10],
39
+ boxShadow: allowShadows ? theme.shadows[10] : 'none',
40
40
  })) }, { children: [item.icon && _jsx(StyledListItemIcon, { children: item.icon }), _jsx(StyledListItemText, { children: item.label }), _jsx(Box, Object.assign({ className: item.alwaysShowRightAction ? '' : 'menu-right-action' }, { children: item.rightAction && item.rightAction }))] }))) }, `${item.label}-${idx}`));
41
41
  }) })));
42
42
  }
@@ -17,4 +17,5 @@ export interface IProps {
17
17
  anchorEl?: Element | null | undefined;
18
18
  style?: CSSProperties;
19
19
  selected?: number;
20
+ allowShadows?: boolean;
20
21
  }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { MultiSelectStatusButtonProps } from './type';
3
+ declare function MultiSelectStatusButton({ options, selectedValues, onSelectionChange, label, variant }: MultiSelectStatusButtonProps): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: import("react").MemoExoticComponent<typeof MultiSelectStatusButton>;
5
+ export default _default;
@@ -0,0 +1,97 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { memo, useState, useRef, useEffect } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { Typography, Checkbox } from '@mui/material';
5
+ import { ChevronIcon } from '../TableHeader_V2/components/StatusButtons/ChevronIcon';
6
+ import StyledBadge, { BadgeVariants } from '../CountBadge';
7
+ import CountryFlag from '../CountryFlag';
8
+ import { formatNumber } from '../../utils/index.js';
9
+ import { closeXIcon } from '../../constants/index.js';
10
+ import { ChevronContainer, Label, LabelWrapper, StyledDropdown, MenuItemContainer, CheckboxStyles, StyledStatusButton, ClearIcon, ChevronIconWrapper, } from './style';
11
+ function MultiSelectStatusButton({ options, selectedValues, onSelectionChange, label, variant = 'inActive' }) {
12
+ const { t } = useTranslation();
13
+ const [anchorEl, setAnchorEl] = useState(null);
14
+ const buttonRef = useRef(null);
15
+ const [internalSelectedValues, setInternalSelectedValues] = useState(selectedValues);
16
+ const [dropdownWidth, setDropdownWidth] = useState(0);
17
+ const [isHovered, setIsHovered] = useState(false);
18
+ const isOpen = Boolean(anchorEl);
19
+ useEffect(() => {
20
+ if (!isOpen) {
21
+ setInternalSelectedValues(selectedValues);
22
+ }
23
+ }, [selectedValues, isOpen]);
24
+ const handleDropdownClick = (event) => {
25
+ var _a;
26
+ event.stopPropagation();
27
+ event.preventDefault();
28
+ if (isOpen) {
29
+ handleClose();
30
+ return;
31
+ }
32
+ setAnchorEl(buttonRef.current);
33
+ const buttonWidth = ((_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 200;
34
+ setDropdownWidth(Math.max(buttonWidth, 200));
35
+ };
36
+ const handleClose = () => {
37
+ const hasChanged = JSON.stringify([...internalSelectedValues].sort()) !== JSON.stringify([...selectedValues].sort());
38
+ if (hasChanged) {
39
+ onSelectionChange(internalSelectedValues);
40
+ }
41
+ setAnchorEl(null);
42
+ setDropdownWidth(0);
43
+ };
44
+ const handleClearAll = (event) => {
45
+ event.stopPropagation();
46
+ event.preventDefault();
47
+ setInternalSelectedValues([]);
48
+ onSelectionChange([]);
49
+ };
50
+ const handleOptionToggle = (optionStatus, event) => {
51
+ if (event) {
52
+ event.stopPropagation();
53
+ event.preventDefault();
54
+ }
55
+ const newSelection = internalSelectedValues.includes(optionStatus)
56
+ ? internalSelectedValues.filter((status) => status !== optionStatus)
57
+ : [...internalSelectedValues, optionStatus];
58
+ setInternalSelectedValues(newSelection);
59
+ };
60
+ const getDisplayLabel = () => {
61
+ return (_jsx(Typography, Object.assign({ fontWeight: 400, fontSize: "11px", variant: "inherit" }, { children: t('Currencies') })));
62
+ };
63
+ const countBadge = (_jsx(StyledBadge, Object.assign({ pointer: true, variant: variant === 'active' ? BadgeVariants.ACTIVE : BadgeVariants.INACTIVE }, { children: formatNumber(selectedValues.length > 0 ? selectedValues.length : options.length) })));
64
+ return (_jsxs(_Fragment, { children: [_jsx(StyledStatusButton, Object.assign({ buttonVariant: variant, ref: buttonRef, sx: {
65
+ paddingInlineEnd: '27px',
66
+ }, "data-testid": "MultiSelectStatusButton", onClick: handleDropdownClick, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [getDisplayLabel(), countBadge] })), _jsxs(ChevronContainer, Object.assign({ onClick: isHovered && internalSelectedValues.length > 0 ? handleClearAll : undefined, sx: {
67
+ '&:hover': {
68
+ backgroundColor: 'transparent',
69
+ },
70
+ } }, { children: [_jsx(ClearIcon, { variant: variant, src: closeXIcon, alt: "clear all", sx: {
71
+ opacity: isHovered && internalSelectedValues.length > 0 ? 1 : 0,
72
+ pointerEvents: isHovered && internalSelectedValues.length > 0 ? 'auto' : 'none',
73
+ } }), _jsx(ChevronIconWrapper, Object.assign({ isVisible: !(isHovered && internalSelectedValues.length > 0) }, { children: _jsx(ChevronIcon, { disableHover: true, isActive: variant === 'active' }) }))] }))] }) })), isOpen && anchorEl && (_jsx(StyledDropdown, { open: isOpen, onClose: handleClose, anchorEl: anchorEl, allowShadows: false, style: {
74
+ minWidth: dropdownWidth || 200,
75
+ width: dropdownWidth || 'auto',
76
+ marginTop: '6px',
77
+ maxWidth: 300,
78
+ }, sx: {
79
+ boxShadow: 'none !important',
80
+ '&:hover': {
81
+ boxShadow: 'none !important',
82
+ },
83
+ }, menuItems: options.map((option) => ({
84
+ label: (_jsxs(MenuItemContainer, { children: [_jsx(Checkbox, { checked: internalSelectedValues.includes(option.status), size: "small", sx: CheckboxStyles, onClick: (e) => {
85
+ var _a;
86
+ e.stopPropagation();
87
+ handleOptionToggle((_a = option.status) !== null && _a !== void 0 ? _a : '', e);
88
+ } }), _jsx(CountryFlag, { code: option.flagCode || option.code, sx: { border: '1px solid white', borderRadius: '3px' } }), _jsx(Typography, Object.assign({ variant: "body2" }, { children: option.name }))] })),
89
+ onClick: (e) => {
90
+ var _a;
91
+ e.preventDefault();
92
+ e.stopPropagation();
93
+ handleOptionToggle((_a = option.status) !== null && _a !== void 0 ? _a : '', e);
94
+ },
95
+ })) }))] }));
96
+ }
97
+ export default memo(MultiSelectStatusButton);
@@ -0,0 +1,3 @@
1
+ import MultiSelectStatusButton from './MultiSelectStatusButton';
2
+ export default MultiSelectStatusButton;
3
+ export type { CurrencyOption, MultiSelectStatusButtonProps } from './type';
@@ -0,0 +1,2 @@
1
+ import MultiSelectStatusButton from './MultiSelectStatusButton';
2
+ export default MultiSelectStatusButton;
@@ -0,0 +1,41 @@
1
+ import type React from 'react';
2
+ import { type Theme } from '@mui/material';
3
+ export { statusButtonVariants, ChevronContainer, Label, LabelWrapper, StyledDropdown, } from '../TableHeader_V2/components/StatusButtons/style';
4
+ export declare const StyledStatusButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
5
+ ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
6
+ }, "disabled" | "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "size" | "variant" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<Theme> & {
7
+ buttonVariant: 'active' | 'inActive';
8
+ }, {}, {}>;
9
+ export declare const FlagContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
11
+ }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
12
+ export declare const MenuItemContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
13
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
14
+ }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
15
+ export declare const CheckboxStyles: {
16
+ padding: number;
17
+ color: string;
18
+ '&.Mui-checked': {
19
+ color: string;
20
+ };
21
+ '&.MuiCheckbox-root': {
22
+ color: string;
23
+ };
24
+ '& .MuiSvgIcon-root': {
25
+ color: string;
26
+ };
27
+ '&.Mui-checked .MuiSvgIcon-root': {
28
+ color: string;
29
+ '& path': {
30
+ fill: string;
31
+ };
32
+ };
33
+ };
34
+ export declare const ClearIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
35
+ variant: 'active' | 'inActive';
36
+ }, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
37
+ export declare const ChevronIconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
38
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
39
+ }, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme> & {
40
+ isVisible: boolean;
41
+ }, {}, {}>;
@@ -0,0 +1,71 @@
1
+ import { Box, Button } from '@mui/material';
2
+ import { styled } from '@mui/material/styles';
3
+ export { statusButtonVariants, ChevronContainer, Label, LabelWrapper, StyledDropdown, } from '../TableHeader_V2/components/StatusButtons/style';
4
+ const baseButtonStyle = (theme) => (Object.assign(Object.assign({}, theme.typography.subtitle1), { borderRadius: '50px', borderWidth: '1px', borderStyle: 'solid', minWidth: '135.11px', height: '32px', display: 'flex', justifyContent: 'center', alignItems: 'center', gap: '8px', textTransform: 'none', transition: 'background-color 0.5s ease, color 0.3s ease', paddingInline: theme.spacing(2) }));
5
+ export const StyledStatusButton = styled(Button, {
6
+ shouldForwardProp: (prop) => prop !== 'buttonVariant',
7
+ })(({ theme, buttonVariant }) => (Object.assign(Object.assign({}, baseButtonStyle(theme)), (buttonVariant === 'active'
8
+ ? {
9
+ background: theme.palette.background.gradient.shadedBlue,
10
+ color: theme.palette.common.white,
11
+ }
12
+ : {
13
+ backgroundColor: theme.palette.common.white,
14
+ borderColor: theme.palette.grey[100],
15
+ color: theme.palette.text.primary,
16
+ '&:hover': {
17
+ backgroundColor: 'white',
18
+ },
19
+ }))));
20
+ export const FlagContainer = styled(Box)(({ theme }) => ({
21
+ display: 'flex',
22
+ alignItems: 'center',
23
+ gap: theme.spacing(0.5),
24
+ }));
25
+ export const MenuItemContainer = styled(Box)(({ theme }) => ({
26
+ display: 'flex',
27
+ alignItems: 'center',
28
+ gap: theme.spacing(0.3),
29
+ width: '100%',
30
+ }));
31
+ export const CheckboxStyles = {
32
+ padding: 0.3,
33
+ color: '#8C9196',
34
+ '&.Mui-checked': {
35
+ color: '#1F88D0',
36
+ },
37
+ '&.MuiCheckbox-root': {
38
+ color: '#8C9196',
39
+ },
40
+ '& .MuiSvgIcon-root': {
41
+ color: 'inherit',
42
+ },
43
+ '&.Mui-checked .MuiSvgIcon-root': {
44
+ color: '#1F88D0',
45
+ '& path': {
46
+ fill: '#1F88D0',
47
+ },
48
+ },
49
+ };
50
+ export const ClearIcon = styled('img')(({ variant }) => ({
51
+ width: '10px',
52
+ height: '10px',
53
+ filter: variant === 'active' ? 'brightness(0) invert(1)' : 'brightness(0) invert(0)',
54
+ cursor: 'pointer',
55
+ position: 'absolute',
56
+ top: '50%',
57
+ left: '47%',
58
+ transform: 'translate(-50%, -50%)',
59
+ transition: 'opacity 0.2s ease-in-out',
60
+ }));
61
+ export const ChevronIconWrapper = styled(Box, {
62
+ shouldForwardProp: (prop) => prop !== 'isVisible',
63
+ })(({ isVisible }) => ({
64
+ opacity: isVisible ? 1 : 0,
65
+ transition: 'opacity 0.2s ease-in-out',
66
+ display: 'flex',
67
+ alignItems: 'center',
68
+ justifyContent: 'center',
69
+ width: '100%',
70
+ height: '100%',
71
+ }));
@@ -0,0 +1,14 @@
1
+ import { TableHeaderStatus } from '../../types/index.js';
2
+ export interface CurrencyOption {
3
+ code: string;
4
+ name: string;
5
+ flagCode?: string;
6
+ status: TableHeaderStatus;
7
+ }
8
+ export interface MultiSelectStatusButtonProps {
9
+ options: CurrencyOption[];
10
+ selectedValues: TableHeaderStatus[];
11
+ onSelectionChange: (selected: TableHeaderStatus[]) => void;
12
+ label?: string;
13
+ variant?: 'active' | 'inActive';
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -554,9 +554,9 @@ export declare const Icon: import("@emotion/styled").StyledComponent<{
554
554
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
555
555
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
556
556
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
557
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
557
558
  src?: string | undefined;
558
559
  alt?: string | undefined;
559
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
560
560
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
561
561
  useMap?: string | undefined;
562
562
  loading?: "eager" | "lazy" | undefined;
@@ -1,12 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import { AvailableStatus } from '../TableHeader_V2';
3
+ import { CurrencyOption } from '../MultiSelectStatusButton';
3
4
  import { TableHeaderStatus } from '../../types/index.js';
4
5
  interface StatusBarProps {
5
6
  status?: TableHeaderStatus;
6
7
  availableStatuses?: AvailableStatus[];
7
8
  isFilteredIdsShown?: boolean;
8
9
  onStatusChange?: (status: TableHeaderStatus) => void;
10
+ onMultiSelectChange?: (status: TableHeaderStatus[]) => void;
11
+ currencyOptions?: CurrencyOption[];
12
+ selectedCurrencies?: TableHeaderStatus[];
13
+ enableMultiSelectCurrency?: boolean;
9
14
  }
10
- declare function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
15
+ declare function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, onMultiSelectChange, currencyOptions, selectedCurrencies, enableMultiSelectCurrency, }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
11
16
  declare const _default: import("react").MemoExoticComponent<typeof StatusBar>;
12
17
  export default _default;
@@ -1,32 +1,68 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
1
  import { createElement as _createElement } from "react";
3
- import { memo, useCallback } from 'react';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { memo, useCallback, useState, useEffect } from 'react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { StatusButton } from '../TableHeader_V2';
6
- function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status }) {
6
+ import MultiSelectStatusButton from '../MultiSelectStatusButton';
7
+ function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, onMultiSelectChange, currencyOptions, selectedCurrencies = [], enableMultiSelectCurrency = false, }) {
7
8
  const { t } = useTranslation();
8
- const getButtonStatus = useCallback((buttonStatus) => (buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive'), [status, isFilteredIdsShown]);
9
- return (_jsx(_Fragment, { children: availableStatuses === null || availableStatuses === void 0 ? void 0 : availableStatuses.map((s) => {
10
- var _a, _b;
11
- if (!Array.isArray(s.status)) {
12
- return (_createElement(StatusButton, Object.assign({}, s, { key: `status-button-array-${s.status}`, variant: getButtonStatus(s.status), onClick: () => {
13
- if (!Array.isArray(s.status)) {
14
- onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(s.status);
15
- }
16
- } })));
17
- }
18
- const isCurrentStatusDropdown = (_a = s.status) === null || _a === void 0 ? void 0 : _a.includes(status || '');
19
- const variant = isCurrentStatusDropdown ? 'active' : 'inActive';
20
- const statusLabel = isCurrentStatusDropdown ? status : s.status[0];
21
- return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, s, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
22
- onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(buttonStatus);
23
- }, dropdownOptions: s.status.map((stat) => ({
24
- label: t(stat || ''),
25
- onClick: () => {
26
- onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(stat);
27
- },
28
- status: stat,
29
- })) })) }, (_b = s === null || s === void 0 ? void 0 : s.status) === null || _b === void 0 ? void 0 : _b[0]));
30
- }) }));
9
+ const [multiSelectValues, setMultiSelectValues] = useState(selectedCurrencies);
10
+ useEffect(() => {
11
+ if (status && multiSelectValues.length > 0) {
12
+ setMultiSelectValues([]);
13
+ }
14
+ }, [status, multiSelectValues.length]);
15
+ useEffect(() => {
16
+ if (!status) {
17
+ setMultiSelectValues(selectedCurrencies);
18
+ }
19
+ }, [selectedCurrencies, status]);
20
+ const getButtonStatus = useCallback((buttonStatus) => {
21
+ if (multiSelectValues.length > 0) {
22
+ return 'inActive';
23
+ }
24
+ return buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive';
25
+ }, [status, isFilteredIdsShown, multiSelectValues.length]);
26
+ const handleMultiSelectChange = useCallback((selected) => {
27
+ setMultiSelectValues(selected);
28
+ onMultiSelectChange === null || onMultiSelectChange === void 0 ? void 0 : onMultiSelectChange(selected);
29
+ if (selected.length > 0) {
30
+ onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange('');
31
+ }
32
+ }, [onMultiSelectChange, onStatusChange]);
33
+ const handleStatusChange = useCallback((newStatus) => {
34
+ if (multiSelectValues.length > 0) {
35
+ setMultiSelectValues([]);
36
+ onMultiSelectChange === null || onMultiSelectChange === void 0 ? void 0 : onMultiSelectChange([]);
37
+ }
38
+ onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(newStatus);
39
+ }, [multiSelectValues.length, onMultiSelectChange, onStatusChange]);
40
+ useEffect(() => {
41
+ if (enableMultiSelectCurrency && multiSelectValues.length === 0 && selectedCurrencies.length === 0 && !status) {
42
+ handleStatusChange('all');
43
+ }
44
+ }, [enableMultiSelectCurrency, multiSelectValues.length, selectedCurrencies.length, status, handleStatusChange]);
45
+ return (_jsxs(_Fragment, { children: [enableMultiSelectCurrency && currencyOptions && (_jsx(MultiSelectStatusButton, { options: currencyOptions, selectedValues: multiSelectValues, onSelectionChange: handleMultiSelectChange, label: t('Currencies') || 'Currencies', variant: multiSelectValues.length > 0 && !status ? 'active' : 'inActive' })), availableStatuses === null || availableStatuses === void 0 ? void 0 : availableStatuses.map((s) => {
46
+ var _a, _b;
47
+ if (!Array.isArray(s.status)) {
48
+ return (_createElement(StatusButton, Object.assign({}, s, { key: `status-button-array-${s.status}`, variant: getButtonStatus(s.status), onClick: () => {
49
+ if (!Array.isArray(s.status)) {
50
+ handleStatusChange(s.status);
51
+ }
52
+ } })));
53
+ }
54
+ const isCurrentStatusDropdown = (_a = s.status) === null || _a === void 0 ? void 0 : _a.includes(status || '');
55
+ const variant = multiSelectValues.length > 0 ? 'inActive' : isCurrentStatusDropdown ? 'active' : 'inActive';
56
+ const statusLabel = isCurrentStatusDropdown ? status : s.status[0];
57
+ return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, s, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
58
+ handleStatusChange(buttonStatus);
59
+ }, dropdownOptions: s.status.map((stat) => ({
60
+ label: t(stat || ''),
61
+ onClick: () => {
62
+ handleStatusChange(stat);
63
+ },
64
+ status: stat,
65
+ })) })) }, (_b = s === null || s === void 0 ? void 0 : s.status) === null || _b === void 0 ? void 0 : _b[0]));
66
+ })] }));
31
67
  }
32
68
  export default memo(StatusBar);
@@ -269,9 +269,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
269
269
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
270
270
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
271
271
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
272
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
272
273
  src?: string | undefined;
273
274
  alt?: string | undefined;
274
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
275
275
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
276
276
  useMap?: string | undefined;
277
277
  loading?: "eager" | "lazy" | undefined;
@@ -273,9 +273,9 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
273
273
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
274
274
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
275
275
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
276
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
276
277
  src?: string | undefined;
277
278
  alt?: string | undefined;
278
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
279
279
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
280
280
  useMap?: string | undefined;
281
281
  loading?: "eager" | "lazy" | undefined;
@@ -262,9 +262,9 @@ export declare const MultiRefundIcon: import("@emotion/styled").StyledComponent<
262
262
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
263
263
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
264
264
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
265
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
265
266
  src?: string | undefined;
266
267
  alt?: string | undefined;
267
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
268
268
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
269
269
  useMap?: string | undefined;
270
270
  loading?: "eager" | "lazy" | undefined;
@@ -1,2 +1,2 @@
1
1
  import { ChevronIconProps } from './type';
2
- export declare function ChevronIcon({ isActive }: ChevronIconProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChevronIcon({ isActive, disableHover }: ChevronIconProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { useTheme } from '@mui/material';
4
- export function ChevronIcon({ isActive }) {
4
+ export function ChevronIcon({ isActive, disableHover }) {
5
5
  const [isHovered, setIsHovered] = useState(false);
6
6
  const theme = useTheme();
7
7
  const handleMouseEnter = () => {
8
- setIsHovered(true);
8
+ if (!disableHover) {
9
+ setIsHovered(true);
10
+ }
9
11
  };
10
12
  const handleMouseLeave = () => {
11
13
  setIsHovered(false);
@@ -58,6 +58,7 @@ export const ChevronContainer = styled('span')(() => ({
58
58
  right: '0',
59
59
  bottom: '0',
60
60
  overflow: 'hidden',
61
+ transition: 'opacity 1s ease',
61
62
  }));
62
63
  export const Label = styled(Box)(({ variant }) => ({
63
64
  display: 'flex',
@@ -15,8 +15,11 @@ export interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'childr
15
15
  dropdownOptions?: Array<MenuItemI & {
16
16
  status: TableHeaderStatus;
17
17
  }>;
18
+ render?: (status: TableHeaderStatus) => ReactNode;
19
+ onMultiSelectChange?: (status: TableHeaderStatus[]) => void;
18
20
  }
19
21
  export interface ChevronIconProps {
20
22
  isActive?: boolean;
23
+ disableHover?: boolean;
21
24
  }
22
25
  export type StatusButtonIcon = keyof typeof statusButtonIcons;
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useMemo, useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import Box from '@mui/material/Box';
4
4
  import Collapse from '@mui/material/Collapse';
5
5
  import lodashValues from 'lodash/values';
@@ -23,38 +23,25 @@ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOn
23
23
  const onClickClear = () => {
24
24
  setValues(options.reduce((acc, { apiKey }) => (Object.assign(Object.assign({}, acc), { [apiKey]: '' })), {}));
25
25
  };
26
+ const isInputHasValue = (key) => values[key] !== undefined && values[key].length > 0;
26
27
  const getInputValue = (key) => (values[key] !== undefined && values[key].length ? values[key] : '');
27
- const showClearButton = useMemo(() => lodashValues(values).some((x) => Boolean(x)), [values]);
28
- const getFilterByApiKey = useCallback((key) => {
29
- return options === null || options === void 0 ? void 0 : options.find((option) => option.apiKey === key);
30
- }, [options]);
31
- const isAnyInputWithValue = (group) => Object.entries(values).some(([inputKey, val]) => { var _a; return Boolean(val) && (((_a = getFilterByApiKey(inputKey)) === null || _a === void 0 ? void 0 : _a.filterGroup) !== group || !group); });
32
- return (_jsxs(Wrapper, Object.assign({ component: "article", "data-testid": "ColumnFilterInputs" }, { children: [_jsx(Text, Object.assign({ component: "header", "data-testid": "ColumnFilterInputs_title" }, { children: t('filterBy') })), _jsx(InputsWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_inputs", component: "main" }, { children: options.map(({ placeholder, apiKey, isDisabled, filterGroup, render }) => {
33
- const inputValue = getInputValue(apiKey);
34
- return (_jsx(ColumnFilterInput, { apiKey: apiKey, isOnlyOneFilter: isOnlyOneFilter, setValues: setValues, options: options, value: inputValue, render: render, placeholder: placeholder, isDisabled: isDisabled, filterGroup: filterGroup, isAnyInputWithValue: isAnyInputWithValue(filterGroup) }, apiKey));
35
- }) })), _jsx(Collapse, Object.assign({ in: showClearButton, component: "section", "data-testid": "ColumnFilterInputs_Collapse" }, { children: _jsx(ClearWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_ClearWrapper" }, { children: _jsx(ClearButton, Object.assign({ type: "button", onClick: onClickClear, "data-testid": "ColumnFilterInputs_ClearButton" }, { children: t('clear') })) })) })), _jsxs(Footer, Object.assign({ component: "footer", "data-testid": "ColumnFilterInputs_footer" }, { children: [_jsx(CancelButton, Object.assign({ type: "button", onClick: onClickCancel, "data-testid": "ColumnFilterInputs_CancelButton" }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ type: "button", onClick: onClickOkay, "data-testid": "ColumnFilterInputs_OkayButton" }, { children: t('okay') }))] }))] })));
36
- }
37
- function ColumnFilterInput({ apiKey, isOnlyOneFilter, setValues, value, render, placeholder, isDisabled, isAnyInputWithValue, }) {
38
- const [anchorEl, setAnchorEl] = useState(null);
39
- const isInputHasValue = useMemo(() => value !== undefined && value.length > 0, [value]);
40
28
  const onClickResetInput = (key) => {
41
- if (isInputHasValue)
42
- setValues((prev) => (Object.assign(Object.assign({}, prev), { [key]: '' })));
29
+ if (isInputHasValue(key))
30
+ setValues(Object.assign(Object.assign({}, values), { [key]: '' }));
43
31
  };
44
- const isInputDisabled = useMemo(() => {
45
- const inputWithValue = value !== undefined && value !== '' && value !== null;
32
+ const showClearButton = useMemo(() => lodashValues(values).some((x) => Boolean(x)), [values]);
33
+ const getFilterByApiKey = useCallback((apiKey) => {
34
+ return options.find((option) => option.apiKey === apiKey);
35
+ }, [options]);
36
+ const isInputDisabled = useCallback((key, filterGroup) => {
37
+ const inputWithValue = (values === null || values === void 0 ? void 0 : values[key]) !== undefined && (values === null || values === void 0 ? void 0 : values[key]) !== '' && (values === null || values === void 0 ? void 0 : values[key]) !== null;
38
+ const isAnyInputWithValue = Object.entries(values).some(([inputKey, val]) => { var _a; return Boolean(val) && (((_a = getFilterByApiKey(inputKey)) === null || _a === void 0 ? void 0 : _a.filterGroup) !== filterGroup || !filterGroup); });
46
39
  return isOnlyOneFilter && !inputWithValue && isAnyInputWithValue;
47
- }, [value, isOnlyOneFilter, isAnyInputWithValue]);
48
- if (render) {
49
- return (_jsx(_Fragment, { children: render({
50
- anchorEl,
51
- setAnchorEl,
52
- }) }));
53
- }
54
- return (_jsx(InputStyled, { className: "input", "data-testid": "ColumnFilterInputs_InputStyled", name: apiKey, placeholder: placeholder, onChange: (e) => {
55
- setValues((prev) => (Object.assign(Object.assign({}, prev), { [apiKey]: e.target.value })));
56
- }, disabled: isDisabled || isInputDisabled, value: value, inputProps: { autoComplete: 'off', 'data-testid': 'ColumnFilterInputs_input' }, endAdornment: _jsx(Box, { component: "img", "data-testid": "ColumnFilterInputs_icon", "data-icon": isInputHasValue ? 'close' : 'search', src: isInputHasValue ? grayCloseIcon : searchIcon, alt: "search", className: "icon", sx: { cursor: isInputHasValue ? 'pointer' : 'default' }, onClick: () => {
57
- onClickResetInput(apiKey);
58
- } }) }));
40
+ }, [options, values, isOnlyOneFilter]);
41
+ return (_jsxs(Wrapper, Object.assign({ component: "article", "data-testid": "ColumnFilterInputs" }, { children: [_jsx(Text, Object.assign({ component: "header", "data-testid": "ColumnFilterInputs_title" }, { children: t('filterBy') })), _jsx(InputsWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_inputs", component: "main" }, { children: options.map(({ placeholder, apiKey, isDisabled, filterGroup, render }) => (_jsx(Fragment, { children: render ? (render()) : (_jsx(InputStyled, { className: "input", "data-testid": "ColumnFilterInputs_InputStyled", name: apiKey, placeholder: placeholder, onChange: (e) => {
42
+ setValues(Object.assign(Object.assign({}, values), { [apiKey]: e.target.value }));
43
+ }, disabled: isDisabled || isInputDisabled(apiKey, filterGroup), value: getInputValue(apiKey), inputProps: { autoComplete: 'off', 'data-testid': 'ColumnFilterInputs_input' }, endAdornment: _jsx(Box, { component: "img", "data-testid": "ColumnFilterInputs_icon", "data-icon": isInputHasValue(apiKey) ? 'close' : 'search', src: isInputHasValue(apiKey) ? grayCloseIcon : searchIcon, alt: "search", className: "icon", sx: { cursor: isInputHasValue(apiKey) ? 'pointer' : 'default' }, onClick: () => {
44
+ onClickResetInput(apiKey);
45
+ } }) })) }, apiKey))) })), _jsx(Collapse, Object.assign({ in: showClearButton, component: "section", "data-testid": "ColumnFilterInputs_Collapse" }, { children: _jsx(ClearWrapper, Object.assign({ "data-testid": "ColumnFilterInputs_ClearWrapper" }, { children: _jsx(ClearButton, Object.assign({ type: "button", onClick: onClickClear, "data-testid": "ColumnFilterInputs_ClearButton" }, { children: t('clear') })) })) })), _jsxs(Footer, Object.assign({ component: "footer", "data-testid": "ColumnFilterInputs_footer" }, { children: [_jsx(CancelButton, Object.assign({ type: "button", onClick: onClickCancel, "data-testid": "ColumnFilterInputs_CancelButton" }, { children: t('cancel') })), _jsx(OkayButton, Object.assign({ type: "button", onClick: onClickOkay, "data-testid": "ColumnFilterInputs_OkayButton" }, { children: t('okay') }))] }))] })));
59
46
  }
60
47
  export default Inputs;
@@ -306,9 +306,9 @@ export declare const ActionIcon: import("@emotion/styled").StyledComponent<{
306
306
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLImageElement> | undefined;
307
307
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
308
308
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLImageElement> | undefined;
309
+ referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
309
310
  src?: string | undefined;
310
311
  alt?: string | undefined;
311
- referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
312
312
  crossOrigin?: "" | "anonymous" | "use-credentials" | undefined;
313
313
  useMap?: string | undefined;
314
314
  loading?: "eager" | "lazy" | undefined;
@@ -86,6 +86,7 @@ export { default as FlagDetails } from './FlagDetails';
86
86
  export { default as TapLoader } from './Loaders';
87
87
  export { default as Error } from './Error';
88
88
  export { default as StatusBar } from './StatusBar';
89
+ export { default as MultiSelectStatusButton, type CurrencyOption, type MultiSelectStatusButtonProps } from './MultiSelectStatusButton';
89
90
  export * from './Chip';
90
91
  export * from './TableHeader_V2';
91
92
  export { default as RangeCalender } from './RangeCalender';
@@ -86,6 +86,7 @@ export { default as FlagDetails } from './FlagDetails';
86
86
  export { default as TapLoader } from './Loaders';
87
87
  export { default as Error } from './Error';
88
88
  export { default as StatusBar } from './StatusBar';
89
+ export { default as MultiSelectStatusButton } from './MultiSelectStatusButton';
89
90
  export * from './Chip';
90
91
  export * from './TableHeader_V2';
91
92
  export { default as RangeCalender } from './RangeCalender';
@@ -70,7 +70,7 @@ export interface IColumnFilterOption {
70
70
  options?: IColumnFilterOption[];
71
71
  isDisabled?: boolean;
72
72
  filterGroup?: string;
73
- render?: (v: any) => React.ReactNode;
73
+ render?: () => React.ReactNode;
74
74
  }
75
75
  export type IColumnListFilterOption = Omit<IColumnFilterOption, 'apiKey' | 'options'> & {
76
76
  value: string;
package/package.json CHANGED
@@ -1,132 +1,132 @@
1
- {
2
- "name": "@tap-payments/os-micro-frontend-shared",
3
- "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.0.97",
5
- "type": "module",
6
- "main": "build/index.js",
7
- "module": "build/index.js",
8
- "types": "build/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./build/index.d.ts",
12
- "import": "./build/index.js",
13
- "require": "./build/index.js"
14
- },
15
- "./constants": {
16
- "types": "./build/constants/index.d.ts",
17
- "import": "./build/constants/index.js",
18
- "require": "./build/constants/index.js"
19
- },
20
- "./components": {
21
- "types": "./build/components/index.d.ts",
22
- "import": "./build/components/index.js",
23
- "require": "./build/components/index.js"
24
- },
25
- "./components/*": {
26
- "types": "./build/components/*/index.d.ts",
27
- "import": "./build/components/*/index.js",
28
- "require": "./build/components/*/index.js"
29
- },
30
- "./hooks": {
31
- "types": "./build/hooks/index.d.ts",
32
- "import": "./build/hooks/index.js",
33
- "require": "./build/hooks/index.js"
34
- },
35
- "./utils": {
36
- "types": "./build/utils/index.d.ts",
37
- "import": "./build/utils/index.js",
38
- "require": "./build/utils/index.js"
39
- },
40
- "./theme": {
41
- "types": "./build/theme/index.d.ts",
42
- "import": "./build/theme/index.js",
43
- "require": "./build/theme/index.js"
44
- },
45
- "./types": {
46
- "types": "./build/types/index.d.ts",
47
- "import": "./build/types/index.js",
48
- "require": "./build/types/index.js"
49
- }
50
- },
51
- "license": "MIT",
52
- "author": {
53
- "name": "Ahmed Sharkawy",
54
- "email": "a.elsharkawy@tap.company"
55
- },
56
- "files": [
57
- "build",
58
- "readme.md"
59
- ],
60
- "scripts": {
61
- "ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
62
- "push": "npm version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
63
- "dev": "vite",
64
- "build": "tsc -b && vite build ",
65
- "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
66
- "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
67
- "lint": "eslint . --color",
68
- "lint:fix": "eslint src --fix --color",
69
- "preview": "vite preview",
70
- "prepare": "husky"
71
- },
72
- "dependencies": {
73
- "@emotion/react": "^11.11.0",
74
- "@emotion/styled": "^11.11.0",
75
- "@hookform/resolvers": "^3.3.1",
76
- "@mui/material": "^5.12.3",
77
- "@uiw/react-json-view": "^2.0.0-alpha.16",
78
- "axios": "^1.4.0",
79
- "dayjs": "^1.11.8",
80
- "framer-motion": "10.11.0",
81
- "i18next": "^22.4.15",
82
- "memoize-one": "^6.0.0",
83
- "re-resizable": "^6.9.9",
84
- "react": "^18.2.0",
85
- "react-currency-input-field": "^3.6.11",
86
- "react-dom": "^18.2.0",
87
- "react-draggable": "^4.4.6",
88
- "react-dropzone": "^14.2.3",
89
- "react-hook-form": "^7.45.4",
90
- "react-hot-toast": "^2.4.1",
91
- "react-i18next": "^12.2.2",
92
- "react-multi-date-picker": "^4.1.2",
93
- "react-router-dom": "^6.14.2",
94
- "react-virtualized-auto-sizer": "^1.0.20",
95
- "react-window": "^1.8.9",
96
- "react-window-infinite-loader": "^1.0.9",
97
- "react18-input-otp": "^1.1.4",
98
- "recharts": "^2.15.1"
99
- },
100
- "devDependencies": {
101
- "@eslint/js": "^9.17.0",
102
- "@testing-library/jest-dom": "^5.16.5",
103
- "@types/lodash": "^4.17.15",
104
- "@types/react": "^18.2.6",
105
- "@types/react-dom": "^18.3.5",
106
- "@types/react-virtualized-auto-sizer": "^1.0.8",
107
- "@types/react-window": "^1.8.5",
108
- "@types/react-window-infinite-loader": "^1.0.6",
109
- "@vitejs/plugin-react": "^4.3.4",
110
- "eslint": "^9.17.0",
111
- "eslint-plugin-react-hooks": "^5.0.0",
112
- "eslint-plugin-react-refresh": "^0.4.16",
113
- "globals": "^15.14.0",
114
- "husky": "^8.0.3",
115
- "lint-staged": "^13.2.2",
116
- "prettier": "^2.8.8",
117
- "tsc-alias": "^1.8.16",
118
- "typescript": "5.0.2",
119
- "typescript-eslint": "^8.18.2",
120
- "vite": "6.0.5",
121
- "vite-tsconfig-paths": "^4.2.0"
122
- },
123
- "lint-staged": {
124
- "src/**/*.{ts,tsx,json,js,jsx}": [
125
- "yarn run prettier:fix",
126
- "yarn run lint"
127
- ]
128
- },
129
- "publishConfig": {
130
- "registry": "https://registry.npmjs.org/"
131
- }
132
- }
1
+ {
2
+ "name": "@tap-payments/os-micro-frontend-shared",
3
+ "description": "Shared components and utilities for Tap Payments micro frontends",
4
+ "version": "0.0.99",
5
+ "type": "module",
6
+ "main": "build/index.js",
7
+ "module": "build/index.js",
8
+ "types": "build/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./build/index.d.ts",
12
+ "import": "./build/index.js",
13
+ "require": "./build/index.js"
14
+ },
15
+ "./constants": {
16
+ "types": "./build/constants/index.d.ts",
17
+ "import": "./build/constants/index.js",
18
+ "require": "./build/constants/index.js"
19
+ },
20
+ "./components": {
21
+ "types": "./build/components/index.d.ts",
22
+ "import": "./build/components/index.js",
23
+ "require": "./build/components/index.js"
24
+ },
25
+ "./components/*": {
26
+ "types": "./build/components/*/index.d.ts",
27
+ "import": "./build/components/*/index.js",
28
+ "require": "./build/components/*/index.js"
29
+ },
30
+ "./hooks": {
31
+ "types": "./build/hooks/index.d.ts",
32
+ "import": "./build/hooks/index.js",
33
+ "require": "./build/hooks/index.js"
34
+ },
35
+ "./utils": {
36
+ "types": "./build/utils/index.d.ts",
37
+ "import": "./build/utils/index.js",
38
+ "require": "./build/utils/index.js"
39
+ },
40
+ "./theme": {
41
+ "types": "./build/theme/index.d.ts",
42
+ "import": "./build/theme/index.js",
43
+ "require": "./build/theme/index.js"
44
+ },
45
+ "./types": {
46
+ "types": "./build/types/index.d.ts",
47
+ "import": "./build/types/index.js",
48
+ "require": "./build/types/index.js"
49
+ }
50
+ },
51
+ "license": "MIT",
52
+ "author": {
53
+ "name": "Ahmed Sharkawy",
54
+ "email": "a.elsharkawy@tap.company"
55
+ },
56
+ "files": [
57
+ "build",
58
+ "readme.md"
59
+ ],
60
+ "scripts": {
61
+ "ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
62
+ "push": "npm version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
63
+ "dev": "vite",
64
+ "build": "tsc -b && vite build ",
65
+ "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
66
+ "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
67
+ "lint": "eslint . --color",
68
+ "lint:fix": "eslint src --fix --color",
69
+ "preview": "vite preview",
70
+ "prepare": "husky"
71
+ },
72
+ "dependencies": {
73
+ "@emotion/react": "^11.11.0",
74
+ "@emotion/styled": "^11.11.0",
75
+ "@hookform/resolvers": "^3.3.1",
76
+ "@mui/material": "^5.12.3",
77
+ "@uiw/react-json-view": "^2.0.0-alpha.16",
78
+ "axios": "^1.4.0",
79
+ "dayjs": "^1.11.8",
80
+ "framer-motion": "10.11.0",
81
+ "i18next": "^22.4.15",
82
+ "memoize-one": "^6.0.0",
83
+ "re-resizable": "^6.9.9",
84
+ "react": "^18.2.0",
85
+ "react-currency-input-field": "^3.6.11",
86
+ "react-dom": "^18.2.0",
87
+ "react-draggable": "^4.4.6",
88
+ "react-dropzone": "^14.2.3",
89
+ "react-hook-form": "^7.45.4",
90
+ "react-hot-toast": "^2.4.1",
91
+ "react-i18next": "^12.2.2",
92
+ "react-multi-date-picker": "^4.1.2",
93
+ "react-router-dom": "^6.14.2",
94
+ "react-virtualized-auto-sizer": "^1.0.20",
95
+ "react-window": "^1.8.9",
96
+ "react-window-infinite-loader": "^1.0.9",
97
+ "react18-input-otp": "^1.1.4",
98
+ "recharts": "^2.15.1"
99
+ },
100
+ "devDependencies": {
101
+ "@eslint/js": "^9.17.0",
102
+ "@testing-library/jest-dom": "^5.16.5",
103
+ "@types/lodash": "^4.17.15",
104
+ "@types/react": "^18.2.6",
105
+ "@types/react-dom": "^18.3.5",
106
+ "@types/react-virtualized-auto-sizer": "^1.0.8",
107
+ "@types/react-window": "^1.8.5",
108
+ "@types/react-window-infinite-loader": "^1.0.6",
109
+ "@vitejs/plugin-react": "^4.3.4",
110
+ "eslint": "^9.17.0",
111
+ "eslint-plugin-react-hooks": "^5.0.0",
112
+ "eslint-plugin-react-refresh": "^0.4.16",
113
+ "globals": "^15.14.0",
114
+ "husky": "^8.0.3",
115
+ "lint-staged": "^13.2.2",
116
+ "prettier": "^2.8.8",
117
+ "tsc-alias": "^1.8.16",
118
+ "typescript": "5.0.2",
119
+ "typescript-eslint": "^8.18.2",
120
+ "vite": "6.0.5",
121
+ "vite-tsconfig-paths": "^4.2.0"
122
+ },
123
+ "lint-staged": {
124
+ "src/**/*.{ts,tsx,json,js,jsx}": [
125
+ "yarn run prettier:fix",
126
+ "yarn run lint"
127
+ ]
128
+ },
129
+ "publishConfig": {
130
+ "registry": "https://registry.npmjs.org/"
131
+ }
132
+ }