@cypress-design/vue-accordion 0.1.7 → 0.1.8

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 CHANGED
@@ -6,7 +6,7 @@
6
6
  <span :class="CssClasses.summaryDiv">
7
7
  <span :class="CssClasses.icon">
8
8
  <slot name="iconEl">
9
- <Icon />
9
+ <Icon v-if="props.icon" />
10
10
  </slot>
11
11
  </span>
12
12
  <span
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @cypress-design/vue-accordion
2
2
 
3
+ ## 0.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6ec15ab`](https://github.com/cypress-io/cypress-design/commit/6ec15ab28355dac5cb0fbc55397f192a3fd68e19) Thanks [@elevatebart](https://github.com/elevatebart)! - avoid warnings on accordions when no icon
8
+
3
9
  ## 0.1.7
4
10
 
5
11
  ### Patch Changes
package/dist/index.es.mjs CHANGED
@@ -1,7 +1,7 @@
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 t, unref as o, renderSlot as C, createVNode as k, createCommentVNode as h, 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";
1
+ import { h as g, defineComponent as v, useSlots as b, ref as x, onMounted as w, openBlock as d, createElementBlock as y, createElementVNode as i, normalizeClass as s, unref as o, renderSlot as C, createBlock as N, createCommentVNode as k, 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
5
  const n = {
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",
@@ -17,13 +17,13 @@ const n = {
17
17
  content: "px-24px py-16px"
18
18
  }, E = ({
19
19
  body: e,
20
- compiledClasses: s,
20
+ compiledClasses: t,
21
21
  size: r,
22
22
  class: l,
23
- interactiveColorsOnGroup: d,
24
- ...u
23
+ interactiveColorsOnGroup: u,
24
+ ...p
25
25
  }) => {
26
- const c = Object.keys(u).reduce((m, a) => (!z.includes(a) && a !== "name" && (m[a] = u[a]), m), {}), f = {
26
+ const c = Object.keys(p).reduce((m, a) => (!B.includes(a) && a !== "name" && (m[a] = p[a]), m), {}), f = {
27
27
  width: r,
28
28
  height: r,
29
29
  viewBox: `0 0 ${r} ${r}`,
@@ -31,21 +31,21 @@ const n = {
31
31
  innerHTML: e,
32
32
  ...c
33
33
  };
34
- return s.length && (f.class = s.join(" ")), f;
34
+ return t.length && (f.class = t.join(" ")), f;
35
35
  }, O = (e) => {
36
- const { sizeWithDefault: s, compiledClasses: r } = D.getComponentAttributes({ ...e, availableSizes: ["8", "16"] }), l = {
36
+ const { sizeWithDefault: t, compiledClasses: r } = z.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
- }[s];
39
+ }[t];
40
40
  if (!l)
41
- throw Error(`Icon "chevron-down-small" is not available in size ${s}`);
42
- return v("svg", E({
41
+ throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
42
+ return g("svg", E({
43
43
  ...e,
44
- size: s,
44
+ size: t,
45
45
  body: l,
46
46
  compiledClasses: r
47
47
  }));
48
- }, B = { class: "flex-grow pr-16px" }, j = /* @__PURE__ */ b({
48
+ }, S = { class: "flex-grow pr-16px" }, A = /* @__PURE__ */ v({
49
49
  __name: "Accordion",
50
50
  props: {
51
51
  title: null,
@@ -58,63 +58,63 @@ const n = {
58
58
  fullWidthContent: { type: Boolean }
59
59
  },
60
60
  setup(e) {
61
- const s = e, r = w(), l = x(null), d = x(null);
62
- N(function() {
63
- d.value && l.value && new $(d.value, l.value);
61
+ const t = e, r = b(), l = x(null), u = x(null);
62
+ w(function() {
63
+ u.value && l.value && new D(u.value, l.value);
64
64
  });
65
- const u = s.icon;
65
+ const p = t.icon;
66
66
  return (c, f) => {
67
67
  var m, a;
68
- return p(), y("details", {
68
+ return d(), y("details", {
69
69
  ref_key: "$details",
70
- ref: d
70
+ ref: u
71
71
  }, [
72
72
  i("summary", {
73
- class: t([o(n).summary, (m = e.headingClassName) != null ? m : o(n).summaryColor])
73
+ class: s([o(n).summary, (m = e.headingClassName) != null ? m : o(n).summaryColor])
74
74
  }, [
75
75
  i("span", {
76
- class: t(o(n).summaryDiv)
76
+ class: s(o(n).summaryDiv)
77
77
  }, [
78
78
  i("span", {
79
- class: t(o(n).icon)
79
+ class: s(o(n).icon)
80
80
  }, [
81
81
  C(c.$slots, "iconEl", {}, () => [
82
- k(o(u))
82
+ t.icon ? (d(), N(o(p), { key: 0 })) : k("", !0)
83
83
  ])
84
84
  ], 2),
85
- (s.icon || o(r).iconEl) && e.separator ? (p(), y("span", {
85
+ (t.icon || o(r).iconEl) && e.separator ? (d(), y("span", {
86
86
  key: 0,
87
- class: t(o(n).separator)
88
- }, null, 2)) : h("", !0),
89
- i("span", B, [
87
+ class: s(o(n).separator)
88
+ }, null, 2)) : k("", !0),
89
+ i("span", S, [
90
90
  i("span", {
91
- class: t([
91
+ class: s([
92
92
  e.titleClassName ? e.titleClassName : o(n).summaryTitleColor,
93
93
  o(n).summaryTitle
94
94
  ])
95
- }, g(e.title), 3),
96
- e.description ? (p(), y("span", {
95
+ }, h(e.title), 3),
96
+ e.description ? (d(), y("span", {
97
97
  key: 0,
98
- class: t([
98
+ class: s([
99
99
  o(n).summaryDescription,
100
100
  (a = e.descriptionClassName) != null ? a : o(n).summaryDescriptionColor
101
101
  ])
102
- }, g(e.description), 3)) : h("", !0)
102
+ }, h(e.description), 3)) : k("", !0)
103
103
  ]),
104
- k(o(O), {
104
+ $(o(O), {
105
105
  strokeColor: "gray-300",
106
- class: t(["open:icon-dark-gray-500", o(n).chevron])
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
111
  ref_key: "$content",
112
112
  ref: l,
113
- class: t(o(n).contentWrapper)
113
+ class: s(o(n).contentWrapper)
114
114
  }, [
115
- e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (p(), y("div", {
115
+ e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (d(), y("div", {
116
116
  key: 1,
117
- class: t(o(n).content)
117
+ class: s(o(n).content)
118
118
  }, [
119
119
  C(c.$slots, "default")
120
120
  ], 2))
@@ -124,7 +124,7 @@ const n = {
124
124
  }
125
125
  });
126
126
  export {
127
- j as default
127
+ A as default
128
128
  };
129
129
 
130
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 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"> */