@dvcol/neo-svelte
Version:
Neomorphic ui library for svelte 5
49 lines (48 loc) • 1.91 kB
TypeScript
import type { NeoTooltipProps } from './neo-tooltip.model.js';
import type { NeoInputProps } from '../../inputs/common/neo-input.model.js';
import type { NeoListSearchProps } from '../../list/neo-list-search.model.js';
import type { NeoListItemOrSection, NeoListProps } from '../../list/neo-list.model.js';
export type NeoPopSelectProps<Value = unknown> = {
/**
* Element(s) to render inside the trigger.
*/
children?: NeoTooltipProps['children'];
/**
* Whether to show the search input.
*/
search?: boolean;
/**
* List items to select from.
*/
items?: (string | number | NeoListItemOrSection)[];
/**
* We use the list's search is focused.
*
* @see search
*/
focused?: NeoInputProps['focused'];
/**
* Optional ref to the list.
*/
listRef?: NeoListProps<Value>['ref'];
/**
* Optional props to pass to the search input.
*/
searchProps?: NeoListSearchProps;
/**
* Event listener that fires when an item is selected/deselected.
*/
onSelect?: NeoListProps<Value>['onSelect'];
/**
* Event listener that fires when an item is selected/deselected.
*/
onChange?: (current: Value, previous: Value) => void;
/**
* Optional ref to the tooltip.
*/
tooltipRef?: NeoTooltipProps['ref'];
/**
* Optional props to pass to the tooltip.
*/
tooltipProps?: Omit<NeoTooltipProps, 'ref' | 'triggerRef' | 'open' | 'children'>;
} & Pick<NeoTooltipProps, 'triggerRef' | 'open' | 'position' | 'target' | 'openDelay' | 'hoverDelay' | 'openOnFocus' | 'openOnHover' | 'openOnClick' | 'color' | 'filled' | 'tinted' | 'rounded' | 'elevation' | 'flex' | 'align' | 'justify' | 'width' | 'height' | 'padding' | 'in' | 'out' | 'transition' | 'use' | 'onOpen' | 'onClose'> & Omit<NeoListProps<Value>, 'ref' | 'children' | 'width' | 'height' | 'items'>;