UNPKG

@lanaco/lnc-react-ui

Version:

React component library

38 lines (36 loc) 2.11 kB
"use strict";const t=require("react/jsx-runtime"),N=require("react"),y=require("./emotion-styled.browser.esm-DwHBgTPn.cjs"),R=require("./react-toastify.esm-C6GBR4r3.cjs"),o=require("./utils-BK6B_Y9X.cjs"),T=require("./ThemeProvider.cjs"),v=y.styled.div` & .lnc-notification { & > div { background-color: ${e=>o.getColorRgbaValue(e.theme,"Notification",e.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: ${e=>`1px solid ${o.getColorRgbaValue(e.theme,"Notification","default","enabled","border")}`}; border-radius: ${e=>o.getBorderRadiusValueWithUnits(e.theme,"regular")}; } & .Toastify__close-button { & svg { fill: ${e=>o.getColorRgbaValue(e.theme,"Notification","default","enabled","icon")}; } } & .Toastify__toast--success { & svg { fill: ${e=>o.getColorRgbaValue(e.theme,"Notification","success","enabled","icon")}; } } & .Toastify__toast--information { & svg { fill: ${e=>o.getColorRgbaValue(e.theme,"Notification","information","enabled","icon")}; } } & .Toastify__toast--danger { & svg { fill: ${e=>o.getColorRgbaValue(e.theme,"Notification","warning","enabled","icon")}; } } & .Toastify__toast--error { & svg { fill: ${e=>o.getColorRgbaValue(e.theme,"Notification","danger","enabled","icon")}; } } } `,$=N.forwardRef((e,i)=>{const{position:a="top-right",autoClose:s=5e5,hideProgressBar:r=!0,newestOnTop:n=!0,closeOnClick:l=!0,rtl:c=!1,pauseOnFocusLoss:u=!1,draggable:f=!1,pauseOnHover:g=!1,closeButton:d=!0,className:b="",style:m={},size:h="small",toastContainerProps:p,...x}=e,{theme:_}=T.useTheme(),C={theme:_,className:"lnc-ui-notification "+b,style:m,size:h};return t.jsx(v,{ref:i,...C,...x,children:t.jsx(R.ToastContainer,{position:a,autoClose:s,hideProgressBar:r,newestOnTop:n,closeOnClick:l,rtl:c,pauseOnFocusLoss:u,draggable:f,pauseOnHover:g,closeButton:d,className:"lnc-notification",...p})})});module.exports=$;