import React from 'react'; import { PropGetterFn, UnknownProperties, Intergalactic } from 'intergalactic/core'; import { Box, BoxProps } from 'intergalactic/flex-box'; import { NeighborItemProps, NeighborLocationProps } from 'intergalactic/neighbor-location'; import { KeyboardFocusProps } from 'intergalactic/utils/lib/enhances/keyboardFocusEnhance'; export type PillsValue = string | number | boolean | null; /** @deprecated */ export interface IPillsProps extends PillsProps, UnknownProperties {} export type PillsProps = NeighborLocationProps & KeyboardFocusProps & BoxProps & { /** Pills size */ size?: 'l' | 'm'; /** Disabled state */ disabled?: boolean; /** Called when the selection is changed */ onChange?: | ((value: T, e?: React.SyntheticEvent) => void) | React.Dispatch>; /** Value for the selected pill */ value?: T; /** Default value for the selected pill */ defaultValue?: T; /** Sets semantic role for corresponding behavior, * when set to `auto` pressing left and right arrows * selects corresponding sibling pill. * * It's recommended to use `auto` behavior in forms * while `manual` behavior for navigation and layout. * @default tabs */ behavior?: /** @deprecated use `manual` */ | 'tabs' /** @deprecated use `auto` */ | 'radio' | 'auto' | 'manual'; }; /** @deprecated */ export interface IPillProps extends PillProps, UnknownProperties {} export type PillProps = BoxProps & NeighborItemProps & KeyboardFocusProps & { /** Pill value */ value?: PillsValue; /** Disabled state */ disabled?: boolean; /** Selected state */ selected?: boolean; /** Left addon text */ addonLeft?: React.ElementType; /** Right addon tag */ addonRight?: React.ElementType; }; /** @deprecated */ export interface IPillsContext extends PillsContext, UnknownProperties {} export type PillsContext = { getItemProps: PropGetterFn; }; /** @deprecated */ export interface IPillsHandlers extends PillsHandlers, UnknownProperties {} export type PillsHandlers = { value: (value: PillsValue) => void; }; type IntergalacticPillsComponent = (< Value extends PillsValue, Tag extends Intergalactic.Tag = 'div', >( props: Intergalactic.InternalTypings.ComponentProps< Tag, 'div', PillsProps, PillsContext, [handlers: PillsHandlers] > & PropsExtending, ) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', PillsProps>; declare const Pills: IntergalacticPillsComponent & { Item: Intergalactic.Component<'button', PillProps, [handlers: PillsHandlers]> & { Text: typeof Box; Addon: typeof Box; }; }; declare const wrapPills: ( wrapper: ( props: Intergalactic.InternalTypings.UntypeRefAndTag< Intergalactic.InternalTypings.ComponentPropsNesting > & PropsExtending, ) => React.ReactNode, ) => IntergalacticPillsComponent; export { wrapPills }; export default Pills;