import { _ as _extends } from '../extends-C4cduGrv.js';
import { _ as _objectWithoutProperties } from '../objectWithoutProperties-TXwlfNxG.js';
import React__default from 'react';
import PropTypes from 'prop-types';
import VisuallyHidden from '@reach/visually-hidden';
import cx from 'classnames';

var _excluded = ["htmlFor", "children", "className", "visuallyHidden", "as"];

function Label(_ref) {
  var htmlFor = _ref.htmlFor,
      children = _ref.children,
      className = _ref.className,
      visuallyHidden = _ref.visuallyHidden,
      _ref$as = _ref.as,
      Component = _ref$as === void 0 ? "label" : _ref$as,
      props = _objectWithoutProperties(_ref, _excluded);

  var labelElement = /*#__PURE__*/React__default.createElement(Component, _extends({
    className: cx(labelClasses, className),
    htmlFor: htmlFor
  }, props), children);
  if (!visuallyHidden) return labelElement;
  return /*#__PURE__*/React__default.createElement(VisuallyHidden, null, labelElement);
}

Label.propTypes = {
  /** If a `Label` has an associated element, pass the `id` of the element as `htmlFor`. */
  htmlFor: PropTypes.string,
  as: PropTypes.string,
  className: PropTypes.string,
  children: PropTypes.node,
  visuallyHidden: PropTypes.bool
};
var labelClasses = "text-sm font-semibold font-sans leading-5 text-gray-800";

export { Label as default, labelClasses };
