@weni/unnnic-system 3.14.0-alpha-teleports.0 → 3.14.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/README.md +1 -9
- package/dist/{es-0d53b5b2.mjs → es-91ae9eed.mjs} +1 -1
- package/dist/{index-d7070de8.mjs → index-3b503557.mjs} +26122 -28965
- package/dist/index.d.ts +1485 -4826
- package/dist/{pt-br-bf4e1f97.mjs → pt-br-9553a558.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +204 -232
- package/dist/unnnic.umd.js +44 -48
- package/package.json +2 -3
- package/src/assets/scss/tailwind.scss +0 -8
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
- package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +1 -2
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +60 -61
- package/src/components/CheckboxGroup/CheckboxGroup.vue +7 -5
- package/src/components/Chip/Chip.vue +1 -1
- package/src/components/DatePicker/DatePicker.vue +1 -10
- package/src/components/Drawer/Drawer.vue +270 -180
- package/src/components/Drawer/__tests__/Drawer.spec.js +43 -32
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
- package/src/components/FormElement/FormElement.vue +96 -87
- package/src/components/InputDatePicker/InputDatePicker.vue +73 -68
- package/src/components/InputDatePicker/__test__/InputDatePicker.spec.js +24 -31
- package/src/components/ModalDialog/ModalDialog.vue +154 -63
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +210 -30
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
- package/src/components/Radio/Radio.vue +12 -6
- package/src/components/Radio/__test__/Radio.spec.js +3 -1
- package/src/components/RadioGroup/RadioGroup.vue +18 -10
- package/src/components/Select/__tests__/SelectItem.spec.js +35 -15
- package/src/components/Switch/Switch.vue +10 -3
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
- package/src/components/TemplatePreview/TemplatePreview.vue +28 -25
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +10 -10
- package/src/components/TemplatePreview/types.d.ts +3 -3
- package/src/components/Toast/Toast.vue +1 -4
- package/src/components/Toast/ToastManager.ts +1 -4
- package/src/components/Toast/__tests__/ToastManager.spec.js +6 -10
- package/src/components/ToolTip/ToolTip.vue +177 -25
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -339
- package/src/components/index.ts +0 -56
- package/src/components/ui/popover/PopoverContent.vue +4 -7
- package/src/components/ui/popover/PopoverTrigger.vue +1 -5
- package/src/index.ts +2 -9
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/ModalDialog.mdx +0 -3
- package/src/stories/ModalDialog.stories.js +1 -96
- package/src/stories/TemplatePreview.stories.js +27 -27
- package/src/stories/TemplatePreviewModal.stories.js +31 -31
- package/src/components/ui/dialog/Dialog.vue +0 -19
- package/src/components/ui/dialog/DialogClose.vue +0 -29
- package/src/components/ui/dialog/DialogContent.vue +0 -140
- package/src/components/ui/dialog/DialogFooter.vue +0 -50
- package/src/components/ui/dialog/DialogHeader.vue +0 -83
- package/src/components/ui/dialog/DialogTitle.vue +0 -38
- package/src/components/ui/dialog/DialogTrigger.vue +0 -16
- package/src/components/ui/dialog/index.ts +0 -7
- package/src/components/ui/drawer/Drawer.vue +0 -27
- package/src/components/ui/drawer/DrawerClose.vue +0 -31
- package/src/components/ui/drawer/DrawerContent.vue +0 -113
- package/src/components/ui/drawer/DrawerDescription.vue +0 -40
- package/src/components/ui/drawer/DrawerFooter.vue +0 -38
- package/src/components/ui/drawer/DrawerHeader.vue +0 -57
- package/src/components/ui/drawer/DrawerOverlay.vue +0 -33
- package/src/components/ui/drawer/DrawerTitle.vue +0 -37
- package/src/components/ui/drawer/DrawerTrigger.vue +0 -31
- package/src/components/ui/drawer/index.ts +0 -10
- package/src/components/ui/tooltip/Tooltip.vue +0 -21
- package/src/components/ui/tooltip/TooltipContent.vue +0 -77
- package/src/components/ui/tooltip/TooltipTrigger.vue +0 -24
- package/src/components/ui/tooltip/index.ts +0 -3
- package/src/lib/__tests__/teleport-target.spec.ts +0 -73
- package/src/lib/layer-manager.ts +0 -64
- package/src/lib/teleport-target.ts +0 -46
- package/src/stories/Dialog.stories.js +0 -832
- package/src/stories/DrawerNext.stories.js +0 -611
- package/src/stories/LayerManager.docs.mdx +0 -40
- package/src/stories/LayerManager.stories.js +0 -407
package/src/components/index.ts
CHANGED
|
@@ -112,20 +112,6 @@ import {
|
|
|
112
112
|
SegmentedControlContent,
|
|
113
113
|
} from './ui/segmented-control';
|
|
114
114
|
import PageHeader from './PageHeader/PageHeader.vue';
|
|
115
|
-
import Dialog from './ui/dialog/Dialog.vue';
|
|
116
|
-
import DialogContent from './ui/dialog/DialogContent.vue';
|
|
117
|
-
import DialogFooter from './ui/dialog/DialogFooter.vue';
|
|
118
|
-
import DialogHeader from './ui/dialog/DialogHeader.vue';
|
|
119
|
-
import DialogTitle from './ui/dialog/DialogTitle.vue';
|
|
120
|
-
import DialogTrigger from './ui/dialog/DialogTrigger.vue';
|
|
121
|
-
import DialogClose from './ui/dialog/DialogClose.vue';
|
|
122
|
-
import DrawerNext from './ui/drawer/Drawer.vue';
|
|
123
|
-
import DrawerContent from './ui/drawer/DrawerContent.vue';
|
|
124
|
-
import DrawerHeader from './ui/drawer/DrawerHeader.vue';
|
|
125
|
-
import DrawerFooter from './ui/drawer/DrawerFooter.vue';
|
|
126
|
-
import DrawerClose from './ui/drawer/DrawerClose.vue';
|
|
127
|
-
import DrawerTitle from './ui/drawer/DrawerTitle.vue';
|
|
128
|
-
import DrawerDescription from './ui/drawer/DrawerDescription.vue';
|
|
129
115
|
|
|
130
116
|
type VueComponent = Component;
|
|
131
117
|
|
|
@@ -246,20 +232,6 @@ export const components: ComponentsMap = {
|
|
|
246
232
|
unnnicSegmentedControlTrigger: SegmentedControlTrigger,
|
|
247
233
|
unnnicSegmentedControlContent: SegmentedControlContent,
|
|
248
234
|
unnnicPageHeader: PageHeader,
|
|
249
|
-
unnnicDialog: Dialog,
|
|
250
|
-
unnnicDialogContent: DialogContent,
|
|
251
|
-
unnnicDialogFooter: DialogFooter,
|
|
252
|
-
unnnicDialogHeader: DialogHeader,
|
|
253
|
-
unnnicDialogTitle: DialogTitle,
|
|
254
|
-
unnnicDialogTrigger: DialogTrigger,
|
|
255
|
-
unnnicDialogClose: DialogClose,
|
|
256
|
-
unnnicDrawerNext: DrawerNext,
|
|
257
|
-
unnnicDrawerContent: DrawerContent,
|
|
258
|
-
unnnicDrawerHeader: DrawerHeader,
|
|
259
|
-
unnnicDrawerFooter: DrawerFooter,
|
|
260
|
-
unnnicDrawerClose: DrawerClose,
|
|
261
|
-
unnnicDrawerTitle: DrawerTitle,
|
|
262
|
-
unnnicDrawerDescription: DrawerDescription,
|
|
263
235
|
};
|
|
264
236
|
|
|
265
237
|
export const unnnicFontSize = fontSize;
|
|
@@ -375,20 +347,6 @@ export const unnnicSegmentedControlList = SegmentedControlList;
|
|
|
375
347
|
export const unnnicSegmentedControlTrigger = SegmentedControlTrigger;
|
|
376
348
|
export const unnnicSegmentedControlContent = SegmentedControlContent;
|
|
377
349
|
export const unnnicPageHeader = PageHeader;
|
|
378
|
-
export const unnnicDialog = Dialog;
|
|
379
|
-
export const unnnicDialogContent = DialogContent;
|
|
380
|
-
export const unnnicDialogFooter = DialogFooter;
|
|
381
|
-
export const unnnicDialogHeader = DialogHeader;
|
|
382
|
-
export const unnnicDialogTitle = DialogTitle;
|
|
383
|
-
export const unnnicDialogTrigger = DialogTrigger;
|
|
384
|
-
export const unnnicDialogClose = DialogClose;
|
|
385
|
-
export const unnnicDrawerNext = DrawerNext;
|
|
386
|
-
export const unnnicDrawerContent = DrawerContent;
|
|
387
|
-
export const unnnicDrawerHeader = DrawerHeader;
|
|
388
|
-
export const unnnicDrawerFooter = DrawerFooter;
|
|
389
|
-
export const unnnicDrawerClose = DrawerClose;
|
|
390
|
-
export const unnnicDrawerTitle = DrawerTitle;
|
|
391
|
-
export const unnnicDrawerDescription = DrawerDescription;
|
|
392
350
|
|
|
393
351
|
export const UnnnicFontSize = fontSize;
|
|
394
352
|
export const UnnnicFormElement = formElement;
|
|
@@ -503,17 +461,3 @@ export const UnnnicSegmentedControlList = SegmentedControlList;
|
|
|
503
461
|
export const UnnnicSegmentedControlTrigger = SegmentedControlTrigger;
|
|
504
462
|
export const UnnnicSegmentedControlContent = SegmentedControlContent;
|
|
505
463
|
export const UnnnicPageHeader = PageHeader;
|
|
506
|
-
export const UnnnicDialog = Dialog;
|
|
507
|
-
export const UnnnicDialogContent = DialogContent;
|
|
508
|
-
export const UnnnicDialogFooter = DialogFooter;
|
|
509
|
-
export const UnnnicDialogHeader = DialogHeader;
|
|
510
|
-
export const UnnnicDialogTitle = DialogTitle;
|
|
511
|
-
export const UnnnicDialogTrigger = DialogTrigger;
|
|
512
|
-
export const UnnnicDialogClose = DialogClose;
|
|
513
|
-
export const UnnnicDrawerNext = DrawerNext;
|
|
514
|
-
export const UnnnicDrawerContent = DrawerContent;
|
|
515
|
-
export const UnnnicDrawerHeader = DrawerHeader;
|
|
516
|
-
export const UnnnicDrawerFooter = DrawerFooter;
|
|
517
|
-
export const UnnnicDrawerClose = DrawerClose;
|
|
518
|
-
export const UnnnicDrawerTitle = DrawerTitle;
|
|
519
|
-
export const UnnnicDrawerDescription = DrawerDescription;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<PopoverPortal
|
|
2
|
+
<PopoverPortal>
|
|
3
3
|
<PopoverContent
|
|
4
4
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
5
|
-
:style="{ width: contentWidth
|
|
5
|
+
:style="{ width: contentWidth }"
|
|
6
6
|
:class="
|
|
7
7
|
cn(
|
|
8
8
|
'unnnic-popover',
|
|
@@ -34,8 +34,6 @@ import { computed, useSlots } from 'vue';
|
|
|
34
34
|
import { reactiveOmit } from '@vueuse/core';
|
|
35
35
|
import { PopoverContent, PopoverPortal, useForwardPropsEmits } from 'reka-ui';
|
|
36
36
|
import { cn } from '@/lib/utils';
|
|
37
|
-
import { useLayerZIndex } from '@/lib/layer-manager';
|
|
38
|
-
import { useTeleportTarget } from '@/lib/teleport-target';
|
|
39
37
|
|
|
40
38
|
defineOptions({
|
|
41
39
|
inheritAttrs: false,
|
|
@@ -65,9 +63,6 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
65
63
|
|
|
66
64
|
const slots = useSlots() as Slots;
|
|
67
65
|
|
|
68
|
-
const popoverZIndex = useLayerZIndex();
|
|
69
|
-
const portalTarget = useTeleportTarget();
|
|
70
|
-
|
|
71
66
|
const getComponentName = (vnode: VNode): string | undefined => {
|
|
72
67
|
const componentType = vnode.type as { name?: string; __name?: string };
|
|
73
68
|
return componentType?.name || componentType?.__name;
|
|
@@ -106,6 +101,8 @@ const contentWidth = computed(() => {
|
|
|
106
101
|
$popover-space: $unnnic-space-4;
|
|
107
102
|
|
|
108
103
|
.unnnic-popover {
|
|
104
|
+
z-index: 10000;
|
|
105
|
+
|
|
109
106
|
border-radius: $unnnic-radius-2;
|
|
110
107
|
box-shadow: $unnnic-shadow-1;
|
|
111
108
|
border: 1px solid $unnnic-color-border-soft;
|
|
@@ -14,14 +14,10 @@ const props = defineProps<PopoverTriggerProps>();
|
|
|
14
14
|
</PopoverTrigger>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<style
|
|
17
|
+
<style scoped>
|
|
18
18
|
.unnnic-popover-trigger {
|
|
19
19
|
border: none;
|
|
20
20
|
background: transparent;
|
|
21
21
|
padding: 0;
|
|
22
|
-
|
|
23
|
-
& > * {
|
|
24
|
-
width: 100%;
|
|
25
|
-
}
|
|
26
22
|
}
|
|
27
23
|
</style>
|
package/src/index.ts
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import type { App } from 'vue';
|
|
2
2
|
import { components } from '@/components';
|
|
3
3
|
import './assets/scss/tailwind.scss';
|
|
4
|
-
import { setTeleportTarget, type TeleportTarget } from '@/lib/teleport-target';
|
|
5
4
|
|
|
6
5
|
interface UnnnicPlugin {
|
|
7
|
-
install(app: App
|
|
6
|
+
install(app: App): void;
|
|
8
7
|
[key: string]: any;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
export interface UnnnicPluginOptions {
|
|
12
|
-
teleportTarget?: TeleportTarget | null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
10
|
const Unnnic: UnnnicPlugin = {
|
|
16
|
-
install(app: App
|
|
17
|
-
setTeleportTarget(options?.teleportTarget ?? null);
|
|
18
|
-
|
|
11
|
+
install(app: App) {
|
|
19
12
|
Object.keys(components).forEach((name) => {
|
|
20
13
|
app.component(name, components[name] as any);
|
|
21
14
|
});
|
|
@@ -6,9 +6,6 @@ import * as ModalDialogStories from './ModalDialog.stories';
|
|
|
6
6
|
|
|
7
7
|
# ModalDialog
|
|
8
8
|
|
|
9
|
-
> **⚠️ DEPRECATED**: This component has been deprecated in favor of the new `Dialog` component. Please use `UnnnicDialog`
|
|
10
|
-
instead for new implementations. See the [Dialog documentation](?path=/docs/feedback-dialog--docs) for more information.
|
|
11
|
-
|
|
12
9
|
The ModalDialog was designed to inform the user about a specific task, request information, or involve other tasks.
|
|
13
10
|
|
|
14
11
|
<Source
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import UnnnicModalDialog from '../components/ModalDialog/ModalDialog.vue';
|
|
2
2
|
import UnnnicInput from '../components/Input/Input.vue';
|
|
3
3
|
import UnnnicLabel from '../components/Label/Label.vue';
|
|
4
|
-
import UnnnicInputDatePicker from '../components/InputDatePicker/InputDatePicker.vue';
|
|
5
|
-
import UnnnicSwitch from '../components/Switch/Switch.vue';
|
|
6
|
-
import UnnnicButton from '../components/Button/Button.vue';
|
|
7
4
|
|
|
8
5
|
import { action } from '@storybook/addon-actions';
|
|
9
6
|
import iconsList from '../utils/iconList';
|
|
10
7
|
import colorsList from '../utils/colorsList';
|
|
11
8
|
|
|
12
9
|
export default {
|
|
13
|
-
title: '
|
|
10
|
+
title: 'Example/ModalDialog',
|
|
14
11
|
component: UnnnicModalDialog,
|
|
15
12
|
argTypes: {
|
|
16
13
|
type: {
|
|
@@ -185,85 +182,6 @@ const TemplateLeftSidebar = (args) => ({
|
|
|
185
182
|
},
|
|
186
183
|
});
|
|
187
184
|
|
|
188
|
-
const TemplateWithDatePicker = (args) => ({
|
|
189
|
-
components: {
|
|
190
|
-
UnnnicModalDialog,
|
|
191
|
-
UnnnicInputDatePicker,
|
|
192
|
-
UnnnicSwitch,
|
|
193
|
-
UnnnicButton,
|
|
194
|
-
},
|
|
195
|
-
setup() {
|
|
196
|
-
const updateModelValue = (value) => {
|
|
197
|
-
action('update:modelValue')(value);
|
|
198
|
-
args.modelValue = value;
|
|
199
|
-
};
|
|
200
|
-
return { args, updateModelValue };
|
|
201
|
-
},
|
|
202
|
-
data() {
|
|
203
|
-
return {
|
|
204
|
-
forms: [{ date: { start: null, end: null }, repeat: false }],
|
|
205
|
-
isLoading: false,
|
|
206
|
-
};
|
|
207
|
-
},
|
|
208
|
-
template: `
|
|
209
|
-
<div>
|
|
210
|
-
<button @click="updateModelValue(true)">Open Modal with DatePicker</button>
|
|
211
|
-
<unnnic-modal-dialog
|
|
212
|
-
v-bind="args"
|
|
213
|
-
@primaryButtonClick="handleSave"
|
|
214
|
-
@secondaryButtonClick="secondaryButtonClick"
|
|
215
|
-
@update:modelValue="updateModelValue"
|
|
216
|
-
>
|
|
217
|
-
<section style="display: flex; flex-direction: column; gap: 16px;">
|
|
218
|
-
<section
|
|
219
|
-
v-for="(form, index) in forms"
|
|
220
|
-
:key="index"
|
|
221
|
-
style="display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid #E2E6ED; border-radius: 8px;"
|
|
222
|
-
>
|
|
223
|
-
<section style="display: flex; flex-direction: column; gap: 8px;">
|
|
224
|
-
<p style="font-family: 'Lato'; font-size: 14px; font-weight: 600; margin: 0; color: #3B414D;">
|
|
225
|
-
Select date or period
|
|
226
|
-
</p>
|
|
227
|
-
<UnnnicInputDatePicker
|
|
228
|
-
v-model="form.date"
|
|
229
|
-
:options="[{ id: 'custom', name: 'Custom' }]"
|
|
230
|
-
next
|
|
231
|
-
fillW
|
|
232
|
-
actionText="Confirm"
|
|
233
|
-
disableClear
|
|
234
|
-
/>
|
|
235
|
-
</section>
|
|
236
|
-
<UnnnicSwitch
|
|
237
|
-
v-model="form.repeat"
|
|
238
|
-
textRight="Repeat annually"
|
|
239
|
-
size="small"
|
|
240
|
-
/>
|
|
241
|
-
</section>
|
|
242
|
-
<UnnnicButton
|
|
243
|
-
iconCenter="add-1"
|
|
244
|
-
type="tertiary"
|
|
245
|
-
text="Add"
|
|
246
|
-
@click="addForm"
|
|
247
|
-
/>
|
|
248
|
-
</section>
|
|
249
|
-
</unnnic-modal-dialog>
|
|
250
|
-
</div>
|
|
251
|
-
`,
|
|
252
|
-
methods: {
|
|
253
|
-
primaryButtonClick: action('primaryButtonClick'),
|
|
254
|
-
secondaryButtonClick: action('secondaryButtonClick'),
|
|
255
|
-
handleSave() {
|
|
256
|
-
action('primaryButtonClick')();
|
|
257
|
-
action('save')(this.forms);
|
|
258
|
-
console.log('Forms data:', this.forms);
|
|
259
|
-
},
|
|
260
|
-
addForm() {
|
|
261
|
-
this.forms.push({ date: { start: null, end: null }, repeat: false });
|
|
262
|
-
action('addForm')();
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
});
|
|
266
|
-
|
|
267
185
|
export const Default = Template.bind({});
|
|
268
186
|
Default.args = {
|
|
269
187
|
title: 'Default Modal',
|
|
@@ -343,16 +261,3 @@ Image.args = {
|
|
|
343
261
|
},
|
|
344
262
|
showActionsDivider: true,
|
|
345
263
|
};
|
|
346
|
-
|
|
347
|
-
export const WithDatePicker = TemplateWithDatePicker.bind({});
|
|
348
|
-
WithDatePicker.args = {
|
|
349
|
-
title: 'Add Non-Working Dates',
|
|
350
|
-
type: '',
|
|
351
|
-
primaryButtonProps: {
|
|
352
|
-
text: 'Save',
|
|
353
|
-
loading: false,
|
|
354
|
-
},
|
|
355
|
-
secondaryButtonProps: {
|
|
356
|
-
text: 'Cancel',
|
|
357
|
-
},
|
|
358
|
-
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import UnnnicTemplatePreview from
|
|
1
|
+
import UnnnicTemplatePreview from '../components/TemplatePreview/TemplatePreview.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title:
|
|
5
|
-
tags: [
|
|
4
|
+
title: 'example/TemplatePreview',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
6
|
component: UnnnicTemplatePreview,
|
|
7
7
|
};
|
|
8
8
|
|
|
@@ -17,28 +17,28 @@ const Template = (args) => ({
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const bodyText =
|
|
20
|
-
|
|
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
21
|
|
|
22
22
|
export const Default = Template.bind({});
|
|
23
23
|
Default.args = {
|
|
24
24
|
template: {
|
|
25
25
|
header: {
|
|
26
|
-
type:
|
|
27
|
-
text:
|
|
26
|
+
type: 'TEXT',
|
|
27
|
+
text: 'Hello, world!',
|
|
28
28
|
},
|
|
29
|
-
footer:
|
|
29
|
+
footer: 'Weni by VTEX',
|
|
30
30
|
buttons: [
|
|
31
31
|
{
|
|
32
|
-
text:
|
|
33
|
-
type:
|
|
32
|
+
text: 'Button 1',
|
|
33
|
+
type: 'PHONE_NUMBER',
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
text:
|
|
37
|
-
type:
|
|
36
|
+
text: 'Button 2',
|
|
37
|
+
type: 'URL',
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
text:
|
|
41
|
-
type:
|
|
40
|
+
text: 'Button 3',
|
|
41
|
+
type: 'QUICK_REPLY',
|
|
42
42
|
},
|
|
43
43
|
],
|
|
44
44
|
body: bodyText,
|
|
@@ -49,10 +49,10 @@ export const Image = Template.bind({});
|
|
|
49
49
|
Image.args = {
|
|
50
50
|
template: {
|
|
51
51
|
header: {
|
|
52
|
-
type:
|
|
53
|
-
mediaType:
|
|
52
|
+
type: 'MEDIA',
|
|
53
|
+
mediaType: 'IMAGE',
|
|
54
54
|
},
|
|
55
|
-
footer:
|
|
55
|
+
footer: 'Weni by VTEX',
|
|
56
56
|
body: bodyText,
|
|
57
57
|
},
|
|
58
58
|
};
|
|
@@ -61,21 +61,21 @@ export const Video = Template.bind({});
|
|
|
61
61
|
Video.args = {
|
|
62
62
|
template: {
|
|
63
63
|
header: {
|
|
64
|
-
type:
|
|
65
|
-
mediaType:
|
|
64
|
+
type: 'MEDIA',
|
|
65
|
+
mediaType: 'VIDEO',
|
|
66
66
|
},
|
|
67
67
|
buttons: [
|
|
68
68
|
{
|
|
69
|
-
text:
|
|
70
|
-
type:
|
|
69
|
+
text: 'Button 1',
|
|
70
|
+
type: 'PHONE_NUMBER',
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
text:
|
|
74
|
-
type:
|
|
73
|
+
text: 'Button 2',
|
|
74
|
+
type: 'URL',
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
text:
|
|
78
|
-
type:
|
|
77
|
+
text: 'Button 3',
|
|
78
|
+
type: 'QUICK_REPLY',
|
|
79
79
|
},
|
|
80
80
|
],
|
|
81
81
|
},
|
|
@@ -85,10 +85,10 @@ export const Document = Template.bind({});
|
|
|
85
85
|
Document.args = {
|
|
86
86
|
template: {
|
|
87
87
|
header: {
|
|
88
|
-
type:
|
|
89
|
-
mediaType:
|
|
88
|
+
type: 'MEDIA',
|
|
89
|
+
mediaType: 'DOCUMENT',
|
|
90
90
|
},
|
|
91
|
-
footer:
|
|
91
|
+
footer: 'Weni by VTEX',
|
|
92
92
|
body: bodyText,
|
|
93
93
|
},
|
|
94
94
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import UnnnicTemplatePreviewModal from
|
|
1
|
+
import UnnnicTemplatePreviewModal from '../components/TemplatePreview/TemplatePreviewModal.vue';
|
|
2
2
|
|
|
3
|
-
import { action } from
|
|
3
|
+
import { action } from '@storybook/addon-actions';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
title:
|
|
7
|
-
tags: [
|
|
6
|
+
title: 'example/TemplatePreviewModal',
|
|
7
|
+
tags: ['autodocs'],
|
|
8
8
|
component: UnnnicTemplatePreviewModal,
|
|
9
9
|
argTypes: {
|
|
10
10
|
locale: {
|
|
11
|
-
control: { type:
|
|
12
|
-
options: [
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: ['pt-br', 'en', 'es'],
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
};
|
|
@@ -18,7 +18,7 @@ const Template = (args) => ({
|
|
|
18
18
|
components: { UnnnicTemplatePreviewModal },
|
|
19
19
|
setup() {
|
|
20
20
|
const close = () => {
|
|
21
|
-
action(
|
|
21
|
+
action('close')();
|
|
22
22
|
args.modelValue = false;
|
|
23
23
|
};
|
|
24
24
|
return { args, close };
|
|
@@ -32,29 +32,29 @@ const Template = (args) => ({
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
const bodyText =
|
|
35
|
-
|
|
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
36
|
|
|
37
37
|
export const Default = Template.bind({});
|
|
38
38
|
Default.args = {
|
|
39
39
|
modelValue: false,
|
|
40
40
|
template: {
|
|
41
41
|
header: {
|
|
42
|
-
type:
|
|
43
|
-
text:
|
|
42
|
+
type: 'TEXT',
|
|
43
|
+
text: 'Hello, world!',
|
|
44
44
|
},
|
|
45
|
-
footer:
|
|
45
|
+
footer: 'Weni by VTEX',
|
|
46
46
|
buttons: [
|
|
47
47
|
{
|
|
48
|
-
text:
|
|
49
|
-
type:
|
|
48
|
+
text: 'Button 1',
|
|
49
|
+
type: 'PHONE_NUMBER',
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
text:
|
|
53
|
-
type:
|
|
52
|
+
text: 'Button 2',
|
|
53
|
+
type: 'URL',
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
text:
|
|
57
|
-
type:
|
|
56
|
+
text: 'Button 3',
|
|
57
|
+
type: 'QUICK_REPLY',
|
|
58
58
|
},
|
|
59
59
|
],
|
|
60
60
|
body: bodyText,
|
|
@@ -65,10 +65,10 @@ export const Image = Template.bind({});
|
|
|
65
65
|
Image.args = {
|
|
66
66
|
template: {
|
|
67
67
|
header: {
|
|
68
|
-
type:
|
|
69
|
-
mediaType:
|
|
68
|
+
type: 'MEDIA',
|
|
69
|
+
mediaType: 'IMAGE',
|
|
70
70
|
},
|
|
71
|
-
footer:
|
|
71
|
+
footer: 'Weni by VTEX',
|
|
72
72
|
body: bodyText,
|
|
73
73
|
},
|
|
74
74
|
};
|
|
@@ -77,21 +77,21 @@ export const Video = Template.bind({});
|
|
|
77
77
|
Video.args = {
|
|
78
78
|
template: {
|
|
79
79
|
header: {
|
|
80
|
-
type:
|
|
81
|
-
mediaType:
|
|
80
|
+
type: 'MEDIA',
|
|
81
|
+
mediaType: 'VIDEO',
|
|
82
82
|
},
|
|
83
83
|
buttons: [
|
|
84
84
|
{
|
|
85
|
-
text:
|
|
86
|
-
type:
|
|
85
|
+
text: 'Button 1',
|
|
86
|
+
type: 'PHONE_NUMBER',
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
text:
|
|
90
|
-
type:
|
|
89
|
+
text: 'Button 2',
|
|
90
|
+
type: 'URL',
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
text:
|
|
94
|
-
type:
|
|
93
|
+
text: 'Button 3',
|
|
94
|
+
type: 'QUICK_REPLY',
|
|
95
95
|
},
|
|
96
96
|
],
|
|
97
97
|
},
|
|
@@ -101,10 +101,10 @@ export const Document = Template.bind({});
|
|
|
101
101
|
Document.args = {
|
|
102
102
|
template: {
|
|
103
103
|
header: {
|
|
104
|
-
type:
|
|
105
|
-
mediaType:
|
|
104
|
+
type: 'MEDIA',
|
|
105
|
+
mediaType: 'DOCUMENT',
|
|
106
106
|
},
|
|
107
|
-
footer:
|
|
107
|
+
footer: 'Weni by VTEX',
|
|
108
108
|
body: bodyText,
|
|
109
109
|
},
|
|
110
110
|
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { DialogRootEmits, DialogRootProps } from 'reka-ui';
|
|
3
|
-
import { DialogRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
|
-
|
|
5
|
-
defineOptions({
|
|
6
|
-
name: 'UnnnicDialog',
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
const props = defineProps<DialogRootProps>();
|
|
10
|
-
const emits = defineEmits<DialogRootEmits>();
|
|
11
|
-
|
|
12
|
-
const forwarded = useForwardPropsEmits(props, emits);
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<template>
|
|
16
|
-
<DialogRoot v-bind="forwarded">
|
|
17
|
-
<slot />
|
|
18
|
-
</DialogRoot>
|
|
19
|
-
</template>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { DialogCloseProps } from 'reka-ui';
|
|
3
|
-
import { DialogClose } from 'reka-ui';
|
|
4
|
-
|
|
5
|
-
defineOptions({
|
|
6
|
-
name: 'UnnnicDialogClose',
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
const props = withDefaults(defineProps<DialogCloseProps>(), {
|
|
10
|
-
asChild: true,
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<DialogClose
|
|
16
|
-
class="unnnic-dialog-close"
|
|
17
|
-
v-bind="props"
|
|
18
|
-
>
|
|
19
|
-
<slot />
|
|
20
|
-
</DialogClose>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<style lang="scss" scoped>
|
|
24
|
-
.unnnic-dialog-close {
|
|
25
|
-
> * {
|
|
26
|
-
width: 100%;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
</style>
|