@weni/unnnic-system 3.11.3-alpha.2 → 3.12.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 +8 -0
- 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 +18 -109
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +36 -218
- 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 +29 -120
- package/dist/components/Card/CardCompany.vue.d.ts +2 -2
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +19 -110
- 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 +18 -109
- package/dist/components/Card/StatusCard.vue.d.ts +1 -1
- package/dist/components/Card/TitleCard.vue.d.ts +18 -109
- package/dist/components/CardImage/CardImage.vue.d.ts +5 -5
- package/dist/components/CardInformation/CardInformation.vue.d.ts +19 -110
- 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 +24 -115
- package/dist/components/ChartLine/ChartLine.vue.d.ts +18 -109
- package/dist/components/ChatText/ChatText.vue.d.ts +18 -109
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +6 -6
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +18 -109
- 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 +18 -109
- 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 +207 -37
- 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 +35 -209
- 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 +18 -109
- 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 +18 -109
- package/dist/components/Switch/Switch.vue.d.ts +2 -2
- package/dist/components/Tab/Tab.vue.d.ts +18 -109
- 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 +18 -109
- 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/popover/PopoverContent.vue.d.ts +2 -2
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/{es-99b102dc.mjs → es-9756db6d.mjs} +1 -1
- package/dist/{index-c20fa852.mjs → index-ab280280.mjs} +51987 -54801
- package/dist/{pt-br-b17e69b4.mjs → pt-br-55135cbc.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +203 -231
- package/dist/unnnic.umd.js +44 -48
- package/package.json +1 -2
- package/src/assets/scss/tailwind.scss +0 -8
- package/src/components/Drawer/Drawer.vue +269 -190
- package/src/components/Drawer/__tests__/Drawer.spec.js +46 -37
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
- package/src/components/ModalDialog/ModalDialog.vue +148 -64
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +221 -11
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
- package/src/components/Toast/Toast.vue +8 -12
- package/src/components/ToolTip/ToolTip.vue +188 -41
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -345
- package/src/components/index.ts +19 -75
- package/src/components/ui/popover/PopoverContent.vue +2 -0
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/ModalDialog.mdx +0 -3
- package/src/stories/ModalDialog.stories.js +1 -1
- package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -23
- package/dist/components/ui/dialog/Dialog.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -19
- package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -43
- package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -25
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -29
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -23
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -19
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/dialog/index.d.ts +0 -8
- package/dist/components/ui/dialog/index.d.ts.map +0 -1
- package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -35
- package/dist/components/ui/drawer/Drawer.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts +0 -19
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -42
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -23
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -22
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -25
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -8
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -23
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts +0 -19
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/drawer/index.d.ts +0 -11
- package/dist/components/ui/drawer/index.d.ts.map +0 -1
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +0 -23
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +0 -31
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts +0 -19
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +0 -19
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts.map +0 -1
- package/dist/components/ui/tooltip/index.d.ts +0 -5
- package/dist/components/ui/tooltip/index.d.ts.map +0 -1
- 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 -134
- 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 -37
- package/src/components/ui/drawer/DrawerContent.vue +0 -101
- 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 -15
- package/src/components/ui/tooltip/TooltipContent.vue +0 -73
- package/src/components/ui/tooltip/TooltipProvider.vue +0 -15
- package/src/components/ui/tooltip/TooltipTrigger.vue +0 -22
- package/src/components/ui/tooltip/index.ts +0 -4
- package/src/stories/Dialog.stories.js +0 -832
- package/src/stories/DrawerNext.stories.js +0 -610
|
@@ -5,19 +5,6 @@ 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
|
-
UnnnicDrawerNext: templateSlot,
|
|
14
|
-
UnnnicDrawerContent: templateSlot,
|
|
15
|
-
UnnnicDrawerFooter: templateSlot,
|
|
16
|
-
UnnnicDrawerClose: templateSlot,
|
|
17
|
-
UnnnicDrawerTitle: templateSlot,
|
|
18
|
-
UnnnicDrawerDescription: templateSlot,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
8
|
beforeEach(() => {
|
|
22
9
|
wrapper = mount(Drawer, {
|
|
23
10
|
props: {
|
|
@@ -28,14 +15,15 @@ describe('Drawer.vue', () => {
|
|
|
28
15
|
secondaryButtonText: 'Secondary Action',
|
|
29
16
|
},
|
|
30
17
|
global: {
|
|
31
|
-
stubs:
|
|
18
|
+
stubs: ['UnnnicIcon', 'UnnnicButton'],
|
|
32
19
|
},
|
|
33
20
|
});
|
|
34
21
|
});
|
|
35
22
|
|
|
36
23
|
const element = (id) => wrapper.find(`[data-testid="${id}"]`);
|
|
37
24
|
const component = (id) => wrapper.findComponent(`[data-testid="${id}"]`);
|
|
38
|
-
const
|
|
25
|
+
const drawer = () => element('drawer');
|
|
26
|
+
const overlay = () => element('overlay');
|
|
39
27
|
const title = () => element('drawer-title');
|
|
40
28
|
const description = () => element('drawer-description');
|
|
41
29
|
const primaryButton = () => component('primary-button');
|
|
@@ -43,8 +31,6 @@ describe('Drawer.vue', () => {
|
|
|
43
31
|
const footer = () => element('footer');
|
|
44
32
|
const closeIcon = () => component('close-icon');
|
|
45
33
|
const drawerContainer = () => element('drawer-container');
|
|
46
|
-
const drawerContentComponent = () =>
|
|
47
|
-
wrapper.findComponent({ name: 'UnnnicDrawerContent' });
|
|
48
34
|
|
|
49
35
|
describe('Component Rendering', () => {
|
|
50
36
|
describe('Component Rendering', () => {
|
|
@@ -53,21 +39,21 @@ describe('Drawer.vue', () => {
|
|
|
53
39
|
});
|
|
54
40
|
|
|
55
41
|
it('should render the drawer when modelValue is true', () => {
|
|
56
|
-
expect(
|
|
42
|
+
expect(drawer().exists()).toBe(true);
|
|
57
43
|
});
|
|
58
44
|
|
|
59
45
|
it('should not render the drawer when modelValue is false', async () => {
|
|
60
46
|
await wrapper.setProps({ modelValue: false });
|
|
61
|
-
expect(
|
|
47
|
+
expect(drawer().exists()).toBe(false);
|
|
62
48
|
});
|
|
63
49
|
|
|
64
50
|
it('should render the overlay when withoutOverlay is false', () => {
|
|
65
|
-
expect(
|
|
51
|
+
expect(overlay().exists()).toBe(true);
|
|
66
52
|
});
|
|
67
53
|
|
|
68
54
|
it('should not render the overlay when withoutOverlay is true', async () => {
|
|
69
55
|
await wrapper.setProps({ withoutOverlay: true });
|
|
70
|
-
expect(
|
|
56
|
+
expect(overlay().exists()).toBe(false);
|
|
71
57
|
});
|
|
72
58
|
|
|
73
59
|
it('should display the title and description correctly', () => {
|
|
@@ -89,11 +75,7 @@ describe('Drawer.vue', () => {
|
|
|
89
75
|
slots: {
|
|
90
76
|
content: '<div data-testid="slot-content">Slot Content</div>',
|
|
91
77
|
},
|
|
92
|
-
global: {
|
|
93
|
-
stubs: globalStubs,
|
|
94
|
-
},
|
|
95
78
|
});
|
|
96
|
-
|
|
97
79
|
expect(wrapper.find('[data-testid="slot-content"]').exists()).toBe(
|
|
98
80
|
true,
|
|
99
81
|
);
|
|
@@ -111,9 +93,6 @@ describe('Drawer.vue', () => {
|
|
|
111
93
|
slots: {
|
|
112
94
|
title: '<h2 data-testid="custom-title">Custom Title Content</h2>',
|
|
113
95
|
},
|
|
114
|
-
global: {
|
|
115
|
-
stubs: globalStubs,
|
|
116
|
-
},
|
|
117
96
|
});
|
|
118
97
|
|
|
119
98
|
expect(title().exists()).toBe(false);
|
|
@@ -134,9 +113,6 @@ describe('Drawer.vue', () => {
|
|
|
134
113
|
slots: {
|
|
135
114
|
title: '<div data-testid="custom-title">Slot Title</div>',
|
|
136
115
|
},
|
|
137
|
-
global: {
|
|
138
|
-
stubs: globalStubs,
|
|
139
|
-
},
|
|
140
116
|
});
|
|
141
117
|
|
|
142
118
|
expect(title().exists()).toBe(false);
|
|
@@ -188,7 +164,7 @@ describe('Drawer.vue', () => {
|
|
|
188
164
|
});
|
|
189
165
|
});
|
|
190
166
|
|
|
191
|
-
describe('Interactions', () => {
|
|
167
|
+
describe('Interactions and Transitions', () => {
|
|
192
168
|
beforeEach(() => {
|
|
193
169
|
vi.useFakeTimers();
|
|
194
170
|
});
|
|
@@ -198,6 +174,9 @@ describe('Drawer.vue', () => {
|
|
|
198
174
|
|
|
199
175
|
it('should close the drawer when the close icon is clicked', async () => {
|
|
200
176
|
await closeIcon().trigger('click');
|
|
177
|
+
|
|
178
|
+
vi.advanceTimersByTime(200);
|
|
179
|
+
|
|
201
180
|
expect(wrapper.emitted('close')).toBeTruthy();
|
|
202
181
|
});
|
|
203
182
|
|
|
@@ -205,6 +184,8 @@ describe('Drawer.vue', () => {
|
|
|
205
184
|
await wrapper.setProps({ distinctCloseBack: true });
|
|
206
185
|
await closeIcon().trigger('click');
|
|
207
186
|
|
|
187
|
+
vi.advanceTimersByTime(200);
|
|
188
|
+
|
|
208
189
|
expect(wrapper.emitted('back')).toBeTruthy();
|
|
209
190
|
});
|
|
210
191
|
|
|
@@ -212,21 +193,49 @@ describe('Drawer.vue', () => {
|
|
|
212
193
|
await closeIcon().trigger('click');
|
|
213
194
|
expect(wrapper.emitted('back')).toBeUndefined();
|
|
214
195
|
});
|
|
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
|
+
});
|
|
215
226
|
});
|
|
216
227
|
|
|
217
228
|
describe('Props and Computed Properties', () => {
|
|
218
229
|
it('should render the correct size class based on size prop', async () => {
|
|
219
230
|
await wrapper.setProps({ size: 'lg' });
|
|
220
|
-
expect(
|
|
231
|
+
expect(drawerContainer().classes()).toContain(
|
|
221
232
|
'unnnic-drawer__container--lg',
|
|
222
233
|
);
|
|
223
|
-
expect(drawerContentComponent().props('size')).toBe('large');
|
|
224
234
|
|
|
225
235
|
await wrapper.setProps({ size: 'xl' });
|
|
226
|
-
expect(
|
|
236
|
+
expect(drawerContainer().classes()).toContain(
|
|
227
237
|
'unnnic-drawer__container--xl',
|
|
228
238
|
);
|
|
229
|
-
expect(drawerContentComponent().props('size')).toBe('extra-large');
|
|
230
239
|
});
|
|
231
240
|
|
|
232
241
|
it('should display footer if either primaryButtonText or secondaryButtonText is provided', async () => {
|
|
@@ -266,7 +275,7 @@ describe('Drawer.vue', () => {
|
|
|
266
275
|
|
|
267
276
|
it('should use correct icon for close button based on closeIcon prop', async () => {
|
|
268
277
|
await wrapper.setProps({ closeIcon: 'custom_close_icon' });
|
|
269
|
-
expect(closeIcon().props('
|
|
278
|
+
expect(closeIcon().props('icon')).toBe('custom_close_icon');
|
|
270
279
|
});
|
|
271
280
|
|
|
272
281
|
it('should validate all size prop values correctly', () => {
|
|
@@ -1,22 +1,23 @@
|
|
|
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
|
-
</
|
|
4
|
+
"<aside data-v-196de012="" class="unnnic-drawer" data-testid="drawer">
|
|
5
|
+
<section data-v-196de012="" class="unnnic-drawer__overlay" data-testid="overlay"></section>
|
|
6
|
+
<transition-stub data-v-196de012="" name="drawer" appear="true" persisted="false" css="true">
|
|
7
|
+
<section data-v-196de012="" data-testid="drawer-container" class="unnnic-drawer__container unnnic-drawer__container--md">
|
|
8
|
+
<header data-v-196de012="" class="unnnic-drawer__header">
|
|
9
|
+
<section data-v-196de012="" class="unnnic-drawer__title-container">
|
|
10
|
+
<h1 data-v-196de012="" class="unnnic-drawer__title" data-testid="drawer-title">Test Title</h1>
|
|
11
|
+
<p data-v-196de012="" class="unnnic-drawer__description" data-testid="drawer-description">Test Description</p>
|
|
12
|
+
</section>
|
|
13
|
+
<unnnic-icon-stub data-v-196de012="" filled="false" icon="arrow_back" clickable="true" size="avatar-nano" scheme="neutral-darkest" class="unnnic-drawer__close" data-testid="close-icon"></unnnic-icon-stub>
|
|
14
|
+
</header>
|
|
15
|
+
<section data-v-196de012="" class="unnnic-drawer__content"></section>
|
|
16
|
+
<footer data-v-196de012="" class="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
|
+
</section>
|
|
21
|
+
</transition-stub>
|
|
22
|
+
</aside>"
|
|
22
23
|
`;
|
|
@@ -1,47 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<section
|
|
3
|
+
v-if="modelValue"
|
|
4
|
+
class="unnnic-modal-dialog"
|
|
5
|
+
data-testid="modal-dialog"
|
|
5
6
|
>
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
<section
|
|
8
|
+
class="unnnic-modal-dialog__overlay"
|
|
9
|
+
data-testid="modal-overlay"
|
|
10
|
+
@click.stop="!persistent && close()"
|
|
11
|
+
/>
|
|
12
|
+
<section
|
|
13
|
+
:class="[
|
|
14
|
+
'unnnic-modal-dialog__container',
|
|
15
|
+
`unnnic-modal-dialog__container--${size}`,
|
|
16
|
+
]"
|
|
17
|
+
data-testid="modal-container"
|
|
14
18
|
>
|
|
15
19
|
<section
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
'unnnic-modal-dialog__container__body--left-sidebar':
|
|
20
|
-
$slots.leftSidebar,
|
|
21
|
-
},
|
|
22
|
-
]"
|
|
20
|
+
v-if="$slots.leftSidebar"
|
|
21
|
+
class="unnnic-modal-dialog__container__left-sidebar"
|
|
23
22
|
>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</section>
|
|
30
|
-
<UnnnicDialogHeader
|
|
23
|
+
<slot name="leftSidebar" />
|
|
24
|
+
</section>
|
|
25
|
+
|
|
26
|
+
<section class="unnnic-modal-dialog__container__body">
|
|
27
|
+
<header
|
|
31
28
|
v-if="title"
|
|
32
|
-
|
|
33
|
-
:type="type"
|
|
29
|
+
class="unnnic-modal-dialog__container__header"
|
|
34
30
|
>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
<section class="unnnic-modal-dialog__container__title-container">
|
|
32
|
+
<UnnnicIcon
|
|
33
|
+
v-if="icon || type"
|
|
34
|
+
data-testid="title-icon"
|
|
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>
|
|
39
56
|
<section class="unnnic-modal-dialog__container__content">
|
|
40
57
|
<slot></slot>
|
|
41
58
|
</section>
|
|
42
|
-
|
|
43
|
-
<UnnnicDialogFooter
|
|
59
|
+
<section
|
|
44
60
|
v-if="primaryButtonProps.text"
|
|
61
|
+
data-testid="actions-section"
|
|
45
62
|
:class="[
|
|
46
63
|
'unnnic-modal-dialog__container__actions',
|
|
47
64
|
{
|
|
@@ -49,8 +66,6 @@
|
|
|
49
66
|
showActionsDivider,
|
|
50
67
|
},
|
|
51
68
|
]"
|
|
52
|
-
:divider="showActionsDivider"
|
|
53
|
-
data-testid="actions-section"
|
|
54
69
|
>
|
|
55
70
|
<UnnnicButton
|
|
56
71
|
v-if="!hideSecondaryButton"
|
|
@@ -77,32 +92,23 @@
|
|
|
77
92
|
class="unnnic-modal-dialog__container__actions__primary-button"
|
|
78
93
|
@click.stop="$emit('primaryButtonClick')"
|
|
79
94
|
/>
|
|
80
|
-
</
|
|
95
|
+
</section>
|
|
81
96
|
</section>
|
|
82
|
-
</
|
|
83
|
-
</
|
|
97
|
+
</section>
|
|
98
|
+
</section>
|
|
84
99
|
</template>
|
|
85
100
|
|
|
86
101
|
<script>
|
|
102
|
+
import UnnnicIcon from '../Icon.vue';
|
|
87
103
|
import UnnnicButton from '../Button/Button.vue';
|
|
88
104
|
import UnnnicI18n from '../../mixins/i18n';
|
|
89
|
-
import UnnnicDialog from '../ui/dialog/Dialog.vue';
|
|
90
|
-
import UnnnicDialogContent from '../ui/dialog/DialogContent.vue';
|
|
91
|
-
import UnnnicDialogHeader from '../ui/dialog/DialogHeader.vue';
|
|
92
|
-
import UnnnicDialogTitle from '../ui/dialog/DialogTitle.vue';
|
|
93
|
-
import UnnnicDialogFooter from '../ui/dialog/DialogFooter.vue';
|
|
94
105
|
|
|
95
106
|
export default {
|
|
96
107
|
name: 'UnnnicModalDialog',
|
|
97
108
|
components: {
|
|
109
|
+
UnnnicIcon,
|
|
98
110
|
UnnnicButton,
|
|
99
|
-
UnnnicDialog,
|
|
100
|
-
UnnnicDialogContent,
|
|
101
|
-
UnnnicDialogHeader,
|
|
102
|
-
UnnnicDialogTitle,
|
|
103
|
-
UnnnicDialogFooter,
|
|
104
111
|
},
|
|
105
|
-
inheritAttrs: false,
|
|
106
112
|
mixins: [UnnnicI18n],
|
|
107
113
|
props: {
|
|
108
114
|
modelValue: {
|
|
@@ -171,6 +177,11 @@ export default {
|
|
|
171
177
|
es: 'Cancelar',
|
|
172
178
|
},
|
|
173
179
|
},
|
|
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
|
+
},
|
|
174
185
|
primaryButtonTypeMapper: {
|
|
175
186
|
success: 'primary',
|
|
176
187
|
warning: 'warning',
|
|
@@ -190,39 +201,91 @@ export default {
|
|
|
190
201
|
updateBodyOverflow(isHidden) {
|
|
191
202
|
document.body.style.overflow = isHidden ? 'hidden' : '';
|
|
192
203
|
},
|
|
193
|
-
persistentHandler(event) {
|
|
194
|
-
if (this.persistent) {
|
|
195
|
-
event.preventDefault();
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
204
|
},
|
|
199
205
|
};
|
|
200
206
|
</script>
|
|
201
207
|
|
|
202
208
|
<style lang="scss" scoped>
|
|
203
209
|
@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
|
+
|
|
204
234
|
.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
|
+
|
|
205
253
|
&__left-sidebar {
|
|
206
254
|
background-color: $unnnic-color-neutral-black;
|
|
207
255
|
color: $unnnic-color-neutral-white;
|
|
208
|
-
|
|
209
|
-
grid-area: left-sidebar;
|
|
210
|
-
grid-row: span 3;
|
|
211
256
|
}
|
|
212
257
|
|
|
213
258
|
&__body {
|
|
214
259
|
flex: 1;
|
|
215
260
|
display: flex;
|
|
216
261
|
flex-direction: column;
|
|
262
|
+
}
|
|
217
263
|
|
|
218
|
-
|
|
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
|
+
}
|
|
219
272
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
273
|
+
&__title-container {
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
gap: $unnnic-spacing-ant;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&__title-icon {
|
|
280
|
+
font-size: 28px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&__title-text {
|
|
284
|
+
font-family: $unnnic-font-family-secondary;
|
|
285
|
+
font-size: $unnnic-font-size-title-sm;
|
|
286
|
+
font-weight: $unnnic-font-weight-black;
|
|
287
|
+
line-height: 28px;
|
|
288
|
+
color: $unnnic-color-neutral-darkest;
|
|
226
289
|
}
|
|
227
290
|
|
|
228
291
|
&__content {
|
|
@@ -246,5 +309,26 @@ export default {
|
|
|
246
309
|
border-radius: $unnnic-border-radius-pill;
|
|
247
310
|
}
|
|
248
311
|
}
|
|
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
|
+
}
|
|
249
333
|
}
|
|
250
334
|
</style>
|