@weni/unnnic-system 3.10.0 → 3.11.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 +80 -0
- package/dist/assets/tokens/colors.json.d.ts +376 -0
- package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
- package/dist/components/Alert/Alert.vue.d.ts +17 -116
- package/dist/components/Alert/Alert.vue.d.ts.map +1 -1
- package/dist/components/Alert/Version1dot1.vue.d.ts +2 -38
- package/dist/components/Alert/Version1dot1.vue.d.ts.map +1 -1
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +2 -2
- package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +5 -5
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +3 -3
- package/dist/components/Banner/Banner.vue.d.ts +1 -1
- package/dist/components/Banner/InfoBanner.vue.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/ButtonIcon.vue.d.ts +1 -1
- package/dist/components/Button/types.d.ts +1 -1
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/AccountCard.vue.d.ts +5 -5
- package/dist/components/Card/BlankCard.vue.d.ts +1 -1
- package/dist/components/Card/Card.vue.d.ts +27 -27
- package/dist/components/Card/CardCompany.vue.d.ts +11 -414
- package/dist/components/Card/CardData.vue.d.ts +1 -1
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +5 -5
- package/dist/components/Card/ContentCard.vue.d.ts +3 -3
- package/dist/components/Card/DashCard.vue.d.ts +5 -5
- package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
- package/dist/components/Card/MarketplaceCard.vue.d.ts +2 -2
- package/dist/components/Card/SimpleCard.vue.d.ts +3 -3
- package/dist/components/Card/StatusCard.vue.d.ts +2 -2
- package/dist/components/Card/TitleCard.vue.d.ts +3 -3
- package/dist/components/CardImage/CardImage.vue.d.ts +24 -31
- package/dist/components/CardInformation/CardInformation.vue.d.ts +5 -5
- package/dist/components/CardProject/CardProject.vue.d.ts +3 -3
- package/dist/components/Carousel/Carousel.vue.d.ts +13 -416
- package/dist/components/Carousel/TagCarousel.vue.d.ts +12 -415
- package/dist/components/ChartBar/ChartBar.vue.d.ts +5 -5
- package/dist/components/ChartLine/ChartLine.vue.d.ts +1 -1
- package/dist/components/ChatText/ChatText.vue.d.ts +2 -2
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +21 -446
- package/dist/components/ChatsDashboardTagLive/ChatsDashboardTagLive.vue.d.ts +1 -1
- package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts +1 -1
- package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts.map +1 -1
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +5 -5
- package/dist/components/ChatsMessage/ChatsMessageStatusBackdrop.vue.d.ts +2 -2
- package/dist/components/ChatsNavbar/ChatsNavbar.vue.d.ts +1 -1
- package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.vue.d.ts +19 -26
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +28 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +1 -0
- package/dist/components/Comment/Comment.vue.d.ts +1 -1
- package/dist/components/DataArea/DataArea.vue.d.ts +2 -2
- package/dist/components/DataTable/index.vue.d.ts +1 -1
- package/dist/components/DataTable/index.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +170 -39
- package/dist/components/DatePicker/DatePicker.vue.d.ts +4 -4
- package/dist/components/Drawer/Drawer.vue.d.ts +4 -4
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/dist/components/Dropdown/LanguageSelect.vue.d.ts +3 -3
- package/dist/components/Flag.vue.d.ts +2 -2
- package/dist/components/FormElement/FormElement.vue.d.ts +51 -28
- package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
- package/dist/components/Icon.vue.d.ts +1 -1
- package/dist/components/Icon.vue.d.ts.map +1 -1
- package/dist/components/IconLoading/IconLoading.vue.d.ts +1 -1
- package/dist/components/ImportCard/ImportCard.vue.d.ts +4 -4
- package/dist/components/Input/BaseInput.vue.d.ts +11 -2
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +170 -39
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +33 -24
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +175 -44
- package/dist/components/InputNext/InputNext.vue.d.ts +4 -4
- package/dist/components/Label/Label.vue.d.ts +9 -15
- package/dist/components/Label/Label.vue.d.ts.map +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +2 -2
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +6 -6
- package/dist/components/ModalNext/ModalNext.vue.d.ts +175 -44
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +9 -9
- package/dist/components/MoodRating/MoodRating.vue.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +26 -14
- package/dist/components/PageHeader/PageHeader.vue.d.ts +28 -0
- package/dist/components/PageHeader/PageHeader.vue.d.ts.map +1 -0
- package/dist/components/PageHeader/index.d.ts +3 -0
- package/dist/components/PageHeader/index.d.ts.map +1 -0
- package/dist/components/PageHeader/types.d.ts +9 -0
- package/dist/components/PageHeader/types.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.vue.d.ts +3 -3
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +10 -6
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +68 -469
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +11 -414
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +21 -28
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts.map +1 -1
- package/dist/components/SelectTime/index.vue.d.ts +33 -24
- package/dist/components/SkeletonLoading/skeletonTheme.vue.d.ts +1 -1
- package/dist/components/Slider/Slider.vue.d.ts +2 -2
- package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
- package/dist/components/Switch/Switch.vue.d.ts +55 -21
- package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +13 -2
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +3 -3
- package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
- package/dist/components/Tag/DefaultTag.vue.d.ts +4 -83
- package/dist/components/Tag/DefaultTag.vue.d.ts.map +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +12 -414
- package/dist/components/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/components/Tag/types.d.ts +18 -0
- package/dist/components/Tag/types.d.ts.map +1 -0
- package/dist/components/TextArea/TextArea.vue.d.ts +78 -33
- package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +16 -0
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -0
- package/dist/components/Toast/ToastManager.d.ts +14 -0
- package/dist/components/Toast/ToastManager.d.ts.map +1 -0
- package/dist/components/Toast/types.d.ts +35 -0
- package/dist/components/Toast/types.d.ts.map +1 -0
- package/dist/components/ToolTip/ToolTip.vue.d.ts +1 -1
- package/dist/components/Tour/Tour.vue.d.ts +3 -3
- package/dist/components/Tour/TourPopover.vue.d.ts +3 -3
- package/dist/components/UploadArea/UploadArea.vue.d.ts +4 -4
- package/dist/components/index.d.ts +8910 -10904
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +1 -1
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/{es-4b899f97.mjs → es-e3248052.mjs} +1 -1
- package/dist/{index-23489897.mjs → index-f67d5b30.mjs} +9289 -8806
- package/dist/{pt-br-5a914a63.mjs → pt-br-f6f53acd.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +181 -173
- package/dist/unnnic.umd.js +35 -36
- package/dist/utils/call.d.ts +2 -1
- package/dist/utils/call.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/assets/icons/checkbox-checked-disabled.svg +3 -0
- package/src/assets/icons/checkbox-checked.svg +3 -0
- package/src/assets/icons/checkbox-less-disabled.svg +3 -0
- package/src/assets/icons/checkbox-less.svg +3 -0
- package/src/assets/icons/radio-checked.svg +3 -0
- package/src/assets/icons/switch-checked-disabled.svg +3 -0
- package/src/assets/icons/switch-checked.svg +3 -0
- package/src/components/Alert/Alert.vue +26 -135
- package/src/components/Alert/Version1dot1.vue +0 -36
- package/src/components/Alert/__tests__/Alert.spec.js +2 -45
- package/src/components/Alert/__tests__/Version1dot1.spec.js +0 -21
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +11 -7
- package/src/components/Alert/__tests__/__snapshots__/AlertBanner.spec.js.snap +2 -2
- package/src/components/Alert/__tests__/__snapshots__/Version1dot1.spec.js.snap +1 -1
- package/src/components/Button/Button.vue +67 -117
- package/src/components/Button/types.ts +0 -1
- package/src/components/ChatsContact/ChatsContact.vue +10 -6
- package/src/components/Checkbox/Checkbox.vue +117 -65
- package/src/components/Checkbox/__tests__/Checkbox.spec.js +6 -21
- package/src/components/CheckboxGroup/CheckboxGroup.vue +96 -0
- package/src/components/FormElement/FormElement.vue +63 -93
- package/src/components/Icon.vue +2 -0
- package/src/components/Input/BaseInput.vue +12 -12
- package/src/components/Input/Input.scss +19 -20
- package/src/components/Input/Input.vue +60 -55
- package/src/components/Input/TextInput.vue +25 -54
- package/src/components/Input/__test__/Input.spec.js +13 -33
- package/src/components/Input/__test__/TextInput.spec.js +6 -8
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +14 -5
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
- package/src/components/Label/Label.vue +52 -21
- package/src/components/Label/__tests__/Label.spec.js +1 -1
- package/src/components/Label/__tests__/__snapshots__/Label.spec.js.snap +1 -1
- package/src/components/PageHeader/PageHeader.vue +148 -0
- package/src/components/PageHeader/index.ts +2 -0
- package/src/components/PageHeader/types.ts +10 -0
- package/src/components/Radio/Radio.vue +118 -66
- package/src/components/Radio/__test__/Radio.spec.js +14 -20
- package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +4 -3
- package/src/components/RadioGroup/RadioGroup.vue +142 -0
- package/src/components/SelectSmart/SelectSmart.vue +4 -3
- package/src/components/Switch/Switch.vue +132 -91
- package/src/components/Switch/__tests__/Switch.spec.js +8 -75
- package/src/components/Switch/__tests__/__snapshots__/Switch.spec.js.snap +5 -6
- package/src/components/Tab/Tab.vue +37 -23
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -1
- package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +2 -2
- package/src/components/TableNext/__test__/__snapshots__/TablePagination.spec.js.snap +2 -2
- package/src/components/Tag/DefaultTag.vue +51 -107
- package/src/components/Tag/Tag.vue +32 -79
- package/src/components/Tag/types.ts +19 -0
- package/src/components/TextArea/TextArea.vue +41 -12
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +11 -3
- package/src/components/Toast/Toast.vue +246 -0
- package/src/components/Toast/ToastManager.ts +110 -0
- package/src/components/Toast/__tests__/Toast.spec.js +291 -0
- package/src/components/Toast/__tests__/ToastManager.spec.js +294 -0
- package/src/components/Toast/types.ts +57 -0
- package/src/components/index.ts +33 -17
- package/src/stories/Alert.stories.js +6 -67
- package/src/stories/Button.stories.js +29 -39
- package/src/stories/Checkbox.stories.js +11 -4
- package/src/stories/CheckboxGroup.stories.js +105 -0
- package/src/stories/Input.stories.js +71 -76
- package/src/stories/Label.stories.js +7 -0
- package/src/stories/PageHeader.stories.js +330 -0
- package/src/stories/Radio.stories.js +28 -1
- package/src/stories/RadioGroup.stories.js +144 -0
- package/src/stories/Switch.stories.js +10 -5
- package/src/stories/Tab.stories.js +11 -4
- package/src/stories/Tag.stories.js +24 -43
- package/src/stories/TextArea.stories.js +14 -2
- package/src/stories/Toast.mdx +123 -0
- package/src/stories/Toast.stories.js +126 -0
- package/src/types/scheme-colors.d.ts +1 -0
- package/src/utils/call.js +46 -18
- package/dist/components/Tag/BrandTag.vue.d.ts +0 -51
- package/dist/components/Tag/BrandTag.vue.d.ts.map +0 -1
- package/dist/components/Tag/IndicatorTag.vue.d.ts +0 -151
- package/dist/components/Tag/IndicatorTag.vue.d.ts.map +0 -1
- package/dist/components/Tag/TagNext.vue.d.ts +0 -24
- package/dist/components/Tag/TagNext.vue.d.ts.map +0 -1
- package/src/components/Alert/AlertBanner.vue +0 -182
- package/src/components/Alert/AlertCaller.vue +0 -49
- package/src/components/Alert/__tests__/AlertBanner.spec.js +0 -89
- package/src/components/Alert/__tests__/AlertCaller.spec.js +0 -98
- package/src/components/Tag/BrandTag.vue +0 -96
- package/src/components/Tag/IndicatorTag.vue +0 -107
- package/src/components/Tag/TagNext.vue +0 -60
|
@@ -6,19 +6,16 @@
|
|
|
6
6
|
:class="[
|
|
7
7
|
'unnnic-button',
|
|
8
8
|
`unnnic-button--size-${size}`,
|
|
9
|
-
`unnnic-button--${
|
|
9
|
+
`unnnic-button--${buttonType}`,
|
|
10
10
|
iconCenter ? `unnnic-button--icon-on-center` : null,
|
|
11
11
|
float ? `unnnic-button--float` : null,
|
|
12
12
|
]"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
14
|
+
<UnnnicIconLoading
|
|
15
15
|
v-if="loading"
|
|
16
|
-
icon="loading-circle-1"
|
|
17
16
|
:scheme="iconScheme"
|
|
18
17
|
:size="iconSize"
|
|
19
|
-
:filled="iconsFilled"
|
|
20
18
|
:style="{ position: 'absolute' }"
|
|
21
|
-
class="rotation"
|
|
22
19
|
data-testid="icon-loading"
|
|
23
20
|
/>
|
|
24
21
|
|
|
@@ -30,6 +27,7 @@
|
|
|
30
27
|
:filled="iconsFilled"
|
|
31
28
|
:class="{ 'unnnic-button__icon-left': hasText }"
|
|
32
29
|
:style="{ visibility: loading ? 'hidden' : 'visible' }"
|
|
30
|
+
clickable
|
|
33
31
|
data-testid="icon-left"
|
|
34
32
|
/>
|
|
35
33
|
|
|
@@ -40,6 +38,7 @@
|
|
|
40
38
|
:style="{ visibility: loading ? 'hidden' : 'visible' }"
|
|
41
39
|
:size="iconSize"
|
|
42
40
|
:filled="iconsFilled"
|
|
41
|
+
clickable
|
|
43
42
|
data-testid="icon-center"
|
|
44
43
|
/>
|
|
45
44
|
|
|
@@ -60,6 +59,7 @@
|
|
|
60
59
|
:filled="iconsFilled"
|
|
61
60
|
:class="{ 'unnnic-button__icon-right': hasText }"
|
|
62
61
|
:style="{ visibility: loading ? 'hidden' : 'visible' }"
|
|
62
|
+
clickable
|
|
63
63
|
data-testid="icon-right"
|
|
64
64
|
/>
|
|
65
65
|
</button>
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
<script setup lang="ts">
|
|
69
69
|
import { computed, watch, useSlots } from 'vue';
|
|
70
70
|
import UnnnicIcon from '../Icon.vue';
|
|
71
|
+
import UnnnicIconLoading from '../IconLoading/IconLoading.vue';
|
|
71
72
|
import type { ButtonProps, ButtonSize, ButtonType } from './types';
|
|
72
73
|
import type { SchemeColor } from '@/types/scheme-colors';
|
|
73
74
|
|
|
@@ -97,8 +98,8 @@ const buttonDisabled = computed(() => {
|
|
|
97
98
|
});
|
|
98
99
|
|
|
99
100
|
const iconSize = computed(() => {
|
|
100
|
-
if (props.size === '
|
|
101
|
-
return '
|
|
101
|
+
if (props.size === 'extra-large') return 'lg';
|
|
102
|
+
return 'ant';
|
|
102
103
|
});
|
|
103
104
|
|
|
104
105
|
const hasText = computed(() => {
|
|
@@ -115,12 +116,11 @@ const iconScheme = computed((): SchemeColor => {
|
|
|
115
116
|
primary: 'neutral-white',
|
|
116
117
|
secondary: 'neutral-dark',
|
|
117
118
|
tertiary: 'neutral-dark',
|
|
118
|
-
alternative: 'neutral-white',
|
|
119
119
|
warning: 'neutral-white',
|
|
120
120
|
attention: 'neutral-white',
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
-
return typeToSchemeMap[
|
|
123
|
+
return typeToSchemeMap[buttonType.value] || 'neutral-white';
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
const isSizePropValid = computed(() => {
|
|
@@ -131,16 +131,23 @@ const isSizePropValid = computed(() => {
|
|
|
131
131
|
);
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
+
const buttonType = computed(() => {
|
|
135
|
+
return (
|
|
136
|
+
{
|
|
137
|
+
alternative: 'tertiary',
|
|
138
|
+
}[props.type] || props.type
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
|
|
134
142
|
const isTypePropValid = computed(() => {
|
|
135
143
|
const validTypes: ButtonType[] = [
|
|
136
144
|
'primary',
|
|
137
145
|
'secondary',
|
|
138
146
|
'tertiary',
|
|
139
|
-
'alternative',
|
|
140
147
|
'warning',
|
|
141
148
|
'attention',
|
|
142
149
|
];
|
|
143
|
-
return validTypes.includes(
|
|
150
|
+
return validTypes.includes(buttonType.value);
|
|
144
151
|
});
|
|
145
152
|
|
|
146
153
|
const validateProps = () => {
|
|
@@ -154,6 +161,8 @@ const validateProps = () => {
|
|
|
154
161
|
|
|
155
162
|
if (!isTypePropValid.value) {
|
|
156
163
|
errorMessage += ' Invalid type prop.';
|
|
164
|
+
errorMessage +=
|
|
165
|
+
' Please provide one of the following types: primary, secondary, tertiary, warning, attention. Alternative is discontinued and it was forced renamed to tertiary.';
|
|
157
166
|
}
|
|
158
167
|
|
|
159
168
|
throw new Error(errorMessage);
|
|
@@ -191,16 +200,19 @@ watch(
|
|
|
191
200
|
display: inline-flex;
|
|
192
201
|
align-items: center;
|
|
193
202
|
justify-content: center;
|
|
194
|
-
border-radius: $unnnic-
|
|
203
|
+
border-radius: $unnnic-radius-2;
|
|
195
204
|
border: 0;
|
|
196
205
|
outline: none;
|
|
197
206
|
overflow: hidden;
|
|
198
207
|
white-space: nowrap;
|
|
199
|
-
font
|
|
200
|
-
font-family: $unnnic-font-family-secondary;
|
|
208
|
+
font: $unnnic-font-action;
|
|
201
209
|
cursor: pointer;
|
|
202
210
|
position: relative;
|
|
203
211
|
|
|
212
|
+
transition-property: color, background-color, border-color;
|
|
213
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
214
|
+
transition-duration: 0.15s;
|
|
215
|
+
|
|
204
216
|
&__icon {
|
|
205
217
|
&-left {
|
|
206
218
|
margin-right: $unnnic-inline-nano;
|
|
@@ -211,129 +223,91 @@ watch(
|
|
|
211
223
|
}
|
|
212
224
|
}
|
|
213
225
|
|
|
226
|
+
&--primary,
|
|
227
|
+
&--warning,
|
|
228
|
+
&--attention {
|
|
229
|
+
color: $unnnic-color-fg-inverted;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&--secondary,
|
|
233
|
+
&--tertiary {
|
|
234
|
+
color: $unnnic-color-fg-emphasized;
|
|
235
|
+
}
|
|
236
|
+
|
|
214
237
|
&--primary {
|
|
215
|
-
background-color: $unnnic-color-
|
|
216
|
-
color: $unnnic-color-neutral-white;
|
|
238
|
+
background-color: $unnnic-color-bg-active;
|
|
217
239
|
|
|
218
240
|
&:hover:enabled {
|
|
219
|
-
background-color: $unnnic-color-
|
|
241
|
+
background-color: $unnnic-color-teal-700;
|
|
220
242
|
}
|
|
221
243
|
|
|
222
244
|
&:active:enabled {
|
|
223
|
-
background-color: $unnnic-color-
|
|
245
|
+
background-color: $unnnic-color-teal-800;
|
|
224
246
|
}
|
|
225
247
|
}
|
|
226
248
|
|
|
227
249
|
&--secondary {
|
|
228
|
-
background-color: $unnnic-color-
|
|
229
|
-
color: $unnnic-color-neutral-dark;
|
|
250
|
+
background-color: $unnnic-color-bg-base;
|
|
230
251
|
box-shadow: inset 0 0 0 $unnnic-border-width-thinner
|
|
231
|
-
$unnnic-color-
|
|
252
|
+
$unnnic-color-border-base;
|
|
232
253
|
|
|
233
254
|
&:hover:enabled {
|
|
234
|
-
background-color: $unnnic-color-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
&:disabled {
|
|
238
|
-
box-shadow: none;
|
|
255
|
+
background-color: $unnnic-color-gray-50;
|
|
239
256
|
}
|
|
240
257
|
|
|
241
258
|
&:active:enabled {
|
|
242
|
-
background-color: $unnnic-color-
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
&--tertiary {
|
|
247
|
-
background-color: transparent;
|
|
248
|
-
color: $unnnic-color-neutral-dark;
|
|
249
|
-
|
|
250
|
-
&:hover:enabled {
|
|
251
|
-
background-color: $unnnic-color-neutral-light;
|
|
259
|
+
background-color: $unnnic-color-gray-100;
|
|
252
260
|
}
|
|
253
261
|
|
|
254
262
|
&:disabled {
|
|
255
|
-
|
|
256
|
-
cursor: not-allowed;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
&:active:enabled {
|
|
260
|
-
background-color: $unnnic-color-neutral-soft;
|
|
263
|
+
box-shadow: none;
|
|
261
264
|
}
|
|
262
265
|
}
|
|
263
266
|
|
|
264
|
-
&--
|
|
265
|
-
background-color:
|
|
266
|
-
color: $unnnic-color-weni-800;
|
|
267
|
-
|
|
268
|
-
:deep(svg .primary) {
|
|
269
|
-
fill: $unnnic-color-weni-800;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
:deep(svg .primary-stroke) {
|
|
273
|
-
stroke: $unnnic-color-weni-800;
|
|
274
|
-
}
|
|
267
|
+
&--tertiary {
|
|
268
|
+
background-color: transparent;
|
|
275
269
|
|
|
276
270
|
&:hover:enabled {
|
|
277
|
-
background-color: $unnnic-color-
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
&:disabled {
|
|
281
|
-
:deep(svg .primary) {
|
|
282
|
-
fill: $unnnic-color-neutral-clean;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
:deep(svg .primary-stroke) {
|
|
286
|
-
stroke: $unnnic-color-neutral-clean;
|
|
287
|
-
}
|
|
271
|
+
background-color: rgba($unnnic-color-gray-400, 0.1);
|
|
288
272
|
}
|
|
289
273
|
|
|
290
274
|
&:active:enabled {
|
|
291
|
-
background-color: $unnnic-color-
|
|
292
|
-
color: $unnnic-color-weni-900;
|
|
293
|
-
|
|
294
|
-
:deep(svg .primary) {
|
|
295
|
-
fill: $unnnic-color-weni-900;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
:deep(svg .primary-stroke) {
|
|
299
|
-
stroke: $unnnic-color-weni-900;
|
|
300
|
-
}
|
|
275
|
+
background-color: rgba($unnnic-color-gray-400, 0.2);
|
|
301
276
|
}
|
|
302
277
|
}
|
|
303
278
|
|
|
304
279
|
&--warning {
|
|
305
|
-
background-color: $unnnic-color-
|
|
280
|
+
background-color: $unnnic-color-red-500;
|
|
306
281
|
color: $unnnic-color-neutral-white;
|
|
307
282
|
|
|
308
283
|
&:hover:enabled {
|
|
309
|
-
background-color: $unnnic-color-
|
|
284
|
+
background-color: $unnnic-color-red-600;
|
|
310
285
|
}
|
|
311
286
|
|
|
312
287
|
&:active:enabled {
|
|
313
|
-
background-color: $unnnic-color-
|
|
288
|
+
background-color: $unnnic-color-red-700;
|
|
314
289
|
}
|
|
315
290
|
}
|
|
316
291
|
|
|
317
292
|
&--attention {
|
|
318
|
-
background-color: $unnnic-color-
|
|
319
|
-
color: $unnnic-color-neutral-white;
|
|
293
|
+
background-color: $unnnic-color-yellow-500;
|
|
320
294
|
|
|
321
295
|
&:hover:enabled {
|
|
322
|
-
background-color: $unnnic-color-
|
|
296
|
+
background-color: $unnnic-color-yellow-600;
|
|
323
297
|
}
|
|
324
298
|
|
|
325
299
|
&:active:enabled {
|
|
326
|
-
background-color: $unnnic-color-
|
|
300
|
+
background-color: $unnnic-color-yellow-700;
|
|
327
301
|
}
|
|
328
302
|
}
|
|
329
303
|
|
|
330
304
|
&--primary:disabled,
|
|
331
305
|
&--secondary:disabled,
|
|
332
|
-
&--
|
|
306
|
+
&--tertiary:disabled,
|
|
333
307
|
&--warning:disabled,
|
|
334
308
|
&--attention:disabled {
|
|
335
|
-
background-color: $unnnic-color-
|
|
336
|
-
color: $unnnic-color-
|
|
309
|
+
background-color: $unnnic-color-bg-muted;
|
|
310
|
+
color: $unnnic-color-fg-muted;
|
|
337
311
|
cursor: not-allowed;
|
|
338
312
|
}
|
|
339
313
|
|
|
@@ -346,26 +320,12 @@ watch(
|
|
|
346
320
|
box-shadow: $unnnic-shadow-level-near;
|
|
347
321
|
}
|
|
348
322
|
|
|
349
|
-
&--size {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
&-small {
|
|
353
|
-
padding: $unnnic-squish-xs;
|
|
354
|
-
font-size: $unnnic-font-size-body-gt;
|
|
355
|
-
line-height: ($unnnic-font-size-body-gt + $unnnic-line-height-medium);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
&-extra-large {
|
|
359
|
-
height: 58px;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
&-large {
|
|
363
|
-
height: 46px;
|
|
364
|
-
}
|
|
323
|
+
&--size-large {
|
|
324
|
+
padding: $unnnic-space-3 $unnnic-space-4;
|
|
325
|
+
}
|
|
365
326
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
327
|
+
&--size-small {
|
|
328
|
+
padding: $unnnic-space-2 $unnnic-space-4;
|
|
369
329
|
}
|
|
370
330
|
}
|
|
371
331
|
</style>
|
|
@@ -383,29 +343,19 @@ watch(
|
|
|
383
343
|
}
|
|
384
344
|
|
|
385
345
|
&-large {
|
|
386
|
-
height:
|
|
387
|
-
width:
|
|
346
|
+
height: 45px;
|
|
347
|
+
width: 45px;
|
|
388
348
|
}
|
|
389
349
|
|
|
390
350
|
&-large,
|
|
391
351
|
&-extra-large {
|
|
392
352
|
padding: $unnnic-inset-xs;
|
|
393
|
-
|
|
394
|
-
.unnnic-icon {
|
|
395
|
-
width: $unnnic-icon-size-md;
|
|
396
|
-
height: $unnnic-icon-size-md;
|
|
397
|
-
}
|
|
398
353
|
}
|
|
399
354
|
|
|
400
355
|
&-small {
|
|
401
356
|
padding: $unnnic-inset-nano;
|
|
402
|
-
height:
|
|
403
|
-
width:
|
|
404
|
-
|
|
405
|
-
.unnnic-icon {
|
|
406
|
-
width: $unnnic-icon-size-ant;
|
|
407
|
-
height: $unnnic-icon-size-ant;
|
|
408
|
-
}
|
|
357
|
+
height: 37px;
|
|
358
|
+
width: 37px;
|
|
409
359
|
}
|
|
410
360
|
}
|
|
411
361
|
}
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
{{ title }}
|
|
46
46
|
</h1>
|
|
47
47
|
|
|
48
|
-
<
|
|
48
|
+
<p
|
|
49
49
|
v-if="projectName"
|
|
50
50
|
class="chats-contact__infos__project-tag"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
>
|
|
52
|
+
{{ projectName }}
|
|
53
|
+
</p>
|
|
54
54
|
</section>
|
|
55
55
|
<div
|
|
56
56
|
class="chats-contact__infos__additional-information"
|
|
@@ -145,7 +145,6 @@ import UnnnicIcon from '../Icon.vue';
|
|
|
145
145
|
import TransitionRipple from '../TransitionRipple/TransitionRipple.vue';
|
|
146
146
|
import UnnnicI18n from '../../mixins/i18n';
|
|
147
147
|
import Checkbox from '../Checkbox/Checkbox.vue';
|
|
148
|
-
import UnnnicTag from '../Tag/Tag.vue';
|
|
149
148
|
|
|
150
149
|
import('moment/dist/locale/es.js');
|
|
151
150
|
import('moment/dist/locale/pt-br.js');
|
|
@@ -160,7 +159,6 @@ export default {
|
|
|
160
159
|
UnnnicIcon,
|
|
161
160
|
TransitionRipple,
|
|
162
161
|
Checkbox,
|
|
163
|
-
UnnnicTag,
|
|
164
162
|
},
|
|
165
163
|
|
|
166
164
|
mixins: [UnnnicI18n],
|
|
@@ -509,6 +507,12 @@ export default {
|
|
|
509
507
|
display: block;
|
|
510
508
|
flex-shrink: 1;
|
|
511
509
|
border: 1px solid $unnnic-color-neutral-cleanest;
|
|
510
|
+
|
|
511
|
+
font: $unnnic-font-caption-1;
|
|
512
|
+
color: $unnnic-color-fg-emphasized;
|
|
513
|
+
|
|
514
|
+
border-radius: $unnnic-radius-4;
|
|
515
|
+
padding: 1px $unnnic-space-2;
|
|
512
516
|
}
|
|
513
517
|
|
|
514
518
|
&__media {
|
|
@@ -1,37 +1,49 @@
|
|
|
1
1
|
<!-- eslint-disable vue/multi-word-component-names -->
|
|
2
2
|
<template>
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
class="unnnic-checkbox"
|
|
6
|
-
:class="{ disabled }"
|
|
7
|
-
:icon="icon"
|
|
8
|
-
:scheme="color"
|
|
9
|
-
:clickable="!disabled"
|
|
10
|
-
:size="size"
|
|
11
|
-
@click="click"
|
|
12
|
-
/>
|
|
13
|
-
|
|
14
|
-
<div
|
|
15
|
-
v-if="textRight"
|
|
3
|
+
<section class="unnnic-checkbox">
|
|
4
|
+
<label
|
|
16
5
|
:class="[
|
|
17
|
-
'unnnic-
|
|
18
|
-
'unnnic-
|
|
19
|
-
`unnnic-checkbox__label__${size}`,
|
|
6
|
+
'unnnic-checkbox__input-wrapper',
|
|
7
|
+
{ 'unnnic-checkbox__input-wrapper--disabled': disabled },
|
|
20
8
|
]"
|
|
21
|
-
data-testid="checkbox-text-right"
|
|
22
9
|
>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
<input
|
|
11
|
+
:class="[
|
|
12
|
+
'unnnic-checkbox__input',
|
|
13
|
+
{ 'unnnic-checkbox__input--less': modelValue === 'less' },
|
|
14
|
+
]"
|
|
15
|
+
type="checkbox"
|
|
16
|
+
:disabled="disabled"
|
|
17
|
+
:checked="modelValue === 'less' || modelValue"
|
|
18
|
+
@change="click"
|
|
19
|
+
v-bind="pick($attrs, ['id', 'name'])"
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<p
|
|
23
|
+
v-if="label || textRight"
|
|
24
|
+
:class="[
|
|
25
|
+
'unnnic-checkbox__label',
|
|
26
|
+
{ 'unnnic-checkbox__label--disabled': disabled },
|
|
27
|
+
]"
|
|
28
|
+
data-testid="checkbox-text-right"
|
|
29
|
+
>
|
|
30
|
+
{{ label || textRight }}
|
|
31
|
+
</p>
|
|
32
|
+
</label>
|
|
33
|
+
|
|
34
|
+
<p
|
|
35
|
+
v-if="helper"
|
|
36
|
+
class="unnnic-checkbox__helper"
|
|
37
|
+
>
|
|
38
|
+
{{ helper }}
|
|
39
|
+
</p>
|
|
40
|
+
</section>
|
|
26
41
|
</template>
|
|
27
42
|
|
|
28
43
|
<script>
|
|
29
|
-
import
|
|
44
|
+
import { pick } from 'lodash';
|
|
30
45
|
|
|
31
46
|
export default {
|
|
32
|
-
components: {
|
|
33
|
-
UnnnicIcon,
|
|
34
|
-
},
|
|
35
47
|
model: {
|
|
36
48
|
event: 'change',
|
|
37
49
|
},
|
|
@@ -50,13 +62,16 @@ export default {
|
|
|
50
62
|
default: false,
|
|
51
63
|
},
|
|
52
64
|
|
|
53
|
-
|
|
65
|
+
label: {
|
|
54
66
|
type: String,
|
|
55
|
-
default: '
|
|
56
|
-
validator(value) {
|
|
57
|
-
return ['md', 'sm'].includes(value);
|
|
58
|
-
},
|
|
67
|
+
default: '',
|
|
59
68
|
},
|
|
69
|
+
|
|
70
|
+
helper: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: '',
|
|
73
|
+
},
|
|
74
|
+
|
|
60
75
|
textRight: {
|
|
61
76
|
type: String,
|
|
62
77
|
default: '',
|
|
@@ -75,25 +90,11 @@ export default {
|
|
|
75
90
|
|
|
76
91
|
return 'less';
|
|
77
92
|
},
|
|
78
|
-
|
|
79
|
-
icon() {
|
|
80
|
-
return {
|
|
81
|
-
checked: 'checkbox-select',
|
|
82
|
-
default: this.disabled ? 'checkbox-disable' : 'checkbox-default',
|
|
83
|
-
less: 'checkbox-less',
|
|
84
|
-
}[this.valueName];
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
color() {
|
|
88
|
-
if (this.valueName === 'default') {
|
|
89
|
-
return 'neutral-clean';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return 'brand-weni';
|
|
93
|
-
},
|
|
94
93
|
},
|
|
95
94
|
|
|
96
95
|
methods: {
|
|
96
|
+
pick,
|
|
97
|
+
|
|
97
98
|
click() {
|
|
98
99
|
const isChecked = ['checked', 'less'].includes(this.valueName);
|
|
99
100
|
this.$emit('change', !isChecked);
|
|
@@ -106,35 +107,86 @@ export default {
|
|
|
106
107
|
<style lang="scss" scoped>
|
|
107
108
|
@use '@/assets/scss/unnnic' as *;
|
|
108
109
|
|
|
109
|
-
|
|
110
|
+
$checkbox-size: 21px;
|
|
111
|
+
|
|
112
|
+
.unnnic-checkbox {
|
|
110
113
|
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
111
115
|
align-items: flex-start;
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
}
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
&__input-wrapper {
|
|
118
|
+
width: fit-content;
|
|
119
|
+
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
column-gap: $unnnic-space-2;
|
|
123
|
+
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
|
|
126
|
+
&--disabled {
|
|
127
|
+
cursor: not-allowed;
|
|
119
128
|
}
|
|
120
129
|
}
|
|
121
|
-
}
|
|
122
130
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
&__input {
|
|
132
|
+
appearance: none;
|
|
133
|
+
width: $checkbox-size;
|
|
134
|
+
min-width: $checkbox-size;
|
|
135
|
+
height: $checkbox-size;
|
|
136
|
+
margin: 0;
|
|
137
|
+
background-color: $unnnic-color-bg-base;
|
|
138
|
+
border: 1px solid $unnnic-color-border-base;
|
|
139
|
+
border-radius: $unnnic-radius-1;
|
|
140
|
+
box-sizing: border-box;
|
|
141
|
+
|
|
142
|
+
outline: none;
|
|
143
|
+
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
|
|
146
|
+
&:checked {
|
|
147
|
+
border-width: 0;
|
|
148
|
+
background-color: $unnnic-color-bg-active;
|
|
149
|
+
background-image: url('../../assets/icons/checkbox-checked.svg');
|
|
150
|
+
background-repeat: no-repeat;
|
|
151
|
+
background-position: center;
|
|
152
|
+
|
|
153
|
+
&.unnnic-checkbox__input--less {
|
|
154
|
+
background-image: url('../../assets/icons/checkbox-less.svg');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:disabled,
|
|
159
|
+
&:disabled:checked {
|
|
160
|
+
background-color: $unnnic-color-bg-muted;
|
|
161
|
+
border: 1px solid $unnnic-color-border-muted;
|
|
127
162
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
163
|
+
cursor: not-allowed;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&:disabled:checked {
|
|
167
|
+
background-image: url('../../assets/icons/checkbox-checked-disabled.svg');
|
|
168
|
+
|
|
169
|
+
&.unnnic-checkbox__input--less {
|
|
170
|
+
background-image: url('../../assets/icons/checkbox-less-disabled.svg');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&__label {
|
|
176
|
+
margin: 0;
|
|
177
|
+
font: $unnnic-font-body;
|
|
178
|
+
color: $unnnic-color-fg-emphasized;
|
|
179
|
+
|
|
180
|
+
&--disabled {
|
|
181
|
+
color: $unnnic-color-fg-muted;
|
|
182
|
+
}
|
|
132
183
|
}
|
|
133
184
|
|
|
134
|
-
&
|
|
135
|
-
margin
|
|
136
|
-
|
|
137
|
-
|
|
185
|
+
&__helper {
|
|
186
|
+
margin: 0;
|
|
187
|
+
margin-left: $checkbox-size + $unnnic-space-2;
|
|
188
|
+
font: $unnnic-font-caption-2;
|
|
189
|
+
color: $unnnic-color-fg-base;
|
|
138
190
|
}
|
|
139
191
|
}
|
|
140
192
|
</style>
|
|
@@ -24,43 +24,28 @@ describe('Checkbox', () => {
|
|
|
24
24
|
|
|
25
25
|
it('should checkbox emit change events', async () => {
|
|
26
26
|
wrapper = createWrapper();
|
|
27
|
-
const checkbox = wrapper.
|
|
27
|
+
const checkbox = wrapper.find('input[type="checkbox"]');
|
|
28
28
|
|
|
29
29
|
// click false to true
|
|
30
|
-
await checkbox.trigger('
|
|
30
|
+
await checkbox.trigger('change');
|
|
31
31
|
expect(wrapper.emitted('change')[0][0]).eq(true);
|
|
32
32
|
|
|
33
33
|
// click true to false
|
|
34
34
|
await wrapper.setProps({ modelValue: true });
|
|
35
|
-
await checkbox.trigger('
|
|
35
|
+
await checkbox.trigger('change');
|
|
36
36
|
expect(wrapper.emitted('change')[1][0]).eq(false);
|
|
37
37
|
|
|
38
38
|
// click less to false
|
|
39
39
|
await wrapper.setProps({ modelValue: 'less' });
|
|
40
|
-
expect(wrapper.vm.
|
|
41
|
-
await checkbox.trigger('
|
|
40
|
+
expect(wrapper.vm.valueName).eq('less');
|
|
41
|
+
await checkbox.trigger('change');
|
|
42
42
|
expect(wrapper.emitted('change')[2][0]).eq(false);
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
it('should checkbox disabled', async () => {
|
|
46
46
|
wrapper = createWrapper({ disabled: true });
|
|
47
|
-
const checkbox = wrapper.
|
|
47
|
+
const checkbox = wrapper.find('input[type="checkbox"]');
|
|
48
48
|
await checkbox.trigger('click');
|
|
49
49
|
expect(wrapper.emitted('change')).eq(undefined);
|
|
50
50
|
});
|
|
51
|
-
|
|
52
|
-
it('should define sizes', async () => {
|
|
53
|
-
wrapper = createWrapper({ size: 'sm', textRight: 'Label' });
|
|
54
|
-
const checkbox = wrapper.findComponent({ name: 'UnnnicIcon' });
|
|
55
|
-
const label = wrapper.find('.unnnic-checkbox__label');
|
|
56
|
-
|
|
57
|
-
// sm
|
|
58
|
-
expect(checkbox.classes()).include('unnnic-icon__size--sm');
|
|
59
|
-
expect(label.classes()).include('unnnic-checkbox__label__sm');
|
|
60
|
-
|
|
61
|
-
// md
|
|
62
|
-
await wrapper.setProps({ size: 'md' });
|
|
63
|
-
expect(checkbox.classes()).include('unnnic-icon__size--md');
|
|
64
|
-
expect(label.classes()).include('unnnic-checkbox__label__md');
|
|
65
|
-
});
|
|
66
51
|
});
|