@xyo-network/react-webapp 3.0.2 → 3.0.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.ts +13 -0
- package/dist/browser/components/Body.d.ts.map +1 -0
- package/dist/browser/components/Chrome.d.ts +16 -0
- package/dist/browser/components/Chrome.d.ts.map +1 -0
- package/dist/browser/components/ErrorPage.d.ts +8 -0
- package/dist/browser/components/ErrorPage.d.ts.map +1 -0
- package/dist/browser/components/NotFoundPage/Page.d.ts +5 -0
- package/dist/browser/components/NotFoundPage/Page.d.ts.map +1 -0
- package/dist/browser/components/NotFoundPage/index.d.ts +2 -0
- package/dist/browser/components/NotFoundPage/index.d.ts.map +1 -0
- package/dist/browser/components/Page.d.ts +12 -0
- package/dist/browser/components/Page.d.ts.map +1 -0
- package/dist/browser/components/index.d.ts +6 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/lib/cssValues.d.ts +6 -0
- package/dist/browser/components/lib/cssValues.d.ts.map +1 -0
- package/dist/browser/components/lib/index.d.ts +2 -0
- package/dist/browser/components/lib/index.d.ts.map +1 -0
- package/dist/browser/index.d.ts +2 -44
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +45 -45
- package/src/components/Body.tsx +13 -14
- package/src/components/Chrome.stories.tsx +4 -6
- package/src/components/Chrome.tsx +6 -2
- package/src/components/NotFoundPage/Page.stories.tsx +1 -5
- package/src/components/Page.tsx +6 -2
- package/src/components/lib/cssValues.ts +2 -6
- package/xy.config.ts +1 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Breakpoint } from '@mui/material';
|
|
2
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface WebAppBodyProps extends FlexBoxProps {
|
|
6
|
+
breadcrumbs?: ReactNode;
|
|
7
|
+
disableBreadcrumbGutter?: boolean;
|
|
8
|
+
mobileScrollingBreakpoint?: Breakpoint;
|
|
9
|
+
spacing?: string | number;
|
|
10
|
+
variant?: 'scrollable' | 'fixed';
|
|
11
|
+
}
|
|
12
|
+
export declare const WebAppBody: React.FC<WebAppBodyProps>;
|
|
13
|
+
//# sourceMappingURL=Body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../src/components/Body.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,MAAM,OAAO,CAAA;AA+DzB,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,yBAAyB,CAAC,EAAE,UAAU,CAAA;IACtC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAA;CACjC;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyBhD,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import type { WebAppNavigationType } from '@xyo-network/react-app-settings';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export interface WebAppChromeProps extends FlexBoxProps {
|
|
6
|
+
appName: string;
|
|
7
|
+
appbar?: ReactNode;
|
|
8
|
+
errorBoundary?: boolean;
|
|
9
|
+
errorPage?: ReactNode;
|
|
10
|
+
footer?: ReactNode;
|
|
11
|
+
footerElevation?: number;
|
|
12
|
+
menuItems?: ReactNode;
|
|
13
|
+
navigationType?: WebAppNavigationType;
|
|
14
|
+
}
|
|
15
|
+
export declare const WebAppChrome: React.ForwardRefExoticComponent<WebAppChromeProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
//# 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,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAI3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,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,0FAyCxB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WebAppPageProps } from './Page.tsx';
|
|
3
|
+
export interface WebAppErrorPageProps extends WebAppPageProps {
|
|
4
|
+
error?: Error;
|
|
5
|
+
}
|
|
6
|
+
export declare const WebAppErrorPage: React.FC<WebAppErrorPageProps>;
|
|
7
|
+
export declare const ErrorPage: React.FC<WebAppErrorPageProps>;
|
|
8
|
+
//# sourceMappingURL=ErrorPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorPage.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorPage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGjD,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAQ1D,CAAA;AAGD,eAAO,MAAM,SAAS,gCAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/Page.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAIxD,CAAA;AAGD,eAAO,MAAM,YAAY,2BAAqB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/NotFoundPage/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ContainerProps } from '@mui/material';
|
|
2
|
+
import type { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
+
import type { WithChildren } from '@xylabs/react-shared';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { WebAppBodyProps } from './Body.tsx';
|
|
6
|
+
export interface WebAppPageProps extends WebAppBodyProps, FlexBoxProps {
|
|
7
|
+
container?: ContainerProps['maxWidth'] | 'none';
|
|
8
|
+
disableGutters?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const WebAppPage: React.FC<WithChildren<WebAppPageProps>>;
|
|
11
|
+
export declare const FlexPage: React.FC<WithChildren<WebAppPageProps>>;
|
|
12
|
+
//# sourceMappingURL=Page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAwBjD,MAAM,WAAW,eAAgB,SAAQ,eAAe,EAAE,YAAY;IACpE,SAAS,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,CAAA;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,CA0D9D,CAAA;AAGD,eAAO,MAAM,QAAQ,yCAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
export declare const scrollableWrap: CSSProperties;
|
|
3
|
+
export declare const fixedWrap: CSSProperties;
|
|
4
|
+
export declare const scrollableContent: CSSProperties;
|
|
5
|
+
export declare const fixedContent: CSSProperties;
|
|
6
|
+
//# sourceMappingURL=cssValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssValues.d.ts","sourceRoot":"","sources":["../../../../src/components/lib/cssValues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C,eAAO,MAAM,cAAc,EAAE,aAGnB,CAAA;AAEV,eAAO,MAAM,SAAS,EAAE,aAGd,CAAA;AAGV,eAAO,MAAM,iBAAiB,EAAE,aAAyC,CAAA;AAEzE,eAAO,MAAM,YAAY,EAAE,aAA8C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,44 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 };
|
|
1
|
+
export * from './components/index.ts';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA"}
|
|
@@ -1 +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 type { Breakpoint } from '@mui/material'\nimport { styled } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport type { ReactNode } from 'react'\nimport React 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 type { 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 type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol, FlexGrowCol, FlexGrowRow } from '@xylabs/react-flexbox'\nimport type { 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 type { ReactNode } from 'react'\nimport React, { forwardRef } 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 type { WebAppPageProps } from './Page.tsx'\nimport { WebAppPage } 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 type { ContainerProps } from '@mui/material'\nimport { Container, styled } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useUserEvents } from '@xylabs/react-pixel'\nimport type { WithChildren } from '@xylabs/react-shared'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useLocation } from 'react-router-dom'\n\nimport type { WebAppBodyProps } from './Body.tsx'\nimport { WebAppBody } 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 type { WebAppPageProps } from '../Page.tsx'\nimport { WebAppPage } 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/** @deprecated use WebAppNotFoundPage instead */\nexport const NotFoundPage = WebAppNotFoundPage\n"],"mappings":";;;;AACA,SAASA,cAAc;AAEvB,SAASC,aAAaC,eAAe;AAErC,OAAOC,WAAW;;;ACHX,IAAMC,iBAAgC;EAC3CC,OAAO;EACPC,UAAU;AACZ;AAEO,IAAMC,YAA2B;EACtCF,OAAO;EACPC,UAAU;AACZ;AAGO,IAAME,oBAAmC;EAC9C,GAAGD;AACL;AAEO,IAAME,eAA8B;EACzC,GAAGL;AACL;;;ADVA,IAAMM,iBAAiB;AACvB,IAAMC,oBAAoB,oBAAIC,IAAI;EAAC;EAA6B;EAAW;EAAW;CAA0B;AACh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AAA,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"]}
|
|
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 type { Breakpoint } from '@mui/material'\nimport { styled } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nimport { fixedContent, scrollableContent } from './lib/index.ts'\n\nconst WebAppBodyName = 'WebAppBody'\nconst propsNotForwarded = new Set(['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter'])\nconst defaultStyledOptions = { shouldForwardProp: (prop: string) => !propsNotForwarded.has(prop) }\n\nconst WebAppBodyRoot = styled(FlexGrowCol, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Root',\n})<WebAppBodyProps>(({\n spacing, theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\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)]: { overflowY: 'scroll' },\n })\n})\n\nconst WebAppBodyBreadcrumb = styled(FlexRow, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Breadcrumb',\n})<WebAppBodyProps>(({\n theme, disableBreadcrumbGutter, spacing,\n}) =>\n theme.unstable_sx({\n justifyContent: 'start',\n marginX: disableBreadcrumbGutter ? 0 : spacing,\n }))\n\nconst WebAppBodyScrollableWrapper = styled(FlexGrowCol, {\n name: WebAppBodyName,\n slot: 'ScrollableWrapper',\n})<WebAppBodyProps>(() => ({ alignItems: 'stretch' }))\n\nconst WebAppBodyScrollable = styled(FlexGrowCol, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Scrollable',\n})<WebAppBodyProps>(({\n theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\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 type { 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 = { ...fixedWrap } as const\n\nexport const fixedContent: CSSProperties = { ...scrollableWrap } as const\n","import { Divider, Paper } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport {\n FlexCol, FlexGrowCol, FlexGrowRow,\n} from '@xylabs/react-flexbox'\nimport type { 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 type { ReactNode } from 'react'\nimport React, { forwardRef } 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 ({\n appName, appbar, children, errorBoundary, errorPage, footer, footerElevation = 4, menuItems, navigationType = 'menu', ...props\n }, 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 type { WebAppPageProps } from './Page.tsx'\nimport { WebAppPage } 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 type { ContainerProps } from '@mui/material'\nimport { Container, styled } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useUserEvents } from '@xylabs/react-pixel'\nimport type { WithChildren } from '@xylabs/react-shared'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useLocation } from 'react-router-dom'\n\nimport type { WebAppBodyProps } from './Body.tsx'\nimport { WebAppBody } 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>(({\n theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\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={{\n alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start',\n }}\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 type { WebAppPageProps } from '../Page.tsx'\nimport { WebAppPage } 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/** @deprecated use WebAppNotFoundPage instead */\nexport const NotFoundPage = WebAppNotFoundPage\n"],"mappings":";;;;AACA,SAASA,cAAc;AAEvB,SAASC,aAAaC,eAAe;AAErC,OAA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BgC,QAAAA;KAChCjC,UAAU,gBAAAM,OAAA,cAAC4B,QAAAA;IAAOC,eAAAA;;AAK7B,CAAA;AAGF1C,aAAa2C,cAAc;;;AGrE3B,SAASC,gBAAgB;AACzB,OAAOC,YAAW;AAKX,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
|
@@ -1,13 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-webapp",
|
|
3
|
+
"version": "3.0.4",
|
|
4
|
+
"description": "Common React library for all XYO projects that use React",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"xyo",
|
|
7
|
+
"utility",
|
|
8
|
+
"typescript",
|
|
9
|
+
"react"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://xyo.network",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues",
|
|
14
|
+
"email": "support@xyo.network"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
|
|
19
|
+
},
|
|
20
|
+
"license": "LGPL-3.0-only",
|
|
3
21
|
"author": {
|
|
4
|
-
"email": "support@xyo.network",
|
|
5
22
|
"name": "XYO Development Team",
|
|
23
|
+
"email": "support@xyo.network",
|
|
6
24
|
"url": "https://xyo.network"
|
|
7
25
|
},
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"type": "module",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/browser/index.d.ts",
|
|
32
|
+
"default": "./dist/browser/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"types": "./dist/browser/index.d.ts",
|
|
35
|
+
"default": "./dist/browser/index.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
"module": "dist/browser/index.mjs",
|
|
40
|
+
"types": "dist/browser/index.d.ts",
|
|
41
|
+
"scripts": {
|
|
42
|
+
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\"",
|
|
43
|
+
"lint-pkg": "npmPkgJsonLint ."
|
|
11
44
|
},
|
|
12
45
|
"dependencies": {
|
|
13
46
|
"@mui/icons-material": "^5.16.7",
|
|
@@ -18,14 +51,13 @@
|
|
|
18
51
|
"@xylabs/react-flexbox": "^4.0.3",
|
|
19
52
|
"@xylabs/react-pixel": "^4.0.3",
|
|
20
53
|
"@xylabs/react-shared": "^4.0.3",
|
|
21
|
-
"@xyo-network/react-app-settings": "^3.0.
|
|
22
|
-
"@xyo-network/react-appbar": "^3.0.
|
|
23
|
-
"@xyo-network/react-footer": "^3.0.
|
|
24
|
-
"@xyo-network/react-shared": "^3.0.
|
|
54
|
+
"@xyo-network/react-app-settings": "^3.0.4",
|
|
55
|
+
"@xyo-network/react-appbar": "^3.0.4",
|
|
56
|
+
"@xyo-network/react-footer": "^3.0.4",
|
|
57
|
+
"@xyo-network/react-shared": "^3.0.4",
|
|
25
58
|
"react": "^18.3.1",
|
|
26
59
|
"react-dom": "^18.3.1",
|
|
27
60
|
"react-helmet": "^6.1.0",
|
|
28
|
-
"react-icons": "^5.3.0",
|
|
29
61
|
"react-router-dom": "^6.26.1"
|
|
30
62
|
},
|
|
31
63
|
"devDependencies": {
|
|
@@ -36,45 +68,13 @@
|
|
|
36
68
|
"@xylabs/react-link": "^4.0.3",
|
|
37
69
|
"@xylabs/react-pixel": "^4.0.3",
|
|
38
70
|
"@xylabs/react-shared": "^4.0.3",
|
|
39
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.
|
|
40
|
-
"@xylabs/tsconfig-react": "^4.0.
|
|
71
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.7",
|
|
72
|
+
"@xylabs/tsconfig-react": "^4.0.7",
|
|
73
|
+
"storybook": "^8.2.9",
|
|
41
74
|
"typescript": "^5.5.4"
|
|
42
75
|
},
|
|
43
|
-
"description": "Common React library for all XYO projects that use React",
|
|
44
|
-
"docs": "dist/docs.json",
|
|
45
|
-
"exports": {
|
|
46
|
-
".": {
|
|
47
|
-
"import": {
|
|
48
|
-
"types": "./dist/browser/index.d.ts",
|
|
49
|
-
"default": "./dist/browser/index.mjs"
|
|
50
|
-
},
|
|
51
|
-
"types": "./dist/browser/index.d.ts",
|
|
52
|
-
"default": "./dist/browser/index.mjs"
|
|
53
|
-
},
|
|
54
|
-
"./package.json": "./package.json"
|
|
55
|
-
},
|
|
56
|
-
"module": "dist/browser/index.mjs",
|
|
57
|
-
"homepage": "https://xyo.network",
|
|
58
|
-
"keywords": [
|
|
59
|
-
"xyo",
|
|
60
|
-
"utility",
|
|
61
|
-
"typescript",
|
|
62
|
-
"react"
|
|
63
|
-
],
|
|
64
|
-
"license": "LGPL-3.0-only",
|
|
65
76
|
"publishConfig": {
|
|
66
77
|
"access": "public"
|
|
67
78
|
},
|
|
68
|
-
"
|
|
69
|
-
"type": "git",
|
|
70
|
-
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
|
|
71
|
-
},
|
|
72
|
-
"scripts": {
|
|
73
|
-
"lint-pkg": "npmPkgJsonLint .",
|
|
74
|
-
"license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
|
|
75
|
-
},
|
|
76
|
-
"sideEffects": false,
|
|
77
|
-
"types": "dist/browser/index.d.ts",
|
|
78
|
-
"version": "3.0.2",
|
|
79
|
-
"type": "module"
|
|
79
|
+
"docs": "dist/docs.json"
|
|
80
80
|
}
|
package/src/components/Body.tsx
CHANGED
|
@@ -9,15 +9,15 @@ import { fixedContent, scrollableContent } from './lib/index.ts'
|
|
|
9
9
|
|
|
10
10
|
const WebAppBodyName = 'WebAppBody'
|
|
11
11
|
const propsNotForwarded = new Set(['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter'])
|
|
12
|
-
const defaultStyledOptions = {
|
|
13
|
-
shouldForwardProp: (prop: string) => !propsNotForwarded.has(prop),
|
|
14
|
-
}
|
|
12
|
+
const defaultStyledOptions = { shouldForwardProp: (prop: string) => !propsNotForwarded.has(prop) }
|
|
15
13
|
|
|
16
14
|
const WebAppBodyRoot = styled(FlexGrowCol, {
|
|
17
15
|
...defaultStyledOptions,
|
|
18
16
|
name: WebAppBodyName,
|
|
19
17
|
slot: 'Root',
|
|
20
|
-
})<WebAppBodyProps>(({
|
|
18
|
+
})<WebAppBodyProps>(({
|
|
19
|
+
spacing, theme, mobileScrollingBreakpoint = 'sm', variant,
|
|
20
|
+
}) => {
|
|
21
21
|
const scrollable = variant === 'scrollable'
|
|
22
22
|
return theme.unstable_sx({
|
|
23
23
|
alignItems: 'stretch',
|
|
@@ -26,9 +26,7 @@ const WebAppBodyRoot = styled(FlexGrowCol, {
|
|
|
26
26
|
overflowX: 'visible',
|
|
27
27
|
overflowY: scrollable ? 'scroll' : 'hidden',
|
|
28
28
|
paddingY: spacing,
|
|
29
|
-
[theme.breakpoints.down(mobileScrollingBreakpoint)]: {
|
|
30
|
-
overflowY: 'scroll',
|
|
31
|
-
},
|
|
29
|
+
[theme.breakpoints.down(mobileScrollingBreakpoint)]: { overflowY: 'scroll' },
|
|
32
30
|
})
|
|
33
31
|
})
|
|
34
32
|
|
|
@@ -36,25 +34,26 @@ const WebAppBodyBreadcrumb = styled(FlexRow, {
|
|
|
36
34
|
...defaultStyledOptions,
|
|
37
35
|
name: WebAppBodyName,
|
|
38
36
|
slot: 'Breadcrumb',
|
|
39
|
-
})<WebAppBodyProps>(({
|
|
37
|
+
})<WebAppBodyProps>(({
|
|
38
|
+
theme, disableBreadcrumbGutter, spacing,
|
|
39
|
+
}) =>
|
|
40
40
|
theme.unstable_sx({
|
|
41
41
|
justifyContent: 'start',
|
|
42
42
|
marginX: disableBreadcrumbGutter ? 0 : spacing,
|
|
43
|
-
})
|
|
44
|
-
)
|
|
43
|
+
}))
|
|
45
44
|
|
|
46
45
|
const WebAppBodyScrollableWrapper = styled(FlexGrowCol, {
|
|
47
46
|
name: WebAppBodyName,
|
|
48
47
|
slot: 'ScrollableWrapper',
|
|
49
|
-
})<WebAppBodyProps>(() => ({
|
|
50
|
-
alignItems: 'stretch',
|
|
51
|
-
}))
|
|
48
|
+
})<WebAppBodyProps>(() => ({ alignItems: 'stretch' }))
|
|
52
49
|
|
|
53
50
|
const WebAppBodyScrollable = styled(FlexGrowCol, {
|
|
54
51
|
...defaultStyledOptions,
|
|
55
52
|
name: WebAppBodyName,
|
|
56
53
|
slot: 'Scrollable',
|
|
57
|
-
})<WebAppBodyProps>(({
|
|
54
|
+
})<WebAppBodyProps>(({
|
|
55
|
+
theme, mobileScrollingBreakpoint = 'sm', variant,
|
|
56
|
+
}) => {
|
|
58
57
|
const props = variant === 'scrollable' ? scrollableContent : fixedContent
|
|
59
58
|
return {
|
|
60
59
|
...props,
|
|
@@ -13,11 +13,7 @@ import { WebAppPage } from './Page.tsx'
|
|
|
13
13
|
const StorybookEntry = {
|
|
14
14
|
argTypes: {},
|
|
15
15
|
component: WebAppChrome,
|
|
16
|
-
parameters: {
|
|
17
|
-
docs: {
|
|
18
|
-
page: null,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
16
|
+
parameters: { docs: { page: null } },
|
|
21
17
|
title: 'webapp/WebAppChrome',
|
|
22
18
|
} as Meta<typeof WebAppChrome>
|
|
23
19
|
|
|
@@ -68,6 +64,8 @@ DefaultSideBar.args = { children: <Children />, navigationType: 'sidebar' }
|
|
|
68
64
|
const WithFixedSizePage = Template.bind({})
|
|
69
65
|
WithFixedSizePage.args = { children: <Children variant="fixed" />, navigationType: 'sidebar' }
|
|
70
66
|
|
|
71
|
-
export {
|
|
67
|
+
export {
|
|
68
|
+
Default, DefaultSideBar, WithFixedSizePage,
|
|
69
|
+
}
|
|
72
70
|
|
|
73
71
|
export default StorybookEntry
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Divider, Paper } from '@mui/material'
|
|
2
2
|
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
FlexCol, FlexGrowCol, FlexGrowRow,
|
|
5
|
+
} from '@xylabs/react-flexbox'
|
|
4
6
|
import type { WebAppNavigationType } from '@xyo-network/react-app-settings'
|
|
5
7
|
import { ApplicationAppBar, SystemToolbar } from '@xyo-network/react-appbar'
|
|
6
8
|
import { Footer } from '@xyo-network/react-footer'
|
|
@@ -23,7 +25,9 @@ export interface WebAppChromeProps extends FlexBoxProps {
|
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export const WebAppChrome = forwardRef<HTMLDivElement, WebAppChromeProps>(
|
|
26
|
-
({
|
|
28
|
+
({
|
|
29
|
+
appName, appbar, children, errorBoundary, errorPage, footer, footerElevation = 4, menuItems, navigationType = 'menu', ...props
|
|
30
|
+
}, ref) => {
|
|
27
31
|
return (
|
|
28
32
|
<FlexCol id="web-chrome-flex" alignItems="stretch" overflow="hidden" height="100vh" ref={ref} {...props}>
|
|
29
33
|
<Helmet defaultTitle={appName} titleTemplate={`%s | ${appName}`}>
|
package/src/components/Page.tsx
CHANGED
|
@@ -17,7 +17,9 @@ const WebAppPageRoot = styled(FlexGrowCol, {
|
|
|
17
17
|
name: 'WebAppPage',
|
|
18
18
|
shouldForwardProp: propName => propName !== 'mobileScrollingBreakpoint' && propName !== 'variant',
|
|
19
19
|
slot: 'Root',
|
|
20
|
-
})<WebAppPageProps>(({
|
|
20
|
+
})<WebAppPageProps>(({
|
|
21
|
+
theme, mobileScrollingBreakpoint = 'sm', variant,
|
|
22
|
+
}) => {
|
|
21
23
|
const props = variant === 'scrollable' ? scrollableWrap : fixedWrap
|
|
22
24
|
return {
|
|
23
25
|
...props,
|
|
@@ -64,7 +66,9 @@ export const WebAppPage: React.FC<WithChildren<WebAppPageProps>> = ({
|
|
|
64
66
|
? (
|
|
65
67
|
<Container
|
|
66
68
|
disableGutters={disableGutters}
|
|
67
|
-
style={{
|
|
69
|
+
style={{
|
|
70
|
+
alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start',
|
|
71
|
+
}}
|
|
68
72
|
maxWidth={container}
|
|
69
73
|
>
|
|
70
74
|
<WebAppBody
|
|
@@ -11,10 +11,6 @@ export const fixedWrap: CSSProperties = {
|
|
|
11
11
|
} as const
|
|
12
12
|
|
|
13
13
|
// Making a scrollable vs fixed wrapper and content is an inversion of the wrap and content styles
|
|
14
|
-
export const scrollableContent: CSSProperties = {
|
|
15
|
-
...fixedWrap,
|
|
16
|
-
} as const
|
|
14
|
+
export const scrollableContent: CSSProperties = { ...fixedWrap } as const
|
|
17
15
|
|
|
18
|
-
export const fixedContent: CSSProperties = {
|
|
19
|
-
...scrollableWrap,
|
|
20
|
-
} as const
|
|
16
|
+
export const fixedContent: CSSProperties = { ...scrollableWrap } as const
|