@weni/unnnic-system 3.2.7 → 3.2.9-alpha.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 (222) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
  3. package/dist/components/Alert/Alert.vue.d.ts +18 -119
  4. package/dist/components/Alert/Alert.vue.d.ts.map +1 -1
  5. package/dist/components/Alert/Version1dot1.vue.d.ts +2 -38
  6. package/dist/components/Alert/Version1dot1.vue.d.ts.map +1 -1
  7. package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +2 -2
  8. package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
  9. package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +5 -5
  10. package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +2 -2
  11. package/dist/components/Banner/Banner.vue.d.ts +1 -1
  12. package/dist/components/Banner/InfoBanner.vue.d.ts +1 -1
  13. package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
  14. package/dist/components/Button/Button.vue.d.ts +2 -2
  15. package/dist/components/Button/Button.vue.d.ts.map +1 -1
  16. package/dist/components/Button/ButtonIcon.vue.d.ts +1 -1
  17. package/dist/components/Button/types.d.ts +1 -1
  18. package/dist/components/Button/types.d.ts.map +1 -1
  19. package/dist/components/Card/AccountCard.vue.d.ts +3 -3
  20. package/dist/components/Card/BlankCard.vue.d.ts +1 -1
  21. package/dist/components/Card/Card.vue.d.ts +21 -21
  22. package/dist/components/Card/CardCompany.vue.d.ts +8 -8
  23. package/dist/components/Card/CardData.vue.d.ts +1 -1
  24. package/dist/components/Card/CardStatusesContainer.vue.d.ts +4 -4
  25. package/dist/components/Card/ContentCard.vue.d.ts +2 -2
  26. package/dist/components/Card/DashCard.vue.d.ts +4 -4
  27. package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
  28. package/dist/components/Card/MarketplaceCard.vue.d.ts +2 -2
  29. package/dist/components/Card/SimpleCard.vue.d.ts +3 -3
  30. package/dist/components/Card/StatusCard.vue.d.ts +2 -2
  31. package/dist/components/Card/TitleCard.vue.d.ts +2 -2
  32. package/dist/components/CardImage/CardImage.vue.d.ts +8 -8
  33. package/dist/components/CardInformation/CardInformation.vue.d.ts +4 -4
  34. package/dist/components/CardProject/CardProject.vue.d.ts +3 -3
  35. package/dist/components/Carousel/Carousel.vue.d.ts +11 -11
  36. package/dist/components/Carousel/TagCarousel.vue.d.ts +9 -9
  37. package/dist/components/ChartBar/ChartBar.vue.d.ts +8 -8
  38. package/dist/components/ChartLine/ChartLine.vue.d.ts +1 -1
  39. package/dist/components/ChatText/ChatText.vue.d.ts +2 -2
  40. package/dist/components/ChatsContact/ChatsContact.vue.d.ts +15 -15
  41. package/dist/components/ChatsDashboardTagLive/ChatsDashboardTagLive.vue.d.ts +1 -1
  42. package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts +1 -1
  43. package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts.map +1 -1
  44. package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +5 -5
  45. package/dist/components/ChatsMessage/ChatsMessageStatusBackdrop.vue.d.ts +2 -2
  46. package/dist/components/ChatsMessage/ChatsMessageText.vue.d.ts.map +1 -1
  47. package/dist/components/ChatsNavbar/ChatsNavbar.vue.d.ts +1 -1
  48. package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +2 -2
  49. package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
  50. package/dist/components/Chip/Chip.vue.d.ts.map +1 -1
  51. package/dist/components/Comment/Comment.vue.d.ts +1 -1
  52. package/dist/components/DataArea/DataArea.vue.d.ts +2 -2
  53. package/dist/components/DataTable/index.vue.d.ts +1 -1
  54. package/dist/components/DataTable/index.vue.d.ts.map +1 -1
  55. package/dist/components/DateFilter/DateFilter.vue.d.ts +182 -27
  56. package/dist/components/DatePicker/DatePicker.vue.d.ts +8 -8
  57. package/dist/components/DatePicker/DatePicker.vue.d.ts.map +1 -1
  58. package/dist/components/Drawer/Drawer.vue.d.ts +7 -7
  59. package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
  60. package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
  61. package/dist/components/Dropdown/LanguageSelect.vue.d.ts +3 -3
  62. package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts.map +1 -1
  63. package/dist/components/Flag.vue.d.ts +2 -2
  64. package/dist/components/FormElement/FormElement.vue.d.ts +38 -32
  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 +7 -7
  70. package/dist/components/Input/BaseInput.vue.d.ts +10 -1
  71. package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
  72. package/dist/components/Input/Input.vue.d.ts +182 -27
  73. package/dist/components/Input/Input.vue.d.ts.map +1 -1
  74. package/dist/components/Input/TextInput.vue.d.ts +31 -13
  75. package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
  76. package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +192 -37
  77. package/dist/components/InputNext/InputNext.vue.d.ts +3 -3
  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 +9 -9
  82. package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
  83. package/dist/components/ModalNext/ModalNext.vue.d.ts +190 -35
  84. package/dist/components/ModalUpload/ModalUpload.vue.d.ts +14 -14
  85. package/dist/components/MoodRating/MoodRating.vue.d.ts +1 -1
  86. package/dist/components/MultiSelect/MultiSelect.vue.d.ts +7 -7
  87. package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
  88. package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
  89. package/dist/components/Radio/Radio.vue.d.ts +2 -2
  90. package/dist/components/SelectSmart/SelectSmart.vue.d.ts +45 -27
  91. package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +8 -8
  92. package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +4 -4
  93. package/dist/components/SelectTime/index.vue.d.ts +31 -13
  94. package/dist/components/SkeletonLoading/skeletonTheme.vue.d.ts +1 -1
  95. package/dist/components/Slider/Slider.vue.d.ts +2 -2
  96. package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
  97. package/dist/components/Switch/Switch.vue.d.ts +2 -2
  98. package/dist/components/Tab/Tab.vue.d.ts +2 -2
  99. package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
  100. package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
  101. package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
  102. package/dist/components/Tag/BrandTag.vue.d.ts +2 -2
  103. package/dist/components/Tag/DefaultTag.vue.d.ts +2 -2
  104. package/dist/components/Tag/IndicatorTag.vue.d.ts +2 -2
  105. package/dist/components/Tag/Tag.vue.d.ts +8 -8
  106. package/dist/components/Tag/TagNext.vue.d.ts.map +1 -1
  107. package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts +9 -0
  108. package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +1 -0
  109. package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +15 -0
  110. package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts.map +1 -0
  111. package/dist/components/TextArea/TextArea.vue.d.ts +38 -32
  112. package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
  113. package/dist/components/Toast/Toast.vue.d.ts +16 -0
  114. package/dist/components/Toast/Toast.vue.d.ts.map +1 -0
  115. package/dist/components/Toast/ToastManager.d.ts +14 -0
  116. package/dist/components/Toast/ToastManager.d.ts.map +1 -0
  117. package/dist/components/Toast/types.d.ts +35 -0
  118. package/dist/components/Toast/types.d.ts.map +1 -0
  119. package/dist/components/ToolTip/ToolTip.vue.d.ts +1 -1
  120. package/dist/components/Tour/Tour.vue.d.ts +6 -6
  121. package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
  122. package/dist/components/UploadArea/UploadArea.vue.d.ts +7 -7
  123. package/dist/components/index.d.ts +2116 -1064
  124. package/dist/components/index.d.ts.map +1 -1
  125. package/dist/{es-57bb200f.mjs → es-2735a8fb.js} +1 -1
  126. package/dist/{index-5f770b98.mjs → index-e012fa52.js} +8428 -8113
  127. package/dist/{pt-br-dc8f4568.mjs → pt-br-f38a8b9c.js} +1 -1
  128. package/dist/style.css +1 -1
  129. package/dist/unnnic.js +188 -0
  130. package/dist/{unnnic.umd.js → unnnic.umd.cjs} +42 -41
  131. package/dist/utils/call.d.ts +2 -1
  132. package/dist/utils/call.d.ts.map +1 -1
  133. package/package.json +10 -9
  134. package/src/assets/icons/script-to-convert-svg-to-vue.js +4 -7
  135. package/src/assets/img/previews/doc-preview.png +0 -0
  136. package/src/assets/img/previews/image-preview.png +0 -0
  137. package/src/assets/img/previews/video-preview.png +0 -0
  138. package/src/assets/scss/scheme-colors.scss +131 -4
  139. package/src/assets/tokens/colors.json +2 -2
  140. package/src/components/Alert/Alert.vue +26 -135
  141. package/src/components/Alert/Version1dot1.vue +0 -36
  142. package/src/components/AudioRecorder/AudioRecorder.vue +3 -2
  143. package/src/components/Button/Button.vue +61 -109
  144. package/src/components/Button/__tests__/Button.spec.js +2 -2
  145. package/src/components/Button/types.ts +1 -2
  146. package/src/components/Card/Card.vue +4 -1
  147. package/src/components/ChartMultiLine/Line/Line.vue +2 -1
  148. package/src/components/ChatsContact/ChatsContact.vue +1 -1
  149. package/src/components/ChatsHeader/ChatsHeader.vue +4 -2
  150. package/src/components/ChatsMessage/ChatsMessageText.vue +5 -5
  151. package/src/components/Chip/Chip.vue +62 -57
  152. package/src/components/Chip/__tests__/Chip.spec.js +18 -18
  153. package/src/components/DataTable/index.vue +8 -5
  154. package/src/components/DatePicker/DatePicker.vue +29 -16
  155. package/src/components/Drawer/Drawer.vue +4 -1
  156. package/src/components/Drawer/__tests__/Drawer.spec.js +9 -3
  157. package/src/components/DropArea/DropArea.vue +1 -1
  158. package/src/components/Dropdown/__tests__/Dropdown.spec.js +17 -17
  159. package/src/components/EmojiPicker/EmojiPicker.vue +57 -48
  160. package/src/components/EmojiPicker/__tests__/EmojiPicker.spec.js +84 -23
  161. package/src/components/Flag.vue +0 -1
  162. package/src/components/FormElement/FormElement.vue +52 -92
  163. package/src/components/Icon/types.ts +2 -2
  164. package/src/components/Icon.vue +3 -1
  165. package/src/components/Input/BaseInput.vue +10 -12
  166. package/src/components/Input/Input.scss +17 -20
  167. package/src/components/Input/Input.vue +96 -28
  168. package/src/components/Input/TextInput.vue +28 -41
  169. package/src/components/Input/__test__/TextInput.spec.js +5 -5
  170. package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +12 -3
  171. package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
  172. package/src/components/InputDatePicker/InputDatePicker.vue +1 -1
  173. package/src/components/Label/Label.vue +52 -21
  174. package/src/components/Label/__tests__/Label.spec.js +1 -1
  175. package/src/components/Label/__tests__/__snapshots__/Label.spec.js.snap +1 -1
  176. package/src/components/ModalDialog/ModalDialog.vue +1 -0
  177. package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -1
  178. package/src/components/ModalNext/ModalNext.vue +2 -2
  179. package/src/components/SelectSmart/SelectSmart.vue +15 -4
  180. package/src/components/SelectSmart/__tests__/SelectSmart.spec.js +2 -2
  181. package/src/components/Switch/__tests__/Switch.spec.js +6 -2
  182. package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +2 -2
  183. package/src/components/TableNext/__test__/__snapshots__/TablePagination.spec.js.snap +2 -2
  184. package/src/components/Tag/TagNext.vue +2 -8
  185. package/src/components/TemplatePreview/TemplatePreview.vue +252 -0
  186. package/src/components/TemplatePreview/TemplatePreviewModal.vue +51 -0
  187. package/src/components/TemplatePreview/types.d.ts +16 -0
  188. package/src/components/TextArea/TextArea.vue +13 -9
  189. package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +7 -2
  190. package/src/components/Toast/Toast.vue +236 -0
  191. package/src/components/Toast/ToastManager.ts +110 -0
  192. package/src/components/Toast/types.ts +57 -0
  193. package/src/components/Tour/TourPopover.vue +1 -1
  194. package/src/components/__tests__/Icon.spec.js +2 -2
  195. package/src/components/index.ts +105 -91
  196. package/src/index.ts +1 -1
  197. package/src/main.ts +1 -1
  198. package/src/stories/Alert.stories.js +6 -67
  199. package/src/stories/Button.stories.js +3 -18
  200. package/src/stories/ChatsHeader.stories.js +1 -1
  201. package/src/stories/ChatsMessage.stories.js +0 -1
  202. package/src/stories/Chip.stories.js +7 -4
  203. package/src/stories/Input.stories.js +16 -3
  204. package/src/stories/Label.stories.js +7 -0
  205. package/src/stories/SelectSmart.stories.js +1 -1
  206. package/src/stories/TableNext.stories.js +1 -1
  207. package/src/stories/TemplatePreview.stories.js +94 -0
  208. package/src/stories/TemplatePreviewModal.stories.js +110 -0
  209. package/src/stories/Toast.mdx +123 -0
  210. package/src/stories/Toast.stories.js +126 -0
  211. package/src/types/index.d.ts +2 -2
  212. package/src/types/scheme-colors.d.ts +121 -16
  213. package/src/types/unnnic-utils.d.ts +87 -87
  214. package/src/types/vue-shims.d.ts +1 -1
  215. package/src/types/vueuse-overrides.d.ts +2 -2
  216. package/src/utils/call.js +46 -18
  217. package/src/utils/plugins/i18n.js +0 -1
  218. package/dist/unnnic.mjs +0 -182
  219. package/src/components/Alert/AlertBanner.vue +0 -182
  220. package/src/components/Alert/AlertCaller.vue +0 -49
  221. package/src/components/Alert/__tests__/AlertBanner.spec.js +0 -89
  222. package/src/components/Alert/__tests__/AlertCaller.spec.js +0 -98
@@ -1,88 +1,88 @@
1
1
  export type UnnnicColorToken =
2
- | "background-solo"
3
- | "background-sky"
4
- | "background-grass"
5
- | "background-carpet"
6
- | "background-snow"
7
- | "background-lightest"
8
- | "background-white"
9
- | "neutral-black"
10
- | "neutral-darkest"
11
- | "neutral-dark"
12
- | "neutral-cloudy"
13
- | "neutral-cleanest"
14
- | "neutral-clean"
15
- | "neutral-soft"
16
- | "neutral-lightest"
17
- | "neutral-light"
18
- | "neutral-white"
19
- | "neutral-snow"
20
- | "feedback-red"
21
- | "feedback-green"
22
- | "feedback-yellow"
23
- | "feedback-blue"
24
- | "feedback-grey"
25
- | "aux-blue"
26
- | "aux-purple"
27
- | "aux-orange"
28
- | "aux-lemon"
29
- | "aux-pink"
30
- | "aux-baby-blue"
31
- | "aux-baby-yellow"
32
- | "aux-baby-red"
33
- | "aux-baby-green"
34
- | "aux-baby-pink"
35
- | "aux-green-100"
36
- | "aux-green-300"
37
- | "aux-green-500"
38
- | "aux-green-700"
39
- | "aux-green-900"
40
- | "aux-blue-100"
41
- | "aux-blue-300"
42
- | "aux-blue-500"
43
- | "aux-blue-700"
44
- | "aux-blue-900"
45
- | "aux-purple-100"
46
- | "aux-purple-300"
47
- | "aux-purple-500"
48
- | "aux-purple-700"
49
- | "aux-purple-900"
50
- | "aux-red-100"
51
- | "aux-red-300"
52
- | "aux-red-500"
53
- | "aux-red-700"
54
- | "aux-red-900"
55
- | "aux-orange-100"
56
- | "aux-orange-300"
57
- | "aux-orange-500"
58
- | "aux-orange-700"
59
- | "aux-orange-900"
60
- | "aux-yellow-100"
61
- | "aux-yellow-300"
62
- | "aux-yellow-500"
63
- | "aux-yellow-700"
64
- | "aux-yellow-900"
65
- | "floweditor-blue"
66
- | "floweditor-purple"
67
- | "floweditor-wine"
68
- | "floweditor-orange"
69
- | "floweditor-pink"
70
- | "floweditor-turquoise"
71
- | "floweditor-green"
72
- | "weni-50"
73
- | "weni-100"
74
- | "weni-200"
75
- | "weni-300"
76
- | "weni-400"
77
- | "weni-500"
78
- | "weni-600"
79
- | "weni-700"
80
- | "weni-800"
81
- | "weni-900"
82
- | "weni-950"
83
- | "brand-weni"
84
- | "brand-weni-dark"
85
- | "brand-weni-soft"
86
- | "brand-sec-dark"
87
- | "brand-sec-soft"
88
- | "brand-sec";
2
+ | 'background-solo'
3
+ | 'background-sky'
4
+ | 'background-grass'
5
+ | 'background-carpet'
6
+ | 'background-snow'
7
+ | 'background-lightest'
8
+ | 'background-white'
9
+ | 'neutral-black'
10
+ | 'neutral-darkest'
11
+ | 'neutral-dark'
12
+ | 'neutral-cloudy'
13
+ | 'neutral-cleanest'
14
+ | 'neutral-clean'
15
+ | 'neutral-soft'
16
+ | 'neutral-lightest'
17
+ | 'neutral-light'
18
+ | 'neutral-white'
19
+ | 'neutral-snow'
20
+ | 'feedback-red'
21
+ | 'feedback-green'
22
+ | 'feedback-yellow'
23
+ | 'feedback-blue'
24
+ | 'feedback-grey'
25
+ | 'aux-blue'
26
+ | 'aux-purple'
27
+ | 'aux-orange'
28
+ | 'aux-lemon'
29
+ | 'aux-pink'
30
+ | 'aux-baby-blue'
31
+ | 'aux-baby-yellow'
32
+ | 'aux-baby-red'
33
+ | 'aux-baby-green'
34
+ | 'aux-baby-pink'
35
+ | 'aux-green-100'
36
+ | 'aux-green-300'
37
+ | 'aux-green-500'
38
+ | 'aux-green-700'
39
+ | 'aux-green-900'
40
+ | 'aux-blue-100'
41
+ | 'aux-blue-300'
42
+ | 'aux-blue-500'
43
+ | 'aux-blue-700'
44
+ | 'aux-blue-900'
45
+ | 'aux-purple-100'
46
+ | 'aux-purple-300'
47
+ | 'aux-purple-500'
48
+ | 'aux-purple-700'
49
+ | 'aux-purple-900'
50
+ | 'aux-red-100'
51
+ | 'aux-red-300'
52
+ | 'aux-red-500'
53
+ | 'aux-red-700'
54
+ | 'aux-red-900'
55
+ | 'aux-orange-100'
56
+ | 'aux-orange-300'
57
+ | 'aux-orange-500'
58
+ | 'aux-orange-700'
59
+ | 'aux-orange-900'
60
+ | 'aux-yellow-100'
61
+ | 'aux-yellow-300'
62
+ | 'aux-yellow-500'
63
+ | 'aux-yellow-700'
64
+ | 'aux-yellow-900'
65
+ | 'floweditor-blue'
66
+ | 'floweditor-purple'
67
+ | 'floweditor-wine'
68
+ | 'floweditor-orange'
69
+ | 'floweditor-pink'
70
+ | 'floweditor-turquoise'
71
+ | 'floweditor-green'
72
+ | 'weni-50'
73
+ | 'weni-100'
74
+ | 'weni-200'
75
+ | 'weni-300'
76
+ | 'weni-400'
77
+ | 'weni-500'
78
+ | 'weni-600'
79
+ | 'weni-700'
80
+ | 'weni-800'
81
+ | 'weni-900'
82
+ | 'weni-950'
83
+ | 'brand-weni'
84
+ | 'brand-weni-dark'
85
+ | 'brand-weni-soft'
86
+ | 'brand-sec-dark'
87
+ | 'brand-sec-soft'
88
+ | 'brand-sec';
@@ -2,4 +2,4 @@ declare module '*.vue' {
2
2
  import type { DefineComponent } from 'vue';
3
3
  const component: DefineComponent<{}, {}, any>;
4
4
  export default component;
5
- }
5
+ }
@@ -2,6 +2,6 @@ declare module '@vueuse/components' {
2
2
  export interface OnClickOutsideOptions {
3
3
  [key: string]: any;
4
4
  }
5
-
5
+
6
6
  export const vOnClickOutside: any;
7
- }
7
+ }
package/src/utils/call.js CHANGED
@@ -1,30 +1,58 @@
1
1
  import { createApp } from 'vue';
2
2
  import Alert from '../components/Alert/Alert.vue';
3
3
  import Modal from '../components/Modal/Modal.vue';
4
+ import ToastInstance from '../components/Toast/ToastManager';
4
5
  import mitt from 'mitt';
5
6
 
6
7
  const emitter = mitt();
7
-
8
- const callAlert = ({ props, containerRef }) => {
9
- const AlertComponent = createApp(Alert, {
10
- ...props,
11
- onClose: () => {
12
- instance.$el.remove();
13
- },
14
- created() {
15
- emitter.on(['close'], () => {
8
+ const callAlert = ({ props, containerRef, seconds }) => {
9
+ if (props.version === '1.1' || containerRef) {
10
+ const AlertComponent = createApp(Alert, {
11
+ ...props,
12
+ seconds,
13
+ version: '1.1',
14
+ onClose: () => {
16
15
  instance.$el.remove();
17
- });
18
- },
19
- });
20
- const element = document.createElement('div');
21
- const instance = AlertComponent.mount(element);
16
+ },
17
+ created() {
18
+ emitter.on(['close'], () => {
19
+ instance.$el.remove();
20
+ });
21
+ },
22
+ });
23
+ const element = document.createElement('div');
24
+ const instance = AlertComponent.mount(element);
22
25
 
23
- if (containerRef) {
24
- instance.$el.style.position = 'absolute';
25
- containerRef.appendChild(instance.$el);
26
+ if (containerRef) {
27
+ instance.$el.style.position = 'absolute';
28
+ containerRef.appendChild(instance.$el);
29
+ } else {
30
+ document.body.appendChild(instance.$el);
31
+ }
26
32
  } else {
27
- document.body.appendChild(instance.$el);
33
+ const typeMap = {
34
+ success: 'success',
35
+ error: 'error',
36
+ attention: 'attention',
37
+ default: 'informational',
38
+ 'feedback-green': 'success',
39
+ 'feedback-red': 'error',
40
+ };
41
+
42
+ const toastProps = {
43
+ timeout: seconds ? seconds * 1000 : 5000,
44
+ type: typeMap[props.scheme || props.type] || typeMap.default,
45
+
46
+ onClose: () => {
47
+ emitter.emit(['close']);
48
+ },
49
+ };
50
+
51
+ ToastInstance.show({
52
+ title: props.text,
53
+ description: '',
54
+ ...toastProps,
55
+ });
28
56
  }
29
57
  };
30
58
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable camelcase */
2
1
  import { createI18n } from 'vue-i18n';
3
2
 
4
3
  import en from '../../locales/en.json';
package/dist/unnnic.mjs DELETED
@@ -1,182 +0,0 @@
1
- import { bd as c, b9 as s, bE as e, aO as r, bk as t, bn as u, aG as o, aH as U, ba as b, bb as l, aT as d, aV as C, aW as m, aX as p, aZ as g, by as h, aY as I, bg as S, bA as T, bQ as D, bB as A, bO as M, bz as x, bw as B, bH as P, bI as R, bJ as v, bK as w, bM as L, bN as N, a_ as k, bY as F, bF as E, a$ as f, bl as j, bq as y, bW as z, bv as H, bm as q, bR as G, bS as J, bs as K, aM as O, aN as Q, bP as V, aB as W, aC as X, aP as Y, aR as Z, aQ as _, bu as $, be as nn, aD as an, aF as cn, aE as sn, bh as en, b2 as rn, b3 as tn, b4 as un, b5 as on, bC as Un, b8 as bn, bV as ln, br as dn, bG as Cn, b0 as mn, bL as pn, b7 as gn, b6 as hn, bX as In, aI as Sn, aJ as Tn, aU as Dn, bf as An, bp as Mn, bD as xn, bo as Bn, bi as Pn, aK as Rn, bT as vn, aL as wn, bj as Ln, bc as Nn, bx as kn, aS as Fn, bU as En, bt as fn, b1 as jn, c as yn, U as zn, Q as Hn, M as qn, ag as Gn, o as Jn, Y as Kn, $ as On, f as Qn, g as Vn, N as Wn, O as Xn, t as Yn, w as Zn, x as _n, y as $n, A as na, aa, z as ia, T as ca, ac as sa, as as ea, ad as ra, aq as ta, ab as ua, a8 as oa, aj as Ua, ak as ba, al as la, am as da, ao as Ca, ap as ma, B as pa, aA as ga, ah as ha, C as Ia, Z as Sa, a2 as Ta, ay as Da, a7 as Aa, _ as Ma, at as xa, au as Ba, a4 as Pa, m as Ra, n as va, ar as wa, u as La, a as Na, p as ka, r as Fa, q as Ea, a6 as fa, R as ja, b as ya, e as za, d as Ha, V as qa, F as Ga, G as Ja, H as Ka, I as Oa, ae as Qa, L as Va, ax as Wa, a3 as Xa, ai as Ya, D as Za, an as _a, K as $a, J as ni, az as ai, i as ii, j as ci, v as si, S as ei, a1 as ri, af as ti, a0 as ui, W as oi, k as Ui, av as bi, l as li, X as di, P as Ci, a9 as mi, s as pi, aw as gi, a5 as hi, E as Ii } from "./index-5f770b98.mjs";
2
- import "vue";
3
- export {
4
- c as UnnnicAccordion,
5
- s as UnnnicAlert,
6
- e as UnnnicAudioRecorder,
7
- r as UnnnicAvatarIcon,
8
- t as UnnnicBanner,
9
- u as UnnnicBreadcrumb,
10
- o as UnnnicButton,
11
- U as UnnnicButtonIcon,
12
- b as UnnnicCallAlert,
13
- l as UnnnicCallModal,
14
- d as UnnnicCard,
15
- C as UnnnicCardCompany,
16
- m as UnnnicCardData,
17
- p as UnnnicCardImage,
18
- g as UnnnicCardInformation,
19
- h as UnnnicCardNumber,
20
- I as UnnnicCardProject,
21
- S as UnnnicCarousel,
22
- T as UnnnicChartBar,
23
- D as UnnnicChartFunnel,
24
- A as UnnnicChartLine,
25
- M as UnnnicChartMultiLine,
26
- x as UnnnicChartRainbow,
27
- B as UnnnicChatText,
28
- P as UnnnicChatsContact,
29
- R as UnnnicChatsDashboardTagLive,
30
- v as UnnnicChatsHeader,
31
- w as UnnnicChatsMessage,
32
- L as UnnnicChatsNavbar,
33
- N as UnnnicChatsUserAvatar,
34
- k as UnnnicCheckbox,
35
- F as UnnnicChip,
36
- E as UnnnicCircleProgressBar,
37
- f as UnnnicCollapse,
38
- j as UnnnicComment,
39
- y as UnnnicDataArea,
40
- z as UnnnicDataTable,
41
- H as UnnnicDateFilter,
42
- q as UnnnicDatePicker,
43
- G as UnnnicDisclaimer,
44
- J as UnnnicDrawer,
45
- K as UnnnicDropArea,
46
- O as UnnnicDropdown,
47
- Q as UnnnicDropdownItem,
48
- V as UnnnicEmojiPicker,
49
- W as UnnnicFontSize,
50
- X as UnnnicFormElement,
51
- Y as UnnnicIcon,
52
- Z as UnnnicIconLoading,
53
- _ as UnnnicIconSvg,
54
- $ as UnnnicImportCard,
55
- nn as UnnnicIndicator,
56
- an as UnnnicInput,
57
- cn as UnnnicInputDatePicker,
58
- sn as UnnnicInputNext,
59
- en as UnnnicLabel,
60
- rn as UnnnicModal,
61
- tn as UnnnicModalDialog,
62
- un as UnnnicModalNext,
63
- on as UnnnicModalUpload,
64
- Un as UnnnicMoodRating,
65
- bn as UnnnicMultiSelect,
66
- ln as UnnnicNavigator,
67
- dn as UnnnicPagination,
68
- Cn as UnnnicProgressBar,
69
- mn as UnnnicRadio,
70
- pn as UnnnicReplyMessage,
71
- gn as UnnnicSelectItem,
72
- hn as UnnnicSelectSmart,
73
- In as UnnnicSelectTime,
74
- Sn as UnnnicSidebar,
75
- Tn as UnnnicSidebarItem,
76
- Dn as UnnnicSimpleCard,
77
- An as UnnnicSkeletonLoading,
78
- Mn as UnnnicSlider,
79
- xn as UnnnicStarRating,
80
- Bn as UnnnicSwitch,
81
- Pn as UnnnicTab,
82
- Rn as UnnnicTable,
83
- vn as UnnnicTableNext,
84
- wn as UnnnicTableRow,
85
- Ln as UnnnicTabsExpanded,
86
- Nn as UnnnicTag,
87
- kn as UnnnicTextArea,
88
- Fn as UnnnicToolTip,
89
- En as UnnnicTour,
90
- fn as UnnnicUploadArea,
91
- jn as UnnniclanguageSelect,
92
- yn as components,
93
- zn as default,
94
- Hn as unnnicAccordion,
95
- qn as unnnicAlert,
96
- Gn as unnnicAudioRecorder,
97
- Jn as unnnicAvatarIcon,
98
- Kn as unnnicBanner,
99
- On as unnnicBreadcrumb,
100
- Qn as unnnicButton,
101
- Vn as unnnicButtonIcon,
102
- Wn as unnnicCallAlert,
103
- Xn as unnnicCallModal,
104
- Yn as unnnicCard,
105
- Zn as unnnicCardCompany,
106
- _n as unnnicCardData,
107
- $n as unnnicCardImage,
108
- na as unnnicCardInformation,
109
- aa as unnnicCardNumber,
110
- ia as unnnicCardProject,
111
- ca as unnnicCarousel,
112
- sa as unnnicChartBar,
113
- ea as unnnicChartFunnel,
114
- ra as unnnicChartLine,
115
- ta as unnnicChartMultiLine,
116
- ua as unnnicChartRainbow,
117
- oa as unnnicChatText,
118
- Ua as unnnicChatsContact,
119
- ba as unnnicChatsDashboardTagLive,
120
- la as unnnicChatsHeader,
121
- da as unnnicChatsMessage,
122
- Ca as unnnicChatsNavbar,
123
- ma as unnnicChatsUserAvatar,
124
- pa as unnnicCheckbox,
125
- ga as unnnicChip,
126
- ha as unnnicCircleProgressBar,
127
- Ia as unnnicCollapse,
128
- Sa as unnnicComment,
129
- Ta as unnnicDataArea,
130
- Da as unnnicDataTable,
131
- Aa as unnnicDateFilter,
132
- Ma as unnnicDatePicker,
133
- xa as unnnicDisclaimer,
134
- Ba as unnnicDrawer,
135
- Pa as unnnicDropArea,
136
- Ra as unnnicDropdown,
137
- va as unnnicDropdownItem,
138
- wa as unnnicEmojiPicker,
139
- La as unnnicFontSize,
140
- Na as unnnicFormElement,
141
- ka as unnnicIcon,
142
- Fa as unnnicIconLoading,
143
- Ea as unnnicIconSvg,
144
- fa as unnnicImportCard,
145
- ja as unnnicIndicator,
146
- ya as unnnicInput,
147
- za as unnnicInputDatePicker,
148
- Ha as unnnicInputNext,
149
- qa as unnnicLabel,
150
- Ga as unnnicModal,
151
- Ja as unnnicModalDialog,
152
- Ka as unnnicModalNext,
153
- Oa as unnnicModalUpload,
154
- Qa as unnnicMoodRating,
155
- Va as unnnicMultiSelect,
156
- Wa as unnnicNavigator,
157
- Xa as unnnicPagination,
158
- Ya as unnnicProgressBar,
159
- Za as unnnicRadio,
160
- _a as unnnicReplyMessage,
161
- $a as unnnicSelectItem,
162
- ni as unnnicSelectSmart,
163
- ai as unnnicSelectTime,
164
- ii as unnnicSidebar,
165
- ci as unnnicSidebarItem,
166
- si as unnnicSimpleCard,
167
- ei as unnnicSkeletonLoading,
168
- ri as unnnicSlider,
169
- ti as unnnicStarRating,
170
- ui as unnnicSwitch,
171
- oi as unnnicTab,
172
- Ui as unnnicTable,
173
- bi as unnnicTableNext,
174
- li as unnnicTableRow,
175
- di as unnnicTabsExpanded,
176
- Ci as unnnicTag,
177
- mi as unnnicTextArea,
178
- pi as unnnicToolTip,
179
- gi as unnnicTour,
180
- hi as unnnicUploadArea,
181
- Ii as unnniclanguageSelect
182
- };
@@ -1,182 +0,0 @@
1
- <template>
2
- <section
3
- :class="[
4
- 'banner-alert',
5
- {
6
- 'banner-alert--banner-danger': type === 'danger',
7
- 'banner-alert--banner-warning': type === 'warning',
8
- },
9
- ]"
10
- >
11
- <header
12
- v-show="text"
13
- class="banner-alert__container-text"
14
- >
15
- <UnnnicIcon
16
- v-show="isShowTextIcon(type)"
17
- class="banner-alert__textIcon"
18
- :icon="getIconType(type)"
19
- size="sm"
20
- scheme="neutral-white"
21
- data-test="unnnic-icon"
22
- />
23
- <p class="text">{{ text }}</p>
24
- <a
25
- v-if="linkHref"
26
- class="banner-alert__link"
27
- :href="linkHref"
28
- :target="linkTarget"
29
- >
30
- {{ linkText }}
31
- </a>
32
- </header>
33
-
34
- <div
35
- v-show="showCloseButton"
36
- class="banner-alert__close"
37
- @click="emitClose"
38
- >
39
- <UnnnicIcon
40
- icon="close"
41
- size="sm"
42
- scheme="neutral-white"
43
- data-test="unnnic-close-icon"
44
- />
45
- </div>
46
- </section>
47
- </template>
48
-
49
- <script>
50
- import UnnnicIcon from '../Icon.vue';
51
-
52
- export default {
53
- components: {
54
- UnnnicIcon,
55
- },
56
- props: {
57
- text: {
58
- type: String,
59
- default: null,
60
- },
61
- onClose: {
62
- type: Function,
63
- default: () => {},
64
- },
65
- showCloseButton: {
66
- type: Boolean,
67
- default: false,
68
- },
69
- linkHref: {
70
- type: String,
71
- default: '',
72
- },
73
- linkTarget: {
74
- type: String,
75
- default: '_blank',
76
- },
77
- linkText: {
78
- type: String,
79
- default: 'Learn more',
80
- },
81
- type: {
82
- type: String,
83
- default: 'info',
84
- },
85
- },
86
- methods: {
87
- getIconType(type) {
88
- if (type === 'danger') return 'block';
89
- if (!type.trim()) return 'info'; // check if type is empty or whitespace
90
- return type;
91
- },
92
- isShowTextIcon(type) {
93
- return ['danger', 'warning', 'info', ''].includes(type);
94
- },
95
- emitClose() {
96
- this.onClose();
97
-
98
- this.$emit('close');
99
- },
100
- },
101
- };
102
- </script>
103
-
104
- <style lang="scss" scoped>
105
- @use '@/assets/scss/unnnic' as *;
106
-
107
- .banner-alert {
108
- display: grid;
109
- grid-template-columns: 1fr auto;
110
- text-align: center;
111
- margin-bottom: $unnnic-spacing-sm;
112
-
113
- color: $unnnic-color-neutral-white;
114
- font-family: $unnnic-font-family-secondary;
115
- font-size: $unnnic-font-size-body-gt;
116
- line-height: $unnnic-font-size-body-gt + $unnnic-line-height-md;
117
- font-weight: $unnnic-font-weight-regular;
118
- background-color: $unnnic-color-aux-blue-500;
119
-
120
- &__container-text {
121
- display: flex;
122
- justify-content: center;
123
- align-items: center;
124
- padding: $unnnic-spacing-xs $unnnic-spacing-sm;
125
- flex-grow: 1;
126
-
127
- .text {
128
- margin: 0 $unnnic-spacing-nano 0 0;
129
- }
130
- }
131
-
132
- &__textIcon {
133
- margin-right: $unnnic-spacing-xs;
134
- }
135
-
136
- &__link {
137
- color: inherit;
138
- display: block;
139
- font-weight: $unnnic-font-weight-bold;
140
- text-decoration: underline;
141
- text-underline-position: under;
142
- }
143
-
144
- &__close {
145
- display: flex;
146
- align-items: center;
147
- max-height: 38px;
148
- padding: 0 $unnnic-spacing-sm;
149
- cursor: pointer;
150
- user-select: none;
151
- border-left: $unnnic-border-width-thinner solid $unnnic-color-aux-blue-300;
152
- &:hover {
153
- background-color: $unnnic-color-aux-blue-300;
154
- }
155
- }
156
-
157
- &--banner-warning {
158
- background-color: $unnnic-color-aux-orange-500;
159
-
160
- .banner-alert__close {
161
- border-left: $unnnic-border-width-thinner solid
162
- $unnnic-color-aux-orange-300;
163
-
164
- &:hover {
165
- background-color: $unnnic-color-aux-orange-300;
166
- }
167
- }
168
- }
169
-
170
- &--banner-danger {
171
- background-color: $unnnic-color-aux-red-500;
172
-
173
- .banner-alert__close {
174
- border-left: $unnnic-border-width-thinner solid $unnnic-color-aux-red-300;
175
-
176
- &:hover {
177
- background-color: $unnnic-color-aux-red-300;
178
- }
179
- }
180
- }
181
- }
182
- </style>
@@ -1,49 +0,0 @@
1
- <template>
2
- <button @click="callAlert">Launch alert</button>
3
- </template>
4
-
5
- <script>
6
- import alert from '../../utils/call';
7
-
8
- export default {
9
- props: {
10
- title: {
11
- type: String,
12
- default: null,
13
- },
14
- text: {
15
- type: String,
16
- default: null,
17
- },
18
- icon: {
19
- type: String,
20
- default: null,
21
- },
22
- enabled: {
23
- type: Boolean,
24
- default: true,
25
- },
26
- scheme: {
27
- type: String,
28
- default: null,
29
- },
30
- seconds: {
31
- type: Number,
32
- default: 3,
33
- },
34
- closeText: {
35
- type: String,
36
- default: null,
37
- },
38
- position: {
39
- type: String,
40
- default: 'top-right',
41
- },
42
- },
43
- methods: {
44
- callAlert() {
45
- alert.callAlert({ props: this.$props, seconds: this.seconds });
46
- },
47
- },
48
- };
49
- </script>