@weni/unnnic-system 3.12.1-alpha.1 → 3.12.1

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 (175) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/Alert/Alert.vue.d.ts +3 -3
  3. package/dist/components/Alert/Version1dot1.vue.d.ts +1 -1
  4. package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +18 -92
  5. package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +36 -184
  6. package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +1 -1
  7. package/dist/components/Button/Button.vue.d.ts +2 -2
  8. package/dist/components/Card/AccountCard.vue.d.ts +2 -2
  9. package/dist/components/Card/Card.vue.d.ts +29 -103
  10. package/dist/components/Card/CardCompany.vue.d.ts +2 -2
  11. package/dist/components/Card/CardStatusesContainer.vue.d.ts +19 -93
  12. package/dist/components/Card/ContentCard.vue.d.ts +1 -1
  13. package/dist/components/Card/DashCard.vue.d.ts +2 -2
  14. package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
  15. package/dist/components/Card/MarketplaceCard.vue.d.ts +1 -1
  16. package/dist/components/Card/SimpleCard.vue.d.ts +18 -92
  17. package/dist/components/Card/StatusCard.vue.d.ts +1 -1
  18. package/dist/components/Card/TitleCard.vue.d.ts +18 -92
  19. package/dist/components/CardImage/CardImage.vue.d.ts +5 -5
  20. package/dist/components/CardInformation/CardInformation.vue.d.ts +19 -93
  21. package/dist/components/CardProject/CardProject.vue.d.ts +2 -2
  22. package/dist/components/Carousel/Carousel.vue.d.ts +2 -2
  23. package/dist/components/Carousel/TagCarousel.vue.d.ts +2 -2
  24. package/dist/components/ChartBar/ChartBar.vue.d.ts +24 -98
  25. package/dist/components/ChartLine/ChartLine.vue.d.ts +18 -92
  26. package/dist/components/ChatText/ChatText.vue.d.ts +18 -92
  27. package/dist/components/ChatsContact/ChatsContact.vue.d.ts +6 -6
  28. package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +18 -92
  29. package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +1 -1
  30. package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
  31. package/dist/components/DataArea/DataArea.vue.d.ts +18 -92
  32. package/dist/components/DataTable/index.vue.d.ts +1 -1
  33. package/dist/components/DataTable/index.vue.d.ts.map +1 -1
  34. package/dist/components/DateFilter/DateFilter.vue.d.ts +13 -13
  35. package/dist/components/Drawer/Drawer.vue.d.ts +207 -37
  36. package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
  37. package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
  38. package/dist/components/FormElement/FormElement.vue.d.ts +6 -6
  39. package/dist/components/ImportCard/ImportCard.vue.d.ts +6 -6
  40. package/dist/components/Input/Input.vue.d.ts +12 -12
  41. package/dist/components/Input/TextInput.vue.d.ts +2 -2
  42. package/dist/components/InputNext/InputNext.vue.d.ts +3 -3
  43. package/dist/components/Label/Label.vue.d.ts +1 -1
  44. package/dist/components/Label/Label.vue.d.ts.map +1 -1
  45. package/dist/components/Modal/Modal.vue.d.ts +1 -1
  46. package/dist/components/ModalDialog/ModalDialog.vue.d.ts +35 -209
  47. package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
  48. package/dist/components/ModalNext/ModalNext.vue.d.ts +18 -18
  49. package/dist/components/ModalUpload/ModalUpload.vue.d.ts +12 -12
  50. package/dist/components/MoodRating/MoodRating.vue.d.ts +18 -92
  51. package/dist/components/MultiSelect/MultiSelect.vue.d.ts +18 -18
  52. package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
  53. package/dist/components/Radio/Radio.vue.d.ts +6 -6
  54. package/dist/components/SelectSmart/SelectSmart.vue.d.ts +11 -11
  55. package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +2 -2
  56. package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +5 -5
  57. package/dist/components/SelectTime/index.vue.d.ts +3 -3
  58. package/dist/components/Slider/Slider.vue.d.ts +18 -92
  59. package/dist/components/Switch/Switch.vue.d.ts +3 -3
  60. package/dist/components/Tab/Tab.vue.d.ts +18 -92
  61. package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
  62. package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
  63. package/dist/components/Tag/DefaultTag.vue.d.ts +1 -1
  64. package/dist/components/Tag/Tag.vue.d.ts +2 -2
  65. package/dist/components/TextArea/TextArea.vue.d.ts +8 -8
  66. package/dist/components/Toast/Toast.vue.d.ts +1 -1
  67. package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
  68. package/dist/components/ToolTip/ToolTip.vue.d.ts +18 -92
  69. package/dist/components/ToolTip/ToolTip.vue.d.ts.map +1 -1
  70. package/dist/components/Tour/Tour.vue.d.ts +6 -6
  71. package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
  72. package/dist/components/UploadArea/UploadArea.vue.d.ts +6 -6
  73. package/dist/components/ui/popover/PopoverContent.vue.d.ts +2 -2
  74. package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
  75. package/dist/components/ui/popover/PopoverOption.vue.d.ts +1 -1
  76. package/dist/components/ui/popover/PopoverOption.vue.d.ts.map +1 -1
  77. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts.map +1 -1
  78. package/dist/{es-38bd0c9c.mjs → es-9756db6d.mjs} +1 -1
  79. package/dist/{index-561a4027.mjs → index-ab280280.mjs} +50935 -53788
  80. package/dist/{pt-br-14a3c647.mjs → pt-br-55135cbc.mjs} +1 -1
  81. package/dist/style.css +1 -1
  82. package/dist/unnnic.mjs +203 -231
  83. package/dist/unnnic.umd.js +44 -48
  84. package/package.json +2 -3
  85. package/src/assets/scss/tailwind.scss +0 -8
  86. package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
  87. package/src/components/Drawer/Drawer.vue +269 -190
  88. package/src/components/Drawer/__tests__/Drawer.spec.js +46 -37
  89. package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
  90. package/src/components/ModalDialog/ModalDialog.vue +148 -64
  91. package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +221 -11
  92. package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
  93. package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
  94. package/src/components/Toast/Toast.vue +9 -16
  95. package/src/components/ToolTip/ToolTip.vue +177 -25
  96. package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -339
  97. package/src/components/index.ts +0 -56
  98. package/src/components/ui/popover/PopoverContent.vue +2 -4
  99. package/src/components/ui/popover/PopoverTrigger.vue +1 -5
  100. package/src/stories/Drawer.stories.js +1 -1
  101. package/src/stories/ModalDialog.mdx +0 -3
  102. package/src/stories/ModalDialog.stories.js +1 -1
  103. package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -23
  104. package/dist/components/ui/dialog/Dialog.vue.d.ts.map +0 -1
  105. package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -19
  106. package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +0 -1
  107. package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -43
  108. package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +0 -1
  109. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -25
  110. package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +0 -1
  111. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -29
  112. package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +0 -1
  113. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -23
  114. package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +0 -1
  115. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -19
  116. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +0 -1
  117. package/dist/components/ui/dialog/index.d.ts +0 -8
  118. package/dist/components/ui/dialog/index.d.ts.map +0 -1
  119. package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -35
  120. package/dist/components/ui/drawer/Drawer.vue.d.ts.map +0 -1
  121. package/dist/components/ui/drawer/DrawerClose.vue.d.ts +0 -19
  122. package/dist/components/ui/drawer/DrawerClose.vue.d.ts.map +0 -1
  123. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -43
  124. package/dist/components/ui/drawer/DrawerContent.vue.d.ts.map +0 -1
  125. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -23
  126. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts.map +0 -1
  127. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -22
  128. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts.map +0 -1
  129. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -25
  130. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts.map +0 -1
  131. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -8
  132. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts.map +0 -1
  133. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -23
  134. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts.map +0 -1
  135. package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts +0 -19
  136. package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts.map +0 -1
  137. package/dist/components/ui/drawer/index.d.ts +0 -11
  138. package/dist/components/ui/drawer/index.d.ts.map +0 -1
  139. package/dist/components/ui/tooltip/Tooltip.vue.d.ts +0 -23
  140. package/dist/components/ui/tooltip/Tooltip.vue.d.ts.map +0 -1
  141. package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +0 -31
  142. package/dist/components/ui/tooltip/TooltipContent.vue.d.ts.map +0 -1
  143. package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +0 -19
  144. package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts.map +0 -1
  145. package/dist/components/ui/tooltip/index.d.ts +0 -4
  146. package/dist/components/ui/tooltip/index.d.ts.map +0 -1
  147. package/dist/lib/layer-manager.d.ts +0 -16
  148. package/dist/lib/layer-manager.d.ts.map +0 -1
  149. package/src/components/ui/dialog/Dialog.vue +0 -19
  150. package/src/components/ui/dialog/DialogClose.vue +0 -29
  151. package/src/components/ui/dialog/DialogContent.vue +0 -140
  152. package/src/components/ui/dialog/DialogFooter.vue +0 -50
  153. package/src/components/ui/dialog/DialogHeader.vue +0 -83
  154. package/src/components/ui/dialog/DialogTitle.vue +0 -38
  155. package/src/components/ui/dialog/DialogTrigger.vue +0 -16
  156. package/src/components/ui/dialog/index.ts +0 -7
  157. package/src/components/ui/drawer/Drawer.vue +0 -27
  158. package/src/components/ui/drawer/DrawerClose.vue +0 -37
  159. package/src/components/ui/drawer/DrawerContent.vue +0 -111
  160. package/src/components/ui/drawer/DrawerDescription.vue +0 -40
  161. package/src/components/ui/drawer/DrawerFooter.vue +0 -38
  162. package/src/components/ui/drawer/DrawerHeader.vue +0 -57
  163. package/src/components/ui/drawer/DrawerOverlay.vue +0 -33
  164. package/src/components/ui/drawer/DrawerTitle.vue +0 -37
  165. package/src/components/ui/drawer/DrawerTrigger.vue +0 -31
  166. package/src/components/ui/drawer/index.ts +0 -10
  167. package/src/components/ui/tooltip/Tooltip.vue +0 -21
  168. package/src/components/ui/tooltip/TooltipContent.vue +0 -74
  169. package/src/components/ui/tooltip/TooltipTrigger.vue +0 -26
  170. package/src/components/ui/tooltip/index.ts +0 -3
  171. package/src/lib/layer-manager.ts +0 -84
  172. package/src/stories/Dialog.stories.js +0 -832
  173. package/src/stories/DrawerNext.stories.js +0 -611
  174. package/src/stories/LayerManager.docs.mdx +0 -40
  175. package/src/stories/LayerManager.stories.js +0 -364
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weni/unnnic-system",
3
- "version": "3.12.1-alpha.1",
3
+ "version": "3.12.1",
4
4
  "type": "commonjs",
5
5
  "files": [
6
6
  "dist",
@@ -63,7 +63,6 @@
63
63
  "reka-ui": "^2.6.0",
64
64
  "remark-gfm": "^4.0.0",
65
65
  "tw-animate-css": "^1.4.0",
66
- "vaul-vue": "^0.4.1",
67
66
  "vue": "^3.4.8",
68
67
  "vue-i18n": "9",
69
68
  "vue-the-mask": "^0.11.1"
@@ -115,4 +114,4 @@
115
114
  "vue-eslint-parser": "^9.4.2",
116
115
  "vue-tsc": "^3.0.5"
117
116
  }
118
- }
117
+ }
@@ -92,13 +92,5 @@
92
92
  @apply bg-background text-foreground;
93
93
  font-family: $unnnic-font-family;
94
94
  }
95
-
96
- button {
97
- border: none;
98
- background: none;
99
- padding: 0;
100
- margin: 0;
101
- cursor: pointer;
102
- }
103
95
  }
104
96
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`UnnnicAlert.vue > matches the snapshot 1`] = `
4
4
  "<transition-stub data-v-c3231c18="" name="toast-slide" appear="true" persisted="false" css="true" data-testid="toast-transition">
5
- <aside data-v-c3231c18="" class="unnnic-toast unnnic-toast--success" role="status" aria-live="polite" data-testid="toast" style="z-index: 1405;">
5
+ <aside data-v-c3231c18="" class="unnnic-toast unnnic-toast--success" role="status" aria-live="polite" data-testid="toast">
6
6
  <section data-v-c3231c18="" class="unnnic-toast__content" data-testid="toast-content">
7
7
  <header data-v-c3231c18="" class="unnnic-toast__header" data-testid="toast-header"><span data-v-26446d8e="" data-v-c3231c18="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--green-500 unnnic-icon-size--ant unnnic-icon__size--ant" data-testid="toast-type-icon" translate="no">check_circle</span>
8
8
  <h3 data-v-c3231c18="" class="unnnic-toast__title" data-testid="toast-title">Test Alert</h3><span data-v-26446d8e="" data-v-c3231c18="" class="unnnic-icon material-symbols-rounded unnnic-icon-scheme--neutral-dark unnnic-icon-size--ant unnnic-icon__size--ant unnnic--clickable unnnic-toast__close" data-testid="toast-close-icon" translate="no">close</span>
@@ -1,210 +1,198 @@
1
1
  <template>
2
- <Drawer
2
+ <aside
3
+ v-if="modelValue"
3
4
  class="unnnic-drawer"
4
5
  data-testid="drawer"
5
- :open="modelValue"
6
- @update:open="$event ? () => {} : back()"
7
6
  >
8
- <DrawerContent
9
- v-bind="$attrs"
10
- :showOverlay="!withoutOverlay"
11
- data-testid="drawer-container"
12
- :size="mappedSize"
13
- :class="
14
- [
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"
16
+ >
17
+ <section
18
+ v-if="showDrawer"
19
+ data-testid="drawer-container"
20
+ :class="[
15
21
  'unnnic-drawer__container',
16
22
  `unnnic-drawer__container--${size}`,
17
- props.class,
18
- ]
19
- .filter(Boolean)
20
- .join(' ')
21
- "
22
- >
23
- <DrawerHeader class="unnnic-drawer__header">
24
- <section class="unnnic-drawer__title-container">
25
- <slot
26
- v-if="$slots.title"
27
- name="title"
28
- />
29
-
30
- <template v-else>
31
- <DrawerTitle
32
- class="unnnic-drawer__title"
33
- data-testid="drawer-title"
34
- >
35
- {{ title }}
36
- </DrawerTitle>
37
- <DrawerDescription
38
- v-if="description"
39
- class="unnnic-drawer__description"
40
- data-testid="drawer-description"
41
- >
42
- {{ description }}
43
- </DrawerDescription>
44
- </template>
45
- </section>
46
- <template #close>
47
- <DrawerClose>
48
- <UnnnicButton
49
- class="unnnic-drawer__close-icon"
50
- data-testid="close-icon"
51
- :iconCenter="closeIcon"
52
- size="small"
53
- type="tertiary"
54
- @click="back"
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"
55
30
  />
56
- </DrawerClose>
57
- </template>
58
- </DrawerHeader>
59
31
 
60
- <section class="unnnic-drawer__content">
61
- <slot name="content"></slot>
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"
55
+ />
56
+ </header>
57
+ <section class="unnnic-drawer__content">
58
+ <slot name="content"></slot>
59
+ </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>
62
86
  </section>
63
-
64
- <DrawerFooter
65
- v-if="showFooter"
66
- class="unnnic-drawer__footer"
67
- data-testid="footer"
68
- >
69
- <UnnnicButton
70
- v-if="secondaryButtonText"
71
- data-testid="secondary-button"
72
- size="large"
73
- type="tertiary"
74
- :disabled="disabledSecondaryButton"
75
- :loading="loadingSecondaryButton"
76
- :text="secondaryButtonText"
77
- @click="$emit('secondaryButtonClick')"
78
- />
79
- <UnnnicButton
80
- v-if="primaryButtonText"
81
- data-testid="primary-button"
82
- size="large"
83
- :disabled="disabledPrimaryButton"
84
- :loading="loadingPrimaryButton"
85
- :type="primaryButtonType"
86
- :text="primaryButtonText"
87
- @click="$emit('primaryButtonClick')"
88
- />
89
- </DrawerFooter>
90
- </DrawerContent>
91
- </Drawer>
87
+ </Transition>
88
+ </aside>
92
89
  </template>
93
90
 
94
- <script setup>
95
- import { computed } from 'vue';
96
-
91
+ <script>
92
+ import UnnnicIcon from '../Icon.vue';
97
93
  import UnnnicButton from '../Button/Button.vue';
98
- import {
99
- Drawer,
100
- DrawerContent,
101
- DrawerHeader,
102
- DrawerFooter,
103
- DrawerClose,
104
- DrawerTitle,
105
- DrawerDescription,
106
- } from '../ui/drawer';
107
-
108
- defineOptions({
109
- name: 'UnnnicDrawer',
110
- inheritAttrs: false,
111
- });
112
94
 
113
- const props = defineProps({
114
- title: {
115
- type: String,
116
- required: true,
117
- },
118
- description: {
119
- type: String,
120
- default: '',
121
- },
122
- disabledPrimaryButton: {
123
- type: Boolean,
124
- default: false,
125
- },
126
- disabledSecondaryButton: {
127
- type: Boolean,
128
- default: false,
129
- },
130
- loadingPrimaryButton: {
131
- type: Boolean,
132
- default: false,
133
- },
134
- loadingSecondaryButton: {
135
- type: Boolean,
136
- default: false,
137
- },
138
- primaryButtonText: {
139
- type: String,
140
- default: '',
141
- },
142
- primaryButtonType: {
143
- type: String,
144
- default: 'primary',
145
- },
146
- secondaryButtonText: {
147
- type: String,
148
- default: '',
95
+ export default {
96
+ name: 'UnnnicDrawer',
97
+ components: {
98
+ UnnnicIcon,
99
+ UnnnicButton,
149
100
  },
150
- size: {
151
- type: String,
152
- default: 'md',
153
- validator(val) {
154
- return ['md', 'lg', 'xl', 'gt'].includes(val);
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,
155
164
  },
156
165
  },
157
- modelValue: {
158
- type: Boolean,
159
- required: true,
160
- },
161
- withoutOverlay: {
162
- type: Boolean,
163
- default: false,
164
- },
165
- closeIcon: {
166
- type: String,
167
- default: 'arrow_forward',
166
+ emits: ['primaryButtonClick', 'secondaryButtonClick', 'close', 'back'],
167
+ data() {
168
+ return {
169
+ showDrawer: true,
170
+ };
168
171
  },
169
- distinctCloseBack: {
170
- type: Boolean,
171
- default: false,
172
+ computed: {
173
+ showFooter() {
174
+ return !!(this.primaryButtonText || this.secondaryButtonText);
175
+ },
172
176
  },
173
- class: {
174
- type: String,
175
- default: '',
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
+ }
194
+ },
176
195
  },
177
- });
178
-
179
- const emit = defineEmits([
180
- 'primaryButtonClick',
181
- 'secondaryButtonClick',
182
- 'close',
183
- 'back',
184
- ]);
185
- const showFooter = computed(
186
- () => !!(props.primaryButtonText || props.secondaryButtonText),
187
- );
188
- const mappedSize = computed(() => {
189
- const sizes = {
190
- md: 'medium',
191
- lg: 'large',
192
- xl: 'extra-large',
193
- gt: 'giant',
194
- };
195
- return sizes[props.size] || 'medium';
196
- });
197
-
198
- const close = () => {
199
- emit('close');
200
- };
201
-
202
- const back = () => {
203
- if (props.distinctCloseBack) {
204
- emit('back');
205
- } else {
206
- close();
207
- }
208
196
  };
209
197
  </script>
210
198
 
@@ -216,16 +204,107 @@ const back = () => {
216
204
  box-sizing: border-box;
217
205
  }
218
206
 
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
+
219
236
  .unnnic-drawer {
237
+ width: 100vw;
238
+ height: 100vh;
239
+ position: fixed;
240
+ left: 0;
241
+ top: 0;
220
242
  z-index: 8;
221
243
  }
222
244
 
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
+
223
252
  .unnnic-drawer__container {
224
253
  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
+ }
225
271
 
226
- .unnnic-drawer__close-icon {
227
- margin: $unnnic-spacing-nano;
272
+ &--xl {
273
+ width: 66%;
274
+ }
275
+
276
+ &--gt {
277
+ width: 75%;
278
+ }
279
+
280
+ .unnnic-drawer__header {
228
281
  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
+ }
229
308
  }
230
309
 
231
310
  .unnnic-drawer__content {