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 React, { forwardRef } from "react";
import { omit } from "../../utils-external/index.js";
import { cl } from "../../utils/helpers/index.js";
import { PageBlock } from "./parts/PageBlock.js";
export const PageComponent = forwardRef((_a, ref) => {
    var { as: Component = "div", className, footer, children, footerPosition, contentBlockPadding = "end" } = _a, rest = __rest(_a, ["as", "className", "footer", "children", "footerPosition", "contentBlockPadding"]);
    const belowFold = footerPosition === "belowFold";
    return (React.createElement(Component, Object.assign({}, omit(rest, ["background"]), { className: cl("aksel-page", className), ref: ref }),
        React.createElement("div", { className: cl({
                "aksel-page__content--fullheight": belowFold,
                "aksel-page__content--grow": !belowFold,
                "aksel-page__content--padding": contentBlockPadding === "end",
            }) }, children),
        footer));
});
/**
 * Page helps with establishing a top-level layout for your page
 *
 * @see [📝 Documentation](https://aksel.nav.no/komponenter/primitives/page)
 * @see 🏷️ {@link PageProps}
 * @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
 *
 * @example
 * ```jsx
 * <Page
 *   footer={<Page.Block width="xl" gutters />}
 * >
 *   <Page.Block width="xl" gutters />// Header
 *   <Page.Block width="xl" gutters />// Content
 * </Page>
 * ```
 * @example
 * Footer placed below page-fold
 * ```jsx
 * <Page
 *   footer={<Page.Block width="xl" gutters />}
 *   footerPosition="belowFold"
 * >
 *   <Page.Block width="xl" gutters />// Header
 *   <Page.Block width="xl" gutters />// Content
 * </Page>
 * ```
 */
const Page = PageComponent;
Page.Block = PageBlock;
export default Page;
//# sourceMappingURL=Page.js.map