@cypress-design/vue-accordion 0.4.3 → 0.4.4
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 +4 -4
- package/Accordion.rootstory.tsx +2 -1
- package/Accordion.vue +3 -3
- package/CHANGELOG.md +9 -0
- package/dist/Accordion.vue.d.ts +3 -3
- package/dist/Accordion.vue.d.ts.map +1 -1
- package/dist/index.es.mjs +79 -74
- 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 +2 -2
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +0 -14
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
-
[36mvite v4.3.
|
|
4
|
+
[36mvite v4.3.9 [32mbuilding for production...[36m[39m
|
|
5
5
|
transforming...
|
|
6
6
|
[32m✓[39m 5 modules transformed.
|
|
7
7
|
rendering chunks...
|
|
8
8
|
computing gzip size...
|
|
9
|
-
[2mdist/[22m[36mindex.es.mjs [39m[1m[
|
|
10
|
-
[2mdist/[22m[36mindex.umd.js [39m[1m[2m4.69 kB[22m[1m[22m[2m │ gzip: 1.82 kB[22m[2m │ map:
|
|
11
|
-
[32m✓ built in
|
|
9
|
+
[2mdist/[22m[36mindex.es.mjs [39m[1m[2m5.00 kB[22m[1m[22m[2m │ gzip: 1.86 kB[22m[2m │ map: 292.50 kB[22m
|
|
10
|
+
[2mdist/[22m[36mindex.umd.js [39m[1m[2m4.69 kB[22m[1m[22m[2m │ gzip: 1.82 kB[22m[2m │ map: 292.24 kB[22m
|
|
11
|
+
[32m✓ built in 4.56s[39m
|
|
12
12
|
$ yarn vue-tsc --project ./tsconfig.build.json
|
|
13
13
|
$ /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,9 +51,6 @@
|
|
|
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,
|
|
@@ -61,6 +58,9 @@ import {
|
|
|
61
58
|
ref,
|
|
62
59
|
useSlots,
|
|
63
60
|
} from 'vue'
|
|
61
|
+
import { CssClasses } from '@cypress-design/constants-accordion'
|
|
62
|
+
import { DetailsAnimation } from '@cypress-design/details-animation'
|
|
63
|
+
import { IconChevronDownSmall } from '@cypress-design/vue-icon'
|
|
64
64
|
|
|
65
65
|
const slots = useSlots()
|
|
66
66
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @cypress-design/vue-accordion
|
|
2
2
|
|
|
3
|
+
## 0.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`d52d023`](https://github.com/cypress-io/cypress-design/commit/d52d02301bb851d514661a8c258d0c4ae5baf171)]:
|
|
10
|
+
- @cypress-design/vue-icon@0.23.1
|
|
11
|
+
|
|
3
12
|
## 0.4.3
|
|
4
13
|
|
|
5
14
|
### 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,EAId,MAAM,KAAK,CAAA;;IA0DV;;;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;;;;;;AAiOL,wBAA8G;AAE9G,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,8 @@
|
|
|
1
|
-
import { h
|
|
2
|
-
import { DetailsAnimation as
|
|
3
|
-
import * as
|
|
4
|
-
import { ICON_COLOR_PROP_NAMES as
|
|
5
|
-
const
|
|
1
|
+
import { h, defineComponent as g, useSlots as v, ref as C, onMounted as x, openBlock as d, createElementBlock as u, createElementVNode as c, normalizeClass as n, unref as o, renderSlot as y, createBlock as b, createCommentVNode as f, toDisplayString as k, createVNode as w } from "vue";
|
|
2
|
+
import { DetailsAnimation as N } from "@cypress-design/details-animation";
|
|
3
|
+
import * as $ from "@cypress-design/icon-registry";
|
|
4
|
+
import { ICON_COLOR_PROP_NAMES as D } from "@cypress-design/icon-registry";
|
|
5
|
+
const s = {
|
|
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",
|
|
@@ -15,119 +15,124 @@ const n = {
|
|
|
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
|
-
},
|
|
19
|
-
body:
|
|
20
|
-
compiledClasses:
|
|
21
|
-
size:
|
|
22
|
-
|
|
23
|
-
interactiveColorsOnGroup: m,
|
|
24
|
-
...d
|
|
18
|
+
}, O = ({
|
|
19
|
+
body: m,
|
|
20
|
+
compiledClasses: a,
|
|
21
|
+
size: l,
|
|
22
|
+
...r
|
|
25
23
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
(
|
|
24
|
+
const t = Object.keys(r).reduce(
|
|
25
|
+
(e, p) => (!D.includes(
|
|
26
|
+
p
|
|
27
|
+
) && p !== "name" && (e[p] = r[p]), e),
|
|
28
28
|
{}
|
|
29
|
-
),
|
|
30
|
-
width:
|
|
31
|
-
height:
|
|
32
|
-
viewBox: `0 0 ${
|
|
29
|
+
), i = {
|
|
30
|
+
width: l,
|
|
31
|
+
height: l,
|
|
32
|
+
viewBox: `0 0 ${l} ${l}`,
|
|
33
33
|
fill: "none",
|
|
34
|
-
innerHTML:
|
|
35
|
-
|
|
34
|
+
innerHTML: m,
|
|
35
|
+
class: void 0,
|
|
36
|
+
...t
|
|
36
37
|
// add all standard attributes back to the svg tag
|
|
37
38
|
};
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
-
const {
|
|
39
|
+
return a.length && (i.class = a.join(" ")), i;
|
|
40
|
+
}, z = (m) => {
|
|
41
|
+
const { interactiveColorsOnGroup: a, name: l, ...r } = m, { sizeWithDefault: t, compiledClasses: i } = $.getComponentAttributes({
|
|
42
|
+
...r,
|
|
43
|
+
availableSizes: ["8", "16"],
|
|
44
|
+
interactiveColorsOnGroup: a
|
|
45
|
+
}), e = {
|
|
41
46
|
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
47
|
16: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m4 6 4 4 4-4" class="icon-dark"/>'
|
|
43
48
|
}[t];
|
|
44
|
-
if (!
|
|
49
|
+
if (!e)
|
|
45
50
|
throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
|
|
46
|
-
return
|
|
47
|
-
...
|
|
51
|
+
return h("svg", O({
|
|
52
|
+
...r,
|
|
48
53
|
size: t,
|
|
49
|
-
body:
|
|
50
|
-
compiledClasses:
|
|
54
|
+
body: e,
|
|
55
|
+
compiledClasses: i
|
|
51
56
|
}));
|
|
52
|
-
},
|
|
57
|
+
}, B = { class: "flex-grow grow pr-[16px]" }, T = /* @__PURE__ */ g({
|
|
53
58
|
__name: "Accordion",
|
|
54
59
|
props: {
|
|
55
|
-
title:
|
|
56
|
-
description:
|
|
57
|
-
icon:
|
|
60
|
+
title: {},
|
|
61
|
+
description: {},
|
|
62
|
+
icon: { type: [Function, Object] },
|
|
58
63
|
separator: { type: Boolean },
|
|
59
|
-
titleClassName:
|
|
60
|
-
descriptionClassName:
|
|
61
|
-
headingClassName:
|
|
64
|
+
titleClassName: {},
|
|
65
|
+
descriptionClassName: {},
|
|
66
|
+
headingClassName: {},
|
|
62
67
|
fullWidthContent: { type: Boolean }
|
|
63
68
|
},
|
|
64
|
-
setup(
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
setup(m) {
|
|
70
|
+
const a = m, l = v(), r = C(null), t = C(null);
|
|
71
|
+
x(function() {
|
|
72
|
+
t.value && r.value && new N(t.value, r.value);
|
|
68
73
|
});
|
|
69
|
-
const
|
|
70
|
-
return (
|
|
74
|
+
const i = a.icon;
|
|
75
|
+
return (e, p) => (d(), u("details", {
|
|
71
76
|
ref_key: "$details",
|
|
72
|
-
ref:
|
|
77
|
+
ref: t
|
|
73
78
|
}, [
|
|
74
|
-
|
|
75
|
-
class:
|
|
79
|
+
c("summary", {
|
|
80
|
+
class: n([o(s).summary, e.headingClassName ?? o(s).summaryColor])
|
|
76
81
|
}, [
|
|
77
|
-
|
|
78
|
-
class:
|
|
82
|
+
c("span", {
|
|
83
|
+
class: n(o(s).summaryDiv)
|
|
79
84
|
}, [
|
|
80
|
-
|
|
81
|
-
class:
|
|
85
|
+
c("span", {
|
|
86
|
+
class: n(o(s).icon)
|
|
82
87
|
}, [
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
y(e.$slots, "iconEl", {}, () => [
|
|
89
|
+
a.icon ? (d(), b(o(i), { key: 0 })) : f("", !0)
|
|
85
90
|
])
|
|
86
91
|
], 2),
|
|
87
|
-
(
|
|
92
|
+
(a.icon || o(l).iconEl) && e.separator ? (d(), u("span", {
|
|
88
93
|
key: 0,
|
|
89
|
-
class:
|
|
94
|
+
class: n(o(s).separator),
|
|
90
95
|
role: "separator"
|
|
91
|
-
}, null, 2)) :
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
class:
|
|
95
|
-
e.titleClassName ? e.titleClassName : o(
|
|
96
|
-
o(
|
|
96
|
+
}, null, 2)) : f("", !0),
|
|
97
|
+
c("span", B, [
|
|
98
|
+
c("span", {
|
|
99
|
+
class: n([
|
|
100
|
+
e.titleClassName ? e.titleClassName : o(s).summaryTitleColor,
|
|
101
|
+
o(s).summaryTitle
|
|
97
102
|
])
|
|
98
|
-
},
|
|
99
|
-
e.description ? (
|
|
103
|
+
}, k(e.title), 3),
|
|
104
|
+
e.description ? (d(), u("span", {
|
|
100
105
|
key: 0,
|
|
101
|
-
class:
|
|
102
|
-
o(
|
|
103
|
-
e.descriptionClassName ?? o(
|
|
106
|
+
class: n([
|
|
107
|
+
o(s).summaryDescription,
|
|
108
|
+
e.descriptionClassName ?? o(s).summaryDescriptionColor
|
|
104
109
|
])
|
|
105
|
-
},
|
|
110
|
+
}, k(e.description), 3)) : f("", !0)
|
|
106
111
|
]),
|
|
107
|
-
|
|
112
|
+
w(o(z), {
|
|
108
113
|
strokeColor: "gray-300",
|
|
109
|
-
class:
|
|
114
|
+
class: n(["open:icon-dark-gray-500", o(s).chevron])
|
|
110
115
|
}, null, 8, ["class"])
|
|
111
116
|
], 2)
|
|
112
117
|
], 2),
|
|
113
|
-
|
|
118
|
+
c("div", {
|
|
114
119
|
ref_key: "$content",
|
|
115
|
-
ref:
|
|
116
|
-
class:
|
|
120
|
+
ref: r,
|
|
121
|
+
class: n(o(s).contentWrapper)
|
|
117
122
|
}, [
|
|
118
|
-
e.fullWidthContent ?
|
|
123
|
+
e.fullWidthContent ? y(e.$slots, "default", { key: 0 }) : (d(), u("div", {
|
|
119
124
|
key: 1,
|
|
120
|
-
class:
|
|
125
|
+
class: n(o(s).content)
|
|
121
126
|
}, [
|
|
122
|
-
|
|
127
|
+
y(e.$slots, "default")
|
|
123
128
|
], 2))
|
|
124
129
|
], 2)
|
|
125
130
|
], 512));
|
|
126
131
|
}
|
|
127
132
|
});
|
|
128
133
|
export {
|
|
129
|
-
|
|
134
|
+
T as default
|
|
130
135
|
};
|
|
131
136
|
//# sourceMappingURL=index.es.mjs.map
|
|
132
137
|
|
|
133
|
-
/* <wind-keep class="flex-grow pr-[16px] open:
|
|
138
|
+
/* <wind-keep class="flex-grow grow pr-[16px] 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]"> */
|