From a4232532bd9f57ae8bfde10691955faf9461eeb1 Mon Sep 17 00:00:00 2001 From: SameerJS6 Date: Fri, 26 Sep 2025 08:57:56 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Enhance=20utility=20types=20in=20cn?= =?UTF-8?q?.ts=20for=20improved=20type=20safety=20and=20flexibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/cn.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/utils/cn.ts b/src/utils/cn.ts index a5ef193..cf65760 100644 --- a/src/utils/cn.ts +++ b/src/utils/cn.ts @@ -1,6 +1,17 @@ -import { clsx, type ClassValue } from "clsx"; +import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; - + export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); + return twMerge(clsx(inputs)); } + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type WithoutChild = T extends { child?: any } ? Omit : T; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type WithoutChildren = T extends { children?: any } + ? Omit + : T; +export type WithoutChildrenOrChild = WithoutChildren>; +export type WithElementRef = T & { + ref?: U | null; +}; \ No newline at end of file