@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.
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  ThemeProvider,
3
- useGlobalDarkMode,
3
+ applyKbachConfig,
4
+ resolveKbachConfig,
5
+ useColors,
4
6
  useTheme
5
- } from "./chunk-CGU7UM2F.mjs";
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-JS5KIGAB.mjs";
17
+ } from "./chunk-H5Z24XX5.mjs";
16
18
  import {
17
19
  defaultTheme,
18
20
  getTheme,
19
21
  setTheme
20
- } from "./chunk-4BXM3QUV.mjs";
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
- useGlobalDarkMode,
36
+ useColors,
33
37
  useTheme
34
38
  };
@@ -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). Previously
362
- // this only had {0,1,2,4,6,8} — a handful of spot-checked values, not
363
- // the real scale — so anything else (`p-3`, `w-5`, `border-2`,
364
- // `gap-10`, ...) silently failed to resolve. Mirrors @kbach/react's
365
- // theme.ts exactly.
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
- darkMode: "attribute"
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.spacing[value];
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.spacing[value];
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
- return theme.colors[key] ?? null;
1089
+ const entry = theme.colors[key];
1090
+ return typeof entry === "string" ? entry : null;
1069
1091
  }
1070
1092
 
1071
1093
  // src/jsEngine/resolvers/border.ts
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  jsx,
3
3
  jsxs
4
- } from "./chunk-KV3ZIXSH.mjs";
5
- import "./chunk-JR3BLUAV.mjs";
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-4BXM3QUV.mjs";
11
+ import "./chunk-HK6PDJJK.mjs";
12
12
 
13
13
  // src/jsx-dev-runtime.tsx
14
14
  var jsxDEV = createJsxDEV(jsx, jsxs);