"use client";
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from "react";
import { defaultGetSpinButtonTextContent } from "./defaults.js";
import { useSpinButton } from "./useSpinButton.js";
/**
 * The `SpinButton` component can be used as a simple wrapper around the
 * {@link useSpinButton} hook if it should be rendered within a `<div>` and
 * only the rendering behavior is required.
 *
 * @since 6.4.0
 */ export const SpinButton = /*#__PURE__*/ forwardRef(function SpinButton(props, ref) {
    const { id, min, max, minDigits, maxDigits, step, form, error, disabled, readOnly, required, fallback, mappings, value, defaultValue, onValueChange, getValueText, getTextContent = defaultGetSpinButtonTextContent, placeholderChar, defaultKeyboardValue, ...remaining } = props;
    const valueProps = {
        value,
        defaultValue
    };
    const { value: currentValue, spinButtonProps } = useSpinButton({
        id,
        ref,
        min,
        max,
        minDigits,
        maxDigits,
        step,
        form,
        fallback,
        mappings,
        error,
        disabled,
        readOnly,
        required,
        ...valueProps,
        onValueChange,
        getValueText,
        getTextContent,
        placeholderChar,
        defaultKeyboardValue
    });
    return /*#__PURE__*/ _jsx("div", {
        ...remaining,
        ...spinButtonProps,
        children: getTextContent({
            min,
            max,
            minDigits,
            maxDigits,
            value: currentValue,
            fallback,
            placeholderChar
        })
    });
});

//# sourceMappingURL=SpinButton.js.map