@kiva/kv-components 6.19.3 → 6.20.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 @@
1
+ @media (min-width: 45.875rem){.cart-modal[data-v-c974cd2d] div.container{right:var(--modal-right)!important;top:var(--modal-top)!important}}
@@ -1,11 +1,12 @@
1
1
  import { toRefs as N, ref as j, computed as C, onMounted as V, onUnmounted as F, resolveComponent as E, openBlock as u, createBlock as O, normalizeStyle as z, withCtx as B, createElementBlock as m, createVNode as D, createElementVNode as e, normalizeClass as R, toDisplayString as T, createCommentVNode as k } from "vue";
2
- import { throttle as U } from "../utils/throttle.js";
3
- import I from "./KvCartModal.js";
2
+ import { throttle as I } from "../utils/throttle.js";
3
+ import U from "./KvCartModal.js";
4
4
  import G from "./KvCartPill.js";
5
+ import "./KvAtbModal.css";
5
6
  import W from "../_virtual/_plugin-vue_export-helper.js";
6
7
  const Y = {
7
8
  components: {
8
- KvCartModal: I,
9
+ KvCartModal: U,
9
10
  KvCartPill: G
10
11
  },
11
12
  props: {
@@ -145,7 +146,7 @@ const Y = {
145
146
  s || (a = [...document.querySelectorAll('[data-testid="header-about"]')], s = a.find((L) => L == null ? void 0 : L.clientHeight));
146
147
  const r = (s == null ? void 0 : s.getBoundingClientRect()) ?? null;
147
148
  r && (r == null ? void 0 : r.right) !== f.value && (f.value = r == null ? void 0 : r.right), o && (o == null ? void 0 : o.bottom) !== w.value && (w.value = o == null ? void 0 : o.bottom);
148
- }, h = U(x, 100);
149
+ }, h = I(x, 100);
149
150
  return V(() => {
150
151
  x(), window.addEventListener("scroll", h), window.addEventListener("resize", h);
151
152
  }), F(() => {
@@ -386,7 +387,7 @@ function e1(g, i, n, l, M, y) {
386
387
  _: 1
387
388
  }, 8, ["style", "visible", "photo-path", "basket-count", "category-name", "onCartModalClosed"])) : k("", !0);
388
389
  }
389
- const a1 = /* @__PURE__ */ W(Y, [["render", e1]]);
390
+ const i1 = /* @__PURE__ */ W(Y, [["render", e1], ["__scopeId", "data-v-c974cd2d"]]);
390
391
  export {
391
- a1 as default
392
+ i1 as default
392
393
  };
@@ -1,10 +1,10 @@
1
- import { toRefs as U, ref as w, reactive as A, computed as G, onMounted as D, onUnmounted as T, watch as j, resolveComponent as I, openBlock as v, createElementBlock as m, normalizeClass as y, withModifiers as q, createElementVNode as s, normalizeStyle as O, createVNode as C, createCommentVNode as g, toDisplayString as J, renderSlot as V, nextTick as P } from "vue";
2
- import { mdiArrowLeft as Q, mdiClose as W, mdiExportVariant as X } from "@mdi/js";
3
- import Y from "./KvMaterialIcon.js";
4
- import Z from "../_virtual/_plugin-vue_export-helper.js";
5
- const $ = {
1
+ import { toRefs as J, ref as w, reactive as P, computed as I, onMounted as Q, onUnmounted as E, watch as R, resolveComponent as W, openBlock as g, createElementBlock as p, normalizeClass as k, withModifiers as X, createElementVNode as c, normalizeStyle as H, createVNode as z, createCommentVNode as x, toDisplayString as Y, renderSlot as N, nextTick as Z } from "vue";
2
+ import { mdiArrowLeft as $, mdiClose as ee, mdiExportVariant as te } from "@mdi/js";
3
+ import oe from "./KvMaterialIcon.js";
4
+ import ie from "../_virtual/_plugin-vue_export-helper.js";
5
+ const ne = {
6
6
  components: {
7
- KvMaterialIcon: Y
7
+ KvMaterialIcon: oe
8
8
  },
9
9
  props: {
10
10
  /**
@@ -62,208 +62,267 @@ const $ = {
62
62
  headline: {
63
63
  type: String,
64
64
  default: ""
65
+ },
66
+ /**
67
+ * The CSS width of the SideSheet, either as a string (e.g., '33.33%') or an object with
68
+ * breakpoint-specific widths (e.g., { default: '100%', lg: '50%' }). Supports responsive
69
+ * design with breakpoints: default, sm, md, lg, xl, 2xl
70
+ * */
71
+ widthDimensions: {
72
+ type: [String, Object],
73
+ default: () => ({ default: "100%", md: "50%" }),
74
+ validator: (l) => typeof l == "string" ? /^(\d+px|[\d.]+%|auto|inherit|initial)$/.test(l) : typeof l == "object" ? Object.keys(l).every((s) => ["default", "sm", "md", "lg", "xl", "2xl"].includes(s) && /^(\d+px|[\d.]+%|auto|inherit|initial)$/.test(l[s])) : !1
65
75
  }
66
76
  },
67
77
  emits: ["side-sheet-closed", "go-to-link"],
68
- setup(c, { emit: l, slots: n }) {
78
+ setup(l, { emit: s, slots: a }) {
69
79
  const {
70
- visible: e,
71
- kvTrackFunction: E,
72
- trackEventCategory: L,
73
- animationSourceElement: r
74
- } = U(c), i = w(!1), S = w({}), u = w({}), h = w(null), f = w(null), R = w(window.innerHeight), d = A({
80
+ visible: t,
81
+ kvTrackFunction: _,
82
+ trackEventCategory: K,
83
+ animationSourceElement: u,
84
+ widthDimensions: i
85
+ } = J(l), d = w(!1), b = w({}), f = w({}), T = w(null), m = w(null), v = w(null), V = w(window.innerHeight), h = P({
75
86
  headline: 0,
76
87
  controls: 0
77
- }), M = G(() => {
78
- const t = R.value - d.headline - d.controls;
79
- return Math.max(t, 0);
80
- }), F = (t, a) => {
88
+ }), U = I(() => {
89
+ const e = V.value - h.headline - h.controls;
90
+ return Math.max(e, 0);
91
+ }), A = (e, n) => {
81
92
  let o;
82
- return (...b) => {
83
- clearTimeout(o), o = setTimeout(() => t(...b), a);
93
+ return (...y) => {
94
+ clearTimeout(o), o = setTimeout(() => e(...y), n);
84
95
  };
85
- }, p = () => {
86
- R.value = window.innerHeight, setTimeout(() => {
87
- P(() => {
88
- var t;
89
- if (f.value) {
90
- const a = f.value.getBoundingClientRect();
91
- d.headline = a.height;
96
+ }, S = () => {
97
+ V.value = window.innerHeight, setTimeout(() => {
98
+ Z(() => {
99
+ var e;
100
+ if (v.value) {
101
+ const n = v.value.getBoundingClientRect();
102
+ h.headline = n.height;
92
103
  } else
93
- d.headline = 0;
94
- if ((t = n.controls) != null && t.call(n) && h.value) {
95
- const a = h.value.getBoundingClientRect();
96
- d.controls = a.height;
104
+ h.headline = 0;
105
+ if ((e = a.controls) != null && e.call(a) && m.value) {
106
+ const n = m.value.getBoundingClientRect();
107
+ h.controls = n.height;
97
108
  } else
98
- d.controls = 0;
109
+ h.controls = 0;
99
110
  });
100
111
  }, 300);
101
- }, k = F(p, 100), x = () => {
102
- const t = "tw-overflow-hidden";
103
- i.value ? document.body.classList.add(t) : document.body.classList.remove(t);
104
- }, H = () => {
105
- i.value = !1, x(), E.value(L.value, "click", "side-sheet-closed"), r.value && (u.value = {
106
- ...S.value,
112
+ }, B = A(S, 100), L = () => {
113
+ const e = "tw-overflow-hidden";
114
+ d.value ? document.body.classList.add(e) : document.body.classList.remove(e);
115
+ }, M = () => {
116
+ d.value = !1, L(), _.value(K.value, "click", "side-sheet-closed"), u.value && (f.value = {
117
+ ...b.value,
107
118
  transition: "all 0.5s ease-in-out"
108
119
  }), setTimeout(() => {
109
- l("side-sheet-closed");
110
- }, 700), document.removeEventListener("keyup", B);
111
- }, K = () => {
112
- l("go-to-link");
113
- }, B = (t) => {
114
- (t == null ? void 0 : t.key) === "Escape" && H();
120
+ s("side-sheet-closed");
121
+ }, 700), document.removeEventListener("keyup", j);
122
+ }, G = () => {
123
+ s("go-to-link");
124
+ }, j = (e) => {
125
+ (e == null ? void 0 : e.key) === "Escape" && M();
115
126
  };
116
- return D(() => {
127
+ Q(() => {
117
128
  if (setTimeout(() => {
118
- p();
119
- }, 100), h.value) {
120
- const t = new ResizeObserver(k);
121
- t.observe(h.value), T(() => t.disconnect());
129
+ S();
130
+ }, 100), m.value) {
131
+ const e = new ResizeObserver(B);
132
+ e.observe(m.value), E(() => e.disconnect());
122
133
  }
123
- if (f.value) {
124
- const t = new ResizeObserver(k);
125
- t.observe(f.value), T(() => t.disconnect());
134
+ if (v.value) {
135
+ const e = new ResizeObserver(B);
136
+ e.observe(v.value), E(() => e.disconnect());
126
137
  }
127
- window.addEventListener("resize", k), T(() => window.removeEventListener("resize", k));
128
- }), j(() => {
129
- var t;
130
- return (t = n.controls) == null ? void 0 : t.call(n);
138
+ window.addEventListener("resize", B), E(() => window.removeEventListener("resize", B));
139
+ }), R(() => {
140
+ var e;
141
+ return (e = a.controls) == null ? void 0 : e.call(a);
131
142
  }, () => {
132
143
  setTimeout(() => {
133
- p();
144
+ S();
134
145
  }, 100);
135
- }, { deep: !0, immediate: !0 }), j(e, (t) => {
136
- var a;
137
- if (t) {
138
- document.addEventListener("keyup", B), setTimeout(() => {
139
- i.value = !0, x(), p();
146
+ }, { deep: !0, immediate: !0 });
147
+ const q = I(() => {
148
+ if (!d.value)
149
+ return {};
150
+ if (typeof i.value == "string")
151
+ return { width: i.value };
152
+ const n = ["sm", "md", "lg", "xl", "2xl"].find((o) => i.value[o]);
153
+ return { width: i.value[n] || i.value.default || "100%" };
154
+ });
155
+ R([t, i], ([e]) => {
156
+ var n;
157
+ if (e) {
158
+ document.addEventListener("keyup", j), setTimeout(() => {
159
+ d.value = !0, L(), S();
140
160
  }, 100);
141
- const o = (a = r.value) == null ? void 0 : a.getBoundingClientRect(), b = (o == null ? void 0 : o.top) ?? 0, N = (o == null ? void 0 : o.left) ?? 0, z = (o == null ? void 0 : o.width) ?? 0, _ = (o == null ? void 0 : o.height) ?? 0;
142
- b || N || z || _ ? (S.value = {
161
+ const o = (n = u.value) == null ? void 0 : n.getBoundingClientRect(), y = (o == null ? void 0 : o.top) ?? 0, O = (o == null ? void 0 : o.left) ?? 0, r = (o == null ? void 0 : o.width) ?? 0, C = (o == null ? void 0 : o.height) ?? 0;
162
+ y || O || r || C ? (b.value = {
143
163
  position: "fixed",
144
- top: `${b}px`,
145
- width: `${z}px`,
146
- height: `${_}px`
147
- }, u.value = {
148
- ...S.value,
164
+ top: `${y}px`,
165
+ width: `${r}px`,
166
+ height: `${C}px`
167
+ }, f.value = {
168
+ ...b.value,
149
169
  transition: "none"
150
170
  }, setTimeout(() => {
151
- u.value = {
171
+ f.value = {
152
172
  top: "0",
153
- width: "100%",
154
173
  height: "100%",
155
174
  transition: "all 0.5s ease-in-out"
156
175
  };
157
- }, 10)) : u.value = {};
176
+ }, 10)) : f.value = {
177
+ height: "100%"
178
+ };
158
179
  } else
159
- i.value = !1, x(), document.removeEventListener("keyup", B);
180
+ d.value = !1, L(), document.removeEventListener("keyup", j), f.value = u.value ? {
181
+ ...b.value,
182
+ transition: "all 0.5s ease-in-out"
183
+ } : {};
184
+ });
185
+ const D = () => {
186
+ if (typeof i.value == "object" && T.value) {
187
+ const e = "side-sheet-styles";
188
+ let n = document.getElementById(e);
189
+ n || (n = document.createElement("style"), n.id = e, document.head.appendChild(n));
190
+ const o = {
191
+ sm: "640px",
192
+ md: "768px",
193
+ lg: "1024px",
194
+ xl: "1280px",
195
+ "2xl": "1536px"
196
+ }, O = Object.keys(i.value).filter((r) => r !== "default").sort((r, C) => {
197
+ const F = ["sm", "md", "lg", "xl", "2xl"];
198
+ return F.indexOf(r) - F.indexOf(C);
199
+ }).map((r) => `
200
+ @media (min-width: ${o[r]}) {
201
+ #side-sheet-${l.trackEventCategory || "default"} {
202
+ width: ${i.value[r]} !important;
203
+ }
204
+ }
205
+ `).join("");
206
+ n.textContent = O, T.value.id = `side-sheet-${l.trackEventCategory || "default"}`, E(() => {
207
+ n && n.remove();
208
+ });
209
+ }
210
+ };
211
+ return R(i, () => {
212
+ d.value && D();
213
+ }, { immediate: !0 }), R(d, (e) => {
214
+ e && D();
160
215
  }), {
161
- closeSideSheet: H,
162
- contentHeight: M,
163
- controlsRef: h,
164
- headlineRef: f,
165
- goToLink: K,
166
- mdiArrowLeft: Q,
167
- mdiClose: W,
168
- mdiExportVariant: X,
169
- modalStyles: u,
170
- open: i
216
+ closeSideSheet: M,
217
+ contentHeight: U,
218
+ controlsRef: m,
219
+ headlineRef: v,
220
+ sideSheetRef: T,
221
+ sideSheetStyles: q,
222
+ goToLink: G,
223
+ mdiArrowLeft: $,
224
+ mdiClose: ee,
225
+ mdiExportVariant: te,
226
+ modalStyles: f,
227
+ open: d
171
228
  };
172
229
  }
173
- }, ee = { class: "tw-flex tw-gap-1.5" }, te = { key: 1 }, oe = { class: "tw-flex tw-gap-1.5" };
174
- function ne(c, l, n, e, E, L) {
175
- const r = I("kv-material-icon");
176
- return n.visible ? (v(), m("div", {
230
+ }, le = { class: "tw-flex tw-gap-1.5" }, se = { key: 1 }, ae = { class: "tw-flex tw-gap-1.5" };
231
+ function re(l, s, a, t, _, K) {
232
+ const u = W("kv-material-icon");
233
+ return a.visible ? (g(), p("div", {
177
234
  key: 0,
178
- class: y(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
179
- "tw-bg-opacity-0 tw-delay-300": !e.open,
180
- "tw-bg-opacity-low": e.open
235
+ class: k(["tw-block lg:tw-mt-0 tw-fixed tw-inset-0 tw-bg-black tw-transition-all md:tw-duration-150 tw-z-modal", {
236
+ "tw-bg-opacity-0 tw-delay-300": !t.open,
237
+ "tw-bg-opacity-low": t.open
181
238
  }]),
182
- onClick: l[3] || (l[3] = q((...i) => e.closeSideSheet && e.closeSideSheet(...i), ["self"]))
239
+ onClick: s[3] || (s[3] = X((...i) => t.closeSideSheet && t.closeSideSheet(...i), ["self"]))
183
240
  }, [
184
- s("div", {
185
- class: y(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto", {
186
- "tw-w-0 tw-delay-200 tw-opacity-0": !e.open,
187
- "lg:tw-w-1/2 tw-w-full tw-opacity-full": e.open,
188
- "tw-h-full": c.$slots.controls
189
- }])
241
+ c("div", {
242
+ ref: "sideSheetRef",
243
+ class: k(["tw-fixed tw-right-0 tw-transition-all tw-duration-300 tw-bg-white tw-overflow-y-auto", {
244
+ "tw-w-0 tw-delay-200 tw-opacity-0": !t.open,
245
+ "tw-opacity-full": t.open,
246
+ "tw-h-full": l.$slots.controls
247
+ }]),
248
+ style: H(t.sideSheetStyles)
190
249
  }, [
191
- s("div", {
250
+ c("div", {
192
251
  class: "tw-flex tw-flex-col tw-h-full",
193
- style: O(e.modalStyles)
252
+ style: H(t.modalStyles)
194
253
  }, [
195
- s("div", {
254
+ c("div", {
196
255
  ref: "headlineRef",
197
- class: y(["tw-flex tw-justify-between tw-transition-opacity tw-duration-500 tw-delay-200 tw-px-3 tw-py-2 tw-border-tertiary", {
198
- "tw-opacity-0": !e.open,
199
- "tw-opacity-full": e.open,
200
- "tw-border-b": n.showHeadlineBorder
256
+ class: k(["tw-flex tw-justify-between tw-transition-opacity tw-duration-200 tw-px-3 tw-py-2 tw-border-tertiary", {
257
+ "tw-opacity-0": !t.open,
258
+ "tw-opacity-full": t.open,
259
+ "tw-border-b": a.showHeadlineBorder
201
260
  }])
202
261
  }, [
203
- s("div", ee, [
204
- n.showBackButton ? (v(), m("button", {
262
+ c("div", le, [
263
+ a.showBackButton ? (g(), p("button", {
205
264
  key: 0,
206
265
  class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
207
- onClick: l[0] || (l[0] = (...i) => e.closeSideSheet && e.closeSideSheet(...i))
266
+ onClick: s[0] || (s[0] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
208
267
  }, [
209
- C(r, {
268
+ z(u, {
210
269
  class: "tw-w-3 tw-h-3",
211
- icon: e.mdiArrowLeft
270
+ icon: t.mdiArrowLeft
212
271
  }, null, 8, ["icon"])
213
- ])) : g("", !0),
214
- n.headline ? (v(), m("h2", te, J(n.headline), 1)) : g("", !0)
272
+ ])) : x("", !0),
273
+ a.headline ? (g(), p("h2", se, Y(a.headline), 1)) : x("", !0)
215
274
  ]),
216
- s("div", oe, [
217
- n.showGoToLink ? (v(), m("button", {
275
+ c("div", ae, [
276
+ a.showGoToLink ? (g(), p("button", {
218
277
  key: 0,
219
278
  class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
220
- onClick: l[1] || (l[1] = (...i) => e.goToLink && e.goToLink(...i))
279
+ onClick: s[1] || (s[1] = (...i) => t.goToLink && t.goToLink(...i))
221
280
  }, [
222
- C(r, {
281
+ z(u, {
223
282
  class: "tw-w-3 tw-h-3",
224
- icon: e.mdiExportVariant
283
+ icon: t.mdiExportVariant
225
284
  }, null, 8, ["icon"])
226
- ])) : g("", !0),
227
- s("button", {
285
+ ])) : x("", !0),
286
+ c("button", {
228
287
  class: "hover:tw-text-action-highlight tw-flex tw-items-center tw-justify-center",
229
- onClick: l[2] || (l[2] = (...i) => e.closeSideSheet && e.closeSideSheet(...i))
288
+ onClick: s[2] || (s[2] = (...i) => t.closeSideSheet && t.closeSideSheet(...i))
230
289
  }, [
231
- C(r, {
290
+ z(u, {
232
291
  class: "tw-w-3 tw-h-3",
233
- icon: e.mdiClose
292
+ icon: t.mdiClose
234
293
  }, null, 8, ["icon"])
235
294
  ])
236
295
  ])
237
296
  ], 2),
238
- s("div", {
297
+ c("div", {
239
298
  class: "tw-overflow-y-auto tw-overscroll-y-contain",
240
- style: O({ height: e.contentHeight + "px" })
299
+ style: H({ height: t.contentHeight + "px" })
241
300
  }, [
242
- s("div", {
243
- class: y(["tw-p-2 tw-transition-opacity tw-duration-500 tw-delay-200", {
244
- "tw-opacity-0": !e.open,
245
- "tw-opacity-full": e.open
301
+ c("div", {
302
+ class: k(["tw-p-2 tw-transition-opacity tw-duration-200", {
303
+ "tw-opacity-0": !t.open,
304
+ "tw-opacity-full": t.open
246
305
  }])
247
306
  }, [
248
- V(c.$slots, "default")
307
+ N(l.$slots, "default")
249
308
  ], 2)
250
309
  ], 4),
251
- c.$slots.controls ? (v(), m("div", {
310
+ l.$slots.controls ? (g(), p("div", {
252
311
  key: 0,
253
312
  ref: "controlsRef",
254
- class: y(["tw-absolute tw-bottom-0 tw-w-full tw-border-t tw-border-tertiary tw-bg-white", {
255
- "tw-opacity-0": !e.open,
256
- "tw-opacity-full": e.open
313
+ class: k(["tw-absolute tw-bottom-0 tw-w-full tw-border-t tw-border-tertiary tw-bg-white tw-transition-opacity tw-duration-200", {
314
+ "tw-opacity-0": !t.open,
315
+ "tw-opacity-full": t.open
257
316
  }]),
258
317
  style: { "z-index": "999" }
259
318
  }, [
260
- V(c.$slots, "controls")
261
- ], 2)) : g("", !0)
319
+ N(l.$slots, "controls")
320
+ ], 2)) : x("", !0)
262
321
  ], 4)
263
- ], 2)
264
- ], 2)) : g("", !0);
322
+ ], 6)
323
+ ], 2)) : x("", !0);
265
324
  }
266
- const ce = /* @__PURE__ */ Z($, [["render", ne]]);
325
+ const fe = /* @__PURE__ */ ie(ne, [["render", re]]);
267
326
  export {
268
- ce as default
327
+ fe as default
269
328
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.19.3",
3
+ "version": "6.20.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -111,5 +111,5 @@
111
111
  "embla-carousel-fade",
112
112
  "popper.js"
113
113
  ],
114
- "gitHead": "598d31555546dd2c068cc2e2e0a86fe6b945619a"
114
+ "gitHead": "679a1245a2f841c23eaabfd75403bd128b375774"
115
115
  }