UNPKG

@douyinfe/semi-ui

Version:

A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.

44 lines (43 loc) 1.72 kB
import React from 'react'; import { PopoverProps } from '../popover/index'; export type TagColor = 'amber' | 'blue' | 'cyan' | 'green' | 'grey' | 'indigo' | 'light-blue' | 'light-green' | 'lime' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'violet' | 'yellow' | 'white'; export type TagType = 'ghost' | 'solid' | 'light'; export type TagSize = 'default' | 'small' | 'large'; export type AvatarShape = 'circle' | 'square'; export type TagShape = 'circle' | 'square'; export interface TagProps { children?: React.ReactNode; tagKey?: string | number; size?: TagSize; color?: TagColor; type?: TagType; closable?: boolean; visible?: boolean; onClose?: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void; onClick?: React.MouseEventHandler<HTMLDivElement>; prefixIcon?: React.ReactNode; suffixIcon?: React.ReactNode; style?: React.CSSProperties; className?: string; avatarSrc?: string; avatarShape?: AvatarShape; shape?: TagShape; onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>; 'aria-label'?: React.AriaAttributes['aria-label']; tabIndex?: number; onMouseEnter?: () => void; } export interface TagGroupProps<T> { style?: React.CSSProperties; className?: string; maxTagCount?: number; restCount?: number; tagList?: (T extends 'custom' ? React.ReactNode : TagProps)[]; size?: 'small' | 'large'; showPopover?: boolean; popoverProps?: PopoverProps; avatarShape?: AvatarShape; mode?: string; onTagClose?: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void; onPlusNMouseEnter?: () => void; }