UNPKG

@teamsnap/teamsnap-ui

Version:

a CSS component library for TeamSnap

52 lines (51 loc) 1.57 kB
/** * @name Select * * @description * A common select component for html select elements. Includes support for a label and a generic map function * for options. See teamsnap patterns lib for more information. * https://teamsnap-ui-patterns.netlify.com/patterns/components/select-box.html * * @example * <Select * name='LineItemFeeCategory' * options={[ * { * 'label': 'Tournament', * 'value': 'tournament' * }, * { * 'label': 'Other', * 'value': 'other' * } * ]} /> * */ import * as React from "react"; import * as PropTypes from "prop-types"; declare class Select extends React.PureComponent<PropTypes.InferProps<typeof Select.propTypes>, any> { static propTypes: { name: PropTypes.Validator<string>; options: PropTypes.Validator<PropTypes.InferProps<{ label: PropTypes.Validator<string>; value: PropTypes.Validator<string>; disabled: PropTypes.Requireable<boolean>; }>[]>; inputProps: PropTypes.Requireable<object>; className: PropTypes.Requireable<string>; mods: PropTypes.Requireable<string>; style: PropTypes.Requireable<object>; otherProps: PropTypes.Requireable<object>; disabled: PropTypes.Requireable<boolean>; }; static defaultProps: { inputProps: {}; className: string; mods: any; style: {}; otherProps: {}; }; renderOptions: (option: any) => JSX.Element; render(): JSX.Element; } export default Select;