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