react-native-twc 1.1.0 → 1.1.1
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/index.js +1 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14,15 +14,6 @@ function filterProps(props, shouldForwardProp) {
|
|
|
14
14
|
}
|
|
15
15
|
return filteredProps;
|
|
16
16
|
}
|
|
17
|
-
function mergeClassName(compose, base, override) {
|
|
18
|
-
if (override === undefined || override === null || override === "") {
|
|
19
|
-
return base;
|
|
20
|
-
}
|
|
21
|
-
if (base === undefined || base === null || base === "") {
|
|
22
|
-
return override;
|
|
23
|
-
}
|
|
24
|
-
return compose(base, override);
|
|
25
|
-
}
|
|
26
17
|
var createTwc = (config = {}) => {
|
|
27
18
|
const compose = config.compose || clsx;
|
|
28
19
|
const defaultShouldForwardProp = config.shouldForwardProp || ((prop) => prop[0] !== "$");
|
|
@@ -51,7 +42,7 @@ var createTwc = (config = {}) => {
|
|
|
51
42
|
finalProps = filterProps({ ...staticAttrs, ...rest }, shouldForwardProp);
|
|
52
43
|
}
|
|
53
44
|
const baseClassName = isClassFn ? stringsOrFn(p) : tplClassName;
|
|
54
|
-
const finalClassName = typeof baseClassName === "function" ? (renderProps) =>
|
|
45
|
+
const finalClassName = typeof baseClassName === "function" ? (renderProps) => compose(baseClassName(renderProps), typeof classNameProp === "function" ? classNameProp(renderProps) : classNameProp) : compose(baseClassName, classNameProp);
|
|
55
46
|
const Comp = Component;
|
|
56
47
|
return /* @__PURE__ */ jsx(Comp, {
|
|
57
48
|
ref,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-twc",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Create reusable React Native + NativeWind components with Tailwind CSS syntax.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"build:js": "NODE_ENV=production bun build src/index.tsx --outdir dist --format esm --external react --external react-native --external clsx --external tailwind-merge",
|
|
21
21
|
"build:dts": "tsc -p tsconfig.build.json",
|
|
22
22
|
"check-types": "tsc --noEmit",
|
|
23
|
-
"prepublishOnly": "bun run build"
|
|
23
|
+
"prepublishOnly": "bun run build && bun test"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"react-native",
|