lumen-lib 0.0.0-stage → 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.
- package/README.md +23 -2
- package/index.cjs +13 -0
- package/index.d.ts +3 -0
- package/index.js +9 -0
- package/package.json +38 -4
package/README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lumen-lib
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Tiny utility helpers for modern web apps.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install lumen-lib
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { cn } from "lumen-lib";
|
|
15
|
+
|
|
16
|
+
cn("btn", isActive && "btn--active", className);
|
|
17
|
+
// => "btn btn--active my-class"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`cn` joins class names and drops falsy values, so conditional classes stay readable without a ternary soup.
|
|
21
|
+
|
|
22
|
+
## License
|
|
23
|
+
|
|
24
|
+
MIT
|
package/index.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Join class names, ignoring falsy values.
|
|
5
|
+
*
|
|
6
|
+
* @param {...(string | false | null | undefined)} classes
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
9
|
+
function cn(...classes) {
|
|
10
|
+
return classes.filter(Boolean).join(" ");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = { cn };
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lumen-lib",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Tiny utility helpers for modern web apps.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"import": "./index.js",
|
|
12
|
+
"require": "./index.cjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"index.cjs",
|
|
18
|
+
"index.d.ts"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"utility",
|
|
22
|
+
"classname",
|
|
23
|
+
"cn",
|
|
24
|
+
"helpers"
|
|
25
|
+
],
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/lumen-lib/lumen-lib.git"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/lumen-lib/lumen-lib#readme",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"type": "email",
|
|
34
|
+
"email": "hi@lumen-lib.dev"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=14"
|
|
38
|
+
},
|
|
39
|
+
"sideEffects": false
|
|
40
|
+
}
|