@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,30 @@
1
+ .storybook-button {
2
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
+ font-weight: 700;
4
+ border: 0;
5
+ border-radius: 3em;
6
+ cursor: pointer;
7
+ display: inline-block;
8
+ line-height: 1;
9
+ }
10
+ .storybook-button--primary {
11
+ color: white;
12
+ background-color: #1ea7fd;
13
+ }
14
+ .storybook-button--secondary {
15
+ color: #333;
16
+ background-color: transparent;
17
+ box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
18
+ }
19
+ .storybook-button--small {
20
+ font-size: 12px;
21
+ padding: 10px 16px;
22
+ }
23
+ .storybook-button--medium {
24
+ font-size: 14px;
25
+ padding: 11px 20px;
26
+ }
27
+ .storybook-button--large {
28
+ font-size: 16px;
29
+ padding: 12px 24px;
30
+ }
@@ -0,0 +1,32 @@
1
+ .storybook-header {
2
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
4
+ padding: 15px 20px;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: space-between;
8
+ }
9
+
10
+ .storybook-header svg {
11
+ display: inline-block;
12
+ vertical-align: top;
13
+ }
14
+
15
+ .storybook-header h1 {
16
+ font-weight: 700;
17
+ font-size: 20px;
18
+ line-height: 1;
19
+ margin: 6px 0 6px 10px;
20
+ display: inline-block;
21
+ vertical-align: top;
22
+ }
23
+
24
+ .storybook-header button + button {
25
+ margin-left: 10px;
26
+ }
27
+
28
+ .storybook-header .welcome {
29
+ color: #333;
30
+ font-size: 14px;
31
+ margin-right: 10px;
32
+ }
@@ -0,0 +1,69 @@
1
+ .storybook-page {
2
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
+ font-size: 14px;
4
+ line-height: 24px;
5
+ padding: 48px 20px;
6
+ margin: 0 auto;
7
+ max-width: 600px;
8
+ color: #333;
9
+ }
10
+
11
+ .storybook-page h2 {
12
+ font-weight: 700;
13
+ font-size: 32px;
14
+ line-height: 1;
15
+ margin: 0 0 4px;
16
+ display: inline-block;
17
+ vertical-align: top;
18
+ }
19
+
20
+ .storybook-page p {
21
+ margin: 1em 0;
22
+ }
23
+
24
+ .storybook-page a {
25
+ text-decoration: none;
26
+ color: #1ea7fd;
27
+ }
28
+
29
+ .storybook-page ul {
30
+ padding-left: 30px;
31
+ margin: 1em 0;
32
+ }
33
+
34
+ .storybook-page li {
35
+ margin-bottom: 8px;
36
+ }
37
+
38
+ .storybook-page .tip {
39
+ display: inline-block;
40
+ border-radius: 1em;
41
+ font-size: 11px;
42
+ line-height: 12px;
43
+ font-weight: 700;
44
+ background: #e7fdd8;
45
+ color: #66bf3c;
46
+ padding: 4px 12px;
47
+ margin-right: 10px;
48
+ vertical-align: top;
49
+ }
50
+
51
+ .storybook-page .tip-wrapper {
52
+ font-size: 13px;
53
+ line-height: 20px;
54
+ margin-top: 40px;
55
+ margin-bottom: 40px;
56
+ }
57
+
58
+ .storybook-page .tip-wrapper svg {
59
+ display: inline-block;
60
+ height: 12px;
61
+ width: 12px;
62
+ margin-right: 4px;
63
+ vertical-align: top;
64
+ margin-top: 3px;
65
+ }
66
+
67
+ .storybook-page .tip-wrapper svg path {
68
+ fill: #1ea7fd;
69
+ }
@@ -0,0 +1,18 @@
1
+ import { CssBaseline, ThemeProvider } from "@mui/material";
2
+ import { ReactNode } from "react";
3
+ import lightTheme from "./lightTheme";
4
+
5
+ export default function MuiThemeProvider({
6
+ children,
7
+ theme,
8
+ }: {
9
+ children: ReactNode;
10
+ theme?: any;
11
+ }) {
12
+ return (
13
+ <ThemeProvider theme={theme ?? lightTheme}>
14
+ <CssBaseline />
15
+ {children}
16
+ </ThemeProvider>
17
+ );
18
+ }
@@ -0,0 +1,71 @@
1
+ // src/stories/ColorPalette.stories.jsx
2
+ import React from "react";
3
+ import { LightColorTokens, DarkColorTokens } from "./colorTokens";
4
+
5
+ export default {
6
+ title: "Design System/Color Palette",
7
+ parameters: {
8
+ controls: { hideNoControlsWarning: true },
9
+ },
10
+ };
11
+
12
+ const ColorBox = ({ color, name }: { color: string; name: string }) => (
13
+ <div style={{ display: "flex", alignItems: "center", marginBottom: 20 }}>
14
+ <div
15
+ style={{
16
+ width: 60,
17
+ height: 60,
18
+ backgroundColor: color,
19
+ marginRight: 10,
20
+ border: "1px solid #ddd", // Slight border to distinguish white or light colors
21
+ borderRadius: 5,
22
+ }}
23
+ />
24
+ <div>
25
+ <div style={{ fontSize: 16, fontWeight: "bold" }}>{name}</div>
26
+ <div style={{ fontSize: 12 }}>{color}</div>
27
+ </div>
28
+ </div>
29
+ );
30
+
31
+ const PaletteDisplay = ({
32
+ themeName,
33
+ colorTokens,
34
+ }: {
35
+ themeName: string;
36
+ colorTokens: any;
37
+ }) => (
38
+ <div style={{ marginBottom: 40 }}>
39
+ <h3>{themeName} Theme</h3>
40
+ {Object.keys(colorTokens).map((group) => (
41
+ <div key={group}>
42
+ <h4>{group.toUpperCase()}</h4>
43
+ {Object.entries(colorTokens[group]).map(([name, color]) => (
44
+ <ColorBox
45
+ key={name}
46
+ name={`${group} ${name}`}
47
+ color={color as string}
48
+ />
49
+ ))}
50
+ </div>
51
+ ))}
52
+ </div>
53
+ );
54
+
55
+ export const ColorPalettes = () => (
56
+ <div
57
+ style={{
58
+ display: "grid",
59
+ gridTemplateColumns: "repeat(6, 1fr)",
60
+ gap: "20px",
61
+ padding: "20px",
62
+ }}
63
+ >
64
+ <div>
65
+ <PaletteDisplay themeName="Light" colorTokens={LightColorTokens} />
66
+ </div>
67
+ <div>
68
+ <PaletteDisplay themeName="Dark" colorTokens={DarkColorTokens} />
69
+ </div>
70
+ </div>
71
+ );
@@ -0,0 +1,77 @@
1
+ export const LightColorTokens = {
2
+ primary: {
3
+ main: "#323167",
4
+ light: "#5C5E8C",
5
+ dark: "#1F1E4A",
6
+ },
7
+ secondary: {
8
+ main: "#E0E0E7",
9
+ light: "#F0F0F5",
10
+ dark: "#CBCBD9",
11
+ },
12
+ background: {
13
+ default: "#F7F8FA",
14
+ paper: "#FFFFFF",
15
+ },
16
+ text: {
17
+ primary: "#121212",
18
+ secondary: "#595959",
19
+ },
20
+ success: {
21
+ main: "#88B053",
22
+ },
23
+ error: {
24
+ main: "F2353C",
25
+ },
26
+ warning: {
27
+ main: "ED9035",
28
+ },
29
+ info: {
30
+ main: "#4BAABE",
31
+ },
32
+ highlight: {
33
+ main: "#D4483E",
34
+ },
35
+ grey: {
36
+ main: "#F2F2F2",
37
+ },
38
+ };
39
+
40
+ export const DarkColorTokens = {
41
+ primary: {
42
+ main: "#9FA8DA",
43
+ light: "#C5CAE9",
44
+ dark: "#5C6BC0",
45
+ },
46
+ secondary: {
47
+ main: "#2F3151",
48
+ light: "#4B4D72",
49
+ dark: "#1C1D2F",
50
+ },
51
+ background: {
52
+ default: "#1D2127",
53
+ paper: "#161A1D",
54
+ },
55
+ text: {
56
+ primary: "#FFFFFF",
57
+ secondary: "#B9BBBB",
58
+ },
59
+ success: {
60
+ main: "#88B053",
61
+ },
62
+ error: {
63
+ main: "F2353C",
64
+ },
65
+ warning: {
66
+ main: "ED9035",
67
+ },
68
+ info: {
69
+ main: "#4BAABE",
70
+ },
71
+ highlight: {
72
+ main: "#D4483E",
73
+ },
74
+ grey: {
75
+ main: "#293640",
76
+ },
77
+ };