@payfit/unity-components
Version:
35 lines (34 loc) • 1.28 kB
JavaScript
import { useMemo as e } from "react";
import { uyTv as t } from "@payfit/unity-themes";
import { jsx as n, jsxs as r } from "react/jsx-runtime";
import { useTranslation as i } from "react-i18next";
import { Icon as a } from "@payfit/unity-icons";
//#region src/modules/tanstack-form/components/password-field/parts/ValidationRuleItem.tsx
var o = t({ slots: {
root: ["uy:flex uy:items-center uy:gap-50 uy:typography-body-small"],
label: ["uy:text-content-neutral"]
} });
function s({ id: t, label: s, status: c }) {
let { t: l } = i("unity"), u = c === "checked", d = e(() => u ? /* @__PURE__ */ n(a, {
src: "CheckCircleFilled",
color: "content.success",
size: 20
}) : /* @__PURE__ */ n(a, {
src: "CheckCircleOutlined",
color: "content.neutral",
size: 20
}), [u]), f = l(u ? (e) => e.unity.component.passwordField.ruleStatus.passed : (e) => e.unity.component.passwordField.ruleStatus.notPassed), { root: p, label: m } = o();
return /* @__PURE__ */ r("li", {
className: p(),
"aria-label": `${f}: ${typeof s == "string" ? s : ""}`,
children: [d, /* @__PURE__ */ r("span", {
className: m(),
children: [/* @__PURE__ */ r("span", {
className: "uy:sr-only",
children: [f, ": "]
}), s]
})]
}, t);
}
//#endregion
export { s as ValidationRuleItem };