UNPKG

@ark-ui/vue

Version:

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

27 lines (24 loc) 751 B
import { defineComponent, computed, toDisplayString } from 'vue'; import { formatBytes } from '@zag-js/i18n-utils'; import { useLocaleContext, DEFAULT_LOCALE } from '../../providers/locale/use-locale-context.js'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "format-byte", props: { unit: {}, unitDisplay: {}, unitSystem: {}, value: {} }, setup(__props) { const props = __props; const locale = useLocaleContext(DEFAULT_LOCALE); const text = computed(() => { const { value, ...otherProps } = props; return formatBytes(value, locale.value.locale, otherProps); }); return (_ctx, _cache) => { return toDisplayString(text.value); }; } }); export { _sfc_main as default };