@campxdev/react-blueprint 0.1.28 → 0.1.29
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 +0 -1
- package/.storybook/preview.tsx +10 -5
- package/.vscode/settings.json +3 -0
- package/package.json +1 -1
- package/src/App.tsx +5 -5
- package/src/components/Assets/Icons/IconComponents/AdministratorIcon.tsx +26 -0
- package/src/components/Assets/Icons/IconComponents/CampxIcon.tsx +25 -0
- package/src/components/{Icons/export.ts → Assets/Icons/Icons.tsx} +4 -0
- package/src/components/Assets/export.ts +1 -0
- package/src/components/DataDisplay/DataTable/TablePagination.tsx +3 -1
- package/src/components/DataDisplay/export.ts +2 -1
- package/src/components/Feedback/Tooltip/Tooltip.tsx +4 -6
- package/src/components/Input/LabelWrapper/LabelWrapper.tsx +1 -1
- package/src/components/Input/SingleCheckBox/SIngleCheckBox.tsx +1 -1
- package/src/components/Input/SingleSelect/SingleSelect.tsx +0 -1
- package/src/components/Layout/AppHeader/AppHeader.tsx +55 -0
- package/src/components/Layout/{Header/HeaderActions → AppHeader/AppHeaderActions}/HeaderActions.tsx +15 -16
- package/src/components/Layout/{Header/HeaderActions → AppHeader/AppHeaderActions}/UserBox.tsx +7 -8
- package/src/components/Layout/AppHeader/styles/styles.tsx +37 -0
- package/src/components/Navigation/exports.ts +15 -0
- package/src/components/export.ts +5 -8
- package/src/{components/Icons → stories/Assets}/Icons.stories.tsx +11 -1
- package/src/{components/DataDisplay/Avatar → stories/DataDisplay}/CircularAvatar.stories.tsx +4 -1
- package/src/{components/DataDisplay/DataTable → stories/DataDisplay}/DataTable.stories.tsx +2 -1
- package/src/{components/DataDisplay/SidePanel → stories/DataDisplay}/SidePanel.stories.tsx +4 -1
- package/src/{components/DataDisplay/Avatar → stories/DataDisplay}/SquareAvatar.stories.tsx +4 -1
- package/src/{themes → stories/DesignSystem}/colorTokens.stories.tsx +7 -11
- package/src/{themes → stories/DesignSystem}/typography.stories.tsx +2 -1
- package/src/{components/Feedback/Spinner → stories/Feedback}/Spinner.stories.tsx +1 -2
- package/src/{components/Feedback/Tooltip → stories/Feedback}/Tooltip.stories.tsx +8 -4
- package/src/{components/Input/Button → stories/Input}/Button.stories.tsx +1 -2
- package/src/{components/Input/Chips → stories/Input}/Chips.stories.tsx +1 -1
- package/src/{components/Input/MultiCheckBox → stories/Input}/MultiCheckBox.stories.tsx +4 -1
- package/src/{components/Input/OtpInput → stories/Input}/OtpInput.stories.tsx +3 -2
- package/src/{components/Input/RadioGroup → stories/Input}/RadioGroup.stories.tsx +4 -1
- package/src/{components/Input/SearchBar → stories/Input}/SearchBar.stories.tsx +1 -1
- package/src/{components/Input/SingleCheckBox → stories/Input}/SingleCheckBox.stories.tsx +4 -2
- package/src/{components/Input/SingleSelect → stories/Input}/SingleSelect.stories.tsx +4 -1
- package/src/{components/Input/Switch → stories/Input}/Switch.stories.tsx +1 -2
- package/src/{components/Input/TextField → stories/Input}/TextField.stories.tsx +20 -6
- package/src/stories/Layout/AppHeader.stories.tsx +68 -0
- package/src/{components/Layout/LayoutWrapper → stories/Layout}/LayoutWrapper.stories.tsx +8 -5
- package/src/{components/Layout/PageContent → stories/Layout}/PageContent.stories.tsx +1 -1
- package/src/{components/Layout/SideNavigation → stories/Layout}/SideNavigation.stories.tsx +2 -2
- package/src/{components/Navigation/DialogButton → stories/Navigation}/DialogButton.stories.tsx +3 -1
- package/src/{components/Navigation/DropDownMenu → stories/Navigation}/DropDownMenu.stories.tsx +8 -5
- package/src/{components/Navigation/TabsContainer → stories/Navigation}/TabsContainer.stories.tsx +5 -2
- package/src/themes/colorTokens/colorPalette.tsx +48 -0
- package/src/themes/colorTokens/darkColorTokens.tsx +42 -0
- package/src/themes/colorTokens/lightColorTokens.ts +42 -0
- package/src/themes/commonTheme.ts +15 -18
- package/src/themes/darkTheme.ts +4 -12
- package/src/themes/lightTheme.ts +2 -11
- package/types/theme.d.ts +22 -12
- package/src/components/Icons/Icons.tsx +0 -14
- package/src/components/Layout/Header/AppHeader.stories.tsx +0 -210
- package/src/components/Layout/Header/AppHeader.tsx +0 -81
- package/src/components/Layout/Header/AppLogo.tsx +0 -51
- package/src/components/Layout/Header/styles/styles.tsx +0 -69
- package/src/themes/colorTokens.ts +0 -77
- /package/src/components/{Icons → Assets/Icons}/IconComponents/ActiveDevicesIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/AppsIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/BulbIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/CareerIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/CheckedCheckBoxIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/CheckedRadioIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/ClogWheelIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/CrossIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/DashBoardIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/DeviceIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/ExamResultIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/ExportIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/FilterIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/HelpIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/HomeIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/InfoIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/InstitutionsIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/LeftIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/LocationIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/LogoutIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/NavigationIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/NotificationIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/ProductFeaturesIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/ProfileIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/RightIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/TicketsIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/UncheckCheckBoxIcon.tsx +0 -0
- /package/src/components/{Icons → Assets/Icons}/IconComponents/UncheckedRadioIcon.tsx +0 -0
- /package/src/components/Layout/{Header/HeaderActions → AppHeader/AppHeaderActions}/CogWheelMenu.tsx +0 -0
- /package/src/components/Layout/{Header → AppHeader}/AppsMenu.tsx +0 -0
package/.storybook/main.ts
CHANGED
package/.storybook/preview.tsx
CHANGED
|
@@ -4,7 +4,9 @@ import React from "react";
|
|
|
4
4
|
import { BrowserRouter } from "react-router-dom";
|
|
5
5
|
import { useDarkMode } from "storybook-dark-mode";
|
|
6
6
|
import { MuiThemeProvider } from "../src/themes/MuiThemeProvider";
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { DarkColorTokens } from "../src/themes/colorTokens/darkColorTokens";
|
|
9
|
+
import { LightColorTokens } from "../src/themes/colorTokens/lightColorTokens";
|
|
8
10
|
import { darkTheme } from "../src/themes/darkTheme";
|
|
9
11
|
import { lightTheme } from "../src/themes/lightTheme";
|
|
10
12
|
|
|
@@ -19,10 +21,13 @@ const preview: Preview = {
|
|
|
19
21
|
backgrounds: {
|
|
20
22
|
default: "light", // name of the default background to use
|
|
21
23
|
values: [
|
|
22
|
-
{ name: "light", value: LightColorTokens.
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
{ name: "light", value: LightColorTokens.surface.defaultBackground },
|
|
25
|
+
{
|
|
26
|
+
name: "light paper",
|
|
27
|
+
value: LightColorTokens.surface.paperBackground,
|
|
28
|
+
},
|
|
29
|
+
{ name: "dark", value: DarkColorTokens.surface.defaultBackground },
|
|
30
|
+
{ name: "dark paper", value: DarkColorTokens.surface.paperBackground },
|
|
26
31
|
],
|
|
27
32
|
},
|
|
28
33
|
},
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -5,12 +5,12 @@ import Providers from "./contexts/Providers";
|
|
|
5
5
|
function App() {
|
|
6
6
|
return (
|
|
7
7
|
<Providers>
|
|
8
|
-
{/* <AppHeader clientLogo={""} fullName={""} userBoxActions={[]} /> */}
|
|
9
8
|
<AppHeader
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
clientName="Anurag University"
|
|
10
|
+
actions={[<p>asdjflsf</p>]}
|
|
11
|
+
appsMenu={<AppsMenu apps={["exams", "square", "admin"]} />}
|
|
12
|
+
userFullName="Srikanth Yellapragada"
|
|
13
|
+
/>
|
|
14
14
|
</Providers>
|
|
15
15
|
);
|
|
16
16
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const AdministratorIcon = () => {
|
|
4
|
+
const theme = useTheme();
|
|
5
|
+
const color = theme.palette.text.primary;
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<svg
|
|
9
|
+
width="30"
|
|
10
|
+
height="30"
|
|
11
|
+
viewBox="0 0 30 30"
|
|
12
|
+
style={{ fill: color }}
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d="M15.0008 28.2871C14.1809 28.3018 13.3712 28.1037 12.6508 27.7121L5.77578 23.7501C2.97578 21.8621 2.80078 21.5751 2.80078 18.6121V11.3871C2.80078 8.42409 2.96378 8.13709 5.71378 6.27509L12.6388 2.27509C13.363 1.89929 14.1669 1.70313 14.9828 1.70312C15.7987 1.70312 16.6026 1.89929 17.3268 2.27509L24.2268 6.25009C27.0268 8.13809 27.2018 8.42509 27.2018 11.3871V18.6031C27.2018 21.5651 27.0398 21.8531 24.2888 23.7161L17.3638 27.7161C16.6378 28.105 15.8243 28.3016 15.0008 28.2871ZM15.0008 3.58709C14.5152 3.57053 14.0334 3.6779 13.6008 3.89909L6.72578 7.87509C4.68878 9.25009 4.68778 9.25009 4.68778 11.3871V18.6031C4.68778 20.7411 4.68778 20.7411 6.77478 22.1531L13.6008 26.0871C14.0399 26.297 14.5205 26.406 15.0073 26.406C15.494 26.406 15.9746 26.297 16.4138 26.0871L23.2888 22.1121C25.3138 20.7371 25.3138 20.7371 25.3138 18.5991V11.3871C25.3138 9.24909 25.3138 9.25009 23.2268 7.83709L16.4008 3.90309C15.9685 3.68052 15.4867 3.57176 15.0008 3.58709Z"
|
|
17
|
+
fill="#121212"
|
|
18
|
+
/>
|
|
19
|
+
<path
|
|
20
|
+
d="M15.0015 19.6875C14.0742 19.6877 13.1677 19.4129 12.3966 18.8979C11.6255 18.3828 11.0245 17.6507 10.6695 16.794C10.3146 15.9373 10.2217 14.9947 10.4025 14.0852C10.5834 13.1757 11.0299 12.3403 11.6856 11.6846C12.3413 11.0289 13.1767 10.5824 14.0862 10.4016C14.9956 10.2207 15.9383 10.3136 16.795 10.6686C17.6516 11.0235 18.3838 11.6245 18.8988 12.3956C19.4139 13.1667 19.6887 14.0732 19.6885 15.0005C19.688 16.2434 19.194 17.4353 18.3151 18.3141C17.4363 19.193 16.2444 19.687 15.0015 19.6875ZM15.0015 12.1875C14.4451 12.1873 13.9011 12.3521 13.4384 12.6611C12.9757 12.9701 12.615 13.4094 12.4019 13.9233C12.1889 14.4373 12.133 15.003 12.2414 15.5487C12.3499 16.0944 12.6177 16.5958 13.0111 16.9893C13.4044 17.3828 13.9056 17.6508 14.4513 17.7594C14.997 17.868 15.5627 17.8124 16.0768 17.5995C16.5908 17.3866 17.0302 17.0261 17.3394 16.5634C17.6485 16.1008 17.8135 15.5569 17.8135 15.0005C17.8124 14.255 17.5159 13.5402 16.9888 13.013C16.4617 12.4857 15.7471 12.1888 15.0015 12.1875Z"
|
|
21
|
+
fill="#121212"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const CampxIcon = () => {
|
|
4
|
+
const theme = useTheme();
|
|
5
|
+
|
|
6
|
+
const color = theme.palette.mode === "dark" ? "white" : "blue";
|
|
7
|
+
console.log(color);
|
|
8
|
+
return (
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="32"
|
|
12
|
+
height="32"
|
|
13
|
+
viewBox="0 5 101.234 104.906"
|
|
14
|
+
style={{
|
|
15
|
+
fill: color,
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
<path
|
|
19
|
+
id="Subtraction_130"
|
|
20
|
+
data-name="Subtraction 130"
|
|
21
|
+
d="M100.772,104.906H76.085L61.518,84.856l12.7-17.476,27.02,37.19-.463.336Zm-75.622,0H.463L0,104.57,37.92,52.377,0,.185.254,0H25.26L50.617,34.9l.005-.007,12.7,17.475-.005.007.018.024-12.7,17.476-.017-.024L25.15,104.906ZM74.112,37.516h0L61.415,20.04,75.975,0H100.98l.254.185L74.112,37.516Z"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -14,6 +14,7 @@ import { HomeIcon } from "./IconComponents/HomeIcon";
|
|
|
14
14
|
import { InfoIcon } from "./IconComponents/InfoIcon";
|
|
15
15
|
|
|
16
16
|
import { BulbIcon } from "./IconComponents/BulbIcon";
|
|
17
|
+
import { CampxIcon } from "./IconComponents/CampxIcon";
|
|
17
18
|
import { CrossIcon } from "./IconComponents/CrossIcon";
|
|
18
19
|
import { InstitutionsIcon } from "./IconComponents/InstitutionsIcon";
|
|
19
20
|
import { LeftIcon } from "./IconComponents/LeftIcon";
|
|
@@ -27,6 +28,7 @@ import { RightIcon } from "./IconComponents/RightIcon";
|
|
|
27
28
|
import { TicketsIcon } from "./IconComponents/TicketsIcon";
|
|
28
29
|
import { UnCheckedCheckboxIcon } from "./IconComponents/UncheckCheckBoxIcon";
|
|
29
30
|
import { UnCheckedRadioIcon } from "./IconComponents/UncheckedRadioIcon";
|
|
31
|
+
import { AdministratorIcon } from "./IconComponents/AdministratorIcon";
|
|
30
32
|
export const Icons = {
|
|
31
33
|
AppsIcon,
|
|
32
34
|
CareerIcon,
|
|
@@ -56,4 +58,6 @@ export const Icons = {
|
|
|
56
58
|
DeviceIcon,
|
|
57
59
|
CrossIcon,
|
|
58
60
|
ProductFeaturesIcon,
|
|
61
|
+
CampxIcon,
|
|
62
|
+
AdministratorIcon,
|
|
59
63
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Icons/Icons";
|
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
Stack,
|
|
5
5
|
} from "@mui/material";
|
|
6
6
|
import { DropdownMenuItem } from "../../Navigation/DropDownMenu/DropdownMenuItem";
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { DropDownButton } from "../../Navigation/DropDownMenu/DropDownButton";
|
|
9
|
+
import { DropdownMenu } from "../../Navigation/DropDownMenu/DropDownMenu";
|
|
8
10
|
import { Typography } from "../Typography/Typography";
|
|
9
11
|
|
|
10
12
|
export type PaginationProps = {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "./Avatar/Avatar";
|
|
2
|
+
export * from "./DataTable/DataTable";
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
IconButton,
|
|
3
3
|
Tooltip as MuiTooltip,
|
|
4
4
|
TooltipProps as MuiTooltipProps,
|
|
5
|
-
|
|
6
|
-
Button,
|
|
5
|
+
Stack,
|
|
7
6
|
} from "@mui/material";
|
|
8
|
-
import {
|
|
7
|
+
import { Children, ReactElement } from "react";
|
|
8
|
+
import { BulbIcon } from "../../Assets/Icons/IconComponents/BulbIcon";
|
|
9
9
|
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
10
|
-
import { InfoIcon } from "../../Icons/IconComponents/InfoIcon";
|
|
11
|
-
import { Children, ReactElement, useState } from "react";
|
|
12
10
|
|
|
13
11
|
export type TooltipProps = {
|
|
14
12
|
children: ReactElement | string;
|
|
@@ -21,7 +21,7 @@ export const LabelWrapper = ({
|
|
|
21
21
|
<Typography htmlFor={name} component="label" variant="label1">
|
|
22
22
|
{label}
|
|
23
23
|
{required && (
|
|
24
|
-
<span style={{ color: `${theme.palette.
|
|
24
|
+
<span style={{ color: `${theme.palette.tertiary.main}` }}>
|
|
25
25
|
{" *"}
|
|
26
26
|
</span>
|
|
27
27
|
)}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Box, Divider, IconButton, Stack } from "@mui/material";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { StyledHeader } from "./styles/styles";
|
|
4
|
+
import { CampxIcon } from "../../Assets/Icons/IconComponents/CampxIcon";
|
|
5
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
6
|
+
import UserBox from "./AppHeaderActions/UserBox";
|
|
7
|
+
import { HelpIcon } from "../../Assets/Icons/IconComponents/HelpIcon";
|
|
8
|
+
import { AdministratorIcon } from "../../Assets/Icons/IconComponents/AdministratorIcon";
|
|
9
|
+
import { TicketsIcon } from "../../Assets/Icons/IconComponents/TicketsIcon";
|
|
10
|
+
import { StyledIconButton } from "../../Navigation/DropDownMenu/styles";
|
|
11
|
+
|
|
12
|
+
export interface AppHeaderProps {
|
|
13
|
+
actions?: ReactNode[];
|
|
14
|
+
appsMenu?: ReactNode;
|
|
15
|
+
clientLogoUrl?: string;
|
|
16
|
+
clientName: string;
|
|
17
|
+
userFullName: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const AppHeader = ({
|
|
21
|
+
actions = [],
|
|
22
|
+
appsMenu,
|
|
23
|
+
clientLogoUrl,
|
|
24
|
+
clientName,
|
|
25
|
+
userFullName,
|
|
26
|
+
}: AppHeaderProps) => {
|
|
27
|
+
return (
|
|
28
|
+
<StyledHeader>
|
|
29
|
+
<Stack
|
|
30
|
+
flexDirection={"row"}
|
|
31
|
+
alignItems={"center"}
|
|
32
|
+
gap={"20px"}
|
|
33
|
+
divider={<Divider orientation="vertical" flexItem />}
|
|
34
|
+
>
|
|
35
|
+
{appsMenu && (
|
|
36
|
+
<Stack alignItems={"center"} gap={"12px"} flexDirection={"row"}>
|
|
37
|
+
{appsMenu}
|
|
38
|
+
</Stack>
|
|
39
|
+
)}
|
|
40
|
+
<CampxIcon />
|
|
41
|
+
<Typography variant={"subtitle2"}>{clientName}</Typography>
|
|
42
|
+
</Stack>
|
|
43
|
+
<Stack alignItems={"center"} gap={"12px"} flexDirection={"row"}>
|
|
44
|
+
<StyledIconButton
|
|
45
|
+
onClick={() => {
|
|
46
|
+
alert("help button clicked");
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<HelpIcon />
|
|
50
|
+
</StyledIconButton>
|
|
51
|
+
<UserBox fullName={userFullName} actions={[]} />
|
|
52
|
+
</Stack>
|
|
53
|
+
</StyledHeader>
|
|
54
|
+
);
|
|
55
|
+
};
|
package/src/components/Layout/{Header/HeaderActions → AppHeader/AppHeaderActions}/HeaderActions.tsx
RENAMED
|
@@ -18,7 +18,7 @@ export interface HeaderActionsProps {
|
|
|
18
18
|
actions?: ReactNode[];
|
|
19
19
|
profileSx?: any;
|
|
20
20
|
avatar?: any;
|
|
21
|
-
navigationIcon:any;
|
|
21
|
+
navigationIcon: any;
|
|
22
22
|
showActiveDevices: any;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -30,9 +30,9 @@ const HeaderActions = ({
|
|
|
30
30
|
profileUrl = "",
|
|
31
31
|
actions = [],
|
|
32
32
|
profileSx = {},
|
|
33
|
-
avatar={},
|
|
34
|
-
navigationIcon={},
|
|
35
|
-
showActiveDevices={},
|
|
33
|
+
avatar = {},
|
|
34
|
+
navigationIcon = {},
|
|
35
|
+
showActiveDevices = {},
|
|
36
36
|
}: HeaderActionsProps) => {
|
|
37
37
|
return (
|
|
38
38
|
<Stack direction="row" gap={1} alignItems="center">
|
|
@@ -54,18 +54,17 @@ const HeaderActions = ({
|
|
|
54
54
|
|
|
55
55
|
{/* Render UserBox */}
|
|
56
56
|
{fullName && (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)}
|
|
68
|
-
|
|
57
|
+
<UserBox
|
|
58
|
+
fullName={fullName}
|
|
59
|
+
designation={designation}
|
|
60
|
+
actions={userBoxActions}
|
|
61
|
+
profileUrl={profileUrl}
|
|
62
|
+
profileSx={profileSx}
|
|
63
|
+
avatar={avatar}
|
|
64
|
+
navigationIcon={navigationIcon}
|
|
65
|
+
showActiveDevices={showActiveDevices}
|
|
66
|
+
/>
|
|
67
|
+
)}
|
|
69
68
|
</Stack>
|
|
70
69
|
);
|
|
71
70
|
};
|
package/src/components/Layout/{Header/HeaderActions → AppHeader/AppHeaderActions}/UserBox.tsx
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Stack, Typography, useTheme } from "@mui/material";
|
|
1
|
+
import { Avatar, Stack, Typography, useTheme } from "@mui/material";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { DropdownMenu } from "../../../Navigation/DropDownMenu/DropDownMenu";
|
|
4
4
|
import { DropdownMenuItem } from "../../../Navigation/DropDownMenu/DropdownMenuItem";
|
|
5
5
|
import { Icons } from "../../../export";
|
|
6
|
-
import { StyledAvatar, StyledTypography } from "../styles/styles";
|
|
7
6
|
|
|
8
7
|
const getStartingLetters = (text: string) => {
|
|
9
8
|
if (!text) return "";
|
|
@@ -42,9 +41,9 @@ export default function UserBox({
|
|
|
42
41
|
return (
|
|
43
42
|
<DropdownMenu
|
|
44
43
|
anchor={({ open }) => (
|
|
45
|
-
<
|
|
44
|
+
<Avatar src={profileUrl ?? ""} onClick={open} sx={profileSx}>
|
|
46
45
|
{getStartingLetters(fullName)}
|
|
47
|
-
</
|
|
46
|
+
</Avatar>
|
|
48
47
|
)}
|
|
49
48
|
menuListProps={{
|
|
50
49
|
sx: {
|
|
@@ -56,7 +55,7 @@ export default function UserBox({
|
|
|
56
55
|
<DropdownMenuItem
|
|
57
56
|
label={
|
|
58
57
|
<Stack gap={0.5} sx={{ width: "100%" }}>
|
|
59
|
-
<
|
|
58
|
+
<Typography variant="subtitle3">Account</Typography>
|
|
60
59
|
<Stack
|
|
61
60
|
direction={"row"}
|
|
62
61
|
alignItems={"center"}
|
|
@@ -64,9 +63,9 @@ export default function UserBox({
|
|
|
64
63
|
>
|
|
65
64
|
{avatar && (
|
|
66
65
|
<Stack direction={"row"} gap={1}>
|
|
67
|
-
<
|
|
66
|
+
<Avatar src={profileUrl ?? ""} sx={profileSx}>
|
|
68
67
|
{getStartingLetters(fullName)}
|
|
69
|
-
</
|
|
68
|
+
</Avatar>
|
|
70
69
|
<Stack direction={"row"} justifyContent={"space-between"}>
|
|
71
70
|
<Stack>
|
|
72
71
|
<Typography variant="subtitle3">{fullName}</Typography>
|
|
@@ -100,7 +99,7 @@ export default function UserBox({
|
|
|
100
99
|
width={"100%"}
|
|
101
100
|
>
|
|
102
101
|
<Typography variant="subtitle3">Logout</Typography>
|
|
103
|
-
<Icons.LogoutIcon hoverColor={theme.palette.
|
|
102
|
+
<Icons.LogoutIcon hoverColor={theme.palette.tertiary.main} />
|
|
104
103
|
</Stack>
|
|
105
104
|
}
|
|
106
105
|
onClick={() => alert("Action 1 clicked")}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Box, styled } from "@mui/material";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
|
|
4
|
+
export const StyledHeader = styled("header")(({ theme }) => ({
|
|
5
|
+
display: "flex",
|
|
6
|
+
flexDirection: "row",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
width: "100%",
|
|
9
|
+
position: "fixed",
|
|
10
|
+
top: 0,
|
|
11
|
+
height: "60px",
|
|
12
|
+
backgroundColor: theme.palette.background.paper,
|
|
13
|
+
justifyContent: "space-between",
|
|
14
|
+
padding: "0 32px",
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
export const StyledActionBox = styled(Box)(({ theme }) => ({
|
|
18
|
+
marginRight: "20px",
|
|
19
|
+
display: "flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
gap: "14px",
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
export const StyledRouterLink = styled(Link)(() => ({
|
|
25
|
+
textDecoration: "none",
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
export const StyledImageWrapper = styled(Box)(() => ({
|
|
29
|
+
width: "auto",
|
|
30
|
+
height: "22px",
|
|
31
|
+
display: "flex",
|
|
32
|
+
img: {
|
|
33
|
+
width: "100%",
|
|
34
|
+
height: "25px",
|
|
35
|
+
objectFit: "contain",
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CustomDialog } from "./DialogButton/DialogButton";
|
|
2
|
+
import { DropDownButton } from "./DropDownMenu/DropDownButton";
|
|
3
|
+
import { DropdownMenu } from "./DropDownMenu/DropDownMenu";
|
|
4
|
+
import { DropDownIcon } from "./DropDownMenu/DropDownIcon";
|
|
5
|
+
import { DropdownMenuItem } from "./DropDownMenu/DropdownMenuItem";
|
|
6
|
+
import { TabsContainer } from "./TabsContainer/TabsContainer";
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
CustomDialog,
|
|
10
|
+
DropDownButton,
|
|
11
|
+
DropdownMenu,
|
|
12
|
+
DropDownIcon,
|
|
13
|
+
DropdownMenuItem,
|
|
14
|
+
TabsContainer,
|
|
15
|
+
};
|
package/src/components/export.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
+
export * from "./Assets/export";
|
|
1
2
|
export * from "./DataDisplay/export";
|
|
2
|
-
export * from "./Icons/export";
|
|
3
3
|
export * from "./Input/export";
|
|
4
|
-
export * from "./Layout/
|
|
5
|
-
|
|
6
|
-
export * from "./Layout/
|
|
4
|
+
export * from "./Layout/AppHeader/AppHeader";
|
|
5
|
+
|
|
6
|
+
export * from "./Layout/AppHeader/AppsMenu";
|
|
7
7
|
export * from "./Layout/LayoutWrapper/LayoutWrapper";
|
|
8
8
|
export * from "./Layout/PageContent/PageContent";
|
|
9
9
|
export * from "./Layout/SideNavigation/SideNavigation";
|
|
10
|
-
export * from "./Navigation/
|
|
11
|
-
export * from "./Navigation/DropDownMenu/DropDownIcon";
|
|
12
|
-
export * from "./Navigation/DropDownMenu/DropDownMenu";
|
|
13
|
-
export * from "./Navigation/DropDownMenu/DropdownMenuItem";
|
|
10
|
+
export * from "./Navigation/exports";
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
|
+
import { Stack } from "@mui/material";
|
|
2
3
|
import { Meta, StoryObj } from "@storybook/react/*";
|
|
4
|
+
import { Icons } from "../../components/Assets/Icons/Icons";
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
const IconsStory = () => {
|
|
7
|
+
return (
|
|
8
|
+
<Stack gap={2} direction={"row"}>
|
|
9
|
+
{Object.values(Icons).map((Icon) => (
|
|
10
|
+
<Icon />
|
|
11
|
+
))}
|
|
12
|
+
</Stack>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
5
15
|
|
|
6
16
|
export default {
|
|
7
17
|
title: "Assets/Icons",
|
package/src/{components/DataDisplay/Avatar → stories/DataDisplay}/CircularAvatar.stories.tsx
RENAMED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
2
|
|
|
3
3
|
import { Meta } from "@storybook/react";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
CircularAvatar,
|
|
6
|
+
CircularAvatarProps,
|
|
7
|
+
} from "../../components/DataDisplay/Avatar/Avatar";
|
|
5
8
|
|
|
6
9
|
// Define the default export with Meta type including the component type
|
|
7
10
|
export default {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GridColDef, GridColumnGroupingModel } from "@mui/x-data-grid";
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { DataTable } from "
|
|
3
|
+
import { DataTable } from "../../components/DataDisplay/DataTable/DataTable";
|
|
4
|
+
// Make sure the path to your component is correct
|
|
4
5
|
|
|
5
6
|
const columns: GridColDef[] = [
|
|
6
7
|
{ field: "id", headerName: "ID", flex: 1 },
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
2
|
|
|
3
3
|
import { Meta } from "@storybook/react";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
SquareAvatar,
|
|
6
|
+
SquareAvatarProps,
|
|
7
|
+
} from "../../components/DataDisplay/Avatar/Avatar";
|
|
5
8
|
|
|
6
9
|
// Define the default export with Meta type including the component type
|
|
7
10
|
export default {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { LightColorTokens
|
|
1
|
+
import { Typography } from "../../components/DataDisplay/Typography/Typography";
|
|
2
|
+
import { DarkColorTokens } from "../../themes/colorTokens/darkColorTokens";
|
|
3
|
+
import { LightColorTokens } from "../../themes/colorTokens/lightColorTokens";
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: "Design System/Color Palette",
|
|
@@ -17,13 +17,13 @@ const ColorBox = ({ color, name }: { color: string; name: string }) => (
|
|
|
17
17
|
height: 60,
|
|
18
18
|
backgroundColor: color,
|
|
19
19
|
marginRight: 10,
|
|
20
|
-
border: "1px solid #ddd",
|
|
20
|
+
border: "1px solid #ddd",
|
|
21
21
|
borderRadius: 5,
|
|
22
22
|
}}
|
|
23
23
|
/>
|
|
24
24
|
<div>
|
|
25
|
-
<
|
|
26
|
-
<
|
|
25
|
+
<Typography variant="subtitle1">{name}</Typography>
|
|
26
|
+
<Typography variant="caption">{color}</Typography>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
);
|
|
@@ -41,11 +41,7 @@ const PaletteDisplay = ({
|
|
|
41
41
|
<div key={group}>
|
|
42
42
|
<h4>{group.toUpperCase()}</h4>
|
|
43
43
|
{Object.entries(colorTokens[group]).map(([name, color]) => (
|
|
44
|
-
<ColorBox
|
|
45
|
-
key={name}
|
|
46
|
-
name={`${group} ${name}`}
|
|
47
|
-
color={color as string}
|
|
48
|
-
/>
|
|
44
|
+
<ColorBox key={name} name={name} color={color as string} />
|
|
49
45
|
))}
|
|
50
46
|
</div>
|
|
51
47
|
))}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/stories/Typography.stories.jsx
|
|
2
2
|
import { Stack } from "@mui/material";
|
|
3
|
-
import { Typography } from "
|
|
3
|
+
import { Typography } from "../../components/DataDisplay/Typography/Typography";
|
|
4
|
+
|
|
4
5
|
// Update path as necessary
|
|
5
6
|
|
|
6
7
|
export default {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
2
|
import { Meta } from "@storybook/react";
|
|
3
|
+
import { Spinner } from "../../components/Feedback/Spinner/Spinner";
|
|
3
4
|
|
|
4
5
|
// Make sure your TextField import is correct
|
|
5
6
|
|
|
6
|
-
import { Spinner } from "./Spinner";
|
|
7
|
-
|
|
8
7
|
// Define the default export with Meta type including the component type
|
|
9
8
|
export default {
|
|
10
9
|
title: "Feedback/Spinner",
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { Icons } from "../../components/Assets/Icons/Icons";
|
|
4
|
+
import {
|
|
5
|
+
ToolTipContent,
|
|
6
|
+
Tooltip,
|
|
7
|
+
} from "../../components/Feedback/Tooltip/Tooltip";
|
|
8
|
+
import { Button } from "../../components/Input/Button/Button";
|
|
5
9
|
|
|
6
10
|
export default {
|
|
7
11
|
title: "Feedback/Tooltip",
|
|
@@ -19,7 +23,7 @@ export const IconTooltip: StoryObj<typeof Tooltip> = {
|
|
|
19
23
|
title: (
|
|
20
24
|
<ToolTipContent message="Duis rhoncus dui venenatis consequat porttitor. Etiam aliquet congue consequat. In posuere, nunc sit amet laoreet blandit, urna sapien imperdiet lectusui." />
|
|
21
25
|
),
|
|
22
|
-
children: <InfoIcon />,
|
|
26
|
+
children: <Icons.InfoIcon />,
|
|
23
27
|
},
|
|
24
28
|
};
|
|
25
29
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
2
|
import { Meta } from "@storybook/react";
|
|
3
|
+
import { Button, ButtonProps } from "../../components/Input/Button/Button";
|
|
3
4
|
|
|
4
5
|
// Make sure your TextField import is correct
|
|
5
6
|
|
|
6
|
-
import { Button, ButtonProps } from "./Button";
|
|
7
|
-
|
|
8
7
|
// Define the default export with Meta type including the component type
|
|
9
8
|
export default {
|
|
10
9
|
title: "Input/Button",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryFn } from "@storybook/react";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
MultiCheckBox,
|
|
5
|
+
MultiCheckboxProps,
|
|
6
|
+
} from "../../components/Input/MultiCheckBox/MultiCheckBox";
|
|
4
7
|
|
|
5
8
|
export default {
|
|
6
9
|
title: "Input/MultiCheckBox",
|