edvoyui-component-library-test-flight 0.0.25 → 0.0.27

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 (37) hide show
  1. package/dist/{input/EUIInput.vue.d.ts → EUIInput.vue.d.ts} +1 -1
  2. package/dist/EUIInput.vue.d.ts.map +1 -0
  3. package/dist/button/EUIButton.vue.d.ts.map +1 -0
  4. package/dist/library-vue-ts.cjs.js +21 -21
  5. package/dist/library-vue-ts.es.js +6229 -6201
  6. package/dist/library-vue-ts.umd.js +24 -24
  7. package/dist/modal/EUIModal.vue.d.ts +1 -1
  8. package/dist/modal/EUIModal.vue.d.ts.map +1 -1
  9. package/dist/table/EUIDashboardTable.vue.d.ts +1 -1
  10. package/dist/table/EUITable.vue.d.ts +1 -1
  11. package/package.json +1 -1
  12. package/src/assets/svg/ChevronBigDown.vue +22 -0
  13. package/src/components/HelloWorld.vue +235 -77
  14. package/src/components/checkbox/EUICheckbox.vue +2 -2
  15. package/src/components/datepicker/EUIDatepicker.stories.ts +136 -12
  16. package/src/components/datepicker/EUIDatepicker.vue +41 -15
  17. package/src/components/delete.vue +49 -1
  18. package/src/components/index.ts +0 -1
  19. package/src/components/input/EUIInput.stories.ts +219 -6
  20. package/src/components/input/EUIInput.vue +30 -15
  21. package/src/components/modal/EUIModal.vue +13 -16
  22. package/src/components/select/EUISelect.stories.ts +49 -3
  23. package/src/components/select/EUISelect.vue +79 -34
  24. package/src/components/table/EUIDashboardTable.vue +68 -36
  25. package/src/components/table/EUITable.vue +2 -2
  26. package/src/components/telephone/EUITelephone.stories.ts +164 -8
  27. package/src/components/telephone/EUITelephone.vue +33 -11
  28. package/src/components/textArea/EUITextArea.stories.ts +52 -0
  29. package/src/components/textArea/EUITextArea.vue +36 -5
  30. package/dist/EUIButton.vue.d.ts.map +0 -1
  31. package/dist/input/EUIInput.vue.d.ts.map +0 -1
  32. package/dist/inputNormal/EUIInputNormal.vue.d.ts +0 -5
  33. package/dist/inputNormal/EUIInputNormal.vue.d.ts.map +0 -1
  34. package/src/components/inputNormal/EUIInputNormal.stories.ts +0 -164
  35. package/src/components/inputNormal/EUIInputNormal.vue +0 -161
  36. package/src/components/select/EUISelect.scss +0 -0
  37. /package/dist/{EUIButton.vue.d.ts → button/EUIButton.vue.d.ts} +0 -0
@@ -74,6 +74,15 @@ const meta = {
74
74
  description:
75
75
  "Specifies an SVG icon to be displayed inside the telephone input field.",
76
76
  },
77
+ inputFilled: {
78
+ control: "boolean",
79
+ description: "Toggles the alternate Select Tel input Filled design.",
80
+ defaultValue: false,
81
+ table: {
82
+ type: { summary: "Boolean" },
83
+ defaultValue: { summary: "false" },
84
+ },
85
+ },
77
86
  },
78
87
  } satisfies Meta<typeof EUITelephone>;
79
88
 
@@ -85,7 +94,7 @@ export const Default: Story = {
85
94
  args: {
86
95
  placeholder: "Mobile number 0 to 9",
87
96
  label: "Contact number",
88
- modelValue: "",
97
+ modelValue: "9094089854",
89
98
  name: "telephoneInput",
90
99
  autoFocus: false,
91
100
  length: 10,
@@ -115,12 +124,40 @@ export const Default: Story = {
115
124
 
116
125
  return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
117
126
  },
118
- template: `<div class="max-w-xl min-h-64"><EUITelephone v-bind="args" /></div>`,
127
+ template: `<div class="max-w-md min-h-64"><EUITelephone v-bind="args" /></div>`,
119
128
  }),
120
129
  };
121
130
 
122
- export const IconUsingStart: Story = {
131
+ export const InputFilled: Story = {
123
132
  args: {
133
+ modelValue: "9094089854",
134
+ inputFilled: true,
135
+ },
136
+ render: (args) => ({
137
+ components: { EUITelephone },
138
+ setup() {
139
+ const modelValue = ref(args.modelValue);
140
+ const isValid = ref(args.isValid);
141
+
142
+ const onUpdateModelValue = (newValue: string) => {
143
+ modelValue.value = newValue;
144
+ args.modelValue = newValue;
145
+ };
146
+
147
+ const onUpdateIsValid = (newValue: boolean) => {
148
+ isValid.value = newValue;
149
+ args.isValid = newValue;
150
+ };
151
+
152
+ return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
153
+ },
154
+ template: `<div class="max-w-md min-h-64"><EUITelephone v-bind="args" /></div>`,
155
+ }),
156
+ };
157
+
158
+ export const TelInputIconStart: Story = {
159
+ args: {
160
+ modelValue: "9094089854",
124
161
  iconType: "startIcon",
125
162
  icon: PhoneIcon,
126
163
  },
@@ -142,12 +179,13 @@ export const IconUsingStart: Story = {
142
179
 
143
180
  return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
144
181
  },
145
- template: `<div class="max-w-xl min-h-64"><EUITelephone v-bind="args" /></div>`,
182
+ template: `<div class="max-w-md min-h-64"><EUITelephone v-bind="args" /></div>`,
146
183
  }),
147
184
  };
148
185
 
149
- export const IconUsingEnd: Story = {
186
+ export const TelInputIconEnd: Story = {
150
187
  args: {
188
+ modelValue: "9094089854",
151
189
  iconType: "endIcon",
152
190
  icon: PhoneIcon,
153
191
  },
@@ -169,13 +207,13 @@ export const IconUsingEnd: Story = {
169
207
 
170
208
  return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
171
209
  },
172
- template: `<div class="max-w-xl min-h-64"><EUITelephone v-bind="args" /></div>`,
210
+ template: `<div class="max-w-md min-h-64"><EUITelephone v-bind="args" /></div>`,
173
211
  }),
174
212
  };
175
213
 
176
214
  export const MobileNumberUsed: Story = {
177
215
  args: {
178
- modelValue: "+919094089456",
216
+ modelValue: "+919094089854",
179
217
  disabled: false,
180
218
  isValid: false,
181
219
  },
@@ -197,6 +235,124 @@ export const MobileNumberUsed: Story = {
197
235
 
198
236
  return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
199
237
  },
200
- template: `<div class="max-w-xl"><EUITelephone v-bind="args" v-model="modelValue" @update:modelValue="onUpdateModelValue" @update:isValid="onUpdateIsValid" /></div>`,
238
+ template: `<div class="max-w-md"><EUITelephone v-bind="args" v-model="modelValue" @update:modelValue="onUpdateModelValue" @update:isValid="onUpdateIsValid" /></div>`,
239
+ }),
240
+ };
241
+
242
+ export const InputFilledIconStart: Story = {
243
+ args: {
244
+ modelValue: "9094089854",
245
+ inputFilled: true,
246
+ iconType: "startIcon",
247
+ icon: PhoneIcon,
248
+ },
249
+ render: (args) => ({
250
+ components: { EUITelephone },
251
+ setup() {
252
+ const modelValue = ref(args.modelValue);
253
+ const isValid = ref(args.isValid);
254
+
255
+ const onUpdateModelValue = (newValue: string) => {
256
+ modelValue.value = newValue;
257
+ args.modelValue = newValue;
258
+ };
259
+
260
+ const onUpdateIsValid = (newValue: boolean) => {
261
+ isValid.value = newValue;
262
+ args.isValid = newValue;
263
+ };
264
+
265
+ return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
266
+ },
267
+ template: `<div class="max-w-md min-h-64"><EUITelephone v-bind="args" /></div>`,
268
+ }),
269
+ };
270
+
271
+ export const InputFilledIconEnd: Story = {
272
+ args: {
273
+ modelValue: "9094089854",
274
+ inputFilled: true,
275
+ iconType: "endIcon",
276
+ icon: PhoneIcon,
277
+ },
278
+ render: (args) => ({
279
+ components: { EUITelephone },
280
+ setup() {
281
+ const modelValue = ref(args.modelValue);
282
+ const isValid = ref(args.isValid);
283
+
284
+ const onUpdateModelValue = (newValue: string) => {
285
+ modelValue.value = newValue;
286
+ args.modelValue = newValue;
287
+ };
288
+
289
+ const onUpdateIsValid = (newValue: boolean) => {
290
+ isValid.value = newValue;
291
+ args.isValid = newValue;
292
+ };
293
+
294
+ return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
295
+ },
296
+ template: `<div class="max-w-md min-h-64"><EUITelephone v-bind="args" /></div>`,
297
+ }),
298
+ };
299
+
300
+ export const TelInputDisabled: Story = {
301
+ args: {
302
+ modelValue: "9094089854",
303
+ inputFilled: true,
304
+ iconType: "startIcon",
305
+ icon: PhoneIcon,
306
+ disabled: true,
307
+ },
308
+ render: (args) => ({
309
+ components: { EUITelephone },
310
+ setup() {
311
+ const modelValue = ref(args.modelValue);
312
+ const isValid = ref(args.isValid);
313
+
314
+ const onUpdateModelValue = (newValue: string) => {
315
+ modelValue.value = newValue;
316
+ args.modelValue = newValue;
317
+ };
318
+
319
+ const onUpdateIsValid = (newValue: boolean) => {
320
+ isValid.value = newValue;
321
+ args.isValid = newValue;
322
+ };
323
+
324
+ return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
325
+ },
326
+ template: `<div class="max-w-md min-h-64"><EUITelephone v-bind="args" /></div>`,
201
327
  }),
202
328
  };
329
+
330
+ export const TelInputReadonly: Story = {
331
+ args: {
332
+ modelValue: "9094089854",
333
+ inputFilled: true,
334
+ iconType: "startIcon",
335
+ icon: PhoneIcon,
336
+ readonly: true,
337
+ },
338
+ render: (args) => ({
339
+ components: { EUITelephone },
340
+ setup() {
341
+ const modelValue = ref(args.modelValue);
342
+ const isValid = ref(args.isValid);
343
+
344
+ const onUpdateModelValue = (newValue: string) => {
345
+ modelValue.value = newValue;
346
+ args.modelValue = newValue;
347
+ };
348
+
349
+ const onUpdateIsValid = (newValue: boolean) => {
350
+ isValid.value = newValue;
351
+ args.isValid = newValue;
352
+ };
353
+
354
+ return { args, modelValue, isValid, onUpdateModelValue, onUpdateIsValid };
355
+ },
356
+ template: `<div class="max-w-md min-h-64"><EUITelephone v-bind="args" /></div>`,
357
+ }),
358
+ };
@@ -1,12 +1,19 @@
1
1
  <template>
2
- <div class="relative z-0">
2
+ <div class="relative z-[calc(infinity)]">
3
+ <label
4
+ v-if="!inputFilled && label"
5
+ :class="[
6
+ 'text-xs w-full text-gray-500 cursor-pointer font-medium',
7
+ required && `after:content-['*'] after:ml-0.5 after:text-red-500`,
8
+ ]"> {{ label }} </label>
9
+
3
10
  <button
4
11
  type="button"
5
- :class="disabled ? 'pointer-events-none cursor-not-allowed' : ''"
6
- class="relative w-full mb-2 bg-white border border-gray-100 cursor-pointer z-1 group h-14 rounded-2xl focus-within:border-purple-600 focus-within:ring-1 focus-within:ring-purple-600"
12
+ :class="[disabled ? 'pointer-events-none cursor-not-allowed bg-gray-50' : 'bg-white', inputFilled ? 'h-14 rounded-2xl' : 'h-10 rounded-md', 'relative w-full mb-2 border border-gray-100 cursor-pointer z-1 group focus-within:border-purple-600 focus-within:ring-1 focus-within:ring-purple-600']"
7
13
  @click="focusInput"
8
14
  >
9
15
  <label
16
+ v-if="inputFilled"
10
17
  :for="`${name}-${id}`"
11
18
  :class="[
12
19
  getIconClass(),
@@ -30,7 +37,7 @@
30
37
  >
31
38
  <component
32
39
  :is="icon"
33
- class="w-6 h-6 text-gray-400"
40
+ class="text-gray-400 size-6"
34
41
  aria-hidden="true"
35
42
  />
36
43
  </div>
@@ -44,9 +51,10 @@
44
51
  @blur="$emit('blur')"
45
52
  ></vue-tel-input>
46
53
  </button>
47
- <EUIErrorMessage :errors="errors" :name="name" />
54
+
55
+ <EUIErrorMessage :errors="errors" :name="name" />
48
56
  <div class="errors" v-if="errorMessage">
49
- <p class="mt-2 text-xs text-red-600">
57
+ <p class="mt-2 text-xs text-red-500">
50
58
  {{ errorMessage }}
51
59
  </p>
52
60
  </div>
@@ -62,6 +70,7 @@
62
70
  {{ tag }}
63
71
  </div>
64
72
  </div>
73
+
65
74
  </template>
66
75
  <script lang="ts" setup>
67
76
  import { computed, onUpdated, PropType, ref, toRefs, watch } from "vue";
@@ -126,6 +135,10 @@ const props = defineProps({
126
135
  type: [Object, String],
127
136
  default: "",
128
137
  },
138
+ inputFilled: {
139
+ type:Boolean,
140
+ default: false
141
+ }
129
142
  });
130
143
  const { isValid } = toRefs(props);
131
144
 
@@ -187,7 +200,7 @@ const bindProps = {
187
200
  styleClasses: "eui-tel_input",
188
201
  },
189
202
  dropdownOptions: {
190
- disabled: false,
203
+ disabled: updateValue.value.readonly || updateValue.value.disabled,
191
204
  showFlags: true,
192
205
  showDialCodeInList: true,
193
206
  showSearchBox: true,
@@ -233,11 +246,11 @@ const errorMessage = computed(() => {
233
246
  const getIconClass = () => {
234
247
  switch (props.iconType) {
235
248
  case "startIcon":
236
- return "pl-12 pr-4";
249
+ return props.inputFilled ? "pl-12 pr-4" : "normal pl-10 pr-4";
237
250
  case "endIcon":
238
- return "pr-12 pl-4";
251
+ return props.inputFilled ? "pr-12 pl-4" : "normal pr-10 pl-4";
239
252
  default:
240
- return "px-4";
253
+ return props.inputFilled ? "px-4" : "normal px-4";
241
254
  }
242
255
  };
243
256
 
@@ -274,7 +287,16 @@ const focusInput = () => {
274
287
  @apply w-[98%] rounded-[4px] placeholder:text-sm;
275
288
  }
276
289
  .eui-tel_input {
277
- @apply z-0 h-full w-full rounded-2xl pt-6 pb-3 placeholder:text-gray-400 focus:outline-none block text-sm font-medium appearance-none disabled:opacity-75 focus:border-purple-600 autofill:bg-white leading-6;
290
+ @apply z-0 h-full w-full pt-6 pb-3 placeholder:text-gray-400 focus:outline-none block text-sm font-medium appearance-none focus:border-purple-600 autofill:bg-white leading-6 disabled:opacity-75 disabled:bg-transparent;
291
+ }
292
+ }
293
+
294
+ .vue-tel-input.eui-tel.normal {
295
+ .vti__dropdown {
296
+ @apply mt-0 p-2 ps-0 hover:bg-transparent open:bg-transparent bg-transparent;
297
+ }
298
+ .eui-tel_input {
299
+ @apply rounded-md py-2;
278
300
  }
279
301
  }
280
302
  </style>
@@ -37,6 +37,15 @@ const meta = {
37
37
  description:
38
38
  "Validation errors object, with field names as keys and error messages as values.",
39
39
  },
40
+ inputFilled: {
41
+ control: "boolean",
42
+ description: "Toggles the alternate Textarea filled design.",
43
+ defaultValue: false,
44
+ table: {
45
+ type: { summary: "Boolean" },
46
+ defaultValue: { summary: "false" },
47
+ },
48
+ },
40
49
  },
41
50
  } satisfies Meta<typeof EUITextarea>;
42
51
 
@@ -54,6 +63,49 @@ export const Default: Story = {
54
63
  },
55
64
  };
56
65
 
66
+ export const inputFilled: Story = {
67
+ args: {
68
+ label: "Description",
69
+ modelValue: "",
70
+ rows: 3,
71
+ cols: 150,
72
+ placeholder: "Enter some description here...",
73
+ inputFilled: true,
74
+ },
75
+ parameters: {
76
+ docs: {
77
+ description: {
78
+ story: "Toggles the alternate Textarea Filled design.",
79
+ },
80
+ },
81
+ },
82
+ };
83
+
84
+ export const inputFilledDisabled: Story = {
85
+ args: {
86
+ label: "Description",
87
+ modelValue: "",
88
+ rows: 3,
89
+ cols: 150,
90
+ placeholder: "Enter some description here...",
91
+ inputFilled: true,
92
+ disabled: true,
93
+ },
94
+ };
95
+
96
+ export const inputFilledReadonly: Story = {
97
+ args: {
98
+ label: "Description",
99
+ rows: 3,
100
+ cols: 150,
101
+ placeholder: "Enter some description here...",
102
+ inputFilled: true,
103
+ readonly: true,
104
+ modelValue:
105
+ "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eum porro quia hic sed voluptatem, laudantium dignissimos sequi illo quasi error maxime vel nam deleniti adipisci itaque.",
106
+ },
107
+ };
108
+
57
109
  // Story to demonstrate textarea with an error message
58
110
  export const WithError: Story = {
59
111
  args: {
@@ -1,8 +1,9 @@
1
1
  <template>
2
2
  <div class="relative">
3
3
  <button
4
+ v-if="inputFilled"
4
5
  :class="[
5
- disabled ? 'pointer-events-none cursor-not-allowed' : '',
6
+ disabled ? 'pointer-events-none cursor-not-allowed bg-gray-50' : '',
6
7
  'group transition-all duration-100 ease-in-out outline-none border-none z-0 focus:border-purple-600 min-h-[4.5rem] mb-2 relative w-full rounded-md ring-1 ring-gray-200 focus-within:ring-2 focus-within:ring-purple-600 cursor-pointer overflow-hidden;',
7
8
  ]"
8
9
  @click="focusInput"
@@ -13,20 +14,20 @@
13
14
  inputValue
14
15
  ? 'top-2 text-xs text-gray-400 cursor-default'
15
16
  : 'top-4 text-sm text-gray-700 cursor-pointer pb-2',
16
- disabled ? 'cursor-not-allowed' : '',
17
+ disabled ? 'cursor-not-allowed bg-gray-50' : 'bg-white',
17
18
  required && `after:content-['*'] after:ml-0.5 after:text-red-500`,
19
+ 'absolute left-0 z-10 w-full h-auto px-4 font-medium leading-normal text-left transition-all duration-300 ease-in-out transform translate-y-0 group-focus-within:top-2 group-focus-within:bg-transparent group-focus-within:py-0 group-focus-within:h-auto'
18
20
  ]"
19
- class="absolute left-0 z-10 w-full h-auto px-4 font-medium leading-normal text-left transition-all duration-100 ease-in-out transform translate-y-0 bg-white group-focus-within:top-2 group-focus-within:py-0"
20
21
  >
21
22
  {{ label }}
22
23
  </label>
23
24
  <textarea
24
25
  ref="inputRef"
25
- :class="[errors ? 'border-red-500' : '']"
26
- class="min-h-[4.5rem] max-h-40 appearance-none block w-full px-4 py-2 placeholder:text-gray-400 text-sm font-medium relative z-0 mt-4 bg-transparent border-none focus:outline-none focus:shadow-none focus-within:outline-none focus:border-none disabled:opacity-75 autofill:bg-white leading-6 placeholder:capitalize rounded-2xl"
26
+ :class="['min-h-[4.5rem] max-h-40 appearance-none block w-full px-4 py-2 placeholder:text-gray-400 text-sm font-medium relative z-0 mt-4 bg-transparent border-none focus:outline-none focus:shadow-none focus-within:outline-none focus:border-none disabled:opacity-75 autofill:bg-white leading-6 placeholder:capitalize rounded-2xl' ,{'border-red-500': errors}]"
27
27
  :placeholder="placeholder"
28
28
  v-model="localValue"
29
29
  :disabled="disabled"
30
+ :readonly="readonly"
30
31
  :autofocus="autoFocus"
31
32
  aria-invalid="true"
32
33
  :rows="rows"
@@ -37,6 +38,28 @@
37
38
  </textarea>
38
39
  </button>
39
40
 
41
+ <div v-else>
42
+ <label
43
+ v-if="label"
44
+ :class="['text-xs w-full text-gray-500 cursor-pointer font-medium', required && `after:content-['*'] after:ml-0.5 after:text-red-500`]">
45
+ {{ label }}
46
+ </label>
47
+ <textarea
48
+ ref="inputRef"
49
+ :class="['min-h-[4.5rem] max-h-40 appearance-none block w-full px-4 py-2 placeholder:text-gray-400 text-sm font-medium relative z-0 bg-transparent border-gray-100 focus:outline-none focus:shadow-none focus-within:outline-none focus:border-purple-600 disabled:opacity-75 autofill:bg-white leading-6 placeholder:capitalize rounded-md border-solid border focus-within:ring-1 focus-within:ring-purple-600 transition-colors duration-300 ease-in-out',{'border-red-500': errors}]"
50
+ v-model="localValue"
51
+ :placeholder="placeholder"
52
+ :disabled="disabled"
53
+ :readonly="readonly"
54
+ :autofocus="autoFocus"
55
+ aria-invalid="true"
56
+ :rows="rows"
57
+ :cols="cols"
58
+ @input="$emit('update:modelValue', localValue)"
59
+ @blur="$emit('blur')"
60
+ >
61
+ </textarea>
62
+ </div>
40
63
  </div>
41
64
  <EUIErrorMessage :errors="errors" :name="name" />
42
65
  </template>
@@ -94,6 +117,14 @@ const props = defineProps({
94
117
  type: Boolean,
95
118
  default: false,
96
119
  },
120
+ readonly: {
121
+ type: Boolean,
122
+ default: false,
123
+ },
124
+ inputFilled: {
125
+ type:Boolean,
126
+ default: false
127
+ }
97
128
  });
98
129
 
99
130
  const { label, rows, cols, placeholder } = props;
@@ -1 +0,0 @@
1
- {"version":3,"file":"EUIButton.vue.d.ts","sourceRoot":"","sources":["../src/components/button/EUIButton.vue"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wGAAwG,CAAC;AAC/H,cAAc,wGAAwG,CAAC;AACvH,OAAO,sGAAsG,CAAC;AAC9G,eAAe,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"EUIInput.vue.d.ts","sourceRoot":"","sources":["../../src/components/input/EUIInput.vue"],"names":[],"mappings":"AACA,cAAc,sGAAsG,CAAC;AACrH,OAAO,oHAAoH,CAAC;;AAE5H,wBAA0F"}
@@ -1,5 +0,0 @@
1
- export * from "/Volumes/work/repos/edvoy-ui-v2/src/components/inputNormal/EUIInputNormal.vue?vue&type=script&setup=true&lang.ts";
2
- import "/Volumes/work/repos/edvoy-ui-v2/src/components/inputNormal/EUIInputNormal.vue?vue&type=style&index=0&scoped=17f24ec5&lang.scss";
3
- declare const _default: any;
4
- export default _default;
5
- //# sourceMappingURL=EUIInputNormal.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EUIInputNormal.vue.d.ts","sourceRoot":"","sources":["../../src/components/inputNormal/EUIInputNormal.vue"],"names":[],"mappings":"AACA,cAAc,kHAAkH,CAAC;AACjI,OAAO,gIAAgI,CAAC;;AAExI,wBAA0F"}
@@ -1,164 +0,0 @@
1
- import { expect, userEvent, within } from "@storybook/test";
2
- import type { Meta, StoryObj } from "@storybook/vue3";
3
- import EUIInputNormal from "./EUIInputNormal.vue";
4
- import { UserCircleIcon } from "@heroicons/vue/24/outline";
5
-
6
- // Meta configuration for the component's stories
7
- const meta = {
8
- title: "Forms/InputNormal",
9
- component: EUIInputNormal,
10
- tags: ["autodocs"],
11
- argTypes: {
12
- modelValue: {
13
- control: "text",
14
- description:
15
- "The value of the input. This is a two-way binding property, used to reflect the current value of the input field.",
16
- },
17
- name: {
18
- control: "text",
19
- description:
20
- "The `name` attribute of the input, typically used for form identification and validation.",
21
- },
22
- label: {
23
- control: "text",
24
- description:
25
- "The label for the input field, usually displayed above or inside the input.",
26
- },
27
- type: {
28
- control: {
29
- type: "select",
30
- options: [
31
- "text",
32
- "number",
33
- "email",
34
- "password",
35
- "search",
36
- "date",
37
- "url",
38
- ],
39
- },
40
- description:
41
- "Specifies the type of input, such as `text`, `number`, `email`, etc.",
42
- },
43
- placeholder: {
44
- control: "text",
45
- description:
46
- "A short hint that describes the expected value when the input is empty.",
47
- },
48
- autoFocus: {
49
- control: "boolean",
50
- description:
51
- "Automatically focuses the input field when the page loads or the component mounts.",
52
- },
53
- required: {
54
- control: "boolean",
55
- description:
56
- "Marks the field as required, showing validation for non-empty input.",
57
- },
58
- readonly: {
59
- control: "boolean",
60
- description:
61
- "Makes the input field read-only, which means users can see the value but cannot edit it.",
62
- },
63
- disabled: {
64
- control: "boolean",
65
- description:
66
- "Disables the input field, making it uneditable and unclickable.",
67
- },
68
- iconType: {
69
- control: "select",
70
- options: ["", "startIcon", "endIcon"],
71
- description:
72
- "Defines the position of the icon. It can be placed at the `start` or `end` of the input field.",
73
- },
74
- icon: {
75
- control: { type: "text" },
76
- description:
77
- "Specifies an SVG icon or icon component to be displayed inside the input field.",
78
- },
79
- errors: {
80
- control: "object",
81
- description:
82
- "An object containing error messages or validation information, typically used for form validation.",
83
- },
84
- rounded: {
85
- control: "boolean",
86
- description: "rounded the input field.",
87
- },
88
- className: {
89
- control: "text",
90
- description: "Required design to add class",
91
- },
92
- },
93
- } satisfies Meta<typeof EUIInputNormal>;
94
-
95
- export default meta;
96
- type Story = StoryObj<typeof meta>;
97
-
98
- // Default story with minimum props
99
- export const Default: Story = {
100
- argTypes: {
101
- type: {
102
- control: "select",
103
- options: ["text", "number", "email", "password", "search", "date"],
104
- },
105
- },
106
- args: {
107
- label: "Username",
108
- type: "text",
109
- placeholder: "Enter fullname here..",
110
- },
111
- };
112
-
113
- export const InputValue: Story = {
114
- args: {
115
- label: "User Name",
116
- type: "text",
117
- placeholder: "Enter fullname here..",
118
- modelValue: "John Cena",
119
- },
120
- play: async ({ canvasElement }) => {
121
- const canvas = within(canvasElement);
122
- const inputElement = canvas.getByPlaceholderText("Enter fullname here..");
123
- await userEvent.type(inputElement, "Storybook Test");
124
- await expect(inputElement).toBe("Storybook Test");
125
- },
126
- };
127
-
128
- export const IconUsingStart: Story = {
129
- args: {
130
- label: "User Name",
131
- type: "text",
132
- placeholder: "Enter fullname here..",
133
- modelValue: "John Cena",
134
- disabled: false,
135
- iconType: "startIcon",
136
- icon: UserCircleIcon,
137
- },
138
- render: (args) => ({
139
- components: { EUIInputNormal },
140
- setup() {
141
- return { args };
142
- },
143
- template: '<EUIInputNormal v-bind="args" />',
144
- }),
145
- };
146
-
147
- export const IconUsingEnd: Story = {
148
- args: {
149
- label: "User Name",
150
- type: "text",
151
- placeholder: "Enter fullname here..",
152
- modelValue: "John Cena",
153
- disabled: false,
154
- iconType: "endIcon",
155
- icon: UserCircleIcon,
156
- },
157
- render: (args) => ({
158
- components: { EUIInputNormal },
159
- setup() {
160
- return { args };
161
- },
162
- template: '<EUIInputNormal v-bind="args" />',
163
- }),
164
- };