@spscommerce/ds-react 7.17.2 → 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.cjs.js +8 -1
- package/lib/index.es.js +18 -9
- package/package.json +12 -12
package/lib/index.cjs.js
CHANGED
|
@@ -591,6 +591,13 @@
|
|
|
591
591
|
|
|
592
592
|
return (
|
|
593
593
|
<>
|
|
594
|
+
<SpsSplitButton
|
|
595
|
+
className="mr-1 mb-1"
|
|
596
|
+
kind={ButtonKind.KEY}
|
|
597
|
+
label="Loading at startup"
|
|
598
|
+
spinning={true}
|
|
599
|
+
spinningTitle="Loading ..."
|
|
600
|
+
/>
|
|
594
601
|
<SpsSplitButton
|
|
595
602
|
onClick={() => handleConfirmationRequest("General confirmation")}
|
|
596
603
|
className="mr-1 mb-1"
|
|
@@ -8724,7 +8731,7 @@ var r=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
8724
8731
|
</div>
|
|
8725
8732
|
);
|
|
8726
8733
|
}
|
|
8727
|
-
`}}}},Sx={disabled:"boolean",href:"string",label:"string",icon:"SpsIcon",kind:"StdButtonKind",options:"Array<SpsActionMethod | [SpsActionDescriptor, () => void]>",spinning:"boolean",spinningTitle:"string"};function al(e){const{children:t,className:n,"data-testid":r,disabled:a,href:o,label:l,options:c,icon:p,kind:f=$.StdButtonKind.DEFAULT,spinning:m,spinningTitle:u,unsafelyReplaceClassName:h,...S}=e,T=s.useRef(null),[E,w]=s.useState({width:0}),[C,I]=s.useState(!1);s.useLayoutEffect(()=>{T.current&&w({width:T.current.offsetWidth})},[]);const
|
|
8734
|
+
`}}}},Sx={disabled:"boolean",href:"string",label:"string",icon:"SpsIcon",kind:"StdButtonKind",options:"Array<SpsActionMethod | [SpsActionDescriptor, () => void]>",spinning:"boolean",spinningTitle:"string"};function al(e){const{children:t,className:n,"data-testid":r,disabled:a,href:o,label:l,options:c,icon:p,kind:f=$.StdButtonKind.DEFAULT,spinning:m,spinningTitle:u,unsafelyReplaceClassName:h,...S}=e,T=s.useRef(null),[E,w]=s.useState({width:0}),[C,I]=s.useState(!1),[k,b]=s.useState(!1);s.useLayoutEffect(()=>{T.current&&w({width:T.current.offsetWidth})},[]),s.useEffect(()=>{b(Boolean(m))},[m]);const M=()=>{I(!0)},L=()=>{I(!1)},N=K(h||"sps-split-button",`sps-split-button--${f}`,C&&"sps-split-button--open",n);return s.createElement(s.Fragment,null,k?s.createElement(He,{className:n,"data-testid":r,style:{width:E.width},kind:f,icon:p,href:o,spinning:!0,spinningTitle:u},l):s.createElement("div",{ref:T,className:N,"data-testid":r,...S},s.createElement(He,{kind:f,icon:p,href:o,disabled:a},l),s.createElement(Fn,{kind:f,options:c,disabled:a,onOpen:M,onClose:L})))}Object.assign(al,{props:Sx,displayName:"SpsSplitButton"});const vf={kinds:{label:"Regular Split Buttons",description:y.code`<p>info about split buttons</p>`,examples:{basic:{description:y.code`<p>Basic</p>`,imports:y.code`
|
|
8728
8735
|
import { SpsSplitButton } from "@spscommerce/ds-react";
|
|
8729
8736
|
`,jsx:y.code`
|
|
8730
8737
|
<React.Fragment>
|
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"
|
|
@@ -27699,23 +27706,25 @@ function um(e) {
|
|
|
27699
27706
|
spinningTitle: u,
|
|
27700
27707
|
unsafelyReplaceClassName: h,
|
|
27701
27708
|
...g
|
|
27702
|
-
} = 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);
|
|
27703
27710
|
s.useLayoutEffect(() => {
|
|
27704
27711
|
y.current && w({
|
|
27705
27712
|
width: y.current.offsetWidth
|
|
27706
27713
|
});
|
|
27707
|
-
}, [])
|
|
27708
|
-
|
|
27714
|
+
}, []), s.useEffect(() => {
|
|
27715
|
+
b(Boolean(m));
|
|
27716
|
+
}, [m]);
|
|
27717
|
+
const M = () => {
|
|
27709
27718
|
I(!0);
|
|
27710
|
-
},
|
|
27719
|
+
}, L = () => {
|
|
27711
27720
|
I(!1);
|
|
27712
|
-
},
|
|
27721
|
+
}, N = V(
|
|
27713
27722
|
h || "sps-split-button",
|
|
27714
27723
|
`sps-split-button--${f}`,
|
|
27715
27724
|
C && "sps-split-button--open",
|
|
27716
27725
|
n
|
|
27717
27726
|
);
|
|
27718
|
-
return /* @__PURE__ */ s.createElement(s.Fragment, null,
|
|
27727
|
+
return /* @__PURE__ */ s.createElement(s.Fragment, null, k ? /* @__PURE__ */ s.createElement(Ye, {
|
|
27719
27728
|
className: n,
|
|
27720
27729
|
"data-testid": r,
|
|
27721
27730
|
style: { width: T.width },
|
|
@@ -27726,7 +27735,7 @@ function um(e) {
|
|
|
27726
27735
|
spinningTitle: u
|
|
27727
27736
|
}, l) : /* @__PURE__ */ s.createElement("div", {
|
|
27728
27737
|
ref: y,
|
|
27729
|
-
className:
|
|
27738
|
+
className: N,
|
|
27730
27739
|
"data-testid": r,
|
|
27731
27740
|
...g
|
|
27732
27741
|
}, /* @__PURE__ */ s.createElement(Ye, {
|
|
@@ -27738,8 +27747,8 @@ function um(e) {
|
|
|
27738
27747
|
kind: f,
|
|
27739
27748
|
options: c,
|
|
27740
27749
|
disabled: a,
|
|
27741
|
-
onOpen:
|
|
27742
|
-
onClose:
|
|
27750
|
+
onOpen: M,
|
|
27751
|
+
onClose: L
|
|
27743
27752
|
})));
|
|
27744
27753
|
}
|
|
27745
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.
|
|
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.
|
|
50
|
-
"@sps-woodland/tabs": "7.17.
|
|
51
|
-
"@spscommerce/ds-colors": "7.17.
|
|
52
|
-
"@spscommerce/ds-shared": "7.17.
|
|
53
|
-
"@spscommerce/positioning": "7.17.
|
|
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.
|
|
76
|
-
"@sps-woodland/tabs": "7.17.
|
|
77
|
-
"@spscommerce/ds-colors": "7.17.
|
|
78
|
-
"@spscommerce/ds-shared": "7.17.
|
|
79
|
-
"@spscommerce/positioning": "7.17.
|
|
80
|
-
"test": "7.17.
|
|
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",
|