@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.
- package/.storybook/main.ts +29 -0
- package/.storybook/preview.tsx +28 -0
- package/.vscode/settings.json +3 -0
- package/README.md +100 -0
- package/bitbucket-pipelines.yml +60 -0
- package/exports.ts +1 -0
- package/package.json +74 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/src/App.css +38 -0
- package/src/App.test.tsx +9 -0
- package/src/App.tsx +12 -0
- package/src/assets/fonts/heebo/Heebo-Medium.ttf +0 -0
- package/src/assets/fonts/heebo/Heebo-SemiBold.ttf +0 -0
- package/src/assets/fonts/heebo/index.ts +3 -0
- package/src/assets/fonts/poppins/Poppins-Bold.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-Light.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-Medium.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-Regular.ttf +0 -0
- package/src/assets/fonts/poppins/Poppins-SemiBold.ttf +0 -0
- package/src/assets/fonts/poppins/index.ts +14 -0
- package/src/assets/images/admin.png +0 -0
- package/src/assets/images/campx_logo__full_primary.png +0 -0
- package/src/assets/images/collegex.png +0 -0
- package/src/assets/images/commutex.png +0 -0
- package/src/assets/images/enrollx.png +0 -0
- package/src/assets/images/examx.png +0 -0
- package/src/assets/images/hostelx copy.png +0 -0
- package/src/assets/images/hostelx.png +0 -0
- package/src/assets/images/icons.tsx +193 -0
- package/src/assets/images/index.ts +25 -0
- package/src/assets/images/payx.png +0 -0
- package/src/assets/images/pepolex.png +0 -0
- package/src/assets/images/svg/commutex_small.svg +11 -0
- package/src/assets/images/svg/enroll_logo.svg +9 -0
- package/src/assets/images/svg/exams_small.svg +12 -0
- package/src/assets/images/svg/help-icon.svg +8 -0
- package/src/assets/images/svg/hostel_small.svg +13 -0
- package/src/assets/images/svg/index.ts +19 -0
- package/src/assets/images/svg/payx_small.svg +16 -0
- package/src/assets/images/svg/people_small.svg +9 -0
- package/src/assets/images/svg/squareSmall.svg +9 -0
- package/src/assets/images/svg/square_small.svg +9 -0
- package/src/components/DropDownMenu/DropDownButton.tsx +30 -0
- package/src/components/DropDownMenu/DropDownIcon.tsx +31 -0
- package/src/components/DropDownMenu/DropDownMenu.stories.tsx +139 -0
- package/src/components/DropDownMenu/DropDownMenu.tsx +65 -0
- package/src/components/DropDownMenu/MenuItemButton.tsx +29 -0
- package/src/components/DropDownMenu/styles.tsx +31 -0
- package/src/components/Input/Button/Button.stories.tsx +62 -0
- package/src/components/Input/Button/Button.tsx +11 -0
- package/src/components/Input/Label/Label.tsx +11 -0
- package/src/components/Input/SingleSelect/SingleSelect.stories.tsx +55 -0
- package/src/components/Input/SingleSelect/SingleSelect.tsx +4 -0
- package/src/components/Input/Switch/Switch.stories.tsx +62 -0
- package/src/components/Input/Switch/Switch.tsx +11 -0
- package/src/components/Input/TextField/TextField.stories.tsx +135 -0
- package/src/components/Input/TextField/TextField.tsx +35 -0
- package/src/components/Layout/ComponentBackground/ComponentBackground.tsx +82 -0
- package/src/components/Layout/ComponentBackground/DefaultBackground.tsx +12 -0
- package/src/components/Layout/ComponentBackground/PaperBackground.tsx +12 -0
- package/src/components/Layout/Header/AppHeader.stories.tsx +209 -0
- package/src/components/Layout/Header/AppHeader.tsx +70 -0
- package/src/components/Layout/Header/AppLogo.tsx +53 -0
- package/src/components/Layout/Header/AppsMenu.tsx +162 -0
- package/src/components/Layout/Header/HeaderActions/CogWheelMenu.tsx +30 -0
- package/src/components/Layout/Header/HeaderActions/HeaderActions.tsx +63 -0
- package/src/components/Layout/Header/HeaderActions/UserBox.tsx +117 -0
- package/src/components/Layout/Header/styles/styles.tsx +69 -0
- package/src/components/Typography/Typography.stories.tsx +95 -0
- package/src/components/Typography/Typography.tsx +12 -0
- package/src/components/index.ts +1 -0
- package/src/contexts/Providers.tsx +6 -0
- package/src/index.css +13 -0
- package/src/index.tsx +19 -0
- package/src/logo.svg +1 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/reportWebVitals.ts +15 -0
- package/src/setupTests.ts +5 -0
- package/src/stories/Button.stories.ts +52 -0
- package/src/stories/Button.tsx +48 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/Header.stories.ts +33 -0
- package/src/stories/Header.tsx +56 -0
- package/src/stories/Page.stories.ts +32 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +5 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +15 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +3 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +12 -0
- package/src/stories/assets/youtube.svg +4 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +69 -0
- package/src/themes/MuiThemeProvider.tsx +18 -0
- package/src/themes/colorTokens.stories.tsx +71 -0
- package/src/themes/colorTokens.ts +77 -0
- package/src/themes/commonTheme.ts +443 -0
- package/src/themes/customCssBaseline.ts +39 -0
- package/src/themes/darkTheme.ts +24 -0
- package/src/themes/index.ts +4 -0
- package/src/themes/lightTheme.ts +22 -0
- package/src/themes/typography.stories.tsx +79 -0
- package/src/utils/applications.ts +140 -0
- package/src/utils/constants.ts +6 -0
- package/src/utils/imageMap.ts +22 -0
- 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
|
+
};
|