@weni/unnnic-system 3.7.1-alpha.3 → 3.8.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 +10 -1
- package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
- package/dist/components/Alert/Alert.vue.d.ts +116 -17
- package/dist/components/Alert/Alert.vue.d.ts.map +1 -1
- package/dist/components/Alert/Version1dot1.vue.d.ts +38 -2
- 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 +5 -5
- 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 +31 -24
- 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 +7 -7
- package/dist/components/Carousel/TagCarousel.vue.d.ts +6 -6
- 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 +34 -27
- 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 +26 -19
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- 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 +41 -251
- 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 +28 -51
- 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 +2 -33
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +41 -251
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +25 -85
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +47 -257
- package/dist/components/InputNext/InputNext.vue.d.ts +5 -5
- package/dist/components/Label/Label.vue.d.ts +15 -9
- 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 +34 -199
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +46 -256
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +8 -8
- package/dist/components/MoodRating/MoodRating.vue.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +14 -20
- 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 +6 -8
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +60 -113
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +5 -5
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +28 -21
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts.map +1 -1
- package/dist/components/SelectTime/index.vue.d.ts +25 -85
- 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 +21 -55
- package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +2 -13
- 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/BrandTag.vue.d.ts +1 -1
- package/dist/components/Tag/DefaultTag.vue.d.ts +1 -1
- package/dist/components/Tag/IndicatorTag.vue.d.ts +2 -2
- package/dist/components/Tag/Tag.vue.d.ts +5 -5
- package/dist/components/TextArea/TextArea.vue.d.ts +30 -66
- package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
- 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 +1367 -3846
- 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-4bdcf86e.mjs → es-85030529.mjs} +1 -1
- package/dist/{index-0d6fa367.mjs → index-43dacc8a.mjs} +14620 -15589
- package/dist/locales/en.json.d.ts +1 -2
- package/dist/locales/es.json.d.ts +1 -2
- package/dist/locales/pt_br.json.d.ts +1 -2
- package/dist/{pt-br-51af7f2a.mjs → pt-br-191d9782.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +176 -193
- package/dist/unnnic.umd.js +39 -43
- package/dist/utils/call.d.ts +1 -2
- package/dist/utils/call.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/assets/scss/tailwind.scss +0 -8
- package/src/components/Alert/Alert.vue +135 -26
- package/src/components/Alert/AlertBanner.vue +182 -0
- package/src/components/Alert/AlertCaller.vue +49 -0
- package/src/components/Alert/Version1dot1.vue +36 -0
- package/src/components/Alert/__tests__/Alert.spec.js +45 -2
- package/src/components/Alert/__tests__/AlertBanner.spec.js +89 -0
- package/src/components/Alert/__tests__/AlertCaller.spec.js +98 -0
- package/src/components/Alert/__tests__/Version1dot1.spec.js +21 -0
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +7 -11
- package/src/components/Alert/__tests__/__snapshots__/Version1dot1.spec.js.snap +2 -2
- package/src/components/Button/Button.vue +117 -68
- package/src/components/Button/types.ts +1 -0
- package/src/components/Checkbox/Checkbox.vue +64 -98
- package/src/components/Checkbox/__tests__/Checkbox.spec.js +21 -6
- package/src/components/FormElement/FormElement.vue +93 -63
- package/src/components/Icon.vue +0 -2
- package/src/components/Input/BaseInput.vue +14 -33
- package/src/components/Input/Input.scss +21 -20
- package/src/components/Input/Input.vue +56 -79
- package/src/components/Input/TextInput.vue +68 -80
- package/src/components/Input/__test__/Input.spec.js +33 -13
- package/src/components/Input/__test__/TextInput.spec.js +8 -6
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +5 -14
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
- package/src/components/Label/Label.vue +21 -52
- 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/ModalDialog/ModalDialog.vue +146 -60
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
- package/src/components/Radio/Radio.vue +67 -80
- package/src/components/Radio/__test__/Radio.spec.js +20 -14
- package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +3 -3
- package/src/components/SelectSmart/SelectSmart.vue +3 -4
- package/src/components/Switch/Switch.vue +96 -123
- package/src/components/Switch/__tests__/Switch.spec.js +75 -8
- package/src/components/Switch/__tests__/__snapshots__/Switch.spec.js.snap +6 -5
- package/src/components/Tab/Tab.vue +23 -37
- 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/TextArea/TextArea.vue +11 -34
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +3 -11
- package/src/components/index.ts +11 -48
- package/src/locales/en.json +1 -2
- package/src/locales/es.json +1 -2
- package/src/locales/pt_br.json +1 -2
- package/src/stories/Alert.stories.js +67 -6
- package/src/stories/Button.stories.js +39 -29
- package/src/stories/Checkbox.stories.js +4 -11
- package/src/stories/Input.stories.js +76 -71
- package/src/stories/Label.stories.js +0 -7
- package/src/stories/ModalDialog.mdx +0 -3
- package/src/stories/ModalDialog.stories.js +1 -1
- package/src/stories/Switch.stories.js +5 -10
- package/src/stories/Tab.stories.js +4 -11
- package/src/stories/TextArea.stories.js +2 -13
- package/src/types/scheme-colors.d.ts +0 -1
- package/src/utils/call.js +18 -46
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +0 -28
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +0 -1
- package/dist/components/Toast/Toast.vue.d.ts +0 -16
- package/dist/components/Toast/Toast.vue.d.ts.map +0 -1
- package/dist/components/Toast/ToastManager.d.ts +0 -14
- package/dist/components/Toast/ToastManager.d.ts.map +0 -1
- package/dist/components/Toast/types.d.ts +0 -35
- package/dist/components/Toast/types.d.ts.map +0 -1
- package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -23
- package/dist/components/ui/dialog/Dialog.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -19
- package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -40
- package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -25
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -29
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -23
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -19
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/index.d.ts +0 -8
- package/dist/components/ui/dialog/index.d.ts.map +0 -1
- package/src/assets/icons/checkbox-checked-disabled.svg +0 -3
- package/src/assets/icons/checkbox-checked.svg +0 -3
- package/src/assets/icons/checkbox-less-disabled.svg +0 -3
- package/src/assets/icons/checkbox-less.svg +0 -3
- package/src/assets/icons/radio-checked.svg +0 -3
- package/src/assets/icons/switch-checked-disabled.svg +0 -3
- package/src/assets/icons/switch-checked.svg +0 -3
- package/src/components/Alert/SIMPLE_MIGRATION_GUIDE.md +0 -152
- package/src/components/CheckboxGroup/CheckboxGroup.vue +0 -96
- package/src/components/Popover/__tests__/Popover.spec.js +0 -147
- package/src/components/Popover/__tests__/__snapshots__/Popover.spec.js.snap +0 -8
- package/src/components/Popover/index.vue +0 -146
- package/src/components/RadioGroup/RadioGroup.vue +0 -142
- package/src/components/Select/SelectOption.vue +0 -65
- package/src/components/Select/__tests__/Select.spec.js +0 -412
- package/src/components/Select/__tests__/SelectItem.spec.js +0 -330
- package/src/components/Select/__tests__/SelectOption.spec.js +0 -174
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +0 -97
- package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +0 -15
- package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +0 -25
- package/src/components/Select/index.vue +0 -245
- package/src/components/Toast/Toast.vue +0 -246
- package/src/components/Toast/ToastManager.ts +0 -110
- package/src/components/Toast/__tests__/Toast.spec.js +0 -284
- package/src/components/Toast/__tests__/ToastManager.spec.js +0 -294
- package/src/components/Toast/types.ts +0 -57
- package/src/components/ui/dialog/Dialog.vue +0 -15
- package/src/components/ui/dialog/DialogClose.vue +0 -25
- package/src/components/ui/dialog/DialogContent.vue +0 -114
- package/src/components/ui/dialog/DialogFooter.vue +0 -46
- package/src/components/ui/dialog/DialogHeader.vue +0 -78
- package/src/components/ui/dialog/DialogTitle.vue +0 -34
- package/src/components/ui/dialog/DialogTrigger.vue +0 -12
- package/src/components/ui/dialog/index.ts +0 -7
- package/src/stories/CheckboxGroup.stories.js +0 -105
- package/src/stories/Dialog.stories.js +0 -832
- package/src/stories/RadioGroup.stories.js +0 -144
- package/src/stories/Select.stories.js +0 -158
- package/src/stories/Toast.mdx +0 -123
- package/src/stories/Toast.stories.js +0 -126
|
@@ -1,44 +1,37 @@
|
|
|
1
1
|
<!-- eslint-disable vue/multi-word-component-names -->
|
|
2
2
|
<template>
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
]"
|
|
23
|
-
data-testid="checkbox-text-right"
|
|
24
|
-
>
|
|
25
|
-
{{ label || textRight }}
|
|
26
|
-
</p>
|
|
27
|
-
</label>
|
|
28
|
-
|
|
29
|
-
<p
|
|
30
|
-
v-if="helper"
|
|
31
|
-
class="unnnic-checkbox__helper"
|
|
3
|
+
<div class="unnnic-checkbox-wrapper">
|
|
4
|
+
<UnnnicIcon
|
|
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"
|
|
16
|
+
:class="[
|
|
17
|
+
'unnnic-checkbox__label',
|
|
18
|
+
'unnnic-checkbox__label__right',
|
|
19
|
+
`unnnic-checkbox__label__${size}`,
|
|
20
|
+
]"
|
|
21
|
+
data-testid="checkbox-text-right"
|
|
32
22
|
>
|
|
33
|
-
{{
|
|
34
|
-
</
|
|
35
|
-
</
|
|
23
|
+
{{ textRight }}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
36
26
|
</template>
|
|
37
27
|
|
|
38
28
|
<script>
|
|
39
|
-
import
|
|
29
|
+
import UnnnicIcon from '../Icon.vue';
|
|
40
30
|
|
|
41
31
|
export default {
|
|
32
|
+
components: {
|
|
33
|
+
UnnnicIcon,
|
|
34
|
+
},
|
|
42
35
|
model: {
|
|
43
36
|
event: 'change',
|
|
44
37
|
},
|
|
@@ -57,16 +50,13 @@ export default {
|
|
|
57
50
|
default: false,
|
|
58
51
|
},
|
|
59
52
|
|
|
60
|
-
|
|
61
|
-
type: String,
|
|
62
|
-
default: '',
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
helper: {
|
|
53
|
+
size: {
|
|
66
54
|
type: String,
|
|
67
|
-
default: '',
|
|
55
|
+
default: 'md',
|
|
56
|
+
validator(value) {
|
|
57
|
+
return ['md', 'sm'].includes(value);
|
|
58
|
+
},
|
|
68
59
|
},
|
|
69
|
-
|
|
70
60
|
textRight: {
|
|
71
61
|
type: String,
|
|
72
62
|
default: '',
|
|
@@ -85,11 +75,25 @@ export default {
|
|
|
85
75
|
|
|
86
76
|
return 'less';
|
|
87
77
|
},
|
|
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
|
+
},
|
|
88
94
|
},
|
|
89
95
|
|
|
90
96
|
methods: {
|
|
91
|
-
pick,
|
|
92
|
-
|
|
93
97
|
click() {
|
|
94
98
|
const isChecked = ['checked', 'less'].includes(this.valueName);
|
|
95
99
|
this.$emit('change', !isChecked);
|
|
@@ -102,73 +106,35 @@ export default {
|
|
|
102
106
|
<style lang="scss" scoped>
|
|
103
107
|
@use '@/assets/scss/unnnic' as *;
|
|
104
108
|
|
|
105
|
-
$checkbox-size: 21px;
|
|
106
|
-
|
|
107
109
|
.unnnic-checkbox-wrapper {
|
|
108
110
|
display: flex;
|
|
109
|
-
flex-direction: column;
|
|
110
111
|
align-items: flex-start;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
label {
|
|
114
|
-
display: flex;
|
|
115
|
-
align-items: center;
|
|
116
|
-
column-gap: $unnnic-space-2;
|
|
112
|
+
cursor: pointer;
|
|
117
113
|
}
|
|
118
114
|
|
|
119
115
|
.unnnic-checkbox {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
margin: 0;
|
|
124
|
-
background-color: $unnnic-color-bg-base;
|
|
125
|
-
border: 1px solid $unnnic-color-border-base;
|
|
126
|
-
border-radius: $unnnic-radius-1;
|
|
127
|
-
box-sizing: border-box;
|
|
128
|
-
|
|
129
|
-
outline: none;
|
|
130
|
-
|
|
131
|
-
&:checked {
|
|
132
|
-
border-width: 0;
|
|
133
|
-
background-color: $unnnic-color-bg-active;
|
|
134
|
-
background-image: url('../../assets/icons/checkbox-checked.svg');
|
|
135
|
-
background-repeat: no-repeat;
|
|
136
|
-
background-position: center;
|
|
137
|
-
|
|
138
|
-
&.unnnic-checkbox--less {
|
|
139
|
-
background-image: url('../../assets/icons/checkbox-less.svg');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&:disabled,
|
|
144
|
-
&:disabled:checked {
|
|
145
|
-
background-color: $unnnic-color-bg-muted;
|
|
146
|
-
border: 1px solid $unnnic-color-border-muted;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
&:disabled:checked {
|
|
150
|
-
background-image: url('../../assets/icons/checkbox-checked-disabled.svg');
|
|
151
|
-
|
|
152
|
-
&.unnnic-checkbox--less {
|
|
153
|
-
background-image: url('../../assets/icons/checkbox-less-disabled.svg');
|
|
116
|
+
&.disabled {
|
|
117
|
+
:deep(.primary) {
|
|
118
|
+
fill: $unnnic-color-neutral-cleanest;
|
|
154
119
|
}
|
|
155
120
|
}
|
|
156
121
|
}
|
|
157
122
|
|
|
158
123
|
.unnnic-checkbox__label {
|
|
159
|
-
|
|
160
|
-
font: $unnnic-font-
|
|
161
|
-
color: $unnnic-color-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
124
|
+
font-family: $unnnic-font-family-secondary;
|
|
125
|
+
font-weight: $unnnic-font-weight-regular;
|
|
126
|
+
color: $unnnic-color-neutral-darkest;
|
|
127
|
+
|
|
128
|
+
&__sm {
|
|
129
|
+
margin-left: $unnnic-inline-nano;
|
|
130
|
+
font-size: $unnnic-font-size-body-md;
|
|
131
|
+
line-height: $unnnic-font-size-body-md + $unnnic-line-height-md;
|
|
165
132
|
}
|
|
166
|
-
}
|
|
167
133
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
134
|
+
&__md {
|
|
135
|
+
margin-left: $unnnic-inline-xs;
|
|
136
|
+
font-size: $unnnic-font-size-body-gt;
|
|
137
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
|
|
138
|
+
}
|
|
173
139
|
}
|
|
174
140
|
</style>
|
|
@@ -24,28 +24,43 @@ 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.findComponent({ name: 'UnnnicIcon' });
|
|
28
28
|
|
|
29
29
|
// click false to true
|
|
30
|
-
await checkbox.trigger('
|
|
30
|
+
await checkbox.trigger('click');
|
|
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('click');
|
|
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.icon).eq('checkbox-less');
|
|
41
|
+
await checkbox.trigger('click');
|
|
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.findComponent({ name: 'UnnnicIcon' });
|
|
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
|
+
});
|
|
51
66
|
});
|
|
@@ -3,53 +3,66 @@
|
|
|
3
3
|
class="unnnic-form-element"
|
|
4
4
|
:class="{ 'unnnic-form-element--disabled': disabled }"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
6
|
+
<p
|
|
7
7
|
v-if="label"
|
|
8
|
-
:label="label"
|
|
9
|
-
:tooltip="tooltip"
|
|
10
8
|
:class="[
|
|
11
9
|
'unnnic-form-element__label',
|
|
12
10
|
{
|
|
13
11
|
'unnnic-form-element__label--fixed': fixedLabel,
|
|
14
12
|
},
|
|
15
13
|
]"
|
|
16
|
-
|
|
14
|
+
>
|
|
15
|
+
{{ fullySanitize(label) }}
|
|
16
|
+
</p>
|
|
17
17
|
|
|
18
18
|
<slot></slot>
|
|
19
19
|
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
<p
|
|
21
|
+
v-if="shouldShowErrorSection"
|
|
22
|
+
class="unnnic-form-element__error"
|
|
23
|
+
>
|
|
24
|
+
<template v-if="error !== true">
|
|
25
|
+
<UnnnicIcon
|
|
26
|
+
size="sm"
|
|
27
|
+
icon="warning"
|
|
28
|
+
scheme="aux-red-500"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
{{ fullySanitize(error) }}
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<span
|
|
35
|
+
v-if="!!$slots.rightMessage"
|
|
36
|
+
class="unnnic-form-element__right-message"
|
|
37
|
+
>
|
|
38
|
+
<slot name="rightMessage"></slot>
|
|
39
|
+
</span>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p
|
|
43
|
+
v-if="message || !!$slots.rightMessage"
|
|
44
|
+
class="unnnic-form-element__message"
|
|
23
45
|
>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class="unnnic-form-element__message error"
|
|
34
|
-
>
|
|
35
|
-
{{ Array.isArray(error) ? error.join(', ') : error }}
|
|
36
|
-
</p>
|
|
37
|
-
</section>
|
|
38
|
-
<p v-if="!!$slots.rightMessage">
|
|
39
|
-
<slot name="rightMessage" />
|
|
40
|
-
</p>
|
|
41
|
-
</section>
|
|
46
|
+
{{ fullySanitize(message) }}
|
|
47
|
+
|
|
48
|
+
<span
|
|
49
|
+
v-if="!shouldShowErrorSection && !!$slots.rightMessage"
|
|
50
|
+
class="unnnic-form-element__right-message"
|
|
51
|
+
>
|
|
52
|
+
<slot name="rightMessage"></slot>
|
|
53
|
+
</span>
|
|
54
|
+
</p>
|
|
42
55
|
</section>
|
|
43
56
|
</template>
|
|
44
57
|
|
|
45
|
-
<script
|
|
58
|
+
<script>
|
|
59
|
+
import UnnnicIcon from '../../components/Icon.vue';
|
|
46
60
|
import { fullySanitize } from '../../utils/sanitize';
|
|
47
|
-
import UnnnicLabel from '../Label/Label.vue';
|
|
48
|
-
|
|
49
61
|
export default {
|
|
50
62
|
components: {
|
|
51
|
-
|
|
63
|
+
UnnnicIcon,
|
|
52
64
|
},
|
|
65
|
+
|
|
53
66
|
props: {
|
|
54
67
|
size: {
|
|
55
68
|
type: String,
|
|
@@ -57,20 +70,28 @@ export default {
|
|
|
57
70
|
validator: (size) => ['md', 'sm'].includes(size),
|
|
58
71
|
},
|
|
59
72
|
|
|
60
|
-
label:
|
|
73
|
+
label: String,
|
|
61
74
|
|
|
62
|
-
fixedLabel:
|
|
75
|
+
fixedLabel: Boolean,
|
|
63
76
|
|
|
64
77
|
error: {
|
|
65
78
|
type: [Boolean, String],
|
|
66
79
|
default: false,
|
|
67
80
|
},
|
|
68
81
|
|
|
69
|
-
message:
|
|
82
|
+
message: String,
|
|
70
83
|
|
|
71
|
-
disabled:
|
|
84
|
+
disabled: Boolean,
|
|
85
|
+
},
|
|
72
86
|
|
|
73
|
-
|
|
87
|
+
data() {
|
|
88
|
+
return {};
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
computed: {
|
|
92
|
+
shouldShowErrorSection() {
|
|
93
|
+
return this.error && (this.error !== true || !!this.$slots.rightMessage);
|
|
94
|
+
},
|
|
74
95
|
},
|
|
75
96
|
methods: {
|
|
76
97
|
fullySanitize,
|
|
@@ -81,66 +102,75 @@ export default {
|
|
|
81
102
|
<style lang="scss" scoped>
|
|
82
103
|
@use '@/assets/scss/unnnic' as *;
|
|
83
104
|
|
|
84
|
-
* {
|
|
85
|
-
margin: $unnnic-space-0;
|
|
86
|
-
padding: $unnnic-space-0;
|
|
87
|
-
box-sizing: border-box;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
105
|
.unnnic-form-element {
|
|
91
106
|
&__label {
|
|
92
|
-
|
|
107
|
+
margin: 0;
|
|
108
|
+
margin-bottom: $unnnic-spacing-nano;
|
|
109
|
+
|
|
93
110
|
color: $unnnic-color-neutral-cloudy;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
font-family: $unnnic-font-family-secondary;
|
|
112
|
+
font-weight: $unnnic-font-weight-regular;
|
|
113
|
+
font-size: $unnnic-font-size-body-gt;
|
|
114
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
|
|
115
|
+
|
|
116
|
+
$label-bottom-spacing: 3px;
|
|
98
117
|
|
|
99
118
|
&--fixed {
|
|
100
|
-
margin-top: -$unnnic-font-size-body-gt - $unnnic-
|
|
119
|
+
margin-top: -$unnnic-font-size-body-gt - $unnnic-line-height-md +
|
|
120
|
+
$label-bottom-spacing;
|
|
101
121
|
}
|
|
102
122
|
|
|
103
123
|
&--fixed {
|
|
104
|
-
margin-bottom:
|
|
124
|
+
margin-bottom: 0;
|
|
105
125
|
position: absolute;
|
|
106
|
-
padding:
|
|
107
|
-
margin-left: $unnnic-
|
|
126
|
+
padding: 0 $unnnic-spacing-nano;
|
|
127
|
+
margin-left: $unnnic-spacing-xs;
|
|
108
128
|
|
|
109
129
|
&:after {
|
|
110
130
|
content: ' ';
|
|
111
131
|
position: absolute;
|
|
112
|
-
left:
|
|
113
|
-
bottom: $
|
|
132
|
+
left: 0;
|
|
133
|
+
bottom: $label-bottom-spacing - $unnnic-border-width-thinner;
|
|
114
134
|
width: 100%;
|
|
115
135
|
height: $unnnic-border-width-thinner;
|
|
116
|
-
background-color: $unnnic-color-white;
|
|
136
|
+
background-color: $unnnic-color-neutral-white;
|
|
117
137
|
}
|
|
118
138
|
}
|
|
119
139
|
}
|
|
120
140
|
|
|
141
|
+
&__error,
|
|
121
142
|
&__message {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
143
|
+
margin: 0;
|
|
144
|
+
margin-top: $unnnic-spacing-stack-nano;
|
|
145
|
+
|
|
146
|
+
color: $unnnic-color-neutral-cloudy;
|
|
147
|
+
font-family: $unnnic-font-family-secondary;
|
|
148
|
+
font-weight: $unnnic-font-weight-regular;
|
|
149
|
+
font-size: $unnnic-font-size-body-md;
|
|
150
|
+
line-height: $unnnic-font-size-body-md + $unnnic-line-height-md;
|
|
125
151
|
}
|
|
126
152
|
|
|
127
|
-
&
|
|
153
|
+
&__message {
|
|
128
154
|
display: flex;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
155
|
+
column-gap: $unnnic-spacing-nano;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&__right-message {
|
|
159
|
+
margin-left: auto;
|
|
133
160
|
}
|
|
134
161
|
|
|
135
|
-
&
|
|
162
|
+
&__error {
|
|
136
163
|
display: flex;
|
|
137
|
-
|
|
138
|
-
|
|
164
|
+
column-gap: $unnnic-spacing-nano;
|
|
165
|
+
align-items: center;
|
|
166
|
+
|
|
167
|
+
color: $unnnic-color-aux-red-500;
|
|
139
168
|
}
|
|
140
169
|
|
|
141
170
|
&--disabled .unnnic-form-element__label,
|
|
142
171
|
&--disabled .unnnic-form-element__message {
|
|
143
172
|
user-select: none;
|
|
173
|
+
color: $unnnic-color-neutral-cleanest;
|
|
144
174
|
}
|
|
145
175
|
}
|
|
146
176
|
</style>
|
package/src/components/Icon.vue
CHANGED
|
@@ -4,18 +4,16 @@
|
|
|
4
4
|
v-mask="mask"
|
|
5
5
|
v-bind="attributes"
|
|
6
6
|
:value="fullySanitize(modelValue)"
|
|
7
|
-
:class="
|
|
7
|
+
:class="classes"
|
|
8
8
|
:type="nativeType"
|
|
9
|
-
:readonly="readonly"
|
|
10
9
|
/>
|
|
10
|
+
|
|
11
11
|
<input
|
|
12
12
|
v-else
|
|
13
13
|
v-bind="attributes"
|
|
14
14
|
:value="fullySanitize(modelValue)"
|
|
15
|
-
:class="
|
|
15
|
+
:class="classes"
|
|
16
16
|
:type="nativeType"
|
|
17
|
-
:maxlength="maxlength"
|
|
18
|
-
:readonly="readonly"
|
|
19
17
|
/>
|
|
20
18
|
</template>
|
|
21
19
|
|
|
@@ -51,19 +49,6 @@ export default {
|
|
|
51
49
|
},
|
|
52
50
|
hasIconLeft: Boolean,
|
|
53
51
|
hasIconRight: Boolean,
|
|
54
|
-
hasClearIcon: Boolean,
|
|
55
|
-
maxlength: {
|
|
56
|
-
type: Number,
|
|
57
|
-
default: null,
|
|
58
|
-
},
|
|
59
|
-
readonly: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: false,
|
|
62
|
-
},
|
|
63
|
-
forceActiveStatus: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: false,
|
|
66
|
-
},
|
|
67
52
|
},
|
|
68
53
|
emits: ['update:modelValue'],
|
|
69
54
|
data() {
|
|
@@ -88,7 +73,6 @@ export default {
|
|
|
88
73
|
{
|
|
89
74
|
'input--has-icon-left': this.hasIconLeft,
|
|
90
75
|
'input--has-icon-right': this.hasIconRight,
|
|
91
|
-
'input--has-clear-icon': this.hasClearIcon,
|
|
92
76
|
},
|
|
93
77
|
];
|
|
94
78
|
},
|
|
@@ -112,30 +96,27 @@ export default {
|
|
|
112
96
|
&.size {
|
|
113
97
|
&-md {
|
|
114
98
|
@include input-md-font;
|
|
115
|
-
|
|
116
|
-
|
|
99
|
+
|
|
100
|
+
padding: ($unnnic-spacing-ant - $unnnic-border-width-thinner)
|
|
101
|
+
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
117
102
|
}
|
|
118
103
|
|
|
119
104
|
&-sm {
|
|
120
105
|
@include input-sm-font;
|
|
121
|
-
|
|
122
|
-
|
|
106
|
+
|
|
107
|
+
padding: $unnnic-spacing-xs
|
|
108
|
+
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
123
109
|
}
|
|
124
110
|
}
|
|
125
111
|
|
|
126
112
|
&.input--has-icon-left {
|
|
127
|
-
padding-left: $unnnic-
|
|
113
|
+
padding-left: $unnnic-spacing-sm + $unnnic-icon-size-sm +
|
|
114
|
+
$unnnic-spacing-xs - $unnnic-border-width-thinner;
|
|
128
115
|
}
|
|
129
116
|
|
|
130
117
|
&.input--has-icon-right {
|
|
131
|
-
padding-right: $unnnic-
|
|
132
|
-
|
|
133
|
-
padding-right: $unnnic-space-10 + $unnnic-space-6;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&.input--has-clear-icon {
|
|
138
|
-
padding-right: $unnnic-space-10;
|
|
118
|
+
padding-right: $unnnic-spacing-sm + $unnnic-icon-size-sm +
|
|
119
|
+
$unnnic-spacing-xs - $unnnic-border-width-thinner;
|
|
139
120
|
}
|
|
140
121
|
|
|
141
122
|
&.error {
|
|
@@ -145,7 +126,7 @@ export default {
|
|
|
145
126
|
&:-ms-input-placeholder,
|
|
146
127
|
&::-ms-input-placeholder {
|
|
147
128
|
/* Internet Explorer 10-11 */
|
|
148
|
-
color: $unnnic-color-
|
|
129
|
+
color: $unnnic-color-brand-sec;
|
|
149
130
|
}
|
|
150
131
|
}
|
|
151
132
|
</style>
|
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
@use '@/assets/scss/unnnic' as *;
|
|
2
2
|
|
|
3
3
|
@mixin input-base {
|
|
4
|
-
background: $unnnic-color-white;
|
|
5
|
-
border: $unnnic-border-width-thinner solid $unnnic-color-
|
|
4
|
+
background: $unnnic-color-neutral-white;
|
|
5
|
+
border: $unnnic-border-width-thinner solid $unnnic-color-neutral-clean;
|
|
6
6
|
outline: none;
|
|
7
|
-
border-radius: $unnnic-radius-
|
|
8
|
-
color: $unnnic-color-
|
|
9
|
-
caret-color: $unnnic-color-
|
|
10
|
-
font: $unnnic-font-
|
|
7
|
+
border-radius: $unnnic-border-radius-sm;
|
|
8
|
+
color: $unnnic-color-neutral-darkest;
|
|
9
|
+
caret-color: $unnnic-color-neutral-clean;
|
|
10
|
+
font-weight: $unnnic-font-weight-regular;
|
|
11
|
+
font-family: $unnnic-font-family-secondary;
|
|
11
12
|
|
|
12
|
-
&:focus
|
|
13
|
-
|
|
14
|
-
transition: border-color 0.1s ease-in-out;
|
|
15
|
-
border-color: $unnnic-color-border-active;
|
|
13
|
+
&:focus {
|
|
14
|
+
border-color: $unnnic-color-weni-600;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
&::placeholder {
|
|
19
|
-
color: $unnnic-color-
|
|
20
|
-
opacity: 1;
|
|
21
|
-
/* Firefox */
|
|
18
|
+
color: $unnnic-color-neutral-cleanest;
|
|
19
|
+
opacity: 1; /* Firefox */
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
&:disabled {
|
|
25
|
-
border-color: $unnnic-color-
|
|
26
|
-
background-color: $unnnic-color-
|
|
23
|
+
border-color: $unnnic-color-neutral-cleanest;
|
|
24
|
+
background-color: $unnnic-color-neutral-lightest;
|
|
27
25
|
cursor: not-allowed;
|
|
28
|
-
color: $unnnic-color-
|
|
26
|
+
color: $unnnic-color-neutral-cleanest;
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
@mixin input-sm-font {
|
|
33
|
-
font: $unnnic-font-body;
|
|
31
|
+
font-size: $unnnic-font-size-body-md;
|
|
32
|
+
line-height: $unnnic-font-size-body-md + $unnnic-line-height-medium;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
@mixin input-md-font {
|
|
37
|
-
font: $unnnic-font-body;
|
|
36
|
+
font-size: $unnnic-font-size-body-gt;
|
|
37
|
+
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
@mixin input-error {
|
|
41
|
-
border-color: $unnnic-color-
|
|
42
|
-
|
|
41
|
+
border-color: $unnnic-color-aux-red-500;
|
|
42
|
+
color: $unnnic-color-aux-red-500;
|
|
43
|
+
}
|