@gspa/ui 0.3.0 → 0.3.1
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/dist/Toast.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes toast-progress-
|
|
1
|
+
.kv-toast-region[data-v-3876a110]{position:fixed;z-index:10000;width:min(408px,100vw);max-height:100dvh;padding:16px;box-sizing:border-box;pointer-events:none}.kv-toast-region--top-left[data-v-3876a110]{top:0;left:0}.kv-toast-region--top-center[data-v-3876a110]{top:0;left:50%;transform:translate(-50%)}.kv-toast-region--top-right[data-v-3876a110]{top:0;right:0}.kv-toast-region--bottom-left[data-v-3876a110]{bottom:0;left:0}.kv-toast-region--bottom-center[data-v-3876a110]{bottom:0;left:50%;transform:translate(-50%)}.kv-toast-region--bottom-right[data-v-3876a110]{right:0;bottom:0}.kv-toast-stack[data-v-3876a110]{display:flex;width:100%;flex-direction:column;gap:10px}.kv-toast-stack--bottom[data-v-3876a110]{flex-direction:column-reverse}.kv-toast[data-v-3876a110]{--toast-accent: var(--ui-primary, #173866);--toast-soft: var(--ui-primary-soft, #e6edf7);position:relative;display:grid;grid-template-columns:34px minmax(0,1fr) 28px;align-items:start;gap:10px;width:100%;min-height:58px;padding:12px 10px 13px 12px;overflow:hidden;box-sizing:border-box;color:var(--ui-text, #172033);background:var(--ui-surface, #ffffff);border:1px solid var(--ui-border, #dce3ed);border-radius:14px;box-shadow:0 12px 30px #0f172a24,0 2px 8px #0f172a12;pointer-events:auto;transition:transform .18s ease,box-shadow .18s ease}.kv-toast[data-v-3876a110]:before{position:absolute;top:12px;bottom:12px;left:0;width:3px;background:var(--toast-accent);border-radius:0 3px 3px 0;content:""}.kv-toast[data-v-3876a110]:hover{transform:translateY(-1px);box-shadow:0 16px 38px #0f172a2b,0 3px 10px #0f172a14}.kv-toast--info[data-v-3876a110]{--toast-accent: var(--ui-cyber, #176b87);--toast-soft: var(--ui-cyber-soft, #e0f2f7)}.kv-toast--success[data-v-3876a110]{--toast-accent: var(--ui-success, #14745d);--toast-soft: var(--ui-success-soft, #def3eb)}.kv-toast--warning[data-v-3876a110]{--toast-accent: var(--ui-warning, #a96008);--toast-soft: var(--ui-warning-soft, #fff0d6)}.kv-toast--error[data-v-3876a110]{--toast-accent: var(--ui-danger, #b4233c);--toast-soft: var(--ui-danger-soft, #fde7eb)}.kv-toast--subtle[data-v-3876a110]:before{opacity:.65}.kv-toast__icon[data-v-3876a110]{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;color:var(--toast-accent);background:var(--toast-soft);border-radius:10px}.kv-toast__icon[data-v-3876a110] svg{display:block;width:19px;height:19px}.kv-toast--loading .kv-toast__icon[data-v-3876a110] svg{animation:kv-toast-spin-3876a110 .9s linear infinite}.kv-toast__content[data-v-3876a110]{min-width:0;padding:1px 0}.kv-toast__title[data-v-3876a110],.kv-toast__message[data-v-3876a110]{padding:0;margin:0;font-family:inherit}.kv-toast__title[data-v-3876a110]{overflow-wrap:anywhere;color:var(--ui-text, #172033);font-size:.875rem;font-weight:650;line-height:1.35;letter-spacing:-.006em}.kv-toast__message[data-v-3876a110]{margin-top:3px;overflow-wrap:anywhere;color:var(--ui-text-muted, #5b687a);font-size:.8125rem;font-weight:400;line-height:1.45}.kv-toast__custom-content[data-v-3876a110]{margin-top:9px}.kv-toast__action[data-v-3876a110]{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:3px 7px;margin:9px 0 0 -7px;color:var(--toast-accent);font:inherit;font-size:.775rem;font-weight:650;line-height:1;background:transparent;border:0;border-radius:7px;cursor:pointer}.kv-toast__action[data-v-3876a110]:hover{background:var(--toast-soft)}.kv-toast__action[data-v-3876a110] svg{width:13px;height:13px;transition:transform .15s ease}.kv-toast__action[data-v-3876a110]:hover svg{transform:translate(2px)}.kv-toast__close[data-v-3876a110]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;color:var(--ui-text-soft, #78869a);background:transparent;border:0;border-radius:8px;cursor:pointer;transition:color .15s ease,background .15s ease}.kv-toast__close[data-v-3876a110]:hover{color:var(--ui-text, #172033);background:var(--ui-surface-muted, #f0f3f8)}.kv-toast__close[data-v-3876a110]:focus-visible,.kv-toast__action[data-v-3876a110]:focus-visible{outline:2px solid var(--ui-ring, var(--ui-primary, #173866));outline-offset:2px}.kv-toast__close[data-v-3876a110] svg{width:16px;height:16px}.kv-toast__progress-track[data-v-3876a110]{position:absolute;right:0;bottom:0;left:0;height:2px;overflow:hidden;background:transparent}.kv-toast__progress[data-v-3876a110]{display:block;width:100%;height:100%;background:var(--toast-accent);transform-origin:left;animation:kv-toast-progress-3876a110 linear forwards;opacity:.8}.kv-toast-enter-active[data-v-3876a110],.kv-toast-leave-active[data-v-3876a110],.kv-toast-move[data-v-3876a110]{transition:opacity .22s ease,transform .26s cubic-bezier(.16,1,.3,1)}.kv-toast-enter-from[data-v-3876a110],.kv-toast-leave-to[data-v-3876a110]{opacity:0;transform:translateY(-8px) scale(.98)}@keyframes kv-toast-progress-3876a110{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes kv-toast-spin-3876a110{to{transform:rotate(360deg)}}@media (max-width: 480px){.kv-toast-region[data-v-3876a110]{width:100vw;padding:10px}.kv-toast[data-v-3876a110]{border-radius:12px}}@media (prefers-reduced-motion: reduce){.kv-toast[data-v-3876a110],.kv-toast-enter-active[data-v-3876a110],.kv-toast-leave-active[data-v-3876a110],.kv-toast-move[data-v-3876a110],.kv-toast__action[data-v-3876a110] svg{transition-duration:.01ms}.kv-toast--loading .kv-toast__icon[data-v-3876a110] svg{animation-duration:1.8s}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),T=require("../lib/toast.cjs"),M=require("./Icon.cjs"),w=require("../_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["data-expanded","data-hotkey"],S=["aria-live"],L={key:0,class:"kv-toast__icon"},$={class:"kv-toast__content"},q={key:0,class:"kv-toast__title"},z={key:1,class:"kv-toast__message"},j=["onClick"],A=["onClick"],P={key:2,class:"kv-toast__progress-track","aria-hidden":"true"},K={__name:"Toast",props:{position:{type:String,default:"top-right",validator:a=>["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"].includes(a)},hotkey:{type:Array,default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!0},expand:{type:Boolean,default:!1},visibleToasts:{type:Number,default:3},closeButton:{type:Boolean,default:!0}},setup(a){const c=a,{toasts:d,dismiss:u}=T.useToaster(),p=e.computed(()=>d.value.slice(0,c.visibleToasts)),n=(t,i)=>({name:`Toast${t}Icon`,render(){return e.h("svg",{"data-toast-icon":t.toLowerCase(),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":1.9,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},i.map(([o,l])=>e.h(o,l)))}}),k=n("default",[["path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9"}],["path",{d:"M10 21h4"}]]),_=n("info",[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"M12 11v5"}],["path",{d:"M12 8h.01"}]]),h=n("success",[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"m8.5 12 2.3 2.3 4.9-5"}]]),v=n("warning",[["path",{d:"M10.3 4.1 2.7 17.2A1.8 1.8 0 0 0 4.3 20h15.4a1.8 1.8 0 0 0 1.6-2.8L13.7 4.1a2 2 0 0 0-3.4 0Z"}],["path",{d:"M12 9v4"}],["path",{d:"M12 16.5h.01"}]]),m=n("error",[["circle",{cx:"12",cy:"12",r:"9"}],["path",{d:"m9 9 6 6"}],["path",{d:"m15 9-6 6"}]]),y=n("loading",[["path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}]]),f=n("close",[["path",{d:"m7.5 7.5 9 9"}],["path",{d:"m16.5 7.5-9 9"}]]),B=n("arrow",[["path",{d:"M5 12h14"}],["path",{d:"m14 7 5 5-5 5"}]]),s={default:k,info:_,success:h,warning:v,error:m,loading:y},r=t=>s[t.variant]?t.variant:"default",g=t=>s[r(t)],b=t=>typeof t.icon=="string",C=t=>t.icon&&typeof t.icon!="string"&&t.icon!==!0?t.icon:g(t),N=t=>t.icon!==!1,V=t=>t.dismissible!==!1&&(t.closeButton||c.closeButton||t.dismissible),x=e.computed(()=>`kv-toast-region--${c.position}`),E=e.computed(()=>c.position.startsWith("bottom-")?"kv-toast-stack--bottom":"");return(t,i)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("section",{class:e.normalizeClass(["kv-toast-region",x.value]),"aria-label":"Notifications","data-expanded":c.expand,"data-hotkey":c.hotkey.join("+")},[e.createVNode(e.TransitionGroup,{name:"kv-toast",tag:"div",class:e.normalizeClass(["kv-toast-stack",E.value])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,o=>(e.openBlock(),e.createElementBlock("article",{key:o.id,class:e.normalizeClass(["kv-toast",[`kv-toast--${r(o)}`,{"kv-toast--subtle":!c.richColors}]]),role:"alert","aria-live":o.variant==="error"?"assertive":"polite","aria-atomic":"true"},[N(o)?(e.openBlock(),e.createElementBlock("span",L,[b(o)?(e.openBlock(),e.createBlock(M.default,{key:0,icon:o.icon,"aria-hidden":"true"},null,8,["icon"])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C(o)),{key:1}))])):e.createCommentVNode("",!0),e.createElementVNode("div",$,[o.title?(e.openBlock(),e.createElementBlock("p",q,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),o.message||o.description?(e.openBlock(),e.createElementBlock("p",z,e.toDisplayString(o.message||o.description),1)):e.createCommentVNode("",!0),o.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),e.mergeProps({key:2,ref_for:!0},o.componentProps,{class:"kv-toast__custom-content"}),null,16)):e.createCommentVNode("",!0),o.action?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"kv-toast__action",onClick:o.action.onClick},[e.createTextVNode(e.toDisplayString(o.action.label)+" ",1),e.createVNode(e.unref(B))],8,j)):e.createCommentVNode("",!0)]),V(o)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"kv-toast__close","aria-label":"Dismiss notification",onClick:l=>e.unref(u)(o.id)},[e.createVNode(e.unref(f))],8,A)):e.createCommentVNode("",!0),o.duration&&o.duration>0?(e.openBlock(),e.createElementBlock("span",P,[e.createElementVNode("span",{class:"kv-toast__progress",style:e.normalizeStyle({animationDuration:`${o.duration}ms`})},null,4)])):e.createCommentVNode("",!0)],10,S))),128))]),_:1},8,["class"])],10,D)]))}},W=w._export_sfc(K,[["__scopeId","data-v-3876a110"]]);exports.default=W;
|
package/dist/components/Toast.js
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { computed as l, createBlock as c, openBlock as e, Teleport as P, createElementVNode as d, normalizeClass as p, createVNode as u, TransitionGroup as W, withCtx as F, createElementBlock as s, Fragment as G, renderList as Z, createCommentVNode as i, resolveDynamicComponent as g, toDisplayString as _, mergeProps as q, createTextVNode as H, unref as h, normalizeStyle as J, h as b } from "vue";
|
|
2
|
+
import { useToaster as O } from "../lib/toast.js";
|
|
3
|
+
import Q from "./Icon.js";
|
|
4
|
+
import { _ as R } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const U = ["data-expanded", "data-hotkey"], X = ["aria-live"], Y = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "kv-toast__icon"
|
|
8
|
+
}, I = { class: "kv-toast__content" }, oo = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "kv-toast__title"
|
|
11
|
+
}, to = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "kv-toast__message"
|
|
14
|
+
}, eo = ["onClick"], no = ["onClick"], so = {
|
|
8
15
|
key: 2,
|
|
9
|
-
class: "
|
|
10
|
-
|
|
16
|
+
class: "kv-toast__progress-track",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}, ao = {
|
|
11
19
|
__name: "Toast",
|
|
12
20
|
props: {
|
|
13
21
|
position: {
|
|
14
22
|
type: String,
|
|
15
23
|
default: "top-right",
|
|
16
|
-
validator: (
|
|
24
|
+
validator: (r) => [
|
|
17
25
|
"top-left",
|
|
18
26
|
"top-center",
|
|
19
27
|
"top-right",
|
|
20
28
|
"bottom-left",
|
|
21
29
|
"bottom-center",
|
|
22
30
|
"bottom-right"
|
|
23
|
-
].includes(
|
|
31
|
+
].includes(r)
|
|
24
32
|
},
|
|
25
33
|
hotkey: {
|
|
26
34
|
type: Array,
|
|
@@ -43,189 +51,125 @@ const ee = ["aria-live"], te = { class: "flex-1 min-w-0 pt-0.5" }, re = ["onClic
|
|
|
43
51
|
default: !0
|
|
44
52
|
}
|
|
45
53
|
},
|
|
46
|
-
setup(
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
variants: {
|
|
62
|
-
variant: {
|
|
63
|
-
default: "ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30",
|
|
64
|
-
info: "border-blue-700 bg-blue-700 ui-text-inverse shadow-lg shadow-blue-900/25",
|
|
65
|
-
success: "border-green-700 bg-green-700 ui-text-inverse shadow-lg shadow-green-900/25",
|
|
66
|
-
warning: "border-amber-600 bg-amber-600 ui-text-inverse shadow-lg shadow-amber-900/25",
|
|
67
|
-
error: "border-red-700 bg-red-700 ui-text-inverse shadow-lg shadow-red-900/25",
|
|
68
|
-
loading: "ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
defaultVariants: { variant: "default" }
|
|
54
|
+
setup(r) {
|
|
55
|
+
const a = r, { toasts: m, dismiss: C } = O(), x = l(() => m.value.slice(0, a.visibleToasts)), n = (t, f) => ({
|
|
56
|
+
name: `Toast${t}Icon`,
|
|
57
|
+
render() {
|
|
58
|
+
return b("svg", {
|
|
59
|
+
"data-toast-icon": t.toLowerCase(),
|
|
60
|
+
viewBox: "0 0 24 24",
|
|
61
|
+
fill: "none",
|
|
62
|
+
stroke: "currentColor",
|
|
63
|
+
"stroke-width": 1.9,
|
|
64
|
+
"stroke-linecap": "round",
|
|
65
|
+
"stroke-linejoin": "round",
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
}, f.map(([o, y]) => b(o, y)));
|
|
72
68
|
}
|
|
73
|
-
),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
error: "text-white",
|
|
114
|
-
loading: "ui-text"
|
|
115
|
-
}, y = {
|
|
116
|
-
default: "ui-text-muted",
|
|
117
|
-
info: "text-white/90",
|
|
118
|
-
success: "text-white/90",
|
|
119
|
-
warning: "text-white/90",
|
|
120
|
-
error: "text-white/90",
|
|
121
|
-
loading: "ui-text-muted"
|
|
122
|
-
}, k = {
|
|
123
|
-
default: "ui-text-soft hover:bg-black/5 dark:hover:bg-white/10 hover:text-(--ui-text)",
|
|
124
|
-
info: "text-white/80 hover:text-white hover:bg-white/15",
|
|
125
|
-
success: "text-white/80 hover:text-white hover:bg-white/15",
|
|
126
|
-
warning: "text-white/80 hover:text-white hover:bg-white/15",
|
|
127
|
-
error: "text-white/80 hover:text-white hover:bg-white/15",
|
|
128
|
-
loading: "ui-text hover:bg-black/5 dark:hover:bg-white/5 hover:text-(--ui-text)"
|
|
129
|
-
}, I = (t) => t.icon || m[t.variant] || m.default, $ = (t) => {
|
|
130
|
-
const d = p[t.variant] || p.default;
|
|
131
|
-
return t.variant === "loading" ? `${d} animate-spin` : d;
|
|
132
|
-
}, P = (t) => v[t.variant] || v.default, S = (t) => x[t.variant] || x.default, j = (t) => w[t.variant] || w.default, A = (t) => b[t.variant] || b.default, E = (t) => y[t.variant] || y.default, K = (t) => k[t.variant] || k.default, L = (t) => t.icon !== !1, F = (t) => t.dismissible !== !1 && (t.closeButton || u.closeButton || t.dismissible);
|
|
133
|
-
return (t, d) => (r(), C(G, { to: "body" }, [
|
|
134
|
-
h("div", {
|
|
135
|
-
class: i(n(o)(
|
|
136
|
-
V.value,
|
|
137
|
-
"fixed z-[10000] flex max-h-screen w-full p-4 md:max-w-[420px] pointer-events-none"
|
|
138
|
-
))
|
|
69
|
+
}), T = n("default", [
|
|
70
|
+
["path", { d: "M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9" }],
|
|
71
|
+
["path", { d: "M10 21h4" }]
|
|
72
|
+
]), B = n("info", [
|
|
73
|
+
["circle", { cx: "12", cy: "12", r: "9" }],
|
|
74
|
+
["path", { d: "M12 11v5" }],
|
|
75
|
+
["path", { d: "M12 8h.01" }]
|
|
76
|
+
]), w = n("success", [
|
|
77
|
+
["circle", { cx: "12", cy: "12", r: "9" }],
|
|
78
|
+
["path", { d: "m8.5 12 2.3 2.3 4.9-5" }]
|
|
79
|
+
]), M = n("warning", [
|
|
80
|
+
["path", { d: "M10.3 4.1 2.7 17.2A1.8 1.8 0 0 0 4.3 20h15.4a1.8 1.8 0 0 0 1.6-2.8L13.7 4.1a2 2 0 0 0-3.4 0Z" }],
|
|
81
|
+
["path", { d: "M12 9v4" }],
|
|
82
|
+
["path", { d: "M12 16.5h.01" }]
|
|
83
|
+
]), N = n("error", [
|
|
84
|
+
["circle", { cx: "12", cy: "12", r: "9" }],
|
|
85
|
+
["path", { d: "m9 9 6 6" }],
|
|
86
|
+
["path", { d: "m15 9-6 6" }]
|
|
87
|
+
]), D = n("loading", [
|
|
88
|
+
["path", { d: "M21 12a9 9 0 1 1-2.64-6.36" }]
|
|
89
|
+
]), $ = n("close", [
|
|
90
|
+
["path", { d: "m7.5 7.5 9 9" }],
|
|
91
|
+
["path", { d: "m16.5 7.5-9 9" }]
|
|
92
|
+
]), L = n("arrow", [
|
|
93
|
+
["path", { d: "M5 12h14" }],
|
|
94
|
+
["path", { d: "m14 7 5 5-5 5" }]
|
|
95
|
+
]), k = {
|
|
96
|
+
default: T,
|
|
97
|
+
info: B,
|
|
98
|
+
success: w,
|
|
99
|
+
warning: M,
|
|
100
|
+
error: N,
|
|
101
|
+
loading: D
|
|
102
|
+
}, v = (t) => k[t.variant] ? t.variant : "default", S = (t) => k[v(t)], V = (t) => typeof t.icon == "string", A = (t) => t.icon && typeof t.icon != "string" && t.icon !== !0 ? t.icon : S(t), E = (t) => t.icon !== !1, j = (t) => t.dismissible !== !1 && (t.closeButton || a.closeButton || t.dismissible), z = l(() => `kv-toast-region--${a.position}`), K = l(() => a.position.startsWith("bottom-") ? "kv-toast-stack--bottom" : "");
|
|
103
|
+
return (t, f) => (e(), c(P, { to: "body" }, [
|
|
104
|
+
d("section", {
|
|
105
|
+
class: p(["kv-toast-region", z.value]),
|
|
106
|
+
"aria-label": "Notifications",
|
|
107
|
+
"data-expanded": a.expand,
|
|
108
|
+
"data-hotkey": a.hotkey.join("+")
|
|
139
109
|
}, [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"enter-from-class": "transform translate-x-full opacity-0 scale-90",
|
|
143
|
-
"enter-to-class": "transform translate-x-0 opacity-100 scale-100",
|
|
144
|
-
"leave-active-class": "transition-all duration-300 ease-[cubic-bezier(0.4,0,1,1)]",
|
|
145
|
-
"leave-from-class": "transform translate-x-0 opacity-100 scale-100",
|
|
146
|
-
"leave-to-class": "transform translate-x-full opacity-0 scale-90",
|
|
147
|
-
"move-class": "transition-all duration-300 ease-out",
|
|
110
|
+
u(W, {
|
|
111
|
+
name: "kv-toast",
|
|
148
112
|
tag: "div",
|
|
149
|
-
class: "
|
|
113
|
+
class: p(["kv-toast-stack", K.value])
|
|
150
114
|
}, {
|
|
151
|
-
default:
|
|
152
|
-
(
|
|
153
|
-
key:
|
|
154
|
-
class:
|
|
115
|
+
default: F(() => [
|
|
116
|
+
(e(!0), s(G, null, Z(x.value, (o) => (e(), s("article", {
|
|
117
|
+
key: o.id,
|
|
118
|
+
class: p(["kv-toast", [
|
|
119
|
+
`kv-toast--${v(o)}`,
|
|
120
|
+
{ "kv-toast--subtle": !a.richColors }
|
|
121
|
+
]]),
|
|
155
122
|
role: "alert",
|
|
156
|
-
"aria-live":
|
|
123
|
+
"aria-live": o.variant === "error" ? "assertive" : "polite",
|
|
124
|
+
"aria-atomic": "true"
|
|
157
125
|
}, [
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
class: i(n(o)(
|
|
161
|
-
"relative flex h-10 w-10 shrink-0 items-center justify-center rounded-lg transition-all duration-300",
|
|
162
|
-
P(e)
|
|
163
|
-
))
|
|
164
|
-
}, [
|
|
165
|
-
l(g, {
|
|
166
|
-
icon: I(e),
|
|
167
|
-
class: i(n(o)(
|
|
168
|
-
"h-5 w-5 transition-transform duration-300 group-hover:scale-110",
|
|
169
|
-
$(e)
|
|
170
|
-
))
|
|
171
|
-
}, null, 8, ["icon", "class"])
|
|
172
|
-
], 2)) : a("", !0),
|
|
173
|
-
h("div", te, [
|
|
174
|
-
e.title ? (r(), s("div", {
|
|
126
|
+
E(o) ? (e(), s("span", Y, [
|
|
127
|
+
V(o) ? (e(), c(Q, {
|
|
175
128
|
key: 0,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
129
|
+
icon: o.icon,
|
|
130
|
+
"aria-hidden": "true"
|
|
131
|
+
}, null, 8, ["icon"])) : (e(), c(g(A(o)), { key: 1 }))
|
|
132
|
+
])) : i("", !0),
|
|
133
|
+
d("div", I, [
|
|
134
|
+
o.title ? (e(), s("p", oo, _(o.title), 1)) : i("", !0),
|
|
135
|
+
o.message || o.description ? (e(), s("p", to, _(o.message || o.description), 1)) : i("", !0),
|
|
136
|
+
o.component ? (e(), c(g(o.component), q({
|
|
183
137
|
key: 2,
|
|
184
138
|
ref_for: !0
|
|
185
|
-
},
|
|
186
|
-
|
|
139
|
+
}, o.componentProps, { class: "kv-toast__custom-content" }), null, 16)) : i("", !0),
|
|
140
|
+
o.action ? (e(), s("button", {
|
|
187
141
|
key: 3,
|
|
188
|
-
|
|
189
|
-
|
|
142
|
+
type: "button",
|
|
143
|
+
class: "kv-toast__action",
|
|
144
|
+
onClick: o.action.onClick
|
|
190
145
|
}, [
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
class: "h-3 w-3 transition-transform duration-200 group-hover:translate-x-0.5"
|
|
195
|
-
})
|
|
196
|
-
], 10, re)) : a("", !0)
|
|
146
|
+
H(_(o.action.label) + " ", 1),
|
|
147
|
+
u(h(L))
|
|
148
|
+
], 8, eo)) : i("", !0)
|
|
197
149
|
]),
|
|
198
|
-
|
|
150
|
+
j(o) ? (e(), s("button", {
|
|
199
151
|
key: 1,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
))
|
|
204
|
-
"aria-label": "Dismiss",
|
|
205
|
-
onClick: (se) => n(T)(e.id)
|
|
152
|
+
type: "button",
|
|
153
|
+
class: "kv-toast__close",
|
|
154
|
+
"aria-label": "Dismiss notification",
|
|
155
|
+
onClick: (y) => h(C)(o.id)
|
|
206
156
|
}, [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
S(e)
|
|
217
|
-
)),
|
|
218
|
-
style: W({ animationDuration: `${e.duration}ms` })
|
|
219
|
-
}, null, 6)
|
|
220
|
-
])) : a("", !0)
|
|
221
|
-
], 10, ee))), 128))
|
|
157
|
+
u(h($))
|
|
158
|
+
], 8, no)) : i("", !0),
|
|
159
|
+
o.duration && o.duration > 0 ? (e(), s("span", so, [
|
|
160
|
+
d("span", {
|
|
161
|
+
class: "kv-toast__progress",
|
|
162
|
+
style: J({ animationDuration: `${o.duration}ms` })
|
|
163
|
+
}, null, 4)
|
|
164
|
+
])) : i("", !0)
|
|
165
|
+
], 10, X))), 128))
|
|
222
166
|
]),
|
|
223
167
|
_: 1
|
|
224
|
-
})
|
|
225
|
-
],
|
|
168
|
+
}, 8, ["class"])
|
|
169
|
+
], 10, U)
|
|
226
170
|
]));
|
|
227
171
|
}
|
|
228
|
-
},
|
|
172
|
+
}, po = /* @__PURE__ */ R(ao, [["__scopeId", "data-v-3876a110"]]);
|
|
229
173
|
export {
|
|
230
|
-
|
|
174
|
+
po as default
|
|
231
175
|
};
|