@kbach/react-native 1.0.0-beta.1 → 1.0.0-beta.10

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.
Files changed (45) hide show
  1. package/README.md +87 -66
  2. package/android/build.gradle +36 -0
  3. package/android/src/main/AndroidManifest.xml +14 -0
  4. package/android/src/main/java/com/kbachnative/KbachModule.kt +83 -0
  5. package/android/src/main/java/com/kbachnative/KbachPackage.kt +54 -0
  6. package/android/src/main/jniLibs/arm64-v8a/libkbach_core_engine.so +0 -0
  7. package/android/src/main/jniLibs/x86_64/libkbach_core_engine.so +0 -0
  8. package/dist/chunk-4N7UEVQL.mjs +14 -0
  9. package/dist/{chunk-SVMYVXY6.mjs → chunk-DLIXI5OW.mjs} +23 -14
  10. package/dist/chunk-H5Z24XX5.mjs +192 -0
  11. package/dist/{chunk-YHF3QLRL.mjs → chunk-HK6PDJJK.mjs} +61 -68
  12. package/dist/chunk-RBJXE32L.mjs +73 -0
  13. package/dist/chunk-TDWBXJH5.mjs +186 -0
  14. package/dist/chunk-XHL653X2.mjs +1211 -0
  15. package/dist/chunk-YOC3SHF5.mjs +40 -0
  16. package/dist/index.d.mts +37 -102
  17. package/dist/index.d.ts +37 -102
  18. package/dist/index.js +1411 -38
  19. package/dist/index.mjs +19 -61
  20. package/dist/index.web.d.mts +15 -0
  21. package/dist/index.web.d.ts +15 -0
  22. package/dist/index.web.js +829 -0
  23. package/dist/index.web.mjs +38 -0
  24. package/dist/jsx-dev-runtime.d.mts +3 -12
  25. package/dist/jsx-dev-runtime.d.ts +3 -12
  26. package/dist/jsx-dev-runtime.js +1314 -47
  27. package/dist/jsx-dev-runtime.mjs +9 -11
  28. package/dist/jsx-dev-runtime.web.d.mts +10 -0
  29. package/dist/jsx-dev-runtime.web.d.ts +10 -0
  30. package/dist/jsx-dev-runtime.web.js +618 -0
  31. package/dist/jsx-dev-runtime.web.mjs +17 -0
  32. package/dist/jsx-runtime.d.mts +3 -23
  33. package/dist/jsx-runtime.d.ts +3 -23
  34. package/dist/jsx-runtime.js +1305 -39
  35. package/dist/jsx-runtime.mjs +7 -3
  36. package/dist/jsx-runtime.web.d.mts +7 -0
  37. package/dist/jsx-runtime.web.d.ts +7 -0
  38. package/dist/jsx-runtime.web.js +602 -0
  39. package/dist/jsx-runtime.web.mjs +12 -0
  40. package/dist/useColors-C6jyCLuG.d.mts +239 -0
  41. package/dist/useColors-C6jyCLuG.d.ts +239 -0
  42. package/package.json +57 -8
  43. package/react-native.config.js +29 -0
  44. package/specs/NativeKbachModule.ts +31 -0
  45. package/src/babel-plugin.js +74 -2
package/README.md CHANGED
@@ -2,27 +2,18 @@
2
2
 
3
3
  Kbach's utility-class styling engine for React Native — the same class
4
4
  names as [`@kbach/react`](https://www.npmjs.com/package/@kbach/react),
5
- resolved to a real `StyleSheet`-ready style object instead of injected CSS.
5
+ resolved to a `StyleSheet`-ready style object instead of injected CSS.
6
6
 
7
- > **Beta, Android-only.** Resolution runs through a Kotlin/JNI TurboModule
8
- > calling the same Rust core `@kbach/react` uses, so class semantics stay
9
- > identical across web and native. The native module ships prebuilt (see
10
- > Setup below) — no Rust toolchain or manual native wiring required — but
11
- > there's no iOS bridge yet.
7
+ > Beta. Native is Android-only (no iOS bridge yet). Ships a prebuilt native
8
+ > module — no Rust toolchain or manual native wiring required.
12
9
 
13
- ## Setup
10
+ ## Install
14
11
 
15
12
  ```sh
16
13
  npm install @kbach/react-native
17
14
  ```
18
15
 
19
- That pulls in [`@kbach/android`](https://www.npmjs.com/package/@kbach/android)
20
- too — the actual native module — as a real dependency. Android's
21
- autolinking discovers it automatically the moment it's in `node_modules`;
22
- no manual `MainApplication.kt` edit needed.
23
-
24
- Add the Babel plugin so your app's JSX routes through Kbach's JSX runtime
25
- instead of `react/jsx-runtime`:
16
+ ### React Native CLI
26
17
 
27
18
  ```js
28
19
  // babel.config.js
@@ -32,74 +23,104 @@ module.exports = {
32
23
  };
33
24
  ```
34
25
 
35
- Then rebuild the Android app (`npm run android`, or a clean Gradle build if
36
- you're re-running one that's already built) so Gradle picks up the new
37
- native module. See `apps/native-sandbox` in the
38
- [repo](https://github.com/semsakadanupol/kbach) for a full working
39
- reference project, including the Metro config a monorepo setup like this
40
- one needs (a plain single-app install doesn't need any of that — it's
41
- only relevant if you're linking packages locally instead of installing
42
- from npm).
43
-
44
- ## What this is
45
-
46
- - A JSX runtime (`@kbach/react-native/jsx-runtime`) that intercepts
47
- `className`/`kb` props on every element and calls into the native bridge
48
- to resolve them to a style object, synchronously, on every render.
49
- - A Babel plugin (`@kbach/react-native/babel-plugin`) that routes your
50
- app's own files (never `node_modules`) through that JSX runtime via a
51
- per-file `@jsxImportSource` pragma.
52
- - `setTheme()`/`getTheme()` for customizing the color palette and spacing
53
- scale — the same `ThemeConfig` shape `@kbach/react` uses, kept as an
54
- independent type here so a native-only project isn't forced to depend on
55
- a web-oriented package.
56
- - `shadow-*` resolves to real native shadows — iOS's discrete
57
- `shadowColor`/`shadowOffset`/`shadowOpacity`/`shadowRadius` and Android's
58
- `elevation`, both derived from the same named tiers (`sm`/`DEFAULT`/`md`/
59
- `lg`/`xl`/`2xl`) `@kbach/react`'s CSS `box-shadow` scale uses — one class
60
- produces a real shadow on both platforms. `shadow-inner` and arbitrary
61
- `shadow-[...]` values aren't supported — neither platform's native shadow
62
- API can express an inset shadow, and an arbitrary value is a raw CSS
63
- string with no mechanical translation into discrete native props.
26
+ Rebuild the Android app afterward so Gradle picks up the native module.
64
27
 
65
- ## Dark mode
28
+ ### Expo Go
29
+
30
+ Works out of the box — no prebuild, no dev client, nothing to configure.
31
+ Expo Go can't load third-party native code, so this falls back to a pure-JS
32
+ engine automatically. Covers layout, spacing, border/radius, plain colors,
33
+ font-weight, text-transform/decoration, line-height, letter-spacing, and
34
+ shadows. Doesn't cover grid, transforms, filters, gradients, or DOM-only
35
+ typography — same scope native itself excludes.
36
+
37
+ ### Expo (dev client / prebuild)
38
+
39
+ Gets you the full native engine instead of the JS fallback:
40
+
41
+ ```js
42
+ // babel.config.js
43
+ module.exports = {
44
+ presets: ['babel-preset-expo'],
45
+ plugins: ['@kbach/react-native/babel-plugin'],
46
+ };
47
+ ```
48
+
49
+ ```sh
50
+ npx expo prebuild
51
+ npx expo run:android
52
+ ```
53
+
54
+ Requires the New Architecture enabled (`"newArchEnabled": true` in
55
+ `app.json`, on by default in current Expo SDKs). EAS Build works the same
56
+ way, no extra config.
66
57
 
67
- Works standalone, with zero provider — same architecture as `@kbach/react`:
58
+ ### Expo Web
59
+
60
+ Works out of the box — resolves through the same real-CSS engine
61
+ `@kbach/react` uses on the DOM, with full modifier support (`hover:`,
62
+ `focus:`, `group-hover:`, container queries, etc.), not just the
63
+ `dark:`/`active:`/responsive subset native supports.
64
+
65
+ **Static rendering (SSR) caveat:** `dark:`/responsive classes on content
66
+ that's part of the initial pre-rendered HTML resolve against the *server*,
67
+ not the visiting browser — so a user in dark mode can briefly see the light
68
+ version on first paint. Defer preference-dependent classes until mounted:
68
69
 
69
70
  ```tsx
70
- import { useGlobalDarkMode, toggleGlobalDarkMode } from '@kbach/react-native';
71
+ const [mounted, setMounted] = useState(false);
72
+ useEffect(() => setMounted(true), []);
71
73
 
72
- function ThemeToggle() {
73
- const isDark = useGlobalDarkMode();
74
- return <Pressable onPress={toggleGlobalDarkMode}><Text>{isDark ? 'Dark' : 'Light'}</Text></Pressable>;
75
- }
74
+ <View className={mounted ? 'bg-gray-1 dark:bg-gray-12' : 'bg-gray-1'} />;
76
75
  ```
77
76
 
78
- Or the optional `<ThemeProvider>` / `useTheme()` pair, reading and writing
79
- the exact same global store:
77
+ ## Dark mode
80
78
 
81
79
  ```tsx
82
- import { ThemeProvider, useTheme } from '@kbach/react-native';
80
+ import { useTheme } from '@kbach/react-native';
83
81
 
84
- function Toggle() {
82
+ function ThemeToggle() {
85
83
  const { mode, isDark, setMode, toggle } = useTheme();
86
84
  return <Pressable onPress={toggle}><Text>{mode}</Text></Pressable>;
87
85
  }
86
+ ```
87
+
88
+ Works anywhere, no provider needed. `<ThemeProvider defaultMode="dark">` is
89
+ optional, for seeding a startup default. Outside React, use
90
+ `getGlobalDarkMode()`/`toggleGlobalDarkMode()` instead.
91
+
92
+ Follows the OS setting live until overridden, and isn't persisted across
93
+ app launches (no built-in storage dependency). To persist, read your own
94
+ storage at startup and call `setGlobalThemeMode()` before your first render.
95
+
96
+ ## Reading colors as values
97
+
98
+ For anywhere you need a real color, not a `className` — a chart prop, a
99
+ native shadow color:
100
+
101
+ ```tsx
102
+ import { useColors } from '@kbach/react-native';
103
+
104
+ const colors = useColors();
105
+ colors.blue[6]; // '#2563eb' — static, same value in both modes
106
+ colors.blue['6/50']; // same, at 50% opacity
107
+ ```
108
+
109
+ Any color can be defined in the theme as a plain string (static) or a
110
+ `{ light, dark }` pair — fully manual, resolved per the current dark-mode
111
+ state:
88
112
 
89
- <ThemeProvider defaultMode="system">
90
- <Toggle />
91
- </ThemeProvider>;
113
+ ```ts
114
+ setTheme({
115
+ ...defaultTheme,
116
+ colors: { ...defaultTheme.colors, brand: { light: '#2563eb', dark: '#93c5fd' } },
117
+ });
92
118
  ```
93
119
 
94
- By default the mode follows the OS `Appearance` setting live until you
95
- explicitly override it — and **isn't persisted across app launches**.
96
- There's no React-Native-builtin equivalent of `localStorage`, and adding
97
- one would mean forcing a real native dependency (e.g.
98
- `@react-native-async-storage/async-storage`) on every consumer, even ones
99
- that don't want it. If you want persistence, read your own storage at
100
- startup and call `setGlobalThemeMode()` with the result before your first
101
- render — the same "seed once" shape `<ThemeProvider defaultMode>` itself
102
- uses internally.
120
+ A shade-family lookup (`colors.blue[n]`) auto-mirrors to shade `13 - n` in
121
+ dark mode — this palette's own convention is 1 = lightest, 12 = darkest, so
122
+ that's the same visual weight relative to its own background, no manual
123
+ `colors.blue[isDark ? 7 : 6]` needed.
103
124
 
104
125
  ## License
105
126
 
@@ -0,0 +1,36 @@
1
+ apply plugin: "com.android.library"
2
+ apply plugin: "org.jetbrains.kotlin.android"
3
+ apply plugin: "com.facebook.react"
4
+
5
+ def getExtOrDefault(name) {
6
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : null
7
+ }
8
+
9
+ android {
10
+ // NOT "com.kbachnative" — that's the app module's own namespace (Phase 5
11
+ // deliberately made the app's package match KbachModule's Kotlin package
12
+ // for simpler JNI symbol names), and AGP requires unique namespaces per
13
+ // module. This is purely a Gradle build-identity value, separate from
14
+ // the actual `package com.kbachnative` declared in the .kt files below —
15
+ // JNI symbol resolution depends on that Kotlin package, not this.
16
+ namespace "com.kbachnative.nativemodule"
17
+ compileSdkVersion getExtOrDefault("compileSdkVersion")
18
+
19
+ defaultConfig {
20
+ minSdkVersion getExtOrDefault("minSdkVersion")
21
+ targetSdkVersion getExtOrDefault("targetSdkVersion")
22
+ }
23
+ }
24
+
25
+ repositories {
26
+ google()
27
+ maven {
28
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm.
29
+ url "$rootDir/../node_modules/react-native/android"
30
+ }
31
+ mavenCentral()
32
+ }
33
+
34
+ dependencies {
35
+ implementation "com.facebook.react:react-native:+"
36
+ }
@@ -0,0 +1,14 @@
1
+ <!--
2
+ Deliberately NO `package="..."` attribute here, even though this
3
+ module's Kotlin package (com.kbachnative, see KbachModule.kt) differs
4
+ from its Gradle build.gradle `namespace` (com.kbachnative.nativemodule)
5
+ — adding one here to help React Native's autolinking guess the right
6
+ Kotlin package (see react-native.config.js at this package's root, which
7
+ fixes that instead) breaks the actual Gradle build on AGP 9+: it now
8
+ hard-errors ("Setting the namespace via the package attribute in the
9
+ source AndroidManifest.xml is no longer supported") whenever the
10
+ manifest's package doesn't match the namespace exactly. If you're
11
+ tempted to add one back to fix an autolinking symbol-resolution error,
12
+ fix react-native.config.js's packageImportPath/packageInstance instead.
13
+ -->
14
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android" />
@@ -0,0 +1,83 @@
1
+ package com.kbachnative
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+
5
+ /**
6
+ * Bridges to the same Rust core engine every other Kbach platform uses
7
+ * (packages/core-engine) — via JNI here instead of WASM. The native
8
+ * `generateCss`/`resolveStyle` externs below (in the companion object) must
9
+ * match `Java_com_kbachnative_KbachModule_generateCss`/`resolveStyle`'s
10
+ * signatures exactly (packages/core-engine/src/jni_bridge.rs): STATIC
11
+ * native methods (hence @JvmStatic in a companion object, not instance
12
+ * methods — the Rust side takes JClass, not JObject, as its second
13
+ * parameter).
14
+ *
15
+ * TurboModule since Phase 13 (was the legacy bridge's
16
+ * `isBlockingSynchronousMethod` support directly on `ReactContextBaseJavaModule`
17
+ * before) — extends the Codegen-generated `NativeKbachModuleSpec`
18
+ * (packages/react-native/specs/NativeKbachModule.ts -> this package's own
19
+ * codegenConfig in package.json, discovered via autolinking ->
20
+ * android/build/generated/source/codegen/java/com/kbachnative/NativeKbachModuleSpec.java),
21
+ * which already provides `getName()` and declares `generateCss`/`resolveStyle`
22
+ * as abstract `@ReactMethod(isBlockingSynchronousMethod = true)` methods —
23
+ * Codegen still routes a synchronously-returning TurboModule method through
24
+ * that same Android bridge mechanism; the real gain here is JSI-backed
25
+ * dispatch + build-time type checking against the JS spec, not the removal
26
+ * of `isBlockingSynchronousMethod` as a concept.
27
+ *
28
+ * The companion's JNI externs are named `nativeGenerateCss`/`nativeResolveStyle`
29
+ * — NOT the same names as the spec's `generateCss`/`resolveStyle` overrides.
30
+ * Tried keeping identical names first (disambiguated via an explicit
31
+ * `Companion.generateCss(...)` qualifier) since that would've meant zero
32
+ * Rust changes, but that fails to compile: `@JvmStatic` duplicates each
33
+ * companion function directly onto the outer class for Java-interop
34
+ * purposes, which collides at the JVM bytecode level with the identically-
35
+ * named, identically-shaped instance override ("platform declaration
36
+ * clash"), regardless of how the Kotlin-source call site is qualified. The
37
+ * rename requires matching `Java_com_kbachnative_KbachModule_nativeGenerateCss`/
38
+ * `nativeResolveStyle` `#[no_mangle]` export names in
39
+ * packages/core-engine/src/jni_bridge.rs — JNI's implicit symbol linking
40
+ * binds by the extern's own method name, not by whatever calls it.
41
+ *
42
+ * Moved here from apps/native-sandbox/android/app in Phase 13 — Android
43
+ * autolinking only discovers native modules from npm dependencies with
44
+ * their own `android/` folder, never from native code declared directly
45
+ * inside the app itself, so `KbachModule` had to become a real (locally
46
+ * `file:`-linked) package to be found by `TurboModuleRegistry.getEnforcing`.
47
+ * Originally that "real package" was a separate `@kbach/android` npm
48
+ * package; later folded directly into `@kbach/react-native` (this
49
+ * package's own `android/` folder, sibling to its `src/`) once it became
50
+ * clear the same autolinking requirement is satisfied just as well by a
51
+ * SINGLE npm package containing both JS and native code — the same layout
52
+ * react-native-safe-area-context itself uses — so consumers only ever run
53
+ * one `npm install @kbach/react-native`, not two.
54
+ */
55
+ class KbachModule(reactContext: ReactApplicationContext) : NativeKbachModuleSpec(reactContext) {
56
+
57
+ companion object {
58
+ init {
59
+ System.loadLibrary("kbach_core_engine")
60
+ }
61
+
62
+ @JvmStatic
63
+ external fun nativeGenerateCss(classString: String, themeJson: String): String
64
+
65
+ @JvmStatic
66
+ external fun nativeResolveStyle(classString: String, themeJson: String, colorScheme: String, pressed: Boolean, width: Double): String
67
+ }
68
+
69
+ override fun generateCss(classString: String, themeJson: String): String {
70
+ return nativeGenerateCss(classString, themeJson)
71
+ }
72
+
73
+ /**
74
+ * `colorScheme` ("light"/"dark", from Appearance.getColorScheme() on the
75
+ * JS side) gates whether `dark:` declarations are applied; `pressed`
76
+ * (only ever true when the caller is RN's Pressable) gates `active:`;
77
+ * `width` (the JS side's current `Dimensions.get('window').width`) gates
78
+ * `sm:`/`md:`/`lg:`/`xl:`/`2xl:` against the theme's `screens` scale.
79
+ */
80
+ override fun resolveStyle(classString: String, themeJson: String, colorScheme: String, pressed: Boolean, width: Double): String {
81
+ return nativeResolveStyle(classString, themeJson, colorScheme, pressed, width)
82
+ }
83
+ }
@@ -0,0 +1,54 @@
1
+ package com.kbachnative
2
+
3
+ import com.facebook.react.BaseReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.module.model.ReactModuleInfo
7
+ import com.facebook.react.module.model.ReactModuleInfoProvider
8
+ import com.facebook.react.uimanager.ViewManager
9
+
10
+ /**
11
+ * `BaseReactPackage` (not plain `ReactPackage`) since Phase 13's TurboModule
12
+ * migration — a plain `ReactPackage`'s `createNativeModules()`-provided
13
+ * modules stay visible to the legacy `NativeModules` interop but are never
14
+ * consulted by `TurboModuleRegistry`'s resolution path, which only walks
15
+ * packages that can answer `getModule(name, ...)` directly. Modeled on
16
+ * react-native-safe-area-context's own `SafeAreaContextPackage.kt` (a real,
17
+ * New-Architecture-compatible package already in this project's
18
+ * dependencies) rather than reflection over a `@ReactModule` annotation —
19
+ * KbachModule doesn't have one, and there's only ever this one module, so
20
+ * building its `ReactModuleInfo` directly is simpler than adding an
21
+ * annotation just to read it back via reflection.
22
+ *
23
+ * Auto-discovered via Android autolinking, not manually registered in
24
+ * apps/native-sandbox's MainApplication.kt — same as SafeAreaContextPackage
25
+ * already was, and the entire reason this module became a real npm package
26
+ * with its own `android/` folder (this one — `@kbach/react-native` itself,
27
+ * see KbachModule.kt's own doc comment) in Phase 13 rather than living
28
+ * inside the app.
29
+ */
30
+ class KbachPackage : BaseReactPackage() {
31
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
32
+ return if (name == NativeKbachModuleSpec.NAME) KbachModule(reactContext) else null
33
+ }
34
+
35
+ override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
36
+ return ReactModuleInfoProvider {
37
+ mapOf(
38
+ NativeKbachModuleSpec.NAME to
39
+ ReactModuleInfo(
40
+ NativeKbachModuleSpec.NAME,
41
+ KbachModule::class.java.name,
42
+ false, // canOverrideExistingModule
43
+ false, // needsEagerInit
44
+ false, // isCxxModule
45
+ true, // isTurboModule
46
+ )
47
+ )
48
+ }
49
+ }
50
+
51
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
52
+ return emptyList()
53
+ }
54
+ }
@@ -0,0 +1,14 @@
1
+ import {
2
+ resolveStyle
3
+ } from "./chunk-XHL653X2.mjs";
4
+ import {
5
+ createJsxFunctions
6
+ } from "./chunk-DLIXI5OW.mjs";
7
+
8
+ // src/jsx-runtime.tsx
9
+ var { jsx, jsxs } = createJsxFunctions(resolveStyle);
10
+
11
+ export {
12
+ jsx,
13
+ jsxs
14
+ };
@@ -1,15 +1,11 @@
1
- import {
2
- resolveStyle
3
- } from "./chunk-YHF3QLRL.mjs";
4
-
5
- // src/jsx-runtime.tsx
1
+ // src/jsxRuntimeCore.ts
6
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
3
  import { Fragment } from "react";
8
4
  import { Pressable } from "react-native";
9
5
  function makeElement(isStaticChildren, type, props, key) {
10
6
  return (isStaticChildren ? _jsxs : _jsx)(type, props, key);
11
7
  }
12
- function resolvedStyleFor(classStrRaw, userStyle, pressed) {
8
+ function resolvedStyleFor(resolveStyle, classStrRaw, userStyle, pressed) {
13
9
  const resolved = resolveStyle(classStrRaw, pressed);
14
10
  if (userStyle === void 0) {
15
11
  return resolved;
@@ -19,7 +15,7 @@ function resolvedStyleFor(classStrRaw, userStyle, pressed) {
19
15
  }
20
16
  return [resolved, userStyle];
21
17
  }
22
- function processElement(type, rawProps, key, isStaticChildren) {
18
+ function processElement(resolveStyle, type, rawProps, key, isStaticChildren) {
23
19
  if (type === null || typeof type === "symbol" || !rawProps) {
24
20
  return makeElement(isStaticChildren, type, rawProps ?? {}, key);
25
21
  }
@@ -27,18 +23,31 @@ function processElement(type, rawProps, key, isStaticChildren) {
27
23
  if (typeof classStrRaw !== "string") {
28
24
  return makeElement(isStaticChildren, type, rawProps, key);
29
25
  }
30
- const finalStyle = type === Pressable ? (state) => resolvedStyleFor(classStrRaw, userStyle, state.pressed) : resolvedStyleFor(classStrRaw, userStyle, false);
26
+ const finalStyle = type === Pressable ? (state) => resolvedStyleFor(resolveStyle, classStrRaw, userStyle, state.pressed) : resolvedStyleFor(resolveStyle, classStrRaw, userStyle, false);
31
27
  return makeElement(isStaticChildren, type, { ...rest, style: finalStyle }, key);
32
28
  }
33
- function jsx(type, props, key) {
34
- return processElement(type, props, key, false);
29
+ function createJsxFunctions(resolveStyle) {
30
+ function jsx(type, props, key) {
31
+ return processElement(resolveStyle, type, props, key, false);
32
+ }
33
+ function jsxs(type, props, key) {
34
+ return processElement(resolveStyle, type, props, key, true);
35
+ }
36
+ return { jsx, jsxs };
35
37
  }
36
- function jsxs(type, props, key) {
37
- return processElement(type, props, key, true);
38
+ function createJsxDEV(jsx, jsxs) {
39
+ return function jsxDEV(type, props, key, isStaticChildren, source, self) {
40
+ const element = (isStaticChildren ? jsxs : jsx)(type, props, key);
41
+ if (source && element && typeof element === "object" && Object.isExtensible(element)) {
42
+ element._source = source;
43
+ element._self = self;
44
+ }
45
+ return element;
46
+ };
38
47
  }
39
48
 
40
49
  export {
41
50
  Fragment,
42
- jsx,
43
- jsxs
51
+ createJsxFunctions,
52
+ createJsxDEV
44
53
  };