2026-07-26 15:13:18 +07:00
|
|
|
import { type ClassValue, clsx } from "clsx";
|
|
|
|
|
import { twMerge } from "tailwind-merge";
|
2026-07-26 11:27:21 +07:00
|
|
|
|
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
2026-07-26 15:13:18 +07:00
|
|
|
return twMerge(clsx(inputs));
|
2026-07-26 11:27:21 +07:00
|
|
|
}
|
2026-08-18 11:01:00 +07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns an inline style that staggers a list item's entrance animation.
|
|
|
|
|
* Pair with the `animate-stagger` class. Caps the delay so long lists still
|
|
|
|
|
* appear promptly.
|
|
|
|
|
*/
|
|
|
|
|
export function staggerDelay(
|
|
|
|
|
index: number,
|
|
|
|
|
step = 45,
|
|
|
|
|
max = 600,
|
|
|
|
|
): React.CSSProperties {
|
|
|
|
|
return { animationDelay: `${Math.min(index * step, max)}ms` };
|
|
|
|
|
}
|