@payfit/unity-components
Version:
84 lines (83 loc) • 5.59 kB
JavaScript
import e from "../../hooks/use-id.js";
import { Badge as t } from "../badge/Badge.js";
import { BRAND_ASSETS as n } from "./PayFitBrand.js";
import { forwardRef as r } from "react";
import { useUnityTheme as i, uyTv as a } from "@payfit/unity-themes";
import { jsx as o, jsxs as s } from "react/jsx-runtime";
//#region src/components/payfit-brand/PayFitPreprod.tsx
var c = a({
slots: { base: "uy:h-auto" },
variants: {
showOnlyMonogram: {
true: { base: "uy:min-w-[32px]" },
false: { base: "uy:min-w-[104px]" }
},
theme: {
legacy: {},
rebrand: {}
}
},
compoundVariants: [{
showOnlyMonogram: !0,
theme: "rebrand",
className: { base: "uy:min-w-[20px]" }
}, {
showOnlyMonogram: !1,
theme: "rebrand",
className: { base: "uy:min-w-[48px]" }
}]
}), l = r(({ label: r, description: a, env: l, showOnlyMonogram: u = !1, ...d }, f) => {
let p = e(), { theme: m } = i(), h = n[m], g = `payfit-preprod-title-${p}`, _ = `payfit-preprod-desc-${p}`, v = {
focusable: !1,
role: "img",
"aria-labelledby": g,
...a && { "aria-describedby": _ }
};
return /* @__PURE__ */ s("span", {
className: "uy:flex uy:gap-200 uy:items-center uy:theme-rebrand:items-center",
children: [/* @__PURE__ */ s("svg", {
...d,
...v,
xmlns: "http://www.w3.org/2000/svg",
viewBox: u ? h.monogram.viewBox : h.logotype.viewBox,
fill: "none",
ref: f,
width: u ? m === "rebrand" ? 24 : 32 : m === "rebrand" ? 80 : 104,
className: c({
showOnlyMonogram: u,
theme: m
}).base(),
children: [
/* @__PURE__ */ o("title", {
id: g,
children: r
}),
a && /* @__PURE__ */ o("desc", {
id: _,
children: a
}),
/* @__PURE__ */ o("path", {
fillRule: "evenodd",
className: m === "rebrand" && !u ? "uy:hidden" : m === "rebrand" ? "uy:fill-grayscale-l12" : "uy:fill-content-warning",
d: h.monogram.path,
clipRule: "evenodd"
}),
!u && m === "rebrand" && /* @__PURE__ */ o("path", {
className: "uy:fill-grayscale-l12",
d: h.logotype.path
}),
!u && m === "legacy" && /* @__PURE__ */ o("path", {
className: "uy:fill-content-neutral",
d: "M76.49 11.945h-1.472c-.163 0-.309.11-.345.255-.073.218-.128.364-.146.455-.582 1.781-1.472 4.472-2.636 8.054-.018.055-.091.255-.237.582-.036.09-.145.127-.236.09a.219.219 0 0 1-.09-.09 7.862 7.862 0 0 1-.237-.582c-1.2-3.69-2.091-6.454-2.673-8.31-.018-.054-.036-.126-.054-.18a.372.372 0 0 0-.346-.255h-1.454a.365.365 0 0 0-.346.472c.018.055.036.091.055.146.909 2.582 2.272 6.436 4.09 11.582 0 .018 0 .018.019.036a.443.443 0 0 1 0 .218c0 .018 0 .018-.018.037-.019.072-.055.163-.073.236a1.805 1.805 0 0 1-1.691 1.2h-1.527c-.2 0-.364.164-.364.364v1.218c0 .2.164.363.364.363H68.6a3.72 3.72 0 0 0 3.418-2.236c.018-.055.037-.11.073-.164.018-.054 1.09-3.09 4.673-13.109.054-.127-.019-.29-.146-.345H76.6c-.055-.018-.073-.037-.11-.037ZM57.11 22.291c.345.109.708.163 1.072.163a4.232 4.232 0 0 0 2.89-1.2 2.949 2.949 0 0 0 .855-2.145v-.945a.163.163 0 0 0-.163-.164h-.037c-.182.018-.272.018-.272.018l-1.146.146-2.273.345c-1.218.2-1.963.69-2.2 1.455a1.923 1.923 0 0 0-.09.563c.018.818.581 1.527 1.363 1.764Zm6.854.8v.727c0 .2-.164.364-.364.364h-1.182a.365.365 0 0 1-.364-.364l-.018-1.2c0-.018-.018-.036-.018-.054a.088.088 0 0 0-.127 0 1.04 1.04 0 0 0-.2.2c-.946.945-2.236 1.418-3.91 1.418-1.2 0-2.181-.327-2.945-.964-.763-.636-1.127-1.527-1.127-2.654A3.316 3.316 0 0 1 54.036 19c.2-.418.491-.764.873-1.018a3.876 3.876 0 0 1 1.055-.546A5.45 5.45 0 0 1 57 17.164c1.764-.255 2.71-.382 2.89-.419.146-.018.728-.09 1.728-.236.073-.018.127-.018.2-.018.091-.018.164-.091.164-.182v-.51c0-.763-.2-1.363-.6-1.78-.4-.42-1.146-.637-2.218-.637-.491 0-.982.054-1.455.2-.364.109-.673.309-.927.6-.164.218-.31.436-.4.69-.018.055-.037.11-.055.183 0 .018 0 .036-.018.054a.371.371 0 0 1-.364.29h-1.363a.378.378 0 0 1-.346-.38v-.074c.019-.145.037-.254.055-.345.09-.345.236-.691.418-1a3.54 3.54 0 0 1 .818-.91c.437-.29.91-.508 1.418-.654a8.41 8.41 0 0 1 2.128-.254c3.29 0 4.89 1.309 4.89 3.963v7.346Zm26.963-10.873v11.564c0 .2.164.363.364.363h1.473c.2 0 .363-.163.363-.363V12.218c0-.2-.163-.364-.363-.364H91.29c-.2 0-.364.164-.364.364Zm0-3.673v1.473c0 .2.164.364.364.364h1.473c.2 0 .363-.164.363-.364V8.545c0-.2-.163-.363-.363-.363H91.29c-.2 0-.364.163-.364.363ZM100 13.782h3.109c.2 0 .364-.164.364-.364V12.2c0-.2-.164-.364-.364-.364H100c-.09 0-.182-.072-.182-.163V8.545c0-.2-.163-.363-.364-.363h-1.472c-.2 0-.364.163-.364.363v3.128c0 .09-.073.181-.163.181H96.09c-.2 0-.364.164-.364.364v1.218c0 .2.164.364.364.364h1.345c.091 0 .182.073.182.164V20.545c.073 2 1.71 3.6 3.709 3.6h1.655c.2 0 .363-.163.363-.363v-1.218c0-.2-.163-.364-.363-.364h-1.655a1.525 1.525 0 0 1-1.527-1.527v-6.71c.018-.108.09-.181.2-.181Zm-47.964-.637a4.96 4.96 0 0 0-4.854-4.963h-7c-.2 0-.364.163-.364.363v15.237c0 .2.164.363.364.363h1.472c.2 0 .364-.163.364-.363v-5.473c0-.09.073-.182.164-.182h5a4.975 4.975 0 0 0 4.854-4.982Zm-1.927 0a3.01 3.01 0 0 1-3.018 3.019h-4.873c-.09 0-.182-.073-.182-.164v-5.691c0-.09.073-.182.164-.182h4.891a3.01 3.01 0 0 1 3.018 3.018Zm31.2 4.928h5.527c.2 0 .364-.164.364-.364v-1.218c0-.2-.164-.364-.364-.364H81.31c-.09 0-.182-.072-.182-.163v-5.655c0-.09.073-.182.164-.182h6.8c.2 0 .364-.163.364-.363V8.545c0-.2-.164-.363-.364-.363h-8.8c-.2 0-.364.163-.364.363v15.237c0 .2.164.363.364.363h1.473c.2 0 .363-.163.363-.363v-5.527c0-.11.073-.182.182-.182Z"
})
]
}), /* @__PURE__ */ o(t, {
variant: "warning",
className: "uy:theme-rebrand:self-center",
children: l
})]
});
});
l.displayName = "PayFitBrandPreprod";
//#endregion
export { l as PayFitBrandPreprod };