norma-library 0.4.8 → 0.5.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/.babelrc.json +1 -1
- package/.husky/commit-msg +4 -0
- package/.prettierignore +11 -0
- package/.prettierrc.json +20 -0
- package/CHANGELOG.md +0 -0
- package/CONTRIBUTING.md +0 -0
- package/README.md +42 -0
- package/commitlint.config.js +1 -0
- package/dist/Button/index.d.ts +9 -0
- package/dist/Button/types.d.ts +18 -0
- package/dist/Card/Card.d.ts +3 -0
- package/dist/Card/CardHeader.d.ts +3 -0
- package/dist/Card/index.d.ts +4 -0
- package/dist/Card/styles.d.ts +546 -0
- package/dist/Card/types.d.ts +8 -0
- package/dist/esm/components/Accordion.d.ts +2 -2
- package/dist/esm/components/Accordion.js +8 -8
- package/dist/esm/components/Accordion.js.map +1 -1
- package/dist/esm/components/Avatar.d.ts +2 -2
- package/dist/esm/components/Avatar.js +7 -7
- package/dist/esm/components/Avatar.js.map +1 -1
- package/dist/esm/components/Badge.d.ts +2 -2
- package/dist/esm/components/Badge.js +5 -5
- package/dist/esm/components/Badge.js.map +1 -1
- package/dist/esm/components/Button.d.ts +2 -2
- package/dist/esm/components/Button.js +10 -10
- package/dist/esm/components/Button.js.map +1 -1
- package/dist/esm/components/Card.d.ts +3 -3
- package/dist/esm/components/Card.js +8 -8
- package/dist/esm/components/Card.js.map +1 -1
- package/dist/esm/components/ChatMessage.d.ts +2 -2
- package/dist/esm/components/ChatMessage.js +35 -35
- package/dist/esm/components/ChatMessage.js.map +1 -1
- package/dist/esm/components/CheckBox.d.ts +2 -2
- package/dist/esm/components/CheckBox.js +5 -5
- package/dist/esm/components/CheckBox.js.map +1 -1
- package/dist/esm/components/DataGrid/base/dropdown.d.ts +4 -0
- package/dist/esm/components/DataGrid/base/dropdown.js +126 -0
- package/dist/esm/components/DataGrid/base/dropdown.js.map +1 -0
- package/dist/esm/components/DataGrid/base/number-filter.d.ts +4 -0
- package/dist/esm/components/DataGrid/base/number-filter.js +30 -0
- package/dist/esm/components/DataGrid/base/number-filter.js.map +1 -0
- package/dist/esm/components/DataGrid/base/sorting.d.ts +5 -0
- package/dist/esm/components/DataGrid/base/sorting.js +15 -0
- package/dist/esm/components/DataGrid/base/sorting.js.map +1 -0
- package/dist/esm/components/DataGrid/icons.d.ts +4 -0
- package/dist/esm/components/DataGrid/icons.js +15 -0
- package/dist/esm/components/DataGrid/icons.js.map +1 -0
- package/dist/esm/components/DataGrid/index.d.ts +5 -0
- package/dist/esm/components/DataGrid/index.js +137 -0
- package/dist/esm/components/DataGrid/index.js.map +1 -0
- package/dist/esm/components/DataGrid/shared.d.ts +20 -0
- package/dist/esm/components/DataGrid/shared.js +128 -0
- package/dist/esm/components/DataGrid/shared.js.map +1 -0
- package/dist/esm/components/DataGrid/styled.d.ts +10 -0
- package/dist/esm/components/DataGrid/styled.js +73 -0
- package/dist/esm/components/DataGrid/styled.js.map +1 -0
- package/dist/esm/components/DatePicker.d.ts +5 -5
- package/dist/esm/components/DatePicker.js +37 -37
- package/dist/esm/components/DatePicker.js.map +1 -1
- package/dist/esm/components/DropDown.d.ts +2 -2
- package/dist/esm/components/DropDown.js +6 -6
- package/dist/esm/components/DropDown.js.map +1 -1
- package/dist/esm/components/IconButton.d.ts +2 -2
- package/dist/esm/components/IconButton.js +7 -7
- package/dist/esm/components/IconButton.js.map +1 -1
- package/dist/esm/components/Icons.d.ts +2 -2
- package/dist/esm/components/Icons.js +10 -10
- package/dist/esm/components/Icons.js.map +1 -1
- package/dist/esm/components/Modal.d.ts +2 -2
- package/dist/esm/components/Modal.js +8 -8
- package/dist/esm/components/Modal.js.map +1 -1
- package/dist/esm/components/Paper.d.ts +2 -2
- package/dist/esm/components/Paper.js +5 -5
- package/dist/esm/components/Paper.js.map +1 -1
- package/dist/esm/components/ProgressBar.d.ts +2 -2
- package/dist/esm/components/ProgressBar.js +11 -11
- package/dist/esm/components/ProgressBar.js.map +1 -1
- package/dist/esm/components/RadioGroup.d.ts +2 -2
- package/dist/esm/components/RadioGroup.js +7 -7
- package/dist/esm/components/RadioGroup.js.map +1 -1
- package/dist/esm/components/RangerSlider.d.ts +2 -2
- package/dist/esm/components/RangerSlider.js +31 -31
- package/dist/esm/components/RangerSlider.js.map +1 -1
- package/dist/esm/components/Select.d.ts +2 -2
- package/dist/esm/components/Select.js +14 -14
- package/dist/esm/components/Select.js.map +1 -1
- package/dist/esm/components/Svgs.d.ts +1 -1
- package/dist/esm/components/Svgs.js +1 -1
- package/dist/esm/components/Svgs.js.map +1 -1
- package/dist/esm/components/Tabs.d.ts +2 -2
- package/dist/esm/components/Tabs.js +25 -26
- package/dist/esm/components/Tabs.js.map +1 -1
- package/dist/esm/components/Tag.d.ts +2 -2
- package/dist/esm/components/Tag.js +8 -8
- package/dist/esm/components/Tag.js.map +1 -1
- package/dist/esm/components/TextField.d.ts +2 -2
- package/dist/esm/components/TextField.js +8 -8
- package/dist/esm/components/TextField.js.map +1 -1
- package/dist/esm/components/TimeLine.d.ts +2 -2
- package/dist/esm/components/TimeLine.js +20 -20
- package/dist/esm/components/TimeLine.js.map +1 -1
- package/dist/esm/components/TimePicker.d.ts +8 -8
- package/dist/esm/components/TimePicker.js +43 -43
- package/dist/esm/components/TimePicker.js.map +1 -1
- package/dist/esm/components/index.d.ts +23 -22
- package/dist/esm/components/index.js +23 -22
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/helpers/alignments.js +7 -7
- package/dist/esm/helpers/borders.js +11 -11
- package/dist/esm/helpers/colors.js +41 -41
- package/dist/esm/helpers/index.d.ts +5 -5
- package/dist/esm/helpers/index.js +5 -5
- package/dist/esm/helpers/sizes.d.ts +1 -1
- package/dist/esm/helpers/sizes.js +39 -39
- package/dist/esm/helpers/sizes.js.map +1 -1
- package/dist/esm/index.d.ts +17 -17
- package/dist/esm/index.js +17 -17
- package/dist/esm/interfaces/Accordion.d.ts +3 -3
- package/dist/esm/interfaces/Avatar.d.ts +6 -6
- package/dist/esm/interfaces/Badge.d.ts +7 -7
- package/dist/esm/interfaces/Button.d.ts +5 -5
- package/dist/esm/interfaces/Card.d.ts +3 -3
- package/dist/esm/interfaces/ChatMessage.d.ts +1 -1
- package/dist/esm/interfaces/CheckBox.d.ts +10 -10
- package/dist/esm/interfaces/DataGrid.d.ts +40 -0
- package/dist/esm/interfaces/DataGrid.js +2 -0
- package/dist/esm/interfaces/DataGrid.js.map +1 -0
- package/dist/esm/interfaces/DatePicker.d.ts +3 -3
- package/dist/esm/interfaces/DropDown.d.ts +4 -4
- package/dist/esm/interfaces/IconButton.d.ts +5 -5
- package/dist/esm/interfaces/Icons.d.ts +3 -3
- package/dist/esm/interfaces/Modal.d.ts +3 -3
- package/dist/esm/interfaces/Paper.d.ts +4 -4
- package/dist/esm/interfaces/ProgressBar.d.ts +5 -5
- package/dist/esm/interfaces/RadioGroup.d.ts +4 -4
- package/dist/esm/interfaces/RangerSlider.d.ts +8 -8
- package/dist/esm/interfaces/Select.d.ts +3 -3
- package/dist/esm/interfaces/Tabs.d.ts +3 -3
- package/dist/esm/interfaces/Tag.d.ts +5 -5
- package/dist/esm/interfaces/TextField.d.ts +12 -12
- package/dist/esm/interfaces/TimeLine.d.ts +3 -3
- package/dist/esm/interfaces/TimePicker.d.ts +3 -3
- package/dist/esm/interfaces/index.d.ts +23 -22
- package/dist/esm/interfaces/index.js +23 -22
- package/dist/esm/interfaces/index.js.map +1 -1
- package/dist/esm/types/index.d.ts +41 -40
- package/dist/esm/types/index.js +2 -2
- package/dist/esm/types/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +6992 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +266 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/docs/index.md +118 -0
- package/package.json +65 -9
- package/src/components/Accordion.tsx +47 -64
- package/src/components/Avatar.tsx +22 -29
- package/src/components/Badge.tsx +19 -22
- package/src/components/Button.tsx +12 -19
- package/src/components/Card.tsx +44 -47
- package/src/components/ChatMessage.tsx +87 -89
- package/src/components/CheckBox.tsx +8 -19
- package/src/components/DataGrid/allData.json +2918 -0
- package/src/components/DataGrid/base/dropdown.tsx +212 -0
- package/src/components/DataGrid/base/number-filter.tsx +43 -0
- package/src/components/DataGrid/base/sorting.tsx +29 -0
- package/src/components/DataGrid/icons.tsx +53 -0
- package/src/components/DataGrid/index.tsx +254 -0
- package/src/components/DataGrid/shared.ts +154 -0
- package/src/components/DataGrid/styled.ts +96 -0
- package/src/components/DataGrid/styles/dropdown.module.css +86 -0
- package/src/components/DataGrid/styles/number-filter.module.css +16 -0
- package/src/components/DataGrid/styles/styles.module.css +107 -0
- package/src/components/DatePicker.tsx +73 -84
- package/src/components/DropDown.tsx +31 -38
- package/src/components/IconButton.tsx +12 -29
- package/src/components/Icons.tsx +82 -87
- package/src/components/Modal.tsx +114 -123
- package/src/components/Paper.tsx +19 -22
- package/src/components/ProgressBar.tsx +54 -63
- package/src/components/RadioGroup.tsx +47 -55
- package/src/components/RangerSlider.tsx +70 -81
- package/src/components/Select.tsx +82 -98
- package/src/components/Svgs.tsx +498 -522
- package/src/components/Tabs.tsx +111 -140
- package/src/components/Tag.tsx +37 -45
- package/src/components/TextField.tsx +11 -22
- package/src/components/TimeLine.tsx +93 -103
- package/src/components/TimePicker.tsx +84 -95
- package/src/components/index.ts +23 -22
- package/src/helpers/alignments.ts +7 -7
- package/src/helpers/borders.ts +11 -11
- package/src/helpers/colors.ts +42 -42
- package/src/helpers/index.ts +5 -5
- package/src/helpers/sizes.ts +39 -46
- package/src/index.ts +17 -17
- package/src/interfaces/Accordion.ts +12 -12
- package/src/interfaces/Avatar.tsx +15 -18
- package/src/interfaces/Badge.ts +19 -32
- package/src/interfaces/Button.ts +5 -10
- package/src/interfaces/Card.ts +11 -11
- package/src/interfaces/ChatMessage.ts +12 -12
- package/src/interfaces/CheckBox.ts +12 -18
- package/src/interfaces/DataGrid.ts +46 -0
- package/src/interfaces/DatePicker.ts +13 -13
- package/src/interfaces/DropDown.ts +14 -14
- package/src/interfaces/IconButton.ts +5 -10
- package/src/interfaces/Icons.ts +17 -17
- package/src/interfaces/Modal.ts +15 -15
- package/src/interfaces/Paper.ts +12 -12
- package/src/interfaces/ProgressBar.ts +18 -25
- package/src/interfaces/RadioGroup.ts +22 -28
- package/src/interfaces/RangerSlider.ts +21 -32
- package/src/interfaces/Select.ts +17 -17
- package/src/interfaces/Tabs.ts +19 -24
- package/src/interfaces/Tag.ts +17 -17
- package/src/interfaces/TextField.ts +14 -34
- package/src/interfaces/TimeLine.ts +11 -16
- package/src/interfaces/TimePicker.ts +13 -13
- package/src/interfaces/index.ts +23 -22
- package/src/sample-data.json +178 -0
- package/src/stories/Accordion.stories.tsx +65 -65
- package/src/stories/Avatar.stories.tsx +123 -139
- package/src/stories/Badge.stories.tsx +39 -47
- package/src/stories/Button.stories.tsx +18 -26
- package/src/stories/Card.stories.tsx +40 -55
- package/src/stories/ChatMessage.stories.tsx +84 -85
- package/src/stories/CheckBox.stories.tsx +17 -23
- package/src/stories/DataGrid.stories.tsx +28 -0
- package/src/stories/DatePicker.stories.tsx +50 -77
- package/src/stories/DropDown.stories.tsx +57 -57
- package/src/stories/IconButton.stories.tsx +78 -114
- package/src/stories/Modal.stories.tsx +190 -190
- package/src/stories/Paper.stories.tsx +53 -53
- package/src/stories/ProgressBar.stories.tsx +95 -139
- package/src/stories/RadioGroup.stories.tsx +21 -28
- package/src/stories/RangerSlider.stories.tsx +58 -68
- package/src/stories/Select.stories.tsx +100 -128
- package/src/stories/Tabs.stories.tsx +62 -62
- package/src/stories/Tag.stories.tsx +56 -74
- package/src/stories/TextField.stories.tsx +54 -189
- package/src/stories/TimeLine.stories.tsx +35 -43
- package/src/stories/TimePicker.stories.tsx +87 -113
- package/src/types/index.ts +92 -154
- package/tsconfig.json +1 -1
- package/buildcache/front-end +0 -1
- package/norma-library.tar +0 -0
- package/postcss.config.js +0 -6
- package/tailwind.config.js +0 -58
|
@@ -1,85 +1,84 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
|
|
3
|
-
import type { Meta } from
|
|
4
|
-
import { ChatMessage, Icons, Avatar } from
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title:
|
|
8
|
-
component: ChatMessage,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout:
|
|
11
|
-
},
|
|
12
|
-
tags: [
|
|
13
|
-
argTypes: {},
|
|
14
|
-
} satisfies Meta<typeof ChatMessage>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
|
|
18
|
-
const chat = [
|
|
19
|
-
{
|
|
20
|
-
send:
|
|
21
|
-
name:
|
|
22
|
-
message:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react';
|
|
4
|
+
import { ChatMessage, Icons, Avatar } from '../components';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Display/ChatMessage',
|
|
8
|
+
component: ChatMessage,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
argTypes: {},
|
|
14
|
+
} satisfies Meta<typeof ChatMessage>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
const chat = [
|
|
19
|
+
{
|
|
20
|
+
send: 'me',
|
|
21
|
+
name: 'Alice',
|
|
22
|
+
message: 'Olá, tudo bem? Meu nome é Alice e falo em nome do banco Bradesco. Eu gostaria de falar com Bob',
|
|
23
|
+
time: '09:50',
|
|
24
|
+
emotion: (
|
|
25
|
+
<Avatar
|
|
26
|
+
sx={{
|
|
27
|
+
backgroundColor: '#FFF',
|
|
28
|
+
border: '1px solid rgb(255, 195, 0)',
|
|
29
|
+
m: '5px',
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<Icons icon="faceNeutral" scale="large" color="warning" />
|
|
33
|
+
</Avatar>
|
|
34
|
+
),
|
|
35
|
+
emotionReplay: (
|
|
36
|
+
<Avatar
|
|
37
|
+
sx={{
|
|
38
|
+
backgroundColor: '#FFF',
|
|
39
|
+
border: '1px solid rgb(219, 102, 25)',
|
|
40
|
+
m: '5px',
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<Icons icon="faceHappy" scale="large" color="primary" />
|
|
44
|
+
</Avatar>
|
|
45
|
+
),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
send: 'replay',
|
|
49
|
+
name: 'Bob',
|
|
50
|
+
message: 'Oi, estou bem, obrigado! E você?',
|
|
51
|
+
time: '10:05',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
send: 'me',
|
|
55
|
+
name: 'Alice',
|
|
56
|
+
message: 'Estou ótima, obrigada por perguntar!',
|
|
57
|
+
time: '10:10',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
send: 'replay',
|
|
61
|
+
name: 'Bob',
|
|
62
|
+
message: 'Que bom ouvir isso!',
|
|
63
|
+
time: '10:15',
|
|
64
|
+
emotion: (
|
|
65
|
+
<Avatar
|
|
66
|
+
sx={{
|
|
67
|
+
backgroundColor: '#FFF',
|
|
68
|
+
border: '1px solid rgb(219, 102, 25)',
|
|
69
|
+
m: '5px',
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<Icons icon="faceHappy" scale="large" color="primary" />
|
|
73
|
+
</Avatar>
|
|
74
|
+
),
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
export const ChatMessageBasic = () => {
|
|
79
|
+
return (
|
|
80
|
+
<>
|
|
81
|
+
<ChatMessage data={chat} />
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { CheckBox } from
|
|
3
|
-
import type { Meta, StoryObj } from
|
|
4
|
-
import { FormControlLabel } from
|
|
5
|
-
import { pink } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CheckBox } from '../components/CheckBox';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import { FormControlLabel } from '@mui/material';
|
|
5
|
+
import { pink } from '@mui/material/colors';
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title:
|
|
8
|
+
title: 'Form/CheckBox',
|
|
9
9
|
component: CheckBox,
|
|
10
10
|
parameters: {
|
|
11
|
-
layout:
|
|
11
|
+
layout: 'centered',
|
|
12
12
|
},
|
|
13
|
-
tags: [
|
|
13
|
+
tags: ['autodocs'],
|
|
14
14
|
argTypes: {},
|
|
15
15
|
} satisfies Meta<typeof CheckBox>;
|
|
16
16
|
|
|
@@ -24,11 +24,11 @@ const defaultArgs = {
|
|
|
24
24
|
|
|
25
25
|
export const Playground: Story = {
|
|
26
26
|
args: {
|
|
27
|
-
color:
|
|
27
|
+
color: 'primary',
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const label = { inputProps: {
|
|
31
|
+
const label = { inputProps: { 'aria-label': 'Checkbox demo' } };
|
|
32
32
|
|
|
33
33
|
export const CheckboxVariant = () => {
|
|
34
34
|
return (
|
|
@@ -40,7 +40,7 @@ export const CheckboxVariant = () => {
|
|
|
40
40
|
</>
|
|
41
41
|
);
|
|
42
42
|
};
|
|
43
|
-
CheckboxVariant.storyName =
|
|
43
|
+
CheckboxVariant.storyName = 'CheckBox Variants';
|
|
44
44
|
|
|
45
45
|
export const CheckboxProps = () => {
|
|
46
46
|
return (
|
|
@@ -52,7 +52,7 @@ export const CheckboxProps = () => {
|
|
|
52
52
|
</>
|
|
53
53
|
);
|
|
54
54
|
};
|
|
55
|
-
CheckboxProps.storyName =
|
|
55
|
+
CheckboxProps.storyName = 'Variants and Label';
|
|
56
56
|
|
|
57
57
|
export const CheckboxColors = () => {
|
|
58
58
|
return (
|
|
@@ -66,7 +66,7 @@ export const CheckboxColors = () => {
|
|
|
66
66
|
defaultChecked
|
|
67
67
|
sx={{
|
|
68
68
|
color: pink[800],
|
|
69
|
-
|
|
69
|
+
'&.Mui-checked': {
|
|
70
70
|
color: pink[600],
|
|
71
71
|
},
|
|
72
72
|
}}
|
|
@@ -74,21 +74,15 @@ export const CheckboxColors = () => {
|
|
|
74
74
|
</>
|
|
75
75
|
);
|
|
76
76
|
};
|
|
77
|
-
CheckboxColors.storyName =
|
|
77
|
+
CheckboxColors.storyName = 'CheckBox Colors';
|
|
78
78
|
|
|
79
79
|
export const CheckboxSizes = () => {
|
|
80
80
|
return (
|
|
81
81
|
<>
|
|
82
|
-
<FormControlLabel
|
|
83
|
-
control={<CheckBox size="small" />}
|
|
84
|
-
label="CheckBox Small"
|
|
85
|
-
/>
|
|
82
|
+
<FormControlLabel control={<CheckBox size="small" />} label="CheckBox Small" />
|
|
86
83
|
<FormControlLabel control={<CheckBox />} label="CheckBox Default" />
|
|
87
|
-
<FormControlLabel
|
|
88
|
-
control={<CheckBox size="medium" />}
|
|
89
|
-
label="CheckBox Medium"
|
|
90
|
-
/>
|
|
84
|
+
<FormControlLabel control={<CheckBox size="medium" />} label="CheckBox Medium" />
|
|
91
85
|
</>
|
|
92
86
|
);
|
|
93
87
|
};
|
|
94
|
-
CheckboxSizes.storyName =
|
|
88
|
+
CheckboxSizes.storyName = 'CheckBox Sizes';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { Meta } from '@storybook/react';
|
|
4
|
+
import { DataGrid } from '../components';
|
|
5
|
+
import dataSource from '../components/DataGrid/allData.json';
|
|
6
|
+
import data from '../sample-data.json';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Display/DataGrid',
|
|
10
|
+
component: DataGrid,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
argTypes: {},
|
|
16
|
+
} satisfies Meta<typeof DataGrid>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
export const DataGridBasic = () => {
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<DataGrid data={data} />
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
DataGridBasic.storyName = 'DataGrid Basic';
|
|
@@ -1,77 +1,50 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { DatePicker } from
|
|
3
|
-
import type { Meta } from
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title:
|
|
7
|
-
component: DatePicker,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout:
|
|
10
|
-
},
|
|
11
|
-
tags: [
|
|
12
|
-
argTypes: {},
|
|
13
|
-
} satisfies Meta<typeof DatePicker>;
|
|
14
|
-
|
|
15
|
-
export default meta;
|
|
16
|
-
|
|
17
|
-
export const BasicDatePicker = () =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<div style={{ width:
|
|
39
|
-
<DatePicker
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<>
|
|
52
|
-
<div style={{ width: "480px", marginBottom: 30 }}>
|
|
53
|
-
<DatePicker
|
|
54
|
-
sx={{ minWidth: 275 }}
|
|
55
|
-
label="DatePicker Brazil"
|
|
56
|
-
language="pt-br"
|
|
57
|
-
/>
|
|
58
|
-
</div>
|
|
59
|
-
<div style={{ width: "480px", marginBottom: 30 }}>
|
|
60
|
-
<DatePicker
|
|
61
|
-
sx={{ minWidth: 275 }}
|
|
62
|
-
label="DatePicker English"
|
|
63
|
-
language="en"
|
|
64
|
-
format="YYYY-MM-DD"
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
<div style={{ width: "480px", marginBottom: 30 }}>
|
|
68
|
-
<DatePicker
|
|
69
|
-
sx={{ minWidth: 275 }}
|
|
70
|
-
label="DatePicker Spain"
|
|
71
|
-
language="es"
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
</>
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
DatePickerLanguage.storyName = "DatePicker Languages";
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DatePicker } from '../components';
|
|
3
|
+
import type { Meta } from '@storybook/react';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Form/DatePicker',
|
|
7
|
+
component: DatePicker,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: {},
|
|
13
|
+
} satisfies Meta<typeof DatePicker>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
export const BasicDatePicker = () => <DatePicker sx={{ minWidth: 275 }} label="DatePicker" />;
|
|
18
|
+
BasicDatePicker.storyName = 'DatePicker Basic';
|
|
19
|
+
|
|
20
|
+
export const DatePickerVariants = () => (
|
|
21
|
+
<>
|
|
22
|
+
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
23
|
+
<DatePicker sx={{ minWidth: 275 }} label="DatePicker Responsive" variant="responsive" />
|
|
24
|
+
</div>
|
|
25
|
+
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
26
|
+
<DatePicker sx={{ minWidth: 275 }} label="DatePicker Mobile" variant="mobile" />
|
|
27
|
+
</div>
|
|
28
|
+
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
29
|
+
<DatePicker sx={{ minWidth: 275 }} label="DatePicker Desktop" variant="desktop" />
|
|
30
|
+
</div>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
DatePickerVariants.storyName = 'DatePicker Variants';
|
|
35
|
+
|
|
36
|
+
export const DatePickerLanguage = () => (
|
|
37
|
+
<>
|
|
38
|
+
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
39
|
+
<DatePicker sx={{ minWidth: 275 }} label="DatePicker Brazil" language="pt-br" />
|
|
40
|
+
</div>
|
|
41
|
+
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
42
|
+
<DatePicker sx={{ minWidth: 275 }} label="DatePicker English" language="en" format="YYYY-MM-DD" />
|
|
43
|
+
</div>
|
|
44
|
+
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
45
|
+
<DatePicker sx={{ minWidth: 275 }} label="DatePicker Spain" language="es" />
|
|
46
|
+
</div>
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
DatePickerLanguage.storyName = 'DatePicker Languages';
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
|
|
3
|
-
import type { Meta, StoryObj } from
|
|
4
|
-
import { Button, DropDown } from
|
|
5
|
-
import { MenuItem } from
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title:
|
|
9
|
-
component: DropDown,
|
|
10
|
-
parameters: {
|
|
11
|
-
layout:
|
|
12
|
-
},
|
|
13
|
-
tags: [
|
|
14
|
-
argTypes: {},
|
|
15
|
-
} satisfies Meta<typeof DropDown>;
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
|
|
21
|
-
export const DropDownlBasic = () => {
|
|
22
|
-
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
|
23
|
-
const open = Boolean(anchorEl);
|
|
24
|
-
|
|
25
|
-
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
26
|
-
setAnchorEl(event.currentTarget);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const handleClose = () => {
|
|
30
|
-
setAnchorEl(null);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<>
|
|
35
|
-
<Button
|
|
36
|
-
id="basic-button"
|
|
37
|
-
aria-controls={open ?
|
|
38
|
-
aria-haspopup="true"
|
|
39
|
-
aria-expanded={open ?
|
|
40
|
-
onClick={handleClick}
|
|
41
|
-
color="primary"
|
|
42
|
-
variant="outlined"
|
|
43
|
-
>
|
|
44
|
-
Open DropDown
|
|
45
|
-
</Button>
|
|
46
|
-
{open && (
|
|
47
|
-
<DropDown onClose={handleClose} open anchorEl={anchorEl}>
|
|
48
|
-
<MenuItem onClick={handleClose}>Profile</MenuItem>
|
|
49
|
-
<MenuItem onClick={handleClose}>My account</MenuItem>
|
|
50
|
-
<MenuItem onClick={handleClose}>Logout</MenuItem>
|
|
51
|
-
</DropDown>
|
|
52
|
-
)}
|
|
53
|
-
</>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
DropDownlBasic.storyName =
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import { Button, DropDown } from '../components';
|
|
5
|
+
import { MenuItem } from '@mui/material';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Layout/DropDown',
|
|
9
|
+
component: DropDown,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: {},
|
|
15
|
+
} satisfies Meta<typeof DropDown>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const DropDownlBasic = () => {
|
|
22
|
+
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
|
23
|
+
const open = Boolean(anchorEl);
|
|
24
|
+
|
|
25
|
+
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
26
|
+
setAnchorEl(event.currentTarget);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleClose = () => {
|
|
30
|
+
setAnchorEl(null);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<Button
|
|
36
|
+
id="basic-button"
|
|
37
|
+
aria-controls={open ? 'basic-menu' : undefined}
|
|
38
|
+
aria-haspopup="true"
|
|
39
|
+
aria-expanded={open ? 'true' : undefined}
|
|
40
|
+
onClick={handleClick}
|
|
41
|
+
color="primary"
|
|
42
|
+
variant="outlined"
|
|
43
|
+
>
|
|
44
|
+
Open DropDown
|
|
45
|
+
</Button>
|
|
46
|
+
{open && (
|
|
47
|
+
<DropDown onClose={handleClose} open anchorEl={anchorEl}>
|
|
48
|
+
<MenuItem onClick={handleClose}>Profile</MenuItem>
|
|
49
|
+
<MenuItem onClick={handleClose}>My account</MenuItem>
|
|
50
|
+
<MenuItem onClick={handleClose}>Logout</MenuItem>
|
|
51
|
+
</DropDown>
|
|
52
|
+
)}
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
DropDownlBasic.storyName = 'DropDown Basic';
|