UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

58 lines (57 loc) 1.91 kB
/** * MSKCC DSM 2021, 2023 */ import React from 'react'; import { ListBoxType, ListBoxSize } from './ListBoxPropTypes'; import { ForwardRefReturn, ReactAttr } from '../../types/common'; type ExcludedAttributes = 'onKeyDown' | 'onKeyPress' | 'ref'; export interface ListBoxProps extends Omit<ReactAttr<HTMLDivElement>, ExcludedAttributes> { /** * Specify whether the ListBox is currently disabled */ disabled?: boolean; /** * Specify whether the control is currently invalid */ invalid?: boolean; /** * Specify the text to be displayed when the control is invalid */ invalidText?: React.ReactNode; /** * Specify if the control should render open */ isOpen?: boolean; /** * `true` to use the light version. For use on $ui-01 backgrounds only. * Don't use this to make tile background color same as container background color. * * @deprecated The `light` prop for `ListBox` has been deprecated in favor of * the new `Layer` component. It will be removed in the next major release. */ light?: boolean; /** * Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option. */ size?: ListBoxSize; /** * Specify the "type" of the ListBox. Currently supports either `default` or * `inline` as an option. */ type?: ListBoxType; /** * Specify whether the control is currently in warning state */ warn?: boolean; /** * Provide the text that is displayed when the control is in warning state */ warnText?: React.ReactNode; } export type ListBoxComponent = ForwardRefReturn<HTMLDivElement, ListBoxProps>; /** * `ListBox` is a generic container component that handles creating the * container class name in response to certain props. */ declare const ListBox: ListBoxComponent; export default ListBox;