tailwind-merge 1.12.0 → 1.13.0
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/README.md +13 -16
- package/dist/index.d.ts +14 -14
- package/dist/lib/class-utils.d.ts +19 -19
- package/dist/lib/class-utils.mjs +2 -2
- package/dist/lib/config-utils.d.ts +13 -12
- package/dist/lib/create-tailwind-merge.d.ts +7 -7
- package/dist/lib/default-config.d.ts +1952 -1952
- package/dist/lib/default-config.mjs +820 -820
- package/dist/lib/default-config.mjs.map +1 -1
- package/dist/lib/extend-tailwind-merge.d.ts +4 -4
- package/dist/lib/from-theme.d.ts +2 -2
- package/dist/lib/lru-cache.d.ts +5 -5
- package/dist/lib/merge-classlist.d.ts +2 -2
- package/dist/lib/merge-classlist.mjs +6 -6
- package/dist/lib/merge-configs.d.ts +6 -6
- package/dist/lib/merge-configs.mjs +3 -3
- package/dist/lib/modifier-utils.d.ts +14 -14
- package/dist/lib/modifier-utils.mjs +4 -4
- package/dist/lib/tw-join.d.ts +13 -13
- package/dist/lib/tw-join.mjs +8 -8
- package/dist/lib/tw-merge.d.ts +1 -1
- package/dist/lib/types.d.ts +58 -58
- package/dist/lib/validators.d.ts +17 -17
- package/dist/lib/validators.mjs +3 -3
- package/dist/lib/validators.mjs.map +1 -1
- package/dist/tailwind-merge.cjs.development.js +856 -856
- package/dist/tailwind-merge.cjs.development.js.map +1 -1
- package/dist/tailwind-merge.cjs.production.min.js +1 -1
- package/dist/tailwind-merge.cjs.production.min.js.map +1 -1
- package/dist/tailwind-merge.mjs +3 -4
- package/dist/tailwind-merge.mjs.map +1 -1
- package/package.json +15 -13
- package/src/lib/default-config.ts +1 -1
- package/src/lib/validators.ts +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
<!-- This file is autogenerated. If you want to change this content, please do the changes in `./docs/README.md` instead. -->
|
|
2
|
+
|
|
1
3
|
<div align="center">
|
|
2
4
|
<br />
|
|
3
5
|
<a href="https://github.com/dcastil/tailwind-merge">
|
|
4
|
-
|
|
5
|
-
<img src="https://github.com/dcastil/tailwind-merge/raw/v1.12.0/assets/logo.svg" alt="tailwind-merge" height="150px" />
|
|
6
|
-
<!-- AUTOGENERATED END -->
|
|
6
|
+
<img src="https://github.com/dcastil/tailwind-merge/raw/v1.13.0/assets/logo.svg" alt="tailwind-merge" height="150px" />
|
|
7
7
|
</a>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
@@ -25,16 +25,13 @@ twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')
|
|
|
25
25
|
|
|
26
26
|
## Get started
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [Similar packages](https://github.com/dcastil/tailwind-merge/tree/v1.12.0/docs/similar-packages.md)
|
|
39
|
-
|
|
40
|
-
<!-- AUTOGENERATED END -->
|
|
28
|
+
- [What is it for](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/what-is-it-for.md)
|
|
29
|
+
- [When and how to use it](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/when-and-how-to-use-it.md)
|
|
30
|
+
- [Features](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/features.md)
|
|
31
|
+
- [Configuration](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/configuration.md)
|
|
32
|
+
- [Recipes](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/recipes.md)
|
|
33
|
+
- [API reference](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/api-reference.md)
|
|
34
|
+
- [Writing plugins](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/writing-plugins.md)
|
|
35
|
+
- [Versioning](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/versioning.md)
|
|
36
|
+
- [Contributing](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/contributing.md)
|
|
37
|
+
- [Similar packages](https://github.com/dcastil/tailwind-merge/tree/v1.13.0/docs/similar-packages.md)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { twJoin } from './lib/tw-join';
|
|
2
|
-
export { twMerge } from './lib/tw-merge';
|
|
3
|
-
export { twJoin } from './lib/tw-join';
|
|
4
|
-
export { getDefaultConfig } from './lib/default-config';
|
|
5
|
-
export { extendTailwindMerge } from './lib/extend-tailwind-merge';
|
|
6
|
-
export { createTailwindMerge } from './lib/create-tailwind-merge';
|
|
7
|
-
export type { Config } from './lib/types';
|
|
8
|
-
export * as validators from './lib/validators';
|
|
9
|
-
export { mergeConfigs } from './lib/merge-configs';
|
|
10
|
-
export { fromTheme } from './lib/from-theme';
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Will be removed in next major version. Use `twJoin` instead.
|
|
13
|
-
*/
|
|
14
|
-
export declare const join: typeof twJoin;
|
|
1
|
+
import { twJoin } from './lib/tw-join';
|
|
2
|
+
export { twMerge } from './lib/tw-merge';
|
|
3
|
+
export { twJoin } from './lib/tw-join';
|
|
4
|
+
export { getDefaultConfig } from './lib/default-config';
|
|
5
|
+
export { extendTailwindMerge } from './lib/extend-tailwind-merge';
|
|
6
|
+
export { createTailwindMerge } from './lib/create-tailwind-merge';
|
|
7
|
+
export type { Config } from './lib/types';
|
|
8
|
+
export * as validators from './lib/validators';
|
|
9
|
+
export { mergeConfigs } from './lib/merge-configs';
|
|
10
|
+
export { fromTheme } from './lib/from-theme';
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Will be removed in next major version. Use `twJoin` instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare const join: typeof twJoin;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ClassGroupId, ClassValidator, Config } from './types';
|
|
2
|
-
export interface ClassPartObject {
|
|
3
|
-
nextPart: Map<string, ClassPartObject>;
|
|
4
|
-
validators: ClassValidatorObject[];
|
|
5
|
-
classGroupId?: ClassGroupId;
|
|
6
|
-
}
|
|
7
|
-
interface ClassValidatorObject {
|
|
8
|
-
classGroupId: ClassGroupId;
|
|
9
|
-
validator: ClassValidator;
|
|
10
|
-
}
|
|
11
|
-
export declare function createClassUtils(config: Config): {
|
|
12
|
-
getClassGroupId: (className: string) => string | undefined;
|
|
13
|
-
getConflictingClassGroupIds: (classGroupId: ClassGroupId, hasPostfixModifier: boolean) => readonly string[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Exported for testing only
|
|
17
|
-
*/
|
|
18
|
-
export declare function createClassMap(config: Config): ClassPartObject;
|
|
19
|
-
export {};
|
|
1
|
+
import { ClassGroupId, ClassValidator, Config } from './types';
|
|
2
|
+
export interface ClassPartObject {
|
|
3
|
+
nextPart: Map<string, ClassPartObject>;
|
|
4
|
+
validators: ClassValidatorObject[];
|
|
5
|
+
classGroupId?: ClassGroupId;
|
|
6
|
+
}
|
|
7
|
+
interface ClassValidatorObject {
|
|
8
|
+
classGroupId: ClassGroupId;
|
|
9
|
+
validator: ClassValidator;
|
|
10
|
+
}
|
|
11
|
+
export declare function createClassUtils(config: Config): {
|
|
12
|
+
getClassGroupId: (className: string) => string | undefined;
|
|
13
|
+
getConflictingClassGroupIds: (classGroupId: ClassGroupId, hasPostfixModifier: boolean) => readonly string[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Exported for testing only
|
|
17
|
+
*/
|
|
18
|
+
export declare function createClassMap(config: Config): ClassPartObject;
|
|
19
|
+
export {};
|
package/dist/lib/class-utils.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Config } from './types';
|
|
2
|
-
export type ConfigUtils = ReturnType<typeof createConfigUtils>;
|
|
3
|
-
export declare function createConfigUtils(config: Config): {
|
|
4
|
-
getClassGroupId: (className: string) => string | undefined;
|
|
5
|
-
getConflictingClassGroupIds: (classGroupId: string) => readonly string[];
|
|
6
|
-
cache: import("./lru-cache").LruCache<string, string>;
|
|
7
|
-
splitModifiers: (className: string) => {
|
|
8
|
-
modifiers: string[];
|
|
9
|
-
hasImportantModifier: boolean;
|
|
10
|
-
baseClassName: string;
|
|
11
|
-
|
|
12
|
-
};
|
|
1
|
+
import { Config } from './types';
|
|
2
|
+
export type ConfigUtils = ReturnType<typeof createConfigUtils>;
|
|
3
|
+
export declare function createConfigUtils(config: Config): {
|
|
4
|
+
getClassGroupId: (className: string) => string | undefined;
|
|
5
|
+
getConflictingClassGroupIds: (classGroupId: string, hasPostfixModifier: boolean) => readonly string[];
|
|
6
|
+
cache: import("./lru-cache").LruCache<string, string>;
|
|
7
|
+
splitModifiers: (className: string) => {
|
|
8
|
+
modifiers: string[];
|
|
9
|
+
hasImportantModifier: boolean;
|
|
10
|
+
baseClassName: string;
|
|
11
|
+
maybePostfixModifierPosition: number | undefined;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ClassNameValue } from './tw-join';
|
|
2
|
-
import { Config } from './types';
|
|
3
|
-
type CreateConfigFirst = () => Config;
|
|
4
|
-
type CreateConfigSubsequent = (config: Config) => Config;
|
|
5
|
-
type TailwindMerge = (...classLists: ClassNameValue[]) => string;
|
|
6
|
-
export declare function createTailwindMerge(...createConfig: [CreateConfigFirst, ...CreateConfigSubsequent[]]): TailwindMerge;
|
|
7
|
-
export {};
|
|
1
|
+
import { ClassNameValue } from './tw-join';
|
|
2
|
+
import { Config } from './types';
|
|
3
|
+
type CreateConfigFirst = () => Config;
|
|
4
|
+
type CreateConfigSubsequent = (config: Config) => Config;
|
|
5
|
+
type TailwindMerge = (...classLists: ClassNameValue[]) => string;
|
|
6
|
+
export declare function createTailwindMerge(...createConfig: [CreateConfigFirst, ...CreateConfigSubsequent[]]): TailwindMerge;
|
|
7
|
+
export {};
|