mirror of
https://github.com/zoriya/v10.git
synced 2026-08-10 08:08:10 +00:00
20 lines
584 B
JavaScript
20 lines
584 B
JavaScript
"use client";
|
|
import { createContext, useContext } from "react";
|
|
import { jsx } from "react/jsx-runtime";
|
|
//#region src/ui/slider/context.tsx
|
|
const SliderContext = createContext(null);
|
|
function SliderProvider({ value, children }) {
|
|
return /* @__PURE__ */ jsx(SliderContext.Provider, {
|
|
value,
|
|
children
|
|
});
|
|
}
|
|
function useSliderContext() {
|
|
const ctx = useContext(SliderContext);
|
|
if (!ctx) throw new Error("Slider compound components must be used within a Slider.Root");
|
|
return ctx;
|
|
}
|
|
//#endregion
|
|
export { SliderProvider, useSliderContext };
|
|
|
|
//# sourceMappingURL=context.js.map
|