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.28 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 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 f=require("react"),e=require("prop-types"),u=require("@progress/kendo-react-common"),r=require("@progress/kendo-svg-icons");function m(i){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(c,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return c.default=i,Object.freeze(c)}const o=m(f),y="Close",d={success:"check-outline",error:"x-outline",info:"info-circle",warning:"exclamation-circle"},b={success:r.checkOutlineIcon,error:r.xOutlineIcon,info:r.infoCircleIcon,warning:r.exclamationCircleIcon},s=class s extends o.Component{render(){const{onClose:c,className:t,closable:n=s.defaultProps.closable,type:a=s.defaultProps.type}=this.props;return o.createElement("div",{dir:this.props.dir,className:"k-notification"+(t?` ${t}`:"")+(a.style==="none"?"":` k-notification-${a.style}`)+(n?" k-notification-closable":""),style:this.props.style},a.icon&&o.createElement(u.IconWrap,{className:"k-notification-status",name:d[a.style],icon:b[a.style]}),o.createElement("div",{className:"k-notification-content"},this.props.children),n&&o.createElement("span",{className:"k-notification-actions"},o.createElement("span",{className:"k-notification-action k-notification-close-action",title:y,onClick:p=>{c&&c.call(void 0,{target:this,syntheticEvent:p,nativeEvent:p.nativeEvent})},...typeof n!="boolean"?n:{}},o.createElement(u.IconWrap,{name:"x",icon:r.xIcon}))))}};s.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},s.defaultProps={closable:!1,type:{style:"none",icon:!0}};let l=s;exports.Notification=l;