import { default as React } from 'react'; import { IconComponent } from '../../Icons'; import { ComponentVariant, SizeVariant } from '../Shared/types'; import { AvatarBaseProps } from '../Avatar/AvatarBase'; export type ChipLayout = "leading" | "avatar"; export type ChipAvatarProps = Pick; export type ChipForcedStatus = "default" | "hovered" | "pressed" | "disabled"; /** Layout del chip o variante semántica legacy. */ export type ChipVariantProp = ChipLayout | ComponentVariant; interface ChipBaseProps extends Omit, 'id'> { label: string; labelClassName?: string; layout?: ChipLayout; /** * Layout (`leading` | `avatar`) o variante semántica legacy (`default` | `error` | `success`). * @deprecated Para layout usá `layout`. Para semántica legacy usá `semanticVariant`. */ variant?: ChipVariantProp; /** * @deprecated El chip nuevo no diferencia estilos por `error` / `success`; solo compatibilidad de API. */ semanticVariant?: ComponentVariant; isSelected?: boolean; trailingIcon?: IconComponent; onTrailingIconClick?: (e: React.MouseEvent) => void; onClick?: (e: React.MouseEvent) => void; avatar?: ChipAvatarProps; disabled?: boolean; /** @internal Fuerza un estado visual (previews / Storybook). */ forcedStatus?: ChipForcedStatus; /** * @deprecated Usá `onTrailingIconClick` con `trailingIcon={Close}`. */ onRemove?: (optionId: string | number) => void; /** @deprecated Identificador pasado a `onRemove`. */ id?: string | number; /** * @deprecated Tamaño fijo en el diseño nuevo; se aplican clases legacy si se define. */ size?: SizeVariant; tabIndex?: number; /** @deprecated Evitá overridear estilos del sistema. */ className?: string; } type ChipPropsWithLeadingIcon = ChipBaseProps & { leadingIcon?: IconComponent; leadingSlot?: never; }; type ChipPropsWithLeadingSlot = ChipBaseProps & { leadingSlot?: React.ReactNode; leadingIcon?: never; }; export type ChipProps = ChipPropsWithLeadingIcon | ChipPropsWithLeadingSlot; export type ResolvedChipConfig = { layout: ChipLayout; legacySemanticVariant?: ComponentVariant; legacySizeClass?: string; legacySemanticContainerClass?: string; useLegacyRemoveHandler: boolean; isLegacyMode: boolean; }; export declare function isChipLayout(value?: string): value is ChipLayout; export declare function isLegacySemanticVariant(value?: string): value is ComponentVariant; export type ChipConfigInput = Pick; export declare function resolveChipConfig(props: ChipConfigInput): ResolvedChipConfig; export {};