classix 0.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.
- package/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Alex Nault
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# classix
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install classix
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
TODO
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- Fast
|
|
16
|
+
- Under 1 kB minified & gzipped
|
|
17
|
+
- Typed with TypeScript
|
|
18
|
+
- Fully tested
|
|
19
|
+
- 0 dependencies
|
|
20
|
+
- Follows [semantic versioning](https://semver.org/)
|
|
21
|
+
|
|
22
|
+
## API
|
|
23
|
+
|
|
24
|
+
TODO
|
|
25
|
+
|
|
26
|
+
## Changelog
|
|
27
|
+
|
|
28
|
+
For a list of changes and releases, see the [changelog](https://github.com/alexnault/classix/releases).
|
|
29
|
+
|
|
30
|
+
## Contributing
|
|
31
|
+
|
|
32
|
+
Found a bug, have a question or looking to improve classix? Open an [issue](https://github.com/alexnault/classix/issues/new), start a [discussion](https://github.com/alexnault/classix/discussions/new) or submit a [PR](https://github.com/alexnault/classix/fork)!
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function cx(...args) {
|
|
2
|
+
let str = "", i = 0, arg, val;
|
|
3
|
+
while (i < args.length) {
|
|
4
|
+
if ((arg = args[i++])) {
|
|
5
|
+
if ((val = typeof arg === "string" || typeof arg === "number" ? arg : "")) {
|
|
6
|
+
str && (str += " ");
|
|
7
|
+
str += val;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return str;
|
|
12
|
+
}
|
|
13
|
+
export default cx;
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "classix",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A tiny utility for conditionally joining classNames.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"author": "Alex Nault",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"class",
|
|
10
|
+
"classes",
|
|
11
|
+
"classname",
|
|
12
|
+
"classnames",
|
|
13
|
+
"clsx"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": "https://github.com/alexnault/classix",
|
|
17
|
+
"homepage": "https://github.com/alexnault/classix#readme",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "rm -rf ./dist && tsc",
|
|
20
|
+
"lint": "eslint src/ --max-warnings=0",
|
|
21
|
+
"test": "jest"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/jest": "^28.0.0",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
29
|
+
"@typescript-eslint/parser": "^4.33.0",
|
|
30
|
+
"benchmark": "^2.1.4",
|
|
31
|
+
"classnames": "^2.3.1",
|
|
32
|
+
"clsx": "^1.2.1",
|
|
33
|
+
"conventional-changelog-conventionalcommits": "^4.6.1",
|
|
34
|
+
"eslint": "^7.32.0",
|
|
35
|
+
"eslint-config-prettier": "^8.3.0",
|
|
36
|
+
"jest": "^28.0.0",
|
|
37
|
+
"prettier": "^2.2.1",
|
|
38
|
+
"semantic-release": "^19.0.2",
|
|
39
|
+
"ts-jest": "^28.0.0",
|
|
40
|
+
"typescript": "^4.7.4"
|
|
41
|
+
}
|
|
42
|
+
}
|