"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _Text = _interopRequireDefault(require("../../../Text"));
var _LabelSt = require("./Label.st.css.js");
var _Asterisk = _interopRequireDefault(require("../Asterisk"));
var _InfoContentIcon = _interopRequireDefault(require("../InfoContentIcon"));
var _excluded = ["labelSize", "label", "aria-hidden", "hasInlineElements", "required", "infoContent", "infoTooltipProps"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/FieldSet/components/Label/Label.tsx";
var Label = _ref => {
  var {
      labelSize,
      label,
      'aria-hidden': ariaHidden,
      hasInlineElements,
      required,
      infoContent,
      infoTooltipProps
    } = _ref,
    rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var weight = labelSize === 'tiny' ? 'normal' : undefined;
  var hasSuffix = required || infoContent;
  return /*#__PURE__*/_react.default.createElement(_Text.default, (0, _extends2.default)({
    "aria-hidden": ariaHidden,
    className: (0, _LabelSt.st)(_LabelSt.classes.root, {
      hasInlineElements,
      labelSize
    }),
    size: labelSize,
    weight: weight,
    secondary: true,
    style: {
      display: 'block'
    } // allows the label to middle vertically
    ,
    suffix: hasSuffix ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, required && /*#__PURE__*/_react.default.createElement(_Asterisk.default, {
      labelSize: labelSize,
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 46,
        columnNumber: 26
      }
    }), /*#__PURE__*/_react.default.createElement(_InfoContentIcon.default, {
      required: required,
      infoContent: infoContent,
      infoTooltipProps: infoTooltipProps,
      __self: void 0,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 47,
        columnNumber: 13
      }
    })) : undefined
  }, rest, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 33,
      columnNumber: 5
    }
  }), label);
};
var _default = exports.default = Label;
//# sourceMappingURL=Label.js.map