@spscommerce/ds-react 7.17.1 → 7.17.3

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.es.js CHANGED
@@ -2916,6 +2916,13 @@ const Cv = {
2916
2916
 
2917
2917
  return (
2918
2918
  <>
2919
+ <SpsSplitButton
2920
+ className="mr-1 mb-1"
2921
+ kind={ButtonKind.KEY}
2922
+ label="Loading at startup"
2923
+ spinning={true}
2924
+ spinningTitle="Loading ..."
2925
+ />
2919
2926
  <SpsSplitButton
2920
2927
  onClick={() => handleConfirmationRequest("General confirmation")}
2921
2928
  className="mr-1 mb-1"
@@ -12544,7 +12551,7 @@ function Pu({
12544
12551
  function Q(W) {
12545
12552
  const q = u || [];
12546
12553
  let z;
12547
- !q[0] || q[1] || J.isBefore(W, q[0]) ? z = [W, null] : (z = [q[0], W], x(!0), k && k.current && k.current.focus()), N && $(N) === "Before" && q[0] === null && q[1] === null && (z = [null, W], x(!0), k && k.current && k.current.focus()), N && $(N) === "After" && (x(!0), k && k.current && k.current.focus()), R(z), L(J.toStringRange(z)), K(void 0), (N && $(N) === "Before" && z && z[0] !== null || N && $(N) !== "Before" && $(N) !== "After") && O(null);
12554
+ !q[0] || q[1] || J.isBefore(W, q[0]) ? z = [W, null] : (z = [q[0], W], x(!0), k && k.current && k.current.focus()), N && H(N) === "Before" && q[0] === null && q[1] === null && (z = [null, W], x(!0), k && k.current && k.current.focus()), N && H(N) === "After" && (x(!0), k && k.current && k.current.focus()), R(z), L(J.toStringRange(z)), K(void 0), (N && H(N) === "Before" && z && z[0] !== null || N && H(N) !== "Before" && H(N) !== "After") && O(null);
12548
12555
  }
12549
12556
  function Z(W) {
12550
12557
  L(W.target.value);
@@ -12565,13 +12572,17 @@ function Pu({
12565
12572
  }
12566
12573
  }
12567
12574
  function H(W) {
12575
+ var q;
12576
+ return W && /^design-system:/.test(W.label) ? T(W.label) : (q = W == null ? void 0 : W.label) != null ? q : "";
12577
+ }
12578
+ function $(W) {
12568
12579
  if (m && (W == null ? void 0 : W.definition) !== f && m(typeof (W == null ? void 0 : W.definition) == "string" ? W == null ? void 0 : W.definition : ""), !W) {
12569
12580
  O(null), R(void 0);
12570
12581
  return;
12571
12582
  }
12572
12583
  O(W);
12573
12584
  const q = J.createRangeFromPreset(W);
12574
- if (W && $(W) === "Before")
12585
+ if (W && H(W) === "Before")
12575
12586
  if (u && u[0] && u[1]) {
12576
12587
  let z = J.createRangeFrom("-");
12577
12588
  z && R(z);
@@ -12579,7 +12590,7 @@ function Pu({
12579
12590
  let z = J.createRangeFrom(`-${J.toString(u && u[0])}`);
12580
12591
  z && R(z);
12581
12592
  }
12582
- else if (W && $(W) === "After")
12593
+ else if (W && H(W) === "After")
12583
12594
  if (u && u[0] && u[1]) {
12584
12595
  let z = J.createRangeFrom("-");
12585
12596
  z && R(z);
@@ -12597,15 +12608,12 @@ function Pu({
12597
12608
  J.createRangeFromPreset(z)
12598
12609
  )
12599
12610
  );
12600
- q ? H(q) : u[0] === null || u[1] === null || O(null);
12611
+ q ? $(q) : u[0] === null || u[1] === null || O(null);
12601
12612
  }
12602
12613
  }, [u]), s.useEffect(() => {
12603
- const W = N ? $(N) : "";
12604
- !u && !["Before", "After"].includes(W) ? U() : Array.isArray(u) && !N ? (u.every((q) => J.isValid(q) || q === null) && L(J.toStringRange(u)), K(void 0)) : Array.isArray(u) && u[0] && u[1] && (W === "Before" || W === "After") && u.every((q) => J.isValid(q) || q === null) ? L(J.toStringRange(u)) : Array.isArray(u) && N && L("");
12614
+ const W = ["Before", "After"].includes(H(N));
12615
+ N && !W ? L("") : Array.isArray(u) && (L(J.toStringRange(u)), N || K(void 0));
12605
12616
  }, [u, N]);
12606
- function $(W) {
12607
- return W && /^design-system:/.test(W.label) ? T(W.label) : W.label;
12608
- }
12609
12617
  const X = V(
12610
12618
  ld,
12611
12619
  "sps-text-input",
@@ -12628,7 +12636,7 @@ function Pu({
12628
12636
  className: "sps-datepicker__selected-preset"
12629
12637
  }, /* @__PURE__ */ s.createElement("span", {
12630
12638
  className: "sps-tag sps-tag--info"
12631
- }, $(N))), /* @__PURE__ */ s.createElement("input", {
12639
+ }, H(N))), /* @__PURE__ */ s.createElement("input", {
12632
12640
  type: "text",
12633
12641
  ref: k,
12634
12642
  className: "sps-text-input__input",
@@ -12662,32 +12670,32 @@ function Pu({
12662
12670
  className: "sps-custom-control__input",
12663
12671
  checked: !N,
12664
12672
  name: `sps-date-range-picker-${w}__range`,
12665
- onChange: () => H()
12673
+ onChange: () => $()
12666
12674
  }), /* @__PURE__ */ s.createElement("label", {
12667
12675
  className: "sps-custom-control__label",
12668
12676
  htmlFor: `sps-date-range-picker-${w}__range-custom`
12669
12677
  }, T("design-system:datepicker.preset.custom"))), p.map((W, q) => /* @__PURE__ */ s.createElement("div", {
12670
- key: $(W),
12678
+ key: H(W),
12671
12679
  className: "sps-custom-control sps-custom-radio sps-custom-control--no-error"
12672
12680
  }, /* @__PURE__ */ s.createElement("input", {
12673
12681
  type: "radio",
12674
12682
  "data-testid": `${g}_preset_option_${W.label}`,
12675
12683
  id: `sps-date-range-picker-${w}__range-${q}`,
12676
12684
  name: `sps-date-range-picker-${w}__range`,
12677
- onChange: () => H(W),
12685
+ onChange: () => $(W),
12678
12686
  checked: N != null && N.definition ? N.definition === W.definition : !1,
12679
12687
  className: "sps-custom-control__input"
12680
12688
  }), /* @__PURE__ */ s.createElement("label", {
12681
12689
  className: "sps-custom-control__label",
12682
12690
  htmlFor: `sps-date-range-picker-${w}__range-${q}`
12683
- }, $(W)))))), /* @__PURE__ */ s.createElement(Ea, {
12691
+ }, H(W)))))), /* @__PURE__ */ s.createElement(Ea, {
12684
12692
  "data-testid": `${g}_calendar`,
12685
12693
  selectedRange: Array.isArray(u) ? u : P,
12686
12694
  onNewSelection: Q,
12687
12695
  minDate: l,
12688
12696
  maxDate: o,
12689
12697
  showTwoMonths: h,
12690
- selectedPreset: N && $(N)
12698
+ selectedPreset: N && H(N)
12691
12699
  })));
12692
12700
  }
12693
12701
  Object.assign(Pu, {
@@ -27698,23 +27706,25 @@ function um(e) {
27698
27706
  spinningTitle: u,
27699
27707
  unsafelyReplaceClassName: h,
27700
27708
  ...g
27701
- } = e, y = s.useRef(null), [T, w] = s.useState({ width: 0 }), [C, I] = s.useState(!1);
27709
+ } = e, y = s.useRef(null), [T, w] = s.useState({ width: 0 }), [C, I] = s.useState(!1), [k, b] = s.useState(!1);
27702
27710
  s.useLayoutEffect(() => {
27703
27711
  y.current && w({
27704
27712
  width: y.current.offsetWidth
27705
27713
  });
27706
- }, []);
27707
- const k = () => {
27714
+ }, []), s.useEffect(() => {
27715
+ b(Boolean(m));
27716
+ }, [m]);
27717
+ const M = () => {
27708
27718
  I(!0);
27709
- }, b = () => {
27719
+ }, L = () => {
27710
27720
  I(!1);
27711
- }, M = V(
27721
+ }, N = V(
27712
27722
  h || "sps-split-button",
27713
27723
  `sps-split-button--${f}`,
27714
27724
  C && "sps-split-button--open",
27715
27725
  n
27716
27726
  );
27717
- return /* @__PURE__ */ s.createElement(s.Fragment, null, m ? /* @__PURE__ */ s.createElement(Ye, {
27727
+ return /* @__PURE__ */ s.createElement(s.Fragment, null, k ? /* @__PURE__ */ s.createElement(Ye, {
27718
27728
  className: n,
27719
27729
  "data-testid": r,
27720
27730
  style: { width: T.width },
@@ -27725,7 +27735,7 @@ function um(e) {
27725
27735
  spinningTitle: u
27726
27736
  }, l) : /* @__PURE__ */ s.createElement("div", {
27727
27737
  ref: y,
27728
- className: M,
27738
+ className: N,
27729
27739
  "data-testid": r,
27730
27740
  ...g
27731
27741
  }, /* @__PURE__ */ s.createElement(Ye, {
@@ -27737,8 +27747,8 @@ function um(e) {
27737
27747
  kind: f,
27738
27748
  options: c,
27739
27749
  disabled: a,
27740
- onOpen: k,
27741
- onClose: b
27750
+ onOpen: M,
27751
+ onClose: L
27742
27752
  })));
27743
27753
  }
27744
27754
  Object.assign(um, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spscommerce/ds-react",
3
3
  "description": "SPS Design System React components",
4
- "version": "7.17.1",
4
+ "version": "7.17.3",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/spscommerce/woodland/tree/main/packages/@spscommerce/ds-react",
@@ -46,11 +46,11 @@
46
46
  "moment-timezone": "^0.5.28",
47
47
  "react": "^16.9.0",
48
48
  "react-dom": "^16.9.0",
49
- "@sps-woodland/illustrations": "7.17.1",
50
- "@sps-woodland/tabs": "7.17.1",
51
- "@spscommerce/ds-colors": "7.17.1",
52
- "@spscommerce/ds-shared": "7.17.1",
53
- "@spscommerce/positioning": "7.17.1"
49
+ "@sps-woodland/illustrations": "7.17.3",
50
+ "@sps-woodland/tabs": "7.17.3",
51
+ "@spscommerce/ds-colors": "7.17.3",
52
+ "@spscommerce/ds-shared": "7.17.3",
53
+ "@spscommerce/positioning": "7.17.3"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@react-spectrum/provider": "^3.4.1",
@@ -72,12 +72,12 @@
72
72
  "raf-stub": "^2.0.2",
73
73
  "react": "^16.9.0",
74
74
  "react-dom": "^16.9.0",
75
- "@sps-woodland/illustrations": "7.17.1",
76
- "@sps-woodland/tabs": "7.17.1",
77
- "@spscommerce/ds-colors": "7.17.1",
78
- "@spscommerce/ds-shared": "7.17.1",
79
- "@spscommerce/positioning": "7.17.1",
80
- "test": "7.17.1"
75
+ "@sps-woodland/illustrations": "7.17.3",
76
+ "@sps-woodland/tabs": "7.17.3",
77
+ "@spscommerce/ds-colors": "7.17.3",
78
+ "@spscommerce/ds-shared": "7.17.3",
79
+ "@spscommerce/positioning": "7.17.3",
80
+ "test": "7.17.3"
81
81
  },
82
82
  "scripts": {
83
83
  "build": "pnpm run build:js && pnpm run build:types",