@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
@@ -0,0 +1,36 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { NativeSyntheticEvent } from 'react-native';
3
+ import { type ButtonProps } from '../Button';
4
+ import { type PickerProps } from '../Picker';
5
+ import { type SwitchProps } from '../Switch';
6
+ import { type SubmenuProps } from './Submenu';
7
+ export type EventHandlers = Record<string, Record<string, (event: NativeSyntheticEvent<any>) => void>>;
8
+ export type ContextMenuElementBase = {
9
+ contextMenuElementID: string;
10
+ };
11
+ type SubmenuElement = ReactElement<ButtonProps> | ReactElement<SwitchProps> | ReactElement<PickerProps> | ReactElement<SubmenuProps>;
12
+ export type ContextMenuContentProps = {
13
+ children: SubmenuElement | SubmenuElement[];
14
+ };
15
+ /**
16
+ * Activation method of the context menu.
17
+ * - `singlePress`: The context menu is opened with a single tap. Does not isolate the content.
18
+ * - `longPress`: The context menu is opened with a long press. On iOS additionally Highlights the content by blurring the background.
19
+ */
20
+ export type ActivationMethod = 'singlePress' | 'longPress';
21
+ /**
22
+ * Props of the `ContextMenu` component.
23
+ */
24
+ export type ContextMenuProps = {
25
+ /**
26
+ * Determines how the context menu will be activated.
27
+ */
28
+ activationMethod?: ActivationMethod;
29
+ /**
30
+ * The contents of the submenu are used as an anchor for the context menu.
31
+ * The children will be wrapped in a pressable element, which triggers opening of the context menu.
32
+ */
33
+ children: ReactNode;
34
+ };
35
+ export {};
36
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAC3D,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,KAAK,cAAc,GACf,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,WAAW,CAAC,GACzB,YAAY,CAAC,YAAY,CAAC,CAAC;AAE/B,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,cAAc,GAAG,cAAc,EAAE,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,WAAW,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, ReactNode } from 'react';\nimport { NativeSyntheticEvent } from 'react-native';\n\nimport { type ButtonProps } from '../Button';\nimport { type PickerProps } from '../Picker';\nimport { type SwitchProps } from '../Switch';\nimport { type SubmenuProps } from './Submenu';\n\nexport type EventHandlers = Record<\n string,\n Record<string, (event: NativeSyntheticEvent<any>) => void>\n>;\n\nexport type ContextMenuElementBase = { contextMenuElementID: string };\n\ntype SubmenuElement =\n | ReactElement<ButtonProps>\n | ReactElement<SwitchProps>\n | ReactElement<PickerProps>\n | ReactElement<SubmenuProps>;\n\nexport type ContextMenuContentProps = {\n children: SubmenuElement | SubmenuElement[];\n};\n\n/**\n * Activation method of the context menu.\n * - `singlePress`: The context menu is opened with a single tap. Does not isolate the content.\n * - `longPress`: The context menu is opened with a long press. On iOS additionally Highlights the content by blurring the background.\n */\nexport type ActivationMethod = 'singlePress' | 'longPress';\n\n/**\n * Props of the `ContextMenu` component.\n */\nexport type ContextMenuProps = {\n /**\n * Determines how the context menu will be activated.\n */\n activationMethod?: ActivationMethod;\n\n /**\n * The contents of the submenu are used as an anchor for the context menu.\n * The children will be wrapped in a pressable element, which triggers opening of the context menu.\n */\n children: ReactNode;\n};\n"]}
@@ -1,8 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
- import { ContextMenuElementBase, EventHandlers } from './index';
3
- import { NativeButtonProps } from '../Button';
4
- import { PickerProps } from '../Picker';
5
- import { SwitchProps } from '../Switch';
2
+ import { type ContextMenuElementBase, type EventHandlers } from './types';
3
+ import { type NativeButtonProps } from '../Button';
4
+ import { type PickerProps } from '../Picker';
5
+ import { type SwitchProps } from '../Switch';
6
6
  type ButtonMenuElement = {
7
7
  button: NativeButtonProps;
8
8
  } & ContextMenuElementBase;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,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iBAAiB,GAAG;IACvB,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG,sBAAsB,CAAC;AAE3B,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,WAAW,CAAC;CACrB,GAAG,sBAAsB,CAAC;AAE3B,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,WAAW,CAAC;CACrB,GAAG,sBAAsB,CAAC;AAE3B,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE;QACP,QAAQ,EAAE,WAAW,EAAE,CAAC;QACxB,MAAM,EAAE,iBAAiB,CAAC;KAC3B,CAAC;CACH,GAAG,sBAAsB,CAAC;AAE3B,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,cAAc,CAAC;AAInB,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,SAAS,EACnB,gBAAgB,EAAE,aAAa,GAC9B,WAAW,EAAE,CAIf"}
@@ -1,8 +1,8 @@
1
1
  import { Children, isValidElement } from 'react';
2
- import { Submenu } from './index';
3
- import { Button, ButtonPrimitive, transformButtonProps, } from '../Button';
4
- import { Picker, PickerPrimitive } from '../Picker';
5
- import { Switch, SwitchPrimitive } from '../Switch';
2
+ import { Button, transformButtonProps } from '../Button';
3
+ import { Picker } from '../Picker';
4
+ import { Switch } from '../Switch';
5
+ import { Submenu } from './Submenu';
6
6
  // Maps the react children to NativeMenuElement[] which is used to render out the native menu
7
7
  // TODO: Ideally we want to pass the children directly to the native side without having to do this
8
8
  export function transformChildrenToElementArray(children, eventHandlersMap) {
@@ -14,15 +14,15 @@ function processChildElement(child, eventHandlersMap) {
14
14
  if (!isValidElement(child))
15
15
  return null;
16
16
  const uuid = expo.uuidv4();
17
- if (child.type === Button || child.type === ButtonPrimitive) {
17
+ if (child.type === Button) {
18
18
  // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
19
19
  return createButtonElement(uuid, child.props, eventHandlersMap);
20
20
  }
21
- if (child.type === Switch || child.type === SwitchPrimitive) {
21
+ if (child.type === Switch) {
22
22
  // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
23
23
  return createSwitchElement(uuid, child.props, eventHandlersMap);
24
24
  }
25
- if (child.type === Picker || child.type === PickerPrimitive) {
25
+ if (child.type === Picker) {
26
26
  // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps
27
27
  return createPickerElement(uuid, child.props, eventHandlersMap);
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAA2B,MAAM,OAAO,CAAC;AAG1E,OAAO,EAAyC,OAAO,EAAgB,MAAM,SAAS,CAAC;AACvF,OAAO,EACL,MAAM,EACN,eAAe,EAGf,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,EAAE,eAAe,EAAe,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAe,MAAM,WAAW,CAAC;AA4BjE,6FAA6F;AAC7F,mGAAmG;AACnG,MAAM,UAAU,+BAA+B,CAC7C,QAAmB,EACnB,gBAA+B;IAE/B,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;SAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;SAC5D,MAAM,CAAC,CAAC,EAAE,EAAqB,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,mBAAmB,CAC1B,KAAgB,EAChB,gBAA+B;IAE/B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAExC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAE3B,IAAI,KAAK,CAAC,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;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAmB;IAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC;AACtD,CAAC","sourcesContent":["import { Children, isValidElement, ReactElement, ReactNode } from 'react';\nimport { NativeSyntheticEvent } from 'react-native';\n\nimport { ContextMenuElementBase, EventHandlers, Submenu, SubmenuProps } from './index';\nimport {\n Button,\n ButtonPrimitive,\n ButtonProps,\n NativeButtonProps,\n transformButtonProps,\n} from '../Button';\nimport { Picker, PickerPrimitive, PickerProps } from '../Picker';\nimport { Switch, SwitchPrimitive, SwitchProps } from '../Switch';\n\n// We use this slightly odd typing for the elements to make unpacking the elements easier on the native side\ntype ButtonMenuElement = {\n button: NativeButtonProps;\n} & ContextMenuElementBase;\n\ntype SwitchMenuElement = {\n switch: SwitchProps;\n} & ContextMenuElementBase;\n\ntype PickerMenuElement = {\n picker: PickerProps;\n} & ContextMenuElementBase;\n\ntype SubmenuElement = {\n submenu: {\n elements: MenuElement[];\n button: NativeButtonProps;\n };\n} & ContextMenuElementBase;\n\nexport type MenuElement =\n | ButtonMenuElement\n | SwitchMenuElement\n | PickerMenuElement\n | SubmenuElement;\n\n// Maps the react children to NativeMenuElement[] which is used to render out the native menu\n// TODO: Ideally we want to pass the children directly to the native side without having to do this\nexport function transformChildrenToElementArray(\n children: ReactNode,\n eventHandlersMap: EventHandlers\n): MenuElement[] {\n return Children.toArray(children)\n .map((child) => processChildElement(child, eventHandlersMap))\n .filter((el): el is MenuElement => el !== null);\n}\n\nfunction processChildElement(\n child: ReactNode,\n eventHandlersMap: EventHandlers\n): MenuElement | null {\n if (!isValidElement(child)) return null;\n\n const uuid = expo.uuidv4();\n\n if (child.type === Button || child.type === ButtonPrimitive) {\n // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps\n return createButtonElement(uuid, child.props, eventHandlersMap);\n }\n\n if (child.type === Switch || child.type === SwitchPrimitive) {\n // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps\n return createSwitchElement(uuid, child.props, eventHandlersMap);\n }\n\n if (child.type === Picker || child.type === PickerPrimitive) {\n // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps\n return createPickerElement(uuid, child.props, eventHandlersMap);\n }\n\n if (isSubmenuComponent(child)) {\n // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps\n return createSubmenuElement(uuid, child.props, eventHandlersMap);\n }\n\n console.warn('Unsupported child type in Menu: ', child.type);\n return null;\n}\n\nfunction createButtonElement(\n uuid: string,\n props: ButtonProps,\n handlers: EventHandlers\n): MenuElement {\n if (props.onPress) {\n handlers[uuid] = { onPress: props.onPress };\n }\n if (typeof props.children !== 'string') {\n throw new Error('ContextMenu Button only supports string children');\n }\n return {\n contextMenuElementID: uuid,\n button: transformButtonProps(props, props.children),\n };\n}\n\nfunction createSwitchElement(\n uuid: string,\n props: SwitchProps,\n handlers: EventHandlers\n): MenuElement {\n if (props.onValueChange) {\n handlers[uuid] = {\n onValueChange: ({ nativeEvent: { value } }: NativeSyntheticEvent<{ value: boolean }>) => {\n props.onValueChange?.(value);\n },\n };\n }\n\n return {\n contextMenuElementID: uuid,\n switch: props,\n };\n}\n\nfunction createPickerElement(\n uuid: string,\n props: PickerProps,\n handlers: EventHandlers\n): MenuElement {\n if (props.onOptionSelected) {\n handlers[uuid] = { onOptionSelected: props.onOptionSelected };\n }\n\n return {\n contextMenuElementID: uuid,\n picker: props,\n };\n}\n\nfunction createSubmenuElement(\n uuid: string,\n props: SubmenuProps,\n handlers: EventHandlers\n): MenuElement {\n if (typeof props.button.props.children !== 'string') {\n throw new Error('ContextMenu Submenu Button only supports string children');\n }\n return {\n contextMenuElementID: uuid,\n submenu: {\n button: transformButtonProps(props.button.props, props.button.props.children),\n elements: transformChildrenToElementArray(props.children, handlers),\n },\n };\n}\n\nfunction isSubmenuComponent(child: ReactElement): boolean {\n return child.type.toString() === Submenu.toString();\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/swift-ui/ContextMenu/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAA2B,MAAM,OAAO,CAAC;AAI1E,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAA4C,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,MAAM,EAAoB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,MAAM,EAAoB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,EAAqB,MAAM,WAAW,CAAC;AA4BvD,6FAA6F;AAC7F,mGAAmG;AACnG,MAAM,UAAU,+BAA+B,CAC7C,QAAmB,EACnB,gBAA+B;IAE/B,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;SAC9B,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;SAC5D,MAAM,CAAC,CAAC,EAAE,EAAqB,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,mBAAmB,CAC1B,KAAgB,EAChB,gBAA+B;IAE/B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAExC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAE3B,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,6GAA6G;QAC7G,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,6GAA6G;QAC7G,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAClE,CAAC;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AAI;QAC1B,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,IAAY,EACZ,KAAkB,EAClB,QAAuB;IAEvB,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAC3B,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAChE,CAAC;IAED,OAAO;QACL,oBAAoB,EAAE,IAAI;QAC1B,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAC3B,IAAY,EACZ,KAAmB,EACnB,QAAuB;IAEvB,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO;QACL,oBAAoB,EAAE,IAAI;QAC1B,OAAO,EAAE;YACP,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC7E,QAAQ,EAAE,+BAA+B,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC;SACpE;KACF,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAmB;IAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC;AACtD,CAAC","sourcesContent":["import { Children, isValidElement, ReactElement, ReactNode } from 'react';\nimport { NativeSyntheticEvent } from 'react-native';\n\nimport { type ContextMenuElementBase, type EventHandlers } from './types';\nimport { Button, transformButtonProps, type ButtonProps, type NativeButtonProps } from '../Button';\nimport { Picker, type PickerProps } from '../Picker';\nimport { Switch, type SwitchProps } from '../Switch';\nimport { Submenu, type SubmenuProps } from './Submenu';\n\n// We use this slightly odd typing for the elements to make unpacking the elements easier on the native side\ntype ButtonMenuElement = {\n button: NativeButtonProps;\n} & ContextMenuElementBase;\n\ntype SwitchMenuElement = {\n switch: SwitchProps;\n} & ContextMenuElementBase;\n\ntype PickerMenuElement = {\n picker: PickerProps;\n} & ContextMenuElementBase;\n\ntype SubmenuElement = {\n submenu: {\n elements: MenuElement[];\n button: NativeButtonProps;\n };\n} & ContextMenuElementBase;\n\nexport type MenuElement =\n | ButtonMenuElement\n | SwitchMenuElement\n | PickerMenuElement\n | SubmenuElement;\n\n// Maps the react children to NativeMenuElement[] which is used to render out the native menu\n// TODO: Ideally we want to pass the children directly to the native side without having to do this\nexport function transformChildrenToElementArray(\n children: ReactNode,\n eventHandlersMap: EventHandlers\n): MenuElement[] {\n return Children.toArray(children)\n .map((child) => processChildElement(child, eventHandlersMap))\n .filter((el): el is MenuElement => el !== null);\n}\n\nfunction processChildElement(\n child: ReactNode,\n eventHandlersMap: EventHandlers\n): MenuElement | null {\n if (!isValidElement(child)) return null;\n\n const uuid = expo.uuidv4();\n\n if (child.type === Button) {\n // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps\n return createButtonElement(uuid, child.props, eventHandlersMap);\n }\n\n if (child.type === Switch) {\n // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps\n return createSwitchElement(uuid, child.props, eventHandlersMap);\n }\n\n if (child.type === Picker) {\n // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps\n return createPickerElement(uuid, child.props, eventHandlersMap);\n }\n\n if (isSubmenuComponent(child)) {\n // @ts-expect-error TODO TS2345: Argument of type unknown is not assignable to parameter of type SubmenuProps\n return createSubmenuElement(uuid, child.props, eventHandlersMap);\n }\n\n console.warn('Unsupported child type in Menu: ', child.type);\n return null;\n}\n\nfunction createButtonElement(\n uuid: string,\n props: ButtonProps,\n handlers: EventHandlers\n): MenuElement {\n if (props.onPress) {\n handlers[uuid] = { onPress: props.onPress };\n }\n if (typeof props.children !== 'string') {\n throw new Error('ContextMenu Button only supports string children');\n }\n return {\n contextMenuElementID: uuid,\n button: transformButtonProps(props, props.children),\n };\n}\n\nfunction createSwitchElement(\n uuid: string,\n props: SwitchProps,\n handlers: EventHandlers\n): MenuElement {\n if (props.onValueChange) {\n handlers[uuid] = {\n onValueChange: ({ nativeEvent: { value } }: NativeSyntheticEvent<{ value: boolean }>) => {\n props.onValueChange?.(value);\n },\n };\n }\n\n return {\n contextMenuElementID: uuid,\n switch: props,\n };\n}\n\nfunction createPickerElement(\n uuid: string,\n props: PickerProps,\n handlers: EventHandlers\n): MenuElement {\n if (props.onOptionSelected) {\n handlers[uuid] = { onOptionSelected: props.onOptionSelected };\n }\n\n return {\n contextMenuElementID: uuid,\n picker: props,\n };\n}\n\nfunction createSubmenuElement(\n uuid: string,\n props: SubmenuProps,\n handlers: EventHandlers\n): MenuElement {\n if (typeof props.button.props.children !== 'string') {\n throw new Error('ContextMenu Submenu Button only supports string children');\n }\n return {\n contextMenuElementID: uuid,\n submenu: {\n button: transformButtonProps(props.button.props, props.button.props.children),\n elements: transformChildrenToElementArray(props.children, handlers),\n },\n };\n}\n\nfunction isSubmenuComponent(child: ReactElement): boolean {\n return child.type.toString() === Submenu.toString();\n}\n"]}
@@ -1,5 +1,4 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
2
- import { ViewEvent } from '../../types';
1
+ import { type CommonViewModifierProps } from '../types';
3
2
  export type IOSVariant = 'wheel' | 'automatic' | 'graphical' | 'compact';
4
3
  export type DisplayedComponents = 'date' | 'hourAndMinute' | 'dateAndTime';
5
4
  export type DateTimePickerProps = {
@@ -31,26 +30,9 @@ export type DateTimePickerProps = {
31
30
  * The tint color to use on the picker elements.
32
31
  */
33
32
  color?: string;
34
- };
35
- type NativeDatePickerProps = Omit<DateTimePickerProps, 'variant' | 'onDateSelected'> & {
36
- variant?: IOSVariant;
37
- } & ViewEvent<'onDateSelected', {
38
- date: Date;
39
- }>;
40
- /**
41
- * @hidden
42
- */
43
- export declare function transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePickerProps;
44
- /**
45
- * `<DateTimePicker>` component without a host view.
46
- * You should use this with a `Host` component in ancestor.
47
- */
48
- export declare function DateTimePickerPrimitive(props: DateTimePickerProps): import("react").JSX.Element;
33
+ } & CommonViewModifierProps;
49
34
  /**
50
35
  * Renders a `DateTimePicker` component.
51
36
  */
52
- export declare function DateTimePicker(props: DateTimePickerProps & {
53
- style?: StyleProp<ViewStyle>;
54
- }): import("react").JSX.Element;
55
- export {};
37
+ export declare function DateTimePicker(props: DateTimePickerProps): import("react").JSX.Element;
56
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/DatePicker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAA0B,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,eAAe,GAAG,aAAa,CAAC;AAE3E,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,qBAAqB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,gBAAgB,CAAC,GAAG;IACrF,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB,GAAG,SAAS,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AAEhD;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,mBAAmB,GAAG,qBAAqB,CAS9F;AAuBD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,mBAAmB,+BAEjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,+BAO3F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/DatePicker/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,eAAe,GAAG,aAAa,CAAC;AAE3E,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,uBAAuB,CAAC;AAwB5B;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,+BAExD"}
@@ -1,12 +1,10 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { StyleSheet, PixelRatio } from 'react-native';
3
- import { Host } from '../Host';
4
- /**
5
- * @hidden
6
- */
7
- export function transformDateTimePickerProps(props) {
8
- const { variant, ...rest } = props;
2
+ import { createViewModifierEventListener } from '../modifiers/utils';
3
+ function transformDateTimePickerProps(props) {
4
+ const { variant, modifiers, ...rest } = props;
9
5
  return {
6
+ modifiers,
7
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
10
8
  ...rest,
11
9
  onDateSelected: ({ nativeEvent: { date } }) => {
12
10
  props?.onDateSelected?.(new Date(date));
@@ -14,31 +12,11 @@ export function transformDateTimePickerProps(props) {
14
12
  variant,
15
13
  };
16
14
  }
17
- function transformDateTimePickerStyle(style) {
18
- const { minWidth, minHeight, ...restStyle } = StyleSheet.flatten(style) || {};
19
- // On Android, the picker’s minWidth and minHeight must be 12dp.
20
- // Otherwise, the picker will crash the app.
21
- const minSize = PixelRatio.getPixelSizeForLayoutSize(12);
22
- // However, when users pass the minWidth and minHeight props, we trust that they know what they are doing.
23
- const parsedMinWidth = minWidth ? minSize : undefined;
24
- const parsedMinHeight = minHeight ? minSize : undefined;
25
- return [restStyle, { minWidth: parsedMinWidth, minHeight: parsedMinHeight }];
26
- }
27
15
  const DatePickerNativeView = requireNativeView('ExpoUI', 'DateTimePickerView');
28
- /**
29
- * `<DateTimePicker>` component without a host view.
30
- * You should use this with a `Host` component in ancestor.
31
- */
32
- export function DateTimePickerPrimitive(props) {
33
- return <DatePickerNativeView {...transformDateTimePickerProps(props)}/>;
34
- }
35
16
  /**
36
17
  * Renders a `DateTimePicker` component.
37
18
  */
38
19
  export function DateTimePicker(props) {
39
- const transformedStyle = transformDateTimePickerStyle(props.style);
40
- return (<Host style={transformedStyle} matchContents>
41
- <DateTimePickerPrimitive {...props}/>
42
- </Host>);
20
+ return <DatePickerNativeView {...transformDateTimePickerProps(props)}/>;
43
21
  }
44
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceR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CAAC,KAA0B;IAChE,OAAO,CAAC,oBAAoB,CAAC,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC3E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAA6D;IAC1F,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnE,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAC1C;MAAA,CAAC,uBAAuB,CAAC,IAAI,KAAK,CAAC,EACrC;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { StyleProp, ViewStyle, StyleSheet, PixelRatio } from 'react-native';\n\nimport { ViewEvent } from '../../types';\nimport { Host } from '../Host';\n\nexport type IOSVariant = 'wheel' | 'automatic' | 'graphical' | 'compact';\n\nexport type DisplayedComponents = 'date' | 'hourAndMinute' | 'dateAndTime';\n\nexport type DateTimePickerProps = {\n /**\n * The initial date to display on the picker.\n */\n initialDate?: string | null;\n /**\n * A title displayed on the picker on iOS.\n * @platform ios\n */\n title?: string;\n /**\n * Callback function that is called when a date is selected.\n */\n onDateSelected?: (date: Date) => void;\n /**\n * The variant of the picker, which determines its appearance and behavior.\n * @default 'automatic'\n */\n variant?: IOSVariant;\n /**\n * The components that the picker should display.\n * On iOS, you can have a picker that selects both date and time.\n * @default 'date'\n */\n displayedComponents?: DisplayedComponents;\n /**\n * The tint color to use on the picker elements.\n */\n color?: string;\n};\n\ntype NativeDatePickerProps = Omit<DateTimePickerProps, 'variant' | 'onDateSelected'> & {\n variant?: IOSVariant;\n} & ViewEvent<'onDateSelected', { date: Date }>;\n\n/**\n * @hidden\n */\nexport function transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePickerProps {\n const { variant, ...rest } = props;\n return {\n ...rest,\n onDateSelected: ({ nativeEvent: { date } }) => {\n props?.onDateSelected?.(new Date(date));\n },\n variant,\n };\n}\n\nfunction transformDateTimePickerStyle(\n style: StyleProp<ViewStyle> | undefined\n): StyleProp<ViewStyle> {\n const { minWidth, minHeight, ...restStyle } = StyleSheet.flatten(style) || {};\n\n // On Android, the picker’s minWidth and minHeight must be 12dp.\n // Otherwise, the picker will crash the app.\n const minSize = PixelRatio.getPixelSizeForLayoutSize(12);\n\n // However, when users pass the minWidth and minHeight props, we trust that they know what they are doing.\n const parsedMinWidth = minWidth ? minSize : undefined;\n const parsedMinHeight = minHeight ? minSize : undefined;\n\n return [restStyle, { minWidth: parsedMinWidth, minHeight: parsedMinHeight }];\n}\n\nconst DatePickerNativeView: React.ComponentType<NativeDatePickerProps> = requireNativeView(\n 'ExpoUI',\n 'DateTimePickerView'\n);\n\n/**\n * `<DateTimePicker>` component without a host view.\n * You should use this with a `Host` component in ancestor.\n */\nexport function DateTimePickerPrimitive(props: DateTimePickerProps) {\n return <DatePickerNativeView {...transformDateTimePickerProps(props)} />;\n}\n\n/**\n * Renders a `DateTimePicker` component.\n */\nexport function DateTimePicker(props: DateTimePickerProps & { style?: StyleProp<ViewStyle> }) {\n const transformedStyle = transformDateTimePickerStyle(props.style);\n return (\n <Host style={transformedStyle} matchContents>\n <DateTimePickerPrimitive {...props} />\n </Host>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/DatePicker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AA0CrE,SAAS,4BAA4B,CAAC,KAA0B;IAC9D,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC9C,OAAO;QACL,SAAS;QACT,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvE,GAAG,IAAI;QACP,cAAc,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;YAC5C,KAAK,EAAE,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAA+C,iBAAiB,CACxF,QAAQ,EACR,oBAAoB,CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,OAAO,CAAC,oBAAoB,CAAC,IAAI,4BAA4B,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC3E,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type ViewEvent } from '../../types';\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport type IOSVariant = 'wheel' | 'automatic' | 'graphical' | 'compact';\n\nexport type DisplayedComponents = 'date' | 'hourAndMinute' | 'dateAndTime';\n\nexport type DateTimePickerProps = {\n /**\n * The initial date to display on the picker.\n */\n initialDate?: string | null;\n /**\n * A title displayed on the picker on iOS.\n * @platform ios\n */\n title?: string;\n /**\n * Callback function that is called when a date is selected.\n */\n onDateSelected?: (date: Date) => void;\n /**\n * The variant of the picker, which determines its appearance and behavior.\n * @default 'automatic'\n */\n variant?: IOSVariant;\n /**\n * The components that the picker should display.\n * On iOS, you can have a picker that selects both date and time.\n * @default 'date'\n */\n displayedComponents?: DisplayedComponents;\n /**\n * The tint color to use on the picker elements.\n */\n color?: string;\n} & CommonViewModifierProps;\n\ntype NativeDatePickerProps = Omit<DateTimePickerProps, 'variant' | 'onDateSelected'> & {\n variant?: IOSVariant;\n} & ViewEvent<'onDateSelected', { date: Date }>;\n\nfunction transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePickerProps {\n const { variant, modifiers, ...rest } = props;\n return {\n modifiers,\n ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),\n ...rest,\n onDateSelected: ({ nativeEvent: { date } }) => {\n props?.onDateSelected?.(new Date(date));\n },\n variant,\n };\n}\n\nconst DatePickerNativeView: React.ComponentType<NativeDatePickerProps> = requireNativeView(\n 'ExpoUI',\n 'DateTimePickerView'\n);\n\n/**\n * Renders a `DateTimePicker` component.\n */\nexport function DateTimePicker(props: DateTimePickerProps) {\n return <DatePickerNativeView {...transformDateTimePickerProps(props)} />;\n}\n"]}
@@ -1,5 +1,4 @@
1
- import { type CommonViewModifierProps } from './types';
2
- import { type ViewEvent } from '../types';
1
+ import { type CommonViewModifierProps } from '../types';
3
2
  export interface DisclosureGroupProps extends CommonViewModifierProps {
4
3
  label: string;
5
4
  children: React.ReactNode;
@@ -12,10 +11,5 @@ export interface DisclosureGroupProps extends CommonViewModifierProps {
12
11
  */
13
12
  onStateChange?: (isExpanded: boolean) => void;
14
13
  }
15
- type StateChangeEvent = ViewEvent<'onStateChange', {
16
- isExpanded: boolean;
17
- }>;
18
- export type NativeDisclosureGroupProps = Omit<DisclosureGroupProps, 'onStateChange'> & StateChangeEvent;
19
14
  export declare function DisclosureGroup(props: DisclosureGroupProps): import("react").JSX.Element;
20
- export {};
21
- //# sourceMappingURL=DisclosureGroup.d.ts.map
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/DisclosureGroup/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AASD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAc1D"}
@@ -0,0 +1,16 @@
1
+ import { requireNativeView } from 'expo';
2
+ import { createViewModifierEventListener } from '../modifiers/utils';
3
+ const DisclosureGroupNativeView = requireNativeView('ExpoUI', 'DisclosureGroupView');
4
+ export function DisclosureGroup(props) {
5
+ const { onStateChange, modifiers, ...rest } = props;
6
+ function handleStateChange(event) {
7
+ onStateChange?.(event.nativeEvent.isExpanded);
8
+ }
9
+ const transformedProps = {
10
+ modifiers,
11
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
12
+ ...rest,
13
+ };
14
+ return <DisclosureGroupNativeView {...transformedProps} onStateChange={handleStateChange}/>;
15
+ }
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/DisclosureGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAoBrE,MAAM,yBAAyB,GAC7B,iBAAiB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AAErD,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAEpD,SAAS,iBAAiB,CAAC,KAA+C;QACxE,aAAa,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,gBAAgB,GAAG;QACvB,SAAS;QACT,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvE,GAAG,IAAI;KACR,CAAC;IAEF,OAAO,CAAC,yBAAyB,CAAC,IAAI,gBAAgB,CAAC,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,EAAG,CAAC;AAC/F,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type ViewEvent } from '../../types';\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport interface DisclosureGroupProps extends CommonViewModifierProps {\n label: string;\n children: React.ReactNode;\n /**\n * Controls whether the disclosure group is expanded.\n */\n isExpanded?: boolean;\n /**\n * A callback that is called when the expansion state changes.\n */\n onStateChange?: (isExpanded: boolean) => void;\n}\n\ntype StateChangeEvent = ViewEvent<'onStateChange', { isExpanded: boolean }>;\n\ntype NativeDisclosureGroupProps = Omit<DisclosureGroupProps, 'onStateChange'> & StateChangeEvent;\n\nconst DisclosureGroupNativeView: React.ComponentType<NativeDisclosureGroupProps> =\n requireNativeView('ExpoUI', 'DisclosureGroupView');\n\nexport function DisclosureGroup(props: DisclosureGroupProps) {\n const { onStateChange, modifiers, ...rest } = props;\n\n function handleStateChange(event: { nativeEvent: { isExpanded: boolean } }) {\n onStateChange?.(event.nativeEvent.isExpanded);\n }\n\n const transformedProps = {\n modifiers,\n ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),\n ...rest,\n };\n\n return <DisclosureGroupNativeView {...transformedProps} onStateChange={handleStateChange} />;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { type CommonViewModifierProps } from './types';
1
+ import { type CommonViewModifierProps } from '../types';
2
2
  export interface FormProps extends CommonViewModifierProps {
3
3
  children: React.ReactNode;
4
4
  /**
@@ -9,4 +9,4 @@ export interface FormProps extends CommonViewModifierProps {
9
9
  scrollEnabled?: boolean;
10
10
  }
11
11
  export declare function Form(props: FormProps): import("react").JSX.Element;
12
- //# sourceMappingURL=Form.d.ts.map
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Form/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,SAAU,SAAQ,uBAAuB;IACxD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAaD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAEpC"}
@@ -0,0 +1,15 @@
1
+ import { requireNativeView } from 'expo';
2
+ import { createViewModifierEventListener } from '../modifiers/utils';
3
+ const FormNativeView = requireNativeView('ExpoUI', 'FormView');
4
+ function transformFormProps(props) {
5
+ const { modifiers, ...restProps } = props;
6
+ return {
7
+ modifiers,
8
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
9
+ ...restProps,
10
+ };
11
+ }
12
+ export function Form(props) {
13
+ return <FormNativeView {...transformFormProps(props)}/>;
14
+ }
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/Form/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAcrE,MAAM,cAAc,GAAmC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAE/F,SAAS,kBAAkB,CAAC,KAAgB;IAC1C,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAC1C,OAAO;QACL,SAAS;QACT,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvE,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,OAAO,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC3D,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport interface FormProps extends CommonViewModifierProps {\n children: React.ReactNode;\n\n /**\n * Makes the form scrollable.\n * @default true\n * @platform ios 16.0+\n */\n scrollEnabled?: boolean;\n}\n\nconst FormNativeView: React.ComponentType<FormProps> = requireNativeView('ExpoUI', 'FormView');\n\nfunction transformFormProps(props: FormProps): FormProps {\n const { modifiers, ...restProps } = props;\n return {\n modifiers,\n ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),\n ...restProps,\n };\n}\n\nexport function Form(props: FormProps) {\n return <FormNativeView {...transformFormProps(props)} />;\n}\n"]}
@@ -1,4 +1,5 @@
1
- import { ColorValue, StyleProp, ViewStyle } from 'react-native';
1
+ import { ColorValue } from 'react-native';
2
+ import { type CommonViewModifierProps } from '../types';
2
3
  /**
3
4
  * The type of `Gauge`.
4
5
  * @platform ios
@@ -51,17 +52,10 @@ export type GaugeProps = {
51
52
  * Color (or array of colors for gradient) of the `Gauge`.
52
53
  */
53
54
  color?: ColorValue | ColorValue[];
54
- };
55
- /**
56
- * `<Gauge>` component without a host view.
57
- * You should use this with a `Host` component in ancestor.
58
- */
59
- export declare function GaugePrimitive({ type, ...props }: GaugeProps): import("react").JSX.Element | null;
55
+ } & CommonViewModifierProps;
60
56
  /**
61
57
  * Renders a native `Gauge` component.
62
58
  * @platform ios
63
59
  */
64
- export declare function Gauge(props: GaugeProps & {
65
- style?: StyleProp<ViewStyle>;
66
- }): import("react").JSX.Element;
60
+ export declare function Gauge({ type, modifiers, ...props }: GaugeProps): import("react").JSX.Element;
67
61
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Gauge/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAY,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI1E;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAA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KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;CACnC,GAAG,uBAAuB,CAAC;AAI5B;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAgB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAS1E"}
@@ -1,27 +1,11 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { Platform } from 'react-native';
3
- import { Host } from '../Host';
4
- let GaugeNativeView;
5
- if (Platform.OS === 'ios') {
6
- GaugeNativeView = requireNativeView('ExpoUI', 'GaugeView');
7
- }
8
- /**
9
- * `<Gauge>` component without a host view.
10
- * You should use this with a `Host` component in ancestor.
11
- */
12
- export function GaugePrimitive({ type = 'default', ...props }) {
13
- if (!GaugeNativeView) {
14
- return null;
15
- }
16
- return <GaugeNativeView type={type} {...props}/>;
17
- }
2
+ import { createViewModifierEventListener } from '../modifiers/utils';
3
+ const GaugeNativeView = requireNativeView('ExpoUI', 'GaugeView');
18
4
  /**
19
5
  * Renders a native `Gauge` component.
20
6
  * @platform ios
21
7
  */
22
- export function Gauge(props) {
23
- return (<Host style={props.style} matchContents>
24
- <GaugePrimitive {...props}/>
25
- </Host>);
8
+ export function Gauge({ type = 'default', modifiers, ...props }) {
9
+ return (<GaugeNativeView modifiers={modifiers} {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)} type={type} {...props}/>);
26
10
  }
27
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/Gauge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAc,QAAQ,EAAwB,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA0D/B,IAAI,eAAuD,CAAC;AAE5D,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;IAC1B,eAAe,GAAG,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,GAAG,KAAK,EAAc;IACvE,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,KAAoD;IACxE,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,aAAa,CACrC;MAAA,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC,EAC5B;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { ColorValue, Platform, StyleProp, ViewStyle } from 'react-native';\n\nimport { Host } from '../Host';\n\n/**\n * The type of `Gauge`.\n * @platform ios\n */\nexport type GaugeType = 'default' | 'circular' | 'circularCapacity' | 'linear' | 'linearCapacity';\n\n/**\n * Value options for the `Gauge` component.\n * @platform ios\n */\nexport type ValueOptions = {\n /**\n * Value of the element.\n */\n value: number;\n /**\n * Label of the element.\n */\n label?: string;\n /**\n * Color of the label.\n */\n color?: ColorValue;\n};\n\nexport type GaugeProps = {\n /**\n * A label displayed on the `Gauge`.\n */\n label?: string;\n /**\n * Color of the label.\n */\n labelColor?: ColorValue;\n /**\n * Current value options.\n */\n current: ValueOptions;\n /**\n * Minimum value options.\n */\n min?: ValueOptions;\n /**\n * Maximum value options.\n */\n max?: ValueOptions;\n /**\n * The type of `Gauge`.\n */\n type?: GaugeType;\n /**\n * Color (or array of colors for gradient) of the `Gauge`.\n */\n color?: ColorValue | ColorValue[];\n};\n\nlet GaugeNativeView: React.ComponentType<GaugeProps> | null;\n\nif (Platform.OS === 'ios') {\n GaugeNativeView = requireNativeView('ExpoUI', 'GaugeView');\n}\n\n/**\n * `<Gauge>` component without a host view.\n * You should use this with a `Host` component in ancestor.\n */\nexport function GaugePrimitive({ type = 'default', ...props }: GaugeProps) {\n if (!GaugeNativeView) {\n return null;\n }\n return <GaugeNativeView type={type} {...props} />;\n}\n\n/**\n * Renders a native `Gauge` component.\n * @platform ios\n */\nexport function Gauge(props: GaugeProps & { style?: StyleProp<ViewStyle> }) {\n return (\n <Host style={props.style} matchContents>\n <GaugePrimitive {...props} />\n </Host>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/Gauge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AA2DrE,MAAM,eAAe,GAAoC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAElG;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAAc;IACzE,OAAO,CACL,CAAC,eAAe,CACd,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CACzE,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { ColorValue } from 'react-native';\n\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\n/**\n * The type of `Gauge`.\n * @platform ios\n */\nexport type GaugeType = 'default' | 'circular' | 'circularCapacity' | 'linear' | 'linearCapacity';\n\n/**\n * Value options for the `Gauge` component.\n * @platform ios\n */\nexport type ValueOptions = {\n /**\n * Value of the element.\n */\n value: number;\n /**\n * Label of the element.\n */\n label?: string;\n /**\n * Color of the label.\n */\n color?: ColorValue;\n};\n\nexport type GaugeProps = {\n /**\n * A label displayed on the `Gauge`.\n */\n label?: string;\n /**\n * Color of the label.\n */\n labelColor?: ColorValue;\n /**\n * Current value options.\n */\n current: ValueOptions;\n /**\n * Minimum value options.\n */\n min?: ValueOptions;\n /**\n * Maximum value options.\n */\n max?: ValueOptions;\n /**\n * The type of `Gauge`.\n */\n type?: GaugeType;\n /**\n * Color (or array of colors for gradient) of the `Gauge`.\n */\n color?: ColorValue | ColorValue[];\n} & CommonViewModifierProps;\n\nconst GaugeNativeView: React.ComponentType<GaugeProps> = requireNativeView('ExpoUI', 'GaugeView');\n\n/**\n * Renders a native `Gauge` component.\n * @platform ios\n */\nexport function Gauge({ type = 'default', modifiers, ...props }: GaugeProps) {\n return (\n <GaugeNativeView\n modifiers={modifiers}\n {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}\n type={type}\n {...props}\n />\n );\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { StyleProp, ViewStyle, type ColorSchemeName } from 'react-native';
2
+ import { type CommonViewModifierProps } from '../types';
2
3
  export type HostProps = {
3
4
  /**
4
5
  * When true, the host view will update its size in the React Native view tree to match the content's layout from SwiftUI.
@@ -30,7 +31,7 @@ export type HostProps = {
30
31
  colorScheme?: ColorSchemeName;
31
32
  children: React.ReactNode;
32
33
  style?: StyleProp<ViewStyle>;
33
- };
34
+ } & CommonViewModifierProps;
34
35
  /**
35
36
  * A hosting component for SwiftUI views.
36
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Host/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAEvE;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAEtF;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAE9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAIF;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BA2BpC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Host/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAEvE;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAEtF;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAE9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,uBAAuB,CAAC;AAI5B;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BA6BpC"}
@@ -1,13 +1,14 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { useState } from 'react';
3
+ import { createViewModifierEventListener } from '../modifiers/utils';
3
4
  const HostNativeView = requireNativeView('ExpoUI', 'HostView');
4
5
  /**
5
6
  * A hosting component for SwiftUI views.
6
7
  */
7
8
  export function Host(props) {
8
- const { matchContents, onLayoutContent, style, ...restProps } = props;
9
+ const { matchContents, onLayoutContent, style, modifiers, ...restProps } = props;
9
10
  const [containerStyle, setContainerStyle] = useState(null);
10
- return (<HostNativeView style={[style, containerStyle]} onLayoutContent={(e) => {
11
+ return (<HostNativeView modifiers={modifiers} {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)} style={[style, containerStyle]} onLayoutContent={(e) => {
11
12
  onLayoutContent?.(e);
12
13
  if (matchContents) {
13
14
  const matchVertical = typeof matchContents === 'object' ? matchContents.vertical : matchContents;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources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,SAAS,CAAC,EACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { useState } from 'react';\nimport { StyleProp, ViewStyle, type ColorSchemeName } from 'react-native';\n\nexport type HostProps = {\n /**\n * When true, the host view will update its size in the React Native view tree to match the content's layout from SwiftUI.\n * @default false\n */\n matchContents?: boolean | { vertical?: boolean; horizontal?: boolean };\n\n /**\n * When true and no explicit size is provided, the host will use the viewport size as the proposed size for SwiftUI layout.\n * This is particularly useful for SwiftUI views that need to fill their available space, such as `Form`.\n * @default false\n */\n useViewportSizeMeasurement?: boolean;\n\n /**\n * Callback function that is triggered when the SwiftUI content completes its layout.\n * Provides the current dimensions of the content, which may change as the content updates.\n */\n onLayoutContent?: (event: { nativeEvent: { width: number; height: number } }) => void;\n\n /**\n * The color scheme of the host view.\n */\n colorScheme?: ColorSchemeName;\n\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst HostNativeView: React.ComponentType<HostProps> = requireNativeView('ExpoUI', 'HostView');\n\n/**\n * A hosting component for SwiftUI views.\n */\nexport function Host(props: HostProps) {\n const { matchContents, onLayoutContent, style, ...restProps } = props;\n const [containerStyle, setContainerStyle] = useState<ViewStyle | null>(null);\n\n return (\n <HostNativeView\n style={[style, containerStyle]}\n onLayoutContent={(e) => {\n onLayoutContent?.(e);\n if (matchContents) {\n const matchVertical =\n typeof matchContents === 'object' ? matchContents.vertical : matchContents;\n const matchHorizontal =\n typeof matchContents === 'object' ? matchContents.horizontal : matchContents;\n const newContainerStyle: ViewStyle = {};\n if (matchVertical) {\n newContainerStyle.height = e.nativeEvent.height;\n }\n if (matchHorizontal) {\n newContainerStyle.width = e.nativeEvent.width;\n }\n setContainerStyle(newContainerStyle);\n }\n }}\n {...restProps}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/Host/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM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CAAC,WAAW,CAAC,KAAK,CAAC;gBAChD,CAAC;gBACD,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;YACvC,CAAC;QACH,CAAC,CAAC,CACF,IAAI,SAAS,CAAC,EACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport { useState } from 'react';\nimport { StyleProp, ViewStyle, type ColorSchemeName } from 'react-native';\n\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport type HostProps = {\n /**\n * When true, the host view will update its size in the React Native view tree to match the content's layout from SwiftUI.\n * @default false\n */\n matchContents?: boolean | { vertical?: boolean; horizontal?: boolean };\n\n /**\n * When true and no explicit size is provided, the host will use the viewport size as the proposed size for SwiftUI layout.\n * This is particularly useful for SwiftUI views that need to fill their available space, such as `Form`.\n * @default false\n */\n useViewportSizeMeasurement?: boolean;\n\n /**\n * Callback function that is triggered when the SwiftUI content completes its layout.\n * Provides the current dimensions of the content, which may change as the content updates.\n */\n onLayoutContent?: (event: { nativeEvent: { width: number; height: number } }) => void;\n\n /**\n * The color scheme of the host view.\n */\n colorScheme?: ColorSchemeName;\n\n children: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n} & CommonViewModifierProps;\n\nconst HostNativeView: React.ComponentType<HostProps> = requireNativeView('ExpoUI', 'HostView');\n\n/**\n * A hosting component for SwiftUI views.\n */\nexport function Host(props: HostProps) {\n const { matchContents, onLayoutContent, style, modifiers, ...restProps } = props;\n const [containerStyle, setContainerStyle] = useState<ViewStyle | null>(null);\n\n return (\n <HostNativeView\n modifiers={modifiers}\n {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}\n style={[style, containerStyle]}\n onLayoutContent={(e) => {\n onLayoutContent?.(e);\n if (matchContents) {\n const matchVertical =\n typeof matchContents === 'object' ? matchContents.vertical : matchContents;\n const matchHorizontal =\n typeof matchContents === 'object' ? matchContents.horizontal : matchContents;\n const newContainerStyle: ViewStyle = {};\n if (matchVertical) {\n newContainerStyle.height = e.nativeEvent.height;\n }\n if (matchHorizontal) {\n newContainerStyle.width = e.nativeEvent.width;\n }\n setContainerStyle(newContainerStyle);\n }\n }}\n {...restProps}\n />\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { type CommonViewModifierProps } from './types';
1
+ import { type CommonViewModifierProps } from '../types';
2
2
  export interface ImageProps extends CommonViewModifierProps {
3
3
  /**
4
4
  * The name of the system image (SF Symbol).
@@ -20,4 +20,4 @@ export interface ImageProps extends CommonViewModifierProps {
20
20
  onPress?: () => void;
21
21
  }
22
22
  export declare function Image(props: ImageProps): import("react").JSX.Element;
23
- //# sourceMappingURL=Image.d.ts.map
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Image/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,WAAW,UAAW,SAAQ,uBAAuB;IACzD;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAuBD,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAEtC"}
@@ -1,7 +1,10 @@
1
1
  import { requireNativeView } from 'expo';
2
+ import { createViewModifierEventListener } from '../modifiers/utils';
2
3
  function transformNativeProps(props) {
3
- const { onPress, ...restProps } = props;
4
+ const { onPress, modifiers, ...restProps } = props;
4
5
  return {
6
+ modifiers,
7
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
5
8
  ...restProps,
6
9
  ...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),
7
10
  };
@@ -10,4 +13,4 @@ const ImageNativeView = requireNativeView('ExpoUI', 'ImageView');
10
13
  export function Image(props) {
11
14
  return <ImageNativeView {...transformNativeProps(props)}/>;
12
15
  }
13
- //# sourceMappingURL=Image.js.map
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/Image/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AA+BrE,SAAS,oBAAoB,CAAC,KAAiB;IAC7C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACnD,OAAO;QACL,SAAS;QACT,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACvE,GAAG,SAAS;QACZ,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KACtE,CAAC;AACJ,CAAC;AAED,MAAM,eAAe,GAA0C,iBAAiB,CAC9E,QAAQ,EACR,WAAW,CACZ,CAAC;AAEF,MAAM,UAAU,KAAK,CAAC,KAAiB;IACrC,OAAO,CAAC,eAAe,CAAC,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;AAC9D,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { type ViewEvent } from '../../types';\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport interface ImageProps extends CommonViewModifierProps {\n /**\n * The name of the system image (SF Symbol).\n * For example: 'photo', 'heart.fill', 'star.circle'\n */\n systemName: string;\n /**\n * The size of the system image.\n */\n size?: number;\n /**\n * The color of the system image.\n * Can be a color name like '#ff00ff', 'red', 'blue', etc.\n */\n color?: string;\n\n /**\n * Callback triggered when the view is pressed.\n */\n onPress?: () => void;\n}\n\ntype TapEvent = ViewEvent<'onTap', object> & {\n useTapGesture?: boolean;\n};\n\ntype NativeImageProps = Omit<ImageProps, 'onPress'> | TapEvent;\n\nfunction transformNativeProps(props: ImageProps): NativeImageProps {\n const { onPress, modifiers, ...restProps } = props;\n return {\n modifiers,\n ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),\n ...restProps,\n ...(onPress ? { useTapGesture: true, onTap: () => onPress() } : null),\n };\n}\n\nconst ImageNativeView: React.ComponentType<NativeImageProps> = requireNativeView(\n 'ExpoUI',\n 'ImageView'\n);\n\nexport function Image(props: ImageProps) {\n return <ImageNativeView {...transformNativeProps(props)} />;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
1
+ import { type CommonViewModifierProps } from '../types';
2
2
  export type LabelProps = {
3
3
  /**
4
4
  * The title text to be displayed in the label.
@@ -12,12 +12,7 @@ export type LabelProps = {
12
12
  * The color of the label icon.
13
13
  */
14
14
  color?: string;
15
- };
16
- /**
17
- * `<Label>` component without a host view.
18
- * You should use this with a `Host` component in ancestor.
19
- */
20
- export declare function LabelPrimitive(props: LabelProps): import("react").JSX.Element;
15
+ } & CommonViewModifierProps;
21
16
  /**
22
17
  * Renders a native label view, which could be used in a list or section.
23
18
  *
@@ -25,7 +20,5 @@ export declare function LabelPrimitive(props: LabelProps): import("react").JSX.E
25
20
  * @returns {JSX.Element} The rendered native Label component.
26
21
  * @platform ios
27
22
  */
28
- export declare function Label(props: LabelProps & {
29
- style?: StyleProp<ViewStyle>;
30
- }): import("react").JSX.Element;
23
+ export declare function Label(props: LabelProps): import("react").JSX.Element;
31
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Label/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAIF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,+BAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,+BAMzE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/Label/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,uBAAuB,CAAC;AAI5B;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,+BAStC"}
@@ -1,13 +1,6 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { Host } from '../Host';
2
+ import { createViewModifierEventListener } from '../modifiers/utils';
3
3
  const LabelNativeView = requireNativeView('ExpoUI', 'LabelView');
4
- /**
5
- * `<Label>` component without a host view.
6
- * You should use this with a `Host` component in ancestor.
7
- */
8
- export function LabelPrimitive(props) {
9
- return <LabelNativeView {...props}/>;
10
- }
11
4
  /**
12
5
  * Renders a native label view, which could be used in a list or section.
13
6
  *
@@ -16,8 +9,7 @@ export function LabelPrimitive(props) {
16
9
  * @platform ios
17
10
  */
18
11
  export function Label(props) {
19
- return (<Host style={props.style} matchContents>
20
- <LabelPrimitive {...props}/>
21
- </Host>);
12
+ const { modifiers, ...restProps } = props;
13
+ return (<LabelNativeView modifiers={modifiers} {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)} {...restProps}/>);
22
14
  }
23
15
  //# sourceMappingURL=index.js.map