@tap-payments/os-micro-frontend-shared 0.1.264 → 0.1.265

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.
@@ -0,0 +1,2 @@
1
+ import { ReceiptViewerProps } from './type';
2
+ export default function ReceiptViewer({ isOpen, receipt, order, appWindow, onClose }: Readonly<ReceiptViewerProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Box from '@mui/material/Box';
3
+ import { AppWindowWrapper } from '../index.js';
4
+ import { Wrapper } from './style';
5
+ export default function ReceiptViewer({ isOpen, receipt, order, appWindow, onClose }) {
6
+ return (_jsx(AppWindowWrapper, Object.assign({ isOpen: isOpen, onClose: () => {
7
+ onClose(receipt.id);
8
+ }, initialPosition: {
9
+ x: 1000 - 20 * order,
10
+ }, windowProps: {
11
+ titleBarText: 'Receipt',
12
+ mainAppIsMinimized: appWindow === null || appWindow === void 0 ? void 0 : appWindow.isMinimized,
13
+ mainAppOrder: appWindow === null || appWindow === void 0 ? void 0 : appWindow.order,
14
+ showSectionsButton: false,
15
+ }, defaultWindowWidth: 502, defaultWindowHeight: 745 }, { children: _jsx(Wrapper, { children: _jsx(Box, { sx: { height: 715, overflow: 'auto' }, dangerouslySetInnerHTML: { __html: receipt.content } }) }) })));
16
+ }
@@ -0,0 +1,11 @@
1
+ import { Receipt } from '../../types/index.js';
2
+ type ReceiptsViewerProps = {
3
+ receipts: Receipt[];
4
+ appWindow?: {
5
+ isMinimized?: boolean;
6
+ order?: number;
7
+ };
8
+ onCloseReceipt: (id: string) => void;
9
+ };
10
+ export default function ReceiptsViewer({ receipts, onCloseReceipt, appWindow }: Readonly<ReceiptsViewerProps>): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import ReceiptViewer from './ReceiptViewer';
3
+ export default function ReceiptsViewer({ receipts, onCloseReceipt, appWindow }) {
4
+ if (!receipts.length)
5
+ return null;
6
+ return (_jsx(_Fragment, { children: receipts.map((receipt, index) => (_jsx(ReceiptViewer, { order: index, isOpen: true, onClose: (id) => onCloseReceipt(id), receipt: receipt, appWindow: appWindow }, receipt.id))) }));
7
+ }
@@ -0,0 +1 @@
1
+ export { default as ReceiptsViewer } from './ReceiptsViewer';
@@ -0,0 +1 @@
1
+ export { default as ReceiptsViewer } from './ReceiptsViewer';
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const Wrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").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").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,7 @@
1
+ import { Box, styled } from '@mui/material';
2
+ export const Wrapper = styled(Box)(({ theme }) => ({
3
+ background: theme.palette.common.white,
4
+ width: '100%',
5
+ height: '100%',
6
+ overflow: 'auto',
7
+ }));
@@ -0,0 +1,11 @@
1
+ import { Receipt } from '../../types/index.js';
2
+ export interface ReceiptViewerProps {
3
+ isOpen: boolean;
4
+ receipt: Receipt;
5
+ order: number;
6
+ appWindow?: {
7
+ isMinimized?: boolean;
8
+ order?: number;
9
+ };
10
+ onClose: (id: string) => void;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -135,3 +135,4 @@ export * from './MerchantCurrencyDropdown';
135
135
  export * from './OpenFileInNewTab';
136
136
  export * from './FilePreview';
137
137
  export * from './FileInputPreview';
138
+ export * from './ReceiptsViewer';
@@ -135,3 +135,4 @@ export * from './MerchantCurrencyDropdown';
135
135
  export * from './OpenFileInNewTab';
136
136
  export * from './FilePreview';
137
137
  export * from './FileInputPreview';
138
+ export * from './ReceiptsViewer';
@@ -27,4 +27,4 @@ export * from './tsUtils';
27
27
  export * from './appEvents';
28
28
  export * from './common';
29
29
  export * from './discount';
30
- export * from './destination';
30
+ export * from './receipt';
@@ -27,4 +27,4 @@ export * from './tsUtils';
27
27
  export * from './appEvents';
28
28
  export * from './common';
29
29
  export * from './discount';
30
- export * from './destination';
30
+ export * from './receipt';
@@ -0,0 +1,4 @@
1
+ export interface Receipt {
2
+ id: string;
3
+ content: string;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.264",
4
+ "version": "0.1.265",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",