@patternfly/react-core
Version:
This library provides a set of common React components for use with the PatternFly reference implementation.
35 lines • 1.81 kB
TypeScript
import * as React from 'react';
import { SimpleListItemProps } from './SimpleListItem';
export interface SimpleListProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onSelect'> {
/** Content rendered inside the SimpleList */
children?: React.ReactNode;
/** Additional classes added to the SimpleList container */
className?: string;
/** Callback when an item is selected */
onSelect?: (ref: React.RefObject<HTMLButtonElement> | React.RefObject<HTMLAnchorElement>, props: SimpleListItemProps) => void;
/** Indicates whether component is controlled by its internal state */
isControlled?: boolean;
/** aria-label for the <ul> element that wraps the SimpleList items. */
'aria-label'?: string;
}
export interface SimpleListState {
/** Ref of the current SimpleListItem */
currentRef: React.RefObject<HTMLButtonElement> | React.RefObject<HTMLAnchorElement>;
}
interface SimpleListContextProps {
currentRef: React.RefObject<HTMLButtonElement> | React.RefObject<HTMLAnchorElement>;
updateCurrentRef: (id: React.RefObject<HTMLButtonElement> | React.RefObject<HTMLAnchorElement>, props: SimpleListItemProps) => void;
isControlled: boolean;
}
export declare const SimpleListContext: React.Context<Partial<SimpleListContextProps>>;
declare class SimpleList extends React.Component<SimpleListProps, SimpleListState> {
static displayName: string;
state: {
currentRef: React.RefObject<HTMLButtonElement> | React.RefObject<HTMLAnchorElement>;
};
static defaultProps: SimpleListProps;
handleCurrentUpdate: (newCurrentRef: React.RefObject<HTMLButtonElement> | React.RefObject<HTMLAnchorElement>, itemProps: SimpleListItemProps) => void;
render(): React.JSX.Element;
}
export { SimpleList };
//# sourceMappingURL=SimpleList.d.ts.map