"use strict";

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

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

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

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

var _ = require(".");

var _Box = require("../Box");

var _Button = require("../Button");

var __jsx = _react2["default"].createElement;
var stories = (0, _react.storiesOf)('Collapse', module).addDecorator(function (story) {
  return __jsx(_Box.Box, {
    maxW: "sm",
    mx: "auto",
    mt: 5
  }, story());
});

function Example() {
  var _React$useState = _react2["default"].useState(false),
      _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
      show = _React$useState2[0],
      setShow = _React$useState2[1];

  var handleToggle = function handleToggle() {
    return setShow(!show);
  };

  return __jsx(_react2["default"].Fragment, null, __jsx(_Button.Button, {
    onClick: handleToggle
  }, "Toggle"), __jsx(_.Collapse, {
    mt: "spacing",
    isOpen: show
  }, "Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident."));
}

stories.add('Default', function () {
  return __jsx(Example, null);
});
stories.add('changing static height', function () {
  function Ex() {
    var _React$useState3 = _react2["default"].useState(false),
        _React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
        show = _React$useState4[0],
        setShow = _React$useState4[1];

    var handleToggle = function handleToggle() {
      return setShow(!show);
    };

    return __jsx(_react2["default"].Fragment, null, __jsx(_.Collapse, {
      startingHeight: 20,
      isOpen: show
    }, "Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident."), __jsx(_Button.Button, {
      size: "sm",
      onClick: handleToggle,
      mt: "1rem"
    }, show ? 'Collapse' : 'Expand'));
  }

  return __jsx(Ex, null);
});
//# sourceMappingURL=examples.js.map