pixelize-design-library 1.0.20 → 1.0.22
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 +3 -2
- package/src/App.tsx +0 -10
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChart.stories.tsx +0 -39
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChart.tsx +0 -80
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChartProps.tsx +0 -20
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChart.stories.tsx +0 -33
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChart.tsx +0 -43
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChartProps.tsx +0 -17
- package/src/Components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -26
- package/src/Components/Breadcrumbs/Breadcrumbs.tsx +0 -26
- package/src/Components/Breadcrumbs/BreadcrumbsProps.tsx +0 -12
- package/src/Components/Button/Button.stories.tsx +0 -32
- package/src/Components/Button/Button.tsx +0 -26
- package/src/Components/Button/ButtonProps.tsx +0 -10
- package/src/Components/ButtonGroupIcon/ButtonGoupIconProps.tsx +0 -14
- package/src/Components/ButtonGroupIcon/ButtonGroupIcon.stories.tsx +0 -37
- package/src/Components/ButtonGroupIcon/ButtonGroupIcon.tsx +0 -26
- package/src/Components/Checkbox/Checkbox.stories.tsx +0 -45
- package/src/Components/Checkbox/Checkbox.tsx +0 -29
- package/src/Components/Checkbox/CheckboxProps.tsx +0 -9
- package/src/Components/Input/TextInput.stories.tsx +0 -45
- package/src/Components/Input/TextInput.tsx +0 -70
- package/src/Components/Input/TextInputProps.tsx +0 -27
- package/src/Components/InputTextArea/InputTextArea.stories.tsx +0 -49
- package/src/Components/InputTextArea/InputTextArea.tsx +0 -36
- package/src/Components/InputTextArea/InputTextAreaProps.tsx +0 -11
- package/src/Components/Loading/Loading.stories.tsx +0 -25
- package/src/Components/Loading/Loading.tsx +0 -38
- package/src/Components/Loading/LoadingProps.tsx +0 -1
- package/src/Components/Modal/Modal.stories.tsx +0 -106
- package/src/Components/Modal/Modal.tsx +0 -45
- package/src/Components/Modal/ModalProps.tsx +0 -12
- package/src/Components/NavigationBar/NavBar.stories.tsx +0 -26
- package/src/Components/NavigationBar/NavigationBar.tsx +0 -56
- package/src/Components/NavigationBar/NavigationBarProps.tsx +0 -13
- package/src/Components/NumberInput/NumberInput.stories.tsx +0 -31
- package/src/Components/NumberInput/NumberInput.tsx +0 -56
- package/src/Components/NumberInput/NumberInputProps.tsx +0 -28
- package/src/Components/PinInput/PinInput.stories.tsx +0 -40
- package/src/Components/PinInput/PinInput.tsx +0 -49
- package/src/Components/PinInput/PinInputProps.tsx +0 -33
- package/src/Components/ProfileCard/ProfileCard.stories.tsx +0 -30
- package/src/Components/ProfileCard/ProfileCard.tsx +0 -59
- package/src/Components/ProfileCard/ProfileCardProps.tsx +0 -41
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewer.stories.tsx +0 -25
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewer.tsx +0 -69
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.tsx +0 -14
- package/src/Components/ProgressBar/ProgressBar.stories.tsx +0 -46
- package/src/Components/ProgressBar/ProgressBar.tsx +0 -33
- package/src/Components/ProgressBar/ProgressBarProps.tsx +0 -7
- package/src/Components/RadioButton/RadioButton.stories.tsx +0 -46
- package/src/Components/RadioButton/RadioButton.tsx +0 -63
- package/src/Components/RadioButton/RadioButtonProps.tsx +0 -10
- package/src/Components/Select/Select.stories.tsx +0 -57
- package/src/Components/Select/Select.tsx +0 -46
- package/src/Components/Select/SelectProps.tsx +0 -15
- package/src/Components/SideBar/SideBar.tsx +0 -143
- package/src/Components/SideBar/SideBarProps.tsx +0 -18
- package/src/Components/SideBar/Sidebar.stories.tsx +0 -80
- package/src/Components/Skeletons/Skeleton.stories.tsx +0 -63
- package/src/Components/Skeletons/SkeletonProps.tsx +0 -23
- package/src/Components/Skeletons/Skeletons.tsx +0 -52
- package/src/Components/Table/Table.stories.tsx +0 -47
- package/src/Components/Table/Table.tsx +0 -517
- package/src/Components/Table/TableProps.tsx +0 -36
- package/src/Components/Toaster/Toaster.stories.tsx +0 -58
- package/src/Components/Toaster/Toaster.tsx +0 -34
- package/src/Components/Toaster/ToasterProps.tsx +0 -15
- package/src/Components/ToolTip/ToolTip.stories.tsx +0 -39
- package/src/Components/ToolTip/ToolTip.tsx +0 -62
- package/src/Components/ToolTip/ToolTipProps.tsx +0 -45
- package/src/Layout.tsx +0 -499
- package/src/Theme/Dark/theme.ts +0 -278
- package/src/Theme/Default/theme.ts +0 -301
- package/src/Theme/index.ts +0 -4
- package/src/bootstrap.tsx +0 -13
- package/src/index.ts +0 -29
- package/src/index.tsx +0 -22
- package/src/types/pixelize-design-library.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixelize-design-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"private": false,
|
|
5
|
-
"main": "dist/index.
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
7
8
|
"dependencies": {
|
|
8
9
|
"@babel/core": "^7.24.5",
|
|
9
10
|
"@chakra-ui/icons": "^2.1.1",
|
package/src/App.tsx
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StoryFn, Meta } from '@storybook/react';
|
|
3
|
-
import ApexBarChart from './ApexBarChart';
|
|
4
|
-
import { ApexBarChartProps } from './ApexBarChartProps';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/ApexCharts/ApexBarChart',
|
|
8
|
-
component: ApexBarChart,
|
|
9
|
-
argTypes: {
|
|
10
|
-
backgroundColor: { control: 'color' },
|
|
11
|
-
},
|
|
12
|
-
} as Meta;
|
|
13
|
-
|
|
14
|
-
const Template: StoryFn<ApexBarChartProps> = (args) => <ApexBarChart {...args} />;
|
|
15
|
-
|
|
16
|
-
export const Primary = Template.bind({});
|
|
17
|
-
Primary.args = {
|
|
18
|
-
data: [44, 55, 41, 64, 22, 43, 21],
|
|
19
|
-
Labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
20
|
-
title: 'Weekly Sales',
|
|
21
|
-
titlePosition: 'left',
|
|
22
|
-
height: 400,
|
|
23
|
-
width: 500,
|
|
24
|
-
barColor: ['#3182ce'],
|
|
25
|
-
xAxisStyle: {
|
|
26
|
-
color: '#ffffff',
|
|
27
|
-
},
|
|
28
|
-
yAxisStyle: {
|
|
29
|
-
color: '#ffffff',
|
|
30
|
-
},
|
|
31
|
-
titleStyle: {
|
|
32
|
-
color: '#3182ce',
|
|
33
|
-
fontSize: '16px',
|
|
34
|
-
fontWeight: 600,
|
|
35
|
-
fontFamily: 'Arial',
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// You can add more variations of the component by adding more exports like the Primary example.
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import ReactApexChart from "react-apexcharts";
|
|
3
|
-
import { ApexOptions } from "apexcharts";
|
|
4
|
-
import { ApexBarChartProps } from "./ApexBarChartProps";
|
|
5
|
-
|
|
6
|
-
export default function ApexBarChart({
|
|
7
|
-
data,
|
|
8
|
-
Labels,
|
|
9
|
-
title,
|
|
10
|
-
titlePosition,
|
|
11
|
-
height = 400,
|
|
12
|
-
width = 500,
|
|
13
|
-
barColor = ["#3182ce"],
|
|
14
|
-
xAxisStyle = {
|
|
15
|
-
color: "#ffffff",
|
|
16
|
-
},
|
|
17
|
-
yAxisStyle = {
|
|
18
|
-
color: "#ffffff",
|
|
19
|
-
},
|
|
20
|
-
titleStyle = {
|
|
21
|
-
color: "#3182ce",
|
|
22
|
-
fontSize: "16px",
|
|
23
|
-
fontWeight: 600,
|
|
24
|
-
fontFamily: "Arial",
|
|
25
|
-
},
|
|
26
|
-
}: ApexBarChartProps) {
|
|
27
|
-
const options: ApexOptions = {
|
|
28
|
-
chart: {
|
|
29
|
-
type: "bar",
|
|
30
|
-
height: 350,
|
|
31
|
-
},
|
|
32
|
-
plotOptions: {
|
|
33
|
-
bar: {
|
|
34
|
-
borderRadius: 4,
|
|
35
|
-
horizontal: false,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
dataLabels: {
|
|
39
|
-
enabled: false,
|
|
40
|
-
style: {
|
|
41
|
-
fontSize: "12px",
|
|
42
|
-
colors: ["#00E396"], //data label color
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
xaxis: {
|
|
46
|
-
categories: Labels,
|
|
47
|
-
labels: {
|
|
48
|
-
style: xAxisStyle,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
yaxis: {
|
|
52
|
-
labels: {
|
|
53
|
-
style: yAxisStyle,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
title: {
|
|
57
|
-
text: title,
|
|
58
|
-
align: titlePosition,
|
|
59
|
-
style: titleStyle,
|
|
60
|
-
},
|
|
61
|
-
colors: barColor, //bar color
|
|
62
|
-
};
|
|
63
|
-
const series = [
|
|
64
|
-
{
|
|
65
|
-
name: "Data",
|
|
66
|
-
data: data,
|
|
67
|
-
},
|
|
68
|
-
];
|
|
69
|
-
return (
|
|
70
|
-
<div>
|
|
71
|
-
<ReactApexChart
|
|
72
|
-
options={options}
|
|
73
|
-
series={series}
|
|
74
|
-
type="bar"
|
|
75
|
-
height={height}
|
|
76
|
-
width={width}
|
|
77
|
-
/>
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ApexOptions } from "apexcharts";
|
|
2
|
-
export type ApexBarChartProps = {
|
|
3
|
-
data: number[];
|
|
4
|
-
Labels: string[];
|
|
5
|
-
title?: string;
|
|
6
|
-
titlePosition?: 'left' | 'center' | 'right';
|
|
7
|
-
height?: number;
|
|
8
|
-
width?: number;
|
|
9
|
-
barColor?: string[];
|
|
10
|
-
xAxisStyle?: StyleProps;
|
|
11
|
-
yAxisStyle?: StyleProps;
|
|
12
|
-
titleStyle?: StyleProps;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type StyleProps = {
|
|
16
|
-
fontSize?: string
|
|
17
|
-
fontFamily?: string
|
|
18
|
-
fontWeight?: string | number
|
|
19
|
-
color?: string
|
|
20
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StoryFn, Meta } from '@storybook/react';
|
|
3
|
-
import ApexPieChart from './ApexPieChart';
|
|
4
|
-
import { ApexPieChartProps } from './ApexPieChartProps';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/ApexCharts/ApexPieChart',
|
|
8
|
-
component: ApexPieChart,
|
|
9
|
-
argTypes: {
|
|
10
|
-
backgroundColor: { control: 'color' },
|
|
11
|
-
},
|
|
12
|
-
} as Meta;
|
|
13
|
-
|
|
14
|
-
const Template: StoryFn<ApexPieChartProps> = (args) => <ApexPieChart {...args} />;
|
|
15
|
-
|
|
16
|
-
export const Primary = Template.bind({});
|
|
17
|
-
Primary.args = {
|
|
18
|
-
data: [44, 55, 41, 64, 22, 43, 21],
|
|
19
|
-
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
20
|
-
title: 'Weekly Sales',
|
|
21
|
-
titlePosition: 'left',
|
|
22
|
-
height: 400,
|
|
23
|
-
width: 500,
|
|
24
|
-
chartColor: ['#3182ce', '#ff6384', '#36a2eb', '#cc65fe', '#ffce56', '#ff6384', '#36a2eb'],
|
|
25
|
-
titleStyle: {
|
|
26
|
-
color: '#3182ce',
|
|
27
|
-
fontSize: '16px',
|
|
28
|
-
fontWeight: 600,
|
|
29
|
-
fontFamily: 'Arial',
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// You can add more variations of the component by adding more exports like the Primary example.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ApexOptions } from "apexcharts";
|
|
3
|
-
import ReactApexChart from "react-apexcharts";
|
|
4
|
-
import { ApexPieChartProps } from "./ApexPieChartProps";
|
|
5
|
-
|
|
6
|
-
export default function ApexPieChart({
|
|
7
|
-
data,
|
|
8
|
-
labels,
|
|
9
|
-
title,
|
|
10
|
-
titlePosition,
|
|
11
|
-
height = 400,
|
|
12
|
-
width = 500,
|
|
13
|
-
chartColor,
|
|
14
|
-
titleStyle = {
|
|
15
|
-
color: "#3182ce",
|
|
16
|
-
},
|
|
17
|
-
}: ApexPieChartProps) {
|
|
18
|
-
const options: ApexOptions = {
|
|
19
|
-
chart: {
|
|
20
|
-
type: "pie",
|
|
21
|
-
height: 350,
|
|
22
|
-
},
|
|
23
|
-
labels: labels,
|
|
24
|
-
title: {
|
|
25
|
-
text: title,
|
|
26
|
-
align: titlePosition,
|
|
27
|
-
style: titleStyle,
|
|
28
|
-
},
|
|
29
|
-
colors: chartColor,
|
|
30
|
-
};
|
|
31
|
-
const series = data;
|
|
32
|
-
return (
|
|
33
|
-
<div>
|
|
34
|
-
<ReactApexChart
|
|
35
|
-
options={options}
|
|
36
|
-
series={series}
|
|
37
|
-
type="pie"
|
|
38
|
-
height={height}
|
|
39
|
-
width={width}
|
|
40
|
-
/>
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type ApexPieChartProps = {
|
|
2
|
-
data: number[];
|
|
3
|
-
labels: string[];
|
|
4
|
-
title?: string;
|
|
5
|
-
titlePosition?: 'left' | 'center' | 'right';
|
|
6
|
-
height?: number;
|
|
7
|
-
width?: number;
|
|
8
|
-
chartColor?: string[];
|
|
9
|
-
titleStyle?: StyleProps;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
type StyleProps = {
|
|
13
|
-
fontSize?: string
|
|
14
|
-
fontFamily?: string
|
|
15
|
-
fontWeight?: string | number
|
|
16
|
-
color?: string
|
|
17
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
3
|
-
import Breadcrumbs from './Breadcrumbs';
|
|
4
|
-
import { BreadcrumbsProps } from './BreadcrumbsProps';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Breadcrumbs/Breadcrumb',
|
|
8
|
-
component: Breadcrumbs,
|
|
9
|
-
} as Meta;
|
|
10
|
-
|
|
11
|
-
const Template: StoryFn<BreadcrumbsProps> = (args) => <Breadcrumbs {...args} />;
|
|
12
|
-
|
|
13
|
-
export const Default = Template.bind({});
|
|
14
|
-
Default.args = {
|
|
15
|
-
spacing: "8px",
|
|
16
|
-
separator: "/",
|
|
17
|
-
fontWeight: "normal",
|
|
18
|
-
fontSize: "1rem",
|
|
19
|
-
isCurrentPage: true,
|
|
20
|
-
handleClick: (path) => console.log(`Clicked: ${path}`),
|
|
21
|
-
items: [
|
|
22
|
-
{ path: '/home', label: 'Home' },
|
|
23
|
-
{ path: '/about', label: 'About' },
|
|
24
|
-
{ path: '/contact', label: 'Contact' },
|
|
25
|
-
],
|
|
26
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, ChakraProvider } from "@chakra-ui/react";
|
|
3
|
-
import { BreadcrumbsProps } from "./BreadcrumbsProps";
|
|
4
|
-
|
|
5
|
-
export default function Breadcrumbs({ spacing, separator, fontWeight, fontSize, isCurrentPage, handleClick, items }: BreadcrumbsProps) {
|
|
6
|
-
return (
|
|
7
|
-
<ChakraProvider>
|
|
8
|
-
<Breadcrumb spacing={spacing} separator={separator} fontWeight={fontWeight} fontSize={fontSize}>
|
|
9
|
-
{items.map((item, index) => (
|
|
10
|
-
<BreadcrumbItem key={index} isCurrentPage={isCurrentPage && index === items.length - 1}>
|
|
11
|
-
<BreadcrumbLink
|
|
12
|
-
href={item.path}
|
|
13
|
-
sx={{ '&:hover, &:active': { textDecoration: 'none' } }}
|
|
14
|
-
onClick={(event) => {
|
|
15
|
-
event.preventDefault();
|
|
16
|
-
handleClick(item.path);
|
|
17
|
-
}}
|
|
18
|
-
>
|
|
19
|
-
{item.label}
|
|
20
|
-
</BreadcrumbLink>
|
|
21
|
-
</BreadcrumbItem>
|
|
22
|
-
))}
|
|
23
|
-
</Breadcrumb>
|
|
24
|
-
</ChakraProvider>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BreadcrumbProps } from "@chakra-ui/react";
|
|
2
|
-
|
|
3
|
-
export type BreadcrumbsProps = Pick<BreadcrumbProps, "spacing" | "separator" | "fontWeight" | "fontSize"> & {
|
|
4
|
-
isCurrentPage?: boolean;
|
|
5
|
-
isLastChild?: boolean;
|
|
6
|
-
handleClick: (path: string) => void;
|
|
7
|
-
items: BreadcrumbItem[];
|
|
8
|
-
};
|
|
9
|
-
export type BreadcrumbItem = {
|
|
10
|
-
path: string;
|
|
11
|
-
label: string;
|
|
12
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import Button from './Button';
|
|
4
|
-
import { fn } from '@storybook/test';
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Button> = {
|
|
7
|
-
title: 'Components/Button/Button',
|
|
8
|
-
component: Button,
|
|
9
|
-
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'centered',
|
|
12
|
-
},
|
|
13
|
-
tags: ['autodocs']
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const Primary: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
label: 'Button',
|
|
22
|
-
width: '',
|
|
23
|
-
color: 'blue',
|
|
24
|
-
variant: 'solid',
|
|
25
|
-
size: 'md',
|
|
26
|
-
isDisabled: false,
|
|
27
|
-
isLoading: false,
|
|
28
|
-
loadingText: 'Loading',
|
|
29
|
-
type: 'button',
|
|
30
|
-
onClick: fn()
|
|
31
|
-
},
|
|
32
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button as ChakraButton, ChakraProvider, } from '@chakra-ui/react';
|
|
3
|
-
import { ButtonProps } from './ButtonProps';
|
|
4
|
-
|
|
5
|
-
export default function Button({
|
|
6
|
-
label,
|
|
7
|
-
width = "120px",
|
|
8
|
-
onClick,
|
|
9
|
-
color,
|
|
10
|
-
variant,
|
|
11
|
-
leftIcon,
|
|
12
|
-
rightIcon,
|
|
13
|
-
size,
|
|
14
|
-
isDisabled = false,
|
|
15
|
-
isLoading = false,
|
|
16
|
-
loadingText = "Loading",
|
|
17
|
-
type
|
|
18
|
-
}: ButtonProps) {
|
|
19
|
-
return (
|
|
20
|
-
<ChakraProvider>
|
|
21
|
-
<ChakraButton type={type} onClick={onClick} width={width} colorScheme={color} variant={variant} size={size} isLoading={isLoading} isDisabled={isDisabled} loadingText={loadingText} leftIcon={leftIcon} rightIcon={rightIcon} >
|
|
22
|
-
{label}
|
|
23
|
-
</ChakraButton>
|
|
24
|
-
</ChakraProvider>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ButtonProps as ChakraButtonProps } from "@chakra-ui/react";
|
|
2
|
-
|
|
3
|
-
export type ButtonProps = Pick<ChakraButtonProps, "onClick" | "leftIcon" | "rightIcon" | "isDisabled" | "isLoading" | "loadingText" | "colorScheme" | "spinner"> & {
|
|
4
|
-
label?: string,
|
|
5
|
-
width?: string | number,
|
|
6
|
-
size?: "lg" | "md" | "sm" | "xs",
|
|
7
|
-
variant?: "solid" | "outline" | "ghost" | "link" | "unstyled",
|
|
8
|
-
color?: "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "whiteAlpha" | "blackAlpha",
|
|
9
|
-
type?: "button" | "submit" | "reset",
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
|
|
3
|
-
export type ButtonGroupIconProps = {
|
|
4
|
-
leftIcon?: ReactElement,
|
|
5
|
-
rightIcon?: ReactElement,
|
|
6
|
-
onLeftIconClick?: () => void;
|
|
7
|
-
onRightIconClick?: () => void;
|
|
8
|
-
buttonText: string,
|
|
9
|
-
onButtonClick?: () => void,
|
|
10
|
-
onButtongroupClick?: () => void,
|
|
11
|
-
size?: "lg" | "md" | "sm" | "xs",
|
|
12
|
-
variant?: "solid" | "outline" | "ghost" | "link" | "unstyled",
|
|
13
|
-
color?: "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "whiteAlpha" | "blackAlpha",
|
|
14
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
-
import ButtonGroupIcon from './ButtonGroupIcon'; // Adjust the import path and component type if needed
|
|
4
|
-
import {ButtonGroupIconProps} from './ButtonGoupIconProps';
|
|
5
|
-
import { FiHome } from 'react-icons/fi';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Components/ButtonGroupIcon/ButtonGroupIcon',
|
|
9
|
-
component: ButtonGroupIcon,
|
|
10
|
-
argTypes: {
|
|
11
|
-
size: { control: { type: 'select', options: ['sm', 'md', 'lg'] } },
|
|
12
|
-
variant: {
|
|
13
|
-
control: { type: 'select', options: ["solid","outline","ghost","link"] },
|
|
14
|
-
defaultValue: 'solid'
|
|
15
|
-
},
|
|
16
|
-
color: {
|
|
17
|
-
control: { type: 'select', options: ["gray" ,"red" ,"orange" ,"yellow" ,"green" ,"teal" ,"blue" ,"cyan" ,"purple" ,"pink" ,"whiteAlpha" ,"blackAlpha"] },
|
|
18
|
-
defaultValue: 'blue'
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
} as Meta;
|
|
22
|
-
|
|
23
|
-
const Template: StoryFn<ButtonGroupIconProps> = (args) => <ButtonGroupIcon {...args} />;
|
|
24
|
-
|
|
25
|
-
export const Default = Template.bind({});
|
|
26
|
-
Default.args = {
|
|
27
|
-
leftIcon: <FiHome/>,
|
|
28
|
-
rightIcon: <FiHome />,
|
|
29
|
-
onLeftIconClick: () => console.log('Left icon clicked'),
|
|
30
|
-
onRightIconClick: () => console.log('Right icon clicked'),
|
|
31
|
-
buttonText: 'Button Text',
|
|
32
|
-
onButtonClick: () => console.log('Button clicked'),
|
|
33
|
-
onButtongroupClick: () => console.log('Button group clicked'),
|
|
34
|
-
size: 'md',
|
|
35
|
-
variant: 'solid',
|
|
36
|
-
color: 'blue',
|
|
37
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, ButtonGroup, ChakraProvider, IconButton } from "@chakra-ui/react";
|
|
3
|
-
import { ButtonGroupIconProps } from "./ButtonGoupIconProps";
|
|
4
|
-
|
|
5
|
-
export default function ButtonGroupIcon({
|
|
6
|
-
leftIcon,
|
|
7
|
-
rightIcon,
|
|
8
|
-
onLeftIconClick,
|
|
9
|
-
onRightIconClick,
|
|
10
|
-
buttonText,
|
|
11
|
-
onButtonClick,
|
|
12
|
-
onButtongroupClick,
|
|
13
|
-
size,
|
|
14
|
-
variant,
|
|
15
|
-
color
|
|
16
|
-
}: ButtonGroupIconProps) {
|
|
17
|
-
return (
|
|
18
|
-
<ChakraProvider>
|
|
19
|
-
<ButtonGroup size={size} isAttached variant={variant} onClick={onButtongroupClick} colorScheme={color}>
|
|
20
|
-
{leftIcon && <IconButton aria-label='Left icon button' icon={leftIcon} onClick={onLeftIconClick} />}
|
|
21
|
-
<Button onClick={onButtonClick}>{buttonText}</Button>
|
|
22
|
-
{rightIcon && <IconButton aria-label='Right icon button' icon={rightIcon} onClick={onRightIconClick} />}
|
|
23
|
-
</ButtonGroup>
|
|
24
|
-
</ChakraProvider>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import CheckBox from './Checkbox';
|
|
4
|
-
import { fn } from '@storybook/test';
|
|
5
|
-
import { CheckboxProps } from './CheckboxProps';
|
|
6
|
-
|
|
7
|
-
const meta: Meta<typeof CheckBox> = {
|
|
8
|
-
title: 'Components/CheckBox/CheckBox',
|
|
9
|
-
component: CheckBox,
|
|
10
|
-
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: 'centered',
|
|
13
|
-
},
|
|
14
|
-
tags: ['autodocs']
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
const CheckBoxTemplate = (args: CheckboxProps) => {
|
|
21
|
-
const [check, setCheck] = useState(true);
|
|
22
|
-
const handleCheck = (e: any) => {
|
|
23
|
-
setCheck(!check);
|
|
24
|
-
}
|
|
25
|
-
return <CheckBox {...args} onChange={handleCheck} isChecked={check} />
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const Check_box: Story = {
|
|
29
|
-
args: {
|
|
30
|
-
label: 'Checkbox',
|
|
31
|
-
spacing: 6,
|
|
32
|
-
isInvalid: false,
|
|
33
|
-
color: 'blue',
|
|
34
|
-
iconColor: 'white',
|
|
35
|
-
iconSize: '1em',
|
|
36
|
-
isChecked: true,
|
|
37
|
-
isIndeterminate: false,
|
|
38
|
-
isDisabled: false,
|
|
39
|
-
size: 'md',
|
|
40
|
-
value: 'checkbox',
|
|
41
|
-
defaultChecked: false,
|
|
42
|
-
onChange: fn()
|
|
43
|
-
},
|
|
44
|
-
render: (args) => CheckBoxTemplate(args)
|
|
45
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { Checkbox as ChakraCheckbox, ChakraProvider, } from '@chakra-ui/react';
|
|
3
|
-
import { CheckboxProps } from './CheckboxProps';
|
|
4
|
-
|
|
5
|
-
const CheckBox: FC<CheckboxProps> = ({
|
|
6
|
-
label,
|
|
7
|
-
spacing,
|
|
8
|
-
isInvalid,
|
|
9
|
-
color,
|
|
10
|
-
iconColor,
|
|
11
|
-
iconSize,
|
|
12
|
-
isChecked,
|
|
13
|
-
isIndeterminate,
|
|
14
|
-
onChange,
|
|
15
|
-
isDisabled,
|
|
16
|
-
size,
|
|
17
|
-
value,
|
|
18
|
-
defaultChecked
|
|
19
|
-
}) => {
|
|
20
|
-
return (
|
|
21
|
-
<ChakraProvider>
|
|
22
|
-
<ChakraCheckbox spacing={spacing} isInvalid={isInvalid} colorScheme={color} iconColor={iconColor} iconSize={iconSize} isChecked={isChecked} isIndeterminate={isIndeterminate} onChange={onChange} isDisabled={isDisabled} size={size} value={value} defaultChecked={defaultChecked}>
|
|
23
|
-
{label}
|
|
24
|
-
</ChakraCheckbox>
|
|
25
|
-
</ChakraProvider>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default CheckBox;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CheckboxProps as ChakraButtonProps } from "@chakra-ui/react";
|
|
2
|
-
|
|
3
|
-
export type CheckboxProps = Pick<ChakraButtonProps, 'spacing' | 'isInvalid' | 'size' | 'iconColor' | 'iconSize' | 'isChecked' | 'isIndeterminate' | 'onChange' | 'isDisabled' | 'value' | 'defaultChecked'> & {
|
|
4
|
-
label?: string;
|
|
5
|
-
width?: string | number;
|
|
6
|
-
variant?: "solid" | "outline" | "ghost" | "link" | "unstyled";
|
|
7
|
-
color?: "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "whiteAlpha" | "blackAlpha";
|
|
8
|
-
size?: "sm" | "md" | "lg";
|
|
9
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
4
|
-
import { TextInputProps } from './TextInputProps';
|
|
5
|
-
import TextInput from './TextInput';
|
|
6
|
-
import { useState } from 'react';
|
|
7
|
-
|
|
8
|
-
const meta: Meta<typeof TextInput> = {
|
|
9
|
-
title: 'Components/Input/TextInput',
|
|
10
|
-
component: TextInput,
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: 'centered',
|
|
13
|
-
},
|
|
14
|
-
tags: ['autodocs'],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
const TextInputTemplate = (args: TextInputProps) => {
|
|
21
|
-
const [value, setValue] = useState("");
|
|
22
|
-
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
23
|
-
setValue(e.target.value);
|
|
24
|
-
}
|
|
25
|
-
return <TextInput {...args} onChange={handleChange} value={value} />
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const Primary: Story = {
|
|
29
|
-
args: {
|
|
30
|
-
label: 'Button',
|
|
31
|
-
onChange: fn(),
|
|
32
|
-
onBlur: fn(),
|
|
33
|
-
onFocus: fn(),
|
|
34
|
-
isDisabled: false,
|
|
35
|
-
isReadOnly: false,
|
|
36
|
-
isRequired: false,
|
|
37
|
-
value: "",
|
|
38
|
-
placeholder: "Placeholder",
|
|
39
|
-
width: 500,
|
|
40
|
-
error: true,
|
|
41
|
-
errorMessage: "jhkjhkjh",
|
|
42
|
-
helperText: ""
|
|
43
|
-
},
|
|
44
|
-
render: (args) => TextInputTemplate(args)
|
|
45
|
-
};
|