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