var _excluded = ["children"],
  _excluded2 = ["children", "settingsHref"],
  _excluded3 = ["children"];
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); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import { Cog } from '@procore/core-icons/dist';
import React from 'react';
import { LinkButton } from '../Button';
import { DetailPage, DetailPageViewContext } from '../DetailPage';
import { Page } from '../PageLayout';
import { Tooltip } from '../Tooltip';
import { useI18nContext } from '../_hooks/I18n';
import { colors } from '../_styles/colors';
import { addSubcomponents } from '../_utils/addSubcomponents';
import { StyledTitleInner, StyledTitleOuter, StyledToolLandingPageBodyContent } from './ToolLandingPage.styles';
export var ToolLandingPage_ = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
  var children = _ref.children,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement(DetailPageViewContext.Provider, {
    value: {
      width: 'xl',
      hasNavigation: false
    }
  }, /*#__PURE__*/React.createElement(Page, _extends({
    ref: ref
  }, props), children));
});
export var Title = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
  var children = _ref2.children,
    settingsHref = _ref2.settingsHref,
    props = _objectWithoutProperties(_ref2, _excluded2);
  var i18n = useI18nContext();
  return /*#__PURE__*/React.createElement(StyledTitleOuter, _extends({
    ref: ref
  }, props), settingsHref && /*#__PURE__*/React.createElement(Tooltip, {
    overlay: i18n.t('core.toolHeader.settingsAction'),
    trigger: ['hover', 'focus']
  }, /*#__PURE__*/React.createElement(LinkButton, {
    "aria-label": i18n.t('core.toolHeader.settingsAction'),
    role: "link",
    icon: /*#__PURE__*/React.createElement(Cog, {
      color: colors.orange50
    }),
    href: settingsHref,
    variant: "tertiary"
  })), /*#__PURE__*/React.createElement(StyledTitleInner, null, children));
});
export var Body = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
  var children = _ref3.children,
    props = _objectWithoutProperties(_ref3, _excluded3);
  return /*#__PURE__*/React.createElement(DetailPage.Body, _extends({
    ref: ref
  }, props), /*#__PURE__*/React.createElement(StyledToolLandingPageBodyContent, null, children));
});

/**
 * A list page is basically a copy of SettingsPage/DetailPage. However, it has some differences.
 * ToolLandingPage does not have Breadcrumbs, nested sections (although, we may need them in the future), and Footer.
 *
 * @since 12.9.0
 *
 * @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-toollandingpage--demo)
 *
 * @see [Design Guidelines](https://design.procore.com/tool-landing-layout)
 */

export var ToolLandingPage = addSubcomponents({
  Main: Page.Main,
  Header: Page.Header,
  Banner: Page.Banner,
  Title: Title,
  Tabs: Page.Tabs,
  Body: Body,
  Aside: Page.Aside
}, ToolLandingPage_);
ToolLandingPage_.displayName = 'ToolLandingPage';
//# sourceMappingURL=ToolLandingPage.js.map