@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.16 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 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,n,o,i){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var s=c(t);const a={success:"check-outline",error:"x-outline",info:"info-circle",warning:"exclamation-circle"},r={success:i.checkOutlineIcon,error:i.xOutlineIcon,info:i.infoCircleIcon,warning:i.exclamationCircleIcon},l={closable:!1,type:{style:"none",icon:!0}},p=e=>{const{children:t,className:n,dir:c,style:f,closable:y=l.closable,type:m=l.type,onClose:u}=e;return s.createElement("div",{dir:c,className:"k-notification"+(n?` ${n}`:"")+("none"===m.style?"":` k-notification-${m.style}`)+(y?" k-notification-closable":""),style:f},m.icon&&s.createElement(o.IconWrap,{className:"k-notification-status",name:a[m.style],icon:r[m.style]}),s.createElement("div",{className:"k-notification-content"},t),y&&s.createElement("span",{className:"k-notification-actions"},s.createElement("span",{className:"k-notification-action k-notification-close-action",title:"Close",onClick:e=>{u&&u({target:p,syntheticEvent:e,nativeEvent:e.nativeEvent})},..."boolean"!=typeof y?y:{}},s.createElement(o.IconWrap,{name:"x",icon:i.xIcon}))))};p.displayName="Notification",p.propTypes={className:n.string,closable:n.oneOfType([n.bool,n.object]),dir:n.string,style:n.object,type:n.shape({style:n.oneOf(["base","secondary","success","error","light","inverse","primary","tertiary","warning","info","dark"]),icon:n.bool}),onClose:n.func};const f={style:{}},y=e=>{const{style:t=f.style,className:n,children:o}=e;return s.createElement("div",{className:"k-notification-group"+(n?` ${n}`:""),style:{alignItems:"center",flexWrap:"wrap",...t}},o)};y.displayName="NotificationGroup",y.propTypes={className:n.string,style:n.object},e.Notification=p,e.NotificationGroup=y});