@expo/ui 58.0.21 → 58.0.23

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 (262) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +86 -2
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/expo/modules/ui/ComposeViews.kt +53 -29
  5. package/android/src/main/java/expo/modules/ui/CompositionLocalProviderView.kt +26 -0
  6. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +12 -0
  7. package/android/src/main/java/expo/modules/ui/HostView.kt +56 -9
  8. package/android/src/main/java/expo/modules/ui/MaskView.kt +3 -2
  9. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +43 -13
  10. package/android/src/main/java/expo/modules/ui/RNHostView.kt +11 -7
  11. package/android/src/main/java/expo/modules/ui/SwitchView.kt +6 -1
  12. package/android/src/main/java/expo/modules/ui/TopAppBarView.kt +62 -0
  13. package/android/src/main/java/expo/modules/ui/UniversalLayout.kt +610 -0
  14. package/android/src/main/java/expo/modules/ui/colors/MaterialColors.kt +61 -0
  15. package/android/src/main/java/expo/modules/ui/state/ObservableState.kt +2 -0
  16. package/android/src/main/java/expo/modules/ui/state/WorkletCallback.kt +2 -0
  17. package/build/community/bottom-sheet/BottomSheet.ios.js +8 -3
  18. package/build/community/bottom-sheet/BottomSheet.ios.js.map +1 -1
  19. package/build/community/pager-view/PagerView.ios.js +25 -8
  20. package/build/community/pager-view/PagerView.ios.js.map +1 -1
  21. package/build/community/segmented-control/SegmentedControl.ios.js +11 -2
  22. package/build/community/segmented-control/SegmentedControl.ios.js.map +1 -1
  23. package/build/community/segmented-control/types.d.ts +5 -1
  24. package/build/community/segmented-control/types.js.map +1 -1
  25. package/build/jetpack-compose/Column/index.d.ts +5 -0
  26. package/build/jetpack-compose/Column/index.js.map +1 -1
  27. package/build/jetpack-compose/CompositionLocalProvider/index.d.ts +28 -0
  28. package/build/jetpack-compose/CompositionLocalProvider/index.js +15 -0
  29. package/build/jetpack-compose/CompositionLocalProvider/index.js.map +1 -0
  30. package/build/jetpack-compose/Host/index.d.ts +8 -0
  31. package/build/jetpack-compose/Host/index.js +38 -5
  32. package/build/jetpack-compose/Host/index.js.map +1 -1
  33. package/build/jetpack-compose/Row/index.d.ts +5 -0
  34. package/build/jetpack-compose/Row/index.js.map +1 -1
  35. package/build/jetpack-compose/Switch/index.d.ts +2 -0
  36. package/build/jetpack-compose/Switch/index.js +1 -0
  37. package/build/jetpack-compose/Switch/index.js.map +1 -1
  38. package/build/jetpack-compose/TopAppBar/index.d.ts +72 -0
  39. package/build/jetpack-compose/TopAppBar/index.js +45 -0
  40. package/build/jetpack-compose/TopAppBar/index.js.map +1 -0
  41. package/build/jetpack-compose/index.d.ts +2 -0
  42. package/build/jetpack-compose/index.js +2 -0
  43. package/build/jetpack-compose/index.js.map +1 -1
  44. package/build/jetpack-compose/modifiers/index.d.ts +5 -1
  45. package/build/jetpack-compose/modifiers/index.js +6 -2
  46. package/build/jetpack-compose/modifiers/index.js.map +1 -1
  47. package/build/recycling/useRecycledRows.d.ts +2 -0
  48. package/build/recycling/useRecycledRows.js +1 -0
  49. package/build/recycling/useRecycledRows.js.map +1 -1
  50. package/build/swift-ui/BottomSheet/index.d.ts +6 -0
  51. package/build/swift-ui/BottomSheet/index.js +9 -3
  52. package/build/swift-ui/BottomSheet/index.js.map +1 -1
  53. package/build/swift-ui/HStack/index.d.ts +6 -0
  54. package/build/swift-ui/HStack/index.js.map +1 -1
  55. package/build/swift-ui/VStack/index.d.ts +6 -0
  56. package/build/swift-ui/VStack/index.js.map +1 -1
  57. package/build/universal/Button/index.android.js +3 -1
  58. package/build/universal/Button/index.android.js.map +1 -1
  59. package/build/universal/Button/index.ios.js +3 -1
  60. package/build/universal/Button/index.ios.js.map +1 -1
  61. package/build/universal/Checkbox/index.android.js +16 -4
  62. package/build/universal/Checkbox/index.android.js.map +1 -1
  63. package/build/universal/Collapsible/index.ios.js +1 -0
  64. package/build/universal/Collapsible/index.ios.js.map +1 -1
  65. package/build/universal/Column/index.android.js +4 -1
  66. package/build/universal/Column/index.android.js.map +1 -1
  67. package/build/universal/Column/index.ios.js +2 -0
  68. package/build/universal/Column/index.ios.js.map +1 -1
  69. package/build/universal/Column/index.js +13 -4
  70. package/build/universal/Column/index.js.map +1 -1
  71. package/build/universal/FieldGroup/FieldGroup.android.js +3 -1
  72. package/build/universal/FieldGroup/FieldGroup.android.js.map +1 -1
  73. package/build/universal/FieldGroup/FieldGroup.ios.js +3 -1
  74. package/build/universal/FieldGroup/FieldGroup.ios.js.map +1 -1
  75. package/build/universal/FieldGroup/FieldSection.android.js +13 -4
  76. package/build/universal/FieldGroup/FieldSection.android.js.map +1 -1
  77. package/build/universal/FieldGroup/FieldSection.ios.js +3 -1
  78. package/build/universal/FieldGroup/FieldSection.ios.js.map +1 -1
  79. package/build/universal/Icon/index.android.js +3 -1
  80. package/build/universal/Icon/index.android.js.map +1 -1
  81. package/build/universal/Icon/index.ios.js +3 -1
  82. package/build/universal/Icon/index.ios.js.map +1 -1
  83. package/build/universal/List/ListForEach.android.d.ts +7 -0
  84. package/build/universal/List/ListForEach.android.js +6 -0
  85. package/build/universal/List/ListForEach.android.js.map +1 -0
  86. package/build/universal/List/ListForEach.d.ts +5 -0
  87. package/build/universal/List/ListForEach.ios.d.ts +5 -0
  88. package/build/universal/List/ListForEach.ios.js +11 -0
  89. package/build/universal/List/ListForEach.ios.js.map +1 -0
  90. package/build/universal/List/ListForEach.js +263 -0
  91. package/build/universal/List/ListForEach.js.map +1 -0
  92. package/build/universal/List/ListScrollContext.d.ts +5 -0
  93. package/build/universal/List/ListScrollContext.js +6 -0
  94. package/build/universal/List/ListScrollContext.js.map +1 -0
  95. package/build/universal/List/index.android.d.ts +5 -0
  96. package/build/universal/List/index.android.js +3 -0
  97. package/build/universal/List/index.android.js.map +1 -1
  98. package/build/universal/List/index.d.ts +5 -0
  99. package/build/universal/List/index.ios.d.ts +5 -0
  100. package/build/universal/List/index.ios.js +3 -0
  101. package/build/universal/List/index.ios.js.map +1 -1
  102. package/build/universal/List/index.js +12 -1
  103. package/build/universal/List/index.js.map +1 -1
  104. package/build/universal/List/types.d.ts +42 -1
  105. package/build/universal/List/types.js +1 -3
  106. package/build/universal/List/types.js.map +1 -1
  107. package/build/universal/RNHostView/index.android.js +3 -1
  108. package/build/universal/RNHostView/index.android.js.map +1 -1
  109. package/build/universal/Row/index.android.js +4 -1
  110. package/build/universal/Row/index.android.js.map +1 -1
  111. package/build/universal/Row/index.ios.js +2 -0
  112. package/build/universal/Row/index.ios.js.map +1 -1
  113. package/build/universal/Row/index.js +13 -7
  114. package/build/universal/Row/index.js.map +1 -1
  115. package/build/universal/ScrollView/index.android.js +8 -1
  116. package/build/universal/ScrollView/index.android.js.map +1 -1
  117. package/build/universal/ScrollView/index.ios.js +15 -7
  118. package/build/universal/ScrollView/index.ios.js.map +1 -1
  119. package/build/universal/Spacer/index.android.js +3 -1
  120. package/build/universal/Spacer/index.android.js.map +1 -1
  121. package/build/universal/Spacer/index.ios.js +3 -1
  122. package/build/universal/Spacer/index.ios.js.map +1 -1
  123. package/build/universal/Switch/index.android.js +17 -4
  124. package/build/universal/Switch/index.android.js.map +1 -1
  125. package/build/universal/Switch/index.js +1 -0
  126. package/build/universal/Switch/index.js.map +1 -1
  127. package/build/universal/Text/index.android.js +3 -1
  128. package/build/universal/Text/index.android.js.map +1 -1
  129. package/build/universal/Text/index.ios.js +3 -1
  130. package/build/universal/Text/index.ios.js.map +1 -1
  131. package/build/universal/Text/index.js +2 -2
  132. package/build/universal/Text/index.js.map +1 -1
  133. package/build/universal/TextInput/index.android.js +22 -7
  134. package/build/universal/TextInput/index.android.js.map +1 -1
  135. package/build/universal/TextInput/index.ios.js +1 -0
  136. package/build/universal/TextInput/index.ios.js.map +1 -1
  137. package/build/universal/index.d.ts +1 -1
  138. package/build/universal/modifierUtils.d.ts +34 -1
  139. package/build/universal/modifierUtils.js +98 -2
  140. package/build/universal/modifierUtils.js.map +1 -1
  141. package/build/universal/stackAxis.d.ts +9 -0
  142. package/build/universal/stackAxis.js +11 -0
  143. package/build/universal/stackAxis.js.map +1 -0
  144. package/build/universal/transformStyle.android.d.ts +6 -2
  145. package/build/universal/transformStyle.android.js +18 -11
  146. package/build/universal/transformStyle.android.js.map +1 -1
  147. package/build/universal/transformStyle.ios.d.ts +5 -1
  148. package/build/universal/transformStyle.ios.js +29 -11
  149. package/build/universal/transformStyle.ios.js.map +1 -1
  150. package/build/universal/types.d.ts +26 -1
  151. package/build/universal/types.js.map +1 -1
  152. package/build/universal/webUtils.js +4 -0
  153. package/build/universal/webUtils.js.map +1 -1
  154. package/ios/BottomSheetView.swift +11 -2
  155. package/ios/DatePickerView.swift +134 -9
  156. package/ios/GroupView.swift +3 -0
  157. package/ios/HStackView.swift +26 -2
  158. package/ios/HostView.swift +21 -12
  159. package/ios/Modifiers/SelectedSegmentTintColorModifier.swift +86 -0
  160. package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
  161. package/ios/RNHostView.swift +34 -16
  162. package/ios/ScrollViewComponent.swift +20 -0
  163. package/ios/UIBaseView.swift +4 -1
  164. package/ios/UniversalLayout.swift +691 -0
  165. package/ios/VStackView.swift +26 -2
  166. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.21/expo.modules.ui-58.0.21-sources.jar → 58.0.23/expo.modules.ui-58.0.23-sources.jar} +0 -0
  167. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.md5 +1 -0
  168. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha1 +1 -0
  169. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha256 +1 -0
  170. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha512 +1 -0
  171. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar +0 -0
  172. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.md5 +1 -0
  173. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha1 +1 -0
  174. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha256 +1 -0
  175. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha512 +1 -0
  176. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.21/expo.modules.ui-58.0.21.module → 58.0.23/expo.modules.ui-58.0.23.module} +22 -22
  177. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.md5 +1 -0
  178. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha1 +1 -0
  179. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha256 +1 -0
  180. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha512 +1 -0
  181. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.21/expo.modules.ui-58.0.21.pom → 58.0.23/expo.modules.ui-58.0.23.pom} +1 -1
  182. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.md5 +1 -0
  183. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha1 +1 -0
  184. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha256 +1 -0
  185. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha512 +1 -0
  186. package/package.json +2 -2
  187. package/src/community/bottom-sheet/BottomSheet.ios.tsx +7 -3
  188. package/src/community/pager-view/PagerView.ios.tsx +25 -8
  189. package/src/community/segmented-control/SegmentedControl.ios.tsx +13 -1
  190. package/src/community/segmented-control/types.tsx +5 -1
  191. package/src/jetpack-compose/Column/index.tsx +5 -0
  192. package/src/jetpack-compose/CompositionLocalProvider/index.tsx +43 -0
  193. package/src/jetpack-compose/Host/index.tsx +50 -4
  194. package/src/jetpack-compose/Row/index.tsx +5 -0
  195. package/src/jetpack-compose/Switch/index.tsx +4 -0
  196. package/src/jetpack-compose/TopAppBar/index.tsx +113 -0
  197. package/src/jetpack-compose/index.ts +2 -0
  198. package/src/jetpack-compose/modifiers/index.ts +11 -3
  199. package/src/recycling/useRecycledRows.tsx +3 -0
  200. package/src/swift-ui/BottomSheet/index.tsx +24 -3
  201. package/src/swift-ui/HStack/index.tsx +6 -0
  202. package/src/swift-ui/VStack/index.tsx +6 -0
  203. package/src/universal/Button/index.android.tsx +3 -1
  204. package/src/universal/Button/index.ios.tsx +2 -1
  205. package/src/universal/Checkbox/index.android.tsx +24 -5
  206. package/src/universal/Collapsible/index.ios.tsx +4 -1
  207. package/src/universal/Column/index.android.tsx +3 -1
  208. package/src/universal/Column/index.ios.tsx +2 -1
  209. package/src/universal/Column/index.tsx +9 -4
  210. package/src/universal/FieldGroup/FieldGroup.android.tsx +8 -1
  211. package/src/universal/FieldGroup/FieldGroup.ios.tsx +2 -1
  212. package/src/universal/FieldGroup/FieldSection.android.tsx +17 -4
  213. package/src/universal/FieldGroup/FieldSection.ios.tsx +2 -1
  214. package/src/universal/Icon/index.android.tsx +2 -1
  215. package/src/universal/Icon/index.ios.tsx +2 -1
  216. package/src/universal/List/ListForEach.android.tsx +6 -0
  217. package/src/universal/List/ListForEach.ios.tsx +9 -0
  218. package/src/universal/List/ListForEach.tsx +246 -0
  219. package/src/universal/List/ListScrollContext.ts +6 -0
  220. package/src/universal/List/index.android.tsx +5 -0
  221. package/src/universal/List/index.ios.tsx +5 -0
  222. package/src/universal/List/index.tsx +11 -2
  223. package/src/universal/List/types.ts +45 -1
  224. package/src/universal/RNHostView/index.android.tsx +2 -1
  225. package/src/universal/Row/index.android.tsx +3 -1
  226. package/src/universal/Row/index.ios.tsx +2 -1
  227. package/src/universal/Row/index.tsx +9 -10
  228. package/src/universal/ScrollView/index.android.tsx +15 -3
  229. package/src/universal/ScrollView/index.ios.tsx +16 -4
  230. package/src/universal/Spacer/index.android.tsx +6 -4
  231. package/src/universal/Spacer/index.ios.tsx +2 -1
  232. package/src/universal/Switch/index.android.tsx +23 -4
  233. package/src/universal/Switch/index.tsx +1 -0
  234. package/src/universal/Text/index.android.tsx +2 -1
  235. package/src/universal/Text/index.ios.tsx +2 -1
  236. package/src/universal/Text/index.tsx +2 -2
  237. package/src/universal/TextInput/index.android.tsx +26 -5
  238. package/src/universal/TextInput/index.ios.tsx +1 -1
  239. package/src/universal/index.ts +6 -1
  240. package/src/universal/modifierUtils.ts +159 -2
  241. package/src/universal/stackAxis.ts +17 -0
  242. package/src/universal/transformStyle.android.ts +30 -12
  243. package/src/universal/transformStyle.ios.ts +41 -13
  244. package/src/universal/types.ts +27 -3
  245. package/src/universal/webUtils.ts +4 -0
  246. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21-sources.jar.md5 +0 -1
  247. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21-sources.jar.sha1 +0 -1
  248. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21-sources.jar.sha256 +0 -1
  249. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21-sources.jar.sha512 +0 -1
  250. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar +0 -0
  251. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.md5 +0 -1
  252. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha1 +0 -1
  253. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha256 +0 -1
  254. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.aar.sha512 +0 -1
  255. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.md5 +0 -1
  256. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha1 +0 -1
  257. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha256 +0 -1
  258. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.module.sha512 +0 -1
  259. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.md5 +0 -1
  260. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha1 +0 -1
  261. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha256 +0 -1
  262. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.21/expo.modules.ui-58.0.21.pom.sha512 +0 -1
@@ -8,12 +8,108 @@
8
8
  * functional props (for example `onPress`, `onAppear`, `disabled`) must not
9
9
  * go through this filter, or a user modifier of the same type would silently
10
10
  * disable the prop.
11
- */ export function omitUserOverridden(derived, userModifiers) {
11
+ */ export function omitUserOverridden(derived, userModifiers, preservedTypes) {
12
12
  if (!userModifiers?.length) {
13
13
  return derived;
14
14
  }
15
15
  const userTypes = new Set(userModifiers.map((modifier)=>modifier.$type));
16
- return derived.filter((modifier)=>!userTypes.has(modifier.$type));
16
+ return derived.filter((modifier)=>preservedTypes?.has(modifier.$type) || !userTypes.has(modifier.$type));
17
+ }
18
+ const PERCENTAGE_PATTERN = /^(?:\d+(?:\.\d+)?|\.\d+)%$/;
19
+ const warnedInvalidDimensions = new Set();
20
+ function warnInvalidDimension(componentName, axis, value) {
21
+ if (!__DEV__) return;
22
+ const warningKey = `${componentName}:${axis}`;
23
+ if (warnedInvalidDimensions.has(warningKey)) return;
24
+ warnedInvalidDimensions.add(warningKey);
25
+ console.warn(`[Expo UI] Ignoring invalid ${axis} on ${componentName}: ${String(value)}. ` + 'Expected a finite, non-negative number or percentage.');
26
+ }
27
+ function serializeDimension(value, componentName, axis) {
28
+ if (value == null) return {};
29
+ if (typeof value === 'number') {
30
+ if (Number.isFinite(value) && value >= 0) return {
31
+ points: value
32
+ };
33
+ warnInvalidDimension(componentName, axis, value);
34
+ return {};
35
+ }
36
+ if (typeof value === 'string' && PERCENTAGE_PATTERN.test(value)) {
37
+ const percentage = Number(value.slice(0, -1));
38
+ if (Number.isFinite(percentage) && percentage >= 0) {
39
+ return {
40
+ fraction: percentage / 100
41
+ };
42
+ }
43
+ }
44
+ warnInvalidDimension(componentName, axis, value);
45
+ return {};
46
+ }
47
+ export function serializeUniversalDimensions(style, componentName = 'universal component') {
48
+ const width = serializeDimension(style?.width, componentName, 'width');
49
+ const height = serializeDimension(style?.height, componentName, 'height');
50
+ return {
51
+ widthPoints: width.points,
52
+ widthFraction: width.fraction,
53
+ heightPoints: height.points,
54
+ heightFraction: height.fraction
55
+ };
56
+ }
57
+ /**
58
+ * Which axes a user modifier already owns.
59
+ * `weight` applies to the parent's main axis, so the cross axis still comes from `style`.
60
+ * `defaultMinSize` only applies when the incoming constraint is 0, so it does not replace a size.
61
+ * A `frame` owns an axis only when it sets `width` or `height`.
62
+ * A minimum or maximum limits that size.
63
+ */ export function getUserSizingOverrides(userModifiers, platform) {
64
+ let width = false;
65
+ let height = false;
66
+ for (const modifier of userModifiers ?? []){
67
+ if (platform === 'android') {
68
+ if (modifier.$type === 'size' || modifier.$type === 'fillMaxSize') {
69
+ width = true;
70
+ height = true;
71
+ } else if (modifier.$type === 'width' || modifier.$type === 'fillMaxWidth' || modifier.$type === 'wrapContentWidth') {
72
+ width = true;
73
+ } else if (modifier.$type === 'height' || modifier.$type === 'fillMaxHeight' || modifier.$type === 'wrapContentHeight') {
74
+ height = true;
75
+ }
76
+ continue;
77
+ }
78
+ if (modifier.$type === 'frame') {
79
+ width ||= modifier.width != null;
80
+ height ||= modifier.height != null;
81
+ } else if (modifier.$type === 'containerRelativeFrame') {
82
+ width ||= modifier.axes === 'horizontal' || modifier.axes === 'both';
83
+ height ||= modifier.axes === 'vertical' || modifier.axes === 'both';
84
+ } else if (modifier.$type === 'fixedSize') {
85
+ const hasExplicitAxis = modifier.horizontal != null || modifier.vertical != null;
86
+ width ||= hasExplicitAxis ? modifier.horizontal === true : true;
87
+ height ||= hasExplicitAxis ? modifier.vertical === true : true;
88
+ }
89
+ }
90
+ return {
91
+ width,
92
+ height
93
+ };
94
+ }
95
+ export function omitUserOverriddenDimensions(dimensions, userModifiers, platform) {
96
+ const overrides = getUserSizingOverrides(userModifiers, platform);
97
+ return {
98
+ widthPoints: overrides.width ? undefined : dimensions.widthPoints,
99
+ widthFraction: overrides.width ? undefined : dimensions.widthFraction,
100
+ heightPoints: overrides.height ? undefined : dimensions.heightPoints,
101
+ heightFraction: overrides.height ? undefined : dimensions.heightFraction
102
+ };
103
+ }
104
+ export function createUniversalLayoutModifier(dimensions) {
105
+ const hasDimension = Object.values(dimensions).some((value)=>value != null);
106
+ return hasDimension ? {
107
+ $type: 'universalLayout',
108
+ ...dimensions
109
+ } : undefined;
110
+ }
111
+ export function resetUniversalDimensionWarningsForTests() {
112
+ warnedInvalidDimensions.clear();
17
113
  }
18
114
 
19
115
  //# sourceMappingURL=modifierUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["universal/modifierUtils.ts"],"sourcesContent":[null],"names":["omitUserOverridden","derived","userModifiers","length","userTypes","Set","map","modifier","$type","filter","has"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASA,mBACdC,OAAY,EACZC,aAAyC;IAEzC,IAAI,CAACA,eAAeC,QAAQ;QAC1B,OAAOF;IACT;IACA,MAAMG,YAAY,IAAIC,IAAIH,cAAcI,GAAG,CAAC,CAACC,WAAaA,SAASC,KAAK;IACxE,OAAOP,QAAQQ,MAAM,CAAC,CAACF,WAAa,CAACH,UAAUM,GAAG,CAACH,SAASC,KAAK;AACnE"}
1
+ {"version":3,"sources":["universal/modifierUtils.ts"],"sourcesContent":[null],"names":["omitUserOverridden","derived","userModifiers","preservedTypes","length","userTypes","Set","map","modifier","$type","filter","has","PERCENTAGE_PATTERN","warnedInvalidDimensions","warnInvalidDimension","componentName","axis","value","__DEV__","warningKey","add","console","warn","String","serializeDimension","Number","isFinite","points","test","percentage","slice","fraction","serializeUniversalDimensions","style","width","height","widthPoints","widthFraction","heightPoints","heightFraction","getUserSizingOverrides","platform","axes","hasExplicitAxis","horizontal","vertical","omitUserOverriddenDimensions","dimensions","overrides","undefined","createUniversalLayoutModifier","hasDimension","Object","values","some","resetUniversalDimensionWarningsForTests","clear"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASA,mBACdC,OAAY,EACZC,aAAyC,EACzCC,cAAoC;IAEpC,IAAI,CAACD,eAAeE,QAAQ;QAC1B,OAAOH;IACT;IACA,MAAMI,YAAY,IAAIC,IAAIJ,cAAcK,GAAG,CAAC,CAACC,WAAaA,SAASC,KAAK;IACxE,OAAOR,QAAQS,MAAM,CACnB,CAACF,WAAaL,gBAAgBQ,IAAIH,SAASC,KAAK,KAAK,CAACJ,UAAUM,GAAG,CAACH,SAASC,KAAK;AAEtF;AAyBA,MAAMG,qBAAqB;AAC3B,MAAMC,0BAA0B,IAAIP;AAEpC,SAASQ,qBAAqBC,aAAqB,EAAEC,IAAmB,EAAEC,KAAc;IACtF,IAAI,CAACC,SAAS;IAEd,MAAMC,aAAa,GAAGJ,cAAc,CAAC,EAAEC,MAAM;IAC7C,IAAIH,wBAAwBF,GAAG,CAACQ,aAAa;IAC7CN,wBAAwBO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MI,eAAeC,OAAOC,MAAM,CAACN,YAAYO,IAAI,CAAC,CAACrC,QAAUA,SAAS;IACxE,OAAOkC,eAAe;QAAE1C,OAAO;QAAmB,GAAGsC,UAAU;IAAC,IAAIE;AACtE;AAEA,OAAO,SAASM;IACd1C,wBAAwB2C,KAAK;AAC/B"}
@@ -0,0 +1,9 @@
1
+ import type { UniversalStyle } from './types';
2
+ export type StackAxis = 'horizontal' | 'vertical';
3
+ /**
4
+ * Main axis of the nearest universal `Row` or `Column` on web.
5
+ * A plain view lays its children out vertically, so that is the default.
6
+ */
7
+ export declare const StackAxisContext: import("react").Context<StackAxis>;
8
+ /** The size `style` sets on the parent's cross axis, if any. */
9
+ export declare function useCrossAxisSize(style: UniversalStyle | undefined): import("./modifierUtils").UniversalDimension | undefined;
@@ -0,0 +1,11 @@
1
+ import { createContext, useContext } from 'react';
2
+ /**
3
+ * Main axis of the nearest universal `Row` or `Column` on web.
4
+ * A plain view lays its children out vertically, so that is the default.
5
+ */ export const StackAxisContext = createContext('vertical');
6
+ /** The size `style` sets on the parent's cross axis, if any. */ export function useCrossAxisSize(style) {
7
+ const parentAxis = useContext(StackAxisContext);
8
+ return parentAxis === 'horizontal' ? style?.height : style?.width;
9
+ }
10
+
11
+ //# sourceMappingURL=stackAxis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["universal/stackAxis.ts"],"sourcesContent":[null],"names":["createContext","useContext","StackAxisContext","useCrossAxisSize","style","parentAxis","height","width"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AAMlD;;;CAGC,GACD,OAAO,MAAMC,mBAAmBF,cAAyB,YAAY;AAErE,8DAA8D,GAC9D,OAAO,SAASG,iBAAiBC,KAAiC;IAChE,MAAMC,aAAaJ,WAAWC;IAC9B,OAAOG,eAAe,eAAeD,OAAOE,SAASF,OAAOG;AAC9D"}
@@ -6,10 +6,14 @@ import type { UniversalBaseProps, UniversalStyle } from './types';
6
6
  *
7
7
  * Compose modifiers apply outside-in (left to right). To match React Native's
8
8
  * box model where background includes the padding area and border is outermost:
9
- * sizing → border → clip → background → padding → opacity
9
+ * universal layout → fixed size → border → clip → background → padding → opacity
10
10
  * → events → behavior → user escape-hatch
11
11
  *
12
+ * Fixed sizes become `size`, `width`, or `height`.
13
+ * Percentages stay on `universalLayout` so the parent stack can resolve them.
12
14
  * Style-derived modifiers yield to user-supplied modifiers of the same
13
15
  * `$type`, so the escape hatch can override anything derived from props.
14
16
  */
15
- export declare function transformToModifiers(style: UniversalStyle | undefined, props: Pick<UniversalBaseProps, 'onPress' | 'disabled' | 'hidden' | 'testID'>, extraModifiers?: ModifierConfig[]): ModifierConfig[];
17
+ export declare function transformToModifiers(style: UniversalStyle | undefined, props: Pick<UniversalBaseProps, 'onPress' | 'disabled' | 'hidden' | 'testID'>, extraModifiers?: ModifierConfig[], options?: {
18
+ componentName?: string;
19
+ }): ModifierConfig[];
@@ -1,27 +1,34 @@
1
1
  import { alpha, background, border, clickable, clip, height, padding, paddingAll, Shapes, size, testID as testIDModifier, width } from '@expo/ui/jetpack-compose/modifiers';
2
- import { omitUserOverridden } from './modifierUtils';
2
+ import { createUniversalLayoutModifier, omitUserOverridden, omitUserOverriddenDimensions, serializeUniversalDimensions } from './modifierUtils';
3
3
  /**
4
4
  * Converts universal style/event/lifecycle/behavior props into a Jetpack
5
5
  * Compose modifier array.
6
6
  *
7
7
  * Compose modifiers apply outside-in (left to right). To match React Native's
8
8
  * box model where background includes the padding area and border is outermost:
9
- * sizing → border → clip → background → padding → opacity
9
+ * universal layout → fixed size → border → clip → background → padding → opacity
10
10
  * → events → behavior → user escape-hatch
11
11
  *
12
+ * Fixed sizes become `size`, `width`, or `height`.
13
+ * Percentages stay on `universalLayout` so the parent stack can resolve them.
12
14
  * Style-derived modifiers yield to user-supplied modifiers of the same
13
15
  * `$type`, so the escape hatch can override anything derived from props.
14
- */ export function transformToModifiers(style, props, extraModifiers) {
16
+ */ export function transformToModifiers(style, props, extraModifiers, options) {
15
17
  let mods = [];
18
+ const dimensions = omitUserOverriddenDimensions(serializeUniversalDimensions(style, options?.componentName), extraModifiers, 'android');
19
+ const fixedWidth = dimensions.widthPoints;
20
+ const fixedHeight = dimensions.heightPoints;
21
+ const universalLayoutModifier = createUniversalLayoutModifier(dimensions);
22
+ if (universalLayoutModifier) mods.push(universalLayoutModifier);
23
+ // Fixed sizing is applied directly. Percentages remain as parent data for
24
+ // the owning universal layout to resolve against its content box.
25
+ if (fixedWidth != null && fixedHeight != null) {
26
+ mods.push(size(fixedWidth, fixedHeight));
27
+ } else {
28
+ if (fixedWidth != null) mods.push(width(fixedWidth));
29
+ if (fixedHeight != null) mods.push(height(fixedHeight));
30
+ }
16
31
  if (style) {
17
- // Sizing (outermost)
18
- if (style.width != null && style.height != null) {
19
- mods.push(size(style.width, style.height));
20
- } else if (style.width != null) {
21
- mods.push(width(style.width));
22
- } else if (style.height != null) {
23
- mods.push(height(style.height));
24
- }
25
32
  // Border + background + borderRadius handling.
26
33
  // Compose's border() doesn't accept a shape, so when borderRadius is set
27
34
  // alongside border, we simulate a rounded border using layered backgrounds:
@@ -1 +1 @@
1
- {"version":3,"sources":["universal/transformStyle.android.ts"],"sourcesContent":[null],"names":["alpha","background","border","clickable","clip","height","padding","paddingAll","Shapes","size","testID","testIDModifier","width","omitUserOverridden","transformToModifiers","style","props","extraModifiers","mods","push","hasBorder","borderWidth","borderColor","hasRadius","borderRadius","radius","bw","RoundedCorner","String","Math","max","backgroundColor","all","top","paddingTop","paddingVertical","bottom","paddingBottom","start","paddingLeft","paddingHorizontal","end","paddingRight","opacity","onPress","hidden"],"mappings":"AAAA,SACEA,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,UAAU,EACVC,MAAM,EACNC,IAAI,EACJC,UAAUC,cAAc,EACxBC,KAAK,QAEA,qCAAqC;AAE5C,SAASC,kBAAkB,QAAQ,kBAAkB;AAGrD;;;;;;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I,IAAIF;IAEjC,OAAOC;AACT"}
1
+ {"version":3,"sources":["universal/transformStyle.android.ts"],"sourcesContent":[null],"names":["alpha","background","border","clickable","clip","height","padding","paddingAll","Shapes","size","testID","testIDModifier","width","createUniversalLayoutModifier","omitUserOverridden","omitUserOverriddenDimensions","serializeUniversalDimensions","transformToModifiers","style","props","extraModifiers","options","mods","dimensions","componentName","fixedWidth","widthPoints","fixedHeight","heightPoints","universalLayoutModifier","push","hasBorder","borderWidth","borderColor","hasRadius","borderRadius","radius","bw","RoundedCorner","String","Math","max","backgroundColor","all","top","paddingTop","paddingVertical","bottom","paddingBottom","start","paddingLeft","paddingHorizontal","end","paddingRight","opacity","onPress","hidden"],"mappings":"AAAA,SACEA,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,UAAU,EACVC,MAAM,EACNC,IAAI,EACJC,UAAUC,cAAc,EACxBC,KAAK,QAEA,qCAAqC;AAE5C,SACEC,6BAA6B,EAC7BC,kBAAkB,EAClBC,4BAA4B,EAC5BC,4BAA4B,QACvB,kBAAkB;AAGzB;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,qBACdC,KAAiC,EACjCC,KAA6E,EAC7EC,cAAiC,EACjCC,OAAoC;IAEpC,IAAIC,OAAyB,EAAE;IAC/B,MAAMC,aAAaR,6BACjBC,6BAA6BE,OAAOG,SAASG,gBAC7CJ,gBACA;IAEF,MAAMK,aAAaF,WAAWG,WAAW;IACzC,MAAMC,cAAcJ,WAAWK,YAAY;IAC3C,MAAMC,0BAA0BhB,8BAA8BU;IAE9D,IAAIM,yBAAyBP,KAAKQ,IAAI,CAACD;IAEvC,0EAA0E;IAC1E,kEAAkE;IAClE,IAAIJ,cAAc,QAAQE,eAAe,MAAM;QAC7CL,KAAKQ,IAAI,CAACrB,KAAKgB,YAAYE;IAC7B,OAAO;QACL,IAAIF,cAAc,MAAMH,KAAKQ,IAAI,CAAClB,MAAMa;Q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IAAgB9B,MAAM4B,eAAe,IAAeH;YACvF,MAAMM,QAAQ,AAAC/B,MAAMgC,WAAW,IAAgBhC,MAAMiC,iBAAiB,IAAeR;YACtF,MAAMS,MAAM,AAAClC,MAAMmC,YAAY,IAAgBnC,MAAMiC,iBAAiB,IAAeR;YACrF,IAAIC,OAAOG,UAAUE,SAASG,KAAK;gBACjC,IAAIR,QAAQG,UAAUA,WAAWE,SAASA,UAAUG,KAAK;oBACvD9B,KAAKQ,IAAI,CAACvB,WAAWqC;gBACvB,OAAO;oBACLtB,KAAKQ,IAAI,CAACxB,QAAQ2C,OAAOL,KAAKQ,KAAKL;gBACrC;YACF;QACF;QAEA,UAAU;QACV,IAAI7B,MAAMoC,OAAO,IAAI,MAAM;YACzBhC,KAAKQ,IAAI,CAAC9B,MAAMkB,MAAMoC,OAAO;QAC/B;IACF;IAEA,2EAA2E;IAC3E,kEAAkE;IAClEhC,OAAOR,mBAAmBQ,MAAMF;IAEhC,2CAA2C;IAC3C,IAAID,MAAMoC,OAAO,EAAEjC,KAAKQ,IAAI,CAAC3B,UAAUgB,MAAMoC,OAAO;IAEpD,WAAW;IACX,IAAIpC,MAAMqC,MAAM,EAAElC,KAAKQ,IAAI,CAAC9B,MAAM;IAClC,IAAImB,MAAMT,MAAM,EAAEY,KAAKQ,IAAI,CAACnB,eAAeQ,MAAMT,MAAM;IACvD,wFAAwF;IAExF,mDAAmD;IACnD,IAAIU,gBAAgBE,KAAKQ,IAAI,IAAIV;IAEjC,OAAOE;AACT"}
@@ -7,13 +7,17 @@ import type { UniversalBaseProps, UniversalStyle } from './types';
7
7
  *
8
8
  * SwiftUI modifiers apply inside-out (each modifier wraps the previous).
9
9
  * To match React Native's box model (background fills the full box):
10
- * padding → sizing → background → clip → border → opacity
10
+ * padding → fixed frame → universal layout → background → border → clip → opacity
11
11
  * → events → lifecycle → behavior → user escape-hatch
12
12
  *
13
+ * Fixed sizes become a `frame`.
14
+ * Percentages stay on `universalLayout` so the parent stack can resolve them.
13
15
  * Style-derived modifiers yield to user-supplied modifiers of the same
14
16
  * `$type`, so the escape hatch can override anything derived from props.
15
17
  */
16
18
  export declare function transformToModifiers(style: UniversalStyle | undefined, props: Pick<UniversalBaseProps, 'onPress' | 'onAppear' | 'onDisappear' | 'disabled' | 'hidden' | 'testID'>, extraModifiers?: ModifierConfig[], options?: {
19
+ /** Component name included in invalid-dimension development warnings. */
20
+ componentName?: string;
17
21
  /** Alignment for the frame modifier (used by Column/Row). */
18
22
  frameAlignment?: Parameters<typeof frame>[0]['alignment'];
19
23
  /** Text-styling props for text-rendering components. */
@@ -1,5 +1,11 @@
1
1
  import { background, border, clipShape, contentShape, disabled as disabledMod, font, foregroundStyle, frame, hidden as hiddenMod, kerning, lineSpacing, multilineTextAlignment, onAppear, onDisappear, onTapGesture, opacity, padding, shapes } from '@expo/ui/swift-ui/modifiers';
2
- import { omitUserOverridden } from './modifierUtils';
2
+ import { createUniversalLayoutModifier, omitUserOverridden, omitUserOverriddenDimensions, serializeUniversalDimensions } from './modifierUtils';
3
+ // A user frame owns only the axes it sets. Keep a derived frame that still
4
+ // owns the other axis, and keep the layout value the parent stack reads.
5
+ const preservedSizingTypes = new Set([
6
+ 'frame',
7
+ 'universalLayout'
8
+ ]);
3
9
  const FONT_WEIGHT_MAP = {
4
10
  '100': 'ultraLight',
5
11
  '200': 'thin',
@@ -19,13 +25,18 @@ const FONT_WEIGHT_MAP = {
19
25
  *
20
26
  * SwiftUI modifiers apply inside-out (each modifier wraps the previous).
21
27
  * To match React Native's box model (background fills the full box):
22
- * padding → sizing → background → clip → border → opacity
28
+ * padding → fixed frame → universal layout → background → border → clip → opacity
23
29
  * → events → lifecycle → behavior → user escape-hatch
24
30
  *
31
+ * Fixed sizes become a `frame`.
32
+ * Percentages stay on `universalLayout` so the parent stack can resolve them.
25
33
  * Style-derived modifiers yield to user-supplied modifiers of the same
26
34
  * `$type`, so the escape hatch can override anything derived from props.
27
35
  */ export function transformToModifiers(style, props, extraModifiers, options) {
28
36
  let mods = [];
37
+ const dimensions = omitUserOverriddenDimensions(serializeUniversalDimensions(style, options?.componentName), extraModifiers, 'ios');
38
+ const fixedWidth = dimensions.widthPoints;
39
+ const fixedHeight = dimensions.heightPoints;
29
40
  // Text styling (innermost — applies to text content before container modifiers)
30
41
  const textStyle = options?.textStyle;
31
42
  if (textStyle) {
@@ -62,14 +73,19 @@ const FONT_WEIGHT_MAP = {
62
73
  trailing: style.paddingRight
63
74
  }));
64
75
  }
65
- // Sizing (before background so background fills the frame)
66
- if (style.width != null || style.height != null) {
67
- mods.push(frame({
68
- width: style.width,
69
- height: style.height,
70
- alignment: options?.frameAlignment
71
- }));
72
- }
76
+ }
77
+ // Fixed sizing is applied directly. Percentages remain as layout values for
78
+ // the owning universal layout to resolve against its content box.
79
+ if (fixedWidth != null || fixedHeight != null) {
80
+ mods.push(frame({
81
+ width: fixedWidth,
82
+ height: fixedHeight,
83
+ alignment: options?.frameAlignment
84
+ }));
85
+ }
86
+ const universalLayoutModifier = createUniversalLayoutModifier(dimensions);
87
+ if (universalLayoutModifier) mods.push(universalLayoutModifier);
88
+ if (style) {
73
89
  // Background (fills the frame area including padding)
74
90
  if (style.backgroundColor) {
75
91
  mods.push(background(style.backgroundColor));
@@ -92,7 +108,9 @@ const FONT_WEIGHT_MAP = {
92
108
  }
93
109
  // A user-supplied modifier replaces any style-derived modifier of the same
94
110
  // type. The event, lifecycle, and behavior modifiers below are never dropped.
95
- mods = omitUserOverridden(mods, extraModifiers);
111
+ // Axis-aware sizing precedence has already removed only the dimensions set
112
+ // by a user frame. Preserve any derived frame that still owns the other axis.
113
+ mods = omitUserOverridden(mods, extraModifiers, preservedSizingTypes);
96
114
  // Events. SwiftUI only hit-tests drawn content, so the `contentShape` lets
97
115
  // taps on empty space (for example a `Spacer` in a `Row`) reach `onPress`.
98
116
  if (props.onPress) mods.push(contentShape(shapes.rectangle()), onTapGesture(props.onPress));
@@ -1 +1 @@
1
- {"version":3,"sources":["universal/transformStyle.ios.ts"],"sourcesContent":[null],"names":["background","border","clipShape","contentShape","disabled","disabledMod","font","foregroundStyle","frame","hidden","hiddenMod","kerning","lineSpacing","multilineTextAlignment","onAppear","onDisappear","onTapGesture","opacity","padding","shapes","omitUserOverridden","FONT_WEIGHT_MAP","normal","bold","transformToModifiers","style","props","extraModifiers","options","mods","textStyle","fontFamily","fontSize","fontWeight","push","family","size","weight","undefined","color","letterSpacing","lineHeight","baseFontSize","Math","max","textAlign","hasPadding","paddingHorizontal","paddingVertical","paddingTop","paddingBottom","paddingLeft","paddingRight","all","horizontal","vertical","top","bottom","leading","trailing","width","height","alignment","frameAlignment","backgroundColor","borderWidth","borderColor","content","borderRadius","onPress","rectangle"],"mappings":"AAAA,SACEA,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,YAAY,EACZC,YAAYC,WAAW,EACvBC,IAAI,EACJC,eAAe,EACfC,KAAK,EACLC,UAAUC,SAAS,EACnBC,OAAO,EACPC,WAAW,EACXC,sBAAsB,EACtBC,QAAQ,EACRC,WAAW,EACXC,YAAY,EACZC,OAAO,EACPC,OAAO,EACPC,MAAM,QAED,8BAA8B;AAGrC,SAASC,kBAAkB,QAAQ,kBAAkB;AAGrD,MAAMC,kBAAwE;IAC5E,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACPC,QAAQ;IACRC,MAAM;AACR;AAEA;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,qBACdC,KAAiC,EACjCC,KAGC,EACDC,cAAiC,EACjCC,OAKC;IAED,IAAIC,OAAyB,EAAE;IAE/B,gFAAgF;IAChF,MAAMC,YAAYF,SAASE;IAC3B,IAAIA,WAAW;QACb,IACEA,UAAUC,UAAU,IAAI,QACxBD,UAAUE,QAAQ,IAAI,QACtBF,UAAUG,UAAU,IAAI,MACxB;YACAJ,KAAKK,IAAI,CACP5B,KAAK;gBACH6B,QAAQL,UAAUC,UAAU;gBAC5B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AAIqB,MAAMjB,MAAM,EAAEoB,KAAKK,IAAI,CAACxB,UAAU;IAEtC,mDAAmD;IACnD,IAAIiB,gBAAgBE,KAAKK,IAAI,IAAIP;IAEjC,OAAOE;AACT"}
1
+ {"version":3,"sources":["universal/transformStyle.ios.ts"],"sourcesContent":[null],"names":["background","border","clipShape","contentShape","disabled","disabledMod","font","foregroundStyle","frame","hidden","hiddenMod","kerning","lineSpacing","multilineTextAlignment","onAppear","onDisappear","onTapGesture","opacity","padding","shapes","createUniversalLayoutModifier","omitUserOverridden","omitUserOverriddenDimensions","serializeUniversalDimensions","preservedSizingTypes","Set","FONT_WEIGHT_MAP","normal","bold","transformToModifiers","style","props","extraModifiers","options","mods","dimensions","componentName","fixedWidth","widthPoints","fixedHeight","heightPoints","textStyle","fontFamily","fontSize","fontWeight","push","family","size","weight","undefined","color","letterSpacing","lineHeight","baseFontSize","Math","max","textAlign","hasPadding","paddingHorizontal","paddingVertical","paddingTop","paddingBottom","paddingLeft","paddingRight","all","horizontal","vertical","top","bottom","leading","trailing","width","height","alignment","frameAlignment","universalLayoutModifier","backgroundColor","borderWidth","borderColor","content","borderRadius","onPress","rectangle"],"mappings":"AAAA,SACEA,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,YAAY,EACZC,YAAYC,WAAW,EACvBC,IAAI,EACJC,eAAe,EACfC,KAAK,EACLC,UAAUC,SAAS,EACnBC,OAAO,EACPC,WAAW,EACXC,sBAAsB,EACtBC,QAAQ,EACRC,WAAW,EACXC,YAAY,EACZC,OAAO,EACPC,OAAO,EACPC,MAAM,QAED,8BAA8B;AAGrC,SACEC,6BAA6B,EAC7BC,kBAAkB,EAClBC,4BAA4B,EAC5BC,4BAA4B,QACvB,kBAAkB;AAGzB,2EAA2E;AAC3E,yEAAyE;AACzE,MAAMC,uBAAuB,IAAIC,IAAI;IAAC;IAAS;CAAkB;AAEjE,MAAMC,kBAAwE;IAC5E,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,O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B9C,KAAKW,IAAI,CAAC3C,UAAU,oBAAoB4B,MAAMkD,YAAY;QAC5D;QAEA,UAAU;QACV,IAAIlD,MAAMb,OAAO,IAAI,MAAM;YACzBiB,KAAKW,IAAI,CAAC5B,QAAQa,MAAMb,OAAO;QACjC;IACF;IAEA,2EAA2E;IAC3E,8EAA8E;IAC9E,2EAA2E;IAC3E,8EAA8E;IAC9EiB,OAAOb,mBAAmBa,MAAMF,gBAAgBR;IAEhD,2EAA2E;IAC3E,2EAA2E;IAC3E,IAAIO,MAAMkD,OAAO,EAAE/C,KAAKW,IAAI,CAAC1C,aAAagB,OAAO+D,SAAS,KAAKlE,aAAae,MAAMkD,OAAO;IAEzF,YAAY;IACZ,IAAIlD,MAAMjB,QAAQ,EAAEoB,KAAKW,IAAI,CAAC/B,SAASiB,MAAMjB,QAAQ;IACrD,IAAIiB,MAAMhB,WAAW,EAAEmB,KAAKW,IAAI,CAAC9B,YAAYgB,MAAMhB,WAAW;IAE9D,WAAW;IACX,IAAIgB,MAAM3B,QAAQ,EAAE8B,KAAKW,IAAI,CAACxC,YAAY;IAC1C,IAAI0B,MAAMtB,MAAM,EAAEyB,KAAKW,IAAI,CAACnC,UAAU;IAEtC,mDAAmD;IACnD,IAAIsB,gBAAgBE,KAAKW,IAAI,IAAIb;IAEjC,OAAOE;AACT"}
@@ -1,11 +1,36 @@
1
1
  import type { ViewStyle } from 'react-native';
2
2
  import type { ModifierConfig } from '../types';
3
+ import type { UniversalDimension } from './modifierUtils';
4
+ export type { UniversalDimension } from './modifierUtils';
3
5
  /**
4
6
  * Subset of React Native `ViewStyle` that maps cleanly to both SwiftUI modifiers
5
7
  * and Jetpack Compose modifiers. On web, passes through to React Native StyleSheet.
8
+ *
9
+ * `width` and `height` also accept a percentage of the parent, such as `'50%'`.
10
+ * On Android and iOS, a percentage resolves when the parent is a universal `Row`, `Column`,
11
+ * or `Host` with a size on that axis.
12
+ * A universal `ScrollView` resolves the cross axis only.
13
+ * The scroll axis stays unbounded.
14
+ * On web, the value is passed through to the view style.
15
+ * A Jetpack Compose `Row` or `Column`, or a SwiftUI stack, does not resolve it.
6
16
  * @docsInline
7
17
  */
8
- export type UniversalStyle = Pick<ViewStyle, 'padding' | 'paddingHorizontal' | 'paddingVertical' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'backgroundColor' | 'borderRadius' | 'borderWidth' | 'borderColor' | 'opacity' | 'width' | 'height'>;
18
+ export type UniversalStyle = Pick<ViewStyle, 'padding' | 'paddingHorizontal' | 'paddingVertical' | 'paddingTop' | 'paddingBottom' | 'paddingLeft' | 'paddingRight' | 'backgroundColor' | 'borderRadius' | 'borderWidth' | 'borderColor' | 'opacity'> & {
19
+ /**
20
+ * Fixed size in density-independent pixels, or a percentage of the parent's content width.
21
+ * On Android and iOS, percentages resolve when the parent is a universal `Row`, `Column`,
22
+ * `ScrollView`, or `Host` with a defined width.
23
+ * A horizontal `ScrollView` leaves width unbounded.
24
+ */
25
+ width?: UniversalDimension;
26
+ /**
27
+ * Fixed size in density-independent pixels, or a percentage of the parent's content height.
28
+ * On Android and iOS, percentages resolve when the parent is a universal `Row`, `Column`,
29
+ * `ScrollView`, or `Host` with a defined height.
30
+ * A vertical `ScrollView` leaves height unbounded.
31
+ */
32
+ height?: UniversalDimension;
33
+ };
9
34
  /**
10
35
  * Base props inherited by all universal components.
11
36
  * @docsInline
@@ -1 +1 @@
1
- {"version":3,"sources":["universal/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAkHA;;;;;;;;;CASC,GACD,WAeE"}
1
+ {"version":3,"sources":["universal/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AA0IA;;;;;;;;;CASC,GACD,WAeE"}
@@ -91,6 +91,10 @@ export const globalCss = css`
91
91
  }
92
92
  }
93
93
 
94
+ [data-theme='light'] {
95
+ ${lightVariables}
96
+ }
97
+
94
98
  [data-theme='dark'] {
95
99
  ${darkVariables}
96
100
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["universal/webUtils.ts"],"sourcesContent":[null],"names":["processColor","unstable_createElement","createWebComponent","type","props","css","strings","values","reduce","acc","s","i","length","String","replace","trim","lightVariables","darkVariables","colors","background","foreground","red","primary","gray","durations","fast","base","slow","easings","standard","shadows","button","focus","input","globalCss","DEFAULT_PRIMARY_COLOR","srgbToLinear","c","Math","pow","linearToSrgb","hexToLch","hex","raw","body","Array","from","join","r","Number","parseInt","slice","g","b","l","cbrt","m","L","labA","labB","sqrt","atan2","lchToHex","chroma","hue","a","cos","sin","l_","m_","s_","bl","cl","max","min","round","map","x","toString","padStart","PRIMARY_STOPS","step","cMul","colorValueToHex","color","argb","generatePrimaryColorScale","C","H","scale","tgtL","newL","newC"],"mappings":"AACA,SACEA,YAAY,EACZC,sBAAsB,QAMjB,eAAe;AAetB,OAAO,MAAMC,qBACX,CAAwBC,OACxB,CAACC,QACCH,uBAAuBE,MAAMC,OAAO;AAExC,OAAO,MAAMC,MAAM,CAACC,SAA+B,GAAGC,SACpDD,QACGE,MAAM,CAAC,CAACC,KAAKC,GAAGC,IAAMF,MAAMC,IAAKC,CAAAA,IAAIJ,OAAOK,MAAM,GAAGC,OAAON,MAAM,CAACI,EAAE,IAAI,EAAC,GAAI,IAC9EG,OAAO,CAAC,QAAQ,KAChBC,IAAI,GAAG;AAEZ,MAAMC,iBAAiBX,GAAG,CAAC;;;;;;;;;;;;;;;;;AAiB3B,CAAC;AAED,MAAMY,gBAAgBZ,GAAG,CAAC;;;;;;;;;;;;;;;;;AAiB1B,CAAC;AAED,OAAO,MAAMa,SAAS;IACpBC,YAAY;IACZC,YAAY;IAEZC,KAAK;IAELC,SAAS;QACPF,YAAY;QACZ,IAAI;QACJ,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;IACP;IAEAG,MAAM;QACJ,IAAI;QACJ,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;Q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Z,uFAAuF;QACvF,gCAAgChC,IAAI,OAAO,YAAYK,SAAS;YAAC;YAAMyB,IAAI;YAAKC;SAAE;IACpF;IAEA,KAAK,MAAM,EAAEP,IAAI,EAAExB,GAAGiC,IAAI,EAAER,IAAI,EAAE,IAAIF,cAAe;QACnD,MAAMW,OAAOD,QAAQ,OAAOjC,IAAIiC;QAChC,MAAME,OAAOL,IAAIL;QACjBO,KAAK,CAAC,CAAC,kBAAkB,EAAER,MAAM,CAAC,GAAGnB,SAAS;YAAC6B;YAAMC;YAAMJ;SAAE;IAC/D;IAEA,OAAOC;AACT,EAAE"}
1
+ {"version":3,"sources":["universal/webUtils.ts"],"sourcesContent":[null],"names":["processColor","unstable_createElement","createWebComponent","type","props","css","strings","values","reduce","acc","s","i","length","String","replace","trim","lightVariables","darkVariables","colors","background","foreground","red","primary","gray","durations","fast","base","slow","easings","standard","shadows","button","focus","input","globalCss","DEFAULT_PRIMARY_COLOR","srgbToLinear","c","Math","pow","linearToSrgb","hexToLch","hex","raw","body","Array","from","join","r","Number","parseInt","slice","g","b","l","cbrt","m","L","labA","labB","sqrt","atan2","lchToHex","chroma","hue","a","cos","sin","l_","m_","s_","bl","cl","max","min","round","map","x","toString","padStart","PRIMARY_STOPS","step","cMul","colorValueToHex","color","argb","generatePrimaryColorScale","C","H","scale","tgtL","newL","newC"],"mappings":"AACA,SACEA,YAAY,EACZC,sBAAsB,QAMjB,eAAe;AAetB,OAAO,MAAMC,qBACX,CAAwBC,OACxB,CAACC,QACCH,uBAAuBE,MAAMC,OAAO;AAExC,OAAO,MAAMC,MAAM,CAACC,SAA+B,GAAGC,SACpDD,QACGE,MAAM,CAAC,CAACC,KAAKC,GAAGC,IAAMF,MAAMC,IAAKC,CAAAA,IAAIJ,OAAOK,MAAM,GAAGC,OAAON,MAAM,CAACI,EAAE,IAAI,EAAC,GAAI,IAC9EG,OAAO,CAAC,QAAQ,KAChBC,IAAI,GAAG;AAEZ,MAAMC,iBAAiBX,GAAG,CAAC;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IAEA,MAAMrC,IAAI,AAACqC,QAAQ,KAAM;IACzB,MAAMjC,IAAI,AAACiC,QAAQ,IAAK;IACxB,MAAMhC,IAAIgC,OAAO;IACjB,OAAO,MAAM;QAACrC;QAAGI;QAAGC;KAAE,CAACuB,GAAG,CAAC,CAACvC,IAAMA,EAAEyC,QAAQ,CAAC,IAAIC,QAAQ,CAAC,GAAG,MAAMhC,IAAI,CAAC;AAC1E;AAEA,OAAO,MAAMuC,4BAA4B,CACvCF,QAAgCjD,qBAAqB;IAErD,MAAM,CAACsB,GAAG8B,GAAGC,EAAE,GAAG/C,SAAS0C,gBAAgBC,UAAUjD;IAErD,MAAMsD,QAAQ;QACZ,uFAAuF;QACvF,gCAAgChC,IAAI,OAAO,YAAYK,SAAS;YAAC;YAAMyB,IAAI;YAAKC;SAAE;IACpF;IAEA,KAAK,MAAM,EAAEP,IAAI,EAAExB,GAAGiC,IAAI,EAAER,IAAI,EAAE,IAAIF,cAAe;QACnD,MAAMW,OAAOD,QAAQ,OAAOjC,IAAIiC;QAChC,MAAME,OAAOL,IAAIL;QACjBO,KAAK,CAAC,CAAC,kBAAkB,EAAER,MAAM,CAAC,GAAGnB,SAAS;YAAC6B;YAAMC;YAAMJ;SAAE;IAC/D;IAEA,OAAOC;AACT,EAAE"}
@@ -70,7 +70,7 @@ struct BottomSheetView: ExpoSwiftUI.View {
70
70
 
71
71
  @ViewBuilder
72
72
  private func contentChildren() -> some View {
73
- ForEach(props.children?.withoutSlot("anchor") ?? [], id: \.id) { child in
73
+ ForEach(props.children?.withoutSlots() ?? [], id: \.id) { child in
74
74
  let view: any View = child.childView
75
75
  AnyView(view)
76
76
  }
@@ -93,6 +93,15 @@ struct BottomSheetView: ExpoSwiftUI.View {
93
93
  }
94
94
  }
95
95
 
96
+ @ViewBuilder
97
+ private var presentedContent: some View {
98
+ if let background = props.children?.slot("presentationBackground") {
99
+ sheetContent.presentationBackground { background }
100
+ } else {
101
+ sheetContent
102
+ }
103
+ }
104
+
96
105
  @ViewBuilder
97
106
  private var anchor: some View {
98
107
  if let anchorView = props.children?.slot("anchor") {
@@ -107,7 +116,7 @@ struct BottomSheetView: ExpoSwiftUI.View {
107
116
  .sheet(isPresented: $isPresented, onDismiss: {
108
117
  props.onDismiss()
109
118
  }) {
110
- sheetContent
119
+ presentedContent
111
120
  }
112
121
  .onChange(of: isPresented, perform: { newIsPresented in
113
122
  if props.isPresented == newIsPresented {