UNPKG

@ark-ui/vue

Version:

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

20 lines (19 loc) 858 B
import { PropTypes } from '@zag-js/vue'; import { ComputedRef, MaybeRef } from 'vue'; import { EmitFn, Optional } from '../../types'; import { CollectionItem, ListCollection } from '../collection'; import { RootEmits } from './select'; import * as select from '@zag-js/select'; export interface UseSelectProps<T extends CollectionItem> extends Optional<Omit<select.Props<T>, 'dir' | 'getRootNode' | 'collection'>, 'id'> { /** * The model value of the select */ modelValue?: select.Props<T>['value']; /** * The collection of items */ collection: ListCollection<T>; } export interface UseSelectReturn<T extends CollectionItem> extends ComputedRef<select.Api<PropTypes, T>> { } export declare const useSelect: <T extends CollectionItem>(props: MaybeRef<UseSelectProps<T>>, emit?: EmitFn<RootEmits<T>>) => UseSelectReturn<T>;