@tap-payments/os-micro-frontend-shared 0.1.368 → 0.1.369-test.4

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 (75) hide show
  1. package/build/components/AnimatedSpinnerIcon/style.d.ts +0 -1
  2. package/build/components/AppWindowWrapper/AppWindow/AppWindow.d.ts +1 -1
  3. package/build/components/AppWindowWrapper/AppWindow/AppWindow.js +2 -2
  4. package/build/components/AppWindowWrapper/AppWindow/type.d.ts +2 -0
  5. package/build/components/AppWindowWrapper/headers/AccountHeader/AccountHeader.d.ts +1 -1
  6. package/build/components/AppWindowWrapper/headers/AccountHeader/AccountHeader.js +2 -2
  7. package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/AccountHeaderTitle.d.ts +1 -1
  8. package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/AccountHeaderTitle.js +2 -2
  9. package/build/components/AppWindowWrapper/headers/AccountHeader/components/AccountHeaderTitle/type.d.ts +3 -2
  10. package/build/components/AppWindowWrapper/headers/AccountHeader/type.d.ts +2 -1
  11. package/build/components/Chip/style.d.ts +0 -1
  12. package/build/components/CountBadge/style.d.ts +0 -1
  13. package/build/components/Dialog/style.d.ts +0 -1
  14. package/build/components/FlippingCard/style.d.ts +0 -1
  15. package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
  16. package/build/components/JSONViewer/style.d.ts +0 -1
  17. package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
  18. package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
  19. package/build/components/SearchButton/styles.d.ts +0 -1
  20. package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
  21. package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
  22. package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
  23. package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
  24. package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
  25. package/build/components/TableCells/CustomCells/AgreementCell/style.d.ts +0 -1
  26. package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
  27. package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
  28. package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
  29. package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
  30. package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
  31. package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
  32. package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
  33. package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
  34. package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
  35. package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
  36. package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
  37. package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
  38. package/build/components/TableCells/CustomCells/PayoutReportCell/style.d.ts +0 -1
  39. package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
  40. package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
  41. package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
  42. package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
  43. package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +0 -1
  44. package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
  45. package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
  46. package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
  47. package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
  48. package/build/components/TableCells/CustomCells/style.d.ts +0 -1
  49. package/build/components/TableReports/components/DownloadButton/style.d.ts +0 -1
  50. package/build/components/TableReports/style.d.ts +0 -1
  51. package/build/components/Toaster/Toaster.d.ts +1 -0
  52. package/build/components/Toaster/Toaster.js +12 -0
  53. package/build/components/Toaster/index.d.ts +2 -0
  54. package/build/components/Toaster/index.js +2 -0
  55. package/build/components/Toolbar/Toolbar.js +1 -1
  56. package/build/components/VirtualTables/components/style.d.ts +0 -1
  57. package/build/components/index.d.ts +1 -1
  58. package/build/components/index.js +1 -1
  59. package/build/hooks/index.d.ts +1 -0
  60. package/build/hooks/index.js +1 -0
  61. package/build/hooks/useToast.d.ts +12 -0
  62. package/build/hooks/useToast.js +29 -0
  63. package/build/types/appEvents.d.ts +3 -1
  64. package/build/types/appEvents.js +1 -0
  65. package/build/types/index.d.ts +1 -0
  66. package/build/types/index.js +1 -0
  67. package/build/types/toast.d.ts +16 -0
  68. package/build/types/toast.js +1 -0
  69. package/package.json +3 -3
  70. package/build/components/Notifications/Notifications.d.ts +0 -1
  71. package/build/components/Notifications/Notifications.js +0 -12
  72. package/build/components/Notifications/index.d.ts +0 -2
  73. package/build/components/Notifications/index.js +0 -2
  74. /package/build/components/{Notifications → Toaster}/style.d.ts +0 -0
  75. /package/build/components/{Notifications → Toaster}/style.js +0 -0
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  type AnimatedSpinnerIconProps = {
4
3
  width?: string;
5
4
  height?: string;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { WindowProps } from './type';
3
- declare function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton }: WindowProps): import("react").ReactPortal;
3
+ declare function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton, rightActions }: WindowProps): import("react").ReactPortal;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof Window>;
5
5
  export default _default;
@@ -9,7 +9,7 @@ import { AppWindowContext } from '../context';
9
9
  import { isSafariBrowser } from '../../../utils/index.js';
10
10
  import { animationDuration } from './constant';
11
11
  import AccountHeader from '../headers/AccountHeader';
12
- function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton = true }) {
12
+ function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinimized, showSectionsButton = true, rightActions }) {
13
13
  const windowNodeRef = useRef(null);
14
14
  const { dimensions, position, resizableRef, isMaximized, isOpen, onClose, viewerDefaultWidth, viewerDefaultHeight, windowZIndex, setPosition, setNewDimensions, isToolbarAnimationDisabled, fullWindowWidth, fullWindowHeight, setIsMaximized, setIsResized, isResized, setIsToolbarAnimationDisabled, setIsSidebarExpanded, isSidebarExpanded, } = useContext(AppWindowContext);
15
15
  const isSafari = isSafariBrowser();
@@ -77,6 +77,6 @@ function Window({ children, titleBar, titleBarText, mainAppOrder, mainAppIsMinim
77
77
  position: 'relative',
78
78
  })) }, { children: _jsxs(Box, Object.assign({ sx: {
79
79
  height: '100%',
80
- }, "data-testid": "AppWindow" }, { children: [titleBar !== null && titleBar !== void 0 ? titleBar : (_jsx(AccountHeader, { setIsToolbarAnimationDisabled: setIsToolbarAnimationDisabled, onClose: onClose, setIsMaximized: setIsMaximized, isToolbarAnimationDisabled: isToolbarAnimationDisabled, setIsSidebarExpanded: setIsSidebarExpanded, isSidebarExpanded: isSidebarExpanded, title: titleBarText, isMaximized: isMaximized, showSectionsButton: showSectionsButton })), children] })) })) })) })), document.body);
80
+ }, "data-testid": "AppWindow" }, { children: [titleBar !== null && titleBar !== void 0 ? titleBar : (_jsx(AccountHeader, { setIsToolbarAnimationDisabled: setIsToolbarAnimationDisabled, onClose: onClose, setIsMaximized: setIsMaximized, isToolbarAnimationDisabled: isToolbarAnimationDisabled, setIsSidebarExpanded: setIsSidebarExpanded, isSidebarExpanded: isSidebarExpanded, title: titleBarText, isMaximized: isMaximized, showSectionsButton: showSectionsButton, rightActions: rightActions })), children] })) })) })) })), document.body);
81
81
  }
82
82
  export default memo(Window);
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { ReactNode } from 'react';
2
3
  export interface WindowProps {
3
4
  children: React.ReactNode;
4
5
  titleBar?: React.ReactNode;
@@ -6,4 +7,5 @@ export interface WindowProps {
6
7
  mainAppIsMinimized?: boolean;
7
8
  mainAppOrder?: number;
8
9
  showSectionsButton?: boolean;
10
+ rightActions?: ReactNode;
9
11
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { AccountHeaderProps } from './type';
3
- declare function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, }: AccountHeaderProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, rightActions, }: AccountHeaderProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof AccountHeader>;
5
5
  export default _default;
@@ -4,7 +4,7 @@ import { motion } from 'framer-motion';
4
4
  import { useMouseState } from '../../../../hooks/index.js';
5
5
  import AccountHeaderTitle from './components/AccountHeaderTitle';
6
6
  import { animationDuration } from '../../AppWindow/constant';
7
- function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, }) {
7
+ function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximized, onClose, isSidebarExpanded, setIsSidebarExpanded, isToolbarAnimationDisabled, title, showSectionsButton, rightActions, }) {
8
8
  const { isHovered, onMouseEnter, onMouseLeave } = useMouseState();
9
9
  return (_jsx(motion.div, Object.assign({ style: Object.assign({}, (isMaximized && {
10
10
  height: 0,
@@ -26,6 +26,6 @@ function AccountHeader({ isMaximized, setIsToolbarAnimationDisabled, setIsMaximi
26
26
  }, maximized: isMaximized, id: "draggable-dialog-title", onRequestClick: () => {
27
27
  setIsToolbarAnimationDisabled === null || setIsToolbarAnimationDisabled === void 0 ? void 0 : setIsToolbarAnimationDisabled(false);
28
28
  setIsSidebarExpanded(!isSidebarExpanded);
29
- }, isSidebarExpanded: isSidebarExpanded, isHovered: isHovered, onMouseHover: onMouseEnter, onMouseLeave: onMouseLeave }) })));
29
+ }, isSidebarExpanded: isSidebarExpanded, isHovered: isHovered, onMouseHover: onMouseEnter, onMouseLeave: onMouseLeave, rightActions: rightActions }) })));
30
30
  }
31
31
  export default memo(AccountHeader);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { AccountHeaderTitleProps } from './type';
3
- declare function AccountHeaderTitle({ title, onClose, onMaximize, maximized, id, onRequestClick, isSidebarExpanded, isHovered, onMouseHover, onMouseLeave, showSectionsButton, }: Readonly<AccountHeaderTitleProps>): import("react/jsx-runtime").JSX.Element;
3
+ declare function AccountHeaderTitle({ title, onClose, onMaximize, maximized, id, onRequestClick, isSidebarExpanded, isHovered, onMouseHover, onMouseLeave, showSectionsButton, rightActions, }: Readonly<AccountHeaderTitleProps>): import("react/jsx-runtime").JSX.Element;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof AccountHeaderTitle>;
5
5
  export default _default;
@@ -4,7 +4,7 @@ import Toolbar from '../../../../../Toolbar';
4
4
  import { StyledHeaderWrapperStyled } from '../../../../../Toolbar/style';
5
5
  import { CloseIcon, ExpandButton, MaximizeIcon } from '../../../../../ToolbarIcon';
6
6
  import { teamWindowIcon } from '../../../../../../constants/index.js';
7
- function AccountHeaderTitle({ title, onClose, onMaximize, maximized = false, id, onRequestClick, isSidebarExpanded = false, isHovered = false, onMouseHover, onMouseLeave, showSectionsButton, }) {
8
- return (_jsx(StyledHeaderWrapperStyled, Object.assign({ id: id, "data-testid": "UserTitleBar", maximized: maximized || false }, { children: _jsx(Toolbar, { onMouseEnter: onMouseHover, onMouseLeave: onMouseLeave, isMaximized: maximized, isHovered: isHovered, title: title, icon: teamWindowIcon, leftActions: _jsxs(_Fragment, { children: [_jsx(CloseIcon, { onClick: onClose }), _jsx(MaximizeIcon, { isMaximized: maximized, onClick: onMaximize }), showSectionsButton && (_jsx(ExpandButton, Object.assign({ onClick: onRequestClick, isExpanded: isSidebarExpanded, isHovered: isHovered }, { children: "Sections" })))] }) }) })));
7
+ function AccountHeaderTitle({ title, onClose, onMaximize, maximized = false, id, onRequestClick, isSidebarExpanded = false, isHovered = false, onMouseHover, onMouseLeave, showSectionsButton, rightActions, }) {
8
+ return (_jsx(StyledHeaderWrapperStyled, Object.assign({ id: id, "data-testid": "UserTitleBar", maximized: maximized || false }, { children: _jsx(Toolbar, { onMouseEnter: onMouseHover, onMouseLeave: onMouseLeave, isMaximized: maximized, isHovered: isHovered, title: title, icon: teamWindowIcon, leftActions: _jsxs(_Fragment, { children: [_jsx(CloseIcon, { onClick: onClose }), _jsx(MaximizeIcon, { isMaximized: maximized, onClick: onMaximize }), showSectionsButton && (_jsx(ExpandButton, Object.assign({ onClick: onRequestClick, isExpanded: !isSidebarExpanded, isHovered: isHovered }, { children: "Sidebar" })))] }), rightActions: rightActions }) })));
9
9
  }
10
10
  export default memo(AccountHeaderTitle);
@@ -1,5 +1,5 @@
1
- import { SyntheticEvent } from 'react';
2
- import { BoxProps } from '@mui/material/Box';
1
+ import type { ReactNode, SyntheticEvent } from 'react';
2
+ import type { BoxProps } from '@mui/material/Box';
3
3
  export interface AccountHeaderTitleProps extends BoxProps {
4
4
  title: string;
5
5
  onClose?: (e: SyntheticEvent) => void;
@@ -11,4 +11,5 @@ export interface AccountHeaderTitleProps extends BoxProps {
11
11
  isHovered?: boolean;
12
12
  onMouseHover?: (e: SyntheticEvent) => void;
13
13
  showSectionsButton?: boolean;
14
+ rightActions?: ReactNode;
14
15
  }
@@ -1,4 +1,4 @@
1
- import { Dispatch, SetStateAction } from 'react';
1
+ import type { Dispatch, ReactNode, SetStateAction } from 'react';
2
2
  export interface AccountHeaderProps {
3
3
  isSidebarExpanded: boolean;
4
4
  setIsSidebarExpanded: (value: boolean) => void;
@@ -9,4 +9,5 @@ export interface AccountHeaderProps {
9
9
  onClose?: () => void;
10
10
  title?: string;
11
11
  showSectionsButton?: boolean;
12
+ rightActions?: ReactNode;
12
13
  }
@@ -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
  color?: 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
  color?: 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
  color?: 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
  color?: 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;
@@ -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;
@@ -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
  color?: 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
  color?: 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 AgreementCellContainer: 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 StyledAgreementCardIcon: 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 CardContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -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
  color?: 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
  color?: 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
  color?: 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
  color?: 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
  color?: 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
  color?: 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
  color?: 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
  color?: 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
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  export declare const StyledDownloadFileImageWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
4
3
  isTextShown?: boolean | 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
  export declare const UnCapturedContainer: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: 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
  color?: 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
  color?: 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
  color?: 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 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
  color?: 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
  export declare const Button: import("@emotion/styled").StyledComponent<{
4
3
  hidden?: boolean | undefined;
5
4
  color?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  type ExportButtonProps = {
4
3
  notificationState?: {
5
4
  success: boolean;
@@ -0,0 +1 @@
1
+ export default function Toaster(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Box from '@mui/material/Box';
3
+ import { Toaster as HotToaster, resolveValue } from 'react-hot-toast';
4
+ import { actionSuccessIcon, warningInfoIcon } from '../../constants/index.js';
5
+ import { Content } from './style';
6
+ const icons = {
7
+ success: actionSuccessIcon,
8
+ error: warningInfoIcon,
9
+ };
10
+ export default function Toaster() {
11
+ return (_jsx(HotToaster, { children: (t) => (_jsxs(Content, { children: [icons[t.type] && _jsx(Box, { component: "img", src: icons[t.type], alt: t.type }), _jsx(Box, { children: resolveValue(t.message, t) })] })) }));
12
+ }
@@ -0,0 +1,2 @@
1
+ import Toaster from './Toaster';
2
+ export default Toaster;
@@ -0,0 +1,2 @@
1
+ import Toaster from './Toaster';
2
+ export default Toaster;
@@ -15,6 +15,6 @@ import { ToolbarStyled, StyledBox, ActionsBox } from './style';
15
15
  import WindowAppIcon from '../WindowAppIcon';
16
16
  function Toolbar(_a) {
17
17
  var { onMouseEnter, onMouseLeave, isMaximized, isHovered, children, rightActions, leftActions, title, icon } = _a, props = __rest(_a, ["onMouseEnter", "onMouseLeave", "isMaximized", "isHovered", "children", "rightActions", "leftActions", "title", "icon"]);
18
- return (_jsx(ToolbarStyled, Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, maximized: isMaximized, id: "toolbar", isHovered: isHovered }, props, { children: _jsxs(StyledBox, Object.assign({ className: "toolbar-wrapper" }, { children: [leftActions ? _jsx(ActionsBox, Object.assign({ className: "action-box" }, { children: leftActions })) : _jsx("div", {}), _jsx(WindowAppIcon, { title: title, icon: icon }), rightActions || _jsx("div", {})] })) })));
18
+ return (_jsx(ToolbarStyled, Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, maximized: isMaximized, id: "toolbar", isHovered: isHovered }, props, { children: _jsxs(StyledBox, Object.assign({ className: "toolbar-wrapper" }, { children: [leftActions ? _jsx(ActionsBox, Object.assign({ className: "action-box" }, { children: leftActions })) : _jsx("div", {}), _jsx(WindowAppIcon, { title: title, icon: icon }), rightActions ? _jsx(ActionsBox, Object.assign({ className: "action-box" }, { children: rightActions })) : _jsx("div", {})] })) })));
19
19
  }
20
20
  export default memo(Toolbar);
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- /// <reference types="react" />
3
2
  interface TableWrapperProps {
4
3
  showNoDataView?: boolean;
5
4
  }
@@ -50,7 +50,7 @@ export { default as MultiSelectDropdownButton, type ButtonWithDropdownProps } fr
50
50
  export { default as MultiSelectWithSearch, type MultiSelectWithSearchProps, ChildMenuItem, ParentMenuItem } from './MultiSelectWithSearch';
51
51
  export { default as NestedDropdown, type DropdownProps, type Selected, type Placement, Dropdown, NestedMenuItem } from './NestedDropdown';
52
52
  export { default as NoInternet } from './NoInternet';
53
- export { default as Notifications } from './Notifications';
53
+ export { default as Toaster } from './Toaster';
54
54
  export { default as ProgressBar } from './ProgressBar';
55
55
  export { default as ProgressRing } from './ProgressRing';
56
56
  export * from './InputBase';
@@ -50,7 +50,7 @@ export { default as MultiSelectDropdownButton } from './MultiSelectDropdownButto
50
50
  export { default as MultiSelectWithSearch, ChildMenuItem, ParentMenuItem } from './MultiSelectWithSearch';
51
51
  export { default as NestedDropdown, Dropdown, NestedMenuItem } from './NestedDropdown';
52
52
  export { default as NoInternet } from './NoInternet';
53
- export { default as Notifications } from './Notifications';
53
+ export { default as Toaster } from './Toaster';
54
54
  export { default as ProgressBar } from './ProgressBar';
55
55
  export { default as ProgressRing } from './ProgressRing';
56
56
  export * from './InputBase';
@@ -13,3 +13,4 @@ export * from './useAppsInfo';
13
13
  export * from './useAppEventPublisher';
14
14
  export * from './useAppEventListener';
15
15
  export * from './useSelectedMerchantDetails';
16
+ export * from './useToast';
@@ -13,3 +13,4 @@ export * from './useAppsInfo';
13
13
  export * from './useAppEventPublisher';
14
14
  export * from './useAppEventListener';
15
15
  export * from './useSelectedMerchantDetails';
16
+ export * from './useToast';
@@ -0,0 +1,12 @@
1
+ import { ToastMessage } from '../types/index.js';
2
+ import type { ToastOptions } from 'react-hot-toast';
3
+ export interface ToastFunction {
4
+ (message: ToastMessage, options?: ToastOptions): string;
5
+ success: (message: ToastMessage, options?: ToastOptions) => string;
6
+ error: (message: ToastMessage, options?: ToastOptions) => string;
7
+ loading: (message: ToastMessage, options?: ToastOptions) => string;
8
+ custom: (message: ToastMessage, options?: ToastOptions) => string;
9
+ dismiss: (toastId?: string) => void;
10
+ remove: (toastId?: string) => void;
11
+ }
12
+ export declare function useToast(): ToastFunction;
@@ -0,0 +1,29 @@
1
+ import { useMemo, useCallback } from 'react';
2
+ import { useAppEventPublisher } from './index.js';
3
+ import { AppEvent } from '../types/index.js';
4
+ const generateToastId = () => crypto.randomUUID();
5
+ export function useToast() {
6
+ const publish = useAppEventPublisher(AppEvent.OnToast);
7
+ const createToastByVariant = useCallback((variant) => (message, options) => {
8
+ var _a;
9
+ const id = (_a = options === null || options === void 0 ? void 0 : options.id) !== null && _a !== void 0 ? _a : generateToastId();
10
+ publish({ action: 'show', variant, message, options: Object.assign(Object.assign({}, options), { id }) });
11
+ return id;
12
+ }, [publish]);
13
+ return useMemo(() => {
14
+ // base callable function
15
+ const toast = createToastByVariant('default');
16
+ // attach variants
17
+ toast.success = createToastByVariant('success');
18
+ toast.error = createToastByVariant('error');
19
+ toast.loading = createToastByVariant('loading');
20
+ toast.custom = createToastByVariant('custom');
21
+ toast.dismiss = (toastId) => {
22
+ publish({ action: 'dismiss', variant: 'dismiss', toastId });
23
+ };
24
+ toast.remove = (toastId) => {
25
+ publish({ action: 'remove', variant: 'remove', toastId });
26
+ };
27
+ return toast;
28
+ }, [createToastByVariant, publish]);
29
+ }
@@ -1,4 +1,4 @@
1
- import { CalenderMode, NavigateFunction, TableMode, Timezone } from './index.js';
1
+ import { CalenderMode, NavigateFunction, TableMode, Timezone, ToastEventPayload } from './index.js';
2
2
  import { DragControls } from 'framer-motion';
3
3
  export declare enum AppEvent {
4
4
  OnClickTableAction = "on-click-table-action",
@@ -10,6 +10,7 @@ export declare enum AppEvent {
10
10
  OnNavigate = "on-navigate",
11
11
  OnStartDrag = "on-start-drag",
12
12
  OnChangeAppToolbar = "on-change-app-toolbar",
13
+ OnToast = "on-toast",
13
14
  OnModifyRemotePayload = "on-modify-remote-payload"
14
15
  }
15
16
  /**
@@ -46,4 +47,5 @@ export type AppEventMap = {
46
47
  windowId: string;
47
48
  payload: object;
48
49
  }) => void;
50
+ [AppEvent.OnToast]: (params: ToastEventPayload) => void;
49
51
  };
@@ -10,6 +10,7 @@ export var AppEvent;
10
10
  AppEvent["OnNavigate"] = "on-navigate";
11
11
  AppEvent["OnStartDrag"] = "on-start-drag";
12
12
  AppEvent["OnChangeAppToolbar"] = "on-change-app-toolbar";
13
+ AppEvent["OnToast"] = "on-toast";
13
14
  // Remote Events
14
15
  AppEvent["OnModifyRemotePayload"] = "on-modify-remote-payload";
15
16
  })(AppEvent || (AppEvent = {}));
@@ -32,3 +32,4 @@ export * from './filter';
32
32
  export * from './utilities';
33
33
  export * from './reports';
34
34
  export * from './document';
35
+ export * from './toast';
@@ -32,3 +32,4 @@ export * from './filter';
32
32
  export * from './utilities';
33
33
  export * from './reports';
34
34
  export * from './document';
35
+ export * from './toast';
@@ -0,0 +1,16 @@
1
+ import type { ToastOptions, ValueOrFunction, Renderable, Toast } from 'react-hot-toast';
2
+ export type ToastMessage = ValueOrFunction<Renderable, Toast>;
3
+ export type ToastEventPayload = {
4
+ action: 'show';
5
+ variant: 'default' | 'success' | 'error' | 'loading' | 'custom';
6
+ message: ToastMessage;
7
+ options?: ToastOptions;
8
+ } | {
9
+ variant: 'dismiss';
10
+ action: 'dismiss';
11
+ toastId?: string;
12
+ } | {
13
+ variant: 'remove';
14
+ action: 'remove';
15
+ toastId?: string;
16
+ };
@@ -0,0 +1 @@
1
+ export {};
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.368",
5
- "testVersion": 0,
4
+ "version": "0.1.369-test.4",
5
+ "testVersion": 4,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -164,4 +164,4 @@
164
164
  "publishConfig": {
165
165
  "registry": "https://registry.npmjs.org/"
166
166
  }
167
- }
167
+ }
@@ -1 +0,0 @@
1
- export default function Notifications(): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Box from '@mui/material/Box';
3
- import { Toaster, resolveValue } from 'react-hot-toast';
4
- import { actionSuccessIcon, warningInfoIcon } from '../../constants/index.js';
5
- import { Content } from './style';
6
- const icons = {
7
- success: actionSuccessIcon,
8
- error: warningInfoIcon,
9
- };
10
- export default function Notifications() {
11
- return (_jsx(Toaster, { children: (t) => (_jsxs(Content, { children: [icons[t.type] && _jsx(Box, { component: "img", src: icons[t.type], alt: t.type }), _jsx(Box, { children: resolveValue(t.message, t) })] })) }));
12
- }
@@ -1,2 +0,0 @@
1
- import Notifications from './Notifications';
2
- export default Notifications;
@@ -1,2 +0,0 @@
1
- import Notifications from './Notifications';
2
- export default Notifications;