@xyo-network/react-webapp 2.81.10 → 2.83.0
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/dist/browser/index.d.ts +44 -2
- package/dist/browser/index.mjs +258 -0
- package/dist/browser/index.mjs.map +1 -0
- package/package.json +28 -44
- package/src/components/Body.tsx +8 -6
- package/src/components/Chrome.stories.tsx +10 -10
- package/src/components/Chrome.tsx +21 -17
- package/src/components/ErrorPage.tsx +2 -1
- package/src/components/NotFoundPage/Page.stories.tsx +1 -1
- package/src/components/NotFoundPage/Page.tsx +2 -1
- package/src/components/NotFoundPage/index.ts +1 -1
- package/src/components/Page.tsx +34 -31
- package/src/components/index.ts +5 -5
- package/src/components/lib/index.ts +1 -1
- package/src/index.ts +1 -1
- package/xy.config.ts +12 -0
- package/dist/browser/components/Body.d.cts +0 -12
- package/dist/browser/components/Body.d.cts.map +0 -1
- package/dist/browser/components/Body.d.mts +0 -12
- package/dist/browser/components/Body.d.mts.map +0 -1
- package/dist/browser/components/Body.d.ts +0 -12
- package/dist/browser/components/Body.d.ts.map +0 -1
- package/dist/browser/components/Chrome.d.cts +0 -15
- package/dist/browser/components/Chrome.d.cts.map +0 -1
- package/dist/browser/components/Chrome.d.mts +0 -15
- package/dist/browser/components/Chrome.d.mts.map +0 -1
- package/dist/browser/components/Chrome.d.ts +0 -15
- package/dist/browser/components/Chrome.d.ts.map +0 -1
- package/dist/browser/components/ErrorPage.d.cts +0 -7
- package/dist/browser/components/ErrorPage.d.cts.map +0 -1
- package/dist/browser/components/ErrorPage.d.mts +0 -7
- package/dist/browser/components/ErrorPage.d.mts.map +0 -1
- package/dist/browser/components/ErrorPage.d.ts +0 -7
- package/dist/browser/components/ErrorPage.d.ts.map +0 -1
- package/dist/browser/components/NotFoundPage/Page.d.cts +0 -4
- package/dist/browser/components/NotFoundPage/Page.d.cts.map +0 -1
- package/dist/browser/components/NotFoundPage/Page.d.mts +0 -4
- package/dist/browser/components/NotFoundPage/Page.d.mts.map +0 -1
- package/dist/browser/components/NotFoundPage/Page.d.ts +0 -4
- package/dist/browser/components/NotFoundPage/Page.d.ts.map +0 -1
- package/dist/browser/components/NotFoundPage/index.d.cts +0 -2
- package/dist/browser/components/NotFoundPage/index.d.cts.map +0 -1
- package/dist/browser/components/NotFoundPage/index.d.mts +0 -2
- package/dist/browser/components/NotFoundPage/index.d.mts.map +0 -1
- package/dist/browser/components/NotFoundPage/index.d.ts +0 -2
- package/dist/browser/components/NotFoundPage/index.d.ts.map +0 -1
- package/dist/browser/components/Page.d.cts +0 -11
- package/dist/browser/components/Page.d.cts.map +0 -1
- package/dist/browser/components/Page.d.mts +0 -11
- package/dist/browser/components/Page.d.mts.map +0 -1
- package/dist/browser/components/Page.d.ts +0 -11
- package/dist/browser/components/Page.d.ts.map +0 -1
- package/dist/browser/components/index.d.cts +0 -6
- package/dist/browser/components/index.d.cts.map +0 -1
- package/dist/browser/components/index.d.mts +0 -6
- package/dist/browser/components/index.d.mts.map +0 -1
- package/dist/browser/components/index.d.ts +0 -6
- package/dist/browser/components/index.d.ts.map +0 -1
- package/dist/browser/components/lib/cssValues.d.cts +0 -6
- package/dist/browser/components/lib/cssValues.d.cts.map +0 -1
- package/dist/browser/components/lib/cssValues.d.mts +0 -6
- package/dist/browser/components/lib/cssValues.d.mts.map +0 -1
- package/dist/browser/components/lib/cssValues.d.ts +0 -6
- package/dist/browser/components/lib/cssValues.d.ts.map +0 -1
- package/dist/browser/components/lib/index.d.cts +0 -2
- package/dist/browser/components/lib/index.d.cts.map +0 -1
- package/dist/browser/components/lib/index.d.mts +0 -2
- package/dist/browser/components/lib/index.d.mts.map +0 -1
- package/dist/browser/components/lib/index.d.ts +0 -2
- package/dist/browser/components/lib/index.d.ts.map +0 -1
- package/dist/browser/index.cjs +0 -261
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.d.cts +0 -2
- package/dist/browser/index.d.cts.map +0 -1
- package/dist/browser/index.d.mts +0 -2
- package/dist/browser/index.d.mts.map +0 -1
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -238
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/components/Body.d.cts +0 -12
- package/dist/neutral/components/Body.d.cts.map +0 -1
- package/dist/neutral/components/Body.d.mts +0 -12
- package/dist/neutral/components/Body.d.mts.map +0 -1
- package/dist/neutral/components/Body.d.ts +0 -12
- package/dist/neutral/components/Body.d.ts.map +0 -1
- package/dist/neutral/components/Chrome.d.cts +0 -15
- package/dist/neutral/components/Chrome.d.cts.map +0 -1
- package/dist/neutral/components/Chrome.d.mts +0 -15
- package/dist/neutral/components/Chrome.d.mts.map +0 -1
- package/dist/neutral/components/Chrome.d.ts +0 -15
- package/dist/neutral/components/Chrome.d.ts.map +0 -1
- package/dist/neutral/components/ErrorPage.d.cts +0 -7
- package/dist/neutral/components/ErrorPage.d.cts.map +0 -1
- package/dist/neutral/components/ErrorPage.d.mts +0 -7
- package/dist/neutral/components/ErrorPage.d.mts.map +0 -1
- package/dist/neutral/components/ErrorPage.d.ts +0 -7
- package/dist/neutral/components/ErrorPage.d.ts.map +0 -1
- package/dist/neutral/components/NotFoundPage/Page.d.cts +0 -4
- package/dist/neutral/components/NotFoundPage/Page.d.cts.map +0 -1
- package/dist/neutral/components/NotFoundPage/Page.d.mts +0 -4
- package/dist/neutral/components/NotFoundPage/Page.d.mts.map +0 -1
- package/dist/neutral/components/NotFoundPage/Page.d.ts +0 -4
- package/dist/neutral/components/NotFoundPage/Page.d.ts.map +0 -1
- package/dist/neutral/components/NotFoundPage/index.d.cts +0 -2
- package/dist/neutral/components/NotFoundPage/index.d.cts.map +0 -1
- package/dist/neutral/components/NotFoundPage/index.d.mts +0 -2
- package/dist/neutral/components/NotFoundPage/index.d.mts.map +0 -1
- package/dist/neutral/components/NotFoundPage/index.d.ts +0 -2
- package/dist/neutral/components/NotFoundPage/index.d.ts.map +0 -1
- package/dist/neutral/components/Page.d.cts +0 -11
- package/dist/neutral/components/Page.d.cts.map +0 -1
- package/dist/neutral/components/Page.d.mts +0 -11
- package/dist/neutral/components/Page.d.mts.map +0 -1
- package/dist/neutral/components/Page.d.ts +0 -11
- package/dist/neutral/components/Page.d.ts.map +0 -1
- package/dist/neutral/components/index.d.cts +0 -6
- package/dist/neutral/components/index.d.cts.map +0 -1
- package/dist/neutral/components/index.d.mts +0 -6
- package/dist/neutral/components/index.d.mts.map +0 -1
- package/dist/neutral/components/index.d.ts +0 -6
- package/dist/neutral/components/index.d.ts.map +0 -1
- package/dist/neutral/components/lib/cssValues.d.cts +0 -6
- package/dist/neutral/components/lib/cssValues.d.cts.map +0 -1
- package/dist/neutral/components/lib/cssValues.d.mts +0 -6
- package/dist/neutral/components/lib/cssValues.d.mts.map +0 -1
- package/dist/neutral/components/lib/cssValues.d.ts +0 -6
- package/dist/neutral/components/lib/cssValues.d.ts.map +0 -1
- package/dist/neutral/components/lib/index.d.cts +0 -2
- package/dist/neutral/components/lib/index.d.cts.map +0 -1
- package/dist/neutral/components/lib/index.d.mts +0 -2
- package/dist/neutral/components/lib/index.d.mts.map +0 -1
- package/dist/neutral/components/lib/index.d.ts +0 -2
- package/dist/neutral/components/lib/index.d.ts.map +0 -1
- package/dist/neutral/index.cjs +0 -261
- package/dist/neutral/index.cjs.map +0 -1
- package/dist/neutral/index.d.cts +0 -2
- package/dist/neutral/index.d.cts.map +0 -1
- package/dist/neutral/index.d.mts +0 -2
- package/dist/neutral/index.d.mts.map +0 -1
- package/dist/neutral/index.d.ts +0 -2
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/neutral/index.js +0 -238
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/components/Body.d.cts +0 -12
- package/dist/node/components/Body.d.cts.map +0 -1
- package/dist/node/components/Body.d.mts +0 -12
- package/dist/node/components/Body.d.mts.map +0 -1
- package/dist/node/components/Body.d.ts +0 -12
- package/dist/node/components/Body.d.ts.map +0 -1
- package/dist/node/components/Chrome.d.cts +0 -15
- package/dist/node/components/Chrome.d.cts.map +0 -1
- package/dist/node/components/Chrome.d.mts +0 -15
- package/dist/node/components/Chrome.d.mts.map +0 -1
- package/dist/node/components/Chrome.d.ts +0 -15
- package/dist/node/components/Chrome.d.ts.map +0 -1
- package/dist/node/components/ErrorPage.d.cts +0 -7
- package/dist/node/components/ErrorPage.d.cts.map +0 -1
- package/dist/node/components/ErrorPage.d.mts +0 -7
- package/dist/node/components/ErrorPage.d.mts.map +0 -1
- package/dist/node/components/ErrorPage.d.ts +0 -7
- package/dist/node/components/ErrorPage.d.ts.map +0 -1
- package/dist/node/components/NotFoundPage/Page.d.cts +0 -4
- package/dist/node/components/NotFoundPage/Page.d.cts.map +0 -1
- package/dist/node/components/NotFoundPage/Page.d.mts +0 -4
- package/dist/node/components/NotFoundPage/Page.d.mts.map +0 -1
- package/dist/node/components/NotFoundPage/Page.d.ts +0 -4
- package/dist/node/components/NotFoundPage/Page.d.ts.map +0 -1
- package/dist/node/components/NotFoundPage/index.d.cts +0 -2
- package/dist/node/components/NotFoundPage/index.d.cts.map +0 -1
- package/dist/node/components/NotFoundPage/index.d.mts +0 -2
- package/dist/node/components/NotFoundPage/index.d.mts.map +0 -1
- package/dist/node/components/NotFoundPage/index.d.ts +0 -2
- package/dist/node/components/NotFoundPage/index.d.ts.map +0 -1
- package/dist/node/components/Page.d.cts +0 -11
- package/dist/node/components/Page.d.cts.map +0 -1
- package/dist/node/components/Page.d.mts +0 -11
- package/dist/node/components/Page.d.mts.map +0 -1
- package/dist/node/components/Page.d.ts +0 -11
- package/dist/node/components/Page.d.ts.map +0 -1
- package/dist/node/components/index.d.cts +0 -6
- package/dist/node/components/index.d.cts.map +0 -1
- package/dist/node/components/index.d.mts +0 -6
- package/dist/node/components/index.d.mts.map +0 -1
- package/dist/node/components/index.d.ts +0 -6
- package/dist/node/components/index.d.ts.map +0 -1
- package/dist/node/components/lib/cssValues.d.cts +0 -6
- package/dist/node/components/lib/cssValues.d.cts.map +0 -1
- package/dist/node/components/lib/cssValues.d.mts +0 -6
- package/dist/node/components/lib/cssValues.d.mts.map +0 -1
- package/dist/node/components/lib/cssValues.d.ts +0 -6
- package/dist/node/components/lib/cssValues.d.ts.map +0 -1
- package/dist/node/components/lib/index.d.cts +0 -2
- package/dist/node/components/lib/index.d.cts.map +0 -1
- package/dist/node/components/lib/index.d.mts +0 -2
- package/dist/node/components/lib/index.d.mts.map +0 -1
- package/dist/node/components/lib/index.d.ts +0 -2
- package/dist/node/components/lib/index.d.ts.map +0 -1
- package/dist/node/index.cjs +0 -272
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -2
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.mts +0 -2
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.js +0 -238
- package/dist/node/index.js.map +0 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Breakpoint, ContainerProps } from '@mui/material';
|
|
2
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
+
import React, { ReactNode } from 'react';
|
|
4
|
+
import { WebAppNavigationType } from '@xyo-network/react-app-settings';
|
|
5
|
+
import { WithChildren } from '@xylabs/react-shared';
|
|
6
|
+
|
|
7
|
+
interface WebAppBodyProps extends FlexBoxProps {
|
|
8
|
+
breadcrumbs?: ReactNode;
|
|
9
|
+
disableBreadcrumbGutter?: boolean;
|
|
10
|
+
mobileScrollingBreakpoint?: Breakpoint;
|
|
11
|
+
spacing?: string | number;
|
|
12
|
+
variant?: 'scrollable' | 'fixed';
|
|
13
|
+
}
|
|
14
|
+
declare const WebAppBody: React.FC<WebAppBodyProps>;
|
|
15
|
+
|
|
16
|
+
interface WebAppChromeProps extends FlexBoxProps {
|
|
17
|
+
appName: string;
|
|
18
|
+
appbar?: ReactNode;
|
|
19
|
+
errorBoundary?: boolean;
|
|
20
|
+
errorPage?: ReactNode;
|
|
21
|
+
footer?: ReactNode;
|
|
22
|
+
footerElevation?: number;
|
|
23
|
+
menuItems?: ReactNode;
|
|
24
|
+
navigationType?: WebAppNavigationType;
|
|
25
|
+
}
|
|
26
|
+
declare const WebAppChrome: React.ForwardRefExoticComponent<WebAppChromeProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
|
|
28
|
+
interface WebAppPageProps extends WebAppBodyProps, FlexBoxProps {
|
|
29
|
+
container?: ContainerProps['maxWidth'] | 'none';
|
|
30
|
+
disableGutters?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const WebAppPage: React.FC<WithChildren<WebAppPageProps>>;
|
|
33
|
+
declare const FlexPage: React.FC<WithChildren<WebAppPageProps>>;
|
|
34
|
+
|
|
35
|
+
interface WebAppErrorPageProps extends WebAppPageProps {
|
|
36
|
+
error?: Error;
|
|
37
|
+
}
|
|
38
|
+
declare const WebAppErrorPage: React.FC<WebAppErrorPageProps>;
|
|
39
|
+
declare const ErrorPage: React.FC<WebAppErrorPageProps>;
|
|
40
|
+
|
|
41
|
+
declare const WebAppNotFoundPage: React.FC<WebAppPageProps>;
|
|
42
|
+
declare const NotFoundPage: React.FC<WebAppPageProps>;
|
|
43
|
+
|
|
44
|
+
export { ErrorPage, FlexPage, NotFoundPage, WebAppBody, type WebAppBodyProps, WebAppChrome, type WebAppChromeProps, WebAppErrorPage, type WebAppErrorPageProps, WebAppNotFoundPage, WebAppPage, type WebAppPageProps };
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/components/Body.tsx
|
|
5
|
+
import { styled } from "@mui/material";
|
|
6
|
+
import { FlexGrowCol, FlexRow } from "@xylabs/react-flexbox";
|
|
7
|
+
import React from "react";
|
|
8
|
+
|
|
9
|
+
// src/components/lib/cssValues.ts
|
|
10
|
+
var scrollableWrap = {
|
|
11
|
+
inset: 0,
|
|
12
|
+
position: "absolute"
|
|
13
|
+
};
|
|
14
|
+
var fixedWrap = {
|
|
15
|
+
inset: "unset",
|
|
16
|
+
position: "relative"
|
|
17
|
+
};
|
|
18
|
+
var scrollableContent = {
|
|
19
|
+
...fixedWrap
|
|
20
|
+
};
|
|
21
|
+
var fixedContent = {
|
|
22
|
+
...scrollableWrap
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// src/components/Body.tsx
|
|
26
|
+
var WebAppBodyName = "WebAppBody";
|
|
27
|
+
var propsNotForwarded = /* @__PURE__ */ new Set([
|
|
28
|
+
"mobileScrollingBreakpoint",
|
|
29
|
+
"variant",
|
|
30
|
+
"spacing",
|
|
31
|
+
"disableBreadcrumbGutter"
|
|
32
|
+
]);
|
|
33
|
+
var defaultStyledOptions = {
|
|
34
|
+
shouldForwardProp: /* @__PURE__ */ __name((prop) => !propsNotForwarded.has(prop), "shouldForwardProp")
|
|
35
|
+
};
|
|
36
|
+
var WebAppBodyRoot = styled(FlexGrowCol, {
|
|
37
|
+
...defaultStyledOptions,
|
|
38
|
+
name: WebAppBodyName,
|
|
39
|
+
slot: "Root"
|
|
40
|
+
})(({ spacing, theme, mobileScrollingBreakpoint = "sm", variant }) => {
|
|
41
|
+
const scrollable = variant === "scrollable";
|
|
42
|
+
return theme.unstable_sx({
|
|
43
|
+
alignItems: "stretch",
|
|
44
|
+
gap: 1,
|
|
45
|
+
justifyContent: "flex-start",
|
|
46
|
+
overflowX: "visible",
|
|
47
|
+
overflowY: scrollable ? "scroll" : "hidden",
|
|
48
|
+
paddingY: spacing,
|
|
49
|
+
[theme.breakpoints.down(mobileScrollingBreakpoint)]: {
|
|
50
|
+
overflowY: "scroll"
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
var WebAppBodyBreadcrumb = styled(FlexRow, {
|
|
55
|
+
...defaultStyledOptions,
|
|
56
|
+
name: WebAppBodyName,
|
|
57
|
+
slot: "Breadcrumb"
|
|
58
|
+
})(({ theme, disableBreadcrumbGutter, spacing }) => theme.unstable_sx({
|
|
59
|
+
justifyContent: "start",
|
|
60
|
+
marginX: disableBreadcrumbGutter ? 0 : spacing
|
|
61
|
+
}));
|
|
62
|
+
var WebAppBodyScrollableWrapper = styled(FlexGrowCol, {
|
|
63
|
+
name: WebAppBodyName,
|
|
64
|
+
slot: "ScrollableWrapper"
|
|
65
|
+
})(() => ({
|
|
66
|
+
alignItems: "stretch"
|
|
67
|
+
}));
|
|
68
|
+
var WebAppBodyScrollable = styled(FlexGrowCol, {
|
|
69
|
+
...defaultStyledOptions,
|
|
70
|
+
name: WebAppBodyName,
|
|
71
|
+
slot: "Scrollable"
|
|
72
|
+
})(({ theme, mobileScrollingBreakpoint = "sm", variant }) => {
|
|
73
|
+
const props = variant === "scrollable" ? scrollableContent : fixedContent;
|
|
74
|
+
return {
|
|
75
|
+
...props,
|
|
76
|
+
alignItems: "stretch",
|
|
77
|
+
justifyContent: "start",
|
|
78
|
+
[theme.breakpoints.down(mobileScrollingBreakpoint)]: {
|
|
79
|
+
inset: "unset",
|
|
80
|
+
position: "relative"
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
var WebAppBody = /* @__PURE__ */ __name(({ children, breadcrumbs, disableBreadcrumbGutter, mobileScrollingBreakpoint, spacing = 1, variant, ...props }) => {
|
|
85
|
+
return /* @__PURE__ */ React.createElement(WebAppBodyRoot, {
|
|
86
|
+
mobileScrollingBreakpoint,
|
|
87
|
+
spacing,
|
|
88
|
+
variant,
|
|
89
|
+
...props
|
|
90
|
+
}, breadcrumbs ? /* @__PURE__ */ React.createElement(WebAppBodyBreadcrumb, {
|
|
91
|
+
disableBreadcrumbGutter,
|
|
92
|
+
spacing
|
|
93
|
+
}, breadcrumbs) : null, /* @__PURE__ */ React.createElement(WebAppBodyScrollableWrapper, null, /* @__PURE__ */ React.createElement(WebAppBodyScrollable, {
|
|
94
|
+
mobileScrollingBreakpoint,
|
|
95
|
+
variant
|
|
96
|
+
}, children)));
|
|
97
|
+
}, "WebAppBody");
|
|
98
|
+
|
|
99
|
+
// src/components/Chrome.tsx
|
|
100
|
+
import { Divider, Paper } from "@mui/material";
|
|
101
|
+
import { FlexCol, FlexGrowCol as FlexGrowCol3, FlexGrowRow } from "@xylabs/react-flexbox";
|
|
102
|
+
import { ApplicationAppBar, SystemToolbar } from "@xyo-network/react-appbar";
|
|
103
|
+
import { Footer } from "@xyo-network/react-footer";
|
|
104
|
+
import { ErrorBoundary } from "@xyo-network/react-shared";
|
|
105
|
+
import React4, { forwardRef } from "react";
|
|
106
|
+
import { Helmet as Helmet2 } from "react-helmet";
|
|
107
|
+
|
|
108
|
+
// src/components/ErrorPage.tsx
|
|
109
|
+
import { ButtonEx } from "@xylabs/react-button";
|
|
110
|
+
import React3 from "react";
|
|
111
|
+
|
|
112
|
+
// src/components/Page.tsx
|
|
113
|
+
import { Container, styled as styled2 } from "@mui/material";
|
|
114
|
+
import { useAsyncEffect } from "@xylabs/react-async-effect";
|
|
115
|
+
import { FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
|
|
116
|
+
import { useUserEvents } from "@xylabs/react-pixel";
|
|
117
|
+
import React2 from "react";
|
|
118
|
+
import { Helmet } from "react-helmet";
|
|
119
|
+
import { useLocation } from "react-router-dom";
|
|
120
|
+
var WebAppPageRoot = styled2(FlexGrowCol2, {
|
|
121
|
+
name: "WebAppPage",
|
|
122
|
+
shouldForwardProp: /* @__PURE__ */ __name((propName) => propName !== "mobileScrollingBreakpoint" && propName !== "variant", "shouldForwardProp"),
|
|
123
|
+
slot: "Root"
|
|
124
|
+
})(({ theme, mobileScrollingBreakpoint = "sm", variant }) => {
|
|
125
|
+
const props = variant === "scrollable" ? scrollableWrap : fixedWrap;
|
|
126
|
+
return {
|
|
127
|
+
...props,
|
|
128
|
+
alignItems: "stretch",
|
|
129
|
+
justifyContent: "start",
|
|
130
|
+
maxWidth: "100vw",
|
|
131
|
+
[theme.breakpoints.down(mobileScrollingBreakpoint)]: {
|
|
132
|
+
inset: 0,
|
|
133
|
+
position: "absolute"
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
var WebAppPage = /* @__PURE__ */ __name(({ disableGutters, disableBreadcrumbGutter, title, container, children, breadcrumbs, mobileScrollingBreakpoint, variant = "scrollable", ...props }) => {
|
|
138
|
+
const userEvents = useUserEvents();
|
|
139
|
+
const { pathname } = useLocation();
|
|
140
|
+
useAsyncEffect(async () => {
|
|
141
|
+
await userEvents?.viewContent({
|
|
142
|
+
name: title ?? "NodeBasePage",
|
|
143
|
+
path: location.pathname
|
|
144
|
+
});
|
|
145
|
+
}, [
|
|
146
|
+
pathname,
|
|
147
|
+
title,
|
|
148
|
+
userEvents
|
|
149
|
+
]);
|
|
150
|
+
return /* @__PURE__ */ React2.createElement(WebAppPageRoot, {
|
|
151
|
+
mobileScrollingBreakpoint,
|
|
152
|
+
variant,
|
|
153
|
+
...props
|
|
154
|
+
}, /* @__PURE__ */ React2.createElement(Helmet, {
|
|
155
|
+
title
|
|
156
|
+
}), container && container !== "none" ? /* @__PURE__ */ React2.createElement(Container, {
|
|
157
|
+
disableGutters,
|
|
158
|
+
style: {
|
|
159
|
+
alignItems: "stretch",
|
|
160
|
+
display: "flex",
|
|
161
|
+
flexDirection: "column",
|
|
162
|
+
flexGrow: 1,
|
|
163
|
+
justifyContent: "flex-start"
|
|
164
|
+
},
|
|
165
|
+
maxWidth: container
|
|
166
|
+
}, /* @__PURE__ */ React2.createElement(WebAppBody, {
|
|
167
|
+
disableBreadcrumbGutter,
|
|
168
|
+
breadcrumbs,
|
|
169
|
+
mobileScrollingBreakpoint,
|
|
170
|
+
variant,
|
|
171
|
+
...props
|
|
172
|
+
}, children)) : /* @__PURE__ */ React2.createElement(WebAppBody, {
|
|
173
|
+
disableBreadcrumbGutter,
|
|
174
|
+
breadcrumbs,
|
|
175
|
+
mobileScrollingBreakpoint,
|
|
176
|
+
paddingX: disableGutters ? 0 : 1,
|
|
177
|
+
variant,
|
|
178
|
+
...props
|
|
179
|
+
}, children));
|
|
180
|
+
}, "WebAppPage");
|
|
181
|
+
var FlexPage = WebAppPage;
|
|
182
|
+
|
|
183
|
+
// src/components/ErrorPage.tsx
|
|
184
|
+
var WebAppErrorPage = /* @__PURE__ */ __name(({ error, ...props }) => /* @__PURE__ */ React3.createElement(WebAppPage, {
|
|
185
|
+
title: "Oops! Something went wrong",
|
|
186
|
+
...props
|
|
187
|
+
}, /* @__PURE__ */ React3.createElement("h1", null, "Oops! Something went wrong!"), /* @__PURE__ */ React3.createElement("p", null, `${error}`), /* @__PURE__ */ React3.createElement(ButtonEx, {
|
|
188
|
+
href: "/",
|
|
189
|
+
variant: "contained"
|
|
190
|
+
}, "Homepage")), "WebAppErrorPage");
|
|
191
|
+
var ErrorPage = WebAppErrorPage;
|
|
192
|
+
|
|
193
|
+
// src/components/Chrome.tsx
|
|
194
|
+
var WebAppChrome = /* @__PURE__ */ forwardRef(({ appName, appbar, children, errorBoundary, errorPage, footer, footerElevation = 4, menuItems, navigationType = "menu", ...props }, ref) => {
|
|
195
|
+
return /* @__PURE__ */ React4.createElement(FlexCol, {
|
|
196
|
+
id: "web-chrome-flex",
|
|
197
|
+
alignItems: "stretch",
|
|
198
|
+
overflow: "hidden",
|
|
199
|
+
height: "100vh",
|
|
200
|
+
ref,
|
|
201
|
+
...props
|
|
202
|
+
}, /* @__PURE__ */ React4.createElement(Helmet2, {
|
|
203
|
+
defaultTitle: appName,
|
|
204
|
+
titleTemplate: `%s | ${appName}`
|
|
205
|
+
}, /* @__PURE__ */ React4.createElement("meta", {
|
|
206
|
+
content: "website",
|
|
207
|
+
property: "og:type"
|
|
208
|
+
})), appbar ?? /* @__PURE__ */ React4.createElement(ApplicationAppBar, {
|
|
209
|
+
systemToolbar: /* @__PURE__ */ React4.createElement(SystemToolbar, {
|
|
210
|
+
menuItems: navigationType === "menu" ? menuItems : void 0
|
|
211
|
+
})
|
|
212
|
+
}), /* @__PURE__ */ React4.createElement(FlexGrowRow, {
|
|
213
|
+
id: "sidebar-nav-flex",
|
|
214
|
+
overflow: "hidden",
|
|
215
|
+
alignItems: "stretch"
|
|
216
|
+
}, navigationType === "menu" ? null : /* @__PURE__ */ React4.createElement(React4.Fragment, null, menuItems, /* @__PURE__ */ React4.createElement(Divider, {
|
|
217
|
+
orientation: "vertical"
|
|
218
|
+
})), /* @__PURE__ */ React4.createElement(FlexGrowCol3, {
|
|
219
|
+
id: "main-flex",
|
|
220
|
+
justifyContent: "flex-start",
|
|
221
|
+
alignItems: "stretch"
|
|
222
|
+
}, errorBoundary ? /* @__PURE__ */ React4.createElement(ErrorBoundary, {
|
|
223
|
+
fallbackWithError: /* @__PURE__ */ __name((error) => {
|
|
224
|
+
return errorPage ?? /* @__PURE__ */ React4.createElement(WebAppErrorPage, {
|
|
225
|
+
error
|
|
226
|
+
});
|
|
227
|
+
}, "fallbackWithError")
|
|
228
|
+
}, children) : children)), /* @__PURE__ */ React4.createElement(FlexCol, {
|
|
229
|
+
id: "footer-flex",
|
|
230
|
+
alignItems: "stretch"
|
|
231
|
+
}, /* @__PURE__ */ React4.createElement(Paper, {
|
|
232
|
+
elevation: footerElevation,
|
|
233
|
+
square: true
|
|
234
|
+
}, footer ?? /* @__PURE__ */ React4.createElement(Footer, {
|
|
235
|
+
dynamicHeight: true
|
|
236
|
+
}))));
|
|
237
|
+
});
|
|
238
|
+
WebAppChrome.displayName = "WebAppChrome";
|
|
239
|
+
|
|
240
|
+
// src/components/NotFoundPage/Page.tsx
|
|
241
|
+
import { NotFound } from "@xyo-network/react-shared";
|
|
242
|
+
import React5 from "react";
|
|
243
|
+
var WebAppNotFoundPage = /* @__PURE__ */ __name(({ title, ...props }) => /* @__PURE__ */ React5.createElement(WebAppPage, {
|
|
244
|
+
title: title ?? "Sorry! Page Not Found",
|
|
245
|
+
...props
|
|
246
|
+
}, /* @__PURE__ */ React5.createElement(NotFound, null)), "WebAppNotFoundPage");
|
|
247
|
+
var NotFoundPage = WebAppNotFoundPage;
|
|
248
|
+
export {
|
|
249
|
+
ErrorPage,
|
|
250
|
+
FlexPage,
|
|
251
|
+
NotFoundPage,
|
|
252
|
+
WebAppBody,
|
|
253
|
+
WebAppChrome,
|
|
254
|
+
WebAppErrorPage,
|
|
255
|
+
WebAppNotFoundPage,
|
|
256
|
+
WebAppPage
|
|
257
|
+
};
|
|
258
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Body.tsx","../../src/components/lib/cssValues.ts","../../src/components/Chrome.tsx","../../src/components/ErrorPage.tsx","../../src/components/Page.tsx","../../src/components/NotFoundPage/Page.tsx"],"sourcesContent":["import { Breakpoint, styled } from '@mui/material'\nimport { FlexBoxProps, FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport React, { ReactNode } from 'react'\n\nimport { fixedContent, scrollableContent } from './lib/index.ts'\n\nconst WebAppBodyName = 'WebAppBody'\nconst propsNotForwarded = new Set(['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter'])\nconst defaultStyledOptions = {\n shouldForwardProp: (prop: string) => !propsNotForwarded.has(prop),\n}\n\nconst WebAppBodyRoot = styled(FlexGrowCol, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Root',\n})<WebAppBodyProps>(({ spacing, theme, mobileScrollingBreakpoint = 'sm', variant }) => {\n const scrollable = variant === 'scrollable'\n return theme.unstable_sx({\n alignItems: 'stretch',\n gap: 1,\n justifyContent: 'flex-start',\n overflowX: 'visible',\n overflowY: scrollable ? 'scroll' : 'hidden',\n paddingY: spacing,\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: {\n overflowY: 'scroll',\n },\n })\n})\n\nconst WebAppBodyBreadcrumb = styled(FlexRow, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Breadcrumb',\n})<WebAppBodyProps>(({ theme, disableBreadcrumbGutter, spacing }) =>\n theme.unstable_sx({\n justifyContent: 'start',\n marginX: disableBreadcrumbGutter ? 0 : spacing,\n }),\n)\n\nconst WebAppBodyScrollableWrapper = styled(FlexGrowCol, {\n name: WebAppBodyName,\n slot: 'ScrollableWrapper',\n})<WebAppBodyProps>(() => ({\n alignItems: 'stretch',\n}))\n\nconst WebAppBodyScrollable = styled(FlexGrowCol, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Scrollable',\n})<WebAppBodyProps>(({ theme, mobileScrollingBreakpoint = 'sm', variant }) => {\n const props = variant === 'scrollable' ? scrollableContent : fixedContent\n return {\n ...props,\n alignItems: 'stretch',\n justifyContent: 'start',\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: {\n inset: 'unset',\n position: 'relative',\n },\n }\n})\n\nexport interface WebAppBodyProps extends FlexBoxProps {\n breadcrumbs?: ReactNode\n disableBreadcrumbGutter?: boolean\n mobileScrollingBreakpoint?: Breakpoint\n spacing?: string | number\n variant?: 'scrollable' | 'fixed'\n}\n\nexport const WebAppBody: React.FC<WebAppBodyProps> = ({\n children,\n breadcrumbs,\n disableBreadcrumbGutter,\n mobileScrollingBreakpoint,\n spacing = 1,\n variant,\n ...props\n}) => {\n return (\n <WebAppBodyRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} spacing={spacing} variant={variant} {...props}>\n {breadcrumbs\n ? (\n <WebAppBodyBreadcrumb disableBreadcrumbGutter={disableBreadcrumbGutter} spacing={spacing}>\n {breadcrumbs}\n </WebAppBodyBreadcrumb>\n )\n : null}\n <WebAppBodyScrollableWrapper>\n <WebAppBodyScrollable mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant}>\n {children}\n </WebAppBodyScrollable>\n </WebAppBodyScrollableWrapper>\n </WebAppBodyRoot>\n )\n}\n","import { CSSProperties } from 'react'\n\nexport const scrollableWrap: CSSProperties = {\n inset: 0,\n position: 'absolute',\n} as const\n\nexport const fixedWrap: CSSProperties = {\n inset: 'unset',\n position: 'relative',\n} as const\n\n// Making a scrollable vs fixed wrapper and content is an inversion of the wrap and content styles\nexport const scrollableContent: CSSProperties = {\n ...fixedWrap,\n} as const\n\nexport const fixedContent: CSSProperties = {\n ...scrollableWrap,\n} as const\n","import { Divider, Paper } from '@mui/material'\nimport { FlexBoxProps, FlexCol, FlexGrowCol, FlexGrowRow } from '@xylabs/react-flexbox'\nimport { WebAppNavigationType } from '@xyo-network/react-app-settings'\nimport { ApplicationAppBar, SystemToolbar } from '@xyo-network/react-appbar'\nimport { Footer } from '@xyo-network/react-footer'\nimport { ErrorBoundary } from '@xyo-network/react-shared'\nimport React, { forwardRef, ReactNode } from 'react'\nimport { Helmet } from 'react-helmet'\n\nimport { WebAppErrorPage } from './ErrorPage.tsx'\n\nexport interface WebAppChromeProps extends FlexBoxProps {\n appName: string\n appbar?: ReactNode\n errorBoundary?: boolean\n errorPage?: ReactNode\n footer?: ReactNode\n footerElevation?: number\n menuItems?: ReactNode\n navigationType?: WebAppNavigationType\n}\n\nexport const WebAppChrome = forwardRef<HTMLDivElement, WebAppChromeProps>(\n ({ appName, appbar, children, errorBoundary, errorPage, footer, footerElevation = 4, menuItems, navigationType = 'menu', ...props }, ref) => {\n return (\n <FlexCol id=\"web-chrome-flex\" alignItems=\"stretch\" overflow=\"hidden\" height=\"100vh\" ref={ref} {...props}>\n <Helmet defaultTitle={appName} titleTemplate={`%s | ${appName}`}>\n <meta content=\"website\" property=\"og:type\" />\n </Helmet>\n {appbar ?? <ApplicationAppBar systemToolbar={<SystemToolbar menuItems={navigationType === 'menu' ? menuItems : undefined} />} />}\n <FlexGrowRow id=\"sidebar-nav-flex\" overflow=\"hidden\" alignItems=\"stretch\">\n {navigationType === 'menu'\n ? null\n : (\n <>\n {menuItems}\n <Divider orientation=\"vertical\" />\n </>\n )}\n <FlexGrowCol id=\"main-flex\" justifyContent=\"flex-start\" alignItems=\"stretch\">\n {errorBoundary\n ? (\n <ErrorBoundary\n fallbackWithError={(error) => {\n return errorPage ?? <WebAppErrorPage error={error} />\n }}\n >\n {children}\n </ErrorBoundary>\n )\n : children}\n </FlexGrowCol>\n </FlexGrowRow>\n <FlexCol id=\"footer-flex\" alignItems=\"stretch\">\n <Paper elevation={footerElevation} square>\n {footer ?? <Footer dynamicHeight />}\n </Paper>\n </FlexCol>\n </FlexCol>\n )\n },\n)\n\nWebAppChrome.displayName = 'WebAppChrome'\n","import { ButtonEx } from '@xylabs/react-button'\nimport React from 'react'\n\nimport { WebAppPage, WebAppPageProps } from './Page.tsx'\n\nexport interface WebAppErrorPageProps extends WebAppPageProps {\n error?: Error\n}\n\nexport const WebAppErrorPage: React.FC<WebAppErrorPageProps> = ({ error, ...props }) => (\n <WebAppPage title=\"Oops! Something went wrong\" {...props}>\n <h1>Oops! Something went wrong!</h1>\n <p>{`${error}`}</p>\n <ButtonEx href=\"/\" variant=\"contained\">\n Homepage\n </ButtonEx>\n </WebAppPage>\n)\n\n/** @deprecated use WebAppErrorPage instead */\nexport const ErrorPage = WebAppErrorPage\n","import { Container, ContainerProps, styled } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport { FlexBoxProps, FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useUserEvents } from '@xylabs/react-pixel'\nimport { WithChildren } from '@xylabs/react-shared'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useLocation } from 'react-router-dom'\n\nimport { WebAppBody, WebAppBodyProps } from './Body.tsx'\nimport { fixedWrap, scrollableWrap } from './lib/index.ts'\n\nconst WebAppPageRoot = styled(FlexGrowCol, {\n name: 'WebAppPage',\n shouldForwardProp: propName => propName !== 'mobileScrollingBreakpoint' && propName !== 'variant',\n slot: 'Root',\n})<WebAppPageProps>(({ theme, mobileScrollingBreakpoint = 'sm', variant }) => {\n const props = variant === 'scrollable' ? scrollableWrap : fixedWrap\n return {\n ...props,\n alignItems: 'stretch',\n justifyContent: 'start',\n maxWidth: '100vw',\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: {\n inset: 0,\n position: 'absolute',\n },\n }\n})\n\nexport interface WebAppPageProps extends WebAppBodyProps, FlexBoxProps {\n container?: ContainerProps['maxWidth'] | 'none'\n disableGutters?: boolean\n}\n\nexport const WebAppPage: React.FC<WithChildren<WebAppPageProps>> = ({\n disableGutters,\n disableBreadcrumbGutter,\n title,\n container,\n children,\n breadcrumbs,\n mobileScrollingBreakpoint,\n variant = 'scrollable',\n ...props\n}) => {\n const userEvents = useUserEvents()\n const { pathname } = useLocation()\n\n useAsyncEffect(\n async () => {\n await userEvents?.viewContent({ name: title ?? 'NodeBasePage', path: location.pathname })\n },\n [pathname, title, userEvents],\n )\n\n return (\n <WebAppPageRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant} {...props}>\n <Helmet title={title} />\n {container && container !== 'none'\n ? (\n <Container\n disableGutters={disableGutters}\n style={{ alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start' }}\n maxWidth={container}\n >\n <WebAppBody\n disableBreadcrumbGutter={disableBreadcrumbGutter}\n breadcrumbs={breadcrumbs}\n mobileScrollingBreakpoint={mobileScrollingBreakpoint}\n variant={variant}\n {...props}\n >\n {children}\n </WebAppBody>\n </Container>\n )\n : (\n <WebAppBody\n disableBreadcrumbGutter={disableBreadcrumbGutter}\n breadcrumbs={breadcrumbs}\n mobileScrollingBreakpoint={mobileScrollingBreakpoint}\n paddingX={disableGutters ? 0 : 1}\n variant={variant}\n {...props}\n >\n {children}\n </WebAppBody>\n )}\n </WebAppPageRoot>\n )\n}\n\n/** @deprecated use WebAppPagePage instead */\nexport const FlexPage = WebAppPage\n","import { NotFound } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport { WebAppPage, WebAppPageProps } from '../Page.tsx'\n\nexport const WebAppNotFoundPage: React.FC<WebAppPageProps> = ({ title, ...props }) => (\n <WebAppPage title={title ?? 'Sorry! Page Not Found'} {...props}>\n <NotFound />\n </WebAppPage>\n)\n\n/** @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A,QAAAA,CAAAA,GAGR,gBAAAS,OAAA,cAACC,SAAAA;IAAQC,IAAG;IAAcC,YAAW;KACnC,gBAAAH,OAAA,cAACyB,OAAAA;IAAMC,WAAW/B;IAAiBgC,QAAAA;KAChCjC,UAAU,gBAAAM,OAAA,cAAC4B,QAAAA;IAAOC,eAAAA;;AAK7B,CAAA;AAGF1C,aAAa2C,cAAc;;;AG/D3B,SAASC,gBAAgB;AACzB,OAAOC,YAAW;AAIX,IAAMC,qBAAgD,wBAAC,EAAEC,OAAO,GAAGC,MAAAA,MACxE,gBAAAC,OAAA,cAACC,YAAAA;EAAWH,OAAOA,SAAS;EAA0B,GAAGC;GACvD,gBAAAC,OAAA,cAACE,UAAAA,IAAAA,CAAAA,GAFwD;AAOtD,IAAMC,eAAeN;","names":["styled","FlexGrowCol","FlexRow","React","scrollableWrap","inset","position","fixedWrap","scrollableContent","fixedContent","WebAppBodyName","propsNotForwarded","Set","defaultStyledOptions","shouldForwardProp","prop","has","WebAppBodyRoot","styled","FlexGrowCol","name","slot","spacing","theme","mobileScrollingBreakpoint","variant","scrollable","unstable_sx","alignItems","gap","justifyContent","overflowX","overflowY","paddingY","breakpoints","down","WebAppBodyBreadcrumb","FlexRow","disableBreadcrumbGutter","marginX","WebAppBodyScrollableWrapper","WebAppBodyScrollable","props","scrollableContent","fixedContent","inset","position","WebAppBody","children","breadcrumbs","Divider","Paper","FlexCol","FlexGrowCol","FlexGrowRow","ApplicationAppBar","SystemToolbar","Footer","ErrorBoundary","React","forwardRef","Helmet","ButtonEx","React","Container","styled","useAsyncEffect","FlexGrowCol","useUserEvents","React","Helmet","useLocation","WebAppPageRoot","styled","FlexGrowCol","name","shouldForwardProp","propName","slot","theme","mobileScrollingBreakpoint","variant","props","scrollableWrap","fixedWrap","alignItems","justifyContent","maxWidth","breakpoints","down","inset","position","WebAppPage","disableGutters","disableBreadcrumbGutter","title","container","children","breadcrumbs","userEvents","useUserEvents","pathname","useLocation","useAsyncEffect","viewContent","path","location","React","Helmet","Container","style","display","flexDirection","flexGrow","WebAppBody","paddingX","FlexPage","WebAppErrorPage","error","props","React","WebAppPage","title","h1","p","ButtonEx","href","variant","ErrorPage","WebAppChrome","forwardRef","appName","appbar","children","errorBoundary","errorPage","footer","footerElevation","menuItems","navigationType","props","ref","React","FlexCol","id","alignItems","overflow","height","Helmet","defaultTitle","titleTemplate","meta","content","property","ApplicationAppBar","systemToolbar","SystemToolbar","undefined","FlexGrowRow","Divider","orientation","FlexGrowCol","justifyContent","ErrorBoundary","fallbackWithError","error","WebAppErrorPage","Paper","elevation","square","Footer","dynamicHeight","displayName","NotFound","React","WebAppNotFoundPage","title","props","React","WebAppPage","NotFound","NotFoundPage"]}
|
package/package.json
CHANGED
|
@@ -10,66 +10,50 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@mui/icons-material": "^5.16.
|
|
14
|
-
"@mui/material": "^5.16.
|
|
15
|
-
"@mui/styles": "^5.16.
|
|
16
|
-
"@xylabs/react-async-effect": "^3.4.
|
|
17
|
-
"@xylabs/react-button": "^3.4.
|
|
18
|
-
"@xylabs/react-flexbox": "^3.4.
|
|
19
|
-
"@xylabs/react-pixel": "^3.4.
|
|
20
|
-
"@xylabs/react-shared": "^3.4.
|
|
21
|
-
"@xyo-network/react-app-settings": "^2.
|
|
22
|
-
"@xyo-network/react-appbar": "^2.
|
|
23
|
-
"@xyo-network/react-footer": "^2.
|
|
24
|
-
"@xyo-network/react-shared": "^2.
|
|
13
|
+
"@mui/icons-material": "^5.16.6",
|
|
14
|
+
"@mui/material": "^5.16.6",
|
|
15
|
+
"@mui/styles": "^5.16.6",
|
|
16
|
+
"@xylabs/react-async-effect": "^3.4.2",
|
|
17
|
+
"@xylabs/react-button": "^3.4.2",
|
|
18
|
+
"@xylabs/react-flexbox": "^3.4.2",
|
|
19
|
+
"@xylabs/react-pixel": "^3.4.2",
|
|
20
|
+
"@xylabs/react-shared": "^3.4.2",
|
|
21
|
+
"@xyo-network/react-app-settings": "^2.83.0",
|
|
22
|
+
"@xyo-network/react-appbar": "^2.83.0",
|
|
23
|
+
"@xyo-network/react-footer": "^2.83.0",
|
|
24
|
+
"@xyo-network/react-shared": "^2.83.0",
|
|
25
25
|
"react": "^18.3.1",
|
|
26
26
|
"react-dom": "^18.3.1",
|
|
27
27
|
"react-helmet": "^6.1.0",
|
|
28
28
|
"react-icons": "^5.2.1",
|
|
29
|
-
"react-router-dom": "^6.
|
|
29
|
+
"react-router-dom": "^6.26.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@storybook/react": "^
|
|
32
|
+
"@storybook/react": "^8.2.7",
|
|
33
33
|
"@types/react-helmet": "^6.1.11",
|
|
34
|
-
"@xylabs/react-button": "^3.4.
|
|
35
|
-
"@xylabs/react-flexbox": "^3.4.
|
|
36
|
-
"@xylabs/react-link": "^3.4.
|
|
37
|
-
"@xylabs/react-pixel": "^3.4.
|
|
38
|
-
"@xylabs/react-shared": "^3.4.
|
|
39
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
40
|
-
"@xylabs/tsconfig-react": "^
|
|
34
|
+
"@xylabs/react-button": "^3.4.2",
|
|
35
|
+
"@xylabs/react-flexbox": "^3.4.2",
|
|
36
|
+
"@xylabs/react-link": "^3.4.2",
|
|
37
|
+
"@xylabs/react-pixel": "^3.4.2",
|
|
38
|
+
"@xylabs/react-shared": "^3.4.2",
|
|
39
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.7",
|
|
40
|
+
"@xylabs/tsconfig-react": "^4.0.0-rc.7",
|
|
41
41
|
"typescript": "^5.5.4"
|
|
42
42
|
},
|
|
43
43
|
"description": "Common React library for all XYO projects that use React",
|
|
44
44
|
"docs": "dist/docs.json",
|
|
45
45
|
"exports": {
|
|
46
46
|
".": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
"default": "./dist/node/index.js"
|
|
51
|
-
},
|
|
52
|
-
"require": {
|
|
53
|
-
"types": "./dist/node/index.d.cts",
|
|
54
|
-
"default": "./dist/node/index.cjs"
|
|
55
|
-
}
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./dist/browser/index.d.ts",
|
|
49
|
+
"default": "./dist/browser/index.mjs"
|
|
56
50
|
},
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
"types": "./dist/browser/index.d.mts",
|
|
60
|
-
"default": "./dist/browser/index.js"
|
|
61
|
-
},
|
|
62
|
-
"require": {
|
|
63
|
-
"types": "./dist/browser/index.d.cts",
|
|
64
|
-
"default": "./dist/browser/index.cjs"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"default": "./dist/browser/index.js"
|
|
51
|
+
"types": "./dist/browser/index.d.ts",
|
|
52
|
+
"default": "./dist/browser/index.mjs"
|
|
68
53
|
},
|
|
69
54
|
"./package.json": "./package.json"
|
|
70
55
|
},
|
|
71
|
-
"
|
|
72
|
-
"module": "dist/browser/index.js",
|
|
56
|
+
"module": "dist/browser/index.mjs",
|
|
73
57
|
"homepage": "https://xyo.network",
|
|
74
58
|
"keywords": [
|
|
75
59
|
"xyo",
|
|
@@ -91,6 +75,6 @@
|
|
|
91
75
|
},
|
|
92
76
|
"sideEffects": false,
|
|
93
77
|
"types": "dist/browser/index.d.ts",
|
|
94
|
-
"version": "2.
|
|
78
|
+
"version": "2.83.0",
|
|
95
79
|
"type": "module"
|
|
96
80
|
}
|
package/src/components/Body.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { Breakpoint, styled } from '@mui/material'
|
|
|
2
2
|
import { FlexBoxProps, FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'
|
|
3
3
|
import React, { ReactNode } from 'react'
|
|
4
4
|
|
|
5
|
-
import { fixedContent, scrollableContent } from './lib/index.
|
|
5
|
+
import { fixedContent, scrollableContent } from './lib/index.ts'
|
|
6
6
|
|
|
7
7
|
const WebAppBodyName = 'WebAppBody'
|
|
8
8
|
const propsNotForwarded = new Set(['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter'])
|
|
@@ -83,11 +83,13 @@ export const WebAppBody: React.FC<WebAppBodyProps> = ({
|
|
|
83
83
|
}) => {
|
|
84
84
|
return (
|
|
85
85
|
<WebAppBodyRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} spacing={spacing} variant={variant} {...props}>
|
|
86
|
-
{breadcrumbs
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
{breadcrumbs
|
|
87
|
+
? (
|
|
88
|
+
<WebAppBodyBreadcrumb disableBreadcrumbGutter={disableBreadcrumbGutter} spacing={spacing}>
|
|
89
|
+
{breadcrumbs}
|
|
90
|
+
</WebAppBodyBreadcrumb>
|
|
91
|
+
)
|
|
92
|
+
: null}
|
|
91
93
|
<WebAppBodyScrollableWrapper>
|
|
92
94
|
<WebAppBodyScrollable mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant}>
|
|
93
95
|
{children}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/* eslint-disable import/no-internal-modules */
|
|
2
1
|
import { Breadcrumbs, List } from '@mui/material'
|
|
3
2
|
import { Meta, StoryFn } from '@storybook/react'
|
|
4
3
|
import { FlexRow } from '@xylabs/react-flexbox'
|
|
5
4
|
import { LinkEx } from '@xylabs/react-link'
|
|
6
5
|
import { MenuListItemContainer } from '@xyo-network/react-appbar'
|
|
6
|
+
import React from 'react'
|
|
7
7
|
import { BrowserRouter } from 'react-router-dom'
|
|
8
8
|
|
|
9
|
-
import { WebAppChrome } from './Chrome.
|
|
10
|
-
import { WebAppPage, WebAppPageProps } from './Page.
|
|
9
|
+
import { WebAppChrome } from './Chrome.tsx'
|
|
10
|
+
import { WebAppPage, WebAppPageProps } from './Page.tsx'
|
|
11
11
|
|
|
12
12
|
const StorybookEntry = {
|
|
13
13
|
argTypes: {},
|
|
@@ -22,13 +22,13 @@ const StorybookEntry = {
|
|
|
22
22
|
|
|
23
23
|
const rowArray = [32, 64, 128, 256, 512, 1024]
|
|
24
24
|
|
|
25
|
-
const Children: React.FC<WebAppPageProps> =
|
|
25
|
+
const Children: React.FC<WebAppPageProps> = props => (
|
|
26
26
|
<WebAppPage
|
|
27
|
-
breadcrumbs={
|
|
27
|
+
breadcrumbs={(
|
|
28
28
|
<Breadcrumbs>
|
|
29
29
|
<LinkEx>BreadCrumbs</LinkEx>
|
|
30
30
|
</Breadcrumbs>
|
|
31
|
-
}
|
|
31
|
+
)}
|
|
32
32
|
{...props}
|
|
33
33
|
>
|
|
34
34
|
{rowArray.map((height) => {
|
|
@@ -45,14 +45,15 @@ const Template: StoryFn<typeof WebAppChrome> = (args) => {
|
|
|
45
45
|
return (
|
|
46
46
|
<BrowserRouter>
|
|
47
47
|
<WebAppChrome
|
|
48
|
-
menuItems={
|
|
48
|
+
menuItems={(
|
|
49
49
|
<List>
|
|
50
50
|
<MenuListItemContainer primary="Hello" />
|
|
51
51
|
</List>
|
|
52
|
-
}
|
|
52
|
+
)}
|
|
53
53
|
height="calc(100vh - 2rem)"
|
|
54
54
|
{...args}
|
|
55
|
-
|
|
55
|
+
>
|
|
56
|
+
</WebAppChrome>
|
|
56
57
|
</BrowserRouter>
|
|
57
58
|
)
|
|
58
59
|
}
|
|
@@ -68,5 +69,4 @@ WithFixedSizePage.args = { children: <Children variant="fixed" />, navigationTyp
|
|
|
68
69
|
|
|
69
70
|
export { Default, DefaultSideBar, WithFixedSizePage }
|
|
70
71
|
|
|
71
|
-
// eslint-disable-next-line import/no-default-export
|
|
72
72
|
export default StorybookEntry
|
|
@@ -4,10 +4,10 @@ import { WebAppNavigationType } from '@xyo-network/react-app-settings'
|
|
|
4
4
|
import { ApplicationAppBar, SystemToolbar } from '@xyo-network/react-appbar'
|
|
5
5
|
import { Footer } from '@xyo-network/react-footer'
|
|
6
6
|
import { ErrorBoundary } from '@xyo-network/react-shared'
|
|
7
|
-
import { forwardRef, ReactNode } from 'react'
|
|
7
|
+
import React, { forwardRef, ReactNode } from 'react'
|
|
8
8
|
import { Helmet } from 'react-helmet'
|
|
9
9
|
|
|
10
|
-
import { WebAppErrorPage } from './ErrorPage.
|
|
10
|
+
import { WebAppErrorPage } from './ErrorPage.tsx'
|
|
11
11
|
|
|
12
12
|
export interface WebAppChromeProps extends FlexBoxProps {
|
|
13
13
|
appName: string
|
|
@@ -29,22 +29,26 @@ export const WebAppChrome = forwardRef<HTMLDivElement, WebAppChromeProps>(
|
|
|
29
29
|
</Helmet>
|
|
30
30
|
{appbar ?? <ApplicationAppBar systemToolbar={<SystemToolbar menuItems={navigationType === 'menu' ? menuItems : undefined} />} />}
|
|
31
31
|
<FlexGrowRow id="sidebar-nav-flex" overflow="hidden" alignItems="stretch">
|
|
32
|
-
{navigationType === 'menu'
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
{navigationType === 'menu'
|
|
33
|
+
? null
|
|
34
|
+
: (
|
|
35
|
+
<>
|
|
36
|
+
{menuItems}
|
|
37
|
+
<Divider orientation="vertical" />
|
|
38
|
+
</>
|
|
39
|
+
)}
|
|
38
40
|
<FlexGrowCol id="main-flex" justifyContent="flex-start" alignItems="stretch">
|
|
39
|
-
{errorBoundary
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
{errorBoundary
|
|
42
|
+
? (
|
|
43
|
+
<ErrorBoundary
|
|
44
|
+
fallbackWithError={(error) => {
|
|
45
|
+
return errorPage ?? <WebAppErrorPage error={error} />
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
{children}
|
|
49
|
+
</ErrorBoundary>
|
|
50
|
+
)
|
|
51
|
+
: children}
|
|
48
52
|
</FlexGrowCol>
|
|
49
53
|
</FlexGrowRow>
|
|
50
54
|
<FlexCol id="footer-flex" alignItems="stretch">
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ButtonEx } from '@xylabs/react-button'
|
|
2
|
+
import React from 'react'
|
|
2
3
|
|
|
3
|
-
import { WebAppPage, WebAppPageProps } from './Page.
|
|
4
|
+
import { WebAppPage, WebAppPageProps } from './Page.tsx'
|
|
4
5
|
|
|
5
6
|
export interface WebAppErrorPageProps extends WebAppPageProps {
|
|
6
7
|
error?: Error
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryFn } from '@storybook/react'
|
|
2
2
|
import { NotFound } from '@xyo-network/react-shared'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
|
|
4
5
|
const StorybookEntry = {
|
|
5
6
|
argTypes: {},
|
|
@@ -21,5 +22,4 @@ Default.args = {}
|
|
|
21
22
|
|
|
22
23
|
export { Default }
|
|
23
24
|
|
|
24
|
-
// eslint-disable-next-line import/no-default-export
|
|
25
25
|
export default StorybookEntry
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NotFound } from '@xyo-network/react-shared'
|
|
2
|
+
import React from 'react'
|
|
2
3
|
|
|
3
|
-
import { WebAppPage, WebAppPageProps } from '../Page.
|
|
4
|
+
import { WebAppPage, WebAppPageProps } from '../Page.tsx'
|
|
4
5
|
|
|
5
6
|
export const WebAppNotFoundPage: React.FC<WebAppPageProps> = ({ title, ...props }) => (
|
|
6
7
|
<WebAppPage title={title ?? 'Sorry! Page Not Found'} {...props}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Page.
|
|
1
|
+
export * from './Page.tsx'
|