UNPKG

@ark-ui/vue

Version:

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

16 lines (13 loc) 467 B
import { createCollator } from '@zag-js/i18n-utils'; import { computed, toValue } from 'vue'; import { useLocaleContext } from './use-locale-context.js'; function useCollator(propsOrFn = {}) { const env = useLocaleContext(); return computed(() => { const props = toValue(propsOrFn); const locale = props.locale ?? env.value.locale; const { locale: _, ...options } = props; return createCollator(locale, options); }); } export { useCollator };