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,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import Title from '../components/Typography/Title'
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Title from '../components/Typography/Title'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Tipografia/Title',
|
|
@@ -12,10 +12,10 @@ export default {
|
|
|
12
12
|
as: {
|
|
13
13
|
description: 'Adiciona a tag do titulo.',
|
|
14
14
|
options: ['h1', 'h2', 'h3', 'h4', 'h5'],
|
|
15
|
-
control: { type: 'radio' }
|
|
15
|
+
control: { type: 'radio' },
|
|
16
16
|
},
|
|
17
17
|
children: {
|
|
18
|
-
description: 'Adiciona um children.'
|
|
18
|
+
description: 'Adiciona um children.',
|
|
19
19
|
},
|
|
20
20
|
className: {
|
|
21
21
|
description: 'Adicione uma classe.',
|
|
@@ -23,14 +23,14 @@ export default {
|
|
|
23
23
|
size: {
|
|
24
24
|
description: 'Adicione um tamanho.',
|
|
25
25
|
options: ['small', 'medium', 'large'],
|
|
26
|
-
control: { type: 'radio' }
|
|
26
|
+
control: { type: 'radio' },
|
|
27
27
|
},
|
|
28
28
|
type: {
|
|
29
29
|
description: 'Adicione um tipo.',
|
|
30
30
|
options: ['default', 'secondary', 'success', 'warning', 'danger', 'info'],
|
|
31
|
-
control: { type: 'radio' }
|
|
31
|
+
control: { type: 'radio' },
|
|
32
32
|
},
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export const Default = (args) => <Title {...args} />
|
|
@@ -40,5 +40,5 @@ Default.args = {
|
|
|
40
40
|
children: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
|
|
41
41
|
className: '',
|
|
42
42
|
size: 'default',
|
|
43
|
-
type: ''
|
|
44
|
-
}
|
|
43
|
+
type: '',
|
|
44
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import UncontrolledTable from '../components/UncontrolledTable'
|
|
3
|
-
import { Button } from '../components/Button'
|
|
4
|
-
import { format } from 'date-fns'
|
|
5
|
-
import CodeIcon from '@mui/icons-material/Code'
|
|
6
|
-
import CreateIcon from '@mui/icons-material/Create'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import UncontrolledTable from '../components/UncontrolledTable'
|
|
3
|
+
import { Button } from '../components/Button'
|
|
4
|
+
import { format } from 'date-fns'
|
|
5
|
+
import CodeIcon from '@mui/icons-material/Code'
|
|
6
|
+
import CreateIcon from '@mui/icons-material/Create'
|
|
7
7
|
|
|
8
|
-
const Template = args => {
|
|
9
|
-
return <UncontrolledTable {...args}
|
|
10
|
-
}
|
|
8
|
+
const Template = (args) => {
|
|
9
|
+
return <UncontrolledTable {...args} />
|
|
10
|
+
}
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
13
|
title: 'Uncontrolled/Table',
|
|
@@ -26,7 +26,7 @@ export default {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
argTypes: {},
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
|
|
31
31
|
const columns = [
|
|
32
32
|
{
|
|
@@ -58,7 +58,7 @@ const columns = [
|
|
|
58
58
|
filterFn: 'customFilterText',
|
|
59
59
|
disableMenu: true,
|
|
60
60
|
},
|
|
61
|
-
]
|
|
61
|
+
]
|
|
62
62
|
|
|
63
63
|
const dnd_columns = [
|
|
64
64
|
{
|
|
@@ -89,9 +89,9 @@ const dnd_columns = [
|
|
|
89
89
|
enableColumnFilter: false,
|
|
90
90
|
filterFn: 'customFilterText',
|
|
91
91
|
},
|
|
92
|
-
]
|
|
92
|
+
]
|
|
93
93
|
|
|
94
|
-
export const Default = args => {
|
|
94
|
+
export const Default = (args) => {
|
|
95
95
|
const data = [
|
|
96
96
|
{
|
|
97
97
|
date: format(new Date('8-14-2023 21:29'), 'dd/MM/yyyy'),
|
|
@@ -103,7 +103,12 @@ export const Default = args => {
|
|
|
103
103
|
origin: 'origin',
|
|
104
104
|
id: '1',
|
|
105
105
|
action: (
|
|
106
|
-
<Button
|
|
106
|
+
<Button
|
|
107
|
+
color="primary"
|
|
108
|
+
disableElevation
|
|
109
|
+
variant="text"
|
|
110
|
+
onClick={() => console.log('click')}
|
|
111
|
+
>
|
|
107
112
|
Editar
|
|
108
113
|
</Button>
|
|
109
114
|
),
|
|
@@ -119,7 +124,12 @@ export const Default = args => {
|
|
|
119
124
|
origin: 'origin',
|
|
120
125
|
id: '2',
|
|
121
126
|
action: (
|
|
122
|
-
<Button
|
|
127
|
+
<Button
|
|
128
|
+
color="primary"
|
|
129
|
+
disableElevation
|
|
130
|
+
variant="text"
|
|
131
|
+
onClick={() => console.log('click')}
|
|
132
|
+
>
|
|
123
133
|
Editar
|
|
124
134
|
</Button>
|
|
125
135
|
),
|
|
@@ -135,7 +145,12 @@ export const Default = args => {
|
|
|
135
145
|
origin: 'origin',
|
|
136
146
|
id: '3',
|
|
137
147
|
action: (
|
|
138
|
-
<Button
|
|
148
|
+
<Button
|
|
149
|
+
color="primary"
|
|
150
|
+
disableElevation
|
|
151
|
+
variant="text"
|
|
152
|
+
onClick={() => console.log('click')}
|
|
153
|
+
>
|
|
139
154
|
Editar
|
|
140
155
|
</Button>
|
|
141
156
|
),
|
|
@@ -151,7 +166,12 @@ export const Default = args => {
|
|
|
151
166
|
origin: 'origin',
|
|
152
167
|
id: '4',
|
|
153
168
|
action: (
|
|
154
|
-
<Button
|
|
169
|
+
<Button
|
|
170
|
+
color="primary"
|
|
171
|
+
disableElevation
|
|
172
|
+
variant="text"
|
|
173
|
+
onClick={() => console.log('click')}
|
|
174
|
+
>
|
|
155
175
|
Editar
|
|
156
176
|
</Button>
|
|
157
177
|
),
|
|
@@ -167,7 +187,12 @@ export const Default = args => {
|
|
|
167
187
|
origin: 'origin',
|
|
168
188
|
id: '5',
|
|
169
189
|
action: (
|
|
170
|
-
<Button
|
|
190
|
+
<Button
|
|
191
|
+
color="primary"
|
|
192
|
+
disableElevation
|
|
193
|
+
variant="text"
|
|
194
|
+
onClick={() => console.log('click')}
|
|
195
|
+
>
|
|
171
196
|
Editar
|
|
172
197
|
</Button>
|
|
173
198
|
),
|
|
@@ -183,7 +208,12 @@ export const Default = args => {
|
|
|
183
208
|
origin: 'origin',
|
|
184
209
|
id: '6',
|
|
185
210
|
action: (
|
|
186
|
-
<Button
|
|
211
|
+
<Button
|
|
212
|
+
color="primary"
|
|
213
|
+
disableElevation
|
|
214
|
+
variant="text"
|
|
215
|
+
onClick={() => console.log('click')}
|
|
216
|
+
>
|
|
187
217
|
Editar
|
|
188
218
|
</Button>
|
|
189
219
|
),
|
|
@@ -199,7 +229,12 @@ export const Default = args => {
|
|
|
199
229
|
origin: 'origin',
|
|
200
230
|
id: '7',
|
|
201
231
|
action: (
|
|
202
|
-
<Button
|
|
232
|
+
<Button
|
|
233
|
+
color="primary"
|
|
234
|
+
disableElevation
|
|
235
|
+
variant="text"
|
|
236
|
+
onClick={() => console.log('click')}
|
|
237
|
+
>
|
|
203
238
|
Editar
|
|
204
239
|
</Button>
|
|
205
240
|
),
|
|
@@ -215,7 +250,12 @@ export const Default = args => {
|
|
|
215
250
|
origin: 'origin',
|
|
216
251
|
id: '8',
|
|
217
252
|
action: (
|
|
218
|
-
<Button
|
|
253
|
+
<Button
|
|
254
|
+
color="primary"
|
|
255
|
+
disableElevation
|
|
256
|
+
variant="text"
|
|
257
|
+
onClick={() => console.log('click')}
|
|
258
|
+
>
|
|
219
259
|
Editar
|
|
220
260
|
</Button>
|
|
221
261
|
),
|
|
@@ -231,7 +271,12 @@ export const Default = args => {
|
|
|
231
271
|
origin: 'origin',
|
|
232
272
|
id: '8',
|
|
233
273
|
action: (
|
|
234
|
-
<Button
|
|
274
|
+
<Button
|
|
275
|
+
color="primary"
|
|
276
|
+
disableElevation
|
|
277
|
+
variant="text"
|
|
278
|
+
onClick={() => console.log('click')}
|
|
279
|
+
>
|
|
235
280
|
Editar
|
|
236
281
|
</Button>
|
|
237
282
|
),
|
|
@@ -247,7 +292,12 @@ export const Default = args => {
|
|
|
247
292
|
origin: 'origin',
|
|
248
293
|
id: '8',
|
|
249
294
|
action: (
|
|
250
|
-
<Button
|
|
295
|
+
<Button
|
|
296
|
+
color="primary"
|
|
297
|
+
disableElevation
|
|
298
|
+
variant="text"
|
|
299
|
+
onClick={() => console.log('click')}
|
|
300
|
+
>
|
|
251
301
|
Editar
|
|
252
302
|
</Button>
|
|
253
303
|
),
|
|
@@ -263,7 +313,12 @@ export const Default = args => {
|
|
|
263
313
|
origin: 'origin',
|
|
264
314
|
id: '8',
|
|
265
315
|
action: (
|
|
266
|
-
<Button
|
|
316
|
+
<Button
|
|
317
|
+
color="primary"
|
|
318
|
+
disableElevation
|
|
319
|
+
variant="text"
|
|
320
|
+
onClick={() => console.log('click')}
|
|
321
|
+
>
|
|
267
322
|
Editar
|
|
268
323
|
</Button>
|
|
269
324
|
),
|
|
@@ -279,7 +334,12 @@ export const Default = args => {
|
|
|
279
334
|
origin: 'origin',
|
|
280
335
|
id: '8',
|
|
281
336
|
action: (
|
|
282
|
-
<Button
|
|
337
|
+
<Button
|
|
338
|
+
color="primary"
|
|
339
|
+
disableElevation
|
|
340
|
+
variant="text"
|
|
341
|
+
onClick={() => console.log('click')}
|
|
342
|
+
>
|
|
283
343
|
Editar
|
|
284
344
|
</Button>
|
|
285
345
|
),
|
|
@@ -295,33 +355,38 @@ export const Default = args => {
|
|
|
295
355
|
origin: 'origin',
|
|
296
356
|
id: '8',
|
|
297
357
|
action: (
|
|
298
|
-
<Button
|
|
358
|
+
<Button
|
|
359
|
+
color="primary"
|
|
360
|
+
disableElevation
|
|
361
|
+
variant="text"
|
|
362
|
+
onClick={() => console.log('click')}
|
|
363
|
+
>
|
|
299
364
|
Editar
|
|
300
365
|
</Button>
|
|
301
366
|
),
|
|
302
367
|
},
|
|
303
|
-
]
|
|
304
|
-
|
|
368
|
+
]
|
|
369
|
+
|
|
305
370
|
const [hiddenColumns, setHiddenColumns] = useState<string[]>(() =>
|
|
306
371
|
JSON.parse(localStorage.getItem('hiddenColumns') || '[]'),
|
|
307
|
-
)
|
|
372
|
+
)
|
|
308
373
|
|
|
309
374
|
const handleColumnVisibilityChange = (columnId: string, isVisible: boolean) => {
|
|
310
|
-
setHiddenColumns(prevHiddenColumns => {
|
|
375
|
+
setHiddenColumns((prevHiddenColumns) => {
|
|
311
376
|
const updatedHiddenColumns = isVisible
|
|
312
|
-
? prevHiddenColumns.filter(col => col !== columnId)
|
|
313
|
-
: [...prevHiddenColumns, columnId]
|
|
377
|
+
? prevHiddenColumns.filter((col) => col !== columnId)
|
|
378
|
+
: [...prevHiddenColumns, columnId]
|
|
314
379
|
|
|
315
|
-
localStorage.setItem('hiddenColumns', JSON.stringify(updatedHiddenColumns))
|
|
380
|
+
localStorage.setItem('hiddenColumns', JSON.stringify(updatedHiddenColumns))
|
|
316
381
|
|
|
317
|
-
console.log('Colunas escondidas:::', updatedHiddenColumns)
|
|
318
|
-
return updatedHiddenColumns
|
|
319
|
-
})
|
|
320
|
-
}
|
|
382
|
+
console.log('Colunas escondidas:::', updatedHiddenColumns)
|
|
383
|
+
return updatedHiddenColumns
|
|
384
|
+
})
|
|
385
|
+
}
|
|
321
386
|
|
|
322
387
|
useEffect(() => {
|
|
323
|
-
console.info('Colunas escondidas ao carregar:::', hiddenColumns)
|
|
324
|
-
}, [hiddenColumns])
|
|
388
|
+
console.info('Colunas escondidas ao carregar:::', hiddenColumns)
|
|
389
|
+
}, [hiddenColumns])
|
|
325
390
|
|
|
326
391
|
return (
|
|
327
392
|
<>
|
|
@@ -338,12 +403,12 @@ export const Default = args => {
|
|
|
338
403
|
<CreateIcon sx={{ fontSize: 18, color: '#DE8B50' }} />
|
|
339
404
|
</div>,
|
|
340
405
|
]}
|
|
341
|
-
onClick={value => console.log('onClick line:', value)}
|
|
342
|
-
onMouseOver={value => console.log('onMouseOver line:', value)}
|
|
343
|
-
onMouseOut={value => console.log('onMouseOut line:', value)}
|
|
406
|
+
onClick={(value) => console.log('onClick line:', value)}
|
|
407
|
+
onMouseOver={(value) => console.log('onMouseOver line:', value)}
|
|
408
|
+
onMouseOut={(value) => console.log('onMouseOut line:', value)}
|
|
344
409
|
onClearFieldsClick={() => console.log('onClearFieldsClick')}
|
|
345
|
-
onFilterClick={column => console.log('onFilterClick', column)}
|
|
346
|
-
onChangePage={pagination => console.log('onChangePage', pagination)}
|
|
410
|
+
onFilterClick={(column) => console.log('onFilterClick', column)}
|
|
411
|
+
onChangePage={(pagination) => console.log('onChangePage', pagination)}
|
|
347
412
|
onSortClick={(column, direction) => console.log('onSortClick', column, direction)}
|
|
348
413
|
pagination={{
|
|
349
414
|
pageIndex: 1,
|
|
@@ -363,12 +428,12 @@ export const Default = args => {
|
|
|
363
428
|
{...args}
|
|
364
429
|
/>
|
|
365
430
|
</>
|
|
366
|
-
)
|
|
367
|
-
}
|
|
431
|
+
)
|
|
432
|
+
}
|
|
368
433
|
|
|
369
|
-
Default.args = {}
|
|
434
|
+
Default.args = {}
|
|
370
435
|
|
|
371
|
-
export const RowDnd = args => {
|
|
436
|
+
export const RowDnd = (args) => {
|
|
372
437
|
const [data, setData] = useState([
|
|
373
438
|
{
|
|
374
439
|
date: format(new Date('8-14-2023 21:29'), 'dd/MM/yyyy'),
|
|
@@ -380,7 +445,12 @@ export const RowDnd = args => {
|
|
|
380
445
|
origin: 'origin',
|
|
381
446
|
id: '1',
|
|
382
447
|
action: (
|
|
383
|
-
<Button
|
|
448
|
+
<Button
|
|
449
|
+
color="primary"
|
|
450
|
+
disableElevation
|
|
451
|
+
variant="text"
|
|
452
|
+
onClick={() => console.log('click')}
|
|
453
|
+
>
|
|
384
454
|
Editar
|
|
385
455
|
</Button>
|
|
386
456
|
),
|
|
@@ -396,7 +466,12 @@ export const RowDnd = args => {
|
|
|
396
466
|
origin: 'origin',
|
|
397
467
|
id: '2',
|
|
398
468
|
action: (
|
|
399
|
-
<Button
|
|
469
|
+
<Button
|
|
470
|
+
color="primary"
|
|
471
|
+
disableElevation
|
|
472
|
+
variant="text"
|
|
473
|
+
onClick={() => console.log('click')}
|
|
474
|
+
>
|
|
400
475
|
Editar
|
|
401
476
|
</Button>
|
|
402
477
|
),
|
|
@@ -412,7 +487,12 @@ export const RowDnd = args => {
|
|
|
412
487
|
origin: 'origin',
|
|
413
488
|
id: '3',
|
|
414
489
|
action: (
|
|
415
|
-
<Button
|
|
490
|
+
<Button
|
|
491
|
+
color="primary"
|
|
492
|
+
disableElevation
|
|
493
|
+
variant="text"
|
|
494
|
+
onClick={() => console.log('click')}
|
|
495
|
+
>
|
|
416
496
|
Editar
|
|
417
497
|
</Button>
|
|
418
498
|
),
|
|
@@ -428,7 +508,12 @@ export const RowDnd = args => {
|
|
|
428
508
|
origin: 'origin',
|
|
429
509
|
id: '4',
|
|
430
510
|
action: (
|
|
431
|
-
<Button
|
|
511
|
+
<Button
|
|
512
|
+
color="primary"
|
|
513
|
+
disableElevation
|
|
514
|
+
variant="text"
|
|
515
|
+
onClick={() => console.log('click')}
|
|
516
|
+
>
|
|
432
517
|
Editar
|
|
433
518
|
</Button>
|
|
434
519
|
),
|
|
@@ -444,7 +529,12 @@ export const RowDnd = args => {
|
|
|
444
529
|
origin: 'origin',
|
|
445
530
|
id: '5',
|
|
446
531
|
action: (
|
|
447
|
-
<Button
|
|
532
|
+
<Button
|
|
533
|
+
color="primary"
|
|
534
|
+
disableElevation
|
|
535
|
+
variant="text"
|
|
536
|
+
onClick={() => console.log('click')}
|
|
537
|
+
>
|
|
448
538
|
Editar
|
|
449
539
|
</Button>
|
|
450
540
|
),
|
|
@@ -460,7 +550,12 @@ export const RowDnd = args => {
|
|
|
460
550
|
origin: 'origin',
|
|
461
551
|
id: '6',
|
|
462
552
|
action: (
|
|
463
|
-
<Button
|
|
553
|
+
<Button
|
|
554
|
+
color="primary"
|
|
555
|
+
disableElevation
|
|
556
|
+
variant="text"
|
|
557
|
+
onClick={() => console.log('click')}
|
|
558
|
+
>
|
|
464
559
|
Editar
|
|
465
560
|
</Button>
|
|
466
561
|
),
|
|
@@ -476,7 +571,12 @@ export const RowDnd = args => {
|
|
|
476
571
|
origin: 'origin',
|
|
477
572
|
id: '7',
|
|
478
573
|
action: (
|
|
479
|
-
<Button
|
|
574
|
+
<Button
|
|
575
|
+
color="primary"
|
|
576
|
+
disableElevation
|
|
577
|
+
variant="text"
|
|
578
|
+
onClick={() => console.log('click')}
|
|
579
|
+
>
|
|
480
580
|
Editar
|
|
481
581
|
</Button>
|
|
482
582
|
),
|
|
@@ -492,7 +592,12 @@ export const RowDnd = args => {
|
|
|
492
592
|
origin: 'origin',
|
|
493
593
|
id: '55',
|
|
494
594
|
action: (
|
|
495
|
-
<Button
|
|
595
|
+
<Button
|
|
596
|
+
color="primary"
|
|
597
|
+
disableElevation
|
|
598
|
+
variant="text"
|
|
599
|
+
onClick={() => console.log('click')}
|
|
600
|
+
>
|
|
496
601
|
Editar
|
|
497
602
|
</Button>
|
|
498
603
|
),
|
|
@@ -508,7 +613,12 @@ export const RowDnd = args => {
|
|
|
508
613
|
origin: 'origin',
|
|
509
614
|
id: '8',
|
|
510
615
|
action: (
|
|
511
|
-
<Button
|
|
616
|
+
<Button
|
|
617
|
+
color="primary"
|
|
618
|
+
disableElevation
|
|
619
|
+
variant="text"
|
|
620
|
+
onClick={() => console.log('click')}
|
|
621
|
+
>
|
|
512
622
|
Editar
|
|
513
623
|
</Button>
|
|
514
624
|
),
|
|
@@ -524,7 +634,12 @@ export const RowDnd = args => {
|
|
|
524
634
|
origin: 'origin',
|
|
525
635
|
id: '9',
|
|
526
636
|
action: (
|
|
527
|
-
<Button
|
|
637
|
+
<Button
|
|
638
|
+
color="primary"
|
|
639
|
+
disableElevation
|
|
640
|
+
variant="text"
|
|
641
|
+
onClick={() => console.log('click')}
|
|
642
|
+
>
|
|
528
643
|
Editar
|
|
529
644
|
</Button>
|
|
530
645
|
),
|
|
@@ -540,7 +655,12 @@ export const RowDnd = args => {
|
|
|
540
655
|
origin: 'origin',
|
|
541
656
|
id: '10',
|
|
542
657
|
action: (
|
|
543
|
-
<Button
|
|
658
|
+
<Button
|
|
659
|
+
color="primary"
|
|
660
|
+
disableElevation
|
|
661
|
+
variant="text"
|
|
662
|
+
onClick={() => console.log('click')}
|
|
663
|
+
>
|
|
544
664
|
Editar
|
|
545
665
|
</Button>
|
|
546
666
|
),
|
|
@@ -556,7 +676,12 @@ export const RowDnd = args => {
|
|
|
556
676
|
origin: 'origin',
|
|
557
677
|
id: '11',
|
|
558
678
|
action: (
|
|
559
|
-
<Button
|
|
679
|
+
<Button
|
|
680
|
+
color="primary"
|
|
681
|
+
disableElevation
|
|
682
|
+
variant="text"
|
|
683
|
+
onClick={() => console.log('click')}
|
|
684
|
+
>
|
|
560
685
|
Editar
|
|
561
686
|
</Button>
|
|
562
687
|
),
|
|
@@ -572,12 +697,17 @@ export const RowDnd = args => {
|
|
|
572
697
|
origin: 'origin',
|
|
573
698
|
id: '12',
|
|
574
699
|
action: (
|
|
575
|
-
<Button
|
|
700
|
+
<Button
|
|
701
|
+
color="primary"
|
|
702
|
+
disableElevation
|
|
703
|
+
variant="text"
|
|
704
|
+
onClick={() => console.log('click')}
|
|
705
|
+
>
|
|
576
706
|
Editar
|
|
577
707
|
</Button>
|
|
578
708
|
),
|
|
579
709
|
},
|
|
580
|
-
])
|
|
710
|
+
])
|
|
581
711
|
|
|
582
712
|
return (
|
|
583
713
|
<>
|
|
@@ -586,11 +716,11 @@ export const RowDnd = args => {
|
|
|
586
716
|
columns={dnd_columns}
|
|
587
717
|
stickyHeader
|
|
588
718
|
draggable
|
|
589
|
-
onDragEnd={data => setData(data)}
|
|
719
|
+
onDragEnd={(data) => setData(data)}
|
|
590
720
|
{...args}
|
|
591
721
|
/>
|
|
592
722
|
</>
|
|
593
|
-
)
|
|
594
|
-
}
|
|
723
|
+
)
|
|
724
|
+
}
|
|
595
725
|
|
|
596
|
-
RowDnd.args = {}
|
|
726
|
+
RowDnd.args = {}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
-
import UncontrolledTabs from '../components/UncontrolledTabs/UncontrolledTabs'
|
|
5
|
-
import { DataTabs } from '../types'
|
|
6
|
-
import { Typography } from '@mui/material'
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
4
|
+
import UncontrolledTabs from '../components/UncontrolledTabs/UncontrolledTabs'
|
|
5
|
+
import { DataTabs } from '../types'
|
|
6
|
+
import { Typography } from '@mui/material'
|
|
7
7
|
|
|
8
8
|
const data: DataTabs[] = [
|
|
9
9
|
{
|
|
@@ -11,8 +11,8 @@ const data: DataTabs[] = [
|
|
|
11
11
|
id: 'panel-1',
|
|
12
12
|
children: (
|
|
13
13
|
<Typography>
|
|
14
|
-
Tab 1 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus
|
|
15
|
-
blandit leo lobortis eget.
|
|
14
|
+
Tab 1 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus
|
|
15
|
+
ex, sit amet blandit leo lobortis eget.
|
|
16
16
|
</Typography>
|
|
17
17
|
),
|
|
18
18
|
},
|
|
@@ -21,12 +21,12 @@ const data: DataTabs[] = [
|
|
|
21
21
|
id: 'panel-2',
|
|
22
22
|
children: (
|
|
23
23
|
<Typography>
|
|
24
|
-
Tab 2 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus
|
|
25
|
-
blandit leo lobortis eget.
|
|
24
|
+
Tab 2 - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus
|
|
25
|
+
ex, sit amet blandit leo lobortis eget.
|
|
26
26
|
</Typography>
|
|
27
27
|
),
|
|
28
28
|
},
|
|
29
|
-
]
|
|
29
|
+
]
|
|
30
30
|
|
|
31
31
|
const meta = {
|
|
32
32
|
title: 'Uncontrolled/Tabs',
|
|
@@ -38,37 +38,42 @@ const meta = {
|
|
|
38
38
|
argTypes: {
|
|
39
39
|
tabs: data,
|
|
40
40
|
},
|
|
41
|
-
} satisfies Meta<typeof UncontrolledTabs
|
|
41
|
+
} satisfies Meta<typeof UncontrolledTabs>
|
|
42
42
|
|
|
43
|
-
export default meta
|
|
43
|
+
export default meta
|
|
44
44
|
|
|
45
|
-
type Story = StoryObj<typeof meta
|
|
45
|
+
type Story = StoryObj<typeof meta>
|
|
46
46
|
|
|
47
47
|
export const Playground: Story = {
|
|
48
48
|
args: {
|
|
49
49
|
tab: 0,
|
|
50
50
|
tabs: data,
|
|
51
51
|
},
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
|
|
54
54
|
export const UncontrolledTabsBasic = () => {
|
|
55
|
-
const [tab, setTab] = useState(0)
|
|
55
|
+
const [tab, setTab] = useState(0)
|
|
56
56
|
return (
|
|
57
57
|
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
58
58
|
<UncontrolledTabs tab={tab} tabs={data} onTabChange={(evt, tab) => setTab(tab)} />
|
|
59
59
|
</div>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
62
|
|
|
63
|
-
UncontrolledTabsBasic.storyName = 'Uncontrolled Tabs'
|
|
63
|
+
UncontrolledTabsBasic.storyName = 'Uncontrolled Tabs'
|
|
64
64
|
|
|
65
65
|
export const UncontrolledTabsInfo = () => {
|
|
66
|
-
const [tab, setTab] = useState(0)
|
|
66
|
+
const [tab, setTab] = useState(0)
|
|
67
67
|
return (
|
|
68
68
|
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
69
|
-
<UncontrolledTabs
|
|
69
|
+
<UncontrolledTabs
|
|
70
|
+
info={<div>Informação dentro da tab</div>}
|
|
71
|
+
tab={tab}
|
|
72
|
+
tabs={data}
|
|
73
|
+
onTabChange={(evt, tab) => setTab(tab)}
|
|
74
|
+
/>
|
|
70
75
|
</div>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
76
|
+
)
|
|
77
|
+
}
|
|
73
78
|
|
|
74
|
-
UncontrolledTabsInfo.storyName = 'Uncontrolled Tabs With Info'
|
|
79
|
+
UncontrolledTabsInfo.storyName = 'Uncontrolled Tabs With Info'
|
|
File without changes
|