UNPKG

@ark-ui/vue

Version:

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

33 lines (30 loc) 1.49 kB
import { defineComponent, useSlots, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString } from 'vue'; import { useLocaleContext, DEFAULT_LOCALE } from '../../providers/locale/use-locale-context.js'; import { ark } from '../factory.js'; import { useColorPickerChannelPropsContext } from './use-color-picker-channel-props-context.js'; import { useColorPickerContext } from './use-color-picker-context.js'; import { useForwardExpose } from '../../utils/use-forward-expose.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "color-picker-channel-slider-value-text", props: { asChild: { type: Boolean } }, setup(__props) { const colorPicker = useColorPickerContext(); const channelProps = useColorPickerChannelPropsContext(); const slots = useSlots(); const localeContext = useLocaleContext(DEFAULT_LOCALE); useForwardExpose(); return (_ctx, _cache) => { return openBlock(), createBlock(unref(ark).span, mergeProps(unref(colorPicker).getChannelSliderValueTextProps(unref(channelProps)), { "as-child": _ctx.asChild }), { default: withCtx(() => [ renderSlot(_ctx.$slots, "default", {}, () => [ createTextVNode(toDisplayString(slots.default?.() || unref(colorPicker).getChannelValueText(unref(channelProps).channel, unref(localeContext).locale)), 1) ]) ]), _: 3 }, 16, ["as-child"]); }; } }); export { _sfc_main as default };