@spscommerce/ds-react 6.37.1 → 6.37.2
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 +2 -2
- package/lib/index.es.js +11 -6
- package/package.json +9 -9
package/lib/index.cjs.js
CHANGED
|
@@ -833,7 +833,7 @@
|
|
|
833
833
|
</div>
|
|
834
834
|
</SpsCardV2Footer>
|
|
835
835
|
</SpsCardV2>
|
|
836
|
-
`}}}},py={checked:"boolean",disabled:"boolean",formMeta:"SpsFormFieldMeta<boolean>",indeterminate:"boolean",inline:"boolean",label:"string",onChange:"ChangeEventHandler"},uy=G(N({},z),{checked:E.exports.bool,disabled:E.exports.bool,formControl:ce(),formMeta:ce(),indeterminate:E.exports.bool,inline:E.exports.bool,label:E.exports.string,onChange:te()});function Nn(S){var T=S,{checked:e,className:t,disabled:n,formControl:s,formMeta:o,id:i,indeterminate:l,inline:c,label:p,onChange:m,"data-testid":f,unsafelyReplaceClassName:u}=T,g=q(T,["checked","className","disabled","formControl","formMeta","id","indeterminate","inline","label","onChange","data-testid","unsafelyReplaceClassName"]);const x=o||s,w=a.useRef(),[D,I]=a.useState(e),[v,k]=a.useState(l),{wrapperId:M,controlId:_}=Tt(i,x);a.useEffect(()=>I(e),[e]),a.useEffect(()=>k(l),[l]),a.useEffect(()=>{w.current.indeterminate=v},[v]);const R=K(u||"sps-checkbox","sps-checkable",c&&"sps-checkable--inline",!p&&"sps-checkable--no-label",t);function O(F){I(F.target.checked),k(!1),x&&(x.setValue(F.target.checked),x.markAsDirty()),m&&m(F),w.current.focus()}return a.createElement(it,{id:M,className:R,formControl:s,formMeta:o,inputRef:w,"data-testid":f},a.createElement("input",N({type:"checkbox",ref:w,className:"sps-checkable__input",id:_,checked:D,disabled:n,"data-
|
|
836
|
+
`}}}},py={checked:"boolean",disabled:"boolean",formMeta:"SpsFormFieldMeta<boolean>",indeterminate:"boolean",inline:"boolean",label:"string",onChange:"ChangeEventHandler"},uy=G(N({},z),{checked:E.exports.bool,disabled:E.exports.bool,formControl:ce(),formMeta:ce(),indeterminate:E.exports.bool,inline:E.exports.bool,label:E.exports.string,onChange:te()});function Nn(S){var T=S,{checked:e,className:t,disabled:n,formControl:s,formMeta:o,id:i,indeterminate:l,inline:c,label:p,onChange:m,"data-testid":f,unsafelyReplaceClassName:u}=T,g=q(T,["checked","className","disabled","formControl","formMeta","id","indeterminate","inline","label","onChange","data-testid","unsafelyReplaceClassName"]);const x=o||s,w=a.useRef(),[D,I]=a.useState(e),[v,k]=a.useState(l),{wrapperId:M,controlId:_}=Tt(i,x);a.useEffect(()=>I(e),[e]),a.useEffect(()=>k(l),[l]),a.useEffect(()=>{w.current.indeterminate=v},[v]);const R=K(u||"sps-checkbox","sps-checkable",c&&"sps-checkable--inline",!p&&"sps-checkable--no-label",t);function O(F){I(F.target.checked),k(!1),x&&(x.setValue(F.target.checked),x.markAsDirty()),m&&m(F),w.current.focus()}return a.createElement(it,{id:M,className:R,formControl:s,formMeta:o,inputRef:w,"data-testid":f},a.createElement("input",N({type:"checkbox",ref:w,className:"sps-checkable__input",id:_,checked:D,disabled:n,"data-testid":`${f}__checkbox-input`,onChange:O},g)),a.createElement("label",{className:"sps-checkable__label",htmlFor:_},p||""))}Object.assign(Nn,{props:py,propTypes:uy,displayName:"SpsCheckbox"});const dd={labels:{label:"Labels",description:y.code`
|
|
837
837
|
<p>An individual checkbox should be labeled with its own <code>label</code> prop,
|
|
838
838
|
not the <code><SpsLabel></code> component.</p>
|
|
839
839
|
`,examples:{label:{react:y.code`
|
|
@@ -2432,7 +2432,7 @@ var s=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
2432
2432
|
</SpsTable>
|
|
2433
2433
|
)
|
|
2434
2434
|
}
|
|
2435
|
-
`}}}},TD={checked:"boolean",onChange:"ChangeEventHandler",indeterminate:"boolean",disabled:"boolean",options:"Array<SpsActionMethod | [SpsActionDescriptor, () => void]>"},ED=G(N({},z),{checked:E.exports.bool,onChange:te(),indeterminate:E.exports.bool,options:E.exports.arrayOf(E.exports.oneOfType([E.exports.func,E.exports.any])).isRequired,disabled:E.exports.bool});function vi(e){const
|
|
2435
|
+
`}}}},TD={checked:"boolean",onChange:"ChangeEventHandler",indeterminate:"boolean",disabled:"boolean",options:"Array<SpsActionMethod | [SpsActionDescriptor, () => void]>"},ED=G(N({},z),{checked:E.exports.bool,onChange:te(),indeterminate:E.exports.bool,options:E.exports.arrayOf(E.exports.oneOfType([E.exports.func,E.exports.any])).isRequired,disabled:E.exports.bool});function vi(e){const f=e,{options:t,className:n,checked:s,onChange:o,indeterminate:i,disabled:l,"data-testid":c}=f,p=q(f,["options","className","checked","onChange","indeterminate","disabled","data-testid"]),m=K("sps-checkbox-dropdown",n);return a.createElement("span",N({className:m,"data-testid":c},p),a.createElement(Nn,{indeterminate:i,checked:s,disabled:l,onChange:o,inline:!0,"data-testid":`${c}__checkbox`}),a.createElement(Dn,{disabled:l,options:t,icon:L.SpsIcon.CHEVRON_DOWN,"data-testid":`${c}__dropdown`}))}Object.assign(vi,{props:TD,propTypes:ED,displayName:"SpsCheckboxDropdown"});const wD={kind:"FeedbackBlockKind"},CD=G(N({},z),{kind:ve(L.FeedbackBlockKind)});function yi(e){const p=e,{children:t,className:n,kind:s=L.FeedbackBlockKind.TIP,"data-testid":o,unsafelyReplaceClassName:i}=p,l=q(p,["children","className","kind","data-testid","unsafelyReplaceClassName"]),c=K(i||"sps-feedback-block",`sps-feedback-block--${s}`,n);return a.createElement("div",N({className:c,role:"alert","data-testid":o},l),a.createElement("i",{className:K("sps-icon",`sps-icon-${L.FeedbackBlockIcons[s]}`),"aria-hidden":"true"}),a.createElement("span",{className:"sps-feedback-block__content","data-testid":`${o}__text`},t))}Object.assign(yi,{props:wD,propTypes:CD,displayName:"SpsFeedbackBlock"});const Gu={standard:{label:"Standard Size",description:"Use Standard Size Feedback Blocks for the majority of cases. If a smaller or more subtle solution is needed, use the Micro Size Feedback Block.",examples:{error:{description:"Error",jsx:y.code`
|
|
2436
2436
|
<SpsFeedbackBlock kind={FeedbackBlockKind.ERROR}>
|
|
2437
2437
|
We are experiencing difficulties communicating to the server. Please try again later.
|
|
2438
2438
|
</SpsFeedbackBlock>
|
package/lib/index.es.js
CHANGED
|
@@ -6443,7 +6443,7 @@ function SpsCheckbox(_q) {
|
|
|
6443
6443
|
id: controlId,
|
|
6444
6444
|
checked,
|
|
6445
6445
|
disabled,
|
|
6446
|
-
"data-
|
|
6446
|
+
"data-testid": `${testId}__checkbox-input`,
|
|
6447
6447
|
onChange: handleChange
|
|
6448
6448
|
}, rest)), /* @__PURE__ */ React.createElement("label", {
|
|
6449
6449
|
className: "sps-checkable__label",
|
|
@@ -23095,28 +23095,33 @@ function SpsCheckboxDropdown(props2) {
|
|
|
23095
23095
|
checked,
|
|
23096
23096
|
onChange,
|
|
23097
23097
|
indeterminate,
|
|
23098
|
-
disabled
|
|
23098
|
+
disabled,
|
|
23099
|
+
"data-testid": testId
|
|
23099
23100
|
} = _a, rest = __objRest(_a, [
|
|
23100
23101
|
"options",
|
|
23101
23102
|
"className",
|
|
23102
23103
|
"checked",
|
|
23103
23104
|
"onChange",
|
|
23104
23105
|
"indeterminate",
|
|
23105
|
-
"disabled"
|
|
23106
|
+
"disabled",
|
|
23107
|
+
"data-testid"
|
|
23106
23108
|
]);
|
|
23107
23109
|
const classes = clsx("sps-checkbox-dropdown", className);
|
|
23108
23110
|
return /* @__PURE__ */ React.createElement("span", __spreadValues({
|
|
23109
|
-
className: classes
|
|
23111
|
+
className: classes,
|
|
23112
|
+
"data-testid": testId
|
|
23110
23113
|
}, rest), /* @__PURE__ */ React.createElement(SpsCheckbox, {
|
|
23111
23114
|
indeterminate,
|
|
23112
23115
|
checked,
|
|
23113
23116
|
disabled,
|
|
23114
23117
|
onChange,
|
|
23115
|
-
inline: true
|
|
23118
|
+
inline: true,
|
|
23119
|
+
"data-testid": `${testId}__checkbox`
|
|
23116
23120
|
}), /* @__PURE__ */ React.createElement(SpsDropdown, {
|
|
23117
23121
|
disabled,
|
|
23118
23122
|
options,
|
|
23119
|
-
icon: SpsIcon.CHEVRON_DOWN
|
|
23123
|
+
icon: SpsIcon.CHEVRON_DOWN,
|
|
23124
|
+
"data-testid": `${testId}__dropdown`
|
|
23120
23125
|
}));
|
|
23121
23126
|
}
|
|
23122
23127
|
Object.assign(SpsCheckboxDropdown, {
|
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": "6.37.
|
|
4
|
+
"version": "6.37.2",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-react",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "6.37.
|
|
32
|
-
"@spscommerce/ds-illustrations": "6.37.
|
|
33
|
-
"@spscommerce/ds-shared": "6.37.
|
|
34
|
-
"@spscommerce/positioning": "6.37.
|
|
31
|
+
"@spscommerce/ds-colors": "6.37.2",
|
|
32
|
+
"@spscommerce/ds-illustrations": "6.37.2",
|
|
33
|
+
"@spscommerce/ds-shared": "6.37.2",
|
|
34
|
+
"@spscommerce/positioning": "6.37.2",
|
|
35
35
|
"@spscommerce/utils": "^6.11.3",
|
|
36
36
|
"moment": "^2.25.3",
|
|
37
37
|
"moment-timezone": "^0.5.28",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@react-stately/collections": "^3.3.3",
|
|
43
|
-
"@spscommerce/ds-colors": "6.37.
|
|
44
|
-
"@spscommerce/ds-illustrations": "6.37.
|
|
45
|
-
"@spscommerce/ds-shared": "6.37.
|
|
46
|
-
"@spscommerce/positioning": "6.37.
|
|
43
|
+
"@spscommerce/ds-colors": "6.37.2",
|
|
44
|
+
"@spscommerce/ds-illustrations": "6.37.2",
|
|
45
|
+
"@spscommerce/ds-shared": "6.37.2",
|
|
46
|
+
"@spscommerce/positioning": "6.37.2",
|
|
47
47
|
"@spscommerce/utils": "^6.11.3",
|
|
48
48
|
"@testing-library/react": "^10.4.0",
|
|
49
49
|
"@types/prop-types": "^15.7.1",
|