import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "direction", "gap", "columnGap", "rowGap", "className", "name", "value", "onChange", "defaultValue"];
import React from "react";
import PropTypes from "prop-types";
import Flex from "../../CssFlex";
import { RadioGroupContext } from "./RadioGroupContext";
var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
  var children = props.children,
      _props$direction = props.direction,
      direction = _props$direction === void 0 ? "row" : _props$direction,
      gap = props.gap,
      _props$columnGap = props.columnGap,
      columnGap = _props$columnGap === void 0 ? "lg" : _props$columnGap,
      _props$rowGap = props.rowGap,
      rowGap = _props$rowGap === void 0 ? "md" : _props$rowGap,
      className = props.className,
      name = props.name,
      value = props.value,
      onChange = props.onChange,
      defaultValue = props.defaultValue,
      htmlProps = _objectWithoutProperties(props, _excluded);

  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Flex, {
    ref: ref,
    className: className,
    direction: direction,
    wrap: "wrap",
    columnGap: gap !== null && gap !== void 0 ? gap : columnGap,
    rowGap: gap !== null && gap !== void 0 ? gap : rowGap
  }, /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {
    value: {
      value: value,
      defaultValue: defaultValue,
      onChange: onChange,
      name: name
    }
  }, children)));
});
export default RadioGroup;
RadioGroup.propTypes = {
  name: PropTypes.string.isRequired,
  className: PropTypes.string,
  value: PropTypes.string,
  onChange: PropTypes.func,
  defaultValue: PropTypes.string,
  direction: PropTypes.oneOf(["row", "column"]),
  gap: PropTypes.string,
  columnGap: PropTypes.string,
  rowGap: PropTypes.string
};
RadioGroup.defaultProps = {};