tailwind-variants 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +11 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,16 @@ export type * from "./types.d.ts";
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const cx: <T extends CnOptions>(...classes: T) => CnReturn;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Type representing a callable function that can also be coerced to a string.
|
|
26
|
+
* This allows `cn` to work both as a function and directly in template literals.
|
|
27
|
+
*/
|
|
28
|
+
type CnCallable = ((config?: TWMConfig) => CnReturn) & {
|
|
29
|
+
toString(): string;
|
|
30
|
+
valueOf(): CnReturn;
|
|
31
|
+
[Symbol.toPrimitive](hint: "string" | "number" | "default"): string | CnReturn;
|
|
32
|
+
} & string;
|
|
33
|
+
|
|
24
34
|
/**
|
|
25
35
|
* Combines class names and merges conflicting Tailwind CSS classes using `tailwind-merge`.
|
|
26
36
|
* @param classes - Class names to combine (strings, arrays, objects, etc.)
|
|
@@ -39,7 +49,7 @@ export declare const cx: <T extends CnOptions>(...classes: T) => CnReturn;
|
|
|
39
49
|
* // Use: cx('bg-red-500', 'bg-blue-500') // => 'bg-red-500 bg-blue-500'
|
|
40
50
|
* ```
|
|
41
51
|
*/
|
|
42
|
-
export declare const cn: <T extends CnOptions>(...classes: T) =>
|
|
52
|
+
export declare const cn: <T extends CnOptions>(...classes: T) => CnCallable;
|
|
43
53
|
|
|
44
54
|
/**
|
|
45
55
|
* Creates a variant-aware component function with Tailwind CSS classes.
|