UNPKG

@teamsnap/teamsnap-ui

Version:

a CSS component library for TeamSnap

68 lines (67 loc) 2.72 kB
/** * @name Combobox * * @description * A common combobox component that will render the appropriate styles. This calls the shared components InputControl * with all the appropriate options. See the teamsnap patterns library for more information. * https://teamsnap-ui-patterns.netlify.com/patterns/components/checkbox.html * * @example * <Combobox * name="birthdate" * buttonLabel="Birthdate" * searchLabel="Search for a year" * items={["2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013"]} /> * */ /// <reference types="react" /> import * as PropTypes from 'prop-types'; declare const propTypes: { name: PropTypes.Validator<string>; buttonLabel: PropTypes.Requireable<string>; searchLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>; items: PropTypes.Requireable<PropTypes.InferProps<{ value: PropTypes.Requireable<string>; label: PropTypes.Requireable<string | PropTypes.ReactElementLike>; subtext: PropTypes.Requireable<string | PropTypes.ReactElementLike>; }>[]>; selected: PropTypes.Requireable<any[]>; onChange: PropTypes.Requireable<(...args: any[]) => any>; className: PropTypes.Requireable<string>; mods: PropTypes.Requireable<string>; style: PropTypes.Requireable<object>; testId: PropTypes.Requireable<string>; otherProps: PropTypes.Requireable<object>; disabled: PropTypes.Requireable<boolean>; }; declare type Props = PropTypes.InferProps<typeof propTypes>; declare const ComboBox: { ({ name, buttonLabel, style, testId, otherProps, disabled, className, selected, mods, items, onChange, }: Props): JSX.Element; propTypes: { name: PropTypes.Validator<string>; buttonLabel: PropTypes.Requireable<string>; searchLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>; items: PropTypes.Requireable<PropTypes.InferProps<{ value: PropTypes.Requireable<string>; label: PropTypes.Requireable<string | PropTypes.ReactElementLike>; subtext: PropTypes.Requireable<string | PropTypes.ReactElementLike>; }>[]>; selected: PropTypes.Requireable<any[]>; onChange: PropTypes.Requireable<(...args: any[]) => any>; className: PropTypes.Requireable<string>; mods: PropTypes.Requireable<string>; style: PropTypes.Requireable<object>; testId: PropTypes.Requireable<string>; otherProps: PropTypes.Requireable<object>; disabled: PropTypes.Requireable<boolean>; }; defaultProps: { mods: any; style: {}; testId: any; className: string; otherProps: {}; selected: any[]; }; }; export default ComboBox;