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

var __jsx = _react2["default"].createElement;
var stories = (0, _react.storiesOf)('Popper', module);

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

  var buttonRef = _react2["default"].useRef();

  function handleClick() {
    setOpen(!open);
  }

  return __jsx(_react2["default"].Fragment, null, __jsx(_Button.Button, {
    size: "sm",
    ref: buttonRef,
    onClick: handleClick
  }, "Toggle Popper"), __jsx(_.Popper, {
    placement: "right",
    isOpen: open,
    anchorEl: buttonRef.current,
    hasArrow: true
  }, __jsx("p", null, "The content of the Popper.")));
};

stories.add('Default', function () {
  return __jsx(Example, null);
});
//# sourceMappingURL=examples.js.map