@weni/unnnic-system 3.9.4 → 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 +94 -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/MarketplaceCard.vue.d.ts.map +1 -1
- 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-8146fb1b.mjs → es-e3248052.mjs} +1 -1
- package/dist/{index-724ed422.mjs → index-f67d5b30.mjs} +9292 -8808
- package/dist/{pt-br-af294ec9.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/fonts/material-symbols-rounded.woff2 +0 -0
- 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/Card/MarketplaceCard.vue +1 -0
- 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/Collapse/Collapse.vue +1 -1
- package/src/components/Collapse/__tests__/__snapshots__/Collapse.spec.js.snap +1 -1
- package/src/components/FormElement/FormElement.vue +63 -93
- package/src/components/Icon.vue +4 -10
- 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/Icon.stories.js +2 -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/assets/fonts/Material Symbols Rounded Filled.woff2 +0 -0
- package/src/assets/fonts/Material Symbols Rounded.woff2 +0 -0
- 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
|
@@ -1,144 +1,88 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section
|
|
3
|
-
:class="`unnnic-tag
|
|
4
|
-
${!disabled ? `unnnic-tag-scheme--${scheme}` : `unnnic-tag--disabled`}
|
|
5
|
-
${clickable ? 'unnnic-tag--clickable' : ''}`"
|
|
6
|
-
>
|
|
2
|
+
<section :class="`unnnic-tag unnnic-tag--${size}`">
|
|
7
3
|
<section
|
|
8
4
|
v-if="leftIcon"
|
|
9
5
|
class="unnnic-tag__icon"
|
|
10
6
|
>
|
|
11
7
|
<UnnnicIcon
|
|
12
8
|
:icon="leftIcon"
|
|
13
|
-
|
|
14
|
-
size="sm"
|
|
15
|
-
/>
|
|
16
|
-
</section>
|
|
17
|
-
<span
|
|
18
|
-
:class="`unnnic-tag__label
|
|
19
|
-
${disabled ? 'unnnic-tag__label--disabled' : ''}`"
|
|
20
|
-
>{{ text }}</span
|
|
21
|
-
>
|
|
22
|
-
<section
|
|
23
|
-
v-if="rightIcon || hasCloseIcon"
|
|
24
|
-
:class="{ 'unnnic-tag__icon': true, clickable: !rightIcon }"
|
|
25
|
-
@click.stop="hasCloseIcon ? emitClose() : () => {}"
|
|
26
|
-
>
|
|
27
|
-
<UnnnicIcon
|
|
28
|
-
:icon="rightIcon || 'close'"
|
|
29
|
-
:scheme="rightIcon ? scheme : 'neutral-darkest'"
|
|
9
|
+
scheme="fg-emphasized"
|
|
30
10
|
size="sm"
|
|
31
11
|
/>
|
|
32
12
|
</section>
|
|
13
|
+
<p :class="`unnnic-tag__label`">{{ text }}</p>
|
|
33
14
|
</section>
|
|
34
15
|
</template>
|
|
35
16
|
|
|
36
|
-
<script>
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { computed } from 'vue';
|
|
19
|
+
|
|
20
|
+
import { color as colors } from '@/assets/tokens/colors.json';
|
|
21
|
+
|
|
37
22
|
import UnnnicIcon from '../Icon.vue';
|
|
38
23
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
rightIcon: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: null,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
methods: {
|
|
75
|
-
closeClicked() {
|
|
76
|
-
if (!this.closeClicked) return;
|
|
77
|
-
this.$emit('close-click');
|
|
78
|
-
},
|
|
79
|
-
emitClose() {
|
|
80
|
-
this.$emit('close');
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
};
|
|
24
|
+
import type { DefaultTagProps } from './types';
|
|
25
|
+
|
|
26
|
+
const props = withDefaults(defineProps<DefaultTagProps>(), {
|
|
27
|
+
text: undefined,
|
|
28
|
+
size: 'medium',
|
|
29
|
+
scheme: 'aux-purple',
|
|
30
|
+
leftIcon: undefined,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const COLOR_MAPPING = [
|
|
34
|
+
{ keywords: ['green'], color: colors.green[200].value },
|
|
35
|
+
{ keywords: ['blue'], color: colors.blue[200].value },
|
|
36
|
+
{ keywords: ['purple'], color: colors.purple[200].value },
|
|
37
|
+
{ keywords: ['red', 'pink'], color: colors.red[200].value },
|
|
38
|
+
{ keywords: ['orange'], color: colors.orange[200].value },
|
|
39
|
+
{ keywords: ['yellow'], color: colors.yellow[200].value },
|
|
40
|
+
{ keywords: ['gray'], color: colors.gray[200].value },
|
|
41
|
+
{ keywords: ['teal', 'weni'], color: colors.teal[200].value },
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const color = computed(() => {
|
|
45
|
+
const scheme = props.scheme.toLowerCase();
|
|
46
|
+
|
|
47
|
+
const match = COLOR_MAPPING.find(({ keywords }) =>
|
|
48
|
+
keywords.some((keyword) => scheme.includes(keyword)),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return match?.color ?? colors.gray[200].value;
|
|
52
|
+
});
|
|
84
53
|
</script>
|
|
85
54
|
|
|
86
55
|
<style lang="scss" scoped>
|
|
87
56
|
@use '@/assets/scss/unnnic' as *;
|
|
88
57
|
|
|
89
|
-
@each $name, $color in $scheme-colors {
|
|
90
|
-
.unnnic-tag-scheme--#{$name} {
|
|
91
|
-
background-color: rgba($color, $unnnic-opacity-level-light);
|
|
92
|
-
outline-style: solid;
|
|
93
|
-
outline-color: rgba($color, $unnnic-opacity-level-extra-light);
|
|
94
|
-
outline-width: $unnnic-border-width-thinner;
|
|
95
|
-
outline-offset: -$unnnic-border-width-thinner;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
58
|
.unnnic-tag {
|
|
100
59
|
display: flex;
|
|
101
60
|
align-items: center;
|
|
102
61
|
justify-content: center;
|
|
62
|
+
gap: $unnnic-space-1;
|
|
103
63
|
border-radius: $unnnic-border-radius-pill;
|
|
104
|
-
padding:
|
|
64
|
+
padding: calc($unnnic-space-1 * 1.5) $unnnic-space-3;
|
|
65
|
+
width: fit-content;
|
|
105
66
|
|
|
106
|
-
|
|
107
|
-
background-color: $unnnic-color-background-sky;
|
|
108
|
-
}
|
|
67
|
+
background-color: v-bind(color);
|
|
109
68
|
|
|
110
|
-
&--
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
@each $name, $color in $scheme-colors {
|
|
114
|
-
&.unnnic-tag-scheme--#{$name}:hover {
|
|
115
|
-
outline-style: solid;
|
|
116
|
-
outline-color: $unnnic-color-neutral-cleanest;
|
|
117
|
-
outline-width: $unnnic-border-width-thinner;
|
|
118
|
-
outline-offset: -$unnnic-border-width-thinner;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
69
|
+
&--small {
|
|
70
|
+
padding: calc($unnnic-space-1 * 0.5) $unnnic-space-3;
|
|
121
71
|
}
|
|
122
72
|
|
|
123
73
|
&__label {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
color: $unnnic-color-neutral-cloudy;
|
|
133
|
-
}
|
|
74
|
+
margin: 0;
|
|
75
|
+
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
text-overflow: ellipsis;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
|
|
80
|
+
font: $unnnic-font-caption-1;
|
|
81
|
+
color: $unnnic-color-fg-emphasized;
|
|
134
82
|
}
|
|
135
83
|
|
|
136
84
|
&__icon {
|
|
137
85
|
display: flex;
|
|
138
86
|
}
|
|
139
|
-
|
|
140
|
-
.clickable {
|
|
141
|
-
cursor: pointer;
|
|
142
|
-
}
|
|
143
87
|
}
|
|
144
88
|
</style>
|
|
@@ -1,90 +1,43 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<UnnnicChip
|
|
3
|
+
v-if="type === 'brand' || hasCloseIcon"
|
|
4
|
+
:text="text"
|
|
5
|
+
type="multiple"
|
|
6
|
+
:isSelected="disabled || hasCloseIcon"
|
|
7
|
+
isClickable
|
|
8
|
+
@click="hasCloseIcon ? $emit('close') : $emit('click')"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<DefaultTag
|
|
12
|
+
v-else
|
|
13
|
+
:size="type === 'next' ? 'small' : size"
|
|
6
14
|
:text="text"
|
|
7
|
-
:disabled="disabled"
|
|
8
|
-
:hasCloseIcon="hasCloseIcon"
|
|
9
15
|
:scheme="scheme"
|
|
10
|
-
:count="count"
|
|
11
|
-
:hasBackButton="hasBackButton"
|
|
12
|
-
:clickable="clickable"
|
|
13
|
-
:tooltipText="tooltipText"
|
|
14
|
-
:enableTooltip="enableTooltip"
|
|
15
16
|
:leftIcon="leftIcon"
|
|
16
|
-
:rightIcon="rightIcon"
|
|
17
17
|
/>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
|
-
<script>
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import UnnnicChip from '../Chip/Chip.vue';
|
|
21
22
|
import DefaultTag from './DefaultTag.vue';
|
|
22
|
-
import
|
|
23
|
-
import BrandTag from './BrandTag.vue';
|
|
24
|
-
import TagNext from './TagNext.vue';
|
|
23
|
+
import type { TagProps } from './types';
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
defineOptions({
|
|
27
26
|
name: 'UnnnicTag',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
clickable: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: false,
|
|
47
|
-
},
|
|
48
|
-
count: {
|
|
49
|
-
type: Number,
|
|
50
|
-
default: 0,
|
|
51
|
-
},
|
|
52
|
-
disabled: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false,
|
|
55
|
-
},
|
|
56
|
-
hasCloseIcon: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
scheme: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: 'aux-purple',
|
|
63
|
-
},
|
|
64
|
-
hasBackButton: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
default: false,
|
|
67
|
-
},
|
|
68
|
-
enableTooltip: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: false,
|
|
71
|
-
},
|
|
72
|
-
leftIcon: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: '',
|
|
75
|
-
},
|
|
76
|
-
rightIcon: {
|
|
77
|
-
type: String,
|
|
78
|
-
default: '',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
computed: {
|
|
82
|
-
currentComponent() {
|
|
83
|
-
if (this.type === 'indicator') return IndicatorTag;
|
|
84
|
-
if (this.type === 'brand') return BrandTag;
|
|
85
|
-
if (this.type === 'next') return TagNext;
|
|
86
|
-
return DefaultTag;
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
withDefaults(defineProps<TagProps>(), {
|
|
30
|
+
type: 'default',
|
|
31
|
+
size: 'medium',
|
|
32
|
+
text: undefined,
|
|
33
|
+
disabled: false,
|
|
34
|
+
scheme: 'aux-purple',
|
|
35
|
+
leftIcon: '',
|
|
36
|
+
hasCloseIcon: false,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
defineEmits<{
|
|
40
|
+
close: [];
|
|
41
|
+
click: [];
|
|
42
|
+
}>();
|
|
90
43
|
</script>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type TagType = 'default' | 'brand' | 'next';
|
|
2
|
+
export type TagSize = 'small' | 'medium';
|
|
3
|
+
|
|
4
|
+
export interface TagProps {
|
|
5
|
+
type?: TagType;
|
|
6
|
+
size?: TagSize;
|
|
7
|
+
text?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
scheme?: string;
|
|
10
|
+
leftIcon?: string;
|
|
11
|
+
hasCloseIcon?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface DefaultTagProps {
|
|
15
|
+
text?: string;
|
|
16
|
+
size?: TagSize;
|
|
17
|
+
scheme?: string;
|
|
18
|
+
leftIcon?: string;
|
|
19
|
+
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
:size="size"
|
|
5
5
|
:disabled="disabled"
|
|
6
6
|
:message="message"
|
|
7
|
-
:
|
|
7
|
+
:tooltip="tooltip"
|
|
8
|
+
:error="computedError"
|
|
8
9
|
>
|
|
9
10
|
<textarea
|
|
10
11
|
ref="textarea"
|
|
@@ -18,13 +19,14 @@
|
|
|
18
19
|
:disabled="disabled"
|
|
19
20
|
:value="modelValue"
|
|
20
21
|
@input="$emit('update:modelValue', fullySanitize($event.target.value))"
|
|
21
|
-
|
|
22
|
+
/>
|
|
22
23
|
|
|
23
24
|
<template
|
|
24
25
|
v-if="maxLength"
|
|
25
26
|
#rightMessage
|
|
26
|
-
>{{ modelValue.length }}/{{ maxLength }}</template
|
|
27
27
|
>
|
|
28
|
+
{{ modelValue.length }}/{{ maxLength }}
|
|
29
|
+
</template>
|
|
28
30
|
</UnnnicFormElement>
|
|
29
31
|
</template>
|
|
30
32
|
|
|
@@ -43,6 +45,14 @@ export default {
|
|
|
43
45
|
default: 'md',
|
|
44
46
|
},
|
|
45
47
|
|
|
48
|
+
resize: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'vertical',
|
|
51
|
+
validator(value) {
|
|
52
|
+
return ['none', 'vertical'].indexOf(value) !== -1;
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
|
|
46
56
|
label: {
|
|
47
57
|
type: String,
|
|
48
58
|
},
|
|
@@ -76,13 +86,28 @@ export default {
|
|
|
76
86
|
},
|
|
77
87
|
},
|
|
78
88
|
|
|
89
|
+
tooltip: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: '',
|
|
92
|
+
},
|
|
93
|
+
|
|
79
94
|
errors: {
|
|
80
|
-
type: Array,
|
|
95
|
+
type: [Array, null],
|
|
81
96
|
default: () => [],
|
|
82
97
|
},
|
|
83
98
|
},
|
|
84
99
|
emits: ['update:modelValue'],
|
|
85
100
|
|
|
101
|
+
computed: {
|
|
102
|
+
computedError() {
|
|
103
|
+
if (Array.isArray(this.errors)) {
|
|
104
|
+
return this.errors.join(', ') || this.type === 'error';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return this.errors || this.type === 'error';
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
|
|
86
111
|
methods: {
|
|
87
112
|
fullySanitize,
|
|
88
113
|
focus() {
|
|
@@ -96,31 +121,35 @@ export default {
|
|
|
96
121
|
@use '@/assets/scss/unnnic' as *;
|
|
97
122
|
@use '@/components/Input/Input' as *;
|
|
98
123
|
|
|
124
|
+
* {
|
|
125
|
+
margin: 0;
|
|
126
|
+
padding: 0;
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
}
|
|
129
|
+
|
|
99
130
|
.unnnic-text-area {
|
|
100
131
|
&__textarea {
|
|
101
132
|
@include input-base;
|
|
102
133
|
|
|
103
134
|
display: block;
|
|
104
135
|
width: 100%;
|
|
105
|
-
|
|
106
|
-
|
|
136
|
+
|
|
137
|
+
resize: v-bind(resize);
|
|
107
138
|
|
|
108
139
|
scrollbar-width: thin;
|
|
109
140
|
|
|
141
|
+
padding: $unnnic-space-3 $unnnic-space-4;
|
|
142
|
+
|
|
110
143
|
&--size-md {
|
|
111
144
|
@include input-md-font;
|
|
112
145
|
|
|
113
|
-
min-height:
|
|
114
|
-
padding: ($unnnic-spacing-ant - $unnnic-border-width-thinner)
|
|
115
|
-
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
146
|
+
min-height: 90px;
|
|
116
147
|
}
|
|
117
148
|
|
|
118
149
|
&--size-sm {
|
|
119
150
|
@include input-sm-font;
|
|
120
151
|
|
|
121
|
-
min-height:
|
|
122
|
-
padding: ($unnnic-spacing-xs)
|
|
123
|
-
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
152
|
+
min-height: $unnnic-space-20;
|
|
124
153
|
}
|
|
125
154
|
|
|
126
155
|
&.unnnic-text-area__textarea--type-error {
|
|
@@ -2,8 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`TextArea.vue > matches the snapshot 1`] = `
|
|
4
4
|
"<section data-v-9f8d6c86="" data-v-735b3c51="" class="unnnic-form-element">
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<section data-v-7f222291="" data-v-9f8d6c86="" class="unnnic-label unnnic-form-element__label">
|
|
6
|
+
<p data-v-7f222291="" class="unnnic-label__label">Description</p>
|
|
7
|
+
<!--v-if-->
|
|
8
|
+
</section><textarea data-v-735b3c51="" class="unnnic-text-area__textarea unnnic-text-area__textarea--size-md unnnic-text-area__textarea--type-normal" placeholder="Enter text" maxlength="200" value=""></textarea>
|
|
9
|
+
<section data-v-9f8d6c86="" class="unnnic-form-element__hints-container">
|
|
10
|
+
<section data-v-9f8d6c86="" class="unnnic-form-element__message-container">
|
|
11
|
+
<!--v-if-->
|
|
12
|
+
<!--v-if-->
|
|
13
|
+
</section>
|
|
14
|
+
<p data-v-9f8d6c86="">0/200</p>
|
|
15
|
+
</section>
|
|
8
16
|
</section>"
|
|
9
17
|
`;
|