@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,14 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
(
|
|
8
|
-
Main(
|
|
9
|
-
Sidebar({ children,
|
|
10
|
-
ExpandMenuItem({
|
|
11
|
-
LinkMenuItem: ()
|
|
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":"
|
|
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
|
-
|
|
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 = (
|
|
15
|
-
return (0, jsx_runtime_1.jsx)(GlobalPrimitive, {
|
|
11
|
+
const Global = (props) => {
|
|
12
|
+
return (0, jsx_runtime_1.jsx)(GlobalPrimitive, { children: props.children });
|
|
16
13
|
};
|
|
17
14
|
exports.Global = Global;
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
23
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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';
|