@weni/unnnic-system 3.1.1 → 3.1.2-alpha.2

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 (33) hide show
  1. package/dist/components/DatePicker/DatePicker.vue.d.ts +2 -2
  2. package/dist/components/DropArea/DropArea.vue.d.ts +2 -0
  3. package/dist/components/DropArea/DropArea.vue.d.ts.map +1 -1
  4. package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +3 -3
  5. package/dist/components/ModalDialog/ModalDialog.vue.d.ts +1 -1
  6. package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
  7. package/dist/components/ModalUpload/ModalUpload.vue.d.ts +6 -0
  8. package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts +9 -0
  9. package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +1 -0
  10. package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +15 -0
  11. package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts.map +1 -0
  12. package/dist/components/UploadArea/UploadArea.vue.d.ts +6 -0
  13. package/dist/{es-b95265ef.mjs → es-447c22a1.mjs} +1 -1
  14. package/dist/{index-d6c4fffb.mjs → index-7ff7db46.mjs} +9268 -9108
  15. package/dist/{pt-br-80b6b07a.mjs → pt-br-b9850dfb.mjs} +1 -1
  16. package/dist/style.css +1 -1
  17. package/dist/unnnic.mjs +26 -24
  18. package/dist/unnnic.umd.js +44 -43
  19. package/package.json +2 -2
  20. package/src/assets/img/previews/doc-preview.png +0 -0
  21. package/src/assets/img/previews/image-preview.png +0 -0
  22. package/src/assets/img/previews/video-preview.png +0 -0
  23. package/src/components/DropArea/DropArea.vue +26 -2
  24. package/src/components/ModalDialog/ModalDialog.vue +27 -29
  25. package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -1
  26. package/src/components/TemplatePreview/TemplatePreview.vue +249 -0
  27. package/src/components/TemplatePreview/TemplatePreviewModal.vue +51 -0
  28. package/src/components/TemplatePreview/types.d.ts +16 -0
  29. package/src/components/index.ts +8 -2
  30. package/src/stories/TemplatePreview.stories.js +94 -0
  31. package/src/stories/TemplatePreviewModal.stories.js +110 -0
  32. package/dist/components/index.d.ts +0 -40344
  33. package/dist/components/index.d.ts.map +0 -1
@@ -0,0 +1,94 @@
1
+ import UnnnicTemplatePreview from "../components/TemplatePreview/TemplatePreview.vue";
2
+
3
+ export default {
4
+ title: "example/TemplatePreview",
5
+ tags: ["autodocs"],
6
+ component: UnnnicTemplatePreview,
7
+ };
8
+
9
+ const Template = (args) => ({
10
+ components: { UnnnicTemplatePreview },
11
+ setup() {
12
+ return { args };
13
+ },
14
+ template: `
15
+ <unnnic-template-preview v-bind="args" />
16
+ `,
17
+ });
18
+
19
+ const bodyText =
20
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sem orci, ultrices id lectus non, vehicula suscipit libero. Ut vehicula libero a tempus fringilla. Nam tincidunt vestibulum maximus. Morbi vel pretium risus. Curabitur id quam lectus. Quisque dolor elit, auctor a lacus non, rutrum ullamcorper mi. Nulla et turpis sed eros pharetra ullamcorper fermentum ac nisl. Donec lacinia hendrerit tellus, sit amet suscipit velit vestibulum sed. Praesent gravida posuere metus, ut fringilla dolor euismod vel. Aenean vel ipsum magna. Integer metus mi, fermentum ut nulla at, facilisis lobortis metus. Ut vitae tortor posuere, dapibus leo quis, finibus neque.";
21
+
22
+ export const Default = Template.bind({});
23
+ Default.args = {
24
+ template: {
25
+ header: {
26
+ type: "TEXT",
27
+ text: "Hello, world!",
28
+ },
29
+ footer: "Weni by VTEX",
30
+ buttons: [
31
+ {
32
+ text: "Button 1",
33
+ type: "PHONE_NUMBER",
34
+ },
35
+ {
36
+ text: "Button 2",
37
+ type: "URL",
38
+ },
39
+ {
40
+ text: "Button 3",
41
+ type: "QUICK_REPLY",
42
+ },
43
+ ],
44
+ body: bodyText,
45
+ },
46
+ };
47
+
48
+ export const Image = Template.bind({});
49
+ Image.args = {
50
+ template: {
51
+ header: {
52
+ type: "MEDIA",
53
+ mediaType: "IMAGE",
54
+ },
55
+ footer: "Weni by VTEX",
56
+ body: bodyText,
57
+ },
58
+ };
59
+
60
+ export const Video = Template.bind({});
61
+ Video.args = {
62
+ template: {
63
+ header: {
64
+ type: "MEDIA",
65
+ mediaType: "VIDEO",
66
+ },
67
+ buttons: [
68
+ {
69
+ text: "Button 1",
70
+ type: "PHONE_NUMBER",
71
+ },
72
+ {
73
+ text: "Button 2",
74
+ type: "URL",
75
+ },
76
+ {
77
+ text: "Button 3",
78
+ type: "QUICK_REPLY",
79
+ },
80
+ ],
81
+ },
82
+ };
83
+
84
+ export const Document = Template.bind({});
85
+ Document.args = {
86
+ template: {
87
+ header: {
88
+ type: "MEDIA",
89
+ mediaType: "DOCUMENT",
90
+ },
91
+ footer: "Weni by VTEX",
92
+ body: bodyText,
93
+ },
94
+ };
@@ -0,0 +1,110 @@
1
+ import UnnnicTemplatePreviewModal from "../components/TemplatePreview/TemplatePreviewModal.vue";
2
+
3
+ import { action } from "@storybook/addon-actions";
4
+
5
+ export default {
6
+ title: "example/TemplatePreviewModal",
7
+ tags: ["autodocs"],
8
+ component: UnnnicTemplatePreviewModal,
9
+ argTypes: {
10
+ locale: {
11
+ control: { type: "select" },
12
+ options: ["pt-br", "en", "es"],
13
+ },
14
+ },
15
+ };
16
+
17
+ const Template = (args) => ({
18
+ components: { UnnnicTemplatePreviewModal },
19
+ setup() {
20
+ const close = () => {
21
+ action("close")();
22
+ args.modelValue = false;
23
+ };
24
+ return { args, close };
25
+ },
26
+ template: `
27
+ <div>
28
+ <button @click="args.modelValue = true">Open Modal</button>
29
+ <unnnic-template-preview-modal v-bind="args" @close="close" />
30
+ </div>
31
+ `,
32
+ });
33
+
34
+ const bodyText =
35
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sem orci, ultrices id lectus non, vehicula suscipit libero. Ut vehicula libero a tempus fringilla. Nam tincidunt vestibulum maximus. Morbi vel pretium risus. Curabitur id quam lectus. Quisque dolor elit, auctor a lacus non, rutrum ullamcorper mi. Nulla et turpis sed eros pharetra ullamcorper fermentum ac nisl. Donec lacinia hendrerit tellus, sit amet suscipit velit vestibulum sed. Praesent gravida posuere metus, ut fringilla dolor euismod vel. Aenean vel ipsum magna. Integer metus mi, fermentum ut nulla at, facilisis lobortis metus. Ut vitae tortor posuere, dapibus leo quis, finibus neque.";
36
+
37
+ export const Default = Template.bind({});
38
+ Default.args = {
39
+ modelValue: false,
40
+ template: {
41
+ header: {
42
+ type: "TEXT",
43
+ text: "Hello, world!",
44
+ },
45
+ footer: "Weni by VTEX",
46
+ buttons: [
47
+ {
48
+ text: "Button 1",
49
+ type: "PHONE_NUMBER",
50
+ },
51
+ {
52
+ text: "Button 2",
53
+ type: "URL",
54
+ },
55
+ {
56
+ text: "Button 3",
57
+ type: "QUICK_REPLY",
58
+ },
59
+ ],
60
+ body: bodyText,
61
+ },
62
+ };
63
+
64
+ export const Image = Template.bind({});
65
+ Image.args = {
66
+ template: {
67
+ header: {
68
+ type: "MEDIA",
69
+ mediaType: "IMAGE",
70
+ },
71
+ footer: "Weni by VTEX",
72
+ body: bodyText,
73
+ },
74
+ };
75
+
76
+ export const Video = Template.bind({});
77
+ Video.args = {
78
+ template: {
79
+ header: {
80
+ type: "MEDIA",
81
+ mediaType: "VIDEO",
82
+ },
83
+ buttons: [
84
+ {
85
+ text: "Button 1",
86
+ type: "PHONE_NUMBER",
87
+ },
88
+ {
89
+ text: "Button 2",
90
+ type: "URL",
91
+ },
92
+ {
93
+ text: "Button 3",
94
+ type: "QUICK_REPLY",
95
+ },
96
+ ],
97
+ },
98
+ };
99
+
100
+ export const Document = Template.bind({});
101
+ Document.args = {
102
+ template: {
103
+ header: {
104
+ type: "MEDIA",
105
+ mediaType: "DOCUMENT",
106
+ },
107
+ footer: "Weni by VTEX",
108
+ body: bodyText,
109
+ },
110
+ };