@kbach/react-native 1.0.0-beta.5 → 1.0.0-beta.51
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/AGENTS.md +361 -0
- package/README.md +150 -137
- package/android/src/main/jniLibs/arm64-v8a/libkbach_core_engine.so +0 -0
- package/android/src/main/jniLibs/x86_64/libkbach_core_engine.so +0 -0
- package/dist/chunk-CD5WFFIQ.mjs +40 -0
- package/dist/chunk-IJAXJVB4.mjs +566 -0
- package/dist/chunk-KHQ2BWYH.mjs +112 -0
- package/dist/clsx-BLLSnqAa.d.ts +277 -0
- package/dist/darkModeStore.d.ts +73 -0
- package/dist/darkModeStore.js +118 -0
- package/dist/dynamicTokens.d.ts +53 -0
- package/dist/dynamicTokens.js +75 -0
- package/dist/index.d.ts +92 -151
- package/dist/index.js +2119 -393
- package/dist/index.web.d.ts +101 -4
- package/dist/index.web.js +438 -401
- package/dist/index.web.mjs +268 -14
- package/dist/jsx-dev-runtime.js +2238 -332
- package/dist/jsx-dev-runtime.web.js +207 -361
- package/dist/jsx-dev-runtime.web.mjs +19 -7
- package/dist/jsx-runtime.js +2238 -332
- package/dist/jsx-runtime.web.js +191 -353
- package/dist/jsx-runtime.web.mjs +3 -6
- package/dist/theme.d.ts +79 -0
- package/dist/{chunk-AEVOM2NB.mjs → theme.js} +89 -62
- package/package.json +44 -14
- package/src/babel-plugin.js +144 -2
- package/dist/chunk-4KCCEMEN.mjs +0 -66
- package/dist/chunk-DLIXI5OW.mjs +0 -53
- package/dist/chunk-FG5E4NLJ.mjs +0 -18
- package/dist/chunk-KSDFO34H.mjs +0 -32
- package/dist/chunk-OJQAJLYT.mjs +0 -14
- package/dist/chunk-ZUE6SCTE.mjs +0 -14
- package/dist/index.d.mts +0 -161
- package/dist/index.mjs +0 -32
- package/dist/index.web.d.mts +0 -7
- package/dist/jsx-dev-runtime.d.mts +0 -10
- package/dist/jsx-dev-runtime.mjs +0 -17
- package/dist/jsx-dev-runtime.web.d.mts +0 -10
- package/dist/jsx-runtime.d.mts +0 -7
- package/dist/jsx-runtime.mjs +0 -14
- package/dist/jsx-runtime.web.d.mts +0 -7
package/dist/chunk-DLIXI5OW.mjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// src/jsxRuntimeCore.ts
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Fragment } from "react";
|
|
4
|
-
import { Pressable } from "react-native";
|
|
5
|
-
function makeElement(isStaticChildren, type, props, key) {
|
|
6
|
-
return (isStaticChildren ? _jsxs : _jsx)(type, props, key);
|
|
7
|
-
}
|
|
8
|
-
function resolvedStyleFor(resolveStyle, classStrRaw, userStyle, pressed) {
|
|
9
|
-
const resolved = resolveStyle(classStrRaw, pressed);
|
|
10
|
-
if (userStyle === void 0) {
|
|
11
|
-
return resolved;
|
|
12
|
-
}
|
|
13
|
-
if (typeof userStyle === "function") {
|
|
14
|
-
return [resolved, userStyle({ pressed })];
|
|
15
|
-
}
|
|
16
|
-
return [resolved, userStyle];
|
|
17
|
-
}
|
|
18
|
-
function processElement(resolveStyle, type, rawProps, key, isStaticChildren) {
|
|
19
|
-
if (type === null || typeof type === "symbol" || !rawProps) {
|
|
20
|
-
return makeElement(isStaticChildren, type, rawProps ?? {}, key);
|
|
21
|
-
}
|
|
22
|
-
const { className: classStrRaw, style: userStyle, ...rest } = rawProps;
|
|
23
|
-
if (typeof classStrRaw !== "string") {
|
|
24
|
-
return makeElement(isStaticChildren, type, rawProps, key);
|
|
25
|
-
}
|
|
26
|
-
const finalStyle = type === Pressable ? (state) => resolvedStyleFor(resolveStyle, classStrRaw, userStyle, state.pressed) : resolvedStyleFor(resolveStyle, classStrRaw, userStyle, false);
|
|
27
|
-
return makeElement(isStaticChildren, type, { ...rest, style: finalStyle }, key);
|
|
28
|
-
}
|
|
29
|
-
function createJsxFunctions(resolveStyle) {
|
|
30
|
-
function jsx(type, props, key) {
|
|
31
|
-
return processElement(resolveStyle, type, props, key, false);
|
|
32
|
-
}
|
|
33
|
-
function jsxs(type, props, key) {
|
|
34
|
-
return processElement(resolveStyle, type, props, key, true);
|
|
35
|
-
}
|
|
36
|
-
return { jsx, jsxs };
|
|
37
|
-
}
|
|
38
|
-
function createJsxDEV(jsx, jsxs) {
|
|
39
|
-
return function jsxDEV(type, props, key, isStaticChildren, source, self) {
|
|
40
|
-
const element = (isStaticChildren ? jsxs : jsx)(type, props, key);
|
|
41
|
-
if (source && element && typeof element === "object" && Object.isExtensible(element)) {
|
|
42
|
-
element._source = source;
|
|
43
|
-
element._self = self;
|
|
44
|
-
}
|
|
45
|
-
return element;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
Fragment,
|
|
51
|
-
createJsxFunctions,
|
|
52
|
-
createJsxDEV
|
|
53
|
-
};
|
package/dist/chunk-FG5E4NLJ.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getGlobalDarkMode,
|
|
3
|
-
getThemeJson
|
|
4
|
-
} from "./chunk-AEVOM2NB.mjs";
|
|
5
|
-
|
|
6
|
-
// src/nativeBridge.ts
|
|
7
|
-
import { Dimensions, TurboModuleRegistry } from "react-native";
|
|
8
|
-
function resolveStyle(classString, pressed = false) {
|
|
9
|
-
const KbachModule = TurboModuleRegistry.getEnforcing("KbachModule");
|
|
10
|
-
const colorScheme = getGlobalDarkMode() ? "dark" : "light";
|
|
11
|
-
const width = Dimensions.get("window").width;
|
|
12
|
-
const json = KbachModule.resolveStyle(classString, getThemeJson(), colorScheme, pressed, width);
|
|
13
|
-
return JSON.parse(json);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
resolveStyle
|
|
18
|
-
};
|