"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 _hocs = require("../../../../hocs");

var _TextareaLight = require("./TextareaLight");

var ControlledTextareaLight = (0, _hocs.withValueState)()((0, _hocs.withFocusedState)()((0, _hocs.withHoveredState)()(_TextareaLight.TextareaLight)));
(0, _react.storiesOf)('TextareaLight', module).addDecorator(_addonKnobs.withKnobs).add('Controlled', function () {
  var actions = {
    onClick: (0, _addonActions.action)('onClick'),
    onBlur: (0, _addonActions.action)('onBlur'),
    onFocus: (0, _addonActions.action)('onFocus'),
    onChange: (0, _addonActions.action)('onChange')
  };
  return (0, _core.jsx)(_Root["default"], null, (0, _core.jsx)(ControlledTextareaLight, (0, _extends2["default"])({
    value: "Hello world",
    placeholder: 'Type something...'
  }, actions)));
}).add('Uncontrolled', function () {
  var knobs = {
    placeholder: (0, _addonKnobs.text)('placeholder', ''),
    error: (0, _addonKnobs.text)('error', 'Something went wrong'),
    hovered: (0, _addonKnobs["boolean"])('hovered', false),
    focused: (0, _addonKnobs["boolean"])('focused', false),
    value: (0, _addonKnobs.text)('value', 'Awesome text')
  };
  return (0, _core.jsx)(_Root["default"], null, (0, _core.jsx)(_TextareaLight.TextareaLight, knobs));
});