norma-library 0.6.86 → 0.6.88
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/ProductCard/ProductCard.js +7 -5
- package/dist/esm/components/ProductCard/ProductCard.js.map +1 -1
- package/dist/esm/components/ProductCard/ProductCard.style.js +1 -1
- package/dist/esm/components/ProductCard/ProductCard.style.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/dist/esm/interfaces/ProductCard.d.ts +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/ProductCard/ProductCard.style.ts +0 -1
- package/src/components/ProductCard/ProductCard.tsx +6 -5
- 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/interfaces/ProductCard.ts +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 +123 -51
- 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,8 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
-
import { Button, Modal } from '../components'
|
|
5
|
-
import { Box, Typography } from '@mui/material'
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
+
import { Button, Modal } from '../components'
|
|
5
|
+
import { Box, Typography } from '@mui/material'
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
8
|
title: 'Layout/Modal',
|
|
@@ -12,14 +12,14 @@ const meta = {
|
|
|
12
12
|
},
|
|
13
13
|
tags: ['autodocs'],
|
|
14
14
|
argTypes: {},
|
|
15
|
-
} satisfies Meta<typeof Modal
|
|
15
|
+
} satisfies Meta<typeof Modal>
|
|
16
16
|
|
|
17
|
-
export default meta
|
|
17
|
+
export default meta
|
|
18
18
|
|
|
19
19
|
export const ModalBasic = () => {
|
|
20
|
-
const [open, setOpen] = React.useState(false)
|
|
21
|
-
const handleOpen = () => setOpen(true)
|
|
22
|
-
const handleClose = () => setOpen(false)
|
|
20
|
+
const [open, setOpen] = React.useState(false)
|
|
21
|
+
const handleOpen = () => setOpen(true)
|
|
22
|
+
const handleClose = () => setOpen(false)
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<>
|
|
@@ -45,15 +45,15 @@ export const ModalBasic = () => {
|
|
|
45
45
|
</Modal>
|
|
46
46
|
)}
|
|
47
47
|
</>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
ModalBasic.storyName = 'Modal Basic'
|
|
51
|
+
ModalBasic.storyName = 'Modal Basic'
|
|
52
52
|
|
|
53
53
|
export const ModalTitle = () => {
|
|
54
|
-
const [open, setOpen] = React.useState(false)
|
|
55
|
-
const handleOpen = () => setOpen(true)
|
|
56
|
-
const handleClose = () => setOpen(false)
|
|
54
|
+
const [open, setOpen] = React.useState(false)
|
|
55
|
+
const handleOpen = () => setOpen(true)
|
|
56
|
+
const handleClose = () => setOpen(false)
|
|
57
57
|
return (
|
|
58
58
|
<>
|
|
59
59
|
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
@@ -67,7 +67,7 @@ export const ModalTitle = () => {
|
|
|
67
67
|
aria-labelledby="modal-modal-title"
|
|
68
68
|
aria-describedby="modal-modal-description"
|
|
69
69
|
title="Title Modal"
|
|
70
|
-
description=
|
|
70
|
+
description="Description Modal"
|
|
71
71
|
>
|
|
72
72
|
<>
|
|
73
73
|
<Typography id="modal-modal-title" variant="h6" component="h2">
|
|
@@ -80,15 +80,15 @@ export const ModalTitle = () => {
|
|
|
80
80
|
</Modal>
|
|
81
81
|
)}
|
|
82
82
|
</>
|
|
83
|
-
)
|
|
84
|
-
}
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
85
|
|
|
86
|
-
ModalTitle.storyName = 'Modal Title'
|
|
86
|
+
ModalTitle.storyName = 'Modal Title'
|
|
87
87
|
|
|
88
88
|
export const ModalAction = () => {
|
|
89
|
-
const [open, setOpen] = React.useState(false)
|
|
90
|
-
const handleOpen = () => setOpen(true)
|
|
91
|
-
const handleClose = () => setOpen(false)
|
|
89
|
+
const [open, setOpen] = React.useState(false)
|
|
90
|
+
const handleOpen = () => setOpen(true)
|
|
91
|
+
const handleClose = () => setOpen(false)
|
|
92
92
|
|
|
93
93
|
const defaultAction = [
|
|
94
94
|
{
|
|
@@ -105,7 +105,7 @@ export const ModalAction = () => {
|
|
|
105
105
|
size: 'medium',
|
|
106
106
|
variant: 'contained',
|
|
107
107
|
},
|
|
108
|
-
]
|
|
108
|
+
]
|
|
109
109
|
return (
|
|
110
110
|
<>
|
|
111
111
|
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
@@ -136,15 +136,15 @@ export const ModalAction = () => {
|
|
|
136
136
|
</Modal>
|
|
137
137
|
)}
|
|
138
138
|
</>
|
|
139
|
-
)
|
|
140
|
-
}
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
141
|
|
|
142
|
-
ModalAction.storyName = 'Modal Action'
|
|
142
|
+
ModalAction.storyName = 'Modal Action'
|
|
143
143
|
|
|
144
144
|
export const ModalProps = () => {
|
|
145
|
-
const [open, setOpen] = React.useState(false)
|
|
146
|
-
const handleOpen = () => setOpen(true)
|
|
147
|
-
const handleClose = () => setOpen(false)
|
|
145
|
+
const [open, setOpen] = React.useState(false)
|
|
146
|
+
const handleOpen = () => setOpen(true)
|
|
147
|
+
const handleClose = () => setOpen(false)
|
|
148
148
|
|
|
149
149
|
const defaultAction = [
|
|
150
150
|
{
|
|
@@ -161,7 +161,7 @@ export const ModalProps = () => {
|
|
|
161
161
|
size: 'medium',
|
|
162
162
|
variant: 'contained',
|
|
163
163
|
},
|
|
164
|
-
]
|
|
164
|
+
]
|
|
165
165
|
return (
|
|
166
166
|
<>
|
|
167
167
|
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
@@ -188,15 +188,15 @@ export const ModalProps = () => {
|
|
|
188
188
|
</Modal>
|
|
189
189
|
)}
|
|
190
190
|
</>
|
|
191
|
-
)
|
|
192
|
-
}
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
193
|
|
|
194
|
-
ModalProps.storyName = 'Modal Title and Action'
|
|
194
|
+
ModalProps.storyName = 'Modal Title and Action'
|
|
195
195
|
|
|
196
196
|
export const ModalSize = () => {
|
|
197
|
-
const [open, setOpen] = React.useState(false)
|
|
198
|
-
const handleOpen = () => setOpen(true)
|
|
199
|
-
const handleClose = () => setOpen(false)
|
|
197
|
+
const [open, setOpen] = React.useState(false)
|
|
198
|
+
const handleOpen = () => setOpen(true)
|
|
199
|
+
const handleClose = () => setOpen(false)
|
|
200
200
|
|
|
201
201
|
const defaultAction = [
|
|
202
202
|
{
|
|
@@ -213,7 +213,7 @@ export const ModalSize = () => {
|
|
|
213
213
|
size: 'medium',
|
|
214
214
|
variant: 'contained',
|
|
215
215
|
},
|
|
216
|
-
]
|
|
216
|
+
]
|
|
217
217
|
return (
|
|
218
218
|
<>
|
|
219
219
|
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
@@ -228,7 +228,7 @@ export const ModalSize = () => {
|
|
|
228
228
|
aria-describedby="modal-modal-description"
|
|
229
229
|
action={defaultAction}
|
|
230
230
|
title="Select a company"
|
|
231
|
-
width=
|
|
231
|
+
width="90vw"
|
|
232
232
|
>
|
|
233
233
|
<>
|
|
234
234
|
<Typography id="modal-modal-title" variant="h6" component="h2">
|
|
@@ -241,15 +241,15 @@ export const ModalSize = () => {
|
|
|
241
241
|
</Modal>
|
|
242
242
|
)}
|
|
243
243
|
</>
|
|
244
|
-
)
|
|
245
|
-
}
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
246
|
|
|
247
|
-
ModalSize.storyName = 'Modal width and height'
|
|
247
|
+
ModalSize.storyName = 'Modal width and height'
|
|
248
248
|
|
|
249
249
|
export const ModalOutsideClick = () => {
|
|
250
|
-
const [open, setOpen] = React.useState(false)
|
|
251
|
-
const handleOpen = () => setOpen(true)
|
|
252
|
-
const handleClose = () => setOpen(false)
|
|
250
|
+
const [open, setOpen] = React.useState(false)
|
|
251
|
+
const handleOpen = () => setOpen(true)
|
|
252
|
+
const handleClose = () => setOpen(false)
|
|
253
253
|
|
|
254
254
|
const defaultAction = [
|
|
255
255
|
{
|
|
@@ -266,7 +266,7 @@ export const ModalOutsideClick = () => {
|
|
|
266
266
|
size: 'medium',
|
|
267
267
|
variant: 'contained',
|
|
268
268
|
},
|
|
269
|
-
]
|
|
269
|
+
]
|
|
270
270
|
return (
|
|
271
271
|
<>
|
|
272
272
|
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
@@ -282,7 +282,7 @@ export const ModalOutsideClick = () => {
|
|
|
282
282
|
aria-describedby="modal-modal-description"
|
|
283
283
|
action={defaultAction}
|
|
284
284
|
title="Select a company"
|
|
285
|
-
width=
|
|
285
|
+
width="90vw"
|
|
286
286
|
>
|
|
287
287
|
<>
|
|
288
288
|
<Typography id="modal-modal-title" variant="h6" component="h2">
|
|
@@ -295,7 +295,7 @@ export const ModalOutsideClick = () => {
|
|
|
295
295
|
</Modal>
|
|
296
296
|
)}
|
|
297
297
|
</>
|
|
298
|
-
)
|
|
299
|
-
}
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
300
|
|
|
301
|
-
ModalOutsideClick.storyName = 'Modal custom outside click behaviour'
|
|
301
|
+
ModalOutsideClick.storyName = 'Modal custom outside click behaviour'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import type { Meta } from '@storybook/react'
|
|
4
|
-
import { ModalStatus } from '../components/StatusModal/StatusModal'
|
|
5
|
-
import { OnAction } from '../types'
|
|
3
|
+
import type { Meta } from '@storybook/react'
|
|
4
|
+
import { ModalStatus } from '../components/StatusModal/StatusModal'
|
|
5
|
+
import { OnAction } from '../types'
|
|
6
6
|
|
|
7
7
|
const actions: OnAction[] = [
|
|
8
8
|
{
|
|
@@ -14,7 +14,7 @@ const actions: OnAction[] = [
|
|
|
14
14
|
variant: 'contained',
|
|
15
15
|
action: () => {},
|
|
16
16
|
},
|
|
17
|
-
]
|
|
17
|
+
]
|
|
18
18
|
|
|
19
19
|
const meta = {
|
|
20
20
|
title: 'Layout/ModalStatus',
|
|
@@ -24,24 +24,40 @@ const meta = {
|
|
|
24
24
|
},
|
|
25
25
|
tags: ['autodocs'],
|
|
26
26
|
argTypes: {},
|
|
27
|
-
} satisfies Meta<typeof ModalStatus
|
|
27
|
+
} satisfies Meta<typeof ModalStatus>
|
|
28
28
|
|
|
29
|
-
export default meta
|
|
29
|
+
export default meta
|
|
30
30
|
|
|
31
31
|
export const ModalSuccess = () => {
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
return (
|
|
33
|
+
<ModalStatus
|
|
34
|
+
title="Título"
|
|
35
|
+
text="Lorem ipsum dolor sit amet."
|
|
36
|
+
actions={actions}
|
|
37
|
+
type="success"
|
|
38
|
+
/>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
ModalSuccess.storyName = 'Modal Success'
|
|
36
43
|
|
|
37
44
|
export const ModalWarning = () => {
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
return (
|
|
46
|
+
<ModalStatus
|
|
47
|
+
title="Título"
|
|
48
|
+
text="Lorem ipsum dolor sit amet."
|
|
49
|
+
actions={actions}
|
|
50
|
+
type="warning"
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ModalWarning.storyName = 'Modal Warning'
|
|
42
56
|
|
|
43
57
|
export const ModalInfo = () => {
|
|
44
|
-
return
|
|
45
|
-
}
|
|
58
|
+
return (
|
|
59
|
+
<ModalStatus title="Título" text="Lorem ipsum dolor sit amet." type="info" actions={actions} />
|
|
60
|
+
)
|
|
61
|
+
}
|
|
46
62
|
|
|
47
|
-
ModalInfo.storyName = 'Modal Info'
|
|
63
|
+
ModalInfo.storyName = 'Modal Info'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import MultiSelectInput from '../components/MultiSelectInput'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import MultiSelectInput from '../components/MultiSelectInput'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Form/MultiSelectInput',
|
|
@@ -8,84 +8,86 @@ 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'
|
|
54
|
+
value: 'value 3',
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
label: 'options 4',
|
|
58
|
-
value: 'value 4'
|
|
58
|
+
value: 'value 4',
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
label: 'options 5',
|
|
62
|
-
value: 'value 5'
|
|
62
|
+
value: 'value 5',
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
label: 'options 6',
|
|
66
|
-
value: 'value 6'
|
|
67
|
-
}
|
|
66
|
+
value: 'value 6',
|
|
67
|
+
},
|
|
68
68
|
]
|
|
69
69
|
const [selectedValue, setSelectedValue] = useState<any>(options[0])
|
|
70
70
|
return (
|
|
71
|
-
<div
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
<div
|
|
72
|
+
style={{
|
|
73
|
+
width: 300,
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<MultiSelectInput
|
|
75
77
|
options={options}
|
|
76
78
|
value={selectedValue}
|
|
77
|
-
onChange={(value) => setSelectedValue(value)}
|
|
78
|
-
{...args}
|
|
79
|
+
onChange={(value) => setSelectedValue(value)}
|
|
80
|
+
{...args}
|
|
79
81
|
/>
|
|
80
82
|
</div>
|
|
81
83
|
)
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
Default.args = {
|
|
86
|
+
Default.args = {
|
|
85
87
|
className: '',
|
|
86
88
|
label: 'Selecione:',
|
|
87
89
|
placeholder: 'Selecione uma opção',
|
|
88
90
|
disabled: false,
|
|
89
91
|
isSearchable: false,
|
|
90
92
|
isClearable: false,
|
|
91
|
-
}
|
|
93
|
+
}
|