native-variants 0.1.33 → 0.1.34

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/dist/cn.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import { StyleProp } from "react-native";
2
- export declare function cn<T extends object>(...styles: Array<StyleProp<T> | null | undefined | false>): StyleProp<T>;
2
+ import { Styles } from "./props.js";
3
+ export declare function cn(...styles: StyleProp<any>[]): Styles;
package/dist/cn.js CHANGED
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cn = cn;
4
4
  function cn(...styles) {
5
- return styles.filter(Boolean);
5
+ return styles
6
+ .filter((style) => Boolean(style))
7
+ .reduce((merged, style) => ({
8
+ ...merged,
9
+ ...style,
10
+ }), {});
6
11
  }
7
12
  //# sourceMappingURL=cn.js.map
package/dist/cn.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cn.js","sourceRoot":"","sources":["../src/cn.ts"],"names":[],"mappings":";;AAEA,gBAIC;AAJD,SAAgB,EAAE,CAChB,GAAG,MAAsD;IAEzD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAiB,CAAC;AAChD,CAAC"}
1
+ {"version":3,"file":"cn.js","sourceRoot":"","sources":["../src/cn.ts"],"names":[],"mappings":";;AAGA,gBAUC;AAVD,SAAgB,EAAE,CAAC,GAAG,MAAwB;IAC5C,OAAO,MAAM;SACV,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAClD,MAAM,CACL,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAClB,GAAG,MAAM;QACT,GAAG,KAAK;KACT,CAAC,EACF,EAAE,CACH,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-variants",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "A library for handling variants in React Native components with theme support.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",