@ebay/ui-core-react 8.11.2 → 8.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/{combobox-cHR61pQI.js → combobox-DOcuo_sc.js} +1 -1
  2. package/common/floating-label-utils/hooks.d.ts +2 -2
  3. package/common/floating-label-utils/hooks.d.ts.map +1 -1
  4. package/ebay-chips-combobox/index.js +1 -1
  5. package/ebay-combobox/index.js +1 -1
  6. package/ebay-date-textbox/index.js +1 -1
  7. package/ebay-flag/index.js +1 -1
  8. package/ebay-icon/types.d.ts +1 -1
  9. package/ebay-icon/types.d.ts.map +1 -1
  10. package/ebay-listbox-button/index.js +1 -2
  11. package/ebay-listbox-button/listbox-button-option.d.ts +2 -1
  12. package/ebay-listbox-button/listbox-button-option.d.ts.map +1 -1
  13. package/ebay-listbox-button/listbox-button.d.ts +1 -0
  14. package/ebay-listbox-button/listbox-button.d.ts.map +1 -1
  15. package/ebay-number-input/index.js +1 -1
  16. package/ebay-phone-input/README.md +114 -0
  17. package/ebay-phone-input/countries.d.ts +11 -0
  18. package/ebay-phone-input/countries.d.ts.map +1 -0
  19. package/ebay-phone-input/index.d.ts +2 -0
  20. package/ebay-phone-input/index.d.ts.map +1 -0
  21. package/ebay-phone-input/index.js +1 -0
  22. package/ebay-phone-input/mask.d.ts +7 -0
  23. package/ebay-phone-input/mask.d.ts.map +1 -0
  24. package/ebay-phone-input/phone-input.d.ts +29 -0
  25. package/ebay-phone-input/phone-input.d.ts.map +1 -0
  26. package/ebay-select/index.js +1 -1
  27. package/ebay-svg/index.js +1 -1
  28. package/ebay-svg/symbols.d.ts.map +1 -1
  29. package/ebay-textbox/index.js +1 -1
  30. package/ebay-textbox/textbox.d.ts +1 -0
  31. package/ebay-textbox/textbox.d.ts.map +1 -1
  32. package/flag-DU-1tRv6.js +1 -0
  33. package/hooks-uidlIIid.js +1 -0
  34. package/listbox-button-rlxnsga8.js +2 -0
  35. package/package.json +1 -1
  36. package/textbox-Bp4UkkZJ.js +1 -0
  37. package/hooks-DTTigNDz.js +0 -1
  38. package/textbox-bggbXBGB.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../src/ebay-svg/symbols.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,OAAO,qBAk7BnB,CAAA"}
1
+ {"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../src/ebay-svg/symbols.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,OAAO,qBAw9BnB,CAAA"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../textbox-bggbXBGB.js");exports.EbayTextbox=x.EbayTextbox;exports.EbayTextboxPostfixIcon=x.EbayTextboxPostfixIcon;exports.EbayTextboxPostfixText=x.EbayTextboxPostfixText;exports.EbayTextboxPrefixIcon=x.EbayTextboxPrefixIcon;exports.EbayTextboxPrefixText=x.EbayTextboxPrefixText;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../textbox-Bp4UkkZJ.js");exports.EbayTextbox=x.EbayTextbox;exports.EbayTextboxPostfixIcon=x.EbayTextboxPostfixIcon;exports.EbayTextboxPostfixText=x.EbayTextboxPostfixText;exports.EbayTextboxPrefixIcon=x.EbayTextboxPrefixIcon;exports.EbayTextboxPrefixText=x.EbayTextboxPrefixText;
@@ -13,6 +13,7 @@ export type EbayTextboxProps = {
13
13
  defaultValue?: string;
14
14
  inputSize?: Size;
15
15
  floatingLabel?: string;
16
+ floatingLabelStatic?: boolean;
16
17
  onChange?: EbayChangeEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
17
18
  onInputChange?: EbayChangeEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
18
19
  onFocus?: EbayFocusEventHandler<HTMLTextAreaElement & HTMLInputElement, TextboxEventProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"textbox.d.ts","sourceRoot":"","sources":["../../src/ebay-textbox/textbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAEV,cAAc,EAEd,GAAG,EASN,MAAM,OAAO,CAAC;AAQf,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,YAAY,GAAI,QAAQ,OAAO,KAAG,OAAuC,CAAC;AAEvF,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC7F,aAAa,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAClG,OAAO,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC3F,MAAM,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC1F,UAAU,CAAC,EAA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C/D,YAAY,CAAC,EAAE,GAAG,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;;AAwJnH,wBAA6D"}
@@ -0,0 +1 @@
1
+ "use strict";const r=require("./tslib.es6-C4EgNkz1.js"),t=require("react"),l=require("classnames"),n=s=>{var{flag:e,className:a}=s,c=r.__rest(s,["flag","className"]);return t.createElement("span",Object.assign({className:l("fflag",a,`fflag--${e.toLowerCase()}`)},c))};exports.EbayFlagIcon=n;
@@ -0,0 +1 @@
1
+ "use strict";const g=require("./tslib.es6-C4EgNkz1.js"),a=require("react"),t=require("classnames"),s=require("makeup-floating-label"),{default:E=s}=s?.default?.__esModule?s.default:s;function y({text:n,disabled:_,invalid:m,size:N,opaqueLabel:C,static:i,containerTagName:L="span",onMount:d=()=>{}}){const r=a.useRef(null),c=a.useRef(null);a.useLayoutEffect(()=>{var e;(e=c.current)===null||e===void 0||e.refresh()}),a.useLayoutEffect(()=>{if(!(!n||i))return r.current&&(c.current=new E(r.current),d()),()=>{var e;(e=c.current)===null||e===void 0||e.destroy()}},[n,i]);const b=t("floating-label",{"floating-label--large":N==="large","floating-label--opaque":C}),v=a.useCallback(({children:e})=>a.createElement(a.Fragment,null,e),[]),p=a.useCallback(a.forwardRef((e,l)=>{var{className:o}=e,q=g.__rest(e,["className"]);return a.createElement(L,Object.assign({},q,{ref:u=>{r.current=u,typeof l=="function"?l(u):l&&(l.current=u)},className:t(o,b)}))}),[b]),f=t("floating-label__label",{"floating-label__label--disabled":_,"floating-label__label--invalid":m}),F=a.useCallback(e=>{var{className:l}=e,o=g.__rest(e,["className"]);return a.createElement("label",Object.assign({},o,{className:t(l,f)}),n)},[f,n]);return n?{Label:F,Container:p}:{Label:()=>null,Container:v}}exports.useFloatingLabel=y;
@@ -0,0 +1,2 @@
1
+ "use strict";const M=require("./tslib.es6-C4EgNkz1.js"),n=require("react"),L=require("classnames"),V=require("./icon-CR8ApQBy.js"),xe=require("./utils-C9NL3q0j.js"),ge=require("./dropdown-B2vObM4k.js"),W=u=>{var{value:p,children:v,selected:x,onClick:d,index:g,icon:E,innerRef:O,className:k}=u,C=M.__rest(u,["value","children","selected","onClick","index","icon","innerRef","className"]);const b=L("listbox-button__option",k,{"listbox-button__option--active":x});return n.createElement("div",Object.assign({},C,{className:b,role:"option","aria-selected":x,ref:O,onClick:_=>{d(_,p,g)}}),n.createElement("span",{className:"listbox-button__value"},E,v),n.createElement(V.EbayIcon,{name:"tick16"}))},Ee=u=>{var p,{children:v,name:x,value:d,selected:g,borderless:E,fluid:O,className:k,maxHeight:C,prefixId:b,prefixLabel:_,floatingLabel:h,split:S,unselectedText:z="-",onChange:T=()=>{},onCollapse:G=()=>{},onExpand:J=()=>{}}=u,Q=M.__rest(u,["children","name","value","selected","borderless","fluid","className","maxHeight","prefixId","prefixLabel","floatingLabel","split","unselectedText","onChange","onCollapse","onExpand"]);const i=n.useRef(null),w=n.useRef(new Map),a=xe.filterByType(v,W);if(!a.length)throw new Error(`EbayListboxButton: Please use a
2
+ EbayListboxButtonOption that defines the options of the listbox`);const X=()=>{const e=g!==void 0?g:a.findIndex(({props:l})=>d!==void 0&&l.value===d||l.selected),t=e>-1||h?e:void 0;return{option:a[t],index:t}},{option:D,index:I}=X(),[s,f]=n.useState(D),[o,R]=n.useState(I),[m,H]=n.useState(),[Y,Z]=n.useState(!1),[A,q]=n.useState(),{overlayStyles:ee,refs:y}=ge.useFloatingDropdown({open:m}),N=y.host,te=y.overlay;n.useEffect(()=>{f(D)},[d]);const c=n.Children.toArray(v),$=e=>c[e].props.value,ne=n.useCallback(e=>c.findIndex(({props:t})=>t.value===e),[c]),oe=e=>w.current.get(e),r=()=>{H(!1),G()},se=()=>{H(!0),J()},le=()=>{m?r():se()},j=(e,t)=>{f(c[t]),R(t),r(),N.current.focus(),T(e,{index:t,selected:[String($(t))],wasClicked:A}),q(!1)},ae=()=>{r(),f(c[I])},ce=e=>{const t=i.current.children[e];t.setAttribute("aria-selected","true"),t.classList.add("listbox-button__option--active")},ie=e=>{const t=i.current.children[e];t.setAttribute("aria-selected","false"),t.classList.remove("listbox-button__option--active")},re=e=>{const t=te.current,l=oe(e);if(t.scrollHeight>t.clientHeight){const ve=t.clientHeight+t.scrollTop,U=l.offsetTop+l.offsetHeight;U>ve?t.scrollTop=U-t.clientHeight:l.offsetTop<t.scrollTop&&(t.scrollTop=l.offsetTop)}},F=e=>{ce(o===void 0||e===-1?0:e),ie(o===void 0||o===-1?0:o),re(e),R(e),f(c[e])},K=e=>setTimeout(()=>{var t;return(t=i?.current)===null||t===void 0?void 0:t.focus(e)},0),ue=()=>{le(),K({preventScroll:!0})},pe=e=>{switch(e.key){case"Escape":r();break;case"Enter":K();break}},de=e=>{switch(e.key){case" ":case"PageUp":case"PageDown":case"Home":case"End":e.preventDefault();break;case"Down":case"ArrowDown":e.preventDefault(),o!==a.length-1&&F(o<a.length-1?o+1:0);break;case"Up":case"ArrowUp":e.preventDefault(),o!==0&&F(o>0?o-1:a.length-1);break;case"Enter":r(),setTimeout(()=>f(c[o])),setTimeout(()=>N.current.focus(),0),T(e,{index:o,selected:[String($(o))],wasClicked:A});break;case"Esc":case"Escape":ae();break}},B=a.map((e,t)=>n.cloneElement(e,{index:t,key:t,selected:s&&e.props.value===s.props.value,id:e.props.id||`listbox_btn_${e.props.value}_${t}`,onClick:l=>j(l,t),innerRef:l=>{l?w.current.set(t,l):w.current.delete(t)}})),be=L("listbox-button",k,{"listbox-button--fluid":O}),fe=L("btn",{"btn--form":!E,"btn--borderless":E,"btn--floating-label":h&&s,[`btn--split-${S}`]:S!=="none"}),P=b&&"expand-btn-text",me=n.createElement(n.Fragment,null,h&&n.createElement("span",{className:"btn__floating-label"},h),_&&n.createElement("span",{className:"btn__label"},_),n.createElement("span",{className:"btn__text",id:P},s?.props.icon||s?.props.children||z));return n.createElement("span",{className:be},n.createElement("button",Object.assign({},Q,{onFocus:()=>Z(!0),type:"button",className:fe,"aria-expanded":!!m,"aria-haspopup":"listbox","aria-labelledby":b&&`${b} ${P}`,onClick:ue,onMouseDown:e=>e.preventDefault(),onKeyUp:pe,ref:y.setHost}),n.createElement("span",{className:"btn__cell"},me,n.createElement(V.EbayIcon,{name:"chevronDown16"}))),(m||Y)&&n.createElement("div",{className:"listbox-button__listbox",ref:y.setOverlay,style:Object.assign(Object.assign({},ee),{maxHeight:C})},n.createElement("div",{className:"listbox-button__options",role:"listbox",tabIndex:m?0:-1,ref:i,"aria-activedescendant":(p=B[o])===null||p===void 0?void 0:p.props.id,onKeyDown:e=>de(e),onMouseDown:e=>{e.preventDefault(),q(!0)},onBlur:()=>{r(),setTimeout(()=>N.current.focus(),0)}},B)),n.createElement("select",{hidden:!0,className:"listbox-button__native",name:x,onChange:e=>j(e,ne(e.target.value)),value:s?s?.props.value:""},B.map((e,t)=>n.createElement("option",{value:e.props.value,key:t}))))};exports.ListboxButton=Ee;exports.ListboxOption=W;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebay/ui-core-react",
3
- "version": "8.11.2",
3
+ "version": "8.12.0",
4
4
  "description": "Skin components build off React",
5
5
  "keywords": [
6
6
  "React",
@@ -0,0 +1 @@
1
+ "use strict";const m=require("./tslib.es6-C4EgNkz1.js"),o=require("react"),re=require("classnames"),ce=require("./forwardRef-DBQKIlPy.js"),f=require("./utils-C9NL3q0j.js"),L=require("./icon-CR8ApQBy.js"),ue=require("./icon-button-B1aE4GTn.js"),de=require("./hooks-uidlIIid.js"),w=n=>{var{children:l,name:a,buttonAriaLabel:i,onClick:u=()=>{}}=n,r=m.__rest(n,["children","name","buttonAriaLabel","onClick"]);return a?i?o.createElement(ue.EbayIconButton,Object.assign({"aria-label":i,icon:a,transparent:!0,onClick:u},r)):o.createElement(L.EbayIcon,Object.assign({name:a},r)):l},K=n=>o.createElement("span",Object.assign({},n)),P=n=>{var{children:l,name:a}=n,i=m.__rest(n,["children","name"]);return a?o.createElement(L.EbayIcon,Object.assign({name:a},i)):l},F=n=>o.createElement("span",Object.assign({},n)),y=n=>typeof n<"u",be=n=>{var l,a,{type:i="text",invalid:u,fluid:r,multiline:_,onChange:q=()=>{},onInputChange:B=()=>{},onFocus:j=()=>{},onBlur:k=()=>{},onKeyPress:O=()=>{},onKeyUp:V=()=>{},onKeyDown:N=()=>{},onInvalid:S=()=>{},onFloatingLabelInit:R=()=>{},onButtonClick:D=()=>{},autoFocus:h,defaultValue:p="",value:g,forwardedRef:U,inputSize:E="default",floatingLabel:z,floatingLabelStatic:A,children:d,placeholder:M,opaqueLabel:W}=n,c=m.__rest(n,["type","invalid","fluid","multiline","onChange","onInputChange","onFocus","onBlur","onKeyPress","onKeyUp","onKeyDown","onInvalid","onFloatingLabelInit","onButtonClick","autoFocus","defaultValue","value","forwardedRef","inputSize","floatingLabel","floatingLabelStatic","children","placeholder","opaqueLabel"]);const[C,$]=o.useState(p),[G,H]=o.useState(p),I=de.useFloatingLabel({text:z,disabled:c.disabled,size:E,invalid:u,opaqueLabel:W,static:A||i==="date",onMount:R,containerTagName:r?"div":"span"}),T=t=>{var e;j(t,{value:((e=t?.target)===null||e===void 0?void 0:e.value)||p})},J=t=>{var e;const s=(e=t.target)===null||e===void 0?void 0:e.value;k(t,{value:s}),s!==C&&(q(t,{value:s}),$(s))},Q=t=>{const e=t.target;O(t,{value:e?.value})},X=t=>{const e=t.target;V(t,{value:e?.value})},Y=t=>{const e=t.target;N(t,{value:e?.value})},Z=t=>{const e=t.target;S(t,{value:e?.value})},ee=t=>{D(t,{value:C})};o.useEffect(()=>{h&&T()},[]);const te=t=>{var e;const s=(e=t.target)===null||e===void 0?void 0:e.value;y(g)||H(s),B(t,{value:s})},ne=_?"textarea":"input",oe=r?"div":"span",ae=f.findComponent(d,P),b=f.findComponent(d,F),le=(l=b?.props)===null||l===void 0?void 0:l.id,x=f.findComponent(d,w),v=f.findComponent(d,K),ie=(a=v?.props)===null||a===void 0?void 0:a.id,se=re("textbox",c.className,{"textbox--fluid":r,"textbox--large":E==="large","textbox--disabled":c.disabled,"textbox--invalid":u,"textbox--readonly":c.readOnly});return o.createElement(I.Container,null,o.createElement(I.Label,{htmlFor:c.id}),o.createElement(oe,{className:se},ae,b,o.createElement(ne,Object.assign({"aria-describedby":[le,ie].filter(Boolean).join(" ")||void 0},c,{className:"textbox__control",type:i,"aria-invalid":u,value:y(g)?g:G,onChange:te,onBlur:J,onFocus:T,onKeyPress:Q,onKeyUp:X,onKeyDown:Y,onInvalid:Z,autoFocus:h,ref:U,placeholder:M})),v,x&&o.cloneElement(x,Object.assign(Object.assign({},x.props),{onClick:t=>{const{onClick:e=()=>{}}=x.props;e(t),ee(t)}}))))},xe=ce.withForwardRef(be);exports.EbayTextbox=xe;exports.EbayTextboxPostfixIcon=w;exports.EbayTextboxPostfixText=K;exports.EbayTextboxPrefixIcon=P;exports.EbayTextboxPrefixText=F;exports.isControlled=y;
package/hooks-DTTigNDz.js DELETED
@@ -1 +0,0 @@
1
- "use strict";const g=require("./tslib.es6-C4EgNkz1.js"),a=require("react"),t=require("classnames"),s=require("makeup-floating-label"),{default:E=s}=s?.default?.__esModule?s.default:s;function j({text:n,disabled:_,invalid:m,size:N,type:u,opaqueLabel:C,containerTagName:L="span",onMount:d=()=>{}}){const r=a.useRef(null),c=a.useRef(null);a.useLayoutEffect(()=>{var e;(e=c.current)===null||e===void 0||e.refresh()}),a.useLayoutEffect(()=>{if(!(!n||u==="date"))return r.current&&(c.current=new E(r.current),d()),()=>{var e;(e=c.current)===null||e===void 0||e.destroy()}},[n,u]);const b=t("floating-label",{"floating-label--large":N==="large","floating-label--opaque":C}),v=a.useCallback(({children:e})=>a.createElement(a.Fragment,null,e),[]),F=a.useCallback(a.forwardRef((e,l)=>{var{className:o}=e,q=g.__rest(e,["className"]);return a.createElement(L,Object.assign({},q,{ref:i=>{r.current=i,typeof l=="function"?l(i):l&&(l.current=i)},className:t(o,b)}))}),[b]),f=t("floating-label__label",{"floating-label__label--disabled":_,"floating-label__label--invalid":m}),p=a.useCallback(e=>{var{className:l}=e,o=g.__rest(e,["className"]);return a.createElement("label",Object.assign({},o,{className:t(l,f)}),n)},[f,n]);return n?{Label:p,Container:F}:{Label:()=>null,Container:v}}exports.useFloatingLabel=j;
@@ -1 +0,0 @@
1
- "use strict";const m=require("./tslib.es6-C4EgNkz1.js"),o=require("react"),se=require("classnames"),re=require("./forwardRef-DBQKIlPy.js"),p=require("./utils-C9NL3q0j.js"),w=require("./icon-CR8ApQBy.js"),ce=require("./icon-button-B1aE4GTn.js"),ue=require("./hooks-DTTigNDz.js"),K=t=>{var{children:l,name:a,buttonAriaLabel:i,onClick:u=()=>{}}=t,r=m.__rest(t,["children","name","buttonAriaLabel","onClick"]);return a?i?o.createElement(ce.EbayIconButton,Object.assign({"aria-label":i,icon:a,transparent:!0,onClick:u},r)):o.createElement(w.EbayIcon,Object.assign({name:a},r)):l},L=t=>o.createElement("span",Object.assign({},t)),P=t=>{var{children:l,name:a}=t,i=m.__rest(t,["children","name"]);return a?o.createElement(w.EbayIcon,Object.assign({name:a},i)):l},F=t=>o.createElement("span",Object.assign({},t)),g=t=>typeof t<"u",de=t=>{var l,a,{type:i="text",invalid:u,fluid:r,multiline:_,onChange:q=()=>{},onInputChange:B=()=>{},onFocus:j=()=>{},onBlur:k=()=>{},onKeyPress:O=()=>{},onKeyUp:V=()=>{},onKeyDown:N=()=>{},onInvalid:R=()=>{},onFloatingLabelInit:D=()=>{},onButtonClick:S=()=>{},autoFocus:h,defaultValue:f="",value:y,forwardedRef:U,inputSize:E="default",floatingLabel:z,children:d,placeholder:A,opaqueLabel:M}=t,c=m.__rest(t,["type","invalid","fluid","multiline","onChange","onInputChange","onFocus","onBlur","onKeyPress","onKeyUp","onKeyDown","onInvalid","onFloatingLabelInit","onButtonClick","autoFocus","defaultValue","value","forwardedRef","inputSize","floatingLabel","children","placeholder","opaqueLabel"]);const[C,W]=o.useState(f),[$,G]=o.useState(f),I=ue.useFloatingLabel({text:z,disabled:c.disabled,size:E,invalid:u,type:i,opaqueLabel:M,onMount:D,containerTagName:r?"div":"span"}),T=n=>{var e;j(n,{value:((e=n?.target)===null||e===void 0?void 0:e.value)||f})},H=n=>{var e;const s=(e=n.target)===null||e===void 0?void 0:e.value;k(n,{value:s}),s!==C&&(q(n,{value:s}),W(s))},J=n=>{const e=n.target;O(n,{value:e?.value})},Q=n=>{const e=n.target;V(n,{value:e?.value})},X=n=>{const e=n.target;N(n,{value:e?.value})},Y=n=>{const e=n.target;R(n,{value:e?.value})},Z=n=>{S(n,{value:C})};o.useEffect(()=>{h&&T()},[]);const ee=n=>{var e;const s=(e=n.target)===null||e===void 0?void 0:e.value;g(y)||G(s),B(n,{value:s})},ne=_?"textarea":"input",te=r?"div":"span",oe=p.findComponent(d,P),x=p.findComponent(d,F),ae=(l=x?.props)===null||l===void 0?void 0:l.id,b=p.findComponent(d,K),v=p.findComponent(d,L),le=(a=v?.props)===null||a===void 0?void 0:a.id,ie=se("textbox",c.className,{"textbox--fluid":r,"textbox--large":E==="large","textbox--disabled":c.disabled,"textbox--invalid":u,"textbox--readonly":c.readOnly});return o.createElement(I.Container,null,o.createElement(I.Label,{htmlFor:c.id}),o.createElement(te,{className:ie},oe,x,o.createElement(ne,Object.assign({"aria-describedby":[ae,le].filter(Boolean).join(" ")||void 0},c,{className:"textbox__control",type:i,"aria-invalid":u,value:g(y)?y:$,onChange:ee,onBlur:H,onFocus:T,onKeyPress:J,onKeyUp:Q,onKeyDown:X,onInvalid:Y,autoFocus:h,ref:U,placeholder:A})),v,b&&o.cloneElement(b,Object.assign(Object.assign({},b.props),{onClick:n=>{const{onClick:e=()=>{}}=b.props;e(n),Z(n)}}))))},xe=re.withForwardRef(de);exports.EbayTextbox=xe;exports.EbayTextboxPostfixIcon=K;exports.EbayTextboxPostfixText=L;exports.EbayTextboxPrefixIcon=P;exports.EbayTextboxPrefixText=F;exports.isControlled=g;