@cypress-design/vue-accordion 0.1.2 → 0.1.3
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/Accordion.vue +33 -31
- package/CHANGELOG.md +6 -0
- package/dist/constants.d.ts +1 -1
- package/dist/index.es.mjs +53 -49
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/Accordion.vue
CHANGED
|
@@ -3,39 +3,41 @@
|
|
|
3
3
|
<summary
|
|
4
4
|
:class="[CssClasses.summary, headingClassName ?? CssClasses.summaryColor]"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<div
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
6
|
+
<div :class="CssClasses.summaryDiv">
|
|
7
|
+
<span :class="CssClasses.icon">
|
|
8
|
+
<slot name="iconEl">
|
|
9
|
+
<Icon />
|
|
10
|
+
</slot>
|
|
11
|
+
</span>
|
|
12
|
+
<hr
|
|
13
|
+
v-if="(props.icon || slots.iconEl) && separator"
|
|
14
|
+
:class="CssClasses.separator"
|
|
15
|
+
/>
|
|
16
|
+
<div class="flex-grow pr-16px">
|
|
17
|
+
<div
|
|
18
|
+
:class="[
|
|
19
|
+
titleClassName ? titleClassName : CssClasses.summaryTitleColor,
|
|
20
|
+
CssClasses.summaryTitle,
|
|
21
|
+
]"
|
|
22
|
+
>
|
|
23
|
+
{{ title }}
|
|
24
|
+
</div>
|
|
25
|
+
<div
|
|
26
|
+
v-if="description"
|
|
27
|
+
:class="[
|
|
28
|
+
CssClasses.summaryDescription,
|
|
29
|
+
descriptionClassName ?? CssClasses.summaryDescriptionColor,
|
|
30
|
+
]"
|
|
31
|
+
>
|
|
32
|
+
{{ description }}
|
|
33
|
+
</div>
|
|
32
34
|
</div>
|
|
35
|
+
<IconChevronDownSmall
|
|
36
|
+
strokeColor="gray-300"
|
|
37
|
+
class="open:icon-dark-gray-500"
|
|
38
|
+
:class="CssClasses.chevron"
|
|
39
|
+
/>
|
|
33
40
|
</div>
|
|
34
|
-
<IconChevronDownSmall
|
|
35
|
-
strokeColor="gray-300"
|
|
36
|
-
class="open:icon-dark-gray-500"
|
|
37
|
-
:class="CssClasses.chevron"
|
|
38
|
-
/>
|
|
39
41
|
</summary>
|
|
40
42
|
<div ref="content" :class="CssClasses.contentWrapper">
|
|
41
43
|
<!-- @slot expandable body of the collapsible accordion -->
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @cypress-design/vue-accordion
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6cece49`](https://github.com/cypress-io/cypress-design/commit/6cece49fc60db7046df81a3f77e9a696326e55a9) Thanks [@elevatebart](https://github.com/elevatebart)! - feat: adapt accordion to safari 14
|
|
8
|
+
|
|
3
9
|
## 0.1.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/constants.d.ts
CHANGED
package/dist/index.es.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { h as g, defineComponent as b, useSlots as w, ref as x, onMounted as N, openBlock as p, createElementBlock as y, createElementVNode as
|
|
1
|
+
import { h as g, defineComponent as b, useSlots as w, ref as x, onMounted as N, openBlock as p, createElementBlock as y, createElementVNode as i, normalizeClass as s, unref as o, renderSlot as C, createVNode as h, createCommentVNode as k, toDisplayString as v } from "vue";
|
|
2
2
|
import { DetailsAnimation as D } from "@cypress-design/details-animation";
|
|
3
3
|
import * as z from "@cypress-design/icon-registry";
|
|
4
4
|
import { ICON_COLOR_PROP_NAMES as E } from "@cypress-design/icon-registry";
|
|
5
5
|
const t = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
summary: "details-none card open:rounded-b-none",
|
|
7
|
+
summaryDiv: "flex flex-row py-12px px-24px flex-nowrap items-center min-h-65px",
|
|
8
8
|
summaryColor: "bg-white",
|
|
9
9
|
summaryTitle: "text-18px leading-28px font-medium",
|
|
10
10
|
summaryTitleColor: "text-indigo-500",
|
|
@@ -18,22 +18,22 @@ const t = {
|
|
|
18
18
|
}, O = ({
|
|
19
19
|
body: e,
|
|
20
20
|
compiledClasses: n,
|
|
21
|
-
size:
|
|
21
|
+
size: r,
|
|
22
22
|
class: l,
|
|
23
23
|
interactiveColorsOnGroup: d,
|
|
24
24
|
...u
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
width:
|
|
28
|
-
height:
|
|
29
|
-
viewBox: `0 0 ${
|
|
26
|
+
const c = Object.keys(u).reduce((m, a) => (E.includes(a) || (m[a] = u[a]), m), {}), f = {
|
|
27
|
+
width: r,
|
|
28
|
+
height: r,
|
|
29
|
+
viewBox: `0 0 ${r} ${r}`,
|
|
30
30
|
fill: "none",
|
|
31
31
|
innerHTML: e,
|
|
32
|
-
...
|
|
32
|
+
...c
|
|
33
33
|
};
|
|
34
34
|
return n.length && (f.class = n.join(" ")), f;
|
|
35
35
|
}, $ = (e) => {
|
|
36
|
-
const { sizeWithDefault: n, compiledClasses:
|
|
36
|
+
const { sizeWithDefault: n, compiledClasses: r } = z.getComponentAttributes({ ...e, availableSizes: ["8", "16"] }), l = {
|
|
37
37
|
8: '<path d="m1 2.5 3 3 3-3" stroke="currentColor" class="icon-dark" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',
|
|
38
38
|
16: '<path d="m4 6 4 4 4-4" stroke="currentColor" class="icon-dark" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>'
|
|
39
39
|
}[n];
|
|
@@ -43,7 +43,7 @@ const t = {
|
|
|
43
43
|
...e,
|
|
44
44
|
size: n,
|
|
45
45
|
body: l,
|
|
46
|
-
compiledClasses:
|
|
46
|
+
compiledClasses: r
|
|
47
47
|
}));
|
|
48
48
|
}, B = { class: "flex-grow pr-16px" }, j = /* @__PURE__ */ b({
|
|
49
49
|
__name: "Accordion",
|
|
@@ -58,61 +58,65 @@ const t = {
|
|
|
58
58
|
fullWidthContent: { type: Boolean }
|
|
59
59
|
},
|
|
60
60
|
setup(e) {
|
|
61
|
-
const n = e,
|
|
61
|
+
const n = e, r = w(), l = x(null), d = x(null);
|
|
62
62
|
N(function() {
|
|
63
63
|
d.value && l.value && new D(d.value, l.value);
|
|
64
64
|
});
|
|
65
65
|
const u = n.icon;
|
|
66
|
-
return (
|
|
67
|
-
var
|
|
66
|
+
return (c, f) => {
|
|
67
|
+
var m, a;
|
|
68
68
|
return p(), y("details", {
|
|
69
69
|
ref_key: "details",
|
|
70
70
|
ref: d
|
|
71
71
|
}, [
|
|
72
|
-
|
|
73
|
-
class:
|
|
72
|
+
i("summary", {
|
|
73
|
+
class: s([o(t).summary, (m = e.headingClassName) != null ? m : o(t).summaryColor])
|
|
74
74
|
}, [
|
|
75
|
-
|
|
76
|
-
class:
|
|
75
|
+
i("div", {
|
|
76
|
+
class: s(o(t).summaryDiv)
|
|
77
77
|
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
key: 0,
|
|
84
|
-
class: r(o(t).separator)
|
|
85
|
-
}, null, 2)) : k("", !0),
|
|
86
|
-
m("div", B, [
|
|
87
|
-
m("div", {
|
|
88
|
-
class: r([
|
|
89
|
-
e.titleClassName ? e.titleClassName : o(t).summaryTitleColor,
|
|
90
|
-
o(t).summaryTitle
|
|
78
|
+
i("span", {
|
|
79
|
+
class: s(o(t).icon)
|
|
80
|
+
}, [
|
|
81
|
+
C(c.$slots, "iconEl", {}, () => [
|
|
82
|
+
h(o(u))
|
|
91
83
|
])
|
|
92
|
-
|
|
93
|
-
e.
|
|
84
|
+
], 2),
|
|
85
|
+
(n.icon || o(r).iconEl) && e.separator ? (p(), y("hr", {
|
|
94
86
|
key: 0,
|
|
95
|
-
class:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
87
|
+
class: s(o(t).separator)
|
|
88
|
+
}, null, 2)) : k("", !0),
|
|
89
|
+
i("div", B, [
|
|
90
|
+
i("div", {
|
|
91
|
+
class: s([
|
|
92
|
+
e.titleClassName ? e.titleClassName : o(t).summaryTitleColor,
|
|
93
|
+
o(t).summaryTitle
|
|
94
|
+
])
|
|
95
|
+
}, v(e.title), 3),
|
|
96
|
+
e.description ? (p(), y("div", {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: s([
|
|
99
|
+
o(t).summaryDescription,
|
|
100
|
+
(a = e.descriptionClassName) != null ? a : o(t).summaryDescriptionColor
|
|
101
|
+
])
|
|
102
|
+
}, v(e.description), 3)) : k("", !0)
|
|
103
|
+
]),
|
|
104
|
+
h(o($), {
|
|
105
|
+
strokeColor: "gray-300",
|
|
106
|
+
class: s(["open:icon-dark-gray-500", o(t).chevron])
|
|
107
|
+
}, null, 8, ["class"])
|
|
108
|
+
], 2)
|
|
105
109
|
], 2),
|
|
106
|
-
|
|
110
|
+
i("div", {
|
|
107
111
|
ref_key: "content",
|
|
108
112
|
ref: l,
|
|
109
|
-
class:
|
|
113
|
+
class: s(o(t).contentWrapper)
|
|
110
114
|
}, [
|
|
111
|
-
e.fullWidthContent ? C(
|
|
115
|
+
e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (p(), y("div", {
|
|
112
116
|
key: 1,
|
|
113
|
-
class:
|
|
117
|
+
class: s(o(t).content)
|
|
114
118
|
}, [
|
|
115
|
-
C(
|
|
119
|
+
C(c.$slots, "default")
|
|
116
120
|
], 2))
|
|
117
121
|
], 2)
|
|
118
122
|
], 512);
|
|
@@ -123,5 +127,5 @@ export {
|
|
|
123
127
|
j as default
|
|
124
128
|
};
|
|
125
129
|
|
|
126
|
-
/* <windicss-keep class="flex-grow pr-16px open:icon-dark-gray-500 icon-dark-gray-300 details-none
|
|
130
|
+
/* <windicss-keep class="flex-grow pr-16px open:icon-dark-gray-500 icon-dark-gray-300 details-none card open:rounded-b-none flex flex-row py-12px px-24px flex-nowrap items-center min-h-65px bg-white text-18px leading-28px font-medium text-indigo-500 text-14px leading-20px font-normal text-gray-700 mr-24px flex-shrink-0 w-1px h-40px bg-gray-100 mr-16px transition transform rotate-0 open:rotate-180 border border-gray-100 rounded-b-md border-t-0 py-16px"> */
|
|
127
131
|
//# sourceMappingURL=index.es.mjs.map
|