pixelize-design-library 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/. prettierrc +14 -0
- package/.eslintcache +1 -0
- package/.husky/pre-commit +4 -0
- package/.storybook/main.ts +19 -0
- package/.storybook/preview.ts +14 -0
- package/README.md +48 -0
- package/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/eslint.config.mjs +20 -0
- package/exposedComponents.json +26 -0
- package/package.json +105 -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/rsbuild.config.ts +49 -0
- package/src/App.tsx +10 -0
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChart.stories.tsx +39 -0
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChart.tsx +80 -0
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChartProps.tsx +20 -0
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChart.stories.tsx +33 -0
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChart.tsx +42 -0
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChartProps.tsx +17 -0
- package/src/Components/Breadcrumbs/Breadcrumbs.stories.tsx +26 -0
- package/src/Components/Breadcrumbs/Breadcrumbs.tsx +25 -0
- package/src/Components/Breadcrumbs/BreadcrumbsProps.tsx +12 -0
- package/src/Components/Button/Button.stories.tsx +32 -0
- package/src/Components/Button/Button.tsx +26 -0
- package/src/Components/Button/ButtonProps.tsx +10 -0
- package/src/Components/ButtonGroupIcon/ButtonGoupIconProps.tsx +14 -0
- package/src/Components/ButtonGroupIcon/ButtonGroupIcon.stories.tsx +37 -0
- package/src/Components/ButtonGroupIcon/ButtonGroupIcon.tsx +25 -0
- package/src/Components/Checkbox/Checkbox.stories.tsx +45 -0
- package/src/Components/Checkbox/Checkbox.tsx +29 -0
- package/src/Components/Checkbox/CheckboxProps.tsx +9 -0
- package/src/Components/Input/TextInput.stories.tsx +44 -0
- package/src/Components/Input/TextInput.tsx +70 -0
- package/src/Components/Input/TextInputProps.tsx +27 -0
- package/src/Components/InputTextArea/InputTextArea.stories.tsx +48 -0
- package/src/Components/InputTextArea/InputTextArea.tsx +36 -0
- package/src/Components/InputTextArea/InputTextAreaProps.tsx +11 -0
- package/src/Components/Loading/Loading.stories.tsx +25 -0
- package/src/Components/Loading/Loading.tsx +37 -0
- package/src/Components/Loading/LoadingProps.tsx +1 -0
- package/src/Components/Modal/Modal.stories.tsx +106 -0
- package/src/Components/Modal/Modal.tsx +44 -0
- package/src/Components/Modal/ModalProps.tsx +12 -0
- package/src/Components/NavigationBar/NavBar.stories.tsx +26 -0
- package/src/Components/NavigationBar/NavigationBar.tsx +55 -0
- package/src/Components/NavigationBar/NavigationBarProps.tsx +13 -0
- package/src/Components/NumberInput/NumberInput.stories.tsx +31 -0
- package/src/Components/NumberInput/NumberInput.tsx +55 -0
- package/src/Components/NumberInput/NumberInputProps.tsx +28 -0
- package/src/Components/PinInput/PinInput.stories.tsx +40 -0
- package/src/Components/PinInput/PinInput.tsx +48 -0
- package/src/Components/PinInput/PinInputProps.tsx +33 -0
- package/src/Components/ProfileCard/ProfileCard.stories.tsx +30 -0
- package/src/Components/ProfileCard/ProfileCard.tsx +58 -0
- package/src/Components/ProfileCard/ProfileCardProps.tsx +41 -0
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewer.stories.tsx +25 -0
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewer.tsx +68 -0
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.tsx +14 -0
- package/src/Components/ProgressBar/ProgressBar.stories.tsx +46 -0
- package/src/Components/ProgressBar/ProgressBar.tsx +32 -0
- package/src/Components/ProgressBar/ProgressBarProps.tsx +7 -0
- package/src/Components/RadioButton/RadioButton.stories.tsx +46 -0
- package/src/Components/RadioButton/RadioButton.tsx +63 -0
- package/src/Components/RadioButton/RadioButtonProps.tsx +10 -0
- package/src/Components/Select/Select.stories.tsx +56 -0
- package/src/Components/Select/Select.tsx +45 -0
- package/src/Components/Select/SelectProps.tsx +15 -0
- package/src/Components/SideBar/SideBar.tsx +143 -0
- package/src/Components/SideBar/SideBarProps.tsx +18 -0
- package/src/Components/SideBar/Sidebar.stories.tsx +80 -0
- package/src/Components/Skeletons/Skeleton.stories.tsx +63 -0
- package/src/Components/Skeletons/SkeletonProps.tsx +23 -0
- package/src/Components/Skeletons/Skeletons.tsx +51 -0
- package/src/Components/Table/Table.stories.tsx +47 -0
- package/src/Components/Table/Table.tsx +516 -0
- package/src/Components/Table/TableProps.tsx +36 -0
- package/src/Components/Toaster/Toaster.stories.tsx +58 -0
- package/src/Components/Toaster/Toaster.tsx +34 -0
- package/src/Components/Toaster/ToasterProps.tsx +15 -0
- package/src/Components/ToolTip/ToolTip.stories.tsx +39 -0
- package/src/Components/ToolTip/ToolTip.tsx +61 -0
- package/src/Components/ToolTip/ToolTipProps.tsx +45 -0
- package/src/Layout.tsx +499 -0
- package/src/Theme/Dark/theme.ts +278 -0
- package/src/Theme/Default/theme.ts +301 -0
- package/src/Theme/index.ts +4 -0
- package/src/bootstrap.tsx +13 -0
- package/src/index.tsx +22 -0
- package/src/stories/Configure.mdx +364 -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/header.css +32 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ToolTip from './ToolTip';
|
|
3
|
+
import { ToolTipProps } from "./ToolTipProps";
|
|
4
|
+
import { StoryFn, Meta } from '@storybook/react';
|
|
5
|
+
import { Box } from '@chakra-ui/react';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/ToolTip/ToolTip',
|
|
9
|
+
component: ToolTip,
|
|
10
|
+
} as Meta;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const Template: StoryFn<ToolTipProps> = (args) => (
|
|
14
|
+
<Box textAlign="center" fontSize="xl">
|
|
15
|
+
<ToolTip {...args}>
|
|
16
|
+
Hover me
|
|
17
|
+
</ToolTip>
|
|
18
|
+
</Box>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export const Default = Template.bind({});
|
|
23
|
+
Default.args = {
|
|
24
|
+
label: 'Default Tooltip',
|
|
25
|
+
placement: 'top',
|
|
26
|
+
hasArrow: true,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Customized = Template.bind({});
|
|
30
|
+
Customized.args = {
|
|
31
|
+
label: 'Customized Tooltip',
|
|
32
|
+
placement: 'bottom',
|
|
33
|
+
hasArrow: true,
|
|
34
|
+
fontSize: 'md',
|
|
35
|
+
bg: 'purple.500',
|
|
36
|
+
color: 'white',
|
|
37
|
+
openDelay: 500,
|
|
38
|
+
closeDelay: 200,
|
|
39
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ChakraProvider, Tooltip as ChakraTooltip } from "@chakra-ui/react";
|
|
2
|
+
import { ToolTipProps } from "./ToolTipProps";
|
|
3
|
+
|
|
4
|
+
export default function ToolTip({
|
|
5
|
+
placement,
|
|
6
|
+
label,
|
|
7
|
+
children,
|
|
8
|
+
hasArrow,
|
|
9
|
+
fontSize,
|
|
10
|
+
bg,
|
|
11
|
+
color,
|
|
12
|
+
isDisabled,
|
|
13
|
+
isOpen,
|
|
14
|
+
defaultIsOpen,
|
|
15
|
+
openDelay,
|
|
16
|
+
closeDelay,
|
|
17
|
+
arrowSize,
|
|
18
|
+
closeOnClick,
|
|
19
|
+
size,
|
|
20
|
+
width,
|
|
21
|
+
height,
|
|
22
|
+
arrowPadding,
|
|
23
|
+
arrowShadowColor,
|
|
24
|
+
direction,
|
|
25
|
+
gutter,
|
|
26
|
+
onClose,
|
|
27
|
+
modifiers,
|
|
28
|
+
closeOnPointerDown
|
|
29
|
+
}: ToolTipProps) {
|
|
30
|
+
return (
|
|
31
|
+
<ChakraProvider>
|
|
32
|
+
<ChakraTooltip
|
|
33
|
+
label={label}
|
|
34
|
+
placement={placement}
|
|
35
|
+
hasArrow={hasArrow}
|
|
36
|
+
fontSize={fontSize}
|
|
37
|
+
bg={bg}
|
|
38
|
+
color={color}
|
|
39
|
+
isDisabled={isDisabled}
|
|
40
|
+
isOpen={isOpen}
|
|
41
|
+
defaultIsOpen={defaultIsOpen}
|
|
42
|
+
openDelay={openDelay}
|
|
43
|
+
closeDelay={closeDelay}
|
|
44
|
+
arrowSize={arrowSize}
|
|
45
|
+
closeOnClick={closeOnClick}
|
|
46
|
+
size={size}
|
|
47
|
+
width={width}
|
|
48
|
+
height={height}
|
|
49
|
+
arrowPadding={arrowPadding}
|
|
50
|
+
arrowShadowColor={arrowShadowColor}
|
|
51
|
+
direction={direction}
|
|
52
|
+
gutter={gutter}
|
|
53
|
+
onClose={onClose}
|
|
54
|
+
modifiers={modifiers}
|
|
55
|
+
closeOnPointerDown={closeOnPointerDown}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</ChakraTooltip>
|
|
59
|
+
</ChakraProvider>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TooltipProps as ChakraTooltip } from "@chakra-ui/react";
|
|
2
|
+
export type ToolTipProps = Pick<
|
|
3
|
+
ChakraTooltip,
|
|
4
|
+
| "placement"
|
|
5
|
+
| "label"
|
|
6
|
+
| "hasArrow"
|
|
7
|
+
| "fontSize"
|
|
8
|
+
| "bg"
|
|
9
|
+
| "color"
|
|
10
|
+
| "isDisabled"
|
|
11
|
+
| "isOpen"
|
|
12
|
+
| "defaultIsOpen"
|
|
13
|
+
| "openDelay"
|
|
14
|
+
| "closeDelay"
|
|
15
|
+
| "arrowSize"
|
|
16
|
+
| "closeOnClick"
|
|
17
|
+
| "size"
|
|
18
|
+
| "width"
|
|
19
|
+
| "height"
|
|
20
|
+
| "arrowPadding"
|
|
21
|
+
| "arrowShadowColor"
|
|
22
|
+
| "direction"
|
|
23
|
+
| "gutter"
|
|
24
|
+
| "onClose"
|
|
25
|
+
| "modifiers"
|
|
26
|
+
| "closeOnPointerDown"
|
|
27
|
+
> & {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
placement:
|
|
30
|
+
| "auto"
|
|
31
|
+
| "auto-start"
|
|
32
|
+
| "auto-end"
|
|
33
|
+
| "top"
|
|
34
|
+
| "top-start"
|
|
35
|
+
| "top-end"
|
|
36
|
+
| "right"
|
|
37
|
+
| "right-start"
|
|
38
|
+
| "right-end"
|
|
39
|
+
| "bottom"
|
|
40
|
+
| "bottom-start"
|
|
41
|
+
| "bottom-end"
|
|
42
|
+
| "left"
|
|
43
|
+
| "left-start"
|
|
44
|
+
| "left-end";
|
|
45
|
+
};
|
package/src/Layout.tsx
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
Flex,
|
|
4
|
+
Heading,
|
|
5
|
+
Text,
|
|
6
|
+
Button as ChakraButton,
|
|
7
|
+
Stack,
|
|
8
|
+
Skeleton,
|
|
9
|
+
} from "@chakra-ui/react";
|
|
10
|
+
import React, { useEffect, useState } from "react";
|
|
11
|
+
import Button from "./Components/Button/Button";
|
|
12
|
+
import CheckBox from "./Components/Checkbox/Checkbox";
|
|
13
|
+
import TextInput from "./Components/Input/TextInput";
|
|
14
|
+
import { useToaster } from "./Components/Toaster/Toaster";
|
|
15
|
+
import Modal from "./Components/Modal/Modal";
|
|
16
|
+
import Select from "./Components/Select/Select";
|
|
17
|
+
import Sidebar from "./Components/SideBar/SideBar";
|
|
18
|
+
import {
|
|
19
|
+
FiBriefcase,
|
|
20
|
+
FiCalendar,
|
|
21
|
+
FiDollarSign,
|
|
22
|
+
FiHome,
|
|
23
|
+
FiSettings,
|
|
24
|
+
FiUser,
|
|
25
|
+
} from "react-icons/fi";
|
|
26
|
+
import NavBar from "./Components/NavigationBar/NavigationBar";
|
|
27
|
+
import Loading from "./Components/Loading/Loading";
|
|
28
|
+
import Skeletons from "./Components/Skeletons/Skeletons";
|
|
29
|
+
import {
|
|
30
|
+
RadioButton,
|
|
31
|
+
RadioButtonGroup,
|
|
32
|
+
} from "./Components/RadioButton/RadioButton";
|
|
33
|
+
import ButtonGroupIcon from "./Components/ButtonGroupIcon/ButtonGroupIcon";
|
|
34
|
+
import ProgressBar from "./Components/ProgressBar/ProgressBar";
|
|
35
|
+
import NumberInput from "./Components/NumberInput/NumberInput";
|
|
36
|
+
import PinInputs from "./Components/PinInput/PinInput";
|
|
37
|
+
import Card from "./Components/ProfileCard/ProfileCard";
|
|
38
|
+
import Breadcrumbs from "./Components/Breadcrumbs/Breadcrumbs";
|
|
39
|
+
import { ChevronRightIcon } from "@chakra-ui/icons";
|
|
40
|
+
import Table from "./Components/Table/Table";
|
|
41
|
+
import ToolTip from "./Components/ToolTip/ToolTip";
|
|
42
|
+
import ApexBarChart from "./Components/Apexcharts/ApexBarChart/ApexBarChart";
|
|
43
|
+
import ApexPieChart from "./Components/Apexcharts/ApexPieChart/ApexPieChart";
|
|
44
|
+
import ProfilePhotoViewer from "./Components/ProfilePhotoViewer/ProfilePhotoViewer";
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
const Layout = () => {
|
|
48
|
+
const navmenus = [
|
|
49
|
+
{ title: "Account Settings", url: "myaccount" },
|
|
50
|
+
{ title: "Resetpassword", url: "resetpassword" },
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const handleNavOnClick = (title: string) => {
|
|
54
|
+
// setActiveMenu(title)
|
|
55
|
+
console.log(title);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const handleLogout = () => {
|
|
59
|
+
console.log("Logout");
|
|
60
|
+
};
|
|
61
|
+
const { showToast } = useToaster();
|
|
62
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
63
|
+
const [selected, setSelected] = useState("");
|
|
64
|
+
|
|
65
|
+
const handleOnclick = () => {
|
|
66
|
+
showToast({
|
|
67
|
+
title: "Hello",
|
|
68
|
+
duration: 3000,
|
|
69
|
+
status: "success",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
//setIsOpen(true);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const handleOnclick2 = () => {
|
|
76
|
+
setIsOpen(true);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const handleOnChange = (e: any) => {
|
|
80
|
+
const checked = e.target.value;
|
|
81
|
+
setSelected(checked);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const menu = [
|
|
85
|
+
{
|
|
86
|
+
title: "Dashboard",
|
|
87
|
+
icon: FiHome,
|
|
88
|
+
url: "dashboard",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
title: "Calendar",
|
|
92
|
+
icon: FiCalendar,
|
|
93
|
+
url: "description",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
title: "Clients",
|
|
97
|
+
icon: FiUser,
|
|
98
|
+
url: "description",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
title: "Animals",
|
|
102
|
+
icon: FiCalendar,
|
|
103
|
+
url: "description",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: "Stock's",
|
|
107
|
+
icon: FiDollarSign,
|
|
108
|
+
url: "description",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: "Reports",
|
|
112
|
+
icon: FiBriefcase,
|
|
113
|
+
url: "description",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
title: "Settings",
|
|
117
|
+
icon: FiSettings,
|
|
118
|
+
url: "description",
|
|
119
|
+
subMenu: [
|
|
120
|
+
{
|
|
121
|
+
title: "Submenu Item 1",
|
|
122
|
+
url: "Submenu item 1 description",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
title: "Submenu Item 2",
|
|
126
|
+
url: "Submenu item 2 description",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
const [toggle, changeToggle] = useState(true);
|
|
133
|
+
const [activeMenu, setActiveMenu] = useState("");
|
|
134
|
+
|
|
135
|
+
const handleMenuClick = (title: string, url: string) => {
|
|
136
|
+
setActiveMenu(title);
|
|
137
|
+
console.log(title);
|
|
138
|
+
console.log(url);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const [selectedValue, setSelectedValue] = useState<string>("1");
|
|
142
|
+
|
|
143
|
+
const radioOptions = [
|
|
144
|
+
{ label: "Option 1", value: "1" },
|
|
145
|
+
{ label: "Option 2", value: "2" },
|
|
146
|
+
{ label: "Option 3", value: "3" },
|
|
147
|
+
];
|
|
148
|
+
|
|
149
|
+
const handleChange = (value: string) => {
|
|
150
|
+
setSelectedValue(value);
|
|
151
|
+
};
|
|
152
|
+
const [numbetInputValue, setNumbetInputValue] = useState("0");
|
|
153
|
+
const handleNumberinput = (value: string) => {
|
|
154
|
+
setNumbetInputValue(value);
|
|
155
|
+
};
|
|
156
|
+
const breadcrumbItems = [
|
|
157
|
+
{ path: "/home", label: "Home" },
|
|
158
|
+
{ path: "/about", label: "About" },
|
|
159
|
+
{ path: "/contact", label: "Contact" },
|
|
160
|
+
];
|
|
161
|
+
const handleClick = (path: string) => {
|
|
162
|
+
console.log(`Navigating to ${path}`);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const tableDataheader = [
|
|
166
|
+
{
|
|
167
|
+
label: "name",
|
|
168
|
+
accessor_key: "name",
|
|
169
|
+
sort: false,
|
|
170
|
+
search: false,
|
|
171
|
+
columnFreeze: true,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
label: "email",
|
|
175
|
+
accessor_key: "email",
|
|
176
|
+
sort: true,
|
|
177
|
+
search: true,
|
|
178
|
+
columnFreeze: true,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
label: "role",
|
|
182
|
+
accessor_key: "role",
|
|
183
|
+
sort: true,
|
|
184
|
+
search: true,
|
|
185
|
+
accessor_function: (value: any): JSX.Element => {
|
|
186
|
+
return <div onClick={() => console.log("hello")}>{value.toUpperCase()}</div>;
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{ label: "age", accessor_key: "age", sort: true, search: true },
|
|
190
|
+
{ label: "age1", accessor_key: "age1", sort: true, search: true },
|
|
191
|
+
{ label: "age2", accessor_key: "age2", sort: true, search: true },
|
|
192
|
+
{ label: "age3", accessor_key: "age3", sort: true, search: true },
|
|
193
|
+
{ label: "age4", accessor_key: "age4", sort: true, search: true },
|
|
194
|
+
{ label: "age5", accessor_key: "age5", sort: true, search: true },
|
|
195
|
+
{ label: "age6", accessor_key: "age6", sort: true, search: true },
|
|
196
|
+
{ label: "age7", accessor_key: "age7", sort: true, search: true },
|
|
197
|
+
{ label: "age8", accessor_key: "age8", sort: true, search: true },
|
|
198
|
+
{ label: "age9", accessor_key: "age9", sort: true, search: true },
|
|
199
|
+
{ label: "age10", accessor_key: "age10", sort: true, search: true },
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
const tableData = Array.from({ length: 20 }, (_, i) => ({
|
|
203
|
+
id: i + 1,
|
|
204
|
+
name: `User ${i + 1}`,
|
|
205
|
+
email: `user${i + 1}@example.com`,
|
|
206
|
+
role: i % 2 === 0 ? "Developer" : "Manager",
|
|
207
|
+
age: Math.floor(Math.random() * 100),
|
|
208
|
+
age1: Math.floor(Math.random() * 100),
|
|
209
|
+
age2: Math.floor(Math.random() * 100),
|
|
210
|
+
age3: Math.floor(Math.random() * 100),
|
|
211
|
+
age4: Math.floor(Math.random() * 100),
|
|
212
|
+
age5: Math.floor(Math.random() * 100),
|
|
213
|
+
age6: Math.floor(Math.random() * 100),
|
|
214
|
+
age7: Math.floor(Math.random() * 100),
|
|
215
|
+
age8: Math.floor(Math.random() * 100),
|
|
216
|
+
age9: Math.floor(Math.random() * 100),
|
|
217
|
+
age10: Math.floor(Math.random() * 100),
|
|
218
|
+
}));
|
|
219
|
+
|
|
220
|
+
function useWindowSize() {
|
|
221
|
+
const [windowSize, setWindowSize] = useState({
|
|
222
|
+
width: 0,
|
|
223
|
+
height: 0,
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
function handleResize() {
|
|
228
|
+
setWindowSize({
|
|
229
|
+
width: window.innerWidth,
|
|
230
|
+
height: window.innerHeight,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
window.addEventListener("resize", handleResize);
|
|
234
|
+
handleResize();
|
|
235
|
+
|
|
236
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
237
|
+
}, []);
|
|
238
|
+
|
|
239
|
+
return windowSize;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const { width, height } = useWindowSize();
|
|
243
|
+
|
|
244
|
+
// console.log(width, height);
|
|
245
|
+
|
|
246
|
+
const exportOptions = [
|
|
247
|
+
{ value: "PDF", label: "Export as PDF" },
|
|
248
|
+
{ value: "XLS", label: "Export as XLS" },
|
|
249
|
+
];
|
|
250
|
+
|
|
251
|
+
const data = Array.from({ length: 10 }, () =>
|
|
252
|
+
Math.floor(Math.random() * 100)
|
|
253
|
+
);
|
|
254
|
+
const categories = data.map((_, index) => `Category ${index + 1}`);
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<Box minH="100vh" bg="gray.100" overflow={"hidden"}>
|
|
258
|
+
<Loading text="Loading" isLoading={false} />
|
|
259
|
+
<Flex>
|
|
260
|
+
<Box>
|
|
261
|
+
<Sidebar
|
|
262
|
+
menus={menu}
|
|
263
|
+
activeMenu={activeMenu}
|
|
264
|
+
handleMenuClick={handleMenuClick}
|
|
265
|
+
toggle={toggle}
|
|
266
|
+
changeToggle={() => changeToggle(!toggle)}
|
|
267
|
+
logo={"https://bit.ly/dan-abramov"}
|
|
268
|
+
companyName="PIXELIZE"
|
|
269
|
+
/>
|
|
270
|
+
</Box>
|
|
271
|
+
<Box flex={"1"} maxWidth={width} overflow={"hidden"}>
|
|
272
|
+
<NavBar
|
|
273
|
+
userAvathar="https://bit.ly/dan-abramov"
|
|
274
|
+
userName="PIXELIZE"
|
|
275
|
+
navMenu={navmenus}
|
|
276
|
+
handleNavOnClick={handleNavOnClick}
|
|
277
|
+
handleLogout={handleLogout}
|
|
278
|
+
logoutText="Logout"
|
|
279
|
+
key={"navbar"}
|
|
280
|
+
/>
|
|
281
|
+
<br />
|
|
282
|
+
<Breadcrumbs
|
|
283
|
+
separator={<ChevronRightIcon color="gray.500" />}
|
|
284
|
+
items={breadcrumbItems}
|
|
285
|
+
handleClick={handleClick}
|
|
286
|
+
/>
|
|
287
|
+
<Box
|
|
288
|
+
p={"50px"}
|
|
289
|
+
height={height - 160}
|
|
290
|
+
overflowY="scroll"
|
|
291
|
+
width={width}
|
|
292
|
+
>
|
|
293
|
+
<TextInput
|
|
294
|
+
//label="hello"
|
|
295
|
+
id="hello"
|
|
296
|
+
name="hello"
|
|
297
|
+
//helperText="Hello"
|
|
298
|
+
//errorMessage="Required"
|
|
299
|
+
//error={true}
|
|
300
|
+
type="file"
|
|
301
|
+
// inputRightIcon={<FiUser color="gray.300" />}
|
|
302
|
+
// onRightIconclick={() => {
|
|
303
|
+
// console.log("icon click");
|
|
304
|
+
// }}
|
|
305
|
+
key={"input"}
|
|
306
|
+
// border={"0px solid"}
|
|
307
|
+
// padding={"0px"}
|
|
308
|
+
inputStyle={{ border: "0px solid", padding: "0px" }}
|
|
309
|
+
inputGroupStyle={{ border: "0px solid", padding: "0px" }}
|
|
310
|
+
onChange={(e) => {
|
|
311
|
+
console.log(e.target.files);
|
|
312
|
+
}}
|
|
313
|
+
/>
|
|
314
|
+
<br />
|
|
315
|
+
<Button
|
|
316
|
+
label="Tosterbutton"
|
|
317
|
+
onClick={handleOnclick}
|
|
318
|
+
width={250}
|
|
319
|
+
variant={"solid"}
|
|
320
|
+
color={"blue"}
|
|
321
|
+
/>
|
|
322
|
+
<br />
|
|
323
|
+
<br />
|
|
324
|
+
<CheckBox label="hello world" />
|
|
325
|
+
<br />
|
|
326
|
+
<br />
|
|
327
|
+
<Button
|
|
328
|
+
label="ModelButton"
|
|
329
|
+
onClick={handleOnclick2}
|
|
330
|
+
width={250}
|
|
331
|
+
variant={"solid"}
|
|
332
|
+
color={"blue"}
|
|
333
|
+
/>
|
|
334
|
+
<br />
|
|
335
|
+
<Modal
|
|
336
|
+
isOpen={isOpen}
|
|
337
|
+
onClose={() => setIsOpen(false)}
|
|
338
|
+
overlaybg={"blackAlpha.300"}
|
|
339
|
+
overlaybackdropFilter={"blur(10px) hue-rotate(90deg)"}
|
|
340
|
+
size={"sm"}
|
|
341
|
+
isCentered={true}
|
|
342
|
+
>
|
|
343
|
+
helldddddlo
|
|
344
|
+
</Modal>
|
|
345
|
+
<br />
|
|
346
|
+
<Select
|
|
347
|
+
options={[
|
|
348
|
+
{ id: 1, label: "mages" },
|
|
349
|
+
{ id: 2, label: "sjdfg" },
|
|
350
|
+
]}
|
|
351
|
+
onChange={handleOnChange}
|
|
352
|
+
value={selected}
|
|
353
|
+
width={200}
|
|
354
|
+
/>
|
|
355
|
+
<br />
|
|
356
|
+
{/* <TextArea label="hello" helperText='Hello' errorMessage='Required' error={true} rows={5} /> */}
|
|
357
|
+
<br />
|
|
358
|
+
<Box width={"150px"}>
|
|
359
|
+
<Skeletons type="skeleton" />
|
|
360
|
+
<br />
|
|
361
|
+
<Skeletons type="circle" />
|
|
362
|
+
<br />
|
|
363
|
+
<Skeletons type="text" mt={4} />
|
|
364
|
+
<br />
|
|
365
|
+
<br />
|
|
366
|
+
<Skeletons
|
|
367
|
+
height="10px"
|
|
368
|
+
isLoaded={false}
|
|
369
|
+
fadeDuration={4}
|
|
370
|
+
bg="blue.500"
|
|
371
|
+
color="white"
|
|
372
|
+
type="skeleton"
|
|
373
|
+
>
|
|
374
|
+
<Box>Hello ChakraUI!</Box>
|
|
375
|
+
</Skeletons>
|
|
376
|
+
</Box>
|
|
377
|
+
<br />
|
|
378
|
+
<br />
|
|
379
|
+
<RadioButton label="dinesh" />
|
|
380
|
+
<br />
|
|
381
|
+
<br />
|
|
382
|
+
<RadioButtonGroup
|
|
383
|
+
options={radioOptions}
|
|
384
|
+
value={selectedValue}
|
|
385
|
+
onChange={handleChange}
|
|
386
|
+
colorScheme="blue"
|
|
387
|
+
size="md"
|
|
388
|
+
/>
|
|
389
|
+
<br />
|
|
390
|
+
<br />
|
|
391
|
+
<ButtonGroupIcon
|
|
392
|
+
buttonText="hello"
|
|
393
|
+
rightIcon={<FiHome />}
|
|
394
|
+
size="md"
|
|
395
|
+
variant="solid"
|
|
396
|
+
color="red"
|
|
397
|
+
/>
|
|
398
|
+
<br /> <br />
|
|
399
|
+
<ProgressBar min={10} max={0} isIndeterminate={true} size="xs" />
|
|
400
|
+
<br />
|
|
401
|
+
<br />
|
|
402
|
+
<NumberInput
|
|
403
|
+
min={0}
|
|
404
|
+
max={20}
|
|
405
|
+
value={numbetInputValue}
|
|
406
|
+
onChange={handleNumberinput}
|
|
407
|
+
/>
|
|
408
|
+
<br />
|
|
409
|
+
<br />
|
|
410
|
+
<PinInputs pins={5} label="Enter pin" />
|
|
411
|
+
<br />
|
|
412
|
+
<br />
|
|
413
|
+
<Card
|
|
414
|
+
align={"center"}
|
|
415
|
+
header={<Heading size="md"> Customer dashboard</Heading>}
|
|
416
|
+
footer={<ChakraButton colorScheme="blue">View here</ChakraButton>}
|
|
417
|
+
>
|
|
418
|
+
<Text>
|
|
419
|
+
View a summary of all your customers over the last month.
|
|
420
|
+
</Text>
|
|
421
|
+
</Card>
|
|
422
|
+
<br />
|
|
423
|
+
<Table
|
|
424
|
+
data={tableData}
|
|
425
|
+
headers={tableDataheader}
|
|
426
|
+
// handleCellClick={(row, header) => {
|
|
427
|
+
// console.log("Cell clicked", row, header);
|
|
428
|
+
// }}
|
|
429
|
+
exportOptions={exportOptions}
|
|
430
|
+
handleExportChange={(value) => {
|
|
431
|
+
console.log("click label", value);
|
|
432
|
+
}}
|
|
433
|
+
isLoading={true}
|
|
434
|
+
loadingContaxt={<Stack spacing={4}>
|
|
435
|
+
<Stack direction="row" justifyContent="space-between" paddingX="4" paddingY="2">
|
|
436
|
+
<Skeleton height="20px" width="10%" />
|
|
437
|
+
<Skeleton height="20px" width="20%" />
|
|
438
|
+
<Skeleton height="20px" width="15%" />
|
|
439
|
+
<Skeleton height="20px" width="25%" />
|
|
440
|
+
<Skeleton height="20px" width="10%" />
|
|
441
|
+
<Skeleton height="20px" width="20%" />
|
|
442
|
+
</Stack>
|
|
443
|
+
{[...Array(5)].map((_, index) => (
|
|
444
|
+
<Stack key={index} direction="row" justifyContent="space-between" paddingX="4" paddingY="2" borderWidth="1px" borderRadius="md">
|
|
445
|
+
<Skeleton height="20px" width="10%" />
|
|
446
|
+
<Skeleton height="20px" width="20%" />
|
|
447
|
+
<Skeleton height="20px" width="15%" />
|
|
448
|
+
<Skeleton height="20px" width="25%" />
|
|
449
|
+
<Skeleton height="20px" width="10%" />
|
|
450
|
+
<Skeleton height="20px" width="20%" />
|
|
451
|
+
</Stack>
|
|
452
|
+
))}
|
|
453
|
+
</Stack>}
|
|
454
|
+
loadingBoxStyle={{ padding: "10px", width: "100%" }}
|
|
455
|
+
/>
|
|
456
|
+
<ToolTip
|
|
457
|
+
label="Hello"
|
|
458
|
+
placement="top"
|
|
459
|
+
hasArrow
|
|
460
|
+
size={"20"}
|
|
461
|
+
width={"300px"}
|
|
462
|
+
height={"100px"}
|
|
463
|
+
bg={"green"}
|
|
464
|
+
>
|
|
465
|
+
hai
|
|
466
|
+
</ToolTip>
|
|
467
|
+
<br />
|
|
468
|
+
<Box>
|
|
469
|
+
<div style={{ display: "flex", justifyContent: "space-around" }}>
|
|
470
|
+
<ApexBarChart
|
|
471
|
+
data={data}
|
|
472
|
+
Labels={categories}
|
|
473
|
+
title="Bar Chart"
|
|
474
|
+
titlePosition="left"
|
|
475
|
+
// barColor={["#00E396"]}
|
|
476
|
+
// xAxisStyle={{ colors: "#00E396", fontSize: "12px" }}
|
|
477
|
+
// yAxisStyle={{ colors: "#00E396", fontSize: "12px" }}
|
|
478
|
+
titleStyle={{ color: "#00E396" }}
|
|
479
|
+
/>
|
|
480
|
+
<ApexPieChart
|
|
481
|
+
data={data}
|
|
482
|
+
labels={categories}
|
|
483
|
+
title="Pie Chart"
|
|
484
|
+
titlePosition="left"
|
|
485
|
+
// chartColor={["#00E396", "#3182ce", "#ff4757", "#ff6348", "#e84393"]}
|
|
486
|
+
titleStyle={{ color: "#00E396" }}
|
|
487
|
+
/>
|
|
488
|
+
</div>
|
|
489
|
+
</Box>
|
|
490
|
+
<br />
|
|
491
|
+
<ProfilePhotoViewer photoUrl="https://bit.ly/dan-abramov" onPhotoChange={(file) => console.log(file)} />
|
|
492
|
+
</Box>
|
|
493
|
+
</Box>
|
|
494
|
+
</Flex>
|
|
495
|
+
</Box>
|
|
496
|
+
);
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
export default Layout;
|