@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.
@@ -2,12 +2,12 @@ import {
2
2
  Fragment,
3
3
  jsx,
4
4
  jsxs
5
- } from "./chunk-OIW7OQWO.mjs";
6
- import "./chunk-JS5KIGAB.mjs";
5
+ } from "./chunk-YOC3SHF5.mjs";
6
+ import "./chunk-H5Z24XX5.mjs";
7
7
  import {
8
8
  createJsxDEV
9
9
  } from "./chunk-DLIXI5OW.mjs";
10
- import "./chunk-4BXM3QUV.mjs";
10
+ import "./chunk-HK6PDJJK.mjs";
11
11
 
12
12
  // src/jsx-dev-runtime.web.tsx
13
13
  var jsxDEV = createJsxDEV(jsx, jsxs);
@@ -349,11 +349,13 @@ var defaultTheme = {
349
349
  colors: PALETTE,
350
350
  // Real Tailwind's default spacing scale in full — every step is exactly
351
351
  // `n * 4px`, including the fractional `.5` steps (`1.5` -> 6px, `2.5` ->
352
- // 10px, `3.5` -> 14px) and the "px" literal (a bare 1px). Previously
353
- // this only had {0,1,2,4,6,8} — a handful of spot-checked values, not
354
- // the real scale — so anything else (`p-3`, `w-5`, `border-2`,
355
- // `gap-10`, ...) silently failed to resolve. Mirrors @kbach/react's
356
- // theme.ts exactly.
352
+ // 10px, `3.5` -> 14px) and the "px" literal (a bare 1px). Only the
353
+ // "usual stops", though — `jsEngine/shared.ts`'s `spacingPx` (and the
354
+ // native Rust dispatcher's own `spacing_px`) falls back to Tailwind v4's
355
+ // live `n * 4px` formula for any bare numeric step not listed here
356
+ // (`p-0.25`, `w-13`, ...), so this table names the common values and
357
+ // gives a theme override something to target, not the full resolvable
358
+ // set. Mirrors @kbach/react's theme.ts exactly.
357
359
  spacing: {
358
360
  "0": 0,
359
361
  "px": 1,
@@ -398,7 +400,20 @@ var defaultTheme = {
398
400
  xl: 1280,
399
401
  "2xl": 1536
400
402
  },
401
- darkMode: "attribute"
403
+ // Byte-for-byte the same three stacks
404
+ // packages/core-engine/src/resolvers/typography.rs's `font_family_value`
405
+ // falls back to. On native these three still effectively no-op (see
406
+ // `first_font_name`'s own doc comment for why a generic CSS keyword
407
+ // isn't a real loadable font) — only a caller-configured custom name
408
+ // changes native rendering; Expo Web uses the full stack as-is.
409
+ fontFamily: {
410
+ sans: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
411
+ serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
412
+ mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
413
+ },
414
+ darkMode: "attribute",
415
+ // Empty by default, matching real Tailwind's own defaults.
416
+ container: {}
402
417
  };
403
418
  var activeTheme = defaultTheme;
404
419
  var activeThemeJson = JSON.stringify(defaultTheme);
@@ -682,6 +697,12 @@ function parseClass(token) {
682
697
  function decl(property, value) {
683
698
  return { property, value };
684
699
  }
700
+ function spacingPx(theme, value) {
701
+ const fromTable = theme.spacing[value];
702
+ if (fromTable !== void 0) return fromTable;
703
+ const n = Number(value);
704
+ return Number.isFinite(n) && value.trim() !== "" ? n * 4 : void 0;
705
+ }
685
706
  function resolveLength(theme, parsed) {
686
707
  if (parsed.negative) return null;
687
708
  const value = parsed.value;
@@ -689,7 +710,7 @@ function resolveLength(theme, parsed) {
689
710
  if (parsed.isArbitrary) return value;
690
711
  if (value === "full") return "100%";
691
712
  if (value === "auto") return "auto";
692
- const px = theme.spacing[value];
713
+ const px = spacingPx(theme, value);
693
714
  return px === void 0 ? null : `${px}px`;
694
715
  }
695
716
  function resolveNegatableLength(theme, parsed) {
@@ -697,7 +718,7 @@ function resolveNegatableLength(theme, parsed) {
697
718
  if (parsed.isArbitrary) return null;
698
719
  const value = parsed.value;
699
720
  if (value === null) return null;
700
- const px = theme.spacing[value];
721
+ const px = spacingPx(theme, value);
701
722
  if (px === void 0) return null;
702
723
  if (px === 0) return "0px";
703
724
  return `-${px}px`;
@@ -1056,7 +1077,8 @@ function resolve2(parsed, theme) {
1056
1077
 
1057
1078
  // src/jsEngine/resolvers/color.ts
1058
1079
  function lookupHex(theme, key) {
1059
- return theme.colors[key] ?? null;
1080
+ const entry = theme.colors[key];
1081
+ return typeof entry === "string" ? entry : null;
1060
1082
  }
1061
1083
 
1062
1084
  // src/jsEngine/resolvers/border.ts
@@ -1,13 +1,13 @@
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
  } from "./chunk-DLIXI5OW.mjs";
10
- import "./chunk-4BXM3QUV.mjs";
10
+ import "./chunk-HK6PDJJK.mjs";
11
11
  export {
12
12
  Fragment,
13
13
  jsx,