@cullsin/lnc-menu 6.9.0 → 7.0.1
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 +2 -0
- package/dist/index.js +1 -0
- package/dist/src/SideMenu.d.ts +4 -1
- package/dist/src/SideMenu.js +20 -19
- package/dist/src/sidemenu.scss +37 -25
- package/dist/src/src/sidemenu.scss +186 -0
- package/dist/src/themes/index.d.ts +10 -0
- package/dist/src/themes/index.js +15 -0
- package/dist/src/themes/themesData.d.ts +3 -0
- package/dist/src/themes/themesData.js +83 -0
- package/dist/src/themes/types.d.ts +29 -0
- package/dist/src/themes/types.js +1 -0
- package/dist/src/themes.d.ts +30 -0
- package/dist/src/themes.js +68 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
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
|
+
export { getThemeColors, themeIds, themesConfig } from './src/themes';
|
|
5
|
+
export type { ThemeId, CustomColors, ThemeConfig, ThemesJson } from './src/themes';
|
|
4
6
|
import './src/sidemenu.scss';
|
package/dist/index.js
CHANGED
package/dist/src/SideMenu.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Location, NavigateFunction } from "react-router-dom";
|
|
3
|
+
import type { ThemeId } from "./themes";
|
|
3
4
|
import { Language } from "./translations";
|
|
4
5
|
interface SideMenuProps {
|
|
5
6
|
useDrawer: () => {
|
|
@@ -11,6 +12,8 @@ interface SideMenuProps {
|
|
|
11
12
|
location: Location;
|
|
12
13
|
language?: Language;
|
|
13
14
|
module?: 'sample' | 'patient';
|
|
15
|
+
/** Theme id for menu colors (default | ocean | forest | sunset). Matches mgm-linc-patient-ui themes. */
|
|
16
|
+
themeId?: ThemeId | string;
|
|
14
17
|
}
|
|
15
|
-
declare function SideMenu({ useDrawer, SampleMgmtIcon, location, language, module }: SideMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function SideMenu({ useDrawer, SampleMgmtIcon, location, language, module, themeId }: SideMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
16
19
|
export default SideMenu;
|
package/dist/src/SideMenu.js
CHANGED
|
@@ -8,10 +8,26 @@ 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";
|
|
11
12
|
import { getTranslations } from "./translations";
|
|
12
|
-
function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en', module }) {
|
|
13
|
+
function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en', module, themeId }) {
|
|
13
14
|
const [selectedMainMenu, setSelectedMainMenu] = React.useState(null);
|
|
14
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]);
|
|
15
31
|
const t = React.useMemo(() => getTranslations(language), [language]);
|
|
16
32
|
const menuItems = React.useMemo(() => [
|
|
17
33
|
{
|
|
@@ -60,7 +76,7 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en', module
|
|
|
60
76
|
setSelectedMainMenu(item.text);
|
|
61
77
|
window.location.href = item.path;
|
|
62
78
|
};
|
|
63
|
-
return (_jsx(Box, { className: "side-menu-container", children: _jsx(Drawer, { variant: "permanent", className: "parent-container", sx: {
|
|
79
|
+
return (_jsx(Box, { className: "side-menu-container", sx: themeCssVars, children: _jsx(Drawer, { variant: "permanent", className: "parent-container", sx: {
|
|
64
80
|
width: isDrawerOpen ? 230 : 64,
|
|
65
81
|
flexShrink: 0,
|
|
66
82
|
zIndex: 100,
|
|
@@ -70,25 +86,10 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en', module
|
|
|
70
86
|
position: "fixed",
|
|
71
87
|
top: "65px",
|
|
72
88
|
height: "calc(100vh - 65px)",
|
|
73
|
-
borderRight: "1px solid #B1BECB",
|
|
89
|
+
borderRight: "1px solid var(--theme-borderGray, #B1BECB)",
|
|
74
90
|
overflowY: "auto",
|
|
75
91
|
zIndex: 100,
|
|
76
92
|
},
|
|
77
|
-
}, children: _jsx(List, { 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),
|
|
78
|
-
"&.Mui-selected": {
|
|
79
|
-
backgroundColor: "rgba(25, 118, 210, 0.08)",
|
|
80
|
-
borderLeft: "3px solid #1976d2",
|
|
81
|
-
"&:hover": {
|
|
82
|
-
backgroundColor: "rgba(25, 118, 210, 0.12)",
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
"&.Mui-selected .MuiListItemIcon-root": {
|
|
86
|
-
color: "#1976d2",
|
|
87
|
-
},
|
|
88
|
-
"&.Mui-selected .MuiListItemText-primary": {
|
|
89
|
-
color: "#1976d2",
|
|
90
|
-
fontWeight: 600,
|
|
91
|
-
},
|
|
92
|
-
}, children: [_jsx(ListItemIcon, { children: item.icon }), isDrawerOpen && _jsx(ListItemText, { primary: item.text })] }) }, index))) }) }) }));
|
|
93
|
+
}, children: _jsx(List, { 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), children: [_jsx(ListItemIcon, { children: item.icon }), isDrawerOpen && _jsx(ListItemText, { primary: item.text })] }) }, index))) }) }) }));
|
|
93
94
|
}
|
|
94
95
|
export default SideMenu;
|
package/dist/src/sidemenu.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Theme-aware side menu – uses CSS variables (--theme-*) from host or from themeId prop.
|
|
2
|
+
// Fallbacks match default theme (#1E2F97 primaryText, #1AA7EE accentBlue).
|
|
2
3
|
|
|
3
4
|
// Side menu container
|
|
4
5
|
.side-menu-container {
|
|
@@ -7,8 +8,12 @@
|
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.MuiBox-root .MuiList-root {
|
|
10
|
-
background: linear-gradient(
|
|
11
|
-
|
|
11
|
+
background: linear-gradient(
|
|
12
|
+
to bottom,
|
|
13
|
+
var(--theme-primaryText, #1e2f97),
|
|
14
|
+
var(--theme-primaryText, #1e2f97)
|
|
15
|
+
) !important;
|
|
16
|
+
color: var(--theme-white, #fff);
|
|
12
17
|
height: 100vh;
|
|
13
18
|
bottom: 0;
|
|
14
19
|
padding: 20px 0;
|
|
@@ -17,16 +22,18 @@
|
|
|
17
22
|
|
|
18
23
|
.MuiList-root {
|
|
19
24
|
.MuiListItem-root {
|
|
20
|
-
// Apply capsule layout with gradient permanently for testing
|
|
21
25
|
padding: 8px 12px;
|
|
22
26
|
margin: 12px 6px 0px 6px;
|
|
23
27
|
border-radius: 15px;
|
|
24
28
|
display: flex;
|
|
25
29
|
align-items: center;
|
|
26
30
|
justify-content: center;
|
|
27
|
-
background: linear-gradient(
|
|
31
|
+
background: linear-gradient(
|
|
32
|
+
to bottom,
|
|
33
|
+
var(--theme-accentBlue, #1aa7ee),
|
|
34
|
+
var(--theme-primaryButtonHoverColor, #0a8bcc)
|
|
35
|
+
) !important;
|
|
28
36
|
|
|
29
|
-
// Width based on menu open/closed state
|
|
30
37
|
&.menu-closed {
|
|
31
38
|
width: 52px;
|
|
32
39
|
}
|
|
@@ -35,19 +42,28 @@
|
|
|
35
42
|
width: 218px;
|
|
36
43
|
}
|
|
37
44
|
|
|
38
|
-
// Hover design - override the default background on hover
|
|
39
45
|
&:hover {
|
|
40
|
-
background: linear-gradient(
|
|
46
|
+
background: linear-gradient(
|
|
47
|
+
to bottom,
|
|
48
|
+
var(--theme-accentBlue, #1aa7ee),
|
|
49
|
+
var(--theme-primaryButtonHoverColor, #0a8bcc)
|
|
50
|
+
) !important;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
|
-
|
|
44
|
-
&:not(:hover) {
|
|
53
|
+
&:not(:hover):not(.Mui-selected) {
|
|
45
54
|
background: transparent !important;
|
|
46
55
|
}
|
|
47
56
|
|
|
48
|
-
|
|
57
|
+
&.Mui-selected {
|
|
58
|
+
background: linear-gradient(
|
|
59
|
+
to bottom,
|
|
60
|
+
var(--theme-accentBlue, #1aa7ee),
|
|
61
|
+
var(--theme-primaryButtonHoverColor, #0a8bcc)
|
|
62
|
+
) !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
49
65
|
.MuiListItemIcon-root {
|
|
50
|
-
color: #1e2f97;
|
|
66
|
+
color: var(--theme-primaryText, #1e2f97);
|
|
51
67
|
min-width: auto;
|
|
52
68
|
margin-right: 0;
|
|
53
69
|
cursor: pointer;
|
|
@@ -55,27 +71,24 @@
|
|
|
55
71
|
align-items: center;
|
|
56
72
|
justify-content: center;
|
|
57
73
|
|
|
58
|
-
// Ensure consistent icon sizing for both MUI icons and custom SVGs
|
|
59
74
|
svg,
|
|
60
75
|
.MuiSvgIcon-root {
|
|
61
76
|
width: 24px;
|
|
62
77
|
height: 25px;
|
|
63
78
|
display: block;
|
|
64
|
-
fill: #1e2f97;
|
|
65
|
-
color: #1e2f97;
|
|
79
|
+
fill: var(--theme-primaryText, #1e2f97);
|
|
80
|
+
color: var(--theme-primaryText, #1e2f97);
|
|
66
81
|
}
|
|
67
82
|
}
|
|
68
83
|
|
|
69
|
-
|
|
70
|
-
&:not(:hover) .MuiListItemIcon-root {
|
|
84
|
+
&:not(:hover):not(.Mui-selected) .MuiListItemIcon-root {
|
|
71
85
|
svg,
|
|
72
86
|
.MuiSvgIcon-root {
|
|
73
|
-
fill: #fff;
|
|
74
|
-
color: #fff;
|
|
87
|
+
fill: var(--theme-white, #fff);
|
|
88
|
+
color: var(--theme-white, #fff);
|
|
75
89
|
}
|
|
76
90
|
}
|
|
77
91
|
|
|
78
|
-
// Add margin-right to icon only when text is visible
|
|
79
92
|
.MuiListItemIcon-root + .MuiListItemText-root {
|
|
80
93
|
margin-left: 8px;
|
|
81
94
|
}
|
|
@@ -85,15 +98,14 @@
|
|
|
85
98
|
|
|
86
99
|
.MuiTypography-root {
|
|
87
100
|
font: 14px/24px "OpenSans-SemiBold";
|
|
88
|
-
color: #1e2f97;
|
|
101
|
+
color: var(--theme-primaryText, #1e2f97);
|
|
89
102
|
cursor: pointer;
|
|
90
103
|
white-space: nowrap;
|
|
91
104
|
}
|
|
92
105
|
}
|
|
93
106
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
color: #fff;
|
|
107
|
+
&:not(:hover):not(.Mui-selected) .MuiListItemText-root .MuiTypography-root {
|
|
108
|
+
color: var(--theme-white, #fff);
|
|
97
109
|
}
|
|
98
110
|
}
|
|
99
111
|
}
|
|
@@ -113,7 +125,7 @@
|
|
|
113
125
|
#more-menu {
|
|
114
126
|
.MuiPaper-root {
|
|
115
127
|
.MuiMenu-list {
|
|
116
|
-
color: #1e2f97;
|
|
128
|
+
color: var(--theme-primaryText, #1e2f97);
|
|
117
129
|
.MuiMenuItem-root {
|
|
118
130
|
font-size: 14px;
|
|
119
131
|
}
|
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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";
|
|
@@ -0,0 +1,15 @@
|
|
|
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 };
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
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[];
|
|
@@ -0,0 +1,68 @@
|
|
|
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"];
|