@tap-payments/os-micro-frontend-shared 0.0.227 → 0.0.228-test.18

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/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, allowShadows, ...props }: IProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function Dropdown({ open, menuItems, anchorEl, onClose, footer, selected, multiple, allowShadows, ...props }: IProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default Dropdown;
@@ -11,33 +11,33 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Divider, Box, useTheme } from '@mui/material';
14
- import { StyledListItemText, StyledMenu, StyledListItemIcon, StyledMenuItem } from './styles';
14
+ import { StyledListItemText, StyledMenu, StyledListItemIcon, StyledMenuItem, CheckboxStyled } from './styles';
15
15
  function Dropdown(_a) {
16
- var { open, menuItems, anchorEl, onClose, selected, allowShadows = true } = _a, props = __rest(_a, ["open", "menuItems", "anchorEl", "onClose", "selected", "allowShadows"]);
16
+ var { open, menuItems, anchorEl, onClose, footer, selected, multiple, allowShadows = true } = _a, props = __rest(_a, ["open", "menuItems", "anchorEl", "onClose", "footer", "selected", "multiple", "allowShadows"]);
17
17
  const theme = useTheme();
18
- return (_jsx(StyledMenu, Object.assign({ open: open, anchorEl: anchorEl, onClose: onClose, onContextMenu: (e) => {
18
+ return (_jsxs(StyledMenu, Object.assign({ open: open, anchorEl: anchorEl, onClose: onClose, onContextMenu: (e) => {
19
19
  e.preventDefault();
20
20
  onClose();
21
- } }, props, { className: "tap-dropdown", minWidth: (anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth) || 'auto' }, { children: menuItems.map((item, idx) => {
22
- if (item.name === 'divider') {
23
- return _jsx(Divider, { sx: { margin: '0 !important' } }, `${item.label}-${idx}`);
24
- }
25
- return (_jsx("div", { children: item.label && (_jsxs(StyledMenuItem, Object.assign({ alwaysShowRightAction: item.alwaysShowRightAction, onClick: (e) => {
26
- if (item.onClick)
27
- item.onClick(e);
28
- }, onContextMenu: item.onRightClick, selected: item.selected, sx: Object.assign({ '&:hover': {
21
+ } }, props, { className: "tap-dropdown", minWidth: (anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.clientWidth) || 'auto' }, { children: [menuItems.map((item, idx) => {
22
+ if (item.name === 'divider') {
23
+ return _jsx(Divider, { sx: { margin: '0 !important' } }, `${item.label}-${idx}`);
24
+ }
25
+ return (_jsx("div", { children: item.label && (_jsxs(StyledMenuItem, Object.assign({ alwaysShowRightAction: item.alwaysShowRightAction, onClick: (e) => {
26
+ if (item.onClick)
27
+ item.onClick(e);
28
+ }, onContextMenu: item.onRightClick, selected: item.selected, sx: Object.assign(Object.assign({ '&:hover': {
29
+ backgroundColor: 'transparent',
30
+ boxShadow: allowShadows ? theme.shadows[10] : 'none',
31
+ '& .sandbox-Icon': {
32
+ display: 'none',
33
+ },
34
+ '& .close-Icon': {
35
+ display: 'block !important',
36
+ },
37
+ } }, (idx === selected && {
29
38
  backgroundColor: 'transparent',
30
39
  boxShadow: allowShadows ? theme.shadows[10] : 'none',
31
- '& .sandbox-Icon': {
32
- display: 'none',
33
- },
34
- '& .close-Icon': {
35
- display: 'block !important',
36
- },
37
- } }, (idx === selected && {
38
- backgroundColor: 'transparent',
39
- boxShadow: allowShadows ? theme.shadows[10] : 'none',
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
- }) })));
40
+ })), item.sx) }, { children: [multiple && _jsx(CheckboxStyled, { size: "small", checked: item.selected }), 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
+ }), footer] })));
42
42
  }
43
43
  export default Dropdown;
@@ -16,3 +16,4 @@ export declare const StyledOption: import("@emotion/styled").StyledComponent<imp
16
16
  export declare const StyledSelectComponent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
17
17
  export declare const StyledMenuTitle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
18
18
  export declare const StyledIconForDropDown: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
19
+ export declare const CheckboxStyled: import("@emotion/styled").StyledComponent<import("@mui/material").CheckboxProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,4 +1,5 @@
1
- import { ListItemText, Menu, MenuItem, styled, ListItemIcon, Select } from '@mui/material';
1
+ import Checkbox from '../Checkbox';
2
+ import { ListItemText, Menu, MenuItem, styled, ListItemIcon, Select, alpha } from '@mui/material';
2
3
  export const StyledMenuItem = styled(MenuItem, {
3
4
  shouldForwardProp: (prop) => prop !== 'alwaysShowRightAction',
4
5
  })(({ theme, alwaysShowRightAction }) => ({
@@ -141,3 +142,17 @@ export const StyledIconForDropDown = styled('img')(() => ({
141
142
  verticalAlign: 'middle',
142
143
  boxSizing: 'border-box',
143
144
  }));
145
+ export const CheckboxStyled = styled(Checkbox)(({ theme }) => ({
146
+ padding: 0,
147
+ paddingRight: '4px',
148
+ width: '14px !important',
149
+ svg: {
150
+ width: '12px !important',
151
+ height: '12px !important',
152
+ },
153
+ '&.Mui-disabled': {
154
+ '[data-testid="IndeterminateCheckBoxIcon"]': {
155
+ fill: alpha(theme.palette.common.black, 0.26),
156
+ },
157
+ },
158
+ }));
@@ -1,4 +1,5 @@
1
1
  import React, { CSSProperties, ReactNode } from 'react';
2
+ import { type SxProps, type Theme } from '@mui/material/styles';
2
3
  export interface MenuItemI {
3
4
  label?: string | null | ReactNode;
4
5
  name?: string;
@@ -9,6 +10,7 @@ export interface MenuItemI {
9
10
  selected?: boolean;
10
11
  rightAction?: ReactNode;
11
12
  alwaysShowRightAction?: boolean;
13
+ sx?: SxProps<Theme>;
12
14
  }
13
15
  export interface IProps {
14
16
  open: boolean;
@@ -18,4 +20,6 @@ export interface IProps {
18
20
  style?: CSSProperties;
19
21
  selected?: number;
20
22
  allowShadows?: boolean;
23
+ multiple?: boolean;
24
+ footer?: React.ReactNode;
21
25
  }
@@ -1,17 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { CurrencyOption } from '../MultiSelectStatusButton';
3
2
  import { TableHeaderStatus } from '../../types/index.js';
4
3
  import { AvailableStatus } from './type';
5
4
  interface StatusBarProps {
6
- status?: TableHeaderStatus;
5
+ status?: TableHeaderStatus | TableHeaderStatus[];
7
6
  availableStatuses?: AvailableStatus[];
8
7
  isFilteredIdsShown?: boolean;
9
- onStatusChange?: (status: TableHeaderStatus) => void;
10
- onMultiSelectChange?: (status: TableHeaderStatus[]) => void;
11
- currencyOptions?: CurrencyOption[];
12
- selectedCurrencies?: TableHeaderStatus[];
13
- enableMultiSelectCurrency?: boolean;
8
+ onStatusChange?: (status: StatusBarProps['status']) => void;
14
9
  }
15
- declare function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, onMultiSelectChange, currencyOptions, selectedCurrencies, enableMultiSelectCurrency, }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
10
+ declare function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
16
11
  declare const _default: import("react").MemoExoticComponent<typeof StatusBar>;
17
12
  export default _default;
@@ -1,68 +1,53 @@
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 { createElement as _createElement } 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';
13
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { Fragment, memo, useCallback, useMemo } from 'react';
4
15
  import { useTranslation } from 'react-i18next';
5
- import MultiSelectStatusButton from '../MultiSelectStatusButton';
6
16
  import StatusButton from '../StatusButton';
7
- function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, onMultiSelectChange, currencyOptions, selectedCurrencies = [], enableMultiSelectCurrency = false, }) {
17
+ function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, }) {
8
18
  const { t } = useTranslation();
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]);
19
+ const isMultiSelection = useMemo(() => Array.isArray(status), [status]);
20
20
  const getButtonStatus = useCallback((buttonStatus) => {
21
- if (multiSelectValues.length > 0) {
22
- return 'inActive';
23
- }
24
21
  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
- })] }));
22
+ }, [status, isFilteredIdsShown]);
23
+ const handleChange = useCallback((selected) => {
24
+ onStatusChange === null || onStatusChange === void 0 ? void 0 : onStatusChange(selected);
25
+ }, [onStatusChange]);
26
+ return (_jsx(_Fragment, { children: availableStatuses === null || availableStatuses === void 0 ? void 0 : availableStatuses.map((_a, index) => {
27
+ var _b, _c;
28
+ var { render } = _a, s = __rest(_a, ["render"]);
29
+ if (render) {
30
+ return _jsx(Fragment, { children: render(status, handleChange) }, `custom-status-slot-${index}`);
31
+ }
32
+ if (!Array.isArray(s.status)) {
33
+ return (_createElement(StatusButton, Object.assign({}, s, { key: `status-button-array-${s.status}`, variant: getButtonStatus(s.status), onClick: () => {
34
+ if (!Array.isArray(s.status)) {
35
+ handleChange(s.status);
36
+ }
37
+ } })));
38
+ }
39
+ const isCurrentStatusDropdown = !isMultiSelection && ((_b = s.status) === null || _b === void 0 ? void 0 : _b.includes(status || ''));
40
+ const variant = isCurrentStatusDropdown ? 'active' : 'inActive';
41
+ const statusLabel = isCurrentStatusDropdown && !isMultiSelection ? status : s.status[0];
42
+ return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, s, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
43
+ handleChange(buttonStatus);
44
+ }, dropdownOptions: s.status.map((stat) => ({
45
+ label: t(stat || ''),
46
+ onClick: () => {
47
+ handleChange(stat);
48
+ },
49
+ status: stat,
50
+ })) })) }, (_c = s === null || s === void 0 ? void 0 : s.status) === null || _c === void 0 ? void 0 : _c[0]));
51
+ }) }));
67
52
  }
68
53
  export default memo(StatusBar);
@@ -1,2 +1,3 @@
1
1
  import StatusBar from './StatusBar';
2
2
  export default StatusBar;
3
+ export { type AvailableStatus } from './type';
@@ -1,5 +1,7 @@
1
+ /// <reference types="react" />
1
2
  import { StatusButtonProps } from '../StatusButton';
2
3
  import { TableHeaderStatus } from '../../types/index.js';
3
4
  export type AvailableStatus<T = undefined> = StatusButtonProps & {
4
5
  status: T | TableHeaderStatus | (TableHeaderStatus | T)[];
6
+ render?: (status: AvailableStatus['status'], onChange: (selected: AvailableStatus['status']) => void) => React.ReactNode;
5
7
  };
@@ -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, onButtonBodyClick } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "onButtonBodyClick"]);
22
+ const { variant = 'inActive', badgeCount, icon, label, dropdownOptions, multiple, onButtonBodyClick, onClose } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "multiple", "onButtonBodyClick", "onClose"]);
23
23
  const [buttonClicks, setButtonClicks] = useState(0);
24
24
  const { t } = useTranslation();
25
25
  const buttonRef = useRef(null);
@@ -44,7 +44,8 @@ const StatusButton = memo((props) => {
44
44
  }, [isActiveVariant]);
45
45
  const handleDropdownClose = useCallback(() => {
46
46
  setAnchorEl(null);
47
- }, []);
47
+ onClose === null || onClose === void 0 ? void 0 : onClose();
48
+ }, [onClose]);
48
49
  const handleDropdownToggle = useCallback(() => {
49
50
  if (!hasDropdown)
50
51
  return;
@@ -61,14 +62,16 @@ const StatusButton = memo((props) => {
61
62
  const handleMenuItemClick = useCallback((item) => (e) => {
62
63
  var _a;
63
64
  (_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
65
+ if (multiple)
66
+ return;
64
67
  setSelectedStatus(item.status);
65
68
  handleDropdownClose();
66
- }, [handleDropdownClose]);
69
+ }, [handleDropdownClose, multiple]);
67
70
  const menuItems = useMemo(() => (dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((item) => (Object.assign(Object.assign({}, item), { onClick: handleMenuItemClick(item) })))) || [], [dropdownOptions, handleMenuItemClick]);
68
71
  const ButtonComponent = statusButtonVariants[variant];
69
72
  const displayLabel = selectedStatus ? t(selectedStatus) : label;
70
73
  return (_jsxs(_Fragment, { children: [_jsx(ButtonComponent, Object.assign({ "data-testid": "StatusButton" }, restProps, { ref: buttonRef, onClick: handleButtonClick, sx: Object.assign({}, (hasDropdown && {
71
74
  paddingInlineEnd: '27px',
72
- })) }, { 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 }))] }));
75
+ })) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, displayLabel, statusBadge] })), dropdownIcon && _jsx(ChevronContainer, { children: dropdownIcon })] }) })), isDropdownOpen && hasDropdown && (_jsx(StyledDropdown, { multiple: multiple, open: isDropdownOpen, onClose: handleDropdownClose, anchorEl: anchorEl, menuItems: menuItems }))] }));
73
76
  });
74
77
  export default StatusButton;
@@ -16,6 +16,8 @@ export interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'childr
16
16
  dropdownOptions?: Array<MenuItemI & {
17
17
  status: TableHeaderStatus;
18
18
  }>;
19
+ multiple?: boolean;
20
+ onClose?: () => void;
19
21
  }
20
22
  export interface ChevronIconProps {
21
23
  isActive?: boolean;
@@ -121,11 +121,11 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
121
121
  const pinnedStartColumnsWidth = useMemo(() => pinnedStartColumnsData.reduce((acc, col) => {
122
122
  const width = typeof col.width === 'string' ? parseInt(col.width) : col.width || 100;
123
123
  return acc + width;
124
- }, 1), [pinnedStartColumnsData]);
124
+ }, 0.2), [pinnedStartColumnsData]);
125
125
  const pinnedEndColumnsWidth = useMemo(() => pinnedEndColumnsData.reduce((acc, col) => {
126
126
  const width = typeof col.width === 'string' ? parseInt(col.width) : col.width || 100;
127
127
  return acc + width;
128
- }, 1), [pinnedEndColumnsData]);
128
+ }, 0.2), [pinnedEndColumnsData]);
129
129
  const renderPinnedColumn = (position, columnsData, columnsWidth, pinnedColumnsList) => {
130
130
  const Wrapper = position === 'start' ? PinnedStartColumnWrapper : PinnedEndColumnWrapper;
131
131
  const containerKey = position === 'start' ? 'pinnedStart' : 'pinnedEnd';
@@ -76,7 +76,7 @@ export { default as CountryFlag } from './CountryFlag';
76
76
  export { default as CurrencyIcon } from './CurrencyIcon';
77
77
  export { default as CustomBackdrop } from './CustomBackdrop';
78
78
  export { default as DeviceIcon } from './DeviceIcon';
79
- export { default as CountBadge, type BadgeVariants, CountAnimatedBadge, type StyledBadgeProps, paymentSourceAnimation } from './CountBadge';
79
+ export { default as CountBadge, BadgeVariants, CountAnimatedBadge, type StyledBadgeProps, paymentSourceAnimation } from './CountBadge';
80
80
  export { default as CircularProgressWithLabel } from './CircularProgressWithLabel';
81
81
  export { default as Collapse, type CollapseProps } from './Collapse';
82
82
  export { default as ConfirmDialog, type ConfirmDialogFunction, type ConfirmDialogProps, useConfirmDialog, ConfirmDialogContext, ConfirmDialogProvider, } from './ConfirmDialog';
@@ -87,7 +87,7 @@ export { default as OTPInput } from './OTPInput';
87
87
  export { default as FlagDetails } from './FlagDetails';
88
88
  export { default as TapLoader } from './Loaders';
89
89
  export { default as Error } from './Error';
90
- export { default as StatusBar } from './StatusBar';
90
+ export { default as StatusBar, type AvailableStatus } from './StatusBar';
91
91
  export { default as MultiSelectStatusButton, type CurrencyOption, type MultiSelectStatusButtonProps } from './MultiSelectStatusButton';
92
92
  export * from './Chip';
93
93
  export * from './StatusGroupChips';
@@ -76,7 +76,7 @@ export { default as CountryFlag } from './CountryFlag';
76
76
  export { default as CurrencyIcon } from './CurrencyIcon';
77
77
  export { default as CustomBackdrop } from './CustomBackdrop';
78
78
  export { default as DeviceIcon } from './DeviceIcon';
79
- export { default as CountBadge, CountAnimatedBadge, paymentSourceAnimation } from './CountBadge';
79
+ export { default as CountBadge, BadgeVariants, CountAnimatedBadge, paymentSourceAnimation } from './CountBadge';
80
80
  export { default as CircularProgressWithLabel } from './CircularProgressWithLabel';
81
81
  export { default as Collapse } from './Collapse';
82
82
  export { default as ConfirmDialog, useConfirmDialog, ConfirmDialogContext, ConfirmDialogProvider, } from './ConfirmDialog';
package/package.json CHANGED
@@ -1,134 +1,134 @@
1
- {
2
- "name": "@tap-payments/os-micro-frontend-shared",
3
- "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.0.227",
5
- "testVersion": 15,
6
- "type": "module",
7
- "main": "build/index.js",
8
- "module": "build/index.js",
9
- "types": "build/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./build/index.d.ts",
13
- "import": "./build/index.js",
14
- "require": "./build/index.js"
15
- },
16
- "./constants": {
17
- "types": "./build/constants/index.d.ts",
18
- "import": "./build/constants/index.js",
19
- "require": "./build/constants/index.js"
20
- },
21
- "./components": {
22
- "types": "./build/components/index.d.ts",
23
- "import": "./build/components/index.js",
24
- "require": "./build/components/index.js"
25
- },
26
- "./components/*": {
27
- "types": "./build/components/*/index.d.ts",
28
- "import": "./build/components/*/index.js",
29
- "require": "./build/components/*/index.js"
30
- },
31
- "./hooks": {
32
- "types": "./build/hooks/index.d.ts",
33
- "import": "./build/hooks/index.js",
34
- "require": "./build/hooks/index.js"
35
- },
36
- "./utils": {
37
- "types": "./build/utils/index.d.ts",
38
- "import": "./build/utils/index.js",
39
- "require": "./build/utils/index.js"
40
- },
41
- "./theme": {
42
- "types": "./build/theme/index.d.ts",
43
- "import": "./build/theme/index.js",
44
- "require": "./build/theme/index.js"
45
- },
46
- "./types": {
47
- "types": "./build/types/index.d.ts",
48
- "import": "./build/types/index.js",
49
- "require": "./build/types/index.js"
50
- }
51
- },
52
- "license": "MIT",
53
- "author": {
54
- "name": "Ahmed Sharkawy",
55
- "email": "a.elsharkawy@tap.company"
56
- },
57
- "files": [
58
- "build",
59
- "readme.md"
60
- ],
61
- "scripts": {
62
- "ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
63
- "push": "npm version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
64
- "push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
65
- "dev": "vite",
66
- "build": "tsc -b && vite build ",
67
- "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
68
- "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
69
- "lint": "eslint . --color",
70
- "lint:fix": "eslint src --fix --color",
71
- "preview": "vite preview",
72
- "prepare": "husky"
73
- },
74
- "dependencies": {
75
- "@emotion/react": "^11.11.0",
76
- "@emotion/styled": "^11.11.0",
77
- "@hookform/resolvers": "^3.3.1",
78
- "@mui/material": "^5.12.3",
79
- "@uiw/react-json-view": "^2.0.0-alpha.16",
80
- "axios": "^1.4.0",
81
- "dayjs": "^1.11.8",
82
- "framer-motion": "10.11.0",
83
- "i18next": "^22.4.15",
84
- "memoize-one": "^6.0.0",
85
- "re-resizable": "^6.9.9",
86
- "react": "^18.2.0",
87
- "react-currency-input-field": "^3.6.11",
88
- "react-dom": "^18.2.0",
89
- "react-draggable": "^4.4.6",
90
- "react-dropzone": "^14.2.3",
91
- "react-hook-form": "^7.45.4",
92
- "react-hot-toast": "^2.4.1",
93
- "react-i18next": "^12.2.2",
94
- "react-multi-date-picker": "^4.1.2",
95
- "react-router-dom": "^7.7.0",
96
- "react-virtualized-auto-sizer": "^1.0.20",
97
- "react-window": "^1.8.9",
98
- "react-window-infinite-loader": "^1.0.9",
99
- "react18-input-otp": "^1.1.4",
100
- "recharts": "^2.15.1"
101
- },
102
- "devDependencies": {
103
- "@eslint/js": "^9.17.0",
104
- "@testing-library/jest-dom": "^5.16.5",
105
- "@types/lodash": "^4.17.15",
106
- "@types/react": "^18.2.6",
107
- "@types/react-dom": "^18.3.5",
108
- "@types/react-virtualized-auto-sizer": "^1.0.8",
109
- "@types/react-window": "^1.8.5",
110
- "@types/react-window-infinite-loader": "^1.0.6",
111
- "@vitejs/plugin-react": "^4.3.4",
112
- "eslint": "^9.17.0",
113
- "eslint-plugin-react-hooks": "^5.0.0",
114
- "eslint-plugin-react-refresh": "^0.4.16",
115
- "globals": "^15.14.0",
116
- "husky": "^8.0.3",
117
- "lint-staged": "^13.2.2",
118
- "prettier": "^2.8.8",
119
- "tsc-alias": "^1.8.16",
120
- "typescript": "5.0.2",
121
- "typescript-eslint": "^8.18.2",
122
- "vite": "6.0.5",
123
- "vite-tsconfig-paths": "^4.2.0"
124
- },
125
- "lint-staged": {
126
- "src/**/*.{ts,tsx,json,js,jsx}": [
127
- "yarn run prettier:fix",
128
- "yarn run lint"
129
- ]
130
- },
131
- "publishConfig": {
132
- "registry": "https://registry.npmjs.org/"
133
- }
134
- }
1
+ {
2
+ "name": "@tap-payments/os-micro-frontend-shared",
3
+ "description": "Shared components and utilities for Tap Payments micro frontends",
4
+ "version": "0.0.228-test.18",
5
+ "testVersion": 18,
6
+ "type": "module",
7
+ "main": "build/index.js",
8
+ "module": "build/index.js",
9
+ "types": "build/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./build/index.d.ts",
13
+ "import": "./build/index.js",
14
+ "require": "./build/index.js"
15
+ },
16
+ "./constants": {
17
+ "types": "./build/constants/index.d.ts",
18
+ "import": "./build/constants/index.js",
19
+ "require": "./build/constants/index.js"
20
+ },
21
+ "./components": {
22
+ "types": "./build/components/index.d.ts",
23
+ "import": "./build/components/index.js",
24
+ "require": "./build/components/index.js"
25
+ },
26
+ "./components/*": {
27
+ "types": "./build/components/*/index.d.ts",
28
+ "import": "./build/components/*/index.js",
29
+ "require": "./build/components/*/index.js"
30
+ },
31
+ "./hooks": {
32
+ "types": "./build/hooks/index.d.ts",
33
+ "import": "./build/hooks/index.js",
34
+ "require": "./build/hooks/index.js"
35
+ },
36
+ "./utils": {
37
+ "types": "./build/utils/index.d.ts",
38
+ "import": "./build/utils/index.js",
39
+ "require": "./build/utils/index.js"
40
+ },
41
+ "./theme": {
42
+ "types": "./build/theme/index.d.ts",
43
+ "import": "./build/theme/index.js",
44
+ "require": "./build/theme/index.js"
45
+ },
46
+ "./types": {
47
+ "types": "./build/types/index.d.ts",
48
+ "import": "./build/types/index.js",
49
+ "require": "./build/types/index.js"
50
+ }
51
+ },
52
+ "license": "MIT",
53
+ "author": {
54
+ "name": "Ahmed Sharkawy",
55
+ "email": "a.elsharkawy@tap.company"
56
+ },
57
+ "files": [
58
+ "build",
59
+ "readme.md"
60
+ ],
61
+ "scripts": {
62
+ "ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
63
+ "push": "npm version patch --no-git-tag-version && npm run ts:build && npm publish --access public",
64
+ "push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
65
+ "dev": "vite",
66
+ "build": "tsc -b && vite build ",
67
+ "prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
68
+ "prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
69
+ "lint": "eslint . --color",
70
+ "lint:fix": "eslint src --fix --color",
71
+ "preview": "vite preview",
72
+ "prepare": "husky"
73
+ },
74
+ "dependencies": {
75
+ "@emotion/react": "^11.11.0",
76
+ "@emotion/styled": "^11.11.0",
77
+ "@hookform/resolvers": "^3.3.1",
78
+ "@mui/material": "^5.12.3",
79
+ "@uiw/react-json-view": "^2.0.0-alpha.16",
80
+ "axios": "^1.4.0",
81
+ "dayjs": "^1.11.8",
82
+ "framer-motion": "10.11.0",
83
+ "i18next": "^22.4.15",
84
+ "memoize-one": "^6.0.0",
85
+ "re-resizable": "^6.9.9",
86
+ "react": "^18.2.0",
87
+ "react-currency-input-field": "^3.6.11",
88
+ "react-dom": "^18.2.0",
89
+ "react-draggable": "^4.4.6",
90
+ "react-dropzone": "^14.2.3",
91
+ "react-hook-form": "^7.45.4",
92
+ "react-hot-toast": "^2.4.1",
93
+ "react-i18next": "^12.2.2",
94
+ "react-multi-date-picker": "^4.1.2",
95
+ "react-router-dom": "^7.7.0",
96
+ "react-virtualized-auto-sizer": "^1.0.20",
97
+ "react-window": "^1.8.9",
98
+ "react-window-infinite-loader": "^1.0.9",
99
+ "react18-input-otp": "^1.1.4",
100
+ "recharts": "^2.15.1"
101
+ },
102
+ "devDependencies": {
103
+ "@eslint/js": "^9.17.0",
104
+ "@testing-library/jest-dom": "^5.16.5",
105
+ "@types/lodash": "^4.17.15",
106
+ "@types/react": "^18.2.6",
107
+ "@types/react-dom": "^18.3.5",
108
+ "@types/react-virtualized-auto-sizer": "^1.0.8",
109
+ "@types/react-window": "^1.8.5",
110
+ "@types/react-window-infinite-loader": "^1.0.6",
111
+ "@vitejs/plugin-react": "^4.3.4",
112
+ "eslint": "^9.17.0",
113
+ "eslint-plugin-react-hooks": "^5.0.0",
114
+ "eslint-plugin-react-refresh": "^0.4.16",
115
+ "globals": "^15.14.0",
116
+ "husky": "^8.0.3",
117
+ "lint-staged": "^13.2.2",
118
+ "prettier": "^2.8.8",
119
+ "tsc-alias": "^1.8.16",
120
+ "typescript": "5.0.2",
121
+ "typescript-eslint": "^8.18.2",
122
+ "vite": "6.0.5",
123
+ "vite-tsconfig-paths": "^4.2.0"
124
+ },
125
+ "lint-staged": {
126
+ "src/**/*.{ts,tsx,json,js,jsx}": [
127
+ "yarn run prettier:fix",
128
+ "yarn run lint"
129
+ ]
130
+ },
131
+ "publishConfig": {
132
+ "registry": "https://registry.npmjs.org/"
133
+ }
134
+ }