"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.ValidationAndDefaultsSection = void 0;
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _designSystem = require("@wix/design-system");
var _ValidationSubSection = require("./ValidationSubSection");
var _ValidationAndDefaultsSectionStCss = require("./ValidationAndDefaultsSection.st.css.js");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CmsFieldManagement/Sections/ValidationAndDefaultsSection.tsx";
const _ValidationAndDefaultsSection = ({
  state
}) => {
  const hasValidation = state.supportedValidationRules.length > 0;
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _ValidationAndDefaultsSectionStCss.classes.accordionWrapper,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 16,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Accordion, {
    skin: "light",
    hideShadow: true,
    horizontalPadding: "large",
    items: [{
      title: 'Validation and defaults',
      toggleIconPlacement: 'start',
      children: /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
        direction: "vertical",
        gap: "SP3",
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 26,
          columnNumber: 15
        }
      }, hasValidation && /*#__PURE__*/_react.default.createElement(_ValidationSubSection.ValidationSubSection, {
        state: state,
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 27,
          columnNumber: 35
        }
      }), /*#__PURE__*/_react.default.createElement(_designSystem.FormField, {
        label: "Help text",
        infoContent: "Descriptive text shown below the field in forms.",
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 29,
          columnNumber: 17
        }
      }, /*#__PURE__*/_react.default.createElement(_designSystem.Input, {
        value: state.properties.helpText,
        onChange: e => state.setHelpText(e.target.value),
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 33,
          columnNumber: 19
        }
      })))
    }],
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 17,
      columnNumber: 7
    }
  }));
};
const ValidationAndDefaultsSection = exports.ValidationAndDefaultsSection = (0, _mobxReactLite.observer)(_ValidationAndDefaultsSection);
//# sourceMappingURL=ValidationAndDefaultsSection.js.map