@cypress-design/vue-accordion 0.1.4 → 0.1.6
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 +14 -14
- package/CHANGELOG.md +12 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.es.mjs +42 -42
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<details ref="details">
|
|
2
|
+
<details ref="$details">
|
|
3
3
|
<summary
|
|
4
4
|
:class="[CssClasses.summary, headingClassName ?? CssClasses.summaryColor]"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
6
|
+
<span :class="CssClasses.summaryDiv">
|
|
7
7
|
<span :class="CssClasses.icon">
|
|
8
8
|
<slot name="iconEl">
|
|
9
9
|
<Icon />
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
v-if="(props.icon || slots.iconEl) && separator"
|
|
14
14
|
:class="CssClasses.separator"
|
|
15
15
|
/>
|
|
16
|
-
<
|
|
17
|
-
<
|
|
16
|
+
<span class="flex-grow pr-16px">
|
|
17
|
+
<span
|
|
18
18
|
:class="[
|
|
19
19
|
titleClassName ? titleClassName : CssClasses.summaryTitleColor,
|
|
20
20
|
CssClasses.summaryTitle,
|
|
21
21
|
]"
|
|
22
22
|
>
|
|
23
23
|
{{ title }}
|
|
24
|
-
</
|
|
25
|
-
<
|
|
24
|
+
</span>
|
|
25
|
+
<span
|
|
26
26
|
v-if="description"
|
|
27
27
|
:class="[
|
|
28
28
|
CssClasses.summaryDescription,
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
]"
|
|
31
31
|
>
|
|
32
32
|
{{ description }}
|
|
33
|
-
</
|
|
34
|
-
</
|
|
33
|
+
</span>
|
|
34
|
+
</span>
|
|
35
35
|
<IconChevronDownSmall
|
|
36
36
|
strokeColor="gray-300"
|
|
37
37
|
class="open:icon-dark-gray-500"
|
|
38
38
|
:class="CssClasses.chevron"
|
|
39
39
|
/>
|
|
40
|
-
</
|
|
40
|
+
</span>
|
|
41
41
|
</summary>
|
|
42
|
-
<div ref="content" :class="CssClasses.contentWrapper">
|
|
42
|
+
<div ref="$content" :class="CssClasses.contentWrapper">
|
|
43
43
|
<!-- @slot expandable body of the collapsible accordion -->
|
|
44
44
|
<slot v-if="fullWidthContent" />
|
|
45
45
|
<div v-else :class="CssClasses.content">
|
|
@@ -101,12 +101,12 @@ const props = defineProps<{
|
|
|
101
101
|
fullWidthContent?: boolean
|
|
102
102
|
}>()
|
|
103
103
|
|
|
104
|
-
const content = ref(null)
|
|
105
|
-
const details = ref(null)
|
|
104
|
+
const $content = ref(null)
|
|
105
|
+
const $details = ref(null)
|
|
106
106
|
|
|
107
107
|
onMounted(function () {
|
|
108
|
-
if (details.value && content.value) {
|
|
109
|
-
new DetailsAnimation(details.value, content.value)
|
|
108
|
+
if ($details.value && $content.value) {
|
|
109
|
+
new DetailsAnimation($details.value, $content.value)
|
|
110
110
|
}
|
|
111
111
|
})
|
|
112
112
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @cypress-design/vue-accordion
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`34a646b`](https://github.com/cypress-io/cypress-design/commit/34a646bbb5ae613d3ede0f63ac62c8a6bf31dd82) Thanks [@elevatebart](https://github.com/elevatebart)! - replace div with spans inside summary for html5 validation
|
|
8
|
+
|
|
9
|
+
## 0.1.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`e590bdc`](https://github.com/cypress-io/cypress-design/commit/e590bdc4a1f076e00fd1c5d41c461880fbff53d1) Thanks [@elevatebart](https://github.com/elevatebart)! - ci: add changeset
|
|
14
|
+
|
|
3
15
|
## 0.1.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;CActB,CAAA;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAA;IACV;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,SAAS,wFACiE,CAAA"}
|
package/dist/index.es.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { DetailsAnimation as
|
|
3
|
-
import * as
|
|
4
|
-
import { ICON_COLOR_PROP_NAMES as
|
|
5
|
-
const
|
|
6
|
-
summary: "details-none card open:rounded-b-none
|
|
7
|
-
summaryDiv: "flex flex-row py-12px px-24px flex-nowrap items-center",
|
|
1
|
+
import { h as v, 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 g } from "vue";
|
|
2
|
+
import { DetailsAnimation as $ } from "@cypress-design/details-animation";
|
|
3
|
+
import * as D from "@cypress-design/icon-registry";
|
|
4
|
+
import { ICON_COLOR_PROP_NAMES as z } from "@cypress-design/icon-registry";
|
|
5
|
+
const n = {
|
|
6
|
+
summary: "details-none card open:rounded-b-none",
|
|
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
10
|
summaryTitleColor: "text-indigo-500",
|
|
@@ -15,15 +15,15 @@ const t = {
|
|
|
15
15
|
chevron: "flex-shrink-0 transition transform rotate-0 open:rotate-180",
|
|
16
16
|
contentWrapper: "border border-gray-100 rounded-b-md border-t-0",
|
|
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
23
|
interactiveColorsOnGroup: d,
|
|
24
24
|
...u
|
|
25
25
|
}) => {
|
|
26
|
-
const c = Object.keys(u).reduce((m, a) => (
|
|
26
|
+
const c = Object.keys(u).reduce((m, a) => (!z.includes(a) && a !== "name" && (m[a] = u[a]), m), {}), f = {
|
|
27
27
|
width: r,
|
|
28
28
|
height: r,
|
|
29
29
|
viewBox: `0 0 ${r} ${r}`,
|
|
@@ -31,17 +31,17 @@ const t = {
|
|
|
31
31
|
innerHTML: e,
|
|
32
32
|
...c
|
|
33
33
|
};
|
|
34
|
-
return
|
|
35
|
-
},
|
|
36
|
-
const { sizeWithDefault:
|
|
34
|
+
return t.length && (f.class = t.join(" ")), f;
|
|
35
|
+
}, O = (e) => {
|
|
36
|
+
const { sizeWithDefault: t, compiledClasses: r } = D.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 v("svg", E({
|
|
43
43
|
...e,
|
|
44
|
-
size:
|
|
44
|
+
size: t,
|
|
45
45
|
body: l,
|
|
46
46
|
compiledClasses: r
|
|
47
47
|
}));
|
|
@@ -58,63 +58,63 @@ const t = {
|
|
|
58
58
|
fullWidthContent: { type: Boolean }
|
|
59
59
|
},
|
|
60
60
|
setup(e) {
|
|
61
|
-
const
|
|
61
|
+
const t = e, r = w(), l = x(null), d = x(null);
|
|
62
62
|
N(function() {
|
|
63
|
-
d.value && l.value && new
|
|
63
|
+
d.value && l.value && new $(d.value, l.value);
|
|
64
64
|
});
|
|
65
|
-
const u =
|
|
65
|
+
const u = t.icon;
|
|
66
66
|
return (c, f) => {
|
|
67
67
|
var m, a;
|
|
68
68
|
return p(), y("details", {
|
|
69
|
-
ref_key: "details",
|
|
69
|
+
ref_key: "$details",
|
|
70
70
|
ref: d
|
|
71
71
|
}, [
|
|
72
72
|
i("summary", {
|
|
73
|
-
class: s([o(
|
|
73
|
+
class: s([o(n).summary, (m = e.headingClassName) != null ? m : o(n).summaryColor])
|
|
74
74
|
}, [
|
|
75
|
-
i("
|
|
76
|
-
class: s(o(
|
|
75
|
+
i("span", {
|
|
76
|
+
class: s(o(n).summaryDiv)
|
|
77
77
|
}, [
|
|
78
78
|
i("span", {
|
|
79
|
-
class: s(o(
|
|
79
|
+
class: s(o(n).icon)
|
|
80
80
|
}, [
|
|
81
81
|
C(c.$slots, "iconEl", {}, () => [
|
|
82
82
|
h(o(u))
|
|
83
83
|
])
|
|
84
84
|
], 2),
|
|
85
|
-
(
|
|
85
|
+
(t.icon || o(r).iconEl) && e.separator ? (p(), y("hr", {
|
|
86
86
|
key: 0,
|
|
87
|
-
class: s(o(
|
|
87
|
+
class: s(o(n).separator)
|
|
88
88
|
}, null, 2)) : k("", !0),
|
|
89
|
-
i("
|
|
90
|
-
i("
|
|
89
|
+
i("span", B, [
|
|
90
|
+
i("span", {
|
|
91
91
|
class: s([
|
|
92
|
-
e.titleClassName ? e.titleClassName : o(
|
|
93
|
-
o(
|
|
92
|
+
e.titleClassName ? e.titleClassName : o(n).summaryTitleColor,
|
|
93
|
+
o(n).summaryTitle
|
|
94
94
|
])
|
|
95
|
-
},
|
|
96
|
-
e.description ? (p(), y("
|
|
95
|
+
}, g(e.title), 3),
|
|
96
|
+
e.description ? (p(), y("span", {
|
|
97
97
|
key: 0,
|
|
98
98
|
class: s([
|
|
99
|
-
o(
|
|
100
|
-
(a = e.descriptionClassName) != null ? a : o(
|
|
99
|
+
o(n).summaryDescription,
|
|
100
|
+
(a = e.descriptionClassName) != null ? a : o(n).summaryDescriptionColor
|
|
101
101
|
])
|
|
102
|
-
},
|
|
102
|
+
}, g(e.description), 3)) : k("", !0)
|
|
103
103
|
]),
|
|
104
|
-
h(o(
|
|
104
|
+
h(o(O), {
|
|
105
105
|
strokeColor: "gray-300",
|
|
106
|
-
class: s(["open:icon-dark-gray-500", o(
|
|
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
|
-
ref_key: "content",
|
|
111
|
+
ref_key: "$content",
|
|
112
112
|
ref: l,
|
|
113
|
-
class: s(o(
|
|
113
|
+
class: s(o(n).contentWrapper)
|
|
114
114
|
}, [
|
|
115
115
|
e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (p(), y("div", {
|
|
116
116
|
key: 1,
|
|
117
|
-
class: s(o(
|
|
117
|
+
class: s(o(n).content)
|
|
118
118
|
}, [
|
|
119
119
|
C(c.$slots, "default")
|
|
120
120
|
], 2))
|
|
@@ -127,5 +127,5 @@ export {
|
|
|
127
127
|
j 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
|
|
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"> */
|
|
131
131
|
//# sourceMappingURL=index.es.mjs.map
|