@weni/unnnic-system 3.1.4-alpha.2 → 3.1.4

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 (43) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/components/DatePicker/DatePicker.vue.d.ts +2 -2
  3. package/dist/components/DropArea/DropArea.vue.d.ts +0 -2
  4. package/dist/components/DropArea/DropArea.vue.d.ts.map +1 -1
  5. package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts.map +1 -1
  6. package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +3 -3
  7. package/dist/components/ModalDialog/ModalDialog.vue.d.ts +1 -1
  8. package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
  9. package/dist/components/ModalUpload/ModalUpload.vue.d.ts +0 -6
  10. package/dist/components/UploadArea/UploadArea.vue.d.ts +0 -6
  11. package/dist/components/index.d.ts +18063 -0
  12. package/dist/components/index.d.ts.map +1 -0
  13. package/dist/{es-95712fb0.mjs → es-a17d2e50.mjs} +1 -1
  14. package/dist/{index-91fded8c.mjs → index-e1869f90.mjs} +17399 -10015
  15. package/dist/locales/en.json.d.ts +1 -0
  16. package/dist/locales/es.json.d.ts +1 -0
  17. package/dist/locales/pt_br.json.d.ts +1 -0
  18. package/dist/{pt-br-4557467c.mjs → pt-br-91d596b9.mjs} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/unnnic.mjs +24 -26
  21. package/dist/unnnic.umd.js +47 -48
  22. package/package.json +1 -1
  23. package/src/components/DropArea/DropArea.vue +2 -26
  24. package/src/components/EmojiPicker/EmojiPicker.vue +8 -3
  25. package/src/components/EmojiPicker/__tests__/EmojiPicker.spec.js +7 -5
  26. package/src/components/ModalDialog/ModalDialog.vue +29 -27
  27. package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -1
  28. package/src/components/index.ts +2 -8
  29. package/src/locales/en.json +1 -0
  30. package/src/locales/es.json +1 -0
  31. package/src/locales/pt_br.json +1 -0
  32. package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts +0 -9
  33. package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +0 -1
  34. package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +0 -15
  35. package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts.map +0 -1
  36. package/src/assets/img/previews/doc-preview.png +0 -0
  37. package/src/assets/img/previews/image-preview.png +0 -0
  38. package/src/assets/img/previews/video-preview.png +0 -0
  39. package/src/components/TemplatePreview/TemplatePreview.vue +0 -249
  40. package/src/components/TemplatePreview/TemplatePreviewModal.vue +0 -51
  41. package/src/components/TemplatePreview/types.d.ts +0 -16
  42. package/src/stories/TemplatePreview.stories.js +0 -94
  43. package/src/stories/TemplatePreviewModal.stories.js +0 -110
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "3.1.4-alpha.2",
3
+ "version": "3.1.4",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -11,7 +11,7 @@
11
11
  @dragleave.stop.prevent="dragleave"
12
12
  @dragend.stop.prevent="dragend"
13
13
  @drop.stop.prevent="drop"
14
- @click="handleDropzoneClick"
14
+ @click="() => $refs.file.click()"
15
15
  >
16
16
  <UnnnicIcon
17
17
  class="unnnic-upload-area__dropzone__icon"
@@ -64,7 +64,7 @@
64
64
  </template>
65
65
 
66
66
  <script setup>
67
- import { ref, computed, getCurrentInstance, useTemplateRef } from 'vue';
67
+ import { ref, computed, getCurrentInstance } from 'vue';
68
68
  import mime from 'mime';
69
69
 
70
70
  import UnnnicIcon from '../Icon.vue';
@@ -73,7 +73,6 @@ const isDragging = ref(false);
73
73
  const hasError = ref(false);
74
74
  const dragEnterCounter = ref(0);
75
75
  const file = ref();
76
- const fileRef = useTemplateRef('file');
77
76
 
78
77
  const props = defineProps({
79
78
  acceptMultiple: {
@@ -112,11 +111,6 @@ const props = defineProps({
112
111
  type: String,
113
112
  default: '',
114
113
  },
115
-
116
- disabled: {
117
- type: Boolean,
118
- default: false,
119
- }
120
114
  });
121
115
 
122
116
  const emit = defineEmits([
@@ -141,21 +135,15 @@ const formattedSupportedFormats = computed(() => {
141
135
  });
142
136
 
143
137
  function dragenter() {
144
- if (props.disabled) return;
145
-
146
138
  dragEnterCounter.value += 1;
147
139
  isDragging.value = true;
148
140
  }
149
141
 
150
142
  function dragover() {
151
- if (props.disabled) return;
152
-
153
143
  isDragging.value = true;
154
144
  }
155
145
 
156
146
  function dragleave() {
157
- if (props.disabled) return;
158
-
159
147
  dragEnterCounter.value -= 1;
160
148
  if (dragEnterCounter.value === 0) {
161
149
  isDragging.value = false;
@@ -163,14 +151,10 @@ function dragleave() {
163
151
  }
164
152
 
165
153
  function dragend() {
166
- if (props.disabled) return;
167
-
168
154
  isDragging.value = false;
169
155
  }
170
156
 
171
157
  function drop(event) {
172
- if (props.disabled) return;
173
-
174
158
  isDragging.value = false;
175
159
 
176
160
  const { files } = event.dataTransfer;
@@ -180,15 +164,7 @@ function drop(event) {
180
164
  }
181
165
  }
182
166
 
183
- function handleDropzoneClick() {
184
- if (props.disabled) return;
185
-
186
- fileRef.value.click();
187
- }
188
-
189
167
  function handleFileChange(event) {
190
- if (props.disabled) return;
191
-
192
168
  const { files } = event.target;
193
169
 
194
170
  if (validateFiles(files)) {
@@ -9,7 +9,10 @@
9
9
  :data="emojiIndex"
10
10
  set="apple"
11
11
  theme="light"
12
- :preview="false"
12
+ emoji="point_up"
13
+ :title="title"
14
+ :showPreview="true"
15
+ showSkinTones
13
16
  :search="true"
14
17
  nav-position="bottom"
15
18
  no-results-emoji="cry"
@@ -26,7 +29,7 @@ import { computed, ref, onMounted, onUnmounted } from 'vue'
26
29
  import { get } from 'lodash'
27
30
  import i18n from '../../utils/plugins/i18n'
28
31
  import { Picker, EmojiIndex } from 'emoji-mart-vue-fast/src'
29
- import data from 'emoji-mart-vue-fast/data/apple.json'
32
+ import data from 'emoji-mart-vue-fast/data/all.json'
30
33
  import 'emoji-mart-vue-fast/css/emoji-mart.css'
31
34
  import UnnnicI18n from '../../mixins/i18n'
32
35
 
@@ -71,6 +74,8 @@ const translation = (key: string) => {
71
74
  return get(localeMsgs, key) || get(enMsgs, key) || key
72
75
  }
73
76
 
77
+ const title = computed(() => translation('emoji_picker.title'))
78
+
74
79
  const translations = computed(() => ({
75
80
  search: translation('emoji_picker.search'),
76
81
  notfound: translation('emoji_picker.notfound'),
@@ -158,7 +163,7 @@ const onEmojiSelect = (emoji: Emoji) => {
158
163
  }
159
164
 
160
165
  :deep(.emoji-type-image.emoji-set-apple) {
161
- background-image: url('/apple-64.png') !important;
166
+ background-image: url('./apple-64.png') !important;
162
167
  }
163
168
 
164
169
  :deep(.emoji-type-image.emoji-set-facebook),
@@ -12,7 +12,7 @@ vi.mock('emoji-mart-vue-fast/src', () => ({
12
12
  EmojiIndex: vi.fn().mockImplementation(() => ({}))
13
13
  }));
14
14
 
15
- vi.mock('emoji-mart-vue-fast/data/apple.json', () => ({
15
+ vi.mock('emoji-mart-vue-fast/data/all.json', () => ({
16
16
  default: {}
17
17
  }));
18
18
 
@@ -50,7 +50,7 @@ describe('UnnnicEmojiPicker', () => {
50
50
  stubs: {
51
51
  Picker: {
52
52
  name: 'Picker',
53
- props: ['data', 'set', 'theme', 'preview', 'search', 'navPosition', 'noResultsEmoji', 'maxFrequentRows', 'i18n', 'color'],
53
+ props: ['data', 'set', 'theme', 'emoji', 'title', 'showPreview', 'search', 'navPosition', 'noResultsEmoji', 'maxFrequentRows', 'i18n', 'color'],
54
54
  emits: ['select', 'click-outside'],
55
55
  template: '<div class="emoji-mart-picker" @select="$emit(\'select\', $event)" @click-outside="$emit(\'click-outside\')"></div>'
56
56
  }
@@ -69,7 +69,9 @@ describe('UnnnicEmojiPicker', () => {
69
69
  expect(picker.exists()).toBe(true);
70
70
  expect(picker.props('set')).toBe('apple');
71
71
  expect(picker.props('theme')).toBe('light');
72
- expect(picker.props('preview')).toBe(false);
72
+ expect(picker.props('emoji')).toBe('point_up');
73
+ expect(picker.props('title')).toBe('Escolha seu emoji...');
74
+ expect(picker.props('showPreview')).toBe(true);
73
75
  expect(picker.props('search')).toBe(true);
74
76
  expect(picker.props('navPosition')).toBe('bottom');
75
77
  expect(picker.props('noResultsEmoji')).toBe('cry');
@@ -94,7 +96,7 @@ describe('UnnnicEmojiPicker', () => {
94
96
  stubs: {
95
97
  Picker: {
96
98
  name: 'Picker',
97
- props: ['data', 'set', 'theme', 'preview', 'search', 'navPosition', 'noResultsEmoji', 'maxFrequentRows', 'i18n', 'color'],
99
+ props: ['data', 'set', 'theme', 'emoji', 'title', 'showPreview', 'search', 'navPosition', 'noResultsEmoji', 'maxFrequentRows', 'i18n', 'color'],
98
100
  emits: ['select', 'click-outside'],
99
101
  template: '<div class="emoji-mart-picker" @select="$emit(\'select\', $event)"></div>'
100
102
  }
@@ -131,7 +133,7 @@ describe('UnnnicEmojiPicker', () => {
131
133
  it('renders bottom position class when position is bottom', async () => {
132
134
  const custom = mount(UnnnicEmojiPicker, {
133
135
  props: { position: 'bottom' },
134
- global: { stubs: { Picker: { name: 'Picker', props: ['data','set','theme','preview','search','navPosition','noResultsEmoji','maxFrequentRows','i18n','color'], template: '<div />' } } }
136
+ global: { stubs: { Picker: { name: 'Picker', props: ['data','set','theme','emoji','title','showPreview','search','navPosition','noResultsEmoji','maxFrequentRows','i18n','color'], template: '<div />' } } }
135
137
  });
136
138
  expect(custom.classes()).toContain('emoji-picker--bottom');
137
139
  custom.unmount();
@@ -24,7 +24,10 @@
24
24
  </section>
25
25
 
26
26
  <section class="unnnic-modal-dialog__container__body">
27
- <header v-if="title" class="unnnic-modal-dialog__container__header">
27
+ <header
28
+ v-if="title"
29
+ class="unnnic-modal-dialog__container__header"
30
+ >
28
31
  <section class="unnnic-modal-dialog__container__title-container">
29
32
  <UnnnicIcon
30
33
  v-if="icon || type"
@@ -46,7 +49,6 @@
46
49
  data-testid="close-icon"
47
50
  icon="close"
48
51
  clickable
49
- scheme="neutral-cloudy"
50
52
  @click="close()"
51
53
  />
52
54
  </header>
@@ -96,12 +98,12 @@
96
98
  </template>
97
99
 
98
100
  <script>
99
- import UnnnicIcon from "../Icon.vue";
100
- import UnnnicButton from "../Button/Button.vue";
101
- import UnnnicI18n from "../../mixins/i18n";
101
+ import UnnnicIcon from '../Icon.vue';
102
+ import UnnnicButton from '../Button/Button.vue';
103
+ import UnnnicI18n from '../../mixins/i18n';
102
104
 
103
105
  export default {
104
- name: "UnnnicModalDialog",
106
+ name: 'UnnnicModalDialog',
105
107
  components: {
106
108
  UnnnicIcon,
107
109
  UnnnicButton,
@@ -118,29 +120,29 @@ export default {
118
120
  },
119
121
  type: {
120
122
  type: String,
121
- default: "",
123
+ default: '',
122
124
  validate(type) {
123
- return ["success", "warning", "attention"].includes(type);
125
+ return ['success', 'warning', 'attention'].includes(type);
124
126
  },
125
127
  },
126
128
  size: {
127
129
  type: String,
128
- default: "md",
130
+ default: 'md',
129
131
  validate(size) {
130
- return ["sm", "md", "lg"].includes(size);
132
+ return ['sm', 'md', 'lg'].includes(size);
131
133
  },
132
134
  },
133
135
  title: {
134
136
  type: String,
135
- default: "",
137
+ default: '',
136
138
  },
137
139
  icon: {
138
140
  type: String,
139
- default: "",
141
+ default: '',
140
142
  },
141
143
  iconScheme: {
142
144
  type: String,
143
- default: "",
145
+ default: '',
144
146
  },
145
147
  showCloseIcon: {
146
148
  type: Boolean,
@@ -163,26 +165,26 @@ export default {
163
165
  default: () => ({}),
164
166
  },
165
167
  },
166
- emits: ["primaryButtonClick", "secondaryButtonClick", "update:modelValue"],
168
+ emits: ['primaryButtonClick', 'secondaryButtonClick', 'update:modelValue'],
167
169
 
168
170
  data() {
169
171
  return {
170
172
  defaultTranslations: {
171
173
  cancel: {
172
- "pt-br": "Cancelar",
173
- en: "Cancel",
174
- es: "Cancelar",
174
+ 'pt-br': 'Cancelar',
175
+ en: 'Cancel',
176
+ es: 'Cancelar',
175
177
  },
176
178
  },
177
179
  iconsMapper: {
178
- success: { icon: "check_circle", scheme: "aux-green-500" },
179
- warning: { icon: "warning", scheme: "aux-red-500" },
180
- attention: { icon: "error", scheme: "aux-yellow-500" },
180
+ success: { icon: 'check_circle', scheme: 'aux-green-500' },
181
+ warning: { icon: 'warning', scheme: 'aux-red-500' },
182
+ attention: { icon: 'error', scheme: 'aux-yellow-500' },
181
183
  },
182
184
  primaryButtonTypeMapper: {
183
- success: "primary",
184
- warning: "warning",
185
- attention: "attention",
185
+ success: 'primary',
186
+ warning: 'warning',
187
+ attention: 'attention',
186
188
  },
187
189
  };
188
190
  },
@@ -193,17 +195,17 @@ export default {
193
195
  },
194
196
  methods: {
195
197
  close() {
196
- this.$emit("update:modelValue", false);
198
+ this.$emit('update:modelValue', false);
197
199
  },
198
200
  updateBodyOverflow(isHidden) {
199
- document.body.style.overflow = isHidden ? "hidden" : "";
201
+ document.body.style.overflow = isHidden ? 'hidden' : '';
200
202
  },
201
203
  },
202
204
  };
203
205
  </script>
204
206
 
205
207
  <style lang="scss" scoped>
206
- @use "@/assets/scss/unnnic" as *;
208
+ @use '@/assets/scss/unnnic' as *;
207
209
  * {
208
210
  margin: 0;
209
211
  padding: 0;
@@ -310,7 +312,7 @@ export default {
310
312
  &__actions {
311
313
  display: grid;
312
314
  grid-template-columns: 1fr 1fr;
313
- grid-template-areas: "secondary-button primary-button";
315
+ grid-template-areas: 'secondary-button primary-button';
314
316
  gap: $unnnic-spacing-sm;
315
317
  padding: $unnnic-spacing-md;
316
318
  flex-shrink: 0;
@@ -11,7 +11,7 @@ exports[`ModalDialog.vue > Elements rendering > matches the snapshot 1`] = `
11
11
  <unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="test-icon" clickable="false" size="md" scheme="neutral-darkest" data-testid="title-icon" class="unnnic-modal-dialog__container__title-icon"></unnnic-icon-stub>
12
12
  <h1 data-v-68ebadeb="" class="unnnic-modal-dialog__container__title-text" data-testid="title-text">Test Title</h1>
13
13
  </section>
14
- <unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="close" clickable="true" size="md" scheme="neutral-cloudy" data-testid="close-icon"></unnnic-icon-stub>
14
+ <unnnic-icon-stub data-v-68ebadeb="" filled="false" next="false" icon="close" clickable="true" size="md" scheme="neutral-darkest" data-testid="close-icon"></unnnic-icon-stub>
15
15
  </header>
16
16
  <section data-v-68ebadeb="" class="unnnic-modal-dialog__container__content"></section>
17
17
  <section data-v-68ebadeb="" data-testid="actions-section" class="unnnic-modal-dialog__container__actions">
@@ -88,9 +88,7 @@ import ModalDialog from "./ModalDialog/ModalDialog.vue";
88
88
  import Tour from "./Tour/Tour.vue";
89
89
  import Navigator from "./Navigator/index.vue";
90
90
  import SelectTime from "./SelectTime/index.vue";
91
- import TemplatePreview from "./TemplatePreview/TemplatePreview.vue";
92
- import TemplatePreviewModal from "./TemplatePreview/TemplatePreviewModal.vue";
93
- import DataTable from './DataTable/index.vue';
91
+ import DataTable from "./DataTable/index.vue";
94
92
 
95
93
  type VueComponent = Component;
96
94
 
@@ -189,8 +187,6 @@ export const components: ComponentsMap = {
189
187
  unnnicTour: Tour,
190
188
  unnnicNavigator: Navigator,
191
189
  unnnicSelectTime: SelectTime,
192
- unnnicTemplatePreview: TemplatePreview,
193
- unnnicTemplatePreviewModal: TemplatePreviewModal,
194
190
  unnnicDataTable: DataTable,
195
191
  };
196
192
 
@@ -284,7 +280,5 @@ export const unnnicDrawer = Drawer;
284
280
  export const unnnicTableNext = TableNext;
285
281
  export const unnnicTour = Tour;
286
282
  export const unnnicNavigator = Navigator;
283
+ export const unnnicDataTable = DataTable as VueComponent;
287
284
  export const unnnicSelectTime = SelectTime as VueComponent;
288
- export const unnnicTemplatePreview = TemplatePreview as VueComponent;
289
- export const unnnicTemplatePreviewModal = TemplatePreviewModal as VueComponent;
290
- export const unnnicDataTable = DataTable;
@@ -24,6 +24,7 @@
24
24
  }
25
25
  },
26
26
  "emoji_picker": {
27
+ "title": "Pick your emoji...",
27
28
  "search": "Search",
28
29
  "notfound": "No Emoji Found",
29
30
  "categories": {
@@ -24,6 +24,7 @@
24
24
  }
25
25
  },
26
26
  "emoji_picker": {
27
+ "title": "Elige tu emoji...",
27
28
  "search": "Buscar",
28
29
  "notfound": "No se encontró ningún emoji",
29
30
  "categories": {
@@ -24,6 +24,7 @@
24
24
  }
25
25
  },
26
26
  "emoji_picker": {
27
+ "title": "Escolha seu emoji...",
27
28
  "search": "Buscar",
28
29
  "notfound": "Nenhum emoji encontrado",
29
30
  "categories": {
@@ -1,9 +0,0 @@
1
- import { Template } from './types';
2
- interface Props {
3
- template?: Template | null;
4
- }
5
- declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
6
- template: Template | null;
7
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
8
- export default _default;
9
- //# sourceMappingURL=TemplatePreview.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TemplatePreview.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TemplatePreview/TemplatePreview.vue"],"names":[],"mappings":"AAgGA;AA6PA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQxC,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC5B;;cADY,QAAQ,GAAG,IAAI;;AAkN5B,wBAQG"}
@@ -1,15 +0,0 @@
1
- import { Template } from './types';
2
- interface Props {
3
- locale?: string;
4
- template: Template;
5
- modelValue: boolean;
6
- }
7
- declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
- close: () => any;
9
- }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
10
- onClose?: (() => any) | undefined;
11
- }>, {
12
- locale: string;
13
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
14
- export default _default;
15
- //# sourceMappingURL=TemplatePreviewModal.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TemplatePreviewModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TemplatePreview/TemplatePreviewModal.vue"],"names":[],"mappings":"AAWA;AAwDA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUxC,UAAU,KAAK;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB;;;;;;YAHU,MAAM;;AAgGjB,wBASG"}