@cullsin/lnc-menu 7.1.2 → 7.1.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.
@@ -3,7 +3,7 @@ import RecentActorsOutlinedIcon from "@mui/icons-material/RecentActorsOutlined";
3
3
  import Box from "@mui/material/Box";
4
4
  import Drawer from "@mui/material/Drawer";
5
5
  import List from "@mui/material/List";
6
- import ListItem from "@mui/material/ListItem";
6
+ import ListItemButton from "@mui/material/ListItemButton";
7
7
  import ListItemIcon from "@mui/material/ListItemIcon";
8
8
  import ListItemText from "@mui/material/ListItemText";
9
9
  import Tooltip from "@mui/material/Tooltip";
@@ -85,7 +85,7 @@ function SideMenu({ useDrawer, location, language = 'en', module }) {
85
85
  background: "transparent",
86
86
  },
87
87
  },
88
- }, children: _jsx(List, { sx: { padding: "var(--side-menu-padding, 0)", paddingTop: "8px" }, children: menuItems.map((item, index) => (_jsx(Tooltip, { title: item.text, placement: "right", disableHoverListener: isDrawerOpen, children: _jsxs(ListItem, { button: true, selected: selectedMainMenu === item.text, className: isDrawerOpen ? "menu-open" : "menu-closed", onClick: () => handleMenuClick(item), sx: {
88
+ }, children: _jsx(List, { sx: { padding: "var(--side-menu-padding, 0)", paddingTop: "8px" }, children: menuItems.map((item, index) => (_jsx(Tooltip, { title: item.text, placement: "right", disableHoverListener: isDrawerOpen, children: _jsxs(ListItemButton, { selected: selectedMainMenu === item.text, className: isDrawerOpen ? "menu-open" : "menu-closed", onClick: () => handleMenuClick(item), sx: {
89
89
  padding: "var(--side-menu-item-padding, 8px)",
90
90
  margin: "var(--side-menu-item-margin, 4px 8px)",
91
91
  borderRadius: "var(--side-menu-item-radius, 8px)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cullsin/lnc-menu",
3
- "version": "7.1.2",
3
+ "version": "7.1.4",
4
4
  "description": "Reusable SideMenu component for MedGenome LNC platform using MUI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,8 +19,10 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@mui/icons-material": "^5.14.0",
23
- "@mui/material": "^5.14.0",
22
+ "@emotion/react": "^11.14.0",
23
+ "@emotion/styled": "^11.14.0",
24
+ "@mui/icons-material": "^7.3.5",
25
+ "@mui/material": "^7.3.5",
24
26
  "react-router-dom": "^7.6.2"
25
27
  },
26
28
  "peerDependencies": {
@@ -1,186 +0,0 @@
1
- // Theme-aware: colors from CSS vars (set by SideMenu when themeId is passed). Fallbacks = default theme.
2
- .parent-container .MuiDrawer-paper .MuiList-root {
3
- background: linear-gradient(
4
- to bottom,
5
- var(--menu-list-bg-start, #1e2f97),
6
- var(--menu-list-bg-end, #0b1659)
7
- ) !important;
8
- color: var(--menu-list-color, #fff);
9
- height: 100%;
10
- bottom: 0;
11
- padding: 20px 0;
12
- }
13
-
14
- .parent-container .MuiList-root {
15
- .MuiListItem-root {
16
- padding: 15px;
17
- &.selected {
18
- padding: 7px;
19
-
20
- .MuiListItemIcon-root {
21
- background: linear-gradient(
22
- to bottom,
23
- var(--menu-selected-bg-start, #7ad4f7),
24
- var(--menu-selected-bg-end, #20a9ef)
25
- ) !important;
26
- color: var(--menu-selected-color, #1e2f97);
27
- padding: 10px;
28
- min-width: 25px;
29
- border-top-left-radius: 5px;
30
- border-bottom-left-radius: 5px;
31
-
32
- &:only-of-type {
33
- border-top-right-radius: 5px;
34
- border-bottom-right-radius: 5px;
35
- }
36
- }
37
-
38
- .MuiListItemText-root {
39
- span {
40
- background: linear-gradient(
41
- to bottom,
42
- var(--menu-selected-bg-start, #7ad4f7),
43
- var(--menu-selected-bg-end, #20a9ef)
44
- ) !important;
45
- padding: 10px 0;
46
- min-width: 25px;
47
- border-top-right-radius: 5px;
48
- border-bottom-right-radius: 5px;
49
- }
50
- }
51
- }
52
-
53
- &:hover:not(.selected) {
54
- padding: 5px 7px;
55
-
56
- .MuiListItemIcon-root {
57
- background: linear-gradient(
58
- to bottom,
59
- var(--menu-selected-bg-start, #7ad4f7),
60
- var(--menu-selected-bg-end, #20a9ef)
61
- ) !important;
62
- color: var(--menu-selected-color, #1e2f97);
63
- padding: 10px;
64
- min-width: 25px;
65
- border-top-left-radius: 5px;
66
- border-bottom-left-radius: 5px;
67
-
68
- &:only-of-type {
69
- border-top-right-radius: 5px;
70
- border-bottom-right-radius: 5px;
71
- }
72
- }
73
-
74
- .MuiListItemText-root {
75
- span {
76
- background: linear-gradient(
77
- to bottom,
78
- var(--menu-selected-bg-start, #7ad4f7),
79
- var(--menu-selected-bg-end, #20a9ef)
80
- ) !important;
81
- padding: 10px 0;
82
- min-width: 25px;
83
- border-top-right-radius: 5px;
84
- border-bottom-right-radius: 5px;
85
- }
86
- .MuiTypography-root {
87
- color: var(--menu-selected-color, #1e2f97);
88
- }
89
- }
90
- }
91
-
92
- .MuiListItemIcon-root {
93
- color: var(--menu-list-color, #fff);
94
- min-width: 30px;
95
- cursor: pointer;
96
- }
97
-
98
- .MuiListItemText-root {
99
- margin-top: 0;
100
- margin-bottom: 0;
101
- .MuiTypography-root {
102
- font: 14px/24px "OpenSans-SemiBold";
103
- color: var(--menu-list-color, #fff);
104
- cursor: pointer;
105
- white-space: nowrap;
106
- }
107
- }
108
- }
109
- }
110
-
111
- .app-menu-item {
112
- .MuiList-root {
113
- &.MuiMenu-list {
114
- background: var(--menu-popover-bg, #fff) !important;
115
- color: var(--menu-popover-text, #1e2f97);
116
- width: 200px;
117
- padding: 10px;
118
- position: relative;
119
- overflow: visible;
120
- border: 1px solid var(--menu-popover-border, #dadada);
121
- .submenu-title {
122
- text-transform: uppercase;
123
- font: 12px / 18px "OpenSans-Regular";
124
- color: var(--menu-popover-text, #1e2f97);
125
- padding: 0 0 5px 10px;
126
- display: block;
127
- border-bottom: 1px solid var(--menu-popover-border, rgba(0, 0, 0, 0.12));
128
- margin-bottom: 5px;
129
- }
130
- .MuiMenuItem-root {
131
- &.Mui-focusVisible {
132
- background-color: transparent;
133
- }
134
-
135
- &:hover {
136
- font: 16px/24px "OpenSans-SemiBold";
137
- background: var(--menu-popover-selected, #DDF7FF);
138
- border-radius: 6px;
139
- }
140
- }
141
- }
142
- }
143
-
144
- &.collapsed-menu {
145
- .MuiList-root {
146
- &.MuiMenu-list {
147
- &::before {
148
- content: "";
149
- position: absolute;
150
- top: 15px;
151
- left: -8px;
152
- width: 0;
153
- height: 0;
154
- border-top: 8px solid transparent;
155
- border-bottom: 8px solid transparent;
156
- border-right: 8px solid var(--menu-popover-border, #516578);
157
- z-index: 2;
158
- }
159
- }
160
- }
161
- }
162
- }
163
-
164
-
165
- .MuiPopover-root {
166
- .MuiPaper-root {
167
- overflow: visible;
168
- position: relative;
169
- width: max-content;
170
- }
171
- }
172
-
173
- .MuiList-root.MuiMenu-list {
174
- border-radius: 5px;
175
- }
176
-
177
- #more-menu {
178
- .MuiPaper-root {
179
- .MuiMenu-list {
180
- color: #1e2f97;
181
- .MuiMenuItem-root {
182
- font-size: 14px;
183
- }
184
- }
185
- }
186
- }
@@ -1,10 +0,0 @@
1
- import type { CustomColors, ThemeId, ThemesJson as ThemesJsonType } from "./types";
2
- declare const themes: ThemesJsonType;
3
- /**
4
- * Returns custom colors for the given theme id.
5
- * Used by SideMenu to inject CSS variables so menu colors match the host app theme.
6
- */
7
- export declare function getThemeColors(themeId: string): CustomColors;
8
- export declare const themeIds: ThemeId[];
9
- export { themes as themesConfig };
10
- export type { ThemeId, CustomColors, ThemeConfig, ThemesJson } from "./types";
@@ -1,15 +0,0 @@
1
- import { themesData } from "./themesData";
2
- const themes = themesData;
3
- const VALID_THEME_IDS = ["default", "ocean", "forest", "sunset"];
4
- /**
5
- * Returns custom colors for the given theme id.
6
- * Used by SideMenu to inject CSS variables so menu colors match the host app theme.
7
- */
8
- export function getThemeColors(themeId) {
9
- var _a;
10
- const id = VALID_THEME_IDS.indexOf(themeId) !== -1 ? themeId : "default";
11
- const config = (_a = themes[id]) !== null && _a !== void 0 ? _a : themes.default;
12
- return config.customColors;
13
- }
14
- export const themeIds = VALID_THEME_IDS;
15
- export { themes as themesConfig };
@@ -1,3 +0,0 @@
1
- import type { ThemesJson } from "./types";
2
- /** Theme definitions matching mgm-linc-patient-ui themes for consistent menu colors. */
3
- export declare const themesData: ThemesJson;
@@ -1,83 +0,0 @@
1
- /** Theme definitions matching mgm-linc-patient-ui themes for consistent menu colors. */
2
- export const themesData = {
3
- default: {
4
- name: "Default",
5
- customColors: {
6
- primaryText: "#1E2F97",
7
- accentBlue: "#1AA7EE",
8
- lightBlueBg: "#EBEFF5",
9
- selectedRow: "#DDF7FF",
10
- borderGray: "#dadada",
11
- columnSeparator: "#999",
12
- switchTrack: "#657BFD",
13
- black: "#000",
14
- white: "#fff",
15
- borderColor: "#B5E6FF",
16
- titleSectionBackground: "#e6f2ff",
17
- errorTextColor: "#D32F2F",
18
- columnHeaders: "#b5e6ff",
19
- columnRowsEven: "#EDFBFF",
20
- primaryButtonHoverColor: "#0A8BCC",
21
- },
22
- },
23
- ocean: {
24
- name: "Ocean",
25
- customColors: {
26
- primaryText: "#0D47A1",
27
- accentBlue: "#0288D1",
28
- lightBlueBg: "#E3F2FD",
29
- selectedRow: "#B3E5FC",
30
- borderGray: "#B0BEC5",
31
- columnSeparator: "#78909C",
32
- switchTrack: "#0288D1",
33
- black: "#263238",
34
- white: "#fff",
35
- borderColor: "#81D4FA",
36
- titleSectionBackground: "#E1F5FE",
37
- errorTextColor: "#C62828",
38
- columnHeaders: "#E3F2FD",
39
- columnRowsEven: "#E1F5FE",
40
- primaryButtonHoverColor: "#01579B",
41
- },
42
- },
43
- forest: {
44
- name: "Forest",
45
- customColors: {
46
- primaryText: "#1B5E20",
47
- accentBlue: "#2E7D32",
48
- lightBlueBg: "#E8F5E9",
49
- selectedRow: "#C8E6C9",
50
- borderGray: "#C8E6C9",
51
- columnSeparator: "#66BB6A",
52
- switchTrack: "#43A047",
53
- black: "#1B5E20",
54
- white: "#fff",
55
- borderColor: "#A5D6A7",
56
- titleSectionBackground: "#E8F5E9",
57
- errorTextColor: "#B71C1C",
58
- columnHeaders: "#E8F5E9",
59
- columnRowsEven: "#F1F8E9",
60
- primaryButtonHoverColor: "#1B5E20",
61
- },
62
- },
63
- sunset: {
64
- name: "Sunset",
65
- customColors: {
66
- primaryText: "#BF360C",
67
- accentBlue: "#E64A19",
68
- lightBlueBg: "#FBE9E7",
69
- selectedRow: "#FFCCBC",
70
- borderGray: "#D7CCC8",
71
- columnSeparator: "#A1887F",
72
- switchTrack: "#FF5722",
73
- black: "#3E2723",
74
- white: "#fff",
75
- borderColor: "#FFAB91",
76
- titleSectionBackground: "#FBE9E7",
77
- errorTextColor: "#B71C1C",
78
- columnHeaders: "#FBE9E7",
79
- columnRowsEven: "#FFF8E1",
80
- primaryButtonHoverColor: "#BF360C",
81
- },
82
- },
83
- };
@@ -1,29 +0,0 @@
1
- /** Custom colors per theme – must match mgm-linc-patient-ui themes for consistent menu styling. */
2
- export interface CustomColors {
3
- primaryText: string;
4
- accentBlue: string;
5
- lightBlueBg: string;
6
- selectedRow: string;
7
- borderGray: string;
8
- columnSeparator: string;
9
- switchTrack: string;
10
- black: string;
11
- white: string;
12
- borderColor: string;
13
- titleSectionBackground: string;
14
- errorTextColor: string;
15
- columnHeaders: string;
16
- columnRowsEven: string;
17
- primaryButtonHoverColor: string;
18
- }
19
- export interface ThemeConfig {
20
- name: string;
21
- customColors: CustomColors;
22
- }
23
- export type ThemeId = "default" | "ocean" | "forest" | "sunset";
24
- export interface ThemesJson {
25
- default: ThemeConfig;
26
- ocean: ThemeConfig;
27
- forest: ThemeConfig;
28
- sunset: ThemeConfig;
29
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,30 +0,0 @@
1
- /**
2
- * Theme colors aligned with mgm-linc-patient-ui (default, ocean, forest, sunset).
3
- * Used when themeId is passed to SideMenu to reflect the host app's theme.
4
- */
5
- export type ThemeId = "default" | "ocean" | "forest" | "sunset";
6
- export interface MenuThemeColors {
7
- /** Primary text and icon color */
8
- primaryText: string;
9
- /** Accent / primary actions */
10
- accentBlue: string;
11
- /** Drawer/menu background */
12
- lightBlueBg: string;
13
- /** Selected item background */
14
- selectedRow: string;
15
- /** Borders */
16
- borderGray: string;
17
- borderColor: string;
18
- /** Hover state (derived or from theme) */
19
- primaryButtonHoverColor: string;
20
- white: string;
21
- black: string;
22
- /** Sidebar list gradient (dark strip) – start and end for theme coherence */
23
- sidebarBgStart: string;
24
- sidebarBgEnd: string;
25
- /** Selected/hover pill gradient in sidebar */
26
- sidebarSelectedStart: string;
27
- sidebarSelectedEnd: string;
28
- }
29
- export declare function getMenuTheme(themeId: string | undefined): MenuThemeColors;
30
- export declare const themeIds: ThemeId[];
@@ -1,68 +0,0 @@
1
- const MENU_THEMES = {
2
- default: {
3
- primaryText: "#1E2F97",
4
- accentBlue: "#1AA7EE",
5
- lightBlueBg: "#EBEFF5",
6
- selectedRow: "#DDF7FF",
7
- borderGray: "#dadada",
8
- borderColor: "#B5E6FF",
9
- primaryButtonHoverColor: "#0A8BCC",
10
- white: "#fff",
11
- black: "#000",
12
- sidebarBgStart: "#1E2F97",
13
- sidebarBgEnd: "#0b1659",
14
- sidebarSelectedStart: "#7ad4f7",
15
- sidebarSelectedEnd: "#20a9ef",
16
- },
17
- ocean: {
18
- primaryText: "#0D47A1",
19
- accentBlue: "#0288D1",
20
- lightBlueBg: "#E3F2FD",
21
- selectedRow: "#B3E5FC",
22
- borderGray: "#B0BEC5",
23
- borderColor: "#81D4FA",
24
- primaryButtonHoverColor: "#01579B",
25
- white: "#fff",
26
- black: "#263238",
27
- sidebarBgStart: "#0D47A1",
28
- sidebarBgEnd: "#01579B",
29
- sidebarSelectedStart: "#81D4FA",
30
- sidebarSelectedEnd: "#0288D1",
31
- },
32
- forest: {
33
- primaryText: "#1B5E20",
34
- accentBlue: "#2E7D32",
35
- lightBlueBg: "#E8F5E9",
36
- selectedRow: "#C8E6C9",
37
- borderGray: "#C8E6C9",
38
- borderColor: "#A5D6A7",
39
- primaryButtonHoverColor: "#1B5E20",
40
- white: "#fff",
41
- black: "#1B5E20",
42
- sidebarBgStart: "#1B5E20",
43
- sidebarBgEnd: "#0d3312",
44
- sidebarSelectedStart: "#A5D6A7",
45
- sidebarSelectedEnd: "#2E7D32",
46
- },
47
- sunset: {
48
- primaryText: "#BF360C",
49
- accentBlue: "#E64A19",
50
- lightBlueBg: "#FBE9E7",
51
- selectedRow: "#FFCCBC",
52
- borderGray: "#D7CCC8",
53
- borderColor: "#FFAB91",
54
- primaryButtonHoverColor: "#BF360C",
55
- white: "#fff",
56
- black: "#3E2723",
57
- sidebarBgStart: "#BF360C",
58
- sidebarBgEnd: "#8B250A",
59
- sidebarSelectedStart: "#FFAB91",
60
- sidebarSelectedEnd: "#E64A19",
61
- },
62
- };
63
- const DEFAULT_THEME_ID = "default";
64
- export function getMenuTheme(themeId) {
65
- const id = themeId && themeId in MENU_THEMES ? themeId : DEFAULT_THEME_ID;
66
- return MENU_THEMES[id];
67
- }
68
- export const themeIds = ["default", "ocean", "forest", "sunset"];
@@ -1 +0,0 @@
1
- {"root":["../src/sidemenu.tsx","../src/translations/en.ts","../src/translations/es.ts","../src/translations/index.ts","../index.ts"],"version":"5.9.3"}