UNPKG

@payfit/unity-components

Version:

38 lines (37 loc) • 1.33 kB
import { Icon as e } from "../../../../../core/components/icon/Icon.js"; import { uyMerge as t, uyTv as n } from "@payfit/unity-themes"; import { jsx as r, jsxs as i } from "react/jsx-runtime"; //#region src/modules/ai-kit/components/ai-composer/parts/AIComposerAlert.tsx var a = n({ slots: { base: "uy:flex uy:items-start uy:gap-50", alertMessage: "uy:min-w-0 uy:whitespace-pre-wrap" }, variants: { variant: { warning: { alertMessage: "uy:typography-body-small uy:text-content-warning-high" }, error: { alertMessage: "uy:typography-body-small uy:text-content-danger" } } } }), o = ({ children: n, variant: o, className: s, ...c }) => { let { base: l, alertMessage: u } = a({ variant: o }), d = o === "error" ? "WarningCircleFilled" : "WarningFilled", f = o === "error" ? "content.danger" : "content.warning"; return /* @__PURE__ */ i("div", { ...c, role: o === "error" ? "alert" : "status", "aria-live": o === "error" ? "assertive" : "polite", className: t(l(), s), "data-unity-slot": "alert", "data-variant": o, children: [/* @__PURE__ */ r(e, { src: d, size: 20, color: f, "aria-hidden": "true", role: "presentation" }), /* @__PURE__ */ r("span", { className: u(), children: n })] }); }; o.displayName = "AIComposerAlert"; //#endregion export { o as AIComposerAlert };