@cypress-design/vue-accordion 0.1.4 → 0.1.6

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
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <details ref="details">
2
+ <details ref="$details">
3
3
  <summary
4
4
  :class="[CssClasses.summary, headingClassName ?? CssClasses.summaryColor]"
5
5
  >
6
- <div :class="CssClasses.summaryDiv">
6
+ <span :class="CssClasses.summaryDiv">
7
7
  <span :class="CssClasses.icon">
8
8
  <slot name="iconEl">
9
9
  <Icon />
@@ -13,16 +13,16 @@
13
13
  v-if="(props.icon || slots.iconEl) && separator"
14
14
  :class="CssClasses.separator"
15
15
  />
16
- <div class="flex-grow pr-16px">
17
- <div
16
+ <span class="flex-grow pr-16px">
17
+ <span
18
18
  :class="[
19
19
  titleClassName ? titleClassName : CssClasses.summaryTitleColor,
20
20
  CssClasses.summaryTitle,
21
21
  ]"
22
22
  >
23
23
  {{ title }}
24
- </div>
25
- <div
24
+ </span>
25
+ <span
26
26
  v-if="description"
27
27
  :class="[
28
28
  CssClasses.summaryDescription,
@@ -30,16 +30,16 @@
30
30
  ]"
31
31
  >
32
32
  {{ description }}
33
- </div>
34
- </div>
33
+ </span>
34
+ </span>
35
35
  <IconChevronDownSmall
36
36
  strokeColor="gray-300"
37
37
  class="open:icon-dark-gray-500"
38
38
  :class="CssClasses.chevron"
39
39
  />
40
- </div>
40
+ </span>
41
41
  </summary>
42
- <div ref="content" :class="CssClasses.contentWrapper">
42
+ <div ref="$content" :class="CssClasses.contentWrapper">
43
43
  <!-- @slot expandable body of the collapsible accordion -->
44
44
  <slot v-if="fullWidthContent" />
45
45
  <div v-else :class="CssClasses.content">
@@ -101,12 +101,12 @@ const props = defineProps<{
101
101
  fullWidthContent?: boolean
102
102
  }>()
103
103
 
104
- const content = ref(null)
105
- const details = ref(null)
104
+ const $content = ref(null)
105
+ const $details = ref(null)
106
106
 
107
107
  onMounted(function () {
108
- if (details.value && content.value) {
109
- new DetailsAnimation(details.value, content.value)
108
+ if ($details.value && $content.value) {
109
+ new DetailsAnimation($details.value, $content.value)
110
110
  }
111
111
  })
112
112
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @cypress-design/vue-accordion
2
2
 
3
+ ## 0.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`34a646b`](https://github.com/cypress-io/cypress-design/commit/34a646bbb5ae613d3ede0f63ac62c8a6bf31dd82) Thanks [@elevatebart](https://github.com/elevatebart)! - replace div with spans inside summary for html5 validation
8
+
9
+ ## 0.1.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`e590bdc`](https://github.com/cypress-io/cypress-design/commit/e590bdc4a1f076e00fd1c5d41c461880fbff53d1) Thanks [@elevatebart](https://github.com/elevatebart)! - ci: add changeset
14
+
3
15
  ## 0.1.4
4
16
 
5
17
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAatB,CAAA;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAA;IACV;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,SAAS,wFACiE,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;CActB,CAAA;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAA;IACV;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,SAAS,wFACiE,CAAA"}
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 i, normalizeClass as s, unref as o, renderSlot as C, createVNode as h, createCommentVNode as k, toDisplayString as v } 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 E } from "@cypress-design/icon-registry";
5
- const t = {
6
- summary: "details-none card open:rounded-b-none min-h-65px",
7
- summaryDiv: "flex flex-row py-12px px-24px flex-nowrap items-center",
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 s, unref as o, renderSlot as C, createVNode as h, createCommentVNode as k, 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";
5
+ const n = {
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",
8
8
  summaryColor: "bg-white",
9
9
  summaryTitle: "text-18px leading-28px font-medium",
10
10
  summaryTitleColor: "text-indigo-500",
@@ -15,15 +15,15 @@ const t = {
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
- }, O = ({
18
+ }, E = ({
19
19
  body: e,
20
- compiledClasses: n,
20
+ compiledClasses: t,
21
21
  size: r,
22
22
  class: l,
23
23
  interactiveColorsOnGroup: d,
24
24
  ...u
25
25
  }) => {
26
- const c = Object.keys(u).reduce((m, a) => (E.includes(a) || (m[a] = u[a]), m), {}), f = {
26
+ const c = Object.keys(u).reduce((m, a) => (!z.includes(a) && a !== "name" && (m[a] = u[a]), m), {}), f = {
27
27
  width: r,
28
28
  height: r,
29
29
  viewBox: `0 0 ${r} ${r}`,
@@ -31,17 +31,17 @@ const t = {
31
31
  innerHTML: e,
32
32
  ...c
33
33
  };
34
- return n.length && (f.class = n.join(" ")), f;
35
- }, $ = (e) => {
36
- const { sizeWithDefault: n, compiledClasses: r } = z.getComponentAttributes({ ...e, availableSizes: ["8", "16"] }), l = {
34
+ return t.length && (f.class = t.join(" ")), f;
35
+ }, O = (e) => {
36
+ const { sizeWithDefault: t, compiledClasses: r } = D.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
- }[n];
39
+ }[t];
40
40
  if (!l)
41
- throw Error(`Icon "chevron-down-small" is not available in size ${n}`);
42
- return g("svg", O({
41
+ throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
42
+ return v("svg", E({
43
43
  ...e,
44
- size: n,
44
+ size: t,
45
45
  body: l,
46
46
  compiledClasses: r
47
47
  }));
@@ -58,63 +58,63 @@ const t = {
58
58
  fullWidthContent: { type: Boolean }
59
59
  },
60
60
  setup(e) {
61
- const n = e, r = w(), l = x(null), d = x(null);
61
+ const t = e, r = w(), l = x(null), d = x(null);
62
62
  N(function() {
63
- d.value && l.value && new D(d.value, l.value);
63
+ d.value && l.value && new $(d.value, l.value);
64
64
  });
65
- const u = n.icon;
65
+ const u = t.icon;
66
66
  return (c, f) => {
67
67
  var m, a;
68
68
  return p(), y("details", {
69
- ref_key: "details",
69
+ ref_key: "$details",
70
70
  ref: d
71
71
  }, [
72
72
  i("summary", {
73
- class: s([o(t).summary, (m = e.headingClassName) != null ? m : o(t).summaryColor])
73
+ class: s([o(n).summary, (m = e.headingClassName) != null ? m : o(n).summaryColor])
74
74
  }, [
75
- i("div", {
76
- class: s(o(t).summaryDiv)
75
+ i("span", {
76
+ class: s(o(n).summaryDiv)
77
77
  }, [
78
78
  i("span", {
79
- class: s(o(t).icon)
79
+ class: s(o(n).icon)
80
80
  }, [
81
81
  C(c.$slots, "iconEl", {}, () => [
82
82
  h(o(u))
83
83
  ])
84
84
  ], 2),
85
- (n.icon || o(r).iconEl) && e.separator ? (p(), y("hr", {
85
+ (t.icon || o(r).iconEl) && e.separator ? (p(), y("hr", {
86
86
  key: 0,
87
- class: s(o(t).separator)
87
+ class: s(o(n).separator)
88
88
  }, null, 2)) : k("", !0),
89
- i("div", B, [
90
- i("div", {
89
+ i("span", B, [
90
+ i("span", {
91
91
  class: s([
92
- e.titleClassName ? e.titleClassName : o(t).summaryTitleColor,
93
- o(t).summaryTitle
92
+ e.titleClassName ? e.titleClassName : o(n).summaryTitleColor,
93
+ o(n).summaryTitle
94
94
  ])
95
- }, v(e.title), 3),
96
- e.description ? (p(), y("div", {
95
+ }, g(e.title), 3),
96
+ e.description ? (p(), y("span", {
97
97
  key: 0,
98
98
  class: s([
99
- o(t).summaryDescription,
100
- (a = e.descriptionClassName) != null ? a : o(t).summaryDescriptionColor
99
+ o(n).summaryDescription,
100
+ (a = e.descriptionClassName) != null ? a : o(n).summaryDescriptionColor
101
101
  ])
102
- }, v(e.description), 3)) : k("", !0)
102
+ }, g(e.description), 3)) : k("", !0)
103
103
  ]),
104
- h(o($), {
104
+ h(o(O), {
105
105
  strokeColor: "gray-300",
106
- class: s(["open:icon-dark-gray-500", o(t).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
- ref_key: "content",
111
+ ref_key: "$content",
112
112
  ref: l,
113
- class: s(o(t).contentWrapper)
113
+ class: s(o(n).contentWrapper)
114
114
  }, [
115
115
  e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (p(), y("div", {
116
116
  key: 1,
117
- class: s(o(t).content)
117
+ class: s(o(n).content)
118
118
  }, [
119
119
  C(c.$slots, "default")
120
120
  ], 2))
@@ -127,5 +127,5 @@ export {
127
127
  j as default
128
128
  };
129
129
 
130
- /* <windicss-keep class="flex-grow pr-16px open:icon-dark-gray-500 icon-dark-gray-300 details-none card open:rounded-b-none min-h-65px flex flex-row py-12px px-24px 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-63px 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"> */
131
131
  //# sourceMappingURL=index.es.mjs.map