@kbach/react-native 1.0.0-beta.10 → 1.0.0-beta.11

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.
@@ -6,7 +6,8 @@ import {
6
6
  import "./chunk-H5Z24XX5.mjs";
7
7
  import {
8
8
  createJsxDEV
9
- } from "./chunk-DLIXI5OW.mjs";
9
+ } from "./chunk-4DQXTAM3.mjs";
10
+ import "./chunk-RBJXE32L.mjs";
10
11
  import "./chunk-HK6PDJJK.mjs";
11
12
 
12
13
  // src/jsx-dev-runtime.web.tsx
@@ -29,43 +29,10 @@ module.exports = __toCommonJS(jsx_runtime_exports);
29
29
  // src/jsxRuntimeCore.ts
30
30
  var import_jsx_runtime = require("react/jsx-runtime");
31
31
  var import_react = require("react");
32
- var import_react_native = require("react-native");
33
- function makeElement(isStaticChildren, type, props, key) {
34
- return (isStaticChildren ? import_jsx_runtime.jsxs : import_jsx_runtime.jsx)(type, props, key);
35
- }
36
- function resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, pressed) {
37
- const resolved = resolveStyle2(classStrRaw, pressed);
38
- if (userStyle === void 0) {
39
- return resolved;
40
- }
41
- if (typeof userStyle === "function") {
42
- return [resolved, userStyle({ pressed })];
43
- }
44
- return [resolved, userStyle];
45
- }
46
- function processElement(resolveStyle2, type, rawProps, key, isStaticChildren) {
47
- if (type === null || typeof type === "symbol" || !rawProps) {
48
- return makeElement(isStaticChildren, type, rawProps ?? {}, key);
49
- }
50
- const { className: classStrRaw, style: userStyle, ...rest } = rawProps;
51
- if (typeof classStrRaw !== "string") {
52
- return makeElement(isStaticChildren, type, rawProps, key);
53
- }
54
- const finalStyle = type === import_react_native.Pressable ? (state) => resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, state.pressed) : resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, false);
55
- return makeElement(isStaticChildren, type, { ...rest, style: finalStyle }, key);
56
- }
57
- function createJsxFunctions(resolveStyle2) {
58
- function jsx2(type, props, key) {
59
- return processElement(resolveStyle2, type, props, key, false);
60
- }
61
- function jsxs2(type, props, key) {
62
- return processElement(resolveStyle2, type, props, key, true);
63
- }
64
- return { jsx: jsx2, jsxs: jsxs2 };
65
- }
32
+ var import_react_native2 = require("react-native");
66
33
 
67
- // src/nativeBridge.ts
68
- var import_react_native3 = require("react-native");
34
+ // src/darkModeStore.ts
35
+ var import_react_native = require("react-native");
69
36
 
70
37
  // src/generatedPalette.ts
71
38
  var PALETTE = {
@@ -425,10 +392,9 @@ function getThemeJson() {
425
392
  }
426
393
 
427
394
  // src/darkModeStore.ts
428
- var import_react_native2 = require("react-native");
429
395
  var listeners = /* @__PURE__ */ new Set();
430
396
  function systemPrefersDark() {
431
- return import_react_native2.Appearance.getColorScheme() === "dark";
397
+ return import_react_native.Appearance.getColorScheme() === "dark";
432
398
  }
433
399
  function resolveIsDark(m) {
434
400
  return m === "system" ? systemPrefersDark() : m === "dark";
@@ -447,7 +413,7 @@ function applyToDom(dark) {
447
413
  var mode = "system";
448
414
  var isDark = resolveIsDark(mode);
449
415
  applyToDom(isDark);
450
- var subscription = import_react_native2.Appearance.addChangeListener(({ colorScheme }) => {
416
+ var subscription = import_react_native.Appearance.addChangeListener(({ colorScheme }) => {
451
417
  if (mode !== "system") return;
452
418
  isDark = colorScheme === "dark";
453
419
  applyToDom(isDark);
@@ -460,6 +426,50 @@ function getGlobalDarkMode() {
460
426
  return isDark;
461
427
  }
462
428
 
429
+ // src/jsxRuntimeCore.ts
430
+ function makeElement(isStaticChildren, type, props, key) {
431
+ return (isStaticChildren ? import_jsx_runtime.jsxs : import_jsx_runtime.jsx)(type, props, key);
432
+ }
433
+ function resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, pressed) {
434
+ const resolved = resolveStyle2(classStrRaw, pressed);
435
+ if (userStyle === void 0) {
436
+ return resolved;
437
+ }
438
+ if (typeof userStyle === "function") {
439
+ return [resolved, userStyle({ pressed })];
440
+ }
441
+ return [resolved, userStyle];
442
+ }
443
+ var DARK_MODIFIER_RE = /(^|\s)dark:/;
444
+ function darkModeKeySuffix(classStrRaw) {
445
+ return DARK_MODIFIER_RE.test(classStrRaw) ? `:kb-dark-${getGlobalDarkMode()}` : "";
446
+ }
447
+ function processElement(resolveStyle2, type, rawProps, key, isStaticChildren) {
448
+ if (type === null || typeof type === "symbol" || !rawProps) {
449
+ return makeElement(isStaticChildren, type, rawProps ?? {}, key);
450
+ }
451
+ const { className: classStrRaw, style: userStyle, ...rest } = rawProps;
452
+ if (typeof classStrRaw !== "string") {
453
+ return makeElement(isStaticChildren, type, rawProps, key);
454
+ }
455
+ const finalStyle = type === import_react_native2.Pressable ? (state) => resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, state.pressed) : resolvedStyleFor(resolveStyle2, classStrRaw, userStyle, false);
456
+ const suffix = darkModeKeySuffix(classStrRaw);
457
+ const finalKey = suffix ? `${key ?? ""}${suffix}` : key;
458
+ return makeElement(isStaticChildren, type, { ...rest, style: finalStyle }, finalKey);
459
+ }
460
+ function createJsxFunctions(resolveStyle2) {
461
+ function jsx2(type, props, key) {
462
+ return processElement(resolveStyle2, type, props, key, false);
463
+ }
464
+ function jsxs2(type, props, key) {
465
+ return processElement(resolveStyle2, type, props, key, true);
466
+ }
467
+ return { jsx: jsx2, jsxs: jsxs2 };
468
+ }
469
+
470
+ // src/nativeBridge.ts
471
+ var import_react_native3 = require("react-native");
472
+
463
473
  // src/jsEngine/parser.ts
464
474
  var VALUE_PREFIXES = [
465
475
  "bg-opacity-",
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  jsx,
3
3
  jsxs
4
- } from "./chunk-4N7UEVQL.mjs";
4
+ } from "./chunk-5MU6PEXV.mjs";
5
5
  import "./chunk-XHL653X2.mjs";
6
- import "./chunk-RBJXE32L.mjs";
7
6
  import {
8
7
  Fragment
9
- } from "./chunk-DLIXI5OW.mjs";
8
+ } from "./chunk-4DQXTAM3.mjs";
9
+ import "./chunk-RBJXE32L.mjs";
10
10
  import "./chunk-HK6PDJJK.mjs";
11
11
  export {
12
12
  Fragment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react-native",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.11",
4
4
  "description": "Kbach's utility-class styling engine for React Native — the same class names as @kbach/react, resolved to a StyleSheet-ready style object via a Kotlin/JNI TurboModule (native), the same WASM engine @kbach/react uses (Expo Web / react-native-web), or a pure-JS fallback engine (Expo Go). Ships its own native Android module — one npm install, no separate native package. Beta. Native is Android-only (no iOS bridge yet); works with the React Native CLI, an Expo dev client, AND Expo Go (a reduced-coverage pure-JS fallback, since Expo Go can't load any custom native module).",
5
5
  "keywords": [
6
6
  "css",