@kbach/react-native 1.0.0-beta.5 → 1.0.0-beta.51
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/AGENTS.md +361 -0
- package/README.md +150 -137
- 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-CD5WFFIQ.mjs +40 -0
- package/dist/chunk-IJAXJVB4.mjs +566 -0
- package/dist/chunk-KHQ2BWYH.mjs +112 -0
- package/dist/clsx-BLLSnqAa.d.ts +277 -0
- package/dist/darkModeStore.d.ts +73 -0
- package/dist/darkModeStore.js +118 -0
- package/dist/dynamicTokens.d.ts +53 -0
- package/dist/dynamicTokens.js +75 -0
- package/dist/index.d.ts +92 -151
- package/dist/index.js +2119 -393
- package/dist/index.web.d.ts +101 -4
- package/dist/index.web.js +438 -401
- package/dist/index.web.mjs +268 -14
- package/dist/jsx-dev-runtime.js +2238 -332
- package/dist/jsx-dev-runtime.web.js +207 -361
- package/dist/jsx-dev-runtime.web.mjs +19 -7
- package/dist/jsx-runtime.js +2238 -332
- package/dist/jsx-runtime.web.js +191 -353
- package/dist/jsx-runtime.web.mjs +3 -6
- package/dist/theme.d.ts +79 -0
- package/dist/{chunk-AEVOM2NB.mjs → theme.js} +89 -62
- package/package.json +44 -14
- package/src/babel-plugin.js +144 -2
- package/dist/chunk-4KCCEMEN.mjs +0 -66
- package/dist/chunk-DLIXI5OW.mjs +0 -53
- package/dist/chunk-FG5E4NLJ.mjs +0 -18
- package/dist/chunk-KSDFO34H.mjs +0 -32
- package/dist/chunk-OJQAJLYT.mjs +0 -14
- package/dist/chunk-ZUE6SCTE.mjs +0 -14
- package/dist/index.d.mts +0 -161
- package/dist/index.mjs +0 -32
- package/dist/index.web.d.mts +0 -7
- package/dist/jsx-dev-runtime.d.mts +0 -10
- package/dist/jsx-dev-runtime.mjs +0 -17
- package/dist/jsx-dev-runtime.web.d.mts +0 -10
- package/dist/jsx-runtime.d.mts +0 -7
- package/dist/jsx-runtime.mjs +0 -14
- package/dist/jsx-runtime.web.d.mts +0 -7
package/dist/index.web.d.ts
CHANGED
|
@@ -1,7 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
export { ColorEntry, ContainerConfig, ThemeConfig, defaultTheme, getTheme, setTheme } from './theme';
|
|
2
|
+
export { C as ClassArray, a as ClassDictionary, b as ClassValue, c as ColorScale, d as ColorsAPI, K as KbachConfig, T as ThemeProvider, e as ThemeProviderProps, f as ThemeState, h as applyKbachConfig, i as clsx, r as resolveKbachConfig, u as useColors, j as useDynamicToken, k as useTheme } from './clsx-BLLSnqAa.js';
|
|
3
|
+
export { ThemeMode, getGlobalDarkMode, getGlobalThemeMode, setGlobalThemeMode, subscribeGlobalDarkMode, toggleGlobalDarkMode } from './darkModeStore';
|
|
4
|
+
export { deleteDynamicToken, getDynamicToken, setDynamicToken, subscribeDynamicTokens } from './dynamicTokens';
|
|
3
5
|
import 'react';
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Resolves `classString` to CSS via the WASM engine, injects every returned
|
|
9
|
+
* rule into a shared `<style data-kbach-rn>` tag (cascade-order-safe — see
|
|
10
|
+
* cssInjector.web.ts), and returns the class string to use as
|
|
11
|
+
* `dataSet={{ kb: <returned value> }}`. MUST use the returned value, not the
|
|
12
|
+
* original input — mode-aware color names (e.g. `bg-surface`) expand into a
|
|
13
|
+
* literal light/dark pair, and the generated rules target that expanded
|
|
14
|
+
* text, not the original.
|
|
15
|
+
*/
|
|
16
|
+
declare function resolveClassName(classString: string): string;
|
|
6
17
|
|
|
7
|
-
export {
|
|
18
|
+
export { resolveClassName };
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Ambient module augmentation adding `className?: string` to React
|
|
22
|
+
* Native's own component prop types — without this, `<View
|
|
23
|
+
* className="...">` type-checks fine at RUNTIME (the babel plugin/
|
|
24
|
+
* jsx-runtime accept `className` on ANY host element regardless of its
|
|
25
|
+
* declared prop type — see jsxRuntimeCore.ts's own `processElement` doc
|
|
26
|
+
* comment) but fails `tsc`/editor type-checking, since `ViewProps`/
|
|
27
|
+
* `TextProps`/etc. (react-native's own types) have no `className` field at
|
|
28
|
+
* all. Confirmed as a real, reported gap: nothing in this package shipped
|
|
29
|
+
* this augmentation before, so a React Native CLI project running `tsc`
|
|
30
|
+
* (or just seeing red squiggles in-editor) hit "Property 'className' does
|
|
31
|
+
* not exist on type ... ViewProps ..." on every styled element.
|
|
32
|
+
*
|
|
33
|
+
* A plain `.d.ts` file has no effect on its own unless something actually
|
|
34
|
+
* pulls it into a consumer's type-checking. A side-effect `import
|
|
35
|
+
* './rnClassNameTypes'` from index.ts was the first thing tried here, but
|
|
36
|
+
* tsup's dts rollup (rollup-plugin-dts) tree-shakes a side-effect-only
|
|
37
|
+
* import with nothing it can trace a type reference through — confirmed by
|
|
38
|
+
* hand that this wasn't even consistent (survived one build, silently
|
|
39
|
+
* vanished from an immediately-following clean rebuild of the identical
|
|
40
|
+
* source). `scripts/append-classname-types.mjs` appends this file's own
|
|
41
|
+
* text onto the end of the built `dist/index.d.ts`/`dist/index.web.d.ts`
|
|
42
|
+
* directly as a deterministic post-build step instead — see that script's
|
|
43
|
+
* own doc comment. Anyone who imports ANYTHING from '@kbach/react-native'
|
|
44
|
+
* gets it with no extra tsconfig step needed either way. Same underlying
|
|
45
|
+
* problem (and the interface-merge half of this fix) nativewind — a React
|
|
46
|
+
* Native styling library solving this identical className-typing problem —
|
|
47
|
+
* also has to solve.
|
|
48
|
+
*
|
|
49
|
+
* Every interface below is `export interface XProps extends Readonly<...>
|
|
50
|
+
* {}` in react-native's own generated types (RN >= ~0.81's Flow-to-TS
|
|
51
|
+
* generation, `types_generated/`) — an otherwise-empty body, so merging a
|
|
52
|
+
* member in is exactly as safe as against a hand-written interface.
|
|
53
|
+
* Deliberately NOT listed here: `ImageProps`, `TouchableOpacityProps`,
|
|
54
|
+
* `ModalProps` — these are `export type X = Readonly<...>` TYPE ALIASES in
|
|
55
|
+
* the same generated types, which TypeScript cannot declaration-merge into
|
|
56
|
+
* at all (confirmed by hand: attempting it is a flat "Duplicate identifier"
|
|
57
|
+
* compile error, not a silent no-op). They don't need an entry anyway —
|
|
58
|
+
* confirmed against a real `tsc` run (RN 0.87) that `className` on
|
|
59
|
+
* `Image`/`TouchableOpacity`/`TouchableHighlight`/`Modal`/`SafeAreaView`
|
|
60
|
+
* ALL already type-check cleanly once `ViewProps` and
|
|
61
|
+
* `TouchableWithoutFeedbackProps` below are augmented — each of those
|
|
62
|
+
* components' real prop type composes one or the other somewhere in its
|
|
63
|
+
* own `Omit<...> & ...` chain (`SafeAreaView` in particular turned out to
|
|
64
|
+
* reuse `ViewProps` directly, with no separate props type of its own at
|
|
65
|
+
* all), so the merged `className` field flows through without needing its
|
|
66
|
+
* own dedicated entry.
|
|
67
|
+
*/
|
|
68
|
+
export {};
|
|
69
|
+
|
|
70
|
+
declare module 'react-native' {
|
|
71
|
+
interface ViewProps {
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
interface TextProps {
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
interface ScrollViewProps {
|
|
78
|
+
className?: string;
|
|
79
|
+
}
|
|
80
|
+
interface PressableProps {
|
|
81
|
+
className?: string;
|
|
82
|
+
}
|
|
83
|
+
interface TextInputProps {
|
|
84
|
+
className?: string;
|
|
85
|
+
}
|
|
86
|
+
interface TouchableHighlightProps {
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
interface TouchableWithoutFeedbackProps {
|
|
90
|
+
className?: string;
|
|
91
|
+
}
|
|
92
|
+
interface SwitchProps {
|
|
93
|
+
className?: string;
|
|
94
|
+
}
|
|
95
|
+
interface KeyboardAvoidingViewProps {
|
|
96
|
+
className?: string;
|
|
97
|
+
}
|
|
98
|
+
interface FlatListProps<ItemT> {
|
|
99
|
+
className?: string;
|
|
100
|
+
}
|
|
101
|
+
interface SectionListProps<ItemT, SectionT> {
|
|
102
|
+
className?: string;
|
|
103
|
+
}
|
|
104
|
+
}
|