@toptal/picasso-tailwind-merge 1.0.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.
@@ -0,0 +1,2 @@
1
+ export * from './twMerge';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './twMerge';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { twJoin } from 'tailwind-merge';
2
+ export declare const twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
3
+ export { twJoin };
4
+ //# sourceMappingURL=twMerge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"twMerge.d.ts","sourceRoot":"","sources":["../../src/twMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAG5D,eAAO,MAAM,OAAO,sEASlB,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { extendTailwindMerge, twJoin } from 'tailwind-merge';
2
+ import { theme } from '@toptal/picasso-tailwind';
3
+ export const twMerge = extendTailwindMerge({
4
+ extend: {
5
+ classGroups: {
6
+ 'font-size': [
7
+ ...Object.keys(theme.fontSize).map(key => `text-${key}`),
8
+ 'font-inherit-size',
9
+ ],
10
+ },
11
+ },
12
+ });
13
+ export { twJoin };
14
+ //# sourceMappingURL=twMerge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"twMerge.js","sourceRoot":"","sources":["../../src/twMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAEhD,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC;IACzC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,WAAW,EAAE;gBACX,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC;gBACxD,mBAAmB;aACpB;SACF;KACF;CACF,CAAC,CAAA;AAEF,OAAO,EAAE,MAAM,EAAE,CAAA"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@toptal/picasso-tailwind-merge",
3
+ "version": "1.0.1",
4
+ "description": "Tailwind merge configured for Picasso theme",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "main": "./dist-package/src/index.js",
9
+ "module": "./dist-package/src/index.js",
10
+ "scripts": {
11
+ "build:package": "tsc -b tsconfig.json",
12
+ "prepublishOnly": "yarn build:package"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/toptal/picasso.git"
17
+ },
18
+ "author": "Toptal",
19
+ "license": "MIT",
20
+ "bugs": {
21
+ "url": "https://github.com/toptal/picasso/issues"
22
+ },
23
+ "homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso#readme",
24
+ "dependencies": {
25
+ "@toptal/picasso-utils": "1.0.3",
26
+ "tailwind-merge": "^2.2.2",
27
+ "react-transition-group": "^4.4.5"
28
+ },
29
+ "sideEffects": false,
30
+ "peerDependencies": {
31
+ "@toptal/picasso-tailwind": ">=2.5.1",
32
+ "react": ">=16.12.0 < 19.0.0"
33
+ },
34
+ "exports": {
35
+ ".": "./dist-package/src/index.js"
36
+ },
37
+ "devDependencies": {
38
+ "@toptal/picasso-test-utils": "1.1.1"
39
+ },
40
+ "files": [
41
+ "dist-package/**",
42
+ "!dist-package/tsconfig.tsbuildinfo",
43
+ "src"
44
+ ]
45
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './twMerge'
package/src/test.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { twMerge } from './twMerge'
2
+
3
+ describe('twMerge', () => {
4
+ it('merges font size classes correctly', () => {
5
+ expect(twMerge('font-inherit-size text-button-large text-2xs')).toBe(
6
+ 'text-2xs'
7
+ )
8
+ })
9
+ })
package/src/twMerge.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { extendTailwindMerge, twJoin } from 'tailwind-merge'
2
+ import { theme } from '@toptal/picasso-tailwind'
3
+
4
+ export const twMerge = extendTailwindMerge({
5
+ extend: {
6
+ classGroups: {
7
+ 'font-size': [
8
+ ...Object.keys(theme.fontSize).map(key => `text-${key}`),
9
+ 'font-inherit-size',
10
+ ],
11
+ },
12
+ },
13
+ })
14
+
15
+ export { twJoin }