@cypress-design/vue-accordion 0.4.3 → 0.4.5
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 +6 -5
- package/Accordion.rootstory.tsx +2 -1
- package/Accordion.vue +5 -4
- package/CHANGELOG.md +15 -0
- package/dist/Accordion.vue.d.ts +3 -3
- package/dist/Accordion.vue.d.ts.map +1 -1
- package/dist/index.es.mjs +49 -84
- 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 +5 -5
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +0 -14
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
$ yarn build:module && yarn build:types
|
|
2
2
|
$ yarn vite build
|
|
3
3
|
$ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vite build
|
|
4
|
-
[
|
|
4
|
+
[33mThe CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.[39m
|
|
5
|
+
[36mvite v5.0.4 [32mbuilding for production...[36m[39m
|
|
5
6
|
transforming...
|
|
6
|
-
[32m✓[39m
|
|
7
|
+
[32m✓[39m 4 modules transformed.
|
|
7
8
|
rendering chunks...
|
|
8
9
|
computing gzip size...
|
|
9
|
-
[2mdist/[22m[36mindex.es.mjs [39m[1m[
|
|
10
|
-
[2mdist/[22m[36mindex.umd.js [39m[1m[
|
|
11
|
-
[32m✓ built in
|
|
10
|
+
[2mdist/[22m[36mindex.es.mjs [39m[1m[2m3.88 kB[22m[1m[22m[2m │ gzip: 1.34 kB[22m[2m │ map: 4.73 kB[22m
|
|
11
|
+
[2mdist/[22m[36mindex.umd.js [39m[1m[2m3.62 kB[22m[1m[22m[2m │ gzip: 1.27 kB[22m[2m │ map: 4.61 kB[22m
|
|
12
|
+
[32m✓ built in 2.88s[39m
|
|
12
13
|
$ yarn vue-tsc --project ./tsconfig.build.json
|
|
13
14
|
$ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vue-tsc --project ./tsconfig.build.json
|
package/Accordion.rootstory.tsx
CHANGED
|
@@ -15,12 +15,13 @@ export default (options: AccordionStoryOptions = {}) => {
|
|
|
15
15
|
} = options
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<div
|
|
18
|
+
<div class="m-[16px]">
|
|
19
19
|
<Accordion
|
|
20
20
|
title={title}
|
|
21
21
|
separator={separator}
|
|
22
22
|
description={description}
|
|
23
23
|
icon={icon}
|
|
24
|
+
// @ts-expect-error volar is a little too strict for tsx html attributes. Only do this for tests
|
|
24
25
|
open={open}
|
|
25
26
|
fullWidthContent={fullWidthContent}
|
|
26
27
|
headingClassName={headingClassName}
|
package/Accordion.vue
CHANGED
|
@@ -51,16 +51,17 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script lang="ts" setup>
|
|
54
|
-
import { CssClasses } from '@cypress-design/constants-accordion'
|
|
55
|
-
import { DetailsAnimation } from '@cypress-design/details-animation'
|
|
56
|
-
import { IconChevronDownSmall } from '@cypress-design/vue-icon'
|
|
57
54
|
import {
|
|
58
55
|
FunctionalComponent,
|
|
59
56
|
SVGAttributes,
|
|
60
57
|
onMounted,
|
|
61
58
|
ref,
|
|
59
|
+
toRaw,
|
|
62
60
|
useSlots,
|
|
63
61
|
} from 'vue'
|
|
62
|
+
import { CssClasses } from '@cypress-design/constants-accordion'
|
|
63
|
+
import { DetailsAnimation } from '@cypress-design/details-animation'
|
|
64
|
+
import { IconChevronDownSmall } from '@cypress-design/vue-icon'
|
|
64
65
|
|
|
65
66
|
const slots = useSlots()
|
|
66
67
|
|
|
@@ -111,5 +112,5 @@ onMounted(function () {
|
|
|
111
112
|
}
|
|
112
113
|
})
|
|
113
114
|
|
|
114
|
-
const Icon = props.icon
|
|
115
|
+
const Icon = toRaw(props.icon)
|
|
115
116
|
</script>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @cypress-design/vue-accordion
|
|
2
2
|
|
|
3
|
+
## 0.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#350](https://github.com/cypress-io/cypress-design/pull/350) [`abc414d`](https://github.com/cypress-io/cypress-design/commit/abc414da149eb6fe0cfa61497a0aa8630d8d8d6e) Thanks [@elevatebart](https://github.com/elevatebart)! - fix: remove some warnings returned by Vue compiler
|
|
8
|
+
|
|
9
|
+
## 0.4.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#245](https://github.com/cypress-io/cypress-design/pull/245) [`d52d023`](https://github.com/cypress-io/cypress-design/commit/d52d02301bb851d514661a8c258d0c4ae5baf171) Thanks [@elevatebart](https://github.com/elevatebart)! - use tailwind to rollup classes in the final package
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`d52d023`](https://github.com/cypress-io/cypress-design/commit/d52d02301bb851d514661a8c258d0c4ae5baf171)]:
|
|
16
|
+
- @cypress-design/vue-icon@0.23.1
|
|
17
|
+
|
|
3
18
|
## 0.4.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/Accordion.vue.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
12
12
|
/**
|
|
13
13
|
* Icon to be displayed on the left of the the heading. Overridden by the iconEl slot, if one is provided.
|
|
14
14
|
*/
|
|
15
|
-
icon?: FunctionalComponent<SVGAttributes, {}> | undefined;
|
|
15
|
+
icon?: FunctionalComponent<SVGAttributes, {}, any> | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* Should we add a vertical separator between the icon and the text.
|
|
18
18
|
*/
|
|
@@ -48,7 +48,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
48
48
|
/**
|
|
49
49
|
* Icon to be displayed on the left of the the heading. Overridden by the iconEl slot, if one is provided.
|
|
50
50
|
*/
|
|
51
|
-
icon?: FunctionalComponent<SVGAttributes, {}> | undefined;
|
|
51
|
+
icon?: FunctionalComponent<SVGAttributes, {}, any> | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* Should we add a vertical separator between the icon and the text.
|
|
54
54
|
*/
|
|
@@ -71,7 +71,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
71
71
|
* removes the content wrapper from the content.
|
|
72
72
|
*/
|
|
73
73
|
fullWidthContent?: boolean | undefined;
|
|
74
|
-
}>>>, {}>, {
|
|
74
|
+
}>>>, {}, {}>, {
|
|
75
75
|
iconEl?(_: {}): any;
|
|
76
76
|
default?(_: {}): any;
|
|
77
77
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.vue.d.ts","sourceRoot":"","sources":["../Accordion.vue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Accordion.vue.d.ts","sourceRoot":"","sources":["../Accordion.vue.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,aAAa,EAKd,MAAM,KAAK,CAAA;;IAkUV;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;;IAjCH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;;OAGG;;;;;;AAIL,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
package/dist/index.es.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DetailsAnimation as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
const n = {
|
|
1
|
+
import { defineComponent as k, useSlots as x, ref as u, onMounted as g, toRaw as h, openBlock as t, createElementBlock as a, createElementVNode as n, normalizeClass as r, unref as e, renderSlot as p, createBlock as v, createCommentVNode as c, toDisplayString as d, createVNode as b } from "vue";
|
|
2
|
+
import { DetailsAnimation as N } from "@cypress-design/details-animation";
|
|
3
|
+
import { IconChevronDownSmall as w } from "@cypress-design/vue-icon";
|
|
4
|
+
const s = {
|
|
6
5
|
summary: "details-none card open:rounded-b-none",
|
|
7
6
|
summaryDiv: "flex flex-row py-[12px] px-[24px] flex-nowrap items-center min-h-[63px]",
|
|
8
7
|
summaryColor: "bg-white",
|
|
@@ -15,119 +14,85 @@ const n = {
|
|
|
15
14
|
chevron: "flex-shrink-0 transition transform rotate-0 open:rotate-180",
|
|
16
15
|
contentWrapper: "border border-gray-100 rounded-b-md border-t-0",
|
|
17
16
|
content: "px-[24px] py-[16px]"
|
|
18
|
-
},
|
|
19
|
-
body: e,
|
|
20
|
-
compiledClasses: t,
|
|
21
|
-
size: r,
|
|
22
|
-
class: l,
|
|
23
|
-
interactiveColorsOnGroup: m,
|
|
24
|
-
...d
|
|
25
|
-
}) => {
|
|
26
|
-
const i = Object.keys(d).reduce(
|
|
27
|
-
(k, u) => (!B.includes(u) && u !== "name" && (k[u] = d[u]), k),
|
|
28
|
-
{}
|
|
29
|
-
), y = {
|
|
30
|
-
width: r,
|
|
31
|
-
height: r,
|
|
32
|
-
viewBox: `0 0 ${r} ${r}`,
|
|
33
|
-
fill: "none",
|
|
34
|
-
innerHTML: e,
|
|
35
|
-
...i
|
|
36
|
-
// add all standard attributes back to the svg tag
|
|
37
|
-
};
|
|
38
|
-
return t.length && (y.class = t.join(" ")), y;
|
|
39
|
-
}, O = (e) => {
|
|
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"/>'
|
|
43
|
-
}[t];
|
|
44
|
-
if (!l)
|
|
45
|
-
throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
|
|
46
|
-
return g("svg", E({
|
|
47
|
-
...e,
|
|
48
|
-
size: t,
|
|
49
|
-
body: l,
|
|
50
|
-
compiledClasses: r
|
|
51
|
-
}));
|
|
52
|
-
}, S = { class: "flex-grow grow pr-[16px]" }, A = /* @__PURE__ */ v({
|
|
17
|
+
}, D = { class: "flex-grow grow pr-[16px]" }, T = /* @__PURE__ */ k({
|
|
53
18
|
__name: "Accordion",
|
|
54
19
|
props: {
|
|
55
|
-
title:
|
|
56
|
-
description:
|
|
57
|
-
icon:
|
|
20
|
+
title: {},
|
|
21
|
+
description: {},
|
|
22
|
+
icon: { type: [Function, Object] },
|
|
58
23
|
separator: { type: Boolean },
|
|
59
|
-
titleClassName:
|
|
60
|
-
descriptionClassName:
|
|
61
|
-
headingClassName:
|
|
24
|
+
titleClassName: {},
|
|
25
|
+
descriptionClassName: {},
|
|
26
|
+
headingClassName: {},
|
|
62
27
|
fullWidthContent: { type: Boolean }
|
|
63
28
|
},
|
|
64
|
-
setup(
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
m.value &&
|
|
29
|
+
setup(y) {
|
|
30
|
+
const f = x(), l = y, i = u(null), m = u(null);
|
|
31
|
+
g(function() {
|
|
32
|
+
m.value && i.value && new N(m.value, i.value);
|
|
68
33
|
});
|
|
69
|
-
const
|
|
70
|
-
return (
|
|
34
|
+
const C = h(l.icon);
|
|
35
|
+
return (o, $) => (t(), a("details", {
|
|
71
36
|
ref_key: "$details",
|
|
72
37
|
ref: m
|
|
73
38
|
}, [
|
|
74
|
-
|
|
75
|
-
class:
|
|
39
|
+
n("summary", {
|
|
40
|
+
class: r([e(s).summary, o.headingClassName ?? e(s).summaryColor])
|
|
76
41
|
}, [
|
|
77
|
-
|
|
78
|
-
class:
|
|
42
|
+
n("span", {
|
|
43
|
+
class: r(e(s).summaryDiv)
|
|
79
44
|
}, [
|
|
80
|
-
|
|
81
|
-
class:
|
|
45
|
+
n("span", {
|
|
46
|
+
class: r(e(s).icon)
|
|
82
47
|
}, [
|
|
83
|
-
|
|
84
|
-
|
|
48
|
+
p(o.$slots, "iconEl", {}, () => [
|
|
49
|
+
l.icon ? (t(), v(e(C), { key: 0 })) : c("", !0)
|
|
85
50
|
])
|
|
86
51
|
], 2),
|
|
87
|
-
(
|
|
52
|
+
(l.icon || e(f).iconEl) && o.separator ? (t(), a("span", {
|
|
88
53
|
key: 0,
|
|
89
|
-
class:
|
|
54
|
+
class: r(e(s).separator),
|
|
90
55
|
role: "separator"
|
|
91
|
-
}, null, 2)) :
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
class:
|
|
95
|
-
|
|
96
|
-
|
|
56
|
+
}, null, 2)) : c("", !0),
|
|
57
|
+
n("span", D, [
|
|
58
|
+
n("span", {
|
|
59
|
+
class: r([
|
|
60
|
+
o.titleClassName ? o.titleClassName : e(s).summaryTitleColor,
|
|
61
|
+
e(s).summaryTitle
|
|
97
62
|
])
|
|
98
|
-
},
|
|
99
|
-
|
|
63
|
+
}, d(o.title), 3),
|
|
64
|
+
o.description ? (t(), a("span", {
|
|
100
65
|
key: 0,
|
|
101
|
-
class:
|
|
102
|
-
|
|
103
|
-
|
|
66
|
+
class: r([
|
|
67
|
+
e(s).summaryDescription,
|
|
68
|
+
o.descriptionClassName ?? e(s).summaryDescriptionColor
|
|
104
69
|
])
|
|
105
|
-
},
|
|
70
|
+
}, d(o.description), 3)) : c("", !0)
|
|
106
71
|
]),
|
|
107
|
-
|
|
72
|
+
b(e(w), {
|
|
108
73
|
strokeColor: "gray-300",
|
|
109
|
-
class:
|
|
74
|
+
class: r(["open:icon-dark-gray-500", e(s).chevron])
|
|
110
75
|
}, null, 8, ["class"])
|
|
111
76
|
], 2)
|
|
112
77
|
], 2),
|
|
113
|
-
|
|
78
|
+
n("div", {
|
|
114
79
|
ref_key: "$content",
|
|
115
|
-
ref:
|
|
116
|
-
class:
|
|
80
|
+
ref: i,
|
|
81
|
+
class: r(e(s).contentWrapper)
|
|
117
82
|
}, [
|
|
118
|
-
|
|
83
|
+
o.fullWidthContent ? p(o.$slots, "default", { key: 0 }) : (t(), a("div", {
|
|
119
84
|
key: 1,
|
|
120
|
-
class:
|
|
85
|
+
class: r(e(s).content)
|
|
121
86
|
}, [
|
|
122
|
-
|
|
87
|
+
p(o.$slots, "default")
|
|
123
88
|
], 2))
|
|
124
89
|
], 2)
|
|
125
90
|
], 512));
|
|
126
91
|
}
|
|
127
92
|
});
|
|
128
93
|
export {
|
|
129
|
-
|
|
94
|
+
T as default
|
|
130
95
|
};
|
|
131
96
|
//# sourceMappingURL=index.es.mjs.map
|
|
132
97
|
|
|
133
|
-
/* <wind-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]"> */
|
|
98
|
+
/* <wind-keep class="flex-grow 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]"> */
|