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

import { jsx as _jsx } from "react/jsx-runtime";
import { useMemo } from 'react';
import { SliderTrackContainerElement } from './elements.js';
export function SliderTrack(props) {
    const { isDisabled, state, orientation = 'horizontal' } = props;
    const selectedTrack = [state.getThumbPercent(0), state.getThumbPercent(1)];
    const showRangeTrack = !Number.isNaN(selectedTrack[1]);
    const mods = useMemo(() => ({
        disabled: isDisabled,
        horizontal: orientation === 'horizontal',
        range: showRangeTrack,
    }), [isDisabled, showRangeTrack]);
    return (_jsx(SliderTrackContainerElement, { mods: mods, style: showRangeTrack
            ? {
                '--slider-range-start': `${selectedTrack[0] * 100}%`,
                '--slider-range-end': `${selectedTrack[1] * 100}%`,
            }
            : {
                '--slider-value': `${selectedTrack[0] * 100}%`,
            } }));
}

        