UNPKG

@ozen-ui/kit

Version:

React component library

43 lines (42 loc) 2.32 kB
import './IconButton.css'; import type { ElementType } from 'react'; import type { IconProps } from '@ozen-ui/icons'; import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant'; import type { PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef'; import type { RenderContentType } from '../../utils/renderContent'; import { ICON_BUTTON_DEFAULT_TAG } from './constants'; export declare const iconButtonColorVariant: readonly ["primary", "secondary"]; export declare const iconButtonVariant: readonly ["contained", "outlined", "ghost", "function", "floating"]; export type IconButtonVariant = (typeof iconButtonVariant)[number]; export type IconButtonColorVariant = (typeof iconButtonColorVariant)[number]; export type IconButtonIcon = RenderContentType<IconProps>['content']; type IconButtonBaseProps = { /** Иконка */ icon: IconButtonIcon; /** Вариант представления компонента */ variant?: IconButtonVariant; /** Размер */ size?: FormElementSizeVariant; /** Основной цвет компонента */ color?: IconButtonColorVariant; /** Цвет иконки кнопки */ iconColor?: string; /** Если `true` уменьшает размер компонента */ compressed?: boolean; /** Если `true` делает компонент заблокированным */ disabled?: boolean; /** Если `true` переводит компонент в состояние загрузки */ loading?: boolean; /** Дополнительные CSS-классы */ className?: string; /** Если `true` делает компонент круглым */ rounded?: boolean; children?: never; }; export type IconButtonProps<As extends ElementType = typeof ICON_BUTTON_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<IconButtonBaseProps, As>; export declare const cnIconButton: import("@bem-react/classname").ClassNameFormatter; /** * @deprecated Компонент устарел. Для замены используйте компонент IconButtonNext */ export declare const IconButton: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<IconButtonBaseProps, "button", "as">; export {};