@mekari/pixel3-toast 0.0.12 → 0.0.13-dev.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.
- package/dist/{chunk-N2F5444N.mjs → chunk-3ZI7VPMZ.mjs} +0 -6
- package/dist/{chunk-ML5VRDPF.mjs → chunk-LXHEYU5E.mjs} +1 -1
- package/dist/{chunk-R6B3NFF2.mjs → chunk-SVASSMS6.mjs} +20 -4
- package/dist/index.js +17 -18
- package/dist/index.mjs +3 -4
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/modules/toast.connects.js +0 -17
- package/dist/modules/toast.connects.mjs +1 -2
- package/dist/modules/toast.hooks.js +0 -17
- package/dist/modules/toast.hooks.mjs +2 -3
- package/dist/toast.js +17 -18
- package/dist/toast.mjs +3 -4
- package/package.json +4 -4
- package/dist/chunk-OEC2ZSPC.mjs +0 -15
- package/dist/modules/toast.utils.d.mts +0 -9
- package/dist/modules/toast.utils.d.ts +0 -9
- package/dist/modules/toast.utils.js +0 -39
- package/dist/modules/toast.utils.mjs +0 -7
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getIconVariant
|
|
3
|
-
} from "./chunk-OEC2ZSPC.mjs";
|
|
4
1
|
import {
|
|
5
2
|
__name
|
|
6
3
|
} from "./chunk-QZ7VFGWC.mjs";
|
|
@@ -11,7 +8,6 @@ function toastConnect(state, classes) {
|
|
|
11
8
|
const {
|
|
12
9
|
id,
|
|
13
10
|
title,
|
|
14
|
-
variant,
|
|
15
11
|
render
|
|
16
12
|
} = state;
|
|
17
13
|
const idx = id != null ? id : `mp-toast-${useId()}`;
|
|
@@ -25,9 +21,7 @@ function toastConnect(state, classes) {
|
|
|
25
21
|
},
|
|
26
22
|
iconProps: {
|
|
27
23
|
id: `${idx}-icon`,
|
|
28
|
-
variant: "duotone",
|
|
29
24
|
size: "md",
|
|
30
|
-
...getIconVariant[variant || "success"],
|
|
31
25
|
class: classes.icon,
|
|
32
26
|
"data-pixel-component": "MpToastIcon"
|
|
33
27
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useToast
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LXHEYU5E.mjs";
|
|
4
4
|
import {
|
|
5
5
|
toastProps
|
|
6
6
|
} from "./chunk-DUGBXMFI.mjs";
|
|
@@ -9,16 +9,32 @@ import {
|
|
|
9
9
|
} from "./chunk-QZ7VFGWC.mjs";
|
|
10
10
|
|
|
11
11
|
// src/toast.tsx
|
|
12
|
-
import {
|
|
13
|
-
import { defineComponent, ref } from "vue";
|
|
12
|
+
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
13
|
+
import { defineComponent, ref, reactive, computed } from "vue";
|
|
14
14
|
import { toast as toaster, Toaster } from "vue-sonner";
|
|
15
|
+
import { usePixelTheme } from "@mekari/pixel3-utils";
|
|
15
16
|
import { MpIcon } from "@mekari/pixel3-icon";
|
|
16
17
|
var MpToast = defineComponent({
|
|
17
18
|
name: "MpToast",
|
|
18
19
|
props: toastProps,
|
|
19
20
|
setup(props) {
|
|
20
21
|
const api = useToast(props);
|
|
21
|
-
|
|
22
|
+
const {
|
|
23
|
+
isNextTheme
|
|
24
|
+
} = usePixelTheme();
|
|
25
|
+
const getIconVariant = reactive({
|
|
26
|
+
success: computed(() => ({
|
|
27
|
+
name: "done",
|
|
28
|
+
color: isNextTheme.value ? "icon.success" : "green.700"
|
|
29
|
+
})),
|
|
30
|
+
error: computed(() => ({
|
|
31
|
+
name: "error",
|
|
32
|
+
color: isNextTheme.value ? "icon.danger" : "red.700"
|
|
33
|
+
}))
|
|
34
|
+
});
|
|
35
|
+
return () => _createVNode("div", api.value.rootProps, [_createVNode(MpIcon, _mergeProps(api.value.iconProps, getIconVariant[props.variant || "success"], {
|
|
36
|
+
"variant": isNextTheme.value ? "fill" : "duotone"
|
|
37
|
+
}), null), _createVNode("p", api.value.labelProps, [api.value.render ? api.value.render() : api.value.title])]);
|
|
22
38
|
}
|
|
23
39
|
});
|
|
24
40
|
var options = ref({});
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_vue2 = require("vue");
|
|
31
31
|
var import_vue3 = require("vue");
|
|
32
32
|
var import_vue_sonner = require("vue-sonner");
|
|
33
|
+
var import_pixel3_utils2 = require("@mekari/pixel3-utils");
|
|
33
34
|
|
|
34
35
|
// src/modules/toast.props.ts
|
|
35
36
|
var toastProps = {
|
|
@@ -63,25 +64,10 @@ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
|
63
64
|
|
|
64
65
|
// src/modules/toast.connects.ts
|
|
65
66
|
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
66
|
-
|
|
67
|
-
// src/modules/toast.utils.ts
|
|
68
|
-
var getIconVariant = {
|
|
69
|
-
success: {
|
|
70
|
-
name: "done",
|
|
71
|
-
color: "green.700"
|
|
72
|
-
},
|
|
73
|
-
error: {
|
|
74
|
-
name: "error",
|
|
75
|
-
color: "red.700"
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// src/modules/toast.connects.ts
|
|
80
67
|
function toastConnect(state, classes) {
|
|
81
68
|
const {
|
|
82
69
|
id,
|
|
83
70
|
title,
|
|
84
|
-
variant,
|
|
85
71
|
render
|
|
86
72
|
} = state;
|
|
87
73
|
const idx = id != null ? id : `mp-toast-${(0, import_pixel3_utils.useId)()}`;
|
|
@@ -95,9 +81,7 @@ function toastConnect(state, classes) {
|
|
|
95
81
|
},
|
|
96
82
|
iconProps: {
|
|
97
83
|
id: `${idx}-icon`,
|
|
98
|
-
variant: "duotone",
|
|
99
84
|
size: "md",
|
|
100
|
-
...getIconVariant[variant || "success"],
|
|
101
85
|
class: classes.icon,
|
|
102
86
|
"data-pixel-component": "MpToastIcon"
|
|
103
87
|
},
|
|
@@ -125,7 +109,22 @@ var MpToast = (0, import_vue3.defineComponent)({
|
|
|
125
109
|
props: toastProps,
|
|
126
110
|
setup(props) {
|
|
127
111
|
const api = useToast(props);
|
|
128
|
-
|
|
112
|
+
const {
|
|
113
|
+
isNextTheme
|
|
114
|
+
} = (0, import_pixel3_utils2.usePixelTheme)();
|
|
115
|
+
const getIconVariant = (0, import_vue3.reactive)({
|
|
116
|
+
success: (0, import_vue3.computed)(() => ({
|
|
117
|
+
name: "done",
|
|
118
|
+
color: isNextTheme.value ? "icon.success" : "green.700"
|
|
119
|
+
})),
|
|
120
|
+
error: (0, import_vue3.computed)(() => ({
|
|
121
|
+
name: "error",
|
|
122
|
+
color: isNextTheme.value ? "icon.danger" : "red.700"
|
|
123
|
+
}))
|
|
124
|
+
});
|
|
125
|
+
return () => (0, import_vue2.createVNode)("div", api.value.rootProps, [(0, import_vue2.createVNode)(import_pixel3_icon.MpIcon, (0, import_vue2.mergeProps)(api.value.iconProps, getIconVariant[props.variant || "success"], {
|
|
126
|
+
"variant": isNextTheme.value ? "fill" : "duotone"
|
|
127
|
+
}), null), (0, import_vue2.createVNode)("p", api.value.labelProps, [api.value.render ? api.value.render() : api.value.title])]);
|
|
129
128
|
}
|
|
130
129
|
});
|
|
131
130
|
var options = (0, import_vue3.ref)({});
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MpToastManager,
|
|
3
3
|
toast
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-SVASSMS6.mjs";
|
|
5
|
+
import "./chunk-LXHEYU5E.mjs";
|
|
6
|
+
import "./chunk-3ZI7VPMZ.mjs";
|
|
7
7
|
import "./chunk-DUGBXMFI.mjs";
|
|
8
|
-
import "./chunk-OEC2ZSPC.mjs";
|
|
9
8
|
import "./chunk-QZ7VFGWC.mjs";
|
|
10
9
|
export {
|
|
11
10
|
MpToastManager,
|
package/dist/metafile-cjs.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/modules/toast.props.ts":{"bytes":755,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"./toast.types","kind":"import-statement","external":true}],"format":"esm"},"src/modules/toast.
|
|
1
|
+
{"inputs":{"src/modules/toast.props.ts":{"bytes":755,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"./toast.types","kind":"import-statement","external":true}],"format":"esm"},"src/modules/toast.connects.ts":{"bytes":841,"imports":[{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"./toast.types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/toast.hooks.ts":{"bytes":598,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"src/modules/toast.connects.ts","kind":"import-statement","original":"./toast.connects"},{"path":"./toast.types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/toast.tsx":{"bytes":3194,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"vue-sonner","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"src/modules/toast.props.ts","kind":"import-statement","original":"./modules/toast.props"},{"path":"src/modules/toast.hooks.ts","kind":"import-statement","original":"./modules/toast.hooks"},{"path":"./modules/toast.types","kind":"import-statement","external":true},{"path":"@mekari/pixel3-icon","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":240,"imports":[{"path":"src/toast.tsx","kind":"import-statement","original":"./toast"}],"format":"esm"},"src/modules/toast.types.ts":{"bytes":908,"imports":[{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"vue-sonner","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"@mekari/pixel3-icon","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":155},"src/toast.tsx":{"bytesInOutput":2888},"src/modules/toast.props.ts":{"bytesInOutput":310},"src/modules/toast.hooks.ts":{"bytesInOutput":440},"src/modules/toast.connects.ts":{"bytesInOutput":678}},"bytes":5657},"dist/toast.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"vue-sonner","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true},{"path":"@mekari/pixel3-icon","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/toast.tsx","inputs":{"src/toast.tsx":{"bytesInOutput":3049},"src/modules/toast.props.ts":{"bytesInOutput":310},"src/modules/toast.hooks.ts":{"bytesInOutput":440},"src/modules/toast.connects.ts":{"bytesInOutput":678}},"bytes":5646},"dist/modules/toast.connects.js":{"imports":[{"path":"@mekari/pixel3-utils","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/modules/toast.connects.ts","inputs":{"src/modules/toast.connects.ts":{"bytesInOutput":840}},"bytes":1869},"dist/modules/toast.hooks.js":{"imports":[{"path":"vue","kind":"require-call","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"require-call","external":true},{"path":"@mekari/pixel3-utils","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/modules/toast.hooks.ts","inputs":{"src/modules/toast.hooks.ts":{"bytesInOutput":585},"src/modules/toast.connects.ts":{"bytesInOutput":678}},"bytes":2350},"dist/modules/toast.props.js":{"imports":[],"exports":[],"entryPoint":"src/modules/toast.props.ts","inputs":{"src/modules/toast.props.ts":{"bytesInOutput":459}},"bytes":1393},"dist/modules/toast.types.js":{"imports":[],"exports":[],"entryPoint":"src/modules/toast.types.ts","inputs":{"src/modules/toast.types.ts":{"bytesInOutput":82}},"bytes":784}}}
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/modules/toast.props.ts":{"bytes":755,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"./toast.types","kind":"import-statement","external":true}],"format":"esm"},"src/modules/toast.
|
|
1
|
+
{"inputs":{"src/modules/toast.props.ts":{"bytes":755,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"./toast.types","kind":"import-statement","external":true}],"format":"esm"},"src/modules/toast.connects.ts":{"bytes":841,"imports":[{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"./toast.types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/toast.hooks.ts":{"bytes":598,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"src/modules/toast.connects.ts","kind":"import-statement","original":"./toast.connects"},{"path":"./toast.types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/toast.tsx":{"bytes":3194,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"vue-sonner","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"src/modules/toast.props.ts","kind":"import-statement","original":"./modules/toast.props"},{"path":"src/modules/toast.hooks.ts","kind":"import-statement","original":"./modules/toast.hooks"},{"path":"./modules/toast.types","kind":"import-statement","external":true},{"path":"@mekari/pixel3-icon","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":240,"imports":[{"path":"src/toast.tsx","kind":"import-statement","original":"./toast"}],"format":"esm"},"src/modules/toast.types.ts":{"bytes":908,"imports":[{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.mjs":{"imports":[{"path":"dist/chunk-SVASSMS6.mjs","kind":"import-statement"},{"path":"dist/chunk-LXHEYU5E.mjs","kind":"import-statement"},{"path":"dist/chunk-3ZI7VPMZ.mjs","kind":"import-statement"},{"path":"dist/chunk-DUGBXMFI.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpToastManager","toast"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":228},"dist/toast.mjs":{"imports":[{"path":"dist/chunk-SVASSMS6.mjs","kind":"import-statement"},{"path":"dist/chunk-LXHEYU5E.mjs","kind":"import-statement"},{"path":"dist/chunk-3ZI7VPMZ.mjs","kind":"import-statement"},{"path":"dist/chunk-DUGBXMFI.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpToastManager","toast"],"entryPoint":"src/toast.tsx","inputs":{},"bytes":228},"dist/chunk-SVASSMS6.mjs":{"imports":[{"path":"dist/chunk-LXHEYU5E.mjs","kind":"import-statement"},{"path":"dist/chunk-DUGBXMFI.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"vue-sonner","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-icon","kind":"import-statement","external":true}],"exports":["MpToastManager","toast"],"inputs":{"src/toast.tsx":{"bytesInOutput":2661}},"bytes":2871},"dist/modules/toast.connects.mjs":{"imports":[{"path":"dist/chunk-3ZI7VPMZ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["toastConnect"],"entryPoint":"src/modules/toast.connects.ts","inputs":{},"bytes":115},"dist/modules/toast.hooks.mjs":{"imports":[{"path":"dist/chunk-LXHEYU5E.mjs","kind":"import-statement"},{"path":"dist/chunk-3ZI7VPMZ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["useToast"],"entryPoint":"src/modules/toast.hooks.ts","inputs":{},"bytes":139},"dist/chunk-LXHEYU5E.mjs":{"imports":[{"path":"dist/chunk-3ZI7VPMZ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true}],"exports":["useToast"],"inputs":{"src/modules/toast.hooks.ts":{"bytesInOutput":379}},"bytes":538},"dist/chunk-3ZI7VPMZ.mjs":{"imports":[{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true}],"exports":["toastConnect"],"inputs":{"src/modules/toast.connects.ts":{"bytesInOutput":640}},"bytes":751},"dist/modules/toast.props.mjs":{"imports":[{"path":"dist/chunk-DUGBXMFI.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["toastProps"],"entryPoint":"src/modules/toast.props.ts","inputs":{},"bytes":111},"dist/chunk-DUGBXMFI.mjs":{"imports":[],"exports":["toastProps"],"inputs":{"src/modules/toast.props.ts":{"bytesInOutput":310}},"bytes":366},"dist/chunk-QZ7VFGWC.mjs":{"imports":[],"exports":["__name"],"inputs":{},"bytes":151},"dist/modules/toast.types.mjs":{"imports":[],"exports":[],"entryPoint":"src/modules/toast.types.ts","inputs":{"src/modules/toast.types.ts":{"bytesInOutput":0}},"bytes":0}}}
|
|
@@ -25,25 +25,10 @@ __export(toast_connects_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(toast_connects_exports);
|
|
27
27
|
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
28
|
-
|
|
29
|
-
// src/modules/toast.utils.ts
|
|
30
|
-
var getIconVariant = {
|
|
31
|
-
success: {
|
|
32
|
-
name: "done",
|
|
33
|
-
color: "green.700"
|
|
34
|
-
},
|
|
35
|
-
error: {
|
|
36
|
-
name: "error",
|
|
37
|
-
color: "red.700"
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// src/modules/toast.connects.ts
|
|
42
28
|
function toastConnect(state, classes) {
|
|
43
29
|
const {
|
|
44
30
|
id,
|
|
45
31
|
title,
|
|
46
|
-
variant,
|
|
47
32
|
render
|
|
48
33
|
} = state;
|
|
49
34
|
const idx = id != null ? id : `mp-toast-${(0, import_pixel3_utils.useId)()}`;
|
|
@@ -57,9 +42,7 @@ function toastConnect(state, classes) {
|
|
|
57
42
|
},
|
|
58
43
|
iconProps: {
|
|
59
44
|
id: `${idx}-icon`,
|
|
60
|
-
variant: "duotone",
|
|
61
45
|
size: "md",
|
|
62
|
-
...getIconVariant[variant || "success"],
|
|
63
46
|
class: classes.icon,
|
|
64
47
|
"data-pixel-component": "MpToastIcon"
|
|
65
48
|
},
|
|
@@ -29,25 +29,10 @@ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
|
29
29
|
|
|
30
30
|
// src/modules/toast.connects.ts
|
|
31
31
|
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
32
|
-
|
|
33
|
-
// src/modules/toast.utils.ts
|
|
34
|
-
var getIconVariant = {
|
|
35
|
-
success: {
|
|
36
|
-
name: "done",
|
|
37
|
-
color: "green.700"
|
|
38
|
-
},
|
|
39
|
-
error: {
|
|
40
|
-
name: "error",
|
|
41
|
-
color: "red.700"
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// src/modules/toast.connects.ts
|
|
46
32
|
function toastConnect(state, classes) {
|
|
47
33
|
const {
|
|
48
34
|
id,
|
|
49
35
|
title,
|
|
50
|
-
variant,
|
|
51
36
|
render
|
|
52
37
|
} = state;
|
|
53
38
|
const idx = id != null ? id : `mp-toast-${(0, import_pixel3_utils.useId)()}`;
|
|
@@ -61,9 +46,7 @@ function toastConnect(state, classes) {
|
|
|
61
46
|
},
|
|
62
47
|
iconProps: {
|
|
63
48
|
id: `${idx}-icon`,
|
|
64
|
-
variant: "duotone",
|
|
65
49
|
size: "md",
|
|
66
|
-
...getIconVariant[variant || "success"],
|
|
67
50
|
class: classes.icon,
|
|
68
51
|
"data-pixel-component": "MpToastIcon"
|
|
69
52
|
},
|
package/dist/toast.js
CHANGED
|
@@ -28,6 +28,7 @@ module.exports = __toCommonJS(toast_exports);
|
|
|
28
28
|
var import_vue2 = require("vue");
|
|
29
29
|
var import_vue3 = require("vue");
|
|
30
30
|
var import_vue_sonner = require("vue-sonner");
|
|
31
|
+
var import_pixel3_utils2 = require("@mekari/pixel3-utils");
|
|
31
32
|
|
|
32
33
|
// src/modules/toast.props.ts
|
|
33
34
|
var toastProps = {
|
|
@@ -61,25 +62,10 @@ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
|
61
62
|
|
|
62
63
|
// src/modules/toast.connects.ts
|
|
63
64
|
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
64
|
-
|
|
65
|
-
// src/modules/toast.utils.ts
|
|
66
|
-
var getIconVariant = {
|
|
67
|
-
success: {
|
|
68
|
-
name: "done",
|
|
69
|
-
color: "green.700"
|
|
70
|
-
},
|
|
71
|
-
error: {
|
|
72
|
-
name: "error",
|
|
73
|
-
color: "red.700"
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// src/modules/toast.connects.ts
|
|
78
65
|
function toastConnect(state, classes) {
|
|
79
66
|
const {
|
|
80
67
|
id,
|
|
81
68
|
title,
|
|
82
|
-
variant,
|
|
83
69
|
render
|
|
84
70
|
} = state;
|
|
85
71
|
const idx = id != null ? id : `mp-toast-${(0, import_pixel3_utils.useId)()}`;
|
|
@@ -93,9 +79,7 @@ function toastConnect(state, classes) {
|
|
|
93
79
|
},
|
|
94
80
|
iconProps: {
|
|
95
81
|
id: `${idx}-icon`,
|
|
96
|
-
variant: "duotone",
|
|
97
82
|
size: "md",
|
|
98
|
-
...getIconVariant[variant || "success"],
|
|
99
83
|
class: classes.icon,
|
|
100
84
|
"data-pixel-component": "MpToastIcon"
|
|
101
85
|
},
|
|
@@ -123,7 +107,22 @@ var MpToast = (0, import_vue3.defineComponent)({
|
|
|
123
107
|
props: toastProps,
|
|
124
108
|
setup(props) {
|
|
125
109
|
const api = useToast(props);
|
|
126
|
-
|
|
110
|
+
const {
|
|
111
|
+
isNextTheme
|
|
112
|
+
} = (0, import_pixel3_utils2.usePixelTheme)();
|
|
113
|
+
const getIconVariant = (0, import_vue3.reactive)({
|
|
114
|
+
success: (0, import_vue3.computed)(() => ({
|
|
115
|
+
name: "done",
|
|
116
|
+
color: isNextTheme.value ? "icon.success" : "green.700"
|
|
117
|
+
})),
|
|
118
|
+
error: (0, import_vue3.computed)(() => ({
|
|
119
|
+
name: "error",
|
|
120
|
+
color: isNextTheme.value ? "icon.danger" : "red.700"
|
|
121
|
+
}))
|
|
122
|
+
});
|
|
123
|
+
return () => (0, import_vue2.createVNode)("div", api.value.rootProps, [(0, import_vue2.createVNode)(import_pixel3_icon.MpIcon, (0, import_vue2.mergeProps)(api.value.iconProps, getIconVariant[props.variant || "success"], {
|
|
124
|
+
"variant": isNextTheme.value ? "fill" : "duotone"
|
|
125
|
+
}), null), (0, import_vue2.createVNode)("p", api.value.labelProps, [api.value.render ? api.value.render() : api.value.title])]);
|
|
127
126
|
}
|
|
128
127
|
});
|
|
129
128
|
var options = (0, import_vue3.ref)({});
|
package/dist/toast.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MpToastManager,
|
|
3
3
|
toast
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-SVASSMS6.mjs";
|
|
5
|
+
import "./chunk-LXHEYU5E.mjs";
|
|
6
|
+
import "./chunk-3ZI7VPMZ.mjs";
|
|
7
7
|
import "./chunk-DUGBXMFI.mjs";
|
|
8
|
-
import "./chunk-OEC2ZSPC.mjs";
|
|
9
8
|
import "./chunk-QZ7VFGWC.mjs";
|
|
10
9
|
export {
|
|
11
10
|
MpToastManager,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mekari/pixel3-toast",
|
|
3
3
|
"description": "Mekari Pixel 3 | Toast component is used to show dynamic notifications and alerts to user",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13-dev.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"vue-sonner": "^1.0.2",
|
|
12
|
-
"@mekari/pixel3-icon": "0.0.
|
|
13
|
-
"@mekari/pixel3-styled-system": "0.1.
|
|
14
|
-
"@mekari/pixel3-utils": "0.0.
|
|
12
|
+
"@mekari/pixel3-icon": "0.0.17-dev.0",
|
|
13
|
+
"@mekari/pixel3-styled-system": "0.1.2-dev.0",
|
|
14
|
+
"@mekari/pixel3-utils": "0.0.7-dev.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"vue": "^3.4.9"
|
package/dist/chunk-OEC2ZSPC.mjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/modules/toast.utils.ts
|
|
21
|
-
var toast_utils_exports = {};
|
|
22
|
-
__export(toast_utils_exports, {
|
|
23
|
-
getIconVariant: () => getIconVariant
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(toast_utils_exports);
|
|
26
|
-
var getIconVariant = {
|
|
27
|
-
success: {
|
|
28
|
-
name: "done",
|
|
29
|
-
color: "green.700"
|
|
30
|
-
},
|
|
31
|
-
error: {
|
|
32
|
-
name: "error",
|
|
33
|
-
color: "red.700"
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
getIconVariant
|
|
39
|
-
});
|