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 CHANGED
@@ -1,3 +1,24 @@
1
- # Temporary Holding Version
1
+ # lumen-lib
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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
@@ -0,0 +1,3 @@
1
+ export declare function cn(
2
+ ...classes: Array<string | false | null | undefined>
3
+ ): string;
package/index.js ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Join class names, ignoring falsy values.
3
+ *
4
+ * @param {...(string | false | null | undefined)} classes
5
+ * @returns {string}
6
+ */
7
+ export function cn(...classes) {
8
+ return classes.filter(Boolean).join(" ");
9
+ }
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "lumen-lib",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
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
+ }