@orioncactuscorp/ui 1.2.0 → 1.4.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/README.md +56 -27
- package/dist/components/Accordion/Accordion.css +1 -1
- package/dist/components/Accordion/Accordion.js +39 -38
- package/dist/components/Accordion/Accordion.module.scss.js +5 -5
- package/dist/components/ActionArea/ActionArea.css +1 -1
- package/dist/components/ActionArea/ActionArea.js +101 -71
- package/dist/components/ActionArea/ActionAreaLayout.css +1 -0
- package/dist/components/ActionArea/ActionAreaLayout.js +145 -0
- package/dist/components/ActionArea/ActionAreaLayout.module.scss.js +11 -0
- package/dist/components/ActionArea.js +10 -4
- package/dist/components/Alert/Alert.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.css +1 -1
- package/dist/components/BackgroundIconButton/BackgroundIconButton.js +72 -52
- package/dist/components/Badge/Badge.css +1 -1
- package/dist/components/Badge/Badge.js +69 -25
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Button/Button.js +79 -139
- package/dist/components/Cell/Cell.css +1 -1
- package/dist/components/Cell/Cell.js +98 -88
- package/dist/components/CheckMark/CheckMark.css +1 -1
- package/dist/components/CheckMark/CheckMark.js +20 -18
- package/dist/components/CheckMark/CheckMark.module.scss.js +7 -3
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.js +10 -8
- package/dist/components/Field/Field.css +1 -1
- package/dist/components/Fieldset/Fieldset.css +1 -1
- package/dist/components/IconButton/IconButton.css +1 -1
- package/dist/components/IconButton/IconButton.js +48 -29
- package/dist/components/Interaction/Interaction.css +1 -1
- package/dist/components/Loading/Loading.css +1 -1
- package/dist/components/Loading/Loading.js +10 -10
- package/dist/components/Menu/Menu.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +377 -346
- package/dist/components/Modal/useModalDrag.js +654 -614
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/Radio/Radio.module.scss.js +9 -7
- package/dist/components/ScrollArea/ScrollArea.css +1 -1
- package/dist/components/SectionHeader/SectionHeader.css +1 -1
- package/dist/components/Select/Select.css +1 -1
- package/dist/components/Select/Select.js +15 -15
- package/dist/components/Select/SelectContent.css +1 -1
- package/dist/components/Switch/Switch.css +1 -1
- package/dist/components/Switch/Switch.module.scss.js +6 -4
- package/dist/components/TextArea/TextArea.css +1 -1
- package/dist/components/TextArea/TextAreaContent.css +1 -1
- package/dist/components/TextButton/TextButton.css +1 -1
- package/dist/components/TextInput/TextInput.css +1 -1
- package/dist/components/TextInput/TextInputContent.css +1 -1
- package/dist/components/Tooltip/Tooltip.css +1 -1
- package/dist/components/internal/Pressable.js +90 -0
- package/dist/foundations/atomic.css +1 -1
- package/dist/foundations/motion.css +1 -1
- package/dist/foundations/typo.css +1 -1
- package/dist/foundations.css +3 -3
- package/dist/index.js +102 -96
- package/dist/react/motion.js +109 -106
- package/dist/styles.css +32 -31
- package/dist/ui/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/ActionArea.d.ts +1 -1
- package/dist/ui/src/components/ActionArea/ActionArea.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/ActionAreaLayout.d.ts +12 -0
- package/dist/ui/src/components/ActionArea/ActionAreaLayout.d.ts.map +1 -0
- package/dist/ui/src/components/ActionArea/index.d.ts +2 -1
- package/dist/ui/src/components/ActionArea/index.d.ts.map +1 -1
- package/dist/ui/src/components/ActionArea/types.d.ts +13 -2
- package/dist/ui/src/components/ActionArea/types.d.ts.map +1 -1
- package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts +1 -1
- package/dist/ui/src/components/BackgroundIconButton/BackgroundIconButton.d.ts.map +1 -1
- package/dist/ui/src/components/BackgroundIconButton/index.d.ts +1 -1
- package/dist/ui/src/components/BackgroundIconButton/index.d.ts.map +1 -1
- package/dist/ui/src/components/BackgroundIconButton/types.d.ts +6 -5
- package/dist/ui/src/components/BackgroundIconButton/types.d.ts.map +1 -1
- package/dist/ui/src/components/Badge/Badge.d.ts +1 -1
- package/dist/ui/src/components/Badge/Badge.d.ts.map +1 -1
- package/dist/ui/src/components/Badge/types.d.ts +19 -2
- package/dist/ui/src/components/Badge/types.d.ts.map +1 -1
- package/dist/ui/src/components/Button/Button.d.ts.map +1 -1
- package/dist/ui/src/components/Button/types.d.ts +3 -7
- package/dist/ui/src/components/Button/types.d.ts.map +1 -1
- package/dist/ui/src/components/Cell/Cell.d.ts.map +1 -1
- 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/index.d.ts +1 -1
- package/dist/ui/src/components/CheckMark/index.d.ts.map +1 -1
- package/dist/ui/src/components/CheckMark/types.d.ts +2 -0
- package/dist/ui/src/components/CheckMark/types.d.ts.map +1 -1
- package/dist/ui/src/components/IconButton/IconButton.d.ts +1 -1
- package/dist/ui/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/ui/src/components/IconButton/index.d.ts +1 -1
- package/dist/ui/src/components/IconButton/index.d.ts.map +1 -1
- package/dist/ui/src/components/IconButton/types.d.ts +6 -5
- package/dist/ui/src/components/IconButton/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/contexts.d.ts +1 -0
- package/dist/ui/src/components/Modal/contexts.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +7 -6
- 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/internal/Pressable.d.ts +19 -0
- package/dist/ui/src/components/internal/Pressable.d.ts.map +1 -0
- package/dist/ui/src/index.d.ts +5 -5
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/ui/src/react/motion/index.d.ts +9 -8
- package/dist/ui/src/react/motion/index.d.ts.map +1 -1
- package/dist/ui/src/utils/motion.d.ts +15 -14
- package/dist/ui/src/utils/motion.d.ts.map +1 -1
- package/dist/utils/motion.js +282 -183
- package/dist/vscode/oc-ui-vars.css +31 -16
- package/package.json +2 -2
- package/src/scss/foundations/atomic.scss +12 -10
- package/src/scss/foundations/atomic.test.ts +34 -0
- package/src/scss/foundations/motion.scss +30 -16
- package/src/scss/foundations/typo.scss +1 -1
- package/src/scss/index.scss +1 -0
- package/src/scss/mixins/_motion.scss +168 -77
- package/src/scss/mixins/_motion.test.ts +137 -54
- package/src/scss/mixins/_radius.scss +3 -0
- package/src/scss/mixins/_radius.test.ts +52 -0
- package/src/scss/mixins/_typo.scss +2 -2
|
@@ -1,49 +1,57 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as d, jsxs as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { Dialog as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { ScrollArea as
|
|
9
|
-
import { useModalContext as
|
|
10
|
-
import { useControllableState as
|
|
11
|
-
import { useMeasuredElement as
|
|
12
|
-
import { useModalDrag as
|
|
13
|
-
import { useModalPlacement as
|
|
14
|
-
import { useModalStackDepth as
|
|
15
|
-
import { getModalScrollState as
|
|
16
|
-
import { resolveModalSnapMetrics as
|
|
17
|
-
import
|
|
18
|
-
function
|
|
2
|
+
import { jsx as d, jsxs as X } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback as F, useEffect as O, useRef as E, useState as H, useMemo as he } from "react";
|
|
4
|
+
import { Dialog as B } from "@base-ui-components/react/dialog";
|
|
5
|
+
import ge from "@orioncactuscorp/icons/orioncactus/CloseThick";
|
|
6
|
+
import ke from "../Background/Background.js";
|
|
7
|
+
import ve from "../BackgroundIconButton/BackgroundIconButton.js";
|
|
8
|
+
import { ScrollArea as ye, ScrollAreaContainer as Ce } from "../ScrollArea/ScrollArea.js";
|
|
9
|
+
import { useModalContext as Y, ModalProvider as Se } from "./contexts.js";
|
|
10
|
+
import { useControllableState as Me } from "./useControllableState.js";
|
|
11
|
+
import { useMeasuredElement as ue } from "./useElementSize.js";
|
|
12
|
+
import { useModalDrag as Ne } from "./useModalDrag.js";
|
|
13
|
+
import { useModalPlacement as we } from "./useModalPlacement.js";
|
|
14
|
+
import { useModalStackDepth as Fe } from "./useModalStackDepth.js";
|
|
15
|
+
import { getModalScrollState as Re } from "./modalScrollArbitration.js";
|
|
16
|
+
import { resolveModalSnapMetrics as Te, resolveModalPopupSnapPositions as He } from "./snapPoints.js";
|
|
17
|
+
import l from "./Modal.module.scss.js";
|
|
18
|
+
function A(...e) {
|
|
19
19
|
return e.filter(Boolean).join(" ");
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Ae(e) {
|
|
22
22
|
return e != null && e !== !1 && e !== "";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function le(e, t) {
|
|
25
25
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function De(e) {
|
|
28
|
+
if (!e) return;
|
|
29
|
+
const t = Object.entries(e).filter(
|
|
30
|
+
([n]) => n.startsWith("--")
|
|
31
|
+
);
|
|
32
|
+
if (t.length !== 0)
|
|
33
|
+
return Object.fromEntries(t);
|
|
34
|
+
}
|
|
35
|
+
function Pe(e) {
|
|
28
36
|
const t = e.trim();
|
|
29
37
|
return t.endsWith("ms") ? Number.parseFloat(t) || 0 : t.endsWith("s") ? (Number.parseFloat(t) || 0) * 1e3 : 0;
|
|
30
38
|
}
|
|
31
|
-
function
|
|
32
|
-
return e.split(",").reduce((t,
|
|
39
|
+
function me(e) {
|
|
40
|
+
return e.split(",").reduce((t, n) => Math.max(t, Pe(n)), 0);
|
|
33
41
|
}
|
|
34
|
-
function
|
|
35
|
-
const t = window.getComputedStyle(e),
|
|
36
|
-
return
|
|
42
|
+
function Be(e) {
|
|
43
|
+
const t = window.getComputedStyle(e), n = me(t.animationDuration), a = me(t.animationDelay);
|
|
44
|
+
return n + a + 250;
|
|
37
45
|
}
|
|
38
|
-
function
|
|
46
|
+
function xe({
|
|
39
47
|
defaultSnapPosition: e,
|
|
40
48
|
node: t,
|
|
41
|
-
snapPositions:
|
|
49
|
+
snapPositions: n
|
|
42
50
|
}) {
|
|
43
|
-
if (!
|
|
44
|
-
const a =
|
|
51
|
+
if (!n?.length) return;
|
|
52
|
+
const a = He({
|
|
45
53
|
defaultSnapPosition: e,
|
|
46
|
-
snapPositions:
|
|
54
|
+
snapPositions: n,
|
|
47
55
|
surfaceMotion: t
|
|
48
56
|
});
|
|
49
57
|
a && (t.style.setProperty(
|
|
@@ -54,14 +62,14 @@ function Ae({
|
|
|
54
62
|
`${a.defaultTarget.y}px`
|
|
55
63
|
));
|
|
56
64
|
}
|
|
57
|
-
function
|
|
65
|
+
function je(e) {
|
|
58
66
|
if (e && typeof e == "object" && "reason" in e && typeof e.reason == "string")
|
|
59
67
|
return e.reason;
|
|
60
68
|
}
|
|
61
|
-
function
|
|
69
|
+
function ae(e) {
|
|
62
70
|
e && typeof e == "object" && "cancel" in e && typeof e.cancel == "function" && e.cancel();
|
|
63
71
|
}
|
|
64
|
-
function
|
|
72
|
+
function Ee(e, t) {
|
|
65
73
|
switch (t) {
|
|
66
74
|
case "drag-dismiss":
|
|
67
75
|
return e?.drag ?? "auto";
|
|
@@ -79,19 +87,22 @@ function Pe(e, t) {
|
|
|
79
87
|
return e?.programmatic ?? "auto";
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
|
-
function
|
|
90
|
+
function Oe(e, t) {
|
|
83
91
|
return t > 0 && (e === "drag-dismiss" || e === "backdrop-press" || e === "outside-press");
|
|
84
92
|
}
|
|
85
|
-
function
|
|
93
|
+
function pe(e, t) {
|
|
94
|
+
return t && (e === "backdrop-press" || e === "outside-press");
|
|
95
|
+
}
|
|
96
|
+
function qe({
|
|
86
97
|
backdrop: e,
|
|
87
98
|
canSnapPopup: t,
|
|
88
|
-
placement:
|
|
99
|
+
placement: n,
|
|
89
100
|
presentationState: a
|
|
90
101
|
}) {
|
|
91
|
-
return e !== "auto" ? e :
|
|
102
|
+
return e !== "auto" ? e : n === "bottom" && a === "peeked" || t ? "hidden" : "visible";
|
|
92
103
|
}
|
|
93
|
-
function
|
|
94
|
-
switch (
|
|
104
|
+
function $e(e) {
|
|
105
|
+
switch (je(e)) {
|
|
95
106
|
case "close-press":
|
|
96
107
|
return "close-button";
|
|
97
108
|
case "outside-press":
|
|
@@ -106,275 +117,286 @@ function je(e) {
|
|
|
106
117
|
return "programmatic";
|
|
107
118
|
}
|
|
108
119
|
}
|
|
109
|
-
function
|
|
120
|
+
function fe({
|
|
110
121
|
children: e,
|
|
111
122
|
open: t,
|
|
112
|
-
defaultOpen:
|
|
123
|
+
defaultOpen: n,
|
|
113
124
|
modal: a = !0,
|
|
114
|
-
onOpenChange:
|
|
115
|
-
canCloseAttempt:
|
|
125
|
+
onOpenChange: p,
|
|
126
|
+
canCloseAttempt: v,
|
|
116
127
|
onCloseAttempt: u,
|
|
117
|
-
presentationState:
|
|
118
|
-
defaultPresentationState:
|
|
128
|
+
presentationState: b,
|
|
129
|
+
defaultPresentationState: f = "visible",
|
|
119
130
|
onPresentationStateChange: S,
|
|
120
|
-
disablePointerDismissal:
|
|
121
|
-
navigationDepth:
|
|
131
|
+
disablePointerDismissal: i,
|
|
132
|
+
navigationDepth: g = 0,
|
|
122
133
|
dismissBehavior: c
|
|
123
134
|
}) {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
),
|
|
135
|
+
const k = t !== void 0, [q, $] = H(
|
|
136
|
+
n ?? !1
|
|
137
|
+
), z = k ? t : q, [I, re] = H("bottom"), [o, U] = H(!1), [K, Z] = H(!1), [s, _] = H(!1), [G, ee] = H(0), [L, J] = H(null), [y, M] = H({
|
|
127
138
|
canScroll: !1,
|
|
128
139
|
scrolledFromTop: !1,
|
|
129
140
|
scrolledToBottom: !0
|
|
130
|
-
}), [
|
|
131
|
-
value:
|
|
132
|
-
defaultValue:
|
|
141
|
+
}), [x, R] = Me({
|
|
142
|
+
value: b,
|
|
143
|
+
defaultValue: f,
|
|
133
144
|
onChange: S
|
|
134
|
-
}),
|
|
135
|
-
(
|
|
136
|
-
|
|
145
|
+
}), V = ue(), N = ue(), D = Math.max(0, g), P = F(
|
|
146
|
+
(r, h) => {
|
|
147
|
+
k || $(r), p?.(r, h);
|
|
137
148
|
},
|
|
138
|
-
[
|
|
139
|
-
),
|
|
140
|
-
(
|
|
141
|
-
[
|
|
142
|
-
),
|
|
143
|
-
(
|
|
144
|
-
|
|
149
|
+
[p, k]
|
|
150
|
+
), w = F(
|
|
151
|
+
(r = { reason: "programmatic" }) => v?.(r) !== !1,
|
|
152
|
+
[v]
|
|
153
|
+
), T = F(
|
|
154
|
+
(r = { reason: "programmatic" }) => {
|
|
155
|
+
ee((h) => h + 1);
|
|
145
156
|
},
|
|
146
157
|
[]
|
|
147
|
-
),
|
|
148
|
-
(
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
), C = F(
|
|
159
|
+
(r = { reason: "programmatic" }) => {
|
|
160
|
+
if (pe(r.reason, s))
|
|
161
|
+
return !1;
|
|
162
|
+
const h = Ee(c, r.reason);
|
|
163
|
+
return h === "allow" ? !0 : h === "block" ? !1 : !Oe(r.reason, D);
|
|
151
164
|
},
|
|
152
|
-
[c,
|
|
153
|
-
),
|
|
154
|
-
(
|
|
155
|
-
const { commit:
|
|
156
|
-
return !
|
|
165
|
+
[s, c, D]
|
|
166
|
+
), W = F(
|
|
167
|
+
(r = { reason: "programmatic" }, h = {}) => {
|
|
168
|
+
const { commit: Q = !0, skipAttempt: m = !1 } = h;
|
|
169
|
+
return !m && pe(r.reason, s) ? (ae(r.eventDetails), !1) : !m && !C(r) || !m && !w(r) || !m && u?.(r) === !1 ? (ae(r.eventDetails), T(r), !1) : (Q && P(!1, r.eventDetails), !0);
|
|
157
170
|
},
|
|
158
171
|
[
|
|
172
|
+
w,
|
|
173
|
+
s,
|
|
174
|
+
C,
|
|
159
175
|
P,
|
|
160
|
-
|
|
161
|
-
N,
|
|
162
|
-
F,
|
|
176
|
+
T,
|
|
163
177
|
u
|
|
164
178
|
]
|
|
165
|
-
),
|
|
166
|
-
(
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
-
reason:
|
|
179
|
+
), ne = F(
|
|
180
|
+
(r, h) => {
|
|
181
|
+
if (r && x === "peeked" && R("visible"), !r) {
|
|
182
|
+
W({
|
|
183
|
+
reason: $e(h),
|
|
170
184
|
eventDetails: h
|
|
171
185
|
});
|
|
172
186
|
return;
|
|
173
187
|
}
|
|
174
|
-
|
|
188
|
+
P(r, h);
|
|
175
189
|
},
|
|
176
|
-
[
|
|
177
|
-
),
|
|
190
|
+
[P, x, W, R]
|
|
191
|
+
), ce = x === "visible" ? a : !1, te = i || I === "bottom" && o, se = he(
|
|
178
192
|
() => ({
|
|
179
|
-
open:
|
|
180
|
-
placement:
|
|
181
|
-
setPlacement:
|
|
182
|
-
presentationState:
|
|
183
|
-
setPresentationState:
|
|
184
|
-
requestClose:
|
|
185
|
-
canDismissByBehavior:
|
|
186
|
-
canCloseAttempt:
|
|
187
|
-
closeAttemptFeedbackKey:
|
|
188
|
-
notifyCloseAttemptRejected:
|
|
189
|
-
disablePointerDismissal:
|
|
193
|
+
open: z,
|
|
194
|
+
placement: I,
|
|
195
|
+
setPlacement: re,
|
|
196
|
+
presentationState: x,
|
|
197
|
+
setPresentationState: R,
|
|
198
|
+
requestClose: W,
|
|
199
|
+
canDismissByBehavior: C,
|
|
200
|
+
canCloseAttempt: w,
|
|
201
|
+
closeAttemptFeedbackKey: G,
|
|
202
|
+
notifyCloseAttemptRejected: T,
|
|
203
|
+
disablePointerDismissal: i ?? !1,
|
|
204
|
+
setBackdropDismissalDisabled: _,
|
|
190
205
|
canPeek: o,
|
|
191
|
-
setCanPeek:
|
|
192
|
-
canRenderHandle:
|
|
193
|
-
setCanRenderHandle:
|
|
194
|
-
headerHeight:
|
|
195
|
-
footerHeight:
|
|
196
|
-
setHeaderNode:
|
|
197
|
-
setFooterNode:
|
|
198
|
-
bodyNode:
|
|
199
|
-
setBodyNode:
|
|
200
|
-
scrollState:
|
|
201
|
-
setScrollState:
|
|
206
|
+
setCanPeek: U,
|
|
207
|
+
canRenderHandle: K,
|
|
208
|
+
setCanRenderHandle: Z,
|
|
209
|
+
headerHeight: V.height,
|
|
210
|
+
footerHeight: N.height,
|
|
211
|
+
setHeaderNode: V.setNode,
|
|
212
|
+
setFooterNode: N.setNode,
|
|
213
|
+
bodyNode: L,
|
|
214
|
+
setBodyNode: J,
|
|
215
|
+
scrollState: y,
|
|
216
|
+
setScrollState: M
|
|
202
217
|
}),
|
|
203
218
|
[
|
|
204
|
-
|
|
219
|
+
L,
|
|
205
220
|
o,
|
|
206
|
-
$,
|
|
207
|
-
M,
|
|
208
|
-
P,
|
|
209
|
-
i,
|
|
210
|
-
R.height,
|
|
211
|
-
R.setNode,
|
|
212
|
-
L.height,
|
|
213
|
-
L.setNode,
|
|
214
|
-
F,
|
|
215
|
-
I,
|
|
216
|
-
V,
|
|
217
|
-
B,
|
|
218
221
|
K,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
C,
|
|
223
|
+
w,
|
|
224
|
+
G,
|
|
225
|
+
N.height,
|
|
226
|
+
N.setNode,
|
|
227
|
+
V.height,
|
|
228
|
+
V.setNode,
|
|
229
|
+
T,
|
|
230
|
+
z,
|
|
231
|
+
I,
|
|
232
|
+
W,
|
|
233
|
+
y,
|
|
234
|
+
i,
|
|
235
|
+
x,
|
|
236
|
+
R
|
|
222
237
|
]
|
|
223
238
|
);
|
|
224
|
-
return /* @__PURE__ */ d(
|
|
225
|
-
|
|
239
|
+
return /* @__PURE__ */ d(Se, { value: se, children: /* @__PURE__ */ d(
|
|
240
|
+
B.Root,
|
|
226
241
|
{
|
|
227
|
-
open:
|
|
228
|
-
modal:
|
|
229
|
-
onOpenChange:
|
|
230
|
-
disablePointerDismissal:
|
|
242
|
+
open: z,
|
|
243
|
+
modal: ce,
|
|
244
|
+
onOpenChange: ne,
|
|
245
|
+
disablePointerDismissal: te,
|
|
231
246
|
children: e
|
|
232
247
|
}
|
|
233
248
|
) });
|
|
234
249
|
}
|
|
235
|
-
function
|
|
250
|
+
function Ie({
|
|
236
251
|
className: e = "",
|
|
237
252
|
children: t,
|
|
238
|
-
render:
|
|
253
|
+
render: n,
|
|
239
254
|
nativeButton: a
|
|
240
255
|
}) {
|
|
241
|
-
return
|
|
242
|
-
|
|
256
|
+
return n ? /* @__PURE__ */ d(
|
|
257
|
+
B.Trigger,
|
|
243
258
|
{
|
|
244
|
-
render:
|
|
259
|
+
render: n,
|
|
245
260
|
nativeButton: a,
|
|
246
261
|
"data-oc-component": "modal-trigger",
|
|
247
262
|
children: t
|
|
248
263
|
}
|
|
249
264
|
) : /* @__PURE__ */ d(
|
|
250
|
-
|
|
265
|
+
B.Trigger,
|
|
251
266
|
{
|
|
252
|
-
className:
|
|
267
|
+
className: A(l.trigger, e),
|
|
253
268
|
nativeButton: a,
|
|
254
269
|
"data-oc-component": "modal-trigger",
|
|
255
270
|
children: t
|
|
256
271
|
}
|
|
257
272
|
);
|
|
258
273
|
}
|
|
259
|
-
function
|
|
274
|
+
function Ke({
|
|
260
275
|
className: e = "",
|
|
261
276
|
children: t,
|
|
262
|
-
variant:
|
|
277
|
+
variant: n = "adaptive",
|
|
263
278
|
size: a = "medium",
|
|
264
|
-
resize:
|
|
265
|
-
backdrop:
|
|
279
|
+
resize: p = "hug",
|
|
280
|
+
backdrop: v = "auto",
|
|
266
281
|
drag: u = "content",
|
|
267
|
-
peekable:
|
|
268
|
-
snapPoints:
|
|
282
|
+
peekable: b = !1,
|
|
283
|
+
snapPoints: f,
|
|
269
284
|
defaultSnapPoint: S,
|
|
270
|
-
snapPositions:
|
|
271
|
-
defaultSnapPosition:
|
|
285
|
+
snapPositions: i,
|
|
286
|
+
defaultSnapPosition: g,
|
|
272
287
|
initialFocus: c,
|
|
273
|
-
peekHeight:
|
|
274
|
-
closeThreshold:
|
|
275
|
-
scrollLockTimeout:
|
|
276
|
-
container:
|
|
277
|
-
style:
|
|
278
|
-
...
|
|
288
|
+
peekHeight: k,
|
|
289
|
+
closeThreshold: q,
|
|
290
|
+
scrollLockTimeout: $,
|
|
291
|
+
container: z,
|
|
292
|
+
style: I,
|
|
293
|
+
...re
|
|
279
294
|
}) {
|
|
280
|
-
const o =
|
|
281
|
-
backdrop:
|
|
295
|
+
const o = Y("ModalContent"), { setCanPeek: U, setCanRenderHandle: K, setPlacement: Z } = o, s = we(n), _ = E(null), G = E(null), ee = E(null), L = E(null), J = E(0), y = E(null), M = E(null), [x, R] = H(), V = u === "handle" || u === "content", N = s === "popup" && u === "content" && !!i?.length, D = qe({
|
|
296
|
+
backdrop: v,
|
|
282
297
|
canSnapPopup: N,
|
|
283
|
-
placement:
|
|
298
|
+
placement: s,
|
|
284
299
|
presentationState: o.presentationState
|
|
285
|
-
}),
|
|
286
|
-
if (!(!
|
|
287
|
-
return
|
|
288
|
-
snapPoints:
|
|
300
|
+
}), P = (s === "bottom" || N) && V, w = s === "bottom" && P && b, T = w && k !== void 0 ? k : o.headerHeight > 0 ? o.headerHeight : void 0, C = he(() => {
|
|
301
|
+
if (!(!f?.length || typeof window > "u"))
|
|
302
|
+
return Te({
|
|
303
|
+
snapPoints: f,
|
|
289
304
|
defaultSnapPoint: S,
|
|
290
305
|
viewportHeight: window.innerHeight
|
|
291
306
|
});
|
|
292
|
-
}, [S,
|
|
307
|
+
}, [S, f]), W = Fe(o.open);
|
|
293
308
|
O(() => {
|
|
294
|
-
|
|
295
|
-
}, [
|
|
296
|
-
o.open || (
|
|
297
|
-
}, [o.open]), O(() => (
|
|
298
|
-
const
|
|
309
|
+
Z(s);
|
|
310
|
+
}, [s, Z]), O(() => {
|
|
311
|
+
o.open || (L.current = null);
|
|
312
|
+
}, [o.open]), O(() => (U(w), () => U(!1)), [w, U]), O(() => (K(P), () => K(!1)), [P, K]);
|
|
313
|
+
const ne = Ne({
|
|
299
314
|
enabled: u !== !1,
|
|
300
315
|
drag: u,
|
|
301
316
|
open: o.open,
|
|
302
|
-
placement:
|
|
303
|
-
surfaceMotionRef:
|
|
304
|
-
backdropRef:
|
|
317
|
+
placement: s,
|
|
318
|
+
surfaceMotionRef: _,
|
|
319
|
+
backdropRef: ee,
|
|
305
320
|
bodyNode: o.bodyNode,
|
|
306
|
-
snapHeights:
|
|
307
|
-
peekHeight:
|
|
308
|
-
peekFallback:
|
|
321
|
+
snapHeights: C?.snapHeights,
|
|
322
|
+
peekHeight: w ? k : void 0,
|
|
323
|
+
peekFallback: w ? "header" : void 0,
|
|
309
324
|
presentationState: o.presentationState,
|
|
310
325
|
setPresentationState: o.setPresentationState,
|
|
311
326
|
requestClose: o.requestClose,
|
|
312
327
|
canCloseAttempt: o.canCloseAttempt,
|
|
313
328
|
dismissible: !o.disablePointerDismissal && o.canDismissByBehavior({ reason: "drag-dismiss" }),
|
|
314
|
-
visibleTranslate:
|
|
315
|
-
snapPositions: N ?
|
|
316
|
-
defaultSnapPosition:
|
|
317
|
-
closeThreshold:
|
|
318
|
-
scrollLockTimeout:
|
|
319
|
-
}),
|
|
320
|
-
(
|
|
321
|
-
|
|
322
|
-
defaultSnapPosition:
|
|
323
|
-
node:
|
|
324
|
-
snapPositions:
|
|
325
|
-
}),
|
|
329
|
+
visibleTranslate: C?.visibleTranslate,
|
|
330
|
+
snapPositions: N ? i : void 0,
|
|
331
|
+
defaultSnapPosition: g,
|
|
332
|
+
closeThreshold: q,
|
|
333
|
+
scrollLockTimeout: $
|
|
334
|
+
}), ce = F(
|
|
335
|
+
(m) => {
|
|
336
|
+
_.current = m, m && o.open && N && L.current !== m && (xe({
|
|
337
|
+
defaultSnapPosition: g,
|
|
338
|
+
node: m,
|
|
339
|
+
snapPositions: i
|
|
340
|
+
}), L.current = m);
|
|
326
341
|
},
|
|
327
|
-
[N, o.open,
|
|
342
|
+
[N, o.open, g, i]
|
|
328
343
|
);
|
|
329
344
|
O(() => {
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
332
|
-
|
|
345
|
+
const m = o.closeAttemptFeedbackKey;
|
|
346
|
+
if (m === 0 || s !== "popup" || J.current === m) {
|
|
347
|
+
J.current = m, R(void 0);
|
|
333
348
|
return;
|
|
334
349
|
}
|
|
335
|
-
const
|
|
336
|
-
if (!
|
|
337
|
-
|
|
338
|
-
const
|
|
339
|
-
R(void 0),
|
|
340
|
-
},
|
|
341
|
-
|
|
350
|
+
const j = G.current;
|
|
351
|
+
if (!j) return;
|
|
352
|
+
J.current = m, y.current !== null && window.cancelAnimationFrame(y.current), M.current !== null && window.clearTimeout(M.current), R(void 0);
|
|
353
|
+
const ie = () => {
|
|
354
|
+
R(void 0), M.current = null;
|
|
355
|
+
}, oe = (de) => {
|
|
356
|
+
de.target === j && de.animationName === "oc-modal-reject-shake" && (j.removeEventListener("animationend", oe), M.current !== null && window.clearTimeout(M.current), ie());
|
|
342
357
|
};
|
|
343
|
-
return
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
},
|
|
358
|
+
return j.addEventListener("animationend", oe), y.current = window.requestAnimationFrame(() => {
|
|
359
|
+
y.current = null, R("reject"), y.current = window.requestAnimationFrame(() => {
|
|
360
|
+
y.current = null, M.current = window.setTimeout(() => {
|
|
361
|
+
j.removeEventListener("animationend", oe), ie();
|
|
362
|
+
}, Be(j));
|
|
348
363
|
});
|
|
349
364
|
}), () => {
|
|
350
|
-
|
|
365
|
+
j.removeEventListener("animationend", oe), y.current !== null && (window.cancelAnimationFrame(y.current), y.current = null), M.current !== null && (window.clearTimeout(M.current), M.current = null);
|
|
351
366
|
};
|
|
352
|
-
}, [o.closeAttemptFeedbackKey,
|
|
353
|
-
const
|
|
367
|
+
}, [o.closeAttemptFeedbackKey, s]);
|
|
368
|
+
const te = De(I), se = {
|
|
369
|
+
...te,
|
|
354
370
|
...o.headerHeight > 0 ? { "--oc-modal-header-height": `${o.headerHeight}px` } : {},
|
|
355
371
|
...o.footerHeight > 0 ? { "--oc-modal-footer-height": `${o.footerHeight}px` } : {},
|
|
356
|
-
...
|
|
357
|
-
...
|
|
358
|
-
...
|
|
359
|
-
"--oc-modal-translate-y": `${
|
|
372
|
+
...T !== void 0 ? { "--oc-modal-peek-height": `${T}px` } : {},
|
|
373
|
+
...C?.sheetHeight !== void 0 ? { "--oc-modal-sheet-height": `${C.sheetHeight}px` } : {},
|
|
374
|
+
...C?.visibleTranslate !== void 0 ? {
|
|
375
|
+
"--oc-modal-translate-y": `${C.visibleTranslate}px`
|
|
360
376
|
} : {}
|
|
361
|
-
},
|
|
377
|
+
}, r = {
|
|
362
378
|
// Each modal reserves one backdrop slot and one viewport slot.
|
|
363
|
-
"--oc-modal-stack-offset":
|
|
364
|
-
},
|
|
365
|
-
return
|
|
379
|
+
"--oc-modal-stack-offset": W * 2
|
|
380
|
+
}, h = c === "content" ? _ : c, { setBackdropDismissalDisabled: Q } = o;
|
|
381
|
+
return O(() => (Q(D === "hidden"), () => {
|
|
382
|
+
Q(!1);
|
|
383
|
+
}), [D, Q]), /* @__PURE__ */ X(B.Portal, { container: z, children: [
|
|
366
384
|
/* @__PURE__ */ d(
|
|
367
|
-
|
|
385
|
+
B.Backdrop,
|
|
368
386
|
{
|
|
369
|
-
ref:
|
|
370
|
-
className:
|
|
387
|
+
ref: ee,
|
|
388
|
+
className: l.backdrop,
|
|
371
389
|
"data-oc-part": "backdrop",
|
|
372
390
|
"data-oc-component": "modal-backdrop",
|
|
373
|
-
"data-oc-modal-backdrop":
|
|
374
|
-
"data-oc-modal-placement":
|
|
391
|
+
"data-oc-modal-backdrop": D,
|
|
392
|
+
"data-oc-modal-placement": s,
|
|
375
393
|
"data-oc-modal-presentation-state": o.presentationState,
|
|
376
|
-
style:
|
|
377
|
-
onClick: () => {
|
|
394
|
+
style: r,
|
|
395
|
+
onClick: (m) => {
|
|
396
|
+
if (D === "hidden") {
|
|
397
|
+
m.stopPropagation();
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
378
400
|
if (o.disablePointerDismissal) {
|
|
379
401
|
o.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
380
402
|
return;
|
|
@@ -383,7 +405,7 @@ function qe({
|
|
|
383
405
|
o.notifyCloseAttemptRejected({ reason: "backdrop-press" });
|
|
384
406
|
return;
|
|
385
407
|
}
|
|
386
|
-
if (
|
|
408
|
+
if (s === "bottom" && w) {
|
|
387
409
|
o.presentationState === "visible" && o.setPresentationState("peeked");
|
|
388
410
|
return;
|
|
389
411
|
}
|
|
@@ -391,94 +413,103 @@ function qe({
|
|
|
391
413
|
}
|
|
392
414
|
}
|
|
393
415
|
),
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
|
|
416
|
+
/* @__PURE__ */ d(
|
|
417
|
+
B.Viewport,
|
|
396
418
|
{
|
|
397
|
-
className:
|
|
419
|
+
className: l.viewport,
|
|
398
420
|
"data-oc-part": "viewport",
|
|
399
421
|
"data-oc-component": "modal-viewport",
|
|
400
|
-
"data-oc-modal-placement":
|
|
401
|
-
style:
|
|
402
|
-
children:
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
"
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
422
|
+
"data-oc-modal-placement": s,
|
|
423
|
+
style: r,
|
|
424
|
+
children: /* @__PURE__ */ X(
|
|
425
|
+
B.Popup,
|
|
426
|
+
{
|
|
427
|
+
...re,
|
|
428
|
+
...ne,
|
|
429
|
+
ref: ce,
|
|
430
|
+
initialFocus: h,
|
|
431
|
+
className: A(
|
|
432
|
+
l.surfaceMotion,
|
|
433
|
+
l[a],
|
|
434
|
+
e
|
|
435
|
+
),
|
|
436
|
+
"data-oc-part": "surface-motion",
|
|
437
|
+
"data-oc-component": "modal-content",
|
|
438
|
+
"data-oc-modal-backdrop": D,
|
|
439
|
+
"data-oc-variant": n,
|
|
440
|
+
"data-oc-size": a,
|
|
441
|
+
"data-oc-resize": p,
|
|
442
|
+
"data-oc-modal-feedback": s === "popup" ? x : void 0,
|
|
443
|
+
"data-oc-modal-placement": s,
|
|
444
|
+
"data-oc-modal-snapping": C || N ? "true" : void 0,
|
|
445
|
+
style: se,
|
|
446
|
+
children: [
|
|
447
|
+
s === "bottom" ? /* @__PURE__ */ d(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
"aria-hidden": "true",
|
|
451
|
+
className: A(
|
|
452
|
+
l.bottomFill,
|
|
453
|
+
l[a],
|
|
454
|
+
e
|
|
455
|
+
),
|
|
456
|
+
"data-oc-part": "bottom-fill",
|
|
457
|
+
"data-oc-component": "modal-bottom-fill",
|
|
458
|
+
"data-oc-size": a,
|
|
459
|
+
style: te
|
|
460
|
+
}
|
|
461
|
+
) : null,
|
|
462
|
+
/* @__PURE__ */ d(
|
|
432
463
|
"div",
|
|
433
464
|
{
|
|
434
|
-
ref:
|
|
435
|
-
className:
|
|
436
|
-
|
|
437
|
-
|
|
465
|
+
ref: G,
|
|
466
|
+
className: A(
|
|
467
|
+
l.surface,
|
|
468
|
+
l[p],
|
|
438
469
|
e
|
|
439
470
|
),
|
|
440
471
|
"data-oc-part": "surface",
|
|
441
|
-
"data-oc-variant":
|
|
472
|
+
"data-oc-variant": n,
|
|
442
473
|
"data-oc-size": a,
|
|
443
|
-
"data-oc-resize":
|
|
444
|
-
"data-oc-modal-placement":
|
|
445
|
-
style:
|
|
474
|
+
"data-oc-resize": p,
|
|
475
|
+
"data-oc-modal-placement": s,
|
|
476
|
+
style: I,
|
|
446
477
|
children: t
|
|
447
478
|
}
|
|
448
479
|
)
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
)
|
|
452
483
|
}
|
|
453
484
|
)
|
|
454
485
|
] });
|
|
455
486
|
}
|
|
456
|
-
function
|
|
487
|
+
function Le({
|
|
457
488
|
className: e = "",
|
|
458
489
|
title: t,
|
|
459
|
-
children:
|
|
490
|
+
children: n,
|
|
460
491
|
leadingContent: a,
|
|
461
|
-
trailingContent:
|
|
462
|
-
closeLabel:
|
|
492
|
+
trailingContent: p,
|
|
493
|
+
closeLabel: v = "닫기",
|
|
463
494
|
closeButton: u = !0,
|
|
464
|
-
handle:
|
|
465
|
-
ref:
|
|
495
|
+
handle: b = !0,
|
|
496
|
+
ref: f,
|
|
466
497
|
...S
|
|
467
498
|
}) {
|
|
468
|
-
const
|
|
469
|
-
(
|
|
470
|
-
|
|
499
|
+
const i = Y("ModalHeader"), { setHeaderNode: g, scrollState: c } = i, k = F(
|
|
500
|
+
($) => {
|
|
501
|
+
g($), le(f, $);
|
|
471
502
|
},
|
|
472
|
-
[
|
|
473
|
-
),
|
|
474
|
-
return /* @__PURE__ */
|
|
475
|
-
|
|
503
|
+
[f, g]
|
|
504
|
+
), q = Ae(a);
|
|
505
|
+
return /* @__PURE__ */ X(
|
|
506
|
+
ke,
|
|
476
507
|
{
|
|
477
508
|
...S,
|
|
478
509
|
as: "header",
|
|
479
|
-
ref:
|
|
510
|
+
ref: k,
|
|
480
511
|
backdrop: "compact",
|
|
481
|
-
className:
|
|
512
|
+
className: A(l.header, e),
|
|
482
513
|
backColor: "var(--oc-color-theme-background-elevated-normal)",
|
|
483
514
|
frontColor: "transparent",
|
|
484
515
|
"data-oc-part": "header",
|
|
@@ -486,26 +517,26 @@ function $e({
|
|
|
486
517
|
variant: "strong",
|
|
487
518
|
"data-oc-sticky": c.scrolledFromTop ? "true" : "false",
|
|
488
519
|
children: [
|
|
489
|
-
|
|
520
|
+
b && i.canRenderHandle ? /* @__PURE__ */ d(
|
|
490
521
|
"div",
|
|
491
522
|
{
|
|
492
523
|
"aria-hidden": "true",
|
|
493
|
-
className:
|
|
524
|
+
className: l.handle,
|
|
494
525
|
"data-oc-part": "handle"
|
|
495
526
|
}
|
|
496
527
|
) : null,
|
|
497
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ X(
|
|
498
529
|
"div",
|
|
499
530
|
{
|
|
500
|
-
className:
|
|
501
|
-
"data-oc-has-leading":
|
|
531
|
+
className: l.headerInner,
|
|
532
|
+
"data-oc-has-leading": q ? "true" : "false",
|
|
502
533
|
"data-oc-part": "header-inner",
|
|
503
534
|
children: [
|
|
504
|
-
|
|
505
|
-
/* @__PURE__ */ d("div", { className:
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
|
|
508
|
-
u ? /* @__PURE__ */ d(
|
|
535
|
+
q ? /* @__PURE__ */ d("div", { className: l.headerLeading, "data-oc-part": "header-leading", children: a }) : null,
|
|
536
|
+
/* @__PURE__ */ d("div", { className: l.headerTitle, "data-oc-part": "header-title", children: t ? /* @__PURE__ */ d(B.Title, { children: t }) : n }),
|
|
537
|
+
/* @__PURE__ */ X("div", { className: l.headerTrailing, "data-oc-part": "header-trailing", children: [
|
|
538
|
+
p,
|
|
539
|
+
u ? /* @__PURE__ */ d(be, { label: v }) : null
|
|
509
540
|
] })
|
|
510
541
|
]
|
|
511
542
|
}
|
|
@@ -514,52 +545,52 @@ function $e({
|
|
|
514
545
|
}
|
|
515
546
|
);
|
|
516
547
|
}
|
|
517
|
-
function
|
|
548
|
+
function Ve({
|
|
518
549
|
className: e = "",
|
|
519
550
|
children: t,
|
|
520
|
-
containerClassName:
|
|
551
|
+
containerClassName: n = "",
|
|
521
552
|
containerProps: a,
|
|
522
|
-
ref:
|
|
523
|
-
...
|
|
553
|
+
ref: p,
|
|
554
|
+
...v
|
|
524
555
|
}) {
|
|
525
|
-
const u =
|
|
556
|
+
const u = Y("ModalBody"), { bodyNode: b, setBodyNode: f, setScrollState: S } = u, i = F(
|
|
526
557
|
(c) => {
|
|
527
|
-
S(
|
|
558
|
+
S(Re(c));
|
|
528
559
|
},
|
|
529
560
|
[S]
|
|
530
|
-
),
|
|
561
|
+
), g = F(
|
|
531
562
|
(c) => {
|
|
532
|
-
|
|
563
|
+
f(c), le(p, c), i(c);
|
|
533
564
|
},
|
|
534
|
-
[
|
|
565
|
+
[p, f, i]
|
|
535
566
|
);
|
|
536
567
|
return O(() => {
|
|
537
|
-
const c =
|
|
538
|
-
if (!c || (
|
|
539
|
-
const
|
|
540
|
-
return
|
|
541
|
-
}, [
|
|
542
|
-
|
|
568
|
+
const c = b;
|
|
569
|
+
if (!c || (i(c), typeof ResizeObserver > "u")) return;
|
|
570
|
+
const k = new ResizeObserver(() => i(c));
|
|
571
|
+
return k.observe(c), c.firstElementChild && k.observe(c.firstElementChild), () => k.disconnect();
|
|
572
|
+
}, [b, i]), /* @__PURE__ */ d(
|
|
573
|
+
ye,
|
|
543
574
|
{
|
|
544
|
-
...
|
|
545
|
-
className:
|
|
575
|
+
...v,
|
|
576
|
+
className: A(l.body, e),
|
|
546
577
|
"data-oc-part": "body",
|
|
547
578
|
"data-oc-component": "modal-body",
|
|
548
579
|
children: /* @__PURE__ */ d(
|
|
549
|
-
|
|
580
|
+
Ce,
|
|
550
581
|
{
|
|
551
|
-
ref:
|
|
552
|
-
className:
|
|
582
|
+
ref: g,
|
|
583
|
+
className: l.bodyContainer,
|
|
553
584
|
"data-oc-part": "body-container",
|
|
554
585
|
"data-oc-component": "modal-body-container",
|
|
555
586
|
onScroll: (c) => {
|
|
556
|
-
a?.onScroll?.(c),
|
|
587
|
+
a?.onScroll?.(c), i(c.currentTarget);
|
|
557
588
|
},
|
|
558
589
|
children: /* @__PURE__ */ d(
|
|
559
590
|
"section",
|
|
560
591
|
{
|
|
561
592
|
...a,
|
|
562
|
-
className:
|
|
593
|
+
className: A(l.bodyContent, n),
|
|
563
594
|
"data-oc-part": "body-content",
|
|
564
595
|
"data-oc-component": "modal-body-content",
|
|
565
596
|
children: t
|
|
@@ -570,25 +601,25 @@ function Ke({
|
|
|
570
601
|
}
|
|
571
602
|
);
|
|
572
603
|
}
|
|
573
|
-
function
|
|
604
|
+
function We({
|
|
574
605
|
className: e = "",
|
|
575
606
|
children: t,
|
|
576
|
-
background:
|
|
607
|
+
background: n = "auto",
|
|
577
608
|
ref: a,
|
|
578
|
-
...
|
|
609
|
+
...p
|
|
579
610
|
}) {
|
|
580
|
-
const
|
|
581
|
-
(
|
|
582
|
-
|
|
611
|
+
const v = Y("ModalFooter"), { scrollState: u, setFooterNode: b } = v, f = F(
|
|
612
|
+
(g) => {
|
|
613
|
+
b(g), le(a, g);
|
|
583
614
|
},
|
|
584
|
-
[a,
|
|
585
|
-
), S =
|
|
615
|
+
[a, b]
|
|
616
|
+
), S = n === !0 || n === "auto" && u.canScroll && !u.scrolledToBottom;
|
|
586
617
|
return /* @__PURE__ */ d(
|
|
587
618
|
"footer",
|
|
588
619
|
{
|
|
589
|
-
...
|
|
590
|
-
ref:
|
|
591
|
-
className:
|
|
620
|
+
...p,
|
|
621
|
+
ref: f,
|
|
622
|
+
className: A(l.footer, e),
|
|
592
623
|
"data-oc-part": "footer",
|
|
593
624
|
"data-oc-component": "modal-footer",
|
|
594
625
|
"data-oc-background": S ? "true" : "false",
|
|
@@ -596,49 +627,49 @@ function Le({
|
|
|
596
627
|
}
|
|
597
628
|
);
|
|
598
629
|
}
|
|
599
|
-
function
|
|
630
|
+
function be({
|
|
600
631
|
className: e = "",
|
|
601
|
-
children: t = /* @__PURE__ */ d(
|
|
602
|
-
label:
|
|
632
|
+
children: t = /* @__PURE__ */ d(ge, {}),
|
|
633
|
+
label: n = "닫기",
|
|
603
634
|
size: a = 24,
|
|
604
|
-
disabled:
|
|
605
|
-
onClick:
|
|
635
|
+
disabled: p,
|
|
636
|
+
onClick: v,
|
|
606
637
|
...u
|
|
607
638
|
}) {
|
|
608
|
-
const
|
|
639
|
+
const b = Y("ModalClose");
|
|
609
640
|
return /* @__PURE__ */ d(
|
|
610
|
-
|
|
641
|
+
ve,
|
|
611
642
|
{
|
|
612
643
|
...u,
|
|
613
|
-
className:
|
|
614
|
-
"aria-label": u["aria-label"] ??
|
|
644
|
+
className: A(l.close, e),
|
|
645
|
+
"aria-label": u["aria-label"] ?? n,
|
|
615
646
|
"data-oc-part": "close",
|
|
616
647
|
"data-oc-component": "modal-close",
|
|
617
|
-
disabled:
|
|
618
|
-
onClick: (
|
|
619
|
-
|
|
648
|
+
disabled: p,
|
|
649
|
+
onClick: (f) => {
|
|
650
|
+
v?.(f), !f.defaultPrevented && !p && b.requestClose({ reason: "close-button" });
|
|
620
651
|
},
|
|
621
652
|
size: a,
|
|
622
653
|
children: t
|
|
623
654
|
}
|
|
624
655
|
);
|
|
625
656
|
}
|
|
626
|
-
const
|
|
627
|
-
Root:
|
|
628
|
-
Trigger:
|
|
629
|
-
Content:
|
|
630
|
-
Header:
|
|
631
|
-
Body:
|
|
632
|
-
Footer:
|
|
633
|
-
Close:
|
|
657
|
+
const st = Object.assign(fe, {
|
|
658
|
+
Root: fe,
|
|
659
|
+
Trigger: Ie,
|
|
660
|
+
Content: Ke,
|
|
661
|
+
Header: Le,
|
|
662
|
+
Body: Ve,
|
|
663
|
+
Footer: We,
|
|
664
|
+
Close: be
|
|
634
665
|
});
|
|
635
666
|
export {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
667
|
+
Ve as ModalBody,
|
|
668
|
+
be as ModalClose,
|
|
669
|
+
Ke as ModalContent,
|
|
670
|
+
We as ModalFooter,
|
|
671
|
+
Le as ModalHeader,
|
|
672
|
+
fe as ModalRoot,
|
|
673
|
+
Ie as ModalTrigger,
|
|
674
|
+
st as default
|
|
644
675
|
};
|