import React, { forwardRef } from "react"; import type { OverridableComponent } from "../../../utils-external"; import { cl } from "../../../utils/helpers"; export const widths = ["text", "md", "lg", "xl", "2xl"] as const; export interface PageBlockProps extends React.HTMLAttributes { /** * Predefined max-width * * text: 576px + dynamic gutters * * md: 768px * * lg: 1024px * * xl: 1280px * * 2xl: 1440px * * @default max-width: 100%; */ width?: (typeof widths)[number]; /** * Adds a standardised responsive padding-inline * * 3rem on > md * * 1rem on < md * * @default false */ gutters?: boolean; } /** * Acts as a top-level container for defining max-width, gutters and horizontal centering * * @see [📝 Documentation](https://aksel.nav.no/komponenter/primitives/page) * @see 🏷️ {@link PageBlockProps} * @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support * * @example * ```jsx * } * > * // Header * // Content * * ``` * @example * With background bleed * Wrapping `Page.Block` with `Box` allows the background-color to use full screen-width * ```jsx * } * footerPosition="belowFold" * > * //Header * //Content * * ``` */ export const PageBlock: OverridableComponent = forwardRef( ({ as: Component = "div", gutters, className, width, ...rest }, ref) => { return ( ); }, ); export default PageBlock;