/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-6a365ba
 * Released under the MIT license.
 */

import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { forwardRef, useRef } from 'react';
import { Gradation } from './Gradation.js';
import { SliderBase } from './SliderBase.js';
import { SliderThumb } from './SliderThumb.js';
import { SliderTrack } from './SliderTrack.js';
const INTL_MESSAGES = {
    minimum: 'Minimum',
    maximum: 'Maximum',
};
function RangeSlider(props, ref) {
    let { isDisabled, styles, gradation, ...otherProps } = props;
    // Create separate refs for each thumb to enable proper focus management
    const minThumbInputRef = useRef(null);
    const maxThumbInputRef = useRef(null);
    return (_jsx(SliderBase, { ref: ref, ...otherProps, children: ({ trackRef, inputRef, state }) => {
            return (_jsxs(_Fragment, { children: [_jsx(Gradation, { state: state, ranges: [0, 1], values: gradation }), _jsx(SliderTrack, { state: state, isDisabled: isDisabled, orientation: props.orientation }), _jsx(SliderThumb, { index: 0, "aria-label": INTL_MESSAGES['minimum'], state: state, inputRef: minThumbInputRef, trackRef: trackRef, isDisabled: isDisabled }), _jsx(SliderThumb, { index: 1, "aria-label": INTL_MESSAGES['maximum'], state: state, inputRef: maxThumbInputRef, trackRef: trackRef, isDisabled: isDisabled })] }));
        } }));
}
const _RangeSlider = forwardRef(RangeSlider);
const __RangeSlider = Object.assign(_RangeSlider, {
    cubeInputType: 'Number',
    displayName: 'RangeSlider',
});
export { __RangeSlider as RangeSlider };

        