@sps-woodland/buttons 8.17.1 → 8.18.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 +23 -23
- package/lib/index.es.js +464 -447
- package/lib/style.css +1 -1
- package/package.json +5 -5
- package/vite.config.mjs +11 -2
package/lib/index.es.js
CHANGED
@@ -1,76 +1,76 @@
|
|
1
1
|
import * as c from "react";
|
2
|
-
import
|
3
|
-
import { Metadata as
|
4
|
-
import { useFocusable as
|
5
|
-
import { code as
|
6
|
-
const Pe = typeof document < "u" ?
|
2
|
+
import Be, { useRef as ee, useCallback as z, useEffect as J, useState as $e, useMemo as Ee, useContext as Le } from "react";
|
3
|
+
import { Metadata as Me, I18nContext as Fe, Spinner as Ue, cl as He, Icon as Re } from "@sps-woodland/core";
|
4
|
+
import { useFocusable as Ge, FocusRing as Ve } from "@react-aria/focus";
|
5
|
+
import { code as h } from "@spscommerce/utils";
|
6
|
+
const Pe = typeof document < "u" ? Be.useLayoutEffect : () => {
|
7
7
|
};
|
8
|
-
function
|
9
|
-
const t =
|
8
|
+
function H(e) {
|
9
|
+
const t = ee(null);
|
10
10
|
return Pe(() => {
|
11
11
|
t.current = e;
|
12
12
|
}, [
|
13
13
|
e
|
14
|
-
]),
|
14
|
+
]), z((...r) => {
|
15
15
|
const o = t.current;
|
16
16
|
return o == null ? void 0 : o(...r);
|
17
17
|
}, []);
|
18
18
|
}
|
19
|
-
let
|
20
|
-
function
|
19
|
+
let fe = /* @__PURE__ */ new Map();
|
20
|
+
function We(e, t) {
|
21
21
|
if (e === t) return e;
|
22
|
-
let r =
|
22
|
+
let r = fe.get(e);
|
23
23
|
if (r)
|
24
24
|
return r(t), t;
|
25
|
-
let o =
|
25
|
+
let o = fe.get(t);
|
26
26
|
return o ? (o(e), e) : t;
|
27
27
|
}
|
28
|
-
function
|
28
|
+
function xe(...e) {
|
29
29
|
return (...t) => {
|
30
30
|
for (let r of e) typeof r == "function" && r(...t);
|
31
31
|
};
|
32
32
|
}
|
33
|
-
const
|
33
|
+
const K = (e) => {
|
34
34
|
var t;
|
35
35
|
return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
|
36
|
-
},
|
37
|
-
function
|
36
|
+
}, ie = (e) => e && "window" in e && e.window === e ? e : K(e).defaultView || window;
|
37
|
+
function Se(e) {
|
38
38
|
var t, r, o = "";
|
39
39
|
if (typeof e == "string" || typeof e == "number") o += e;
|
40
40
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
41
|
-
var
|
42
|
-
for (t = 0; t <
|
41
|
+
var a = e.length;
|
42
|
+
for (t = 0; t < a; t++) e[t] && (r = Se(e[t])) && (o && (o += " "), o += r);
|
43
43
|
} else for (r in e) e[r] && (o && (o += " "), o += r);
|
44
44
|
return o;
|
45
45
|
}
|
46
|
-
function
|
47
|
-
for (var e, t, r = 0, o = "",
|
46
|
+
function Ye() {
|
47
|
+
for (var e, t, r = 0, o = "", a = arguments.length; r < a; r++) (e = arguments[r]) && (t = Se(e)) && (o && (o += " "), o += t);
|
48
48
|
return o;
|
49
49
|
}
|
50
|
-
function
|
50
|
+
function G(...e) {
|
51
51
|
let t = {
|
52
52
|
...e[0]
|
53
53
|
};
|
54
54
|
for (let r = 1; r < e.length; r++) {
|
55
55
|
let o = e[r];
|
56
|
-
for (let
|
57
|
-
let
|
58
|
-
typeof
|
59
|
-
|
60
|
-
65 &&
|
61
|
-
90 ? t[
|
56
|
+
for (let a in o) {
|
57
|
+
let d = t[a], u = o[a];
|
58
|
+
typeof d == "function" && typeof u == "function" && // This is a lot faster than a regex.
|
59
|
+
a[0] === "o" && a[1] === "n" && a.charCodeAt(2) >= /* 'A' */
|
60
|
+
65 && a.charCodeAt(2) <= /* 'Z' */
|
61
|
+
90 ? t[a] = xe(d, u) : (a === "className" || a === "UNSAFE_className") && typeof d == "string" && typeof u == "string" ? t[a] = Ye(d, u) : a === "id" && d && u ? t.id = We(d, u) : t[a] = u !== void 0 ? u : d;
|
62
62
|
}
|
63
63
|
}
|
64
64
|
return t;
|
65
65
|
}
|
66
|
-
const
|
66
|
+
const je = /* @__PURE__ */ new Set([
|
67
67
|
"id"
|
68
|
-
]),
|
68
|
+
]), Xe = /* @__PURE__ */ new Set([
|
69
69
|
"aria-label",
|
70
70
|
"aria-labelledby",
|
71
71
|
"aria-describedby",
|
72
72
|
"aria-details"
|
73
|
-
]),
|
73
|
+
]), ze = /* @__PURE__ */ new Set([
|
74
74
|
"href",
|
75
75
|
"hrefLang",
|
76
76
|
"target",
|
@@ -78,37 +78,37 @@ const We = /* @__PURE__ */ new Set([
|
|
78
78
|
"download",
|
79
79
|
"ping",
|
80
80
|
"referrerPolicy"
|
81
|
-
]),
|
82
|
-
function
|
83
|
-
let { labelable: r, isLink: o, propNames:
|
84
|
-
for (const u in e) Object.prototype.hasOwnProperty.call(e, u) && (
|
85
|
-
return
|
81
|
+
]), qe = /^(data-.*)$/;
|
82
|
+
function Je(e, t = {}) {
|
83
|
+
let { labelable: r, isLink: o, propNames: a } = t, d = {};
|
84
|
+
for (const u in e) Object.prototype.hasOwnProperty.call(e, u) && (je.has(u) || r && Xe.has(u) || o && ze.has(u) || a != null && a.has(u) || qe.test(u)) && (d[u] = e[u]);
|
85
|
+
return d;
|
86
86
|
}
|
87
|
-
function
|
88
|
-
if (
|
87
|
+
function R(e) {
|
88
|
+
if (Qe()) e.focus({
|
89
89
|
preventScroll: !0
|
90
90
|
});
|
91
91
|
else {
|
92
|
-
let t =
|
93
|
-
e.focus(),
|
92
|
+
let t = Ze(e);
|
93
|
+
e.focus(), et(t);
|
94
94
|
}
|
95
95
|
}
|
96
|
-
let
|
97
|
-
function
|
98
|
-
if (
|
99
|
-
|
96
|
+
let W = null;
|
97
|
+
function Qe() {
|
98
|
+
if (W == null) {
|
99
|
+
W = !1;
|
100
100
|
try {
|
101
101
|
document.createElement("div").focus({
|
102
102
|
get preventScroll() {
|
103
|
-
return
|
103
|
+
return W = !0, !0;
|
104
104
|
}
|
105
105
|
});
|
106
106
|
} catch {
|
107
107
|
}
|
108
108
|
}
|
109
|
-
return
|
109
|
+
return W;
|
110
110
|
}
|
111
|
-
function
|
111
|
+
function Ze(e) {
|
112
112
|
let t = e.parentNode, r = [], o = document.scrollingElement || document.documentElement;
|
113
113
|
for (; t instanceof HTMLElement && t !== o; )
|
114
114
|
(t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && r.push({
|
@@ -122,115 +122,112 @@ function Je(e) {
|
|
122
122
|
scrollLeft: o.scrollLeft
|
123
123
|
}), r;
|
124
124
|
}
|
125
|
-
function
|
125
|
+
function et(e) {
|
126
126
|
for (let { element: t, scrollTop: r, scrollLeft: o } of e)
|
127
127
|
t.scrollTop = r, t.scrollLeft = o;
|
128
128
|
}
|
129
|
-
function
|
129
|
+
function te(e) {
|
130
130
|
var t;
|
131
131
|
return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((r) => e.test(r.brand))) || e.test(window.navigator.userAgent);
|
132
132
|
}
|
133
|
-
function
|
133
|
+
function de(e) {
|
134
134
|
var t;
|
135
135
|
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;
|
136
136
|
}
|
137
|
-
function
|
138
|
-
|
137
|
+
function I(e) {
|
138
|
+
let t = null;
|
139
|
+
return () => (t == null && (t = e()), t);
|
139
140
|
}
|
140
|
-
|
141
|
-
return
|
142
|
-
}
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
return
|
149
|
-
}
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
return
|
155
|
-
}
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
var o, i;
|
164
|
-
let { metaKey: p, ctrlKey: u, altKey: d, shiftKey: b } = t;
|
165
|
-
nt() && (!((i = window.event) === null || i === void 0 || (o = i.type) === null || o === void 0) && o.startsWith("key")) && e.target === "_blank" && (q() ? p = !0 : u = !0);
|
166
|
-
let h = et() && q() && !Se() ? new KeyboardEvent("keydown", {
|
141
|
+
const Q = I(function() {
|
142
|
+
return de(/^Mac/i);
|
143
|
+
}), tt = I(function() {
|
144
|
+
return de(/^iPhone/i);
|
145
|
+
}), Ne = I(function() {
|
146
|
+
return de(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
147
|
+
Q() && navigator.maxTouchPoints > 1;
|
148
|
+
}), Oe = I(function() {
|
149
|
+
return tt() || Ne();
|
150
|
+
}), nt = I(function() {
|
151
|
+
return te(/AppleWebKit/i) && !ot();
|
152
|
+
}), ot = I(function() {
|
153
|
+
return te(/Chrome/i);
|
154
|
+
}), De = I(function() {
|
155
|
+
return te(/Android/i);
|
156
|
+
}), rt = I(function() {
|
157
|
+
return te(/Firefox/i);
|
158
|
+
});
|
159
|
+
function V(e, t, r = !0) {
|
160
|
+
var o, a;
|
161
|
+
let { metaKey: d, ctrlKey: u, altKey: p, shiftKey: m } = t;
|
162
|
+
rt() && (!((a = window.event) === null || a === void 0 || (o = a.type) === null || o === void 0) && o.startsWith("key")) && e.target === "_blank" && (Q() ? d = !0 : u = !0);
|
163
|
+
let g = nt() && Q() && !Ne() ? new KeyboardEvent("keydown", {
|
167
164
|
keyIdentifier: "Enter",
|
168
|
-
metaKey:
|
165
|
+
metaKey: d,
|
169
166
|
ctrlKey: u,
|
170
|
-
altKey:
|
171
|
-
shiftKey:
|
167
|
+
altKey: p,
|
168
|
+
shiftKey: m
|
172
169
|
}) : new MouseEvent("click", {
|
173
|
-
metaKey:
|
170
|
+
metaKey: d,
|
174
171
|
ctrlKey: u,
|
175
|
-
altKey:
|
176
|
-
shiftKey:
|
172
|
+
altKey: p,
|
173
|
+
shiftKey: m,
|
177
174
|
bubbles: !0,
|
178
175
|
cancelable: !0
|
179
176
|
});
|
180
|
-
|
177
|
+
V.isOpening = r, R(e), e.dispatchEvent(g), V.isOpening = !1;
|
181
178
|
}
|
182
|
-
|
183
|
-
let
|
184
|
-
function
|
179
|
+
V.isOpening = !1;
|
180
|
+
let F = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Set();
|
181
|
+
function me() {
|
185
182
|
if (typeof window > "u") return;
|
186
183
|
function e(o) {
|
187
184
|
return "propertyName" in o;
|
188
185
|
}
|
189
186
|
let t = (o) => {
|
190
187
|
if (!e(o) || !o.target) return;
|
191
|
-
let
|
192
|
-
|
188
|
+
let a = F.get(o.target);
|
189
|
+
a || (a = /* @__PURE__ */ new Set(), F.set(o.target, a), o.target.addEventListener("transitioncancel", r, {
|
193
190
|
once: !0
|
194
|
-
})),
|
191
|
+
})), a.add(o.propertyName);
|
195
192
|
}, r = (o) => {
|
196
193
|
if (!e(o) || !o.target) return;
|
197
|
-
let
|
198
|
-
if (
|
199
|
-
for (let
|
200
|
-
|
194
|
+
let a = F.get(o.target);
|
195
|
+
if (a && (a.delete(o.propertyName), a.size === 0 && (o.target.removeEventListener("transitioncancel", r), F.delete(o.target)), F.size === 0)) {
|
196
|
+
for (let d of le) d();
|
197
|
+
le.clear();
|
201
198
|
}
|
202
199
|
};
|
203
200
|
document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", r);
|
204
201
|
}
|
205
|
-
typeof document < "u" && (document.readyState !== "loading" ?
|
206
|
-
function
|
202
|
+
typeof document < "u" && (document.readyState !== "loading" ? me() : document.addEventListener("DOMContentLoaded", me));
|
203
|
+
function st(e) {
|
207
204
|
requestAnimationFrame(() => {
|
208
|
-
|
205
|
+
F.size === 0 ? e() : le.add(e);
|
209
206
|
});
|
210
207
|
}
|
211
|
-
function
|
212
|
-
let e =
|
213
|
-
let
|
214
|
-
e.current.delete(u), u(...
|
208
|
+
function at() {
|
209
|
+
let e = ee(/* @__PURE__ */ new Map()), t = z((a, d, u, p) => {
|
210
|
+
let m = p != null && p.once ? (...g) => {
|
211
|
+
e.current.delete(u), u(...g);
|
215
212
|
} : u;
|
216
213
|
e.current.set(u, {
|
217
|
-
type:
|
218
|
-
eventTarget:
|
219
|
-
fn:
|
220
|
-
options:
|
221
|
-
}),
|
222
|
-
}, []), r =
|
223
|
-
var
|
224
|
-
let
|
225
|
-
|
226
|
-
}, []), o =
|
227
|
-
e.current.forEach((
|
228
|
-
r(
|
214
|
+
type: d,
|
215
|
+
eventTarget: a,
|
216
|
+
fn: m,
|
217
|
+
options: p
|
218
|
+
}), a.addEventListener(d, u, p);
|
219
|
+
}, []), r = z((a, d, u, p) => {
|
220
|
+
var m;
|
221
|
+
let g = ((m = e.current.get(u)) === null || m === void 0 ? void 0 : m.fn) || u;
|
222
|
+
a.removeEventListener(d, g, p), e.current.delete(u);
|
223
|
+
}, []), o = z(() => {
|
224
|
+
e.current.forEach((a, d) => {
|
225
|
+
r(a.eventTarget, a.type, d, a.options);
|
229
226
|
});
|
230
227
|
}, [
|
231
228
|
r
|
232
229
|
]);
|
233
|
-
return
|
230
|
+
return J(() => o, [
|
234
231
|
o
|
235
232
|
]), {
|
236
233
|
addGlobalListener: t,
|
@@ -238,7 +235,7 @@ function ot() {
|
|
238
235
|
removeAllGlobalListeners: o
|
239
236
|
};
|
240
237
|
}
|
241
|
-
function
|
238
|
+
function it(e, t) {
|
242
239
|
Pe(() => {
|
243
240
|
if (e && e.ref && t)
|
244
241
|
return e.ref.current = t.current, () => {
|
@@ -246,62 +243,62 @@ function st(e, t) {
|
|
246
243
|
};
|
247
244
|
});
|
248
245
|
}
|
249
|
-
function
|
250
|
-
return e.mozInputSource === 0 && e.isTrusted ? !0 :
|
246
|
+
function _e(e) {
|
247
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : De() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
251
248
|
}
|
252
|
-
function
|
253
|
-
return !
|
249
|
+
function lt(e) {
|
250
|
+
return !De() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
|
254
251
|
}
|
255
|
-
let
|
256
|
-
function
|
257
|
-
if (
|
258
|
-
if (
|
259
|
-
const t =
|
260
|
-
|
252
|
+
let U = "default", ue = "", q = /* @__PURE__ */ new WeakMap();
|
253
|
+
function be(e) {
|
254
|
+
if (Oe()) {
|
255
|
+
if (U === "default") {
|
256
|
+
const t = K(e);
|
257
|
+
ue = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
|
261
258
|
}
|
262
|
-
|
263
|
-
} else (e instanceof HTMLElement || e instanceof SVGElement) && (
|
259
|
+
U = "disabled";
|
260
|
+
} else (e instanceof HTMLElement || e instanceof SVGElement) && (q.set(e, e.style.userSelect), e.style.userSelect = "none");
|
264
261
|
}
|
265
|
-
function
|
266
|
-
if (
|
267
|
-
if (
|
268
|
-
|
269
|
-
|
270
|
-
if (
|
271
|
-
const t =
|
272
|
-
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect =
|
262
|
+
function Y(e) {
|
263
|
+
if (Oe()) {
|
264
|
+
if (U !== "disabled") return;
|
265
|
+
U = "restoring", setTimeout(() => {
|
266
|
+
st(() => {
|
267
|
+
if (U === "restoring") {
|
268
|
+
const t = K(e);
|
269
|
+
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = ue || ""), ue = "", U = "default";
|
273
270
|
}
|
274
271
|
});
|
275
272
|
}, 300);
|
276
|
-
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e &&
|
277
|
-
let t =
|
278
|
-
e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"),
|
273
|
+
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && q.has(e)) {
|
274
|
+
let t = q.get(e);
|
275
|
+
e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), q.delete(e);
|
279
276
|
}
|
280
277
|
}
|
281
|
-
const
|
278
|
+
const Ce = Be.createContext({
|
282
279
|
register: () => {
|
283
280
|
}
|
284
281
|
});
|
285
|
-
|
286
|
-
function
|
282
|
+
Ce.displayName = "PressResponderContext";
|
283
|
+
function ut(e, t) {
|
287
284
|
return t.get ? t.get.call(e) : t.value;
|
288
285
|
}
|
289
|
-
function
|
286
|
+
function Ke(e, t, r) {
|
290
287
|
if (!t.has(e)) throw new TypeError("attempted to " + r + " private field on non-instance");
|
291
288
|
return t.get(e);
|
292
289
|
}
|
293
|
-
function
|
294
|
-
var r =
|
295
|
-
return
|
290
|
+
function ct(e, t) {
|
291
|
+
var r = Ke(e, t, "get");
|
292
|
+
return ut(e, r);
|
296
293
|
}
|
297
|
-
function
|
294
|
+
function dt(e, t) {
|
298
295
|
if (t.has(e))
|
299
296
|
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
300
297
|
}
|
301
|
-
function ct(e, t, r) {
|
302
|
-
ut(e, t), t.set(e, r);
|
303
|
-
}
|
304
298
|
function pt(e, t, r) {
|
299
|
+
dt(e, t), t.set(e, r);
|
300
|
+
}
|
301
|
+
function ft(e, t, r) {
|
305
302
|
if (t.set) t.set.call(e, r);
|
306
303
|
else {
|
307
304
|
if (!t.writable)
|
@@ -309,50 +306,55 @@ function pt(e, t, r) {
|
|
309
306
|
t.value = r;
|
310
307
|
}
|
311
308
|
}
|
312
|
-
function
|
313
|
-
var o =
|
314
|
-
return
|
309
|
+
function ge(e, t, r) {
|
310
|
+
var o = Ke(e, t, "set");
|
311
|
+
return ft(e, o, r), r;
|
315
312
|
}
|
316
|
-
function
|
317
|
-
let t =
|
313
|
+
function mt(e) {
|
314
|
+
let t = Le(Ce);
|
318
315
|
if (t) {
|
319
316
|
let { register: r, ...o } = t;
|
320
|
-
e =
|
317
|
+
e = G(o, e), r();
|
321
318
|
}
|
322
|
-
return
|
319
|
+
return it(t, e.ref), e;
|
323
320
|
}
|
324
|
-
var
|
325
|
-
class
|
321
|
+
var j = /* @__PURE__ */ new WeakMap();
|
322
|
+
class X {
|
326
323
|
continuePropagation() {
|
327
|
-
|
324
|
+
ge(this, j, !1);
|
328
325
|
}
|
329
326
|
get shouldStopPropagation() {
|
330
|
-
return
|
327
|
+
return ct(this, j);
|
331
328
|
}
|
332
|
-
constructor(t, r, o) {
|
333
|
-
|
329
|
+
constructor(t, r, o, a) {
|
330
|
+
pt(this, j, {
|
334
331
|
writable: !0,
|
335
332
|
value: void 0
|
336
|
-
}),
|
333
|
+
}), ge(this, j, !0);
|
334
|
+
var d;
|
335
|
+
let u = (d = a == null ? void 0 : a.target) !== null && d !== void 0 ? d : o.currentTarget;
|
336
|
+
const p = u == null ? void 0 : u.getBoundingClientRect();
|
337
|
+
let m, g = 0, b, E = null;
|
338
|
+
o.clientX != null && o.clientY != null && (b = o.clientX, E = o.clientY), p && (b != null && E != null ? (m = b - p.left, g = E - p.top) : (m = p.width / 2, g = p.height / 2)), this.type = t, this.pointerType = r, this.target = o.currentTarget, this.shiftKey = o.shiftKey, this.metaKey = o.metaKey, this.ctrlKey = o.ctrlKey, this.altKey = o.altKey, this.x = m, this.y = g;
|
337
339
|
}
|
338
340
|
}
|
339
|
-
const
|
340
|
-
function
|
341
|
+
const ve = Symbol("linkClicked");
|
342
|
+
function _t(e) {
|
341
343
|
let {
|
342
344
|
onPress: t,
|
343
345
|
onPressChange: r,
|
344
346
|
onPressStart: o,
|
345
|
-
onPressEnd:
|
346
|
-
onPressUp:
|
347
|
+
onPressEnd: a,
|
348
|
+
onPressUp: d,
|
347
349
|
isDisabled: u,
|
348
|
-
isPressed:
|
349
|
-
preventFocusOnPress:
|
350
|
-
shouldCancelOnPointerExit:
|
351
|
-
allowTextSelectionOnPress:
|
350
|
+
isPressed: p,
|
351
|
+
preventFocusOnPress: m,
|
352
|
+
shouldCancelOnPointerExit: g,
|
353
|
+
allowTextSelectionOnPress: b,
|
352
354
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
353
|
-
ref:
|
355
|
+
ref: E,
|
354
356
|
...x
|
355
|
-
} =
|
357
|
+
} = mt(e), [_, P] = $e(!1), w = ee({
|
356
358
|
isPressed: !1,
|
357
359
|
ignoreEmulatedMouseEvents: !1,
|
358
360
|
ignoreClickAfterPress: !1,
|
@@ -362,126 +364,126 @@ function ft(e) {
|
|
362
364
|
target: null,
|
363
365
|
isOverTarget: !1,
|
364
366
|
pointerType: null
|
365
|
-
}), { addGlobalListener:
|
366
|
-
let
|
367
|
-
if (u ||
|
367
|
+
}), { addGlobalListener: B, removeAllGlobalListeners: S } = at(), $ = H((n, f) => {
|
368
|
+
let T = w.current;
|
369
|
+
if (u || T.didFirePressStart) return !1;
|
368
370
|
let l = !0;
|
369
|
-
if (
|
370
|
-
let v = new
|
371
|
+
if (T.isTriggeringEvent = !0, o) {
|
372
|
+
let v = new X("pressstart", f, n);
|
371
373
|
o(v), l = v.shouldStopPropagation;
|
372
374
|
}
|
373
|
-
return r && r(!0),
|
374
|
-
}),
|
375
|
-
let l =
|
375
|
+
return r && r(!0), T.isTriggeringEvent = !1, T.didFirePressStart = !0, P(!0), l;
|
376
|
+
}), k = H((n, f, T = !0) => {
|
377
|
+
let l = w.current;
|
376
378
|
if (!l.didFirePressStart) return !1;
|
377
379
|
l.ignoreClickAfterPress = !0, l.didFirePressStart = !1, l.isTriggeringEvent = !0;
|
378
380
|
let v = !0;
|
379
|
-
if (
|
380
|
-
let s = new
|
381
|
-
|
381
|
+
if (a) {
|
382
|
+
let s = new X("pressend", f, n);
|
383
|
+
a(s), v = s.shouldStopPropagation;
|
382
384
|
}
|
383
|
-
if (r && r(!1),
|
384
|
-
let s = new
|
385
|
+
if (r && r(!1), P(!1), t && T && !u) {
|
386
|
+
let s = new X("press", f, n);
|
385
387
|
t(s), v && (v = s.shouldStopPropagation);
|
386
388
|
}
|
387
389
|
return l.isTriggeringEvent = !1, v;
|
388
|
-
}), O =
|
389
|
-
let
|
390
|
+
}), O = H((n, f) => {
|
391
|
+
let T = w.current;
|
390
392
|
if (u) return !1;
|
391
|
-
if (
|
392
|
-
|
393
|
-
let l = new
|
394
|
-
return
|
393
|
+
if (d) {
|
394
|
+
T.isTriggeringEvent = !0;
|
395
|
+
let l = new X("pressup", f, n);
|
396
|
+
return d(l), T.isTriggeringEvent = !1, l.shouldStopPropagation;
|
395
397
|
}
|
396
398
|
return !0;
|
397
|
-
}), N =
|
398
|
-
let f =
|
399
|
-
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null &&
|
400
|
-
}),
|
401
|
-
|
402
|
-
}),
|
403
|
-
let n =
|
399
|
+
}), N = H((n) => {
|
400
|
+
let f = w.current;
|
401
|
+
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && k(D(f.target, n), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, S(), b || Y(f.target));
|
402
|
+
}), A = H((n) => {
|
403
|
+
g && N(n);
|
404
|
+
}), oe = Ee(() => {
|
405
|
+
let n = w.current, f = {
|
404
406
|
onKeyDown(l) {
|
405
|
-
if (
|
407
|
+
if (re(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
|
406
408
|
var v;
|
407
409
|
ye(l.target, l.key) && l.preventDefault();
|
408
410
|
let s = !0;
|
409
411
|
if (!n.isPressed && !l.repeat) {
|
410
|
-
n.target = l.currentTarget, n.isPressed = !0, s =
|
411
|
-
let
|
412
|
-
|
412
|
+
n.target = l.currentTarget, n.isPressed = !0, s = $(l, "keyboard");
|
413
|
+
let i = l.currentTarget, y = (L) => {
|
414
|
+
re(L, i) && !L.repeat && i.contains(L.target) && n.target && O(D(n.target, L), "keyboard");
|
413
415
|
};
|
414
|
-
|
416
|
+
B(K(l.currentTarget), "keyup", xe(y, T), !0);
|
415
417
|
}
|
416
|
-
s && l.stopPropagation(), l.metaKey &&
|
418
|
+
s && l.stopPropagation(), l.metaKey && Q() && ((v = n.metaKeyEvents) === null || v === void 0 || v.set(l.key, l.nativeEvent));
|
417
419
|
} else l.key === "Meta" && (n.metaKeyEvents = /* @__PURE__ */ new Map());
|
418
420
|
},
|
419
421
|
onClick(l) {
|
420
|
-
if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !n.isTriggeringEvent && !
|
422
|
+
if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !n.isTriggeringEvent && !V.isOpening) {
|
421
423
|
let v = !0;
|
422
|
-
if (u && l.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && !n.isPressed && (n.pointerType === "virtual" ||
|
423
|
-
!u && !
|
424
|
-
let s =
|
425
|
-
v = s &&
|
424
|
+
if (u && l.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && !n.isPressed && (n.pointerType === "virtual" || _e(l.nativeEvent))) {
|
425
|
+
!u && !m && R(l.currentTarget);
|
426
|
+
let s = $(l, "virtual"), i = O(l, "virtual"), y = k(l, "virtual");
|
427
|
+
v = s && i && y;
|
426
428
|
}
|
427
429
|
n.ignoreEmulatedMouseEvents = !1, n.ignoreClickAfterPress = !1, v && l.stopPropagation();
|
428
430
|
}
|
429
431
|
}
|
430
|
-
},
|
432
|
+
}, T = (l) => {
|
431
433
|
var v;
|
432
|
-
if (n.isPressed && n.target &&
|
434
|
+
if (n.isPressed && n.target && re(l, n.target)) {
|
433
435
|
var s;
|
434
436
|
ye(l.target, l.key) && l.preventDefault();
|
435
|
-
let
|
436
|
-
|
437
|
+
let y = l.target;
|
438
|
+
k(D(n.target, l), "keyboard", n.target.contains(y)), S(), l.key !== "Enter" && pe(n.target) && n.target.contains(y) && !l[ve] && (l[ve] = !0, V(n.target, l, !1)), n.isPressed = !1, (s = n.metaKeyEvents) === null || s === void 0 || s.delete(l.key);
|
437
439
|
} else if (l.key === "Meta" && (!((v = n.metaKeyEvents) === null || v === void 0) && v.size)) {
|
438
|
-
var
|
439
|
-
let
|
440
|
+
var i;
|
441
|
+
let y = n.metaKeyEvents;
|
440
442
|
n.metaKeyEvents = void 0;
|
441
|
-
for (let
|
443
|
+
for (let L of y.values()) (i = n.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", L));
|
442
444
|
}
|
443
445
|
};
|
444
446
|
if (typeof PointerEvent < "u") {
|
445
|
-
f.onPointerDown = (
|
446
|
-
if (
|
447
|
-
if (
|
447
|
+
f.onPointerDown = (i) => {
|
448
|
+
if (i.button !== 0 || !i.currentTarget.contains(i.target)) return;
|
449
|
+
if (lt(i.nativeEvent)) {
|
448
450
|
n.pointerType = "virtual";
|
449
451
|
return;
|
450
452
|
}
|
451
|
-
|
452
|
-
let
|
453
|
-
n.isPressed || (n.isPressed = !0, n.isOverTarget = !0, n.activePointerId =
|
454
|
-
}, f.onMouseDown = (
|
455
|
-
|
456
|
-
}, f.onPointerUp = (
|
457
|
-
!
|
453
|
+
se(i.currentTarget) && i.preventDefault(), n.pointerType = i.pointerType;
|
454
|
+
let y = !0;
|
455
|
+
n.isPressed || (n.isPressed = !0, n.isOverTarget = !0, n.activePointerId = i.pointerId, n.target = i.currentTarget, !u && !m && R(i.currentTarget), b || be(n.target), y = $(i, n.pointerType), B(K(i.currentTarget), "pointermove", l, !1), B(K(i.currentTarget), "pointerup", v, !1), B(K(i.currentTarget), "pointercancel", s, !1)), y && i.stopPropagation();
|
456
|
+
}, f.onMouseDown = (i) => {
|
457
|
+
i.currentTarget.contains(i.target) && i.button === 0 && (se(i.currentTarget) && i.preventDefault(), i.stopPropagation());
|
458
|
+
}, f.onPointerUp = (i) => {
|
459
|
+
!i.currentTarget.contains(i.target) || n.pointerType === "virtual" || i.button === 0 && M(i, i.currentTarget) && O(i, n.pointerType || i.pointerType);
|
458
460
|
};
|
459
|
-
let l = (
|
460
|
-
|
461
|
-
}, v = (
|
462
|
-
|
463
|
-
}, s = (
|
464
|
-
N(
|
461
|
+
let l = (i) => {
|
462
|
+
i.pointerId === n.activePointerId && (n.target && M(i, n.target) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, $(D(n.target, i), n.pointerType)) : n.target && n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, k(D(n.target, i), n.pointerType, !1), A(i)));
|
463
|
+
}, v = (i) => {
|
464
|
+
i.pointerId === n.activePointerId && n.isPressed && i.button === 0 && n.target && (M(i, n.target) && n.pointerType != null ? k(D(n.target, i), n.pointerType) : n.isOverTarget && n.pointerType != null && k(D(n.target, i), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, S(), b || Y(n.target));
|
465
|
+
}, s = (i) => {
|
466
|
+
N(i);
|
465
467
|
};
|
466
|
-
f.onDragStart = (
|
467
|
-
|
468
|
+
f.onDragStart = (i) => {
|
469
|
+
i.currentTarget.contains(i.target) && N(i);
|
468
470
|
};
|
469
471
|
} else {
|
470
472
|
f.onMouseDown = (s) => {
|
471
473
|
if (s.button !== 0 || !s.currentTarget.contains(s.target)) return;
|
472
|
-
if (
|
474
|
+
if (se(s.currentTarget) && s.preventDefault(), n.ignoreEmulatedMouseEvents) {
|
473
475
|
s.stopPropagation();
|
474
476
|
return;
|
475
477
|
}
|
476
|
-
n.isPressed = !0, n.isOverTarget = !0, n.target = s.currentTarget, n.pointerType =
|
478
|
+
n.isPressed = !0, n.isOverTarget = !0, n.target = s.currentTarget, n.pointerType = _e(s.nativeEvent) ? "virtual" : "mouse", !u && !m && R(s.currentTarget), $(s, n.pointerType) && s.stopPropagation(), B(K(s.currentTarget), "mouseup", l, !1);
|
477
479
|
}, f.onMouseEnter = (s) => {
|
478
480
|
if (!s.currentTarget.contains(s.target)) return;
|
479
|
-
let
|
480
|
-
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0,
|
481
|
+
let i = !0;
|
482
|
+
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0, i = $(s, n.pointerType)), i && s.stopPropagation();
|
481
483
|
}, f.onMouseLeave = (s) => {
|
482
484
|
if (!s.currentTarget.contains(s.target)) return;
|
483
|
-
let
|
484
|
-
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1,
|
485
|
+
let i = !0;
|
486
|
+
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1, i = k(s, n.pointerType, !1), A(s)), i && s.stopPropagation();
|
485
487
|
}, f.onMouseUp = (s) => {
|
486
488
|
s.currentTarget.contains(s.target) && !n.ignoreEmulatedMouseEvents && s.button === 0 && O(s, n.pointerType || "mouse");
|
487
489
|
};
|
@@ -491,32 +493,32 @@ function ft(e) {
|
|
491
493
|
n.ignoreEmulatedMouseEvents = !1;
|
492
494
|
return;
|
493
495
|
}
|
494
|
-
n.target &&
|
496
|
+
n.target && M(s, n.target) && n.pointerType != null ? k(D(n.target, s), n.pointerType) : n.target && n.isOverTarget && n.pointerType != null && k(D(n.target, s), n.pointerType, !1), n.isOverTarget = !1;
|
495
497
|
}
|
496
498
|
};
|
497
499
|
f.onTouchStart = (s) => {
|
498
500
|
if (!s.currentTarget.contains(s.target)) return;
|
499
|
-
let
|
500
|
-
if (!
|
501
|
-
n.activePointerId =
|
501
|
+
let i = bt(s.nativeEvent);
|
502
|
+
if (!i) return;
|
503
|
+
n.activePointerId = i.identifier, n.ignoreEmulatedMouseEvents = !0, n.isOverTarget = !0, n.isPressed = !0, n.target = s.currentTarget, n.pointerType = "touch", !u && !m && R(s.currentTarget), b || be(n.target), $(C(n.target, s), n.pointerType) && s.stopPropagation(), B(ie(s.currentTarget), "scroll", v, !0);
|
502
504
|
}, f.onTouchMove = (s) => {
|
503
505
|
if (!s.currentTarget.contains(s.target)) return;
|
504
506
|
if (!n.isPressed) {
|
505
507
|
s.stopPropagation();
|
506
508
|
return;
|
507
509
|
}
|
508
|
-
let
|
509
|
-
|
510
|
+
let i = he(s.nativeEvent, n.activePointerId), y = !0;
|
511
|
+
i && M(i, s.currentTarget) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, y = $(C(n.target, s), n.pointerType)) : n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, y = k(C(n.target, s), n.pointerType, !1), A(C(n.target, s))), y && s.stopPropagation();
|
510
512
|
}, f.onTouchEnd = (s) => {
|
511
513
|
if (!s.currentTarget.contains(s.target)) return;
|
512
514
|
if (!n.isPressed) {
|
513
515
|
s.stopPropagation();
|
514
516
|
return;
|
515
517
|
}
|
516
|
-
let
|
517
|
-
|
518
|
+
let i = he(s.nativeEvent, n.activePointerId), y = !0;
|
519
|
+
i && M(i, s.currentTarget) && n.pointerType != null ? (O(C(n.target, s), n.pointerType), y = k(C(n.target, s), n.pointerType)) : n.isOverTarget && n.pointerType != null && (y = k(C(n.target, s), n.pointerType, !1)), y && s.stopPropagation(), n.isPressed = !1, n.activePointerId = null, n.isOverTarget = !1, n.ignoreEmulatedMouseEvents = !0, n.target && !b && Y(n.target), S();
|
518
520
|
}, f.onTouchCancel = (s) => {
|
519
|
-
s.currentTarget.contains(s.target) && (s.stopPropagation(), n.isPressed && N(s));
|
521
|
+
s.currentTarget.contains(s.target) && (s.stopPropagation(), n.isPressed && N(C(n.target, s)));
|
520
522
|
};
|
521
523
|
let v = (s) => {
|
522
524
|
n.isPressed && s.target.contains(n.target) && N({
|
@@ -533,57 +535,72 @@ function ft(e) {
|
|
533
535
|
}
|
534
536
|
return f;
|
535
537
|
}, [
|
536
|
-
|
538
|
+
B,
|
537
539
|
u,
|
538
|
-
|
540
|
+
m,
|
539
541
|
S,
|
540
|
-
|
542
|
+
b,
|
541
543
|
N,
|
542
|
-
|
543
|
-
|
544
|
-
|
544
|
+
A,
|
545
|
+
k,
|
546
|
+
$,
|
545
547
|
O
|
546
548
|
]);
|
547
|
-
return
|
549
|
+
return J(() => () => {
|
548
550
|
var n;
|
549
|
-
|
551
|
+
b || Y((n = w.current.target) !== null && n !== void 0 ? n : void 0);
|
550
552
|
}, [
|
551
|
-
|
553
|
+
b
|
552
554
|
]), {
|
553
|
-
isPressed:
|
554
|
-
pressProps:
|
555
|
+
isPressed: p || _,
|
556
|
+
pressProps: G(x, oe)
|
555
557
|
};
|
556
558
|
}
|
557
|
-
function
|
559
|
+
function pe(e) {
|
558
560
|
return e.tagName === "A" && e.hasAttribute("href");
|
559
561
|
}
|
560
|
-
function
|
561
|
-
const { key: r, code: o } = e,
|
562
|
-
return (r === "Enter" || r === " " || r === "Spacebar" || o === "Space") && !(
|
563
|
-
!((
|
562
|
+
function re(e, t) {
|
563
|
+
const { key: r, code: o } = e, a = t, d = a.getAttribute("role");
|
564
|
+
return (r === "Enter" || r === " " || r === "Spacebar" || o === "Space") && !(a instanceof ie(a).HTMLInputElement && !Ie(a, r) || a instanceof ie(a).HTMLTextAreaElement || a.isContentEditable) && // Links should only trigger with Enter key
|
565
|
+
!((d === "link" || !d && pe(a)) && r !== "Enter");
|
564
566
|
}
|
565
|
-
function
|
567
|
+
function bt(e) {
|
566
568
|
const { targetTouches: t } = e;
|
567
569
|
return t.length > 0 ? t[0] : null;
|
568
570
|
}
|
569
|
-
function
|
571
|
+
function he(e, t) {
|
570
572
|
const r = e.changedTouches;
|
571
573
|
for (let o = 0; o < r.length; o++) {
|
572
|
-
const
|
573
|
-
if (
|
574
|
+
const a = r[o];
|
575
|
+
if (a.identifier === t) return a;
|
574
576
|
}
|
575
577
|
return null;
|
576
578
|
}
|
577
579
|
function C(e, t) {
|
580
|
+
let r = 0, o = 0;
|
581
|
+
return t.targetTouches && t.targetTouches.length === 1 && (r = t.targetTouches[0].clientX, o = t.targetTouches[0].clientY), {
|
582
|
+
currentTarget: e,
|
583
|
+
shiftKey: t.shiftKey,
|
584
|
+
ctrlKey: t.ctrlKey,
|
585
|
+
metaKey: t.metaKey,
|
586
|
+
altKey: t.altKey,
|
587
|
+
clientX: r,
|
588
|
+
clientY: o
|
589
|
+
};
|
590
|
+
}
|
591
|
+
function D(e, t) {
|
592
|
+
let r = t.clientX, o = t.clientY;
|
578
593
|
return {
|
579
594
|
currentTarget: e,
|
580
595
|
shiftKey: t.shiftKey,
|
581
596
|
ctrlKey: t.ctrlKey,
|
582
597
|
metaKey: t.metaKey,
|
583
|
-
altKey: t.altKey
|
598
|
+
altKey: t.altKey,
|
599
|
+
clientX: r,
|
600
|
+
clientY: o
|
584
601
|
};
|
585
602
|
}
|
586
|
-
function
|
603
|
+
function gt(e) {
|
587
604
|
let t = 0, r = 0;
|
588
605
|
return e.width !== void 0 ? t = e.width / 2 : e.radiusX !== void 0 && (t = e.radiusX), e.height !== void 0 ? r = e.height / 2 : e.radiusY !== void 0 && (r = e.radiusY), {
|
589
606
|
top: e.clientY - r,
|
@@ -592,20 +609,20 @@ function bt(e) {
|
|
592
609
|
left: e.clientX - t
|
593
610
|
};
|
594
611
|
}
|
595
|
-
function
|
612
|
+
function vt(e, t) {
|
596
613
|
return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
|
597
614
|
}
|
598
|
-
function
|
599
|
-
let r = t.getBoundingClientRect(), o =
|
600
|
-
return
|
615
|
+
function M(e, t) {
|
616
|
+
let r = t.getBoundingClientRect(), o = gt(e);
|
617
|
+
return vt(r, o);
|
601
618
|
}
|
602
|
-
function
|
619
|
+
function se(e) {
|
603
620
|
return !(e instanceof HTMLElement) || !e.hasAttribute("draggable");
|
604
621
|
}
|
605
622
|
function ye(e, t) {
|
606
|
-
return e instanceof HTMLInputElement ? !
|
623
|
+
return e instanceof HTMLInputElement ? !Ie(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !pe(e);
|
607
624
|
}
|
608
|
-
const
|
625
|
+
const ht = /* @__PURE__ */ new Set([
|
609
626
|
"checkbox",
|
610
627
|
"radio",
|
611
628
|
"range",
|
@@ -616,143 +633,143 @@ const vt = /* @__PURE__ */ new Set([
|
|
616
633
|
"submit",
|
617
634
|
"reset"
|
618
635
|
]);
|
619
|
-
function
|
620
|
-
return e.type === "checkbox" || e.type === "radio" ? t === " " :
|
636
|
+
function Ie(e, t) {
|
637
|
+
return e.type === "checkbox" || e.type === "radio" ? t === " " : ht.has(e.type);
|
621
638
|
}
|
622
|
-
let
|
623
|
-
function
|
624
|
-
|
625
|
-
|
639
|
+
let Z = !1, ae = 0;
|
640
|
+
function ce() {
|
641
|
+
Z = !0, setTimeout(() => {
|
642
|
+
Z = !1;
|
626
643
|
}, 50);
|
627
644
|
}
|
628
|
-
function
|
629
|
-
e.pointerType === "touch" &&
|
645
|
+
function ke(e) {
|
646
|
+
e.pointerType === "touch" && ce();
|
630
647
|
}
|
631
648
|
function yt() {
|
632
649
|
if (!(typeof document > "u"))
|
633
|
-
return typeof PointerEvent < "u" ? document.addEventListener("pointerup",
|
634
|
-
|
650
|
+
return typeof PointerEvent < "u" ? document.addEventListener("pointerup", ke) : document.addEventListener("touchend", ce), ae++, () => {
|
651
|
+
ae--, !(ae > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", ke) : document.removeEventListener("touchend", ce));
|
635
652
|
};
|
636
653
|
}
|
637
|
-
function
|
638
|
-
let { onHoverStart: t, onHoverChange: r, onHoverEnd: o, isDisabled:
|
654
|
+
function kt(e) {
|
655
|
+
let { onHoverStart: t, onHoverChange: r, onHoverEnd: o, isDisabled: a } = e, [d, u] = $e(!1), p = ee({
|
639
656
|
isHovered: !1,
|
640
657
|
ignoreEmulatedMouseEvents: !1,
|
641
658
|
pointerType: "",
|
642
659
|
target: null
|
643
660
|
}).current;
|
644
|
-
|
645
|
-
let { hoverProps:
|
646
|
-
let
|
647
|
-
if (
|
648
|
-
|
649
|
-
let
|
650
|
-
|
661
|
+
J(yt, []);
|
662
|
+
let { hoverProps: m, triggerHoverEnd: g } = Ee(() => {
|
663
|
+
let b = (_, P) => {
|
664
|
+
if (p.pointerType = P, a || P === "touch" || p.isHovered || !_.currentTarget.contains(_.target)) return;
|
665
|
+
p.isHovered = !0;
|
666
|
+
let w = _.currentTarget;
|
667
|
+
p.target = w, t && t({
|
651
668
|
type: "hoverstart",
|
652
|
-
target:
|
653
|
-
pointerType:
|
669
|
+
target: w,
|
670
|
+
pointerType: P
|
654
671
|
}), r && r(!0), u(!0);
|
655
|
-
},
|
656
|
-
if (
|
657
|
-
|
658
|
-
let
|
672
|
+
}, E = (_, P) => {
|
673
|
+
if (p.pointerType = "", p.target = null, P === "touch" || !p.isHovered) return;
|
674
|
+
p.isHovered = !1;
|
675
|
+
let w = _.currentTarget;
|
659
676
|
o && o({
|
660
677
|
type: "hoverend",
|
661
|
-
target:
|
662
|
-
pointerType:
|
678
|
+
target: w,
|
679
|
+
pointerType: P
|
663
680
|
}), r && r(!1), u(!1);
|
664
681
|
}, x = {};
|
665
|
-
return typeof PointerEvent < "u" ? (x.onPointerEnter = (
|
666
|
-
|
667
|
-
}, x.onPointerLeave = (
|
668
|
-
!
|
682
|
+
return typeof PointerEvent < "u" ? (x.onPointerEnter = (_) => {
|
683
|
+
Z && _.pointerType === "mouse" || b(_, _.pointerType);
|
684
|
+
}, x.onPointerLeave = (_) => {
|
685
|
+
!a && _.currentTarget.contains(_.target) && E(_, _.pointerType);
|
669
686
|
}) : (x.onTouchStart = () => {
|
670
|
-
|
671
|
-
}, x.onMouseEnter = (
|
672
|
-
!
|
673
|
-
}, x.onMouseLeave = (
|
674
|
-
!
|
687
|
+
p.ignoreEmulatedMouseEvents = !0;
|
688
|
+
}, x.onMouseEnter = (_) => {
|
689
|
+
!p.ignoreEmulatedMouseEvents && !Z && b(_, "mouse"), p.ignoreEmulatedMouseEvents = !1;
|
690
|
+
}, x.onMouseLeave = (_) => {
|
691
|
+
!a && _.currentTarget.contains(_.target) && E(_, "mouse");
|
675
692
|
}), {
|
676
693
|
hoverProps: x,
|
677
|
-
triggerHoverEnd:
|
694
|
+
triggerHoverEnd: E
|
678
695
|
};
|
679
696
|
}, [
|
680
697
|
t,
|
681
698
|
r,
|
682
699
|
o,
|
683
|
-
|
684
|
-
|
700
|
+
a,
|
701
|
+
p
|
685
702
|
]);
|
686
|
-
return
|
687
|
-
|
688
|
-
currentTarget:
|
689
|
-
},
|
703
|
+
return J(() => {
|
704
|
+
a && g({
|
705
|
+
currentTarget: p.target
|
706
|
+
}, p.pointerType);
|
690
707
|
}, [
|
691
|
-
|
708
|
+
a
|
692
709
|
]), {
|
693
|
-
hoverProps:
|
694
|
-
isHovered:
|
710
|
+
hoverProps: m,
|
711
|
+
isHovered: d
|
695
712
|
};
|
696
713
|
}
|
697
|
-
function
|
714
|
+
function wt(e, t) {
|
698
715
|
let {
|
699
716
|
elementType: r = "button",
|
700
717
|
isDisabled: o,
|
701
|
-
onPress:
|
702
|
-
onPressStart:
|
718
|
+
onPress: a,
|
719
|
+
onPressStart: d,
|
703
720
|
onPressEnd: u,
|
704
|
-
onPressUp:
|
705
|
-
onPressChange:
|
706
|
-
preventFocusOnPress:
|
707
|
-
allowFocusWhenDisabled:
|
721
|
+
onPressUp: p,
|
722
|
+
onPressChange: m,
|
723
|
+
preventFocusOnPress: g,
|
724
|
+
allowFocusWhenDisabled: b,
|
708
725
|
// @ts-ignore
|
709
|
-
onClick:
|
726
|
+
onClick: E,
|
710
727
|
href: x,
|
711
|
-
target:
|
712
|
-
rel:
|
713
|
-
type:
|
714
|
-
} = e,
|
715
|
-
r === "button" ?
|
716
|
-
type:
|
728
|
+
target: _,
|
729
|
+
rel: P,
|
730
|
+
type: w = "button"
|
731
|
+
} = e, B;
|
732
|
+
r === "button" ? B = {
|
733
|
+
type: w,
|
717
734
|
disabled: o
|
718
|
-
} :
|
735
|
+
} : B = {
|
719
736
|
role: "button",
|
720
737
|
tabIndex: o ? void 0 : 0,
|
721
738
|
href: r === "a" && o ? void 0 : x,
|
722
|
-
target: r === "a" ?
|
723
|
-
type: r === "input" ?
|
739
|
+
target: r === "a" ? _ : void 0,
|
740
|
+
type: r === "input" ? w : void 0,
|
724
741
|
disabled: r === "input" ? o : void 0,
|
725
742
|
"aria-disabled": !o || r === "input" ? void 0 : o,
|
726
|
-
rel: r === "a" ?
|
743
|
+
rel: r === "a" ? P : void 0
|
727
744
|
};
|
728
|
-
let { pressProps: S, isPressed:
|
729
|
-
onPressStart:
|
745
|
+
let { pressProps: S, isPressed: $ } = _t({
|
746
|
+
onPressStart: d,
|
730
747
|
onPressEnd: u,
|
731
|
-
onPressChange:
|
732
|
-
onPress:
|
733
|
-
onPressUp:
|
748
|
+
onPressChange: m,
|
749
|
+
onPress: a,
|
750
|
+
onPressUp: p,
|
734
751
|
isDisabled: o,
|
735
|
-
preventFocusOnPress:
|
752
|
+
preventFocusOnPress: g,
|
736
753
|
ref: t
|
737
|
-
}), { focusableProps:
|
738
|
-
|
739
|
-
let O =
|
754
|
+
}), { focusableProps: k } = Ge(e, t);
|
755
|
+
b && (k.tabIndex = o ? -1 : k.tabIndex);
|
756
|
+
let O = G(k, S, Je(e, {
|
740
757
|
labelable: !0
|
741
758
|
}));
|
742
759
|
return {
|
743
|
-
isPressed:
|
744
|
-
buttonProps:
|
760
|
+
isPressed: $,
|
761
|
+
buttonProps: G(B, O, {
|
745
762
|
"aria-haspopup": e["aria-haspopup"],
|
746
763
|
"aria-expanded": e["aria-expanded"],
|
747
764
|
"aria-controls": e["aria-controls"],
|
748
765
|
"aria-pressed": e["aria-pressed"],
|
749
766
|
onClick: (N) => {
|
750
|
-
|
767
|
+
E && (E(N), console.warn("onClick is deprecated, please use onPress"));
|
751
768
|
}
|
752
769
|
})
|
753
770
|
};
|
754
771
|
}
|
755
|
-
function
|
772
|
+
function Tt(e, t, r) {
|
756
773
|
return t in e ? Object.defineProperty(e, t, {
|
757
774
|
value: r,
|
758
775
|
enumerable: !0,
|
@@ -760,117 +777,117 @@ function Et(e, t, r) {
|
|
760
777
|
writable: !0
|
761
778
|
}) : e[t] = r, e;
|
762
779
|
}
|
763
|
-
function
|
780
|
+
function we(e, t) {
|
764
781
|
var r = Object.keys(e);
|
765
782
|
if (Object.getOwnPropertySymbols) {
|
766
783
|
var o = Object.getOwnPropertySymbols(e);
|
767
|
-
t && (o = o.filter(function(
|
768
|
-
return Object.getOwnPropertyDescriptor(e,
|
784
|
+
t && (o = o.filter(function(a) {
|
785
|
+
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
769
786
|
})), r.push.apply(r, o);
|
770
787
|
}
|
771
788
|
return r;
|
772
789
|
}
|
773
|
-
function
|
790
|
+
function Te(e) {
|
774
791
|
for (var t = 1; t < arguments.length; t++) {
|
775
792
|
var r = arguments[t] != null ? arguments[t] : {};
|
776
|
-
t % 2 ?
|
777
|
-
|
778
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
793
|
+
t % 2 ? we(Object(r), !0).forEach(function(o) {
|
794
|
+
Tt(e, o, r[o]);
|
795
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : we(Object(r)).forEach(function(o) {
|
779
796
|
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(r, o));
|
780
797
|
});
|
781
798
|
}
|
782
799
|
return e;
|
783
800
|
}
|
784
|
-
var
|
801
|
+
var Bt = (e, t, r) => {
|
785
802
|
for (var o of Object.keys(e)) {
|
786
|
-
var
|
787
|
-
if (e[o] !== ((
|
803
|
+
var a;
|
804
|
+
if (e[o] !== ((a = t[o]) !== null && a !== void 0 ? a : r[o]))
|
788
805
|
return !1;
|
789
806
|
}
|
790
807
|
return !0;
|
791
|
-
},
|
792
|
-
var r = e.defaultClassName, o =
|
793
|
-
for (var
|
794
|
-
var
|
808
|
+
}, ne = (e) => (t) => {
|
809
|
+
var r = e.defaultClassName, o = Te(Te({}, e.defaultVariants), t);
|
810
|
+
for (var a in o) {
|
811
|
+
var d, u = (d = o[a]) !== null && d !== void 0 ? d : e.defaultVariants[a];
|
795
812
|
if (u != null) {
|
796
|
-
var
|
797
|
-
typeof
|
798
|
-
var
|
813
|
+
var p = u;
|
814
|
+
typeof p == "boolean" && (p = p === !0 ? "true" : "false");
|
815
|
+
var m = (
|
799
816
|
// @ts-expect-error
|
800
|
-
e.variantClassNames[
|
817
|
+
e.variantClassNames[a][p]
|
801
818
|
);
|
802
|
-
|
819
|
+
m && (r += " " + m);
|
803
820
|
}
|
804
821
|
}
|
805
|
-
for (var [
|
806
|
-
|
822
|
+
for (var [g, b] of e.compoundVariants)
|
823
|
+
Bt(g, o, e.defaultVariants) && (r += " " + b);
|
807
824
|
return r;
|
808
|
-
},
|
809
|
-
function
|
825
|
+
}, $t = ne({ defaultClassName: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy0", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy1", false: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy2" }, kind: { default: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy3", link: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy4", confirm: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy5", delete: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy6", key: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy7", icon: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy8" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy9", false: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyb"], [{ kind: "default", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyd"], [{ kind: "delete", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxye"], [{ kind: "key", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyf"], [{ disabled: !0, spinning: !1 }, "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyg"]] }), Et = ne({ defaultClassName: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyh", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyi", false: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyj" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyk", default: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyl", delete: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxym", key: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyn", confirm: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyo", link: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyp" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyq", false: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyr" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), Pt = "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy11", xt = ne({ defaultClassName: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy12", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy13", false: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy14" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), St = ne({ defaultClassName: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxys", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyt", false: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyu" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyv", default: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyw", delete: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyx", key: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyy", confirm: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxyz", link: "pkg_sps-woodland_buttons__version_8_18_0__hash_125pcxy10" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
|
826
|
+
function Nt({
|
810
827
|
as: e,
|
811
828
|
onClick: t,
|
812
829
|
onPress: r,
|
813
830
|
children: o,
|
814
|
-
className:
|
815
|
-
isDisabled:
|
831
|
+
className: a,
|
832
|
+
isDisabled: d,
|
816
833
|
disabled: u,
|
817
|
-
href:
|
818
|
-
icon:
|
819
|
-
kind:
|
820
|
-
spinning:
|
821
|
-
spinningTitle:
|
834
|
+
href: p,
|
835
|
+
icon: m,
|
836
|
+
kind: g = "default",
|
837
|
+
spinning: b,
|
838
|
+
spinningTitle: E,
|
822
839
|
title: x,
|
823
|
-
...
|
824
|
-
},
|
825
|
-
const
|
840
|
+
..._
|
841
|
+
}, P) {
|
842
|
+
const w = e ?? (p ? "a" : "button"), B = {
|
826
843
|
onPress: r ?? t,
|
827
844
|
// the button element should be disabled if the button is marked as disabled or spinning
|
828
|
-
isDisabled: u ??
|
829
|
-
...
|
830
|
-
}, { "data-testid": S } =
|
831
|
-
...
|
832
|
-
ref:
|
845
|
+
isDisabled: u ?? d ?? b,
|
846
|
+
..._
|
847
|
+
}, { "data-testid": S } = _, $ = P || c.useRef(null), { buttonProps: k } = wt(B, $), { hoverProps: O } = kt({ isDisabled: B.isDisabled }), { type: N, ...A } = k, oe = {
|
848
|
+
...G(A, O),
|
849
|
+
ref: $,
|
833
850
|
title: x,
|
834
|
-
className:
|
835
|
-
...
|
836
|
-
...
|
837
|
-
}, { t: n } = c.useContext(
|
838
|
-
|
851
|
+
className: p ? St({ spinning: b, kind: g }) : Et({ disabled: d || u, kind: g, spinning: b }),
|
852
|
+
...p ? { href: p } : { type: N },
|
853
|
+
..._
|
854
|
+
}, { t: n } = c.useContext(Fe), f = m && /* @__PURE__ */ c.createElement(
|
855
|
+
Re,
|
839
856
|
{
|
840
857
|
className: Pt,
|
841
|
-
icon:
|
858
|
+
icon: m,
|
842
859
|
"aria-hidden": "true",
|
843
|
-
"data-testid": `${S}__${
|
860
|
+
"data-testid": `${S}__${m}-icon`
|
844
861
|
}
|
845
862
|
);
|
846
|
-
let
|
847
|
-
|
848
|
-
const l =
|
849
|
-
|
863
|
+
let T;
|
864
|
+
g === "default" || g === "icon" || g === "link" ? T = "dark" : T = "light";
|
865
|
+
const l = b && /* @__PURE__ */ c.createElement(
|
866
|
+
Ue,
|
850
867
|
{
|
851
|
-
color:
|
852
|
-
className:
|
853
|
-
title:
|
868
|
+
color: T,
|
869
|
+
className: xt({ spinning: b }),
|
870
|
+
title: E || n("design-system:button.spinningTitle"),
|
854
871
|
"data-testid": `${S}__spinner`
|
855
872
|
}
|
856
873
|
);
|
857
|
-
return /* @__PURE__ */ c.createElement(
|
874
|
+
return /* @__PURE__ */ c.createElement(Ve, null, /* @__PURE__ */ c.createElement(
|
858
875
|
"div",
|
859
876
|
{
|
860
|
-
className:
|
861
|
-
|
862
|
-
disabled:
|
863
|
-
kind:
|
864
|
-
spinning:
|
877
|
+
className: He(
|
878
|
+
$t({
|
879
|
+
disabled: d || u,
|
880
|
+
kind: g,
|
881
|
+
spinning: b
|
865
882
|
}),
|
866
|
-
|
883
|
+
a
|
867
884
|
)
|
868
885
|
},
|
869
|
-
/* @__PURE__ */ c.createElement(
|
886
|
+
/* @__PURE__ */ c.createElement(w, { ...oe }, f, o ? /* @__PURE__ */ c.createElement("span", null, o) : "", l)
|
870
887
|
));
|
871
888
|
}
|
872
|
-
const
|
873
|
-
|
889
|
+
const Ae = c.forwardRef(Nt);
|
890
|
+
Me.set(Ae, {
|
874
891
|
name: "Button",
|
875
892
|
props: {
|
876
893
|
disabled: "boolean",
|
@@ -886,8 +903,8 @@ Ae.set(Ie, {
|
|
886
903
|
},
|
887
904
|
panellable: !0
|
888
905
|
});
|
889
|
-
const
|
890
|
-
components: [
|
906
|
+
const Ot = {
|
907
|
+
components: [Ae],
|
891
908
|
description: () => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, "Buttons are used to initiate events or actions. The labels and/or icons describe what the button will do."), /* @__PURE__ */ c.createElement("br", null), /* @__PURE__ */ c.createElement("h5", null, "Variants"), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Default: "), "For tertiary actions or actions of lower importance on a page."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Key: "), "For primary or important actions on a page."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Confirm: "), "For the main call to action on a page. There should only be one Confirm button per screen."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Delete: "), "For deleting information or another destructive action. These should always be paired with a Delete Confirmation Modal."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Disabled: "), "For actions that are not permitted in a particular state. These can be accompanied by a Tooltip on hover describing why it’s disabled."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "With an Icon: "), "For further illustrating the action. Example: Pencil icon in an Edit button. There can also be Icon Buttons without text.")),
|
892
909
|
examples: {
|
893
910
|
basic: {
|
@@ -896,7 +913,7 @@ const Nt = {
|
|
896
913
|
examples: {
|
897
914
|
withoutIcons: {
|
898
915
|
description: "Without Icons",
|
899
|
-
react:
|
916
|
+
react: h`
|
900
917
|
import { Button } from "@sps-woodland/buttons";
|
901
918
|
import { sprinkles } from "@sps-woodland/tokens";
|
902
919
|
|
@@ -915,7 +932,7 @@ const Nt = {
|
|
915
932
|
},
|
916
933
|
withIcons: {
|
917
934
|
description: "With Icons",
|
918
|
-
react:
|
935
|
+
react: h`
|
919
936
|
import { Button } from "@sps-woodland/buttons";
|
920
937
|
import { sprinkles } from "@sps-woodland/tokens";
|
921
938
|
|
@@ -934,7 +951,7 @@ const Nt = {
|
|
934
951
|
},
|
935
952
|
spinning: {
|
936
953
|
description: "Spinning",
|
937
|
-
react:
|
954
|
+
react: h`
|
938
955
|
import { Button } from "@sps-woodland/buttons";
|
939
956
|
import { sprinkles } from "@sps-woodland/tokens";
|
940
957
|
|
@@ -958,7 +975,7 @@ const Nt = {
|
|
958
975
|
examples: {
|
959
976
|
withoutIcons: {
|
960
977
|
description: "Without Icons",
|
961
|
-
react:
|
978
|
+
react: h`
|
962
979
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
963
980
|
|
964
981
|
function Component() {
|
@@ -1000,7 +1017,7 @@ const Nt = {
|
|
1000
1017
|
},
|
1001
1018
|
withIcons: {
|
1002
1019
|
description: "With Icons",
|
1003
|
-
react:
|
1020
|
+
react: h`
|
1004
1021
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1005
1022
|
|
1006
1023
|
function Component() {
|
@@ -1047,7 +1064,7 @@ const Nt = {
|
|
1047
1064
|
},
|
1048
1065
|
spinning: {
|
1049
1066
|
description: "Spinning",
|
1050
|
-
react:
|
1067
|
+
react: h`
|
1051
1068
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1052
1069
|
|
1053
1070
|
function Component() {
|
@@ -1093,7 +1110,7 @@ const Nt = {
|
|
1093
1110
|
examples: {
|
1094
1111
|
withoutIcons: {
|
1095
1112
|
description: "Without Icons",
|
1096
|
-
react:
|
1113
|
+
react: h`
|
1097
1114
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
1098
1115
|
|
1099
1116
|
function Component() {
|
@@ -1123,7 +1140,7 @@ const Nt = {
|
|
1123
1140
|
},
|
1124
1141
|
withIcons: {
|
1125
1142
|
description: "With Icons",
|
1126
|
-
react:
|
1143
|
+
react: h`
|
1127
1144
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
1128
1145
|
|
1129
1146
|
function Component() {
|
@@ -1171,7 +1188,7 @@ const Nt = {
|
|
1171
1188
|
examples: {
|
1172
1189
|
standard: {
|
1173
1190
|
description: "Standard Icon Buttons",
|
1174
|
-
react:
|
1191
|
+
react: h`
|
1175
1192
|
import { Button } from "@sps-woodland/buttons";
|
1176
1193
|
import { sprinkles } from "@sps-woodland/tokens";
|
1177
1194
|
|
@@ -1194,7 +1211,7 @@ const Nt = {
|
|
1194
1211
|
},
|
1195
1212
|
dropdown: {
|
1196
1213
|
description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("h5", null, "Dropdown Icon Buttons"), /* @__PURE__ */ c.createElement("p", null, "Use these when there are several options available for action. Example: Dropdown Icon Button in a ", /* @__PURE__ */ c.createElement(e, { to: "content-rows" }, "Content Row"), ".")),
|
1197
|
-
react:
|
1214
|
+
react: h`
|
1198
1215
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1199
1216
|
|
1200
1217
|
function Component() {
|
@@ -1212,7 +1229,7 @@ const Nt = {
|
|
1212
1229
|
},
|
1213
1230
|
spinner: {
|
1214
1231
|
description: "Spinner",
|
1215
|
-
react:
|
1232
|
+
react: h`
|
1216
1233
|
import { Button } from "@sps-woodland/buttons";
|
1217
1234
|
|
1218
1235
|
function Component() {
|
@@ -1232,7 +1249,7 @@ const Nt = {
|
|
1232
1249
|
examples: {
|
1233
1250
|
withoutIcons: {
|
1234
1251
|
description: "Without Icons",
|
1235
|
-
react:
|
1252
|
+
react: h`
|
1236
1253
|
import { Button } from "@sps-woodland/buttons";
|
1237
1254
|
import { sprinkles } from "@sps-woodland/tokens";
|
1238
1255
|
|
@@ -1249,7 +1266,7 @@ const Nt = {
|
|
1249
1266
|
},
|
1250
1267
|
withIcons: {
|
1251
1268
|
description: "With Icons",
|
1252
|
-
react:
|
1269
|
+
react: h`
|
1253
1270
|
import { Button } from "@sps-woodland/buttons";
|
1254
1271
|
import { sprinkles } from "@sps-woodland/tokens";
|
1255
1272
|
|
@@ -1266,7 +1283,7 @@ const Nt = {
|
|
1266
1283
|
},
|
1267
1284
|
spinner: {
|
1268
1285
|
description: "Spinner",
|
1269
|
-
react:
|
1286
|
+
react: h`
|
1270
1287
|
import { Button } from "@sps-woodland/buttons";
|
1271
1288
|
|
1272
1289
|
function Component() {
|
@@ -1285,7 +1302,7 @@ const Nt = {
|
|
1285
1302
|
description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement("p", null, "Use to submit a form. There can be a number of visual variations, for example a", " ", /* @__PURE__ */ c.createElement(e, { to: "modals" }, "Modal"), " uses Basic Button (Key) as its Submit Button."),
|
1286
1303
|
examples: {
|
1287
1304
|
basic: {
|
1288
|
-
react:
|
1305
|
+
react: h`
|
1289
1306
|
import { Button } from "@sps-woodland/buttons";
|
1290
1307
|
import { sprinkles } from "@sps-woodland/tokens";
|
1291
1308
|
|
@@ -1313,7 +1330,7 @@ const Nt = {
|
|
1313
1330
|
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.",
|
1314
1331
|
examples: {
|
1315
1332
|
basic: {
|
1316
|
-
react:
|
1333
|
+
react: h`
|
1317
1334
|
import { Button } from "@sps-woodland/buttons";
|
1318
1335
|
|
1319
1336
|
function Component() {
|
@@ -1335,7 +1352,7 @@ const Nt = {
|
|
1335
1352
|
examples: {
|
1336
1353
|
basic: {
|
1337
1354
|
description: "Basic Button Groups",
|
1338
|
-
react:
|
1355
|
+
react: h`
|
1339
1356
|
import { Button } from "@sps-woodland/buttons";
|
1340
1357
|
import { sprinkles } from "@sps-woodland/tokens";
|
1341
1358
|
|
@@ -1351,7 +1368,7 @@ const Nt = {
|
|
1351
1368
|
},
|
1352
1369
|
icon: {
|
1353
1370
|
description: "Icon Button Groups",
|
1354
|
-
react:
|
1371
|
+
react: h`
|
1355
1372
|
import { Button } from "@sps-woodland/buttons";
|
1356
1373
|
|
1357
1374
|
function Component() {
|
@@ -1366,7 +1383,7 @@ const Nt = {
|
|
1366
1383
|
},
|
1367
1384
|
textAndIcons: {
|
1368
1385
|
description: "Text Buttons + Icon Buttons Group",
|
1369
|
-
react:
|
1386
|
+
react: h`
|
1370
1387
|
import { Button } from "@sps-woodland/buttons";
|
1371
1388
|
import { sprinkles } from "@sps-woodland/tokens";
|
1372
1389
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1385,7 +1402,7 @@ const Nt = {
|
|
1385
1402
|
},
|
1386
1403
|
textAndBasic: {
|
1387
1404
|
description: "Text Buttons + Basic Buttons Group",
|
1388
|
-
react:
|
1405
|
+
react: h`
|
1389
1406
|
import { Button } from "@sps-woodland/buttons";
|
1390
1407
|
import { sprinkles } from "@sps-woodland/tokens";
|
1391
1408
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1405,7 +1422,7 @@ const Nt = {
|
|
1405
1422
|
},
|
1406
1423
|
iconsAndBasic: {
|
1407
1424
|
description: "Icon Buttons + Basic Buttons Group",
|
1408
|
-
react:
|
1425
|
+
react: h`
|
1409
1426
|
import { Button } from "@sps-woodland/buttons";
|
1410
1427
|
import { sprinkles } from "@sps-woodland/tokens";
|
1411
1428
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1426,7 +1443,7 @@ const Nt = {
|
|
1426
1443
|
},
|
1427
1444
|
textIconsAndBasic: {
|
1428
1445
|
description: "Text Buttons + Icon Buttons + Basic Buttons Group",
|
1429
|
-
react:
|
1446
|
+
react: h`
|
1430
1447
|
import { Button } from "@sps-woodland/buttons";
|
1431
1448
|
import { sprinkles } from "@sps-woodland/tokens";
|
1432
1449
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1450,10 +1467,10 @@ const Nt = {
|
|
1450
1467
|
}
|
1451
1468
|
}
|
1452
1469
|
}
|
1453
|
-
},
|
1454
|
-
Buttons:
|
1470
|
+
}, At = {
|
1471
|
+
Buttons: Ot
|
1455
1472
|
};
|
1456
1473
|
export {
|
1457
|
-
|
1458
|
-
|
1474
|
+
Ae as Button,
|
1475
|
+
At as MANIFEST
|
1459
1476
|
};
|