@campxdev/react-blueprint 2.3.9 → 2.3.10
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/cjs/index.js +1 -1
- package/dist/cjs/types/src/components/Layout/AppLayout/components/AppBar.d.ts +2 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/Sidebar.d.ts +8 -1
- package/dist/cjs/types/src/components/Layout/AppLayout/components/Sidebar/interfaces.d.ts +2 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/components/UserProfilePopup.d.ts +2 -2
- package/dist/cjs/types/src/components/Layout/AppLayout/types.d.ts +2 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/src/components/Layout/AppLayout/components/AppBar.d.ts +2 -0
- package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/Sidebar.d.ts +8 -1
- package/dist/esm/types/src/components/Layout/AppLayout/components/Sidebar/interfaces.d.ts +2 -0
- package/dist/esm/types/src/components/Layout/AppLayout/components/UserProfilePopup.d.ts +2 -2
- package/dist/esm/types/src/components/Layout/AppLayout/types.d.ts +2 -0
- package/dist/index.d.ts +4 -2
- package/package.json +1 -1
- package/src/components/DataDisplay/SidePanel/styles.tsx +1 -1
- package/src/components/Layout/AppLayout/AppLayout.tsx +5 -3
- package/src/components/Layout/AppLayout/components/AppBar.tsx +8 -3
- package/src/components/Layout/AppLayout/components/Sidebar/MenuBar.tsx +5 -1
- package/src/components/Layout/AppLayout/components/Sidebar/MenuItem.tsx +6 -1
- package/src/components/Layout/AppLayout/components/Sidebar/Sidebar.tsx +165 -45
- package/src/components/Layout/AppLayout/components/Sidebar/interfaces.ts +2 -0
- package/src/components/Layout/AppLayout/components/UserProfilePopup.tsx +4 -4
- package/src/components/Layout/AppLayout/types.ts +3 -0
- package/dist/cjs/types/src/components/Layout/AppLayout/components/PersistentSidebar.d.ts +0 -14
- package/dist/esm/types/src/components/Layout/AppLayout/components/PersistentSidebar.d.ts +0 -14
- package/src/components/Layout/AppLayout/components/PersistentSidebar.tsx +0 -171
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface AppBarProps {
|
|
3
|
+
/** Left section component*/
|
|
4
|
+
leftSection?: React.ReactNode;
|
|
3
5
|
/** Right section component (actions, profile, etc.) */
|
|
4
6
|
rightSection?: React.ReactNode;
|
|
5
7
|
/** Center section component (workspace switcher, etc.) */
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { UserProfilePopupProps } from '../UserProfilePopup';
|
|
2
3
|
import { SideMenuItemProps } from './interfaces';
|
|
3
4
|
interface SidebarProps {
|
|
5
|
+
/** Menu items for navigation */
|
|
4
6
|
menu: SideMenuItemProps[];
|
|
5
|
-
|
|
7
|
+
/**User profile Params */
|
|
8
|
+
userProfileParams: UserProfilePopupProps;
|
|
9
|
+
/** Whether the sidebar is collapsed */
|
|
10
|
+
collapsed: boolean;
|
|
11
|
+
/** Function to toggle sidebar collapse state */
|
|
12
|
+
setCollapsed: any;
|
|
6
13
|
}
|
|
7
14
|
export declare const Sidebar: React.FC<SidebarProps>;
|
|
8
15
|
export {};
|
|
@@ -41,6 +41,7 @@ export interface MenuItemProps {
|
|
|
41
41
|
internalMenuClickHandler: (params: InternalMenuClickHandlerProps) => void;
|
|
42
42
|
onClose?: () => void;
|
|
43
43
|
collapsed?: boolean;
|
|
44
|
+
setCollapsed?: any;
|
|
44
45
|
}
|
|
45
46
|
export interface SubMenuItemProps {
|
|
46
47
|
index: number;
|
|
@@ -54,4 +55,5 @@ export interface MenuBarProps {
|
|
|
54
55
|
previousMenuClickHandler: () => void;
|
|
55
56
|
onClose?: () => void;
|
|
56
57
|
collapsed?: boolean;
|
|
58
|
+
setCollapsed?: any;
|
|
57
59
|
}
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
export interface UserProfilePopupProps {
|
|
3
3
|
/** User's full name */
|
|
4
4
|
userFullName: string;
|
|
5
|
-
/** User's
|
|
6
|
-
|
|
5
|
+
/** User's email */
|
|
6
|
+
email?: string;
|
|
7
7
|
/** Profile dropdown actions (custom menu items) */
|
|
8
8
|
profileActions?: React.ReactNode[];
|
|
9
9
|
/** Logout click handler */
|
|
@@ -19,6 +19,8 @@ export interface AppLayoutProps {
|
|
|
19
19
|
/**User profile parameters */
|
|
20
20
|
userProfileParams: UserProfilePopupProps;
|
|
21
21
|
/** AppBar customization - Primary approach */
|
|
22
|
+
leftSection?: ReactNode;
|
|
23
|
+
/** AppBar customization - Primary approach */
|
|
22
24
|
rightSection?: ReactNode;
|
|
23
25
|
/** AppBar center section customization */
|
|
24
26
|
centerSection?: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -959,8 +959,8 @@ interface SubMenuData {
|
|
|
959
959
|
interface UserProfilePopupProps {
|
|
960
960
|
/** User's full name */
|
|
961
961
|
userFullName: string;
|
|
962
|
-
/** User's
|
|
963
|
-
|
|
962
|
+
/** User's email */
|
|
963
|
+
email?: string;
|
|
964
964
|
/** Profile dropdown actions (custom menu items) */
|
|
965
965
|
profileActions?: react__default.ReactNode[];
|
|
966
966
|
/** Logout click handler */
|
|
@@ -1016,6 +1016,8 @@ interface AppLayoutProps {
|
|
|
1016
1016
|
/**User profile parameters */
|
|
1017
1017
|
userProfileParams: UserProfilePopupProps;
|
|
1018
1018
|
/** AppBar customization - Primary approach */
|
|
1019
|
+
leftSection?: ReactNode;
|
|
1020
|
+
/** AppBar customization - Primary approach */
|
|
1019
1021
|
rightSection?: ReactNode;
|
|
1020
1022
|
/** AppBar center section customization */
|
|
1021
1023
|
centerSection?: ReactNode;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { Box, Stack, styled, Typography } from '@mui/material';
|
|
|
2
2
|
|
|
3
3
|
export const StyledSidePanelContainer = styled(Stack)(({ theme }) => ({
|
|
4
4
|
width: '300px',
|
|
5
|
-
backgroundColor:
|
|
5
|
+
backgroundColor: '#F7F8FA',
|
|
6
6
|
padding: '12px',
|
|
7
7
|
borderRadius: '8px',
|
|
8
8
|
gap: '12px',
|
|
@@ -3,12 +3,13 @@ import { motion } from 'framer-motion';
|
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import { AppBar } from './components/AppBar';
|
|
5
5
|
import { FloatingHelpDocs } from './components/FloatingHelpDocs';
|
|
6
|
-
import {
|
|
6
|
+
import { Sidebar } from './components/Sidebar/Sidebar';
|
|
7
7
|
import { AppLayoutProps } from './types';
|
|
8
8
|
|
|
9
9
|
export const AppLayout: React.FC<AppLayoutProps> = ({
|
|
10
10
|
children,
|
|
11
11
|
menu,
|
|
12
|
+
leftSection,
|
|
12
13
|
rightSection,
|
|
13
14
|
centerSection,
|
|
14
15
|
mainContainerSx = {},
|
|
@@ -49,10 +50,10 @@ export const AppLayout: React.FC<AppLayoutProps> = ({
|
|
|
49
50
|
return (
|
|
50
51
|
<AppLayoutContainer>
|
|
51
52
|
{/* Persistent Sidebar */}
|
|
52
|
-
<
|
|
53
|
+
<Sidebar
|
|
53
54
|
menu={menu}
|
|
54
55
|
collapsed={collapsed}
|
|
55
|
-
|
|
56
|
+
setCollapsed={setCollapsed}
|
|
56
57
|
userProfileParams={userProfileParams}
|
|
57
58
|
/>
|
|
58
59
|
|
|
@@ -70,6 +71,7 @@ export const AppLayout: React.FC<AppLayoutProps> = ({
|
|
|
70
71
|
>
|
|
71
72
|
{/* AppBar - Top of main content area */}
|
|
72
73
|
<AppBar
|
|
74
|
+
leftSection={leftSection}
|
|
73
75
|
rightSection={rightSection}
|
|
74
76
|
centerSection={centerSection}
|
|
75
77
|
hideHamburger={!isSmallScreen}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconButton, Stack, styled, useTheme } from '@mui/material';
|
|
1
|
+
import { Box, IconButton, Stack, styled, useTheme } from '@mui/material';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { CampxIconV2 } from '../../../Assets/Icons/IconComponents/CampxIconV2';
|
|
4
4
|
import { HamburgerMenuIcon } from '../../../Assets/Icons/IconComponents/HamburgerMenuIcon';
|
|
@@ -30,6 +30,8 @@ const AppBarContainer = styled('header')(({ theme }: { theme?: any }) => ({
|
|
|
30
30
|
}));
|
|
31
31
|
|
|
32
32
|
interface AppBarProps {
|
|
33
|
+
/** Left section component*/
|
|
34
|
+
leftSection?: React.ReactNode;
|
|
33
35
|
/** Right section component (actions, profile, etc.) */
|
|
34
36
|
rightSection?: React.ReactNode;
|
|
35
37
|
/** Center section component (workspace switcher, etc.) */
|
|
@@ -45,6 +47,7 @@ interface AppBarProps {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
export const AppBar: React.FC<AppBarProps> = ({
|
|
50
|
+
leftSection,
|
|
48
51
|
rightSection,
|
|
49
52
|
centerSection,
|
|
50
53
|
className = 'appHeaderV2',
|
|
@@ -59,11 +62,13 @@ export const AppBar: React.FC<AppBarProps> = ({
|
|
|
59
62
|
className={className}
|
|
60
63
|
sx={{
|
|
61
64
|
...sx,
|
|
62
|
-
justifyContent:
|
|
65
|
+
justifyContent: 'space-between',
|
|
63
66
|
}}
|
|
64
67
|
>
|
|
65
68
|
{/* Left section - Hamburger + Logo (only show if not hidden) */}
|
|
66
|
-
{
|
|
69
|
+
{hideHamburger ? (
|
|
70
|
+
<Box sx={{ paddingX: '12px' }}>{leftSection}</Box>
|
|
71
|
+
) : (
|
|
67
72
|
<Stack gap={'4px'} direction={'row'} alignItems={'center'}>
|
|
68
73
|
<IconButton
|
|
69
74
|
onClick={onToggleSidebar}
|
|
@@ -24,9 +24,12 @@ export const MenuBar: React.FC<MenuBarProps> = ({
|
|
|
24
24
|
previousMenuClickHandler,
|
|
25
25
|
onClose,
|
|
26
26
|
collapsed,
|
|
27
|
+
setCollapsed,
|
|
27
28
|
}) => {
|
|
28
29
|
return (
|
|
29
|
-
<MenuBarContainer
|
|
30
|
+
<MenuBarContainer
|
|
31
|
+
sx={{ ':hover': { cursor: collapsed ? 'e-resize' : 'default' } }}
|
|
32
|
+
>
|
|
30
33
|
{currentMenuState.title && (
|
|
31
34
|
<MenuHeaderContainer
|
|
32
35
|
direction="row"
|
|
@@ -57,6 +60,7 @@ export const MenuBar: React.FC<MenuBarProps> = ({
|
|
|
57
60
|
internalMenuClickHandler={internalMenuClickHandler}
|
|
58
61
|
onClose={onClose}
|
|
59
62
|
collapsed={collapsed}
|
|
63
|
+
setCollapsed={setCollapsed}
|
|
60
64
|
/>
|
|
61
65
|
))}
|
|
62
66
|
</motion.div>
|
|
@@ -22,6 +22,7 @@ export const MenuItem: React.FC<MenuItemProps> = ({
|
|
|
22
22
|
internalMenuClickHandler,
|
|
23
23
|
onClose,
|
|
24
24
|
collapsed,
|
|
25
|
+
setCollapsed,
|
|
25
26
|
}) => {
|
|
26
27
|
const { name, path, icon, menu: internalMenu, subMenu } = menuItem;
|
|
27
28
|
const newPath = currentMenuPath ? `${currentMenuPath}${path}` : path;
|
|
@@ -30,9 +31,13 @@ export const MenuItem: React.FC<MenuItemProps> = ({
|
|
|
30
31
|
const match = useMatch({ path: resolved.pathname, end: false });
|
|
31
32
|
const [expanded, setExpanded] = useState(!!match);
|
|
32
33
|
|
|
33
|
-
const handleSubMenuToggle = () =>
|
|
34
|
+
const handleSubMenuToggle = () => {
|
|
35
|
+
setCollapsed(false);
|
|
36
|
+
setExpanded(!expanded);
|
|
37
|
+
};
|
|
34
38
|
|
|
35
39
|
const handleInternalMenuClick = () => {
|
|
40
|
+
setCollapsed(false);
|
|
36
41
|
internalMenuClickHandler({
|
|
37
42
|
menuTitle: name,
|
|
38
43
|
menuPath: newPath,
|
|
@@ -1,62 +1,182 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
IconButton,
|
|
4
|
+
Stack,
|
|
5
|
+
styled,
|
|
6
|
+
useMediaQuery,
|
|
7
|
+
useTheme,
|
|
8
|
+
} from '@mui/material';
|
|
9
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
|
+
import { CampxFullLogoIconV2 } from '../../../../Assets/Icons/IconComponents/CampxFullLogoIconV2';
|
|
12
|
+
import { CampxIconV2 } from '../../../../Assets/Icons/IconComponents/CampxIconV2';
|
|
13
|
+
import { Icons } from '../../../../export';
|
|
14
|
+
import { UserProfilePopup, UserProfilePopupProps } from '../UserProfilePopup';
|
|
5
15
|
import { SideMenuItemProps } from './interfaces';
|
|
6
16
|
import { MenuBar } from './MenuBar';
|
|
7
|
-
import { SidebarContainer } from './styles';
|
|
8
17
|
import { useSidebarNavigation } from './useSidebarNavigation';
|
|
9
18
|
|
|
10
19
|
interface SidebarProps {
|
|
20
|
+
/** Menu items for navigation */
|
|
11
21
|
menu: SideMenuItemProps[];
|
|
12
|
-
|
|
22
|
+
/**User profile Params */
|
|
23
|
+
userProfileParams: UserProfilePopupProps;
|
|
24
|
+
/** Whether the sidebar is collapsed */
|
|
25
|
+
collapsed: boolean;
|
|
26
|
+
/** Function to toggle sidebar collapse state */
|
|
27
|
+
setCollapsed: any;
|
|
13
28
|
}
|
|
14
29
|
|
|
15
|
-
export const Sidebar: React.FC<SidebarProps> = ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
export const Sidebar: React.FC<SidebarProps> = ({
|
|
31
|
+
menu,
|
|
32
|
+
userProfileParams,
|
|
33
|
+
collapsed,
|
|
34
|
+
setCollapsed,
|
|
35
|
+
}) => {
|
|
36
|
+
const theme = useTheme();
|
|
37
|
+
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
|
|
38
|
+
const [hovered, setHovered] = useState(false);
|
|
39
|
+
// Use the navigation hook
|
|
40
|
+
const navigation = useSidebarNavigation(menu);
|
|
41
|
+
|
|
42
|
+
const onToggle = () => {
|
|
43
|
+
setCollapsed(!collapsed);
|
|
44
|
+
};
|
|
22
45
|
|
|
23
46
|
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
<>
|
|
48
|
+
{/* Mobile overlay backdrop */}
|
|
49
|
+
<AnimatePresence>
|
|
50
|
+
{!collapsed && isSmallScreen && (
|
|
51
|
+
<motion.div
|
|
52
|
+
initial={{ opacity: 0 }}
|
|
53
|
+
animate={{ opacity: 1 }}
|
|
54
|
+
exit={{ opacity: 0 }}
|
|
55
|
+
transition={{ duration: 0.2 }}
|
|
56
|
+
style={{
|
|
57
|
+
position: 'fixed',
|
|
58
|
+
top: 0,
|
|
59
|
+
left: 0,
|
|
60
|
+
right: 0,
|
|
61
|
+
bottom: 0,
|
|
62
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
63
|
+
zIndex: 1299,
|
|
64
|
+
}}
|
|
65
|
+
onClick={onToggle}
|
|
41
66
|
/>
|
|
42
|
-
|
|
43
|
-
</
|
|
44
|
-
|
|
67
|
+
)}
|
|
68
|
+
</AnimatePresence>
|
|
69
|
+
|
|
70
|
+
{/* Persistent Sidebar */}
|
|
71
|
+
<motion.div
|
|
72
|
+
animate={{
|
|
73
|
+
width: collapsed ? '64px' : '250px',
|
|
74
|
+
x: isSmallScreen && collapsed ? '-100%' : '0%',
|
|
75
|
+
}}
|
|
76
|
+
transition={{ duration: 0.3, ease: [0.32, 0.72, 0, 1] }}
|
|
77
|
+
style={{
|
|
78
|
+
position: isSmallScreen ? 'fixed' : 'relative',
|
|
79
|
+
zIndex: isSmallScreen ? 1300 : 1,
|
|
80
|
+
height: '100vh',
|
|
81
|
+
flexShrink: 0,
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
<SidebarContainer>
|
|
85
|
+
{/* Sidebar Header */}
|
|
86
|
+
<Stack
|
|
87
|
+
direction="row"
|
|
88
|
+
justifyContent="space-between"
|
|
89
|
+
alignItems="center"
|
|
90
|
+
sx={{
|
|
91
|
+
height: '64px',
|
|
92
|
+
padding: collapsed ? '0' : '0 16px',
|
|
93
|
+
[theme.breakpoints.down('md')]: {
|
|
94
|
+
height: '54px',
|
|
95
|
+
},
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
{/* Logo - Show icon when collapsed, full logo when expanded */}
|
|
99
|
+
{collapsed ? (
|
|
100
|
+
<IconButton
|
|
101
|
+
onClick={() => {
|
|
102
|
+
setHovered(false);
|
|
103
|
+
onToggle();
|
|
104
|
+
}}
|
|
105
|
+
onMouseEnter={() => setHovered(true)}
|
|
106
|
+
onMouseLeave={() => setHovered(false)}
|
|
107
|
+
sx={{
|
|
108
|
+
width: '64px',
|
|
109
|
+
height: '64px',
|
|
110
|
+
borderRadius: 0,
|
|
111
|
+
[theme.breakpoints.down('md')]: {
|
|
112
|
+
height: '54px',
|
|
113
|
+
width: '54px',
|
|
114
|
+
},
|
|
115
|
+
':hover': { cursor: 'e-resize' },
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{hovered ? <Icons.RightIcon size={24} /> : <CampxIconV2 />}
|
|
119
|
+
</IconButton>
|
|
120
|
+
) : (
|
|
121
|
+
<>
|
|
122
|
+
<CampxFullLogoIconV2 />
|
|
123
|
+
<IconButton
|
|
124
|
+
onClick={onToggle}
|
|
125
|
+
sx={{
|
|
126
|
+
':hover': { cursor: 'e-resize' },
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
<Icons.LeftIcon size={20} />
|
|
130
|
+
</IconButton>
|
|
131
|
+
</>
|
|
132
|
+
)}
|
|
133
|
+
</Stack>
|
|
134
|
+
|
|
135
|
+
{/* Menu Content */}
|
|
136
|
+
<motion.div
|
|
137
|
+
key={`sidebar-${navigation.currentMenuState.title || 'main'}`}
|
|
138
|
+
initial={{ x: navigation.menuPosition }}
|
|
139
|
+
animate={{ x: 0 }}
|
|
140
|
+
transition={{
|
|
141
|
+
duration: 0.3,
|
|
142
|
+
ease: navigation.menuPosition ? 'circOut' : 'circIn',
|
|
143
|
+
}}
|
|
144
|
+
style={{
|
|
145
|
+
height: `calc(100% - 116px)`,
|
|
146
|
+
width: '100%',
|
|
147
|
+
}}
|
|
148
|
+
onClick={() => setCollapsed(false)}
|
|
149
|
+
>
|
|
150
|
+
<MenuBar
|
|
151
|
+
currentMenuState={navigation.currentMenuState}
|
|
152
|
+
menuPosition={navigation.menuPosition}
|
|
153
|
+
internalMenuClickHandler={navigation.internalMenuClickHandler}
|
|
154
|
+
previousMenuClickHandler={navigation.previousMenuClickHandler}
|
|
155
|
+
onClose={isSmallScreen ? onToggle : undefined}
|
|
156
|
+
collapsed={collapsed}
|
|
157
|
+
setCollapsed={setCollapsed}
|
|
158
|
+
/>
|
|
159
|
+
</motion.div>
|
|
160
|
+
<Box sx={{ position: 'fixed', bottom: 0, left: 0 }}>
|
|
161
|
+
<UserProfilePopup
|
|
162
|
+
userFullName={userProfileParams?.userFullName}
|
|
163
|
+
email={userProfileParams?.email}
|
|
164
|
+
onLogout={userProfileParams?.onLogout}
|
|
165
|
+
onAccountClick={userProfileParams?.onAccountClick}
|
|
166
|
+
profileActions={userProfileParams?.profileActions}
|
|
167
|
+
collapsed={collapsed}
|
|
168
|
+
/>
|
|
169
|
+
</Box>
|
|
170
|
+
</SidebarContainer>
|
|
171
|
+
</motion.div>
|
|
172
|
+
</>
|
|
45
173
|
);
|
|
46
174
|
};
|
|
47
175
|
|
|
48
|
-
const
|
|
49
|
-
width: `${width}px`,
|
|
176
|
+
const SidebarContainer = styled(Stack)(({ theme }: { theme?: any }) => ({
|
|
50
177
|
height: '100%',
|
|
51
|
-
|
|
52
|
-
backgroundColor: theme.palette.background.paper,
|
|
53
|
-
borderRadius: '8px',
|
|
54
|
-
border: `1px solid ${theme.palette.divider}`,
|
|
55
|
-
overflow: 'hidden',
|
|
56
|
-
display: 'flex',
|
|
178
|
+
backgroundColor: theme.palette.surface.paperBackground,
|
|
57
179
|
flexDirection: 'column',
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
display: 'none',
|
|
61
|
-
},
|
|
180
|
+
overflow: 'hidden',
|
|
181
|
+
borderRight: `1px solid ${theme.palette.divider}`,
|
|
62
182
|
}));
|
|
@@ -49,6 +49,7 @@ export interface MenuItemProps {
|
|
|
49
49
|
internalMenuClickHandler: (params: InternalMenuClickHandlerProps) => void;
|
|
50
50
|
onClose?: () => void; // Optional callback to close the drawer
|
|
51
51
|
collapsed?: boolean; // Whether sidebar is collapsed
|
|
52
|
+
setCollapsed?: any;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
export interface SubMenuItemProps {
|
|
@@ -64,4 +65,5 @@ export interface MenuBarProps {
|
|
|
64
65
|
previousMenuClickHandler: () => void;
|
|
65
66
|
onClose?: () => void; // Optional callback to close the drawer
|
|
66
67
|
collapsed?: boolean; // Whether sidebar is collapsed
|
|
68
|
+
setCollapsed?: any;
|
|
67
69
|
}
|
|
@@ -7,8 +7,8 @@ import { DropdownMenuItem } from '../../../Navigation/DropDownMenu/DropdownMenuI
|
|
|
7
7
|
export interface UserProfilePopupProps {
|
|
8
8
|
/** User's full name */
|
|
9
9
|
userFullName: string;
|
|
10
|
-
/** User's
|
|
11
|
-
|
|
10
|
+
/** User's email */
|
|
11
|
+
email?: string;
|
|
12
12
|
/** Profile dropdown actions (custom menu items) */
|
|
13
13
|
profileActions?: React.ReactNode[];
|
|
14
14
|
/** Logout click handler */
|
|
@@ -56,7 +56,7 @@ const getStartingLetters = (text: string) => {
|
|
|
56
56
|
export const UserProfilePopup: React.FC<UserProfilePopupProps> = ({
|
|
57
57
|
collapsed,
|
|
58
58
|
userFullName,
|
|
59
|
-
|
|
59
|
+
email = '',
|
|
60
60
|
profileActions = [],
|
|
61
61
|
onLogout,
|
|
62
62
|
profileUrl,
|
|
@@ -165,7 +165,7 @@ export const UserProfilePopup: React.FC<UserProfilePopupProps> = ({
|
|
|
165
165
|
</Avatar>
|
|
166
166
|
<Stack>
|
|
167
167
|
<Typography variant="subtitle3">{userFullName}</Typography>
|
|
168
|
-
<Typography variant="caption">{
|
|
168
|
+
<Typography variant="caption">{email}</Typography>
|
|
169
169
|
</Stack>
|
|
170
170
|
</Stack>
|
|
171
171
|
<Icons.NavigationIcon />
|
|
@@ -24,6 +24,9 @@ export interface AppLayoutProps {
|
|
|
24
24
|
/**User profile parameters */
|
|
25
25
|
userProfileParams: UserProfilePopupProps;
|
|
26
26
|
|
|
27
|
+
/** AppBar customization - Primary approach */
|
|
28
|
+
leftSection?: ReactNode;
|
|
29
|
+
|
|
27
30
|
/** AppBar customization - Primary approach */
|
|
28
31
|
rightSection?: ReactNode;
|
|
29
32
|
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SideMenuItemProps } from './Sidebar/interfaces';
|
|
3
|
-
import { UserProfilePopupProps } from './UserProfilePopup';
|
|
4
|
-
interface PersistentSidebarProps {
|
|
5
|
-
/** Menu items for navigation */
|
|
6
|
-
menu: SideMenuItemProps[];
|
|
7
|
-
userProfileParams: UserProfilePopupProps;
|
|
8
|
-
/** Whether the sidebar is collapsed */
|
|
9
|
-
collapsed: boolean;
|
|
10
|
-
/** Function to toggle sidebar collapse state */
|
|
11
|
-
onToggle: () => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const PersistentSidebar: React.FC<PersistentSidebarProps>;
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SideMenuItemProps } from './Sidebar/interfaces';
|
|
3
|
-
import { UserProfilePopupProps } from './UserProfilePopup';
|
|
4
|
-
interface PersistentSidebarProps {
|
|
5
|
-
/** Menu items for navigation */
|
|
6
|
-
menu: SideMenuItemProps[];
|
|
7
|
-
userProfileParams: UserProfilePopupProps;
|
|
8
|
-
/** Whether the sidebar is collapsed */
|
|
9
|
-
collapsed: boolean;
|
|
10
|
-
/** Function to toggle sidebar collapse state */
|
|
11
|
-
onToggle: () => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const PersistentSidebar: React.FC<PersistentSidebarProps>;
|
|
14
|
-
export {};
|