react-native-edge-to-edge 1.6.2 → 1.8.0

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 (62) hide show
  1. package/README.md +59 -20
  2. package/android/build.gradle +10 -18
  3. package/android/src/main/AndroidManifest.xml +1 -1
  4. package/android/src/main/java/com/zoontek/rnedgetoedge/EdgeToEdgeModuleImpl.kt +5 -0
  5. package/android/src/main/java/com/zoontek/rnedgetoedge/EdgeToEdgePackage.kt +0 -1
  6. package/android/src/main/res/values/public.xml +4 -0
  7. package/android/src/main/res/values/styles.xml +48 -0
  8. package/android/src/main/res/values-v27/styles.xml +20 -0
  9. package/android/src/main/res/values-v29/styles.xml +28 -0
  10. package/android/src/main/res/values-v30/styles.xml +28 -0
  11. package/app.plugin.js +2 -1
  12. package/dist/commonjs/{expo.js → extras/expo.js} +13 -6
  13. package/dist/commonjs/extras/expo.js.map +1 -0
  14. package/dist/commonjs/index.js +1 -20
  15. package/dist/commonjs/index.js.map +1 -1
  16. package/dist/commonjs/package.json +1 -0
  17. package/dist/module/{expo.js → extras/expo.js} +11 -5
  18. package/dist/module/extras/expo.js.map +1 -0
  19. package/dist/module/index.js +1 -2
  20. package/dist/module/index.js.map +1 -1
  21. package/dist/module/package.json +1 -0
  22. package/dist/typescript/{SystemBars.d.ts → commonjs/SystemBars.d.ts} +1 -1
  23. package/dist/typescript/commonjs/SystemBars.d.ts.map +1 -0
  24. package/dist/typescript/commonjs/extras/expo.d.ts +24 -0
  25. package/dist/typescript/commonjs/extras/expo.d.ts.map +1 -0
  26. package/dist/typescript/commonjs/index.d.ts +3 -0
  27. package/dist/typescript/commonjs/index.d.ts.map +1 -0
  28. package/dist/typescript/commonjs/package.json +1 -0
  29. package/dist/typescript/commonjs/specs/NativeEdgeToEdgeModule.d.ts.map +1 -0
  30. package/dist/typescript/commonjs/specs/NativeEdgeToEdgeModule.web.d.ts.map +1 -0
  31. package/dist/typescript/commonjs/types.d.ts.map +1 -0
  32. package/dist/typescript/module/SystemBars.d.ts +10 -0
  33. package/dist/typescript/module/SystemBars.d.ts.map +1 -0
  34. package/dist/typescript/module/extras/expo.d.ts +24 -0
  35. package/dist/typescript/module/extras/expo.d.ts.map +1 -0
  36. package/dist/typescript/module/index.d.ts +3 -0
  37. package/dist/typescript/module/index.d.ts.map +1 -0
  38. package/dist/typescript/module/package.json +1 -0
  39. package/dist/typescript/module/specs/NativeEdgeToEdgeModule.d.ts +11 -0
  40. package/dist/typescript/module/specs/NativeEdgeToEdgeModule.d.ts.map +1 -0
  41. package/dist/typescript/module/specs/NativeEdgeToEdgeModule.web.d.ts +3 -0
  42. package/dist/typescript/module/specs/NativeEdgeToEdgeModule.web.d.ts.map +1 -0
  43. package/dist/typescript/module/types.d.ts +17 -0
  44. package/dist/typescript/module/types.d.ts.map +1 -0
  45. package/package.json +50 -16
  46. package/src/SystemBars.ts +1 -1
  47. package/src/{expo.ts → extras/expo.ts} +41 -17
  48. package/src/index.ts +1 -1
  49. package/android/src/main/AndroidManifestNew.xml +0 -3
  50. package/dist/commonjs/expo.js.map +0 -1
  51. package/dist/module/expo.js.map +0 -1
  52. package/dist/typescript/SystemBars.d.ts.map +0 -1
  53. package/dist/typescript/expo.d.ts +0 -12
  54. package/dist/typescript/expo.d.ts.map +0 -1
  55. package/dist/typescript/index.d.ts +0 -3
  56. package/dist/typescript/index.d.ts.map +0 -1
  57. package/dist/typescript/specs/NativeEdgeToEdgeModule.d.ts.map +0 -1
  58. package/dist/typescript/specs/NativeEdgeToEdgeModule.web.d.ts.map +0 -1
  59. package/dist/typescript/types.d.ts.map +0 -1
  60. /package/dist/typescript/{specs → commonjs/specs}/NativeEdgeToEdgeModule.d.ts +0 -0
  61. /package/dist/typescript/{specs → commonjs/specs}/NativeEdgeToEdgeModule.web.d.ts +0 -0
  62. /package/dist/typescript/{types.d.ts → commonjs/types.d.ts} +0 -0
package/README.md CHANGED
@@ -2,11 +2,14 @@
2
2
 
3
3
  Effortlessly enable [edge-to-edge](https://developer.android.com/develop/ui/views/layout/edge-to-edge) display in React Native, allowing your Android (v6 and above) app content to flow seamlessly beneath the system bars.
4
4
 
5
+ > [!TIP]
6
+ > If you're running React Native 0.81 or later, consider using the built-in `edgeToEdgeEnabled=true` Gradle property along with [`@zoontek/react-native-navigation-bar`](https://github.com/zoontek/react-native-navigation-bar) instead.
7
+
5
8
  [![mit licence](https://img.shields.io/dub/l/vibe-d.svg?style=for-the-badge)](https://github.com/zoontek/react-native-edge-to-edge/blob/main/LICENSE)
6
9
  [![npm version](https://img.shields.io/npm/v/react-native-edge-to-edge?style=for-the-badge)](https://www.npmjs.org/package/react-native-edge-to-edge)
7
10
  [![npm downloads](https://img.shields.io/npm/dt/react-native-edge-to-edge.svg?label=downloads&style=for-the-badge)](https://www.npmjs.org/package/react-native-edge-to-edge)
8
11
 
9
- <img width="240" src="./docs/logo.svg" alt="Logo">
12
+ <img width="210" src="./docs/logo.svg" alt="Logo">
10
13
 
11
14
  ## Credits
12
15
 
@@ -47,39 +50,71 @@ $ yarn add react-native-edge-to-edge
47
50
 
48
51
  This library requires you to update the parent of your Android `AppTheme` to an edge-to-edge version. Don't worry, it's very easy to understand! You just need to choose a theme based on the current value:
49
52
 
50
- | If you currently have… | …you should use |
51
- | :--------------------------------------------------- | :----------------------------------------- |
52
- | `Theme.AppCompat.DayNight.NoActionBar` | `Theme.EdgeToEdge` |
53
- | `Theme.MaterialComponents.DayNight.NoActionBar` | `Theme.EdgeToEdge.Material2` |
54
- | `Theme.Material3.DayNight.NoActionBar` | `Theme.EdgeToEdge.Material3` |
55
- | `Theme.Material3.DynamicColors.DayNight.NoActionBar` | `Theme.EdgeToEdge.Material3.Dynamic` |
56
- | `Theme.AppCompat.Light.NoActionBar` | `Theme.EdgeToEdge.Light` |
57
- | `Theme.MaterialComponents.Light.NoActionBar` | `Theme.EdgeToEdge.Material2.Light` |
58
- | `Theme.Material3.Light.NoActionBar` | `Theme.EdgeToEdge.Material3.Light` |
59
- | `Theme.Material3.DynamicColors.Light.NoActionBar` | `Theme.EdgeToEdge.Material3.Dynamic.Light` |
53
+ | If you currently have… | …you should use |
54
+ | :------------------------------------------------------------- | :--------------------------------------------------- |
55
+ | `Theme.AppCompat.DayNight.NoActionBar` | `Theme.EdgeToEdge` |
56
+ | `Theme.MaterialComponents.DayNight.NoActionBar` | `Theme.EdgeToEdge.Material2` |
57
+ | `Theme.Material3.DayNight.NoActionBar` | `Theme.EdgeToEdge.Material3` |
58
+ | `Theme.Material3.DynamicColors.DayNight.NoActionBar` | `Theme.EdgeToEdge.Material3.Dynamic` |
59
+ | `Theme.Material3Expressive.DayNight.NoActionBar` | `Theme.EdgeToEdge.Material3Expressive` |
60
+ | `Theme.Material3Expressive.DynamicColors.DayNight.NoActionBar` | `Theme.EdgeToEdge.Material3Expressive.Dynamic` |
61
+ | `Theme.AppCompat.Light.NoActionBar` | `Theme.EdgeToEdge.Light` |
62
+ | `Theme.MaterialComponents.Light.NoActionBar` | `Theme.EdgeToEdge.Material2.Light` |
63
+ | `Theme.Material3.Light.NoActionBar` | `Theme.EdgeToEdge.Material3.Light` |
64
+ | `Theme.Material3.DynamicColors.Light.NoActionBar` | `Theme.EdgeToEdge.Material3.Dynamic.Light` |
65
+ | `Theme.Material3Expressive.Light.NoActionBar` | `Theme.EdgeToEdge.Material3Expressive.Light` |
66
+ | `Theme.Material3Expressive.DynamicColors.Light.NoActionBar` | `Theme.EdgeToEdge.Material3Expressive.Dynamic.Light` |
60
67
 
61
68
  ### Expo
62
69
 
63
- Add the library plugin in your `app.json` config file and [create a new build](https://docs.expo.dev/develop/development-builds/create-a-build) 👷:
70
+ Add the library plugin in your app config file and [create a new build](https://docs.expo.dev/develop/development-builds/create-a-build) 👷:
71
+
72
+ <details open>
73
+ <summary><strong>Dynamic configuration (app.config.js, app.config.ts)</strong></summary>
74
+
75
+ ```ts
76
+ import type { ConfigContext, ExpoConfig } from "expo/config";
77
+ import edgeToEdge from "react-native-edge-to-edge/expo"; // use `require` in app.config.js
78
+
79
+ export default ({ config }: ConfigContext): ExpoConfig => ({
80
+ // …
81
+ plugins: [
82
+ edgeToEdge({
83
+ android: {
84
+ parentTheme: "Default",
85
+ enforceNavigationBarContrast: false,
86
+ },
87
+ }),
88
+ ],
89
+ });
90
+ ```
91
+
92
+ </details>
64
93
 
65
- ```json
94
+ <details>
95
+ <summary><strong>Static configuration (app.json)</strong></summary>
96
+
97
+ ```jsonc
66
98
  {
67
99
  "expo": {
100
+ // …
68
101
  "plugins": [
69
102
  [
70
103
  "react-native-edge-to-edge",
71
104
  {
72
105
  "android": {
73
106
  "parentTheme": "Default",
74
- "enforceNavigationBarContrast": false
75
- }
76
- }
77
- ]
78
- ]
79
- }
107
+ "enforceNavigationBarContrast": false,
108
+ },
109
+ },
110
+ ],
111
+ ],
112
+ },
80
113
  }
81
114
  ```
82
115
 
116
+ </details>
117
+
83
118
  _📌 The available plugins options are:_
84
119
 
85
120
  ```ts
@@ -88,10 +123,14 @@ type ParentTheme =
88
123
  | "Material2" // uses `Theme.EdgeToEdge.Material2`
89
124
  | "Material3" // uses `Theme.EdgeToEdge.Material3`
90
125
  | "Material3.Dynamic" // uses `Theme.EdgeToEdge.Material3.Dynamic`
126
+ | "Material3Expressive" // uses `Theme.EdgeToEdge.Material3Expressive`
127
+ | "Material3Expressive.Dynamic" // uses `Theme.EdgeToEdge.Material3Expressive.Dynamic`
91
128
  | "Light" // uses `Theme.EdgeToEdge.Light`
92
129
  | "Material2.Light" // uses `Theme.EdgeToEdge.Material2.Light`
93
130
  | "Material3.Light" // uses `Theme.EdgeToEdge.Material3.Light`
94
- | "Material3.Dynamic.Light"; // uses `Theme.EdgeToEdge.Material3.Dynamic.Light`
131
+ | "Material3.Dynamic.Light" // uses `Theme.EdgeToEdge.Material3.Dynamic.Light`
132
+ | "Material3Expressive.Light" // uses `Theme.EdgeToEdge.Material3Expressive.Light`
133
+ | "Material3Expressive.Dynamic.Light"; // uses `Theme.EdgeToEdge.Material3Expressive.Dynamic.Light`
95
134
 
96
135
  type Options = {
97
136
  android?: {
@@ -7,8 +7,8 @@ buildscript {
7
7
  gradlePluginPortal()
8
8
  }
9
9
  dependencies {
10
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet("kotlinVersion", "1.8.0")}")
11
- classpath("com.android.tools.build:gradle:8.1.1")
10
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet("kotlinVersion", "1.9.24")}")
11
+ classpath("com.android.tools.build:gradle:8.13.0")
12
12
  }
13
13
  }
14
14
 
@@ -24,25 +24,18 @@ if (isNewArchitectureEnabled()) {
24
24
  }
25
25
 
26
26
  android {
27
- buildToolsVersion safeExtGet("buildToolsVersion", "34.0.0")
28
- compileSdkVersion safeExtGet("compileSdkVersion", 34)
27
+ namespace "com.zoontek.rnedgetoedge"
29
28
 
30
- if (project.android.hasProperty("namespace")) {
31
- namespace "com.zoontek.rnedgetoedge"
29
+ buildToolsVersion safeExtGet("buildToolsVersion", "35.0.0")
30
+ compileSdkVersion safeExtGet("compileSdkVersion", 35)
32
31
 
33
- buildFeatures {
34
- buildConfig true
35
- }
36
- sourceSets {
37
- main {
38
- manifest.srcFile "src/main/AndroidManifestNew.xml"
39
- }
40
- }
32
+ buildFeatures {
33
+ buildConfig true
41
34
  }
42
35
  defaultConfig {
43
36
  buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
44
- minSdkVersion safeExtGet("minSdkVersion", 23)
45
- targetSdkVersion safeExtGet("targetSdkVersion", 34)
37
+ minSdkVersion safeExtGet("minSdkVersion", 24)
38
+ targetSdkVersion safeExtGet("targetSdkVersion", 35)
46
39
  }
47
40
  lintOptions {
48
41
  abortOnError false
@@ -63,12 +56,11 @@ repositories {
63
56
  // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
64
57
  url("$rootDir/../node_modules/react-native/android")
65
58
  }
66
- mavenCentral()
67
59
  google()
60
+ mavenCentral()
68
61
  }
69
62
 
70
63
  dependencies {
71
64
  //noinspection GradleDynamicVersion
72
65
  implementation "com.facebook.react:react-native:+" // From node_modules
73
- implementation "com.google.android.material:material:${safeExtGet("materialVersion", "1.12.0")}"
74
66
  }
@@ -1,3 +1,3 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.zoontek.rnedgetoedge">
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
3
  </manifest>
@@ -73,6 +73,11 @@ object EdgeToEdgeModuleImpl {
73
73
 
74
74
  window.statusBarColor = Color.TRANSPARENT
75
75
 
76
+ // Fix https://github.com/zoontek/react-native-edge-to-edge/issues/105
77
+ if (VERSION.SDK_INT <= VERSION_CODES.O_MR1) {
78
+ window.decorView.setOnSystemUiVisibilityChangeListener { initInsetsController(window) }
79
+ }
80
+
76
81
  if (VERSION.SDK_INT >= VERSION_CODES.O_MR1 && isNavigationBarTransparent(activity)) {
77
82
  window.navigationBarColor = Color.TRANSPARENT
78
83
 
@@ -23,7 +23,6 @@ class EdgeToEdgePackage : BaseReactPackage() {
23
23
  EdgeToEdgeModuleImpl.NAME,
24
24
  false,
25
25
  true,
26
- true,
27
26
  false,
28
27
  isTurboModule
29
28
  )
@@ -6,9 +6,13 @@
6
6
  <public name="Theme.EdgeToEdge.Material2" type="style" />
7
7
  <public name="Theme.EdgeToEdge.Material3" type="style" />
8
8
  <public name="Theme.EdgeToEdge.Material3.Dynamic" type="style" />
9
+ <public name="Theme.EdgeToEdge.Material3Expressive" type="style" />
10
+ <public name="Theme.EdgeToEdge.Material3Expressive.Dynamic" type="style" />
9
11
 
10
12
  <public name="Theme.EdgeToEdge.Light" type="style" />
11
13
  <public name="Theme.EdgeToEdge.Material2.Light" type="style" />
12
14
  <public name="Theme.EdgeToEdge.Material3.Light" type="style" />
13
15
  <public name="Theme.EdgeToEdge.Material3.Dynamic.Light" type="style" />
16
+ <public name="Theme.EdgeToEdge.Material3Expressive.Light" type="style" />
17
+ <public name="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light" type="style" />
14
18
  </resources>
@@ -44,6 +44,28 @@
44
44
  <item name="android:windowLightStatusBar">@bool/windowLightSystemBars</item>
45
45
  </style>
46
46
 
47
+ <style name="Theme.EdgeToEdge.Material3Expressive.DayNight.Common" parent="Theme.Material3Expressive.DayNight.NoActionBar">
48
+ <item name="enforceNavigationBarContrast">true</item>
49
+ <item name="enforceSystemBarsLightTheme">false</item>
50
+
51
+ <item name="android:windowDrawsSystemBarBackgrounds">true</item>
52
+ <item name="android:fitsSystemWindows">false</item>
53
+ <item name="android:navigationBarColor">@color/navigationBarColor</item>
54
+ <item name="android:statusBarColor">@android:color/transparent</item>
55
+ <item name="android:windowLightStatusBar">@bool/windowLightSystemBars</item>
56
+ </style>
57
+
58
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic.DayNight.Common" parent="Theme.Material3Expressive.DynamicColors.DayNight.NoActionBar">
59
+ <item name="enforceNavigationBarContrast">true</item>
60
+ <item name="enforceSystemBarsLightTheme">false</item>
61
+
62
+ <item name="android:windowDrawsSystemBarBackgrounds">true</item>
63
+ <item name="android:fitsSystemWindows">false</item>
64
+ <item name="android:navigationBarColor">@color/navigationBarColor</item>
65
+ <item name="android:statusBarColor">@android:color/transparent</item>
66
+ <item name="android:windowLightStatusBar">@bool/windowLightSystemBars</item>
67
+ </style>
68
+
47
69
  <style name="Theme.EdgeToEdge.Light.Common" parent="Theme.AppCompat.Light.NoActionBar">
48
70
  <item name="enforceNavigationBarContrast">true</item>
49
71
  <item name="enforceSystemBarsLightTheme">true</item>
@@ -88,13 +110,39 @@
88
110
  <item name="android:windowLightStatusBar">true</item>
89
111
  </style>
90
112
 
113
+ <style name="Theme.EdgeToEdge.Material3Expressive.Light.Common" parent="Theme.Material3Expressive.Light.NoActionBar">
114
+ <item name="enforceNavigationBarContrast">true</item>
115
+ <item name="enforceSystemBarsLightTheme">false</item>
116
+
117
+ <item name="android:windowDrawsSystemBarBackgrounds">true</item>
118
+ <item name="android:fitsSystemWindows">false</item>
119
+ <item name="android:navigationBarColor">@color/navigationBarColor</item>
120
+ <item name="android:statusBarColor">@android:color/transparent</item>
121
+ <item name="android:windowLightStatusBar">@bool/windowLightSystemBars</item>
122
+ </style>
123
+
124
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light.Common" parent="Theme.Material3Expressive.DynamicColors.Light.NoActionBar">
125
+ <item name="enforceNavigationBarContrast">true</item>
126
+ <item name="enforceSystemBarsLightTheme">false</item>
127
+
128
+ <item name="android:windowDrawsSystemBarBackgrounds">true</item>
129
+ <item name="android:fitsSystemWindows">false</item>
130
+ <item name="android:navigationBarColor">@color/navigationBarColor</item>
131
+ <item name="android:statusBarColor">@android:color/transparent</item>
132
+ <item name="android:windowLightStatusBar">@bool/windowLightSystemBars</item>
133
+ </style>
134
+
91
135
  <style name="Theme.EdgeToEdge" parent="Theme.EdgeToEdge.DayNight.Common" />
92
136
  <style name="Theme.EdgeToEdge.Material2" parent="Theme.EdgeToEdge.Material2.DayNight.Common" />
93
137
  <style name="Theme.EdgeToEdge.Material3" parent="Theme.EdgeToEdge.Material3.DayNight.Common" />
94
138
  <style name="Theme.EdgeToEdge.Material3.Dynamic" parent="Theme.EdgeToEdge.Material3.Dynamic.DayNight.Common" />
139
+ <style name="Theme.EdgeToEdge.Material3Expressive" parent="Theme.EdgeToEdge.Material3Expressive.DayNight.Common" />
140
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic" parent="Theme.EdgeToEdge.Material3Expressive.Dynamic.DayNight.Common" />
95
141
 
96
142
  <style name="Theme.EdgeToEdge.Light" parent="Theme.EdgeToEdge.Light.Common" />
97
143
  <style name="Theme.EdgeToEdge.Material2.Light" parent="Theme.EdgeToEdge.Material2.Light.Common" />
98
144
  <style name="Theme.EdgeToEdge.Material3.Light" parent="Theme.EdgeToEdge.Material3.Light.Common" />
99
145
  <style name="Theme.EdgeToEdge.Material3.Dynamic.Light" parent="Theme.EdgeToEdge.Material3.Dynamic.Light.Common" />
146
+ <style name="Theme.EdgeToEdge.Material3Expressive.Light" parent="Theme.EdgeToEdge.Material3Expressive.Light.Common" />
147
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light" parent="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light.Common" />
100
148
  </resources>
@@ -20,6 +20,16 @@
20
20
  <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
21
21
  </style>
22
22
 
23
+ <style name="Theme.EdgeToEdge.Material3Expressive" parent="Theme.EdgeToEdge.Material3Expressive.DayNight.Common">
24
+ <item name="android:windowLightNavigationBar">@bool/windowLightSystemBars</item>
25
+ <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
26
+ </style>
27
+
28
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic" parent="Theme.EdgeToEdge.Material3Expressive.Dynamic.DayNight.Common">
29
+ <item name="android:windowLightNavigationBar">@bool/windowLightSystemBars</item>
30
+ <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
31
+ </style>
32
+
23
33
  <style name="Theme.EdgeToEdge.Light" parent="Theme.EdgeToEdge.Light.Common">
24
34
  <item name="android:windowLightNavigationBar">true</item>
25
35
  <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
@@ -39,4 +49,14 @@
39
49
  <item name="android:windowLightNavigationBar">true</item>
40
50
  <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
41
51
  </style>
52
+
53
+ <style name="Theme.EdgeToEdge.Material3Expressive.Light" parent="Theme.EdgeToEdge.Material3Expressive.Light.Common">
54
+ <item name="android:windowLightNavigationBar">true</item>
55
+ <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
56
+ </style>
57
+
58
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light" parent="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light.Common">
59
+ <item name="android:windowLightNavigationBar">true</item>
60
+ <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
61
+ </style>
42
62
  </resources>
@@ -28,6 +28,20 @@
28
28
  <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
29
29
  </style>
30
30
 
31
+ <style name="Theme.EdgeToEdge.Material3Expressive" parent="Theme.EdgeToEdge.Material3Expressive.DayNight.Common">
32
+ <item name="android:windowLightNavigationBar">@bool/windowLightSystemBars</item>
33
+ <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
34
+ <item name="android:enforceStatusBarContrast">false</item>
35
+ <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
36
+ </style>
37
+
38
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic" parent="Theme.EdgeToEdge.Material3Expressive.Dynamic.DayNight.Common">
39
+ <item name="android:windowLightNavigationBar">@bool/windowLightSystemBars</item>
40
+ <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
41
+ <item name="android:enforceStatusBarContrast">false</item>
42
+ <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
43
+ </style>
44
+
31
45
  <style name="Theme.EdgeToEdge.Light" parent="Theme.EdgeToEdge.Light.Common">
32
46
  <item name="android:windowLightNavigationBar">true</item>
33
47
  <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
@@ -55,4 +69,18 @@
55
69
  <item name="android:enforceStatusBarContrast">false</item>
56
70
  <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
57
71
  </style>
72
+
73
+ <style name="Theme.EdgeToEdge.Material3Expressive.Light" parent="Theme.EdgeToEdge.Material3Expressive.Light.Common">
74
+ <item name="android:windowLightNavigationBar">true</item>
75
+ <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
76
+ <item name="android:enforceStatusBarContrast">false</item>
77
+ <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
78
+ </style>
79
+
80
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light" parent="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light.Common">
81
+ <item name="android:windowLightNavigationBar">true</item>
82
+ <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
83
+ <item name="android:enforceStatusBarContrast">false</item>
84
+ <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
85
+ </style>
58
86
  </resources>
@@ -28,6 +28,20 @@
28
28
  <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
29
29
  </style>
30
30
 
31
+ <style name="Theme.EdgeToEdge.Material3Expressive" parent="Theme.EdgeToEdge.Material3Expressive.DayNight.Common">
32
+ <item name="android:windowLightNavigationBar">@bool/windowLightSystemBars</item>
33
+ <item name="android:windowLayoutInDisplayCutoutMode">always</item>
34
+ <item name="android:enforceStatusBarContrast">false</item>
35
+ <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
36
+ </style>
37
+
38
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic" parent="Theme.EdgeToEdge.Material3Expressive.Dynamic.DayNight.Common">
39
+ <item name="android:windowLightNavigationBar">@bool/windowLightSystemBars</item>
40
+ <item name="android:windowLayoutInDisplayCutoutMode">always</item>
41
+ <item name="android:enforceStatusBarContrast">false</item>
42
+ <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
43
+ </style>
44
+
31
45
  <style name="Theme.EdgeToEdge.Light" parent="Theme.EdgeToEdge.Light.Common">
32
46
  <item name="android:windowLightNavigationBar">true</item>
33
47
  <item name="android:windowLayoutInDisplayCutoutMode">always</item>
@@ -55,4 +69,18 @@
55
69
  <item name="android:enforceStatusBarContrast">false</item>
56
70
  <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
57
71
  </style>
72
+
73
+ <style name="Theme.EdgeToEdge.Material3Expressive.Light" parent="Theme.EdgeToEdge.Material3Expressive.Light.Common">
74
+ <item name="android:windowLightNavigationBar">true</item>
75
+ <item name="android:windowLayoutInDisplayCutoutMode">always</item>
76
+ <item name="android:enforceStatusBarContrast">false</item>
77
+ <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
78
+ </style>
79
+
80
+ <style name="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light" parent="Theme.EdgeToEdge.Material3Expressive.Dynamic.Light.Common">
81
+ <item name="android:windowLightNavigationBar">true</item>
82
+ <item name="android:windowLayoutInDisplayCutoutMode">always</item>
83
+ <item name="android:enforceStatusBarContrast">false</item>
84
+ <item name="android:enforceNavigationBarContrast">?enforceNavigationBarContrast</item>
85
+ </style>
58
86
  </resources>
package/app.plugin.js CHANGED
@@ -1 +1,2 @@
1
- module.exports = require("./dist/commonjs/expo");
1
+ const { withEdgeToEdge } = require("./dist/commonjs/extras/expo");
2
+ module.exports = withEdgeToEdge;
@@ -3,21 +3,25 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.withEdgeToEdge = exports.default = void 0;
7
7
  var _configPlugins = require("@expo/config-plugins");
8
- const withAndroidEdgeToEdgeTheme = (config, props = {}) => {
8
+ const plugin = (expoConfig, pluginConfig = {}) => {
9
9
  const themes = {
10
10
  Default: "Theme.EdgeToEdge",
11
11
  Material2: "Theme.EdgeToEdge.Material2",
12
12
  Material3: "Theme.EdgeToEdge.Material3",
13
13
  "Material3.Dynamic": "Theme.EdgeToEdge.Material3.Dynamic",
14
+ Material3Expressive: "Theme.EdgeToEdge.Material3Expressive",
15
+ "Material3Expressive.Dynamic": "Theme.EdgeToEdge.Material3Expressive.Dynamic",
14
16
  Light: "Theme.EdgeToEdge.Light",
15
17
  "Material2.Light": "Theme.EdgeToEdge.Material2.Light",
16
18
  "Material3.Light": "Theme.EdgeToEdge.Material3.Light",
17
- "Material3.Dynamic.Light": "Theme.EdgeToEdge.Material3.Dynamic.Light"
19
+ "Material3.Dynamic.Light": "Theme.EdgeToEdge.Material3.Dynamic.Light",
20
+ "Material3Expressive.Light": "Theme.EdgeToEdge.Material3Expressive.Light",
21
+ "Material3Expressive.Dynamic.Light": "Theme.EdgeToEdge.Material3Expressive.Dynamic.Light"
18
22
  };
19
23
  const cleanupList = new Set(["enforceNavigationBarContrast", "android:enforceNavigationBarContrast", "android:enforceStatusBarContrast", "android:fitsSystemWindows", "android:navigationBarColor", "android:statusBarColor", "android:windowDrawsSystemBarBackgrounds", "android:windowLayoutInDisplayCutoutMode", "android:windowLightNavigationBar", "android:windowLightStatusBar", "android:windowTranslucentNavigation", "android:windowTranslucentStatus"]);
20
- return (0, _configPlugins.withAndroidStyles)(config, config => {
24
+ return (0, _configPlugins.withAndroidStyles)(expoConfig, config => {
21
25
  const {
22
26
  androidNavigationBar = {},
23
27
  androidStatusBar = {},
@@ -31,7 +35,7 @@ const withAndroidEdgeToEdgeTheme = (config, props = {}) => {
31
35
  } = androidStatusBar;
32
36
  const {
33
37
  android = {}
34
- } = props;
38
+ } = pluginConfig;
35
39
  const {
36
40
  enforceNavigationBarContrast,
37
41
  parentTheme = "Default"
@@ -86,5 +90,8 @@ const withAndroidEdgeToEdgeTheme = (config, props = {}) => {
86
90
  return config;
87
91
  });
88
92
  };
89
- var _default = exports.default = (0, _configPlugins.createRunOncePlugin)(withAndroidEdgeToEdgeTheme, "react-native-edge-to-edge");
93
+ const PACKAGE_NAME = "react-native-edge-to-edge";
94
+ const withEdgeToEdge = exports.withEdgeToEdge = (0, _configPlugins.createRunOncePlugin)(plugin, PACKAGE_NAME);
95
+ var _default = config => [PACKAGE_NAME, config];
96
+ exports.default = _default;
90
97
  //# sourceMappingURL=expo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_configPlugins","require","plugin","expoConfig","pluginConfig","themes","Default","Material2","Material3","Material3Expressive","Light","cleanupList","Set","withAndroidStyles","config","androidNavigationBar","androidStatusBar","userInterfaceStyle","barStyle","navigationBarStyle","statusBarStyle","android","enforceNavigationBarContrast","parentTheme","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String","PACKAGE_NAME","withEdgeToEdge","exports","createRunOncePlugin","_default","default"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EAAE;YAC7CS,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;cACdN,CAAC,EAAE;gBAAEC,IAAI,EAAE;cAAmC,CAAC;cAC/CM,CAAC,EAAEC,MAAM,CAACjB,kBAAkB,KAAK,OAAO;YAC1C,CAAC,CAAC;UACJ;UAEAO,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;YACdN,CAAC,EAAE;cAAEC,IAAI,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAAC,KAAK;UACjB,CAAC,CAAC;QACJ;MACF;MAEA,OAAOV,KAAK;IACd,CACF,CAAC;IAED,OAAOZ,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAED,MAAMuB,YAAY,GAAG,2BAA2B;AAEzC,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,kCAAmB,EAACtC,MAAM,EAAEmC,YAAY,CAAC;AAAC,IAAAI,QAAA,GAGtE3B,MAA8B,IACoB,CAACuB,YAAY,EAAEvB,MAAM,CAAC;AAAAyB,OAAA,CAAAG,OAAA,GAAAD,QAAA","ignoreList":[]}
@@ -3,30 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "SystemBarStyle", {
7
- enumerable: true,
8
- get: function () {
9
- return _types.SystemBarStyle;
10
- }
11
- });
12
6
  Object.defineProperty(exports, "SystemBars", {
13
7
  enumerable: true,
14
8
  get: function () {
15
9
  return _SystemBars.SystemBars;
16
10
  }
17
11
  });
18
- Object.defineProperty(exports, "SystemBarsEntry", {
19
- enumerable: true,
20
- get: function () {
21
- return _types.SystemBarsEntry;
22
- }
23
- });
24
- Object.defineProperty(exports, "SystemBarsProps", {
25
- enumerable: true,
26
- get: function () {
27
- return _types.SystemBarsProps;
28
- }
29
- });
30
- var _SystemBars = require("./SystemBars");
31
- var _types = require("./types");
12
+ var _SystemBars = require("./SystemBars.js");
32
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_SystemBars","require","_types"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_SystemBars","require"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -1,19 +1,23 @@
1
1
  "use strict";
2
2
 
3
3
  import { createRunOncePlugin, withAndroidStyles } from "@expo/config-plugins";
4
- const withAndroidEdgeToEdgeTheme = (config, props = {}) => {
4
+ const plugin = (expoConfig, pluginConfig = {}) => {
5
5
  const themes = {
6
6
  Default: "Theme.EdgeToEdge",
7
7
  Material2: "Theme.EdgeToEdge.Material2",
8
8
  Material3: "Theme.EdgeToEdge.Material3",
9
9
  "Material3.Dynamic": "Theme.EdgeToEdge.Material3.Dynamic",
10
+ Material3Expressive: "Theme.EdgeToEdge.Material3Expressive",
11
+ "Material3Expressive.Dynamic": "Theme.EdgeToEdge.Material3Expressive.Dynamic",
10
12
  Light: "Theme.EdgeToEdge.Light",
11
13
  "Material2.Light": "Theme.EdgeToEdge.Material2.Light",
12
14
  "Material3.Light": "Theme.EdgeToEdge.Material3.Light",
13
- "Material3.Dynamic.Light": "Theme.EdgeToEdge.Material3.Dynamic.Light"
15
+ "Material3.Dynamic.Light": "Theme.EdgeToEdge.Material3.Dynamic.Light",
16
+ "Material3Expressive.Light": "Theme.EdgeToEdge.Material3Expressive.Light",
17
+ "Material3Expressive.Dynamic.Light": "Theme.EdgeToEdge.Material3Expressive.Dynamic.Light"
14
18
  };
15
19
  const cleanupList = new Set(["enforceNavigationBarContrast", "android:enforceNavigationBarContrast", "android:enforceStatusBarContrast", "android:fitsSystemWindows", "android:navigationBarColor", "android:statusBarColor", "android:windowDrawsSystemBarBackgrounds", "android:windowLayoutInDisplayCutoutMode", "android:windowLightNavigationBar", "android:windowLightStatusBar", "android:windowTranslucentNavigation", "android:windowTranslucentStatus"]);
16
- return withAndroidStyles(config, config => {
20
+ return withAndroidStyles(expoConfig, config => {
17
21
  const {
18
22
  androidNavigationBar = {},
19
23
  androidStatusBar = {},
@@ -27,7 +31,7 @@ const withAndroidEdgeToEdgeTheme = (config, props = {}) => {
27
31
  } = androidStatusBar;
28
32
  const {
29
33
  android = {}
30
- } = props;
34
+ } = pluginConfig;
31
35
  const {
32
36
  enforceNavigationBarContrast,
33
37
  parentTheme = "Default"
@@ -82,5 +86,7 @@ const withAndroidEdgeToEdgeTheme = (config, props = {}) => {
82
86
  return config;
83
87
  });
84
88
  };
85
- export default createRunOncePlugin(withAndroidEdgeToEdgeTheme, "react-native-edge-to-edge");
89
+ const PACKAGE_NAME = "react-native-edge-to-edge";
90
+ export const withEdgeToEdge = createRunOncePlugin(plugin, PACKAGE_NAME);
91
+ export default config => [PACKAGE_NAME, config];
86
92
  //# sourceMappingURL=expo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createRunOncePlugin","withAndroidStyles","plugin","expoConfig","pluginConfig","themes","Default","Material2","Material3","Material3Expressive","Light","cleanupList","Set","config","androidNavigationBar","androidStatusBar","userInterfaceStyle","barStyle","navigationBarStyle","statusBarStyle","android","enforceNavigationBarContrast","parentTheme","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String","PACKAGE_NAME","withEdgeToEdge"],"sourceRoot":"../../../src","sources":["extras/expo.ts"],"mappings":";;AAAA,SAEEA,mBAAmB,EACnBC,iBAAiB,QACZ,sBAAsB;AAkC7B,MAAMC,MAAwD,GAAGA,CAC/DC,UAAU,EACVC,YAAY,GAAG,CAAC,CAAC,KACd;EACH,MAAMC,MAAmC,GAAG;IAC1CC,OAAO,EAAE,kBAAkB;IAC3BC,SAAS,EAAE,4BAA4B;IACvCC,SAAS,EAAE,4BAA4B;IACvC,mB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,CAAC,EAAEC,MAAM,CAAC,KAAK;UACjB,CAAC,CAAC;QACJ;MACF;MAEA,OAAOV,KAAK;IACd,CACF,CAAC;IAED,OAAOZ,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAED,MAAMuB,YAAY,GAAG,2BAA2B;AAEhD,OAAO,MAAMC,cAAc,GAAGrC,mBAAmB,CAACE,MAAM,EAAEkC,YAAY,CAAC;AAEvE,eACEvB,MAA8B,IACoB,CAACuB,YAAY,EAAEvB,MAAM,CAAC","ignoreList":[]}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
2
 
3
- export { SystemBars } from "./SystemBars";
4
- export { SystemBarStyle, SystemBarsEntry, SystemBarsProps } from "./types";
3
+ export { SystemBars } from "./SystemBars.js";
5
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SystemBars","SystemBarStyle","SystemBarsEntry","SystemBarsProps"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,cAAc,EAAEC,eAAe,EAAEC,eAAe,QAAQ,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["SystemBars"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,iBAAc","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -1,4 +1,4 @@
1
- import { SystemBarsEntry, SystemBarsProps } from "./types";
1
+ import type { SystemBarsEntry, SystemBarsProps } from "./types";
2
2
  export declare function SystemBars(props: SystemBarsProps): null;
3
3
  export declare namespace SystemBars {
4
4
  var pushStackEntry: (props: SystemBarsProps) => SystemBarsEntry;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SystemBars.d.ts","sourceRoot":"","sources":["../../../src/SystemBars.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AA6PhF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,QAmDhD;yBAnDe,UAAU;gCA1EK,eAAe,KAAG,eAAe;+BAYlC,eAAe,KAAG,IAAI;mCAe3C,eAAe,SACf,eAAe,KACrB,eAAe;0BAeO,eAAe,CAAC,OAAO,CAAC;4BAmBtB,eAAe,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type ConfigPlugin } from "@expo/config-plugins";
2
+ type ParentTheme = "Default" | "Material2" | "Material3" | "Material3.Dynamic" | "Material3Expressive" | "Material3Expressive.Dynamic" | "Light" | "Material2.Light" | "Material3.Light" | "Material3.Dynamic.Light" | "Material3Expressive.Light" | "Material3Expressive.Dynamic.Light";
3
+ type EdgeToEdgePluginConfig = {
4
+ android?: {
5
+ /**
6
+ * Enforce a contrasting background on the navigation bar.
7
+ * Set to `false` to enforce full transparency in all cases (you will then
8
+ * need to manage the navigation bar style using `SystemBars`).
9
+ * @default true
10
+ */
11
+ enforceNavigationBarContrast?: boolean;
12
+ /**
13
+ * The parent theme for the Android `AppTheme`. Choose based on your
14
+ * current theme.
15
+ * @default "Default"
16
+ */
17
+ parentTheme?: ParentTheme;
18
+ };
19
+ };
20
+ declare const PACKAGE_NAME = "react-native-edge-to-edge";
21
+ export declare const withEdgeToEdge: ConfigPlugin<EdgeToEdgePluginConfig | undefined>;
22
+ declare const _default: (config: EdgeToEdgePluginConfig) => [typeof PACKAGE_NAME, EdgeToEdgePluginConfig];
23
+ export default _default;
24
+ //# sourceMappingURL=expo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../../../src/extras/expo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,sBAAsB,CAAC;AAE9B,KAAK,WAAW,GACZ,SAAS,GACT,WAAW,GACX,WAAW,GACX,mBAAmB,GACnB,qBAAqB,GACrB,6BAA6B,GAC7B,OAAO,GACP,iBAAiB,GACjB,iBAAiB,GACjB,yBAAyB,GACzB,2BAA2B,GAC3B,mCAAmC,CAAC;AAExC,KAAK,sBAAsB,GAAG;IAC5B,OAAO,CAAC,EAAE;QACR;;;;;WAKG;QACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC;;;;WAIG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC;KAC3B,CAAC;CACH,CAAC;AAsGF,QAAA,MAAM,YAAY,8BAA8B,CAAC;AAEjD,eAAO,MAAM,cAAc,kDAA4C,CAAC;yBAGtE,QAAQ,sBAAsB,KAC7B,CAAC,OAAO,YAAY,EAAE,sBAAsB,CAAC;AAFhD,wBAE2E"}
@@ -0,0 +1,3 @@
1
+ export { SystemBars } from "./SystemBars";
2
+ export type { SystemBarStyle, SystemBarsEntry, SystemBarsProps } from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeEdgeToEdgeModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeEdgeToEdgeModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,UAAU,IAAK,SAAQ,WAAW;IAChC,mBAAmB,IAAI,IAAI,CAAC;IAC5B,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,YAAY,aAGR,CAAC;AAQX,eAAe,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeEdgeToEdgeModule.web.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeEdgeToEdgeModule.web.ts"],"names":[],"mappings":";AAAA,wBAAoB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,kBAAkB,EAAE,cAAc,GAAG,SAAS,CAAC;IAC/C,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { SystemBarsEntry, SystemBarsProps } from "./types";
2
+ export declare function SystemBars(props: SystemBarsProps): null;
3
+ export declare namespace SystemBars {
4
+ var pushStackEntry: (props: SystemBarsProps) => SystemBarsEntry;
5
+ var popStackEntry: (entry: SystemBarsEntry) => void;
6
+ var replaceStackEntry: (entry: SystemBarsEntry, props: SystemBarsProps) => SystemBarsEntry;
7
+ var setStyle: (style: SystemBarsProps["style"]) => void;
8
+ var setHidden: (hidden: SystemBarsProps["hidden"]) => void;
9
+ }
10
+ //# sourceMappingURL=SystemBars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SystemBars.d.ts","sourceRoot":"","sources":["../../../src/SystemBars.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AA6PhF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,QAmDhD;yBAnDe,UAAU;gCA1EK,eAAe,KAAG,eAAe;+BAYlC,eAAe,KAAG,IAAI;mCAe3C,eAAe,SACf,eAAe,KACrB,eAAe;0BAeO,eAAe,CAAC,OAAO,CAAC;4BAmBtB,eAAe,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type ConfigPlugin } from "@expo/config-plugins";
2
+ type ParentTheme = "Default" | "Material2" | "Material3" | "Material3.Dynamic" | "Material3Expressive" | "Material3Expressive.Dynamic" | "Light" | "Material2.Light" | "Material3.Light" | "Material3.Dynamic.Light" | "Material3Expressive.Light" | "Material3Expressive.Dynamic.Light";
3
+ type EdgeToEdgePluginConfig = {
4
+ android?: {
5
+ /**
6
+ * Enforce a contrasting background on the navigation bar.
7
+ * Set to `false` to enforce full transparency in all cases (you will then
8
+ * need to manage the navigation bar style using `SystemBars`).
9
+ * @default true
10
+ */
11
+ enforceNavigationBarContrast?: boolean;
12
+ /**
13
+ * The parent theme for the Android `AppTheme`. Choose based on your
14
+ * current theme.
15
+ * @default "Default"
16
+ */
17
+ parentTheme?: ParentTheme;
18
+ };
19
+ };
20
+ declare const PACKAGE_NAME = "react-native-edge-to-edge";
21
+ export declare const withEdgeToEdge: ConfigPlugin<EdgeToEdgePluginConfig | undefined>;
22
+ declare const _default: (config: EdgeToEdgePluginConfig) => [typeof PACKAGE_NAME, EdgeToEdgePluginConfig];
23
+ export default _default;
24
+ //# sourceMappingURL=expo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../../../src/extras/expo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,sBAAsB,CAAC;AAE9B,KAAK,WAAW,GACZ,SAAS,GACT,WAAW,GACX,WAAW,GACX,mBAAmB,GACnB,qBAAqB,GACrB,6BAA6B,GAC7B,OAAO,GACP,iBAAiB,GACjB,iBAAiB,GACjB,yBAAyB,GACzB,2BAA2B,GAC3B,mCAAmC,CAAC;AAExC,KAAK,sBAAsB,GAAG;IAC5B,OAAO,CAAC,EAAE;QACR;;;;;WAKG;QACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC;;;;WAIG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC;KAC3B,CAAC;CACH,CAAC;AAsGF,QAAA,MAAM,YAAY,8BAA8B,CAAC;AAEjD,eAAO,MAAM,cAAc,kDAA4C,CAAC;yBAGtE,QAAQ,sBAAsB,KAC7B,CAAC,OAAO,YAAY,EAAE,sBAAsB,CAAC;AAFhD,wBAE2E"}
@@ -0,0 +1,3 @@
1
+ export { SystemBars } from "./SystemBars";
2
+ export type { SystemBarStyle, SystemBarsEntry, SystemBarsProps } from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,11 @@
1
+ import type { TurboModule } from "react-native";
2
+ interface Spec extends TurboModule {
3
+ onColorSchemeChange(): void;
4
+ setStatusBarStyle(style: string): void;
5
+ setNavigationBarStyle(style: string): void;
6
+ setStatusBarHidden(hidden: boolean): void;
7
+ setNavigationBarHidden(hidden: boolean): void;
8
+ }
9
+ declare const NativeModule: Spec | null;
10
+ export default NativeModule;
11
+ //# sourceMappingURL=NativeEdgeToEdgeModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeEdgeToEdgeModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeEdgeToEdgeModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,UAAU,IAAK,SAAQ,WAAW;IAChC,mBAAmB,IAAI,IAAI,CAAC;IAC5B,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,YAAY,aAGR,CAAC;AAQX,eAAe,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: null;
2
+ export default _default;
3
+ //# sourceMappingURL=NativeEdgeToEdgeModule.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeEdgeToEdgeModule.web.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeEdgeToEdgeModule.web.ts"],"names":[],"mappings":";AAAA,wBAAoB"}
@@ -0,0 +1,17 @@
1
+ type SystemBarsProp<T> = T | {
2
+ statusBar?: T;
3
+ navigationBar?: T;
4
+ };
5
+ export type SystemBarStyle = "auto" | "inverted" | "light" | "dark";
6
+ export type SystemBarsEntry = {
7
+ statusBarStyle: SystemBarStyle | undefined;
8
+ navigationBarStyle: SystemBarStyle | undefined;
9
+ statusBarHidden: boolean | undefined;
10
+ navigationBarHidden: boolean | undefined;
11
+ };
12
+ export type SystemBarsProps = {
13
+ style?: SystemBarsProp<SystemBarStyle>;
14
+ hidden?: SystemBarsProp<boolean>;
15
+ };
16
+ export {};
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,kBAAkB,EAAE,cAAc,GAAG,SAAS,CAAC;IAC/C,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,37 @@
1
1
  {
2
2
  "name": "react-native-edge-to-edge",
3
- "version": "1.6.2",
3
+ "version": "1.8.0",
4
4
  "license": "MIT",
5
5
  "description": "Effortlessly enable edge-to-edge display in React Native",
6
6
  "author": "Mathieu Acthernoene <zoontek@gmail.com>",
7
7
  "homepage": "https://github.com/zoontek/react-native-edge-to-edge",
8
- "main": "dist/commonjs/index.js",
9
- "module": "dist/module/index.js",
10
- "types": "dist/typescript/index.d.ts",
8
+ "main": "./dist/commonjs/index.js",
9
+ "module": "./dist/module/index.js",
10
+ "types": "./dist/typescript/commonjs/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": {
14
+ "types": "./dist/typescript/module/index.d.ts",
15
+ "default": "./dist/module/index.js"
16
+ },
17
+ "require": {
18
+ "types": "./dist/typescript/commonjs/index.d.ts",
19
+ "default": "./dist/commonjs/index.js"
20
+ }
21
+ },
22
+ "./expo": {
23
+ "import": {
24
+ "types": "./dist/typescript/module/extras/expo.d.ts",
25
+ "default": "./dist/module/extras/expo.js"
26
+ },
27
+ "require": {
28
+ "types": "./dist/typescript/commonjs/extras/expo.d.ts",
29
+ "default": "./dist/commonjs/extras/expo.js"
30
+ }
31
+ },
32
+ "./package.json": "./package.json",
33
+ "./app.plugin.js": "./app.plugin.js"
34
+ },
11
35
  "files": [
12
36
  "dist",
13
37
  "src",
@@ -34,16 +58,26 @@
34
58
  "clean": "rm -rf dist",
35
59
  "format": "prettier '**/*' -u -w",
36
60
  "typecheck": "tsc --noEmit",
37
- "build": "yarn clean && bob build && rm -rf dist/*/package.json",
61
+ "build": "yarn clean && bob build",
38
62
  "prepack": "prettier '**/*' -u -c && yarn typecheck && yarn build"
39
63
  },
40
64
  "react-native-builder-bob": {
41
65
  "source": "src",
42
66
  "output": "dist",
43
67
  "targets": [
44
- "commonjs",
45
- "module",
46
- "typescript"
68
+ "typescript",
69
+ [
70
+ "module",
71
+ {
72
+ "esm": true
73
+ }
74
+ ],
75
+ [
76
+ "commonjs",
77
+ {
78
+ "esm": true
79
+ }
80
+ ]
47
81
  ]
48
82
  },
49
83
  "prettier": {
@@ -58,14 +92,14 @@
58
92
  "devDependencies": {
59
93
  "@babel/core": "^7.25.2",
60
94
  "@babel/preset-env": "^7.25.3",
61
- "@expo/config-plugins": "^9.0.0 || ^10.0.0",
62
- "@types/react": "^19.0.0",
63
- "prettier": "^3.6.2",
64
- "prettier-plugin-organize-imports": "^4.1.0",
65
- "react": "19.1.0",
66
- "react-native": "0.80.0",
67
- "react-native-builder-bob": "^0.40.12",
68
- "typescript": "^5.8.3"
95
+ "@expo/config-plugins": "*",
96
+ "@types/react": "^19.2.0",
97
+ "prettier": "^3.8.1",
98
+ "prettier-plugin-organize-imports": "^4.3.0",
99
+ "react": "19.2.3",
100
+ "react-native": "0.84.0",
101
+ "react-native-builder-bob": "^0.40.18",
102
+ "typescript": "^5.9.3"
69
103
  },
70
104
  "codegenConfig": {
71
105
  "name": "RNEdgeToEdge",
package/src/SystemBars.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useMemo, useRef } from "react";
2
2
  import { Appearance, Platform, StatusBar, useColorScheme } from "react-native";
3
3
  import NativeModule from "./specs/NativeEdgeToEdgeModule";
4
- import { SystemBarsEntry, SystemBarsProps, SystemBarStyle } from "./types";
4
+ import type { SystemBarsEntry, SystemBarsProps, SystemBarStyle } from "./types";
5
5
 
6
6
  type ResolvedBarStyle = "light" | "dark" | undefined;
7
7
 
@@ -1,5 +1,5 @@
1
1
  import {
2
- ConfigPlugin,
2
+ type ConfigPlugin,
3
3
  createRunOncePlugin,
4
4
  withAndroidStyles,
5
5
  } from "@expo/config-plugins";
@@ -9,32 +9,53 @@ type ParentTheme =
9
9
  | "Material2"
10
10
  | "Material3"
11
11
  | "Material3.Dynamic"
12
+ | "Material3Expressive"
13
+ | "Material3Expressive.Dynamic"
12
14
  | "Light"
13
15
  | "Material2.Light"
14
16
  | "Material3.Light"
15
- | "Material3.Dynamic.Light";
16
-
17
- type AndroidProps = {
18
- enforceNavigationBarContrast?: boolean;
19
- parentTheme?: ParentTheme;
17
+ | "Material3.Dynamic.Light"
18
+ | "Material3Expressive.Light"
19
+ | "Material3Expressive.Dynamic.Light";
20
+
21
+ type EdgeToEdgePluginConfig = {
22
+ android?: {
23
+ /**
24
+ * Enforce a contrasting background on the navigation bar.
25
+ * Set to `false` to enforce full transparency in all cases (you will then
26
+ * need to manage the navigation bar style using `SystemBars`).
27
+ * @default true
28
+ */
29
+ enforceNavigationBarContrast?: boolean;
30
+ /**
31
+ * The parent theme for the Android `AppTheme`. Choose based on your
32
+ * current theme.
33
+ * @default "Default"
34
+ */
35
+ parentTheme?: ParentTheme;
36
+ };
20
37
  };
21
38
 
22
- type Props = { android?: AndroidProps } | undefined;
23
-
24
- const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
25
- config,
26
- props = {},
39
+ const plugin: ConfigPlugin<EdgeToEdgePluginConfig | undefined> = (
40
+ expoConfig,
41
+ pluginConfig = {},
27
42
  ) => {
28
43
  const themes: Record<ParentTheme, string> = {
29
44
  Default: "Theme.EdgeToEdge",
30
45
  Material2: "Theme.EdgeToEdge.Material2",
31
46
  Material3: "Theme.EdgeToEdge.Material3",
32
47
  "Material3.Dynamic": "Theme.EdgeToEdge.Material3.Dynamic",
48
+ Material3Expressive: "Theme.EdgeToEdge.Material3Expressive",
49
+ "Material3Expressive.Dynamic":
50
+ "Theme.EdgeToEdge.Material3Expressive.Dynamic",
33
51
 
34
52
  Light: "Theme.EdgeToEdge.Light",
35
53
  "Material2.Light": "Theme.EdgeToEdge.Material2.Light",
36
54
  "Material3.Light": "Theme.EdgeToEdge.Material3.Light",
37
55
  "Material3.Dynamic.Light": "Theme.EdgeToEdge.Material3.Dynamic.Light",
56
+ "Material3Expressive.Light": "Theme.EdgeToEdge.Material3Expressive.Light",
57
+ "Material3Expressive.Dynamic.Light":
58
+ "Theme.EdgeToEdge.Material3Expressive.Dynamic.Light",
38
59
  };
39
60
 
40
61
  const cleanupList = new Set([
@@ -52,7 +73,7 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
52
73
  "android:windowTranslucentStatus",
53
74
  ]);
54
75
 
55
- return withAndroidStyles(config, (config) => {
76
+ return withAndroidStyles(expoConfig, (config) => {
56
77
  const {
57
78
  androidNavigationBar = {},
58
79
  androidStatusBar = {},
@@ -61,7 +82,7 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
61
82
 
62
83
  const { barStyle: navigationBarStyle } = androidNavigationBar;
63
84
  const { barStyle: statusBarStyle } = androidStatusBar;
64
- const { android = {} } = props;
85
+ const { android = {} } = pluginConfig;
65
86
  const { enforceNavigationBarContrast, parentTheme = "Default" } = android;
66
87
 
67
88
  config.modResults.resources.style = config.modResults.resources.style?.map(
@@ -115,7 +136,10 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
115
136
  });
116
137
  };
117
138
 
118
- export default createRunOncePlugin(
119
- withAndroidEdgeToEdgeTheme,
120
- "react-native-edge-to-edge",
121
- );
139
+ const PACKAGE_NAME = "react-native-edge-to-edge";
140
+
141
+ export const withEdgeToEdge = createRunOncePlugin(plugin, PACKAGE_NAME);
142
+
143
+ export default (
144
+ config: EdgeToEdgePluginConfig,
145
+ ): [typeof PACKAGE_NAME, EdgeToEdgePluginConfig] => [PACKAGE_NAME, config];
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { SystemBars } from "./SystemBars";
2
- export { SystemBarStyle, SystemBarsEntry, SystemBarsProps } from "./types";
2
+ export type { SystemBarStyle, SystemBarsEntry, SystemBarsProps } from "./types";
@@ -1,3 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
- </manifest>
@@ -1 +0,0 @@
1
- {"version":3,"names":["_configPlugins","require","withAndroidEdgeToEdgeTheme","config","props","themes","Default","Material2","Material3","Light","cleanupList","Set","withAndroidStyles","androidNavigationBar","androidStatusBar","userInterfaceStyle","barStyle","navigationBarStyle","statusBarStyle","android","enforceNavigationBarContrast","parentTheme","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String","_default","exports","default","createRunOncePlugin"],"sourceRoot":"../../src","sources":["expo.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAuBA,MAAMC,0BAA+C,GAAGA,CACtDC,MAAM,EACNC,KAAK,GAAG,CAAC,CAAC,KACP;EACH,MAAMC,MAAmC,GAAG;IAC1CC,OAAO,EAAE,kBAAkB;IAC3BC,SAAS,EAAE,4BAA4B;IACvCC,SAAS,EAAE,4BAA4B;IACvC,mBAAmB,EAAE,oCAAoC;IAEzDC,KAAK,EAAE,wBAAwB;IAC/B,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,kCAAkC;IACrD,yBAAyB,EAAE;EAC7B,CAAC;EAED,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAC,CAC1B,8BAA8B,EAC9B,sCAAs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EdgeToEdgeTheme","config","props","themes","Default","Material2","Material3","Light","cleanupList","Set","androidNavigationBar","androidStatusBar","userInterfaceStyle","barStyle","navigationBarStyle","statusBarStyle","android","enforceNavigationBarContrast","parentTheme","modResults","resources","style","map","$","name","parent","item","filter","has","push","_","String"],"sourceRoot":"../../src","sources":["expo.ts"],"mappings":";;AAAA,SAEEA,mBAAmB,EACnBC,iBAAiB,QACZ,sBAAsB;AAmB7B,MAAMC,0BAA+C,GAAGA,CACtDC,MAAM,EACNC,KAAK,GAAG,CAAC,CAAC,KACP;EACH,MAAMC,MAAmC,GAAG;IAC1CC,OAAO,EAAE,kBAAkB;IAC3BC,SAAS,EAAE,4BAA4B;IACvCC,SAAS,EAAE,4BAA4B;IACvC,mBAAmB,EAAE,oCAAoC;IAEzDC,KAAK,EAAE,wBAAwB;IAC/B,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,kCAAkC;IACrD,yBAAyB,EAAE;EAC7B,CAAC;EAED,MAAMC,WAAW,GAAG,IAAIC,GAAG,CAAC,CAC1B,8BAA8B,EAC9B,sCAAsC,EACtC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,yCAAyC,EACzC,yCAAyC,EACzC,kCAAkC,EAClC,8BAA8B,EAC9B,qCAAqC,EACrC,iCAAiC,CAClC,CAAC;EAEF,OAAOV,iBAAiB,CAACE,MAAM,EAAGA,MAAM,IAAK;IAC3C,MAAM;MACJS,oBAAoB,GAAG,CAAC,CAAC;MACzBC,gBAAgB,GAAG,CAAC,CAAC;MACrBC,kBAAkB,GAAG;IACvB,CAAC,GAAGX,MAAM;IAEV,MAAM;MAAEY,QAAQ,EAAEC;IAAmB,CAAC,GAAGJ,oBAAoB;IAC7D,MAAM;MAAEG,QAAQ,EAAEE;IAAe,CAAC,GAAGJ,gBAAgB;IACrD,MAAM;MAAEK,OAAO,GAAG,CAAC;IAAE,CAAC,GAAGd,KAAK;IAC9B,MAAM;MAAEe,4BA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,CAAC,CAAC;UACJ,CAAC,MAAM,IAAIF,kBAAkB,KAAK,WAAW,EAAE;YAC7CS,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;cACdN,CAAC,EAAE;gBAAEC,IAAI,EAAE;cAAmC,CAAC;cAC/CM,CAAC,EAAEC,MAAM,CAACjB,kBAAkB,KAAK,OAAO;YAC1C,CAAC,CAAC;UACJ;UAEAO,KAAK,CAACK,IAAI,CAACG,IAAI,CAAC;YACdN,CAAC,EAAE;cAAEC,IAAI,EAAE;YAA+B,CAAC;YAC3CM,CAAC,EAAEC,MAAM,CAAC,KAAK;UACjB,CAAC,CAAC;QACJ;MACF;MAEA,OAAOV,KAAK;IACd,CACF,CAAC;IAED,OAAOpB,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAED,eAAeH,mBAAmB,CAChCE,0BAA0B,EAC1B,2BACF,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SystemBars.d.ts","sourceRoot":"","sources":["../../src/SystemBars.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAkB,MAAM,SAAS,CAAC;AA6P3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,QAmDhD;yBAnDe,UAAU;gCA1EK,eAAe,KAAG,eAAe;+BAYlC,eAAe,KAAG,IAAI;mCAe3C,eAAe,SACf,eAAe,KACrB,eAAe;0BAeO,eAAe,CAAC,OAAO,CAAC;4BAmBtB,eAAe,CAAC,QAAQ,CAAC"}
@@ -1,12 +0,0 @@
1
- import { ConfigPlugin } from "@expo/config-plugins";
2
- type ParentTheme = "Default" | "Material2" | "Material3" | "Material3.Dynamic" | "Light" | "Material2.Light" | "Material3.Light" | "Material3.Dynamic.Light";
3
- type AndroidProps = {
4
- enforceNavigationBarContrast?: boolean;
5
- parentTheme?: ParentTheme;
6
- };
7
- type Props = {
8
- android?: AndroidProps;
9
- } | undefined;
10
- declare const _default: ConfigPlugin<Props>;
11
- export default _default;
12
- //# sourceMappingURL=expo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expo.d.ts","sourceRoot":"","sources":["../../src/expo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,sBAAsB,CAAC;AAE9B,KAAK,WAAW,GACZ,SAAS,GACT,WAAW,GACX,WAAW,GACX,mBAAmB,GACnB,OAAO,GACP,iBAAiB,GACjB,iBAAiB,GACjB,yBAAyB,CAAC;AAE9B,KAAK,YAAY,GAAG;IAClB,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,KAAK,KAAK,GAAG;IAAE,OAAO,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,SAAS,CAAC;;AAgGpD,wBAGE"}
@@ -1,3 +0,0 @@
1
- export { SystemBars } from "./SystemBars";
2
- export { SystemBarStyle, SystemBarsEntry, SystemBarsProps } from "./types";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeEdgeToEdgeModule.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeEdgeToEdgeModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,UAAU,IAAK,SAAQ,WAAW;IAChC,mBAAmB,IAAI,IAAI,CAAC;IAC5B,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/C;AAED,QAAA,MAAM,YAAY,aAGR,CAAC;AAQX,eAAe,YAAY,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NativeEdgeToEdgeModule.web.d.ts","sourceRoot":"","sources":["../../../src/specs/NativeEdgeToEdgeModule.web.ts"],"names":[],"mappings":";AAAA,wBAAoB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IAC3C,kBAAkB,EAAE,cAAc,GAAG,SAAS,CAAC;IAC/C,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,mBAAmB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC"}