cnfast 0.0.2
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/LICENSE +34 -0
- package/README.md +66 -0
- package/bin/cli.js +12 -0
- package/dist/chunk-w6R9maHv.mjs +18 -0
- package/dist/cli.js +15843 -0
- package/dist/index.cjs +3543 -0
- package/dist/index.d.cts +38 -0
- package/dist/index.d.mts +38 -0
- package/dist/index.iife.js +3547 -0
- package/dist/index.mjs +3537 -0
- package/dist/vite.config.cli-only.iife.js +46830 -0
- package/package.json +82 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/clsx.d.ts
|
|
2
|
+
interface ClassDictionary {
|
|
3
|
+
[className: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
type ClassValue = string | number | bigint | boolean | null | undefined | ClassValue[] | ClassDictionary;
|
|
6
|
+
declare const clsx: (...inputs: ClassValue[]) => string;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/lib/tw-join.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
|
|
11
|
+
*
|
|
12
|
+
* Specifically:
|
|
13
|
+
* - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
|
|
14
|
+
* - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
|
|
15
|
+
*
|
|
16
|
+
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
17
|
+
*/
|
|
18
|
+
type ClassNameValue = ClassNameArray | string | null | undefined | 0 | 0n | false;
|
|
19
|
+
type ClassNameArray = readonly ClassNameValue[];
|
|
20
|
+
declare const twJoin: (...classLists: ClassNameValue[]) => string;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/lib/create-tailwind-merge.d.ts
|
|
23
|
+
interface TailwindMerge {
|
|
24
|
+
(...classLists: ClassNameValue[]): string;
|
|
25
|
+
/**
|
|
26
|
+
* Merge an already-joined, space-separated class string, skipping the `twJoin` pass.
|
|
27
|
+
* Used by `cn`, whose `clsx` step already produces a single string.
|
|
28
|
+
*/
|
|
29
|
+
mergeString(classList: string): string;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/lib/tw-merge.d.ts
|
|
33
|
+
declare const twMerge: TailwindMerge;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/index.d.ts
|
|
36
|
+
declare const cn: (...inputs: ClassValue[]) => string;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { type ClassDictionary, type ClassNameValue, type ClassValue, clsx, cn, cn as default, twJoin, twMerge };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/clsx.d.ts
|
|
2
|
+
interface ClassDictionary {
|
|
3
|
+
[className: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
type ClassValue = string | number | bigint | boolean | null | undefined | ClassValue[] | ClassDictionary;
|
|
6
|
+
declare const clsx: (...inputs: ClassValue[]) => string;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/lib/tw-join.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
|
|
11
|
+
*
|
|
12
|
+
* Specifically:
|
|
13
|
+
* - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
|
|
14
|
+
* - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
|
|
15
|
+
*
|
|
16
|
+
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
17
|
+
*/
|
|
18
|
+
type ClassNameValue = ClassNameArray | string | null | undefined | 0 | 0n | false;
|
|
19
|
+
type ClassNameArray = readonly ClassNameValue[];
|
|
20
|
+
declare const twJoin: (...classLists: ClassNameValue[]) => string;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/lib/create-tailwind-merge.d.ts
|
|
23
|
+
interface TailwindMerge {
|
|
24
|
+
(...classLists: ClassNameValue[]): string;
|
|
25
|
+
/**
|
|
26
|
+
* Merge an already-joined, space-separated class string, skipping the `twJoin` pass.
|
|
27
|
+
* Used by `cn`, whose `clsx` step already produces a single string.
|
|
28
|
+
*/
|
|
29
|
+
mergeString(classList: string): string;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/lib/tw-merge.d.ts
|
|
33
|
+
declare const twMerge: TailwindMerge;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/index.d.ts
|
|
36
|
+
declare const cn: (...inputs: ClassValue[]) => string;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { type ClassDictionary, type ClassNameValue, type ClassValue, clsx, cn, cn as default, twJoin, twMerge };
|