"use strict";

var _react = _interopRequireDefault(require("react"));

var _react2 = require("@storybook/react");

var _addonKnobs = require("@storybook/addon-knobs");

var _utils = require("@vincent_za/utils");

var _utils2 = require("../../../storybook/utils");

var _component = _interopRequireDefault(require("./component"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var props = function props() {
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
      _ref$isTouchDevice = _ref.isTouchDevice,
      isTouchDevice = _ref$isTouchDevice === void 0 ? false : _ref$isTouchDevice,
      _ref$isSearch = _ref.isSearch,
      isSearch = _ref$isSearch === void 0 ? undefined : _ref$isSearch,
      _ref$isAccordion = _ref.isAccordion,
      isAccordion = _ref$isAccordion === void 0 ? undefined : _ref$isAccordion,
      _ref$isOpenByDefault = _ref.isOpenByDefault,
      isOpenByDefault = _ref$isOpenByDefault === void 0 ? undefined : _ref$isOpenByDefault,
      _ref$isAccordionDisab = _ref.isAccordionDisabled,
      isAccordionDisabled = _ref$isAccordionDisab === void 0 ? undefined : _ref$isAccordionDisab,
      _ref$isTableResponsiv = _ref.isTableResponsive,
      isTableResponsive = _ref$isTableResponsiv === void 0 ? undefined : _ref$isTableResponsiv,
      _ref$isHidden = _ref.isHidden,
      isHidden = _ref$isHidden === void 0 ? undefined : _ref$isHidden,
      _ref$isDisabled = _ref.isDisabled,
      isDisabled = _ref$isDisabled === void 0 ? undefined : _ref$isDisabled,
      _ref$isNoContent = _ref.isNoContent,
      isNoContent = _ref$isNoContent === void 0 ? undefined : _ref$isNoContent,
      _ref$actionTemplate = _ref.actionTemplate,
      actionTemplate = _ref$actionTemplate === void 0 ? undefined : _ref$actionTemplate,
      _ref$title = _ref.title,
      title = _ref$title === void 0 ? undefined : _ref$title,
      _ref$fieldName = _ref.fieldName,
      fieldName = _ref$fieldName === void 0 ? undefined : _ref$fieldName,
      _ref$formName = _ref.formName,
      formName = _ref$formName === void 0 ? undefined : _ref$formName,
      _ref$children = _ref.children,
      children = _ref$children === void 0 ? undefined : _ref$children,
      _ref$hasAsyncStatus = _ref.hasAsyncStatus,
      hasAsyncStatus = _ref$hasAsyncStatus === void 0 ? true : _ref$hasAsyncStatus,
      _ref$isSpinnerAlwaysV = _ref.isSpinnerAlwaysVisible,
      isSpinnerAlwaysVisible = _ref$isSpinnerAlwaysV === void 0 ? undefined : _ref$isSpinnerAlwaysV,
      _ref$isInfoErrorVaria = _ref.isInfoErrorVariant,
      isInfoErrorVariant = _ref$isInfoErrorVaria === void 0 ? undefined : _ref$isInfoErrorVaria,
      _ref$infoMessage = _ref.infoMessage,
      infoMessage = _ref$infoMessage === void 0 ? undefined : _ref$infoMessage,
      _ref$asyncStatus = _ref.asyncStatus,
      asyncStatus = _ref$asyncStatus === void 0 ? undefined : _ref$asyncStatus;

  return {
    isTouchDevice: (0, _addonKnobs.boolean)('isTouchDevice', isTouchDevice),
    isSearch: (0, _addonKnobs.boolean)('isSearch', isSearch),
    isAccordion: (0, _addonKnobs.boolean)('isAccordion', isAccordion),
    isOpenByDefault: (0, _addonKnobs.boolean)('isOpenByDefault', isOpenByDefault),
    isAccordionDisabled: (0, _addonKnobs.boolean)('isAccordionDisabled', isAccordionDisabled),
    isTableResponsive: (0, _addonKnobs.boolean)('isTableResponsive', isTableResponsive),
    isHidden: (0, _addonKnobs.boolean)('isHidden', isHidden),
    isDisabled: (0, _addonKnobs.boolean)('isDisabled', isDisabled),
    isNoContent: (0, _addonKnobs.boolean)('isNoContent', isNoContent),
    actionTemplate: (0, _addonKnobs.text)('actionTemplate', actionTemplate),
    title: (0, _addonKnobs.text)('title', title),
    fieldName: (0, _addonKnobs.text)('fieldName', fieldName),
    formName: (0, _addonKnobs.text)('formName', formName),
    children: (0, _addonKnobs.text)('children', children),
    hasAsyncStatus: (0, _addonKnobs.boolean)('hasAsyncStatus', hasAsyncStatus),
    isSpinnerAlwaysVisible: (0, _addonKnobs.boolean)('isSpinnerAlwaysVisible', isSpinnerAlwaysVisible),
    isInfoErrorVariant: (0, _addonKnobs.boolean)('isInfoErrorVariant', isInfoErrorVariant),
    infoMessage: (0, _addonKnobs.text)('infoMessage', infoMessage),
    asyncStatus: (0, _addonKnobs.select)('asyncStatus', (0, _utils2.asyncStates)({
      isList: false
    }), asyncStatus)
  };
};

(0, _react2.storiesOf)('Web|page').add('PageSection', function () {
  return _react.default.createElement(_component.default, props({
    title: 'page section title',
    isNoContent: true,
    hasAsyncStatus: true,
    isSpinnerAlwaysVisible: true,
    asyncStatus: _utils.SHAPE_ASYNC_STATUS_REQUESTED
  }));
}, {
  info: 'container passes isTouchDevice'
});