@spscommerce/ds-react 5.33.2 → 5.33.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 +1 -1
- package/lib/index.es.js +5 -5
- package/lib/product-bar/SpsProductBar.d.ts +1 -1
- package/package.json +11 -11
package/lib/index.cjs.js
CHANGED
|
@@ -5967,7 +5967,7 @@ var a=n.defineLocale("zh-tw",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u5
|
|
|
5967
5967
|
function Component() {
|
|
5968
5968
|
return <SpsPageSelector numPages={25} onPageChange={() => {}} disabled />;
|
|
5969
5969
|
}
|
|
5970
|
-
`}}}},a_={active:"boolean",as:"React.ElementType"};function Pr(e){const p=e,{active:t,as:n="a",children:a,className:r,unsafelyReplaceClassName:i}=p,l=J(p,["active","as","children","className","unsafelyReplaceClassName"]),c=A(i||"sps-nav__item","sps-nav__link",t&&"active");return s.createElement(n,I({className:c},l),a)}Object.assign(Pr,{props:a_,displayName:"SpsProductBarTab"});const s_={activeTab:"string",fullWidth:"boolean",onTabChange:"(newTab: string) => void",onProductNameClick:"React.MouseEventHandler",productLogoSrc:"string",productName:
|
|
5970
|
+
`}}}},a_={active:"boolean",as:"React.ElementType"};function Pr(e){const p=e,{active:t,as:n="a",children:a,className:r,unsafelyReplaceClassName:i}=p,l=J(p,["active","as","children","className","unsafelyReplaceClassName"]),c=A(i||"sps-nav__item","sps-nav__link",t&&"active");return s.createElement(n,I({className:c},l),a)}Object.assign(Pr,{props:a_,displayName:"SpsProductBarTab"});const s_={activeTab:"string",fullWidth:"boolean",onTabChange:"(newTab: string) => void",onProductNameClick:"React.MouseEventHandler",productLogoSrc:"string",productName:"string",productNameHref:"string",tabs:"Array<string>"},r_=$(I({},q),{activeTab:T.exports.string,fullWidth:T.exports.bool,onTabChange:oe(),onProductNameClick:oe(),productLogoSrc:T.exports.string,productName:T.exports.string,productNameHref:T.exports.string,tabs:T.exports.arrayOf(T.exports.string)});function ul(e){const N=e,{activeTab:t,children:n,className:a,fullWidth:r,onProductNameClick:i,onTabChange:l,productLogoSrc:c,productName:p,productNameHref:u,tabs:f=[],unsafelyReplaceClassName:m}=N,g=J(N,["activeTab","children","className","fullWidth","onProductNameClick","onTabChange","productLogoSrc","productName","productNameHref","tabs","unsafelyReplaceClassName"]),v=s.useRef(),[C,D]=Vt(n,[{type:Pr}]),[S,w]=s.useState(t||f[0]);s.useEffect(()=>{w(t)},[t]);function E(_){w(_),l&&l(_)}const y=A(m||"sps-navbar-container","z-stratum-bar",a);return s.createElement("div",$(I({className:y},g),{ref:v}),s.createElement("nav",{className:A("sps-navbar","sps-navbar--expand-lg",r&&"sps-navbar--full-width")},p||c?s.createElement(s.Fragment,null,s.createElement("a",{className:"sps-navbar__brand",href:u,onClick:i},c&&s.createElement("img",{className:"sps-navbar__brand-logo",src:c,"aria-hidden":"true",alt:`${p} Logo`}),p&&s.createElement("span",{className:"sps-navbar__brand-name"},p)),s.createElement("span",{className:"sps-vertical-rule"})):null,s.createElement("div",{className:"sps-navbar__nav"},f.map(_=>s.createElement("a",{className:A("sps-nav__item","sps-nav__link",_===S&&"active"),key:_,onClick:()=>E(_)},s.createElement("span",null,_),_===S&&s.createElement("span",{className:"sr-only"},"(current)"))),C),s.createElement("div",{className:"sps-navbar__content"},s.createElement(It.Provider,{value:{parentElementRef:v,fixed:!0}},D))))}Object.assign(ul,{props:s_,propTypes:r_,displayName:"SpsProductBar"});const Lf={basic:{label:"Basic",description:x.code`
|
|
5971
5971
|
<p>Product navigation bar</p>
|
|
5972
5972
|
`,examples:{basic:{react:x.code`
|
|
5973
5973
|
function DemoComponent() {
|
package/lib/index.es.js
CHANGED
|
@@ -31398,7 +31398,7 @@ const propsDoc$I = {
|
|
|
31398
31398
|
onTabChange: "(newTab: string) => void",
|
|
31399
31399
|
onProductNameClick: "React.MouseEventHandler",
|
|
31400
31400
|
productLogoSrc: "string",
|
|
31401
|
-
productName:
|
|
31401
|
+
productName: "string",
|
|
31402
31402
|
productNameHref: "string",
|
|
31403
31403
|
tabs: "Array<string>"
|
|
31404
31404
|
};
|
|
@@ -31408,7 +31408,7 @@ const propTypes$L = __spreadProps(__spreadValues({}, spsGlobalPropTypes), {
|
|
|
31408
31408
|
onTabChange: fun(),
|
|
31409
31409
|
onProductNameClick: fun(),
|
|
31410
31410
|
productLogoSrc: propTypes$1O.exports.string,
|
|
31411
|
-
productName: propTypes$1O.exports.string
|
|
31411
|
+
productName: propTypes$1O.exports.string,
|
|
31412
31412
|
productNameHref: propTypes$1O.exports.string,
|
|
31413
31413
|
tabs: propTypes$1O.exports.arrayOf(propTypes$1O.exports.string)
|
|
31414
31414
|
});
|
|
@@ -31457,7 +31457,7 @@ function SpsProductBar(props2) {
|
|
|
31457
31457
|
ref: rootElement
|
|
31458
31458
|
}), /* @__PURE__ */ React.createElement("nav", {
|
|
31459
31459
|
className: clsx("sps-navbar", "sps-navbar--expand-lg", fullWidth && "sps-navbar--full-width")
|
|
31460
|
-
}, /* @__PURE__ */ React.createElement("a", {
|
|
31460
|
+
}, productName || productLogoSrc ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("a", {
|
|
31461
31461
|
className: "sps-navbar__brand",
|
|
31462
31462
|
href: productNameHref,
|
|
31463
31463
|
onClick: onProductNameClick
|
|
@@ -31466,11 +31466,11 @@ function SpsProductBar(props2) {
|
|
|
31466
31466
|
src: productLogoSrc,
|
|
31467
31467
|
"aria-hidden": "true",
|
|
31468
31468
|
alt: `${productName} Logo`
|
|
31469
|
-
}), /* @__PURE__ */ React.createElement("span", {
|
|
31469
|
+
}), productName && /* @__PURE__ */ React.createElement("span", {
|
|
31470
31470
|
className: "sps-navbar__brand-name"
|
|
31471
31471
|
}, productName)), /* @__PURE__ */ React.createElement("span", {
|
|
31472
31472
|
className: "sps-vertical-rule"
|
|
31473
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
31473
|
+
})) : null, /* @__PURE__ */ React.createElement("div", {
|
|
31474
31474
|
className: "sps-navbar__nav"
|
|
31475
31475
|
}, tabs.map((tab2) => /* @__PURE__ */ React.createElement("a", {
|
|
31476
31476
|
className: clsx("sps-nav__item", "sps-nav__link", tab2 === activeTab && "active"),
|
|
@@ -6,7 +6,7 @@ declare const propTypes: {
|
|
|
6
6
|
onTabChange: PropTypes.Requireable<(newTab: string) => void>;
|
|
7
7
|
onProductNameClick: PropTypes.Requireable<React.MouseEventHandler<Element>>;
|
|
8
8
|
productLogoSrc: PropTypes.Requireable<string>;
|
|
9
|
-
productName: PropTypes.
|
|
9
|
+
productName: PropTypes.Requireable<string>;
|
|
10
10
|
productNameHref: PropTypes.Requireable<string>;
|
|
11
11
|
tabs: PropTypes.Requireable<string[]>;
|
|
12
12
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
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.33.
|
|
4
|
+
"version": "5.33.3",
|
|
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.33.
|
|
32
|
-
"@spscommerce/ds-illustrations": "5.33.
|
|
33
|
-
"@spscommerce/ds-shared": "5.33.
|
|
34
|
-
"@spscommerce/positioning": "5.33.
|
|
35
|
-
"@spscommerce/utils": "5.33.
|
|
31
|
+
"@spscommerce/ds-colors": "5.33.3",
|
|
32
|
+
"@spscommerce/ds-illustrations": "5.33.3",
|
|
33
|
+
"@spscommerce/ds-shared": "5.33.3",
|
|
34
|
+
"@spscommerce/positioning": "5.33.3",
|
|
35
|
+
"@spscommerce/utils": "5.33.3",
|
|
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.33.
|
|
44
|
-
"@spscommerce/ds-illustrations": "5.33.
|
|
45
|
-
"@spscommerce/ds-shared": "5.33.
|
|
46
|
-
"@spscommerce/positioning": "5.33.
|
|
47
|
-
"@spscommerce/utils": "5.33.
|
|
43
|
+
"@spscommerce/ds-colors": "5.33.3",
|
|
44
|
+
"@spscommerce/ds-illustrations": "5.33.3",
|
|
45
|
+
"@spscommerce/ds-shared": "5.33.3",
|
|
46
|
+
"@spscommerce/positioning": "5.33.3",
|
|
47
|
+
"@spscommerce/utils": "5.33.3",
|
|
48
48
|
"@testing-library/react": "^9.3.2",
|
|
49
49
|
"@types/prop-types": "^15.7.1",
|
|
50
50
|
"@types/react": "^16.9.0",
|