Files
NapCatQQ/.pnpm-store/v3/files/49/3280263623b4473e8990c30d016c44d8dc31688612fce9663085e1c4efe29870b29f4bc816e35acd9f8ccb1dae3b003647151f7876f77ed88866b2dcea64be
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

68 lines
2.1 KiB
Plaintext

"use client";
import {
slider_thumb_default
} from "./chunk-B5EDLGDE.mjs";
import {
useSlider
} from "./chunk-PN6OXKRL.mjs";
// src/slider.tsx
import { renderFn } from "@heroui/react-utils";
import { forwardRef } from "@heroui/system";
import { jsx, jsxs } from "react/jsx-runtime";
var Slider = forwardRef((props, ref) => {
const {
Component,
state,
label,
steps,
marks,
startContent,
endContent,
getStepProps,
getBaseProps,
renderValue,
renderLabel,
getTrackWrapperProps,
getLabelWrapperProps,
getLabelProps,
getValueProps,
getTrackProps,
getFillerProps,
getThumbProps,
getMarkProps,
getStartContentProps,
getEndContentProps
} = useSlider({ ...props, ref });
return /* @__PURE__ */ jsxs(Component, { ...getBaseProps(), children: [
label && /* @__PURE__ */ jsxs("div", { ...getLabelWrapperProps(), children: [
renderFn({
Component: "label",
props: getLabelProps(),
renderCustom: renderLabel
}),
renderFn({
Component: "output",
props: getValueProps(),
renderCustom: renderValue
})
] }),
/* @__PURE__ */ jsxs("div", { ...getTrackWrapperProps(), children: [
startContent && /* @__PURE__ */ jsx("div", { ...getStartContentProps(), children: startContent }),
/* @__PURE__ */ jsxs("div", { ...getTrackProps(), children: [
/* @__PURE__ */ jsx("div", { ...getFillerProps() }),
Number.isFinite(steps) && Array.from({ length: steps }, (_, index) => /* @__PURE__ */ jsx("div", { ...getStepProps(index) }, index)),
state.values.map((_, index) => /* @__PURE__ */ jsx(slider_thumb_default, { ...getThumbProps(index) }, index)),
(marks == null ? void 0 : marks.length) > 0 && marks.map((mark, index) => /* @__PURE__ */ jsx("div", { ...getMarkProps(mark), children: mark.label }, index))
] }),
endContent && /* @__PURE__ */ jsx("div", { ...getEndContentProps(), children: endContent })
] })
] });
});
Slider.displayName = "HeroUI.Slider";
var slider_default = Slider;
export {
slider_default
};