@campxdev/react-blueprint 1.1.8 → 1.1.9

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.
Files changed (209) hide show
  1. package/package.json +2 -2
  2. package/src/AppContent.tsx +6 -6
  3. package/src/assets/fonts/heebo/index.ts +2 -2
  4. package/src/assets/fonts/poppins/index.ts +5 -5
  5. package/src/assets/images/gif/index.ts +4 -0
  6. package/src/assets/images/gif/upload-file.gif +0 -0
  7. package/src/assets/images/gif/uploading-file.gif +0 -0
  8. package/src/components/Assets/ErrorPages/InternalServerError.tsx +7 -7
  9. package/src/components/Assets/ErrorPages/NoInternetConnection.tsx +7 -7
  10. package/src/components/Assets/ErrorPages/NoItemFound.tsx +7 -7
  11. package/src/components/Assets/ErrorPages/PageNotFound.tsx +5 -5
  12. package/src/components/Assets/ErrorPages/UnAuthorized.tsx +6 -6
  13. package/src/components/Assets/ErrorPages/styles.tsx +15 -15
  14. package/src/components/Assets/Icons/IconComponents/AcademicIcon.tsx +7 -1
  15. package/src/components/Assets/Icons/IconComponents/ActiveDevicesIcon.tsx +1 -1
  16. package/src/components/Assets/Icons/IconComponents/AdminIcon.tsx +1 -1
  17. package/src/components/Assets/Icons/IconComponents/AdministratorIcon.tsx +1 -1
  18. package/src/components/Assets/Icons/IconComponents/AlertFilledIcon.tsx +1 -1
  19. package/src/components/Assets/Icons/IconComponents/ArrowBackIcon.tsx +1 -1
  20. package/src/components/Assets/Icons/IconComponents/AttachmentIcon.tsx +32 -0
  21. package/src/components/Assets/Icons/IconComponents/BulbIcon.tsx +1 -1
  22. package/src/components/Assets/Icons/IconComponents/CampxFullLogoIcon.tsx +3 -3
  23. package/src/components/Assets/Icons/IconComponents/CampxIcon.tsx +2 -2
  24. package/src/components/Assets/Icons/IconComponents/CareerIcon.tsx +1 -1
  25. package/src/components/Assets/Icons/IconComponents/CheckedCheckBoxIcon.tsx +1 -1
  26. package/src/components/Assets/Icons/IconComponents/CheckedRadioIcon.tsx +1 -1
  27. package/src/components/Assets/Icons/IconComponents/ClogWheelIcon.tsx +1 -1
  28. package/src/components/Assets/Icons/IconComponents/CollapseIcon.tsx +1 -1
  29. package/src/components/Assets/Icons/IconComponents/CrossIcon.tsx +1 -1
  30. package/src/components/Assets/Icons/IconComponents/DashBoardIcon.tsx +1 -1
  31. package/src/components/Assets/Icons/IconComponents/DeleteIcon.tsx +1 -1
  32. package/src/components/Assets/Icons/IconComponents/DeviceIcon.tsx +1 -1
  33. package/src/components/Assets/Icons/IconComponents/DocumentIcon.tsx +52 -0
  34. package/src/components/Assets/Icons/IconComponents/DownloadIcon.tsx +52 -0
  35. package/src/components/Assets/Icons/IconComponents/EditIcon.tsx +1 -1
  36. package/src/components/Assets/Icons/IconComponents/ExamResultIcon.tsx +1 -1
  37. package/src/components/Assets/Icons/IconComponents/ExcelIcon.tsx +56 -0
  38. package/src/components/Assets/Icons/IconComponents/ExpandIcon.tsx +1 -1
  39. package/src/components/Assets/Icons/IconComponents/ExportIcon.tsx +1 -1
  40. package/src/components/Assets/Icons/IconComponents/FilterIcon.tsx +1 -1
  41. package/src/components/Assets/Icons/IconComponents/HelpIcon.tsx +1 -1
  42. package/src/components/Assets/Icons/IconComponents/HomeIcon.tsx +1 -1
  43. package/src/components/Assets/Icons/IconComponents/ImageIcon.tsx +44 -0
  44. package/src/components/Assets/Icons/IconComponents/InfoFilledIcon.tsx +1 -1
  45. package/src/components/Assets/Icons/IconComponents/InfoIcon.tsx +1 -1
  46. package/src/components/Assets/Icons/IconComponents/InstitutionsIcon.tsx +1 -1
  47. package/src/components/Assets/Icons/IconComponents/LeftIcon.tsx +1 -1
  48. package/src/components/Assets/Icons/IconComponents/LocationIcon.tsx +1 -1
  49. package/src/components/Assets/Icons/IconComponents/LogoutIcon.tsx +2 -2
  50. package/src/components/Assets/Icons/IconComponents/NavigationIcon.tsx +1 -1
  51. package/src/components/Assets/Icons/IconComponents/NoteIcon.tsx +7 -1
  52. package/src/components/Assets/Icons/IconComponents/NotificationIcon.tsx +1 -1
  53. package/src/components/Assets/Icons/IconComponents/PdfIcon.tsx +52 -0
  54. package/src/components/Assets/Icons/IconComponents/ProductFeaturesIcon.tsx +1 -1
  55. package/src/components/Assets/Icons/IconComponents/ProfileIcon.tsx +1 -1
  56. package/src/components/Assets/Icons/IconComponents/RedirectIcon.tsx +1 -1
  57. package/src/components/Assets/Icons/IconComponents/RedoIcon.tsx +1 -1
  58. package/src/components/Assets/Icons/IconComponents/RightIcon.tsx +1 -1
  59. package/src/components/Assets/Icons/IconComponents/SaveIcon.tsx +39 -39
  60. package/src/components/Assets/Icons/IconComponents/SearchIcon.tsx +1 -1
  61. package/src/components/Assets/Icons/IconComponents/ShareIcon.tsx +1 -1
  62. package/src/components/Assets/Icons/IconComponents/SuccessFilledIcon.tsx +1 -1
  63. package/src/components/Assets/Icons/IconComponents/TicketsIcon.tsx +1 -1
  64. package/src/components/Assets/Icons/IconComponents/UncheckCheckBoxIcon.tsx +1 -1
  65. package/src/components/Assets/Icons/IconComponents/UncheckedRadioIcon.tsx +1 -1
  66. package/src/components/Assets/Icons/IconComponents/ViewIcon.tsx +1 -1
  67. package/src/components/Assets/Icons/IconComponents/VisibiityOffIcon.tsx +1 -1
  68. package/src/components/Assets/Icons/IconComponents/VisibilityIcon.tsx +1 -1
  69. package/src/components/Assets/Icons/IconComponents/WarningFilledIcon.tsx +1 -1
  70. package/src/components/Assets/Icons/Icons.tsx +12 -0
  71. package/src/components/Assets/export.ts +6 -6
  72. package/src/components/Charts/BarChart/BarChart.tsx +17 -19
  73. package/src/components/Charts/LineChart/LineChart.tsx +12 -14
  74. package/src/components/Charts/PieChart/PieChart.tsx +8 -8
  75. package/src/components/Charts/TreeMap/TreeMap.tsx +15 -15
  76. package/src/components/Charts/export.ts +4 -4
  77. package/src/components/Charts/types/types.ts +3 -3
  78. package/src/components/DataDisplay/Accordion/Accordion.tsx +2 -0
  79. package/src/components/DataDisplay/Avatar/Avatar.tsx +14 -3
  80. package/src/components/DataDisplay/Card/Card.tsx +18 -18
  81. package/src/components/DataDisplay/Card/styles.tsx +24 -25
  82. package/src/components/DataDisplay/Chips/Chips.tsx +14 -14
  83. package/src/components/DataDisplay/DataTable/DataTable.tsx +4 -1
  84. package/src/components/DataDisplay/DataTable/TablePagination.tsx +10 -10
  85. package/src/components/DataDisplay/SidePanel/SidePanel.tsx +1 -1
  86. package/src/components/DataDisplay/Typography/Typography.tsx +1 -1
  87. package/src/components/Feedback/Alert/Alert.tsx +8 -8
  88. package/src/components/Feedback/Snackbar/Snackbar.tsx +27 -27
  89. package/src/components/Feedback/Spinner/Spinner.tsx +2 -2
  90. package/src/components/Feedback/Tooltip/Tooltip.tsx +6 -6
  91. package/src/components/Feedback/Tutorial/Tutorial.tsx +45 -45
  92. package/src/components/Feedback/export.ts +5 -0
  93. package/src/components/Image/Image.tsx +8 -8
  94. package/src/components/Input/Button/Button.tsx +2 -2
  95. package/src/components/Input/DatePicker/DatePicker.tsx +18 -4
  96. package/src/components/Input/FormActions/FormActions.tsx +15 -4
  97. package/src/components/Input/FormControlWrapper/FormControlWrapper.tsx +20 -5
  98. package/src/components/Input/HelpButton/HelpButton.stories.tsx +9 -9
  99. package/src/components/Input/HelpButton/HelpButton.tsx +4 -4
  100. package/src/components/Input/IconButtons/IconButtons/DeleteButton.tsx +2 -2
  101. package/src/components/Input/IconButtons/IconButtons/EditButton.tsx +2 -2
  102. package/src/components/Input/IconButtons/IconButtons/RedirectButton.tsx +2 -2
  103. package/src/components/Input/IconButtons/IconButtons/ViewButton.tsx +2 -2
  104. package/src/components/Input/LabelWrapper/LabelWrapper.tsx +5 -5
  105. package/src/components/Input/MultiCheckBox/MultiCheckBox.tsx +6 -6
  106. package/src/components/Input/OtpInput/OtpInput.tsx +17 -17
  107. package/src/components/Input/PasswordField/PasswordField.tsx +8 -8
  108. package/src/components/Input/RadioGroup/RadioGroup.tsx +5 -5
  109. package/src/components/Input/SearchBar/SearchBar.tsx +20 -20
  110. package/src/components/Input/SingleCheckBox/SIngleCheckBox.tsx +5 -5
  111. package/src/components/Input/SingleSelect/SingleSelect.tsx +39 -6
  112. package/src/components/Input/Switch/Switch.tsx +1 -1
  113. package/src/components/Input/TextField/TextField.tsx +3 -3
  114. package/src/components/Input/TimePicker/TimePicker.tsx +18 -4
  115. package/src/components/Input/components/FetchingOptionsLoader.tsx +3 -3
  116. package/src/components/Input/styles.tsx +6 -6
  117. package/src/components/Layout/AppHeader/AppHeader.tsx +10 -12
  118. package/src/components/Layout/AppHeader/AppHeaderActions/CogWheelMenu.tsx +5 -5
  119. package/src/components/Layout/AppHeader/AppHeaderActions/HeaderActions.tsx +6 -6
  120. package/src/components/Layout/AppHeader/AppHeaderActions/SwitchInstitution.tsx +37 -37
  121. package/src/components/Layout/AppHeader/AppHeaderActions/UserBox.tsx +28 -28
  122. package/src/components/Layout/AppHeader/styles/styles.tsx +24 -24
  123. package/src/components/Layout/PageHeader/PageHeader.tsx +8 -3
  124. package/src/components/Layout/TabsLayout/Tabs.tsx +16 -16
  125. package/src/components/Layout/TabsLayout/TabsLayout.tsx +6 -6
  126. package/src/components/Layout/export.ts +4 -0
  127. package/src/components/Navigation/Breadcrumbs/Breadcrumbs.tsx +35 -23
  128. package/src/components/Navigation/ConfirmDialog/ConfirmDialog.tsx +43 -48
  129. package/src/components/Navigation/Dialog/Dialog.tsx +33 -0
  130. package/src/components/Navigation/DialogButton/DialogButton.tsx +17 -81
  131. package/src/components/Navigation/DropDownMenu/DropDownButton.tsx +4 -4
  132. package/src/components/Navigation/DropDownMenu/DropDownIcon.tsx +4 -4
  133. package/src/components/Navigation/DropDownMenu/DropDownMenu.tsx +8 -8
  134. package/src/components/Navigation/DropDownMenu/DropdownMenuItem.tsx +3 -3
  135. package/src/components/Navigation/DropDownMenu/styles.tsx +13 -13
  136. package/src/components/Navigation/PreviewFiles/PreviewFiles.tsx +165 -0
  137. package/src/components/Navigation/Sidebar/Components.tsx +18 -18
  138. package/src/components/Navigation/Sidebar/MenuItem.tsx +1 -1
  139. package/src/components/Navigation/Sidebar/SubMenuItem.tsx +2 -1
  140. package/src/components/Navigation/Sidebar/interfaces.ts +1 -1
  141. package/src/components/Navigation/Sidebar/styles.tsx +64 -64
  142. package/src/components/Navigation/Stepper/Stepper.tsx +5 -5
  143. package/src/components/Navigation/Stepper/StepperComponents.tsx +15 -15
  144. package/src/components/Navigation/TabsContainer/TabsContainer.tsx +4 -4
  145. package/src/components/Navigation/UploadDialog/LoadingUploadDialogContainer.tsx +23 -0
  146. package/src/components/Navigation/UploadDialog/Styles.tsx +34 -0
  147. package/src/components/Navigation/UploadDialog/UploadDialog.tsx +143 -0
  148. package/src/components/Navigation/UploadDialog/UploadDialogContainer.tsx +82 -0
  149. package/src/components/Navigation/{exports.ts → export.ts} +4 -0
  150. package/src/components/export.ts +7 -7
  151. package/src/index.tsx +2 -2
  152. package/src/store/activeStore.ts +1 -1
  153. package/src/stories/Assets/Icons.stories.tsx +6 -6
  154. package/src/stories/Charts/BarChart.stories.tsx +56 -56
  155. package/src/stories/Charts/LineChart.stories.tsx +49 -49
  156. package/src/stories/Charts/PieChart.stories.tsx +53 -53
  157. package/src/stories/Charts/Treemap.stories.tsx +122 -122
  158. package/src/stories/DataDisplay/AccordionGroup.stories.tsx +11 -12
  159. package/src/stories/DataDisplay/Card.stories.tsx +34 -34
  160. package/src/stories/DataDisplay/Chips.stories.tsx +10 -10
  161. package/src/stories/DataDisplay/CircularAvatar.stories.tsx +6 -6
  162. package/src/stories/DataDisplay/DataTable.stories.tsx +32 -32
  163. package/src/stories/DataDisplay/SidePanel.stories.tsx +14 -14
  164. package/src/stories/DataDisplay/SquareAvatar.stories.tsx +15 -15
  165. package/src/stories/DesignSystem/colorTokens.stories.tsx +10 -10
  166. package/src/stories/DesignSystem/typography.stories.tsx +19 -19
  167. package/src/stories/Feedback/Alert.stories.tsx +9 -9
  168. package/src/stories/Feedback/Snackbar.stories.tsx +11 -11
  169. package/src/stories/Feedback/Spinner.stories.tsx +4 -4
  170. package/src/stories/Feedback/Tooltip.stories.tsx +5 -5
  171. package/src/stories/Feedback/Tutorial.stories.tsx +13 -13
  172. package/src/stories/Input/Button.stories.tsx +26 -26
  173. package/src/stories/Input/DatePicker.stories.tsx +48 -8
  174. package/src/stories/Input/IconButtons.stories.tsx +6 -6
  175. package/src/stories/Input/MultiCheckBox.stories.tsx +15 -15
  176. package/src/stories/Input/OtpInput.stories.tsx +5 -5
  177. package/src/stories/Input/Password.stories.tsx +7 -7
  178. package/src/stories/Input/RadioGroup.stories.tsx +14 -14
  179. package/src/stories/Input/SearchBar.stories.tsx +10 -10
  180. package/src/stories/Input/SingleCheckBox.stories.tsx +7 -7
  181. package/src/stories/Input/SingleSelect.stories.tsx +47 -47
  182. package/src/stories/Input/Switch.stories.tsx +22 -22
  183. package/src/stories/Input/TextField.stories.tsx +47 -47
  184. package/src/stories/Input/TimePicker.stories.tsx +44 -7
  185. package/src/stories/Layout/AppHeader.stories.tsx +13 -13
  186. package/src/stories/Layout/TabsLayout.stories.tsx +24 -24
  187. package/src/stories/Navigation/ConfirmDialog.stories.tsx +12 -2
  188. package/src/stories/Navigation/DialogButton.stories.tsx +38 -45
  189. package/src/stories/Navigation/DropDownMenu.stories.tsx +24 -24
  190. package/src/stories/Navigation/FloatingSidebar.stories.tsx +23 -23
  191. package/src/stories/Navigation/ImportDialog.stories.tsx +45 -0
  192. package/src/stories/Navigation/PreviewFiles.stories.tsx +80 -0
  193. package/src/stories/Navigation/Stepper.stories.tsx +15 -15
  194. package/src/stories/Navigation/TabsContainer.stories.tsx +11 -11
  195. package/src/themes/MuiThemeProvider.tsx +3 -3
  196. package/src/themes/colorTokens/colorPalette.tsx +38 -38
  197. package/src/themes/colorTokens/darkColorTokens.tsx +1 -1
  198. package/src/themes/colorTokens/lightColorTokens.ts +1 -1
  199. package/src/themes/commonTheme.ts +13 -3
  200. package/src/themes/customCssBaseline.ts +2 -2
  201. package/src/themes/darkTheme.ts +4 -4
  202. package/src/themes/export.ts +3 -3
  203. package/src/themes/lightTheme.ts +4 -4
  204. package/src/utils/constants.ts +5 -5
  205. package/src/utils/logout.ts +8 -8
  206. package/src/components/Feedback/exports.ts +0 -5
  207. package/src/components/Layout/exports.ts +0 -4
  208. package/src/stories/Navigation/Breadcrumbs.stories.tsx +0 -34
  209. package/src/utils/campxAxios.ts +0 -18
@@ -1,20 +1,20 @@
1
- import { Box, Stack, TextField, Typography, styled } from "@mui/material";
2
- import Cookies from "js-cookie";
3
- import { useState } from "react";
4
- import { isDevelopment } from "../../../../utils/constants";
5
- import Image from "../../../Image/Image";
1
+ import { Box, Stack, TextField, Typography, styled } from '@mui/material';
2
+ import Cookies from 'js-cookie';
3
+ import { useState } from 'react';
4
+ import { isDevelopment } from '../../../../utils/constants';
5
+ import Image from '../../../Image/Image';
6
6
 
7
7
  const SwitchInstitution = ({ close, institutions }: any) => {
8
- const [searchText, setSearchText] = useState<string>("");
8
+ const [searchText, setSearchText] = useState<string>('');
9
9
 
10
10
  const filteredInstitutions = institutions?.filter((item: any) =>
11
- item.name.toLowerCase().includes(searchText.toLowerCase())
11
+ item.name.toLowerCase().includes(searchText.toLowerCase()),
12
12
  );
13
13
 
14
14
  return (
15
- <Box sx={{ padding: "20px" }}>
15
+ <Box sx={{ padding: '20px' }}>
16
16
  <Stack>
17
- <Typography variant="subtitle3" textAlign={"center"}>
17
+ <Typography variant="subtitle3" textAlign={'center'}>
18
18
  Select an Institution
19
19
  </Typography>
20
20
 
@@ -23,8 +23,8 @@ const SwitchInstitution = ({ close, institutions }: any) => {
23
23
  variant="outlined"
24
24
  value={searchText}
25
25
  sx={{
26
- display: "flex",
27
- alignItems: "center",
26
+ display: 'flex',
27
+ alignItems: 'center',
28
28
  }}
29
29
  fullWidth
30
30
  onChange={(e) => setSearchText(e.target.value)}
@@ -42,7 +42,7 @@ const SwitchInstitution = ({ close, institutions }: any) => {
42
42
  const InstitutionCard = ({ institution }: any) => {
43
43
  const handleClick = () => {
44
44
  if (isDevelopment) {
45
- Cookies.set("campx_institution", institution?.code);
45
+ Cookies.set('campx_institution', institution?.code);
46
46
  } else {
47
47
  }
48
48
 
@@ -53,7 +53,7 @@ const InstitutionCard = ({ institution }: any) => {
53
53
  <StyledInstitutionCard onClick={handleClick}>
54
54
  <Image
55
55
  alt="logo"
56
- height={"100px"}
56
+ height={'100px'}
57
57
  width="100%"
58
58
  src={institution?.imageSquare?.url}
59
59
  />
@@ -63,36 +63,36 @@ const InstitutionCard = ({ institution }: any) => {
63
63
  };
64
64
 
65
65
  const StyledInstitutionCard = styled(Box)(({ theme }) => ({
66
- display: "flex",
67
- flexDirection: "column",
68
- alignItems: "center",
69
- gap: "20px",
70
- padding: "14px",
71
- border: "1px solid black",
72
- borderRadius: "10px",
73
- cursor: "pointer",
74
- width: "200px",
66
+ display: 'flex',
67
+ flexDirection: 'column',
68
+ alignItems: 'center',
69
+ gap: '20px',
70
+ padding: '14px',
71
+ border: '1px solid black',
72
+ borderRadius: '10px',
73
+ cursor: 'pointer',
74
+ width: '200px',
75
75
  flexShrink: 0,
76
76
  }));
77
77
 
78
78
  export const StyledInstitutionContainer = styled(Box)(({ theme }) => ({
79
- marginTop: "20px",
80
- display: "flex",
81
- justifyContent: "center",
82
- padding: "20px",
83
- flexWrap: "wrap",
84
- gap: "20px",
85
- "&::-webkit-scrollbar": {
86
- width: "0.5em",
87
- height: "0.5em",
88
- backgroundColor: "rgba(0, 0, 0, 0.1)",
79
+ marginTop: '20px',
80
+ display: 'flex',
81
+ justifyContent: 'center',
82
+ padding: '20px',
83
+ flexWrap: 'wrap',
84
+ gap: '20px',
85
+ '&::-webkit-scrollbar': {
86
+ width: '0.5em',
87
+ height: '0.5em',
88
+ backgroundColor: 'rgba(0, 0, 0, 0.1)',
89
89
  },
90
- "&::-webkit-scrollbar-thumb": {
91
- backgroundColor: "rgba(0, 0, 0, 0.2)",
92
- borderRadius: "3px",
90
+ '&::-webkit-scrollbar-thumb': {
91
+ backgroundColor: 'rgba(0, 0, 0, 0.2)',
92
+ borderRadius: '3px',
93
93
 
94
- "&:hover": {
95
- background: "rgba(0, 0, 0, 0.3)",
94
+ '&:hover': {
95
+ background: 'rgba(0, 0, 0, 0.3)',
96
96
  },
97
97
  },
98
98
  }));
@@ -1,24 +1,24 @@
1
- import { Avatar, Box, Stack, Typography, useTheme } from "@mui/material";
2
- import { ReactNode } from "react";
3
- import logout from "../../../../utils/logout";
4
- import DialogButton from "../../../Navigation/DialogButton/DialogButton";
5
- import { DropdownMenu } from "../../../Navigation/DropDownMenu/DropDownMenu";
6
- import { DropdownMenuItem } from "../../../Navigation/DropDownMenu/DropdownMenuItem";
7
- import { StyledMenuItem } from "../../../Navigation/DropDownMenu/styles";
8
- import { Icons } from "../../../export";
9
- import SwitchInstitution from "./SwitchInstitution";
1
+ import { Avatar, Box, Stack, Typography, useTheme } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import logout from '../../../../utils/logout';
4
+ import DialogButton from '../../../Navigation/DialogButton/DialogButton';
5
+ import { DropdownMenu } from '../../../Navigation/DropDownMenu/DropDownMenu';
6
+ import { DropdownMenuItem } from '../../../Navigation/DropDownMenu/DropdownMenuItem';
7
+ import { StyledMenuItem } from '../../../Navigation/DropDownMenu/styles';
8
+ import { Icons } from '../../../export';
9
+ import SwitchInstitution from './SwitchInstitution';
10
10
 
11
11
  const getStartingLetters = (text: string) => {
12
- if (!text) return "";
12
+ if (!text) return '';
13
13
  return text
14
- .split(" ")
14
+ .split(' ')
15
15
  ?.map((w) => w[0])
16
- ?.join("");
16
+ ?.join('');
17
17
  };
18
18
 
19
19
  export default function UserBox({
20
20
  fullName,
21
- designation = "",
21
+ designation = '',
22
22
  actions,
23
23
  profileUrl,
24
24
  profileSx = {},
@@ -48,32 +48,32 @@ export default function UserBox({
48
48
  <>
49
49
  <DropdownMenu
50
50
  anchor={({ open }) => (
51
- <Avatar src={profileUrl ?? ""} onClick={open} sx={profileSx}>
51
+ <Avatar src={profileUrl ?? ''} onClick={open} sx={profileSx}>
52
52
  {getStartingLetters(fullName)}
53
53
  </Avatar>
54
54
  )}
55
55
  menuListProps={{
56
56
  sx: {
57
- width: "300px",
58
- borderRadius: "5px",
57
+ width: '300px',
58
+ borderRadius: '5px',
59
59
  },
60
60
  }}
61
61
  menu={[
62
62
  <DropdownMenuItem
63
63
  label={
64
- <Stack gap={0.5} sx={{ width: "100%" }}>
64
+ <Stack gap={0.5} sx={{ width: '100%' }}>
65
65
  <Typography variant="subtitle3">Account</Typography>
66
66
  <Stack
67
- direction={"row"}
68
- alignItems={"center"}
69
- justifyContent={"space-between"}
67
+ direction={'row'}
68
+ alignItems={'center'}
69
+ justifyContent={'space-between'}
70
70
  >
71
71
  {avatar && (
72
- <Stack direction={"row"} gap={1}>
73
- <Avatar src={profileUrl ?? ""} sx={profileSx}>
72
+ <Stack direction={'row'} gap={1}>
73
+ <Avatar src={profileUrl ?? ''} sx={profileSx}>
74
74
  {getStartingLetters(fullName)}
75
75
  </Avatar>
76
- <Stack direction={"row"} justifyContent={"space-between"}>
76
+ <Stack direction={'row'} justifyContent={'space-between'}>
77
77
  <Stack>
78
78
  <Typography variant="subtitle3">
79
79
  {fullName}
@@ -89,7 +89,7 @@ export default function UserBox({
89
89
  </Stack>
90
90
  </Stack>
91
91
  }
92
- onClick={() => console.log("Action 1 clicked")}
92
+ onClick={() => console.log('Action 1 clicked')}
93
93
  />,
94
94
  showActiveDevices && (
95
95
  <DropdownMenuItem
@@ -98,7 +98,7 @@ export default function UserBox({
98
98
  <Typography variant="subtitle3">Active Devices</Typography>
99
99
  </Stack>
100
100
  }
101
- onClick={() => alert("Action 1 clicked")}
101
+ onClick={() => alert('Action 1 clicked')}
102
102
  />
103
103
  ),
104
104
  <Box>
@@ -126,9 +126,9 @@ export default function UserBox({
126
126
  label={
127
127
  <Stack
128
128
  gap={0.5}
129
- direction={"row"}
130
- justifyContent={"space-between"}
131
- width={"100%"}
129
+ direction={'row'}
130
+ justifyContent={'space-between'}
131
+ width={'100%'}
132
132
  >
133
133
  <Typography variant="subtitle3">Logout</Typography>
134
134
  <Icons.LogoutIcon
@@ -1,39 +1,39 @@
1
- import { Box, styled } from "@mui/material";
2
- import { Link } from "react-router-dom";
1
+ import { Box, styled } from '@mui/material';
2
+ import { Link } from 'react-router-dom';
3
3
 
4
- export const StyledHeader = styled("header")(
4
+ export const StyledHeader = styled('header')(
5
5
  ({ theme }: { theme?: any; collapsed: boolean }) => ({
6
- display: "flex",
7
- flexDirection: "row",
8
- alignItems: "center",
9
- height: "60px",
10
- minHeight: "60px",
11
- width: "100%",
6
+ display: 'flex',
7
+ flexDirection: 'row',
8
+ alignItems: 'center',
9
+ height: '60px',
10
+ minHeight: '60px',
11
+ width: '100%',
12
12
  backgroundColor: theme.palette.background.paper,
13
- justifyContent: "space-between",
14
- padding: "0 32px",
15
- borderRadius: "8px",
16
- })
13
+ justifyContent: 'space-between',
14
+ padding: '0 32px',
15
+ borderRadius: '8px',
16
+ }),
17
17
  );
18
18
 
19
19
  export const StyledActionBox = styled(Box)(({ theme }) => ({
20
- marginRight: "20px",
21
- display: "flex",
22
- alignItems: "center",
23
- gap: "14px",
20
+ marginRight: '20px',
21
+ display: 'flex',
22
+ alignItems: 'center',
23
+ gap: '14px',
24
24
  }));
25
25
 
26
26
  export const StyledRouterLink = styled(Link)(() => ({
27
- textDecoration: "none",
27
+ textDecoration: 'none',
28
28
  }));
29
29
 
30
30
  export const StyledImageWrapper = styled(Box)(() => ({
31
- width: "auto",
32
- height: "22px",
33
- display: "flex",
31
+ width: 'auto',
32
+ height: '22px',
33
+ display: 'flex',
34
34
  img: {
35
- width: "100%",
36
- height: "25px",
37
- objectFit: "contain",
35
+ width: '100%',
36
+ height: '25px',
37
+ objectFit: 'contain',
38
38
  },
39
39
  }));
@@ -1,6 +1,5 @@
1
1
  import { Box, styled, Typography } from '@mui/material';
2
2
  import { ReactNode } from 'react';
3
- import { Breadcrumbs } from '../../Navigation/Breadcrumbs/Breadcrumbs';
4
3
 
5
4
  interface BreadCrumbsLink {
6
5
  name: string | ReactNode;
@@ -35,9 +34,15 @@ export default function PageHeader({ title, actions, links }: PageHeaderProps) {
35
34
  <StyledBox>
36
35
  <>
37
36
  {links && links.length > 0 ? (
38
- <Breadcrumbs links={links} />
37
+ <></>
39
38
  ) : (
40
- <>{typeof title === 'string' ? <Typography variant="subtitle2">{title}</Typography> : title}</>
39
+ <>
40
+ {typeof title === 'string' ? (
41
+ <Typography variant="subtitle2">{title}</Typography>
42
+ ) : (
43
+ title
44
+ )}
45
+ </>
41
46
  )}
42
47
  </>
43
48
  <Box className="actions">{actions}</Box>
@@ -1,5 +1,5 @@
1
- import { Box, Divider, styled } from "@mui/material";
2
- import { NavLink } from "react-router-dom";
1
+ import { Box, Divider, styled } from '@mui/material';
2
+ import { NavLink } from 'react-router-dom';
3
3
 
4
4
  interface TabProps {
5
5
  index: number;
@@ -24,8 +24,8 @@ export const Tab = ({
24
24
  <Box
25
25
  key={index}
26
26
  sx={{
27
- display: "flex",
28
- alignItems: "center",
27
+ display: 'flex',
28
+ alignItems: 'center',
29
29
  }}
30
30
  onClick={() => handleTabChange(index)}
31
31
  >
@@ -40,27 +40,27 @@ export const Tab = ({
40
40
  };
41
41
 
42
42
  const StyledNavLink = styled(NavLink)(({ theme }) => ({
43
- width: "204px",
44
- padding: "12px 26px",
45
- textAlign: "center",
46
- textDecoration: "none",
43
+ width: '204px',
44
+ padding: '12px 26px',
45
+ textAlign: 'center',
46
+ textDecoration: 'none',
47
47
  fontWeight: 400,
48
48
  color: theme.palette.text.secondary,
49
- borderTopRightRadius: "12px",
50
- borderTopLeftRadius: "12px",
49
+ borderTopRightRadius: '12px',
50
+ borderTopLeftRadius: '12px',
51
51
  backgroundColor: theme.palette.surface.defaultBackground,
52
- position: "relative",
52
+ position: 'relative',
53
53
 
54
- "&.active": {
54
+ '&.active': {
55
55
  fontWeight: 600,
56
56
  color: theme.palette.text.primary,
57
57
  backgroundColor: theme.palette.surface.paperBackground,
58
- "&::after": {
58
+ '&::after': {
59
59
  content: '""',
60
- position: "absolute",
60
+ position: 'absolute',
61
61
  bottom: 0,
62
- left: "25%",
63
- width: "50%",
62
+ left: '25%',
63
+ width: '50%',
64
64
  borderBottom: `4px solid ${theme.palette.tertiary.main}`,
65
65
  },
66
66
  },
@@ -1,8 +1,8 @@
1
- import { Box, Stack, useTheme } from "@mui/material";
2
- import { useState } from "react";
3
- import { ErrorBoundary } from "react-error-boundary";
4
- import { Outlet } from "react-router-dom";
5
- import { Tab } from "./Tabs";
1
+ import { Box, Stack, useTheme } from '@mui/material';
2
+ import { useState } from 'react';
3
+ import { ErrorBoundary } from 'react-error-boundary';
4
+ import { Outlet } from 'react-router-dom';
5
+ import { Tab } from './Tabs';
6
6
 
7
7
  interface TabsLayoutProps {
8
8
  menu: MenuItem[];
@@ -24,7 +24,7 @@ export const TabsLayout = ({ menu }: TabsLayoutProps) => {
24
24
  return (
25
25
  <Stack>
26
26
  <Stack
27
- direction={"row"}
27
+ direction={'row'}
28
28
  sx={{
29
29
  backgroundColor: theme.palette.surface.defaultBackground,
30
30
  }}
@@ -0,0 +1,4 @@
1
+ import { AppHeader } from './AppHeader/AppHeader';
2
+ import { TabsLayout } from './TabsLayout/TabsLayout';
3
+
4
+ export { AppHeader, TabsLayout };
@@ -1,40 +1,52 @@
1
+ import { getBreadcrumbsCharacter } from '@campxdev/campx-web-utils';
1
2
  import {
2
- Link,
3
3
  Breadcrumbs as MuiBreadcrumbs,
4
+ BreadcrumbsProps as MuiBreadcrumbsProps,
4
5
  Stack,
5
6
  styled,
6
- } from "@mui/material";
7
- import { ReactNode } from "react";
8
- import { Typography } from "../../DataDisplay/Typography/Typography";
7
+ } from '@mui/material';
8
+ import { Link } from 'react-router-dom';
9
+ import { Typography } from '../../export';
9
10
 
10
- interface BreadcrumbsProps {
11
- links: {
12
- name: string | ReactNode;
13
- to: string;
14
- }[];
15
- }
11
+ export type BreadcrumbsProps = {
12
+ urlSpliceCount: number;
13
+ } & MuiBreadcrumbsProps;
16
14
 
17
- export const Breadcrumbs = ({ links }: BreadcrumbsProps) => {
18
- const linksArray = links?.slice(0, -1);
19
- const currentPage = links?.slice(-1)[0];
15
+ export const Breadcrumbs = ({ urlSpliceCount, ...rest }: BreadcrumbsProps) => {
16
+ const specialCharacter = getBreadcrumbsCharacter();
17
+ const currentPathArray = window.location.pathname.split('/');
18
+
19
+ let basePath =
20
+ window.location.origin +
21
+ currentPathArray.slice(0, urlSpliceCount + 1).join('/');
22
+
23
+ currentPathArray.splice(0, urlSpliceCount + 1);
20
24
 
21
25
  return (
22
- <Stack direction={"row"} alignItems={"center"}>
23
- <MuiBreadcrumbs>
24
- {linksArray?.map((item, index) => (
25
- <StyledLink key={index} href={item?.to}>
26
- {item?.name}
27
- </StyledLink>
28
- ))}
29
- <Typography variant="subtitle2">{currentPage?.name}</Typography>
26
+ <Stack direction={'row'} alignItems={'center'}>
27
+ <MuiBreadcrumbs {...rest}>
28
+ {currentPathArray?.map((item, index) => {
29
+ basePath = basePath + `/${item}`;
30
+ return index === currentPathArray.length - 1 ? (
31
+ <Typography variant="subtitle2">
32
+ {decodeURIComponent(item).split(specialCharacter)[0]}
33
+ </Typography>
34
+ ) : (
35
+ <StyledLink key={index} to={basePath}>
36
+ {decodeURIComponent(item).split(specialCharacter)[0]}
37
+ </StyledLink>
38
+ );
39
+ })}
30
40
  </MuiBreadcrumbs>
31
41
  </Stack>
32
42
  );
33
43
  };
34
44
 
35
45
  const StyledLink = styled(Link)(({ theme }) => ({
36
- transition: "color 0.3s ease-in-out",
37
- "&:hover": {
46
+ textDecoration: 'none',
47
+ transition: 'color 0.3s ease-in-out',
48
+ color: theme.palette.text.tertiary,
49
+ '&:hover': {
38
50
  color: theme.palette.primary.light,
39
51
  },
40
52
  }));
@@ -1,7 +1,6 @@
1
- import { Box, Dialog, DialogActions, styled } from '@mui/material';
2
-
1
+ import { Box, Stack } from '@mui/material';
3
2
  import { AnimatedGifs } from '../../../assets/images/gif';
4
- import { Button, Typography } from '../../export';
3
+ import { Button, Dialog, Typography } from '../../export';
5
4
 
6
5
  export type ConfirmDialogType = 'confirm' | 'delete';
7
6
 
@@ -14,19 +13,6 @@ export type ConfirmDialogProps = {
14
13
  type: ConfirmDialogType;
15
14
  };
16
15
 
17
- const StyledDialogContent = styled(Box)(() => ({
18
- display: 'flex',
19
- alignItems: 'center',
20
- }));
21
-
22
- const StyledDialog = styled(Dialog)(({ theme }) => ({
23
- '& .MuiPaper-root': {
24
- padding: '24px 16px',
25
- display: 'flex',
26
- height: '175px',
27
- },
28
- }));
29
-
30
16
  export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
31
17
  isOpen,
32
18
  title,
@@ -38,42 +24,51 @@ export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
38
24
  if (!isOpen) return null;
39
25
 
40
26
  return (
41
- <StyledDialog
27
+ <Dialog
42
28
  keepMounted
43
29
  maxWidth="sm"
44
30
  transitionDuration={150}
45
31
  open={isOpen}
32
+ content={({ close }) => {
33
+ return (
34
+ <>
35
+ <Stack direction="row" alignItems="center">
36
+ <img
37
+ src={
38
+ type === 'delete'
39
+ ? AnimatedGifs.DeleteConfirmationAlert
40
+ : AnimatedGifs.ConfirmationAlert
41
+ }
42
+ alt="Animated GIF"
43
+ style={{ width: '80px' }}
44
+ />
45
+ <Box>
46
+ <Typography variant="subtitle2">{title}</Typography>
47
+ <Typography variant="label1">{message}</Typography>
48
+ </Box>
49
+ </Stack>
50
+ <Stack direction="row" justifyContent="flex-end" gap={3}>
51
+ <Button
52
+ onClick={() => {
53
+ onCancel();
54
+ close();
55
+ }}
56
+ variant="text"
57
+ >
58
+ Cancel
59
+ </Button>
60
+ <Button
61
+ onClick={onConfirm}
62
+ variant="contained"
63
+ color={type === 'delete' ? 'error' : 'primary'}
64
+ >
65
+ {type === 'delete' ? 'Confirm Delete' : 'Confirm'}
66
+ </Button>
67
+ </Stack>
68
+ </>
69
+ );
70
+ }}
46
71
  onClose={onCancel}
47
- >
48
- <StyledDialogContent>
49
- <Box>
50
- <img
51
- src={
52
- type === 'delete'
53
- ? AnimatedGifs.DeleteConfirmationAlert
54
- : AnimatedGifs.ConfirmationAlert
55
- }
56
- alt="Animated GIF"
57
- style={{ width: '80px' }}
58
- />
59
- </Box>
60
- <Box>
61
- <Typography variant="subtitle2">{title}</Typography>
62
- <Typography variant="label1">{message}</Typography>
63
- </Box>
64
- </StyledDialogContent>
65
- <DialogActions sx={{ gap: '16px' }}>
66
- <Button onClick={onCancel} variant="text">
67
- Cancel
68
- </Button>
69
- <Button
70
- onClick={onConfirm}
71
- variant="contained"
72
- color={type === 'delete' ? 'error' : 'primary'}
73
- >
74
- {type === 'delete' ? 'Confirm Delete' : 'Confirm'}
75
- </Button>
76
- </DialogActions>
77
- </StyledDialog>
72
+ />
78
73
  );
79
74
  };
@@ -0,0 +1,33 @@
1
+ import {
2
+ DialogContent,
3
+ DialogTitle,
4
+ Dialog as MuiDialog,
5
+ DialogProps as MuiDialogProps,
6
+ } from '@mui/material';
7
+ import { ReactNode } from 'react';
8
+ export type DialogProps = {
9
+ content: (props: { close: () => void }) => ReactNode;
10
+ title?: string | undefined;
11
+ onClose: () => void;
12
+ } & Omit<MuiDialogProps, 'content'>;
13
+
14
+ export const Dialog = ({
15
+ onClose,
16
+ title,
17
+ content,
18
+ open,
19
+ ...props
20
+ }: DialogProps) => {
21
+ return (
22
+ <MuiDialog
23
+ open={open}
24
+ onClose={(_, reason) => {
25
+ onClose();
26
+ }}
27
+ {...props}
28
+ >
29
+ {title && <DialogTitle>{title}</DialogTitle>}
30
+ <DialogContent> {content({ close: onClose })}</DialogContent>
31
+ </MuiDialog>
32
+ );
33
+ };