import _JSXStyle from "../styled-jsx.es.js";
import React from 'react';
import { useTheme } from '@helpdice/theme';
import useScale from '../use-scale';
import Text from '../text';
export var InputError = function InputError(_ref) {
  var text = _ref.text,
    error = _ref.error;
  return /*#__PURE__*/React.createElement(Text, {
    font: 0.8,
    style: {
      marginTop: 0.4,
      marginRight: 0,
      marginLeft: 0,
      marginBottom: '0.4rem',
      textAlign: 'left',
      zIndex: 0
    },
    color: error ? "error" : 'default'
  }, "\xA0", text);
};
var InputBlockLabelComponent = function InputBlockLabelComponent(_ref2) {
  var children = _ref2.children,
    _ref2$required = _ref2.required,
    required = _ref2$required === void 0 ? false : _ref2$required;
  var theme = useTheme();
  var _useScale = useScale(),
    SCALES = _useScale.SCALES;
  return /*#__PURE__*/React.createElement("label", {
    className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme.palette.accents_6, theme.palette.errorDark, SCALES.font(1.2)]]])
  }, children, required && /*#__PURE__*/React.createElement("span", {
    className: _JSXStyle.dynamic([["588038827", [typeof children === "string" ? 'block' : 'flex', theme.palette.accents_6, theme.palette.errorDark, SCALES.font(1.2)]]]) + " " + "mark-error"
  }, "*"), /*#__PURE__*/React.createElement(_JSXStyle, {
    id: "588038827",
    dynamic: [typeof children === "string" ? 'block' : 'flex', theme.palette.accents_6, theme.palette.errorDark, SCALES.font(1.2)]
  }, "label.__jsx-style-dynamic-selector{display:".concat(typeof children === "string" ? 'block' : 'flex', ";font-weight:normal;color:").concat(theme.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;font-size:1em;line-height:1.5;}label.__jsx-style-dynamic-selector .mark-error.__jsx-style-dynamic-selector{color:").concat(theme.palette.errorDark, ";margin:0px 3px;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;font-size:").concat(SCALES.font(1.2), ";}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")));
};
InputBlockLabelComponent.displayName = 'InputBlockLabel';
var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
export default InputBlockLabel;