import { cnb } from "cnbuilder";
import { cssUtils } from "../cssUtils.js";
import { bem } from "../utils/bem.js";
import { getFormConfig } from "./formConfig.js";
import { label } from "./labelStyles.js";
const styles = bem("rmd-legend");
/**
 * @since 6.4.0
 */ export function legend(options = {}) {
    const { className, srOnly, floating, theme = getFormConfig("theme"), ...labelOptions } = options;
    return cnb(styles({
        floating,
        "floating-filled": floating && theme === "filled",
        "floating-underline": floating && theme === "underline",
        "floating-outline": floating && theme === "outline"
    }), floating && label({
        ...labelOptions,
        floating: true,
        floatingActive: true
    }), cssUtils({
        srOnly
    }), className);
}

//# sourceMappingURL=legendStyles.js.map