@csszyx/runtime 0.9.10 → 0.10.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
@@ -35,26 +35,26 @@ const className = _sz("a", null, "b", undefined, false, "c");
35
35
  // Returns: "a b c"
36
36
  ```
37
37
 
38
- ### Conditional Helpers
38
+ ### Conditional Classes
39
+
40
+ Plain JS conditionals compose with `_sz` — no dedicated helper needed:
39
41
 
40
42
  ```typescript
41
- import { _szIf, _szSwitch } from "@csszyx/runtime";
43
+ import { _sz } from "@csszyx/runtime";
42
44
 
43
45
  // Simple conditional
44
- _szIf(isActive, "active"); // "active" or false
46
+ _sz("base", isActive && "active");
45
47
 
46
48
  // With fallback
47
- _szIf(isActive, "active", "inactive"); // "active" or "inactive"
48
-
49
- // Switch-like
50
- _szSwitch(
51
- [
52
- [status === "success", "text-green-500"],
53
- [status === "error", "text-red-500"],
54
- [status === "warning", "text-yellow-500"],
55
- ],
56
- "text-gray-500",
57
- );
49
+ _sz("base", isActive ? "active" : "inactive");
50
+
51
+ // Switch-like — a plain object lookup
52
+ const className =
53
+ {
54
+ success: "text-green-500",
55
+ error: "text-red-500",
56
+ warning: "text-yellow-500",
57
+ }[status] ?? "text-gray-500";
58
58
  ```
59
59
 
60
60
  ### Merging Classes
@@ -141,14 +141,6 @@ Optimized two-argument version.
141
141
 
142
142
  Optimized three-argument version.
143
143
 
144
- #### `_szIf(condition, className, fallback?): string | false`
145
-
146
- Conditional className application.
147
-
148
- #### `_szSwitch(conditions, default?): string`
149
-
150
- Switch-like className selection.
151
-
152
144
  #### `_szMerge(...classes): string`
153
145
 
154
146
  Merge className strings with duplicate removal.