@wikicasa-dev/components 2.1.24-alpha.5 → 2.1.24-alpha.7
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.
|
@@ -9,9 +9,12 @@ export type SnackbarProps = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Vue native teleport component prop :to
|
|
11
11
|
* @see https://vuejs.org/guide/built-ins/teleport.html#basic-usage
|
|
12
|
+
*
|
|
13
|
+
* If false, the viewport won't use the teleport feature.
|
|
12
14
|
*/
|
|
13
|
-
to?: ToastPortalProps["to"];
|
|
15
|
+
to?: string | false | ToastPortalProps["to"];
|
|
14
16
|
dataCy?: string;
|
|
17
|
+
withCloseIcon?: boolean;
|
|
15
18
|
};
|
|
16
19
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
17
20
|
open?: Optional<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.uikit-alert-viewport{--uikit-alert-viewport-padding: 0px;padding:var(--uikit-alert-viewport-padding)}.uikit-alert{--uikit-alert-bg-color: #e9effe;--uikit-alert-text-color: #2b5dff;background-color:var(--uikit-alert-bg-color);color:var(--uikit-alert-text-color)}.uikit-alert.uikit-alert-w-danger{--uikit-alert-bg-color: #fff4f4;--uikit-alert-text-color: #f20003}.uikit-alert.uikit-alert-w-darkblue{--uikit-alert-bg-color: #2a3761;--uikit-alert-text-color: #fff}.toast-root{will-change:animation,transform,opacity}.toast-root[data-state=open]{animation:slideLeft .1s ease-out}.toast-root[data-state=closed]{animation:slideRight .1s ease-out}.toast-root[data-swipe=move]{transform:translate(var(--reka-toast-swipe-move-x))}.toast-root[data-swipe=cancel]{transform:translate(0);transition:transform .2s ease-out}.toast-root[data-swipe=end]{animation:slideRight .1s ease-out}@keyframes slideLeft{0%{transform:translate(100%);opacity:0}to{transform:translate(var(--reka-toast-swipe-end-x));opacity:1}}@keyframes slideRight{0%{transform:translate(var(--reka-toast-swipe-end-x));opacity:1}to{transform:translate(100%);opacity:0}}
|
|
1
|
+
.uikit-alert-viewport{--uikit-alert-viewport-padding: 0px;--uikit-alert-viewport-position: fixed;--uikit-alert-viewport-top: auto;--uikit-alert-viewport-right: auto;--uikit-alert-viewport-bottom: 0px;--uikit-alert-viewport-left: 0px;padding:var(--uikit-alert-viewport-padding);position:var(--uikit-alert-viewport-position);inset:var(--uikit-alert-viewport-top) var(--uikit-alert-viewport-right) var(--uikit-alert-viewport-bottom) var(--uikit-alert-viewport-left)}.uikit-alert{--uikit-alert-bg-color: #e9effe;--uikit-alert-text-color: #2b5dff;background-color:var(--uikit-alert-bg-color);color:var(--uikit-alert-text-color)}.uikit-alert.uikit-alert-w-danger{--uikit-alert-bg-color: #fff4f4;--uikit-alert-text-color: #f20003}.uikit-alert.uikit-alert-w-darkblue{--uikit-alert-bg-color: #2a3761;--uikit-alert-text-color: #fff}.uikit-toast-root{will-change:animation,transform,opacity}.uikit-toast-root[data-state=open]{animation:slideLeft .1s ease-out}.uikit-toast-root[data-state=closed]{animation:slideRight .1s ease-out}.uikit-toast-root[data-swipe=move]{transform:translate(var(--reka-toast-swipe-move-x))}.uikit-toast-root[data-swipe=cancel]{transform:translate(0);transition:transform .2s ease-out}.uikit-toast-root[data-swipe=end]{animation:slideRight .1s ease-out}@keyframes slideLeft{0%{transform:translate(100%);opacity:0}to{transform:translate(var(--reka-toast-swipe-end-x));opacity:1}}@keyframes slideRight{0%{transform:translate(var(--reka-toast-swipe-end-x));opacity:1}to{transform:translate(100%);opacity:0}}
|
|
@@ -1,104 +1,109 @@
|
|
|
1
|
-
import { defineComponent as T, mergeModels as g, useModel as h, ref as
|
|
1
|
+
import { defineComponent as T, mergeModels as g, useModel as h, ref as x, watch as C, nextTick as I, createBlock as u, openBlock as s, unref as t, withCtx as a, renderSlot as k, createVNode as r, normalizeClass as $, createCommentVNode as m, normalizeStyle as b } from "vue";
|
|
2
2
|
import { CloseIcon as V } from "../../node_modules/@wikicasa-dev/svg-icons/dist/CloseIcon.js";
|
|
3
3
|
import "../../node_modules/@wikicasa-dev/svg-icons/dist/PharmacyIcon.js";
|
|
4
|
-
import { ToastProvider as
|
|
4
|
+
import { ToastProvider as B, ToastRoot as P, ToastTitle as z, ToastDescription as D, ToastClose as M, ToastAction as S, ProgressRoot as j, ProgressIndicator as A, ToastPortal as N, ToastViewport as p } from "reka-ui";
|
|
5
5
|
const q = /* @__PURE__ */ T({
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "BaseSnackbar",
|
|
8
8
|
props: /* @__PURE__ */ g({
|
|
9
9
|
alertClass: { default: "primary" },
|
|
10
10
|
duration: { default: 3e3 },
|
|
11
|
-
to: { default: "body" },
|
|
12
|
-
dataCy: { default: "" }
|
|
11
|
+
to: { type: [String, Boolean], default: "body" },
|
|
12
|
+
dataCy: { default: "" },
|
|
13
|
+
withCloseIcon: { type: Boolean, default: !0 }
|
|
13
14
|
}, {
|
|
14
15
|
open: { type: Boolean, default: !1 },
|
|
15
16
|
openModifiers: {}
|
|
16
17
|
}),
|
|
17
18
|
emits: ["update:open"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
let
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
19
|
+
setup(i) {
|
|
20
|
+
const n = h(i, "open"), o = x(0);
|
|
21
|
+
let f, c;
|
|
22
|
+
const v = (e = 3e3) => {
|
|
23
|
+
o.value = 0;
|
|
24
|
+
const l = Date.now();
|
|
25
|
+
c = setInterval(() => {
|
|
26
|
+
const w = Date.now() - l;
|
|
27
|
+
o.value = Math.min(100, w / e * 100), o.value >= 100 && clearInterval(c);
|
|
27
28
|
}, 30);
|
|
28
|
-
},
|
|
29
|
-
clearTimeout(
|
|
30
|
-
|
|
31
|
-
},
|
|
29
|
+
}, y = () => {
|
|
30
|
+
clearTimeout(f), f = setTimeout(() => {
|
|
31
|
+
n.value = !1;
|
|
32
|
+
}, i.duration), v(i.duration);
|
|
32
33
|
};
|
|
33
|
-
return
|
|
34
|
-
|
|
34
|
+
return C(
|
|
35
|
+
n,
|
|
35
36
|
(e) => {
|
|
36
|
-
|
|
37
|
+
I(() => {
|
|
37
38
|
if (e) {
|
|
38
|
-
|
|
39
|
+
y();
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
|
-
clearInterval(
|
|
42
|
+
clearInterval(c), clearTimeout(f), o.value = 0;
|
|
42
43
|
});
|
|
43
44
|
},
|
|
44
45
|
{ immediate: !0 }
|
|
45
|
-
), (e,
|
|
46
|
+
), (e, l) => (s(), u(t(B), null, {
|
|
46
47
|
default: a(() => [
|
|
47
|
-
|
|
48
|
-
open: () =>
|
|
48
|
+
k(e.$slots, "trigger", {
|
|
49
|
+
open: () => n.value = !0
|
|
49
50
|
}),
|
|
50
|
-
|
|
51
|
-
open:
|
|
52
|
-
"onUpdate:open":
|
|
53
|
-
duration:
|
|
54
|
-
class:
|
|
55
|
-
"data-cy":
|
|
51
|
+
r(t(P), {
|
|
52
|
+
open: n.value,
|
|
53
|
+
"onUpdate:open": l[1] || (l[1] = (d) => n.value = d),
|
|
54
|
+
duration: i.duration,
|
|
55
|
+
class: $(["uikit-toast-root uikit-relative uikit-flex uikit-gap-[8px] uikit-overflow-hidden uikit-rounded-[4px] uikit-p-[16px] uikit-text-16 uikit-font-medium uikit-shadow-surface sm:uikit-max-w-[460px]", ["uikit-alert", `uikit-alert-w-${i.alertClass}`, e.$attrs.class]]),
|
|
56
|
+
"data-cy": i.dataCy
|
|
56
57
|
}, {
|
|
57
58
|
default: a(() => [
|
|
58
|
-
e.$slots.title ? (
|
|
59
|
+
e.$slots.title ? (s(), u(t(z), {
|
|
59
60
|
key: 0,
|
|
60
61
|
"as-child": ""
|
|
61
62
|
}, {
|
|
62
63
|
default: a(() => [
|
|
63
|
-
|
|
64
|
+
k(e.$slots, "title")
|
|
64
65
|
]),
|
|
65
66
|
_: 3
|
|
66
|
-
})) :
|
|
67
|
-
|
|
67
|
+
})) : m("", !0),
|
|
68
|
+
r(t(D), { "as-child": "" }, {
|
|
68
69
|
default: a(() => [
|
|
69
|
-
|
|
70
|
-
i(
|
|
70
|
+
k(e.$slots, "default"),
|
|
71
|
+
i.withCloseIcon ? (s(), u(t(M), {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: "uikit-ml-[16px] uikit-flex uikit-size-[24px] uikit-shrink-0 uikit-cursor-pointer uikit-appearance-none uikit-items-center uikit-justify-center uikit-rounded-full uikit-bg-[#C1C8D5]"
|
|
74
|
+
}, {
|
|
71
75
|
default: a(() => [
|
|
72
|
-
|
|
76
|
+
r(t(V), {
|
|
73
77
|
width: 12,
|
|
74
78
|
height: 12,
|
|
75
79
|
"stroke-color": "#fff"
|
|
76
80
|
})
|
|
77
81
|
]),
|
|
78
82
|
_: 1
|
|
79
|
-
})
|
|
83
|
+
})) : m("", !0)
|
|
80
84
|
]),
|
|
81
85
|
_: 3
|
|
82
86
|
}),
|
|
83
|
-
|
|
87
|
+
e.$slots["toast-action"] ? (s(), u(t(S), {
|
|
88
|
+
key: 1,
|
|
84
89
|
class: "[grid-area:_action]",
|
|
85
90
|
"as-child": "",
|
|
86
91
|
"alt-text": "Goto schedule to undo"
|
|
87
92
|
}, {
|
|
88
93
|
default: a(() => [
|
|
89
|
-
|
|
94
|
+
k(e.$slots, "toast-action")
|
|
90
95
|
]),
|
|
91
96
|
_: 3
|
|
92
|
-
}),
|
|
93
|
-
|
|
94
|
-
modelValue:
|
|
95
|
-
"onUpdate:modelValue":
|
|
97
|
+
})) : m("", !0),
|
|
98
|
+
r(t(j), {
|
|
99
|
+
modelValue: o.value,
|
|
100
|
+
"onUpdate:modelValue": l[0] || (l[0] = (d) => o.value = d),
|
|
96
101
|
class: "uikit-absolute uikit-bottom-0 uikit-left-0 uikit-h-[4px] uikit-w-full uikit-overflow-hidden"
|
|
97
102
|
}, {
|
|
98
103
|
default: a(() => [
|
|
99
|
-
|
|
104
|
+
r(t(A), {
|
|
100
105
|
class: "uikit-relative uikit-block uikit-size-full uikit-bg-[#2b5dff] uikit-transition-transform uikit-duration-75 uikit-will-change-transform",
|
|
101
|
-
style:
|
|
106
|
+
style: b(`transform: translateX(-${100 - o.value}%)`)
|
|
102
107
|
}, null, 8, ["style"])
|
|
103
108
|
]),
|
|
104
109
|
_: 1
|
|
@@ -106,12 +111,18 @@ const q = /* @__PURE__ */ T({
|
|
|
106
111
|
]),
|
|
107
112
|
_: 3
|
|
108
113
|
}, 8, ["open", "duration", "class", "data-cy"]),
|
|
109
|
-
i(
|
|
114
|
+
i.to ? (s(), u(t(N), {
|
|
115
|
+
key: 0,
|
|
116
|
+
to: i.to
|
|
117
|
+
}, {
|
|
110
118
|
default: a(() => [
|
|
111
|
-
|
|
119
|
+
r(t(p), { class: "uikit-alert-viewport uikit-m-0 uikit-flex uikit-w-full uikit-list-none uikit-flex-col uikit-items-end uikit-justify-end uikit-gap-[8px]" })
|
|
112
120
|
]),
|
|
113
121
|
_: 1
|
|
114
|
-
}, 8, ["to"])
|
|
122
|
+
}, 8, ["to"])) : (s(), u(t(p), {
|
|
123
|
+
key: 1,
|
|
124
|
+
class: "uikit-alert-viewport uikit-m-0 uikit-flex uikit-w-full uikit-list-none uikit-flex-col uikit-items-end uikit-justify-end uikit-gap-[8px]"
|
|
125
|
+
}))
|
|
115
126
|
]),
|
|
116
127
|
_: 3
|
|
117
128
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wikicasa-dev/components",
|
|
3
|
-
"version": "2.1.24-alpha.
|
|
3
|
+
"version": "2.1.24-alpha.7",
|
|
4
4
|
"description": "Wikicasa frontend components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"prepublish": "pnpm build",
|
|
93
93
|
"story:dev": "histoire dev",
|
|
94
94
|
"story:build": "histoire build",
|
|
95
|
-
"story:preview": "histoire preview"
|
|
95
|
+
"story:preview": "histoire preview",
|
|
96
|
+
"release:alpha": "pnpm version prerelease --preid=alpha && pnpm publish --tag alpha --no-git-checks"
|
|
96
97
|
}
|
|
97
98
|
}
|