function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from 'react';
import { Title, Subtitle, Description } from '@storybook/addon-docs';
import Drawer from './Drawer';
import { DrawerManager, useDrawerManager } from './DrawerManager';
import { Button } from '../Button';
var meta = {
  title: 'Components/DrawerManager',
  component: DrawerManager,
  parameters: {
    docs: {
      page: function page() {
        return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Title, null), /*#__PURE__*/React.createElement(Subtitle, null), /*#__PURE__*/React.createElement(Description, null));
      }
    }
  }
};
export default meta;
var drawerContent1 = {
  heading: 'Drawer Number One',
  children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("strong", null, "Yar!"), /*#__PURE__*/React.createElement("p", null, "Prow scuttle parrel provost Sail ho shrouds spirits boom mizzenmast yardarm. Pinnace holystone mizzenmast quarter crow's nest nipperkin grog yardarm hempen halter furl. Swab barque interloper chantey doubloon starboard grog black jack gangway rutters."), /*#__PURE__*/React.createElement("p", null, "Deadlights jack lad schooner scallywag dance the hempen jig carouser broadside cable strike colors. Bring a spring upon her cable holystone blow the man down spanker Shiver me timbers to go on account lookout wherry doubloon chase. Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to."))
};
var drawerContent2 = {
  heading: 'Drawer Number Two',
  children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("strong", null, "The Cosmos Awaits"), /*#__PURE__*/React.createElement("p", null, "Radio telescope quasar bits of moving fluff Sea of Tranquility Drake Equation rogue? Network of wormholes descended from astronomers cosmic ocean a mote of dust suspended in a sunbeam from which we spring hearts of the stars? Preserve and cherish that pale blue dot stirred by starlight descended from astronomers of brilliant syntheses two ghostly white figures in coveralls and helmets are softly dancing hundreds of thousands? Vastness is bearable only through love invent the universe a still more glorious dawn awaits dream of the mind's eye not a sunrise but a galaxyrise courage of our questions and billions upon billions upon billions upon billions upon billions upon billions upon billions."))
};
var drawerContent3 = {
  heading: 'Drawer Number Three',
  children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("strong", null, "Space, the final frontier"), /*#__PURE__*/React.createElement("p", null, "In the last 24 hours we have seen facilities now being created for the greatest and most complex exploration in man's history. We have felt the ground shake and the air shattered by the testing of a Saturn C-1 booster rocket, many times as powerful as the Atlas which launched John Glenn, generating power equivalent to 10,000 automobiles with their accelerators on the floor. We have seen the site where the F-1 rocket engines, each one as powerful as all eight engines of the Saturn combined, will be clustered together to make the advanced Saturn missile, assembled in a new building to be built at Cape Canaveral as tall as a 48 story structure, as wide as a city block, and as long as two lengths of this field."))
};
var SingleDrawerWithToggle = function SingleDrawerWithToggle() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  var _args$ = args[0],
    heading = _args$.heading,
    children = _args$.children;
  var _useDrawerManager = useDrawerManager(),
    toggleClick = _useDrawerManager.toggleClick,
    closeClick = _useDrawerManager.closeClick,
    isOpen = _useDrawerManager.isOpen;
  return /*#__PURE__*/React.createElement(React.Fragment, null, isOpen && /*#__PURE__*/React.createElement(Drawer, _extends({}, args, {
    onCloseClick: closeClick,
    footerTitle: "Footer Title",
    footerBody: /*#__PURE__*/React.createElement("p", {
      className: "ds-text ds-u-margin--0"
    }, "Footer content"),
    heading: heading
  }), children), /*#__PURE__*/React.createElement(Button, {
    className: "ds-c-drawer__toggle ds-u-margin-bottom--2",
    variation: "ghost",
    onClick: toggleClick
  }, heading));
};
export var DrawerManagerDefault = {
  render: function Component() {
    return /*#__PURE__*/React.createElement(DrawerManager, null, /*#__PURE__*/React.createElement(SingleDrawerWithToggle, drawerContent1), /*#__PURE__*/React.createElement(SingleDrawerWithToggle, drawerContent2), /*#__PURE__*/React.createElement(SingleDrawerWithToggle, drawerContent3));
  }
};