@cullsin/lnc-menu 6.5.0 → 6.7.0

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.
@@ -63,6 +63,6 @@ function SideMenu({ useDrawer, SampleMgmtIcon, location, language = 'en' }) {
63
63
  overflowY: "auto",
64
64
  zIndex: 100,
65
65
  },
66
- }, 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: selectedMainMenu === item.text ? "selected" : "", onClick: () => handleMenuClick(item), children: [_jsx(ListItemIcon, { children: item.icon }), isDrawerOpen && _jsx(ListItemText, { primary: item.text })] }) }, index))) }) }) }));
66
+ }, children: _jsx(List, { children: menuItems.map((item, index) => (_jsx(Tooltip, { title: item.text, placement: "right", disableHoverListener: isDrawerOpen, children: _jsxs(ListItem, { button: true, className: isDrawerOpen ? "menu-open" : "menu-closed", onClick: () => handleMenuClick(item), children: [_jsx(ListItemIcon, { children: item.icon }), isDrawerOpen && _jsx(ListItemText, { primary: item.text })] }) }, index))) }) }) }));
67
67
  }
68
68
  export default SideMenu;
@@ -17,19 +17,39 @@
17
17
 
18
18
  .MuiList-root {
19
19
  .MuiListItem-root {
20
- // Apply capsule layout permanently to prevent layout shifts
21
- padding: 10px 15px;
22
- margin: 4px 12px;
23
- border-radius: 20px;
20
+ // Apply capsule layout with gradient permanently for testing
21
+ padding: 10px 16px;
22
+ margin: 12px 0px 0px 0px;
23
+ border-radius: 15px;
24
24
  display: flex;
25
25
  align-items: center;
26
- transition: background 0.2s ease;
26
+ justify-content: center;
27
+ background: linear-gradient(to bottom, #7ad4f7, #20a9ef) !important;
28
+
29
+ // Width based on menu open/closed state
30
+ &.menu-closed {
31
+ width: 58px;
32
+ }
33
+
34
+ &.menu-open {
35
+ width: 200px;
36
+ }
37
+
38
+ // Hover design - override the default background on hover
39
+ &:hover {
40
+ background: linear-gradient(to bottom, #7ad4f7, #20a9ef) !important;
41
+ }
42
+
43
+ // Default state (not hovered) - transparent background
44
+ &:not(:hover) {
45
+ background: transparent !important;
46
+ }
27
47
 
28
48
  // Normalize all icons (MUI icons and custom SVGs)
29
49
  .MuiListItemIcon-root {
30
- color: #fff;
50
+ color: #1e2f97;
31
51
  min-width: auto;
32
- margin-right: 8px;
52
+ margin-right: 0;
33
53
  cursor: pointer;
34
54
  display: flex;
35
55
  align-items: center;
@@ -41,62 +61,39 @@
41
61
  width: 24px;
42
62
  height: 25px;
43
63
  display: block;
44
- transition: fill 0.2s ease, color 0.2s ease;
64
+ fill: #1e2f97;
65
+ color: #1e2f97;
45
66
  }
46
67
  }
47
68
 
48
- .MuiListItemText-root {
49
- margin: 0;
50
-
51
- .MuiTypography-root {
52
- font: 14px/24px "OpenSans-SemiBold";
69
+ // Icon color changes on hover
70
+ &:not(:hover) .MuiListItemIcon-root {
71
+ svg,
72
+ .MuiSvgIcon-root {
73
+ fill: #fff;
53
74
  color: #fff;
54
- cursor: pointer;
55
- white-space: nowrap;
56
- transition: color 0.2s ease;
57
75
  }
58
76
  }
59
77
 
60
- // Selected state - active capsule with gradient background
61
- &.selected {
62
- background: linear-gradient(to bottom, #7ad4f7, #20a9ef) !important;
63
-
64
- .MuiListItemIcon-root {
65
- color: #1e2f97;
66
-
67
- svg,
68
- .MuiSvgIcon-root {
69
- fill: #1e2f97;
70
- color: #1e2f97;
71
- }
72
- }
73
-
74
- .MuiListItemText-root {
75
- .MuiTypography-root {
76
- color: #1e2f97;
77
- }
78
- }
78
+ // Add margin-right to icon only when text is visible
79
+ .MuiListItemIcon-root + .MuiListItemText-root {
80
+ margin-left: 8px;
79
81
  }
80
82
 
81
- // Hover state - show gradient background on non-selected items
82
- &:hover:not(.selected) {
83
- background: linear-gradient(to bottom, #7ad4f7, #20a9ef) !important;
83
+ .MuiListItemText-root {
84
+ margin: 0;
84
85
 
85
- .MuiListItemIcon-root {
86
+ .MuiTypography-root {
87
+ font: 14px/24px "OpenSans-SemiBold";
86
88
  color: #1e2f97;
87
-
88
- svg,
89
- .MuiSvgIcon-root {
90
- fill: #1e2f97;
91
- color: #1e2f97;
92
- }
89
+ cursor: pointer;
90
+ white-space: nowrap;
93
91
  }
92
+ }
94
93
 
95
- .MuiListItemText-root {
96
- .MuiTypography-root {
97
- color: #1e2f97;
98
- }
99
- }
94
+ // Text color changes on hover
95
+ &:not(:hover) .MuiListItemText-root .MuiTypography-root {
96
+ color: #fff;
100
97
  }
101
98
  }
102
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cullsin/lnc-menu",
3
- "version": "6.5.0",
3
+ "version": "6.7.0",
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",