@luciodale/swipe-bar 1.3.2 → 1.3.3
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/dist/SwipeBarProvider.d.ts.map +1 -1
- package/dist/ToggleBottom.d.ts.map +1 -1
- package/dist/ToggleLeft.d.ts.map +1 -1
- package/dist/ToggleRight.d.ts.map +1 -1
- package/dist/components/Overlay.d.ts.map +1 -1
- package/dist/components/SwipeBarBottom.d.ts +1 -1
- package/dist/components/SwipeBarBottom.d.ts.map +1 -1
- package/dist/components/SwipeBarLeft.d.ts +1 -1
- package/dist/components/SwipeBarLeft.d.ts.map +1 -1
- package/dist/components/SwipeBarRight.d.ts +1 -1
- package/dist/components/SwipeBarRight.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/swipe-bar.es.js +1039 -967
- package/dist/swipe-bar.umd.js +2 -18
- package/dist/swipeSidebarShared.d.ts +1 -0
- package/dist/swipeSidebarShared.d.ts.map +1 -1
- package/dist/test-utils.d.ts +8 -8
- package/dist/useFocusTrap.d.ts +12 -0
- package/dist/useFocusTrap.d.ts.map +1 -0
- package/dist/useSwipeBarContext.d.ts.map +1 -1
- package/dist/useSwipeBottomSidebar.d.ts.map +1 -1
- package/dist/useSwipeLeftSidebar.d.ts.map +1 -1
- package/dist/useSwipeRightSidebar.d.ts.map +1 -1
- package/package.json +5 -2
package/dist/swipe-bar.es.js
CHANGED
|
@@ -1,681 +1,662 @@
|
|
|
1
|
-
import xt, { createContext as Rt, useState as Q, useRef as L, useMemo as Je, useCallback as B, useEffect as
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
17
|
-
function r(i, s, o) {
|
|
18
|
-
var f = null;
|
|
19
|
-
if (o !== void 0 && (f = "" + o), s.key !== void 0 && (f = "" + s.key), "key" in s) {
|
|
20
|
-
o = {};
|
|
21
|
-
for (var c in s)
|
|
22
|
-
c !== "key" && (o[c] = s[c]);
|
|
23
|
-
} else o = s;
|
|
24
|
-
return s = o.ref, {
|
|
1
|
+
import xt, { createContext as Rt, useState as Q, useRef as L, useMemo as Je, useCallback as B, useEffect as Z, useContext as Tt } from "react";
|
|
2
|
+
var pe = { exports: {} }, he = {};
|
|
3
|
+
var Ye;
|
|
4
|
+
function Et() {
|
|
5
|
+
if (Ye) return he;
|
|
6
|
+
Ye = 1;
|
|
7
|
+
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function r(i, s, n) {
|
|
9
|
+
var c = null;
|
|
10
|
+
if (n !== void 0 && (c = "" + n), s.key !== void 0 && (c = "" + s.key), "key" in s) {
|
|
11
|
+
n = {};
|
|
12
|
+
for (var f in s)
|
|
13
|
+
f !== "key" && (n[f] = s[f]);
|
|
14
|
+
} else n = s;
|
|
15
|
+
return s = n.ref, {
|
|
25
16
|
$$typeof: e,
|
|
26
17
|
type: i,
|
|
27
|
-
key:
|
|
18
|
+
key: c,
|
|
28
19
|
ref: s !== void 0 ? s : null,
|
|
29
|
-
props:
|
|
20
|
+
props: n
|
|
30
21
|
};
|
|
31
22
|
}
|
|
32
|
-
return
|
|
23
|
+
return he.Fragment = t, he.jsx = r, he.jsxs = r, he;
|
|
33
24
|
}
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var We;
|
|
45
|
-
function Et() {
|
|
46
|
-
return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
-
function e(n) {
|
|
48
|
-
if (n == null) return null;
|
|
49
|
-
if (typeof n == "function")
|
|
50
|
-
return n.$$typeof === V ? null : n.displayName || n.name || null;
|
|
51
|
-
if (typeof n == "string") return n;
|
|
52
|
-
switch (n) {
|
|
53
|
-
case M:
|
|
54
|
-
return "Fragment";
|
|
25
|
+
var me = {};
|
|
26
|
+
var $e;
|
|
27
|
+
function Ot() {
|
|
28
|
+
return $e || ($e = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
|
+
function e(o) {
|
|
30
|
+
if (o == null) return null;
|
|
31
|
+
if (typeof o == "function")
|
|
32
|
+
return o.$$typeof === V ? null : o.displayName || o.name || null;
|
|
33
|
+
if (typeof o == "string") return o;
|
|
34
|
+
switch (o) {
|
|
55
35
|
case C:
|
|
56
|
-
return "
|
|
36
|
+
return "Fragment";
|
|
57
37
|
case _:
|
|
38
|
+
return "Profiler";
|
|
39
|
+
case D:
|
|
58
40
|
return "StrictMode";
|
|
59
|
-
case
|
|
41
|
+
case X:
|
|
60
42
|
return "Suspense";
|
|
61
|
-
case
|
|
43
|
+
case m:
|
|
62
44
|
return "SuspenseList";
|
|
63
|
-
case
|
|
45
|
+
case I:
|
|
64
46
|
return "Activity";
|
|
65
47
|
}
|
|
66
|
-
if (typeof
|
|
67
|
-
switch (typeof
|
|
48
|
+
if (typeof o == "object")
|
|
49
|
+
switch (typeof o.tag == "number" && console.error(
|
|
68
50
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
-
),
|
|
70
|
-
case
|
|
51
|
+
), o.$$typeof) {
|
|
52
|
+
case w:
|
|
71
53
|
return "Portal";
|
|
54
|
+
case F:
|
|
55
|
+
return o.displayName || "Context";
|
|
56
|
+
case W:
|
|
57
|
+
return (o._context.displayName || "Context") + ".Consumer";
|
|
72
58
|
case j:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
case y:
|
|
80
|
-
return h = n.displayName || null, h !== null ? h : e(n.type) || "Memo";
|
|
81
|
-
case O:
|
|
82
|
-
h = n._payload, n = n._init;
|
|
59
|
+
var p = o.render;
|
|
60
|
+
return o = o.displayName, o || (o = p.displayName || p.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
61
|
+
case x:
|
|
62
|
+
return p = o.displayName || null, p !== null ? p : e(o.type) || "Memo";
|
|
63
|
+
case A:
|
|
64
|
+
p = o._payload, o = o._init;
|
|
83
65
|
try {
|
|
84
|
-
return e(
|
|
66
|
+
return e(o(p));
|
|
85
67
|
} catch {
|
|
86
68
|
}
|
|
87
69
|
}
|
|
88
70
|
return null;
|
|
89
71
|
}
|
|
90
|
-
function t(
|
|
91
|
-
return "" +
|
|
72
|
+
function t(o) {
|
|
73
|
+
return "" + o;
|
|
92
74
|
}
|
|
93
|
-
function r(
|
|
75
|
+
function r(o) {
|
|
94
76
|
try {
|
|
95
|
-
t(
|
|
96
|
-
var
|
|
77
|
+
t(o);
|
|
78
|
+
var p = !1;
|
|
97
79
|
} catch {
|
|
98
|
-
|
|
80
|
+
p = !0;
|
|
99
81
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
return
|
|
104
|
-
|
|
82
|
+
if (p) {
|
|
83
|
+
p = console;
|
|
84
|
+
var O = p.error, E = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
85
|
+
return O.call(
|
|
86
|
+
p,
|
|
105
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
107
|
-
), t(
|
|
88
|
+
E
|
|
89
|
+
), t(o);
|
|
108
90
|
}
|
|
109
91
|
}
|
|
110
|
-
function i(
|
|
111
|
-
if (
|
|
112
|
-
if (typeof
|
|
92
|
+
function i(o) {
|
|
93
|
+
if (o === C) return "<>";
|
|
94
|
+
if (typeof o == "object" && o !== null && o.$$typeof === A)
|
|
113
95
|
return "<...>";
|
|
114
96
|
try {
|
|
115
|
-
var
|
|
116
|
-
return
|
|
97
|
+
var p = e(o);
|
|
98
|
+
return p ? "<" + p + ">" : "<...>";
|
|
117
99
|
} catch {
|
|
118
100
|
return "<...>";
|
|
119
101
|
}
|
|
120
102
|
}
|
|
121
103
|
function s() {
|
|
122
|
-
var
|
|
123
|
-
return
|
|
104
|
+
var o = Y.A;
|
|
105
|
+
return o === null ? null : o.getOwner();
|
|
124
106
|
}
|
|
125
|
-
function
|
|
107
|
+
function n() {
|
|
126
108
|
return Error("react-stack-top-frame");
|
|
127
109
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
110
|
+
function c(o) {
|
|
111
|
+
if (J.call(o, "key")) {
|
|
112
|
+
var p = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
113
|
+
if (p && p.isReactWarning) return !1;
|
|
132
114
|
}
|
|
133
|
-
return
|
|
115
|
+
return o.key !== void 0;
|
|
134
116
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
137
|
-
|
|
117
|
+
function f(o, p) {
|
|
118
|
+
function O() {
|
|
119
|
+
N || (N = !0, console.error(
|
|
138
120
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
-
|
|
121
|
+
p
|
|
140
122
|
));
|
|
141
123
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
124
|
+
O.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
125
|
+
get: O,
|
|
144
126
|
configurable: !0
|
|
145
127
|
});
|
|
146
128
|
}
|
|
147
|
-
function
|
|
148
|
-
var
|
|
149
|
-
return
|
|
129
|
+
function u() {
|
|
130
|
+
var o = e(this.type);
|
|
131
|
+
return q[o] || (q[o] = !0, console.error(
|
|
150
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
-
)),
|
|
133
|
+
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
152
134
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
155
|
-
return
|
|
156
|
-
$$typeof:
|
|
157
|
-
type:
|
|
158
|
-
key:
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
135
|
+
function a(o, p, O, E, ae, U) {
|
|
136
|
+
var $ = O.ref;
|
|
137
|
+
return o = {
|
|
138
|
+
$$typeof: M,
|
|
139
|
+
type: o,
|
|
140
|
+
key: p,
|
|
141
|
+
props: O,
|
|
142
|
+
_owner: E
|
|
143
|
+
}, ($ !== void 0 ? $ : null) !== null ? Object.defineProperty(o, "ref", {
|
|
162
144
|
enumerable: !1,
|
|
163
|
-
get:
|
|
164
|
-
}) : Object.defineProperty(
|
|
145
|
+
get: u
|
|
146
|
+
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
165
147
|
configurable: !1,
|
|
166
148
|
enumerable: !1,
|
|
167
149
|
writable: !0,
|
|
168
150
|
value: 0
|
|
169
|
-
}), Object.defineProperty(
|
|
151
|
+
}), Object.defineProperty(o, "_debugInfo", {
|
|
170
152
|
configurable: !1,
|
|
171
153
|
enumerable: !1,
|
|
172
154
|
writable: !0,
|
|
173
155
|
value: null
|
|
174
|
-
}), Object.defineProperty(
|
|
156
|
+
}), Object.defineProperty(o, "_debugStack", {
|
|
175
157
|
configurable: !1,
|
|
176
158
|
enumerable: !1,
|
|
177
159
|
writable: !0,
|
|
178
|
-
value:
|
|
179
|
-
}), Object.defineProperty(
|
|
160
|
+
value: ae
|
|
161
|
+
}), Object.defineProperty(o, "_debugTask", {
|
|
180
162
|
configurable: !1,
|
|
181
163
|
enumerable: !1,
|
|
182
164
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
-
}), Object.freeze && (Object.freeze(
|
|
165
|
+
value: U
|
|
166
|
+
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
185
167
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
for (
|
|
192
|
-
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
168
|
+
function v(o, p, O, E, ae, U) {
|
|
169
|
+
var $ = p.children;
|
|
170
|
+
if ($ !== void 0)
|
|
171
|
+
if (E)
|
|
172
|
+
if (z($)) {
|
|
173
|
+
for (E = 0; E < $.length; E++)
|
|
174
|
+
y($[E]);
|
|
175
|
+
Object.freeze && Object.freeze($);
|
|
194
176
|
} else
|
|
195
177
|
console.error(
|
|
196
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
179
|
);
|
|
198
|
-
else
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
return
|
|
180
|
+
else y($);
|
|
181
|
+
if (J.call(p, "key")) {
|
|
182
|
+
$ = e(o);
|
|
183
|
+
var K = Object.keys(p).filter(function(Se) {
|
|
184
|
+
return Se !== "key";
|
|
203
185
|
});
|
|
204
|
-
|
|
186
|
+
E = 0 < K.length ? "{key: someKey, " + K.join(": ..., ") + ": ...}" : "{key: someKey}", G[$ + E] || (K = 0 < K.length ? "{" + K.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
188
|
let props = %s;
|
|
207
189
|
<%s {...props} />
|
|
208
190
|
React keys must be passed directly to JSX without using spread:
|
|
209
191
|
let props = %s;
|
|
210
192
|
<%s key={someKey} {...props} />`,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
),
|
|
193
|
+
E,
|
|
194
|
+
$,
|
|
195
|
+
K,
|
|
196
|
+
$
|
|
197
|
+
), G[$ + E] = !0);
|
|
216
198
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
typeof
|
|
225
|
-
),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
199
|
+
if ($ = null, O !== void 0 && (r(O), $ = "" + O), c(p) && (r(p.key), $ = "" + p.key), "key" in p) {
|
|
200
|
+
O = {};
|
|
201
|
+
for (var fe in p)
|
|
202
|
+
fe !== "key" && (O[fe] = p[fe]);
|
|
203
|
+
} else O = p;
|
|
204
|
+
return $ && f(
|
|
205
|
+
O,
|
|
206
|
+
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
207
|
+
), a(
|
|
208
|
+
o,
|
|
209
|
+
$,
|
|
210
|
+
O,
|
|
229
211
|
s(),
|
|
230
|
-
|
|
231
|
-
|
|
212
|
+
ae,
|
|
213
|
+
U
|
|
232
214
|
);
|
|
233
215
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
216
|
+
function y(o) {
|
|
217
|
+
h(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === A && (o._payload.status === "fulfilled" ? h(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
|
|
236
218
|
}
|
|
237
|
-
function
|
|
238
|
-
return typeof
|
|
219
|
+
function h(o) {
|
|
220
|
+
return typeof o == "object" && o !== null && o.$$typeof === M;
|
|
239
221
|
}
|
|
240
|
-
var S = xt,
|
|
222
|
+
var S = xt, M = /* @__PURE__ */ Symbol.for("react.transitional.element"), w = /* @__PURE__ */ Symbol.for("react.portal"), C = /* @__PURE__ */ Symbol.for("react.fragment"), D = /* @__PURE__ */ Symbol.for("react.strict_mode"), _ = /* @__PURE__ */ Symbol.for("react.profiler"), W = /* @__PURE__ */ Symbol.for("react.consumer"), F = /* @__PURE__ */ Symbol.for("react.context"), j = /* @__PURE__ */ Symbol.for("react.forward_ref"), X = /* @__PURE__ */ Symbol.for("react.suspense"), m = /* @__PURE__ */ Symbol.for("react.suspense_list"), x = /* @__PURE__ */ Symbol.for("react.memo"), A = /* @__PURE__ */ Symbol.for("react.lazy"), I = /* @__PURE__ */ Symbol.for("react.activity"), V = /* @__PURE__ */ Symbol.for("react.client.reference"), Y = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, z = Array.isArray, H = console.createTask ? console.createTask : function() {
|
|
241
223
|
return null;
|
|
242
224
|
};
|
|
243
225
|
S = {
|
|
244
|
-
react_stack_bottom_frame: function(
|
|
245
|
-
return
|
|
226
|
+
react_stack_bottom_frame: function(o) {
|
|
227
|
+
return o();
|
|
246
228
|
}
|
|
247
229
|
};
|
|
248
|
-
var
|
|
230
|
+
var N, q = {}, oe = S.react_stack_bottom_frame.bind(
|
|
249
231
|
S,
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
return
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
232
|
+
n
|
|
233
|
+
)(), R = H(i(n)), G = {};
|
|
234
|
+
me.Fragment = C, me.jsx = function(o, p, O) {
|
|
235
|
+
var E = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return v(
|
|
237
|
+
o,
|
|
238
|
+
p,
|
|
239
|
+
O,
|
|
258
240
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
241
|
+
E ? Error("react-stack-top-frame") : oe,
|
|
242
|
+
E ? H(i(o)) : R
|
|
261
243
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
244
|
+
}, me.jsxs = function(o, p, O) {
|
|
245
|
+
var E = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return v(
|
|
247
|
+
o,
|
|
248
|
+
p,
|
|
249
|
+
O,
|
|
268
250
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
251
|
+
E ? Error("react-stack-top-frame") : oe,
|
|
252
|
+
E ? H(i(o)) : R
|
|
271
253
|
);
|
|
272
254
|
};
|
|
273
|
-
}()),
|
|
255
|
+
})()), me;
|
|
256
|
+
}
|
|
257
|
+
var Be;
|
|
258
|
+
function At() {
|
|
259
|
+
return Be || (Be = 1, process.env.NODE_ENV === "production" ? pe.exports = Et() : pe.exports = Ot()), pe.exports;
|
|
274
260
|
}
|
|
275
|
-
|
|
276
|
-
var E = Re.exports;
|
|
261
|
+
var T = At();
|
|
277
262
|
const Ke = Rt(null), ye = (e) => {
|
|
278
263
|
throw new Error(`Unhandled sidebar side: ${e}`);
|
|
279
|
-
},
|
|
264
|
+
}, ve = {
|
|
280
265
|
isOpen: !1,
|
|
281
266
|
anchorState: "closed",
|
|
282
267
|
meta: null
|
|
283
|
-
},
|
|
268
|
+
}, pr = ({
|
|
284
269
|
children: e,
|
|
285
270
|
sidebarWidthPx: t,
|
|
286
271
|
transitionMs: r,
|
|
287
272
|
edgeActivationWidthPx: i,
|
|
288
273
|
dragActivationDeltaPx: s,
|
|
289
|
-
showOverlay:
|
|
290
|
-
isAbsolute:
|
|
291
|
-
overlayBackgroundColor:
|
|
292
|
-
toggleIconColor:
|
|
293
|
-
toggleIconSizePx:
|
|
294
|
-
toggleIconEdgeDistancePx:
|
|
295
|
-
showToggle:
|
|
296
|
-
mediaQueryWidth:
|
|
274
|
+
showOverlay: n,
|
|
275
|
+
isAbsolute: c,
|
|
276
|
+
overlayBackgroundColor: f,
|
|
277
|
+
toggleIconColor: u,
|
|
278
|
+
toggleIconSizePx: a,
|
|
279
|
+
toggleIconEdgeDistancePx: v,
|
|
280
|
+
showToggle: y,
|
|
281
|
+
mediaQueryWidth: h,
|
|
297
282
|
swipeBarZIndex: S,
|
|
298
|
-
toggleZIndex:
|
|
299
|
-
overlayZIndex:
|
|
300
|
-
fadeContent:
|
|
301
|
-
fadeContentTransitionMs:
|
|
302
|
-
closeSidebarOnOverlayClick:
|
|
303
|
-
resetMetaOnClose:
|
|
283
|
+
toggleZIndex: M,
|
|
284
|
+
overlayZIndex: w,
|
|
285
|
+
fadeContent: C,
|
|
286
|
+
fadeContentTransitionMs: D,
|
|
287
|
+
closeSidebarOnOverlayClick: _,
|
|
288
|
+
resetMetaOnClose: W
|
|
304
289
|
}) => {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
), ce = N.current.get("primary"), it = (ce == null ? void 0 : ce.sidebarRef) ?? { current: null }, ot = (ce == null ? void 0 : ce.toggleRef) ?? { current: null }, at = x.primary ?? {}, [st, ct] = Q({
|
|
290
|
+
const [F, j] = Q(null), [X, m] = Q(!1), [x, A] = Q(!1), [I, V] = Q({}), [Y, J] = Q({}), z = L(null), H = L(null), N = L(null), q = L(null), [oe, R] = Q(null), [G, o] = Q(null), [p, O] = Q({}), [E, ae] = Q({}), U = L(/* @__PURE__ */ new Map()), $ = L(null), K = L([]), fe = p.primary?.isOpen ?? !1, Se = p.primary?.anchorState ?? "closed", _e = Je(
|
|
291
|
+
() => Object.values(p).some((l) => l.isOpen),
|
|
292
|
+
[p]
|
|
293
|
+
), Le = U.current.get("primary"), it = Le?.sidebarRef ?? { current: null }, ot = Le?.toggleRef ?? { current: null }, at = E.primary ?? {}, [st, ct] = Q({
|
|
310
294
|
sidebarWidthPx: t ?? It,
|
|
311
|
-
sidebarHeightPx:
|
|
312
|
-
transitionMs: r ??
|
|
313
|
-
edgeActivationWidthPx: i ??
|
|
314
|
-
dragActivationDeltaPx: s ??
|
|
315
|
-
showOverlay:
|
|
316
|
-
isAbsolute:
|
|
317
|
-
overlayBackgroundColor:
|
|
318
|
-
toggleIconColor:
|
|
319
|
-
toggleIconSizePx:
|
|
320
|
-
toggleIconEdgeDistancePx:
|
|
321
|
-
showToggle:
|
|
322
|
-
mediaQueryWidth:
|
|
295
|
+
sidebarHeightPx: We,
|
|
296
|
+
transitionMs: r ?? Pt,
|
|
297
|
+
edgeActivationWidthPx: i ?? Mt,
|
|
298
|
+
dragActivationDeltaPx: s ?? Ct,
|
|
299
|
+
showOverlay: n ?? _t,
|
|
300
|
+
isAbsolute: c ?? Dt,
|
|
301
|
+
overlayBackgroundColor: f ?? et,
|
|
302
|
+
toggleIconColor: u ?? Xt,
|
|
303
|
+
toggleIconSizePx: a ?? Yt,
|
|
304
|
+
toggleIconEdgeDistancePx: v ?? $t,
|
|
305
|
+
showToggle: y ?? Bt,
|
|
306
|
+
mediaQueryWidth: h ?? Re,
|
|
323
307
|
swipeBarZIndex: S ?? Wt,
|
|
324
|
-
toggleZIndex:
|
|
325
|
-
overlayZIndex:
|
|
326
|
-
fadeContent:
|
|
327
|
-
fadeContentTransitionMs:
|
|
328
|
-
swipeToOpen:
|
|
329
|
-
swipeToClose:
|
|
330
|
-
midAnchorPoint:
|
|
331
|
-
midAnchorPointPx:
|
|
308
|
+
toggleZIndex: M ?? jt,
|
|
309
|
+
overlayZIndex: w ?? kt,
|
|
310
|
+
fadeContent: C ?? Ht,
|
|
311
|
+
fadeContentTransitionMs: D ?? Nt,
|
|
312
|
+
swipeToOpen: Gt,
|
|
313
|
+
swipeToClose: Ut,
|
|
314
|
+
midAnchorPoint: Zt,
|
|
315
|
+
midAnchorPointPx: We / 3,
|
|
332
316
|
disabled: !1,
|
|
333
|
-
closeSidebarOnOverlayClick:
|
|
334
|
-
resetMetaOnClose:
|
|
335
|
-
}), lt = B((l,
|
|
336
|
-
|
|
317
|
+
closeSidebarOnOverlayClick: _ ?? Lt,
|
|
318
|
+
resetMetaOnClose: W ?? !1
|
|
319
|
+
}), lt = B((l, d) => {
|
|
320
|
+
U.current.set(l, d), O((g) => g[l] ? g : { ...g, [l]: { ...ve } });
|
|
337
321
|
}, []), ut = B((l) => {
|
|
338
|
-
|
|
339
|
-
const g = { ...
|
|
322
|
+
U.current.delete(l), O((d) => {
|
|
323
|
+
const g = { ...d };
|
|
340
324
|
return delete g[l], g;
|
|
341
|
-
}),
|
|
342
|
-
const g = { ...
|
|
325
|
+
}), ae((d) => {
|
|
326
|
+
const g = { ...d };
|
|
343
327
|
return delete g[l], g;
|
|
344
328
|
});
|
|
345
|
-
}, []), dt = B((l) =>
|
|
346
|
-
(l,
|
|
347
|
-
|
|
329
|
+
}, []), dt = B((l) => U.current.get(l), []), ft = B(
|
|
330
|
+
(l, d) => {
|
|
331
|
+
ae((g) => g[l] === d ? g : { ...g, [l]: d });
|
|
348
332
|
},
|
|
349
333
|
[]
|
|
350
|
-
),
|
|
351
|
-
|
|
352
|
-
const
|
|
353
|
-
return
|
|
334
|
+
), re = B((l, d) => {
|
|
335
|
+
O((g) => {
|
|
336
|
+
const b = g[l] ?? ve;
|
|
337
|
+
return b.isOpen === d ? g : { ...g, [l]: { ...b, isOpen: d } };
|
|
354
338
|
});
|
|
355
|
-
}, []),
|
|
356
|
-
(l,
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
return
|
|
339
|
+
}, []), ne = B(
|
|
340
|
+
(l, d) => {
|
|
341
|
+
O((g) => {
|
|
342
|
+
const b = g[l] ?? ve;
|
|
343
|
+
return b.anchorState === d ? g : { ...g, [l]: { ...b, anchorState: d } };
|
|
360
344
|
});
|
|
361
345
|
},
|
|
362
346
|
[]
|
|
363
|
-
),
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
return
|
|
347
|
+
), ge = B((l, d) => {
|
|
348
|
+
O((g) => {
|
|
349
|
+
const b = g[l] ?? ve;
|
|
350
|
+
return b.meta === d ? g : { ...g, [l]: { ...b, meta: d } };
|
|
367
351
|
});
|
|
368
352
|
}, []);
|
|
369
|
-
|
|
353
|
+
Z(() => (X || x || _e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
370
354
|
document.body.style.overflow = "";
|
|
371
|
-
}), [
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
a && (a.style.opacity = "1");
|
|
355
|
+
}), [X, x, _e]), Z(() => {
|
|
356
|
+
if (I.fadeContent === !1) {
|
|
357
|
+
const l = z.current?.firstElementChild;
|
|
358
|
+
l && (l.style.opacity = "1");
|
|
376
359
|
}
|
|
377
|
-
}, [
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
a && (a.style.opacity = "1");
|
|
360
|
+
}, [I.fadeContent]), Z(() => {
|
|
361
|
+
if (Y.fadeContent === !1) {
|
|
362
|
+
const l = H.current?.firstElementChild;
|
|
363
|
+
l && (l.style.opacity = "1");
|
|
382
364
|
}
|
|
383
|
-
}, [
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
A && (A.style.opacity = "1");
|
|
365
|
+
}, [Y.fadeContent]), Z(() => {
|
|
366
|
+
for (const [l, d] of Object.entries(E))
|
|
367
|
+
if (d.fadeContent === !1) {
|
|
368
|
+
const b = U.current.get(l)?.sidebarRef.current?.firstElementChild;
|
|
369
|
+
b && (b.style.opacity = "1");
|
|
389
370
|
}
|
|
390
|
-
}, [
|
|
371
|
+
}, [E]);
|
|
391
372
|
const gt = B((l) => {
|
|
392
|
-
ct((
|
|
393
|
-
}, []),
|
|
394
|
-
const g = l === "left" ?
|
|
395
|
-
|
|
373
|
+
ct((d) => ({ ...d, ...l }));
|
|
374
|
+
}, []), ce = B((l, d) => {
|
|
375
|
+
const g = l === "left" ? R : o;
|
|
376
|
+
d?.resetMeta ? g(null) : d?.meta !== void 0 && g(d.meta);
|
|
396
377
|
}, []), ie = B(
|
|
397
|
-
(l,
|
|
398
|
-
|
|
378
|
+
(l, d) => {
|
|
379
|
+
d?.resetMeta ? ge(l, null) : d?.meta !== void 0 && ge(l, d.meta);
|
|
399
380
|
},
|
|
400
|
-
[
|
|
381
|
+
[ge]
|
|
401
382
|
), ht = B(
|
|
402
|
-
(l,
|
|
383
|
+
(l, d) => {
|
|
403
384
|
if (l === "left")
|
|
404
|
-
|
|
385
|
+
R(d);
|
|
405
386
|
else if (l === "right")
|
|
406
|
-
|
|
387
|
+
o(d);
|
|
407
388
|
else {
|
|
408
|
-
const g =
|
|
409
|
-
|
|
389
|
+
const g = d;
|
|
390
|
+
ge(g.id, g.meta);
|
|
410
391
|
}
|
|
411
392
|
},
|
|
412
|
-
[
|
|
393
|
+
[ge]
|
|
413
394
|
), se = B((l) => {
|
|
414
|
-
const
|
|
415
|
-
g !== -1 &&
|
|
416
|
-
}, []),
|
|
417
|
-
const
|
|
418
|
-
g !== -1 &&
|
|
395
|
+
const d = K.current, g = d.indexOf(l);
|
|
396
|
+
g !== -1 && d.splice(g, 1), d.push(l), j("bottom");
|
|
397
|
+
}, []), De = B((l) => {
|
|
398
|
+
const d = K.current, g = d.indexOf(l);
|
|
399
|
+
g !== -1 && d.splice(g, 1), O((b) => (Object.entries(b).some(([k, ee]) => k !== l && ee.isOpen) || j(null), b));
|
|
419
400
|
}, []), mt = B(
|
|
420
|
-
(l,
|
|
421
|
-
const g = (
|
|
401
|
+
(l, d) => {
|
|
402
|
+
const g = (b, P, k, ee) => {
|
|
422
403
|
xe({
|
|
423
404
|
side: l,
|
|
424
|
-
ref:
|
|
425
|
-
options:
|
|
426
|
-
toggleRef:
|
|
405
|
+
ref: b,
|
|
406
|
+
options: P,
|
|
407
|
+
toggleRef: k,
|
|
427
408
|
afterApply: () => {
|
|
428
|
-
|
|
409
|
+
ee(!0), j(l);
|
|
429
410
|
}
|
|
430
411
|
});
|
|
431
412
|
};
|
|
432
413
|
if (l === "left") {
|
|
433
|
-
if (
|
|
434
|
-
|
|
414
|
+
if (I.disabled) return;
|
|
415
|
+
ce("left", d), g(z, I, N, m);
|
|
435
416
|
} else if (l === "right") {
|
|
436
|
-
if (
|
|
437
|
-
|
|
417
|
+
if (Y.disabled) return;
|
|
418
|
+
ce("right", d), g(H, Y, q, A);
|
|
438
419
|
} else if (l === "bottom") {
|
|
439
|
-
const
|
|
440
|
-
if (!
|
|
441
|
-
ie(
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
ref:
|
|
445
|
-
options:
|
|
446
|
-
toggleRef:
|
|
420
|
+
const b = d?.id ?? "primary", P = E[b], k = U.current.get(b);
|
|
421
|
+
if (!P || !k || P.disabled) return;
|
|
422
|
+
ie(b, d);
|
|
423
|
+
const ee = P.sidebarHeightPx ?? 0, St = P.mediaQueryWidth ?? 640, Xe = window.innerWidth < St, yt = Xe ? P.midAnchorPointPx ?? 0 : ee;
|
|
424
|
+
Xe && P.midAnchorPoint && !P.swipeToOpen && yt < ee ? Fe({
|
|
425
|
+
ref: k.sidebarRef,
|
|
426
|
+
options: P,
|
|
427
|
+
toggleRef: k.toggleRef,
|
|
447
428
|
afterApply: () => {
|
|
448
|
-
|
|
429
|
+
re(b, !0), ne(b, "midAnchor"), se(b);
|
|
449
430
|
}
|
|
450
431
|
}) : xe({
|
|
451
432
|
side: l,
|
|
452
|
-
ref:
|
|
453
|
-
options:
|
|
454
|
-
toggleRef:
|
|
433
|
+
ref: k.sidebarRef,
|
|
434
|
+
options: P,
|
|
435
|
+
toggleRef: k.toggleRef,
|
|
455
436
|
afterApply: () => {
|
|
456
|
-
|
|
437
|
+
re(b, !0), ne(b, "open"), se(b);
|
|
457
438
|
}
|
|
458
439
|
});
|
|
459
440
|
} else
|
|
460
441
|
ye(l);
|
|
461
442
|
},
|
|
462
443
|
[
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
te,
|
|
444
|
+
I,
|
|
445
|
+
Y,
|
|
446
|
+
E,
|
|
467
447
|
re,
|
|
448
|
+
ne,
|
|
468
449
|
se,
|
|
469
|
-
|
|
450
|
+
ce,
|
|
470
451
|
ie
|
|
471
452
|
]
|
|
472
|
-
),
|
|
473
|
-
(l,
|
|
453
|
+
), bt = B(
|
|
454
|
+
(l, d) => {
|
|
474
455
|
if (l !== "bottom") return;
|
|
475
|
-
const g =
|
|
476
|
-
!
|
|
477
|
-
ref:
|
|
478
|
-
options:
|
|
479
|
-
toggleRef:
|
|
456
|
+
const g = d?.id ?? "primary", b = E[g], P = U.current.get(g);
|
|
457
|
+
!b || !P || b.disabled || (ie(g, d), Fe({
|
|
458
|
+
ref: P.sidebarRef,
|
|
459
|
+
options: b,
|
|
460
|
+
toggleRef: P.toggleRef,
|
|
480
461
|
afterApply: () => {
|
|
481
|
-
|
|
462
|
+
re(g, !0), ne(g, "midAnchor"), se(g);
|
|
482
463
|
}
|
|
483
464
|
}));
|
|
484
465
|
},
|
|
485
466
|
[
|
|
486
|
-
|
|
487
|
-
te,
|
|
467
|
+
E,
|
|
488
468
|
re,
|
|
469
|
+
ne,
|
|
489
470
|
se,
|
|
490
471
|
ie
|
|
491
472
|
]
|
|
492
|
-
),
|
|
493
|
-
(l,
|
|
473
|
+
), pt = B(
|
|
474
|
+
(l, d) => {
|
|
494
475
|
if (l !== "bottom") return;
|
|
495
|
-
const g =
|
|
496
|
-
!
|
|
476
|
+
const g = d?.id ?? "primary", b = E[g], P = U.current.get(g);
|
|
477
|
+
!b || !P || b.disabled || (ie(g, d), xe({
|
|
497
478
|
side: l,
|
|
498
|
-
ref:
|
|
499
|
-
options:
|
|
500
|
-
toggleRef:
|
|
479
|
+
ref: P.sidebarRef,
|
|
480
|
+
options: b,
|
|
481
|
+
toggleRef: P.toggleRef,
|
|
501
482
|
afterApply: () => {
|
|
502
|
-
|
|
483
|
+
re(g, !0), ne(g, "open"), se(g);
|
|
503
484
|
}
|
|
504
485
|
}));
|
|
505
486
|
},
|
|
506
487
|
[
|
|
507
|
-
|
|
508
|
-
te,
|
|
488
|
+
E,
|
|
509
489
|
re,
|
|
490
|
+
ne,
|
|
510
491
|
se,
|
|
511
492
|
ie
|
|
512
493
|
]
|
|
513
|
-
),
|
|
514
|
-
(l,
|
|
515
|
-
const g = (
|
|
494
|
+
), vt = B(
|
|
495
|
+
(l, d) => {
|
|
496
|
+
const g = (b, P, k, ee) => {
|
|
516
497
|
ke({
|
|
517
|
-
ref:
|
|
518
|
-
options:
|
|
519
|
-
toggleRef:
|
|
498
|
+
ref: b,
|
|
499
|
+
options: P,
|
|
500
|
+
toggleRef: k,
|
|
520
501
|
side: l,
|
|
521
502
|
afterApply: () => {
|
|
522
|
-
|
|
503
|
+
ee(!1), j(null);
|
|
523
504
|
}
|
|
524
505
|
});
|
|
525
506
|
};
|
|
526
507
|
if (l === "left") {
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
|
|
508
|
+
if (I.disabled) return;
|
|
509
|
+
const b = I.resetMetaOnClose && d?.meta === void 0 && d?.resetMeta === void 0 ? { ...d, resetMeta: !0 } : d;
|
|
510
|
+
ce("left", b), g(z, I, N, m);
|
|
530
511
|
} else if (l === "right") {
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
|
|
512
|
+
if (Y.disabled) return;
|
|
513
|
+
const b = Y.resetMetaOnClose && d?.meta === void 0 && d?.resetMeta === void 0 ? { ...d, resetMeta: !0 } : d;
|
|
514
|
+
ce("right", b), g(H, Y, q, A);
|
|
534
515
|
} else if (l === "bottom") {
|
|
535
|
-
const
|
|
536
|
-
if (!
|
|
537
|
-
const
|
|
538
|
-
ie(
|
|
539
|
-
ref:
|
|
540
|
-
options:
|
|
541
|
-
toggleRef:
|
|
516
|
+
const b = d?.id ?? "primary", P = E[b], k = U.current.get(b);
|
|
517
|
+
if (!P || !k || P.disabled) return;
|
|
518
|
+
const ee = P.resetMetaOnClose && d?.meta === void 0 && d?.resetMeta === void 0 ? { ...d, resetMeta: !0 } : d;
|
|
519
|
+
ie(b, ee), ke({
|
|
520
|
+
ref: k.sidebarRef,
|
|
521
|
+
options: P,
|
|
522
|
+
toggleRef: k.toggleRef,
|
|
542
523
|
side: l,
|
|
543
524
|
afterApply: () => {
|
|
544
|
-
|
|
525
|
+
re(b, !1), ne(b, "closed"), De(b);
|
|
545
526
|
}
|
|
546
527
|
});
|
|
547
528
|
} else
|
|
548
529
|
ye(l);
|
|
549
530
|
},
|
|
550
531
|
[
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
te,
|
|
532
|
+
I,
|
|
533
|
+
Y,
|
|
534
|
+
E,
|
|
555
535
|
re,
|
|
556
|
-
|
|
557
|
-
|
|
536
|
+
ne,
|
|
537
|
+
De,
|
|
538
|
+
ce,
|
|
558
539
|
ie
|
|
559
540
|
]
|
|
560
|
-
),
|
|
561
|
-
(l,
|
|
541
|
+
), wt = B(
|
|
542
|
+
(l, d, g) => {
|
|
562
543
|
if (l === "left")
|
|
563
|
-
|
|
564
|
-
ref:
|
|
565
|
-
toggleRef:
|
|
566
|
-
options:
|
|
567
|
-
translateX:
|
|
544
|
+
Ne({
|
|
545
|
+
ref: z,
|
|
546
|
+
toggleRef: N,
|
|
547
|
+
options: I,
|
|
548
|
+
translateX: d
|
|
568
549
|
});
|
|
569
550
|
else if (l === "right")
|
|
570
|
-
|
|
551
|
+
Ne({
|
|
571
552
|
ref: H,
|
|
572
|
-
toggleRef:
|
|
573
|
-
options:
|
|
574
|
-
translateX:
|
|
553
|
+
toggleRef: q,
|
|
554
|
+
options: Y,
|
|
555
|
+
translateX: d
|
|
575
556
|
});
|
|
576
557
|
else if (l === "bottom") {
|
|
577
|
-
const
|
|
578
|
-
if (!
|
|
579
|
-
|
|
580
|
-
ref:
|
|
581
|
-
toggleRef:
|
|
582
|
-
options:
|
|
583
|
-
translateY:
|
|
558
|
+
const b = g?.id ?? "primary", P = E[b], k = U.current.get(b);
|
|
559
|
+
if (!P || !k) return;
|
|
560
|
+
or({
|
|
561
|
+
ref: k.sidebarRef,
|
|
562
|
+
toggleRef: k.toggleRef,
|
|
563
|
+
options: P,
|
|
564
|
+
translateY: d
|
|
584
565
|
});
|
|
585
566
|
} else
|
|
586
567
|
ye(l);
|
|
587
568
|
},
|
|
588
|
-
[
|
|
569
|
+
[I, Y, E]
|
|
589
570
|
);
|
|
590
|
-
return /* @__PURE__ */
|
|
571
|
+
return /* @__PURE__ */ T.jsx(
|
|
591
572
|
Ke.Provider,
|
|
592
573
|
{
|
|
593
574
|
value: {
|
|
594
|
-
lockedSidebar:
|
|
595
|
-
setLockedSidebar:
|
|
596
|
-
leftSidebarRef:
|
|
575
|
+
lockedSidebar: F,
|
|
576
|
+
setLockedSidebar: j,
|
|
577
|
+
leftSidebarRef: z,
|
|
597
578
|
rightSidebarRef: H,
|
|
598
|
-
isLeftOpen:
|
|
599
|
-
isRightOpen:
|
|
579
|
+
isLeftOpen: X,
|
|
580
|
+
isRightOpen: x,
|
|
600
581
|
// Backwards-compat aliases for primary bottom sidebar
|
|
601
|
-
isBottomOpen:
|
|
602
|
-
bottomAnchorState:
|
|
582
|
+
isBottomOpen: fe,
|
|
583
|
+
bottomAnchorState: Se,
|
|
603
584
|
bottomSidebarRef: it,
|
|
604
585
|
bottomToggleRef: ot,
|
|
605
586
|
bottomSidebarOptions: at,
|
|
606
587
|
// Multi-instance bottom sidebar
|
|
607
|
-
bottomSidebars:
|
|
608
|
-
bottomSidebarOptionsMap:
|
|
588
|
+
bottomSidebars: p,
|
|
589
|
+
bottomSidebarOptionsMap: E,
|
|
609
590
|
registerBottomSidebar: lt,
|
|
610
591
|
unregisterBottomSidebar: ut,
|
|
611
592
|
getBottomSidebarRefs: dt,
|
|
612
|
-
activeBottomDragIdRef:
|
|
613
|
-
bottomFocusStackRef:
|
|
593
|
+
activeBottomDragIdRef: $,
|
|
594
|
+
bottomFocusStackRef: K,
|
|
614
595
|
// Functions
|
|
615
596
|
openSidebar: mt,
|
|
616
|
-
openSidebarFully:
|
|
617
|
-
openSidebarToMidAnchor:
|
|
618
|
-
closeSidebar:
|
|
619
|
-
dragSidebar:
|
|
597
|
+
openSidebarFully: pt,
|
|
598
|
+
openSidebarToMidAnchor: bt,
|
|
599
|
+
closeSidebar: vt,
|
|
600
|
+
dragSidebar: wt,
|
|
620
601
|
globalOptions: st,
|
|
621
602
|
setGlobalOptions: gt,
|
|
622
|
-
leftSidebarOptions:
|
|
623
|
-
rightSidebarOptions:
|
|
603
|
+
leftSidebarOptions: I,
|
|
604
|
+
rightSidebarOptions: Y,
|
|
624
605
|
setLeftSidebarOptions: V,
|
|
625
|
-
setRightSidebarOptions:
|
|
606
|
+
setRightSidebarOptions: J,
|
|
626
607
|
setBottomSidebarOptionsById: ft,
|
|
627
|
-
leftToggleRef:
|
|
628
|
-
rightToggleRef:
|
|
608
|
+
leftToggleRef: N,
|
|
609
|
+
rightToggleRef: q,
|
|
629
610
|
leftMeta: oe,
|
|
630
|
-
rightMeta:
|
|
611
|
+
rightMeta: G,
|
|
631
612
|
setMeta: ht
|
|
632
613
|
},
|
|
633
614
|
children: e
|
|
634
615
|
}
|
|
635
616
|
);
|
|
636
617
|
};
|
|
637
|
-
function
|
|
618
|
+
function te() {
|
|
638
619
|
const e = Tt(Ke);
|
|
639
620
|
if (!e)
|
|
640
621
|
throw new Error("useSwipeBarContext must be used within SwipeBarProvider");
|
|
641
622
|
return e;
|
|
642
623
|
}
|
|
643
|
-
const
|
|
624
|
+
const Pt = 300, Mt = 40, Ct = 20, It = 320, We = window.innerHeight, _t = !0, Lt = !0, Dt = !1, et = "rgba(0, 0, 0, 0.5)", Te = "rgb(36,36,36)", Xt = "white", Yt = 40, $t = 40, Bt = !0, Re = 640, Wt = 30, jt = 15, kt = 20, je = 0.6, Ft = 200, Nt = 100, Ht = !1, Gt = !0, Ut = !0, Zt = !1, le = "cubic-bezier(0.22, 1, 0.36, 1)", tt = {
|
|
644
625
|
width: 0,
|
|
645
626
|
top: 0,
|
|
646
627
|
bottom: 0,
|
|
647
628
|
flexShrink: 0,
|
|
648
629
|
overflowX: "hidden",
|
|
649
630
|
willChange: "transform"
|
|
650
|
-
}, Zt = {
|
|
651
|
-
transform: "translateX(-100%)"
|
|
652
631
|
}, zt = {
|
|
632
|
+
transform: "translateX(-100%)"
|
|
633
|
+
}, qt = {
|
|
653
634
|
transform: "translateX(100%)"
|
|
654
635
|
}, Vt = {
|
|
655
636
|
position: "fixed",
|
|
656
637
|
left: 0,
|
|
657
638
|
top: 0,
|
|
658
639
|
bottom: 0
|
|
659
|
-
},
|
|
640
|
+
}, Qt = {
|
|
660
641
|
position: "fixed",
|
|
661
642
|
right: 0,
|
|
662
643
|
top: 0,
|
|
663
644
|
bottom: 0
|
|
664
|
-
},
|
|
645
|
+
}, Jt = {
|
|
665
646
|
height: 0,
|
|
666
647
|
left: 0,
|
|
667
648
|
right: 0,
|
|
668
649
|
flexShrink: 0,
|
|
669
650
|
overflowY: "hidden",
|
|
670
651
|
willChange: "transform"
|
|
671
|
-
}, Jt = {
|
|
672
|
-
transform: "translateY(100%)"
|
|
673
652
|
}, Kt = {
|
|
653
|
+
transform: "translateY(100%)"
|
|
654
|
+
}, er = {
|
|
674
655
|
position: "fixed",
|
|
675
656
|
bottom: 0,
|
|
676
657
|
left: 0,
|
|
677
658
|
right: 0
|
|
678
|
-
},
|
|
659
|
+
}, tr = {
|
|
679
660
|
position: "fixed",
|
|
680
661
|
top: 0,
|
|
681
662
|
left: 0,
|
|
@@ -685,7 +666,7 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
|
|
|
685
666
|
transitionProperty: "opacity",
|
|
686
667
|
pointerEvents: "none",
|
|
687
668
|
opacity: 0
|
|
688
|
-
},
|
|
669
|
+
}, rr = {
|
|
689
670
|
opacity: 1,
|
|
690
671
|
pointerEvents: "auto"
|
|
691
672
|
}, rt = {
|
|
@@ -695,7 +676,7 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
|
|
|
695
676
|
width: "1px",
|
|
696
677
|
display: "flex",
|
|
697
678
|
justifyContent: "center"
|
|
698
|
-
},
|
|
679
|
+
}, nr = {
|
|
699
680
|
position: "fixed",
|
|
700
681
|
bottom: 0,
|
|
701
682
|
left: "50%",
|
|
@@ -703,7 +684,7 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
|
|
|
703
684
|
height: "1px",
|
|
704
685
|
display: "flex",
|
|
705
686
|
alignItems: "center"
|
|
706
|
-
},
|
|
687
|
+
}, ir = {
|
|
707
688
|
position: "relative",
|
|
708
689
|
cursor: "pointer",
|
|
709
690
|
display: "flex",
|
|
@@ -712,33 +693,30 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
|
|
|
712
693
|
justifyContent: "center"
|
|
713
694
|
}, Ee = (e) => {
|
|
714
695
|
throw new Error(`Unhandled sidebar side: ${e}`);
|
|
715
|
-
}, be = (e) => {
|
|
716
|
-
var t;
|
|
717
|
-
return (t = e.current) == null ? void 0 : t.firstElementChild;
|
|
718
|
-
}, xe = ({
|
|
696
|
+
}, be = (e) => e.current?.firstElementChild, xe = ({
|
|
719
697
|
ref: e,
|
|
720
698
|
side: t,
|
|
721
699
|
options: r,
|
|
722
700
|
toggleRef: i,
|
|
723
701
|
afterApply: s
|
|
724
702
|
}) => {
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
let
|
|
728
|
-
t === "left" || t === "right" ? (
|
|
703
|
+
const n = be(e), c = r.transitionMs ? r.transitionMs / 2 : 0;
|
|
704
|
+
n && r.fadeContent && (n.style.opacity = "0");
|
|
705
|
+
let f, u;
|
|
706
|
+
t === "left" || t === "right" ? (f = "width", u = r.sidebarWidthPx, n && u && (n.style.minWidth = `${u}px`)) : t === "bottom" ? (f = "height", u = r.sidebarHeightPx, n && u && (n.style.minHeight = `${u}px`)) : Ee(t), requestAnimationFrame(() => {
|
|
729
707
|
if (!e.current) return;
|
|
730
|
-
const
|
|
731
|
-
e.current.style.transition = `${
|
|
708
|
+
const a = `transform ${r.transitionMs}ms ${le}`, v = r.isAbsolute ? "" : `, ${f} ${r.transitionMs}ms ${le}`;
|
|
709
|
+
e.current.style.transition = `${a}${v}`, n && r.fadeContent && (n.style.transition = `opacity ${r.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
732
710
|
if (e.current) {
|
|
733
711
|
if (e.current.style.transform = t === "bottom" ? "translateY(0px)" : "translateX(0px)", !r.isAbsolute)
|
|
734
|
-
e.current.style[
|
|
735
|
-
else if (e.current.style[
|
|
736
|
-
const
|
|
737
|
-
e.current.style.transition =
|
|
712
|
+
e.current.style[f] = `${u}px`;
|
|
713
|
+
else if (e.current.style[f] !== `${u}px`) {
|
|
714
|
+
const y = e.current.style.transition;
|
|
715
|
+
e.current.style.transition = a, e.current.style[f] = `${u}px`, e.current.style.transition = y;
|
|
738
716
|
}
|
|
739
|
-
i.current &&
|
|
740
|
-
|
|
741
|
-
},
|
|
717
|
+
i.current && u && (i.current.style.opacity = "1", t === "left" ? i.current.style.transform = `translateY(-50%) translateX(${u}px)` : t === "right" ? i.current.style.transform = `translateY(-50%) translateX(-${u}px)` : t === "bottom" && (i.current.style.transform = `translateX(-50%) translateY(-${u}px)`)), n && r.fadeContent && setTimeout(() => {
|
|
718
|
+
n.style.opacity = "1";
|
|
719
|
+
}, c), s();
|
|
742
720
|
}
|
|
743
721
|
});
|
|
744
722
|
}), setTimeout(() => {
|
|
@@ -750,41 +728,41 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
|
|
|
750
728
|
toggleRef: i,
|
|
751
729
|
afterApply: s
|
|
752
730
|
}) => {
|
|
753
|
-
const
|
|
754
|
-
let
|
|
755
|
-
r === "left" || r === "right" ? (
|
|
731
|
+
const n = be(e);
|
|
732
|
+
let c;
|
|
733
|
+
r === "left" || r === "right" ? (c = "width", n && t.sidebarWidthPx && (n.style.minWidth = `${t.sidebarWidthPx}px`)) : r === "bottom" ? (c = "height", n && t.sidebarHeightPx && (n.style.minHeight = `${t.sidebarHeightPx}px`)) : Ee(r), requestAnimationFrame(() => {
|
|
756
734
|
if (!e.current) return;
|
|
757
|
-
const
|
|
758
|
-
e.current.style.transition = `${
|
|
759
|
-
e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")),
|
|
735
|
+
const f = `transform ${t.transitionMs}ms ${le}`, u = t.isAbsolute ? "" : `, ${c} ${t.transitionMs}ms ${le}`;
|
|
736
|
+
e.current.style.transition = `${f}${u}`, n && t.fadeContent && (n.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
737
|
+
e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")), n && t.fadeContent && (n.style.opacity = "0"), s());
|
|
760
738
|
});
|
|
761
739
|
});
|
|
762
|
-
},
|
|
740
|
+
}, Fe = ({
|
|
763
741
|
ref: e,
|
|
764
742
|
options: t,
|
|
765
743
|
toggleRef: r,
|
|
766
744
|
afterApply: i
|
|
767
745
|
}) => {
|
|
768
|
-
const s = be(e),
|
|
746
|
+
const s = be(e), n = t.transitionMs ? t.transitionMs / 2 : 0;
|
|
769
747
|
s && t.fadeContent && (s.style.opacity = "0"), s && t.midAnchorPointPx && (s.style.minHeight = `${t.sidebarHeightPx}px`), requestAnimationFrame(() => {
|
|
770
748
|
if (!e.current) return;
|
|
771
|
-
const
|
|
772
|
-
e.current.style.transition = `${
|
|
749
|
+
const c = `transform ${t.transitionMs}ms ${le}`, f = t.isAbsolute ? "" : `, height ${t.transitionMs}ms ${le}`;
|
|
750
|
+
e.current.style.transition = `${c}${f}`, s && t.fadeContent && (s.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
773
751
|
if (!e.current) return;
|
|
774
|
-
const
|
|
775
|
-
if (e.current.style.transform = `translateY(${
|
|
776
|
-
e.current.style.height = `${
|
|
777
|
-
else if (e.current.style.height !== `${
|
|
778
|
-
const
|
|
779
|
-
e.current.style.transition =
|
|
752
|
+
const u = t.midAnchorPointPx ?? 0, a = t.sidebarHeightPx ?? 0, v = a - u;
|
|
753
|
+
if (e.current.style.transform = `translateY(${v}px)`, !t.isAbsolute)
|
|
754
|
+
e.current.style.height = `${a}px`;
|
|
755
|
+
else if (e.current.style.height !== `${a}px`) {
|
|
756
|
+
const y = e.current.style.transition;
|
|
757
|
+
e.current.style.transition = c, e.current.style.height = `${a}px`, e.current.style.transition = y;
|
|
780
758
|
}
|
|
781
|
-
r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${
|
|
759
|
+
r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${u}px)`), s && t.fadeContent && setTimeout(() => {
|
|
782
760
|
s.style.opacity = "1";
|
|
783
|
-
},
|
|
761
|
+
}, n), i();
|
|
784
762
|
});
|
|
785
763
|
}), setTimeout(() => {
|
|
786
764
|
}, 0);
|
|
787
|
-
},
|
|
765
|
+
}, Ne = ({
|
|
788
766
|
ref: e,
|
|
789
767
|
toggleRef: t,
|
|
790
768
|
options: r,
|
|
@@ -794,13 +772,13 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
|
|
|
794
772
|
const s = be(e);
|
|
795
773
|
if (e.current) {
|
|
796
774
|
if (s && r.fadeContent && (s.style.opacity = "0"), s && r.sidebarWidthPx && (s.style.minWidth = `${r.sidebarWidthPx}px`), !r.isAbsolute) {
|
|
797
|
-
const
|
|
798
|
-
e.current.style.width !==
|
|
775
|
+
const n = `${r.sidebarWidthPx}px`;
|
|
776
|
+
e.current.style.width !== n && (e.current.style.width = n);
|
|
799
777
|
}
|
|
800
778
|
e.current.style.transform = `translateX(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateY(-50%) translateX(${i}px)`);
|
|
801
779
|
}
|
|
802
780
|
}));
|
|
803
|
-
},
|
|
781
|
+
}, or = ({
|
|
804
782
|
ref: e,
|
|
805
783
|
toggleRef: t,
|
|
806
784
|
options: r,
|
|
@@ -810,13 +788,13 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
|
|
|
810
788
|
const s = be(e);
|
|
811
789
|
if (e.current) {
|
|
812
790
|
if (s && r.fadeContent && (s.style.opacity = "0"), s && r.sidebarHeightPx && (s.style.minHeight = `${r.sidebarHeightPx}px`), !r.isAbsolute) {
|
|
813
|
-
const
|
|
814
|
-
e.current.style.height !==
|
|
791
|
+
const n = `${r.sidebarHeightPx}px`;
|
|
792
|
+
e.current.style.height !== n && (e.current.style.height = n);
|
|
815
793
|
}
|
|
816
794
|
e.current.style.transform = `translateY(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateX(-50%) translateY(${i}px)`);
|
|
817
795
|
}
|
|
818
796
|
}));
|
|
819
|
-
},
|
|
797
|
+
}, we = ({ refs: e, clientX: t, clientY: r, touchId: i, isMouse: s }) => {
|
|
820
798
|
e.draggingRef.current = {
|
|
821
799
|
startX: t,
|
|
822
800
|
startY: r,
|
|
@@ -840,9 +818,9 @@ const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t
|
|
|
840
818
|
}, e.currentYRef.current = r, e.prevYRef.current = r;
|
|
841
819
|
}, nt = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
|
|
842
820
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null, t(null), r();
|
|
843
|
-
},
|
|
821
|
+
}, ar = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
|
|
844
822
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, t(null);
|
|
845
|
-
},
|
|
823
|
+
}, ue = (e) => e instanceof Element ? !!e.closest("input, textarea, [contenteditable='true']") : !1;
|
|
846
824
|
function Ge(e) {
|
|
847
825
|
let t = e instanceof HTMLElement ? e : null;
|
|
848
826
|
for (; t; ) {
|
|
@@ -853,162 +831,163 @@ function Ge(e) {
|
|
|
853
831
|
}
|
|
854
832
|
return null;
|
|
855
833
|
}
|
|
856
|
-
const
|
|
834
|
+
const Oe = (e, t) => {
|
|
857
835
|
for (let r = 0; r < e.length; r++) {
|
|
858
836
|
const i = e[r];
|
|
859
837
|
if (t == null || i.identifier === t)
|
|
860
838
|
return i;
|
|
861
839
|
}
|
|
862
840
|
return null;
|
|
863
|
-
},
|
|
841
|
+
}, Ae = (e, t) => {
|
|
864
842
|
for (let r = 0; r < e.length; r++)
|
|
865
843
|
if (e[r].identifier === t)
|
|
866
844
|
return !0;
|
|
867
845
|
return !1;
|
|
868
|
-
},
|
|
846
|
+
}, Pe = (e, t, r) => {
|
|
869
847
|
const {
|
|
870
848
|
globalOptions: i,
|
|
871
849
|
setLeftSidebarOptions: s,
|
|
872
|
-
setRightSidebarOptions:
|
|
873
|
-
setBottomSidebarOptionsById:
|
|
874
|
-
} =
|
|
875
|
-
sidebarWidthPx:
|
|
876
|
-
sidebarHeightPx:
|
|
877
|
-
transitionMs:
|
|
878
|
-
edgeActivationWidthPx:
|
|
879
|
-
dragActivationDeltaPx:
|
|
880
|
-
showOverlay:
|
|
850
|
+
setRightSidebarOptions: n,
|
|
851
|
+
setBottomSidebarOptionsById: c
|
|
852
|
+
} = te(), {
|
|
853
|
+
sidebarWidthPx: f,
|
|
854
|
+
sidebarHeightPx: u,
|
|
855
|
+
transitionMs: a,
|
|
856
|
+
edgeActivationWidthPx: v,
|
|
857
|
+
dragActivationDeltaPx: y,
|
|
858
|
+
showOverlay: h,
|
|
881
859
|
isAbsolute: S,
|
|
882
|
-
overlayBackgroundColor:
|
|
883
|
-
toggleIconColor:
|
|
884
|
-
toggleIconSizePx:
|
|
885
|
-
toggleIconEdgeDistancePx:
|
|
886
|
-
showToggle:
|
|
887
|
-
mediaQueryWidth:
|
|
888
|
-
swipeBarZIndex:
|
|
889
|
-
toggleZIndex:
|
|
890
|
-
overlayZIndex:
|
|
891
|
-
fadeContent:
|
|
892
|
-
fadeContentTransitionMs:
|
|
893
|
-
swipeToOpen:
|
|
894
|
-
swipeToClose:
|
|
860
|
+
overlayBackgroundColor: M,
|
|
861
|
+
toggleIconColor: w,
|
|
862
|
+
toggleIconSizePx: C,
|
|
863
|
+
toggleIconEdgeDistancePx: D,
|
|
864
|
+
showToggle: _,
|
|
865
|
+
mediaQueryWidth: W,
|
|
866
|
+
swipeBarZIndex: F,
|
|
867
|
+
toggleZIndex: j,
|
|
868
|
+
overlayZIndex: X,
|
|
869
|
+
fadeContent: m,
|
|
870
|
+
fadeContentTransitionMs: x,
|
|
871
|
+
swipeToOpen: A,
|
|
872
|
+
swipeToClose: I,
|
|
895
873
|
midAnchorPoint: V,
|
|
896
|
-
midAnchorPointPx:
|
|
897
|
-
disabled:
|
|
898
|
-
closeSidebarOnOverlayClick:
|
|
874
|
+
midAnchorPointPx: Y,
|
|
875
|
+
disabled: J,
|
|
876
|
+
closeSidebarOnOverlayClick: z,
|
|
899
877
|
resetMetaOnClose: H
|
|
900
|
-
} = t,
|
|
901
|
-
const
|
|
878
|
+
} = t, N = Je(() => {
|
|
879
|
+
const q = u ?? i.sidebarHeightPx;
|
|
902
880
|
return {
|
|
903
|
-
sidebarWidthPx:
|
|
904
|
-
sidebarHeightPx:
|
|
905
|
-
transitionMs:
|
|
906
|
-
edgeActivationWidthPx:
|
|
907
|
-
dragActivationDeltaPx:
|
|
908
|
-
showOverlay:
|
|
881
|
+
sidebarWidthPx: f ?? i.sidebarWidthPx,
|
|
882
|
+
sidebarHeightPx: q,
|
|
883
|
+
transitionMs: a ?? i.transitionMs,
|
|
884
|
+
edgeActivationWidthPx: v ?? i.edgeActivationWidthPx,
|
|
885
|
+
dragActivationDeltaPx: y ?? i.dragActivationDeltaPx,
|
|
886
|
+
showOverlay: h ?? i.showOverlay,
|
|
909
887
|
isAbsolute: S ?? i.isAbsolute,
|
|
910
|
-
overlayBackgroundColor:
|
|
911
|
-
toggleIconColor:
|
|
912
|
-
toggleIconSizePx:
|
|
913
|
-
toggleIconEdgeDistancePx:
|
|
914
|
-
showToggle:
|
|
915
|
-
mediaQueryWidth:
|
|
916
|
-
swipeBarZIndex:
|
|
917
|
-
toggleZIndex:
|
|
918
|
-
overlayZIndex:
|
|
919
|
-
fadeContent:
|
|
920
|
-
fadeContentTransitionMs:
|
|
921
|
-
swipeToOpen:
|
|
922
|
-
swipeToClose:
|
|
888
|
+
overlayBackgroundColor: M ?? i.overlayBackgroundColor,
|
|
889
|
+
toggleIconColor: w ?? i.toggleIconColor,
|
|
890
|
+
toggleIconSizePx: C ?? i.toggleIconSizePx,
|
|
891
|
+
toggleIconEdgeDistancePx: D ?? i.toggleIconEdgeDistancePx,
|
|
892
|
+
showToggle: _ ?? i.showToggle,
|
|
893
|
+
mediaQueryWidth: W ?? i.mediaQueryWidth,
|
|
894
|
+
swipeBarZIndex: F ?? i.swipeBarZIndex,
|
|
895
|
+
toggleZIndex: j ?? i.toggleZIndex,
|
|
896
|
+
overlayZIndex: X ?? i.overlayZIndex,
|
|
897
|
+
fadeContent: m ?? i.fadeContent,
|
|
898
|
+
fadeContentTransitionMs: x ?? i.fadeContentTransitionMs,
|
|
899
|
+
swipeToOpen: A ?? i.swipeToOpen,
|
|
900
|
+
swipeToClose: I ?? i.swipeToClose,
|
|
923
901
|
midAnchorPoint: V ?? i.midAnchorPoint,
|
|
924
|
-
midAnchorPointPx:
|
|
925
|
-
disabled:
|
|
926
|
-
closeSidebarOnOverlayClick:
|
|
902
|
+
midAnchorPointPx: Y ?? i.midAnchorPointPx ?? Math.floor(q / 3),
|
|
903
|
+
disabled: J ?? i.disabled,
|
|
904
|
+
closeSidebarOnOverlayClick: z ?? i.closeSidebarOnOverlayClick,
|
|
927
905
|
resetMetaOnClose: H ?? i.resetMetaOnClose
|
|
928
906
|
};
|
|
929
907
|
}, [
|
|
930
|
-
|
|
931
|
-
d,
|
|
908
|
+
f,
|
|
932
909
|
u,
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
910
|
+
a,
|
|
911
|
+
v,
|
|
912
|
+
y,
|
|
913
|
+
h,
|
|
936
914
|
S,
|
|
937
|
-
I,
|
|
938
|
-
p,
|
|
939
915
|
M,
|
|
940
|
-
|
|
916
|
+
w,
|
|
941
917
|
C,
|
|
918
|
+
D,
|
|
919
|
+
_,
|
|
942
920
|
i,
|
|
943
|
-
|
|
921
|
+
W,
|
|
922
|
+
F,
|
|
944
923
|
j,
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
P,
|
|
924
|
+
X,
|
|
925
|
+
m,
|
|
926
|
+
x,
|
|
927
|
+
A,
|
|
928
|
+
I,
|
|
951
929
|
V,
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
930
|
+
Y,
|
|
931
|
+
J,
|
|
932
|
+
z,
|
|
955
933
|
H
|
|
956
934
|
]);
|
|
957
|
-
return
|
|
958
|
-
e === "left" ? s(
|
|
935
|
+
return Z(() => {
|
|
936
|
+
e === "left" ? s(N) : e === "right" ? n(N) : e === "bottom" ? c(r ?? "primary", N) : Ee(e);
|
|
959
937
|
}, [
|
|
960
938
|
e,
|
|
961
939
|
r,
|
|
962
|
-
|
|
940
|
+
N,
|
|
963
941
|
s,
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
]),
|
|
942
|
+
n,
|
|
943
|
+
c
|
|
944
|
+
]), N;
|
|
967
945
|
};
|
|
968
|
-
function
|
|
946
|
+
function Me({
|
|
969
947
|
isCollapsed: e,
|
|
970
948
|
setCollapsed: t,
|
|
971
949
|
closeSidebarOnClick: r = !0,
|
|
972
950
|
transitionMs: i,
|
|
973
951
|
overlayBackgroundColor: s,
|
|
974
|
-
overlayZIndex:
|
|
952
|
+
overlayZIndex: n
|
|
975
953
|
}) {
|
|
976
|
-
return /* @__PURE__ */
|
|
954
|
+
return /* @__PURE__ */ T.jsx(
|
|
977
955
|
"div",
|
|
978
956
|
{
|
|
957
|
+
"aria-hidden": "true",
|
|
979
958
|
style: {
|
|
980
959
|
transitionDuration: `${i}ms`,
|
|
981
|
-
...
|
|
982
|
-
...e ? {} :
|
|
960
|
+
...tr,
|
|
961
|
+
...e ? {} : rr,
|
|
983
962
|
...s ? { backgroundColor: s } : {},
|
|
984
|
-
zIndex:
|
|
963
|
+
zIndex: n
|
|
985
964
|
},
|
|
986
|
-
onMouseDown: (
|
|
987
|
-
r && (
|
|
965
|
+
onMouseDown: (c) => {
|
|
966
|
+
r && (c.stopPropagation(), t());
|
|
988
967
|
}
|
|
989
968
|
}
|
|
990
969
|
);
|
|
991
970
|
}
|
|
992
971
|
function Ce({ size: e, color: t }) {
|
|
993
972
|
const r = L(null);
|
|
994
|
-
return
|
|
973
|
+
return Z(() => {
|
|
995
974
|
const i = () => {
|
|
996
975
|
r.current && (r.current.style.opacity = "1");
|
|
997
976
|
}, s = () => {
|
|
998
977
|
r.current && (r.current.style.opacity = `${je}`);
|
|
999
978
|
};
|
|
1000
979
|
r.current && (r.current.addEventListener("mouseenter", i), r.current.addEventListener("mouseleave", s));
|
|
1001
|
-
}, []), /* @__PURE__ */
|
|
980
|
+
}, []), /* @__PURE__ */ T.jsx(
|
|
1002
981
|
"div",
|
|
1003
982
|
{
|
|
1004
983
|
style: {
|
|
1005
|
-
...
|
|
984
|
+
...ir
|
|
1006
985
|
},
|
|
1007
|
-
children: /* @__PURE__ */
|
|
986
|
+
children: /* @__PURE__ */ T.jsxs(
|
|
1008
987
|
"svg",
|
|
1009
988
|
{
|
|
1010
989
|
style: {
|
|
1011
|
-
transition: `opacity ${
|
|
990
|
+
transition: `opacity ${Ft}ms ease`,
|
|
1012
991
|
opacity: `${je}`
|
|
1013
992
|
},
|
|
1014
993
|
ref: r,
|
|
@@ -1018,8 +997,8 @@ function Ce({ size: e, color: t }) {
|
|
|
1018
997
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1019
998
|
width: e,
|
|
1020
999
|
children: [
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ T.jsx("g", { strokeWidth: "0" }),
|
|
1001
|
+
/* @__PURE__ */ T.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ T.jsx("g", { children: /* @__PURE__ */ T.jsx(
|
|
1023
1002
|
"path",
|
|
1024
1003
|
{
|
|
1025
1004
|
clipRule: "evenodd",
|
|
@@ -1034,50 +1013,98 @@ function Ce({ size: e, color: t }) {
|
|
|
1034
1013
|
}
|
|
1035
1014
|
);
|
|
1036
1015
|
}
|
|
1037
|
-
function
|
|
1016
|
+
function sr({
|
|
1038
1017
|
id: e,
|
|
1039
1018
|
toggleRef: t,
|
|
1040
1019
|
options: r,
|
|
1041
1020
|
showToggle: i = !0,
|
|
1042
1021
|
ToggleComponent: s
|
|
1043
1022
|
}) {
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
return i ? /* @__PURE__ */ E.jsx(
|
|
1023
|
+
const { openSidebar: n, closeSidebar: c, bottomSidebars: f } = te(), u = f[e]?.isOpen ?? !1;
|
|
1024
|
+
return i ? /* @__PURE__ */ T.jsx(
|
|
1047
1025
|
"div",
|
|
1048
1026
|
{
|
|
1049
1027
|
ref: t,
|
|
1050
1028
|
style: {
|
|
1051
|
-
...
|
|
1029
|
+
...nr,
|
|
1052
1030
|
transition: `transform ${r.transitionMs}ms ease, opacity ${r.transitionMs}ms ease`,
|
|
1053
1031
|
zIndex: r.toggleZIndex
|
|
1054
1032
|
},
|
|
1055
|
-
children: (!
|
|
1033
|
+
children: (!u || u && !r.showOverlay) && /* @__PURE__ */ T.jsx(
|
|
1056
1034
|
"button",
|
|
1057
1035
|
{
|
|
1058
1036
|
type: "button",
|
|
1037
|
+
"aria-expanded": u,
|
|
1038
|
+
"aria-controls": `swipebar-bottom-${e}`,
|
|
1039
|
+
"aria-label": u ? "Close bottom sidebar" : "Open bottom sidebar",
|
|
1059
1040
|
onClick: () => {
|
|
1060
|
-
r.disabled || (
|
|
1041
|
+
r.disabled || (u ? c("bottom", { id: e }) : n("bottom", { id: e }));
|
|
1061
1042
|
},
|
|
1062
1043
|
disabled: r.disabled,
|
|
1063
1044
|
style: {
|
|
1064
1045
|
marginBottom: `${r.toggleIconEdgeDistancePx}px`,
|
|
1065
1046
|
// Rotate icon: -90deg points up when closed, 90deg points down when open
|
|
1066
|
-
transform:
|
|
1047
|
+
transform: u ? "rotate(90deg)" : "rotate(-90deg)"
|
|
1067
1048
|
},
|
|
1068
|
-
children: s ?? /* @__PURE__ */
|
|
1049
|
+
children: s ?? /* @__PURE__ */ T.jsx(Ce, { size: r.toggleIconSizePx, color: r.toggleIconColor })
|
|
1069
1050
|
}
|
|
1070
1051
|
)
|
|
1071
1052
|
}
|
|
1072
1053
|
) : null;
|
|
1073
1054
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
return
|
|
1055
|
+
const cr = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
1056
|
+
function lr(e) {
|
|
1057
|
+
return Array.from(e.querySelectorAll(cr)).filter(
|
|
1058
|
+
(t) => !t.closest("[inert]")
|
|
1059
|
+
);
|
|
1060
|
+
}
|
|
1061
|
+
function Ie({
|
|
1062
|
+
sidebarRef: e,
|
|
1063
|
+
triggerRef: t,
|
|
1064
|
+
isOpen: r,
|
|
1065
|
+
onClose: i,
|
|
1066
|
+
transitionMs: s
|
|
1067
|
+
}) {
|
|
1068
|
+
const n = L(null);
|
|
1069
|
+
Z(() => {
|
|
1070
|
+
if (r) {
|
|
1071
|
+
n.current = document.activeElement;
|
|
1072
|
+
const f = setTimeout(() => {
|
|
1073
|
+
e.current && (e.current.setAttribute("tabindex", "-1"), e.current.focus());
|
|
1074
|
+
}, s);
|
|
1075
|
+
return () => clearTimeout(f);
|
|
1076
|
+
}
|
|
1077
|
+
const c = n.current;
|
|
1078
|
+
if (c) {
|
|
1079
|
+
const f = t.current?.querySelector("button") ?? c;
|
|
1080
|
+
requestAnimationFrame(() => {
|
|
1081
|
+
f.focus();
|
|
1082
|
+
}), n.current = null;
|
|
1083
|
+
}
|
|
1084
|
+
}, [r, e, t, s]), Z(() => {
|
|
1085
|
+
if (!r) return;
|
|
1086
|
+
function c(f) {
|
|
1087
|
+
if (f.key === "Escape") {
|
|
1088
|
+
if (!e.current) return;
|
|
1089
|
+
e.current.contains(document.activeElement) && (f.preventDefault(), i());
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
if (f.key !== "Tab" || !e.current) return;
|
|
1093
|
+
const u = lr(e.current);
|
|
1094
|
+
if (u.length === 0) return;
|
|
1095
|
+
const a = u[0], v = u[u.length - 1];
|
|
1096
|
+
f.shiftKey ? document.activeElement === a && (f.preventDefault(), v.focus()) : document.activeElement === v && (f.preventDefault(), a.focus());
|
|
1097
|
+
}
|
|
1098
|
+
return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
|
|
1099
|
+
}, [r, e, i]);
|
|
1100
|
+
}
|
|
1101
|
+
function de(e = Re) {
|
|
1102
|
+
const t = `(max-width: ${Math.min(e, Re)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [i, s] = Q(r);
|
|
1103
|
+
return Z(() => {
|
|
1077
1104
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
1078
1105
|
return;
|
|
1079
|
-
const
|
|
1080
|
-
return
|
|
1106
|
+
const n = window.matchMedia(t), c = () => s(n.matches);
|
|
1107
|
+
return c(), n.addEventListener("change", c), () => n.removeEventListener("change", c);
|
|
1081
1108
|
}, [t]), i;
|
|
1082
1109
|
}
|
|
1083
1110
|
const Ue = ({
|
|
@@ -1086,20 +1113,20 @@ const Ue = ({
|
|
|
1086
1113
|
currentY: r,
|
|
1087
1114
|
preventDefault: i,
|
|
1088
1115
|
lockPane: s,
|
|
1089
|
-
options:
|
|
1090
|
-
scrollableAncestor:
|
|
1091
|
-
initialScrollTop:
|
|
1116
|
+
options: n,
|
|
1117
|
+
scrollableAncestor: c,
|
|
1118
|
+
initialScrollTop: f
|
|
1092
1119
|
}) => {
|
|
1093
1120
|
if (!e.draggingRef.current) return;
|
|
1094
|
-
const
|
|
1095
|
-
if (!e.draggingRef.current.isActivated && Math.abs(
|
|
1096
|
-
if (
|
|
1097
|
-
if (
|
|
1121
|
+
const u = r - e.draggingRef.current.startY;
|
|
1122
|
+
if (!e.draggingRef.current.isActivated && Math.abs(u) >= n.dragActivationDeltaPx) {
|
|
1123
|
+
if (c && t.getIsOpen()) {
|
|
1124
|
+
if (c.scrollTop !== f) {
|
|
1098
1125
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1099
1126
|
return;
|
|
1100
1127
|
}
|
|
1101
|
-
const { scrollTop:
|
|
1102
|
-
if (
|
|
1128
|
+
const { scrollTop: w, scrollHeight: C, clientHeight: D } = c, _ = w > 1, W = w + D < C - 1;
|
|
1129
|
+
if (u > 0 && _ || u < 0 && W) {
|
|
1103
1130
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1104
1131
|
return;
|
|
1105
1132
|
}
|
|
@@ -1108,59 +1135,59 @@ const Ue = ({
|
|
|
1108
1135
|
}
|
|
1109
1136
|
if (!e.draggingRef.current.isActivated) return;
|
|
1110
1137
|
e.prevYRef.current = e.currentYRef.current, e.currentYRef.current = r;
|
|
1111
|
-
const
|
|
1112
|
-
let
|
|
1113
|
-
if ((
|
|
1138
|
+
const a = t.getIsOpen(), v = window.innerHeight;
|
|
1139
|
+
let y = !1;
|
|
1140
|
+
if ((a || e.draggingRef.current.startY >= v - n.edgeActivationWidthPx) && (y = !0), !y) {
|
|
1114
1141
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1115
1142
|
return;
|
|
1116
1143
|
}
|
|
1117
1144
|
i();
|
|
1118
|
-
const
|
|
1119
|
-
if (
|
|
1120
|
-
if (
|
|
1121
|
-
const
|
|
1122
|
-
if (
|
|
1123
|
-
const
|
|
1145
|
+
const h = n.sidebarHeightPx, S = n.midAnchorPointPx, M = n.midAnchorPoint && !n.swipeToOpen && S < h;
|
|
1146
|
+
if (a)
|
|
1147
|
+
if (M) {
|
|
1148
|
+
const w = t.getBottomAnchorState();
|
|
1149
|
+
if (w === "open") {
|
|
1150
|
+
const C = Math.max(
|
|
1124
1151
|
0,
|
|
1125
|
-
Math.min(
|
|
1152
|
+
Math.min(h, u - n.dragActivationDeltaPx)
|
|
1126
1153
|
);
|
|
1127
|
-
t.dragSidebar(
|
|
1128
|
-
} else if (
|
|
1129
|
-
const
|
|
1154
|
+
t.dragSidebar(C);
|
|
1155
|
+
} else if (w === "midAnchor") {
|
|
1156
|
+
const C = h - S, D = Math.max(
|
|
1130
1157
|
0,
|
|
1131
1158
|
Math.min(
|
|
1132
|
-
|
|
1133
|
-
|
|
1159
|
+
h,
|
|
1160
|
+
C + u - n.dragActivationDeltaPx
|
|
1134
1161
|
)
|
|
1135
1162
|
);
|
|
1136
|
-
t.dragSidebar(
|
|
1163
|
+
t.dragSidebar(D);
|
|
1137
1164
|
}
|
|
1138
1165
|
} else {
|
|
1139
|
-
const
|
|
1166
|
+
const w = Math.max(
|
|
1140
1167
|
0,
|
|
1141
|
-
Math.min(
|
|
1168
|
+
Math.min(h, u - n.dragActivationDeltaPx)
|
|
1142
1169
|
);
|
|
1143
|
-
t.dragSidebar(
|
|
1170
|
+
t.dragSidebar(w);
|
|
1144
1171
|
}
|
|
1145
|
-
else if (e.draggingRef.current.startY >=
|
|
1146
|
-
if (
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1172
|
+
else if (e.draggingRef.current.startY >= v - n.edgeActivationWidthPx)
|
|
1173
|
+
if (M) {
|
|
1174
|
+
const w = h - S, C = Math.max(
|
|
1175
|
+
w,
|
|
1149
1176
|
Math.min(
|
|
1150
|
-
|
|
1151
|
-
|
|
1177
|
+
h,
|
|
1178
|
+
h + u + n.dragActivationDeltaPx
|
|
1152
1179
|
)
|
|
1153
1180
|
);
|
|
1154
|
-
t.dragSidebar(
|
|
1181
|
+
t.dragSidebar(C);
|
|
1155
1182
|
} else {
|
|
1156
|
-
const
|
|
1183
|
+
const w = Math.max(
|
|
1157
1184
|
0,
|
|
1158
1185
|
Math.min(
|
|
1159
|
-
|
|
1160
|
-
|
|
1186
|
+
h,
|
|
1187
|
+
h + u + n.dragActivationDeltaPx
|
|
1161
1188
|
)
|
|
1162
1189
|
);
|
|
1163
|
-
t.dragSidebar(
|
|
1190
|
+
t.dragSidebar(w);
|
|
1164
1191
|
}
|
|
1165
1192
|
}, Ze = ({
|
|
1166
1193
|
refs: e,
|
|
@@ -1173,225 +1200,234 @@ const Ue = ({
|
|
|
1173
1200
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null;
|
|
1174
1201
|
return;
|
|
1175
1202
|
}
|
|
1176
|
-
const s = e.currentYRef.current ?? e.draggingRef.current.startY,
|
|
1203
|
+
const s = e.currentYRef.current ?? e.draggingRef.current.startY, n = e.prevYRef.current ?? e.draggingRef.current.startY, c = e.draggingRef.current.startY, f = t.getIsOpen(), u = window.innerHeight;
|
|
1177
1204
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, i();
|
|
1178
|
-
const
|
|
1179
|
-
if (
|
|
1180
|
-
if (
|
|
1181
|
-
const
|
|
1182
|
-
if (
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1185
|
-
} else if (
|
|
1186
|
-
const
|
|
1205
|
+
const a = s < n, v = s >= n, y = c >= u - r.edgeActivationWidthPx, h = r.midAnchorPointPx, S = r.sidebarHeightPx, M = r.midAnchorPoint && !r.swipeToOpen && h < S;
|
|
1206
|
+
if (f)
|
|
1207
|
+
if (M) {
|
|
1208
|
+
const w = t.getBottomAnchorState(), C = S - h;
|
|
1209
|
+
if (w === "open") {
|
|
1210
|
+
const D = Math.max(0, s - c);
|
|
1211
|
+
v ? D > C ? t.closeSidebar() : t.openToMidAnchor() : D < C ? t.openSidebarFully() : t.closeSidebar(), t.dragSidebar(null);
|
|
1212
|
+
} else if (w === "midAnchor") {
|
|
1213
|
+
const D = S - h, _ = Math.max(
|
|
1187
1214
|
0,
|
|
1188
|
-
Math.min(S,
|
|
1215
|
+
Math.min(S, D + (s - c))
|
|
1189
1216
|
);
|
|
1190
|
-
|
|
1217
|
+
a ? _ < C ? t.openSidebarFully() : t.openToMidAnchor() : t.closeSidebar(), t.dragSidebar(null);
|
|
1191
1218
|
}
|
|
1192
1219
|
} else
|
|
1193
|
-
|
|
1194
|
-
else
|
|
1220
|
+
v ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null);
|
|
1221
|
+
else y && a ? (M ? t.openToMidAnchor() : t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1195
1222
|
};
|
|
1196
|
-
function
|
|
1197
|
-
|
|
1198
|
-
const r = fe(e.mediaQueryWidth), {
|
|
1223
|
+
function ur(e, t) {
|
|
1224
|
+
const r = de(e.mediaQueryWidth), {
|
|
1199
1225
|
lockedSidebar: i,
|
|
1200
1226
|
setLockedSidebar: s,
|
|
1201
|
-
bottomSidebars:
|
|
1202
|
-
openSidebar:
|
|
1203
|
-
openSidebarFully:
|
|
1204
|
-
closeSidebar:
|
|
1205
|
-
dragSidebar:
|
|
1206
|
-
openSidebarToMidAnchor:
|
|
1207
|
-
activeBottomDragIdRef:
|
|
1208
|
-
bottomFocusStackRef:
|
|
1209
|
-
} =
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
}, [
|
|
1227
|
+
bottomSidebars: n,
|
|
1228
|
+
openSidebar: c,
|
|
1229
|
+
openSidebarFully: f,
|
|
1230
|
+
closeSidebar: u,
|
|
1231
|
+
dragSidebar: a,
|
|
1232
|
+
openSidebarToMidAnchor: v,
|
|
1233
|
+
activeBottomDragIdRef: y,
|
|
1234
|
+
bottomFocusStackRef: h
|
|
1235
|
+
} = te(), S = n[t]?.isOpen ?? !1, M = n[t]?.anchorState ?? "closed", w = L(null), C = L(null), D = L(null), _ = L(null), W = L(0), F = L(null), j = L(M);
|
|
1236
|
+
Z(() => {
|
|
1237
|
+
j.current = M;
|
|
1238
|
+
}, [M]), Z(() => {
|
|
1213
1239
|
if (!r || i && i !== "bottom" || e.disabled) return;
|
|
1214
|
-
const
|
|
1240
|
+
const X = {
|
|
1215
1241
|
getIsOpen: () => S,
|
|
1216
|
-
openSidebar: () =>
|
|
1217
|
-
openSidebarFully: () =>
|
|
1218
|
-
closeSidebar: () =>
|
|
1219
|
-
dragSidebar: (
|
|
1220
|
-
getBottomAnchorState: () =>
|
|
1221
|
-
openToMidAnchor: () =>
|
|
1222
|
-
},
|
|
1223
|
-
draggingRef:
|
|
1224
|
-
currentYRef:
|
|
1225
|
-
prevYRef:
|
|
1226
|
-
},
|
|
1227
|
-
const
|
|
1228
|
-
return
|
|
1229
|
-
},
|
|
1230
|
-
if (
|
|
1231
|
-
|
|
1242
|
+
openSidebar: () => c("bottom", { id: t }),
|
|
1243
|
+
openSidebarFully: () => f("bottom", { id: t }),
|
|
1244
|
+
closeSidebar: () => u("bottom", { id: t }),
|
|
1245
|
+
dragSidebar: (R) => a("bottom", R, { id: t }),
|
|
1246
|
+
getBottomAnchorState: () => j.current,
|
|
1247
|
+
openToMidAnchor: () => v("bottom", { id: t })
|
|
1248
|
+
}, m = {
|
|
1249
|
+
draggingRef: w,
|
|
1250
|
+
currentYRef: C,
|
|
1251
|
+
prevYRef: D
|
|
1252
|
+
}, x = () => y.current !== null && y.current !== t, A = () => {
|
|
1253
|
+
const R = h.current;
|
|
1254
|
+
return R.length === 0 ? !0 : R[R.length - 1] === t;
|
|
1255
|
+
}, I = () => {
|
|
1256
|
+
if (x()) {
|
|
1257
|
+
w.current = null;
|
|
1232
1258
|
return;
|
|
1233
1259
|
}
|
|
1234
|
-
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1237
|
-
},
|
|
1238
|
-
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1260
|
+
y.current = t, s("bottom");
|
|
1261
|
+
const R = _.current;
|
|
1262
|
+
R && (F.current = R.style.overflowY, R.style.overflowY = "hidden");
|
|
1263
|
+
}, V = () => {
|
|
1264
|
+
y.current === t && (y.current = null);
|
|
1265
|
+
const R = _.current;
|
|
1266
|
+
R && F.current !== null && (R.style.overflowY = F.current, F.current = null);
|
|
1241
1267
|
};
|
|
1242
|
-
function
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
touchId: h.identifier,
|
|
1268
|
+
function Y(R) {
|
|
1269
|
+
if (i && i !== "bottom" || x() || !A() || ue(R.target) || R.changedTouches.length === 0) return;
|
|
1270
|
+
const G = R.changedTouches[0], o = window.innerHeight, p = X.getIsOpen(), O = G.clientY >= o - e.edgeActivationWidthPx;
|
|
1271
|
+
p && !e.swipeToClose || !p && !e.swipeToOpen || (p || O) && (_.current = Ge(R.target), W.current = _.current?.scrollTop ?? 0, He({
|
|
1272
|
+
refs: m,
|
|
1273
|
+
clientX: G.clientX,
|
|
1274
|
+
clientY: G.clientY,
|
|
1275
|
+
touchId: G.identifier,
|
|
1251
1276
|
isMouse: !1
|
|
1252
1277
|
}));
|
|
1253
1278
|
}
|
|
1254
|
-
function
|
|
1279
|
+
function J(R) {
|
|
1255
1280
|
if (i && i !== "bottom") return;
|
|
1256
|
-
if (
|
|
1257
|
-
|
|
1281
|
+
if (x()) {
|
|
1282
|
+
w.current = null;
|
|
1258
1283
|
return;
|
|
1259
1284
|
}
|
|
1260
|
-
if (!
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
refs:
|
|
1264
|
-
callbacks:
|
|
1265
|
-
currentY:
|
|
1266
|
-
preventDefault: () =>
|
|
1267
|
-
lockPane:
|
|
1285
|
+
if (!w.current || w.current.isMouse) return;
|
|
1286
|
+
const G = w.current.activeTouchId, o = Oe(R.changedTouches, G);
|
|
1287
|
+
o && Ue({
|
|
1288
|
+
refs: m,
|
|
1289
|
+
callbacks: X,
|
|
1290
|
+
currentY: o.clientY,
|
|
1291
|
+
preventDefault: () => R.preventDefault(),
|
|
1292
|
+
lockPane: I,
|
|
1268
1293
|
options: e,
|
|
1269
|
-
scrollableAncestor:
|
|
1270
|
-
initialScrollTop:
|
|
1294
|
+
scrollableAncestor: _.current,
|
|
1295
|
+
initialScrollTop: W.current
|
|
1271
1296
|
});
|
|
1272
1297
|
}
|
|
1273
|
-
function
|
|
1274
|
-
if (i && i !== "bottom" || !
|
|
1275
|
-
const
|
|
1276
|
-
|
|
1277
|
-
refs:
|
|
1278
|
-
callbacks:
|
|
1298
|
+
function z(R) {
|
|
1299
|
+
if (i && i !== "bottom" || !w.current || w.current.isMouse) return;
|
|
1300
|
+
const G = w.current.activeTouchId;
|
|
1301
|
+
Ae(R.changedTouches, G) && Ze({
|
|
1302
|
+
refs: m,
|
|
1303
|
+
callbacks: X,
|
|
1279
1304
|
options: e,
|
|
1280
|
-
onDragEnd:
|
|
1305
|
+
onDragEnd: V
|
|
1281
1306
|
});
|
|
1282
1307
|
}
|
|
1283
|
-
function
|
|
1284
|
-
i && i !== "bottom" || !
|
|
1285
|
-
refs:
|
|
1286
|
-
dragSidebar:
|
|
1308
|
+
function H() {
|
|
1309
|
+
i && i !== "bottom" || !w.current || w.current.isMouse || (V(), ar({
|
|
1310
|
+
refs: m,
|
|
1311
|
+
dragSidebar: X.dragSidebar,
|
|
1287
1312
|
onDeactivate: () => {
|
|
1288
1313
|
}
|
|
1289
1314
|
}));
|
|
1290
1315
|
}
|
|
1291
|
-
function
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
clientY: n.clientY,
|
|
1316
|
+
function N(R) {
|
|
1317
|
+
if (i && i !== "bottom" || x() || !A() || ue(R.target) || R.button !== 0) return;
|
|
1318
|
+
const G = window.innerHeight, o = X.getIsOpen(), p = R.clientY >= G - e.edgeActivationWidthPx;
|
|
1319
|
+
o && !e.swipeToClose || !o && !e.swipeToOpen || (o || p) && (_.current = Ge(R.target), W.current = _.current?.scrollTop ?? 0, He({
|
|
1320
|
+
refs: m,
|
|
1321
|
+
clientX: R.clientX,
|
|
1322
|
+
clientY: R.clientY,
|
|
1299
1323
|
touchId: null,
|
|
1300
1324
|
isMouse: !0
|
|
1301
1325
|
}));
|
|
1302
1326
|
}
|
|
1303
|
-
function
|
|
1327
|
+
function q(R) {
|
|
1304
1328
|
if (!(i && i !== "bottom")) {
|
|
1305
|
-
if (
|
|
1306
|
-
|
|
1329
|
+
if (x()) {
|
|
1330
|
+
w.current = null;
|
|
1307
1331
|
return;
|
|
1308
1332
|
}
|
|
1309
|
-
!
|
|
1310
|
-
refs:
|
|
1311
|
-
callbacks:
|
|
1312
|
-
currentY:
|
|
1313
|
-
preventDefault: () =>
|
|
1314
|
-
lockPane:
|
|
1333
|
+
!w.current || !w.current.isMouse || Ue({
|
|
1334
|
+
refs: m,
|
|
1335
|
+
callbacks: X,
|
|
1336
|
+
currentY: R.clientY,
|
|
1337
|
+
preventDefault: () => R.preventDefault(),
|
|
1338
|
+
lockPane: I,
|
|
1315
1339
|
options: e,
|
|
1316
|
-
scrollableAncestor:
|
|
1317
|
-
initialScrollTop:
|
|
1340
|
+
scrollableAncestor: _.current,
|
|
1341
|
+
initialScrollTop: W.current
|
|
1318
1342
|
});
|
|
1319
1343
|
}
|
|
1320
1344
|
}
|
|
1321
|
-
function
|
|
1322
|
-
i && i !== "bottom" || !
|
|
1323
|
-
refs:
|
|
1324
|
-
callbacks:
|
|
1345
|
+
function oe() {
|
|
1346
|
+
i && i !== "bottom" || !w.current || !w.current.isMouse || Ze({
|
|
1347
|
+
refs: m,
|
|
1348
|
+
callbacks: X,
|
|
1325
1349
|
options: e,
|
|
1326
|
-
onDragEnd:
|
|
1350
|
+
onDragEnd: V
|
|
1327
1351
|
});
|
|
1328
1352
|
}
|
|
1329
|
-
return window.addEventListener("touchstart",
|
|
1330
|
-
window.removeEventListener("touchstart",
|
|
1353
|
+
return window.addEventListener("touchstart", Y, { passive: !0 }), window.addEventListener("touchmove", J, { passive: !1 }), window.addEventListener("touchend", z, { passive: !0 }), window.addEventListener("touchcancel", H, { passive: !0 }), window.addEventListener("mousedown", N, { passive: !0 }), window.addEventListener("mousemove", q, { passive: !1 }), window.addEventListener("mouseup", oe, { passive: !0 }), () => {
|
|
1354
|
+
window.removeEventListener("touchstart", Y), window.removeEventListener("touchmove", J), window.removeEventListener("touchend", z), window.removeEventListener("touchcancel", H), window.removeEventListener("mousedown", N), window.removeEventListener("mousemove", q), window.removeEventListener("mouseup", oe);
|
|
1331
1355
|
};
|
|
1332
1356
|
}, [
|
|
1333
1357
|
t,
|
|
1334
1358
|
r,
|
|
1335
1359
|
S,
|
|
1336
|
-
f,
|
|
1337
1360
|
c,
|
|
1338
|
-
|
|
1361
|
+
f,
|
|
1339
1362
|
u,
|
|
1363
|
+
a,
|
|
1340
1364
|
i,
|
|
1341
1365
|
s,
|
|
1342
1366
|
e,
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1367
|
+
v,
|
|
1368
|
+
y,
|
|
1369
|
+
h
|
|
1346
1370
|
]);
|
|
1347
1371
|
}
|
|
1348
|
-
function
|
|
1372
|
+
function vr({
|
|
1349
1373
|
id: e = "primary",
|
|
1350
1374
|
className: t,
|
|
1351
1375
|
children: r,
|
|
1352
1376
|
ToggleComponent: i,
|
|
1353
|
-
|
|
1377
|
+
ariaLabel: s,
|
|
1378
|
+
...n
|
|
1354
1379
|
}) {
|
|
1355
|
-
|
|
1356
|
-
if ((r == null ? void 0 : r.type) === E.Fragment)
|
|
1380
|
+
if (r?.type === T.Fragment)
|
|
1357
1381
|
throw new Error("Fragments is not allowed in SwipeBarBottom");
|
|
1358
|
-
const { bottomSidebars:
|
|
1359
|
-
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
return
|
|
1364
|
-
|
|
1365
|
-
|
|
1382
|
+
const { bottomSidebars: c, closeSidebar: f, registerBottomSidebar: u, unregisterBottomSidebar: a } = te(), v = L(null), y = L(null);
|
|
1383
|
+
Z(() => (u(e, { sidebarRef: v, toggleRef: y }), () => a(e)), [e, u, a]);
|
|
1384
|
+
const h = Pe("bottom", n, e), S = de(h.mediaQueryWidth);
|
|
1385
|
+
ur(h, e);
|
|
1386
|
+
const M = c[e]?.isOpen ?? !1, w = B(() => f("bottom", { id: e }), [f, e]);
|
|
1387
|
+
return Ie({
|
|
1388
|
+
sidebarRef: v,
|
|
1389
|
+
triggerRef: y,
|
|
1390
|
+
isOpen: M,
|
|
1391
|
+
onClose: w,
|
|
1392
|
+
transitionMs: h.transitionMs
|
|
1393
|
+
}), /* @__PURE__ */ T.jsxs(T.Fragment, { children: [
|
|
1394
|
+
h.showOverlay && /* @__PURE__ */ T.jsx(
|
|
1395
|
+
Me,
|
|
1366
1396
|
{
|
|
1367
|
-
isCollapsed: !
|
|
1397
|
+
isCollapsed: !M,
|
|
1368
1398
|
setCollapsed: () => f("bottom", { id: e }),
|
|
1369
|
-
closeSidebarOnClick:
|
|
1370
|
-
transitionMs:
|
|
1371
|
-
overlayBackgroundColor:
|
|
1372
|
-
overlayZIndex:
|
|
1399
|
+
closeSidebarOnClick: h.closeSidebarOnOverlayClick,
|
|
1400
|
+
transitionMs: h.transitionMs,
|
|
1401
|
+
overlayBackgroundColor: h.overlayBackgroundColor,
|
|
1402
|
+
overlayZIndex: h.overlayZIndex
|
|
1373
1403
|
}
|
|
1374
1404
|
),
|
|
1375
|
-
/* @__PURE__ */
|
|
1376
|
-
|
|
1405
|
+
/* @__PURE__ */ T.jsx(
|
|
1406
|
+
sr,
|
|
1377
1407
|
{
|
|
1378
1408
|
id: e,
|
|
1379
|
-
toggleRef:
|
|
1380
|
-
options:
|
|
1381
|
-
showToggle:
|
|
1409
|
+
toggleRef: y,
|
|
1410
|
+
options: h,
|
|
1411
|
+
showToggle: h.showToggle,
|
|
1382
1412
|
ToggleComponent: i
|
|
1383
1413
|
}
|
|
1384
1414
|
),
|
|
1385
|
-
/* @__PURE__ */
|
|
1415
|
+
/* @__PURE__ */ T.jsx(
|
|
1386
1416
|
"div",
|
|
1387
1417
|
{
|
|
1388
|
-
ref:
|
|
1418
|
+
ref: v,
|
|
1419
|
+
id: `swipebar-bottom-${e}`,
|
|
1420
|
+
role: "dialog",
|
|
1421
|
+
"aria-modal": M,
|
|
1422
|
+
"aria-hidden": !M,
|
|
1423
|
+
"aria-label": s ?? "Bottom sidebar",
|
|
1424
|
+
inert: !M,
|
|
1389
1425
|
style: {
|
|
1390
|
-
...Qt,
|
|
1391
1426
|
...Jt,
|
|
1392
|
-
...
|
|
1393
|
-
...
|
|
1394
|
-
|
|
1427
|
+
...Kt,
|
|
1428
|
+
...h.isAbsolute || S ? er : {},
|
|
1429
|
+
...t ? {} : { backgroundColor: Te },
|
|
1430
|
+
zIndex: h.swipeBarZIndex
|
|
1395
1431
|
},
|
|
1396
1432
|
className: t,
|
|
1397
1433
|
children: r
|
|
@@ -1399,9 +1435,9 @@ function mr({
|
|
|
1399
1435
|
)
|
|
1400
1436
|
] });
|
|
1401
1437
|
}
|
|
1402
|
-
function
|
|
1403
|
-
const { openSidebar: i, leftToggleRef: s, isLeftOpen:
|
|
1404
|
-
return t ? /* @__PURE__ */
|
|
1438
|
+
function dr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
1439
|
+
const { openSidebar: i, leftToggleRef: s, isLeftOpen: n, closeSidebar: c } = te();
|
|
1440
|
+
return t ? /* @__PURE__ */ T.jsx(
|
|
1405
1441
|
"div",
|
|
1406
1442
|
{
|
|
1407
1443
|
ref: s,
|
|
@@ -1411,19 +1447,22 @@ function cr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
|
1411
1447
|
left: 0,
|
|
1412
1448
|
zIndex: e.toggleZIndex
|
|
1413
1449
|
},
|
|
1414
|
-
children: (!
|
|
1450
|
+
children: (!n || n && !e.showOverlay) && /* @__PURE__ */ T.jsx(
|
|
1415
1451
|
"button",
|
|
1416
1452
|
{
|
|
1417
1453
|
type: "button",
|
|
1454
|
+
"aria-expanded": n,
|
|
1455
|
+
"aria-controls": "swipebar-left",
|
|
1456
|
+
"aria-label": n ? "Close left sidebar" : "Open left sidebar",
|
|
1418
1457
|
onClick: () => {
|
|
1419
|
-
e.disabled || (
|
|
1458
|
+
e.disabled || (n ? c("left") : i("left"));
|
|
1420
1459
|
},
|
|
1421
1460
|
disabled: e.disabled,
|
|
1422
1461
|
style: {
|
|
1423
1462
|
marginLeft: `${e.toggleIconEdgeDistancePx}px`,
|
|
1424
|
-
...
|
|
1463
|
+
...n ? { transform: "rotate(180deg)" } : {}
|
|
1425
1464
|
},
|
|
1426
|
-
children: r ?? /* @__PURE__ */
|
|
1465
|
+
children: r ?? /* @__PURE__ */ T.jsx(Ce, { size: e.toggleIconSizePx, color: e.toggleIconColor })
|
|
1427
1466
|
}
|
|
1428
1467
|
)
|
|
1429
1468
|
}
|
|
@@ -1435,190 +1474,205 @@ const ze = ({
|
|
|
1435
1474
|
currentX: r,
|
|
1436
1475
|
preventDefault: i,
|
|
1437
1476
|
lockPane: s,
|
|
1438
|
-
options:
|
|
1477
|
+
options: n
|
|
1439
1478
|
}) => {
|
|
1440
1479
|
if (!e.draggingRef.current) return;
|
|
1441
|
-
const
|
|
1442
|
-
if (!e.draggingRef.current.isActivated && Math.abs(
|
|
1480
|
+
const c = r - e.draggingRef.current.startX;
|
|
1481
|
+
if (!e.draggingRef.current.isActivated && Math.abs(c) >= n.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, s()), !e.draggingRef.current.isActivated) return;
|
|
1443
1482
|
e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
|
|
1444
|
-
const
|
|
1445
|
-
let
|
|
1446
|
-
if ((
|
|
1483
|
+
const f = t.getIsOpen();
|
|
1484
|
+
let u = !1;
|
|
1485
|
+
if ((f || e.draggingRef.current.startX <= n.edgeActivationWidthPx) && (u = !0), !u) {
|
|
1447
1486
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1448
1487
|
return;
|
|
1449
1488
|
}
|
|
1450
1489
|
i();
|
|
1451
|
-
const
|
|
1452
|
-
if (
|
|
1453
|
-
const
|
|
1490
|
+
const a = n.sidebarWidthPx;
|
|
1491
|
+
if (f) {
|
|
1492
|
+
const v = Math.min(
|
|
1454
1493
|
0,
|
|
1455
|
-
Math.max(-
|
|
1494
|
+
Math.max(-a, c + n.dragActivationDeltaPx)
|
|
1456
1495
|
);
|
|
1457
|
-
t.dragSidebar(
|
|
1458
|
-
} else if (e.draggingRef.current.startX <=
|
|
1459
|
-
const
|
|
1496
|
+
t.dragSidebar(v);
|
|
1497
|
+
} else if (e.draggingRef.current.startX <= n.edgeActivationWidthPx) {
|
|
1498
|
+
const v = Math.min(
|
|
1460
1499
|
0,
|
|
1461
1500
|
Math.max(
|
|
1462
|
-
-
|
|
1463
|
-
-
|
|
1501
|
+
-a,
|
|
1502
|
+
-a + c - n.dragActivationDeltaPx
|
|
1464
1503
|
)
|
|
1465
1504
|
);
|
|
1466
|
-
t.dragSidebar(
|
|
1505
|
+
t.dragSidebar(v);
|
|
1467
1506
|
}
|
|
1468
|
-
},
|
|
1507
|
+
}, qe = ({ refs: e, callbacks: t, options: r }) => {
|
|
1469
1508
|
if (!e.draggingRef.current) return;
|
|
1470
1509
|
if (!e.draggingRef.current.isActivated) {
|
|
1471
1510
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1472
1511
|
return;
|
|
1473
1512
|
}
|
|
1474
|
-
const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX,
|
|
1513
|
+
const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX, n = e.draggingRef.current.startX, c = t.getIsOpen();
|
|
1475
1514
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1515
|
+
const f = i >= s, u = i < s, a = n <= r.edgeActivationWidthPx;
|
|
1516
|
+
c ? (u ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : a && f ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1478
1517
|
};
|
|
1479
|
-
function
|
|
1480
|
-
const t =
|
|
1518
|
+
function fr(e) {
|
|
1519
|
+
const t = de(e.mediaQueryWidth), {
|
|
1481
1520
|
lockedSidebar: r,
|
|
1482
1521
|
setLockedSidebar: i,
|
|
1483
1522
|
isLeftOpen: s,
|
|
1484
|
-
openSidebar:
|
|
1485
|
-
closeSidebar:
|
|
1486
|
-
dragSidebar:
|
|
1487
|
-
leftSidebarRef:
|
|
1488
|
-
} =
|
|
1489
|
-
|
|
1523
|
+
openSidebar: n,
|
|
1524
|
+
closeSidebar: c,
|
|
1525
|
+
dragSidebar: f,
|
|
1526
|
+
leftSidebarRef: u
|
|
1527
|
+
} = te(), a = L(null), v = L(null), y = L(null);
|
|
1528
|
+
Z(() => {
|
|
1490
1529
|
if (!t || r && r !== "left" || e.disabled) return;
|
|
1491
|
-
const
|
|
1530
|
+
const h = {
|
|
1492
1531
|
getIsOpen: () => s,
|
|
1493
|
-
openSidebar: () =>
|
|
1494
|
-
closeSidebar: () =>
|
|
1495
|
-
dragSidebar: (
|
|
1532
|
+
openSidebar: () => n("left"),
|
|
1533
|
+
closeSidebar: () => c("left"),
|
|
1534
|
+
dragSidebar: (m) => f("left", m)
|
|
1496
1535
|
}, S = {
|
|
1497
|
-
draggingRef:
|
|
1498
|
-
currentXRef:
|
|
1499
|
-
prevXRef:
|
|
1500
|
-
},
|
|
1501
|
-
function
|
|
1502
|
-
if (r && r !== "left" ||
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1536
|
+
draggingRef: a,
|
|
1537
|
+
currentXRef: v,
|
|
1538
|
+
prevXRef: y
|
|
1539
|
+
}, M = () => i("left"), w = () => i(null);
|
|
1540
|
+
function C(m) {
|
|
1541
|
+
if (r && r !== "left" || ue(m.target) || m.changedTouches.length === 0) return;
|
|
1542
|
+
const x = m.changedTouches[0], A = h.getIsOpen(), I = x.clientX <= e.edgeActivationWidthPx;
|
|
1543
|
+
A && !e.swipeToClose || !A && !e.swipeToOpen || (A || I) && we({
|
|
1505
1544
|
refs: S,
|
|
1506
|
-
clientX:
|
|
1507
|
-
clientY:
|
|
1508
|
-
touchId:
|
|
1545
|
+
clientX: x.clientX,
|
|
1546
|
+
clientY: x.clientY,
|
|
1547
|
+
touchId: x.identifier,
|
|
1509
1548
|
isMouse: !1
|
|
1510
1549
|
});
|
|
1511
1550
|
}
|
|
1512
|
-
function
|
|
1513
|
-
if (r && r !== "left" || !
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1551
|
+
function D(m) {
|
|
1552
|
+
if (r && r !== "left" || !a.current || a.current.isMouse) return;
|
|
1553
|
+
const x = a.current.activeTouchId, A = Oe(m.changedTouches, x);
|
|
1554
|
+
A && ze({
|
|
1516
1555
|
refs: S,
|
|
1517
|
-
callbacks:
|
|
1518
|
-
currentX:
|
|
1519
|
-
preventDefault: () =>
|
|
1520
|
-
lockPane:
|
|
1556
|
+
callbacks: h,
|
|
1557
|
+
currentX: A.clientX,
|
|
1558
|
+
preventDefault: () => m.preventDefault(),
|
|
1559
|
+
lockPane: M,
|
|
1521
1560
|
options: e
|
|
1522
1561
|
});
|
|
1523
1562
|
}
|
|
1524
|
-
function
|
|
1525
|
-
if (r && r !== "left" || !
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1563
|
+
function _(m) {
|
|
1564
|
+
if (r && r !== "left" || !a.current || a.current.isMouse) return;
|
|
1565
|
+
const x = a.current.activeTouchId;
|
|
1566
|
+
Ae(m.changedTouches, x) && qe({
|
|
1528
1567
|
refs: S,
|
|
1529
|
-
callbacks:
|
|
1568
|
+
callbacks: h,
|
|
1530
1569
|
options: e
|
|
1531
1570
|
});
|
|
1532
1571
|
}
|
|
1533
|
-
function
|
|
1534
|
-
r && r !== "left" || !
|
|
1572
|
+
function W() {
|
|
1573
|
+
r && r !== "left" || !a.current || a.current.isMouse || nt({
|
|
1535
1574
|
refs: S,
|
|
1536
|
-
dragSidebar:
|
|
1537
|
-
onDeactivate:
|
|
1575
|
+
dragSidebar: h.dragSidebar,
|
|
1576
|
+
onDeactivate: w
|
|
1538
1577
|
});
|
|
1539
1578
|
}
|
|
1540
|
-
function
|
|
1541
|
-
if (r && r !== "left" ||
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1579
|
+
function F(m) {
|
|
1580
|
+
if (r && r !== "left" || ue(m.target) || m.button !== 0) return;
|
|
1581
|
+
const x = h.getIsOpen(), A = m.clientX <= e.edgeActivationWidthPx;
|
|
1582
|
+
x && !e.swipeToClose || !x && !e.swipeToOpen || (x || A) && we({
|
|
1544
1583
|
refs: S,
|
|
1545
|
-
clientX:
|
|
1546
|
-
clientY:
|
|
1584
|
+
clientX: m.clientX,
|
|
1585
|
+
clientY: m.clientY,
|
|
1547
1586
|
touchId: null,
|
|
1548
1587
|
isMouse: !0
|
|
1549
1588
|
});
|
|
1550
1589
|
}
|
|
1551
|
-
function
|
|
1552
|
-
r && r !== "left" || !
|
|
1590
|
+
function j(m) {
|
|
1591
|
+
r && r !== "left" || !a.current || !a.current.isMouse || ze({
|
|
1553
1592
|
refs: S,
|
|
1554
|
-
callbacks:
|
|
1555
|
-
currentX:
|
|
1556
|
-
preventDefault: () =>
|
|
1557
|
-
lockPane:
|
|
1593
|
+
callbacks: h,
|
|
1594
|
+
currentX: m.clientX,
|
|
1595
|
+
preventDefault: () => m.preventDefault(),
|
|
1596
|
+
lockPane: M,
|
|
1558
1597
|
options: e
|
|
1559
1598
|
});
|
|
1560
1599
|
}
|
|
1561
|
-
function
|
|
1562
|
-
r && r !== "left" || !
|
|
1600
|
+
function X() {
|
|
1601
|
+
r && r !== "left" || !a.current || !a.current.isMouse || qe({
|
|
1563
1602
|
refs: S,
|
|
1564
|
-
callbacks:
|
|
1603
|
+
callbacks: h,
|
|
1565
1604
|
options: e
|
|
1566
1605
|
});
|
|
1567
1606
|
}
|
|
1568
|
-
return window.addEventListener("touchstart",
|
|
1569
|
-
window.removeEventListener("touchstart",
|
|
1607
|
+
return window.addEventListener("touchstart", C, { passive: !0 }), window.addEventListener("touchmove", D, { passive: !1 }), window.addEventListener("touchend", _, { passive: !0 }), window.addEventListener("touchcancel", W, { passive: !0 }), window.addEventListener("mousedown", F, { passive: !0 }), window.addEventListener("mousemove", j, { passive: !1 }), window.addEventListener("mouseup", X, { passive: !0 }), () => {
|
|
1608
|
+
window.removeEventListener("touchstart", C), window.removeEventListener("touchmove", D), window.removeEventListener("touchend", _), window.removeEventListener("touchcancel", W), window.removeEventListener("mousedown", F), window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", X);
|
|
1570
1609
|
};
|
|
1571
1610
|
}, [
|
|
1572
1611
|
t,
|
|
1573
1612
|
s,
|
|
1574
|
-
|
|
1575
|
-
f,
|
|
1613
|
+
n,
|
|
1576
1614
|
c,
|
|
1615
|
+
f,
|
|
1577
1616
|
r,
|
|
1578
1617
|
i,
|
|
1579
|
-
|
|
1618
|
+
u,
|
|
1580
1619
|
e
|
|
1581
1620
|
]);
|
|
1582
1621
|
}
|
|
1583
|
-
function
|
|
1622
|
+
function wr({
|
|
1584
1623
|
className: e,
|
|
1585
1624
|
children: t,
|
|
1586
1625
|
ToggleComponent: r,
|
|
1587
|
-
|
|
1626
|
+
ariaLabel: i,
|
|
1627
|
+
...s
|
|
1588
1628
|
}) {
|
|
1589
|
-
if (
|
|
1629
|
+
if (t?.type === T.Fragment)
|
|
1590
1630
|
throw new Error("Fragments is not allowed in SwipeBarLeft");
|
|
1591
|
-
const { isLeftOpen:
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1631
|
+
const { isLeftOpen: n, closeSidebar: c, leftSidebarRef: f, leftToggleRef: u } = te(), a = Pe("left", s), v = de(a.mediaQueryWidth);
|
|
1632
|
+
fr(a);
|
|
1633
|
+
const y = B(() => c("left"), [c]);
|
|
1634
|
+
return Ie({
|
|
1635
|
+
sidebarRef: f,
|
|
1636
|
+
triggerRef: u,
|
|
1637
|
+
isOpen: n,
|
|
1638
|
+
onClose: y,
|
|
1639
|
+
transitionMs: a.transitionMs
|
|
1640
|
+
}), /* @__PURE__ */ T.jsxs(T.Fragment, { children: [
|
|
1641
|
+
a.showOverlay && /* @__PURE__ */ T.jsx(
|
|
1642
|
+
Me,
|
|
1595
1643
|
{
|
|
1596
|
-
isCollapsed: !
|
|
1597
|
-
setCollapsed: () =>
|
|
1598
|
-
closeSidebarOnClick:
|
|
1599
|
-
transitionMs:
|
|
1600
|
-
overlayBackgroundColor:
|
|
1601
|
-
overlayZIndex:
|
|
1644
|
+
isCollapsed: !n,
|
|
1645
|
+
setCollapsed: () => c("left"),
|
|
1646
|
+
closeSidebarOnClick: a.closeSidebarOnOverlayClick,
|
|
1647
|
+
transitionMs: a.transitionMs,
|
|
1648
|
+
overlayBackgroundColor: a.overlayBackgroundColor,
|
|
1649
|
+
overlayZIndex: a.overlayZIndex
|
|
1602
1650
|
}
|
|
1603
1651
|
),
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
|
|
1652
|
+
/* @__PURE__ */ T.jsx(
|
|
1653
|
+
dr,
|
|
1606
1654
|
{
|
|
1607
|
-
options:
|
|
1608
|
-
showToggle:
|
|
1655
|
+
options: a,
|
|
1656
|
+
showToggle: a.showToggle,
|
|
1609
1657
|
ToggleComponent: r
|
|
1610
1658
|
}
|
|
1611
1659
|
),
|
|
1612
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ T.jsx(
|
|
1613
1661
|
"div",
|
|
1614
1662
|
{
|
|
1615
1663
|
ref: f,
|
|
1664
|
+
id: "swipebar-left",
|
|
1665
|
+
role: "dialog",
|
|
1666
|
+
"aria-modal": n,
|
|
1667
|
+
"aria-hidden": !n,
|
|
1668
|
+
"aria-label": i ?? "Left sidebar",
|
|
1669
|
+
inert: !n,
|
|
1616
1670
|
style: {
|
|
1617
1671
|
...tt,
|
|
1618
|
-
...
|
|
1619
|
-
...
|
|
1620
|
-
...e ? {} : { backgroundColor:
|
|
1621
|
-
zIndex:
|
|
1672
|
+
...zt,
|
|
1673
|
+
...a.isAbsolute || v ? Vt : {},
|
|
1674
|
+
...e ? {} : { backgroundColor: Te },
|
|
1675
|
+
zIndex: a.swipeBarZIndex
|
|
1622
1676
|
},
|
|
1623
1677
|
className: e,
|
|
1624
1678
|
children: t
|
|
@@ -1626,11 +1680,11 @@ function vr({
|
|
|
1626
1680
|
)
|
|
1627
1681
|
] });
|
|
1628
1682
|
}
|
|
1629
|
-
function
|
|
1630
|
-
const { openSidebar: i, rightToggleRef: s, isRightOpen:
|
|
1683
|
+
function gr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
1684
|
+
const { openSidebar: i, rightToggleRef: s, isRightOpen: n, closeSidebar: c } = te();
|
|
1631
1685
|
return t ? (
|
|
1632
1686
|
// 1px wide container
|
|
1633
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ T.jsx(
|
|
1634
1688
|
"div",
|
|
1635
1689
|
{
|
|
1636
1690
|
ref: s,
|
|
@@ -1640,58 +1694,61 @@ function ur({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
|
1640
1694
|
right: 0,
|
|
1641
1695
|
zIndex: e.toggleZIndex
|
|
1642
1696
|
},
|
|
1643
|
-
children: (!
|
|
1697
|
+
children: (!n || n && !e.showOverlay) && /* @__PURE__ */ T.jsx(
|
|
1644
1698
|
"button",
|
|
1645
1699
|
{
|
|
1646
1700
|
type: "button",
|
|
1701
|
+
"aria-expanded": n,
|
|
1702
|
+
"aria-controls": "swipebar-right",
|
|
1703
|
+
"aria-label": n ? "Close right sidebar" : "Open right sidebar",
|
|
1647
1704
|
onClick: () => {
|
|
1648
|
-
e.disabled || (
|
|
1705
|
+
e.disabled || (n ? c("right") : i("right"));
|
|
1649
1706
|
},
|
|
1650
1707
|
disabled: e.disabled,
|
|
1651
1708
|
style: {
|
|
1652
1709
|
marginRight: `${e.toggleIconEdgeDistancePx}px`,
|
|
1653
1710
|
// reverse because we are using the same icon for both left and right
|
|
1654
|
-
...
|
|
1711
|
+
...n ? {} : { transform: "rotate(180deg)" }
|
|
1655
1712
|
},
|
|
1656
|
-
children: r ?? /* @__PURE__ */
|
|
1713
|
+
children: r ?? /* @__PURE__ */ T.jsx(Ce, { size: e.toggleIconSizePx, color: e.toggleIconColor })
|
|
1657
1714
|
}
|
|
1658
1715
|
)
|
|
1659
1716
|
}
|
|
1660
1717
|
)
|
|
1661
1718
|
) : null;
|
|
1662
1719
|
}
|
|
1663
|
-
const
|
|
1720
|
+
const Ve = ({
|
|
1664
1721
|
refs: e,
|
|
1665
1722
|
callbacks: t,
|
|
1666
1723
|
currentX: r,
|
|
1667
1724
|
preventDefault: i,
|
|
1668
1725
|
lockPane: s,
|
|
1669
|
-
options:
|
|
1726
|
+
options: n
|
|
1670
1727
|
}) => {
|
|
1671
1728
|
if (!e.draggingRef.current) return;
|
|
1672
|
-
const
|
|
1673
|
-
if (!
|
|
1729
|
+
const c = window.innerWidth, f = r - e.draggingRef.current.startX, u = e.draggingRef.current.startX >= c - n.edgeActivationWidthPx, a = e.draggingRef.current.isActivated;
|
|
1730
|
+
if (!a && Math.abs(f) >= n.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, s()), !a) return;
|
|
1674
1731
|
e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
|
|
1675
|
-
const
|
|
1676
|
-
let
|
|
1677
|
-
if ((
|
|
1732
|
+
const v = t.getIsOpen();
|
|
1733
|
+
let y = !1;
|
|
1734
|
+
if ((v || u) && (y = !0), !y) {
|
|
1678
1735
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1679
1736
|
return;
|
|
1680
1737
|
}
|
|
1681
1738
|
i();
|
|
1682
|
-
const
|
|
1683
|
-
if (
|
|
1739
|
+
const h = n.sidebarWidthPx;
|
|
1740
|
+
if (v) {
|
|
1684
1741
|
const S = Math.max(
|
|
1685
1742
|
0,
|
|
1686
|
-
Math.min(
|
|
1743
|
+
Math.min(h, f - n.dragActivationDeltaPx)
|
|
1687
1744
|
);
|
|
1688
1745
|
t.dragSidebar(S);
|
|
1689
1746
|
} else {
|
|
1690
1747
|
const S = Math.max(
|
|
1691
1748
|
0,
|
|
1692
1749
|
Math.min(
|
|
1693
|
-
|
|
1694
|
-
|
|
1750
|
+
h,
|
|
1751
|
+
h + f + n.dragActivationDeltaPx
|
|
1695
1752
|
)
|
|
1696
1753
|
);
|
|
1697
1754
|
t.dragSidebar(S);
|
|
@@ -1702,154 +1759,169 @@ const qe = ({
|
|
|
1702
1759
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1703
1760
|
return;
|
|
1704
1761
|
}
|
|
1705
|
-
const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX,
|
|
1762
|
+
const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX, n = e.draggingRef.current.startX, c = t.getIsOpen(), f = window.innerWidth;
|
|
1706
1763
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1707
|
-
const
|
|
1708
|
-
|
|
1764
|
+
const u = i > s, a = i < s, v = n >= f - r.edgeActivationWidthPx;
|
|
1765
|
+
c ? (u ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : v && a ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1709
1766
|
};
|
|
1710
|
-
function
|
|
1711
|
-
const t =
|
|
1767
|
+
function hr(e) {
|
|
1768
|
+
const t = de(e.mediaQueryWidth), {
|
|
1712
1769
|
lockedSidebar: r,
|
|
1713
1770
|
setLockedSidebar: i,
|
|
1714
1771
|
isRightOpen: s,
|
|
1715
|
-
openSidebar:
|
|
1716
|
-
closeSidebar:
|
|
1717
|
-
dragSidebar:
|
|
1718
|
-
rightSidebarRef:
|
|
1719
|
-
} =
|
|
1720
|
-
|
|
1772
|
+
openSidebar: n,
|
|
1773
|
+
closeSidebar: c,
|
|
1774
|
+
dragSidebar: f,
|
|
1775
|
+
rightSidebarRef: u
|
|
1776
|
+
} = te(), a = L(null), v = L(null), y = L(null);
|
|
1777
|
+
Z(() => {
|
|
1721
1778
|
if (!t || r && r !== "right" || e.disabled) return;
|
|
1722
|
-
const
|
|
1779
|
+
const h = {
|
|
1723
1780
|
getIsOpen: () => s,
|
|
1724
|
-
openSidebar: () =>
|
|
1725
|
-
closeSidebar: () =>
|
|
1726
|
-
dragSidebar: (
|
|
1781
|
+
openSidebar: () => n("right"),
|
|
1782
|
+
closeSidebar: () => c("right"),
|
|
1783
|
+
dragSidebar: (m) => f("right", m)
|
|
1727
1784
|
}, S = {
|
|
1728
|
-
draggingRef:
|
|
1729
|
-
currentXRef:
|
|
1730
|
-
prevXRef:
|
|
1731
|
-
},
|
|
1732
|
-
function
|
|
1733
|
-
if (r && r !== "right" ||
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1785
|
+
draggingRef: a,
|
|
1786
|
+
currentXRef: v,
|
|
1787
|
+
prevXRef: y
|
|
1788
|
+
}, M = () => i("right"), w = () => i(null);
|
|
1789
|
+
function C(m) {
|
|
1790
|
+
if (r && r !== "right" || ue(m.target) || m.changedTouches.length === 0) return;
|
|
1791
|
+
const x = m.changedTouches[0], A = window.innerWidth, I = h.getIsOpen(), V = x.clientX >= A - e.edgeActivationWidthPx;
|
|
1792
|
+
I && !e.swipeToClose || !I && !e.swipeToOpen || (I || V) && we({
|
|
1736
1793
|
refs: S,
|
|
1737
|
-
clientX:
|
|
1738
|
-
clientY:
|
|
1739
|
-
touchId:
|
|
1794
|
+
clientX: x.clientX,
|
|
1795
|
+
clientY: x.clientY,
|
|
1796
|
+
touchId: x.identifier,
|
|
1740
1797
|
isMouse: !1
|
|
1741
1798
|
});
|
|
1742
1799
|
}
|
|
1743
|
-
function
|
|
1744
|
-
if (r && r !== "right" || !
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1800
|
+
function D(m) {
|
|
1801
|
+
if (r && r !== "right" || !a.current || a.current.isMouse) return;
|
|
1802
|
+
const x = a.current.activeTouchId, A = Oe(m.changedTouches, x);
|
|
1803
|
+
A && Ve({
|
|
1747
1804
|
refs: S,
|
|
1748
|
-
callbacks:
|
|
1749
|
-
currentX:
|
|
1750
|
-
preventDefault: () =>
|
|
1751
|
-
lockPane:
|
|
1805
|
+
callbacks: h,
|
|
1806
|
+
currentX: A.clientX,
|
|
1807
|
+
preventDefault: () => m.preventDefault(),
|
|
1808
|
+
lockPane: M,
|
|
1752
1809
|
options: e
|
|
1753
1810
|
});
|
|
1754
1811
|
}
|
|
1755
|
-
function
|
|
1756
|
-
if (r && r !== "right" || !
|
|
1757
|
-
const
|
|
1758
|
-
|
|
1812
|
+
function _(m) {
|
|
1813
|
+
if (r && r !== "right" || !a.current || a.current.isMouse) return;
|
|
1814
|
+
const x = a.current.activeTouchId;
|
|
1815
|
+
Ae(m.changedTouches, x) && Qe({
|
|
1759
1816
|
refs: S,
|
|
1760
|
-
callbacks:
|
|
1817
|
+
callbacks: h,
|
|
1761
1818
|
options: e
|
|
1762
1819
|
});
|
|
1763
1820
|
}
|
|
1764
|
-
function
|
|
1765
|
-
r && r !== "right" || !
|
|
1821
|
+
function W() {
|
|
1822
|
+
r && r !== "right" || !a.current || a.current.isMouse || nt({
|
|
1766
1823
|
refs: S,
|
|
1767
|
-
dragSidebar:
|
|
1768
|
-
onDeactivate:
|
|
1824
|
+
dragSidebar: h.dragSidebar,
|
|
1825
|
+
onDeactivate: w
|
|
1769
1826
|
});
|
|
1770
1827
|
}
|
|
1771
|
-
function
|
|
1772
|
-
if (r && r !== "right" ||
|
|
1773
|
-
const
|
|
1774
|
-
|
|
1828
|
+
function F(m) {
|
|
1829
|
+
if (r && r !== "right" || ue(m.target) || m.button !== 0) return;
|
|
1830
|
+
const x = window.innerWidth, A = h.getIsOpen(), I = m.clientX >= x - e.edgeActivationWidthPx;
|
|
1831
|
+
A && !e.swipeToClose || !A && !e.swipeToOpen || (A || I) && we({
|
|
1775
1832
|
refs: S,
|
|
1776
|
-
clientX:
|
|
1777
|
-
clientY:
|
|
1833
|
+
clientX: m.clientX,
|
|
1834
|
+
clientY: m.clientY,
|
|
1778
1835
|
touchId: null,
|
|
1779
1836
|
isMouse: !0
|
|
1780
1837
|
});
|
|
1781
1838
|
}
|
|
1782
|
-
function
|
|
1783
|
-
r && r !== "right" || !
|
|
1839
|
+
function j(m) {
|
|
1840
|
+
r && r !== "right" || !a.current || !a.current.isMouse || Ve({
|
|
1784
1841
|
refs: S,
|
|
1785
|
-
callbacks:
|
|
1786
|
-
currentX:
|
|
1787
|
-
preventDefault: () =>
|
|
1788
|
-
lockPane:
|
|
1842
|
+
callbacks: h,
|
|
1843
|
+
currentX: m.clientX,
|
|
1844
|
+
preventDefault: () => m.preventDefault(),
|
|
1845
|
+
lockPane: M,
|
|
1789
1846
|
options: e
|
|
1790
1847
|
});
|
|
1791
1848
|
}
|
|
1792
|
-
function
|
|
1793
|
-
r && r !== "right" || !
|
|
1849
|
+
function X() {
|
|
1850
|
+
r && r !== "right" || !a.current || !a.current.isMouse || Qe({
|
|
1794
1851
|
refs: S,
|
|
1795
|
-
callbacks:
|
|
1852
|
+
callbacks: h,
|
|
1796
1853
|
options: e
|
|
1797
1854
|
});
|
|
1798
1855
|
}
|
|
1799
|
-
return window.addEventListener("touchstart",
|
|
1800
|
-
window.removeEventListener("touchstart",
|
|
1856
|
+
return window.addEventListener("touchstart", C, { passive: !0 }), window.addEventListener("touchmove", D, { passive: !1 }), window.addEventListener("touchend", _, { passive: !0 }), window.addEventListener("touchcancel", W, { passive: !0 }), window.addEventListener("mousedown", F, { passive: !0 }), window.addEventListener("mousemove", j, { passive: !1 }), window.addEventListener("mouseup", X, { passive: !0 }), () => {
|
|
1857
|
+
window.removeEventListener("touchstart", C), window.removeEventListener("touchmove", D), window.removeEventListener("touchend", _), window.removeEventListener("touchcancel", W), window.removeEventListener("mousedown", F), window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", X);
|
|
1801
1858
|
};
|
|
1802
1859
|
}, [
|
|
1803
1860
|
t,
|
|
1804
1861
|
s,
|
|
1805
|
-
|
|
1806
|
-
f,
|
|
1862
|
+
n,
|
|
1807
1863
|
c,
|
|
1864
|
+
f,
|
|
1808
1865
|
r,
|
|
1809
1866
|
i,
|
|
1810
|
-
|
|
1867
|
+
u,
|
|
1811
1868
|
e
|
|
1812
1869
|
]);
|
|
1813
1870
|
}
|
|
1814
|
-
function
|
|
1871
|
+
function Sr({
|
|
1815
1872
|
className: e,
|
|
1816
1873
|
children: t,
|
|
1817
1874
|
ToggleComponent: r,
|
|
1818
|
-
|
|
1875
|
+
ariaLabel: i,
|
|
1876
|
+
...s
|
|
1819
1877
|
}) {
|
|
1820
|
-
if (
|
|
1878
|
+
if (t?.type === T.Fragment)
|
|
1821
1879
|
throw new Error("Fragments is not allowed in SwipeBarRight");
|
|
1822
|
-
const { isRightOpen:
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1880
|
+
const { isRightOpen: n, closeSidebar: c, rightSidebarRef: f, rightToggleRef: u } = te(), a = Pe("right", s), v = de(a.mediaQueryWidth);
|
|
1881
|
+
hr(a);
|
|
1882
|
+
const y = B(() => c("right"), [c]);
|
|
1883
|
+
return Ie({
|
|
1884
|
+
sidebarRef: f,
|
|
1885
|
+
triggerRef: u,
|
|
1886
|
+
isOpen: n,
|
|
1887
|
+
onClose: y,
|
|
1888
|
+
transitionMs: a.transitionMs
|
|
1889
|
+
}), /* @__PURE__ */ T.jsxs(T.Fragment, { children: [
|
|
1890
|
+
a.showOverlay && /* @__PURE__ */ T.jsx(
|
|
1891
|
+
Me,
|
|
1826
1892
|
{
|
|
1827
|
-
isCollapsed: !
|
|
1828
|
-
setCollapsed: () =>
|
|
1829
|
-
closeSidebarOnClick:
|
|
1830
|
-
transitionMs:
|
|
1831
|
-
overlayBackgroundColor:
|
|
1832
|
-
overlayZIndex:
|
|
1893
|
+
isCollapsed: !n,
|
|
1894
|
+
setCollapsed: () => c("right"),
|
|
1895
|
+
closeSidebarOnClick: a.closeSidebarOnOverlayClick,
|
|
1896
|
+
transitionMs: a.transitionMs,
|
|
1897
|
+
overlayBackgroundColor: a.overlayBackgroundColor,
|
|
1898
|
+
overlayZIndex: a.overlayZIndex
|
|
1833
1899
|
}
|
|
1834
1900
|
),
|
|
1835
|
-
/* @__PURE__ */
|
|
1836
|
-
|
|
1901
|
+
/* @__PURE__ */ T.jsx(
|
|
1902
|
+
gr,
|
|
1837
1903
|
{
|
|
1838
|
-
options:
|
|
1839
|
-
showToggle:
|
|
1904
|
+
options: a,
|
|
1905
|
+
showToggle: a.showToggle,
|
|
1840
1906
|
ToggleComponent: r
|
|
1841
1907
|
}
|
|
1842
1908
|
),
|
|
1843
|
-
/* @__PURE__ */
|
|
1909
|
+
/* @__PURE__ */ T.jsx(
|
|
1844
1910
|
"div",
|
|
1845
1911
|
{
|
|
1846
1912
|
ref: f,
|
|
1913
|
+
id: "swipebar-right",
|
|
1914
|
+
role: "dialog",
|
|
1915
|
+
"aria-modal": n,
|
|
1916
|
+
"aria-hidden": !n,
|
|
1917
|
+
"aria-label": i ?? "Right sidebar",
|
|
1918
|
+
inert: !n,
|
|
1847
1919
|
style: {
|
|
1848
1920
|
...tt,
|
|
1849
|
-
...
|
|
1850
|
-
...
|
|
1851
|
-
...e ? {} : { backgroundColor:
|
|
1852
|
-
zIndex:
|
|
1921
|
+
...qt,
|
|
1922
|
+
...a.isAbsolute || v ? Qt : {},
|
|
1923
|
+
...e ? {} : { backgroundColor: Te },
|
|
1924
|
+
zIndex: a.swipeBarZIndex
|
|
1853
1925
|
},
|
|
1854
1926
|
className: e,
|
|
1855
1927
|
children: t
|
|
@@ -1858,14 +1930,14 @@ function br({
|
|
|
1858
1930
|
] });
|
|
1859
1931
|
}
|
|
1860
1932
|
export {
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1933
|
+
Me as Overlay,
|
|
1934
|
+
vr as SwipeBarBottom,
|
|
1935
|
+
wr as SwipeBarLeft,
|
|
1936
|
+
pr as SwipeBarProvider,
|
|
1937
|
+
Sr as SwipeBarRight,
|
|
1938
|
+
sr as ToggleBottom,
|
|
1939
|
+
dr as ToggleLeft,
|
|
1940
|
+
gr as ToggleRight,
|
|
1941
|
+
de as useMediaQuery,
|
|
1942
|
+
te as useSwipeBarContext
|
|
1871
1943
|
};
|