import { ComputedRef, MaybeRefOrGetter, Ref } from '../../node_modules/vue'; import { IconSize, TextColorVariant } from '../types'; /** * Reactive options for {@link useAppIcon}. They mirror the `AppIcon` component * props that drive its color, sizing and hover state. */ export interface UseAppIconOptions { /** * Requested icon size: a preset key, a raw CSS value or a percentage. */ size: MaybeRefOrGetter; /** * Scale factor applied to the icon size through a CSS custom property. */ scale: MaybeRefOrGetter; /** * Bootstrap color variant for the icon. */ variant: MaybeRefOrGetter; /** * Bootstrap color variant applied while hovered. */ hoverVariant: MaybeRefOrGetter; /** * Forces the icon into its hover state when true. */ hover: MaybeRefOrGetter; /** * Duration of the spin animation. */ spinDuration: MaybeRefOrGetter; /** * Duration of the beat animation. */ beatDuration: MaybeRefOrGetter; /** * Duration of the fade animation. */ fadeDuration: MaybeRefOrGetter; /** * Enable spinning animation. */ spin: MaybeRefOrGetter; /** * Reverse the direction of the spin animation. */ spinReverse: MaybeRefOrGetter; /** * Enable pulsing beat animation. */ beat: MaybeRefOrGetter; /** * Enable fade in/out animation. */ fade: MaybeRefOrGetter; } /** * Reactive API returned by {@link useAppIcon}. */ export interface UseAppIcon { currentHover: Ref; color: ComputedRef; isPercentSize: ComputedRef; isRawSize: ComputedRef; hasSize: ComputedRef; style: ComputedRef>; classList: ComputedRef>; } /** * Derives the inline style and class list for the `AppIcon` component: tracks * the hover state (driven by both the `hover` prop and mouse events), * classifies the requested size (preset / raw CSS / percentage) and resolves * the active color variant. * * Internal building block for `AppIcon`; not exported from `@icij/murmur-next`. * * @param options - Reactive icon options (see {@link UseAppIconOptions}). * @returns The {@link UseAppIcon} API: the mutable `currentHover` flag plus the * `style` and `classList` bindings (and the size predicates they rely on). * @example * import { toRef } from 'vue' * import { useAppIcon } from '@/composables/useAppIcon' * * const { currentHover, style, classList } = useAppIcon({ * size: toRef(props, 'size'), * scale: toRef(props, 'scale'), * variant: toRef(props, 'variant'), * hoverVariant: toRef(props, 'hoverVariant'), * hover: toRef(props, 'hover'), * spinDuration: toRef(props, 'spinDuration'), * beatDuration: toRef(props, 'beatDuration'), * fadeDuration: toRef(props, 'fadeDuration'), * spin: toRef(props, 'spin'), * spinReverse: toRef(props, 'spinReverse'), * beat: toRef(props, 'beat'), * fade: toRef(props, 'fade') * }) */ export declare function useAppIcon(options: UseAppIconOptions): UseAppIcon; export default useAppIcon;