@cypress-design/vue-accordion 0.1.7 → 0.2.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.
@@ -15,7 +15,7 @@ export default (options: AccordionStoryOptions = {}) => {
15
15
  } = options
16
16
 
17
17
  return (
18
- <div className="m-16px">
18
+ <div className="m-[16px]">
19
19
  <Accordion
20
20
  title={title}
21
21
  separator={separator}
package/Accordion.vue CHANGED
@@ -6,14 +6,15 @@
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
13
13
  v-if="(props.icon || slots.iconEl) && separator"
14
14
  :class="CssClasses.separator"
15
+ aria-role="separator"
15
16
  />
16
- <span class="flex-grow pr-16px">
17
+ <span class="flex-grow pr-[16px]">
17
18
  <span
18
19
  :class="[
19
20
  titleClassName ? titleClassName : CssClasses.summaryTitleColor,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @cypress-design/vue-accordion
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#151](https://github.com/cypress-io/cypress-design/pull/151) [`8b0e735`](https://github.com/cypress-io/cypress-design/commit/8b0e7356eb64a6b3583d3486dda8ecbb11c34cca) Thanks [@elevatebart](https://github.com/elevatebart)! - refactor: use clases compatible with both windi and tailwind
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`106b61a`](https://github.com/cypress-io/cypress-design/commit/106b61a97888f956a4c9d235fde5efb4243e1445), [`7b4f416`](https://github.com/cypress-io/cypress-design/commit/7b4f4162a0d150aa8cab7ec239faebb58c39464d)]:
12
+ - @cypress-design/vue-icon@0.18.0
13
+
14
+ ## 0.1.8
15
+
16
+ ### Patch Changes
17
+
18
+ - [`6ec15ab`](https://github.com/cypress-io/cypress-design/commit/6ec15ab28355dac5cb0fbc55397f192a3fd68e19) Thanks [@elevatebart](https://github.com/elevatebart)! - avoid warnings on accordions when no icon
19
+
3
20
  ## 0.1.7
4
21
 
5
22
  ### Patch Changes
package/dist/index.es.mjs CHANGED
@@ -1,29 +1,29 @@
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
- summaryDiv: "flex flex-row py-12px px-24px flex-nowrap items-center min-h-63px",
7
+ summaryDiv: "flex flex-row py-[12px] px-[24px] flex-nowrap items-center min-h-[63px]",
8
8
  summaryColor: "bg-white",
9
- summaryTitle: "text-18px leading-28px font-medium",
9
+ summaryTitle: "text-[18px] leading-[28px] font-medium",
10
10
  summaryTitleColor: "text-indigo-500 block",
11
- summaryDescription: "text-14px leading-20px font-normal block",
11
+ summaryDescription: "text-[14px] leading-[20px] font-normal block",
12
12
  summaryDescriptionColor: "text-gray-700",
13
- icon: "mr-24px flex-shrink-0",
14
- separator: "w-1px h-40px bg-gray-100 mr-16px",
13
+ icon: "mr-[24px] flex-shrink-0",
14
+ separator: "w-[1px] h-[40px] bg-gray-100 mr-[16px]",
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
- content: "px-24px py-16px"
17
+ content: "px-[24px] py-[16px]"
18
18
  }, E = ({
19
19
  body: e,
20
- compiledClasses: s,
20
+ compiledClasses: t,
21
21
  size: r,
22
- class: l,
23
- interactiveColorsOnGroup: d,
24
- ...u
22
+ class: a,
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, l) => (!B.includes(l) && l !== "name" && (m[l] = p[l]), 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"] }), a = {
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];
40
- if (!l)
41
- throw Error(`Icon "chevron-down-small" is not available in size ${s}`);
42
- return v("svg", E({
39
+ }[t];
40
+ if (!a)
41
+ throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
42
+ return g("svg", E({
43
43
  ...e,
44
- size: s,
45
- body: l,
44
+ size: t,
45
+ body: a,
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,64 @@ 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(), a = x(null), u = x(null);
62
+ w(function() {
63
+ u.value && a.value && new D(u.value, a.value);
64
64
  });
65
- const u = s.icon;
65
+ const p = t.icon;
66
66
  return (c, f) => {
67
- var m, a;
68
- return p(), y("details", {
67
+ var m, l;
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
+ "aria-role": "separator"
89
+ }, null, 2)) : k("", !0),
90
+ i("span", S, [
90
91
  i("span", {
91
- class: t([
92
+ class: s([
92
93
  e.titleClassName ? e.titleClassName : o(n).summaryTitleColor,
93
94
  o(n).summaryTitle
94
95
  ])
95
- }, g(e.title), 3),
96
- e.description ? (p(), y("span", {
96
+ }, h(e.title), 3),
97
+ e.description ? (d(), y("span", {
97
98
  key: 0,
98
- class: t([
99
+ class: s([
99
100
  o(n).summaryDescription,
100
- (a = e.descriptionClassName) != null ? a : o(n).summaryDescriptionColor
101
+ (l = e.descriptionClassName) != null ? l : o(n).summaryDescriptionColor
101
102
  ])
102
- }, g(e.description), 3)) : h("", !0)
103
+ }, h(e.description), 3)) : k("", !0)
103
104
  ]),
104
- k(o(O), {
105
+ $(o(O), {
105
106
  strokeColor: "gray-300",
106
- class: t(["open:icon-dark-gray-500", o(n).chevron])
107
+ class: s(["open:icon-dark-gray-500", o(n).chevron])
107
108
  }, null, 8, ["class"])
108
109
  ], 2)
109
110
  ], 2),
110
111
  i("div", {
111
112
  ref_key: "$content",
112
- ref: l,
113
- class: t(o(n).contentWrapper)
113
+ ref: a,
114
+ class: s(o(n).contentWrapper)
114
115
  }, [
115
- e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (p(), y("div", {
116
+ e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (d(), y("div", {
116
117
  key: 1,
117
- class: t(o(n).content)
118
+ class: s(o(n).content)
118
119
  }, [
119
120
  C(c.$slots, "default")
120
121
  ], 2))
@@ -124,8 +125,8 @@ const n = {
124
125
  }
125
126
  });
126
127
  export {
127
- j as default
128
+ A as default
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"> */
131
+ /* <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]"> */
131
132
  //# sourceMappingURL=index.es.mjs.map