UNPKG

@progress/kendo-react-notification

Version:

React Notification renders a message to the user with information about the status of an app process. KendoReact Notification package

9 lines (8 loc) 2.22 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),e=require("prop-types"),p=require("@progress/kendo-react-common"),a=require("@progress/kendo-svg-icons");function d(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(c,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return c.default=t,Object.freeze(c)}const o=d(b),g="Close",k={success:"check-outline",error:"x-outline",info:"info-circle",warning:"exclamation-circle"},N={success:a.checkOutlineIcon,error:a.xOutlineIcon,info:a.infoCircleIcon,warning:a.exclamationCircleIcon},f={closable:!1,type:{style:"none",icon:!0}},l=t=>{const{children:c,className:n,dir:s,style:y,closable:r=f.closable,type:i=f.type,onClose:u}=t;return o.createElement("div",{dir:s,className:"k-notification"+(n?` ${n}`:"")+(i.style==="none"?"":` k-notification-${i.style}`)+(r?" k-notification-closable":""),style:y},i.icon&&o.createElement(p.IconWrap,{className:"k-notification-status",name:k[i.style],icon:N[i.style]}),o.createElement("div",{className:"k-notification-content"},c),r&&o.createElement("span",{className:"k-notification-actions"},o.createElement("span",{className:"k-notification-action k-notification-close-action",title:g,onClick:m=>{u&&u({target:l,syntheticEvent:m,nativeEvent:m.nativeEvent})},...typeof r!="boolean"?r:{}},o.createElement(p.IconWrap,{name:"x",icon:a.xIcon}))))};l.displayName="Notification";l.propTypes={className:e.string,closable:e.oneOfType([e.bool,e.object]),dir:e.string,style:e.object,type:e.shape({style:e.oneOf(["base","secondary","success","error","light","inverse","primary","tertiary","warning","info","dark"]),icon:e.bool}),onClose:e.func};exports.Notification=l;exports.notificationDefaultProps=f;