@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.
- package/README.md +70 -169
- 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-OJQAJLYT.mjs → chunk-DOWW44F7.mjs} +1 -1
- package/dist/chunk-H5Z24XX5.mjs +192 -0
- package/dist/{chunk-AEVOM2NB.mjs → chunk-HK6PDJJK.mjs} +54 -58
- package/dist/chunk-SY5OAY2C.mjs +1211 -0
- package/dist/chunk-X4UQCEOE.mjs +186 -0
- package/dist/chunk-YOC3SHF5.mjs +40 -0
- package/dist/chunk-Z664AKW7.mjs +54 -0
- package/dist/index.d.mts +24 -102
- package/dist/index.d.ts +24 -102
- package/dist/index.js +1387 -36
- package/dist/index.mjs +14 -8
- package/dist/index.web.d.mts +12 -4
- package/dist/index.web.d.ts +12 -4
- package/dist/index.web.js +266 -69
- package/dist/index.web.mjs +17 -11
- package/dist/jsx-dev-runtime.js +1246 -6
- package/dist/jsx-dev-runtime.mjs +4 -3
- package/dist/jsx-dev-runtime.web.js +124 -72
- package/dist/jsx-dev-runtime.web.mjs +4 -4
- package/dist/jsx-runtime.js +1246 -6
- package/dist/jsx-runtime.mjs +4 -3
- package/dist/jsx-runtime.web.js +109 -62
- package/dist/jsx-runtime.web.mjs +4 -6
- package/dist/useColors-CeP5_HvM.d.mts +230 -0
- package/dist/useColors-CeP5_HvM.d.ts +230 -0
- package/package.json +22 -4
- package/src/babel-plugin.js +74 -2
- package/dist/chunk-4KCCEMEN.mjs +0 -66
- package/dist/chunk-5WK55Z56.mjs +0 -14
- package/dist/chunk-FG5E4NLJ.mjs +0 -18
- package/dist/chunk-T3HPTH62.mjs +0 -161
|
@@ -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
|
-
"
|
|
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
|
-
|
|
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
|
};
|