@weni/unnnic-system 2.14.2 → 2.15.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/CHANGELOG.md +9 -0
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +2260 -2187
- package/dist/unnnic.umd.js +28 -29
- package/package.json +1 -1
- package/src/components/Collapse/Collapse.vue +2 -0
- package/src/components/Collapse/__tests__/Collapse.spec.js +117 -0
- package/src/components/Collapse/__tests__/__snapshots__/Collapse.spec.js.snap +10 -0
- package/src/components/Drawer/Drawer.vue +14 -1
- package/src/components/Drawer/__tests__/Drawer.spec.js +253 -0
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +23 -0
- package/src/components/ModalDialog/ModalDialog.vue +12 -1
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +256 -0
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +24 -0
- package/src/components/TableNext/TableNext.vue +67 -10
- package/src/components/TableNext/__test__/TableNext.spec.js +45 -2
- package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +8 -8
- package/src/components/TableNext/__test__/validation.unit.test.js +8 -7
- package/src/components/TableNext/validation.js +6 -8
- package/src/components/Tag/BrandTag.vue +0 -4
- package/src/components/Tag/DefaultTag.vue +33 -18
- package/src/components/Tag/Tag.vue +8 -3
- package/src/stories/TableNext.stories.js +81 -27
- package/src/stories/Tag.stories.js +28 -3
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<section
|
|
3
3
|
:class="`unnnic-tag
|
|
4
4
|
${!disabled ? `unnnic-tag-scheme--${scheme}` : `unnnic-tag--disabled`}
|
|
5
5
|
${clickable ? 'unnnic-tag--clickable' : ''}`"
|
|
6
6
|
>
|
|
7
|
+
<section
|
|
8
|
+
v-if="leftIcon"
|
|
9
|
+
class="unnnic-tag__icon"
|
|
10
|
+
>
|
|
11
|
+
<UnnnicIcon
|
|
12
|
+
:icon="leftIcon"
|
|
13
|
+
:scheme="scheme"
|
|
14
|
+
size="sm"
|
|
15
|
+
/>
|
|
16
|
+
</section>
|
|
7
17
|
<span
|
|
8
18
|
:class="`unnnic-tag__label
|
|
9
|
-
${hasCloseIcon ? 'unnnic-tag__label--hasIcon' : ''}
|
|
10
19
|
${disabled ? 'unnnic-tag__label--disabled' : ''}`"
|
|
11
20
|
>{{ text }}</span
|
|
12
21
|
>
|
|
13
|
-
<
|
|
14
|
-
v-if="hasCloseIcon"
|
|
15
|
-
class="unnnic-tag__icon"
|
|
16
|
-
@click.stop="emitClose"
|
|
22
|
+
<section
|
|
23
|
+
v-if="rightIcon || hasCloseIcon"
|
|
24
|
+
:class="{ 'unnnic-tag__icon': true, clickable: !rightIcon }"
|
|
25
|
+
@click.stop="hasCloseIcon ? emitClose() : () => {}"
|
|
17
26
|
>
|
|
18
27
|
<UnnnicIcon
|
|
19
|
-
icon="close
|
|
20
|
-
scheme="neutral-darkest"
|
|
21
|
-
size="
|
|
28
|
+
:icon="rightIcon || 'close'"
|
|
29
|
+
:scheme="rightIcon ? scheme : 'neutral-darkest'"
|
|
30
|
+
size="sm"
|
|
22
31
|
/>
|
|
23
|
-
</
|
|
24
|
-
</
|
|
32
|
+
</section>
|
|
33
|
+
</section>
|
|
25
34
|
</template>
|
|
26
35
|
|
|
27
36
|
<script>
|
|
@@ -53,6 +62,14 @@ export default {
|
|
|
53
62
|
type: String,
|
|
54
63
|
default: 'aux-purple',
|
|
55
64
|
},
|
|
65
|
+
leftIcon: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: null,
|
|
68
|
+
},
|
|
69
|
+
rightIcon: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: null,
|
|
72
|
+
},
|
|
56
73
|
},
|
|
57
74
|
methods: {
|
|
58
75
|
closeClicked() {
|
|
@@ -84,6 +101,7 @@ export default {
|
|
|
84
101
|
align-items: center;
|
|
85
102
|
justify-content: center;
|
|
86
103
|
border-radius: $unnnic-border-radius-pill;
|
|
104
|
+
padding: 0 $unnnic-spacing-xs;
|
|
87
105
|
|
|
88
106
|
&--disabled {
|
|
89
107
|
background-color: $unnnic-color-background-sky;
|
|
@@ -107,22 +125,19 @@ export default {
|
|
|
107
125
|
font-size: $unnnic-font-size-body-md;
|
|
108
126
|
font-weight: $unnnic-font-weight-regular;
|
|
109
127
|
line-height: ($unnnic-font-size-body-md + $unnnic-line-height-medium);
|
|
110
|
-
padding: $unnnic-spacing-stack-nano
|
|
128
|
+
padding: $unnnic-spacing-stack-nano;
|
|
111
129
|
color: $unnnic-color-neutral-darkest;
|
|
112
130
|
|
|
113
131
|
&--disabled {
|
|
114
132
|
color: $unnnic-color-neutral-cloudy;
|
|
115
133
|
}
|
|
116
|
-
|
|
117
|
-
&--hasIcon {
|
|
118
|
-
padding-left: $unnnic-inline-ant;
|
|
119
|
-
padding-right: $unnnic-spacing-stack-nano;
|
|
120
|
-
}
|
|
121
134
|
}
|
|
122
135
|
|
|
123
136
|
&__icon {
|
|
124
137
|
display: flex;
|
|
125
|
-
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.clickable {
|
|
126
141
|
cursor: pointer;
|
|
127
142
|
}
|
|
128
143
|
}
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
:clickable="clickable"
|
|
13
13
|
:tooltipText="tooltipText"
|
|
14
14
|
:enableTooltip="enableTooltip"
|
|
15
|
-
:
|
|
15
|
+
:leftIcon="leftIcon"
|
|
16
|
+
:rightIcon="rightIcon"
|
|
16
17
|
/>
|
|
17
18
|
</template>
|
|
18
19
|
|
|
@@ -67,9 +68,13 @@ export default {
|
|
|
67
68
|
type: Boolean,
|
|
68
69
|
default: false,
|
|
69
70
|
},
|
|
70
|
-
|
|
71
|
+
leftIcon: {
|
|
71
72
|
type: String,
|
|
72
|
-
default:
|
|
73
|
+
default: '',
|
|
74
|
+
},
|
|
75
|
+
rightIcon: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: '',
|
|
73
78
|
},
|
|
74
79
|
},
|
|
75
80
|
computed: {
|
|
@@ -2,9 +2,46 @@ import UnnnicTableNext from '../components/TableNext/TableNext.vue';
|
|
|
2
2
|
import UnnnicButton from '../components/Button/Button.vue';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title: '
|
|
5
|
+
title: 'Data Display/TableNext',
|
|
6
6
|
component: UnnnicTableNext,
|
|
7
|
-
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
headers: {
|
|
10
|
+
description:
|
|
11
|
+
'Array of header items defining the structure of the table header.',
|
|
12
|
+
control: 'object',
|
|
13
|
+
},
|
|
14
|
+
rows: {
|
|
15
|
+
description: 'Array of row items defining the content of the table rows.',
|
|
16
|
+
control: 'object',
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
description:
|
|
20
|
+
'The size of the table. Options are `sm` for small and `md` for medium.',
|
|
21
|
+
control: { type: 'select' },
|
|
22
|
+
options: ['sm', 'md'],
|
|
23
|
+
},
|
|
24
|
+
pagination: {
|
|
25
|
+
description: 'The current page number for pagination.',
|
|
26
|
+
control: 'number',
|
|
27
|
+
},
|
|
28
|
+
paginationTotal: {
|
|
29
|
+
description: 'The total number of pages available for pagination.',
|
|
30
|
+
control: 'number',
|
|
31
|
+
},
|
|
32
|
+
paginationInterval: {
|
|
33
|
+
description: 'The number of items displayed per page.',
|
|
34
|
+
control: 'number',
|
|
35
|
+
},
|
|
36
|
+
isLoading: {
|
|
37
|
+
description: 'Indicates whether the table data is loading.',
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
},
|
|
40
|
+
hideHeaders: {
|
|
41
|
+
description: 'Determines if the table headers should be hidden.',
|
|
42
|
+
control: 'boolean',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
8
45
|
render: (args) => ({
|
|
9
46
|
components: {
|
|
10
47
|
UnnnicTableNext,
|
|
@@ -19,7 +56,7 @@ export default {
|
|
|
19
56
|
headers: [
|
|
20
57
|
{
|
|
21
58
|
content: 'ID',
|
|
22
|
-
size:
|
|
59
|
+
size: 'auto',
|
|
23
60
|
},
|
|
24
61
|
{
|
|
25
62
|
content: 'Name',
|
|
@@ -32,6 +69,7 @@ export default {
|
|
|
32
69
|
},
|
|
33
70
|
{
|
|
34
71
|
content: 'Add with friend',
|
|
72
|
+
size: 0.5,
|
|
35
73
|
},
|
|
36
74
|
],
|
|
37
75
|
rows: [],
|
|
@@ -67,32 +105,48 @@ const addButton = {
|
|
|
67
105
|
},
|
|
68
106
|
};
|
|
69
107
|
|
|
108
|
+
const rows = [
|
|
109
|
+
{
|
|
110
|
+
content: ['1', 'Alice', '30', 'USA', addButton],
|
|
111
|
+
link: {
|
|
112
|
+
url: 'https://weni.ai/',
|
|
113
|
+
target: '_blank',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
content: ['2', 'Bob', '25', 'Canada', addButton],
|
|
118
|
+
link: {
|
|
119
|
+
url: 'https://weni.ai/',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
content: ['3', 'Charlie', '35', 'UK', addButton],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
content: ['4', 'Diana', '28', 'Australia', addButton],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
content: ['5', 'Ethan', '22', 'New Zealand', addButton],
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
|
|
70
133
|
export const Default = {
|
|
71
134
|
args: {
|
|
72
|
-
rows
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
content: ['3', 'Charlie', '35', 'UK', addButton],
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
content: ['4', 'Diana', '28', 'Australia', addButton],
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
content: ['5', 'Ethan', '22', 'New Zealand', addButton],
|
|
94
|
-
},
|
|
95
|
-
],
|
|
135
|
+
rows,
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const Medium = {
|
|
140
|
+
args: {
|
|
141
|
+
rows,
|
|
142
|
+
size: 'md',
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const HideHeaders = {
|
|
147
|
+
args: {
|
|
148
|
+
rows,
|
|
149
|
+
hideHeaders: true,
|
|
96
150
|
},
|
|
97
151
|
};
|
|
98
152
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import UnnnicTag from '../components/Tag/Tag.vue';
|
|
2
2
|
import colorsList from '../utils/colorsList';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title: '
|
|
6
|
-
component:
|
|
5
|
+
title: 'Data Display/Tag',
|
|
6
|
+
component: UnnnicTag,
|
|
7
|
+
tags: ['autodocs'],
|
|
7
8
|
argTypes: {
|
|
8
9
|
text: { control: { type: 'text' } },
|
|
9
10
|
type: {
|
|
@@ -25,6 +26,30 @@ export const Default = {
|
|
|
25
26
|
},
|
|
26
27
|
};
|
|
27
28
|
|
|
29
|
+
export const LeftIcon = {
|
|
30
|
+
args: {
|
|
31
|
+
text: 'Label',
|
|
32
|
+
type: 'default',
|
|
33
|
+
leftIcon: 'check_circle',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const RightIcon = {
|
|
38
|
+
args: {
|
|
39
|
+
text: 'Label',
|
|
40
|
+
type: 'default',
|
|
41
|
+
rightIcon: 'check_circle',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const CloseIcon = {
|
|
46
|
+
args: {
|
|
47
|
+
text: 'Label',
|
|
48
|
+
type: 'default',
|
|
49
|
+
hasCloseIcon: true,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
28
53
|
export const Indicator = {
|
|
29
54
|
args: {
|
|
30
55
|
text: 'Tag Name',
|