@tap-payments/os-micro-frontend-shared 0.0.246-test.3 → 0.0.246-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.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { AppWindowHeaderProps } from './type';
3
- declare function AppWindowHeader({ isMaximized, id, isToolbarAnimationDisabled, title, leftActions, onClose, onMaximize }: AppWindowHeaderProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function AppWindowHeader({ isMaximized, id, isToolbarAnimationDisabled, title, leftActions, onClose, onMaximize, sx }: AppWindowHeaderProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof AppWindowHeader>;
5
5
  export default _default;
@@ -5,7 +5,7 @@ import { useMouseState } from '../../../../hooks/index.js';
5
5
  import { animationDuration } from '../../AppWindow/constant';
6
6
  import AppWindowHeaderBase from './AppWindowHeaderBase';
7
7
  import { CloseIcon, MaximizeIcon } from '../../../ToolbarIcon';
8
- function AppWindowHeader({ isMaximized, id, isToolbarAnimationDisabled, title, leftActions, onClose, onMaximize }) {
8
+ function AppWindowHeader({ isMaximized, id, isToolbarAnimationDisabled, title, leftActions, onClose, onMaximize, sx }) {
9
9
  const { isHovered, onMouseEnter, onMouseLeave } = useMouseState();
10
10
  return (_jsx(motion.div, Object.assign({ style: Object.assign({}, (isMaximized && {
11
11
  height: 0,
@@ -18,6 +18,6 @@ function AppWindowHeader({ isMaximized, id, isToolbarAnimationDisabled, title, l
18
18
  width: '100%',
19
19
  })), transition: Object.assign({ duration: animationDuration }, (isToolbarAnimationDisabled && {
20
20
  duration: 0,
21
- })) }, { children: _jsx(AppWindowHeaderBase, { title: title, maximized: isMaximized, id: id || 'draggable-dialog-title', isHovered: isHovered, onMouseHover: onMouseEnter, onMouseLeave: onMouseLeave, leftActions: leftActions || (_jsxs(_Fragment, { children: [_jsx(CloseIcon, { onClick: onClose }), _jsx(MaximizeIcon, { isMaximized: isMaximized, onClick: () => onMaximize === null || onMaximize === void 0 ? void 0 : onMaximize(!isMaximized) })] })) }) })));
21
+ })) }, { children: _jsx(AppWindowHeaderBase, { title: title, maximized: isMaximized, id: id || 'draggable-dialog-title', isHovered: isHovered, onMouseHover: onMouseEnter, onMouseLeave: onMouseLeave, leftActions: leftActions || (_jsxs(_Fragment, { children: [_jsx(CloseIcon, { onClick: onClose }), _jsx(MaximizeIcon, { isMaximized: isMaximized, onClick: () => onMaximize === null || onMaximize === void 0 ? void 0 : onMaximize(!isMaximized) })] })), sx: sx }) })));
22
22
  }
23
23
  export default memo(AppWindowHeader);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { AppWindowHeaderBaseProps } from './type';
3
- declare function AppWindowHeaderBase({ title, maximized, id, isHovered, onMouseHover, onMouseLeave, leftActions, sandboxMode, titleIconSrc, ...rootProps }: AppWindowHeaderBaseProps): import("react/jsx-runtime").JSX.Element;
3
+ declare function AppWindowHeaderBase({ title, maximized, id, isHovered, onMouseHover, onMouseLeave, leftActions, sandboxMode, titleIconSrc, sx, ...rootProps }: AppWindowHeaderBaseProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare const _default: import("react").MemoExoticComponent<typeof AppWindowHeaderBase>;
5
5
  export default _default;
@@ -14,7 +14,7 @@ import { memo } from 'react';
14
14
  import Toolbar from '../../../Toolbar';
15
15
  import { StyledHeaderWrapperStyled } from '../../../Toolbar/style';
16
16
  function AppWindowHeaderBase(_a) {
17
- var { title, maximized = false, id, isHovered = false, onMouseHover, onMouseLeave, leftActions, sandboxMode = false, titleIconSrc } = _a, rootProps = __rest(_a, ["title", "maximized", "id", "isHovered", "onMouseHover", "onMouseLeave", "leftActions", "sandboxMode", "titleIconSrc"]);
18
- return (_jsx(StyledHeaderWrapperStyled, Object.assign({ id: id, "data-testid": "UserTitleBar", maximized: maximized || false, sandboxMode: sandboxMode }, rootProps, { children: _jsx(Toolbar, { onMouseEnter: onMouseHover, onMouseLeave: onMouseLeave, isMaximized: maximized, isHovered: isHovered, title: title || '', icon: titleIconSrc, leftActions: leftActions }) })));
17
+ var { title, maximized = false, id, isHovered = false, onMouseHover, onMouseLeave, leftActions, sandboxMode = false, titleIconSrc, sx } = _a, rootProps = __rest(_a, ["title", "maximized", "id", "isHovered", "onMouseHover", "onMouseLeave", "leftActions", "sandboxMode", "titleIconSrc", "sx"]);
18
+ return (_jsx(StyledHeaderWrapperStyled, Object.assign({ className: "header-wrapper", id: id, "data-testid": "UserTitleBar", maximized: maximized || false, sandboxMode: sandboxMode, sx: sx }, rootProps, { children: _jsx(Toolbar, { onMouseEnter: onMouseHover, onMouseLeave: onMouseLeave, isMaximized: maximized, isHovered: isHovered, title: title || '', icon: titleIconSrc, leftActions: leftActions }) })));
19
19
  }
20
20
  export default memo(AppWindowHeaderBase);
@@ -1,4 +1,5 @@
1
1
  import { StyledHeaderWrapperStyled, ToolbarProps } from '../../../Toolbar';
2
+ import type { SxProps, Theme } from '@mui/material/styles';
2
3
  import { ReactNode, SyntheticEvent } from 'react';
3
4
  export type AppWindowHeaderBaseProps = React.ComponentProps<typeof StyledHeaderWrapperStyled> & {
4
5
  title?: string;
@@ -18,4 +19,7 @@ export type AppWindowHeaderProps = {
18
19
  leftActions?: ReactNode;
19
20
  onClose?: () => void;
20
21
  onMaximize?: (isMaximized: boolean) => void;
22
+ headerBaseProps?: Partial<AppWindowHeaderBaseProps>;
23
+ headerBaseStyles?: SxProps<Theme>;
24
+ sx?: AppWindowHeaderBaseProps['sx'];
21
25
  };
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.0.246-test.3",
5
- "testVersion": 3,
4
+ "version": "0.0.246-test.4",
5
+ "testVersion": 4,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",