edvoyui-component-library-test-flight 0.0.216 → 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.
- package/dist/components/accordion/EUIAccordion.d.ts +10 -0
- package/dist/components/accordion/EUIAccordion.vue +41 -27
- package/dist/components/select/EUISelect.vue +14 -0
- package/dist/edvoy-ui.cjs.js +5 -5
- package/dist/edvoy-ui.css +1 -1
- package/dist/edvoy-ui.es.js +195 -187
- package/dist/edvoy-ui.umd.js +2 -2
- package/package.json +1 -1
|
@@ -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
|
-
? '
|
|
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
|
|
20
|
-
: '
|
|
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
|
-
? '
|
|
29
|
-
: 'group-open/accordion:
|
|
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-
|
|
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
|
|
67
|
-
accordionStyle === 'grouped' ? '
|
|
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>
|
|
@@ -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);
|