@sps-woodland/buttons 8.4.1 → 8.4.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/lib/button/Button.d.ts +17 -1
- package/lib/index.cjs.js +23 -23
- package/lib/index.es.js +632 -773
- package/package.json +15 -5
package/lib/index.es.js
CHANGED
@@ -1,68 +1,69 @@
|
|
1
|
-
import * as
|
2
|
-
import
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
1
|
+
import * as c from "react";
|
2
|
+
import Ne, { useRef as re, useCallback as Q, useEffect as ee, useState as Oe, useMemo as De, useContext as je } from "react";
|
3
|
+
import { Metadata as Ye, I18nContext as ze, Spinner as Xe, cl as qe, Icon as Je } from "@sps-woodland/core";
|
4
|
+
import { useFocusable as Qe, FocusRing as Ze } from "@react-aria/focus";
|
5
|
+
import { code as y } from "@spscommerce/utils";
|
6
|
+
function Le(e) {
|
7
|
+
var t, r, o = "";
|
7
8
|
if (typeof e == "string" || typeof e == "number")
|
8
|
-
|
9
|
+
o += e;
|
9
10
|
else if (typeof e == "object")
|
10
11
|
if (Array.isArray(e)) {
|
11
|
-
var
|
12
|
-
for (t = 0; t <
|
13
|
-
e[t] && (
|
12
|
+
var i = e.length;
|
13
|
+
for (t = 0; t < i; t++)
|
14
|
+
e[t] && (r = Le(e[t])) && (o && (o += " "), o += r);
|
14
15
|
} else
|
15
|
-
for (
|
16
|
-
e[
|
17
|
-
return
|
16
|
+
for (r in e)
|
17
|
+
e[r] && (o && (o += " "), o += r);
|
18
|
+
return o;
|
18
19
|
}
|
19
20
|
function et() {
|
20
|
-
for (var e, t,
|
21
|
-
(e = arguments[
|
22
|
-
return
|
21
|
+
for (var e, t, r = 0, o = "", i = arguments.length; r < i; r++)
|
22
|
+
(e = arguments[r]) && (t = Le(e)) && (o && (o += " "), o += t);
|
23
|
+
return o;
|
23
24
|
}
|
24
|
-
const
|
25
|
+
const Ce = typeof document < "u" ? Ne.useLayoutEffect : () => {
|
25
26
|
};
|
26
|
-
function
|
27
|
-
const t =
|
28
|
-
return
|
27
|
+
function R(e) {
|
28
|
+
const t = re(null);
|
29
|
+
return Ce(() => {
|
29
30
|
t.current = e;
|
30
31
|
}, [
|
31
32
|
e
|
32
|
-
]),
|
33
|
-
const
|
34
|
-
return
|
33
|
+
]), Q((...r) => {
|
34
|
+
const o = t.current;
|
35
|
+
return o == null ? void 0 : o(...r);
|
35
36
|
}, []);
|
36
37
|
}
|
37
38
|
let ye = /* @__PURE__ */ new Map();
|
38
39
|
function tt(e, t) {
|
39
40
|
if (e === t)
|
40
41
|
return e;
|
41
|
-
let
|
42
|
-
if (
|
43
|
-
return
|
44
|
-
let
|
45
|
-
return
|
42
|
+
let r = ye.get(e);
|
43
|
+
if (r)
|
44
|
+
return r(t), t;
|
45
|
+
let o = ye.get(t);
|
46
|
+
return o ? (o(e), e) : t;
|
46
47
|
}
|
47
|
-
function
|
48
|
+
function _e(...e) {
|
48
49
|
return (...t) => {
|
49
|
-
for (let
|
50
|
-
typeof
|
50
|
+
for (let r of e)
|
51
|
+
typeof r == "function" && r(...t);
|
51
52
|
};
|
52
53
|
}
|
53
|
-
const
|
54
|
+
const D = (e) => {
|
54
55
|
var t;
|
55
56
|
return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
|
56
|
-
},
|
57
|
-
function
|
57
|
+
}, H = (e) => e && "window" in e && e.window === e ? e : D(e).defaultView || window;
|
58
|
+
function W(...e) {
|
58
59
|
let t = {
|
59
60
|
...e[0]
|
60
61
|
};
|
61
|
-
for (let
|
62
|
-
let
|
63
|
-
for (let
|
64
|
-
let
|
65
|
-
typeof
|
62
|
+
for (let r = 1; r < e.length; r++) {
|
63
|
+
let o = e[r];
|
64
|
+
for (let i in o) {
|
65
|
+
let d = t[i], u = o[i];
|
66
|
+
typeof d == "function" && typeof u == "function" && i[0] === "o" && i[1] === "n" && i.charCodeAt(2) >= 65 && i.charCodeAt(2) <= 90 ? t[i] = _e(d, u) : (i === "className" || i === "UNSAFE_className") && typeof d == "string" && typeof u == "string" ? t[i] = et(d, u) : i === "id" && d && u ? t.id = tt(d, u) : t[i] = u !== void 0 ? u : d;
|
66
67
|
}
|
67
68
|
}
|
68
69
|
return t;
|
@@ -82,14 +83,14 @@ const nt = /* @__PURE__ */ new Set([
|
|
82
83
|
"ping",
|
83
84
|
"referrerPolicy"
|
84
85
|
]), st = /^(data-.*)$/;
|
85
|
-
function
|
86
|
-
let { labelable:
|
86
|
+
function it(e, t = {}) {
|
87
|
+
let { labelable: r, isLink: o, propNames: i } = t, d = {};
|
87
88
|
for (const u in e)
|
88
|
-
Object.prototype.hasOwnProperty.call(e, u) && (nt.has(u) ||
|
89
|
-
return
|
89
|
+
Object.prototype.hasOwnProperty.call(e, u) && (nt.has(u) || r && rt.has(u) || o && ot.has(u) || (i == null ? void 0 : i.has(u)) || st.test(u)) && (d[u] = e[u]);
|
90
|
+
return d;
|
90
91
|
}
|
91
|
-
function
|
92
|
-
if (
|
92
|
+
function G(e) {
|
93
|
+
if (at())
|
93
94
|
e.focus({
|
94
95
|
preventScroll: !0
|
95
96
|
});
|
@@ -98,272 +99,272 @@ function K(e) {
|
|
98
99
|
e.focus(), ut(t);
|
99
100
|
}
|
100
101
|
}
|
101
|
-
let
|
102
|
-
function
|
103
|
-
if (
|
104
|
-
|
102
|
+
let z = null;
|
103
|
+
function at() {
|
104
|
+
if (z == null) {
|
105
|
+
z = !1;
|
105
106
|
try {
|
106
107
|
document.createElement("div").focus({
|
107
108
|
get preventScroll() {
|
108
|
-
return
|
109
|
+
return z = !0, !0;
|
109
110
|
}
|
110
111
|
});
|
111
112
|
} catch {
|
112
113
|
}
|
113
114
|
}
|
114
|
-
return
|
115
|
+
return z;
|
115
116
|
}
|
116
117
|
function lt(e) {
|
117
|
-
let t = e.parentNode,
|
118
|
-
for (; t instanceof HTMLElement && t !==
|
119
|
-
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) &&
|
118
|
+
let t = e.parentNode, r = [], o = document.scrollingElement || document.documentElement;
|
119
|
+
for (; t instanceof HTMLElement && t !== o; )
|
120
|
+
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && r.push({
|
120
121
|
element: t,
|
121
122
|
scrollTop: t.scrollTop,
|
122
123
|
scrollLeft: t.scrollLeft
|
123
124
|
}), t = t.parentNode;
|
124
|
-
return
|
125
|
-
element:
|
126
|
-
scrollTop:
|
127
|
-
scrollLeft:
|
128
|
-
}),
|
125
|
+
return o instanceof HTMLElement && r.push({
|
126
|
+
element: o,
|
127
|
+
scrollTop: o.scrollTop,
|
128
|
+
scrollLeft: o.scrollLeft
|
129
|
+
}), r;
|
129
130
|
}
|
130
131
|
function ut(e) {
|
131
|
-
for (let { element: t, scrollTop:
|
132
|
-
t.scrollTop =
|
132
|
+
for (let { element: t, scrollTop: r, scrollLeft: o } of e)
|
133
|
+
t.scrollTop = r, t.scrollLeft = o;
|
133
134
|
}
|
134
|
-
function
|
135
|
+
function oe(e) {
|
135
136
|
var t;
|
136
|
-
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((
|
137
|
+
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((r) => e.test(r.brand))) || e.test(window.navigator.userAgent);
|
137
138
|
}
|
138
|
-
function
|
139
|
+
function be(e) {
|
139
140
|
var t;
|
140
141
|
return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
|
141
142
|
}
|
142
|
-
function
|
143
|
-
return
|
143
|
+
function j() {
|
144
|
+
return be(/^Mac/i);
|
144
145
|
}
|
145
146
|
function ct() {
|
146
|
-
return
|
147
|
-
}
|
148
|
-
function Le() {
|
149
|
-
return me(/^iPad/i) || Y() && navigator.maxTouchPoints > 1;
|
147
|
+
return be(/^iPhone/i);
|
150
148
|
}
|
151
149
|
function Ke() {
|
152
|
-
return
|
150
|
+
return be(/^iPad/i) || j() && navigator.maxTouchPoints > 1;
|
151
|
+
}
|
152
|
+
function Ie() {
|
153
|
+
return ct() || Ke();
|
153
154
|
}
|
154
155
|
function dt() {
|
155
|
-
return
|
156
|
+
return oe(/AppleWebKit/i) && !pt();
|
156
157
|
}
|
157
158
|
function pt() {
|
158
|
-
return
|
159
|
+
return oe(/Chrome/i);
|
159
160
|
}
|
160
|
-
function
|
161
|
-
return
|
161
|
+
function Ae() {
|
162
|
+
return oe(/Android/i);
|
162
163
|
}
|
163
164
|
function ft() {
|
164
|
-
return
|
165
|
+
return oe(/Firefox/i);
|
165
166
|
}
|
166
|
-
function
|
167
|
-
var
|
168
|
-
let { metaKey:
|
169
|
-
ft() && ((
|
170
|
-
let
|
167
|
+
function Y(e, t, r = !0) {
|
168
|
+
var o, i;
|
169
|
+
let { metaKey: d, ctrlKey: u, altKey: p, shiftKey: b } = t;
|
170
|
+
ft() && ((i = window.event) === null || i === void 0 || (o = i.type) === null || o === void 0 ? void 0 : o.startsWith("key")) && e.target === "_blank" && (j() ? d = !0 : u = !0);
|
171
|
+
let E = dt() && j() && !Ke() ? new KeyboardEvent("keydown", {
|
171
172
|
keyIdentifier: "Enter",
|
172
|
-
metaKey:
|
173
|
+
metaKey: d,
|
173
174
|
ctrlKey: u,
|
174
|
-
altKey:
|
175
|
-
shiftKey:
|
175
|
+
altKey: p,
|
176
|
+
shiftKey: b
|
176
177
|
}) : new MouseEvent("click", {
|
177
|
-
metaKey:
|
178
|
+
metaKey: d,
|
178
179
|
ctrlKey: u,
|
179
|
-
altKey:
|
180
|
-
shiftKey:
|
180
|
+
altKey: p,
|
181
|
+
shiftKey: b,
|
181
182
|
bubbles: !0,
|
182
183
|
cancelable: !0
|
183
184
|
});
|
184
|
-
|
185
|
+
Y.isOpening = r, G(e), e.dispatchEvent(E), Y.isOpening = !1;
|
185
186
|
}
|
186
|
-
|
187
|
-
let
|
187
|
+
Y.isOpening = !1;
|
188
|
+
let F = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Set();
|
188
189
|
function he() {
|
189
190
|
if (typeof window > "u")
|
190
191
|
return;
|
191
|
-
function e(
|
192
|
-
return "propertyName" in
|
192
|
+
function e(o) {
|
193
|
+
return "propertyName" in o;
|
193
194
|
}
|
194
|
-
let t = (
|
195
|
-
if (!e(
|
195
|
+
let t = (o) => {
|
196
|
+
if (!e(o) || !o.target)
|
196
197
|
return;
|
197
|
-
let
|
198
|
-
|
198
|
+
let i = F.get(o.target);
|
199
|
+
i || (i = /* @__PURE__ */ new Set(), F.set(o.target, i), o.target.addEventListener("transitioncancel", r, {
|
199
200
|
once: !0
|
200
|
-
})),
|
201
|
-
},
|
202
|
-
if (!e(
|
201
|
+
})), i.add(o.propertyName);
|
202
|
+
}, r = (o) => {
|
203
|
+
if (!e(o) || !o.target)
|
203
204
|
return;
|
204
|
-
let
|
205
|
-
if (!!
|
206
|
-
for (let
|
207
|
-
|
208
|
-
|
205
|
+
let i = F.get(o.target);
|
206
|
+
if (!!i && (i.delete(o.propertyName), i.size === 0 && (o.target.removeEventListener("transitioncancel", r), F.delete(o.target)), F.size === 0)) {
|
207
|
+
for (let d of ce)
|
208
|
+
d();
|
209
|
+
ce.clear();
|
209
210
|
}
|
210
211
|
};
|
211
|
-
document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend",
|
212
|
+
document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", r);
|
212
213
|
}
|
213
214
|
typeof document < "u" && (document.readyState !== "loading" ? he() : document.addEventListener("DOMContentLoaded", he));
|
214
|
-
function
|
215
|
+
function mt(e) {
|
215
216
|
requestAnimationFrame(() => {
|
216
|
-
|
217
|
+
F.size === 0 ? e() : ce.add(e);
|
217
218
|
});
|
218
219
|
}
|
219
|
-
function
|
220
|
-
let e =
|
221
|
-
let
|
222
|
-
e.current.delete(u), u(...
|
220
|
+
function bt() {
|
221
|
+
let e = re(/* @__PURE__ */ new Map()), t = Q((i, d, u, p) => {
|
222
|
+
let b = p != null && p.once ? (...E) => {
|
223
|
+
e.current.delete(u), u(...E);
|
223
224
|
} : u;
|
224
225
|
e.current.set(u, {
|
225
|
-
type:
|
226
|
-
eventTarget:
|
227
|
-
fn:
|
228
|
-
options:
|
229
|
-
}),
|
230
|
-
}, []),
|
231
|
-
var
|
232
|
-
let
|
233
|
-
|
234
|
-
}, []),
|
235
|
-
e.current.forEach((
|
236
|
-
|
226
|
+
type: d,
|
227
|
+
eventTarget: i,
|
228
|
+
fn: b,
|
229
|
+
options: p
|
230
|
+
}), i.addEventListener(d, u, p);
|
231
|
+
}, []), r = Q((i, d, u, p) => {
|
232
|
+
var b;
|
233
|
+
let E = ((b = e.current.get(u)) === null || b === void 0 ? void 0 : b.fn) || u;
|
234
|
+
i.removeEventListener(d, E, p), e.current.delete(u);
|
235
|
+
}, []), o = Q(() => {
|
236
|
+
e.current.forEach((i, d) => {
|
237
|
+
r(i.eventTarget, i.type, d, i.options);
|
237
238
|
});
|
238
239
|
}, [
|
239
|
-
n
|
240
|
-
]);
|
241
|
-
return pe(() => r, [
|
242
240
|
r
|
241
|
+
]);
|
242
|
+
return ee(() => o, [
|
243
|
+
o
|
243
244
|
]), {
|
244
245
|
addGlobalListener: t,
|
245
|
-
removeGlobalListener:
|
246
|
-
removeAllGlobalListeners:
|
246
|
+
removeGlobalListener: r,
|
247
|
+
removeAllGlobalListeners: o
|
247
248
|
};
|
248
249
|
}
|
249
|
-
function
|
250
|
-
|
250
|
+
function gt(e, t) {
|
251
|
+
Ce(() => {
|
251
252
|
if (e && e.ref && t)
|
252
253
|
return e.ref.current = t.current, () => {
|
253
254
|
e.ref && (e.ref.current = null);
|
254
255
|
};
|
255
256
|
});
|
256
257
|
}
|
257
|
-
function
|
258
|
-
return e.mozInputSource === 0 && e.isTrusted ? !0 :
|
258
|
+
function de(e) {
|
259
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Ae() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
259
260
|
}
|
260
|
-
function
|
261
|
-
return !
|
261
|
+
function vt(e) {
|
262
|
+
return !Ae() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
|
262
263
|
}
|
263
|
-
function
|
264
|
+
function yt(e, t) {
|
264
265
|
return t.get ? t.get.call(e) : t.value;
|
265
266
|
}
|
266
|
-
function
|
267
|
+
function Me(e, t, r) {
|
267
268
|
if (!t.has(e))
|
268
|
-
throw new TypeError("attempted to " +
|
269
|
+
throw new TypeError("attempted to " + r + " private field on non-instance");
|
269
270
|
return t.get(e);
|
270
271
|
}
|
271
|
-
function
|
272
|
-
var
|
273
|
-
return
|
272
|
+
function ht(e, t) {
|
273
|
+
var r = Me(e, t, "get");
|
274
|
+
return yt(e, r);
|
274
275
|
}
|
275
|
-
function
|
276
|
+
function Et(e, t) {
|
276
277
|
if (t.has(e))
|
277
278
|
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
278
279
|
}
|
279
|
-
function
|
280
|
-
|
280
|
+
function $t(e, t, r) {
|
281
|
+
Et(e, t), t.set(e, r);
|
281
282
|
}
|
282
|
-
function
|
283
|
+
function kt(e, t, r) {
|
283
284
|
if (t.set)
|
284
|
-
t.set.call(e,
|
285
|
+
t.set.call(e, r);
|
285
286
|
else {
|
286
287
|
if (!t.writable)
|
287
288
|
throw new TypeError("attempted to set read only private field");
|
288
|
-
t.value =
|
289
|
+
t.value = r;
|
289
290
|
}
|
290
291
|
}
|
291
|
-
function
|
292
|
-
var
|
293
|
-
return
|
292
|
+
function Ee(e, t, r) {
|
293
|
+
var o = Me(e, t, "set");
|
294
|
+
return kt(e, o, r), r;
|
294
295
|
}
|
295
|
-
let
|
296
|
-
function
|
297
|
-
if (
|
298
|
-
if (
|
299
|
-
const t =
|
300
|
-
|
296
|
+
let U = "default", pe = "", Z = /* @__PURE__ */ new WeakMap();
|
297
|
+
function $e(e) {
|
298
|
+
if (Ie()) {
|
299
|
+
if (U === "default") {
|
300
|
+
const t = D(e);
|
301
|
+
pe = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
|
301
302
|
}
|
302
|
-
|
303
|
+
U = "disabled";
|
303
304
|
} else
|
304
|
-
(e instanceof HTMLElement || e instanceof SVGElement) && (
|
305
|
+
(e instanceof HTMLElement || e instanceof SVGElement) && (Z.set(e, e.style.userSelect), e.style.userSelect = "none");
|
305
306
|
}
|
306
|
-
function
|
307
|
-
if (
|
308
|
-
if (
|
307
|
+
function X(e) {
|
308
|
+
if (Ie()) {
|
309
|
+
if (U !== "disabled")
|
309
310
|
return;
|
310
|
-
|
311
|
-
|
312
|
-
if (
|
313
|
-
const t =
|
314
|
-
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect =
|
311
|
+
U = "restoring", setTimeout(() => {
|
312
|
+
mt(() => {
|
313
|
+
if (U === "restoring") {
|
314
|
+
const t = D(e);
|
315
|
+
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = pe || ""), pe = "", U = "default";
|
315
316
|
}
|
316
317
|
});
|
317
318
|
}, 300);
|
318
|
-
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e &&
|
319
|
-
let t =
|
320
|
-
e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"),
|
319
|
+
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && Z.has(e)) {
|
320
|
+
let t = Z.get(e);
|
321
|
+
e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), Z.delete(e);
|
321
322
|
}
|
322
323
|
}
|
323
|
-
const Fe =
|
324
|
+
const Fe = Ne.createContext({
|
324
325
|
register: () => {
|
325
326
|
}
|
326
327
|
});
|
327
328
|
Fe.displayName = "PressResponderContext";
|
328
|
-
function
|
329
|
-
let t =
|
329
|
+
function wt(e) {
|
330
|
+
let t = je(Fe);
|
330
331
|
if (t) {
|
331
|
-
let { register:
|
332
|
-
e =
|
332
|
+
let { register: r, ...o } = t;
|
333
|
+
e = W(o, e), r();
|
333
334
|
}
|
334
|
-
return
|
335
|
+
return gt(t, e.ref), e;
|
335
336
|
}
|
336
|
-
var
|
337
|
-
class
|
337
|
+
var q = /* @__PURE__ */ new WeakMap();
|
338
|
+
class J {
|
338
339
|
continuePropagation() {
|
339
|
-
|
340
|
+
Ee(this, q, !1);
|
340
341
|
}
|
341
342
|
get shouldStopPropagation() {
|
342
|
-
return
|
343
|
+
return ht(this, q);
|
343
344
|
}
|
344
|
-
constructor(t,
|
345
|
-
|
345
|
+
constructor(t, r, o) {
|
346
|
+
$t(this, q, {
|
346
347
|
writable: !0,
|
347
348
|
value: void 0
|
348
|
-
}),
|
349
|
+
}), Ee(this, q, !0), this.type = t, this.pointerType = r, this.target = o.currentTarget, this.shiftKey = o.shiftKey, this.metaKey = o.metaKey, this.ctrlKey = o.ctrlKey, this.altKey = o.altKey;
|
349
350
|
}
|
350
351
|
}
|
351
|
-
const
|
352
|
-
function
|
352
|
+
const ke = Symbol("linkClicked");
|
353
|
+
function Tt(e) {
|
353
354
|
let {
|
354
355
|
onPress: t,
|
355
|
-
onPressChange:
|
356
|
-
onPressStart:
|
357
|
-
onPressEnd:
|
358
|
-
onPressUp:
|
356
|
+
onPressChange: r,
|
357
|
+
onPressStart: o,
|
358
|
+
onPressEnd: i,
|
359
|
+
onPressUp: d,
|
359
360
|
isDisabled: u,
|
360
|
-
isPressed:
|
361
|
-
preventFocusOnPress:
|
362
|
-
shouldCancelOnPointerExit:
|
363
|
-
allowTextSelectionOnPress:
|
364
|
-
ref:
|
365
|
-
...
|
366
|
-
} =
|
361
|
+
isPressed: p,
|
362
|
+
preventFocusOnPress: b,
|
363
|
+
shouldCancelOnPointerExit: E,
|
364
|
+
allowTextSelectionOnPress: v,
|
365
|
+
ref: C,
|
366
|
+
...x
|
367
|
+
} = wt(e), [m, P] = Oe(!1), k = re({
|
367
368
|
isPressed: !1,
|
368
369
|
ignoreEmulatedMouseEvents: !1,
|
369
370
|
ignoreClickAfterPress: !1,
|
@@ -373,232 +374,232 @@ function wt(e) {
|
|
373
374
|
target: null,
|
374
375
|
isOverTarget: !1,
|
375
376
|
pointerType: null
|
376
|
-
}), { addGlobalListener:
|
377
|
-
let
|
378
|
-
if (u ||
|
377
|
+
}), { addGlobalListener: T, removeAllGlobalListeners: N } = bt(), B = R((n, f) => {
|
378
|
+
let w = k.current;
|
379
|
+
if (u || w.didFirePressStart)
|
379
380
|
return !1;
|
380
|
-
let
|
381
|
-
if (
|
382
|
-
let
|
383
|
-
|
381
|
+
let l = !0;
|
382
|
+
if (w.isTriggeringEvent = !0, o) {
|
383
|
+
let g = new J("pressstart", f, n);
|
384
|
+
o(g), l = g.shouldStopPropagation;
|
384
385
|
}
|
385
|
-
return
|
386
|
-
}),
|
387
|
-
let
|
388
|
-
if (!
|
386
|
+
return r && r(!0), w.isTriggeringEvent = !1, w.didFirePressStart = !0, P(!0), l;
|
387
|
+
}), $ = R((n, f, w = !0) => {
|
388
|
+
let l = k.current;
|
389
|
+
if (!l.didFirePressStart)
|
389
390
|
return !1;
|
390
|
-
|
391
|
-
let
|
392
|
-
if (
|
393
|
-
let
|
394
|
-
s
|
391
|
+
l.ignoreClickAfterPress = !0, l.didFirePressStart = !1, l.isTriggeringEvent = !0;
|
392
|
+
let g = !0;
|
393
|
+
if (i) {
|
394
|
+
let s = new J("pressend", f, n);
|
395
|
+
i(s), g = s.shouldStopPropagation;
|
395
396
|
}
|
396
|
-
if (
|
397
|
-
let
|
398
|
-
t(
|
397
|
+
if (r && r(!1), P(!1), t && w && !u) {
|
398
|
+
let s = new J("press", f, n);
|
399
|
+
t(s), g && (g = s.shouldStopPropagation);
|
399
400
|
}
|
400
|
-
return
|
401
|
-
}),
|
402
|
-
let
|
401
|
+
return l.isTriggeringEvent = !1, g;
|
402
|
+
}), L = R((n, f) => {
|
403
|
+
let w = k.current;
|
403
404
|
if (u)
|
404
405
|
return !1;
|
405
|
-
if (
|
406
|
-
|
407
|
-
let
|
408
|
-
return l
|
406
|
+
if (d) {
|
407
|
+
w.isTriggeringEvent = !0;
|
408
|
+
let l = new J("pressup", f, n);
|
409
|
+
return d(l), w.isTriggeringEvent = !1, l.shouldStopPropagation;
|
409
410
|
}
|
410
411
|
return !0;
|
411
|
-
}),
|
412
|
-
let f =
|
413
|
-
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null &&
|
414
|
-
}),
|
415
|
-
|
416
|
-
}),
|
417
|
-
let
|
418
|
-
onKeyDown(
|
419
|
-
if (
|
420
|
-
var
|
421
|
-
Te(
|
422
|
-
let
|
423
|
-
if (!
|
424
|
-
|
425
|
-
let
|
426
|
-
|
412
|
+
}), O = R((n) => {
|
413
|
+
let f = k.current;
|
414
|
+
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && $(_(f.target, n), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, N(), v || X(f.target));
|
415
|
+
}), I = R((n) => {
|
416
|
+
E && O(n);
|
417
|
+
}), ie = De(() => {
|
418
|
+
let n = k.current, f = {
|
419
|
+
onKeyDown(l) {
|
420
|
+
if (ae(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
|
421
|
+
var g;
|
422
|
+
Te(l.target, l.key) && l.preventDefault();
|
423
|
+
let s = !0;
|
424
|
+
if (!n.isPressed && !l.repeat) {
|
425
|
+
n.target = l.currentTarget, n.isPressed = !0, s = B(l, "keyboard");
|
426
|
+
let a = l.currentTarget, h = (A) => {
|
427
|
+
ae(A, a) && !A.repeat && a.contains(A.target) && n.target && L(_(n.target, A), "keyboard");
|
427
428
|
};
|
428
|
-
|
429
|
+
T(D(l.currentTarget), "keyup", _e(h, w), !0);
|
429
430
|
}
|
430
|
-
|
431
|
+
s && l.stopPropagation(), l.metaKey && j() && ((g = n.metaKeyEvents) === null || g === void 0 || g.set(l.key, l.nativeEvent));
|
431
432
|
} else
|
432
|
-
|
433
|
+
l.key === "Meta" && (n.metaKeyEvents = /* @__PURE__ */ new Map());
|
433
434
|
},
|
434
|
-
onClick(
|
435
|
-
if (!(
|
436
|
-
let
|
437
|
-
if (u &&
|
438
|
-
!u && !
|
439
|
-
let
|
440
|
-
|
435
|
+
onClick(l) {
|
436
|
+
if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !n.isTriggeringEvent && !Y.isOpening) {
|
437
|
+
let g = !0;
|
438
|
+
if (u && l.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && !n.isPressed && (n.pointerType === "virtual" || de(l.nativeEvent))) {
|
439
|
+
!u && !b && G(l.currentTarget);
|
440
|
+
let s = B(l, "virtual"), a = L(l, "virtual"), h = $(l, "virtual");
|
441
|
+
g = s && a && h;
|
441
442
|
}
|
442
|
-
|
443
|
+
n.ignoreEmulatedMouseEvents = !1, n.ignoreClickAfterPress = !1, g && l.stopPropagation();
|
443
444
|
}
|
444
445
|
}
|
445
|
-
},
|
446
|
-
var
|
447
|
-
if (
|
446
|
+
}, w = (l) => {
|
447
|
+
var g;
|
448
|
+
if (n.isPressed && n.target && ae(l, n.target)) {
|
449
|
+
var s;
|
450
|
+
Te(l.target, l.key) && l.preventDefault();
|
451
|
+
let h = l.target;
|
452
|
+
$(_(n.target, l), "keyboard", n.target.contains(h)), N(), l.key !== "Enter" && ge(n.target) && n.target.contains(h) && !l[ke] && (l[ke] = !0, Y(n.target, l, !1)), n.isPressed = !1, (s = n.metaKeyEvents) === null || s === void 0 || s.delete(l.key);
|
453
|
+
} else if (l.key === "Meta" && ((g = n.metaKeyEvents) === null || g === void 0 ? void 0 : g.size)) {
|
448
454
|
var a;
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
var i;
|
454
|
-
let y = o.metaKeyEvents;
|
455
|
-
o.metaKeyEvents = void 0;
|
456
|
-
for (let F of y.values())
|
457
|
-
(i = o.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", F));
|
455
|
+
let h = n.metaKeyEvents;
|
456
|
+
n.metaKeyEvents = void 0;
|
457
|
+
for (let A of h.values())
|
458
|
+
(a = n.target) === null || a === void 0 || a.dispatchEvent(new KeyboardEvent("keyup", A));
|
458
459
|
}
|
459
460
|
};
|
460
461
|
if (typeof PointerEvent < "u") {
|
461
|
-
f.onPointerDown = (
|
462
|
-
if (
|
462
|
+
f.onPointerDown = (a) => {
|
463
|
+
if (a.button !== 0 || !a.currentTarget.contains(a.target))
|
463
464
|
return;
|
464
|
-
if (
|
465
|
-
|
465
|
+
if (vt(a.nativeEvent)) {
|
466
|
+
n.pointerType = "virtual";
|
466
467
|
return;
|
467
468
|
}
|
468
|
-
|
469
|
-
let
|
470
|
-
|
471
|
-
}, f.onMouseDown = (
|
472
|
-
!
|
473
|
-
}, f.onPointerUp = (
|
474
|
-
!
|
469
|
+
le(a.currentTarget) && a.preventDefault(), n.pointerType = a.pointerType;
|
470
|
+
let h = !0;
|
471
|
+
n.isPressed || (n.isPressed = !0, n.isOverTarget = !0, n.activePointerId = a.pointerId, n.target = a.currentTarget, !u && !b && G(a.currentTarget), v || $e(n.target), h = B(a, n.pointerType), T(D(a.currentTarget), "pointermove", l, !1), T(D(a.currentTarget), "pointerup", g, !1), T(D(a.currentTarget), "pointercancel", s, !1)), h && a.stopPropagation();
|
472
|
+
}, f.onMouseDown = (a) => {
|
473
|
+
!a.currentTarget.contains(a.target) || a.button === 0 && (le(a.currentTarget) && a.preventDefault(), a.stopPropagation());
|
474
|
+
}, f.onPointerUp = (a) => {
|
475
|
+
!a.currentTarget.contains(a.target) || n.pointerType === "virtual" || a.button === 0 && M(a, a.currentTarget) && L(a, n.pointerType || a.pointerType);
|
475
476
|
};
|
476
|
-
let
|
477
|
-
|
478
|
-
},
|
479
|
-
|
480
|
-
},
|
481
|
-
|
477
|
+
let l = (a) => {
|
478
|
+
a.pointerId === n.activePointerId && (n.target && M(a, n.target) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, B(_(n.target, a), n.pointerType)) : n.target && n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, $(_(n.target, a), n.pointerType, !1), I(a)));
|
479
|
+
}, g = (a) => {
|
480
|
+
a.pointerId === n.activePointerId && n.isPressed && a.button === 0 && n.target && (M(a, n.target) && n.pointerType != null ? $(_(n.target, a), n.pointerType) : n.isOverTarget && n.pointerType != null && $(_(n.target, a), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, N(), v || X(n.target));
|
481
|
+
}, s = (a) => {
|
482
|
+
O(a);
|
482
483
|
};
|
483
|
-
f.onDragStart = (
|
484
|
-
!
|
484
|
+
f.onDragStart = (a) => {
|
485
|
+
!a.currentTarget.contains(a.target) || O(a);
|
485
486
|
};
|
486
487
|
} else {
|
487
|
-
f.onMouseDown = (
|
488
|
-
if (
|
488
|
+
f.onMouseDown = (s) => {
|
489
|
+
if (s.button !== 0 || !s.currentTarget.contains(s.target))
|
489
490
|
return;
|
490
|
-
if (
|
491
|
-
|
491
|
+
if (le(s.currentTarget) && s.preventDefault(), n.ignoreEmulatedMouseEvents) {
|
492
|
+
s.stopPropagation();
|
492
493
|
return;
|
493
494
|
}
|
494
|
-
|
495
|
-
}, f.onMouseEnter = (
|
496
|
-
if (!
|
495
|
+
n.isPressed = !0, n.isOverTarget = !0, n.target = s.currentTarget, n.pointerType = de(s.nativeEvent) ? "virtual" : "mouse", !u && !b && G(s.currentTarget), B(s, n.pointerType) && s.stopPropagation(), T(D(s.currentTarget), "mouseup", l, !1);
|
496
|
+
}, f.onMouseEnter = (s) => {
|
497
|
+
if (!s.currentTarget.contains(s.target))
|
497
498
|
return;
|
498
|
-
let
|
499
|
-
|
500
|
-
}, f.onMouseLeave = (
|
501
|
-
if (!
|
499
|
+
let a = !0;
|
500
|
+
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0, a = B(s, n.pointerType)), a && s.stopPropagation();
|
501
|
+
}, f.onMouseLeave = (s) => {
|
502
|
+
if (!s.currentTarget.contains(s.target))
|
502
503
|
return;
|
503
|
-
let
|
504
|
-
|
505
|
-
}, f.onMouseUp = (
|
506
|
-
!
|
504
|
+
let a = !0;
|
505
|
+
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1, a = $(s, n.pointerType, !1), I(s)), a && s.stopPropagation();
|
506
|
+
}, f.onMouseUp = (s) => {
|
507
|
+
!s.currentTarget.contains(s.target) || !n.ignoreEmulatedMouseEvents && s.button === 0 && L(s, n.pointerType || "mouse");
|
507
508
|
};
|
508
|
-
let
|
509
|
-
if (
|
510
|
-
if (
|
511
|
-
|
509
|
+
let l = (s) => {
|
510
|
+
if (s.button === 0) {
|
511
|
+
if (n.isPressed = !1, N(), n.ignoreEmulatedMouseEvents) {
|
512
|
+
n.ignoreEmulatedMouseEvents = !1;
|
512
513
|
return;
|
513
514
|
}
|
514
|
-
|
515
|
+
n.target && M(s, n.target) && n.pointerType != null ? $(_(n.target, s), n.pointerType) : n.target && n.isOverTarget && n.pointerType != null && $(_(n.target, s), n.pointerType, !1), n.isOverTarget = !1;
|
515
516
|
}
|
516
517
|
};
|
517
|
-
f.onTouchStart = (
|
518
|
-
if (!
|
518
|
+
f.onTouchStart = (s) => {
|
519
|
+
if (!s.currentTarget.contains(s.target))
|
519
520
|
return;
|
520
|
-
let
|
521
|
-
if (!
|
521
|
+
let a = Bt(s.nativeEvent);
|
522
|
+
if (!a)
|
522
523
|
return;
|
523
|
-
|
524
|
-
}, f.onTouchMove = (
|
525
|
-
if (!
|
524
|
+
n.activePointerId = a.identifier, n.ignoreEmulatedMouseEvents = !0, n.isOverTarget = !0, n.isPressed = !0, n.target = s.currentTarget, n.pointerType = "touch", !u && !b && G(s.currentTarget), v || $e(n.target), B(s, n.pointerType) && s.stopPropagation(), T(H(s.currentTarget), "scroll", g, !0);
|
525
|
+
}, f.onTouchMove = (s) => {
|
526
|
+
if (!s.currentTarget.contains(s.target))
|
526
527
|
return;
|
527
|
-
if (!
|
528
|
-
|
528
|
+
if (!n.isPressed) {
|
529
|
+
s.stopPropagation();
|
529
530
|
return;
|
530
531
|
}
|
531
|
-
let
|
532
|
-
|
533
|
-
}, f.onTouchEnd = (
|
534
|
-
if (!
|
532
|
+
let a = we(s.nativeEvent, n.activePointerId), h = !0;
|
533
|
+
a && M(a, s.currentTarget) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, h = B(s, n.pointerType)) : n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, h = $(s, n.pointerType, !1), I(s)), h && s.stopPropagation();
|
534
|
+
}, f.onTouchEnd = (s) => {
|
535
|
+
if (!s.currentTarget.contains(s.target))
|
535
536
|
return;
|
536
|
-
if (!
|
537
|
-
|
537
|
+
if (!n.isPressed) {
|
538
|
+
s.stopPropagation();
|
538
539
|
return;
|
539
540
|
}
|
540
|
-
let
|
541
|
-
|
542
|
-
}, f.onTouchCancel = (
|
543
|
-
!
|
541
|
+
let a = we(s.nativeEvent, n.activePointerId), h = !0;
|
542
|
+
a && M(a, s.currentTarget) && n.pointerType != null ? (L(s, n.pointerType), h = $(s, n.pointerType)) : n.isOverTarget && n.pointerType != null && (h = $(s, n.pointerType, !1)), h && s.stopPropagation(), n.isPressed = !1, n.activePointerId = null, n.isOverTarget = !1, n.ignoreEmulatedMouseEvents = !0, n.target && !v && X(n.target), N();
|
543
|
+
}, f.onTouchCancel = (s) => {
|
544
|
+
!s.currentTarget.contains(s.target) || (s.stopPropagation(), n.isPressed && O(s));
|
544
545
|
};
|
545
|
-
let
|
546
|
-
|
547
|
-
currentTarget:
|
546
|
+
let g = (s) => {
|
547
|
+
n.isPressed && s.target.contains(n.target) && O({
|
548
|
+
currentTarget: n.target,
|
548
549
|
shiftKey: !1,
|
549
550
|
ctrlKey: !1,
|
550
551
|
metaKey: !1,
|
551
552
|
altKey: !1
|
552
553
|
});
|
553
554
|
};
|
554
|
-
f.onDragStart = (
|
555
|
-
!
|
555
|
+
f.onDragStart = (s) => {
|
556
|
+
!s.currentTarget.contains(s.target) || O(s);
|
556
557
|
};
|
557
558
|
}
|
558
559
|
return f;
|
559
560
|
}, [
|
560
|
-
|
561
|
+
T,
|
561
562
|
u,
|
562
|
-
|
563
|
+
b,
|
563
564
|
N,
|
565
|
+
v,
|
566
|
+
O,
|
567
|
+
I,
|
564
568
|
$,
|
565
569
|
B,
|
566
|
-
L
|
567
|
-
v,
|
568
|
-
w,
|
569
|
-
T
|
570
|
+
L
|
570
571
|
]);
|
571
|
-
return
|
572
|
-
var
|
573
|
-
|
572
|
+
return ee(() => () => {
|
573
|
+
var n;
|
574
|
+
v || X((n = k.current.target) !== null && n !== void 0 ? n : void 0);
|
574
575
|
}, [
|
575
|
-
|
576
|
+
v
|
576
577
|
]), {
|
577
|
-
isPressed:
|
578
|
-
pressProps:
|
578
|
+
isPressed: p || m,
|
579
|
+
pressProps: W(x, ie)
|
579
580
|
};
|
580
581
|
}
|
581
|
-
function
|
582
|
+
function ge(e) {
|
582
583
|
return e.tagName === "A" && e.hasAttribute("href");
|
583
584
|
}
|
584
|
-
function
|
585
|
-
const { key:
|
586
|
-
return (
|
585
|
+
function ae(e, t) {
|
586
|
+
const { key: r, code: o } = e, i = t, d = i.getAttribute("role");
|
587
|
+
return (r === "Enter" || r === " " || r === "Spacebar" || o === "Space") && !(i instanceof H(i).HTMLInputElement && !Ue(i, r) || i instanceof H(i).HTMLTextAreaElement || i.isContentEditable) && !((d === "link" || !d && ge(i)) && r !== "Enter");
|
587
588
|
}
|
588
|
-
function
|
589
|
+
function Bt(e) {
|
589
590
|
const { targetTouches: t } = e;
|
590
591
|
return t.length > 0 ? t[0] : null;
|
591
592
|
}
|
592
|
-
function
|
593
|
-
const
|
594
|
-
for (let
|
595
|
-
const
|
596
|
-
if (
|
597
|
-
return
|
593
|
+
function we(e, t) {
|
594
|
+
const r = e.changedTouches;
|
595
|
+
for (let o = 0; o < r.length; o++) {
|
596
|
+
const i = r[o];
|
597
|
+
if (i.identifier === t)
|
598
|
+
return i;
|
598
599
|
}
|
599
600
|
return null;
|
600
601
|
}
|
601
|
-
function
|
602
|
+
function _(e, t) {
|
602
603
|
return {
|
603
604
|
currentTarget: e,
|
604
605
|
shiftKey: t.shiftKey,
|
@@ -607,29 +608,29 @@ function D(e, t) {
|
|
607
608
|
altKey: t.altKey
|
608
609
|
};
|
609
610
|
}
|
610
|
-
function
|
611
|
-
let t = 0,
|
612
|
-
return e.width !== void 0 ? t = e.width / 2 : e.radiusX !== void 0 && (t = e.radiusX), e.height !== void 0 ?
|
613
|
-
top: e.clientY -
|
611
|
+
function Pt(e) {
|
612
|
+
let t = 0, r = 0;
|
613
|
+
return e.width !== void 0 ? t = e.width / 2 : e.radiusX !== void 0 && (t = e.radiusX), e.height !== void 0 ? r = e.height / 2 : e.radiusY !== void 0 && (r = e.radiusY), {
|
614
|
+
top: e.clientY - r,
|
614
615
|
right: e.clientX + t,
|
615
|
-
bottom: e.clientY +
|
616
|
+
bottom: e.clientY + r,
|
616
617
|
left: e.clientX - t
|
617
618
|
};
|
618
619
|
}
|
619
|
-
function
|
620
|
+
function xt(e, t) {
|
620
621
|
return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
|
621
622
|
}
|
622
|
-
function
|
623
|
-
let
|
624
|
-
return
|
623
|
+
function M(e, t) {
|
624
|
+
let r = t.getBoundingClientRect(), o = Pt(e);
|
625
|
+
return xt(r, o);
|
625
626
|
}
|
626
|
-
function
|
627
|
+
function le(e) {
|
627
628
|
return !(e instanceof HTMLElement) || !e.hasAttribute("draggable");
|
628
629
|
}
|
629
630
|
function Te(e, t) {
|
630
|
-
return e instanceof HTMLInputElement ? !
|
631
|
+
return e instanceof HTMLInputElement ? !Ue(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !ge(e);
|
631
632
|
}
|
632
|
-
const
|
633
|
+
const St = /* @__PURE__ */ new Set([
|
633
634
|
"checkbox",
|
634
635
|
"radio",
|
635
636
|
"range",
|
@@ -640,450 +641,308 @@ const Pt = /* @__PURE__ */ new Set([
|
|
640
641
|
"submit",
|
641
642
|
"reset"
|
642
643
|
]);
|
643
|
-
function
|
644
|
-
return e.type === "checkbox" || e.type === "radio" ? t === " " :
|
644
|
+
function Ue(e, t) {
|
645
|
+
return e.type === "checkbox" || e.type === "radio" ? t === " " : St.has(e.type);
|
645
646
|
}
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
preventDefault() {
|
651
|
-
this.defaultPrevented = !0, this.nativeEvent.preventDefault();
|
652
|
-
}
|
653
|
-
stopPropagation() {
|
654
|
-
this.nativeEvent.stopPropagation(), this.isPropagationStopped = () => !0;
|
655
|
-
}
|
656
|
-
isPropagationStopped() {
|
657
|
-
return !1;
|
658
|
-
}
|
659
|
-
persist() {
|
660
|
-
}
|
661
|
-
constructor(t, n) {
|
662
|
-
this.nativeEvent = n, this.target = n.target, this.currentTarget = n.currentTarget, this.relatedTarget = n.relatedTarget, this.bubbles = n.bubbles, this.cancelable = n.cancelable, this.defaultPrevented = n.defaultPrevented, this.eventPhase = n.eventPhase, this.isTrusted = n.isTrusted, this.timeStamp = n.timeStamp, this.type = t;
|
663
|
-
}
|
664
|
-
}
|
665
|
-
function St(e) {
|
666
|
-
let t = X({
|
667
|
-
isFocused: !1,
|
668
|
-
observer: null
|
669
|
-
});
|
670
|
-
fe(() => {
|
671
|
-
const r = t.current;
|
672
|
-
return () => {
|
673
|
-
r.observer && (r.observer.disconnect(), r.observer = null);
|
674
|
-
};
|
675
|
-
}, []);
|
676
|
-
let n = U((r) => {
|
677
|
-
e == null || e(r);
|
678
|
-
});
|
679
|
-
return _((r) => {
|
680
|
-
if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
|
681
|
-
t.current.isFocused = !0;
|
682
|
-
let s = r.target, l = (u) => {
|
683
|
-
t.current.isFocused = !1, s.disabled && n(new xt("blur", u)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
|
684
|
-
};
|
685
|
-
s.addEventListener("focusout", l, {
|
686
|
-
once: !0
|
687
|
-
}), t.current.observer = new MutationObserver(() => {
|
688
|
-
if (t.current.isFocused && s.disabled) {
|
689
|
-
var u;
|
690
|
-
(u = t.current.observer) === null || u === void 0 || u.disconnect();
|
691
|
-
let m = s === document.activeElement ? null : document.activeElement;
|
692
|
-
s.dispatchEvent(new FocusEvent("blur", {
|
693
|
-
relatedTarget: m
|
694
|
-
})), s.dispatchEvent(new FocusEvent("focusout", {
|
695
|
-
bubbles: !0,
|
696
|
-
relatedTarget: m
|
697
|
-
}));
|
698
|
-
}
|
699
|
-
}), t.current.observer.observe(s, {
|
700
|
-
attributes: !0,
|
701
|
-
attributeFilter: [
|
702
|
-
"disabled"
|
703
|
-
]
|
704
|
-
});
|
705
|
-
}
|
706
|
-
}, [
|
707
|
-
n
|
708
|
-
]);
|
709
|
-
}
|
710
|
-
function Nt(e) {
|
711
|
-
let { isDisabled: t, onFocus: n, onBlur: r, onFocusChange: s } = e;
|
712
|
-
const l = _((p) => {
|
713
|
-
if (p.target === p.currentTarget)
|
714
|
-
return r && r(p), s && s(!1), !0;
|
715
|
-
}, [
|
716
|
-
r,
|
717
|
-
s
|
718
|
-
]), u = St(l), m = _((p) => {
|
719
|
-
p.target === p.currentTarget && document.activeElement === p.target && (n && n(p), s && s(!0), u(p));
|
720
|
-
}, [
|
721
|
-
s,
|
722
|
-
n,
|
723
|
-
u
|
724
|
-
]);
|
725
|
-
return {
|
726
|
-
focusProps: {
|
727
|
-
onFocus: !t && (n || s || r) ? m : void 0,
|
728
|
-
onBlur: !t && (r || s) ? l : void 0
|
729
|
-
}
|
730
|
-
};
|
731
|
-
}
|
732
|
-
let q = null, Dt = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Map(), I = !1, ce = !1;
|
733
|
-
function ge(e, t) {
|
734
|
-
for (let n of Dt)
|
735
|
-
n(e, t);
|
647
|
+
let Nt = /* @__PURE__ */ new Set(), V = /* @__PURE__ */ new Map(), K = !1, fe = !1;
|
648
|
+
function ve(e, t) {
|
649
|
+
for (let r of Nt)
|
650
|
+
r(e, t);
|
736
651
|
}
|
737
652
|
function Ot(e) {
|
738
|
-
return !(e.metaKey || !
|
653
|
+
return !(e.metaKey || !j() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
739
654
|
}
|
740
|
-
function
|
741
|
-
|
655
|
+
function te(e) {
|
656
|
+
K = !0, Ot(e) && ve("keyboard", e);
|
742
657
|
}
|
743
|
-
function
|
744
|
-
|
658
|
+
function S(e) {
|
659
|
+
(e.type === "mousedown" || e.type === "pointerdown") && (K = !0, ve("pointer", e));
|
745
660
|
}
|
746
|
-
function
|
747
|
-
|
661
|
+
function He(e) {
|
662
|
+
de(e) && (K = !0);
|
748
663
|
}
|
749
|
-
function
|
750
|
-
e.target === window || e.target === document || (!
|
664
|
+
function Re(e) {
|
665
|
+
e.target === window || e.target === document || (!K && !fe && ve("virtual", e), K = !1, fe = !1);
|
751
666
|
}
|
752
667
|
function Ge() {
|
753
|
-
|
668
|
+
K = !1, fe = !0;
|
754
669
|
}
|
755
670
|
function Be(e) {
|
756
|
-
if (typeof window > "u" ||
|
671
|
+
if (typeof window > "u" || V.get(H(e)))
|
757
672
|
return;
|
758
|
-
const t =
|
759
|
-
let
|
673
|
+
const t = H(e), r = D(e);
|
674
|
+
let o = t.HTMLElement.prototype.focus;
|
760
675
|
t.HTMLElement.prototype.focus = function() {
|
761
|
-
|
762
|
-
},
|
763
|
-
|
676
|
+
K = !0, o.apply(this, arguments);
|
677
|
+
}, r.addEventListener("keydown", te, !0), r.addEventListener("keyup", te, !0), r.addEventListener("click", He, !0), t.addEventListener("focus", Re, !0), t.addEventListener("blur", Ge, !1), typeof PointerEvent < "u" ? (r.addEventListener("pointerdown", S, !0), r.addEventListener("pointermove", S, !0), r.addEventListener("pointerup", S, !0)) : (r.addEventListener("mousedown", S, !0), r.addEventListener("mousemove", S, !0), r.addEventListener("mouseup", S, !0)), t.addEventListener("beforeunload", () => {
|
678
|
+
Ve(e);
|
764
679
|
}, {
|
765
680
|
once: !0
|
766
|
-
}),
|
767
|
-
focus:
|
681
|
+
}), V.set(t, {
|
682
|
+
focus: o
|
768
683
|
});
|
769
684
|
}
|
770
|
-
const
|
771
|
-
const
|
772
|
-
t &&
|
685
|
+
const Ve = (e, t) => {
|
686
|
+
const r = H(e), o = D(e);
|
687
|
+
t && o.removeEventListener("DOMContentLoaded", t), V.has(r) && (r.HTMLElement.prototype.focus = V.get(r).focus, o.removeEventListener("keydown", te, !0), o.removeEventListener("keyup", te, !0), o.removeEventListener("click", He, !0), r.removeEventListener("focus", Re, !0), r.removeEventListener("blur", Ge, !1), typeof PointerEvent < "u" ? (o.removeEventListener("pointerdown", S, !0), o.removeEventListener("pointermove", S, !0), o.removeEventListener("pointerup", S, !0)) : (o.removeEventListener("mousedown", S, !0), o.removeEventListener("mousemove", S, !0), o.removeEventListener("mouseup", S, !0)), V.delete(r));
|
773
688
|
};
|
774
|
-
function
|
775
|
-
const t =
|
776
|
-
let
|
777
|
-
return t.readyState !== "loading" ? Be(e) : (
|
689
|
+
function Dt(e) {
|
690
|
+
const t = D(e);
|
691
|
+
let r;
|
692
|
+
return t.readyState !== "loading" ? Be(e) : (r = () => {
|
778
693
|
Be(e);
|
779
|
-
}, t.addEventListener("DOMContentLoaded",
|
694
|
+
}, t.addEventListener("DOMContentLoaded", r)), () => Ve(e, r);
|
780
695
|
}
|
781
|
-
typeof document < "u" &&
|
782
|
-
|
783
|
-
|
696
|
+
typeof document < "u" && Dt();
|
697
|
+
let ne = !1, ue = 0;
|
698
|
+
function me() {
|
699
|
+
ne = !0, setTimeout(() => {
|
700
|
+
ne = !1;
|
701
|
+
}, 50);
|
784
702
|
}
|
785
703
|
function Pe(e) {
|
786
|
-
|
787
|
-
return;
|
788
|
-
let t = !0;
|
789
|
-
return (n) => {
|
790
|
-
let r = {
|
791
|
-
...n,
|
792
|
-
preventDefault() {
|
793
|
-
n.preventDefault();
|
794
|
-
},
|
795
|
-
isDefaultPrevented() {
|
796
|
-
return n.isDefaultPrevented();
|
797
|
-
},
|
798
|
-
stopPropagation() {
|
799
|
-
console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.");
|
800
|
-
},
|
801
|
-
continuePropagation() {
|
802
|
-
t = !1;
|
803
|
-
}
|
804
|
-
};
|
805
|
-
e(r), t && n.stopPropagation();
|
806
|
-
};
|
807
|
-
}
|
808
|
-
function Kt(e) {
|
809
|
-
return {
|
810
|
-
keyboardProps: e.isDisabled ? {} : {
|
811
|
-
onKeyDown: Pe(e.onKeyDown),
|
812
|
-
onKeyUp: Pe(e.onKeyUp)
|
813
|
-
}
|
814
|
-
};
|
815
|
-
}
|
816
|
-
function _t(e) {
|
817
|
-
const t = x(e);
|
818
|
-
if (Lt() === "virtual") {
|
819
|
-
let n = t.activeElement;
|
820
|
-
Ie(() => {
|
821
|
-
t.activeElement === n && e.isConnected && K(e);
|
822
|
-
});
|
823
|
-
} else
|
824
|
-
K(e);
|
825
|
-
}
|
826
|
-
function It(e, t) {
|
827
|
-
return !e || !t ? !1 : t.some((n) => n.contains(e));
|
828
|
-
}
|
829
|
-
class ve {
|
830
|
-
get size() {
|
831
|
-
return this.fastMap.size;
|
832
|
-
}
|
833
|
-
getTreeNode(t) {
|
834
|
-
return this.fastMap.get(t);
|
835
|
-
}
|
836
|
-
addTreeNode(t, n, r) {
|
837
|
-
let s = this.fastMap.get(n != null ? n : null);
|
838
|
-
if (!s)
|
839
|
-
return;
|
840
|
-
let l = new xe({
|
841
|
-
scopeRef: t
|
842
|
-
});
|
843
|
-
s.addChild(l), l.parent = s, this.fastMap.set(t, l), r && (l.nodeToRestore = r);
|
844
|
-
}
|
845
|
-
addNode(t) {
|
846
|
-
this.fastMap.set(t.scopeRef, t);
|
847
|
-
}
|
848
|
-
removeTreeNode(t) {
|
849
|
-
if (t === null)
|
850
|
-
return;
|
851
|
-
let n = this.fastMap.get(t);
|
852
|
-
if (!n)
|
853
|
-
return;
|
854
|
-
let r = n.parent;
|
855
|
-
for (let l of this.traverse())
|
856
|
-
l !== n && n.nodeToRestore && l.nodeToRestore && n.scopeRef && n.scopeRef.current && It(l.nodeToRestore, n.scopeRef.current) && (l.nodeToRestore = n.nodeToRestore);
|
857
|
-
let s = n.children;
|
858
|
-
r && (r.removeChild(n), s.size > 0 && s.forEach((l) => r && r.addChild(l))), this.fastMap.delete(n.scopeRef);
|
859
|
-
}
|
860
|
-
*traverse(t = this.root) {
|
861
|
-
if (t.scopeRef != null && (yield t), t.children.size > 0)
|
862
|
-
for (let n of t.children)
|
863
|
-
yield* this.traverse(n);
|
864
|
-
}
|
865
|
-
clone() {
|
866
|
-
var t;
|
867
|
-
let n = new ve();
|
868
|
-
var r;
|
869
|
-
for (let s of this.traverse())
|
870
|
-
n.addTreeNode(s.scopeRef, (r = (t = s.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && r !== void 0 ? r : null, s.nodeToRestore);
|
871
|
-
return n;
|
872
|
-
}
|
873
|
-
constructor() {
|
874
|
-
this.fastMap = /* @__PURE__ */ new Map(), this.root = new xe({
|
875
|
-
scopeRef: null
|
876
|
-
}), this.fastMap.set(null, this.root);
|
877
|
-
}
|
704
|
+
e.pointerType === "touch" && me();
|
878
705
|
}
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
this.children.delete(t), t.parent = void 0;
|
885
|
-
}
|
886
|
-
constructor(t) {
|
887
|
-
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
|
888
|
-
}
|
889
|
-
}
|
890
|
-
new ve();
|
891
|
-
let Mt = /* @__PURE__ */ de.createContext(null);
|
892
|
-
function At(e) {
|
893
|
-
let t = De(Mt) || {};
|
894
|
-
Me(t, e);
|
895
|
-
let { ref: n, ...r } = t;
|
896
|
-
return r;
|
706
|
+
function Lt() {
|
707
|
+
if (!(typeof document > "u"))
|
708
|
+
return typeof PointerEvent < "u" ? document.addEventListener("pointerup", Pe) : document.addEventListener("touchend", me), ue++, () => {
|
709
|
+
ue--, !(ue > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", Pe) : document.removeEventListener("touchend", me));
|
710
|
+
};
|
897
711
|
}
|
898
|
-
function
|
899
|
-
let {
|
900
|
-
|
901
|
-
|
712
|
+
function Ct(e) {
|
713
|
+
let { onHoverStart: t, onHoverChange: r, onHoverEnd: o, isDisabled: i } = e, [d, u] = Oe(!1), p = re({
|
714
|
+
isHovered: !1,
|
715
|
+
ignoreEmulatedMouseEvents: !1,
|
716
|
+
pointerType: "",
|
717
|
+
target: null
|
718
|
+
}).current;
|
719
|
+
ee(Lt, []);
|
720
|
+
let { hoverProps: b, triggerHoverEnd: E } = De(() => {
|
721
|
+
let v = (m, P) => {
|
722
|
+
if (p.pointerType = P, i || P === "touch" || p.isHovered || !m.currentTarget.contains(m.target))
|
723
|
+
return;
|
724
|
+
p.isHovered = !0;
|
725
|
+
let k = m.currentTarget;
|
726
|
+
p.target = k, t && t({
|
727
|
+
type: "hoverstart",
|
728
|
+
target: k,
|
729
|
+
pointerType: P
|
730
|
+
}), r && r(!0), u(!0);
|
731
|
+
}, C = (m, P) => {
|
732
|
+
if (p.pointerType = "", p.target = null, P === "touch" || !p.isHovered)
|
733
|
+
return;
|
734
|
+
p.isHovered = !1;
|
735
|
+
let k = m.currentTarget;
|
736
|
+
o && o({
|
737
|
+
type: "hoverend",
|
738
|
+
target: k,
|
739
|
+
pointerType: P
|
740
|
+
}), r && r(!1), u(!1);
|
741
|
+
}, x = {};
|
742
|
+
return typeof PointerEvent < "u" ? (x.onPointerEnter = (m) => {
|
743
|
+
ne && m.pointerType === "mouse" || v(m, m.pointerType);
|
744
|
+
}, x.onPointerLeave = (m) => {
|
745
|
+
!i && m.currentTarget.contains(m.target) && C(m, m.pointerType);
|
746
|
+
}) : (x.onTouchStart = () => {
|
747
|
+
p.ignoreEmulatedMouseEvents = !0;
|
748
|
+
}, x.onMouseEnter = (m) => {
|
749
|
+
!p.ignoreEmulatedMouseEvents && !ne && v(m, "mouse"), p.ignoreEmulatedMouseEvents = !1;
|
750
|
+
}, x.onMouseLeave = (m) => {
|
751
|
+
!i && m.currentTarget.contains(m.target) && C(m, "mouse");
|
752
|
+
}), {
|
753
|
+
hoverProps: x,
|
754
|
+
triggerHoverEnd: C
|
755
|
+
};
|
756
|
+
}, [
|
757
|
+
t,
|
758
|
+
r,
|
759
|
+
o,
|
760
|
+
i,
|
761
|
+
p
|
762
|
+
]);
|
763
|
+
return ee(() => {
|
764
|
+
i && E({
|
765
|
+
currentTarget: p.target
|
766
|
+
}, p.pointerType);
|
902
767
|
}, [
|
903
|
-
|
768
|
+
i
|
904
769
|
]), {
|
905
|
-
|
906
|
-
|
907
|
-
tabIndex: e.excludeFromTabOrder && !e.isDisabled ? -1 : void 0
|
908
|
-
}, u)
|
770
|
+
hoverProps: b,
|
771
|
+
isHovered: d
|
909
772
|
};
|
910
773
|
}
|
911
|
-
function
|
774
|
+
function _t(e, t) {
|
912
775
|
let {
|
913
|
-
elementType:
|
914
|
-
isDisabled:
|
915
|
-
onPress:
|
916
|
-
onPressStart:
|
776
|
+
elementType: r = "button",
|
777
|
+
isDisabled: o,
|
778
|
+
onPress: i,
|
779
|
+
onPressStart: d,
|
917
780
|
onPressEnd: u,
|
918
|
-
onPressUp:
|
919
|
-
onPressChange:
|
920
|
-
preventFocusOnPress:
|
921
|
-
allowFocusWhenDisabled:
|
922
|
-
onClick:
|
923
|
-
href:
|
924
|
-
target:
|
925
|
-
rel:
|
926
|
-
type:
|
927
|
-
} = e,
|
928
|
-
|
929
|
-
type:
|
930
|
-
disabled:
|
931
|
-
} :
|
781
|
+
onPressUp: p,
|
782
|
+
onPressChange: b,
|
783
|
+
preventFocusOnPress: E,
|
784
|
+
allowFocusWhenDisabled: v,
|
785
|
+
onClick: C,
|
786
|
+
href: x,
|
787
|
+
target: m,
|
788
|
+
rel: P,
|
789
|
+
type: k = "button"
|
790
|
+
} = e, T;
|
791
|
+
r === "button" ? T = {
|
792
|
+
type: k,
|
793
|
+
disabled: o
|
794
|
+
} : T = {
|
932
795
|
role: "button",
|
933
|
-
tabIndex:
|
934
|
-
href:
|
935
|
-
target:
|
936
|
-
type:
|
937
|
-
disabled:
|
938
|
-
"aria-disabled": !
|
939
|
-
rel:
|
796
|
+
tabIndex: o ? void 0 : 0,
|
797
|
+
href: r === "a" && o ? void 0 : x,
|
798
|
+
target: r === "a" ? m : void 0,
|
799
|
+
type: r === "input" ? k : void 0,
|
800
|
+
disabled: r === "input" ? o : void 0,
|
801
|
+
"aria-disabled": !o || r === "input" ? void 0 : o,
|
802
|
+
rel: r === "a" ? P : void 0
|
940
803
|
};
|
941
|
-
let { pressProps: N, isPressed:
|
942
|
-
onPressStart:
|
804
|
+
let { pressProps: N, isPressed: B } = Tt({
|
805
|
+
onPressStart: d,
|
943
806
|
onPressEnd: u,
|
944
|
-
onPressChange:
|
945
|
-
onPress:
|
946
|
-
onPressUp:
|
947
|
-
isDisabled:
|
948
|
-
preventFocusOnPress:
|
807
|
+
onPressChange: b,
|
808
|
+
onPress: i,
|
809
|
+
onPressUp: p,
|
810
|
+
isDisabled: o,
|
811
|
+
preventFocusOnPress: E,
|
949
812
|
ref: t
|
950
|
-
}), { focusableProps:
|
951
|
-
|
952
|
-
let
|
813
|
+
}), { focusableProps: $ } = Qe(e, t);
|
814
|
+
v && ($.tabIndex = o ? -1 : $.tabIndex);
|
815
|
+
let L = W($, N, it(e, {
|
953
816
|
labelable: !0
|
954
817
|
}));
|
955
818
|
return {
|
956
|
-
isPressed:
|
957
|
-
buttonProps:
|
819
|
+
isPressed: B,
|
820
|
+
buttonProps: W(T, L, {
|
958
821
|
"aria-haspopup": e["aria-haspopup"],
|
959
822
|
"aria-expanded": e["aria-expanded"],
|
960
823
|
"aria-controls": e["aria-controls"],
|
961
824
|
"aria-pressed": e["aria-pressed"],
|
962
|
-
onClick: (
|
963
|
-
|
825
|
+
onClick: (O) => {
|
826
|
+
C && (C(O), console.warn("onClick is deprecated, please use onPress"));
|
964
827
|
}
|
965
828
|
})
|
966
829
|
};
|
967
830
|
}
|
968
|
-
function
|
831
|
+
function Kt(e, t, r) {
|
969
832
|
return t in e ? Object.defineProperty(e, t, {
|
970
|
-
value:
|
833
|
+
value: r,
|
971
834
|
enumerable: !0,
|
972
835
|
configurable: !0,
|
973
836
|
writable: !0
|
974
|
-
}) : e[t] =
|
837
|
+
}) : e[t] = r, e;
|
975
838
|
}
|
976
|
-
function
|
977
|
-
var
|
839
|
+
function xe(e, t) {
|
840
|
+
var r = Object.keys(e);
|
978
841
|
if (Object.getOwnPropertySymbols) {
|
979
|
-
var
|
980
|
-
t && (
|
981
|
-
return Object.getOwnPropertyDescriptor(e,
|
982
|
-
})),
|
842
|
+
var o = Object.getOwnPropertySymbols(e);
|
843
|
+
t && (o = o.filter(function(i) {
|
844
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
845
|
+
})), r.push.apply(r, o);
|
983
846
|
}
|
984
|
-
return
|
847
|
+
return r;
|
985
848
|
}
|
986
|
-
function
|
849
|
+
function Se(e) {
|
987
850
|
for (var t = 1; t < arguments.length; t++) {
|
988
|
-
var
|
989
|
-
t % 2 ?
|
990
|
-
|
991
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
992
|
-
Object.defineProperty(e,
|
851
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
852
|
+
t % 2 ? xe(Object(r), !0).forEach(function(o) {
|
853
|
+
Kt(e, o, r[o]);
|
854
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : xe(Object(r)).forEach(function(o) {
|
855
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(r, o));
|
993
856
|
});
|
994
857
|
}
|
995
858
|
return e;
|
996
859
|
}
|
997
|
-
var
|
998
|
-
for (var
|
999
|
-
var
|
1000
|
-
if (e[
|
860
|
+
var It = (e, t, r) => {
|
861
|
+
for (var o of Object.keys(e)) {
|
862
|
+
var i;
|
863
|
+
if (e[o] !== ((i = t[o]) !== null && i !== void 0 ? i : r[o]))
|
1001
864
|
return !1;
|
1002
865
|
}
|
1003
866
|
return !0;
|
1004
|
-
},
|
1005
|
-
var
|
1006
|
-
for (var
|
1007
|
-
var
|
867
|
+
}, se = (e) => (t) => {
|
868
|
+
var r = e.defaultClassName, o = Se(Se({}, e.defaultVariants), t);
|
869
|
+
for (var i in o) {
|
870
|
+
var d, u = (d = o[i]) !== null && d !== void 0 ? d : e.defaultVariants[i];
|
1008
871
|
if (u != null) {
|
1009
|
-
var
|
1010
|
-
typeof
|
1011
|
-
var
|
1012
|
-
|
872
|
+
var p = u;
|
873
|
+
typeof p == "boolean" && (p = p === !0 ? "true" : "false");
|
874
|
+
var b = e.variantClassNames[i][p];
|
875
|
+
b && (r += " " + b);
|
1013
876
|
}
|
1014
877
|
}
|
1015
|
-
for (var [
|
1016
|
-
|
1017
|
-
return
|
1018
|
-
},
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
)));
|
1084
|
-
}
|
1085
|
-
);
|
1086
|
-
Qe.set(He, {
|
878
|
+
for (var [E, v] of e.compoundVariants)
|
879
|
+
It(E, o, e.defaultVariants) && (r += " " + v);
|
880
|
+
return r;
|
881
|
+
}, At = se({ defaultClassName: "_125pcxy0", variantClassNames: { disabled: { true: "_125pcxy1", false: "_125pcxy2" }, kind: { default: "_125pcxy3", link: "_125pcxy4", confirm: "_125pcxy5", delete: "_125pcxy6", key: "_125pcxy7", icon: "_125pcxy8" }, spinning: { true: "_125pcxy9", false: "_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "_125pcxyb"], [{ kind: "default", spinning: !0 }, "_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "_125pcxyd"], [{ kind: "delete", spinning: !0 }, "_125pcxye"], [{ kind: "key", spinning: !0 }, "_125pcxyf"], [{ disabled: !0, spinning: !1 }, "_125pcxyg"]] }), Mt = se({ defaultClassName: "_125pcxyh", variantClassNames: { disabled: { true: "_125pcxyi", false: "_125pcxyj" }, kind: { icon: "_125pcxyk", default: "_125pcxyl", delete: "_125pcxym", key: "_125pcxyn", confirm: "_125pcxyo", link: "_125pcxyp" }, spinning: { true: "_125pcxyq", false: "_125pcxyr" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), Ft = "_125pcxyv", Ut = se({ defaultClassName: "_125pcxyw", variantClassNames: { spinning: { true: "_125pcxyx", false: "_125pcxyy" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), Ht = se({ defaultClassName: "_125pcxys", variantClassNames: { spinning: { true: "_125pcxyt", false: "_125pcxyu" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
|
882
|
+
function Rt({
|
883
|
+
as: e,
|
884
|
+
onClick: t,
|
885
|
+
onPress: r,
|
886
|
+
children: o,
|
887
|
+
className: i,
|
888
|
+
isDisabled: d,
|
889
|
+
disabled: u,
|
890
|
+
href: p,
|
891
|
+
icon: b,
|
892
|
+
kind: E = "default",
|
893
|
+
spinning: v,
|
894
|
+
spinningTitle: C,
|
895
|
+
title: x,
|
896
|
+
...m
|
897
|
+
}, P) {
|
898
|
+
var g;
|
899
|
+
const k = e != null ? e : p ? "a" : "button", T = {
|
900
|
+
onPress: r != null ? r : t,
|
901
|
+
isDisabled: (g = u != null ? u : d) != null ? g : v,
|
902
|
+
...m
|
903
|
+
}, { "data-testid": N } = m, B = P || c.useRef(null), { buttonProps: $ } = _t(T, B), { hoverProps: L } = Ct({ isDisabled: T.isDisabled }), { type: O, ...I } = $, ie = {
|
904
|
+
...W(I, L),
|
905
|
+
ref: B,
|
906
|
+
title: x,
|
907
|
+
className: p ? Ht({ spinning: v }) : Mt({ disabled: d || u, kind: E, spinning: v }),
|
908
|
+
...p ? { href: p } : { type: O }
|
909
|
+
}, { t: n } = c.useContext(ze), f = b && /* @__PURE__ */ c.createElement(
|
910
|
+
Je,
|
911
|
+
{
|
912
|
+
className: Ft,
|
913
|
+
icon: b,
|
914
|
+
"aria-hidden": "true",
|
915
|
+
"data-testid": `${N}__${b}-icon`
|
916
|
+
}
|
917
|
+
);
|
918
|
+
let w;
|
919
|
+
E === "default" || E === "icon" || E === "link" ? w = "dark" : w = "light";
|
920
|
+
const l = v && /* @__PURE__ */ c.createElement(
|
921
|
+
Xe,
|
922
|
+
{
|
923
|
+
color: w,
|
924
|
+
className: Ut({ spinning: v }),
|
925
|
+
title: C || n("design-system:button.spinningTitle"),
|
926
|
+
"data-testid": `${N}__spinner`
|
927
|
+
}
|
928
|
+
);
|
929
|
+
return /* @__PURE__ */ c.createElement(Ze, null, /* @__PURE__ */ c.createElement(
|
930
|
+
"div",
|
931
|
+
{
|
932
|
+
className: qe(
|
933
|
+
At({
|
934
|
+
disabled: d || u,
|
935
|
+
kind: E,
|
936
|
+
spinning: v
|
937
|
+
}),
|
938
|
+
i
|
939
|
+
)
|
940
|
+
},
|
941
|
+
/* @__PURE__ */ c.createElement(k, { ...ie }, f, o ? /* @__PURE__ */ c.createElement("span", null, o) : "", l)
|
942
|
+
));
|
943
|
+
}
|
944
|
+
const We = c.forwardRef(Rt);
|
945
|
+
Ye.set(We, {
|
1087
946
|
name: "Button",
|
1088
947
|
props: {
|
1089
948
|
disabled: "boolean",
|
@@ -1099,17 +958,17 @@ Qe.set(He, {
|
|
1099
958
|
},
|
1100
959
|
panellable: !0
|
1101
960
|
});
|
1102
|
-
const
|
1103
|
-
components: [
|
1104
|
-
description: () => /* @__PURE__ */
|
961
|
+
const Gt = {
|
962
|
+
components: [We],
|
963
|
+
description: () => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, "Buttons are used to initiate events or actions. The labels and/or icons describe what the button will do."), /* @__PURE__ */ c.createElement("br", null), /* @__PURE__ */ c.createElement("h5", null, "Variants"), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Default: "), "For tertiary actions or actions of lower importance on a page."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Key: "), "For primary or important actions on a page."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Confirm: "), "For the main call to action on a page. There should only be one Confirm button per screen."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Delete: "), "For deleting information or another destructive action. These should always be paired with a Delete Confirmation Modal."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Disabled: "), "For actions that are not permitted in a particular state. These can be accompanied by a Tooltip on hover describing why it\u2019s disabled."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "With an Icon: "), "For further illustrating the action. Example: Pencil icon in an Edit button. There can also be Icon Buttons without text.")),
|
1105
964
|
examples: {
|
1106
965
|
basic: {
|
1107
966
|
label: "Basic Buttons",
|
1108
|
-
description: ({ NavigateTo: e }) => /* @__PURE__ */
|
967
|
+
description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("p", null, "The most common type of button that can be used in most cases. Example: Basic Buttons in a ", /* @__PURE__ */ c.createElement(e, { to: "modals" }, "Modal"), ".")),
|
1109
968
|
examples: {
|
1110
969
|
withoutIcons: {
|
1111
970
|
description: "Without Icons",
|
1112
|
-
react:
|
971
|
+
react: y`
|
1113
972
|
import { Button } from "@sps-woodland/buttons";
|
1114
973
|
import { sprinkles } from "@sps-woodland/tokens";
|
1115
974
|
|
@@ -1128,7 +987,7 @@ const zt = {
|
|
1128
987
|
},
|
1129
988
|
withIcons: {
|
1130
989
|
description: "With Icons",
|
1131
|
-
react:
|
990
|
+
react: y`
|
1132
991
|
import { Button } from "@sps-woodland/buttons";
|
1133
992
|
import { sprinkles } from "@sps-woodland/tokens";
|
1134
993
|
|
@@ -1147,7 +1006,7 @@ const zt = {
|
|
1147
1006
|
},
|
1148
1007
|
spinning: {
|
1149
1008
|
description: "Spinning",
|
1150
|
-
react:
|
1009
|
+
react: y`
|
1151
1010
|
import { Button } from "@sps-woodland/buttons";
|
1152
1011
|
import { sprinkles } from "@sps-woodland/tokens";
|
1153
1012
|
|
@@ -1171,7 +1030,7 @@ const zt = {
|
|
1171
1030
|
examples: {
|
1172
1031
|
withoutIcons: {
|
1173
1032
|
description: "Without Icons",
|
1174
|
-
react:
|
1033
|
+
react: y`
|
1175
1034
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1176
1035
|
|
1177
1036
|
function Component() {
|
@@ -1213,7 +1072,7 @@ const zt = {
|
|
1213
1072
|
},
|
1214
1073
|
withIcons: {
|
1215
1074
|
description: "With Icons",
|
1216
|
-
react:
|
1075
|
+
react: y`
|
1217
1076
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1218
1077
|
|
1219
1078
|
function Component() {
|
@@ -1260,7 +1119,7 @@ const zt = {
|
|
1260
1119
|
},
|
1261
1120
|
spinning: {
|
1262
1121
|
description: "Spinning",
|
1263
|
-
react:
|
1122
|
+
react: y`
|
1264
1123
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1265
1124
|
|
1266
1125
|
function Component() {
|
@@ -1306,7 +1165,7 @@ const zt = {
|
|
1306
1165
|
examples: {
|
1307
1166
|
withoutIcons: {
|
1308
1167
|
description: "Without Icons",
|
1309
|
-
react:
|
1168
|
+
react: y`
|
1310
1169
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
1311
1170
|
|
1312
1171
|
function Component() {
|
@@ -1336,7 +1195,7 @@ const zt = {
|
|
1336
1195
|
},
|
1337
1196
|
withIcons: {
|
1338
1197
|
description: "With Icons",
|
1339
|
-
react:
|
1198
|
+
react: y`
|
1340
1199
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
1341
1200
|
|
1342
1201
|
function Component() {
|
@@ -1380,11 +1239,11 @@ const zt = {
|
|
1380
1239
|
},
|
1381
1240
|
iconButtons: {
|
1382
1241
|
label: "Icon Buttons",
|
1383
|
-
description: ({ NavigateTo: e, Link: t }) => /* @__PURE__ */
|
1242
|
+
description: ({ NavigateTo: e, Link: t }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("p", null, "Use these for quick actions that can clearly be articulated by the use of an icon. Example: A Print button in the", " ", /* @__PURE__ */ c.createElement(e, { to: "list-action-bar" }, "List Action Bar"), ". Do not use an icon that doesn't have a universally understood meaning; instead use a Basic Button or a Basic Button with an icon. ", /* @__PURE__ */ c.createElement(t, { to: "/style-and-layout/icons/" }, "View All Icons"))),
|
1384
1243
|
examples: {
|
1385
1244
|
standard: {
|
1386
1245
|
description: "Standard Icon Buttons",
|
1387
|
-
react:
|
1246
|
+
react: y`
|
1388
1247
|
import { Button } from "@sps-woodland/buttons";
|
1389
1248
|
import { sprinkles } from "@sps-woodland/tokens";
|
1390
1249
|
|
@@ -1406,8 +1265,8 @@ const zt = {
|
|
1406
1265
|
`
|
1407
1266
|
},
|
1408
1267
|
dropdown: {
|
1409
|
-
description: ({ NavigateTo: e }) => /* @__PURE__ */
|
1410
|
-
react:
|
1268
|
+
description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("h5", null, "Dropdown Icon Buttons"), /* @__PURE__ */ c.createElement("p", null, "Use these when there are several options available for action. Example: Dropdown Icon Button in a ", /* @__PURE__ */ c.createElement(e, { to: "content-rows" }, "Content Row"), ".")),
|
1269
|
+
react: y`
|
1411
1270
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1412
1271
|
|
1413
1272
|
function Component() {
|
@@ -1425,7 +1284,7 @@ const zt = {
|
|
1425
1284
|
},
|
1426
1285
|
spinner: {
|
1427
1286
|
description: "Spinner",
|
1428
|
-
react:
|
1287
|
+
react: y`
|
1429
1288
|
import { Button } from "@sps-woodland/buttons";
|
1430
1289
|
|
1431
1290
|
function Component() {
|
@@ -1441,11 +1300,11 @@ const zt = {
|
|
1441
1300
|
},
|
1442
1301
|
textButtons: {
|
1443
1302
|
label: "Text Buttons",
|
1444
|
-
description: ({ NavigateTo: e }) => /* @__PURE__ */
|
1303
|
+
description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement("p", null, "Use for less important actions, or ones that aren't taken as frequently. They should not appear inline with other copy. Example: Advanced Search button in the", " ", /* @__PURE__ */ c.createElement(e, { to: "list-toolbar" }, "List Toolbar")),
|
1445
1304
|
examples: {
|
1446
1305
|
withoutIcons: {
|
1447
1306
|
description: "Without Icons",
|
1448
|
-
react:
|
1307
|
+
react: y`
|
1449
1308
|
import { Button } from "@sps-woodland/buttons";
|
1450
1309
|
import { sprinkles } from "@sps-woodland/tokens";
|
1451
1310
|
|
@@ -1462,7 +1321,7 @@ const zt = {
|
|
1462
1321
|
},
|
1463
1322
|
withIcons: {
|
1464
1323
|
description: "With Icons",
|
1465
|
-
react:
|
1324
|
+
react: y`
|
1466
1325
|
import { Button } from "@sps-woodland/buttons";
|
1467
1326
|
import { sprinkles } from "@sps-woodland/tokens";
|
1468
1327
|
|
@@ -1479,7 +1338,7 @@ const zt = {
|
|
1479
1338
|
},
|
1480
1339
|
spinner: {
|
1481
1340
|
description: "Spinner",
|
1482
|
-
react:
|
1341
|
+
react: y`
|
1483
1342
|
import { Button } from "@sps-woodland/buttons";
|
1484
1343
|
|
1485
1344
|
function Component() {
|
@@ -1495,10 +1354,10 @@ const zt = {
|
|
1495
1354
|
},
|
1496
1355
|
submitButtons: {
|
1497
1356
|
label: "Submit Buttons",
|
1498
|
-
description: ({ NavigateTo: e }) => /* @__PURE__ */
|
1357
|
+
description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement("p", null, "Use to submit a form. There can be a number of visual variations, for example a", " ", /* @__PURE__ */ c.createElement(e, { to: "modals" }, "Modal"), " uses Basic Button (Key) as its Submit Button."),
|
1499
1358
|
examples: {
|
1500
1359
|
basic: {
|
1501
|
-
react:
|
1360
|
+
react: y`
|
1502
1361
|
import { Button } from "@sps-woodland/buttons";
|
1503
1362
|
import { sprinkles } from "@sps-woodland/tokens";
|
1504
1363
|
|
@@ -1526,7 +1385,7 @@ const zt = {
|
|
1526
1385
|
description: "Used to link to another page, such as an external website. They may open in the same window or in a new one. It should only be used when a Text Button doesn't provide enough visual emphasis.",
|
1527
1386
|
examples: {
|
1528
1387
|
basic: {
|
1529
|
-
react:
|
1388
|
+
react: y`
|
1530
1389
|
import { Button } from "@sps-woodland/buttons";
|
1531
1390
|
|
1532
1391
|
function Component() {
|
@@ -1544,11 +1403,11 @@ const zt = {
|
|
1544
1403
|
},
|
1545
1404
|
buttonGroups: {
|
1546
1405
|
label: "Button Groups",
|
1547
|
-
description: ({ NavigateTo: e }) => /* @__PURE__ */
|
1406
|
+
description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement("p", null, "Use button groups when there are a number of actions that can be taken in a view. When there are multiple button types in a group, they are separated using dividers. Example: Button groups in ", /* @__PURE__ */ c.createElement(e, { to: "List Action Bar" }, "List Action Bar"), "."),
|
1548
1407
|
examples: {
|
1549
1408
|
basic: {
|
1550
1409
|
description: "Basic Button Groups",
|
1551
|
-
react:
|
1410
|
+
react: y`
|
1552
1411
|
import { Button } from "@sps-woodland/buttons";
|
1553
1412
|
import { sprinkles } from "@sps-woodland/tokens";
|
1554
1413
|
|
@@ -1564,7 +1423,7 @@ const zt = {
|
|
1564
1423
|
},
|
1565
1424
|
icon: {
|
1566
1425
|
description: "Icon Button Groups",
|
1567
|
-
react:
|
1426
|
+
react: y`
|
1568
1427
|
import { Button } from "@sps-woodland/buttons";
|
1569
1428
|
|
1570
1429
|
function Component() {
|
@@ -1579,7 +1438,7 @@ const zt = {
|
|
1579
1438
|
},
|
1580
1439
|
textAndIcons: {
|
1581
1440
|
description: "Text Buttons + Icon Buttons Group",
|
1582
|
-
react:
|
1441
|
+
react: y`
|
1583
1442
|
import { Button } from "@sps-woodland/buttons";
|
1584
1443
|
import { sprinkles } from "@sps-woodland/tokens";
|
1585
1444
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1598,7 +1457,7 @@ const zt = {
|
|
1598
1457
|
},
|
1599
1458
|
textAndBasic: {
|
1600
1459
|
description: "Text Buttons + Basic Buttons Group",
|
1601
|
-
react:
|
1460
|
+
react: y`
|
1602
1461
|
import { Button } from "@sps-woodland/buttons";
|
1603
1462
|
import { sprinkles } from "@sps-woodland/tokens";
|
1604
1463
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1618,7 +1477,7 @@ const zt = {
|
|
1618
1477
|
},
|
1619
1478
|
iconsAndBasic: {
|
1620
1479
|
description: "Icon Buttons + Basic Buttons Group",
|
1621
|
-
react:
|
1480
|
+
react: y`
|
1622
1481
|
import { Button } from "@sps-woodland/buttons";
|
1623
1482
|
import { sprinkles } from "@sps-woodland/tokens";
|
1624
1483
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1639,7 +1498,7 @@ const zt = {
|
|
1639
1498
|
},
|
1640
1499
|
textIconsAndBasic: {
|
1641
1500
|
description: "Text Buttons + Icon Buttons + Basic Buttons Group",
|
1642
|
-
react:
|
1501
|
+
react: y`
|
1643
1502
|
import { Button } from "@sps-woodland/buttons";
|
1644
1503
|
import { sprinkles } from "@sps-woodland/tokens";
|
1645
1504
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1663,10 +1522,10 @@ const zt = {
|
|
1663
1522
|
}
|
1664
1523
|
}
|
1665
1524
|
}
|
1666
|
-
},
|
1667
|
-
Buttons:
|
1525
|
+
}, zt = {
|
1526
|
+
Buttons: Gt
|
1668
1527
|
};
|
1669
1528
|
export {
|
1670
|
-
|
1671
|
-
|
1529
|
+
We as Button,
|
1530
|
+
zt as MANIFEST
|
1672
1531
|
};
|