@sps-woodland/product-bar 8.45.2 → 8.45.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.js +2 -2
- package/lib/index.umd.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -1247,7 +1247,7 @@ var zr = (e, t, r) => {
|
|
|
1247
1247
|
for (var [$, g] of e.compoundVariants)
|
|
1248
1248
|
zr($, o, e.defaultVariants) && (r += " " + g);
|
|
1249
1249
|
return r;
|
|
1250
|
-
}, Rr = "pkg_sps-woodland_product-
|
|
1250
|
+
}, Rr = "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg110", Vr = ht({ defaultClassName: "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg111", variantClassNames: { fullWidth: { true: "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg112", false: "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg113" } }, defaultVariants: { fullWidth: !1 }, compoundVariants: [] }), Ur = "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg114", Hr = "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg115", jr = "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg116", Gr = "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg117", Wr = ht({ defaultClassName: "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg118", variantClassNames: { active: { true: "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg119", false: "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11a" }, disabled: { true: "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11b", false: "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11c" } }, defaultVariants: { active: !1, disabled: !1 }, compoundVariants: [] }), Yr = "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11d", Xr = "pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11e";
|
|
1251
1251
|
function De(e) {
|
|
1252
1252
|
const t = E.useRef(null), { linkProps: r } = Fr(e, t), { active: o, ...i } = e, s = {
|
|
1253
1253
|
...i,
|
|
@@ -1310,7 +1310,7 @@ pe.set(Pt, {
|
|
|
1310
1310
|
fullWidth: { type: "boolean" }
|
|
1311
1311
|
}
|
|
1312
1312
|
});
|
|
1313
|
-
var qr = "pkg_sps-woodland_product-
|
|
1313
|
+
var qr = "pkg_sps-woodland_product-bar__version_8_45_3__hash_r7f8id0", Jr = "pkg_sps-woodland_product-bar__version_8_45_3__hash_r7f8id1";
|
|
1314
1314
|
function Et({
|
|
1315
1315
|
channelId: e,
|
|
1316
1316
|
className: t,
|
package/lib/index.umd.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
touch-action: pan-x pan-y pinch-zoom;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
`.trim(),n.head.prepend(u)},[R]),p.useEffect(()=>{let n=L.current;return()=>{var u;P||Te((u=n.target)!==null&&u!==void 0?u:void 0);for(let a of n.disposables)a();n.disposables=[]}},[P]),{isPressed:f||xe,pressProps:j(Ce,Gr,{[rt]:!0})}}function _e(e){return e.tagName==="A"&&e.hasAttribute("href")}function we(e,t){const{key:r,code:o}=e,i=t,s=i.getAttribute("role");return(r==="Enter"||r===" "||r==="Spacebar"||o==="Space")&&!(i instanceof C(i).HTMLInputElement&&!it(i,r)||i instanceof C(i).HTMLTextAreaElement||i.isContentEditable)&&!((s==="link"||!s&&_e(i))&&r!=="Enter")}function ur(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function nt(e,t){const r=e.changedTouches;for(let o=0;o<r.length;o++){const i=r[o];if(i.identifier===t)return i}return null}function K(e,t){let r=0,o=0;return t.targetTouches&&t.targetTouches.length===1&&(r=t.targetTouches[0].clientX,o=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:o}}function D(e,t){let r=t.clientX,o=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:o,key:t.key}}function dr(e){let t=0,r=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?r=e.height/2:e.radiusY!==void 0&&(r=e.radiusY),{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function fr(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function ot(e,t){let r=t.getBoundingClientRect(),o=dr(e);return fr(r,o)}function pr(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!_e(e)}function at(e,t){return e instanceof HTMLInputElement?!it(e,t):pr(e)}const br=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function it(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":br.has(e.type)}let X=null;const vr=new Set;let q=new Map,F=!1,ke=!1;function Se(e,t){for(let r of vr)r(e,t)}function gr(e){return!(e.metaKey||!G()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function le(e){F=!0,!M.isOpening&&gr(e)&&(X="keyboard",Se("keyboard",e))}function w(e){X="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(F=!0,Se("pointer",e))}function st(e){!M.isOpening&&Pe(e)&&(F=!0,X="virtual")}function lt(e){v(e)===window||v(e)===document||oe||!e.isTrusted||(!F&&!ke&&(X="virtual",Se("virtual",e)),F=!1,ke=!1)}function ct(){oe||(F=!1,ke=!0)}function ut(e){if(typeof window>"u"||typeof document>"u"||q.get(C(e)))return;const t=C(e),r=T(e);let o=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){F=!0,o.apply(this,arguments)},r.addEventListener("keydown",le,!0),r.addEventListener("keyup",le,!0),r.addEventListener("click",st,!0),t.addEventListener("focus",lt,!0),t.addEventListener("blur",ct,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",w,!0),r.addEventListener("pointermove",w,!0),r.addEventListener("pointerup",w,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",w,!0),r.addEventListener("mousemove",w,!0),r.addEventListener("mouseup",w,!0)),t.addEventListener("beforeunload",()=>{dt(e)},{once:!0}),q.set(t,{focus:o})}const dt=(e,t)=>{const r=C(e),o=T(e);t&&o.removeEventListener("DOMContentLoaded",t),q.has(r)&&(r.HTMLElement.prototype.focus=q.get(r).focus,o.removeEventListener("keydown",le,!0),o.removeEventListener("keyup",le,!0),o.removeEventListener("click",st,!0),r.removeEventListener("focus",lt,!0),r.removeEventListener("blur",ct,!1),typeof PointerEvent<"u"?(o.removeEventListener("pointerdown",w,!0),o.removeEventListener("pointermove",w,!0),o.removeEventListener("pointerup",w,!0)):process.env.NODE_ENV==="test"&&(o.removeEventListener("mousedown",w,!0),o.removeEventListener("mousemove",w,!0),o.removeEventListener("mouseup",w,!0)),q.delete(r))};function $r(e){const t=T(e);let r;return t.readyState!=="loading"?ut(e):(r=()=>{ut(e)},t.addEventListener("DOMContentLoaded",r)),()=>dt(e,r)}typeof document<"u"&&$r();function mr(){return X}function yr(e){if(!e.isConnected)return;const t=T(e);if(mr()==="virtual"){let r=U(t);He(()=>{const o=U(t);(o===r||o===t.body)&&e.isConnected&&H(e)})}else H(e)}function hr(e){let{isDisabled:t,onFocus:r,onBlur:o,onFocusChange:i}=e;const s=p.useCallback(f=>{if(v(f)===f.currentTarget)return o&&o(f),i&&i(!1),!0},[o,i]),l=rr(s),c=p.useCallback(f=>{let m=v(f);const $=T(m),P=$?U($):U();m===f.currentTarget&&m===P&&(r&&r(f),i&&i(!0),l(f))},[i,r,l]);return{focusProps:{onFocus:!t&&(r||i||o)?c:void 0,onBlur:!t&&(o||i)?s:void 0}}}function ft(e){if(!e)return;let t=!0;return r=>{let o={...r,preventDefault(){r.preventDefault()},isDefaultPrevented(){return r.isDefaultPrevented()},stopPropagation(){t&&process.env.NODE_ENV!=="production"?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(o),t&&r.stopPropagation()}}function Pr(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:ft(e.onKeyDown),onKeyUp:ft(e.onKeyUp)}}}let Er=p.createContext(null);function Tr(e){let t=p.useContext(Er)||{};Ge(t,e);let{ref:r,...o}=t;return o}function _r(e,t){let{focusProps:r}=hr(e),{keyboardProps:o}=Pr(e),i=j(r,o),s=Tr(t),l=e.isDisabled?{}:s,c=p.useRef(e.autoFocus);p.useEffect(()=>{c.current&&t.current&&yr(t.current),c.current=!1},[t]);let f=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(f=void 0),{focusableProps:j({...i,tabIndex:f},l)}}function wr(e,t){let{elementType:r="a",onPress:o,onPressStart:i,onPressEnd:s,onClick:l,isDisabled:c,...f}=e,m={};r!=="a"&&(m={role:"link",tabIndex:c?void 0:0});let{focusableProps:$}=_r(e,t),{pressProps:P,isPressed:R}=cr({onPress:o,onPressStart:i,onPressEnd:s,isDisabled:c,ref:t}),Ce=Ot(f,{labelable:!0}),xe=j($,P),J=Ue(),L=Ht(e);return{isPressed:R,linkProps:j(Ce,L,{...xe,...m,"aria-disabled":c||void 0,"aria-current":e["aria-current"],onClick:h=>{var B;(B=P.onClick)===null||B===void 0||B.call(P,h),l&&(l(h),console.warn("onClick is deprecated, please use onPress")),!J.isNative&&h.currentTarget instanceof HTMLAnchorElement&&h.currentTarget.href&&!h.isDefaultPrevented()&&Vt(h.currentTarget,h)&&e.href&&(h.preventDefault(),J.open(h.currentTarget,h,e.href,e.routerOptions))}})}}function kr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,o)}return r}function bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pt(Object(r),!0).forEach(function(o){kr(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}var Sr=(e,t,r)=>{for(var o of Object.keys(e)){var i;if(e[o]!==((i=t[o])!==null&&i!==void 0?i:r[o]))return!1}return!0},vt=e=>t=>{var r=e.defaultClassName,o=bt(bt({},e.defaultVariants),t);for(var i in o){var s,l=(s=o[i])!==null&&s!==void 0?s:e.defaultVariants[i];if(l!=null){var c=l;typeof c=="boolean"&&(c=c===!0?"true":"false");var f=e.variantClassNames[i][c];f&&(r+=" "+f)}}for(var[m,$]of e.compoundVariants)Sr(m,o,e.defaultVariants)&&(r+=" "+$);return r},Lr="pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg110",Br=vt({defaultClassName:"pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg111",variantClassNames:{fullWidth:{true:"pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg112",false:"pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg113"}},defaultVariants:{fullWidth:!1},compoundVariants:[]}),Cr="pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg114",xr="pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg115",Or="pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg116",Mr="pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg117",Nr=vt({defaultClassName:"pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg118",variantClassNames:{active:{true:"pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg119",false:"pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg11a"},disabled:{true:"pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg11b",false:"pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg11c"}},defaultVariants:{active:!1,disabled:!1},compoundVariants:[]}),Kr="pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg11d",Ar="pkg_sps-woodland_product-bar__version_8_45_2__hash_1gzyg11e";function ce(e){const t=E.useRef(null),{linkProps:r}=wr(e,t),{active:o,...i}=e,s={...i,...r,ref:t,className:k.cl(Nr({active:o,disabled:!1}),e.className)},l=e.as??(e.href?"a":"span");return E.createElement(l,{...s},e.children)}k.Metadata.set(ce,{name:"Product Bar Tab",props:{active:{type:"boolean",required:!0},href:{type:"string"}}});function ue({children:e,className:t,name:r,logoSrc:o,...i}){return E.createElement(E.Fragment,null,E.createElement("a",{className:k.cl(Cr,t),...i},o&&E.createElement("img",{className:xr,src:o,"aria-hidden":"true",alt:`${r} Logo`}),r&&E.createElement("span",{className:Or},r)),E.createElement("span",{className:Kr}))}k.Metadata.set(ue,{name:"ProductBarName",props:{name:{type:"string"},logoSrc:{type:"string"}}});function Le({fullWidth:e,children:t,className:r,...o}){const i=E.useRef(null),[s,l,c]=k.selectChildren(t,[{type:ue},{type:ce}]);return E.createElement("div",{className:k.cl(Lr,r),...o,ref:i},E.createElement("nav",{className:Br({fullWidth:e})},s,E.createElement("div",{className:Ar},l),E.createElement("div",{className:Mr},E.createElement(k.PortalContext.Provider,{value:{parentElementRef:i,fixed:!0}},c))))}k.Metadata.set(Le,{name:"ProductBar",props:{fullWidth:{type:"boolean"}}});var Dr="pkg_sps-woodland_product-bar__version_8_45_2__hash_r7f8id0",Fr="pkg_sps-woodland_product-bar__version_8_45_2__hash_r7f8id1";function Be({channelId:e,className:t,...r}){const{t:o}=yt.useWoodlandLanguage();return E.createElement("a",{className:k.cl(Dr,t),target:"_blank",rel:"noreferrer",href:`https://spscommerce.slack.com/archives/${e}`,...r},E.createElement(k.Icon,{className:Fr,icon:"conversation","aria-hidden":"true"}),E.createElement("span",null,o("slackLink.label",{defaultValue:"Chat"})))}k.Metadata.set(Be,{name:"Slack Link",props:{channelId:{type:"string",required:!0}}});const Ir={components:[Le,ue,ce],examples:{basic:{label:"Basic",description:"Product navigation bar",examples:{basic:{react:ee.code`
|
|
7
|
+
`.trim(),n.head.prepend(u)},[R]),p.useEffect(()=>{let n=L.current;return()=>{var u;P||Te((u=n.target)!==null&&u!==void 0?u:void 0);for(let a of n.disposables)a();n.disposables=[]}},[P]),{isPressed:f||xe,pressProps:j(Ce,Gr,{[rt]:!0})}}function _e(e){return e.tagName==="A"&&e.hasAttribute("href")}function we(e,t){const{key:r,code:o}=e,i=t,s=i.getAttribute("role");return(r==="Enter"||r===" "||r==="Spacebar"||o==="Space")&&!(i instanceof C(i).HTMLInputElement&&!it(i,r)||i instanceof C(i).HTMLTextAreaElement||i.isContentEditable)&&!((s==="link"||!s&&_e(i))&&r!=="Enter")}function ur(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function nt(e,t){const r=e.changedTouches;for(let o=0;o<r.length;o++){const i=r[o];if(i.identifier===t)return i}return null}function K(e,t){let r=0,o=0;return t.targetTouches&&t.targetTouches.length===1&&(r=t.targetTouches[0].clientX,o=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:o}}function D(e,t){let r=t.clientX,o=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:o,key:t.key}}function dr(e){let t=0,r=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?r=e.height/2:e.radiusY!==void 0&&(r=e.radiusY),{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}function fr(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function ot(e,t){let r=t.getBoundingClientRect(),o=dr(e);return fr(r,o)}function pr(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!_e(e)}function at(e,t){return e instanceof HTMLInputElement?!it(e,t):pr(e)}const br=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function it(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":br.has(e.type)}let X=null;const vr=new Set;let q=new Map,F=!1,ke=!1;function Se(e,t){for(let r of vr)r(e,t)}function gr(e){return!(e.metaKey||!G()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function le(e){F=!0,!M.isOpening&&gr(e)&&(X="keyboard",Se("keyboard",e))}function w(e){X="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(F=!0,Se("pointer",e))}function st(e){!M.isOpening&&Pe(e)&&(F=!0,X="virtual")}function lt(e){v(e)===window||v(e)===document||oe||!e.isTrusted||(!F&&!ke&&(X="virtual",Se("virtual",e)),F=!1,ke=!1)}function ct(){oe||(F=!1,ke=!0)}function ut(e){if(typeof window>"u"||typeof document>"u"||q.get(C(e)))return;const t=C(e),r=T(e);let o=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){F=!0,o.apply(this,arguments)},r.addEventListener("keydown",le,!0),r.addEventListener("keyup",le,!0),r.addEventListener("click",st,!0),t.addEventListener("focus",lt,!0),t.addEventListener("blur",ct,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",w,!0),r.addEventListener("pointermove",w,!0),r.addEventListener("pointerup",w,!0)):process.env.NODE_ENV==="test"&&(r.addEventListener("mousedown",w,!0),r.addEventListener("mousemove",w,!0),r.addEventListener("mouseup",w,!0)),t.addEventListener("beforeunload",()=>{dt(e)},{once:!0}),q.set(t,{focus:o})}const dt=(e,t)=>{const r=C(e),o=T(e);t&&o.removeEventListener("DOMContentLoaded",t),q.has(r)&&(r.HTMLElement.prototype.focus=q.get(r).focus,o.removeEventListener("keydown",le,!0),o.removeEventListener("keyup",le,!0),o.removeEventListener("click",st,!0),r.removeEventListener("focus",lt,!0),r.removeEventListener("blur",ct,!1),typeof PointerEvent<"u"?(o.removeEventListener("pointerdown",w,!0),o.removeEventListener("pointermove",w,!0),o.removeEventListener("pointerup",w,!0)):process.env.NODE_ENV==="test"&&(o.removeEventListener("mousedown",w,!0),o.removeEventListener("mousemove",w,!0),o.removeEventListener("mouseup",w,!0)),q.delete(r))};function $r(e){const t=T(e);let r;return t.readyState!=="loading"?ut(e):(r=()=>{ut(e)},t.addEventListener("DOMContentLoaded",r)),()=>dt(e,r)}typeof document<"u"&&$r();function mr(){return X}function yr(e){if(!e.isConnected)return;const t=T(e);if(mr()==="virtual"){let r=U(t);He(()=>{const o=U(t);(o===r||o===t.body)&&e.isConnected&&H(e)})}else H(e)}function hr(e){let{isDisabled:t,onFocus:r,onBlur:o,onFocusChange:i}=e;const s=p.useCallback(f=>{if(v(f)===f.currentTarget)return o&&o(f),i&&i(!1),!0},[o,i]),l=rr(s),c=p.useCallback(f=>{let m=v(f);const $=T(m),P=$?U($):U();m===f.currentTarget&&m===P&&(r&&r(f),i&&i(!0),l(f))},[i,r,l]);return{focusProps:{onFocus:!t&&(r||i||o)?c:void 0,onBlur:!t&&(o||i)?s:void 0}}}function ft(e){if(!e)return;let t=!0;return r=>{let o={...r,preventDefault(){r.preventDefault()},isDefaultPrevented(){return r.isDefaultPrevented()},stopPropagation(){t&&process.env.NODE_ENV!=="production"?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(o),t&&r.stopPropagation()}}function Pr(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:ft(e.onKeyDown),onKeyUp:ft(e.onKeyUp)}}}let Er=p.createContext(null);function Tr(e){let t=p.useContext(Er)||{};Ge(t,e);let{ref:r,...o}=t;return o}function _r(e,t){let{focusProps:r}=hr(e),{keyboardProps:o}=Pr(e),i=j(r,o),s=Tr(t),l=e.isDisabled?{}:s,c=p.useRef(e.autoFocus);p.useEffect(()=>{c.current&&t.current&&yr(t.current),c.current=!1},[t]);let f=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(f=void 0),{focusableProps:j({...i,tabIndex:f},l)}}function wr(e,t){let{elementType:r="a",onPress:o,onPressStart:i,onPressEnd:s,onClick:l,isDisabled:c,...f}=e,m={};r!=="a"&&(m={role:"link",tabIndex:c?void 0:0});let{focusableProps:$}=_r(e,t),{pressProps:P,isPressed:R}=cr({onPress:o,onPressStart:i,onPressEnd:s,isDisabled:c,ref:t}),Ce=Ot(f,{labelable:!0}),xe=j($,P),J=Ue(),L=Ht(e);return{isPressed:R,linkProps:j(Ce,L,{...xe,...m,"aria-disabled":c||void 0,"aria-current":e["aria-current"],onClick:h=>{var B;(B=P.onClick)===null||B===void 0||B.call(P,h),l&&(l(h),console.warn("onClick is deprecated, please use onPress")),!J.isNative&&h.currentTarget instanceof HTMLAnchorElement&&h.currentTarget.href&&!h.isDefaultPrevented()&&Vt(h.currentTarget,h)&&e.href&&(h.preventDefault(),J.open(h.currentTarget,h,e.href,e.routerOptions))}})}}function kr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,o)}return r}function bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pt(Object(r),!0).forEach(function(o){kr(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}var Sr=(e,t,r)=>{for(var o of Object.keys(e)){var i;if(e[o]!==((i=t[o])!==null&&i!==void 0?i:r[o]))return!1}return!0},vt=e=>t=>{var r=e.defaultClassName,o=bt(bt({},e.defaultVariants),t);for(var i in o){var s,l=(s=o[i])!==null&&s!==void 0?s:e.defaultVariants[i];if(l!=null){var c=l;typeof c=="boolean"&&(c=c===!0?"true":"false");var f=e.variantClassNames[i][c];f&&(r+=" "+f)}}for(var[m,$]of e.compoundVariants)Sr(m,o,e.defaultVariants)&&(r+=" "+$);return r},Lr="pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg110",Br=vt({defaultClassName:"pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg111",variantClassNames:{fullWidth:{true:"pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg112",false:"pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg113"}},defaultVariants:{fullWidth:!1},compoundVariants:[]}),Cr="pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg114",xr="pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg115",Or="pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg116",Mr="pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg117",Nr=vt({defaultClassName:"pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg118",variantClassNames:{active:{true:"pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg119",false:"pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11a"},disabled:{true:"pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11b",false:"pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11c"}},defaultVariants:{active:!1,disabled:!1},compoundVariants:[]}),Kr="pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11d",Ar="pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11e";function ce(e){const t=E.useRef(null),{linkProps:r}=wr(e,t),{active:o,...i}=e,s={...i,...r,ref:t,className:k.cl(Nr({active:o,disabled:!1}),e.className)},l=e.as??(e.href?"a":"span");return E.createElement(l,{...s},e.children)}k.Metadata.set(ce,{name:"Product Bar Tab",props:{active:{type:"boolean",required:!0},href:{type:"string"}}});function ue({children:e,className:t,name:r,logoSrc:o,...i}){return E.createElement(E.Fragment,null,E.createElement("a",{className:k.cl(Cr,t),...i},o&&E.createElement("img",{className:xr,src:o,"aria-hidden":"true",alt:`${r} Logo`}),r&&E.createElement("span",{className:Or},r)),E.createElement("span",{className:Kr}))}k.Metadata.set(ue,{name:"ProductBarName",props:{name:{type:"string"},logoSrc:{type:"string"}}});function Le({fullWidth:e,children:t,className:r,...o}){const i=E.useRef(null),[s,l,c]=k.selectChildren(t,[{type:ue},{type:ce}]);return E.createElement("div",{className:k.cl(Lr,r),...o,ref:i},E.createElement("nav",{className:Br({fullWidth:e})},s,E.createElement("div",{className:Ar},l),E.createElement("div",{className:Mr},E.createElement(k.PortalContext.Provider,{value:{parentElementRef:i,fixed:!0}},c))))}k.Metadata.set(Le,{name:"ProductBar",props:{fullWidth:{type:"boolean"}}});var Dr="pkg_sps-woodland_product-bar__version_8_45_3__hash_r7f8id0",Fr="pkg_sps-woodland_product-bar__version_8_45_3__hash_r7f8id1";function Be({channelId:e,className:t,...r}){const{t:o}=yt.useWoodlandLanguage();return E.createElement("a",{className:k.cl(Dr,t),target:"_blank",rel:"noreferrer",href:`https://spscommerce.slack.com/archives/${e}`,...r},E.createElement(k.Icon,{className:Fr,icon:"conversation","aria-hidden":"true"}),E.createElement("span",null,o("slackLink.label",{defaultValue:"Chat"})))}k.Metadata.set(Be,{name:"Slack Link",props:{channelId:{type:"string",required:!0}}});const Ir={components:[Le,ue,ce],examples:{basic:{label:"Basic",description:"Product navigation bar",examples:{basic:{react:ee.code`
|
|
8
8
|
import { ProductBar, ProductBarName, ProductBarTab } from "@sps-woodland/product-bar";
|
|
9
9
|
import { Button } from "@sps-woodland/buttons";
|
|
10
10
|
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-woodland_product-
|
|
1
|
+
.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg110{background-color:#fff;box-shadow:0 1px 2px #00000026;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg111{background-color:#fff;display:flex;min-height:3.75rem;padding-top:0;padding-right:2rem;padding-bottom:0;padding-left:2rem;width:1280px;align-items:center}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg112{width:100%}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg114{align-content:center;cursor:pointer;display:flex;margin-right:2rem;text-decoration:none}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg114:hover{text-decoration:none}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg115{align-content:center;display:flex;height:1.5rem;margin-right:.5rem;width:1.5rem}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg116{align-content:center;color:#1f282c;display:flex;font-size:1rem;font-weight:600}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg117{flex:1;text-align:right}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg118{align-items:center;color:#4b5356!important;font-size:.875rem!important;cursor:pointer;display:flex;height:3.625rem;justify-content:center;margin-top:.125rem;padding-top:0;padding-right:1rem;padding-bottom:0;padding-left:1rem;text-decoration:none}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg118:hover{text-decoration:none}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg119{box-shadow:inset 0 -.125rem #007db8}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11b{color:#d2d4d4}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11d{display:inline-block;height:2.125rem;margin-top:0;margin-right:1rem;margin-bottom:0;margin-left:0;background:#d2d4d4;width:.0625rem}.pkg_sps-woodland_product-bar__version_8_45_3__hash_1gzyg11e{display:flex;flex-direction:row;padding-left:0;margin-bottom:0;list-style:none}.pkg_sps-woodland_product-bar__version_8_45_3__hash_r7f8id0{align-items:center;display:inline-flex;font-size:.875rem;text-decoration:none}.pkg_sps-woodland_product-bar__version_8_45_3__hash_r7f8id0:hover{border-bottom-style:solid;border-bottom-width:.0625rem;border-bottom-color:#007db8;text-decoration:none!important}.pkg_sps-woodland_product-bar__version_8_45_3__hash_r7f8id1{font-size:1rem;margin-right:.25rem}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/product-bar",
|
|
3
3
|
"description": "SPS Woodland Design System product bar component",
|
|
4
|
-
"version": "8.45.
|
|
4
|
+
"version": "8.45.3",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/product-bar",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0",
|
|
30
30
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
31
31
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
|
-
"@sps-woodland/core": "8.45.
|
|
33
|
-
"@sps-woodland/tokens": "8.45.
|
|
34
|
-
"@spscommerce/i18n": "8.45.
|
|
32
|
+
"@sps-woodland/core": "8.45.3",
|
|
33
|
+
"@sps-woodland/tokens": "8.45.3",
|
|
34
|
+
"@spscommerce/i18n": "8.45.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@spscommerce/utils": "^8.1.1",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@vanilla-extract/recipes": "^0.2.5",
|
|
40
40
|
"react": "^16.14.0",
|
|
41
41
|
"react-dom": "^16.14.0",
|
|
42
|
-
"@sps-woodland/core": "8.45.
|
|
43
|
-
"@sps-woodland/tokens": "8.45.
|
|
44
|
-
"@spscommerce/i18n": "8.45.
|
|
42
|
+
"@sps-woodland/core": "8.45.3",
|
|
43
|
+
"@sps-woodland/tokens": "8.45.3",
|
|
44
|
+
"@spscommerce/i18n": "8.45.3"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@react-aria/link": "^3.3.6"
|