@dvcol/neo-svelte
Version:
Neomorphic ui library for svelte 5
50 lines (49 loc) • 2.22 kB
TypeScript
import type { Snippet } from 'svelte';
import type { NeoFloatingStepperProps } from '../common/neo-floating-stepper.model.js';
import type { NeoTooltipContext, NeoTooltipProps, NeoTooltipToggle } from './neo-tooltip.model.js';
import type { NeoStepperContext } from '../../stepper/neo-stepper.model.js';
export type NeoPopStepperProps = {
/**
* Element(s) to render inside the trigger.
*/
children?: NeoTooltipProps['children'];
/**
* Element(s) to render inside the tooltip once open.
*/
tooltip?: Snippet<[NeoTooltipContext, NeoTooltipToggle, NeoStepperContext]>;
/**
* Element(s) to render inside the header once open.
*/
header?: string | Snippet<[NeoTooltipContext, NeoTooltipToggle, NeoStepperContext]>;
/**
* Optional ref to the tooltip.
*/
tooltipRef?: NeoTooltipProps['ref'];
/**
* Optional ref to the trigger element.
*/
triggerRef?: NeoTooltipProps['triggerRef'];
/**
* Whether the tooltip can be dismissed and a close button shown.
*
* @default true
*/
closable?: NeoTooltipProps['closeOnDismiss'];
/**
* Event Handlers that fires on cancel.
* If a promise is returned, the loading state will be set to true until the promise resolves.
* If the function rejects, the tooltip will not close.
*/
onCancel?: NeoFloatingStepperProps['onBeforeStep'];
/**
* Event Handlers that fires on confirm.
* If a promise is returned, the loading state will be set to true until the promise resolves.
* If the promise rejects, the tooltip will not close.
* @param e
*/
onConfirm?: NeoFloatingStepperProps['onBeforeStep'];
/**
* 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' | 'elevation' | 'flex' | 'align' | 'justify' | 'width' | 'height' | 'padding' | 'in' | 'out' | 'transition' | 'use' | 'onOpen' | 'onClose'> & Omit<NeoFloatingStepperProps, 'header' | 'children'>;