@campxdev/react-blueprint 0.1.56 → 1.0.0

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.56",
3
+ "version": "1.0.0",
4
4
  "main": "./export.ts",
5
5
  "private": false,
6
6
  "dependencies": {
@@ -35,7 +35,6 @@ import { ProductFeaturesIcon } from "./IconComponents/ProductFeaturesIcon";
35
35
  import { ProfileIcon } from "./IconComponents/ProfileIcon";
36
36
  import { RightIcon } from "./IconComponents/RightIcon";
37
37
  import { TicketsIcon } from "./IconComponents/TicketsIcon";
38
- import { ToursIcon } from "./IconComponents/ToursIcon";
39
38
  import { UmsIcon } from "./IconComponents/UmsIcon";
40
39
  import { UnCheckedCheckboxIcon } from "./IconComponents/UncheckCheckBoxIcon";
41
40
  import { UnCheckedRadioIcon } from "./IconComponents/UncheckedRadioIcon";
@@ -56,7 +55,6 @@ export const Icons = {
56
55
  FilterIcon,
57
56
  ExportIcon,
58
57
  ProfileIcon,
59
- ToursIcon,
60
58
  InstitutionsIcon,
61
59
  ActiveDevicesIcon,
62
60
  NavigationIcon,
@@ -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>
@@ -1,9 +1,7 @@
1
1
  import { axios } from "@campxdev/campx-web-utils";
2
- import { IconButton } from "@mui/material";
3
- import { ReactNode, useEffect, useState, useCallback } from "react";
4
- import ReactJoyride, { Step, CallBackProps, ACTIONS } from "react-joyride";
5
- import { ToursIcon } from "../../Assets/Icons/IconComponents/ToursIcon";
6
- import { Tooltip } from "../Tooltip/Tooltip";
2
+ import { Box, useTheme } from "@mui/material";
3
+ import { ReactNode, useCallback, useEffect, useState } from "react";
4
+ import ReactJoyride, { ACTIONS, CallBackProps, Step } from "react-joyride";
7
5
  import { Typography } from "../../DataDisplay/Typography/Typography";
8
6
 
9
7
  export interface TutorialProps {
@@ -21,16 +19,17 @@ export const Tutorial = ({
21
19
  }: TutorialProps) => {
22
20
  const [run, setRun] = useState(false);
23
21
  const userTours = localStorage.getItem("userTours") || "[]";
22
+ const theme = useTheme();
24
23
 
25
24
  const startTour = useCallback(() => {
26
25
  setRun(true);
27
26
  }, []);
28
27
 
29
- // useEffect(() => {
30
- // if (userTours && !userTours.includes(tourName)) {
31
- // startTour();
32
- // }
33
- // }, [userTours, tourName, startTour]);
28
+ useEffect(() => {
29
+ if (userTours && !userTours.includes(tourName)) {
30
+ startTour();
31
+ }
32
+ }, [userTours, tourName, startTour]);
34
33
 
35
34
  const handleJoyrideCallback = (data: CallBackProps) => {
36
35
  console.log(data);
@@ -75,19 +74,22 @@ export const Tutorial = ({
75
74
  };
76
75
 
77
76
  return (
78
- <div style={{ textAlign: iconPosition }}>
79
- <Tooltip
80
- title={<Typography variant="body1">Start Tour</Typography>}
81
- placement="left"
77
+ <div style={{ display: "flex", justifyContent: "flex-end" }}>
78
+ <Box
79
+ sx={{
80
+ background: theme.palette.surface.grey,
81
+ padding: "20px 8px",
82
+ borderRadius: "12px 0px 0px 12px",
83
+ cursor: "pointer",
84
+ width: "40px",
85
+ textAlign: "center",
86
+ }}
87
+ onClick={startTour}
82
88
  >
83
- <IconButton
84
- onClick={startTour}
85
- style={{ cursor: "pointer" }}
86
- aria-label={`Start ${tourName} tour`}
87
- >
88
- <ToursIcon />
89
- </IconButton>
90
- </Tooltip>
89
+ <Box sx={{ transform: "rotate(-90deg)", marginTop: "10px" }}>
90
+ <Typography variant="subtitle2">Tour</Typography>
91
+ </Box>
92
+ </Box>
91
93
 
92
94
  <ReactJoyride
93
95
  callback={handleJoyrideCallback}
@@ -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 {
@@ -63,12 +63,33 @@ export const Sidebar = ({
63
63
  setCollapsed(false);
64
64
  }}
65
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>
66
+ {!collapsed && (
67
+ <StyledListItemButton collapsed={collapsed}>
68
+ <StyledListItemIcon collapsed={collapsed}>
69
+ {Icon ? Icon : <Icons.HomeIcon />}
70
+ </StyledListItemIcon>
71
+ <Typography variant="subtitle2">{name}</Typography>
72
+ </StyledListItemButton>
73
+ )}
74
+ {collapsed && (
75
+ <StyledListItemButton collapsed={collapsed}>
76
+ <StyledListItemIcon collapsed={collapsed}>
77
+ {Icon ? (
78
+ <Tooltip
79
+ title={<Typography variant="label2">{name}</Typography>}
80
+ >
81
+ {Icon}
82
+ </Tooltip>
83
+ ) : (
84
+ <Tooltip
85
+ title={<Typography variant="label2">{name}</Typography>}
86
+ >
87
+ <Icons.HomeIcon />
88
+ </Tooltip>
89
+ )}
90
+ </StyledListItemIcon>
91
+ </StyledListItemButton>
92
+ )}
72
93
  </StyledLinkButton>
73
94
  </StyledListItem>
74
95
  );
@@ -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
  },
@@ -1,50 +0,0 @@
1
- export const ToursIcon = ({ size = 16 }) => {
2
- return (
3
- <svg
4
- xmlns="http://www.w3.org/2000/svg"
5
- width={size}
6
- height={size}
7
- viewBox="0 0 70 70"
8
- >
9
- <g
10
- id="Group_9777"
11
- data-name="Group 9777"
12
- transform="translate(-1840 -1000)"
13
- >
14
- <g
15
- id="Group_9776"
16
- data-name="Group 9776"
17
- transform="translate(1840 1000)"
18
- >
19
- <rect
20
- id="Rectangle_24558"
21
- data-name="Rectangle 24558"
22
- width="70"
23
- height="70"
24
- rx="35"
25
- fill="#f0f0f5"
26
- />
27
- <rect
28
- id="Rectangle_24559"
29
- data-name="Rectangle 24559"
30
- width="54"
31
- height="54"
32
- rx="27"
33
- transform="translate(8 8)"
34
- fill="#d0d0e3"
35
- />
36
- </g>
37
- <path
38
- id="bulb"
39
- d="M27.892,25.169c0-4.19,1.985-5.292,1.985-5.292a6.893,6.893,0,0,0,.139-9.841,7.056,7.056,0,0,0-9.978,0,6.891,6.891,0,0,0,.137,9.841s1.985,1.1,1.985,5.292Zm-1.544,5.292H23.7m3.528-2.646H22.82M24.8,4V5.323M14,14.8h1.323m19.4,0h.882M17.164,22.445l.935-.935M31.821,7.788l.624-.624m-15.281,0L18.1,8.1M31.821,21.821l.624.624"
40
- transform="translate(1850.195 1017.771)"
41
- fill="none"
42
- stroke="#323167"
43
- stroke-linecap="round"
44
- stroke-linejoin="round"
45
- stroke-width="1.8"
46
- />
47
- </g>
48
- </svg>
49
- );
50
- };