@cypress-design/vue-alert 0.5.3 → 0.5.4
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 +3 -3
- package/Alert.vue +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/Alert.vue.d.ts +1 -1
- package/dist/Alert.vue.d.ts.map +1 -1
- package/dist/index.es.mjs +122 -105
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +0 -8
- package/vue-shim.d.ts +0 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -6,8 +6,8 @@ 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[2m10.
|
|
10
|
-
[2mdist/[22m[36mindex.umd.js [39m[1m[
|
|
11
|
-
[32m✓ built in
|
|
9
|
+
[2mdist/[22m[36mindex.es.mjs [39m[1m[2m10.97 kB[22m[1m[22m[2m │ gzip: 2.89 kB[22m[2m │ map: 295.13 kB[22m
|
|
10
|
+
[2mdist/[22m[36mindex.umd.js [39m[1m[2m9.03 kB[22m[1m[22m[2m │ gzip: 2.72 kB[22m[2m │ map: 294.33 kB[22m
|
|
11
|
+
[32m✓ built in 13.67s[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/Alert.vue
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @cypress-design/vue-alert
|
|
2
2
|
|
|
3
|
+
## 0.5.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#219](https://github.com/cypress-io/cypress-design/pull/219) [`0a4ce3b`](https://github.com/cypress-io/cypress-design/commit/0a4ce3bb55b9ab0510f7fb9ba207d5fdc3cb723f) Thanks [@elevatebart](https://github.com/elevatebart)! - refactor some typings so eslint passes without warning
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`0a4ce3b`](https://github.com/cypress-io/cypress-design/commit/0a4ce3bb55b9ab0510f7fb9ba207d5fdc3cb723f)]:
|
|
10
|
+
- @cypress-design/vue-icon@0.22.3
|
|
11
|
+
|
|
3
12
|
## 0.5.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/Alert.vue.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
86
86
|
type: AlertVariant;
|
|
87
87
|
detailsTitle: string;
|
|
88
88
|
size: "xs" | "sm" | "md" | "lg";
|
|
89
|
-
}>, {
|
|
89
|
+
}, {}>, {
|
|
90
90
|
icon?(_: {
|
|
91
91
|
strokeColor: import("@cypress-design/vue-icon").WindiColor | undefined;
|
|
92
92
|
class: string;
|
package/dist/Alert.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.vue.d.ts","sourceRoot":"","sources":["../Alert.vue.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,YAAY,EAKb,MAAM,iCAAiC,CAAA;;
|
|
1
|
+
{"version":3,"file":"Alert.vue.d.ts","sourceRoot":"","sources":["../Alert.vue.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,YAAY,EAKb,MAAM,iCAAiC,CAAA;;IAmIpC;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;IA/BH;;OAEG;;IAEH;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IA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
|
1
|
+
import { h as c, defineComponent as R, ref as z, useSlots as D, computed as g, onMounted as A, onUnmounted as G, openBlock as C, createElementBlock as b, normalizeClass as p, createElementVNode as f, renderSlot as y, normalizeProps as O, guardReactiveProps as H, createBlock as I, resolveDynamicComponent as T, mergeProps as B, createCommentVNode as m, createVNode as $, unref as x, createTextVNode as E, toDisplayString as N } from "vue";
|
|
2
|
+
import * as h from "@cypress-design/icon-registry";
|
|
3
|
+
import { ICON_COLOR_PROP_NAMES as P } from "@cypress-design/icon-registry";
|
|
4
|
+
import { DetailsAnimation as V } from "@cypress-design/details-animation";
|
|
5
5
|
const k = ({
|
|
6
|
-
body:
|
|
7
|
-
compiledClasses:
|
|
8
|
-
size:
|
|
9
|
-
|
|
10
|
-
interactiveColorsOnGroup: h,
|
|
11
|
-
...p
|
|
6
|
+
body: l,
|
|
7
|
+
compiledClasses: a,
|
|
8
|
+
size: r,
|
|
9
|
+
...s
|
|
12
10
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
(
|
|
11
|
+
const e = Object.keys(s).reduce(
|
|
12
|
+
(o, i) => (!P.includes(
|
|
13
|
+
i
|
|
14
|
+
) && i !== "name" && (o[i] = s[i]), o),
|
|
15
15
|
{}
|
|
16
|
-
),
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
19
|
-
viewBox: `0 0 ${
|
|
16
|
+
), t = {
|
|
17
|
+
width: r,
|
|
18
|
+
height: r,
|
|
19
|
+
viewBox: `0 0 ${r} ${r}`,
|
|
20
20
|
fill: "none",
|
|
21
|
-
innerHTML:
|
|
22
|
-
|
|
21
|
+
innerHTML: l,
|
|
22
|
+
class: void 0,
|
|
23
|
+
...e
|
|
23
24
|
// add all standard attributes back to the svg tag
|
|
24
25
|
};
|
|
25
|
-
return
|
|
26
|
-
}, _ = (
|
|
27
|
-
const {
|
|
26
|
+
return a.length && (t.class = a.join(" ")), t;
|
|
27
|
+
}, _ = (l) => {
|
|
28
|
+
const { interactiveColorsOnGroup: a, name: r, ...s } = l, { sizeWithDefault: e, compiledClasses: t } = h.getComponentAttributes({
|
|
29
|
+
...s,
|
|
30
|
+
availableSizes: ["16", "24"],
|
|
31
|
+
interactiveColorsOnGroup: a
|
|
32
|
+
}), o = {
|
|
28
33
|
16: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 13 13 3M3 3l10 10" class="icon-dark"/>',
|
|
29
34
|
24: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 20 20 4M4 4l16 16" class="icon-dark"/>'
|
|
30
|
-
}[
|
|
31
|
-
if (!
|
|
32
|
-
throw Error(`Icon "action-delete-large" is not available in size ${
|
|
33
|
-
return
|
|
35
|
+
}[e];
|
|
36
|
+
if (!o)
|
|
37
|
+
throw Error(`Icon "action-delete-large" is not available in size ${e}`);
|
|
38
|
+
return c("svg", k({
|
|
34
39
|
...s,
|
|
35
|
-
size:
|
|
36
|
-
body:
|
|
37
|
-
compiledClasses:
|
|
40
|
+
size: e,
|
|
41
|
+
body: o,
|
|
42
|
+
compiledClasses: t
|
|
38
43
|
}));
|
|
39
|
-
},
|
|
40
|
-
const {
|
|
44
|
+
}, Z = (l) => {
|
|
45
|
+
const { interactiveColorsOnGroup: a, name: r, ...s } = l, { sizeWithDefault: e, compiledClasses: t } = h.getComponentAttributes({
|
|
46
|
+
...s,
|
|
47
|
+
availableSizes: ["16"],
|
|
48
|
+
interactiveColorsOnGroup: a
|
|
49
|
+
}), o = {
|
|
41
50
|
16: '<path stroke="currentColor" stroke-width="2" d="M12.95 12.95a7 7 0 1 1-9.9-9.9 7 7 0 0 1 9.9 9.9Z" class="icon-dark"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 8 1.5 2L10 6" class="icon-dark"/>'
|
|
42
|
-
}[
|
|
43
|
-
if (!
|
|
44
|
-
throw Error(`Icon "checkmark-outline" is not available in size ${
|
|
45
|
-
return
|
|
51
|
+
}[e];
|
|
52
|
+
if (!o)
|
|
53
|
+
throw Error(`Icon "checkmark-outline" is not available in size ${e}`);
|
|
54
|
+
return c("svg", k({
|
|
46
55
|
...s,
|
|
47
|
-
size:
|
|
48
|
-
body:
|
|
49
|
-
compiledClasses:
|
|
56
|
+
size: e,
|
|
57
|
+
body: o,
|
|
58
|
+
compiledClasses: t
|
|
50
59
|
}));
|
|
51
|
-
},
|
|
52
|
-
const {
|
|
60
|
+
}, W = (l) => {
|
|
61
|
+
const { interactiveColorsOnGroup: a, name: r, ...s } = l, { sizeWithDefault: e, compiledClasses: t } = h.getComponentAttributes({
|
|
62
|
+
...s,
|
|
63
|
+
availableSizes: ["8", "16"],
|
|
64
|
+
interactiveColorsOnGroup: a
|
|
65
|
+
}), o = {
|
|
53
66
|
8: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 2.5 3 3 3-3" class="icon-dark"/>',
|
|
54
67
|
16: '<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m4 6 4 4 4-4" class="icon-dark"/>'
|
|
55
|
-
}[
|
|
56
|
-
if (!
|
|
57
|
-
throw Error(`Icon "chevron-down-small" is not available in size ${
|
|
58
|
-
return
|
|
68
|
+
}[e];
|
|
69
|
+
if (!o)
|
|
70
|
+
throw Error(`Icon "chevron-down-small" is not available in size ${e}`);
|
|
71
|
+
return c("svg", k({
|
|
59
72
|
...s,
|
|
60
|
-
size:
|
|
61
|
-
body:
|
|
62
|
-
compiledClasses:
|
|
73
|
+
size: e,
|
|
74
|
+
body: o,
|
|
75
|
+
compiledClasses: t
|
|
63
76
|
}));
|
|
64
|
-
},
|
|
65
|
-
const {
|
|
77
|
+
}, S = (l) => {
|
|
78
|
+
const { interactiveColorsOnGroup: a, name: r, ...s } = l, { sizeWithDefault: e, compiledClasses: t } = h.getComponentAttributes({
|
|
79
|
+
...s,
|
|
80
|
+
availableSizes: ["16"],
|
|
81
|
+
interactiveColorsOnGroup: a
|
|
82
|
+
}), o = {
|
|
66
83
|
16: '<path fill="currentColor" fill-rule="evenodd" d="M2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8Zm6-8a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm1 5a1 1 0 0 0-2 0v3a1 1 0 0 0 2 0V5Zm-1 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" class="icon-dark" clip-rule="evenodd"/>'
|
|
67
|
-
}[
|
|
68
|
-
if (!
|
|
69
|
-
throw Error(`Icon "warning-circle" is not available in size ${
|
|
70
|
-
return
|
|
84
|
+
}[e];
|
|
85
|
+
if (!o)
|
|
86
|
+
throw Error(`Icon "warning-circle" is not available in size ${e}`);
|
|
87
|
+
return c("svg", k({
|
|
71
88
|
...s,
|
|
72
|
-
size:
|
|
73
|
-
body:
|
|
74
|
-
compiledClasses:
|
|
89
|
+
size: e,
|
|
90
|
+
body: o,
|
|
91
|
+
compiledClasses: t
|
|
75
92
|
}));
|
|
76
|
-
},
|
|
93
|
+
}, L = {
|
|
77
94
|
xs: "py-[4px] px-[8px] leading-[22px] text-[14px]",
|
|
78
95
|
sm: "py-[8px] px-[12px] leading-[22px] text-[14px]",
|
|
79
96
|
md: "py-[12px] px-[16px] leading-[24px] text-[16px]",
|
|
@@ -161,100 +178,100 @@ const k = ({
|
|
|
161
178
|
dismissible: { type: Boolean },
|
|
162
179
|
noIcon: { type: Boolean },
|
|
163
180
|
notRounded: { type: Boolean },
|
|
164
|
-
duration:
|
|
181
|
+
duration: {},
|
|
165
182
|
size: { default: U }
|
|
166
183
|
},
|
|
167
184
|
emits: ["dismiss"],
|
|
168
|
-
setup(
|
|
169
|
-
const
|
|
170
|
-
let
|
|
185
|
+
setup(l, { emit: a }) {
|
|
186
|
+
const r = l, s = z(!1), e = D(), t = g(() => r.variant ?? r.type), o = z(null), i = z(null), n = g(() => q[t.value] ?? {});
|
|
187
|
+
let u;
|
|
171
188
|
A(() => {
|
|
172
|
-
|
|
189
|
+
r.duration && (u = setTimeout(w, r.duration));
|
|
173
190
|
}), A(() => {
|
|
174
|
-
|
|
175
|
-
}),
|
|
176
|
-
|
|
191
|
+
o.value && i.value && new V(o.value, i.value);
|
|
192
|
+
}), G(() => {
|
|
193
|
+
u && clearTimeout(u);
|
|
177
194
|
});
|
|
178
195
|
function w() {
|
|
179
|
-
|
|
196
|
+
s.value = !0, a("dismiss"), u && (clearTimeout(u), u = void 0);
|
|
180
197
|
}
|
|
181
|
-
const
|
|
182
|
-
strokeColor:
|
|
198
|
+
const v = g(() => ({
|
|
199
|
+
strokeColor: n.value.iconColor,
|
|
183
200
|
class: "my-[4px] mr-[8px]"
|
|
184
|
-
})), j =
|
|
185
|
-
switch (
|
|
201
|
+
})), j = g(() => {
|
|
202
|
+
switch (t.value) {
|
|
186
203
|
case "info":
|
|
187
204
|
return null;
|
|
188
205
|
case "success":
|
|
189
|
-
return () =>
|
|
206
|
+
return () => c(Z, v.value);
|
|
190
207
|
case "warning":
|
|
191
|
-
return () =>
|
|
208
|
+
return () => c(S, v.value);
|
|
192
209
|
case "error":
|
|
193
|
-
return () =>
|
|
210
|
+
return () => c(S, v.value);
|
|
194
211
|
default:
|
|
195
212
|
return null;
|
|
196
213
|
}
|
|
197
|
-
}), M =
|
|
198
|
-
return (d, Q) =>
|
|
214
|
+
}), M = g(() => L[r.size] ?? {});
|
|
215
|
+
return (d, Q) => s.value ? m("", !0) : (C(), b("div", {
|
|
199
216
|
key: 0,
|
|
200
|
-
class:
|
|
217
|
+
class: p(["overflow-hidden text-left", [n.value.wrapperClass, { rounded: !r.notRounded }]])
|
|
201
218
|
}, [
|
|
202
|
-
|
|
203
|
-
class:
|
|
219
|
+
f("div", {
|
|
220
|
+
class: p(["flex", [n.value.headerClass, M.value]])
|
|
204
221
|
}, [
|
|
205
|
-
|
|
206
|
-
!
|
|
222
|
+
y(d.$slots, "icon", O(H(v.value)), () => [
|
|
223
|
+
!r.noIcon && j.value ? (C(), I(T(j.value), O(B({ key: 0 }, v.value)), null, 16)) : m("", !0)
|
|
207
224
|
]),
|
|
208
|
-
|
|
209
|
-
|
|
225
|
+
f("div", K, [
|
|
226
|
+
y(d.$slots, "default")
|
|
210
227
|
]),
|
|
211
|
-
|
|
228
|
+
d.dismissible ? (C(), b("button", {
|
|
212
229
|
key: 0,
|
|
213
230
|
class: "m-[4px] ml-[8px] h-[16px]",
|
|
214
231
|
onClick: w,
|
|
215
232
|
"aria-label": "Dismiss"
|
|
216
233
|
}, [
|
|
217
|
-
|
|
218
|
-
"stroke-color":
|
|
234
|
+
$(x(_), {
|
|
235
|
+
"stroke-color": n.value.iconCloseColor
|
|
219
236
|
}, null, 8, ["stroke-color"])
|
|
220
|
-
])) :
|
|
237
|
+
])) : m("", !0)
|
|
221
238
|
], 2),
|
|
222
|
-
|
|
239
|
+
x(e).body ? (C(), b("div", {
|
|
223
240
|
key: 0,
|
|
224
|
-
class:
|
|
241
|
+
class: p(["p-[16px]", n.value.bodyClass])
|
|
225
242
|
}, [
|
|
226
|
-
|
|
227
|
-
], 2)) :
|
|
228
|
-
|
|
243
|
+
y(d.$slots, "body")
|
|
244
|
+
], 2)) : m("", !0),
|
|
245
|
+
x(e).details ? (C(), b("details", {
|
|
229
246
|
key: 1,
|
|
230
|
-
class:
|
|
247
|
+
class: p(["p-[16px] border-t border-t-1", [n.value.bodyClass, n.value.borderClass]]),
|
|
231
248
|
ref_key: "detailsRef",
|
|
232
|
-
ref:
|
|
249
|
+
ref: o
|
|
233
250
|
}, [
|
|
234
|
-
|
|
235
|
-
class:
|
|
251
|
+
f("summary", {
|
|
252
|
+
class: p(["flex font-medium cursor-pointer details-none", n.value.detailsHeaderClass])
|
|
236
253
|
}, [
|
|
237
|
-
|
|
238
|
-
strokeColor:
|
|
254
|
+
$(x(W), {
|
|
255
|
+
strokeColor: n.value.iconChevronColor,
|
|
239
256
|
class: "icon my-[4px] mr-[8px] transition transform -rotate-90 open:rotate-0"
|
|
240
257
|
}, null, 8, ["strokeColor"]),
|
|
241
|
-
|
|
258
|
+
E(" " + N(r.detailsTitle), 1)
|
|
242
259
|
], 2),
|
|
243
|
-
|
|
260
|
+
f("div", {
|
|
244
261
|
ref_key: "contentRef",
|
|
245
262
|
ref: i
|
|
246
263
|
}, [
|
|
247
|
-
|
|
248
|
-
|
|
264
|
+
f("div", null, [
|
|
265
|
+
y(d.$slots, "details")
|
|
249
266
|
])
|
|
250
267
|
], 512)
|
|
251
|
-
], 2)) :
|
|
252
|
-
d.$slots.footer ? (
|
|
268
|
+
], 2)) : m("", !0),
|
|
269
|
+
d.$slots.footer ? (C(), b("div", {
|
|
253
270
|
key: 2,
|
|
254
|
-
class:
|
|
271
|
+
class: p(n.value.bodyClass)
|
|
255
272
|
}, [
|
|
256
|
-
|
|
257
|
-
], 2)) :
|
|
273
|
+
y(d.$slots, "footer")
|
|
274
|
+
], 2)) : m("", !0)
|
|
258
275
|
], 2));
|
|
259
276
|
}
|
|
260
277
|
});
|