"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.ShortText = void 0;
var _react = _interopRequireDefault(require("react"));
var _designSystem = require("@wix/design-system");
var _Field = require("../Field");
var _dataHooks = require("../dataHooks");
var _useTextInput = require("../useTextInput");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/fields/ShortText/ShortText.tsx";
const ShortText = ({
  dataHook,
  schema,
  initialValue,
  onChange
}) => {
  const {
    value,
    charCount,
    handleChange
  } = (0, _useTextInput.useTextInput)({
    initialValue,
    maxLength: schema.maxLength,
    onChange
  });
  return /*#__PURE__*/_react.default.createElement(_Field.Field, {
    dataHook: dataHook,
    type: schema.type,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 23,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.FormField, {
    dataHook: _dataHooks.dataHooks.Label,
    label: schema.label,
    charCount: charCount,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 24,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Input, {
    dataHook: _dataHooks.dataHooks.Input,
    value: value,
    onChange: handleChange,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 9
    }
  })));
};
exports.ShortText = ShortText;
//# sourceMappingURL=ShortText.js.map