@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
97 lines (96 loc) • 2.58 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
*-------------------------------------------------------------------------------------------
*/
import * as o from "react";
import e from "prop-types";
import { IconWrap as l } from "@progress/kendo-react-common";
import { exclamationCircleIcon as u, infoCircleIcon as b, xOutlineIcon as k, checkOutlineIcon as N, xIcon as E } from "@progress/kendo-svg-icons";
const d = "Close", g = {
success: "check-outline",
error: "x-outline",
info: "info-circle",
warning: "exclamation-circle"
}, v = {
success: N,
error: k,
info: b,
warning: u
}, r = {
closable: !1,
type: { style: "none", icon: !0 }
}, i = (f) => {
const {
children: m,
className: c,
dir: p,
style: y,
closable: n = r.closable,
type: t = r.type,
onClose: a
} = f;
return /* @__PURE__ */ o.createElement(
"div",
{
dir: p,
className: "k-notification" + (c ? ` ${c}` : "") + (t.style === "none" ? "" : ` k-notification-${t.style}`) + (n ? " k-notification-closable" : ""),
style: y
},
t.icon && /* @__PURE__ */ o.createElement(
l,
{
className: "k-notification-status",
name: g[t.style],
icon: v[t.style]
}
),
/* @__PURE__ */ o.createElement("div", { className: "k-notification-content" }, m),
n && /* @__PURE__ */ o.createElement("span", { className: "k-notification-actions" }, /* @__PURE__ */ o.createElement(
"span",
{
className: "k-notification-action k-notification-close-action",
title: d,
onClick: (s) => {
a && a({
target: i,
syntheticEvent: s,
nativeEvent: s.nativeEvent
});
},
...typeof n != "boolean" ? n : {}
},
/* @__PURE__ */ o.createElement(l, { name: "x", icon: E })
))
);
};
i.displayName = "Notification";
i.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
};
export {
i as Notification,
r as notificationDefaultProps
};