@campxdev/react-blueprint 2.3.1 → 2.3.2
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/AppHeader/AppHeader.d.ts +2 -1
- package/dist/cjs/types/src/components/Layout/AppLayout/components/AppBar.d.ts +2 -0
- 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/AppHeader/AppHeader.d.ts +2 -1
- package/dist/esm/types/src/components/Layout/AppLayout/components/AppBar.d.ts +2 -0
- package/dist/esm/types/src/components/Layout/AppLayout/types.d.ts +2 -0
- package/dist/index.d.ts +4 -1
- package/package.json +1 -1
- package/src/components/Layout/AppHeader/AppHeader.tsx +9 -0
- package/src/components/Layout/AppLayout/AppLayout.tsx +6 -1
- package/src/components/Layout/AppLayout/components/AppBar.tsx +27 -1
- package/src/components/Layout/AppLayout/types.ts +3 -0
|
@@ -4,6 +4,7 @@ export type AppHeaderProps = {
|
|
|
4
4
|
actions?: ReactNode[];
|
|
5
5
|
profileActions?: ReactNode[];
|
|
6
6
|
appsMenu?: ReactNode;
|
|
7
|
+
centerContent?: ReactNode;
|
|
7
8
|
clientLogoUrl?: string;
|
|
8
9
|
clientName?: string;
|
|
9
10
|
userFullName: string;
|
|
@@ -19,4 +20,4 @@ export type AppHeaderProps = {
|
|
|
19
20
|
onChangeInstitutionClick?: () => void;
|
|
20
21
|
onAvatarClick?: () => void;
|
|
21
22
|
};
|
|
22
|
-
export declare const AppHeader: ({ actions, profileActions, profileSx, clientLogoUrl, onLogoutClick, designation, clientName, userFullName, collapsed, institutionsData, showActiveDevices, headerSx, onAccountClick, onActiveDevicesClick, onChangeInstitutionClick, onAvatarClick, }: AppHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const AppHeader: ({ actions, profileActions, profileSx, clientLogoUrl, onLogoutClick, designation, clientName, userFullName, collapsed, institutionsData, showActiveDevices, headerSx, centerContent, onAccountClick, onActiveDevicesClick, onChangeInstitutionClick, onAvatarClick, }: AppHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,8 @@ import { SideMenuItemProps } from './Sidebar/interfaces';
|
|
|
3
3
|
interface AppBarProps {
|
|
4
4
|
/** Right section component (actions, profile, etc.) */
|
|
5
5
|
rightSection?: React.ReactNode;
|
|
6
|
+
/** Center section component (workspace switcher, etc.) */
|
|
7
|
+
centerSection?: React.ReactNode;
|
|
6
8
|
/** Menu items for mobile drawer */
|
|
7
9
|
menu?: SideMenuItemProps[];
|
|
8
10
|
/** Custom className for the AppBar */
|
|
@@ -17,6 +17,8 @@ export interface AppLayoutProps {
|
|
|
17
17
|
menu: SideMenuItemProps[];
|
|
18
18
|
/** AppBar customization - Primary approach */
|
|
19
19
|
rightSection?: ReactNode;
|
|
20
|
+
/** AppBar center section customization */
|
|
21
|
+
centerSection?: ReactNode;
|
|
20
22
|
/** Layout customization */
|
|
21
23
|
mainContainerSx?: any;
|
|
22
24
|
/** Help documentation configuration for route-based contextual help */
|
package/dist/index.d.ts
CHANGED
|
@@ -941,6 +941,8 @@ interface AppLayoutProps {
|
|
|
941
941
|
menu: SideMenuItemProps$1[];
|
|
942
942
|
/** AppBar customization - Primary approach */
|
|
943
943
|
rightSection?: ReactNode;
|
|
944
|
+
/** AppBar center section customization */
|
|
945
|
+
centerSection?: ReactNode;
|
|
944
946
|
/** Layout customization */
|
|
945
947
|
mainContainerSx?: any;
|
|
946
948
|
/** Help documentation configuration for route-based contextual help */
|
|
@@ -1056,6 +1058,7 @@ type AppHeaderProps = {
|
|
|
1056
1058
|
actions?: ReactNode[];
|
|
1057
1059
|
profileActions?: ReactNode[];
|
|
1058
1060
|
appsMenu?: ReactNode;
|
|
1061
|
+
centerContent?: ReactNode;
|
|
1059
1062
|
clientLogoUrl?: string;
|
|
1060
1063
|
clientName?: string;
|
|
1061
1064
|
userFullName: string;
|
|
@@ -1071,7 +1074,7 @@ type AppHeaderProps = {
|
|
|
1071
1074
|
onChangeInstitutionClick?: () => void;
|
|
1072
1075
|
onAvatarClick?: () => void;
|
|
1073
1076
|
};
|
|
1074
|
-
declare const AppHeader: ({ actions, profileActions, profileSx, clientLogoUrl, onLogoutClick, designation, clientName, userFullName, collapsed, institutionsData, showActiveDevices, headerSx, onAccountClick, onActiveDevicesClick, onChangeInstitutionClick, onAvatarClick, }: AppHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
1077
|
+
declare const AppHeader: ({ actions, profileActions, profileSx, clientLogoUrl, onLogoutClick, designation, clientName, userFullName, collapsed, institutionsData, showActiveDevices, headerSx, centerContent, onAccountClick, onActiveDevicesClick, onChangeInstitutionClick, onAvatarClick, }: AppHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
1075
1078
|
|
|
1076
1079
|
declare const Sidebar: ({ menu, collapsed, setCollapsed, }: {
|
|
1077
1080
|
menu: SideMenuItemProps[];
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ export type AppHeaderProps = {
|
|
|
8
8
|
actions?: ReactNode[];
|
|
9
9
|
profileActions?: ReactNode[];
|
|
10
10
|
appsMenu?: ReactNode;
|
|
11
|
+
centerContent?: ReactNode;
|
|
11
12
|
clientLogoUrl?: string;
|
|
12
13
|
clientName?: string;
|
|
13
14
|
userFullName: string;
|
|
@@ -38,6 +39,7 @@ export const AppHeader = ({
|
|
|
38
39
|
institutionsData,
|
|
39
40
|
showActiveDevices = true,
|
|
40
41
|
headerSx,
|
|
42
|
+
centerContent,
|
|
41
43
|
// Destructuring the new onClick props
|
|
42
44
|
onAccountClick,
|
|
43
45
|
onActiveDevicesClick,
|
|
@@ -57,6 +59,13 @@ export const AppHeader = ({
|
|
|
57
59
|
{clientName}
|
|
58
60
|
</Typography>
|
|
59
61
|
|
|
62
|
+
{/* Center Content Section */}
|
|
63
|
+
{centerContent && (
|
|
64
|
+
<Stack alignItems={'center'} justifyContent={'center'} flex={1}>
|
|
65
|
+
{centerContent}
|
|
66
|
+
</Stack>
|
|
67
|
+
)}
|
|
68
|
+
|
|
60
69
|
<Stack alignItems={'center'} gap={'12px'} flexDirection={'row'}>
|
|
61
70
|
{actions.map((action) => action)}
|
|
62
71
|
|
|
@@ -8,6 +8,7 @@ export const AppLayout: React.FC<AppLayoutProps> = ({
|
|
|
8
8
|
children,
|
|
9
9
|
menu,
|
|
10
10
|
rightSection,
|
|
11
|
+
centerSection,
|
|
11
12
|
mainContainerSx = {},
|
|
12
13
|
helpDocsConfig,
|
|
13
14
|
}) => {
|
|
@@ -30,7 +31,11 @@ export const AppLayout: React.FC<AppLayoutProps> = ({
|
|
|
30
31
|
return (
|
|
31
32
|
<AppLayoutContainer>
|
|
32
33
|
{/* AppBar - Full width at the top */}
|
|
33
|
-
<AppBar
|
|
34
|
+
<AppBar
|
|
35
|
+
rightSection={rightSection}
|
|
36
|
+
centerSection={centerSection}
|
|
37
|
+
menu={menu}
|
|
38
|
+
/>
|
|
34
39
|
|
|
35
40
|
{/* Main Content - Single column, centered with max-width */}
|
|
36
41
|
<MainContent
|
|
@@ -17,6 +17,7 @@ const AppBarContainer = styled('header')(({ theme }: { theme?: any }) => ({
|
|
|
17
17
|
flexDirection: 'row',
|
|
18
18
|
alignItems: 'center',
|
|
19
19
|
justifyContent: 'space-between',
|
|
20
|
+
position: 'relative', // Add relative positioning for absolute center positioning
|
|
20
21
|
width: '100%',
|
|
21
22
|
height: '64px',
|
|
22
23
|
minHeight: '64px',
|
|
@@ -39,6 +40,8 @@ const AppBarContainer = styled('header')(({ theme }: { theme?: any }) => ({
|
|
|
39
40
|
interface AppBarProps {
|
|
40
41
|
/** Right section component (actions, profile, etc.) */
|
|
41
42
|
rightSection?: React.ReactNode;
|
|
43
|
+
/** Center section component (workspace switcher, etc.) */
|
|
44
|
+
centerSection?: React.ReactNode;
|
|
42
45
|
/** Menu items for mobile drawer */
|
|
43
46
|
menu?: SideMenuItemProps[];
|
|
44
47
|
/** Custom className for the AppBar */
|
|
@@ -49,6 +52,7 @@ interface AppBarProps {
|
|
|
49
52
|
|
|
50
53
|
export const AppBar: React.FC<AppBarProps> = ({
|
|
51
54
|
rightSection,
|
|
55
|
+
centerSection,
|
|
52
56
|
menu = [],
|
|
53
57
|
className = 'appHeaderV2',
|
|
54
58
|
sx = {},
|
|
@@ -79,9 +83,31 @@ export const AppBar: React.FC<AppBarProps> = ({
|
|
|
79
83
|
{isMobile ? <CampxIconV2 /> : <CampxFullLogoIconV2 size={28} />}
|
|
80
84
|
</Stack>
|
|
81
85
|
|
|
86
|
+
{/* Center section - Custom content from props */}
|
|
87
|
+
{centerSection && (
|
|
88
|
+
<Stack
|
|
89
|
+
direction="row"
|
|
90
|
+
alignItems="center"
|
|
91
|
+
gap="12px"
|
|
92
|
+
sx={{
|
|
93
|
+
position: 'absolute',
|
|
94
|
+
left: '50%',
|
|
95
|
+
transform: 'translateX(-50%)',
|
|
96
|
+
zIndex: 1,
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
{centerSection}
|
|
100
|
+
</Stack>
|
|
101
|
+
)}
|
|
102
|
+
|
|
82
103
|
{/* Right section - Custom content from props */}
|
|
83
104
|
{rightSection && (
|
|
84
|
-
<Stack
|
|
105
|
+
<Stack
|
|
106
|
+
direction="row"
|
|
107
|
+
alignItems="center"
|
|
108
|
+
gap="12px"
|
|
109
|
+
sx={{ zIndex: 2 }}
|
|
110
|
+
>
|
|
85
111
|
{rightSection}
|
|
86
112
|
</Stack>
|
|
87
113
|
)}
|