@expo/ui 55.0.2 → 55.0.3

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 (193) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
  4. package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
  5. package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
  6. package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
  7. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +258 -70
  8. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
  9. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +44 -1
  10. package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
  11. package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
  12. package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
  13. package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
  14. package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
  15. package/android/src/main/java/expo/modules/ui/SwitchView.kt +53 -161
  16. package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
  17. package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
  18. package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
  19. package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -86
  20. package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
  21. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
  22. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
  23. package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
  24. package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
  25. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
  26. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
  27. package/build/jetpack-compose/Button/index.d.ts +65 -51
  28. package/build/jetpack-compose/Button/index.d.ts.map +1 -1
  29. package/build/jetpack-compose/Card/index.d.ts +72 -14
  30. package/build/jetpack-compose/Card/index.d.ts.map +1 -1
  31. package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
  32. package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
  33. package/build/jetpack-compose/Chip/index.d.ts +247 -27
  34. package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
  35. package/build/jetpack-compose/DatePicker/index.d.ts +38 -3
  36. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  37. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
  38. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
  39. package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
  40. package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
  41. package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
  42. package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
  43. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
  44. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
  45. package/build/jetpack-compose/IconButton/index.d.ts +45 -29
  46. package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
  47. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
  48. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  49. package/build/jetpack-compose/Progress/index.d.ts +78 -35
  50. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  51. package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
  52. package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
  53. package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
  54. package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
  55. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
  56. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  57. package/build/jetpack-compose/Slider/index.d.ts +34 -10
  58. package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
  59. package/build/jetpack-compose/Switch/index.d.ts +10 -50
  60. package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
  61. package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
  62. package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
  63. package/build/jetpack-compose/index.d.ts +5 -4
  64. package/build/jetpack-compose/index.d.ts.map +1 -1
  65. package/build/jetpack-compose/modifiers/index.d.ts +18 -1
  66. package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
  67. package/build/swift-ui/ProgressView/index.d.ts +1 -5
  68. package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
  69. package/build/swift-ui/Stepper/index.d.ts +3 -3
  70. package/build/swift-ui/Stepper/index.d.ts.map +1 -1
  71. package/build/swift-ui/Text/index.d.ts +33 -1
  72. package/build/swift-ui/Text/index.d.ts.map +1 -1
  73. package/build/swift-ui/modifiers/index.d.ts +22 -1
  74. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  75. package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
  76. package/build/swift-ui/types.d.ts +7 -0
  77. package/build/swift-ui/types.d.ts.map +1 -1
  78. package/expo-module.config.json +1 -1
  79. package/ios/BottomSheetView.swift +1 -6
  80. package/ios/ClosedRangeDateRecord.swift +10 -0
  81. package/ios/ColorPickerView.swift +9 -8
  82. package/ios/ConfirmationDialog/ConfirmationDialog.swift +4 -6
  83. package/ios/DatePickerView.swift +7 -5
  84. package/ios/DisclosureGroupView.swift +5 -7
  85. package/ios/ListView.swift +6 -14
  86. package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
  87. package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
  88. package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
  89. package/ios/Picker/PickerView.swift +6 -10
  90. package/ios/Popover/PopoverView.swift +3 -5
  91. package/ios/ProgressView.swift +0 -5
  92. package/ios/SectionView.swift +3 -5
  93. package/ios/SliderView.swift +8 -6
  94. package/ios/StepperView.swift +12 -16
  95. package/ios/TextView.swift +37 -1
  96. package/ios/Toggle/ToggleView.swift +5 -7
  97. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
  98. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
  99. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
  100. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
  101. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
  102. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
  103. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
  104. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
  105. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
  106. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
  107. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.module → 55.0.3/expo.modules.ui-55.0.3.module} +22 -22
  108. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
  109. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
  110. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
  111. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
  112. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.pom → 55.0.3/expo.modules.ui-55.0.3.pom} +1 -1
  113. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
  114. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
  115. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
  116. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha512 +1 -0
  117. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  118. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  119. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  120. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  121. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  122. package/package.json +5 -2
  123. package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
  124. package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
  125. package/src/jetpack-compose/Button/index.tsx +69 -92
  126. package/src/jetpack-compose/Card/index.tsx +105 -29
  127. package/src/jetpack-compose/Checkbox/index.tsx +126 -0
  128. package/src/jetpack-compose/Chip/index.tsx +391 -51
  129. package/src/jetpack-compose/DatePicker/index.tsx +112 -7
  130. package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
  131. package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
  132. package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
  133. package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
  134. package/src/jetpack-compose/IconButton/index.tsx +49 -56
  135. package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
  136. package/src/jetpack-compose/Progress/index.tsx +120 -62
  137. package/src/jetpack-compose/RadioButton/index.tsx +8 -9
  138. package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
  139. package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
  140. package/src/jetpack-compose/Slider/index.tsx +76 -29
  141. package/src/jetpack-compose/Switch/index.tsx +17 -87
  142. package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
  143. package/src/jetpack-compose/index.ts +5 -4
  144. package/src/jetpack-compose/modifiers/index.ts +26 -2
  145. package/src/swift-ui/ProgressView/index.tsx +1 -3
  146. package/src/swift-ui/Stepper/index.tsx +7 -7
  147. package/src/swift-ui/Text/index.tsx +66 -2
  148. package/src/swift-ui/modifiers/index.ts +40 -0
  149. package/src/swift-ui/types.ts +5 -0
  150. package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
  151. package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
  152. package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
  153. package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
  154. package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
  155. package/build/jetpack-compose/Button/types.d.ts +0 -5
  156. package/build/jetpack-compose/Button/types.d.ts.map +0 -1
  157. package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
  158. package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
  159. package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
  160. package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
  161. package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
  162. package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
  163. package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
  164. package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
  165. package/build/jetpack-compose/Picker/index.d.ts +0 -62
  166. package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
  167. package/build/jetpack-compose/TextButton/index.d.ts +0 -29
  168. package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
  169. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar +0 -0
  170. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.md5 +0 -1
  171. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha1 +0 -1
  172. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha256 +0 -1
  173. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha512 +0 -1
  174. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar +0 -0
  175. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.md5 +0 -1
  176. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha1 +0 -1
  177. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha256 +0 -1
  178. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha512 +0 -1
  179. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.md5 +0 -1
  180. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha1 +0 -1
  181. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha256 +0 -1
  182. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha512 +0 -1
  183. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.md5 +0 -1
  184. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha1 +0 -1
  185. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha256 +0 -1
  186. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha512 +0 -1
  187. package/src/jetpack-compose/Button/types.ts +0 -57
  188. package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
  189. package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
  190. package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
  191. package/src/jetpack-compose/FilterChip/index.tsx +0 -89
  192. package/src/jetpack-compose/Picker/index.tsx +0 -90
  193. package/src/jetpack-compose/TextButton/index.tsx +0 -55
package/CHANGELOG.md CHANGED
@@ -10,12 +10,41 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 55.0.3 — 2026-03-17
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - [iOS] Renamed Stepper `defaultValue` to `value` and `onValueChanged` to `onValueChange`. ([#43954](https://github.com/expo/expo/pull/43954) by [@nishan](https://github.com/intergalacticspacehighway))
18
+ - [android] Replace `Picker` with `SingleChoiceSegmentedButtonRow`, `MultiChoiceSegmentedButtonRow`, and `SegmentedButton` components. Replace `RadioButton` `nativeClickable` prop with `onClick` event. ([#43809](https://github.com/expo/expo/pull/43809) by [@nishan](https://github.com/intergalacticspacehighway))
19
+ - [android] Split `ToggleButton` into separate M3 components: `ToggleButton`, `IconToggleButton`, `FilledIconToggleButton`, `OutlinedIconToggleButton`. Removed `variant`, `text`, `color`, `disabled` props. Added `colors` with checked/unchecked variants. ([#43974](https://github.com/expo/expo/pull/43974) by [@nishan](https://github.com/intergalacticspacehighway))
20
+ - [android] Match `Switch` API to native: removed `variant` prop and split into separate `Switch` and `Checkbox` components matching native M3 APIs. Renamed `elementColors` to `colors`, `onValueChange` to `onCheckedChange`, removed `color` convenience prop. ([#43887](https://github.com/expo/expo/pull/43887) by [@nishan](https://github.com/intergalacticspacehighway))
21
+ - [android] Refactored Progress Indicators to match native Compose API: split into `LinearProgressIndicator`, `CircularProgressIndicator`, `LinearWavyProgressIndicator`, `CircularWavyProgressIndicator`. Flattened `elementColors.trackColor` to `trackColor`. Added `strokeCap`, `gapSize`, `strokeWidth` props. ([#43907](https://github.com/expo/expo/pull/43907) by [@nishan](https://github.com/intergalacticspacehighway))
22
+ - [android] Refactored `Card` to match native Material3 API: split into `Card`/`ElevatedCard`/`OutlinedCard` with type-specific props (`elevation`, `border`). ([#43896](https://github.com/expo/expo/pull/43896) by [@nishan](https://github.com/intergalacticspacehighway))
23
+ - [android] Split `Button` into separate M3 components: `Button`, `FilledTonalButton`, `OutlinedButton`, `ElevatedButton`, `TextButton`. Removed `variant`, `text`, `leadingIcon`, `trailingIcon`, `color`, `elementColors`, `disabled` props. ([#43859](https://github.com/expo/expo/pull/43859) by [@nishan](https://github.com/intergalacticspacehighway))
24
+ - [android] Split `IconButton` into separate M3 components: `IconButton`, `FilledIconButton`, `FilledTonalIconButton`, `OutlinedIconButton`. Removed `variant`, `color`, `elementColors`, `disabled`, `onPress` props. ([#43859](https://github.com/expo/expo/pull/43859) by [@nishan](https://github.com/intergalacticspacehighway))
25
+ - [android] Refactored `Chip` to match native Material3 API: split into `AssistChip`/`FilterChip`/`InputChip`/`SuggestionChip` with slot-based content, added `colors`/`elevation`/`border` props. Merged `FilterChip` into `Chip` module. ([#43900](https://github.com/expo/expo/pull/43900) by [@nishan](https://github.com/intergalacticspacehighway))
26
+ - [android] Refactored `Slider` to match native Material3 API: renamed `elementColors` to `colors`, removed `color` convenience prop. ([#43840](https://github.com/expo/expo/pull/43840) by [@nishan](https://github.com/intergalacticspacehighway))
27
+ - [android] rename ContextMenu to DropdownMenu ([#43794](https://github.com/expo/expo/pull/43794) by [@Ubax](https://github.com/Ubax))
28
+ - [android] configure ContextMenu by using native children ([#43792](https://github.com/expo/expo/pull/43792) by [@Ubax](https://github.com/Ubax))
29
+ - [android] control ContextMenu expanded state from JS ([#43793](https://github.com/expo/expo/pull/43793) by [@Ubax](https://github.com/Ubax))
30
+
31
+ ### 🎉 New features
32
+
33
+ - [iOS] Added `date`, `dateStyle`, `timerInterval`, `countsDown`, and `pauseTime` props to `Text` component for displaying auto-updating dates, timers, and countdowns using SwiftUI's `Text.DateStyle`. ([#43552](https://github.com/expo/expo/pull/43552) by [@LouisRaverdy](https://github.com/LouisRaverdy))
34
+ - [android] Added `Checkbox` and `TriStateCheckbox` components. ([#43887](https://github.com/expo/expo/pull/43887) by [@nishan](https://github.com/intergalacticspacehighway))
35
+ - [Android] Added `DatePickerDialog` and `TimePickerDialog` components, and `selectableDates` prop to `DateTimePicker`. ([#43895](https://github.com/expo/expo/pull/43895) by [@vonovak](https://github.com/vonovak))
36
+ - [android] Added `FloatingActionButton` component. ([#43738](https://github.com/expo/expo/pull/43738) by [@benjaminkomen](https://github.com/benjaminkomen))
37
+ - [android] Added `enabled`, `onValueChangeFinished`, and `Slider.Thumb`/`Slider.Track` slot support to `Slider` component. ([#43840](https://github.com/expo/expo/pull/43840) by [@nishan](https://github.com/intergalacticspacehighway))
38
+ - [android] add AnimatedVisibility transition API ([#43632](https://github.com/expo/expo/pull/43632) by [@Ubax](https://github.com/Ubax))
39
+
13
40
  ## 55.0.2 — 2026-03-11
14
41
 
15
42
  ### 🎉 New features
16
43
 
17
44
  - [Android] Added `graphicsLayer` modifier and animation helpers for per-value animation in it. Added `indication` option to `clickable` modifier to control ripple effects. ([#43655](https://github.com/expo/expo/pull/43655) by [@vonovak](https://github.com/vonovak))
18
45
  - [Android] Added border color customization for `Switch` and `Checkbox` components. ([#43770](https://github.com/expo/expo/pull/43770) by [@liestig](https://github.com/liestig))
46
+ - [iOS] Added `defaultScrollAnchor` modifier for controlling initial scroll position (iOS 17+). ([#43914](https://github.com/expo/expo/pull/43914) by [@ramonclaudio](https://github.com/ramonclaudio))
47
+ - [iOS] Added `defaultScrollAnchorForRole` modifier for per-role scroll anchor control (iOS 18+). ([#43923](https://github.com/expo/expo/pull/43923) by [@ramonclaudio](https://github.com/ramonclaudio))
19
48
  - [iOS] Added `rotation3DEffect` modifier for 3D rotation transforms ([#43640](https://github.com/expo/expo/pull/43640) by [@vonovak](https://github.com/vonovak))
20
49
  - [iOS] Added `ControlGroup` component. ([#43581](https://github.com/expo/expo/pull/43581) by [@nishan](https://github.com/intergalacticspacehighway))
21
50
  - [android] detect FAB in HorizontalFloatingToolbar ([#43601](https://github.com/expo/expo/pull/43601) by [@Ubax](https://github.com/Ubax))
@@ -25,6 +54,8 @@
25
54
 
26
55
  ### 🐛 Bug fixes
27
56
 
57
+ - [iOS] Fix initial prop values not being applied since `init` runs before `updateProps`. ([#43954](https://github.com/expo/expo/pull/43954) by [@nishan](https://github.com/intergalacticspacehighway))
58
+ - [iOS] Fix prop syncing race condition where stale values override user interactions. Replace `onReceive(Sequence.publisher)` with `onAppear` + `onChange` across all SwiftUI views. ([#43954](https://github.com/expo/expo/pull/43954) by [@nishan](https://github.com/intergalacticspacehighway))
28
59
  - [iOS] Fix `Slider` thumb snapping back during drag by guarding `.onReceive` with `isEditing` state. ([#43701](https://github.com/expo/expo/issues/43701) by [@fedeciancaglini](https://github.com/fedeciancaglini)) ([#43797](https://github.com/expo/expo/pull/43797) by [@fedeciancaglini](https://github.com/fedeciancaglini))
29
60
  - [Android] Fix touch events for RN views inside Compose BottomSheet. ([#43716](https://github.com/expo/expo/pull/43716) by [@nishan](https://github.com/intergalacticspacehighway))
30
61
  - [Android] Fix `RNHostView` child parent related crash. ([#43691](https://github.com/expo/expo/pull/43691) by [@nishan](https://github.com/intergalacticspacehighway))
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
12
12
  apply plugin: 'org.jetbrains.kotlin.plugin.compose'
13
13
 
14
14
  group = 'expo.modules.ui'
15
- version = '55.0.2'
15
+ version = '55.0.3'
16
16
 
17
17
  android {
18
18
  namespace "expo.modules.ui"
19
19
  defaultConfig {
20
20
  versionCode 1
21
- versionName "55.0.2"
21
+ versionName "55.0.3"
22
22
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
23
23
  }
24
24
  buildFeatures {
@@ -0,0 +1,130 @@
1
+ package expo.modules.ui
2
+
3
+ import androidx.compose.animation.AnimatedVisibility
4
+ import androidx.compose.animation.EnterTransition
5
+ import androidx.compose.animation.ExitTransition
6
+ import androidx.compose.animation.expandHorizontally
7
+ import androidx.compose.animation.expandIn
8
+ import androidx.compose.animation.expandVertically
9
+ import androidx.compose.animation.fadeIn
10
+ import androidx.compose.animation.fadeOut
11
+ import androidx.compose.animation.scaleIn
12
+ import androidx.compose.animation.scaleOut
13
+ import androidx.compose.animation.shrinkHorizontally
14
+ import androidx.compose.animation.shrinkOut
15
+ import androidx.compose.animation.shrinkVertically
16
+ import androidx.compose.animation.slideInHorizontally
17
+ import androidx.compose.animation.slideInVertically
18
+ import androidx.compose.animation.slideOutHorizontally
19
+ import androidx.compose.animation.slideOutVertically
20
+ import androidx.compose.runtime.Composable
21
+ import expo.modules.kotlin.records.Field
22
+ import expo.modules.kotlin.records.Record
23
+ import expo.modules.kotlin.types.Enumerable
24
+ import expo.modules.kotlin.views.ComposableScope
25
+ import expo.modules.kotlin.views.ComposeProps
26
+ import expo.modules.kotlin.views.FunctionalComposableScope
27
+
28
+ // region Transition types
29
+
30
+ enum class EnterTransitionType(val value: String) : Enumerable {
31
+ FADE_IN("fadeIn"),
32
+ SLIDE_IN_HORIZONTALLY("slideInHorizontally"),
33
+ SLIDE_IN_VERTICALLY("slideInVertically"),
34
+ EXPAND_IN("expandIn"),
35
+ EXPAND_HORIZONTALLY("expandHorizontally"),
36
+ EXPAND_VERTICALLY("expandVertically"),
37
+ SCALE_IN("scaleIn")
38
+ }
39
+
40
+ enum class ExitTransitionType(val value: String) : Enumerable {
41
+ FADE_OUT("fadeOut"),
42
+ SLIDE_OUT_HORIZONTALLY("slideOutHorizontally"),
43
+ SLIDE_OUT_VERTICALLY("slideOutVertically"),
44
+ SHRINK_OUT("shrinkOut"),
45
+ SHRINK_HORIZONTALLY("shrinkHorizontally"),
46
+ SHRINK_VERTICALLY("shrinkVertically"),
47
+ SCALE_OUT("scaleOut")
48
+ }
49
+
50
+ data class EnterTransitionRecord(
51
+ @Field val type: EnterTransitionType = EnterTransitionType.FADE_IN,
52
+ @Field val initialAlpha: Float? = null,
53
+ @Field val initialOffsetX: Float? = null,
54
+ @Field val initialOffsetY: Float? = null,
55
+ @Field val initialScale: Float? = null
56
+ ) : Record
57
+
58
+ data class ExitTransitionRecord(
59
+ @Field val type: ExitTransitionType = ExitTransitionType.FADE_OUT,
60
+ @Field val targetAlpha: Float? = null,
61
+ @Field val targetOffsetX: Float? = null,
62
+ @Field val targetOffsetY: Float? = null,
63
+ @Field val targetScale: Float? = null
64
+ ) : Record
65
+
66
+ // endregion
67
+
68
+ // region Transition conversion
69
+
70
+ // TODO(@ubax): expose animationSpec parameter (tween, spring, duration) for all transitions
71
+ private fun EnterTransitionRecord.toComposeTransition(): EnterTransition = when (type) {
72
+ EnterTransitionType.FADE_IN ->
73
+ if (initialAlpha != null) fadeIn(initialAlpha = initialAlpha) else fadeIn()
74
+ EnterTransitionType.SLIDE_IN_HORIZONTALLY ->
75
+ if (initialOffsetX != null) slideInHorizontally { (it * initialOffsetX).toInt() } else slideInHorizontally()
76
+ EnterTransitionType.SLIDE_IN_VERTICALLY ->
77
+ if (initialOffsetY != null) slideInVertically { (it * initialOffsetY).toInt() } else slideInVertically()
78
+ // TODO(@ubax): expose expandFrom (Alignment) and initialSize parameters for expand transitions
79
+ EnterTransitionType.EXPAND_IN -> expandIn()
80
+ EnterTransitionType.EXPAND_HORIZONTALLY -> expandHorizontally()
81
+ EnterTransitionType.EXPAND_VERTICALLY -> expandVertically()
82
+ EnterTransitionType.SCALE_IN ->
83
+ if (initialScale != null) scaleIn(initialScale = initialScale) else scaleIn()
84
+ }
85
+
86
+ private fun ExitTransitionRecord.toComposeTransition(): ExitTransition = when (type) {
87
+ ExitTransitionType.FADE_OUT ->
88
+ if (targetAlpha != null) fadeOut(targetAlpha = targetAlpha) else fadeOut()
89
+ ExitTransitionType.SLIDE_OUT_HORIZONTALLY ->
90
+ if (targetOffsetX != null) slideOutHorizontally { (it * targetOffsetX).toInt() } else slideOutHorizontally()
91
+ ExitTransitionType.SLIDE_OUT_VERTICALLY ->
92
+ if (targetOffsetY != null) slideOutVertically { (it * targetOffsetY).toInt() } else slideOutVertically()
93
+ // TODO(@ubax): expose shrinkTowards (Alignment) and targetSize parameters for shrink transitions
94
+ ExitTransitionType.SHRINK_OUT -> shrinkOut()
95
+ ExitTransitionType.SHRINK_HORIZONTALLY -> shrinkHorizontally()
96
+ ExitTransitionType.SHRINK_VERTICALLY -> shrinkVertically()
97
+ ExitTransitionType.SCALE_OUT ->
98
+ if (targetScale != null) scaleOut(targetScale = targetScale) else scaleOut()
99
+ }
100
+
101
+ private fun List<EnterTransitionRecord>.toComposedEnterTransition(): EnterTransition? =
102
+ map { it.toComposeTransition() }.reduceOrNull { acc, transition -> acc + transition }
103
+
104
+ private fun List<ExitTransitionRecord>.toComposedExitTransition(): ExitTransition? =
105
+ map { it.toComposeTransition() }.reduceOrNull { acc, transition -> acc + transition }
106
+
107
+ // endregion
108
+
109
+ data class AnimatedVisibilityProps(
110
+ val visible: Boolean = true,
111
+ val enterTransition: List<EnterTransitionRecord>? = null,
112
+ val exitTransition: List<ExitTransitionRecord>? = null,
113
+ val modifiers: ModifierList = emptyList()
114
+ ) : ComposeProps
115
+
116
+ @Composable
117
+ fun FunctionalComposableScope.AnimatedVisibilityContent(props: AnimatedVisibilityProps) {
118
+ val enter = props.enterTransition?.takeIf { it.isNotEmpty() }?.toComposedEnterTransition()
119
+ val exit = props.exitTransition?.takeIf { it.isNotEmpty() }?.toComposedExitTransition()
120
+
121
+ AnimatedVisibility(
122
+ visible = props.visible,
123
+ enter = enter ?: (fadeIn() + expandIn()),
124
+ exit = exit ?: (fadeOut() + shrinkOut()),
125
+ modifier = ModifierRegistry
126
+ .applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
127
+ ) {
128
+ Children(ComposableScope())
129
+ }
130
+ }
@@ -1,12 +1,14 @@
1
1
  package expo.modules.ui
2
2
 
3
3
  import android.graphics.Color
4
+ import androidx.compose.foundation.BorderStroke
4
5
  import androidx.compose.foundation.layout.ColumnScope
5
6
  import androidx.compose.material3.Card
6
7
  import androidx.compose.material3.CardDefaults
7
8
  import androidx.compose.material3.ElevatedCard
8
9
  import androidx.compose.material3.OutlinedCard
9
10
  import androidx.compose.runtime.Composable
11
+ import androidx.compose.ui.unit.dp
10
12
  import expo.modules.kotlin.records.Field
11
13
  import expo.modules.kotlin.records.Record
12
14
  import expo.modules.kotlin.views.ComposableScope
@@ -14,15 +16,22 @@ import expo.modules.kotlin.views.ComposeProps
14
16
  import expo.modules.kotlin.views.FunctionalComposableScope
15
17
  import expo.modules.kotlin.views.with
16
18
 
17
- data class CardElementColors(
19
+ data class CardColors(
18
20
  @Field val containerColor: Color? = null,
19
21
  @Field val contentColor: Color? = null
20
22
  ) : Record
21
23
 
24
+ data class CardBorder(
25
+ @Field val width: Float = 1f,
26
+ @Field val color: Color? = null
27
+ ) : Record
28
+
29
+ // region Card
30
+
22
31
  data class CardProps(
23
- val variant: String = "default",
24
- val color: Color? = null,
25
- val elementColors: CardElementColors? = null,
32
+ val colors: CardColors = CardColors(),
33
+ val elevation: Float? = null,
34
+ val border: CardBorder? = null,
26
35
  val modifiers: ModifierList = emptyList()
27
36
  ) : ComposeProps
28
37
 
@@ -30,15 +39,29 @@ data class CardProps(
30
39
  fun FunctionalComposableScope.CardContent(props: CardProps) {
31
40
  val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
32
41
 
33
- val colors = when {
34
- props.elementColors != null -> CardDefaults.cardColors(
35
- containerColor = props.elementColors.containerColor?.compose ?: androidx.compose.ui.graphics.Color.Unspecified,
36
- contentColor = props.elementColors.contentColor?.compose ?: androidx.compose.ui.graphics.Color.Unspecified
37
- )
38
- props.color != null -> CardDefaults.cardColors(
39
- containerColor = props.color.compose
40
- )
41
- else -> CardDefaults.cardColors()
42
+ val defaults = CardDefaults.cardColors()
43
+ val colors = CardDefaults.cardColors(
44
+ containerColor = props.colors.containerColor.composeOrNull
45
+ ?: defaults.containerColor,
46
+ contentColor = props.colors.contentColor.composeOrNull
47
+ ?: defaults.contentColor
48
+ )
49
+
50
+ val elevation = if (props.elevation != null) {
51
+ CardDefaults.cardElevation(defaultElevation = props.elevation.dp)
52
+ } else {
53
+ CardDefaults.cardElevation()
54
+ }
55
+
56
+ val border = if (props.border != null) {
57
+ val borderColor = props.border.color.composeOrNull
58
+ if (borderColor != null) {
59
+ BorderStroke(props.border.width.dp, borderColor)
60
+ } else {
61
+ BorderStroke(props.border.width.dp, CardDefaults.outlinedCardBorder().brush)
62
+ }
63
+ } else {
64
+ null
42
65
  }
43
66
 
44
67
  val content: @Composable ColumnScope.() -> Unit = {
@@ -46,27 +69,108 @@ fun FunctionalComposableScope.CardContent(props: CardProps) {
46
69
  Children(scope)
47
70
  }
48
71
 
49
- when (props.variant) {
50
- "elevated" -> {
51
- ElevatedCard(
52
- modifier = modifier,
53
- colors = colors,
54
- content = content
55
- )
56
- }
57
- "outlined" -> {
58
- OutlinedCard(
59
- modifier = modifier,
60
- colors = colors,
61
- content = content
62
- )
63
- }
64
- else -> {
65
- Card(
66
- modifier = modifier,
67
- colors = colors,
68
- content = content
69
- )
72
+ Card(
73
+ modifier = modifier,
74
+ colors = colors,
75
+ elevation = elevation,
76
+ border = border,
77
+ content = content
78
+ )
79
+ }
80
+
81
+ // endregion
82
+
83
+ // region ElevatedCard
84
+
85
+ data class ElevatedCardProps(
86
+ val colors: CardColors = CardColors(),
87
+ val elevation: Float? = null,
88
+ val modifiers: ModifierList = emptyList()
89
+ ) : ComposeProps
90
+
91
+ @Composable
92
+ fun FunctionalComposableScope.ElevatedCardContent(props: ElevatedCardProps) {
93
+ val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
94
+
95
+ val defaults = CardDefaults.elevatedCardColors()
96
+ val colors = CardDefaults.elevatedCardColors(
97
+ containerColor = props.colors.containerColor.composeOrNull
98
+ ?: defaults.containerColor,
99
+ contentColor = props.colors.contentColor.composeOrNull
100
+ ?: defaults.contentColor
101
+ )
102
+
103
+ val elevation = if (props.elevation != null) {
104
+ CardDefaults.elevatedCardElevation(defaultElevation = props.elevation.dp)
105
+ } else {
106
+ CardDefaults.elevatedCardElevation()
107
+ }
108
+
109
+ val content: @Composable ColumnScope.() -> Unit = {
110
+ val scope = ComposableScope().with(columnScope = this)
111
+ Children(scope)
112
+ }
113
+
114
+ ElevatedCard(
115
+ modifier = modifier,
116
+ colors = colors,
117
+ elevation = elevation,
118
+ content = content
119
+ )
120
+ }
121
+
122
+ // endregion
123
+
124
+ // region OutlinedCard
125
+
126
+ data class OutlinedCardProps(
127
+ val colors: CardColors = CardColors(),
128
+ val elevation: Float? = null,
129
+ val border: CardBorder? = null,
130
+ val modifiers: ModifierList = emptyList()
131
+ ) : ComposeProps
132
+
133
+ @Composable
134
+ fun FunctionalComposableScope.OutlinedCardContent(props: OutlinedCardProps) {
135
+ val modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
136
+
137
+ val defaults = CardDefaults.outlinedCardColors()
138
+ val colors = CardDefaults.outlinedCardColors(
139
+ containerColor = props.colors.containerColor.composeOrNull
140
+ ?: defaults.containerColor,
141
+ contentColor = props.colors.contentColor.composeOrNull
142
+ ?: defaults.contentColor
143
+ )
144
+
145
+ val elevation = if (props.elevation != null) {
146
+ CardDefaults.outlinedCardElevation(defaultElevation = props.elevation.dp)
147
+ } else {
148
+ CardDefaults.outlinedCardElevation()
149
+ }
150
+
151
+ val border = if (props.border != null) {
152
+ val borderColor = props.border.color.composeOrNull
153
+ if (borderColor != null) {
154
+ BorderStroke(props.border.width.dp, borderColor)
155
+ } else {
156
+ BorderStroke(props.border.width.dp, CardDefaults.outlinedCardBorder().brush)
70
157
  }
158
+ } else {
159
+ CardDefaults.outlinedCardBorder()
71
160
  }
161
+
162
+ val content: @Composable ColumnScope.() -> Unit = {
163
+ val scope = ComposableScope().with(columnScope = this)
164
+ Children(scope)
165
+ }
166
+
167
+ OutlinedCard(
168
+ modifier = modifier,
169
+ colors = colors,
170
+ elevation = elevation,
171
+ border = border,
172
+ content = content
173
+ )
72
174
  }
175
+
176
+ // endregion
@@ -0,0 +1,98 @@
1
+ package expo.modules.ui
2
+
3
+ import android.graphics.Color
4
+ import androidx.compose.material3.Checkbox
5
+ import androidx.compose.material3.CheckboxDefaults
6
+ import androidx.compose.material3.TriStateCheckbox
7
+ import androidx.compose.runtime.Composable
8
+ import androidx.compose.ui.state.ToggleableState
9
+ import expo.modules.kotlin.records.Field
10
+ import expo.modules.kotlin.records.Record
11
+ import expo.modules.kotlin.types.Enumerable
12
+ import expo.modules.kotlin.views.ComposeProps
13
+ import expo.modules.kotlin.views.FunctionalComposableScope
14
+
15
+ data class CheckboxColors(
16
+ @Field val checkedColor: Color? = null,
17
+ @Field val disabledCheckedColor: Color? = null,
18
+ @Field val uncheckedColor: Color? = null,
19
+ @Field val disabledUncheckedColor: Color? = null,
20
+ @Field val checkmarkColor: Color? = null,
21
+ @Field val disabledIndeterminateColor: Color? = null
22
+ ) : Record
23
+
24
+ data class CheckboxProps(
25
+ val value: Boolean = false,
26
+ val enabled: Boolean = true,
27
+ val nativeClickable: Boolean = true,
28
+ val colors: CheckboxColors = CheckboxColors(),
29
+ val modifiers: ModifierList = emptyList()
30
+ ) : ComposeProps
31
+
32
+ @Composable
33
+ fun FunctionalComposableScope.CheckboxContent(
34
+ props: CheckboxProps,
35
+ onCheckedChange: (Boolean) -> Unit
36
+ ) {
37
+ Checkbox(
38
+ checked = props.value,
39
+ onCheckedChange = if (props.nativeClickable) {
40
+ onCheckedChange
41
+ } else {
42
+ null
43
+ },
44
+ modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
45
+ enabled = props.enabled,
46
+ colors = CheckboxDefaults.colors(
47
+ checkedColor = props.colors.checkedColor.compose,
48
+ disabledCheckedColor = props.colors.disabledCheckedColor.compose,
49
+ uncheckedColor = props.colors.uncheckedColor.compose,
50
+ disabledUncheckedColor = props.colors.disabledUncheckedColor.compose,
51
+ checkmarkColor = props.colors.checkmarkColor.compose,
52
+ disabledIndeterminateColor = props.colors.disabledIndeterminateColor.compose
53
+ )
54
+ )
55
+ }
56
+
57
+ enum class ToggleableStateValue(val value: String) : Enumerable {
58
+ ON("on"),
59
+ OFF("off"),
60
+ INDETERMINATE("indeterminate")
61
+ }
62
+
63
+ data class TriStateCheckboxProps(
64
+ val state: ToggleableStateValue = ToggleableStateValue.OFF,
65
+ val enabled: Boolean = true,
66
+ val nativeClickable: Boolean = true,
67
+ val colors: CheckboxColors = CheckboxColors(),
68
+ val modifiers: ModifierList = emptyList()
69
+ ) : ComposeProps
70
+
71
+ @Composable
72
+ fun FunctionalComposableScope.TriStateCheckboxContent(
73
+ props: TriStateCheckboxProps,
74
+ onClick: () -> Unit
75
+ ) {
76
+ TriStateCheckbox(
77
+ state = when (props.state) {
78
+ ToggleableStateValue.ON -> ToggleableState.On
79
+ ToggleableStateValue.OFF -> ToggleableState.Off
80
+ ToggleableStateValue.INDETERMINATE -> ToggleableState.Indeterminate
81
+ },
82
+ onClick = if (props.nativeClickable) {
83
+ onClick
84
+ } else {
85
+ null
86
+ },
87
+ modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
88
+ enabled = props.enabled,
89
+ colors = CheckboxDefaults.colors(
90
+ checkedColor = props.colors.checkedColor.compose,
91
+ disabledCheckedColor = props.colors.disabledCheckedColor.compose,
92
+ uncheckedColor = props.colors.uncheckedColor.compose,
93
+ disabledUncheckedColor = props.colors.disabledUncheckedColor.compose,
94
+ checkmarkColor = props.colors.checkmarkColor.compose,
95
+ disabledIndeterminateColor = props.colors.disabledIndeterminateColor.compose
96
+ )
97
+ )
98
+ }