import { HTMLChakraProps, UnstyledProp } from '@chakra-ui/react/styled-system'; import { OmitInternalProps } from '../../type-utils/omit-props'; /** ModalPage has no size/variant recipe variants — only the unstyled escape hatch. */ type ModalPageRecipeProps = UnstyledProp; export type ModalPageRootSlotProps = HTMLChakraProps<"div", ModalPageRecipeProps>; export type ModalPageTopBarSlotProps = HTMLChakraProps<"div">; export type ModalPageHeaderSlotProps = HTMLChakraProps<"header">; export type ModalPageTitleSlotProps = HTMLChakraProps<"div">; export type ModalPageSubtitleSlotProps = HTMLChakraProps<"p">; export type ModalPageTabNavSlotProps = HTMLChakraProps<"div">; export type ModalPageActionsSlotProps = HTMLChakraProps<"div">; export type ModalPageContentSlotProps = HTMLChakraProps<"div">; export type ModalPageFooterSlotProps = HTMLChakraProps<"footer">; /** * Props for ModalPage.Root * * ModalPage.Root renders a Drawer internally. Style props (e.g. `width`) are * forwarded to the underlying Drawer.Content panel. The default width is * near-fullscreen; pass a custom `width` to override. * * Note: Unlike other sub-components, Root does not extend its slot props * because it wraps a Drawer — Chakra style props are not surfaced to consumers. * Use the `width` prop for panel sizing. */ export type ModalPageRootProps = { /** Whether the modal page is open (controlled) */ isOpen: boolean; /** Callback fired when the modal page should close */ onClose: () => void; /** Child components — TopBar (required), Header, Content, and optional Footer */ children: React.ReactNode; /** Ref forwarded to the inner grid container */ ref?: React.Ref; /** Custom width for the modal page panel. Defaults to near-fullscreen. */ width?: HTMLChakraProps<"div">["width"]; }; /** * Props for ModalPage.TopBar */ export type ModalPageTopBarProps = OmitInternalProps & { /** Label of the previous page shown in the back navigation button (e.g. "Products") */ previousPathLabel: string; /** Label of the current page shown in the breadcrumb (e.g. "Edit Product") */ currentPathLabel: string; /** Ref forwarded to the top bar container */ ref?: React.Ref; }; /** * Props for ModalPage.Header */ export type ModalPageHeaderProps = OmitInternalProps & { /** Header content — typically ModalPage.Title, ModalPage.Subtitle, and ModalPage.Actions */ children: React.ReactNode; /** Ref forwarded to the header element */ ref?: React.Ref; }; /** * Props for ModalPage.Title */ export type ModalPageTitleProps = OmitInternalProps & { /** Title text content — rendered inside an h2 heading */ children?: React.ReactNode; /** Ref forwarded to the title container */ ref?: React.Ref; }; /** * Props for ModalPage.Subtitle */ export type ModalPageSubtitleProps = OmitInternalProps & { /** Subtitle text content displayed below the title */ children?: React.ReactNode; /** Ref forwarded to the subtitle paragraph element */ ref?: React.Ref; }; /** * Props for ModalPage.TabNav */ export type ModalPageTabNavProps = OmitInternalProps & { /** Tab navigation content — typically a TabNav.Root */ children?: React.ReactNode; /** Ref forwarded to the tab nav container */ ref?: React.Ref; }; /** * Props for ModalPage.Actions */ export type ModalPageActionsProps = OmitInternalProps & { /** Action button elements displayed in the header right column */ children: React.ReactNode; /** Ref forwarded to the actions container */ ref?: React.Ref; }; /** * Props for ModalPage.Content */ export type ModalPageContentProps = OmitInternalProps & { /** Page content — forms, tables, read-only fields, or any layout content */ children?: React.ReactNode; /** Ref forwarded to the content container */ ref?: React.Ref; }; /** * Props for ModalPage.Footer */ export type ModalPageFooterProps = OmitInternalProps & { /** Footer content — typically save/cancel action buttons */ children: React.ReactNode; /** Ref forwarded to the footer element */ ref?: React.Ref; }; export {};