UNPKG

@lanaco/lnc-react-ui

Version:

React component library

38 lines (36 loc) 2.63 kB
"use strict";const s=require("react/jsx-runtime"),N=require("react"),e=require("./index-BPVoEhTF.cjs"),_=require("./emotion-styled.browser.esm-Cle7tAM9.cjs"),R=require("./react-toastify.esm-Dq1k28O7.cjs"),t=require("./utils-NZLCh-J5.cjs"),v=require("./ThemeProvider.cjs"),O=_.newStyled.div` & .lnc-notification { & > div { background-color: ${o=>t.getColorRgbaValue(o.theme,"Notification",o.color,"enabled","background","backgroundOpacity")}; box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05); border: ${o=>`1px solid ${t.getColorRgbaValue(o.theme,"Notification","default","enabled","border")}`}; border-radius: ${o=>t.getBorderRadiusValueWithUnits(o.theme,"regular")}; } & .Toastify__close-button { & svg { fill: ${o=>t.getColorRgbaValue(o.theme,"Notification","default","enabled","icon")}; } } & .Toastify__toast--success { & svg { fill: ${o=>t.getColorRgbaValue(o.theme,"Notification","success","enabled","icon")}; } } & .Toastify__toast--information { & svg { fill: ${o=>t.getColorRgbaValue(o.theme,"Notification","information","enabled","icon")}; } } & .Toastify__toast--danger { & svg { fill: ${o=>t.getColorRgbaValue(o.theme,"Notification","warning","enabled","icon")}; } } & .Toastify__toast--error { & svg { fill: ${o=>t.getColorRgbaValue(o.theme,"Notification","danger","enabled","icon")}; } } } `,r=N.forwardRef((o,a)=>{const{position:i="top-right",autoClose:n=5e5,hideProgressBar:l=!0,newestOnTop:c=!0,closeOnClick:p=!0,rtl:u=!1,pauseOnFocusLoss:b=!1,draggable:g=!1,pauseOnHover:f=!1,closeButton:d=!0,className:m="",style:y={},size:T="small",toastContainerProps:h,...P}=o,{theme:x}=v.useTheme(),C={theme:x,className:"lnc-ui-notification "+m,style:y,size:T};return s.jsx(O,{ref:a,...C,...P,children:s.jsx(R.ToastContainer,{position:i,autoClose:n,hideProgressBar:l,newestOnTop:c,closeOnClick:p,rtl:u,pauseOnFocusLoss:b,draggable:g,pauseOnHover:f,closeButton:d,className:"lnc-notification",...h})})});r.propTypes={position:e.PropTypes.oneOf(["top-right","top-center","top-left","bottom-right","bottom-center","bottom-left"]),autoClose:e.PropTypes.number,hideProgressBar:e.PropTypes.bool,newestOnTop:e.PropTypes.bool,closeOnClick:e.PropTypes.bool,rtl:e.PropTypes.bool,pauseOnFocusLoss:e.PropTypes.bool,draggable:e.PropTypes.bool,pauseOnHover:e.PropTypes.bool,closeButton:e.PropTypes.bool,className:e.PropTypes.string,style:e.PropTypes.object,toastContainerProps:e.PropTypes.any};module.exports=r;