@xyo-network/react-webapp 2.64.0-rc.3 → 2.64.0-rc.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.
- package/dist/browser/components/Body.d.mts.map +1 -0
- package/dist/browser/components/Body.d.ts.map +1 -0
- package/dist/browser/components/Body.js +77 -0
- package/dist/browser/components/Body.js.map +1 -0
- package/dist/browser/components/Chrome.d.mts.map +1 -0
- package/dist/browser/components/Chrome.d.ts.map +1 -0
- package/dist/browser/components/Chrome.js +38 -0
- package/dist/browser/components/Chrome.js.map +1 -0
- package/dist/browser/components/Chrome.stories.js +53 -0
- package/dist/browser/components/Chrome.stories.js.map +1 -0
- package/dist/browser/components/ErrorPage.d.mts.map +1 -0
- package/dist/browser/components/ErrorPage.d.ts.map +1 -0
- package/dist/browser/components/ErrorPage.js +14 -0
- package/dist/browser/components/ErrorPage.js.map +1 -0
- package/dist/browser/components/NotFoundPage/Page.d.mts.map +1 -0
- package/dist/browser/components/NotFoundPage/Page.d.ts.map +1 -0
- package/dist/browser/components/NotFoundPage/Page.js +10 -0
- package/dist/browser/components/NotFoundPage/Page.js.map +1 -0
- package/dist/browser/components/NotFoundPage/Page.stories.js +23 -0
- package/dist/browser/components/NotFoundPage/Page.stories.js.map +1 -0
- package/dist/browser/components/NotFoundPage/index.d.mts.map +1 -0
- package/dist/browser/components/NotFoundPage/index.d.ts.map +1 -0
- package/dist/browser/components/NotFoundPage/index.js +2 -0
- package/dist/browser/components/NotFoundPage/index.js.map +1 -0
- package/dist/browser/components/Page.d.mts.map +1 -0
- package/dist/browser/components/Page.d.ts.map +1 -0
- package/dist/browser/components/Page.js +86 -0
- package/dist/browser/components/Page.js.map +1 -0
- package/dist/browser/components/index.d.mts.map +1 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/index.js +6 -0
- package/dist/browser/components/index.js.map +1 -0
- package/dist/browser/components/lib/cssValues.d.mts.map +1 -0
- package/dist/browser/components/lib/cssValues.d.ts.map +1 -0
- package/dist/browser/components/lib/cssValues.js +21 -0
- package/dist/browser/components/lib/cssValues.js.map +1 -0
- package/dist/browser/components/lib/index.d.mts.map +1 -0
- package/dist/browser/components/lib/index.d.ts.map +1 -0
- package/dist/browser/components/lib/index.js +2 -0
- package/dist/browser/components/lib/index.js.map +1 -0
- package/dist/{index.d.mts.map → browser/index.d.mts.map} +1 -1
- package/dist/{index.d.ts.map → browser/index.d.ts.map} +1 -1
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/node/components/Body.d.mts +12 -0
- package/dist/node/components/Body.d.mts.map +1 -0
- package/dist/node/components/Body.d.ts +12 -0
- package/dist/node/components/Body.d.ts.map +1 -0
- package/dist/node/components/Body.js +101 -0
- package/dist/node/components/Body.js.map +1 -0
- package/dist/node/components/Body.mjs +77 -0
- package/dist/node/components/Body.mjs.map +1 -0
- package/dist/node/components/Chrome.d.mts +14 -0
- package/dist/node/components/Chrome.d.mts.map +1 -0
- package/dist/node/components/Chrome.d.ts +14 -0
- package/dist/node/components/Chrome.d.ts.map +1 -0
- package/dist/node/components/Chrome.js +62 -0
- package/dist/node/components/Chrome.js.map +1 -0
- package/dist/node/components/Chrome.mjs +38 -0
- package/dist/node/components/Chrome.mjs.map +1 -0
- package/dist/node/components/Chrome.stories.js +79 -0
- package/dist/node/components/Chrome.stories.js.map +1 -0
- package/dist/node/components/Chrome.stories.mjs +53 -0
- package/dist/node/components/Chrome.stories.mjs.map +1 -0
- package/dist/node/components/ErrorPage.d.mts +9 -0
- package/dist/node/components/ErrorPage.d.mts.map +1 -0
- package/dist/node/components/ErrorPage.d.ts +9 -0
- package/dist/node/components/ErrorPage.d.ts.map +1 -0
- package/dist/node/components/ErrorPage.js +39 -0
- package/dist/node/components/ErrorPage.js.map +1 -0
- package/dist/node/components/ErrorPage.mjs +14 -0
- package/dist/node/components/ErrorPage.mjs.map +1 -0
- package/dist/node/components/NotFoundPage/Page.d.mts +6 -0
- package/dist/node/components/NotFoundPage/Page.d.mts.map +1 -0
- package/dist/node/components/NotFoundPage/Page.d.ts +6 -0
- package/dist/node/components/NotFoundPage/Page.d.ts.map +1 -0
- package/dist/node/components/NotFoundPage/Page.js +35 -0
- package/dist/node/components/NotFoundPage/Page.js.map +1 -0
- package/dist/node/components/NotFoundPage/Page.mjs +10 -0
- package/dist/node/components/NotFoundPage/Page.mjs.map +1 -0
- package/dist/node/components/NotFoundPage/Page.stories.js +47 -0
- package/dist/node/components/NotFoundPage/Page.stories.js.map +1 -0
- package/dist/node/components/NotFoundPage/Page.stories.mjs +23 -0
- package/dist/node/components/NotFoundPage/Page.stories.mjs.map +1 -0
- package/dist/node/components/NotFoundPage/index.d.mts +2 -0
- package/dist/node/components/NotFoundPage/index.d.mts.map +1 -0
- package/dist/node/components/NotFoundPage/index.d.ts +2 -0
- package/dist/node/components/NotFoundPage/index.d.ts.map +1 -0
- package/dist/node/components/NotFoundPage/index.js +23 -0
- package/dist/node/components/NotFoundPage/index.js.map +1 -0
- package/dist/node/components/NotFoundPage/index.mjs +2 -0
- package/dist/node/components/NotFoundPage/index.mjs.map +1 -0
- package/dist/node/components/Page.d.mts +13 -0
- package/dist/node/components/Page.d.mts.map +1 -0
- package/dist/node/components/Page.d.ts +13 -0
- package/dist/node/components/Page.d.ts.map +1 -0
- package/dist/node/components/Page.js +111 -0
- package/dist/node/components/Page.js.map +1 -0
- package/dist/node/components/Page.mjs +86 -0
- package/dist/node/components/Page.mjs.map +1 -0
- package/dist/node/components/index.d.mts +6 -0
- package/dist/node/components/index.d.mts.map +1 -0
- package/dist/node/components/index.d.ts +6 -0
- package/dist/node/components/index.d.ts.map +1 -0
- package/dist/node/components/index.js +31 -0
- package/dist/node/components/index.js.map +1 -0
- package/dist/node/components/index.mjs +6 -0
- package/dist/node/components/index.mjs.map +1 -0
- package/dist/node/components/lib/cssValues.d.mts +6 -0
- package/dist/node/components/lib/cssValues.d.mts.map +1 -0
- package/dist/node/components/lib/cssValues.d.ts +6 -0
- package/dist/node/components/lib/cssValues.d.ts.map +1 -0
- package/dist/node/components/lib/cssValues.js +48 -0
- package/dist/node/components/lib/cssValues.js.map +1 -0
- package/dist/node/components/lib/cssValues.mjs +21 -0
- package/dist/node/components/lib/cssValues.mjs.map +1 -0
- package/dist/node/components/lib/index.d.mts +2 -0
- package/dist/node/components/lib/index.d.mts.map +1 -0
- package/dist/node/components/lib/index.d.ts +2 -0
- package/dist/node/components/lib/index.d.ts.map +1 -0
- package/dist/node/components/lib/index.js +23 -0
- package/dist/node/components/lib/index.js.map +1 -0
- package/dist/node/components/lib/index.mjs +2 -0
- package/dist/node/components/lib/index.mjs.map +1 -0
- package/dist/node/index.d.mts +2 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +23 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/index.mjs.map +1 -0
- package/package.json +25 -25
- package/dist/components/Body.d.mts.map +0 -1
- package/dist/components/Body.d.ts.map +0 -1
- package/dist/components/Chrome.d.mts.map +0 -1
- package/dist/components/Chrome.d.ts.map +0 -1
- package/dist/components/Chrome.stories.d.mts +0 -8
- package/dist/components/Chrome.stories.d.mts.map +0 -1
- package/dist/components/Chrome.stories.d.ts +0 -8
- package/dist/components/Chrome.stories.d.ts.map +0 -1
- package/dist/components/ErrorPage.d.mts.map +0 -1
- package/dist/components/ErrorPage.d.ts.map +0 -1
- package/dist/components/NotFoundPage/Page.d.mts.map +0 -1
- package/dist/components/NotFoundPage/Page.d.ts.map +0 -1
- package/dist/components/NotFoundPage/Page.stories.d.mts +0 -5
- package/dist/components/NotFoundPage/Page.stories.d.mts.map +0 -1
- package/dist/components/NotFoundPage/Page.stories.d.ts +0 -5
- package/dist/components/NotFoundPage/Page.stories.d.ts.map +0 -1
- package/dist/components/NotFoundPage/index.d.mts.map +0 -1
- package/dist/components/NotFoundPage/index.d.ts.map +0 -1
- package/dist/components/Page.d.mts.map +0 -1
- package/dist/components/Page.d.ts.map +0 -1
- package/dist/components/index.d.mts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/lib/cssValues.d.mts.map +0 -1
- package/dist/components/lib/cssValues.d.ts.map +0 -1
- package/dist/components/lib/index.d.mts.map +0 -1
- package/dist/components/lib/index.d.ts.map +0 -1
- package/dist/index.js +0 -272
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -238
- package/dist/index.mjs.map +0 -1
- /package/dist/{components → browser/components}/Body.d.mts +0 -0
- /package/dist/{components → browser/components}/Body.d.ts +0 -0
- /package/dist/{components → browser/components}/Chrome.d.mts +0 -0
- /package/dist/{components → browser/components}/Chrome.d.ts +0 -0
- /package/dist/{components → browser/components}/ErrorPage.d.mts +0 -0
- /package/dist/{components → browser/components}/ErrorPage.d.ts +0 -0
- /package/dist/{components → browser/components}/NotFoundPage/Page.d.mts +0 -0
- /package/dist/{components → browser/components}/NotFoundPage/Page.d.ts +0 -0
- /package/dist/{components → browser/components}/NotFoundPage/index.d.mts +0 -0
- /package/dist/{components → browser/components}/NotFoundPage/index.d.ts +0 -0
- /package/dist/{components → browser/components}/Page.d.mts +0 -0
- /package/dist/{components → browser/components}/Page.d.ts +0 -0
- /package/dist/{components → browser/components}/index.d.mts +0 -0
- /package/dist/{components → browser/components}/index.d.ts +0 -0
- /package/dist/{components → browser/components}/lib/cssValues.d.mts +0 -0
- /package/dist/{components → browser/components}/lib/cssValues.d.ts +0 -0
- /package/dist/{components → browser/components}/lib/index.d.mts +0 -0
- /package/dist/{components → browser/components}/lib/index.d.ts +0 -0
- /package/dist/{index.d.mts → browser/index.d.mts} +0 -0
- /package/dist/{index.d.ts → browser/index.d.ts} +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Body_exports = {};
|
|
20
|
+
__export(Body_exports, {
|
|
21
|
+
WebAppBody: () => WebAppBody
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Body_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_material = require("@mui/material");
|
|
26
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
27
|
+
var import_lib = require("./lib");
|
|
28
|
+
const WebAppBodyName = "WebAppBody";
|
|
29
|
+
const propsNotForwarded = ["mobileScrollingBreakpoint", "variant", "spacing", "disableBreadcrumbGutter"];
|
|
30
|
+
const defaultStyledOptions = {
|
|
31
|
+
shouldForwardProp: (prop) => !propsNotForwarded.includes(prop)
|
|
32
|
+
};
|
|
33
|
+
const WebAppBodyRoot = (0, import_material.styled)(import_react_flexbox.FlexGrowCol, {
|
|
34
|
+
...defaultStyledOptions,
|
|
35
|
+
name: WebAppBodyName,
|
|
36
|
+
slot: "Root"
|
|
37
|
+
})(({ spacing, theme, mobileScrollingBreakpoint = "sm", variant }) => {
|
|
38
|
+
const scrollable = variant === "scrollable";
|
|
39
|
+
return theme.unstable_sx({
|
|
40
|
+
alignItems: "stretch",
|
|
41
|
+
gap: 1,
|
|
42
|
+
justifyContent: "flex-start",
|
|
43
|
+
overflowX: "visible",
|
|
44
|
+
overflowY: scrollable ? "scroll" : "hidden",
|
|
45
|
+
paddingY: spacing,
|
|
46
|
+
[theme.breakpoints.down(mobileScrollingBreakpoint)]: {
|
|
47
|
+
overflowY: "scroll"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
const WebAppBodyBreadcrumb = (0, import_material.styled)(import_react_flexbox.FlexRow, {
|
|
52
|
+
...defaultStyledOptions,
|
|
53
|
+
name: WebAppBodyName,
|
|
54
|
+
slot: "Breadcrumb"
|
|
55
|
+
})(
|
|
56
|
+
({ theme, disableBreadcrumbGutter, spacing }) => theme.unstable_sx({
|
|
57
|
+
justifyContent: "start",
|
|
58
|
+
marginX: disableBreadcrumbGutter ? 0 : spacing
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
const WebAppBodyScrollableWrapper = (0, import_material.styled)(import_react_flexbox.FlexGrowCol, {
|
|
62
|
+
name: WebAppBodyName,
|
|
63
|
+
slot: "ScrollableWrapper"
|
|
64
|
+
})(() => ({
|
|
65
|
+
alignItems: "stretch"
|
|
66
|
+
}));
|
|
67
|
+
const WebAppBodyScrollable = (0, import_material.styled)(import_react_flexbox.FlexGrowCol, {
|
|
68
|
+
...defaultStyledOptions,
|
|
69
|
+
name: WebAppBodyName,
|
|
70
|
+
slot: "Scrollable"
|
|
71
|
+
})(({ theme, mobileScrollingBreakpoint = "sm", variant }) => {
|
|
72
|
+
const props = variant === "scrollable" ? import_lib.scrollableContent : import_lib.fixedContent;
|
|
73
|
+
return {
|
|
74
|
+
...props,
|
|
75
|
+
alignItems: "stretch",
|
|
76
|
+
justifyContent: "start",
|
|
77
|
+
[theme.breakpoints.down(mobileScrollingBreakpoint)]: {
|
|
78
|
+
inset: "unset",
|
|
79
|
+
position: "relative"
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
const WebAppBody = ({
|
|
84
|
+
children,
|
|
85
|
+
breadcrumbs,
|
|
86
|
+
disableBreadcrumbGutter,
|
|
87
|
+
mobileScrollingBreakpoint,
|
|
88
|
+
spacing = 1,
|
|
89
|
+
variant,
|
|
90
|
+
...props
|
|
91
|
+
}) => {
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(WebAppBodyRoot, { mobileScrollingBreakpoint, spacing, variant, ...props, children: [
|
|
93
|
+
breadcrumbs ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WebAppBodyBreadcrumb, { disableBreadcrumbGutter, spacing, children: breadcrumbs }) : null,
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(WebAppBodyScrollableWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WebAppBodyScrollable, { mobileScrollingBreakpoint, variant, children }) })
|
|
95
|
+
] });
|
|
96
|
+
};
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
WebAppBody
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=Body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Body.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'\n\nconst WebAppBodyName = 'WebAppBody'\nconst propsNotForwarded = ['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter']\nconst defaultStyledOptions = {\n shouldForwardProp: (prop: string) => !propsNotForwarded.includes(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 <WebAppBodyBreadcrumb disableBreadcrumbGutter={disableBreadcrumbGutter} spacing={spacing}>\n {breadcrumbs}\n </WebAppBodyBreadcrumb>\n ) : null}\n <WebAppBodyScrollableWrapper>\n <WebAppBodyScrollable mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant}>\n {children}\n </WebAppBodyScrollable>\n </WebAppBodyScrollableWrapper>\n </WebAppBodyRoot>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoFI;AApFJ,sBAAmC;AACnC,2BAAmD;AAGnD,iBAAgD;AAEhD,MAAM,iBAAiB;AACvB,MAAM,oBAAoB,CAAC,6BAA6B,WAAW,WAAW,yBAAyB;AACvG,MAAM,uBAAuB;AAAA,EAC3B,mBAAmB,CAAC,SAAiB,CAAC,kBAAkB,SAAS,IAAI;AACvE;AAEA,MAAM,qBAAiB,wBAAO,kCAAa;AAAA,EACzC,GAAG;AAAA,EACH,MAAM;AAAA,EACN,MAAM;AACR,CAAC,EAAmB,CAAC,EAAE,SAAS,OAAO,4BAA4B,MAAM,QAAQ,MAAM;AACrF,QAAM,aAAa,YAAY;AAC/B,SAAO,MAAM,YAAY;AAAA,IACvB,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,WAAW,aAAa,WAAW;AAAA,IACnC,UAAU;AAAA,IACV,CAAC,MAAM,YAAY,KAAK,yBAAyB,CAAC,GAAG;AAAA,MACnD,WAAW;AAAA,IACb;AAAA,EACF,CAAC;AACH,CAAC;AAED,MAAM,2BAAuB,wBAAO,8BAAS;AAAA,EAC3C,GAAG;AAAA,EACH,MAAM;AAAA,EACN,MAAM;AACR,CAAC;AAAA,EAAmB,CAAC,EAAE,OAAO,yBAAyB,QAAQ,MAC7D,MAAM,YAAY;AAAA,IAChB,gBAAgB;AAAA,IAChB,SAAS,0BAA0B,IAAI;AAAA,EACzC,CAAC;AACH;AAEA,MAAM,kCAA8B,wBAAO,kCAAa;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AACR,CAAC,EAAmB,OAAO;AAAA,EACzB,YAAY;AACd,EAAE;AAEF,MAAM,2BAAuB,wBAAO,kCAAa;AAAA,EAC/C,GAAG;AAAA,EACH,MAAM;AAAA,EACN,MAAM;AACR,CAAC,EAAmB,CAAC,EAAE,OAAO,4BAA4B,MAAM,QAAQ,MAAM;AAC5E,QAAM,QAAQ,YAAY,eAAe,+BAAoB;AAC7D,SAAO;AAAA,IACL,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,CAAC,MAAM,YAAY,KAAK,yBAAyB,CAAC,GAAG;AAAA,MACnD,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AACF,CAAC;AAUM,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACE,6CAAC,kBAAe,2BAAsD,SAAkB,SAAmB,GAAG,OAC3G;AAAA,kBACC,4CAAC,wBAAqB,yBAAkD,SACrE,uBACH,IACE;AAAA,IACJ,4CAAC,+BACC,sDAAC,wBAAqB,2BAAsD,SACzE,UACH,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { styled } from "@mui/material";
|
|
3
|
+
import { FlexGrowCol, FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
+
import { fixedContent, scrollableContent } from "./lib";
|
|
5
|
+
const WebAppBodyName = "WebAppBody";
|
|
6
|
+
const propsNotForwarded = ["mobileScrollingBreakpoint", "variant", "spacing", "disableBreadcrumbGutter"];
|
|
7
|
+
const defaultStyledOptions = {
|
|
8
|
+
shouldForwardProp: (prop) => !propsNotForwarded.includes(prop)
|
|
9
|
+
};
|
|
10
|
+
const WebAppBodyRoot = styled(FlexGrowCol, {
|
|
11
|
+
...defaultStyledOptions,
|
|
12
|
+
name: WebAppBodyName,
|
|
13
|
+
slot: "Root"
|
|
14
|
+
})(({ spacing, theme, mobileScrollingBreakpoint = "sm", variant }) => {
|
|
15
|
+
const scrollable = variant === "scrollable";
|
|
16
|
+
return theme.unstable_sx({
|
|
17
|
+
alignItems: "stretch",
|
|
18
|
+
gap: 1,
|
|
19
|
+
justifyContent: "flex-start",
|
|
20
|
+
overflowX: "visible",
|
|
21
|
+
overflowY: scrollable ? "scroll" : "hidden",
|
|
22
|
+
paddingY: spacing,
|
|
23
|
+
[theme.breakpoints.down(mobileScrollingBreakpoint)]: {
|
|
24
|
+
overflowY: "scroll"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
const WebAppBodyBreadcrumb = styled(FlexRow, {
|
|
29
|
+
...defaultStyledOptions,
|
|
30
|
+
name: WebAppBodyName,
|
|
31
|
+
slot: "Breadcrumb"
|
|
32
|
+
})(
|
|
33
|
+
({ theme, disableBreadcrumbGutter, spacing }) => theme.unstable_sx({
|
|
34
|
+
justifyContent: "start",
|
|
35
|
+
marginX: disableBreadcrumbGutter ? 0 : spacing
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
const WebAppBodyScrollableWrapper = styled(FlexGrowCol, {
|
|
39
|
+
name: WebAppBodyName,
|
|
40
|
+
slot: "ScrollableWrapper"
|
|
41
|
+
})(() => ({
|
|
42
|
+
alignItems: "stretch"
|
|
43
|
+
}));
|
|
44
|
+
const WebAppBodyScrollable = styled(FlexGrowCol, {
|
|
45
|
+
...defaultStyledOptions,
|
|
46
|
+
name: WebAppBodyName,
|
|
47
|
+
slot: "Scrollable"
|
|
48
|
+
})(({ theme, mobileScrollingBreakpoint = "sm", variant }) => {
|
|
49
|
+
const props = variant === "scrollable" ? scrollableContent : fixedContent;
|
|
50
|
+
return {
|
|
51
|
+
...props,
|
|
52
|
+
alignItems: "stretch",
|
|
53
|
+
justifyContent: "start",
|
|
54
|
+
[theme.breakpoints.down(mobileScrollingBreakpoint)]: {
|
|
55
|
+
inset: "unset",
|
|
56
|
+
position: "relative"
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const WebAppBody = ({
|
|
61
|
+
children,
|
|
62
|
+
breadcrumbs,
|
|
63
|
+
disableBreadcrumbGutter,
|
|
64
|
+
mobileScrollingBreakpoint,
|
|
65
|
+
spacing = 1,
|
|
66
|
+
variant,
|
|
67
|
+
...props
|
|
68
|
+
}) => {
|
|
69
|
+
return /* @__PURE__ */ jsxs(WebAppBodyRoot, { mobileScrollingBreakpoint, spacing, variant, ...props, children: [
|
|
70
|
+
breadcrumbs ? /* @__PURE__ */ jsx(WebAppBodyBreadcrumb, { disableBreadcrumbGutter, spacing, children: breadcrumbs }) : null,
|
|
71
|
+
/* @__PURE__ */ jsx(WebAppBodyScrollableWrapper, { children: /* @__PURE__ */ jsx(WebAppBodyScrollable, { mobileScrollingBreakpoint, variant, children }) })
|
|
72
|
+
] });
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
WebAppBody
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=Body.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Body.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'\n\nconst WebAppBodyName = 'WebAppBody'\nconst propsNotForwarded = ['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter']\nconst defaultStyledOptions = {\n shouldForwardProp: (prop: string) => !propsNotForwarded.includes(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 <WebAppBodyBreadcrumb disableBreadcrumbGutter={disableBreadcrumbGutter} spacing={spacing}>\n {breadcrumbs}\n </WebAppBodyBreadcrumb>\n ) : null}\n <WebAppBodyScrollableWrapper>\n <WebAppBodyScrollable mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant}>\n {children}\n </WebAppBodyScrollable>\n </WebAppBodyScrollableWrapper>\n </WebAppBodyRoot>\n )\n}\n"],"mappings":"AAoFI,SAEI,KAFJ;AApFJ,SAAqB,cAAc;AACnC,SAAuB,aAAa,eAAe;AAGnD,SAAS,cAAc,yBAAyB;AAEhD,MAAM,iBAAiB;AACvB,MAAM,oBAAoB,CAAC,6BAA6B,WAAW,WAAW,yBAAyB;AACvG,MAAM,uBAAuB;AAAA,EAC3B,mBAAmB,CAAC,SAAiB,CAAC,kBAAkB,SAAS,IAAI;AACvE;AAEA,MAAM,iBAAiB,OAAO,aAAa;AAAA,EACzC,GAAG;AAAA,EACH,MAAM;AAAA,EACN,MAAM;AACR,CAAC,EAAmB,CAAC,EAAE,SAAS,OAAO,4BAA4B,MAAM,QAAQ,MAAM;AACrF,QAAM,aAAa,YAAY;AAC/B,SAAO,MAAM,YAAY;AAAA,IACvB,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,WAAW,aAAa,WAAW;AAAA,IACnC,UAAU;AAAA,IACV,CAAC,MAAM,YAAY,KAAK,yBAAyB,CAAC,GAAG;AAAA,MACnD,WAAW;AAAA,IACb;AAAA,EACF,CAAC;AACH,CAAC;AAED,MAAM,uBAAuB,OAAO,SAAS;AAAA,EAC3C,GAAG;AAAA,EACH,MAAM;AAAA,EACN,MAAM;AACR,CAAC;AAAA,EAAmB,CAAC,EAAE,OAAO,yBAAyB,QAAQ,MAC7D,MAAM,YAAY;AAAA,IAChB,gBAAgB;AAAA,IAChB,SAAS,0BAA0B,IAAI;AAAA,EACzC,CAAC;AACH;AAEA,MAAM,8BAA8B,OAAO,aAAa;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AACR,CAAC,EAAmB,OAAO;AAAA,EACzB,YAAY;AACd,EAAE;AAEF,MAAM,uBAAuB,OAAO,aAAa;AAAA,EAC/C,GAAG;AAAA,EACH,MAAM;AAAA,EACN,MAAM;AACR,CAAC,EAAmB,CAAC,EAAE,OAAO,4BAA4B,MAAM,QAAQ,MAAM;AAC5E,QAAM,QAAQ,YAAY,eAAe,oBAAoB;AAC7D,SAAO;AAAA,IACL,GAAG;AAAA,IACH,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,CAAC,MAAM,YAAY,KAAK,yBAAyB,CAAC,GAAG;AAAA,MACnD,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AACF,CAAC;AAUM,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACE,qBAAC,kBAAe,2BAAsD,SAAkB,SAAmB,GAAG,OAC3G;AAAA,kBACC,oBAAC,wBAAqB,yBAAkD,SACrE,uBACH,IACE;AAAA,IACJ,oBAAC,+BACC,8BAAC,wBAAqB,2BAAsD,SACzE,UACH,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import { WebAppNavigationType } from '@xyo-network/react-app-settings';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export interface WebAppChromeProps extends FlexBoxProps {
|
|
5
|
+
appName: string;
|
|
6
|
+
appbar?: ReactNode;
|
|
7
|
+
errorPage?: ReactNode;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
footerElevation?: number;
|
|
10
|
+
menuItems?: ReactNode;
|
|
11
|
+
navigationType?: WebAppNavigationType;
|
|
12
|
+
}
|
|
13
|
+
export declare const WebAppChrome: import("react").ForwardRefExoticComponent<WebAppChromeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=Chrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chrome.d.ts","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,uBAAuB,CAAA;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAItE,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7C,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,cAAc,CAAC,EAAE,oBAAoB,CAAA;CACtC;AAED,eAAO,MAAM,YAAY,8GAiCxB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import { WebAppNavigationType } from '@xyo-network/react-app-settings';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export interface WebAppChromeProps extends FlexBoxProps {
|
|
5
|
+
appName: string;
|
|
6
|
+
appbar?: ReactNode;
|
|
7
|
+
errorPage?: ReactNode;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
footerElevation?: number;
|
|
10
|
+
menuItems?: ReactNode;
|
|
11
|
+
navigationType?: WebAppNavigationType;
|
|
12
|
+
}
|
|
13
|
+
export declare const WebAppChrome: import("react").ForwardRefExoticComponent<WebAppChromeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=Chrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chrome.d.ts","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,uBAAuB,CAAA;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAItE,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAK7C,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,cAAc,CAAC,EAAE,oBAAoB,CAAA;CACtC;AAED,eAAO,MAAM,YAAY,8GAiCxB,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Chrome_exports = {};
|
|
20
|
+
__export(Chrome_exports, {
|
|
21
|
+
WebAppChrome: () => WebAppChrome
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Chrome_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_material = require("@mui/material");
|
|
26
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
27
|
+
var import_react_appbar = require("@xyo-network/react-appbar");
|
|
28
|
+
var import_react_footer = require("@xyo-network/react-footer");
|
|
29
|
+
var import_react_shared = require("@xyo-network/react-shared");
|
|
30
|
+
var import_react = require("react");
|
|
31
|
+
var import_react_helmet = require("react-helmet");
|
|
32
|
+
var import_ErrorPage = require("./ErrorPage");
|
|
33
|
+
const WebAppChrome = (0, import_react.forwardRef)(
|
|
34
|
+
({ appName, appbar, children, errorPage, footer, footerElevation = 4, menuItems, navigationType = "menu", ...props }, ref) => {
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexCol, { id: "web-chrome-flex", alignItems: "stretch", overflow: "hidden", height: "100vh", ref, ...props, children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_helmet.Helmet, { defaultTitle: appName, titleTemplate: `%s | ${appName}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("meta", { content: "website", property: "og:type" }) }),
|
|
37
|
+
appbar ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_appbar.ApplicationAppBar, { systemToolbar: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_appbar.SystemToolbar, { menuItems: navigationType === "menu" ? menuItems : void 0 }) }),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexGrowRow, { id: "sidebar-nav-flex", overflow: "hidden", alignItems: "stretch", children: [
|
|
39
|
+
navigationType !== "menu" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
40
|
+
menuItems,
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Divider, { orientation: "vertical" })
|
|
42
|
+
] }) : null,
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexGrowCol, { id: "main-flex", justifyContent: "flex-start", alignItems: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
import_react_shared.ErrorBoundary,
|
|
45
|
+
{
|
|
46
|
+
fallbackWithError: (error) => {
|
|
47
|
+
return errorPage ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ErrorPage.WebAppErrorPage, { error });
|
|
48
|
+
},
|
|
49
|
+
children
|
|
50
|
+
}
|
|
51
|
+
) })
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { id: "footer-flex", alignItems: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Paper, { elevation: footerElevation, square: true, children: footer ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_footer.Footer, { dynamicHeight: true }) }) })
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
WebAppChrome.displayName = "WebAppChrome";
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
WebAppChrome
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=Chrome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Chrome.tsx"],"sourcesContent":["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 { forwardRef, ReactNode } from 'react'\nimport { Helmet } from 'react-helmet'\n\nimport { WebAppErrorPage } from './ErrorPage'\n\nexport interface WebAppChromeProps extends FlexBoxProps {\n appName: string\n appbar?: ReactNode\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, 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 <>\n {menuItems}\n <Divider orientation=\"vertical\" />\n </>\n ) : null}\n <FlexGrowCol id=\"main-flex\" justifyContent=\"flex-start\" alignItems=\"stretch\">\n <ErrorBoundary\n fallbackWithError={(error) => {\n return errorPage ?? <WebAppErrorPage error={error} />\n }}\n >\n {children}\n </ErrorBoundary>\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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BU;AA1BV,sBAA+B;AAC/B,2BAAgE;AAEhE,0BAAiD;AACjD,0BAAuB;AACvB,0BAA8B;AAC9B,mBAAsC;AACtC,0BAAuB;AAEvB,uBAAgC;AAYzB,MAAM,mBAAe;AAAA,EAC1B,CAAC,EAAE,SAAS,QAAQ,UAAU,WAAW,QAAQ,kBAAkB,GAAG,WAAW,iBAAiB,QAAQ,GAAG,MAAM,GAAG,QAAQ;AAC5H,WACE,6CAAC,gCAAQ,IAAG,mBAAkB,YAAW,WAAU,UAAS,UAAS,QAAO,SAAQ,KAAW,GAAG,OAChG;AAAA,kDAAC,8BAAO,cAAc,SAAS,eAAe,QAAQ,OAAO,IAC3D,sDAAC,UAAK,SAAQ,WAAU,UAAS,WAAU,GAC7C;AAAA,MACC,UAAU,4CAAC,yCAAkB,eAAe,4CAAC,qCAAc,WAAW,mBAAmB,SAAS,YAAY,QAAW,GAAI;AAAA,MAC9H,6CAAC,oCAAY,IAAG,oBAAmB,UAAS,UAAS,YAAW,WAC7D;AAAA,2BAAmB,SAClB,4EACG;AAAA;AAAA,UACD,4CAAC,2BAAQ,aAAY,YAAW;AAAA,WAClC,IACE;AAAA,QACJ,4CAAC,oCAAY,IAAG,aAAY,gBAAe,cAAa,YAAW,WACjE;AAAA,UAAC;AAAA;AAAA,YACC,mBAAmB,CAAC,UAAU;AAC5B,qBAAO,aAAa,4CAAC,oCAAgB,OAAc;AAAA,YACrD;AAAA,YAEC;AAAA;AAAA,QACH,GACF;AAAA,SACF;AAAA,MACA,4CAAC,gCAAQ,IAAG,eAAc,YAAW,WACnC,sDAAC,yBAAM,WAAW,iBAAiB,QAAM,MACtC,oBAAU,4CAAC,8BAAO,eAAa,MAAC,GACnC,GACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Divider, Paper } from "@mui/material";
|
|
3
|
+
import { FlexCol, FlexGrowCol, FlexGrowRow } from "@xylabs/react-flexbox";
|
|
4
|
+
import { ApplicationAppBar, SystemToolbar } from "@xyo-network/react-appbar";
|
|
5
|
+
import { Footer } from "@xyo-network/react-footer";
|
|
6
|
+
import { ErrorBoundary } from "@xyo-network/react-shared";
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { Helmet } from "react-helmet";
|
|
9
|
+
import { WebAppErrorPage } from "./ErrorPage";
|
|
10
|
+
const WebAppChrome = forwardRef(
|
|
11
|
+
({ appName, appbar, children, errorPage, footer, footerElevation = 4, menuItems, navigationType = "menu", ...props }, ref) => {
|
|
12
|
+
return /* @__PURE__ */ jsxs(FlexCol, { id: "web-chrome-flex", alignItems: "stretch", overflow: "hidden", height: "100vh", ref, ...props, children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Helmet, { defaultTitle: appName, titleTemplate: `%s | ${appName}`, children: /* @__PURE__ */ jsx("meta", { content: "website", property: "og:type" }) }),
|
|
14
|
+
appbar ?? /* @__PURE__ */ jsx(ApplicationAppBar, { systemToolbar: /* @__PURE__ */ jsx(SystemToolbar, { menuItems: navigationType === "menu" ? menuItems : void 0 }) }),
|
|
15
|
+
/* @__PURE__ */ jsxs(FlexGrowRow, { id: "sidebar-nav-flex", overflow: "hidden", alignItems: "stretch", children: [
|
|
16
|
+
navigationType !== "menu" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
menuItems,
|
|
18
|
+
/* @__PURE__ */ jsx(Divider, { orientation: "vertical" })
|
|
19
|
+
] }) : null,
|
|
20
|
+
/* @__PURE__ */ jsx(FlexGrowCol, { id: "main-flex", justifyContent: "flex-start", alignItems: "stretch", children: /* @__PURE__ */ jsx(
|
|
21
|
+
ErrorBoundary,
|
|
22
|
+
{
|
|
23
|
+
fallbackWithError: (error) => {
|
|
24
|
+
return errorPage ?? /* @__PURE__ */ jsx(WebAppErrorPage, { error });
|
|
25
|
+
},
|
|
26
|
+
children
|
|
27
|
+
}
|
|
28
|
+
) })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsx(FlexCol, { id: "footer-flex", alignItems: "stretch", children: /* @__PURE__ */ jsx(Paper, { elevation: footerElevation, square: true, children: footer ?? /* @__PURE__ */ jsx(Footer, { dynamicHeight: true }) }) })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
WebAppChrome.displayName = "WebAppChrome";
|
|
35
|
+
export {
|
|
36
|
+
WebAppChrome
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=Chrome.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Chrome.tsx"],"sourcesContent":["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 { forwardRef, ReactNode } from 'react'\nimport { Helmet } from 'react-helmet'\n\nimport { WebAppErrorPage } from './ErrorPage'\n\nexport interface WebAppChromeProps extends FlexBoxProps {\n appName: string\n appbar?: ReactNode\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, 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 <>\n {menuItems}\n <Divider orientation=\"vertical\" />\n </>\n ) : null}\n <FlexGrowCol id=\"main-flex\" justifyContent=\"flex-start\" alignItems=\"stretch\">\n <ErrorBoundary\n fallbackWithError={(error) => {\n return errorPage ?? <WebAppErrorPage error={error} />\n }}\n >\n {children}\n </ErrorBoundary>\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"],"mappings":"AA0BU,SAKE,UALF,KAKE,YALF;AA1BV,SAAS,SAAS,aAAa;AAC/B,SAAuB,SAAS,aAAa,mBAAmB;AAEhE,SAAS,mBAAmB,qBAAqB;AACjD,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,kBAA6B;AACtC,SAAS,cAAc;AAEvB,SAAS,uBAAuB;AAYzB,MAAM,eAAe;AAAA,EAC1B,CAAC,EAAE,SAAS,QAAQ,UAAU,WAAW,QAAQ,kBAAkB,GAAG,WAAW,iBAAiB,QAAQ,GAAG,MAAM,GAAG,QAAQ;AAC5H,WACE,qBAAC,WAAQ,IAAG,mBAAkB,YAAW,WAAU,UAAS,UAAS,QAAO,SAAQ,KAAW,GAAG,OAChG;AAAA,0BAAC,UAAO,cAAc,SAAS,eAAe,QAAQ,OAAO,IAC3D,8BAAC,UAAK,SAAQ,WAAU,UAAS,WAAU,GAC7C;AAAA,MACC,UAAU,oBAAC,qBAAkB,eAAe,oBAAC,iBAAc,WAAW,mBAAmB,SAAS,YAAY,QAAW,GAAI;AAAA,MAC9H,qBAAC,eAAY,IAAG,oBAAmB,UAAS,UAAS,YAAW,WAC7D;AAAA,2BAAmB,SAClB,iCACG;AAAA;AAAA,UACD,oBAAC,WAAQ,aAAY,YAAW;AAAA,WAClC,IACE;AAAA,QACJ,oBAAC,eAAY,IAAG,aAAY,gBAAe,cAAa,YAAW,WACjE;AAAA,UAAC;AAAA;AAAA,YACC,mBAAmB,CAAC,UAAU;AAC5B,qBAAO,aAAa,oBAAC,mBAAgB,OAAc;AAAA,YACrD;AAAA,YAEC;AAAA;AAAA,QACH,GACF;AAAA,SACF;AAAA,MACA,oBAAC,WAAQ,IAAG,eAAc,YAAW,WACnC,8BAAC,SAAM,WAAW,iBAAiB,QAAM,MACtC,oBAAU,oBAAC,UAAO,eAAa,MAAC,GACnC,GACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;","names":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Chrome_stories_exports = {};
|
|
20
|
+
__export(Chrome_stories_exports, {
|
|
21
|
+
Default: () => Default,
|
|
22
|
+
DefaultSideBar: () => DefaultSideBar,
|
|
23
|
+
WithFixedSizePage: () => WithFixedSizePage,
|
|
24
|
+
default: () => Chrome_stories_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(Chrome_stories_exports);
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var import_material = require("@mui/material");
|
|
29
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
30
|
+
var import_react_link = require("@xylabs/react-link");
|
|
31
|
+
var import_react_appbar = require("@xyo-network/react-appbar");
|
|
32
|
+
var import_react_router_dom = require("react-router-dom");
|
|
33
|
+
var import_Chrome = require("./Chrome");
|
|
34
|
+
var import_Page = require("./Page");
|
|
35
|
+
const StorybookEntry = {
|
|
36
|
+
argTypes: {},
|
|
37
|
+
component: import_Chrome.WebAppChrome,
|
|
38
|
+
parameters: {
|
|
39
|
+
docs: {
|
|
40
|
+
page: null
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
title: "webapp/WebAppChrome"
|
|
44
|
+
};
|
|
45
|
+
const rowArray = [32, 64, 128, 256, 512, 1024];
|
|
46
|
+
const Children = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
import_Page.WebAppPage,
|
|
48
|
+
{
|
|
49
|
+
breadcrumbs: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Breadcrumbs, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_link.LinkEx, { children: "BreadCrumbs" }) }),
|
|
50
|
+
...props,
|
|
51
|
+
children: rowArray.map((height) => {
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexRow, { height, children: height }, height);
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
const Template = (args) => {
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.BrowserRouter, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
+
import_Chrome.WebAppChrome,
|
|
59
|
+
{
|
|
60
|
+
menuItems: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.List, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_appbar.MenuListItemContainer, { primary: "Hello" }) }),
|
|
61
|
+
height: "calc(100vh - 2rem)",
|
|
62
|
+
...args
|
|
63
|
+
}
|
|
64
|
+
) });
|
|
65
|
+
};
|
|
66
|
+
const Default = Template.bind({});
|
|
67
|
+
Default.args = {};
|
|
68
|
+
const DefaultSideBar = Template.bind({});
|
|
69
|
+
DefaultSideBar.args = { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Children, {}), navigationType: "sidebar" };
|
|
70
|
+
const WithFixedSizePage = Template.bind({});
|
|
71
|
+
WithFixedSizePage.args = { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Children, { variant: "fixed" }), navigationType: "sidebar" };
|
|
72
|
+
var Chrome_stories_default = StorybookEntry;
|
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
+
0 && (module.exports = {
|
|
75
|
+
Default,
|
|
76
|
+
DefaultSideBar,
|
|
77
|
+
WithFixedSizePage
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=Chrome.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Chrome.stories.tsx"],"sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport { Breadcrumbs, List } from '@mui/material'\nimport { Meta, StoryFn } from '@storybook/react'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { MenuListItemContainer } from '@xyo-network/react-appbar'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport { WebAppChrome } from './Chrome'\nimport { WebAppPage, WebAppPageProps } from './Page'\n\nconst StorybookEntry = {\n argTypes: {},\n component: WebAppChrome,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'webapp/WebAppChrome',\n} as Meta<typeof WebAppChrome>\n\nconst rowArray = [32, 64, 128, 256, 512, 1024]\n\nconst Children: React.FC<WebAppPageProps> = (props) => (\n <WebAppPage\n breadcrumbs={\n <Breadcrumbs>\n <LinkEx>BreadCrumbs</LinkEx>\n </Breadcrumbs>\n }\n {...props}\n >\n {rowArray.map((height) => {\n return (\n <FlexRow key={height} height={height}>\n {height}\n </FlexRow>\n )\n })}\n </WebAppPage>\n)\n\nconst Template: StoryFn<typeof WebAppChrome> = (args) => {\n return (\n <BrowserRouter>\n <WebAppChrome\n menuItems={\n <List>\n <MenuListItemContainer primary=\"Hello\" />\n </List>\n }\n height=\"calc(100vh - 2rem)\"\n {...args}\n ></WebAppChrome>\n </BrowserRouter>\n )\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nconst DefaultSideBar = Template.bind({})\nDefaultSideBar.args = { children: <Children />, navigationType: 'sidebar' }\n\nconst WithFixedSizePage = Template.bind({})\nWithFixedSizePage.args = { children: <Children variant=\"fixed\" />, navigationType: 'sidebar' }\n\nexport { Default, DefaultSideBar, WithFixedSizePage }\n\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BQ;AA3BR,sBAAkC;AAElC,2BAAwB;AACxB,wBAAuB;AACvB,0BAAsC;AACtC,8BAA8B;AAE9B,oBAA6B;AAC7B,kBAA4C;AAE5C,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,WAAW,CAAC,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI;AAE7C,MAAM,WAAsC,CAAC,UAC3C;AAAA,EAAC;AAAA;AAAA,IACC,aACE,4CAAC,+BACC,sDAAC,4BAAO,yBAAW,GACrB;AAAA,IAED,GAAG;AAAA,IAEH,mBAAS,IAAI,CAAC,WAAW;AACxB,aACE,4CAAC,gCAAqB,QACnB,oBADW,MAEd;AAAA,IAEJ,CAAC;AAAA;AACH;AAGF,MAAM,WAAyC,CAAC,SAAS;AACvD,SACE,4CAAC,yCACC;AAAA,IAAC;AAAA;AAAA,MACC,WACE,4CAAC,wBACC,sDAAC,6CAAsB,SAAQ,SAAQ,GACzC;AAAA,MAEF,QAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACL,GACH;AAEJ;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAEhB,MAAM,iBAAiB,SAAS,KAAK,CAAC,CAAC;AACvC,eAAe,OAAO,EAAE,UAAU,4CAAC,YAAS,GAAI,gBAAgB,UAAU;AAE1E,MAAM,oBAAoB,SAAS,KAAK,CAAC,CAAC;AAC1C,kBAAkB,OAAO,EAAE,UAAU,4CAAC,YAAS,SAAQ,SAAQ,GAAI,gBAAgB,UAAU;AAK7F,IAAO,yBAAQ;","names":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Breadcrumbs, List } from "@mui/material";
|
|
3
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
4
|
+
import { LinkEx } from "@xylabs/react-link";
|
|
5
|
+
import { MenuListItemContainer } from "@xyo-network/react-appbar";
|
|
6
|
+
import { BrowserRouter } from "react-router-dom";
|
|
7
|
+
import { WebAppChrome } from "./Chrome";
|
|
8
|
+
import { WebAppPage } from "./Page";
|
|
9
|
+
const StorybookEntry = {
|
|
10
|
+
argTypes: {},
|
|
11
|
+
component: WebAppChrome,
|
|
12
|
+
parameters: {
|
|
13
|
+
docs: {
|
|
14
|
+
page: null
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
title: "webapp/WebAppChrome"
|
|
18
|
+
};
|
|
19
|
+
const rowArray = [32, 64, 128, 256, 512, 1024];
|
|
20
|
+
const Children = (props) => /* @__PURE__ */ jsx(
|
|
21
|
+
WebAppPage,
|
|
22
|
+
{
|
|
23
|
+
breadcrumbs: /* @__PURE__ */ jsx(Breadcrumbs, { children: /* @__PURE__ */ jsx(LinkEx, { children: "BreadCrumbs" }) }),
|
|
24
|
+
...props,
|
|
25
|
+
children: rowArray.map((height) => {
|
|
26
|
+
return /* @__PURE__ */ jsx(FlexRow, { height, children: height }, height);
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
const Template = (args) => {
|
|
31
|
+
return /* @__PURE__ */ jsx(BrowserRouter, { children: /* @__PURE__ */ jsx(
|
|
32
|
+
WebAppChrome,
|
|
33
|
+
{
|
|
34
|
+
menuItems: /* @__PURE__ */ jsx(List, { children: /* @__PURE__ */ jsx(MenuListItemContainer, { primary: "Hello" }) }),
|
|
35
|
+
height: "calc(100vh - 2rem)",
|
|
36
|
+
...args
|
|
37
|
+
}
|
|
38
|
+
) });
|
|
39
|
+
};
|
|
40
|
+
const Default = Template.bind({});
|
|
41
|
+
Default.args = {};
|
|
42
|
+
const DefaultSideBar = Template.bind({});
|
|
43
|
+
DefaultSideBar.args = { children: /* @__PURE__ */ jsx(Children, {}), navigationType: "sidebar" };
|
|
44
|
+
const WithFixedSizePage = Template.bind({});
|
|
45
|
+
WithFixedSizePage.args = { children: /* @__PURE__ */ jsx(Children, { variant: "fixed" }), navigationType: "sidebar" };
|
|
46
|
+
var Chrome_stories_default = StorybookEntry;
|
|
47
|
+
export {
|
|
48
|
+
Default,
|
|
49
|
+
DefaultSideBar,
|
|
50
|
+
WithFixedSizePage,
|
|
51
|
+
Chrome_stories_default as default
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=Chrome.stories.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Chrome.stories.tsx"],"sourcesContent":["/* eslint-disable import/no-internal-modules */\nimport { Breadcrumbs, List } from '@mui/material'\nimport { Meta, StoryFn } from '@storybook/react'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport { LinkEx } from '@xylabs/react-link'\nimport { MenuListItemContainer } from '@xyo-network/react-appbar'\nimport { BrowserRouter } from 'react-router-dom'\n\nimport { WebAppChrome } from './Chrome'\nimport { WebAppPage, WebAppPageProps } from './Page'\n\nconst StorybookEntry = {\n argTypes: {},\n component: WebAppChrome,\n parameters: {\n docs: {\n page: null,\n },\n },\n title: 'webapp/WebAppChrome',\n} as Meta<typeof WebAppChrome>\n\nconst rowArray = [32, 64, 128, 256, 512, 1024]\n\nconst Children: React.FC<WebAppPageProps> = (props) => (\n <WebAppPage\n breadcrumbs={\n <Breadcrumbs>\n <LinkEx>BreadCrumbs</LinkEx>\n </Breadcrumbs>\n }\n {...props}\n >\n {rowArray.map((height) => {\n return (\n <FlexRow key={height} height={height}>\n {height}\n </FlexRow>\n )\n })}\n </WebAppPage>\n)\n\nconst Template: StoryFn<typeof WebAppChrome> = (args) => {\n return (\n <BrowserRouter>\n <WebAppChrome\n menuItems={\n <List>\n <MenuListItemContainer primary=\"Hello\" />\n </List>\n }\n height=\"calc(100vh - 2rem)\"\n {...args}\n ></WebAppChrome>\n </BrowserRouter>\n )\n}\n\nconst Default = Template.bind({})\nDefault.args = {}\n\nconst DefaultSideBar = Template.bind({})\nDefaultSideBar.args = { children: <Children />, navigationType: 'sidebar' }\n\nconst WithFixedSizePage = Template.bind({})\nWithFixedSizePage.args = { children: <Children variant=\"fixed\" />, navigationType: 'sidebar' }\n\nexport { Default, DefaultSideBar, WithFixedSizePage }\n\n// eslint-disable-next-line import/no-default-export\nexport default StorybookEntry\n"],"mappings":"AA4BQ;AA3BR,SAAS,aAAa,YAAY;AAElC,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAE9B,SAAS,oBAAoB;AAC7B,SAAS,kBAAmC;AAE5C,MAAM,iBAAiB;AAAA,EACrB,UAAU,CAAC;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,IACV,MAAM;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,OAAO;AACT;AAEA,MAAM,WAAW,CAAC,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI;AAE7C,MAAM,WAAsC,CAAC,UAC3C;AAAA,EAAC;AAAA;AAAA,IACC,aACE,oBAAC,eACC,8BAAC,UAAO,yBAAW,GACrB;AAAA,IAED,GAAG;AAAA,IAEH,mBAAS,IAAI,CAAC,WAAW;AACxB,aACE,oBAAC,WAAqB,QACnB,oBADW,MAEd;AAAA,IAEJ,CAAC;AAAA;AACH;AAGF,MAAM,WAAyC,CAAC,SAAS;AACvD,SACE,oBAAC,iBACC;AAAA,IAAC;AAAA;AAAA,MACC,WACE,oBAAC,QACC,8BAAC,yBAAsB,SAAQ,SAAQ,GACzC;AAAA,MAEF,QAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACL,GACH;AAEJ;AAEA,MAAM,UAAU,SAAS,KAAK,CAAC,CAAC;AAChC,QAAQ,OAAO,CAAC;AAEhB,MAAM,iBAAiB,SAAS,KAAK,CAAC,CAAC;AACvC,eAAe,OAAO,EAAE,UAAU,oBAAC,YAAS,GAAI,gBAAgB,UAAU;AAE1E,MAAM,oBAAoB,SAAS,KAAK,CAAC,CAAC;AAC1C,kBAAkB,OAAO,EAAE,UAAU,oBAAC,YAAS,SAAQ,SAAQ,GAAI,gBAAgB,UAAU;AAK7F,IAAO,yBAAQ;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebAppPageProps } from './Page';
|
|
3
|
+
export interface WebAppErrorPageProps extends WebAppPageProps {
|
|
4
|
+
error?: Error;
|
|
5
|
+
}
|
|
6
|
+
export declare const WebAppErrorPage: React.FC<WebAppErrorPageProps>;
|
|
7
|
+
/** @deprecated use WebAppErrorPage instead */
|
|
8
|
+
export declare const ErrorPage: import("react").FC<WebAppErrorPageProps>;
|
|
9
|
+
//# sourceMappingURL=ErrorPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorPage.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPage.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAc,eAAe,EAAE,MAAM,QAAQ,CAAA;AAEpD,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAQ1D,CAAA;AAED,8CAA8C;AAC9C,eAAO,MAAM,SAAS,0CAAkB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebAppPageProps } from './Page';
|
|
3
|
+
export interface WebAppErrorPageProps extends WebAppPageProps {
|
|
4
|
+
error?: Error;
|
|
5
|
+
}
|
|
6
|
+
export declare const WebAppErrorPage: React.FC<WebAppErrorPageProps>;
|
|
7
|
+
/** @deprecated use WebAppErrorPage instead */
|
|
8
|
+
export declare const ErrorPage: import("react").FC<WebAppErrorPageProps>;
|
|
9
|
+
//# sourceMappingURL=ErrorPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorPage.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPage.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAc,eAAe,EAAE,MAAM,QAAQ,CAAA;AAEpD,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAQ1D,CAAA;AAED,8CAA8C;AAC9C,eAAO,MAAM,SAAS,0CAAkB,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var ErrorPage_exports = {};
|
|
20
|
+
__export(ErrorPage_exports, {
|
|
21
|
+
ErrorPage: () => ErrorPage,
|
|
22
|
+
WebAppErrorPage: () => WebAppErrorPage
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ErrorPage_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react_button = require("@xylabs/react-button");
|
|
27
|
+
var import_Page = require("./Page");
|
|
28
|
+
const WebAppErrorPage = ({ error, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Page.WebAppPage, { title: "Oops! Something went wrong", ...props, children: [
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { children: "Oops! Something went wrong!" }),
|
|
30
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: `${error}` }),
|
|
31
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_button.ButtonEx, { href: "/", variant: "contained", children: "Homepage" })
|
|
32
|
+
] });
|
|
33
|
+
const ErrorPage = WebAppErrorPage;
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
ErrorPage,
|
|
37
|
+
WebAppErrorPage
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=ErrorPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ErrorPage.tsx"],"sourcesContent":["import { ButtonEx } from '@xylabs/react-button'\n\nimport { WebAppPage, WebAppPageProps } from './Page'\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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASE;AATF,0BAAyB;AAEzB,kBAA4C;AAMrC,MAAM,kBAAkD,CAAC,EAAE,OAAO,GAAG,MAAM,MAChF,6CAAC,0BAAW,OAAM,8BAA8B,GAAG,OACjD;AAAA,8CAAC,QAAG,yCAA2B;AAAA,EAC/B,4CAAC,OAAG,aAAG,KAAK,IAAG;AAAA,EACf,4CAAC,gCAAS,MAAK,KAAI,SAAQ,aAAY,sBAEvC;AAAA,GACF;AAIK,MAAM,YAAY;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonEx } from "@xylabs/react-button";
|
|
3
|
+
import { WebAppPage } from "./Page";
|
|
4
|
+
const WebAppErrorPage = ({ error, ...props }) => /* @__PURE__ */ jsxs(WebAppPage, { title: "Oops! Something went wrong", ...props, children: [
|
|
5
|
+
/* @__PURE__ */ jsx("h1", { children: "Oops! Something went wrong!" }),
|
|
6
|
+
/* @__PURE__ */ jsx("p", { children: `${error}` }),
|
|
7
|
+
/* @__PURE__ */ jsx(ButtonEx, { href: "/", variant: "contained", children: "Homepage" })
|
|
8
|
+
] });
|
|
9
|
+
const ErrorPage = WebAppErrorPage;
|
|
10
|
+
export {
|
|
11
|
+
ErrorPage,
|
|
12
|
+
WebAppErrorPage
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=ErrorPage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ErrorPage.tsx"],"sourcesContent":["import { ButtonEx } from '@xylabs/react-button'\n\nimport { WebAppPage, WebAppPageProps } from './Page'\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"],"mappings":"AASE,SACE,KADF;AATF,SAAS,gBAAgB;AAEzB,SAAS,kBAAmC;AAMrC,MAAM,kBAAkD,CAAC,EAAE,OAAO,GAAG,MAAM,MAChF,qBAAC,cAAW,OAAM,8BAA8B,GAAG,OACjD;AAAA,sBAAC,QAAG,yCAA2B;AAAA,EAC/B,oBAAC,OAAG,aAAG,KAAK,IAAG;AAAA,EACf,oBAAC,YAAS,MAAK,KAAI,SAAQ,aAAY,sBAEvC;AAAA,GACF;AAIK,MAAM,YAAY;","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebAppPageProps } from '../Page';
|
|
3
|
+
export declare const WebAppNotFoundPage: React.FC<WebAppPageProps>;
|
|
4
|
+
/** @deprecated use WebAppNotFoundPage instead */
|
|
5
|
+
export declare const NotFoundPage: import("react").FC<WebAppPageProps>;
|
|
6
|
+
//# sourceMappingURL=Page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/Page.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAc,eAAe,EAAE,MAAM,SAAS,CAAA;AAErD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAIxD,CAAA;AAED,kDAAkD;AAClD,eAAO,MAAM,YAAY,qCAAqB,CAAA"}
|