"use client"; import { renderElement } from "../../utils/use-render.js"; import { useSliderContext } from "./context.js"; import { forwardRef } from "react"; //#region src/ui/slider/slider-value.tsx /** Displays a formatted text representation of the slider value. Renders an `` element. */ const SliderValue = forwardRef(function SliderValue(componentProps, forwardedRef) { const { render, className, style, type = "current", format, ...elementProps } = componentProps; const context = useSliderContext(); const { state, pointerValue, formatValue } = context; const rawValue = type === "pointer" ? pointerValue : state.value; const text = format ? format(rawValue) : formatValue ? formatValue(rawValue, type) : String(Math.round(rawValue)); return renderElement("output", { render, className, style }, { state, stateAttrMap: context.stateAttrMap, ref: forwardedRef, props: [{ "aria-live": "off", children: text }, elementProps] }); }); //#endregion export { SliderValue }; //# sourceMappingURL=slider-value.js.map