'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _react3 = require('@storybook/react');

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

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

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

var _index2 = _interopRequireDefault(_index);

var _ResultsHeading = require('./ResultsHeading.md');

var _ResultsHeading2 = _interopRequireDefault(_ResultsHeading);

var _TagsKnobs = require('../../molecules/Tags/Tags.knobs.options');

var _TagsKnobs2 = _interopRequireDefault(_TagsKnobs);

var _ResultsHeadingKnobs = require('./ResultsHeading.knobs.options');

var _ButtonToggleKnobs = require('../../atoms/buttons/ButtonToggle/ButtonToggle.knobs.options');

var _ButtonToggleKnobs2 = _interopRequireDefault(_ButtonToggleKnobs);

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

(0, _react3.storiesOf)('molecules/ResultsHeading', module).addDecorator((0, _addonKnobs.withKnobs)({ escapeHTML: false })).add('ResultsHeading with ButtonToggle', function () {
  var props = {
    numResults: (0, _addonKnobs.text)('ResultsHeading numResults', '1-12'),
    totalResults: (0, _addonKnobs.text)('ResultsHeading totalResults', '108'),
    tags: {
      tags: (0, _addonKnobs.object)('ResultsHeading tags', _TagsKnobs2.default.tags),
      onClearCallback: (0, _addonActions.action)('resultsHeading tags on clearAll'),
      onClearThisCallback: (0, _addonActions.action)('resultsHeading tags on clearThis')
    }
  };
  props.buttonToggle = {
    option1: (0, _addonKnobs.object)('ResultsHeading buttonToggle: option1', _ButtonToggleKnobs2.default.options[0]),
    option2: (0, _addonKnobs.object)('ResultsHeading buttonToggle: option2', _ButtonToggleKnobs2.default.options[1]),
    id: (0, _addonKnobs.text)('ResultsHeading buttonToggle: id', 'sort'),
    labelText: (0, _addonKnobs.text)('ResultsHeading buttonToggle: labelText', 'Sort by:'),
    onChangeCallback: (0, _addonActions.action)('resultsHeading buttontoggle on change'),
    defaultValue: (0, _addonKnobs.select)('ResultsHeading buttonToggle: defaultValue', [_ButtonToggleKnobs2.default.options[0].value, _ButtonToggleKnobs2.default.options[1].value], 'date')
  };
  return _react2.default.createElement(_index2.default, props);
}, { info: _ResultsHeading2.default }).add('ResultsHeading with SelectBox', function () {
  var props = {
    numResults: (0, _addonKnobs.text)('ResultsHeading numResults', '1-12'),
    totalResults: (0, _addonKnobs.text)('ResultsHeading totalResults', '108'),
    tags: {
      tags: (0, _addonKnobs.object)('ResultsHeading tags', _TagsKnobs2.default.tags),
      onClearCallback: (0, _addonActions.action)('resultsHeading tags on clearAll'),
      onClearThisCallback: (0, _addonActions.action)('resultsHeading tags on clearThis')
    }
  };
  props.selectBox = {
    label: (0, _addonKnobs.text)('ResultsHeading selectBox: label', 'Sort by:', 'SelectBox'),
    stackLabel: (0, _addonKnobs.boolean)('ResultsHeading selectBox: stackLabel', false, 'SelectBox'),
    required: (0, _addonKnobs.boolean)('ResultsHeading selectBox: required', true, 'SelectBox'),
    id: (0, _addonKnobs.text)('ResultsHeading selectBox: id', 'sort-select', 'SelectBox'),
    options: (0, _addonKnobs.object)('ResultsHeading selectBox: options', _ResultsHeadingKnobs.SortData.sort, 'SelectBox'),
    selected: (0, _addonKnobs.select)('ResultsHeading selectBox: defaultSelected', _ResultsHeadingKnobs.SortData.sort.map(function (option) {
      return option.text;
    }), _ResultsHeadingKnobs.SortData.sort[0].text, 'SelectBox'),
    onChangeCallback: (0, _addonActions.action)('custom-click on select')
  };
  return _react2.default.createElement(_index2.default, props);
}, { info: _ResultsHeading2.default });