"use strict";

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

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

var _addonInfo = require("@storybook/addon-info");

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

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

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

(0, _react2.storiesOf)('Dropdown', module).add('Default', (0, _addonInfo.withInfo)('Default')(function () {
  return _react.default.createElement("div", {
    style: {
      margin: 10
    }
  }, _react.default.createElement("h4", null, "Default"), _react.default.createElement(_index.default, {
    label: "Gender",
    items: [{
      label: 'Male',
      value: 'male'
    }, {
      label: 'Female',
      value: 'female'
    }]
  }), _react.default.createElement("h4", null, "Selected"), _react.default.createElement(_index.default, {
    selectedIndex: 0,
    items: [{
      label: 'Male',
      value: 'male'
    }, {
      label: 'Female',
      value: 'female'
    }]
  }), _react.default.createElement("h4", null, "Multiple Selection"), _react.default.createElement(_index.default, {
    multiple: true,
    items: [{
      label: 'First',
      value: 'First'
    }, {
      label: 'Second',
      value: 'Second'
    }, {
      label: 'Third',
      value: 'Third'
    }, {
      label: 'Fourth',
      value: 'Fourth'
    }, {
      label: 'Fifth',
      value: 'Fifth'
    }]
  }), _react.default.createElement("h4", null, "Multiple initial Selection using index"), _react.default.createElement(_index.default, {
    multiple: true,
    selectedIndex: [0, 2],
    items: [{
      label: 'First',
      value: 'First'
    }, {
      label: 'Second',
      value: 'Second'
    }, {
      label: 'Third',
      value: 'Third'
    }, {
      label: 'Fourth',
      value: 'Fourth'
    }, {
      label: 'Fifth',
      value: 'Fifth'
    }]
  }), _react.default.createElement("h4", null, "Multiple initial Selection using value"), _react.default.createElement(_index.default, {
    multiple: true,
    value: ['First', 'Third'],
    items: [{
      label: 'First',
      value: 'First'
    }, {
      label: 'Second',
      value: 'Second'
    }, {
      label: 'Third',
      value: 'Third'
    }, {
      label: 'Fourth',
      value: 'Fourth'
    }, {
      label: 'Fifth',
      value: 'Fifth'
    }]
  }), _react.default.createElement("h4", null, "Custom Placeholder & without Label"), _react.default.createElement(_index.default, {
    placeholder: 'Select Gender',
    items: [{
      label: 'Male',
      value: 'male'
    }, {
      label: 'Female',
      value: 'female'
    }]
  }), _react.default.createElement("h4", null, "onChange function"), _react.default.createElement(_index.default, {
    placeholder: 'Select Gender',
    onChange: (0, _addonActions.action)('on-change'),
    items: [{
      label: 'Male',
      value: 'male'
    }, {
      label: 'Female',
      value: 'female'
    }]
  }), _react.default.createElement("h4", null, "Disabled"), _react.default.createElement(_index.default, {
    placeholder: 'Select Gender',
    disabled: true,
    selectedIndex: 0,
    items: [{
      label: 'Male',
      value: 'male'
    }, {
      label: 'Female',
      value: 'female'
    }]
  }), _react.default.createElement("h4", null, "With Error"), _react.default.createElement(_index.default, {
    placeholder: 'Select Gender',
    disabled: true,
    items: [{
      label: 'Male',
      value: 'male'
    }, {
      label: 'Female',
      value: 'female'
    }],
    error: 'Please select your gender'
  }));
}));