@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,6 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { ColorValue, StyleProp, ViewStyle } from 'react-native';
3
3
 
4
+ import { ExpoModifier } from '../../types';
5
+
4
6
  export type ProgressElementColors = {
5
7
  /**
6
8
  * Track color.
@@ -28,6 +30,8 @@ export type CircularProgressProps = {
28
30
  * @platform android
29
31
  */
30
32
  elementColors?: ProgressElementColors;
33
+ /** Modifiers for the component */
34
+ modifiers?: ExpoModifier[];
31
35
  };
32
36
 
33
37
  export type LinearProgressProps = {
@@ -48,6 +52,8 @@ export type LinearProgressProps = {
48
52
  * @platform android
49
53
  */
50
54
  elementColors?: ProgressElementColors;
55
+ /** Modifiers for the component */
56
+ modifiers?: ExpoModifier[];
51
57
  };
52
58
 
53
59
  type NativeProgressProps =
@@ -65,12 +71,24 @@ const NativeProgressView: React.ComponentType<NativeProgressProps> = requireNati
65
71
  * Renders a `CircularProgress` component.
66
72
  */
67
73
  export function CircularProgress(props: CircularProgressProps) {
68
- return <NativeProgressView {...props} variant="circular" />;
74
+ return (
75
+ <NativeProgressView
76
+ {...props} // @ts-expect-error
77
+ modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)}
78
+ variant="circular"
79
+ />
80
+ );
69
81
  }
70
82
 
71
83
  /**
72
84
  * Renders a `LinearProgress` component.
73
85
  */
74
86
  export function LinearProgress(props: LinearProgressProps) {
75
- return <NativeProgressView {...props} variant="linear" />;
87
+ return (
88
+ <NativeProgressView
89
+ {...props} // @ts-expect-error
90
+ modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)}
91
+ variant="linear"
92
+ />
93
+ );
76
94
  }
@@ -1,6 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { ViewStyle } from 'react-native';
3
3
 
4
+ import { ExpoModifier } from '../../types';
5
+
4
6
  export type ShapeProps = {
5
7
  /**
6
8
  * Corner rounding percentage. Multiplied by the shorter dimension of the view to produce pixel values.
@@ -31,6 +33,8 @@ export type ShapeProps = {
31
33
  style?: ViewStyle;
32
34
  /** Color of the shape */
33
35
  color?: string;
36
+ /** Modifiers for the component */
37
+ modifiers?: ExpoModifier[];
34
38
  };
35
39
 
36
40
  const ShapeNativeView: React.ComponentType<any> = requireNativeView('ExpoUI', 'ShapeView');
@@ -56,9 +60,20 @@ function Rectangle(props: Pick<ShapeProps, 'smoothing' | 'cornerRounding' | 'sty
56
60
  }
57
61
 
58
62
  function Polygon(
59
- props: Pick<ShapeProps, 'smoothing' | 'cornerRounding' | 'verticesCount' | 'style' | 'color'>
63
+ props: Pick<
64
+ ShapeProps,
65
+ 'smoothing' | 'cornerRounding' | 'verticesCount' | 'style' | 'color' | 'modifiers'
66
+ >
60
67
  ) {
61
- return <ShapeNativeView {...props} style={props.style} type="polygon" />;
68
+ return (
69
+ <ShapeNativeView
70
+ {...props}
71
+ // @ts-expect-error
72
+ modifiers={props.modifiers?.map((m) => m.__expo_shared_object_id__)}
73
+ style={props.style}
74
+ type="polygon"
75
+ />
76
+ );
62
77
  }
63
78
 
64
79
  export const Shape = {
@@ -1,7 +1,7 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
3
 
4
- import { ViewEvent } from '../../types';
4
+ import { ExpoModifier, ViewEvent } from '../../types';
5
5
 
6
6
  /**
7
7
  * Colors for slider's core elements.
@@ -53,6 +53,9 @@ export type SliderProps = {
53
53
  * Callback triggered on dragging along the slider.
54
54
  */
55
55
  onValueChange?: (value: number) => void;
56
+
57
+ /** Modifiers for the component */
58
+ modifiers?: ExpoModifier[];
56
59
  };
57
60
 
58
61
  type NativeSliderProps = Omit<SliderProps, 'onValueChange'> &
@@ -86,6 +89,8 @@ export function transformSliderProps(props: SliderProps): NativeSliderProps {
86
89
  }
87
90
  : undefined,
88
91
  color: props.color,
92
+ // @ts-expect-error
93
+ modifiers: props.modifiers?.map((m) => m.__expo_shared_object_id__),
89
94
  };
90
95
  }
91
96
 
@@ -1,6 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
3
3
 
4
+ import { ExpoModifier } from '../../types';
5
+
4
6
  // @docsMissing
5
7
  /**
6
8
  * Only for switch.
@@ -54,6 +56,9 @@ export type SwitchProps = {
54
56
  * Picker color. On iOS, it only applies to the `menu` variant.
55
57
  */
56
58
  color?: string;
59
+
60
+ /** Modifiers for the component */
61
+ modifiers?: ExpoModifier[];
57
62
  } & (SwitchSwitchVariantProps | SwitchCheckboxVariantProps | SwitchButtonVariantProps);
58
63
 
59
64
  export type SwitchSwitchVariantProps = {
@@ -118,6 +123,8 @@ export function transformSwitchProps(props: SwitchProps): NativeSwitchProps {
118
123
  onValueChange: ({ nativeEvent: { value } }) => {
119
124
  props?.onValueChange?.(value);
120
125
  },
126
+ // @ts-expect-error
127
+ modifiers: props.modifiers?.map((m) => m.__expo_shared_object_id__),
121
128
  } as NativeSwitchProps;
122
129
  }
123
130
 
@@ -2,7 +2,7 @@ import { requireNativeView } from 'expo';
2
2
  import { Ref } from 'react';
3
3
  import { StyleProp, ViewStyle } from 'react-native';
4
4
 
5
- import { ViewEvent } from '../../types';
5
+ import { ExpoModifier, ViewEvent } from '../../types';
6
6
 
7
7
  /**
8
8
  * @hidden Not used anywhere yet.
@@ -83,6 +83,9 @@ export type TextInputProps = {
83
83
  * @platform android
84
84
  */
85
85
  autoCapitalize?: 'characters' | 'none' | 'sentences' | 'unspecified' | 'words';
86
+
87
+ /** Modifiers for the component */
88
+ modifiers?: ExpoModifier[];
86
89
  };
87
90
 
88
91
  export type NativeTextInputProps = Omit<TextInputProps, 'onChangeText'> & {} & ViewEvent<
@@ -105,6 +108,8 @@ function transformTextInputProps(props: TextInputProps): NativeTextInputProps {
105
108
  onValueChanged: (event) => {
106
109
  props.onChangeText?.(event.nativeEvent.value);
107
110
  },
111
+ // @ts-expect-error
112
+ modifiers: props.modifiers?.map((m) => m.__expo_shared_object_id__),
108
113
  };
109
114
  }
110
115
 
@@ -8,3 +8,4 @@ export * from './Slider';
8
8
  export * from './Switch';
9
9
  export * from './TextInput';
10
10
  export * from './Shape';
11
+ export * from './modifiers';
@@ -0,0 +1,19 @@
1
+ import { requireNativeModule } from 'expo';
2
+
3
+ import { ExpoModifier } from '../types';
4
+
5
+ const nativeExpoUIModule = requireNativeModule('ExpoUI');
6
+
7
+ export const padding: (all: number) => ExpoModifier = nativeExpoUIModule.padding;
8
+ export const size: (width: number, height: number) => ExpoModifier = nativeExpoUIModule.size;
9
+ export const fillMaxSize: () => ExpoModifier = nativeExpoUIModule.fillMaxSize;
10
+ export const offset: (x: number, y: number) => ExpoModifier = nativeExpoUIModule.offset;
11
+ export const background: (color: string) => ExpoModifier = nativeExpoUIModule.background;
12
+ export const border: (borderWidth: number, borderColor: string) => ExpoModifier =
13
+ nativeExpoUIModule.border;
14
+ export const shadow: (elevation: number) => ExpoModifier = nativeExpoUIModule.shadow;
15
+ export const alpha: (alpha: number) => ExpoModifier = nativeExpoUIModule.alpha;
16
+ export const blur: (radius: number) => ExpoModifier = nativeExpoUIModule.blur;
17
+ export const clickable: (callback: () => void) => ExpoModifier = nativeExpoUIModule.clickable;
18
+ export const rotate: (degrees: number) => ExpoModifier = nativeExpoUIModule.rotate;
19
+ export const zIndex: (index: number) => ExpoModifier = nativeExpoUIModule.zIndex;
@@ -1,7 +1,8 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { Dimensions, NativeSyntheticEvent } from 'react-native';
2
+ import { NativeSyntheticEvent } 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 BottomSheetProps = {
7
8
  /**
@@ -16,7 +17,7 @@ export type BottomSheetProps = {
16
17
  * Callback function that is called when the `BottomSheet` is opened.
17
18
  */
18
19
  onIsOpenedChange: (isOpened: boolean) => void;
19
- };
20
+ } & CommonViewModifierProps;
20
21
 
21
22
  type NativeBottomSheetProps = Omit<BottomSheetProps, 'onIsOpenedChange'> & {
22
23
  onIsOpenedChange: (event: NativeSyntheticEvent<{ isOpened: boolean }>) => void;
@@ -27,28 +28,18 @@ const BottomSheetNativeView: React.ComponentType<NativeBottomSheetProps> = requi
27
28
  'BottomSheetView'
28
29
  );
29
30
 
30
- export function transformBottomSheetProps(props: BottomSheetProps): NativeBottomSheetProps {
31
+ function transformBottomSheetProps(props: BottomSheetProps): NativeBottomSheetProps {
32
+ const { modifiers, ...restProps } = props;
31
33
  return {
32
- ...props,
34
+ modifiers,
35
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
36
+ ...restProps,
33
37
  onIsOpenedChange: ({ nativeEvent: { isOpened } }) => {
34
38
  props?.onIsOpenedChange?.(isOpened);
35
39
  },
36
40
  };
37
41
  }
38
42
 
39
- /**
40
- * `<BottomSheet>` component without a host view.
41
- * You should use this with a `Host` component in ancestor.
42
- */
43
- export function BottomSheetPrimitive(props: BottomSheetProps) {
44
- return <BottomSheetNativeView {...transformBottomSheetProps(props)} />;
45
- }
46
-
47
43
  export function BottomSheet(props: BottomSheetProps) {
48
- const { width } = Dimensions.get('window');
49
- return (
50
- <Host style={{ position: 'absolute', width }}>
51
- <BottomSheetPrimitive {...props} />
52
- </Host>
53
- );
44
+ return <BottomSheetNativeView {...transformBottomSheetProps(props)} />;
54
45
  }
@@ -1,8 +1,8 @@
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
7
  /**
8
8
  * The role of the button.
@@ -76,9 +76,10 @@ export type ButtonProps = {
76
76
  * Disabled state of the button.
77
77
  */
78
78
  disabled?: boolean;
79
- };
79
+ } & CommonViewModifierProps;
80
80
 
81
81
  /**
82
+ * exposed for ContextMenu
82
83
  * @hidden
83
84
  */
84
85
  export type NativeButtonProps = Omit<
@@ -97,14 +98,17 @@ const ButtonNativeView: React.ComponentType<NativeButtonProps> = requireNativeVi
97
98
  );
98
99
 
99
100
  /**
101
+ * exposed for ContextMenu
100
102
  * @hidden
101
103
  */
102
104
  export function transformButtonProps(
103
105
  props: Omit<ButtonProps, 'children'>,
104
106
  text: string | undefined
105
107
  ): NativeButtonProps {
106
- const { role, onPress, systemImage, ...restProps } = props;
108
+ const { role, onPress, systemImage, modifiers, ...restProps } = props;
107
109
  return {
110
+ modifiers,
111
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
108
112
  ...restProps,
109
113
  text,
110
114
  systemImage,
@@ -114,10 +118,9 @@ export function transformButtonProps(
114
118
  }
115
119
 
116
120
  /**
117
- * `<Button>` component without a host view.
118
- * You should use this with a `Host` component in ancestor.
121
+ * Displays a native button component.
119
122
  */
120
- export function ButtonPrimitive(props: ButtonProps) {
123
+ export function Button(props: ButtonProps) {
121
124
  const { children, ...restProps } = props;
122
125
 
123
126
  if (!children && !restProps.systemImage) {
@@ -136,15 +139,3 @@ export function ButtonPrimitive(props: ButtonProps) {
136
139
  }
137
140
  return <ButtonNativeView {...transformedProps}>{children}</ButtonNativeView>;
138
141
  }
139
-
140
- /**
141
- * Displays a native button component.
142
- */
143
- export function Button(props: ButtonProps & { style?: StyleProp<ViewStyle> }) {
144
- const useViewportSizeMeasurement = props.style == null;
145
- return (
146
- <Host style={props.style} matchContents useViewportSizeMeasurement={useViewportSizeMeasurement}>
147
- <ButtonPrimitive {...props} />
148
- </Host>
149
- );
150
- }
@@ -1,8 +1,9 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { useCallback } from 'react';
3
- import { NativeSyntheticEvent, processColor, StyleProp, ViewStyle } from 'react-native';
3
+ import { NativeSyntheticEvent, processColor } from 'react-native';
4
4
 
5
- import { Host } from '../Host';
5
+ import { createViewModifierEventListener } from '../modifiers/utils';
6
+ import { type CommonViewModifierProps } from '../types';
6
7
 
7
8
  export type ColorPickerProps = {
8
9
  /**
@@ -21,7 +22,7 @@ export type ColorPickerProps = {
21
22
  * Whether the color picker should support opacity.
22
23
  */
23
24
  supportsOpacity?: boolean;
24
- };
25
+ } & CommonViewModifierProps;
25
26
 
26
27
  type OnValueChangedEvent = NativeSyntheticEvent<{ value: string }>;
27
28
 
@@ -33,12 +34,13 @@ const ColorPickerNativeView: React.ComponentType<
33
34
  > = requireNativeView('ExpoUI', 'ColorPickerView');
34
35
 
35
36
  /**
36
- * `<ColorPicker>` component without a host view.
37
- * You should use this with a `Host` component in ancestor.
37
+ * Renders a `ColorPicker` component using SwiftUI.
38
+ * @platform ios
38
39
  */
39
- export function ColorPickerPrimitive({
40
+ export function ColorPicker({
40
41
  selection,
41
42
  onValueChanged,
43
+ modifiers,
42
44
  ...restProps
43
45
  }: ColorPickerProps) {
44
46
  const onNativeValueChanged = useCallback(
@@ -49,21 +51,11 @@ export function ColorPickerPrimitive({
49
51
  );
50
52
  return (
51
53
  <ColorPickerNativeView
54
+ modifiers={modifiers}
55
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
52
56
  selection={processColor(selection || '')}
53
57
  onValueChanged={onNativeValueChanged}
54
58
  {...restProps}
55
59
  />
56
60
  );
57
61
  }
58
-
59
- /**
60
- * Renders a `ColorPicker` component using SwiftUI.
61
- * @platform ios
62
- */
63
- export function ColorPicker(props: ColorPickerProps & { style?: StyleProp<ViewStyle> }) {
64
- return (
65
- <Host style={props.style} matchContents>
66
- <ColorPickerPrimitive {...props} />
67
- </Host>
68
- );
69
- }
@@ -1,7 +1,7 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { Platform } from 'react-native';
3
2
 
4
- import { CommonViewModifierProps } from './types';
3
+ import { createViewModifierEventListener } from '../modifiers/utils';
4
+ import { type CommonViewModifierProps } from '../types';
5
5
 
6
6
  export interface ContentUnavailableViewProps extends CommonViewModifierProps {
7
7
  /**
@@ -20,17 +20,24 @@ export interface ContentUnavailableViewProps extends CommonViewModifierProps {
20
20
  description?: string;
21
21
  }
22
22
 
23
- const ContentUnavailableViewNativeView: React.ComponentType<ContentUnavailableViewProps> | null =
24
- Platform.OS === 'ios' ? requireNativeView('ExpoUI', 'ContentUnavailableView') : null;
23
+ const ContentUnavailableViewNativeView: React.ComponentType<ContentUnavailableViewProps> =
24
+ requireNativeView('ExpoUI', 'ContentUnavailableView');
25
25
 
26
26
  /**
27
27
  * Displays a native Swift UI ContentUnavailableView.
28
28
  * @platform ios 17.0+
29
- *
30
29
  */
30
+ function transformContentUnavailableViewProps(
31
+ props: ContentUnavailableViewProps
32
+ ): ContentUnavailableViewProps {
33
+ const { modifiers, ...restProps } = props;
34
+ return {
35
+ modifiers,
36
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
37
+ ...restProps,
38
+ };
39
+ }
40
+
31
41
  export function ContentUnavailableView(props: ContentUnavailableViewProps) {
32
- if (!ContentUnavailableViewNativeView) {
33
- return null;
34
- }
35
- return <ContentUnavailableViewNativeView {...props} />;
42
+ return <ContentUnavailableViewNativeView {...transformContentUnavailableViewProps(props)} />;
36
43
  }
@@ -0,0 +1,25 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+
3
+ import { type ButtonProps } from '../Button';
4
+
5
+ /**
6
+ * Props of the `Submenu` component.
7
+ */
8
+ export type SubmenuProps = {
9
+ /**
10
+ * The button that will be used to expand the submenu. On Android the `text` prop of the `Button` will be used as a section title.
11
+ */
12
+ button: ReactElement<ButtonProps>;
13
+ /**
14
+ * Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
15
+ */
16
+ children: ReactNode;
17
+ };
18
+
19
+ /**
20
+ * The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
21
+ * Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
22
+ */
23
+ export function Submenu(props: SubmenuProps) {
24
+ return <></>;
25
+ }
@@ -1,12 +1,16 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { ComponentType, Children, ReactElement, ReactNode, useMemo } from 'react';
3
- import { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
2
+ import { ComponentType, Children, useMemo } from 'react';
3
+ import { NativeSyntheticEvent } from 'react-native';
4
4
 
5
- import { Host } from '../Host';
5
+ import { type ContextMenuProps, type EventHandlers } from './types';
6
6
  import { MenuElement, transformChildrenToElementArray } from './utils';
7
- import { ButtonProps } from '../Button';
8
- import { PickerProps } from '../Picker';
9
- import { SwitchProps } from '../Switch';
7
+
8
+ export * from './Submenu';
9
+ export {
10
+ type ActivationMethod,
11
+ type ContextMenuProps,
12
+ type ContextMenuContentProps,
13
+ } from './types';
10
14
 
11
15
  const MenuNativeView: ComponentType<NativeMenuProps> = requireNativeView('ExpoUI', 'ContextMenu');
12
16
 
@@ -20,70 +24,7 @@ const MenuNativePreviewView: ComponentType<object> = requireNativeView(
20
24
  'ContextMenuPreview'
21
25
  );
22
26
 
23
- type SubmenuElement =
24
- | ReactElement<ButtonProps>
25
- | ReactElement<SwitchProps>
26
- | ReactElement<PickerProps>
27
- | ReactElement<SubmenuProps>;
28
-
29
- export type ContextMenuContentProps = {
30
- children: SubmenuElement | SubmenuElement[];
31
- };
32
-
33
- /**
34
- * @hidden
35
- */
36
- export type EventHandlers = Record<
37
- string,
38
- Record<string, (event: NativeSyntheticEvent<any>) => void>
39
- >;
40
-
41
- /**
42
- * @hidden
43
- */
44
- export type ContextMenuElementBase = { contextMenuElementID: string };
45
-
46
- /**
47
- * Activation method of the context menu.
48
- * - `singlePress`: The context menu is opened with a single tap. Does not isolate the content.
49
- * - `longPress`: The context menu is opened with a long press. On iOS additionally Highlights the content by blurring the background.
50
- */
51
- export type ActivationMethod = 'singlePress' | 'longPress';
52
-
53
- /**
54
- * Props of the `ContextMenu` component.
55
- */
56
- export type ContextMenuProps = {
57
- /**
58
- * Determines how the context menu will be activated.
59
- */
60
- activationMethod?: ActivationMethod;
61
-
62
- /**
63
- * The contents of the submenu are used as an anchor for the context menu.
64
- * The children will be wrapped in a pressable element, which triggers opening of the context menu.
65
- */
66
- children: ReactNode;
67
- };
68
-
69
- /**
70
- * Props of the `Submenu` component.
71
- */
72
- export type SubmenuProps = {
73
- /**
74
- * The button that will be used to expand the submenu. On Android the `text` prop of the `Button` will be used as a section title.
75
- */
76
- button: ReactElement<ButtonProps>;
77
- /**
78
- * Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
79
- */
80
- children: ReactNode;
81
- };
82
-
83
- /**
84
- * @hidden
85
- */
86
- export type NativeMenuProps = ContextMenuProps & {
27
+ type NativeMenuProps = ContextMenuProps & {
87
28
  elements: MenuElement[];
88
29
  onContextMenuButtonPressed: (
89
30
  event: NativeSyntheticEvent<{ contextMenuElementID: string }>
@@ -103,14 +44,6 @@ export type NativeMenuProps = ContextMenuProps & {
103
44
  ) => void;
104
45
  };
105
46
 
106
- /**
107
- * The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
108
- * Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
109
- */
110
- export function Submenu(props: SubmenuProps) {
111
- return <></>;
112
- }
113
-
114
47
  /**
115
48
  * Items visible inside the context menu. Pass input components as immidiate children of the tag.
116
49
  * `Button`, `Switch` and `Submenu` components are supported on both Android and iOS.
@@ -140,7 +73,17 @@ export function Preview(props: { children: React.ReactNode }) {
140
73
  * `<ContextMenu>` component without a host view.
141
74
  * You should use this with a `Host` component in ancestor.
142
75
  */
143
- function ContextMenuPrimitive(props: ContextMenuProps) {
76
+
77
+ /**
78
+ * `ContextMenu` allows you to create a context menu, which can be used to provide additional options to the user.
79
+ *
80
+ * There are some platform-specific differences in the behavior of the context menu:
81
+ * - On Android, the expansion of the context menu is controlled by the `expanded` prop. iOS, does not allow for manual control of the expansion state.
82
+ * - On iOS, the context menu can be triggered by a single press or a long press. The `activationMethod` prop allows you to choose between these two options.
83
+ * - Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple sections. The `title` prop of the `Button`, which opens the submenu on iOS will be used as a section title.
84
+ * - Android does not support showing a `Picker` element in the context menu.
85
+ */
86
+ function ContextMenu(props: ContextMenuProps) {
144
87
  const eventHandlersMap: EventHandlers = {};
145
88
  const initialChildren = Children.map(
146
89
  props.children as any,
@@ -169,28 +112,8 @@ function ContextMenuPrimitive(props: ContextMenuProps) {
169
112
  );
170
113
  }
171
114
 
172
- /**
173
- * `ContextMenuPrimitive` allows you to create a context menu, which can be used to provide additional options to the user.
174
- *
175
- * There are some platform-specific differences in the behavior of the context menu:
176
- * - On Android, the expansion of the context menu is controlled by the `expanded` prop. iOS, does not allow for manual control of the expansion state.
177
- * - On iOS, the context menu can be triggered by a single press or a long press. The `activationMethod` prop allows you to choose between these two options.
178
- * - Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple sections. The `title` prop of the `Button`, which opens the submenu on iOS will be used as a section title.
179
- * - Android does not support showing a `Picker` element in the context menu.
180
- */
181
- function ContextMenu(props: ContextMenuProps & { style?: StyleProp<ViewStyle> }) {
182
- return (
183
- <Host style={props.style} matchContents>
184
- <ContextMenuPrimitive {...props} />
185
- </Host>
186
- );
187
- }
188
-
189
- ContextMenuPrimitive.Trigger = Trigger;
190
- ContextMenuPrimitive.Preview = Preview;
191
- ContextMenuPrimitive.Items = Items;
192
115
  ContextMenu.Trigger = Trigger;
193
116
  ContextMenu.Preview = Preview;
194
117
  ContextMenu.Items = Items;
195
118
 
196
- export { ContextMenuPrimitive, ContextMenu };
119
+ export { ContextMenu };
@@ -0,0 +1,47 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { NativeSyntheticEvent } from 'react-native';
3
+
4
+ import { type ButtonProps } from '../Button';
5
+ import { type PickerProps } from '../Picker';
6
+ import { type SwitchProps } from '../Switch';
7
+ import { type SubmenuProps } from './Submenu';
8
+
9
+ export type EventHandlers = Record<
10
+ string,
11
+ Record<string, (event: NativeSyntheticEvent<any>) => void>
12
+ >;
13
+
14
+ export type ContextMenuElementBase = { contextMenuElementID: string };
15
+
16
+ type SubmenuElement =
17
+ | ReactElement<ButtonProps>
18
+ | ReactElement<SwitchProps>
19
+ | ReactElement<PickerProps>
20
+ | ReactElement<SubmenuProps>;
21
+
22
+ export type ContextMenuContentProps = {
23
+ children: SubmenuElement | SubmenuElement[];
24
+ };
25
+
26
+ /**
27
+ * Activation method of the context menu.
28
+ * - `singlePress`: The context menu is opened with a single tap. Does not isolate the content.
29
+ * - `longPress`: The context menu is opened with a long press. On iOS additionally Highlights the content by blurring the background.
30
+ */
31
+ export type ActivationMethod = 'singlePress' | 'longPress';
32
+
33
+ /**
34
+ * Props of the `ContextMenu` component.
35
+ */
36
+ export type ContextMenuProps = {
37
+ /**
38
+ * Determines how the context menu will be activated.
39
+ */
40
+ activationMethod?: ActivationMethod;
41
+
42
+ /**
43
+ * The contents of the submenu are used as an anchor for the context menu.
44
+ * The children will be wrapped in a pressable element, which triggers opening of the context menu.
45
+ */
46
+ children: ReactNode;
47
+ };