@equinor/fusion-react-layout 0.1.1 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @equinor/fusion-react-layout
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 934e52c: Forward props from `Page` and its compound slot components to their underlying elements.
8
+
9
+ Update the underlying layout and page web components to constrain content to the available height, preventing nested content from expanding the viewport and allowing main content to scroll correctly.
10
+
3
11
  ## 0.1.1
4
12
 
5
13
  ### Patch Changes
@@ -1,9 +1,11 @@
1
1
  import type { PropsWithChildren, ReactNode } from 'react';
2
+ import type { ComponentProps } from '@equinor/fusion-react-utils';
2
3
  import '@equinor/fusion-wc-page';
3
- type PageComponent = ((props: PropsWithChildren) => ReactNode) & {
4
- Header: (props: PropsWithChildren) => ReactNode;
5
- Main: (props: PropsWithChildren) => ReactNode;
6
- Footer: (props: PropsWithChildren) => ReactNode;
4
+ export type PageProps = ComponentProps<HTMLDivElement, PropsWithChildren>;
5
+ type PageComponent = ((props: PageProps) => ReactNode) & {
6
+ Header: (props: PageProps) => ReactNode;
7
+ Main: (props: PageProps) => ReactNode;
8
+ Footer: (props: PageProps) => ReactNode;
7
9
  displayName?: string;
8
10
  };
9
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/page/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,yBAAyB,CAAC;AAEjC,KAAK,aAAa,GAAG,CAAC,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC,GAAG;IAC/D,MAAM,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC;IAChD,IAAI,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC;IAC9C,MAAM,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,SAAS,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,aAGlB,CAAC;eA0Ba,IAAI"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/page/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,yBAAyB,CAAC;AAEjC,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAE1E,KAAK,aAAa,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,CAAC,GAAG;IACvD,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,CAAC;IACxC,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,CAAC;IACtC,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,aAGlB,CAAC;eAsCa,IAAI"}
@@ -4,24 +4,24 @@ import '@equinor/fusion-wc-page';
4
4
  * Wraps the Fusion page web component and exposes compound components for
5
5
  * assigning children to the page header, main, and footer slots.
6
6
  */
7
- export const Page = ({ children }) => {
7
+ export const Page = ({ children, ...props }) => {
8
8
  /* @ts-expect-error fwc-page is a web component */
9
- return _jsx("fwc-page", { children: children });
9
+ return _jsx("fwc-page", { ...props, children: children });
10
10
  };
11
11
  Page.displayName = 'Page';
12
- const Header = ({ children }) => {
12
+ const Header = ({ children, ...props }) => {
13
13
  // The underlying web component projects this content into its header slot.
14
- return _jsx("div", { slot: "header", children: children });
14
+ return (_jsx("div", { slot: "header", ...props, children: children }));
15
15
  };
16
16
  Header.displayName = 'Page.Header';
17
- const Main = ({ children }) => {
17
+ const Main = ({ children, ...props }) => {
18
18
  // The underlying web component projects this content into its main slot.
19
- return _jsx("div", { slot: "main", children: children });
19
+ return (_jsx("div", { slot: "main", style: { height: '100%' }, ...props, children: children }));
20
20
  };
21
21
  Main.displayName = 'Page.Main';
22
- const Footer = ({ children }) => {
22
+ const Footer = ({ children, ...props }) => {
23
23
  // The underlying web component projects this content into its footer slot.
24
- return _jsx("div", { slot: "footer", children: children });
24
+ return (_jsx("div", { slot: "footer", ...props, children: children }));
25
25
  };
26
26
  Footer.displayName = 'Page.Footer';
27
27
  // Compound components mirror the slots supported by the underlying web component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-react-layout",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Fusion React Layout Component.",
5
5
  "keywords": [
6
6
  "react",
@@ -57,11 +57,11 @@
57
57
  "url": "https://github.com/equinor/fusion-react-components/issues"
58
58
  },
59
59
  "dependencies": {
60
- "@equinor/fusion-wc-layout": "^0.0.0",
61
- "@equinor/fusion-wc-page": "^0.0.0"
60
+ "@equinor/fusion-wc-layout": "^0.1.2",
61
+ "@equinor/fusion-wc-page": "^0.1.2"
62
62
  },
63
63
  "devDependencies": {
64
- "@types/react": "^19.2.14",
64
+ "@types/react": "^19.2.18",
65
65
  "react": "^19.2.8"
66
66
  },
67
67
  "peerDependencies": {