@sps-woodland/buttons 8.53.2 → 8.53.4
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 +46 -46
- package/lib/index.umd.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as f from "react";
|
|
2
|
-
import _e, { useRef as Z, useCallback as
|
|
3
|
-
import { Spinner as
|
|
2
|
+
import _e, { useRef as Z, useCallback as B, useEffect as z, useState as fe, useMemo as at, useContext as lt } from "react";
|
|
3
|
+
import { Spinner as xt, cl as St, Metadata as Lt, Icon as Re } from "@sps-woodland/core";
|
|
4
4
|
import { flushSync as Nt } from "react-dom";
|
|
5
5
|
import { FocusRing as Dt } from "@react-aria/focus";
|
|
6
6
|
import { useWoodlandLanguage as Ct } from "@spscommerce/i18n";
|
|
7
7
|
import { code as E } from "@spscommerce/utils";
|
|
8
8
|
const oe = typeof document < "u" ? _e.useLayoutEffect : () => {
|
|
9
9
|
};
|
|
10
|
-
let
|
|
10
|
+
let xe = /* @__PURE__ */ new Map();
|
|
11
11
|
typeof FinalizationRegistry < "u" && new FinalizationRegistry((e) => {
|
|
12
|
-
|
|
12
|
+
xe.delete(e);
|
|
13
13
|
});
|
|
14
14
|
function At(e, t) {
|
|
15
15
|
if (e === t) return e;
|
|
16
|
-
let n =
|
|
16
|
+
let n = xe.get(e);
|
|
17
17
|
if (n)
|
|
18
18
|
return n.forEach((i) => i.current = t), t;
|
|
19
|
-
let r =
|
|
19
|
+
let r = xe.get(t);
|
|
20
20
|
return r ? (r.forEach((i) => i.current = e), e) : t;
|
|
21
21
|
}
|
|
22
22
|
function ut(...e) {
|
|
@@ -308,7 +308,7 @@ function ft(e) {
|
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
function mt() {
|
|
311
|
-
let e = Z(/* @__PURE__ */ new Map()), t =
|
|
311
|
+
let e = Z(/* @__PURE__ */ new Map()), t = B((i, l, u, a) => {
|
|
312
312
|
let c = a?.once ? (...v) => {
|
|
313
313
|
e.current.delete(u), u(...v);
|
|
314
314
|
} : u;
|
|
@@ -318,11 +318,11 @@ function mt() {
|
|
|
318
318
|
fn: c,
|
|
319
319
|
options: a
|
|
320
320
|
}), i.addEventListener(l, c, a);
|
|
321
|
-
}, []), n =
|
|
321
|
+
}, []), n = B((i, l, u, a) => {
|
|
322
322
|
var c;
|
|
323
323
|
let v = ((c = e.current.get(u)) === null || c === void 0 ? void 0 : c.fn) || u;
|
|
324
324
|
i.removeEventListener(l, v, a), e.current.delete(u);
|
|
325
|
-
}, []), r =
|
|
325
|
+
}, []), r = B(() => {
|
|
326
326
|
e.current.forEach((i, l) => {
|
|
327
327
|
n(i.eventTarget, i.type, l, i.options);
|
|
328
328
|
});
|
|
@@ -345,7 +345,7 @@ function ue(e) {
|
|
|
345
345
|
t.current = e;
|
|
346
346
|
}, [
|
|
347
347
|
e
|
|
348
|
-
]),
|
|
348
|
+
]), B((...n) => {
|
|
349
349
|
const r = t.current;
|
|
350
350
|
return r?.(...n);
|
|
351
351
|
}, []);
|
|
@@ -435,7 +435,7 @@ function dn(e) {
|
|
|
435
435
|
return () => {
|
|
436
436
|
n.observer && (n.observer.disconnect(), n.observer = null);
|
|
437
437
|
};
|
|
438
|
-
}, []),
|
|
438
|
+
}, []), B((n) => {
|
|
439
439
|
let r = b(n);
|
|
440
440
|
if (r instanceof HTMLButtonElement || r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement) {
|
|
441
441
|
t.current.isFocused = !0;
|
|
@@ -596,7 +596,7 @@ function _n(e) {
|
|
|
596
596
|
isOverTarget: !1,
|
|
597
597
|
pointerType: null,
|
|
598
598
|
disposables: []
|
|
599
|
-
}), { addGlobalListener: w, removeAllGlobalListeners: T, removeGlobalListener: O } = mt(),
|
|
599
|
+
}), { addGlobalListener: w, removeAllGlobalListeners: T, removeGlobalListener: O } = mt(), x = B((o, d) => {
|
|
600
600
|
let s = $.current;
|
|
601
601
|
if (a || s.didFirePressStart) return !1;
|
|
602
602
|
let p = !0;
|
|
@@ -609,7 +609,7 @@ function _n(e) {
|
|
|
609
609
|
a,
|
|
610
610
|
r,
|
|
611
611
|
n
|
|
612
|
-
]), S =
|
|
612
|
+
]), S = B((o, d, s = !0) => {
|
|
613
613
|
let p = $.current;
|
|
614
614
|
if (!p.didFirePressStart) return !1;
|
|
615
615
|
p.didFirePressStart = !1, p.isTriggeringEvent = !0;
|
|
@@ -628,7 +628,7 @@ function _n(e) {
|
|
|
628
628
|
i,
|
|
629
629
|
n,
|
|
630
630
|
t
|
|
631
|
-
]), $e = ue(S), I =
|
|
631
|
+
]), $e = ue(S), I = B((o, d) => {
|
|
632
632
|
let s = $.current;
|
|
633
633
|
if (a) return !1;
|
|
634
634
|
if (l) {
|
|
@@ -640,7 +640,7 @@ function _n(e) {
|
|
|
640
640
|
}, [
|
|
641
641
|
a,
|
|
642
642
|
l
|
|
643
|
-
]), Ee = ue(I), A =
|
|
643
|
+
]), Ee = ue(I), A = B((o) => {
|
|
644
644
|
let d = $.current;
|
|
645
645
|
if (d.isPressed && d.target) {
|
|
646
646
|
d.didFirePressStart && d.pointerType != null && S(G(d.target, o), d.pointerType, !1), d.isPressed = !1, te(null), d.isOverTarget = !1, d.activePointerId = null, d.pointerType = null, T(), k || Oe(d.target);
|
|
@@ -651,17 +651,17 @@ function _n(e) {
|
|
|
651
651
|
k,
|
|
652
652
|
T,
|
|
653
653
|
S
|
|
654
|
-
]), R = ue(A), F =
|
|
654
|
+
]), R = ue(A), F = B((o) => {
|
|
655
655
|
g && A(o);
|
|
656
656
|
}, [
|
|
657
657
|
g,
|
|
658
658
|
A
|
|
659
|
-
]), ee =
|
|
659
|
+
]), ee = B((o) => {
|
|
660
660
|
a || u?.(o);
|
|
661
661
|
}, [
|
|
662
662
|
a,
|
|
663
663
|
u
|
|
664
|
-
]), ke =
|
|
664
|
+
]), ke = B((o, d) => {
|
|
665
665
|
if (!a && u) {
|
|
666
666
|
let s = new MouseEvent("click", o);
|
|
667
667
|
cn(s, d), u(_t(s));
|
|
@@ -675,7 +675,7 @@ function _n(e) {
|
|
|
675
675
|
if (Ve) {
|
|
676
676
|
let d = (_) => {
|
|
677
677
|
var H;
|
|
678
|
-
if (o.isPressed && o.target &&
|
|
678
|
+
if (o.isPressed && o.target && Be(_, o.target)) {
|
|
679
679
|
var we;
|
|
680
680
|
et(b(_), _.key) && _.preventDefault();
|
|
681
681
|
let ie = b(_), ae = y(o.target, ie);
|
|
@@ -687,7 +687,7 @@ function _n(e) {
|
|
|
687
687
|
for (let ae of ie.values()) (Pe = o.target) === null || Pe === void 0 || Pe.dispatchEvent(new KeyboardEvent("keyup", ae));
|
|
688
688
|
}
|
|
689
689
|
}, s = o.target, m = ut((_) => {
|
|
690
|
-
s &&
|
|
690
|
+
s && Be(_, s) && !_.repeat && y(s, b(_)) && o.target && Ee(G(o.target, _), "keyboard");
|
|
691
691
|
}, d);
|
|
692
692
|
return w(P(o.target), "keyup", m, !0), () => {
|
|
693
693
|
O(P(o.target), "keyup", m, !0);
|
|
@@ -751,21 +751,21 @@ function _n(e) {
|
|
|
751
751
|
w,
|
|
752
752
|
O
|
|
753
753
|
]);
|
|
754
|
-
let
|
|
754
|
+
let Bt = at(() => {
|
|
755
755
|
let o = $.current, d = {
|
|
756
756
|
onKeyDown(s) {
|
|
757
|
-
if (
|
|
757
|
+
if (Be(s.nativeEvent, s.currentTarget) && y(s.currentTarget, b(s))) {
|
|
758
758
|
var p;
|
|
759
759
|
et(b(s), s.key) && s.preventDefault();
|
|
760
760
|
let m = !0;
|
|
761
|
-
!o.isPressed && !s.repeat && (o.target = s.currentTarget, o.isPressed = !0, Ue(!0), o.pointerType = "keyboard", m =
|
|
761
|
+
!o.isPressed && !s.repeat && (o.target = s.currentTarget, o.isPressed = !0, Ue(!0), o.pointerType = "keyboard", m = x(s, "keyboard")), m && s.stopPropagation(), s.metaKey && Q() && ((p = o.metaKeyEvents) === null || p === void 0 || p.set(s.key, s.nativeEvent));
|
|
762
762
|
} else s.key === "Meta" && (o.metaKeyEvents = /* @__PURE__ */ new Map());
|
|
763
763
|
},
|
|
764
764
|
onClick(s) {
|
|
765
765
|
if (!(s && !y(s.currentTarget, b(s))) && s && s.button === 0 && !o.isTriggeringEvent && !W.isOpening) {
|
|
766
766
|
let p = !0;
|
|
767
767
|
if (a && s.preventDefault(), !o.ignoreEmulatedMouseEvents && !o.isPressed && (o.pointerType === "virtual" || Le(s.nativeEvent))) {
|
|
768
|
-
let m =
|
|
768
|
+
let m = x(s, "virtual"), _ = I(s, "virtual"), H = S(s, "virtual");
|
|
769
769
|
ee(s), p = m && _ && H;
|
|
770
770
|
} else if (o.isPressed && o.pointerType !== "keyboard") {
|
|
771
771
|
let m = o.pointerType || s.nativeEvent.pointerType || "virtual", _ = I(G(s.currentTarget, s), m), H = S(G(s.currentTarget, s), m, !0);
|
|
@@ -784,7 +784,7 @@ function _n(e) {
|
|
|
784
784
|
o.pointerType = s.pointerType;
|
|
785
785
|
let p = !0;
|
|
786
786
|
if (!o.isPressed) {
|
|
787
|
-
o.isPressed = !0, te("pointer"), o.isOverTarget = !0, o.activePointerId = s.pointerId, o.target = s.currentTarget, k || Ye(o.target), p =
|
|
787
|
+
o.isPressed = !0, te("pointer"), o.isOverTarget = !0, o.activePointerId = s.pointerId, o.target = s.currentTarget, k || Ye(o.target), p = x(s, o.pointerType);
|
|
788
788
|
let m = b(s);
|
|
789
789
|
"releasePointerCapture" in m && ("hasPointerCapture" in m ? m.hasPointerCapture(s.pointerId) && m.releasePointerCapture(s.pointerId) : m.releasePointerCapture(s.pointerId));
|
|
790
790
|
}
|
|
@@ -800,7 +800,7 @@ function _n(e) {
|
|
|
800
800
|
}, d.onPointerUp = (s) => {
|
|
801
801
|
!y(s.currentTarget, b(s)) || o.pointerType === "virtual" || s.button === 0 && !o.isPressed && I(s, o.pointerType || s.pointerType);
|
|
802
802
|
}, d.onPointerEnter = (s) => {
|
|
803
|
-
s.pointerId === o.activePointerId && o.target && !o.isOverTarget && o.pointerType != null && (o.isOverTarget = !0,
|
|
803
|
+
s.pointerId === o.activePointerId && o.target && !o.isOverTarget && o.pointerType != null && (o.isOverTarget = !0, x(G(o.target, s), o.pointerType));
|
|
804
804
|
}, d.onPointerLeave = (s) => {
|
|
805
805
|
s.pointerId === o.activePointerId && o.target && o.isOverTarget && o.pointerType != null && (o.isOverTarget = !1, S(G(o.target, s), o.pointerType, !1), F(s));
|
|
806
806
|
}, d.onDragStart = (s) => {
|
|
@@ -811,14 +811,14 @@ function _n(e) {
|
|
|
811
811
|
s.stopPropagation();
|
|
812
812
|
return;
|
|
813
813
|
}
|
|
814
|
-
if (o.isPressed = !0, te("mouse"), o.isOverTarget = !0, o.target = s.currentTarget, o.pointerType = Le(s.nativeEvent) ? "virtual" : "mouse", Nt(() =>
|
|
814
|
+
if (o.isPressed = !0, te("mouse"), o.isOverTarget = !0, o.target = s.currentTarget, o.pointerType = Le(s.nativeEvent) ? "virtual" : "mouse", Nt(() => x(s, o.pointerType)) && s.stopPropagation(), v) {
|
|
815
815
|
let m = We(s.target);
|
|
816
816
|
m && o.disposables.push(m);
|
|
817
817
|
}
|
|
818
818
|
}, d.onMouseEnter = (s) => {
|
|
819
819
|
if (!y(s.currentTarget, b(s))) return;
|
|
820
820
|
let p = !0;
|
|
821
|
-
o.isPressed && !o.ignoreEmulatedMouseEvents && o.pointerType != null && (o.isOverTarget = !0, p =
|
|
821
|
+
o.isPressed && !o.ignoreEmulatedMouseEvents && o.pointerType != null && (o.isOverTarget = !0, p = x(s, o.pointerType)), p && s.stopPropagation();
|
|
822
822
|
}, d.onMouseLeave = (s) => {
|
|
823
823
|
if (!y(s.currentTarget, b(s))) return;
|
|
824
824
|
let p = !0;
|
|
@@ -829,7 +829,7 @@ function _n(e) {
|
|
|
829
829
|
if (!y(s.currentTarget, b(s))) return;
|
|
830
830
|
let p = hn(s.nativeEvent);
|
|
831
831
|
if (!p) return;
|
|
832
|
-
o.activePointerId = p.identifier, o.ignoreEmulatedMouseEvents = !0, o.isOverTarget = !0, o.isPressed = !0, te("touch"), o.target = s.currentTarget, o.pointerType = "touch", k || Ye(o.target),
|
|
832
|
+
o.activePointerId = p.identifier, o.ignoreEmulatedMouseEvents = !0, o.isOverTarget = !0, o.isPressed = !0, te("touch"), o.target = s.currentTarget, o.pointerType = "touch", k || Ye(o.target), x(V(o.target, s), o.pointerType) && s.stopPropagation();
|
|
833
833
|
}, d.onTouchMove = (s) => {
|
|
834
834
|
if (!y(s.currentTarget, b(s))) return;
|
|
835
835
|
if (!o.isPressed) {
|
|
@@ -837,7 +837,7 @@ function _n(e) {
|
|
|
837
837
|
return;
|
|
838
838
|
}
|
|
839
839
|
let p = Qe(s.nativeEvent, o.activePointerId), m = !0;
|
|
840
|
-
p && Ze(p, s.currentTarget) ? !o.isOverTarget && o.pointerType != null && (o.isOverTarget = !0, m =
|
|
840
|
+
p && Ze(p, s.currentTarget) ? !o.isOverTarget && o.pointerType != null && (o.isOverTarget = !0, m = x(V(o.target, s), o.pointerType)) : o.isOverTarget && o.pointerType != null && (o.isOverTarget = !1, m = S(V(o.target, s), o.pointerType, !1), F(V(o.target, s))), m && s.stopPropagation();
|
|
841
841
|
}, d.onTouchEnd = (s) => {
|
|
842
842
|
if (!y(s.currentTarget, b(s))) return;
|
|
843
843
|
if (!o.isPressed) {
|
|
@@ -859,7 +859,7 @@ function _n(e) {
|
|
|
859
859
|
A,
|
|
860
860
|
F,
|
|
861
861
|
S,
|
|
862
|
-
|
|
862
|
+
x,
|
|
863
863
|
I,
|
|
864
864
|
ee,
|
|
865
865
|
ke
|
|
@@ -890,7 +890,7 @@ function _n(e) {
|
|
|
890
890
|
k
|
|
891
891
|
]), {
|
|
892
892
|
isPressed: c || N,
|
|
893
|
-
pressProps: j(L,
|
|
893
|
+
pressProps: j(L, Bt, {
|
|
894
894
|
[Je]: !0
|
|
895
895
|
})
|
|
896
896
|
};
|
|
@@ -898,7 +898,7 @@ function _n(e) {
|
|
|
898
898
|
function Ke(e) {
|
|
899
899
|
return e.tagName === "A" && e.hasAttribute("href");
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function Be(e, t) {
|
|
902
902
|
const { key: n, code: r } = e, i = t, l = i.getAttribute("role");
|
|
903
903
|
return (n === "Enter" || n === " " || n === "Spacebar" || r === "Space") && !(i instanceof M(i).HTMLInputElement && !$t(i, n) || i instanceof M(i).HTMLTextAreaElement || i.isContentEditable) && // Links should only trigger with Enter key
|
|
904
904
|
!((l === "link" || !l && Ke(i)) && n !== "Enter");
|
|
@@ -1029,7 +1029,7 @@ typeof document < "u" && Tn();
|
|
|
1029
1029
|
function On() {
|
|
1030
1030
|
return re;
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1032
|
+
function Bn(e) {
|
|
1033
1033
|
if (!e.isConnected) return;
|
|
1034
1034
|
const t = P(e);
|
|
1035
1035
|
if (On() === "virtual") {
|
|
@@ -1040,15 +1040,15 @@ function xn(e) {
|
|
|
1040
1040
|
});
|
|
1041
1041
|
} else J(e);
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function xn(e) {
|
|
1044
1044
|
let { isDisabled: t, onFocus: n, onBlur: r, onFocusChange: i } = e;
|
|
1045
|
-
const l =
|
|
1045
|
+
const l = B((c) => {
|
|
1046
1046
|
if (b(c) === c.currentTarget)
|
|
1047
1047
|
return r && r(c), i && i(!1), !0;
|
|
1048
1048
|
}, [
|
|
1049
1049
|
r,
|
|
1050
1050
|
i
|
|
1051
|
-
]), u = dn(l), a =
|
|
1051
|
+
]), u = dn(l), a = B((c) => {
|
|
1052
1052
|
let v = b(c);
|
|
1053
1053
|
const g = P(v), k = g ? q(g) : q();
|
|
1054
1054
|
v === c.currentTarget && v === k && (n && n(c), i && i(!0), u(c));
|
|
@@ -1105,9 +1105,9 @@ function Nn(e) {
|
|
|
1105
1105
|
return r;
|
|
1106
1106
|
}
|
|
1107
1107
|
function Dn(e, t) {
|
|
1108
|
-
let { focusProps: n } =
|
|
1108
|
+
let { focusProps: n } = xn(e), { keyboardProps: r } = Sn(e), i = j(n, r), l = Nn(t), u = e.isDisabled ? {} : l, a = Z(e.autoFocus);
|
|
1109
1109
|
z(() => {
|
|
1110
|
-
a.current && t.current &&
|
|
1110
|
+
a.current && t.current && Bn(t.current), a.current = !1;
|
|
1111
1111
|
}, [
|
|
1112
1112
|
t
|
|
1113
1113
|
]);
|
|
@@ -1232,12 +1232,12 @@ function In(e, t) {
|
|
|
1232
1232
|
ref: t
|
|
1233
1233
|
}), { focusableProps: O } = Dn(e, t);
|
|
1234
1234
|
g && (O.tabIndex = r ? -1 : O.tabIndex);
|
|
1235
|
-
let
|
|
1235
|
+
let x = j(O, w, Wt(e, {
|
|
1236
1236
|
labelable: !0
|
|
1237
1237
|
}));
|
|
1238
1238
|
return {
|
|
1239
1239
|
isPressed: T,
|
|
1240
|
-
buttonProps: j($,
|
|
1240
|
+
buttonProps: j($, x, {
|
|
1241
1241
|
"aria-haspopup": e["aria-haspopup"],
|
|
1242
1242
|
"aria-expanded": e["aria-expanded"],
|
|
1243
1243
|
"aria-controls": e["aria-controls"],
|
|
@@ -1300,7 +1300,7 @@ var Kn = (e, t, n) => {
|
|
|
1300
1300
|
for (var [v, g] of e.compoundVariants)
|
|
1301
1301
|
Kn(v, r, e.defaultVariants) && (n += " " + g);
|
|
1302
1302
|
return n;
|
|
1303
|
-
}, Fn = ye({ defaultClassName: "pkg_sps-
|
|
1303
|
+
}, Fn = ye({ defaultClassName: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy0", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy1", false: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy2" }, kind: { default: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy3", link: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy4", confirm: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy5", delete: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy6", key: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy7", icon: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy8" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy9", false: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyb"], [{ kind: "default", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyd"], [{ kind: "delete", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxye"], [{ kind: "key", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyf"], [{ disabled: !0, spinning: !1 }, "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyg"], [{ kind: "link", disabled: !0 }, "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyh"]] }), Vn = ye({ defaultClassName: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyi", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyj", false: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyk" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyl", default: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxym", delete: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyn", key: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyo", confirm: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyp", link: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyq" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyr", false: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxys" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), Un = ye({ defaultClassName: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyt", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyu", false: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyv" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyw", default: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyx", delete: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyy", key: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyz", confirm: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy10", link: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy11" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), it = "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy12", Rn = ye({ defaultClassName: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy13", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy14", false: "pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy15" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
|
|
1304
1304
|
const Tt = f.forwardRef(
|
|
1305
1305
|
({
|
|
1306
1306
|
as: e,
|
|
@@ -1321,12 +1321,12 @@ const Tt = f.forwardRef(
|
|
|
1321
1321
|
const h = e ?? (a ? "a" : "button"), $ = {
|
|
1322
1322
|
onPress: n ?? t,
|
|
1323
1323
|
// the button element should be disabled if the button is marked as disabled or spinning
|
|
1324
|
-
isDisabled: g
|
|
1324
|
+
isDisabled: !!(g || u || l),
|
|
1325
1325
|
...L
|
|
1326
|
-
}, { "data-testid": w } = L, T = f.useRef(null), O = N || T, { buttonProps:
|
|
1326
|
+
}, { "data-testid": w } = L, T = f.useRef(null), O = N || T, { buttonProps: x } = In(
|
|
1327
1327
|
$,
|
|
1328
1328
|
O
|
|
1329
|
-
), { hoverProps: S } = An({ isDisabled: $.isDisabled }), { type: $e, ...I } =
|
|
1329
|
+
), { hoverProps: S } = An({ isDisabled: $.isDisabled }), { type: $e, ...I } = x, Ee = {
|
|
1330
1330
|
...j(I, S),
|
|
1331
1331
|
ref: O,
|
|
1332
1332
|
title: C,
|
|
@@ -1359,7 +1359,7 @@ const Tt = f.forwardRef(
|
|
|
1359
1359
|
let F;
|
|
1360
1360
|
v === "default" || v === "icon" || v === "link" ? F = "dark" : F = "light";
|
|
1361
1361
|
const ee = g && /* @__PURE__ */ f.createElement(
|
|
1362
|
-
|
|
1362
|
+
xt,
|
|
1363
1363
|
{
|
|
1364
1364
|
color: F,
|
|
1365
1365
|
className: Rn({ spinning: g }),
|
package/lib/index.umd.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
touch-action: pan-x pan-y pinch-zoom;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
`.trim(),o.head.prepend(d)},[A]),m.useEffect(()=>{let o=k.current;return()=>{var d;w||Oe((d=o.target)!==null&&d!==void 0?d:void 0);for(let s of o.disposables)s();o.disposables=[]}},[w]),{isPressed:c||N,pressProps:G(D,In,{[st]:!0})}}function Be(e){return e.tagName==="A"&&e.hasAttribute("href")}function xe(e,t){const{key:n,code:r}=e,i=t,l=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof M(i).HTMLInputElement&&!ut(i,n)||i instanceof M(i).HTMLTextAreaElement||i.isContentEditable)&&!((l==="link"||!l&&Be(i))&&n!=="Enter")}function cn(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function it(e,t){const n=e.changedTouches;for(let r=0;r<n.length;r++){const i=n[r];if(i.identifier===t)return i}return null}function U(e,t){let n=0,r=0;return t.targetTouches&&t.targetTouches.length===1&&(n=t.targetTouches[0].clientX,r=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r}}function W(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function dn(e){let t=0,n=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?n=e.height/2:e.radiusY!==void 0&&(n=e.radiusY),{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function pn(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function at(e,t){let n=t.getBoundingClientRect(),r=dn(e);return pn(n,r)}function fn(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Be(e)}function lt(e,t){return e instanceof HTMLInputElement?!ut(e,t):fn(e)}const mn=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ut(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":mn.has(e.type)}let te=null;const bn=new Set;let ne=new Map,Y=!1,Se=!1;function Le(e,t){for(let n of bn)n(e,t)}function vn(e){return!(e.metaKey||!J()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function pe(e){Y=!0,!j.isOpening&&vn(e)&&(te="keyboard",Le("keyboard",e))}function C(e){te="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(Y=!0,Le("pointer",e))}function ct(e){!j.isOpening&&Pe(e)&&(Y=!0,te="virtual")}function dt(e){v(e)===window||v(e)===document||le||!e.isTrusted||(!Y&&!Se&&(te="virtual",Le("virtual",e)),Y=!1,Se=!1)}function pt(){le||(Y=!1,Se=!0)}function ft(e){if(typeof window>"u"||typeof document>"u"||ne.get(M(e)))return;const t=M(e),n=T(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Y=!0,r.apply(this,arguments)},n.addEventListener("keydown",pe,!0),n.addEventListener("keyup",pe,!0),n.addEventListener("click",ct,!0),t.addEventListener("focus",dt,!0),t.addEventListener("blur",pt,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",C,!0),n.addEventListener("pointermove",C,!0),n.addEventListener("pointerup",C,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("mouseup",C,!0)),t.addEventListener("beforeunload",()=>{mt(e)},{once:!0}),ne.set(t,{focus:r})}const mt=(e,t)=>{const n=M(e),r=T(e);t&&r.removeEventListener("DOMContentLoaded",t),ne.has(n)&&(n.HTMLElement.prototype.focus=ne.get(n).focus,r.removeEventListener("keydown",pe,!0),r.removeEventListener("keyup",pe,!0),r.removeEventListener("click",ct,!0),n.removeEventListener("focus",dt,!0),n.removeEventListener("blur",pt,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",C,!0),r.removeEventListener("pointermove",C,!0),r.removeEventListener("pointerup",C,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",C,!0),r.removeEventListener("mousemove",C,!0),r.removeEventListener("mouseup",C,!0)),ne.delete(n))};function gn(e){const t=T(e);let n;return t.readyState!=="loading"?ft(e):(n=()=>{ft(e)},t.addEventListener("DOMContentLoaded",n)),()=>mt(e,n)}typeof document<"u"&&gn();function _n(){return te}function yn(e){if(!e.isConnected)return;const t=T(e);if(_n()==="virtual"){let n=z(t);Ye(()=>{const r=z(t);(r===n||r===t.body)&&e.isConnected&&q(e)})}else q(e)}function hn(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const l=m.useCallback(c=>{if(v(c)===c.currentTarget)return r&&r(c),i&&i(!1),!0},[r,i]),u=tn(l),a=m.useCallback(c=>{let g=v(c);const _=T(g),w=_?z(_):z();g===c.currentTarget&&g===w&&(n&&n(c),i&&i(!0),u(c))},[i,n,u]);return{focusProps:{onFocus:!t&&(n||i||r)?a:void 0,onBlur:!t&&(r||i)?l:void 0}}}function bt(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t&&process.env.NODE_ENV!=="production"?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(r),t&&n.stopPropagation()}}function $n(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:bt(e.onKeyDown),onKeyUp:bt(e.onKeyUp)}}}let En=m.createContext(null);function kn(e){let t=m.useContext(En)||{};Re(t,e);let{ref:n,...r}=t;return r}function wn(e,t){let{focusProps:n}=hn(e),{keyboardProps:r}=$n(e),i=G(n,r),l=kn(t),u=e.isDisabled?{}:l,a=m.useRef(e.autoFocus);m.useEffect(()=>{a.current&&t.current&&yn(t.current),a.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:G({...i,tabIndex:c},u)}}let fe=!1,me=0;function Ce(){fe=!0,setTimeout(()=>{fe=!1},50)}function vt(e){e.pointerType==="touch"&&Ce()}function Pn(){if(!(typeof document>"u"))return me===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",vt):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Ce)),me++,()=>{me--,!(me>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",vt):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Ce))}}function Tn(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[l,u]=m.useState(!1),a=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(Pn,[]);let{addGlobalListener:c,removeAllGlobalListeners:g}=Xe(),{hoverProps:_,triggerHoverEnd:w}=m.useMemo(()=>{let A=(h,k)=>{if(a.pointerType=k,i||k==="touch"||a.isHovered||!$(h.currentTarget,v(h)))return;a.isHovered=!0;let P=h.currentTarget;a.target=P,c(T(v(h)),"pointerover",O=>{a.isHovered&&a.target&&!$(a.target,v(O))&&D(O,O.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:P,pointerType:k}),n&&n(!0),u(!0)},D=(h,k)=>{let P=a.target;a.pointerType="",a.target=null,!(k==="touch"||!a.isHovered||!P)&&(a.isHovered=!1,g(),r&&r({type:"hoverend",target:P,pointerType:k}),n&&n(!1),u(!1))},N={};return typeof PointerEvent<"u"?(N.onPointerEnter=h=>{fe&&h.pointerType==="mouse"||A(h,h.pointerType)},N.onPointerLeave=h=>{!i&&$(h.currentTarget,v(h))&&D(h,h.pointerType)}):process.env.NODE_ENV==="test"&&(N.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},N.onMouseEnter=h=>{!a.ignoreEmulatedMouseEvents&&!fe&&A(h,"mouse"),a.ignoreEmulatedMouseEvents=!1},N.onMouseLeave=h=>{!i&&$(h.currentTarget,v(h))&&D(h,"mouse")}),{hoverProps:N,triggerHoverEnd:D}},[t,n,r,i,a,c,g]);return m.useEffect(()=>{i&&w({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:_,isHovered:l}}function On(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:l,onPressEnd:u,onPressUp:a,onPressChange:c,preventFocusOnPress:g,allowFocusWhenDisabled:_,onClick:w,href:A,target:D,rel:N,type:h="button"}=e,k;n==="button"?k={type:h,disabled:r,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:k={role:"button",href:n==="a"&&!r?A:void 0,target:n==="a"?D:void 0,type:n==="input"?h:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?N:void 0};let{pressProps:P,isPressed:O}=un({onPressStart:l,onPressEnd:u,onPressChange:c,onPress:i,onPressUp:a,onClick:w,isDisabled:r,preventFocusOnPress:g,ref:t}),{focusableProps:B}=wn(e,t);_&&(B.tabIndex=r?-1:B.tabIndex);let S=G(B,P,Mt(e,{labelable:!0}));return{isPressed:O,buttonProps:G(k,S,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"],"aria-disabled":e["aria-disabled"]})}}function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gt(Object(n),!0).forEach(function(r){Bn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var xn=(e,t,n)=>{for(var r of Object.keys(e)){var i;if(e[r]!==((i=t[r])!==null&&i!==void 0?i:n[r]))return!1}return!0},be=e=>t=>{var n=e.defaultClassName,r=_t(_t({},e.defaultVariants),t);for(var i in r){var l,u=(l=r[i])!==null&&l!==void 0?l:e.defaultVariants[i];if(u!=null){var a=u;typeof a=="boolean"&&(a=a===!0?"true":"false");var c=e.variantClassNames[i][a];c&&(n+=" "+c)}}for(var[g,_]of e.compoundVariants)xn(g,r,e.defaultVariants)&&(n+=" "+_);return n},Sn=be({defaultClassName:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy0",variantClassNames:{disabled:{true:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy1",false:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy2"},kind:{default:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy3",link:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy4",confirm:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy5",delete:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy6",key:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy7",icon:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy8"},spinning:{true:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy9",false:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxya"}},defaultVariants:{disabled:!1,kind:"default",spinning:!1},compoundVariants:[[{kind:"icon",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyb"],[{kind:"default",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyc"],[{kind:"confirm",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyd"],[{kind:"delete",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxye"],[{kind:"key",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyf"],[{disabled:!0,spinning:!1},"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyg"],[{kind:"link",disabled:!0},"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyh"]]}),Ln=be({defaultClassName:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyi",variantClassNames:{disabled:{true:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyj",false:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyk"},kind:{icon:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyl",default:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxym",delete:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyn",key:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyo",confirm:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyp",link:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyq"},spinning:{true:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyr",false:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxys"}},defaultVariants:{disabled:!1,kind:"default",spinning:!1},compoundVariants:[]}),Cn=be({defaultClassName:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyt",variantClassNames:{spinning:{true:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyu",false:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyv"},kind:{icon:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyw",default:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyx",delete:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyy",key:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxyz",confirm:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy10",link:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy11"}},defaultVariants:{spinning:!1},compoundVariants:[]}),yt="pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy12",Dn=be({defaultClassName:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy13",variantClassNames:{spinning:{true:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy14",false:"pkg_sps-woodland_buttons__version_8_53_2__hash_125pcxy15"}},defaultVariants:{spinning:!1},compoundVariants:[]});const De=f.forwardRef(({as:e,onClick:t,onPress:n,children:r,className:i,isDisabled:l,disabled:u,href:a,icon:c,kind:g="default",spinning:_,spinningTitle:w,title:A,...D},N)=>{const h=e??(a?"a":"button"),k={onPress:n??t,isDisabled:_??u??l,...D},{"data-testid":P}=D,O=f.useRef(null),B=N||O,{buttonProps:S}=On(k,B),{hoverProps:L}=Tn({isDisabled:k.isDisabled}),{type:Ne,...F}=S,Ae={...G(F,L),ref:B,title:A,className:a?Cn({spinning:_,kind:g}):Ln({disabled:l||u,kind:g,spinning:_}),...a?{href:a}:{type:Ne},...D},{t:I}=wt.useWoodlandLanguage(),X=c&&(c==="ai-color"?f.createElement(Z.Icon,{className:yt,icon:g==="default"||g==="link"?"ai-color":"ai",size:"sm","aria-hidden":"true","data-testid":`${P}__${c}-icon`}):f.createElement(Z.Icon,{className:yt,icon:c,size:"sm","aria-hidden":"true","data-testid":`${P}__${c}-icon`}));let H;g==="default"||g==="icon"||g==="link"?H="dark":H="light";const oe=_&&f.createElement(Z.Spinner,{color:H,className:Dn({spinning:_}),title:w||I("button.spinningTitle",{defaultValue:"Loading..."}),"data-testid":`${P}__spinner`});return f.createElement(kt.FocusRing,null,f.createElement("div",{className:Z.cl(Sn({disabled:l||u,kind:g,spinning:_}),i)},f.createElement(h,{...Ae},X,r?f.createElement("span",null,r):"",oe)))});Z.Metadata.set(De,{name:"Button",props:{disabled:"boolean",href:"string",icon:"IconName",kind:{type:'"default" | "link" | "icon" | "confirm" | "delete" | "key"',default:'"default"'},spinning:"boolean",spinningTitle:"string",type:{type:'"button" | "submit"',default:'"button"'},as:"button | a",onClick:"() => void",onPress:"() => void",children:"ReactNode",className:"string",isDisabled:"boolean",style:"CSSProperties"},panellable:!0});const Nn={Buttons:{components:[De],description:()=>f.createElement(f.Fragment,null,f.createElement("div",{className:"sps-body-14"},"Buttons are used to initiate events or actions. The labels and/or icons describe what the button will do."),f.createElement("br",null),f.createElement("h5",null,"Variants"),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Default: "),"For tertiary actions or actions of lower importance on a page."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Key: "),"For primary or important actions on a page."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Confirm: "),"For the main call to action on a page. There should only be one Confirm button per screen."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Delete: "),"For deleting information or another destructive action. These should always be paired with a Delete Confirmation Modal."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Disabled: "),"For actions that are not permitted in a particular state. These can be accompanied by a Tooltip on hover describing why it’s disabled."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"With an Icon: "),"For further illustrating the action. Example: Pencil icon in an Edit button. There can also be Icon Buttons without text.")),examples:{basic:{label:"Basic Buttons",description:({NavigateTo:e})=>f.createElement(f.Fragment,null,f.createElement("p",null,"The most common type of button that can be used in most cases. Example: Basic Buttons in a ",f.createElement(e,{to:"modals"},"Modal"),".")),examples:{withoutIcons:{description:"Without Icons",react:E.code`
|
|
7
|
+
`.trim(),o.head.prepend(d)},[A]),m.useEffect(()=>{let o=k.current;return()=>{var d;w||Oe((d=o.target)!==null&&d!==void 0?d:void 0);for(let s of o.disposables)s();o.disposables=[]}},[w]),{isPressed:c||N,pressProps:G(D,In,{[st]:!0})}}function Be(e){return e.tagName==="A"&&e.hasAttribute("href")}function xe(e,t){const{key:n,code:r}=e,i=t,l=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof M(i).HTMLInputElement&&!ut(i,n)||i instanceof M(i).HTMLTextAreaElement||i.isContentEditable)&&!((l==="link"||!l&&Be(i))&&n!=="Enter")}function cn(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function it(e,t){const n=e.changedTouches;for(let r=0;r<n.length;r++){const i=n[r];if(i.identifier===t)return i}return null}function U(e,t){let n=0,r=0;return t.targetTouches&&t.targetTouches.length===1&&(n=t.targetTouches[0].clientX,r=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r}}function W(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function dn(e){let t=0,n=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?n=e.height/2:e.radiusY!==void 0&&(n=e.radiusY),{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function pn(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function at(e,t){let n=t.getBoundingClientRect(),r=dn(e);return pn(n,r)}function fn(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Be(e)}function lt(e,t){return e instanceof HTMLInputElement?!ut(e,t):fn(e)}const mn=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ut(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":mn.has(e.type)}let te=null;const bn=new Set;let ne=new Map,Y=!1,Se=!1;function Le(e,t){for(let n of bn)n(e,t)}function vn(e){return!(e.metaKey||!J()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function pe(e){Y=!0,!j.isOpening&&vn(e)&&(te="keyboard",Le("keyboard",e))}function C(e){te="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(Y=!0,Le("pointer",e))}function ct(e){!j.isOpening&&Pe(e)&&(Y=!0,te="virtual")}function dt(e){v(e)===window||v(e)===document||le||!e.isTrusted||(!Y&&!Se&&(te="virtual",Le("virtual",e)),Y=!1,Se=!1)}function pt(){le||(Y=!1,Se=!0)}function ft(e){if(typeof window>"u"||typeof document>"u"||ne.get(M(e)))return;const t=M(e),n=T(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Y=!0,r.apply(this,arguments)},n.addEventListener("keydown",pe,!0),n.addEventListener("keyup",pe,!0),n.addEventListener("click",ct,!0),t.addEventListener("focus",dt,!0),t.addEventListener("blur",pt,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",C,!0),n.addEventListener("pointermove",C,!0),n.addEventListener("pointerup",C,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("mouseup",C,!0)),t.addEventListener("beforeunload",()=>{mt(e)},{once:!0}),ne.set(t,{focus:r})}const mt=(e,t)=>{const n=M(e),r=T(e);t&&r.removeEventListener("DOMContentLoaded",t),ne.has(n)&&(n.HTMLElement.prototype.focus=ne.get(n).focus,r.removeEventListener("keydown",pe,!0),r.removeEventListener("keyup",pe,!0),r.removeEventListener("click",ct,!0),n.removeEventListener("focus",dt,!0),n.removeEventListener("blur",pt,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",C,!0),r.removeEventListener("pointermove",C,!0),r.removeEventListener("pointerup",C,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",C,!0),r.removeEventListener("mousemove",C,!0),r.removeEventListener("mouseup",C,!0)),ne.delete(n))};function gn(e){const t=T(e);let n;return t.readyState!=="loading"?ft(e):(n=()=>{ft(e)},t.addEventListener("DOMContentLoaded",n)),()=>mt(e,n)}typeof document<"u"&&gn();function _n(){return te}function yn(e){if(!e.isConnected)return;const t=T(e);if(_n()==="virtual"){let n=z(t);Ye(()=>{const r=z(t);(r===n||r===t.body)&&e.isConnected&&q(e)})}else q(e)}function hn(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const l=m.useCallback(c=>{if(v(c)===c.currentTarget)return r&&r(c),i&&i(!1),!0},[r,i]),u=tn(l),a=m.useCallback(c=>{let g=v(c);const _=T(g),w=_?z(_):z();g===c.currentTarget&&g===w&&(n&&n(c),i&&i(!0),u(c))},[i,n,u]);return{focusProps:{onFocus:!t&&(n||i||r)?a:void 0,onBlur:!t&&(r||i)?l:void 0}}}function bt(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t&&process.env.NODE_ENV!=="production"?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(r),t&&n.stopPropagation()}}function $n(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:bt(e.onKeyDown),onKeyUp:bt(e.onKeyUp)}}}let En=m.createContext(null);function kn(e){let t=m.useContext(En)||{};Re(t,e);let{ref:n,...r}=t;return r}function wn(e,t){let{focusProps:n}=hn(e),{keyboardProps:r}=$n(e),i=G(n,r),l=kn(t),u=e.isDisabled?{}:l,a=m.useRef(e.autoFocus);m.useEffect(()=>{a.current&&t.current&&yn(t.current),a.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:G({...i,tabIndex:c},u)}}let fe=!1,me=0;function Ce(){fe=!0,setTimeout(()=>{fe=!1},50)}function vt(e){e.pointerType==="touch"&&Ce()}function Pn(){if(!(typeof document>"u"))return me===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",vt):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Ce)),me++,()=>{me--,!(me>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",vt):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Ce))}}function Tn(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[l,u]=m.useState(!1),a=m.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;m.useEffect(Pn,[]);let{addGlobalListener:c,removeAllGlobalListeners:g}=Xe(),{hoverProps:_,triggerHoverEnd:w}=m.useMemo(()=>{let A=(h,k)=>{if(a.pointerType=k,i||k==="touch"||a.isHovered||!$(h.currentTarget,v(h)))return;a.isHovered=!0;let P=h.currentTarget;a.target=P,c(T(v(h)),"pointerover",O=>{a.isHovered&&a.target&&!$(a.target,v(O))&&D(O,O.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:P,pointerType:k}),n&&n(!0),u(!0)},D=(h,k)=>{let P=a.target;a.pointerType="",a.target=null,!(k==="touch"||!a.isHovered||!P)&&(a.isHovered=!1,g(),r&&r({type:"hoverend",target:P,pointerType:k}),n&&n(!1),u(!1))},N={};return typeof PointerEvent<"u"?(N.onPointerEnter=h=>{fe&&h.pointerType==="mouse"||A(h,h.pointerType)},N.onPointerLeave=h=>{!i&&$(h.currentTarget,v(h))&&D(h,h.pointerType)}):process.env.NODE_ENV==="test"&&(N.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},N.onMouseEnter=h=>{!a.ignoreEmulatedMouseEvents&&!fe&&A(h,"mouse"),a.ignoreEmulatedMouseEvents=!1},N.onMouseLeave=h=>{!i&&$(h.currentTarget,v(h))&&D(h,"mouse")}),{hoverProps:N,triggerHoverEnd:D}},[t,n,r,i,a,c,g]);return m.useEffect(()=>{i&&w({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:_,isHovered:l}}function On(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:l,onPressEnd:u,onPressUp:a,onPressChange:c,preventFocusOnPress:g,allowFocusWhenDisabled:_,onClick:w,href:A,target:D,rel:N,type:h="button"}=e,k;n==="button"?k={type:h,disabled:r,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:k={role:"button",href:n==="a"&&!r?A:void 0,target:n==="a"?D:void 0,type:n==="input"?h:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?N:void 0};let{pressProps:P,isPressed:O}=un({onPressStart:l,onPressEnd:u,onPressChange:c,onPress:i,onPressUp:a,onClick:w,isDisabled:r,preventFocusOnPress:g,ref:t}),{focusableProps:B}=wn(e,t);_&&(B.tabIndex=r?-1:B.tabIndex);let S=G(B,P,Mt(e,{labelable:!0}));return{isPressed:O,buttonProps:G(k,S,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"],"aria-disabled":e["aria-disabled"]})}}function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gt(Object(n),!0).forEach(function(r){Bn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var xn=(e,t,n)=>{for(var r of Object.keys(e)){var i;if(e[r]!==((i=t[r])!==null&&i!==void 0?i:n[r]))return!1}return!0},be=e=>t=>{var n=e.defaultClassName,r=_t(_t({},e.defaultVariants),t);for(var i in r){var l,u=(l=r[i])!==null&&l!==void 0?l:e.defaultVariants[i];if(u!=null){var a=u;typeof a=="boolean"&&(a=a===!0?"true":"false");var c=e.variantClassNames[i][a];c&&(n+=" "+c)}}for(var[g,_]of e.compoundVariants)xn(g,r,e.defaultVariants)&&(n+=" "+_);return n},Sn=be({defaultClassName:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy0",variantClassNames:{disabled:{true:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy1",false:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy2"},kind:{default:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy3",link:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy4",confirm:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy5",delete:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy6",key:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy7",icon:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy8"},spinning:{true:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy9",false:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxya"}},defaultVariants:{disabled:!1,kind:"default",spinning:!1},compoundVariants:[[{kind:"icon",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyb"],[{kind:"default",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyc"],[{kind:"confirm",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyd"],[{kind:"delete",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxye"],[{kind:"key",spinning:!0},"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyf"],[{disabled:!0,spinning:!1},"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyg"],[{kind:"link",disabled:!0},"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyh"]]}),Ln=be({defaultClassName:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyi",variantClassNames:{disabled:{true:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyj",false:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyk"},kind:{icon:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyl",default:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxym",delete:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyn",key:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyo",confirm:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyp",link:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyq"},spinning:{true:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyr",false:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxys"}},defaultVariants:{disabled:!1,kind:"default",spinning:!1},compoundVariants:[]}),Cn=be({defaultClassName:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyt",variantClassNames:{spinning:{true:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyu",false:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyv"},kind:{icon:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyw",default:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyx",delete:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyy",key:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyz",confirm:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy10",link:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy11"}},defaultVariants:{spinning:!1},compoundVariants:[]}),yt="pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy12",Dn=be({defaultClassName:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy13",variantClassNames:{spinning:{true:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy14",false:"pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy15"}},defaultVariants:{spinning:!1},compoundVariants:[]});const De=f.forwardRef(({as:e,onClick:t,onPress:n,children:r,className:i,isDisabled:l,disabled:u,href:a,icon:c,kind:g="default",spinning:_,spinningTitle:w,title:A,...D},N)=>{const h=e??(a?"a":"button"),k={onPress:n??t,isDisabled:!!(_||u||l),...D},{"data-testid":P}=D,O=f.useRef(null),B=N||O,{buttonProps:S}=On(k,B),{hoverProps:L}=Tn({isDisabled:k.isDisabled}),{type:Ne,...F}=S,Ae={...G(F,L),ref:B,title:A,className:a?Cn({spinning:_,kind:g}):Ln({disabled:l||u,kind:g,spinning:_}),...a?{href:a}:{type:Ne},...D},{t:I}=wt.useWoodlandLanguage(),X=c&&(c==="ai-color"?f.createElement(Z.Icon,{className:yt,icon:g==="default"||g==="link"?"ai-color":"ai",size:"sm","aria-hidden":"true","data-testid":`${P}__${c}-icon`}):f.createElement(Z.Icon,{className:yt,icon:c,size:"sm","aria-hidden":"true","data-testid":`${P}__${c}-icon`}));let H;g==="default"||g==="icon"||g==="link"?H="dark":H="light";const oe=_&&f.createElement(Z.Spinner,{color:H,className:Dn({spinning:_}),title:w||I("button.spinningTitle",{defaultValue:"Loading..."}),"data-testid":`${P}__spinner`});return f.createElement(kt.FocusRing,null,f.createElement("div",{className:Z.cl(Sn({disabled:l||u,kind:g,spinning:_}),i)},f.createElement(h,{...Ae},X,r?f.createElement("span",null,r):"",oe)))});Z.Metadata.set(De,{name:"Button",props:{disabled:"boolean",href:"string",icon:"IconName",kind:{type:'"default" | "link" | "icon" | "confirm" | "delete" | "key"',default:'"default"'},spinning:"boolean",spinningTitle:"string",type:{type:'"button" | "submit"',default:'"button"'},as:"button | a",onClick:"() => void",onPress:"() => void",children:"ReactNode",className:"string",isDisabled:"boolean",style:"CSSProperties"},panellable:!0});const Nn={Buttons:{components:[De],description:()=>f.createElement(f.Fragment,null,f.createElement("div",{className:"sps-body-14"},"Buttons are used to initiate events or actions. The labels and/or icons describe what the button will do."),f.createElement("br",null),f.createElement("h5",null,"Variants"),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Default: "),"For tertiary actions or actions of lower importance on a page."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Key: "),"For primary or important actions on a page."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Confirm: "),"For the main call to action on a page. There should only be one Confirm button per screen."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Delete: "),"For deleting information or another destructive action. These should always be paired with a Delete Confirmation Modal."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"Disabled: "),"For actions that are not permitted in a particular state. These can be accompanied by a Tooltip on hover describing why it’s disabled."),f.createElement("div",{className:"sps-body-14"},f.createElement("span",{className:"sps-text-semibold"},"With an Icon: "),"For further illustrating the action. Example: Pencil icon in an Edit button. There can also be Icon Buttons without text.")),examples:{basic:{label:"Basic Buttons",description:({NavigateTo:e})=>f.createElement(f.Fragment,null,f.createElement("p",null,"The most common type of button that can be used in most cases. Example: Basic Buttons in a ",f.createElement(e,{to:"modals"},"Modal"),".")),examples:{withoutIcons:{description:"Without Icons",react:E.code`
|
|
8
8
|
import { Button } from "@sps-woodland/buttons";
|
|
9
9
|
import { sprinkles } from "@sps-woodland/tokens";
|
|
10
10
|
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy0{border-width:.0625rem;border-style:solid;border-radius:.25rem;cursor:pointer;display:inline-block;font-size:.75rem;font-weight:600;line-height:.875rem;padding:0;position:relative;vertical-align:middle}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy3{background:#e9e9ea;border-color:#d2d4d4;color:#4b5356}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy3:hover{background:#d2d4d4}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy4{background:none transparent;border:0;color:#007db8}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy4:hover{background:none transparent;color:#09638d;text-decoration:none}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy5{background:#007db8;border-color:#09638d;color:#fff}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy5:hover{background:#09638d}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy6{background:#de002e;border-color:#a30d2d;color:#fff}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy6:hover{background:#a30d2d}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy7{background:#4b5356;border-color:#1f282c;color:#fff}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy7:hover{background:#1f282c}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy8{background:transparent;border-color:transparent;color:#4b5356}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy8:hover{background-color:#d2d4d4;border-color:#d2d4d4}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy9{color:transparent!important;cursor:not-allowed}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyb{background:#e9e9ea;border-color:#d2d4d4}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyb:hover,.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyc:hover{background:#e9e9ea}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyd:hover{background:#007db8}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxye:hover{background:#de002e}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyf:hover{background:#4b5356}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyg{background:#fff!important;border-color:#d2d4d4!important;color:#717779!important;cursor:not-allowed}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyg:hover{background:#fff}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyh{background:none transparent!important}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyi{background:none transparent;border:0 none;color:inherit;display:flex;align-items:center;font-size:inherit;font-weight:inherit;margin:0;text-decoration:none;padding:.5rem 1rem}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyi:hover{text-decoration:none}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyj{cursor:not-allowed!important}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyl{padding:.25rem .5rem}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyq{padding-top:.5rem;padding-bottom:.5rem;padding-right:0;padding-left:0}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyr{cursor:not-allowed!important}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyt{background:none transparent;border:0 none;color:inherit;cursor:inherit;display:flex;align-items:center;font-size:inherit;font-weight:inherit;margin:0;padding:.5rem 1rem;text-decoration:none}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyt:hover{text-decoration:none;color:inherit}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyu{cursor:not-allowed}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxyw{padding:.25rem .5rem}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy11{padding-top:.5rem;padding-bottom:.5rem;padding-right:0;padding-left:0}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy12:not(:last-child){margin-right:.5rem}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy13{left:50%;margin:-.875rem -.4375rem;position:absolute}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy14{cursor:not-allowed;display:inline}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy15{display:none}.pkg_sps-woodland_buttons__version_8_53_4__hash_125pcxy13>i{border-width:.125rem;height:.875rem;width:.875rem}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/buttons",
|
|
3
3
|
"description": "SPS Woodland Design System button components",
|
|
4
|
-
"version": "8.53.
|
|
4
|
+
"version": "8.53.4",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/buttons",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
31
31
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
32
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
33
|
-
"@sps-woodland/core": "8.53.
|
|
34
|
-
"@sps-woodland/tokens": "8.53.
|
|
35
|
-
"@spscommerce/i18n": "8.53.
|
|
33
|
+
"@sps-woodland/core": "8.53.4",
|
|
34
|
+
"@sps-woodland/tokens": "8.53.4",
|
|
35
|
+
"@spscommerce/i18n": "8.53.4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@react-aria/button": "3.14.5",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"@vanilla-extract/recipes": "0.2.5",
|
|
44
44
|
"react": "16.14.0",
|
|
45
45
|
"react-dom": "16.14.0",
|
|
46
|
-
"@sps-woodland/core": "8.53.
|
|
47
|
-
"@sps-woodland/tokens": "8.53.
|
|
48
|
-
"@spscommerce/i18n": "8.53.
|
|
46
|
+
"@sps-woodland/core": "8.53.4",
|
|
47
|
+
"@sps-woodland/tokens": "8.53.4",
|
|
48
|
+
"@spscommerce/i18n": "8.53.4"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@react-aria/interactions": "^3.27.1",
|