import { __assign, __rest } from "tslib";
import React, { useContext } from 'react';
import classNames from 'classnames';
import { ConfigContext } from '../config-provider/config-context';
import { getPrefixCls } from '../_utils/general';
var NativeSelect = React.forwardRef(function (props, ref) {
    var _a;
    var _b = props.size, size = _b === void 0 ? 'md' : _b, _c = props.disabled, disabled = _c === void 0 ? false : _c, className = props.className, children = props.children, customisedCls = props.prefixCls, otherProps = __rest(props, ["size", "disabled", "className", "children", "prefixCls"]);
    var configContext = useContext(ConfigContext);
    var prefixCls = getPrefixCls('select-native', configContext.prefixCls, customisedCls);
    var cls = classNames(prefixCls, className, (_a = {},
        _a[prefixCls + "_" + size] = size,
        _a[prefixCls + "_disabled"] = disabled,
        _a));
    return (React.createElement("select", __assign({ ref: ref }, otherProps, { className: cls }), React.Children.map(children, function (child) {
        var childProps = {
            disabled: disabled,
        };
        return React.cloneElement(child, childProps);
    })));
});
NativeSelect.displayName = 'NativeSelect';
export default NativeSelect;
//# sourceMappingURL=native-select.js.map