@weni/unnnic-system 3.12.3-alpha.4 → 3.12.3
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 -0
- package/dist/components/Alert/Alert.vue.d.ts +3 -3
- package/dist/components/Alert/Version1dot1.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +18 -92
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +36 -184
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +2 -2
- package/dist/components/Card/AccountCard.vue.d.ts +2 -2
- package/dist/components/Card/Card.vue.d.ts +29 -103
- package/dist/components/Card/CardCompany.vue.d.ts +2 -2
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +19 -93
- package/dist/components/Card/ContentCard.vue.d.ts +1 -1
- package/dist/components/Card/DashCard.vue.d.ts +2 -2
- package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
- package/dist/components/Card/MarketplaceCard.vue.d.ts +1 -1
- package/dist/components/Card/SimpleCard.vue.d.ts +18 -92
- package/dist/components/Card/StatusCard.vue.d.ts +1 -1
- package/dist/components/Card/TitleCard.vue.d.ts +18 -92
- package/dist/components/CardImage/CardImage.vue.d.ts +5 -5
- package/dist/components/CardInformation/CardInformation.vue.d.ts +19 -93
- package/dist/components/CardProject/CardProject.vue.d.ts +2 -2
- package/dist/components/Carousel/Carousel.vue.d.ts +2 -2
- package/dist/components/Carousel/TagCarousel.vue.d.ts +2 -2
- package/dist/components/ChartBar/ChartBar.vue.d.ts +24 -98
- package/dist/components/ChartLine/ChartLine.vue.d.ts +18 -92
- package/dist/components/ChatText/ChatText.vue.d.ts +18 -92
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +6 -6
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +18 -92
- package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
- package/dist/components/DataArea/DataArea.vue.d.ts +18 -92
- 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 +15 -94
- package/dist/components/Disclaimer/Disclaimer.vue.d.ts +3 -6
- package/dist/components/Disclaimer/Disclaimer.vue.d.ts.map +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.vue.d.ts +8 -0
- package/dist/components/Disclaimer/DisclaimerV2.vue.d.ts.map +1 -0
- package/dist/components/Disclaimer/types-v2.d.ts +7 -0
- package/dist/components/Disclaimer/types-v2.d.ts.map +1 -0
- package/dist/components/Disclaimer/types.d.ts +3 -6
- package/dist/components/Disclaimer/types.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.vue.d.ts +207 -37
- package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/dist/components/FormElement/FormElement.vue.d.ts +6 -6
- package/dist/components/ImportCard/ImportCard.vue.d.ts +6 -6
- package/dist/components/Input/BaseInput.vue.d.ts +0 -22
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +14 -93
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +3 -54
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputNext/InputNext.vue.d.ts +4 -4
- package/dist/components/Label/Label.vue.d.ts +1 -1
- package/dist/components/Label/Label.vue.d.ts.map +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +35 -209
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +20 -99
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +12 -12
- package/dist/components/MoodRating/MoodRating.vue.d.ts +18 -92
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +163 -0
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
- package/dist/components/Radio/Radio.vue.d.ts +6 -6
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +12 -63
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +2 -2
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +5 -5
- package/dist/components/SelectTime/index.vue.d.ts +4 -55
- package/dist/components/Slider/Slider.vue.d.ts +18 -92
- package/dist/components/Switch/Switch.vue.d.ts +3 -3
- package/dist/components/Tab/Tab.vue.d.ts +18 -92
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
- package/dist/components/Tag/DefaultTag.vue.d.ts +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +2 -2
- package/dist/components/TextArea/TextArea.vue.d.ts +8 -8
- package/dist/components/Toast/Toast.vue.d.ts +1 -1
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/ToolTip/ToolTip.vue.d.ts +18 -92
- package/dist/components/ToolTip/ToolTip.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 +6 -6
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +2 -2
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/components/ui/popover/PopoverOption.vue.d.ts +1 -1
- package/dist/components/ui/popover/PopoverOption.vue.d.ts.map +1 -1
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts.map +1 -1
- package/dist/{es-e4e4f53d.mjs → es-c19444c0.mjs} +1 -1
- package/dist/{index-492e2532.mjs → index-93b45359.mjs} +51889 -54730
- package/dist/locales/en.json.d.ts +1 -3
- package/dist/locales/es.json.d.ts +1 -3
- package/dist/locales/pt_br.json.d.ts +1 -3
- package/dist/{pt-br-ac2463c3.mjs → pt-br-23dc9ca6.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +206 -234
- package/dist/unnnic.umd.js +44 -48
- package/package.json +2 -3
- package/src/assets/scss/scheme-colors.scss +223 -223
- package/src/assets/scss/tailwind.scss +0 -8
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
- package/src/components/Checkbox/Checkbox.vue +1 -1
- package/src/components/Disclaimer/Disclaimer.vue +42 -136
- package/src/components/Disclaimer/DisclaimerV2.vue +171 -0
- package/src/components/Disclaimer/__tests__/Disclaimer.spec.js +45 -70
- package/src/components/Disclaimer/__tests__/DisclaimerV2.spec.js +68 -0
- package/src/components/Disclaimer/types-v2.ts +12 -0
- package/src/components/Disclaimer/types.ts +3 -12
- package/src/components/Drawer/Drawer.vue +269 -190
- package/src/components/Drawer/__tests__/Drawer.spec.js +46 -37
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
- package/src/components/Input/BaseInput.vue +2 -21
- package/src/components/Input/Input.scss +3 -2
- package/src/components/Input/Input.vue +1 -19
- package/src/components/Input/TextInput.vue +22 -58
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +1 -5
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -7
- package/src/components/ModalDialog/ModalDialog.vue +148 -64
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +221 -11
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
- package/src/components/MultiSelect/MultiSelect.vue +297 -0
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
- package/src/components/Toast/Toast.vue +9 -16
- package/src/components/ToolTip/ToolTip.vue +177 -25
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -339
- package/src/components/index.ts +11 -63
- package/src/components/ui/popover/PopoverContent.vue +2 -19
- package/src/components/ui/popover/PopoverOption.vue +0 -4
- package/src/components/ui/popover/PopoverTrigger.vue +1 -5
- package/src/locales/en.json +1 -3
- package/src/locales/es.json +1 -3
- package/src/locales/pt_br.json +1 -3
- package/src/stories/Disclaimer.stories.js +12 -53
- package/src/stories/DisclaimerV2.stories.js +51 -0
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/ModalDialog.mdx +0 -3
- package/src/stories/ModalDialog.stories.js +1 -1
- package/src/stories/MultiSelect.stories.js +46 -142
- package/dist/components/MultiSelect/MultSelectOption.vue.d.ts +0 -17
- package/dist/components/MultiSelect/MultSelectOption.vue.d.ts.map +0 -1
- package/dist/components/MultiSelect/index.vue.d.ts +0 -44
- package/dist/components/MultiSelect/index.vue.d.ts.map +0 -1
- package/dist/components/Select/index.vue.d.ts +0 -44
- package/dist/components/Select/index.vue.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -23750
- package/dist/components/index.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 -21
- package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -43
- 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/dist/components/ui/drawer/Drawer.vue.d.ts +0 -35
- package/dist/components/ui/drawer/Drawer.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts +0 -21
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -43
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -23
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -22
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -25
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -8
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -23
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts +0 -19
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/index.d.ts +0 -11
- package/dist/components/ui/drawer/index.d.ts.map +0 -1
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +0 -23
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +0 -31
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +0 -19
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/index.d.ts +0 -4
- package/dist/components/ui/tooltip/index.d.ts.map +0 -1
- package/dist/lib/layer-manager.d.ts +0 -16
- package/dist/lib/layer-manager.d.ts.map +0 -1
- package/src/components/MultiSelect/MultSelectOption.vue +0 -49
- package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +0 -556
- package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +0 -229
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +0 -87
- package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +0 -51
- package/src/components/MultiSelect/index.vue +0 -224
- package/src/components/Select/__tests__/Select.spec.js +0 -422
- package/src/components/Select/__tests__/SelectItem.spec.js +0 -330
- package/src/components/Select/__tests__/__snapshots__/Popover.spec.js.snap +0 -8
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +0 -71
- 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/__tests__/__snapshots__/SelectPopover.spec.js.snap +0 -8
- package/src/components/Select/index.vue +0 -297
- package/src/components/ui/dialog/Dialog.vue +0 -19
- package/src/components/ui/dialog/DialogClose.vue +0 -29
- package/src/components/ui/dialog/DialogContent.vue +0 -140
- package/src/components/ui/dialog/DialogFooter.vue +0 -50
- package/src/components/ui/dialog/DialogHeader.vue +0 -83
- package/src/components/ui/dialog/DialogTitle.vue +0 -38
- package/src/components/ui/dialog/DialogTrigger.vue +0 -16
- package/src/components/ui/dialog/index.ts +0 -7
- package/src/components/ui/drawer/Drawer.vue +0 -27
- package/src/components/ui/drawer/DrawerClose.vue +0 -31
- package/src/components/ui/drawer/DrawerContent.vue +0 -111
- package/src/components/ui/drawer/DrawerDescription.vue +0 -40
- package/src/components/ui/drawer/DrawerFooter.vue +0 -38
- package/src/components/ui/drawer/DrawerHeader.vue +0 -57
- package/src/components/ui/drawer/DrawerOverlay.vue +0 -33
- package/src/components/ui/drawer/DrawerTitle.vue +0 -37
- package/src/components/ui/drawer/DrawerTrigger.vue +0 -31
- package/src/components/ui/drawer/index.ts +0 -10
- package/src/components/ui/tooltip/Tooltip.vue +0 -21
- package/src/components/ui/tooltip/TooltipContent.vue +0 -74
- package/src/components/ui/tooltip/TooltipTrigger.vue +0 -26
- package/src/components/ui/tooltip/index.ts +0 -3
- package/src/lib/layer-manager.ts +0 -92
- package/src/stories/Dialog.stories.js +0 -832
- package/src/stories/DrawerNext.stories.js +0 -611
- package/src/stories/LayerManager.docs.mdx +0 -40
- package/src/stories/LayerManager.stories.js +0 -364
- package/src/stories/Select.stories.js +0 -158
|
@@ -1,165 +1,71 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section
|
|
3
|
-
:class="['unnnic-disclaimer', `unnnic-disclaimer--${type}`]"
|
|
4
|
-
data-testid="disclaimer"
|
|
5
|
-
>
|
|
2
|
+
<section class="unnnic-disclaimer">
|
|
6
3
|
<UnnnicIcon
|
|
7
4
|
class="unnnic-disclaimer__icon"
|
|
8
|
-
size="
|
|
9
|
-
:icon="
|
|
10
|
-
:scheme="
|
|
5
|
+
size="avatar-nano"
|
|
6
|
+
:icon="icon"
|
|
7
|
+
:scheme="iconColor"
|
|
11
8
|
data-testid="disclaimer-icon"
|
|
12
9
|
/>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
data-testid="disclaimer-title"
|
|
19
|
-
>
|
|
20
|
-
{{ title }}
|
|
21
|
-
</p>
|
|
22
|
-
<p
|
|
23
|
-
v-if="description"
|
|
24
|
-
class="unnnic-disclaimer__description"
|
|
25
|
-
data-testid="disclaimer-description"
|
|
26
|
-
>
|
|
27
|
-
{{ description }}
|
|
28
|
-
</p>
|
|
29
|
-
</section>
|
|
10
|
+
<p
|
|
11
|
+
class="unnnic-disclaimer__text"
|
|
12
|
+
data-testid="disclaimer-text"
|
|
13
|
+
v-html="text"
|
|
14
|
+
/>
|
|
30
15
|
</section>
|
|
31
16
|
</template>
|
|
32
17
|
|
|
33
18
|
<script setup lang="ts">
|
|
34
|
-
import
|
|
35
|
-
|
|
19
|
+
import icons from '../../utils/iconList';
|
|
20
|
+
import colors from '../../utils/colorsList';
|
|
36
21
|
import UnnnicIcon from '../Icon.vue';
|
|
37
|
-
import type {
|
|
38
|
-
import type { DisclaimerType, DisclaimerProps } from './types';
|
|
22
|
+
import type { DisclaimerProps } from './types';
|
|
39
23
|
|
|
40
24
|
defineOptions({
|
|
41
25
|
name: 'UnnnicDisclaimer',
|
|
42
26
|
});
|
|
43
27
|
|
|
28
|
+
export type { DisclaimerProps };
|
|
29
|
+
|
|
44
30
|
const props = withDefaults(defineProps<DisclaimerProps>(), {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
type: 'informational',
|
|
48
|
-
icon: undefined,
|
|
49
|
-
iconColor: undefined,
|
|
31
|
+
icon: 'alert-circle-1-1',
|
|
32
|
+
iconColor: 'neutral-darkest',
|
|
50
33
|
});
|
|
51
34
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (props.icon) {
|
|
56
|
-
if (props.icon.includes('alert-circle')) return 'attention';
|
|
57
|
-
if (props.icon === 'info') return 'informational';
|
|
58
|
-
if (props.icon === 'error') return 'error';
|
|
59
|
-
return 'neutral';
|
|
60
|
-
}
|
|
35
|
+
const validateIcon = (value: string): boolean => {
|
|
36
|
+
return icons.includes(value);
|
|
37
|
+
};
|
|
61
38
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return 'neutral';
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return props.type;
|
|
69
|
-
});
|
|
39
|
+
const validateIconColor = (value: string): boolean => {
|
|
40
|
+
return colors.includes(value);
|
|
41
|
+
};
|
|
70
42
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{ icon: string; scheme: SchemeColor }
|
|
75
|
-
> = {
|
|
76
|
-
informational: {
|
|
77
|
-
icon: 'info',
|
|
78
|
-
scheme: 'blue-500',
|
|
79
|
-
},
|
|
80
|
-
success: {
|
|
81
|
-
icon: 'check_circle',
|
|
82
|
-
scheme: 'green-500',
|
|
83
|
-
},
|
|
84
|
-
attention: {
|
|
85
|
-
icon: 'error',
|
|
86
|
-
scheme: 'yellow-500',
|
|
87
|
-
},
|
|
88
|
-
error: {
|
|
89
|
-
icon: 'cancel',
|
|
90
|
-
scheme: 'red-500',
|
|
91
|
-
},
|
|
92
|
-
neutral: {
|
|
93
|
-
icon: 'info',
|
|
94
|
-
scheme: 'gray-400',
|
|
95
|
-
},
|
|
96
|
-
};
|
|
43
|
+
if (!validateIcon(props.icon as string)) {
|
|
44
|
+
console.warn(`Invalid icon prop: ${props.icon}`);
|
|
45
|
+
}
|
|
97
46
|
|
|
98
|
-
|
|
99
|
-
});
|
|
47
|
+
if (!validateIconColor(props.iconColor as string)) {
|
|
48
|
+
console.warn(`Invalid iconColor prop: ${props.iconColor}`);
|
|
49
|
+
}
|
|
100
50
|
</script>
|
|
101
51
|
|
|
102
|
-
<style
|
|
52
|
+
<style lang="scss" scoped>
|
|
103
53
|
@use '@/assets/scss/unnnic' as *;
|
|
104
|
-
|
|
105
54
|
.unnnic-disclaimer {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
box-sizing: border-box;
|
|
115
|
-
|
|
116
|
-
border: $border-width solid $unnnic-color-border-base;
|
|
117
|
-
border-radius: $unnnic-radius-2;
|
|
118
|
-
|
|
119
|
-
background-color: $unnnic-color-bg-soft;
|
|
120
|
-
|
|
121
|
-
color: $unnnic-color-fg-emphasized;
|
|
122
|
-
|
|
123
|
-
&__content {
|
|
124
|
-
display: flex;
|
|
125
|
-
flex-direction: column;
|
|
126
|
-
justify-content: center;
|
|
127
|
-
gap: $unnnic-space-1;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
&__title {
|
|
131
|
-
margin: 0;
|
|
132
|
-
font: $unnnic-font-action;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&__description {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: $unnnic-spacing-xs;
|
|
58
|
+
padding: $unnnic-spacing-sm;
|
|
59
|
+
border-radius: $unnnic-border-radius-sm;
|
|
60
|
+
border: 1px solid $unnnic-color-neutral-soft;
|
|
61
|
+
background: $unnnic-color-background-lightest;
|
|
62
|
+
.unnnic-disclaimer__text {
|
|
136
63
|
margin: 0;
|
|
137
|
-
font: $unnnic-font-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
border-color: $unnnic-color-border-info;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
&--success {
|
|
146
|
-
background-color: $unnnic-color-bg-success;
|
|
147
|
-
border-color: $unnnic-color-border-success;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
&--attention {
|
|
151
|
-
background-color: $unnnic-color-bg-warning;
|
|
152
|
-
border-color: $unnnic-color-border-warning;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
&--error {
|
|
156
|
-
background-color: $unnnic-color-bg-critical;
|
|
157
|
-
border-color: $unnnic-color-border-critical;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
&--neutral {
|
|
161
|
-
background-color: $unnnic-color-bg-soft;
|
|
162
|
-
border-color: $unnnic-color-border-base;
|
|
64
|
+
font-family: $unnnic-font-family-secondary;
|
|
65
|
+
font-size: $unnnic-font-size-body-gt;
|
|
66
|
+
line-height: $unnnic-line-height-large * 1.375;
|
|
67
|
+
font-weight: $unnnic-font-weight-regular;
|
|
68
|
+
color: $unnnic-color-neutral-dark;
|
|
163
69
|
}
|
|
164
70
|
}
|
|
165
71
|
</style>
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
class="unnnic-disclaimerv2"
|
|
4
|
+
:class="[
|
|
5
|
+
`type-${type}`,
|
|
6
|
+
{ 'unnnic-disclaimerv2-align-center': alignCenter },
|
|
7
|
+
]"
|
|
8
|
+
data-testid="disclaimerv2"
|
|
9
|
+
>
|
|
10
|
+
<section class="unnnic-disclaimerv2__icon-container">
|
|
11
|
+
<UnnnicIcon
|
|
12
|
+
class="unnnic-disclaimerv2__icon"
|
|
13
|
+
size="sm"
|
|
14
|
+
:icon="variant.icon"
|
|
15
|
+
:scheme="variant.scheme"
|
|
16
|
+
data-testid="disclaimerv2-icon"
|
|
17
|
+
/>
|
|
18
|
+
</section>
|
|
19
|
+
|
|
20
|
+
<section class="unnnic-disclaimerv2__content">
|
|
21
|
+
<p
|
|
22
|
+
v-if="title"
|
|
23
|
+
class="unnnic-disclaimerv2__title"
|
|
24
|
+
data-testid="disclaimerv2-title"
|
|
25
|
+
>
|
|
26
|
+
{{ title }}
|
|
27
|
+
</p>
|
|
28
|
+
<p
|
|
29
|
+
v-if="description"
|
|
30
|
+
class="unnnic-disclaimerv2__description"
|
|
31
|
+
data-testid="disclaimerv2-description"
|
|
32
|
+
>
|
|
33
|
+
{{ description }}
|
|
34
|
+
</p>
|
|
35
|
+
</section>
|
|
36
|
+
</section>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script setup lang="ts">
|
|
40
|
+
import { computed } from 'vue';
|
|
41
|
+
|
|
42
|
+
import UnnnicIcon from '../Icon.vue';
|
|
43
|
+
import type { SchemeColor } from '@/types/scheme-colors';
|
|
44
|
+
import type { DisclaimerTypeV2, DisclaimerV2Props } from './types-v2';
|
|
45
|
+
|
|
46
|
+
defineOptions({
|
|
47
|
+
name: 'UnnnicDisclaimerV2',
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const props = withDefaults(defineProps<DisclaimerV2Props>(), {
|
|
51
|
+
title: 'Disclaimer',
|
|
52
|
+
description: 'The quick brown fox jumps over the lazy dog',
|
|
53
|
+
type: 'informational',
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const hasTitle = computed(() => Boolean(props.title));
|
|
57
|
+
const hasDescription = computed(() => Boolean(props.description));
|
|
58
|
+
const alignCenter = computed(() =>
|
|
59
|
+
Boolean(!hasTitle.value && hasDescription.value),
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const variant = computed(() => {
|
|
63
|
+
const variants: Record<
|
|
64
|
+
DisclaimerTypeV2,
|
|
65
|
+
{ icon: string; scheme: SchemeColor }
|
|
66
|
+
> = {
|
|
67
|
+
informational: {
|
|
68
|
+
icon: 'information-circle-4',
|
|
69
|
+
scheme: 'blue-500',
|
|
70
|
+
},
|
|
71
|
+
success: {
|
|
72
|
+
icon: 'check-circle-1-1',
|
|
73
|
+
scheme: 'green-500',
|
|
74
|
+
},
|
|
75
|
+
attention: {
|
|
76
|
+
icon: 'alert-circle-1-1',
|
|
77
|
+
scheme: 'yellow-500',
|
|
78
|
+
},
|
|
79
|
+
error: {
|
|
80
|
+
icon: 'alert-circle-1',
|
|
81
|
+
scheme: 'red-500',
|
|
82
|
+
},
|
|
83
|
+
neutral: {
|
|
84
|
+
icon: 'information-circle-4',
|
|
85
|
+
scheme: 'gray-400',
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return variants[props.type];
|
|
90
|
+
});
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style scoped lang="scss">
|
|
94
|
+
@use '@/assets/scss/unnnic' as *;
|
|
95
|
+
|
|
96
|
+
.unnnic-disclaimerv2 {
|
|
97
|
+
display: flex;
|
|
98
|
+
gap: $unnnic-space-2;
|
|
99
|
+
|
|
100
|
+
&-align-center {
|
|
101
|
+
align-items: center;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
width: 100%;
|
|
105
|
+
padding: $unnnic-space-4;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
|
|
108
|
+
border: 1px solid $unnnic-color-border-base;
|
|
109
|
+
border-radius: $unnnic-radius-2;
|
|
110
|
+
|
|
111
|
+
background-color: $unnnic-color-bg-soft;
|
|
112
|
+
|
|
113
|
+
color: $unnnic-color-fg-emphasized;
|
|
114
|
+
|
|
115
|
+
&__icon-container {
|
|
116
|
+
display: flex;
|
|
117
|
+
padding: 3px $unnnic-space-05;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
align-items: flex-start;
|
|
120
|
+
flex-shrink: 0;
|
|
121
|
+
align-self: stretch;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&__icon {
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&__content {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
gap: $unnnic-space-1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&__title {
|
|
135
|
+
margin: 0;
|
|
136
|
+
font: $unnnic-font-action;
|
|
137
|
+
color: $unnnic-color-fg-emphasized;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&__description {
|
|
141
|
+
margin: 0;
|
|
142
|
+
font: $unnnic-font-caption-2;
|
|
143
|
+
color: $unnnic-color-fg-emphasized;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&.type-informational {
|
|
147
|
+
background-color: $unnnic-color-bg-info;
|
|
148
|
+
border-color: $unnnic-color-border-info;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.type-success {
|
|
152
|
+
background-color: $unnnic-color-bg-success;
|
|
153
|
+
border-color: $unnnic-color-border-success;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.type-attention {
|
|
157
|
+
background-color: $unnnic-color-bg-warning;
|
|
158
|
+
border-color: $unnnic-color-border-warning;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&.type-error {
|
|
162
|
+
background-color: $unnnic-color-bg-critical;
|
|
163
|
+
border-color: $unnnic-color-border-critical;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&.type-neutral {
|
|
167
|
+
background-color: $unnnic-color-bg-soft;
|
|
168
|
+
border-color: $unnnic-color-border-base;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
</style>
|
|
@@ -1,97 +1,72 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
3
3
|
|
|
4
4
|
import Disclaimer from '../Disclaimer.vue';
|
|
5
5
|
import Icon from '../../Icon.vue';
|
|
6
6
|
|
|
7
|
-
const mountComponent = (props = {}) =>
|
|
8
|
-
mount(Disclaimer, {
|
|
9
|
-
props,
|
|
10
|
-
global: {
|
|
11
|
-
components: { UnnnicIcon: Icon },
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
7
|
describe('Disclaimer', () => {
|
|
16
|
-
|
|
17
|
-
const wrapper = mountComponent();
|
|
8
|
+
let wrapper;
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
wrapper = mount(Disclaimer, {
|
|
12
|
+
props: { text: 'Test Disclaimer Text' },
|
|
13
|
+
global: { components: { UnnnicIcon: Icon } },
|
|
14
|
+
});
|
|
25
15
|
});
|
|
26
16
|
|
|
27
|
-
it('
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
expect(wrapper.find('[data-testid="disclaimer-title"]').exists()).toBe(
|
|
31
|
-
false,
|
|
17
|
+
it('renders the text prop correctly', () => {
|
|
18
|
+
expect(wrapper.find('[data-testid="disclaimer-text"]').text()).toBe(
|
|
19
|
+
'Test Disclaimer Text',
|
|
32
20
|
);
|
|
33
21
|
});
|
|
34
22
|
|
|
35
|
-
it('
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
expect(
|
|
39
|
-
wrapper.find('[data-testid="disclaimer-description"]').exists(),
|
|
40
|
-
).toBe(false);
|
|
41
|
-
});
|
|
23
|
+
it('renders the UnnnicIcon component with correct icon and color', async () => {
|
|
24
|
+
const icon = 'alert-circle-1-1';
|
|
25
|
+
const iconColor = 'neutral-darkest';
|
|
42
26
|
|
|
43
|
-
|
|
44
|
-
['informational', 'info', 'blue-500'],
|
|
45
|
-
['success', 'check_circle', 'green-500'],
|
|
46
|
-
['attention', 'error', 'yellow-500'],
|
|
47
|
-
['error', 'cancel', 'red-500'],
|
|
48
|
-
['neutral', 'info', 'gray-400'],
|
|
49
|
-
])('applies variant %s styles', (type, icon, scheme) => {
|
|
50
|
-
const wrapper = mountComponent({ type });
|
|
51
|
-
|
|
52
|
-
expect(wrapper.classes()).toContain(`unnnic-disclaimer--${type}`);
|
|
27
|
+
await wrapper.setProps({ icon, iconColor });
|
|
53
28
|
|
|
54
29
|
const iconComponent = wrapper.findComponent(
|
|
55
30
|
'[data-testid="disclaimer-icon"]',
|
|
56
31
|
);
|
|
57
|
-
|
|
32
|
+
expect(iconComponent.exists()).toBe(true);
|
|
58
33
|
expect(iconComponent.props('icon')).toBe(icon);
|
|
59
|
-
expect(iconComponent.props('scheme')).toBe(
|
|
34
|
+
expect(iconComponent.props('scheme')).toBe(iconColor);
|
|
60
35
|
});
|
|
61
36
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
[
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const wrapper = mountComponent({ icon });
|
|
70
|
-
|
|
71
|
-
const iconComponent = wrapper.findComponent(
|
|
72
|
-
'[data-testid="disclaimer-icon"]',
|
|
73
|
-
);
|
|
37
|
+
it('renders with default icon and color if not provided', () => {
|
|
38
|
+
const iconComponent = wrapper.findComponent(
|
|
39
|
+
'[data-testid="disclaimer-icon"]',
|
|
40
|
+
);
|
|
41
|
+
expect(iconComponent.props('icon')).toBe('alert-circle-1-1');
|
|
42
|
+
expect(iconComponent.props('scheme')).toBe('neutral-darkest');
|
|
43
|
+
});
|
|
74
44
|
|
|
75
|
-
|
|
76
|
-
|
|
45
|
+
it('validates the icon prop correctly', () => {
|
|
46
|
+
const wrapperValid = mount(Disclaimer, {
|
|
47
|
+
props: { text: 'Test', icon: 'alert-circle-1-1' },
|
|
48
|
+
global: { components: { UnnnicIcon: Icon } },
|
|
77
49
|
});
|
|
50
|
+
expect(wrapperValid.exists()).toBe(true);
|
|
78
51
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(iconColor, expectedIcon, scheme) => {
|
|
86
|
-
const wrapper = mountComponent({ iconColor });
|
|
52
|
+
const wrapperInvalid = mount(Disclaimer, {
|
|
53
|
+
props: { text: 'Test', icon: 'invalid-icon' },
|
|
54
|
+
global: { components: { UnnnicIcon: Icon } },
|
|
55
|
+
});
|
|
56
|
+
expect(wrapperInvalid.exists()).toBe(true);
|
|
57
|
+
});
|
|
87
58
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
59
|
+
it('validates the iconColor prop correctly', () => {
|
|
60
|
+
const wrapperValid = mount(Disclaimer, {
|
|
61
|
+
props: { text: 'Test', iconColor: 'neutral-darkest' },
|
|
62
|
+
global: { components: { UnnnicIcon: Icon } },
|
|
63
|
+
});
|
|
64
|
+
expect(wrapperValid.exists()).toBe(true);
|
|
91
65
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
);
|
|
66
|
+
const wrapperInvalid = mount(Disclaimer, {
|
|
67
|
+
props: { text: 'Test', iconColor: 'invalid-color' },
|
|
68
|
+
global: { components: { UnnnicIcon: Icon } },
|
|
69
|
+
});
|
|
70
|
+
expect(wrapperInvalid.exists()).toBe(true);
|
|
96
71
|
});
|
|
97
72
|
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import DisclaimerV2 from '../DisclaimerV2.vue';
|
|
5
|
+
import Icon from '../../Icon.vue';
|
|
6
|
+
|
|
7
|
+
const mountComponent = (props = {}) =>
|
|
8
|
+
mount(DisclaimerV2, {
|
|
9
|
+
props,
|
|
10
|
+
global: {
|
|
11
|
+
components: { UnnnicIcon: Icon },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('DisclaimerV2', () => {
|
|
16
|
+
it('renders default title and description', () => {
|
|
17
|
+
const wrapper = mountComponent();
|
|
18
|
+
|
|
19
|
+
expect(wrapper.find('[data-testid="disclaimerv2-title"]').text()).toBe(
|
|
20
|
+
'Disclaimer',
|
|
21
|
+
);
|
|
22
|
+
expect(
|
|
23
|
+
wrapper.find('[data-testid="disclaimerv2-description"]').text(),
|
|
24
|
+
).toBe('The quick brown fox jumps over the lazy dog');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('hides title when no title is provided', () => {
|
|
28
|
+
const wrapper = mountComponent({ title: '' });
|
|
29
|
+
|
|
30
|
+
expect(wrapper.find('[data-testid="disclaimerv2-title"]').exists()).toBe(
|
|
31
|
+
false,
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('hides description when no description is provided', () => {
|
|
36
|
+
const wrapper = mountComponent({ description: '' });
|
|
37
|
+
|
|
38
|
+
expect(
|
|
39
|
+
wrapper.find('[data-testid="disclaimerv2-description"]').exists(),
|
|
40
|
+
).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('aligns center when only one description text line is present', () => {
|
|
44
|
+
const onlyDescription = mountComponent({ title: '' });
|
|
45
|
+
expect(onlyDescription.classes()).toContain(
|
|
46
|
+
'unnnic-disclaimerv2-align-center',
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it.each([
|
|
51
|
+
['informational', 'information-circle-4', 'blue-500'],
|
|
52
|
+
['success', 'check-circle-1-1', 'green-500'],
|
|
53
|
+
['attention', 'alert-circle-1-1', 'yellow-500'],
|
|
54
|
+
['error', 'alert-circle-1', 'red-500'],
|
|
55
|
+
['neutral', 'information-circle-4', 'gray-400'],
|
|
56
|
+
])('applies variant %s styles', (type, icon, scheme) => {
|
|
57
|
+
const wrapper = mountComponent({ type });
|
|
58
|
+
|
|
59
|
+
expect(wrapper.classes()).toContain(`type-${type}`);
|
|
60
|
+
|
|
61
|
+
const iconComponent = wrapper.findComponent(
|
|
62
|
+
'[data-testid="disclaimerv2-icon"]',
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect(iconComponent.props('icon')).toBe(icon);
|
|
66
|
+
expect(iconComponent.props('scheme')).toBe(scheme);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import type { SchemeColor } from '@/types/scheme-colors';
|
|
2
2
|
|
|
3
|
-
export type DisclaimerType =
|
|
4
|
-
| 'informational'
|
|
5
|
-
| 'success'
|
|
6
|
-
| 'attention'
|
|
7
|
-
| 'error'
|
|
8
|
-
| 'neutral';
|
|
9
|
-
|
|
10
3
|
export interface DisclaimerProps {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
icon?: string | undefined;
|
|
15
|
-
iconColor?: SchemeColor | undefined;
|
|
4
|
+
text: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
iconColor?: SchemeColor;
|
|
16
7
|
}
|