@ulu/frontend-vue 0.6.13 → 0.6.15

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.
@@ -1,6 +1,6 @@
1
1
  export { default as corePlugin } from './core/index.js';
2
- export { default as toastPlugin } from './toast/index.js';
3
2
  export { default as breakpointsPlugin } from './breakpoints/index.js';
4
3
  export { default as popoversPlugin, useTooltip, useTooltipFollow } from './popovers/index.js';
5
4
  export { default as modalsPlugin, useModals } from './modals/index.js';
5
+ export { default as toastPlugin, useToast } from './toast/index.js';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1,23 +1,22 @@
1
- import { computed as i, createBlock as a, openBlock as e, Teleport as p, unref as s, createVNode as m, TransitionGroup as u, normalizeClass as _, withCtx as d, createElementBlock as f, Fragment as k, renderList as T, resolveDynamicComponent as g } from "vue";
1
+ import { computed as i, createBlock as r, openBlock as e, Teleport as p, unref as s, createVNode as u, TransitionGroup as m, normalizeClass as _, withCtx as d, createElementBlock as f, Fragment as k, renderList as T, resolveDynamicComponent as g } from "vue";
2
2
  import { store as v } from "./store.js";
3
- /* empty css */
4
- const h = {
3
+ const C = {
5
4
  __name: "UluToastDisplay",
6
5
  setup(x) {
7
6
  const { toasts: c, pluginOptions: o } = v, l = i(() => {
8
7
  const { position: n } = o;
9
- return n.map((r) => `toast-container--${r}`);
8
+ return n.map((a) => `toast-container--${a}`);
10
9
  });
11
- return (n, r) => (e(), a(p, {
10
+ return (n, a) => (e(), r(p, {
12
11
  to: s(o).teleportTo
13
12
  }, [
14
- m(u, {
13
+ u(m, {
15
14
  class: _(["toast-container", l.value]),
16
15
  name: "toast-animation",
17
16
  tag: "div"
18
17
  }, {
19
18
  default: d(() => [
20
- (e(!0), f(k, null, T(s(c), (t) => (e(), a(g(t.component), {
19
+ (e(!0), f(k, null, T(s(c), (t) => (e(), r(g(t.component), {
21
20
  key: t.uid,
22
21
  toast: t
23
22
  }, null, 8, ["toast"]))), 128))
@@ -28,5 +27,5 @@ const h = {
28
27
  }
29
28
  };
30
29
  export {
31
- h as default
30
+ C as default
32
31
  };
@@ -1,5 +1,7 @@
1
+ import { useToast } from './useToast.js';
1
2
  /**
2
3
  * Install plugin
3
4
  */
4
5
  export default function install(app: any, userOptions?: {}): void;
6
+ export { useToast };
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/toast/index.js"],"names":[],"mappings":"AAOA;;GAEG;AACH,kEASC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/plugins/toast/index.js"],"names":[],"mappings":"AAQA;;GAEG;AACH,kEASC;;yBAdwB,eAAe"}
@@ -0,0 +1,10 @@
1
+ import { inject as o } from "vue";
2
+ const n = () => {
3
+ const t = o("uluToast");
4
+ if (!t)
5
+ throw new Error("Toast plugin not installed");
6
+ return t;
7
+ };
8
+ export {
9
+ n as useToast
10
+ };
@@ -8,5 +8,5 @@
8
8
  export { default as corePlugin } from './core/index.js';
9
9
  export { default as popoversPlugin, useTooltip, useTooltipFollow } from './popovers/index.js';
10
10
  export { default as modalsPlugin, useModals } from './modals/index.js';
11
- export { default as toastPlugin } from './toast/index.js';
11
+ export { default as toastPlugin, useToast } from "./toast/index.js";
12
12
  export { default as breakpointsPlugin } from './breakpoints/index.js';
@@ -26,21 +26,4 @@
26
26
  const { position } = pluginOptions;
27
27
  return position.map(p => `toast-container--${ p }`);
28
28
  });
29
- </script>
30
-
31
- <style lang="css">
32
- .toast-animation-move,
33
- .toast-animation-enter-active,
34
- .toast-animation-leave-active {
35
- transition: all 0.3s ease;
36
- }
37
- .toast-animation-enter-from,
38
- .toast-animation-leave-to {
39
- opacity: 0;
40
- transform: translateX(30px);
41
- }
42
- .toast-animation-leave-active {
43
- position: absolute;
44
- width: 100%;
45
- }
46
- </style>
29
+ </script>
@@ -180,18 +180,18 @@ $config: (
180
180
  }
181
181
  }
182
182
 
183
- // Vue animation
184
- #{ $prefix }--animation-move,
185
- #{ $prefix }--animation-enter-active,
186
- #{ $prefix }--animation-leave-active {
183
+ // Vue transition group animation on container
184
+ .toast-animation-move,
185
+ .toast-animation-enter-active,
186
+ .toast-animation-leave-active {
187
187
  transition: all 0.3s ease;
188
188
  }
189
- #{ $prefix }--animation-enter-from,
190
- #{ $prefix }--animation-leave-to {
189
+ .toast-animation-enter-from,
190
+ .toast-animation-leave-to {
191
191
  opacity: 0;
192
192
  transform: translateX(30px);
193
193
  }
194
- #{ $prefix }--animation-leave-active {
194
+ .toast-animation-leave-active {
195
195
  position: absolute;
196
196
  width: 100%;
197
197
  }
@@ -4,6 +4,7 @@
4
4
  import { store, api } from "./store.js";
5
5
  import UluToast from "./UluToast.vue";
6
6
  import UluToastDisplay from "./UluToastDisplay.vue";
7
+ import { useToast } from "./useToast.js";
7
8
 
8
9
  /**
9
10
  * Install plugin
@@ -16,5 +17,7 @@ export default function install(app, userOptions = {}) {
16
17
  app.component("UluToastDisplay", UluToastDisplay);
17
18
 
18
19
  app.config.globalProperties.$uluToast = api;
19
- app.provide('uluToast', api);
20
- }
20
+ app.provide("uluToast", api);
21
+ }
22
+
23
+ export { useToast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend-vue",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "description": "A modular, tree-shakeable Vue 3 component library for the Ulu Frontend theming system, plus general utilities for Vue development",
5
5
  "type": "module",
6
6
  "files": [