@orioncactuscorp/ui 1.14.0 → 1.15.1
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 +116 -0
- package/README.md +65 -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.js +138 -137
- 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 +504 -488
- package/dist/components/Modal/Modal.module.scss.js +69 -62
- package/dist/components/Modal/keyboardSession.js +104 -0
- package/dist/components/Modal/snapPoints.js +95 -82
- package/dist/components/Modal/useModalDrag.js +587 -637
- 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 +126 -124
- package/dist/components/internal/OverlayPortalContext.js +20 -0
- package/dist/index.js +133 -126
- package/dist/styles.css +12 -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.map +1 -1
- package/dist/ui/src/components/FloatingWindow/types.d.ts +1 -1
- package/dist/ui/src/components/FloatingWindow/types.d.ts.map +1 -1
- 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 +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- 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 +8 -1
- 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 +2 -1
- package/dist/ui/src/components/internal/ModalPresentation.d.ts.map +1 -1
- 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 +5 -1
- package/dist/ui/src/index.d.ts.map +1 -1
- package/docs/api-conventions.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 +77 -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,25 +1,31 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as u, jsxs as
|
|
3
|
-
import { useRef as A, useState as l, useMemo as
|
|
4
|
-
import { Dialog as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { mergeRefs as
|
|
8
|
-
import { useModalContext as
|
|
9
|
-
import { useControllableState as
|
|
10
|
-
import { useModalContentBlockTransition as
|
|
11
|
-
import { useMeasuredElement as
|
|
12
|
-
import { useModalDrag as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
import { jsx as u, jsxs as _e } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as A, useState as l, useMemo as Y, useLayoutEffect as Me, useEffect as X, useCallback as v } from "react";
|
|
4
|
+
import { Dialog as I } from "@base-ui-components/react/dialog";
|
|
5
|
+
import ht from "@orioncactuscorp/icons/orioncactus/CloseThick";
|
|
6
|
+
import gt from "../BackgroundIconButton/BackgroundIconButton.js";
|
|
7
|
+
import { mergeRefs as De } from "../../utils/mergeRefs.js";
|
|
8
|
+
import { useModalContext as Z, ModalProvider as bt } from "./contexts.js";
|
|
9
|
+
import { useControllableState as vt } from "./useControllableState.js";
|
|
10
|
+
import { useModalContentBlockTransition as yt } from "./useModalContentBlockTransition.js";
|
|
11
|
+
import { useMeasuredElement as We } from "./useElementSize.js";
|
|
12
|
+
import { useModalDrag as St } from "./useModalDrag.js";
|
|
13
|
+
import { useModalKeyboardAvoidance as kt } from "./useModalKeyboardAvoidance.js";
|
|
14
|
+
import { useModalPlacement as Mt } from "./useModalPlacement.js";
|
|
15
|
+
import { useModalStackDepth as Ct } from "./useModalStackDepth.js";
|
|
16
|
+
import { useModalViewportGeometry as Nt } from "./useModalViewportGeometry.js";
|
|
17
|
+
import { resolveContentSizedBottomSheetHeight as wt } from "./bottomSheetGeometry.js";
|
|
18
|
+
import { getModalScrollState as Ht } from "./modalScrollArbitration.js";
|
|
19
|
+
import { resolveModalInitialFocus as xt } from "./initialFocus.js";
|
|
20
|
+
import { useModalBodyScrollState as Tt, ModalBodyFrame as Rt, ModalSurfaceFrame as Ft, resolveModalFooterBackground as Bt, ModalFooterFrame as Pt, ModalHeaderFrame as At, ModalNavigationSectionFrame as Dt, mergeModalClassName as Et } from "../internal/ModalPresentation.js";
|
|
21
|
+
import { OverlayPortalProvider as Vt } from "../internal/OverlayPortalContext.js";
|
|
22
|
+
import { resolveModalSnapMetrics as jt, resolveModalPopupSnapPositions as It } from "./snapPoints.js";
|
|
23
|
+
import N from "./Modal.module.scss.js";
|
|
24
|
+
const $t = /* @__PURE__ */ new Set([
|
|
25
|
+
"oc-modal-reject-shake",
|
|
26
|
+
"oc-modal-reject-shake-replay"
|
|
27
|
+
]), Ne = Et;
|
|
28
|
+
function Lt(e) {
|
|
23
29
|
if (!e) return;
|
|
24
30
|
const t = Object.entries(e).filter(
|
|
25
31
|
([n]) => n.startsWith("--")
|
|
@@ -27,91 +33,73 @@ function Bt(e) {
|
|
|
27
33
|
if (t.length !== 0)
|
|
28
34
|
return Object.fromEntries(t);
|
|
29
35
|
}
|
|
30
|
-
function
|
|
31
|
-
return typeof window > "u" ? 0 : window.visualViewport?.height ?? window.innerHeight;
|
|
32
|
-
}
|
|
33
|
-
function Pt(e) {
|
|
36
|
+
function Ot(e) {
|
|
34
37
|
const t = e.trim();
|
|
35
38
|
if (!t.endsWith("px")) return;
|
|
36
39
|
const n = Number.parseFloat(t);
|
|
37
40
|
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
38
41
|
}
|
|
39
|
-
function
|
|
42
|
+
function Kt(e) {
|
|
40
43
|
if (!(!e || typeof window > "u"))
|
|
41
|
-
return
|
|
44
|
+
return Ot(window.getComputedStyle(e).maxHeight);
|
|
42
45
|
}
|
|
43
|
-
function
|
|
46
|
+
function qt({
|
|
44
47
|
contentTransition: e,
|
|
45
48
|
placement: t,
|
|
46
49
|
resize: n
|
|
47
50
|
}) {
|
|
48
51
|
return e !== "auto" || n !== "content" || t === "full" ? "none" : t === "bottom" ? "sheet" : "surface";
|
|
49
52
|
}
|
|
50
|
-
function
|
|
53
|
+
function ze(e, t) {
|
|
51
54
|
return e.resolvedBackdrop === t ? e : {
|
|
52
55
|
resolvedBackdrop: t,
|
|
53
56
|
exiting: t === "hidden" && e.resolvedBackdrop !== "hidden"
|
|
54
57
|
};
|
|
55
58
|
}
|
|
56
|
-
function
|
|
57
|
-
const [t, n] = l($e);
|
|
58
|
-
return ue(() => {
|
|
59
|
-
if (!e || typeof window > "u") return;
|
|
60
|
-
const r = () => {
|
|
61
|
-
n($e());
|
|
62
|
-
};
|
|
63
|
-
return r(), window.addEventListener("resize", r), window.visualViewport?.addEventListener("resize", r), () => {
|
|
64
|
-
window.removeEventListener("resize", r), window.visualViewport?.removeEventListener(
|
|
65
|
-
"resize",
|
|
66
|
-
r
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
}, [e]), t;
|
|
70
|
-
}
|
|
71
|
-
function Vt(e) {
|
|
59
|
+
function _t(e) {
|
|
72
60
|
const t = e.trim();
|
|
73
61
|
return t.endsWith("ms") ? Number.parseFloat(t) || 0 : t.endsWith("s") ? (Number.parseFloat(t) || 0) * 1e3 : 0;
|
|
74
62
|
}
|
|
75
|
-
function
|
|
76
|
-
return e.split(",").reduce((t, n) => Math.max(t,
|
|
63
|
+
function we(e) {
|
|
64
|
+
return e.split(",").reduce((t, n) => Math.max(t, _t(n)), 0);
|
|
77
65
|
}
|
|
78
|
-
function
|
|
79
|
-
const t = window.getComputedStyle(e), n =
|
|
80
|
-
return n +
|
|
66
|
+
function Wt(e) {
|
|
67
|
+
const t = window.getComputedStyle(e), n = we(t.animationDuration), s = we(t.animationDelay);
|
|
68
|
+
return n + s + 250;
|
|
81
69
|
}
|
|
82
|
-
function
|
|
83
|
-
const t = window.getComputedStyle(e), n =
|
|
84
|
-
return n +
|
|
70
|
+
function zt(e) {
|
|
71
|
+
const t = window.getComputedStyle(e), n = we(t.transitionDuration), s = we(t.transitionDelay);
|
|
72
|
+
return n + s + 250;
|
|
85
73
|
}
|
|
86
|
-
function
|
|
74
|
+
function Gt({
|
|
87
75
|
defaultSnapPosition: e,
|
|
88
76
|
node: t,
|
|
89
77
|
snapPositions: n
|
|
90
78
|
}) {
|
|
91
79
|
if (!n?.length) return;
|
|
92
|
-
const
|
|
80
|
+
const s = It({
|
|
93
81
|
defaultSnapPosition: e,
|
|
94
82
|
snapPositions: n,
|
|
95
83
|
surfaceMotion: t
|
|
96
84
|
});
|
|
97
|
-
if (!
|
|
98
|
-
const
|
|
85
|
+
if (!s) return;
|
|
86
|
+
const c = s.defaultTarget;
|
|
99
87
|
t.style.setProperty(
|
|
100
88
|
"--oc-modal-translate-x",
|
|
101
|
-
|
|
89
|
+
c.settledTranslate?.x ?? `${c.x}px`
|
|
102
90
|
), t.style.setProperty(
|
|
103
91
|
"--oc-modal-translate-y",
|
|
104
|
-
|
|
92
|
+
c.settledTranslate?.y ?? `${c.y}px`
|
|
105
93
|
);
|
|
106
94
|
}
|
|
107
|
-
function
|
|
95
|
+
function Ut(e) {
|
|
108
96
|
if (e && typeof e == "object" && "reason" in e && typeof e.reason == "string")
|
|
109
97
|
return e.reason;
|
|
110
98
|
}
|
|
111
|
-
function
|
|
99
|
+
function Ce(e) {
|
|
112
100
|
e && typeof e == "object" && "cancel" in e && typeof e.cancel == "function" && e.cancel();
|
|
113
101
|
}
|
|
114
|
-
function
|
|
102
|
+
function Jt(e, t) {
|
|
115
103
|
switch (t) {
|
|
116
104
|
case "drag-dismiss":
|
|
117
105
|
return e?.drag ?? "auto";
|
|
@@ -129,22 +117,22 @@ function Ot(e, t) {
|
|
|
129
117
|
return e?.programmatic ?? "auto";
|
|
130
118
|
}
|
|
131
119
|
}
|
|
132
|
-
function
|
|
120
|
+
function Qt(e, t) {
|
|
133
121
|
return t > 0 && (e === "drag-dismiss" || e === "backdrop-press" || e === "outside-press");
|
|
134
122
|
}
|
|
135
|
-
function
|
|
123
|
+
function Ge(e, t) {
|
|
136
124
|
return t && (e === "backdrop-press" || e === "outside-press");
|
|
137
125
|
}
|
|
138
|
-
function
|
|
126
|
+
function Xt({
|
|
139
127
|
backdrop: e,
|
|
140
128
|
canSnapPopup: t,
|
|
141
129
|
placement: n,
|
|
142
|
-
presentationState:
|
|
130
|
+
presentationState: s
|
|
143
131
|
}) {
|
|
144
|
-
return e !== "auto" ? e : n === "bottom" &&
|
|
132
|
+
return e !== "auto" ? e : n === "bottom" && s === "peeked" || t ? "hidden" : "visible";
|
|
145
133
|
}
|
|
146
|
-
function
|
|
147
|
-
switch (
|
|
134
|
+
function Yt(e) {
|
|
135
|
+
switch (Ut(e)) {
|
|
148
136
|
case "close-press":
|
|
149
137
|
return "close-button";
|
|
150
138
|
case "outside-press":
|
|
@@ -163,433 +151,456 @@ function Ue({
|
|
|
163
151
|
children: e,
|
|
164
152
|
open: t,
|
|
165
153
|
defaultOpen: n,
|
|
166
|
-
modal:
|
|
167
|
-
onOpenChange:
|
|
168
|
-
canCloseAttempt:
|
|
169
|
-
onCloseAttempt:
|
|
154
|
+
modal: s = !0,
|
|
155
|
+
onOpenChange: c,
|
|
156
|
+
canCloseAttempt: h,
|
|
157
|
+
onCloseAttempt: y,
|
|
170
158
|
presentationState: S,
|
|
171
|
-
defaultPresentationState:
|
|
172
|
-
onPresentationStateChange:
|
|
173
|
-
disablePointerDismissal:
|
|
174
|
-
navigationDepth:
|
|
175
|
-
dismissBehavior:
|
|
159
|
+
defaultPresentationState: p = "visible",
|
|
160
|
+
onPresentationStateChange: H,
|
|
161
|
+
disablePointerDismissal: w,
|
|
162
|
+
navigationDepth: B = 0,
|
|
163
|
+
dismissBehavior: M
|
|
176
164
|
}) {
|
|
177
|
-
const
|
|
165
|
+
const k = t !== void 0, [ee, $] = l(
|
|
178
166
|
n ?? !1
|
|
179
|
-
),
|
|
167
|
+
), L = k ? t : ee, [te, He] = l("bottom"), [O, xe] = l(!1), [o, oe] = l(!1), [D, ue] = l(!1), [i, me] = l(!1), [pe, ne] = l(0), [W, E] = l(0), [fe, re] = l(null), [he, ge] = l(null), [be, ae] = l({
|
|
180
168
|
canScroll: !1,
|
|
181
169
|
scrolledFromTop: !1,
|
|
182
170
|
scrolledToBottom: !0
|
|
183
|
-
}), [
|
|
171
|
+
}), [f, g] = vt({
|
|
184
172
|
value: S,
|
|
185
|
-
defaultValue:
|
|
186
|
-
onChange:
|
|
187
|
-
}),
|
|
188
|
-
(a,
|
|
189
|
-
|
|
173
|
+
defaultValue: p,
|
|
174
|
+
onChange: H
|
|
175
|
+
}), x = We(), V = We(), se = Math.max(0, B), K = v(
|
|
176
|
+
(a, m) => {
|
|
177
|
+
k || $(a), c?.(a, m);
|
|
190
178
|
},
|
|
191
|
-
[
|
|
192
|
-
),
|
|
193
|
-
(a = { reason: "programmatic" }) =>
|
|
194
|
-
[
|
|
195
|
-
),
|
|
179
|
+
[c, k]
|
|
180
|
+
), C = v(
|
|
181
|
+
(a = { reason: "programmatic" }) => h?.(a) !== !1,
|
|
182
|
+
[h]
|
|
183
|
+
), d = v(
|
|
196
184
|
(a = { reason: "programmatic" }) => {
|
|
197
|
-
|
|
185
|
+
ne((m) => m + 1);
|
|
198
186
|
},
|
|
199
187
|
[]
|
|
200
|
-
),
|
|
201
|
-
|
|
202
|
-
}, []),
|
|
188
|
+
), q = v(() => {
|
|
189
|
+
E((a) => a + 1);
|
|
190
|
+
}, []), _ = v(
|
|
203
191
|
(a = { reason: "programmatic" }) => {
|
|
204
|
-
if (
|
|
192
|
+
if (Ge(a.reason, D))
|
|
205
193
|
return !1;
|
|
206
|
-
const
|
|
207
|
-
return
|
|
194
|
+
const m = Jt(M, a.reason);
|
|
195
|
+
return m === "allow" ? !0 : m === "block" ? !1 : !Qt(a.reason, se);
|
|
208
196
|
},
|
|
209
|
-
[
|
|
210
|
-
),
|
|
211
|
-
(a = { reason: "programmatic" },
|
|
212
|
-
const { commit:
|
|
213
|
-
return !
|
|
197
|
+
[D, M, se]
|
|
198
|
+
), P = v(
|
|
199
|
+
(a = { reason: "programmatic" }, m = {}) => {
|
|
200
|
+
const { commit: ve = !0, skipAttempt: T = !1 } = m;
|
|
201
|
+
return !T && Ge(a.reason, D) ? (Ce(a.eventDetails), !1) : !T && !_(a) || !T && !C(a) || !T && y?.(a) === !1 ? (Ce(a.eventDetails), d(a), !1) : (ve && K(!1, a.eventDetails), !0);
|
|
214
202
|
},
|
|
215
203
|
[
|
|
216
|
-
|
|
217
|
-
E,
|
|
218
|
-
V,
|
|
219
|
-
d,
|
|
204
|
+
C,
|
|
220
205
|
D,
|
|
221
|
-
|
|
206
|
+
_,
|
|
207
|
+
K,
|
|
208
|
+
d,
|
|
209
|
+
y
|
|
222
210
|
]
|
|
223
|
-
),
|
|
224
|
-
(a,
|
|
225
|
-
if (a &&
|
|
226
|
-
|
|
227
|
-
reason:
|
|
228
|
-
eventDetails:
|
|
211
|
+
), ce = v(
|
|
212
|
+
(a, m) => {
|
|
213
|
+
if (a && f === "peeked" && g("visible"), !a) {
|
|
214
|
+
P({
|
|
215
|
+
reason: Yt(m),
|
|
216
|
+
eventDetails: m
|
|
229
217
|
});
|
|
230
218
|
return;
|
|
231
219
|
}
|
|
232
|
-
|
|
220
|
+
K(a, m);
|
|
233
221
|
},
|
|
234
|
-
[
|
|
235
|
-
),
|
|
222
|
+
[K, f, P, g]
|
|
223
|
+
), z = f === "visible" && !i ? s : !1, ie = w || te === "bottom" && (O || i), j = Y(
|
|
236
224
|
() => ({
|
|
237
|
-
open:
|
|
238
|
-
modal:
|
|
239
|
-
placement:
|
|
240
|
-
setPlacement:
|
|
241
|
-
presentationState:
|
|
242
|
-
setPresentationState:
|
|
243
|
-
requestClose:
|
|
244
|
-
canDismissByBehavior:
|
|
245
|
-
canCloseAttempt:
|
|
246
|
-
closeAttemptFeedbackKey:
|
|
247
|
-
notifyCloseAttemptRejected:
|
|
248
|
-
disablePointerDismissal:
|
|
249
|
-
setBackdropDismissalDisabled:
|
|
250
|
-
setBackgroundInteractive:
|
|
251
|
-
canPeek:
|
|
252
|
-
setCanPeek:
|
|
225
|
+
open: L,
|
|
226
|
+
modal: z,
|
|
227
|
+
placement: te,
|
|
228
|
+
setPlacement: He,
|
|
229
|
+
presentationState: f,
|
|
230
|
+
setPresentationState: g,
|
|
231
|
+
requestClose: P,
|
|
232
|
+
canDismissByBehavior: _,
|
|
233
|
+
canCloseAttempt: C,
|
|
234
|
+
closeAttemptFeedbackKey: pe,
|
|
235
|
+
notifyCloseAttemptRejected: d,
|
|
236
|
+
disablePointerDismissal: w ?? !1,
|
|
237
|
+
setBackdropDismissalDisabled: ue,
|
|
238
|
+
setBackgroundInteractive: me,
|
|
239
|
+
canPeek: O,
|
|
240
|
+
setCanPeek: xe,
|
|
253
241
|
canRenderHandle: o,
|
|
254
|
-
setCanRenderHandle:
|
|
255
|
-
popupSnapLayoutVersion:
|
|
256
|
-
notifyPopupSnapLayoutChange:
|
|
257
|
-
headerHeight:
|
|
258
|
-
footerHeight:
|
|
259
|
-
setHeaderNode:
|
|
242
|
+
setCanRenderHandle: oe,
|
|
243
|
+
popupSnapLayoutVersion: W,
|
|
244
|
+
notifyPopupSnapLayoutChange: q,
|
|
245
|
+
headerHeight: x.height,
|
|
246
|
+
footerHeight: V.height,
|
|
247
|
+
setHeaderNode: x.setNode,
|
|
260
248
|
titleNode: he,
|
|
261
|
-
setTitleNode:
|
|
262
|
-
setFooterNode:
|
|
249
|
+
setTitleNode: ge,
|
|
250
|
+
setFooterNode: V.setNode,
|
|
263
251
|
bodyNode: fe,
|
|
264
|
-
setBodyNode:
|
|
265
|
-
scrollState:
|
|
266
|
-
setScrollState:
|
|
252
|
+
setBodyNode: re,
|
|
253
|
+
scrollState: be,
|
|
254
|
+
setScrollState: ae
|
|
267
255
|
}),
|
|
268
256
|
[
|
|
269
257
|
fe,
|
|
270
|
-
I,
|
|
271
|
-
o,
|
|
272
|
-
V,
|
|
273
|
-
P,
|
|
274
|
-
ae,
|
|
275
|
-
z.height,
|
|
276
|
-
z.setNode,
|
|
277
|
-
B.height,
|
|
278
|
-
B.setNode,
|
|
279
|
-
T,
|
|
280
|
-
D,
|
|
281
258
|
O,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
259
|
+
o,
|
|
260
|
+
_,
|
|
261
|
+
C,
|
|
262
|
+
pe,
|
|
263
|
+
V.height,
|
|
264
|
+
V.setNode,
|
|
265
|
+
x.height,
|
|
266
|
+
x.setNode,
|
|
267
|
+
z,
|
|
268
|
+
d,
|
|
285
269
|
q,
|
|
270
|
+
W,
|
|
271
|
+
L,
|
|
272
|
+
te,
|
|
273
|
+
P,
|
|
274
|
+
be,
|
|
286
275
|
w,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
U,
|
|
276
|
+
f,
|
|
277
|
+
g,
|
|
278
|
+
ge,
|
|
291
279
|
he
|
|
292
280
|
]
|
|
293
281
|
);
|
|
294
|
-
return /* @__PURE__ */ u(
|
|
295
|
-
|
|
282
|
+
return /* @__PURE__ */ u(bt, { value: j, children: /* @__PURE__ */ u(
|
|
283
|
+
I.Root,
|
|
296
284
|
{
|
|
297
|
-
open:
|
|
298
|
-
modal:
|
|
299
|
-
onOpenChange:
|
|
300
|
-
disablePointerDismissal:
|
|
285
|
+
open: L,
|
|
286
|
+
modal: z,
|
|
287
|
+
onOpenChange: ce,
|
|
288
|
+
disablePointerDismissal: ie,
|
|
301
289
|
children: e
|
|
302
290
|
}
|
|
303
291
|
) });
|
|
304
292
|
}
|
|
305
|
-
function
|
|
293
|
+
function Zt({
|
|
306
294
|
className: e = "",
|
|
307
295
|
children: t,
|
|
308
296
|
render: n,
|
|
309
|
-
nativeButton:
|
|
297
|
+
nativeButton: s
|
|
310
298
|
}) {
|
|
311
299
|
return n ? /* @__PURE__ */ u(
|
|
312
|
-
|
|
300
|
+
I.Trigger,
|
|
313
301
|
{
|
|
314
302
|
render: n,
|
|
315
|
-
nativeButton:
|
|
303
|
+
nativeButton: s,
|
|
316
304
|
"data-oc-component": "modal-trigger",
|
|
317
305
|
children: t
|
|
318
306
|
}
|
|
319
307
|
) : /* @__PURE__ */ u(
|
|
320
|
-
|
|
308
|
+
I.Trigger,
|
|
321
309
|
{
|
|
322
|
-
className:
|
|
323
|
-
nativeButton:
|
|
310
|
+
className: Ne(N.trigger, e),
|
|
311
|
+
nativeButton: s,
|
|
324
312
|
"data-oc-component": "modal-trigger",
|
|
325
313
|
children: t
|
|
326
314
|
}
|
|
327
315
|
);
|
|
328
316
|
}
|
|
329
|
-
function
|
|
317
|
+
function eo({
|
|
330
318
|
className: e = "",
|
|
331
319
|
children: t,
|
|
332
320
|
variant: n = "adaptive",
|
|
333
|
-
size:
|
|
334
|
-
resize:
|
|
335
|
-
contentTransition:
|
|
336
|
-
backdrop:
|
|
321
|
+
size: s = "medium",
|
|
322
|
+
resize: c = "content",
|
|
323
|
+
contentTransition: h = "auto",
|
|
324
|
+
backdrop: y = "auto",
|
|
337
325
|
backdropFrom: S,
|
|
338
|
-
drag:
|
|
339
|
-
peekable:
|
|
340
|
-
snapPoints:
|
|
341
|
-
defaultSnapPoint:
|
|
342
|
-
snapPositions:
|
|
343
|
-
defaultSnapPosition:
|
|
344
|
-
initialFocus:
|
|
345
|
-
peekHeight:
|
|
346
|
-
closeThreshold:
|
|
347
|
-
scrollLockTimeout:
|
|
348
|
-
container:
|
|
349
|
-
style:
|
|
350
|
-
...
|
|
326
|
+
drag: p = "content",
|
|
327
|
+
peekable: H = !1,
|
|
328
|
+
snapPoints: w,
|
|
329
|
+
defaultSnapPoint: B,
|
|
330
|
+
snapPositions: M,
|
|
331
|
+
defaultSnapPosition: k,
|
|
332
|
+
initialFocus: ee,
|
|
333
|
+
peekHeight: $,
|
|
334
|
+
closeThreshold: L,
|
|
335
|
+
scrollLockTimeout: te,
|
|
336
|
+
container: He,
|
|
337
|
+
style: O,
|
|
338
|
+
...xe
|
|
351
339
|
}) {
|
|
352
|
-
const o =
|
|
340
|
+
const o = Z("ModalContent"), { setCanPeek: oe, setCanRenderHandle: D, setPlacement: ue } = o, i = Mt(n), me = A(null), pe = A(null), ne = A(null), W = A(null), [E, fe] = l(null), [re, he] = l(
|
|
353
341
|
null
|
|
354
|
-
),
|
|
355
|
-
backdrop:
|
|
356
|
-
canSnapPopup:
|
|
357
|
-
placement:
|
|
342
|
+
), [ge, be] = l(null), ae = A(0), f = A(null), g = A(null), x = A(null), [V, se] = l(), K = p === "handle" || p === "content", C = i === "popup" && K && !!M?.length, d = Xt({
|
|
343
|
+
backdrop: y,
|
|
344
|
+
canSnapPopup: C,
|
|
345
|
+
placement: i,
|
|
358
346
|
presentationState: o.presentationState
|
|
359
|
-
}), [
|
|
347
|
+
}), [q, _] = l(() => ({
|
|
360
348
|
resolvedBackdrop: d,
|
|
361
349
|
exiting: !1
|
|
362
|
-
})),
|
|
363
|
-
() =>
|
|
364
|
-
[
|
|
365
|
-
),
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
350
|
+
})), P = Y(
|
|
351
|
+
() => ze(q, d),
|
|
352
|
+
[q, d]
|
|
353
|
+
), ce = P.exiting, z = C && d === "hidden", ie = (i === "bottom" || C) && K, j = i === "bottom" && ie && H, a = j && $ !== void 0 ? $ : o.headerHeight > 0 ? o.headerHeight : void 0, m = i === "bottom" && c !== "fixed", ve = Nt(o.open), T = kt({
|
|
354
|
+
bodyNode: o.bodyNode,
|
|
355
|
+
enabled: o.open && i === "bottom",
|
|
356
|
+
footerHeight: o.footerHeight,
|
|
357
|
+
surfaceNode: E,
|
|
358
|
+
viewportGeometry: ve,
|
|
359
|
+
viewportNode: ge
|
|
360
|
+
}), G = i === "bottom" ? T.viewportGeometry : ve, ye = G?.height ?? 0, Qe = Y(() => {
|
|
361
|
+
if (!(!w?.length || ye <= 0))
|
|
362
|
+
return jt({
|
|
363
|
+
snapPoints: w,
|
|
364
|
+
defaultSnapPoint: B,
|
|
372
365
|
backdropFrom: S,
|
|
373
|
-
viewportHeight:
|
|
366
|
+
viewportHeight: ye
|
|
374
367
|
});
|
|
375
|
-
}, [S,
|
|
376
|
-
contentTransition:
|
|
377
|
-
placement:
|
|
378
|
-
resize:
|
|
379
|
-
}),
|
|
380
|
-
|
|
381
|
-
enabled: o.open &&
|
|
382
|
-
node:
|
|
383
|
-
}),
|
|
384
|
-
if (
|
|
385
|
-
|
|
368
|
+
}, [S, B, w, ye]), R = i === "bottom" ? Qe : void 0, Xe = Ct(o.open), [Se, Ye] = l(0), ke = A(!1), Ze = R !== void 0 && m, Te = m && Se > 0 ? Se : void 0, U = R ? Ze && Te !== void 0 ? Te : R.sheetHeight : Te, et = R && U !== void 0 ? Math.max(0, U - R.defaultHeight) : void 0, tt = U !== void 0, Re = qt({
|
|
369
|
+
contentTransition: h,
|
|
370
|
+
placement: i,
|
|
371
|
+
resize: c
|
|
372
|
+
}), ot = Re === "surface" ? "auto" : "none", nt = Re === "sheet" ? "auto" : "none", Ee = o.bodyNode;
|
|
373
|
+
yt({
|
|
374
|
+
enabled: o.open && Re === "surface",
|
|
375
|
+
node: re
|
|
376
|
+
}), Me(() => {
|
|
377
|
+
if (!m) {
|
|
378
|
+
ke.current = !1;
|
|
386
379
|
return;
|
|
387
380
|
}
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
390
|
-
|
|
381
|
+
const r = Ee?.firstElementChild;
|
|
382
|
+
if (!r) {
|
|
383
|
+
ke.current = !1;
|
|
391
384
|
return;
|
|
392
385
|
}
|
|
393
|
-
const
|
|
394
|
-
const
|
|
395
|
-
contentHeight:
|
|
396
|
-
maxHeight:
|
|
397
|
-
snapHeight:
|
|
398
|
-
}),
|
|
399
|
-
|
|
386
|
+
const b = () => {
|
|
387
|
+
const Q = r.getBoundingClientRect().height, le = wt({
|
|
388
|
+
contentHeight: Q,
|
|
389
|
+
maxHeight: Kt(E),
|
|
390
|
+
snapHeight: R?.sheetHeight
|
|
391
|
+
}), qe = Math.abs(Se - le) > 0.5;
|
|
392
|
+
ke.current = qe, qe && Ye(le);
|
|
400
393
|
};
|
|
401
|
-
if (
|
|
402
|
-
const
|
|
403
|
-
return
|
|
394
|
+
if (b(), typeof ResizeObserver > "u") return;
|
|
395
|
+
const F = new ResizeObserver(b);
|
|
396
|
+
return F.observe(r), () => F.disconnect();
|
|
404
397
|
}, [
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
]),
|
|
412
|
-
|
|
413
|
-
}, [
|
|
414
|
-
o.open || (
|
|
415
|
-
}, [o.open]),
|
|
416
|
-
const
|
|
417
|
-
() =>
|
|
398
|
+
Ee,
|
|
399
|
+
m,
|
|
400
|
+
R?.sheetHeight,
|
|
401
|
+
Se,
|
|
402
|
+
ye,
|
|
403
|
+
E
|
|
404
|
+
]), X(() => {
|
|
405
|
+
ue(i);
|
|
406
|
+
}, [i, ue]), X(() => {
|
|
407
|
+
o.open || (W.current = null);
|
|
408
|
+
}, [o.open]), X(() => (oe(j), () => oe(!1)), [j, oe]), X(() => (D(ie), () => D(!1)), [ie, D]);
|
|
409
|
+
const rt = v(
|
|
410
|
+
() => ke.current,
|
|
418
411
|
[]
|
|
419
|
-
),
|
|
420
|
-
|
|
421
|
-
}, [
|
|
422
|
-
Le(!
|
|
412
|
+
), Ve = o.bodyNode, je = o.setScrollState, at = v(() => {
|
|
413
|
+
je(Ht(Ve));
|
|
414
|
+
}, [Ve, je]), Ie = R?.backdropFromHeight, [$e, Le] = l(!1), st = v((r) => {
|
|
415
|
+
Le(!r);
|
|
423
416
|
}, []);
|
|
424
|
-
!o.open &&
|
|
425
|
-
const
|
|
426
|
-
enabled:
|
|
427
|
-
drag:
|
|
417
|
+
!o.open && $e && Le(!1);
|
|
418
|
+
const Fe = Ie !== void 0 && $e, { collapseBottomSheetToUndimmedSnap: Be, handlers: ct } = St({
|
|
419
|
+
enabled: p !== !1 && !T.active,
|
|
420
|
+
drag: p,
|
|
428
421
|
open: o.open,
|
|
429
|
-
placement:
|
|
430
|
-
surfaceMotionRef:
|
|
431
|
-
surfaceMotionNode:
|
|
432
|
-
backdropRef:
|
|
422
|
+
placement: i,
|
|
423
|
+
surfaceMotionRef: me,
|
|
424
|
+
surfaceMotionNode: E,
|
|
425
|
+
backdropRef: ne,
|
|
433
426
|
bodyNode: o.bodyNode,
|
|
434
|
-
snapHeights:
|
|
435
|
-
sheetHeight:
|
|
436
|
-
backdropFromHeight:
|
|
437
|
-
onBackdropDimRestChange:
|
|
438
|
-
peekHeight:
|
|
439
|
-
peekFallback:
|
|
427
|
+
snapHeights: R?.snapHeights,
|
|
428
|
+
sheetHeight: U,
|
|
429
|
+
backdropFromHeight: Ie,
|
|
430
|
+
onBackdropDimRestChange: st,
|
|
431
|
+
peekHeight: j ? $ : void 0,
|
|
432
|
+
peekFallback: j ? "header" : void 0,
|
|
440
433
|
presentationState: o.presentationState,
|
|
441
434
|
setPresentationState: o.setPresentationState,
|
|
442
435
|
requestClose: o.requestClose,
|
|
443
436
|
canCloseAttempt: o.canCloseAttempt,
|
|
444
437
|
dismissible: !o.disablePointerDismissal && o.canDismissByBehavior({ reason: "drag-dismiss" }),
|
|
445
438
|
backdropHidden: d === "hidden",
|
|
446
|
-
visibleTranslate:
|
|
447
|
-
shouldDeferBottomSettle:
|
|
448
|
-
refreshScrollState:
|
|
449
|
-
snapPositions:
|
|
450
|
-
defaultSnapPosition:
|
|
451
|
-
closeThreshold:
|
|
452
|
-
scrollLockTimeout:
|
|
439
|
+
visibleTranslate: et,
|
|
440
|
+
shouldDeferBottomSettle: rt,
|
|
441
|
+
refreshScrollState: at,
|
|
442
|
+
snapPositions: C ? M : void 0,
|
|
443
|
+
defaultSnapPosition: k,
|
|
444
|
+
closeThreshold: L,
|
|
445
|
+
scrollLockTimeout: te,
|
|
453
446
|
popupSnapLayoutVersion: o.popupSnapLayoutVersion
|
|
454
|
-
}),
|
|
455
|
-
(
|
|
456
|
-
|
|
457
|
-
defaultSnapPosition:
|
|
458
|
-
node:
|
|
459
|
-
snapPositions:
|
|
460
|
-
}),
|
|
447
|
+
}), it = v(
|
|
448
|
+
(r) => {
|
|
449
|
+
me.current = r, fe(r), r && o.open && C && W.current !== r && (Gt({
|
|
450
|
+
defaultSnapPosition: k,
|
|
451
|
+
node: r,
|
|
452
|
+
snapPositions: M
|
|
453
|
+
}), W.current = r);
|
|
461
454
|
},
|
|
462
|
-
[
|
|
463
|
-
),
|
|
464
|
-
|
|
455
|
+
[C, o.open, k, M]
|
|
456
|
+
), dt = v((r) => {
|
|
457
|
+
pe.current = r, he(r);
|
|
465
458
|
}, []);
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
|
|
459
|
+
X(() => {
|
|
460
|
+
const r = o.closeAttemptFeedbackKey, b = () => {
|
|
461
|
+
se(void 0), g.current = null;
|
|
462
|
+
};
|
|
463
|
+
if (r === 0) {
|
|
464
|
+
ae.current = r, b();
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
if (i !== "popup") {
|
|
468
|
+
b();
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
if (ae.current === r) {
|
|
472
|
+
b();
|
|
470
473
|
return;
|
|
471
474
|
}
|
|
472
|
-
const
|
|
473
|
-
if (!
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
}, X = (le) => {
|
|
478
|
-
le.target === p && le.animationName === "oc-modal-reject-shake" && (p.removeEventListener("animationend", X), C.current !== null && window.clearTimeout(C.current), de());
|
|
475
|
+
const F = re;
|
|
476
|
+
if (!F) return;
|
|
477
|
+
ae.current = r, f.current !== null && window.cancelAnimationFrame(f.current), g.current !== null && window.clearTimeout(g.current), b();
|
|
478
|
+
const Q = (le) => {
|
|
479
|
+
le.target === F && $t.has(le.animationName) && (F.removeEventListener("animationend", Q), g.current !== null && window.clearTimeout(g.current), b());
|
|
479
480
|
};
|
|
480
|
-
return
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
},
|
|
481
|
+
return F.addEventListener("animationend", Q), f.current = window.requestAnimationFrame(() => {
|
|
482
|
+
f.current = null, se(r), f.current = window.requestAnimationFrame(() => {
|
|
483
|
+
f.current = null, g.current = window.setTimeout(() => {
|
|
484
|
+
F.removeEventListener("animationend", Q), b();
|
|
485
|
+
}, Wt(F));
|
|
485
486
|
});
|
|
486
487
|
}), () => {
|
|
487
|
-
|
|
488
|
+
F.removeEventListener("animationend", Q), f.current !== null && (window.cancelAnimationFrame(f.current), f.current = null), g.current !== null && (window.clearTimeout(g.current), g.current = null);
|
|
488
489
|
};
|
|
489
|
-
}, [o.closeAttemptFeedbackKey,
|
|
490
|
-
const
|
|
491
|
-
...
|
|
490
|
+
}, [o.closeAttemptFeedbackKey, i, re]);
|
|
491
|
+
const Oe = Lt(O), lt = {
|
|
492
|
+
...Oe,
|
|
492
493
|
...o.headerHeight > 0 ? { "--oc-modal-header-height": `${o.headerHeight}px` } : {},
|
|
493
494
|
...o.footerHeight > 0 ? { "--oc-modal-footer-height": `${o.footerHeight}px` } : {},
|
|
494
|
-
...
|
|
495
|
-
...
|
|
495
|
+
...a !== void 0 ? { "--oc-modal-peek-height": `${a}px` } : {},
|
|
496
|
+
...U !== void 0 ? { "--oc-modal-sheet-height": `${U}px` } : {}
|
|
496
497
|
// `--oc-modal-translate-y` and the inline `height` are owned imperatively
|
|
497
498
|
// by the drag hook: content-size transitions pin the surface to a canvas
|
|
498
499
|
// height and compensate the translate in the same frame. Rendering the
|
|
499
500
|
// height here would commit the new size before that compensation runs and
|
|
500
501
|
// make the sheet jump a frame early. The managed sizing CSS rule renders
|
|
501
502
|
// the resting height from `--oc-modal-sheet-height`.
|
|
502
|
-
},
|
|
503
|
+
}, Ke = {
|
|
503
504
|
// Each modal reserves one backdrop slot and one viewport slot.
|
|
504
|
-
"--oc-modal-stack-offset":
|
|
505
|
-
},
|
|
506
|
-
...
|
|
505
|
+
"--oc-modal-stack-offset": Xe * 2
|
|
506
|
+
}, ut = {
|
|
507
|
+
...Ke,
|
|
508
|
+
"--_-modal-keyboard-inset": `${T.keyboardInset}px`,
|
|
509
|
+
"--_-modal-keyboard-inset-settled": `${T.settledKeyboardInset}px`,
|
|
510
|
+
...G ? {
|
|
511
|
+
"--_-modal-viewport-height": `${G.height}px`,
|
|
512
|
+
"--_-modal-viewport-offset-left": `${G.offsetLeft}px`,
|
|
513
|
+
"--_-modal-viewport-offset-top": `${G.offsetTop}px`,
|
|
514
|
+
"--_-modal-viewport-width": `${G.width}px`
|
|
515
|
+
} : {}
|
|
516
|
+
}, mt = o.headerHeight > 0 ? {
|
|
517
|
+
...O,
|
|
507
518
|
"--oc-modal-header-height": `${o.headerHeight}px`
|
|
508
|
-
} :
|
|
509
|
-
contentNode:
|
|
510
|
-
initialFocus:
|
|
519
|
+
} : O, pt = xt({
|
|
520
|
+
contentNode: E,
|
|
521
|
+
initialFocus: ee,
|
|
511
522
|
modal: o.modal,
|
|
512
523
|
titleNode: o.titleNode
|
|
513
|
-
}), { setBackdropDismissalDisabled:
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}, [
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
}, []),
|
|
520
|
-
d === "hidden" && (
|
|
521
|
-
const
|
|
522
|
-
|
|
524
|
+
}), { setBackdropDismissalDisabled: Pe, setBackgroundInteractive: Ae } = o, ft = d !== "hidden" || ce;
|
|
525
|
+
Me(() => {
|
|
526
|
+
P !== q && _(P);
|
|
527
|
+
}, [q, P]);
|
|
528
|
+
const J = v(() => {
|
|
529
|
+
x.current !== null && (window.clearTimeout(x.current), x.current = null);
|
|
530
|
+
}, []), de = v(() => {
|
|
531
|
+
d === "hidden" && (J(), _((r) => {
|
|
532
|
+
const b = ze(
|
|
533
|
+
r,
|
|
523
534
|
d
|
|
524
535
|
);
|
|
525
|
-
return
|
|
526
|
-
...
|
|
536
|
+
return b.resolvedBackdrop !== "hidden" || !b.exiting ? b : {
|
|
537
|
+
...b,
|
|
527
538
|
exiting: !1
|
|
528
539
|
};
|
|
529
540
|
}));
|
|
530
|
-
}, [
|
|
531
|
-
return
|
|
541
|
+
}, [J, d]);
|
|
542
|
+
return X(
|
|
532
543
|
() => () => {
|
|
533
|
-
|
|
544
|
+
J();
|
|
534
545
|
},
|
|
535
|
-
[
|
|
536
|
-
),
|
|
537
|
-
if (!
|
|
538
|
-
const
|
|
539
|
-
if (!
|
|
540
|
-
|
|
546
|
+
[J]
|
|
547
|
+
), Me(() => {
|
|
548
|
+
if (!ce || d !== "hidden") return;
|
|
549
|
+
const r = ne.current;
|
|
550
|
+
if (!r) {
|
|
551
|
+
x.current = window.setTimeout(de, 0);
|
|
541
552
|
return;
|
|
542
553
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
554
|
+
J(), x.current = window.setTimeout(
|
|
555
|
+
de,
|
|
556
|
+
zt(r)
|
|
546
557
|
);
|
|
547
558
|
}, [
|
|
548
|
-
|
|
559
|
+
J,
|
|
560
|
+
de,
|
|
549
561
|
ce,
|
|
550
|
-
V,
|
|
551
562
|
d
|
|
552
|
-
]),
|
|
553
|
-
|
|
563
|
+
]), Me(() => (Pe(d === "hidden"), Ae(z || Fe), () => {
|
|
564
|
+
Pe(!1), Ae(!1);
|
|
554
565
|
}), [
|
|
555
|
-
Te,
|
|
556
|
-
q,
|
|
557
|
-
d,
|
|
558
566
|
Fe,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
567
|
+
z,
|
|
568
|
+
d,
|
|
569
|
+
Pe,
|
|
570
|
+
Ae
|
|
571
|
+
]), /* @__PURE__ */ _e(I.Portal, { container: He, children: [
|
|
572
|
+
ft ? /* @__PURE__ */ u(
|
|
573
|
+
I.Backdrop,
|
|
563
574
|
{
|
|
564
|
-
ref:
|
|
565
|
-
className:
|
|
575
|
+
ref: ne,
|
|
576
|
+
className: N.backdrop,
|
|
566
577
|
"data-oc-part": "backdrop",
|
|
567
578
|
"data-oc-component": "modal-backdrop",
|
|
568
579
|
"data-oc-modal-backdrop": d,
|
|
569
|
-
"data-oc-modal-backdrop-passthrough":
|
|
570
|
-
"data-oc-modal-placement":
|
|
580
|
+
"data-oc-modal-backdrop-passthrough": Fe ? "true" : void 0,
|
|
581
|
+
"data-oc-modal-placement": i,
|
|
571
582
|
"data-oc-modal-presentation-state": o.presentationState,
|
|
572
|
-
style:
|
|
573
|
-
onTransitionCancel: (
|
|
574
|
-
|
|
583
|
+
style: Ke,
|
|
584
|
+
onTransitionCancel: (r) => {
|
|
585
|
+
r.currentTarget === r.target && r.propertyName === "opacity" && de();
|
|
575
586
|
},
|
|
576
|
-
onTransitionEnd: (
|
|
577
|
-
|
|
587
|
+
onTransitionEnd: (r) => {
|
|
588
|
+
r.currentTarget === r.target && r.propertyName === "opacity" && de();
|
|
578
589
|
},
|
|
579
590
|
onClick: () => {
|
|
580
591
|
if (o.disablePointerDismissal) {
|
|
581
|
-
if (
|
|
592
|
+
if (Be()) return;
|
|
582
593
|
o.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
583
594
|
return;
|
|
584
595
|
}
|
|
585
596
|
if (!o.canDismissByBehavior({ reason: "backdrop-press" })) {
|
|
586
|
-
if (
|
|
597
|
+
if (Be()) return;
|
|
587
598
|
o.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
588
599
|
return;
|
|
589
600
|
}
|
|
590
|
-
if (
|
|
601
|
+
if (i === "bottom" && j) {
|
|
591
602
|
if (o.presentationState === "visible") {
|
|
592
|
-
if (
|
|
603
|
+
if (Be()) return;
|
|
593
604
|
o.setPresentationState("peeked");
|
|
594
605
|
}
|
|
595
606
|
return;
|
|
@@ -599,246 +610,251 @@ function Ut({
|
|
|
599
610
|
}
|
|
600
611
|
) : null,
|
|
601
612
|
/* @__PURE__ */ u(
|
|
602
|
-
|
|
613
|
+
I.Viewport,
|
|
603
614
|
{
|
|
604
|
-
|
|
615
|
+
ref: be,
|
|
616
|
+
className: N.viewport,
|
|
605
617
|
"data-oc-part": "viewport",
|
|
606
618
|
"data-oc-component": "modal-viewport",
|
|
607
|
-
"data-oc-modal-placement":
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
619
|
+
"data-oc-modal-placement": i,
|
|
620
|
+
"data-oc-modal-keyboard-avoiding": T.active ? "true" : void 0,
|
|
621
|
+
style: ut,
|
|
622
|
+
children: /* @__PURE__ */ u(
|
|
623
|
+
I.Popup,
|
|
611
624
|
{
|
|
612
|
-
...
|
|
613
|
-
...
|
|
614
|
-
ref:
|
|
615
|
-
initialFocus:
|
|
616
|
-
className:
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
e
|
|
625
|
+
...xe,
|
|
626
|
+
...ct,
|
|
627
|
+
ref: it,
|
|
628
|
+
initialFocus: pt,
|
|
629
|
+
className: Ne(
|
|
630
|
+
N.surfaceMotion,
|
|
631
|
+
N[s],
|
|
632
|
+
e,
|
|
633
|
+
V === void 0 ? void 0 : V % 2 === 0 ? N.feedbackEven : N.feedbackOdd
|
|
620
634
|
),
|
|
621
635
|
"data-oc-part": "surface-motion",
|
|
622
636
|
"data-oc-component": "modal-content",
|
|
623
637
|
"data-oc-modal-backdrop": d,
|
|
624
638
|
"data-oc-variant": n,
|
|
625
|
-
"data-oc-size":
|
|
626
|
-
"data-oc-resize":
|
|
627
|
-
"data-oc-modal-feedback":
|
|
628
|
-
"data-oc-modal-placement":
|
|
629
|
-
"data-oc-modal-snapping":
|
|
630
|
-
"data-oc-modal-sheet-sizing":
|
|
631
|
-
"data-oc-modal-sheet-transition":
|
|
632
|
-
style:
|
|
633
|
-
children: [
|
|
634
|
-
|
|
639
|
+
"data-oc-size": s,
|
|
640
|
+
"data-oc-resize": c,
|
|
641
|
+
"data-oc-modal-feedback": i === "popup" && V !== void 0 ? "reject" : void 0,
|
|
642
|
+
"data-oc-modal-placement": i,
|
|
643
|
+
"data-oc-modal-snapping": R || C ? "true" : void 0,
|
|
644
|
+
"data-oc-modal-sheet-sizing": tt ? "managed" : void 0,
|
|
645
|
+
"data-oc-modal-sheet-transition": nt === "auto" ? "auto" : void 0,
|
|
646
|
+
style: lt,
|
|
647
|
+
children: /* @__PURE__ */ _e(Vt, { container: E, children: [
|
|
648
|
+
i === "bottom" ? /* @__PURE__ */ u(
|
|
635
649
|
"div",
|
|
636
650
|
{
|
|
637
651
|
"aria-hidden": "true",
|
|
638
|
-
className:
|
|
639
|
-
|
|
640
|
-
|
|
652
|
+
className: Ne(
|
|
653
|
+
N.bottomFill,
|
|
654
|
+
N[s],
|
|
641
655
|
e
|
|
642
656
|
),
|
|
643
657
|
"data-oc-part": "bottom-fill",
|
|
644
658
|
"data-oc-component": "modal-bottom-fill",
|
|
645
|
-
"data-oc-size":
|
|
646
|
-
style:
|
|
659
|
+
"data-oc-size": s,
|
|
660
|
+
style: Oe
|
|
647
661
|
}
|
|
648
662
|
) : null,
|
|
649
663
|
/* @__PURE__ */ u(
|
|
650
|
-
|
|
664
|
+
Ft,
|
|
651
665
|
{
|
|
652
|
-
ref:
|
|
666
|
+
ref: dt,
|
|
653
667
|
className: e,
|
|
654
|
-
contentTransition:
|
|
655
|
-
placement:
|
|
656
|
-
resize:
|
|
668
|
+
contentTransition: ot === "auto" ? "auto" : void 0,
|
|
669
|
+
placement: i,
|
|
670
|
+
resize: c,
|
|
657
671
|
scrollable: o.scrollState.canScroll,
|
|
658
|
-
size:
|
|
659
|
-
style:
|
|
672
|
+
size: s,
|
|
673
|
+
style: mt,
|
|
660
674
|
variant: n,
|
|
661
675
|
children: t
|
|
662
676
|
}
|
|
663
677
|
)
|
|
664
|
-
]
|
|
678
|
+
] })
|
|
665
679
|
}
|
|
666
680
|
)
|
|
667
681
|
}
|
|
668
682
|
)
|
|
669
683
|
] });
|
|
670
684
|
}
|
|
671
|
-
function
|
|
685
|
+
function to({
|
|
672
686
|
className: e = "",
|
|
673
687
|
title: t,
|
|
674
688
|
children: n,
|
|
675
|
-
leadingContent:
|
|
676
|
-
trailingContent:
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
689
|
+
leadingContent: s,
|
|
690
|
+
trailingContent: c,
|
|
691
|
+
bottomContent: h,
|
|
692
|
+
closeLabel: y = "닫기",
|
|
693
|
+
closeButton: S = !0,
|
|
694
|
+
handle: p = !0,
|
|
695
|
+
ref: H,
|
|
696
|
+
...w
|
|
682
697
|
}) {
|
|
683
|
-
const
|
|
684
|
-
() =>
|
|
685
|
-
[
|
|
686
|
-
),
|
|
687
|
-
() =>
|
|
698
|
+
const B = Z("ModalHeader"), { setHeaderNode: M, setTitleNode: k, scrollState: ee } = B, $ = Y(
|
|
699
|
+
() => De(M, H),
|
|
700
|
+
[H, M]
|
|
701
|
+
), L = Y(
|
|
702
|
+
() => De(k),
|
|
688
703
|
[k]
|
|
689
704
|
);
|
|
690
705
|
return /* @__PURE__ */ u(
|
|
691
|
-
|
|
706
|
+
At,
|
|
692
707
|
{
|
|
693
|
-
...
|
|
694
|
-
ref:
|
|
708
|
+
...w,
|
|
709
|
+
ref: $,
|
|
710
|
+
bottomSlot: h,
|
|
695
711
|
className: e,
|
|
696
|
-
closeContent:
|
|
697
|
-
handleContent:
|
|
712
|
+
closeContent: S ? /* @__PURE__ */ u(Je, { label: y }) : null,
|
|
713
|
+
handleContent: p && B.canRenderHandle ? /* @__PURE__ */ u(
|
|
698
714
|
"div",
|
|
699
715
|
{
|
|
700
716
|
"aria-hidden": "true",
|
|
701
|
-
className:
|
|
717
|
+
className: N.handle,
|
|
702
718
|
"data-oc-part": "handle"
|
|
703
719
|
}
|
|
704
720
|
) : null,
|
|
705
|
-
leadingContent:
|
|
706
|
-
sticky:
|
|
721
|
+
leadingContent: s,
|
|
722
|
+
sticky: ee.scrolledFromTop,
|
|
707
723
|
titleContent: t ? /* @__PURE__ */ u(
|
|
708
|
-
|
|
724
|
+
I.Title,
|
|
709
725
|
{
|
|
710
|
-
ref:
|
|
711
|
-
className:
|
|
726
|
+
ref: L,
|
|
727
|
+
className: N.initialFocusTitle,
|
|
712
728
|
tabIndex: -1,
|
|
713
729
|
children: t
|
|
714
730
|
}
|
|
715
731
|
) : void 0,
|
|
716
|
-
trailingContent:
|
|
732
|
+
trailingContent: c,
|
|
717
733
|
children: n
|
|
718
734
|
}
|
|
719
735
|
);
|
|
720
736
|
}
|
|
721
|
-
function
|
|
737
|
+
function oo({
|
|
722
738
|
handle: e = !0,
|
|
723
739
|
...t
|
|
724
740
|
}) {
|
|
725
|
-
const n =
|
|
726
|
-
canRenderHandle:
|
|
727
|
-
notifyPopupSnapLayoutChange:
|
|
728
|
-
placement:
|
|
741
|
+
const n = Z("ModalNavigationSection"), {
|
|
742
|
+
canRenderHandle: s,
|
|
743
|
+
notifyPopupSnapLayoutChange: c,
|
|
744
|
+
placement: h
|
|
729
745
|
} = n;
|
|
730
746
|
return /* @__PURE__ */ u(
|
|
731
|
-
|
|
747
|
+
Dt,
|
|
732
748
|
{
|
|
733
749
|
...t,
|
|
734
|
-
canRenderHandle: e &&
|
|
750
|
+
canRenderHandle: e && s,
|
|
735
751
|
onPanelMotionStateChange: () => {
|
|
736
|
-
|
|
752
|
+
h === "popup" && c();
|
|
737
753
|
}
|
|
738
754
|
}
|
|
739
755
|
);
|
|
740
756
|
}
|
|
741
|
-
function
|
|
757
|
+
function no({
|
|
742
758
|
className: e = "",
|
|
743
759
|
children: t,
|
|
744
760
|
layout: n = "content",
|
|
745
|
-
containerClassName:
|
|
746
|
-
containerProps:
|
|
747
|
-
ref:
|
|
748
|
-
...
|
|
761
|
+
containerClassName: s = "",
|
|
762
|
+
containerProps: c,
|
|
763
|
+
ref: h,
|
|
764
|
+
...y
|
|
749
765
|
}) {
|
|
750
|
-
const S =
|
|
751
|
-
bodyNode:
|
|
752
|
-
bodyRef:
|
|
753
|
-
setBodyNode:
|
|
754
|
-
setScrollState:
|
|
766
|
+
const S = Z("ModalBody"), { bodyNode: p, setBodyNode: H, setScrollState: w } = S, { setBodyRef: B, updateScrollState: M } = Tt({
|
|
767
|
+
bodyNode: p,
|
|
768
|
+
bodyRef: h,
|
|
769
|
+
setBodyNode: H,
|
|
770
|
+
setScrollState: w
|
|
755
771
|
});
|
|
756
772
|
return /* @__PURE__ */ u(
|
|
757
|
-
|
|
773
|
+
Rt,
|
|
758
774
|
{
|
|
759
775
|
bodyContainerProps: {
|
|
760
|
-
ref:
|
|
761
|
-
onScroll: (
|
|
762
|
-
|
|
776
|
+
ref: B,
|
|
777
|
+
onScroll: (k) => {
|
|
778
|
+
c?.onScroll?.(k), M(k.currentTarget);
|
|
763
779
|
}
|
|
764
780
|
},
|
|
765
|
-
bodyContentProps: { ...
|
|
781
|
+
bodyContentProps: { ...c, className: s },
|
|
766
782
|
layout: n,
|
|
767
|
-
scrollAreaProps: { ...
|
|
783
|
+
scrollAreaProps: { ...y, className: e },
|
|
768
784
|
children: t
|
|
769
785
|
}
|
|
770
786
|
);
|
|
771
787
|
}
|
|
772
|
-
function
|
|
788
|
+
function ro({
|
|
773
789
|
className: e = "",
|
|
774
790
|
children: t,
|
|
775
791
|
background: n = "auto",
|
|
776
|
-
ref:
|
|
777
|
-
...
|
|
792
|
+
ref: s,
|
|
793
|
+
...c
|
|
778
794
|
}) {
|
|
779
|
-
const
|
|
780
|
-
() =>
|
|
781
|
-
[
|
|
782
|
-
),
|
|
795
|
+
const h = Z("ModalFooter"), { scrollState: y, setFooterNode: S } = h, p = Y(
|
|
796
|
+
() => De(S, s),
|
|
797
|
+
[s, S]
|
|
798
|
+
), H = Bt(
|
|
783
799
|
n,
|
|
784
|
-
|
|
800
|
+
y
|
|
785
801
|
);
|
|
786
802
|
return /* @__PURE__ */ u(
|
|
787
|
-
|
|
803
|
+
Pt,
|
|
788
804
|
{
|
|
789
|
-
...
|
|
790
|
-
ref:
|
|
791
|
-
backgroundActive:
|
|
805
|
+
...c,
|
|
806
|
+
ref: p,
|
|
807
|
+
backgroundActive: H,
|
|
792
808
|
className: e,
|
|
793
809
|
children: t
|
|
794
810
|
}
|
|
795
811
|
);
|
|
796
812
|
}
|
|
797
|
-
function
|
|
813
|
+
function Je({
|
|
798
814
|
className: e = "",
|
|
799
|
-
children: t = /* @__PURE__ */ u(
|
|
815
|
+
children: t = /* @__PURE__ */ u(ht, {}),
|
|
800
816
|
label: n = "닫기",
|
|
801
|
-
size:
|
|
802
|
-
disabled:
|
|
803
|
-
onClick:
|
|
804
|
-
...
|
|
817
|
+
size: s = 24,
|
|
818
|
+
disabled: c,
|
|
819
|
+
onClick: h,
|
|
820
|
+
...y
|
|
805
821
|
}) {
|
|
806
|
-
const S =
|
|
822
|
+
const S = Z("ModalClose");
|
|
807
823
|
return /* @__PURE__ */ u(
|
|
808
|
-
|
|
824
|
+
gt,
|
|
809
825
|
{
|
|
810
|
-
...
|
|
811
|
-
className:
|
|
812
|
-
"aria-label":
|
|
826
|
+
...y,
|
|
827
|
+
className: Ne(N.close, e),
|
|
828
|
+
"aria-label": y["aria-label"] ?? n,
|
|
813
829
|
"data-oc-part": "close",
|
|
814
830
|
"data-oc-component": "modal-close",
|
|
815
|
-
disabled:
|
|
816
|
-
onClick: (
|
|
817
|
-
|
|
831
|
+
disabled: c,
|
|
832
|
+
onClick: (p) => {
|
|
833
|
+
h?.(p), !p.defaultPrevented && !c && S.requestClose({ reason: "close-button" });
|
|
818
834
|
},
|
|
819
|
-
size:
|
|
835
|
+
size: s,
|
|
820
836
|
children: t
|
|
821
837
|
}
|
|
822
838
|
);
|
|
823
839
|
}
|
|
824
|
-
const
|
|
840
|
+
const To = Object.assign(Ue, {
|
|
825
841
|
Root: Ue,
|
|
826
|
-
Trigger:
|
|
827
|
-
Content:
|
|
828
|
-
Header:
|
|
829
|
-
NavigationSection:
|
|
830
|
-
Body:
|
|
831
|
-
Footer:
|
|
832
|
-
Close:
|
|
842
|
+
Trigger: Zt,
|
|
843
|
+
Content: eo,
|
|
844
|
+
Header: to,
|
|
845
|
+
NavigationSection: oo,
|
|
846
|
+
Body: no,
|
|
847
|
+
Footer: ro,
|
|
848
|
+
Close: Je
|
|
833
849
|
});
|
|
834
850
|
export {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
851
|
+
no as ModalBody,
|
|
852
|
+
Je as ModalClose,
|
|
853
|
+
eo as ModalContent,
|
|
854
|
+
ro as ModalFooter,
|
|
855
|
+
to as ModalHeader,
|
|
856
|
+
oo as ModalNavigationSection,
|
|
841
857
|
Ue as ModalRoot,
|
|
842
|
-
|
|
843
|
-
|
|
858
|
+
Zt as ModalTrigger,
|
|
859
|
+
To as default
|
|
844
860
|
};
|