quirk-ui 0.0.279 → 0.0.280

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.
@@ -27,7 +27,7 @@ function Ut({
27
27
  siblingRef: h,
28
28
  isSplit: z = !1
29
29
  }) {
30
- const [f, p] = o(0), [a, x] = o(0), [v, I] = o(0), [i, nt] = o(u), [_, st] = o(!1), [Y, ot] = o(Z), [$, ct] = o(!1), rt = y(null), d = y(null), w = y(null), E = et, [M, N] = o(!1), [B, j] = o(null), [X, U] = o(null), [G, H] = o(null), [at, O] = o(!1), [C, V] = o(null), [T, q] = o(null), lt = (t) => {
30
+ const [f, p] = o(0), [a, x] = o(0), [v, I] = o(0), [l, nt] = o(u), [_, st] = o(!1), [Y, ot] = o(Z), [$, ct] = o(!1), rt = y(null), d = y(null), w = y(null), E = et, [M, N] = o(!1), [B, j] = o(null), [X, U] = o(null), [G, H] = o(null), [at, O] = o(!1), [C, V] = o(null), [T, q] = o(null), lt = (t) => {
31
31
  Math.abs((T ?? 0) - (C ?? 0)) > 25 && (t.stopPropagation(), t.preventDefault());
32
32
  }, it = (t) => {
33
33
  V(t.clientX);
@@ -51,8 +51,8 @@ function Ut({
51
51
  const t = F.current;
52
52
  if (!t) return;
53
53
  const e = (n) => {
54
- const s = n.touches[0].clientX - (X ?? 0), l = n.touches[0].clientY - (B ?? 0);
55
- !M && Math.abs(s) > Math.abs(l) && N(!0), M && (n.preventDefault(), H(n.touches[0].clientX));
54
+ const s = n.touches[0].clientX - (X ?? 0), i = n.touches[0].clientY - (B ?? 0);
55
+ !M && Math.abs(s) > Math.abs(i) && N(!0), M && (n.preventDefault(), H(n.touches[0].clientX));
56
56
  };
57
57
  return t.addEventListener("touchmove", e), () => {
58
58
  t.removeEventListener("touchmove", e);
@@ -79,7 +79,7 @@ function Ut({
79
79
  return t(), window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
80
80
  }
81
81
  }, [u]);
82
- const A = Math.ceil(i / Q), J = vt(m, i), g = J.length, _t = 3 * 16, gt = 3 * 16, mt = $t(
82
+ const A = Math.ceil(l / Q), J = vt(m, l), g = J.length, _t = 3 * 16, gt = 3 * 16, mt = $t(
83
83
  (t) => {
84
84
  if (t && !$) {
85
85
  const e = t.getBoundingClientRect().width;
@@ -97,11 +97,11 @@ function Ut({
97
97
  }, [a, $, v]), k(() => {
98
98
  const t = new ResizeObserver((e) => {
99
99
  var n, s;
100
- for (let l of e)
101
- if (l.contentRect) {
102
- _ ? x(l.contentRect.width - gt) : z ? h != null && h.current ? x(
103
- l.contentRect.width - ((n = h == null ? void 0 : h.current) == null ? void 0 : n.offsetWidth) - _t
104
- ) : x(l.contentRect.width) : (x(l.contentRect.width), I(
100
+ for (let i of e)
101
+ if (i.contentRect) {
102
+ _ ? x(i.contentRect.width - gt) : z ? h != null && h.current ? x(
103
+ i.contentRect.width - ((n = h == null ? void 0 : h.current) == null ? void 0 : n.offsetWidth) - _t
104
+ ) : x(i.contentRect.width) : (x(i.contentRect.width), I(
105
105
  ((s = d == null ? void 0 : d.current) == null ? void 0 : s.children[0].children[0].children[0].getBoundingClientRect().width) ?? 0
106
106
  ));
107
107
  const b = _ ? 1 : u;
@@ -130,7 +130,7 @@ function Ut({
130
130
  w.current && clearInterval(w.current);
131
131
  }), [Y, R, K]);
132
132
  const Ct = {
133
- "--max-item-width": `${(a - (i - 1) * 16) / i}px`
133
+ "--max-item-width": `${(a - (l - 1) * 16) / l}px`
134
134
  //Container minus gaps (dynamicItemsPerPage - 1 * gap size) divided by dynamicItemsPerPage
135
135
  };
136
136
  return /* @__PURE__ */ P("div", { className: `${tt ?? ""} ${c.carousel}`, ref: rt, children: [
@@ -163,7 +163,7 @@ function Ut({
163
163
  style: {
164
164
  display: A > 1 ? "grid" : "flex",
165
165
  gridTemplateColumns: `repeat(${Math.ceil(
166
- i / A
166
+ l / A
167
167
  )}, 1fr)`,
168
168
  gridTemplateRows: `repeat(${A}, auto)`,
169
169
  width: `${a}px`
@@ -175,8 +175,8 @@ function Ut({
175
175
  onClickCapture: lt,
176
176
  style: {
177
177
  ...Ct,
178
- flexBasis: _ ? "100%" : "unset",
179
- width: _ ? `${a / i - 16}px` : "unset"
178
+ flexBasis: _ ? "100%" : `${(a - (l - 1) * 16) / l}px`,
179
+ width: _ ? `${a / l - 16}px` : "unset"
180
180
  },
181
181
  children: n
182
182
  },
@@ -223,7 +223,7 @@ function Ut({
223
223
  "aria-label": "Next slide",
224
224
  className: `${c.next} ${f >= g - 1 ? c.disabled : ""}`,
225
225
  onClick: L,
226
- disabled: f >= m.length - i,
226
+ disabled: f >= m.length - l,
227
227
  children: /* @__PURE__ */ r(Xt, { size: 36 })
228
228
  }
229
229
  )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.279",
4
+ "version": "0.0.280",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {