@sps-woodland/buttons 8.0.1 → 8.0.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/index.cjs.js +23 -23
- package/lib/index.es.js +771 -713
- package/package.json +19 -6
package/lib/index.es.js
CHANGED
@@ -1,281 +1,635 @@
|
|
1
1
|
import * as d from "react";
|
2
|
-
import
|
3
|
-
import { I18nContext as
|
4
|
-
import { code as
|
5
|
-
function
|
6
|
-
var t, n,
|
2
|
+
import ce, { useRef as H, useCallback as K, useEffect as ue, useState as Ve, useMemo as Ge, useContext as De } from "react";
|
3
|
+
import { I18nContext as We, Icon as He, Spinner as je, cl as ze, Metadata as Ye } from "@sps-woodland/core";
|
4
|
+
import { code as g } from "@spscommerce/utils";
|
5
|
+
function Oe(e) {
|
6
|
+
var t, n, o = "";
|
7
7
|
if (typeof e == "string" || typeof e == "number")
|
8
|
-
|
8
|
+
o += e;
|
9
9
|
else if (typeof e == "object")
|
10
10
|
if (Array.isArray(e))
|
11
11
|
for (t = 0; t < e.length; t++)
|
12
|
-
e[t] && (n =
|
12
|
+
e[t] && (n = Oe(e[t])) && (o && (o += " "), o += n);
|
13
13
|
else
|
14
14
|
for (t in e)
|
15
|
-
e[t] && (
|
16
|
-
return
|
15
|
+
e[t] && (o && (o += " "), o += t);
|
16
|
+
return o;
|
17
17
|
}
|
18
|
-
function
|
19
|
-
for (var e, t, n = 0,
|
20
|
-
(e = arguments[n++]) && (t =
|
21
|
-
return
|
18
|
+
function Xe() {
|
19
|
+
for (var e, t, n = 0, o = ""; n < arguments.length; )
|
20
|
+
(e = arguments[n++]) && (t = Oe(e)) && (o && (o += " "), o += t);
|
21
|
+
return o;
|
22
22
|
}
|
23
|
-
typeof
|
24
|
-
|
25
|
-
function
|
23
|
+
const de = typeof document < "u" ? ce.useLayoutEffect : () => {
|
24
|
+
};
|
25
|
+
function M(e) {
|
26
|
+
const t = H(null);
|
27
|
+
return de(() => {
|
28
|
+
t.current = e;
|
29
|
+
}, [
|
30
|
+
e
|
31
|
+
]), K((...n) => {
|
32
|
+
const o = t.current;
|
33
|
+
return o(...n);
|
34
|
+
}, []);
|
35
|
+
}
|
36
|
+
let ge = /* @__PURE__ */ new Map();
|
37
|
+
function qe(e, t) {
|
26
38
|
if (e === t)
|
27
39
|
return e;
|
28
|
-
let n =
|
40
|
+
let n = ge.get(e);
|
29
41
|
if (n)
|
30
42
|
return n(t), t;
|
31
|
-
let
|
32
|
-
return
|
43
|
+
let o = ge.get(t);
|
44
|
+
return o ? (o(e), e) : t;
|
33
45
|
}
|
34
|
-
function
|
46
|
+
function Je(...e) {
|
35
47
|
return (...t) => {
|
36
48
|
for (let n of e)
|
37
49
|
typeof n == "function" && n(...t);
|
38
50
|
};
|
39
51
|
}
|
40
|
-
|
52
|
+
const N = (e) => {
|
53
|
+
var t;
|
54
|
+
return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
|
55
|
+
}, oe = (e) => e && "window" in e && e.window === e ? e : N(e).defaultView || window;
|
56
|
+
function U(...e) {
|
41
57
|
let t = {
|
42
58
|
...e[0]
|
43
59
|
};
|
44
60
|
for (let n = 1; n < e.length; n++) {
|
45
|
-
let
|
46
|
-
for (let s in
|
47
|
-
let
|
48
|
-
typeof
|
61
|
+
let o = e[n];
|
62
|
+
for (let s in o) {
|
63
|
+
let u = t[s], c = o[s];
|
64
|
+
typeof u == "function" && typeof c == "function" && s[0] === "o" && s[1] === "n" && s.charCodeAt(2) >= 65 && s.charCodeAt(2) <= 90 ? t[s] = Je(u, c) : (s === "className" || s === "UNSAFE_className") && typeof u == "string" && typeof c == "string" ? t[s] = Xe(u, c) : s === "id" && u && c ? t.id = qe(u, c) : t[s] = c !== void 0 ? c : u;
|
49
65
|
}
|
50
66
|
}
|
51
67
|
return t;
|
52
68
|
}
|
53
|
-
const
|
69
|
+
const Qe = /* @__PURE__ */ new Set([
|
54
70
|
"id"
|
55
|
-
]),
|
71
|
+
]), Ze = /* @__PURE__ */ new Set([
|
56
72
|
"aria-label",
|
57
73
|
"aria-labelledby",
|
58
74
|
"aria-describedby",
|
59
75
|
"aria-details"
|
60
|
-
]),
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
function
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
if (!!r && (r.delete(n.propertyName), r.size === 0 && (n.target.removeEventListener("transitioncancel", t), G.delete(n.target)), G.size === 0)) {
|
77
|
-
for (let s of be)
|
78
|
-
s();
|
79
|
-
be.clear();
|
80
|
-
}
|
81
|
-
};
|
82
|
-
document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
|
83
|
-
}
|
84
|
-
typeof document < "u" && (document.readyState !== "loading" ? ge() : document.addEventListener("DOMContentLoaded", ge));
|
85
|
-
const st = typeof window < "u" ? U.useLayoutEffect : () => {
|
86
|
-
};
|
87
|
-
let ye = /* @__PURE__ */ new Map();
|
88
|
-
function at(e, t) {
|
89
|
-
if (e === t)
|
90
|
-
return e;
|
91
|
-
let n = ye.get(e);
|
92
|
-
if (n)
|
93
|
-
return n(t), t;
|
94
|
-
let r = ye.get(t);
|
95
|
-
return r ? (r(e), e) : t;
|
96
|
-
}
|
97
|
-
function it(...e) {
|
98
|
-
return (...t) => {
|
99
|
-
for (let n of e)
|
100
|
-
typeof n == "function" && n(...t);
|
101
|
-
};
|
102
|
-
}
|
103
|
-
function Q(...e) {
|
104
|
-
let t = {
|
105
|
-
...e[0]
|
106
|
-
};
|
107
|
-
for (let n = 1; n < e.length; n++) {
|
108
|
-
let r = e[n];
|
109
|
-
for (let s in r) {
|
110
|
-
let l = t[s], u = r[s];
|
111
|
-
typeof l == "function" && typeof u == "function" && s[0] === "o" && s[1] === "n" && s.charCodeAt(2) >= 65 && s.charCodeAt(2) <= 90 ? t[s] = it(l, u) : (s === "className" || s === "UNSAFE_className") && typeof l == "string" && typeof u == "string" ? t[s] = Me(l, u) : s === "id" && l && u ? t.id = at(l, u) : t[s] = u !== void 0 ? u : l;
|
112
|
-
}
|
113
|
-
}
|
114
|
-
return t;
|
115
|
-
}
|
116
|
-
function F(e) {
|
117
|
-
if (lt())
|
76
|
+
]), et = /* @__PURE__ */ new Set([
|
77
|
+
"href",
|
78
|
+
"target",
|
79
|
+
"rel",
|
80
|
+
"download",
|
81
|
+
"ping",
|
82
|
+
"referrerPolicy"
|
83
|
+
]), tt = /^(data-.*)$/;
|
84
|
+
function nt(e, t = {}) {
|
85
|
+
let { labelable: n, isLink: o, propNames: s } = t, u = {};
|
86
|
+
for (const c in e)
|
87
|
+
Object.prototype.hasOwnProperty.call(e, c) && (Qe.has(c) || n && Ze.has(c) || o && et.has(c) || (s == null ? void 0 : s.has(c)) || tt.test(c)) && (u[c] = e[c]);
|
88
|
+
return u;
|
89
|
+
}
|
90
|
+
function _(e) {
|
91
|
+
if (rt())
|
118
92
|
e.focus({
|
119
93
|
preventScroll: !0
|
120
94
|
});
|
121
95
|
else {
|
122
|
-
let t =
|
123
|
-
e.focus(),
|
96
|
+
let t = ot(e);
|
97
|
+
e.focus(), st(t);
|
124
98
|
}
|
125
99
|
}
|
126
|
-
let
|
127
|
-
function
|
128
|
-
if (
|
129
|
-
|
100
|
+
let X = null;
|
101
|
+
function rt() {
|
102
|
+
if (X == null) {
|
103
|
+
X = !1;
|
130
104
|
try {
|
131
105
|
var e = document.createElement("div");
|
132
106
|
e.focus({
|
133
107
|
get preventScroll() {
|
134
|
-
return
|
108
|
+
return X = !0, !0;
|
135
109
|
}
|
136
110
|
});
|
137
111
|
} catch {
|
138
112
|
}
|
139
113
|
}
|
140
|
-
return
|
114
|
+
return X;
|
141
115
|
}
|
142
|
-
function
|
143
|
-
for (var t = e.parentNode, n = [],
|
116
|
+
function ot(e) {
|
117
|
+
for (var t = e.parentNode, n = [], o = document.scrollingElement || document.documentElement; t instanceof HTMLElement && t !== o; )
|
144
118
|
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && n.push({
|
145
119
|
element: t,
|
146
120
|
scrollTop: t.scrollTop,
|
147
121
|
scrollLeft: t.scrollLeft
|
148
122
|
}), t = t.parentNode;
|
149
|
-
return
|
150
|
-
element:
|
151
|
-
scrollTop:
|
152
|
-
scrollLeft:
|
123
|
+
return o instanceof HTMLElement && n.push({
|
124
|
+
element: o,
|
125
|
+
scrollTop: o.scrollTop,
|
126
|
+
scrollLeft: o.scrollLeft
|
153
127
|
}), n;
|
154
128
|
}
|
155
|
-
function
|
156
|
-
for (let { element: t, scrollTop: n, scrollLeft:
|
157
|
-
t.scrollTop = n, t.scrollLeft =
|
129
|
+
function st(e) {
|
130
|
+
for (let { element: t, scrollTop: n, scrollLeft: o } of e)
|
131
|
+
t.scrollTop = n, t.scrollLeft = o;
|
132
|
+
}
|
133
|
+
function ee(e) {
|
134
|
+
var t;
|
135
|
+
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent);
|
136
|
+
}
|
137
|
+
function pe(e) {
|
138
|
+
var t;
|
139
|
+
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;
|
140
|
+
}
|
141
|
+
function G() {
|
142
|
+
return pe(/^Mac/i);
|
143
|
+
}
|
144
|
+
function at() {
|
145
|
+
return pe(/^iPhone/i);
|
146
|
+
}
|
147
|
+
function Ce() {
|
148
|
+
return pe(/^iPad/i) || G() && navigator.maxTouchPoints > 1;
|
149
|
+
}
|
150
|
+
function _e() {
|
151
|
+
return at() || Ce();
|
152
|
+
}
|
153
|
+
function it() {
|
154
|
+
return ee(/AppleWebKit/i) && !lt();
|
155
|
+
}
|
156
|
+
function lt() {
|
157
|
+
return ee(/Chrome/i);
|
158
|
+
}
|
159
|
+
function Ke() {
|
160
|
+
return ee(/Android/i);
|
161
|
+
}
|
162
|
+
function ct() {
|
163
|
+
return ee(/Firefox/i);
|
164
|
+
}
|
165
|
+
function W(e, t, n = !0) {
|
166
|
+
var o, s;
|
167
|
+
let { metaKey: u, ctrlKey: c, altKey: m, shiftKey: p } = t;
|
168
|
+
ct() && ((s = window.event) === null || s === void 0 || (o = s.type) === null || o === void 0 ? void 0 : o.startsWith("key")) && e.target === "_blank" && (G() ? u = !0 : c = !0);
|
169
|
+
let y = it() && G() && !Ce() ? new KeyboardEvent("keydown", {
|
170
|
+
keyIdentifier: "Enter",
|
171
|
+
metaKey: u,
|
172
|
+
ctrlKey: c,
|
173
|
+
altKey: m,
|
174
|
+
shiftKey: p
|
175
|
+
}) : new MouseEvent("click", {
|
176
|
+
metaKey: u,
|
177
|
+
ctrlKey: c,
|
178
|
+
altKey: m,
|
179
|
+
shiftKey: p,
|
180
|
+
bubbles: !0,
|
181
|
+
cancelable: !0
|
182
|
+
});
|
183
|
+
W.isOpening = n, _(e), e.dispatchEvent(y), W.isOpening = !1;
|
158
184
|
}
|
159
|
-
|
160
|
-
|
185
|
+
W.isOpening = !1;
|
186
|
+
let F = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set();
|
187
|
+
function ve() {
|
161
188
|
if (typeof window > "u")
|
162
189
|
return;
|
163
190
|
let e = (n) => {
|
164
|
-
let
|
165
|
-
|
191
|
+
let o = F.get(n.target);
|
192
|
+
o || (o = /* @__PURE__ */ new Set(), F.set(n.target, o), n.target.addEventListener("transitioncancel", t)), o.add(n.propertyName);
|
166
193
|
}, t = (n) => {
|
167
|
-
let
|
168
|
-
if (!!
|
169
|
-
for (let s of
|
194
|
+
let o = F.get(n.target);
|
195
|
+
if (!!o && (o.delete(n.propertyName), o.size === 0 && (n.target.removeEventListener("transitioncancel", t), F.delete(n.target)), F.size === 0)) {
|
196
|
+
for (let s of se)
|
170
197
|
s();
|
171
|
-
|
198
|
+
se.clear();
|
172
199
|
}
|
173
200
|
};
|
174
201
|
document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
|
175
202
|
}
|
176
|
-
typeof document < "u" && (document.readyState !== "loading" ?
|
177
|
-
function
|
203
|
+
typeof document < "u" && (document.readyState !== "loading" ? ve() : document.addEventListener("DOMContentLoaded", ve));
|
204
|
+
function Le(e) {
|
178
205
|
requestAnimationFrame(() => {
|
179
|
-
|
206
|
+
F.size === 0 ? e() : se.add(e);
|
180
207
|
});
|
181
208
|
}
|
182
|
-
function
|
183
|
-
let e =
|
184
|
-
let
|
185
|
-
e.current.delete(
|
186
|
-
} :
|
187
|
-
e.current.set(
|
188
|
-
type:
|
209
|
+
function ut() {
|
210
|
+
let e = H(/* @__PURE__ */ new Map()), t = K((s, u, c, m) => {
|
211
|
+
let p = m != null && m.once ? (...y) => {
|
212
|
+
e.current.delete(c), c(...y);
|
213
|
+
} : c;
|
214
|
+
e.current.set(c, {
|
215
|
+
type: u,
|
189
216
|
eventTarget: s,
|
190
|
-
fn:
|
191
|
-
options:
|
192
|
-
}), s.addEventListener(
|
193
|
-
}, []), n =
|
194
|
-
var
|
195
|
-
let
|
196
|
-
s.removeEventListener(
|
197
|
-
}, []),
|
198
|
-
e.current.forEach((s,
|
199
|
-
n(s.eventTarget, s.type,
|
217
|
+
fn: p,
|
218
|
+
options: m
|
219
|
+
}), s.addEventListener(u, c, m);
|
220
|
+
}, []), n = K((s, u, c, m) => {
|
221
|
+
var p;
|
222
|
+
let y = ((p = e.current.get(c)) === null || p === void 0 ? void 0 : p.fn) || c;
|
223
|
+
s.removeEventListener(u, y, m), e.current.delete(c);
|
224
|
+
}, []), o = K(() => {
|
225
|
+
e.current.forEach((s, u) => {
|
226
|
+
n(s.eventTarget, s.type, u, s.options);
|
200
227
|
});
|
201
228
|
}, [
|
202
229
|
n
|
203
230
|
]);
|
204
|
-
return
|
205
|
-
|
231
|
+
return ue(() => o, [
|
232
|
+
o
|
206
233
|
]), {
|
207
234
|
addGlobalListener: t,
|
208
235
|
removeGlobalListener: n,
|
209
|
-
removeAllGlobalListeners:
|
236
|
+
removeAllGlobalListeners: o
|
210
237
|
};
|
211
238
|
}
|
212
|
-
function
|
213
|
-
|
239
|
+
function Ie(e, t) {
|
240
|
+
de(() => {
|
214
241
|
if (e && e.ref && t)
|
215
242
|
return e.ref.current = t.current, () => {
|
216
243
|
e.ref.current = null;
|
217
244
|
};
|
245
|
+
});
|
246
|
+
}
|
247
|
+
function ae(e) {
|
248
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Ke() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
249
|
+
}
|
250
|
+
function dt(e) {
|
251
|
+
return !Ke() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
|
252
|
+
}
|
253
|
+
function pt(e, t) {
|
254
|
+
return t.get ? t.get.call(e) : t.value;
|
255
|
+
}
|
256
|
+
function Ae(e, t, n) {
|
257
|
+
if (!t.has(e))
|
258
|
+
throw new TypeError("attempted to " + n + " private field on non-instance");
|
259
|
+
return t.get(e);
|
260
|
+
}
|
261
|
+
function ft(e, t) {
|
262
|
+
var n = Ae(e, t, "get");
|
263
|
+
return pt(e, n);
|
264
|
+
}
|
265
|
+
function mt(e, t) {
|
266
|
+
if (t.has(e))
|
267
|
+
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
268
|
+
}
|
269
|
+
function bt(e, t, n) {
|
270
|
+
mt(e, t), t.set(e, n);
|
271
|
+
}
|
272
|
+
function gt(e, t, n) {
|
273
|
+
if (t.set)
|
274
|
+
t.set.call(e, n);
|
275
|
+
else {
|
276
|
+
if (!t.writable)
|
277
|
+
throw new TypeError("attempted to set read only private field");
|
278
|
+
t.value = n;
|
279
|
+
}
|
280
|
+
}
|
281
|
+
function ye(e, t, n) {
|
282
|
+
var o = Ae(e, t, "set");
|
283
|
+
return gt(e, o, n), n;
|
284
|
+
}
|
285
|
+
let R = "default", ie = "", Z = /* @__PURE__ */ new WeakMap();
|
286
|
+
function he(e) {
|
287
|
+
if (_e()) {
|
288
|
+
if (R === "default") {
|
289
|
+
const t = N(e);
|
290
|
+
ie = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
|
291
|
+
}
|
292
|
+
R = "disabled";
|
293
|
+
} else
|
294
|
+
(e instanceof HTMLElement || e instanceof SVGElement) && (Z.set(e, e.style.userSelect), e.style.userSelect = "none");
|
295
|
+
}
|
296
|
+
function q(e) {
|
297
|
+
if (_e()) {
|
298
|
+
if (R !== "disabled")
|
299
|
+
return;
|
300
|
+
R = "restoring", setTimeout(() => {
|
301
|
+
Le(() => {
|
302
|
+
if (R === "restoring") {
|
303
|
+
const t = N(e);
|
304
|
+
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = ie || ""), ie = "", R = "default";
|
305
|
+
}
|
306
|
+
});
|
307
|
+
}, 300);
|
308
|
+
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && Z.has(e)) {
|
309
|
+
let t = Z.get(e);
|
310
|
+
e.style.userSelect === "none" && t && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), Z.delete(e);
|
311
|
+
}
|
312
|
+
}
|
313
|
+
const Me = ce.createContext({
|
314
|
+
register: () => {
|
315
|
+
}
|
316
|
+
});
|
317
|
+
Me.displayName = "PressResponderContext";
|
318
|
+
function vt(e) {
|
319
|
+
let t = De(Me);
|
320
|
+
if (t) {
|
321
|
+
let { register: n, ...o } = t;
|
322
|
+
e = U(o, e), n();
|
323
|
+
}
|
324
|
+
return Ie(t, e.ref), e;
|
325
|
+
}
|
326
|
+
var J = /* @__PURE__ */ new WeakMap();
|
327
|
+
class Q {
|
328
|
+
continuePropagation() {
|
329
|
+
ye(this, J, !1);
|
330
|
+
}
|
331
|
+
get shouldStopPropagation() {
|
332
|
+
return ft(this, J);
|
333
|
+
}
|
334
|
+
constructor(t, n, o) {
|
335
|
+
bt(this, J, {
|
336
|
+
writable: !0,
|
337
|
+
value: void 0
|
338
|
+
}), ye(this, J, !0), this.type = t, this.pointerType = n, this.target = o.currentTarget, this.shiftKey = o.shiftKey, this.metaKey = o.metaKey, this.ctrlKey = o.ctrlKey, this.altKey = o.altKey;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
const $e = Symbol("linkClicked");
|
342
|
+
function yt(e) {
|
343
|
+
let {
|
344
|
+
onPress: t,
|
345
|
+
onPressChange: n,
|
346
|
+
onPressStart: o,
|
347
|
+
onPressEnd: s,
|
348
|
+
onPressUp: u,
|
349
|
+
isDisabled: c,
|
350
|
+
isPressed: m,
|
351
|
+
preventFocusOnPress: p,
|
352
|
+
shouldCancelOnPointerExit: y,
|
353
|
+
allowTextSelectionOnPress: $,
|
354
|
+
ref: D,
|
355
|
+
...O
|
356
|
+
} = vt(e), [V, C] = Ve(!1), T = H({
|
357
|
+
isPressed: !1,
|
358
|
+
ignoreEmulatedMouseEvents: !1,
|
359
|
+
ignoreClickAfterPress: !1,
|
360
|
+
didFirePressStart: !1,
|
361
|
+
isTriggeringEvent: !1,
|
362
|
+
activePointerId: null,
|
363
|
+
target: null,
|
364
|
+
isOverTarget: !1,
|
365
|
+
pointerType: null
|
366
|
+
}), { addGlobalListener: w, removeAllGlobalListeners: x } = ut(), k = M((r, f) => {
|
367
|
+
let E = T.current;
|
368
|
+
if (c || E.didFirePressStart)
|
369
|
+
return !1;
|
370
|
+
let l = !0;
|
371
|
+
if (E.isTriggeringEvent = !0, o) {
|
372
|
+
let b = new Q("pressstart", f, r);
|
373
|
+
o(b), l = b.shouldStopPropagation;
|
374
|
+
}
|
375
|
+
return n && n(!0), E.isTriggeringEvent = !1, E.didFirePressStart = !0, C(!0), l;
|
376
|
+
}), v = M((r, f, E = !0) => {
|
377
|
+
let l = T.current;
|
378
|
+
if (!l.didFirePressStart)
|
379
|
+
return !1;
|
380
|
+
l.ignoreClickAfterPress = !0, l.didFirePressStart = !1, l.isTriggeringEvent = !0;
|
381
|
+
let b = !0;
|
382
|
+
if (s) {
|
383
|
+
let a = new Q("pressend", f, r);
|
384
|
+
s(a), b = a.shouldStopPropagation;
|
385
|
+
}
|
386
|
+
if (n && n(!1), C(!1), t && E && !c) {
|
387
|
+
let a = new Q("press", f, r);
|
388
|
+
t(a), b && (b = a.shouldStopPropagation);
|
389
|
+
}
|
390
|
+
return l.isTriggeringEvent = !1, b;
|
391
|
+
}), P = M((r, f) => {
|
392
|
+
let E = T.current;
|
393
|
+
if (c)
|
394
|
+
return !1;
|
395
|
+
if (u) {
|
396
|
+
E.isTriggeringEvent = !0;
|
397
|
+
let l = new Q("pressup", f, r);
|
398
|
+
return u(l), E.isTriggeringEvent = !1, l.shouldStopPropagation;
|
399
|
+
}
|
400
|
+
return !0;
|
401
|
+
}), B = M((r) => {
|
402
|
+
let f = T.current;
|
403
|
+
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && v(S(f.target, r), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, x(), $ || q(f.target));
|
404
|
+
}), Y = M((r) => {
|
405
|
+
y && B(r);
|
406
|
+
}), Ue = Ge(() => {
|
407
|
+
let r = T.current, f = {
|
408
|
+
onKeyDown(l) {
|
409
|
+
if (ne(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
|
410
|
+
var b;
|
411
|
+
we(l.target, l.key) && l.preventDefault();
|
412
|
+
let a = !0;
|
413
|
+
!r.isPressed && !l.repeat && (r.target = l.currentTarget, r.isPressed = !0, a = k(l, "keyboard"), w(N(l.currentTarget), "keyup", E, !1)), a && l.stopPropagation(), l.metaKey && G() && ((b = r.metaKeyEvents) === null || b === void 0 || b.set(l.key, l.nativeEvent));
|
414
|
+
} else
|
415
|
+
l.key === "Meta" && (r.metaKeyEvents = /* @__PURE__ */ new Map());
|
416
|
+
},
|
417
|
+
onKeyUp(l) {
|
418
|
+
ne(l.nativeEvent, l.currentTarget) && !l.repeat && l.currentTarget.contains(l.target) && r.target && P(S(r.target, l), "keyboard");
|
419
|
+
},
|
420
|
+
onClick(l) {
|
421
|
+
if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !r.isTriggeringEvent && !W.isOpening) {
|
422
|
+
let b = !0;
|
423
|
+
if (c && l.preventDefault(), !r.ignoreClickAfterPress && !r.ignoreEmulatedMouseEvents && !r.isPressed && (r.pointerType === "virtual" || ae(l.nativeEvent))) {
|
424
|
+
!c && !p && _(l.currentTarget);
|
425
|
+
let a = k(l, "virtual"), i = P(l, "virtual"), h = v(l, "virtual");
|
426
|
+
b = a && i && h;
|
427
|
+
}
|
428
|
+
r.ignoreEmulatedMouseEvents = !1, r.ignoreClickAfterPress = !1, b && l.stopPropagation();
|
429
|
+
}
|
430
|
+
}
|
431
|
+
}, E = (l) => {
|
432
|
+
var b;
|
433
|
+
if (r.isPressed && r.target && ne(l, r.target)) {
|
434
|
+
var a;
|
435
|
+
we(l.target, l.key) && l.preventDefault();
|
436
|
+
let h = l.target, te = v(S(r.target, l), "keyboard", r.target.contains(h));
|
437
|
+
x(), te && l.stopPropagation(), l.key !== "Enter" && fe(r.target) && r.target.contains(h) && !l[$e] && (l[$e] = !0, W(r.target, l, !1)), r.isPressed = !1, (a = r.metaKeyEvents) === null || a === void 0 || a.delete(l.key);
|
438
|
+
} else if (l.key === "Meta" && ((b = r.metaKeyEvents) === null || b === void 0 ? void 0 : b.size)) {
|
439
|
+
var i;
|
440
|
+
let h = r.metaKeyEvents;
|
441
|
+
r.metaKeyEvents = void 0;
|
442
|
+
for (let te of h.values())
|
443
|
+
(i = r.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", te));
|
444
|
+
}
|
445
|
+
};
|
446
|
+
if (typeof PointerEvent < "u") {
|
447
|
+
f.onPointerDown = (i) => {
|
448
|
+
if (i.button !== 0 || !i.currentTarget.contains(i.target))
|
449
|
+
return;
|
450
|
+
if (dt(i.nativeEvent)) {
|
451
|
+
r.pointerType = "virtual";
|
452
|
+
return;
|
453
|
+
}
|
454
|
+
re(i.currentTarget) && i.preventDefault(), r.pointerType = i.pointerType;
|
455
|
+
let h = !0;
|
456
|
+
r.isPressed || (r.isPressed = !0, r.isOverTarget = !0, r.activePointerId = i.pointerId, r.target = i.currentTarget, !c && !p && _(i.currentTarget), $ || he(r.target), h = k(i, r.pointerType), w(N(i.currentTarget), "pointermove", l, !1), w(N(i.currentTarget), "pointerup", b, !1), w(N(i.currentTarget), "pointercancel", a, !1)), h && i.stopPropagation();
|
457
|
+
}, f.onMouseDown = (i) => {
|
458
|
+
!i.currentTarget.contains(i.target) || i.button === 0 && (re(i.currentTarget) && i.preventDefault(), i.stopPropagation());
|
459
|
+
}, f.onPointerUp = (i) => {
|
460
|
+
!i.currentTarget.contains(i.target) || r.pointerType === "virtual" || i.button === 0 && I(i, i.currentTarget) && P(i, r.pointerType || i.pointerType);
|
461
|
+
};
|
462
|
+
let l = (i) => {
|
463
|
+
i.pointerId === r.activePointerId && (r.target && I(i, r.target) ? !r.isOverTarget && r.pointerType != null && (r.isOverTarget = !0, k(S(r.target, i), r.pointerType)) : r.target && r.isOverTarget && r.pointerType != null && (r.isOverTarget = !1, v(S(r.target, i), r.pointerType, !1), Y(i)));
|
464
|
+
}, b = (i) => {
|
465
|
+
i.pointerId === r.activePointerId && r.isPressed && i.button === 0 && r.target && (I(i, r.target) && r.pointerType != null ? v(S(r.target, i), r.pointerType) : r.isOverTarget && r.pointerType != null && v(S(r.target, i), r.pointerType, !1), r.isPressed = !1, r.isOverTarget = !1, r.activePointerId = null, r.pointerType = null, x(), $ || q(r.target));
|
466
|
+
}, a = (i) => {
|
467
|
+
B(i);
|
468
|
+
};
|
469
|
+
f.onDragStart = (i) => {
|
470
|
+
!i.currentTarget.contains(i.target) || B(i);
|
471
|
+
};
|
472
|
+
} else {
|
473
|
+
f.onMouseDown = (a) => {
|
474
|
+
if (a.button !== 0 || !a.currentTarget.contains(a.target))
|
475
|
+
return;
|
476
|
+
if (re(a.currentTarget) && a.preventDefault(), r.ignoreEmulatedMouseEvents) {
|
477
|
+
a.stopPropagation();
|
478
|
+
return;
|
479
|
+
}
|
480
|
+
r.isPressed = !0, r.isOverTarget = !0, r.target = a.currentTarget, r.pointerType = ae(a.nativeEvent) ? "virtual" : "mouse", !c && !p && _(a.currentTarget), k(a, r.pointerType) && a.stopPropagation(), w(N(a.currentTarget), "mouseup", l, !1);
|
481
|
+
}, f.onMouseEnter = (a) => {
|
482
|
+
if (!a.currentTarget.contains(a.target))
|
483
|
+
return;
|
484
|
+
let i = !0;
|
485
|
+
r.isPressed && !r.ignoreEmulatedMouseEvents && r.pointerType != null && (r.isOverTarget = !0, i = k(a, r.pointerType)), i && a.stopPropagation();
|
486
|
+
}, f.onMouseLeave = (a) => {
|
487
|
+
if (!a.currentTarget.contains(a.target))
|
488
|
+
return;
|
489
|
+
let i = !0;
|
490
|
+
r.isPressed && !r.ignoreEmulatedMouseEvents && r.pointerType != null && (r.isOverTarget = !1, i = v(a, r.pointerType, !1), Y(a)), i && a.stopPropagation();
|
491
|
+
}, f.onMouseUp = (a) => {
|
492
|
+
!a.currentTarget.contains(a.target) || !r.ignoreEmulatedMouseEvents && a.button === 0 && P(a, r.pointerType || "mouse");
|
493
|
+
};
|
494
|
+
let l = (a) => {
|
495
|
+
if (a.button === 0) {
|
496
|
+
if (r.isPressed = !1, x(), r.ignoreEmulatedMouseEvents) {
|
497
|
+
r.ignoreEmulatedMouseEvents = !1;
|
498
|
+
return;
|
499
|
+
}
|
500
|
+
r.target && I(a, r.target) && r.pointerType != null ? v(S(r.target, a), r.pointerType) : r.target && r.isOverTarget && r.pointerType != null && v(S(r.target, a), r.pointerType, !1), r.isOverTarget = !1;
|
501
|
+
}
|
502
|
+
};
|
503
|
+
f.onTouchStart = (a) => {
|
504
|
+
if (!a.currentTarget.contains(a.target))
|
505
|
+
return;
|
506
|
+
let i = ht(a.nativeEvent);
|
507
|
+
if (!i)
|
508
|
+
return;
|
509
|
+
r.activePointerId = i.identifier, r.ignoreEmulatedMouseEvents = !0, r.isOverTarget = !0, r.isPressed = !0, r.target = a.currentTarget, r.pointerType = "touch", !c && !p && _(a.currentTarget), $ || he(r.target), k(a, r.pointerType) && a.stopPropagation(), w(oe(a.currentTarget), "scroll", b, !0);
|
510
|
+
}, f.onTouchMove = (a) => {
|
511
|
+
if (!a.currentTarget.contains(a.target))
|
512
|
+
return;
|
513
|
+
if (!r.isPressed) {
|
514
|
+
a.stopPropagation();
|
515
|
+
return;
|
516
|
+
}
|
517
|
+
let i = ke(a.nativeEvent, r.activePointerId), h = !0;
|
518
|
+
i && I(i, a.currentTarget) ? !r.isOverTarget && r.pointerType != null && (r.isOverTarget = !0, h = k(a, r.pointerType)) : r.isOverTarget && r.pointerType != null && (r.isOverTarget = !1, h = v(a, r.pointerType, !1), Y(a)), h && a.stopPropagation();
|
519
|
+
}, f.onTouchEnd = (a) => {
|
520
|
+
if (!a.currentTarget.contains(a.target))
|
521
|
+
return;
|
522
|
+
if (!r.isPressed) {
|
523
|
+
a.stopPropagation();
|
524
|
+
return;
|
525
|
+
}
|
526
|
+
let i = ke(a.nativeEvent, r.activePointerId), h = !0;
|
527
|
+
i && I(i, a.currentTarget) && r.pointerType != null ? (P(a, r.pointerType), h = v(a, r.pointerType)) : r.isOverTarget && r.pointerType != null && (h = v(a, r.pointerType, !1)), h && a.stopPropagation(), r.isPressed = !1, r.activePointerId = null, r.isOverTarget = !1, r.ignoreEmulatedMouseEvents = !0, r.target && !$ && q(r.target), x();
|
528
|
+
}, f.onTouchCancel = (a) => {
|
529
|
+
!a.currentTarget.contains(a.target) || (a.stopPropagation(), r.isPressed && B(a));
|
530
|
+
};
|
531
|
+
let b = (a) => {
|
532
|
+
r.isPressed && a.target.contains(r.target) && B({
|
533
|
+
currentTarget: r.target,
|
534
|
+
shiftKey: !1,
|
535
|
+
ctrlKey: !1,
|
536
|
+
metaKey: !1,
|
537
|
+
altKey: !1
|
538
|
+
});
|
539
|
+
};
|
540
|
+
f.onDragStart = (a) => {
|
541
|
+
!a.currentTarget.contains(a.target) || B(a);
|
542
|
+
};
|
543
|
+
}
|
544
|
+
return f;
|
218
545
|
}, [
|
219
|
-
|
220
|
-
|
546
|
+
w,
|
547
|
+
c,
|
548
|
+
p,
|
549
|
+
x,
|
550
|
+
$,
|
551
|
+
B,
|
552
|
+
Y,
|
553
|
+
v,
|
554
|
+
k,
|
555
|
+
P
|
221
556
|
]);
|
557
|
+
return ue(() => () => {
|
558
|
+
var r;
|
559
|
+
$ || q((r = T.current.target) !== null && r !== void 0 ? r : void 0);
|
560
|
+
}, [
|
561
|
+
$
|
562
|
+
]), {
|
563
|
+
isPressed: m || V,
|
564
|
+
pressProps: U(O, Ue)
|
565
|
+
};
|
222
566
|
}
|
223
|
-
function
|
224
|
-
|
225
|
-
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;
|
567
|
+
function fe(e) {
|
568
|
+
return e.tagName === "A" && e.hasAttribute("href");
|
226
569
|
}
|
227
|
-
function
|
228
|
-
|
570
|
+
function ne(e, t) {
|
571
|
+
const { key: n, code: o } = e, s = t, u = s.getAttribute("role");
|
572
|
+
return (n === "Enter" || n === " " || n === "Spacebar" || o === "Space") && !(s instanceof oe(s).HTMLInputElement && !Fe(s, n) || s instanceof oe(s).HTMLTextAreaElement || s.isContentEditable) && !((u === "link" || !u && fe(s)) && n !== "Enter");
|
229
573
|
}
|
230
|
-
function
|
231
|
-
|
574
|
+
function ht(e) {
|
575
|
+
const { targetTouches: t } = e;
|
576
|
+
return t.length > 0 ? t[0] : null;
|
232
577
|
}
|
233
|
-
function
|
234
|
-
|
578
|
+
function ke(e, t) {
|
579
|
+
const n = e.changedTouches;
|
580
|
+
for (let o = 0; o < n.length; o++) {
|
581
|
+
const s = n[o];
|
582
|
+
if (s.identifier === t)
|
583
|
+
return s;
|
584
|
+
}
|
585
|
+
return null;
|
235
586
|
}
|
236
|
-
function
|
237
|
-
return
|
587
|
+
function S(e, t) {
|
588
|
+
return {
|
589
|
+
currentTarget: e,
|
590
|
+
shiftKey: t.shiftKey,
|
591
|
+
ctrlKey: t.ctrlKey,
|
592
|
+
metaKey: t.metaKey,
|
593
|
+
altKey: t.altKey
|
594
|
+
};
|
238
595
|
}
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
let r = H.get(n.target);
|
247
|
-
r || (r = /* @__PURE__ */ new Set(), H.set(n.target, r), n.target.addEventListener("transitioncancel", t)), r.add(n.propertyName);
|
248
|
-
}, t = (n) => {
|
249
|
-
let r = H.get(n.target);
|
250
|
-
if (!!r && (r.delete(n.propertyName), r.size === 0 && (n.target.removeEventListener("transitioncancel", t), H.delete(n.target)), H.size === 0)) {
|
251
|
-
for (let s of ve)
|
252
|
-
s();
|
253
|
-
ve.clear();
|
254
|
-
}
|
596
|
+
function $t(e) {
|
597
|
+
let t = 0, n = 0;
|
598
|
+
return e.width !== void 0 ? t = e.width / 2 : e.radiusX !== void 0 && (t = e.radiusX), e.height !== void 0 ? n = e.height / 2 : e.radiusY !== void 0 && (n = e.radiusY), {
|
599
|
+
top: e.clientY - n,
|
600
|
+
right: e.clientX + t,
|
601
|
+
bottom: e.clientY + n,
|
602
|
+
left: e.clientX - t
|
255
603
|
};
|
256
|
-
document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
|
257
604
|
}
|
258
|
-
|
259
|
-
|
260
|
-
var t;
|
261
|
-
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((n) => e.test(n.brand))) || e.test(window.navigator.userAgent);
|
605
|
+
function kt(e, t) {
|
606
|
+
return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
|
262
607
|
}
|
263
|
-
function
|
264
|
-
|
265
|
-
return
|
608
|
+
function I(e, t) {
|
609
|
+
let n = t.getBoundingClientRect(), o = $t(e);
|
610
|
+
return kt(n, o);
|
266
611
|
}
|
267
|
-
function
|
268
|
-
return
|
612
|
+
function re(e) {
|
613
|
+
return !(e instanceof HTMLElement) || !e.hasAttribute("draggable");
|
269
614
|
}
|
270
|
-
function
|
271
|
-
return
|
615
|
+
function we(e, t) {
|
616
|
+
return e instanceof HTMLInputElement ? !Fe(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !fe(e);
|
272
617
|
}
|
273
|
-
|
274
|
-
|
618
|
+
const wt = /* @__PURE__ */ new Set([
|
619
|
+
"checkbox",
|
620
|
+
"radio",
|
621
|
+
"range",
|
622
|
+
"color",
|
623
|
+
"file",
|
624
|
+
"image",
|
625
|
+
"button",
|
626
|
+
"submit",
|
627
|
+
"reset"
|
628
|
+
]);
|
629
|
+
function Fe(e, t) {
|
630
|
+
return e.type === "checkbox" || e.type === "radio" ? t === " " : wt.has(e.type);
|
275
631
|
}
|
276
|
-
|
277
|
-
ht.displayName = "PressResponderContext";
|
278
|
-
class kt {
|
632
|
+
class Tt {
|
279
633
|
isDefaultPrevented() {
|
280
634
|
return this.nativeEvent.defaultPrevented;
|
281
635
|
}
|
@@ -294,94 +648,106 @@ class kt {
|
|
294
648
|
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;
|
295
649
|
}
|
296
650
|
}
|
297
|
-
function
|
298
|
-
let t =
|
651
|
+
function Bt(e) {
|
652
|
+
let t = H({
|
299
653
|
isFocused: !1,
|
300
|
-
onBlur: e,
|
301
654
|
observer: null
|
302
655
|
});
|
303
|
-
|
304
|
-
const
|
656
|
+
de(() => {
|
657
|
+
const o = t.current;
|
305
658
|
return () => {
|
306
|
-
|
659
|
+
o.observer && (o.observer.disconnect(), o.observer = null);
|
307
660
|
};
|
308
|
-
}, [])
|
309
|
-
|
661
|
+
}, []);
|
662
|
+
let n = M((o) => {
|
663
|
+
e == null || e(o);
|
664
|
+
});
|
665
|
+
return K((o) => {
|
666
|
+
if (o.target instanceof HTMLButtonElement || o.target instanceof HTMLInputElement || o.target instanceof HTMLTextAreaElement || o.target instanceof HTMLSelectElement) {
|
310
667
|
t.current.isFocused = !0;
|
311
|
-
let
|
312
|
-
|
313
|
-
t.current.isFocused = !1, r.disabled && ((p = (u = t.current).onBlur) === null || p === void 0 || p.call(u, new kt("blur", l))), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
|
668
|
+
let s = o.target, u = (c) => {
|
669
|
+
t.current.isFocused = !1, s.disabled && n(new Tt("blur", c)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
|
314
670
|
};
|
315
|
-
|
671
|
+
s.addEventListener("focusout", u, {
|
316
672
|
once: !0
|
317
673
|
}), t.current.observer = new MutationObserver(() => {
|
318
|
-
t.current.isFocused &&
|
319
|
-
|
320
|
-
|
321
|
-
|
674
|
+
if (t.current.isFocused && s.disabled) {
|
675
|
+
var c;
|
676
|
+
(c = t.current.observer) === null || c === void 0 || c.disconnect();
|
677
|
+
let m = s === document.activeElement ? null : document.activeElement;
|
678
|
+
s.dispatchEvent(new FocusEvent("blur", {
|
679
|
+
relatedTarget: m
|
680
|
+
})), s.dispatchEvent(new FocusEvent("focusout", {
|
681
|
+
bubbles: !0,
|
682
|
+
relatedTarget: m
|
683
|
+
}));
|
684
|
+
}
|
685
|
+
}), t.current.observer.observe(s, {
|
322
686
|
attributes: !0,
|
323
687
|
attributeFilter: [
|
324
688
|
"disabled"
|
325
689
|
]
|
326
690
|
});
|
327
691
|
}
|
328
|
-
}, [
|
692
|
+
}, [
|
693
|
+
n
|
694
|
+
]);
|
329
695
|
}
|
330
|
-
function
|
331
|
-
let { isDisabled: t, onFocus: n, onBlur:
|
332
|
-
const
|
333
|
-
if (
|
334
|
-
return
|
696
|
+
function Pt(e) {
|
697
|
+
let { isDisabled: t, onFocus: n, onBlur: o, onFocusChange: s } = e;
|
698
|
+
const u = K((p) => {
|
699
|
+
if (p.target === p.currentTarget)
|
700
|
+
return o && o(p), s && s(!1), !0;
|
335
701
|
}, [
|
336
|
-
|
702
|
+
o,
|
337
703
|
s
|
338
|
-
]),
|
339
|
-
|
704
|
+
]), c = Bt(u), m = K((p) => {
|
705
|
+
p.target === p.currentTarget && document.activeElement === p.target && (n && n(p), s && s(!0), c(p));
|
340
706
|
}, [
|
341
707
|
s,
|
342
708
|
n,
|
343
|
-
|
709
|
+
c
|
344
710
|
]);
|
345
711
|
return {
|
346
712
|
focusProps: {
|
347
|
-
onFocus: !t && (n || s ||
|
348
|
-
onBlur: !t && (
|
713
|
+
onFocus: !t && (n || s || o) ? m : void 0,
|
714
|
+
onBlur: !t && (o || s) ? u : void 0
|
349
715
|
}
|
350
716
|
};
|
351
717
|
}
|
352
|
-
let j = null, Et = /* @__PURE__ */ new Set(),
|
353
|
-
function
|
718
|
+
let j = null, Et = /* @__PURE__ */ new Set(), Te = !1, L = !1, le = !1;
|
719
|
+
function me(e, t) {
|
354
720
|
for (let n of Et)
|
355
721
|
n(e, t);
|
356
722
|
}
|
357
|
-
function
|
358
|
-
return !(e.metaKey || !
|
723
|
+
function xt(e) {
|
724
|
+
return !(e.metaKey || !G() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
359
725
|
}
|
360
|
-
function
|
361
|
-
|
726
|
+
function Be(e) {
|
727
|
+
L = !0, xt(e) && (j = "keyboard", me("keyboard", e));
|
362
728
|
}
|
363
|
-
function
|
364
|
-
j = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (
|
729
|
+
function A(e) {
|
730
|
+
j = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (L = !0, me("pointer", e));
|
365
731
|
}
|
366
|
-
function
|
367
|
-
|
732
|
+
function St(e) {
|
733
|
+
ae(e) && (L = !0, j = "virtual");
|
368
734
|
}
|
369
|
-
function
|
370
|
-
e.target === window || e.target === document || (!
|
735
|
+
function Nt(e) {
|
736
|
+
e.target === window || e.target === document || (!L && !le && (j = "virtual", me("virtual", e)), L = !1, le = !1);
|
371
737
|
}
|
372
|
-
function
|
373
|
-
|
738
|
+
function Dt() {
|
739
|
+
L = !1, le = !0;
|
374
740
|
}
|
375
|
-
function
|
376
|
-
if (typeof window > "u" ||
|
741
|
+
function Pe() {
|
742
|
+
if (typeof window > "u" || Te)
|
377
743
|
return;
|
378
744
|
let e = HTMLElement.prototype.focus;
|
379
745
|
HTMLElement.prototype.focus = function() {
|
380
|
-
|
381
|
-
}, document.addEventListener("keydown",
|
746
|
+
L = !0, e.apply(this, arguments);
|
747
|
+
}, document.addEventListener("keydown", Be, !0), document.addEventListener("keyup", Be, !0), document.addEventListener("click", St, !0), window.addEventListener("focus", Nt, !0), window.addEventListener("blur", Dt, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", A, !0), document.addEventListener("pointermove", A, !0), document.addEventListener("pointerup", A, !0)) : (document.addEventListener("mousedown", A, !0), document.addEventListener("mousemove", A, !0), document.addEventListener("mouseup", A, !0)), Te = !0;
|
382
748
|
}
|
383
|
-
typeof document < "u" && (document.readyState !== "loading" ?
|
384
|
-
function
|
749
|
+
typeof document < "u" && (document.readyState !== "loading" ? Pe() : document.addEventListener("DOMContentLoaded", Pe));
|
750
|
+
function Ot() {
|
385
751
|
return j;
|
386
752
|
}
|
387
753
|
function Ee(e) {
|
@@ -389,7 +755,7 @@ function Ee(e) {
|
|
389
755
|
return;
|
390
756
|
let t = !0;
|
391
757
|
return (n) => {
|
392
|
-
let
|
758
|
+
let o = {
|
393
759
|
...n,
|
394
760
|
preventDefault() {
|
395
761
|
n.preventDefault();
|
@@ -404,10 +770,10 @@ function Ee(e) {
|
|
404
770
|
t = !1;
|
405
771
|
}
|
406
772
|
};
|
407
|
-
e(
|
773
|
+
e(o), t && n.stopPropagation();
|
408
774
|
};
|
409
775
|
}
|
410
|
-
function
|
776
|
+
function Ct(e) {
|
411
777
|
return {
|
412
778
|
keyboardProps: e.isDisabled ? {} : {
|
413
779
|
onKeyDown: Ee(e.onKeyDown),
|
@@ -415,466 +781,158 @@ function Dt(e) {
|
|
415
781
|
}
|
416
782
|
};
|
417
783
|
}
|
418
|
-
function
|
419
|
-
if (
|
784
|
+
function _t(e) {
|
785
|
+
if (Ot() === "virtual") {
|
420
786
|
let t = document.activeElement;
|
421
|
-
|
422
|
-
document.activeElement === t && document.contains(e) &&
|
787
|
+
Le(() => {
|
788
|
+
document.activeElement === t && document.contains(e) && _(e);
|
423
789
|
});
|
424
790
|
} else
|
425
|
-
|
791
|
+
_(e);
|
426
792
|
}
|
427
|
-
function
|
428
|
-
return t.some(
|
429
|
-
(n) => n.contains(e)
|
430
|
-
);
|
793
|
+
function Kt(e, t) {
|
794
|
+
return !e || !t ? !1 : t.some((n) => n.contains(e));
|
431
795
|
}
|
432
|
-
class
|
796
|
+
class be {
|
433
797
|
get size() {
|
434
798
|
return this.fastMap.size;
|
435
799
|
}
|
436
800
|
getTreeNode(t) {
|
437
801
|
return this.fastMap.get(t);
|
438
802
|
}
|
439
|
-
addTreeNode(t, n,
|
440
|
-
let s = this.fastMap.get(n != null ? n : null)
|
803
|
+
addTreeNode(t, n, o) {
|
804
|
+
let s = this.fastMap.get(n != null ? n : null);
|
805
|
+
if (!s)
|
806
|
+
return;
|
807
|
+
let u = new xe({
|
441
808
|
scopeRef: t
|
442
809
|
});
|
443
|
-
s.addChild(
|
810
|
+
s.addChild(u), u.parent = s, this.fastMap.set(t, u), o && (u.nodeToRestore = o);
|
811
|
+
}
|
812
|
+
addNode(t) {
|
813
|
+
this.fastMap.set(t.scopeRef, t);
|
444
814
|
}
|
445
815
|
removeTreeNode(t) {
|
446
816
|
if (t === null)
|
447
817
|
return;
|
448
|
-
let n = this.fastMap.get(t)
|
449
|
-
|
450
|
-
|
818
|
+
let n = this.fastMap.get(t);
|
819
|
+
if (!n)
|
820
|
+
return;
|
821
|
+
let o = n.parent;
|
822
|
+
for (let u of this.traverse())
|
823
|
+
u !== n && n.nodeToRestore && u.nodeToRestore && n.scopeRef && n.scopeRef.current && Kt(u.nodeToRestore, n.scopeRef.current) && (u.nodeToRestore = n.nodeToRestore);
|
451
824
|
let s = n.children;
|
452
|
-
|
453
|
-
(l) => r.addChild(l)
|
454
|
-
), this.fastMap.delete(n.scopeRef);
|
825
|
+
o && (o.removeChild(n), s.size > 0 && s.forEach((u) => o && o.addChild(u))), this.fastMap.delete(n.scopeRef);
|
455
826
|
}
|
456
827
|
*traverse(t = this.root) {
|
457
|
-
if (t.scopeRef != null && (yield t), t.children.
|
828
|
+
if (t.scopeRef != null && (yield t), t.children.size > 0)
|
458
829
|
for (let n of t.children)
|
459
830
|
yield* this.traverse(n);
|
460
831
|
}
|
461
832
|
clone() {
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
833
|
+
var t;
|
834
|
+
let n = new be();
|
835
|
+
var o;
|
836
|
+
for (let s of this.traverse())
|
837
|
+
n.addTreeNode(s.scopeRef, (o = (t = s.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && o !== void 0 ? o : null, s.nodeToRestore);
|
838
|
+
return n;
|
466
839
|
}
|
467
840
|
constructor() {
|
468
|
-
this.fastMap = /* @__PURE__ */ new Map(), this.root = new
|
841
|
+
this.fastMap = /* @__PURE__ */ new Map(), this.root = new xe({
|
469
842
|
scopeRef: null
|
470
843
|
}), this.fastMap.set(null, this.root);
|
471
844
|
}
|
472
845
|
}
|
473
|
-
class
|
846
|
+
class xe {
|
474
847
|
addChild(t) {
|
475
|
-
this.children.
|
848
|
+
this.children.add(t), t.parent = this;
|
476
849
|
}
|
477
850
|
removeChild(t) {
|
478
|
-
this.children.
|
851
|
+
this.children.delete(t), t.parent = void 0;
|
479
852
|
}
|
480
853
|
constructor(t) {
|
481
|
-
this.children =
|
854
|
+
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
|
482
855
|
}
|
483
856
|
}
|
484
|
-
new
|
485
|
-
let Lt = /* @__PURE__ */
|
486
|
-
function
|
487
|
-
let t =
|
488
|
-
|
489
|
-
let { ref: n, ...
|
490
|
-
return
|
491
|
-
}
|
492
|
-
function
|
493
|
-
let { focusProps: n } =
|
494
|
-
return
|
495
|
-
|
857
|
+
new be();
|
858
|
+
let Lt = /* @__PURE__ */ ce.createContext(null);
|
859
|
+
function It(e) {
|
860
|
+
let t = De(Lt) || {};
|
861
|
+
Ie(t, e);
|
862
|
+
let { ref: n, ...o } = t;
|
863
|
+
return o;
|
864
|
+
}
|
865
|
+
function At(e, t) {
|
866
|
+
let { focusProps: n } = Pt(e), { keyboardProps: o } = Ct(e), s = U(n, o), u = It(t), c = e.isDisabled ? {} : u, m = H(e.autoFocus);
|
867
|
+
return ue(() => {
|
868
|
+
m.current && t.current && _t(t.current), m.current = !1;
|
496
869
|
}, [
|
497
870
|
t
|
498
871
|
]), {
|
499
|
-
focusableProps:
|
872
|
+
focusableProps: U({
|
500
873
|
...s,
|
501
874
|
tabIndex: e.excludeFromTabOrder && !e.isDisabled ? -1 : void 0
|
502
|
-
},
|
875
|
+
}, c)
|
503
876
|
};
|
504
877
|
}
|
505
|
-
|
506
|
-
function Te(e) {
|
507
|
-
Re() ? (_ === "default" && (re = document.documentElement.style.webkitUserSelect, document.documentElement.style.webkitUserSelect = "none"), _ = "disabled") : (e instanceof HTMLElement || e instanceof SVGElement) && (J.set(e, e.style.userSelect), e.style.userSelect = "none");
|
508
|
-
}
|
509
|
-
function X(e) {
|
510
|
-
if (Re()) {
|
511
|
-
if (_ !== "disabled")
|
512
|
-
return;
|
513
|
-
_ = "restoring", setTimeout(() => {
|
514
|
-
Ae(() => {
|
515
|
-
_ === "restoring" && (document.documentElement.style.webkitUserSelect === "none" && (document.documentElement.style.webkitUserSelect = re || ""), re = "", _ = "default");
|
516
|
-
});
|
517
|
-
}, 300);
|
518
|
-
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && J.has(e)) {
|
519
|
-
let t = J.get(e);
|
520
|
-
e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), J.delete(e);
|
521
|
-
}
|
522
|
-
}
|
523
|
-
function oe(e) {
|
524
|
-
return e.mozInputSource === 0 && e.isTrusted ? !0 : e.detail === 0 && !e.pointerType;
|
525
|
-
}
|
526
|
-
const Ue = U.createContext(null);
|
527
|
-
Ue.displayName = "PressResponderContext";
|
528
|
-
function Mt(e) {
|
529
|
-
let t = Ke(Ue);
|
530
|
-
if (t) {
|
531
|
-
let { register: n, ...r } = t;
|
532
|
-
e = Q(r, e), n();
|
533
|
-
}
|
534
|
-
return Fe(t, e.ref), e;
|
535
|
-
}
|
536
|
-
function At(e) {
|
537
|
-
let {
|
538
|
-
onPress: t,
|
539
|
-
onPressChange: n,
|
540
|
-
onPressStart: r,
|
541
|
-
onPressEnd: s,
|
542
|
-
onPressUp: l,
|
543
|
-
isDisabled: u,
|
544
|
-
isPressed: p,
|
545
|
-
preventFocusOnPress: f,
|
546
|
-
shouldCancelOnPointerExit: b,
|
547
|
-
allowTextSelectionOnPress: g,
|
548
|
-
ref: O,
|
549
|
-
...x
|
550
|
-
} = Mt(e), k = W(null);
|
551
|
-
k.current = {
|
552
|
-
onPress: t,
|
553
|
-
onPressChange: n,
|
554
|
-
onPressStart: r,
|
555
|
-
onPressEnd: s,
|
556
|
-
onPressUp: l,
|
557
|
-
isDisabled: u,
|
558
|
-
shouldCancelOnPointerExit: b
|
559
|
-
};
|
560
|
-
let [S, E] = je(!1), L = W({
|
561
|
-
isPressed: !1,
|
562
|
-
ignoreEmulatedMouseEvents: !1,
|
563
|
-
ignoreClickAfterPress: !1,
|
564
|
-
didFirePressStart: !1,
|
565
|
-
activePointerId: null,
|
566
|
-
target: null,
|
567
|
-
isOverTarget: !1,
|
568
|
-
pointerType: null
|
569
|
-
}), { addGlobalListener: w, removeAllGlobalListeners: $ } = dt(), N = ze(() => {
|
570
|
-
let o = L.current, B = (i, v) => {
|
571
|
-
let { onPressStart: a, onPressChange: c, isDisabled: Y } = k.current;
|
572
|
-
Y || o.didFirePressStart || (a && a({
|
573
|
-
type: "pressstart",
|
574
|
-
pointerType: v,
|
575
|
-
target: i.currentTarget,
|
576
|
-
shiftKey: i.shiftKey,
|
577
|
-
metaKey: i.metaKey,
|
578
|
-
ctrlKey: i.ctrlKey,
|
579
|
-
altKey: i.altKey
|
580
|
-
}), c && c(!0), o.didFirePressStart = !0, E(!0));
|
581
|
-
}, h = (i, v, a = !0) => {
|
582
|
-
let { onPressEnd: c, onPressChange: Y, onPress: fe, isDisabled: We } = k.current;
|
583
|
-
!o.didFirePressStart || (o.ignoreClickAfterPress = !0, o.didFirePressStart = !1, c && c({
|
584
|
-
type: "pressend",
|
585
|
-
pointerType: v,
|
586
|
-
target: i.currentTarget,
|
587
|
-
shiftKey: i.shiftKey,
|
588
|
-
metaKey: i.metaKey,
|
589
|
-
ctrlKey: i.ctrlKey,
|
590
|
-
altKey: i.altKey
|
591
|
-
}), Y && Y(!1), E(!1), fe && a && !We && fe({
|
592
|
-
type: "press",
|
593
|
-
pointerType: v,
|
594
|
-
target: i.currentTarget,
|
595
|
-
shiftKey: i.shiftKey,
|
596
|
-
metaKey: i.metaKey,
|
597
|
-
ctrlKey: i.ctrlKey,
|
598
|
-
altKey: i.altKey
|
599
|
-
}));
|
600
|
-
}, V = (i, v) => {
|
601
|
-
let { onPressUp: a, isDisabled: c } = k.current;
|
602
|
-
c || a && a({
|
603
|
-
type: "pressup",
|
604
|
-
pointerType: v,
|
605
|
-
target: i.currentTarget,
|
606
|
-
shiftKey: i.shiftKey,
|
607
|
-
metaKey: i.metaKey,
|
608
|
-
ctrlKey: i.ctrlKey,
|
609
|
-
altKey: i.altKey
|
610
|
-
});
|
611
|
-
}, T = (i) => {
|
612
|
-
o.isPressed && (o.isOverTarget && h(P(o.target, i), o.pointerType, !1), o.isPressed = !1, o.isOverTarget = !1, o.activePointerId = null, o.pointerType = null, $(), g || X(o.target));
|
613
|
-
}, y = {
|
614
|
-
onKeyDown(i) {
|
615
|
-
Z(i.nativeEvent, i.currentTarget) && i.currentTarget.contains(i.target) ? (Se(i.target, i.key) && i.preventDefault(), i.stopPropagation(), !o.isPressed && !i.repeat && (o.target = i.currentTarget, o.isPressed = !0, B(i, "keyboard"), w(document, "keyup", He, !1))) : i.key === "Enter" && se(i.currentTarget) && i.stopPropagation();
|
616
|
-
},
|
617
|
-
onKeyUp(i) {
|
618
|
-
Z(i.nativeEvent, i.currentTarget) && !i.repeat && i.currentTarget.contains(i.target) && V(P(o.target, i), "keyboard");
|
619
|
-
},
|
620
|
-
onClick(i) {
|
621
|
-
i && !i.currentTarget.contains(i.target) || i && i.button === 0 && (i.stopPropagation(), u && i.preventDefault(), !o.ignoreClickAfterPress && !o.ignoreEmulatedMouseEvents && (o.pointerType === "virtual" || oe(i.nativeEvent)) && (!u && !f && F(i.currentTarget), B(i, "virtual"), V(i, "virtual"), h(i, "virtual")), o.ignoreEmulatedMouseEvents = !1, o.ignoreClickAfterPress = !1);
|
622
|
-
}
|
623
|
-
}, He = (i) => {
|
624
|
-
if (o.isPressed && Z(i, o.target)) {
|
625
|
-
Se(i.target, i.key) && i.preventDefault(), i.stopPropagation(), o.isPressed = !1;
|
626
|
-
let v = i.target;
|
627
|
-
h(P(o.target, i), "keyboard", o.target.contains(v)), $(), o.target instanceof HTMLElement && o.target.contains(v) && (se(o.target) || o.target.getAttribute("role") === "link") && o.target.click();
|
628
|
-
}
|
629
|
-
};
|
630
|
-
if (typeof PointerEvent < "u") {
|
631
|
-
y.onPointerDown = (c) => {
|
632
|
-
if (!(c.button !== 0 || !c.currentTarget.contains(c.target))) {
|
633
|
-
if (Vt(c.nativeEvent)) {
|
634
|
-
o.pointerType = "virtual";
|
635
|
-
return;
|
636
|
-
}
|
637
|
-
ee(c.currentTarget) && c.preventDefault(), o.pointerType = c.pointerType, c.stopPropagation(), o.isPressed || (o.isPressed = !0, o.isOverTarget = !0, o.activePointerId = c.pointerId, o.target = c.currentTarget, !u && !f && F(c.currentTarget), g || Te(o.target), B(c, o.pointerType), w(document, "pointermove", i, !1), w(document, "pointerup", v, !1), w(document, "pointercancel", a, !1));
|
638
|
-
}
|
639
|
-
}, y.onMouseDown = (c) => {
|
640
|
-
!c.currentTarget.contains(c.target) || c.button === 0 && (ee(c.currentTarget) && c.preventDefault(), c.stopPropagation());
|
641
|
-
}, y.onPointerUp = (c) => {
|
642
|
-
!c.currentTarget.contains(c.target) || o.pointerType === "virtual" || c.button === 0 && I(c, c.currentTarget) && V(c, o.pointerType || c.pointerType);
|
643
|
-
};
|
644
|
-
let i = (c) => {
|
645
|
-
c.pointerId === o.activePointerId && (I(c, o.target) ? o.isOverTarget || (o.isOverTarget = !0, B(P(o.target, c), o.pointerType)) : o.isOverTarget && (o.isOverTarget = !1, h(P(o.target, c), o.pointerType, !1), k.current.shouldCancelOnPointerExit && T(c)));
|
646
|
-
}, v = (c) => {
|
647
|
-
c.pointerId === o.activePointerId && o.isPressed && c.button === 0 && (I(c, o.target) ? h(P(o.target, c), o.pointerType) : o.isOverTarget && h(P(o.target, c), o.pointerType, !1), o.isPressed = !1, o.isOverTarget = !1, o.activePointerId = null, o.pointerType = null, $(), g || X(o.target));
|
648
|
-
}, a = (c) => {
|
649
|
-
T(c);
|
650
|
-
};
|
651
|
-
y.onDragStart = (c) => {
|
652
|
-
!c.currentTarget.contains(c.target) || T(c);
|
653
|
-
};
|
654
|
-
} else {
|
655
|
-
y.onMouseDown = (a) => {
|
656
|
-
a.button !== 0 || !a.currentTarget.contains(a.target) || (ee(a.currentTarget) && a.preventDefault(), a.stopPropagation(), !o.ignoreEmulatedMouseEvents && (o.isPressed = !0, o.isOverTarget = !0, o.target = a.currentTarget, o.pointerType = oe(a.nativeEvent) ? "virtual" : "mouse", !u && !f && F(a.currentTarget), B(a, o.pointerType), w(document, "mouseup", i, !1)));
|
657
|
-
}, y.onMouseEnter = (a) => {
|
658
|
-
!a.currentTarget.contains(a.target) || (a.stopPropagation(), o.isPressed && !o.ignoreEmulatedMouseEvents && (o.isOverTarget = !0, B(a, o.pointerType)));
|
659
|
-
}, y.onMouseLeave = (a) => {
|
660
|
-
!a.currentTarget.contains(a.target) || (a.stopPropagation(), o.isPressed && !o.ignoreEmulatedMouseEvents && (o.isOverTarget = !1, h(a, o.pointerType, !1), k.current.shouldCancelOnPointerExit && T(a)));
|
661
|
-
}, y.onMouseUp = (a) => {
|
662
|
-
!a.currentTarget.contains(a.target) || !o.ignoreEmulatedMouseEvents && a.button === 0 && V(a, o.pointerType);
|
663
|
-
};
|
664
|
-
let i = (a) => {
|
665
|
-
if (a.button === 0) {
|
666
|
-
if (o.isPressed = !1, $(), o.ignoreEmulatedMouseEvents) {
|
667
|
-
o.ignoreEmulatedMouseEvents = !1;
|
668
|
-
return;
|
669
|
-
}
|
670
|
-
I(a, o.target) ? h(P(o.target, a), o.pointerType) : o.isOverTarget && h(P(o.target, a), o.pointerType, !1), o.isOverTarget = !1;
|
671
|
-
}
|
672
|
-
};
|
673
|
-
y.onTouchStart = (a) => {
|
674
|
-
if (!a.currentTarget.contains(a.target))
|
675
|
-
return;
|
676
|
-
a.stopPropagation();
|
677
|
-
let c = Ft(a.nativeEvent);
|
678
|
-
!c || (o.activePointerId = c.identifier, o.ignoreEmulatedMouseEvents = !0, o.isOverTarget = !0, o.isPressed = !0, o.target = a.currentTarget, o.pointerType = "touch", !u && !f && F(a.currentTarget), g || Te(o.target), B(a, o.pointerType), w(window, "scroll", v, !0));
|
679
|
-
}, y.onTouchMove = (a) => {
|
680
|
-
if (!a.currentTarget.contains(a.target) || (a.stopPropagation(), !o.isPressed))
|
681
|
-
return;
|
682
|
-
let c = xe(a.nativeEvent, o.activePointerId);
|
683
|
-
c && I(c, a.currentTarget) ? o.isOverTarget || (o.isOverTarget = !0, B(a, o.pointerType)) : o.isOverTarget && (o.isOverTarget = !1, h(a, o.pointerType, !1), k.current.shouldCancelOnPointerExit && T(a));
|
684
|
-
}, y.onTouchEnd = (a) => {
|
685
|
-
if (!a.currentTarget.contains(a.target) || (a.stopPropagation(), !o.isPressed))
|
686
|
-
return;
|
687
|
-
let c = xe(a.nativeEvent, o.activePointerId);
|
688
|
-
c && I(c, a.currentTarget) ? (V(a, o.pointerType), h(a, o.pointerType)) : o.isOverTarget && h(a, o.pointerType, !1), o.isPressed = !1, o.activePointerId = null, o.isOverTarget = !1, o.ignoreEmulatedMouseEvents = !0, g || X(o.target), $();
|
689
|
-
}, y.onTouchCancel = (a) => {
|
690
|
-
!a.currentTarget.contains(a.target) || (a.stopPropagation(), o.isPressed && T(a));
|
691
|
-
};
|
692
|
-
let v = (a) => {
|
693
|
-
o.isPressed && a.target.contains(o.target) && T({
|
694
|
-
currentTarget: o.target,
|
695
|
-
shiftKey: !1,
|
696
|
-
ctrlKey: !1,
|
697
|
-
metaKey: !1,
|
698
|
-
altKey: !1
|
699
|
-
});
|
700
|
-
};
|
701
|
-
y.onDragStart = (a) => {
|
702
|
-
!a.currentTarget.contains(a.target) || T(a);
|
703
|
-
};
|
704
|
-
}
|
705
|
-
return y;
|
706
|
-
}, [
|
707
|
-
w,
|
708
|
-
u,
|
709
|
-
f,
|
710
|
-
$,
|
711
|
-
g
|
712
|
-
]);
|
713
|
-
return ie(() => () => {
|
714
|
-
g || X(L.current.target);
|
715
|
-
}, [
|
716
|
-
g
|
717
|
-
]), {
|
718
|
-
isPressed: p || S,
|
719
|
-
pressProps: Q(x, N)
|
720
|
-
};
|
721
|
-
}
|
722
|
-
function se(e) {
|
723
|
-
return e.tagName === "A" && e.hasAttribute("href");
|
724
|
-
}
|
725
|
-
function Z(e, t) {
|
726
|
-
const { key: n, code: r } = e, s = t, l = s.getAttribute("role");
|
727
|
-
return (n === "Enter" || n === " " || n === "Spacebar" || r === "Space") && !(s instanceof HTMLInputElement && !Ve(s, n) || s instanceof HTMLTextAreaElement || s.isContentEditable) && (!se(s) || l === "button" && n !== "Enter") && !(l === "link" && n !== "Enter");
|
728
|
-
}
|
729
|
-
function Ft(e) {
|
730
|
-
const { targetTouches: t } = e;
|
731
|
-
return t.length > 0 ? t[0] : null;
|
732
|
-
}
|
733
|
-
function xe(e, t) {
|
734
|
-
const n = e.changedTouches;
|
735
|
-
for (let r = 0; r < n.length; r++) {
|
736
|
-
const s = n[r];
|
737
|
-
if (s.identifier === t)
|
738
|
-
return s;
|
739
|
-
}
|
740
|
-
return null;
|
741
|
-
}
|
742
|
-
function P(e, t) {
|
743
|
-
return {
|
744
|
-
currentTarget: e,
|
745
|
-
shiftKey: t.shiftKey,
|
746
|
-
ctrlKey: t.ctrlKey,
|
747
|
-
metaKey: t.metaKey,
|
748
|
-
altKey: t.altKey
|
749
|
-
};
|
750
|
-
}
|
751
|
-
function _t(e) {
|
752
|
-
let t = e.width / 2 || e.radiusX || 0, n = e.height / 2 || e.radiusY || 0;
|
753
|
-
return {
|
754
|
-
top: e.clientY - n,
|
755
|
-
right: e.clientX + t,
|
756
|
-
bottom: e.clientY + n,
|
757
|
-
left: e.clientX - t
|
758
|
-
};
|
759
|
-
}
|
760
|
-
function Rt(e, t) {
|
761
|
-
return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
|
762
|
-
}
|
763
|
-
function I(e, t) {
|
764
|
-
let n = t.getBoundingClientRect(), r = _t(e);
|
765
|
-
return Rt(n, r);
|
766
|
-
}
|
767
|
-
function ee(e) {
|
768
|
-
return !(e instanceof HTMLElement) || !e.draggable;
|
769
|
-
}
|
770
|
-
function Se(e, t) {
|
771
|
-
return e instanceof HTMLInputElement ? !Ve(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" : !0;
|
772
|
-
}
|
773
|
-
const Ut = /* @__PURE__ */ new Set([
|
774
|
-
"checkbox",
|
775
|
-
"radio",
|
776
|
-
"range",
|
777
|
-
"color",
|
778
|
-
"file",
|
779
|
-
"image",
|
780
|
-
"button",
|
781
|
-
"submit",
|
782
|
-
"reset"
|
783
|
-
]);
|
784
|
-
function Ve(e, t) {
|
785
|
-
return e.type === "checkbox" || e.type === "radio" ? t === " " : Ut.has(e.type);
|
786
|
-
}
|
787
|
-
function Vt(e) {
|
788
|
-
return e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
|
789
|
-
}
|
790
|
-
let Gt = /* @__PURE__ */ new Set(), Ne = !1, C = !1, ae = !1;
|
791
|
-
function de(e, t) {
|
792
|
-
for (let n of Gt)
|
793
|
-
n(e, t);
|
794
|
-
}
|
795
|
-
function Ht(e) {
|
796
|
-
return !(e.metaKey || !_e() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
797
|
-
}
|
798
|
-
function De(e) {
|
799
|
-
C = !0, Ht(e) && de("keyboard", e);
|
800
|
-
}
|
801
|
-
function M(e) {
|
802
|
-
(e.type === "mousedown" || e.type === "pointerdown") && (C = !0, de("pointer", e));
|
803
|
-
}
|
804
|
-
function Wt(e) {
|
805
|
-
oe(e) && (C = !0);
|
806
|
-
}
|
807
|
-
function jt(e) {
|
808
|
-
e.target === window || e.target === document || (!C && !ae && de("virtual", e), C = !1, ae = !1);
|
809
|
-
}
|
810
|
-
function zt() {
|
811
|
-
C = !1, ae = !0;
|
812
|
-
}
|
813
|
-
function Ce() {
|
814
|
-
if (typeof window > "u" || Ne)
|
815
|
-
return;
|
816
|
-
let e = HTMLElement.prototype.focus;
|
817
|
-
HTMLElement.prototype.focus = function() {
|
818
|
-
C = !0, e.apply(this, arguments);
|
819
|
-
}, document.addEventListener("keydown", De, !0), document.addEventListener("keyup", De, !0), document.addEventListener("click", Wt, !0), window.addEventListener("focus", jt, !0), window.addEventListener("blur", zt, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", M, !0), document.addEventListener("pointermove", M, !0), document.addEventListener("pointerup", M, !0)) : (document.addEventListener("mousedown", M, !0), document.addEventListener("mousemove", M, !0), document.addEventListener("mouseup", M, !0)), Ne = !0;
|
820
|
-
}
|
821
|
-
typeof document < "u" && (document.readyState !== "loading" ? Ce() : document.addEventListener("DOMContentLoaded", Ce));
|
822
|
-
function Yt(e, t) {
|
878
|
+
function Mt(e, t) {
|
823
879
|
let {
|
824
880
|
elementType: n = "button",
|
825
|
-
isDisabled:
|
881
|
+
isDisabled: o,
|
826
882
|
onPress: s,
|
827
|
-
onPressStart:
|
828
|
-
onPressEnd:
|
883
|
+
onPressStart: u,
|
884
|
+
onPressEnd: c,
|
885
|
+
onPressUp: m,
|
829
886
|
onPressChange: p,
|
830
|
-
preventFocusOnPress:
|
831
|
-
allowFocusWhenDisabled:
|
832
|
-
onClick:
|
887
|
+
preventFocusOnPress: y,
|
888
|
+
allowFocusWhenDisabled: $,
|
889
|
+
onClick: D,
|
833
890
|
href: O,
|
834
|
-
target:
|
835
|
-
rel:
|
836
|
-
type:
|
837
|
-
} = e,
|
838
|
-
n === "button" ?
|
839
|
-
type:
|
840
|
-
disabled:
|
841
|
-
} :
|
891
|
+
target: V,
|
892
|
+
rel: C,
|
893
|
+
type: T = "button"
|
894
|
+
} = e, w;
|
895
|
+
n === "button" ? w = {
|
896
|
+
type: T,
|
897
|
+
disabled: o
|
898
|
+
} : w = {
|
842
899
|
role: "button",
|
843
|
-
tabIndex:
|
844
|
-
href: n === "a" &&
|
845
|
-
target: n === "a" ?
|
846
|
-
type: n === "input" ?
|
847
|
-
disabled: n === "input" ?
|
848
|
-
"aria-disabled": !
|
849
|
-
rel: n === "a" ?
|
900
|
+
tabIndex: o ? void 0 : 0,
|
901
|
+
href: n === "a" && o ? void 0 : O,
|
902
|
+
target: n === "a" ? V : void 0,
|
903
|
+
type: n === "input" ? T : void 0,
|
904
|
+
disabled: n === "input" ? o : void 0,
|
905
|
+
"aria-disabled": !o || n === "input" ? void 0 : o,
|
906
|
+
rel: n === "a" ? C : void 0
|
850
907
|
};
|
851
|
-
let { pressProps:
|
852
|
-
onPressStart:
|
853
|
-
onPressEnd:
|
908
|
+
let { pressProps: x, isPressed: k } = yt({
|
909
|
+
onPressStart: u,
|
910
|
+
onPressEnd: c,
|
854
911
|
onPressChange: p,
|
855
912
|
onPress: s,
|
856
|
-
|
857
|
-
|
913
|
+
onPressUp: m,
|
914
|
+
isDisabled: o,
|
915
|
+
preventFocusOnPress: y,
|
858
916
|
ref: t
|
859
|
-
}), { focusableProps:
|
860
|
-
|
861
|
-
let
|
917
|
+
}), { focusableProps: v } = At(e, t);
|
918
|
+
$ && (v.tabIndex = o ? -1 : v.tabIndex);
|
919
|
+
let P = U(v, x, nt(e, {
|
862
920
|
labelable: !0
|
863
921
|
}));
|
864
922
|
return {
|
865
|
-
isPressed:
|
866
|
-
buttonProps:
|
923
|
+
isPressed: k,
|
924
|
+
buttonProps: U(w, P, {
|
867
925
|
"aria-haspopup": e["aria-haspopup"],
|
868
926
|
"aria-expanded": e["aria-expanded"],
|
869
927
|
"aria-controls": e["aria-controls"],
|
870
928
|
"aria-pressed": e["aria-pressed"],
|
871
|
-
onClick: (
|
872
|
-
|
929
|
+
onClick: (B) => {
|
930
|
+
D && (D(B), console.warn("onClick is deprecated, please use onPress"));
|
873
931
|
}
|
874
932
|
})
|
875
933
|
};
|
876
934
|
}
|
877
|
-
function
|
935
|
+
function Ft(e, t, n) {
|
878
936
|
return t in e ? Object.defineProperty(e, t, {
|
879
937
|
value: n,
|
880
938
|
enumerable: !0,
|
@@ -882,98 +940,98 @@ function qt(e, t, n) {
|
|
882
940
|
writable: !0
|
883
941
|
}) : e[t] = n, e;
|
884
942
|
}
|
885
|
-
function
|
943
|
+
function Se(e, t) {
|
886
944
|
var n = Object.keys(e);
|
887
945
|
if (Object.getOwnPropertySymbols) {
|
888
|
-
var
|
889
|
-
t && (
|
946
|
+
var o = Object.getOwnPropertySymbols(e);
|
947
|
+
t && (o = o.filter(function(s) {
|
890
948
|
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
891
|
-
})), n.push.apply(n,
|
949
|
+
})), n.push.apply(n, o);
|
892
950
|
}
|
893
951
|
return n;
|
894
952
|
}
|
895
|
-
function
|
953
|
+
function Ne(e) {
|
896
954
|
for (var t = 1; t < arguments.length; t++) {
|
897
955
|
var n = arguments[t] != null ? arguments[t] : {};
|
898
|
-
t % 2 ?
|
899
|
-
|
900
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
901
|
-
Object.defineProperty(e,
|
956
|
+
t % 2 ? Se(Object(n), !0).forEach(function(o) {
|
957
|
+
Ft(e, o, n[o]);
|
958
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Se(Object(n)).forEach(function(o) {
|
959
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(n, o));
|
902
960
|
});
|
903
961
|
}
|
904
962
|
return e;
|
905
963
|
}
|
906
|
-
var
|
907
|
-
for (var
|
964
|
+
var Rt = (e, t, n) => {
|
965
|
+
for (var o of Object.keys(e)) {
|
908
966
|
var s;
|
909
|
-
if (e[
|
967
|
+
if (e[o] !== ((s = t[o]) !== null && s !== void 0 ? s : n[o]))
|
910
968
|
return !1;
|
911
969
|
}
|
912
970
|
return !0;
|
913
971
|
}, z = (e) => (t) => {
|
914
|
-
var n = e.defaultClassName,
|
915
|
-
for (var s in
|
916
|
-
var
|
917
|
-
if (
|
918
|
-
var
|
919
|
-
typeof
|
920
|
-
var
|
921
|
-
|
972
|
+
var n = e.defaultClassName, o = Ne(Ne({}, e.defaultVariants), t);
|
973
|
+
for (var s in o) {
|
974
|
+
var u, c = (u = o[s]) !== null && u !== void 0 ? u : e.defaultVariants[s];
|
975
|
+
if (c != null) {
|
976
|
+
var m = c;
|
977
|
+
typeof m == "boolean" && (m = m === !0 ? "true" : "false");
|
978
|
+
var p = e.variantClassNames[s][m];
|
979
|
+
p && (n += " " + p);
|
922
980
|
}
|
923
981
|
}
|
924
|
-
for (var [
|
925
|
-
|
982
|
+
for (var [y, $] of e.compoundVariants)
|
983
|
+
Rt(y, o, e.defaultVariants) && (n += " " + $);
|
926
984
|
return n;
|
927
|
-
},
|
928
|
-
const
|
985
|
+
}, Ut = z({ 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"]] }), Vt = z({ 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: [] }), Gt = z({ defaultClassName: "_125pcxyv", variantClassNames: { kind: { icon: "_125pcxyw", default: "_125pcxyx", key: "_125pcxyy", delete: "_125pcxyz", confirm: "_125pcxy10", link: "_125pcxy11" } }, defaultVariants: { kind: "default" }, compoundVariants: [] }), Wt = z({ defaultClassName: "_125pcxy12", variantClassNames: { spinning: { true: "_125pcxy13", false: "_125pcxy14" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), Ht = z({ defaultClassName: "_125pcxys", variantClassNames: { spinning: { true: "_125pcxyt", false: "_125pcxyu" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
|
986
|
+
const Re = d.forwardRef(
|
929
987
|
({
|
930
988
|
onClick: e,
|
931
989
|
onPress: t,
|
932
990
|
children: n,
|
933
|
-
className:
|
991
|
+
className: o,
|
934
992
|
isDisabled: s,
|
935
|
-
disabled:
|
936
|
-
href:
|
937
|
-
icon:
|
938
|
-
kind:
|
939
|
-
spinning:
|
940
|
-
spinningTitle:
|
941
|
-
...
|
942
|
-
},
|
993
|
+
disabled: u,
|
994
|
+
href: c,
|
995
|
+
icon: m,
|
996
|
+
kind: p = "default",
|
997
|
+
spinning: y,
|
998
|
+
spinningTitle: $,
|
999
|
+
...D
|
1000
|
+
}, O) => {
|
943
1001
|
var B;
|
944
|
-
const
|
1002
|
+
const V = {
|
945
1003
|
onPress: t != null ? t : e,
|
946
|
-
isDisabled: (B =
|
947
|
-
...
|
948
|
-
}, { "data-testid":
|
949
|
-
className:
|
950
|
-
icon:
|
1004
|
+
isDisabled: (B = u != null ? u : s) != null ? B : y,
|
1005
|
+
...D
|
1006
|
+
}, { "data-testid": C } = D, T = O != null ? O : d.useRef(null), { buttonProps: w } = Mt(V, T), { t: x } = d.useContext(We), k = m && /* @__PURE__ */ d.createElement(He, {
|
1007
|
+
className: Gt({ kind: p }),
|
1008
|
+
icon: m,
|
951
1009
|
"aria-hidden": "true",
|
952
|
-
"data-testid": `${
|
1010
|
+
"data-testid": `${C}__${m}-icon`
|
953
1011
|
});
|
954
|
-
let
|
955
|
-
|
956
|
-
const
|
957
|
-
color:
|
958
|
-
className:
|
959
|
-
title:
|
960
|
-
"data-testid": `${
|
1012
|
+
let v;
|
1013
|
+
p === "default" || p === "icon" || p === "link" ? v = "dark" : v = "light";
|
1014
|
+
const P = y && /* @__PURE__ */ d.createElement(je, {
|
1015
|
+
color: v,
|
1016
|
+
className: Wt({ spinning: y }),
|
1017
|
+
title: $ || x("design-system:button.spinningTitle"),
|
1018
|
+
"data-testid": `${C}__spinner`
|
961
1019
|
});
|
962
1020
|
return /* @__PURE__ */ d.createElement("div", {
|
963
|
-
className:
|
964
|
-
},
|
965
|
-
className:
|
966
|
-
...
|
967
|
-
href:
|
968
|
-
},
|
969
|
-
className:
|
1021
|
+
className: ze(Ut({ disabled: s || u, kind: p, spinning: y }), o)
|
1022
|
+
}, c ? /* @__PURE__ */ d.createElement("a", {
|
1023
|
+
className: Ht({ spinning: y }),
|
1024
|
+
...D,
|
1025
|
+
href: c
|
1026
|
+
}, k, n, P) : /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("button", {
|
1027
|
+
className: Vt({ disabled: s || u, kind: p, spinning: y }),
|
970
1028
|
disabled: s,
|
971
|
-
...
|
972
|
-
ref:
|
973
|
-
},
|
1029
|
+
...w,
|
1030
|
+
ref: T
|
1031
|
+
}, k, n, P)));
|
974
1032
|
}
|
975
1033
|
);
|
976
|
-
|
1034
|
+
Ye.set(Re, {
|
977
1035
|
name: "Buttons",
|
978
1036
|
props: {
|
979
1037
|
disabled: "boolean",
|
@@ -988,8 +1046,8 @@ Qe.set(Ge, {
|
|
988
1046
|
type: { type: '"button" | "submit"', default: '"button"' }
|
989
1047
|
}
|
990
1048
|
});
|
991
|
-
const
|
992
|
-
components: [
|
1049
|
+
const jt = {
|
1050
|
+
components: [Re],
|
993
1051
|
description: () => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", {
|
994
1052
|
className: "sps-body-14"
|
995
1053
|
}, "Buttons are used to initiate events or actions. The labels and/or icons describe what the button will do."), /* @__PURE__ */ d.createElement("br", null), /* @__PURE__ */ d.createElement("h5", null, "Variants"), /* @__PURE__ */ d.createElement("div", {
|
@@ -1026,7 +1084,7 @@ const nn = {
|
|
1026
1084
|
examples: {
|
1027
1085
|
withoutIcons: {
|
1028
1086
|
description: "Without Icons",
|
1029
|
-
react:
|
1087
|
+
react: g`
|
1030
1088
|
import { Button } from "@sps-woodland/buttons";
|
1031
1089
|
import { sprinkles } from "@sps-woodland/tokens";
|
1032
1090
|
|
@@ -1045,7 +1103,7 @@ const nn = {
|
|
1045
1103
|
},
|
1046
1104
|
withIcons: {
|
1047
1105
|
description: "With Icons",
|
1048
|
-
react:
|
1106
|
+
react: g`
|
1049
1107
|
import { Button } from "@sps-woodland/buttons";
|
1050
1108
|
import { sprinkles } from "@sps-woodland/tokens";
|
1051
1109
|
|
@@ -1064,7 +1122,7 @@ const nn = {
|
|
1064
1122
|
},
|
1065
1123
|
spinning: {
|
1066
1124
|
description: "Spinning",
|
1067
|
-
react:
|
1125
|
+
react: g`
|
1068
1126
|
import { Button } from "@sps-woodland/buttons";
|
1069
1127
|
import { sprinkles } from "@sps-woodland/tokens";
|
1070
1128
|
|
@@ -1088,7 +1146,7 @@ const nn = {
|
|
1088
1146
|
examples: {
|
1089
1147
|
withoutIcons: {
|
1090
1148
|
description: "Without Icons",
|
1091
|
-
react:
|
1149
|
+
react: g`
|
1092
1150
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1093
1151
|
|
1094
1152
|
function Component() {
|
@@ -1130,7 +1188,7 @@ const nn = {
|
|
1130
1188
|
},
|
1131
1189
|
withIcons: {
|
1132
1190
|
description: "With Icons",
|
1133
|
-
react:
|
1191
|
+
react: g`
|
1134
1192
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1135
1193
|
|
1136
1194
|
function Component() {
|
@@ -1177,7 +1235,7 @@ const nn = {
|
|
1177
1235
|
},
|
1178
1236
|
spinning: {
|
1179
1237
|
description: "Spinning",
|
1180
|
-
react:
|
1238
|
+
react: g`
|
1181
1239
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1182
1240
|
|
1183
1241
|
function Component() {
|
@@ -1223,7 +1281,7 @@ const nn = {
|
|
1223
1281
|
examples: {
|
1224
1282
|
withoutIcons: {
|
1225
1283
|
description: "Without Icons",
|
1226
|
-
react:
|
1284
|
+
react: g`
|
1227
1285
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
1228
1286
|
|
1229
1287
|
function Component() {
|
@@ -1253,7 +1311,7 @@ const nn = {
|
|
1253
1311
|
},
|
1254
1312
|
withIcons: {
|
1255
1313
|
description: "With Icons",
|
1256
|
-
react:
|
1314
|
+
react: g`
|
1257
1315
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
1258
1316
|
|
1259
1317
|
function Component() {
|
@@ -1305,7 +1363,7 @@ const nn = {
|
|
1305
1363
|
examples: {
|
1306
1364
|
standard: {
|
1307
1365
|
description: "Standard Icon Buttons",
|
1308
|
-
react:
|
1366
|
+
react: g`
|
1309
1367
|
import { Button } from "@sps-woodland/buttons";
|
1310
1368
|
import { sprinkles } from "@sps-woodland/tokens";
|
1311
1369
|
|
@@ -1330,7 +1388,7 @@ const nn = {
|
|
1330
1388
|
description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Dropdown Icon Buttons"), /* @__PURE__ */ d.createElement("p", null, "Use these when there are several options available for action. Example: Dropdown Icon Button in a ", /* @__PURE__ */ d.createElement(e, {
|
1331
1389
|
to: "content-rows"
|
1332
1390
|
}, "Content Row"), ".")),
|
1333
|
-
react:
|
1391
|
+
react: g`
|
1334
1392
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1335
1393
|
|
1336
1394
|
function Component() {
|
@@ -1348,7 +1406,7 @@ const nn = {
|
|
1348
1406
|
},
|
1349
1407
|
spinner: {
|
1350
1408
|
description: "Spinner",
|
1351
|
-
react:
|
1409
|
+
react: g`
|
1352
1410
|
import { Button } from "@sps-woodland/buttons";
|
1353
1411
|
|
1354
1412
|
function Component() {
|
@@ -1370,7 +1428,7 @@ const nn = {
|
|
1370
1428
|
examples: {
|
1371
1429
|
withoutIcons: {
|
1372
1430
|
description: "Without Icons",
|
1373
|
-
react:
|
1431
|
+
react: g`
|
1374
1432
|
import { Button } from "@sps-woodland/buttons";
|
1375
1433
|
import { sprinkles } from "@sps-woodland/tokens";
|
1376
1434
|
|
@@ -1387,7 +1445,7 @@ const nn = {
|
|
1387
1445
|
},
|
1388
1446
|
withIcons: {
|
1389
1447
|
description: "With Icons",
|
1390
|
-
react:
|
1448
|
+
react: g`
|
1391
1449
|
import { Button } from "@sps-woodland/buttons";
|
1392
1450
|
import { sprinkles } from "@sps-woodland/tokens";
|
1393
1451
|
|
@@ -1404,7 +1462,7 @@ const nn = {
|
|
1404
1462
|
},
|
1405
1463
|
spinner: {
|
1406
1464
|
description: "Spinner",
|
1407
|
-
react:
|
1465
|
+
react: g`
|
1408
1466
|
import { Button } from "@sps-woodland/buttons";
|
1409
1467
|
|
1410
1468
|
function Component() {
|
@@ -1425,7 +1483,7 @@ const nn = {
|
|
1425
1483
|
}, "Modal"), " uses Basic Button (Key) as its Submit Button."),
|
1426
1484
|
examples: {
|
1427
1485
|
basic: {
|
1428
|
-
react:
|
1486
|
+
react: g`
|
1429
1487
|
import { Button } from "@sps-woodland/buttons";
|
1430
1488
|
import { sprinkles } from "@sps-woodland/tokens";
|
1431
1489
|
|
@@ -1453,7 +1511,7 @@ const nn = {
|
|
1453
1511
|
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.",
|
1454
1512
|
examples: {
|
1455
1513
|
basic: {
|
1456
|
-
react:
|
1514
|
+
react: g`
|
1457
1515
|
import { Button } from "@sps-woodland/buttons";
|
1458
1516
|
|
1459
1517
|
function Component() {
|
@@ -1477,7 +1535,7 @@ const nn = {
|
|
1477
1535
|
examples: {
|
1478
1536
|
basic: {
|
1479
1537
|
description: "Basic Button Groups",
|
1480
|
-
react:
|
1538
|
+
react: g`
|
1481
1539
|
import { Button } from "@sps-woodland/buttons";
|
1482
1540
|
import { sprinkles } from "@sps-woodland/tokens";
|
1483
1541
|
|
@@ -1493,7 +1551,7 @@ const nn = {
|
|
1493
1551
|
},
|
1494
1552
|
icon: {
|
1495
1553
|
description: "Icon Button Groups",
|
1496
|
-
react:
|
1554
|
+
react: g`
|
1497
1555
|
import { Button } from "@sps-woodland/buttons";
|
1498
1556
|
|
1499
1557
|
function Component() {
|
@@ -1508,7 +1566,7 @@ const nn = {
|
|
1508
1566
|
},
|
1509
1567
|
textAndIcons: {
|
1510
1568
|
description: "Text Buttons + Icon Buttons Group",
|
1511
|
-
react:
|
1569
|
+
react: g`
|
1512
1570
|
import { Button } from "@sps-woodland/buttons";
|
1513
1571
|
import { sprinkles } from "@sps-woodland/tokens";
|
1514
1572
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1527,7 +1585,7 @@ const nn = {
|
|
1527
1585
|
},
|
1528
1586
|
textAndBasic: {
|
1529
1587
|
description: "Text Buttons + Basic Buttons Group",
|
1530
|
-
react:
|
1588
|
+
react: g`
|
1531
1589
|
import { Button } from "@sps-woodland/buttons";
|
1532
1590
|
import { sprinkles } from "@sps-woodland/tokens";
|
1533
1591
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1547,7 +1605,7 @@ const nn = {
|
|
1547
1605
|
},
|
1548
1606
|
iconsAndBasic: {
|
1549
1607
|
description: "Icon Buttons + Basic Buttons Group",
|
1550
|
-
react:
|
1608
|
+
react: g`
|
1551
1609
|
import { Button } from "@sps-woodland/buttons";
|
1552
1610
|
import { sprinkles } from "@sps-woodland/tokens";
|
1553
1611
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1568,7 +1626,7 @@ const nn = {
|
|
1568
1626
|
},
|
1569
1627
|
textIconsAndBasic: {
|
1570
1628
|
description: "Text Buttons + Icon Buttons + Basic Buttons Group",
|
1571
|
-
react:
|
1629
|
+
react: g`
|
1572
1630
|
import { Button } from "@sps-woodland/buttons";
|
1573
1631
|
import { sprinkles } from "@sps-woodland/tokens";
|
1574
1632
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1592,10 +1650,10 @@ const nn = {
|
|
1592
1650
|
}
|
1593
1651
|
}
|
1594
1652
|
}
|
1595
|
-
},
|
1596
|
-
Buttons:
|
1653
|
+
}, qt = {
|
1654
|
+
Buttons: jt
|
1597
1655
|
};
|
1598
1656
|
export {
|
1599
|
-
|
1600
|
-
|
1657
|
+
Re as Button,
|
1658
|
+
qt as MANIFEST
|
1601
1659
|
};
|