@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,259 @@
1
+ /**
2
+ * Core modifier factory and type definitions for SwiftUI view modifiers.
3
+ * This system allows both built-in and 3rd party modifiers to use the same API.
4
+ */
5
+ /**
6
+ * Base interface for all view modifiers.
7
+ * All modifiers must have a type field and can include arbitrary parameters.
8
+ */
9
+ export interface ModifierConfig {
10
+ $type: string;
11
+ [key: string]: any;
12
+ eventListener?: (args: any) => void;
13
+ }
14
+ /**
15
+ * Factory function to create modifier configuration objects.
16
+ * This is used internally by all modifier functions.
17
+ */
18
+ declare function createModifier(type: string, params?: Record<string, any>): ModifierConfig;
19
+ /**
20
+ * Sets the background of a view.
21
+ * @param color - The background color (hex string, e.g., '#FF0000')
22
+ */
23
+ export declare const background: (color: string) => ModifierConfig;
24
+ /**
25
+ * Applies corner radius to a view.
26
+ * @param radius - The corner radius value
27
+ */
28
+ export declare const cornerRadius: (radius: number) => ModifierConfig;
29
+ /**
30
+ * Adds a shadow to a view.
31
+ */
32
+ export declare const shadow: (params: {
33
+ radius: number;
34
+ x?: number;
35
+ y?: number;
36
+ color?: string;
37
+ }) => ModifierConfig;
38
+ /**
39
+ * Sets the frame properties of a view.
40
+ */
41
+ export declare const frame: (params: {
42
+ width?: number;
43
+ height?: number;
44
+ minWidth?: number;
45
+ maxWidth?: number;
46
+ minHeight?: number;
47
+ maxHeight?: number;
48
+ idealWidth?: number;
49
+ idealHeight?: number;
50
+ alignment?: "center" | "leading" | "trailing" | "top" | "bottom" | "topLeading" | "topTrailing" | "bottomLeading" | "bottomTrailing";
51
+ }) => ModifierConfig;
52
+ /**
53
+ * Sets padding on a view.
54
+ * Supports individual edges or shorthand properties.
55
+ */
56
+ export declare const padding: (params: {
57
+ top?: number;
58
+ bottom?: number;
59
+ leading?: number;
60
+ trailing?: number;
61
+ horizontal?: number;
62
+ vertical?: number;
63
+ all?: number;
64
+ }) => ModifierConfig;
65
+ /**
66
+ * Controls fixed size behavior.
67
+ * @param enabled - Whether the view should use its natural size
68
+ */
69
+ export declare const fixedSize: (enabled?: boolean) => ModifierConfig;
70
+ /**
71
+ * Adds a tap gesture recognizer.
72
+ * @param handler - Function to call when tapped
73
+ */
74
+ export declare const onTapGesture: (handler: () => void) => ModifierConfig;
75
+ /**
76
+ * Adds a long press gesture recognizer.
77
+ * @param handler - Function to call when long pressed
78
+ * @param minimumDuration - Minimum duration for long press (default: 0.5s)
79
+ */
80
+ export declare const onLongPressGesture: (handler: () => void, minimumDuration?: number) => ModifierConfig;
81
+ /**
82
+ * Sets the opacity of a view.
83
+ * @param value - Opacity value between 0 and 1
84
+ */
85
+ export declare const opacity: (value: number) => ModifierConfig;
86
+ /**
87
+ * Clips the view to a specific shape.
88
+ * @param shape - The clipping shape
89
+ * @param cornerRadius - Corner radius for rounded rectangle (default: 8)
90
+ */
91
+ export declare const clipShape: (shape: "rectangle" | "circle" | "roundedRectangle", cornerRadius?: number) => ModifierConfig;
92
+ /**
93
+ * Adds a border to a view.
94
+ */
95
+ export declare const border: (params: {
96
+ color: string;
97
+ width?: number;
98
+ }) => ModifierConfig;
99
+ /**
100
+ * Applies scaling transformation.
101
+ * @param scale - Scale factor (1.0 = normal size)
102
+ */
103
+ export declare const scaleEffect: (scale: number) => ModifierConfig;
104
+ /**
105
+ * Applies rotation transformation.
106
+ * @param angle - Rotation angle in degrees
107
+ */
108
+ export declare const rotationEffect: (angle: number) => ModifierConfig;
109
+ /**
110
+ * Applies an offset (translation) to a view.
111
+ */
112
+ export declare const offset: (params: {
113
+ x?: number;
114
+ y?: number;
115
+ }) => ModifierConfig;
116
+ /**
117
+ * Sets the foreground color/tint of a view.
118
+ * @param color - The foreground color (hex string)
119
+ */
120
+ export declare const foregroundColor: (color: string) => ModifierConfig;
121
+ /**
122
+ * Sets the tint color of a view.
123
+ * @param color - The tint color (hex string)
124
+ */
125
+ export declare const tint: (color: string) => ModifierConfig;
126
+ /**
127
+ * Hides or shows a view.
128
+ * @param hidden - Whether the view should be hidden
129
+ */
130
+ export declare const hidden: (hidden?: boolean) => ModifierConfig;
131
+ /**
132
+ * Sets the z-index (display order) of a view.
133
+ * @param index - The z-index value
134
+ */
135
+ export declare const zIndex: (index: number) => ModifierConfig;
136
+ /**
137
+ * Applies blur to a view.
138
+ * @param radius - The blur radius
139
+ */
140
+ export declare const blur: (radius: number) => ModifierConfig;
141
+ /**
142
+ * Adjusts the brightness of a view.
143
+ * @param amount - Brightness adjustment (-1 to 1)
144
+ */
145
+ export declare const brightness: (amount: number) => ModifierConfig;
146
+ /**
147
+ * Adjusts the contrast of a view.
148
+ * @param amount - Contrast multiplier (0 to infinity, 1 = normal)
149
+ */
150
+ export declare const contrast: (amount: number) => ModifierConfig;
151
+ /**
152
+ * Adjusts the saturation of a view.
153
+ * @param amount - Saturation multiplier (0 to infinity, 1 = normal)
154
+ */
155
+ export declare const saturation: (amount: number) => ModifierConfig;
156
+ /**
157
+ * Applies a hue rotation to a view.
158
+ * @param angle - Hue rotation angle in degrees
159
+ */
160
+ export declare const hueRotation: (angle: number) => ModifierConfig;
161
+ /**
162
+ * Inverts the colors of a view.
163
+ * @param inverted - Whether to invert colors
164
+ */
165
+ export declare const colorInvert: (inverted?: boolean) => ModifierConfig;
166
+ /**
167
+ * Makes a view grayscale.
168
+ * @param amount - Grayscale amount (0 to 1)
169
+ */
170
+ export declare const grayscale: (amount: number) => ModifierConfig;
171
+ /**
172
+ * Sets accessibility label for the view.
173
+ * @param label - The accessibility label
174
+ */
175
+ export declare const accessibilityLabel: (label: string) => ModifierConfig;
176
+ /**
177
+ * Sets accessibility hint for the view.
178
+ * @param hint - The accessibility hint
179
+ */
180
+ export declare const accessibilityHint: (hint: string) => ModifierConfig;
181
+ /**
182
+ * Sets accessibility value for the view.
183
+ * @param value - The accessibility value
184
+ */
185
+ export declare const accessibilityValue: (value: string) => ModifierConfig;
186
+ /**
187
+ * Sets layout priority for the view.
188
+ * @param priority - Layout priority value
189
+ */
190
+ export declare const layoutPriority: (priority: number) => ModifierConfig;
191
+ /**
192
+ * Applies a mask to the view.
193
+ * @param shape - The masking shape
194
+ * @param cornerRadius - Corner radius for rounded rectangle (default: 8)
195
+ */
196
+ export declare const mask: (shape: "rectangle" | "circle" | "roundedRectangle", cornerRadius?: number) => ModifierConfig;
197
+ /**
198
+ * Overlays another view on top.
199
+ * @param color - Overlay color
200
+ * @param alignment - Overlay alignment
201
+ */
202
+ export declare const overlay: (params: {
203
+ color?: string;
204
+ alignment?: "center" | "top" | "bottom" | "leading" | "trailing";
205
+ }) => ModifierConfig;
206
+ /**
207
+ * Adds a background behind the view.
208
+ * @param color - Background color
209
+ * @param alignment - Background alignment
210
+ */
211
+ export declare const backgroundOverlay: (params: {
212
+ color?: string;
213
+ alignment?: "center" | "top" | "bottom" | "leading" | "trailing";
214
+ }) => ModifierConfig;
215
+ /**
216
+ * Sets aspect ratio constraint.
217
+ * @param ratio - Width/height aspect ratio
218
+ * @param contentMode - How content fits the aspect ratio
219
+ */
220
+ export declare const aspectRatio: (params: {
221
+ ratio: number;
222
+ contentMode?: "fit" | "fill";
223
+ }) => ModifierConfig;
224
+ /**
225
+ * Clips content to bounds.
226
+ * @param clipped - Whether to clip content
227
+ */
228
+ export declare const clipped: (clipped?: boolean) => ModifierConfig;
229
+ /**
230
+ * Union type of all built-in modifier return types.
231
+ * This provides type safety for the modifiers array.
232
+ */
233
+ export type BuiltInModifier = ReturnType<typeof background> | ReturnType<typeof cornerRadius> | ReturnType<typeof shadow> | ReturnType<typeof frame> | ReturnType<typeof padding> | ReturnType<typeof fixedSize> | ReturnType<typeof onTapGesture> | ReturnType<typeof onLongPressGesture> | ReturnType<typeof opacity> | ReturnType<typeof clipShape> | ReturnType<typeof border> | ReturnType<typeof scaleEffect> | ReturnType<typeof rotationEffect> | ReturnType<typeof offset> | ReturnType<typeof foregroundColor> | ReturnType<typeof tint> | ReturnType<typeof hidden> | ReturnType<typeof zIndex> | ReturnType<typeof blur> | ReturnType<typeof brightness> | ReturnType<typeof contrast> | ReturnType<typeof saturation> | ReturnType<typeof hueRotation> | ReturnType<typeof colorInvert> | ReturnType<typeof grayscale> | ReturnType<typeof accessibilityLabel> | ReturnType<typeof accessibilityHint> | ReturnType<typeof accessibilityValue> | ReturnType<typeof layoutPriority> | ReturnType<typeof mask> | ReturnType<typeof overlay> | ReturnType<typeof backgroundOverlay> | ReturnType<typeof aspectRatio> | ReturnType<typeof clipped>;
234
+ /**
235
+ * Main ViewModifier type that supports both built-in and 3rd party modifiers.
236
+ * 3rd party modifiers should return ModifierConfig objects with their own type strings.
237
+ */
238
+ export type ViewModifier = BuiltInModifier | ModifierConfig;
239
+ /**
240
+ * Creates a custom modifier for 3rd party libraries.
241
+ * This function is exported so 3rd party packages can create their own modifiers.
242
+ *
243
+ * @example
244
+ * ```typescript
245
+ * // In a 3rd party package
246
+ * export const blurEffect = (params: { radius: number; style?: string }) =>
247
+ * createModifier('blurEffect', params);
248
+ * ```
249
+ */
250
+ export { createModifier };
251
+ /**
252
+ * Type guard to check if a value is a valid modifier.
253
+ */
254
+ export declare const isModifier: (value: any) => value is ModifierConfig;
255
+ /**
256
+ * Filters an array to only include valid modifiers.
257
+ */
258
+ export declare const filterModifiers: (modifiers: unknown[]) => ModifierConfig[];
259
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/index.ts"],"names":[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C,GAC7B,UAAU,CAAC,OAAO,QAAQ,CAAC,GAC3B,UAAU,CAAC,OAAO,UAAU,CAAC,GAC7B,UAAU,CAAC,OAAO,WAAW,CAAC,GAC9B,UAAU,CAAC,OAAO,WAAW,CAAC,GAC9B,UAAU,CAAC,OAAO,SAAS,CAAC,GAC5B,UAAU,CAAC,OAAO,kBAAkB,CAAC,GACrC,UAAU,CAAC,OAAO,iBAAiB,CAAC,GACpC,UAAU,CAAC,OAAO,kBAAkB,CAAC,GACrC,UAAU,CAAC,OAAO,cAAc,CAAC,GACjC,UAAU,CAAC,OAAO,IAAI,CAAC,GACvB,UAAU,CAAC,OAAO,OAAO,CAAC,GAC1B,UAAU,CAAC,OAAO,iBAAiB,CAAC,GACpC,UAAU,CAAC,OAAO,WAAW,CAAC,GAC9B,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,cAAc,CAAC;AAM5D;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI,cAEhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,OAAO,EAAE,KAAG,cAAc,EAEpE,CAAC"}
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Core modifier factory and type definitions for SwiftUI view modifiers.
3
+ * This system allows both built-in and 3rd party modifiers to use the same API.
4
+ */
5
+ /**
6
+ * Factory function to create modifier configuration objects.
7
+ * This is used internally by all modifier functions.
8
+ */
9
+ function createModifier(type, params = {}) {
10
+ return { $type: type, ...params };
11
+ }
12
+ /**
13
+ * Creates a modifier with an event listener.
14
+ */
15
+ function createModifierWithEventListener(type, eventListener, params = {}) {
16
+ return { $type: type, ...params, eventListener };
17
+ }
18
+ // =============================================================================
19
+ // Built-in Modifier Functions
20
+ // =============================================================================
21
+ /**
22
+ * Sets the background of a view.
23
+ * @param color - The background color (hex string, e.g., '#FF0000')
24
+ */
25
+ export const background = (color) => createModifier('background', { color });
26
+ /**
27
+ * Applies corner radius to a view.
28
+ * @param radius - The corner radius value
29
+ */
30
+ export const cornerRadius = (radius) => createModifier('cornerRadius', { radius });
31
+ /**
32
+ * Adds a shadow to a view.
33
+ */
34
+ export const shadow = (params) => createModifier('shadow', params);
35
+ /**
36
+ * Sets the frame properties of a view.
37
+ */
38
+ export const frame = (params) => createModifier('frame', params);
39
+ /**
40
+ * Sets padding on a view.
41
+ * Supports individual edges or shorthand properties.
42
+ */
43
+ export const padding = (params) => createModifier('padding', params);
44
+ /**
45
+ * Controls fixed size behavior.
46
+ * @param enabled - Whether the view should use its natural size
47
+ */
48
+ export const fixedSize = (enabled = true) => createModifier('fixedSize', { enabled });
49
+ /**
50
+ * Adds a tap gesture recognizer.
51
+ * @param handler - Function to call when tapped
52
+ */
53
+ export const onTapGesture = (handler) => createModifierWithEventListener('onTapGesture', handler);
54
+ /**
55
+ * Adds a long press gesture recognizer.
56
+ * @param handler - Function to call when long pressed
57
+ * @param minimumDuration - Minimum duration for long press (default: 0.5s)
58
+ */
59
+ export const onLongPressGesture = (handler, minimumDuration) => createModifierWithEventListener('onLongPressGesture', handler, {
60
+ minimumDuration: minimumDuration ?? 0.5,
61
+ });
62
+ // Note: Complex gesture modifiers like onDragGesture are not available
63
+ // in the modifier system. Use component-level props instead.
64
+ /**
65
+ * Sets the opacity of a view.
66
+ * @param value - Opacity value between 0 and 1
67
+ */
68
+ export const opacity = (value) => createModifier('opacity', { value });
69
+ /**
70
+ * Clips the view to a specific shape.
71
+ * @param shape - The clipping shape
72
+ * @param cornerRadius - Corner radius for rounded rectangle (default: 8)
73
+ */
74
+ export const clipShape = (shape, cornerRadius) => createModifier('clipShape', { shape, cornerRadius });
75
+ /**
76
+ * Adds a border to a view.
77
+ */
78
+ export const border = (params) => createModifier('border', params);
79
+ /**
80
+ * Applies scaling transformation.
81
+ * @param scale - Scale factor (1.0 = normal size)
82
+ */
83
+ export const scaleEffect = (scale) => createModifier('scaleEffect', { scale });
84
+ /**
85
+ * Applies rotation transformation.
86
+ * @param angle - Rotation angle in degrees
87
+ */
88
+ export const rotationEffect = (angle) => createModifier('rotationEffect', { angle });
89
+ /**
90
+ * Applies an offset (translation) to a view.
91
+ */
92
+ export const offset = (params) => createModifier('offset', params);
93
+ /**
94
+ * Sets the foreground color/tint of a view.
95
+ * @param color - The foreground color (hex string)
96
+ */
97
+ export const foregroundColor = (color) => createModifier('foregroundColor', { color });
98
+ /**
99
+ * Sets the tint color of a view.
100
+ * @param color - The tint color (hex string)
101
+ */
102
+ export const tint = (color) => createModifier('tint', { color });
103
+ /**
104
+ * Hides or shows a view.
105
+ * @param hidden - Whether the view should be hidden
106
+ */
107
+ export const hidden = (hidden = true) => createModifier('hidden', { hidden });
108
+ /**
109
+ * Sets the z-index (display order) of a view.
110
+ * @param index - The z-index value
111
+ */
112
+ export const zIndex = (index) => createModifier('zIndex', { index });
113
+ /**
114
+ * Applies blur to a view.
115
+ * @param radius - The blur radius
116
+ */
117
+ export const blur = (radius) => createModifier('blur', { radius });
118
+ /**
119
+ * Adjusts the brightness of a view.
120
+ * @param amount - Brightness adjustment (-1 to 1)
121
+ */
122
+ export const brightness = (amount) => createModifier('brightness', { amount });
123
+ /**
124
+ * Adjusts the contrast of a view.
125
+ * @param amount - Contrast multiplier (0 to infinity, 1 = normal)
126
+ */
127
+ export const contrast = (amount) => createModifier('contrast', { amount });
128
+ /**
129
+ * Adjusts the saturation of a view.
130
+ * @param amount - Saturation multiplier (0 to infinity, 1 = normal)
131
+ */
132
+ export const saturation = (amount) => createModifier('saturation', { amount });
133
+ /**
134
+ * Applies a hue rotation to a view.
135
+ * @param angle - Hue rotation angle in degrees
136
+ */
137
+ export const hueRotation = (angle) => createModifier('hueRotation', { angle });
138
+ /**
139
+ * Inverts the colors of a view.
140
+ * @param inverted - Whether to invert colors
141
+ */
142
+ export const colorInvert = (inverted = true) => createModifier('colorInvert', { inverted });
143
+ /**
144
+ * Makes a view grayscale.
145
+ * @param amount - Grayscale amount (0 to 1)
146
+ */
147
+ export const grayscale = (amount) => createModifier('grayscale', { amount });
148
+ /**
149
+ * Sets accessibility label for the view.
150
+ * @param label - The accessibility label
151
+ */
152
+ export const accessibilityLabel = (label) => createModifier('accessibilityLabel', { label });
153
+ /**
154
+ * Sets accessibility hint for the view.
155
+ * @param hint - The accessibility hint
156
+ */
157
+ export const accessibilityHint = (hint) => createModifier('accessibilityHint', { hint });
158
+ /**
159
+ * Sets accessibility value for the view.
160
+ * @param value - The accessibility value
161
+ */
162
+ export const accessibilityValue = (value) => createModifier('accessibilityValue', { value });
163
+ /**
164
+ * Sets layout priority for the view.
165
+ * @param priority - Layout priority value
166
+ */
167
+ export const layoutPriority = (priority) => createModifier('layoutPriority', { priority });
168
+ /**
169
+ * Applies a mask to the view.
170
+ * @param shape - The masking shape
171
+ * @param cornerRadius - Corner radius for rounded rectangle (default: 8)
172
+ */
173
+ export const mask = (shape, cornerRadius) => createModifier('mask', { shape, cornerRadius });
174
+ /**
175
+ * Overlays another view on top.
176
+ * @param color - Overlay color
177
+ * @param alignment - Overlay alignment
178
+ */
179
+ export const overlay = (params) => createModifier('overlay', params);
180
+ /**
181
+ * Adds a background behind the view.
182
+ * @param color - Background color
183
+ * @param alignment - Background alignment
184
+ */
185
+ export const backgroundOverlay = (params) => createModifier('backgroundOverlay', params);
186
+ /**
187
+ * Sets aspect ratio constraint.
188
+ * @param ratio - Width/height aspect ratio
189
+ * @param contentMode - How content fits the aspect ratio
190
+ */
191
+ export const aspectRatio = (params) => createModifier('aspectRatio', params);
192
+ /**
193
+ * Clips content to bounds.
194
+ * @param clipped - Whether to clip content
195
+ */
196
+ export const clipped = (clipped = true) => createModifier('clipped', { clipped });
197
+ // =============================================================================
198
+ // Utility Functions
199
+ // =============================================================================
200
+ /**
201
+ * Creates a custom modifier for 3rd party libraries.
202
+ * This function is exported so 3rd party packages can create their own modifiers.
203
+ *
204
+ * @example
205
+ * ```typescript
206
+ * // In a 3rd party package
207
+ * export const blurEffect = (params: { radius: number; style?: string }) =>
208
+ * createModifier('blurEffect', params);
209
+ * ```
210
+ */
211
+ export { createModifier };
212
+ /**
213
+ * Type guard to check if a value is a valid modifier.
214
+ */
215
+ export const isModifier = (value) => {
216
+ return typeof value === 'object' && value !== null && typeof value.$type === 'string';
217
+ };
218
+ /**
219
+ * Filters an array to only include valid modifiers.
220
+ */
221
+ export const filterModifiers = (modifiers) => {
222
+ return modifiers.filter(isModifier);
223
+ };
224
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAY,EAAE,SAA8B,EAAE;IACpE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,SAAS,+BAA+B,CACtC,IAAY,EACZ,aAAkC,EAClC,SAA8B,EAAE;IAEhC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,aAAa,EAAE,CAAC;AACnD,CAAC;AAED,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,cAAc,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AAErF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,cAAc,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAE3F;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAkE,EAAE,EAAE,CAC3F,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;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E,EAAE,CAChG,cAAc,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAGvB,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAGjC,EAAE,EAAE,CAAC,cAAc,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAuD,EAAE,EAAE,CACrF,cAAc,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,UAAmB,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AAoD3F,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAU,EAA2B,EAAE;IAChE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AACxF,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAoB,EAAoB,EAAE;IACxE,OAAO,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC,CAAC","sourcesContent":["/**\n * Core modifier factory and type definitions for SwiftUI view modifiers.\n * This system allows both built-in and 3rd party modifiers to use the same API.\n */\n\n/**\n * Base interface for all view modifiers.\n * All modifiers must have a type field and can include arbitrary parameters.\n */\nexport interface ModifierConfig {\n $type: string;\n [key: string]: any;\n eventListener?: (args: any) => void;\n}\n\n/**\n * Factory function to create modifier configuration objects.\n * This is used internally by all modifier functions.\n */\nfunction createModifier(type: string, params: Record<string, any> = {}): ModifierConfig {\n return { $type: type, ...params };\n}\n\n/**\n * Creates a modifier with an event listener.\n */\nfunction createModifierWithEventListener(\n type: string,\n eventListener: (args: any) => void,\n params: Record<string, any> = {}\n): ModifierConfig {\n return { $type: type, ...params, eventListener };\n}\n\n// =============================================================================\n// Built-in Modifier Functions\n// =============================================================================\n\n/**\n * Sets the background of a view.\n * @param color - The background color (hex string, e.g., '#FF0000')\n */\nexport const background = (color: string) => createModifier('background', { color });\n\n/**\n * Applies corner radius to a view.\n * @param radius - The corner radius value\n */\nexport const cornerRadius = (radius: number) => createModifier('cornerRadius', { radius });\n\n/**\n * Adds a shadow to a view.\n */\nexport const shadow = (params: { radius: number; x?: number; y?: number; color?: string }) =>\n createModifier('shadow', params);\n\n/**\n * Sets the frame properties of a view.\n */\nexport const frame = (params: {\n width?: number;\n height?: number;\n minWidth?: number;\n maxWidth?: number;\n minHeight?: number;\n maxHeight?: number;\n idealWidth?: number;\n idealHeight?: number;\n alignment?:\n | 'center'\n | 'leading'\n | 'trailing'\n | 'top'\n | 'bottom'\n | 'topLeading'\n | 'topTrailing'\n | 'bottomLeading'\n | 'bottomTrailing';\n}) => createModifier('frame', params);\n\n/**\n * Sets padding on a view.\n * Supports individual edges or shorthand properties.\n */\nexport const padding = (params: {\n top?: number;\n bottom?: number;\n leading?: number;\n trailing?: number;\n horizontal?: number;\n vertical?: number;\n all?: number;\n}) => createModifier('padding', params);\n\n/**\n * Controls fixed size behavior.\n * @param enabled - Whether the view should use its natural size\n */\nexport const fixedSize = (enabled: boolean = true) => createModifier('fixedSize', { enabled });\n\n/**\n * Adds a tap gesture recognizer.\n * @param handler - Function to call when tapped\n */\nexport const onTapGesture = (handler: () => void) =>\n createModifierWithEventListener('onTapGesture', handler);\n\n/**\n * Adds a long press gesture recognizer.\n * @param handler - Function to call when long pressed\n * @param minimumDuration - Minimum duration for long press (default: 0.5s)\n */\nexport const onLongPressGesture = (handler: () => void, minimumDuration?: number) =>\n createModifierWithEventListener('onLongPressGesture', handler, {\n minimumDuration: minimumDuration ?? 0.5,\n });\n\n// Note: Complex gesture modifiers like onDragGesture are not available\n// in the modifier system. Use component-level props instead.\n\n/**\n * Sets the opacity of a view.\n * @param value - Opacity value between 0 and 1\n */\nexport const opacity = (value: number) => createModifier('opacity', { value });\n\n/**\n * Clips the view to a specific shape.\n * @param shape - The clipping shape\n * @param cornerRadius - Corner radius for rounded rectangle (default: 8)\n */\nexport const clipShape = (\n shape: 'rectangle' | 'circle' | 'roundedRectangle',\n cornerRadius?: number\n) => createModifier('clipShape', { shape, cornerRadius });\n\n/**\n * Adds a border to a view.\n */\nexport const border = (params: { color: string; width?: number }) =>\n createModifier('border', params);\n\n/**\n * Applies scaling transformation.\n * @param scale - Scale factor (1.0 = normal size)\n */\nexport const scaleEffect = (scale: number) => createModifier('scaleEffect', { scale });\n\n/**\n * Applies rotation transformation.\n * @param angle - Rotation angle in degrees\n */\nexport const rotationEffect = (angle: number) => createModifier('rotationEffect', { angle });\n\n/**\n * Applies an offset (translation) to a view.\n */\nexport const offset = (params: { x?: number; y?: number }) => createModifier('offset', params);\n\n/**\n * Sets the foreground color/tint of a view.\n * @param color - The foreground color (hex string)\n */\nexport const foregroundColor = (color: string) => createModifier('foregroundColor', { color });\n\n/**\n * Sets the tint color of a view.\n * @param color - The tint color (hex string)\n */\nexport const tint = (color: string) => createModifier('tint', { color });\n\n/**\n * Hides or shows a view.\n * @param hidden - Whether the view should be hidden\n */\nexport const hidden = (hidden: boolean = true) => createModifier('hidden', { hidden });\n\n/**\n * Sets the z-index (display order) of a view.\n * @param index - The z-index value\n */\nexport const zIndex = (index: number) => createModifier('zIndex', { index });\n\n/**\n * Applies blur to a view.\n * @param radius - The blur radius\n */\nexport const blur = (radius: number) => createModifier('blur', { radius });\n\n/**\n * Adjusts the brightness of a view.\n * @param amount - Brightness adjustment (-1 to 1)\n */\nexport const brightness = (amount: number) => createModifier('brightness', { amount });\n\n/**\n * Adjusts the contrast of a view.\n * @param amount - Contrast multiplier (0 to infinity, 1 = normal)\n */\nexport const contrast = (amount: number) => createModifier('contrast', { amount });\n\n/**\n * Adjusts the saturation of a view.\n * @param amount - Saturation multiplier (0 to infinity, 1 = normal)\n */\nexport const saturation = (amount: number) => createModifier('saturation', { amount });\n\n/**\n * Applies a hue rotation to a view.\n * @param angle - Hue rotation angle in degrees\n */\nexport const hueRotation = (angle: number) => createModifier('hueRotation', { angle });\n\n/**\n * Inverts the colors of a view.\n * @param inverted - Whether to invert colors\n */\nexport const colorInvert = (inverted: boolean = true) =>\n createModifier('colorInvert', { inverted });\n\n/**\n * Makes a view grayscale.\n * @param amount - Grayscale amount (0 to 1)\n */\nexport const grayscale = (amount: number) => createModifier('grayscale', { amount });\n\n/**\n * Sets accessibility label for the view.\n * @param label - The accessibility label\n */\nexport const accessibilityLabel = (label: string) =>\n createModifier('accessibilityLabel', { label });\n\n/**\n * Sets accessibility hint for the view.\n * @param hint - The accessibility hint\n */\nexport const accessibilityHint = (hint: string) => createModifier('accessibilityHint', { hint });\n\n/**\n * Sets accessibility value for the view.\n * @param value - The accessibility value\n */\nexport const accessibilityValue = (value: string) =>\n createModifier('accessibilityValue', { value });\n\n/**\n * Sets layout priority for the view.\n * @param priority - Layout priority value\n */\nexport const layoutPriority = (priority: number) => createModifier('layoutPriority', { priority });\n\n/**\n * Applies a mask to the view.\n * @param shape - The masking shape\n * @param cornerRadius - Corner radius for rounded rectangle (default: 8)\n */\nexport const mask = (shape: 'rectangle' | 'circle' | 'roundedRectangle', cornerRadius?: number) =>\n createModifier('mask', { shape, cornerRadius });\n\n/**\n * Overlays another view on top.\n * @param color - Overlay color\n * @param alignment - Overlay alignment\n */\nexport const overlay = (params: {\n color?: string;\n alignment?: 'center' | 'top' | 'bottom' | 'leading' | 'trailing';\n}) => createModifier('overlay', params);\n\n/**\n * Adds a background behind the view.\n * @param color - Background color\n * @param alignment - Background alignment\n */\nexport const backgroundOverlay = (params: {\n color?: string;\n alignment?: 'center' | 'top' | 'bottom' | 'leading' | 'trailing';\n}) => createModifier('backgroundOverlay', params);\n\n/**\n * Sets aspect ratio constraint.\n * @param ratio - Width/height aspect ratio\n * @param contentMode - How content fits the aspect ratio\n */\nexport const aspectRatio = (params: { ratio: number; contentMode?: 'fit' | 'fill' }) =>\n createModifier('aspectRatio', params);\n\n/**\n * Clips content to bounds.\n * @param clipped - Whether to clip content\n */\nexport const clipped = (clipped: boolean = true) => createModifier('clipped', { clipped });\n\n// =============================================================================\n// Type Definitions\n// =============================================================================\n\n/**\n * Union type of all built-in modifier return types.\n * This provides type safety for the modifiers array.\n */\nexport type BuiltInModifier =\n | ReturnType<typeof background>\n | ReturnType<typeof cornerRadius>\n | ReturnType<typeof shadow>\n | ReturnType<typeof frame>\n | ReturnType<typeof padding>\n | ReturnType<typeof fixedSize>\n | ReturnType<typeof onTapGesture>\n | ReturnType<typeof onLongPressGesture>\n | ReturnType<typeof opacity>\n | ReturnType<typeof clipShape>\n | ReturnType<typeof border>\n | ReturnType<typeof scaleEffect>\n | ReturnType<typeof rotationEffect>\n | ReturnType<typeof offset>\n | ReturnType<typeof foregroundColor>\n | ReturnType<typeof tint>\n | ReturnType<typeof hidden>\n | ReturnType<typeof zIndex>\n | ReturnType<typeof blur>\n | ReturnType<typeof brightness>\n | ReturnType<typeof contrast>\n | ReturnType<typeof saturation>\n | ReturnType<typeof hueRotation>\n | ReturnType<typeof colorInvert>\n | ReturnType<typeof grayscale>\n | ReturnType<typeof accessibilityLabel>\n | ReturnType<typeof accessibilityHint>\n | ReturnType<typeof accessibilityValue>\n | ReturnType<typeof layoutPriority>\n | ReturnType<typeof mask>\n | ReturnType<typeof overlay>\n | ReturnType<typeof backgroundOverlay>\n | ReturnType<typeof aspectRatio>\n | ReturnType<typeof clipped>;\n\n/**\n * Main ViewModifier type that supports both built-in and 3rd party modifiers.\n * 3rd party modifiers should return ModifierConfig objects with their own type strings.\n */\nexport type ViewModifier = BuiltInModifier | ModifierConfig;\n\n// =============================================================================\n// Utility Functions\n// =============================================================================\n\n/**\n * Creates a custom modifier for 3rd party libraries.\n * This function is exported so 3rd party packages can create their own modifiers.\n *\n * @example\n * ```typescript\n * // In a 3rd party package\n * export const blurEffect = (params: { radius: number; style?: string }) =>\n * createModifier('blurEffect', params);\n * ```\n */\nexport { createModifier };\n\n/**\n * Type guard to check if a value is a valid modifier.\n */\nexport const isModifier = (value: any): value is ModifierConfig => {\n return typeof value === 'object' && value !== null && typeof value.$type === 'string';\n};\n\n/**\n * Filters an array to only include valid modifiers.\n */\nexport const filterModifiers = (modifiers: unknown[]): ModifierConfig[] => {\n return modifiers.filter(isModifier);\n};\n"]}
@@ -0,0 +1,15 @@
1
+ import { type ModifierConfig } from './index';
2
+ type GlobalEventPayload = {
3
+ [eventName: string]: Record<string, any>;
4
+ };
5
+ type GlobalEvent = {
6
+ onGlobalEvent: (event: {
7
+ nativeEvent: GlobalEventPayload;
8
+ }) => void;
9
+ };
10
+ /**
11
+ * Create an event listener for a view modifier.
12
+ */
13
+ export declare function createViewModifierEventListener(modifiers: ModifierConfig[]): GlobalEvent;
14
+ export {};
15
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,KAAK,kBAAkB,GAAG;IACxB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC1C,CAAC;AACF,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,kBAAkB,CAAA;KAAE,KAAK,IAAI,CAAC;CACrE,CAAC;AAEF;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,WAAW,CAoBxF"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Create an event listener for a view modifier.
3
+ */
4
+ export function createViewModifierEventListener(modifiers) {
5
+ const eventListeners = {};
6
+ for (const modifier of modifiers) {
7
+ if (modifier.eventListener) {
8
+ eventListeners[modifier.$type] = modifier.eventListener;
9
+ }
10
+ }
11
+ const onGlobalEvent = ({ nativeEvent }) => {
12
+ for (const [eventName, params] of Object.entries(nativeEvent)) {
13
+ const listener = eventListeners[eventName];
14
+ if (listener) {
15
+ listener(params);
16
+ }
17
+ }
18
+ };
19
+ return {
20
+ onGlobalEvent,
21
+ };
22
+ }
23
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/utils.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,UAAU,+BAA+B,CAAC,SAA2B;IACzE,MAAM,cAAc,GAAwC,EAAE,CAAC;IAC/D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC3B,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,MAAM,aAAa,GAAiC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;QACtE,KAAK,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YAC9D,MAAM,QAAQ,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;YAC3C,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,aAAa;KACd,CAAC;AACJ,CAAC","sourcesContent":["import { type ModifierConfig } from './index';\n\ntype GlobalEventPayload = {\n [eventName: string]: Record<string, any>;\n};\ntype GlobalEvent = {\n onGlobalEvent: (event: { nativeEvent: GlobalEventPayload }) => void;\n};\n\n/**\n * Create an event listener for a view modifier.\n */\nexport function createViewModifierEventListener(modifiers: ModifierConfig[]): GlobalEvent {\n const eventListeners: Record<string, (args: any) => void> = {};\n for (const modifier of modifiers) {\n if (modifier.eventListener) {\n eventListeners[modifier.$type] = modifier.eventListener;\n }\n }\n\n const onGlobalEvent: GlobalEvent['onGlobalEvent'] = ({ nativeEvent }) => {\n for (const [eventName, params] of Object.entries(nativeEvent)) {\n const listener = eventListeners[eventName];\n if (listener) {\n listener(params);\n }\n }\n };\n\n return {\n onGlobalEvent,\n };\n}\n"]}
@@ -65,21 +65,64 @@ export interface PaddingProps {
65
65
  */
66
66
  export interface CommonViewModifierProps {
67
67
  /**
68
- * Whether the view should take its natural size.
69
- * When true, the view will ignore frame constraints and use its intrinsic size.
68
+ * @deprecated Use `fixedSize()` modifier instead. This prop will be removed in a future version.
69
+ * @example
70
+ * ```tsx
71
+ * // Old way (deprecated)
72
+ * <Text fixedSize={true}>Hello</Text>
73
+ *
74
+ * // New way (recommended)
75
+ * <Text modifiers={[fixedSize(true)]}>Hello</Text>
76
+ * ```
70
77
  */
71
78
  fixedSize?: boolean;
72
79
  /**
73
- * Frame properties for the view container.
80
+ * @deprecated Use `frame()` modifier instead. This prop will be removed in a future version.
81
+ * @example
82
+ * ```tsx
83
+ * // Old way (deprecated)
84
+ * <Text frame={{ width: 100, height: 50 }}>Hello</Text>
85
+ *
86
+ * // New way (recommended)
87
+ * <Text modifiers={[frame({ width: 100, height: 50 })]}>Hello</Text>
88
+ * ```
74
89
  */
75
90
  frame?: FrameProps;
76
91
  /**
77
- * Padding properties for the view.
92
+ * @deprecated Use `padding()` modifier instead. This prop will be removed in a future version.
93
+ * @example
94
+ * ```tsx
95
+ * // Old way (deprecated)
96
+ * <Text padding={{ all: 16 }}>Hello</Text>
97
+ *
98
+ * // New way (recommended)
99
+ * <Text modifiers={[padding({ all: 16 })]}>Hello</Text>
100
+ * ```
78
101
  */
79
102
  padding?: PaddingProps;
80
103
  /**
81
104
  * Used to locate this view in end-to-end tests.
82
105
  */
83
106
  testID?: string;
107
+ /**
108
+ * Array of view modifiers to apply to this view.
109
+ * Modifiers are applied in the order they appear in the array.
110
+ *
111
+ * @example
112
+ * ```tsx
113
+ * import { background, cornerRadius, shadow, frame, padding, fixedSize } from 'expo-ui/swift-ui/modifiers';
114
+ *
115
+ * <Text modifiers={[
116
+ * background('#FF0000'),
117
+ * cornerRadius(10),
118
+ * padding({ all: 16 }),
119
+ * frame({ width: 200 }),
120
+ * shadow({ radius: 5, x: 0, y: 2 })
121
+ * ]}>
122
+ * Hello World
123
+ * </Text>
124
+ * ```
125
+ */
126
+ modifiers?: import('./modifiers').ViewModifier[];
84
127
  }
85
128
  //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/swift-ui/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EACN,QAAQ,GACR,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,CAAC;CAC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