@ebay/ebayui-core
Version:
Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.
22 lines (21 loc) • 752 B
TypeScript
import type { WithNormalizedProps } from "../../global";
type Size = 32 | 40 | 48 | 56 | 64 | 96 | 128;
type ImagePlacement = "cover" | "fit";
interface State {
imagePlacement: ImagePlacement;
}
interface AvatarInput extends Omit<Marko.HTML.Div, `on${string}`> {
username?: string;
color?: string;
"a11y-text"?: Marko.HTMLAttributes["aria-label"];
size?: Size | `${Size}`;
img?: Marko.AttrTag<Omit<Marko.HTML.Img, `on${string}` | "alt">>;
"known-aspect-ratio"?: number;
}
export interface Input extends WithNormalizedProps<AvatarInput> {
}
declare class Avatar extends Marko.Component<Input, State> {
onCreate(input: Input): void;
handleImageLoad(_event: Event, el: HTMLImageElement): void;
}
export default Avatar;