/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-1fc5ad1 | Cube Dev Team */
import { Gradation } from "./Gradation.js";
import { _SliderBase } from "./SliderBase.js";
import { SliderThumb } from "./SliderThumb.js";
import { SliderTrack } from "./SliderTrack.js";
import { forwardRef, useRef } from "react";
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";

//#region src/components/fields/Slider/RangeSlider.tsx
const INTL_MESSAGES = {
	minimum: "Minimum",
	maximum: "Maximum"
};
function RangeSlider(props, ref) {
	let { isDisabled, styles, gradation, ...otherProps } = props;
	const minThumbInputRef = useRef(null);
	const maxThumbInputRef = useRef(null);
	return /* @__PURE__ */ jsx(_SliderBase, {
		ref,
		...otherProps,
		children: ({ trackRef, inputRef, state }) => {
			return /* @__PURE__ */ jsxs(Fragment$1, { children: [
				/* @__PURE__ */ jsx(Gradation, {
					state,
					ranges: [0, 1],
					values: gradation
				}),
				/* @__PURE__ */ jsx(SliderTrack, {
					state,
					isDisabled,
					orientation: props.orientation
				}),
				/* @__PURE__ */ jsx(SliderThumb, {
					index: 0,
					"aria-label": INTL_MESSAGES["minimum"],
					state,
					inputRef: minThumbInputRef,
					trackRef,
					isDisabled
				}),
				/* @__PURE__ */ jsx(SliderThumb, {
					index: 1,
					"aria-label": INTL_MESSAGES["maximum"],
					state,
					inputRef: maxThumbInputRef,
					trackRef,
					isDisabled
				})
			] });
		}
	});
}
const _RangeSlider = forwardRef(RangeSlider);
const __RangeSlider = Object.assign(_RangeSlider, {
	cubeInputType: "Number",
	displayName: "RangeSlider"
});

//#endregion
export { __RangeSlider };
//# sourceMappingURL=RangeSlider.js.map