@cypress-design/vue-accordion 0.1.6 → 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 +2 -2
- package/CHANGELOG.md +12 -0
- package/dist/index.es.mjs +28 -28
- 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
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
<span :class="CssClasses.summaryDiv">
|
|
7
7
|
<span :class="CssClasses.icon">
|
|
8
8
|
<slot name="iconEl">
|
|
9
|
-
<Icon />
|
|
9
|
+
<Icon v-if="props.icon" />
|
|
10
10
|
</slot>
|
|
11
11
|
</span>
|
|
12
|
-
<
|
|
12
|
+
<span
|
|
13
13
|
v-if="(props.icon || slots.iconEl) && separator"
|
|
14
14
|
:class="CssClasses.separator"
|
|
15
15
|
/>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
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
|
+
|
|
9
|
+
## 0.1.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`ff54d5c`](https://github.com/cypress-io/cypress-design/commit/ff54d5c098bec93083b9c2ecc84439a0d3878f56) Thanks [@elevatebart](https://github.com/elevatebart)! - fix hr into span
|
|
14
|
+
|
|
3
15
|
## 0.1.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.es.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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",
|
|
8
8
|
summaryColor: "bg-white",
|
|
9
9
|
summaryTitle: "text-18px leading-28px font-medium",
|
|
10
|
-
summaryTitleColor: "text-indigo-500",
|
|
11
|
-
summaryDescription: "text-14px leading-20px font-normal",
|
|
10
|
+
summaryTitleColor: "text-indigo-500 block",
|
|
11
|
+
summaryDescription: "text-14px leading-20px font-normal block",
|
|
12
12
|
summaryDescriptionColor: "text-gray-700",
|
|
13
13
|
icon: "mr-24px flex-shrink-0",
|
|
14
14
|
separator: "w-1px h-40px bg-gray-100 mr-16px",
|
|
@@ -20,10 +20,10 @@ const n = {
|
|
|
20
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}`,
|
|
@@ -33,19 +33,19 @@ const n = {
|
|
|
33
33
|
};
|
|
34
34
|
return t.length && (f.class = t.join(" ")), f;
|
|
35
35
|
}, O = (e) => {
|
|
36
|
-
const { sizeWithDefault: t, compiledClasses: r } =
|
|
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
41
|
throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
|
|
42
|
-
return
|
|
42
|
+
return g("svg", E({
|
|
43
43
|
...e,
|
|
44
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,16 +58,16 @@ const n = {
|
|
|
58
58
|
fullWidthContent: { type: Boolean }
|
|
59
59
|
},
|
|
60
60
|
setup(e) {
|
|
61
|
-
const t = e, r =
|
|
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
73
|
class: s([o(n).summary, (m = e.headingClassName) != null ? m : o(n).summaryColor])
|
|
@@ -79,29 +79,29 @@ const n = {
|
|
|
79
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
|
-
(t.icon || o(r).iconEl) && e.separator ? (
|
|
85
|
+
(t.icon || o(r).iconEl) && e.separator ? (d(), y("span", {
|
|
86
86
|
key: 0,
|
|
87
87
|
class: s(o(n).separator)
|
|
88
88
|
}, null, 2)) : k("", !0),
|
|
89
|
-
i("span",
|
|
89
|
+
i("span", S, [
|
|
90
90
|
i("span", {
|
|
91
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
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
106
|
class: s(["open:icon-dark-gray-500", o(n).chevron])
|
|
107
107
|
}, null, 8, ["class"])
|
|
@@ -112,7 +112,7 @@ const n = {
|
|
|
112
112
|
ref: l,
|
|
113
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
117
|
class: s(o(n).content)
|
|
118
118
|
}, [
|
|
@@ -124,8 +124,8 @@ const n = {
|
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
export {
|
|
127
|
-
|
|
127
|
+
A as default
|
|
128
128
|
};
|
|
129
129
|
|
|
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 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"> */
|
|
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"> */
|
|
131
131
|
//# sourceMappingURL=index.es.mjs.map
|