@storefront-ui/shared
Advanced tools
Comparing version 2.0.0-rc.3 to 2.0.0-rc.4
@@ -1,2 +0,1 @@ | ||
export * from './progress'; | ||
export * from './scrollable'; | ||
@@ -3,0 +2,0 @@ export * from './utils'; |
var L = Object.defineProperty; | ||
var v = (e, t, s) => t in e ? L(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s; | ||
var r = (e, t, s) => (v(e, typeof t != "symbol" ? t + "" : t, s), s); | ||
const B = { | ||
xs: { | ||
icon: 16, | ||
r: 7.2, | ||
dash: 45.216 | ||
}, | ||
sm: { | ||
icon: 20, | ||
r: 9, | ||
dash: 56.52 | ||
}, | ||
base: { | ||
icon: 24, | ||
r: 11, | ||
dash: 69.08 | ||
}, | ||
lg: { | ||
icon: 32, | ||
r: 14.67, | ||
dash: 92.127 | ||
}, | ||
xl: { | ||
icon: 40, | ||
r: 19, | ||
dash: 119.32 | ||
}, | ||
"2xl": { | ||
icon: 56, | ||
r: 26, | ||
dash: 163.28 | ||
}, | ||
"3xl": { | ||
icon: 96, | ||
r: 44, | ||
dash: 276.32 | ||
}, | ||
"4xl": { | ||
icon: 192, | ||
r: 88, | ||
dash: 552.64 | ||
} | ||
}, p = { | ||
var f = (t, s, e) => s in t ? L(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e; | ||
var i = (t, s, e) => (f(t, typeof s != "symbol" ? s + "" : s, e), e); | ||
const m = { | ||
reduceMotion: !1, | ||
@@ -50,28 +9,28 @@ snap: !1, | ||
vertical: !1 | ||
}, u = "vsf-scrollable__container--dragging"; | ||
class j { | ||
constructor(t, s) { | ||
r(this, "container"); | ||
r(this, "options"); | ||
r(this, "debounceId"); | ||
r(this, "isDragged"); | ||
r(this, "dragScrollX"); | ||
r(this, "dragScrollLeft"); | ||
r(this, "dragScrollY"); | ||
r(this, "dragScrollTop"); | ||
r(this, "scrollListenerInstance", () => { | ||
}, u = "sf-scrollable__container--dragging"; | ||
class z { | ||
constructor(s, e) { | ||
i(this, "container"); | ||
i(this, "options"); | ||
i(this, "debounceId"); | ||
i(this, "isDragged"); | ||
i(this, "dragScrollX"); | ||
i(this, "dragScrollLeft"); | ||
i(this, "dragScrollY"); | ||
i(this, "dragScrollTop"); | ||
i(this, "scrollListenerInstance", () => { | ||
}); | ||
r(this, "resizeListenerInstance", () => { | ||
i(this, "resizeListenerInstance", () => { | ||
}); | ||
r(this, "mouseDownListenerInstance", () => { | ||
i(this, "mouseDownListenerInstance", () => { | ||
}); | ||
r(this, "mouseUpListenerInstance", () => { | ||
i(this, "mouseUpListenerInstance", () => { | ||
}); | ||
r(this, "mouseMoveListenerInstance", () => { | ||
i(this, "mouseMoveListenerInstance", () => { | ||
}); | ||
r(this, "mouseLeaveListenerInstance", () => { | ||
i(this, "mouseLeaveListenerInstance", () => { | ||
}); | ||
if (!(t instanceof HTMLElement)) | ||
throw new Error(`VsfScrollable: Container is not a HTMLElement! Received: ${t}`); | ||
this.container = t, this.options = { ...p, ...s }, this.dragScrollX = 0, this.dragScrollLeft = 0, this.dragScrollY = 0, this.dragScrollTop = 0, this.init(); | ||
if (!(s instanceof HTMLElement)) | ||
throw new Error(`SfScrollable: Container is not a HTMLElement! Received: ${s}`); | ||
this.container = s, this.options = { ...m, ...e }, this.dragScrollX = 0, this.dragScrollLeft = 0, this.dragScrollY = 0, this.dragScrollTop = 0, this.init(); | ||
} | ||
@@ -81,4 +40,4 @@ init() { | ||
} | ||
update(t) { | ||
this.options = { ...p, ...t }, this.removeListeners(), this.init(); | ||
update(s) { | ||
this.options = { ...m, ...s }, this.removeListeners(), this.init(); | ||
} | ||
@@ -89,20 +48,20 @@ destroy() { | ||
prev() { | ||
const { container: t, options: s } = this; | ||
s.vertical ? this.scrollTo({ top: t.scrollTop - t.clientHeight }) : this.scrollTo({ left: t.scrollLeft - t.clientWidth }); | ||
const { container: s, options: e } = this; | ||
e.vertical ? this.scrollTo({ top: s.scrollTop - s.clientHeight }) : this.scrollTo({ left: s.scrollLeft - s.clientWidth }); | ||
} | ||
next() { | ||
const { container: t, options: s } = this; | ||
s.vertical ? this.scrollTo({ top: t.scrollTop + t.clientHeight }) : this.scrollTo({ left: t.scrollLeft + t.clientWidth }); | ||
const { container: s, options: e } = this; | ||
e.vertical ? this.scrollTo({ top: s.scrollTop + s.clientHeight }) : this.scrollTo({ left: s.scrollLeft + s.clientWidth }); | ||
} | ||
scrollToIndex(t) { | ||
const s = this.children(); | ||
if (s[t]) { | ||
const { container: n } = this, i = s[t].getBoundingClientRect(), o = i.left - n.getBoundingClientRect().left, l = i.top - n.getBoundingClientRect().top, c = n.clientWidth / 2 - i.width / 2, m = n.clientHeight / 2 - i.height / 2; | ||
this.options.vertical ? this.scrollTo({ top: n.scrollTop + l - m }) : this.scrollTo({ left: n.scrollLeft + o - c }); | ||
scrollToIndex(s) { | ||
const e = this.children(); | ||
if (e[s]) { | ||
const { container: n } = this, r = e[s].getBoundingClientRect(), o = r.left - n.getBoundingClientRect().left, c = r.top - n.getBoundingClientRect().top, l = n.clientWidth / 2 - r.width / 2, x = n.clientHeight / 2 - r.height / 2; | ||
this.options.vertical ? this.scrollTo({ top: n.scrollTop + c - x }) : this.scrollTo({ left: n.scrollLeft + o - l }); | ||
} | ||
} | ||
refresh(t) { | ||
refresh(s) { | ||
requestAnimationFrame(() => { | ||
const s = this.calculate(); | ||
t == null || t(s); | ||
const e = this.calculate(); | ||
s == null || s(e); | ||
}); | ||
@@ -118,19 +77,19 @@ } | ||
} | ||
onMouseDown(t) { | ||
t.preventDefault(); | ||
const { container: s, options: n } = this; | ||
this.isDragged = !0, s.classList.add(u), n.vertical ? (this.dragScrollY = t.pageY - s.offsetTop, this.dragScrollTop = s.scrollTop) : (this.dragScrollX = t.pageX - s.offsetLeft, this.dragScrollLeft = s.scrollLeft); | ||
onMouseDown(s) { | ||
s.preventDefault(); | ||
const { container: e, options: n } = this; | ||
this.isDragged = !0, e.classList.add(u), n.vertical ? (this.dragScrollY = s.pageY - e.offsetTop, this.dragScrollTop = e.scrollTop) : (this.dragScrollX = s.pageX - e.offsetLeft, this.dragScrollLeft = e.scrollLeft); | ||
} | ||
onMouseMove(t) { | ||
onMouseMove(s) { | ||
var o; | ||
if (!this.isDragged) | ||
return; | ||
t.preventDefault(); | ||
const s = ((o = this.options.drag) == null ? void 0 : o.sensitivity) ?? 4, { container: n, options: i } = this; | ||
if (i.vertical) { | ||
const c = (t.pageY - n.offsetTop - this.dragScrollY) * s; | ||
n.scrollTop = this.dragScrollTop - c; | ||
s.preventDefault(); | ||
const e = ((o = this.options.drag) == null ? void 0 : o.sensitivity) ?? 4, { container: n, options: r } = this; | ||
if (r.vertical) { | ||
const l = (s.pageY - n.offsetTop - this.dragScrollY) * e; | ||
n.scrollTop = this.dragScrollTop - l; | ||
} else { | ||
const c = (t.pageX - n.offsetLeft - this.dragScrollX) * s; | ||
n.scrollLeft = this.dragScrollLeft - c; | ||
const l = (s.pageX - n.offsetLeft - this.dragScrollX) * e; | ||
n.scrollLeft = this.dragScrollLeft - l; | ||
} | ||
@@ -147,5 +106,5 @@ } | ||
} | ||
scrollTo({ left: t, top: s }) { | ||
scrollTo({ left: s, top: e }) { | ||
const n = this.options.reduceMotion ? "auto" : "smooth"; | ||
this.container.scrollTo({ left: t, top: s, behavior: n }); | ||
this.container.scrollTo({ left: s, top: e, behavior: n }); | ||
} | ||
@@ -156,26 +115,26 @@ onScroll() { | ||
onResize() { | ||
this.container && this.refresh((s) => { | ||
var n, i; | ||
return (i = (n = this.options).onScroll) == null ? void 0 : i.call(n, s); | ||
this.container && this.refresh((e) => { | ||
var n, r; | ||
return (r = (n = this.options).onScroll) == null ? void 0 : r.call(n, e); | ||
}); | ||
} | ||
onScrollHandler() { | ||
this.refresh((t) => { | ||
var s, n; | ||
return (n = (s = this.options).onScroll) == null ? void 0 : n.call(s, t); | ||
this.refresh((s) => { | ||
var e, n; | ||
return (n = (e = this.options).onScroll) == null ? void 0 : n.call(e, s); | ||
}); | ||
} | ||
calculate() { | ||
const { container: t, options: s } = this; | ||
const { container: s, options: e } = this; | ||
function n() { | ||
return s.vertical ? t.scrollHeight > Math.ceil(t.scrollTop) + t.clientHeight : t.scrollWidth > Math.ceil(t.scrollLeft) + t.clientWidth; | ||
return e.vertical ? s.scrollHeight > Math.ceil(s.scrollTop) + s.clientHeight : s.scrollWidth > Math.ceil(s.scrollLeft) + s.clientWidth; | ||
} | ||
function i() { | ||
return s.vertical ? !!t.scrollTop : !!t.scrollLeft; | ||
function r() { | ||
return e.vertical ? !!s.scrollTop : !!s.scrollLeft; | ||
} | ||
return { | ||
left: t.scrollLeft, | ||
width: t.clientWidth, | ||
scrollWidth: t.scrollWidth, | ||
hasPrev: i(), | ||
left: s.scrollLeft, | ||
width: s.clientWidth, | ||
scrollWidth: s.scrollWidth, | ||
hasPrev: r(), | ||
hasNext: n() | ||
@@ -185,147 +144,158 @@ }; | ||
} | ||
const g = typeof window < "u", z = g && (window == null ? void 0 : window.matchMedia("(prefers-reduced-motion: reduce)").matches), h = g && /^((?!chrome|android).)*safari/i.test(navigator == null ? void 0 : navigator.userAgent); | ||
let I = -1; | ||
const _ = (e) => `vsf-${e}--${++I}`, $ = (e) => e.key === "Tab" && e.shiftKey, q = (e) => e.key === "Tab" && !e.shiftKey, K = () => { | ||
const p = typeof window < "u", S = p && (window == null ? void 0 : window.matchMedia("(prefers-reduced-motion: reduce)").matches), h = p && /^((?!chrome|android).)*safari/i.test(navigator == null ? void 0 : navigator.userAgent); | ||
let v = -1; | ||
const tt = (t) => `sf-${t}--${++v}`, st = (t) => t.key === "Tab" && t.shiftKey, et = (t) => t.key === "Tab" && !t.shiftKey, nt = () => { | ||
}; | ||
function F(e, t, s) { | ||
return Math.min(Math.max(e, t), s); | ||
function rt(t, s, e) { | ||
return Math.min(Math.max(t, s), e); | ||
} | ||
function k(e, t) { | ||
return Math.round(e / t) * t; | ||
function it(t, s) { | ||
return Math.round(t / s) * s; | ||
} | ||
function x(e, t) { | ||
if (e === t) | ||
function I(t, s) { | ||
if (t === s) | ||
return !0; | ||
const s = typeof e; | ||
if (s !== typeof t) | ||
const e = typeof t; | ||
if (e !== typeof s) | ||
return !1; | ||
if (s === "object" && e !== null && t !== null) { | ||
if (e.length !== t.length || Object.getOwnPropertyNames(e).length !== Object.getOwnPropertyNames(t).length) | ||
if (e === "object" && t !== null && s !== null) { | ||
if (t.length !== s.length || Object.getOwnPropertyNames(t).length !== Object.getOwnPropertyNames(s).length) | ||
return !1; | ||
for (const i in e) | ||
if (!x(e[i], t[i])) | ||
for (const r in t) | ||
if (!I(t[r], s[r])) | ||
return !1; | ||
} else | ||
return s === "function" ? e.toString() === t.toString() : !1; | ||
return e === "function" ? t.toString() === s.toString() : !1; | ||
return !0; | ||
} | ||
var M = /* @__PURE__ */ ((e) => (e.gray = "gray", e.secondary = "secondary", e.positive = "positive", e.warning = "warning", e.error = "error", e))(M || {}), w = /* @__PURE__ */ ((e) => (e.temporary = "temporary", e.persistent = "persistent", e))(w || {}), T = /* @__PURE__ */ ((e) => (e.top = "top", e.middle = "middle", e))(T || {}), D = /* @__PURE__ */ ((e) => (e.top = "top", e.middle = "middle", e.bottom = "bottom", e))(D || {}), S = /* @__PURE__ */ ((e) => (e.category = "category", e.subcategory = "subcategory", e.contact = "contact", e.contactDescription = "contact-description", e.socialMedia = "social-media", e.bottomLinks = "bottom-links", e.companyName = "company-name", e))(S || {}), y = /* @__PURE__ */ ((e) => (e.xs = "xs", e.sm = "sm", e.base = "base", e.lg = "lg", e.xl = "xl", e["2xl"] = "2xl", e["3xl"] = "3xl", e["4xl"] = "4xl", e))(y || {}); | ||
const d = (e, t) => t.findIndex((s) => s === e), E = (e, t) => { | ||
const s = d(e, t); | ||
return t[s + 1]; | ||
}, N = (e, t) => { | ||
const s = d(e, t); | ||
return t[s - 1]; | ||
}, a = ({ focusables: e, event: t }) => { | ||
t == null || t.preventDefault(); | ||
const s = e[0]; | ||
return s == null || s.focus(), s; | ||
}, f = ({ focusables: e, event: t }) => { | ||
t == null || t.preventDefault(); | ||
const s = e[e.length - 1]; | ||
return s == null || s.focus(), s; | ||
}, H = (e, t) => { | ||
const s = E(e, t); | ||
return s == null || s.focus(), s; | ||
}, P = (e, t) => { | ||
const s = N(e, t); | ||
return s == null || s.focus(), s; | ||
}, O = (e, t) => d(e, t) === 0, R = (e, t) => d(e, t) === t.length - 1, W = (e, t, s) => { | ||
const n = [...s].reverse(), i = n.findIndex((o) => o === e); | ||
return n.find((o, l) => { | ||
var c; | ||
if (l > i && o.closest(t) && e.closest(t) !== o.closest(t) && ((c = n[l + 1]) == null ? void 0 : c.closest(t)) !== o.closest(t)) | ||
var b = /* @__PURE__ */ ((t) => (t.neutral = "neutral", t.secondary = "secondary", t.positive = "positive", t.warning = "warning", t.error = "error", t))(b || {}), T = /* @__PURE__ */ ((t) => (t.temporary = "temporary", t.persistent = "persistent", t))(T || {}), M = /* @__PURE__ */ ((t) => (t.sm = "sm", t.base = "base", t.lg = "lg", t))(M || {}), y = /* @__PURE__ */ ((t) => (t.primary = "primary", t.secondary = "secondary", t.tertiary = "tertiary", t))(y || {}), w = /* @__PURE__ */ ((t) => (t.sm = "sm", t.base = "base", t))(w || {}), D = /* @__PURE__ */ ((t) => (t["3xs"] = "3xs", t["2xs"] = "2xs", t.xs = "xs", t.sm = "sm", t.base = "base", t.lg = "lg", t))(D || {}), E = /* @__PURE__ */ ((t) => (t.top = "top", t.bottom = "bottom", t.left = "left", t.right = "right", t))(E || {}), N = /* @__PURE__ */ ((t) => (t.sm = "sm", t.base = "base", t.lg = "lg", t))(N || {}), H = /* @__PURE__ */ ((t) => (t.xs = "xs", t.sm = "sm", t.base = "base", t.lg = "lg", t.xl = "xl", t["2xl"] = "2xl", t["3xl"] = "3xl", t["4xl"] = "4xl", t))(H || {}), F = /* @__PURE__ */ ((t) => (t.primary = "primary", t.secondary = "secondary", t))(F || {}), O = /* @__PURE__ */ ((t) => (t.sm = "sm", t.base = "base", t.lg = "lg", t))(O || {}), W = /* @__PURE__ */ ((t) => (t.xs = "xs", t.sm = "sm", t.base = "base", t.lg = "lg", t.xl = "xl", t["2xl"] = "2xl", t["3xl"] = "3xl", t["4xl"] = "4xl", t))(W || {}), U = /* @__PURE__ */ ((t) => (t.xs = "xs", t.sm = "sm", t.base = "base", t.lg = "lg", t.xl = "xl", t["2xl"] = "2xl", t["3xl"] = "3xl", t["4xl"] = "4xl", t))(U || {}), X = /* @__PURE__ */ ((t) => (t.xs = "xs", t.sm = "sm", t.base = "base", t.lg = "lg", t.xl = "xl", t))(X || {}), Y = /* @__PURE__ */ ((t) => (t.sm = "sm", t.base = "base", t.lg = "lg", t))(Y || {}), G = /* @__PURE__ */ ((t) => (t.sm = "sm", t.base = "base", t.lg = "lg", t.xl = "xl", t))(G || {}), R = /* @__PURE__ */ ((t) => (t["top-start"] = "top-start", t.top = "top", t["top-end"] = "top-end", t["bottom-start"] = "bottom-start", t.bottom = "bottom", t["bottom-end"] = "bottom-end", t["left-start"] = "left-start", t.left = "left", t["left-end"] = "left-end", t["right-start"] = "right-start", t.right = "right", t["right-end"] = "right-end", t))(R || {}), j = /* @__PURE__ */ ((t) => (t.fixed = "fixed", t.absolute = "absolute", t))(j || {}); | ||
const d = (t, s) => s.findIndex((e) => e === t), _ = (t, s) => { | ||
const e = d(t, s); | ||
return s[e + 1]; | ||
}, $ = (t, s) => { | ||
const e = d(t, s); | ||
return s[e - 1]; | ||
}, a = ({ focusables: t, event: s }) => { | ||
s == null || s.preventDefault(); | ||
const e = t[0]; | ||
return e == null || e.focus(), e; | ||
}, g = ({ focusables: t, event: s }) => { | ||
s == null || s.preventDefault(); | ||
const e = t[t.length - 1]; | ||
return e == null || e.focus(), e; | ||
}, q = (t, s) => { | ||
const e = _(t, s); | ||
return e == null || e.focus(), e; | ||
}, C = (t, s) => { | ||
const e = $(t, s); | ||
return e == null || e.focus(), e; | ||
}, K = (t, s) => d(t, s) === 0, A = (t, s) => d(t, s) === s.length - 1, B = (t, s, e) => { | ||
const n = [...e].reverse(), r = n.findIndex((o) => o === t); | ||
return n.find((o, c) => { | ||
var l; | ||
if (c > r && o.closest(s) && t.closest(s) !== o.closest(s) && ((l = n[c + 1]) == null ? void 0 : l.closest(s)) !== o.closest(s)) | ||
return o; | ||
}); | ||
}, C = (e, t, s) => { | ||
const n = s.findIndex((i) => i === e); | ||
return s.find((i, o) => { | ||
if (o > n && i.closest(t) && e.closest(t) !== i.closest(t)) | ||
return i; | ||
}, J = (t, s, e) => { | ||
const n = e.findIndex((r) => r === t); | ||
return e.find((r, o) => { | ||
if (o > n && r.closest(s) && t.closest(s) !== r.closest(s)) | ||
return r; | ||
}); | ||
}, U = ({ | ||
current: e, | ||
focusables: t, | ||
arrowFocusGroupSelector: s | ||
}, Q = ({ | ||
current: t, | ||
focusables: s, | ||
arrowFocusGroupSelector: e | ||
}) => { | ||
if (!e) | ||
return a({ focusables: t }); | ||
const n = C(e, s, t); | ||
return e && n ? (n == null || n.focus(), n) : a({ focusables: t }); | ||
}, X = ({ | ||
current: e, | ||
focusables: t, | ||
arrowFocusGroupSelector: s | ||
if (!t) | ||
return a({ focusables: s }); | ||
const n = J(t, e, s); | ||
return t && n ? (n == null || n.focus(), n) : a({ focusables: s }); | ||
}, Z = ({ | ||
current: t, | ||
focusables: s, | ||
arrowFocusGroupSelector: e | ||
}) => { | ||
if (!e) | ||
return a({ focusables: t }); | ||
const n = W(e, s, t); | ||
return e && n ? (n == null || n.focus(), n) : f({ focusables: t }); | ||
}, Y = ({ | ||
current: e, | ||
focusables: t, | ||
event: s | ||
if (!t) | ||
return a({ focusables: s }); | ||
const n = B(t, e, s); | ||
return t && n ? (n == null || n.focus(), n) : g({ focusables: s }); | ||
}, k = ({ | ||
current: t, | ||
focusables: s, | ||
event: e | ||
}) => { | ||
if (h && (s == null || s.preventDefault()), e) { | ||
if (R(e, t)) | ||
return a({ focusables: t, event: s }); | ||
if (h || !s) | ||
return H(e, t); | ||
if (h && (e == null || e.preventDefault()), t) { | ||
if (A(t, s)) | ||
return a({ focusables: s, event: e }); | ||
if (h || !e) | ||
return q(t, s); | ||
} else | ||
return a({ focusables: t, event: s }); | ||
}, G = ({ | ||
current: e, | ||
focusables: t, | ||
event: s | ||
return a({ focusables: s, event: e }); | ||
}, V = ({ | ||
current: t, | ||
focusables: s, | ||
event: e | ||
}) => { | ||
if (h && (s == null || s.preventDefault()), e) { | ||
if (O(e, t)) | ||
return f({ focusables: t, event: s }); | ||
if (h || !s) | ||
return P(e, t); | ||
if (h && (e == null || e.preventDefault()), t) { | ||
if (K(t, s)) | ||
return g({ focusables: s, event: e }); | ||
if (h || !e) | ||
return C(t, s); | ||
} else | ||
return f({ focusables: t, event: s }); | ||
}, A = ({ | ||
current: e, | ||
event: t, | ||
return g({ focusables: s, event: e }); | ||
}, ot = ({ | ||
current: t, | ||
event: s, | ||
focusables: e, | ||
arrowFocusGroupSelector: n | ||
}) => n ? Q({ current: t, focusables: e, arrowFocusGroupSelector: n }) : k({ current: t, focusables: e, event: s }), lt = ({ | ||
current: t, | ||
focusables: s, | ||
event: e, | ||
arrowFocusGroupSelector: n | ||
}) => n ? U({ current: e, focusables: s, arrowFocusGroupSelector: n }) : Y({ current: e, focusables: s, event: t }), J = ({ | ||
current: e, | ||
focusables: t, | ||
event: s, | ||
arrowFocusGroupSelector: n | ||
}) => n ? X({ current: e, focusables: t, arrowFocusGroupSelector: n }) : G({ current: e, focusables: t, event: s }); | ||
}) => n ? Z({ current: t, focusables: s, arrowFocusGroupSelector: n }) : V({ current: t, focusables: s, event: e }); | ||
export { | ||
j as VSFScrollable, | ||
w as VsfAlertType, | ||
M as VsfAlertVariant, | ||
T as VsfFooterColumnType, | ||
S as VsfFooterLabelType, | ||
D as VsfFooterSectionType, | ||
y as VsfLoaderSize, | ||
F as clamp, | ||
x as equal, | ||
z as SFScrollable, | ||
T as SfAlertType, | ||
b as SfAlertVariant, | ||
M as SfButtonSize, | ||
y as SfButtonVariant, | ||
w as SfChipSize, | ||
D as SfCounterSize, | ||
E as SfDrawerPlacement, | ||
H as SfIconSize, | ||
N as SfInputSize, | ||
F as SfLinkVariant, | ||
O as SfListItemSize, | ||
W as SfLoaderSize, | ||
R as SfPopoverPlacement, | ||
j as SfPopoverStrategy, | ||
U as SfProgressSize, | ||
X as SfRatingSize, | ||
Y as SfSelectSize, | ||
G as SfThumbnailSize, | ||
rt as clamp, | ||
I as equal, | ||
d as findCurrentFocusableIndex, | ||
E as findNextFocusable, | ||
N as findPrevFocusable, | ||
_ as findNextFocusable, | ||
$ as findPrevFocusable, | ||
a as focusFirstElement, | ||
f as focusLastElement, | ||
A as focusNext, | ||
H as focusNextElement, | ||
Y as focusNextOrFirst, | ||
J as focusPrev, | ||
P as focusPrevElement, | ||
G as focusPrevOrLast, | ||
_ as generateId, | ||
g as isBrowser, | ||
O as isCurrentFirstElement, | ||
R as isCurrentLastElement, | ||
z as isReduceMotionEnabled, | ||
g as focusLastElement, | ||
ot as focusNext, | ||
q as focusNextElement, | ||
k as focusNextOrFirst, | ||
lt as focusPrev, | ||
C as focusPrevElement, | ||
V as focusPrevOrLast, | ||
tt as generateId, | ||
p as isBrowser, | ||
K as isCurrentFirstElement, | ||
A as isCurrentLastElement, | ||
S as isReduceMotionEnabled, | ||
h as isSafari, | ||
q as isTab, | ||
$ as isTabAndShift, | ||
K as noop, | ||
B as progressSvgSizes, | ||
k as roundToNearest | ||
et as isTab, | ||
st as isTabAndShift, | ||
nt as noop, | ||
it as roundToNearest | ||
}; |
@@ -1,1 +0,1 @@ | ||
(function(i,c){typeof exports=="object"&&typeof module<"u"?c(exports):typeof define=="function"&&define.amd?define(["exports"],c):(i=typeof globalThis<"u"?globalThis:i||self,c(i["storefront-ui-shared"]={}))})(this,function(i){"use strict";var k=Object.defineProperty;var J=(i,c,a)=>c in i?k(i,c,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[c]=a;var o=(i,c,a)=>(J(i,typeof c!="symbol"?c+"":c,a),a);const c={xs:{icon:16,r:7.2,dash:45.216},sm:{icon:20,r:9,dash:56.52},base:{icon:24,r:11,dash:69.08},lg:{icon:32,r:14.67,dash:92.127},xl:{icon:40,r:19,dash:119.32},"2xl":{icon:56,r:26,dash:163.28},"3xl":{icon:96,r:44,dash:276.32},"4xl":{icon:192,r:88,dash:552.64}},a={reduceMotion:!1,snap:!1,drag:void 0,vertical:!1},L="vsf-scrollable__container--dragging";class F{constructor(t,n){o(this,"container");o(this,"options");o(this,"debounceId");o(this,"isDragged");o(this,"dragScrollX");o(this,"dragScrollLeft");o(this,"dragScrollY");o(this,"dragScrollTop");o(this,"scrollListenerInstance",()=>{});o(this,"resizeListenerInstance",()=>{});o(this,"mouseDownListenerInstance",()=>{});o(this,"mouseUpListenerInstance",()=>{});o(this,"mouseMoveListenerInstance",()=>{});o(this,"mouseLeaveListenerInstance",()=>{});if(!(t instanceof HTMLElement))throw new Error(`VsfScrollable: Container is not a HTMLElement! Received: ${t}`);this.container=t,this.options={...a,...n},this.dragScrollX=0,this.dragScrollLeft=0,this.dragScrollY=0,this.dragScrollTop=0,this.init()}init(){this.addListeners(),this.onScrollHandler()}update(t){this.options={...a,...t},this.removeListeners(),this.init()}destroy(){this.removeListeners()}prev(){const{container:t,options:n}=this;n.vertical?this.scrollTo({top:t.scrollTop-t.clientHeight}):this.scrollTo({left:t.scrollLeft-t.clientWidth})}next(){const{container:t,options:n}=this;n.vertical?this.scrollTo({top:t.scrollTop+t.clientHeight}):this.scrollTo({left:t.scrollLeft+t.clientWidth})}scrollToIndex(t){const n=this.children();if(n[t]){const{container:s}=this,r=n[t].getBoundingClientRect(),l=r.left-s.getBoundingClientRect().left,u=r.top-s.getBoundingClientRect().top,d=s.clientWidth/2-r.width/2,K=s.clientHeight/2-r.height/2;this.options.vertical?this.scrollTo({top:s.scrollTop+u-K}):this.scrollTo({left:s.scrollLeft+l-d})}}refresh(t){requestAnimationFrame(()=>{const n=this.calculate();t==null||t(n)})}onMouseUp(){this.isDragged=!1,setTimeout(()=>{this.container.classList.remove(L)},50)}onMouseLeave(){this.isDragged=!1,this.container.classList.remove(L)}onMouseDown(t){t.preventDefault();const{container:n,options:s}=this;this.isDragged=!0,n.classList.add(L),s.vertical?(this.dragScrollY=t.pageY-n.offsetTop,this.dragScrollTop=n.scrollTop):(this.dragScrollX=t.pageX-n.offsetLeft,this.dragScrollLeft=n.scrollLeft)}onMouseMove(t){var l;if(!this.isDragged)return;t.preventDefault();const n=((l=this.options.drag)==null?void 0:l.sensitivity)??4,{container:s,options:r}=this;if(r.vertical){const d=(t.pageY-s.offsetTop-this.dragScrollY)*n;s.scrollTop=this.dragScrollTop-d}else{const d=(t.pageX-s.offsetLeft-this.dragScrollX)*n;s.scrollLeft=this.dragScrollLeft-d}}addListeners(){this.scrollListenerInstance=this.onScroll.bind(this),this.resizeListenerInstance=this.onResize.bind(this),this.container.addEventListener("scroll",this.scrollListenerInstance,{passive:!0}),window.addEventListener("resize",this.resizeListenerInstance),this.options.drag&&(this.mouseDownListenerInstance=this.onMouseDown.bind(this),this.mouseUpListenerInstance=this.onMouseUp.bind(this),this.mouseMoveListenerInstance=this.onMouseMove.bind(this),this.mouseLeaveListenerInstance=this.onMouseLeave.bind(this),this.container.addEventListener("mousedown",this.mouseDownListenerInstance,{passive:!1}),this.container.addEventListener("mouseup",this.mouseUpListenerInstance,{passive:!0}),this.container.addEventListener("mousemove",this.mouseMoveListenerInstance,{passive:!1}),this.container.addEventListener("mouseleave",this.mouseLeaveListenerInstance,{passive:!0}))}removeListeners(){this.container.removeEventListener("scroll",this.scrollListenerInstance),window.removeEventListener("resize",this.resizeListenerInstance),this.options.drag||(this.container.removeEventListener("mousedown",this.mouseDownListenerInstance),this.container.removeEventListener("mouseup",this.mouseUpListenerInstance),this.container.removeEventListener("mousemove",this.mouseMoveListenerInstance),this.container.removeEventListener("mouseleave",this.mouseLeaveListenerInstance))}children(){return this.container.children}scrollTo({left:t,top:n}){const s=this.options.reduceMotion?"auto":"smooth";this.container.scrollTo({left:t,top:n,behavior:s})}onScroll(){this.container&&(clearTimeout(this.debounceId),this.debounceId=setTimeout(this.onScrollHandler.bind(this),50))}onResize(){this.container&&this.refresh(n=>{var s,r;return(r=(s=this.options).onScroll)==null?void 0:r.call(s,n)})}onScrollHandler(){this.refresh(t=>{var n,s;return(s=(n=this.options).onScroll)==null?void 0:s.call(n,t)})}calculate(){const{container:t,options:n}=this;function s(){return n.vertical?t.scrollHeight>Math.ceil(t.scrollTop)+t.clientHeight:t.scrollWidth>Math.ceil(t.scrollLeft)+t.clientWidth}function r(){return n.vertical?!!t.scrollTop:!!t.scrollLeft}return{left:t.scrollLeft,width:t.clientWidth,scrollWidth:t.scrollWidth,hasPrev:r(),hasNext:s()}}}const v=typeof window<"u",H=v&&(window==null?void 0:window.matchMedia("(prefers-reduced-motion: reduce)").matches),f=v&&/^((?!chrome|android).)*safari/i.test(navigator==null?void 0:navigator.userAgent);let R=-1;const W=e=>`vsf-${e}--${++R}`,U=e=>e.key==="Tab"&&e.shiftKey,X=e=>e.key==="Tab"&&!e.shiftKey,Y=()=>{};function j(e,t,n){return Math.min(Math.max(e,t),n)}function z(e,t){return Math.round(e/t)*t}function p(e,t){if(e===t)return!0;const n=typeof e;if(n!==typeof t)return!1;if(n==="object"&&e!==null&&t!==null){if(e.length!==t.length||Object.getOwnPropertyNames(e).length!==Object.getOwnPropertyNames(t).length)return!1;for(const r in e)if(!p(e[r],t[r]))return!1}else return n==="function"?e.toString()===t.toString():!1;return!0}var I=(e=>(e.gray="gray",e.secondary="secondary",e.positive="positive",e.warning="warning",e.error="error",e))(I||{}),T=(e=>(e.temporary="temporary",e.persistent="persistent",e))(T||{}),M=(e=>(e.top="top",e.middle="middle",e))(M||{}),S=(e=>(e.top="top",e.middle="middle",e.bottom="bottom",e))(S||{}),w=(e=>(e.category="category",e.subcategory="subcategory",e.contact="contact",e.contactDescription="contact-description",e.socialMedia="social-media",e.bottomLinks="bottom-links",e.companyName="company-name",e))(w||{}),y=(e=>(e.xs="xs",e.sm="sm",e.base="base",e.lg="lg",e.xl="xl",e["2xl"]="2xl",e["3xl"]="3xl",e["4xl"]="4xl",e))(y||{});const m=(e,t)=>t.findIndex(n=>n===e),E=(e,t)=>{const n=m(e,t);return t[n+1]},D=(e,t)=>{const n=m(e,t);return t[n-1]},h=({focusables:e,event:t})=>{t==null||t.preventDefault();const n=e[0];return n==null||n.focus(),n},g=({focusables:e,event:t})=>{t==null||t.preventDefault();const n=e[e.length-1];return n==null||n.focus(),n},N=(e,t)=>{const n=E(e,t);return n==null||n.focus(),n},b=(e,t)=>{const n=D(e,t);return n==null||n.focus(),n},P=(e,t)=>m(e,t)===0,x=(e,t)=>m(e,t)===t.length-1,B=(e,t,n)=>{const s=[...n].reverse(),r=s.findIndex(l=>l===e);return s.find((l,u)=>{var d;if(u>r&&l.closest(t)&&e.closest(t)!==l.closest(t)&&((d=s[u+1])==null?void 0:d.closest(t))!==l.closest(t))return l})},G=(e,t,n)=>{const s=n.findIndex(r=>r===e);return n.find((r,l)=>{if(l>s&&r.closest(t)&&e.closest(t)!==r.closest(t))return r})},q=({current:e,focusables:t,arrowFocusGroupSelector:n})=>{if(!e)return h({focusables:t});const s=G(e,n,t);return e&&s?(s==null||s.focus(),s):h({focusables:t})},A=({current:e,focusables:t,arrowFocusGroupSelector:n})=>{if(!e)return h({focusables:t});const s=B(e,n,t);return e&&s?(s==null||s.focus(),s):g({focusables:t})},O=({current:e,focusables:t,event:n})=>{if(f&&(n==null||n.preventDefault()),e){if(x(e,t))return h({focusables:t,event:n});if(f||!n)return N(e,t)}else return h({focusables:t,event:n})},C=({current:e,focusables:t,event:n})=>{if(f&&(n==null||n.preventDefault()),e){if(P(e,t))return g({focusables:t,event:n});if(f||!n)return b(e,t)}else return g({focusables:t,event:n})},_=({current:e,event:t,focusables:n,arrowFocusGroupSelector:s})=>s?q({current:e,focusables:n,arrowFocusGroupSelector:s}):O({current:e,focusables:n,event:t}),$=({current:e,focusables:t,event:n,arrowFocusGroupSelector:s})=>s?A({current:e,focusables:t,arrowFocusGroupSelector:s}):C({current:e,focusables:t,event:n});i.VSFScrollable=F,i.VsfAlertType=T,i.VsfAlertVariant=I,i.VsfFooterColumnType=M,i.VsfFooterLabelType=w,i.VsfFooterSectionType=S,i.VsfLoaderSize=y,i.clamp=j,i.equal=p,i.findCurrentFocusableIndex=m,i.findNextFocusable=E,i.findPrevFocusable=D,i.focusFirstElement=h,i.focusLastElement=g,i.focusNext=_,i.focusNextElement=N,i.focusNextOrFirst=O,i.focusPrev=$,i.focusPrevElement=b,i.focusPrevOrLast=C,i.generateId=W,i.isBrowser=v,i.isCurrentFirstElement=P,i.isCurrentLastElement=x,i.isReduceMotionEnabled=H,i.isSafari=f,i.isTab=X,i.isTabAndShift=U,i.noop=Y,i.progressSvgSizes=c,i.roundToNearest=z,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}); | ||
(function(n,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(n=typeof globalThis<"u"?globalThis:n||self,l(n["storefront-ui-shared"]={}))})(this,function(n){"use strict";var ot=Object.defineProperty;var lt=(n,l,a)=>l in n?ot(n,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[l]=a;var o=(n,l,a)=>(lt(n,typeof l!="symbol"?l+"":l,a),a);const l={reduceMotion:!1,snap:!1,drag:void 0,vertical:!1},a="sf-scrollable__container--dragging";class ${constructor(e,s){o(this,"container");o(this,"options");o(this,"debounceId");o(this,"isDragged");o(this,"dragScrollX");o(this,"dragScrollLeft");o(this,"dragScrollY");o(this,"dragScrollTop");o(this,"scrollListenerInstance",()=>{});o(this,"resizeListenerInstance",()=>{});o(this,"mouseDownListenerInstance",()=>{});o(this,"mouseUpListenerInstance",()=>{});o(this,"mouseMoveListenerInstance",()=>{});o(this,"mouseLeaveListenerInstance",()=>{});if(!(e instanceof HTMLElement))throw new Error(`SfScrollable: Container is not a HTMLElement! Received: ${e}`);this.container=e,this.options={...l,...s},this.dragScrollX=0,this.dragScrollLeft=0,this.dragScrollY=0,this.dragScrollTop=0,this.init()}init(){this.addListeners(),this.onScrollHandler()}update(e){this.options={...l,...e},this.removeListeners(),this.init()}destroy(){this.removeListeners()}prev(){const{container:e,options:s}=this;s.vertical?this.scrollTo({top:e.scrollTop-e.clientHeight}):this.scrollTo({left:e.scrollLeft-e.clientWidth})}next(){const{container:e,options:s}=this;s.vertical?this.scrollTo({top:e.scrollTop+e.clientHeight}):this.scrollTo({left:e.scrollLeft+e.clientWidth})}scrollToIndex(e){const s=this.children();if(s[e]){const{container:r}=this,i=s[e].getBoundingClientRect(),c=i.left-r.getBoundingClientRect().left,h=i.top-r.getBoundingClientRect().top,d=r.clientWidth/2-i.width/2,it=r.clientHeight/2-i.height/2;this.options.vertical?this.scrollTo({top:r.scrollTop+h-it}):this.scrollTo({left:r.scrollLeft+c-d})}}refresh(e){requestAnimationFrame(()=>{const s=this.calculate();e==null||e(s)})}onMouseUp(){this.isDragged=!1,setTimeout(()=>{this.container.classList.remove(a)},50)}onMouseLeave(){this.isDragged=!1,this.container.classList.remove(a)}onMouseDown(e){e.preventDefault();const{container:s,options:r}=this;this.isDragged=!0,s.classList.add(a),r.vertical?(this.dragScrollY=e.pageY-s.offsetTop,this.dragScrollTop=s.scrollTop):(this.dragScrollX=e.pageX-s.offsetLeft,this.dragScrollLeft=s.scrollLeft)}onMouseMove(e){var c;if(!this.isDragged)return;e.preventDefault();const s=((c=this.options.drag)==null?void 0:c.sensitivity)??4,{container:r,options:i}=this;if(i.vertical){const d=(e.pageY-r.offsetTop-this.dragScrollY)*s;r.scrollTop=this.dragScrollTop-d}else{const d=(e.pageX-r.offsetLeft-this.dragScrollX)*s;r.scrollLeft=this.dragScrollLeft-d}}addListeners(){this.scrollListenerInstance=this.onScroll.bind(this),this.resizeListenerInstance=this.onResize.bind(this),this.container.addEventListener("scroll",this.scrollListenerInstance,{passive:!0}),window.addEventListener("resize",this.resizeListenerInstance),this.options.drag&&(this.mouseDownListenerInstance=this.onMouseDown.bind(this),this.mouseUpListenerInstance=this.onMouseUp.bind(this),this.mouseMoveListenerInstance=this.onMouseMove.bind(this),this.mouseLeaveListenerInstance=this.onMouseLeave.bind(this),this.container.addEventListener("mousedown",this.mouseDownListenerInstance,{passive:!1}),this.container.addEventListener("mouseup",this.mouseUpListenerInstance,{passive:!0}),this.container.addEventListener("mousemove",this.mouseMoveListenerInstance,{passive:!1}),this.container.addEventListener("mouseleave",this.mouseLeaveListenerInstance,{passive:!0}))}removeListeners(){this.container.removeEventListener("scroll",this.scrollListenerInstance),window.removeEventListener("resize",this.resizeListenerInstance),this.options.drag||(this.container.removeEventListener("mousedown",this.mouseDownListenerInstance),this.container.removeEventListener("mouseup",this.mouseUpListenerInstance),this.container.removeEventListener("mousemove",this.mouseMoveListenerInstance),this.container.removeEventListener("mouseleave",this.mouseLeaveListenerInstance))}children(){return this.container.children}scrollTo({left:e,top:s}){const r=this.options.reduceMotion?"auto":"smooth";this.container.scrollTo({left:e,top:s,behavior:r})}onScroll(){this.container&&(clearTimeout(this.debounceId),this.debounceId=setTimeout(this.onScrollHandler.bind(this),50))}onResize(){this.container&&this.refresh(s=>{var r,i;return(i=(r=this.options).onScroll)==null?void 0:i.call(r,s)})}onScrollHandler(){this.refresh(e=>{var s,r;return(r=(s=this.options).onScroll)==null?void 0:r.call(s,e)})}calculate(){const{container:e,options:s}=this;function r(){return s.vertical?e.scrollHeight>Math.ceil(e.scrollTop)+e.clientHeight:e.scrollWidth>Math.ceil(e.scrollLeft)+e.clientWidth}function i(){return s.vertical?!!e.scrollTop:!!e.scrollLeft}return{left:e.scrollLeft,width:e.clientWidth,scrollWidth:e.scrollWidth,hasPrev:i(),hasNext:r()}}}const L=typeof window<"u",K=L&&(window==null?void 0:window.matchMedia("(prefers-reduced-motion: reduce)").matches),f=L&&/^((?!chrome|android).)*safari/i.test(navigator==null?void 0:navigator.userAgent);let J=-1;const Q=t=>`sf-${t}--${++J}`,Z=t=>t.key==="Tab"&&t.shiftKey,k=t=>t.key==="Tab"&&!t.shiftKey,V=()=>{};function P(t,e,s){return Math.min(Math.max(t,e),s)}function z(t,e){return Math.round(t/e)*e}function v(t,e){if(t===e)return!0;const s=typeof t;if(s!==typeof e)return!1;if(s==="object"&&t!==null&&e!==null){if(t.length!==e.length||Object.getOwnPropertyNames(t).length!==Object.getOwnPropertyNames(e).length)return!1;for(const i in t)if(!v(t[i],e[i]))return!1}else return s==="function"?t.toString()===e.toString():!1;return!0}var b=(t=>(t.neutral="neutral",t.secondary="secondary",t.positive="positive",t.warning="warning",t.error="error",t))(b||{}),p=(t=>(t.temporary="temporary",t.persistent="persistent",t))(p||{}),I=(t=>(t.sm="sm",t.base="base",t.lg="lg",t))(I||{}),T=(t=>(t.primary="primary",t.secondary="secondary",t.tertiary="tertiary",t))(T||{}),x=(t=>(t.sm="sm",t.base="base",t))(x||{}),y=(t=>(t["3xs"]="3xs",t["2xs"]="2xs",t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t))(y||{}),M=(t=>(t.top="top",t.bottom="bottom",t.left="left",t.right="right",t))(M||{}),w=(t=>(t.sm="sm",t.base="base",t.lg="lg",t))(w||{}),E=(t=>(t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t["2xl"]="2xl",t["3xl"]="3xl",t["4xl"]="4xl",t))(E||{}),F=(t=>(t.primary="primary",t.secondary="secondary",t))(F||{}),N=(t=>(t.sm="sm",t.base="base",t.lg="lg",t))(N||{}),D=(t=>(t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t["2xl"]="2xl",t["3xl"]="3xl",t["4xl"]="4xl",t))(D||{}),O=(t=>(t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t["2xl"]="2xl",t["3xl"]="3xl",t["4xl"]="4xl",t))(O||{}),H=(t=>(t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t))(H||{}),W=(t=>(t.sm="sm",t.base="base",t.lg="lg",t))(W||{}),C=(t=>(t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t))(C||{}),R=(t=>(t["top-start"]="top-start",t.top="top",t["top-end"]="top-end",t["bottom-start"]="bottom-start",t.bottom="bottom",t["bottom-end"]="bottom-end",t["left-start"]="left-start",t.left="left",t["left-end"]="left-end",t["right-start"]="right-start",t.right="right",t["right-end"]="right-end",t))(R||{}),U=(t=>(t.fixed="fixed",t.absolute="absolute",t))(U||{});const m=(t,e)=>e.findIndex(s=>s===t),X=(t,e)=>{const s=m(t,e);return e[s+1]},Y=(t,e)=>{const s=m(t,e);return e[s-1]},u=({focusables:t,event:e})=>{e==null||e.preventDefault();const s=t[0];return s==null||s.focus(),s},g=({focusables:t,event:e})=>{e==null||e.preventDefault();const s=t[t.length-1];return s==null||s.focus(),s},j=(t,e)=>{const s=X(t,e);return s==null||s.focus(),s},G=(t,e)=>{const s=Y(t,e);return s==null||s.focus(),s},q=(t,e)=>m(t,e)===0,A=(t,e)=>m(t,e)===e.length-1,S=(t,e,s)=>{const r=[...s].reverse(),i=r.findIndex(c=>c===t);return r.find((c,h)=>{var d;if(h>i&&c.closest(e)&&t.closest(e)!==c.closest(e)&&((d=r[h+1])==null?void 0:d.closest(e))!==c.closest(e))return c})},tt=(t,e,s)=>{const r=s.findIndex(i=>i===t);return s.find((i,c)=>{if(c>r&&i.closest(e)&&t.closest(e)!==i.closest(e))return i})},et=({current:t,focusables:e,arrowFocusGroupSelector:s})=>{if(!t)return u({focusables:e});const r=tt(t,s,e);return t&&r?(r==null||r.focus(),r):u({focusables:e})},st=({current:t,focusables:e,arrowFocusGroupSelector:s})=>{if(!t)return u({focusables:e});const r=S(t,s,e);return t&&r?(r==null||r.focus(),r):g({focusables:e})},B=({current:t,focusables:e,event:s})=>{if(f&&(s==null||s.preventDefault()),t){if(A(t,e))return u({focusables:e,event:s});if(f||!s)return j(t,e)}else return u({focusables:e,event:s})},_=({current:t,focusables:e,event:s})=>{if(f&&(s==null||s.preventDefault()),t){if(q(t,e))return g({focusables:e,event:s});if(f||!s)return G(t,e)}else return g({focusables:e,event:s})},nt=({current:t,event:e,focusables:s,arrowFocusGroupSelector:r})=>r?et({current:t,focusables:s,arrowFocusGroupSelector:r}):B({current:t,focusables:s,event:e}),rt=({current:t,focusables:e,event:s,arrowFocusGroupSelector:r})=>r?st({current:t,focusables:e,arrowFocusGroupSelector:r}):_({current:t,focusables:e,event:s});n.SFScrollable=$,n.SfAlertType=p,n.SfAlertVariant=b,n.SfButtonSize=I,n.SfButtonVariant=T,n.SfChipSize=x,n.SfCounterSize=y,n.SfDrawerPlacement=M,n.SfIconSize=E,n.SfInputSize=w,n.SfLinkVariant=F,n.SfListItemSize=N,n.SfLoaderSize=D,n.SfPopoverPlacement=R,n.SfPopoverStrategy=U,n.SfProgressSize=O,n.SfRatingSize=H,n.SfSelectSize=W,n.SfThumbnailSize=C,n.clamp=P,n.equal=v,n.findCurrentFocusableIndex=m,n.findNextFocusable=X,n.findPrevFocusable=Y,n.focusFirstElement=u,n.focusLastElement=g,n.focusNext=nt,n.focusNextElement=j,n.focusNextOrFirst=B,n.focusPrev=rt,n.focusPrevElement=G,n.focusPrevOrLast=_,n.generateId=Q,n.isBrowser=L,n.isCurrentFirstElement=q,n.isCurrentLastElement=A,n.isReduceMotionEnabled=K,n.isSafari=f,n.isTab=k,n.isTabAndShift=Z,n.noop=V,n.roundToNearest=z,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}); |
@@ -1,4 +0,4 @@ | ||
import VSFScrollable from './scrollable'; | ||
import SFScrollable from './scrollable'; | ||
export * from './types'; | ||
export { VSFScrollable }; | ||
export { SFScrollable }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import type { VsfScrollableOptions, VsfScrollableCallbackData } from './types'; | ||
export default class VSFScrollable { | ||
import type { SfScrollableOptions, SfScrollableCallbackData } from './types'; | ||
export default class SFScrollable { | ||
container: HTMLElement; | ||
@@ -17,5 +17,5 @@ private options; | ||
private mouseLeaveListenerInstance; | ||
constructor(container: Element, VsfScrollableOptions?: Partial<VsfScrollableOptions>); | ||
constructor(container: Element, SfScrollableOptions?: Partial<SfScrollableOptions>); | ||
init(): void; | ||
update(VsfScrollableOptions?: Partial<VsfScrollableOptions>): void; | ||
update(SfScrollableOptions?: Partial<SfScrollableOptions>): void; | ||
destroy(): void; | ||
@@ -25,3 +25,3 @@ prev(): void; | ||
scrollToIndex(index: number): void; | ||
refresh(callback?: (data: VsfScrollableCallbackData) => void): void; | ||
refresh(callback?: (data: SfScrollableCallbackData) => void): void; | ||
private onMouseUp; | ||
@@ -28,0 +28,0 @@ private onMouseLeave; |
@@ -1,2 +0,2 @@ | ||
export type VsfScrollableOptions = { | ||
export type SfScrollableOptions = { | ||
reduceMotion?: boolean; | ||
@@ -8,5 +8,5 @@ snap?: boolean; | ||
vertical?: boolean; | ||
onScroll?: (data: VsfScrollableCallbackData) => void; | ||
onScroll?: (data: SfScrollableCallbackData) => void; | ||
}; | ||
export type VsfScrollableCallbackData = { | ||
export type SfScrollableCallbackData = { | ||
left: number; | ||
@@ -13,0 +13,0 @@ width: number; |
@@ -1,4 +0,17 @@ | ||
export * from './VsfAlert'; | ||
export * from './VsfFooter'; | ||
export * from './VsfLoader'; | ||
export * from './SfAlert'; | ||
export * from './SfButton'; | ||
export * from './SfChip'; | ||
export * from './SfCounter'; | ||
export * from './SfDrawer'; | ||
export * from './SfInput'; | ||
export * from './SfIconBase'; | ||
export * from './SfLink'; | ||
export * from './SfListItem'; | ||
export * from './SfLoader'; | ||
export * from './SfProgress'; | ||
export * from './SfRating'; | ||
export * from './SfSelect'; | ||
export * from './SfThumbnail'; | ||
export * from './usePopover'; | ||
export * from './utils'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@storefront-ui/shared", | ||
"description": "Shared set of utils and typings used by `@storefront-ui/*` packages", | ||
"version": "2.0.0-rc.3", | ||
"version": "2.0.0-rc.4", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
@@ -19,12 +20,5 @@ "exports": { | ||
"dev": "vite build --watch", | ||
"dev:shared": "vite build --watch", | ||
"build:shared": "vite build" | ||
}, | ||
"homepage": "https://docs.storefrontui.io/v2/", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/vuestorefront/sfui2.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/vuestorefront/sfui2/issues" | ||
}, | ||
"devDependencies": { | ||
@@ -41,5 +35,13 @@ "tabbable": "^6.1.1", | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
] | ||
"dist" | ||
], | ||
"homepage": "https://docs.storefrontui.io/v2/", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/vuestorefront/sfui2.git", | ||
"directory": "packages/sfui/shared" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/vuestorefront/sfui2/issues" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
44298
63
0
612
1