import type { BaseButtonProps } from "../ButtonV2/ButtonProps.type"; import type { PageHeaderProps } from "../PageHeader"; type CRUDPageButtonProps = Pick; type CRUDPageTitle = { text: string; /** * @deprecated * We don't want to show icons in the page title anymore. */ icon?: string; }; type CRUDPageHeader = Omit; type CRUDPagePropsWithoutHeaderOrTitle = { dataTestId?: string; /** * @deprecated use accessory instead */ submitButtonProps?: CRUDPageButtonProps; /** * @deprecated use accessory instead */ cancelButtonProps?: CRUDPageButtonProps; className?: string; isLoading?: boolean; /** * @deprecated Instead, show the loading indicator in the submit button directly * if you want to show a loading state in the submit button. * * @example submitButton={Submit} */ isSubmitting?: boolean; children?: React.ReactNode; steps?: { titles: Array; currentStep: number; localization: { step: string; }; }; /** * When `true` will set the height of the * page to `100vh` and use `overflow-y: auto` * to set a better mobile experience when this form is in use. * * By default in vitals the html, body and react container are * set to `100vh` height with `overflow: hidden` and the pages. * * It would be probably best if the page by default had `100vh` and * `overflow-y: auto` but it could cause strange layout behaviors in HiX, * for the sake of avoiding breaking changes I'd rather keep it configurable. * */ isMobileFriendly?: boolean; /** * Component that will be rendered above the container that renders the children in the page. * The header - with page title and breadcrumbs will be rendered above this component. */ belowHeader?: React.ReactNode; /** * Rendered directly below the children of this component. * Used for e.g. submit and cancel buttons. * * Will override the deprecated submitButtonProps and cancelButtonProps if provided, so * please make sure to include them. */ accessory?: React.ReactNode; }; export type CRUDPageProps = (CRUDPagePropsWithoutHeaderOrTitle & { title: CRUDPageTitle; header?: never; }) | (CRUDPagePropsWithoutHeaderOrTitle & { header: CRUDPageHeader; title?: never; }) /** * For the minimalistic variant of the form, where no page title * and no header components are needed. */ | (CRUDPagePropsWithoutHeaderOrTitle & { header?: never; title?: never; }); export {};