1 | import classNames from 'classnames';
|
2 | import * as React from 'react';
|
3 | import { useContext } from 'react';
|
4 | import { useBootstrapPrefix } from './ThemeProvider';
|
5 | import FormContext from './FormContext';
|
6 | import { jsx as _jsx } from "react/jsx-runtime";
|
7 | const FormSelect = React.forwardRef(({
|
8 | bsPrefix,
|
9 | size,
|
10 | htmlSize,
|
11 | className,
|
12 | isValid = false,
|
13 | isInvalid = false,
|
14 | id,
|
15 | ...props
|
16 | }, ref) => {
|
17 | const {
|
18 | controlId
|
19 | } = useContext(FormContext);
|
20 | bsPrefix = useBootstrapPrefix(bsPrefix, 'form-select');
|
21 | return _jsx("select", { ...props,
|
22 | size: htmlSize,
|
23 | ref: ref,
|
24 | className: classNames(className, bsPrefix, size && `${bsPrefix}-${size}`, isValid && `is-valid`, isInvalid && `is-invalid`),
|
25 | id: id || controlId
|
26 | });
|
27 | });
|
28 | FormSelect.displayName = 'FormSelect';
|
29 | export default FormSelect; |
\ | No newline at end of file |