UNPKG

@neo4j-ndl/react

Version:

React implementation of Neo4j Design System

49 lines (48 loc) 2.28 kB
/** * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import type React from 'react'; import { type PolymorphicCommonProps } from '../_common/types'; type AvatarProps = { /** Whether to display a status indicator */ hasStatus?: boolean; /** Whether the avatar is disabled. When disabled, status indicators are hidden and `onClick` handlers are disabled when cast as a button */ isDisabled?: boolean; /** The name associated with the avatar. Used for alt text and aria-label. For letters type, this text is displayed */ name?: string; /** The shape of the avatar */ shape?: 'circle' | 'square'; /** The size of the avatar */ size?: 'x-small' | 'small' | 'medium' | 'large' | 'x-large'; /** Source URI for the image. When provided with `type="image`", displays the image */ source?: string; /** The status to display. Only shown when `hasStatus` is `true` and component is not disabled */ status?: 'offline' | 'online' | 'unknown'; /** The type of avatar content. If `type="image"` and no source is provided, automatically falls back to `icon` */ type?: 'icon' | 'image' | 'letters'; } & ({ as: 'button'; onClick: () => void; } | { as?: React.ElementType; }); export declare const Avatar: <T extends React.ElementType = "div">({ as, hasStatus, isDisabled, name, shape, size, source, status, type: initialType, className, style, htmlAttributes, ref, ...restProps }: PolymorphicCommonProps<T, AvatarProps>) => import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=Avatar.d.ts.map