@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.
@@ -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
- vite v4.3.5 building for production...
4
+ The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
5
+ vite v5.0.4 building for production...
5
6
  transforming...
6
- ✓ 5 modules transformed.
7
+ ✓ 4 modules transformed.
7
8
  rendering chunks...
8
9
  computing gzip size...
9
- dist/index.es.mjs 4.96 kB │ gzip: 1.84 kB │ map: 262.64 kB
10
- dist/index.umd.js 4.69 kB │ gzip: 1.82 kB │ map: 262.39 kB
11
- ✓ built in 5.37s
10
+ dist/index.es.mjs 3.88 kB │ gzip: 1.34 kB │ map: 4.73 kB
11
+ dist/index.umd.js 3.62 kB │ gzip: 1.27 kB │ map: 4.61 kB
12
+ ✓ built in 2.88s
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
@@ -15,12 +15,13 @@ export default (options: AccordionStoryOptions = {}) => {
15
15
  } = options
16
16
 
17
17
  return (
18
- <div className="m-[16px]">
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
@@ -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":"AAKA,OAAO,EACL,mBAAmB,EACnB,aAAa,EAId,MAAM,KAAK,CAAA;;IAsDV;;;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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AC,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 { 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
- 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
- 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
- }, E = ({
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: null,
56
- description: null,
57
- icon: null,
20
+ title: {},
21
+ description: {},
22
+ icon: { type: [Function, Object] },
58
23
  separator: { type: Boolean },
59
- titleClassName: null,
60
- descriptionClassName: null,
61
- headingClassName: null,
24
+ titleClassName: {},
25
+ descriptionClassName: {},
26
+ headingClassName: {},
62
27
  fullWidthContent: { type: Boolean }
63
28
  },
64
- setup(e) {
65
- const t = e, r = b(), l = x(null), m = x(null);
66
- w(function() {
67
- m.value && l.value && new D(m.value, l.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 d = t.icon;
70
- return (i, y) => (c(), p("details", {
34
+ const C = h(l.icon);
35
+ return (o, $) => (t(), a("details", {
71
36
  ref_key: "$details",
72
37
  ref: m
73
38
  }, [
74
- a("summary", {
75
- class: s([o(n).summary, e.headingClassName ?? o(n).summaryColor])
39
+ n("summary", {
40
+ class: r([e(s).summary, o.headingClassName ?? e(s).summaryColor])
76
41
  }, [
77
- a("span", {
78
- class: s(o(n).summaryDiv)
42
+ n("span", {
43
+ class: r(e(s).summaryDiv)
79
44
  }, [
80
- a("span", {
81
- class: s(o(n).icon)
45
+ n("span", {
46
+ class: r(e(s).icon)
82
47
  }, [
83
- f(i.$slots, "iconEl", {}, () => [
84
- t.icon ? (c(), N(o(d), { key: 0 })) : C("", !0)
48
+ p(o.$slots, "iconEl", {}, () => [
49
+ l.icon ? (t(), v(e(C), { key: 0 })) : c("", !0)
85
50
  ])
86
51
  ], 2),
87
- (t.icon || o(r).iconEl) && e.separator ? (c(), p("span", {
52
+ (l.icon || e(f).iconEl) && o.separator ? (t(), a("span", {
88
53
  key: 0,
89
- class: s(o(n).separator),
54
+ class: r(e(s).separator),
90
55
  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
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
- }, h(e.title), 3),
99
- e.description ? (c(), p("span", {
63
+ }, d(o.title), 3),
64
+ o.description ? (t(), a("span", {
100
65
  key: 0,
101
- class: s([
102
- o(n).summaryDescription,
103
- e.descriptionClassName ?? o(n).summaryDescriptionColor
66
+ class: r([
67
+ e(s).summaryDescription,
68
+ o.descriptionClassName ?? e(s).summaryDescriptionColor
104
69
  ])
105
- }, h(e.description), 3)) : C("", !0)
70
+ }, d(o.description), 3)) : c("", !0)
106
71
  ]),
107
- $(o(O), {
72
+ b(e(w), {
108
73
  strokeColor: "gray-300",
109
- class: s(["open:icon-dark-gray-500", o(n).chevron])
74
+ class: r(["open:icon-dark-gray-500", e(s).chevron])
110
75
  }, null, 8, ["class"])
111
76
  ], 2)
112
77
  ], 2),
113
- a("div", {
78
+ n("div", {
114
79
  ref_key: "$content",
115
- ref: l,
116
- class: s(o(n).contentWrapper)
80
+ ref: i,
81
+ class: r(e(s).contentWrapper)
117
82
  }, [
118
- e.fullWidthContent ? f(i.$slots, "default", { key: 0 }) : (c(), p("div", {
83
+ o.fullWidthContent ? p(o.$slots, "default", { key: 0 }) : (t(), a("div", {
119
84
  key: 1,
120
- class: s(o(n).content)
85
+ class: r(e(s).content)
121
86
  }, [
122
- f(i.$slots, "default")
87
+ p(o.$slots, "default")
123
88
  ], 2))
124
89
  ], 2)
125
90
  ], 512));
126
91
  }
127
92
  });
128
93
  export {
129
- A as default
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]"> */