edvoyui-component-library-test-flight 0.0.215 → 0.0.217

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.
@@ -8,6 +8,7 @@ declare function __VLS_template(): {
8
8
  'right-icon'?(_: {
9
9
  item: any;
10
10
  open: boolean;
11
+ toggle: () => void;
11
12
  }): any;
12
13
  content?(_: {
13
14
  item: any;
@@ -39,6 +40,10 @@ declare const __VLS_component: import('../../../node_modules/vue').DefineCompone
39
40
  type: StringConstructor;
40
41
  required: false;
41
42
  };
43
+ animateContent: {
44
+ type: BooleanConstructor;
45
+ default: boolean;
46
+ };
42
47
  }>, {}, {}, {}, {}, import('../../../node_modules/vue').ComponentOptionsMixin, import('../../../node_modules/vue').ComponentOptionsMixin, {
43
48
  "update:activeItem": (...args: any[]) => void;
44
49
  }, string, import('../../../node_modules/vue').PublicProps, Readonly<import('../../../node_modules/vue').ExtractPropTypes<{
@@ -63,6 +68,10 @@ declare const __VLS_component: import('../../../node_modules/vue').DefineCompone
63
68
  type: StringConstructor;
64
69
  required: false;
65
70
  };
71
+ animateContent: {
72
+ type: BooleanConstructor;
73
+ default: boolean;
74
+ };
66
75
  }>> & Readonly<{
67
76
  "onUpdate:activeItem"?: ((...args: any[]) => any) | undefined;
68
77
  }>, {
@@ -70,6 +79,7 @@ declare const __VLS_component: import('../../../node_modules/vue').DefineCompone
70
79
  defaultOpen: number[];
71
80
  collapse: boolean;
72
81
  accordionStyle: "grouped" | "separated";
82
+ animateContent: boolean;
73
83
  }, {}, {}, {}, string, import('../../../node_modules/vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
74
84
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
75
85
  export default _default;
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <div>
2
+ <div :class="['accordion-root', { 'accordion-animated': animateContent }]">
3
3
  <div
4
4
  :class="[
5
5
  accordionStyle === 'grouped'
6
- ? 'p-2 bg-gray-50 rounded-xl'
6
+ ? 'space-y-1'
7
7
  : 'space-y-3',
8
8
  'max-w-full transition-all duration-100 ease-in-out',
9
9
  ]"
@@ -12,27 +12,27 @@
12
12
  v-for="(item, index) in datas"
13
13
  :key="`accordion-${index}`"
14
14
  :open="openAccordions[index]"
15
- @click.prevent="onClick(index)"
16
15
  :class="[
17
- 'box-border relative mx-auto my-0 text-base font-normal transition-colors duration-150 ease-in-out group/accordion',
16
+ 'box-border relative mx-auto my-0 text-base font-normal transition-colors duration-150 ease-in-out group/accordion bg-white',
18
17
  accordionStyle === 'grouped'
19
- ? 'rounded-lg hover:bg-gray-100 open:bg-gray-100 open:mb-4 open:last:mb-0'
20
- : 'bg-white px-8 py-4 rounded-2xl hover:ring-2 hover:ring-purple-500 open:ring-2 ring-purple-700 open:shadow-lg open:shadow-purple-100',
18
+ ? 'rounded-lg open:mb-4 open:last:mb-0'
19
+ : 'rounded-2xl ring-1 ring-gray-50 hover:bg-gray-50 hover:open:bg-white open:ring-gray-100 open:shadow-md open:shadow-purple-100',
21
20
  className, item?.className,
22
21
  ]"
23
22
  >
24
23
  <summary
24
+ @click.prevent="onClick(index)"
25
25
  :class="[
26
26
  'flex items-center font-semibold list-none cursor-pointer select-none focus:outline-none max-w-full justify-between',
27
27
  accordionStyle === 'grouped'
28
- ? 'p-4'
29
- : 'group-open/accordion:pb-4 gap-6 group-open/accordion:border-b group-open/accordion:border-gray-200',
28
+ ? 'px-4 min-h-12 group-open/accordion:py-2'
29
+ : 'px-6 min-h-16 group-open/accordion:py-4 gap-6 group-open/accordion:border-b group-open/accordion:border-gray-200',
30
30
  ]"
31
31
  :aria-expanded="openAccordions[index]"
32
32
  >
33
33
  <div
34
34
  :class="[
35
- 'text-gray-700 transition-all duration-200 ease-in-out faq-title group-hover/accordion:text-gray-900 group-open/accordion:text-gray-900',
35
+ 'text-gray-600 transition-all duration-200 ease-in-out faq-title group-hover/accordion:text-gray-900 group-open/accordion:text-gray-900',
36
36
  accordionStyle === 'grouped' ? 'w-11/12' : 'flex-initial w-[calc(75%-1.5rem)]',
37
37
  ]"
38
38
  >
@@ -40,31 +40,20 @@
40
40
  {{ item.title }}
41
41
  </slot>
42
42
  </div>
43
+
43
44
  <svg
44
45
  v-if="accordionStyle === 'grouped'"
45
- xmlns="http://www.w3.org/2000/svg"
46
- class="absolute text-gray-700 transition-all duration-150 ease-out pointer-events-none expand-icon group-open/accordion:text-gray-900 right-4 group-open/accordion:rotate-90"
47
- width="24"
48
- height="24"
49
- viewBox="0 0 24 24"
50
- stroke-width="2"
51
- stroke="currentColor"
52
- fill="none"
53
- stroke-linecap="round"
54
- stroke-linejoin="round"
55
- >
56
- <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
57
- <path d="M9 6l6 6l-6 6"></path>
46
+ class="absolute text-gray-700 transition-all duration-150 ease-out pointer-events-none expand-icon group-open/accordion:text-gray-900 right-4 group-open/accordion:rotate-90" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M10 8.13867C11.4619 9.20073 12.7713 10.4457 13.8942 11.8408C14.0353 12.016 14.0353 12.2613 13.8942 12.4365C12.7713 13.8316 11.4619 15.0766 10 16.1387" stroke="currentColor" stroke-opacity="0.8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
58
47
  </svg>
59
- <div v-else class="flex-1 max-w-[25%] flex items-center justify-end gap-3" @click.stop>
60
- <slot name="right-icon" :item="item" :open="openAccordions[index]"></slot>
48
+ <div v-else class="flex-1 min-w-0 max-w-[25%] flex items-center justify-end gap-3" @click.stop.prevent>
49
+ <slot name="right-icon" :item="item" :open="openAccordions[index]" :toggle="() => onClick(index)"></slot>
61
50
  </div>
62
51
  </summary>
63
52
  <div
64
- v-if="openAccordions[index]"
53
+ v-if="animateContent || openAccordions[index]"
65
54
  :class="[
66
- 'font-light text-gray-600 transition-all duration-300 ease-in-out h-auto faq-content',
67
- accordionStyle === 'grouped' ? 'p-4 pt-1' : 'pt-3',
55
+ 'font-light text-gray-600 faq-content',
56
+ accordionStyle === 'grouped' ? 'px-4 pt-1 pb-3' : 'py-3 px-6',
68
57
  ]"
69
58
  >
70
59
  <slot name="content" :item="item">
@@ -101,6 +90,13 @@ const props = defineProps({
101
90
  type: String,
102
91
  required: false,
103
92
  },
93
+ // When true, content stays mounted and the open/close height animates
94
+ // smoothly. When false (default), content is lazily mounted via v-if and
95
+ // opens/closes instantly — preserves the original behavior.
96
+ animateContent: {
97
+ type: Boolean,
98
+ default: true,
99
+ },
104
100
  });
105
101
 
106
102
  const openAccordions = ref<boolean[]>(Array(props.datas.length).fill(false));
@@ -150,4 +146,22 @@ summary {
150
146
  display: none;
151
147
  }
152
148
  }
149
+
150
+ /* Opt-in (:animateContent) smooth expand/collapse of the native <details>
151
+ content instead of snapping. `interpolate-size` enables animating
152
+ to/from `height: auto`. Without this class the accordion keeps its
153
+ original instant open/close behaviour. */
154
+ .accordion-animated {
155
+ interpolate-size: allow-keywords;
156
+
157
+ details::details-content {
158
+ height: 0;
159
+ overflow: clip;
160
+ transition: height 0.3s ease, content-visibility 0.3s ease allow-discrete;
161
+ }
162
+
163
+ details[open]::details-content {
164
+ height: auto;
165
+ }
166
+ }
153
167
  </style>
@@ -33,6 +33,10 @@ declare const _default: import('../../../node_modules/vue').DefineComponent<impo
33
33
  type: BooleanConstructor;
34
34
  default: boolean;
35
35
  };
36
+ readonly: {
37
+ type: BooleanConstructor;
38
+ default: boolean;
39
+ };
36
40
  }>, {}, {}, {}, {}, import('../../../node_modules/vue').ComponentOptionsMixin, import('../../../node_modules/vue').ComponentOptionsMixin, {
37
41
  "update:modelValue": (...args: any[]) => void;
38
42
  }, string, import('../../../node_modules/vue').PublicProps, Readonly<import('../../../node_modules/vue').ExtractPropTypes<{
@@ -65,6 +69,10 @@ declare const _default: import('../../../node_modules/vue').DefineComponent<impo
65
69
  type: BooleanConstructor;
66
70
  default: boolean;
67
71
  };
72
+ readonly: {
73
+ type: BooleanConstructor;
74
+ default: boolean;
75
+ };
68
76
  }>> & Readonly<{
69
77
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
70
78
  }>, {
@@ -73,6 +81,7 @@ declare const _default: import('../../../node_modules/vue').DefineComponent<impo
73
81
  name: string;
74
82
  errors: Record<string, any>;
75
83
  modelValue: string;
84
+ readonly: boolean;
76
85
  options: RadioOption[];
77
86
  }, {}, {}, {}, string, import('../../../node_modules/vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
78
87
  export default _default;
@@ -11,13 +11,16 @@
11
11
  v-for="option in options"
12
12
  :key="option.value"
13
13
  class="inline-flex items-center gap-0 cursor-pointer"
14
- :class="{ 'opacity-50 cursor-not-allowed': disabled }"
14
+ :class="{
15
+ 'opacity-50 cursor-not-allowed': disabled,
16
+ 'cursor-not-allowed': readonly && !disabled,
17
+ }"
15
18
  >
16
19
  <input
17
20
  :value="option.value"
18
21
  type="radio"
19
22
  class="sr-only peer eui-radiogroup_input"
20
- :disabled="disabled"
23
+ :disabled="disabled || readonly"
21
24
  :checked="modelValue === option.value"
22
25
  @change="selectOption(option.value)"
23
26
  />
@@ -68,6 +71,10 @@ const props = defineProps({
68
71
  type: Boolean,
69
72
  default: false,
70
73
  },
74
+ readonly: {
75
+ type: Boolean,
76
+ default: false,
77
+ },
71
78
  });
72
79
 
73
80
  const { modelValue } = toRefs(props);
@@ -882,6 +882,20 @@ const open = () => {
882
882
  }
883
883
  }
884
884
 
885
+ /* Disabled: the control is non-interactive, so suppress the hover
886
+ affordances (red color change, "Clear Selected" tooltip) and block
887
+ clearing/deselecting. pointer-events:none stops :hover from firing,
888
+ so the underlying toggle's not-allowed cursor is what shows. */
889
+ .vs--disabled {
890
+ .vs__clear,
891
+ .vs__deselect,
892
+ .vs__open-indicator,
893
+ .vs__selected {
894
+ pointer-events: none;
895
+ user-select: none;
896
+ }
897
+ }
898
+
885
899
  .vs__selected-options {
886
900
  @apply group-focus:bg-transparent focus-within:bg-transparent border-transparent;
887
901
  background-color: v-bind(selectBG);