@weni/unnnic-system 3.2.9-alpha.3 → 3.2.9-alpha.6
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 +8 -0
- package/dist/components/Chip/Chip.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +11 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-6e7b12d4.js → es-1bd57600.js} +1 -1
- package/dist/{index-531ad3f6.js → index-4cd729ce.js} +41 -32
- package/dist/{pt-br-9c8a0c50.js → pt-br-59f06c05.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.js +1 -1
- package/dist/unnnic.umd.cjs +2 -2
- package/package.json +1 -1
- package/src/components/Chip/Chip.vue +3 -2
- package/src/components/Tab/Tab.vue +37 -23
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -1
- package/src/stories/Tab.stories.js +11 -4
package/package.json
CHANGED
|
@@ -71,7 +71,7 @@ const chipClass = computed(() => {
|
|
|
71
71
|
|
|
72
72
|
.chip {
|
|
73
73
|
display: inline-flex;
|
|
74
|
-
height:
|
|
74
|
+
height: 22px;
|
|
75
75
|
padding: $unnnic-space-1 $unnnic-space-3;
|
|
76
76
|
justify-content: center;
|
|
77
77
|
align-items: center;
|
|
@@ -79,6 +79,7 @@ const chipClass = computed(() => {
|
|
|
79
79
|
flex-shrink: 0;
|
|
80
80
|
border-radius: 600px;
|
|
81
81
|
background-color: $unnnic-color-bg-base;
|
|
82
|
+
border: 1px solid transparent;
|
|
82
83
|
|
|
83
84
|
&:hover {
|
|
84
85
|
background-color: $unnnic-color-bg-soft;
|
|
@@ -96,7 +97,7 @@ const chipClass = computed(() => {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
&--border {
|
|
99
|
-
border:
|
|
100
|
+
border-color: $unnnic-color-border-base;
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
&__text {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
class="tab-head"
|
|
10
10
|
:class="{
|
|
11
11
|
'tab-head--active': localValue === tab,
|
|
12
|
+
'tab-head--disabled': disabledTabs?.includes(tab),
|
|
12
13
|
}"
|
|
13
14
|
@click="change(tab)"
|
|
14
15
|
>
|
|
@@ -20,10 +21,9 @@
|
|
|
20
21
|
side="bottom"
|
|
21
22
|
>
|
|
22
23
|
<UnnnicIcon
|
|
23
|
-
icon="
|
|
24
|
+
icon="help"
|
|
24
25
|
:size="size === 'sm' ? 'xs' : 'sm'"
|
|
25
|
-
|
|
26
|
-
scheme="neutral-cleanest"
|
|
26
|
+
scheme="fg-base"
|
|
27
27
|
/>
|
|
28
28
|
</UnnnicToolTip>
|
|
29
29
|
</li>
|
|
@@ -65,6 +65,13 @@ export default {
|
|
|
65
65
|
tabs: {
|
|
66
66
|
type: Array,
|
|
67
67
|
default: null,
|
|
68
|
+
validator: (tabs) => {
|
|
69
|
+
return tabs.every((tab) => typeof tab === 'string') && tabs.length <= 5;
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
disabledTabs: {
|
|
73
|
+
type: Array,
|
|
74
|
+
default: null,
|
|
68
75
|
},
|
|
69
76
|
},
|
|
70
77
|
emits: ['change'],
|
|
@@ -105,6 +112,10 @@ export default {
|
|
|
105
112
|
return '';
|
|
106
113
|
},
|
|
107
114
|
change(value) {
|
|
115
|
+
if (this.disabledTabs?.includes(value)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
108
119
|
this.localValue = value;
|
|
109
120
|
this.$emit('change', this.localValue);
|
|
110
121
|
},
|
|
@@ -119,18 +130,15 @@ export default {
|
|
|
119
130
|
display: flex;
|
|
120
131
|
align-items: flex-start;
|
|
121
132
|
justify-content: space-between;
|
|
122
|
-
color: $unnnic-color-
|
|
123
|
-
font
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
line-height: ($unnnic-font-size-body-lg + $unnnic-line-height-medium);
|
|
127
|
-
margin-bottom: $unnnic-inset-sm;
|
|
128
|
-
border-bottom: $unnnic-border-width-thinner solid $unnnic-color-neutral-soft;
|
|
133
|
+
color: $unnnic-color-fg-base;
|
|
134
|
+
font: $unnnic-font-action;
|
|
135
|
+
margin-bottom: $unnnic-space-4;
|
|
136
|
+
border-bottom: $unnnic-border-width-thinner solid $unnnic-color-border-base;
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
.tab-content {
|
|
132
140
|
display: flex;
|
|
133
|
-
gap: $unnnic-
|
|
141
|
+
gap: $unnnic-space-6;
|
|
134
142
|
|
|
135
143
|
margin: 0;
|
|
136
144
|
padding: 0;
|
|
@@ -139,27 +147,24 @@ export default {
|
|
|
139
147
|
|
|
140
148
|
.tab-head {
|
|
141
149
|
display: flex;
|
|
142
|
-
gap: $unnnic-
|
|
150
|
+
gap: $unnnic-space-2;
|
|
143
151
|
align-items: center;
|
|
144
152
|
|
|
145
153
|
cursor: pointer;
|
|
146
|
-
|
|
154
|
+
padding: $unnnic-space-2 $unnnic-space-4;
|
|
147
155
|
|
|
148
156
|
.unnnic-tooltip {
|
|
149
157
|
display: flex;
|
|
150
158
|
}
|
|
151
159
|
|
|
152
160
|
&:hover {
|
|
153
|
-
color: $unnnic-color-
|
|
161
|
+
color: $unnnic-color-fg-emphasized;
|
|
154
162
|
}
|
|
155
163
|
}
|
|
156
164
|
|
|
157
165
|
.tab-head--active {
|
|
158
|
-
|
|
159
|
-
font
|
|
160
|
-
color: $unnnic-color-neutral-black;
|
|
161
|
-
font-size: $unnnic-font-size-body-lg;
|
|
162
|
-
line-height: ($unnnic-font-size-body-lg + $unnnic-line-height-medium);
|
|
166
|
+
color: $unnnic-color-fg-emphasized;
|
|
167
|
+
font: $unnnic-font-action;
|
|
163
168
|
transition: 0.4s;
|
|
164
169
|
|
|
165
170
|
position: relative;
|
|
@@ -168,14 +173,23 @@ export default {
|
|
|
168
173
|
content: '';
|
|
169
174
|
|
|
170
175
|
position: absolute;
|
|
171
|
-
bottom:
|
|
172
|
-
left:
|
|
176
|
+
bottom: 0;
|
|
177
|
+
left: 0;
|
|
173
178
|
|
|
174
179
|
display: block;
|
|
175
180
|
|
|
176
|
-
width:
|
|
181
|
+
width: 100%;
|
|
177
182
|
|
|
178
|
-
border-bottom: $unnnic-border-width-thin solid $unnnic-color-
|
|
183
|
+
border-bottom: $unnnic-border-width-thin solid $unnnic-color-border-active;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.tab-head--disabled {
|
|
188
|
+
color: $unnnic-color-fg-muted;
|
|
189
|
+
cursor: default;
|
|
190
|
+
|
|
191
|
+
&:hover {
|
|
192
|
+
color: $unnnic-color-fg-muted;
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
195
|
|
|
@@ -4,7 +4,7 @@ exports[`Tab.vue > matches the snapshot 1`] = `
|
|
|
4
4
|
"<div data-v-b4e39fac="" class="tab size-md">
|
|
5
5
|
<header data-v-b4e39fac="" class="tab-header">
|
|
6
6
|
<ul data-v-b4e39fac="" class="tab-content">
|
|
7
|
-
<li data-v-b4e39fac="" class="tab-head">tab1<div data-v-bf0cf546="" data-v-b4e39fac="" class="unnnic-tooltip"><span data-v-26446d8e="" data-v-b4e39fac="" class="material-symbols-rounded unnnic-icon-scheme--
|
|
7
|
+
<li data-v-b4e39fac="" class="tab-head">tab1<div data-v-bf0cf546="" data-v-b4e39fac="" class="unnnic-tooltip"><span data-v-26446d8e="" data-v-b4e39fac="" class="material-symbols-rounded unnnic-icon-scheme--fg-base unnnic-icon-size--sm" data-testid="material-icon" translate="no">help</span><span data-v-bf0cf546="" class="unnnic-tooltip-label unnnic-tooltip-label-bottom" data-testid="tooltip-label" style="left: 0px; top: 8px;">Tooltip text <br data-v-bf0cf546=""><!--v-if--></span></div>
|
|
8
8
|
</li>
|
|
9
9
|
<li data-v-b4e39fac="" class="tab-head tab-head--active">tab2
|
|
10
10
|
<!--v-if-->
|
|
@@ -3,9 +3,6 @@ import unnnicTab from '../components/Tab/Tab.vue';
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'tabs/Tab',
|
|
5
5
|
component: unnnicTab,
|
|
6
|
-
argTypes: {
|
|
7
|
-
size: { control: { type: 'select', options: ['md', 'sm'] } },
|
|
8
|
-
},
|
|
9
6
|
render: (args) => ({
|
|
10
7
|
components: {
|
|
11
8
|
unnnicTab,
|
|
@@ -36,6 +33,15 @@ export default {
|
|
|
36
33
|
Second description
|
|
37
34
|
</p>
|
|
38
35
|
</template>
|
|
36
|
+
<template #tab-head-third>
|
|
37
|
+
Third
|
|
38
|
+
</template>
|
|
39
|
+
<template #tab-panel-third>
|
|
40
|
+
<h2 class="title">Third Content</h2>
|
|
41
|
+
<p class="description">
|
|
42
|
+
Third description
|
|
43
|
+
</p>
|
|
44
|
+
</template>
|
|
39
45
|
</unnnic-tab>
|
|
40
46
|
`,
|
|
41
47
|
}),
|
|
@@ -44,6 +50,7 @@ export default {
|
|
|
44
50
|
export const Default = {
|
|
45
51
|
args: {
|
|
46
52
|
initialTab: 'first',
|
|
47
|
-
tabs: ['first', 'second'],
|
|
53
|
+
tabs: ['first', 'second', 'third'],
|
|
54
|
+
disabledTabs: ['third'],
|
|
48
55
|
},
|
|
49
56
|
};
|