@cypress-design/vue-accordion 0.2.0 → 0.3.0
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/.turbo/turbo-build.log +13 -0
- package/Accordion.vue +1 -1
- package/CHANGELOG.md +18 -0
- package/ReadMe.md +19 -13
- package/dist/index.es.mjs +70 -69
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/vue/Accordion.vue.d.ts +48 -159
- package/dist/vue/Accordion.vue.d.ts.map +1 -1
- package/package.json +27 -24
- package/tsconfig.build.json +2 -1
- package/tsconfig.json +1 -0
- package/Accordion.stories.mdx +0 -138
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
$ yarn build:module && yarn build:types
|
|
2
|
+
$ yarn vite build
|
|
3
|
+
$ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vite build
|
|
4
|
+
[36mvite v4.2.1 [32mbuilding for production...[36m[39m
|
|
5
|
+
transforming...
|
|
6
|
+
[32m✓[39m 5 modules transformed.
|
|
7
|
+
rendering chunks...
|
|
8
|
+
computing gzip size...
|
|
9
|
+
[2mdist/[22m[36mindex.es.mjs [39m[1m[2m4.96 kB[22m[1m[22m[2m │ gzip: 1.84 kB[22m[2m │ map: 263.66 kB[22m
|
|
10
|
+
[2mdist/[22m[36mindex.umd.js [39m[1m[2m4.69 kB[22m[1m[22m[2m │ gzip: 1.81 kB[22m[2m │ map: 263.42 kB[22m
|
|
11
|
+
[32m✓[39m built in 5.84s
|
|
12
|
+
$ yarn vue-tsc --project ./tsconfig.build.json
|
|
13
|
+
$ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vue-tsc --project ./tsconfig.build.json
|
package/Accordion.vue
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @cypress-design/vue-accordion
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#178](https://github.com/cypress-io/cypress-design/pull/178) [`d0de778`](https://github.com/cypress-io/cypress-design/commit/d0de77843adb87d8f4804219c6dca8f45b15c650) Thanks [@elevatebart](https://github.com/elevatebart)! - deliver new docs and improved components
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`18399c7`](https://github.com/cypress-io/cypress-design/commit/18399c72a52288c67af0935384430d4e4cd24251), [`d0de778`](https://github.com/cypress-io/cypress-design/commit/d0de77843adb87d8f4804219c6dca8f45b15c650)]:
|
|
12
|
+
- @cypress-design/vue-icon@0.20.0
|
|
13
|
+
- @cypress-design/details-animation@0.1.0
|
|
14
|
+
|
|
15
|
+
## 0.2.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`c798320`](https://github.com/cypress-io/cypress-design/commit/c798320236ec41a43eb74be80f407781e980aaf0) Thanks [@elevatebart](https://github.com/elevatebart)! - fix the aria-role of accordion separator
|
|
20
|
+
|
|
3
21
|
## 0.2.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/ReadMe.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Collapsible component with a header and a body.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install @cypress-design/vue-accordion
|
|
@@ -22,16 +22,22 @@ yarn add @cypress-design/vue-accordion
|
|
|
22
22
|
import Accordion from '@cypress-design/vue-accordion'
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
```vue
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
```vue live
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import { IconActionQuestionMarkCircle } from '@cypress-design/vue-icon'
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<Accordion
|
|
32
|
+
:icon="IconActionQuestionMarkCircle"
|
|
33
|
+
title="Accordion Title"
|
|
34
|
+
description="Vestibulum id ligula porta felis euismod semper. Nulla... "
|
|
35
|
+
separator
|
|
36
|
+
open
|
|
37
|
+
fullWidthContent
|
|
38
|
+
>
|
|
39
|
+
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis
|
|
40
|
+
nemo minus, sapiente magni ...
|
|
41
|
+
</Accordion>
|
|
42
|
+
</template>
|
|
37
43
|
```
|
package/dist/index.es.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as g, defineComponent as v, useSlots as b, ref as x, onMounted as w, openBlock as
|
|
1
|
+
import { h as g, defineComponent as v, useSlots as b, ref as x, onMounted as w, openBlock as c, createElementBlock as p, createElementVNode as a, normalizeClass as s, unref as o, renderSlot as f, createBlock as N, createCommentVNode as C, toDisplayString as h, createVNode as $ } 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 B } from "@cypress-design/icon-registry";
|
|
@@ -19,30 +19,34 @@ const n = {
|
|
|
19
19
|
body: e,
|
|
20
20
|
compiledClasses: t,
|
|
21
21
|
size: r,
|
|
22
|
-
class:
|
|
23
|
-
interactiveColorsOnGroup:
|
|
24
|
-
...
|
|
22
|
+
class: l,
|
|
23
|
+
interactiveColorsOnGroup: m,
|
|
24
|
+
...d
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
26
|
+
const i = Object.keys(d).reduce(
|
|
27
|
+
(k, u) => (!B.includes(u) && u !== "name" && (k[u] = d[u]), k),
|
|
28
|
+
{}
|
|
29
|
+
), y = {
|
|
27
30
|
width: r,
|
|
28
31
|
height: r,
|
|
29
32
|
viewBox: `0 0 ${r} ${r}`,
|
|
30
33
|
fill: "none",
|
|
31
34
|
innerHTML: e,
|
|
32
|
-
...
|
|
35
|
+
...i
|
|
36
|
+
// add all standard attributes back to the svg tag
|
|
33
37
|
};
|
|
34
|
-
return t.length && (
|
|
38
|
+
return t.length && (y.class = t.join(" ")), y;
|
|
35
39
|
}, O = (e) => {
|
|
36
|
-
const { sizeWithDefault: t, compiledClasses: r } = z.getComponentAttributes({ ...e, availableSizes: ["8", "16"] }),
|
|
37
|
-
8: '<path
|
|
38
|
-
16: '<path
|
|
40
|
+
const { sizeWithDefault: t, compiledClasses: r } = z.getComponentAttributes({ ...e, availableSizes: ["8", "16"] }), l = {
|
|
41
|
+
8: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 2.5 3 3 3-3" class="icon-dark"/>',
|
|
42
|
+
16: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m4 6 4 4 4-4" class="icon-dark"/>'
|
|
39
43
|
}[t];
|
|
40
|
-
if (!
|
|
44
|
+
if (!l)
|
|
41
45
|
throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
|
|
42
46
|
return g("svg", E({
|
|
43
47
|
...e,
|
|
44
48
|
size: t,
|
|
45
|
-
body:
|
|
49
|
+
body: l,
|
|
46
50
|
compiledClasses: r
|
|
47
51
|
}));
|
|
48
52
|
}, S = { class: "flex-grow pr-[16px]" }, A = /* @__PURE__ */ v({
|
|
@@ -58,75 +62,72 @@ const n = {
|
|
|
58
62
|
fullWidthContent: { type: Boolean }
|
|
59
63
|
},
|
|
60
64
|
setup(e) {
|
|
61
|
-
const t = e, r = b(),
|
|
65
|
+
const t = e, r = b(), l = x(null), m = x(null);
|
|
62
66
|
w(function() {
|
|
63
|
-
|
|
67
|
+
m.value && l.value && new D(m.value, l.value);
|
|
64
68
|
});
|
|
65
|
-
const
|
|
66
|
-
return (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
const d = t.icon;
|
|
70
|
+
return (i, y) => (c(), p("details", {
|
|
71
|
+
ref_key: "$details",
|
|
72
|
+
ref: m
|
|
73
|
+
}, [
|
|
74
|
+
a("summary", {
|
|
75
|
+
class: s([o(n).summary, e.headingClassName ?? o(n).summaryColor])
|
|
71
76
|
}, [
|
|
72
|
-
|
|
73
|
-
class: s(
|
|
77
|
+
a("span", {
|
|
78
|
+
class: s(o(n).summaryDiv)
|
|
74
79
|
}, [
|
|
75
|
-
|
|
76
|
-
class: s(o(n).
|
|
80
|
+
a("span", {
|
|
81
|
+
class: s(o(n).icon)
|
|
77
82
|
}, [
|
|
78
|
-
i
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
f(i.$slots, "iconEl", {}, () => [
|
|
84
|
+
t.icon ? (c(), N(o(d), { key: 0 })) : C("", !0)
|
|
85
|
+
])
|
|
86
|
+
], 2),
|
|
87
|
+
(t.icon || o(r).iconEl) && e.separator ? (c(), p("span", {
|
|
88
|
+
key: 0,
|
|
89
|
+
class: s(o(n).separator),
|
|
90
|
+
role: "separator"
|
|
91
|
+
}, null, 2)) : C("", !0),
|
|
92
|
+
a("span", S, [
|
|
93
|
+
a("span", {
|
|
94
|
+
class: s([
|
|
95
|
+
e.titleClassName ? e.titleClassName : o(n).summaryTitleColor,
|
|
96
|
+
o(n).summaryTitle
|
|
83
97
|
])
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
}, h(e.title), 3),
|
|
99
|
+
e.description ? (c(), p("span", {
|
|
86
100
|
key: 0,
|
|
87
|
-
class: s(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
e.description ? (d(), y("span", {
|
|
98
|
-
key: 0,
|
|
99
|
-
class: s([
|
|
100
|
-
o(n).summaryDescription,
|
|
101
|
-
(l = e.descriptionClassName) != null ? l : o(n).summaryDescriptionColor
|
|
102
|
-
])
|
|
103
|
-
}, h(e.description), 3)) : k("", !0)
|
|
104
|
-
]),
|
|
105
|
-
$(o(O), {
|
|
106
|
-
strokeColor: "gray-300",
|
|
107
|
-
class: s(["open:icon-dark-gray-500", o(n).chevron])
|
|
108
|
-
}, null, 8, ["class"])
|
|
109
|
-
], 2)
|
|
110
|
-
], 2),
|
|
111
|
-
i("div", {
|
|
112
|
-
ref_key: "$content",
|
|
113
|
-
ref: a,
|
|
114
|
-
class: s(o(n).contentWrapper)
|
|
115
|
-
}, [
|
|
116
|
-
e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (d(), y("div", {
|
|
117
|
-
key: 1,
|
|
118
|
-
class: s(o(n).content)
|
|
119
|
-
}, [
|
|
120
|
-
C(c.$slots, "default")
|
|
121
|
-
], 2))
|
|
101
|
+
class: s([
|
|
102
|
+
o(n).summaryDescription,
|
|
103
|
+
e.descriptionClassName ?? o(n).summaryDescriptionColor
|
|
104
|
+
])
|
|
105
|
+
}, h(e.description), 3)) : C("", !0)
|
|
106
|
+
]),
|
|
107
|
+
$(o(O), {
|
|
108
|
+
strokeColor: "gray-300",
|
|
109
|
+
class: s(["open:icon-dark-gray-500", o(n).chevron])
|
|
110
|
+
}, null, 8, ["class"])
|
|
122
111
|
], 2)
|
|
123
|
-
],
|
|
124
|
-
|
|
112
|
+
], 2),
|
|
113
|
+
a("div", {
|
|
114
|
+
ref_key: "$content",
|
|
115
|
+
ref: l,
|
|
116
|
+
class: s(o(n).contentWrapper)
|
|
117
|
+
}, [
|
|
118
|
+
e.fullWidthContent ? f(i.$slots, "default", { key: 0 }) : (c(), p("div", {
|
|
119
|
+
key: 1,
|
|
120
|
+
class: s(o(n).content)
|
|
121
|
+
}, [
|
|
122
|
+
f(i.$slots, "default")
|
|
123
|
+
], 2))
|
|
124
|
+
], 2)
|
|
125
|
+
], 512));
|
|
125
126
|
}
|
|
126
127
|
});
|
|
127
128
|
export {
|
|
128
129
|
A as default
|
|
129
130
|
};
|
|
131
|
+
//# sourceMappingURL=index.es.mjs.map
|
|
130
132
|
|
|
131
133
|
/* <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]"> */
|
|
132
|
-
//# sourceMappingURL=index.es.mjs.map
|