@ark-ui/solid
Version:
A collection of unstyled, accessible UI components for Solid, utilizing state machines for seamless interaction.
75 lines (67 loc) • 3 kB
TypeScript
import * as solid_js from 'solid-js';
import { Accessor } from 'solid-js';
import { HTMLProps, PolymorphicProps } from '../factory.js';
import { M as MaybeAccessor } from '../../types-Sr_80hg9.js';
import { R as RenderStrategyProps } from '../../render-strategy-B5MqQP3X.js';
import { a as UsePresenceReturn } from '../../use-presence-DsfHkUSW.js';
import { s as swapAnatomy } from '../../swap.anatomy-BTCTOTbL.js';
import '@zag-js/presence';
import '@zag-js/anatomy';
interface SwapIndicatorBaseProps extends PolymorphicProps<'span'> {
type: 'on' | 'off';
}
interface SwapIndicatorProps extends HTMLProps<'span'>, SwapIndicatorBaseProps {
}
declare const SwapIndicator: (props: SwapIndicatorProps) => solid_js.JSX.Element;
interface UseSwapProps extends RenderStrategyProps {
/**
* Whether the swap is in the "on" state.
* @default false
*/
swap?: boolean;
}
interface IndicatorProps {
type: 'on' | 'off';
}
interface UseSwapReturn {
/**
* Whether the swap is in the "on" state.
*/
swap: boolean;
/**
* The presence instance for the "on" indicator.
*/
onPresence: UsePresenceReturn;
/**
* The presence instance for the "off" indicator.
*/
offPresence: UsePresenceReturn;
/**
* Props for the root element.
*/
getRootProps: () => HTMLProps<'span'>;
/**
* Props for the indicator element.
*/
getIndicatorProps: (props: IndicatorProps) => HTMLProps<'span'>;
}
declare const useSwap: (props?: MaybeAccessor<UseSwapProps>) => Accessor<UseSwapReturn>;
interface SwapRootBaseProps extends UseSwapProps, PolymorphicProps<'span'> {
}
interface SwapRootProps extends HTMLProps<'span'>, SwapRootBaseProps {
}
declare const SwapRoot: (props: SwapRootProps) => solid_js.JSX.Element;
interface SwapRootProviderBaseProps extends PolymorphicProps<'span'> {
value: Accessor<UseSwapReturn>;
}
interface SwapRootProviderProps extends HTMLProps<'span'>, SwapRootProviderBaseProps {
}
declare const SwapRootProvider: (props: SwapRootProviderProps) => solid_js.JSX.Element;
declare const swap_swapAnatomy: typeof swapAnatomy;
declare namespace swap {
export { SwapIndicator as Indicator, type SwapIndicatorBaseProps as IndicatorBaseProps, type SwapIndicatorProps as IndicatorProps, SwapRoot as Root, type SwapRootBaseProps as RootBaseProps, type SwapRootProps as RootProps, SwapRootProvider as RootProvider, type SwapRootProviderBaseProps as RootProviderBaseProps, type SwapRootProviderProps as RootProviderProps, swap_swapAnatomy as swapAnatomy };
}
interface UseSwapContext extends Accessor<UseSwapReturn> {
}
declare const useSwapContext: () => UseSwapContext;
export { swap as Swap, SwapIndicator, type SwapIndicatorBaseProps, type SwapIndicatorProps, SwapRoot, type SwapRootBaseProps, type SwapRootProps, SwapRootProvider, type SwapRootProviderBaseProps, type SwapRootProviderProps, type UseSwapContext, type UseSwapProps, type UseSwapReturn, swapAnatomy, useSwap, useSwapContext };