feat: migrate Slider with native range semantics and strict ESM declarations

This commit is contained in:
maoyingjie
2026-10-23 13:12:26 +08:00
parent b1cb00deba
commit 4da45b109e
40 changed files with 2239 additions and 3 deletions
+24
View File
@@ -0,0 +1,24 @@
import {
type SliderProps,
type SliderThumbProps,
Slider,
SliderTrack,
SliderThumb,
} from "@heroui-vue/components";
const valid: SliderProps = { modelValue: [20, 80], orientation: "vertical" };
const thumb: SliderThumbProps = { name: "max", index: 1, isDisabled: true };
// @ts-expect-error model is numeric
const invalid: SliderProps = { modelValue: "20" };
// @ts-expect-error orientation is constrained
const direction: SliderProps = { orientation: "diagonal" };
void [valid, thumb, invalid, direction, Slider, SliderTrack, SliderThumb];
import { type NumberFieldProps } from "@heroui-vue/components";
const numeric: NumberFieldProps = {
modelValue: null,
validate: (value) => (value === null ? "Required" : true),
};
// @ts-expect-error NumberField public values must remain numeric in NodeNext too
const badNumeric: NumberFieldProps = { modelValue: "12,5" };
// @ts-expect-error index is numeric
const badThumb: SliderThumbProps = { index: "1" };
void [numeric, badNumeric, badThumb];