import { OmitInternalProps } from '../../type-utils/omit-props'; import { HTMLChakraProps, UnstyledProp } from '@chakra-ui/react/styled-system'; export type DefaultPageRecipeProps = UnstyledProp; export type DefaultPageRootSlotProps = HTMLChakraProps<"div", DefaultPageRecipeProps>; export type DefaultPageHeaderSlotProps = HTMLChakraProps<"header">; export type DefaultPageActionsSlotProps = HTMLChakraProps<"div">; export type DefaultPageBackLinkSlotProps = HTMLChakraProps<"a">; export type DefaultPageTitleSlotProps = HTMLChakraProps<"h1">; export type DefaultPageSubtitleSlotProps = HTMLChakraProps<"p">; export type DefaultPageTabNavSlotProps = HTMLChakraProps<"div">; export type DefaultPageContentSlotProps = HTMLChakraProps<"main">; export type DefaultPageFooterSlotProps = HTMLChakraProps<"footer">; /** * Shared base props for DefaultPage.Root, common to both layout modes. */ type DefaultPageBaseProps = OmitInternalProps & { children?: React.ReactNode; ref?: React.Ref; }; /** * Props for DefaultPage.Root when using constrained layout (default). * * The page fills its parent height. The content area scrolls independently * while the header and footer are always pinned by the CSS grid. */ type DefaultPageConstrainedProps = DefaultPageBaseProps & { /** * Controls the scroll behaviour of the page. * * - `"constrained"` — The page fills its parent container (`height: 100%`). * Only the content area scrolls. Header and footer are pinned by the grid. * - `"flexible"` — The page grows with its content (`height: auto`). The * whole page scrolls. Use `stickyHeader`/`stickyFooter` to pin elements. * * @default "constrained" */ layout?: "constrained"; }; /** * Props for DefaultPage.Root when using flexible layout. * * The page grows with its content and the whole page scrolls. Use * `stickyHeader` and/or `stickyFooter` to pin the header or footer. */ type DefaultPageFlexibleProps = DefaultPageBaseProps & { /** * Controls the scroll behaviour of the page. * * - `"constrained"` — The page fills its parent container (`height: 100%`). * Only the content area scrolls. Header and footer are pinned by the grid. * - `"flexible"` — The page grows with its content (`height: auto`). The * whole page scrolls. Use `stickyHeader`/`stickyFooter` to pin elements. */ layout: "flexible"; /** * Pin the header at the top of the scroll container while the page scrolls. * Only available with `layout="flexible"`. */ stickyHeader?: boolean; /** * Pin the footer at the bottom of the scroll container while the page scrolls. * Only available with `layout="flexible"`. */ stickyFooter?: boolean; }; /** * Discriminated union on the `layout` prop. * * - `"constrained"` (default) — pinned header/footer, scrollable content. * - `"flexible"` — whole-page scroll; unlocks `stickyHeader` / `stickyFooter`. */ export type DefaultPageProps = DefaultPageConstrainedProps | DefaultPageFlexibleProps; export type DefaultPageHeaderProps = OmitInternalProps & { children?: React.ReactNode; ref?: React.Ref; }; export type DefaultPageActionsProps = OmitInternalProps & { children?: React.ReactNode; ref?: React.Ref; }; export type DefaultPageBackLinkProps = OmitInternalProps & { /** The URL to navigate to when the back link is clicked */ href: string; children?: React.ReactNode; ref?: React.Ref; }; export type DefaultPageTitleProps = OmitInternalProps & { children?: React.ReactNode; ref?: React.Ref; }; export type DefaultPageSubtitleProps = OmitInternalProps & { children?: React.ReactNode; ref?: React.Ref; }; export type DefaultPageTabNavProps = OmitInternalProps & { children?: React.ReactNode; ref?: React.Ref; }; export type DefaultPageContentProps = OmitInternalProps & { children?: React.ReactNode; ref?: React.Ref; }; export type DefaultPageFooterProps = OmitInternalProps & { children?: React.ReactNode; ref?: React.Ref; }; export {};