@xyo-network/react-webapp 2.37.4 → 2.37.6

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.
Files changed (37) hide show
  1. package/dist/cjs/components/Body.d.ts +2 -1
  2. package/dist/cjs/components/Body.d.ts.map +1 -1
  3. package/dist/cjs/components/Body.js +25 -22
  4. package/dist/cjs/components/Body.js.map +1 -1
  5. package/dist/cjs/components/Page.d.ts.map +1 -1
  6. package/dist/cjs/components/Page.js +11 -14
  7. package/dist/cjs/components/Page.js.map +1 -1
  8. package/dist/cjs/components/lib/cssValues.d.ts +6 -0
  9. package/dist/cjs/components/lib/cssValues.d.ts.map +1 -0
  10. package/dist/cjs/components/lib/cssValues.js +15 -0
  11. package/dist/cjs/components/lib/cssValues.js.map +1 -0
  12. package/dist/cjs/components/lib/index.d.ts +2 -0
  13. package/dist/cjs/components/lib/index.d.ts.map +1 -0
  14. package/dist/cjs/components/lib/index.js +5 -0
  15. package/dist/cjs/components/lib/index.js.map +1 -0
  16. package/dist/docs.json +1950 -1915
  17. package/dist/esm/components/Body.d.ts +2 -1
  18. package/dist/esm/components/Body.d.ts.map +1 -1
  19. package/dist/esm/components/Body.js +32 -24
  20. package/dist/esm/components/Body.js.map +1 -1
  21. package/dist/esm/components/Page.d.ts.map +1 -1
  22. package/dist/esm/components/Page.js +17 -14
  23. package/dist/esm/components/Page.js.map +1 -1
  24. package/dist/esm/components/lib/cssValues.d.ts +6 -0
  25. package/dist/esm/components/lib/cssValues.d.ts.map +1 -0
  26. package/dist/esm/components/lib/cssValues.js +16 -0
  27. package/dist/esm/components/lib/cssValues.js.map +1 -0
  28. package/dist/esm/components/lib/index.d.ts +2 -0
  29. package/dist/esm/components/lib/index.d.ts.map +1 -0
  30. package/dist/esm/components/lib/index.js +2 -0
  31. package/dist/esm/components/lib/index.js.map +1 -0
  32. package/package.json +5 -5
  33. package/src/components/Body.tsx +33 -22
  34. package/src/components/Chrome.stories.tsx +3 -3
  35. package/src/components/Page.tsx +22 -16
  36. package/src/components/lib/cssValues.ts +20 -0
  37. package/src/components/lib/index.ts +1 -0
@@ -5,7 +5,8 @@ export interface WebAppBodyProps extends FlexBoxProps {
5
5
  breadcrumbs?: ReactNode;
6
6
  disableBreadcrumbGutter?: boolean;
7
7
  spacing?: string | number;
8
- scrollingBreakpoint?: Breakpoint;
8
+ mobileScrollingBreakpoint?: Breakpoint;
9
+ variant?: 'scrollable' | 'fixed';
9
10
  }
10
11
  export declare const WebAppBody: React.FC<WebAppBodyProps>;
11
12
  //# sourceMappingURL=Body.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../src/components/Body.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiC,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,YAAY,EAAwB,MAAM,uBAAuB,CAAA;AAC1E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAwDxC,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,mBAAmB,CAAC,EAAE,UAAU,CAAA;CACjC;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoBhD,CAAA"}
1
+ {"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../src/components/Body.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiC,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,YAAY,EAAwB,MAAM,uBAAuB,CAAA;AAC1E,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AA+DxC,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,yBAAyB,CAAC,EAAE,UAAU,CAAA;IACtC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAA;CACjC;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuBhD,CAAA"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { experimental_sx as sx, styled } from '@mui/material';
3
3
  import { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox';
4
+ import { fixedContent, scrollableContent } from './lib';
4
5
  const WebAppBodyName = 'WebAppBody';
5
- const propsNotForwarded = ['scrollingBreakpoint', 'spacing', 'disableBreadcrumbGutter'];
6
+ const propsNotForwarded = ['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter'];
6
7
  const defaultStyledOptions = {
7
8
  shouldForwardProp: (prop) => !propsNotForwarded.includes(prop),
8
9
  };
@@ -10,16 +11,19 @@ const WebAppBodyRoot = styled(FlexGrowCol, {
10
11
  ...defaultStyledOptions,
11
12
  name: WebAppBodyName,
12
13
  slot: 'Root',
13
- })(({ spacing, theme, scrollingBreakpoint = 'sm' }) => sx({
14
- alignItems: 'stretch',
15
- gap: 1,
16
- justifyContent: 'flex-start',
17
- overflow: 'hidden',
18
- paddingY: spacing,
19
- [theme.breakpoints.down(scrollingBreakpoint)]: {
20
- overflow: 'scroll',
21
- },
22
- }));
14
+ })(({ spacing, theme, mobileScrollingBreakpoint = 'sm', variant }) => {
15
+ const scrollable = variant === 'scrollable';
16
+ return sx({
17
+ alignItems: 'stretch',
18
+ gap: 1,
19
+ justifyContent: 'flex-start',
20
+ overflow: scrollable ? 'scroll' : 'hidden',
21
+ paddingY: spacing,
22
+ [theme.breakpoints.down(mobileScrollingBreakpoint)]: {
23
+ overflow: 'scroll',
24
+ },
25
+ });
26
+ });
23
27
  const WebAppBodyBreadcrumb = styled(FlexRow, {
24
28
  ...defaultStyledOptions,
25
29
  name: WebAppBodyName,
@@ -31,22 +35,26 @@ const WebAppBodyBreadcrumb = styled(FlexRow, {
31
35
  const WebAppBodyScrollableWrapper = styled(FlexGrowCol, {
32
36
  name: WebAppBodyName,
33
37
  slot: 'ScrollableWrapper',
34
- })(() => ({}));
38
+ })(() => ({
39
+ alignItems: 'stretch',
40
+ }));
35
41
  const WebAppBodyScrollable = styled(FlexGrowCol, {
36
42
  ...defaultStyledOptions,
37
43
  name: WebAppBodyName,
38
44
  slot: 'Scrollable',
39
- })(({ theme, scrollingBreakpoint = 'sm' }) => ({
40
- alignItems: 'stretch',
41
- inset: 0,
42
- justifyContent: 'start',
43
- position: 'absolute',
44
- [theme.breakpoints.down(scrollingBreakpoint)]: {
45
- inset: 'unset',
46
- position: 'relative',
47
- },
48
- }));
49
- export const WebAppBody = ({ children, breadcrumbs, disableBreadcrumbGutter, scrollingBreakpoint, spacing = 1, ...props }) => {
50
- return (_jsxs(WebAppBodyRoot, { scrollingBreakpoint: scrollingBreakpoint, spacing: spacing, ...props, children: [breadcrumbs ? (_jsx(WebAppBodyBreadcrumb, { disableBreadcrumbGutter: disableBreadcrumbGutter, spacing: spacing, children: breadcrumbs })) : null, _jsx(WebAppBodyScrollableWrapper, { children: _jsx(WebAppBodyScrollable, { scrollingBreakpoint: scrollingBreakpoint, children: children }) })] }));
45
+ })(({ theme, mobileScrollingBreakpoint = 'sm', variant }) => {
46
+ const props = variant === 'scrollable' ? scrollableContent : fixedContent;
47
+ return {
48
+ ...props,
49
+ alignItems: 'stretch',
50
+ justifyContent: 'start',
51
+ [theme.breakpoints.down(mobileScrollingBreakpoint)]: {
52
+ inset: 'unset',
53
+ position: 'relative',
54
+ },
55
+ };
56
+ });
57
+ export const WebAppBody = ({ children, breadcrumbs, disableBreadcrumbGutter, mobileScrollingBreakpoint, spacing = 1, variant, ...props }) => {
58
+ return (_jsxs(WebAppBodyRoot, { mobileScrollingBreakpoint: mobileScrollingBreakpoint, spacing: spacing, variant: variant, ...props, children: [breadcrumbs ? (_jsx(WebAppBodyBreadcrumb, { disableBreadcrumbGutter: disableBreadcrumbGutter, spacing: spacing, children: breadcrumbs })) : null, _jsx(WebAppBodyScrollableWrapper, { children: _jsx(WebAppBodyScrollable, { mobileScrollingBreakpoint: mobileScrollingBreakpoint, variant: variant, children: children }) })] }));
51
59
  };
52
60
  //# sourceMappingURL=Body.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Body.js","sourceRoot":"","sources":["../../../src/components/Body.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,eAAe,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,EAAgB,WAAW,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAG1E,MAAM,cAAc,GAAG,YAAY,CAAA;AACnC,MAAM,iBAAiB,GAAG,CAAC,qBAAqB,EAAE,SAAS,EAAE,yBAAyB,CAAC,CAAA;AACvF,MAAM,oBAAoB,GAAG;IAC3B,iBAAiB,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC;CACvE,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,EAAE;IACzC,GAAG,oBAAoB;IACvB,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,MAAM;CACb,CAAC,CAAkB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI,EAAE,EAAE,EAAE,CACrE,EAAE,CAAC;IACD,UAAU,EAAE,SAAS;IACrB,GAAG,EAAE,CAAC;IACN,cAAc,EAAE,YAAY;IAC5B,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,OAAO;IACjB,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE;QAC7C,QAAQ,EAAE,QAAQ;KACnB;CACF,CAAC,CACH,C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AACH,CAAC,CAAC,CAAA;AAUF,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,OAAO,GAAG,CAAC,EACX,OAAO,EACP,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,CACL,MAAC,cAAc,IAAC,yBAAyB,EAAE,yBAAyB,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAM,KAAK,aAChH,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,oBAAoB,IAAC,uBAAuB,EAAE,uBAAuB,EAAE,OAAO,EAAE,OAAO,YACrF,WAAW,GACS,CACxB,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,2BAA2B,cAC1B,KAAC,oBAAoB,IAAC,yBAAyB,EAAE,yBAAyB,EAAE,OAAO,EAAE,OAAO,YACzF,QAAQ,GACY,GACK,IACf,CAClB,CAAA;AACH,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAU,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,YAAY,EAAe,MAAM,uBAAuB,CAAA;AAEjE,OAAO,EAAkB,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAInE,OAAO,EAAc,eAAe,EAAE,MAAM,QAAQ,CAAA;AAkBpD,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,CAoD9D,CAAA;AAED,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,mDAAa,CAAA"}
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAU,MAAM,eAAe,CAAA;AACjE,OAAO,EAAE,YAAY,EAAe,MAAM,uBAAuB,CAAA;AAEjE,OAAO,EAAkB,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAInE,OAAO,EAAc,eAAe,EAAE,MAAM,QAAQ,CAAA;AAqBpD,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,CAuD9D,CAAA;AAED,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,mDAAa,CAAA"}
@@ -6,22 +6,25 @@ import { useAsyncEffect } from '@xylabs/react-shared';
6
6
  import { Helmet } from 'react-helmet';
7
7
  import { useLocation } from 'react-router-dom';
8
8
  import { WebAppBody } from './Body';
9
+ import { fixedWrap, scrollableWrap } from './lib';
9
10
  const WebAppPageRoot = styled(FlexGrowCol, {
10
11
  name: 'WebAppPage',
11
- shouldForwardProp: (propName) => propName !== 'scrollingBreakpoint',
12
+ shouldForwardProp: (propName) => propName !== 'mobileScrollingBreakpoint' && propName !== 'variant',
12
13
  slot: 'Root',
13
- })(({ theme, scrollingBreakpoint = 'sm' }) => ({
14
- alignItems: 'stretch',
15
- inset: 'unset',
16
- justifyContent: 'start',
17
- maxWidth: '100vw',
18
- position: 'relative',
19
- [theme.breakpoints.down(scrollingBreakpoint)]: {
20
- inset: 0,
21
- position: 'absolute',
22
- },
23
- }));
24
- export const WebAppPage = ({ disableGutters, disableBreadcrumbGutter, title, container, children, breadcrumbs, scrollingBreakpoint, ...props }) => {
14
+ })(({ theme, mobileScrollingBreakpoint = 'sm', variant }) => {
15
+ const props = variant === 'scrollable' ? scrollableWrap : fixedWrap;
16
+ return {
17
+ ...props,
18
+ alignItems: 'stretch',
19
+ justifyContent: 'start',
20
+ maxWidth: '100vw',
21
+ [theme.breakpoints.down(mobileScrollingBreakpoint)]: {
22
+ inset: 0,
23
+ position: 'absolute',
24
+ },
25
+ };
26
+ });
27
+ export const WebAppPage = ({ disableGutters, disableBreadcrumbGutter, title, container, children, breadcrumbs, mobileScrollingBreakpoint, variant = 'scrollable', ...props }) => {
25
28
  const userEvents = useUserEvents();
26
29
  const { pathname } = useLocation();
27
30
  useAsyncEffect(
@@ -29,7 +32,7 @@ export const WebAppPage = ({ disableGutters, disableBreadcrumbGutter, title, con
29
32
  async () => {
30
33
  await userEvents?.viewContent({ name: title ?? 'NodeBasePage', path: location.pathname });
31
34
  }, [pathname, title, userEvents]);
32
- return (_jsxs(WebAppPageRoot, { scrollingBreakpoint: scrollingBreakpoint, ...props, children: [_jsx(Helmet, { title: title }), container && container !== 'none' ? (_jsx(Container, { disableGutters: disableGutters, style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start' }, maxWidth: container, children: _jsx(WebAppBody, { disableBreadcrumbGutter: disableBreadcrumbGutter, breadcrumbs: breadcrumbs, scrollingBreakpoint: scrollingBreakpoint, ...props, children: children }) })) : (_jsx(WebAppBody, { disableBreadcrumbGutter: disableBreadcrumbGutter, breadcrumbs: breadcrumbs, scrollingBreakpoint: scrollingBreakpoint, paddingX: disableGutters ? 0 : 1, ...props, children: children }))] }));
35
+ return (_jsxs(WebAppPageRoot, { mobileScrollingBreakpoint: mobileScrollingBreakpoint, variant: variant, ...props, children: [_jsx(Helmet, { title: title }), container && container !== 'none' ? (_jsx(Container, { disableGutters: disableGutters, style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start' }, maxWidth: container, children: _jsx(WebAppBody, { disableBreadcrumbGutter: disableBreadcrumbGutter, breadcrumbs: breadcrumbs, mobileScrollingBreakpoint: mobileScrollingBreakpoint, variant: variant, ...props, children: children }) })) : (_jsx(WebAppBody, { disableBreadcrumbGutter: disableBreadcrumbGutter, breadcrumbs: breadcrumbs, mobileScrollingBreakpoint: mobileScrollingBreakpoint, paddingX: disableGutters ? 0 : 1, variant: variant, ...props, children: children }))] }));
33
36
  };
34
37
  /** @deprecated use WebAppPagePage instead */
35
38
  export const FlexPage = WebAppPage;
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/components/Page.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,EAAgB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAgB,MAAM,sBAAsB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAmB,MAAM,QAAQ,CAAA;AAEpD,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,EAAE;IACzC,IAAI,EAAE,YAAY;IAClB,iBAAiB,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,qBAAqB;IACnE,IAAI,EAAE,MAAM;CACb,CAAC,CAAkB,CAAC,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9D,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,OAAO;IACvB,QAAQ,EAAE,OAAO;IACjB,QAAQ,EAAE,UAAU;IACpB,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE;QAC7C,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAC,CA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WAAW,EACxB,yBAAyB,EAAE,yBAAyB,EACpD,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAChC,OAAO,EAAE,OAAO,KACZ,KAAK,YAER,QAAQ,GACE,CACd,IACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { 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,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,eAAO,MAAM,cAAc,EAAE,aAGnB,CAAA;AAEV,eAAO,MAAM,SAAS,EAAE,aAGd,CAAA;AAGV,eAAO,MAAM,iBAAiB,EAAE,aAEtB,CAAA;AAEV,eAAO,MAAM,YAAY,EAAE,aAEjB,CAAA"}
@@ -0,0 +1,16 @@
1
+ export const scrollableWrap = {
2
+ inset: 0,
3
+ position: 'absolute',
4
+ };
5
+ export const fixedWrap = {
6
+ inset: 'unset',
7
+ position: 'relative',
8
+ };
9
+ // Making a scrollable vs fixed wrapper and content is an inversion of the wrap and content styles
10
+ export const scrollableContent = {
11
+ ...fixedWrap,
12
+ };
13
+ export const fixedContent = {
14
+ ...scrollableWrap,
15
+ };
16
+ //# sourceMappingURL=cssValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cssValues.js","sourceRoot":"","sources":["../../../../src/components/lib/cssValues.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC3C,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,UAAU;CACZ,CAAA;AAEV,MAAM,CAAC,MAAM,SAAS,GAAkB;IACtC,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACZ,CAAA;AAEV,kGAAkG;AAClG,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC9C,GAAG,SAAS;CACJ,CAAA;AAEV,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC,GAAG,cAAc;CACT,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './cssValues';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './cssValues';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
package/package.json CHANGED
@@ -14,10 +14,10 @@
14
14
  "@xylabs/react-flexbox": "^2.15.1",
15
15
  "@xylabs/react-pixel": "^2.15.1",
16
16
  "@xylabs/react-shared": "^2.15.1",
17
- "@xyo-network/react-app-settings": "^2.37.4",
18
- "@xyo-network/react-appbar": "^2.37.4",
19
- "@xyo-network/react-footer": "^2.37.4",
20
- "@xyo-network/react-shared": "^2.37.4",
17
+ "@xyo-network/react-app-settings": "^2.37.6",
18
+ "@xyo-network/react-appbar": "^2.37.6",
19
+ "@xyo-network/react-footer": "^2.37.6",
20
+ "@xyo-network/react-shared": "^2.37.6",
21
21
  "react-helmet": "^6.1.0",
22
22
  "tslib": "^2.4.0"
23
23
  },
@@ -78,5 +78,5 @@
78
78
  },
79
79
  "sideEffects": false,
80
80
  "types": "dist/esm/index.d.ts",
81
- "version": "2.37.4"
81
+ "version": "2.37.6"
82
82
  }
@@ -2,8 +2,10 @@ import { Breakpoint, experimental_sx as sx, styled } from '@mui/material'
2
2
  import { FlexBoxProps, FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'
3
3
  import React, { ReactNode } from 'react'
4
4
 
5
+ import { fixedContent, scrollableContent } from './lib'
6
+
5
7
  const WebAppBodyName = 'WebAppBody'
6
- const propsNotForwarded = ['scrollingBreakpoint', 'spacing', 'disableBreadcrumbGutter']
8
+ const propsNotForwarded = ['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter']
7
9
  const defaultStyledOptions = {
8
10
  shouldForwardProp: (prop: string) => !propsNotForwarded.includes(prop),
9
11
  }
@@ -12,18 +14,19 @@ const WebAppBodyRoot = styled(FlexGrowCol, {
12
14
  ...defaultStyledOptions,
13
15
  name: WebAppBodyName,
14
16
  slot: 'Root',
15
- })<WebAppBodyProps>(({ spacing, theme, scrollingBreakpoint = 'sm' }) =>
16
- sx({
17
+ })<WebAppBodyProps>(({ spacing, theme, mobileScrollingBreakpoint = 'sm', variant }) => {
18
+ const scrollable = variant === 'scrollable'
19
+ return sx({
17
20
  alignItems: 'stretch',
18
21
  gap: 1,
19
22
  justifyContent: 'flex-start',
20
- overflow: 'hidden',
23
+ overflow: scrollable ? 'scroll' : 'hidden',
21
24
  paddingY: spacing,
22
- [theme.breakpoints.down(scrollingBreakpoint)]: {
25
+ [theme.breakpoints.down(mobileScrollingBreakpoint)]: {
23
26
  overflow: 'scroll',
24
27
  },
25
- }),
26
- )
28
+ })
29
+ })
27
30
 
28
31
  const WebAppBodyBreadcrumb = styled(FlexRow, {
29
32
  ...defaultStyledOptions,
@@ -39,47 +42,55 @@ const WebAppBodyBreadcrumb = styled(FlexRow, {
39
42
  const WebAppBodyScrollableWrapper = styled(FlexGrowCol, {
40
43
  name: WebAppBodyName,
41
44
  slot: 'ScrollableWrapper',
42
- })<WebAppBodyProps>(() => ({}))
45
+ })<WebAppBodyProps>(() => ({
46
+ alignItems: 'stretch',
47
+ }))
43
48
 
44
49
  const WebAppBodyScrollable = styled(FlexGrowCol, {
45
50
  ...defaultStyledOptions,
46
51
  name: WebAppBodyName,
47
52
  slot: 'Scrollable',
48
- })<WebAppBodyProps>(({ theme, scrollingBreakpoint = 'sm' }) => ({
49
- alignItems: 'stretch',
50
- inset: 0,
51
- justifyContent: 'start',
52
- position: 'absolute',
53
- [theme.breakpoints.down(scrollingBreakpoint)]: {
54
- inset: 'unset',
55
- position: 'relative',
56
- },
57
- }))
53
+ })<WebAppBodyProps>(({ theme, mobileScrollingBreakpoint = 'sm', variant }) => {
54
+ const props = variant === 'scrollable' ? scrollableContent : fixedContent
55
+ return {
56
+ ...props,
57
+ alignItems: 'stretch',
58
+ justifyContent: 'start',
59
+ [theme.breakpoints.down(mobileScrollingBreakpoint)]: {
60
+ inset: 'unset',
61
+ position: 'relative',
62
+ },
63
+ }
64
+ })
58
65
 
59
66
  export interface WebAppBodyProps extends FlexBoxProps {
60
67
  breadcrumbs?: ReactNode
61
68
  disableBreadcrumbGutter?: boolean
62
69
  spacing?: string | number
63
- scrollingBreakpoint?: Breakpoint
70
+ mobileScrollingBreakpoint?: Breakpoint
71
+ variant?: 'scrollable' | 'fixed'
64
72
  }
65
73
 
66
74
  export const WebAppBody: React.FC<WebAppBodyProps> = ({
67
75
  children,
68
76
  breadcrumbs,
69
77
  disableBreadcrumbGutter,
70
- scrollingBreakpoint,
78
+ mobileScrollingBreakpoint,
71
79
  spacing = 1,
80
+ variant,
72
81
  ...props
73
82
  }) => {
74
83
  return (
75
- <WebAppBodyRoot scrollingBreakpoint={scrollingBreakpoint} spacing={spacing} {...props}>
84
+ <WebAppBodyRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} spacing={spacing} variant={variant} {...props}>
76
85
  {breadcrumbs ? (
77
86
  <WebAppBodyBreadcrumb disableBreadcrumbGutter={disableBreadcrumbGutter} spacing={spacing}>
78
87
  {breadcrumbs}
79
88
  </WebAppBodyBreadcrumb>
80
89
  ) : null}
81
90
  <WebAppBodyScrollableWrapper>
82
- <WebAppBodyScrollable scrollingBreakpoint={scrollingBreakpoint}>{children}</WebAppBodyScrollable>
91
+ <WebAppBodyScrollable mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant}>
92
+ {children}
93
+ </WebAppBodyScrollable>
83
94
  </WebAppBodyScrollableWrapper>
84
95
  </WebAppBodyRoot>
85
96
  )
@@ -63,10 +63,10 @@ Default.args = {}
63
63
  const DefaultSideBar = Template.bind({})
64
64
  DefaultSideBar.args = { children: <Children />, navigationType: 'sidebar' }
65
65
 
66
- const DefaultAlwaysScrollable = Template.bind({})
67
- DefaultAlwaysScrollable.args = { children: <Children scrollingBreakpoint="xl" />, navigationType: 'sidebar' }
66
+ const WithFixedSizePage = Template.bind({})
67
+ WithFixedSizePage.args = { children: <Children variant="fixed" />, navigationType: 'sidebar' }
68
68
 
69
- export { Default, DefaultAlwaysScrollable, DefaultSideBar }
69
+ export { Default, DefaultSideBar, WithFixedSizePage }
70
70
 
71
71
  // eslint-disable-next-line import/no-default-export
72
72
  export default StorybookEntry
@@ -6,22 +6,25 @@ import { Helmet } from 'react-helmet'
6
6
  import { useLocation } from 'react-router-dom'
7
7
 
8
8
  import { WebAppBody, WebAppBodyProps } from './Body'
9
+ import { fixedWrap, scrollableWrap } from './lib'
9
10
 
10
11
  const WebAppPageRoot = styled(FlexGrowCol, {
11
12
  name: 'WebAppPage',
12
- shouldForwardProp: (propName) => propName !== 'scrollingBreakpoint',
13
+ shouldForwardProp: (propName) => propName !== 'mobileScrollingBreakpoint' && propName !== 'variant',
13
14
  slot: 'Root',
14
- })<WebAppPageProps>(({ theme, scrollingBreakpoint = 'sm' }) => ({
15
- alignItems: 'stretch',
16
- inset: 'unset',
17
- justifyContent: 'start',
18
- maxWidth: '100vw',
19
- position: 'relative',
20
- [theme.breakpoints.down(scrollingBreakpoint)]: {
21
- inset: 0,
22
- position: 'absolute',
23
- },
24
- }))
15
+ })<WebAppPageProps>(({ theme, mobileScrollingBreakpoint = 'sm', variant }) => {
16
+ const props = variant === 'scrollable' ? scrollableWrap : fixedWrap
17
+ return {
18
+ ...props,
19
+ alignItems: 'stretch',
20
+ justifyContent: 'start',
21
+ maxWidth: '100vw',
22
+ [theme.breakpoints.down(mobileScrollingBreakpoint)]: {
23
+ inset: 0,
24
+ position: 'absolute',
25
+ },
26
+ }
27
+ })
25
28
 
26
29
  export interface WebAppPageProps extends WebAppBodyProps, FlexBoxProps {
27
30
  container?: ContainerProps['maxWidth'] | 'none'
@@ -35,7 +38,8 @@ export const WebAppPage: React.FC<WithChildren<WebAppPageProps>> = ({
35
38
  container,
36
39
  children,
37
40
  breadcrumbs,
38
- scrollingBreakpoint,
41
+ mobileScrollingBreakpoint,
42
+ variant = 'scrollable',
39
43
  ...props
40
44
  }) => {
41
45
  const userEvents = useUserEvents()
@@ -50,7 +54,7 @@ export const WebAppPage: React.FC<WithChildren<WebAppPageProps>> = ({
50
54
  )
51
55
 
52
56
  return (
53
- <WebAppPageRoot scrollingBreakpoint={scrollingBreakpoint} {...props}>
57
+ <WebAppPageRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant} {...props}>
54
58
  <Helmet title={title} />
55
59
  {container && container !== 'none' ? (
56
60
  <Container
@@ -61,7 +65,8 @@ export const WebAppPage: React.FC<WithChildren<WebAppPageProps>> = ({
61
65
  <WebAppBody
62
66
  disableBreadcrumbGutter={disableBreadcrumbGutter}
63
67
  breadcrumbs={breadcrumbs}
64
- scrollingBreakpoint={scrollingBreakpoint}
68
+ mobileScrollingBreakpoint={mobileScrollingBreakpoint}
69
+ variant={variant}
65
70
  {...props}
66
71
  >
67
72
  {children}
@@ -71,8 +76,9 @@ export const WebAppPage: React.FC<WithChildren<WebAppPageProps>> = ({
71
76
  <WebAppBody
72
77
  disableBreadcrumbGutter={disableBreadcrumbGutter}
73
78
  breadcrumbs={breadcrumbs}
74
- scrollingBreakpoint={scrollingBreakpoint}
79
+ mobileScrollingBreakpoint={mobileScrollingBreakpoint}
75
80
  paddingX={disableGutters ? 0 : 1}
81
+ variant={variant}
76
82
  {...props}
77
83
  >
78
84
  {children}
@@ -0,0 +1,20 @@
1
+ import { CSSProperties } from 'react'
2
+
3
+ export const scrollableWrap: CSSProperties = {
4
+ inset: 0,
5
+ position: 'absolute',
6
+ } as const
7
+
8
+ export const fixedWrap: CSSProperties = {
9
+ inset: 'unset',
10
+ position: 'relative',
11
+ } as const
12
+
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
17
+
18
+ export const fixedContent: CSSProperties = {
19
+ ...scrollableWrap,
20
+ } as const
@@ -0,0 +1 @@
1
+ export * from './cssValues'