@kbach/react-native 1.0.0-beta.8 → 1.0.0-beta.9
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/README.md +67 -235
- 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-KV3ZIXSH.mjs → chunk-DOWW44F7.mjs} +1 -1
- package/dist/chunk-H5Z24XX5.mjs +192 -0
- package/dist/{chunk-4BXM3QUV.mjs → chunk-HK6PDJJK.mjs} +21 -6
- package/dist/{chunk-JR3BLUAV.mjs → chunk-SY5OAY2C.mjs} +11 -4
- package/dist/chunk-X4UQCEOE.mjs +186 -0
- package/dist/{chunk-OIW7OQWO.mjs → chunk-YOC3SHF5.mjs} +1 -1
- package/dist/index.d.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +176 -39
- package/dist/index.mjs +9 -5
- package/dist/index.web.d.mts +1 -1
- package/dist/index.web.d.ts +1 -1
- package/dist/index.web.js +171 -39
- package/dist/index.web.mjs +9 -5
- package/dist/jsx-dev-runtime.js +31 -9
- package/dist/jsx-dev-runtime.mjs +3 -3
- package/dist/jsx-dev-runtime.web.js +22 -7
- package/dist/jsx-dev-runtime.web.mjs +3 -3
- package/dist/jsx-runtime.js +31 -9
- package/dist/jsx-runtime.mjs +3 -3
- package/dist/jsx-runtime.web.js +22 -7
- package/dist/jsx-runtime.web.mjs +3 -3
- package/dist/useColors-CeP5_HvM.d.mts +230 -0
- package/dist/useColors-CeP5_HvM.d.ts +230 -0
- package/package.json +1 -1
- package/src/babel-plugin.js +74 -2
- package/dist/ThemeContext-Dc5AC-m0.d.mts +0 -98
- package/dist/ThemeContext-Dc5AC-m0.d.ts +0 -98
- package/dist/chunk-CGU7UM2F.mjs +0 -66
- package/dist/chunk-JS5KIGAB.mjs +0 -192
package/dist/index.web.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ThemeProvider,
|
|
3
|
-
|
|
3
|
+
applyKbachConfig,
|
|
4
|
+
resolveKbachConfig,
|
|
5
|
+
useColors,
|
|
4
6
|
useTheme
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-X4UQCEOE.mjs";
|
|
6
8
|
import {
|
|
7
9
|
getGlobalDarkMode,
|
|
8
10
|
getGlobalThemeMode,
|
|
@@ -12,23 +14,25 @@ import {
|
|
|
12
14
|
} from "./chunk-Z664AKW7.mjs";
|
|
13
15
|
import {
|
|
14
16
|
resolveClassName
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-H5Z24XX5.mjs";
|
|
16
18
|
import {
|
|
17
19
|
defaultTheme,
|
|
18
20
|
getTheme,
|
|
19
21
|
setTheme
|
|
20
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-HK6PDJJK.mjs";
|
|
21
23
|
export {
|
|
22
24
|
ThemeProvider,
|
|
25
|
+
applyKbachConfig,
|
|
23
26
|
defaultTheme,
|
|
24
27
|
getGlobalDarkMode,
|
|
25
28
|
getGlobalThemeMode,
|
|
26
29
|
getTheme,
|
|
27
30
|
resolveClassName,
|
|
31
|
+
resolveKbachConfig,
|
|
28
32
|
setGlobalThemeMode,
|
|
29
33
|
setTheme,
|
|
30
34
|
subscribeGlobalDarkMode,
|
|
31
35
|
toggleGlobalDarkMode,
|
|
32
|
-
|
|
36
|
+
useColors,
|
|
33
37
|
useTheme
|
|
34
38
|
};
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -358,11 +358,13 @@ var defaultTheme = {
|
|
|
358
358
|
colors: PALETTE,
|
|
359
359
|
// Real Tailwind's default spacing scale in full — every step is exactly
|
|
360
360
|
// `n * 4px`, including the fractional `.5` steps (`1.5` -> 6px, `2.5` ->
|
|
361
|
-
// 10px, `3.5` -> 14px) and the "px" literal (a bare 1px).
|
|
362
|
-
//
|
|
363
|
-
//
|
|
364
|
-
// `
|
|
365
|
-
//
|
|
361
|
+
// 10px, `3.5` -> 14px) and the "px" literal (a bare 1px). Only the
|
|
362
|
+
// "usual stops", though — `jsEngine/shared.ts`'s `spacingPx` (and the
|
|
363
|
+
// native Rust dispatcher's own `spacing_px`) falls back to Tailwind v4's
|
|
364
|
+
// live `n * 4px` formula for any bare numeric step not listed here
|
|
365
|
+
// (`p-0.25`, `w-13`, ...), so this table names the common values and
|
|
366
|
+
// gives a theme override something to target, not the full resolvable
|
|
367
|
+
// set. Mirrors @kbach/react's theme.ts exactly.
|
|
366
368
|
spacing: {
|
|
367
369
|
"0": 0,
|
|
368
370
|
"px": 1,
|
|
@@ -407,7 +409,20 @@ var defaultTheme = {
|
|
|
407
409
|
xl: 1280,
|
|
408
410
|
"2xl": 1536
|
|
409
411
|
},
|
|
410
|
-
|
|
412
|
+
// Byte-for-byte the same three stacks
|
|
413
|
+
// packages/core-engine/src/resolvers/typography.rs's `font_family_value`
|
|
414
|
+
// falls back to. On native these three still effectively no-op (see
|
|
415
|
+
// `first_font_name`'s own doc comment for why a generic CSS keyword
|
|
416
|
+
// isn't a real loadable font) — only a caller-configured custom name
|
|
417
|
+
// changes native rendering; Expo Web uses the full stack as-is.
|
|
418
|
+
fontFamily: {
|
|
419
|
+
sans: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
|
|
420
|
+
serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
|
|
421
|
+
mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
|
|
422
|
+
},
|
|
423
|
+
darkMode: "attribute",
|
|
424
|
+
// Empty by default, matching real Tailwind's own defaults.
|
|
425
|
+
container: {}
|
|
411
426
|
};
|
|
412
427
|
var activeTheme = defaultTheme;
|
|
413
428
|
var activeThemeJson = JSON.stringify(defaultTheme);
|
|
@@ -691,6 +706,12 @@ function parseClass(token) {
|
|
|
691
706
|
function decl(property, value) {
|
|
692
707
|
return { property, value };
|
|
693
708
|
}
|
|
709
|
+
function spacingPx(theme, value) {
|
|
710
|
+
const fromTable = theme.spacing[value];
|
|
711
|
+
if (fromTable !== void 0) return fromTable;
|
|
712
|
+
const n = Number(value);
|
|
713
|
+
return Number.isFinite(n) && value.trim() !== "" ? n * 4 : void 0;
|
|
714
|
+
}
|
|
694
715
|
function resolveLength(theme, parsed) {
|
|
695
716
|
if (parsed.negative) return null;
|
|
696
717
|
const value = parsed.value;
|
|
@@ -698,7 +719,7 @@ function resolveLength(theme, parsed) {
|
|
|
698
719
|
if (parsed.isArbitrary) return value;
|
|
699
720
|
if (value === "full") return "100%";
|
|
700
721
|
if (value === "auto") return "auto";
|
|
701
|
-
const px = theme
|
|
722
|
+
const px = spacingPx(theme, value);
|
|
702
723
|
return px === void 0 ? null : `${px}px`;
|
|
703
724
|
}
|
|
704
725
|
function resolveNegatableLength(theme, parsed) {
|
|
@@ -706,7 +727,7 @@ function resolveNegatableLength(theme, parsed) {
|
|
|
706
727
|
if (parsed.isArbitrary) return null;
|
|
707
728
|
const value = parsed.value;
|
|
708
729
|
if (value === null) return null;
|
|
709
|
-
const px = theme
|
|
730
|
+
const px = spacingPx(theme, value);
|
|
710
731
|
if (px === void 0) return null;
|
|
711
732
|
if (px === 0) return "0px";
|
|
712
733
|
return `-${px}px`;
|
|
@@ -1065,7 +1086,8 @@ function resolve2(parsed, theme) {
|
|
|
1065
1086
|
|
|
1066
1087
|
// src/jsEngine/resolvers/color.ts
|
|
1067
1088
|
function lookupHex(theme, key) {
|
|
1068
|
-
|
|
1089
|
+
const entry = theme.colors[key];
|
|
1090
|
+
return typeof entry === "string" ? entry : null;
|
|
1069
1091
|
}
|
|
1070
1092
|
|
|
1071
1093
|
// src/jsEngine/resolvers/border.ts
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
jsx,
|
|
3
3
|
jsxs
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-DOWW44F7.mjs";
|
|
5
|
+
import "./chunk-SY5OAY2C.mjs";
|
|
6
6
|
import "./chunk-Z664AKW7.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Fragment,
|
|
9
9
|
createJsxDEV
|
|
10
10
|
} from "./chunk-DLIXI5OW.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-HK6PDJJK.mjs";
|
|
12
12
|
|
|
13
13
|
// src/jsx-dev-runtime.tsx
|
|
14
14
|
var jsxDEV = createJsxDEV(jsx, jsxs);
|