@weni/unnnic-system 3.12.3-alpha.5 → 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.
Files changed (238) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/components/Alert/Alert.vue.d.ts +3 -3
  3. package/dist/components/Alert/Version1dot1.vue.d.ts +1 -1
  4. package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +18 -92
  5. package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +36 -184
  6. package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +1 -1
  7. package/dist/components/Button/Button.vue.d.ts +2 -2
  8. package/dist/components/Card/AccountCard.vue.d.ts +2 -2
  9. package/dist/components/Card/Card.vue.d.ts +29 -103
  10. package/dist/components/Card/CardCompany.vue.d.ts +2 -2
  11. package/dist/components/Card/CardStatusesContainer.vue.d.ts +19 -93
  12. package/dist/components/Card/ContentCard.vue.d.ts +1 -1
  13. package/dist/components/Card/DashCard.vue.d.ts +2 -2
  14. package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
  15. package/dist/components/Card/MarketplaceCard.vue.d.ts +1 -1
  16. package/dist/components/Card/SimpleCard.vue.d.ts +18 -92
  17. package/dist/components/Card/StatusCard.vue.d.ts +1 -1
  18. package/dist/components/Card/TitleCard.vue.d.ts +18 -92
  19. package/dist/components/CardImage/CardImage.vue.d.ts +5 -5
  20. package/dist/components/CardInformation/CardInformation.vue.d.ts +19 -93
  21. package/dist/components/CardProject/CardProject.vue.d.ts +2 -2
  22. package/dist/components/Carousel/Carousel.vue.d.ts +2 -2
  23. package/dist/components/Carousel/TagCarousel.vue.d.ts +2 -2
  24. package/dist/components/ChartBar/ChartBar.vue.d.ts +24 -98
  25. package/dist/components/ChartLine/ChartLine.vue.d.ts +18 -92
  26. package/dist/components/ChatText/ChatText.vue.d.ts +18 -92
  27. package/dist/components/ChatsContact/ChatsContact.vue.d.ts +6 -6
  28. package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +18 -92
  29. package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +1 -1
  30. package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
  31. package/dist/components/DataArea/DataArea.vue.d.ts +18 -92
  32. package/dist/components/DataTable/index.vue.d.ts +1 -1
  33. package/dist/components/DataTable/index.vue.d.ts.map +1 -1
  34. package/dist/components/DateFilter/DateFilter.vue.d.ts +16 -122
  35. package/dist/components/Disclaimer/Disclaimer.vue.d.ts +3 -6
  36. package/dist/components/Disclaimer/Disclaimer.vue.d.ts.map +1 -1
  37. package/dist/components/Disclaimer/DisclaimerV2.vue.d.ts +8 -0
  38. package/dist/components/Disclaimer/DisclaimerV2.vue.d.ts.map +1 -0
  39. package/dist/components/Disclaimer/types-v2.d.ts +7 -0
  40. package/dist/components/Disclaimer/types-v2.d.ts.map +1 -0
  41. package/dist/components/Disclaimer/types.d.ts +3 -6
  42. package/dist/components/Disclaimer/types.d.ts.map +1 -1
  43. package/dist/components/Drawer/Drawer.vue.d.ts +207 -37
  44. package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
  45. package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
  46. package/dist/components/FormElement/FormElement.vue.d.ts +6 -6
  47. package/dist/components/ImportCard/ImportCard.vue.d.ts +6 -6
  48. package/dist/components/Input/BaseInput.vue.d.ts +0 -31
  49. package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
  50. package/dist/components/Input/Input.vue.d.ts +15 -121
  51. package/dist/components/Input/Input.vue.d.ts.map +1 -1
  52. package/dist/components/Input/TextInput.vue.d.ts +4 -73
  53. package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
  54. package/dist/components/InputNext/InputNext.vue.d.ts +4 -4
  55. package/dist/components/Label/Label.vue.d.ts +1 -1
  56. package/dist/components/Label/Label.vue.d.ts.map +1 -1
  57. package/dist/components/Modal/Modal.vue.d.ts +1 -1
  58. package/dist/components/ModalDialog/ModalDialog.vue.d.ts +35 -209
  59. package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
  60. package/dist/components/ModalNext/ModalNext.vue.d.ts +21 -127
  61. package/dist/components/ModalUpload/ModalUpload.vue.d.ts +12 -12
  62. package/dist/components/MoodRating/MoodRating.vue.d.ts +18 -92
  63. package/dist/components/MultiSelect/MultiSelect.vue.d.ts +163 -0
  64. package/dist/components/MultiSelect/MultiSelect.vue.d.ts.map +1 -0
  65. package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
  66. package/dist/components/Radio/Radio.vue.d.ts +6 -6
  67. package/dist/components/SelectSmart/SelectSmart.vue.d.ts +13 -82
  68. package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +2 -2
  69. package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +5 -5
  70. package/dist/components/SelectTime/index.vue.d.ts +5 -74
  71. package/dist/components/Slider/Slider.vue.d.ts +18 -92
  72. package/dist/components/Switch/Switch.vue.d.ts +3 -3
  73. package/dist/components/Tab/Tab.vue.d.ts +18 -92
  74. package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
  75. package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
  76. package/dist/components/Tag/DefaultTag.vue.d.ts +1 -1
  77. package/dist/components/Tag/Tag.vue.d.ts +2 -2
  78. package/dist/components/TextArea/TextArea.vue.d.ts +8 -8
  79. package/dist/components/Toast/Toast.vue.d.ts +1 -1
  80. package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
  81. package/dist/components/ToolTip/ToolTip.vue.d.ts +18 -92
  82. package/dist/components/ToolTip/ToolTip.vue.d.ts.map +1 -1
  83. package/dist/components/Tour/Tour.vue.d.ts +6 -6
  84. package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
  85. package/dist/components/UploadArea/UploadArea.vue.d.ts +6 -6
  86. package/dist/components/ui/popover/PopoverContent.vue.d.ts +2 -2
  87. package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
  88. package/dist/components/ui/popover/PopoverOption.vue.d.ts +1 -1
  89. package/dist/components/ui/popover/PopoverOption.vue.d.ts.map +1 -1
  90. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts.map +1 -1
  91. package/dist/{es-a9e51a05.mjs → es-c19444c0.mjs} +1 -1
  92. package/dist/{index-ade761d4.mjs → index-93b45359.mjs} +51889 -54741
  93. package/dist/locales/en.json.d.ts +1 -3
  94. package/dist/locales/es.json.d.ts +1 -3
  95. package/dist/locales/pt_br.json.d.ts +1 -3
  96. package/dist/{pt-br-5395459d.mjs → pt-br-23dc9ca6.mjs} +1 -1
  97. package/dist/style.css +1 -1
  98. package/dist/unnnic.mjs +206 -234
  99. package/dist/unnnic.umd.js +44 -48
  100. package/package.json +2 -3
  101. package/src/assets/scss/scheme-colors.scss +223 -223
  102. package/src/assets/scss/tailwind.scss +0 -8
  103. package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
  104. package/src/components/Checkbox/Checkbox.vue +1 -1
  105. package/src/components/Disclaimer/Disclaimer.vue +42 -136
  106. package/src/components/Disclaimer/DisclaimerV2.vue +171 -0
  107. package/src/components/Disclaimer/__tests__/Disclaimer.spec.js +45 -70
  108. package/src/components/Disclaimer/__tests__/DisclaimerV2.spec.js +68 -0
  109. package/src/components/Disclaimer/types-v2.ts +12 -0
  110. package/src/components/Disclaimer/types.ts +3 -12
  111. package/src/components/Drawer/Drawer.vue +269 -190
  112. package/src/components/Drawer/__tests__/Drawer.spec.js +46 -37
  113. package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
  114. package/src/components/Input/BaseInput.vue +5 -25
  115. package/src/components/Input/Input.scss +3 -2
  116. package/src/components/Input/Input.vue +1 -24
  117. package/src/components/Input/TextInput.vue +25 -64
  118. package/src/components/Input/__test__/TextInput.spec.js +1 -1
  119. package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +1 -5
  120. package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -7
  121. package/src/components/ModalDialog/ModalDialog.vue +148 -64
  122. package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +221 -11
  123. package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
  124. package/src/components/MultiSelect/MultiSelect.vue +297 -0
  125. package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
  126. package/src/components/Toast/Toast.vue +9 -16
  127. package/src/components/ToolTip/ToolTip.vue +177 -25
  128. package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -339
  129. package/src/components/index.ts +11 -63
  130. package/src/components/ui/popover/PopoverContent.vue +2 -19
  131. package/src/components/ui/popover/PopoverOption.vue +0 -4
  132. package/src/components/ui/popover/PopoverTrigger.vue +1 -5
  133. package/src/locales/en.json +1 -3
  134. package/src/locales/es.json +1 -3
  135. package/src/locales/pt_br.json +1 -3
  136. package/src/stories/Disclaimer.stories.js +12 -53
  137. package/src/stories/DisclaimerV2.stories.js +51 -0
  138. package/src/stories/Drawer.stories.js +1 -1
  139. package/src/stories/Input.mdx +0 -3
  140. package/src/stories/ModalDialog.mdx +0 -3
  141. package/src/stories/ModalDialog.stories.js +1 -1
  142. package/src/stories/MultiSelect.stories.js +46 -142
  143. package/dist/components/MultiSelect/MultSelectOption.vue.d.ts +0 -17
  144. package/dist/components/MultiSelect/MultSelectOption.vue.d.ts.map +0 -1
  145. package/dist/components/MultiSelect/index.vue.d.ts +0 -44
  146. package/dist/components/MultiSelect/index.vue.d.ts.map +0 -1
  147. package/dist/components/Select/index.vue.d.ts +0 -44
  148. package/dist/components/Select/index.vue.d.ts.map +0 -1
  149. package/dist/components/index.d.ts +0 -23912
  150. package/dist/components/index.d.ts.map +0 -1
  151. package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -23
  152. package/dist/components/ui/dialog/Dialog.vue.d.ts.map +0 -1
  153. package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -21
  154. package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +0 -1
  155. package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -43
  156. package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +0 -1
  157. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -25
  158. package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +0 -1
  159. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -29
  160. package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +0 -1
  161. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -23
  162. package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +0 -1
  163. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -19
  164. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +0 -1
  165. package/dist/components/ui/dialog/index.d.ts +0 -8
  166. package/dist/components/ui/dialog/index.d.ts.map +0 -1
  167. package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -35
  168. package/dist/components/ui/drawer/Drawer.vue.d.ts.map +0 -1
  169. package/dist/components/ui/drawer/DrawerClose.vue.d.ts +0 -21
  170. package/dist/components/ui/drawer/DrawerClose.vue.d.ts.map +0 -1
  171. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -43
  172. package/dist/components/ui/drawer/DrawerContent.vue.d.ts.map +0 -1
  173. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -23
  174. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts.map +0 -1
  175. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -22
  176. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts.map +0 -1
  177. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -25
  178. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts.map +0 -1
  179. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -8
  180. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts.map +0 -1
  181. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -23
  182. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts.map +0 -1
  183. package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts +0 -19
  184. package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts.map +0 -1
  185. package/dist/components/ui/drawer/index.d.ts +0 -11
  186. package/dist/components/ui/drawer/index.d.ts.map +0 -1
  187. package/dist/components/ui/tooltip/Tooltip.vue.d.ts +0 -23
  188. package/dist/components/ui/tooltip/Tooltip.vue.d.ts.map +0 -1
  189. package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +0 -31
  190. package/dist/components/ui/tooltip/TooltipContent.vue.d.ts.map +0 -1
  191. package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +0 -19
  192. package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts.map +0 -1
  193. package/dist/components/ui/tooltip/index.d.ts +0 -4
  194. package/dist/components/ui/tooltip/index.d.ts.map +0 -1
  195. package/dist/lib/layer-manager.d.ts +0 -16
  196. package/dist/lib/layer-manager.d.ts.map +0 -1
  197. package/src/components/MultiSelect/MultSelectOption.vue +0 -49
  198. package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +0 -556
  199. package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +0 -229
  200. package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +0 -87
  201. package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +0 -51
  202. package/src/components/MultiSelect/index.vue +0 -225
  203. package/src/components/Select/__tests__/Select.spec.js +0 -422
  204. package/src/components/Select/__tests__/SelectItem.spec.js +0 -330
  205. package/src/components/Select/__tests__/__snapshots__/Popover.spec.js.snap +0 -8
  206. package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +0 -71
  207. package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +0 -15
  208. package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +0 -25
  209. package/src/components/Select/__tests__/__snapshots__/SelectPopover.spec.js.snap +0 -8
  210. package/src/components/Select/index.vue +0 -298
  211. package/src/components/ui/dialog/Dialog.vue +0 -19
  212. package/src/components/ui/dialog/DialogClose.vue +0 -29
  213. package/src/components/ui/dialog/DialogContent.vue +0 -140
  214. package/src/components/ui/dialog/DialogFooter.vue +0 -50
  215. package/src/components/ui/dialog/DialogHeader.vue +0 -83
  216. package/src/components/ui/dialog/DialogTitle.vue +0 -38
  217. package/src/components/ui/dialog/DialogTrigger.vue +0 -16
  218. package/src/components/ui/dialog/index.ts +0 -7
  219. package/src/components/ui/drawer/Drawer.vue +0 -27
  220. package/src/components/ui/drawer/DrawerClose.vue +0 -31
  221. package/src/components/ui/drawer/DrawerContent.vue +0 -111
  222. package/src/components/ui/drawer/DrawerDescription.vue +0 -40
  223. package/src/components/ui/drawer/DrawerFooter.vue +0 -38
  224. package/src/components/ui/drawer/DrawerHeader.vue +0 -57
  225. package/src/components/ui/drawer/DrawerOverlay.vue +0 -33
  226. package/src/components/ui/drawer/DrawerTitle.vue +0 -37
  227. package/src/components/ui/drawer/DrawerTrigger.vue +0 -31
  228. package/src/components/ui/drawer/index.ts +0 -10
  229. package/src/components/ui/tooltip/Tooltip.vue +0 -21
  230. package/src/components/ui/tooltip/TooltipContent.vue +0 -74
  231. package/src/components/ui/tooltip/TooltipTrigger.vue +0 -26
  232. package/src/components/ui/tooltip/index.ts +0 -3
  233. package/src/lib/layer-manager.ts +0 -92
  234. package/src/stories/Dialog.stories.js +0 -832
  235. package/src/stories/DrawerNext.stories.js +0 -611
  236. package/src/stories/LayerManager.docs.mdx +0 -40
  237. package/src/stories/LayerManager.stories.js +0 -364
  238. 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="ant"
9
- :icon="variant.icon"
10
- :scheme="variant.scheme"
5
+ size="avatar-nano"
6
+ :icon="icon"
7
+ :scheme="iconColor"
11
8
  data-testid="disclaimer-icon"
12
9
  />
13
-
14
- <section class="unnnic-disclaimer__content">
15
- <p
16
- v-if="title"
17
- class="unnnic-disclaimer__title"
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 { computed } from 'vue';
35
-
19
+ import icons from '../../utils/iconList';
20
+ import colors from '../../utils/colorsList';
36
21
  import UnnnicIcon from '../Icon.vue';
37
- import type { SchemeColor } from '@/types/scheme-colors';
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
- title: 'Disclaimer',
46
- description: 'The quick brown fox jumps over the lazy dog',
47
- type: 'informational',
48
- icon: undefined,
49
- iconColor: undefined,
31
+ icon: 'alert-circle-1-1',
32
+ iconColor: 'neutral-darkest',
50
33
  });
51
34
 
52
- // This is a temporary solution to ensure backwards compatibility with the older version of the component.
53
- // TODO: It should be removed once the older version is discontinued.
54
- const variantCompatibleWithOlderVersion = computed((): DisclaimerType => {
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
- if (props.iconColor) {
63
- if (props.iconColor.includes('yellow')) return 'attention';
64
- if (props.iconColor.includes('red')) return 'error';
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
- const variant = computed(() => {
72
- const variants: Record<
73
- DisclaimerType,
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
- return variants[variantCompatibleWithOlderVersion.value || props.type];
99
- });
47
+ if (!validateIconColor(props.iconColor as string)) {
48
+ console.warn(`Invalid iconColor prop: ${props.iconColor}`);
49
+ }
100
50
  </script>
101
51
 
102
- <style scoped lang="scss">
52
+ <style lang="scss" scoped>
103
53
  @use '@/assets/scss/unnnic' as *;
104
-
105
54
  .unnnic-disclaimer {
106
- $border-width: 1px;
107
-
108
- display: flex;
109
- gap: $unnnic-space-2;
110
-
111
- width: 100%;
112
- min-height: 53px;
113
- padding: calc($unnnic-space-4 - $border-width) $unnnic-space-4;
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-caption-2;
138
- }
139
-
140
- &--informational {
141
- background-color: $unnnic-color-bg-info;
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
- it('renders default title and description', () => {
17
- const wrapper = mountComponent();
8
+ let wrapper;
18
9
 
19
- expect(wrapper.find('[data-testid="disclaimer-title"]').text()).toBe(
20
- 'Disclaimer',
21
- );
22
- expect(wrapper.find('[data-testid="disclaimer-description"]').text()).toBe(
23
- 'The quick brown fox jumps over the lazy dog',
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('hides title when no title is provided', () => {
28
- const wrapper = mountComponent({ title: '' });
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('hides description when no description is provided', () => {
36
- const wrapper = mountComponent({ description: '' });
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
- it.each([
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(scheme);
34
+ expect(iconComponent.props('scheme')).toBe(iconColor);
60
35
  });
61
36
 
62
- describe('legacy compatibility', () => {
63
- it.each([
64
- ['alert-circle-1-1', 'error', 'yellow-500'],
65
- ['info', 'info', 'blue-500'],
66
- ['error', 'cancel', 'red-500'],
67
- ['custom-icon', 'info', 'gray-400'],
68
- ])('maps icon prop "%s" to variant', (icon, expectedIcon, scheme) => {
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
- expect(iconComponent.props('icon')).toBe(expectedIcon);
76
- expect(iconComponent.props('scheme')).toBe(scheme);
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
- it.each([
80
- ['feedback-yellow', 'error', 'yellow-500'],
81
- ['feedback-red', 'cancel', 'red-500'],
82
- ['feedback-blue', 'info', 'gray-400'],
83
- ])(
84
- 'maps iconColor prop "%s" to variant',
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
- const iconComponent = wrapper.findComponent(
89
- '[data-testid="disclaimer-icon"]',
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
- expect(iconComponent.props('icon')).toBe(expectedIcon);
93
- expect(iconComponent.props('scheme')).toBe(scheme);
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
+ });
@@ -0,0 +1,12 @@
1
+ export type DisclaimerTypeV2 =
2
+ | 'informational'
3
+ | 'success'
4
+ | 'attention'
5
+ | 'error'
6
+ | 'neutral';
7
+
8
+ export interface DisclaimerV2Props {
9
+ title?: string;
10
+ description?: string;
11
+ type?: DisclaimerTypeV2;
12
+ }
@@ -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
- title?: string;
12
- description?: string;
13
- type?: DisclaimerType;
14
- icon?: string | undefined;
15
- iconColor?: SchemeColor | undefined;
4
+ text: string;
5
+ icon?: string;
6
+ iconColor?: SchemeColor;
16
7
  }