@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
16 lines (15 loc) • 3.2 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-svg-icons")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-svg-icons"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactNotification={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoSvgIcons)}(this,(function(e,t,o,n,s){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var i=c(t);const r={success:"check-outline",error:"x-outline",info:"info-circle",warning:"exclamation-circle"},a={success:s.checkOutlineIcon,error:s.xOutlineIcon,info:s.infoCircleIcon,warning:s.exclamationCircleIcon},l=class e extends i.Component{render(){const{onClose:t,className:o,closable:c=e.defaultProps.closable,type:l=e.defaultProps.type}=this.props;return i.createElement("div",{dir:this.props.dir,className:"k-notification"+(o?` ${o}`:"")+("none"===l.style?"":` k-notification-${l.style}`)+(c?" k-notification-closable":""),style:this.props.style},l.icon&&i.createElement(n.IconWrap,{className:"k-notification-status",name:r[l.style],icon:a[l.style]}),i.createElement("div",{className:"k-notification-content"},this.props.children),c&&i.createElement("span",{className:"k-notification-actions"},i.createElement("span",{className:"k-notification-action k-notification-close-action",title:"Close",onClick:e=>{t&&t.call(void 0,{target:this,syntheticEvent:e,nativeEvent:e.nativeEvent})},..."boolean"!=typeof c?c:{}},i.createElement(n.IconWrap,{name:"x",icon:s.xIcon}))))}};l.propTypes={className:o.string,closable:o.oneOfType([o.bool,o.object]),dir:o.string,style:o.object,type:o.shape({style:o.oneOf(["none","success","error","warning","info"]),icon:o.bool}),onClose:o.func},l.defaultProps={closable:!1,type:{style:"none",icon:!0}};let p=l;const f=class extends i.Component{render(){const{style:e={},className:t}=this.props;return i.createElement("div",{className:"k-notification-group"+(t?` ${t}`:""),style:{alignItems:"center",flexWrap:"wrap",...e}},this.props.children)}};f.propTypes={className:o.string,style:o.object};let u=f;e.Notification=p,e.NotificationGroup=u}));