@campxdev/react-blueprint 0.1.57 → 1.0.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/react-blueprint",
3
- "version": "0.1.57",
3
+ "version": "1.0.1",
4
4
  "main": "./export.ts",
5
5
  "private": false,
6
6
  "dependencies": {
@@ -32,7 +32,7 @@ export const Tooltip = ({
32
32
 
33
33
  export const ToolTipContent = ({ message }: TooltipContentProps) => {
34
34
  return (
35
- <Stack gap={1}>
35
+ <Stack gap={1} sx={{ margin: "5px" }}>
36
36
  <Stack direction="row" gap={1}>
37
37
  <BulbIcon />
38
38
  <Typography variant="subtitle3">Note:</Typography>
@@ -5,7 +5,7 @@ import { CampxIcon } from "../../Assets/Icons/IconComponents/CampxIcon";
5
5
  import { LeftIcon } from "../../Assets/Icons/IconComponents/LeftIcon";
6
6
  import { RightIcon } from "../../Assets/Icons/IconComponents/RightIcon";
7
7
  import { Typography } from "../../DataDisplay/Typography/Typography";
8
- import { Icons } from "../../export";
8
+ import { Icons, Tooltip } from "../../export";
9
9
  import { createSidebarStyles } from "./styles";
10
10
 
11
11
  export interface MenuItemProps {
@@ -57,18 +57,34 @@ export const Sidebar = ({
57
57
  match={match}
58
58
  className="listItem"
59
59
  >
60
- <StyledLinkButton
61
- to={path}
62
- onClick={() => {
63
- setCollapsed(false);
64
- }}
65
- >
66
- <StyledListItemButton collapsed={collapsed}>
67
- <StyledListItemIcon collapsed={collapsed}>
68
- {Icon ? Icon : <Icons.HomeIcon />}
69
- </StyledListItemIcon>
70
- {!collapsed && <Typography variant="subtitle2">{name}</Typography>}
71
- </StyledListItemButton>
60
+ <StyledLinkButton to={path}>
61
+ {!collapsed && (
62
+ <StyledListItemButton collapsed={collapsed}>
63
+ <StyledListItemIcon collapsed={collapsed}>
64
+ {Icon ? Icon : <Icons.HomeIcon />}
65
+ </StyledListItemIcon>
66
+ <Typography variant="subtitle2">{name}</Typography>
67
+ </StyledListItemButton>
68
+ )}
69
+ {collapsed && (
70
+ <StyledListItemButton collapsed={collapsed}>
71
+ <StyledListItemIcon collapsed={collapsed}>
72
+ {Icon ? (
73
+ <Tooltip
74
+ title={<Typography variant="label2">{name}</Typography>}
75
+ >
76
+ {Icon}
77
+ </Tooltip>
78
+ ) : (
79
+ <Tooltip
80
+ title={<Typography variant="label2">{name}</Typography>}
81
+ >
82
+ <Icons.HomeIcon />
83
+ </Tooltip>
84
+ )}
85
+ </StyledListItemIcon>
86
+ </StyledListItemButton>
87
+ )}
72
88
  </StyledLinkButton>
73
89
  </StyledListItem>
74
90
  );
@@ -35,8 +35,43 @@ export const Primary: Story = {
35
35
  render: (args) => <Sidebar {...args} />,
36
36
  args: {
37
37
  menu: [
38
- { name: "Home", path: "/home", icon: <Icons.DashBoardIcon size={24} /> },
39
- { name: "Self Service Portal", path: "/item2" },
38
+ { name: "Admin", path: "/admin", icon: <Icons.AdminIcon size={20} /> },
39
+ { name: "UMS", path: "/ums", icon: <Icons.UmsIcon size={20} /> },
40
+ {
41
+ name: "Payments",
42
+ path: "/payments",
43
+ icon: <Icons.PayxIcon size={20} />,
44
+ },
45
+ { name: "Exams", path: "/exams", icon: <Icons.ExamxIcon size={20} /> },
46
+ { name: "HRMS", path: "/hrms", icon: <Icons.PeoplexIcon size={20} /> },
47
+ {
48
+ name: "Enroll",
49
+ path: "/enroll",
50
+ icon: <Icons.EnrollxIcon size={20} />,
51
+ },
52
+ {
53
+ name: "Commute",
54
+ path: "/commute",
55
+ icon: <Icons.CommutexIcon size={20} />,
56
+ },
57
+ {
58
+ name: "Hostels",
59
+ path: "/hostels",
60
+ icon: <Icons.HostelxIcon size={20} />,
61
+ },
62
+ {
63
+ name: "Evaluator",
64
+ path: "/evaluator",
65
+ },
40
66
  ],
41
67
  },
42
68
  };
69
+
70
+ // Collapsed story
71
+ export const Collapsed: Story = {
72
+ render: (args) => <Sidebar {...args} />,
73
+ args: {
74
+ ...Primary.args,
75
+ collapsed: true,
76
+ },
77
+ };
@@ -187,7 +187,6 @@ export const getCommonTheme = (mode: Theme) => {
187
187
  styleOverrides: {
188
188
  tooltip: {
189
189
  backgroundColor: ColorTokens.surface.paperBackground,
190
- padding: "20px 20px",
191
190
  boxShadow: `0px 2px 5px ${ColorTokens.secondary.main}`,
192
191
  border: `1px solid ${ColorTokens.secondary.main}`,
193
192
  },