@sps-woodland/buttons 8.50.2 → 8.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +38 -1443
- package/lib/index.umd.cjs +23 -29
- package/lib/style.css +1 -1
- package/package.json +5 -19
- package/vite.config.mjs +6 -13
- package/lib/button/Button.css.d.ts +0 -14
- package/lib/button/Button.d.ts +0 -18
package/lib/index.js
CHANGED
|
@@ -1,1422 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const oe = typeof document < "u" ? _e.useLayoutEffect : () => {
|
|
9
|
-
};
|
|
10
|
-
let Be = /* @__PURE__ */ new Map();
|
|
11
|
-
typeof FinalizationRegistry < "u" && new FinalizationRegistry((e) => {
|
|
12
|
-
Be.delete(e);
|
|
13
|
-
});
|
|
14
|
-
function At(e, t) {
|
|
15
|
-
if (e === t) return e;
|
|
16
|
-
let n = Be.get(e);
|
|
17
|
-
if (n)
|
|
18
|
-
return n.forEach((i) => i.current = t), t;
|
|
19
|
-
let r = Be.get(t);
|
|
20
|
-
return r ? (r.forEach((i) => i.current = e), e) : t;
|
|
21
|
-
}
|
|
22
|
-
function ut(...e) {
|
|
23
|
-
return (...t) => {
|
|
24
|
-
for (let n of e) typeof n == "function" && n(...t);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
const P = (e) => {
|
|
28
|
-
var t;
|
|
29
|
-
return (t = e?.ownerDocument) !== null && t !== void 0 ? t : document;
|
|
30
|
-
}, M = (e) => e && "window" in e && e.window === e ? e : P(e).defaultView || window;
|
|
31
|
-
function It(e) {
|
|
32
|
-
return e !== null && typeof e == "object" && "nodeType" in e && typeof e.nodeType == "number";
|
|
33
|
-
}
|
|
34
|
-
function Mt(e) {
|
|
35
|
-
return It(e) && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in e;
|
|
36
|
-
}
|
|
37
|
-
let Kt = !1;
|
|
38
|
-
function Ae() {
|
|
39
|
-
return Kt;
|
|
40
|
-
}
|
|
41
|
-
function y(e, t) {
|
|
42
|
-
if (!Ae()) return t && e ? e.contains(t) : !1;
|
|
43
|
-
if (!e || !t) return !1;
|
|
44
|
-
let n = t;
|
|
45
|
-
for (; n !== null; ) {
|
|
46
|
-
if (n === e) return !0;
|
|
47
|
-
n.tagName === "SLOT" && n.assignedSlot ? n = n.assignedSlot.parentNode : Mt(n) ? n = n.host : n = n.parentNode;
|
|
48
|
-
}
|
|
49
|
-
return !1;
|
|
50
|
-
}
|
|
51
|
-
const q = (e = document) => {
|
|
52
|
-
var t;
|
|
53
|
-
if (!Ae()) return e.activeElement;
|
|
54
|
-
let n = e.activeElement;
|
|
55
|
-
for (; n && "shadowRoot" in n && (!((t = n.shadowRoot) === null || t === void 0) && t.activeElement); ) n = n.shadowRoot.activeElement;
|
|
56
|
-
return n;
|
|
57
|
-
};
|
|
58
|
-
function b(e) {
|
|
59
|
-
if (Ae() && e.target instanceof Element && e.target.shadowRoot) {
|
|
60
|
-
var t, n;
|
|
61
|
-
if ("composedPath" in e) return (t = e.composedPath()[0]) !== null && t !== void 0 ? t : null;
|
|
62
|
-
if ("composedPath" in e.nativeEvent) return (n = e.nativeEvent.composedPath()[0]) !== null && n !== void 0 ? n : null;
|
|
63
|
-
}
|
|
64
|
-
return e.target;
|
|
65
|
-
}
|
|
66
|
-
function Ft(...e) {
|
|
67
|
-
return e.length === 1 && e[0] ? e[0] : (t) => {
|
|
68
|
-
let n = !1;
|
|
69
|
-
const r = e.map((i) => {
|
|
70
|
-
const l = He(i, t);
|
|
71
|
-
return n || (n = typeof l == "function"), l;
|
|
72
|
-
});
|
|
73
|
-
if (n) return () => {
|
|
74
|
-
r.forEach((i, l) => {
|
|
75
|
-
typeof i == "function" ? i() : He(e[l], null);
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function He(e, t) {
|
|
81
|
-
if (typeof e == "function") return e(t);
|
|
82
|
-
e != null && (e.current = t);
|
|
83
|
-
}
|
|
84
|
-
function ct(e) {
|
|
85
|
-
var t, n, r = "";
|
|
86
|
-
if (typeof e == "string" || typeof e == "number") r += e;
|
|
87
|
-
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
88
|
-
var i = e.length;
|
|
89
|
-
for (t = 0; t < i; t++) e[t] && (n = ct(e[t])) && (r && (r += " "), r += n);
|
|
90
|
-
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
91
|
-
return r;
|
|
92
|
-
}
|
|
93
|
-
function Vt() {
|
|
94
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = ct(e)) && (r && (r += " "), r += t);
|
|
95
|
-
return r;
|
|
96
|
-
}
|
|
97
|
-
function j(...e) {
|
|
98
|
-
let t = {
|
|
99
|
-
...e[0]
|
|
100
|
-
};
|
|
101
|
-
for (let n = 1; n < e.length; n++) {
|
|
102
|
-
let r = e[n];
|
|
103
|
-
for (let i in r) {
|
|
104
|
-
let l = t[i], u = r[i];
|
|
105
|
-
typeof l == "function" && typeof u == "function" && // This is a lot faster than a regex.
|
|
106
|
-
i[0] === "o" && i[1] === "n" && i.charCodeAt(2) >= /* 'A' */
|
|
107
|
-
65 && i.charCodeAt(2) <= /* 'Z' */
|
|
108
|
-
90 ? t[i] = ut(l, u) : (i === "className" || i === "UNSAFE_className") && typeof l == "string" && typeof u == "string" ? t[i] = Vt(l, u) : i === "id" && l && u ? t.id = At(l, u) : i === "ref" && l && u ? t.ref = Ft(l, u) : t[i] = u !== void 0 ? u : l;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return t;
|
|
112
|
-
}
|
|
113
|
-
const Ut = /* @__PURE__ */ new Set([
|
|
114
|
-
"id"
|
|
115
|
-
]), Rt = /* @__PURE__ */ new Set([
|
|
116
|
-
"aria-label",
|
|
117
|
-
"aria-labelledby",
|
|
118
|
-
"aria-describedby",
|
|
119
|
-
"aria-details"
|
|
120
|
-
]), Ht = /* @__PURE__ */ new Set([
|
|
121
|
-
"href",
|
|
122
|
-
"hrefLang",
|
|
123
|
-
"target",
|
|
124
|
-
"rel",
|
|
125
|
-
"download",
|
|
126
|
-
"ping",
|
|
127
|
-
"referrerPolicy"
|
|
128
|
-
]), Gt = /* @__PURE__ */ new Set([
|
|
129
|
-
"dir",
|
|
130
|
-
"lang",
|
|
131
|
-
"hidden",
|
|
132
|
-
"inert",
|
|
133
|
-
"translate"
|
|
134
|
-
]), Ge = /* @__PURE__ */ new Set([
|
|
135
|
-
"onClick",
|
|
136
|
-
"onAuxClick",
|
|
137
|
-
"onContextMenu",
|
|
138
|
-
"onDoubleClick",
|
|
139
|
-
"onMouseDown",
|
|
140
|
-
"onMouseEnter",
|
|
141
|
-
"onMouseLeave",
|
|
142
|
-
"onMouseMove",
|
|
143
|
-
"onMouseOut",
|
|
144
|
-
"onMouseOver",
|
|
145
|
-
"onMouseUp",
|
|
146
|
-
"onTouchCancel",
|
|
147
|
-
"onTouchEnd",
|
|
148
|
-
"onTouchMove",
|
|
149
|
-
"onTouchStart",
|
|
150
|
-
"onPointerDown",
|
|
151
|
-
"onPointerMove",
|
|
152
|
-
"onPointerUp",
|
|
153
|
-
"onPointerCancel",
|
|
154
|
-
"onPointerEnter",
|
|
155
|
-
"onPointerLeave",
|
|
156
|
-
"onPointerOver",
|
|
157
|
-
"onPointerOut",
|
|
158
|
-
"onGotPointerCapture",
|
|
159
|
-
"onLostPointerCapture",
|
|
160
|
-
"onScroll",
|
|
161
|
-
"onWheel",
|
|
162
|
-
"onAnimationStart",
|
|
163
|
-
"onAnimationEnd",
|
|
164
|
-
"onAnimationIteration",
|
|
165
|
-
"onTransitionCancel",
|
|
166
|
-
"onTransitionEnd",
|
|
167
|
-
"onTransitionRun",
|
|
168
|
-
"onTransitionStart"
|
|
169
|
-
]), jt = /^(data-.*)$/;
|
|
170
|
-
function Wt(e, t = {}) {
|
|
171
|
-
let { labelable: n, isLink: r, global: i, events: l = i, propNames: u } = t, a = {};
|
|
172
|
-
for (const c in e) Object.prototype.hasOwnProperty.call(e, c) && (Ut.has(c) || n && Rt.has(c) || r && Ht.has(c) || i && Gt.has(c) || l && (Ge.has(c) || c.endsWith("Capture") && Ge.has(c.slice(0, -7))) || u?.has(c) || jt.test(c)) && (a[c] = e[c]);
|
|
173
|
-
return a;
|
|
174
|
-
}
|
|
175
|
-
function J(e) {
|
|
176
|
-
if (Yt()) e.focus({
|
|
177
|
-
preventScroll: !0
|
|
178
|
-
});
|
|
179
|
-
else {
|
|
180
|
-
let t = Xt(e);
|
|
181
|
-
e.focus(), zt(t);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
let le = null;
|
|
185
|
-
function Yt() {
|
|
186
|
-
if (le == null) {
|
|
187
|
-
le = !1;
|
|
188
|
-
try {
|
|
189
|
-
document.createElement("div").focus({
|
|
190
|
-
get preventScroll() {
|
|
191
|
-
return le = !0, !0;
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
} catch {
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return le;
|
|
198
|
-
}
|
|
199
|
-
function Xt(e) {
|
|
200
|
-
let t = e.parentNode, n = [], r = document.scrollingElement || document.documentElement;
|
|
201
|
-
for (; t instanceof HTMLElement && t !== r; )
|
|
202
|
-
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && n.push({
|
|
203
|
-
element: t,
|
|
204
|
-
scrollTop: t.scrollTop,
|
|
205
|
-
scrollLeft: t.scrollLeft
|
|
206
|
-
}), t = t.parentNode;
|
|
207
|
-
return r instanceof HTMLElement && n.push({
|
|
208
|
-
element: r,
|
|
209
|
-
scrollTop: r.scrollTop,
|
|
210
|
-
scrollLeft: r.scrollLeft
|
|
211
|
-
}), n;
|
|
212
|
-
}
|
|
213
|
-
function zt(e) {
|
|
214
|
-
for (let { element: t, scrollTop: n, scrollLeft: r } of e)
|
|
215
|
-
t.scrollTop = n, t.scrollLeft = r;
|
|
216
|
-
}
|
|
217
|
-
function he(e) {
|
|
218
|
-
var t;
|
|
219
|
-
if (typeof window > "u" || window.navigator == null) return !1;
|
|
220
|
-
let n = (t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands;
|
|
221
|
-
return Array.isArray(n) && n.some((r) => e.test(r.brand)) || e.test(window.navigator.userAgent);
|
|
222
|
-
}
|
|
223
|
-
function Ie(e) {
|
|
224
|
-
var t;
|
|
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;
|
|
226
|
-
}
|
|
227
|
-
function K(e) {
|
|
228
|
-
if (process.env.NODE_ENV === "test") return e;
|
|
229
|
-
let t = null;
|
|
230
|
-
return () => (t == null && (t = e()), t);
|
|
231
|
-
}
|
|
232
|
-
const Q = K(function() {
|
|
233
|
-
return Ie(/^Mac/i);
|
|
234
|
-
}), qt = K(function() {
|
|
235
|
-
return Ie(/^iPhone/i);
|
|
236
|
-
}), dt = K(function() {
|
|
237
|
-
return Ie(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
238
|
-
Q() && navigator.maxTouchPoints > 1;
|
|
239
|
-
}), Me = K(function() {
|
|
240
|
-
return qt() || dt();
|
|
241
|
-
});
|
|
242
|
-
K(function() {
|
|
243
|
-
return Q() || Me();
|
|
244
|
-
});
|
|
245
|
-
const Jt = K(function() {
|
|
246
|
-
return he(/AppleWebKit/i) && !Qt();
|
|
247
|
-
}), Qt = K(function() {
|
|
248
|
-
return he(/Chrome/i);
|
|
249
|
-
}), pt = K(function() {
|
|
250
|
-
return he(/Android/i);
|
|
251
|
-
}), Zt = K(function() {
|
|
252
|
-
return he(/Firefox/i);
|
|
253
|
-
});
|
|
254
|
-
function W(e, t, n = !0) {
|
|
255
|
-
var r, i;
|
|
256
|
-
let { metaKey: l, ctrlKey: u, altKey: a, shiftKey: c } = t;
|
|
257
|
-
Zt() && (!((i = window.event) === null || i === void 0 || (r = i.type) === null || r === void 0) && r.startsWith("key")) && e.target === "_blank" && (Q() ? l = !0 : u = !0);
|
|
258
|
-
let v = Jt() && Q() && !dt() && process.env.NODE_ENV !== "test" ? new KeyboardEvent("keydown", {
|
|
259
|
-
keyIdentifier: "Enter",
|
|
260
|
-
metaKey: l,
|
|
261
|
-
ctrlKey: u,
|
|
262
|
-
altKey: a,
|
|
263
|
-
shiftKey: c
|
|
264
|
-
}) : new MouseEvent("click", {
|
|
265
|
-
metaKey: l,
|
|
266
|
-
ctrlKey: u,
|
|
267
|
-
altKey: a,
|
|
268
|
-
shiftKey: c,
|
|
269
|
-
detail: 1,
|
|
270
|
-
bubbles: !0,
|
|
271
|
-
cancelable: !0
|
|
272
|
-
});
|
|
273
|
-
W.isOpening = n, J(e), e.dispatchEvent(v), W.isOpening = !1;
|
|
274
|
-
}
|
|
275
|
-
W.isOpening = !1;
|
|
276
|
-
let U = /* @__PURE__ */ new Map(), Se = /* @__PURE__ */ new Set();
|
|
277
|
-
function je() {
|
|
278
|
-
if (typeof window > "u") return;
|
|
279
|
-
function e(r) {
|
|
280
|
-
return "propertyName" in r;
|
|
281
|
-
}
|
|
282
|
-
let t = (r) => {
|
|
283
|
-
let i = b(r);
|
|
284
|
-
if (!e(r) || !i) return;
|
|
285
|
-
let l = U.get(i);
|
|
286
|
-
l || (l = /* @__PURE__ */ new Set(), U.set(i, l), i.addEventListener("transitioncancel", n, {
|
|
287
|
-
once: !0
|
|
288
|
-
})), l.add(r.propertyName);
|
|
289
|
-
}, n = (r) => {
|
|
290
|
-
let i = b(r);
|
|
291
|
-
if (!e(r) || !i) return;
|
|
292
|
-
let l = U.get(i);
|
|
293
|
-
if (l && (l.delete(r.propertyName), l.size === 0 && (i.removeEventListener("transitioncancel", n), U.delete(i)), U.size === 0)) {
|
|
294
|
-
for (let u of Se) u();
|
|
295
|
-
Se.clear();
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", n);
|
|
299
|
-
}
|
|
300
|
-
typeof document < "u" && (document.readyState !== "loading" ? je() : document.addEventListener("DOMContentLoaded", je));
|
|
301
|
-
function en() {
|
|
302
|
-
for (const [e] of U)
|
|
303
|
-
"isConnected" in e && !e.isConnected && U.delete(e);
|
|
304
|
-
}
|
|
305
|
-
function ft(e) {
|
|
306
|
-
requestAnimationFrame(() => {
|
|
307
|
-
en(), U.size === 0 ? e() : Se.add(e);
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
function mt() {
|
|
311
|
-
let e = Z(/* @__PURE__ */ new Map()), t = x((i, l, u, a) => {
|
|
312
|
-
let c = a?.once ? (...v) => {
|
|
313
|
-
e.current.delete(u), u(...v);
|
|
314
|
-
} : u;
|
|
315
|
-
e.current.set(u, {
|
|
316
|
-
type: l,
|
|
317
|
-
eventTarget: i,
|
|
318
|
-
fn: c,
|
|
319
|
-
options: a
|
|
320
|
-
}), i.addEventListener(l, c, a);
|
|
321
|
-
}, []), n = x((i, l, u, a) => {
|
|
322
|
-
var c;
|
|
323
|
-
let v = ((c = e.current.get(u)) === null || c === void 0 ? void 0 : c.fn) || u;
|
|
324
|
-
i.removeEventListener(l, v, a), e.current.delete(u);
|
|
325
|
-
}, []), r = x(() => {
|
|
326
|
-
e.current.forEach((i, l) => {
|
|
327
|
-
n(i.eventTarget, i.type, l, i.options);
|
|
328
|
-
});
|
|
329
|
-
}, [
|
|
330
|
-
n
|
|
331
|
-
]);
|
|
332
|
-
return z(() => r, [
|
|
333
|
-
r
|
|
334
|
-
]), {
|
|
335
|
-
addGlobalListener: t,
|
|
336
|
-
removeGlobalListener: n,
|
|
337
|
-
removeAllGlobalListeners: r
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
var Te;
|
|
341
|
-
const tn = (Te = _e.useInsertionEffect) !== null && Te !== void 0 ? Te : oe;
|
|
342
|
-
function ue(e) {
|
|
343
|
-
const t = Z(null);
|
|
344
|
-
return tn(() => {
|
|
345
|
-
t.current = e;
|
|
346
|
-
}, [
|
|
347
|
-
e
|
|
348
|
-
]), x((...n) => {
|
|
349
|
-
const r = t.current;
|
|
350
|
-
return r?.(...n);
|
|
351
|
-
}, []);
|
|
352
|
-
}
|
|
353
|
-
function bt(e, t) {
|
|
354
|
-
oe(() => {
|
|
355
|
-
if (e && e.ref && t)
|
|
356
|
-
return e.ref.current = t.current, () => {
|
|
357
|
-
e.ref && (e.ref.current = null);
|
|
358
|
-
};
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
function Le(e) {
|
|
362
|
-
return e.pointerType === "" && e.isTrusted ? !0 : pt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
363
|
-
}
|
|
364
|
-
function nn(e) {
|
|
365
|
-
return !pt() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
|
|
366
|
-
}
|
|
367
|
-
const on = typeof Element < "u" && "checkVisibility" in Element.prototype;
|
|
368
|
-
function rn(e) {
|
|
369
|
-
const t = M(e);
|
|
370
|
-
if (!(e instanceof t.HTMLElement) && !(e instanceof t.SVGElement)) return !1;
|
|
371
|
-
let { display: n, visibility: r } = e.style, i = n !== "none" && r !== "hidden" && r !== "collapse";
|
|
372
|
-
if (i) {
|
|
373
|
-
const { getComputedStyle: l } = e.ownerDocument.defaultView;
|
|
374
|
-
let { display: u, visibility: a } = l(e);
|
|
375
|
-
i = u !== "none" && a !== "hidden" && a !== "collapse";
|
|
376
|
-
}
|
|
377
|
-
return i;
|
|
378
|
-
}
|
|
379
|
-
function sn(e, t) {
|
|
380
|
-
return !e.hasAttribute("hidden") && // Ignore HiddenSelect when tree walking.
|
|
381
|
-
!e.hasAttribute("data-react-aria-prevent-focus") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
|
|
382
|
-
}
|
|
383
|
-
function vt(e, t) {
|
|
384
|
-
return on ? e.checkVisibility({
|
|
385
|
-
visibilityProperty: !0
|
|
386
|
-
}) && !e.closest("[data-react-aria-prevent-focus]") : e.nodeName !== "#comment" && rn(e) && sn(e, t) && (!e.parentElement || vt(e.parentElement, e));
|
|
387
|
-
}
|
|
388
|
-
const gt = [
|
|
389
|
-
"input:not([disabled]):not([type=hidden])",
|
|
390
|
-
"select:not([disabled])",
|
|
391
|
-
"textarea:not([disabled])",
|
|
392
|
-
"button:not([disabled])",
|
|
393
|
-
"a[href]",
|
|
394
|
-
"area[href]",
|
|
395
|
-
"summary",
|
|
396
|
-
"iframe",
|
|
397
|
-
"object",
|
|
398
|
-
"embed",
|
|
399
|
-
"audio[controls]",
|
|
400
|
-
"video[controls]",
|
|
401
|
-
'[contenteditable]:not([contenteditable^="false"])',
|
|
402
|
-
"permission"
|
|
403
|
-
], an = gt.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
|
404
|
-
gt.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
405
|
-
function ln(e) {
|
|
406
|
-
return e.matches(an) && vt(e) && !un(e);
|
|
407
|
-
}
|
|
408
|
-
function un(e) {
|
|
409
|
-
let t = e;
|
|
410
|
-
for (; t != null; ) {
|
|
411
|
-
if (t instanceof t.ownerDocument.defaultView.HTMLElement && t.inert) return !0;
|
|
412
|
-
t = t.parentElement;
|
|
413
|
-
}
|
|
414
|
-
return !1;
|
|
415
|
-
}
|
|
416
|
-
function _t(e) {
|
|
417
|
-
let t = e;
|
|
418
|
-
return t.nativeEvent = e, t.isDefaultPrevented = () => t.defaultPrevented, t.isPropagationStopped = () => t.cancelBubble, t.persist = () => {
|
|
419
|
-
}, t;
|
|
420
|
-
}
|
|
421
|
-
function cn(e, t) {
|
|
422
|
-
Object.defineProperty(e, "target", {
|
|
423
|
-
value: t
|
|
424
|
-
}), Object.defineProperty(e, "currentTarget", {
|
|
425
|
-
value: t
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
function dn(e) {
|
|
429
|
-
let t = Z({
|
|
430
|
-
isFocused: !1,
|
|
431
|
-
observer: null
|
|
432
|
-
});
|
|
433
|
-
return oe(() => {
|
|
434
|
-
const n = t.current;
|
|
435
|
-
return () => {
|
|
436
|
-
n.observer && (n.observer.disconnect(), n.observer = null);
|
|
437
|
-
};
|
|
438
|
-
}, []), x((n) => {
|
|
439
|
-
let r = b(n);
|
|
440
|
-
if (r instanceof HTMLButtonElement || r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement) {
|
|
441
|
-
t.current.isFocused = !0;
|
|
442
|
-
let i = r, l = (u) => {
|
|
443
|
-
if (t.current.isFocused = !1, i.disabled) {
|
|
444
|
-
let a = _t(u);
|
|
445
|
-
e?.(a);
|
|
446
|
-
}
|
|
447
|
-
t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
|
|
448
|
-
};
|
|
449
|
-
i.addEventListener("focusout", l, {
|
|
450
|
-
once: !0
|
|
451
|
-
}), t.current.observer = new MutationObserver(() => {
|
|
452
|
-
if (t.current.isFocused && i.disabled) {
|
|
453
|
-
var u;
|
|
454
|
-
(u = t.current.observer) === null || u === void 0 || u.disconnect();
|
|
455
|
-
let a = i === q() ? null : q();
|
|
456
|
-
i.dispatchEvent(new FocusEvent("blur", {
|
|
457
|
-
relatedTarget: a
|
|
458
|
-
})), i.dispatchEvent(new FocusEvent("focusout", {
|
|
459
|
-
bubbles: !0,
|
|
460
|
-
relatedTarget: a
|
|
461
|
-
}));
|
|
462
|
-
}
|
|
463
|
-
}), t.current.observer.observe(i, {
|
|
464
|
-
attributes: !0,
|
|
465
|
-
attributeFilter: [
|
|
466
|
-
"disabled"
|
|
467
|
-
]
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
}, [
|
|
471
|
-
e
|
|
472
|
-
]);
|
|
473
|
-
}
|
|
474
|
-
let be = !1;
|
|
475
|
-
function We(e) {
|
|
476
|
-
for (; e && !ln(e); ) e = e.parentElement;
|
|
477
|
-
let t = M(e), n = t.document.activeElement;
|
|
478
|
-
if (!n || n === e) return;
|
|
479
|
-
be = !0;
|
|
480
|
-
let r = !1, i = (g) => {
|
|
481
|
-
(b(g) === n || r) && g.stopImmediatePropagation();
|
|
482
|
-
}, l = (g) => {
|
|
483
|
-
(b(g) === n || r) && (g.stopImmediatePropagation(), !e && !r && (r = !0, J(n), c()));
|
|
484
|
-
}, u = (g) => {
|
|
485
|
-
(b(g) === e || r) && g.stopImmediatePropagation();
|
|
486
|
-
}, a = (g) => {
|
|
487
|
-
(b(g) === e || r) && (g.stopImmediatePropagation(), r || (r = !0, J(n), c()));
|
|
488
|
-
};
|
|
489
|
-
t.addEventListener("blur", i, !0), t.addEventListener("focusout", l, !0), t.addEventListener("focusin", a, !0), t.addEventListener("focus", u, !0);
|
|
490
|
-
let c = () => {
|
|
491
|
-
cancelAnimationFrame(v), t.removeEventListener("blur", i, !0), t.removeEventListener("focusout", l, !0), t.removeEventListener("focusin", a, !0), t.removeEventListener("focus", u, !0), be = !1, r = !1;
|
|
492
|
-
}, v = requestAnimationFrame(c);
|
|
493
|
-
return c;
|
|
494
|
-
}
|
|
495
|
-
let X = "default", Ne = "", me = /* @__PURE__ */ new WeakMap();
|
|
496
|
-
function Ye(e) {
|
|
497
|
-
if (Me()) {
|
|
498
|
-
if (X === "default") {
|
|
499
|
-
const t = P(e);
|
|
500
|
-
Ne = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
|
|
501
|
-
}
|
|
502
|
-
X = "disabled";
|
|
503
|
-
} else if (e instanceof HTMLElement || e instanceof SVGElement) {
|
|
504
|
-
let t = "userSelect" in e.style ? "userSelect" : "webkitUserSelect";
|
|
505
|
-
me.set(e, e.style[t]), e.style[t] = "none";
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
function Oe(e) {
|
|
509
|
-
if (Me()) {
|
|
510
|
-
if (X !== "disabled") return;
|
|
511
|
-
X = "restoring", setTimeout(() => {
|
|
512
|
-
ft(() => {
|
|
513
|
-
if (X === "restoring") {
|
|
514
|
-
const t = P(e);
|
|
515
|
-
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = Ne || ""), Ne = "", X = "default";
|
|
516
|
-
}
|
|
517
|
-
});
|
|
518
|
-
}, 300);
|
|
519
|
-
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && me.has(e)) {
|
|
520
|
-
let t = me.get(e), n = "userSelect" in e.style ? "userSelect" : "webkitUserSelect";
|
|
521
|
-
e.style[n] === "none" && (e.style[n] = t), e.getAttribute("style") === "" && e.removeAttribute("style"), me.delete(e);
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
const ht = _e.createContext({
|
|
525
|
-
register: () => {
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
ht.displayName = "PressResponderContext";
|
|
529
|
-
function pn(e, t) {
|
|
530
|
-
return t.get ? t.get.call(e) : t.value;
|
|
531
|
-
}
|
|
532
|
-
function yt(e, t, n) {
|
|
533
|
-
if (!t.has(e)) throw new TypeError("attempted to " + n + " private field on non-instance");
|
|
534
|
-
return t.get(e);
|
|
535
|
-
}
|
|
536
|
-
function fn(e, t) {
|
|
537
|
-
var n = yt(e, t, "get");
|
|
538
|
-
return pn(e, n);
|
|
539
|
-
}
|
|
540
|
-
function mn(e, t) {
|
|
541
|
-
if (t.has(e))
|
|
542
|
-
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
543
|
-
}
|
|
544
|
-
function bn(e, t, n) {
|
|
545
|
-
mn(e, t), t.set(e, n);
|
|
546
|
-
}
|
|
547
|
-
function vn(e, t, n) {
|
|
548
|
-
if (t.set) t.set.call(e, n);
|
|
549
|
-
else {
|
|
550
|
-
if (!t.writable)
|
|
551
|
-
throw new TypeError("attempted to set read only private field");
|
|
552
|
-
t.value = n;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
function Xe(e, t, n) {
|
|
556
|
-
var r = yt(e, t, "set");
|
|
557
|
-
return vn(e, r, n), n;
|
|
558
|
-
}
|
|
559
|
-
function gn(e) {
|
|
560
|
-
let t = lt(ht);
|
|
561
|
-
if (t) {
|
|
562
|
-
let { register: n, ref: r, ...i } = t;
|
|
563
|
-
e = j(i, e), n();
|
|
564
|
-
}
|
|
565
|
-
return bt(t, e.ref), e;
|
|
566
|
-
}
|
|
567
|
-
var ce = /* @__PURE__ */ new WeakMap();
|
|
568
|
-
class de {
|
|
569
|
-
continuePropagation() {
|
|
570
|
-
Xe(this, ce, !1);
|
|
571
|
-
}
|
|
572
|
-
get shouldStopPropagation() {
|
|
573
|
-
return fn(this, ce);
|
|
574
|
-
}
|
|
575
|
-
constructor(t, n, r, i) {
|
|
576
|
-
bn(this, ce, {
|
|
577
|
-
writable: !0,
|
|
578
|
-
value: void 0
|
|
579
|
-
}), Xe(this, ce, !0);
|
|
580
|
-
var l;
|
|
581
|
-
let u = (l = i?.target) !== null && l !== void 0 ? l : r.currentTarget;
|
|
582
|
-
const a = u?.getBoundingClientRect();
|
|
583
|
-
let c, v = 0, g, k = null;
|
|
584
|
-
r.clientX != null && r.clientY != null && (g = r.clientX, k = r.clientY), a && (g != null && k != null ? (c = g - a.left, v = k - a.top) : (c = a.width / 2, v = a.height / 2)), this.type = t, this.pointerType = n, this.target = r.currentTarget, this.shiftKey = r.shiftKey, this.metaKey = r.metaKey, this.ctrlKey = r.ctrlKey, this.altKey = r.altKey, this.x = c, this.y = v, this.key = r.key;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
const ze = /* @__PURE__ */ Symbol("linkClicked"), qe = "react-aria-pressable-style", Je = "data-react-aria-pressable";
|
|
588
|
-
function _n(e) {
|
|
589
|
-
let { onPress: t, onPressChange: n, onPressStart: r, onPressEnd: i, onPressUp: l, onClick: u, isDisabled: a, isPressed: c, preventFocusOnPress: v, shouldCancelOnPointerExit: g, allowTextSelectionOnPress: k, ref: C, ...L } = gn(e), [N, h] = fe(!1), $ = Z({
|
|
590
|
-
isPressed: !1,
|
|
591
|
-
ignoreEmulatedMouseEvents: !1,
|
|
592
|
-
didFirePressStart: !1,
|
|
593
|
-
isTriggeringEvent: !1,
|
|
594
|
-
activePointerId: null,
|
|
595
|
-
target: null,
|
|
596
|
-
isOverTarget: !1,
|
|
597
|
-
pointerType: null,
|
|
598
|
-
disposables: []
|
|
599
|
-
}), { addGlobalListener: w, removeAllGlobalListeners: T, removeGlobalListener: O } = mt(), B = x((o, d) => {
|
|
600
|
-
let s = $.current;
|
|
601
|
-
if (a || s.didFirePressStart) return !1;
|
|
602
|
-
let p = !0;
|
|
603
|
-
if (s.isTriggeringEvent = !0, r) {
|
|
604
|
-
let m = new de("pressstart", d, o);
|
|
605
|
-
r(m), p = m.shouldStopPropagation;
|
|
606
|
-
}
|
|
607
|
-
return n && n(!0), s.isTriggeringEvent = !1, s.didFirePressStart = !0, h(!0), p;
|
|
608
|
-
}, [
|
|
609
|
-
a,
|
|
610
|
-
r,
|
|
611
|
-
n
|
|
612
|
-
]), S = x((o, d, s = !0) => {
|
|
613
|
-
let p = $.current;
|
|
614
|
-
if (!p.didFirePressStart) return !1;
|
|
615
|
-
p.didFirePressStart = !1, p.isTriggeringEvent = !0;
|
|
616
|
-
let m = !0;
|
|
617
|
-
if (i) {
|
|
618
|
-
let _ = new de("pressend", d, o);
|
|
619
|
-
i(_), m = _.shouldStopPropagation;
|
|
620
|
-
}
|
|
621
|
-
if (n && n(!1), h(!1), t && s && !a) {
|
|
622
|
-
let _ = new de("press", d, o);
|
|
623
|
-
t(_), m && (m = _.shouldStopPropagation);
|
|
624
|
-
}
|
|
625
|
-
return p.isTriggeringEvent = !1, m;
|
|
626
|
-
}, [
|
|
627
|
-
a,
|
|
628
|
-
i,
|
|
629
|
-
n,
|
|
630
|
-
t
|
|
631
|
-
]), $e = ue(S), I = x((o, d) => {
|
|
632
|
-
let s = $.current;
|
|
633
|
-
if (a) return !1;
|
|
634
|
-
if (l) {
|
|
635
|
-
s.isTriggeringEvent = !0;
|
|
636
|
-
let p = new de("pressup", d, o);
|
|
637
|
-
return l(p), s.isTriggeringEvent = !1, p.shouldStopPropagation;
|
|
638
|
-
}
|
|
639
|
-
return !0;
|
|
640
|
-
}, [
|
|
641
|
-
a,
|
|
642
|
-
l
|
|
643
|
-
]), Ee = ue(I), A = x((o) => {
|
|
644
|
-
let d = $.current;
|
|
645
|
-
if (d.isPressed && d.target) {
|
|
646
|
-
d.didFirePressStart && d.pointerType != null && S(G(d.target, o), d.pointerType, !1), d.isPressed = !1, te(null), d.isOverTarget = !1, d.activePointerId = null, d.pointerType = null, T(), k || Oe(d.target);
|
|
647
|
-
for (let s of d.disposables) s();
|
|
648
|
-
d.disposables = [];
|
|
649
|
-
}
|
|
650
|
-
}, [
|
|
651
|
-
k,
|
|
652
|
-
T,
|
|
653
|
-
S
|
|
654
|
-
]), R = ue(A), F = x((o) => {
|
|
655
|
-
g && A(o);
|
|
656
|
-
}, [
|
|
657
|
-
g,
|
|
658
|
-
A
|
|
659
|
-
]), ee = x((o) => {
|
|
660
|
-
a || u?.(o);
|
|
661
|
-
}, [
|
|
662
|
-
a,
|
|
663
|
-
u
|
|
664
|
-
]), ke = x((o, d) => {
|
|
665
|
-
if (!a && u) {
|
|
666
|
-
let s = new MouseEvent("click", o);
|
|
667
|
-
cn(s, d), u(_t(s));
|
|
668
|
-
}
|
|
669
|
-
}, [
|
|
670
|
-
a,
|
|
671
|
-
u
|
|
672
|
-
]), Ot = ue(ke), [Ve, Ue] = fe(!1);
|
|
673
|
-
oe(() => {
|
|
674
|
-
let o = $.current;
|
|
675
|
-
if (Ve) {
|
|
676
|
-
let d = (_) => {
|
|
677
|
-
var H;
|
|
678
|
-
if (o.isPressed && o.target && xe(_, o.target)) {
|
|
679
|
-
var we;
|
|
680
|
-
et(b(_), _.key) && _.preventDefault();
|
|
681
|
-
let ie = b(_), ae = y(o.target, ie);
|
|
682
|
-
$e(G(o.target, _), "keyboard", ae), ae && Ot(_, o.target), T(), _.key !== "Enter" && Ke(o.target) && y(o.target, ie) && !_[ze] && (_[ze] = !0, W(o.target, _, !1)), o.isPressed = !1, Ue(!1), (we = o.metaKeyEvents) === null || we === void 0 || we.delete(_.key);
|
|
683
|
-
} else if (_.key === "Meta" && (!((H = o.metaKeyEvents) === null || H === void 0) && H.size)) {
|
|
684
|
-
var Pe;
|
|
685
|
-
let ie = o.metaKeyEvents;
|
|
686
|
-
o.metaKeyEvents = void 0;
|
|
687
|
-
for (let ae of ie.values()) (Pe = o.target) === null || Pe === void 0 || Pe.dispatchEvent(new KeyboardEvent("keyup", ae));
|
|
688
|
-
}
|
|
689
|
-
}, s = o.target, m = ut((_) => {
|
|
690
|
-
s && xe(_, s) && !_.repeat && y(s, b(_)) && o.target && Ee(G(o.target, _), "keyboard");
|
|
691
|
-
}, d);
|
|
692
|
-
return w(P(o.target), "keyup", m, !0), () => {
|
|
693
|
-
O(P(o.target), "keyup", m, !0);
|
|
694
|
-
};
|
|
695
|
-
}
|
|
696
|
-
}, [
|
|
697
|
-
Ve,
|
|
698
|
-
w,
|
|
699
|
-
T,
|
|
700
|
-
O
|
|
701
|
-
]);
|
|
702
|
-
let [se, te] = fe(null);
|
|
703
|
-
oe(() => {
|
|
704
|
-
let o = $.current;
|
|
705
|
-
if (se === "pointer") {
|
|
706
|
-
let d = (p) => {
|
|
707
|
-
if (p.pointerId === o.activePointerId && o.isPressed && p.button === 0 && o.target) {
|
|
708
|
-
if (y(o.target, b(p)) && o.pointerType != null) {
|
|
709
|
-
let m = !1, _ = setTimeout(() => {
|
|
710
|
-
o.isPressed && o.target instanceof HTMLElement && (m ? R(p) : (J(o.target), o.target.click()));
|
|
711
|
-
}, 80);
|
|
712
|
-
p.currentTarget && w(p.currentTarget, "click", () => m = !0, !0), o.disposables.push(() => clearTimeout(_));
|
|
713
|
-
} else R(p);
|
|
714
|
-
o.isOverTarget = !1;
|
|
715
|
-
}
|
|
716
|
-
}, s = (p) => {
|
|
717
|
-
R(p);
|
|
718
|
-
};
|
|
719
|
-
return w(P(o.target), "pointerup", d, !1), w(P(o.target), "pointercancel", s, !1), () => {
|
|
720
|
-
O(P(o.target), "pointerup", d, !1), O(P(o.target), "pointercancel", s, !1);
|
|
721
|
-
};
|
|
722
|
-
} else if (se === "mouse" && process.env.NODE_ENV === "test") {
|
|
723
|
-
let d = (s) => {
|
|
724
|
-
if (s.button === 0) {
|
|
725
|
-
if (o.ignoreEmulatedMouseEvents) {
|
|
726
|
-
o.ignoreEmulatedMouseEvents = !1;
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
o.target && y(o.target, s.target) && o.pointerType != null || R(s), o.isOverTarget = !1;
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
return w(P(o.target), "mouseup", d, !1), () => {
|
|
733
|
-
O(P(o.target), "mouseup", d, !1);
|
|
734
|
-
};
|
|
735
|
-
} else if (se === "touch" && process.env.NODE_ENV === "test") {
|
|
736
|
-
let d = (s) => {
|
|
737
|
-
o.isPressed && y(b(s), o.target) && R({
|
|
738
|
-
currentTarget: o.target,
|
|
739
|
-
shiftKey: !1,
|
|
740
|
-
ctrlKey: !1,
|
|
741
|
-
metaKey: !1,
|
|
742
|
-
altKey: !1
|
|
743
|
-
});
|
|
744
|
-
};
|
|
745
|
-
return w(M(o.target), "scroll", d, !0), () => {
|
|
746
|
-
O(M(o.target), "scroll", d, !0);
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
}, [
|
|
750
|
-
se,
|
|
751
|
-
w,
|
|
752
|
-
O
|
|
753
|
-
]);
|
|
754
|
-
let xt = at(() => {
|
|
755
|
-
let o = $.current, d = {
|
|
756
|
-
onKeyDown(s) {
|
|
757
|
-
if (xe(s.nativeEvent, s.currentTarget) && y(s.currentTarget, b(s))) {
|
|
758
|
-
var p;
|
|
759
|
-
et(b(s), s.key) && s.preventDefault();
|
|
760
|
-
let m = !0;
|
|
761
|
-
!o.isPressed && !s.repeat && (o.target = s.currentTarget, o.isPressed = !0, Ue(!0), o.pointerType = "keyboard", m = B(s, "keyboard")), m && s.stopPropagation(), s.metaKey && Q() && ((p = o.metaKeyEvents) === null || p === void 0 || p.set(s.key, s.nativeEvent));
|
|
762
|
-
} else s.key === "Meta" && (o.metaKeyEvents = /* @__PURE__ */ new Map());
|
|
763
|
-
},
|
|
764
|
-
onClick(s) {
|
|
765
|
-
if (!(s && !y(s.currentTarget, b(s))) && s && s.button === 0 && !o.isTriggeringEvent && !W.isOpening) {
|
|
766
|
-
let p = !0;
|
|
767
|
-
if (a && s.preventDefault(), !o.ignoreEmulatedMouseEvents && !o.isPressed && (o.pointerType === "virtual" || Le(s.nativeEvent))) {
|
|
768
|
-
let m = B(s, "virtual"), _ = I(s, "virtual"), H = S(s, "virtual");
|
|
769
|
-
ee(s), p = m && _ && H;
|
|
770
|
-
} else if (o.isPressed && o.pointerType !== "keyboard") {
|
|
771
|
-
let m = o.pointerType || s.nativeEvent.pointerType || "virtual", _ = I(G(s.currentTarget, s), m), H = S(G(s.currentTarget, s), m, !0);
|
|
772
|
-
p = _ && H, o.isOverTarget = !1, ee(s), A(s);
|
|
773
|
-
}
|
|
774
|
-
o.ignoreEmulatedMouseEvents = !1, p && s.stopPropagation();
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
};
|
|
778
|
-
return typeof PointerEvent < "u" ? (d.onPointerDown = (s) => {
|
|
779
|
-
if (s.button !== 0 || !y(s.currentTarget, b(s))) return;
|
|
780
|
-
if (nn(s.nativeEvent)) {
|
|
781
|
-
o.pointerType = "virtual";
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
o.pointerType = s.pointerType;
|
|
785
|
-
let p = !0;
|
|
786
|
-
if (!o.isPressed) {
|
|
787
|
-
o.isPressed = !0, te("pointer"), o.isOverTarget = !0, o.activePointerId = s.pointerId, o.target = s.currentTarget, k || Ye(o.target), p = B(s, o.pointerType);
|
|
788
|
-
let m = b(s);
|
|
789
|
-
"releasePointerCapture" in m && ("hasPointerCapture" in m ? m.hasPointerCapture(s.pointerId) && m.releasePointerCapture(s.pointerId) : m.releasePointerCapture(s.pointerId));
|
|
790
|
-
}
|
|
791
|
-
p && s.stopPropagation();
|
|
792
|
-
}, d.onMouseDown = (s) => {
|
|
793
|
-
if (y(s.currentTarget, b(s)) && s.button === 0) {
|
|
794
|
-
if (v) {
|
|
795
|
-
let p = We(s.target);
|
|
796
|
-
p && o.disposables.push(p);
|
|
797
|
-
}
|
|
798
|
-
s.stopPropagation();
|
|
799
|
-
}
|
|
800
|
-
}, d.onPointerUp = (s) => {
|
|
801
|
-
!y(s.currentTarget, b(s)) || o.pointerType === "virtual" || s.button === 0 && !o.isPressed && I(s, o.pointerType || s.pointerType);
|
|
802
|
-
}, d.onPointerEnter = (s) => {
|
|
803
|
-
s.pointerId === o.activePointerId && o.target && !o.isOverTarget && o.pointerType != null && (o.isOverTarget = !0, B(G(o.target, s), o.pointerType));
|
|
804
|
-
}, d.onPointerLeave = (s) => {
|
|
805
|
-
s.pointerId === o.activePointerId && o.target && o.isOverTarget && o.pointerType != null && (o.isOverTarget = !1, S(G(o.target, s), o.pointerType, !1), F(s));
|
|
806
|
-
}, d.onDragStart = (s) => {
|
|
807
|
-
y(s.currentTarget, b(s)) && A(s);
|
|
808
|
-
}) : process.env.NODE_ENV === "test" && (d.onMouseDown = (s) => {
|
|
809
|
-
if (s.button !== 0 || !y(s.currentTarget, b(s))) return;
|
|
810
|
-
if (o.ignoreEmulatedMouseEvents) {
|
|
811
|
-
s.stopPropagation();
|
|
812
|
-
return;
|
|
813
|
-
}
|
|
814
|
-
if (o.isPressed = !0, te("mouse"), o.isOverTarget = !0, o.target = s.currentTarget, o.pointerType = Le(s.nativeEvent) ? "virtual" : "mouse", Nt(() => B(s, o.pointerType)) && s.stopPropagation(), v) {
|
|
815
|
-
let m = We(s.target);
|
|
816
|
-
m && o.disposables.push(m);
|
|
817
|
-
}
|
|
818
|
-
}, d.onMouseEnter = (s) => {
|
|
819
|
-
if (!y(s.currentTarget, b(s))) return;
|
|
820
|
-
let p = !0;
|
|
821
|
-
o.isPressed && !o.ignoreEmulatedMouseEvents && o.pointerType != null && (o.isOverTarget = !0, p = B(s, o.pointerType)), p && s.stopPropagation();
|
|
822
|
-
}, d.onMouseLeave = (s) => {
|
|
823
|
-
if (!y(s.currentTarget, b(s))) return;
|
|
824
|
-
let p = !0;
|
|
825
|
-
o.isPressed && !o.ignoreEmulatedMouseEvents && o.pointerType != null && (o.isOverTarget = !1, p = S(s, o.pointerType, !1), F(s)), p && s.stopPropagation();
|
|
826
|
-
}, d.onMouseUp = (s) => {
|
|
827
|
-
y(s.currentTarget, b(s)) && !o.ignoreEmulatedMouseEvents && s.button === 0 && !o.isPressed && I(s, o.pointerType || "mouse");
|
|
828
|
-
}, d.onTouchStart = (s) => {
|
|
829
|
-
if (!y(s.currentTarget, b(s))) return;
|
|
830
|
-
let p = hn(s.nativeEvent);
|
|
831
|
-
if (!p) return;
|
|
832
|
-
o.activePointerId = p.identifier, o.ignoreEmulatedMouseEvents = !0, o.isOverTarget = !0, o.isPressed = !0, te("touch"), o.target = s.currentTarget, o.pointerType = "touch", k || Ye(o.target), B(V(o.target, s), o.pointerType) && s.stopPropagation();
|
|
833
|
-
}, d.onTouchMove = (s) => {
|
|
834
|
-
if (!y(s.currentTarget, b(s))) return;
|
|
835
|
-
if (!o.isPressed) {
|
|
836
|
-
s.stopPropagation();
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
let p = Qe(s.nativeEvent, o.activePointerId), m = !0;
|
|
840
|
-
p && Ze(p, s.currentTarget) ? !o.isOverTarget && o.pointerType != null && (o.isOverTarget = !0, m = B(V(o.target, s), o.pointerType)) : o.isOverTarget && o.pointerType != null && (o.isOverTarget = !1, m = S(V(o.target, s), o.pointerType, !1), F(V(o.target, s))), m && s.stopPropagation();
|
|
841
|
-
}, d.onTouchEnd = (s) => {
|
|
842
|
-
if (!y(s.currentTarget, b(s))) return;
|
|
843
|
-
if (!o.isPressed) {
|
|
844
|
-
s.stopPropagation();
|
|
845
|
-
return;
|
|
846
|
-
}
|
|
847
|
-
let p = Qe(s.nativeEvent, o.activePointerId), m = !0;
|
|
848
|
-
p && Ze(p, s.currentTarget) && o.pointerType != null ? (I(V(o.target, s), o.pointerType), m = S(V(o.target, s), o.pointerType), ke(s.nativeEvent, o.target)) : o.isOverTarget && o.pointerType != null && (m = S(V(o.target, s), o.pointerType, !1)), m && s.stopPropagation(), o.isPressed = !1, te(null), o.activePointerId = null, o.isOverTarget = !1, o.ignoreEmulatedMouseEvents = !0, o.target && !k && Oe(o.target), T();
|
|
849
|
-
}, d.onTouchCancel = (s) => {
|
|
850
|
-
y(s.currentTarget, b(s)) && (s.stopPropagation(), o.isPressed && A(V(o.target, s)));
|
|
851
|
-
}, d.onDragStart = (s) => {
|
|
852
|
-
y(s.currentTarget, b(s)) && A(s);
|
|
853
|
-
}), d;
|
|
854
|
-
}, [
|
|
855
|
-
a,
|
|
856
|
-
v,
|
|
857
|
-
T,
|
|
858
|
-
k,
|
|
859
|
-
A,
|
|
860
|
-
F,
|
|
861
|
-
S,
|
|
862
|
-
B,
|
|
863
|
-
I,
|
|
864
|
-
ee,
|
|
865
|
-
ke
|
|
866
|
-
]);
|
|
867
|
-
return z(() => {
|
|
868
|
-
if (!C || process.env.NODE_ENV === "test") return;
|
|
869
|
-
const o = P(C.current);
|
|
870
|
-
if (!o || !o.head || o.getElementById(qe)) return;
|
|
871
|
-
const d = o.createElement("style");
|
|
872
|
-
d.id = qe, d.textContent = `
|
|
873
|
-
@layer {
|
|
874
|
-
[${Je}] {
|
|
875
|
-
touch-action: pan-x pan-y pinch-zoom;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
`.trim(), o.head.prepend(d);
|
|
879
|
-
}, [
|
|
880
|
-
C
|
|
881
|
-
]), z(() => {
|
|
882
|
-
let o = $.current;
|
|
883
|
-
return () => {
|
|
884
|
-
var d;
|
|
885
|
-
k || Oe((d = o.target) !== null && d !== void 0 ? d : void 0);
|
|
886
|
-
for (let s of o.disposables) s();
|
|
887
|
-
o.disposables = [];
|
|
888
|
-
};
|
|
889
|
-
}, [
|
|
890
|
-
k
|
|
891
|
-
]), {
|
|
892
|
-
isPressed: c || N,
|
|
893
|
-
pressProps: j(L, xt, {
|
|
894
|
-
[Je]: !0
|
|
895
|
-
})
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
function Ke(e) {
|
|
899
|
-
return e.tagName === "A" && e.hasAttribute("href");
|
|
900
|
-
}
|
|
901
|
-
function xe(e, t) {
|
|
902
|
-
const { key: n, code: r } = e, i = t, l = i.getAttribute("role");
|
|
903
|
-
return (n === "Enter" || n === " " || n === "Spacebar" || r === "Space") && !(i instanceof M(i).HTMLInputElement && !$t(i, n) || i instanceof M(i).HTMLTextAreaElement || i.isContentEditable) && // Links should only trigger with Enter key
|
|
904
|
-
!((l === "link" || !l && Ke(i)) && n !== "Enter");
|
|
905
|
-
}
|
|
906
|
-
function hn(e) {
|
|
907
|
-
const { targetTouches: t } = e;
|
|
908
|
-
return t.length > 0 ? t[0] : null;
|
|
909
|
-
}
|
|
910
|
-
function Qe(e, t) {
|
|
911
|
-
const n = e.changedTouches;
|
|
912
|
-
for (let r = 0; r < n.length; r++) {
|
|
913
|
-
const i = n[r];
|
|
914
|
-
if (i.identifier === t) return i;
|
|
915
|
-
}
|
|
916
|
-
return null;
|
|
917
|
-
}
|
|
918
|
-
function V(e, t) {
|
|
919
|
-
let n = 0, r = 0;
|
|
920
|
-
return t.targetTouches && t.targetTouches.length === 1 && (n = t.targetTouches[0].clientX, r = t.targetTouches[0].clientY), {
|
|
921
|
-
currentTarget: e,
|
|
922
|
-
shiftKey: t.shiftKey,
|
|
923
|
-
ctrlKey: t.ctrlKey,
|
|
924
|
-
metaKey: t.metaKey,
|
|
925
|
-
altKey: t.altKey,
|
|
926
|
-
clientX: n,
|
|
927
|
-
clientY: r
|
|
928
|
-
};
|
|
929
|
-
}
|
|
930
|
-
function G(e, t) {
|
|
931
|
-
let n = t.clientX, r = t.clientY;
|
|
932
|
-
return {
|
|
933
|
-
currentTarget: e,
|
|
934
|
-
shiftKey: t.shiftKey,
|
|
935
|
-
ctrlKey: t.ctrlKey,
|
|
936
|
-
metaKey: t.metaKey,
|
|
937
|
-
altKey: t.altKey,
|
|
938
|
-
clientX: n,
|
|
939
|
-
clientY: r,
|
|
940
|
-
key: t.key
|
|
941
|
-
};
|
|
942
|
-
}
|
|
943
|
-
function yn(e) {
|
|
944
|
-
let t = 0, n = 0;
|
|
945
|
-
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), {
|
|
946
|
-
top: e.clientY - n,
|
|
947
|
-
right: e.clientX + t,
|
|
948
|
-
bottom: e.clientY + n,
|
|
949
|
-
left: e.clientX - t
|
|
950
|
-
};
|
|
951
|
-
}
|
|
952
|
-
function $n(e, t) {
|
|
953
|
-
return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
|
|
954
|
-
}
|
|
955
|
-
function Ze(e, t) {
|
|
956
|
-
let n = t.getBoundingClientRect(), r = yn(e);
|
|
957
|
-
return $n(n, r);
|
|
958
|
-
}
|
|
959
|
-
function En(e) {
|
|
960
|
-
return e instanceof HTMLInputElement ? !1 : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !Ke(e);
|
|
961
|
-
}
|
|
962
|
-
function et(e, t) {
|
|
963
|
-
return e instanceof HTMLInputElement ? !$t(e, t) : En(e);
|
|
964
|
-
}
|
|
965
|
-
const kn = /* @__PURE__ */ new Set([
|
|
966
|
-
"checkbox",
|
|
967
|
-
"radio",
|
|
968
|
-
"range",
|
|
969
|
-
"color",
|
|
970
|
-
"file",
|
|
971
|
-
"image",
|
|
972
|
-
"button",
|
|
973
|
-
"submit",
|
|
974
|
-
"reset"
|
|
975
|
-
]);
|
|
976
|
-
function $t(e, t) {
|
|
977
|
-
return e.type === "checkbox" || e.type === "radio" ? t === " " : kn.has(e.type);
|
|
978
|
-
}
|
|
979
|
-
let re = null;
|
|
980
|
-
const wn = /* @__PURE__ */ new Set();
|
|
981
|
-
let ne = /* @__PURE__ */ new Map(), Y = !1, De = !1;
|
|
982
|
-
function Fe(e, t) {
|
|
983
|
-
for (let n of wn) n(e, t);
|
|
984
|
-
}
|
|
985
|
-
function Pn(e) {
|
|
986
|
-
return !(e.metaKey || !Q() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
987
|
-
}
|
|
988
|
-
function ve(e) {
|
|
989
|
-
Y = !0, !W.isOpening && Pn(e) && (re = "keyboard", Fe("keyboard", e));
|
|
990
|
-
}
|
|
991
|
-
function D(e) {
|
|
992
|
-
re = "pointer", "pointerType" in e && e.pointerType, (e.type === "mousedown" || e.type === "pointerdown") && (Y = !0, Fe("pointer", e));
|
|
993
|
-
}
|
|
994
|
-
function Et(e) {
|
|
995
|
-
!W.isOpening && Le(e) && (Y = !0, re = "virtual");
|
|
996
|
-
}
|
|
997
|
-
function kt(e) {
|
|
998
|
-
b(e) === window || b(e) === document || be || !e.isTrusted || (!Y && !De && (re = "virtual", Fe("virtual", e)), Y = !1, De = !1);
|
|
999
|
-
}
|
|
1000
|
-
function wt() {
|
|
1001
|
-
be || (Y = !1, De = !0);
|
|
1002
|
-
}
|
|
1003
|
-
function tt(e) {
|
|
1004
|
-
if (typeof window > "u" || typeof document > "u" || ne.get(M(e))) return;
|
|
1005
|
-
const t = M(e), n = P(e);
|
|
1006
|
-
let r = t.HTMLElement.prototype.focus;
|
|
1007
|
-
t.HTMLElement.prototype.focus = function() {
|
|
1008
|
-
Y = !0, r.apply(this, arguments);
|
|
1009
|
-
}, n.addEventListener("keydown", ve, !0), n.addEventListener("keyup", ve, !0), n.addEventListener("click", Et, !0), t.addEventListener("focus", kt, !0), t.addEventListener("blur", wt, !1), typeof PointerEvent < "u" ? (n.addEventListener("pointerdown", D, !0), n.addEventListener("pointermove", D, !0), n.addEventListener("pointerup", D, !0)) : process.env.NODE_ENV === "test" && (n.addEventListener("mousedown", D, !0), n.addEventListener("mousemove", D, !0), n.addEventListener("mouseup", D, !0)), t.addEventListener("beforeunload", () => {
|
|
1010
|
-
Pt(e);
|
|
1011
|
-
}, {
|
|
1012
|
-
once: !0
|
|
1013
|
-
}), ne.set(t, {
|
|
1014
|
-
focus: r
|
|
1015
|
-
});
|
|
1016
|
-
}
|
|
1017
|
-
const Pt = (e, t) => {
|
|
1018
|
-
const n = M(e), r = P(e);
|
|
1019
|
-
t && r.removeEventListener("DOMContentLoaded", t), ne.has(n) && (n.HTMLElement.prototype.focus = ne.get(n).focus, r.removeEventListener("keydown", ve, !0), r.removeEventListener("keyup", ve, !0), r.removeEventListener("click", Et, !0), n.removeEventListener("focus", kt, !0), n.removeEventListener("blur", wt, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", D, !0), r.removeEventListener("pointermove", D, !0), r.removeEventListener("pointerup", D, !0)) : process.env.NODE_ENV === "test" && (r.removeEventListener("mousedown", D, !0), r.removeEventListener("mousemove", D, !0), r.removeEventListener("mouseup", D, !0)), ne.delete(n));
|
|
1020
|
-
};
|
|
1021
|
-
function Tn(e) {
|
|
1022
|
-
const t = P(e);
|
|
1023
|
-
let n;
|
|
1024
|
-
return t.readyState !== "loading" ? tt(e) : (n = () => {
|
|
1025
|
-
tt(e);
|
|
1026
|
-
}, t.addEventListener("DOMContentLoaded", n)), () => Pt(e, n);
|
|
1027
|
-
}
|
|
1028
|
-
typeof document < "u" && Tn();
|
|
1029
|
-
function On() {
|
|
1030
|
-
return re;
|
|
1031
|
-
}
|
|
1032
|
-
function xn(e) {
|
|
1033
|
-
if (!e.isConnected) return;
|
|
1034
|
-
const t = P(e);
|
|
1035
|
-
if (On() === "virtual") {
|
|
1036
|
-
let n = q(t);
|
|
1037
|
-
ft(() => {
|
|
1038
|
-
const r = q(t);
|
|
1039
|
-
(r === n || r === t.body) && e.isConnected && J(e);
|
|
1040
|
-
});
|
|
1041
|
-
} else J(e);
|
|
1042
|
-
}
|
|
1043
|
-
function Bn(e) {
|
|
1044
|
-
let { isDisabled: t, onFocus: n, onBlur: r, onFocusChange: i } = e;
|
|
1045
|
-
const l = x((c) => {
|
|
1046
|
-
if (b(c) === c.currentTarget)
|
|
1047
|
-
return r && r(c), i && i(!1), !0;
|
|
1048
|
-
}, [
|
|
1049
|
-
r,
|
|
1050
|
-
i
|
|
1051
|
-
]), u = dn(l), a = x((c) => {
|
|
1052
|
-
let v = b(c);
|
|
1053
|
-
const g = P(v), k = g ? q(g) : q();
|
|
1054
|
-
v === c.currentTarget && v === k && (n && n(c), i && i(!0), u(c));
|
|
1055
|
-
}, [
|
|
1056
|
-
i,
|
|
1057
|
-
n,
|
|
1058
|
-
u
|
|
1059
|
-
]);
|
|
1060
|
-
return {
|
|
1061
|
-
focusProps: {
|
|
1062
|
-
onFocus: !t && (n || i || r) ? a : void 0,
|
|
1063
|
-
onBlur: !t && (r || i) ? l : void 0
|
|
1064
|
-
}
|
|
1065
|
-
};
|
|
1066
|
-
}
|
|
1067
|
-
function nt(e) {
|
|
1068
|
-
if (!e) return;
|
|
1069
|
-
let t = !0;
|
|
1070
|
-
return (n) => {
|
|
1071
|
-
let r = {
|
|
1072
|
-
...n,
|
|
1073
|
-
preventDefault() {
|
|
1074
|
-
n.preventDefault();
|
|
1075
|
-
},
|
|
1076
|
-
isDefaultPrevented() {
|
|
1077
|
-
return n.isDefaultPrevented();
|
|
1078
|
-
},
|
|
1079
|
-
stopPropagation() {
|
|
1080
|
-
t && process.env.NODE_ENV !== "production" ? console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.") : t = !0;
|
|
1081
|
-
},
|
|
1082
|
-
continuePropagation() {
|
|
1083
|
-
t = !1;
|
|
1084
|
-
},
|
|
1085
|
-
isPropagationStopped() {
|
|
1086
|
-
return t;
|
|
1087
|
-
}
|
|
1088
|
-
};
|
|
1089
|
-
e(r), t && n.stopPropagation();
|
|
1090
|
-
};
|
|
1091
|
-
}
|
|
1092
|
-
function Sn(e) {
|
|
1093
|
-
return {
|
|
1094
|
-
keyboardProps: e.isDisabled ? {} : {
|
|
1095
|
-
onKeyDown: nt(e.onKeyDown),
|
|
1096
|
-
onKeyUp: nt(e.onKeyUp)
|
|
1097
|
-
}
|
|
1098
|
-
};
|
|
1099
|
-
}
|
|
1100
|
-
let Ln = /* @__PURE__ */ _e.createContext(null);
|
|
1101
|
-
function Nn(e) {
|
|
1102
|
-
let t = lt(Ln) || {};
|
|
1103
|
-
bt(t, e);
|
|
1104
|
-
let { ref: n, ...r } = t;
|
|
1105
|
-
return r;
|
|
1106
|
-
}
|
|
1107
|
-
function Dn(e, t) {
|
|
1108
|
-
let { focusProps: n } = Bn(e), { keyboardProps: r } = Sn(e), i = j(n, r), l = Nn(t), u = e.isDisabled ? {} : l, a = Z(e.autoFocus);
|
|
1109
|
-
z(() => {
|
|
1110
|
-
a.current && t.current && xn(t.current), a.current = !1;
|
|
1111
|
-
}, [
|
|
1112
|
-
t
|
|
1113
|
-
]);
|
|
1114
|
-
let c = e.excludeFromTabOrder ? -1 : 0;
|
|
1115
|
-
return e.isDisabled && (c = void 0), {
|
|
1116
|
-
focusableProps: j({
|
|
1117
|
-
...i,
|
|
1118
|
-
tabIndex: c
|
|
1119
|
-
}, u)
|
|
1120
|
-
};
|
|
1121
|
-
}
|
|
1122
|
-
let ge = !1, pe = 0;
|
|
1123
|
-
function Ce() {
|
|
1124
|
-
ge = !0, setTimeout(() => {
|
|
1125
|
-
ge = !1;
|
|
1126
|
-
}, 50);
|
|
1127
|
-
}
|
|
1128
|
-
function ot(e) {
|
|
1129
|
-
e.pointerType === "touch" && Ce();
|
|
1130
|
-
}
|
|
1131
|
-
function Cn() {
|
|
1132
|
-
if (!(typeof document > "u"))
|
|
1133
|
-
return pe === 0 && (typeof PointerEvent < "u" ? document.addEventListener("pointerup", ot) : process.env.NODE_ENV === "test" && document.addEventListener("touchend", Ce)), pe++, () => {
|
|
1134
|
-
pe--, !(pe > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", ot) : process.env.NODE_ENV === "test" && document.removeEventListener("touchend", Ce));
|
|
1135
|
-
};
|
|
1136
|
-
}
|
|
1137
|
-
function An(e) {
|
|
1138
|
-
let { onHoverStart: t, onHoverChange: n, onHoverEnd: r, isDisabled: i } = e, [l, u] = fe(!1), a = Z({
|
|
1139
|
-
isHovered: !1,
|
|
1140
|
-
ignoreEmulatedMouseEvents: !1,
|
|
1141
|
-
pointerType: "",
|
|
1142
|
-
target: null
|
|
1143
|
-
}).current;
|
|
1144
|
-
z(Cn, []);
|
|
1145
|
-
let { addGlobalListener: c, removeAllGlobalListeners: v } = mt(), { hoverProps: g, triggerHoverEnd: k } = at(() => {
|
|
1146
|
-
let C = (h, $) => {
|
|
1147
|
-
if (a.pointerType = $, i || $ === "touch" || a.isHovered || !y(h.currentTarget, b(h))) return;
|
|
1148
|
-
a.isHovered = !0;
|
|
1149
|
-
let w = h.currentTarget;
|
|
1150
|
-
a.target = w, c(P(b(h)), "pointerover", (T) => {
|
|
1151
|
-
a.isHovered && a.target && !y(a.target, b(T)) && L(T, T.pointerType);
|
|
1152
|
-
}, {
|
|
1153
|
-
capture: !0
|
|
1154
|
-
}), t && t({
|
|
1155
|
-
type: "hoverstart",
|
|
1156
|
-
target: w,
|
|
1157
|
-
pointerType: $
|
|
1158
|
-
}), n && n(!0), u(!0);
|
|
1159
|
-
}, L = (h, $) => {
|
|
1160
|
-
let w = a.target;
|
|
1161
|
-
a.pointerType = "", a.target = null, !($ === "touch" || !a.isHovered || !w) && (a.isHovered = !1, v(), r && r({
|
|
1162
|
-
type: "hoverend",
|
|
1163
|
-
target: w,
|
|
1164
|
-
pointerType: $
|
|
1165
|
-
}), n && n(!1), u(!1));
|
|
1166
|
-
}, N = {};
|
|
1167
|
-
return typeof PointerEvent < "u" ? (N.onPointerEnter = (h) => {
|
|
1168
|
-
ge && h.pointerType === "mouse" || C(h, h.pointerType);
|
|
1169
|
-
}, N.onPointerLeave = (h) => {
|
|
1170
|
-
!i && y(h.currentTarget, b(h)) && L(h, h.pointerType);
|
|
1171
|
-
}) : process.env.NODE_ENV === "test" && (N.onTouchStart = () => {
|
|
1172
|
-
a.ignoreEmulatedMouseEvents = !0;
|
|
1173
|
-
}, N.onMouseEnter = (h) => {
|
|
1174
|
-
!a.ignoreEmulatedMouseEvents && !ge && C(h, "mouse"), a.ignoreEmulatedMouseEvents = !1;
|
|
1175
|
-
}, N.onMouseLeave = (h) => {
|
|
1176
|
-
!i && y(h.currentTarget, b(h)) && L(h, "mouse");
|
|
1177
|
-
}), {
|
|
1178
|
-
hoverProps: N,
|
|
1179
|
-
triggerHoverEnd: L
|
|
1180
|
-
};
|
|
1181
|
-
}, [
|
|
1182
|
-
t,
|
|
1183
|
-
n,
|
|
1184
|
-
r,
|
|
1185
|
-
i,
|
|
1186
|
-
a,
|
|
1187
|
-
c,
|
|
1188
|
-
v
|
|
1189
|
-
]);
|
|
1190
|
-
return z(() => {
|
|
1191
|
-
i && k({
|
|
1192
|
-
currentTarget: a.target
|
|
1193
|
-
}, a.pointerType);
|
|
1194
|
-
}, [
|
|
1195
|
-
i
|
|
1196
|
-
]), {
|
|
1197
|
-
hoverProps: g,
|
|
1198
|
-
isHovered: l
|
|
1199
|
-
};
|
|
1200
|
-
}
|
|
1201
|
-
function In(e, t) {
|
|
1202
|
-
let { elementType: n = "button", isDisabled: r, onPress: i, onPressStart: l, onPressEnd: u, onPressUp: a, onPressChange: c, preventFocusOnPress: v, allowFocusWhenDisabled: g, onClick: k, href: C, target: L, rel: N, type: h = "button" } = e, $;
|
|
1203
|
-
n === "button" ? $ = {
|
|
1204
|
-
type: h,
|
|
1205
|
-
disabled: r,
|
|
1206
|
-
form: e.form,
|
|
1207
|
-
formAction: e.formAction,
|
|
1208
|
-
formEncType: e.formEncType,
|
|
1209
|
-
formMethod: e.formMethod,
|
|
1210
|
-
formNoValidate: e.formNoValidate,
|
|
1211
|
-
formTarget: e.formTarget,
|
|
1212
|
-
name: e.name,
|
|
1213
|
-
value: e.value
|
|
1214
|
-
} : $ = {
|
|
1215
|
-
role: "button",
|
|
1216
|
-
href: n === "a" && !r ? C : void 0,
|
|
1217
|
-
target: n === "a" ? L : void 0,
|
|
1218
|
-
type: n === "input" ? h : void 0,
|
|
1219
|
-
disabled: n === "input" ? r : void 0,
|
|
1220
|
-
"aria-disabled": !r || n === "input" ? void 0 : r,
|
|
1221
|
-
rel: n === "a" ? N : void 0
|
|
1222
|
-
};
|
|
1223
|
-
let { pressProps: w, isPressed: T } = _n({
|
|
1224
|
-
onPressStart: l,
|
|
1225
|
-
onPressEnd: u,
|
|
1226
|
-
onPressChange: c,
|
|
1227
|
-
onPress: i,
|
|
1228
|
-
onPressUp: a,
|
|
1229
|
-
onClick: k,
|
|
1230
|
-
isDisabled: r,
|
|
1231
|
-
preventFocusOnPress: v,
|
|
1232
|
-
ref: t
|
|
1233
|
-
}), { focusableProps: O } = Dn(e, t);
|
|
1234
|
-
g && (O.tabIndex = r ? -1 : O.tabIndex);
|
|
1235
|
-
let B = j(O, w, Wt(e, {
|
|
1236
|
-
labelable: !0
|
|
1237
|
-
}));
|
|
1238
|
-
return {
|
|
1239
|
-
isPressed: T,
|
|
1240
|
-
buttonProps: j($, B, {
|
|
1241
|
-
"aria-haspopup": e["aria-haspopup"],
|
|
1242
|
-
"aria-expanded": e["aria-expanded"],
|
|
1243
|
-
"aria-controls": e["aria-controls"],
|
|
1244
|
-
"aria-pressed": e["aria-pressed"],
|
|
1245
|
-
"aria-current": e["aria-current"],
|
|
1246
|
-
"aria-disabled": e["aria-disabled"]
|
|
1247
|
-
})
|
|
1248
|
-
};
|
|
1249
|
-
}
|
|
1250
|
-
function Mn(e, t, n) {
|
|
1251
|
-
return t in e ? Object.defineProperty(e, t, {
|
|
1252
|
-
value: n,
|
|
1253
|
-
enumerable: !0,
|
|
1254
|
-
configurable: !0,
|
|
1255
|
-
writable: !0
|
|
1256
|
-
}) : e[t] = n, e;
|
|
1257
|
-
}
|
|
1258
|
-
function rt(e, t) {
|
|
1259
|
-
var n = Object.keys(e);
|
|
1260
|
-
if (Object.getOwnPropertySymbols) {
|
|
1261
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
1262
|
-
t && (r = r.filter(function(i) {
|
|
1263
|
-
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
1264
|
-
})), n.push.apply(n, r);
|
|
1265
|
-
}
|
|
1266
|
-
return n;
|
|
1267
|
-
}
|
|
1268
|
-
function st(e) {
|
|
1269
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
1270
|
-
var n = arguments[t] != null ? arguments[t] : {};
|
|
1271
|
-
t % 2 ? rt(Object(n), !0).forEach(function(r) {
|
|
1272
|
-
Mn(e, r, n[r]);
|
|
1273
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : rt(Object(n)).forEach(function(r) {
|
|
1274
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
1275
|
-
});
|
|
1276
|
-
}
|
|
1277
|
-
return e;
|
|
1278
|
-
}
|
|
1279
|
-
var Kn = (e, t, n) => {
|
|
1280
|
-
for (var r of Object.keys(e)) {
|
|
1281
|
-
var i;
|
|
1282
|
-
if (e[r] !== ((i = t[r]) !== null && i !== void 0 ? i : n[r]))
|
|
1283
|
-
return !1;
|
|
1284
|
-
}
|
|
1285
|
-
return !0;
|
|
1286
|
-
}, ye = (e) => (t) => {
|
|
1287
|
-
var n = e.defaultClassName, r = st(st({}, e.defaultVariants), t);
|
|
1288
|
-
for (var i in r) {
|
|
1289
|
-
var l, u = (l = r[i]) !== null && l !== void 0 ? l : e.defaultVariants[i];
|
|
1290
|
-
if (u != null) {
|
|
1291
|
-
var a = u;
|
|
1292
|
-
typeof a == "boolean" && (a = a === !0 ? "true" : "false");
|
|
1293
|
-
var c = (
|
|
1294
|
-
// @ts-expect-error
|
|
1295
|
-
e.variantClassNames[i][a]
|
|
1296
|
-
);
|
|
1297
|
-
c && (n += " " + c);
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
for (var [v, g] of e.compoundVariants)
|
|
1301
|
-
Kn(v, r, e.defaultVariants) && (n += " " + g);
|
|
1302
|
-
return n;
|
|
1303
|
-
}, Fn = ye({ defaultClassName: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy0", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy1", false: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy2" }, kind: { default: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy3", link: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy4", confirm: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy5", delete: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy6", key: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy7", icon: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy8" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy9", false: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyb"], [{ kind: "default", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyd"], [{ kind: "delete", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxye"], [{ kind: "key", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyf"], [{ disabled: !0, spinning: !1 }, "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyg"], [{ kind: "link", disabled: !0 }, "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyh"]] }), Vn = ye({ defaultClassName: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyi", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyj", false: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyk" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyl", default: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxym", delete: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyn", key: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyo", confirm: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyp", link: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyq" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyr", false: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxys" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), Un = ye({ defaultClassName: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyt", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyu", false: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyv" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyw", default: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyx", delete: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyy", key: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxyz", confirm: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy10", link: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy11" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), it = "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy12", Rn = ye({ defaultClassName: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy13", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy14", false: "pkg_sps-woodland_buttons__version_8_50_2__hash_125pcxy15" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
|
|
1304
|
-
const Tt = f.forwardRef(
|
|
1305
|
-
({
|
|
1306
|
-
as: e,
|
|
1307
|
-
onClick: t,
|
|
1308
|
-
onPress: n,
|
|
1309
|
-
children: r,
|
|
1310
|
-
className: i,
|
|
1311
|
-
isDisabled: l,
|
|
1312
|
-
disabled: u,
|
|
1313
|
-
href: a,
|
|
1314
|
-
icon: c,
|
|
1315
|
-
kind: v = "default",
|
|
1316
|
-
spinning: g,
|
|
1317
|
-
spinningTitle: k,
|
|
1318
|
-
title: C,
|
|
1319
|
-
...L
|
|
1320
|
-
}, N) => {
|
|
1321
|
-
const h = e ?? (a ? "a" : "button"), $ = {
|
|
1322
|
-
onPress: n ?? t,
|
|
1323
|
-
// the button element should be disabled if the button is marked as disabled or spinning
|
|
1324
|
-
isDisabled: g ?? u ?? l,
|
|
1325
|
-
...L
|
|
1326
|
-
}, { "data-testid": w } = L, T = f.useRef(null), O = N || T, { buttonProps: B } = In(
|
|
1327
|
-
$,
|
|
1328
|
-
O
|
|
1329
|
-
), { hoverProps: S } = An({ isDisabled: $.isDisabled }), { type: $e, ...I } = B, Ee = {
|
|
1330
|
-
...j(I, S),
|
|
1331
|
-
ref: O,
|
|
1332
|
-
title: C,
|
|
1333
|
-
className: a ? Un({ spinning: g, kind: v }) : Vn({ disabled: l || u, kind: v, spinning: g }),
|
|
1334
|
-
...a ? { href: a } : { type: $e },
|
|
1335
|
-
...L
|
|
1336
|
-
}, { t: A } = Ct(), R = c && (c === "ai-color" ? (
|
|
1337
|
-
// ai-color can only be used on default or link buttons for contrast/accessibility reasons
|
|
1338
|
-
// if the user tries to use ai-color on a non-approved button swap it out for the regular ai icon
|
|
1339
|
-
/* @__PURE__ */ f.createElement(
|
|
1340
|
-
Re,
|
|
1341
|
-
{
|
|
1342
|
-
className: it,
|
|
1343
|
-
icon: v === "default" || v === "link" ? "ai-color" : "ai",
|
|
1344
|
-
size: "sm",
|
|
1345
|
-
"aria-hidden": "true",
|
|
1346
|
-
"data-testid": `${w}__${c}-icon`
|
|
1347
|
-
}
|
|
1348
|
-
)
|
|
1349
|
-
) : /* @__PURE__ */ f.createElement(
|
|
1350
|
-
Re,
|
|
1351
|
-
{
|
|
1352
|
-
className: it,
|
|
1353
|
-
icon: c,
|
|
1354
|
-
size: "sm",
|
|
1355
|
-
"aria-hidden": "true",
|
|
1356
|
-
"data-testid": `${w}__${c}-icon`
|
|
1357
|
-
}
|
|
1358
|
-
));
|
|
1359
|
-
let F;
|
|
1360
|
-
v === "default" || v === "icon" || v === "link" ? F = "dark" : F = "light";
|
|
1361
|
-
const ee = g && /* @__PURE__ */ f.createElement(
|
|
1362
|
-
Bt,
|
|
1363
|
-
{
|
|
1364
|
-
color: F,
|
|
1365
|
-
className: Rn({ spinning: g }),
|
|
1366
|
-
title: k || A("button.spinningTitle", { defaultValue: "Loading..." }),
|
|
1367
|
-
"data-testid": `${w}__spinner`
|
|
1368
|
-
}
|
|
1369
|
-
);
|
|
1370
|
-
return /* @__PURE__ */ f.createElement(Dt, null, /* @__PURE__ */ f.createElement(
|
|
1371
|
-
"div",
|
|
1372
|
-
{
|
|
1373
|
-
className: St(
|
|
1374
|
-
Fn({
|
|
1375
|
-
disabled: l || u,
|
|
1376
|
-
kind: v,
|
|
1377
|
-
spinning: g
|
|
1378
|
-
}),
|
|
1379
|
-
i
|
|
1380
|
-
)
|
|
1381
|
-
},
|
|
1382
|
-
/* @__PURE__ */ f.createElement(h, { ...Ee }, R, r ? /* @__PURE__ */ f.createElement("span", null, r) : "", ee)
|
|
1383
|
-
));
|
|
1384
|
-
}
|
|
1385
|
-
);
|
|
1386
|
-
Lt.set(Tt, {
|
|
1387
|
-
name: "Button",
|
|
1388
|
-
props: {
|
|
1389
|
-
disabled: "boolean",
|
|
1390
|
-
href: "string",
|
|
1391
|
-
icon: "IconName",
|
|
1392
|
-
kind: {
|
|
1393
|
-
type: '"default" | "link" | "icon" | "confirm" | "delete" | "key"',
|
|
1394
|
-
default: '"default"'
|
|
1395
|
-
},
|
|
1396
|
-
spinning: "boolean",
|
|
1397
|
-
spinningTitle: "string",
|
|
1398
|
-
type: { type: '"button" | "submit"', default: '"button"' },
|
|
1399
|
-
as: "button | a",
|
|
1400
|
-
onClick: "() => void",
|
|
1401
|
-
onPress: "() => void",
|
|
1402
|
-
children: "ReactNode",
|
|
1403
|
-
className: "string",
|
|
1404
|
-
isDisabled: "boolean",
|
|
1405
|
-
style: "CSSProperties"
|
|
1406
|
-
},
|
|
1407
|
-
panellable: !0
|
|
1408
|
-
});
|
|
1409
|
-
const Hn = {
|
|
1410
|
-
components: [Tt],
|
|
1411
|
-
description: () => /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.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__ */ f.createElement("br", null), /* @__PURE__ */ f.createElement("h5", null, "Variants"), /* @__PURE__ */ f.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ f.createElement("span", { className: "sps-text-semibold" }, "Default: "), "For tertiary actions or actions of lower importance on a page."), /* @__PURE__ */ f.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ f.createElement("span", { className: "sps-text-semibold" }, "Key: "), "For primary or important actions on a page."), /* @__PURE__ */ f.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ f.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__ */ f.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ f.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__ */ f.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ f.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’s disabled."), /* @__PURE__ */ f.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ f.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.")),
|
|
1
|
+
import { Button as s } from "@sps-woodland/core/button";
|
|
2
|
+
export * from "@sps-woodland/core/button";
|
|
3
|
+
import * as o from "react";
|
|
4
|
+
import { code as n } from "@spscommerce/utils";
|
|
5
|
+
const i = {
|
|
6
|
+
components: [s],
|
|
7
|
+
description: () => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.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__ */ o.createElement("br", null), /* @__PURE__ */ o.createElement("h5", null, "Variants"), /* @__PURE__ */ o.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ o.createElement("span", { className: "sps-text-semibold" }, "Default: "), "For tertiary actions or actions of lower importance on a page."), /* @__PURE__ */ o.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ o.createElement("span", { className: "sps-text-semibold" }, "Key: "), "For primary or important actions on a page."), /* @__PURE__ */ o.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ o.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__ */ o.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ o.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__ */ o.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ o.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’s disabled."), /* @__PURE__ */ o.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ o.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.")),
|
|
1412
8
|
examples: {
|
|
1413
9
|
basic: {
|
|
1414
10
|
label: "Basic Buttons",
|
|
1415
|
-
description: ({ NavigateTo:
|
|
11
|
+
description: ({ NavigateTo: t }) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("p", null, "The most common type of button that can be used in most cases. Example: Basic Buttons in a ", /* @__PURE__ */ o.createElement(t, { to: "modals" }, "Modal"), ".")),
|
|
1416
12
|
examples: {
|
|
1417
13
|
withoutIcons: {
|
|
1418
14
|
description: "Without Icons",
|
|
1419
|
-
react:
|
|
15
|
+
react: n`
|
|
1420
16
|
import { Button } from "@sps-woodland/buttons";
|
|
1421
17
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1422
18
|
|
|
@@ -1435,7 +31,7 @@ const Hn = {
|
|
|
1435
31
|
},
|
|
1436
32
|
withIcons: {
|
|
1437
33
|
description: "With Icons",
|
|
1438
|
-
react:
|
|
34
|
+
react: n`
|
|
1439
35
|
import { Button } from "@sps-woodland/buttons";
|
|
1440
36
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1441
37
|
|
|
@@ -1454,7 +50,7 @@ const Hn = {
|
|
|
1454
50
|
},
|
|
1455
51
|
spinning: {
|
|
1456
52
|
description: "Spinning",
|
|
1457
|
-
react:
|
|
53
|
+
react: n`
|
|
1458
54
|
import { Button } from "@sps-woodland/buttons";
|
|
1459
55
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1460
56
|
|
|
@@ -1478,7 +74,7 @@ const Hn = {
|
|
|
1478
74
|
examples: {
|
|
1479
75
|
withoutIcons: {
|
|
1480
76
|
description: "Without Icons",
|
|
1481
|
-
react:
|
|
77
|
+
react: n`
|
|
1482
78
|
import { Dropdown, OptionList, Option } from "@sps-woodland/dropdowns";
|
|
1483
79
|
|
|
1484
80
|
function Component() {
|
|
@@ -1516,7 +112,7 @@ const Hn = {
|
|
|
1516
112
|
},
|
|
1517
113
|
withIcons: {
|
|
1518
114
|
description: "With Icons",
|
|
1519
|
-
react:
|
|
115
|
+
react: n`
|
|
1520
116
|
import { Dropdown, OptionList, Option } from "@sps-woodland/dropdowns";
|
|
1521
117
|
|
|
1522
118
|
function Component() {
|
|
@@ -1554,7 +150,7 @@ const Hn = {
|
|
|
1554
150
|
},
|
|
1555
151
|
spinning: {
|
|
1556
152
|
description: "Spinning",
|
|
1557
|
-
react:
|
|
153
|
+
react: n`
|
|
1558
154
|
import { Dropdown, OptionList, Option } from "@sps-woodland/dropdowns";
|
|
1559
155
|
|
|
1560
156
|
function Component() {
|
|
@@ -1593,7 +189,7 @@ const Hn = {
|
|
|
1593
189
|
examples: {
|
|
1594
190
|
withoutIcons: {
|
|
1595
191
|
description: "Without Icons",
|
|
1596
|
-
react:
|
|
192
|
+
react: n`
|
|
1597
193
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
|
1598
194
|
|
|
1599
195
|
function Component() {
|
|
@@ -1626,7 +222,7 @@ const Hn = {
|
|
|
1626
222
|
},
|
|
1627
223
|
withIcons: {
|
|
1628
224
|
description: "With Icons",
|
|
1629
|
-
react:
|
|
225
|
+
react: n`
|
|
1630
226
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
|
1631
227
|
|
|
1632
228
|
function Component() {
|
|
@@ -1675,11 +271,11 @@ const Hn = {
|
|
|
1675
271
|
},
|
|
1676
272
|
iconButtons: {
|
|
1677
273
|
label: "Icon Buttons",
|
|
1678
|
-
description: ({ NavigateTo:
|
|
274
|
+
description: ({ NavigateTo: t, Link: e }) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.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__ */ o.createElement(t, { 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__ */ o.createElement(e, { to: "/style-and-layout/icons/" }, "View All Icons"))),
|
|
1679
275
|
examples: {
|
|
1680
276
|
standard: {
|
|
1681
277
|
description: "Standard Icon Buttons",
|
|
1682
|
-
react:
|
|
278
|
+
react: n`
|
|
1683
279
|
import { Button } from "@sps-woodland/buttons";
|
|
1684
280
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1685
281
|
|
|
@@ -1701,8 +297,8 @@ const Hn = {
|
|
|
1701
297
|
`
|
|
1702
298
|
},
|
|
1703
299
|
dropdown: {
|
|
1704
|
-
description: ({ NavigateTo:
|
|
1705
|
-
react:
|
|
300
|
+
description: ({ NavigateTo: t }) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("h5", null, "Dropdown Icon Buttons"), /* @__PURE__ */ o.createElement("p", null, "Use these when there are several options available for action. Example: Dropdown Icon Button in a ", /* @__PURE__ */ o.createElement(t, { to: "content-rows" }, "Content Row"), ".")),
|
|
301
|
+
react: n`
|
|
1706
302
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
|
1707
303
|
|
|
1708
304
|
function Component() {
|
|
@@ -1720,7 +316,7 @@ const Hn = {
|
|
|
1720
316
|
},
|
|
1721
317
|
spinner: {
|
|
1722
318
|
description: "Spinner",
|
|
1723
|
-
react:
|
|
319
|
+
react: n`
|
|
1724
320
|
import { Button } from "@sps-woodland/buttons";
|
|
1725
321
|
|
|
1726
322
|
function Component() {
|
|
@@ -1736,11 +332,11 @@ const Hn = {
|
|
|
1736
332
|
},
|
|
1737
333
|
textButtons: {
|
|
1738
334
|
label: "Text Buttons",
|
|
1739
|
-
description: ({ NavigateTo:
|
|
335
|
+
description: ({ NavigateTo: t }) => /* @__PURE__ */ o.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__ */ o.createElement(t, { to: "list-toolbar" }, "List Toolbar")),
|
|
1740
336
|
examples: {
|
|
1741
337
|
withoutIcons: {
|
|
1742
338
|
description: "Without Icons",
|
|
1743
|
-
react:
|
|
339
|
+
react: n`
|
|
1744
340
|
import { Button } from "@sps-woodland/buttons";
|
|
1745
341
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1746
342
|
|
|
@@ -1757,7 +353,7 @@ const Hn = {
|
|
|
1757
353
|
},
|
|
1758
354
|
withIcons: {
|
|
1759
355
|
description: "With Icons",
|
|
1760
|
-
react:
|
|
356
|
+
react: n`
|
|
1761
357
|
import { Button } from "@sps-woodland/buttons";
|
|
1762
358
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1763
359
|
|
|
@@ -1774,7 +370,7 @@ const Hn = {
|
|
|
1774
370
|
},
|
|
1775
371
|
spinner: {
|
|
1776
372
|
description: "Spinner",
|
|
1777
|
-
react:
|
|
373
|
+
react: n`
|
|
1778
374
|
import { Button } from "@sps-woodland/buttons";
|
|
1779
375
|
|
|
1780
376
|
function Component() {
|
|
@@ -1790,10 +386,10 @@ const Hn = {
|
|
|
1790
386
|
},
|
|
1791
387
|
submitButtons: {
|
|
1792
388
|
label: "Submit Buttons",
|
|
1793
|
-
description: ({ NavigateTo:
|
|
389
|
+
description: ({ NavigateTo: t }) => /* @__PURE__ */ o.createElement("p", null, "Use to submit a form. There can be a number of visual variations, for example a", " ", /* @__PURE__ */ o.createElement(t, { to: "modals" }, "Modal"), " uses Basic Button (Key) as its Submit Button."),
|
|
1794
390
|
examples: {
|
|
1795
391
|
basic: {
|
|
1796
|
-
react:
|
|
392
|
+
react: n`
|
|
1797
393
|
import { Button } from "@sps-woodland/buttons";
|
|
1798
394
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1799
395
|
|
|
@@ -1821,7 +417,7 @@ const Hn = {
|
|
|
1821
417
|
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.",
|
|
1822
418
|
examples: {
|
|
1823
419
|
basic: {
|
|
1824
|
-
react:
|
|
420
|
+
react: n`
|
|
1825
421
|
import { Button } from "@sps-woodland/buttons";
|
|
1826
422
|
|
|
1827
423
|
function Component() {
|
|
@@ -1839,11 +435,11 @@ const Hn = {
|
|
|
1839
435
|
},
|
|
1840
436
|
buttonGroups: {
|
|
1841
437
|
label: "Button Groups",
|
|
1842
|
-
description: ({ NavigateTo:
|
|
438
|
+
description: ({ NavigateTo: t }) => /* @__PURE__ */ o.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__ */ o.createElement(t, { to: "List Action Bar" }, "List Action Bar"), "."),
|
|
1843
439
|
examples: {
|
|
1844
440
|
basic: {
|
|
1845
441
|
description: "Basic Button Groups",
|
|
1846
|
-
react:
|
|
442
|
+
react: n`
|
|
1847
443
|
import { Button } from "@sps-woodland/buttons";
|
|
1848
444
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1849
445
|
|
|
@@ -1859,7 +455,7 @@ const Hn = {
|
|
|
1859
455
|
},
|
|
1860
456
|
icon: {
|
|
1861
457
|
description: "Icon Button Groups",
|
|
1862
|
-
react:
|
|
458
|
+
react: n`
|
|
1863
459
|
import { Button } from "@sps-woodland/buttons";
|
|
1864
460
|
|
|
1865
461
|
function Component() {
|
|
@@ -1874,7 +470,7 @@ const Hn = {
|
|
|
1874
470
|
},
|
|
1875
471
|
textAndIcons: {
|
|
1876
472
|
description: "Text Buttons + Icon Buttons Group",
|
|
1877
|
-
react:
|
|
473
|
+
react: n`
|
|
1878
474
|
import { Button } from "@sps-woodland/buttons";
|
|
1879
475
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1880
476
|
import { VericalRule } from "@sps-woodland/core";
|
|
@@ -1893,7 +489,7 @@ const Hn = {
|
|
|
1893
489
|
},
|
|
1894
490
|
textAndBasic: {
|
|
1895
491
|
description: "Text Buttons + Basic Buttons Group",
|
|
1896
|
-
react:
|
|
492
|
+
react: n`
|
|
1897
493
|
import { Button } from "@sps-woodland/buttons";
|
|
1898
494
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1899
495
|
import { VericalRule } from "@sps-woodland/core";
|
|
@@ -1913,7 +509,7 @@ const Hn = {
|
|
|
1913
509
|
},
|
|
1914
510
|
iconsAndBasic: {
|
|
1915
511
|
description: "Icon Buttons + Basic Buttons Group",
|
|
1916
|
-
react:
|
|
512
|
+
react: n`
|
|
1917
513
|
import { Button } from "@sps-woodland/buttons";
|
|
1918
514
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1919
515
|
import { VericalRule } from "@sps-woodland/core";
|
|
@@ -1934,7 +530,7 @@ const Hn = {
|
|
|
1934
530
|
},
|
|
1935
531
|
textIconsAndBasic: {
|
|
1936
532
|
description: "Text Buttons + Icon Buttons + Basic Buttons Group",
|
|
1937
|
-
react:
|
|
533
|
+
react: n`
|
|
1938
534
|
import { Button } from "@sps-woodland/buttons";
|
|
1939
535
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
1940
536
|
import { VericalRule } from "@sps-woodland/core";
|
|
@@ -1958,10 +554,9 @@ const Hn = {
|
|
|
1958
554
|
}
|
|
1959
555
|
}
|
|
1960
556
|
}
|
|
1961
|
-
},
|
|
1962
|
-
Buttons:
|
|
557
|
+
}, a = {
|
|
558
|
+
Buttons: i
|
|
1963
559
|
};
|
|
1964
560
|
export {
|
|
1965
|
-
|
|
1966
|
-
qn as MANIFEST
|
|
561
|
+
a as MANIFEST
|
|
1967
562
|
};
|