import { jsx as _jsx } from "react/jsx-runtime";
import { cnb } from "cnbuilder";
import { forwardRef } from "react";
import { cssUtils } from "../cssUtils.js";
import { Typography } from "../typography/Typography.js";
/**
 * **Server Component**
 *
 * This should be used within a `Fieldset` to apply a label.
 *
 * @remarks \@since 6.0.0
 */ export const Legend = /*#__PURE__*/ forwardRef(function Legend(props, ref) {
    const { srOnly = false, className, children, ...remaining } = props;
    return /*#__PURE__*/ _jsx(Typography, {
        ...remaining,
        as: "legend",
        ref: ref,
        className: cnb("rmd-legend", cssUtils({
            srOnly
        }), className),
        children: children
    });
});

//# sourceMappingURL=Legend.js.map