import { clsx } from 'clsx'; import type { ComponentPropsWithRef, ElementType, PropsWithChildren } from 'react'; import { CommonProps } from '../common'; type ContainerOwnProps = CommonProps & { /** Controls the maximum width: `fluid` (100%), `standard` (1160px), `narrow` (840px), `compact` (600px). @default 'standard' */ size?: 'fluid' | 'standard' | 'narrow' | 'compact'; as?: T; }; export type ContainerProps = PropsWithChildren< ContainerOwnProps > & Omit, keyof ContainerOwnProps | 'children'>; /** * Centers page content within a responsive max-width boundary, with automatic horizontal padding that adapts to the viewport size. * * **Design guidance**: wise.design/foundations/grid */ const Container = ({ size = 'standard', as, className, children, ...otherProps }: ContainerProps) => { const Element = as ?? 'div'; return ( {children} ); }; export default Container;