function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
import React from 'react';
import { Box } from '../../Box';
import { Breadcrumbs } from '../../Breadcrumbs';
import { Button } from '../../Button';
import { Card } from '../../Card';
import { Flex } from '../../Flex';
import { FlexList } from '../../FlexList';
import { Input } from '../../Input';
import { Modal } from '../../Modal';
import { useLabelledPopup } from '../../OverlayTrigger/a11yPresets';
import { Page } from '../../PageLayout';
import { Panel } from '../../Panel';
import { Required } from '../../Required';
import { H1, Label } from '../../Semantic';
import { SuperSelect } from '../../SuperSelect/SuperSelect';
import { Tabs } from '../../Tabs';
import { Tab } from '../../Tabs/Tabs';
import { exampleText } from '../../_storyHelpers_/constants';
var longText = exampleText.longest_ipsum;
var shortText = exampleText.short_sentence;
var panelContent = /*#__PURE__*/React.createElement(Flex, {
  direction: "column",
  alignItems: "center",
  paddingBottom: "lg",
  style: {
    width: '100%'
  }
}, Array.from({
  length: 10
}).map(function (_, i) {
  return /*#__PURE__*/React.createElement("div", {
    key: "".concat(i, "-content-item"),
    style: {
      width: '80%',
      height: '100px',
      marginTop: '16px',
      backgroundColor: 'white',
      border: '1px solid lightgray',
      borderRadius: '8px'
    }
  });
}));
function PanelSample(_ref) {
  var onClose = _ref.onClose,
    footer = _ref.hasFooter;
  return /*#__PURE__*/React.createElement(Panel, null, /*#__PURE__*/React.createElement(Panel.Header, {
    onClose: onClose
  }, /*#__PURE__*/React.createElement(Panel.Title, null, "Sample heading")), /*#__PURE__*/React.createElement(Panel.Body, null, panelContent), footer && /*#__PURE__*/React.createElement(Panel.Footer, null, /*#__PURE__*/React.createElement(Button, null, "Action 3"), /*#__PURE__*/React.createElement(FlexList, {
    space: "sm",
    marginLeft: "auto"
  }, /*#__PURE__*/React.createElement(Button, {
    variant: "primary"
  }, "Action 4"), /*#__PURE__*/React.createElement(Button, {
    onClick: onClose,
    variant: "secondary"
  }, "Close"))));
}
export var PageLayoutDemo = /*#__PURE__*/React.forwardRef(function PageLayoutDemo(props, ref) {
  var _props$asideVisible;
  var _React$useState = React.useState((_props$asideVisible = props.asideVisible) !== null && _props$asideVisible !== void 0 ? _props$asideVisible : false),
    _React$useState2 = _slicedToArray(_React$useState, 2),
    isAsideVisible = _React$useState2[0],
    setIsAsideVisible = _React$useState2[1];
  var _React$useState3 = React.useState(false),
    _React$useState4 = _slicedToArray(_React$useState3, 2),
    isModalVisible = _React$useState4[0],
    setIsModalVisible = _React$useState4[1];
  var _useLabelledPopup = useLabelledPopup({
      isOpen: isModalVisible,
      popupRole: 'dialog'
    }),
    triggerProps = _useLabelledPopup.triggerProps,
    labelProps = _useLabelledPopup.labelProps,
    popupProps = _useLabelledPopup.popupProps;
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal, _extends({
    open: isModalVisible,
    onClose: function onClose() {
      return setIsModalVisible(false);
    }
  }, popupProps, {
    role: "dialog",
    howToClose: ['x']
  }), /*#__PURE__*/React.createElement(Modal.Header, labelProps, shortText), /*#__PURE__*/React.createElement(Modal.Body, {
    tabIndex: 0
  }, longText)), /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(Page.Main, null, /*#__PURE__*/React.createElement(Page.Header, null, /*#__PURE__*/React.createElement(Page.Breadcrumbs, null, /*#__PURE__*/React.createElement(Breadcrumbs, null, /*#__PURE__*/React.createElement(Breadcrumbs.Crumb, {
    active: true
  }, "Tool Name"), /*#__PURE__*/React.createElement(Breadcrumbs.Crumb, null, "Item"))), /*#__PURE__*/React.createElement(Page.Title, null, /*#__PURE__*/React.createElement(H1, {
    id: "page-title"
  }, "Page Title")), /*#__PURE__*/React.createElement(Page.Tabs, null, /*#__PURE__*/React.createElement(Tabs, null, /*#__PURE__*/React.createElement(Tab, {
    active: true
  }, /*#__PURE__*/React.createElement(Tabs.Link, null, "Active")), /*#__PURE__*/React.createElement(Tab, null, /*#__PURE__*/React.createElement(Tabs.Link, null, "Second")), /*#__PURE__*/React.createElement(Tab, null, /*#__PURE__*/React.createElement(Tabs.Link, null, "Third")), /*#__PURE__*/React.createElement(Tab, null, /*#__PURE__*/React.createElement(Tabs.Link, null, "Fourth"))))), /*#__PURE__*/React.createElement(Page.Body, null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Box, {
    padding: "md"
  }, /*#__PURE__*/React.createElement(SuperSelect, {
    placeholder: "Select",
    block: true,
    multiple: true,
    options: [{
      value: '1',
      label: 'some label one'
    }, {
      value: '2',
      label: 'two 2'
    }, {
      value: '3',
      label: 'three three three'
    }],
    onChange: console.log
  })), /*#__PURE__*/React.createElement(Box, {
    padding: "md"
  }, /*#__PURE__*/React.createElement(Label, {
    block: true,
    style: {
      marginBottom: '4px'
    },
    htmlFor: "example"
  }, "Label Text", /*#__PURE__*/React.createElement(Required, null)), /*#__PURE__*/React.createElement(Input, {
    id: "example",
    placeholder: "Hello",
    ref: ref
  }))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Box, {
    padding: "md",
    marginTop: "sm"
  }, longText)), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Box, {
    padding: "md",
    marginTop: "sm"
  }, longText)), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Box, {
    padding: "md",
    marginTop: "sm"
  }, longText)), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Box, {
    padding: "md",
    marginTop: "sm"
  }, longText))), /*#__PURE__*/React.createElement(Page.Footer, null, /*#__PURE__*/React.createElement(Box, {
    padding: "16px",
    display: "flex"
  }, /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
    variant: "secondary",
    onClick: function onClick() {
      return setIsModalVisible(true);
    }
  }), "Open Modal"), /*#__PURE__*/React.createElement(Button, {
    variant: "secondary",
    onClick: function onClick() {
      return setIsAsideVisible(true);
    },
    style: {
      marginLeft: 'auto'
    }
  }, "Open Panel")))), /*#__PURE__*/React.createElement(Page.Aside, {
    open: isAsideVisible
  }, /*#__PURE__*/React.createElement(PanelSample, {
    hasFooter: true,
    onClose: function onClose() {
      return setIsAsideVisible(false);
    }
  }))));
});
//# sourceMappingURL=PageLayoutDemo.js.map