import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { cnb } from "cnbuilder";
import { forwardRef } from "react";
import { bem } from "../utils/bem.js";
const styles = bem("rmd-fab");
/**
 * FAB = Floating Action Button
 *
 * @remarks \@since 6.0.0
 * @internal
 */ export function fab(options) {
    const { className, position = null, absolute = false } = options;
    return cnb(styles({
        tl: position === "top-left",
        tr: position === "top-right",
        bl: position === "bottom-left",
        br: position === "bottom-right",
        absolute
    }), className);
}
/**
 * @remarks \@since 6.0.0
 * @internal
 */ export const FloatingActionButton = /*#__PURE__*/ forwardRef(function FloatingActionButton(props, ref) {
    const { children, className, position = null, absolute = false, ...remaining } = props;
    if (!position) {
        return /*#__PURE__*/ _jsx(_Fragment, {
            children: children
        });
    }
    return /*#__PURE__*/ _jsx("span", {
        ...remaining,
        ref: ref,
        className: fab({
            className,
            position,
            absolute
        }),
        children: children
    });
});

//# sourceMappingURL=FloatingActionButton.js.map