UNPKG

analytica-frontend-lib

Version:

Repositório público dos componentes utilizados nas plataformas da Analytica Ensino

87 lines (80 loc) 3.26 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _chunkANT66KVKjs = require('./chunk-ANT66KVK.js'); var _chunkTN3AYOMVjs = require('./chunk-TN3AYOMV.js'); // src/components/Alert/Alert.tsx var _CheckCircle = require('@phosphor-icons/react/dist/csr/CheckCircle'); var _Info = require('@phosphor-icons/react/dist/csr/Info'); var _WarningCircle = require('@phosphor-icons/react/dist/csr/WarningCircle'); var _XCircle = require('@phosphor-icons/react/dist/csr/XCircle'); var _jsxruntime = require('react/jsx-runtime'); var VARIANT_ACTION_CLASSES = { solid: { default: "bg-background-50 border-transparent", info: "bg-info border-transparent", success: "bg-success border-transparent", warning: "bg-warning border-transparent", error: "bg-error border-transparent" }, outline: { default: "bg-background border border-border-100", info: "bg-background border border-border-100", success: "bg-background border border-border-100", warning: "bg-background border border-border-100", error: "bg-background border border-border-100" } }; var COLOR_CLASSES = { default: "text-text-950", info: "text-info-800", success: "text-success-800", warning: "text-warning-800", error: "text-error-800" }; var ICONS = { default: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _CheckCircle.CheckCircleIcon, { size: 18 }), info: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _Info.InfoIcon, { size: 18 }), success: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _CheckCircle.CheckCircleIcon, { size: 18 }), warning: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _WarningCircle.WarningCircleIcon, { size: 18 }), error: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _XCircle.XCircleIcon, { size: 18 }) }; var Alert = ({ variant = "solid", title, description, action = "default", className, ...props }) => { const baseClasses = "alert-wrapper flex items-start gap-2 w-[384px] py-3 px-4 font-inherit rounded-md"; const variantClasses = VARIANT_ACTION_CLASSES[variant][action]; const variantColor = COLOR_CLASSES[action]; const variantIcon = ICONS[action]; const hasHeading = Boolean(title); return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkTN3AYOMVjs.cn.call(void 0, baseClasses, variantClasses, className), ...props, children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunkTN3AYOMVjs.cn.call(void 0, "mt-0.5", variantColor), children: variantIcon }), /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [ hasHeading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { size: "md", weight: "medium", color: variantColor, className: "mb-0.5", children: title } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { size: hasHeading ? "sm" : "md", weight: "normal", color: !hasHeading ? variantColor : "text-text-700", children: description } ) ] }) ] }); }; var Alert_default = Alert; exports.Alert_default = Alert_default; //# sourceMappingURL=chunk-CFD6NHL7.js.map