classix 0.0.2 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +31 -6
  2. package/package.json +13 -9
package/README.md CHANGED
@@ -8,7 +8,36 @@ npm install classix
8
8
 
9
9
  ## Usage
10
10
 
11
- TODO
11
+ ```js
12
+ import cx from "classix";
13
+ // or
14
+ import { cx } from "classix";
15
+
16
+ cx("class1", "class2");
17
+ // => "class1 class2"
18
+
19
+ cx("class1 class2", "class3", "class4 class5");
20
+ // => "class1 class2 class3 class4 class5"
21
+
22
+ cx("class1", true && "class2");
23
+ // => "class1 class2"
24
+
25
+ cx(false && "class1", "class2");
26
+ // => "class2"
27
+
28
+ cx(true ? "class1" : "class2");
29
+ // => "class1"
30
+
31
+ cx("class1", false ? "class2" : "class3");
32
+ // => "class1 class3"
33
+
34
+ cx(
35
+ "flex",
36
+ isPrimary ? "bg-primary-100" : "bg-secondary-100",
37
+ isLarge ? "m-4 p-4" : "m-2 py-2"
38
+ );
39
+ // => "flex bg-primary-100 m-2 p-2" *assuming isPrimary is true and isLarge is false
40
+ ```
12
41
 
13
42
  ## Highlights
14
43
 
@@ -16,13 +45,9 @@ TODO
16
45
  - Under 1 kB minified & gzipped
17
46
  - Typed with TypeScript
18
47
  - Fully tested
19
- - 0 dependencies
48
+ - Zero dependencies
20
49
  - Follows [semantic versioning](https://semver.org/)
21
50
 
22
- ## API
23
-
24
- TODO
25
-
26
51
  ## Changelog
27
52
 
28
53
  For a list of changes and releases, see the [changelog](https://github.com/alexnault/classix/releases).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "classix",
3
- "version": "0.0.2",
3
+ "version": "1.0.0",
4
4
  "description": "A tiny utility for conditionally joining classNames.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,13 +10,17 @@
10
10
  "classes",
11
11
  "classname",
12
12
  "classnames",
13
- "clsx"
13
+ "clsx",
14
+ "tailwind",
15
+ "css"
14
16
  ],
15
17
  "license": "MIT",
16
18
  "repository": "https://github.com/alexnault/classix",
17
19
  "homepage": "https://github.com/alexnault/classix#readme",
18
20
  "scripts": {
21
+ "bench": "node benchmark",
19
22
  "build": "rm -rf ./dist && tsc",
23
+ "format": "prettier --write \"{src,benchmark}/**/*.{js,ts}\"",
20
24
  "lint": "eslint src/ --max-warnings=0",
21
25
  "test": "jest"
22
26
  },
@@ -25,17 +29,17 @@
25
29
  ],
26
30
  "devDependencies": {
27
31
  "@types/jest": "^28.0.0",
28
- "@typescript-eslint/eslint-plugin": "^4.33.0",
29
- "@typescript-eslint/parser": "^4.33.0",
32
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
33
+ "@typescript-eslint/parser": "^5.30.5",
30
34
  "benchmark": "^2.1.4",
31
35
  "classnames": "^2.3.1",
32
36
  "clsx": "^1.2.1",
33
- "conventional-changelog-conventionalcommits": "^4.6.1",
34
- "eslint": "^7.32.0",
35
- "eslint-config-prettier": "^8.3.0",
37
+ "conventional-changelog-conventionalcommits": "^4.6.3",
38
+ "eslint": "^8.19.0",
39
+ "eslint-config-prettier": "^8.5.0",
36
40
  "jest": "^28.0.0",
37
- "prettier": "^2.2.1",
38
- "semantic-release": "^19.0.2",
41
+ "prettier": "^2.7.1",
42
+ "semantic-release": "^19.0.3",
39
43
  "ts-jest": "^28.0.0",
40
44
  "typescript": "^4.7.4"
41
45
  }