@campxdev/react-blueprint 0.1.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.
Files changed (122) hide show
  1. package/.storybook/main.ts +29 -0
  2. package/.storybook/preview.tsx +28 -0
  3. package/.vscode/settings.json +3 -0
  4. package/README.md +100 -0
  5. package/bitbucket-pipelines.yml +60 -0
  6. package/exports.ts +1 -0
  7. package/package.json +74 -0
  8. package/public/favicon.ico +0 -0
  9. package/public/index.html +43 -0
  10. package/public/logo192.png +0 -0
  11. package/public/logo512.png +0 -0
  12. package/public/manifest.json +25 -0
  13. package/public/robots.txt +3 -0
  14. package/src/App.css +38 -0
  15. package/src/App.test.tsx +9 -0
  16. package/src/App.tsx +12 -0
  17. package/src/assets/fonts/heebo/Heebo-Medium.ttf +0 -0
  18. package/src/assets/fonts/heebo/Heebo-SemiBold.ttf +0 -0
  19. package/src/assets/fonts/heebo/index.ts +3 -0
  20. package/src/assets/fonts/poppins/Poppins-Bold.ttf +0 -0
  21. package/src/assets/fonts/poppins/Poppins-Light.ttf +0 -0
  22. package/src/assets/fonts/poppins/Poppins-Medium.ttf +0 -0
  23. package/src/assets/fonts/poppins/Poppins-Regular.ttf +0 -0
  24. package/src/assets/fonts/poppins/Poppins-SemiBold.ttf +0 -0
  25. package/src/assets/fonts/poppins/index.ts +14 -0
  26. package/src/assets/images/admin.png +0 -0
  27. package/src/assets/images/campx_logo__full_primary.png +0 -0
  28. package/src/assets/images/collegex.png +0 -0
  29. package/src/assets/images/commutex.png +0 -0
  30. package/src/assets/images/enrollx.png +0 -0
  31. package/src/assets/images/examx.png +0 -0
  32. package/src/assets/images/hostelx copy.png +0 -0
  33. package/src/assets/images/hostelx.png +0 -0
  34. package/src/assets/images/icons.tsx +193 -0
  35. package/src/assets/images/index.ts +25 -0
  36. package/src/assets/images/payx.png +0 -0
  37. package/src/assets/images/pepolex.png +0 -0
  38. package/src/assets/images/svg/commutex_small.svg +11 -0
  39. package/src/assets/images/svg/enroll_logo.svg +9 -0
  40. package/src/assets/images/svg/exams_small.svg +12 -0
  41. package/src/assets/images/svg/help-icon.svg +8 -0
  42. package/src/assets/images/svg/hostel_small.svg +13 -0
  43. package/src/assets/images/svg/index.ts +19 -0
  44. package/src/assets/images/svg/payx_small.svg +16 -0
  45. package/src/assets/images/svg/people_small.svg +9 -0
  46. package/src/assets/images/svg/squareSmall.svg +9 -0
  47. package/src/assets/images/svg/square_small.svg +9 -0
  48. package/src/components/DropDownMenu/DropDownButton.tsx +30 -0
  49. package/src/components/DropDownMenu/DropDownIcon.tsx +31 -0
  50. package/src/components/DropDownMenu/DropDownMenu.stories.tsx +139 -0
  51. package/src/components/DropDownMenu/DropDownMenu.tsx +65 -0
  52. package/src/components/DropDownMenu/MenuItemButton.tsx +29 -0
  53. package/src/components/DropDownMenu/styles.tsx +31 -0
  54. package/src/components/Input/Button/Button.stories.tsx +62 -0
  55. package/src/components/Input/Button/Button.tsx +11 -0
  56. package/src/components/Input/Label/Label.tsx +11 -0
  57. package/src/components/Input/SingleSelect/SingleSelect.stories.tsx +55 -0
  58. package/src/components/Input/SingleSelect/SingleSelect.tsx +4 -0
  59. package/src/components/Input/Switch/Switch.stories.tsx +62 -0
  60. package/src/components/Input/Switch/Switch.tsx +11 -0
  61. package/src/components/Input/TextField/TextField.stories.tsx +135 -0
  62. package/src/components/Input/TextField/TextField.tsx +35 -0
  63. package/src/components/Layout/ComponentBackground/ComponentBackground.tsx +82 -0
  64. package/src/components/Layout/ComponentBackground/DefaultBackground.tsx +12 -0
  65. package/src/components/Layout/ComponentBackground/PaperBackground.tsx +12 -0
  66. package/src/components/Layout/Header/AppHeader.stories.tsx +209 -0
  67. package/src/components/Layout/Header/AppHeader.tsx +70 -0
  68. package/src/components/Layout/Header/AppLogo.tsx +53 -0
  69. package/src/components/Layout/Header/AppsMenu.tsx +162 -0
  70. package/src/components/Layout/Header/HeaderActions/CogWheelMenu.tsx +30 -0
  71. package/src/components/Layout/Header/HeaderActions/HeaderActions.tsx +63 -0
  72. package/src/components/Layout/Header/HeaderActions/UserBox.tsx +117 -0
  73. package/src/components/Layout/Header/styles/styles.tsx +69 -0
  74. package/src/components/Typography/Typography.stories.tsx +95 -0
  75. package/src/components/Typography/Typography.tsx +12 -0
  76. package/src/components/index.ts +1 -0
  77. package/src/contexts/Providers.tsx +6 -0
  78. package/src/index.css +13 -0
  79. package/src/index.tsx +19 -0
  80. package/src/logo.svg +1 -0
  81. package/src/react-app-env.d.ts +1 -0
  82. package/src/reportWebVitals.ts +15 -0
  83. package/src/setupTests.ts +5 -0
  84. package/src/stories/Button.stories.ts +52 -0
  85. package/src/stories/Button.tsx +48 -0
  86. package/src/stories/Configure.mdx +364 -0
  87. package/src/stories/Header.stories.ts +33 -0
  88. package/src/stories/Header.tsx +56 -0
  89. package/src/stories/Page.stories.ts +32 -0
  90. package/src/stories/Page.tsx +73 -0
  91. package/src/stories/assets/accessibility.png +0 -0
  92. package/src/stories/assets/accessibility.svg +5 -0
  93. package/src/stories/assets/addon-library.png +0 -0
  94. package/src/stories/assets/assets.png +0 -0
  95. package/src/stories/assets/avif-test-image.avif +0 -0
  96. package/src/stories/assets/context.png +0 -0
  97. package/src/stories/assets/discord.svg +15 -0
  98. package/src/stories/assets/docs.png +0 -0
  99. package/src/stories/assets/figma-plugin.png +0 -0
  100. package/src/stories/assets/github.svg +3 -0
  101. package/src/stories/assets/share.png +0 -0
  102. package/src/stories/assets/styling.png +0 -0
  103. package/src/stories/assets/testing.png +0 -0
  104. package/src/stories/assets/theming.png +0 -0
  105. package/src/stories/assets/tutorials.svg +12 -0
  106. package/src/stories/assets/youtube.svg +4 -0
  107. package/src/stories/button.css +30 -0
  108. package/src/stories/header.css +32 -0
  109. package/src/stories/page.css +69 -0
  110. package/src/themes/MuiThemeProvider.tsx +18 -0
  111. package/src/themes/colorTokens.stories.tsx +71 -0
  112. package/src/themes/colorTokens.ts +77 -0
  113. package/src/themes/commonTheme.ts +443 -0
  114. package/src/themes/customCssBaseline.ts +39 -0
  115. package/src/themes/darkTheme.ts +24 -0
  116. package/src/themes/index.ts +4 -0
  117. package/src/themes/lightTheme.ts +22 -0
  118. package/src/themes/typography.stories.tsx +79 -0
  119. package/src/utils/applications.ts +140 -0
  120. package/src/utils/constants.ts +6 -0
  121. package/src/utils/imageMap.ts +22 -0
  122. package/tsconfig.json +26 -0
@@ -0,0 +1,193 @@
1
+ import { useTheme } from "@mui/material";
2
+
3
+ export const AppsIcon = () => {
4
+ return (
5
+ <svg
6
+ id="apps"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ width="24"
9
+ height="24"
10
+ viewBox="0 0 24 24"
11
+ >
12
+ <path
13
+ id="Path_15109"
14
+ data-name="Path 15109"
15
+ d="M7,0H4A4,4,0,0,0,0,4V7a4,4,0,0,0,4,4H7a4,4,0,0,0,4-4V4A4,4,0,0,0,7,0ZM9,7A2,2,0,0,1,7,9H4A2,2,0,0,1,2,7V4A2,2,0,0,1,4,2H7A2,2,0,0,1,9,4Z"
16
+ fill="#d4483e"
17
+ />
18
+ <path
19
+ id="Path_15110"
20
+ data-name="Path 15110"
21
+ d="M20,0H17a4,4,0,0,0-4,4V7a4,4,0,0,0,4,4h3a4,4,0,0,0,4-4V4A4,4,0,0,0,20,0Zm2,7a2,2,0,0,1-2,2H17a2,2,0,0,1-2-2V4a2,2,0,0,1,2-2h3a2,2,0,0,1,2,2Z"
22
+ fill="#f8d759"
23
+ />
24
+ <path
25
+ id="Path_15111"
26
+ data-name="Path 15111"
27
+ d="M7,13H4a4,4,0,0,0-4,4v3a4,4,0,0,0,4,4H7a4,4,0,0,0,4-4V17A4,4,0,0,0,7,13Zm2,7a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V17a2,2,0,0,1,2-2H7a2,2,0,0,1,2,2Z"
28
+ fill="#88b053"
29
+ />
30
+ <path
31
+ id="Path_15112"
32
+ data-name="Path 15112"
33
+ d="M20,13H17a4,4,0,0,0-4,4v3a4,4,0,0,0,4,4h3a4,4,0,0,0,4-4V17A4,4,0,0,0,20,13Zm2,7a2,2,0,0,1-2,2H17a2,2,0,0,1-2-2V17a2,2,0,0,1,2-2h3a2,2,0,0,1,2,2Z"
34
+ fill="#4baabe"
35
+ />
36
+ </svg>
37
+ );
38
+ };
39
+
40
+ export const HelpIcon = () => {
41
+ const theme = useTheme();
42
+ const color = theme.palette.text.primary;
43
+ return (
44
+ <svg
45
+ id="message-question"
46
+ xmlns="http://www.w3.org/2000/svg"
47
+ width="20"
48
+ height="20"
49
+ viewBox="0 0 20 20"
50
+ >
51
+ <g id="message-question-2" data-name="message-question">
52
+ <path
53
+ id="Vector"
54
+ d="M12.5,16.667H4.1A3.877,3.877,0,0,1,0,12.593V4.074A3.893,3.893,0,0,1,4.167,0H12.5a3.893,3.893,0,0,1,4.167,4.074v8.52A3.893,3.893,0,0,1,12.5,16.667Z"
55
+ transform="translate(1.667 2.025)"
56
+ fill="none"
57
+ stroke={color}
58
+ stroke-linecap="round"
59
+ stroke-linejoin="round"
60
+ stroke-width="1.5"
61
+ />
62
+ <path
63
+ id="Vector-2"
64
+ data-name="Vector"
65
+ d="M2.245,6.086V5.8A2.119,2.119,0,0,1,3.382,4,2.073,2.073,0,0,0,4.491,2.245,2.245,2.245,0,0,0,0,2.245"
66
+ transform="translate(7.755 5.594)"
67
+ fill="none"
68
+ stroke={color}
69
+ stroke-linecap="round"
70
+ stroke-linejoin="round"
71
+ stroke-width="1.5"
72
+ />
73
+ <path
74
+ id="Vector-3"
75
+ data-name="Vector"
76
+ d="M0,0H20V20H0Z"
77
+ fill="none"
78
+ opacity="0"
79
+ />
80
+ <path
81
+ id="Vector-4"
82
+ data-name="Vector"
83
+ d="M.5.5H.508"
84
+ transform="translate(9.499 14.414)"
85
+ fill="none"
86
+ stroke={color}
87
+ stroke-linecap="round"
88
+ stroke-linejoin="round"
89
+ stroke-width="1.5"
90
+ />
91
+ </g>
92
+ </svg>
93
+ );
94
+ };
95
+
96
+ export const NotificationIcon = () => {
97
+ return (
98
+ <>
99
+ <svg
100
+ xmlns="http://www.w3.org/2000/svg"
101
+ width="18.125"
102
+ height="20"
103
+ viewBox="0 0 18.125 20"
104
+ >
105
+ <path
106
+ id="bell_10_"
107
+ data-name="bell (10)"
108
+ d="M18.958,11.384l-1.583-5.7a7.767,7.767,0,0,0-15.064.395L1.085,11.595a4.166,4.166,0,0,0,4.067,5.07H6.08a4.166,4.166,0,0,0,8.166,0h.7a4.166,4.166,0,0,0,4.015-5.281Zm-8.795,6.948a2.5,2.5,0,0,1-2.346-1.666H12.51A2.5,2.5,0,0,1,10.163,18.332Zm6.771-4.32A2.481,2.481,0,0,1,14.944,15H5.152a2.5,2.5,0,0,1-2.44-3.042L3.937,6.444a6.1,6.1,0,0,1,11.832-.31l1.583,5.7a2.481,2.481,0,0,1-.418,2.181Z"
109
+ transform="translate(-0.986 -0.002)"
110
+ fill="#121212"
111
+ />
112
+ </svg>
113
+ </>
114
+ );
115
+ };
116
+
117
+ export const ExamResultIcon = () => {
118
+ const theme = useTheme();
119
+ const color = theme.palette.text.primary;
120
+ return (
121
+ <>
122
+ <svg
123
+ xmlns="http://www.w3.org/2000/svg"
124
+ width="14.3"
125
+ height="20.3"
126
+ viewBox="0 0 15.3 20.3"
127
+ >
128
+ <path
129
+ id="mobile"
130
+ d="M13.833,0H7.167A4.172,4.172,0,0,0,3,4.167V15.833A4.172,4.172,0,0,0,7.167,20h6.667A4.172,4.172,0,0,0,18,15.833V4.167A4.172,4.172,0,0,0,13.833,0Zm2.5,15.833a2.5,2.5,0,0,1-2.5,2.5h-2.5V17.5a.833.833,0,1,0-1.667,0v.833h-2.5a2.5,2.5,0,0,1-2.5-2.5V4.167a2.5,2.5,0,0,1,2.5-2.5h6.667a2.5,2.5,0,0,1,2.5,2.5Zm-2.5-2.5a.833.833,0,0,1-.833.833H8A.833.833,0,1,1,8,12.5h5A.833.833,0,0,1,13.833,13.333Zm-5-2.5A.833.833,0,0,0,9.667,10V9.167h1.667V10A.833.833,0,0,0,13,10V6.667a2.5,2.5,0,1,0-5,0V10A.833.833,0,0,0,8.833,10.833Zm1.667-5a.833.833,0,0,1,.833.833V7.5H9.667V6.667A.833.833,0,0,1,10.5,5.833Z"
131
+ transform="translate(-2.85 0.15)"
132
+ stroke-width="0.3"
133
+ fill={color}
134
+ />
135
+ </svg>
136
+ </>
137
+ );
138
+ };
139
+
140
+ export const CareerIcon = () => {
141
+ const theme = useTheme();
142
+ const color = theme.palette.text.primary;
143
+ return (
144
+ <svg
145
+ xmlns="http://www.w3.org/2000/svg"
146
+ width="18.3"
147
+ height="20.3"
148
+ viewBox="0 0 20.3 20.3"
149
+ >
150
+ <path
151
+ id="briefcase"
152
+ d="M15.833,3.333h-.917A4.174,4.174,0,0,0,10.833,0H9.167A4.174,4.174,0,0,0,5.083,3.333H4.167A4.172,4.172,0,0,0,0,7.5v8.333A4.172,4.172,0,0,0,4.167,20H15.833A4.172,4.172,0,0,0,20,15.833V7.5a4.172,4.172,0,0,0-4.167-4.167ZM9.167,1.667h1.667A2.5,2.5,0,0,1,13.18,3.333H6.82A2.5,2.5,0,0,1,9.167,1.667ZM4.167,5H15.833a2.5,2.5,0,0,1,2.5,2.5V10H1.667V7.5A2.5,2.5,0,0,1,4.167,5ZM15.833,18.333H4.167a2.5,2.5,0,0,1-2.5-2.5V11.667h7.5V12.5a.833.833,0,0,0,1.667,0v-.833h7.5v4.167A2.5,2.5,0,0,1,15.833,18.333Z"
153
+ transform="translate(0.15 0.15)"
154
+ fill={color}
155
+ stroke-width="0.3"
156
+ />
157
+ </svg>
158
+ );
159
+ };
160
+
161
+ export const ClogWheelIcon = () => {
162
+ const theme = useTheme();
163
+ const color = theme.palette.text.primary;
164
+ return (
165
+ <svg
166
+ xmlns="http://www.w3.org/2000/svg"
167
+ width="16.595"
168
+ height="20"
169
+ viewBox="0 0 17.995 20"
170
+ >
171
+ <g
172
+ id="settings_11_"
173
+ data-name="settings (11)"
174
+ transform="translate(-1.203)"
175
+ >
176
+ <path
177
+ id="Path_1375"
178
+ data-name="Path 1375"
179
+ d="M11.333,8a3.333,3.333,0,1,0,3.333,3.333A3.333,3.333,0,0,0,11.333,8Zm0,5A1.667,1.667,0,1,1,13,11.333,1.667,1.667,0,0,1,11.333,13Z"
180
+ transform="translate(-1.133 -1.333)"
181
+ fill={color}
182
+ />
183
+ <path
184
+ id="Path_1376"
185
+ data-name="Path 1376"
186
+ d="M17.945,11.583l-.37-.213a7.583,7.583,0,0,0,0-2.742l.37-.213a2.5,2.5,0,1,0-2.5-4.333l-.371.214A7.481,7.481,0,0,0,12.7,2.927V2.5a2.5,2.5,0,1,0-5,0v.427A7.481,7.481,0,0,0,5.327,4.3l-.373-.216a2.5,2.5,0,1,0-2.5,4.333l.37.213a7.583,7.583,0,0,0,0,2.742l-.37.213a2.5,2.5,0,0,0,2.5,4.333l.371-.214A7.481,7.481,0,0,0,7.7,17.072V17.5a2.5,2.5,0,1,0,5,0v-.428A7.481,7.481,0,0,0,15.074,15.7l.373.215a2.5,2.5,0,1,0,2.5-4.333ZM15.822,8.437a5.873,5.873,0,0,1,0,3.125.833.833,0,0,0,.387.944l.9.522a.834.834,0,1,1-.833,1.444l-.9-.523a.833.833,0,0,0-1.012.138,5.82,5.82,0,0,1-2.7,1.563.833.833,0,0,0-.626.807V17.5a.833.833,0,0,1-1.667,0V16.457a.833.833,0,0,0-.626-.807,5.82,5.82,0,0,1-2.7-1.566.833.833,0,0,0-1.013-.138l-.9.523a.833.833,0,1,1-.833-1.443l.9-.522a.833.833,0,0,0,.387-.944,5.873,5.873,0,0,1,0-3.125.833.833,0,0,0-.388-.941l-.9-.522a.834.834,0,0,1,.833-1.444l.9.523a.833.833,0,0,0,1.012-.134,5.82,5.82,0,0,1,2.7-1.562.833.833,0,0,0,.626-.811V2.5a.833.833,0,1,1,1.667,0V3.543a.833.833,0,0,0,.626.808,5.82,5.82,0,0,1,2.7,1.566.833.833,0,0,0,1.012.137l.9-.522a.833.833,0,1,1,.833,1.443l-.9.522a.833.833,0,0,0-.386.941Z"
187
+ transform="translate(0 0)"
188
+ fill={color}
189
+ />
190
+ </g>
191
+ </svg>
192
+ );
193
+ };
@@ -0,0 +1,25 @@
1
+ import admin from "./admin.png";
2
+ import campxLogoPrimary from "./campx_logo__full_primary.png";
3
+ import collegex from "./collegex.png";
4
+ import commutex from "./commutex.png";
5
+
6
+ import enrollx from "./enrollx.png";
7
+
8
+ import examx from "./examx.png";
9
+
10
+ import hostelx from "./hostelx.png";
11
+ import payx from "./payx.png";
12
+
13
+ import peoplex from "./pepolex.png";
14
+
15
+ export {
16
+ admin,
17
+ campxLogoPrimary,
18
+ collegex,
19
+ commutex,
20
+ enrollx,
21
+ examx,
22
+ hostelx,
23
+ payx,
24
+ peoplex,
25
+ };
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25.391" height="35" viewBox="0 0 25.391 35">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#6a2886"/>
5
+ <stop offset="1" stop-color="#8234a4"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="Group_4867" data-name="Group 4867" transform="translate(-152.7 -249.981)">
9
+ <path id="Union_49" data-name="Union 49" d="M16.86,35l-4.188-5.765L8.483,35H.085L0,34.938,11.873,18.6H.008V16.408H11.931L4.267,5.87l0,0L0,0,0,0H8.531l4.188,5.764L16.907,0h8.4l.086.062L13.514,16.408H25.383V18.6H13.463L21.124,29.13l0,0L25.391,35l0,0Z" transform="translate(152.7 249.981)" fill="url(#linear-gradient)"/>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="177.011" height="195.229" viewBox="0 0 177.011 195.229">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#007ab1"/>
5
+ <stop offset="1" stop-color="#149ecd"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <path id="Union_61" data-name="Union 61" d="M0,195.229H.009L0,195.215l23.664-32.567.009.013L70.934,97.615h46.6l.474.344-70.671,97.27ZM87.442,156.1l42.5-58.487h46.6l.474.344L134.768,156.1Zm89.1-58.487h0Zm0,0h-46.6L87.381,39.042h47.325L177.011,97.27Zm-105.6,0L23.673,32.568l-.009.013L0,.013.009,0H47.337l70.671,97.27-.474.344ZM106.356.022h0ZM106.357.022Zm-47.346,0L59,.013,59.014,0h47.327l.016.021H59.011ZM0,0H.009Z" fill="url(#linear-gradient)"/>
9
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="33.975" height="35" viewBox="0 0 33.975 35">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#d86b00"/>
5
+ <stop offset="1" stop-color="#ed9035"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="Group_4349" data-name="Group 4349" transform="translate(-342.295 -263.508)">
9
+ <path id="Subtraction_34" data-name="Subtraction 34" d="M33.973,35H25.488l0,0L0,35l0,0,4.242-5.838,0,0L12.717,17.5,4.244,5.839l0,0L0,0,0,0H33.973l0,0L29.732,5.841l0,0L21.257,17.5,29.73,29.161l0,0L33.975,35l0,0ZM16.987,23.3,13.43,28.2l7.11,0L16.987,23.3ZM13.43,6.8l3.557,4.9L20.539,6.8l-7.109,0Z" transform="translate(342.295 263.508)" fill="url(#linear-gradient)"/>
10
+ <rect id="Rectangle_4307" data-name="Rectangle 4307" width="0.404" height="14.649" transform="translate(359.08 273.686)" fill="#16161d"/>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg id="message-question" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
2
+ <g id="message-question-2" data-name="message-question">
3
+ <path id="Vector" d="M12.5,16.667H4.1A3.877,3.877,0,0,1,0,12.593V4.074A3.893,3.893,0,0,1,4.167,0H12.5a3.893,3.893,0,0,1,4.167,4.074v8.52A3.893,3.893,0,0,1,12.5,16.667Z" transform="translate(1.667 2.025)" fill="none" stroke="#292d32" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
4
+ <path id="Vector-2" data-name="Vector" d="M2.245,6.086V5.8A2.119,2.119,0,0,1,3.382,4,2.073,2.073,0,0,0,4.491,2.245,2.245,2.245,0,0,0,0,2.245" transform="translate(7.755 5.594)" fill="none" stroke="#292d32" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
5
+ <path id="Vector-3" data-name="Vector" d="M0,0H20V20H0Z" fill="none" opacity="0"/>
6
+ <path id="Vector-4" data-name="Vector" d="M.5.5H.508" transform="translate(9.499 14.414)" fill="none" stroke="#292d32" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,13 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="50.761" height="35" viewBox="0 0 50.761 35">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#573dab"/>
5
+ <stop offset="1" stop-color="#7251dd"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="Group_4351" data-name="Group 4351" transform="translate(-270.758 -251.98)">
9
+ <path id="Subtraction_9" data-name="Subtraction 9" d="M8.724,17.99H0l0,0,4.361-6,0,0L12.981.127,17.251,6l0,0,.09.124L8.724,17.99ZM21.7.124h0L21.614,0h.047l.088.063L21.7.124Z" transform="translate(283.16 268.99)" fill="url(#linear-gradient)"/>
10
+ <path id="Union_40" data-name="Union 40" d="M8.724,35H0l0,0,4.362-6v0l8.618-11.861.02.028,3.762-5.179,0,0L25.383.127l.043.058.026-.036L38.368,17.927l-.008.006L46.4,29l0,0,4.361,6,0,0H42.037L33.418,23.136l0,0-4.363-6v0h0l-.044-.061,0,0-.858-1.18.011,0-2.759-3.8L21.126,17.99h-.041l-3.908,5.374L8.724,35h0Zm8-34.847L16.619,0l0,0h.218l-.111.152h0ZM34.107.124,34.016,0h.047l.087.064-.044.061Z" transform="translate(270.758 251.98)" fill="url(#linear-gradient)"/>
11
+ <path id="Subtraction_10" data-name="Subtraction 10" d="M21.661,17.99H13.073L4.472,6.152l4.361-6L21.749,17.927l-.087.063ZM.109.152h0L0,0,0,0H.219L.109.152Z" transform="translate(287.377 268.989)" fill="url(#linear-gradient)"/>
12
+ </g>
13
+ </svg>
@@ -0,0 +1,19 @@
1
+ import commuteSmall from "./commutex_small.svg";
2
+ import enrollSmall from "./enroll_logo.svg";
3
+ import examsSmall from "./exams_small.svg";
4
+ import helpIcon from "./help-icon.svg";
5
+ import hostelSmall from "./hostel_small.svg";
6
+ import payxSmall from "./payx_small.svg";
7
+ import peopleSmall from "./people_small.svg";
8
+ import squareSmall from "./square_small.svg";
9
+
10
+ export {
11
+ commuteSmall,
12
+ enrollSmall,
13
+ examsSmall,
14
+ helpIcon,
15
+ hostelSmall,
16
+ payxSmall,
17
+ peopleSmall,
18
+ squareSmall,
19
+ };
@@ -0,0 +1,16 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24.634" height="35" viewBox="0 0 24.634 35">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.222" y1="1" x2="0.787" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#88b053"/>
5
+ <stop offset="1" stop-color="#50840b"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <g id="Group_4350" data-name="Group 4350" transform="translate(-1597.6 -781.549)">
9
+ <g id="Group_4461" data-name="Group 4461" transform="translate(1597.6 781.55)">
10
+ <g id="Group_4460" data-name="Group 4460" transform="translate(0 0)">
11
+ <path id="Subtraction_8" data-name="Subtraction 8" d="M8.75,17.991,21.775.063,21.688,0H13.1L4.389,11.988l0,0-4.361,6,0,0H8.75Z" transform="translate(2.859 17.009)" fill="url(#linear-gradient)"/>
12
+ <path id="Subtraction_8-2" data-name="Subtraction 8" d="M13.051,0,.026,17.927l.087.063H8.7L17.412,6l0,0,4.361-6,0,0H13.051Z" transform="translate(-0.026 0)" fill="url(#linear-gradient)"/>
13
+ </g>
14
+ </g>
15
+ </g>
16
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="46.624" height="35.002" viewBox="0 0 46.624 35.002">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#d0002b"/>
5
+ <stop offset="1" stop-color="#ea4a6b"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <path id="Union_1" data-name="Union 1" d="M-1718.525-7459l-5.5-7.575-1.032,1.42,4.429,6.071-.113.083h-20l0,0,4.479-6.165-1.023-1.408-5.5,7.574H-1754l0,0,5.6-7.715,0,0,11.076-15.242.085.116,6.578,9.018,6.616-9.017.065-.089,16.6,22.845-.111.083Zm-10.1-30.589a4.412,4.412,0,0,1,4.41-4.412,4.413,4.413,0,0,1,4.412,4.412,4.413,4.413,0,0,1-4.412,4.413A4.413,4.413,0,0,1-1728.62-7489.589Zm-13.114,0a4.412,4.412,0,0,1,4.412-4.412,4.412,4.412,0,0,1,4.41,4.412,4.412,4.412,0,0,1-4.41,4.413A4.413,4.413,0,0,1-1741.735-7489.589Z" transform="translate(1753.999 7494.002)" fill="url(#linear-gradient)"/>
9
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="35" height="35" viewBox="0 0 35 35">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#596e79"/>
5
+ <stop offset="1" stop-color="#7c909b"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <path id="Subtraction_7" data-name="Subtraction 7" d="M-5678.321,8264.99h-13.18v-13.234h6.563v6.672h6.617v6.563Zm21.82,0h-13.18v-6.562h6.617v-6.672h6.563v13.234Zm0-21.875h-6.562v-6.562h-6.617v-6.562h13.18v13.125Zm-28.437,0h-6.562V8229.99h13.18v6.563h-6.617v6.563Z" transform="translate(5691.501 -8229.99)" fill="url(#linear-gradient)"/>
9
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="35" height="35" viewBox="0 0 35 35">
2
+ <defs>
3
+ <linearGradient id="linear-gradient" x1="0.5" x2="0.5" y2="1" gradientUnits="objectBoundingBox">
4
+ <stop offset="0" stop-color="#596e79"/>
5
+ <stop offset="1" stop-color="#7c909b"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <path id="Subtraction_7" data-name="Subtraction 7" d="M-5678.321,8264.99h-13.18v-13.234h6.563v6.672h6.617v6.563Zm21.82,0h-13.18v-6.562h6.617v-6.672h6.563v13.234Zm0-21.875h-6.562v-6.562h-6.617v-6.562h13.18v13.125Zm-28.437,0h-6.562V8229.99h13.18v6.563h-6.617v6.563Z" transform="translate(5691.501 -8229.99)" fill="url(#linear-gradient)"/>
9
+ </svg>
@@ -0,0 +1,30 @@
1
+ import { KeyboardArrowDown } from "@mui/icons-material";
2
+ import { ButtonProps, CircularProgress } from "@mui/material";
3
+ import { StyledDropDownButton } from "./styles";
4
+
5
+ export default function DropDownButton({
6
+ button,
7
+ handleClick,
8
+ loading,
9
+ }: {
10
+ loading?: boolean;
11
+ button?: {
12
+ label?: string;
13
+ buttonProps?: ButtonProps;
14
+ };
15
+ handleClick: any;
16
+ }) {
17
+ return (
18
+ <StyledDropDownButton
19
+ onClick={handleClick}
20
+ variant="outlined"
21
+ disabled={loading}
22
+ endIcon={
23
+ loading ? <CircularProgress size="20px" /> : <KeyboardArrowDown />
24
+ }
25
+ {...button?.buttonProps}
26
+ >
27
+ {button?.label}
28
+ </StyledDropDownButton>
29
+ );
30
+ }
@@ -0,0 +1,31 @@
1
+ import { MoreVert } from "@mui/icons-material";
2
+ import { IconButtonProps } from "@mui/material";
3
+ import { ReactNode } from "react";
4
+ import { StyledIconButton } from "./styles";
5
+
6
+ const defaultIcon = {
7
+ icon: <MoreVert color="primary" />,
8
+ outlined: true,
9
+ };
10
+
11
+ export default function DropDownIcon({
12
+ icon = defaultIcon,
13
+ handleClick,
14
+ }: {
15
+ icon?: {
16
+ icon?: ReactNode;
17
+ iconProps?: IconButtonProps;
18
+ outlined?: boolean;
19
+ };
20
+ handleClick: any;
21
+ }) {
22
+ return (
23
+ <StyledIconButton
24
+ outlined={icon?.outlined ?? false}
25
+ onClick={handleClick}
26
+ {...icon.iconProps}
27
+ >
28
+ {icon.icon}
29
+ </StyledIconButton>
30
+ );
31
+ }
@@ -0,0 +1,139 @@
1
+ import MoreVertIcon from "@mui/icons-material/MoreVert";
2
+ import { IconButton } from "@mui/material";
3
+ import { Meta, StoryObj } from "@storybook/react";
4
+ import { HelpIcon } from "../../assets/images/icons";
5
+ import DropDownButton from "./DropDownButton";
6
+ import DropDownIcon from "./DropDownIcon";
7
+ import DropDownMenu, { DropDownMenuProps } from "./DropDownMenu";
8
+ import MenuItemButton from "./MenuItemButton";
9
+
10
+ // Define the default export with Meta type including the component type
11
+ const meta: Meta<typeof DropDownMenu> = {
12
+ title: "Navigation/DropDownMenu",
13
+ component: DropDownMenu,
14
+ tags: ["autodocs"],
15
+ argTypes: {
16
+ anchor: {
17
+ description:
18
+ "A function that returns a React node used as the dropdown anchor. It provides a method to open the dropdown.",
19
+ control: "object",
20
+ },
21
+ menuProps: {
22
+ description: 'Props to pass to the Menu component, except for "open".',
23
+ control: "object",
24
+ },
25
+ menuListProps: {
26
+ description: "Props to pass to the MenuList component.",
27
+ control: "object",
28
+ },
29
+ },
30
+ };
31
+
32
+ export default meta;
33
+ type Story = StoryObj<typeof DropDownMenu>;
34
+
35
+ // Primary story
36
+ export const Primary: Story = {
37
+ render: (args: DropDownMenuProps) => <DropDownMenu {...args} />,
38
+ args: {
39
+ anchor: ({ open }: { open: (e: any) => void }) => (
40
+ <DropDownButton
41
+ button={{
42
+ label: "Options",
43
+ buttonProps: { variant: "contained", color: "primary" },
44
+ }}
45
+ handleClick={open}
46
+ loading={false}
47
+ />
48
+ ),
49
+ menu: [
50
+ <MenuItemButton
51
+ icon={<HelpIcon />}
52
+ label={"Register"}
53
+ onClick={() => {
54
+ console.log("hi");
55
+ }}
56
+ />,
57
+
58
+ <MenuItemButton
59
+ label={"Active Devices"}
60
+ onClick={() => {
61
+ console.log("hi");
62
+ }}
63
+ />,
64
+ ],
65
+ },
66
+ };
67
+
68
+ // Story with Button Loading
69
+ export const WithButtonLoading: Story = {
70
+ render: (args: DropDownMenuProps) => <DropDownMenu {...args} />,
71
+ args: {
72
+ anchor: ({ open }: { open: (e: any) => void }) => (
73
+ <DropDownButton
74
+ button={{
75
+ label: "Options",
76
+ buttonProps: { variant: "contained", color: "primary" },
77
+ }}
78
+ handleClick={open}
79
+ loading={true}
80
+ />
81
+ ),
82
+ menu: [
83
+ <MenuItemButton
84
+ icon={<HelpIcon />}
85
+ label={"Register"}
86
+ onClick={() => {
87
+ window.open("/payment", "_blank");
88
+ }}
89
+ />,
90
+
91
+ <MenuItemButton
92
+ icon={<HelpIcon />}
93
+ label={"Register"}
94
+ onClick={() => {
95
+ console.log("hi");
96
+ }}
97
+ />,
98
+ ],
99
+ },
100
+ };
101
+
102
+ // Story with Default Icon
103
+ export const WithDefaultIcon: Story = {
104
+ render: (args: DropDownMenuProps) => <DropDownMenu {...args} />,
105
+ args: {
106
+ anchor: ({ open }: { open: (e: any) => void }) => (
107
+ <DropDownIcon handleClick={open} />
108
+ ),
109
+ menu: [
110
+ <MenuItemButton
111
+ label={"Student Payments"}
112
+ onClick={() => {
113
+ window.open("/payment", "_blank");
114
+ }}
115
+ />,
116
+ ],
117
+ },
118
+ };
119
+
120
+ // Story with Icon
121
+ export const WithIcon: Story = {
122
+ render: (args: DropDownMenuProps) => <DropDownMenu {...args} />,
123
+ args: {
124
+ anchor: ({ open }: { open: (e: any) => void }) => (
125
+ <DropDownIcon
126
+ handleClick={open}
127
+ icon={{
128
+ icon: (
129
+ <IconButton>
130
+ <MoreVertIcon />
131
+ </IconButton>
132
+ ),
133
+ iconProps: { color: "secondary" },
134
+ outlined: false,
135
+ }}
136
+ />
137
+ ),
138
+ },
139
+ };
@@ -0,0 +1,65 @@
1
+ import { Divider, Menu, MenuListProps, MenuProps } from "@mui/material";
2
+ import { ReactNode, useState } from "react";
3
+
4
+ export interface DropDownMenuProps {
5
+ anchor: (props: { open: (e: any) => void }) => ReactNode;
6
+ menu: ReactNode[];
7
+ menuProps?: Omit<MenuProps, "open">;
8
+ menuListProps?: MenuListProps;
9
+ }
10
+
11
+ const DropDownMenu = ({
12
+ menuProps,
13
+ menu = [],
14
+ menuListProps,
15
+ anchor,
16
+ }: DropDownMenuProps) => {
17
+ const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
18
+ const [open, setOpen] = useState(false);
19
+
20
+ const handleClick = (event: any) => {
21
+ setAnchorEl(event.currentTarget);
22
+ setOpen(true);
23
+ };
24
+
25
+ const handleClose = () => {
26
+ setAnchorEl(null);
27
+ setOpen(false);
28
+ };
29
+
30
+ return (
31
+ <>
32
+ {anchor({ open: handleClick })}
33
+
34
+ <Menu
35
+ elevation={0}
36
+ id="basic-menu"
37
+ anchorEl={anchorEl}
38
+ keepMounted
39
+ anchorOrigin={{
40
+ vertical: "bottom",
41
+ horizontal: "right",
42
+ }}
43
+ open={open}
44
+ onClose={handleClose}
45
+ transitionDuration={150}
46
+ transformOrigin={{
47
+ vertical: "top",
48
+ horizontal: "right",
49
+ }}
50
+ MenuListProps={{
51
+ ...menuListProps,
52
+ }}
53
+ {...menuProps}
54
+ >
55
+ {menu.map((item, index) => (
56
+ <>
57
+ {item}
58
+ <Divider flexItem sx={{ margin: "0 !important" }} />
59
+ </>
60
+ ))}
61
+ </Menu>
62
+ </>
63
+ );
64
+ };
65
+ export default DropDownMenu;
@@ -0,0 +1,29 @@
1
+ import { ListItemIcon, Typography } from "@mui/material";
2
+ import { ReactNode } from "react";
3
+ import { StyledMenuItem } from "./styles";
4
+
5
+ export type MenuItemButtonProps = {
6
+ icon?: ReactNode;
7
+ label: ReactNode;
8
+ onClick: () => void;
9
+ };
10
+
11
+ const MenuItemButton = ({
12
+ icon,
13
+ label,
14
+ onClick,
15
+ ...props
16
+ }: MenuItemButtonProps) => {
17
+ return (
18
+ <StyledMenuItem
19
+ sx={{ minWidth: "180px", width: "100%" }}
20
+ onClick={onClick}
21
+ {...props}
22
+ >
23
+ {icon && <ListItemIcon>{icon}</ListItemIcon>}
24
+ <Typography variant="subtitle3">{label}</Typography>
25
+ </StyledMenuItem>
26
+ );
27
+ };
28
+
29
+ export default MenuItemButton;