@kiva/kv-components 6.0.0 → 6.2.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.
@@ -1 +1 @@
1
- .screen[data-v-faf9d7e4]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1400;background-color:#0003}.modal[data-v-faf9d7e4]{width:100%;border-bottom-right-radius:.875rem;border-bottom-left-radius:.875rem;--tw-bg-opacity: 1;background-color:rgba(var(--bg-primary),var(--tw-bg-opacity, 1))}@media (min-width: 45.875rem){.modal[data-v-faf9d7e4]{position:absolute;right:0}}.modal[data-v-faf9d7e4]{max-height:90%}.modal__body[data-v-faf9d7e4]{display:flex;gap:1rem;padding-left:1.25rem;padding-right:1.25rem}@media (min-width: 45.875rem){.modal__body[data-v-faf9d7e4]{padding-left:2rem;padding-right:2rem}}.container[data-v-faf9d7e4]{position:absolute;top:0;right:0;bottom:0;left:0}@media (min-width: 45.875rem){.modal[data-v-faf9d7e4]{max-width:24.5rem}}
1
+ .screen[data-v-e2f3420c]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1400;background-color:#0003}.modal[data-v-e2f3420c]{width:100%;border-bottom-right-radius:.875rem;border-bottom-left-radius:.875rem;--tw-bg-opacity: 1;background-color:rgba(var(--bg-primary),var(--tw-bg-opacity, 1))}@media (min-width: 45.875rem){.modal[data-v-e2f3420c]{position:absolute;right:0}}.modal[data-v-e2f3420c]{max-height:90%}.modal__body[data-v-e2f3420c]{display:flex;gap:1rem;padding-left:1.25rem;padding-right:1.25rem}@media (min-width: 45.875rem){.modal__body[data-v-e2f3420c]{padding-left:2rem;padding-right:2rem}}.container[data-v-e2f3420c]{position:absolute;top:0;right:0;bottom:0;left:0}@media (min-width: 45.875rem){.modal[data-v-e2f3420c]{max-width:24.5rem}}
@@ -1,17 +1,17 @@
1
- import { toRefs as B, ref as f, computed as S, watch as M, onMounted as E, onBeforeUnmount as T, resolveComponent as C, openBlock as y, createBlock as N, Transition as V, withCtx as b, withDirectives as K, createElementVNode as e, withModifiers as p, renderSlot as x, createVNode as k, createElementBlock as F, createCommentVNode as I, createTextVNode as P, toDisplayString as R, vShow as j, nextTick as A } from "vue";
2
- import { mdiClose as D, mdiCheckCircle as L } from "@mdi/js";
3
- import { useFocusTrap as O } from "@vueuse/integrations/useFocusTrap";
4
- import { hideOthers as U } from "../vendor/aria-hidden/dist/es2015/index.js";
5
- import { unlockScroll as q, lockScroll as z } from "../utils/scrollLock.js";
6
- import { unlockPrintSingleEl as G, lockPrintSingleEl as H } from "../utils/printing.js";
7
- import J from "./KvButton.js";
8
- import Q from "./KvMaterialIcon.js";
1
+ import { toRefs as T, ref as w, computed as E, watch as A, onMounted as N, onBeforeUnmount as V, resolveComponent as y, openBlock as b, createBlock as I, Transition as K, withCtx as x, withDirectives as F, createElementVNode as o, withModifiers as k, renderSlot as h, createVNode as C, createElementBlock as P, createCommentVNode as R, createTextVNode as j, toDisplayString as D, vShow as L, nextTick as O } from "vue";
2
+ import { mdiClose as U, mdiCheckCircle as q } from "@mdi/js";
3
+ import { useFocusTrap as z } from "@vueuse/integrations/useFocusTrap";
4
+ import { hideOthers as G } from "../vendor/aria-hidden/dist/es2015/index.js";
5
+ import { unlockScroll as H, lockScroll as J } from "../utils/scrollLock.js";
6
+ import { unlockPrintSingleEl as Q, lockPrintSingleEl as W } from "../utils/printing.js";
7
+ import X from "./KvButton.js";
8
+ import Y from "./KvMaterialIcon.js";
9
9
  import "./KvCartModal.css";
10
- import W from "../_virtual/_plugin-vue_export-helper.js";
11
- const X = {
10
+ import Z from "../_virtual/_plugin-vue_export-helper.js";
11
+ const $ = {
12
12
  components: {
13
- KvMaterialIcon: Q,
14
- KvButton: J
13
+ KvMaterialIcon: Y,
14
+ KvButton: X
15
15
  },
16
16
  props: {
17
17
  /**
@@ -43,61 +43,67 @@ const X = {
43
43
  setup(c, { emit: t }) {
44
44
  const {
45
45
  visible: l,
46
- preventClose: o
47
- } = B(c), s = f(null), n = f(null), d = f(null), m = S(() => [
48
- s.value
46
+ preventClose: e
47
+ } = T(c), r = w(null), a = w(null), d = w(null), u = w(), n = E(() => [
48
+ r.value
49
49
  // This cart modal
50
50
  ]), {
51
- activate: r,
52
- deactivate: h
53
- } = O(m, {
51
+ activate: _,
52
+ deactivate: g
53
+ } = z(n, {
54
54
  allowOutsideClick: !0
55
55
  // allow clicking outside the cart modal to close it
56
56
  });
57
- let u = null, v = null;
58
- const a = (i = "") => {
59
- s.value && n.value && (h(), n.value.scrollTop = 0, G(n.value)), q(), u && (u(), u = null), document.removeEventListener("keyup", v), t("cart-modal-closed", { type: i });
57
+ let v = null, m = null;
58
+ const s = (i = "") => {
59
+ r.value && a.value && (g(), a.value.scrollTop = 0, Q(a.value)), H(), v && (v(), v = null), document.removeEventListener("keyup", m), t("cart-modal-closed", { type: i });
60
60
  };
61
- v = (i) => {
62
- i && i.key === "Escape" && !o.value && a();
61
+ m = (i) => {
62
+ i && i.key === "Escape" && !e.value && s();
63
63
  };
64
- const _ = () => {
65
- o.value || a("background");
66
- }, w = () => {
67
- l.value && (document.addEventListener("keyup", v), A(() => {
68
- s.value && n.value && (r(), u = U(s.value), H(n.value)), z();
64
+ const M = () => {
65
+ e.value || s("background");
66
+ }, f = () => {
67
+ l.value && (document.addEventListener("keyup", m), O(() => {
68
+ r.value && a.value && (_(), v = G(r.value), W(a.value)), J();
69
69
  }));
70
- }, g = (i) => {
71
- a(i);
72
- };
73
- return M(l, () => {
74
- l.value ? w() : a();
75
- }), E(() => {
76
- l.value && (w(), setTimeout(() => {
70
+ }, B = (i) => {
71
+ s(i);
72
+ }, p = () => {
73
+ e.value || (u.value = setTimeout(() => {
77
74
  t("cart-modal-closed", { type: "time" });
78
75
  }, 1e4));
79
- }), T(() => a()), {
80
- mdiClose: D,
81
- mdiCheckCircle: L,
82
- onKeyUp: v,
83
- onScreenClick: _,
84
- hide: a,
85
- show: w,
76
+ }, S = () => {
77
+ e.value || clearTimeout(u.value);
78
+ };
79
+ return A(l, () => {
80
+ l.value ? (f(), p()) : s();
81
+ }), N(() => {
82
+ l.value && (f(), p());
83
+ }), V(() => s()), {
84
+ mdiClose: U,
85
+ mdiCheckCircle: q,
86
+ onKeyUp: m,
87
+ onScreenClick: M,
88
+ hide: s,
89
+ show: f,
86
90
  controlsRef: d,
87
- handleClick: g
91
+ handleClick: B,
92
+ clearAutomaticClose: S,
93
+ setAutomaticClose: p
88
94
  };
89
95
  }
90
- }, Y = { class: "container" }, Z = { class: "tw-flex tw-pt-2 tw-px-2.5" }, $ = { class: "tw-flex tw-flex-grow tw-gap-1 tw-items-center tw-pb-2" }, tt = {
96
+ }, tt = { class: "container" }, et = { class: "tw-flex tw-pt-2 tw-px-2.5" }, ot = { class: "tw-flex tw-flex-grow tw-gap-1 tw-items-center tw-pb-2" }, lt = {
91
97
  id: "kvCartModalBody",
92
98
  ref: "kvCartModalBody",
93
99
  class: "modal__body"
94
- }, et = {
100
+ }, nt = {
95
101
  ref: "controlsRef",
96
102
  class: "tw-flex-shrink-0 tw-flex tw-justify-end tw-gap-x-2.5 tw-px-2.5 tw-pb-2 tw-flex-col tw-gap-1"
97
103
  };
98
- function ot(c, t, l, o, s, n) {
99
- const d = C("kv-material-icon"), m = C("kv-button");
100
- return y(), N(V, {
104
+ function at(c, t, l, e, r, a) {
105
+ const d = y("kv-material-icon"), u = y("kv-button");
106
+ return b(), I(K, {
101
107
  "enter-active-class": "tw-transition-opacity tw-duration-300",
102
108
  "leave-active-class": "tw-transition-opacity tw-duration-300",
103
109
  "enter-class": "tw-opacity-0",
@@ -105,70 +111,72 @@ function ot(c, t, l, o, s, n) {
105
111
  "leave-class": "tw-opacity-full",
106
112
  "leave-to-class": "tw-opacity-0"
107
113
  }, {
108
- default: b(() => [
109
- K(e("div", {
114
+ default: x(() => [
115
+ F(o("div", {
110
116
  class: "screen",
111
- onClick: t[3] || (t[3] = p((...r) => o.onScreenClick && o.onScreenClick(...r), ["stop", "prevent"]))
117
+ onClick: t[5] || (t[5] = k((...n) => e.onScreenClick && e.onScreenClick(...n), ["stop", "prevent"]))
112
118
  }, [
113
- e("div", null, [
114
- e("div", Y, [
115
- e("div", {
119
+ o("div", null, [
120
+ o("div", tt, [
121
+ o("div", {
116
122
  ref: "kvCartModal",
117
123
  tabindex: "-1",
118
124
  "data-test": "kv-cart-modal",
119
125
  class: "modal",
120
126
  "aria-modal": "true",
121
127
  "aria-label": "Added to basket",
122
- onClick: t[2] || (t[2] = p(() => {
123
- }, ["stop"]))
128
+ onClick: t[2] || (t[2] = k(() => {
129
+ }, ["stop"])),
130
+ onMouseenter: t[3] || (t[3] = (n) => e.clearAutomaticClose()),
131
+ onMouseleave: t[4] || (t[4] = (n) => e.setAutomaticClose())
124
132
  }, [
125
- e("div", Z, [
126
- e("div", $, [
127
- x(c.$slots, "header", {}, () => [
128
- k(d, {
133
+ o("div", et, [
134
+ o("div", ot, [
135
+ h(c.$slots, "header", {}, () => [
136
+ C(d, {
129
137
  class: "tw-w-3.5 tw-h-3.5 tw-text-brand",
130
- icon: o.mdiCheckCircle
138
+ icon: e.mdiCheckCircle
131
139
  }, null, 8, ["icon"]),
132
- t[4] || (t[4] = e("p", { class: "tw-flex-1 tw-font-medium tw-text-center" }, " Added to basket ", -1))
140
+ t[6] || (t[6] = o("p", { class: "tw-flex-1 tw-font-medium tw-text-center" }, " Added to basket ", -1))
133
141
  ], !0),
134
- l.preventClose ? I("", !0) : (y(), F("button", {
142
+ l.preventClose ? R("", !0) : (b(), P("button", {
135
143
  key: 0,
136
144
  class: "tw-grid tw-content-center tw-justify-center tw-ml-auto tw-w-6 tw-h-6 tw--m-2 hover:tw-text-action-highlight",
137
- onClick: t[0] || (t[0] = p((r) => o.hide("x-button"), ["stop"]))
145
+ onClick: t[0] || (t[0] = k((n) => e.hide("x-button"), ["stop"]))
138
146
  }, [
139
- k(d, {
147
+ C(d, {
140
148
  class: "tw-w-3.5 tw-h-3.5",
141
- icon: o.mdiClose
149
+ icon: e.mdiClose
142
150
  }, null, 8, ["icon"]),
143
- t[5] || (t[5] = e("span", { class: "tw-sr-only" }, "Close", -1))
151
+ t[7] || (t[7] = o("span", { class: "tw-sr-only" }, "Close", -1))
144
152
  ]))
145
153
  ])
146
154
  ]),
147
- e("div", tt, [
148
- x(c.$slots, "content", {}, void 0, !0)
155
+ o("div", lt, [
156
+ h(c.$slots, "content", {}, void 0, !0)
149
157
  ], 512),
150
- e("div", et, [
151
- k(m, {
158
+ o("div", nt, [
159
+ C(u, {
152
160
  class: "tw-w-full",
153
- onClick: t[1] || (t[1] = (r) => o.handleClick("view-basket"))
161
+ onClick: t[1] || (t[1] = (n) => e.handleClick("view-basket"))
154
162
  }, {
155
- default: b(() => [
156
- P(" View basket (" + R(l.basketCount) + ") ", 1)
163
+ default: x(() => [
164
+ j(" View basket (" + D(l.basketCount) + ") ", 1)
157
165
  ]),
158
166
  _: 1
159
167
  })
160
168
  ], 512)
161
- ], 512)
169
+ ], 544)
162
170
  ])
163
171
  ])
164
172
  ], 512), [
165
- [j, l.visible]
173
+ [L, l.visible]
166
174
  ])
167
175
  ]),
168
176
  _: 3
169
177
  });
170
178
  }
171
- const mt = /* @__PURE__ */ W(X, [["render", ot], ["__scopeId", "data-v-faf9d7e4"]]);
179
+ const pt = /* @__PURE__ */ Z($, [["render", at], ["__scopeId", "data-v-e2f3420c"]]);
172
180
  export {
173
- mt as default
181
+ pt as default
174
182
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.0.0",
3
+ "version": "6.2.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -107,5 +107,5 @@
107
107
  "embla-carousel-fade",
108
108
  "popper.js"
109
109
  ],
110
- "gitHead": "59c2c9181a16a9e579b56826a5cb3415226b1859"
110
+ "gitHead": "4c0ac0befe6a72080cedbf0bb38b1149ad0d7ee8"
111
111
  }