@orioncactuscorp/ui 1.13.0 → 1.15.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.
- package/CHANGELOG.md +155 -0
- package/README.md +133 -36
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/CheckMark/CheckMark.js +19 -17
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +38 -36
- package/dist/components/FloatingWindow/FloatingWindow.css +1 -0
- package/dist/components/FloatingWindow/FloatingWindow.js +693 -0
- package/dist/components/FloatingWindow/FloatingWindow.module.scss.js +17 -0
- package/dist/components/FloatingWindow/FloatingWindowManager.js +36 -0
- package/dist/components/FloatingWindow/contexts.js +25 -0
- package/dist/components/FloatingWindow/geometry.js +222 -0
- package/dist/components/FloatingWindow/stack.js +31 -0
- package/dist/components/FloatingWindow.d.ts +6 -0
- package/dist/components/FloatingWindow.js +18 -0
- package/dist/components/Interaction/Interaction.css +1 -1
- package/dist/components/Menu/Menu.css +1 -1
- package/dist/components/Menu/Menu.js +95 -87
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +558 -723
- package/dist/components/Modal/Modal.module.scss.js +69 -60
- package/dist/components/Modal/initialFocus.js +11 -0
- package/dist/components/Modal/keyboardSession.js +104 -0
- package/dist/components/Modal/snapPoints.js +95 -82
- package/dist/components/Modal/useModalDrag.js +730 -762
- package/dist/components/Modal/useModalKeyboardAvoidance.js +159 -0
- package/dist/components/Modal/useModalViewportGeometry.js +36 -0
- package/dist/components/PositionSnap/PositionSnap.css +1 -0
- package/dist/components/PositionSnap/PositionSnap.js +330 -0
- package/dist/components/PositionSnap/PositionSnap.module.scss.js +9 -0
- package/dist/components/PositionSnap/contexts.js +12 -0
- package/dist/components/PositionSnap/geometry.js +75 -0
- package/dist/components/PositionSnap/gesture.js +7 -0
- package/dist/components/PositionSnap/policy.js +60 -0
- package/dist/components/PositionSnap.d.ts +6 -0
- package/dist/components/PositionSnap.js +7 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.css +1 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.js +45 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.module.scss.js +13 -0
- package/dist/components/ProgressIndicator.d.ts +6 -0
- package/dist/components/ProgressIndicator.js +4 -0
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/Radio/Radio.js +26 -24
- package/dist/components/Switch/Switch.css +1 -1
- package/dist/components/Switch/Switch.js +18 -16
- package/dist/components/Tabs/Tabs.css +1 -1
- package/dist/components/Tooltip/Tooltip.css +1 -1
- package/dist/components/Tooltip/Tooltip.js +59 -56
- package/dist/components/Tooltip/Tooltip.module.scss.js +6 -4
- package/dist/components/internal/ModalPresentation.js +361 -0
- package/dist/components/internal/OverlayPortalContext.js +20 -0
- package/dist/index.js +135 -112
- package/dist/styles.css +13 -10
- package/dist/ui/src/components/CheckMark/CheckMark.d.ts +1 -1
- package/dist/ui/src/components/CheckMark/CheckMark.d.ts.map +1 -1
- package/dist/ui/src/components/CheckMark/types.d.ts +2 -1
- package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -1
- package/dist/ui/src/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/ui/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/ui/src/components/Checkbox/types.d.ts +2 -1
- package/dist/ui/src/components/Checkbox/types.d.ts.map +1 -1
- package/dist/ui/src/components/FloatingWindow/FloatingWindow.d.ts +32 -0
- package/dist/ui/src/components/FloatingWindow/FloatingWindow.d.ts.map +1 -0
- package/dist/ui/src/components/FloatingWindow/FloatingWindowManager.d.ts +4 -0
- package/dist/ui/src/components/FloatingWindow/FloatingWindowManager.d.ts.map +1 -0
- package/dist/ui/src/components/FloatingWindow/contexts.d.ts +36 -0
- package/dist/ui/src/components/FloatingWindow/contexts.d.ts.map +1 -0
- package/dist/ui/src/components/FloatingWindow/geometry.d.ts +31 -0
- package/dist/ui/src/components/FloatingWindow/geometry.d.ts.map +1 -0
- package/dist/ui/src/components/FloatingWindow/index.d.ts +4 -0
- package/dist/ui/src/components/FloatingWindow/index.d.ts.map +1 -0
- package/dist/ui/src/components/FloatingWindow/stack.d.ts +9 -0
- package/dist/ui/src/components/FloatingWindow/stack.d.ts.map +1 -0
- package/dist/ui/src/components/FloatingWindow/types.d.ts +121 -0
- package/dist/ui/src/components/FloatingWindow/types.d.ts.map +1 -0
- package/dist/ui/src/components/Interaction/index.d.ts +1 -1
- package/dist/ui/src/components/Interaction/index.d.ts.map +1 -1
- package/dist/ui/src/components/Interaction/types.d.ts +9 -1
- package/dist/ui/src/components/Interaction/types.d.ts.map +1 -1
- package/dist/ui/src/components/Menu/Menu.d.ts +2 -2
- package/dist/ui/src/components/Menu/Menu.d.ts.map +1 -1
- package/dist/ui/src/components/Menu/types.d.ts +9 -2
- package/dist/ui/src/components/Menu/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts +2 -2
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/contexts.d.ts +3 -0
- package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/initialFocus.d.ts +18 -0
- package/dist/ui/src/components/Modal/initialFocus.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/keyboardSession.d.ts +46 -0
- package/dist/ui/src/components/Modal/keyboardSession.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/snapPoints.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +17 -2
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalKeyboardAvoidance.d.ts +17 -0
- package/dist/ui/src/components/Modal/useModalKeyboardAvoidance.d.ts.map +1 -0
- package/dist/ui/src/components/Modal/useModalViewportGeometry.d.ts +9 -0
- package/dist/ui/src/components/Modal/useModalViewportGeometry.d.ts.map +1 -0
- package/dist/ui/src/components/PositionSnap/PositionSnap.d.ts +11 -0
- package/dist/ui/src/components/PositionSnap/PositionSnap.d.ts.map +1 -0
- package/dist/ui/src/components/PositionSnap/contexts.d.ts +17 -0
- package/dist/ui/src/components/PositionSnap/contexts.d.ts.map +1 -0
- package/dist/ui/src/components/PositionSnap/geometry.d.ts +31 -0
- package/dist/ui/src/components/PositionSnap/geometry.d.ts.map +1 -0
- package/dist/ui/src/components/PositionSnap/gesture.d.ts +2 -0
- package/dist/ui/src/components/PositionSnap/gesture.d.ts.map +1 -0
- package/dist/ui/src/components/PositionSnap/index.d.ts +3 -0
- package/dist/ui/src/components/PositionSnap/index.d.ts.map +1 -0
- package/dist/ui/src/components/PositionSnap/policy.d.ts +24 -0
- package/dist/ui/src/components/PositionSnap/policy.d.ts.map +1 -0
- package/dist/ui/src/components/PositionSnap/types.d.ts +31 -0
- package/dist/ui/src/components/PositionSnap/types.d.ts.map +1 -0
- package/dist/ui/src/components/ProgressIndicator/ProgressIndicator.d.ts +4 -0
- package/dist/ui/src/components/ProgressIndicator/ProgressIndicator.d.ts.map +1 -0
- package/dist/ui/src/components/ProgressIndicator/index.d.ts +3 -0
- package/dist/ui/src/components/ProgressIndicator/index.d.ts.map +1 -0
- package/dist/ui/src/components/ProgressIndicator/types.d.ts +17 -0
- package/dist/ui/src/components/ProgressIndicator/types.d.ts.map +1 -0
- package/dist/ui/src/components/Radio/Radio.d.ts +1 -1
- package/dist/ui/src/components/Radio/Radio.d.ts.map +1 -1
- package/dist/ui/src/components/Radio/types.d.ts +2 -1
- package/dist/ui/src/components/Radio/types.d.ts.map +1 -1
- package/dist/ui/src/components/Switch/Switch.d.ts +1 -1
- package/dist/ui/src/components/Switch/Switch.d.ts.map +1 -1
- package/dist/ui/src/components/Switch/types.d.ts +2 -1
- package/dist/ui/src/components/Switch/types.d.ts.map +1 -1
- package/dist/ui/src/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/ui/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/ui/src/components/Tooltip/types.d.ts +6 -0
- package/dist/ui/src/components/Tooltip/types.d.ts.map +1 -1
- package/dist/ui/src/components/internal/ModalPresentation.d.ts +62 -0
- package/dist/ui/src/components/internal/ModalPresentation.d.ts.map +1 -0
- package/dist/ui/src/components/internal/OverlayPortalContext.d.ts +10 -0
- package/dist/ui/src/components/internal/OverlayPortalContext.d.ts.map +1 -0
- package/dist/ui/src/index.d.ts +7 -1
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/ui/src/utils/motion.d.ts.map +1 -1
- package/dist/utils/motion.js +194 -135
- package/docs/api-conventions.md +4 -0
- package/docs/motion.md +4 -0
- package/docs/overlay-stacking.md +48 -0
- package/docs/responsive-foundation-profile.md +1 -1
- package/docs/scss-helpers.md +110 -5
- package/docs/selector-contract.md +126 -2
- package/docs/tokens.md +2 -0
- package/package.json +1 -1
- package/src/scss/foundations/atomic.scss +9 -8
- package/src/scss/index.scss +2 -0
- package/src/scss/mixins/_fluid.scss +57 -0
- package/src/scss/mixins/_fluid.test.ts +87 -0
- package/src/scss/mixins/_gradient.scss +99 -0
- package/src/scss/mixins/_gradient.test.ts +111 -0
- package/src/scss/mixins/_responsive.scss +2 -1
- package/src/scss/mixins/_typo.scss +2 -1
- package/src/scss/mixins/_units.scss +14 -0
- package/src/scss/mixins/_utils.scss +3 -22
|
@@ -1,68 +1,77 @@
|
|
|
1
|
-
import './Modal.css';const o = "oc-Modal-module__trigger__B-N3y", a = "oc-Modal-module__backdrop__jYpTA",
|
|
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 = {
|
|
2
2
|
trigger: o,
|
|
3
3
|
backdrop: a,
|
|
4
|
-
viewport:
|
|
5
|
-
surfaceMotion:
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
viewport: e,
|
|
5
|
+
surfaceMotion: n,
|
|
6
|
+
initialFocusTitle: _,
|
|
7
|
+
bottomFill: l,
|
|
8
|
+
surface: d,
|
|
9
|
+
feedbackOdd: t,
|
|
8
10
|
"oc-modal-reject-shake": "oc-Modal-module__oc-modal-reject-shake__RJrNe",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
feedbackEven: i,
|
|
12
|
+
"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,
|
|
17
|
+
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,
|
|
38
|
+
bodyContent: w
|
|
34
39
|
};
|
|
35
40
|
export {
|
|
36
41
|
a as backdrop,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
42
|
+
x as body,
|
|
43
|
+
O as bodyContainer,
|
|
44
|
+
w as bodyContent,
|
|
45
|
+
l as bottomFill,
|
|
46
|
+
y as close,
|
|
47
|
+
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,
|
|
59
|
+
_ as initialFocusTitle,
|
|
60
|
+
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,
|
|
74
|
+
n as surfaceMotion,
|
|
66
75
|
o as trigger,
|
|
67
|
-
|
|
76
|
+
e as viewport
|
|
68
77
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function n({
|
|
2
|
+
contentNode: t,
|
|
3
|
+
initialFocus: r,
|
|
4
|
+
modal: f,
|
|
5
|
+
titleNode: e
|
|
6
|
+
}) {
|
|
7
|
+
return r === "content" ? () => t : r === "first-interactive" ? !0 : r === "title" ? () => e ?? !0 : r === void 0 || r === "auto" ? f === !1 ? !1 : () => e ?? !0 : r;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
n as resolveModalInitialFocus
|
|
11
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
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) {
|
|
17
|
+
switch (e.type) {
|
|
18
|
+
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,
|
|
25
|
+
phase: "active",
|
|
26
|
+
sawKeyboard: !1,
|
|
27
|
+
target: r
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
case "retain":
|
|
31
|
+
return t && { ...t, phase: "active", target: e.target };
|
|
32
|
+
case "close":
|
|
33
|
+
return t && { ...t, phase: "closing", target: null };
|
|
34
|
+
case "measure":
|
|
35
|
+
return t && !t.sawKeyboard ? { ...t, sawKeyboard: !0 } : t;
|
|
36
|
+
case "release":
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
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) {
|
|
46
|
+
return !t || !e || Math.abs(t.baselineWidth - e.width) < 80;
|
|
47
|
+
}
|
|
48
|
+
function _(t, e) {
|
|
49
|
+
return Math.abs(t.baselineHeight - e.height) <= 2;
|
|
50
|
+
}
|
|
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);
|
|
56
|
+
}
|
|
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 } : {
|
|
62
|
+
...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
|
|
70
|
+
};
|
|
71
|
+
}
|
|
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) {
|
|
82
|
+
return t !== null && typeof t.getAnimations == "function" && typeof CSSTransition < "u";
|
|
83
|
+
}
|
|
84
|
+
function D(t) {
|
|
85
|
+
return t.getAnimations({ subtree: !0 }).some(
|
|
86
|
+
(e) => e instanceof CSSTransition && e.transitionProperty === "transform" && e.playState === "running"
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
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
|
|
104
|
+
};
|
|
@@ -1,108 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { resolvePositionSnapPoint as M, resolvePositionSnapTargets as N } from "../PositionSnap/geometry.js";
|
|
2
|
+
const P = {
|
|
3
|
+
center: "center",
|
|
4
|
+
left: "inline-start",
|
|
5
|
+
right: "inline-end",
|
|
6
|
+
top: "block-start",
|
|
7
|
+
bottom: "block-end",
|
|
8
|
+
"top-left": "block-start-inline-start",
|
|
9
|
+
"top-right": "block-start-inline-end",
|
|
10
|
+
"bottom-left": "block-end-inline-start",
|
|
11
|
+
"bottom-right": "block-end-inline-end"
|
|
12
|
+
};
|
|
13
|
+
function T(t, n) {
|
|
14
|
+
return typeof t == "string" ? Number.parseFloat(t) : t > 1 ? t : t * n;
|
|
3
15
|
}
|
|
4
|
-
function
|
|
5
|
-
return Number.isFinite(
|
|
16
|
+
function y(t) {
|
|
17
|
+
return Number.isFinite(t) && t > 0;
|
|
6
18
|
}
|
|
7
|
-
function
|
|
8
|
-
snapPoints:
|
|
9
|
-
defaultSnapPoint:
|
|
10
|
-
backdropFrom:
|
|
11
|
-
viewportHeight:
|
|
19
|
+
function I({
|
|
20
|
+
snapPoints: t,
|
|
21
|
+
defaultSnapPoint: n,
|
|
22
|
+
backdropFrom: o,
|
|
23
|
+
viewportHeight: s
|
|
12
24
|
}) {
|
|
13
|
-
if (!
|
|
14
|
-
const
|
|
15
|
-
(
|
|
16
|
-
), i =
|
|
25
|
+
if (!t?.length) return;
|
|
26
|
+
const e = t.map(
|
|
27
|
+
(r) => T(r, s)
|
|
28
|
+
), i = e.filter(y).sort((r, u) => r - u);
|
|
17
29
|
if (!i.length) return;
|
|
18
|
-
const
|
|
19
|
-
return process.env.NODE_ENV !== "production" &&
|
|
30
|
+
const d = Math.max(...i), c = n !== void 0 ? t.findIndex((r) => r === n) : -1, g = c >= 0 && e[c] ? e[c] : d, a = o !== void 0 ? t.findIndex((r) => r === o) : -1, h = a >= 0 && y(e[a]) ? e[a] : void 0;
|
|
31
|
+
return process.env.NODE_ENV !== "production" && o !== void 0 && h === void 0 && console.warn(
|
|
20
32
|
"oc-ui Modal: `backdropFrom` must reference a member of `snapPoints`; the backdrop threshold was ignored."
|
|
21
33
|
), {
|
|
22
34
|
snapHeights: i,
|
|
23
|
-
sheetHeight:
|
|
24
|
-
defaultHeight:
|
|
25
|
-
visibleTranslate: Math.max(0,
|
|
26
|
-
backdropFromHeight:
|
|
35
|
+
sheetHeight: d,
|
|
36
|
+
defaultHeight: g,
|
|
37
|
+
visibleTranslate: Math.max(0, d - g),
|
|
38
|
+
backdropFromHeight: h
|
|
27
39
|
};
|
|
28
40
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
return Number.isFinite(
|
|
32
|
-
}
|
|
33
|
-
function w(e, t) {
|
|
34
|
-
switch (e) {
|
|
35
|
-
case "left":
|
|
36
|
-
return { x: t.minX, y: 0 };
|
|
37
|
-
case "right":
|
|
38
|
-
return { x: t.maxX, y: 0 };
|
|
39
|
-
case "top":
|
|
40
|
-
return { x: 0, y: t.minY };
|
|
41
|
-
case "bottom":
|
|
42
|
-
return { x: 0, y: t.maxY };
|
|
43
|
-
case "top-left":
|
|
44
|
-
return { x: t.minX, y: t.minY };
|
|
45
|
-
case "top-right":
|
|
46
|
-
return { x: t.maxX, y: t.minY };
|
|
47
|
-
case "bottom-left":
|
|
48
|
-
return { x: t.minX, y: t.maxY };
|
|
49
|
-
case "bottom-right":
|
|
50
|
-
return { x: t.maxX, y: t.maxY };
|
|
51
|
-
default:
|
|
52
|
-
return { x: 0, y: 0 };
|
|
53
|
-
}
|
|
41
|
+
function p(t, n) {
|
|
42
|
+
const o = Number.parseFloat(t.getPropertyValue(n));
|
|
43
|
+
return Number.isFinite(o) ? o : 0;
|
|
54
44
|
}
|
|
55
|
-
function
|
|
56
|
-
position:
|
|
57
|
-
viewportRect:
|
|
58
|
-
paddingTop:
|
|
59
|
-
paddingBottom:
|
|
45
|
+
function F({
|
|
46
|
+
position: t,
|
|
47
|
+
viewportRect: n,
|
|
48
|
+
paddingTop: o,
|
|
49
|
+
paddingBottom: s
|
|
60
50
|
}) {
|
|
61
|
-
if (
|
|
51
|
+
if (t === "top" || t.startsWith("top-"))
|
|
62
52
|
return {
|
|
63
|
-
y: `calc(${
|
|
53
|
+
y: `calc(${o - n.height / 2}px + 50%)`
|
|
64
54
|
};
|
|
65
|
-
if (
|
|
55
|
+
if (t === "bottom" || t.startsWith("bottom-"))
|
|
66
56
|
return {
|
|
67
|
-
y: `calc(${
|
|
57
|
+
y: `calc(${n.height / 2 - s}px - 50%)`
|
|
68
58
|
};
|
|
69
59
|
}
|
|
70
|
-
function
|
|
71
|
-
defaultSnapPosition:
|
|
72
|
-
snapPositions:
|
|
73
|
-
surfaceMotion:
|
|
60
|
+
function R({
|
|
61
|
+
defaultSnapPosition: t,
|
|
62
|
+
snapPositions: n,
|
|
63
|
+
surfaceMotion: o
|
|
74
64
|
}) {
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
65
|
+
const s = o.parentElement;
|
|
66
|
+
if (!s || !n.length) return;
|
|
67
|
+
const e = s.getBoundingClientRect(), i = o.getBoundingClientRect();
|
|
68
|
+
if (e.width <= 0 || e.height <= 0 || i.width <= 0 || i.height <= 0)
|
|
79
69
|
return;
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
const d = window.getComputedStyle(s), c = p(d, "padding-left"), g = p(d, "padding-right"), a = p(d, "padding-top"), h = p(d, "padding-bottom"), r = {
|
|
71
|
+
x: e.left,
|
|
72
|
+
y: e.top,
|
|
73
|
+
width: e.width,
|
|
74
|
+
height: e.height
|
|
75
|
+
}, u = {
|
|
76
|
+
top: a,
|
|
77
|
+
right: g,
|
|
78
|
+
bottom: h,
|
|
79
|
+
left: c
|
|
80
|
+
}, m = { width: i.width, height: i.height }, b = M({
|
|
81
|
+
boundary: r,
|
|
82
|
+
direction: "ltr",
|
|
83
|
+
padding: u,
|
|
84
|
+
position: "center",
|
|
85
|
+
size: m
|
|
86
|
+
}), k = {
|
|
87
|
+
minX: c + i.width / 2 - e.width / 2,
|
|
88
|
+
maxX: e.width - g - i.width / 2 - e.width / 2,
|
|
89
|
+
minY: a + i.height / 2 - e.height / 2,
|
|
90
|
+
maxY: e.height - h - i.height / 2 - e.height / 2
|
|
91
|
+
}, f = N({
|
|
92
|
+
boundary: r,
|
|
93
|
+
direction: "ltr",
|
|
94
|
+
padding: u,
|
|
95
|
+
positions: n.map((l) => P[l]),
|
|
96
|
+
size: m
|
|
97
|
+
}).map((l, H) => {
|
|
98
|
+
const w = n[H] ?? "center", x = F({
|
|
99
|
+
position: w,
|
|
100
|
+
viewportRect: e,
|
|
101
|
+
paddingTop: a,
|
|
102
|
+
paddingBottom: h
|
|
91
103
|
});
|
|
92
104
|
return {
|
|
93
|
-
key:
|
|
94
|
-
|
|
95
|
-
|
|
105
|
+
key: w,
|
|
106
|
+
x: l.x - b.x,
|
|
107
|
+
y: l.y - b.y,
|
|
108
|
+
...x ? { settledTranslate: x } : {}
|
|
96
109
|
};
|
|
97
|
-
}),
|
|
98
|
-
if (
|
|
110
|
+
}), S = t ?? n[0], v = f.find((l) => l.key === S) ?? f[0];
|
|
111
|
+
if (v)
|
|
99
112
|
return {
|
|
100
|
-
bounds:
|
|
101
|
-
defaultTarget:
|
|
102
|
-
targets:
|
|
113
|
+
bounds: k,
|
|
114
|
+
defaultTarget: v,
|
|
115
|
+
targets: f
|
|
103
116
|
};
|
|
104
117
|
}
|
|
105
118
|
export {
|
|
106
|
-
|
|
107
|
-
|
|
119
|
+
R as resolveModalPopupSnapPositions,
|
|
120
|
+
I as resolveModalSnapMetrics
|
|
108
121
|
};
|