edvoyui-component-library-test-flight 0.0.21 → 0.0.23

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 (125) hide show
  1. package/dist/EUIButton.vue.d.ts.map +1 -0
  2. package/dist/library-vue-ts.cjs.js +4 -3
  3. package/dist/library-vue-ts.es.js +3 -8
  4. package/dist/library-vue-ts.umd.js +4 -3
  5. package/dist/select/EUISelect.vue.d.ts.map +1 -0
  6. package/package.json +4 -2
  7. package/src/App.vue +16 -0
  8. package/src/assets/fonts/gilroy/GilroyBold/font.woff +0 -0
  9. package/src/assets/fonts/gilroy/GilroyBold/font.woff2 +0 -0
  10. package/src/assets/fonts/gilroy/GilroyBoldItalic/font.woff +0 -0
  11. package/src/assets/fonts/gilroy/GilroyBoldItalic/font.woff2 +0 -0
  12. package/src/assets/fonts/gilroy/GilroyExtraBold/font.woff +0 -0
  13. package/src/assets/fonts/gilroy/GilroyExtraBold/font.woff2 +0 -0
  14. package/src/assets/fonts/gilroy/GilroyExtraBoldItalic/font.woff +0 -0
  15. package/src/assets/fonts/gilroy/GilroyExtraBoldItalic/font.woff2 +0 -0
  16. package/src/assets/fonts/gilroy/GilroyMedium/font.woff +0 -0
  17. package/src/assets/fonts/gilroy/GilroyMedium/font.woff2 +0 -0
  18. package/src/assets/fonts/gilroy/GilroyRegular/font.woff +0 -0
  19. package/src/assets/fonts/gilroy/GilroyRegular/font.woff2 +0 -0
  20. package/src/assets/fonts/gilroy/GilroySemiBold/font.woff +0 -0
  21. package/src/assets/fonts/gilroy/GilroySemiBold/font.woff2 +0 -0
  22. package/src/assets/fonts/inter/Inter-Bold.woff +0 -0
  23. package/src/assets/fonts/inter/Inter-Bold.woff2 +0 -0
  24. package/src/assets/fonts/inter/Inter-Italic.woff +0 -0
  25. package/src/assets/fonts/inter/Inter-Italic.woff2 +0 -0
  26. package/src/assets/fonts/inter/Inter-Medium.woff +0 -0
  27. package/src/assets/fonts/inter/Inter-Medium.woff2 +0 -0
  28. package/src/assets/fonts/inter/Inter-MediumItalic.woff +0 -0
  29. package/src/assets/fonts/inter/Inter-MediumItalic.woff2 +0 -0
  30. package/src/assets/fonts/inter/Inter-Regular.woff +0 -0
  31. package/src/assets/fonts/inter/Inter-Regular.woff2 +0 -0
  32. package/src/assets/fonts/inter/Inter-SemiBold.woff +0 -0
  33. package/src/assets/fonts/inter/Inter-SemiBold.woff2 +0 -0
  34. package/src/assets/fonts/inter/Inter-SemiBoldItalic.woff +0 -0
  35. package/src/assets/fonts/inter/Inter-SemiBoldItalic.woff2 +0 -0
  36. package/src/assets/scss/body.scss +15 -0
  37. package/src/assets/svg/ChevronDownSolid.vue +19 -0
  38. package/src/assets/svg/ChevronDownStroke.vue +22 -0
  39. package/src/assets/svg/SortArrow.vue +24 -0
  40. package/src/assets/svg/Student.vue +30 -0
  41. package/src/assets/svg/partner.vue +33 -0
  42. package/src/assets/svg/people.vue +25 -0
  43. package/src/assets/vue.svg +1 -0
  44. package/src/components/HelloWorld.vue +999 -0
  45. package/src/components/accordion/EUIAccordion.stories.ts +157 -0
  46. package/src/components/accordion/EUIAccordion.vue +90 -0
  47. package/src/components/avatar/EUIAvatar.stories.ts +157 -0
  48. package/src/components/avatar/EUIAvatar.vue +96 -0
  49. package/src/components/button/EUIButton.stories.ts +252 -0
  50. package/src/components/button/EUIButton.vue +151 -0
  51. package/src/components/checkbox/EUICheckbox.stories.ts +58 -0
  52. package/src/components/checkbox/EUICheckbox.vue +103 -0
  53. package/src/components/datepicker/EUIDatepicker.stories.ts +236 -0
  54. package/src/components/datepicker/EUIDatepicker.vue +185 -0
  55. package/src/components/delete.vue +108 -0
  56. package/src/components/dropdown/EUIMultiDropdown.stories.ts +187 -0
  57. package/src/components/dropdown/EUIMultiDropdown.vue +129 -0
  58. package/src/components/errorMessage/EUIErrorMessage.scss +0 -0
  59. package/src/components/errorMessage/EUIErrorMessage.stories.ts +41 -0
  60. package/src/components/errorMessage/EUIErrorMessage.vue +25 -0
  61. package/src/components/index.ts +46 -0
  62. package/src/components/input/EUIInput.stories.ts +174 -0
  63. package/src/components/input/EUIInput.vue +169 -0
  64. package/src/components/inputNormal/EUIInputNormal.stories.ts +164 -0
  65. package/src/components/inputNormal/EUIInputNormal.vue +161 -0
  66. package/src/components/loader/EUICircleLoader.vue +31 -0
  67. package/src/components/loader/EUICubeLoader.vue +237 -0
  68. package/src/components/loader/EUILoader.stories.ts +99 -0
  69. package/src/components/loader/EUILoader.vue +17 -0
  70. package/src/components/loader/EUISquareLoader.vue +47 -0
  71. package/src/components/modal/EUIModal.stories.ts +372 -0
  72. package/src/components/modal/EUIModal.vue +163 -0
  73. package/src/components/pillSelect/EUIPillSelect.stories.ts +74 -0
  74. package/src/components/pillSelect/EUIPillSelect.vue +149 -0
  75. package/src/components/popover/EUIPopover.stories.ts +247 -0
  76. package/src/components/popover/EUIPopover.vue +159 -0
  77. package/src/components/radio/EUIRadio.stories.ts +54 -0
  78. package/src/components/radio/EUIRadio.vue +78 -0
  79. package/src/components/searchInput/EUISearch.stories.ts +24 -0
  80. package/src/components/searchInput/EUISearch.vue +215 -0
  81. package/src/components/select/EUISelect.scss +0 -0
  82. package/src/components/select/EUISelect.stories.ts +49 -0
  83. package/src/components/select/EUISelect.vue +682 -0
  84. package/src/components/selectSearch/EUISelectSearch.vue +23 -0
  85. package/src/components/slideover/EUISlideover.stories.ts +318 -0
  86. package/src/components/slideover/EUISlideover.vue +207 -0
  87. package/src/components/stepperTimeline/EUIStepperHorizontal.vue +112 -0
  88. package/src/components/stepperTimeline/EUIStepperTimeline.stories.ts +54 -0
  89. package/src/components/stepperTimeline/EUIStepperTimeline.vue +16 -0
  90. package/src/components/stepperTimeline/EUIStepperVertical.vue +112 -0
  91. package/src/components/table/EUIDashboardTable.vue +482 -0
  92. package/src/components/table/EUIPageLimit.vue +66 -0
  93. package/src/components/table/EUIPagination.vue +175 -0
  94. package/src/components/table/EUIStudentPagination.vue +172 -0
  95. package/src/components/table/EUITable.stories.ts +190 -0
  96. package/src/components/table/EUITable.vue +508 -0
  97. package/src/components/table/EUITableCheckbox.vue +97 -0
  98. package/src/components/tabs/EUITabs.vue +128 -0
  99. package/src/components/tabs/EUItabs.stories.ts +123 -0
  100. package/src/components/tag/EUITag.stories.ts +46 -0
  101. package/src/components/tag/EUITag.vue +46 -0
  102. package/src/components/telephone/EUITelephone.stories.ts +202 -0
  103. package/src/components/telephone/EUITelephone.vue +280 -0
  104. package/src/components/textArea/EUITextArea.stories.ts +82 -0
  105. package/src/components/textArea/EUITextArea.vue +122 -0
  106. package/src/components/timeLine/EUITimeLine.stories.ts +247 -0
  107. package/src/components/timeLine/EUITimeLine.vue +43 -0
  108. package/src/components/timeLine/EUITimeLineItem.vue +124 -0
  109. package/src/components/toggle/EUIToggle.stories.ts +63 -0
  110. package/src/components/toggle/EUIToggle.vue +99 -0
  111. package/src/components/tooltip/EUITooltip.stories.ts +53 -0
  112. package/src/components/tooltip/EUITooltip.vue +108 -0
  113. package/src/data/books.ts +163 -0
  114. package/src/data/tab.ts +33 -0
  115. package/src/data/table.ts +5392 -0
  116. package/src/main.ts +5 -0
  117. package/src/utils/lodash.ts +9 -0
  118. package/src/utils/types.ts +9 -0
  119. package/src/vite-env.d.ts +5 -0
  120. package/dist/EUISelect.vue.d.ts.map +0 -1
  121. package/dist/button/EUIButton.vue.d.ts.map +0 -1
  122. package/dist/library-vue-ts.css +0 -1
  123. package/dist/style.scss +0 -118
  124. /package/dist/{button/EUIButton.vue.d.ts → EUIButton.vue.d.ts} +0 -0
  125. /package/dist/{EUISelect.vue.d.ts → select/EUISelect.vue.d.ts} +0 -0
@@ -0,0 +1,372 @@
1
+ import type { Meta, StoryObj } from "@storybook/vue3";
2
+ import { action } from "@storybook/addon-actions";
3
+ import { ref } from "vue";
4
+ import EUIModal from "./EUIModal.vue";
5
+ import EUIButton from "../button/EUIButton.vue";
6
+
7
+ const meta: Meta<typeof EUIModal> = {
8
+ title: "Example/Modal",
9
+ component: EUIModal,
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ ...{
13
+ isVisible: {
14
+ control: "boolean",
15
+ description: "Controls the visibility of the EUIModal.",
16
+ },
17
+ slimHeader: {
18
+ control: "boolean",
19
+ description: "Enables a slimmer header style for the modal.",
20
+ defaultValue: false,
21
+ },
22
+ title: {
23
+ control: "text",
24
+ description: "Sets the title displayed in the modal header.",
25
+ defaultValue: "Default Modal Title",
26
+ },
27
+ roundedClass: {
28
+ control: "text",
29
+ description:
30
+ "CSS class for defining custom border radius of the modal.",
31
+ defaultValue: "",
32
+ },
33
+ "update:isVisible": {
34
+ action: "update:isVisible",
35
+ description: "Triggers when the modal's visibility is updated.",
36
+ },
37
+ confirm: {
38
+ action: "confirm",
39
+ description: "Emits when the confirm button is clicked.",
40
+ },
41
+ },
42
+ },
43
+ parameters: {
44
+ actions: {
45
+ handles: ["update:isVisible"],
46
+ },
47
+ },
48
+ };
49
+
50
+ export default meta;
51
+ type Story = StoryObj<typeof meta>;
52
+
53
+ // Default EUIModal story with basic content
54
+ export const Default: Story = {
55
+ args: {
56
+ isVisible: false,
57
+ },
58
+ render: (args) => ({
59
+ components: { EUIModal, EUIButton },
60
+ setup() {
61
+ const isModalVisible = ref(args.isVisible);
62
+
63
+ const openModal = () => {
64
+ isModalVisible.value = true;
65
+ action("update:isVisible")(true);
66
+ };
67
+
68
+ const closeModal = () => {
69
+ isModalVisible.value = false;
70
+ action("update:isVisible")(false);
71
+ };
72
+
73
+ return {
74
+ args,
75
+ isModalVisible,
76
+ openModal,
77
+ closeModal,
78
+ onConfirm: action("confirm"),
79
+ };
80
+ },
81
+ template: `
82
+ <EUIButton size="md" color="purple" @click="openModal">Open Modal</EUIButton>
83
+ <EUIModal v-bind="args" :isVisible="isModalVisible" @update:isVisible="closeModal" @confirm="onConfirm">
84
+ <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus
85
+ quas possimus ea culpa id voluptatum cumque, animi earum sequi,
86
+ aliquid eius omnis repellendus nihil soluta vitae a temporibus!
87
+ Perspiciatis, nihil?</p>
88
+ </EUIModal>
89
+ `,
90
+ }),
91
+ parameters: {
92
+ docs: {
93
+ description: {
94
+ story:
95
+ "This story demonstrates a modal component that is initially hidden. Clicking the 'Open Modal' button triggers the modal to appear, and it can be closed through the close button inside the modal or the cancel button. The modal also includes a 'Confirm' button that emits a `confirm` event, which is logged in Storybook’s actions panel.",
96
+ },
97
+ source: {
98
+ code: `<script setup lang="ts">
99
+ import { ref } from "vue";
100
+ const isModalVisible = ref(false);
101
+
102
+ const openModal = () => {
103
+ isModalVisible.value = true;
104
+ };
105
+
106
+ const closeModal = () => {
107
+ isModalVisible.value = false;
108
+ };
109
+
110
+ const onActionModal = () => {
111
+ alert("Modal Action working set validation");
112
+ closeModal();
113
+ };
114
+ </script>
115
+ <template>
116
+ <EUIButton size="md" color="purple" @click="openModal">Open Modal</EUIButton>
117
+ <EUIModal
118
+ :isVisible="isModalVisible"
119
+ :slim-header="false"
120
+ @update:isVisible="isModalVisible = $event"
121
+ @confirm="onActionModal"
122
+ >
123
+ <div>
124
+ Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus quas
125
+ possimus ea culpa id voluptatum cumque, animi earum sequi, aliquid eius
126
+ omnis repellendus nihil soluta vitae a temporibus! Perspiciatis, nihil?
127
+ </div>
128
+ </EUIModal>
129
+ </template>
130
+ `,
131
+ },
132
+ },
133
+ },
134
+ };
135
+
136
+ // Custom EUIModal story with different content
137
+ export const ModalCustomize: Story = {
138
+ args: {
139
+ isVisible: false, // EUIModal is visible by default
140
+ },
141
+ render: (args) => ({
142
+ components: { EUIModal, EUIButton },
143
+ setup() {
144
+ const isModalVisible = ref(args.isVisible);
145
+
146
+ const openModal = () => {
147
+ isModalVisible.value = true;
148
+ action("update:isVisible")(true);
149
+ };
150
+
151
+ const closeModal = () => {
152
+ isModalVisible.value = false;
153
+ action("update:isVisible")(false);
154
+ };
155
+
156
+ const onActionModal = () => {
157
+ alert("Modal Action working set validation");
158
+ closeModal();
159
+ };
160
+
161
+ return {
162
+ args,
163
+ isModalVisible,
164
+ openModal,
165
+ closeModal,
166
+ onActionModal,
167
+ onConfirm: action("confirm"),
168
+ };
169
+ },
170
+ template: `
171
+ <EUIButton size="md" color="purple" @click="openModal">Open Modal</EUIButton>
172
+ <EUIModal v-bind="args" :isVisible="isModalVisible" @update:isVisible="closeModal" @confirm="onConfirm">
173
+ <template #header>
174
+ <div
175
+ class="sticky inset-x-0 top-0 px-6 py-4 text-base font-semibold bg-white border-b"
176
+ >
177
+ Custom Header here
178
+ </div>
179
+ </template>
180
+ <template #content>
181
+ <div
182
+ class="p-4 max-h-[calc(100svh-10rem)] overflow-y-auto space-y-4"
183
+ >
184
+ <div v-for="item in 10" :key="item">
185
+ Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus
186
+ quas possimus ea culpa id voluptatum cumque, animi earum sequi,
187
+ aliquid eius omnis repellendus nihil soluta vitae a temporibus!
188
+ Perspiciatis, nihil?
189
+ </div>
190
+ </div>
191
+ </template>
192
+ <template #footer>
193
+ <div
194
+ class="sticky inset-x-0 bottom-0 flex items-center justify-end gap-4 p-4 bg-white border-t border-gray-200"
195
+ >
196
+ <button
197
+ class="px-4 py-2 text-base font-semibold tracking-wide text-gray-600 transition-colors duration-75 bg-white rounded-md hover:bg-gray-100"
198
+ @click="closeModal"
199
+ >
200
+ Cancel
201
+ </button>
202
+ <button
203
+ class="px-4 py-2 text-base font-semibold tracking-wide text-white transition-colors duration-75 bg-purple-600 rounded-md hover:bg-purple-700"
204
+ @click="onActionModal"
205
+ >
206
+ Apply now
207
+ </button>
208
+ </div>
209
+ </template>
210
+ </EUIModal>
211
+ `,
212
+ }),
213
+ parameters: {
214
+ docs: {
215
+ description: {
216
+ story:
217
+ "* The template method allows you to define how content is rendered in the <mark>EUIModal</mark> component. \n\n* Named slots <mark>(#header, #content, #footer)</mark> enable you to customize modal.",
218
+ },
219
+ source: {
220
+ code: `<script setup lang="ts">
221
+ import { ref } from "vue";
222
+ const isModalVisible = ref(false);
223
+
224
+ const openModal = () => {
225
+ isModalVisible.value = true;
226
+ };
227
+
228
+ const closeModal = () => {
229
+ isModalVisible.value = false;
230
+ };
231
+
232
+ const onActionModal = () => {
233
+ alert("Modal Action working set validation");
234
+ closeModal();
235
+ };
236
+ </script>
237
+ <template>
238
+ <EUIButton size="md" color="purple" @click="openModal">Open Modal</EUIButton>
239
+ <EUIModal
240
+ :isVisible="isModalVisible"
241
+ :slim-header="false"
242
+ rounded-class="rounded-3xl"
243
+ @update:isVisible="isModalVisible = $event"
244
+ @confirm="closeModal"
245
+ >
246
+ <template #header>
247
+ <div class="sticky inset-x-0 top-0 px-6 py-4 text-base font-semibold bg-white border-b">
248
+ Custom Header here
249
+ </div>
250
+ </template>
251
+ <template #content>
252
+ <div class="p-4 max-h-[calc(100svh-10rem)] overflow-y-auto space-y-4">
253
+ <div v-for="item in 10" :key="item">
254
+ Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus quas
255
+ possimus ea culpa id voluptatum cumque, animi earum sequi, aliquid
256
+ eius omnis repellendus nihil soluta vitae a temporibus! Perspiciatis,
257
+ nihil?
258
+ </div>
259
+ </div>
260
+ </template>
261
+ <template #footer>
262
+ <div
263
+ class="sticky inset-x-0 bottom-0 flex items-center justify-end gap-4 p-4 bg-white border-t border-gray-200"
264
+ >
265
+ <button
266
+ class="px-4 py-2 text-base font-semibold tracking-wide text-gray-600 transition-colors duration-75 bg-white rounded-md hover:bg-gray-100"
267
+ @click="closeModal()"
268
+ >
269
+ Cancel
270
+ </button>
271
+ <button
272
+ class="px-4 py-2 text-base font-semibold tracking-wide text-white transition-colors duration-75 bg-purple-600 rounded-md hover:bg-purple-700"
273
+ @click="onActionModal()"
274
+ >
275
+ Apply now
276
+ </button>
277
+ </div>
278
+ </template>
279
+ </EUIModal>
280
+ </template>
281
+ `,
282
+ },
283
+ },
284
+ },
285
+ };
286
+
287
+ export const SlimHeader: Story = {
288
+ args: {
289
+ isVisible: false,
290
+ slimHeader: true,
291
+ title: "Slimheader Modal Title",
292
+ },
293
+ render: (args) => ({
294
+ components: { EUIModal, EUIButton },
295
+ setup() {
296
+ const isModalVisible = ref(args.isVisible);
297
+
298
+ const openModal = () => {
299
+ isModalVisible.value = true;
300
+ action("update:isVisible")(true);
301
+ };
302
+
303
+ const closeModal = () => {
304
+ isModalVisible.value = false;
305
+ action("update:isVisible")(false);
306
+ };
307
+
308
+ return {
309
+ args,
310
+ isModalVisible,
311
+ openModal,
312
+ closeModal,
313
+ onConfirm: action("confirm"),
314
+ };
315
+ },
316
+ template: `
317
+ <EUIButton size="md" color="purple" @click="openModal">Open Modal</EUIButton>
318
+ <EUIModal v-bind="args" :isVisible="isModalVisible" :slimHeader="args.slimHeader" :title="args.title" :roundedClass="args.roundedClass" @update:isVisible="closeModal" @confirm="onConfirm">
319
+ <template #title>{{ args.title }}</template>
320
+ <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus
321
+ quas possimus ea culpa id voluptatum cumque, animi earum sequi,
322
+ aliquid eius omnis repellendus nihil soluta vitae a temporibus!
323
+ Perspiciatis, nihil?</p>
324
+ </EUIModal>
325
+ `,
326
+ }),
327
+ parameters: {
328
+ docs: {
329
+ description: {
330
+ story:
331
+ "This story demonstrates a modal component that is initially hidden. Clicking the 'Open Modal' button triggers the modal to appear, and it can be closed through the close button inside the modal or the cancel button. The modal also includes a 'Confirm' button that emits a `confirm` event, which is logged in Storybook’s actions panel. enable <mark>slimheader</mark> use template slot name <mark>(#title)</mark>",
332
+ },
333
+ source: {
334
+ code: `<script setup lang="ts">
335
+ import { ref } from "vue";
336
+ const isModalVisible = ref(false);
337
+
338
+ const openModal = () => {
339
+ isModalVisible.value = true;
340
+ };
341
+
342
+ const closeModal = () => {
343
+ isModalVisible.value = false;
344
+ };
345
+
346
+ const onActionModal = () => {
347
+ alert("Modal Action working set validation");
348
+ closeModal();
349
+ };
350
+
351
+ </script>
352
+ <template>
353
+ <EUIButton size="md" color="purple" @click="openModal">Open Modal</EUIButton>
354
+ <EUIModal
355
+ :isVisible="isModalVisible"
356
+ :slim-header="true"
357
+ @update:isVisible="isModalVisible = $event"
358
+ @confirm="onActionModal"
359
+ >
360
+ <template #title> Default Modal Title</template>
361
+ <div>
362
+ Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus quas
363
+ possimus ea culpa id voluptatum cumque, animi earum sequi, aliquid eius
364
+ omnis repellendus nihil soluta vitae a temporibus! Perspiciatis, nihil?
365
+ </div>
366
+ </EUIModal>
367
+ </template>
368
+ `,
369
+ },
370
+ },
371
+ },
372
+ };
@@ -0,0 +1,163 @@
1
+ <template>
2
+ <Teleport defer to="body">
3
+ <Transition name="modal">
4
+ <div
5
+ v-if="isVisible"
6
+ class="fixed inset-0 z-50 flex flex-col items-center justify-end sm:justify-center"
7
+ @click.self="closeModal"
8
+ >
9
+ <div
10
+ class="backdrop fixed inset-0 z-[-1] w-screen h-screen bg-black/25 pointer-events-none overflow-hidden"
11
+ ></div>
12
+ <div
13
+ class="bg-white shadow-lg max-w-lg w-full max-h-[calc(100svh-3rem)] md:h-auto overflow-hidden relative"
14
+ :class="[
15
+ roundedClass !== '' ? roundedClass : 'rounded-t-3xl md:rounded-2xl',
16
+ ]"
17
+ >
18
+ <template v-if="$slots.header">
19
+ <slot name="header"></slot>
20
+ </template>
21
+ <div
22
+ v-else
23
+ class="flex items-center justify-between font-medium text-gray-700"
24
+ :class="slimHeader ? 'p-4 text-base' : 'p-6 text-lg'"
25
+ >
26
+ <h3 class="text-xl font-semibold">
27
+ <slot name="title">{{ title || "Modal Title" }}</slot>
28
+ </h3>
29
+ <div>
30
+ <button
31
+ type="button"
32
+ class="flex items-center justify-center text-gray-400 bg-white hover:bg-gray-50 rounded-3xl hover:text-gray-600 size-8"
33
+ @click="closeModal"
34
+ >
35
+ <span class="sr-only">Close</span>
36
+ <svg
37
+ xmlns="http://www.w3.org/2000/svg"
38
+ fill="none"
39
+ viewBox="0 0 24 24"
40
+ stroke-width="2"
41
+ stroke="currentColor"
42
+ aria-hidden="true"
43
+ class="w-5 h-5"
44
+ >
45
+ <path
46
+ stroke-linecap="round"
47
+ stroke-linejoin="round"
48
+ d="M6 18L18 6M6 6l12 12"
49
+ ></path>
50
+ </svg>
51
+ </button>
52
+ </div>
53
+ </div>
54
+
55
+ <template v-if="$slots.content">
56
+ <slot name="content"></slot>
57
+ </template>
58
+ <div v-else class="p-4 border-t border-b border-gray-200">
59
+ <slot></slot>
60
+ </div>
61
+
62
+ <template v-if="$slots.footer">
63
+ <slot name="footer"></slot>
64
+ </template>
65
+ <div v-else class="flex items-center justify-end p-4 space-x-2">
66
+ <button
67
+ @click="closeModal"
68
+ class="px-4 py-2 text-base font-semibold tracking-wide text-gray-600 transition-colors duration-75 bg-white rounded-md hover:bg-gray-100"
69
+ >
70
+ Cancel
71
+ </button>
72
+ <button
73
+ @click="$emit('confirm')"
74
+ class="px-4 py-2 text-base font-semibold tracking-wide text-white transition-colors duration-75 bg-purple-600 rounded-md hover:bg-purple-700"
75
+ >
76
+ Confirm
77
+ </button>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </Transition>
82
+ </Teleport>
83
+ </template>
84
+
85
+ <script lang="ts">
86
+ import { defineComponent, watchEffect } from "vue";
87
+
88
+ export default defineComponent({
89
+ name: "Modal",
90
+ props: {
91
+ isVisible: {
92
+ type: Boolean,
93
+ default: false,
94
+ },
95
+ slimHeader: {
96
+ type: Boolean,
97
+ default: false,
98
+ },
99
+ title: {
100
+ type: String,
101
+ default: "",
102
+ },
103
+ roundedClass: {
104
+ type: String,
105
+ default: "",
106
+ },
107
+ },
108
+ emits: ["update:isVisible", "confirm"],
109
+ methods: {
110
+ closeModal() {
111
+ this.$emit("update:isVisible", false);
112
+ },
113
+ },
114
+ setup(props) {
115
+ watchEffect(() => {
116
+ if (props.isVisible) {
117
+ document.body.style.overflow = "hidden"; // Disable body scroll
118
+ } else {
119
+ document.body.style.overflow = ""; // Re-enable body scroll
120
+ }
121
+ });
122
+
123
+ return {};
124
+ },
125
+ beforeUnmount() {
126
+ document.body.style.overflow = ""; // Re-enable scroll when component unmounts
127
+ },
128
+ });
129
+ </script>
130
+
131
+ <style lang="scss" scoped>
132
+ .modal-enter-active,
133
+ .modal-leave-active {
134
+ transition: opacity 0.5s ease, transform 0.5s ease;
135
+ }
136
+ .modal-enter-from,
137
+ .modal-leave-to {
138
+ opacity: 0;
139
+ transform-origin: top;
140
+ transform: translateY(40%) scale(0.4);
141
+ }
142
+ .modal-enter-to,
143
+ .modal-leave-from {
144
+ opacity: 1;
145
+ transform-origin: top center;
146
+ transform: translateY(0%) scale(1);
147
+ }
148
+
149
+ .backdrop {
150
+ transition: opacity 0.6s ease, transform 0.6s ease;
151
+ }
152
+ .modal-enter-from .backdrop,
153
+ .modal-leave-to .backdrop {
154
+ transform: scale(0.3) rotate3d(0.5, 1, 0, 60deg);
155
+ opacity: 0;
156
+ }
157
+ .modal-enter-to .backdrop,
158
+ .modal-leave-from .backdrop {
159
+ // transform: scale(0.8) rotate3d(0.5, 0, 0, 90deg); //rotate effect
160
+ transform: scale(1) rotate3d(0, 0, 0, 90deg); // fade effect only
161
+ opacity: 0.2;
162
+ }
163
+ </style>
@@ -0,0 +1,74 @@
1
+ import type { Meta, StoryObj } from "@storybook/vue3";
2
+
3
+ import EUIPillSelect from "./EUIPillSelect.vue";
4
+ import { ref } from "vue";
5
+
6
+ // Meta configuration for the component's stories
7
+ const meta = {
8
+ title: "Example/Pill Select",
9
+ component: EUIPillSelect,
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ disabled: {
13
+ control: "boolean",
14
+ },
15
+ items: {
16
+ control: "object",
17
+ description: "Array of options to display in the select pills.",
18
+ },
19
+ modelValue: {
20
+ control: "object",
21
+ },
22
+ label: {
23
+ control: "text",
24
+ },
25
+ name: {
26
+ control: "text",
27
+ },
28
+ multiple: {
29
+ control: "boolean",
30
+ },
31
+ errors: {
32
+ control: "object",
33
+ },
34
+ },
35
+ } satisfies Meta<typeof EUIPillSelect>;
36
+
37
+ export default meta;
38
+ type Story = StoryObj<typeof meta>;
39
+
40
+ // Default story with minimum props
41
+ export const Default: Story = {
42
+ args: {
43
+ name: "pill",
44
+ modelValue: {
45
+ value: "usa",
46
+ label: "United States",
47
+ },
48
+ label:"Please select country",
49
+ disabled: false,
50
+ multiple: false,
51
+ items: [
52
+ { value: "usa", label: "United States", name: "United States" },
53
+ { value: "canada", label: "Canada", name: "Canada" },
54
+ { value: "uk", label: "United Kingdom", name: "United Kingdom" },
55
+ ],
56
+ errors: {
57
+ pill: "Pill is Required",
58
+ },
59
+ },
60
+ render: (args) => ({
61
+ components: { EUIPillSelect },
62
+ setup() {
63
+ const modelValue = ref(args.modelValue);
64
+
65
+ const onUpdateModelValue = (newValue: any) => {
66
+ modelValue.value = newValue;
67
+ args.modelValue = newValue;
68
+ };
69
+
70
+ return { args, modelValue, onUpdateModelValue };
71
+ },
72
+ template: `<EUIPillSelect v-bind="args" v-model="modelValue" @update:modelValue="onUpdateModelValue" />`,
73
+ }),
74
+ };