@ebay/ui-core-react 7.4.0-alpha.0 → 7.4.0-alpha.1

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.
@@ -0,0 +1 @@
1
+ "use strict";const o=require("react"),Be=require("react-remove-scroll"),T=require("classnames"),_e=require("./icon-TuxfQndO.js"),we=require("./common/random-id/index.js"),Le=require("./ebay-dialog-base/components/animation/index.js"),te=require("./ebay-dialog-base/components/dialog-header/index.js"),ne=require("./ebay-dialog-base/components/dialog-footer/index.js"),Se=require("./icon-button-Cwaj-eT9.js"),W=({children:e})=>o.createElement(o.Fragment,null,e),Te=e=>e.nodeType===1&&e.tagName.toLowerCase()!=="body"&&e.tagName.toLowerCase()!=="html",Ce=e=>e.nodeType===1&&e.tagName.toLowerCase()!=="script",De=(e,t)=>e.concat(t);function le(e,t=[]){const n=e.previousSibling;return n?(t.push(n),le(n,t)):t}function ie(e,t=[]){const n=e.nextSibling;return n?(t.push(n),ie(n,t)):t}function se(e){return le(e).concat(ie(e)).filter(Ce)}function ce(e,t=[]){const n=e.parentNode;return n?(t.push(n),ce(n,t)):t}function ue(e){return ce(e).filter(Te)}function Fe(e){return ue(e).map(t=>se(t)).reduce(De,[])}let v,u,C;const oe=e=>e.tagName.toLowerCase()!=="svg";function re(e,t){let n;return t===!1?n=D(e,"aria-hidden","false"):n=D(e,"hidden",!1),n}function ae(e,t){let n;return t===!1?n=D(e,"aria-hidden","true"):n=D(e,"hidden",!0),n}function D(e,t,n){const i=typeof n=="boolean";return{el:e,attributeName:t,cleanValue:i?e[t]:e.getAttribute(t),dirtyValue:n,isProperty:i}}function $e(e){e.isProperty===!0?e.el[e.attributeName]=e.dirtyValue:e.el.setAttribute(e.attributeName,e.dirtyValue)}function ke(e){e.cleanValue?e.isProperty===!0?e.el[e.attributeName]=e.cleanValue:e.el.setAttribute(e.attributeName,e.cleanValue):e.el.removeAttribute(e.attributeName)}function U(){u&&(C.forEach(e=>ke(e)),C=[],v&&v.setAttribute("role","main"),u.dispatchEvent(new CustomEvent("screenreaderUntrap",{bubbles:!0})),u=null)}const qe={useHiddenProperty:!1};function Re(e,t){U();const n=Object.assign({},qe,t);u=e,v=document.querySelector('main, [role="main"]'),v&&v.setAttribute("role","presentation");const i=ue(u);let m=se(u),d=Fe(u);n.useHiddenProperty===!0&&(m=m.filter(oe),d=d.filter(oe)),C=[re(u,n.useHiddenProperty)].concat(i.map(a=>re(a,n.useHiddenProperty))).concat(m.map(a=>ae(a,n.useHiddenProperty))).concat(d.map(a=>ae(a,n.useHiddenProperty))),C.forEach(a=>$e(a)),u.dispatchEvent(new CustomEvent("screenreaderTrap",{bubbles:!0}))}const He=["a[href]","area[href]","button:not([disabled])","embed","iframe","input:not([disabled])","object","select:not([disabled])","textarea:not([disabled])","*[tabindex]","*[contenteditable]"],Ie=He.join();function Ve(e,t=!1,n){return We(e,t)}function We(e,t=!1){let n=Array.prototype.slice.call(e.querySelectorAll(Ie));return n=n.filter(function(i){return window.getComputedStyle(i).display!=="none"}),t===!0&&(n=n.filter(function(i){return i.getAttribute("tabindex")!=="-1"})),n}let l,s,h,N,A,B,_,de,fe;function Ue(){const e=document.createElement("div");return e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","0"),e.className="keyboard-trap-boundary",e}function I(){de.focus()}function V(){fe.focus()}function xe(){s=Ue(),h=s.cloneNode(),N=s.cloneNode(),A=s.cloneNode(),B=s.cloneNode(),_=s.cloneNode(),s.addEventListener("focus",I),h.addEventListener("focus",I),N.addEventListener("focus",V),A.addEventListener("focus",I),B.addEventListener("focus",V),_.addEventListener("focus",V)}function x(){return l&&(s=E(s),h=E(h),N=E(N),A=E(A),B=E(B),_=E(_),l.classList.remove("keyboard-trap--active"),l.dispatchEvent(new CustomEvent("keyboardUntrap",{bubbles:!0})),l=null),l}function E(e){const t=e.parentNode;return t?t.removeChild(e):e}function Ke(e){s?x():xe(),l=e;const t=typeof document>"u"?null:document.body,n=Ve(l,!0);return de=n[0],fe=n[n.length-1],t.insertBefore(s,t.childNodes[0]),l.parentNode.insertBefore(h,l),l.insertBefore(N,l.childNodes[0]),l.appendChild(A),l.parentNode.insertBefore(B,l.nextElementSibling),t.appendChild(_),l.dispatchEvent(new CustomEvent("keyboardTrap",{bubbles:!0})),l.classList.add("keyboard-trap--active"),l}const ze=({baseEl:e="div",classPrefix:t="drawer-dialog",windowClass:n,windowType:i,mainId:m,top:d,header:a,buttonPosition:c="right",children:F,ariaLabelledby:$,a11yCloseText:k,onCloseBtnClick:w=()=>{},footer:L,actions:g,onScroll:G,open:r=!1,onOpen:q=()=>{},onBackgroundClick:J=()=>{},ignoreEscape:me,closeButton:be,previousButton:Ee,isModal:S,role:ge="dialog",focus:Q,transitionElement:ye,animated:X,closeButtonClass:pe,...Y})=>{var ee;const Z=o.useRef(null),b=o.useRef(null),M=o.useRef(null),[ve,he]=o.useState("");o.useEffect(()=>{he(we.randomId())},[]),o.useEffect(()=>{let f;const y=p=>{b.current&&!b.current.contains(p.target)&&J(p)};return r&&c!=="hidden"&&(f=window.setTimeout(()=>{document.addEventListener("click",y,!1)})),()=>{clearTimeout(f),document.removeEventListener("click",y,!1)}},[J,r]),o.useEffect(()=>(r&&S?(Re(b.current),Ke(b.current)):(U(),x()),()=>{U(),x()}),[r,S]),Le.useDialogAnimation({open:r,classPrefix:t,transitionElement:ye,dialogRef:Z,dialogWindowRef:b,enabled:X,onTransitionEnd:()=>P(r)});const R=f=>{!me&&f.key==="Escape"&&(f.stopPropagation(),w(f))};o.useEffect(()=>{X||P(r),r&&q()},[r]);function P(f){var y,p;if(f)return Q?(y=Q.current)==null||y.focus():S&&((p=M.current)==null||p.focus()),document.addEventListener("keydown",R,!1),()=>document.removeEventListener("keydown",R,!1)}const O=c!=="hidden"&&o.createElement("button",{ref:M,className:T("icon-btn",pe,`${t}__close`,{"icon-btn--transparent":t==="toast-dialog"}),type:"button","aria-label":k,onClick:w},be||o.createElement(_e.EbayIcon,{name:"close16"})),Ne=i?`${t}__${i}-window`:`${t}__window`,j=((ee=a==null?void 0:a.props)==null?void 0:ee.id)||`dialog-title-${ve}`,Ae=$||j,H=a?o.cloneElement(a,{...a.props,id:j}):null;return o.createElement(e,{...Y,"aria-labelledby":Ae,"aria-modal":"true",role:ge,hidden:!r,className:T(t,Y.className),"aria-live":S?void 0:"polite",ref:Z,onKeyDown:R},o.createElement("div",{className:T(Ne,n),ref:b},d,H&&o.createElement("div",{className:`${t}__header`},Ee,c==="right"&&H,c!=="bottom"&&O,(c==="left"||c==="hidden")&&H),o.createElement("div",{id:m,className:`${t}__main`,onScroll:G},F),g?o.createElement("div",{className:`${t}__actions`},g):null,L||c==="bottom"?o.createElement("div",{className:`${t}__footer`},L,c==="bottom"&&O):null))},Ge=({isModal:e,open:t,children:n,animated:i=!0,...m})=>{const d=e!==!1,a=o.Children.toArray(n),c=a.find(r=>r.type===te),F=a.find(r=>r.type===ne),$=a.find(r=>r.type===K),k=a.find(r=>r.type===W),w=a.find(r=>r.type===z),L=a.filter(r=>![te,ne,W,K,z].some(q=>q===r.type)),g=o.createElement(ze,{...m,open:t,isModal:d,header:c,footer:F,actions:$,closeButton:k,previousButton:w,animated:i},L);return i||t?d?o.createElement(Be.RemoveScroll,{enabled:t},g):g:null},K=({children:e})=>o.createElement(o.Fragment,null,e),z=({className:e,icon:t,...n})=>o.createElement(Se.EbayIconButton,{...n,icon:t||"chevronLeft16",className:T(e,"lightbox-dialog__prev")});exports.DialogBaseWithState=Ge;exports.EbayDialogActions=K;exports.EbayDialogCloseButton=W;exports.EbayDialogPreviousButton=z;
@@ -1 +1 @@
1
- "use strict";const o=require("react"),E=require("classnames"),f=require("./ebay-dialog-base/components/dialog-header/index.js"),H=require("./dialog-previous-button-CpuFLkQp.js");require("./icon-button-Cwaj-eT9.js");const T=30,t="drawer-dialog",$=({expanded:i=!1,noHandle:_,onClose:l=()=>{},onCollapsed:p=()=>{},onExpanded:y=()=>{},a11yMaximizeText:D,a11yMinimizeText:S,children:b,...d})=>{let a=[];const[c,w]=o.useState(i);o.useEffect(()=>{w(i)},[i]);const r=e=>{w(e),e?y():p()},x=e=>{a=Array.from(e.changedTouches).map(({identifier:s,pageY:n})=>({identifier:s,pageY:n}))},u=e=>{Array.from(e.changedTouches).forEach(({identifier:s})=>{const n=a.findIndex(h=>h.identifier===s);n>-1&&a.splice(n,1)})},C=e=>{a.length&&Array.from(e.changedTouches).forEach(({identifier:s,pageY:n})=>{const h=a.findIndex(B=>B.identifier===s),g=n-a[h].pageY;g>T?(c?r(!1):l(),u(e)):g<-T&&(r(!0),u(e))})},k=_?null:o.createElement("button",{"aria-label":c?S:D,className:`${t}__handle`,onClick:()=>r(!c),onScroll:()=>r(!0),onTouchStart:x,onTouchMove:C,onTouchEnd:u,type:"button"}),m=o.Children.toArray(b),q=m.find(({type:e})=>e===f),A=m.filter(({type:e})=>e!==f);return o.createElement(H.DialogBaseWithState,{...d,classPrefix:t,onCloseBtnClick:l,className:E(d.className,`${t}--mask-fade-slow`),windowClass:E(d.windowClass,`${t}__window`,`${t}__window--slide`,{[`${t}__window--expanded`]:c}),onBackgroundClick:l,top:k},q||o.createElement(f,null),A)};exports.EbayDrawerDialog=$;
1
+ "use strict";const o=require("react"),E=require("classnames"),f=require("./ebay-dialog-base/components/dialog-header/index.js"),H=require("./dialog-previous-button-5cTKpmJ-.js");require("./icon-button-Cwaj-eT9.js");const T=30,t="drawer-dialog",$=({expanded:i=!1,noHandle:_,onClose:l=()=>{},onCollapsed:p=()=>{},onExpanded:y=()=>{},a11yMaximizeText:D,a11yMinimizeText:S,children:b,...d})=>{let a=[];const[c,w]=o.useState(i);o.useEffect(()=>{w(i)},[i]);const r=e=>{w(e),e?y():p()},x=e=>{a=Array.from(e.changedTouches).map(({identifier:s,pageY:n})=>({identifier:s,pageY:n}))},u=e=>{Array.from(e.changedTouches).forEach(({identifier:s})=>{const n=a.findIndex(h=>h.identifier===s);n>-1&&a.splice(n,1)})},C=e=>{a.length&&Array.from(e.changedTouches).forEach(({identifier:s,pageY:n})=>{const h=a.findIndex(B=>B.identifier===s),g=n-a[h].pageY;g>T?(c?r(!1):l(),u(e)):g<-T&&(r(!0),u(e))})},k=_?null:o.createElement("button",{"aria-label":c?S:D,className:`${t}__handle`,onClick:()=>r(!c),onScroll:()=>r(!0),onTouchStart:x,onTouchMove:C,onTouchEnd:u,type:"button"}),m=o.Children.toArray(b),q=m.find(({type:e})=>e===f),A=m.filter(({type:e})=>e!==f);return o.createElement(H.DialogBaseWithState,{...d,classPrefix:t,onCloseBtnClick:l,className:E(d.className,`${t}--mask-fade-slow`),windowClass:E(d.windowClass,`${t}__window`,`${t}__window--slide`,{[`${t}__window--expanded`]:c}),onBackgroundClick:l,top:k},q||o.createElement(f,null),A)};exports.EbayDrawerDialog=$;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),c=require("classnames"),d=require("../ebay-dialog-base/components/dialog-footer/index.js"),u=require("../dialog-previous-button-CpuFLkQp.js");require("../icon-button-Cwaj-eT9.js");const g=require("../button-DGuEBUDJ.js"),a="alert-dialog",m=({a11yCloseText:r="Close Dialog",confirmText:l,onConfirm:n=()=>{},...o})=>{const t=e.useRef(null),s="alert-dialog-confirm",i="alert-dialog-main";return e.createElement(u.DialogBaseWithState,{focus:t,...o,a11yCloseText:r,role:"alertdialog",classPrefix:a,ignoreEscape:!0,mainId:i,buttonPosition:"hidden",className:c(o.className,`${a}--mask-fade`),windowClass:`${a}__window ${a}__window--fade`},o.children,e.createElement(d,null,e.createElement(g.EbayButton,{priority:"primary","aria-describedby":i,onClick:n,ref:t,id:s,className:"alert-dialog__acknowledge"},l)))};exports.EbayAlertDialog=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),c=require("classnames"),d=require("../ebay-dialog-base/components/dialog-footer/index.js"),u=require("../dialog-previous-button-5cTKpmJ-.js");require("../icon-button-Cwaj-eT9.js");const g=require("../button-DGuEBUDJ.js"),a="alert-dialog",m=({a11yCloseText:r="Close Dialog",confirmText:l,onConfirm:n=()=>{},...o})=>{const t=e.useRef(null),s="alert-dialog-confirm",i="alert-dialog-main";return e.createElement(u.DialogBaseWithState,{focus:t,...o,a11yCloseText:r,role:"alertdialog",classPrefix:a,ignoreEscape:!0,mainId:i,buttonPosition:"hidden",className:c(o.className,`${a}--mask-fade`),windowClass:`${a}__window ${a}__window--fade`},o.children,e.createElement(d,null,e.createElement(g.EbayButton,{priority:"primary","aria-describedby":i,onClick:n,ref:t,id:s,className:"alert-dialog__acknowledge"},l)))};exports.EbayAlertDialog=m;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),u=require("classnames"),f=require("../ebay-dialog-base/components/dialog-footer/index.js"),g=require("../dialog-previous-button-CpuFLkQp.js");require("../icon-button-Cwaj-eT9.js");const t=require("../button-DGuEBUDJ.js"),o="confirm-dialog",b=({a11yCloseText:c="Close Dialog",confirmText:l,rejectText:s,onReject:n=()=>{},onConfirm:m=()=>{},...i})=>{const a=e.useRef(null),d="confirm-dialog-confirm",r="confirm-dialog-main";return e.createElement(g.DialogBaseWithState,{focus:a,...i,a11yCloseText:c,role:"dialog",mainId:r,classPrefix:o,className:u(i.className,`${o}--mask-fade`),windowClass:`${o}__window ${o}__window--fade`,buttonPosition:"hidden",onCloseBtnClick:n},i.children,e.createElement(f,null,e.createElement(t.EbayButton,{onClick:n,className:"confirm-dialog__reject"},s),e.createElement(t.EbayButton,{ref:a,priority:"primary",onClick:m,id:d,"aria-describedby":r,className:"confirm-dialog__confirm"},l)))};exports.EbayConfirmDialog=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),u=require("classnames"),f=require("../ebay-dialog-base/components/dialog-footer/index.js"),g=require("../dialog-previous-button-5cTKpmJ-.js");require("../icon-button-Cwaj-eT9.js");const t=require("../button-DGuEBUDJ.js"),o="confirm-dialog",b=({a11yCloseText:c="Close Dialog",confirmText:l,rejectText:s,onReject:n=()=>{},onConfirm:m=()=>{},...i})=>{const a=e.useRef(null),d="confirm-dialog-confirm",r="confirm-dialog-main";return e.createElement(g.DialogBaseWithState,{focus:a,...i,a11yCloseText:c,role:"dialog",mainId:r,classPrefix:o,className:u(i.className,`${o}--mask-fade`),windowClass:`${o}__window ${o}__window--fade`,buttonPosition:"hidden",onCloseBtnClick:n},i.children,e.createElement(f,null,e.createElement(t.EbayButton,{onClick:n,className:"confirm-dialog__reject"},s),e.createElement(t.EbayButton,{ref:a,priority:"primary",onClick:m,id:d,"aria-describedby":r,className:"confirm-dialog__confirm"},l)))};exports.EbayConfirmDialog=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),k=require("makeup-expander"),S=require("../calendar-lAu6VfAb.js"),i=require("../textbox-dUhinDwj.js");require("../icon-TuxfQndO.js");const H=require("classnames"),U=600,V=({className:O,inputPlaceholderText:E="YYYY-MM-DD",a11yOpenPopoverText:T="open calendar",range:o,value:v,rangeEnd:g,defaultValue:D,defaultRangeEnd:R,collapseOnSelect:_,onChange:p=()=>{},onInputChange:M=()=>{},onInputRangeEndChange:P=()=>{},...q})=>{const m=n.useRef(),l=n.useRef(null),[w,d]=n.useState(D||""),[A,u]=n.useState(R||""),f=i.isControlled(v)?v:w,y=i.isControlled(g)?g:A,[s,b]=n.useState(()=>S.dateArgToISO(f)),[c,x]=n.useState(()=>S.dateArgToISO(y)),[C,I]=n.useState(!1),[L,Y]=n.useState(1),B=()=>{I(!0)},z=()=>{I(!1)};n.useEffect(()=>{if(!l.current)return;m.current=new k(l.current,{hostSelector:".ebay-date-textbox--main > .icon-btn",contentSelector:".date-textbox__popover",expandOnClick:!0,autoCollapse:!0}),l.current.addEventListener("expander-expand",B),l.current.addEventListener("expander-collapse",z);const e=()=>{Y(document.documentElement.clientWidth<U?1:2)};return e(),window.addEventListener("resize",e),()=>{var t;(t=m.current)==null||t.destroy(),window.removeEventListener("resize",e)}},[]);const h=(e,t)=>{const r=new Date(e.target.value),a=isNaN(r.getTime())?null:S.toISO(r);t===0?(b(a),d(a||"")):(x(a),u(a||"")),o?p(e,{rangeStart:t===0?a:s,rangeEnd:t===1?a:c}):p(e,{selected:a})},F=(e,{iso:t})=>{if(b(t),d(t),o){const r=s||c,a={rangeStart:t,rangeEnd:r};s&&c?(u(""),x(null),a.rangeEnd=null):r&&(r<t?(b(r),d(r),u(t),x(t),a.rangeStart=r,a.rangeEnd=t):(b(t),d(t),u(r),x(r),a.rangeStart=t,a.rangeEnd=r)),p(e,a)}else p(e,{selected:t});_&&(m.current.expanded=!1)},N=(e,t)=>{t===0?(d(e.target.value),M(e)):(u(e.target.value),P(e))},[W,j]=Array.isArray(E)?E:[E,E];return n.createElement("span",{className:H("date-textbox",O),ref:l},o&&n.createElement(i.EbayTextbox,{value:f,placeholder:W,onInputChange:e=>N(e,0),onBlur:e=>h(e,0)}),n.createElement(i.EbayTextbox,{className:"ebay-date-textbox--main",placeholder:j,value:o?y:f,onInputChange:e=>N(e,o?1:0),onBlur:e=>h(e,o?1:0)},n.createElement(i.EbayTextboxPostfixIcon,{name:"calendar24",buttonAriaLabel:T})),n.createElement("div",{hidden:!C,className:"date-textbox__popover"},n.createElement(S.EbayCalendar,{...q,range:o,interactive:!0,navigable:!0,numMonths:L,selected:s&&c?[s,c]:s||c||void 0,onSelect:F})))};exports.EbayDateTextbox=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),k=require("../index-Dr03j-Q0.js"),S=require("../calendar-lAu6VfAb.js"),i=require("../textbox-dUhinDwj.js");require("../icon-TuxfQndO.js");const H=require("classnames"),U=600,V=({className:O,inputPlaceholderText:E="YYYY-MM-DD",a11yOpenPopoverText:T="open calendar",range:s,value:v,rangeEnd:g,defaultValue:_,defaultRangeEnd:D,collapseOnSelect:R,onChange:b=()=>{},onInputChange:M=()=>{},onInputRangeEndChange:P=()=>{},...q})=>{const m=n.useRef(),l=n.useRef(null),[w,d]=n.useState(_||""),[A,u]=n.useState(D||""),f=i.isControlled(v)?v:w,y=i.isControlled(g)?g:A,[o,p]=n.useState(()=>S.dateArgToISO(f)),[c,x]=n.useState(()=>S.dateArgToISO(y)),[C,I]=n.useState(!1),[L,Y]=n.useState(1),B=()=>{I(!0)},z=()=>{I(!1)};n.useEffect(()=>{if(!l.current)return;m.current=new k.src_default(l.current,{hostSelector:".ebay-date-textbox--main > .icon-btn",contentSelector:".date-textbox__popover",expandOnClick:!0,autoCollapse:!0}),l.current.addEventListener("expander-expand",B),l.current.addEventListener("expander-collapse",z);const e=()=>{Y(document.documentElement.clientWidth<U?1:2)};return e(),window.addEventListener("resize",e),()=>{var t;(t=m.current)==null||t.destroy(),window.removeEventListener("resize",e)}},[]);const h=(e,t)=>{const r=new Date(e.target.value),a=isNaN(r.getTime())?null:S.toISO(r);t===0?(p(a),d(a||"")):(x(a),u(a||"")),s?b(e,{rangeStart:t===0?a:o,rangeEnd:t===1?a:c}):b(e,{selected:a})},F=(e,{iso:t})=>{if(p(t),d(t),s){const r=o||c,a={rangeStart:t,rangeEnd:r};o&&c?(u(""),x(null),a.rangeEnd=null):r&&(r<t?(p(r),d(r),u(t),x(t),a.rangeStart=r,a.rangeEnd=t):(p(t),d(t),u(r),x(r),a.rangeStart=t,a.rangeEnd=r)),b(e,a)}else b(e,{selected:t});R&&(m.current.expanded=!1)},N=(e,t)=>{t===0?(d(e.target.value),M(e)):(u(e.target.value),P(e))},[W,j]=Array.isArray(E)?E:[E,E];return n.createElement("span",{className:H("date-textbox",O),ref:l},s&&n.createElement(i.EbayTextbox,{value:f,placeholder:W,onInputChange:e=>N(e,0),onBlur:e=>h(e,0)}),n.createElement(i.EbayTextbox,{className:"ebay-date-textbox--main",placeholder:j,value:s?y:f,onInputChange:e=>N(e,s?1:0),onBlur:e=>h(e,s?1:0)},n.createElement(i.EbayTextboxPostfixIcon,{name:"calendar24",buttonAriaLabel:T})),n.createElement("div",{hidden:!C,className:"date-textbox__popover"},n.createElement(S.EbayCalendar,{...q,range:s,interactive:!0,navigable:!0,numMonths:L,selected:o&&c?[o,c]:o||c||void 0,onSelect:F})))};exports.EbayDateTextbox=V;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./components/dialog-header/index.js"),e=require("./components/dialog-footer/index.js"),o=require("../dialog-previous-button-CpuFLkQp.js"),i=require("./components/animation/index.js");exports.EbayDialogHeader=a;exports.EbayDialogFooter=e;exports.DialogBaseWithState=o.DialogBaseWithState;exports.EbayDialogActions=o.EbayDialogActions;exports.EbayDialogCloseButton=o.EbayDialogCloseButton;exports.EbayDialogPreviousButton=o.EbayDialogPreviousButton;exports.useDialogAnimation=i.useDialogAnimation;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./components/dialog-header/index.js"),e=require("./components/dialog-footer/index.js"),o=require("../dialog-previous-button-5cTKpmJ-.js"),i=require("./components/animation/index.js");exports.EbayDialogHeader=a;exports.EbayDialogFooter=e;exports.DialogBaseWithState=o.DialogBaseWithState;exports.EbayDialogActions=o.EbayDialogActions;exports.EbayDialogCloseButton=o.EbayDialogCloseButton;exports.EbayDialogPreviousButton=o.EbayDialogPreviousButton;exports.useDialogAnimation=i.useDialogAnimation;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../drawer-rqXAEeqd.js");exports.EbayDrawerDialog=e.EbayDrawerDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../drawer-xTtCoO3F.js");exports.EbayDrawerDialog=e.EbayDrawerDialog;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),o=require("classnames"),r=require("../dialog-previous-button-CpuFLkQp.js");require("../icon-button-Cwaj-eT9.js");const e="fullscreen-dialog",c=({open:s,onClose:t=()=>{},className:i,animated:l,...n})=>a.createElement(r.DialogBaseWithState,{...n,classPrefix:e,buttonPosition:"right",onCloseBtnClick:t,transitionElement:"window",animated:l,className:o(i,`${e}--mask-fade-slow`),windowClass:o(`${e}__window`,`${e}__window--slide`),open:s});exports.EbayFullscreenDialog=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),o=require("classnames"),r=require("../dialog-previous-button-5cTKpmJ-.js");require("../icon-button-Cwaj-eT9.js");const e="fullscreen-dialog",c=({open:s,onClose:t=()=>{},className:i,animated:l,...n})=>a.createElement(r.DialogBaseWithState,{...n,classPrefix:e,buttonPosition:"right",onCloseBtnClick:t,transitionElement:"window",animated:l,className:o(i,`${e}--mask-fade-slow`),windowClass:o(`${e}__window`,`${e}__window--slide`),open:s});exports.EbayFullscreenDialog=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),T=require("classnames"),E=require("../common/component-utils/utils/index.js"),r=require("../use-tooltip-CL3_zAeg.js"),$=require("../drawer-rqXAEeqd.js"),B=require("../ebay-dialog-base/components/dialog-header/index.js");require("react-remove-scroll");require("makeup-screenreader-trap");require("makeup-keyboard-trap");const M=require("../icon-TuxfQndO.js");require("../icon-button-Cwaj-eT9.js");const S=require("classnames/dedupe"),U=require("../common/component-utils/forwardRef/index.js"),j=({icon:t,className:o,children:n,forwardedRef:c,variant:l,...p})=>{const i=l==="modal"?"dialog--mini":"infotip",a=e.createElement(M.EbayIcon,{name:t}),f=n instanceof Function?n({icon:a}):n;return e.createElement("button",{...p,className:S("icon-btn icon-btn--transparent",o,`${i}__host`),type:"button",ref:c},f||a)},b=U.withForwardRef(j),k=({variant:t="default",pointer:o,overlayStyle:n,disabled:c,onExpand:l,onCollapse:p,children:i,initialExpanded:a,icon:f="information16",a11yCloseText:d,"aria-label":R,className:H,a11yMaximizeText:N,a11yMinimizeText:F})=>{const y=e.useRef(),{isExpanded:s,expandTooltip:P,collapseTooltip:m}=r.useTooltip({onCollapse:p,onExpand:l,initialExpanded:a,hostRef:y}),u=t==="modal",x=e.useRef(),g=E.findComponent(i,h),q=E.findComponent(i,w),C=E.findComponent(i,b)||e.createElement(b),D=()=>{s?m():P()};if(!q)throw new Error("EbayInfotip: Please use a EbayInfotipContent that defines the content of the infotip");const{children:I,..._}=q.props;return e.createElement(e.Fragment,null,e.createElement(r.Tooltip,{type:"infotip",isExpanded:s,className:T(H,{"dialog--mini":u}),ref:x},e.createElement(r.TooltipHost,null,e.cloneElement(C,{ref:y,onClick:D,disabled:c,variant:t,"aria-label":R,"aria-expanded":s,icon:f,...C.props})),!u&&e.createElement(r.TooltipContent,{..._,type:"infotip",style:n,pointer:o,showCloseButton:!0,a11yCloseText:d,onClose:m},g,I)),u&&e.createElement($.EbayDrawerDialog,{..._,open:s,onClose:m,a11yCloseText:d,className:"dialog--mini__overlay",a11yMaximizeText:N,a11yMinimizeText:F},e.createElement(B,null,g),I))},h=({className:t,...o})=>e.createElement("span",{...o,className:T("infotip__heading",t)}),w=({children:t})=>e.createElement(e.Fragment,null,t);exports.EbayInfotip=k;exports.EbayInfotipContent=w;exports.EbayInfotipHeading=h;exports.EbayInfotipHost=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),T=require("classnames"),E=require("../common/component-utils/utils/index.js"),r=require("../use-tooltip-CL3_zAeg.js"),$=require("../drawer-xTtCoO3F.js"),B=require("../ebay-dialog-base/components/dialog-header/index.js");require("react-remove-scroll");const M=require("../icon-TuxfQndO.js");require("../icon-button-Cwaj-eT9.js");const S=require("classnames/dedupe"),U=require("../common/component-utils/forwardRef/index.js"),j=({icon:t,className:o,children:n,forwardedRef:c,variant:l,...p})=>{const a=l==="modal"?"dialog--mini":"infotip",i=e.createElement(M.EbayIcon,{name:t}),f=n instanceof Function?n({icon:i}):n;return e.createElement("button",{...p,className:S("icon-btn icon-btn--transparent",o,`${a}__host`),type:"button",ref:c},f||i)},b=U.withForwardRef(j),k=({variant:t="default",pointer:o,overlayStyle:n,disabled:c,onExpand:l,onCollapse:p,children:a,initialExpanded:i,icon:f="information16",a11yCloseText:d,"aria-label":R,className:H,a11yMaximizeText:N,a11yMinimizeText:F})=>{const y=e.useRef(),{isExpanded:s,expandTooltip:P,collapseTooltip:m}=r.useTooltip({onCollapse:p,onExpand:l,initialExpanded:i,hostRef:y}),u=t==="modal",x=e.useRef(),g=E.findComponent(a,h),C=E.findComponent(a,w),I=E.findComponent(a,b)||e.createElement(b),D=()=>{s?m():P()};if(!C)throw new Error("EbayInfotip: Please use a EbayInfotipContent that defines the content of the infotip");const{children:_,...q}=C.props;return e.createElement(e.Fragment,null,e.createElement(r.Tooltip,{type:"infotip",isExpanded:s,className:T(H,{"dialog--mini":u}),ref:x},e.createElement(r.TooltipHost,null,e.cloneElement(I,{ref:y,onClick:D,disabled:c,variant:t,"aria-label":R,"aria-expanded":s,icon:f,...I.props})),!u&&e.createElement(r.TooltipContent,{...q,type:"infotip",style:n,pointer:o,showCloseButton:!0,a11yCloseText:d,onClose:m},g,_)),u&&e.createElement($.EbayDrawerDialog,{...q,open:s,onClose:m,a11yCloseText:d,className:"dialog--mini__overlay",a11yMaximizeText:N,a11yMinimizeText:F},e.createElement(B,null,g),_))},h=({className:t,...o})=>e.createElement("span",{...o,className:T("infotip__heading",t)}),w=({children:t})=>e.createElement(e.Fragment,null,t);exports.EbayInfotip=k;exports.EbayInfotipContent=w;exports.EbayInfotipHeading=h;exports.EbayInfotipHost=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),a=require("classnames"),c=require("../dialog-previous-button-CpuFLkQp.js");require("../icon-button-Cwaj-eT9.js");const i="lightbox-dialog",r=({open:s,mode:l,size:o,onClose:e=()=>{},...t})=>n.createElement(c.DialogBaseWithState,{buttonPosition:"right",...t,classPrefix:i,onCloseBtnClick:e,onBackgroundClick:e,className:a(t.className,`${i}--mask-fade`,o&&`${i}--${o}`),windowClass:a("lightbox-dialog__window--fade",{[`${i}__window--mini`]:l==="mini"}),open:s});exports.EbayLightboxDialog=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),a=require("classnames"),c=require("../dialog-previous-button-5cTKpmJ-.js");require("../icon-button-Cwaj-eT9.js");const i="lightbox-dialog",r=({open:s,mode:l,size:o,onClose:e=()=>{},...t})=>n.createElement(c.DialogBaseWithState,{buttonPosition:"right",...t,classPrefix:i,onCloseBtnClick:e,onBackgroundClick:e,className:a(t.className,`${i}--mask-fade`,o&&`${i}--${o}`),windowClass:a("lightbox-dialog__window--fade",{[`${i}__window--mini`]:l==="mini"}),open:s});exports.EbayLightboxDialog=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../listbox-Bq3f2oxx.js");exports.EbayListbox=t.EbayListbox;exports.EbayListboxOption=t.EbayListboxOption;exports.EbayListboxOptionDescription=t.EbayListboxOptionDescription;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../listbox-DYqjiD8y.js");exports.EbayListbox=t.EbayListbox;exports.EbayListboxOption=t.EbayListboxOption;exports.EbayListboxOptionDescription=t.EbayListboxOptionDescription;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),W=require("makeup-expander"),X=require("makeup-prevent-scroll-keys"),N=require("classnames"),E=require("../listbox-Bq3f2oxx.js"),Y=require("../common/component-utils/utils/index.js"),Z=require("../icon-TuxfQndO.js");function ee(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const P=ee(X),$=({alwaysDisplay:t,icon:r,labelId:n,text:o,unselectedText:_,postfixLabel:m})=>{if(r)return e.createElement("span",{id:n,className:"btn__text"},r);if(o||t){const i=o||_;return e.createElement("span",{id:n,className:"btn__text"},i,m&&e.createElement("span",{className:"btn__postfix-label"},m))}};function k({selected:t,value:r,options:n}){return t!==void 0?t:r!==void 0?n.findIndex(o=>o.props.value===r):n.findIndex(o=>o.props.selected)}const te=E.EbayListboxOption,ne=({"aria-invalid":t,a11yIconPrefixText:r,borderless:n,children:o,className:_,collapseOnSelect:m,disabled:i,floatingLabel:y,fluid:S,hasError:h,listSelection:F,maxHeight:M,name:K,postfixLabel:q,prefixId:C,prefixLabel:L,selected:v,split:I,truncate:R,unselectedText:T="-",value:g,variant:z,onChange:A=()=>{},onExpand:U=()=>{},onCollapse:V=()=>{},...G})=>{const a=e.useRef(),u=e.useRef(),l=e.useRef(),b=Y.filterByType(o,E.EbayListboxOption),[j,w]=e.useState(k({selected:v,value:g,options:b})),p=b[j],d=p&&(p.props.text||p.props.children),O=p&&p.props.icon,B=O&&d,f=C&&"expand-btn-text";e.useEffect(()=>{w(k({selected:v,value:g,options:b}))},[g,v]),e.useEffect(()=>{function c(){var x,D;(D=(x=a.current)==null?void 0:x.querySelector(".listbox-button__listbox"))==null||D.scroll(),U()}function s(){requestAnimationFrame(()=>{var x;(x=u.current)==null||x.focus()}),V()}return b.length&&!i&&(l.current=new W(a.current,{alwaysDoFocusManagement:!0,autoCollapse:!0,expandOnClick:!0,simulateSpacebarClick:!0,contentSelector:".listbox-button__listbox",hostSelector:".listbox-button__control",expandedClass:"listbox-button--expanded",focusManagement:"content"}),a.current.addEventListener("expander-expand",c),a.current.addEventListener("expander-collapse",s)),P.add(u.current),()=>{l.current&&(l.current.destroy(),l.current=void 0),a.current&&(a.current.removeEventListener("expander-expand",c),a.current.removeEventListener("expander-collapse",s)),u.current&&P.remove(u.current)}},[i]);function H(c,s){m!==!1&&(l.current.expanded=!1),w(s.index),A(c,s)}function J(){l.current.expanded=!1}const Q=R&&!S?"div":"span";return e.createElement(Q,{ref:a,className:N("listbox-button",_,{"listbox-button--fluid":S,"listbox-button--form":z==="form","listbox-button--error":t||h})},e.createElement("button",{...G,disabled:i,ref:u,className:N("listbox-button__control","btn",{[`btn--split-${I}`]:I,"btn--borderless":n,"btn--form":!n,"btn--truncated":R,"btn--floating-label":y}),"aria-label":B&&`${r}: ${B}`,value:d,type:"button","aria-haspopup":"listbox","aria-labelledby":f&&`${C} ${f}`,"aria-invalid":t||h},e.createElement("span",{className:"btn__cell"},y?e.createElement(e.Fragment,null,e.createElement("span",{className:N("btn__floating-label","btn__floating-label--animate",!d&&"btn__floating-label--inline")},y),e.createElement($,{icon:O,labelId:f,text:d,unselectedText:T,postfixLabel:q})):e.createElement(e.Fragment,null,L?e.createElement("span",{className:"btn__label"},L):null,e.createElement($,{alwaysDisplay:!0,icon:O,labelId:f,text:d,unselectedText:T,postfixLabel:q})),e.createElement(Z.EbayIcon,{name:"chevronDown12"}))),e.createElement(E.EbayListbox,{className:"listbox-button__listbox",selectClassName:"listbox-button__native",tabIndex:-1,listSelection:F,name:K,maxHeight:M,onChange:H,onEscape:J},b.map((c,s)=>e.createElement(E.EbayListboxOption,{key:c.props.value||s,selected:s===j,...c.props}))))};exports.EbayListboxButton=ne;exports.EbayListboxButtonOption=te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),W=require("../index-Dr03j-Q0.js"),L=require("classnames"),E=require("../listbox-DYqjiD8y.js"),X=require("../common/component-utils/utils/index.js"),Y=require("../icon-TuxfQndO.js");function M(t){t.keyCode>=32&&t.keyCode<=40&&t.preventDefault()}function Z(t){t.addEventListener("keydown",M)}function ee(t){t.removeEventListener("keydown",M)}const $=({alwaysDisplay:t,icon:s,labelId:n,text:o,unselectedText:_,postfixLabel:m})=>{if(s)return e.createElement("span",{id:n,className:"btn__text"},s);if(o||t){const i=o||_;return e.createElement("span",{id:n,className:"btn__text"},i,m&&e.createElement("span",{className:"btn__postfix-label"},m))}};function F({selected:t,value:s,options:n}){return t!==void 0?t:s!==void 0?n.findIndex(o=>o.props.value===s):n.findIndex(o=>o.props.selected)}const te=E.EbayListboxOption,ne=({"aria-invalid":t,a11yIconPrefixText:s,borderless:n,children:o,className:_,collapseOnSelect:m,disabled:i,floatingLabel:y,fluid:N,hasError:h,listSelection:j,maxHeight:A,name:K,postfixLabel:S,prefixId:q,prefixLabel:I,selected:v,split:O,truncate:R,unselectedText:k="-",value:g,variant:P,onChange:U=()=>{},onExpand:V=()=>{},onCollapse:z=()=>{},...G})=>{const r=e.useRef(),u=e.useRef(),l=e.useRef(),b=X.filterByType(o,E.EbayListboxOption),[w,B]=e.useState(F({selected:v,value:g,options:b})),d=b[w],p=d&&(d.props.text||d.props.children),C=d&&d.props.icon,D=C&&p,f=q&&"expand-btn-text";e.useEffect(()=>{B(F({selected:v,value:g,options:b}))},[g,v]),e.useEffect(()=>{function c(){var x,T;(T=(x=r.current)==null?void 0:x.querySelector(".listbox-button__listbox"))==null||T.scroll(),V()}function a(){requestAnimationFrame(()=>{var x;(x=u.current)==null||x.focus()}),z()}return b.length&&!i&&(l.current=new W.src_default(r.current,{alwaysDoFocusManagement:!0,autoCollapse:!0,expandOnClick:!0,simulateSpacebarClick:!0,contentSelector:".listbox-button__listbox",hostSelector:".listbox-button__control",expandedClass:"listbox-button--expanded",focusManagement:"content"}),r.current.addEventListener("expander-expand",c),r.current.addEventListener("expander-collapse",a)),Z(u.current),()=>{l.current&&(l.current.destroy(),l.current=void 0),r.current&&(r.current.removeEventListener("expander-expand",c),r.current.removeEventListener("expander-collapse",a)),u.current&&ee(u.current)}},[i]);function H(c,a){m!==!1&&(l.current.expanded=!1),B(a.index),U(c,a)}function J(){l.current.expanded=!1}const Q=R&&!N?"div":"span";return e.createElement(Q,{ref:r,className:L("listbox-button",_,{"listbox-button--fluid":N,"listbox-button--form":P==="form","listbox-button--error":t||h})},e.createElement("button",{...G,disabled:i,ref:u,className:L("listbox-button__control","btn",{[`btn--split-${O}`]:O,"btn--borderless":n,"btn--form":!n,"btn--truncated":R,"btn--floating-label":y}),"aria-label":D&&`${s}: ${D}`,value:p,type:"button","aria-haspopup":"listbox","aria-labelledby":f&&`${q} ${f}`,"aria-invalid":t||h},e.createElement("span",{className:"btn__cell"},y?e.createElement(e.Fragment,null,e.createElement("span",{className:L("btn__floating-label","btn__floating-label--animate",!p&&"btn__floating-label--inline")},y),e.createElement($,{icon:C,labelId:f,text:p,unselectedText:k,postfixLabel:S})):e.createElement(e.Fragment,null,I?e.createElement("span",{className:"btn__label"},I):null,e.createElement($,{alwaysDisplay:!0,icon:C,labelId:f,text:p,unselectedText:k,postfixLabel:S})),e.createElement(Y.EbayIcon,{name:"chevronDown12"}))),e.createElement(E.EbayListbox,{className:"listbox-button__listbox",selectClassName:"listbox-button__native",tabIndex:-1,listSelection:j,name:K,maxHeight:A,onChange:H,onEscape:J},b.map((c,a)=>e.createElement(E.EbayListboxOption,{key:c.props.value||a,selected:a===w,...c.props}))))};exports.EbayListboxButton=ne;exports.EbayListboxButtonOption=te;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),t=require("classnames"),c=require("../dialog-previous-button-CpuFLkQp.js");require("../icon-button-Cwaj-eT9.js");const e="panel-dialog",d=({open:i,animated:a,position:s="start",onClose:o=()=>{},className:l,...n})=>r.createElement(c.DialogBaseWithState,{...n,"aria-label":"Infotip",classPrefix:e,buttonPosition:"right",onCloseBtnClick:o,onBackgroundClick:o,animated:a,className:t(l,{[`${e}--mask-fade-slow`]:a}),windowClass:t(`${e}__window--slide`,{[`${e}__window--end`]:s==="end"}),open:i});exports.EbayPanelDialog=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),t=require("classnames"),c=require("../dialog-previous-button-5cTKpmJ-.js");require("../icon-button-Cwaj-eT9.js");const e="panel-dialog",d=({open:i,animated:a,position:s="start",onClose:o=()=>{},className:l,...n})=>r.createElement(c.DialogBaseWithState,{...n,"aria-label":"Infotip",classPrefix:e,buttonPosition:"right",onCloseBtnClick:o,onBackgroundClick:o,animated:a,className:t(l,{[`${e}--mask-fade-slow`]:a}),windowClass:t(`${e}__window--slide`,{[`${e}__window--end`]:s==="end"}),open:i});exports.EbayPanelDialog=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("classnames"),e=require("react"),k=require("../dialog-previous-button-CpuFLkQp.js");require("../icon-button-Cwaj-eT9.js");const f=({className:r,children:c,...l})=>e.createElement("button",{className:D(r,"fake-link"),...l},c),L=6e3,N=({className:r,onOpen:c=()=>{},onClose:l=()=>{},layout:S,open:i,children:h,onAction:u,...T})=>{const n=e.useRef(new Set),b=e.useRef(),[C,m]=e.useState(i),g=e.Children.toArray(h),o=g.find(t=>t.type===f),p=g.filter(t=>t.type!==f),s=()=>{clearTimeout(b.current)},d=()=>{m(!1),l()},E=()=>{n.current.size===0&&(s(),b.current=setTimeout(()=>{d()},L))},M=()=>{m(!0),c(),E()},q=()=>{s(),n.current.add("focus")},w=()=>{n.current.delete("focus"),E()},R=()=>{s(),n.current.add("mouseEnter")},v=()=>{n.current.delete("mouseEnter"),E()},B=t=>{var a,y;s(),u==null||u(t),(y=(a=o==null?void 0:o.props)==null?void 0:a.onClick)==null||y.call(a,t),d()};return e.useEffect(()=>()=>{s()},[]),e.useEffect(()=>{i?M():d()},[i]),e.createElement(k.DialogBaseWithState,{...T,open:C,isModal:!1,baseEl:"aside",classPrefix:"snackbar-dialog",transitionElement:"root",a11yCloseText:"",buttonPosition:"hidden",className:D(r,"snackbar-dialog--transition"),windowClass:S==="column"&&"snackbar-dialog__window--column",onFocus:q,onBlur:w,onMouseEnter:R,onMouseLeave:v},p,o?e.createElement(k.EbayDialogActions,null,e.cloneElement(o,{onClick:B})):null)};exports.EbaySnackbarDialog=N;exports.EbaySnackbarDialogAction=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("classnames"),e=require("react"),k=require("../dialog-previous-button-5cTKpmJ-.js");require("../icon-button-Cwaj-eT9.js");const f=({className:r,children:c,...l})=>e.createElement("button",{className:D(r,"fake-link"),...l},c),L=6e3,N=({className:r,onOpen:c=()=>{},onClose:l=()=>{},layout:S,open:i,children:h,onAction:u,...T})=>{const n=e.useRef(new Set),b=e.useRef(),[C,m]=e.useState(i),g=e.Children.toArray(h),o=g.find(t=>t.type===f),p=g.filter(t=>t.type!==f),s=()=>{clearTimeout(b.current)},d=()=>{m(!1),l()},E=()=>{n.current.size===0&&(s(),b.current=setTimeout(()=>{d()},L))},M=()=>{m(!0),c(),E()},q=()=>{s(),n.current.add("focus")},w=()=>{n.current.delete("focus"),E()},R=()=>{s(),n.current.add("mouseEnter")},v=()=>{n.current.delete("mouseEnter"),E()},B=t=>{var a,y;s(),u==null||u(t),(y=(a=o==null?void 0:o.props)==null?void 0:a.onClick)==null||y.call(a,t),d()};return e.useEffect(()=>()=>{s()},[]),e.useEffect(()=>{i?M():d()},[i]),e.createElement(k.DialogBaseWithState,{...T,open:C,isModal:!1,baseEl:"aside",classPrefix:"snackbar-dialog",transitionElement:"root",a11yCloseText:"",buttonPosition:"hidden",className:D(r,"snackbar-dialog--transition"),windowClass:S==="column"&&"snackbar-dialog__window--column",onFocus:q,onBlur:w,onMouseEnter:R,onMouseLeave:v},p,o?e.createElement(k.EbayDialogActions,null,e.cloneElement(o,{onClick:B})):null)};exports.EbaySnackbarDialog=N;exports.EbaySnackbarDialogAction=f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),s=require("classnames"),i=require("../dialog-previous-button-CpuFLkQp.js");require("../icon-button-Cwaj-eT9.js");const r=({className:t,onClose:e=()=>{},...o})=>a.createElement(i.DialogBaseWithState,{...o,isModal:!1,baseEl:"aside",classPrefix:"toast-dialog",buttonPosition:"right",transitionElement:"root",className:s(t,"toast-dialog--transition"),onCloseBtnClick:e});exports.EbayToast=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),s=require("classnames"),i=require("../dialog-previous-button-5cTKpmJ-.js");require("../icon-button-Cwaj-eT9.js");const r=({className:t,onClose:e=()=>{},...o})=>a.createElement(i.DialogBaseWithState,{...o,isModal:!1,baseEl:"aside",classPrefix:"toast-dialog",buttonPosition:"right",transitionElement:"root",className:s(t,"toast-dialog--transition"),onCloseBtnClick:e});exports.EbayToast=r;
@@ -0,0 +1 @@
1
+ "use strict";const o={},m="nid",a=h(3);function c(t){return Math.floor(Math.random()*t)}function h(t){const e="abcdefghijklmnopqrstuvwxyz",n=e+"0123456789";let r=e[c(25)];for(let u=1;u<t;u++)r+=n[c(35)];return r}function d(t,e=m){const n=`${e}${e===""?"":"-"}${a}`;return o[n]=o[n]||0,t.id||t.setAttribute("id",`${n}-${o[n]++}`),t.id}const s={};function l(t,e,i){t.dispatchEvent(new CustomEvent("focusExit",{detail:{fromElement:e,toElement:i},bubbles:!1}))}function E(t){const e=t.target;this.el.contains(e)===!0?this.currentFocusElement=e:(window.removeEventListener("blur",this.onWindowBlurListener),document.removeEventListener("focusin",this.onDocumentFocusInListener),l(this.el,this.currentFocusElement,e),this.currentFocusElement=null)}function f(){l(this.el,this.currentFocusElement,void 0)}function v(){document.addEventListener("focusin",this.onDocumentFocusInListener),window.addEventListener("blur",this.onWindowBlurListener)}class F{constructor(e){this.el=e,this.currentFocusElement=null,this.onWidgetFocusInListener=v.bind(this),this.onDocumentFocusInListener=E.bind(this),this.onWindowBlurListener=f.bind(this),this.el.addEventListener("focusin",this.onWidgetFocusInListener)}removeEventListeners(){window.removeEventListener("blur",this.onWindowBlurListener),document.removeEventListener("focusin",this.onDocumentFocusInListener),this.el.removeEventListener("focusin",this.onWidgetFocusInListener)}}function L(t){let e=null;return d(t),s[t.id]||(e=new F(t),s[t.id]=e),e}function w(t){const e=s[t.id];e&&(e.removeEventListeners(),delete s[t.id])}exports.addFocusExit=L;exports.removeFocusExit=w;exports.src_default=d;
@@ -0,0 +1 @@
1
+ "use strict";const n=require("./index-D3xZmuzJ.js"),l=["a[href]","area[href]","button:not([disabled])","embed","iframe","input:not([disabled])","object","select:not([disabled])","textarea:not([disabled])","*[tabindex]","*[contenteditable]"],a=l.join();function o(t,e=!1,s){return u(t,e)}function u(t,e=!1){let s=Array.prototype.slice.call(t.querySelectorAll(a));return s=s.filter(function(i){return!!(i.offsetWidth||i.offsetHeight||i.getClientRects().length)}),e===!0&&(s=s.filter(function(i){return i.getAttribute("tabindex")!=="-1"})),s}const h={alwaysDoFocusManagement:!1,ariaControls:!0,autoCollapse:!1,collapseOnFocusOut:!1,collapseOnMouseOut:!1,collapseOnClickOut:!1,contentSelector:".expander__content",expandedClass:null,expandOnClick:!1,expandOnFocus:!1,expandOnHover:!1,focusManagement:null,hostSelector:".expander__host",simulateSpacebarClick:!1};function c(t){(t.keyCode===13||t.keyCode===32)&&(this._keyboardClickFlag=!0),t.keyCode===32&&this.options.simulateSpacebarClick===!0&&this.hostEl.click()}function r(){this._mouseClickFlag=!0}function d(){this._expandWasKeyboardClickActivated=this._keyboardClickFlag,this._expandWasMouseClickActivated=this._mouseClickFlag,this.expanded=!this.expanded}function f(){this._expandWasFocusActivated=!0,this.expanded=!0}function p(){clearTimeout(this._mouseLeft),this._expandWasHoverActivated=!0,this.expanded=!0}function v(){this.expanded=!1}function L(){clearTimeout(this._mouseLeft),this._mouseLeft=setTimeout(()=>{this.expanded=!1},300)}function _(t){this.el.contains(t.target)===!1&&(this.expanded=!1)}function m(){this.documentClick=!0}function E(){this.documentClick=!1}function x(t){this.documentClick===!0&&(this.documentClick=!1,this.el.contains(t.target)===!1&&(this.expanded=!1))}function C(t,e){if(console.log("FOCUS MJS",e),t==="content")e.setAttribute("tabindex","-1"),e.focus();else if(t==="focusable")o(e)[0].focus();else if(t==="interactive")o(e,!0)[0].focus();else if(t!==null){const s=e.querySelector(`#${t}`);s&&s.focus()}}class O{constructor(e,s){console.log("MJS"),this.options=Object.assign({},h,s),this.el=e,this.hostEl=e.querySelector(this.options.hostSelector),this.contentEl=e.querySelector(this.options.contentSelector),n.addFocusExit(this.el),this._hostKeyDownListener=c.bind(this),this._hostMouseDownListener=r.bind(this),this._documentClickListener=_.bind(this),this._documentTouchStartListener=m.bind(this),this._documentTouchMoveListener=E.bind(this),this._documentTouchEndListener=x.bind(this),this._hostClickListener=d.bind(this),this._hostFocusListener=f.bind(this),this._hostHoverListener=p.bind(this),this._focusExitListener=v.bind(this),this._mouseLeaveListener=L.bind(this),this.hostEl.getAttribute("aria-expanded")===null&&this.hostEl.setAttribute("aria-expanded","false"),this.options.ariaControls===!0&&(n.src_default(this.el,"expander"),this.contentEl.id=this.contentEl.id||`${this.el.id}-content`,this.hostEl.setAttribute("aria-controls",this.contentEl.id)),this.expandOnClick=this.options.expandOnClick,this.expandOnFocus=this.options.expandOnFocus,this.expandOnHover=this.options.expandOnHover,this.options.autoCollapse===!1&&(this.collapseOnClickOut=this.options.collapseOnClickOut,this.collapseOnFocusOut=this.options.collapseOnFocusOut,this.collapseOnMouseOut=this.options.collapseOnMouseOut)}set expandOnClick(e){e===!0?(this.hostEl.addEventListener("keydown",this._hostKeyDownListener),this.hostEl.addEventListener("mousedown",this._hostMouseDownListener),this.hostEl.addEventListener("click",this._hostClickListener),this.options.autoCollapse===!0&&(this.collapseOnClickOut=!0,this.collapseOnFocusOut=!0)):(this.hostEl.removeEventListener("click",this._hostClickListener),this.hostEl.removeEventListener("mousedown",this._hostMouseDownListener),this.hostEl.removeEventListener("keydown",this._hostKeyDownListener))}set expandOnFocus(e){e===!0?(this.hostEl.addEventListener("focus",this._hostFocusListener),this.options.autoCollapse===!0&&(this.collapseOnClickOut=!0,this.collapseOnFocusOut=!0)):this.hostEl.removeEventListener("focus",this._hostFocusListener)}set expandOnHover(e){e===!0?(this.hostEl.addEventListener("mouseenter",this._hostHoverListener),this.contentEl.addEventListener("mouseenter",this._hostHoverListener),this.options.autoCollapse===!0&&(this.collapseOnMouseOut=!0)):(this.hostEl.removeEventListener("mouseenter",this._hostHoverListener),this.contentEl.removeEventListener("mouseenter",this._hostHoverListener))}set collapseOnClickOut(e){e===!0?(document.addEventListener("click",this._documentClickListener),document.addEventListener("touchstart",this._documentTouchStartListener),document.addEventListener("touchmove",this._documentTouchMoveListener),document.addEventListener("touchend",this._documentTouchEndListener)):(document.removeEventListener("click",this._documentClickListener),document.removeEventListener("touchstart",this._documentTouchStartListener),document.removeEventListener("touchmove",this._documentTouchMoveListener),document.removeEventListener("touchend",this._documentTouchEndListener))}set collapseOnFocusOut(e){e===!0?this.el.addEventListener("focusExit",this._focusExitListener):this.el.removeEventListener("focusExit",this._focusExitListener)}set collapseOnMouseOut(e){e===!0?(this.el.addEventListener("mouseleave",this._mouseLeaveListener),this.contentEl.addEventListener("mouseleave",this._mouseLeaveListener)):(this.el.removeEventListener("mouseleave",this._mouseLeaveListener),this.contentEl.removeEventListener("mouseleave",this._mouseLeaveListener))}get expanded(){return this.hostEl.getAttribute("aria-expanded")==="true"}set expanded(e){e===!0&&this.expanded===!1&&(this.hostEl.setAttribute("aria-expanded","true"),this.options.expandedClass&&this.el.classList.add(this.options.expandedClass),(this._expandWasKeyboardClickActivated||this._expandWasMouseClickActivated&&this.options.alwaysDoFocusManagement)&&C(this.options.focusManagement,this.contentEl),this.el.dispatchEvent(new CustomEvent("expander-expand",{bubbles:!0,detail:this.contentEl}))),e===!1&&this.expanded===!0&&(this.hostEl.setAttribute("aria-expanded","false"),this.options.expandedClass&&this.el.classList.remove(this.options.expandedClass),this.el.dispatchEvent(new CustomEvent("expander-collapse",{bubbles:!0,detail:this.contentEl}))),this._expandWasKeyboardClickActivated=!1,this._expandWasMouseClickActivated=!1,this._expandWasFocusActivated=!1,this._expandWasHoverActivated=!1,this._keyboardClickFlag=!1,this._mouseClickFlag=!1}sleep(){this._destroyed!==!0&&(this.expandOnClick=!1,this.expandOnFocus=!1,this.expandOnHover=!1,this.collapseOnClickOut=!1,this.collapseOnFocusOut=!1,this.collapseOnMouseOut=!1)}destroy(){this.sleep(),this._destroyed=!0,this._hostKeyDownListener=null,this._hostMouseDownListener=null,this._documentClickListener=null,this._documentTouchStartListener=null,this._documentTouchMoveListener=null,this._documentTouchEndListener=null,this._hostClickListener=null,this._hostFocusListener=null,this._hostHoverListener=null,this._focusExitListener=null,this._mouseLeaveListener=null}}exports.src_default=O;
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react"),x=require("./index-D3xZmuzJ.js"),y=require("classnames"),A=require("./common/component-utils/utils/index.js"),j=require("./icon-TuxfQndO.js");function V(t){return t.charAt(0).toLowerCase()+t.slice(1)}function z(t,e,n){if(!t.shiftKey){const i=t.key;switch(i){case"Enter":case"Escape":case"PageUp":case"PageDown":case"End":case"Home":case"ArrowLeft":case"ArrowUp":case"ArrowRight":case"ArrowDown":e.dispatchEvent(new CustomEvent(V(`${i}Key${n}`),{detail:t,bubbles:!0}));break;case" ":e.dispatchEvent(new CustomEvent(`spacebarKey${n}`,{detail:t,bubbles:!0}));break;default:return}}}function T(t){z(t,this,"Down")}function G(t){t.addEventListener("keydown",T)}function W(t){t.removeEventListener("keydown",T)}const Y={axis:"both",autoInit:"interactive",autoReset:"current",ignoreByDelegateSelector:null,wrap:!1};function p(t){return!t.hidden&&t.getAttribute("aria-disabled")!=="true"}function O(t,e){return e>=0&&e<t.length?p(t[e]):!1}function J(t){return t.filter(p)}function m(t){return t.findIndex(e=>p(e))}function C(t){return t.indexOf(J(t).reverse()[0])}function B(t,e,n){return t.findIndex(i=>p(i)&&i.getAttribute(e)===n)}function Q(t){return B(t,"aria-checked","true")}function R(t){return B(t,"aria-selected","true")}function w(t,e){return e.ignoreByDelegateSelector!==null?[...t.querySelectorAll(e.ignoreByDelegateSelector)]:[]}function X(t,e,n){let i=-1;if(e===null||ee(t,e))n===!0&&(i=C(t));else{let s=e;for(;--s>=0;)if(p(t[s])){i=s;break}}return i}function Z(t,e,n){let i=-1;if(e===null)i=m(t);else if(te(t,e))n===!0&&(i=m(t));else{let s=e;for(;++s<t.length;)if(p(t[s])){i=s;break}}return i}function K(t,e,n){let i=-1;switch(t){case"none":i=null;break;case"current":i=n;break;case"interactive":i=m(e);break;case"ariaChecked":i=Q(e);break;case"ariaSelected":i=R(e);break;case"ariaSelectedOrInteractive":i=R(e),i=i===-1?m(e):i;break;default:i=typeof t=="number"||t===null?t:-1}return i}function ee(t,e){return e===m(t)}function te(t,e){return e===C(t)}function ne(t){const e=w(this._el,this.options);(e.length===0||!e.includes(t.detail.target))&&(this.index=X(this.items,this.index,this.options.wrap))}function ie(t){const e=w(this._el,this.options);(e.length===0||!e.includes(t.detail.target))&&(this.index=Z(this.items,this.index,this.options.wrap))}function se(t){const e=this.indexOf(t.target.closest(this._itemSelector));O(this.items,e)&&(this.index=e)}function oe(t){const e=w(this._el,this.options);(e.length===0||!e.includes(t.detail.target))&&(this.index=m(this.items))}function re(t){const e=w(this._el,this.options);(e.length===0||!e.includes(t.detail.target))&&(this.index=C(this.items))}function ae(){this.options.autoReset!==null&&this.reset()}function ce(t){const e=this.index;let n=this.index;const{addedNodes:i,attributeName:s,removedNodes:o,target:u,type:h}=t[0];h==="attributes"?u===this.currentItem?s==="aria-disabled"?n=this.index:s==="hidden"&&(n=m(this.items)):n=this.index:h==="childList"&&(o.length>0&&[...o].includes(this._cachedElement)?n=m(this.items):(o.length>0||i.length>0)&&(n=this.indexOf(this._cachedElement))),this._index=n,this._el.dispatchEvent(new CustomEvent("navigationModelMutation",{bubbles:!1,detail:{fromIndex:e,toIndex:n}}))}class le{constructor(e,n,i){this.options=Object.assign({},Y,i),this._el=e,this._itemSelector=n}}class de extends le{constructor(e,n,i){super(e,n,i);const s=this._index,o=K(this.options.autoInit,this.items,this.index);this._index=o,this._cachedElement=this.items[o],this._el.dispatchEvent(new CustomEvent("navigationModelInit",{bubbles:!1,detail:{firstInteractiveIndex:this.firstNavigableIndex,fromIndex:s,items:this.items,toIndex:o}}))}get currentItem(){return this.items[this.index]}get items(){return[...this._el.querySelectorAll(`${this._itemSelector}`)]}get index(){return this._index}set index(e){if(e!==this.index&&O(this.items,e)){const n=this.index;this._cachedElement=this.items[e],this._index=e,this._el.dispatchEvent(new CustomEvent("navigationModelChange",{bubbles:!1,detail:{fromIndex:n,toIndex:e}}))}}indexOf(e){return this.items.indexOf(e)}reset(){const e=this.index,n=K(this.options.autoReset,this.items,this.index);n!==e&&(this._index=n,this._el.dispatchEvent(new CustomEvent("navigationModelReset",{bubbles:!1,detail:{fromIndex:e,toIndex:n}})))}}class ue{constructor(e,n){this.model=n,this.el=e,this._keyPrevListener=ne.bind(n),this._keyNextListener=ie.bind(n),this._keyHomeListener=oe.bind(n),this._keyEndListener=re.bind(n),this._clickListener=se.bind(n),this._focusExitListener=ae.bind(n),this._observer=new MutationObserver(ce.bind(n)),G(this.el),x.addFocusExit(this.el);const i=n.options.axis;(i==="both"||i==="x")&&(this.el.addEventListener("arrowLeftKeyDown",this._keyPrevListener),this.el.addEventListener("arrowRightKeyDown",this._keyNextListener)),(i==="both"||i==="y")&&(this.el.addEventListener("arrowUpKeyDown",this._keyPrevListener),this.el.addEventListener("arrowDownKeyDown",this._keyNextListener)),this.el.addEventListener("homeKeyDown",this._keyHomeListener),this.el.addEventListener("endKeyDown",this._keyEndListener),this.el.addEventListener("click",this._clickListener),this.el.addEventListener("focusExit",this._focusExitListener),this._observer.observe(this.el,{childList:!0,subtree:!0,attributeFilter:["aria-disabled","hidden"],attributes:!0,attributeOldValue:!0})}destroy(){W(this.el),x.removeFocusExit(this.el),this.el.removeEventListener("arrowLeftKeyDown",this._keyPrevListener),this.el.removeEventListener("arrowRightKeyDown",this._keyNextListener),this.el.removeEventListener("arrowUpKeyDown",this._keyPrevListener),this.el.removeEventListener("arrowDownKeyDown",this._keyNextListener),this.el.removeEventListener("homeKeyDown",this._keyHomeListener),this.el.removeEventListener("endKeyDown",this._keyEndListener),this.el.removeEventListener("click",this._clickListener),this.el.removeEventListener("focusExit",this._focusExitListener),this._observer.disconnect()}}function he(t,e,n){const i=new de(t,e,n);return new ue(t,i)}const fe={activeDescendantClassName:"active-descendant",autoInit:"none",autoReset:"none",autoScroll:!1,axis:"both",wrap:!1};function ve(t){const{items:e,toIndex:n}=t.detail,i=e[n];i&&(i.classList.add(this._options.activeDescendantClassName),this._focusEl.setAttribute("aria-activedescendant",i.id)),this._el.dispatchEvent(new CustomEvent("activeDescendantInit",{detail:t.detail}))}function me(t){const{fromIndex:e,toIndex:n}=t.detail,i=this.items[e],s=this.items[n];i&&i.classList.remove(this._options.activeDescendantClassName),s&&(s.classList.add(this._options.activeDescendantClassName),this._focusEl.setAttribute("aria-activedescendant",s.id),this._options.autoScroll&&this._itemContainerEl&&s.scrollIntoView({block:"center"})),this._el.dispatchEvent(new CustomEvent("activeDescendantChange",{detail:t.detail}))}function _e(t){const e=t.detail.toIndex,n=this._options.activeDescendantClassName;if(this.items.forEach(function(i){i.classList.remove(n)}),e!==null&&e!==-1){const i=this.items[e];i.classList.add(n),this._focusEl.setAttribute("aria-activedescendant",i.id)}else this._focusEl.removeAttribute("aria-activedescendant");this._el.dispatchEvent(new CustomEvent("activeDescendantReset",{detail:t.detail}))}function Ee(t){const{toIndex:e}=t.detail,n=this._options.activeDescendantClassName;this.items.forEach(function(i,s){x.src_default(i),s!==e?i.classList.remove(n):i.classList.add(n)}),this._el.dispatchEvent(new CustomEvent("activeDescendantMutation",{detail:t.detail}))}class pe{constructor(e){this._el=e,this._onMutationListener=Ee.bind(this),this._onChangeListener=me.bind(this),this._onResetListener=_e.bind(this),this._onInitListener=ve.bind(this),this._el.addEventListener("navigationModelMutation",this._onMutationListener),this._el.addEventListener("navigationModelChange",this._onChangeListener),this._el.addEventListener("navigationModelReset",this._onResetListener),this._el.addEventListener("navigationModelInit",this._onInitListener)}destroy(){this._el.removeEventListener("navigationModelMutation",this._onMutationListener),this._el.removeEventListener("navigationModelChange",this._onChangeListener),this._el.removeEventListener("navigationModelReset",this._onResetListener),this._el.removeEventListener("navigationModelInit",this._onInitListener)}}class be extends pe{constructor(e,n,i,s,o){super(e),this._options=Object.assign({},fe,o),this._focusEl=n,this._itemContainerEl=i,this._itemSelector=s,x.src_default(this._itemContainerEl),this._itemContainerEl!==this._focusEl&&n.setAttribute("aria-owns",this._itemContainerEl.id),this._navigationEmitter=he(e,s,{autoInit:this._options.autoInit,autoReset:this._options.autoReset,axis:this._options.axis,ignoreByDelegateSelector:this._options.ignoreByDelegateSelector,wrap:this._options.wrap}),this.items.forEach(function(u){x.src_default(u)})}get index(){return this._navigationEmitter.model.index}set index(e){this._navigationEmitter.model.index=e}reset(){this._navigationEmitter.model.reset()}get currentItem(){return this._navigationEmitter.model.currentItem}get items(){return this._navigationEmitter.model.items}set wrap(e){this._navigationEmitter.model.options.wrap=e}destroy(){super.destroy(),this._navigationEmitter.destroy()}}function ge(t,e,n,i,s){return new be(t,e,n,i,s)}function xe(){let t,e="";return{getIndex:function(n,i,s){e=e.concat(i);let o;if(n==null)return-1;const u=e.toLocaleLowerCase();return o=[...n].findIndex(h=>h.textContent.toLocaleLowerCase().startsWith(u)),o===-1&&(o=[...n].findIndex(h=>h.textContent.toLocaleLowerCase().includes(u))),setTimeout(()=>{clearTimeout(t),e=""},s),o},destroy:function(){}}}function Le(t){if(!t)return;const e=t.parentElement,n=t.offsetTop+t.offsetHeight,i=e.scrollTop+e.offsetHeight;t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:n>i&&(e.scrollTop=n-e.offsetHeight)}const S=({children:t,className:e,...n})=>r.createElement("div",{className:y("listbox__description",e),...n},t),H=({className:t,icon:e,text:n,children:i,disabled:s,tabIndex:o,selected:u,...h})=>{const l=A.filterByType(i,S),b=n||(l!=null&&l.length?"":i);return r.createElement("div",{...h,tabIndex:s?-1:o,className:y("listbox__option",t),"aria-disabled":s,"aria-selected":u,role:"option"},e?r.createElement("span",{className:"listbox__value"},e,b?r.createElement("span",null,b):null,l!=null&&l.length?l:null):r.createElement(r.Fragment,null,r.createElement("span",{className:"listbox__value"},b),l!=null&&l.length?l:null),r.createElement(j.EbayIcon,{name:"tick16"}))},ye=1300,we=({name:t,className:e,disabled:n,children:i,tabIndex:s=0,listSelection:o,maxHeight:u,typeaheadTimeoutLength:h,selectClassName:l,onChange:b=()=>{},onEscape:P=()=>{},...F})=>{var N;const v=A.filterByType(i,H),I=v.findIndex(a=>a.props.selected),[_,k]=r.useState(v.findIndex(a=>a.props.selected));r.useEffect(()=>{I!==_&&k(I)},[I]);const d=r.useRef(),E=r.useRef(),g=r.useRef(),L=r.useRef(!1);function D(a,c,f){c===_||v[c].props.disabled||(k(c),b(a,{index:c,selected:[v[c].props.value],wasClicked:f}))}function q(a){switch(a.code){case"Esc":case"Escape":P();break;case"Space":case"Enter":D(a,E.current.index,!1);break;default:return}const c=g.current.getIndex(d.current.children,a.key,h||ye);if(c!==-1){E.current.index=c;const f=d.current.querySelectorAll("[role=option]")[c];d.current.scrollTop=f.offsetTop-d.current.offsetHeight/2}}function U(){L.current=!0}return r.useEffect(()=>{const a=c=>{const f=parseInt(c.detail.toIndex,10),M=d.current?d.current.querySelectorAll("[role=option]")[_]:null,$=L.current;Le(M),L.current&&(L.current=!1),D(c,f,$)};if(v.length&&!n){const c=d.current,f=d.current;E.current=ge(c,f,f,".listbox__option[role=option]",{activeDescendantClassName:"listbox__option--active",autoInit:_,autoReset:null,autoScroll:o!=="auto"}),g.current=xe()}return o==="auto"&&d.current.addEventListener("activeDescendantChange",a),()=>{E.current&&(E.current.reset(),E.current.destroy(),E.current=void 0),g.current&&(g.current.destroy(),g.current=void 0),d.current&&d.current.removeEventListener("activeDescendantChange",a)}},[_,n,o]),r.createElement(r.Fragment,null,r.createElement("div",{...F,tabIndex:s,ref:d,role:"listbox",onKeyDown:o!=="auto"?q:void 0,className:y("listbox__options",e),style:{maxHeight:u}},v.map((a,c)=>r.cloneElement(a,{key:a.props.value||c,...a.props,onMouseDown:o==="auto"?U:void 0,onClick:f=>{o!=="auto"&&D(f,c,!0)},selected:c===_}))),r.createElement("select",{hidden:!0,className:y("listbox__native",l),name:t,value:(N=v[_])==null?void 0:N.props.value,onChange:()=>{}},v.map((a,c)=>r.createElement("option",{key:a.props.value||c,value:a.props.value,disabled:a.props.disabled}))))};exports.EbayListbox=we;exports.EbayListboxOption=H;exports.EbayListboxOptionDescription=S;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebay/ui-core-react",
3
- "version": "7.4.0-alpha.0",
3
+ "version": "7.4.0-alpha.1",
4
4
  "description": "Skin components build off React",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
@@ -1 +0,0 @@
1
- "use strict";const e=require("react"),ee=require("react-remove-scroll"),_=require("classnames"),te=require("makeup-screenreader-trap"),ne=require("makeup-keyboard-trap"),ae=require("./icon-TuxfQndO.js"),oe=require("./common/random-id/index.js"),re=require("./ebay-dialog-base/components/animation/index.js"),z=require("./ebay-dialog-base/components/dialog-header/index.js"),K=require("./ebay-dialog-base/components/dialog-footer/index.js"),ce=require("./icon-button-Cwaj-eT9.js");function G(a){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(n,r,l.get?l:{enumerable:!0,get:()=>a[r]})}}return n.default=a,Object.freeze(n)}const q=G(te),R=G(ne),h=({children:a})=>e.createElement(e.Fragment,null,a),le=({baseEl:a="div",classPrefix:n="drawer-dialog",windowClass:r,windowType:l,mainId:b,top:f,header:o,buttonPosition:c="right",children:p,ariaLabelledby:v,a11yCloseText:B,onCloseBtnClick:g=()=>{},footer:E,actions:d,onScroll:L,open:t=!1,onOpen:D=()=>{},onBackgroundClick:T=()=>{},ignoreEscape:J,closeButton:M,previousButton:Q,isModal:y,role:U="dialog",focus:I,transitionElement:V,animated:O,closeButtonClass:X,...S})=>{var H;const A=e.useRef(null),i=e.useRef(null),j=e.useRef(null),[Y,Z]=e.useState("");e.useEffect(()=>{Z(oe.randomId())},[]),e.useEffect(()=>{let s;const u=m=>{i.current&&!i.current.contains(m.target)&&T(m)};return t&&c!=="hidden"&&(s=window.setTimeout(()=>{document.addEventListener("click",u,!1)})),()=>{clearTimeout(s),document.removeEventListener("click",u,!1)}},[T,t]),e.useEffect(()=>(t&&y?(q.trap(i.current),R.trap(i.current)):(q.untrap(),R.untrap()),()=>{q.untrap(),R.untrap()}),[t,y]),re.useDialogAnimation({open:t,classPrefix:n,transitionElement:V,dialogRef:A,dialogWindowRef:i,enabled:O,onTransitionEnd:()=>C(t)});const w=s=>{!J&&s.key==="Escape"&&(s.stopPropagation(),g(s))};e.useEffect(()=>{O||C(t),t&&D()},[t]);function C(s){var u,m;if(s)return I?(u=I.current)==null||u.focus():y&&((m=j.current)==null||m.focus()),document.addEventListener("keydown",w,!1),()=>document.removeEventListener("keydown",w,!1)}const F=c!=="hidden"&&e.createElement("button",{ref:j,className:_("icon-btn",X,`${n}__close`,{"icon-btn--transparent":n==="toast-dialog"}),type:"button","aria-label":B,onClick:g},M||e.createElement(ae.EbayIcon,{name:"close16"})),x=l?`${n}__${l}-window`:`${n}__window`,W=((H=o==null?void 0:o.props)==null?void 0:H.id)||`dialog-title-${Y}`,P=v||W,N=o?e.cloneElement(o,{...o.props,id:W}):null;return e.createElement(a,{...S,"aria-labelledby":P,"aria-modal":"true",role:U,hidden:!t,className:_(n,S.className),"aria-live":y?void 0:"polite",ref:A,onKeyDown:w},e.createElement("div",{className:_(x,r),ref:i},f,N&&e.createElement("div",{className:`${n}__header`},Q,c==="right"&&N,c!=="bottom"&&F,(c==="left"||c==="hidden")&&N),e.createElement("div",{id:b,className:`${n}__main`,onScroll:L},p),d?e.createElement("div",{className:`${n}__actions`},d):null,E||c==="bottom"?e.createElement("div",{className:`${n}__footer`},E,c==="bottom"&&F):null))},se=({isModal:a,open:n,children:r,animated:l=!0,...b})=>{const f=a!==!1,o=e.Children.toArray(r),c=o.find(t=>t.type===z),p=o.find(t=>t.type===K),v=o.find(t=>t.type===$),B=o.find(t=>t.type===h),g=o.find(t=>t.type===k),E=o.filter(t=>![z,K,h,$,k].some(D=>D===t.type)),d=e.createElement(le,{...b,open:n,isModal:f,header:c,footer:p,actions:v,closeButton:B,previousButton:g,animated:l},E);return l||n?f?e.createElement(ee.RemoveScroll,{enabled:n},d):d:null},$=({children:a})=>e.createElement(e.Fragment,null,a),k=({className:a,icon:n,...r})=>e.createElement(ce.EbayIconButton,{...r,icon:n||"chevronLeft16",className:_(a,"lightbox-dialog__prev")});exports.DialogBaseWithState=se;exports.EbayDialogActions=$;exports.EbayDialogCloseButton=h;exports.EbayDialogPreviousButton=k;
@@ -1 +0,0 @@
1
- "use strict";const e=require("react"),H=require("makeup-active-descendant"),A=require("makeup-typeahead"),v=require("classnames"),L=require("./common/component-utils/utils/index.js"),B=require("./icon-TuxfQndO.js");function M(s){if(!s)return;const o=s.parentElement,l=s.offsetTop+s.offsetHeight,d=o.scrollTop+o.offsetHeight;s.offsetTop<o.scrollTop?o.scrollTop=s.offsetTop:l>d&&(o.scrollTop=l-o.offsetHeight)}const k=({children:s,className:o,...l})=>e.createElement("div",{className:v("listbox__description",o),...l},s),I=({className:s,icon:o,text:l,children:d,disabled:b,tabIndex:i,selected:h,...x})=>{const r=L.filterByType(d,k),m=l||(r!=null&&r.length?"":d);return e.createElement("div",{...x,tabIndex:b?-1:i,className:v("listbox__option",s),"aria-disabled":b,"aria-selected":h,role:"option"},o?e.createElement("span",{className:"listbox__value"},o,m?e.createElement("span",null,m):null,r!=null&&r.length?r:null):e.createElement(e.Fragment,null,e.createElement("span",{className:"listbox__value"},m),r!=null&&r.length?r:null),e.createElement(B.EbayIcon,{name:"tick16"}))},F=1300,K=({name:s,className:o,disabled:l,children:d,tabIndex:b=0,listSelection:i,maxHeight:h,typeaheadTimeoutLength:x,selectClassName:r,onChange:m=()=>{},onEscape:R=()=>{},...N})=>{var D;const u=L.filterByType(d,I),_=u.findIndex(t=>t.props.selected),[p,T]=e.useState(u.findIndex(t=>t.props.selected));e.useEffect(()=>{_!==p&&T(_)},[_]);const c=e.useRef(),f=e.useRef(),E=e.useRef(),y=e.useRef(!1);function g(t,n,a){n===p||u[n].props.disabled||(T(n),m(t,{index:n,selected:[u[n].props.value],wasClicked:a}))}function q(t){switch(t.code){case"Esc":case"Escape":R();break;case"Space":case"Enter":g(t,f.current.index,!1);break;default:return}const n=E.current.getIndex(c.current.children,t.key,x||F);if(n!==-1){f.current.index=n;const a=c.current.querySelectorAll("[role=option]")[n];c.current.scrollTop=a.offsetTop-c.current.offsetHeight/2}}function w(){y.current=!0}return e.useEffect(()=>{const t=n=>{const a=parseInt(n.detail.toIndex,10),C=c.current?c.current.querySelectorAll("[role=option]")[p]:null,O=y.current;M(C),y.current&&(y.current=!1),g(n,a,O)};if(u.length&&!l){const n=c.current,a=c.current;f.current=H.createLinear(n,a,a,".listbox__option[role=option]",{activeDescendantClassName:"listbox__option--active",autoInit:p,autoReset:null,autoScroll:i!=="auto"}),E.current=A()}return i==="auto"&&c.current.addEventListener("activeDescendantChange",t),()=>{f.current&&(f.current.reset(),f.current.destroy(),f.current=void 0),E.current&&(E.current.destroy(),E.current=void 0),c.current&&c.current.removeEventListener("activeDescendantChange",t)}},[p,l,i]),e.createElement(e.Fragment,null,e.createElement("div",{...N,tabIndex:b,ref:c,role:"listbox",onKeyDown:i!=="auto"?q:void 0,className:v("listbox__options",o),style:{maxHeight:h}},u.map((t,n)=>e.cloneElement(t,{key:t.props.value||n,...t.props,onMouseDown:i==="auto"?w:void 0,onClick:a=>{i!=="auto"&&g(a,n,!0)},selected:n===p}))),e.createElement("select",{hidden:!0,className:v("listbox__native",r),name:s,value:(D=u[p])==null?void 0:D.props.value,onChange:()=>{}},u.map((t,n)=>e.createElement("option",{key:t.props.value||n,value:t.props.value,disabled:t.props.disabled}))))};exports.EbayListbox=K;exports.EbayListboxOption=I;exports.EbayListboxOptionDescription=k;