@expo/ui 0.2.0-alpha.0 → 0.2.0-alpha.2

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 (350) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/AlertDialogView.kt +3 -1
  4. package/android/src/main/java/expo/modules/ui/ComposeViews.kt +6 -6
  5. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +4 -3
  6. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +88 -0
  7. package/android/src/main/java/expo/modules/ui/Modifiers.kt +15 -0
  8. package/android/src/main/java/expo/modules/ui/PickerView.kt +7 -2
  9. package/android/src/main/java/expo/modules/ui/ProgressView.kt +8 -4
  10. package/android/src/main/java/expo/modules/ui/ShapeView.kt +3 -2
  11. package/android/src/main/java/expo/modules/ui/SliderView.kt +4 -2
  12. package/android/src/main/java/expo/modules/ui/SwitchView.kt +3 -2
  13. package/android/src/main/java/expo/modules/ui/TextInputView.kt +4 -2
  14. package/android/src/main/java/expo/modules/ui/button/Button.kt +17 -8
  15. package/build/jetpack-compose/AlertDialog/index.d.ts +3 -0
  16. package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
  17. package/build/jetpack-compose/AlertDialog/index.js +3 -1
  18. package/build/jetpack-compose/AlertDialog/index.js.map +1 -1
  19. package/build/jetpack-compose/Button/index.d.ts +3 -1
  20. package/build/jetpack-compose/Button/index.d.ts.map +1 -1
  21. package/build/jetpack-compose/Button/index.js +2 -0
  22. package/build/jetpack-compose/Button/index.js.map +1 -1
  23. package/build/jetpack-compose/ContextMenu/index.d.ts +3 -0
  24. package/build/jetpack-compose/ContextMenu/index.d.ts.map +1 -1
  25. package/build/jetpack-compose/ContextMenu/index.js +3 -1
  26. package/build/jetpack-compose/ContextMenu/index.js.map +1 -1
  27. package/build/jetpack-compose/DatePicker/index.d.ts +3 -1
  28. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  29. package/build/jetpack-compose/DatePicker/index.js +2 -0
  30. package/build/jetpack-compose/DatePicker/index.js.map +1 -1
  31. package/build/jetpack-compose/Picker/index.d.ts +5 -0
  32. package/build/jetpack-compose/Picker/index.d.ts.map +1 -1
  33. package/build/jetpack-compose/Picker/index.js +4 -0
  34. package/build/jetpack-compose/Picker/index.js.map +1 -1
  35. package/build/jetpack-compose/Progress/index.d.ts +5 -0
  36. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  37. package/build/jetpack-compose/Progress/index.js +4 -2
  38. package/build/jetpack-compose/Progress/index.js.map +1 -1
  39. package/build/jetpack-compose/Shape/index.d.ts +4 -1
  40. package/build/jetpack-compose/Shape/index.d.ts.map +1 -1
  41. package/build/jetpack-compose/Shape/index.js +3 -1
  42. package/build/jetpack-compose/Shape/index.js.map +1 -1
  43. package/build/jetpack-compose/Slider/index.d.ts +3 -1
  44. package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
  45. package/build/jetpack-compose/Slider/index.js +2 -0
  46. package/build/jetpack-compose/Slider/index.js.map +1 -1
  47. package/build/jetpack-compose/Switch/index.d.ts +3 -0
  48. package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
  49. package/build/jetpack-compose/Switch/index.js +2 -0
  50. package/build/jetpack-compose/Switch/index.js.map +1 -1
  51. package/build/jetpack-compose/TextInput/index.d.ts +3 -1
  52. package/build/jetpack-compose/TextInput/index.d.ts.map +1 -1
  53. package/build/jetpack-compose/TextInput/index.js +2 -0
  54. package/build/jetpack-compose/TextInput/index.js.map +1 -1
  55. package/build/jetpack-compose/index.d.ts +1 -0
  56. package/build/jetpack-compose/index.d.ts.map +1 -1
  57. package/build/jetpack-compose/index.js +1 -0
  58. package/build/jetpack-compose/index.js.map +1 -1
  59. package/build/jetpack-compose/modifiers.d.ts +14 -0
  60. package/build/jetpack-compose/modifiers.d.ts.map +1 -0
  61. package/build/jetpack-compose/modifiers.js +15 -0
  62. package/build/jetpack-compose/modifiers.js.map +1 -0
  63. package/build/swift-ui/BottomSheet/index.d.ts +2 -14
  64. package/build/swift-ui/BottomSheet/index.d.ts.map +1 -1
  65. package/build/swift-ui/BottomSheet/index.js +7 -15
  66. package/build/swift-ui/BottomSheet/index.js.map +1 -1
  67. package/build/swift-ui/Button/index.d.ts +6 -11
  68. package/build/swift-ui/Button/index.d.ts.map +1 -1
  69. package/build/swift-ui/Button/index.js +7 -14
  70. package/build/swift-ui/Button/index.js.map +1 -1
  71. package/build/swift-ui/ColorPicker/index.d.ts +3 -10
  72. package/build/swift-ui/ColorPicker/index.d.ts.map +1 -1
  73. package/build/swift-ui/ColorPicker/index.js +5 -14
  74. package/build/swift-ui/ColorPicker/index.js.map +1 -1
  75. package/build/{swift-ui-primitives/ContentUnavailableView.d.ts → swift-ui/ContentUnavailableView/index.d.ts} +3 -8
  76. package/build/swift-ui/ContentUnavailableView/index.d.ts.map +1 -0
  77. package/build/swift-ui/ContentUnavailableView/index.js +19 -0
  78. package/build/swift-ui/ContentUnavailableView/index.js.map +1 -0
  79. package/build/swift-ui/ContextMenu/Submenu.d.ts +21 -0
  80. package/build/swift-ui/ContextMenu/Submenu.d.ts.map +1 -0
  81. package/build/swift-ui/ContextMenu/Submenu.js +8 -0
  82. package/build/swift-ui/ContextMenu/Submenu.js.map +1 -0
  83. package/build/swift-ui/ContextMenu/index.d.ts +6 -87
  84. package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
  85. package/build/swift-ui/ContextMenu/index.js +11 -26
  86. package/build/swift-ui/ContextMenu/index.js.map +1 -1
  87. package/build/swift-ui/ContextMenu/types.d.ts +36 -0
  88. package/build/swift-ui/ContextMenu/types.d.ts.map +1 -0
  89. package/build/swift-ui/ContextMenu/types.js.map +1 -0
  90. package/build/swift-ui/ContextMenu/utils.d.ts +4 -4
  91. package/build/swift-ui/ContextMenu/utils.d.ts.map +1 -1
  92. package/build/swift-ui/ContextMenu/utils.js +7 -7
  93. package/build/swift-ui/ContextMenu/utils.js.map +1 -1
  94. package/build/swift-ui/DatePicker/index.d.ts +3 -21
  95. package/build/swift-ui/DatePicker/index.d.ts.map +1 -1
  96. package/build/swift-ui/DatePicker/index.js +6 -28
  97. package/build/swift-ui/DatePicker/index.js.map +1 -1
  98. package/build/{swift-ui-primitives/DisclosureGroup.d.ts → swift-ui/DisclosureGroup/index.d.ts} +2 -8
  99. package/build/swift-ui/DisclosureGroup/index.d.ts.map +1 -0
  100. package/build/swift-ui/DisclosureGroup/index.js +16 -0
  101. package/build/swift-ui/DisclosureGroup/index.js.map +1 -0
  102. package/build/{swift-ui-primitives/Form.d.ts → swift-ui/Form/index.d.ts} +2 -2
  103. package/build/swift-ui/Form/index.d.ts.map +1 -0
  104. package/build/swift-ui/Form/index.js +15 -0
  105. package/build/swift-ui/Form/index.js.map +1 -0
  106. package/build/swift-ui/Gauge/index.d.ts +4 -10
  107. package/build/swift-ui/Gauge/index.d.ts.map +1 -1
  108. package/build/swift-ui/Gauge/index.js +4 -20
  109. package/build/swift-ui/Gauge/index.js.map +1 -1
  110. package/build/swift-ui/Host/index.d.ts +2 -1
  111. package/build/swift-ui/Host/index.d.ts.map +1 -1
  112. package/build/swift-ui/Host/index.js +3 -2
  113. package/build/swift-ui/Host/index.js.map +1 -1
  114. package/build/{swift-ui-primitives/Image.d.ts → swift-ui/Image/index.d.ts} +2 -2
  115. package/build/swift-ui/Image/index.d.ts.map +1 -0
  116. package/build/{swift-ui-primitives/Image.js → swift-ui/Image/index.js} +5 -2
  117. package/build/swift-ui/Image/index.js.map +1 -0
  118. package/build/swift-ui/Label/index.d.ts +3 -10
  119. package/build/swift-ui/Label/index.d.ts.map +1 -1
  120. package/build/swift-ui/Label/index.js +3 -11
  121. package/build/swift-ui/Label/index.js.map +1 -1
  122. package/build/{swift-ui-primitives/Layout.d.ts → swift-ui/Layout/index.d.ts} +3 -3
  123. package/build/swift-ui/Layout/index.d.ts.map +1 -0
  124. package/build/{swift-ui-primitives/Layout.js → swift-ui/Layout/index.js} +15 -3
  125. package/build/swift-ui/Layout/index.js.map +1 -0
  126. package/build/swift-ui/List/index.d.ts +3 -34
  127. package/build/swift-ui/List/index.d.ts.map +1 -1
  128. package/build/swift-ui/List/index.js +7 -16
  129. package/build/swift-ui/List/index.js.map +1 -1
  130. package/build/swift-ui/Picker/index.d.ts +3 -16
  131. package/build/swift-ui/Picker/index.d.ts.map +1 -1
  132. package/build/swift-ui/Picker/index.js +7 -16
  133. package/build/swift-ui/Picker/index.js.map +1 -1
  134. package/build/swift-ui/Progress/index.d.ts +6 -19
  135. package/build/swift-ui/Progress/index.d.ts.map +1 -1
  136. package/build/swift-ui/Progress/index.js +5 -21
  137. package/build/swift-ui/Progress/index.js.map +1 -1
  138. package/build/swift-ui/Section/index.d.ts +4 -11
  139. package/build/swift-ui/Section/index.d.ts.map +1 -1
  140. package/build/swift-ui/Section/index.js +3 -11
  141. package/build/swift-ui/Section/index.js.map +1 -1
  142. package/build/swift-ui/SecureField/index.d.ts +3 -14
  143. package/build/swift-ui/SecureField/index.d.ts.map +1 -1
  144. package/build/swift-ui/SecureField/index.js +5 -14
  145. package/build/swift-ui/SecureField/index.js.map +1 -1
  146. package/build/swift-ui/ShareLink/index.d.ts +3 -10
  147. package/build/swift-ui/ShareLink/index.d.ts.map +1 -1
  148. package/build/swift-ui/ShareLink/index.js +3 -11
  149. package/build/swift-ui/ShareLink/index.js.map +1 -1
  150. package/build/swift-ui/Slider/index.d.ts +3 -15
  151. package/build/swift-ui/Slider/index.d.ts.map +1 -1
  152. package/build/swift-ui/Slider/index.js +7 -12
  153. package/build/swift-ui/Slider/index.js.map +1 -1
  154. package/build/{swift-ui-primitives/Spacer.d.ts → swift-ui/Spacer/index.d.ts} +2 -2
  155. package/build/swift-ui/Spacer/index.d.ts.map +1 -0
  156. package/build/swift-ui/Spacer/index.js +15 -0
  157. package/build/swift-ui/Spacer/index.js.map +1 -0
  158. package/build/swift-ui/Switch/index.d.ts +3 -20
  159. package/build/swift-ui/Switch/index.d.ts.map +1 -1
  160. package/build/swift-ui/Switch/index.js +7 -16
  161. package/build/swift-ui/Switch/index.js.map +1 -1
  162. package/build/{swift-ui-primitives/Text.d.ts → swift-ui/Text/index.d.ts} +2 -2
  163. package/build/swift-ui/Text/index.d.ts.map +1 -0
  164. package/build/{swift-ui-primitives/Text.js → swift-ui/Text/index.js} +5 -2
  165. package/build/swift-ui/Text/index.js.map +1 -0
  166. package/build/swift-ui/TextField/index.d.ts +4 -11
  167. package/build/swift-ui/TextField/index.d.ts.map +1 -1
  168. package/build/swift-ui/TextField/index.js +5 -14
  169. package/build/swift-ui/TextField/index.js.map +1 -1
  170. package/build/swift-ui/index.d.ts +7 -0
  171. package/build/swift-ui/index.d.ts.map +1 -1
  172. package/build/swift-ui/index.js +7 -0
  173. package/build/swift-ui/index.js.map +1 -1
  174. package/build/swift-ui/modifiers/index.d.ts +259 -0
  175. package/build/swift-ui/modifiers/index.d.ts.map +1 -0
  176. package/build/swift-ui/modifiers/index.js +224 -0
  177. package/build/swift-ui/modifiers/index.js.map +1 -0
  178. package/build/swift-ui/modifiers/utils.d.ts +15 -0
  179. package/build/swift-ui/modifiers/utils.d.ts.map +1 -0
  180. package/build/swift-ui/modifiers/utils.js +23 -0
  181. package/build/swift-ui/modifiers/utils.js.map +1 -0
  182. package/build/{swift-ui-primitives → swift-ui}/types.d.ts +47 -4
  183. package/build/swift-ui/types.d.ts.map +1 -0
  184. package/build/swift-ui/types.js +2 -0
  185. package/build/swift-ui/types.js.map +1 -0
  186. package/build/types.d.ts +3 -0
  187. package/build/types.d.ts.map +1 -1
  188. package/build/types.js.map +1 -1
  189. package/expo-module.config.json +1 -1
  190. package/ios/BottomSheetView.swift +9 -1
  191. package/ios/Button/Button.swift +1 -0
  192. package/ios/Button/ButtonProps.swift +7 -2
  193. package/ios/ColorPickerView.swift +8 -1
  194. package/ios/ContentUnavailableView.swift +3 -1
  195. package/ios/ContextMenu/ContextMenu.swift +5 -0
  196. package/ios/ContextMenu/ContextMenuRecords.swift +19 -3
  197. package/ios/DateTimePickerView.swift +8 -1
  198. package/ios/DisclosureGroupView.swift +4 -2
  199. package/ios/ExpoUIModule.swift +25 -28
  200. package/ios/FormView.swift +3 -1
  201. package/ios/Gauge/Gauge.swift +1 -0
  202. package/ios/Gauge/GaugeProps.swift +7 -1
  203. package/ios/GroupView.swift +3 -1
  204. package/ios/HStackView.swift +3 -1
  205. package/ios/HostView.swift +1 -1
  206. package/ios/ImageView.swift +3 -1
  207. package/ios/Label.swift +9 -2
  208. package/ios/List.swift +8 -2
  209. package/ios/Modifiers/CommonViewModifiers.swift +6 -3
  210. package/ios/Modifiers/View+ModifierArray.swift +27 -0
  211. package/ios/Modifiers/ViewModifierRegistry.swift +718 -0
  212. package/ios/PickerView.swift +8 -1
  213. package/ios/ProgressView.swift +8 -1
  214. package/ios/SectionView.swift +9 -20
  215. package/ios/SecureField/SecureFieldView.swift +10 -2
  216. package/ios/ShareLinkView.swift +9 -1
  217. package/ios/SliderView.swift +8 -1
  218. package/ios/SpacerView.swift +3 -1
  219. package/ios/SwitchView.swift +8 -1
  220. package/ios/TextField/TextFieldView.swift +8 -1
  221. package/ios/TextView.swift +3 -1
  222. package/ios/VStackView.swift +3 -1
  223. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar +0 -0
  224. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar.md5 +1 -0
  225. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar.sha1 +1 -0
  226. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar.sha256 +1 -0
  227. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2-sources.jar.sha512 +1 -0
  228. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar +0 -0
  229. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar.md5 +1 -0
  230. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar.sha1 +1 -0
  231. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar.sha256 +1 -0
  232. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.aar.sha512 +1 -0
  233. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module → 0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module} +22 -22
  234. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module.md5 +1 -0
  235. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module.sha1 +1 -0
  236. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module.sha256 +1 -0
  237. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.module.sha512 +1 -0
  238. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom → 0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom} +1 -1
  239. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom.md5 +1 -0
  240. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom.sha1 +1 -0
  241. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom.sha256 +1 -0
  242. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.2/expo.modules.ui-0.2.0-alpha.2.pom.sha512 +1 -0
  243. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  244. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  245. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  246. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  247. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  248. package/package.json +4 -4
  249. package/src/jetpack-compose/AlertDialog/index.tsx +12 -1
  250. package/src/jetpack-compose/Button/index.tsx +6 -1
  251. package/src/jetpack-compose/ContextMenu/index.tsx +6 -0
  252. package/src/jetpack-compose/DatePicker/index.tsx +5 -1
  253. package/src/jetpack-compose/Picker/index.tsx +10 -0
  254. package/src/jetpack-compose/Progress/index.tsx +20 -2
  255. package/src/jetpack-compose/Shape/index.tsx +17 -2
  256. package/src/jetpack-compose/Slider/index.tsx +6 -1
  257. package/src/jetpack-compose/Switch/index.tsx +7 -0
  258. package/src/jetpack-compose/TextInput/index.tsx +6 -1
  259. package/src/jetpack-compose/{index.tsx → index.ts} +1 -0
  260. package/src/jetpack-compose/modifiers.ts +19 -0
  261. package/src/swift-ui/BottomSheet/index.tsx +10 -19
  262. package/src/swift-ui/Button/index.tsx +11 -20
  263. package/src/swift-ui/ColorPicker/index.tsx +10 -18
  264. package/src/{swift-ui-primitives/ContentUnavailableView.tsx → swift-ui/ContentUnavailableView/index.tsx} +16 -9
  265. package/src/swift-ui/ContextMenu/Submenu.tsx +25 -0
  266. package/src/swift-ui/ContextMenu/index.tsx +23 -100
  267. package/src/swift-ui/ContextMenu/types.ts +47 -0
  268. package/src/swift-ui/ContextMenu/utils.ts +8 -13
  269. package/src/swift-ui/DatePicker/index.tsx +10 -40
  270. package/src/{swift-ui-primitives/DisclosureGroup.tsx → swift-ui/DisclosureGroup/index.tsx} +12 -6
  271. package/src/swift-ui/Form/index.tsx +30 -0
  272. package/src/swift-ui/Gauge/index.tsx +12 -23
  273. package/src/swift-ui/Host/index.tsx +7 -2
  274. package/src/{swift-ui-primitives/Image.tsx → swift-ui/Image/index.tsx} +6 -3
  275. package/src/swift-ui/Label/index.tsx +10 -15
  276. package/src/{swift-ui-primitives/Layout.tsx → swift-ui/Layout/index.tsx} +17 -4
  277. package/src/swift-ui/List/index.tsx +16 -28
  278. package/src/swift-ui/Picker/index.tsx +10 -22
  279. package/src/swift-ui/Progress/index.tsx +21 -28
  280. package/src/swift-ui/Section/index.tsx +11 -16
  281. package/src/swift-ui/SecureField/index.tsx +10 -22
  282. package/src/swift-ui/ShareLink/index.tsx +10 -15
  283. package/src/swift-ui/Slider/index.tsx +10 -18
  284. package/src/{swift-ui-primitives/Spacer.tsx → swift-ui/Spacer/index.tsx} +12 -2
  285. package/src/swift-ui/Switch/index.tsx +12 -22
  286. package/src/{swift-ui-primitives/Text.tsx → swift-ui/Text/index.tsx} +6 -2
  287. package/src/swift-ui/TextField/index.tsx +9 -21
  288. package/src/swift-ui/index.tsx +7 -0
  289. package/src/swift-ui/modifiers/index.ts +374 -0
  290. package/src/swift-ui/modifiers/utils.ts +33 -0
  291. package/src/{swift-ui-primitives → swift-ui}/types.ts +48 -4
  292. package/src/types.ts +4 -0
  293. package/swift-ui/index.d.ts +1 -0
  294. package/swift-ui/index.js +1 -0
  295. package/swift-ui/modifiers.d.ts +1 -0
  296. package/swift-ui/modifiers.js +1 -0
  297. package/build/swift-ui-primitives/ContentUnavailableView.d.ts.map +0 -1
  298. package/build/swift-ui-primitives/ContentUnavailableView.js +0 -15
  299. package/build/swift-ui-primitives/ContentUnavailableView.js.map +0 -1
  300. package/build/swift-ui-primitives/DisclosureGroup.d.ts.map +0 -1
  301. package/build/swift-ui-primitives/DisclosureGroup.js +0 -10
  302. package/build/swift-ui-primitives/DisclosureGroup.js.map +0 -1
  303. package/build/swift-ui-primitives/Form.d.ts.map +0 -1
  304. package/build/swift-ui-primitives/Form.js +0 -6
  305. package/build/swift-ui-primitives/Form.js.map +0 -1
  306. package/build/swift-ui-primitives/Image.d.ts.map +0 -1
  307. package/build/swift-ui-primitives/Image.js.map +0 -1
  308. package/build/swift-ui-primitives/Layout.d.ts.map +0 -1
  309. package/build/swift-ui-primitives/Layout.js.map +0 -1
  310. package/build/swift-ui-primitives/Section.d.ts +0 -6
  311. package/build/swift-ui-primitives/Section.d.ts.map +0 -1
  312. package/build/swift-ui-primitives/Section.js +0 -6
  313. package/build/swift-ui-primitives/Section.js.map +0 -1
  314. package/build/swift-ui-primitives/Spacer.d.ts.map +0 -1
  315. package/build/swift-ui-primitives/Spacer.js +0 -6
  316. package/build/swift-ui-primitives/Spacer.js.map +0 -1
  317. package/build/swift-ui-primitives/Text.d.ts.map +0 -1
  318. package/build/swift-ui-primitives/Text.js.map +0 -1
  319. package/build/swift-ui-primitives/index.d.ts +0 -24
  320. package/build/swift-ui-primitives/index.d.ts.map +0 -1
  321. package/build/swift-ui-primitives/index.js +0 -24
  322. package/build/swift-ui-primitives/index.js.map +0 -1
  323. package/build/swift-ui-primitives/types.d.ts.map +0 -1
  324. package/build/swift-ui-primitives/types.js.map +0 -1
  325. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar +0 -0
  326. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar.md5 +0 -1
  327. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar.sha1 +0 -1
  328. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar.sha256 +0 -1
  329. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0-sources.jar.sha512 +0 -1
  330. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar +0 -0
  331. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar.md5 +0 -1
  332. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar.sha1 +0 -1
  333. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar.sha256 +0 -1
  334. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.aar.sha512 +0 -1
  335. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module.md5 +0 -1
  336. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module.sha1 +0 -1
  337. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module.sha256 +0 -1
  338. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.module.sha512 +0 -1
  339. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom.md5 +0 -1
  340. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom.sha1 +0 -1
  341. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom.sha256 +0 -1
  342. package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.0/expo.modules.ui-0.2.0-alpha.0.pom.sha512 +0 -1
  343. package/src/swift-ui-primitives/Form.tsx +0 -20
  344. package/src/swift-ui-primitives/Section.tsx +0 -15
  345. package/src/swift-ui-primitives/index.tsx +0 -27
  346. package/swift-ui-primitives.d.ts +0 -1
  347. package/swift-ui-primitives.js +0 -1
  348. package/swift-ui.d.ts +0 -1
  349. package/swift-ui.js +0 -1
  350. /package/build/{swift-ui-primitives → swift-ui/ContextMenu}/types.js +0 -0
@@ -1,16 +1,11 @@
1
1
  import { Children, isValidElement, ReactElement, ReactNode } from 'react';
2
2
  import { NativeSyntheticEvent } from 'react-native';
3
3
 
4
- import { ContextMenuElementBase, EventHandlers, Submenu, SubmenuProps } from './index';
5
- import {
6
- Button,
7
- ButtonPrimitive,
8
- ButtonProps,
9
- NativeButtonProps,
10
- transformButtonProps,
11
- } from '../Button';
12
- import { Picker, PickerPrimitive, PickerProps } from '../Picker';
13
- import { Switch, SwitchPrimitive, SwitchProps } from '../Switch';
4
+ import { type ContextMenuElementBase, type EventHandlers } from './types';
5
+ import { Button, transformButtonProps, type ButtonProps, type NativeButtonProps } from '../Button';
6
+ import { Picker, type PickerProps } from '../Picker';
7
+ import { Switch, type SwitchProps } from '../Switch';
8
+ import { Submenu, type SubmenuProps } from './Submenu';
14
9
 
15
10
  // We use this slightly odd typing for the elements to make unpacking the elements easier on the native side
16
11
  type ButtonMenuElement = {
@@ -57,17 +52,17 @@ function processChildElement(
57
52
 
58
53
  const uuid = expo.uuidv4();
59
54
 
60
- if (child.type === Button || child.type === ButtonPrimitive) {
55
+ if (child.type === Button) {
61
56
  // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
62
57
  return createButtonElement(uuid, child.props, eventHandlersMap);
63
58
  }
64
59
 
65
- if (child.type === Switch || child.type === SwitchPrimitive) {
60
+ if (child.type === Switch) {
66
61
  // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
67
62
  return createSwitchElement(uuid, child.props, eventHandlersMap);
68
63
  }
69
64
 
70
- if (child.type === Picker || child.type === PickerPrimitive) {
65
+ if (child.type === Picker) {
71
66
  // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
72
67
  return createPickerElement(uuid, child.props, eventHandlersMap);
73
68
  }
@@ -1,8 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { StyleProp, ViewStyle, StyleSheet, PixelRatio } from 'react-native';
3
2
 
4
- import { ViewEvent } from '../../types';
5
- import { Host } from '../Host';
3
+ import { type ViewEvent } from '../../types';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+ import { type CommonViewModifierProps } from '../types';
6
6
 
7
7
  export type IOSVariant = 'wheel' | 'automatic' | 'graphical' | 'compact';
8
8
 
@@ -37,18 +37,17 @@ export type DateTimePickerProps = {
37
37
  * The tint color to use on the picker elements.
38
38
  */
39
39
  color?: string;
40
- };
40
+ } & CommonViewModifierProps;
41
41
 
42
42
  type NativeDatePickerProps = Omit<DateTimePickerProps, 'variant' | 'onDateSelected'> & {
43
43
  variant?: IOSVariant;
44
44
  } & ViewEvent<'onDateSelected', { date: Date }>;
45
45
 
46
- /**
47
- * @hidden
48
- */
49
- export function transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePickerProps {
50
- const { variant, ...rest } = props;
46
+ function transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePickerProps {
47
+ const { variant, modifiers, ...rest } = props;
51
48
  return {
49
+ modifiers,
50
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
52
51
  ...rest,
53
52
  onDateSelected: ({ nativeEvent: { date } }) => {
54
53
  props?.onDateSelected?.(new Date(date));
@@ -57,43 +56,14 @@ export function transformDateTimePickerProps(props: DateTimePickerProps): Native
57
56
  };
58
57
  }
59
58
 
60
- function transformDateTimePickerStyle(
61
- style: StyleProp<ViewStyle> | undefined
62
- ): StyleProp<ViewStyle> {
63
- const { minWidth, minHeight, ...restStyle } = StyleSheet.flatten(style) || {};
64
-
65
- // On Android, the picker’s minWidth and minHeight must be 12dp.
66
- // Otherwise, the picker will crash the app.
67
- const minSize = PixelRatio.getPixelSizeForLayoutSize(12);
68
-
69
- // However, when users pass the minWidth and minHeight props, we trust that they know what they are doing.
70
- const parsedMinWidth = minWidth ? minSize : undefined;
71
- const parsedMinHeight = minHeight ? minSize : undefined;
72
-
73
- return [restStyle, { minWidth: parsedMinWidth, minHeight: parsedMinHeight }];
74
- }
75
-
76
59
  const DatePickerNativeView: React.ComponentType<NativeDatePickerProps> = requireNativeView(
77
60
  'ExpoUI',
78
61
  'DateTimePickerView'
79
62
  );
80
63
 
81
- /**
82
- * `<DateTimePicker>` component without a host view.
83
- * You should use this with a `Host` component in ancestor.
84
- */
85
- export function DateTimePickerPrimitive(props: DateTimePickerProps) {
86
- return <DatePickerNativeView {...transformDateTimePickerProps(props)} />;
87
- }
88
-
89
64
  /**
90
65
  * Renders a `DateTimePicker` component.
91
66
  */
92
- export function DateTimePicker(props: DateTimePickerProps & { style?: StyleProp<ViewStyle> }) {
93
- const transformedStyle = transformDateTimePickerStyle(props.style);
94
- return (
95
- <Host style={transformedStyle} matchContents>
96
- <DateTimePickerPrimitive {...props} />
97
- </Host>
98
- );
67
+ export function DateTimePicker(props: DateTimePickerProps) {
68
+ return <DatePickerNativeView {...transformDateTimePickerProps(props)} />;
99
69
  }
@@ -1,7 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
2
 
3
- import { type CommonViewModifierProps } from './types';
4
- import { type ViewEvent } from '../types';
3
+ import { type ViewEvent } from '../../types';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+ import { type CommonViewModifierProps } from '../types';
5
6
 
6
7
  export interface DisclosureGroupProps extends CommonViewModifierProps {
7
8
  label: string;
@@ -18,18 +19,23 @@ export interface DisclosureGroupProps extends CommonViewModifierProps {
18
19
 
19
20
  type StateChangeEvent = ViewEvent<'onStateChange', { isExpanded: boolean }>;
20
21
 
21
- export type NativeDisclosureGroupProps = Omit<DisclosureGroupProps, 'onStateChange'> &
22
- StateChangeEvent;
22
+ type NativeDisclosureGroupProps = Omit<DisclosureGroupProps, 'onStateChange'> & StateChangeEvent;
23
23
 
24
24
  const DisclosureGroupNativeView: React.ComponentType<NativeDisclosureGroupProps> =
25
25
  requireNativeView('ExpoUI', 'DisclosureGroupView');
26
26
 
27
27
  export function DisclosureGroup(props: DisclosureGroupProps) {
28
- const { onStateChange, ...rest } = props;
28
+ const { onStateChange, modifiers, ...rest } = props;
29
29
 
30
30
  function handleStateChange(event: { nativeEvent: { isExpanded: boolean } }) {
31
31
  onStateChange?.(event.nativeEvent.isExpanded);
32
32
  }
33
33
 
34
- return <DisclosureGroupNativeView {...rest} onStateChange={handleStateChange} />;
34
+ const transformedProps = {
35
+ modifiers,
36
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
37
+ ...rest,
38
+ };
39
+
40
+ return <DisclosureGroupNativeView {...transformedProps} onStateChange={handleStateChange} />;
35
41
  }
@@ -0,0 +1,30 @@
1
+ import { requireNativeView } from 'expo';
2
+
3
+ import { createViewModifierEventListener } from '../modifiers/utils';
4
+ import { type CommonViewModifierProps } from '../types';
5
+
6
+ export interface FormProps extends CommonViewModifierProps {
7
+ children: React.ReactNode;
8
+
9
+ /**
10
+ * Makes the form scrollable.
11
+ * @default true
12
+ * @platform ios 16.0+
13
+ */
14
+ scrollEnabled?: boolean;
15
+ }
16
+
17
+ const FormNativeView: React.ComponentType<FormProps> = requireNativeView('ExpoUI', 'FormView');
18
+
19
+ function transformFormProps(props: FormProps): FormProps {
20
+ const { modifiers, ...restProps } = props;
21
+ return {
22
+ modifiers,
23
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
24
+ ...restProps,
25
+ };
26
+ }
27
+
28
+ export function Form(props: FormProps) {
29
+ return <FormNativeView {...transformFormProps(props)} />;
30
+ }
@@ -1,7 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { ColorValue, Platform, StyleProp, ViewStyle } from 'react-native';
2
+ import { ColorValue } from 'react-native';
3
3
 
4
- import { Host } from '../Host';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+ import { type CommonViewModifierProps } from '../types';
5
6
 
6
7
  /**
7
8
  * The type of `Gauge`.
@@ -57,33 +58,21 @@ export type GaugeProps = {
57
58
  * Color (or array of colors for gradient) of the `Gauge`.
58
59
  */
59
60
  color?: ColorValue | ColorValue[];
60
- };
61
-
62
- let GaugeNativeView: React.ComponentType<GaugeProps> | null;
63
-
64
- if (Platform.OS === 'ios') {
65
- GaugeNativeView = requireNativeView('ExpoUI', 'GaugeView');
66
- }
61
+ } & CommonViewModifierProps;
67
62
 
68
- /**
69
- * `<Gauge>` component without a host view.
70
- * You should use this with a `Host` component in ancestor.
71
- */
72
- export function GaugePrimitive({ type = 'default', ...props }: GaugeProps) {
73
- if (!GaugeNativeView) {
74
- return null;
75
- }
76
- return <GaugeNativeView type={type} {...props} />;
77
- }
63
+ const GaugeNativeView: React.ComponentType<GaugeProps> = requireNativeView('ExpoUI', 'GaugeView');
78
64
 
79
65
  /**
80
66
  * Renders a native `Gauge` component.
81
67
  * @platform ios
82
68
  */
83
- export function Gauge(props: GaugeProps & { style?: StyleProp<ViewStyle> }) {
69
+ export function Gauge({ type = 'default', modifiers, ...props }: GaugeProps) {
84
70
  return (
85
- <Host style={props.style} matchContents>
86
- <GaugePrimitive {...props} />
87
- </Host>
71
+ <GaugeNativeView
72
+ modifiers={modifiers}
73
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
74
+ type={type}
75
+ {...props}
76
+ />
88
77
  );
89
78
  }
@@ -2,6 +2,9 @@ import { requireNativeView } from 'expo';
2
2
  import { useState } from 'react';
3
3
  import { StyleProp, ViewStyle, type ColorSchemeName } from 'react-native';
4
4
 
5
+ import { createViewModifierEventListener } from '../modifiers/utils';
6
+ import { type CommonViewModifierProps } from '../types';
7
+
5
8
  export type HostProps = {
6
9
  /**
7
10
  * When true, the host view will update its size in the React Native view tree to match the content's layout from SwiftUI.
@@ -29,7 +32,7 @@ export type HostProps = {
29
32
 
30
33
  children: React.ReactNode;
31
34
  style?: StyleProp<ViewStyle>;
32
- };
35
+ } & CommonViewModifierProps;
33
36
 
34
37
  const HostNativeView: React.ComponentType<HostProps> = requireNativeView('ExpoUI', 'HostView');
35
38
 
@@ -37,11 +40,13 @@ const HostNativeView: React.ComponentType<HostProps> = requireNativeView('ExpoUI
37
40
  * A hosting component for SwiftUI views.
38
41
  */
39
42
  export function Host(props: HostProps) {
40
- const { matchContents, onLayoutContent, style, ...restProps } = props;
43
+ const { matchContents, onLayoutContent, style, modifiers, ...restProps } = props;
41
44
  const [containerStyle, setContainerStyle] = useState<ViewStyle | null>(null);
42
45
 
43
46
  return (
44
47
  <HostNativeView
48
+ modifiers={modifiers}
49
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
45
50
  style={[style, containerStyle]}
46
51
  onLayoutContent={(e) => {
47
52
  onLayoutContent?.(e);
@@ -1,7 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
2
 
3
- import { ViewEvent } from '../types';
4
- import { type CommonViewModifierProps } from './types';
3
+ import { type ViewEvent } from '../../types';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+ import { type CommonViewModifierProps } from '../types';
5
6
 
6
7
  export interface ImageProps extends CommonViewModifierProps {
7
8
  /**
@@ -32,8 +33,10 @@ type TapEvent = ViewEvent<'onTap', object> & {
32
33
  type NativeImageProps = Omit<ImageProps, 'onPress'> | TapEvent;
33
34
 
34
35
  function transformNativeProps(props: ImageProps): NativeImageProps {
35
- const { onPress, ...restProps } = props;
36
+ const { onPress, modifiers, ...restProps } = props;
36
37
  return {
38
+ modifiers,
39
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
37
40
  ...restProps,
38
41
  ...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),
39
42
  };
@@ -1,7 +1,7 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
2
 
4
- import { Host } from '../Host';
3
+ import { createViewModifierEventListener } from '../modifiers/utils';
4
+ import { type CommonViewModifierProps } from '../types';
5
5
 
6
6
  export type LabelProps = {
7
7
  /**
@@ -18,18 +18,10 @@ export type LabelProps = {
18
18
  * The color of the label icon.
19
19
  */
20
20
  color?: string;
21
- };
21
+ } & CommonViewModifierProps;
22
22
 
23
23
  const LabelNativeView: React.ComponentType<LabelProps> = requireNativeView('ExpoUI', 'LabelView');
24
24
 
25
- /**
26
- * `<Label>` component without a host view.
27
- * You should use this with a `Host` component in ancestor.
28
- */
29
- export function LabelPrimitive(props: LabelProps) {
30
- return <LabelNativeView {...props} />;
31
- }
32
-
33
25
  /**
34
26
  * Renders a native label view, which could be used in a list or section.
35
27
  *
@@ -37,10 +29,13 @@ export function LabelPrimitive(props: LabelProps) {
37
29
  * @returns {JSX.Element} The rendered native Label component.
38
30
  * @platform ios
39
31
  */
40
- export function Label(props: LabelProps & { style?: StyleProp<ViewStyle> }) {
32
+ export function Label(props: LabelProps) {
33
+ const { modifiers, ...restProps } = props;
41
34
  return (
42
- <Host style={props.style} matchContents>
43
- <LabelPrimitive {...props} />
44
- </Host>
35
+ <LabelNativeView
36
+ modifiers={modifiers}
37
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
38
+ {...restProps}
39
+ />
45
40
  );
46
41
  }
@@ -1,7 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
2
 
3
- import { type CommonViewModifierProps } from './types';
4
- import { ViewEvent } from '../types';
3
+ import { type ViewEvent } from '../../types';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+ import { type CommonViewModifierProps } from '../types';
5
6
 
6
7
  type TapEvent = ViewEvent<'onTap', object> & {
7
8
  useTapGesture?: boolean;
@@ -20,8 +21,10 @@ interface StackBaseProps extends CommonViewModifierProps {
20
21
  export type NativeStackProps = Omit<StackBaseProps, 'onPress'> | TapEvent;
21
22
 
22
23
  function transformNativeProps(props: StackBaseProps): NativeStackProps {
23
- const { onPress, ...restProps } = props;
24
+ const { onPress, modifiers, ...restProps } = props;
24
25
  return {
26
+ modifiers,
27
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
25
28
  ...restProps,
26
29
  ...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),
27
30
  };
@@ -73,7 +76,17 @@ const GroupNativeView: React.ComponentType<NativeGroupProps> = requireNativeView
73
76
  'GroupView'
74
77
  );
75
78
 
79
+ function transformGroupProps(props: GroupProps): NativeGroupProps {
80
+ const { onPress, modifiers, ...restProps } = props;
81
+ return {
82
+ modifiers,
83
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
84
+ ...restProps,
85
+ ...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),
86
+ };
87
+ }
88
+
76
89
  export function Group(props: GroupProps) {
77
- return <GroupNativeView {...transformNativeProps(props)} />;
90
+ return <GroupNativeView {...transformGroupProps(props)} />;
78
91
  }
79
92
  //#endregion
@@ -1,15 +1,20 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
2
 
4
- import { ViewEvent } from '../../types';
5
- import { Host } from '../Host';
3
+ import { type ViewEvent } from '../../types';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+ import { type CommonViewModifierProps } from '../types';
6
6
 
7
- const ListNativeView: React.ComponentType<NativeListProps> | null =
8
- requireNativeView<NativeListProps>('ExpoUI', 'ListView');
7
+ const ListNativeView: React.ComponentType<NativeListProps> = requireNativeView<NativeListProps>(
8
+ 'ExpoUI',
9
+ 'ListView'
10
+ );
9
11
 
10
12
  function transformListProps(props: Omit<ListProps, 'children'>): Omit<NativeListProps, 'children'> {
13
+ const { modifiers, ...restProps } = props;
11
14
  return {
12
- ...props,
15
+ modifiers,
16
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
17
+ ...restProps,
13
18
  onDeleteItem: ({ nativeEvent: { index } }) => props?.onDeleteItem?.(index),
14
19
  onMoveItem: ({ nativeEvent: { from, to } }) => props?.onMoveItem?.(from, to),
15
20
  onSelectionChange: ({ nativeEvent: { selection } }) => props?.onSelectionChange?.(selection),
@@ -18,7 +23,7 @@ function transformListProps(props: Omit<ListProps, 'children'>): Omit<NativeList
18
23
 
19
24
  export type ListStyle = 'automatic' | 'plain' | 'inset' | 'insetGrouped' | 'grouped' | 'sidebar';
20
25
 
21
- export interface ListProps {
26
+ export interface ListProps extends CommonViewModifierProps {
22
27
  /**
23
28
  * One of the predefined ListStyle types in SwiftUI.
24
29
  * @default 'automatic'
@@ -90,37 +95,20 @@ type MoveItemEvent = ViewEvent<'onMoveItem', { from: number; to: number }>;
90
95
  */
91
96
  type SelectItemEvent = ViewEvent<'onSelectionChange', { selection: number[] }>;
92
97
 
93
- export type NativeListProps = Omit<ListProps, 'onDeleteItem' | 'onMoveItem' | 'onSelectionChange'> &
98
+ type NativeListProps = Omit<ListProps, 'onDeleteItem' | 'onMoveItem' | 'onSelectionChange'> &
94
99
  DeleteItemEvent &
95
100
  MoveItemEvent &
96
101
  SelectItemEvent & {
97
102
  children: React.ReactNode;
98
103
  };
99
104
 
100
- /**
101
- * `<List>` component without a host view.
102
- * You should use this with a `Host` component in ancestor.
103
- */
104
- export function ListPrimitive(props: ListProps) {
105
- const { children, ...nativeProps } = props;
106
-
107
- if (!ListNativeView) {
108
- return null;
109
- }
110
-
111
- return <ListNativeView {...transformListProps(nativeProps)}>{children}</ListNativeView>;
112
- }
113
-
114
105
  /**
115
106
  * A list component that renders its children using a native SwiftUI list.
116
107
  * @param {ListProps} props - The properties for the list component.
117
108
  * @returns {JSX.Element | null} The rendered list with its children or null if the platform is unsupported.
118
109
  * @platform ios
119
110
  */
120
- export function List(props: ListProps & { style?: StyleProp<ViewStyle> }) {
121
- return (
122
- <Host style={[props.style, { flex: 1 }]} matchContents>
123
- <ListPrimitive {...props} />
124
- </Host>
125
- );
111
+ export function List(props: ListProps) {
112
+ const { children, ...nativeProps } = props;
113
+ return <ListNativeView {...transformListProps(nativeProps)}>{children}</ListNativeView>;
126
114
  }
@@ -1,7 +1,7 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
2
 
4
- import { Host } from '../Host';
3
+ import { createViewModifierEventListener } from '../modifiers/utils';
4
+ import { type CommonViewModifierProps } from '../types';
5
5
 
6
6
  export type PickerProps = {
7
7
  /**
@@ -30,7 +30,7 @@ export type PickerProps = {
30
30
  * Picker color. On iOS it only applies to the `'menu'` variant.
31
31
  */
32
32
  color?: string;
33
- };
33
+ } & CommonViewModifierProps;
34
34
 
35
35
  const PickerNativeView: React.ComponentType<PickerProps> = requireNativeView(
36
36
  'ExpoUI',
@@ -39,32 +39,20 @@ const PickerNativeView: React.ComponentType<PickerProps> = requireNativeView(
39
39
 
40
40
  type NativePickerProps = PickerProps;
41
41
 
42
- /**
43
- * @hidden
44
- */
45
- export function transformPickerProps(props: PickerProps): NativePickerProps {
42
+ function transformPickerProps(props: PickerProps): NativePickerProps {
43
+ const { modifiers, ...restProps } = props;
46
44
  return {
47
- ...props,
45
+ modifiers,
46
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
47
+ ...restProps,
48
48
  variant: props.variant ?? 'segmented',
49
49
  color: props.color,
50
50
  };
51
51
  }
52
52
 
53
- /**
54
- * `<Picker>` component without a host view.
55
- * You should use this with a `Host` component in ancestor.
56
- */
57
- export function PickerPrimitive(props: PickerProps) {
58
- return <PickerNativeView {...transformPickerProps(props)} />;
59
- }
60
-
61
53
  /**
62
54
  * Displays a native picker component. Depending on the variant it can be a segmented button, an inline picker, a list of choices or a radio button.
63
55
  */
64
- export function Picker(props: PickerProps & { style?: StyleProp<ViewStyle> }) {
65
- return (
66
- <Host style={props.style} matchContents>
67
- <PickerPrimitive {...props} />
68
- </Host>
69
- );
56
+ export function Picker(props: PickerProps) {
57
+ return <PickerNativeView {...transformPickerProps(props)} />;
70
58
  }
@@ -1,7 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { ColorValue, StyleProp, ViewStyle } from 'react-native';
2
+ import { ColorValue } from 'react-native';
3
3
 
4
- import { Host } from '../Host';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+ import { type CommonViewModifierProps } from '../types';
5
6
 
6
7
  export type CircularProgressProps = {
7
8
  /**
@@ -12,7 +13,7 @@ export type CircularProgressProps = {
12
13
  * Progress color.
13
14
  */
14
15
  color?: ColorValue;
15
- };
16
+ } & CommonViewModifierProps;
16
17
 
17
18
  export type LinearProgressProps = {
18
19
  /**
@@ -23,7 +24,7 @@ export type LinearProgressProps = {
23
24
  * Progress color.
24
25
  */
25
26
  color?: ColorValue;
26
- };
27
+ } & CommonViewModifierProps;
27
28
 
28
29
  type NativeProgressProps =
29
30
  | CircularProgressProps
@@ -36,40 +37,32 @@ const NativeProgressView: React.ComponentType<NativeProgressProps> = requireNati
36
37
  'ProgressView'
37
38
  );
38
39
 
39
- /**
40
- * `<CircularProgress>` component without a host view.
41
- * You should use this with a `Host` component in ancestor.
42
- */
43
- export function CircularProgressPrimitive(props: CircularProgressProps) {
44
- return <NativeProgressView {...props} variant="circular" />;
45
- }
46
-
47
- /**
48
- * `<LinearProgress>` component without a host view.
49
- * You should use this with a `Host` component in ancestor.
50
- */
51
- export function LinearProgressPrimitive(props: LinearProgressProps) {
52
- return <NativeProgressView {...props} variant="linear" />;
53
- }
54
-
55
40
  /**
56
41
  * Renders a `CircularProgress` component.
57
42
  */
58
- export function CircularProgress(props: CircularProgressProps & { style?: StyleProp<ViewStyle> }) {
43
+ export function CircularProgress(props: CircularProgressProps) {
44
+ const { modifiers, ...restProps } = props;
59
45
  return (
60
- <Host style={props.style} matchContents>
61
- <CircularProgressPrimitive {...props} />
62
- </Host>
46
+ <NativeProgressView
47
+ modifiers={modifiers}
48
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
49
+ {...restProps}
50
+ variant="circular"
51
+ />
63
52
  );
64
53
  }
65
54
 
66
55
  /**
67
56
  * Renders a `LinearProgress` component.
68
57
  */
69
- export function LinearProgress(props: LinearProgressProps & { style?: StyleProp<ViewStyle> }) {
58
+ export function LinearProgress(props: LinearProgressProps) {
59
+ const { modifiers, ...restProps } = props;
70
60
  return (
71
- <Host style={props.style} matchContents>
72
- <LinearProgressPrimitive {...props} />
73
- </Host>
61
+ <NativeProgressView
62
+ modifiers={modifiers}
63
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
64
+ {...restProps}
65
+ variant="linear"
66
+ />
74
67
  );
75
68
  }
@@ -1,38 +1,33 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
2
 
4
- import { Host } from '../Host';
3
+ import { createViewModifierEventListener } from '../modifiers/utils';
4
+ import { type CommonViewModifierProps } from '../types';
5
5
 
6
6
  export type SectionProps = {
7
7
  /**
8
8
  * On iOS, section titles are usually capitalized for consistency with platform conventions.
9
9
  */
10
10
  title?: string;
11
- children: any;
12
- };
11
+ children: React.ReactNode;
12
+ } & CommonViewModifierProps;
13
13
 
14
14
  const SectionNativeView: React.ComponentType<SectionProps> = requireNativeView(
15
15
  'ExpoUI',
16
16
  'SectionView'
17
17
  );
18
18
 
19
- /**
20
- * `<Section>` component without a host view.
21
- * You should use this with a `Host` component in ancestor.
22
- */
23
- export function SectionPrimitive(props: SectionProps) {
24
- return <SectionNativeView {...props} />;
25
- }
26
-
27
19
  /**
28
20
  * Section component uses the native [Section](https://developer.apple.com/documentation/swiftui/section) component.
29
21
  * It has no intrinsic dimensions, so it needs explicit height or flex set to display content (like ScrollView).
30
22
  * @platform ios
31
23
  */
32
- export function Section(props: SectionProps & { style?: StyleProp<ViewStyle> }) {
24
+ export function Section(props: SectionProps) {
25
+ const { modifiers, ...restProps } = props;
33
26
  return (
34
- <Host style={props.style} matchContents>
35
- <SectionPrimitive {...props} />
36
- </Host>
27
+ <SectionNativeView
28
+ modifiers={modifiers}
29
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
30
+ {...restProps}
31
+ />
37
32
  );
38
33
  }