import { cnb } from "cnbuilder";
import { bem } from "./utils/bem.js";
const styles = bem("rmd-object-fit");
/**
 * This is a utility className helper function that should be applied to
 * `<img>` and `<video>` elements to make them responsive to their content box
 * container.
 *
 * @example Simple Example
 * ```tsx
 * import { objectFit } from "@react-md/core/objectFit";
 *
 * export function Example() {
 *   return (
 *     <img
 *       alt=""
 *       src="https://example.com/example.png"
 *       className={objectFit()}
 *     />
 *   );
 * }
 * ```
 *
 * @example Setting Aspect Ratio
 * ```tsx
 * import { objectFit } from "@react-md/core/objectFit";
 *
 * export function Example() {
 *   return (
 *     <img
 *       alt=""
 *       src="https://example.com/example.png"
 *       className={objectFit({
 *         aspectRatio: "16-9",
 *       })}
 *     />
 *   );
 * }
 *
 * ```
 *
 * @since 6.0.0
 */ export function objectFit(options = {}) {
    const { className, inline, fit: propFit, aspectRatio = "" } = options;
    const fit = propFit ?? (aspectRatio ? "fill" : "contain");
    return cnb(styles({
        [fit]: fit !== "contain",
        contain: !inline,
        [aspectRatio]: !!aspectRatio
    }), className);
}

//# sourceMappingURL=objectFit.js.map