@campxdev/react-blueprint 1.1.3 → 1.1.5
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/package.json +1 -1
- package/src/components/Assets/Icons/IconComponents/ArrowBackIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CollapseIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ExpandIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/RedoIcon.tsx +29 -0
- package/src/components/Assets/Icons/IconComponents/VisibiityOffIcon.tsx +27 -0
- package/src/components/Assets/Icons/IconComponents/VisibilityIcon.tsx +33 -0
- package/src/components/Assets/Icons/Icons.tsx +6 -0
- package/src/components/DataDisplay/Typography/Typography.tsx +10 -2
- package/src/components/Input/PasswordField/PasswordField.tsx +67 -0
- package/src/components/Input/export.ts +1 -0
- package/src/components/Navigation/Sidebar/DropdownItem.tsx +34 -0
- package/src/components/Navigation/Sidebar/MenuItem.tsx +8 -13
- package/src/components/Navigation/Sidebar/Sidebar.tsx +1 -1
- package/src/components/Navigation/Sidebar/interfaces.ts +7 -1
- package/src/stories/Input/Password.stories.tsx +22 -0
- package/src/stories/Input/TextField.stories.tsx +0 -11
- package/src/themes/commonTheme.ts +7 -0
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const RedoIcon = ({ size = 16 }) => {
|
|
4
|
+
const theme = useTheme();
|
|
5
|
+
const color = theme.palette.text.primary;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<svg
|
|
9
|
+
width={size}
|
|
10
|
+
height={size}
|
|
11
|
+
viewBox={`0 0 20 20`}
|
|
12
|
+
fill="none"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d="M12.612 4.01719H5.94531C5.75303 4.01719 5.56862 4.09357 5.43266 4.22954C5.2967 4.3655 5.22031 4.54991 5.22031 4.74219C5.22031 4.93447 5.2967 5.11888 5.43266 5.25484C5.56862 5.3908 5.75303 5.46719 5.94531 5.46719H12.612C13.5248 5.46719 14.4002 5.82979 15.0456 6.47523C15.691 7.12067 16.0536 7.99607 16.0536 8.90885C16.0536 9.82164 15.691 10.697 15.0456 11.3425C14.4002 11.9879 13.5248 12.3505 12.612 12.3505H3.44531C3.25303 12.3505 3.06862 12.4269 2.93266 12.5629C2.7967 12.6988 2.72031 12.8832 2.72031 13.0755C2.72031 13.2678 2.7967 13.4522 2.93266 13.5882C3.06862 13.7241 3.25303 13.8005 3.44531 13.8005H12.612C13.9093 13.8005 15.1535 13.2851 16.0709 12.3678C16.9883 11.4504 17.5036 10.2062 17.5036 8.90885C17.5036 7.6115 16.9883 6.36729 16.0709 5.44992C15.1535 4.53256 13.9093 4.01719 12.612 4.01719Z"
|
|
17
|
+
fill={color}
|
|
18
|
+
stroke="#323167"
|
|
19
|
+
stroke-width="0.2"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
d="M5.35888 10.2672C5.26348 10.2668 5.16895 10.2854 5.08082 10.3219C4.99263 10.3584 4.91261 10.4122 4.84543 10.48C4.84537 10.4801 4.84531 10.4801 4.84524 10.4802L2.71227 12.6131L2.71185 12.6136C2.57712 12.7499 2.50156 12.9339 2.50156 13.1255C2.50156 13.3172 2.57712 13.5012 2.71185 13.6375L2.71227 13.6379L4.845 15.7706C4.91172 15.8396 4.99146 15.8946 5.07961 15.9325C5.16804 15.9706 5.26317 15.9906 5.35943 15.9915C5.4557 15.9924 5.55117 15.9741 5.64029 15.9377C5.7294 15.9013 5.81038 15.8475 5.87848 15.7794C5.94659 15.7114 6.00046 15.6305 6.03695 15.5414C6.07345 15.4523 6.09184 15.3569 6.09105 15.2606C6.09026 15.1643 6.0703 15.0692 6.03235 14.9807C5.99451 14.8925 5.93953 14.8127 5.87061 14.7459L4.25024 13.1255L5.87119 11.5046L5.87161 11.5042C6.00634 11.3678 6.0819 11.1839 6.0819 10.9922C6.0819 10.8005 6.00634 10.6166 5.87161 10.4802L5.87155 10.4802C5.80445 10.4124 5.72452 10.3586 5.63643 10.3221C5.54846 10.2856 5.45412 10.2669 5.35888 10.2672ZM5.35888 10.2672C5.35902 10.2672 5.35916 10.2672 5.35931 10.2672L5.35881 10.3672L5.35846 10.2672C5.3586 10.2672 5.35874 10.2672 5.35888 10.2672Z"
|
|
23
|
+
fill={color}
|
|
24
|
+
stroke="#323167"
|
|
25
|
+
stroke-width="0.2"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const VisibilityOffIcon = ({ size = 16 }) => {
|
|
4
|
+
const theme = useTheme();
|
|
5
|
+
const color = theme.palette.text.primary;
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
width={size}
|
|
9
|
+
height={size}
|
|
10
|
+
viewBox="0 0 17 16"
|
|
11
|
+
style={{
|
|
12
|
+
fill: color,
|
|
13
|
+
stroke: color,
|
|
14
|
+
}}
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
>
|
|
17
|
+
<g opacity="0.5">
|
|
18
|
+
<path
|
|
19
|
+
d="M14.1191 6.7759C14.5889 6.38566 14.9815 5.98185 15.3013 5.60619C15.5012 5.3713 15.4682 5.022 15.2289 4.82702L15.2289 4.82702C14.9909 4.63308 14.6375 4.66423 14.4386 4.89781L14.4386 4.89781C13.3705 6.15247 11.437 7.7143 8.39892 7.7143C5.36076 7.7143 3.42726 6.15246 2.35914 4.8978L2.35914 4.8978C2.16029 4.66422 1.80691 4.63307 1.56886 4.827L14.1191 6.7759ZM14.1191 6.7759C14.1264 6.78787 14.1333 6.8002 14.1398 6.81287L14.1398 6.81293L15.3724 9.22448L15.3724 9.22448C15.5126 9.49877 15.398 9.83078 15.1206 9.96648L15.1206 9.96649C14.8443 10.1016 14.507 9.99292 14.3675 9.71997L14.4565 9.67445L14.3675 9.71996L13.2046 7.44464C12.4682 7.91518 11.5948 8.32026 10.5743 8.56629L11.1071 11.1722C11.1687 11.4734 10.9687 11.7631 10.6657 11.8224C10.3634 11.8816 10.0661 11.6901 10.0047 11.3896L10.0047 11.3896L9.46705 8.76005C9.12496 8.79822 8.76899 8.8186 8.39892 8.8186C8.02879 8.8186 7.67281 8.79822 7.33066 8.76004L6.79308 11.3896L6.69511 11.3696L6.79308 11.3896C6.73164 11.6901 6.43433 11.8816 6.13201 11.8224C5.82908 11.7631 5.62907 11.4734 5.69064 11.1722L5.78862 11.1922L5.69064 11.1722L6.22341 8.56623C5.38442 8.36396 4.64476 8.05415 3.99891 7.68879L2.37696 9.80438L2.37695 9.80439C2.19035 10.0477 1.83898 10.0963 1.59134 9.91461L1.59132 9.9146C1.34241 9.73191 1.29105 9.38484 1.47868 9.14007L1.47869 9.14006L3.06069 7.0766C2.41767 6.59736 1.89937 6.0794 1.4965 5.60618C1.29654 5.37129 1.32953 5.02199 1.56886 4.827L14.1191 6.7759Z"
|
|
20
|
+
fill="#121212"
|
|
21
|
+
stroke="#121212"
|
|
22
|
+
stroke-width="0.2"
|
|
23
|
+
/>
|
|
24
|
+
</g>
|
|
25
|
+
</svg>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const VisibilityIcon = ({ size = 16 }) => {
|
|
4
|
+
const theme = useTheme();
|
|
5
|
+
const color = theme.palette.text.primary;
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
width={size}
|
|
9
|
+
height={size}
|
|
10
|
+
viewBox="0 0 17 16"
|
|
11
|
+
style={{
|
|
12
|
+
fill: color,
|
|
13
|
+
stroke: color,
|
|
14
|
+
}}
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
>
|
|
17
|
+
<g opacity="0.5">
|
|
18
|
+
<path
|
|
19
|
+
d="M11.3848 7.99974V7.99968C11.3848 7.40903 11.2096 6.83164 10.8815 6.34053C10.5533 5.84942 10.0869 5.46664 9.54121 5.24061C8.99552 5.01458 8.39505 4.95543 7.81575 5.07067C7.23644 5.1859 6.70432 5.47032 6.28666 5.88798C5.869 6.30563 5.58458 6.83776 5.46935 7.41706C5.35412 7.99637 5.41326 8.59684 5.63929 9.14253C5.86532 9.68822 6.2481 10.1546 6.73921 10.4828C7.23032 10.8109 7.80771 10.9861 8.39836 10.9861H8.39842C9.19031 10.9856 9.94965 10.6709 10.5096 10.1109C11.0696 9.55096 11.3843 8.79163 11.3848 7.99974ZM7.40606 6.51406C7.69973 6.31773 8.04503 6.21287 8.39828 6.21275C8.87197 6.21329 9.32612 6.40167 9.66112 6.73657C9.99612 7.07149 10.1846 7.52559 10.1853 7.99929C10.1853 8.35254 10.0805 8.69785 9.88427 8.99157C9.688 9.28533 9.40903 9.5143 9.08264 9.64952C8.75625 9.78474 8.39709 9.82015 8.05057 9.75126C7.70406 9.68237 7.38575 9.51229 7.1359 9.2625C6.88605 9.01272 6.71587 8.69446 6.64688 8.34797C6.5779 8.00147 6.6132 7.6423 6.74833 7.31587C6.88346 6.98944 7.11235 6.71041 7.40606 6.51406Z"
|
|
20
|
+
fill="#121212"
|
|
21
|
+
stroke="#121212"
|
|
22
|
+
stroke-width="0.2"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M1.81217 10.0492L1.81206 10.0492L1.81477 10.0535C3.45532 12.6219 5.8504 14.113 8.39878 14.113C10.9408 14.113 13.3359 12.6218 14.9764 10.0535L14.9765 10.0536L14.979 10.0492C15.3349 9.42477 15.5221 8.71841 15.5221 7.99966C15.5221 7.28091 15.3349 6.57455 14.979 5.95014L14.9791 5.95007L14.9764 5.94583C13.3359 3.37748 10.9403 1.88633 8.39878 1.88633C5.85728 1.88633 3.46174 3.37748 1.81487 5.94568L1.81475 5.94561L1.81217 5.95014C1.45621 6.57455 1.26902 7.28091 1.26902 7.99966C1.26902 8.71841 1.45621 9.42477 1.81217 10.0492ZM2.83152 6.5904C4.25818 4.35317 6.28873 3.08633 8.39878 3.08633C10.5088 3.08633 12.5394 4.35317 13.966 6.59039C14.2029 7.02223 14.3271 7.50683 14.3271 7.99939C14.3271 8.49196 14.2029 8.97656 13.966 9.4084C12.5394 11.6456 10.5088 12.9125 8.39878 12.9125C6.28872 12.9125 4.25817 11.6461 2.83153 9.4084C2.59466 8.97656 2.47048 8.49196 2.47048 7.99939C2.47048 7.50683 2.59466 7.02223 2.83152 6.5904Z"
|
|
26
|
+
fill="#121212"
|
|
27
|
+
stroke="#121212"
|
|
28
|
+
stroke-width="0.2"
|
|
29
|
+
/>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -40,6 +40,7 @@ import { InfoFilledIcon } from "./IconComponents/InfoFilledIcon";
|
|
|
40
40
|
import { PeoplexIcon } from "./IconComponents/PeoplexIcon";
|
|
41
41
|
import { ProductFeaturesIcon } from "./IconComponents/ProductFeaturesIcon";
|
|
42
42
|
import { ProfileIcon } from "./IconComponents/ProfileIcon";
|
|
43
|
+
import { RedoIcon } from "./IconComponents/RedoIcon";
|
|
43
44
|
import { RightIcon } from "./IconComponents/RightIcon";
|
|
44
45
|
import { SaveIcon } from "./IconComponents/SaveIcon";
|
|
45
46
|
import { SearchIcon } from "./IconComponents/SearchIcon";
|
|
@@ -49,9 +50,12 @@ import { TicketsIcon } from "./IconComponents/TicketsIcon";
|
|
|
49
50
|
import { UmsIcon } from "./IconComponents/UmsIcon";
|
|
50
51
|
import { UnCheckedCheckboxIcon } from "./IconComponents/UncheckCheckBoxIcon";
|
|
51
52
|
import { UnCheckedRadioIcon } from "./IconComponents/UncheckedRadioIcon";
|
|
53
|
+
import { VisibilityOffIcon } from "./IconComponents/VisibiityOffIcon";
|
|
54
|
+
import { VisibilityIcon } from "./IconComponents/VisibilityIcon";
|
|
52
55
|
import { WarningFilledIcon } from "./IconComponents/WarningFilledIcon";
|
|
53
56
|
|
|
54
57
|
export const Icons = {
|
|
58
|
+
RedoIcon,
|
|
55
59
|
ArrowBackIcon,
|
|
56
60
|
CollapseIcon,
|
|
57
61
|
ExpandIcon,
|
|
@@ -59,6 +63,8 @@ export const Icons = {
|
|
|
59
63
|
CareerIcon,
|
|
60
64
|
ClogWheelIcon,
|
|
61
65
|
DashBoardIcon,
|
|
66
|
+
VisibilityIcon,
|
|
67
|
+
VisibilityOffIcon,
|
|
62
68
|
HelpIcon,
|
|
63
69
|
HomeIcon,
|
|
64
70
|
LeftIcon,
|
|
@@ -5,6 +5,14 @@ import {
|
|
|
5
5
|
|
|
6
6
|
export type TypographyProps = {} & MuiTypographyProps;
|
|
7
7
|
|
|
8
|
-
export const Typography = ({
|
|
9
|
-
|
|
8
|
+
export const Typography = ({
|
|
9
|
+
variant,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}: TypographyProps) => {
|
|
13
|
+
return (
|
|
14
|
+
<MuiTypography variant={variant} {...props}>
|
|
15
|
+
{children}
|
|
16
|
+
</MuiTypography>
|
|
17
|
+
);
|
|
10
18
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconButton,
|
|
3
|
+
InputAdornment,
|
|
4
|
+
TextField as MuiTextField,
|
|
5
|
+
TextFieldProps as MuiTextFieldProps,
|
|
6
|
+
StackProps,
|
|
7
|
+
} from "@mui/material";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { VisibilityOffIcon } from "../../Assets/Icons/IconComponents/VisibiityOffIcon";
|
|
10
|
+
import { VisibilityIcon } from "../../Assets/Icons/IconComponents/VisibilityIcon";
|
|
11
|
+
import { Typography } from "../../export";
|
|
12
|
+
import { LabelWrapper } from "../LabelWrapper/LabelWrapper";
|
|
13
|
+
|
|
14
|
+
export type PasswordFieldProps = {
|
|
15
|
+
containerProps?: StackProps;
|
|
16
|
+
description?: string;
|
|
17
|
+
} & MuiTextFieldProps;
|
|
18
|
+
|
|
19
|
+
export const PasswordField = ({
|
|
20
|
+
name,
|
|
21
|
+
label,
|
|
22
|
+
value,
|
|
23
|
+
onChange,
|
|
24
|
+
required = false,
|
|
25
|
+
containerProps,
|
|
26
|
+
description,
|
|
27
|
+
type = "text",
|
|
28
|
+
...rest
|
|
29
|
+
}: PasswordFieldProps) => {
|
|
30
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
31
|
+
const handleClickShowPassword = () => {
|
|
32
|
+
setShowPassword((prev) => !prev);
|
|
33
|
+
};
|
|
34
|
+
return (
|
|
35
|
+
<LabelWrapper
|
|
36
|
+
label={label}
|
|
37
|
+
required={required}
|
|
38
|
+
name={name}
|
|
39
|
+
containerProps={containerProps}
|
|
40
|
+
>
|
|
41
|
+
<MuiTextField
|
|
42
|
+
required={required}
|
|
43
|
+
id={name}
|
|
44
|
+
value={value}
|
|
45
|
+
label={label}
|
|
46
|
+
name={name}
|
|
47
|
+
onChange={onChange}
|
|
48
|
+
type={!showPassword ? "password" : "text"}
|
|
49
|
+
InputProps={{
|
|
50
|
+
endAdornment: (
|
|
51
|
+
<InputAdornment position="end">
|
|
52
|
+
<IconButton
|
|
53
|
+
aria-label="toggle password visibility"
|
|
54
|
+
onClick={handleClickShowPassword}
|
|
55
|
+
edge="end"
|
|
56
|
+
>
|
|
57
|
+
{showPassword ? <VisibilityIcon /> : <VisibilityOffIcon />}
|
|
58
|
+
</IconButton>
|
|
59
|
+
</InputAdornment>
|
|
60
|
+
),
|
|
61
|
+
}}
|
|
62
|
+
{...rest}
|
|
63
|
+
/>
|
|
64
|
+
<Typography variant="caption">{description}</Typography>
|
|
65
|
+
</LabelWrapper>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useMatch, useResolvedPath } from "react-router-dom";
|
|
2
|
+
import { Typography } from "../../export";
|
|
3
|
+
import { DropdownMenuItem } from "./interfaces";
|
|
4
|
+
import { createSidebarStyles } from "./styles";
|
|
5
|
+
|
|
6
|
+
export const SidebarDropdownItem = ({
|
|
7
|
+
dropdownItem,
|
|
8
|
+
collapsed,
|
|
9
|
+
index,
|
|
10
|
+
}: {
|
|
11
|
+
dropdownItem: DropdownMenuItem;
|
|
12
|
+
collapsed: boolean;
|
|
13
|
+
index: number;
|
|
14
|
+
}) => {
|
|
15
|
+
const { name, path, permissionKey } = dropdownItem;
|
|
16
|
+
|
|
17
|
+
let resolved = useResolvedPath(path);
|
|
18
|
+
let match = useMatch({ path: resolved.pathname, end: false });
|
|
19
|
+
|
|
20
|
+
const { StyledListItem, StyledLinkButton, StyledListItemButton } =
|
|
21
|
+
createSidebarStyles(collapsed);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<StyledListItem key={index} disablePadding className="listItem">
|
|
25
|
+
<StyledLinkButton to={path} match={match}>
|
|
26
|
+
{!collapsed && (
|
|
27
|
+
<StyledListItemButton collapsed={collapsed}>
|
|
28
|
+
<Typography variant="button1">{name}</Typography>
|
|
29
|
+
</StyledListItemButton>
|
|
30
|
+
)}
|
|
31
|
+
</StyledLinkButton>
|
|
32
|
+
</StyledListItem>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -3,6 +3,7 @@ import { motion } from "framer-motion";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { useMatch, useResolvedPath } from "react-router-dom";
|
|
5
5
|
import { Icons, Tooltip, Typography } from "../../export";
|
|
6
|
+
import { SidebarDropdownItem } from "./DropdownItem";
|
|
6
7
|
import { MenuItemProps } from "./interfaces";
|
|
7
8
|
import { createSidebarStyles } from "./styles";
|
|
8
9
|
|
|
@@ -10,13 +11,11 @@ export const SideBarMenuItem = ({
|
|
|
10
11
|
menuItem,
|
|
11
12
|
index,
|
|
12
13
|
collapsed,
|
|
13
|
-
isDropdownMenuItem = false,
|
|
14
14
|
newMenuClickHandler,
|
|
15
15
|
}: {
|
|
16
16
|
menuItem: MenuItemProps;
|
|
17
17
|
index: number;
|
|
18
18
|
collapsed: boolean;
|
|
19
|
-
isDropdownMenuItem?: boolean;
|
|
20
19
|
newMenuClickHandler: (newMenu: MenuItemProps[], newMenuTitle: string) => void;
|
|
21
20
|
}) => {
|
|
22
21
|
const {
|
|
@@ -28,7 +27,8 @@ export const SideBarMenuItem = ({
|
|
|
28
27
|
HoverIcon,
|
|
29
28
|
} = createSidebarStyles(collapsed);
|
|
30
29
|
|
|
31
|
-
const { path, icon: Icon,
|
|
30
|
+
const { name, path, icon: Icon, menu: newMenu, dropdownMenu } = menuItem;
|
|
31
|
+
|
|
32
32
|
let resolved = useResolvedPath(path);
|
|
33
33
|
let match = useMatch({ path: resolved.pathname, end: false });
|
|
34
34
|
|
|
@@ -61,7 +61,7 @@ export const SideBarMenuItem = ({
|
|
|
61
61
|
<Typography variant="button1">{name}</Typography>
|
|
62
62
|
</Stack>
|
|
63
63
|
<HoverIcon display={"flex"} className="hoverIcon">
|
|
64
|
-
<Icons.
|
|
64
|
+
<Icons.RedoIcon size={18} />
|
|
65
65
|
</HoverIcon>
|
|
66
66
|
</Stack>
|
|
67
67
|
</StyledListItemButton>
|
|
@@ -94,9 +94,7 @@ export const SideBarMenuItem = ({
|
|
|
94
94
|
const DefaultTile = () => {
|
|
95
95
|
return (
|
|
96
96
|
<StyledListItemButton collapsed={collapsed}>
|
|
97
|
-
{
|
|
98
|
-
<StyledListItemIcon collapsed={collapsed}>{Icon}</StyledListItemIcon>
|
|
99
|
-
)}
|
|
97
|
+
<StyledListItemIcon collapsed={collapsed}>{Icon}</StyledListItemIcon>
|
|
100
98
|
<Typography variant="button1">{name}</Typography>
|
|
101
99
|
</StyledListItemButton>
|
|
102
100
|
);
|
|
@@ -132,13 +130,10 @@ export const SideBarMenuItem = ({
|
|
|
132
130
|
{expanded && dropdownMenu && dropdownMenu.length > 0 && (
|
|
133
131
|
<Stack>
|
|
134
132
|
{dropdownMenu?.map((item: any, index: number) => (
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
index={index}
|
|
138
|
-
key={index}
|
|
133
|
+
<SidebarDropdownItem
|
|
134
|
+
dropdownItem={item}
|
|
139
135
|
collapsed={collapsed}
|
|
140
|
-
|
|
141
|
-
newMenuClickHandler={newMenuClickHandler}
|
|
136
|
+
index={index}
|
|
142
137
|
/>
|
|
143
138
|
))}
|
|
144
139
|
</Stack>
|
|
@@ -62,7 +62,7 @@ export const Sidebar = ({
|
|
|
62
62
|
StyledMenuBar,
|
|
63
63
|
StyledCollapsibleSection,
|
|
64
64
|
StyledMenuHeaderButton,
|
|
65
|
-
} = useMemo(() => createSidebarStyles(collapsed), [collapsed
|
|
65
|
+
} = useMemo(() => createSidebarStyles(collapsed), [collapsed]);
|
|
66
66
|
|
|
67
67
|
return (
|
|
68
68
|
<motion.div
|
|
@@ -6,7 +6,13 @@ export interface MenuItemProps {
|
|
|
6
6
|
icon: ReactElement;
|
|
7
7
|
permissionKey?: string;
|
|
8
8
|
menu?: MenuItemProps[];
|
|
9
|
-
dropdownMenu?:
|
|
9
|
+
dropdownMenu?: DropdownMenuItem[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface DropdownMenuItem {
|
|
13
|
+
name: string;
|
|
14
|
+
path: string;
|
|
15
|
+
permissionKey?: string;
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
export interface MenuHistory {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
PasswordField,
|
|
4
|
+
PasswordFieldProps,
|
|
5
|
+
} from "../../components/Input/PasswordField/PasswordField";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Input/PasswordField",
|
|
9
|
+
component: PasswordField,
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
argTypes: {},
|
|
12
|
+
} as Meta<typeof PasswordField>;
|
|
13
|
+
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: (args: PasswordFieldProps) => <PasswordField {...args} />,
|
|
16
|
+
args: {
|
|
17
|
+
label: "Password",
|
|
18
|
+
required: true,
|
|
19
|
+
value: "KAHPS9888B",
|
|
20
|
+
helperText: "Password should be alpha-numeric with special character",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -132,17 +132,6 @@ export const WarningInput = {
|
|
|
132
132
|
},
|
|
133
133
|
};
|
|
134
134
|
|
|
135
|
-
export const PassowrdInput = {
|
|
136
|
-
render: (args: TextFieldProps) => <TextField {...args} />,
|
|
137
|
-
args: {
|
|
138
|
-
label: "Password",
|
|
139
|
-
type: "password",
|
|
140
|
-
required: true,
|
|
141
|
-
value: "KAHPS9888B",
|
|
142
|
-
helperText: "Password should be alpha-numeric with special character",
|
|
143
|
-
},
|
|
144
|
-
};
|
|
145
|
-
|
|
146
135
|
export const InfoInput = {
|
|
147
136
|
render: (args: TextFieldProps) => <TextField {...args} />,
|
|
148
137
|
args: {
|