var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import styles from '@procore/core-css/src/layouts/_legacy_detail_page.scss';
import React from 'react';
import { Icon } from '../../components/Icon';
import { Visibility } from '../../state/Visibility';
import { addSubcomponents } from '../../utils/addSubcomponents';
var classnames = require('classnames/bind');
var cx = classnames.bind(styles);
var _a = React.createContext({
    isVisible: false,
    show: function () { },
    hide: function () { },
    toggle: function () { },
}), Provider = _a.Provider, Consumer = _a.Consumer;
var DetailPage_ = React.forwardRef(function DetailPage(_a, ref) {
    var children = _a.children, className = _a.className, initialIsVisible = _a.initialIsVisible, props = __rest(_a, ["children", "className", "initialIsVisible"]);
    return (React.createElement(Visibility, { initialIsVisible: initialIsVisible }, function (visibility) { return (React.createElement(Provider, { value: visibility },
        React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page', {
                'l-detail-page--collapsed': !visibility.isVisible,
            }, className) }, props), children))); }));
});
export var Main = React.forwardRef(function Main(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__main', className) }, props), children));
});
export var Banner = React.forwardRef(function Banner(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__banner', className) }, props), children));
});
export var Body = React.forwardRef(function Body(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__body', className) }, props),
        React.createElement("div", { className: cx('l-detail-page__body__content') }, children)));
});
export var Header = React.forwardRef(function Header(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__header', className) }, props), children));
});
export var Breadcrumbs = React.forwardRef(function Breadcrumbs(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__breadcrumbs', className) }, props), children));
});
export var Actions = React.forwardRef(function Aactions(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__actions', className) }, props), children));
});
export var Title = React.forwardRef(function Title(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__title', className) }, props), children));
});
export var Subtabs = React.forwardRef(function Subtabs(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__subtabs', className) }, props), children));
});
export var Sidebar = React.forwardRef(function (_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__sidebar', className) }, props), children));
});
export var SidebarContent = React.forwardRef(function Sidebar(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__sidebar__content', className) }, props), children));
});
export var SidebarFooter = React.forwardRef(function SidebarFooter(_a, ref) {
    var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
    return (React.createElement(Consumer, null, function (visibility) { return (React.createElement("div", __assign({ ref: ref, className: cx('l-detail-page__sidebar__footer', className), onClick: visibility.toggle }, props),
        React.createElement("div", { className: cx('l-detail-page__sidebar__footer__label') }, children),
        React.createElement("div", { className: cx('l-detail-page__sidebar__footer__icon') },
            React.createElement(Icon, { icon: "angle-double-left", clickable: true })))); }));
});
DetailPage_.displayName = 'LegacyDetailPage';
Banner.displayName = 'LegacyDetailPage.Actions';
Banner.displayName = 'LegacyDetailPage.Banner';
Body.displayName = 'LegacyDetailPage.Body';
Breadcrumbs.displayName = 'LegacyDetailPage.Breadcrumbs';
Header.displayName = 'LegacyDetailPage.Header';
Main.displayName = 'LegacyDetailPage.Main';
Sidebar.displayName = 'LegacyDetailPage.Sidebar';
SidebarContent.displayName = 'LegacyDetailPage.SidebarContent';
SidebarFooter.displayName = 'LegacyDetailPage.SidebarFooter';
Subtabs.displayName = 'LegacyDetailPage.Subtabs';
Title.displayName = 'LegacyDetailPage.Title';
/**
 * @deprecated
 *
 * This component has been deprecated and will be removed in a future version.
 * Please use `NextDetailPage` instead.
 *
 * @deprecatedSince 10.20.0
 *
 * @see https://core.procore.com/latest/web/layout/next-detail-page/react/
 * @since 10.19.0
 */
export var DetailPage = addSubcomponents({
    Actions: Actions,
    Banner: Banner,
    Body: Body,
    Breadcrumbs: Breadcrumbs,
    Header: Header,
    Consumer: Consumer,
    Main: Main,
    Provider: Provider,
    Sidebar: Sidebar,
    SidebarContent: SidebarContent,
    SidebarFooter: SidebarFooter,
    Subtabs: Subtabs,
    Title: Title,
}, DetailPage_);
export default DetailPage;
//# sourceMappingURL=LegacyDetailPage.js.map