@spscommerce/ds-react 8.4.8 → 8.4.9
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 +1 -1
- package/lib/index.es.js +5 -1
- package/package.json +12 -12
package/lib/index.cjs.js
CHANGED
|
@@ -2813,7 +2813,7 @@ var r=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
2813
2813
|
</SpsForm>
|
|
2814
2814
|
)
|
|
2815
2815
|
}
|
|
2816
|
-
`}}}},vN={disabled:"boolean",defaultValue:"number",min:"number",max:"number",step:"number",onValueChange:"(newValue: number) => void"};function Vi(e){const{autoComplete:t,disabled:n,defaultValue:r=0,min:a=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:l=1,onValueChange:c,unsafelyReplaceClassName:p,className:f,"data-testid":m,...u}=e,[h,g]=s.useState(Math.max(a,r)),[v,w]=s.useState(!1);s.useEffect(()=>{c&&typeof c=="function"&&c(h),w(h<a||h>o)},[h]);const T=()=>h<=a?!1:(h>o?g(o):g(I=>Math.max(I-l,a)),!0),E=()=>h>=o?!1:(h<a?g(a):g(I=>I+l),!0),N=I=>{I.target.value!==""&&g(parseInt(I.target.value,10))},x=p||H("sps-incrementor sps-input-group sps-input-group__append",f);return s.createElement("div",{className:x,...u,"data-testid":m},s.createElement("div",{className:"sps-button sps-button--icon"},s.createElement("button",{type:"button","data-testid":`${m}__minus`,onClick:T,disabled:n,"aria-label":`Subtract ${l}`},s.createElement("i",{className:"sps-icon sps-icon-minus","aria-hidden":"true"}))),s.createElement("div",{className:"sps-text-input"},s.createElement("input",{type:"text",className:H("sps-form-control",v&&"sps-input--error"),value:h,onChange:N,disabled:n,"data-testid":`${m}__input`,autoComplete:t})),s.createElement("div",{className:"sps-button sps-button--icon"},s.createElement("button",{type:"button","data-testid":`${m}__plus`,onClick:E,disabled:n,"aria-label":`Add ${l}`},s.createElement("i",{className:"sps-icon sps-icon-plus-sign","aria-hidden":"true"}))))}Object.assign(Vi,{props:vN,displayName:"SpsIncrementor"});const pm={stepExample:{label:"Incrementor",description:"info about incrementor",examples:{stacked:{react:y.code`
|
|
2816
|
+
`}}}},vN={disabled:"boolean",defaultValue:"number",min:"number",max:"number",step:"number",onValueChange:"(newValue: number) => void"};function Vi(e){const{autoComplete:t,disabled:n,defaultValue:r=0,min:a=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:l=1,onValueChange:c,unsafelyReplaceClassName:p,className:f,"data-testid":m,...u}=e,[h,g]=s.useState(Math.max(a,r));s.useEffect(()=>{g(Math.max(a,r))},[r]);const[v,w]=s.useState(!1);s.useEffect(()=>{c&&typeof c=="function"&&c(h),w(h<a||h>o)},[h]);const T=()=>h<=a?!1:(h>o?g(o):g(I=>Math.max(I-l,a)),!0),E=()=>h>=o?!1:(h<a?g(a):g(I=>I+l),!0),N=I=>{I.target.value!==""&&g(parseInt(I.target.value,10))},x=p||H("sps-incrementor sps-input-group sps-input-group__append",f);return s.createElement("div",{className:x,...u,"data-testid":m},s.createElement("div",{className:"sps-button sps-button--icon"},s.createElement("button",{type:"button","data-testid":`${m}__minus`,onClick:T,disabled:n,"aria-label":`Subtract ${l}`},s.createElement("i",{className:"sps-icon sps-icon-minus","aria-hidden":"true"}))),s.createElement("div",{className:"sps-text-input"},s.createElement("input",{type:"text",className:H("sps-form-control",v&&"sps-input--error"),value:h,onChange:N,disabled:n,"data-testid":`${m}__input`,autoComplete:t})),s.createElement("div",{className:"sps-button sps-button--icon"},s.createElement("button",{type:"button","data-testid":`${m}__plus`,onClick:E,disabled:n,"aria-label":`Add ${l}`},s.createElement("i",{className:"sps-icon sps-icon-plus-sign","aria-hidden":"true"}))))}Object.assign(Vi,{props:vN,displayName:"SpsIncrementor"});const pm={stepExample:{label:"Incrementor",description:"info about incrementor",examples:{stacked:{react:y.code`
|
|
2817
2817
|
import { SpsIncrementor } from "@spscommerce/ds-react";
|
|
2818
2818
|
function Component () {
|
|
2819
2819
|
const [value, setValue] = React.useState("");
|
package/lib/index.es.js
CHANGED
|
@@ -17988,7 +17988,11 @@ function Tu(e) {
|
|
|
17988
17988
|
className: f,
|
|
17989
17989
|
"data-testid": m,
|
|
17990
17990
|
...u
|
|
17991
|
-
} = e, [h, g] = s.useState(Math.max(a, r))
|
|
17991
|
+
} = e, [h, g] = s.useState(Math.max(a, r));
|
|
17992
|
+
s.useEffect(() => {
|
|
17993
|
+
g(Math.max(a, r));
|
|
17994
|
+
}, [r]);
|
|
17995
|
+
const [v, w] = s.useState(!1);
|
|
17992
17996
|
s.useEffect(() => {
|
|
17993
17997
|
c && typeof c == "function" && c(h), w(h < a || h > o);
|
|
17994
17998
|
}, [h]);
|
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": "8.4.
|
|
4
|
+
"version": "8.4.9",
|
|
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": "8.4.
|
|
50
|
-
"@sps-woodland/tabs": "8.4.
|
|
51
|
-
"@spscommerce/ds-colors": "8.4.
|
|
52
|
-
"@spscommerce/ds-shared": "8.4.
|
|
53
|
-
"@spscommerce/positioning": "8.4.
|
|
49
|
+
"@sps-woodland/illustrations": "8.4.9",
|
|
50
|
+
"@sps-woodland/tabs": "8.4.9",
|
|
51
|
+
"@spscommerce/ds-colors": "8.4.9",
|
|
52
|
+
"@spscommerce/ds-shared": "8.4.9",
|
|
53
|
+
"@spscommerce/positioning": "8.4.9"
|
|
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": "8.4.
|
|
76
|
-
"@sps-woodland/tabs": "8.4.
|
|
77
|
-
"@spscommerce/ds-colors": "8.4.
|
|
78
|
-
"@spscommerce/ds-shared": "8.4.
|
|
79
|
-
"@spscommerce/positioning": "8.4.
|
|
80
|
-
"test": "8.4.
|
|
75
|
+
"@sps-woodland/illustrations": "8.4.9",
|
|
76
|
+
"@sps-woodland/tabs": "8.4.9",
|
|
77
|
+
"@spscommerce/ds-colors": "8.4.9",
|
|
78
|
+
"@spscommerce/ds-shared": "8.4.9",
|
|
79
|
+
"@spscommerce/positioning": "8.4.9",
|
|
80
|
+
"test": "8.4.9"
|
|
81
81
|
},
|
|
82
82
|
"scripts": {
|
|
83
83
|
"build": "pnpm run build:js && pnpm run build:types",
|