@cypress-design/vue-accordion 0.1.2 → 0.1.3

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
@@ -3,39 +3,41 @@
3
3
  <summary
4
4
  :class="[CssClasses.summary, headingClassName ?? CssClasses.summaryColor]"
5
5
  >
6
- <span :class="CssClasses.icon">
7
- <slot name="iconEl">
8
- <Icon />
9
- </slot>
10
- </span>
11
- <hr
12
- v-if="(props.icon || slots.iconEl) && separator"
13
- :class="CssClasses.separator"
14
- />
15
- <div class="flex-grow pr-16px">
16
- <div
17
- :class="[
18
- titleClassName ? titleClassName : CssClasses.summaryTitleColor,
19
- CssClasses.summaryTitle,
20
- ]"
21
- >
22
- {{ title }}
23
- </div>
24
- <div
25
- v-if="description"
26
- :class="[
27
- CssClasses.summaryDescription,
28
- descriptionClassName ?? CssClasses.summaryDescriptionColor,
29
- ]"
30
- >
31
- {{ description }}
6
+ <div :class="CssClasses.summaryDiv">
7
+ <span :class="CssClasses.icon">
8
+ <slot name="iconEl">
9
+ <Icon />
10
+ </slot>
11
+ </span>
12
+ <hr
13
+ v-if="(props.icon || slots.iconEl) && separator"
14
+ :class="CssClasses.separator"
15
+ />
16
+ <div class="flex-grow pr-16px">
17
+ <div
18
+ :class="[
19
+ titleClassName ? titleClassName : CssClasses.summaryTitleColor,
20
+ CssClasses.summaryTitle,
21
+ ]"
22
+ >
23
+ {{ title }}
24
+ </div>
25
+ <div
26
+ v-if="description"
27
+ :class="[
28
+ CssClasses.summaryDescription,
29
+ descriptionClassName ?? CssClasses.summaryDescriptionColor,
30
+ ]"
31
+ >
32
+ {{ description }}
33
+ </div>
32
34
  </div>
35
+ <IconChevronDownSmall
36
+ strokeColor="gray-300"
37
+ class="open:icon-dark-gray-500"
38
+ :class="CssClasses.chevron"
39
+ />
33
40
  </div>
34
- <IconChevronDownSmall
35
- strokeColor="gray-300"
36
- class="open:icon-dark-gray-500"
37
- :class="CssClasses.chevron"
38
- />
39
41
  </summary>
40
42
  <div ref="content" :class="CssClasses.contentWrapper">
41
43
  <!-- @slot expandable body of the collapsible accordion -->
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @cypress-design/vue-accordion
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6cece49`](https://github.com/cypress-io/cypress-design/commit/6cece49fc60db7046df81a3f77e9a696326e55a9) Thanks [@elevatebart](https://github.com/elevatebart)! - feat: adapt accordion to safari 14
8
+
3
9
  ## 0.1.2
4
10
 
5
11
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  export declare const CssClasses: {
2
- details: string;
3
2
  summary: string;
3
+ summaryDiv: string;
4
4
  summaryColor: string;
5
5
  summaryTitle: string;
6
6
  summaryTitleColor: string;
package/dist/index.es.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { h as g, defineComponent as b, useSlots as w, ref as x, onMounted as N, openBlock as p, createElementBlock as y, createElementVNode as m, normalizeClass as r, unref as o, renderSlot as C, createVNode as h, createCommentVNode as k, toDisplayString as v } from "vue";
1
+ import { h as g, defineComponent as b, useSlots as w, ref as x, onMounted as N, openBlock as p, createElementBlock as y, createElementVNode as i, normalizeClass as s, unref as o, renderSlot as C, createVNode as h, createCommentVNode as k, toDisplayString as v } from "vue";
2
2
  import { DetailsAnimation as D } from "@cypress-design/details-animation";
3
3
  import * as z from "@cypress-design/icon-registry";
4
4
  import { ICON_COLOR_PROP_NAMES as E } from "@cypress-design/icon-registry";
5
5
  const t = {
6
- details: "",
7
- summary: "details-none min-h-65px py-12px card open:rounded-b-none px-24px flex flex-row flex-nowrap items-center",
6
+ summary: "details-none card open:rounded-b-none",
7
+ summaryDiv: "flex flex-row py-12px px-24px flex-nowrap items-center min-h-65px",
8
8
  summaryColor: "bg-white",
9
9
  summaryTitle: "text-18px leading-28px font-medium",
10
10
  summaryTitleColor: "text-indigo-500",
@@ -18,22 +18,22 @@ const t = {
18
18
  }, O = ({
19
19
  body: e,
20
20
  compiledClasses: n,
21
- size: s,
21
+ size: r,
22
22
  class: l,
23
23
  interactiveColorsOnGroup: d,
24
24
  ...u
25
25
  }) => {
26
- const i = Object.keys(u).reduce((c, a) => (E.includes(a) || (c[a] = u[a]), c), {}), f = {
27
- width: s,
28
- height: s,
29
- viewBox: `0 0 ${s} ${s}`,
26
+ const c = Object.keys(u).reduce((m, a) => (E.includes(a) || (m[a] = u[a]), m), {}), f = {
27
+ width: r,
28
+ height: r,
29
+ viewBox: `0 0 ${r} ${r}`,
30
30
  fill: "none",
31
31
  innerHTML: e,
32
- ...i
32
+ ...c
33
33
  };
34
34
  return n.length && (f.class = n.join(" ")), f;
35
35
  }, $ = (e) => {
36
- const { sizeWithDefault: n, compiledClasses: s } = z.getComponentAttributes({ ...e, availableSizes: ["8", "16"] }), l = {
36
+ const { sizeWithDefault: n, 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
39
  }[n];
@@ -43,7 +43,7 @@ const t = {
43
43
  ...e,
44
44
  size: n,
45
45
  body: l,
46
- compiledClasses: s
46
+ compiledClasses: r
47
47
  }));
48
48
  }, B = { class: "flex-grow pr-16px" }, j = /* @__PURE__ */ b({
49
49
  __name: "Accordion",
@@ -58,61 +58,65 @@ const t = {
58
58
  fullWidthContent: { type: Boolean }
59
59
  },
60
60
  setup(e) {
61
- const n = e, s = w(), l = x(null), d = x(null);
61
+ const n = e, r = w(), l = x(null), d = x(null);
62
62
  N(function() {
63
63
  d.value && l.value && new D(d.value, l.value);
64
64
  });
65
65
  const u = n.icon;
66
- return (i, f) => {
67
- var c, a;
66
+ return (c, f) => {
67
+ var m, a;
68
68
  return p(), y("details", {
69
69
  ref_key: "details",
70
70
  ref: d
71
71
  }, [
72
- m("summary", {
73
- class: r([o(t).summary, (c = e.headingClassName) != null ? c : o(t).summaryColor])
72
+ i("summary", {
73
+ class: s([o(t).summary, (m = e.headingClassName) != null ? m : o(t).summaryColor])
74
74
  }, [
75
- m("span", {
76
- class: r(o(t).icon)
75
+ i("div", {
76
+ class: s(o(t).summaryDiv)
77
77
  }, [
78
- C(i.$slots, "iconEl", {}, () => [
79
- h(o(u))
80
- ])
81
- ], 2),
82
- (n.icon || o(s).iconEl) && e.separator ? (p(), y("hr", {
83
- key: 0,
84
- class: r(o(t).separator)
85
- }, null, 2)) : k("", !0),
86
- m("div", B, [
87
- m("div", {
88
- class: r([
89
- e.titleClassName ? e.titleClassName : o(t).summaryTitleColor,
90
- o(t).summaryTitle
78
+ i("span", {
79
+ class: s(o(t).icon)
80
+ }, [
81
+ C(c.$slots, "iconEl", {}, () => [
82
+ h(o(u))
91
83
  ])
92
- }, v(e.title), 3),
93
- e.description ? (p(), y("div", {
84
+ ], 2),
85
+ (n.icon || o(r).iconEl) && e.separator ? (p(), y("hr", {
94
86
  key: 0,
95
- class: r([
96
- o(t).summaryDescription,
97
- (a = e.descriptionClassName) != null ? a : o(t).summaryDescriptionColor
98
- ])
99
- }, v(e.description), 3)) : k("", !0)
100
- ]),
101
- h(o($), {
102
- strokeColor: "gray-300",
103
- class: r(["open:icon-dark-gray-500", o(t).chevron])
104
- }, null, 8, ["class"])
87
+ class: s(o(t).separator)
88
+ }, null, 2)) : k("", !0),
89
+ i("div", B, [
90
+ i("div", {
91
+ class: s([
92
+ e.titleClassName ? e.titleClassName : o(t).summaryTitleColor,
93
+ o(t).summaryTitle
94
+ ])
95
+ }, v(e.title), 3),
96
+ e.description ? (p(), y("div", {
97
+ key: 0,
98
+ class: s([
99
+ o(t).summaryDescription,
100
+ (a = e.descriptionClassName) != null ? a : o(t).summaryDescriptionColor
101
+ ])
102
+ }, v(e.description), 3)) : k("", !0)
103
+ ]),
104
+ h(o($), {
105
+ strokeColor: "gray-300",
106
+ class: s(["open:icon-dark-gray-500", o(t).chevron])
107
+ }, null, 8, ["class"])
108
+ ], 2)
105
109
  ], 2),
106
- m("div", {
110
+ i("div", {
107
111
  ref_key: "content",
108
112
  ref: l,
109
- class: r(o(t).contentWrapper)
113
+ class: s(o(t).contentWrapper)
110
114
  }, [
111
- e.fullWidthContent ? C(i.$slots, "default", { key: 0 }) : (p(), y("div", {
115
+ e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (p(), y("div", {
112
116
  key: 1,
113
- class: r(o(t).content)
117
+ class: s(o(t).content)
114
118
  }, [
115
- C(i.$slots, "default")
119
+ C(c.$slots, "default")
116
120
  ], 2))
117
121
  ], 2)
118
122
  ], 512);
@@ -123,5 +127,5 @@ export {
123
127
  j as default
124
128
  };
125
129
 
126
- /* <windicss-keep class="flex-grow pr-16px open:icon-dark-gray-500 icon-dark-gray-300 details-none min-h-65px py-12px card open:rounded-b-none px-24px flex flex-row flex-nowrap items-center bg-white text-18px leading-28px font-medium text-indigo-500 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"> */
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-65px bg-white text-18px leading-28px font-medium text-indigo-500 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"> */
127
131
  //# sourceMappingURL=index.es.mjs.map