@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.
Files changed (42) hide show
  1. package/AGENTS.md +361 -0
  2. package/README.md +150 -137
  3. package/android/src/main/jniLibs/arm64-v8a/libkbach_core_engine.so +0 -0
  4. package/android/src/main/jniLibs/x86_64/libkbach_core_engine.so +0 -0
  5. package/dist/chunk-CD5WFFIQ.mjs +40 -0
  6. package/dist/chunk-IJAXJVB4.mjs +566 -0
  7. package/dist/chunk-KHQ2BWYH.mjs +112 -0
  8. package/dist/clsx-BLLSnqAa.d.ts +277 -0
  9. package/dist/darkModeStore.d.ts +73 -0
  10. package/dist/darkModeStore.js +118 -0
  11. package/dist/dynamicTokens.d.ts +53 -0
  12. package/dist/dynamicTokens.js +75 -0
  13. package/dist/index.d.ts +92 -151
  14. package/dist/index.js +2119 -393
  15. package/dist/index.web.d.ts +101 -4
  16. package/dist/index.web.js +438 -401
  17. package/dist/index.web.mjs +268 -14
  18. package/dist/jsx-dev-runtime.js +2238 -332
  19. package/dist/jsx-dev-runtime.web.js +207 -361
  20. package/dist/jsx-dev-runtime.web.mjs +19 -7
  21. package/dist/jsx-runtime.js +2238 -332
  22. package/dist/jsx-runtime.web.js +191 -353
  23. package/dist/jsx-runtime.web.mjs +3 -6
  24. package/dist/theme.d.ts +79 -0
  25. package/dist/{chunk-AEVOM2NB.mjs → theme.js} +89 -62
  26. package/package.json +44 -14
  27. package/src/babel-plugin.js +144 -2
  28. package/dist/chunk-4KCCEMEN.mjs +0 -66
  29. package/dist/chunk-DLIXI5OW.mjs +0 -53
  30. package/dist/chunk-FG5E4NLJ.mjs +0 -18
  31. package/dist/chunk-KSDFO34H.mjs +0 -32
  32. package/dist/chunk-OJQAJLYT.mjs +0 -14
  33. package/dist/chunk-ZUE6SCTE.mjs +0 -14
  34. package/dist/index.d.mts +0 -161
  35. package/dist/index.mjs +0 -32
  36. package/dist/index.web.d.mts +0 -7
  37. package/dist/jsx-dev-runtime.d.mts +0 -10
  38. package/dist/jsx-dev-runtime.mjs +0 -17
  39. package/dist/jsx-dev-runtime.web.d.mts +0 -10
  40. package/dist/jsx-runtime.d.mts +0 -7
  41. package/dist/jsx-runtime.mjs +0 -14
  42. package/dist/jsx-runtime.web.d.mts +0 -7
@@ -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
- };
@@ -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
- };