import { default as React } from 'react'; import { AnchorProps } from '../Anchor/Anchor'; import { IconProps } from '../Icon/Icon'; /** * Context to pass the list configuration to the list items. */ export interface ListContextType { columns: boolean | 'dense'; dividers: boolean; ellipsis: boolean; icon: IconProps | boolean | undefined; dense: boolean; verticalAlignment: 'top' | 'center' | 'bottom'; } export interface ListProps { children: React.ReactNode; /** * Displays the list in columns. * * Items are distributed in columns filling the first column, then second, and so on. * * @default false */ columns?: boolean | 'dense'; /** * Displays dividers between list items. * @default true */ dividers?: boolean; /** * Displays ellipsis for long text in list items. * @default true */ ellipsis?: boolean; /** * Icon to be displayed in the list. * * - `IconName` displays icon with the provided name * - `IconProps` displays icon defined by the icon props * - `true` displays empty icon placeholder, extra space (padding) * - `false` to not display any icon or icon placeholder padding * * @default undefined */ icon?: IconProps['icon'] | Omit | boolean; /** * If true, the list items have no minimum height. * @default false */ dense?: boolean; /** * Aligns the content of the list items vertically. * @default 'top' * */ verticalAlignment?: 'top' | 'center' | 'bottom'; } export interface ListItemKeyValueProps { /** * Value of the list item. */ value: React.ReactNode; /** * Children are not allowed in this case. */ children?: never; } export interface ListItemWithChildrenProps { /** * Value is not allowed in this case. */ value?: never; /** * Children of the list item. */ children: React.ReactNode; } export type ListItemProps = { /** * Action to be displayed in the list item. * * @default undefined */ action?: { href?: string; onClick: React.MouseEventHandler; value: string; target?: AnchorProps['target']; }; /** * Icon to be displayed in the list item. * * - `IconName` displays icon with the provided name * - `IconProps` displays icon defined by the icon props * - `true` displays empty icon placeholder, extra space (padding) * - `false` to not display any icon or icon placeholder padding * * @default undefined */ icon?: IconProps['icon'] | Omit | boolean; /** * Displays ellipsis for long text in list items. * @default true */ ellipsis?: boolean; /** * Label of the list item. */ label?: string; /** * If true, the list items have no minimum height. * @default false */ dense?: boolean; /** * Aligns the content of the list items vertically. * @default 'top' * */ verticalAlignment?: 'top' | 'center' | 'bottom'; /** * Displays dividers at the bottom of the list item. * @default false */ divider?: boolean; } & (ListItemKeyValueProps | ListItemWithChildrenProps); declare function ListComponent({ children, columns, dividers, ellipsis, dense, verticalAlignment, icon, ...rest }: ListProps): React.JSX.Element; declare namespace ListComponent { var displayName: string; } declare function ListItem({ action, ellipsis: ellipsisProp, icon: propsIcon, dense: denseProp, verticalAlignment: verticalAlignmentProp, divider, ...rest }: ListItemProps): React.JSX.Element; export interface BasicListItemProps { children: React.ReactNode; } declare function BasicListItem({ children, ...rest }: BasicListItemProps): React.JSX.Element; export declare const List: typeof ListComponent & { Item: typeof ListItem; BasicItem: typeof BasicListItem; }; export {};