@sps-woodland/buttons 8.23.17 → 8.24.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.js +193 -186
- package/lib/index.umd.cjs +22 -22
- package/lib/style.css +1 -1
- package/package.json +5 -5
package/lib/index.js
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
import * as c from "react";
|
2
|
-
import Ee, { useRef as
|
2
|
+
import Ee, { useRef as Z, useCallback as X, useEffect as q, useState as $e, useMemo as Be, useContext as Me } from "react";
|
3
3
|
import { I18nContext as Fe, Spinner as Ue, cl as He, Metadata as Re, Icon as Ge } from "@sps-woodland/core";
|
4
4
|
import { useFocusable as Ve, FocusRing as We } from "@react-aria/focus";
|
5
|
-
import { code as
|
5
|
+
import { code as v } from "@spscommerce/utils";
|
6
6
|
const Pe = typeof document < "u" ? Ee.useLayoutEffect : () => {
|
7
7
|
};
|
8
|
-
function
|
9
|
-
const t =
|
8
|
+
function U(e) {
|
9
|
+
const t = Z(null);
|
10
10
|
return Pe(() => {
|
11
11
|
t.current = e;
|
12
12
|
}, [
|
13
13
|
e
|
14
|
-
]),
|
14
|
+
]), X((...r) => {
|
15
15
|
const o = t.current;
|
16
16
|
return o == null ? void 0 : o(...r);
|
17
17
|
}, []);
|
@@ -30,10 +30,10 @@ function xe(...e) {
|
|
30
30
|
for (let r of e) typeof r == "function" && r(...t);
|
31
31
|
};
|
32
32
|
}
|
33
|
-
const
|
33
|
+
const L = (e) => {
|
34
34
|
var t;
|
35
35
|
return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
|
36
|
-
}, ie = (e) => e && "window" in e && e.window === e ? e :
|
36
|
+
}, ie = (e) => e && "window" in e && e.window === e ? e : L(e).defaultView || window;
|
37
37
|
function Se(e) {
|
38
38
|
var t, r, o = "";
|
39
39
|
if (typeof e == "string" || typeof e == "number") o += e;
|
@@ -47,7 +47,7 @@ function je() {
|
|
47
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 R(...e) {
|
51
51
|
let t = {
|
52
52
|
...e[0]
|
53
53
|
};
|
@@ -84,7 +84,7 @@ function Qe(e, t = {}) {
|
|
84
84
|
for (const u in e) Object.prototype.hasOwnProperty.call(e, u) && (Xe.has(u) || r && ze.has(u) || o && qe.has(u) || a != null && a.has(u) || Je.test(u)) && (d[u] = e[u]);
|
85
85
|
return d;
|
86
86
|
}
|
87
|
-
function
|
87
|
+
function H(e) {
|
88
88
|
if (Ze()) e.focus({
|
89
89
|
preventScroll: !0
|
90
90
|
});
|
@@ -93,20 +93,20 @@ function R(e) {
|
|
93
93
|
e.focus(), tt(t);
|
94
94
|
}
|
95
95
|
}
|
96
|
-
let
|
96
|
+
let V = null;
|
97
97
|
function Ze() {
|
98
|
-
if (
|
99
|
-
|
98
|
+
if (V == null) {
|
99
|
+
V = !1;
|
100
100
|
try {
|
101
101
|
document.createElement("div").focus({
|
102
102
|
get preventScroll() {
|
103
|
-
return
|
103
|
+
return V = !0, !0;
|
104
104
|
}
|
105
105
|
});
|
106
106
|
} catch {
|
107
107
|
}
|
108
108
|
}
|
109
|
-
return
|
109
|
+
return V;
|
110
110
|
}
|
111
111
|
function et(e) {
|
112
112
|
let t = e.parentNode, r = [], o = document.scrollingElement || document.documentElement;
|
@@ -126,7 +126,7 @@ function tt(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 ee(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
|
}
|
@@ -134,33 +134,33 @@ 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
|
137
|
+
function I(e) {
|
138
138
|
let t = null;
|
139
139
|
return () => (t == null && (t = e()), t);
|
140
140
|
}
|
141
|
-
const
|
141
|
+
const J = I(function() {
|
142
142
|
return de(/^Mac/i);
|
143
|
-
}), nt =
|
143
|
+
}), nt = I(function() {
|
144
144
|
return de(/^iPhone/i);
|
145
|
-
}), Ne =
|
145
|
+
}), Ne = I(function() {
|
146
146
|
return de(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
147
|
-
|
148
|
-
}), De =
|
147
|
+
J() && navigator.maxTouchPoints > 1;
|
148
|
+
}), De = I(function() {
|
149
149
|
return nt() || Ne();
|
150
|
-
}), ot =
|
151
|
-
return
|
152
|
-
}), rt =
|
153
|
-
return
|
154
|
-
}), Oe =
|
155
|
-
return
|
156
|
-
}), st =
|
157
|
-
return
|
150
|
+
}), ot = I(function() {
|
151
|
+
return ee(/AppleWebKit/i) && !rt();
|
152
|
+
}), rt = I(function() {
|
153
|
+
return ee(/Chrome/i);
|
154
|
+
}), Oe = I(function() {
|
155
|
+
return ee(/Android/i);
|
156
|
+
}), st = I(function() {
|
157
|
+
return ee(/Firefox/i);
|
158
158
|
});
|
159
|
-
function
|
159
|
+
function G(e, t, r = !0) {
|
160
160
|
var o, a;
|
161
161
|
let { metaKey: d, ctrlKey: u, altKey: p, shiftKey: m } = t;
|
162
|
-
st() && (!((a = window.event) === null || a === void 0 || (o = a.type) === null || o === void 0) && o.startsWith("key")) && e.target === "_blank" && (
|
163
|
-
let
|
162
|
+
st() && (!((a = window.event) === null || a === void 0 || (o = a.type) === null || o === void 0) && o.startsWith("key")) && e.target === "_blank" && (J() ? d = !0 : u = !0);
|
163
|
+
let g = ot() && J() && !Ne() ? new KeyboardEvent("keydown", {
|
164
164
|
keyIdentifier: "Enter",
|
165
165
|
metaKey: d,
|
166
166
|
ctrlKey: u,
|
@@ -174,10 +174,10 @@ function V(e, t, r = !0) {
|
|
174
174
|
bubbles: !0,
|
175
175
|
cancelable: !0
|
176
176
|
});
|
177
|
-
|
177
|
+
G.isOpening = r, H(e), e.dispatchEvent(g), G.isOpening = !1;
|
178
178
|
}
|
179
|
-
|
180
|
-
let
|
179
|
+
G.isOpening = !1;
|
180
|
+
let M = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Set();
|
181
181
|
function me() {
|
182
182
|
if (typeof window > "u") return;
|
183
183
|
function e(o) {
|
@@ -185,14 +185,14 @@ function me() {
|
|
185
185
|
}
|
186
186
|
let t = (o) => {
|
187
187
|
if (!e(o) || !o.target) return;
|
188
|
-
let a =
|
189
|
-
a || (a = /* @__PURE__ */ new Set(),
|
188
|
+
let a = M.get(o.target);
|
189
|
+
a || (a = /* @__PURE__ */ new Set(), M.set(o.target, a), o.target.addEventListener("transitioncancel", r, {
|
190
190
|
once: !0
|
191
191
|
})), a.add(o.propertyName);
|
192
192
|
}, r = (o) => {
|
193
193
|
if (!e(o) || !o.target) return;
|
194
|
-
let a =
|
195
|
-
if (a && (a.delete(o.propertyName), a.size === 0 && (o.target.removeEventListener("transitioncancel", r),
|
194
|
+
let a = M.get(o.target);
|
195
|
+
if (a && (a.delete(o.propertyName), a.size === 0 && (o.target.removeEventListener("transitioncancel", r), M.delete(o.target)), M.size === 0)) {
|
196
196
|
for (let d of le) d();
|
197
197
|
le.clear();
|
198
198
|
}
|
@@ -202,32 +202,32 @@ function me() {
|
|
202
202
|
typeof document < "u" && (document.readyState !== "loading" ? me() : document.addEventListener("DOMContentLoaded", me));
|
203
203
|
function at(e) {
|
204
204
|
requestAnimationFrame(() => {
|
205
|
-
|
205
|
+
M.size === 0 ? e() : le.add(e);
|
206
206
|
});
|
207
207
|
}
|
208
208
|
function it() {
|
209
|
-
let e =
|
210
|
-
let m = p != null && p.once ? (...
|
211
|
-
e.current.delete(u), u(...
|
209
|
+
let e = Z(/* @__PURE__ */ new Map()), t = X((a, d, u, p) => {
|
210
|
+
let m = p != null && p.once ? (...g) => {
|
211
|
+
e.current.delete(u), u(...g);
|
212
212
|
} : u;
|
213
213
|
e.current.set(u, {
|
214
214
|
type: d,
|
215
215
|
eventTarget: a,
|
216
216
|
fn: m,
|
217
217
|
options: p
|
218
|
-
}), a.addEventListener(d,
|
219
|
-
}, []), r =
|
218
|
+
}), a.addEventListener(d, m, p);
|
219
|
+
}, []), r = X((a, d, u, p) => {
|
220
220
|
var m;
|
221
|
-
let
|
222
|
-
a.removeEventListener(d,
|
223
|
-
}, []), o =
|
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 = X(() => {
|
224
224
|
e.current.forEach((a, d) => {
|
225
225
|
r(a.eventTarget, a.type, d, a.options);
|
226
226
|
});
|
227
227
|
}, [
|
228
228
|
r
|
229
229
|
]);
|
230
|
-
return
|
230
|
+
return q(() => o, [
|
231
231
|
o
|
232
232
|
]), {
|
233
233
|
addGlobalListener: t,
|
@@ -249,30 +249,30 @@ function _e(e) {
|
|
249
249
|
function ut(e) {
|
250
250
|
return !Oe() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
|
251
251
|
}
|
252
|
-
let
|
252
|
+
let F = "default", ue = "", z = /* @__PURE__ */ new WeakMap();
|
253
253
|
function be(e) {
|
254
254
|
if (De()) {
|
255
|
-
if (
|
256
|
-
const t =
|
255
|
+
if (F === "default") {
|
256
|
+
const t = L(e);
|
257
257
|
ue = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
|
258
258
|
}
|
259
|
-
|
260
|
-
} else (e instanceof HTMLElement || e instanceof SVGElement) && (
|
259
|
+
F = "disabled";
|
260
|
+
} else (e instanceof HTMLElement || e instanceof SVGElement) && (z.set(e, e.style.userSelect), e.style.userSelect = "none");
|
261
261
|
}
|
262
|
-
function
|
262
|
+
function W(e) {
|
263
263
|
if (De()) {
|
264
|
-
if (
|
265
|
-
|
264
|
+
if (F !== "disabled") return;
|
265
|
+
F = "restoring", setTimeout(() => {
|
266
266
|
at(() => {
|
267
|
-
if (
|
268
|
-
const t =
|
269
|
-
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = ue || ""), ue = "",
|
267
|
+
if (F === "restoring") {
|
268
|
+
const t = L(e);
|
269
|
+
t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = ue || ""), ue = "", F = "default";
|
270
270
|
}
|
271
271
|
});
|
272
272
|
}, 300);
|
273
|
-
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e &&
|
274
|
-
let t =
|
275
|
-
e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"),
|
273
|
+
} else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && z.has(e)) {
|
274
|
+
let t = z.get(e);
|
275
|
+
e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), z.delete(e);
|
276
276
|
}
|
277
277
|
}
|
278
278
|
const Ce = Ee.createContext({
|
@@ -314,31 +314,31 @@ function _t(e) {
|
|
314
314
|
let t = Me(Ce);
|
315
315
|
if (t) {
|
316
316
|
let { register: r, ...o } = t;
|
317
|
-
e =
|
317
|
+
e = R(o, e), r();
|
318
318
|
}
|
319
319
|
return lt(t, e.ref), e;
|
320
320
|
}
|
321
|
-
var
|
322
|
-
class
|
321
|
+
var Y = /* @__PURE__ */ new WeakMap();
|
322
|
+
class j {
|
323
323
|
continuePropagation() {
|
324
|
-
ge(this,
|
324
|
+
ge(this, Y, !1);
|
325
325
|
}
|
326
326
|
get shouldStopPropagation() {
|
327
|
-
return dt(this,
|
327
|
+
return dt(this, Y);
|
328
328
|
}
|
329
329
|
constructor(t, r, o, a) {
|
330
|
-
ft(this,
|
330
|
+
ft(this, Y, {
|
331
331
|
writable: !0,
|
332
332
|
value: void 0
|
333
|
-
}), ge(this,
|
333
|
+
}), ge(this, Y, !0);
|
334
334
|
var d;
|
335
335
|
let u = (d = a == null ? void 0 : a.target) !== null && d !== void 0 ? d : o.currentTarget;
|
336
336
|
const p = u == null ? void 0 : u.getBoundingClientRect();
|
337
|
-
let m,
|
338
|
-
o.clientX != null && o.clientY != null && (b = o.clientX, E = o.clientY), p && (b != null && E != null ? (m = b - p.left,
|
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;
|
339
339
|
}
|
340
340
|
}
|
341
|
-
const
|
341
|
+
const he = Symbol("linkClicked");
|
342
342
|
function bt(e) {
|
343
343
|
let {
|
344
344
|
onPress: t,
|
@@ -349,12 +349,12 @@ function bt(e) {
|
|
349
349
|
isDisabled: u,
|
350
350
|
isPressed: p,
|
351
351
|
preventFocusOnPress: m,
|
352
|
-
shouldCancelOnPointerExit:
|
352
|
+
shouldCancelOnPointerExit: g,
|
353
353
|
allowTextSelectionOnPress: b,
|
354
354
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
355
355
|
ref: E,
|
356
356
|
...x
|
357
|
-
} = _t(e), [_, $] = $e(!1), w =
|
357
|
+
} = _t(e), [_, $] = $e(!1), w = Z({
|
358
358
|
isPressed: !1,
|
359
359
|
ignoreEmulatedMouseEvents: !1,
|
360
360
|
ignoreClickAfterPress: !1,
|
@@ -364,83 +364,83 @@ function bt(e) {
|
|
364
364
|
target: null,
|
365
365
|
isOverTarget: !1,
|
366
366
|
pointerType: null
|
367
|
-
}), { addGlobalListener: T, removeAllGlobalListeners: S } = it(), B =
|
367
|
+
}), { addGlobalListener: T, removeAllGlobalListeners: S } = it(), B = U((n, f) => {
|
368
368
|
let P = w.current;
|
369
369
|
if (u || P.didFirePressStart) return !1;
|
370
370
|
let l = !0;
|
371
371
|
if (P.isTriggeringEvent = !0, o) {
|
372
|
-
let h = new
|
372
|
+
let h = new j("pressstart", f, n);
|
373
373
|
o(h), l = h.shouldStopPropagation;
|
374
374
|
}
|
375
375
|
return r && r(!0), P.isTriggeringEvent = !1, P.didFirePressStart = !0, $(!0), l;
|
376
|
-
}),
|
376
|
+
}), y = U((n, f, P = !0) => {
|
377
377
|
let l = w.current;
|
378
378
|
if (!l.didFirePressStart) return !1;
|
379
379
|
l.ignoreClickAfterPress = !0, l.didFirePressStart = !1, l.isTriggeringEvent = !0;
|
380
380
|
let h = !0;
|
381
381
|
if (a) {
|
382
|
-
let s = new
|
382
|
+
let s = new j("pressend", f, n);
|
383
383
|
a(s), h = s.shouldStopPropagation;
|
384
384
|
}
|
385
385
|
if (r && r(!1), $(!1), t && P && !u) {
|
386
|
-
let s = new
|
386
|
+
let s = new j("press", f, n);
|
387
387
|
t(s), h && (h = s.shouldStopPropagation);
|
388
388
|
}
|
389
389
|
return l.isTriggeringEvent = !1, h;
|
390
|
-
}), D =
|
390
|
+
}), D = U((n, f) => {
|
391
391
|
let P = w.current;
|
392
392
|
if (u) return !1;
|
393
393
|
if (d) {
|
394
394
|
P.isTriggeringEvent = !0;
|
395
|
-
let l = new
|
395
|
+
let l = new j("pressup", f, n);
|
396
396
|
return d(l), P.isTriggeringEvent = !1, l.shouldStopPropagation;
|
397
397
|
}
|
398
398
|
return !0;
|
399
|
-
}), N =
|
399
|
+
}), N = U((n) => {
|
400
400
|
let f = w.current;
|
401
|
-
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null &&
|
402
|
-
}), A =
|
403
|
-
|
404
|
-
}),
|
401
|
+
f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && y(C(f.target, n), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, S(), b || W(f.target));
|
402
|
+
}), A = U((n) => {
|
403
|
+
g && N(n);
|
404
|
+
}), ne = Be(() => {
|
405
405
|
let n = w.current, f = {
|
406
406
|
onKeyDown(l) {
|
407
|
-
if (
|
407
|
+
if (oe(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
|
408
408
|
var h;
|
409
409
|
ye(l.target, l.key) && l.preventDefault();
|
410
410
|
let s = !0;
|
411
411
|
if (!n.isPressed && !l.repeat) {
|
412
412
|
n.target = l.currentTarget, n.isPressed = !0, s = B(l, "keyboard");
|
413
|
-
let
|
414
|
-
|
413
|
+
let i = l.currentTarget, k = (O) => {
|
414
|
+
oe(O, i) && !O.repeat && i.contains(O.target) && n.target && D(C(n.target, O), "keyboard");
|
415
415
|
};
|
416
|
-
T(
|
416
|
+
T(L(l.currentTarget), "keyup", xe(k, P), !0);
|
417
417
|
}
|
418
|
-
s && l.stopPropagation(), l.metaKey &&
|
418
|
+
s && l.stopPropagation(), l.metaKey && J() && ((h = n.metaKeyEvents) === null || h === void 0 || h.set(l.key, l.nativeEvent));
|
419
419
|
} else l.key === "Meta" && (n.metaKeyEvents = /* @__PURE__ */ new Map());
|
420
420
|
},
|
421
421
|
onClick(l) {
|
422
|
-
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 && !G.isOpening) {
|
423
423
|
let h = !0;
|
424
424
|
if (u && l.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && !n.isPressed && (n.pointerType === "virtual" || _e(l.nativeEvent))) {
|
425
|
-
!u && !m &&
|
426
|
-
let s = B(l, "virtual"),
|
427
|
-
h = s &&
|
425
|
+
!u && !m && H(l.currentTarget);
|
426
|
+
let s = B(l, "virtual"), i = D(l, "virtual"), k = y(l, "virtual");
|
427
|
+
h = s && i && k;
|
428
428
|
}
|
429
429
|
n.ignoreEmulatedMouseEvents = !1, n.ignoreClickAfterPress = !1, h && l.stopPropagation();
|
430
430
|
}
|
431
431
|
}
|
432
432
|
}, P = (l) => {
|
433
433
|
var h;
|
434
|
-
if (n.isPressed && n.target &&
|
434
|
+
if (n.isPressed && n.target && oe(l, n.target)) {
|
435
435
|
var s;
|
436
436
|
ye(l.target, l.key) && l.preventDefault();
|
437
|
-
let
|
438
|
-
|
437
|
+
let k = l.target;
|
438
|
+
y(C(n.target, l), "keyboard", n.target.contains(k)), S(), l.key !== "Enter" && pe(n.target) && n.target.contains(k) && !l[he] && (l[he] = !0, G(n.target, l, !1)), n.isPressed = !1, (s = n.metaKeyEvents) === null || s === void 0 || s.delete(l.key);
|
439
439
|
} else if (l.key === "Meta" && (!((h = n.metaKeyEvents) === null || h === void 0) && h.size)) {
|
440
|
-
var
|
441
|
-
let
|
440
|
+
var i;
|
441
|
+
let k = n.metaKeyEvents;
|
442
442
|
n.metaKeyEvents = void 0;
|
443
|
-
for (let O of
|
443
|
+
for (let O of k.values()) (i = n.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", O));
|
444
444
|
}
|
445
445
|
};
|
446
446
|
if (typeof PointerEvent < "u") {
|
@@ -451,22 +451,29 @@ function bt(e) {
|
|
451
451
|
return;
|
452
452
|
}
|
453
453
|
se(i.currentTarget) && i.preventDefault(), n.pointerType = i.pointerType;
|
454
|
-
let
|
455
|
-
|
454
|
+
let k = !0;
|
455
|
+
if (!n.isPressed) {
|
456
|
+
n.isPressed = !0, n.isOverTarget = !0, n.activePointerId = i.pointerId, n.target = i.currentTarget, !u && !m && H(i.currentTarget), b || be(n.target), k = B(i, n.pointerType);
|
457
|
+
let O = i.target;
|
458
|
+
"releasePointerCapture" in O && O.releasePointerCapture(i.pointerId), T(L(i.currentTarget), "pointerup", l, !1), T(L(i.currentTarget), "pointercancel", s, !1);
|
459
|
+
}
|
460
|
+
k && i.stopPropagation();
|
456
461
|
}, f.onMouseDown = (i) => {
|
457
462
|
i.currentTarget.contains(i.target) && i.button === 0 && (se(i.currentTarget) && i.preventDefault(), i.stopPropagation());
|
458
463
|
}, f.onPointerUp = (i) => {
|
459
|
-
!i.currentTarget.contains(i.target) || n.pointerType === "virtual" || i.button === 0 &&
|
464
|
+
!i.currentTarget.contains(i.target) || n.pointerType === "virtual" || i.button === 0 && D(i, n.pointerType || i.pointerType);
|
465
|
+
}, f.onPointerEnter = (i) => {
|
466
|
+
i.pointerId === n.activePointerId && n.target && !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, B(C(n.target, i), n.pointerType));
|
467
|
+
}, f.onPointerLeave = (i) => {
|
468
|
+
i.pointerId === n.activePointerId && n.target && n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, y(C(n.target, i), n.pointerType, !1), A(i));
|
460
469
|
};
|
461
470
|
let l = (i) => {
|
462
|
-
i.pointerId === n.activePointerId &&
|
463
|
-
}, h = (i) => {
|
464
|
-
i.pointerId === n.activePointerId && n.isPressed && i.button === 0 && n.target && (M(i, n.target) && n.pointerType != null ? k(C(n.target, i), n.pointerType) : n.isOverTarget && n.pointerType != null && k(C(n.target, i), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, S(), b || Y(n.target), "ontouchend" in n.target && i.pointerType !== "mouse" && T(n.target, "touchend", s, {
|
471
|
+
i.pointerId === n.activePointerId && n.isPressed && i.button === 0 && n.target && (n.target.contains(i.target) && n.pointerType != null ? y(C(n.target, i), n.pointerType) : n.isOverTarget && n.pointerType != null && y(C(n.target, i), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, S(), b || W(n.target), "ontouchend" in n.target && i.pointerType !== "mouse" && T(n.target, "touchend", h, {
|
465
472
|
once: !0
|
466
473
|
}));
|
474
|
+
}, h = (i) => {
|
475
|
+
Ie(i.currentTarget) && i.preventDefault();
|
467
476
|
}, s = (i) => {
|
468
|
-
Ie(i.target) && i.preventDefault();
|
469
|
-
}, g = (i) => {
|
470
477
|
N(i);
|
471
478
|
};
|
472
479
|
f.onDragStart = (i) => {
|
@@ -479,15 +486,15 @@ function bt(e) {
|
|
479
486
|
s.stopPropagation();
|
480
487
|
return;
|
481
488
|
}
|
482
|
-
n.isPressed = !0, n.isOverTarget = !0, n.target = s.currentTarget, n.pointerType = _e(s.nativeEvent) ? "virtual" : "mouse", !u && !m &&
|
489
|
+
n.isPressed = !0, n.isOverTarget = !0, n.target = s.currentTarget, n.pointerType = _e(s.nativeEvent) ? "virtual" : "mouse", !u && !m && H(s.currentTarget), B(s, n.pointerType) && s.stopPropagation(), T(L(s.currentTarget), "mouseup", l, !1);
|
483
490
|
}, f.onMouseEnter = (s) => {
|
484
491
|
if (!s.currentTarget.contains(s.target)) return;
|
485
|
-
let
|
486
|
-
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0,
|
492
|
+
let i = !0;
|
493
|
+
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0, i = B(s, n.pointerType)), i && s.stopPropagation();
|
487
494
|
}, f.onMouseLeave = (s) => {
|
488
495
|
if (!s.currentTarget.contains(s.target)) return;
|
489
|
-
let
|
490
|
-
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1,
|
496
|
+
let i = !0;
|
497
|
+
n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1, i = y(s, n.pointerType, !1), A(s)), i && s.stopPropagation();
|
491
498
|
}, f.onMouseUp = (s) => {
|
492
499
|
s.currentTarget.contains(s.target) && !n.ignoreEmulatedMouseEvents && s.button === 0 && D(s, n.pointerType || "mouse");
|
493
500
|
};
|
@@ -497,30 +504,30 @@ function bt(e) {
|
|
497
504
|
n.ignoreEmulatedMouseEvents = !1;
|
498
505
|
return;
|
499
506
|
}
|
500
|
-
n.target &&
|
507
|
+
n.target && re(s, n.target) && n.pointerType != null ? y(C(n.target, s), n.pointerType) : n.target && n.isOverTarget && n.pointerType != null && y(C(n.target, s), n.pointerType, !1), n.isOverTarget = !1;
|
501
508
|
}
|
502
509
|
};
|
503
510
|
f.onTouchStart = (s) => {
|
504
511
|
if (!s.currentTarget.contains(s.target)) return;
|
505
|
-
let
|
506
|
-
if (!
|
507
|
-
n.activePointerId =
|
512
|
+
let i = gt(s.nativeEvent);
|
513
|
+
if (!i) return;
|
514
|
+
n.activePointerId = i.identifier, n.ignoreEmulatedMouseEvents = !0, n.isOverTarget = !0, n.isPressed = !0, n.target = s.currentTarget, n.pointerType = "touch", !u && !m && H(s.currentTarget), b || be(n.target), B(K(n.target, s), n.pointerType) && s.stopPropagation(), T(ie(s.currentTarget), "scroll", h, !0);
|
508
515
|
}, f.onTouchMove = (s) => {
|
509
516
|
if (!s.currentTarget.contains(s.target)) return;
|
510
517
|
if (!n.isPressed) {
|
511
518
|
s.stopPropagation();
|
512
519
|
return;
|
513
520
|
}
|
514
|
-
let
|
515
|
-
|
521
|
+
let i = ve(s.nativeEvent, n.activePointerId), k = !0;
|
522
|
+
i && re(i, s.currentTarget) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, k = B(K(n.target, s), n.pointerType)) : n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, k = y(K(n.target, s), n.pointerType, !1), A(K(n.target, s))), k && s.stopPropagation();
|
516
523
|
}, f.onTouchEnd = (s) => {
|
517
524
|
if (!s.currentTarget.contains(s.target)) return;
|
518
525
|
if (!n.isPressed) {
|
519
526
|
s.stopPropagation();
|
520
527
|
return;
|
521
528
|
}
|
522
|
-
let
|
523
|
-
|
529
|
+
let i = ve(s.nativeEvent, n.activePointerId), k = !0;
|
530
|
+
i && re(i, s.currentTarget) && n.pointerType != null ? (D(K(n.target, s), n.pointerType), k = y(K(n.target, s), n.pointerType)) : n.isOverTarget && n.pointerType != null && (k = y(K(n.target, s), n.pointerType, !1)), k && s.stopPropagation(), n.isPressed = !1, n.activePointerId = null, n.isOverTarget = !1, n.ignoreEmulatedMouseEvents = !0, n.target && !b && W(n.target), S();
|
524
531
|
}, f.onTouchCancel = (s) => {
|
525
532
|
s.currentTarget.contains(s.target) && (s.stopPropagation(), n.isPressed && N(K(n.target, s)));
|
526
533
|
};
|
@@ -546,24 +553,24 @@ function bt(e) {
|
|
546
553
|
b,
|
547
554
|
N,
|
548
555
|
A,
|
549
|
-
|
556
|
+
y,
|
550
557
|
B,
|
551
558
|
D
|
552
559
|
]);
|
553
|
-
return
|
560
|
+
return q(() => () => {
|
554
561
|
var n;
|
555
|
-
b ||
|
562
|
+
b || W((n = w.current.target) !== null && n !== void 0 ? n : void 0);
|
556
563
|
}, [
|
557
564
|
b
|
558
565
|
]), {
|
559
566
|
isPressed: p || _,
|
560
|
-
pressProps:
|
567
|
+
pressProps: R(x, ne)
|
561
568
|
};
|
562
569
|
}
|
563
570
|
function pe(e) {
|
564
571
|
return e.tagName === "A" && e.hasAttribute("href");
|
565
572
|
}
|
566
|
-
function
|
573
|
+
function oe(e, t) {
|
567
574
|
const { key: r, code: o } = e, a = t, d = a.getAttribute("role");
|
568
575
|
return (r === "Enter" || r === " " || r === "Spacebar" || o === "Space") && !(a instanceof ie(a).HTMLInputElement && !Le(a, r) || a instanceof ie(a).HTMLTextAreaElement || a.isContentEditable) && // Links should only trigger with Enter key
|
569
576
|
!((d === "link" || !d && pe(a)) && r !== "Enter");
|
@@ -572,7 +579,7 @@ function gt(e) {
|
|
572
579
|
const { targetTouches: t } = e;
|
573
580
|
return t.length > 0 ? t[0] : null;
|
574
581
|
}
|
575
|
-
function
|
582
|
+
function ve(e, t) {
|
576
583
|
const r = e.changedTouches;
|
577
584
|
for (let o = 0; o < r.length; o++) {
|
578
585
|
const a = r[o];
|
@@ -604,7 +611,7 @@ function C(e, t) {
|
|
604
611
|
clientY: o
|
605
612
|
};
|
606
613
|
}
|
607
|
-
function
|
614
|
+
function ht(e) {
|
608
615
|
let t = 0, r = 0;
|
609
616
|
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), {
|
610
617
|
top: e.clientY - r,
|
@@ -613,12 +620,12 @@ function vt(e) {
|
|
613
620
|
left: e.clientX - t
|
614
621
|
};
|
615
622
|
}
|
616
|
-
function
|
623
|
+
function vt(e, t) {
|
617
624
|
return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
|
618
625
|
}
|
619
|
-
function
|
620
|
-
let r = t.getBoundingClientRect(), o =
|
621
|
-
return
|
626
|
+
function re(e, t) {
|
627
|
+
let r = t.getBoundingClientRect(), o = ht(e);
|
628
|
+
return vt(r, o);
|
622
629
|
}
|
623
630
|
function se(e) {
|
624
631
|
return !(e instanceof HTMLElement) || !e.hasAttribute("draggable");
|
@@ -643,10 +650,10 @@ const yt = /* @__PURE__ */ new Set([
|
|
643
650
|
function Le(e, t) {
|
644
651
|
return e.type === "checkbox" || e.type === "radio" ? t === " " : yt.has(e.type);
|
645
652
|
}
|
646
|
-
let
|
653
|
+
let Q = !1, ae = 0;
|
647
654
|
function ce() {
|
648
|
-
|
649
|
-
|
655
|
+
Q = !0, setTimeout(() => {
|
656
|
+
Q = !1;
|
650
657
|
}, 50);
|
651
658
|
}
|
652
659
|
function ke(e) {
|
@@ -659,14 +666,14 @@ function kt() {
|
|
659
666
|
};
|
660
667
|
}
|
661
668
|
function wt(e) {
|
662
|
-
let { onHoverStart: t, onHoverChange: r, onHoverEnd: o, isDisabled: a } = e, [d, u] = $e(!1), p =
|
669
|
+
let { onHoverStart: t, onHoverChange: r, onHoverEnd: o, isDisabled: a } = e, [d, u] = $e(!1), p = Z({
|
663
670
|
isHovered: !1,
|
664
671
|
ignoreEmulatedMouseEvents: !1,
|
665
672
|
pointerType: "",
|
666
673
|
target: null
|
667
674
|
}).current;
|
668
|
-
|
669
|
-
let { hoverProps: m, triggerHoverEnd:
|
675
|
+
q(kt, []);
|
676
|
+
let { hoverProps: m, triggerHoverEnd: g } = Be(() => {
|
670
677
|
let b = (_, $) => {
|
671
678
|
if (p.pointerType = $, a || $ === "touch" || p.isHovered || !_.currentTarget.contains(_.target)) return;
|
672
679
|
p.isHovered = !0;
|
@@ -687,13 +694,13 @@ function wt(e) {
|
|
687
694
|
}), r && r(!1), u(!1);
|
688
695
|
}, x = {};
|
689
696
|
return typeof PointerEvent < "u" ? (x.onPointerEnter = (_) => {
|
690
|
-
|
697
|
+
Q && _.pointerType === "mouse" || b(_, _.pointerType);
|
691
698
|
}, x.onPointerLeave = (_) => {
|
692
699
|
!a && _.currentTarget.contains(_.target) && E(_, _.pointerType);
|
693
700
|
}) : (x.onTouchStart = () => {
|
694
701
|
p.ignoreEmulatedMouseEvents = !0;
|
695
702
|
}, x.onMouseEnter = (_) => {
|
696
|
-
!p.ignoreEmulatedMouseEvents && !
|
703
|
+
!p.ignoreEmulatedMouseEvents && !Q && b(_, "mouse"), p.ignoreEmulatedMouseEvents = !1;
|
697
704
|
}, x.onMouseLeave = (_) => {
|
698
705
|
!a && _.currentTarget.contains(_.target) && E(_, "mouse");
|
699
706
|
}), {
|
@@ -707,8 +714,8 @@ function wt(e) {
|
|
707
714
|
a,
|
708
715
|
p
|
709
716
|
]);
|
710
|
-
return
|
711
|
-
a &&
|
717
|
+
return q(() => {
|
718
|
+
a && g({
|
712
719
|
currentTarget: p.target
|
713
720
|
}, p.pointerType);
|
714
721
|
}, [
|
@@ -727,7 +734,7 @@ function Tt(e, t) {
|
|
727
734
|
onPressEnd: u,
|
728
735
|
onPressUp: p,
|
729
736
|
onPressChange: m,
|
730
|
-
preventFocusOnPress:
|
737
|
+
preventFocusOnPress: g,
|
731
738
|
allowFocusWhenDisabled: b,
|
732
739
|
// @ts-ignore
|
733
740
|
onClick: E,
|
@@ -742,7 +749,7 @@ function Tt(e, t) {
|
|
742
749
|
} : T = {
|
743
750
|
role: "button",
|
744
751
|
tabIndex: o ? void 0 : 0,
|
745
|
-
href: r === "a" && o ? void 0
|
752
|
+
href: r === "a" && !o ? x : void 0,
|
746
753
|
target: r === "a" ? _ : void 0,
|
747
754
|
type: r === "input" ? w : void 0,
|
748
755
|
disabled: r === "input" ? o : void 0,
|
@@ -756,16 +763,16 @@ function Tt(e, t) {
|
|
756
763
|
onPress: a,
|
757
764
|
onPressUp: p,
|
758
765
|
isDisabled: o,
|
759
|
-
preventFocusOnPress:
|
766
|
+
preventFocusOnPress: g,
|
760
767
|
ref: t
|
761
|
-
}), { focusableProps:
|
762
|
-
b && (
|
763
|
-
let D =
|
768
|
+
}), { focusableProps: y } = Ve(e, t);
|
769
|
+
b && (y.tabIndex = o ? -1 : y.tabIndex);
|
770
|
+
let D = R(y, S, Qe(e, {
|
764
771
|
labelable: !0
|
765
772
|
}));
|
766
773
|
return {
|
767
774
|
isPressed: B,
|
768
|
-
buttonProps:
|
775
|
+
buttonProps: R(T, D, {
|
769
776
|
"aria-haspopup": e["aria-haspopup"],
|
770
777
|
"aria-expanded": e["aria-expanded"],
|
771
778
|
"aria-controls": e["aria-controls"],
|
@@ -812,7 +819,7 @@ var $t = (e, t, r) => {
|
|
812
819
|
return !1;
|
813
820
|
}
|
814
821
|
return !0;
|
815
|
-
},
|
822
|
+
}, te = (e) => (t) => {
|
816
823
|
var r = e.defaultClassName, o = Te(Te({}, e.defaultVariants), t);
|
817
824
|
for (var a in o) {
|
818
825
|
var d, u = (d = o[a]) !== null && d !== void 0 ? d : e.defaultVariants[a];
|
@@ -826,10 +833,10 @@ var $t = (e, t, r) => {
|
|
826
833
|
m && (r += " " + m);
|
827
834
|
}
|
828
835
|
}
|
829
|
-
for (var [
|
830
|
-
$t(
|
836
|
+
for (var [g, b] of e.compoundVariants)
|
837
|
+
$t(g, o, e.defaultVariants) && (r += " " + b);
|
831
838
|
return r;
|
832
|
-
}, Bt =
|
839
|
+
}, Bt = te({ defaultClassName: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy0", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy1", false: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy2" }, kind: { default: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy3", link: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy4", confirm: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy5", delete: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy6", key: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy7", icon: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy8" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy9", false: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyb"], [{ kind: "default", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyd"], [{ kind: "delete", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxye"], [{ kind: "key", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyf"], [{ disabled: !0, spinning: !1 }, "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyg"]] }), Pt = te({ defaultClassName: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyh", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyi", false: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyj" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyk", default: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyl", delete: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxym", key: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyn", confirm: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyo", link: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyp" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyq", false: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyr" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), xt = "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy11", St = te({ defaultClassName: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy12", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy13", false: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy14" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), Nt = te({ defaultClassName: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxys", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyt", false: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyu" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyv", default: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyw", delete: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyx", key: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyy", confirm: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxyz", link: "pkg_sps-woodland_buttons__version_8_24_0__hash_125pcxy10" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
|
833
840
|
const Ae = c.forwardRef(
|
834
841
|
({
|
835
842
|
as: e,
|
@@ -841,7 +848,7 @@ const Ae = c.forwardRef(
|
|
841
848
|
disabled: u,
|
842
849
|
href: p,
|
843
850
|
icon: m,
|
844
|
-
kind:
|
851
|
+
kind: g = "default",
|
845
852
|
spinning: b,
|
846
853
|
spinningTitle: E,
|
847
854
|
title: x,
|
@@ -852,14 +859,14 @@ const Ae = c.forwardRef(
|
|
852
859
|
// the button element should be disabled if the button is marked as disabled or spinning
|
853
860
|
isDisabled: u ?? d ?? b,
|
854
861
|
..._
|
855
|
-
}, { "data-testid": S } = _, B = c.useRef(null),
|
862
|
+
}, { "data-testid": S } = _, B = c.useRef(null), y = $ || B, { buttonProps: D } = Tt(
|
856
863
|
T,
|
857
|
-
|
858
|
-
), { hoverProps: N } = wt({ isDisabled: T.isDisabled }), { type: A, ...
|
859
|
-
...
|
860
|
-
ref:
|
864
|
+
y
|
865
|
+
), { hoverProps: N } = wt({ isDisabled: T.isDisabled }), { type: A, ...ne } = D, n = {
|
866
|
+
...R(ne, N),
|
867
|
+
ref: y,
|
861
868
|
title: x,
|
862
|
-
className: p ? Nt({ spinning: b, kind:
|
869
|
+
className: p ? Nt({ spinning: b, kind: g }) : Pt({ disabled: d || u, kind: g, spinning: b }),
|
863
870
|
...p ? { href: p } : { type: A },
|
864
871
|
..._
|
865
872
|
}, { t: f } = c.useContext(Fe), P = m && /* @__PURE__ */ c.createElement(
|
@@ -872,7 +879,7 @@ const Ae = c.forwardRef(
|
|
872
879
|
}
|
873
880
|
);
|
874
881
|
let l;
|
875
|
-
|
882
|
+
g === "default" || g === "icon" || g === "link" ? l = "dark" : l = "light";
|
876
883
|
const h = b && /* @__PURE__ */ c.createElement(
|
877
884
|
Ue,
|
878
885
|
{
|
@@ -888,7 +895,7 @@ const Ae = c.forwardRef(
|
|
888
895
|
className: He(
|
889
896
|
Bt({
|
890
897
|
disabled: d || u,
|
891
|
-
kind:
|
898
|
+
kind: g,
|
892
899
|
spinning: b
|
893
900
|
}),
|
894
901
|
a
|
@@ -931,7 +938,7 @@ const Dt = {
|
|
931
938
|
examples: {
|
932
939
|
withoutIcons: {
|
933
940
|
description: "Without Icons",
|
934
|
-
react:
|
941
|
+
react: v`
|
935
942
|
import { Button } from "@sps-woodland/buttons";
|
936
943
|
import { sprinkles } from "@sps-woodland/tokens";
|
937
944
|
|
@@ -950,7 +957,7 @@ const Dt = {
|
|
950
957
|
},
|
951
958
|
withIcons: {
|
952
959
|
description: "With Icons",
|
953
|
-
react:
|
960
|
+
react: v`
|
954
961
|
import { Button } from "@sps-woodland/buttons";
|
955
962
|
import { sprinkles } from "@sps-woodland/tokens";
|
956
963
|
|
@@ -969,7 +976,7 @@ const Dt = {
|
|
969
976
|
},
|
970
977
|
spinning: {
|
971
978
|
description: "Spinning",
|
972
|
-
react:
|
979
|
+
react: v`
|
973
980
|
import { Button } from "@sps-woodland/buttons";
|
974
981
|
import { sprinkles } from "@sps-woodland/tokens";
|
975
982
|
|
@@ -993,7 +1000,7 @@ const Dt = {
|
|
993
1000
|
examples: {
|
994
1001
|
withoutIcons: {
|
995
1002
|
description: "Without Icons",
|
996
|
-
react:
|
1003
|
+
react: v`
|
997
1004
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
998
1005
|
|
999
1006
|
function Component() {
|
@@ -1035,7 +1042,7 @@ const Dt = {
|
|
1035
1042
|
},
|
1036
1043
|
withIcons: {
|
1037
1044
|
description: "With Icons",
|
1038
|
-
react:
|
1045
|
+
react: v`
|
1039
1046
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1040
1047
|
|
1041
1048
|
function Component() {
|
@@ -1082,7 +1089,7 @@ const Dt = {
|
|
1082
1089
|
},
|
1083
1090
|
spinning: {
|
1084
1091
|
description: "Spinning",
|
1085
|
-
react:
|
1092
|
+
react: v`
|
1086
1093
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1087
1094
|
|
1088
1095
|
function Component() {
|
@@ -1128,7 +1135,7 @@ const Dt = {
|
|
1128
1135
|
examples: {
|
1129
1136
|
withoutIcons: {
|
1130
1137
|
description: "Without Icons",
|
1131
|
-
react:
|
1138
|
+
react: v`
|
1132
1139
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
1133
1140
|
|
1134
1141
|
function Component() {
|
@@ -1158,7 +1165,7 @@ const Dt = {
|
|
1158
1165
|
},
|
1159
1166
|
withIcons: {
|
1160
1167
|
description: "With Icons",
|
1161
|
-
react:
|
1168
|
+
react: v`
|
1162
1169
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
1163
1170
|
|
1164
1171
|
function Component() {
|
@@ -1206,7 +1213,7 @@ const Dt = {
|
|
1206
1213
|
examples: {
|
1207
1214
|
standard: {
|
1208
1215
|
description: "Standard Icon Buttons",
|
1209
|
-
react:
|
1216
|
+
react: v`
|
1210
1217
|
import { Button } from "@sps-woodland/buttons";
|
1211
1218
|
import { sprinkles } from "@sps-woodland/tokens";
|
1212
1219
|
|
@@ -1229,7 +1236,7 @@ const Dt = {
|
|
1229
1236
|
},
|
1230
1237
|
dropdown: {
|
1231
1238
|
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"), ".")),
|
1232
|
-
react:
|
1239
|
+
react: v`
|
1233
1240
|
import { SpsDropdown } from "@spscommerce/ds-react";
|
1234
1241
|
|
1235
1242
|
function Component() {
|
@@ -1247,7 +1254,7 @@ const Dt = {
|
|
1247
1254
|
},
|
1248
1255
|
spinner: {
|
1249
1256
|
description: "Spinner",
|
1250
|
-
react:
|
1257
|
+
react: v`
|
1251
1258
|
import { Button } from "@sps-woodland/buttons";
|
1252
1259
|
|
1253
1260
|
function Component() {
|
@@ -1267,7 +1274,7 @@ const Dt = {
|
|
1267
1274
|
examples: {
|
1268
1275
|
withoutIcons: {
|
1269
1276
|
description: "Without Icons",
|
1270
|
-
react:
|
1277
|
+
react: v`
|
1271
1278
|
import { Button } from "@sps-woodland/buttons";
|
1272
1279
|
import { sprinkles } from "@sps-woodland/tokens";
|
1273
1280
|
|
@@ -1284,7 +1291,7 @@ const Dt = {
|
|
1284
1291
|
},
|
1285
1292
|
withIcons: {
|
1286
1293
|
description: "With Icons",
|
1287
|
-
react:
|
1294
|
+
react: v`
|
1288
1295
|
import { Button } from "@sps-woodland/buttons";
|
1289
1296
|
import { sprinkles } from "@sps-woodland/tokens";
|
1290
1297
|
|
@@ -1301,7 +1308,7 @@ const Dt = {
|
|
1301
1308
|
},
|
1302
1309
|
spinner: {
|
1303
1310
|
description: "Spinner",
|
1304
|
-
react:
|
1311
|
+
react: v`
|
1305
1312
|
import { Button } from "@sps-woodland/buttons";
|
1306
1313
|
|
1307
1314
|
function Component() {
|
@@ -1320,7 +1327,7 @@ const Dt = {
|
|
1320
1327
|
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."),
|
1321
1328
|
examples: {
|
1322
1329
|
basic: {
|
1323
|
-
react:
|
1330
|
+
react: v`
|
1324
1331
|
import { Button } from "@sps-woodland/buttons";
|
1325
1332
|
import { sprinkles } from "@sps-woodland/tokens";
|
1326
1333
|
|
@@ -1348,7 +1355,7 @@ const Dt = {
|
|
1348
1355
|
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.",
|
1349
1356
|
examples: {
|
1350
1357
|
basic: {
|
1351
|
-
react:
|
1358
|
+
react: v`
|
1352
1359
|
import { Button } from "@sps-woodland/buttons";
|
1353
1360
|
|
1354
1361
|
function Component() {
|
@@ -1370,7 +1377,7 @@ const Dt = {
|
|
1370
1377
|
examples: {
|
1371
1378
|
basic: {
|
1372
1379
|
description: "Basic Button Groups",
|
1373
|
-
react:
|
1380
|
+
react: v`
|
1374
1381
|
import { Button } from "@sps-woodland/buttons";
|
1375
1382
|
import { sprinkles } from "@sps-woodland/tokens";
|
1376
1383
|
|
@@ -1386,7 +1393,7 @@ const Dt = {
|
|
1386
1393
|
},
|
1387
1394
|
icon: {
|
1388
1395
|
description: "Icon Button Groups",
|
1389
|
-
react:
|
1396
|
+
react: v`
|
1390
1397
|
import { Button } from "@sps-woodland/buttons";
|
1391
1398
|
|
1392
1399
|
function Component() {
|
@@ -1401,7 +1408,7 @@ const Dt = {
|
|
1401
1408
|
},
|
1402
1409
|
textAndIcons: {
|
1403
1410
|
description: "Text Buttons + Icon Buttons Group",
|
1404
|
-
react:
|
1411
|
+
react: v`
|
1405
1412
|
import { Button } from "@sps-woodland/buttons";
|
1406
1413
|
import { sprinkles } from "@sps-woodland/tokens";
|
1407
1414
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1420,7 +1427,7 @@ const Dt = {
|
|
1420
1427
|
},
|
1421
1428
|
textAndBasic: {
|
1422
1429
|
description: "Text Buttons + Basic Buttons Group",
|
1423
|
-
react:
|
1430
|
+
react: v`
|
1424
1431
|
import { Button } from "@sps-woodland/buttons";
|
1425
1432
|
import { sprinkles } from "@sps-woodland/tokens";
|
1426
1433
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1440,7 +1447,7 @@ const Dt = {
|
|
1440
1447
|
},
|
1441
1448
|
iconsAndBasic: {
|
1442
1449
|
description: "Icon Buttons + Basic Buttons Group",
|
1443
|
-
react:
|
1450
|
+
react: v`
|
1444
1451
|
import { Button } from "@sps-woodland/buttons";
|
1445
1452
|
import { sprinkles } from "@sps-woodland/tokens";
|
1446
1453
|
import { VericalRule } from "@sps-woodland/core";
|
@@ -1461,7 +1468,7 @@ const Dt = {
|
|
1461
1468
|
},
|
1462
1469
|
textIconsAndBasic: {
|
1463
1470
|
description: "Text Buttons + Icon Buttons + Basic Buttons Group",
|
1464
|
-
react:
|
1471
|
+
react: v`
|
1465
1472
|
import { Button } from "@sps-woodland/buttons";
|
1466
1473
|
import { sprinkles } from "@sps-woodland/tokens";
|
1467
1474
|
import { VericalRule } from "@sps-woodland/core";
|