import { aspectRatio as aspectRatioRecipe } from "@seed-design/css/recipes/aspect-ratio"; import clsx from "clsx"; import * as React from "react"; import { Box, type BoxProps } from "../Box/Box"; export type AspectRatioProps = BoxProps & { /** * The aspect ratio of the aspect ratio container (width / height). * @default 4 / 3 */ ratio?: number; // following 3 are just here for JSDoc purposes /** * @default "relative" */ position?: BoxProps["position"]; /** * @default "hidden" */ overflowX?: BoxProps["overflowX"]; /** * @default "hidden" */ overflowY?: BoxProps["overflowY"]; }; export const AspectRatio = React.forwardRef( ({ ratio = 4 / 3, children, className, style, ...rest }, ref) => { const child = React.Children.only(children); const aspectRatio = aspectRatioRecipe(); return ( {child} ); }, ); AspectRatio.displayName = "AspectRatio";