@cypress-design/vue-accordion 0.1.7 → 0.1.8
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 +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/index.es.mjs +40 -40
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/Accordion.vue
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @cypress-design/vue-accordion
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6ec15ab`](https://github.com/cypress-io/cypress-design/commit/6ec15ab28355dac5cb0fbc55397f192a3fd68e19) Thanks [@elevatebart](https://github.com/elevatebart)! - avoid warnings on accordions when no icon
|
|
8
|
+
|
|
3
9
|
## 0.1.7
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.es.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { DetailsAnimation as
|
|
3
|
-
import * as
|
|
4
|
-
import { ICON_COLOR_PROP_NAMES as
|
|
1
|
+
import { h as g, defineComponent as v, useSlots as b, ref as x, onMounted as w, openBlock as d, createElementBlock as y, createElementVNode as i, normalizeClass as s, unref as o, renderSlot as C, createBlock as N, createCommentVNode as k, toDisplayString as h, createVNode as $ } from "vue";
|
|
2
|
+
import { DetailsAnimation as D } from "@cypress-design/details-animation";
|
|
3
|
+
import * as z from "@cypress-design/icon-registry";
|
|
4
|
+
import { ICON_COLOR_PROP_NAMES as B } from "@cypress-design/icon-registry";
|
|
5
5
|
const n = {
|
|
6
6
|
summary: "details-none card open:rounded-b-none",
|
|
7
7
|
summaryDiv: "flex flex-row py-12px px-24px flex-nowrap items-center min-h-63px",
|
|
@@ -17,13 +17,13 @@ const n = {
|
|
|
17
17
|
content: "px-24px py-16px"
|
|
18
18
|
}, E = ({
|
|
19
19
|
body: e,
|
|
20
|
-
compiledClasses:
|
|
20
|
+
compiledClasses: t,
|
|
21
21
|
size: r,
|
|
22
22
|
class: l,
|
|
23
|
-
interactiveColorsOnGroup:
|
|
24
|
-
...
|
|
23
|
+
interactiveColorsOnGroup: u,
|
|
24
|
+
...p
|
|
25
25
|
}) => {
|
|
26
|
-
const c = Object.keys(
|
|
26
|
+
const c = Object.keys(p).reduce((m, a) => (!B.includes(a) && a !== "name" && (m[a] = p[a]), m), {}), f = {
|
|
27
27
|
width: r,
|
|
28
28
|
height: r,
|
|
29
29
|
viewBox: `0 0 ${r} ${r}`,
|
|
@@ -31,21 +31,21 @@ const n = {
|
|
|
31
31
|
innerHTML: e,
|
|
32
32
|
...c
|
|
33
33
|
};
|
|
34
|
-
return
|
|
34
|
+
return t.length && (f.class = t.join(" ")), f;
|
|
35
35
|
}, O = (e) => {
|
|
36
|
-
const { sizeWithDefault:
|
|
36
|
+
const { sizeWithDefault: t, 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
|
+
}[t];
|
|
40
40
|
if (!l)
|
|
41
|
-
throw Error(`Icon "chevron-down-small" is not available in size ${
|
|
42
|
-
return
|
|
41
|
+
throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
|
|
42
|
+
return g("svg", E({
|
|
43
43
|
...e,
|
|
44
|
-
size:
|
|
44
|
+
size: t,
|
|
45
45
|
body: l,
|
|
46
46
|
compiledClasses: r
|
|
47
47
|
}));
|
|
48
|
-
},
|
|
48
|
+
}, S = { class: "flex-grow pr-16px" }, A = /* @__PURE__ */ v({
|
|
49
49
|
__name: "Accordion",
|
|
50
50
|
props: {
|
|
51
51
|
title: null,
|
|
@@ -58,63 +58,63 @@ const n = {
|
|
|
58
58
|
fullWidthContent: { type: Boolean }
|
|
59
59
|
},
|
|
60
60
|
setup(e) {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const t = e, r = b(), l = x(null), u = x(null);
|
|
62
|
+
w(function() {
|
|
63
|
+
u.value && l.value && new D(u.value, l.value);
|
|
64
64
|
});
|
|
65
|
-
const
|
|
65
|
+
const p = t.icon;
|
|
66
66
|
return (c, f) => {
|
|
67
67
|
var m, a;
|
|
68
|
-
return
|
|
68
|
+
return d(), y("details", {
|
|
69
69
|
ref_key: "$details",
|
|
70
|
-
ref:
|
|
70
|
+
ref: u
|
|
71
71
|
}, [
|
|
72
72
|
i("summary", {
|
|
73
|
-
class:
|
|
73
|
+
class: s([o(n).summary, (m = e.headingClassName) != null ? m : o(n).summaryColor])
|
|
74
74
|
}, [
|
|
75
75
|
i("span", {
|
|
76
|
-
class:
|
|
76
|
+
class: s(o(n).summaryDiv)
|
|
77
77
|
}, [
|
|
78
78
|
i("span", {
|
|
79
|
-
class:
|
|
79
|
+
class: s(o(n).icon)
|
|
80
80
|
}, [
|
|
81
81
|
C(c.$slots, "iconEl", {}, () => [
|
|
82
|
-
|
|
82
|
+
t.icon ? (d(), N(o(p), { key: 0 })) : k("", !0)
|
|
83
83
|
])
|
|
84
84
|
], 2),
|
|
85
|
-
(
|
|
85
|
+
(t.icon || o(r).iconEl) && e.separator ? (d(), y("span", {
|
|
86
86
|
key: 0,
|
|
87
|
-
class:
|
|
88
|
-
}, null, 2)) :
|
|
89
|
-
i("span",
|
|
87
|
+
class: s(o(n).separator)
|
|
88
|
+
}, null, 2)) : k("", !0),
|
|
89
|
+
i("span", S, [
|
|
90
90
|
i("span", {
|
|
91
|
-
class:
|
|
91
|
+
class: s([
|
|
92
92
|
e.titleClassName ? e.titleClassName : o(n).summaryTitleColor,
|
|
93
93
|
o(n).summaryTitle
|
|
94
94
|
])
|
|
95
|
-
},
|
|
96
|
-
e.description ? (
|
|
95
|
+
}, h(e.title), 3),
|
|
96
|
+
e.description ? (d(), y("span", {
|
|
97
97
|
key: 0,
|
|
98
|
-
class:
|
|
98
|
+
class: s([
|
|
99
99
|
o(n).summaryDescription,
|
|
100
100
|
(a = e.descriptionClassName) != null ? a : o(n).summaryDescriptionColor
|
|
101
101
|
])
|
|
102
|
-
},
|
|
102
|
+
}, h(e.description), 3)) : k("", !0)
|
|
103
103
|
]),
|
|
104
|
-
|
|
104
|
+
$(o(O), {
|
|
105
105
|
strokeColor: "gray-300",
|
|
106
|
-
class:
|
|
106
|
+
class: s(["open:icon-dark-gray-500", o(n).chevron])
|
|
107
107
|
}, null, 8, ["class"])
|
|
108
108
|
], 2)
|
|
109
109
|
], 2),
|
|
110
110
|
i("div", {
|
|
111
111
|
ref_key: "$content",
|
|
112
112
|
ref: l,
|
|
113
|
-
class:
|
|
113
|
+
class: s(o(n).contentWrapper)
|
|
114
114
|
}, [
|
|
115
|
-
e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (
|
|
115
|
+
e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (d(), y("div", {
|
|
116
116
|
key: 1,
|
|
117
|
-
class:
|
|
117
|
+
class: s(o(n).content)
|
|
118
118
|
}, [
|
|
119
119
|
C(c.$slots, "default")
|
|
120
120
|
], 2))
|
|
@@ -124,7 +124,7 @@ const n = {
|
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
export {
|
|
127
|
-
|
|
127
|
+
A as default
|
|
128
128
|
};
|
|
129
129
|
|
|
130
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-63px bg-white text-18px leading-28px font-medium text-indigo-500 block 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"> */
|