@forge/react 11.10.0-next.4 → 11.10.0-next.5

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,11 @@
1
1
  # @forge/react
2
2
 
3
+ ## 11.10.0-next.5
4
+
5
+ ### Minor Changes
6
+
7
+ - 62fcf09: Added props to Global component
8
+
3
9
  ## 11.10.0-next.4
4
10
 
5
11
  ### Minor Changes
@@ -1,14 +1,31 @@
1
- /// <reference types="react" />
2
- import { ForgeElement } from '../../types';
3
- interface InternalGlobalProps {
4
- children: React.ReactNode;
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ declare type GlobalElements = ReactElement<GlobalExpandableMenuItemProps> | ReactElement<GlobalLinkMenuItemProps> | ReactElement<GlobalSidebarProps> | ReactElement<GlobalMainProps> | ReactElement<GlobalProps>;
3
+ declare type NotGlobalComponents<T> = T extends GlobalElements ? never : T;
4
+ interface GlobalLinkMenuItemProps {
5
+ href: string;
6
+ label: string;
7
+ children?: never;
8
+ }
9
+ interface GlobalExpandableMenuItemProps {
10
+ children: ReactElement<GlobalLinkMenuItemProps> | ReactElement<GlobalLinkMenuItemProps>[];
11
+ label: string;
12
+ }
13
+ interface GlobalSidebarProps {
14
+ forYouUrl?: string;
15
+ children: ReactElement<GlobalLinkMenuItemProps> | ReactElement<GlobalExpandableMenuItemProps> | Array<ReactElement<GlobalLinkMenuItemProps> | ReactElement<GlobalExpandableMenuItemProps>>;
16
+ }
17
+ interface GlobalMainProps {
18
+ children: NotGlobalComponents<ReactNode>;
19
+ }
20
+ interface GlobalProps {
21
+ children: [ReactElement<GlobalSidebarProps, typeof Global.Sidebar>, ReactElement<GlobalMainProps, typeof Global.Main>] | [ReactElement<GlobalMainProps, typeof Global.Main>, ReactElement<GlobalSidebarProps, typeof Global.Sidebar>];
5
22
  }
6
23
  export declare const Global: {
7
- ({ children, ...rest }: InternalGlobalProps): import("react/jsx-runtime").JSX.Element;
8
- Main({ children, ...rest }: any): import("react/jsx-runtime").JSX.Element;
9
- Sidebar({ children, ...rest }: any): import("react/jsx-runtime").JSX.Element;
10
- ExpandMenuItem({ children, ...rest }: any): import("react/jsx-runtime").JSX.Element;
11
- LinkMenuItem: () => ForgeElement;
24
+ (props: GlobalProps): import("react/jsx-runtime").JSX.Element;
25
+ Main(props: GlobalMainProps): import("react/jsx-runtime").JSX.Element;
26
+ Sidebar({ children, forYouUrl }: GlobalSidebarProps): import("react/jsx-runtime").JSX.Element;
27
+ ExpandMenuItem({ label, children }: GlobalExpandableMenuItemProps): import("react/jsx-runtime").JSX.Element;
28
+ LinkMenuItem(props: GlobalLinkMenuItemProps): import("react/jsx-runtime").JSX.Element;
12
29
  };
13
30
  export {};
14
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/global/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAYD,eAAO,MAAM,MAAM;4BAA2B,mBAAmB;gCAK3B,GAAG;mCAKA,GAAG;0CAKI,GAAG;wBAIa,YAAY;CAjB3E,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/global/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,aAAK,cAAc,GACf,YAAY,CAAC,6BAA6B,CAAC,GAC3C,YAAY,CAAC,uBAAuB,CAAC,GACrC,YAAY,CAAC,kBAAkB,CAAC,GAChC,YAAY,CAAC,eAAe,CAAC,GAC7B,YAAY,CAAC,WAAW,CAAC,CAAC;AAE9B,aAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,cAAc,GAAG,KAAK,GAAG,CAAC,CAAC;AAEnE,UAAU,uBAAuB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC;CAElB;AAED,UAAU,6BAA6B;IACrC,QAAQ,EAAE,YAAY,CAAC,uBAAuB,CAAC,GAAG,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC;IAC1F,KAAK,EAAE,MAAM,CAAC;CAEf;AAED,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EACJ,YAAY,CAAC,uBAAuB,CAAC,GACrC,YAAY,CAAC,6BAA6B,CAAC,GAC3C,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC,CAAC;CAEhG;AAED,UAAU,eAAe;IACvB,QAAQ,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAE1C;AAED,UAAU,WAAW;IACnB,QAAQ,EACJ,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,eAAe,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,GAC5G,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,kBAAkB,EAAE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;CAElH;AAiBD,eAAO,MAAM,MAAM;YAAW,WAAW;gBAInB,eAAe;qCAIM,kBAAkB;wCAIf,6BAA6B;wBAI7C,uBAAuB;CAdpD,CAAC"}
@@ -2,29 +2,25 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Global = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- // eslint-disable-next-line
6
- const GlobalPrimitive = 'Global'; // Refine props and type checking
7
- // eslint-disable-next-line
5
+ const GlobalPrimitive = 'Global';
8
6
  const GlobalMainPrimitive = 'Global.Main';
9
- // eslint-disable-next-line
10
7
  const GlobalSidebarPrimitive = 'Global.Sidebar';
11
- // eslint-disable-next-line
12
8
  const GlobalExpandMenuItemPrimitive = 'Global.ExpandMenuItem';
9
+ const GlobalLinkMenuItemPrimitive = 'Global.LinkMenuItem';
13
10
  // Top level component
14
- const Global = ({ children, ...rest }) => {
15
- return (0, jsx_runtime_1.jsx)(GlobalPrimitive, { ...rest, children: children });
11
+ const Global = (props) => {
12
+ return (0, jsx_runtime_1.jsx)(GlobalPrimitive, { children: props.children });
16
13
  };
17
14
  exports.Global = Global;
18
- // eslint-disable-next-line
19
- exports.Global.Main = ({ children, ...rest }) => {
20
- return (0, jsx_runtime_1.jsx)(GlobalMainPrimitive, { ...rest, children: children });
15
+ exports.Global.Main = (props) => {
16
+ return (0, jsx_runtime_1.jsx)(GlobalMainPrimitive, { children: props.children });
21
17
  };
22
- // eslint-disable-next-line
23
- exports.Global.Sidebar = ({ children, ...rest }) => {
24
- return (0, jsx_runtime_1.jsx)(GlobalSidebarPrimitive, { ...rest, children: children });
18
+ exports.Global.Sidebar = ({ children, forYouUrl }) => {
19
+ return (0, jsx_runtime_1.jsx)(GlobalSidebarPrimitive, { forYouUrl: forYouUrl, children: children });
25
20
  };
26
- // eslint-disable-next-line
27
- exports.Global.ExpandMenuItem = ({ children, ...rest }) => {
28
- return (0, jsx_runtime_1.jsx)(GlobalExpandMenuItemPrimitive, { ...rest, children: children });
21
+ exports.Global.ExpandMenuItem = ({ label, children }) => {
22
+ return (0, jsx_runtime_1.jsx)(GlobalExpandMenuItemPrimitive, { label: label, children: children });
23
+ };
24
+ exports.Global.LinkMenuItem = (props) => {
25
+ return (0, jsx_runtime_1.jsx)(GlobalLinkMenuItemPrimitive, { ...props });
29
26
  };
30
- exports.Global.LinkMenuItem = 'Global.LinkMenuItem';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/react",
3
- "version": "11.10.0-next.4",
3
+ "version": "11.10.0-next.5",
4
4
  "description": "Forge React reconciler",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",