/** * @fileoverview Core utility functions for the Saasflare design system. * @module @saasflare/ui/lib/utils * * Deliberately NO "use client": these are pure functions, safe in React * Server Components. Client-coupled helpers live in lib/context.ts and * lib/hooks.ts. * * @example * import { cn, composeEventHandlers } from '@saasflare/ui'; */ import { type ClassValue } from 'clsx'; import type * as React from 'react'; /** * Merges class names with Tailwind CSS conflict resolution. * Combines clsx conditional logic with tailwind-merge deduplication. * * @param inputs - Class values (strings, objects, arrays, undefined) * @returns Merged and deduplicated class string * * @example * cn('p-4 bg-red-500', 'bg-blue-500') // → 'p-4 bg-blue-500' * cn('text-sm', isLarge && 'text-lg') // conditional classes * cn('mt-2', className) // safe forwarding */ export declare function cn(...inputs: ClassValue[]): string; /** * Merges multiple refs into a single callback ref. * Essential for components that forward a ref while also needing an internal one. * * @example * const Component = forwardRef((props, ref) => { * const internalRef = useRef(null); * return
; * }); */ export declare function mergeRefs(...refs: (React.Ref | undefined)[]): React.RefCallback; /** * Composes two event handlers, respecting `preventDefault()`. * The internal handler is skipped if the external one calls `preventDefault()`. * * @param external - Consumer-provided handler (runs first) * @param internal - Component-internal handler (skipped if default prevented) * * @example *