clava 0.1.16 → 0.1.18
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/CHANGELOG.md +35 -0
- package/dist/index.d.ts +23 -20187
- package/dist/index.js +115 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/rolldown.config.ts +2 -0
- package/src/index.ts +181 -21
- package/src/test-react.ts +1 -1
- package/src/test.ts +270 -38
- package/src/types.ts +49 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# clava
|
|
2
2
|
|
|
3
|
+
## 0.1.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f1aefb1: Preserved `clsx` and `csstype` as external imports in the published Clava build instead of bundling them into `dist`.
|
|
8
|
+
|
|
9
|
+
## 0.1.17
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- c2f1fa9: Added support for disabling inherited variants and variant values with `null`.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const base = cv({
|
|
17
|
+
variants: { size: { sm: "sm", lg: "lg" } },
|
|
18
|
+
defaultVariants: { size: "sm" },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const button = cv({
|
|
22
|
+
extend: [base],
|
|
23
|
+
variants: { size: { sm: null } },
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
button({ size: "lg" }); // ✅
|
|
27
|
+
button({ size: "sm" }); // ❌ TypeScript error
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Disabled variants and values are excluded from `defaultVariants`, resolved variant props, and applied classes/styles.
|
|
31
|
+
|
|
32
|
+
- a8cc18c: Added `Variant<T, K>` utility type for cross-component variant key constraints.
|
|
33
|
+
- 4e54d51: Required an explicit `style` key for object-based variant/computed outputs.
|
|
34
|
+
- 7e32a54: Reduced runtime overhead in `cv` hot paths.
|
|
35
|
+
|
|
36
|
+
This avoids repeated key-array allocations when merging style objects and when propagating override metadata to extended components. Behavior remains the same while reducing per-call work in frequently executed code paths, especially for components with many style merges or multiple `extend` entries.
|
|
37
|
+
|
|
3
38
|
## 0.1.16
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|