UNPKG

@ark-ui/vue

Version:

A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.

57 lines (54 loc) 1.65 kB
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue'; import { ark } from '../factory.js'; import { useSlider } from './use-slider.js'; import { SliderProvider } from './use-slider-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "slider-root", props: /* @__PURE__ */ mergeDefaults({ "aria-label": {}, "aria-labelledby": {}, defaultValue: {}, dir: {}, disabled: { type: Boolean }, form: {}, getAriaValueText: { type: Function }, getRootNode: { type: Function }, id: {}, ids: {}, invalid: { type: Boolean }, max: {}, min: {}, minStepsBetweenThumbs: {}, modelValue: {}, name: {}, orientation: {}, origin: {}, readOnly: { type: Boolean }, step: {}, thumbAlignment: {}, thumbSize: {}, asChild: { type: Boolean } }, { disabled: void 0, invalid: void 0, readOnly: void 0 }), emits: ["focusChange", "valueChange", "valueChangeEnd", "update:modelValue"], setup(__props, { emit: __emit }) { const props = __props; const emits = __emit; const slider = useSlider(props, emits); SliderProvider(slider); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).div, mergeProps(unref(slider).getRootProps(), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default") ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };