"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _core = require("@emotion/core");

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

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

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

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

var _Root = _interopRequireDefault(require("../../../Root"));

var _InputLight = require("./InputLight");

var _hocs = require("../../../../hocs");

var ControllerInputLight = (0, _hocs.withValueState)()((0, _hocs.withFocusedState)()((0, _hocs.withHoveredState)()(_InputLight.InputLight)));
(0, _react.storiesOf)('InputLight', module).addDecorator(_addonKnobs.withKnobs).add('Empty', function () {
  var knobs = {
    error: (0, _addonKnobs.text)('error', 'Something went wrong'),
    hovered: (0, _addonKnobs["boolean"])('hovered', false),
    focused: (0, _addonKnobs["boolean"])('focused', false)
  };
  return (0, _core.jsx)(_Root["default"], null, (0, _core.jsx)(_InputLight.InputLight, (0, _extends2["default"])({}, knobs, {
    placeholder: 'Type something...'
  })));
}).add('Filled', function () {
  var knobs = {
    error: (0, _addonKnobs.text)('error', 'Something went wrong'),
    hovered: (0, _addonKnobs["boolean"])('hovered', false),
    focused: (0, _addonKnobs["boolean"])('focused', false),
    success: (0, _addonKnobs["boolean"])('success', false),
    value: (0, _addonKnobs.text)('value', 'Awesome text')
  };
  return (0, _core.jsx)(_Root["default"], null, (0, _core.jsx)(_InputLight.InputLight, knobs));
}).add('With focus and hover', function () {
  return (0, _core.jsx)(_Root["default"], null, (0, _core.jsx)(ControllerInputLight, {
    value: "Hello world",
    placeholder: 'Type something...',
    onChange: (0, _addonActions.action)('onChange'),
    onFocus: (0, _addonActions.action)('onFocus'),
    onBlur: (0, _addonActions.action)('onBlur')
  }));
});