UNPKG

@payfit/unity-components

Version:

40 lines (39 loc) 1.43 kB
import { Actionable as e } from "../actionable/Actionable.js"; import { Tooltip as t } from "../tooltip/Tooltip.js"; import { avatarBase as n } from "./Avatar.variants.js"; import { useAvatarGroupContext as r } from "../avatar-group/AvatarGroup.context.js"; import { Avatar as i } from "./Avatar.js"; import * as a from "react"; import { uyMerge as o } from "@payfit/unity-themes"; import { jsx as s } from "react/jsx-runtime"; //#region src/components/avatar/InteractiveAvatar.tsx var c = a.forwardRef(({ tooltip: a, onPress: c, onPressStart: l, onPressEnd: u, onPressChange: d, children: f, ...p }, m) => { let h = r(); return /* @__PURE__ */ s(t, { title: a, children: /* @__PURE__ */ s(e, { ref: m, asElement: "button", type: "button", className: o(n({ variant: p.variant ?? "circle", size: p.size ?? h?.defaultSize ?? "md" }), "uy:cursor-pointer uy:leading-[0] uy:outline-none uy:data-[focus-visible=true]:ring-2 uy:data-[focus-visible=true]:ring-utility-focus-ring uy:data-[focus-visible=true]:ring-offset-2"), onPress: c, onPressStart: l, onPressEnd: u, onPressChange: d, "aria-label": p["aria-label"], "aria-describedby": p["aria-describedby"], "aria-details": p["aria-details"], children: /* @__PURE__ */ s(i, { ...p, "aria-hidden": !0, children: f }) }) }); }); c.displayName = "InteractiveAvatar"; //#endregion export { c as InteractiveAvatar };