@cullsin/lnc-menu 7.0.1 → 7.0.4
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/index.d.ts +1 -2
- package/dist/index.js +1 -1
- package/dist/src/SideMenu.d.ts +1 -6
- package/dist/src/SideMenu.js +7 -22
- package/dist/src/sidemenu.scss +38 -44
- package/dist/src/tenant.module.css +42 -0
- package/package.json +32 -30
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { default as SideMenu } from './src/SideMenu';
|
|
2
2
|
export { getTranslations, en, es } from './src/translations';
|
|
3
3
|
export type { Language, Translations } from './src/translations';
|
|
4
|
-
|
|
5
|
-
export type { ThemeId, CustomColors, ThemeConfig, ThemesJson } from './src/themes';
|
|
4
|
+
import './src/tenant.module.css';
|
|
6
5
|
import './src/sidemenu.scss';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as SideMenu } from './src/SideMenu';
|
|
2
2
|
export { getTranslations, en, es } from './src/translations';
|
|
3
|
-
|
|
3
|
+
import './src/tenant.module.css'; // CSS-variable defaults — overridden by CDN tenant.css at runtime
|
|
4
4
|
import './src/sidemenu.scss'; // consumer must support SCSS
|
package/dist/src/SideMenu.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { Location, NavigateFunction } from "react-router-dom";
|
|
3
|
-
import type { ThemeId } from "./themes";
|
|
4
2
|
import { Language } from "./translations";
|
|
5
3
|
interface SideMenuProps {
|
|
6
4
|
useDrawer: () => {
|
|
7
5
|
isDrawerOpen: boolean;
|
|
8
6
|
toggleDrawer: () => void;
|
|
9
7
|
};
|
|
10
|
-
SampleMgmtIcon: React.ElementType;
|
|
11
8
|
navigate: NavigateFunction;
|
|
12
9
|
location: Location;
|
|
13
10
|
language?: Language;
|
|
14
11
|
module?: 'sample' | 'patient';
|
|
15
|
-
/** Theme id for menu colors (default | ocean | forest | sunset). Matches mgm-linc-patient-ui themes. */
|
|
16
|
-
themeId?: ThemeId | string;
|
|
17
12
|
}
|
|
18
|
-
declare function SideMenu({ useDrawer,
|
|
13
|
+
declare function SideMenu({ useDrawer, location, language, module }: SideMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
19
14
|
export default SideMenu;
|
package/dist/src/SideMenu.js
CHANGED
|
@@ -8,26 +8,11 @@ import ListItemIcon from "@mui/material/ListItemIcon";
|
|
|
8
8
|
import ListItemText from "@mui/material/ListItemText";
|
|
9
9
|
import Tooltip from "@mui/material/Tooltip";
|
|
10
10
|
import * as React from "react";
|
|
11
|
-
import { getThemeColors } from "./themes";
|
|
12
11
|
import { getTranslations } from "./translations";
|
|
13
|
-
|
|
12
|
+
const SampleMgmtIcon = (props) => (_jsxs("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { d: "M20.144 1.03155C18.7687 -0.343852 16.5307 -0.343852 15.1552 1.03155L13.6553 2.53152L13.154 2.03015C12.8794 1.75559 12.4342 1.75559 12.1595 2.03015C11.8849 2.30472 11.8849 2.74997 12.1595 3.02458L12.6609 3.52594L6.30985 9.877C5.592 10.5948 5.3345 11.6309 5.60293 12.5811L3.92764 14.2564C3.65303 14.531 3.65303 14.9762 3.92764 15.2508L5.92376 17.247C6.06107 17.3843 6.24103 17.4529 6.42095 17.4529C6.60087 17.4529 6.78088 17.3843 6.91814 17.247L8.59319 15.5719C9.54379 15.841 10.5806 15.5838 11.2989 14.8655L17.6496 8.51467L18.151 9.01604C18.2883 9.15334 18.4683 9.22202 18.6482 9.22202C18.8281 9.22202 19.0081 9.15334 19.1454 9.01604C19.42 8.74147 19.42 8.29622 19.1454 8.02161L18.644 7.52025L20.144 6.02033C21.5194 4.64493 21.5194 2.40696 20.144 1.03155ZM10.3044 13.871C9.8905 14.285 9.26121 14.3873 8.73758 14.1262C8.46643 13.9878 8.13669 14.0396 7.92091 14.2554L6.42095 15.7553L5.41926 14.7536L6.91917 13.2537C7.1334 13.0395 7.18633 12.7121 7.05052 12.4412C6.78763 11.917 6.88954 11.2862 7.30428 10.8715L8.29777 9.87799H14.2975L10.3044 13.871ZM15.7039 8.47159H9.70411L13.6553 4.52037L16.6552 7.52025L15.7039 8.47159ZM19.1496 5.02591L17.6496 6.52582L14.6498 3.52594L16.1497 2.02598C16.9767 1.19891 18.3226 1.19891 19.1496 2.02598C19.9767 2.85305 19.9767 4.19879 19.1496 5.02591Z", fill: "currentColor" }), _jsx("path", { d: "M5.51817 18.6605C5.38686 18.4704 5.17061 18.3569 4.9396 18.3569C4.70858 18.3569 4.49233 18.4704 4.36103 18.6605C4.34598 18.6823 3.98802 19.2016 3.62527 19.827C2.90729 21.0648 2.82422 21.5941 2.82422 21.8846C2.82422 23.051 3.77317 23.9999 4.9396 23.9999C6.10602 23.9999 7.05498 23.051 7.05498 21.8846C7.05498 21.5941 6.97195 21.0648 6.25392 19.827C5.89118 19.2016 5.53322 18.6823 5.51817 18.6605ZM4.9396 22.5936C4.54863 22.5936 4.23056 22.2755 4.23056 21.8853C4.23605 21.669 4.53124 21.0509 4.93974 20.3631C5.34791 21.0501 5.64286 21.6679 5.64863 21.885C5.6484 22.2758 5.33042 22.5936 4.9396 22.5936Z", fill: "currentColor" })] })));
|
|
13
|
+
function SideMenu({ useDrawer, location, language = 'en', module }) {
|
|
14
14
|
const [selectedMainMenu, setSelectedMainMenu] = React.useState(null);
|
|
15
15
|
const { isDrawerOpen } = useDrawer();
|
|
16
|
-
const themeCssVars = React.useMemo(() => {
|
|
17
|
-
if (!themeId)
|
|
18
|
-
return {};
|
|
19
|
-
const c = getThemeColors(themeId);
|
|
20
|
-
return {
|
|
21
|
-
"--theme-primaryText": c.primaryText,
|
|
22
|
-
"--theme-accentBlue": c.accentBlue,
|
|
23
|
-
"--theme-lightBlueBg": c.lightBlueBg,
|
|
24
|
-
"--theme-selectedRow": c.selectedRow,
|
|
25
|
-
"--theme-borderGray": c.borderGray,
|
|
26
|
-
"--theme-primaryButtonHoverColor": c.primaryButtonHoverColor,
|
|
27
|
-
"--theme-white": c.white,
|
|
28
|
-
"--theme-borderColor": c.borderColor,
|
|
29
|
-
};
|
|
30
|
-
}, [themeId]);
|
|
31
16
|
const t = React.useMemo(() => getTranslations(language), [language]);
|
|
32
17
|
const menuItems = React.useMemo(() => [
|
|
33
18
|
{
|
|
@@ -40,7 +25,7 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en', module
|
|
|
40
25
|
icon: _jsx(SampleMgmtIcon, {}),
|
|
41
26
|
path: `/sample/${language}/sample-listing`,
|
|
42
27
|
},
|
|
43
|
-
], [
|
|
28
|
+
], [t, language]);
|
|
44
29
|
// Sync selection with module prop or current path
|
|
45
30
|
React.useEffect(() => {
|
|
46
31
|
// If module prop is provided, use it to set the selection
|
|
@@ -76,7 +61,7 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en', module
|
|
|
76
61
|
setSelectedMainMenu(item.text);
|
|
77
62
|
window.location.href = item.path;
|
|
78
63
|
};
|
|
79
|
-
return (_jsx(Box, { className: "side-menu-container",
|
|
64
|
+
return (_jsx(Box, { className: "side-menu-container", children: _jsx(Drawer, { variant: "permanent", className: "parent-container", sx: {
|
|
80
65
|
width: isDrawerOpen ? 230 : 64,
|
|
81
66
|
flexShrink: 0,
|
|
82
67
|
zIndex: 100,
|
|
@@ -84,9 +69,9 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en', module
|
|
|
84
69
|
width: isDrawerOpen ? 230 : 64,
|
|
85
70
|
transition: "width 0.3s ease",
|
|
86
71
|
position: "fixed",
|
|
87
|
-
top: "65px",
|
|
88
|
-
height: "calc(100vh - 65px)",
|
|
89
|
-
borderRight: "1px solid var(--
|
|
72
|
+
top: "var(--size-header-height, 65px)",
|
|
73
|
+
height: "calc(100vh - var(--size-header-height, 65px))",
|
|
74
|
+
borderRight: "1px solid var(--color-border-header, #e5e9eb)",
|
|
90
75
|
overflowY: "auto",
|
|
91
76
|
zIndex: 100,
|
|
92
77
|
},
|
package/dist/src/sidemenu.scss
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Fallbacks match default theme (#1E2F97 primaryText, #1AA7EE accentBlue).
|
|
1
|
+
//overwritten the default MUI css
|
|
3
2
|
|
|
4
3
|
// Side menu container
|
|
5
4
|
.side-menu-container {
|
|
@@ -8,62 +7,51 @@
|
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.MuiBox-root .MuiList-root {
|
|
11
|
-
background:
|
|
12
|
-
|
|
13
|
-
var(--theme-primaryText, #1e2f97),
|
|
14
|
-
var(--theme-primaryText, #1e2f97)
|
|
15
|
-
) !important;
|
|
16
|
-
color: var(--theme-white, #fff);
|
|
10
|
+
background: var(--side-menu-bg) !important;
|
|
11
|
+
color: var(--side-menu-list-color);
|
|
17
12
|
height: 100vh;
|
|
18
13
|
bottom: 0;
|
|
19
|
-
padding:
|
|
14
|
+
padding: var(--side-menu-padding);
|
|
20
15
|
overflow-x: hidden;
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
.MuiList-root {
|
|
24
19
|
.MuiListItem-root {
|
|
25
|
-
padding:
|
|
26
|
-
margin:
|
|
27
|
-
border-radius:
|
|
20
|
+
padding: var(--side-menu-item-padding);
|
|
21
|
+
margin: var(--side-menu-item-margin);
|
|
22
|
+
border-radius: var(--side-menu-item-radius);
|
|
28
23
|
display: flex;
|
|
29
24
|
align-items: center;
|
|
30
25
|
justify-content: center;
|
|
31
|
-
background:
|
|
32
|
-
to bottom,
|
|
33
|
-
var(--theme-accentBlue, #1aa7ee),
|
|
34
|
-
var(--theme-primaryButtonHoverColor, #0a8bcc)
|
|
35
|
-
) !important;
|
|
26
|
+
background: var(--side-menu-item-active-bg) !important;
|
|
36
27
|
|
|
28
|
+
// Width based on menu open/closed state
|
|
37
29
|
&.menu-closed {
|
|
38
|
-
width:
|
|
30
|
+
width: var(--side-menu-item-width-closed);
|
|
39
31
|
}
|
|
40
32
|
|
|
41
33
|
&.menu-open {
|
|
42
|
-
width:
|
|
34
|
+
width: var(--side-menu-item-width-open);
|
|
43
35
|
}
|
|
44
36
|
|
|
37
|
+
// Hover design - override the default background on hover
|
|
45
38
|
&:hover {
|
|
46
|
-
background:
|
|
47
|
-
to bottom,
|
|
48
|
-
var(--theme-accentBlue, #1aa7ee),
|
|
49
|
-
var(--theme-primaryButtonHoverColor, #0a8bcc)
|
|
50
|
-
) !important;
|
|
39
|
+
background: var(--side-menu-item-active-bg) !important;
|
|
51
40
|
}
|
|
52
41
|
|
|
42
|
+
// Default state (not hovered and not selected) - transparent background
|
|
53
43
|
&:not(:hover):not(.Mui-selected) {
|
|
54
|
-
background:
|
|
44
|
+
background: var(--side-menu-item-bg-default) !important;
|
|
55
45
|
}
|
|
56
46
|
|
|
47
|
+
// Selected state - same as hover design
|
|
57
48
|
&.Mui-selected {
|
|
58
|
-
background:
|
|
59
|
-
to bottom,
|
|
60
|
-
var(--theme-accentBlue, #1aa7ee),
|
|
61
|
-
var(--theme-primaryButtonHoverColor, #0a8bcc)
|
|
62
|
-
) !important;
|
|
49
|
+
background: var(--side-menu-item-active-bg) !important;
|
|
63
50
|
}
|
|
64
51
|
|
|
52
|
+
// Normalize all icons (MUI icons and custom SVGs)
|
|
65
53
|
.MuiListItemIcon-root {
|
|
66
|
-
color: var(--
|
|
54
|
+
color: var(--side-menu-icon-color-active);
|
|
67
55
|
min-width: auto;
|
|
68
56
|
margin-right: 0;
|
|
69
57
|
cursor: pointer;
|
|
@@ -71,24 +59,27 @@
|
|
|
71
59
|
align-items: center;
|
|
72
60
|
justify-content: center;
|
|
73
61
|
|
|
62
|
+
// Ensure consistent icon sizing for both MUI icons and custom SVGs
|
|
74
63
|
svg,
|
|
75
64
|
.MuiSvgIcon-root {
|
|
76
|
-
width:
|
|
77
|
-
height:
|
|
65
|
+
width: var(--side-menu-icon-size);
|
|
66
|
+
height: var(--side-menu-icon-size);
|
|
78
67
|
display: block;
|
|
79
|
-
fill: var(--
|
|
80
|
-
color: var(--
|
|
68
|
+
fill: var(--side-menu-icon-color-active);
|
|
69
|
+
color: var(--side-menu-icon-color-active);
|
|
81
70
|
}
|
|
82
71
|
}
|
|
83
72
|
|
|
73
|
+
// Icon color changes on hover (white when not hovered and not selected)
|
|
84
74
|
&:not(:hover):not(.Mui-selected) .MuiListItemIcon-root {
|
|
85
75
|
svg,
|
|
86
76
|
.MuiSvgIcon-root {
|
|
87
|
-
fill: var(--
|
|
88
|
-
color: var(--
|
|
77
|
+
fill: var(--side-menu-icon-color-default);
|
|
78
|
+
color: var(--side-menu-icon-color-default);
|
|
89
79
|
}
|
|
90
80
|
}
|
|
91
81
|
|
|
82
|
+
// Add margin-right to icon only when text is visible
|
|
92
83
|
.MuiListItemIcon-root + .MuiListItemText-root {
|
|
93
84
|
margin-left: 8px;
|
|
94
85
|
}
|
|
@@ -97,15 +88,18 @@
|
|
|
97
88
|
margin: 0;
|
|
98
89
|
|
|
99
90
|
.MuiTypography-root {
|
|
100
|
-
font:
|
|
101
|
-
|
|
91
|
+
font-family: var(--side-menu-text-font-family);
|
|
92
|
+
font-size: var(--side-menu-text-font-size);
|
|
93
|
+
line-height: var(--side-menu-text-line-height);
|
|
94
|
+
color: var(--side-menu-text-color-active);
|
|
102
95
|
cursor: pointer;
|
|
103
96
|
white-space: nowrap;
|
|
104
97
|
}
|
|
105
98
|
}
|
|
106
99
|
|
|
100
|
+
// Text color changes on hover (white when not hovered and not selected)
|
|
107
101
|
&:not(:hover):not(.Mui-selected) .MuiListItemText-root .MuiTypography-root {
|
|
108
|
-
color: var(--
|
|
102
|
+
color: var(--side-menu-text-color-default);
|
|
109
103
|
}
|
|
110
104
|
}
|
|
111
105
|
}
|
|
@@ -119,16 +113,16 @@
|
|
|
119
113
|
}
|
|
120
114
|
|
|
121
115
|
.MuiList-root.MuiMenu-list {
|
|
122
|
-
border-radius:
|
|
116
|
+
border-radius: var(--side-menu-popover-radius);
|
|
123
117
|
}
|
|
124
118
|
|
|
125
119
|
#more-menu {
|
|
126
120
|
.MuiPaper-root {
|
|
127
121
|
.MuiMenu-list {
|
|
128
|
-
color: var(--
|
|
122
|
+
color: var(--side-menu-more-menu-color);
|
|
129
123
|
.MuiMenuItem-root {
|
|
130
|
-
font-size:
|
|
124
|
+
font-size: var(--side-menu-more-menu-font-size);
|
|
131
125
|
}
|
|
132
126
|
}
|
|
133
127
|
}
|
|
134
|
-
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* ================================================================
|
|
2
|
+
TENANT MODULE CSS — lnc-menu-npm-fe
|
|
3
|
+
Auto-generated by generate-tenant-css.js
|
|
4
|
+
Branch scanned: Development
|
|
5
|
+
Covers: CSS var() references, SCSS $variables, and hardcoded
|
|
6
|
+
brand values detected in component files.
|
|
7
|
+
================================================================ */
|
|
8
|
+
|
|
9
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
10
|
+
MODULE: side-menu (lnc-menu-npm-fe)
|
|
11
|
+
CSS custom-properties consumed by this micro-frontend.
|
|
12
|
+
These are default / fallback values overridden by tenant.css.
|
|
13
|
+
═══════════════════════════════════════════════════════════════ */
|
|
14
|
+
:root {
|
|
15
|
+
--side-menu-bg: #ffffff;
|
|
16
|
+
--side-menu-icon-color-active: #1e2f97;
|
|
17
|
+
--side-menu-icon-color-default: rgba(0, 0, 0, 0.54);
|
|
18
|
+
--side-menu-icon-size: 24px;
|
|
19
|
+
--side-menu-item-active-bg: rgba(30, 47, 151, 0.08);
|
|
20
|
+
--side-menu-item-bg-default: transparent;
|
|
21
|
+
--side-menu-item-margin: 4px 8px;
|
|
22
|
+
--side-menu-item-padding: 8px;
|
|
23
|
+
--side-menu-item-radius: 4px;
|
|
24
|
+
--side-menu-item-width-closed: 40px;
|
|
25
|
+
--side-menu-item-width-open: 198px;
|
|
26
|
+
--side-menu-list-color: rgba(0, 0, 0, 0.87);
|
|
27
|
+
--side-menu-more-menu-color: rgba(0, 0, 0, 0.87);
|
|
28
|
+
--side-menu-more-menu-font-size: 14px;
|
|
29
|
+
--side-menu-padding: 0;
|
|
30
|
+
--side-menu-popover-radius: 4px;
|
|
31
|
+
--side-menu-text-color-active: #1e2f97;
|
|
32
|
+
--side-menu-text-color-default: rgba(0, 0, 0, 0.87);
|
|
33
|
+
--side-menu-text-font-family: "opensans-regular";
|
|
34
|
+
--side-menu-text-font-size: 14px;
|
|
35
|
+
--side-menu-text-line-height: 1.4;
|
|
36
|
+
|
|
37
|
+
/* ── Auto-discovered on 2026-03-14 ── */
|
|
38
|
+
--color-border-header: #e5e9eb;
|
|
39
|
+
|
|
40
|
+
/* ── Auto-discovered on 2026-03-15 ── */
|
|
41
|
+
--size-header-height: 65px;
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
"name": "@cullsin/lnc-menu",
|
|
3
|
+
"version": "7.0.4",
|
|
4
|
+
"description": "Reusable SideMenu component for MedGenome LNC platform using MUI",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"style": "dist/src/tenant.module.css",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "npm run generate:tenant && tsc && npm run copy-css",
|
|
13
|
+
"copy-css": "cpy src/sidemenu.scss src/tenant.module.css dist/src --flat",
|
|
14
|
+
"generate:tenant": "node generate-tenant-css.mjs"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@mui/icons-material": "^5.14.0",
|
|
22
|
+
"@mui/material": "^5.14.0",
|
|
23
|
+
"react-router-dom": "^7.6.2"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"cpy-cli": "^5.0.0",
|
|
27
|
+
"typescript": "^5.0.0"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/cullsin/lnc-menu"
|
|
32
|
+
},
|
|
33
|
+
"author": "Raja Kulasekaran \u003ccullsin@gmail.com\u003e"
|
|
32
34
|
}
|