@weni/unnnic-system 3.12.8 → 3.14.0-alpha-teleports.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.
Files changed (107) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +9 -1
  3. package/dist/{es-62c1e8d3.mjs → es-0d53b5b2.mjs} +1 -1
  4. package/dist/{index-ef197fd5.mjs → index-d7070de8.mjs} +99880 -96723
  5. package/dist/index.d.ts +5588 -1607
  6. package/dist/{pt-br-198b147b.mjs → pt-br-bf4e1f97.mjs} +1 -1
  7. package/dist/style.css +1 -1
  8. package/dist/unnnic.mjs +233 -203
  9. package/dist/unnnic.umd.js +48 -44
  10. package/package.json +3 -2
  11. package/src/assets/scss/tailwind.scss +8 -0
  12. package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
  13. package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +2 -1
  14. package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +61 -60
  15. package/src/components/Checkbox/Checkbox.vue +1 -1
  16. package/src/components/CheckboxGroup/CheckboxGroup.vue +5 -7
  17. package/src/components/Chip/Chip.vue +1 -1
  18. package/src/components/DatePicker/DatePicker.vue +10 -1
  19. package/src/components/Drawer/Drawer.vue +180 -270
  20. package/src/components/Drawer/__tests__/Drawer.spec.js +32 -43
  21. package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +18 -19
  22. package/src/components/FormElement/FormElement.vue +87 -96
  23. package/src/components/Input/BaseInput.vue +25 -5
  24. package/src/components/Input/Input.scss +2 -1
  25. package/src/components/Input/Input.vue +24 -1
  26. package/src/components/Input/TextInput.vue +64 -25
  27. package/src/components/Input/__test__/TextInput.spec.js +1 -1
  28. package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +5 -1
  29. package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +7 -1
  30. package/src/components/InputDatePicker/InputDatePicker.vue +68 -73
  31. package/src/components/InputDatePicker/__test__/InputDatePicker.spec.js +31 -24
  32. package/src/components/ModalDialog/ModalDialog.vue +63 -154
  33. package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +30 -210
  34. package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -22
  35. package/src/components/MultiSelect/MultSelectOption.vue +49 -0
  36. package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +557 -0
  37. package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +229 -0
  38. package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +87 -0
  39. package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +51 -0
  40. package/src/components/MultiSelect/index.vue +265 -0
  41. package/src/components/Radio/Radio.vue +6 -12
  42. package/src/components/Radio/__test__/Radio.spec.js +1 -3
  43. package/src/components/RadioGroup/RadioGroup.vue +10 -18
  44. package/src/components/Select/__tests__/Select.spec.js +422 -0
  45. package/src/components/Select/__tests__/SelectItem.spec.js +310 -0
  46. package/src/components/Select/__tests__/__snapshots__/Popover.spec.js.snap +8 -0
  47. package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +71 -0
  48. package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +15 -0
  49. package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +25 -0
  50. package/src/components/Select/__tests__/__snapshots__/SelectPopover.spec.js.snap +8 -0
  51. package/src/components/Select/index.vue +308 -0
  52. package/src/components/Switch/Switch.vue +3 -10
  53. package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +3 -1
  54. package/src/components/TemplatePreview/TemplatePreview.vue +25 -28
  55. package/src/components/TemplatePreview/TemplatePreviewModal.vue +10 -10
  56. package/src/components/TemplatePreview/types.d.ts +3 -3
  57. package/src/components/Toast/Toast.vue +4 -1
  58. package/src/components/Toast/ToastManager.ts +4 -1
  59. package/src/components/Toast/__tests__/ToastManager.spec.js +10 -6
  60. package/src/components/ToolTip/ToolTip.vue +25 -177
  61. package/src/components/ToolTip/__tests__/ToolTip.spec.js +339 -61
  62. package/src/components/index.ts +62 -6
  63. package/src/components/ui/dialog/Dialog.vue +19 -0
  64. package/src/components/ui/dialog/DialogClose.vue +29 -0
  65. package/src/components/ui/dialog/DialogContent.vue +140 -0
  66. package/src/components/ui/dialog/DialogFooter.vue +50 -0
  67. package/src/components/ui/dialog/DialogHeader.vue +83 -0
  68. package/src/components/ui/dialog/DialogTitle.vue +38 -0
  69. package/src/components/ui/dialog/DialogTrigger.vue +16 -0
  70. package/src/components/ui/dialog/index.ts +7 -0
  71. package/src/components/ui/drawer/Drawer.vue +27 -0
  72. package/src/components/ui/drawer/DrawerClose.vue +31 -0
  73. package/src/components/ui/drawer/DrawerContent.vue +113 -0
  74. package/src/components/ui/drawer/DrawerDescription.vue +40 -0
  75. package/src/components/ui/drawer/DrawerFooter.vue +38 -0
  76. package/src/components/ui/drawer/DrawerHeader.vue +57 -0
  77. package/src/components/ui/drawer/DrawerOverlay.vue +33 -0
  78. package/src/components/ui/drawer/DrawerTitle.vue +37 -0
  79. package/src/components/ui/drawer/DrawerTrigger.vue +31 -0
  80. package/src/components/ui/drawer/index.ts +10 -0
  81. package/src/components/ui/popover/PopoverContent.vue +7 -4
  82. package/src/components/ui/popover/PopoverOption.vue +4 -0
  83. package/src/components/ui/popover/PopoverTrigger.vue +5 -1
  84. package/src/components/ui/tooltip/Tooltip.vue +21 -0
  85. package/src/components/ui/tooltip/TooltipContent.vue +77 -0
  86. package/src/components/ui/tooltip/TooltipTrigger.vue +24 -0
  87. package/src/components/ui/tooltip/index.ts +3 -0
  88. package/src/index.ts +9 -2
  89. package/src/lib/__tests__/teleport-target.spec.ts +73 -0
  90. package/src/lib/layer-manager.ts +64 -0
  91. package/src/lib/teleport-target.ts +46 -0
  92. package/src/locales/en.json +3 -1
  93. package/src/locales/es.json +3 -1
  94. package/src/locales/pt_br.json +3 -1
  95. package/src/stories/Dialog.stories.js +832 -0
  96. package/src/stories/Drawer.stories.js +1 -1
  97. package/src/stories/DrawerNext.stories.js +611 -0
  98. package/src/stories/Input.mdx +3 -0
  99. package/src/stories/LayerManager.docs.mdx +40 -0
  100. package/src/stories/LayerManager.stories.js +407 -0
  101. package/src/stories/ModalDialog.mdx +3 -0
  102. package/src/stories/ModalDialog.stories.js +96 -1
  103. package/src/stories/MultiSelect.stories.js +143 -45
  104. package/src/stories/Select.stories.js +161 -0
  105. package/src/stories/TemplatePreview.stories.js +27 -27
  106. package/src/stories/TemplatePreviewModal.stories.js +31 -31
  107. package/src/components/MultiSelect/MultiSelect.vue +0 -297
@@ -1,198 +1,199 @@
1
1
  <template>
2
- <aside
3
- v-if="modelValue"
2
+ <Drawer
4
3
  class="unnnic-drawer"
5
4
  data-testid="drawer"
5
+ :open="modelValue"
6
+ @update:open="$event ? () => {} : back()"
6
7
  >
7
- <section
8
- v-if="!withoutOverlay"
9
- class="unnnic-drawer__overlay"
10
- data-testid="overlay"
11
- @click.stop="close"
12
- />
13
- <Transition
14
- appear
15
- name="drawer"
8
+ <DrawerContent
9
+ v-bind="$attrs"
10
+ :showOverlay="!withoutOverlay"
11
+ data-testid="drawer-container"
12
+ :size="mappedSize"
13
+ :class="[
14
+ 'unnnic-drawer__container',
15
+ `unnnic-drawer__container--${size}`,
16
+ props.class,
17
+ ].filter(Boolean).join(' ')"
16
18
  >
17
- <section
18
- v-if="showDrawer"
19
- data-testid="drawer-container"
20
- :class="[
21
- 'unnnic-drawer__container',
22
- `unnnic-drawer__container--${size}`,
23
- ]"
24
- >
25
- <header class="unnnic-drawer__header">
26
- <section class="unnnic-drawer__title-container">
27
- <slot
28
- v-if="$slots.title"
29
- name="title"
30
- />
31
-
32
- <template v-else>
33
- <h1
34
- class="unnnic-drawer__title"
35
- data-testid="drawer-title"
36
- >
37
- {{ title }}
38
- </h1>
39
- <p
40
- v-if="description"
41
- class="unnnic-drawer__description"
42
- data-testid="drawer-description"
43
- >
44
- {{ description }}
45
- </p>
46
- </template>
47
- </section>
48
- <UnnnicIcon
49
- class="unnnic-drawer__close"
50
- data-testid="close-icon"
51
- :icon="closeIcon"
52
- size="avatar-nano"
53
- clickable
54
- @click="back"
19
+ <DrawerHeader class="unnnic-drawer__header">
20
+ <section class="unnnic-drawer__title-container">
21
+ <slot
22
+ v-if="$slots.title"
23
+ name="title"
55
24
  />
56
- </header>
57
- <section class="unnnic-drawer__content">
58
- <slot name="content"></slot>
25
+
26
+ <template v-else>
27
+ <DrawerTitle
28
+ class="unnnic-drawer__title"
29
+ data-testid="drawer-title"
30
+ >
31
+ {{ title }}
32
+ </DrawerTitle>
33
+ <DrawerDescription
34
+ v-if="description"
35
+ class="unnnic-drawer__description"
36
+ data-testid="drawer-description"
37
+ >
38
+ {{ description }}
39
+ </DrawerDescription>
40
+ </template>
59
41
  </section>
60
- <footer
61
- v-if="showFooter"
62
- class="unnnic-drawer__footer"
63
- data-testid="footer"
64
- >
65
- <UnnnicButton
66
- v-if="secondaryButtonText"
67
- data-testid="secondary-button"
68
- size="large"
69
- type="tertiary"
70
- :disabled="disabledSecondaryButton"
71
- :loading="loadingSecondaryButton"
72
- :text="secondaryButtonText"
73
- @click="$emit('secondaryButtonClick')"
74
- />
75
- <UnnnicButton
76
- v-if="primaryButtonText"
77
- data-testid="primary-button"
78
- size="large"
79
- :disabled="disabledPrimaryButton"
80
- :loading="loadingPrimaryButton"
81
- :type="primaryButtonType"
82
- :text="primaryButtonText"
83
- @click="$emit('primaryButtonClick')"
84
- />
85
- </footer>
42
+ <template #close>
43
+ <DrawerClose>
44
+ <UnnnicButton
45
+ class="unnnic-drawer__close-icon"
46
+ data-testid="close-icon"
47
+ :iconCenter="closeIcon"
48
+ size="small"
49
+ type="tertiary"
50
+ @click="back"
51
+ />
52
+ </DrawerClose>
53
+ </template>
54
+ </DrawerHeader>
55
+
56
+ <section class="unnnic-drawer__content">
57
+ <slot name="content"></slot>
86
58
  </section>
87
- </Transition>
88
- </aside>
59
+
60
+ <DrawerFooter
61
+ v-if="showFooter"
62
+ class="unnnic-drawer__footer"
63
+ data-testid="footer"
64
+ >
65
+ <UnnnicButton
66
+ v-if="secondaryButtonText"
67
+ data-testid="secondary-button"
68
+ size="large"
69
+ type="tertiary"
70
+ :disabled="disabledSecondaryButton"
71
+ :loading="loadingSecondaryButton"
72
+ :text="secondaryButtonText"
73
+ @click="$emit('secondaryButtonClick')"
74
+ />
75
+ <UnnnicButton
76
+ v-if="primaryButtonText"
77
+ data-testid="primary-button"
78
+ size="large"
79
+ :disabled="disabledPrimaryButton"
80
+ :loading="loadingPrimaryButton"
81
+ :type="primaryButtonType"
82
+ :text="primaryButtonText"
83
+ @click="$emit('primaryButtonClick')"
84
+ />
85
+ </DrawerFooter>
86
+ </DrawerContent>
87
+ </Drawer>
89
88
  </template>
90
89
 
91
- <script>
92
- import UnnnicIcon from '../Icon.vue';
93
- import UnnnicButton from '../Button/Button.vue';
90
+ <script setup>
91
+ import { computed } from 'vue';
94
92
 
95
- export default {
93
+ import UnnnicButton from '../Button/Button.vue';
94
+ import {
95
+ Drawer,
96
+ DrawerContent,
97
+ DrawerHeader,
98
+ DrawerFooter,
99
+ DrawerClose,
100
+ DrawerTitle,
101
+ DrawerDescription,
102
+ } from '../ui/drawer';
103
+
104
+ defineOptions({
96
105
  name: 'UnnnicDrawer',
97
- components: {
98
- UnnnicIcon,
99
- UnnnicButton,
106
+ inheritAttrs: false,
107
+ });
108
+
109
+ const props = defineProps({
110
+ title: {
111
+ type: String,
112
+ required: true,
100
113
  },
101
- props: {
102
- title: {
103
- type: String,
104
- required: true,
105
- },
106
- description: {
107
- type: String,
108
- default: '',
109
- },
110
- disabledPrimaryButton: {
111
- type: Boolean,
112
- default: false,
113
- },
114
- disabledSecondaryButton: {
115
- type: Boolean,
116
- default: false,
117
- },
118
- loadingPrimaryButton: {
119
- type: Boolean,
120
- default: false,
121
- },
122
- loadingSecondaryButton: {
123
- type: Boolean,
124
- default: false,
125
- },
126
- primaryButtonText: {
127
- type: String,
128
- default: '',
129
- },
130
- primaryButtonType: {
131
- type: String,
132
- default: 'primary',
133
- },
134
- secondaryButtonText: {
135
- type: String,
136
- default: '',
137
- },
138
- size: {
139
- type: String,
140
- default: 'md',
141
- validator(val) {
142
- return ['md', 'lg', 'xl', 'gt'].includes(val);
143
- },
144
- },
145
- wide: {
146
- type: Boolean,
147
- default: false,
148
- },
149
- modelValue: {
150
- type: Boolean,
151
- required: true,
152
- },
153
- withoutOverlay: {
154
- type: Boolean,
155
- default: false,
156
- },
157
- closeIcon: {
158
- type: String,
159
- default: 'arrow_back',
160
- },
161
- distinctCloseBack: {
162
- type: Boolean,
163
- default: false,
164
- },
114
+ description: {
115
+ type: String,
116
+ default: '',
165
117
  },
166
- emits: ['primaryButtonClick', 'secondaryButtonClick', 'close', 'back'],
167
- data() {
168
- return {
169
- showDrawer: true,
170
- };
118
+ disabledPrimaryButton: {
119
+ type: Boolean,
120
+ default: false,
171
121
  },
172
- computed: {
173
- showFooter() {
174
- return !!(this.primaryButtonText || this.secondaryButtonText);
175
- },
122
+ disabledSecondaryButton: {
123
+ type: Boolean,
124
+ default: false,
176
125
  },
177
- methods: {
178
- transitionClose(callback) {
179
- this.showDrawer = false;
180
- setTimeout(() => {
181
- callback?.();
182
- this.showDrawer = true;
183
- }, 200);
184
- },
185
- close() {
186
- this.transitionClose(() => this.$emit('close'));
187
- },
188
- back() {
189
- if (this.distinctCloseBack) {
190
- this.transitionClose(() => this.$emit('back'));
191
- } else {
192
- this.close();
193
- }
126
+ loadingPrimaryButton: {
127
+ type: Boolean,
128
+ default: false,
129
+ },
130
+ loadingSecondaryButton: {
131
+ type: Boolean,
132
+ default: false,
133
+ },
134
+ primaryButtonText: {
135
+ type: String,
136
+ default: '',
137
+ },
138
+ primaryButtonType: {
139
+ type: String,
140
+ default: 'primary',
141
+ },
142
+ secondaryButtonText: {
143
+ type: String,
144
+ default: '',
145
+ },
146
+ size: {
147
+ type: String,
148
+ default: 'md',
149
+ validator(val) {
150
+ return ['md', 'lg', 'xl', 'gt'].includes(val);
194
151
  },
195
152
  },
153
+ modelValue: {
154
+ type: Boolean,
155
+ required: true,
156
+ },
157
+ withoutOverlay: {
158
+ type: Boolean,
159
+ default: false,
160
+ },
161
+ closeIcon: {
162
+ type: String,
163
+ default: 'arrow_forward',
164
+ },
165
+ distinctCloseBack: {
166
+ type: Boolean,
167
+ default: false,
168
+ },
169
+ class: {
170
+ type: String,
171
+ default: '',
172
+ },
173
+ });
174
+
175
+ const emit = defineEmits(['primaryButtonClick', 'secondaryButtonClick', 'close', 'back']);
176
+ const showFooter = computed(() => !!(props.primaryButtonText || props.secondaryButtonText));
177
+ const mappedSize = computed(() => {
178
+ const sizes = {
179
+ md: 'medium',
180
+ lg: 'large',
181
+ xl: 'extra-large',
182
+ gt: 'giant',
183
+ }
184
+ return sizes[props.size] || 'medium';
185
+ });
186
+
187
+ const close = () => {
188
+ emit('close');
189
+ };
190
+
191
+ const back = () => {
192
+ if (props.distinctCloseBack) {
193
+ emit('back');
194
+ } else {
195
+ close();
196
+ }
196
197
  };
197
198
  </script>
198
199
 
@@ -204,107 +205,16 @@ export default {
204
205
  box-sizing: border-box;
205
206
  }
206
207
 
207
- @keyframes drawerOpen {
208
- from {
209
- transform: translateX(100%);
210
- }
211
- to {
212
- transform: translateX(0);
213
- }
214
- }
215
-
216
- @keyframes drawerClose {
217
- from {
218
- transform: translateX(0);
219
- }
220
- to {
221
- transform: translateX(100%);
222
- }
223
- }
224
-
225
- .drawer-enter-active,
226
- .drawer-enter-to {
227
- animation: drawerOpen 200ms ease-in;
228
- }
229
-
230
- .drawer-leave-active,
231
- .drawer-leave-to {
232
- display: none;
233
- animation: drawerClose 200ms ease-in;
234
- }
235
-
236
208
  .unnnic-drawer {
237
- width: 100vw;
238
- height: 100vh;
239
- position: fixed;
240
- left: 0;
241
- top: 0;
242
209
  z-index: 8;
243
210
  }
244
211
 
245
- .unnnic-drawer__overlay {
246
- z-index: 9;
247
- background-color: rgba(0, 0, 0, 0.4);
248
- width: 100%;
249
- height: 100%;
250
- }
251
-
252
212
  .unnnic-drawer__container {
253
213
  z-index: 10;
254
- top: 0;
255
- right: 0;
256
- position: fixed;
257
- display: flex;
258
- flex-direction: column;
259
- font-family: $unnnic-font-family-secondary;
260
- justify-content: space-between;
261
- height: 100%;
262
- background-color: $unnnic-color-neutral-white;
263
-
264
- &--md {
265
- width: calc(100% / 3);
266
- }
267
-
268
- &--lg {
269
- width: 50%;
270
- }
271
214
 
272
- &--xl {
273
- width: 66%;
274
- }
275
-
276
- &--gt {
277
- width: 75%;
278
- }
279
-
280
- .unnnic-drawer__header {
215
+ .unnnic-drawer__close-icon {
216
+ margin: $unnnic-spacing-nano;
281
217
  display: flex;
282
- justify-content: space-between;
283
- border-bottom: 1px solid $unnnic-color-neutral-soft;
284
- padding: $unnnic-spacing-md;
285
- .unnnic-drawer__title-container {
286
- .unnnic-drawer__title {
287
- color: $unnnic-color-neutral-darkest;
288
- font-family: $unnnic-font-family-secondary;
289
- font-size: $unnnic-font-size-title-sm;
290
- font-weight: $unnnic-font-weight-black;
291
- line-height: $unnnic-line-height-large * 1.75;
292
- }
293
-
294
- .unnnic-drawer__description {
295
- color: $unnnic-color-neutral-cloudy;
296
- font-family: $unnnic-font-family-secondary;
297
- font-size: $unnnic-font-size-body-gt;
298
- font-weight: $unnnic-font-weight-regular;
299
- line-height: $unnnic-line-height-large * 1.375;
300
- }
301
- }
302
-
303
- .unnnic-drawer__close {
304
- margin: $unnnic-spacing-nano;
305
- transform: rotate(180deg);
306
- display: flex;
307
- }
308
218
  }
309
219
 
310
220
  .unnnic-drawer__content {
@@ -5,6 +5,19 @@ 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
+
8
21
  beforeEach(() => {
9
22
  wrapper = mount(Drawer, {
10
23
  props: {
@@ -15,7 +28,7 @@ describe('Drawer.vue', () => {
15
28
  secondaryButtonText: 'Secondary Action',
16
29
  },
17
30
  global: {
18
- stubs: ['UnnnicIcon', 'UnnnicButton'],
31
+ stubs: globalStubs,
19
32
  },
20
33
  });
21
34
  });
@@ -23,7 +36,6 @@ describe('Drawer.vue', () => {
23
36
  const element = (id) => wrapper.find(`[data-testid="${id}"]`);
24
37
  const component = (id) => wrapper.findComponent(`[data-testid="${id}"]`);
25
38
  const drawer = () => element('drawer');
26
- const overlay = () => element('overlay');
27
39
  const title = () => element('drawer-title');
28
40
  const description = () => element('drawer-description');
29
41
  const primaryButton = () => component('primary-button');
@@ -39,21 +51,23 @@ describe('Drawer.vue', () => {
39
51
  });
40
52
 
41
53
  it('should render the drawer when modelValue is true', () => {
42
- expect(drawer().exists()).toBe(true);
54
+ expect(drawer().attributes('open')).toBe('true');
43
55
  });
44
56
 
45
57
  it('should not render the drawer when modelValue is false', async () => {
46
58
  await wrapper.setProps({ modelValue: false });
47
- expect(drawer().exists()).toBe(false);
59
+ expect(drawer().attributes('open')).toBe('false');
48
60
  });
49
61
 
50
62
  it('should render the overlay when withoutOverlay is false', () => {
51
- expect(overlay().exists()).toBe(true);
63
+ console.log('wrapper.html()', wrapper.html());
64
+
65
+ expect(drawerContainer().attributes('showoverlay')).toBe('true');
52
66
  });
53
67
 
54
68
  it('should not render the overlay when withoutOverlay is true', async () => {
55
69
  await wrapper.setProps({ withoutOverlay: true });
56
- expect(overlay().exists()).toBe(false);
70
+ expect(drawerContainer().attributes('showoverlay')).toBe('false');
57
71
  });
58
72
 
59
73
  it('should display the title and description correctly', () => {
@@ -75,7 +89,11 @@ describe('Drawer.vue', () => {
75
89
  slots: {
76
90
  content: '<div data-testid="slot-content">Slot Content</div>',
77
91
  },
92
+ global: {
93
+ stubs: globalStubs,
94
+ },
78
95
  });
96
+
79
97
  expect(wrapper.find('[data-testid="slot-content"]').exists()).toBe(
80
98
  true,
81
99
  );
@@ -93,6 +111,9 @@ describe('Drawer.vue', () => {
93
111
  slots: {
94
112
  title: '<h2 data-testid="custom-title">Custom Title Content</h2>',
95
113
  },
114
+ global: {
115
+ stubs: globalStubs,
116
+ },
96
117
  });
97
118
 
98
119
  expect(title().exists()).toBe(false);
@@ -113,6 +134,9 @@ describe('Drawer.vue', () => {
113
134
  slots: {
114
135
  title: '<div data-testid="custom-title">Slot Title</div>',
115
136
  },
137
+ global: {
138
+ stubs: globalStubs,
139
+ },
116
140
  });
117
141
 
118
142
  expect(title().exists()).toBe(false);
@@ -164,7 +188,7 @@ describe('Drawer.vue', () => {
164
188
  });
165
189
  });
166
190
 
167
- describe('Interactions and Transitions', () => {
191
+ describe('Interactions', () => {
168
192
  beforeEach(() => {
169
193
  vi.useFakeTimers();
170
194
  });
@@ -174,9 +198,6 @@ describe('Drawer.vue', () => {
174
198
 
175
199
  it('should close the drawer when the close icon is clicked', async () => {
176
200
  await closeIcon().trigger('click');
177
-
178
- vi.advanceTimersByTime(200);
179
-
180
201
  expect(wrapper.emitted('close')).toBeTruthy();
181
202
  });
182
203
 
@@ -184,8 +205,6 @@ describe('Drawer.vue', () => {
184
205
  await wrapper.setProps({ distinctCloseBack: true });
185
206
  await closeIcon().trigger('click');
186
207
 
187
- vi.advanceTimersByTime(200);
188
-
189
208
  expect(wrapper.emitted('back')).toBeTruthy();
190
209
  });
191
210
 
@@ -193,36 +212,6 @@ describe('Drawer.vue', () => {
193
212
  await closeIcon().trigger('click');
194
213
  expect(wrapper.emitted('back')).toBeUndefined();
195
214
  });
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
215
  });
227
216
 
228
217
  describe('Props and Computed Properties', () => {
@@ -275,7 +264,7 @@ describe('Drawer.vue', () => {
275
264
 
276
265
  it('should use correct icon for close button based on closeIcon prop', async () => {
277
266
  await wrapper.setProps({ closeIcon: 'custom_close_icon' });
278
- expect(closeIcon().props('icon')).toBe('custom_close_icon');
267
+ expect(closeIcon().props('iconCenter')).toBe('custom_close_icon');
279
268
  });
280
269
 
281
270
  it('should validate all size prop values correctly', () => {