@tap-payments/os-micro-frontend-shared 0.1.202 → 0.1.203-test.9

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 (58) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +12 -12
  3. package/build/components/AppServices/ServiceItem.js +4 -6
  4. package/build/components/BetaBanner/BetaBanner.d.ts +1 -0
  5. package/build/components/BetaBanner/BetaBanner.js +5 -0
  6. package/build/components/BetaBanner/index.d.ts +2 -0
  7. package/build/components/BetaBanner/index.js +2 -0
  8. package/build/components/BetaBanner/style.d.ts +6 -0
  9. package/build/components/BetaBanner/style.js +17 -0
  10. package/build/components/Chip/style.d.ts +0 -1
  11. package/build/components/CountBadge/style.d.ts +0 -1
  12. package/build/components/Dialog/style.d.ts +0 -1
  13. package/build/components/FlippingCard/style.d.ts +0 -1
  14. package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
  15. package/build/components/JSONViewer/style.d.ts +0 -1
  16. package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
  17. package/build/components/MultiSelectDropdownButton/MultiSelectDropdownButton.js +1 -1
  18. package/build/components/MultiSelectDropdownButton/components/StatusButton.d.ts +10 -0
  19. package/build/components/MultiSelectDropdownButton/components/StatusButton.js +34 -0
  20. package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
  21. package/build/components/SearchButton/styles.d.ts +0 -1
  22. package/build/components/StatusBar/StatusBar.d.ts +1 -1
  23. package/build/components/StatusBar/StatusBar.js +8 -14
  24. package/build/components/StatusBar/type.js +0 -6
  25. package/build/components/StatusButton/StatusButton.js +3 -5
  26. package/build/components/StatusButton/type.d.ts +1 -0
  27. package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
  28. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
  29. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
  30. package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
  31. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
  32. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
  33. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
  34. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
  35. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
  36. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
  37. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
  38. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
  39. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
  40. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
  41. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
  42. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
  43. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
  44. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
  45. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
  46. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
  47. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
  48. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
  49. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
  50. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
  51. package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +0 -1
  52. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
  53. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
  54. package/build/components/TableCells/CustomCells/style.d.ts +0 -1
  55. package/build/components/VirtualTables/components/style.d.ts +0 -1
  56. package/build/components/index.d.ts +1 -0
  57. package/build/components/index.js +1 -0
  58. package/package.json +3 -3
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,9 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { memo, useState } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
- import { DropdownMenu, Icon } from '../index.js';
5
- import { isInsightService } from '../../utils/index.js';
6
- import { homeIcon, newWindowIcon } from '../../constants/index.js';
4
+ import { DropdownMenu } from '../index.js';
5
+ import { newWindowIcon } from '../../constants/index.js';
7
6
  import { ServiceItemStyled } from './style';
8
7
  function ServiceItem({ isDropdown = false, name, code, activeCode, navigateToMenuItem, onClickServiceItem }) {
9
8
  const [anchorEl, setAnchorEl] = useState(null);
@@ -12,17 +11,16 @@ function ServiceItem({ isDropdown = false, name, code, activeCode, navigateToMen
12
11
  const handleClose = () => {
13
12
  setAnchorEl(null);
14
13
  };
15
- const isHomeService = isInsightService(code);
16
14
  return (_jsxs(_Fragment, { children: [_jsx(ServiceItemStyled, Object.assign({ isDropdown: isDropdown, className: activeCode.toLowerCase() === code.toLowerCase() ? 'active' : '', onClick: (e) => {
17
15
  e.preventDefault();
18
16
  e.stopPropagation();
19
17
  navigateToMenuItem(code);
20
- }, title: isHomeService ? undefined : name, onContextMenu: (event) => {
18
+ }, title: name, onContextMenu: (event) => {
21
19
  event.preventDefault();
22
20
  event.stopPropagation();
23
21
  handleClose();
24
22
  setAnchorEl(event.currentTarget);
25
- } }, { children: isHomeService ? _jsx(Icon, { src: homeIcon }) : name })), _jsx(DropdownMenu, { open: open, anchorEl: anchorEl, onClose: handleClose, menuItems: [
23
+ } }, { children: name })), _jsx(DropdownMenu, { open: open, anchorEl: anchorEl, onClose: handleClose, menuItems: [
26
24
  {
27
25
  label: t('openNewWindow'),
28
26
  name: 'new',
@@ -0,0 +1 @@
1
+ export default function BetaBanner(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { BannerContainer, BoldText, RegularText } from './style';
3
+ export default function BetaBanner() {
4
+ return (_jsxs(BannerContainer, { children: [_jsx(BoldText, { children: "Insights is in beta - " }), _jsx(RegularText, { children: "improvements are ongoing, thanks for your patience." })] }));
5
+ }
@@ -0,0 +1,2 @@
1
+ import BetaBanner from './BetaBanner';
2
+ export default BetaBanner;
@@ -0,0 +1,2 @@
1
+ import BetaBanner from './BetaBanner';
2
+ export default BetaBanner;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const BannerContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
5
+ export declare const BoldText: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
6
+ export declare const RegularText: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -0,0 +1,17 @@
1
+ import Box from '@mui/material/Box';
2
+ import { styled } from '@mui/material/styles';
3
+ export const BannerContainer = styled(Box)(() => ({
4
+ color: '#1F88D0',
5
+ backgroundColor: '#1F88D00D',
6
+ padding: '8px 12px',
7
+ borderRadius: '4px',
8
+ fontSize: '11px',
9
+ display: 'flex',
10
+ alignItems: 'center'
11
+ }));
12
+ export const BoldText = styled('span')(() => ({
13
+ fontWeight: 700
14
+ }));
15
+ export const RegularText = styled('span')(() => ({
16
+ fontWeight: 500
17
+ }));
@@ -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,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const AgreementImageWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DialogWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Wrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  declare const ImageWrapper: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const FOOTER_HEIGHT = 37;
4
3
  export declare const TITLE_BAR_HEIGHT = "32px";
5
4
  export declare const VIEWER_HEIGHT = 545;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import type { SxProps, Theme } from '@mui/material/styles';
4
3
  export declare const CHIP_GAP = 3;
5
4
  export declare const DEFAULT_CHIP_MIN_WIDTH = 24;
@@ -3,7 +3,7 @@ import { memo, useState } from 'react';
3
3
  import { Popper } from '@mui/material';
4
4
  import { ButtonLabel } from './style';
5
5
  import CustomBackdrop from '../CustomBackdrop';
6
- import StatusButton from '../StatusButton';
6
+ import StatusButton from './components/StatusButton';
7
7
  import ListColumnFilter from '../VirtualTables/components/ColumnFilter/List';
8
8
  import { downArrowIcon } from '../../constants/index.js';
9
9
  function MultiSelectDropdownButton({ buttonLabel, onClear, onConfirm, dropdownItems, apiKey, data, styles, buttonDisabled, }) {
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ import { ButtonProps } from '@mui/material';
3
+ import { StatusButtonVariant } from '../../StatusButton/style';
4
+ interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'children'> {
5
+ variant?: StatusButtonVariant;
6
+ badgeCount: number;
7
+ label: ReactNode;
8
+ }
9
+ declare const StatusButton: import("react").MemoExoticComponent<(props: StatusButtonProps) => import("react/jsx-runtime").JSX.Element>;
10
+ export default StatusButton;
@@ -0,0 +1,34 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { memo, useCallback, useMemo, useRef } from 'react';
14
+ import StyledBadge, { BadgeVariants } from '../../CountBadge';
15
+ import { convertToNumber, formatNumber } from '../../../utils/index.js';
16
+ import { Label, LabelWrapper, statusButtonVariants } from '../../StatusButton/style';
17
+ const StatusButton = memo((props) => {
18
+ const { variant = 'inActive', badgeCount, label } = props, restProps = __rest(props, ["variant", "badgeCount", "label"]);
19
+ const buttonRef = useRef(null);
20
+ // Memoized computed values
21
+ const statusBadge = useMemo(() => {
22
+ if (!badgeCount || Number.isNaN(convertToNumber(badgeCount)))
23
+ return null;
24
+ return _jsx(StyledBadge, Object.assign({ variant: BadgeVariants.INACTIVE }, { children: formatNumber(Number(badgeCount)) }));
25
+ }, [badgeCount]);
26
+ const handleButtonClick = useCallback((e) => {
27
+ var _a;
28
+ e.stopPropagation();
29
+ (_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
30
+ }, [props]);
31
+ const ButtonComponent = statusButtonVariants[variant];
32
+ return (_jsx(ButtonComponent, Object.assign({ "data-testid": "MultiSelectStatusButton" }, restProps, { ref: buttonRef, onClick: handleButtonClick }, { children: _jsx(LabelWrapper, { children: _jsxs(Label, Object.assign({ variant: variant }, { children: [label, statusBadge] })) }) })));
33
+ });
34
+ export default StatusButton;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  import type { SxProps, Theme } from '@mui/material/styles';
4
3
  export declare const CHIP_GAP = 3;
5
4
  export declare const CenterIconWrapper: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledInput: import("@emotion/styled").StyledComponent<{
4
3
  width?: string | number | undefined;
5
4
  height?: string | number | undefined;
@@ -6,6 +6,6 @@ interface StatusBarProps<IStatus extends TableHeaderStatus | TableHeaderStatus[]
6
6
  isFilteredIdsShown?: boolean;
7
7
  onStatusChange?: (status?: IStatus) => void;
8
8
  }
9
- declare function StatusBar<IStatus extends TableHeaderStatus | TableHeaderStatus[] = undefined>({ isFilteredIdsShown, onStatusChange, availableStatuses, status, }: StatusBarProps<IStatus>): import("react/jsx-runtime").JSX.Element;
9
+ declare function StatusBar<IStatus extends TableHeaderStatus | TableHeaderStatus[] = undefined>({ isFilteredIdsShown, availableStatuses, status, onStatusChange, }: Readonly<StatusBarProps<IStatus>>): import("react/jsx-runtime").JSX.Element;
10
10
  declare const _default: typeof StatusBar;
11
11
  export default _default;
@@ -11,12 +11,11 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { createElement as _createElement } from "react";
13
13
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
14
- import { Fragment, memo, useCallback, useMemo } from 'react';
14
+ import { Fragment, memo, useCallback } from 'react';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import StatusButton from '../StatusButton';
17
- function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, status, }) {
17
+ function StatusBar({ isFilteredIdsShown, availableStatuses, status, onStatusChange, }) {
18
18
  const { t } = useTranslation();
19
- const isMultiSelection = useMemo(() => Array.isArray(status), [status]);
20
19
  const getButtonStatus = useCallback((buttonStatus) => {
21
20
  return buttonStatus === status && !isFilteredIdsShown ? 'active' : 'inActive';
22
21
  }, [status, isFilteredIdsShown]);
@@ -39,20 +38,15 @@ function StatusBar({ isFilteredIdsShown, onStatusChange, availableStatuses, stat
39
38
  const statusItems = s.status;
40
39
  if (!statusItems)
41
40
  return null;
42
- const formattedStatuses = (statusItems.filter(Boolean).map((item) => (typeof item === 'string' ? { value: item } : item)) ||
43
- []);
44
- const isCurrentStatusDropdown = !isMultiSelection && !!status && formattedStatuses.some((item) => (item === null || item === void 0 ? void 0 : item.value) === status);
45
- const variant = isCurrentStatusDropdown ? 'active' : 'inActive';
46
- const statusLabel = isCurrentStatusDropdown && !isMultiSelection ? status : (_b = formattedStatuses[0]) === null || _b === void 0 ? void 0 : _b.value;
47
- return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, s, { label: t(statusLabel || ''), variant: variant, onButtonBodyClick: (buttonStatus) => {
48
- handleStatusChange(buttonStatus);
49
- }, dropdownOptions: formattedStatuses.map((stat) => ({
41
+ const formattedStatuses = statusItems.filter(Boolean).map((item) => (typeof item === 'string' ? { value: item } : item)) || [];
42
+ const hasMatchingDropdownStatus = !!status && formattedStatuses.some((item) => (item === null || item === void 0 ? void 0 : item.value) === status);
43
+ const variant = hasMatchingDropdownStatus ? 'active' : 'inActive';
44
+ const selectedStatus = hasMatchingDropdownStatus ? status : (_b = formattedStatuses[0]) === null || _b === void 0 ? void 0 : _b.value;
45
+ return (_jsx("div", { children: _jsx(StatusButton, Object.assign({}, s, { selectedStatus: selectedStatus, variant: variant, onButtonBodyClick: (buttonStatus) => handleStatusChange(buttonStatus), dropdownOptions: formattedStatuses.map((stat) => ({
50
46
  label: t((stat === null || stat === void 0 ? void 0 : stat.value) || ''),
51
- onClick: () => {
52
- handleStatusChange(stat.value);
53
- },
54
47
  status: stat === null || stat === void 0 ? void 0 : stat.value,
55
48
  icon: stat.icon,
49
+ onClick: () => handleStatusChange(stat.value),
56
50
  })) })) }, (_c = formattedStatuses[0]) === null || _c === void 0 ? void 0 : _c.value));
57
51
  }) }));
58
52
  }
@@ -1,7 +1 @@
1
- const test = [
2
- {
3
- status: [{ value: 'ACTIVE' }, { value: 'ACTIVE', icon: '' }],
4
- },
5
- ];
6
- console.log(test);
7
1
  export {};
@@ -19,12 +19,12 @@ 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, iconMapper = statusButtonIcons } = props, restProps = __rest(props, ["variant", "badgeCount", "icon", "label", "dropdownOptions", "onButtonBodyClick", "iconMapper"]);
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"]);
23
23
  const [buttonClicks, setButtonClicks] = useState(0);
24
24
  const { t } = useTranslation();
25
25
  const buttonRef = useRef(null);
26
26
  const [anchorEl, setAnchorEl] = useState(null);
27
- const [selectedStatus, setSelectedStatus] = useState((_a = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _a === void 0 ? void 0 : _a.status);
27
+ const [selectedStatus, setSelectedStatus] = useState(initialStatus !== null && initialStatus !== void 0 ? initialStatus : (_a = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _a === void 0 ? void 0 : _a.status);
28
28
  // Memoized computed values
29
29
  const hasDropdown = useMemo(() => Boolean(dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.length), [dropdownOptions]);
30
30
  // only open if button is clicked more than once
@@ -75,8 +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 && {
79
- paddingInlineEnd: '27px',
80
- })) }, { 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({}, (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 }))] }));
81
79
  });
82
80
  export default StatusButton;
@@ -12,6 +12,7 @@ export interface StatusButtonProps extends Omit<ButtonProps, 'variant' | 'childr
12
12
  label?: ReactNode | null;
13
13
  showDropdownIcon?: boolean;
14
14
  totalCount?: number;
15
+ selectedStatus?: TableHeaderStatus;
15
16
  onButtonBodyClick?: (status: TableHeaderStatus) => void;
16
17
  /**
17
18
  * @description
@@ -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 BalanceCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const ErrorCodeLabel: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | 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
  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 UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const BalanceCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | 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 DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const DueDateCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const ProductCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | 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 ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const RefundChargeCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const RefundCellContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | 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 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 MultiRefundIcon: import("@emotion/styled").StyledComponent<{
4
3
  width?: string | number | undefined;
5
4
  height?: string | number | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  id?: string | undefined;
@@ -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>, {}>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  interface TableWrapperProps {
4
3
  showNoDataView?: boolean;
5
4
  }
@@ -120,3 +120,4 @@ export * from './AppServicesBar';
120
120
  export { default as ListLayout } from './ListLayout';
121
121
  export * from './ListLayout';
122
122
  export { default as MFWidgetLoader } from './MFWidgetLoader';
123
+ export { default as BetaBanner } from './BetaBanner';
@@ -120,3 +120,4 @@ export * from './AppServicesBar';
120
120
  export { default as ListLayout } from './ListLayout';
121
121
  export * from './ListLayout';
122
122
  export { default as MFWidgetLoader } from './MFWidgetLoader';
123
+ export { default as BetaBanner } from './BetaBanner';
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.202",
5
- "testVersion": 8,
4
+ "version": "0.1.203-test.9",
5
+ "testVersion": 9,
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
+ }