'use strict';

var clsx = require('clsx');
var Label_messages = require('./Label.messages.js');
var reactIntl = require('react-intl');
var Body = require('../body/Body.js');
var jsxRuntime = require('react/jsx-runtime');

const Label = ({
  className,
  children,
  htmlFor,
  id
}) => {
  return /*#__PURE__*/jsxRuntime.jsx("label", {
    id: id,
    htmlFor: htmlFor,
    className: clsx.clsx('np-label d-flex flex-column np-text-body-default-bold text-primary m-b-0', className),
    children: children
  });
};
// eslint-disable-next-line functional/immutable-data
Label.Optional = function Optional({
  children,
  className
}) {
  const {
    formatMessage
  } = reactIntl.useIntl();
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
    children: [children, /*#__PURE__*/jsxRuntime.jsx(Body, {
      as: "span",
      className: clsx.clsx('text-secondary', 'm-l-1', className),
      children: formatMessage(Label_messages.optionalLabel)
    })]
  });
};
// eslint-disable-next-line functional/immutable-data
Label.Description = function Description({
  id,
  children,
  className
}) {
  return children ? /*#__PURE__*/jsxRuntime.jsx(Body, {
    id: id,
    className: clsx.clsx('text-secondary', className),
    children: children
  }) : null;
};

exports.Label = Label;
//# sourceMappingURL=Label.js.map
