import { jsx } from '@emotion/core';
import { Fragment } from 'react';
import _pt from 'prop-types';
import { Heading } from '../Heading/Heading.esm.js';
import { StyledModalCloseButton } from './StyledModal.esm.js';
import { StickyObserver } from '../StickyObserver/StickyObserver.esm.js';

function StyledPanel(_ref) {
  var children = _ref.children;
  return jsx(Fragment, null, children);
}
StyledPanel.propTypes = {
  children: _pt.node.isRequired
};

var headerContainerCss = function headerContainerCss(theme) {
  return {
    backgroundColor: theme.colors.white,
    borderBottom: "1px solid ".concat(theme.colors.grey[20])
  };
};

var headerCss = function headerCss(theme) {
  return {
    display: "flex",
    alignItems: "center",
    justifyContent: "space-between",
    paddingTop: theme.space[7],
    paddingRight: theme.space[7],
    paddingBottom: theme.space[7],
    paddingLeft: theme.space[7]
  };
};

function StyledPanelHeader(_ref2) {
  var children = _ref2.children,
      onCloseButtonClick = _ref2.onCloseButtonClick,
      _ref2$closeButtonLabe = _ref2.closeButtonLabel,
      closeButtonLabel = _ref2$closeButtonLabe === void 0 ? "Close panel" : _ref2$closeButtonLabe;
  return jsx(StickyObserver, {
    lipShadowPosition: "bottom",
    css: headerContainerCss
  }, jsx("div", {
    css: headerCss
  }, jsx(Heading, {
    variant: "PRIMARY"
  }, children), jsx(StyledPanelCloseButton, {
    onClick: onCloseButtonClick,
    "aria-label": closeButtonLabel
  })));
}
StyledPanelHeader.propTypes = {
  children: _pt.node.isRequired,
  onCloseButtonClick: _pt.func,
  closeButtonLabel: _pt.string
};
function StyledPanelCloseButton(props) {
  return jsx(StyledModalCloseButton, props);
}

var bodySectionCss = function bodySectionCss(theme) {
  return {
    backgroundColor: theme.colors.white,
    paddingTop: theme.space[5],
    paddingRight: theme.space[7],
    paddingBottom: theme.space[7],
    paddingLeft: theme.space[7]
  };
};

function StyledPanelBodySection(_ref3) {
  var children = _ref3.children;
  return jsx("div", {
    css: bodySectionCss
  }, children);
}
StyledPanelBodySection.propTypes = {
  children: _pt.node.isRequired
};

var actionsContainerCss = function actionsContainerCss(theme) {
  return {
    width: "100%",
    backgroundColor: theme.colors.white,
    borderTop: "1px solid ".concat(theme.colors.grey[20])
  };
};

var actionsCss = function actionsCss(theme) {
  return {
    display: "flex",
    alignItems: "center",
    justifyContent: "space-between",
    paddingTop: theme.space[7],
    paddingRight: theme.space[7],
    paddingBottom: theme.space[7],
    paddingLeft: theme.space[7]
  };
};

function StyledPanelActions(_ref4) {
  var children = _ref4.children;
  return jsx(StickyObserver, {
    lipShadowPosition: "top",
    css: actionsContainerCss
  }, jsx("div", {
    css: actionsCss
  }, children));
}
StyledPanelActions.propTypes = {
  children: _pt.node.isRequired
};
StyledPanel.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "StyledPanel",
  "props": {
    "children": {
      "required": true,
      "tsType": {
        "name": "ReactReactNode",
        "raw": "React.ReactNode"
      },
      "description": ""
    }
  }
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/Modal/StyledPanel.tsx"] = {
    name: "StyledPanel",
    docgenInfo: StyledPanel.__docgenInfo,
    path: "src/components/Modal/StyledPanel.tsx"
  };
}

StyledPanelHeader.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "StyledPanelHeader",
  "props": {
    "closeButtonLabel": {
      "defaultValue": {
        "value": "`Close panel`",
        "computed": false
      },
      "required": false,
      "tsType": {
        "name": "string"
      },
      "description": ""
    },
    "children": {
      "required": true,
      "tsType": {
        "name": "ReactReactNode",
        "raw": "React.ReactNode"
      },
      "description": ""
    },
    "onCloseButtonClick": {
      "required": false,
      "tsType": {
        "name": "signature",
        "type": "function",
        "raw": "() => void",
        "signature": {
          "arguments": [],
          "return": {
            "name": "void"
          }
        }
      },
      "description": ""
    }
  }
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/Modal/StyledPanel.tsx"] = {
    name: "StyledPanelHeader",
    docgenInfo: StyledPanelHeader.__docgenInfo,
    path: "src/components/Modal/StyledPanel.tsx"
  };
}

StyledPanelCloseButton.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "StyledPanelCloseButton"
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/Modal/StyledPanel.tsx"] = {
    name: "StyledPanelCloseButton",
    docgenInfo: StyledPanelCloseButton.__docgenInfo,
    path: "src/components/Modal/StyledPanel.tsx"
  };
}

StyledPanelBodySection.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "StyledPanelBodySection",
  "props": {
    "children": {
      "required": true,
      "tsType": {
        "name": "ReactReactNode",
        "raw": "React.ReactNode"
      },
      "description": ""
    }
  }
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/Modal/StyledPanel.tsx"] = {
    name: "StyledPanelBodySection",
    docgenInfo: StyledPanelBodySection.__docgenInfo,
    path: "src/components/Modal/StyledPanel.tsx"
  };
}

StyledPanelActions.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "StyledPanelActions",
  "props": {
    "children": {
      "required": true,
      "tsType": {
        "name": "ReactReactNode",
        "raw": "React.ReactNode"
      },
      "description": ""
    }
  }
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/Modal/StyledPanel.tsx"] = {
    name: "StyledPanelActions",
    docgenInfo: StyledPanelActions.__docgenInfo,
    path: "src/components/Modal/StyledPanel.tsx"
  };
}

export { StyledPanel, StyledPanelActions, StyledPanelBodySection, StyledPanelCloseButton, StyledPanelHeader };
//# sourceMappingURL=StyledPanel.esm.js.map
