@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.
Files changed (236) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/dist/assets/tokens/colors.json.d.ts +376 -0
  3. package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
  4. package/dist/components/Alert/Alert.vue.d.ts +17 -116
  5. package/dist/components/Alert/Alert.vue.d.ts.map +1 -1
  6. package/dist/components/Alert/Version1dot1.vue.d.ts +2 -38
  7. package/dist/components/Alert/Version1dot1.vue.d.ts.map +1 -1
  8. package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +2 -2
  9. package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
  10. package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +5 -5
  11. package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +3 -3
  12. package/dist/components/Banner/Banner.vue.d.ts +1 -1
  13. package/dist/components/Banner/InfoBanner.vue.d.ts +1 -1
  14. package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
  15. package/dist/components/Button/Button.vue.d.ts +1 -1
  16. package/dist/components/Button/Button.vue.d.ts.map +1 -1
  17. package/dist/components/Button/ButtonIcon.vue.d.ts +1 -1
  18. package/dist/components/Button/types.d.ts +1 -1
  19. package/dist/components/Button/types.d.ts.map +1 -1
  20. package/dist/components/Card/AccountCard.vue.d.ts +5 -5
  21. package/dist/components/Card/BlankCard.vue.d.ts +1 -1
  22. package/dist/components/Card/Card.vue.d.ts +27 -27
  23. package/dist/components/Card/CardCompany.vue.d.ts +11 -414
  24. package/dist/components/Card/CardData.vue.d.ts +1 -1
  25. package/dist/components/Card/CardStatusesContainer.vue.d.ts +5 -5
  26. package/dist/components/Card/ContentCard.vue.d.ts +3 -3
  27. package/dist/components/Card/DashCard.vue.d.ts +5 -5
  28. package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
  29. package/dist/components/Card/MarketplaceCard.vue.d.ts +2 -2
  30. package/dist/components/Card/MarketplaceCard.vue.d.ts.map +1 -1
  31. package/dist/components/Card/SimpleCard.vue.d.ts +3 -3
  32. package/dist/components/Card/StatusCard.vue.d.ts +2 -2
  33. package/dist/components/Card/TitleCard.vue.d.ts +3 -3
  34. package/dist/components/CardImage/CardImage.vue.d.ts +24 -31
  35. package/dist/components/CardInformation/CardInformation.vue.d.ts +5 -5
  36. package/dist/components/CardProject/CardProject.vue.d.ts +3 -3
  37. package/dist/components/Carousel/Carousel.vue.d.ts +13 -416
  38. package/dist/components/Carousel/TagCarousel.vue.d.ts +12 -415
  39. package/dist/components/ChartBar/ChartBar.vue.d.ts +5 -5
  40. package/dist/components/ChartLine/ChartLine.vue.d.ts +1 -1
  41. package/dist/components/ChatText/ChatText.vue.d.ts +2 -2
  42. package/dist/components/ChatsContact/ChatsContact.vue.d.ts +21 -446
  43. package/dist/components/ChatsDashboardTagLive/ChatsDashboardTagLive.vue.d.ts +1 -1
  44. package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts +1 -1
  45. package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts.map +1 -1
  46. package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +5 -5
  47. package/dist/components/ChatsMessage/ChatsMessageStatusBackdrop.vue.d.ts +2 -2
  48. package/dist/components/ChatsNavbar/ChatsNavbar.vue.d.ts +1 -1
  49. package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +2 -2
  50. package/dist/components/Checkbox/Checkbox.vue.d.ts +19 -26
  51. package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
  52. package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +28 -0
  53. package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +1 -0
  54. package/dist/components/Comment/Comment.vue.d.ts +1 -1
  55. package/dist/components/DataArea/DataArea.vue.d.ts +2 -2
  56. package/dist/components/DataTable/index.vue.d.ts +1 -1
  57. package/dist/components/DataTable/index.vue.d.ts.map +1 -1
  58. package/dist/components/DateFilter/DateFilter.vue.d.ts +170 -39
  59. package/dist/components/DatePicker/DatePicker.vue.d.ts +4 -4
  60. package/dist/components/Drawer/Drawer.vue.d.ts +4 -4
  61. package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
  62. package/dist/components/Dropdown/LanguageSelect.vue.d.ts +3 -3
  63. package/dist/components/Flag.vue.d.ts +2 -2
  64. package/dist/components/FormElement/FormElement.vue.d.ts +51 -28
  65. package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
  66. package/dist/components/Icon.vue.d.ts +1 -1
  67. package/dist/components/Icon.vue.d.ts.map +1 -1
  68. package/dist/components/IconLoading/IconLoading.vue.d.ts +1 -1
  69. package/dist/components/ImportCard/ImportCard.vue.d.ts +4 -4
  70. package/dist/components/Input/BaseInput.vue.d.ts +11 -2
  71. package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
  72. package/dist/components/Input/Input.vue.d.ts +170 -39
  73. package/dist/components/Input/Input.vue.d.ts.map +1 -1
  74. package/dist/components/Input/TextInput.vue.d.ts +33 -24
  75. package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
  76. package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +175 -44
  77. package/dist/components/InputNext/InputNext.vue.d.ts +4 -4
  78. package/dist/components/Label/Label.vue.d.ts +9 -15
  79. package/dist/components/Label/Label.vue.d.ts.map +1 -1
  80. package/dist/components/Modal/Modal.vue.d.ts +2 -2
  81. package/dist/components/ModalDialog/ModalDialog.vue.d.ts +6 -6
  82. package/dist/components/ModalNext/ModalNext.vue.d.ts +175 -44
  83. package/dist/components/ModalUpload/ModalUpload.vue.d.ts +9 -9
  84. package/dist/components/MoodRating/MoodRating.vue.d.ts +1 -1
  85. package/dist/components/MultiSelect/MultiSelect.vue.d.ts +26 -14
  86. package/dist/components/PageHeader/PageHeader.vue.d.ts +28 -0
  87. package/dist/components/PageHeader/PageHeader.vue.d.ts.map +1 -0
  88. package/dist/components/PageHeader/index.d.ts +3 -0
  89. package/dist/components/PageHeader/index.d.ts.map +1 -0
  90. package/dist/components/PageHeader/types.d.ts +9 -0
  91. package/dist/components/PageHeader/types.d.ts.map +1 -0
  92. package/dist/components/Pagination/Pagination.vue.d.ts +3 -3
  93. package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
  94. package/dist/components/Radio/Radio.vue.d.ts +10 -6
  95. package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
  96. package/dist/components/SelectSmart/SelectSmart.vue.d.ts +68 -469
  97. package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +11 -414
  98. package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +21 -28
  99. package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts.map +1 -1
  100. package/dist/components/SelectTime/index.vue.d.ts +33 -24
  101. package/dist/components/SkeletonLoading/skeletonTheme.vue.d.ts +1 -1
  102. package/dist/components/Slider/Slider.vue.d.ts +2 -2
  103. package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
  104. package/dist/components/Switch/Switch.vue.d.ts +55 -21
  105. package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
  106. package/dist/components/Tab/Tab.vue.d.ts +13 -2
  107. package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
  108. package/dist/components/TableNext/TablePagination.vue.d.ts +3 -3
  109. package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
  110. package/dist/components/Tag/DefaultTag.vue.d.ts +4 -83
  111. package/dist/components/Tag/DefaultTag.vue.d.ts.map +1 -1
  112. package/dist/components/Tag/Tag.vue.d.ts +12 -414
  113. package/dist/components/Tag/Tag.vue.d.ts.map +1 -1
  114. package/dist/components/Tag/types.d.ts +18 -0
  115. package/dist/components/Tag/types.d.ts.map +1 -0
  116. package/dist/components/TextArea/TextArea.vue.d.ts +78 -33
  117. package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
  118. package/dist/components/Toast/Toast.vue.d.ts +16 -0
  119. package/dist/components/Toast/Toast.vue.d.ts.map +1 -0
  120. package/dist/components/Toast/ToastManager.d.ts +14 -0
  121. package/dist/components/Toast/ToastManager.d.ts.map +1 -0
  122. package/dist/components/Toast/types.d.ts +35 -0
  123. package/dist/components/Toast/types.d.ts.map +1 -0
  124. package/dist/components/ToolTip/ToolTip.vue.d.ts +1 -1
  125. package/dist/components/Tour/Tour.vue.d.ts +3 -3
  126. package/dist/components/Tour/TourPopover.vue.d.ts +3 -3
  127. package/dist/components/UploadArea/UploadArea.vue.d.ts +4 -4
  128. package/dist/components/index.d.ts +8910 -10904
  129. package/dist/components/index.d.ts.map +1 -1
  130. package/dist/components/ui/popover/PopoverContent.vue.d.ts +1 -1
  131. package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
  132. package/dist/{es-8146fb1b.mjs → es-e3248052.mjs} +1 -1
  133. package/dist/{index-724ed422.mjs → index-f67d5b30.mjs} +9292 -8808
  134. package/dist/{pt-br-af294ec9.mjs → pt-br-f6f53acd.mjs} +1 -1
  135. package/dist/style.css +1 -1
  136. package/dist/unnnic.mjs +181 -173
  137. package/dist/unnnic.umd.js +35 -36
  138. package/dist/utils/call.d.ts +2 -1
  139. package/dist/utils/call.d.ts.map +1 -1
  140. package/package.json +2 -2
  141. package/src/assets/fonts/material-symbols-rounded.woff2 +0 -0
  142. package/src/assets/icons/checkbox-checked-disabled.svg +3 -0
  143. package/src/assets/icons/checkbox-checked.svg +3 -0
  144. package/src/assets/icons/checkbox-less-disabled.svg +3 -0
  145. package/src/assets/icons/checkbox-less.svg +3 -0
  146. package/src/assets/icons/radio-checked.svg +3 -0
  147. package/src/assets/icons/switch-checked-disabled.svg +3 -0
  148. package/src/assets/icons/switch-checked.svg +3 -0
  149. package/src/components/Alert/Alert.vue +26 -135
  150. package/src/components/Alert/Version1dot1.vue +0 -36
  151. package/src/components/Alert/__tests__/Alert.spec.js +2 -45
  152. package/src/components/Alert/__tests__/Version1dot1.spec.js +0 -21
  153. package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +11 -7
  154. package/src/components/Alert/__tests__/__snapshots__/AlertBanner.spec.js.snap +2 -2
  155. package/src/components/Alert/__tests__/__snapshots__/Version1dot1.spec.js.snap +1 -1
  156. package/src/components/Button/Button.vue +67 -117
  157. package/src/components/Button/types.ts +0 -1
  158. package/src/components/Card/MarketplaceCard.vue +1 -0
  159. package/src/components/ChatsContact/ChatsContact.vue +10 -6
  160. package/src/components/Checkbox/Checkbox.vue +117 -65
  161. package/src/components/Checkbox/__tests__/Checkbox.spec.js +6 -21
  162. package/src/components/CheckboxGroup/CheckboxGroup.vue +96 -0
  163. package/src/components/Collapse/Collapse.vue +1 -1
  164. package/src/components/Collapse/__tests__/__snapshots__/Collapse.spec.js.snap +1 -1
  165. package/src/components/FormElement/FormElement.vue +63 -93
  166. package/src/components/Icon.vue +4 -10
  167. package/src/components/Input/BaseInput.vue +12 -12
  168. package/src/components/Input/Input.scss +19 -20
  169. package/src/components/Input/Input.vue +60 -55
  170. package/src/components/Input/TextInput.vue +25 -54
  171. package/src/components/Input/__test__/Input.spec.js +13 -33
  172. package/src/components/Input/__test__/TextInput.spec.js +6 -8
  173. package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +14 -5
  174. package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
  175. package/src/components/Label/Label.vue +52 -21
  176. package/src/components/Label/__tests__/Label.spec.js +1 -1
  177. package/src/components/Label/__tests__/__snapshots__/Label.spec.js.snap +1 -1
  178. package/src/components/PageHeader/PageHeader.vue +148 -0
  179. package/src/components/PageHeader/index.ts +2 -0
  180. package/src/components/PageHeader/types.ts +10 -0
  181. package/src/components/Radio/Radio.vue +118 -66
  182. package/src/components/Radio/__test__/Radio.spec.js +14 -20
  183. package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +4 -3
  184. package/src/components/RadioGroup/RadioGroup.vue +142 -0
  185. package/src/components/SelectSmart/SelectSmart.vue +4 -3
  186. package/src/components/Switch/Switch.vue +132 -91
  187. package/src/components/Switch/__tests__/Switch.spec.js +8 -75
  188. package/src/components/Switch/__tests__/__snapshots__/Switch.spec.js.snap +5 -6
  189. package/src/components/Tab/Tab.vue +37 -23
  190. package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -1
  191. package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +2 -2
  192. package/src/components/TableNext/__test__/__snapshots__/TablePagination.spec.js.snap +2 -2
  193. package/src/components/Tag/DefaultTag.vue +51 -107
  194. package/src/components/Tag/Tag.vue +32 -79
  195. package/src/components/Tag/types.ts +19 -0
  196. package/src/components/TextArea/TextArea.vue +41 -12
  197. package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +11 -3
  198. package/src/components/Toast/Toast.vue +246 -0
  199. package/src/components/Toast/ToastManager.ts +110 -0
  200. package/src/components/Toast/__tests__/Toast.spec.js +291 -0
  201. package/src/components/Toast/__tests__/ToastManager.spec.js +294 -0
  202. package/src/components/Toast/types.ts +57 -0
  203. package/src/components/index.ts +33 -17
  204. package/src/stories/Alert.stories.js +6 -67
  205. package/src/stories/Button.stories.js +29 -39
  206. package/src/stories/Checkbox.stories.js +11 -4
  207. package/src/stories/CheckboxGroup.stories.js +105 -0
  208. package/src/stories/Icon.stories.js +2 -0
  209. package/src/stories/Input.stories.js +71 -76
  210. package/src/stories/Label.stories.js +7 -0
  211. package/src/stories/PageHeader.stories.js +330 -0
  212. package/src/stories/Radio.stories.js +28 -1
  213. package/src/stories/RadioGroup.stories.js +144 -0
  214. package/src/stories/Switch.stories.js +10 -5
  215. package/src/stories/Tab.stories.js +11 -4
  216. package/src/stories/Tag.stories.js +24 -43
  217. package/src/stories/TextArea.stories.js +14 -2
  218. package/src/stories/Toast.mdx +123 -0
  219. package/src/stories/Toast.stories.js +126 -0
  220. package/src/types/scheme-colors.d.ts +1 -0
  221. package/src/utils/call.js +46 -18
  222. package/dist/components/Tag/BrandTag.vue.d.ts +0 -51
  223. package/dist/components/Tag/BrandTag.vue.d.ts.map +0 -1
  224. package/dist/components/Tag/IndicatorTag.vue.d.ts +0 -151
  225. package/dist/components/Tag/IndicatorTag.vue.d.ts.map +0 -1
  226. package/dist/components/Tag/TagNext.vue.d.ts +0 -24
  227. package/dist/components/Tag/TagNext.vue.d.ts.map +0 -1
  228. package/src/assets/fonts/Material Symbols Rounded Filled.woff2 +0 -0
  229. package/src/assets/fonts/Material Symbols Rounded.woff2 +0 -0
  230. package/src/components/Alert/AlertBanner.vue +0 -182
  231. package/src/components/Alert/AlertCaller.vue +0 -49
  232. package/src/components/Alert/__tests__/AlertBanner.spec.js +0 -89
  233. package/src/components/Alert/__tests__/AlertCaller.spec.js +0 -98
  234. package/src/components/Tag/BrandTag.vue +0 -96
  235. package/src/components/Tag/IndicatorTag.vue +0 -107
  236. package/src/components/Tag/TagNext.vue +0 -60
@@ -6,19 +6,16 @@
6
6
  :class="[
7
7
  'unnnic-button',
8
8
  `unnnic-button--size-${size}`,
9
- `unnnic-button--${type}`,
9
+ `unnnic-button--${buttonType}`,
10
10
  iconCenter ? `unnnic-button--icon-on-center` : null,
11
11
  float ? `unnnic-button--float` : null,
12
12
  ]"
13
13
  >
14
- <UnnnicIcon
14
+ <UnnnicIconLoading
15
15
  v-if="loading"
16
- icon="loading-circle-1"
17
16
  :scheme="iconScheme"
18
17
  :size="iconSize"
19
- :filled="iconsFilled"
20
18
  :style="{ position: 'absolute' }"
21
- class="rotation"
22
19
  data-testid="icon-loading"
23
20
  />
24
21
 
@@ -30,6 +27,7 @@
30
27
  :filled="iconsFilled"
31
28
  :class="{ 'unnnic-button__icon-left': hasText }"
32
29
  :style="{ visibility: loading ? 'hidden' : 'visible' }"
30
+ clickable
33
31
  data-testid="icon-left"
34
32
  />
35
33
 
@@ -40,6 +38,7 @@
40
38
  :style="{ visibility: loading ? 'hidden' : 'visible' }"
41
39
  :size="iconSize"
42
40
  :filled="iconsFilled"
41
+ clickable
43
42
  data-testid="icon-center"
44
43
  />
45
44
 
@@ -60,6 +59,7 @@
60
59
  :filled="iconsFilled"
61
60
  :class="{ 'unnnic-button__icon-right': hasText }"
62
61
  :style="{ visibility: loading ? 'hidden' : 'visible' }"
62
+ clickable
63
63
  data-testid="icon-right"
64
64
  />
65
65
  </button>
@@ -68,6 +68,7 @@
68
68
  <script setup lang="ts">
69
69
  import { computed, watch, useSlots } from 'vue';
70
70
  import UnnnicIcon from '../Icon.vue';
71
+ import UnnnicIconLoading from '../IconLoading/IconLoading.vue';
71
72
  import type { ButtonProps, ButtonSize, ButtonType } from './types';
72
73
  import type { SchemeColor } from '@/types/scheme-colors';
73
74
 
@@ -97,8 +98,8 @@ const buttonDisabled = computed(() => {
97
98
  });
98
99
 
99
100
  const iconSize = computed(() => {
100
- if (props.size === 'small') return 'sm';
101
- return 'md';
101
+ if (props.size === 'extra-large') return 'lg';
102
+ return 'ant';
102
103
  });
103
104
 
104
105
  const hasText = computed(() => {
@@ -115,12 +116,11 @@ const iconScheme = computed((): SchemeColor => {
115
116
  primary: 'neutral-white',
116
117
  secondary: 'neutral-dark',
117
118
  tertiary: 'neutral-dark',
118
- alternative: 'neutral-white',
119
119
  warning: 'neutral-white',
120
120
  attention: 'neutral-white',
121
121
  };
122
122
 
123
- return typeToSchemeMap[props.type] || 'neutral-white';
123
+ return typeToSchemeMap[buttonType.value] || 'neutral-white';
124
124
  });
125
125
 
126
126
  const isSizePropValid = computed(() => {
@@ -131,16 +131,23 @@ const isSizePropValid = computed(() => {
131
131
  );
132
132
  });
133
133
 
134
+ const buttonType = computed(() => {
135
+ return (
136
+ {
137
+ alternative: 'tertiary',
138
+ }[props.type] || props.type
139
+ );
140
+ });
141
+
134
142
  const isTypePropValid = computed(() => {
135
143
  const validTypes: ButtonType[] = [
136
144
  'primary',
137
145
  'secondary',
138
146
  'tertiary',
139
- 'alternative',
140
147
  'warning',
141
148
  'attention',
142
149
  ];
143
- return validTypes.includes(props.type);
150
+ return validTypes.includes(buttonType.value);
144
151
  });
145
152
 
146
153
  const validateProps = () => {
@@ -154,6 +161,8 @@ const validateProps = () => {
154
161
 
155
162
  if (!isTypePropValid.value) {
156
163
  errorMessage += ' Invalid type prop.';
164
+ errorMessage +=
165
+ ' Please provide one of the following types: primary, secondary, tertiary, warning, attention. Alternative is discontinued and it was forced renamed to tertiary.';
157
166
  }
158
167
 
159
168
  throw new Error(errorMessage);
@@ -191,16 +200,19 @@ watch(
191
200
  display: inline-flex;
192
201
  align-items: center;
193
202
  justify-content: center;
194
- border-radius: $unnnic-border-radius-sm;
203
+ border-radius: $unnnic-radius-2;
195
204
  border: 0;
196
205
  outline: none;
197
206
  overflow: hidden;
198
207
  white-space: nowrap;
199
- font-weight: $unnnic-font-weight-regular;
200
- font-family: $unnnic-font-family-secondary;
208
+ font: $unnnic-font-action;
201
209
  cursor: pointer;
202
210
  position: relative;
203
211
 
212
+ transition-property: color, background-color, border-color;
213
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
214
+ transition-duration: 0.15s;
215
+
204
216
  &__icon {
205
217
  &-left {
206
218
  margin-right: $unnnic-inline-nano;
@@ -211,129 +223,91 @@ watch(
211
223
  }
212
224
  }
213
225
 
226
+ &--primary,
227
+ &--warning,
228
+ &--attention {
229
+ color: $unnnic-color-fg-inverted;
230
+ }
231
+
232
+ &--secondary,
233
+ &--tertiary {
234
+ color: $unnnic-color-fg-emphasized;
235
+ }
236
+
214
237
  &--primary {
215
- background-color: $unnnic-color-weni-600;
216
- color: $unnnic-color-neutral-white;
238
+ background-color: $unnnic-color-bg-active;
217
239
 
218
240
  &:hover:enabled {
219
- background-color: $unnnic-color-weni-700;
241
+ background-color: $unnnic-color-teal-700;
220
242
  }
221
243
 
222
244
  &:active:enabled {
223
- background-color: $unnnic-color-weni-800;
245
+ background-color: $unnnic-color-teal-800;
224
246
  }
225
247
  }
226
248
 
227
249
  &--secondary {
228
- background-color: $unnnic-color-neutral-white;
229
- color: $unnnic-color-neutral-dark;
250
+ background-color: $unnnic-color-bg-base;
230
251
  box-shadow: inset 0 0 0 $unnnic-border-width-thinner
231
- $unnnic-color-neutral-cleanest;
252
+ $unnnic-color-border-base;
232
253
 
233
254
  &:hover:enabled {
234
- background-color: $unnnic-color-neutral-light;
235
- }
236
-
237
- &:disabled {
238
- box-shadow: none;
255
+ background-color: $unnnic-color-gray-50;
239
256
  }
240
257
 
241
258
  &:active:enabled {
242
- background-color: $unnnic-color-neutral-soft;
243
- }
244
- }
245
-
246
- &--tertiary {
247
- background-color: transparent;
248
- color: $unnnic-color-neutral-dark;
249
-
250
- &:hover:enabled {
251
- background-color: $unnnic-color-neutral-light;
259
+ background-color: $unnnic-color-gray-100;
252
260
  }
253
261
 
254
262
  &:disabled {
255
- color: $unnnic-color-neutral-clean;
256
- cursor: not-allowed;
257
- }
258
-
259
- &:active:enabled {
260
- background-color: $unnnic-color-neutral-soft;
263
+ box-shadow: none;
261
264
  }
262
265
  }
263
266
 
264
- &--alternative {
265
- background-color: $unnnic-color-weni-50;
266
- color: $unnnic-color-weni-800;
267
-
268
- :deep(svg .primary) {
269
- fill: $unnnic-color-weni-800;
270
- }
271
-
272
- :deep(svg .primary-stroke) {
273
- stroke: $unnnic-color-weni-800;
274
- }
267
+ &--tertiary {
268
+ background-color: transparent;
275
269
 
276
270
  &:hover:enabled {
277
- background-color: $unnnic-color-weni-100;
278
- }
279
-
280
- &:disabled {
281
- :deep(svg .primary) {
282
- fill: $unnnic-color-neutral-clean;
283
- }
284
-
285
- :deep(svg .primary-stroke) {
286
- stroke: $unnnic-color-neutral-clean;
287
- }
271
+ background-color: rgba($unnnic-color-gray-400, 0.1);
288
272
  }
289
273
 
290
274
  &:active:enabled {
291
- background-color: $unnnic-color-weni-200;
292
- color: $unnnic-color-weni-900;
293
-
294
- :deep(svg .primary) {
295
- fill: $unnnic-color-weni-900;
296
- }
297
-
298
- :deep(svg .primary-stroke) {
299
- stroke: $unnnic-color-weni-900;
300
- }
275
+ background-color: rgba($unnnic-color-gray-400, 0.2);
301
276
  }
302
277
  }
303
278
 
304
279
  &--warning {
305
- background-color: $unnnic-color-aux-red-500;
280
+ background-color: $unnnic-color-red-500;
306
281
  color: $unnnic-color-neutral-white;
307
282
 
308
283
  &:hover:enabled {
309
- background-color: $unnnic-color-aux-red-700;
284
+ background-color: $unnnic-color-red-600;
310
285
  }
311
286
 
312
287
  &:active:enabled {
313
- background-color: $unnnic-color-aux-red-900;
288
+ background-color: $unnnic-color-red-700;
314
289
  }
315
290
  }
316
291
 
317
292
  &--attention {
318
- background-color: $unnnic-color-aux-yellow-500;
319
- color: $unnnic-color-neutral-white;
293
+ background-color: $unnnic-color-yellow-500;
320
294
 
321
295
  &:hover:enabled {
322
- background-color: $unnnic-color-aux-yellow-700;
296
+ background-color: $unnnic-color-yellow-600;
323
297
  }
324
298
 
325
299
  &:active:enabled {
326
- background-color: $unnnic-color-aux-yellow-900;
300
+ background-color: $unnnic-color-yellow-700;
327
301
  }
328
302
  }
329
303
 
330
304
  &--primary:disabled,
331
305
  &--secondary:disabled,
332
- &--alternative:disabled,
306
+ &--tertiary:disabled,
333
307
  &--warning:disabled,
334
308
  &--attention:disabled {
335
- background-color: $unnnic-color-neutral-soft;
336
- color: $unnnic-color-neutral-clean;
309
+ background-color: $unnnic-color-bg-muted;
310
+ color: $unnnic-color-fg-muted;
337
311
  cursor: not-allowed;
338
312
  }
339
313
 
@@ -346,26 +320,12 @@ watch(
346
320
  box-shadow: $unnnic-shadow-level-near;
347
321
  }
348
322
 
349
- &--size {
350
- &-extra-large,
351
- &-large,
352
- &-small {
353
- padding: $unnnic-squish-xs;
354
- font-size: $unnnic-font-size-body-gt;
355
- line-height: ($unnnic-font-size-body-gt + $unnnic-line-height-medium);
356
- }
357
-
358
- &-extra-large {
359
- height: 58px;
360
- }
361
-
362
- &-large {
363
- height: 46px;
364
- }
323
+ &--size-large {
324
+ padding: $unnnic-space-3 $unnnic-space-4;
325
+ }
365
326
 
366
- &-small {
367
- height: 38px;
368
- }
327
+ &--size-small {
328
+ padding: $unnnic-space-2 $unnnic-space-4;
369
329
  }
370
330
  }
371
331
  </style>
@@ -383,29 +343,19 @@ watch(
383
343
  }
384
344
 
385
345
  &-large {
386
- height: 46px;
387
- width: 46px;
346
+ height: 45px;
347
+ width: 45px;
388
348
  }
389
349
 
390
350
  &-large,
391
351
  &-extra-large {
392
352
  padding: $unnnic-inset-xs;
393
-
394
- .unnnic-icon {
395
- width: $unnnic-icon-size-md;
396
- height: $unnnic-icon-size-md;
397
- }
398
353
  }
399
354
 
400
355
  &-small {
401
356
  padding: $unnnic-inset-nano;
402
- height: 38px;
403
- width: 38px;
404
-
405
- .unnnic-icon {
406
- width: $unnnic-icon-size-ant;
407
- height: $unnnic-icon-size-ant;
408
- }
357
+ height: 37px;
358
+ width: 37px;
409
359
  }
410
360
  }
411
361
  }
@@ -4,7 +4,6 @@ export type ButtonType =
4
4
  | 'primary'
5
5
  | 'secondary'
6
6
  | 'tertiary'
7
- | 'alternative'
8
7
  | 'warning'
9
8
  | 'attention';
10
9
 
@@ -33,6 +33,7 @@
33
33
  scheme="feedback-yellow"
34
34
  icon="rating-star-1"
35
35
  size="ant"
36
+ filled
36
37
  />
37
38
  <div class="unnnic-card-marketplace__content__rating__value">
38
39
  {{ rating }}
@@ -45,12 +45,12 @@
45
45
  {{ title }}
46
46
  </h1>
47
47
 
48
- <UnnnicTag
48
+ <p
49
49
  v-if="projectName"
50
50
  class="chats-contact__infos__project-tag"
51
- :text="projectName"
52
- scheme="neutral-white"
53
- />
51
+ >
52
+ {{ projectName }}
53
+ </p>
54
54
  </section>
55
55
  <div
56
56
  class="chats-contact__infos__additional-information"
@@ -145,7 +145,6 @@ import UnnnicIcon from '../Icon.vue';
145
145
  import TransitionRipple from '../TransitionRipple/TransitionRipple.vue';
146
146
  import UnnnicI18n from '../../mixins/i18n';
147
147
  import Checkbox from '../Checkbox/Checkbox.vue';
148
- import UnnnicTag from '../Tag/Tag.vue';
149
148
 
150
149
  import('moment/dist/locale/es.js');
151
150
  import('moment/dist/locale/pt-br.js');
@@ -160,7 +159,6 @@ export default {
160
159
  UnnnicIcon,
161
160
  TransitionRipple,
162
161
  Checkbox,
163
- UnnnicTag,
164
162
  },
165
163
 
166
164
  mixins: [UnnnicI18n],
@@ -509,6 +507,12 @@ export default {
509
507
  display: block;
510
508
  flex-shrink: 1;
511
509
  border: 1px solid $unnnic-color-neutral-cleanest;
510
+
511
+ font: $unnnic-font-caption-1;
512
+ color: $unnnic-color-fg-emphasized;
513
+
514
+ border-radius: $unnnic-radius-4;
515
+ padding: 1px $unnnic-space-2;
512
516
  }
513
517
 
514
518
  &__media {
@@ -1,37 +1,49 @@
1
1
  <!-- eslint-disable vue/multi-word-component-names -->
2
2
  <template>
3
- <div class="unnnic-checkbox-wrapper">
4
- <UnnnicIcon
5
- class="unnnic-checkbox"
6
- :class="{ disabled }"
7
- :icon="icon"
8
- :scheme="color"
9
- :clickable="!disabled"
10
- :size="size"
11
- @click="click"
12
- />
13
-
14
- <div
15
- v-if="textRight"
3
+ <section class="unnnic-checkbox">
4
+ <label
16
5
  :class="[
17
- 'unnnic-checkbox__label',
18
- 'unnnic-checkbox__label__right',
19
- `unnnic-checkbox__label__${size}`,
6
+ 'unnnic-checkbox__input-wrapper',
7
+ { 'unnnic-checkbox__input-wrapper--disabled': disabled },
20
8
  ]"
21
- data-testid="checkbox-text-right"
22
9
  >
23
- {{ textRight }}
24
- </div>
25
- </div>
10
+ <input
11
+ :class="[
12
+ 'unnnic-checkbox__input',
13
+ { 'unnnic-checkbox__input--less': modelValue === 'less' },
14
+ ]"
15
+ type="checkbox"
16
+ :disabled="disabled"
17
+ :checked="modelValue === 'less' || modelValue"
18
+ @change="click"
19
+ v-bind="pick($attrs, ['id', 'name'])"
20
+ />
21
+
22
+ <p
23
+ v-if="label || textRight"
24
+ :class="[
25
+ 'unnnic-checkbox__label',
26
+ { 'unnnic-checkbox__label--disabled': disabled },
27
+ ]"
28
+ data-testid="checkbox-text-right"
29
+ >
30
+ {{ label || textRight }}
31
+ </p>
32
+ </label>
33
+
34
+ <p
35
+ v-if="helper"
36
+ class="unnnic-checkbox__helper"
37
+ >
38
+ {{ helper }}
39
+ </p>
40
+ </section>
26
41
  </template>
27
42
 
28
43
  <script>
29
- import UnnnicIcon from '../Icon.vue';
44
+ import { pick } from 'lodash';
30
45
 
31
46
  export default {
32
- components: {
33
- UnnnicIcon,
34
- },
35
47
  model: {
36
48
  event: 'change',
37
49
  },
@@ -50,13 +62,16 @@ export default {
50
62
  default: false,
51
63
  },
52
64
 
53
- size: {
65
+ label: {
54
66
  type: String,
55
- default: 'md',
56
- validator(value) {
57
- return ['md', 'sm'].includes(value);
58
- },
67
+ default: '',
59
68
  },
69
+
70
+ helper: {
71
+ type: String,
72
+ default: '',
73
+ },
74
+
60
75
  textRight: {
61
76
  type: String,
62
77
  default: '',
@@ -75,25 +90,11 @@ export default {
75
90
 
76
91
  return 'less';
77
92
  },
78
-
79
- icon() {
80
- return {
81
- checked: 'checkbox-select',
82
- default: this.disabled ? 'checkbox-disable' : 'checkbox-default',
83
- less: 'checkbox-less',
84
- }[this.valueName];
85
- },
86
-
87
- color() {
88
- if (this.valueName === 'default') {
89
- return 'neutral-clean';
90
- }
91
-
92
- return 'brand-weni';
93
- },
94
93
  },
95
94
 
96
95
  methods: {
96
+ pick,
97
+
97
98
  click() {
98
99
  const isChecked = ['checked', 'less'].includes(this.valueName);
99
100
  this.$emit('change', !isChecked);
@@ -106,35 +107,86 @@ export default {
106
107
  <style lang="scss" scoped>
107
108
  @use '@/assets/scss/unnnic' as *;
108
109
 
109
- .unnnic-checkbox-wrapper {
110
+ $checkbox-size: 21px;
111
+
112
+ .unnnic-checkbox {
110
113
  display: flex;
114
+ flex-direction: column;
111
115
  align-items: flex-start;
112
- cursor: pointer;
113
- }
114
116
 
115
- .unnnic-checkbox {
116
- &.disabled {
117
- :deep(.primary) {
118
- fill: $unnnic-color-neutral-cleanest;
117
+ &__input-wrapper {
118
+ width: fit-content;
119
+
120
+ display: flex;
121
+ align-items: center;
122
+ column-gap: $unnnic-space-2;
123
+
124
+ cursor: pointer;
125
+
126
+ &--disabled {
127
+ cursor: not-allowed;
119
128
  }
120
129
  }
121
- }
122
130
 
123
- .unnnic-checkbox__label {
124
- font-family: $unnnic-font-family-secondary;
125
- font-weight: $unnnic-font-weight-regular;
126
- color: $unnnic-color-neutral-darkest;
131
+ &__input {
132
+ appearance: none;
133
+ width: $checkbox-size;
134
+ min-width: $checkbox-size;
135
+ height: $checkbox-size;
136
+ margin: 0;
137
+ background-color: $unnnic-color-bg-base;
138
+ border: 1px solid $unnnic-color-border-base;
139
+ border-radius: $unnnic-radius-1;
140
+ box-sizing: border-box;
141
+
142
+ outline: none;
143
+
144
+ cursor: pointer;
145
+
146
+ &:checked {
147
+ border-width: 0;
148
+ background-color: $unnnic-color-bg-active;
149
+ background-image: url('../../assets/icons/checkbox-checked.svg');
150
+ background-repeat: no-repeat;
151
+ background-position: center;
152
+
153
+ &.unnnic-checkbox__input--less {
154
+ background-image: url('../../assets/icons/checkbox-less.svg');
155
+ }
156
+ }
157
+
158
+ &:disabled,
159
+ &:disabled:checked {
160
+ background-color: $unnnic-color-bg-muted;
161
+ border: 1px solid $unnnic-color-border-muted;
127
162
 
128
- &__sm {
129
- margin-left: $unnnic-inline-nano;
130
- font-size: $unnnic-font-size-body-md;
131
- line-height: $unnnic-font-size-body-md + $unnnic-line-height-md;
163
+ cursor: not-allowed;
164
+ }
165
+
166
+ &:disabled:checked {
167
+ background-image: url('../../assets/icons/checkbox-checked-disabled.svg');
168
+
169
+ &.unnnic-checkbox__input--less {
170
+ background-image: url('../../assets/icons/checkbox-less-disabled.svg');
171
+ }
172
+ }
173
+ }
174
+
175
+ &__label {
176
+ margin: 0;
177
+ font: $unnnic-font-body;
178
+ color: $unnnic-color-fg-emphasized;
179
+
180
+ &--disabled {
181
+ color: $unnnic-color-fg-muted;
182
+ }
132
183
  }
133
184
 
134
- &__md {
135
- margin-left: $unnnic-inline-xs;
136
- font-size: $unnnic-font-size-body-gt;
137
- line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
185
+ &__helper {
186
+ margin: 0;
187
+ margin-left: $checkbox-size + $unnnic-space-2;
188
+ font: $unnnic-font-caption-2;
189
+ color: $unnnic-color-fg-base;
138
190
  }
139
191
  }
140
192
  </style>
@@ -24,43 +24,28 @@ describe('Checkbox', () => {
24
24
 
25
25
  it('should checkbox emit change events', async () => {
26
26
  wrapper = createWrapper();
27
- const checkbox = wrapper.findComponent({ name: 'UnnnicIcon' });
27
+ const checkbox = wrapper.find('input[type="checkbox"]');
28
28
 
29
29
  // click false to true
30
- await checkbox.trigger('click');
30
+ await checkbox.trigger('change');
31
31
  expect(wrapper.emitted('change')[0][0]).eq(true);
32
32
 
33
33
  // click true to false
34
34
  await wrapper.setProps({ modelValue: true });
35
- await checkbox.trigger('click');
35
+ await checkbox.trigger('change');
36
36
  expect(wrapper.emitted('change')[1][0]).eq(false);
37
37
 
38
38
  // click less to false
39
39
  await wrapper.setProps({ modelValue: 'less' });
40
- expect(wrapper.vm.icon).eq('checkbox-less');
41
- await checkbox.trigger('click');
40
+ expect(wrapper.vm.valueName).eq('less');
41
+ await checkbox.trigger('change');
42
42
  expect(wrapper.emitted('change')[2][0]).eq(false);
43
43
  });
44
44
 
45
45
  it('should checkbox disabled', async () => {
46
46
  wrapper = createWrapper({ disabled: true });
47
- const checkbox = wrapper.findComponent({ name: 'UnnnicIcon' });
47
+ const checkbox = wrapper.find('input[type="checkbox"]');
48
48
  await checkbox.trigger('click');
49
49
  expect(wrapper.emitted('change')).eq(undefined);
50
50
  });
51
-
52
- it('should define sizes', async () => {
53
- wrapper = createWrapper({ size: 'sm', textRight: 'Label' });
54
- const checkbox = wrapper.findComponent({ name: 'UnnnicIcon' });
55
- const label = wrapper.find('.unnnic-checkbox__label');
56
-
57
- // sm
58
- expect(checkbox.classes()).include('unnnic-icon__size--sm');
59
- expect(label.classes()).include('unnnic-checkbox__label__sm');
60
-
61
- // md
62
- await wrapper.setProps({ size: 'md' });
63
- expect(checkbox.classes()).include('unnnic-icon__size--md');
64
- expect(label.classes()).include('unnnic-checkbox__label__md');
65
- });
66
51
  });