"use strict";

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

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

var _addonActions = require("@storybook/addon-actions");

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

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

var _index = require("./index");

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$isDisabled = _ref.isDisabled,
      isDisabled = _ref$isDisabled === void 0 ? undefined : _ref$isDisabled,
      _ref$isFormButton = _ref.isFormButton,
      isFormButton = _ref$isFormButton === void 0 ? undefined : _ref$isFormButton,
      _ref$isLinkButton = _ref.isLinkButton,
      isLinkButton = _ref$isLinkButton === void 0 ? undefined : _ref$isLinkButton,
      _ref$tooltipPosition = _ref.tooltipPosition,
      tooltipPosition = _ref$tooltipPosition === void 0 ? undefined : _ref$tooltipPosition,
      _ref$hasAsyncStatus = _ref.hasAsyncStatus,
      hasAsyncStatus = _ref$hasAsyncStatus === void 0 ? undefined : _ref$hasAsyncStatus,
      _ref$asyncStatus = _ref.asyncStatus,
      asyncStatus = _ref$asyncStatus === void 0 ? undefined : _ref$asyncStatus,
      _ref$asyncStatusList = _ref.asyncStatusList,
      asyncStatusList = _ref$asyncStatusList === void 0 ? undefined : _ref$asyncStatusList,
      _ref$children = _ref.children,
      children = _ref$children === void 0 ? undefined : _ref$children,
      _ref$onClick = _ref.onClick,
      onClick = _ref$onClick === void 0 ? undefined : _ref$onClick;

  return {
    isDisabled: (0, _addonKnobs.boolean)('isDisabled', isDisabled),
    isFormButton: (0, _addonKnobs.boolean)('isFormButton', isFormButton),
    isLinkButton: (0, _addonKnobs.boolean)('isLinkButton', isLinkButton),
    tooltipPosition: (0, _addonKnobs.radios)('tooltipPosition', _utils.tooltipPositions, tooltipPosition),
    hasAsyncStatus: (0, _addonKnobs.boolean)('hasAsyncStatus', hasAsyncStatus),
    asyncStatus: (0, _addonKnobs.select)('asyncStatus', (0, _utils.asyncStates)({
      isList: false
    }), asyncStatus),
    asyncStatusList: (0, _addonKnobs.select)('asyncStatusList', (0, _utils.asyncStates)({
      isList: true
    }), asyncStatusList),
    children: (0, _addonKnobs.text)('children', children),
    onClick: (0, _addonKnobs.button)('onClick', (0, _addonActions.action)('clicked', onClick))
  };
};

(0, _react2.storiesOf)('Web|Button', module).addParameters({
  info: 'sharedTouchDevice'
}).add('Button', function () {
  return _react.default.createElement(_index.Button, props({
    children: 'Default button'
  }));
});