@cypress-design/vue-accordion 0.2.1 → 0.3.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.
@@ -0,0 +1,13 @@
1
+ $ yarn build:module && yarn build:types
2
+ $ yarn vite build
3
+ $ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vite build
4
+ vite v4.2.1 building for production...
5
+ transforming...
6
+ ✓ 5 modules transformed.
7
+ rendering chunks...
8
+ computing gzip size...
9
+ dist/index.es.mjs 4.96 kB │ gzip: 1.84 kB │ map: 263.66 kB
10
+ dist/index.umd.js 4.69 kB │ gzip: 1.81 kB │ map: 263.42 kB
11
+ ✓ built in 5.84s
12
+ $ yarn vue-tsc --project ./tsconfig.build.json
13
+ $ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vue-tsc --project ./tsconfig.build.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @cypress-design/vue-accordion
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#178](https://github.com/cypress-io/cypress-design/pull/178) [`d0de778`](https://github.com/cypress-io/cypress-design/commit/d0de77843adb87d8f4804219c6dca8f45b15c650) Thanks [@elevatebart](https://github.com/elevatebart)! - deliver new docs and improved components
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`18399c7`](https://github.com/cypress-io/cypress-design/commit/18399c72a52288c67af0935384430d4e4cd24251), [`d0de778`](https://github.com/cypress-io/cypress-design/commit/d0de77843adb87d8f4804219c6dca8f45b15c650)]:
12
+ - @cypress-design/vue-icon@0.20.0
13
+ - @cypress-design/details-animation@0.1.0
14
+
3
15
  ## 0.2.1
4
16
 
5
17
  ### Patch Changes
package/ReadMe.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Collapsible component with a header and a body.
6
6
 
7
- ## install
7
+ ## Install
8
8
 
9
9
  ```bash
10
10
  npm install @cypress-design/vue-accordion
@@ -22,16 +22,22 @@ yarn add @cypress-design/vue-accordion
22
22
  import Accordion from '@cypress-design/vue-accordion'
23
23
  ```
24
24
 
25
- ```vue
26
- <Accordion
27
- :icon="IconActionQuestionMarkCircle"
28
- title="Accordion Title"
29
- description="Vestibulum id ligula porta felis euismod semper. Nulla... "
30
- separator
31
- open
32
- fullWidthContent
33
- >
34
- Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis
35
- nemo minus, sapiente magni ...
36
- </Accordion>
25
+ ```vue live
26
+ <script lang="ts" setup>
27
+ import { IconActionQuestionMarkCircle } from '@cypress-design/vue-icon'
28
+ </script>
29
+
30
+ <template>
31
+ <Accordion
32
+ :icon="IconActionQuestionMarkCircle"
33
+ title="Accordion Title"
34
+ description="Vestibulum id ligula porta felis euismod semper. Nulla... "
35
+ separator
36
+ open
37
+ fullWidthContent
38
+ >
39
+ Lorem ipsum, dolor sit amet consectetur adipisicing elit. Odio dolore omnis
40
+ nemo minus, sapiente magni ...
41
+ </Accordion>
42
+ </template>
37
43
  ```
package/dist/index.es.mjs CHANGED
@@ -1,4 +1,4 @@
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";
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
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 B } from "@cypress-design/icon-registry";
@@ -20,22 +20,26 @@ const n = {
20
20
  compiledClasses: t,
21
21
  size: r,
22
22
  class: l,
23
- interactiveColorsOnGroup: u,
24
- ...p
23
+ interactiveColorsOnGroup: m,
24
+ ...d
25
25
  }) => {
26
- const c = Object.keys(p).reduce((m, a) => (!B.includes(a) && a !== "name" && (m[a] = p[a]), m), {}), f = {
26
+ const i = Object.keys(d).reduce(
27
+ (k, u) => (!B.includes(u) && u !== "name" && (k[u] = d[u]), k),
28
+ {}
29
+ ), y = {
27
30
  width: r,
28
31
  height: r,
29
32
  viewBox: `0 0 ${r} ${r}`,
30
33
  fill: "none",
31
34
  innerHTML: e,
32
- ...c
35
+ ...i
36
+ // add all standard attributes back to the svg tag
33
37
  };
34
- return t.length && (f.class = t.join(" ")), f;
38
+ return t.length && (y.class = t.join(" ")), y;
35
39
  }, O = (e) => {
36
40
  const { sizeWithDefault: t, compiledClasses: r } = z.getComponentAttributes({ ...e, availableSizes: ["8", "16"] }), l = {
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
- 16: '<path d="m4 6 4 4 4-4" stroke="currentColor" class="icon-dark" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>'
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"/>'
39
43
  }[t];
40
44
  if (!l)
41
45
  throw Error(`Icon "chevron-down-small" is not available in size ${t}`);
@@ -58,75 +62,72 @@ const n = {
58
62
  fullWidthContent: { type: Boolean }
59
63
  },
60
64
  setup(e) {
61
- const t = e, r = b(), l = x(null), u = x(null);
65
+ const t = e, r = b(), l = x(null), m = x(null);
62
66
  w(function() {
63
- u.value && l.value && new D(u.value, l.value);
67
+ m.value && l.value && new D(m.value, l.value);
64
68
  });
65
- const p = t.icon;
66
- return (c, f) => {
67
- var m, a;
68
- return d(), y("details", {
69
- ref_key: "$details",
70
- ref: u
69
+ const d = t.icon;
70
+ return (i, y) => (c(), p("details", {
71
+ ref_key: "$details",
72
+ ref: m
73
+ }, [
74
+ a("summary", {
75
+ class: s([o(n).summary, e.headingClassName ?? o(n).summaryColor])
71
76
  }, [
72
- i("summary", {
73
- class: s([o(n).summary, (m = e.headingClassName) != null ? m : o(n).summaryColor])
77
+ a("span", {
78
+ class: s(o(n).summaryDiv)
74
79
  }, [
75
- i("span", {
76
- class: s(o(n).summaryDiv)
80
+ a("span", {
81
+ class: s(o(n).icon)
77
82
  }, [
78
- i("span", {
79
- class: s(o(n).icon)
80
- }, [
81
- C(c.$slots, "iconEl", {}, () => [
82
- t.icon ? (d(), N(o(p), { key: 0 })) : k("", !0)
83
+ f(i.$slots, "iconEl", {}, () => [
84
+ t.icon ? (c(), N(o(d), { key: 0 })) : C("", !0)
85
+ ])
86
+ ], 2),
87
+ (t.icon || o(r).iconEl) && e.separator ? (c(), p("span", {
88
+ key: 0,
89
+ class: s(o(n).separator),
90
+ 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
83
97
  ])
84
- ], 2),
85
- (t.icon || o(r).iconEl) && e.separator ? (d(), y("span", {
98
+ }, h(e.title), 3),
99
+ e.description ? (c(), p("span", {
86
100
  key: 0,
87
- class: s(o(n).separator),
88
- role: "separator"
89
- }, null, 2)) : k("", !0),
90
- i("span", S, [
91
- i("span", {
92
- class: s([
93
- e.titleClassName ? e.titleClassName : o(n).summaryTitleColor,
94
- o(n).summaryTitle
95
- ])
96
- }, h(e.title), 3),
97
- e.description ? (d(), y("span", {
98
- key: 0,
99
- class: s([
100
- o(n).summaryDescription,
101
- (a = e.descriptionClassName) != null ? a : o(n).summaryDescriptionColor
102
- ])
103
- }, h(e.description), 3)) : k("", !0)
104
- ]),
105
- $(o(O), {
106
- strokeColor: "gray-300",
107
- class: s(["open:icon-dark-gray-500", o(n).chevron])
108
- }, null, 8, ["class"])
109
- ], 2)
110
- ], 2),
111
- i("div", {
112
- ref_key: "$content",
113
- ref: l,
114
- class: s(o(n).contentWrapper)
115
- }, [
116
- e.fullWidthContent ? C(c.$slots, "default", { key: 0 }) : (d(), y("div", {
117
- key: 1,
118
- class: s(o(n).content)
119
- }, [
120
- C(c.$slots, "default")
121
- ], 2))
101
+ class: s([
102
+ o(n).summaryDescription,
103
+ e.descriptionClassName ?? o(n).summaryDescriptionColor
104
+ ])
105
+ }, h(e.description), 3)) : C("", !0)
106
+ ]),
107
+ $(o(O), {
108
+ strokeColor: "gray-300",
109
+ class: s(["open:icon-dark-gray-500", o(n).chevron])
110
+ }, null, 8, ["class"])
122
111
  ], 2)
123
- ], 512);
124
- };
112
+ ], 2),
113
+ a("div", {
114
+ ref_key: "$content",
115
+ ref: l,
116
+ class: s(o(n).contentWrapper)
117
+ }, [
118
+ e.fullWidthContent ? f(i.$slots, "default", { key: 0 }) : (c(), p("div", {
119
+ key: 1,
120
+ class: s(o(n).content)
121
+ }, [
122
+ f(i.$slots, "default")
123
+ ], 2))
124
+ ], 2)
125
+ ], 512));
125
126
  }
126
127
  });
127
128
  export {
128
129
  A as default
129
130
  };
131
+ //# sourceMappingURL=index.es.mjs.map
130
132
 
131
133
  /* <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]"> */
132
- //# sourceMappingURL=index.es.mjs.map