@weni/unnnic-system 3.2.5-alpha.1 → 3.2.5
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 +31 -0
- package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
- package/dist/components/Alert/Alert.vue.d.ts +5 -5
- package/dist/components/Alert/Version1dot1.vue.d.ts +2 -2
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +3 -3
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +2 -2
- 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 +2 -2
- 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 +3 -3
- package/dist/components/Card/BlankCard.vue.d.ts +1 -1
- package/dist/components/Card/Card.vue.d.ts +20 -20
- package/dist/components/Card/CardCompany.vue.d.ts +7 -7
- package/dist/components/Card/CardData.vue.d.ts +1 -1
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +3 -3
- package/dist/components/Card/ContentCard.vue.d.ts +2 -2
- package/dist/components/Card/DashCard.vue.d.ts +4 -4
- 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 +2 -2
- package/dist/components/Card/StatusCard.vue.d.ts +2 -2
- package/dist/components/Card/TitleCard.vue.d.ts +1 -1
- package/dist/components/CardImage/CardImage.vue.d.ts +7 -7
- package/dist/components/CardInformation/CardInformation.vue.d.ts +3 -3
- package/dist/components/CardProject/CardProject.vue.d.ts +2 -2
- package/dist/components/Carousel/Carousel.vue.d.ts +10 -10
- package/dist/components/Carousel/TagCarousel.vue.d.ts +8 -8
- package/dist/components/ChartBar/ChartBar.vue.d.ts +7 -7
- package/dist/components/ChatText/ChatText.vue.d.ts +1 -1
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +14 -14
- 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 +4 -4
- 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 +3 -3
- package/dist/components/Chip/Chip.vue.d.ts +8 -0
- package/dist/components/Chip/Chip.vue.d.ts.map +1 -0
- package/dist/components/Chip/types.d.ts +9 -0
- package/dist/components/Chip/types.d.ts.map +1 -0
- package/dist/components/Comment/Comment.vue.d.ts +1 -1
- package/dist/components/DataArea/DataArea.vue.d.ts +1 -1
- 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 +27 -182
- package/dist/components/DatePicker/DatePicker.vue.d.ts +8 -8
- package/dist/components/Disclaimer/types.d.ts +1 -1
- package/dist/components/Disclaimer/types.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.vue.d.ts +7 -7
- package/dist/components/DropArea/DropArea.vue.d.ts +0 -2
- package/dist/components/DropArea/DropArea.vue.d.ts.map +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 +32 -38
- package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
- package/dist/components/Icon/types.d.ts +2 -1
- package/dist/components/Icon/types.d.ts.map +1 -1
- package/dist/components/Icon.vue.d.ts +3 -2
- 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 +7 -7
- package/dist/components/Input/BaseInput.vue.d.ts +1 -10
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +27 -182
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +13 -31
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +37 -192
- package/dist/components/InputNext/InputNext.vue.d.ts +3 -3
- package/dist/components/Modal/Modal.vue.d.ts +2 -2
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +10 -10
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +34 -189
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +14 -20
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +7 -7
- package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +2 -2
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +26 -44
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +7 -7
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +4 -4
- package/dist/components/SelectTime/index.vue.d.ts +13 -31
- package/dist/components/Slider/Slider.vue.d.ts +1 -1
- package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
- package/dist/components/Switch/Switch.vue.d.ts +2 -2
- package/dist/components/Tab/Tab.vue.d.ts +1 -1
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
- package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
- package/dist/components/Tag/BrandTag.vue.d.ts +2 -2
- package/dist/components/Tag/DefaultTag.vue.d.ts +2 -2
- package/dist/components/Tag/IndicatorTag.vue.d.ts +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +7 -7
- package/dist/components/TextArea/TextArea.vue.d.ts +32 -38
- package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
- package/dist/components/Tour/Tour.vue.d.ts +6 -6
- package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
- package/dist/components/UploadArea/UploadArea.vue.d.ts +7 -13
- package/dist/components/index.d.ts +791 -2085
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-dc7f4ae0.mjs → es-a07e7553.mjs} +1 -1
- package/dist/{index-93c6d4e1.mjs → index-93aafec9.mjs} +7771 -7911
- package/dist/{pt-br-6c72f1f4.mjs → pt-br-a81c613f.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +116 -118
- package/dist/unnnic.umd.js +41 -42
- package/package.json +2 -2
- package/src/assets/scss/scheme-colors.scss +132 -0
- package/src/assets/scss/unnnic.scss +2 -0
- package/src/components/Button/Button.vue +109 -58
- package/src/components/Button/types.ts +1 -0
- package/src/components/Card/Card.vue +12 -21
- package/src/components/Chip/Chip.vue +124 -0
- package/src/components/Chip/__tests__/Chip.spec.js +164 -0
- package/src/components/Chip/types.ts +8 -0
- package/src/components/Disclaimer/types.ts +1 -1
- package/src/components/DropArea/DropArea.vue +2 -26
- package/src/components/FormElement/FormElement.vue +90 -50
- package/src/components/Icon/types.ts +4 -95
- package/src/components/Icon.vue +3 -98
- package/src/components/Input/BaseInput.vue +12 -10
- package/src/components/Input/Input.scss +20 -17
- package/src/components/Input/Input.vue +28 -86
- package/src/components/Input/TextInput.vue +35 -27
- package/src/components/Input/__test__/TextInput.spec.js +5 -5
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +3 -12
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
- package/src/components/ModalDialog/ModalDialog.vue +29 -27
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.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 +9 -14
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +2 -7
- package/src/components/index.ts +7 -12
- package/src/stories/Button.stories.js +10 -1
- package/src/stories/Chip.stories.js +173 -0
- package/src/stories/Input.stories.js +3 -17
- package/src/types/scheme-colors.d.ts +102 -0
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts +0 -9
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +0 -1
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +0 -15
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts.map +0 -1
- package/src/assets/img/previews/doc-preview.png +0 -0
- package/src/assets/img/previews/image-preview.png +0 -0
- package/src/assets/img/previews/video-preview.png +0 -0
- package/src/components/TemplatePreview/TemplatePreview.vue +0 -249
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +0 -51
- package/src/components/TemplatePreview/types.d.ts +0 -16
- package/src/stories/TemplatePreview.stories.js +0 -94
- package/src/stories/TemplatePreviewModal.stories.js +0 -110
package/package.json
CHANGED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
@use './colors' as *;
|
|
2
|
+
@use './deprecated/colors' as *;
|
|
3
|
+
|
|
4
|
+
// Global scheme colors mapping for all components
|
|
5
|
+
|
|
6
|
+
$unnnic-scheme-colors:
|
|
7
|
+
'background-solo' $unnnic-color-teal-50,
|
|
8
|
+
'background-sky' $unnnic-color-gray-50,
|
|
9
|
+
'background-grass' $unnnic-color-green-50,
|
|
10
|
+
'background-carpet' $unnnic-color-gray-50,
|
|
11
|
+
'background-snow' $unnnic-color-white,
|
|
12
|
+
'background-lightest' $unnnic-color-gray-50,
|
|
13
|
+
'background-white' $unnnic-color-white,
|
|
14
|
+
|
|
15
|
+
'neutral-black' $unnnic-color-gray-900,
|
|
16
|
+
'neutral-darkest' $unnnic-color-gray-800,
|
|
17
|
+
'neutral-dark' $unnnic-color-gray-700,
|
|
18
|
+
'neutral-cloudy' $unnnic-color-gray-500,
|
|
19
|
+
'neutral-cleanest' $unnnic-color-gray-200,
|
|
20
|
+
'neutral-clean' $unnnic-color-gray-300,
|
|
21
|
+
'neutral-soft' $unnnic-color-gray-100,
|
|
22
|
+
'neutral-lightest' $unnnic-color-gray-50,
|
|
23
|
+
'neutral-light' $unnnic-color-gray-50,
|
|
24
|
+
'neutral-white' $unnnic-color-white,
|
|
25
|
+
'neutral-snow' $unnnic-color-white,
|
|
26
|
+
|
|
27
|
+
'feedback-red' $unnnic-color-red-500,
|
|
28
|
+
'feedback-green' $unnnic-color-green-500,
|
|
29
|
+
'feedback-yellow' $unnnic-color-yellow-500,
|
|
30
|
+
'feedback-blue' $unnnic-color-blue-500,
|
|
31
|
+
'feedback-grey' $unnnic-color-gray-500,
|
|
32
|
+
|
|
33
|
+
'aux-blue' $unnnic-color-blue-500,
|
|
34
|
+
'aux-purple' $unnnic-color-purple-500,
|
|
35
|
+
'aux-orange' $unnnic-color-orange-500,
|
|
36
|
+
'aux-lemon' $unnnic-color-yellow-400,
|
|
37
|
+
'aux-pink' $unnnic-color-red-300,
|
|
38
|
+
'aux-baby-blue' $unnnic-color-blue-200,
|
|
39
|
+
'aux-baby-yellow' $unnnic-color-yellow-200,
|
|
40
|
+
'aux-baby-red' $unnnic-color-red-200,
|
|
41
|
+
'aux-baby-green' $unnnic-color-green-200,
|
|
42
|
+
'aux-baby-pink' $unnnic-color-red-100,
|
|
43
|
+
|
|
44
|
+
'aux-green-100' $unnnic-color-green-100,
|
|
45
|
+
'aux-green-300' $unnnic-color-green-300,
|
|
46
|
+
'aux-green-500' $unnnic-color-green-500,
|
|
47
|
+
'aux-green-700' $unnnic-color-green-700,
|
|
48
|
+
'aux-green-900' $unnnic-color-green-900,
|
|
49
|
+
'aux-blue-100' $unnnic-color-blue-100,
|
|
50
|
+
'aux-blue-300' $unnnic-color-blue-300,
|
|
51
|
+
'aux-blue-500' $unnnic-color-blue-500,
|
|
52
|
+
'aux-blue-700' $unnnic-color-blue-700,
|
|
53
|
+
'aux-blue-900' $unnnic-color-blue-900,
|
|
54
|
+
'aux-purple-100' $unnnic-color-purple-100,
|
|
55
|
+
'aux-purple-300' $unnnic-color-purple-300,
|
|
56
|
+
'aux-purple-500' $unnnic-color-purple-500,
|
|
57
|
+
'aux-purple-700' $unnnic-color-purple-700,
|
|
58
|
+
'aux-purple-900' $unnnic-color-purple-900,
|
|
59
|
+
'aux-red-100' $unnnic-color-red-100,
|
|
60
|
+
'aux-red-300' $unnnic-color-red-300,
|
|
61
|
+
'aux-red-500' $unnnic-color-red-500,
|
|
62
|
+
'aux-red-700' $unnnic-color-red-700,
|
|
63
|
+
'aux-red-900' $unnnic-color-red-900,
|
|
64
|
+
'aux-orange-100' $unnnic-color-orange-100,
|
|
65
|
+
'aux-orange-300' $unnnic-color-orange-300,
|
|
66
|
+
'aux-orange-500' $unnnic-color-orange-500,
|
|
67
|
+
'aux-orange-700' $unnnic-color-orange-700,
|
|
68
|
+
'aux-orange-900' $unnnic-color-orange-900,
|
|
69
|
+
'aux-yellow-100' $unnnic-color-yellow-100,
|
|
70
|
+
'aux-yellow-300' $unnnic-color-yellow-300,
|
|
71
|
+
'aux-yellow-500' $unnnic-color-yellow-500,
|
|
72
|
+
'aux-yellow-700' $unnnic-color-yellow-700,
|
|
73
|
+
'aux-yellow-900' $unnnic-color-yellow-900,
|
|
74
|
+
|
|
75
|
+
'floweditor-blue' $unnnic-color-blue-600,
|
|
76
|
+
'floweditor-purple' $unnnic-color-purple-600,
|
|
77
|
+
'floweditor-wine' $unnnic-color-red-800,
|
|
78
|
+
'floweditor-orange' $unnnic-color-orange-600,
|
|
79
|
+
'floweditor-pink' $unnnic-color-red-400,
|
|
80
|
+
'floweditor-turquoise' $unnnic-color-teal-500,
|
|
81
|
+
'floweditor-green' $unnnic-color-green-600,
|
|
82
|
+
|
|
83
|
+
'weni-50' $unnnic-color-teal-50,
|
|
84
|
+
'weni-100' $unnnic-color-teal-100,
|
|
85
|
+
'weni-200' $unnnic-color-teal-200,
|
|
86
|
+
'weni-300' $unnnic-color-teal-300,
|
|
87
|
+
'weni-400' $unnnic-color-teal-400,
|
|
88
|
+
'weni-500' $unnnic-color-teal-500,
|
|
89
|
+
'weni-600' $unnnic-color-teal-600,
|
|
90
|
+
'weni-700' $unnnic-color-teal-700,
|
|
91
|
+
'weni-800' $unnnic-color-teal-800,
|
|
92
|
+
'weni-900' $unnnic-color-teal-900,
|
|
93
|
+
'weni-950' $unnnic-color-teal-950,
|
|
94
|
+
'brand-weni' $unnnic-color-teal-600,
|
|
95
|
+
'brand-weni-dark' $unnnic-color-teal-800,
|
|
96
|
+
'brand-weni-soft' $unnnic-color-teal-100,
|
|
97
|
+
'brand-sec-dark' $unnnic-color-blue-800,
|
|
98
|
+
'brand-sec-soft' $unnnic-color-blue-100,
|
|
99
|
+
'brand-sec' $unnnic-color-blue-600,
|
|
100
|
+
|
|
101
|
+
'bg-base' $unnnic-color-bg-base,
|
|
102
|
+
'bg-soft' $unnnic-color-bg-soft,
|
|
103
|
+
|
|
104
|
+
'teal-50' $unnnic-color-teal-50,
|
|
105
|
+
'teal-100' $unnnic-color-teal-100,
|
|
106
|
+
'teal-200' $unnnic-color-teal-200,
|
|
107
|
+
'teal-300' $unnnic-color-teal-300,
|
|
108
|
+
'teal-400' $unnnic-color-teal-400,
|
|
109
|
+
'teal-500' $unnnic-color-teal-500,
|
|
110
|
+
'teal-600' $unnnic-color-teal-600,
|
|
111
|
+
'teal-700' $unnnic-color-teal-700,
|
|
112
|
+
'teal-800' $unnnic-color-teal-800,
|
|
113
|
+
'teal-900' $unnnic-color-teal-900,
|
|
114
|
+
'teal-950' $unnnic-color-teal-950;
|
|
115
|
+
|
|
116
|
+
@mixin generate-scheme-classes($component-name, $property: 'background-color') {
|
|
117
|
+
@each $name, $color in $unnnic-scheme-colors {
|
|
118
|
+
.#{$component-name}--#{$name} {
|
|
119
|
+
#{$property}: $color;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@function get-scheme-color($name) {
|
|
125
|
+
@each $scheme-name, $color in $unnnic-scheme-colors {
|
|
126
|
+
@if $scheme-name == $name {
|
|
127
|
+
@return $color;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
@warn "Scheme color '#{$name}' not found in $unnnic-scheme-colors";
|
|
131
|
+
@return null;
|
|
132
|
+
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
@forward './spaces';
|
|
9
9
|
@forward './icon-sizes';
|
|
10
10
|
@forward './colors';
|
|
11
|
+
@forward './scheme-colors';
|
|
11
12
|
|
|
12
13
|
@use './deprecated/colors' as *;
|
|
13
14
|
@use './deprecated/fonts' as *;
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
@use './spaces' as *;
|
|
20
21
|
@use './icon-sizes' as *;
|
|
21
22
|
@use './colors' as *;
|
|
23
|
+
@use './scheme-colors' as *;
|
|
22
24
|
|
|
23
25
|
.unnnic {
|
|
24
26
|
&--clickable {
|
|
@@ -6,16 +6,20 @@
|
|
|
6
6
|
:class="[
|
|
7
7
|
'unnnic-button',
|
|
8
8
|
`unnnic-button--size-${size}`,
|
|
9
|
-
`unnnic-button--${
|
|
9
|
+
`unnnic-button--${type}`,
|
|
10
10
|
iconCenter ? `unnnic-button--icon-on-center` : null,
|
|
11
11
|
float ? `unnnic-button--float` : null,
|
|
12
12
|
]"
|
|
13
13
|
>
|
|
14
|
-
<
|
|
14
|
+
<UnnnicIcon
|
|
15
15
|
v-if="loading"
|
|
16
|
+
icon="loading-circle-1"
|
|
16
17
|
:scheme="iconScheme"
|
|
17
18
|
:size="iconSize"
|
|
19
|
+
:filled="iconsFilled"
|
|
18
20
|
:style="{ position: 'absolute' }"
|
|
21
|
+
class="rotation"
|
|
22
|
+
:next="next"
|
|
19
23
|
data-testid="icon-loading"
|
|
20
24
|
/>
|
|
21
25
|
|
|
@@ -68,9 +72,8 @@
|
|
|
68
72
|
<script setup lang="ts">
|
|
69
73
|
import { computed, watch, useSlots } from 'vue';
|
|
70
74
|
import UnnnicIcon from '../Icon.vue';
|
|
71
|
-
import UnnnicIconLoading from '../IconLoading/IconLoading.vue';
|
|
72
75
|
import type { ButtonProps, ButtonSize, ButtonType } from './types';
|
|
73
|
-
import type { SchemeColor } from '
|
|
76
|
+
import type { SchemeColor } from '@/types/scheme-colors';
|
|
74
77
|
|
|
75
78
|
defineOptions({
|
|
76
79
|
name: 'UnnnicButton',
|
|
@@ -99,8 +102,8 @@ const buttonDisabled = computed(() => {
|
|
|
99
102
|
});
|
|
100
103
|
|
|
101
104
|
const iconSize = computed(() => {
|
|
102
|
-
if (props.size === '
|
|
103
|
-
return '
|
|
105
|
+
if (props.size === 'small') return 'sm';
|
|
106
|
+
return 'md';
|
|
104
107
|
});
|
|
105
108
|
|
|
106
109
|
const hasText = computed(() => {
|
|
@@ -117,11 +120,12 @@ const iconScheme = computed((): SchemeColor => {
|
|
|
117
120
|
primary: 'neutral-white',
|
|
118
121
|
secondary: 'neutral-dark',
|
|
119
122
|
tertiary: 'neutral-dark',
|
|
123
|
+
alternative: 'neutral-white',
|
|
120
124
|
warning: 'neutral-white',
|
|
121
125
|
attention: 'neutral-white',
|
|
122
126
|
};
|
|
123
127
|
|
|
124
|
-
return typeToSchemeMap[
|
|
128
|
+
return typeToSchemeMap[props.type] || 'neutral-white';
|
|
125
129
|
});
|
|
126
130
|
|
|
127
131
|
const isSizePropValid = computed(() => {
|
|
@@ -132,21 +136,16 @@ const isSizePropValid = computed(() => {
|
|
|
132
136
|
);
|
|
133
137
|
});
|
|
134
138
|
|
|
135
|
-
const buttonType = computed(() => {
|
|
136
|
-
return {
|
|
137
|
-
'alternative': 'tertiary',
|
|
138
|
-
}[props.type] || props.type;
|
|
139
|
-
});
|
|
140
|
-
|
|
141
139
|
const isTypePropValid = computed(() => {
|
|
142
140
|
const validTypes: ButtonType[] = [
|
|
143
141
|
'primary',
|
|
144
142
|
'secondary',
|
|
145
143
|
'tertiary',
|
|
144
|
+
'alternative',
|
|
146
145
|
'warning',
|
|
147
146
|
'attention',
|
|
148
147
|
];
|
|
149
|
-
return validTypes.includes(
|
|
148
|
+
return validTypes.includes(props.type);
|
|
150
149
|
});
|
|
151
150
|
|
|
152
151
|
const validateProps = () => {
|
|
@@ -160,7 +159,6 @@ const validateProps = () => {
|
|
|
160
159
|
|
|
161
160
|
if (!isTypePropValid.value) {
|
|
162
161
|
errorMessage += ' Invalid type prop.';
|
|
163
|
-
errorMessage += ' Please provide one of the following types: primary, secondary, tertiary, warning, attention. Alternative is discontinued and it was forced renamed to tertiary.';
|
|
164
162
|
}
|
|
165
163
|
|
|
166
164
|
throw new Error(errorMessage);
|
|
@@ -198,12 +196,13 @@ watch(
|
|
|
198
196
|
display: inline-flex;
|
|
199
197
|
align-items: center;
|
|
200
198
|
justify-content: center;
|
|
201
|
-
border-radius: $unnnic-radius-
|
|
199
|
+
border-radius: $unnnic-border-radius-sm;
|
|
202
200
|
border: 0;
|
|
203
201
|
outline: none;
|
|
204
202
|
overflow: hidden;
|
|
205
203
|
white-space: nowrap;
|
|
206
|
-
font: $unnnic-font-
|
|
204
|
+
font-weight: $unnnic-font-weight-regular;
|
|
205
|
+
font-family: $unnnic-font-family-secondary;
|
|
207
206
|
cursor: pointer;
|
|
208
207
|
position: relative;
|
|
209
208
|
|
|
@@ -217,91 +216,129 @@ watch(
|
|
|
217
216
|
}
|
|
218
217
|
}
|
|
219
218
|
|
|
220
|
-
&--primary,
|
|
221
|
-
&--warning,
|
|
222
|
-
&--attention {
|
|
223
|
-
color: $unnnic-color-fg-inverted;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
&--secondary,
|
|
227
|
-
&--tertiary {
|
|
228
|
-
color: $unnnic-color-fg-emphasized;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
219
|
&--primary {
|
|
232
|
-
background-color: $unnnic-color-
|
|
220
|
+
background-color: $unnnic-color-weni-600;
|
|
221
|
+
color: $unnnic-color-neutral-white;
|
|
233
222
|
|
|
234
223
|
&:hover:enabled {
|
|
235
|
-
background-color: $unnnic-color-
|
|
224
|
+
background-color: $unnnic-color-weni-700;
|
|
236
225
|
}
|
|
237
226
|
|
|
238
227
|
&:active:enabled {
|
|
239
|
-
background-color: $unnnic-color-
|
|
228
|
+
background-color: $unnnic-color-weni-800;
|
|
240
229
|
}
|
|
241
230
|
}
|
|
242
231
|
|
|
243
232
|
&--secondary {
|
|
244
|
-
background-color: $unnnic-color-
|
|
233
|
+
background-color: $unnnic-color-neutral-white;
|
|
234
|
+
color: $unnnic-color-neutral-dark;
|
|
245
235
|
box-shadow: inset 0 0 0 $unnnic-border-width-thinner
|
|
246
|
-
$unnnic-color-
|
|
236
|
+
$unnnic-color-neutral-cleanest;
|
|
247
237
|
|
|
248
238
|
&:hover:enabled {
|
|
249
|
-
background-color: $unnnic-color-
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
&:active:enabled {
|
|
253
|
-
background-color: $unnnic-color-gray-100;
|
|
239
|
+
background-color: $unnnic-color-neutral-light;
|
|
254
240
|
}
|
|
255
241
|
|
|
256
242
|
&:disabled {
|
|
257
243
|
box-shadow: none;
|
|
258
244
|
}
|
|
245
|
+
|
|
246
|
+
&:active:enabled {
|
|
247
|
+
background-color: $unnnic-color-neutral-soft;
|
|
248
|
+
}
|
|
259
249
|
}
|
|
260
250
|
|
|
261
251
|
&--tertiary {
|
|
262
252
|
background-color: transparent;
|
|
253
|
+
color: $unnnic-color-neutral-dark;
|
|
263
254
|
|
|
264
255
|
&:hover:enabled {
|
|
265
|
-
background-color:
|
|
256
|
+
background-color: $unnnic-color-neutral-light;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
&:disabled {
|
|
260
|
+
color: $unnnic-color-neutral-clean;
|
|
261
|
+
cursor: not-allowed;
|
|
266
262
|
}
|
|
267
263
|
|
|
268
264
|
&:active:enabled {
|
|
269
|
-
background-color:
|
|
265
|
+
background-color: $unnnic-color-neutral-soft;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
&--alternative {
|
|
270
|
+
background-color: $unnnic-color-weni-50;
|
|
271
|
+
color: $unnnic-color-weni-800;
|
|
272
|
+
|
|
273
|
+
:deep(svg .primary) {
|
|
274
|
+
fill: $unnnic-color-weni-800;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
:deep(svg .primary-stroke) {
|
|
278
|
+
stroke: $unnnic-color-weni-800;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
&:hover:enabled {
|
|
282
|
+
background-color: $unnnic-color-weni-100;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&:disabled {
|
|
286
|
+
:deep(svg .primary) {
|
|
287
|
+
fill: $unnnic-color-neutral-clean;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
:deep(svg .primary-stroke) {
|
|
291
|
+
stroke: $unnnic-color-neutral-clean;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&:active:enabled {
|
|
296
|
+
background-color: $unnnic-color-weni-200;
|
|
297
|
+
color: $unnnic-color-weni-900;
|
|
298
|
+
|
|
299
|
+
:deep(svg .primary) {
|
|
300
|
+
fill: $unnnic-color-weni-900;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
:deep(svg .primary-stroke) {
|
|
304
|
+
stroke: $unnnic-color-weni-900;
|
|
305
|
+
}
|
|
270
306
|
}
|
|
271
307
|
}
|
|
272
308
|
|
|
273
309
|
&--warning {
|
|
274
|
-
background-color: $unnnic-color-red-500;
|
|
310
|
+
background-color: $unnnic-color-aux-red-500;
|
|
275
311
|
color: $unnnic-color-neutral-white;
|
|
276
312
|
|
|
277
313
|
&:hover:enabled {
|
|
278
|
-
background-color: $unnnic-color-red-
|
|
314
|
+
background-color: $unnnic-color-aux-red-700;
|
|
279
315
|
}
|
|
280
316
|
|
|
281
317
|
&:active:enabled {
|
|
282
|
-
background-color: $unnnic-color-red-
|
|
318
|
+
background-color: $unnnic-color-aux-red-900;
|
|
283
319
|
}
|
|
284
320
|
}
|
|
285
321
|
|
|
286
322
|
&--attention {
|
|
287
|
-
background-color: $unnnic-color-yellow-500;
|
|
323
|
+
background-color: $unnnic-color-aux-yellow-500;
|
|
324
|
+
color: $unnnic-color-neutral-white;
|
|
288
325
|
|
|
289
326
|
&:hover:enabled {
|
|
290
|
-
background-color: $unnnic-color-yellow-
|
|
327
|
+
background-color: $unnnic-color-aux-yellow-700;
|
|
291
328
|
}
|
|
292
329
|
|
|
293
330
|
&:active:enabled {
|
|
294
|
-
background-color: $unnnic-color-yellow-
|
|
331
|
+
background-color: $unnnic-color-aux-yellow-900;
|
|
295
332
|
}
|
|
296
333
|
}
|
|
297
334
|
|
|
298
335
|
&--primary:disabled,
|
|
299
336
|
&--secondary:disabled,
|
|
300
|
-
&--
|
|
337
|
+
&--alternative:disabled,
|
|
301
338
|
&--warning:disabled,
|
|
302
339
|
&--attention:disabled {
|
|
303
|
-
background-color: $unnnic-color-
|
|
304
|
-
color: $unnnic-color-
|
|
340
|
+
background-color: $unnnic-color-neutral-soft;
|
|
341
|
+
color: $unnnic-color-neutral-clean;
|
|
305
342
|
cursor: not-allowed;
|
|
306
343
|
}
|
|
307
344
|
|
|
@@ -314,12 +351,26 @@ watch(
|
|
|
314
351
|
box-shadow: $unnnic-shadow-level-near;
|
|
315
352
|
}
|
|
316
353
|
|
|
317
|
-
&--size
|
|
318
|
-
|
|
319
|
-
|
|
354
|
+
&--size {
|
|
355
|
+
&-extra-large,
|
|
356
|
+
&-large,
|
|
357
|
+
&-small {
|
|
358
|
+
padding: $unnnic-squish-xs;
|
|
359
|
+
font-size: $unnnic-font-size-body-gt;
|
|
360
|
+
line-height: ($unnnic-font-size-body-gt + $unnnic-line-height-medium);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
&-extra-large {
|
|
364
|
+
height: 58px;
|
|
365
|
+
}
|
|
320
366
|
|
|
321
|
-
|
|
322
|
-
|
|
367
|
+
&-large {
|
|
368
|
+
height: 46px;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
&-small {
|
|
372
|
+
height: 38px;
|
|
373
|
+
}
|
|
323
374
|
}
|
|
324
375
|
}
|
|
325
376
|
</style>
|
|
@@ -337,8 +388,8 @@ watch(
|
|
|
337
388
|
}
|
|
338
389
|
|
|
339
390
|
&-large {
|
|
340
|
-
height:
|
|
341
|
-
width:
|
|
391
|
+
height: 46px;
|
|
392
|
+
width: 46px;
|
|
342
393
|
}
|
|
343
394
|
|
|
344
395
|
&-large,
|
|
@@ -353,8 +404,8 @@ watch(
|
|
|
353
404
|
|
|
354
405
|
&-small {
|
|
355
406
|
padding: $unnnic-inset-nano;
|
|
356
|
-
height:
|
|
357
|
-
width:
|
|
407
|
+
height: 38px;
|
|
408
|
+
width: 38px;
|
|
358
409
|
|
|
359
410
|
.unnnic-icon {
|
|
360
411
|
width: $unnnic-icon-size-ant;
|
|
@@ -194,29 +194,20 @@ export default {
|
|
|
194
194
|
<style lang="scss">
|
|
195
195
|
@use '@/assets/scss/unnnic' as *;
|
|
196
196
|
|
|
197
|
-
$
|
|
198
|
-
'feedback-red' $unnnic-color-feedback-red,
|
|
199
|
-
'feedback-green' $unnnic-color-feedback-green,
|
|
200
|
-
'feedback-yellow' $unnnic-color-feedback-yellow,
|
|
201
|
-
'feedback-blue' $unnnic-color-feedback-blue,
|
|
202
|
-
'feedback-grey' $unnnic-color-feedback-grey,
|
|
203
|
-
'aux-blue' $unnnic-color-aux-blue,
|
|
204
|
-
'aux-purple' $unnnic-color-aux-purple,
|
|
205
|
-
'aux-orange' $unnnic-color-aux-orange,
|
|
206
|
-
'aux-lemon' $unnnic-color-aux-lemon,
|
|
207
|
-
'aux-pink' $unnnic-color-aux-pink,
|
|
208
|
-
'brand-weni-soft' $unnnic-color-brand-weni-soft;
|
|
197
|
+
$card-needed-colors: 'feedback-red', 'feedback-green', 'feedback-yellow', 'feedback-blue', 'feedback-grey', 'aux-blue', 'aux-purple', 'aux-orange', 'aux-lemon', 'aux-pink', 'brand-weni-soft';
|
|
209
198
|
|
|
210
|
-
@each $name, $color in $scheme-colors {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
&--icon {
|
|
199
|
+
@each $name, $color in $unnnic-scheme-colors {
|
|
200
|
+
@if index($card-needed-colors, $name) {
|
|
201
|
+
.unnnic-card-scheme {
|
|
202
|
+
&--#{$name} {
|
|
203
|
+
background-color: rgba($color, $unnnic-opacity-level-extra-light);
|
|
216
204
|
color: $color;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
205
|
+
&--icon {
|
|
206
|
+
color: $color;
|
|
207
|
+
}
|
|
208
|
+
&--border {
|
|
209
|
+
border-left: 0.25 * $unnnic-font-size solid $color;
|
|
210
|
+
}
|
|
220
211
|
}
|
|
221
212
|
}
|
|
222
213
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<!-- eslint-disable vue/multi-word-component-names -->
|
|
2
|
+
<template>
|
|
3
|
+
<section
|
|
4
|
+
:class="[
|
|
5
|
+
'chip',
|
|
6
|
+
chipClass,
|
|
7
|
+
{
|
|
8
|
+
'chip--border': shouldShowBorder,
|
|
9
|
+
'chip--is-clickable': isClickable
|
|
10
|
+
}
|
|
11
|
+
]"
|
|
12
|
+
@click="onClick"
|
|
13
|
+
>
|
|
14
|
+
<p :class="['chip__text', textColorClass]">{{ text }}</p>
|
|
15
|
+
<p v-if="count" :class="['chip__count', countColorClass]">{{ count }}</p>
|
|
16
|
+
<UnnnicIcon
|
|
17
|
+
v-if="type === 'multiple'"
|
|
18
|
+
:icon="isSelected ? 'close' : 'add'"
|
|
19
|
+
:scheme="isSelected ? 'teal-600' : 'feedback-grey'"
|
|
20
|
+
class="chip__icon"
|
|
21
|
+
size="sm"
|
|
22
|
+
/>
|
|
23
|
+
</section>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import { computed } from 'vue';
|
|
28
|
+
import UnnnicIcon from '../Icon.vue';
|
|
29
|
+
import type { ChipProps } from './types';
|
|
30
|
+
|
|
31
|
+
const props = defineProps<ChipProps>();
|
|
32
|
+
|
|
33
|
+
const emit = defineEmits<{
|
|
34
|
+
click: [event: Event];
|
|
35
|
+
}>();
|
|
36
|
+
|
|
37
|
+
const onClick = (event: Event) => {
|
|
38
|
+
emit('click', event);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const shouldShowBorder = computed(() => {
|
|
42
|
+
return !props.isSelected;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const textColorClass = computed(() => {
|
|
46
|
+
if (props.isSelected) {
|
|
47
|
+
return 'chip__text--is-selected';
|
|
48
|
+
}
|
|
49
|
+
return '';
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const countColorClass = computed(() => {
|
|
53
|
+
if (props.isSelected) {
|
|
54
|
+
return 'chip__count--is-selected';
|
|
55
|
+
}
|
|
56
|
+
return '';
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const chipClass = computed(() => {
|
|
60
|
+
return props.isSelected ? 'chip--is-selected' : '';
|
|
61
|
+
});
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style lang="scss" scoped>
|
|
65
|
+
@use '@/assets/scss/unnnic' as *;
|
|
66
|
+
|
|
67
|
+
.chip {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
height: 26px;
|
|
70
|
+
padding: $unnnic-space-1 $unnnic-space-3;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: $unnnic-space-2;
|
|
74
|
+
flex-shrink: 0;
|
|
75
|
+
border-radius: 600px;
|
|
76
|
+
background-color: $unnnic-color-bg-base;
|
|
77
|
+
|
|
78
|
+
&:hover {
|
|
79
|
+
background-color: $unnnic-color-bg-soft;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&--is-selected {
|
|
83
|
+
background-color: $unnnic-color-teal-100;
|
|
84
|
+
&:hover {
|
|
85
|
+
background-color: $unnnic-color-teal-200;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--is-clickable {
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&--border {
|
|
94
|
+
border: 1px solid $unnnic-color-border-base;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__text {
|
|
98
|
+
color: $unnnic-color-fg-base;
|
|
99
|
+
font: $unnnic-font-caption-1;
|
|
100
|
+
|
|
101
|
+
&--is-selected {
|
|
102
|
+
color: $unnnic-color-fg-active;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__count {
|
|
107
|
+
display: flex;
|
|
108
|
+
padding: 0 $unnnic-space-2;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
align-items: center;
|
|
111
|
+
gap: 10px;
|
|
112
|
+
border-radius: 600px;
|
|
113
|
+
background: $unnnic-color-bg-soft;
|
|
114
|
+
color: $unnnic-color-fg-base;
|
|
115
|
+
font: $unnnic-font-caption-1;
|
|
116
|
+
font-weight: $unnnic-font-weight-medium;
|
|
117
|
+
|
|
118
|
+
&--is-selected {
|
|
119
|
+
color: $unnnic-color-fg-active;
|
|
120
|
+
background: $unnnic-color-white;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</style>
|