@luscii-healthtech/web-ui 0.4.2 → 0.4.3
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/components/NavMenu/NavMenu.d.ts +9 -1
- package/dist/components/NavMenu/NavMenu.utils.d.ts +3 -0
- package/dist/components/NavMenu/NavMenuContent.d.ts +2 -6
- package/dist/components/NavMenu/NavMenuItem.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/web-ui.cjs.development.js +15 -6
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.js +15 -6
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NavMenu/{NavMenu.js → NavMenu.tsx} +7 -3
- package/src/components/NavMenu/NavMenu.utils.ts +6 -0
- package/src/components/NavMenu/NavMenuContent.tsx +8 -8
- package/src/components/NavMenu/NavMenuItem.tsx +1 -1
- package/src/index.tsx +1 -1
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NavMenuItemProps } from "./NavMenuItem";
|
|
3
|
+
export declare type NavMenuElement = NavMenuItemProps | {
|
|
4
|
+
type: "separator" | "spacer";
|
|
5
|
+
};
|
|
6
|
+
export declare type NavMenuProps = {
|
|
7
|
+
items: NavMenuElement[];
|
|
8
|
+
};
|
|
9
|
+
export declare function NavMenu({ items }: NavMenuProps): JSX.Element;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
items: Array<NavMenuItemProps>;
|
|
5
|
-
}
|
|
6
|
-
export declare const NavMenuContent: (props: NavMenuContentProps) => JSX.Element;
|
|
7
|
-
export {};
|
|
2
|
+
import { NavMenuProps } from "./NavMenu";
|
|
3
|
+
export declare const NavMenuContent: ({ items }: NavMenuProps) => JSX.Element;
|
|
@@ -9,7 +9,7 @@ export interface NavMenuItemProps {
|
|
|
9
9
|
dataTestId: string;
|
|
10
10
|
gtmEvent?: string;
|
|
11
11
|
isExternal?: boolean;
|
|
12
|
-
type?: "
|
|
12
|
+
type?: "base";
|
|
13
13
|
track?: (event: string) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const NavMenuItem: (props: NavMenuItemProps) => JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { LoadingIndicator, LoadingIndicatorProps, } from "./components/LoadingIn
|
|
|
23
23
|
export { default as Menu } from "./components/Menu/Menu";
|
|
24
24
|
export { MultiSelect } from "./components/MultiSelect/MultiSelect";
|
|
25
25
|
export { NavLayout, NavMenuLayoutProps } from "./components/NavMenu/NavLayout";
|
|
26
|
-
export { NavMenu } from "./components/NavMenu/NavMenu";
|
|
26
|
+
export { NavMenu, NavMenuElement } from "./components/NavMenu/NavMenu";
|
|
27
27
|
export { NotificationBanner, NotificationBannerColor, NotificationBannerLinkProps, } from "./components/NotificationBanner/NotificationBanner";
|
|
28
28
|
export { default as Page } from "./components/Page/Page";
|
|
29
29
|
export { default as CRUDPage } from "./components/Page/CRUDPage";
|
|
@@ -2763,10 +2763,15 @@ var NavMenuItem = function NavMenuItem(props) {
|
|
|
2763
2763
|
}
|
|
2764
2764
|
};
|
|
2765
2765
|
|
|
2766
|
-
|
|
2766
|
+
function isNavMenuItem(item) {
|
|
2767
|
+
return item.type === "base" || item.type === undefined;
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
var NavMenuContent = function NavMenuContent(_ref) {
|
|
2771
|
+
var items = _ref.items;
|
|
2767
2772
|
return /*#__PURE__*/React.createElement("div", {
|
|
2768
2773
|
className: "flex flex-col bg-nav-menu w-46 pl-1 py-2 lg:relative shadow-lg"
|
|
2769
|
-
},
|
|
2774
|
+
}, items.map(function (item, index) {
|
|
2770
2775
|
if (item.type === "separator") {
|
|
2771
2776
|
return /*#__PURE__*/React.createElement("div", {
|
|
2772
2777
|
key: item.type + "-" + index,
|
|
@@ -2777,15 +2782,19 @@ var NavMenuContent = function NavMenuContent(props) {
|
|
|
2777
2782
|
key: item.type + "-" + index,
|
|
2778
2783
|
className: "mt-auto"
|
|
2779
2784
|
});
|
|
2780
|
-
} else {
|
|
2785
|
+
} else if (isNavMenuItem(item)) {
|
|
2781
2786
|
return /*#__PURE__*/React.createElement(NavMenuItem, Object.assign({}, item, {
|
|
2782
2787
|
key: item.title
|
|
2783
2788
|
}));
|
|
2789
|
+
} else {
|
|
2790
|
+
return null;
|
|
2784
2791
|
}
|
|
2785
2792
|
}));
|
|
2786
2793
|
};
|
|
2787
2794
|
|
|
2788
|
-
function NavMenu(
|
|
2795
|
+
function NavMenu(_ref) {
|
|
2796
|
+
var items = _ref.items;
|
|
2797
|
+
|
|
2789
2798
|
var _useState = React.useState(false),
|
|
2790
2799
|
isOpen = _useState[0],
|
|
2791
2800
|
setIsOpen = _useState[1];
|
|
@@ -2797,7 +2806,7 @@ function NavMenu(props) {
|
|
|
2797
2806
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
2798
2807
|
className: "hidden h-screen lg:flex"
|
|
2799
2808
|
}, /*#__PURE__*/React.createElement(NavMenuContent, {
|
|
2800
|
-
items:
|
|
2809
|
+
items: items
|
|
2801
2810
|
})), /*#__PURE__*/React.createElement("div", {
|
|
2802
2811
|
className: "lg:hidden relative bg-nav-header w-screen flex items-center p-2 shadow-lg"
|
|
2803
2812
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -2808,7 +2817,7 @@ function NavMenu(props) {
|
|
|
2808
2817
|
})), isOpen && /*#__PURE__*/React.createElement("div", {
|
|
2809
2818
|
className: "absolute z-20"
|
|
2810
2819
|
}, /*#__PURE__*/React.createElement(NavMenuContent, {
|
|
2811
|
-
items:
|
|
2820
|
+
items: items
|
|
2812
2821
|
})));
|
|
2813
2822
|
}
|
|
2814
2823
|
|