@expo/ui 57.0.10 → 57.0.12

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 (96) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +21 -1
  4. package/android/src/main/java/expo/modules/ui/graphics/DrawablePainter.kt +43 -0
  5. package/android/src/main/java/expo/modules/ui/{icon/VectorIconLoader.kt → graphics/ImageLoader.kt} +122 -87
  6. package/android/src/main/java/expo/modules/ui/graphics/ImageSource.kt +28 -0
  7. package/android/src/main/java/expo/modules/ui/{icon → graphics}/ResourceIdHelper.kt +1 -1
  8. package/android/src/main/java/expo/modules/ui/icon/IconView.kt +7 -78
  9. package/android/src/main/java/expo/modules/ui/image/ImageView.kt +136 -0
  10. package/build/State/useWorkletProp.d.ts.map +1 -1
  11. package/build/jetpack-compose/Image/index.d.ts +107 -0
  12. package/build/jetpack-compose/Image/index.d.ts.map +1 -0
  13. package/build/jetpack-compose/index.d.ts +1 -0
  14. package/build/jetpack-compose/index.d.ts.map +1 -1
  15. package/build/swift-ui/Alert/index.d.ts.map +1 -1
  16. package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -1
  17. package/build/swift-ui/Overlay/index.d.ts.map +1 -1
  18. package/build/swift-ui/Popover/index.d.ts.map +1 -1
  19. package/build/swift-ui/Slider/index.d.ts.map +1 -1
  20. package/build/swift-ui/modifiers/index.d.ts +61 -9
  21. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  22. package/build/universal/BottomSheet/index.android.d.ts +1 -1
  23. package/build/universal/BottomSheet/index.android.d.ts.map +1 -1
  24. package/build/universal/BottomSheet/index.d.ts +1 -1
  25. package/build/universal/BottomSheet/index.d.ts.map +1 -1
  26. package/build/universal/BottomSheet/index.ios.d.ts +1 -1
  27. package/build/universal/BottomSheet/index.ios.d.ts.map +1 -1
  28. package/build/universal/BottomSheet/types.d.ts +28 -0
  29. package/build/universal/BottomSheet/types.d.ts.map +1 -1
  30. package/build/universal/BottomSheet/utils.d.ts +13 -0
  31. package/build/universal/BottomSheet/utils.d.ts.map +1 -0
  32. package/expo-module.config.json +1 -1
  33. package/ios/Convertibles/PaddingValue.swift +57 -0
  34. package/ios/Modifiers/MenuIndicatorModifier.swift +18 -0
  35. package/ios/Modifiers/MenuStyleModifier.swift +28 -0
  36. package/ios/Modifiers/ViewModifierRegistry.swift +105 -18
  37. package/ios/SliderView.swift +11 -5
  38. package/ios/State/WorkletCallbackClassDef.swift +7 -0
  39. package/ios/Toggle/ToggleView.swift +16 -18
  40. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.10/expo.modules.ui-57.0.10-sources.jar → 57.0.12/expo.modules.ui-57.0.12-sources.jar} +0 -0
  41. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12-sources.jar.md5 +1 -0
  42. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12-sources.jar.sha1 +1 -0
  43. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12-sources.jar.sha256 +1 -0
  44. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12-sources.jar.sha512 +1 -0
  45. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar +0 -0
  46. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar.md5 +1 -0
  47. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar.sha1 +1 -0
  48. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar.sha256 +1 -0
  49. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.aar.sha512 +1 -0
  50. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.10/expo.modules.ui-57.0.10.module → 57.0.12/expo.modules.ui-57.0.12.module} +22 -22
  51. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.module.md5 +1 -0
  52. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.module.sha1 +1 -0
  53. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.module.sha256 +1 -0
  54. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.module.sha512 +1 -0
  55. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.10/expo.modules.ui-57.0.10.pom → 57.0.12/expo.modules.ui-57.0.12.pom} +1 -1
  56. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.pom.md5 +1 -0
  57. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.pom.sha1 +1 -0
  58. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.pom.sha256 +1 -0
  59. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.12/expo.modules.ui-57.0.12.pom.sha512 +1 -0
  60. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  61. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  62. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  63. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  64. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  65. package/package.json +4 -4
  66. package/src/State/useWorkletProp.ts +31 -14
  67. package/src/jetpack-compose/Image/index.tsx +149 -0
  68. package/src/jetpack-compose/index.ts +1 -0
  69. package/src/swift-ui/Alert/index.tsx +1 -0
  70. package/src/swift-ui/ConfirmationDialog/index.tsx +1 -0
  71. package/src/swift-ui/Overlay/index.tsx +1 -0
  72. package/src/swift-ui/Popover/index.tsx +1 -0
  73. package/src/swift-ui/Slider/index.tsx +14 -8
  74. package/src/swift-ui/modifiers/index.ts +70 -8
  75. package/src/universal/BottomSheet/index.android.tsx +13 -2
  76. package/src/universal/BottomSheet/index.ios.tsx +9 -1
  77. package/src/universal/BottomSheet/index.tsx +17 -2
  78. package/src/universal/BottomSheet/types.ts +33 -0
  79. package/src/universal/BottomSheet/utils.ts +35 -0
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10-sources.jar.md5 +0 -1
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10-sources.jar.sha1 +0 -1
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10-sources.jar.sha256 +0 -1
  83. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10-sources.jar.sha512 +0 -1
  84. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.aar +0 -0
  85. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.aar.md5 +0 -1
  86. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.aar.sha1 +0 -1
  87. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.aar.sha256 +0 -1
  88. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.aar.sha512 +0 -1
  89. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.module.md5 +0 -1
  90. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.module.sha1 +0 -1
  91. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.module.sha256 +0 -1
  92. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.module.sha512 +0 -1
  93. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.pom.md5 +0 -1
  94. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.pom.sha1 +0 -1
  95. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.pom.sha256 +0 -1
  96. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.10/expo.modules.ui-57.0.10.pom.sha512 +0 -1
@@ -2,9 +2,7 @@ package expo.modules.ui.icon
2
2
 
3
3
  import android.content.Context
4
4
  import android.graphics.Color
5
- import android.graphics.drawable.BitmapDrawable
6
5
  import android.graphics.drawable.Drawable
7
- import android.net.Uri
8
6
  import androidx.compose.foundation.layout.size
9
7
  import androidx.compose.material3.Icon
10
8
  import androidx.compose.material3.LocalContentColor
@@ -16,19 +14,10 @@ import androidx.compose.runtime.mutableStateOf
16
14
  import androidx.compose.runtime.remember
17
15
  import androidx.compose.runtime.setValue
18
16
  import androidx.compose.ui.Modifier
19
- import androidx.compose.ui.geometry.Size
20
- import androidx.compose.ui.graphics.asImageBitmap
21
- import androidx.compose.ui.graphics.drawscope.DrawScope
22
- import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
23
- import androidx.compose.ui.graphics.nativeCanvas
24
- import androidx.compose.ui.graphics.painter.BitmapPainter
25
- import androidx.compose.ui.graphics.painter.Painter
26
17
  import androidx.compose.ui.graphics.vector.ImageVector
27
18
  import androidx.compose.ui.graphics.vector.rememberVectorPainter
28
19
  import androidx.compose.ui.unit.dp
29
20
  import expo.modules.kotlin.AppContext
30
- import expo.modules.kotlin.records.Field
31
- import expo.modules.kotlin.records.Record
32
21
  import expo.modules.kotlin.views.ComposableScope
33
22
  import expo.modules.kotlin.views.ComposeProps
34
23
  import expo.modules.kotlin.views.ExpoComposeView
@@ -36,20 +25,14 @@ import expo.modules.ui.ExpoUIModule
36
25
  import expo.modules.ui.ModifierList
37
26
  import expo.modules.ui.ModifierRegistry
38
27
  import expo.modules.ui.compose
39
- import expo.modules.kotlin.types.OptimizedRecord
40
28
  import expo.modules.kotlin.views.OptimizedComposeProps
41
-
42
- @OptimizedRecord
43
- data class Source(
44
- @Field val uri: String,
45
- @Field val width: Int = 0,
46
- @Field val height: Int = 0,
47
- @Field val scale: Double = 1.0
48
- ) : Record
29
+ import expo.modules.ui.graphics.ImageSource
30
+ import expo.modules.ui.graphics.rememberDrawablePainter
31
+ import expo.modules.ui.graphics.resolveUri
49
32
 
50
33
  @OptimizedComposeProps
51
34
  data class IconProps(
52
- val source: MutableState<Source?> = mutableStateOf(null),
35
+ val source: MutableState<ImageSource?> = mutableStateOf(null),
53
36
  val tint: MutableState<Color?> = mutableStateOf(null),
54
37
  val inheritTint: MutableState<Boolean> = mutableStateOf(true),
55
38
  val size: MutableState<Int?> = mutableStateOf(null),
@@ -64,11 +47,7 @@ class IconView(context: Context, appContext: AppContext) :
64
47
 
65
48
  private val iconLoader by lazy {
66
49
  val module = appContext.registry.getModule<ExpoUIModule>()
67
- val okHttpClient = requireNotNull(module?.okHttpClient) { "ExpoUIModule.okHttpClient is not initialized" }
68
- VectorIconLoader(
69
- context = context,
70
- okHttpClient = okHttpClient
71
- )
50
+ requireNotNull(module?.imageLoader) { "ExpoUIModule.imageLoader is not initialized" }
72
51
  }
73
52
 
74
53
  @Composable
@@ -88,7 +67,7 @@ class IconView(context: Context, appContext: AppContext) :
88
67
  imageVector = null
89
68
  drawable = null
90
69
 
91
- val uriString = source?.let { resolveUri(it) }
70
+ val uriString = source?.resolveUri(context)
92
71
  if (uriString != null) {
93
72
  // loadFromUri is already a suspend function that handles dispatchers
94
73
  val result = iconLoader.loadFromUri(uriString)
@@ -99,7 +78,7 @@ class IconView(context: Context, appContext: AppContext) :
99
78
 
100
79
  // Convert to Painter (prioritize ImageVector over Drawable)
101
80
  val painter = imageVector?.let { rememberVectorPainter(it) }
102
- ?: rememberDrawableAsPainter(drawable)
81
+ ?: rememberDrawablePainter(drawable)
103
82
 
104
83
  // Render icon if painter available
105
84
  if (painter != null) {
@@ -115,54 +94,4 @@ class IconView(context: Context, appContext: AppContext) :
115
94
  )
116
95
  }
117
96
  }
118
-
119
- /**
120
- * Resolve Source to URI string, handling resource IDs and local resources.
121
- */
122
- private fun resolveUri(source: Source): String? {
123
- val stringUri = source.uri
124
- return try {
125
- val uri = Uri.parse(stringUri)
126
-
127
- // If no scheme, try to resolve as local resource
128
- if (uri.scheme == null) {
129
- ResourceIdHelper.getResourceUri(context, stringUri)?.toString()
130
- } else {
131
- stringUri
132
- }
133
- } catch (e: Exception) {
134
- // Fallback to resource ID helper
135
- ResourceIdHelper.getResourceUri(context, stringUri)?.toString()
136
- }
137
- }
138
-
139
- @Composable
140
- private fun rememberDrawableAsPainter(drawable: Drawable?): Painter? {
141
- return remember(drawable) {
142
- when (drawable) {
143
- null -> null
144
- is BitmapDrawable -> BitmapPainter(drawable.bitmap.asImageBitmap())
145
- else -> DrawablePainter(drawable.mutate())
146
- }
147
- }
148
- }
149
-
150
- private class DrawablePainter(
151
- private val drawable: Drawable
152
- ) : Painter() {
153
- override val intrinsicSize: Size
154
- get() = Size(
155
- drawable.intrinsicWidth.toFloat().takeIf { it > 0 } ?: Size.Unspecified.width,
156
- drawable.intrinsicHeight.toFloat().takeIf { it > 0 } ?: Size.Unspecified.height
157
- )
158
-
159
- override fun DrawScope.onDraw() {
160
- drawIntoCanvas { canvas ->
161
- with(drawable) {
162
- setBounds(0, 0, size.width.toInt(), size.height.toInt())
163
- draw(canvas.nativeCanvas)
164
- }
165
- }
166
- }
167
- }
168
97
  }
@@ -0,0 +1,136 @@
1
+ package expo.modules.ui.image
2
+
3
+ import android.content.Context
4
+ import android.graphics.Color
5
+ import androidx.compose.foundation.Image
6
+ import androidx.compose.runtime.Composable
7
+ import androidx.compose.runtime.LaunchedEffect
8
+ import androidx.compose.runtime.MutableState
9
+ import androidx.compose.runtime.getValue
10
+ import androidx.compose.runtime.mutableStateOf
11
+ import androidx.compose.runtime.remember
12
+ import androidx.compose.runtime.setValue
13
+ import androidx.compose.ui.graphics.ColorFilter
14
+ import androidx.compose.ui.graphics.painter.ColorPainter
15
+ import androidx.compose.ui.graphics.vector.rememberVectorPainter
16
+ import androidx.compose.ui.layout.ContentScale
17
+ import expo.modules.kotlin.AppContext
18
+ import expo.modules.kotlin.records.Field
19
+ import expo.modules.kotlin.records.Record
20
+ import expo.modules.kotlin.types.Enumerable
21
+ import expo.modules.kotlin.types.OptimizedRecord
22
+ import expo.modules.kotlin.viewevent.EventDispatcher
23
+ import expo.modules.kotlin.views.ComposableScope
24
+ import expo.modules.kotlin.views.ComposeProps
25
+ import expo.modules.kotlin.views.ExpoComposeView
26
+ import expo.modules.kotlin.views.OptimizedComposeProps
27
+ import expo.modules.ui.ExpoUIModule
28
+ import expo.modules.ui.ModifierList
29
+ import expo.modules.ui.ModifierRegistry
30
+ import expo.modules.ui.compose
31
+ import expo.modules.ui.convertibles.ContentAlignment
32
+ import expo.modules.ui.graphics.ImageLoader
33
+ import expo.modules.ui.graphics.ImageSource
34
+ import expo.modules.ui.graphics.rememberDrawablePainter
35
+ import expo.modules.ui.graphics.resolveUri
36
+
37
+ enum class ImageContentScale(val value: String) : Enumerable {
38
+ FIT("fit"),
39
+ CROP("crop"),
40
+ FILL_BOUNDS("fillBounds"),
41
+ FILL_WIDTH("fillWidth"),
42
+ FILL_HEIGHT("fillHeight"),
43
+ INSIDE("inside"),
44
+ NONE("none");
45
+
46
+ fun toComposeContentScale(): ContentScale {
47
+ return when (this) {
48
+ FIT -> ContentScale.Fit
49
+ CROP -> ContentScale.Crop
50
+ FILL_BOUNDS -> ContentScale.FillBounds
51
+ FILL_WIDTH -> ContentScale.FillWidth
52
+ FILL_HEIGHT -> ContentScale.FillHeight
53
+ INSIDE -> ContentScale.Inside
54
+ NONE -> ContentScale.None
55
+ }
56
+ }
57
+ }
58
+
59
+ @OptimizedRecord
60
+ data class ImageErrorEvent(
61
+ @Field val error: String
62
+ ) : Record
63
+
64
+ @OptimizedComposeProps
65
+ data class ImageProps(
66
+ val source: MutableState<ImageSource?> = mutableStateOf(null),
67
+ val contentScale: MutableState<ImageContentScale> = mutableStateOf(ImageContentScale.FIT),
68
+ val alignment: MutableState<ContentAlignment> = mutableStateOf(ContentAlignment.CENTER),
69
+ val contentDescription: MutableState<String?> = mutableStateOf(null),
70
+ val tint: MutableState<Color?> = mutableStateOf(null),
71
+ val alpha: MutableState<Float> = mutableStateOf(1f),
72
+ val modifiers: MutableState<ModifierList> = mutableStateOf(emptyList())
73
+ ) : ComposeProps
74
+
75
+ class ImageView(context: Context, appContext: AppContext) :
76
+ ExpoComposeView<ImageProps>(context, appContext) {
77
+
78
+ override val props = ImageProps()
79
+ private val onLoad by EventDispatcher<Unit>()
80
+ private val onError by EventDispatcher<ImageErrorEvent>()
81
+
82
+ private val imageLoader by lazy {
83
+ val module = appContext.registry.getModule<ExpoUIModule>()
84
+ requireNotNull(module?.imageLoader) { "ExpoUIModule.imageLoader is not initialized" }
85
+ }
86
+
87
+ @Composable
88
+ override fun ComposableScope.Content() {
89
+ val (source) = props.source
90
+ val (contentScale) = props.contentScale
91
+ val (alignment) = props.alignment
92
+ val (contentDescription) = props.contentDescription
93
+ val (tint) = props.tint
94
+ val (alpha) = props.alpha
95
+ val (modifiers) = props.modifiers
96
+
97
+ var loadedImage by remember(source) { mutableStateOf(ImageLoader.ImageResult()) }
98
+
99
+ LaunchedEffect(source) {
100
+ val resolvedUri = source?.resolveUri(context)
101
+ if (resolvedUri == null) {
102
+ val error = "Unable to resolve image source"
103
+ loadedImage = ImageLoader.ImageResult(error = error)
104
+ onError(ImageErrorEvent(error))
105
+ return@LaunchedEffect
106
+ }
107
+
108
+ loadedImage = imageLoader.loadFromUri(resolvedUri).also { result ->
109
+ if (result.isSuccess) {
110
+ onLoad(Unit)
111
+ } else {
112
+ onError(ImageErrorEvent(result.error ?: "Failed to load image"))
113
+ }
114
+ }
115
+ }
116
+
117
+ val painter = loadedImage.imageVector?.let { rememberVectorPainter(it) }
118
+ ?: rememberDrawablePainter(loadedImage.drawable)
119
+ ?: remember { ColorPainter(androidx.compose.ui.graphics.Color.Transparent) }
120
+
121
+ Image(
122
+ painter = painter,
123
+ contentDescription = contentDescription,
124
+ contentScale = contentScale.toComposeContentScale(),
125
+ alignment = alignment.toComposeAlignment(),
126
+ colorFilter = tint?.compose?.let { ColorFilter.tint(it) },
127
+ alpha = alpha.coerceIn(0f, 1f),
128
+ modifier = ModifierRegistry.applyModifiers(
129
+ modifiers,
130
+ appContext,
131
+ this@Content,
132
+ globalEventDispatcher
133
+ )
134
+ )
135
+ }
136
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"useWorkletProp.d.ts","sourceRoot":"","sources":["../../src/State/useWorkletProp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAA4B,MAAM,mBAAmB,CAAC;AAMhF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EACnC,QAAQ,CAAC,EAAE,MAAM,GAChB,YAAY,GAAG,IAAI,CAcrB"}
1
+ {"version":3,"file":"useWorkletProp.d.ts","sourceRoot":"","sources":["../../src/State/useWorkletProp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAyC,MAAM,mBAAmB,CAAC;AAmB7F;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EACnC,QAAQ,CAAC,EAAE,MAAM,GAChB,YAAY,GAAG,IAAI,CAkBrB"}
@@ -0,0 +1,107 @@
1
+ import { type ColorValue, type ImageResolvedAssetSource } from 'react-native';
2
+ import { type ViewEvent } from '../../types';
3
+ import { type ContentAlignment, type PrimitiveBaseProps } from '../layout-types';
4
+ /** Controls how an image is scaled inside its bounds. */
5
+ export type ImageContentScale = 'fit' | 'crop' | 'fillBounds' | 'fillWidth' | 'fillHeight' | 'inside' | 'none';
6
+ /** A bundled image or a single URI-based image source. */
7
+ export type ImageSource = number | {
8
+ uri: string;
9
+ width?: number;
10
+ height?: number;
11
+ scale?: number;
12
+ };
13
+ export interface ImageProps extends PrimitiveBaseProps {
14
+ /**
15
+ * A bundled image or an object containing a single local or remote URI.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <Image source={require('./photo.png')} />
20
+ * <Image source={{ uri: 'file:///path/to/photo.png' }} />
21
+ * ```
22
+ */
23
+ source: ImageSource;
24
+ /**
25
+ * How the image should be scaled to fit its bounds.
26
+ * @default 'fit'
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * <Image source={require('./photo.png')} contentScale="crop" />
31
+ * ```
32
+ */
33
+ contentScale?: ImageContentScale;
34
+ /**
35
+ * How the image should be aligned within its bounds.
36
+ * @default 'center'
37
+ */
38
+ alignment?: ContentAlignment;
39
+ /**
40
+ * Accessibility label for the image.
41
+ * Used by screen readers to describe the image to users.
42
+ * Use `null` for decorative images.
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * <Image
47
+ * source={require('./photo.png')}
48
+ * contentDescription="A mountain at sunset"
49
+ * />
50
+ * ```
51
+ */
52
+ contentDescription?: string | null;
53
+ /**
54
+ * Optional color applied to every non-transparent image pixel.
55
+ *
56
+ * @example
57
+ * ```tsx
58
+ * <Image source={require('./icon.png')} tint="#007AFF" />
59
+ * <Image source={require('./icon.png')} tint="blue" />
60
+ * ```
61
+ */
62
+ tint?: ColorValue;
63
+ /**
64
+ * Opacity of the image between `0` and `1`.
65
+ * @default 1
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * <Image source={require('./icon.png')} alpha={0.5} />
70
+ * ```
71
+ */
72
+ alpha?: number;
73
+ /**
74
+ * Callback that is called when the image loads successfully.
75
+ */
76
+ onLoad?: () => void;
77
+ /**
78
+ * Callback that is called when the image fails to load.
79
+ */
80
+ onError?: (error: string) => void;
81
+ }
82
+ /** @hidden */
83
+ export type NativeImageProps = Omit<ImageProps, 'source' | 'onLoad' | 'onError'> & ViewEvent<'onLoad', void> & ViewEvent<'onError', {
84
+ error: string;
85
+ }> & {
86
+ source: ImageResolvedAssetSource | null;
87
+ };
88
+ /**
89
+ * Displays an image using Jetpack Compose.
90
+ *
91
+ * Size the image with modifiers such as `size`, `width`, `height`, or `fillMaxSize`.
92
+ *
93
+ * @example
94
+ * ```tsx
95
+ * import { Image } from '@expo/ui/jetpack-compose';
96
+ * import { size } from '@expo/ui/jetpack-compose/modifiers';
97
+ *
98
+ * <Image
99
+ * source={require('./photo.png')}
100
+ * contentScale="crop"
101
+ * contentDescription="A mountain at sunset"
102
+ * modifiers={[size(160, 100)]}
103
+ * />
104
+ * ```
105
+ */
106
+ export declare function Image(props: ImageProps): import("react/jsx-runtime").JSX.Element;
107
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/Image/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAkB,MAAM,iBAAiB,CAAC;AAEjG,yDAAyD;AACzD,MAAM,MAAM,iBAAiB,GACzB,KAAK,GACL,MAAM,GACN,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,MAAM,CAAC;AAEX,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GACnB,MAAM,GACN;IACE,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN,MAAM,WAAW,UAAW,SAAQ,kBAAkB;IACpD;;;;;;;;OAQG;IACH,MAAM,EAAE,WAAW,CAAC;IAEpB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAEjC;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,cAAc;AACd,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC,GAC9E,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,GACzB,SAAS,CAAC,SAAS,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG;IACxC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC;CACzC,CAAC;AAOJ;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAWtC"}
@@ -9,6 +9,7 @@ export * from './Chip';
9
9
  export * from './Button';
10
10
  export * from './colors';
11
11
  export * from './Icon';
12
+ export * from './Image';
12
13
  export * from './IconButton';
13
14
  export * from './DropdownMenu';
14
15
  export * from './ExposedDropdownMenuBox';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceR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AAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Alert/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,uBAAuB;IACzD;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;CACtD;AAgCD;;;;GAIG;AACH,iBAAS,KAAK,CAAC,KAAK,EAAE,UAAU,2CAe/B;kBAfQ,KAAK;yBAvBU;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;yBAO7B;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;yBAO7B;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;;AA8BrD,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Alert/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,uBAAuB;IACzD;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;O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AS,CAAA;KAAE;;AA8BrD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ConfirmationDialog/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB;IACtE;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD;;;OAGG;IACH,eAAe,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;CACtD;AA8BD;;;;GAIG;AACH,iBAAS,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAgBzD;kBAhBQ,kBAAkB;yBAvBH;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;yBAO7B;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;yBAO7B;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;;AA+BrD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Overlay/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExE,MAAM,WAAW,YAAa,SAAQ,uBAAuB;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAOD,iBAAS,cAAc,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE3D;AAID,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CAU1C;yBAVe,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Overlay/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExE,MAAM,WAAW,YAAa,SAAQ,uBAAuB;IAC3D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAOD,iBAAS,cAAc,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE3D;AAID,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CAW1C;yBAXe,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Popover/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;IAC/D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;IACxE;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CAChE;AAWD,iBAAS,cAAc,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE3D;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE3D;AAKD,wBAAgB,OAAO,CAAC,KAAK,EAAE,gBAAgB,2CAgB9C;yBAhBe,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Popover/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;IAC/D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;IACxE;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CAChE;AAWD,iBAAS,cAAc,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE3D;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAE3D;AAKD,wBAAgB,OAAO,CAAC,KAAK,EAAE,gBAAgB,2CAiB9C;yBAjBe,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Slider/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,WAAY,SAAQ,uBAAuB;IAC1D;;OAEG;IACH,KAAK,CAAC,EAAE,MAA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S,CAAC;IACpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACjD;AA4CD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,2CAWxC"}
@@ -60,6 +60,22 @@ export declare const matchedGeometryEffect: (id: string, namespaceId: string, op
60
60
  anchor?: UnitPointValue;
61
61
  isSource?: boolean;
62
62
  }) => ModifierConfig;
63
+ /**
64
+ * Isolates the geometry (e.g. position and size) of the view from its parent view.
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * <VStack modifiers={[animation(Animation.spring(), isBusy)]}>
69
+ * {isBusy ? <Text>Working…</Text> : null}
70
+ * <Button label="Check now" modifiers={[geometryGroup()]} />
71
+ * </VStack>
72
+ * ```
73
+ *
74
+ * @platform ios 17.0+
75
+ * @platform tvos 17.0+
76
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/geometrygroup()).
77
+ */
78
+ export declare const geometryGroup: () => ModifierConfig;
63
79
  /**
64
80
  * Sets the frame properties of a view.
65
81
  * @param params - The frame parameters. Width, height, minWidth, maxWidth, minHeight, maxHeight, idealWidth, idealHeight and alignment.
@@ -92,18 +108,26 @@ export declare const containerRelativeFrame: (params: {
92
108
  }) => ModifierConfig;
93
109
  /**
94
110
  * Sets padding on a view.
95
- * Supports individual edges or shorthand properties.
111
+ * Supports individual edges or shorthand properties. Every edge accepts a length in points or
112
+ * `'default'` to apply the system default padding to that edge. Edges set by a specific property
113
+ * take precedence over the shorthand ones, and unspecified edges get no padding.
114
+ * Calling it without parameters applies the system default padding to all edges.
96
115
  * @param params - The padding parameters: `top`, `bottom`, `leading`, `trailing`, `horizontal`, `vertical` and `all`.
97
116
  * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/SwiftUI/View/padding(_:_:)).
117
+ * @example
118
+ * ```tsx
119
+ * // The system default padding on top, 12 points on the sides, nothing at the bottom.
120
+ * <Text modifiers={[padding({ top: 'default', horizontal: 12 })]}>Hello</Text>
121
+ * ```
98
122
  */
99
123
  export declare const padding: (params?: {
100
- top?: number;
101
- bottom?: number;
102
- leading?: number;
103
- trailing?: number;
104
- horizontal?: number;
105
- vertical?: number;
106
- all?: number;
124
+ top?: number | "default";
125
+ bottom?: number | "default";
126
+ leading?: number | "default";
127
+ trailing?: number | "default";
128
+ horizontal?: number | "default";
129
+ vertical?: number | "default";
130
+ all?: number | "default";
107
131
  }) => ModifierConfig;
108
132
  /**
109
133
  * Controls fixed size behavior.
@@ -526,6 +550,27 @@ export declare const buttonBorderShape: (shape: "automatic" | "capsule" | "round
526
550
  * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/togglestyle(_:)).
527
551
  */
528
552
  export declare const toggleStyle: (style: "automatic" | "switch" | "button") => ModifierConfig;
553
+ /**
554
+ * Sets the style for menus within this view.
555
+ * @param style - The menu style. Combine `'button'` with `buttonStyle('plain')` and
556
+ * `menuIndicator('hidden')` to render the menu's own label as the entire trigger, without any
557
+ * surrounding button chrome or disclosure chevron.
558
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/menustyle(_:)).
559
+ * @platform ios
560
+ * @platform tvos 17.0+
561
+ */
562
+ export declare const menuStyle: (style: "automatic" | "button") => ModifierConfig;
563
+ /**
564
+ * Sets the visibility of the menu indicator, the disclosure chevron drawn next to a menu's label.
565
+ * @param visibility - Indicator visibility:
566
+ * - `'automatic'`: platform-default behavior.
567
+ * - `'visible'`: show the indicator.
568
+ * - `'hidden'`: hide the indicator.
569
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/menuindicator(_:)).
570
+ * @platform ios
571
+ * @platform tvos 17.0+
572
+ */
573
+ export declare const menuIndicator: (visibility: "automatic" | "visible" | "hidden") => ModifierConfig;
529
574
  /**
530
575
  * Sets the size of controls within this view.
531
576
  * @param size - The control size.
@@ -807,6 +852,13 @@ export declare const listRowBackground: (color: Color) => ModifierConfig;
807
852
  * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/listrowseparator(_:edges:)).
808
853
  */
809
854
  export declare const listRowSeparator: (visibility: "automatic" | "visible" | "hidden", edges?: "all" | "top" | "bottom") => ModifierConfig;
855
+ /**
856
+ * Sets the tint color of the separator for a list row.
857
+ * @param color - The color to apply to the separator (hex string). For example, `#FF0000`. When omitted, the default separator color is used.
858
+ * @param edges - The edges where the separator tint applies.
859
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/listrowseparatortint(_:edges:)).
860
+ */
861
+ export declare const listRowSeparatorTint: (color?: Color, edges?: "all" | "top" | "bottom") => ModifierConfig;
810
862
  /**
811
863
  * Sets the vertical spacing between adjacent rows in a list.
812
864
  * @param spacing - The spacing value to use. When omitted, the default spacing is used.
@@ -1184,7 +1236,7 @@ export declare const resizable: (capInsets?: {
1184
1236
  * This provides type safety for the modifiers array.
1185
1237
  * @hidden
1186
1238
  */
1187
- export type BuiltInModifier = ReturnType<typeof listSectionSpacing> | ReturnType<typeof background> | ReturnType<typeof cornerRadius> | ReturnType<typeof shadow> | ReturnType<typeof frame> | ReturnType<typeof padding> | ReturnType<typeof fixedSize> | ReturnType<typeof ignoreSafeArea> | ReturnType<typeof onTapGesture> | ReturnType<typeof onLongPressGesture> | ReturnType<typeof onAppear> | ReturnType<typeof luminanceToAlpha> | ReturnType<typeof onDisappear> | ReturnType<typeof onGeometryChange> | ReturnType<typeof opacity> | ReturnType<typeof clipShape> | ReturnType<typeof border> | ReturnType<typeof strokeBorder> | ReturnType<typeof scaleEffect> | ReturnType<typeof rotationEffect> | ReturnType<typeof rotation3DEffect> | ReturnType<typeof offset> | ReturnType<typeof foregroundColor> | ReturnType<typeof foregroundStyle> | ReturnType<typeof bold> | ReturnType<typeof italic> | ReturnType<typeof monospacedDigit> | ReturnType<typeof tint> | ReturnType<typeof hidden> | ReturnType<typeof disabled> | ReturnType<typeof redacted> | ReturnType<typeof unredacted> | ReturnType<typeof privacySensitive> | ReturnType<typeof invalidatableContent> | ReturnType<typeof zIndex> | ReturnType<typeof blur> | ReturnType<typeof brightness> | ReturnType<typeof contrast> | ReturnType<typeof saturation> | ReturnType<typeof hueRotation> | ReturnType<typeof colorInvert> | ReturnType<typeof grayscale> | ReturnType<typeof buttonStyle> | ReturnType<typeof buttonBorderShape> | ReturnType<typeof toggleStyle> | ReturnType<typeof controlSize> | ReturnType<typeof imageScale> | ReturnType<typeof labelStyle> | ReturnType<typeof labelsHidden> | ReturnType<typeof textFieldStyle> | ReturnType<typeof menuActionDismissBehavior> | ReturnType<typeof accessibilityLabel> | ReturnType<typeof accessibilityHint> | ReturnType<typeof accessibilityValue> | ReturnType<typeof accessibilityInputLabels> | ReturnType<typeof accessibilityIdentifier> | ReturnType<typeof accessibilityHidden> | ReturnType<typeof accessibilityElement> | ReturnType<typeof accessibilityAddTraits> | ReturnType<typeof accessibilityRemoveTraits> | ReturnType<typeof layoutPriority> | ReturnType<typeof mask> | ReturnType<typeof overlay> | ReturnType<typeof backgroundOverlay> | ReturnType<typeof aspectRatio> | ReturnType<typeof clipped> | ReturnType<typeof glassEffect> | ReturnType<typeof glassEffectId> | ReturnType<typeof animation> | ReturnType<typeof containerShape> | ReturnType<typeof contentShape> | ReturnType<typeof containerRelativeFrame> | ReturnType<typeof scrollContentBackground> | ReturnType<typeof scrollDisabled> | ReturnType<typeof scrollIndicators> | ReturnType<typeof defaultScrollAnchor> | ReturnType<typeof defaultScrollAnchorForRole> | ReturnType<typeof scrollTargetBehavior> | ReturnType<typeof scrollTargetLayout> | ReturnType<typeof id> | ReturnType<typeof scrollPosition> | ReturnType<typeof onScrollPhaseChange> | NonNullable<ReturnType<typeof useScrollGeometryChange>> | ReturnType<typeof moveDisabled> | ReturnType<typeof deleteDisabled> | ReturnType<typeof environment> | ReturnType<typeof listRowBackground> | ReturnType<typeof listRowSeparator> | ReturnType<typeof listRowSpacing> | ReturnType<typeof truncationMode> | ReturnType<typeof allowsTightening> | ReturnType<typeof kerning> | ReturnType<typeof textCase> | ReturnType<typeof underline> | ReturnType<typeof strikethrough> | ReturnType<typeof multilineTextAlignment> | ReturnType<typeof textSelection> | ReturnType<typeof lineSpacing> | ReturnType<typeof lineHeight> | ReturnType<typeof lineLimit> | ReturnType<typeof headerProminence> | ReturnType<typeof listRowInsets> | ReturnType<typeof badgeProminence> | ReturnType<typeof badge> | ReturnType<typeof listSectionMargins> | ReturnType<typeof font> | ReturnType<typeof dynamicTypeSize> | ReturnType<typeof gridCellUnsizedAxes> | ReturnType<typeof gridCellColumns> | ReturnType<typeof gridColumnAlignment> | ReturnType<typeof gridCellAnchor> | ReturnType<typeof submitLabel> | ReturnType<typeof keyboardType> | ReturnType<typeof autocorrectionDisabled> | ReturnType<typeof onSubmit> | ReturnType<typeof textInputAutocapitalization> | ReturnType<typeof textContentType> | ReturnType<typeof datePickerStyle> | ReturnType<typeof progressViewStyle> | ReturnType<typeof gaugeStyle> | ReturnType<typeof listStyle> | ReturnType<typeof contentTransition> | ReturnType<typeof resizable> | ReturnType<typeof symbolEffect> | ReturnType<typeof widgetAccentedRenderingMode> | ReturnType<typeof widgetURL> | ReturnType<typeof activityBackgroundTint> | ReturnType<typeof containerBackground>;
1239
+ export type BuiltInModifier = ReturnType<typeof listSectionSpacing> | ReturnType<typeof background> | ReturnType<typeof cornerRadius> | ReturnType<typeof shadow> | ReturnType<typeof frame> | ReturnType<typeof padding> | ReturnType<typeof fixedSize> | ReturnType<typeof ignoreSafeArea> | ReturnType<typeof onTapGesture> | ReturnType<typeof onLongPressGesture> | ReturnType<typeof onAppear> | ReturnType<typeof luminanceToAlpha> | ReturnType<typeof onDisappear> | ReturnType<typeof onGeometryChange> | ReturnType<typeof opacity> | ReturnType<typeof clipShape> | ReturnType<typeof border> | ReturnType<typeof strokeBorder> | ReturnType<typeof scaleEffect> | ReturnType<typeof rotationEffect> | ReturnType<typeof rotation3DEffect> | ReturnType<typeof offset> | ReturnType<typeof foregroundColor> | ReturnType<typeof foregroundStyle> | ReturnType<typeof bold> | ReturnType<typeof italic> | ReturnType<typeof monospacedDigit> | ReturnType<typeof tint> | ReturnType<typeof hidden> | ReturnType<typeof disabled> | ReturnType<typeof redacted> | ReturnType<typeof unredacted> | ReturnType<typeof privacySensitive> | ReturnType<typeof invalidatableContent> | ReturnType<typeof zIndex> | ReturnType<typeof blur> | ReturnType<typeof brightness> | ReturnType<typeof contrast> | ReturnType<typeof saturation> | ReturnType<typeof hueRotation> | ReturnType<typeof colorInvert> | ReturnType<typeof grayscale> | ReturnType<typeof buttonStyle> | ReturnType<typeof buttonBorderShape> | ReturnType<typeof toggleStyle> | ReturnType<typeof menuStyle> | ReturnType<typeof menuIndicator> | ReturnType<typeof controlSize> | ReturnType<typeof imageScale> | ReturnType<typeof labelStyle> | ReturnType<typeof labelsHidden> | ReturnType<typeof textFieldStyle> | ReturnType<typeof menuActionDismissBehavior> | ReturnType<typeof accessibilityLabel> | ReturnType<typeof accessibilityHint> | ReturnType<typeof accessibilityValue> | ReturnType<typeof accessibilityInputLabels> | ReturnType<typeof accessibilityIdentifier> | ReturnType<typeof accessibilityHidden> | ReturnType<typeof accessibilityElement> | ReturnType<typeof accessibilityAddTraits> | ReturnType<typeof accessibilityRemoveTraits> | ReturnType<typeof layoutPriority> | ReturnType<typeof mask> | ReturnType<typeof overlay> | ReturnType<typeof backgroundOverlay> | ReturnType<typeof aspectRatio> | ReturnType<typeof clipped> | ReturnType<typeof glassEffect> | ReturnType<typeof glassEffectId> | ReturnType<typeof geometryGroup> | ReturnType<typeof animation> | ReturnType<typeof containerShape> | ReturnType<typeof contentShape> | ReturnType<typeof containerRelativeFrame> | ReturnType<typeof scrollContentBackground> | ReturnType<typeof scrollDisabled> | ReturnType<typeof scrollIndicators> | ReturnType<typeof defaultScrollAnchor> | ReturnType<typeof defaultScrollAnchorForRole> | ReturnType<typeof scrollTargetBehavior> | ReturnType<typeof scrollTargetLayout> | ReturnType<typeof id> | ReturnType<typeof scrollPosition> | ReturnType<typeof onScrollPhaseChange> | NonNullable<ReturnType<typeof useScrollGeometryChange>> | ReturnType<typeof moveDisabled> | ReturnType<typeof deleteDisabled> | ReturnType<typeof environment> | ReturnType<typeof listRowBackground> | ReturnType<typeof listRowSeparator> | ReturnType<typeof listRowSeparatorTint> | ReturnType<typeof listRowSpacing> | ReturnType<typeof truncationMode> | ReturnType<typeof allowsTightening> | ReturnType<typeof kerning> | ReturnType<typeof textCase> | ReturnType<typeof underline> | ReturnType<typeof strikethrough> | ReturnType<typeof multilineTextAlignment> | ReturnType<typeof textSelection> | ReturnType<typeof lineSpacing> | ReturnType<typeof lineHeight> | ReturnType<typeof lineLimit> | ReturnType<typeof headerProminence> | ReturnType<typeof listRowInsets> | ReturnType<typeof badgeProminence> | ReturnType<typeof badge> | ReturnType<typeof listSectionMargins> | ReturnType<typeof font> | ReturnType<typeof dynamicTypeSize> | ReturnType<typeof gridCellUnsizedAxes> | ReturnType<typeof gridCellColumns> | ReturnType<typeof gridColumnAlignment> | ReturnType<typeof gridCellAnchor> | ReturnType<typeof submitLabel> | ReturnType<typeof keyboardType> | ReturnType<typeof autocorrectionDisabled> | ReturnType<typeof onSubmit> | ReturnType<typeof textInputAutocapitalization> | ReturnType<typeof textContentType> | ReturnType<typeof datePickerStyle> | ReturnType<typeof progressViewStyle> | ReturnType<typeof gaugeStyle> | ReturnType<typeof listStyle> | ReturnType<typeof contentTransition> | ReturnType<typeof resizable> | ReturnType<typeof symbolEffect> | ReturnType<typeof widgetAccentedRenderingMode> | ReturnType<typeof widgetURL> | ReturnType<typeof activityBackgroundTint> | ReturnType<typeof containerBackground>;
1188
1240
  /**
1189
1241
  * Main ViewModifier type that supports both built-in and 3rd party modifiers.
1190
1242
  * 3rd party modifiers should return ModifierConfig objects with their own type strings.