@ozen-ui/kit
Version:
React component library
38 lines (37 loc) • 1.98 kB
TypeScript
import './Chip.css';
import React from 'react';
import type { Ref, FC, ReactNode, HTMLAttributes, InputHTMLAttributes } from 'react';
import type { IconProps } from '@ozen-ui/icons';
import type { ExtendableProps } from '../../types/ExtendableProps';
export declare const cnChip: import("@bem-react/classname").ClassNameFormatter;
export declare const chipSizeVariant: readonly ["xs", "s", "m", "l"];
export declare const chipColorVariant: readonly ["primary", "secondary"];
export type ChipSizeVariant = (typeof chipSizeVariant)[number];
export type ChipColorVariant = (typeof chipColorVariant)[number];
export type ChipIconComponent = FC<IconProps>;
export type ChipBaseProps = {
/** Размер компонента */
size?: ChipSizeVariant;
/** Вариант представления компонента */
color?: ChipColorVariant;
/** Если `true` компонент отображается как заблокированный */
disabled?: boolean;
/** Иконка слева */
iconLeft?: ChipIconComponent;
/** Иконка справа */
iconRight?: ChipIconComponent;
/** Ссылка на input-элемент в компоненте */
inputRef?: Ref<HTMLInputElement>;
/** HTML-атрибуты label-элемента в компоненте */
labelProps?: HTMLAttributes<HTMLLabelElement>;
/** Дополнительные СSS-классы */
className?: string;
/** Содержимое компонента */
children: ReactNode;
'data-testid'?: string;
};
export type ChipProps = ExtendableProps<ChipBaseProps, InputHTMLAttributes<HTMLInputElement>>;
/**
* @deprecated Компонент устарел. Для замены используйте компонент ChipNext
*/
export declare const Chip: React.ForwardRefExoticComponent<ChipBaseProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof ChipBaseProps> & React.RefAttributes<HTMLLabelElement>>;