@ebay/ui-core-react
Version:
Skin components build off React
2 lines (1 loc) • 1.15 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../tslib.es6-C4EgNkz1.js"),e=require("react"),E=require("classnames"),c=require("../notice-content-C0ZStfuX.js"),d=require("../notice-content-9iF4T8uB.js"),y=require("../utils-C9NL3q0j.js"),m=require("../icon-CR8ApQBy.js"),h=i=>{var{className:r,status:t="general",children:s,hidden:n=!1,"aria-label":l,onNoticeShow:u=()=>{}}=i,b=N.__rest(i,["className","status","children","hidden","aria-label","onNoticeShow"]);if(e.useEffect(()=>{n||u()},[n]),n)return null;const a=y.findComponent(s,c.EbayNoticeContent);if(!a)throw new Error("EbayInlineNotice: Please use a EbayNoticeContent that defines the content of the notice");const o=t==="general";return e.createElement("div",Object.assign({},b,{className:E(r,"inline-notice",{[`inline-notice--${t}`]:!o})}),o?null:e.createElement("span",{className:"inline-notice__header"},e.createElement(m.EbayIcon,{name:`${t}Filled16`,a11yText:l,a11yVariant:"label"})),e.createElement(d.NoticeContent,Object.assign({},a.props,{type:"inline"})))};exports.EbayNoticeContent=c.EbayNoticeContent;exports.EbayInlineNotice=h;
;