UNPKG

@wix/design-system

Version:

@wix/design-system

112 lines 4.77 kB
import React, { PureComponent } from 'react'; import PageHeader, { HeaderProps } from './components/Header'; import { SectionProps } from './components/Section'; import { ContentProps, PageProps, TailProps, FixedContentProps, FixedFooterProps } from './Page.types'; type DefaultProps = Required<Pick<PageProps, 'minWidth' | 'maxWidth' | 'scrollProps'>>; type Props = PageProps & DefaultProps; type State = { headerContainerHeight: number; headerWrapperHeight: number; tailHeight: number; footerHeight: number; pageHeight?: number; windowHeight?: number; minimized: boolean; }; type HeaderElement = React.ReactElement<HeaderProps>; type SectionElement = React.ReactElement<SectionProps>; type ContentElement = React.ReactElement<ContentProps>; type FixedContentElement = React.ReactElement<FixedContentProps>; type TailElement = React.ReactElement<TailProps>; type FixedFooterElement = React.ReactElement<FixedFooterProps>; type ChildrenObject = { PageHeader?: HeaderElement; Section?: SectionElement; PageContent?: ContentElement; PageFixedContent?: FixedContentElement; PageTail?: TailElement; FixedFooter?: FixedFooterElement; }; declare class Page extends PureComponent<Props, State> { static displayName: string; static defaultProps: DefaultProps; static Header: typeof PageHeader; static Section: { ({ dataHook, showDivider, title, subtitle, actionsBar, className, }: SectionProps): React.JSX.Element; displayName: string; }; static Content: { ({ children, stickyStyle }: ContentProps): any; displayName: string; }; static FixedContent: { (props: { children: React.ReactNode; }): React.ReactNode; displayName: string; }; static Tail: { ({ children, minimized }: TailProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>; displayName: string; }; static FixedFooter: { ({ children }: FixedContentProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>; displayName: string; }; static Sticky: { ({ children, className, style, ...props }: import("./Page.types").StickyProps): React.JSX.Element; displayName: string; }; static Footer: { ({ divider, className, children, dataHook, ...props }: import("./components/Footer").FooterProps): React.JSX.Element; displayName: string; Start: typeof import("./components/Footer/components/Start/Start").default; Center: typeof import("./components/Footer/components/Center/Center").default; End: typeof import("./components/Footer/components/End/End").default; }; scrollableContainerRef: React.RefObject<HTMLDivElement>; headerWrapperRef: HTMLDivElement | null; headerContainerRef: HTMLDivElement | null; pageHeaderTailRef: HTMLDivElement | null; pageRef: HTMLDivElement | null; footerWrapperRef: HTMLDivElement | null; pageScrollContextValue: { scrollableContentRef: React.RefObject<HTMLDivElement>; }; headerResizeObserver: ResizeObserver | undefined; constructor(props: Props); componentDidMount(): void; componentDidUpdate(): void; componentWillUnmount(): void; _getNamedChildren(): ChildrenObject; _calculateComponentsHeights(): void; _getScrollContainer(): HTMLDivElement | null; _getMinimizedHeaderWrapperHeight(): number; _getMinimizationDiff(): number | null; _handleScroll(e: HTMLElement): void; _handleWindowResize(): void; _safeGetChildren(element?: ContentElement): string | number | true | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>; _getPageDimensionsStyle(): React.CSSProperties | undefined; _hasBackgroundImage(): boolean; _hasGradientClassName(): boolean; _renderContentHorizontalLayout(props: React.HTMLAttributes<HTMLDivElement> & { horizontalScroll?: boolean; }): React.JSX.Element; _renderHeader(): React.JSX.Element | undefined; _renderHeaderContainer(): React.JSX.Element; _renderScrollableContainer(): React.JSX.Element; _hasTail(): boolean; _hasHeader(): boolean; _renderScrollableBackground(): React.JSX.Element | null; _renderTail(): React.JSX.Element | undefined; _renderContentContainer(): React.JSX.Element; _renderFixedFooter: () => React.JSX.Element | null; render(): React.JSX.Element; /** * Scrolls the page to a particular set of coordinates * @param {ScrollToOptions} scrollTo { left: number, top: number, behavior: 'smooth' | 'auto' } */ scrollTo(scrollTo?: ScrollToOptions): void; } export default Page; //# sourceMappingURL=Page.d.ts.map