@weni/unnnic-system 3.2.5 → 3.2.7-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.
- package/CHANGELOG.md +16 -0
- package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
- package/dist/components/Alert/Alert.vue.d.ts +5 -5
- package/dist/components/Alert/Version1dot1.vue.d.ts +2 -2
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +3 -3
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +2 -2
- package/dist/components/Banner/Banner.vue.d.ts +1 -1
- package/dist/components/Banner/InfoBanner.vue.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +2 -2
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/ButtonIcon.vue.d.ts +1 -1
- package/dist/components/Button/types.d.ts +1 -1
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/AccountCard.vue.d.ts +3 -3
- package/dist/components/Card/BlankCard.vue.d.ts +1 -1
- package/dist/components/Card/Card.vue.d.ts +20 -20
- package/dist/components/Card/CardCompany.vue.d.ts +7 -7
- package/dist/components/Card/CardData.vue.d.ts +1 -1
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +3 -3
- package/dist/components/Card/ContentCard.vue.d.ts +2 -2
- package/dist/components/Card/DashCard.vue.d.ts +4 -4
- package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
- package/dist/components/Card/MarketplaceCard.vue.d.ts +2 -2
- package/dist/components/Card/SimpleCard.vue.d.ts +2 -2
- package/dist/components/Card/StatusCard.vue.d.ts +2 -2
- package/dist/components/Card/TitleCard.vue.d.ts +1 -1
- package/dist/components/CardImage/CardImage.vue.d.ts +16 -7
- package/dist/components/CardInformation/CardInformation.vue.d.ts +3 -3
- package/dist/components/CardProject/CardProject.vue.d.ts +11 -2
- package/dist/components/Carousel/Carousel.vue.d.ts +10 -10
- package/dist/components/Carousel/TagCarousel.vue.d.ts +8 -8
- package/dist/components/ChartBar/ChartBar.vue.d.ts +7 -7
- package/dist/components/ChatText/ChatText.vue.d.ts +1 -1
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +14 -14
- package/dist/components/ChatsDashboardTagLive/ChatsDashboardTagLive.vue.d.ts +1 -1
- package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts +1 -1
- package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts.map +1 -1
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +4 -4
- package/dist/components/ChatsMessage/ChatsMessageStatusBackdrop.vue.d.ts +2 -2
- package/dist/components/ChatsNavbar/ChatsNavbar.vue.d.ts +1 -1
- package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
- package/dist/components/Comment/Comment.vue.d.ts +1 -1
- package/dist/components/DataArea/DataArea.vue.d.ts +1 -1
- package/dist/components/DataTable/index.vue.d.ts +3 -1
- package/dist/components/DataTable/index.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +182 -27
- package/dist/components/DatePicker/DatePicker.vue.d.ts +8 -8
- package/dist/components/Drawer/Drawer.vue.d.ts +7 -7
- package/dist/components/DropArea/DropArea.vue.d.ts +2 -0
- package/dist/components/DropArea/DropArea.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +9 -0
- package/dist/components/Dropdown/LanguageSelect.vue.d.ts +3 -3
- package/dist/components/Flag.vue.d.ts +2 -2
- package/dist/components/FormElement/FormElement.vue.d.ts +38 -32
- package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
- package/dist/components/Icon.vue.d.ts +1 -1
- package/dist/components/IconLoading/IconLoading.vue.d.ts +1 -1
- package/dist/components/ImportCard/ImportCard.vue.d.ts +7 -7
- package/dist/components/Input/BaseInput.vue.d.ts +10 -1
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +182 -27
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +31 -13
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +192 -37
- package/dist/components/InputNext/InputNext.vue.d.ts +3 -3
- package/dist/components/Modal/Modal.vue.d.ts +2 -2
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +10 -10
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +189 -34
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +20 -14
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +7 -7
- package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +2 -2
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +45 -26
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +7 -7
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +4 -4
- package/dist/components/SelectTime/index.vue.d.ts +31 -13
- package/dist/components/Slider/Slider.vue.d.ts +1 -1
- package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
- package/dist/components/Switch/Switch.vue.d.ts +2 -2
- package/dist/components/Tab/Tab.vue.d.ts +1 -1
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
- package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
- package/dist/components/Tag/BrandTag.vue.d.ts +2 -2
- package/dist/components/Tag/DefaultTag.vue.d.ts +2 -2
- package/dist/components/Tag/IndicatorTag.vue.d.ts +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +7 -7
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts +9 -0
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +1 -0
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts +15 -0
- package/dist/components/TemplatePreview/TemplatePreviewModal.vue.d.ts.map +1 -0
- package/dist/components/TextArea/TextArea.vue.d.ts +38 -32
- package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
- package/dist/components/Tour/Tour.vue.d.ts +6 -6
- package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
- package/dist/components/UploadArea/UploadArea.vue.d.ts +13 -7
- package/dist/components/index.d.ts +2071 -767
- package/dist/components/index.d.ts.map +1 -1
- package/dist/{es-a07e7553.mjs → es-a147ef18.mjs} +1 -1
- package/dist/{index-93aafec9.mjs → index-802ab669.mjs} +8035 -7832
- package/dist/{pt-br-a81c613f.mjs → pt-br-cdc64aa4.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +123 -119
- package/dist/unnnic.umd.js +42 -41
- package/package.json +2 -2
- package/src/assets/img/previews/doc-preview.png +0 -0
- package/src/assets/img/previews/image-preview.png +0 -0
- package/src/assets/img/previews/video-preview.png +0 -0
- package/src/components/Button/Button.vue +57 -108
- package/src/components/Button/types.ts +0 -1
- package/src/components/DataTable/index.vue +26 -14
- package/src/components/DropArea/DropArea.vue +26 -2
- package/src/components/Dropdown/Dropdown.vue +6 -0
- package/src/components/Dropdown/__tests__/Dropdown.spec.js +57 -0
- package/src/components/FormElement/FormElement.vue +50 -90
- package/src/components/Input/BaseInput.vue +10 -12
- package/src/components/Input/Input.scss +17 -20
- package/src/components/Input/Input.vue +86 -28
- package/src/components/Input/TextInput.vue +27 -35
- package/src/components/Input/__test__/TextInput.spec.js +5 -5
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +12 -3
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
- package/src/components/ModalDialog/ModalDialog.vue +27 -29
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -1
- package/src/components/SelectSmart/SelectSmart.vue +3 -1
- package/src/components/SelectSmart/__tests__/SelectSmart.spec.js +45 -0
- package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +2 -2
- package/src/components/TableNext/__test__/__snapshots__/TablePagination.spec.js.snap +2 -2
- package/src/components/TemplatePreview/TemplatePreview.vue +249 -0
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +51 -0
- package/src/components/TemplatePreview/types.d.ts +16 -0
- package/src/components/TextArea/TextArea.vue +14 -9
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +7 -2
- package/src/components/index.ts +11 -3
- package/src/stories/Button.stories.js +1 -10
- package/src/stories/DataTable.stories.js +2 -2
- package/src/stories/Input.stories.js +17 -3
- package/src/stories/TemplatePreview.stories.js +94 -0
- package/src/stories/TemplatePreviewModal.stories.js +110 -0
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
:disabled="disabled"
|
|
19
19
|
:value="modelValue"
|
|
20
20
|
@input="$emit('update:modelValue', fullySanitize($event.target.value))"
|
|
21
|
-
|
|
21
|
+
/>
|
|
22
22
|
|
|
23
23
|
<template
|
|
24
24
|
v-if="maxLength"
|
|
25
25
|
#rightMessage
|
|
26
|
-
>{{ modelValue.length }}/{{ maxLength }}</template
|
|
27
26
|
>
|
|
27
|
+
{{ modelValue.length }}/{{ maxLength }}
|
|
28
|
+
</template>
|
|
28
29
|
</UnnnicFormElement>
|
|
29
30
|
</template>
|
|
30
31
|
|
|
@@ -96,6 +97,12 @@ export default {
|
|
|
96
97
|
@use '@/assets/scss/unnnic' as *;
|
|
97
98
|
@use '@/components/Input/Input' as *;
|
|
98
99
|
|
|
100
|
+
* {
|
|
101
|
+
margin: 0;
|
|
102
|
+
padding: 0;
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
.unnnic-text-area {
|
|
100
107
|
&__textarea {
|
|
101
108
|
@include input-base;
|
|
@@ -103,24 +110,22 @@ export default {
|
|
|
103
110
|
display: block;
|
|
104
111
|
width: 100%;
|
|
105
112
|
resize: vertical;
|
|
106
|
-
box-sizing: border-box;
|
|
107
113
|
|
|
108
114
|
scrollbar-width: thin;
|
|
109
115
|
|
|
116
|
+
padding: $unnnic-space-3 $unnnic-space-4;
|
|
117
|
+
|
|
110
118
|
&--size-md {
|
|
111
119
|
@include input-md-font;
|
|
112
120
|
|
|
113
|
-
min-height:
|
|
114
|
-
|
|
115
|
-
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
121
|
+
min-height: 100px;
|
|
122
|
+
|
|
116
123
|
}
|
|
117
124
|
|
|
118
125
|
&--size-sm {
|
|
119
126
|
@include input-sm-font;
|
|
120
127
|
|
|
121
|
-
min-height:
|
|
122
|
-
padding: ($unnnic-spacing-xs)
|
|
123
|
-
($unnnic-spacing-sm - $unnnic-border-width-thinner);
|
|
128
|
+
min-height: $unnnic-space-20;
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
&.unnnic-text-area__textarea--type-error {
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
exports[`TextArea.vue > matches the snapshot 1`] = `
|
|
4
4
|
"<section data-v-9f8d6c86="" data-v-735b3c51="" class="unnnic-form-element">
|
|
5
5
|
<p data-v-9f8d6c86="" class="unnnic-form-element__label">Description</p><textarea data-v-735b3c51="" class="unnnic-text-area__textarea unnnic-text-area__textarea--size-md unnnic-text-area__textarea--type-normal" placeholder="Enter text" maxlength="200" value=""></textarea>
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
<section data-v-9f8d6c86="" class="unnnic-form-element__hints-container">
|
|
7
|
+
<section data-v-9f8d6c86="" class="unnnic-form-element__message-container">
|
|
8
|
+
<!--v-if-->
|
|
9
|
+
<!--v-if-->
|
|
10
|
+
</section>
|
|
11
|
+
<p data-v-9f8d6c86="">0/200</p>
|
|
12
|
+
</section>
|
|
8
13
|
</section>"
|
|
9
14
|
`;
|
package/src/components/index.ts
CHANGED
|
@@ -88,7 +88,9 @@ 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
|
|
91
|
+
import TemplatePreview from "./TemplatePreview/TemplatePreview.vue";
|
|
92
|
+
import TemplatePreviewModal from "./TemplatePreview/TemplatePreviewModal.vue";
|
|
93
|
+
import DataTable from './DataTable/index.vue';
|
|
92
94
|
import Chip from "./Chip/Chip.vue";
|
|
93
95
|
|
|
94
96
|
type VueComponent = Component;
|
|
@@ -188,6 +190,8 @@ export const components: ComponentsMap = {
|
|
|
188
190
|
unnnicTour: Tour,
|
|
189
191
|
unnnicNavigator: Navigator,
|
|
190
192
|
unnnicSelectTime: SelectTime,
|
|
193
|
+
unnnicTemplatePreview: TemplatePreview,
|
|
194
|
+
unnnicTemplatePreviewModal: TemplatePreviewModal,
|
|
191
195
|
unnnicDataTable: DataTable,
|
|
192
196
|
unnnicChip: Chip,
|
|
193
197
|
};
|
|
@@ -282,8 +286,10 @@ export const unnnicDrawer = Drawer;
|
|
|
282
286
|
export const unnnicTableNext = TableNext;
|
|
283
287
|
export const unnnicTour = Tour;
|
|
284
288
|
export const unnnicNavigator = Navigator;
|
|
285
|
-
export const unnnicDataTable = DataTable as VueComponent;
|
|
286
289
|
export const unnnicSelectTime = SelectTime as VueComponent;
|
|
290
|
+
export const unnnicTemplatePreview = TemplatePreview as VueComponent;
|
|
291
|
+
export const unnnicTemplatePreviewModal = TemplatePreviewModal as VueComponent;
|
|
292
|
+
export const unnnicDataTable = DataTable as VueComponent;
|
|
287
293
|
export const unnnicChip = Chip;
|
|
288
294
|
|
|
289
295
|
export const UnnnicFontSize = fontSize;
|
|
@@ -376,6 +382,8 @@ export const UnnnicDrawer = Drawer;
|
|
|
376
382
|
export const UnnnicTableNext = TableNext;
|
|
377
383
|
export const UnnnicTour = Tour;
|
|
378
384
|
export const UnnnicNavigator = Navigator;
|
|
379
|
-
export const UnnnicDataTable = DataTable as VueComponent;
|
|
380
385
|
export const UnnnicSelectTime = SelectTime as VueComponent;
|
|
386
|
+
export const UnnnicTemplatePreview = TemplatePreview as VueComponent;
|
|
387
|
+
export const UnnnicTemplatePreviewModal = TemplatePreviewModal as VueComponent;
|
|
388
|
+
export const UnnnicDataTable = DataTable as VueComponent;
|
|
381
389
|
export const UnnnicChip = Chip;
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
description: {
|
|
9
9
|
component: `Allows users to perform an action or navigate to another page.
|
|
10
10
|
It has styles for various needs and are ideal for directing the user's attention.
|
|
11
|
-
It is divided into
|
|
11
|
+
It is divided into 5 types: Primary, Secondary, Tertiary, Warning, Attention.
|
|
12
12
|
Each of these types has its states.
|
|
13
13
|
<br/>
|
|
14
14
|
<br/>
|
|
@@ -40,7 +40,6 @@ export default {
|
|
|
40
40
|
'primary',
|
|
41
41
|
'secondary',
|
|
42
42
|
'tertiary',
|
|
43
|
-
'alternative',
|
|
44
43
|
'warning',
|
|
45
44
|
'attention',
|
|
46
45
|
],
|
|
@@ -114,14 +113,6 @@ export const OnlyIcon = {
|
|
|
114
113
|
},
|
|
115
114
|
};
|
|
116
115
|
|
|
117
|
-
export const Alternative = {
|
|
118
|
-
args: {
|
|
119
|
-
type: 'alternative',
|
|
120
|
-
iconLeft: 'add',
|
|
121
|
-
text: 'Text',
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
|
|
125
116
|
export const Warning = {
|
|
126
117
|
parameters: {
|
|
127
118
|
docs: {
|
|
@@ -76,8 +76,8 @@ export default {
|
|
|
76
76
|
UnnnicDataTable,
|
|
77
77
|
},
|
|
78
78
|
setup() {
|
|
79
|
-
const sort = ({ order, header }) => {
|
|
80
|
-
action('update:sort')({ order, header });
|
|
79
|
+
const sort = ({ order, header, itemKey }) => {
|
|
80
|
+
action('update:sort')({ order, header, itemKey });
|
|
81
81
|
if (order === 'asc')
|
|
82
82
|
args.items = args.items.sort((a, b) => a.id - b.id);
|
|
83
83
|
if (order === 'desc')
|
|
@@ -35,9 +35,7 @@ export default {
|
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
template: `
|
|
38
|
-
|
|
39
|
-
<unnnic-input v-model="value" @icon-right-click="click" v-bind="args" />
|
|
40
|
-
</unnnic-form-element>
|
|
38
|
+
<unnnic-input v-model="value" @icon-right-click="click" v-bind="args" label="Label" />
|
|
41
39
|
`,
|
|
42
40
|
}),
|
|
43
41
|
};
|
|
@@ -156,4 +154,20 @@ export const Mask = {
|
|
|
156
154
|
placeholder: 'Text',
|
|
157
155
|
mask: ['###.###.###-##', '##.###.###/####-##'],
|
|
158
156
|
},
|
|
157
|
+
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const LimitMaxLength = {
|
|
161
|
+
args: {
|
|
162
|
+
placeholder: 'Text',
|
|
163
|
+
maxlength: 10,
|
|
164
|
+
showMaxlengthCounter: true,
|
|
165
|
+
},
|
|
159
166
|
};
|
|
167
|
+
|
|
168
|
+
export const WithTooltip = {
|
|
169
|
+
args: {
|
|
170
|
+
placeholder: 'Text',
|
|
171
|
+
tooltip: 'Tooltip',
|
|
172
|
+
},
|
|
173
|
+
};
|
|
@@ -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
|
+
};
|