/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e634e55 | Cube Dev Team */
import { SliderGradationElement, SliderGradeElement } from "./elements.js";
import { jsx } from "react/jsx-runtime";

//#region src/components/fields/Slider/Gradation.tsx
function Gradation(props) {
	const { state, ranges, values = [] } = props;
	if (!values.length) return null;
	const getIsActive = (value, idx) => {
		const [minIdx, maxIdx] = ranges.map((range) => state.getThumbValue(range));
		return idx >= minIdx && idx <= maxIdx;
	};
	return /* @__PURE__ */ jsx(SliderGradationElement, { children: values.map((value, idx) => /* @__PURE__ */ jsx(SliderGradeElement, {
		mods: { active: getIsActive(value, idx) },
		children: value
	}, value)) });
}

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