@equal-experts/kuat-vue 0.5.0 → 0.6.0

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.
@@ -0,0 +1,113 @@
1
+ import { defineComponent as f, useAttrs as b, computed as m, createBlock as p, openBlock as s, unref as r, mergeProps as v, createElementBlock as l, createCommentVNode as u, createElementVNode as _, resolveDynamicComponent as g, toDisplayString as d, h } from "vue";
2
+ import { Toaster as I, toast as e } from "vue-sonner";
3
+ import { c as N } from "./utils-DLUjLwnh.js";
4
+ const E = /* @__PURE__ */ f({
5
+ inheritAttrs: !1,
6
+ __name: "KuatSonner",
7
+ props: {
8
+ class: {},
9
+ containerAriaLabel: { default: "Notifications" },
10
+ expand: { type: Boolean, default: !1 },
11
+ position: { default: "top-right" },
12
+ toastOptions: {},
13
+ visibleToasts: { default: 3 }
14
+ },
15
+ setup(t) {
16
+ const n = t, o = b(), i = m(() => {
17
+ const c = n.toastOptions ?? {};
18
+ return {
19
+ ...c,
20
+ classNames: {
21
+ toast: "kuat-sonner__toast",
22
+ title: "kuat-sonner__title",
23
+ description: "kuat-sonner__description",
24
+ content: "kuat-sonner__content",
25
+ icon: "kuat-sonner__icon",
26
+ actionButton: "kuat-sonner__action",
27
+ cancelButton: "kuat-sonner__cancel",
28
+ loader: "kuat-sonner__loader",
29
+ ...c.classNames
30
+ }
31
+ };
32
+ }), k = m(() => i.value);
33
+ return (c, C) => (s(), p(r(I), v({
34
+ class: r(N)("kuat-sonner__toaster", n.class),
35
+ "container-aria-label": n.containerAriaLabel,
36
+ expand: n.expand,
37
+ position: n.position,
38
+ "visible-toasts": n.visibleToasts,
39
+ "toast-options": k.value
40
+ }, r(o)), null, 16, ["class", "container-aria-label", "expand", "position", "visible-toasts", "toast-options"]));
41
+ }
42
+ }), O = { class: "kuat-sonner__content" }, x = { class: "kuat-sonner__text" }, y = { class: "kuat-sonner__title" }, S = {
43
+ key: 0,
44
+ class: "kuat-sonner__description"
45
+ }, T = ["aria-label"], P = /* @__PURE__ */ f({
46
+ __name: "KuatSonnerContent",
47
+ props: {
48
+ action: { default: void 0 },
49
+ description: { default: void 0 },
50
+ leftIcon: { default: null },
51
+ showLeftIcon: { type: Boolean, default: !0 },
52
+ title: {}
53
+ },
54
+ setup(t) {
55
+ return (n, o) => (s(), l("div", O, [
56
+ t.showLeftIcon && t.leftIcon ? (s(), p(g(t.leftIcon), {
57
+ key: 0,
58
+ class: "kuat-sonner__icon"
59
+ })) : u("", !0),
60
+ _("div", x, [
61
+ _("div", y, d(t.title), 1),
62
+ t.description ? (s(), l("div", S, d(t.description), 1)) : u("", !0)
63
+ ]),
64
+ t.action ? (s(), l("button", {
65
+ key: 1,
66
+ type: "button",
67
+ class: "kuat-sonner__action",
68
+ "aria-label": t.action.ariaLabel ?? t.action.label,
69
+ onClick: o[0] || (o[0] = //@ts-ignore
70
+ (...i) => t.action.onClick && t.action.onClick(...i))
71
+ }, d(t.action.label), 9, T)) : u("", !0)
72
+ ]));
73
+ }
74
+ }), V = [
75
+ "top-left",
76
+ "top-center",
77
+ "top-right",
78
+ "bottom-left",
79
+ "bottom-center",
80
+ "bottom-right"
81
+ ], B = h("span", {
82
+ "aria-hidden": "true",
83
+ class: "kuat-sonner__loading-spinner"
84
+ });
85
+ function a(t) {
86
+ if (!t) return { important: !1 };
87
+ const { announcement: n = "polite", ...o } = t;
88
+ return {
89
+ ...o,
90
+ important: n === "assertive"
91
+ };
92
+ }
93
+ const D = Object.assign(
94
+ (t, n) => e(t, a(n)),
95
+ {
96
+ success: (t, n) => e.success(t, a(n)),
97
+ info: (t, n) => e.info(t, a(n)),
98
+ warning: (t, n) => e.warning(t, a(n)),
99
+ error: (t, n) => e.error(t, a(n)),
100
+ loading: (t, n) => e(t, {
101
+ duration: Number.POSITIVE_INFINITY,
102
+ icon: B,
103
+ ...a(n)
104
+ }),
105
+ dismiss: e.dismiss
106
+ }
107
+ );
108
+ export {
109
+ V as S,
110
+ E as _,
111
+ P as a,
112
+ D as t
113
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equal-experts/kuat-vue",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -58,6 +58,10 @@
58
58
  "import": "./dist/switch.js",
59
59
  "types": "./dist/switch.d.ts"
60
60
  },
61
+ "./sonner": {
62
+ "import": "./dist/sonner.js",
63
+ "types": "./dist/sonner.d.ts"
64
+ },
61
65
  "./toggle": {
62
66
  "import": "./dist/toggle.js",
63
67
  "types": "./dist/toggle.d.ts"
@@ -99,7 +103,8 @@
99
103
  "class-variance-authority": "^0.7.0",
100
104
  "clsx": "^2.1.0",
101
105
  "embla-carousel-vue": "^8.0.0",
102
- "tailwind-merge": "^2.2.1"
106
+ "tailwind-merge": "^2.2.1",
107
+ "vue-sonner": "^2.0.9"
103
108
  },
104
109
  "devDependencies": {
105
110
  "@equal-experts/kuat-core": "workspace:*",