@expo/ui 0.2.0-beta.6 → 0.2.0-beta.8

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 (285) hide show
  1. package/CHANGELOG.md +70 -14
  2. package/android/build.gradle +8 -8
  3. package/android/src/main/java/expo/modules/ui/AlertDialogView.kt +3 -2
  4. package/android/src/main/java/expo/modules/ui/BottomSheetView.kt +67 -0
  5. package/android/src/main/java/expo/modules/ui/CarouselView.kt +151 -0
  6. package/android/src/main/java/expo/modules/ui/ChipView.kt +4 -3
  7. package/android/src/main/java/expo/modules/ui/ComposeViews.kt +33 -13
  8. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +3 -2
  9. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +55 -4
  10. package/android/src/main/java/expo/modules/ui/Modifiers.kt +35 -6
  11. package/android/src/main/java/expo/modules/ui/PickerView.kt +3 -2
  12. package/android/src/main/java/expo/modules/ui/ProgressView.kt +3 -2
  13. package/android/src/main/java/expo/modules/ui/ShapeView.kt +66 -11
  14. package/android/src/main/java/expo/modules/ui/SliderView.kt +3 -2
  15. package/android/src/main/java/expo/modules/ui/SwitchView.kt +4 -3
  16. package/android/src/main/java/expo/modules/ui/TextInputView.kt +3 -2
  17. package/android/src/main/java/expo/modules/ui/button/Button.kt +30 -9
  18. package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +2 -1
  19. package/build/jetpack-compose/AlertDialog/index.d.ts +3 -1
  20. package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
  21. package/build/jetpack-compose/BottomSheet/index.d.ts +21 -0
  22. package/build/jetpack-compose/BottomSheet/index.d.ts.map +1 -0
  23. package/build/jetpack-compose/Button/index.d.ts +8 -3
  24. package/build/jetpack-compose/Button/index.d.ts.map +1 -1
  25. package/build/jetpack-compose/Carousel/index.d.ts +38 -0
  26. package/build/jetpack-compose/Carousel/index.d.ts.map +1 -0
  27. package/build/jetpack-compose/Chip/index.d.ts +4 -4
  28. package/build/jetpack-compose/ContextMenu/index.d.ts +3 -15
  29. package/build/jetpack-compose/ContextMenu/index.d.ts.map +1 -1
  30. package/build/jetpack-compose/DatePicker/index.d.ts +3 -1
  31. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  32. package/build/jetpack-compose/Host/index.d.ts +8 -0
  33. package/build/jetpack-compose/Host/index.d.ts.map +1 -0
  34. package/build/jetpack-compose/Picker/index.d.ts +3 -2
  35. package/build/jetpack-compose/Picker/index.d.ts.map +1 -1
  36. package/build/jetpack-compose/Progress/index.d.ts +6 -2
  37. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  38. package/build/jetpack-compose/Shape/index.d.ts +13 -7
  39. package/build/jetpack-compose/Shape/index.d.ts.map +1 -1
  40. package/build/jetpack-compose/Slider/index.d.ts +3 -1
  41. package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
  42. package/build/jetpack-compose/Switch/index.d.ts +5 -3
  43. package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
  44. package/build/jetpack-compose/TextInput/index.d.ts +3 -1
  45. package/build/jetpack-compose/TextInput/index.d.ts.map +1 -1
  46. package/build/jetpack-compose/index.d.ts +4 -0
  47. package/build/jetpack-compose/index.d.ts.map +1 -1
  48. package/build/{jetpack-compose-primitives/index.d.ts → jetpack-compose/layout.d.ts} +14 -11
  49. package/build/jetpack-compose/layout.d.ts.map +1 -0
  50. package/build/jetpack-compose/modifiers.d.ts +8 -1
  51. package/build/jetpack-compose/modifiers.d.ts.map +1 -1
  52. package/build/swift-ui/BottomSheet/index.d.ts +6 -6
  53. package/build/swift-ui/Button/index.d.ts +22 -7
  54. package/build/swift-ui/Button/index.d.ts.map +1 -1
  55. package/build/swift-ui/Chart/index.d.ts +41 -5
  56. package/build/swift-ui/Chart/index.d.ts.map +1 -1
  57. package/build/swift-ui/ContentUnavailableView/index.d.ts +5 -0
  58. package/build/swift-ui/ContentUnavailableView/index.d.ts.map +1 -1
  59. package/build/swift-ui/ContextMenu/index.d.ts +8 -21
  60. package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
  61. package/build/swift-ui/ContextMenu/types.d.ts +17 -16
  62. package/build/swift-ui/ContextMenu/types.d.ts.map +1 -1
  63. package/build/swift-ui/DatePicker/index.d.ts +2 -2
  64. package/build/swift-ui/DatePicker/index.d.ts.map +1 -1
  65. package/build/swift-ui/Divider/index.d.ts +8 -0
  66. package/build/swift-ui/Divider/index.d.ts.map +1 -0
  67. package/build/swift-ui/Form/index.d.ts +1 -0
  68. package/build/swift-ui/Form/index.d.ts.map +1 -1
  69. package/build/swift-ui/Gauge/index.d.ts +1 -3
  70. package/build/swift-ui/Gauge/index.d.ts.map +1 -1
  71. package/build/swift-ui/Grid/index.d.ts +27 -0
  72. package/build/swift-ui/Grid/index.d.ts.map +1 -0
  73. package/build/swift-ui/Host/index.d.ts +6 -1
  74. package/build/swift-ui/Host/index.d.ts.map +1 -1
  75. package/build/swift-ui/Image/index.d.ts +2 -1
  76. package/build/swift-ui/Image/index.d.ts.map +1 -1
  77. package/build/swift-ui/Label/index.d.ts +3 -2
  78. package/build/swift-ui/Label/index.d.ts.map +1 -1
  79. package/build/swift-ui/LabeledContent/index.d.ts +3 -3
  80. package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
  81. package/build/swift-ui/Layout/index.d.ts +2 -1
  82. package/build/swift-ui/Layout/index.d.ts.map +1 -1
  83. package/build/swift-ui/List/index.d.ts +1 -1
  84. package/build/swift-ui/List/index.d.ts.map +1 -1
  85. package/build/swift-ui/Picker/index.d.ts +4 -2
  86. package/build/swift-ui/Picker/index.d.ts.map +1 -1
  87. package/build/swift-ui/Popover/index.d.ts +32 -0
  88. package/build/swift-ui/Popover/index.d.ts.map +1 -0
  89. package/build/swift-ui/Section/index.d.ts +15 -2
  90. package/build/swift-ui/Section/index.d.ts.map +1 -1
  91. package/build/swift-ui/SecureField/index.d.ts +16 -1
  92. package/build/swift-ui/SecureField/index.d.ts.map +1 -1
  93. package/build/swift-ui/ShareLink/index.d.ts +8 -2
  94. package/build/swift-ui/ShareLink/index.d.ts.map +1 -1
  95. package/build/swift-ui/Slider/index.d.ts +2 -1
  96. package/build/swift-ui/Slider/index.d.ts.map +1 -1
  97. package/build/swift-ui/Stepper/index.d.ts +29 -0
  98. package/build/swift-ui/Stepper/index.d.ts.map +1 -0
  99. package/build/swift-ui/Switch/index.d.ts +8 -2
  100. package/build/swift-ui/Switch/index.d.ts.map +1 -1
  101. package/build/swift-ui/Text/index.d.ts +10 -2
  102. package/build/swift-ui/Text/index.d.ts.map +1 -1
  103. package/build/swift-ui/TextField/index.d.ts +44 -5
  104. package/build/swift-ui/TextField/index.d.ts.map +1 -1
  105. package/build/swift-ui/index.d.ts +4 -0
  106. package/build/swift-ui/index.d.ts.map +1 -1
  107. package/build/swift-ui/modifiers/background.d.ts +10 -0
  108. package/build/swift-ui/modifiers/background.d.ts.map +1 -0
  109. package/build/swift-ui/modifiers/containerShape.d.ts +4 -7
  110. package/build/swift-ui/modifiers/containerShape.d.ts.map +1 -1
  111. package/build/swift-ui/modifiers/createModifier.d.ts +1 -0
  112. package/build/swift-ui/modifiers/createModifier.d.ts.map +1 -1
  113. package/build/swift-ui/modifiers/index.d.ts +331 -55
  114. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  115. package/build/swift-ui/modifiers/shapes/index.d.ts +35 -0
  116. package/build/swift-ui/modifiers/shapes/index.d.ts.map +1 -0
  117. package/build/swift-ui/modifiers/types.d.ts +5 -0
  118. package/build/swift-ui/modifiers/types.d.ts.map +1 -0
  119. package/build/utils/index.d.ts.map +1 -1
  120. package/expo-module.config.json +1 -1
  121. package/ios/BottomSheetView.swift +1 -9
  122. package/ios/Button/Button.swift +2 -1
  123. package/ios/Button/ButtonProps.swift +32 -7
  124. package/ios/CapsuleView.swift +1 -8
  125. package/ios/ChartView.swift +64 -25
  126. package/ios/CircleView.swift +1 -7
  127. package/ios/ColorPickerView.swift +1 -8
  128. package/ios/ConcentricRectangleView.swift +1 -8
  129. package/ios/ContentUnavailableView.swift +1 -8
  130. package/ios/ContextMenu/ContextMenu.swift +20 -114
  131. package/ios/ContextMenu/ContextMenuComponents.swift +37 -0
  132. package/ios/ContextMenu/ContextMenuRecords.swift +5 -40
  133. package/ios/DateTimePickerView.swift +1 -8
  134. package/ios/DisclosureGroupView.swift +1 -8
  135. package/ios/DividerView.swift +15 -0
  136. package/ios/EllipseView.swift +1 -7
  137. package/ios/ExpoUIModule.swift +88 -37
  138. package/ios/FormView.swift +1 -8
  139. package/ios/Gauge/Gauge.swift +0 -1
  140. package/ios/Gauge/GaugeProps.swift +1 -7
  141. package/ios/GlassEffectContainerView.swift +1 -7
  142. package/ios/GridView.swift +44 -0
  143. package/ios/GroupView.swift +1 -8
  144. package/ios/HStackView.swift +1 -8
  145. package/ios/HostView.swift +46 -4
  146. package/ios/ImageView.swift +1 -8
  147. package/ios/Label.swift +16 -13
  148. package/ios/LabeledContentView.swift +55 -10
  149. package/ios/List.swift +1 -8
  150. package/ios/Modifiers/BackgroundModifier.swift +37 -0
  151. package/ios/Modifiers/ContainerShapeModifier.swift +27 -0
  152. package/ios/Modifiers/FontModifier.swift +65 -0
  153. package/ios/Modifiers/GlassEffectModifier.swift +92 -0
  154. package/ios/Modifiers/RefreshableModifier.swift +59 -0
  155. package/ios/Modifiers/ShapeTypes.swift +62 -0
  156. package/ios/Modifiers/ViewModifierRegistry.swift +651 -95
  157. package/ios/PickerView.swift +1 -8
  158. package/ios/Popover/PopoverComponents.swift +18 -0
  159. package/ios/Popover/PopoverProps.swift +59 -0
  160. package/ios/Popover/PopoverView.swift +64 -0
  161. package/ios/ProgressView.swift +1 -8
  162. package/ios/RectangleView.swift +1 -7
  163. package/ios/RoundedRectangleView.swift +1 -8
  164. package/ios/SectionView.swift +86 -10
  165. package/ios/SecureField/SecureFieldView.swift +31 -9
  166. package/ios/ShareLink/AsyncShareableItemUtils.swift +79 -0
  167. package/ios/ShareLink/ShareLinkView.swift +112 -0
  168. package/ios/SliderView.swift +1 -8
  169. package/ios/SpacerView.swift +1 -8
  170. package/ios/StepperView.swift +45 -0
  171. package/ios/SwitchView.swift +12 -9
  172. package/ios/TextField/TextFieldView.swift +102 -15
  173. package/ios/TextView.swift +16 -38
  174. package/ios/UIBaseView.swift +57 -0
  175. package/ios/UIBaseViewProps.swift +25 -0
  176. package/ios/UnevenRoundedRectangleView.swift +1 -8
  177. package/ios/VStackView.swift +1 -8
  178. package/ios/ZStackView.swift +1 -8
  179. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar +0 -0
  180. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar.md5 +1 -0
  181. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar.sha1 +1 -0
  182. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar.sha256 +1 -0
  183. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8-sources.jar.sha512 +1 -0
  184. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar +0 -0
  185. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar.md5 +1 -0
  186. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar.sha1 +1 -0
  187. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar.sha256 +1 -0
  188. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.aar.sha512 +1 -0
  189. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module → 0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module} +29 -29
  190. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module.md5 +1 -0
  191. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module.sha1 +1 -0
  192. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module.sha256 +1 -0
  193. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.module.sha512 +1 -0
  194. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom → 0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom} +7 -7
  195. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom.md5 +1 -0
  196. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom.sha1 +1 -0
  197. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom.sha256 +1 -0
  198. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.8/expo.modules.ui-0.2.0-beta.8.pom.sha512 +1 -0
  199. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  200. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  201. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  202. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  203. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  204. package/package.json +3 -7
  205. package/src/jetpack-compose/AlertDialog/index.tsx +3 -1
  206. package/src/jetpack-compose/BottomSheet/index.tsx +46 -0
  207. package/src/jetpack-compose/Button/index.tsx +11 -4
  208. package/src/jetpack-compose/Carousel/index.tsx +57 -0
  209. package/src/jetpack-compose/Chip/index.tsx +4 -4
  210. package/src/jetpack-compose/ContextMenu/index.tsx +3 -17
  211. package/src/jetpack-compose/DatePicker/index.tsx +3 -1
  212. package/src/jetpack-compose/Host/index.tsx +25 -0
  213. package/src/jetpack-compose/Picker/index.tsx +3 -2
  214. package/src/jetpack-compose/Progress/index.tsx +6 -2
  215. package/src/jetpack-compose/Shape/index.tsx +65 -12
  216. package/src/jetpack-compose/Slider/index.tsx +3 -1
  217. package/src/jetpack-compose/Switch/index.tsx +5 -3
  218. package/src/jetpack-compose/TextInput/index.tsx +3 -1
  219. package/src/jetpack-compose/index.ts +5 -0
  220. package/src/{jetpack-compose-primitives/index.tsx → jetpack-compose/layout.tsx} +56 -24
  221. package/src/jetpack-compose/modifiers.ts +11 -1
  222. package/src/swift-ui/BottomSheet/index.tsx +6 -6
  223. package/src/swift-ui/Button/index.tsx +23 -7
  224. package/src/swift-ui/Chart/index.tsx +43 -5
  225. package/src/swift-ui/ContentUnavailableView/index.tsx +5 -4
  226. package/src/swift-ui/ContextMenu/index.tsx +26 -73
  227. package/src/swift-ui/ContextMenu/types.ts +18 -24
  228. package/src/swift-ui/DatePicker/index.tsx +2 -2
  229. package/src/swift-ui/Divider/index.tsx +18 -0
  230. package/src/swift-ui/Form/index.tsx +1 -0
  231. package/src/swift-ui/Gauge/index.tsx +1 -3
  232. package/src/swift-ui/Grid/index.tsx +65 -0
  233. package/src/swift-ui/Host/index.tsx +11 -2
  234. package/src/swift-ui/Image/index.tsx +2 -1
  235. package/src/swift-ui/Label/index.tsx +3 -2
  236. package/src/swift-ui/LabeledContent/index.tsx +22 -6
  237. package/src/swift-ui/Layout/index.tsx +2 -1
  238. package/src/swift-ui/List/index.tsx +1 -1
  239. package/src/swift-ui/Picker/index.tsx +4 -2
  240. package/src/swift-ui/Popover/index.tsx +71 -0
  241. package/src/swift-ui/Section/index.tsx +27 -5
  242. package/src/swift-ui/SecureField/index.tsx +26 -3
  243. package/src/swift-ui/ShareLink/index.tsx +37 -7
  244. package/src/swift-ui/Slider/index.tsx +2 -1
  245. package/src/swift-ui/Stepper/index.tsx +56 -0
  246. package/src/swift-ui/Switch/index.tsx +9 -2
  247. package/src/swift-ui/Text/index.tsx +13 -4
  248. package/src/swift-ui/TextField/index.tsx +50 -9
  249. package/src/swift-ui/index.tsx +4 -0
  250. package/src/swift-ui/modifiers/background.ts +12 -0
  251. package/src/swift-ui/modifiers/containerShape.ts +4 -9
  252. package/src/swift-ui/modifiers/createModifier.ts +1 -0
  253. package/src/swift-ui/modifiers/index.ts +408 -75
  254. package/src/swift-ui/modifiers/shapes/index.ts +32 -0
  255. package/src/swift-ui/modifiers/types.ts +23 -0
  256. package/src/utils/index.ts +3 -0
  257. package/build/jetpack-compose-primitives/index.d.ts.map +0 -1
  258. package/build/swift-ui/ContextMenu/Submenu.d.ts +0 -21
  259. package/build/swift-ui/ContextMenu/Submenu.d.ts.map +0 -1
  260. package/build/swift-ui/ContextMenu/utils.d.ts +0 -24
  261. package/build/swift-ui/ContextMenu/utils.d.ts.map +0 -1
  262. package/ios/Modifiers/CommonViewModifiers.swift +0 -29
  263. package/ios/ShareLinkView.swift +0 -111
  264. package/jetpack-compose-primitives.d.ts +0 -1
  265. package/jetpack-compose-primitives.js +0 -1
  266. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar +0 -0
  267. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar.md5 +0 -1
  268. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar.sha1 +0 -1
  269. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar.sha256 +0 -1
  270. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6-sources.jar.sha512 +0 -1
  271. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar +0 -0
  272. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar.md5 +0 -1
  273. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar.sha1 +0 -1
  274. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar.sha256 +0 -1
  275. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.aar.sha512 +0 -1
  276. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module.md5 +0 -1
  277. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module.sha1 +0 -1
  278. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module.sha256 +0 -1
  279. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.module.sha512 +0 -1
  280. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom.md5 +0 -1
  281. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom.sha1 +0 -1
  282. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom.sha256 +0 -1
  283. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-beta.6/expo.modules.ui-0.2.0-beta.6.pom.sha512 +0 -1
  284. package/src/swift-ui/ContextMenu/Submenu.tsx +0 -25
  285. package/src/swift-ui/ContextMenu/utils.ts +0 -149
package/CHANGELOG.md CHANGED
@@ -10,23 +10,82 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 0.2.0-beta.6 — 2025-10-01
13
+ ## 0.2.0-beta.8 — 2025-11-06
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - [Android] Move all `jetpack-compose-primitives` components to `jetpack-compose` namespace. ([#40272](https://github.com/expo/expo/pull/40272) by [@aleqsio](https://github.com/aleqsio))
18
+
19
+ ### 🎉 New features
20
+
21
+ - [iOS] Add `refreshable` modifier. ([#40201](https://github.com/expo/expo/pull/40201) by [@christianwooldridge](https://github.com/christianwooldridge))
22
+ - [iOS] Add RTL support in swiftui. ([#40335](https://github.com/expo/expo/pull/40335) by [@kfirfitousi](https://github.com/kfirfitousi))
23
+ - [Android] Add Carousel component. ([#40325](https://github.com/expo/expo/pull/40325) by [@aleqsio](https://github.com/aleqsio))
24
+ - [iOS] Add `scrollDismissesKeyboard` modifier. ([#40201](https://github.com/expo/expo/pull/40201) by [@christianwooldridge](https://github.com/christianwooldridge))
25
+ - [Android] Add Android BottomSheet ([#37553](https://github.com/expo/expo/pull/37553) by [@Jeroen-G](https://github.com/Jeroen-G))
26
+ - [Android] Move all components to use Host ([#40244](https://github.com/expo/expo/pull/40244) by [@aleqsio](https://github.com/aleqsio))
27
+ - [Android] Add support for modifiers in primitives, add clip modifier. ([#40164](https://github.com/expo/expo/pull/40164) by [@aleqsio](https://github.com/aleqsio))
28
+ - Add scoped compose modifiers, move testID to modifiers. ([#39155](https://github.com/expo/expo/pull/39155) by [@aleqsio](https://github.com/aleqsio))
29
+ - [Android] Add custom button shapes. ([#40163](https://github.com/expo/expo/pull/40163) by [@aleqsio](https://github.com/aleqsio))
30
+ - [iOS] Add ref methods and onChangeFocus to TextField and SecureField. ([#39898](https://github.com/expo/expo/pull/39898) by [@aleqsio](https://github.com/aleqsio))
31
+ - [iOS] Add SF symbol typings ([#39802](https://github.com/expo/expo/pull/39802) by [@nishan](https://github.com/intergalacticspacehighway))
32
+ - [iOS] Add `scrollContentBackground` and `listRowBackground` modifier. ([#40195](https://github.com/expo/expo/pull/40195) by [@doombladeoff](https://github.com/doombladeoff))
33
+ - Added `onAppear` and `onDisappear` modifiers to `swift-ui`. ([#40056](https://github.com/expo/expo/pull/40056) by [@kudo](https://github.com/kudo))
34
+ - [iOS] Add Stepper component. ([#39813](https://github.com/expo/expo/pull/39813) by [@hryhoriiK97](https://github.com/hryhoriiK97))
35
+ - [ios] Add text modifiers (`truncationMode`, `kerning`, `allowsTightening`, `textCase`, `underline`, `strikethrough`, `multilineTextAlignment`,`textSelection` and `lineSpacing`) ([#40282](https://github.com/expo/expo/pull/40282) by [@doombladeoff](https://github.com/doombladeoff))
36
+ - [iOS] Added `header` and `footer` props for sections, support for collapsible sections, and headerProminence modifier ([#40340](https://github.com/expo/expo/pull/40340) by [@doombladeoff](https://github.com/doombladeoff))
37
+ - [iOS] Add new modifiers (`listRowInsets`, `listSectionMargins`, `badgeProminence`, `badge`) ([#40329](https://github.com/expo/expo/pull/40329) by [@doombladeoff](https://github.com/doombladeoff))
38
+ - Add Interpolated string support in button ([#40416](https://github.com/expo/expo/pull/40416) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
39
+ - [iOS] Added Popover component ([#40454](https://github.com/expo/expo/pull/40454) by [@doombladeoff](https://github.com/doombladeoff))
40
+ - [iOS] Add RectangleMark and RuleMark support to Chart component ([#40046](https://github.com/expo/expo/pull/40046) by [@hryhoriiK97](https://github.com/hryhoriiK97))
41
+ - Adds selection API in text field, autoFocus, onSubmit event and rounded rectangle (squircle) support in glassEffect. ([#40455](https://github.com/expo/expo/pull/40455) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
42
+ - [iOS] Add `font` modifier ([#40553](https://github.com/expo/expo/pull/40553) by [@nishan](https://github.com/intergalacticspacehighway))
43
+ - [iOS] Add `getItemAsync` to `ShareLink` ([#40391](https://github.com/expo/expo/pull/40391) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
44
+ - [iOS] Add Grid component and modifiers `gridCellUnsizedAxes`, `gridCellColumns`, `gridColumnAlignment`, `gridCellAnchor` ([#40485](https://github.com/expo/expo/pull/40485) by [@doombladeoff](https://github.com/doombladeoff))
45
+ - [iOS] Add `labelView` to LabeledContent component ([#40798](https://github.com/expo/expo/pull/40798) by [@focux](https://github.com/focux))
46
+ - [iOS] - Add shape in `background` modifier and fix `foregroundStyle` modifer in `Label` ([#40748](https://github.com/expo/expo/pull/40748) by [@nishan](https://github.com/intergalacticspacehighway))
47
+ - [iOS] - Add `systemImage` property to `Switch` component ([#40838](https://github.com/expo/expo/pull/40838) by [@focux](https://github.com/focux))
14
48
 
15
49
  ### 🐛 Bug fixes
16
50
 
17
- - [iOS] Add `buttonStyle` modifier. ([#40119](https://github.com/expo/expo/pull/40119) by [@nishan](https://github.com/intergalacticspacehighway))
51
+ - [iOS] remove empty section header spacing when no title provided ([#40296](https://github.com/expo/expo/pull/40296) by [@dylancom](https://github.com/dylancom))
52
+ - [iOS] Merge edge and axis paddings correctly in PaddingModifier ([#40414](https://github.com/expo/expo/pull/40414) by [@lucabc2000](https://github.com/lucabc2000))
53
+ - [iOS] Enhance PaddingModifier to support default SwiftUI padding when no custom values are provided ([#40715](https://github.com/expo/expo/pull/40715) by [@betomoedano](https://github.com/betomoedano))
18
54
 
19
- ## 0.2.0-beta.5 — 2025-10-01
55
+ ### 💡 Others
56
+
57
+ - [docs] Improve consistency and remove invalid platform checks. ([#40362](https://github.com/expo/expo/pull/40362) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
58
+ - Refactored `CommonViewProps` to `UIBaseViewProps` and reduced duplicated code. ([#40492](https://github.com/expo/expo/pull/40492) by [@kudo](https://github.com/kudo))
59
+
60
+ ## 0.2.0-beta.7 - 2025-10-09
61
+
62
+ ### 🎉 New features
63
+
64
+ - [iOS] Adds `controlSize` prop to Button([#40030](https://github.com/expo/expo/pull/40030) by [@betomoedano](https://github.com/betomoedano))
65
+ - [iOS] Add Divider component. ([#40283](https://github.com/expo/expo/pull/40283) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
66
+
67
+ ### 💡 Others
68
+
69
+ - [iOS] Make `ContextMenu` more composable. ([#40254](https://github.com/expo/expo/pull/40254) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
70
+
71
+ ## 0.2.0-beta.6 - 2025-10-01
72
+
73
+ ### 🐛 Bug fixes
74
+
75
+ - [iOS] Add `buttonStyle` modifier. ([#40119](https://github.com/expo/expo/pull/40119) by [@nishan](https://github.com/intergalacticspacehighway)) ([#40119](https://github.com/expo/expo/pull/40119) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
76
+
77
+ ## 0.2.0-beta.5 - 2025-10-01
20
78
 
21
79
  ### 🎉 New features
22
80
 
23
81
  - [iOS] Add `variableValue` prop to Image component for SF Symbols with variable color support ([#39852](https://github.com/expo/expo/pull/39852) by [@morellodev](https://github.com/morellodev))
24
- - [iOS] Adds `Rectangle`, `RoundedRectangle`, `UnevenRoundedRectangle`, `Circle`, `Ellipse`, `Capsule` shape components and `fill` modifier ([#39793](https://github.com/expo/expo/pull/39793) by [@nishan](https://github.com/intergalacticspacehighway))
25
- - [iOS] Add `ignoreSafeArea` modifier ([#39804](https://github.com/expo/expo/pull/39804) by [@nishan](https://github.com/intergalacticspacehighway))
26
- - [iOS] Add `presentationDetents`, `presentationDragIndicator`, `interactiveDismissDisabled` props to `BottomSheet`. ([#39952](https://github.com/expo/expo/pull/39952) by [@nishan](https://github.com/intergalacticspacehighway))
27
- - [iOS] Add `ConcentricRectangle` shape ([#39907](https://github.com/expo/expo/pull/39907) by [@nishan](https://github.com/intergalacticspacehighway))
82
+ - [iOS] Adds `Rectangle`, `RoundedRectangle`, `UnevenRoundedRectangle`, `Circle`, `Ellipse`, `Capsule` shape components and `fill` modifier ([#39793](https://github.com/expo/expo/pull/39793) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39793](https://github.com/expo/expo/pull/39793) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
83
+ - [iOS] Add `ignoreSafeArea` modifier ([#39804](https://github.com/expo/expo/pull/39804) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39804](https://github.com/expo/expo/pull/39804) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
84
+ - [iOS] Add `presentationDetents`, `presentationDragIndicator`, `interactiveDismissDisabled` props to `BottomSheet`. ([#39952](https://github.com/expo/expo/pull/39952) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39952](https://github.com/expo/expo/pull/39952) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
85
+ - [iOS] Add `ConcentricRectangle` shape ([#39907](https://github.com/expo/expo/pull/39907) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39907](https://github.com/expo/expo/pull/39907) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
28
86
  - [iOS] Add disabled modifier for swiftui. ([#39864](https://github.com/expo/expo/pull/39864) by [@hryhoriiK97](https://github.com/hryhoriiK97))
29
- - Add Interpolated string support in button ([#39932](https://github.com/expo/expo/pull/39932) by [@nishan](https://github.com/intergalacticspacehighway))
87
+ - Add Interpolated string support in button ([#39932](https://github.com/expo/expo/pull/39932) by [@nishan](https://github.com/intergalacticspacehighway)) ([#39932](https://github.com/expo/expo/pull/39932) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
88
+ - [iOS] list section spacing modifier ([#40291](https://github.com/expo/expo/pull/40291) by [@dylancom](https://github.com/dylancom))
30
89
 
31
90
  ### 🐛 Bug fixes
32
91
 
@@ -34,16 +93,13 @@
34
93
 
35
94
  ### 💡 Others
36
95
 
37
- - [ios] - Set host dimension synchronously on native ([#40017](https://github.com/expo/expo/pull/40017) by [@nishan](https://github.com/intergalacticspacehighway))
38
-
39
- ## 0.2.0-beta.4 — 2025-09-22
40
-
41
- ### 🎉 New features
96
+ - [ios] - Set host dimension synchronously on native ([#40017](https://github.com/expo/expo/pull/40017) by [@nishan](https://github.com/intergalacticspacehighway)) ([#40017](https://github.com/expo/expo/pull/40017) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
42
97
 
43
- - Add SF symbol typings ([#39802](https://github.com/expo/expo/pull/39802) by [@nishan](https://github.com/intergalacticspacehighway))
98
+ ## 0.2.0-beta.4 - 2025-09-22
44
99
 
45
100
  ### 🐛 Bug fixes
46
101
 
102
+ - [iOS] Add correct color value types. ([#39899](https://github.com/expo/expo/pull/39899) by [@EvanBacon](https://github.com/EvanBacon))
47
103
  - [iOS] Updated description for glass button styles availability ([#39736](https://github.com/expo/expo/pull/39736) by [@terijaki](https://github.com/terijaki))
48
104
 
49
105
  ## 0.2.0-beta.3 — 2025-09-16
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
12
12
  apply plugin: 'org.jetbrains.kotlin.plugin.compose'
13
13
 
14
14
  group = 'expo.modules.ui'
15
- version = '0.2.0-beta.6'
15
+ version = '0.2.0-beta.8'
16
16
 
17
17
  android {
18
18
  namespace "expo.modules.ui"
19
19
  defaultConfig {
20
20
  versionCode 1
21
- versionName "0.2.0-beta.6"
21
+ versionName "0.2.0-beta.8"
22
22
  }
23
23
  buildFeatures {
24
24
  compose true
@@ -29,11 +29,11 @@ android {
29
29
  }
30
30
 
31
31
  dependencies {
32
- implementation 'androidx.compose.foundation:foundation-android:1.7.6'
33
- implementation 'androidx.compose.ui:ui-android:1.7.6'
34
- implementation "androidx.compose.material3:material3:1.3.1"
35
- implementation 'androidx.lifecycle:lifecycle-runtime:2.8.7'
36
- implementation 'androidx.fragment:fragment-ktx:1.8.5'
37
- implementation 'androidx.compose.material3:material3-android:1.3.1'
32
+ implementation 'androidx.compose.foundation:foundation-android:1.9.1'
33
+ implementation 'androidx.compose.ui:ui-android:1.9.1'
34
+ implementation "androidx.compose.material3:material3:1.3.2"
35
+ implementation 'androidx.lifecycle:lifecycle-runtime:2.9.3'
36
+ implementation 'androidx.fragment:fragment-ktx:1.8.9'
37
+ implementation 'androidx.compose.material3:material3-android:1.3.2'
38
38
  implementation "androidx.graphics:graphics-shapes:1.0.1"
39
39
  }
@@ -13,6 +13,7 @@ import androidx.compose.ui.Modifier
13
13
  import expo.modules.kotlin.views.ExpoComposeView
14
14
  import expo.modules.kotlin.viewevent.EventDispatcher
15
15
  import expo.modules.kotlin.records.Record
16
+ import expo.modules.kotlin.views.ComposableScope
16
17
  import java.io.Serializable
17
18
 
18
19
  open class AlertDialogButtonPressedEvent() : Record, Serializable
@@ -27,13 +28,13 @@ data class AlertDialogProps(
27
28
  ) : ComposeProps
28
29
 
29
30
  class AlertDialogView(context: Context, appContext: AppContext) :
30
- ExpoComposeView<AlertDialogProps>(context, appContext, withHostingView = true) {
31
+ ExpoComposeView<AlertDialogProps>(context, appContext) {
31
32
  override val props = AlertDialogProps()
32
33
  private val onDismissPressed by EventDispatcher<AlertDialogButtonPressedEvent>()
33
34
  private val onConfirmPressed by EventDispatcher<AlertDialogButtonPressedEvent>()
34
35
 
35
36
  @Composable
36
- override fun Content(modifier: Modifier) {
37
+ override fun ComposableScope.Content() {
37
38
  val (title) = props.title
38
39
  val (text) = props.text
39
40
  val (confirmButtonText) = props.confirmButtonText
@@ -0,0 +1,67 @@
1
+ package expo.modules.ui
2
+
3
+ import android.content.Context
4
+ import androidx.compose.foundation.layout.Box
5
+ import androidx.compose.foundation.layout.fillMaxHeight
6
+ import androidx.compose.material3.ExperimentalMaterial3Api
7
+ import androidx.compose.material3.ModalBottomSheet
8
+ import androidx.compose.material3.rememberModalBottomSheetState
9
+ import androidx.compose.runtime.Composable
10
+ import androidx.compose.runtime.MutableState
11
+ import androidx.compose.runtime.mutableStateOf
12
+ import androidx.compose.ui.Modifier
13
+ import expo.modules.kotlin.AppContext
14
+ import expo.modules.kotlin.records.Field
15
+ import expo.modules.kotlin.records.Record
16
+ import expo.modules.kotlin.viewevent.EventDispatcher
17
+ import expo.modules.kotlin.views.ComposableScope
18
+ import expo.modules.kotlin.views.ComposeProps
19
+ import expo.modules.kotlin.views.ExpoComposeView
20
+ import java.io.Serializable
21
+
22
+ open class IsOpenedChangeEvent(
23
+ @Field open val isOpened: Boolean = false
24
+ ) : Record, Serializable
25
+
26
+ data class BottomSheetProps(
27
+ val isOpened: MutableState<Boolean> = mutableStateOf(false),
28
+ val skipPartiallyExpanded: MutableState<Boolean> = mutableStateOf(false)
29
+ ) : ComposeProps
30
+
31
+ @OptIn(ExperimentalMaterial3Api::class)
32
+ @Composable
33
+ fun BottomSheetComposable(skipPartiallyExpanded: Boolean, isOpened: Boolean, onIsOpenedChange: (Boolean) -> Unit, content: @Composable () -> Unit) {
34
+ val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded)
35
+
36
+ if (isOpened) {
37
+ ModalBottomSheet(
38
+ sheetState = sheetState,
39
+ modifier = Modifier.fillMaxHeight(),
40
+ onDismissRequest = { onIsOpenedChange(false) }
41
+ ) {
42
+ content()
43
+ }
44
+ }
45
+ }
46
+
47
+ class BottomSheetView(context: Context, appContext: AppContext) :
48
+ ExpoComposeView<BottomSheetProps>(context, appContext) {
49
+ override val props = BottomSheetProps()
50
+ private val onIsOpenedChange by EventDispatcher<IsOpenedChangeEvent>()
51
+
52
+ @Composable
53
+ override fun ComposableScope.Content() {
54
+ val (isOpened) = props.isOpened
55
+ val (skipPartiallyExpanded) = props.skipPartiallyExpanded
56
+
57
+ Box {
58
+ BottomSheetComposable(
59
+ skipPartiallyExpanded,
60
+ isOpened,
61
+ onIsOpenedChange = { value -> onIsOpenedChange(IsOpenedChangeEvent(value)) }
62
+ ) {
63
+ Children(ComposableScope())
64
+ }
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,151 @@
1
+ @file:OptIn(EitherType::class)
2
+
3
+ package expo.modules.ui
4
+
5
+ import android.content.Context
6
+ import androidx.compose.foundation.gestures.TargetedFlingBehavior
7
+ import androidx.compose.foundation.layout.PaddingValues
8
+ import androidx.compose.material3.ExperimentalMaterial3Api
9
+ import androidx.compose.material3.carousel.HorizontalMultiBrowseCarousel
10
+ import androidx.compose.material3.carousel.HorizontalUncontainedCarousel
11
+ import androidx.compose.material3.carousel.rememberCarouselState
12
+ import androidx.compose.material3.carousel.CarouselDefaults
13
+ import androidx.compose.runtime.Composable
14
+ import androidx.compose.runtime.MutableState
15
+ import androidx.compose.runtime.mutableStateOf
16
+ import androidx.compose.ui.Modifier
17
+ import androidx.compose.ui.unit.dp
18
+ import androidx.core.view.size
19
+ import expo.modules.kotlin.AppContext
20
+ import expo.modules.kotlin.apifeatures.EitherType
21
+ import expo.modules.kotlin.types.Enumerable
22
+ import expo.modules.kotlin.records.Field
23
+ import expo.modules.kotlin.records.Record
24
+ import expo.modules.kotlin.types.Either
25
+ import expo.modules.kotlin.views.ComposeProps
26
+ import expo.modules.kotlin.views.ExpoComposeView
27
+ import expo.modules.kotlin.views.ComposableScope
28
+
29
+ enum class CarouselVariant(val value: String) : Enumerable {
30
+ MULTI_BROWSE("multiBrowse"),
31
+ UNCONSTRAINED("unconstrained")
32
+ }
33
+
34
+ enum class FlingBehaviorType(val value: String) : Enumerable {
35
+ SINGLE_ADVANCE("singleAdvance"),
36
+ NO_SNAP("noSnap")
37
+ }
38
+
39
+ class PaddingValuesRecord : Record {
40
+ @Field
41
+ val start: Float? = null
42
+
43
+ @Field
44
+ val top: Float? = null
45
+
46
+ @Field
47
+ val end: Float? = null
48
+
49
+ @Field
50
+ val bottom: Float? = null
51
+
52
+ fun toPaddingValues(): PaddingValues {
53
+ return PaddingValues(
54
+ start?.dp ?: 0.dp,
55
+ top?.dp ?: 0.dp,
56
+ end?.dp ?: 0.dp,
57
+ bottom?.dp ?: 0.dp
58
+ )
59
+ }
60
+ }
61
+
62
+ fun paddingValuesFromEither(either: Either<Float, PaddingValuesRecord>?): PaddingValues {
63
+ if (either == null) {
64
+ return PaddingValues(0.dp)
65
+ }
66
+
67
+ return when {
68
+ either.`is`(Float::class) -> PaddingValues(either.get(Float::class).dp)
69
+ either.`is`(PaddingValuesRecord::class) -> either.get(PaddingValuesRecord::class).toPaddingValues()
70
+ else -> throw IllegalStateException()
71
+ }
72
+ }
73
+
74
+ data class CarouselProps(
75
+ val variant: MutableState<CarouselVariant?> = mutableStateOf(null),
76
+ val modifiers: MutableState<List<ExpoModifier>?> = mutableStateOf(null),
77
+ val itemSpacing: MutableState<Float?> = mutableStateOf(null),
78
+ val contentPadding: MutableState<Either<Float, PaddingValuesRecord>?> = mutableStateOf(null),
79
+ val minSmallItemWidth: MutableState<Float?> = mutableStateOf(null),
80
+ val maxSmallItemWidth: MutableState<Float?> = mutableStateOf(null),
81
+ val flingBehavior: MutableState<FlingBehaviorType?> = mutableStateOf(null),
82
+ val preferredItemWidth: MutableState<Float?> = mutableStateOf(null),
83
+ val itemWidth: MutableState<Float?> = mutableStateOf(null)
84
+ ) : ComposeProps
85
+
86
+ const val DEFAULT_MIN_SMALL_ITEM_WIDTH = 40f
87
+ const val DEFAULT_MAX_SMALL_ITEM_WIDTH = 56f
88
+ const val DEFAULT_PREFERRED_ITEM_WIDTH = 200f
89
+ const val DEFAULT_ITEM_WIDTH = 200f
90
+
91
+ class CarouselView(context: Context, appContext: AppContext) : ExpoComposeView<CarouselProps>(context, appContext) {
92
+ override val props = CarouselProps()
93
+
94
+ @OptIn(ExperimentalMaterial3Api::class)
95
+ @Composable
96
+ override fun ComposableScope.Content() {
97
+ val variant = props.variant.value ?: CarouselVariant.MULTI_BROWSE
98
+ val modifiers = props.modifiers.value ?: emptyList()
99
+ val itemSpacing = (props.itemSpacing.value ?: 0f).dp
100
+ val minSmallItemWidth = (props.minSmallItemWidth.value ?: DEFAULT_MIN_SMALL_ITEM_WIDTH).dp
101
+
102
+ // we need to constrain maxSmallItemWidth to be at least minSmallItemWidth or the app will crash
103
+ val maxSmallItemWidth = minSmallItemWidth.coerceAtLeast((props.maxSmallItemWidth.value ?: DEFAULT_MAX_SMALL_ITEM_WIDTH).dp)
104
+ val preferredItemWidth = (props.preferredItemWidth.value ?: DEFAULT_PREFERRED_ITEM_WIDTH).dp
105
+ val itemWidth = (props.itemWidth.value ?: DEFAULT_ITEM_WIDTH).dp
106
+ val flingBehaviorType = props.flingBehavior.value ?: FlingBehaviorType.SINGLE_ADVANCE
107
+ val contentPadding = paddingValuesFromEither(props.contentPadding.value)
108
+
109
+ val carouselState = rememberCarouselState(0) { size }
110
+
111
+ val flingBehavior: TargetedFlingBehavior = when (flingBehaviorType) {
112
+ FlingBehaviorType.SINGLE_ADVANCE -> CarouselDefaults.singleAdvanceFlingBehavior(state = carouselState)
113
+ FlingBehaviorType.NO_SNAP -> CarouselDefaults.noSnapFlingBehavior()
114
+ }
115
+
116
+ @Composable
117
+ fun MultiBrowseCarouselComposable() {
118
+ HorizontalMultiBrowseCarousel(
119
+ state = carouselState,
120
+ preferredItemWidth = preferredItemWidth,
121
+ modifier = Modifier.fromExpoModifiers(modifiers, this@Content),
122
+ itemSpacing = itemSpacing,
123
+ flingBehavior = flingBehavior,
124
+ minSmallItemWidth = minSmallItemWidth,
125
+ maxSmallItemWidth = maxSmallItemWidth,
126
+ contentPadding = contentPadding
127
+ ) { itemIndex ->
128
+ Child(ComposableScope(), itemIndex)
129
+ }
130
+ }
131
+
132
+ @Composable
133
+ fun UnconstrainedCarouselComposable() {
134
+ HorizontalUncontainedCarousel(
135
+ state = carouselState,
136
+ itemWidth = itemWidth,
137
+ modifier = Modifier.fromExpoModifiers(modifiers, this@Content),
138
+ itemSpacing = itemSpacing,
139
+ flingBehavior = flingBehavior,
140
+ contentPadding = contentPadding
141
+ ) { itemIndex ->
142
+ Child(ComposableScope(), itemIndex)
143
+ }
144
+ }
145
+
146
+ when (variant) {
147
+ CarouselVariant.MULTI_BROWSE -> MultiBrowseCarouselComposable()
148
+ CarouselVariant.UNCONSTRAINED -> UnconstrainedCarouselComposable()
149
+ }
150
+ }
151
+ }
@@ -12,6 +12,7 @@ import androidx.compose.ui.unit.dp
12
12
  import expo.modules.kotlin.AppContext
13
13
  import expo.modules.kotlin.records.Record
14
14
  import expo.modules.kotlin.viewevent.EventDispatcher
15
+ import expo.modules.kotlin.views.ComposableScope
15
16
  import expo.modules.kotlin.views.ComposeProps
16
17
  import expo.modules.kotlin.views.ExpoComposeView
17
18
  import java.io.Serializable
@@ -30,7 +31,7 @@ data class ChipProps(
30
31
  ) : ComposeProps
31
32
 
32
33
  class ChipView(context: Context, appContext: AppContext) :
33
- ExpoComposeView<ChipProps>(context, appContext, withHostingView = true) {
34
+ ExpoComposeView<ChipProps>(context, appContext) {
34
35
 
35
36
  override val props = ChipProps()
36
37
 
@@ -39,7 +40,7 @@ class ChipView(context: Context, appContext: AppContext) :
39
40
 
40
41
  @OptIn(ExperimentalMaterial3Api::class)
41
42
  @Composable
42
- override fun Content(modifier: Modifier) {
43
+ override fun ComposableScope.Content() {
43
44
  val variant by props.variant
44
45
  val label by props.label
45
46
  val leadingIcon by props.leadingIcon
@@ -49,7 +50,7 @@ class ChipView(context: Context, appContext: AppContext) :
49
50
  val enabled by props.enabled
50
51
  val selected by props.selected
51
52
 
52
- val chipModifier = modifier
53
+ val chipModifier = Modifier
53
54
  .padding(4.dp)
54
55
  .wrapContentSize(Alignment.Center)
55
56
 
@@ -3,6 +3,7 @@ package expo.modules.ui
3
3
  import android.content.Context
4
4
  import android.graphics.Color as AndroidColor
5
5
  import androidx.compose.foundation.layout.Arrangement
6
+ import androidx.compose.foundation.layout.Box
6
7
  import androidx.compose.foundation.layout.Column
7
8
  import androidx.compose.foundation.layout.Row
8
9
  import androidx.compose.material3.Text
@@ -20,6 +21,8 @@ import expo.modules.kotlin.AppContext
20
21
  import expo.modules.kotlin.types.Enumerable
21
22
  import expo.modules.kotlin.views.ComposeProps
22
23
  import expo.modules.kotlin.views.ExpoComposeView
24
+ import expo.modules.kotlin.views.ComposableScope
25
+ import expo.modules.kotlin.views.with
23
26
 
24
27
  enum class HorizontalArrangement(val value: String) : Enumerable {
25
28
  START("start"),
@@ -94,20 +97,20 @@ data class LayoutProps(
94
97
  val verticalArrangement: MutableState<VerticalArrangement> = mutableStateOf(VerticalArrangement.TOP),
95
98
  val horizontalAlignment: MutableState<HorizontalAlignment> = mutableStateOf(HorizontalAlignment.START),
96
99
  val verticalAlignment: MutableState<VerticalAlignment> = mutableStateOf(VerticalAlignment.TOP),
97
- val modifiers: MutableState<List<ExpoModifier>> = mutableStateOf(emptyList())
100
+ val modifiers: MutableState<List<ExpoModifier>?> = mutableStateOf(emptyList())
98
101
  ) : ComposeProps
99
102
 
100
103
  class RowView(context: Context, appContext: AppContext) : ExpoComposeView<LayoutProps>(context, appContext) {
101
104
  override val props = LayoutProps()
102
105
 
103
106
  @Composable
104
- override fun Content(modifier: Modifier) {
107
+ override fun ComposableScope.Content() {
105
108
  Row(
106
109
  horizontalArrangement = props.horizontalArrangement.value.toComposeArrangement(),
107
110
  verticalAlignment = props.verticalAlignment.value.toComposeAlignment(),
108
- modifier = modifier.then(Modifier.fromExpoModifiers(props.modifiers.value))
111
+ modifier = Modifier.fromExpoModifiers(props.modifiers.value, this@Content)
109
112
  ) {
110
- Children()
113
+ Children(this@Content.with(rowScope = this@Row))
111
114
  }
112
115
  }
113
116
  }
@@ -116,13 +119,26 @@ class ColumnView(context: Context, appContext: AppContext) : ExpoComposeView<Lay
116
119
  override val props = LayoutProps()
117
120
 
118
121
  @Composable
119
- override fun Content(modifier: Modifier) {
122
+ override fun ComposableScope.Content() {
120
123
  Column(
121
124
  verticalArrangement = props.verticalArrangement.value.toComposeArrangement(),
122
125
  horizontalAlignment = props.horizontalAlignment.value.toComposeAlignment(),
123
- modifier = modifier.then(Modifier.fromExpoModifiers(props.modifiers.value))
126
+ modifier = Modifier.fromExpoModifiers(props.modifiers.value, this@Content)
127
+ ) {
128
+ Children(this@Content.with(columnScope = this@Column))
129
+ }
130
+ }
131
+ }
132
+
133
+ class BoxView(context: Context, appContext: AppContext) : ExpoComposeView<LayoutProps>(context, appContext) {
134
+ override val props = LayoutProps()
135
+
136
+ @Composable
137
+ override fun ComposableScope.Content() {
138
+ Box(
139
+ modifier = Modifier.fromExpoModifiers(props.modifiers.value, this@Content)
124
140
  ) {
125
- Children()
141
+ Children(this@Content.with(boxScope = this@Box))
126
142
  }
127
143
  }
128
144
  }
@@ -169,10 +185,10 @@ class TextView(context: Context, appContext: AppContext) : ExpoComposeView<TextP
169
185
  override val props = TextProps()
170
186
 
171
187
  @Composable
172
- override fun Content(modifier: Modifier) {
188
+ override fun ComposableScope.Content() {
173
189
  Text(
174
190
  text = props.text.value,
175
- modifier = modifier.then(Modifier.fromExpoModifiers(props.modifiers.value)),
191
+ modifier = Modifier.fromExpoModifiers(props.modifiers.value),
176
192
  color = colorToComposeColor(props.color.value),
177
193
  style = TextStyle(
178
194
  fontSize = props.fontSize.value.sp,
@@ -182,13 +198,17 @@ class TextView(context: Context, appContext: AppContext) : ExpoComposeView<TextP
182
198
  }
183
199
  }
184
200
 
185
- class ContainerView(context: Context, appContext: AppContext) :
201
+ class HostView(context: Context, appContext: AppContext) :
186
202
  ExpoComposeView<ComposeProps>(context, appContext, withHostingView = true) {
187
203
  @Composable
188
- override fun Content(modifier: Modifier) {
189
- for (index in 0..<this.size) {
204
+ override fun ComposableScope.Content() {
205
+ for (index in 0..<this@HostView.size) {
190
206
  val child = getChildAt(index) as? ExpoComposeView<*> ?: continue
191
- child.Content(modifier = modifier)
207
+ with(this) {
208
+ with(child) {
209
+ Content()
210
+ }
211
+ }
192
212
  }
193
213
  }
194
214
  }
@@ -25,6 +25,7 @@ import expo.modules.kotlin.types.Enumerable
25
25
  import expo.modules.kotlin.viewevent.EventDispatcher
26
26
  import expo.modules.kotlin.views.ComposeProps
27
27
  import expo.modules.kotlin.views.ExpoComposeView
28
+ import expo.modules.kotlin.views.ComposableScope
28
29
  import java.util.Calendar
29
30
  import java.util.Date
30
31
  import android.graphics.Color as AndroidColor
@@ -68,12 +69,12 @@ data class DateTimePickerProps(
68
69
  @SuppressLint("ViewConstructor")
69
70
  @OptIn(ExperimentalMaterial3Api::class)
70
71
  class DateTimePickerView(context: Context, appContext: AppContext) :
71
- ExpoComposeView<DateTimePickerProps>(context, appContext, withHostingView = true) {
72
+ ExpoComposeView<DateTimePickerProps>(context, appContext) {
72
73
  override val props = DateTimePickerProps()
73
74
  private val onDateSelected by EventDispatcher<DatePickerResult>()
74
75
 
75
76
  @Composable
76
- override fun Content(modifier: Modifier) {
77
+ override fun ComposableScope.Content() {
77
78
  if (props.displayedComponents.value == DisplayedComponents.HOUR_AND_MINUTE) {
78
79
  ExpoTimePicker(props = props, modifier = Modifier.fromExpoModifiers(props.modifiers.value)) {
79
80
  onDateSelected(it)
@@ -1,6 +1,9 @@
1
1
  package expo.modules.ui
2
2
 
3
3
  import android.graphics.Color
4
+ import androidx.compose.animation.animateContentSize
5
+ import androidx.compose.animation.core.Spring
6
+ import androidx.compose.animation.core.spring
4
7
  import androidx.compose.foundation.BorderStroke
5
8
  import androidx.compose.foundation.background
6
9
  import androidx.compose.foundation.border
@@ -12,9 +15,9 @@ import androidx.compose.foundation.layout.size
12
15
  import androidx.compose.ui.Modifier
13
16
  import androidx.compose.ui.draw.alpha
14
17
  import androidx.compose.ui.draw.blur
18
+ import androidx.compose.ui.draw.clip
15
19
  import androidx.compose.ui.draw.rotate
16
20
  import androidx.compose.ui.draw.shadow
17
- import androidx.compose.ui.unit.Dp
18
21
  import androidx.compose.ui.unit.dp
19
22
  import androidx.compose.ui.zIndex
20
23
  import expo.modules.kotlin.jni.JavaScriptFunction
@@ -39,6 +42,10 @@ class ExpoUIModule : Module() {
39
42
  }
40
43
  }
41
44
 
45
+ View(BottomSheetView::class) {
46
+ Events("onIsOpenedChange")
47
+ }
48
+
42
49
  // Defines a single view for now – a single choice segmented control
43
50
  View(PickerView::class) {
44
51
  Events("onOptionSelected")
@@ -85,10 +92,12 @@ class ExpoUIModule : Module() {
85
92
  }
86
93
  }
87
94
 
95
+ View(BoxView::class)
88
96
  View(RowView::class)
89
97
  View(ColumnView::class)
90
- View(ContainerView::class)
98
+ View(HostView::class)
91
99
  View(TextView::class)
100
+ View(CarouselView::class)
92
101
 
93
102
  View(AlertDialogView::class) {
94
103
  Events(
@@ -104,8 +113,12 @@ class ExpoUIModule : Module() {
104
113
  )
105
114
  }
106
115
 
107
- Function("padding") { all: Int ->
108
- return@Function ExpoModifier(Modifier.padding(Dp(all.toFloat())))
116
+ Function("paddingAll") { all: Int ->
117
+ return@Function ExpoModifier(Modifier.padding(all.dp))
118
+ }
119
+
120
+ Function("padding") { start: Int, top: Int, end: Int, bottom: Int ->
121
+ return@Function ExpoModifier(Modifier.padding(start.dp, top.dp, end.dp, bottom.dp))
109
122
  }
110
123
 
111
124
  Function("size") { width: Int, height: Int ->
@@ -160,6 +173,44 @@ class ExpoUIModule : Module() {
160
173
  return@Function ExpoModifier(Modifier.zIndex(index))
161
174
  }
162
175
 
176
+ Function("animateContentSize") { dampingRatio: Float?, stiffness: Float? ->
177
+ return@Function ExpoModifier(
178
+ Modifier.animateContentSize(
179
+ spring(dampingRatio = dampingRatio ?: Spring.DampingRatioNoBouncy, stiffness = stiffness ?: Spring.StiffnessMedium)
180
+ )
181
+ )
182
+ }
183
+
184
+ Function("weight") { weight: Float ->
185
+ val scopedExpoModifier = ExpoModifier {
186
+ it.rowScope?.run {
187
+ Modifier.weight(weight)
188
+ } ?: it.columnScope?.run {
189
+ Modifier.weight(weight)
190
+ } ?: Modifier
191
+ }
192
+ return@Function scopedExpoModifier
193
+ }
194
+
195
+ Function("matchParentSize") {
196
+ val scopedExpoModifier = ExpoModifier {
197
+ it.boxScope?.run {
198
+ Modifier.matchParentSize()
199
+ } ?: Modifier
200
+ }
201
+ return@Function scopedExpoModifier
202
+ }
203
+
204
+ Function("testID") { testID: String ->
205
+ return@Function ExpoModifier(Modifier.applyTestTag(testID))
206
+ }
207
+
208
+ Function("clip") { shapeRecord: ShapeRecord ->
209
+ val shape = shapeFromShapeRecord(shapeRecord)
210
+ ?: return@Function Modifier
211
+ return@Function ExpoModifier(Modifier.clip(shape))
212
+ }
213
+
163
214
  // TODO: Consider implementing semantics, layoutId, clip, navigationBarsPadding, systemBarsPadding
164
215
  }
165
216
  }