@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
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
:class="[
|
|
4
|
+
'unnnic-checkbox-group__container',
|
|
5
|
+
`unnnic-checkbox-group--state-${state}`,
|
|
6
|
+
]"
|
|
7
|
+
>
|
|
8
|
+
<UnnnicLabel
|
|
9
|
+
v-if="label"
|
|
10
|
+
:label="label"
|
|
11
|
+
:tooltip="labelTooltip"
|
|
12
|
+
:useHtmlTooltip="labelUseHtmlTooltip"
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<section class="unnnic-checkbox-group__checkboxes">
|
|
16
|
+
<slot />
|
|
17
|
+
</section>
|
|
18
|
+
|
|
19
|
+
<footer
|
|
20
|
+
v-if="helper"
|
|
21
|
+
class="unnnic-checkbox-group__helper"
|
|
22
|
+
>
|
|
23
|
+
{{ helper }}
|
|
24
|
+
</footer>
|
|
25
|
+
</section>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup>
|
|
29
|
+
import UnnnicLabel from '../Label/Label.vue';
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
state: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'horizontal',
|
|
35
|
+
validator(value) {
|
|
36
|
+
return ['horizontal', 'vertical'].includes(value);
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
label: {
|
|
41
|
+
type: String,
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
labelTooltip: {
|
|
45
|
+
type: String,
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
labelUseHtmlTooltip: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
helper: {
|
|
53
|
+
type: String,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style lang="scss" scoped>
|
|
59
|
+
@use '@/assets/scss/unnnic' as *;
|
|
60
|
+
|
|
61
|
+
.unnnic-checkbox-group {
|
|
62
|
+
&__container {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&__checkboxes {
|
|
68
|
+
margin-top: $unnnic-space-3;
|
|
69
|
+
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: $unnnic-space-4 $unnnic-space-6;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&__helper {
|
|
75
|
+
margin-top: $unnnic-space-2;
|
|
76
|
+
font: $unnnic-font-caption-2;
|
|
77
|
+
color: $unnnic-color-fg-base;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&--state-horizontal {
|
|
81
|
+
.unnnic-checkbox-group__checkboxes {
|
|
82
|
+
flex-direction: row;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&--state-vertical {
|
|
87
|
+
.unnnic-checkbox-group__checkboxes {
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.unnnic-checkbox-group__helper {
|
|
92
|
+
margin-top: $unnnic-space-3;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Collapse.vue > matches the snapshot 1`] = `
|
|
4
4
|
"<div data-v-7d0d9fbd="" data-testid="collapse" class="unnnic-collapse unnnic-collapse--size-lg">
|
|
5
|
-
<div data-v-7d0d9fbd="" data-testid="collapse-header" class="unnnic-collapse__header">Test Title<span data-v-26446d8e="" data-v-7d0d9fbd="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--neutral-cloudy unnnic-icon-size--
|
|
5
|
+
<div data-v-7d0d9fbd="" data-testid="collapse-header" class="unnnic-collapse__header">Test Title<span data-v-26446d8e="" data-v-7d0d9fbd="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--neutral-cloudy unnnic-icon-size--ant unnnic-icon__size--ant" data-testid="material-icon" translate="no">expand_more</span></div>
|
|
6
6
|
<div data-v-7d0d9fbd="" class="unnnic-collapse__body" style="display: none;"></div>
|
|
7
7
|
</div>"
|
|
8
8
|
`;
|
|
@@ -3,66 +3,53 @@
|
|
|
3
3
|
class="unnnic-form-element"
|
|
4
4
|
:class="{ 'unnnic-form-element--disabled': disabled }"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
6
|
+
<UnnnicLabel
|
|
7
7
|
v-if="label"
|
|
8
|
+
:label="label"
|
|
9
|
+
:tooltip="tooltip"
|
|
8
10
|
:class="[
|
|
9
11
|
'unnnic-form-element__label',
|
|
10
12
|
{
|
|
11
13
|
'unnnic-form-element__label--fixed': fixedLabel,
|
|
12
14
|
},
|
|
13
15
|
]"
|
|
14
|
-
|
|
15
|
-
{{ fullySanitize(label) }}
|
|
16
|
-
</p>
|
|
16
|
+
/>
|
|
17
17
|
|
|
18
18
|
<slot></slot>
|
|
19
19
|
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
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"
|
|
20
|
+
<section
|
|
21
|
+
class="unnnic-form-element__hints-container"
|
|
22
|
+
v-if="message || error || !!$slots.rightMessage"
|
|
45
23
|
>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
24
|
+
<section class="unnnic-form-element__message-container">
|
|
25
|
+
<p
|
|
26
|
+
v-if="message"
|
|
27
|
+
class="unnnic-form-element__message"
|
|
28
|
+
>
|
|
29
|
+
{{ fullySanitize(message) }}
|
|
30
|
+
</p>
|
|
31
|
+
<p
|
|
32
|
+
v-if="!!error?.length"
|
|
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>
|
|
55
42
|
</section>
|
|
56
43
|
</template>
|
|
57
44
|
|
|
58
|
-
<script>
|
|
59
|
-
import UnnnicIcon from '../../components/Icon.vue';
|
|
45
|
+
<script lang="js">
|
|
60
46
|
import { fullySanitize } from '../../utils/sanitize';
|
|
47
|
+
import UnnnicLabel from '../Label/Label.vue';
|
|
48
|
+
|
|
61
49
|
export default {
|
|
62
50
|
components: {
|
|
63
|
-
|
|
51
|
+
UnnnicLabel,
|
|
64
52
|
},
|
|
65
|
-
|
|
66
53
|
props: {
|
|
67
54
|
size: {
|
|
68
55
|
type: String,
|
|
@@ -70,28 +57,20 @@ export default {
|
|
|
70
57
|
validator: (size) => ['md', 'sm'].includes(size),
|
|
71
58
|
},
|
|
72
59
|
|
|
73
|
-
label: String,
|
|
60
|
+
label: { type: String, default: '' },
|
|
74
61
|
|
|
75
|
-
fixedLabel: Boolean,
|
|
62
|
+
fixedLabel: { type: Boolean, default: false },
|
|
76
63
|
|
|
77
64
|
error: {
|
|
78
65
|
type: [Boolean, String],
|
|
79
66
|
default: false,
|
|
80
67
|
},
|
|
81
68
|
|
|
82
|
-
message: String,
|
|
69
|
+
message: { type: String, default: '' },
|
|
83
70
|
|
|
84
|
-
disabled: Boolean,
|
|
85
|
-
},
|
|
71
|
+
disabled: { type: Boolean, default: false },
|
|
86
72
|
|
|
87
|
-
|
|
88
|
-
return {};
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
computed: {
|
|
92
|
-
shouldShowErrorSection() {
|
|
93
|
-
return this.error && (this.error !== true || !!this.$slots.rightMessage);
|
|
94
|
-
},
|
|
73
|
+
tooltip: { type: String, default: '' },
|
|
95
74
|
},
|
|
96
75
|
methods: {
|
|
97
76
|
fullySanitize,
|
|
@@ -102,75 +81,66 @@ export default {
|
|
|
102
81
|
<style lang="scss" scoped>
|
|
103
82
|
@use '@/assets/scss/unnnic' as *;
|
|
104
83
|
|
|
84
|
+
* {
|
|
85
|
+
margin: $unnnic-space-0;
|
|
86
|
+
padding: $unnnic-space-0;
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
}
|
|
89
|
+
|
|
105
90
|
.unnnic-form-element {
|
|
106
91
|
&__label {
|
|
107
|
-
|
|
108
|
-
margin-bottom: $unnnic-spacing-nano;
|
|
109
|
-
|
|
92
|
+
font: $unnnic-font-body;
|
|
110
93
|
color: $unnnic-color-neutral-cloudy;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
$label-bottom-spacing: 3px;
|
|
94
|
+
margin-bottom: $unnnic-space-1;
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
gap: $unnnic-space-2;
|
|
117
98
|
|
|
118
99
|
&--fixed {
|
|
119
|
-
margin-top: -$unnnic-font-size-body-gt - $unnnic-
|
|
120
|
-
$label-bottom-spacing;
|
|
100
|
+
margin-top: -$unnnic-font-size-body-gt - $unnnic-space-2 + $unnnic-space-1;
|
|
121
101
|
}
|
|
122
102
|
|
|
123
103
|
&--fixed {
|
|
124
|
-
margin-bottom: 0;
|
|
104
|
+
margin-bottom: $unnnic-space-0;
|
|
125
105
|
position: absolute;
|
|
126
|
-
padding: 0 $unnnic-
|
|
127
|
-
margin-left: $unnnic-
|
|
106
|
+
padding: $unnnic-space-0 $unnnic-space-1;
|
|
107
|
+
margin-left: $unnnic-space-2;
|
|
128
108
|
|
|
129
109
|
&:after {
|
|
130
110
|
content: ' ';
|
|
131
111
|
position: absolute;
|
|
132
|
-
left: 0;
|
|
133
|
-
bottom: $
|
|
112
|
+
left: $unnnic-space-0;
|
|
113
|
+
bottom: $unnnic-space-1 - $unnnic-border-width-thinner;
|
|
134
114
|
width: 100%;
|
|
135
115
|
height: $unnnic-border-width-thinner;
|
|
136
|
-
background-color: $unnnic-color-
|
|
116
|
+
background-color: $unnnic-color-white;
|
|
137
117
|
}
|
|
138
118
|
}
|
|
139
119
|
}
|
|
140
120
|
|
|
141
|
-
&__error,
|
|
142
121
|
&__message {
|
|
143
|
-
|
|
144
|
-
|
|
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;
|
|
122
|
+
&.error {
|
|
123
|
+
color: $unnnic-color-fg-critical;
|
|
124
|
+
}
|
|
151
125
|
}
|
|
152
126
|
|
|
153
|
-
&
|
|
127
|
+
&__hints-container {
|
|
154
128
|
display: flex;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
margin-left: auto;
|
|
129
|
+
justify-content: space-between;
|
|
130
|
+
margin-top: $unnnic-space-1;
|
|
131
|
+
font: $unnnic-font-caption-2;
|
|
132
|
+
color: $unnnic-color-fg-base;
|
|
160
133
|
}
|
|
161
134
|
|
|
162
|
-
&
|
|
135
|
+
&__message-container {
|
|
163
136
|
display: flex;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
color: $unnnic-color-aux-red-500;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
gap: $unnnic-space-1;
|
|
168
139
|
}
|
|
169
140
|
|
|
170
141
|
&--disabled .unnnic-form-element__label,
|
|
171
142
|
&--disabled .unnnic-form-element__message {
|
|
172
143
|
user-select: none;
|
|
173
|
-
color: $unnnic-color-neutral-cleanest;
|
|
174
144
|
}
|
|
175
145
|
}
|
|
176
146
|
</style>
|
package/src/components/Icon.vue
CHANGED
|
@@ -133,15 +133,7 @@ $icon-sizes:
|
|
|
133
133
|
font-family: 'Material Symbols Rounded';
|
|
134
134
|
font-style: normal;
|
|
135
135
|
font-weight: 300;
|
|
136
|
-
src: url('../assets/fonts/
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@font-face {
|
|
140
|
-
font-family: 'Material Symbols Rounded Filled';
|
|
141
|
-
font-style: normal;
|
|
142
|
-
font-weight: 300;
|
|
143
|
-
src: url('../assets/fonts/Material Symbols Rounded Filled.woff2')
|
|
144
|
-
format('woff2');
|
|
136
|
+
src: url('../assets/fonts/material-symbols-rounded.woff2') format('woff2');
|
|
145
137
|
}
|
|
146
138
|
|
|
147
139
|
.unnnic-icon {
|
|
@@ -197,8 +189,10 @@ $icon-sizes:
|
|
|
197
189
|
-webkit-font-feature-settings: 'liga';
|
|
198
190
|
-webkit-font-smoothing: antialiased;
|
|
199
191
|
|
|
192
|
+
user-select: none;
|
|
193
|
+
|
|
200
194
|
&--filled {
|
|
201
|
-
font-
|
|
195
|
+
font-variation-settings: 'FILL' 1;
|
|
202
196
|
}
|
|
203
197
|
}
|
|
204
198
|
</style>
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
:class="classes"
|
|
8
8
|
:type="nativeType"
|
|
9
9
|
/>
|
|
10
|
-
|
|
11
10
|
<input
|
|
12
11
|
v-else
|
|
13
12
|
v-bind="attributes"
|
|
14
13
|
:value="fullySanitize(modelValue)"
|
|
15
14
|
:class="classes"
|
|
16
15
|
:type="nativeType"
|
|
16
|
+
:maxlength="maxlength"
|
|
17
17
|
/>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
@@ -49,6 +49,10 @@ export default {
|
|
|
49
49
|
},
|
|
50
50
|
hasIconLeft: Boolean,
|
|
51
51
|
hasIconRight: Boolean,
|
|
52
|
+
maxlength: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: null,
|
|
55
|
+
},
|
|
52
56
|
},
|
|
53
57
|
emits: ['update:modelValue'],
|
|
54
58
|
data() {
|
|
@@ -96,27 +100,23 @@ export default {
|
|
|
96
100
|
&.size {
|
|
97
101
|
&-md {
|
|
98
102
|
@include input-md-font;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
103
|
+
padding: $unnnic-space-3 $unnnic-space-4;
|
|
104
|
+
height: 45px;
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
&-sm {
|
|
105
108
|
@include input-sm-font;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
109
|
+
padding: $unnnic-space-2 $unnnic-space-4;
|
|
110
|
+
height: 37px;
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
&.input--has-icon-left {
|
|
113
|
-
padding-left: $unnnic-
|
|
114
|
-
$unnnic-spacing-xs - $unnnic-border-width-thinner;
|
|
115
|
+
padding-left: $unnnic-space-10;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
&.input--has-icon-right {
|
|
118
|
-
padding-right: $unnnic-
|
|
119
|
-
$unnnic-spacing-xs - $unnnic-border-width-thinner;
|
|
119
|
+
padding-right: $unnnic-space-10;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
&.error {
|
|
@@ -126,7 +126,7 @@ export default {
|
|
|
126
126
|
&:-ms-input-placeholder,
|
|
127
127
|
&::-ms-input-placeholder {
|
|
128
128
|
/* Internet Explorer 10-11 */
|
|
129
|
-
color: $unnnic-color-
|
|
129
|
+
color: $unnnic-color-fg-muted;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
</style>
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
@use '@/assets/scss/unnnic' as *;
|
|
2
2
|
|
|
3
3
|
@mixin input-base {
|
|
4
|
-
background: $unnnic-color-
|
|
5
|
-
border: $unnnic-border-width-thinner solid $unnnic-color-
|
|
4
|
+
background: $unnnic-color-white;
|
|
5
|
+
border: $unnnic-border-width-thinner solid $unnnic-color-border-base;
|
|
6
6
|
outline: none;
|
|
7
|
-
border-radius: $unnnic-
|
|
8
|
-
color: $unnnic-color-
|
|
9
|
-
caret-color: $unnnic-color-
|
|
10
|
-
font
|
|
11
|
-
|
|
7
|
+
border-radius: $unnnic-radius-2;
|
|
8
|
+
color: $unnnic-color-fg-emphasized;
|
|
9
|
+
caret-color: $unnnic-color-fg-muted;
|
|
10
|
+
font: $unnnic-font-body;
|
|
11
|
+
|
|
12
|
+
transition: border-color 0.1s ease-in-out;
|
|
12
13
|
|
|
13
14
|
&:focus {
|
|
14
|
-
border-color: $unnnic-color-
|
|
15
|
+
border-color: $unnnic-color-border-active;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
&::placeholder {
|
|
18
|
-
color: $unnnic-color-
|
|
19
|
-
opacity: 1;
|
|
19
|
+
color: $unnnic-color-fg-muted;
|
|
20
|
+
opacity: 1;
|
|
21
|
+
/* Firefox */
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
&:disabled {
|
|
23
|
-
border-color: $unnnic-color-
|
|
24
|
-
background-color: $unnnic-color-
|
|
25
|
+
border-color: $unnnic-color-border-muted;
|
|
26
|
+
background-color: $unnnic-color-bg-muted;
|
|
25
27
|
cursor: not-allowed;
|
|
26
|
-
color: $unnnic-color-
|
|
28
|
+
color: $unnnic-color-fg-muted;
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
@mixin input-sm-font {
|
|
31
|
-
font
|
|
32
|
-
line-height: $unnnic-font-size-body-md + $unnnic-line-height-medium;
|
|
33
|
+
font: $unnnic-font-body;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
@mixin input-md-font {
|
|
36
|
-
font
|
|
37
|
-
line-height: $unnnic-font-size-body-gt + $unnnic-line-height-medium;
|
|
37
|
+
font: $unnnic-font-body;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
@mixin input-error {
|
|
41
|
-
border-color: $unnnic-color-
|
|
42
|
-
|
|
43
|
-
}
|
|
41
|
+
border-color: $unnnic-color-border-critical;
|
|
42
|
+
}
|