norma-library 0.6.86 → 0.6.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +7 -0
- package/dist/esm/components/Box/interfaces.d.ts +1 -0
- package/dist/esm/components/Breadcrumb/index.d.ts +2 -2
- package/dist/esm/components/Breadcrumb/index.js +13 -9
- package/dist/esm/components/Breadcrumb/index.js.map +1 -1
- package/dist/esm/components/Breadcrumb/interface.d.ts +11 -6
- package/dist/esm/components/Breadcrumb/styles.d.ts +3 -3
- package/dist/esm/components/Breadcrumb/styles.js +3 -3
- package/dist/esm/components/Breadcrumb/styles.js.map +1 -1
- package/dist/esm/components/Typography/Text/interfaces.d.ts +1 -0
- package/dist/esm/components/Typography/Title/interfaces.d.ts +1 -0
- package/dist/esm/hooks/useClickOutside.d.ts +1 -1
- package/dist/esm/hooks/useClickOutside.js.map +1 -1
- package/package.json +24 -24
- package/src/components/Box/interfaces.ts +2 -0
- package/src/components/Breadcrumb/index.tsx +16 -11
- package/src/components/Breadcrumb/interface.ts +12 -6
- package/src/components/Breadcrumb/styles.tsx +10 -11
- package/src/components/Typography/Text/interfaces.ts +3 -1
- package/src/components/Typography/Title/interfaces.ts +2 -0
- package/src/hooks/useClickOutside.tsx +1 -1
- package/src/stories/Accordion.stories.tsx +19 -19
- package/src/stories/Avatar.stories.tsx +32 -28
- package/src/stories/Badge.stories.tsx +17 -15
- package/src/stories/Box.stories.tsx +16 -12
- package/src/stories/Breadcrumb.stories.tsx +62 -18
- package/src/stories/Button.stories.tsx +24 -16
- package/src/stories/Card.stories.tsx +21 -13
- package/src/stories/ChatMessage.stories.tsx +10 -9
- package/src/stories/ChatMessageBalloon.stories.tsx +83 -66
- package/src/stories/CheckBox.stories.tsx +23 -23
- package/src/stories/DateInput.stories.tsx +15 -16
- package/src/stories/DatePicker.stories.tsx +17 -12
- package/src/stories/DropDown.stories.tsx +16 -16
- package/src/stories/IconButton.stories.tsx +45 -21
- package/src/stories/Modal.stories.tsx +49 -49
- package/src/stories/ModalStatus.stories.tsx +34 -18
- package/src/stories/MultiSelectInput.stories.tsx +30 -28
- package/src/stories/NormaChatMessageBalloon.stories.tsx +119 -82
- package/src/stories/Paper.stories.tsx +14 -14
- package/src/stories/ProductCard.stories.tsx +76 -52
- package/src/stories/ProgressBar.stories.tsx +27 -19
- package/src/stories/RadioGroup.stories.tsx +28 -21
- package/src/stories/RangerSlider.stories.tsx +43 -35
- package/src/stories/Select.stories.tsx +61 -33
- package/src/stories/SelectInput.stories.tsx +27 -25
- package/src/stories/ServiceCard.stories.tsx +36 -27
- package/src/stories/Table.stories.tsx +211 -276
- package/src/stories/Tabs.stories.tsx +17 -17
- package/src/stories/Tag.stories.tsx +22 -14
- package/src/stories/Text.stories.tsx +9 -9
- package/src/stories/TextField.stories.tsx +116 -35
- package/src/stories/TextInput.stories.tsx +14 -15
- package/src/stories/TimeLine.stories.tsx +22 -20
- package/src/stories/TimePicker.stories.tsx +54 -30
- package/src/stories/Title.stories.tsx +9 -9
- package/src/stories/UncontrolledTable.stories.tsx +196 -66
- package/src/stories/UncontrolledTabs.stories.tsx +28 -23
- /package/src/stories/{Colors.stories.mdx → Colors.mdx} +0 -0
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import { ProgressBar } from '../components'
|
|
4
|
-
import { ColorVariant } from '../types'
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { ProgressBar } from '../components'
|
|
4
|
+
import { ColorVariant } from '../types'
|
|
5
5
|
|
|
6
|
-
const colors: ColorVariant[] = [
|
|
6
|
+
const colors: ColorVariant[] = [
|
|
7
|
+
'inherit',
|
|
8
|
+
'primary',
|
|
9
|
+
'secondary',
|
|
10
|
+
'success',
|
|
11
|
+
'error',
|
|
12
|
+
'info',
|
|
13
|
+
'warning',
|
|
14
|
+
]
|
|
7
15
|
|
|
8
16
|
const meta = {
|
|
9
17
|
title: 'Display/ProgressBar',
|
|
@@ -13,15 +21,15 @@ const meta = {
|
|
|
13
21
|
},
|
|
14
22
|
tags: ['autodocs'],
|
|
15
23
|
argTypes: {},
|
|
16
|
-
} satisfies Meta<typeof ProgressBar
|
|
24
|
+
} satisfies Meta<typeof ProgressBar>
|
|
17
25
|
|
|
18
|
-
export default meta
|
|
26
|
+
export default meta
|
|
19
27
|
|
|
20
|
-
type Story = StoryObj<typeof meta
|
|
28
|
+
type Story = StoryObj<typeof meta>
|
|
21
29
|
|
|
22
30
|
const defaultArgs = {
|
|
23
31
|
disabled: false,
|
|
24
|
-
}
|
|
32
|
+
}
|
|
25
33
|
|
|
26
34
|
export const Playground: Story = {
|
|
27
35
|
args: {
|
|
@@ -30,7 +38,7 @@ export const Playground: Story = {
|
|
|
30
38
|
color: 'primary',
|
|
31
39
|
value: 10,
|
|
32
40
|
},
|
|
33
|
-
}
|
|
41
|
+
}
|
|
34
42
|
|
|
35
43
|
export const ProgressBarBasic = () => (
|
|
36
44
|
<div style={{ display: 'flex', gap: '1rem', width: '320px' }}>
|
|
@@ -38,9 +46,9 @@ export const ProgressBarBasic = () => (
|
|
|
38
46
|
<ProgressBar value={40} total={100} color="primary" />
|
|
39
47
|
</div>
|
|
40
48
|
</div>
|
|
41
|
-
)
|
|
49
|
+
)
|
|
42
50
|
|
|
43
|
-
ProgressBarBasic.storyName = 'ProgressBar Basic'
|
|
51
|
+
ProgressBarBasic.storyName = 'ProgressBar Basic'
|
|
44
52
|
|
|
45
53
|
export const ProgressBarTitle: Story = () => (
|
|
46
54
|
<div style={{ display: 'flex', gap: '1rem', width: '320px' }}>
|
|
@@ -48,9 +56,9 @@ export const ProgressBarTitle: Story = () => (
|
|
|
48
56
|
<ProgressBar value={10} label="Progress" total={100} />
|
|
49
57
|
</div>
|
|
50
58
|
</div>
|
|
51
|
-
)
|
|
59
|
+
)
|
|
52
60
|
|
|
53
|
-
ProgressBarTitle.storyName = 'ProgressBar With Title'
|
|
61
|
+
ProgressBarTitle.storyName = 'ProgressBar With Title'
|
|
54
62
|
|
|
55
63
|
export const ProgressBarColors: Story = () => (
|
|
56
64
|
<>
|
|
@@ -81,9 +89,9 @@ export const ProgressBarColors: Story = () => (
|
|
|
81
89
|
</div>
|
|
82
90
|
</div>
|
|
83
91
|
</>
|
|
84
|
-
)
|
|
92
|
+
)
|
|
85
93
|
|
|
86
|
-
ProgressBarColors.storyName = 'ProgressBar Colors'
|
|
94
|
+
ProgressBarColors.storyName = 'ProgressBar Colors'
|
|
87
95
|
|
|
88
96
|
export const ProgressBarCustomColors: Story = () => (
|
|
89
97
|
<>
|
|
@@ -106,11 +114,11 @@ export const ProgressBarCustomColors: Story = () => (
|
|
|
106
114
|
label="Custom Color Blue"
|
|
107
115
|
h={5}
|
|
108
116
|
hideValue
|
|
109
|
-
fSize=
|
|
117
|
+
fSize="12px"
|
|
110
118
|
/>
|
|
111
119
|
</div>
|
|
112
120
|
</div>
|
|
113
121
|
</>
|
|
114
|
-
)
|
|
122
|
+
)
|
|
115
123
|
|
|
116
|
-
ProgressBarCustomColors.storyName = 'ProgressBar Custom Colors'
|
|
124
|
+
ProgressBarCustomColors.storyName = 'ProgressBar Custom Colors'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { RadioGroup } from '../components/RadioGroup'
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
-
import { SizeVariant } from '../types'
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { RadioGroup } from '../components/RadioGroup'
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
+
import { SizeVariant } from '../types'
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
title: 'Form/RadioGroup',
|
|
@@ -11,27 +11,27 @@ const meta = {
|
|
|
11
11
|
},
|
|
12
12
|
tags: ['autodocs'],
|
|
13
13
|
argTypes: {},
|
|
14
|
-
} satisfies Meta<typeof RadioGroup
|
|
14
|
+
} satisfies Meta<typeof RadioGroup>
|
|
15
15
|
|
|
16
|
-
export default meta
|
|
16
|
+
export default meta
|
|
17
17
|
|
|
18
|
-
type Story = StoryObj<typeof meta
|
|
18
|
+
type Story = StoryObj<typeof meta>
|
|
19
19
|
|
|
20
20
|
const defaultArgs = {
|
|
21
21
|
disabled: false,
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
|
|
24
24
|
const sizeOptions = [
|
|
25
25
|
{ label: 'Small', value: 'S', size: 'small' },
|
|
26
26
|
{ label: 'Medium', value: 'M', size: 'medium' },
|
|
27
27
|
{ label: 'Large', value: 'L', size: 'large' },
|
|
28
|
-
]
|
|
28
|
+
]
|
|
29
29
|
|
|
30
30
|
const genderOptions = [
|
|
31
31
|
{ label: 'Male', value: 'M' },
|
|
32
32
|
{ label: 'Female', value: 'F' },
|
|
33
33
|
{ label: 'Other', value: 'O' },
|
|
34
|
-
]
|
|
34
|
+
]
|
|
35
35
|
|
|
36
36
|
export const Playground: Story = {
|
|
37
37
|
args: {
|
|
@@ -41,16 +41,23 @@ export const Playground: Story = {
|
|
|
41
41
|
label: 'Gender',
|
|
42
42
|
checked: 'F',
|
|
43
43
|
},
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
45
|
|
|
46
46
|
export const RadioboxVertical = () => {
|
|
47
47
|
return (
|
|
48
48
|
<>
|
|
49
|
-
<RadioGroup
|
|
49
|
+
<RadioGroup
|
|
50
|
+
name="gender"
|
|
51
|
+
options={genderOptions}
|
|
52
|
+
label="Gender"
|
|
53
|
+
color="primary"
|
|
54
|
+
checked="M"
|
|
55
|
+
id="gender"
|
|
56
|
+
/>
|
|
50
57
|
</>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
RadioboxVertical.storyName = 'RadioGroup Vertical'
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
RadioboxVertical.storyName = 'RadioGroup Vertical'
|
|
54
61
|
|
|
55
62
|
export const RadioHorizontal = () => {
|
|
56
63
|
return (
|
|
@@ -65,9 +72,9 @@ export const RadioHorizontal = () => {
|
|
|
65
72
|
direction="horizontal"
|
|
66
73
|
/>
|
|
67
74
|
</>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
RadioHorizontal.storyName = 'RadioGroup Horizontal'
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
RadioHorizontal.storyName = 'RadioGroup Horizontal'
|
|
71
78
|
|
|
72
79
|
export const RadioSizes = () => {
|
|
73
80
|
return (
|
|
@@ -82,6 +89,6 @@ export const RadioSizes = () => {
|
|
|
82
89
|
direction="horizontal"
|
|
83
90
|
/>
|
|
84
91
|
</>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
RadioSizes.storyName = 'RadioGroup Sizes'
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
RadioSizes.storyName = 'RadioGroup Sizes'
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
import { RangerSlider } from '../components'
|
|
4
|
-
import { ColorVariant, TextFieldSizeVariant } from '../types'
|
|
5
|
-
import { TextField } from '@mui/material'
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { RangerSlider } from '../components'
|
|
4
|
+
import { ColorVariant, TextFieldSizeVariant } from '../types'
|
|
5
|
+
import { TextField } from '@mui/material'
|
|
6
6
|
|
|
7
|
-
const colors: ColorVariant[] = [
|
|
8
|
-
|
|
7
|
+
const colors: ColorVariant[] = [
|
|
8
|
+
'inherit',
|
|
9
|
+
'primary',
|
|
10
|
+
'secondary',
|
|
11
|
+
'success',
|
|
12
|
+
'error',
|
|
13
|
+
'info',
|
|
14
|
+
'warning',
|
|
15
|
+
]
|
|
16
|
+
const sizes: TextFieldSizeVariant[] = ['small', 'medium']
|
|
9
17
|
|
|
10
18
|
const meta: Meta<typeof RangerSlider> = {
|
|
11
19
|
title: 'Display/RangerSlider',
|
|
@@ -60,11 +68,11 @@ const meta: Meta<typeof RangerSlider> = {
|
|
|
60
68
|
description: 'Função callback que é disparada quando o valor do slider é alterado.',
|
|
61
69
|
},
|
|
62
70
|
},
|
|
63
|
-
}
|
|
71
|
+
}
|
|
64
72
|
|
|
65
|
-
export default meta
|
|
73
|
+
export default meta
|
|
66
74
|
|
|
67
|
-
type Story = StoryObj<typeof meta
|
|
75
|
+
type Story = StoryObj<typeof meta>
|
|
68
76
|
|
|
69
77
|
export const RangerSliderBasic: Story = {
|
|
70
78
|
args: {
|
|
@@ -79,22 +87,22 @@ export const RangerSliderBasic: Story = {
|
|
|
79
87
|
control: { type: 'array' },
|
|
80
88
|
},
|
|
81
89
|
},
|
|
82
|
-
render: args => {
|
|
83
|
-
const [value, setValue] = React.useState<number[]>(args.value)
|
|
90
|
+
render: (args) => {
|
|
91
|
+
const [value, setValue] = React.useState<number[]>(args.value)
|
|
84
92
|
|
|
85
93
|
const handleChange = (event: Event, newValue: number | number[]) => {
|
|
86
|
-
setValue(newValue as number[])
|
|
87
|
-
args.onChange?.(event, newValue, 0)
|
|
88
|
-
}
|
|
94
|
+
setValue(newValue as number[])
|
|
95
|
+
args.onChange?.(event, newValue, 0)
|
|
96
|
+
}
|
|
89
97
|
|
|
90
98
|
return (
|
|
91
99
|
<div style={{ display: 'flex', gap: '1rem', width: '480px', marginBottom: 30 }}>
|
|
92
100
|
<RangerSlider {...args} value={value} onChange={handleChange} />
|
|
93
101
|
</div>
|
|
94
|
-
)
|
|
102
|
+
)
|
|
95
103
|
},
|
|
96
104
|
name: 'RangerSlider Básico',
|
|
97
|
-
}
|
|
105
|
+
}
|
|
98
106
|
|
|
99
107
|
export const RangerSliderFormatter: Story = {
|
|
100
108
|
args: {
|
|
@@ -104,23 +112,23 @@ export const RangerSliderFormatter: Story = {
|
|
|
104
112
|
showValueInline: true,
|
|
105
113
|
valueLabelFormat: (value: number) => {
|
|
106
114
|
if (value < 60) {
|
|
107
|
-
return `${value}s
|
|
115
|
+
return `${value}s`
|
|
108
116
|
} else if (value < 3600) {
|
|
109
|
-
const minutes = Math.floor(value / 60)
|
|
110
|
-
const seconds = value % 60
|
|
111
|
-
return seconds === 0 ? `${minutes}min` : `${minutes}min ${seconds}s
|
|
117
|
+
const minutes = Math.floor(value / 60)
|
|
118
|
+
const seconds = value % 60
|
|
119
|
+
return seconds === 0 ? `${minutes}min` : `${minutes}min ${seconds}s`
|
|
112
120
|
} else {
|
|
113
|
-
const hours = Math.floor(value / 3600)
|
|
114
|
-
const minutes = Math.floor((value % 3600) / 60)
|
|
115
|
-
const seconds = value % 60
|
|
121
|
+
const hours = Math.floor(value / 3600)
|
|
122
|
+
const minutes = Math.floor((value % 3600) / 60)
|
|
123
|
+
const seconds = value % 60
|
|
116
124
|
if (minutes === 0 && seconds === 0) {
|
|
117
|
-
return `${hours}h
|
|
125
|
+
return `${hours}h`
|
|
118
126
|
} else if (minutes === 0) {
|
|
119
|
-
return `${hours}h ${seconds}s
|
|
127
|
+
return `${hours}h ${seconds}s`
|
|
120
128
|
} else if (seconds === 0) {
|
|
121
|
-
return `${hours}h ${minutes}min
|
|
129
|
+
return `${hours}h ${minutes}min`
|
|
122
130
|
} else {
|
|
123
|
-
return `${hours}h ${minutes}min ${seconds}s
|
|
131
|
+
return `${hours}h ${minutes}min ${seconds}s`
|
|
124
132
|
}
|
|
125
133
|
}
|
|
126
134
|
},
|
|
@@ -133,13 +141,13 @@ export const RangerSliderFormatter: Story = {
|
|
|
133
141
|
control: { type: 'array' },
|
|
134
142
|
},
|
|
135
143
|
},
|
|
136
|
-
render: args => {
|
|
137
|
-
const [value, setValue] = React.useState<number[]>(args.value)
|
|
144
|
+
render: (args) => {
|
|
145
|
+
const [value, setValue] = React.useState<number[]>(args.value)
|
|
138
146
|
|
|
139
147
|
const handleChange = (event: Event, newValue: number | number[]) => {
|
|
140
|
-
setValue(newValue as number[])
|
|
141
|
-
args.onChange?.(event, newValue, 0)
|
|
142
|
-
}
|
|
148
|
+
setValue(newValue as number[])
|
|
149
|
+
args.onChange?.(event, newValue, 0)
|
|
150
|
+
}
|
|
143
151
|
|
|
144
152
|
return (
|
|
145
153
|
<div style={{ display: 'flex', gap: '1rem', width: '480px', marginBottom: 30 }}>
|
|
@@ -147,7 +155,7 @@ export const RangerSliderFormatter: Story = {
|
|
|
147
155
|
<RangerSlider {...args} value={value} onChange={handleChange} />
|
|
148
156
|
{/* <TextField size="small" variant='standard' /> */}
|
|
149
157
|
</div>
|
|
150
|
-
)
|
|
158
|
+
)
|
|
151
159
|
},
|
|
152
160
|
name: 'RangerSlider com Formatter',
|
|
153
|
-
}
|
|
161
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
-
import { Select } from '../components'
|
|
5
|
-
import { DataSelect, TextFieldSizeVariant } from '../types'
|
|
6
|
-
import { SelectChangeEvent } from '@mui/material'
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
+
import { Select } from '../components'
|
|
5
|
+
import { DataSelect, TextFieldSizeVariant } from '../types'
|
|
6
|
+
import { SelectChangeEvent } from '@mui/material'
|
|
7
7
|
|
|
8
|
-
const sizes: TextFieldSizeVariant[] = ['small', 'medium']
|
|
8
|
+
const sizes: TextFieldSizeVariant[] = ['small', 'medium']
|
|
9
9
|
|
|
10
10
|
const data: DataSelect[] = [
|
|
11
11
|
{ label: 'Oliver Hansen', value: 'oliver-hansen' },
|
|
@@ -18,7 +18,7 @@ const data: DataSelect[] = [
|
|
|
18
18
|
{ label: 'Bradley Wilkerson', value: 'bradley-wilkerson' },
|
|
19
19
|
{ label: 'Virginia Andrews', value: 'virginia-andrews' },
|
|
20
20
|
{ label: 'Kelly Snyder', value: 'kelly-snyder' },
|
|
21
|
-
]
|
|
21
|
+
]
|
|
22
22
|
|
|
23
23
|
const meta = {
|
|
24
24
|
title: 'Form/Select',
|
|
@@ -28,59 +28,87 @@ const meta = {
|
|
|
28
28
|
},
|
|
29
29
|
tags: ['autodocs'],
|
|
30
30
|
argTypes: {},
|
|
31
|
-
} satisfies Meta<typeof Select
|
|
31
|
+
} satisfies Meta<typeof Select>
|
|
32
32
|
|
|
33
|
-
export default meta
|
|
33
|
+
export default meta
|
|
34
34
|
|
|
35
|
-
type Story = StoryObj<typeof meta
|
|
35
|
+
type Story = StoryObj<typeof meta>
|
|
36
36
|
|
|
37
37
|
export const SelectBasic = () => {
|
|
38
|
-
const [value, setValue] = React.useState('')
|
|
38
|
+
const [value, setValue] = React.useState('')
|
|
39
39
|
|
|
40
40
|
const handleChange = (event: SelectChangeEvent) => {
|
|
41
|
-
setValue(event.target.value as string)
|
|
42
|
-
}
|
|
41
|
+
setValue(event.target.value as string)
|
|
42
|
+
}
|
|
43
43
|
return (
|
|
44
44
|
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
45
|
-
<Select
|
|
45
|
+
<Select
|
|
46
|
+
id="select-demo"
|
|
47
|
+
value={value}
|
|
48
|
+
onChange={handleChange}
|
|
49
|
+
label="Members"
|
|
50
|
+
variant="standard"
|
|
51
|
+
data={data}
|
|
52
|
+
/>
|
|
46
53
|
</div>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
49
56
|
|
|
50
|
-
SelectBasic.storyName = 'Select Basic'
|
|
57
|
+
SelectBasic.storyName = 'Select Basic'
|
|
51
58
|
|
|
52
59
|
export const SelectVariants = () => {
|
|
53
|
-
const [value, setValue] = React.useState('')
|
|
60
|
+
const [value, setValue] = React.useState('')
|
|
54
61
|
|
|
55
62
|
const handleChange = (event: SelectChangeEvent) => {
|
|
56
|
-
setValue(event.target.value as string)
|
|
57
|
-
}
|
|
63
|
+
setValue(event.target.value as string)
|
|
64
|
+
}
|
|
58
65
|
return (
|
|
59
66
|
<>
|
|
60
67
|
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
61
|
-
<Select
|
|
68
|
+
<Select
|
|
69
|
+
id="select-demo"
|
|
70
|
+
value={value}
|
|
71
|
+
onChange={handleChange}
|
|
72
|
+
label="Members"
|
|
73
|
+
variant="standard"
|
|
74
|
+
data={data}
|
|
75
|
+
/>
|
|
62
76
|
</div>
|
|
63
77
|
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
64
|
-
<Select
|
|
78
|
+
<Select
|
|
79
|
+
id="select-demo"
|
|
80
|
+
value={value}
|
|
81
|
+
onChange={handleChange}
|
|
82
|
+
label="Members"
|
|
83
|
+
variant="filled"
|
|
84
|
+
data={data}
|
|
85
|
+
/>
|
|
65
86
|
</div>
|
|
66
87
|
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
67
|
-
<Select
|
|
88
|
+
<Select
|
|
89
|
+
id="select-demo"
|
|
90
|
+
value={value}
|
|
91
|
+
onChange={handleChange}
|
|
92
|
+
label="Members"
|
|
93
|
+
variant="outlined"
|
|
94
|
+
data={data}
|
|
95
|
+
/>
|
|
68
96
|
</div>
|
|
69
97
|
</>
|
|
70
|
-
)
|
|
71
|
-
}
|
|
98
|
+
)
|
|
99
|
+
}
|
|
72
100
|
|
|
73
|
-
SelectVariants.storyName = 'Select Variantes'
|
|
101
|
+
SelectVariants.storyName = 'Select Variantes'
|
|
74
102
|
|
|
75
103
|
export const SelectMultiple = () => {
|
|
76
|
-
const [value, setValue] = React.useState<string[]>([])
|
|
104
|
+
const [value, setValue] = React.useState<string[]>([])
|
|
77
105
|
|
|
78
106
|
const handleChange = (event: SelectChangeEvent<typeof value>) => {
|
|
79
107
|
const {
|
|
80
108
|
target: { value },
|
|
81
|
-
} = event
|
|
82
|
-
setValue(typeof value === 'string' ? value.split(',') : value)
|
|
83
|
-
}
|
|
109
|
+
} = event
|
|
110
|
+
setValue(typeof value === 'string' ? value.split(',') : value)
|
|
111
|
+
}
|
|
84
112
|
|
|
85
113
|
return (
|
|
86
114
|
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
@@ -94,7 +122,7 @@ export const SelectMultiple = () => {
|
|
|
94
122
|
variant="standard"
|
|
95
123
|
/>
|
|
96
124
|
</div>
|
|
97
|
-
)
|
|
98
|
-
}
|
|
125
|
+
)
|
|
126
|
+
}
|
|
99
127
|
|
|
100
|
-
SelectMultiple.storyName = 'Select Multiples'
|
|
128
|
+
SelectMultiple.storyName = 'Select Multiples'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import SelectInput from '../components/SelectInput'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import SelectInput from '../components/SelectInput'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Form/SelectInput',
|
|
@@ -8,72 +8,74 @@ export default {
|
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: 'centered',
|
|
10
10
|
},
|
|
11
|
-
argTypes: {
|
|
11
|
+
argTypes: {
|
|
12
12
|
className: {
|
|
13
13
|
description: 'Adicione uma classe.',
|
|
14
14
|
},
|
|
15
15
|
label: {
|
|
16
|
-
description: 'Adicione uma label.'
|
|
16
|
+
description: 'Adicione uma label.',
|
|
17
17
|
},
|
|
18
18
|
onChange: {
|
|
19
|
-
description: 'Função para capturar o valor quando alterado.'
|
|
19
|
+
description: 'Função para capturar o valor quando alterado.',
|
|
20
20
|
},
|
|
21
21
|
placeholder: {
|
|
22
|
-
description: 'Adicione um placeholder.'
|
|
22
|
+
description: 'Adicione um placeholder.',
|
|
23
23
|
},
|
|
24
24
|
options: {
|
|
25
|
-
description: 'Lista de valores a ser exibido.'
|
|
25
|
+
description: 'Lista de valores a ser exibido.',
|
|
26
26
|
},
|
|
27
27
|
value: {
|
|
28
|
-
description: 'Valor selecionado.'
|
|
28
|
+
description: 'Valor selecionado.',
|
|
29
29
|
},
|
|
30
30
|
isSearchable: {
|
|
31
|
-
description: 'Habilita a função de buscar um valor.'
|
|
31
|
+
description: 'Habilita a função de buscar um valor.',
|
|
32
32
|
},
|
|
33
33
|
isClearable: {
|
|
34
|
-
description: 'Habilita a função de limpar o item selecionado.'
|
|
34
|
+
description: 'Habilita a função de limpar o item selecionado.',
|
|
35
35
|
},
|
|
36
36
|
disabled: {
|
|
37
|
-
description: 'Habilita ou desabilita.'
|
|
38
|
-
}
|
|
39
|
-
}
|
|
37
|
+
description: 'Habilita ou desabilita.',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export const Default = (args) => {
|
|
43
43
|
const options = [
|
|
44
44
|
{
|
|
45
45
|
label: 'options 1',
|
|
46
|
-
value: 'value 1'
|
|
46
|
+
value: 'value 1',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
label: 'options 2',
|
|
50
|
-
value: 'value 2'
|
|
50
|
+
value: 'value 2',
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
label: 'options 3',
|
|
54
|
-
value: 'value 3'
|
|
55
|
-
}
|
|
54
|
+
value: 'value 3',
|
|
55
|
+
},
|
|
56
56
|
]
|
|
57
57
|
const [selectedValue, setSelectedValue] = useState<any>(options[0])
|
|
58
58
|
return (
|
|
59
|
-
<div
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
<div
|
|
60
|
+
style={{
|
|
61
|
+
width: 300,
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
<SelectInput
|
|
63
65
|
options={options}
|
|
64
66
|
value={selectedValue}
|
|
65
|
-
onChange={(value) => setSelectedValue(value)}
|
|
66
|
-
{...args}
|
|
67
|
+
onChange={(value) => setSelectedValue(value)}
|
|
68
|
+
{...args}
|
|
67
69
|
/>
|
|
68
70
|
</div>
|
|
69
71
|
)
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
Default.args = {
|
|
74
|
+
Default.args = {
|
|
73
75
|
className: '',
|
|
74
76
|
label: 'Selecione:',
|
|
75
77
|
placeholder: 'Selecione uma opção',
|
|
76
78
|
disabled: false,
|
|
77
79
|
isSearchable: false,
|
|
78
80
|
isClearable: false,
|
|
79
|
-
}
|
|
81
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Meta } from
|
|
2
|
-
import { ServiceCard } from
|
|
3
|
-
import React from
|
|
4
|
-
import { Home } from
|
|
1
|
+
import { Meta } from '@storybook/react'
|
|
2
|
+
import { ServiceCard } from '../components/ServiceCard/ServiceCard'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { Home } from '@mui/icons-material'
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
title: 'Layout/ServiceCard',
|
|
@@ -11,29 +11,38 @@ const meta = {
|
|
|
11
11
|
},
|
|
12
12
|
tags: ['autodocs'],
|
|
13
13
|
argTypes: {},
|
|
14
|
-
} satisfies Meta<typeof ServiceCard
|
|
14
|
+
} satisfies Meta<typeof ServiceCard>
|
|
15
15
|
|
|
16
|
-
export default meta
|
|
16
|
+
export default meta
|
|
17
17
|
|
|
18
|
-
export const BasicServiceCard = () =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
export const BasicServiceCard = () => (
|
|
19
|
+
<ServiceCard
|
|
20
|
+
title="Financeiro e Jurídico"
|
|
21
|
+
description="Dados financeiros e legais sobre seus produtos."
|
|
22
|
+
icon={{
|
|
23
|
+
iconName: Home,
|
|
24
|
+
bgColor: '#F6F07F',
|
|
25
|
+
iconColor: '#B16E4B',
|
|
26
|
+
scale: 'medium',
|
|
27
|
+
iconWidth: '36px',
|
|
28
|
+
iconHeight: '36px',
|
|
29
|
+
}}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
BasicServiceCard.storyName = 'Basic Service Card'
|
|
29
33
|
|
|
30
|
-
export const DisabledServiceCard = () =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
export const DisabledServiceCard = () => (
|
|
35
|
+
<ServiceCard
|
|
36
|
+
title="Financeiro e Jurídico"
|
|
37
|
+
description="Dados financeiros e legais sobre seus produtos."
|
|
38
|
+
icon={{
|
|
39
|
+
iconName: 'olosFinancial',
|
|
40
|
+
bgColor: '#F6F07F',
|
|
41
|
+
iconColor: '#B16E4B',
|
|
42
|
+
scale: 'medium',
|
|
43
|
+
iconWidth: '36px',
|
|
44
|
+
iconHeight: '36px',
|
|
45
|
+
}}
|
|
46
|
+
disabled
|
|
47
|
+
/>
|
|
48
|
+
)
|