@trail-ui/react
Version:
44 lines (42 loc) • 1.94 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/alert/alert-icon.tsx
var alert_icon_exports = {};
__export(alert_icon_exports, {
AlertIcon: () => AlertIcon
});
module.exports = __toCommonJS(alert_icon_exports);
var import_icons = require("@trail-ui/icons");
var import_shared_utils = require("@trail-ui/shared-utils");
var import_jsx_runtime = require("react/jsx-runtime");
var ICONS = {
info: { outline: import_icons.InfoIcon, filled: import_icons.InfoFilledIcon },
yellow: { outline: import_icons.ExclamationCircleIcon, filled: import_icons.ExclamationCircleFilledIcon },
green: { outline: import_icons.CheckCircleIcon, filled: import_icons.CheckCircleFilledIcon },
error: { outline: import_icons.XCircleIcon, filled: import_icons.XCircleFilledIcon }
};
var AlertIcon = (props) => {
const { type = "info", filled = false, className, ...rest } = props;
const Icon = filled ? ICONS[type].filled : ICONS[type].outline;
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: (0, import_shared_utils.clsx)("h-6 w-6 shrink-0", className), ...rest });
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
AlertIcon
});