@spscommerce/ds-react 5.28.1 → 5.30.0
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 +10 -6
- package/lib/tile-list/SpsTile.d.ts +1 -0
- package/package.json +11 -11
package/lib/index.cjs.js
CHANGED
|
@@ -7924,7 +7924,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
7924
7924
|
</div>
|
|
7925
7925
|
);
|
|
7926
7926
|
}
|
|
7927
|
-
`}}}},P_={href:"string",icon:{type:"ReactNodeOrRenderFn",required:"true"},error:"boolean",title:{type:"string",required:"true"},warning:"boolean"},A_=$(I({},q),{href:T.exports.string,target:T.exports.string,icon:Nt.isRequired,error:T.exports.bool,title:T.exports.string.isRequired,warning:T.exports.bool});function El(e){const
|
|
7927
|
+
`}}}},P_={href:"string",icon:{type:"ReactNodeOrRenderFn",required:"true"},error:"boolean",title:{type:"string",required:"true"},warning:"boolean",disabled:"boolean"},A_=$(I({},q),{href:T.exports.string,target:T.exports.string,icon:Nt.isRequired,error:T.exports.bool,title:T.exports.string.isRequired,warning:T.exports.bool,disabled:T.exports.bool});function El(e){const g=e,{className:t,href:n,target:a,icon:r,error:i=!1,title:l,unsafelyReplaceClassName:c,warning:p=!1,disabled:u=!1}=g,f=Z(g,["className","href","target","icon","error","title","unsafelyReplaceClassName","warning","disabled"]),m=A(c||"sps-tile",t,i&&"sps-tile--error",p&&"sps-tile--warning",u&&"sps-tile--disabled");return s.useEffect(()=>{if(p&&i)throw new Error("Tile should have warning or error, not both")},[p,i]),s.createElement("div",{className:"sps-tile-container sfg-col-3 sfg-break-col-6"},s.createElement("a",I({className:m,href:u?void 0:n,target:a,rel:a==="_blank"?"noopener noreferrer":void 0},f),(p||i)&&s.createElement("div",{className:"sps-tile--icon"},p&&s.createElement("i",{className:A("sps-icon","sps-icon-status-warning")}),i&&s.createElement("i",{className:A("sps-icon","sps-icon-ban")})),s.createElement("div",{className:"sps-tile--content"},s.createElement("div",{className:"sps-tile--image"},typeof r=="string"?s.createElement("img",{className:"sps-tile--image",src:r,alt:""}):At(r)),s.createElement("div",{className:"sps-tile--title"},s.createElement("p",null,l,a==="_blank"&&s.createElement("i",{className:A("sps-icon","sps-icon-tabs")}))))))}Object.assign(El,{props:P_,propTypes:A_,displayName:"SpsTile"});const F_={},K_=I({},q);function xl(e){const c=e,{children:t,unsafelyReplaceClassName:n,"data-testid":a,className:r}=c,i=Z(c,["children","unsafelyReplaceClassName","data-testid","className"]),l=A(n||"sps-tile-list",r||"sfg-row");return s.createElement("div",I({className:l},i),t)}Object.assign(xl,{props:F_,propTypes:K_,displayName:"SpsTileList"});const Zf={basic:{label:"Basic",examples:{basic:{react:x.code`
|
|
7928
7928
|
function Component() {
|
|
7929
7929
|
const apps = [
|
|
7930
7930
|
{
|
package/lib/index.es.js
CHANGED
|
@@ -35380,7 +35380,8 @@ const propsDoc$t = {
|
|
|
35380
35380
|
icon: { type: "ReactNodeOrRenderFn", required: "true" },
|
|
35381
35381
|
error: "boolean",
|
|
35382
35382
|
title: { type: "string", required: "true" },
|
|
35383
|
-
warning: "boolean"
|
|
35383
|
+
warning: "boolean",
|
|
35384
|
+
disabled: "boolean"
|
|
35384
35385
|
};
|
|
35385
35386
|
const propTypes$v = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
35386
35387
|
href: propTypes$1O.exports.string,
|
|
@@ -35388,7 +35389,8 @@ const propTypes$v = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
|
35388
35389
|
icon: nodeOrRenderFn.isRequired,
|
|
35389
35390
|
error: propTypes$1O.exports.bool,
|
|
35390
35391
|
title: propTypes$1O.exports.string.isRequired,
|
|
35391
|
-
warning: propTypes$1O.exports.bool
|
|
35392
|
+
warning: propTypes$1O.exports.bool,
|
|
35393
|
+
disabled: propTypes$1O.exports.bool
|
|
35392
35394
|
});
|
|
35393
35395
|
function SpsTile(props2) {
|
|
35394
35396
|
const _a = props2, {
|
|
@@ -35399,7 +35401,8 @@ function SpsTile(props2) {
|
|
|
35399
35401
|
error = false,
|
|
35400
35402
|
title,
|
|
35401
35403
|
unsafelyReplaceClassName,
|
|
35402
|
-
warning = false
|
|
35404
|
+
warning = false,
|
|
35405
|
+
disabled = false
|
|
35403
35406
|
} = _a, rest = __objRest(_a, [
|
|
35404
35407
|
"className",
|
|
35405
35408
|
"href",
|
|
@@ -35408,9 +35411,10 @@ function SpsTile(props2) {
|
|
|
35408
35411
|
"error",
|
|
35409
35412
|
"title",
|
|
35410
35413
|
"unsafelyReplaceClassName",
|
|
35411
|
-
"warning"
|
|
35414
|
+
"warning",
|
|
35415
|
+
"disabled"
|
|
35412
35416
|
]);
|
|
35413
|
-
const classes = clsx(unsafelyReplaceClassName || "sps-tile", className, error && "sps-tile--error", warning && "sps-tile--warning");
|
|
35417
|
+
const classes = clsx(unsafelyReplaceClassName || "sps-tile", className, error && "sps-tile--error", warning && "sps-tile--warning", disabled && "sps-tile--disabled");
|
|
35414
35418
|
React.useEffect(() => {
|
|
35415
35419
|
if (warning && error) {
|
|
35416
35420
|
throw new Error("Tile should have warning or error, not both");
|
|
@@ -35420,7 +35424,7 @@ function SpsTile(props2) {
|
|
|
35420
35424
|
className: "sps-tile-container sfg-col-3 sfg-break-col-6"
|
|
35421
35425
|
}, /* @__PURE__ */ React.createElement("a", __spreadValues({
|
|
35422
35426
|
className: classes,
|
|
35423
|
-
href,
|
|
35427
|
+
href: disabled ? void 0 : href,
|
|
35424
35428
|
target,
|
|
35425
35429
|
rel: target === "_blank" ? "noopener noreferrer" : void 0
|
|
35426
35430
|
}, rest), (warning || error) && /* @__PURE__ */ React.createElement("div", {
|
|
@@ -6,6 +6,7 @@ declare const propTypes: {
|
|
|
6
6
|
error: PropTypes.Requireable<boolean>;
|
|
7
7
|
title: PropTypes.Validator<string>;
|
|
8
8
|
warning: PropTypes.Requireable<boolean>;
|
|
9
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
9
10
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
10
11
|
className: PropTypes.Requireable<string>;
|
|
11
12
|
"data-testid": PropTypes.Requireable<string>;
|
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": "5.
|
|
4
|
+
"version": "5.30.0",
|
|
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,11 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "5.
|
|
32
|
-
"@spscommerce/ds-illustrations": "5.
|
|
33
|
-
"@spscommerce/ds-shared": "5.
|
|
34
|
-
"@spscommerce/positioning": "5.
|
|
35
|
-
"@spscommerce/utils": "5.
|
|
31
|
+
"@spscommerce/ds-colors": "5.30.0",
|
|
32
|
+
"@spscommerce/ds-illustrations": "5.30.0",
|
|
33
|
+
"@spscommerce/ds-shared": "5.30.0",
|
|
34
|
+
"@spscommerce/positioning": "5.30.0",
|
|
35
|
+
"@spscommerce/utils": "5.30.0",
|
|
36
36
|
"moment": "^2.25.3",
|
|
37
37
|
"moment-timezone": "^0.5.28",
|
|
38
38
|
"react": "^16.9.0",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@react-stately/collections": "^3.3.3",
|
|
43
|
-
"@spscommerce/ds-colors": "5.
|
|
44
|
-
"@spscommerce/ds-illustrations": "5.
|
|
45
|
-
"@spscommerce/ds-shared": "5.
|
|
46
|
-
"@spscommerce/positioning": "5.
|
|
47
|
-
"@spscommerce/utils": "5.
|
|
43
|
+
"@spscommerce/ds-colors": "5.30.0",
|
|
44
|
+
"@spscommerce/ds-illustrations": "5.30.0",
|
|
45
|
+
"@spscommerce/ds-shared": "5.30.0",
|
|
46
|
+
"@spscommerce/positioning": "5.30.0",
|
|
47
|
+
"@spscommerce/utils": "5.30.0",
|
|
48
48
|
"@testing-library/react": "^9.3.2",
|
|
49
49
|
"@types/prop-types": "^15.7.1",
|
|
50
50
|
"@types/react": "^16.9.0",
|