import { jsx as _jsx } from "react/jsx-runtime";
import { cnb } from "cnbuilder";
import { forwardRef } from "react";
import { bem } from "../utils/bem.js";
const styles = bem("rmd-fieldset");
/**
 * @since 6.0.0
 */ export function fieldset(options = {}) {
    const { className, fullWidth, browserStyles = false } = options;
    return cnb(styles({
        unstyled: !browserStyles,
        "full-width": fullWidth
    }), className);
}
/**
 * @example Simple Example
 * ```tsx
 * import { Form, Fieldset, Legend } from "@react-md/core";
 *
 * function Example(): ReactElement {
 *   return (
 *     <Form>
 *       <Fieldset>
 *         <Legend>Some Title</Legend>
 *         // form components
 *       </Fieldset>
 *     </Form>
 *   );
 * }
 * ```
 */ export const Fieldset = /*#__PURE__*/ forwardRef(function Fieldset(props, ref) {
    const { className, fullWidth = false, browserStyles = false, children, ...remaining } = props;
    return /*#__PURE__*/ _jsx("fieldset", {
        ...remaining,
        ref: ref,
        className: fieldset({
            className,
            fullWidth,
            browserStyles
        }),
        children: children
    });
});

//# sourceMappingURL=Fieldset.js.map