@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.
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +18 -0
- package/CheckboxVue.cy.tsx +1 -1
- package/ReadMe.md +6 -0
- package/dist/Checkbox.vue.d.ts +7 -4
- package/dist/Checkbox.vue.d.ts.map +1 -1
- package/dist/index.es.mjs +61 -56
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +0 -13
package/.turbo/turbo-build.log
CHANGED
|
@@ -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
|
-
[36mvite v4.
|
|
4
|
+
[36mvite v4.3.9 [32mbuilding for production...[36m[39m
|
|
5
5
|
transforming...
|
|
6
6
|
[32m✓[39m 5 modules transformed.
|
|
7
7
|
rendering chunks...
|
|
8
8
|
computing gzip size...
|
|
9
|
-
[2mdist/[22m[36mindex.es.mjs [39m[1m[
|
|
10
|
-
[2mdist/[22m[36mindex.umd.js [39m[1m[2m3.
|
|
11
|
-
[32m
|
|
9
|
+
[2mdist/[22m[36mindex.es.mjs [39m[1m[2m4.03 kB[22m[1m[22m[2m │ gzip: 1.75 kB[22m[2m │ map: 292.01 kB[22m
|
|
10
|
+
[2mdist/[22m[36mindex.umd.js [39m[1m[2m3.67 kB[22m[1m[22m[2m │ gzip: 1.70 kB[22m[2m │ map: 291.75 kB[22m
|
|
11
|
+
[32m✓ built in 3.65s[39m
|
|
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
|
package/CheckboxVue.cy.tsx
CHANGED
package/ReadMe.md
CHANGED
package/dist/Checkbox.vue.d.ts
CHANGED
|
@@ -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
|
|
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.vue.d.ts","sourceRoot":"","sources":["../Checkbox.vue.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Checkbox.vue.d.ts","sourceRoot":"","sources":["../Checkbox.vue.ts"],"names":[],"mappings":";IAgFI;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;;IAGH;;;OAGG;;;;;;;;IA1BH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;;IAGH;;;OAGG;;;;;;;;QAtBE,MAAM;WAaH,KAAK,GAAG,QAAQ,GAAG,MAAM;;mBAoIT,GAAG;;AAxN/B,wBAwO0G;AAC1G,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AAWN,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,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
|
|
2
|
-
import * as
|
|
3
|
-
import { ICON_COLOR_PROP_NAMES as
|
|
4
|
-
const
|
|
5
|
-
body:
|
|
6
|
-
compiledClasses:
|
|
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
|
-
|
|
9
|
-
interactiveColorsOnGroup: h,
|
|
10
|
-
...n
|
|
8
|
+
...o
|
|
11
9
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
(
|
|
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
|
-
),
|
|
15
|
+
), r = {
|
|
16
16
|
width: l,
|
|
17
17
|
height: l,
|
|
18
18
|
viewBox: `0 0 ${l} ${l}`,
|
|
19
19
|
fill: "none",
|
|
20
|
-
innerHTML:
|
|
21
|
-
|
|
20
|
+
innerHTML: s,
|
|
21
|
+
class: void 0,
|
|
22
|
+
...t
|
|
22
23
|
// add all standard attributes back to the svg tag
|
|
23
24
|
};
|
|
24
|
-
return
|
|
25
|
-
},
|
|
26
|
-
const {
|
|
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
|
-
}[
|
|
29
|
-
if (!
|
|
30
|
-
throw Error(`Icon "checkmark-small" is not available in size ${
|
|
31
|
-
return
|
|
32
|
-
...
|
|
33
|
-
size:
|
|
34
|
-
body:
|
|
35
|
-
compiledClasses:
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
50
|
-
function
|
|
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
|
|
61
|
+
const L = /* @__PURE__ */ k({
|
|
57
62
|
__name: "Checkbox",
|
|
58
63
|
props: {
|
|
59
|
-
id: { default: () =>
|
|
60
|
-
name:
|
|
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:
|
|
70
|
+
label: {}
|
|
66
71
|
},
|
|
67
72
|
emits: ["update:modelValue"],
|
|
68
|
-
setup(
|
|
69
|
-
const l =
|
|
70
|
-
function
|
|
71
|
-
|
|
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
|
|
74
|
-
() => l.disabled ?
|
|
78
|
+
const r = C(
|
|
79
|
+
() => l.disabled ? p.disabled : o.value ? p[l.color] : p.empty
|
|
75
80
|
);
|
|
76
|
-
return (
|
|
81
|
+
return (e, i) => (u(), m("span", _, [
|
|
77
82
|
b("input", {
|
|
78
83
|
id: e.id,
|
|
79
|
-
class:
|
|
84
|
+
class: d(n(c).hiddenInput),
|
|
80
85
|
name: e.name || e.id,
|
|
81
86
|
type: "checkbox",
|
|
82
|
-
onChange:
|
|
87
|
+
onChange: t,
|
|
83
88
|
disabled: l.disabled,
|
|
84
|
-
checked:
|
|
85
|
-
}, null, 42,
|
|
89
|
+
checked: o.value
|
|
90
|
+
}, null, 42, j),
|
|
86
91
|
b("label", {
|
|
87
|
-
class:
|
|
92
|
+
class: d(n(c).labelTag),
|
|
88
93
|
for: e.id
|
|
89
94
|
}, [
|
|
90
|
-
|
|
95
|
+
o.value ? (u(), y(n(S), {
|
|
91
96
|
key: 0,
|
|
92
97
|
strokeColor: "white",
|
|
93
98
|
class: "absolute"
|
|
94
|
-
})) :
|
|
99
|
+
})) : h("", !0),
|
|
95
100
|
b("span", {
|
|
96
|
-
class:
|
|
101
|
+
class: d([r.value, n(c).visibleCheckbox])
|
|
97
102
|
}, null, 2),
|
|
98
|
-
|
|
99
|
-
e.label ? (u(),
|
|
103
|
+
v(e.$slots, "label", {}, () => [
|
|
104
|
+
e.label ? (u(), m("span", {
|
|
100
105
|
key: 0,
|
|
101
|
-
class:
|
|
102
|
-
|
|
106
|
+
class: d([
|
|
107
|
+
n(c).trueLabel,
|
|
103
108
|
e.disabled ? "text-gray-500" : "text-gray-800 dark:text-gray-200"
|
|
104
109
|
])
|
|
105
|
-
},
|
|
110
|
+
}, x(e.label), 3)) : h("", !0)
|
|
106
111
|
])
|
|
107
|
-
], 10,
|
|
112
|
+
], 10, z)
|
|
108
113
|
]));
|
|
109
114
|
}
|
|
110
115
|
});
|
|
111
116
|
export {
|
|
112
|
-
|
|
117
|
+
L as default
|
|
113
118
|
};
|
|
114
119
|
//# sourceMappingURL=index.es.mjs.map
|
|
115
120
|
|
|
116
|
-
/* <
|
|
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"> */
|