@weni/unnnic-system 3.11.2 → 3.11.3-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/dist/components/Alert/Alert.vue.d.ts +3 -3
- package/dist/components/Alert/Version1dot1.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +109 -18
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +218 -36
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +2 -2
- package/dist/components/Card/AccountCard.vue.d.ts +2 -2
- package/dist/components/Card/Card.vue.d.ts +120 -29
- package/dist/components/Card/CardCompany.vue.d.ts +2 -2
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +110 -19
- package/dist/components/Card/ContentCard.vue.d.ts +1 -1
- package/dist/components/Card/DashCard.vue.d.ts +2 -2
- package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
- package/dist/components/Card/MarketplaceCard.vue.d.ts +1 -1
- package/dist/components/Card/SimpleCard.vue.d.ts +109 -18
- package/dist/components/Card/StatusCard.vue.d.ts +1 -1
- package/dist/components/Card/TitleCard.vue.d.ts +109 -18
- package/dist/components/CardImage/CardImage.vue.d.ts +5 -5
- package/dist/components/CardInformation/CardInformation.vue.d.ts +110 -19
- package/dist/components/CardProject/CardProject.vue.d.ts +2 -2
- package/dist/components/Carousel/Carousel.vue.d.ts +2 -2
- package/dist/components/Carousel/TagCarousel.vue.d.ts +2 -2
- package/dist/components/ChartBar/ChartBar.vue.d.ts +115 -24
- package/dist/components/ChartLine/ChartLine.vue.d.ts +109 -18
- package/dist/components/ChatText/ChatText.vue.d.ts +109 -18
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +6 -6
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +109 -18
- package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
- package/dist/components/DataArea/DataArea.vue.d.ts +109 -18
- package/dist/components/DataTable/index.vue.d.ts +1 -1
- package/dist/components/DataTable/index.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +10 -10
- package/dist/components/Drawer/Drawer.vue.d.ts +37 -207
- package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/dist/components/FormElement/FormElement.vue.d.ts +4 -4
- package/dist/components/ImportCard/ImportCard.vue.d.ts +6 -6
- package/dist/components/Input/Input.vue.d.ts +9 -9
- package/dist/components/Input/TextInput.vue.d.ts +2 -2
- package/dist/components/InputNext/InputNext.vue.d.ts +3 -3
- package/dist/components/Modal/Modal.vue.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +209 -35
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +15 -15
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +12 -12
- package/dist/components/MoodRating/MoodRating.vue.d.ts +109 -18
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +18 -18
- package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
- package/dist/components/Radio/Radio.vue.d.ts +6 -6
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +11 -11
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +2 -2
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +5 -5
- package/dist/components/SelectTime/index.vue.d.ts +3 -3
- package/dist/components/Slider/Slider.vue.d.ts +109 -18
- package/dist/components/Switch/Switch.vue.d.ts +2 -2
- package/dist/components/Tab/Tab.vue.d.ts +109 -18
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
- package/dist/components/Tag/DefaultTag.vue.d.ts +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +2 -2
- package/dist/components/TextArea/TextArea.vue.d.ts +5 -5
- package/dist/components/Toast/Toast.vue.d.ts +1 -1
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/ToolTip/ToolTip.vue.d.ts +109 -18
- package/dist/components/ToolTip/ToolTip.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 +6 -6
- package/dist/components/ui/dialog/Dialog.vue.d.ts +23 -0
- package/dist/components/ui/dialog/Dialog.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +19 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +43 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +25 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +29 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +23 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +19 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/index.d.ts +8 -0
- package/dist/components/ui/dialog/index.d.ts.map +1 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +35 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts +19 -0
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +42 -0
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +23 -0
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +22 -0
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +25 -0
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +8 -0
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +23 -0
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts +19 -0
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/index.d.ts +11 -0
- package/dist/components/ui/drawer/index.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +2 -2
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/components/ui/segmented-control/SegmentedControlList.vue.d.ts +26 -0
- package/dist/components/ui/segmented-control/SegmentedControlList.vue.d.ts.map +1 -0
- package/dist/components/ui/segmented-control/SegmentedControlTrigger.vue.d.ts +24 -0
- package/dist/components/ui/segmented-control/SegmentedControlTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/segmented-control/index.d.ts +5 -0
- package/dist/components/ui/segmented-control/index.d.ts.map +1 -0
- package/dist/components/ui/tabs/TabsTrigger.vue.d.ts.map +1 -1
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +23 -0
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +31 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts +19 -0
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +19 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/index.d.ts +5 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -0
- package/dist/{es-042a0d15.mjs → es-9cccca43.mjs} +1 -1
- package/dist/{index-fd0ea6b9.mjs → index-386c3448.mjs} +99605 -96738
- package/dist/{pt-br-3b7cced5.mjs → pt-br-9303b2c4.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +232 -196
- package/dist/unnnic.umd.js +48 -44
- package/package.json +2 -1
- package/src/assets/scss/tailwind.scss +8 -0
- package/src/components/Drawer/Drawer.vue +188 -269
- package/src/components/Drawer/__tests__/Drawer.spec.js +31 -46
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +18 -19
- package/src/components/ModalDialog/ModalDialog.vue +62 -148
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +11 -221
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -22
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +3 -1
- package/src/components/Toast/Toast.vue +12 -8
- package/src/components/ToolTip/ToolTip.vue +41 -188
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +345 -61
- package/src/components/index.ts +86 -12
- package/src/components/ui/dialog/Dialog.vue +15 -0
- package/src/components/ui/dialog/DialogClose.vue +25 -0
- package/src/components/ui/dialog/DialogContent.vue +130 -0
- package/src/components/ui/dialog/DialogFooter.vue +46 -0
- package/src/components/ui/dialog/DialogHeader.vue +79 -0
- package/src/components/ui/dialog/DialogTitle.vue +34 -0
- package/src/components/ui/dialog/DialogTrigger.vue +12 -0
- package/src/components/ui/dialog/index.ts +7 -0
- package/src/components/ui/drawer/Drawer.vue +27 -0
- package/src/components/ui/drawer/DrawerClose.vue +37 -0
- package/src/components/ui/drawer/DrawerContent.vue +102 -0
- package/src/components/ui/drawer/DrawerDescription.vue +40 -0
- package/src/components/ui/drawer/DrawerFooter.vue +38 -0
- package/src/components/ui/drawer/DrawerHeader.vue +57 -0
- package/src/components/ui/drawer/DrawerOverlay.vue +34 -0
- package/src/components/ui/drawer/DrawerTitle.vue +37 -0
- package/src/components/ui/drawer/DrawerTrigger.vue +31 -0
- package/src/components/ui/drawer/index.ts +10 -0
- package/src/components/ui/popover/PopoverContent.vue +0 -2
- package/src/components/ui/segmented-control/SegmentedControlList.vue +51 -0
- package/src/components/ui/segmented-control/SegmentedControlTrigger.vue +81 -0
- package/src/components/ui/segmented-control/index.ts +4 -0
- package/src/components/ui/tabs/TabsTrigger.vue +4 -20
- package/src/components/ui/tooltip/Tooltip.vue +15 -0
- package/src/components/ui/tooltip/TooltipContent.vue +73 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +15 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +22 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/stories/Dialog.stories.js +832 -0
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/DrawerNext.stories.js +610 -0
- package/src/stories/ModalDialog.mdx +3 -0
- package/src/stories/ModalDialog.stories.js +1 -1
- package/src/stories/SegmentedControl.stories.js +253 -0
- package/src/stories/Tabs.stories.js +1 -1
|
@@ -5,6 +5,13 @@ import Drawer from '../Drawer.vue';
|
|
|
5
5
|
describe('Drawer.vue', () => {
|
|
6
6
|
let wrapper;
|
|
7
7
|
|
|
8
|
+
const templateSlot = { template: `<div><slot /></div>` };
|
|
9
|
+
const globalStubs = {
|
|
10
|
+
UnnnicIcon: true,
|
|
11
|
+
UnnnicButton: true,
|
|
12
|
+
Teleport: templateSlot,
|
|
13
|
+
};
|
|
14
|
+
|
|
8
15
|
beforeEach(() => {
|
|
9
16
|
wrapper = mount(Drawer, {
|
|
10
17
|
props: {
|
|
@@ -15,15 +22,14 @@ describe('Drawer.vue', () => {
|
|
|
15
22
|
secondaryButtonText: 'Secondary Action',
|
|
16
23
|
},
|
|
17
24
|
global: {
|
|
18
|
-
stubs:
|
|
25
|
+
stubs: globalStubs,
|
|
19
26
|
},
|
|
20
27
|
});
|
|
21
28
|
});
|
|
22
29
|
|
|
23
30
|
const element = (id) => wrapper.find(`[data-testid="${id}"]`);
|
|
24
31
|
const component = (id) => wrapper.findComponent(`[data-testid="${id}"]`);
|
|
25
|
-
const
|
|
26
|
-
const overlay = () => element('overlay');
|
|
32
|
+
const drawerRoot = () => wrapper.findComponent({ name: 'UnnnicDrawerNext' });
|
|
27
33
|
const title = () => element('drawer-title');
|
|
28
34
|
const description = () => element('drawer-description');
|
|
29
35
|
const primaryButton = () => component('primary-button');
|
|
@@ -31,6 +37,8 @@ describe('Drawer.vue', () => {
|
|
|
31
37
|
const footer = () => element('footer');
|
|
32
38
|
const closeIcon = () => component('close-icon');
|
|
33
39
|
const drawerContainer = () => element('drawer-container');
|
|
40
|
+
const drawerContentComponent = () =>
|
|
41
|
+
wrapper.findComponent({ name: 'UnnnicDrawerContent' });
|
|
34
42
|
|
|
35
43
|
describe('Component Rendering', () => {
|
|
36
44
|
describe('Component Rendering', () => {
|
|
@@ -39,21 +47,21 @@ describe('Drawer.vue', () => {
|
|
|
39
47
|
});
|
|
40
48
|
|
|
41
49
|
it('should render the drawer when modelValue is true', () => {
|
|
42
|
-
expect(
|
|
50
|
+
expect(drawerRoot().props('open')).toBe(true);
|
|
43
51
|
});
|
|
44
52
|
|
|
45
53
|
it('should not render the drawer when modelValue is false', async () => {
|
|
46
54
|
await wrapper.setProps({ modelValue: false });
|
|
47
|
-
expect(
|
|
55
|
+
expect(drawerRoot().props('open')).toBe(false);
|
|
48
56
|
});
|
|
49
57
|
|
|
50
58
|
it('should render the overlay when withoutOverlay is false', () => {
|
|
51
|
-
expect(
|
|
59
|
+
expect(drawerContentComponent().props('showOverlay')).toBe(true);
|
|
52
60
|
});
|
|
53
61
|
|
|
54
62
|
it('should not render the overlay when withoutOverlay is true', async () => {
|
|
55
63
|
await wrapper.setProps({ withoutOverlay: true });
|
|
56
|
-
expect(
|
|
64
|
+
expect(drawerContentComponent().props('showOverlay')).toBe(false);
|
|
57
65
|
});
|
|
58
66
|
|
|
59
67
|
it('should display the title and description correctly', () => {
|
|
@@ -75,7 +83,11 @@ describe('Drawer.vue', () => {
|
|
|
75
83
|
slots: {
|
|
76
84
|
content: '<div data-testid="slot-content">Slot Content</div>',
|
|
77
85
|
},
|
|
86
|
+
global: {
|
|
87
|
+
stubs: globalStubs,
|
|
88
|
+
},
|
|
78
89
|
});
|
|
90
|
+
|
|
79
91
|
expect(wrapper.find('[data-testid="slot-content"]').exists()).toBe(
|
|
80
92
|
true,
|
|
81
93
|
);
|
|
@@ -93,6 +105,9 @@ describe('Drawer.vue', () => {
|
|
|
93
105
|
slots: {
|
|
94
106
|
title: '<h2 data-testid="custom-title">Custom Title Content</h2>',
|
|
95
107
|
},
|
|
108
|
+
global: {
|
|
109
|
+
stubs: globalStubs,
|
|
110
|
+
},
|
|
96
111
|
});
|
|
97
112
|
|
|
98
113
|
expect(title().exists()).toBe(false);
|
|
@@ -113,6 +128,9 @@ describe('Drawer.vue', () => {
|
|
|
113
128
|
slots: {
|
|
114
129
|
title: '<div data-testid="custom-title">Slot Title</div>',
|
|
115
130
|
},
|
|
131
|
+
global: {
|
|
132
|
+
stubs: globalStubs,
|
|
133
|
+
},
|
|
116
134
|
});
|
|
117
135
|
|
|
118
136
|
expect(title().exists()).toBe(false);
|
|
@@ -164,7 +182,7 @@ describe('Drawer.vue', () => {
|
|
|
164
182
|
});
|
|
165
183
|
});
|
|
166
184
|
|
|
167
|
-
describe('Interactions
|
|
185
|
+
describe('Interactions', () => {
|
|
168
186
|
beforeEach(() => {
|
|
169
187
|
vi.useFakeTimers();
|
|
170
188
|
});
|
|
@@ -174,9 +192,6 @@ describe('Drawer.vue', () => {
|
|
|
174
192
|
|
|
175
193
|
it('should close the drawer when the close icon is clicked', async () => {
|
|
176
194
|
await closeIcon().trigger('click');
|
|
177
|
-
|
|
178
|
-
vi.advanceTimersByTime(200);
|
|
179
|
-
|
|
180
195
|
expect(wrapper.emitted('close')).toBeTruthy();
|
|
181
196
|
});
|
|
182
197
|
|
|
@@ -184,8 +199,6 @@ describe('Drawer.vue', () => {
|
|
|
184
199
|
await wrapper.setProps({ distinctCloseBack: true });
|
|
185
200
|
await closeIcon().trigger('click');
|
|
186
201
|
|
|
187
|
-
vi.advanceTimersByTime(200);
|
|
188
|
-
|
|
189
202
|
expect(wrapper.emitted('back')).toBeTruthy();
|
|
190
203
|
});
|
|
191
204
|
|
|
@@ -193,49 +206,21 @@ describe('Drawer.vue', () => {
|
|
|
193
206
|
await closeIcon().trigger('click');
|
|
194
207
|
expect(wrapper.emitted('back')).toBeUndefined();
|
|
195
208
|
});
|
|
196
|
-
|
|
197
|
-
it('should correctly handle transitions when closing the drawer', async () => {
|
|
198
|
-
await wrapper.vm.close();
|
|
199
|
-
expect(wrapper.vm.showDrawer).toBe(false);
|
|
200
|
-
|
|
201
|
-
setTimeout(() => {
|
|
202
|
-
expect(drawer().exists()).toBe(false);
|
|
203
|
-
}, 200);
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
it('should handle overlay clicks to close the drawer when withoutOverlay is false', async () => {
|
|
207
|
-
expect(overlay().exists()).toBe(true);
|
|
208
|
-
await overlay().trigger('click');
|
|
209
|
-
|
|
210
|
-
vi.advanceTimersByTime(200);
|
|
211
|
-
|
|
212
|
-
expect(wrapper.emitted('close')).toBeTruthy();
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it('should execute the callback after 200ms timeout and reset showDrawer', async () => {
|
|
216
|
-
const callbackMock = vi.fn();
|
|
217
|
-
wrapper.vm.transitionClose(callbackMock);
|
|
218
|
-
|
|
219
|
-
expect(wrapper.vm.showDrawer).toBe(false);
|
|
220
|
-
|
|
221
|
-
vi.advanceTimersByTime(200);
|
|
222
|
-
|
|
223
|
-
expect(callbackMock).toHaveBeenCalled();
|
|
224
|
-
expect(wrapper.vm.showDrawer).toBe(true);
|
|
225
|
-
});
|
|
226
209
|
});
|
|
227
210
|
|
|
228
211
|
describe('Props and Computed Properties', () => {
|
|
229
212
|
it('should render the correct size class based on size prop', async () => {
|
|
230
213
|
await wrapper.setProps({ size: 'lg' });
|
|
231
|
-
expect(
|
|
214
|
+
expect(drawerContentComponent().props('class')).toContain(
|
|
232
215
|
'unnnic-drawer__container--lg',
|
|
233
216
|
);
|
|
217
|
+
expect(drawerContentComponent().props('size')).toBe('large');
|
|
234
218
|
|
|
235
219
|
await wrapper.setProps({ size: 'xl' });
|
|
236
|
-
expect(
|
|
220
|
+
expect(drawerContentComponent().props('class')).toContain(
|
|
237
221
|
'unnnic-drawer__container--xl',
|
|
238
222
|
);
|
|
223
|
+
expect(drawerContentComponent().props('size')).toBe('extra-large');
|
|
239
224
|
});
|
|
240
225
|
|
|
241
226
|
it('should display footer if either primaryButtonText or secondaryButtonText is provided', async () => {
|
|
@@ -275,7 +260,7 @@ describe('Drawer.vue', () => {
|
|
|
275
260
|
|
|
276
261
|
it('should use correct icon for close button based on closeIcon prop', async () => {
|
|
277
262
|
await wrapper.setProps({ closeIcon: 'custom_close_icon' });
|
|
278
|
-
expect(closeIcon().props('
|
|
263
|
+
expect(closeIcon().props('iconCenter')).toBe('custom_close_icon');
|
|
279
264
|
});
|
|
280
265
|
|
|
281
266
|
it('should validate all size prop values correctly', () => {
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`Drawer.vue > Component Rendering > Component Rendering > matches the snapshot 1`] = `
|
|
4
|
-
"<
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</aside>"
|
|
4
|
+
"<div data-v-e761d31f="" data-v-196de012="" disabled="false" defer="false" forcemount="false" data-testid="drawer-container">
|
|
5
|
+
<div data-v-7f241b30="" data-v-e761d31f="" data-state="open" style="pointer-events: auto;" data-vaul-overlay="" data-vaul-snap-points="false" data-vaul-snap-points-overlay="true" class="unnnic-drawer__overlay"></div>
|
|
6
|
+
<div data-v-e761d31f="" data-dismissable-layer="" style="--snap-point-height: 0; --initial-transform: calc(100% + 8px); pointer-events: auto;" tabindex="-1" data-vaul-drawer="" data-vaul-drawer-direction="right" data-vaul-delayed-snap-points="false" data-vaul-snap-points="false" size="medium" showoverlay="true" class="unnnic-drawer__content unnnic-drawer__content--medium unnnic-drawer__container unnnic-drawer__container--md" id="" role="dialog" aria-describedby="reka-dialog-description-v-1" aria-labelledby="reka-dialog-title-v-0" data-state="open">
|
|
7
|
+
<header data-v-39d0dfb8="" data-v-196de012="" class="unnnic-drawer__header unnnic-drawer__header">
|
|
8
|
+
<section data-v-196de012="" class="unnnic-drawer__title-container">
|
|
9
|
+
<h2 data-v-97709962="" data-v-196de012="" id="reka-dialog-title-v-0" class="unnnic-drawer__title unnnic-drawer__title" data-testid="drawer-title">Test Title</h2>
|
|
10
|
+
<p data-v-750ea255="" data-v-196de012="" id="reka-dialog-description-v-1" class="unnnic-drawer__description unnnic-drawer__description" data-testid="drawer-description">Test Description</p>
|
|
11
|
+
</section><button data-v-4a771f40="" data-v-196de012="" type="button" class="unnnic-drawer__close">
|
|
12
|
+
<unnnic-button-stub data-v-196de012="" size="small" text="" type="tertiary" float="false" iconleft="" iconright="" iconcenter="arrow_forward" iconsfilled="false" disabled="false" loading="false" class="unnnic-drawer__close-icon" data-testid="close-icon"></unnnic-button-stub>
|
|
13
|
+
</button>
|
|
14
|
+
</header>
|
|
15
|
+
<section data-v-196de012="" class="unnnic-drawer__content"></section>
|
|
16
|
+
<footer data-v-02ebc5b4="" data-v-196de012="" class="unnnic-drawer__footer unnnic-drawer__footer" data-testid="footer">
|
|
17
|
+
<unnnic-button-stub data-v-196de012="" size="large" text="Secondary Action" type="tertiary" float="false" iconleft="" iconright="" iconcenter="" iconsfilled="false" disabled="false" loading="false" data-testid="secondary-button"></unnnic-button-stub>
|
|
18
|
+
<unnnic-button-stub data-v-196de012="" size="large" text="Primary Action" type="primary" float="false" iconleft="" iconright="" iconcenter="" iconsfilled="false" disabled="false" loading="false" data-testid="primary-button"></unnnic-button-stub>
|
|
19
|
+
</footer>
|
|
20
|
+
</div>
|
|
21
|
+
</div>"
|
|
23
22
|
`;
|
|
@@ -1,64 +1,46 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
data-testid="modal-dialog"
|
|
2
|
+
<UnnnicDialog
|
|
3
|
+
:open="modelValue"
|
|
4
|
+
@update:open="$emit('update:modelValue', $event)"
|
|
6
5
|
>
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'unnnic-modal-dialog__container',
|
|
15
|
-
`unnnic-modal-dialog__container--${size}`,
|
|
16
|
-
]"
|
|
17
|
-
data-testid="modal-container"
|
|
6
|
+
<UnnnicDialogContent
|
|
7
|
+
:size="size === 'sm' ? 'small' : size === 'lg' ? 'large' : 'medium'"
|
|
8
|
+
:parentClass="['unnnic-modal-dialog', $attrs.class]"
|
|
9
|
+
class="unnnic-modal-dialog__container"
|
|
10
|
+
data-testid="modal-dialog"
|
|
11
|
+
@escape-key-down="persistentHandler"
|
|
12
|
+
@pointer-down-outside="persistentHandler"
|
|
18
13
|
>
|
|
19
14
|
<section
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
:class="[
|
|
16
|
+
'unnnic-modal-dialog__container__body',
|
|
17
|
+
{
|
|
18
|
+
'unnnic-modal-dialog__container__body--left-sidebar':
|
|
19
|
+
$slots.leftSidebar,
|
|
20
|
+
},
|
|
21
|
+
]"
|
|
22
22
|
>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
<section
|
|
24
|
+
v-if="$slots.leftSidebar"
|
|
25
|
+
class="unnnic-modal-dialog__container__left-sidebar"
|
|
26
|
+
>
|
|
27
|
+
<slot name="leftSidebar" />
|
|
28
|
+
</section>
|
|
29
|
+
<UnnnicDialogHeader
|
|
28
30
|
v-if="title"
|
|
29
|
-
|
|
31
|
+
:closeButton="showCloseIcon"
|
|
32
|
+
:type="type"
|
|
30
33
|
>
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class="unnnic-modal-dialog__container__title-icon"
|
|
36
|
-
:icon="icon || iconsMapper[type]?.icon"
|
|
37
|
-
:scheme="iconScheme || iconsMapper[type]?.scheme"
|
|
38
|
-
size="md"
|
|
39
|
-
/>
|
|
40
|
-
<h1
|
|
41
|
-
class="unnnic-modal-dialog__container__title-text"
|
|
42
|
-
data-testid="title-text"
|
|
43
|
-
>
|
|
44
|
-
{{ title }}
|
|
45
|
-
</h1>
|
|
46
|
-
</section>
|
|
47
|
-
<UnnnicIcon
|
|
48
|
-
v-if="showCloseIcon"
|
|
49
|
-
data-testid="close-icon"
|
|
50
|
-
icon="close"
|
|
51
|
-
clickable
|
|
52
|
-
scheme="neutral-cloudy"
|
|
53
|
-
@click="close()"
|
|
54
|
-
/>
|
|
55
|
-
</header>
|
|
34
|
+
<UnnnicDialogTitle>
|
|
35
|
+
{{ title }}
|
|
36
|
+
</UnnnicDialogTitle>
|
|
37
|
+
</UnnnicDialogHeader>
|
|
56
38
|
<section class="unnnic-modal-dialog__container__content">
|
|
57
39
|
<slot></slot>
|
|
58
40
|
</section>
|
|
59
|
-
|
|
41
|
+
|
|
42
|
+
<UnnnicDialogFooter
|
|
60
43
|
v-if="primaryButtonProps.text"
|
|
61
|
-
data-testid="actions-section"
|
|
62
44
|
:class="[
|
|
63
45
|
'unnnic-modal-dialog__container__actions',
|
|
64
46
|
{
|
|
@@ -66,6 +48,8 @@
|
|
|
66
48
|
showActionsDivider,
|
|
67
49
|
},
|
|
68
50
|
]"
|
|
51
|
+
:divider="showActionsDivider"
|
|
52
|
+
data-testid="actions-section"
|
|
69
53
|
>
|
|
70
54
|
<UnnnicButton
|
|
71
55
|
v-if="!hideSecondaryButton"
|
|
@@ -92,22 +76,30 @@
|
|
|
92
76
|
class="unnnic-modal-dialog__container__actions__primary-button"
|
|
93
77
|
@click.stop="$emit('primaryButtonClick')"
|
|
94
78
|
/>
|
|
95
|
-
</
|
|
79
|
+
</UnnnicDialogFooter>
|
|
96
80
|
</section>
|
|
97
|
-
</
|
|
98
|
-
</
|
|
81
|
+
</UnnnicDialogContent>
|
|
82
|
+
</UnnnicDialog>
|
|
99
83
|
</template>
|
|
100
84
|
|
|
101
85
|
<script>
|
|
102
|
-
import UnnnicIcon from '../Icon.vue';
|
|
103
86
|
import UnnnicButton from '../Button/Button.vue';
|
|
104
87
|
import UnnnicI18n from '../../mixins/i18n';
|
|
88
|
+
import UnnnicDialog from '../ui/dialog/Dialog.vue';
|
|
89
|
+
import UnnnicDialogContent from '../ui/dialog/DialogContent.vue';
|
|
90
|
+
import UnnnicDialogHeader from '../ui/dialog/DialogHeader.vue';
|
|
91
|
+
import UnnnicDialogTitle from '../ui/dialog/DialogTitle.vue';
|
|
92
|
+
import UnnnicDialogFooter from '../ui/dialog/DialogFooter.vue';
|
|
105
93
|
|
|
106
94
|
export default {
|
|
107
95
|
name: 'UnnnicModalDialog',
|
|
108
96
|
components: {
|
|
109
|
-
UnnnicIcon,
|
|
110
97
|
UnnnicButton,
|
|
98
|
+
UnnnicDialog,
|
|
99
|
+
UnnnicDialogContent,
|
|
100
|
+
UnnnicDialogHeader,
|
|
101
|
+
UnnnicDialogTitle,
|
|
102
|
+
UnnnicDialogFooter,
|
|
111
103
|
},
|
|
112
104
|
mixins: [UnnnicI18n],
|
|
113
105
|
props: {
|
|
@@ -177,11 +169,6 @@ export default {
|
|
|
177
169
|
es: 'Cancelar',
|
|
178
170
|
},
|
|
179
171
|
},
|
|
180
|
-
iconsMapper: {
|
|
181
|
-
success: { icon: 'check_circle', scheme: 'aux-green-500' },
|
|
182
|
-
warning: { icon: 'warning', scheme: 'aux-red-500' },
|
|
183
|
-
attention: { icon: 'error', scheme: 'aux-yellow-500' },
|
|
184
|
-
},
|
|
185
172
|
primaryButtonTypeMapper: {
|
|
186
173
|
success: 'primary',
|
|
187
174
|
warning: 'warning',
|
|
@@ -201,91 +188,39 @@ export default {
|
|
|
201
188
|
updateBodyOverflow(isHidden) {
|
|
202
189
|
document.body.style.overflow = isHidden ? 'hidden' : '';
|
|
203
190
|
},
|
|
191
|
+
persistentHandler(event) {
|
|
192
|
+
if (this.persistent) {
|
|
193
|
+
event.preventDefault();
|
|
194
|
+
}
|
|
195
|
+
},
|
|
204
196
|
},
|
|
205
197
|
};
|
|
206
198
|
</script>
|
|
207
199
|
|
|
208
200
|
<style lang="scss" scoped>
|
|
209
201
|
@use '@/assets/scss/unnnic' as *;
|
|
210
|
-
* {
|
|
211
|
-
margin: 0;
|
|
212
|
-
padding: 0;
|
|
213
|
-
box-sizing: border-box;
|
|
214
|
-
}
|
|
215
|
-
.unnnic-modal-dialog {
|
|
216
|
-
width: 100vw;
|
|
217
|
-
height: 100vh;
|
|
218
|
-
position: fixed;
|
|
219
|
-
left: 0;
|
|
220
|
-
top: 0;
|
|
221
|
-
display: flex;
|
|
222
|
-
justify-content: center;
|
|
223
|
-
align-items: center;
|
|
224
|
-
z-index: 9999;
|
|
225
|
-
|
|
226
|
-
&__overlay {
|
|
227
|
-
position: absolute;
|
|
228
|
-
width: 100%;
|
|
229
|
-
height: 100%;
|
|
230
|
-
background-color: rgba(0, 0, 0, 0.4);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
202
|
.unnnic-modal-dialog__container {
|
|
235
|
-
display: flex;
|
|
236
|
-
background: $unnnic-color-neutral-white;
|
|
237
|
-
border-radius: $unnnic-spacing-xs;
|
|
238
|
-
box-shadow: $unnnic-shadow-level-near;
|
|
239
|
-
position: fixed;
|
|
240
|
-
max-height: calc(100vh - $unnnic-spacing-giant);
|
|
241
|
-
overflow: hidden;
|
|
242
|
-
|
|
243
|
-
&--sm {
|
|
244
|
-
width: 400px;
|
|
245
|
-
}
|
|
246
|
-
&--md {
|
|
247
|
-
width: 600px;
|
|
248
|
-
}
|
|
249
|
-
&--lg {
|
|
250
|
-
width: 800px;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
203
|
&__left-sidebar {
|
|
254
204
|
background-color: $unnnic-color-neutral-black;
|
|
255
205
|
color: $unnnic-color-neutral-white;
|
|
206
|
+
|
|
207
|
+
grid-area: left-sidebar;
|
|
208
|
+
grid-row: span 3;
|
|
256
209
|
}
|
|
257
210
|
|
|
258
211
|
&__body {
|
|
259
212
|
flex: 1;
|
|
260
213
|
display: flex;
|
|
261
214
|
flex-direction: column;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
&__header {
|
|
265
|
-
display: flex;
|
|
266
|
-
justify-content: space-between;
|
|
267
|
-
align-items: center;
|
|
268
|
-
border-bottom: 1px solid $unnnic-color-neutral-soft;
|
|
269
|
-
padding: $unnnic-spacing-md;
|
|
270
|
-
flex-shrink: 0;
|
|
271
|
-
}
|
|
272
215
|
|
|
273
|
-
|
|
274
|
-
display: flex;
|
|
275
|
-
align-items: center;
|
|
276
|
-
gap: $unnnic-spacing-ant;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
&__title-icon {
|
|
280
|
-
font-size: 28px;
|
|
281
|
-
}
|
|
216
|
+
overflow-y: auto;
|
|
282
217
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
218
|
+
&--left-sidebar {
|
|
219
|
+
border-radius: $unnnic-radius-4 0 0 $unnnic-radius-4;
|
|
220
|
+
display: grid;
|
|
221
|
+
grid-template-columns: auto 1fr;
|
|
222
|
+
grid-template-areas: 'left-sidebar content';
|
|
223
|
+
}
|
|
289
224
|
}
|
|
290
225
|
|
|
291
226
|
&__content {
|
|
@@ -309,26 +244,5 @@ export default {
|
|
|
309
244
|
border-radius: $unnnic-border-radius-pill;
|
|
310
245
|
}
|
|
311
246
|
}
|
|
312
|
-
|
|
313
|
-
&__actions {
|
|
314
|
-
display: grid;
|
|
315
|
-
grid-template-columns: 1fr 1fr;
|
|
316
|
-
grid-template-areas: 'secondary-button primary-button';
|
|
317
|
-
gap: $unnnic-spacing-sm;
|
|
318
|
-
padding: $unnnic-spacing-md;
|
|
319
|
-
flex-shrink: 0;
|
|
320
|
-
|
|
321
|
-
&--divider {
|
|
322
|
-
border-top: 1px solid $unnnic-color-neutral-soft;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
&__secondary-button {
|
|
326
|
-
grid-area: secondary-button;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
&__primary-button {
|
|
330
|
-
grid-area: primary-button;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
247
|
}
|
|
334
248
|
</style>
|