@campxdev/react-blueprint 0.1.37 → 0.1.38
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/package.json +1 -1
- package/src/components/Layout/AppHeader/styles/styles.tsx +1 -0
- package/src/components/Navigation/{FloatingSidebar/FloatingSidebar.tsx → Sidebar/Sidebar.tsx} +2 -2
- package/src/components/Navigation/{FloatingSidebar → Sidebar}/styles.tsx +2 -2
- package/src/components/Navigation/exports.ts +4 -4
- package/src/components/Layout/AppLayout/AppLayout.tsx +0 -42
- package/src/stories/Layout/AppLayout.stories.tsx +0 -31
package/package.json
CHANGED
package/src/components/Navigation/{FloatingSidebar/FloatingSidebar.tsx → Sidebar/Sidebar.tsx}
RENAMED
|
@@ -16,7 +16,7 @@ export interface MenuItemProps {
|
|
|
16
16
|
iconType?: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export const
|
|
19
|
+
export const Sidebar = ({
|
|
20
20
|
menu,
|
|
21
21
|
collapsed,
|
|
22
22
|
setCollapsed,
|
|
@@ -85,4 +85,4 @@ export const FloatingSidebar = ({
|
|
|
85
85
|
);
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
export default
|
|
88
|
+
export default Sidebar;
|
|
@@ -12,6 +12,8 @@ export const createSidebarStyles = (collapsed: boolean) => {
|
|
|
12
12
|
const StyledSidebarContainer = styled(Stack)(({ theme }) => {
|
|
13
13
|
return {
|
|
14
14
|
height: "100vh",
|
|
15
|
+
marginLeft: "12px",
|
|
16
|
+
marginTop: "12px",
|
|
15
17
|
width: collapsed ? "60px" : "240px",
|
|
16
18
|
backgroundColor: theme.palette.surface.defaultBackground,
|
|
17
19
|
};
|
|
@@ -78,8 +80,6 @@ export const createSidebarStyles = (collapsed: boolean) => {
|
|
|
78
80
|
|
|
79
81
|
const StyledListItemIcon = styled(ListItemIcon)(
|
|
80
82
|
({ collapsed }: { collapsed: boolean }) => ({
|
|
81
|
-
minWidth: "auto",
|
|
82
|
-
paddingRight: collapsed ? "0px" : "8px",
|
|
83
83
|
display: "flex",
|
|
84
84
|
justifyContent: "center",
|
|
85
85
|
})
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { CustomDialog } from "./DialogButton/DialogButton";
|
|
2
2
|
import { DropDownButton } from "./DropDownMenu/DropDownButton";
|
|
3
|
-
import { DropdownMenu } from "./DropDownMenu/DropDownMenu";
|
|
4
3
|
import { DropDownIcon } from "./DropDownMenu/DropDownIcon";
|
|
4
|
+
import { DropdownMenu } from "./DropDownMenu/DropDownMenu";
|
|
5
5
|
import { DropdownMenuItem } from "./DropDownMenu/DropdownMenuItem";
|
|
6
|
+
import { Sidebar } from "./Sidebar/Sidebar";
|
|
6
7
|
import { TabsContainer } from "./TabsContainer/TabsContainer";
|
|
7
|
-
import { FloatingSidebar } from "./FloatingSidebar/FloatingSidebar";
|
|
8
8
|
|
|
9
9
|
export {
|
|
10
10
|
CustomDialog,
|
|
11
11
|
DropDownButton,
|
|
12
|
-
DropdownMenu,
|
|
13
12
|
DropDownIcon,
|
|
13
|
+
DropdownMenu,
|
|
14
14
|
DropdownMenuItem,
|
|
15
|
+
Sidebar,
|
|
15
16
|
TabsContainer,
|
|
16
|
-
FloatingSidebar,
|
|
17
17
|
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Grid, Stack, useTheme } from "@mui/material";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { FloatingSidebar, Icons } from "../../export";
|
|
4
|
-
import { AppHeader } from "../AppHeader/AppHeader";
|
|
5
|
-
|
|
6
|
-
export const AppLayout = () => {
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
const [collapsed, setCollapsed] = useState(false);
|
|
9
|
-
const menu = [
|
|
10
|
-
{ name: "Home", path: "/home", icon: Icons.DashBoardIcon },
|
|
11
|
-
{ name: "Self Service Portal", path: "/item2" },
|
|
12
|
-
{ name: "hrms", path: "/hrms" },
|
|
13
|
-
];
|
|
14
|
-
return (
|
|
15
|
-
<Grid
|
|
16
|
-
container
|
|
17
|
-
spacing={3}
|
|
18
|
-
sx={{
|
|
19
|
-
backgroundColor: theme.palette.surface.defaultBackground,
|
|
20
|
-
minHeight: "80vh",
|
|
21
|
-
}}
|
|
22
|
-
>
|
|
23
|
-
<Grid item xs={collapsed ? 1 : 3}>
|
|
24
|
-
<FloatingSidebar
|
|
25
|
-
menu={menu}
|
|
26
|
-
collapsed={collapsed}
|
|
27
|
-
setCollapsed={setCollapsed}
|
|
28
|
-
/>
|
|
29
|
-
</Grid>
|
|
30
|
-
<Grid item xs={collapsed ? 11 : 9}>
|
|
31
|
-
<Stack>
|
|
32
|
-
<AppHeader
|
|
33
|
-
clientName="Anurag University"
|
|
34
|
-
userFullName="Srikanth Yellapragada"
|
|
35
|
-
actions={[]}
|
|
36
|
-
collapsed={true}
|
|
37
|
-
/>
|
|
38
|
-
</Stack>
|
|
39
|
-
</Grid>
|
|
40
|
-
</Grid>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { AppLayout } from "../../components/Layout/AppLayout/AppLayout";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Define the default export with Meta type including the component type
|
|
6
|
-
const meta: Meta<typeof AppLayout> = {
|
|
7
|
-
title: "Layout/AppLayout",
|
|
8
|
-
component: AppLayout,
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
argTypes: {
|
|
11
|
-
actions: {
|
|
12
|
-
control: "object",
|
|
13
|
-
description: "Custom actions to be displayed.",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof AppLayout>;
|
|
20
|
-
|
|
21
|
-
// Primary story
|
|
22
|
-
export const Primary: Story = {
|
|
23
|
-
render: (args: any) => (
|
|
24
|
-
|
|
25
|
-
<AppLayout {...args} />
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
args: {
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
};
|