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