@cypress-design/vue-checkbox 0.3.1 → 0.3.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.
@@ -1,13 +1,13 @@
1
1
  $ yarn build:module && yarn build:types
2
2
  $ yarn vite build
3
3
  $ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vite build
4
- vite v4.2.2 building for production...
4
+ vite v4.3.9 building for production...
5
5
  transforming...
6
6
  ✓ 5 modules transformed.
7
7
  rendering chunks...
8
8
  computing gzip size...
9
- dist/index.es.mjs 3.71 kB │ gzip: 1.72 kB │ map: 262.14 kB
10
- dist/index.umd.js 3.39 kB │ gzip: 1.67 kB │ map: 261.92 kB
11
- ✓ built in 9.75s
9
+ dist/index.es.mjs 4.03 kB │ gzip: 1.75 kB │ map: 292.01 kB
10
+ dist/index.umd.js 3.67 kB │ gzip: 1.70 kB │ map: 291.75 kB
11
+ ✓ built in 3.65s
12
12
  $ yarn vue-tsc --project ./tsconfig.build.json
13
13
  $ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vue-tsc --project ./tsconfig.build.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @cypress-design/vue-checkbox
2
2
 
3
+ ## 0.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#245](https://github.com/cypress-io/cypress-design/pull/245) [`d52d023`](https://github.com/cypress-io/cypress-design/commit/d52d02301bb851d514661a8c258d0c4ae5baf171) Thanks [@elevatebart](https://github.com/elevatebart)! - use tailwind to rollup classes in the final package
8
+
9
+ - Updated dependencies [[`d52d023`](https://github.com/cypress-io/cypress-design/commit/d52d02301bb851d514661a8c258d0c4ae5baf171)]:
10
+ - @cypress-design/vue-icon@0.23.1
11
+
12
+ ## 0.3.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [`08ba16d`](https://github.com/cypress-io/cypress-design/commit/08ba16da4a8663676ee96ac4950938857bd0d9a3) Thanks [@elevatebart](https://github.com/elevatebart)! - fix wind-keep plugin
17
+
18
+ - Updated dependencies [[`08ba16d`](https://github.com/cypress-io/cypress-design/commit/08ba16da4a8663676ee96ac4950938857bd0d9a3)]:
19
+ - @cypress-design/vue-icon@0.22.1
20
+
3
21
  ## 0.3.1
4
22
 
5
23
  ### Patch Changes
@@ -68,7 +68,7 @@ describe('<Checkbox />', () => {
68
68
  <div>
69
69
  <Checkbox
70
70
  label="Welcome guide settings"
71
- vModel={isChecked.value}
71
+ v-model={isChecked.value}
72
72
  class="px-2 py-1 m-2 border border-gray-300 rounded"
73
73
  />
74
74
  <div
package/ReadMe.md CHANGED
@@ -11,3 +11,9 @@ or with yarn
11
11
  ```bash
12
12
  yarn add @cypress-design/vue-checkbox
13
13
  ```
14
+
15
+ ## Usage
16
+
17
+ ```ts
18
+ import Checkbox from '@cypress-design/vue-checkbox'
19
+ ```
@@ -69,8 +69,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
69
69
  }, {
70
70
  id: string;
71
71
  color: 'red' | 'indigo' | 'jade';
72
- }>, {
73
- label: (_: {}) => any;
72
+ }, {}>, {
73
+ label?(_: {}): any;
74
74
  }>;
75
75
  export default _default;
76
76
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -83,13 +83,16 @@ type __VLS_TypePropsToRuntimeProps<T> = {
83
83
  };
84
84
  };
85
85
  type __VLS_WithDefaults<P, D> = {
86
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
86
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
87
87
  default: D[K];
88
- } : P[K];
88
+ }> : P[K];
89
89
  };
90
90
  type __VLS_WithTemplateSlots<T, S> = T & {
91
91
  new (): {
92
92
  $slots: S;
93
93
  };
94
94
  };
95
+ type __VLS_Prettify<T> = {
96
+ [K in keyof T]: T[K];
97
+ } & {};
95
98
  //# sourceMappingURL=Checkbox.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.v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AAC,CAAC;KACT,CAAA;CAAE,CAAC;AACJ,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
package/dist/index.es.mjs CHANGED
@@ -1,116 +1,121 @@
1
- import { h as f, defineComponent as x, ref as C, computed as y, openBlock as u, createElementBlock as g, createElementVNode as b, normalizeClass as i, unref as a, createBlock as v, createCommentVNode as k, renderSlot as w, toDisplayString as B } from "vue";
2
- import * as S from "@cypress-design/icon-registry";
3
- import { ICON_COLOR_PROP_NAMES as j } from "@cypress-design/icon-registry";
4
- const z = ({
5
- body: e,
6
- compiledClasses: o,
1
+ import { h as g, defineComponent as k, ref as f, computed as C, openBlock as u, createElementBlock as m, createElementVNode as b, normalizeClass as d, unref as n, createBlock as y, createCommentVNode as h, renderSlot as v, toDisplayString as x } from "vue";
2
+ import * as w from "@cypress-design/icon-registry";
3
+ import { ICON_COLOR_PROP_NAMES as B } from "@cypress-design/icon-registry";
4
+ const O = ({
5
+ body: s,
6
+ compiledClasses: a,
7
7
  size: l,
8
- class: t,
9
- interactiveColorsOnGroup: h,
10
- ...n
8
+ ...o
11
9
  }) => {
12
- const d = Object.keys(n).reduce(
13
- (p, s) => (!j.includes(s) && s !== "name" && (p[s] = n[s]), p),
10
+ const t = Object.keys(o).reduce(
11
+ (e, i) => (!B.includes(
12
+ i
13
+ ) && i !== "name" && (e[i] = o[i]), e),
14
14
  {}
15
- ), c = {
15
+ ), r = {
16
16
  width: l,
17
17
  height: l,
18
18
  viewBox: `0 0 ${l} ${l}`,
19
19
  fill: "none",
20
- innerHTML: e,
21
- ...d
20
+ innerHTML: s,
21
+ class: void 0,
22
+ ...t
22
23
  // add all standard attributes back to the svg tag
23
24
  };
24
- return o.length && (c.class = o.join(" ")), c;
25
- }, O = (e) => {
26
- const { sizeWithDefault: o, compiledClasses: l } = S.getComponentAttributes({ ...e, availableSizes: ["16"] }), t = {
25
+ return a.length && (r.class = a.join(" ")), r;
26
+ }, S = (s) => {
27
+ const { interactiveColorsOnGroup: a, name: l, ...o } = s, { sizeWithDefault: t, compiledClasses: r } = w.getComponentAttributes({
28
+ ...o,
29
+ availableSizes: ["16"],
30
+ interactiveColorsOnGroup: a
31
+ }), e = {
27
32
  16: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 8.5 7.5 11 11 5" class="icon-dark"/>'
28
- }[o];
29
- if (!t)
30
- throw Error(`Icon "checkmark-small" is not available in size ${o}`);
31
- return f("svg", z({
32
- ...e,
33
- size: o,
34
- body: t,
35
- compiledClasses: l
33
+ }[t];
34
+ if (!e)
35
+ throw Error(`Icon "checkmark-small" is not available in size ${t}`);
36
+ return g("svg", O({
37
+ ...o,
38
+ size: t,
39
+ body: e,
40
+ compiledClasses: r
36
41
  }));
37
- }, r = {
42
+ }, c = {
38
43
  wrapper: "relative flex items-center",
39
44
  hiddenInput: "absolute inset-0 w-0 h-0 opacity-0",
40
45
  labelTag: "flex items-center",
41
46
  visibleCheckbox: "border border-solid rounded h-[16px] w-[16px] flex flex-shrink-0 items-center text-white",
42
47
  trueLabel: "block ml-[8px] text-[16px] leading-[24px] font-light select-none"
43
- }, m = {
48
+ }, p = {
44
49
  indigo: "border-indigo-500 bg-indigo-400",
45
50
  jade: "border-jade-500 bg-jade-400",
46
51
  red: "border-red-500 bg-red-400",
47
52
  disabled: "border-gray-200 bg-gray-100",
48
53
  empty: "border-gray-200 bg-white"
49
- }, V = { class: "relative flex items-center" }, E = ["id", "name", "disabled", "checked"], I = ["for"];
50
- function L() {
54
+ }, _ = { class: "relative flex items-center" }, j = ["id", "name", "disabled", "checked"], z = ["for"];
55
+ function V() {
51
56
  return String(Date.now().toString(32) + Math.random().toString(16)).replace(
52
57
  /\./g,
53
58
  ""
54
59
  );
55
60
  }
56
- const $ = /* @__PURE__ */ x({
61
+ const L = /* @__PURE__ */ k({
57
62
  __name: "Checkbox",
58
63
  props: {
59
- id: { default: () => L() },
60
- name: null,
64
+ id: { default: () => V() },
65
+ name: {},
61
66
  checked: { type: Boolean },
62
67
  color: { default: "indigo" },
63
68
  disabled: { type: Boolean },
64
69
  modelValue: { type: Boolean },
65
- label: null
70
+ label: {}
66
71
  },
67
72
  emits: ["update:modelValue"],
68
- setup(e, { emit: o }) {
69
- const l = e, t = C(l.modelValue || l.checked);
70
- function h() {
71
- t.value = !t.value, o("update:modelValue", t.value);
73
+ setup(s, { emit: a }) {
74
+ const l = s, o = f(l.modelValue || l.checked);
75
+ function t() {
76
+ o.value = !o.value, a("update:modelValue", o.value);
72
77
  }
73
- const n = y(
74
- () => l.disabled ? m.disabled : t.value ? m[l.color] : m.empty
78
+ const r = C(
79
+ () => l.disabled ? p.disabled : o.value ? p[l.color] : p.empty
75
80
  );
76
- return (d, c) => (u(), g("span", V, [
81
+ return (e, i) => (u(), m("span", _, [
77
82
  b("input", {
78
83
  id: e.id,
79
- class: i(a(r).hiddenInput),
84
+ class: d(n(c).hiddenInput),
80
85
  name: e.name || e.id,
81
86
  type: "checkbox",
82
- onChange: h,
87
+ onChange: t,
83
88
  disabled: l.disabled,
84
- checked: t.value
85
- }, null, 42, E),
89
+ checked: o.value
90
+ }, null, 42, j),
86
91
  b("label", {
87
- class: i(a(r).labelTag),
92
+ class: d(n(c).labelTag),
88
93
  for: e.id
89
94
  }, [
90
- t.value ? (u(), v(a(O), {
95
+ o.value ? (u(), y(n(S), {
91
96
  key: 0,
92
97
  strokeColor: "white",
93
98
  class: "absolute"
94
- })) : k("", !0),
99
+ })) : h("", !0),
95
100
  b("span", {
96
- class: i([a(n), a(r).visibleCheckbox])
101
+ class: d([r.value, n(c).visibleCheckbox])
97
102
  }, null, 2),
98
- w(d.$slots, "label", {}, () => [
99
- e.label ? (u(), g("span", {
103
+ v(e.$slots, "label", {}, () => [
104
+ e.label ? (u(), m("span", {
100
105
  key: 0,
101
- class: i([
102
- a(r).trueLabel,
106
+ class: d([
107
+ n(c).trueLabel,
103
108
  e.disabled ? "text-gray-500" : "text-gray-800 dark:text-gray-200"
104
109
  ])
105
- }, B(e.label), 3)) : k("", !0)
110
+ }, x(e.label), 3)) : h("", !0)
106
111
  ])
107
- ], 10, I)
112
+ ], 10, z)
108
113
  ]));
109
114
  }
110
115
  });
111
116
  export {
112
- $ as default
117
+ L as default
113
118
  };
114
119
  //# sourceMappingURL=index.es.mjs.map
115
120
 
116
- /* <windicss-keep class="relative flex items-center absolute text-gray-500 text-gray-800 dark:text-gray-200 icon-dark-white"> */
121
+ /* <wind-keep class="relative flex items-center absolute text-gray-500 text-gray-800 dark:text-gray-200 inset-0 w-0 h-0 opacity-0 border border-solid rounded h-[16px] w-[16px] flex-shrink-0 text-white block ml-[8px] text-[16px] leading-[24px] font-light select-none border-indigo-500 bg-indigo-400 border-red-500 bg-red-400 border-gray-200 bg-gray-100 bg-white"> */