@caspeco/casper-ui-library 10.0.2 → 10.0.3

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
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,IAAI,YAAY,EAItB,MAAM,kBAAkB,CAAC;AAI1B,KAAK,qBAAqB,GAAG;IAC5B;2EACuE;IACvE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAG1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,KAAK,sBAAsB,GAAG,IAAI,CACjC,YAAY,CAAC,SAAS,EACtB,UAAU,GAAG,IAAI,GAAG,gBAAgB,GAAG,WAAW,CAClD,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;AAExE,wBAAgB,KAAK,CAAC,EACrB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,kBAAyB,EACzB,IAAW,EACX,cAAyB,EACzB,UAAiB,EACjB,GAAG,KAAK,EACR,EAAE,UAAU,+BAoCZ"}
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,IAAI,YAAY,EAItB,MAAM,kBAAkB,CAAC;AAI1B,KAAK,qBAAqB,GAAG;IAC5B;2EACuE;IACvE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAG1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,KAAK,sBAAsB,GAAG,IAAI,CACjC,YAAY,CAAC,SAAS,EACtB,UAAU,GAAG,IAAI,GAAG,gBAAgB,GAAG,WAAW,CAClD,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;AAExE,wBAAgB,KAAK,CAAC,EACrB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,kBAAyB,EACzB,IAAW,EACX,cAAyB,EACzB,UAAiB,EACjB,GAAG,KAAK,EACR,EAAE,UAAU,+BAuCZ"}
@@ -1,12 +1,12 @@
1
- import { jsx as O, jsxs as _ } from "react/jsx-runtime";
2
- import { c as D } from "../../_virtual/compiler-runtime.js";
3
- import { useBreakpointValue as I, Dialog as b, Portal as V } from "@chakra-ui/react";
4
- import { useState as $ } from "react";
5
- import { ModalBodyContext as q } from "./modal-body-context.js";
6
- function L(y) {
7
- const e = D.c(40);
1
+ import { jsx as O, jsxs as D } from "react/jsx-runtime";
2
+ import { c as I } from "../../_virtual/compiler-runtime.js";
3
+ import { useBreakpointValue as V, Dialog as y, Portal as $ } from "@chakra-ui/react";
4
+ import { useState as q } from "react";
5
+ import { ModalBodyContext as w } from "./modal-body-context.js";
6
+ function N(g) {
7
+ const e = I.c(41);
8
8
  let t, o, l, n, s, i, r, u, h, C, v;
9
- e[0] !== y ? ({
9
+ e[0] !== g ? ({
10
10
  children: t,
11
11
  isOpen: n,
12
12
  onClose: s,
@@ -18,39 +18,41 @@ function L(y) {
18
18
  scrollBehavior: C,
19
19
  isCentered: v,
20
20
  ...r
21
- } = y, e[0] = y, e[1] = t, e[2] = o, e[3] = l, e[4] = n, e[5] = s, e[6] = i, e[7] = r, e[8] = u, e[9] = h, e[10] = C, e[11] = v) : (t = e[1], o = e[2], l = e[3], n = e[4], s = e[5], i = e[6], r = e[7], u = e[8], h = e[9], C = e[10], v = e[11]);
22
- const g = u === void 0 ? !0 : u, P = h === void 0 ? "sm" : h, k = C === void 0 ? "inside" : C, z = v === void 0 ? !0 : v, [F, M] = $(null);
23
- let x;
21
+ } = g, e[0] = g, e[1] = t, e[2] = o, e[3] = l, e[4] = n, e[5] = s, e[6] = i, e[7] = r, e[8] = u, e[9] = h, e[10] = C, e[11] = v) : (t = e[1], o = e[2], l = e[3], n = e[4], s = e[5], i = e[6], r = e[7], u = e[8], h = e[9], C = e[10], v = e[11]);
22
+ const P = u === void 0 ? !0 : u, k = h === void 0 ? "sm" : h, F = C === void 0 ? "inside" : C, M = v === void 0 ? !0 : v, [S, R] = q(null);
23
+ let x, B;
24
24
  e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = {
25
25
  base: "bottomSheet",
26
26
  md: void 0
27
- }, e[12] = x) : x = e[12];
28
- const c = I(x);
29
- let B;
30
- e[13] !== s ? (B = function(R) {
31
- R.open || s?.();
32
- }, e[13] = s, e[14] = B) : B = e[14];
33
- const S = B;
27
+ }, B = {
28
+ ssr: !1
29
+ }, e[12] = x, e[13] = B) : (x = e[12], B = e[13]);
30
+ const c = V(x, B);
31
+ let E;
32
+ e[14] !== s ? (E = function(_) {
33
+ _.open || s?.();
34
+ }, e[14] = s, e[15] = E) : E = e[15];
35
+ const j = E;
34
36
  let a;
35
- e[15] !== F ? (a = {
36
- bodyElement: F,
37
- setBodyElement: M
38
- }, e[15] = F, e[16] = a) : a = e[16];
39
- const j = z ? "center" : void 0;
37
+ e[16] !== S ? (a = {
38
+ bodyElement: S,
39
+ setBodyElement: R
40
+ }, e[16] = S, e[17] = a) : a = e[17];
41
+ const z = M ? "center" : void 0;
40
42
  let d;
41
- e[17] !== c ? (d = /* @__PURE__ */ O(b.Backdrop, { "data-variant": c }), e[17] = c, e[18] = d) : d = e[18];
43
+ e[18] !== c ? (d = /* @__PURE__ */ O(y.Backdrop, { "data-variant": c }), e[18] = c, e[19] = d) : d = e[19];
42
44
  let m;
43
- e[19] !== t ? (m = /* @__PURE__ */ O(b.Positioner, { children: /* @__PURE__ */ O(b.Content, { children: t }) }), e[19] = t, e[20] = m) : m = e[20];
45
+ e[20] !== t ? (m = /* @__PURE__ */ O(y.Positioner, { children: /* @__PURE__ */ O(y.Content, { children: t }) }), e[20] = t, e[21] = m) : m = e[21];
44
46
  let p;
45
- e[21] !== m || e[22] !== d ? (p = /* @__PURE__ */ _(V, { children: [
47
+ e[22] !== d || e[23] !== m ? (p = /* @__PURE__ */ D($, { children: [
46
48
  d,
47
49
  m
48
- ] }), e[21] = m, e[22] = d, e[23] = p) : p = e[23];
50
+ ] }), e[22] = d, e[23] = m, e[24] = p) : p = e[24];
49
51
  let f;
50
- e[24] !== o || e[25] !== l || e[26] !== S || e[27] !== n || e[28] !== i || e[29] !== r || e[30] !== g || e[31] !== k || e[32] !== P || e[33] !== p || e[34] !== j || e[35] !== c ? (f = /* @__PURE__ */ O(b.Root, { variant: c, scrollBehavior: k, motionPreset: "slide-in-bottom", size: P, placement: j, closeOnInteractOutside: l, closeOnEscape: o, open: n, onOpenChange: S, restoreFocus: g, onExitComplete: i, ...r, children: p }), e[24] = o, e[25] = l, e[26] = S, e[27] = n, e[28] = i, e[29] = r, e[30] = g, e[31] = k, e[32] = P, e[33] = p, e[34] = j, e[35] = c, e[36] = f) : f = e[36];
51
- let E;
52
- return e[37] !== f || e[38] !== a ? (E = /* @__PURE__ */ O(q.Provider, { value: a, children: f }), e[37] = f, e[38] = a, e[39] = E) : E = e[39], E;
52
+ e[25] !== o || e[26] !== l || e[27] !== j || e[28] !== n || e[29] !== i || e[30] !== r || e[31] !== P || e[32] !== F || e[33] !== k || e[34] !== p || e[35] !== z || e[36] !== c ? (f = /* @__PURE__ */ O(y.Root, { variant: c, scrollBehavior: F, motionPreset: "slide-in-bottom", size: k, placement: z, closeOnInteractOutside: l, closeOnEscape: o, open: n, onOpenChange: j, restoreFocus: P, onExitComplete: i, ...r, children: p }), e[25] = o, e[26] = l, e[27] = j, e[28] = n, e[29] = i, e[30] = r, e[31] = P, e[32] = F, e[33] = k, e[34] = p, e[35] = z, e[36] = c, e[37] = f) : f = e[37];
53
+ let b;
54
+ return e[38] !== f || e[39] !== a ? (b = /* @__PURE__ */ O(w.Provider, { value: a, children: f }), e[38] = f, e[39] = a, e[40] = b) : b = e[40], b;
53
55
  }
54
56
  export {
55
- L as Modal
57
+ N as Modal
56
58
  };
@@ -23,9 +23,9 @@ function $({
23
23
  i.current.enabled = x, i.current.mode = h;
24
24
  const S = (e) => {
25
25
  const t = i.current;
26
- if (!t.enabled) return;
26
+ if (!t.enabled || !t.container) return;
27
27
  const n = e.getTotalSize();
28
- if (t.container && n !== t.lastSize) {
28
+ if (n !== t.lastSize) {
29
29
  t.lastSize = n;
30
30
  const d = e.options.horizontal ? "width" : "height";
31
31
  t.container.style[d] = `${n}px`;
@@ -1,12 +1,12 @@
1
1
  import { createLazyMeasurementsView as F } from "./lazy-measurements.js";
2
2
  import { memo as M, notUndefined as w, approxEqual as R, debounce as D } from "./utils.js";
3
- let I;
3
+ let z;
4
4
  const y = () => {
5
- if (I !== void 0) return I;
6
- if (typeof navigator > "u") return I = !1;
7
- if (/iP(hone|od|ad)/.test(navigator.userAgent)) return I = !0;
5
+ if (z !== void 0) return z;
6
+ if (typeof navigator > "u") return z = !1;
7
+ if (/iP(hone|od|ad)/.test(navigator.userAgent)) return z = !0;
8
8
  const r = navigator.maxTouchPoints;
9
- return I = navigator.platform === "MacIntel" && r !== void 0 && r > 0;
9
+ return z = navigator.platform === "MacIntel" && r !== void 0 && r > 0;
10
10
  }, C = (r) => {
11
11
  const { offsetWidth: a, offsetHeight: t } = r;
12
12
  return { width: a, height: t };
@@ -366,8 +366,8 @@ class U {
366
366
  p = g[f * 2] + g[f * 2 + 1] + c;
367
367
  }
368
368
  for (let f = m; f < t; f++) {
369
- const b = i(f), _ = d.get(b), z = typeof _ == "number" ? _ : this.options.estimateSize(f);
370
- g[f * 2] = p, g[f * 2 + 1] = z, p += z + c;
369
+ const b = i(f), _ = d.get(b), I = typeof _ == "number" ? _ : this.options.estimateSize(f);
370
+ g[f * 2] = p, g[f * 2 + 1] = I, p += I + c;
371
371
  }
372
372
  const E = F(t, g, i);
373
373
  return this.measurementsCache = E, E;
@@ -391,12 +391,12 @@ class U {
391
391
  const O = this.options.lanes === 1 ? h[c - 1] : this.getFurthestMeasurement(h, c);
392
392
  E = O ? O.end + this.options.gap : e + s, p = O ? O.lane : c % this.options.lanes, this.options.lanes > 1 && f && this.laneAssignments.set(c, p);
393
393
  }
394
- const b = d.get(v), _ = typeof b == "number" ? b : this.options.estimateSize(c), z = E + _;
394
+ const b = d.get(v), _ = typeof b == "number" ? b : this.options.estimateSize(c), I = E + _;
395
395
  h[c] = {
396
396
  index: c,
397
397
  start: E,
398
398
  size: _,
399
- end: z,
399
+ end: I,
400
400
  key: v,
401
401
  lane: p
402
402
  }, S[p] = c;
@@ -508,13 +508,13 @@ class U {
508
508
  m,
509
509
  this
510
510
  ) : (
511
- // Default: adjust scrollTop only when the resize is an above-
512
- // viewport item AND we're not actively scrolling backward.
513
- // Adjusting during backward scroll fights the user's scroll
514
- // direction and produces the "items jump while scrolling up"
515
- // jank reported across many issues. Users who want the old
516
- // behavior can pass shouldAdjustScrollPositionOnItemSizeChange.
517
- o < this.getScrollOffset() + this.scrollAdjustments && this.scrollDirection !== "backward"
511
+ // Default: adjust when the resize is an above-viewport item.
512
+ // First measurement (!has(key)): always adjust the item
513
+ // has never been sized, so the estimate→actual delta must
514
+ // be compensated regardless of scroll direction.
515
+ // Re-measurement (has(key)): skip during backward scroll
516
+ // to avoid the "items jump while scrolling up" cascade.
517
+ o < this.getScrollOffset() + this.scrollAdjustments && (!this.itemSizeCache.has(l) || this.scrollDirection !== "backward")
518
518
  ));
519
519
  (this.pendingMin === null || t < this.pendingMin) && (this.pendingMin = t), this.itemSizeCache.set(l, e), this.itemSizeCacheVersion++, h ? this.applyScrollAdjustment(this.getTotalSize() - S) : c && this.applyScrollAdjustment(m), this.notify(!1);
520
520
  }