@orioncactuscorp/ui 1.16.0 → 1.18.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/README.md +55 -14
  3. package/dist/components/ActionArea/ActionArea.css +1 -1
  4. package/dist/components/ActionArea/ActionArea.js +56 -55
  5. package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
  6. package/dist/components/Badge/Badge.css +1 -1
  7. package/dist/components/Badge/Badge.js +45 -40
  8. package/dist/components/Badge/Badge.module.scss.js +9 -8
  9. package/dist/components/Fieldset/Fieldset.css +1 -1
  10. package/dist/components/Modal/Modal.css +1 -1
  11. package/dist/components/Modal/Modal.js +582 -563
  12. package/dist/components/Modal/Modal.module.scss.js +59 -57
  13. package/dist/components/Modal/blockSize.js +7 -0
  14. package/dist/components/Modal/cssTime.js +11 -0
  15. package/dist/components/Modal/fieldReveal.js +57 -0
  16. package/dist/components/Modal/headerTapScroll.js +10 -0
  17. package/dist/components/Modal/keyboardEditable.js +31 -0
  18. package/dist/components/Modal/keyboardInsetMemory.js +24 -0
  19. package/dist/components/Modal/keyboardSession.js +46 -73
  20. package/dist/components/Modal/modalResizeTarget.js +28 -0
  21. package/dist/components/Modal/modalScrollArbitration.js +69 -80
  22. package/dist/components/Modal/scrollportScroller.js +43 -0
  23. package/dist/components/Modal/tapCaret.js +32 -0
  24. package/dist/components/Modal/useBottomSheetIntrinsicHeight.js +58 -0
  25. package/dist/components/Modal/useFieldReveal.js +81 -0
  26. package/dist/components/Modal/useMeasuredElement.js +20 -0
  27. package/dist/components/Modal/useModalContentBlockTransition.js +128 -49
  28. package/dist/components/Modal/useModalContentSizeSignal.js +30 -0
  29. package/dist/components/Modal/useModalDrag.js +1136 -1056
  30. package/dist/components/Modal/useModalKeyboardAvoidance.js +200 -117
  31. package/dist/components/Modal/useModalViewportGeometry.js +35 -19
  32. package/dist/components/PositionSnap/policy.js +40 -43
  33. package/dist/components/internal/ModalPresentation.js +1 -1
  34. package/dist/styles.css +5 -5
  35. package/dist/ui/src/components/ActionArea/ActionArea.d.ts.map +1 -1
  36. package/dist/ui/src/components/Badge/Badge.d.ts.map +1 -1
  37. package/dist/ui/src/components/Badge/types.d.ts +1 -1
  38. package/dist/ui/src/components/Badge/types.d.ts.map +1 -1
  39. package/dist/ui/src/components/Modal/Modal.d.ts +2 -2
  40. package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
  41. package/dist/ui/src/components/Modal/Modal.test.utils.d.ts +12 -0
  42. package/dist/ui/src/components/Modal/Modal.test.utils.d.ts.map +1 -0
  43. package/dist/ui/src/components/Modal/blockSize.d.ts +2 -0
  44. package/dist/ui/src/components/Modal/blockSize.d.ts.map +1 -0
  45. package/dist/ui/src/components/Modal/contexts.d.ts +6 -0
  46. package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -1
  47. package/dist/ui/src/components/Modal/cssTime.d.ts +4 -0
  48. package/dist/ui/src/components/Modal/cssTime.d.ts.map +1 -0
  49. package/dist/ui/src/components/Modal/fieldReveal.d.ts +18 -0
  50. package/dist/ui/src/components/Modal/fieldReveal.d.ts.map +1 -0
  51. package/dist/ui/src/components/Modal/headerTapScroll.d.ts +5 -0
  52. package/dist/ui/src/components/Modal/headerTapScroll.d.ts.map +1 -0
  53. package/dist/ui/src/components/Modal/keyboardEditable.d.ts +6 -0
  54. package/dist/ui/src/components/Modal/keyboardEditable.d.ts.map +1 -0
  55. package/dist/ui/src/components/Modal/keyboardInsetMemory.d.ts +5 -0
  56. package/dist/ui/src/components/Modal/keyboardInsetMemory.d.ts.map +1 -0
  57. package/dist/ui/src/components/Modal/keyboardSession.d.ts +4 -11
  58. package/dist/ui/src/components/Modal/keyboardSession.d.ts.map +1 -1
  59. package/dist/ui/src/components/Modal/modalResizeTarget.d.ts +12 -0
  60. package/dist/ui/src/components/Modal/modalResizeTarget.d.ts.map +1 -0
  61. package/dist/ui/src/components/Modal/modalScrollArbitration.d.ts.map +1 -1
  62. package/dist/ui/src/components/Modal/scrollportScroller.d.ts +20 -0
  63. package/dist/ui/src/components/Modal/scrollportScroller.d.ts.map +1 -0
  64. package/dist/ui/src/components/Modal/tapCaret.d.ts +10 -0
  65. package/dist/ui/src/components/Modal/tapCaret.d.ts.map +1 -0
  66. package/dist/ui/src/components/Modal/types.d.ts +6 -0
  67. package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
  68. package/dist/ui/src/components/Modal/useBottomSheetIntrinsicHeight.d.ts +28 -0
  69. package/dist/ui/src/components/Modal/useBottomSheetIntrinsicHeight.d.ts.map +1 -0
  70. package/dist/ui/src/components/Modal/useFieldReveal.d.ts +28 -0
  71. package/dist/ui/src/components/Modal/useFieldReveal.d.ts.map +1 -0
  72. package/dist/ui/src/components/Modal/{useElementSize.d.ts → useMeasuredElement.d.ts} +1 -1
  73. package/dist/ui/src/components/Modal/useMeasuredElement.d.ts.map +1 -0
  74. package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts +20 -1
  75. package/dist/ui/src/components/Modal/useModalContentBlockTransition.d.ts.map +1 -1
  76. package/dist/ui/src/components/Modal/useModalContentSizeSignal.d.ts +22 -0
  77. package/dist/ui/src/components/Modal/useModalContentSizeSignal.d.ts.map +1 -0
  78. package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
  79. package/dist/ui/src/components/Modal/useModalKeyboardAvoidance.d.ts +6 -1
  80. package/dist/ui/src/components/Modal/useModalKeyboardAvoidance.d.ts.map +1 -1
  81. package/dist/ui/src/components/Modal/useModalViewportGeometry.d.ts +1 -0
  82. package/dist/ui/src/components/Modal/useModalViewportGeometry.d.ts.map +1 -1
  83. package/dist/ui/src/components/PositionSnap/policy.d.ts.map +1 -1
  84. package/dist/ui/src/utils/gesture.d.ts +58 -0
  85. package/dist/ui/src/utils/gesture.d.ts.map +1 -0
  86. package/dist/utils/gesture.d.ts +2 -0
  87. package/dist/utils/gesture.js +103 -0
  88. package/docs/api-conventions.md +5 -0
  89. package/docs/gesture.md +64 -0
  90. package/docs/selector-contract.md +41 -10
  91. package/docs/spring.md +4 -0
  92. package/package.json +5 -1
  93. package/dist/components/Modal/useElementSize.js +0 -23
  94. package/dist/ui/src/components/Modal/useElementSize.d.ts.map +0 -1
@@ -1,76 +1,78 @@
1
- import './Modal.css';const o = "oc-Modal-module__trigger__B-N3y", a = "oc-Modal-module__backdrop__jYpTA", e = "oc-Modal-module__viewport__8dW9u", n = "oc-Modal-module__surfaceMotion__fJnTQ", _ = "oc-Modal-module__initialFocusTitle__eIZKr", l = "oc-Modal-module__bottomFill__wKrvv", d = "oc-Modal-module__surface__FnAX8", t = "oc-Modal-module__feedbackOdd__auvRQ", i = "oc-Modal-module__feedbackEven__xT95f", c = "oc-Modal-module__header__NS30G", r = "oc-Modal-module__footer__Oyz-R", m = "oc-Modal-module__small__qdBEU", s = "oc-Modal-module__medium__JRDXg", g = "oc-Modal-module__large__O42Af", u = "oc-Modal-module__fixed__Gj1Dv", v = "oc-Modal-module__navigationSection__oHkbv", M = "oc-Modal-module__handle__Fan4V", h = "oc-Modal-module__headerInner__F5nxn", f = "oc-Modal-module__headerLeading__v735-", b = "oc-Modal-module__headerTrailing__hQamr", T = "oc-Modal-module__headerTitle__tJ2Qv", k = "oc-Modal-module__headerBottom__g-Jta", y = "oc-Modal-module__close__058gy", F = "oc-Modal-module__navigationDialogTitle__vkGhC", P = "oc-Modal-module__navigationHeading__XioS6", I = "oc-Modal-module__navigation__ldQt-", p = "oc-Modal-module__navigationTitle__ncfjD", j = "oc-Modal-module__navigationIndicator__swRE1", S = "oc-Modal-module__navigationPanel__conuU", C = "oc-Modal-module__navigationPanelScroll__UO-ue", D = "oc-Modal-module__navigationPanelFrame__RljMi", R = "oc-Modal-module__navigationPanelInner__k0D4f", x = "oc-Modal-module__body__3zIj9", O = "oc-Modal-module__bodyContainer__t57Y6", w = "oc-Modal-module__bodyContent__fRK23", B = {
1
+ import './Modal.css';const o = "oc-Modal-module__trigger__B-N3y", a = "oc-Modal-module__backdrop__jYpTA", e = "oc-Modal-module__viewport__8dW9u", n = "oc-Modal-module__surfaceMotion__fJnTQ", _ = "oc-Modal-module__initialFocusTitle__eIZKr", l = "oc-Modal-module__bodyContainer__t57Y6", d = "oc-Modal-module__bottomFill__wKrvv", t = "oc-Modal-module__surface__FnAX8", i = "oc-Modal-module__feedbackOdd__auvRQ", c = "oc-Modal-module__feedbackEven__xT95f", r = "oc-Modal-module__header__NS30G", m = "oc-Modal-module__footer__Oyz-R", s = "oc-Modal-module__small__qdBEU", u = "oc-Modal-module__medium__JRDXg", g = "oc-Modal-module__large__O42Af", v = "oc-Modal-module__fixed__Gj1Dv", M = "oc-Modal-module__navigationSection__oHkbv", h = "oc-Modal-module__handleArea__cLoTW", f = "oc-Modal-module__handle__Fan4V", b = "oc-Modal-module__headerInner__F5nxn", T = "oc-Modal-module__headerLeading__v735-", k = "oc-Modal-module__headerTrailing__hQamr", y = "oc-Modal-module__headerTitle__tJ2Qv", F = "oc-Modal-module__headerBottom__g-Jta", P = "oc-Modal-module__close__058gy", I = "oc-Modal-module__navigationDialogTitle__vkGhC", p = "oc-Modal-module__navigationHeading__XioS6", j = "oc-Modal-module__navigation__ldQt-", S = "oc-Modal-module__navigationTitle__ncfjD", C = "oc-Modal-module__navigationIndicator__swRE1", D = "oc-Modal-module__navigationPanel__conuU", R = "oc-Modal-module__navigationPanelScroll__UO-ue", x = "oc-Modal-module__navigationPanelFrame__RljMi", A = "oc-Modal-module__navigationPanelInner__k0D4f", O = "oc-Modal-module__body__3zIj9", w = "oc-Modal-module__bodyContent__fRK23", B = {
2
2
  trigger: o,
3
3
  backdrop: a,
4
4
  viewport: e,
5
5
  surfaceMotion: n,
6
6
  initialFocusTitle: _,
7
- bottomFill: l,
8
- surface: d,
9
- feedbackOdd: t,
7
+ bodyContainer: l,
8
+ bottomFill: d,
9
+ surface: t,
10
+ feedbackOdd: i,
10
11
  "oc-modal-reject-shake": "oc-Modal-module__oc-modal-reject-shake__RJrNe",
11
- feedbackEven: i,
12
+ feedbackEven: c,
12
13
  "oc-modal-reject-shake-replay": "oc-Modal-module__oc-modal-reject-shake-replay__cbWGX",
13
- header: c,
14
- footer: r,
15
- small: m,
16
- medium: s,
14
+ header: r,
15
+ footer: m,
16
+ small: s,
17
+ medium: u,
17
18
  large: g,
18
- fixed: u,
19
- navigationSection: v,
20
- handle: M,
21
- headerInner: h,
22
- headerLeading: f,
23
- headerTrailing: b,
24
- headerTitle: T,
25
- headerBottom: k,
26
- close: y,
27
- navigationDialogTitle: F,
28
- navigationHeading: P,
29
- navigation: I,
30
- navigationTitle: p,
31
- navigationIndicator: j,
32
- navigationPanel: S,
33
- navigationPanelScroll: C,
34
- navigationPanelFrame: D,
35
- navigationPanelInner: R,
36
- body: x,
37
- bodyContainer: O,
19
+ fixed: v,
20
+ navigationSection: M,
21
+ handleArea: h,
22
+ handle: f,
23
+ headerInner: b,
24
+ headerLeading: T,
25
+ headerTrailing: k,
26
+ headerTitle: y,
27
+ headerBottom: F,
28
+ close: P,
29
+ navigationDialogTitle: I,
30
+ navigationHeading: p,
31
+ navigation: j,
32
+ navigationTitle: S,
33
+ navigationIndicator: C,
34
+ navigationPanel: D,
35
+ navigationPanelScroll: R,
36
+ navigationPanelFrame: x,
37
+ navigationPanelInner: A,
38
+ body: O,
38
39
  bodyContent: w
39
40
  };
40
41
  export {
41
42
  a as backdrop,
42
- x as body,
43
- O as bodyContainer,
43
+ O as body,
44
+ l as bodyContainer,
44
45
  w as bodyContent,
45
- l as bottomFill,
46
- y as close,
46
+ d as bottomFill,
47
+ P as close,
47
48
  B as default,
48
- i as feedbackEven,
49
- t as feedbackOdd,
50
- u as fixed,
51
- r as footer,
52
- M as handle,
53
- c as header,
54
- k as headerBottom,
55
- h as headerInner,
56
- f as headerLeading,
57
- T as headerTitle,
58
- b as headerTrailing,
49
+ c as feedbackEven,
50
+ i as feedbackOdd,
51
+ v as fixed,
52
+ m as footer,
53
+ f as handle,
54
+ h as handleArea,
55
+ r as header,
56
+ F as headerBottom,
57
+ b as headerInner,
58
+ T as headerLeading,
59
+ y as headerTitle,
60
+ k as headerTrailing,
59
61
  _ as initialFocusTitle,
60
62
  g as large,
61
- s as medium,
62
- I as navigation,
63
- F as navigationDialogTitle,
64
- P as navigationHeading,
65
- j as navigationIndicator,
66
- S as navigationPanel,
67
- D as navigationPanelFrame,
68
- R as navigationPanelInner,
69
- C as navigationPanelScroll,
70
- v as navigationSection,
71
- p as navigationTitle,
72
- m as small,
73
- d as surface,
63
+ u as medium,
64
+ j as navigation,
65
+ I as navigationDialogTitle,
66
+ p as navigationHeading,
67
+ C as navigationIndicator,
68
+ D as navigationPanel,
69
+ x as navigationPanelFrame,
70
+ A as navigationPanelInner,
71
+ R as navigationPanelScroll,
72
+ M as navigationSection,
73
+ S as navigationTitle,
74
+ s as small,
75
+ t as surface,
74
76
  n as surfaceMotion,
75
77
  o as trigger,
76
78
  e as viewport
@@ -0,0 +1,7 @@
1
+ function i(t) {
2
+ const e = Number.parseFloat(window.getComputedStyle(t).height);
3
+ return Number.isFinite(e) && e > 0 ? e : t.getBoundingClientRect().height;
4
+ }
5
+ export {
6
+ i as getBlockSize
7
+ };
@@ -0,0 +1,11 @@
1
+ function s(t) {
2
+ const e = t.trim();
3
+ return e.endsWith("ms") ? Number.parseFloat(e) || 0 : e.endsWith("s") ? (Number.parseFloat(e) || 0) * 1e3 : 0;
4
+ }
5
+ function i(t) {
6
+ return t.split(",").reduce((e, r) => Math.max(e, s(r)), 0);
7
+ }
8
+ export {
9
+ i as getMaxCssTimeMs,
10
+ s as parseCssTimeMs
11
+ };
@@ -0,0 +1,57 @@
1
+ const E = 16, d = 48;
2
+ function i({
3
+ labelRects: e,
4
+ targetRect: t
5
+ }) {
6
+ let n = t.top;
7
+ for (const o of e) {
8
+ const l = t.top - o.bottom;
9
+ o.top < n && l >= 0 && l <= 48 && (n = o.top);
10
+ }
11
+ return { bottom: t.bottom, top: n };
12
+ }
13
+ function b(e) {
14
+ const t = /* @__PURE__ */ new Set();
15
+ (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) && e.labels && e.labels.forEach((o) => t.add(o));
16
+ const n = e.getAttribute("aria-labelledby");
17
+ if (n)
18
+ for (const o of n.split(/\s+/)) {
19
+ const l = o ? e.ownerDocument.getElementById(o) : null;
20
+ l instanceof HTMLElement && t.add(l);
21
+ }
22
+ return Array.from(t);
23
+ }
24
+ function f(e) {
25
+ return i({
26
+ labelRects: b(e).map(
27
+ (t) => t.getBoundingClientRect()
28
+ ),
29
+ targetRect: e.getBoundingClientRect()
30
+ });
31
+ }
32
+ function A(e) {
33
+ const t = Number.parseFloat(e ?? "");
34
+ return Number.isFinite(t) && t > 0 ? t : 0;
35
+ }
36
+ function m({
37
+ bodyRect: e,
38
+ clearanceInset: t,
39
+ footerHeight: n,
40
+ revealed: o,
41
+ scrollPaddingStart: l,
42
+ targetRect: s
43
+ }) {
44
+ const r = e.top + l, a = s.top - r;
45
+ if (!o) return a;
46
+ const c = e.bottom - t - n;
47
+ return s.bottom > c - 16 || s.top < r ? a : 0;
48
+ }
49
+ export {
50
+ d as KEYBOARD_REVEAL_LABEL_MAX_GAP,
51
+ E as KEYBOARD_REVEAL_SCROLL_PADDING,
52
+ b as getKeyboardRevealLabels,
53
+ i as getKeyboardRevealRect,
54
+ m as getKeyboardRevealScrollDelta,
55
+ f as getKeyboardRevealTargetRect,
56
+ A as parseScrollPadding
57
+ };
@@ -0,0 +1,10 @@
1
+ import { shouldIgnoreDragTarget as e } from "./modalScrollArbitration.js";
2
+ function n({
3
+ scrollTop: o,
4
+ target: r
5
+ }) {
6
+ return o > 0 && !e(r);
7
+ }
8
+ export {
9
+ n as shouldScrollToTopOnHeaderClick
10
+ };
@@ -0,0 +1,31 @@
1
+ const o = /* @__PURE__ */ new Set([
2
+ "email",
3
+ "number",
4
+ "password",
5
+ "search",
6
+ "tel",
7
+ "text",
8
+ "url"
9
+ ]), i = /* @__PURE__ */ new Set(["decimal", "numeric", "tel"]), r = /* @__PURE__ */ new Set(["number", "tel"]);
10
+ function t(e) {
11
+ return !(e instanceof HTMLElement) || e.hasAttribute("disabled") || e.getAttribute("inputmode")?.toLowerCase() === "none" ? !1 : e.isContentEditable ? !0 : !(e instanceof HTMLInputElement) && !(e instanceof HTMLTextAreaElement) || e.readOnly ? !1 : e instanceof HTMLTextAreaElement ? !0 : o.has(e.type.toLowerCase());
12
+ }
13
+ function u(e) {
14
+ if (t(e)) return e;
15
+ if (!(e instanceof HTMLElement)) return null;
16
+ const n = e.closest("label")?.control ?? null;
17
+ return t(n) ? n : null;
18
+ }
19
+ function s(e) {
20
+ const n = e.getAttribute("inputmode")?.toLowerCase();
21
+ return n !== void 0 && n !== "" ? i.has(n) ? "numeric" : "text" : e instanceof HTMLInputElement && r.has(e.type.toLowerCase()) ? "numeric" : "text";
22
+ }
23
+ function l(e) {
24
+ return e.navigator.maxTouchPoints > 0 && typeof e.matchMedia == "function" && e.matchMedia("(pointer: coarse)").matches;
25
+ }
26
+ export {
27
+ s as getKeyboardClass,
28
+ u as getTapEditable,
29
+ l as hasSoftKeyboardEnvironment,
30
+ t as isKeyboardEditable
31
+ };
@@ -0,0 +1,24 @@
1
+ const r = /* @__PURE__ */ new Map();
2
+ function d(o, s, e) {
3
+ const t = Math.round(o), n = r.get(t) ?? {};
4
+ r.set(t, {
5
+ ...n,
6
+ [s]: e
7
+ });
8
+ }
9
+ function c(o, s) {
10
+ const e = r.get(
11
+ Math.round(o)
12
+ );
13
+ if (!e) return;
14
+ const t = e[s];
15
+ if (t !== void 0) return t;
16
+ const n = Object.values(e).filter(
17
+ (a) => a !== void 0
18
+ );
19
+ return n.length > 0 ? Math.max(...n) : void 0;
20
+ }
21
+ export {
22
+ c as getSeedKeyboardInset,
23
+ d as recordMeasuredKeyboardInset
24
+ };
@@ -1,34 +1,33 @@
1
- const f = 80, E = 2, h = 16, u = /* @__PURE__ */ new Set([
2
- "email",
3
- "number",
4
- "password",
5
- "search",
6
- "tel",
7
- "text",
8
- "url"
9
- ]), i = /* @__PURE__ */ new Map();
10
- function l(t, e) {
11
- i.set(Math.round(t), e);
12
- }
13
- function b(t) {
14
- return i.get(Math.round(t));
15
- }
16
- function c(t, e) {
1
+ const h = 80, u = 2;
2
+ function f(t, e) {
17
3
  switch (e.type) {
18
4
  case "focus": {
19
- const { geometry: n, target: r } = e;
20
- return t && t.phase === "active" && Math.abs(t.baselineWidth - n.width) < 80 ? { ...t, baselineWidth: n.width, target: r } : {
21
- baselineHeight: n.height,
22
- baselineOffsetLeft: n.offsetLeft,
23
- baselineOffsetTop: n.offsetTop,
24
- baselineWidth: n.width,
5
+ const { geometry: a, keyboardClass: r, target: i } = e;
6
+ return t && Math.abs(t.baselineWidth - a.width) < 80 ? {
7
+ ...t,
8
+ baselineHeight: Math.max(t.baselineHeight, a.height),
9
+ baselineWidth: a.width,
10
+ keyboardClass: r,
11
+ phase: "active",
12
+ target: i
13
+ } : {
14
+ baselineHeight: a.height,
15
+ baselineOffsetLeft: a.offsetLeft,
16
+ baselineOffsetTop: a.offsetTop,
17
+ baselineWidth: a.width,
18
+ keyboardClass: r,
25
19
  phase: "active",
26
20
  sawKeyboard: !1,
27
- target: r
21
+ target: i
28
22
  };
29
23
  }
30
24
  case "retain":
31
- return t && { ...t, phase: "active", target: e.target };
25
+ return t && {
26
+ ...t,
27
+ keyboardClass: e.keyboardClass,
28
+ phase: "active",
29
+ target: e.target
30
+ };
32
31
  case "close":
33
32
  return t && { ...t, phase: "closing", target: null };
34
33
  case "measure":
@@ -37,68 +36,42 @@ function c(t, e) {
37
36
  return;
38
37
  }
39
38
  }
40
- function s(t) {
41
- return !(t instanceof HTMLElement) || t.hasAttribute("disabled") ? !1 : t.isContentEditable || t.tagName === "TEXTAREA" ? !0 : t.tagName !== "INPUT" ? !1 : u.has(
42
- (t.getAttribute("type") ?? "text").toLowerCase()
43
- );
44
- }
45
- function o(t, e) {
39
+ function n(t, e) {
46
40
  return !t || !e || Math.abs(t.baselineWidth - e.width) < 80;
47
41
  }
48
- function _(t, e) {
42
+ function l(t, e) {
49
43
  return Math.abs(t.baselineHeight - e.height) <= 2;
50
44
  }
51
- function R(t, e) {
52
- return !t || // A closing session targets the resting inset at once: the chase
53
- // transition glides the footer down alongside the keyboard instead of
54
- // trailing WebKit's progressive geometry restore sample by sample.
55
- t.phase === "closing" || !e || !o(t, e) ? 0 : Math.max(0, t.baselineHeight - e.height);
45
+ function c(t, e) {
46
+ return !t || // Blur is the only "keyboard will hide" signal the page gets: iOS reports
47
+ // the restored geometry in one sample only after its whole dismissal
48
+ // choreography (~0.5s). A closing session targets the resting inset at
49
+ // once and the footer glides down over that span (see the closing
50
+ // transition in Modal.module.scss) instead of waiting for the sample.
51
+ t.phase === "closing" || !e || !n(t, e) ? 0 : Math.max(0, t.baselineHeight - e.height);
56
52
  }
57
- function d(t, e) {
58
- if (!t || !e || !o(t, e))
59
- return e;
60
- const n = Math.max(t.baselineHeight, e.height);
61
- return t.phase !== "closing" ? { ...e, height: n } : {
53
+ function o(t, e) {
54
+ return !t || !e || !n(t, e) ? e : {
62
55
  ...e,
63
- height: n,
64
- // A closing session targets the resting pan at once so the container
65
- // glides back in step with the keyboard and the inset drop, instead of
66
- // chasing WebKit's late restore samples and stranding the sheet offset
67
- // until a terminal snap.
68
- offsetLeft: t.baselineOffsetLeft,
69
- offsetTop: t.baselineOffsetTop
56
+ height: Math.max(t.baselineHeight, e.height)
70
57
  };
71
58
  }
72
- function O({
73
- bodyRect: t,
74
- clearanceInset: e,
75
- footerHeight: n,
76
- targetRect: r
77
- }) {
78
- const a = t.bottom - e - n;
79
- return r.bottom > a - 16 ? r.bottom - a + 16 : r.top < t.top + 16 ? r.top - t.top - 16 : 0;
80
- }
81
- function A(t) {
59
+ function b(t) {
82
60
  return t !== null && typeof t.getAnimations == "function" && typeof CSSTransition < "u";
83
61
  }
84
- function D(t) {
62
+ function E(t) {
85
63
  return t.getAnimations({ subtree: !0 }).some(
86
64
  (e) => e instanceof CSSTransition && e.transitionProperty === "transform" && e.playState === "running"
87
65
  );
88
66
  }
89
67
  export {
90
- h as KEYBOARD_REVEAL_SCROLL_PADDING,
91
- E as KEYBOARD_VIEWPORT_RESTORE_EPSILON,
92
- f as KEYBOARD_VIEWPORT_WIDTH_CHANGE_THRESHOLD,
93
- R as getKeyboardInset,
94
- O as getKeyboardRevealScrollDelta,
95
- b as getSeedKeyboardInset,
96
- d as getSessionStableViewportGeometry,
97
- D as hasRunningTransformTransition,
98
- s as isKeyboardEditable,
99
- o as isSessionGeometryCompatible,
100
- _ as isSessionGeometryRestored,
101
- c as keyboardSessionReducer,
102
- l as recordMeasuredKeyboardInset,
103
- A as supportsTransitionSettleDetection
68
+ u as KEYBOARD_VIEWPORT_RESTORE_EPSILON,
69
+ h as KEYBOARD_VIEWPORT_WIDTH_CHANGE_THRESHOLD,
70
+ c as getKeyboardInset,
71
+ o as getSessionStableViewportGeometry,
72
+ E as hasRunningTransformTransition,
73
+ n as isSessionGeometryCompatible,
74
+ l as isSessionGeometryRestored,
75
+ f as keyboardSessionReducer,
76
+ b as supportsTransitionSettleDetection
104
77
  };
@@ -0,0 +1,28 @@
1
+ const r = "--oc-modal-resize-target-scrollport-height", o = '[data-oc-modal-resizing="true"]';
2
+ function s(e, t) {
3
+ e.dataset.ocModalResizing = "true", t !== null && e.style.setProperty(
4
+ r,
5
+ `${t}px`
6
+ );
7
+ }
8
+ function i(e) {
9
+ delete e.dataset.ocModalResizing, e.style.removeProperty(r);
10
+ }
11
+ function l(e) {
12
+ return e.dataset.ocModalResizing === "true";
13
+ }
14
+ function n(e) {
15
+ const t = e.closest(o);
16
+ if (!t) return null;
17
+ const a = Number.parseFloat(
18
+ t.style.getPropertyValue(r)
19
+ );
20
+ return Number.isFinite(a) ? a : null;
21
+ }
22
+ export {
23
+ r as MODAL_RESIZE_TARGET_SCROLLPORT_HEIGHT_PROPERTY,
24
+ i as clearModalResizeTarget,
25
+ l as isModalResizeTargetPublished,
26
+ s as publishModalResizeTarget,
27
+ n as readModalResizeTarget
28
+ };