UNPKG

@progress/kendo-react-layout

Version:

React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package

66 lines (65 loc) 1.84 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import * as a from "react"; import r from "prop-types"; import { classNames as s, kendoThemeMaps as o } from "@progress/kendo-react-common"; import { avatarType as t } from "./interfaces/Enums.mjs"; const i = (l) => { const e = { type: t.TEXT, size: "medium", rounded: "full", fillMode: "solid", themeColor: "primary", ...l }; return /* @__PURE__ */ a.createElement( "div", { style: e.style, className: s( "k-avatar", { "k-avatar-bordered": e.border, [`k-rounded-${o.roundedMap[e.rounded] || e.rounded}`]: e.rounded, [`k-avatar-${o.sizeMap[e.size] || e.size}`]: e.size, [`k-avatar-${e.fillMode}`]: e.fillMode, [`k-avatar-${e.fillMode}-${e.themeColor}`]: !!(e.fillMode && e.themeColor) }, e.className ) }, /* @__PURE__ */ a.createElement("span", { className: `k-avatar-${e.type}` }, e.children) ); }; i.propTypes = { className: r.string, type: r.oneOf(["text", "image", "icon"]), size: r.oneOf([null, "small", "medium", "large"]), rounded: r.oneOf([null, "small", "medium", "large", "full"]), fillMode: r.oneOf([null, "solid", "outline"]), /* eslint-disable max-len */ themeColor: r.oneOf([ null, "base", "dark", "error", "info", "inverse", "inverse", "light", "primary", "secondary", "success", "tertiary", "warning" ]) }; export { i as Avatar };