@kbach/react-native 1.0.0-beta.7 → 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.
@@ -278,16 +278,51 @@ var PALETTE = {
278
278
  // src/theme.ts
279
279
  var defaultTheme = {
280
280
  colors: PALETTE,
281
+ // Real Tailwind's default spacing scale in full — every step is exactly
282
+ // `n * 4px`, including the fractional `.5` steps (`1.5` -> 6px, `2.5` ->
283
+ // 10px, `3.5` -> 14px) and the "px" literal (a bare 1px). Only the
284
+ // "usual stops", though — `jsEngine/shared.ts`'s `spacingPx` (and the
285
+ // native Rust dispatcher's own `spacing_px`) falls back to Tailwind v4's
286
+ // live `n * 4px` formula for any bare numeric step not listed here
287
+ // (`p-0.25`, `w-13`, ...), so this table names the common values and
288
+ // gives a theme override something to target, not the full resolvable
289
+ // set. Mirrors @kbach/react's theme.ts exactly.
281
290
  spacing: {
282
- // "0" is always a hardcoded zero in real Tailwind's own scale too,
283
- // regardless of the base spacing unit — needed for `p-0`/`m-0`/etc.
284
- // Mirrors the identical fix in @kbach/react's theme.ts.
285
291
  "0": 0,
292
+ "px": 1,
293
+ "0.5": 2,
286
294
  "1": 4,
295
+ "1.5": 6,
287
296
  "2": 8,
297
+ "2.5": 10,
298
+ "3": 12,
299
+ "3.5": 14,
288
300
  "4": 16,
301
+ "5": 20,
289
302
  "6": 24,
290
- "8": 32
303
+ "7": 28,
304
+ "8": 32,
305
+ "9": 36,
306
+ "10": 40,
307
+ "11": 44,
308
+ "12": 48,
309
+ "14": 56,
310
+ "16": 64,
311
+ "20": 80,
312
+ "24": 96,
313
+ "28": 112,
314
+ "32": 128,
315
+ "36": 144,
316
+ "40": 160,
317
+ "44": 176,
318
+ "48": 192,
319
+ "52": 208,
320
+ "56": 224,
321
+ "60": 240,
322
+ "64": 256,
323
+ "72": 288,
324
+ "80": 320,
325
+ "96": 384
291
326
  },
292
327
  screens: {
293
328
  sm: 640,
@@ -296,7 +331,20 @@ var defaultTheme = {
296
331
  xl: 1280,
297
332
  "2xl": 1536
298
333
  },
299
- darkMode: "attribute"
334
+ // Byte-for-byte the same three stacks
335
+ // packages/core-engine/src/resolvers/typography.rs's `font_family_value`
336
+ // falls back to. On native these three still effectively no-op (see
337
+ // `first_font_name`'s own doc comment for why a generic CSS keyword
338
+ // isn't a real loadable font) — only a caller-configured custom name
339
+ // changes native rendering; Expo Web uses the full stack as-is.
340
+ fontFamily: {
341
+ sans: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
342
+ serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
343
+ mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
344
+ },
345
+ darkMode: "attribute",
346
+ // Empty by default, matching real Tailwind's own defaults.
347
+ container: {}
300
348
  };
301
349
  var activeTheme = defaultTheme;
302
350
  var activeThemeJson = JSON.stringify(defaultTheme);
@@ -311,61 +359,9 @@ function getThemeJson() {
311
359
  return activeThemeJson;
312
360
  }
313
361
 
314
- // src/darkModeStore.ts
315
- import { Appearance } from "react-native";
316
- var listeners = /* @__PURE__ */ new Set();
317
- function systemPrefersDark() {
318
- return Appearance.getColorScheme() === "dark";
319
- }
320
- function resolveIsDark(m) {
321
- return m === "system" ? systemPrefersDark() : m === "dark";
322
- }
323
- var mode = "system";
324
- var isDark = resolveIsDark(mode);
325
- var hasExplicitChoice = false;
326
- var subscription = Appearance.addChangeListener(({ colorScheme }) => {
327
- if (mode !== "system") return;
328
- isDark = colorScheme === "dark";
329
- notify();
330
- });
331
- function notify() {
332
- for (const listener of listeners) listener();
333
- }
334
- function getGlobalDarkMode() {
335
- return isDark;
336
- }
337
- function getGlobalThemeMode() {
338
- return mode;
339
- }
340
- function setGlobalThemeMode(nextMode) {
341
- mode = nextMode;
342
- isDark = resolveIsDark(nextMode);
343
- hasExplicitChoice = true;
344
- notify();
345
- }
346
- function toggleGlobalDarkMode() {
347
- setGlobalThemeMode(isDark ? "light" : "dark");
348
- }
349
- function subscribeGlobalDarkMode(listener) {
350
- listeners.add(listener);
351
- return () => listeners.delete(listener);
352
- }
353
- function seedDefaultMode(fallback) {
354
- if (hasExplicitChoice || mode === fallback) return;
355
- mode = fallback;
356
- isDark = resolveIsDark(fallback);
357
- notify();
358
- }
359
-
360
362
  export {
361
363
  defaultTheme,
362
364
  setTheme,
363
365
  getTheme,
364
- getThemeJson,
365
- getGlobalDarkMode,
366
- getGlobalThemeMode,
367
- setGlobalThemeMode,
368
- toggleGlobalDarkMode,
369
- subscribeGlobalDarkMode,
370
- seedDefaultMode
366
+ getThemeJson
371
367
  };