"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("@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$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$onClick = _ref.onClick,
      onClick = _ref$onClick === void 0 ? undefined : _ref$onClick;

  return {
    isDisabled: (0, _addonKnobs.boolean)('is disabled', isDisabled),
    isFormButton: (0, _addonKnobs.boolean)('is form variant', isFormButton),
    isLinkButton: (0, _addonKnobs.boolean)('is link variant', isLinkButton),
    tooltipPosition: (0, _addonKnobs.radios)('tooltip position', _utils2.tooltipPositions, tooltipPosition),
    // hasAsyncStatus: boolean('has async status', hasAsyncStatus),
    // asyncStatus: select('async status', asyncStates({ isList: false }), asyncStatus),
    // asyncStatusList: select('async status list', asyncStates({ isList: true }), asyncStatusList),
    onClick: (0, _addonKnobs.button)('onClick', (0, _addonActions.action)('clicked', onClick))
  };
};

(0, _react2.storiesOf)('Shared|Button', module).add('default', function () {
  return _react.default.createElement(_component.default, props(), "default");
}).add('isLink', function () {
  return _react.default.createElement(_component.default, props({
    isLinkButton: true
  }), "link");
}).add('isForm', function () {
  return _react.default.createElement(_component.default, props({
    isFormButton: true,
    onClick: function onClick() {}
  }), "form");
}).add('isForm isDisabled', function () {
  return _react.default.createElement(_component.default, props({
    isFormButton: true,
    isDisabled: true
  }), "form disabled");
}); // .add('isForm isBusy', () => (
//   <Button {...props({
//     isFormButton: true,
//     hasAsyncStatus: true,
//     asyncStatus: SHAPE_ASYNC_STATUS_REQUESTED,
//   })}>
//     form busy
//   </Button>
// ))
// .add('isForm isError', () => (
//   <Button {...props({
//     isFormButton: true,
//     hasAsyncStatus: true,
//     asyncStatus: { ...SHAPE_ASYNC_STATUS_INITIAL, [IS_ERROR]: true, [ERROR_MESSAGE]: 'error message' }
//   })}>
//     form error
//   </Button>
// ))
// .add('isForm isError', () => (
//   <Button {...props({
//     isFormButton: true,
//     hasAsyncStatus: true,
//     asyncStatus: { ...SHAPE_ASYNC_STATUS_INITIAL, [IS_ERROR]: true, [ERROR_MESSAGE]: 'error message' }
//   })}>
//     form error
//   </Button>
// ))