@campxdev/react-blueprint 0.1.36 → 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 +9 -4
- package/src/components/Layout/AppHeader/AppHeader.tsx +4 -7
- package/src/components/Layout/AppHeader/styles/styles.tsx +1 -7
- package/src/components/Navigation/{FloatingSidebar/FloatingSidebar.tsx → Sidebar/Sidebar.tsx} +17 -11
- package/src/components/Navigation/{FloatingSidebar → Sidebar}/styles.tsx +2 -7
- package/src/components/Navigation/exports.ts +4 -4
- package/src/App.test.tsx +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/react-blueprint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
4
4
|
"main": "./export.ts",
|
|
5
5
|
"private": false,
|
|
6
6
|
"dependencies": {
|
|
@@ -14,6 +14,14 @@
|
|
|
14
14
|
"axios": "^1.7.2",
|
|
15
15
|
"framer-motion": "^11.2.9",
|
|
16
16
|
"js-cookie": "^3.0.5",
|
|
17
|
+
"@testing-library/jest-dom": "^5.14.1",
|
|
18
|
+
"@testing-library/react": "^13.0.0",
|
|
19
|
+
"@testing-library/user-event": "^13.2.1",
|
|
20
|
+
"@types/jest": "^27.0.1",
|
|
21
|
+
"@types/node": "^16.7.13",
|
|
22
|
+
"@types/react": "^18.0.0",
|
|
23
|
+
"@types/react-dom": "^18.3.0",
|
|
24
|
+
"@types/react-router-dom": "^5.3.3",
|
|
17
25
|
"lodash": "^4.17.21",
|
|
18
26
|
"pullstate": "^1.24.0",
|
|
19
27
|
"react": "^18.3.1",
|
|
@@ -66,9 +74,6 @@
|
|
|
66
74
|
"@storybook/react-webpack5": "^8.1.5",
|
|
67
75
|
"@storybook/test": "^8.1.5",
|
|
68
76
|
"@types/js-cookie": "^3.0.5",
|
|
69
|
-
"@types/react": "^18.0.0",
|
|
70
|
-
"@types/react-dom": "^18.3.0",
|
|
71
|
-
"@types/react-router-dom": "^5.3.3",
|
|
72
77
|
"eslint-plugin-storybook": "^0.8.0",
|
|
73
78
|
"prop-types": "^15.8.1",
|
|
74
79
|
"storybook": "^8.1.5",
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Stack } from "@mui/material";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import { StyledHeader } from "./styles/styles";
|
|
4
|
-
import { CampxIcon } from "../../Assets/Icons/IconComponents/CampxIcon";
|
|
5
|
-
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
6
|
-
import UserBox from "./AppHeaderActions/UserBox";
|
|
7
3
|
import { HelpIcon } from "../../Assets/Icons/IconComponents/HelpIcon";
|
|
8
|
-
import {
|
|
9
|
-
import { TicketsIcon } from "../../Assets/Icons/IconComponents/TicketsIcon";
|
|
4
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
10
5
|
import { StyledIconButton } from "../../Navigation/DropDownMenu/styles";
|
|
6
|
+
import UserBox from "./AppHeaderActions/UserBox";
|
|
7
|
+
import { StyledHeader } from "./styles/styles";
|
|
11
8
|
|
|
12
9
|
export interface AppHeaderProps {
|
|
13
10
|
actions?: ReactNode[];
|
|
@@ -6,20 +6,14 @@ const sidebarWidth = { collapsed: "60px", expanded: "240px" };
|
|
|
6
6
|
export const StyledHeader = styled("header")(
|
|
7
7
|
({ theme, collapsed }: { theme?: any; collapsed: boolean }) => ({
|
|
8
8
|
display: "flex",
|
|
9
|
-
position: "fixed",
|
|
10
9
|
flexDirection: "row",
|
|
11
10
|
alignItems: "center",
|
|
12
|
-
width:
|
|
13
|
-
"calc(100% - 12px - " +
|
|
14
|
-
(collapsed ? sidebarWidth.collapsed : sidebarWidth.expanded) +
|
|
15
|
-
")",
|
|
16
|
-
top: "12px",
|
|
17
|
-
left: collapsed ? sidebarWidth.collapsed : sidebarWidth.expanded,
|
|
18
11
|
height: "60px",
|
|
19
12
|
backgroundColor: theme.palette.background.paper,
|
|
20
13
|
justifyContent: "space-between",
|
|
21
14
|
padding: "0 32px",
|
|
22
15
|
borderRadius: "8px",
|
|
16
|
+
marginTop: "12px",
|
|
23
17
|
})
|
|
24
18
|
);
|
|
25
19
|
|
package/src/components/Navigation/{FloatingSidebar/FloatingSidebar.tsx → Sidebar/Sidebar.tsx}
RENAMED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IconButton, ListItemIcon } from "@mui/material";
|
|
3
|
-
import { RightIcon } from "../../Assets/Icons/IconComponents/RightIcon";
|
|
4
|
-
import { LeftIcon } from "../../Assets/Icons/IconComponents/LeftIcon";
|
|
5
|
-
import { createSidebarStyles } from "./styles";
|
|
1
|
+
import { IconButton } from "@mui/material";
|
|
6
2
|
import { useMatch, useResolvedPath } from "react-router-dom";
|
|
7
|
-
import { Icons } from "../../export";
|
|
8
|
-
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
9
|
-
import { CampxIcon } from "../../Assets/Icons/IconComponents/CampxIcon";
|
|
10
3
|
import { CampxFullLogoIcon } from "../../Assets/Icons/IconComponents/CampxFullLogoIcon";
|
|
4
|
+
import { CampxIcon } from "../../Assets/Icons/IconComponents/CampxIcon";
|
|
5
|
+
import { LeftIcon } from "../../Assets/Icons/IconComponents/LeftIcon";
|
|
6
|
+
import { RightIcon } from "../../Assets/Icons/IconComponents/RightIcon";
|
|
7
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
8
|
+
import { Icons } from "../../export";
|
|
9
|
+
import { createSidebarStyles } from "./styles";
|
|
11
10
|
|
|
12
11
|
export interface MenuItemProps {
|
|
13
12
|
name: string;
|
|
@@ -17,8 +16,15 @@ export interface MenuItemProps {
|
|
|
17
16
|
iconType?: string;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
export const
|
|
21
|
-
|
|
19
|
+
export const Sidebar = ({
|
|
20
|
+
menu,
|
|
21
|
+
collapsed,
|
|
22
|
+
setCollapsed,
|
|
23
|
+
}: {
|
|
24
|
+
menu: MenuItemProps[];
|
|
25
|
+
collapsed: boolean;
|
|
26
|
+
setCollapsed: any;
|
|
27
|
+
}) => {
|
|
22
28
|
const {
|
|
23
29
|
StyledSidebarContainer,
|
|
24
30
|
StyledLogoArea,
|
|
@@ -79,4 +85,4 @@ export const FloatingSidebar = ({ menu }: { menu: MenuItemProps[] }) => {
|
|
|
79
85
|
);
|
|
80
86
|
};
|
|
81
87
|
|
|
82
|
-
export default
|
|
88
|
+
export default Sidebar;
|
|
@@ -12,13 +12,10 @@ 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
|
-
position: "fixed",
|
|
18
|
-
left: "12px",
|
|
19
|
-
top: "12px",
|
|
20
|
-
bottom: "12px",
|
|
21
|
-
zIndex: 1000,
|
|
22
19
|
};
|
|
23
20
|
});
|
|
24
21
|
|
|
@@ -83,8 +80,6 @@ export const createSidebarStyles = (collapsed: boolean) => {
|
|
|
83
80
|
|
|
84
81
|
const StyledListItemIcon = styled(ListItemIcon)(
|
|
85
82
|
({ collapsed }: { collapsed: boolean }) => ({
|
|
86
|
-
minWidth: "auto",
|
|
87
|
-
paddingRight: collapsed ? "0px" : "8px",
|
|
88
83
|
display: "flex",
|
|
89
84
|
justifyContent: "center",
|
|
90
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
|
};
|
package/src/App.test.tsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import App from './App';
|
|
4
|
-
|
|
5
|
-
test('renders learn react link', () => {
|
|
6
|
-
render(<App />);
|
|
7
|
-
const linkElement = screen.getByText(/learn react/i);
|
|
8
|
-
expect(linkElement).toBeInTheDocument();
|
|
9
|
-
});
|