@payfit/unity-components
Version:
89 lines (88 loc) • 2.85 kB
JavaScript
import { Icon as e } from "../../icon/Icon.js";
import { Text as t } from "../../text/Text.js";
import { Badge as n } from "../../badge/Badge.js";
import { AppProfileAvatar as r, InteractiveAppProfileAvatar as i } from "./AppProfileAvatar.js";
import { jsx as a, jsxs as o } from "react/jsx-runtime";
import { useIntl as s } from "react-intl";
//#region src/components/app-profile-menu-button/parts/AppProfileMenuHeader.tsx
var c = ({ asMenuHeader: c = !1, avatar: l, avatarPair: u, avatarSize: d, avatarVariant: f, badgeLabel: p, description: m, labelId: h, menuTriggerDescription: g, title: _, triggerDescriptionId: v, triggerVariant: y, uploadAvatarCallback: b, uploadAvatarDescription: x, uploadAvatarLabel: S }) => {
let C = s(), w = g ?? C.formatMessage({
id: "unity:component:app-menu:footer:profile-button:description",
defaultMessage: "Press this button to open the profile menu."
});
return /* @__PURE__ */ o("div", {
className: "uy:w-full uy:flex uy:items-center",
"data-unity-slot": "profile-summary",
children: [
/* @__PURE__ */ a("div", {
className: "uy:mr-150 uy:flex uy:items-center",
"data-unity-slot": "avatar",
children: b ? /* @__PURE__ */ a(i, {
avatar: l,
avatarPair: u,
avatarSize: d,
avatarVariant: f,
labelId: h,
title: _,
uploadAvatarCallback: b,
uploadAvatarDescription: x,
uploadAvatarLabel: S
}) : /* @__PURE__ */ a(r, {
avatar: l,
avatarPair: u,
avatarSize: d,
avatarVariant: f,
isPairAvatarVisible: !0,
labelId: h,
title: _
})
}),
/* @__PURE__ */ o("div", {
className: "uy:flex uy:flex-col uy:text-left uy:leading-[1.25] uy:min-w-0 uy:flex-grow",
"data-unity-slot": "profile-details",
children: [
/* @__PURE__ */ a(t, {
asElement: "span",
className: "uy:w-full",
color: "content.neutral",
"data-dd-privacy": "mask",
id: c ? void 0 : h,
lineClamp: 1,
variant: d === "md" ? "bodySmallStrong" : "bodyStrong",
children: _
}),
/* @__PURE__ */ a(t, {
asElement: "span",
className: "uy:w-full",
color: "content.neutral.low",
"data-dd-privacy": "allow",
lineClamp: 1,
variant: "bodySmall",
children: m
}),
!c && /* @__PURE__ */ a("span", {
id: v,
className: "uy:sr-only",
children: w
})
]
}),
/* @__PURE__ */ a("div", {
className: "uy:p-100",
"data-unity-slot": "disclosure",
children: c ? p && /* @__PURE__ */ a(n, {
className: "uy:capitalize",
variant: "neutral",
children: p
}) : /* @__PURE__ */ a(e, {
src: y === "small" ? "CaretDownOutlined" : "CaretUpDownOutlined",
alt: w,
size: 20,
color: "content.neutral.low"
})
})
]
});
};
//#endregion
export { c as AppProfileMenuHeader };