@expo/ui 55.0.2 → 55.0.4

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 (232) hide show
  1. package/CHANGELOG.md +42 -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/BottomSheetView.kt +91 -13
  5. package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
  6. package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
  7. package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
  8. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +258 -70
  9. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +209 -61
  10. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +44 -1
  11. package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
  12. package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
  13. package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
  14. package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
  15. package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
  16. package/android/src/main/java/expo/modules/ui/SwitchView.kt +53 -161
  17. package/android/src/main/java/expo/modules/ui/TextInputView.kt +39 -15
  18. package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
  19. package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
  20. package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
  21. package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -86
  22. package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
  23. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
  24. package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
  25. package/build/datetime-picker/DateTimePicker.android.d.ts +3 -0
  26. package/build/datetime-picker/DateTimePicker.android.d.ts.map +1 -0
  27. package/build/datetime-picker/DateTimePicker.d.ts +3 -0
  28. package/build/datetime-picker/DateTimePicker.d.ts.map +1 -0
  29. package/build/datetime-picker/DateTimePicker.web.d.ts +3 -0
  30. package/build/datetime-picker/DateTimePicker.web.d.ts.map +1 -0
  31. package/build/datetime-picker/index.d.ts +5 -0
  32. package/build/datetime-picker/index.d.ts.map +1 -0
  33. package/build/datetime-picker/types.d.ts +128 -0
  34. package/build/datetime-picker/types.d.ts.map +1 -0
  35. package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
  36. package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
  37. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
  38. package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
  39. package/build/jetpack-compose/Button/index.d.ts +65 -51
  40. package/build/jetpack-compose/Button/index.d.ts.map +1 -1
  41. package/build/jetpack-compose/Card/index.d.ts +72 -14
  42. package/build/jetpack-compose/Card/index.d.ts.map +1 -1
  43. package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
  44. package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
  45. package/build/jetpack-compose/Chip/index.d.ts +247 -27
  46. package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
  47. package/build/jetpack-compose/DatePicker/index.d.ts +38 -3
  48. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  49. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
  50. package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
  51. package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
  52. package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
  53. package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
  54. package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
  55. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
  56. package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
  57. package/build/jetpack-compose/IconButton/index.d.ts +45 -29
  58. package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
  59. package/build/jetpack-compose/ModalBottomSheet/index.d.ts +65 -13
  60. package/build/jetpack-compose/ModalBottomSheet/index.d.ts.map +1 -1
  61. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
  62. package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  63. package/build/jetpack-compose/Progress/index.d.ts +78 -35
  64. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  65. package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
  66. package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
  67. package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
  68. package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
  69. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
  70. package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
  71. package/build/jetpack-compose/Slider/index.d.ts +34 -10
  72. package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
  73. package/build/jetpack-compose/Switch/index.d.ts +10 -50
  74. package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
  75. package/build/jetpack-compose/TextInput/index.d.ts +9 -0
  76. package/build/jetpack-compose/TextInput/index.d.ts.map +1 -1
  77. package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
  78. package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
  79. package/build/jetpack-compose/index.d.ts +5 -4
  80. package/build/jetpack-compose/index.d.ts.map +1 -1
  81. package/build/jetpack-compose/modifiers/index.d.ts +18 -1
  82. package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
  83. package/build/swift-ui/Link/index.d.ts +36 -0
  84. package/build/swift-ui/Link/index.d.ts.map +1 -0
  85. package/build/swift-ui/ProgressView/index.d.ts +1 -5
  86. package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
  87. package/build/swift-ui/Stepper/index.d.ts +3 -3
  88. package/build/swift-ui/Stepper/index.d.ts.map +1 -1
  89. package/build/swift-ui/Text/index.d.ts +33 -1
  90. package/build/swift-ui/Text/index.d.ts.map +1 -1
  91. package/build/swift-ui/index.d.ts +1 -0
  92. package/build/swift-ui/index.d.ts.map +1 -1
  93. package/build/swift-ui/modifiers/environment.d.ts +16 -1
  94. package/build/swift-ui/modifiers/environment.d.ts.map +1 -1
  95. package/build/swift-ui/modifiers/index.d.ts +24 -7
  96. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  97. package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
  98. package/build/swift-ui/modifiers/widgets.d.ts +14 -0
  99. package/build/swift-ui/modifiers/widgets.d.ts.map +1 -0
  100. package/build/swift-ui/types.d.ts +7 -0
  101. package/build/swift-ui/types.d.ts.map +1 -1
  102. package/expo-module.config.json +1 -1
  103. package/ios/BottomSheetView.swift +1 -6
  104. package/ios/ClosedRangeDateRecord.swift +10 -0
  105. package/ios/ColorPickerView.swift +9 -8
  106. package/ios/ConfirmationDialog/ConfirmationDialog.swift +4 -6
  107. package/ios/DatePickerView.swift +7 -5
  108. package/ios/DisclosureGroupView.swift +5 -7
  109. package/ios/ExpoUIModule.swift +1 -0
  110. package/ios/LinkView.swift +29 -0
  111. package/ios/ListView.swift +6 -14
  112. package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
  113. package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
  114. package/ios/Modifiers/EnvironmentModifier.swift +14 -0
  115. package/ios/Modifiers/ViewModifierRegistry.swift +12 -0
  116. package/ios/Modifiers/WidgetModifiers.swift +12 -0
  117. package/ios/Picker/PickerView.swift +6 -10
  118. package/ios/Popover/PopoverView.swift +3 -5
  119. package/ios/ProgressView.swift +0 -5
  120. package/ios/SectionView.swift +3 -5
  121. package/ios/SliderView.swift +8 -6
  122. package/ios/StepperView.swift +12 -16
  123. package/ios/TextView.swift +37 -1
  124. package/ios/Toggle/ToggleView.swift +5 -7
  125. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar +0 -0
  126. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar.md5 +1 -0
  127. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar.sha1 +1 -0
  128. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar.sha256 +1 -0
  129. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4-sources.jar.sha512 +1 -0
  130. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar +0 -0
  131. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar.md5 +1 -0
  132. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar.sha1 +1 -0
  133. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar.sha256 +1 -0
  134. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.aar.sha512 +1 -0
  135. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.module → 55.0.4/expo.modules.ui-55.0.4.module} +22 -22
  136. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.module.md5 +1 -0
  137. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.module.sha1 +1 -0
  138. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.module.sha256 +1 -0
  139. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.module.sha512 +1 -0
  140. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.pom → 55.0.4/expo.modules.ui-55.0.4.pom} +1 -1
  141. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.pom.md5 +1 -0
  142. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.pom.sha1 +1 -0
  143. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.pom.sha256 +1 -0
  144. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.4/expo.modules.ui-55.0.4.pom.sha512 +1 -0
  145. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  146. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  147. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  148. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  149. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  150. package/package.json +9 -2
  151. package/src/datetime-picker/DateTimePicker.android.tsx +126 -0
  152. package/src/datetime-picker/DateTimePicker.tsx +94 -0
  153. package/src/datetime-picker/DateTimePicker.web.tsx +5 -0
  154. package/src/datetime-picker/index.tsx +11 -0
  155. package/src/datetime-picker/types.tsx +147 -0
  156. package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
  157. package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
  158. package/src/jetpack-compose/Button/index.tsx +69 -92
  159. package/src/jetpack-compose/Card/index.tsx +105 -29
  160. package/src/jetpack-compose/Checkbox/index.tsx +126 -0
  161. package/src/jetpack-compose/Chip/index.tsx +391 -51
  162. package/src/jetpack-compose/DatePicker/index.tsx +112 -7
  163. package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
  164. package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
  165. package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
  166. package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
  167. package/src/jetpack-compose/IconButton/index.tsx +49 -56
  168. package/src/jetpack-compose/ModalBottomSheet/index.tsx +85 -15
  169. package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
  170. package/src/jetpack-compose/Progress/index.tsx +120 -62
  171. package/src/jetpack-compose/RadioButton/index.tsx +8 -9
  172. package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
  173. package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
  174. package/src/jetpack-compose/Slider/index.tsx +76 -29
  175. package/src/jetpack-compose/Switch/index.tsx +17 -87
  176. package/src/jetpack-compose/TextInput/index.tsx +10 -0
  177. package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
  178. package/src/jetpack-compose/index.ts +5 -4
  179. package/src/jetpack-compose/modifiers/index.ts +26 -2
  180. package/src/swift-ui/Link/index.tsx +52 -0
  181. package/src/swift-ui/ProgressView/index.tsx +1 -3
  182. package/src/swift-ui/Stepper/index.tsx +7 -7
  183. package/src/swift-ui/Text/index.tsx +66 -2
  184. package/src/swift-ui/index.tsx +1 -0
  185. package/src/swift-ui/modifiers/environment.ts +17 -4
  186. package/src/swift-ui/modifiers/index.ts +44 -10
  187. package/src/swift-ui/modifiers/widgets.ts +18 -0
  188. package/src/swift-ui/types.ts +5 -0
  189. package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
  190. package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
  191. package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
  192. package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
  193. package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
  194. package/build/jetpack-compose/Button/types.d.ts +0 -5
  195. package/build/jetpack-compose/Button/types.d.ts.map +0 -1
  196. package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
  197. package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
  198. package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
  199. package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
  200. package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
  201. package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
  202. package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
  203. package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
  204. package/build/jetpack-compose/Picker/index.d.ts +0 -62
  205. package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
  206. package/build/jetpack-compose/TextButton/index.d.ts +0 -29
  207. package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
  208. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar +0 -0
  209. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.md5 +0 -1
  210. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha1 +0 -1
  211. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha256 +0 -1
  212. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha512 +0 -1
  213. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar +0 -0
  214. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.md5 +0 -1
  215. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha1 +0 -1
  216. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha256 +0 -1
  217. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha512 +0 -1
  218. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.md5 +0 -1
  219. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha1 +0 -1
  220. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha256 +0 -1
  221. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha512 +0 -1
  222. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.md5 +0 -1
  223. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha1 +0 -1
  224. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha256 +0 -1
  225. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha512 +0 -1
  226. package/src/jetpack-compose/Button/types.ts +0 -57
  227. package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
  228. package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
  229. package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
  230. package/src/jetpack-compose/FilterChip/index.tsx +0 -89
  231. package/src/jetpack-compose/Picker/index.tsx +0 -90
  232. package/src/jetpack-compose/TextButton/index.tsx +0 -55
@@ -1,16 +1,54 @@
1
1
  import { requireNativeView } from 'expo';
2
- import React from 'react';
2
+ import React, { Ref } from 'react';
3
+ import { type ColorValue } from 'react-native';
3
4
 
4
- import { type ExpoModifier, type ViewEvent } from '../../types';
5
+ import { type ModifierConfig } from '../../types';
5
6
  import { createViewModifierEventListener } from '../modifiers/utils';
6
7
 
8
+ type SlotNativeViewProps = {
9
+ slotName: string;
10
+ children: React.ReactNode;
11
+ };
12
+
13
+ const SlotNativeView: React.ComponentType<SlotNativeViewProps> = requireNativeView(
14
+ 'ExpoUI',
15
+ 'SlotView'
16
+ );
17
+
18
+ export type ModalBottomSheetRef = {
19
+ /**
20
+ * Programmatically hides the bottom sheet with an animation.
21
+ * The returned promise resolves after the dismiss animation completes.
22
+ */
23
+ hide: () => Promise<void>;
24
+ };
25
+
26
+ export type ModalBottomSheetProperties = {
27
+ /**
28
+ * Whether the bottom sheet can be dismissed by pressing the back button.
29
+ * @default true
30
+ */
31
+ shouldDismissOnBackPress?: boolean;
32
+ /**
33
+ * Whether the bottom sheet can be dismissed by clicking outside (on the scrim).
34
+ * @default true
35
+ */
36
+ shouldDismissOnClickOutside?: boolean;
37
+ };
38
+
7
39
  export type ModalBottomSheetProps = {
8
40
  /**
9
41
  * The children of the `ModalBottomSheet` component.
42
+ * Can include a `ModalBottomSheet.DragHandle` slot for a custom drag handle.
10
43
  */
11
44
  children: React.ReactNode;
12
45
  /**
13
- * Callback function that is called when the bottom sheet is dismissed.
46
+ * Can be used to imperatively hide the bottom sheet with an animation.
47
+ */
48
+ ref?: Ref<ModalBottomSheetRef>;
49
+ /**
50
+ * Callback function that is called when the user dismisses the bottom sheet
51
+ * (via swipe, back press, or tapping outside the scrim).
14
52
  */
15
53
  onDismissRequest: () => void;
16
54
  /**
@@ -18,14 +56,42 @@ export type ModalBottomSheetProps = {
18
56
  * @default false
19
57
  */
20
58
  skipPartiallyExpanded?: boolean;
59
+ /**
60
+ * The background color of the bottom sheet.
61
+ */
62
+ containerColor?: ColorValue;
63
+ /**
64
+ * The preferred color of the content inside the bottom sheet.
65
+ */
66
+ contentColor?: ColorValue;
67
+ /**
68
+ * The color of the scrim overlay behind the bottom sheet.
69
+ */
70
+ scrimColor?: ColorValue;
71
+ /**
72
+ * Whether to show the default drag handle at the top of the bottom sheet.
73
+ * Ignored if a custom `ModalBottomSheet.DragHandle` slot is provided.
74
+ * @default true
75
+ */
76
+ showDragHandle?: boolean;
77
+ /**
78
+ * Whether gestures (swipe to dismiss) are enabled on the bottom sheet.
79
+ * @default true
80
+ */
81
+ sheetGesturesEnabled?: boolean;
82
+ /**
83
+ * Properties for the modal window behavior.
84
+ */
85
+ properties?: ModalBottomSheetProperties;
21
86
  /**
22
87
  * Modifiers for the component.
23
88
  */
24
- modifiers?: ExpoModifier[];
89
+ modifiers?: ModifierConfig[];
25
90
  };
26
91
 
27
- type NativeModalBottomSheetProps = Omit<ModalBottomSheetProps, 'onDismissRequest'> &
28
- ViewEvent<'onDismissRequest', void>;
92
+ type NativeModalBottomSheetProps = Omit<ModalBottomSheetProps, 'onDismissRequest'> & {
93
+ onDismissRequest: () => void;
94
+ };
29
95
 
30
96
  const ModalBottomSheetNativeView: React.ComponentType<NativeModalBottomSheetProps> =
31
97
  requireNativeView('ExpoUI', 'ModalBottomSheetView');
@@ -44,18 +110,22 @@ function transformProps(props: ModalBottomSheetProps): NativeModalBottomSheetPro
44
110
  }
45
111
 
46
112
  /**
47
- * A Material Design modal bottom sheet.
113
+ * A custom drag handle slot for `ModalBottomSheet`.
114
+ * Wrap any content to use as the sheet's drag handle.
115
+ *
116
+ * @platform android
48
117
  */
49
- export function ModalBottomSheet(props: ModalBottomSheetProps) {
50
- return <ModalBottomSheetNativeView {...transformProps(props)} />;
118
+ function DragHandle(props: { children: React.ReactNode }) {
119
+ return <SlotNativeView slotName="dragHandle">{props.children}</SlotNativeView>;
51
120
  }
52
121
 
53
122
  /**
54
- * @deprecated Use `ModalBottomSheet` instead.
123
+ * A Material Design modal bottom sheet.
55
124
  */
56
- export const BottomSheet = ModalBottomSheet;
125
+ function ModalBottomSheetComponent(props: ModalBottomSheetProps) {
126
+ return <ModalBottomSheetNativeView {...transformProps(props)} />;
127
+ }
57
128
 
58
- /**
59
- * @deprecated Use `ModalBottomSheetProps` instead.
60
- */
61
- export type BottomSheetProps = ModalBottomSheetProps;
129
+ ModalBottomSheetComponent.DragHandle = DragHandle;
130
+
131
+ export const ModalBottomSheet = ModalBottomSheetComponent;
@@ -0,0 +1,34 @@
1
+ import { requireNativeView } from 'expo';
2
+
3
+ import { type ModifierConfig } from '../../types';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+
6
+ export type MultiChoiceSegmentedButtonRowProps = {
7
+ /**
8
+ * SegmentedButton children.
9
+ */
10
+ children: React.ReactNode;
11
+ /**
12
+ * Modifiers for the component.
13
+ */
14
+ modifiers?: ModifierConfig[];
15
+ };
16
+
17
+ const MultiChoiceSegmentedButtonRowNativeView: React.ComponentType<MultiChoiceSegmentedButtonRowProps> =
18
+ requireNativeView('ExpoUI', 'MultiChoiceSegmentedButtonRowView');
19
+
20
+ /**
21
+ * A row container for multi-choice `SegmentedButton` children.
22
+ * Maps to Material 3 `MultiChoiceSegmentedButtonRow`.
23
+ */
24
+ export function MultiChoiceSegmentedButtonRow(props: MultiChoiceSegmentedButtonRowProps) {
25
+ const { children, modifiers, ...restProps } = props;
26
+ return (
27
+ <MultiChoiceSegmentedButtonRowNativeView
28
+ modifiers={modifiers}
29
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
30
+ {...restProps}>
31
+ {children}
32
+ </MultiChoiceSegmentedButtonRowNativeView>
33
+ );
34
+ }
@@ -1,102 +1,160 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { ColorValue } from 'react-native';
2
+ import { type ColorValue } from 'react-native';
3
3
 
4
- import { ExpoModifier } from '../../types';
4
+ import { type ModifierConfig } from '../../types';
5
5
  import { createViewModifierEventListener } from '../modifiers/utils';
6
6
 
7
- export type ProgressElementColors = {
8
- /**
9
- * Track color.
10
- *
11
- * @platform android
12
- */
13
- trackColor?: ColorValue;
14
- };
7
+ /**
8
+ * Stroke cap style for progress indicators.
9
+ */
10
+ export type StrokeCap = 'round' | 'butt' | 'square';
15
11
 
16
- export type CircularProgressProps = {
12
+ /**
13
+ * Common props shared by all progress indicator variants.
14
+ */
15
+ type BaseProgressProps = {
17
16
  /**
18
- * The current progress value of the slider. This is a number between `0` and `1`.
17
+ * The current progress value between `0` and `1`. Omit for indeterminate.
19
18
  */
20
19
  progress?: number | null;
21
20
  /**
22
- * Progress color.
21
+ * Progress indicator color.
23
22
  */
24
23
  color?: ColorValue;
25
24
  /**
26
- * Colors for switch's core elements.
27
- * @platform android
25
+ * Track (background) color.
28
26
  */
29
- elementColors?: ProgressElementColors;
27
+ trackColor?: ColorValue;
30
28
  /**
31
29
  * Modifiers for the component.
32
30
  */
33
- modifiers?: ExpoModifier[];
31
+ modifiers?: ModifierConfig[];
34
32
  };
35
33
 
36
- export type LinearProgressProps = {
37
- /**
38
- * The current progress value of the slider. This is a number between `0` and `1`.
39
- */
40
- progress?: number | null;
34
+ function transformProps<T extends BaseProgressProps>(props: T): T {
35
+ const { modifiers, ...restProps } = props;
36
+ return {
37
+ modifiers,
38
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
39
+ ...restProps,
40
+ } as T;
41
+ }
42
+
43
+ function createProgressComponent<P extends BaseProgressProps>(
44
+ viewName: string
45
+ ): React.ComponentType<P> {
46
+ const NativeView: React.ComponentType<P> = requireNativeView('ExpoUI', viewName);
47
+ return function ProgressComponent(props: P) {
48
+ return <NativeView {...transformProps(props)} />;
49
+ };
50
+ }
51
+
52
+ // region LinearProgressIndicator
53
+
54
+ /**
55
+ * Configuration for the stop indicator dot at the end of the determinate linear progress track.
56
+ * When provided, draws a stop indicator with the given options. Omit to use the Compose default.
57
+ */
58
+ export type DrawStopIndicatorConfig = {
41
59
  /**
42
- * Progress color.
60
+ * Color of the stop indicator. Defaults to the indicator's color.
43
61
  */
44
62
  color?: ColorValue;
45
63
  /**
46
- * Colors for switch's core elements.
47
- * @platform android
64
+ * Stroke cap style for the stop indicator. Defaults to the indicator's strokeCap.
48
65
  */
49
- elementColors?: ProgressElementColors;
66
+ strokeCap?: StrokeCap;
50
67
  /**
51
- * Modifiers for the component.
68
+ * Size of the stop indicator in dp. Defaults to the Material 3 default.
52
69
  */
53
- modifiers?: ExpoModifier[];
70
+ stopSize?: number;
54
71
  };
55
72
 
56
- type NativeProgressProps =
57
- | CircularProgressProps
58
- | (LinearProgressProps & {
59
- variant: 'linear' | 'circular' | 'linearWavy' | 'circularWavy';
60
- });
73
+ export type LinearProgressIndicatorProps = BaseProgressProps & {
74
+ /**
75
+ * Stroke cap style for the indicator ends.
76
+ * @default 'round'
77
+ */
78
+ strokeCap?: StrokeCap;
79
+ /**
80
+ * Gap size between the indicator and track in dp.
81
+ */
82
+ gapSize?: number;
83
+ /**
84
+ * Configuration for the stop indicator dot at the end of the determinate progress track.
85
+ */
86
+ drawStopIndicator?: DrawStopIndicatorConfig;
87
+ };
61
88
 
62
- const NativeProgressView: React.ComponentType<NativeProgressProps> = requireNativeView(
63
- 'ExpoUI',
64
- 'ProgressView'
89
+ /**
90
+ * A linear progress indicator that displays progress in a horizontal bar.
91
+ *
92
+ * Matches the Jetpack Compose `LinearProgressIndicator`.
93
+ */
94
+ export const LinearProgressIndicator = createProgressComponent<LinearProgressIndicatorProps>(
95
+ 'LinearProgressIndicatorView'
65
96
  );
66
97
 
67
- function transformProps(props: CircularProgressProps | LinearProgressProps): NativeProgressProps {
68
- const { modifiers, ...restProps } = props;
69
- return {
70
- modifiers,
71
- ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
72
- ...restProps,
73
- };
74
- }
98
+ // endregion
75
99
 
76
- /**
77
- * Renders a `CircularProgress` component.
78
- */
79
- export function CircularProgress(props: CircularProgressProps) {
80
- return <NativeProgressView {...transformProps(props)} variant="circular" />;
81
- }
100
+ // region CircularProgressIndicator
101
+
102
+ export type CircularProgressIndicatorProps = BaseProgressProps & {
103
+ /**
104
+ * Width of the circular stroke in dp.
105
+ */
106
+ strokeWidth?: number;
107
+ /**
108
+ * Stroke cap style for the indicator ends.
109
+ * @default 'round'
110
+ */
111
+ strokeCap?: StrokeCap;
112
+ /**
113
+ * Gap size between the indicator and track in dp.
114
+ */
115
+ gapSize?: number;
116
+ };
82
117
 
83
118
  /**
84
- * Renders a `LinearProgress` component.
119
+ * A circular progress indicator that displays progress in a circular format.
120
+ *
121
+ * Matches the Jetpack Compose `CircularProgressIndicator`.
85
122
  */
86
- export function LinearProgress(props: LinearProgressProps) {
87
- return <NativeProgressView {...transformProps(props)} variant="linear" />;
88
- }
123
+ export const CircularProgressIndicator = createProgressComponent<CircularProgressIndicatorProps>(
124
+ 'CircularProgressIndicatorView'
125
+ );
126
+
127
+ // endregion
128
+
129
+ // region LinearWavyProgressIndicator
130
+
131
+ export type LinearWavyProgressIndicatorProps = BaseProgressProps & {
132
+ /**
133
+ * Size of the stop indicator in dp at the end of the determinate progress track.
134
+ */
135
+ stopSize?: number;
136
+ };
89
137
 
90
138
  /**
91
- * Renders a `CircularWavyProgress` component with wavy animation.
139
+ * A linear progress indicator with wavy animation style.
140
+ *
141
+ * Matches the Jetpack Compose `LinearWavyProgressIndicator`.
92
142
  */
93
- export function CircularWavyProgress(props: CircularProgressProps) {
94
- return <NativeProgressView {...transformProps(props)} variant="circularWavy" />;
95
- }
143
+ export const LinearWavyProgressIndicator =
144
+ createProgressComponent<LinearWavyProgressIndicatorProps>('LinearWavyProgressIndicatorView');
145
+
146
+ // endregion
147
+
148
+ // region CircularWavyProgressIndicator
149
+
150
+ export type CircularWavyProgressIndicatorProps = BaseProgressProps;
96
151
 
97
152
  /**
98
- * Renders a `LinearWavyProgress` component with wavy animation.
153
+ * A circular progress indicator with wavy animation style.
154
+ *
155
+ * Matches the Jetpack Compose `CircularWavyProgressIndicator`.
99
156
  */
100
- export function LinearWavyProgress(props: LinearProgressProps) {
101
- return <NativeProgressView {...transformProps(props)} variant="linearWavy" />;
102
- }
157
+ export const CircularWavyProgressIndicator =
158
+ createProgressComponent<CircularWavyProgressIndicatorProps>('CircularWavyProgressIndicatorView');
159
+
160
+ // endregion
@@ -1,6 +1,6 @@
1
1
  import { requireNativeView } from 'expo';
2
2
 
3
- import { type ExpoModifier, type ViewEvent } from '../../types';
3
+ import { type ModifierConfig, type ViewEvent } from '../../types';
4
4
  import { createViewModifierEventListener } from '../modifiers/utils';
5
5
 
6
6
  export type RadioButtonProps = {
@@ -15,12 +15,13 @@ export type RadioButtonProps = {
15
15
  /**
16
16
  * Modifiers for the component.
17
17
  */
18
- modifiers?: ExpoModifier[];
18
+ modifiers?: ModifierConfig[];
19
19
  };
20
20
 
21
- type NativeRadioButtonProps = Omit<RadioButtonProps, 'onClick'> & {
22
- nativeClickable: boolean;
23
- } & ViewEvent<'onNativeClick', void>;
21
+ type NativeRadioButtonProps = Omit<RadioButtonProps, 'onClick'> &
22
+ ViewEvent<'onButtonPressed', void> & {
23
+ clickable: boolean;
24
+ };
24
25
 
25
26
  const RadioButtonNativeView: React.ComponentType<NativeRadioButtonProps> = requireNativeView(
26
27
  'ExpoUI',
@@ -33,10 +34,8 @@ function transformProps(props: RadioButtonProps): NativeRadioButtonProps {
33
34
  modifiers,
34
35
  ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
35
36
  ...restProps,
36
- nativeClickable: onClick != null,
37
- onNativeClick: () => {
38
- onClick?.();
39
- },
37
+ clickable: onClick != null,
38
+ onButtonPressed: () => onClick?.(),
40
39
  };
41
40
  }
42
41
 
@@ -0,0 +1,109 @@
1
+ import { requireNativeView } from 'expo';
2
+ import { type ColorValue } from 'react-native';
3
+
4
+ import { type ModifierConfig, type ViewEvent } from '../../types';
5
+ import { createViewModifierEventListener } from '../modifiers/utils';
6
+
7
+ /**
8
+ * Colors for the segmented button in different states.
9
+ */
10
+ export type SegmentedButtonColors = {
11
+ activeBorderColor?: ColorValue;
12
+ activeContentColor?: ColorValue;
13
+ inactiveBorderColor?: ColorValue;
14
+ inactiveContentColor?: ColorValue;
15
+ disabledActiveBorderColor?: ColorValue;
16
+ disabledActiveContentColor?: ColorValue;
17
+ disabledInactiveBorderColor?: ColorValue;
18
+ disabledInactiveContentColor?: ColorValue;
19
+ activeContainerColor?: ColorValue;
20
+ inactiveContainerColor?: ColorValue;
21
+ disabledActiveContainerColor?: ColorValue;
22
+ disabledInactiveContainerColor?: ColorValue;
23
+ };
24
+
25
+ export type SegmentedButtonProps = {
26
+ /**
27
+ * Whether the button is currently selected (used inside `SingleChoiceSegmentedButtonRow`).
28
+ */
29
+ selected?: boolean;
30
+ /**
31
+ * Callback that is called when the button is clicked (used inside `SingleChoiceSegmentedButtonRow`).
32
+ */
33
+ onClick?: () => void;
34
+ /**
35
+ * Whether the button is currently checked (used inside `MultiChoiceSegmentedButtonRow`).
36
+ */
37
+ checked?: boolean;
38
+ /**
39
+ * Callback that is called when the checked state changes (used inside `MultiChoiceSegmentedButtonRow`).
40
+ */
41
+ onCheckedChange?: (checked: boolean) => void;
42
+ /**
43
+ * Whether the button is enabled.
44
+ * @default true
45
+ */
46
+ enabled?: boolean;
47
+ /**
48
+ * Colors for the button in different states.
49
+ */
50
+ colors?: SegmentedButtonColors;
51
+ /**
52
+ * Modifiers for the component.
53
+ */
54
+ modifiers?: ModifierConfig[];
55
+ /**
56
+ * Children containing a `Label` slot.
57
+ */
58
+ children?: React.ReactNode;
59
+ };
60
+
61
+ type NativeSlotViewProps = {
62
+ slotName: string;
63
+ children: React.ReactNode;
64
+ };
65
+
66
+ type NativeSegmentedButtonProps = Omit<SegmentedButtonProps, 'onClick' | 'onCheckedChange'> &
67
+ ViewEvent<'onButtonPressed', void> &
68
+ ViewEvent<'onCheckedChange', { value: boolean }>;
69
+
70
+ const SegmentedButtonNativeView: React.ComponentType<NativeSegmentedButtonProps> =
71
+ requireNativeView('ExpoUI', 'SegmentedButtonView');
72
+
73
+ const SlotNativeView: React.ComponentType<NativeSlotViewProps> = requireNativeView(
74
+ 'ExpoUI',
75
+ 'SlotView'
76
+ );
77
+
78
+ /**
79
+ * Label slot for `SegmentedButton`.
80
+ */
81
+ function SegmentedButtonLabel(props: { children: React.ReactNode }) {
82
+ return <SlotNativeView slotName="label">{props.children}</SlotNativeView>;
83
+ }
84
+
85
+ /**
86
+ * A Material 3 segmented button. Must be used inside a `SingleChoiceSegmentedButtonRow`
87
+ * or `MultiChoiceSegmentedButtonRow`.
88
+ */
89
+ function SegmentedButtonComponent(props: SegmentedButtonProps) {
90
+ const { children, modifiers, onClick, onCheckedChange, ...restProps } = props;
91
+ return (
92
+ <SegmentedButtonNativeView
93
+ modifiers={modifiers}
94
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
95
+ {...restProps}
96
+ onButtonPressed={() => onClick?.()}
97
+ onCheckedChange={(e) => onCheckedChange?.(e.nativeEvent.value)}>
98
+ {children}
99
+ </SegmentedButtonNativeView>
100
+ );
101
+ }
102
+
103
+ SegmentedButtonComponent.Label = SegmentedButtonLabel;
104
+
105
+ export { SegmentedButtonComponent as SegmentedButton };
106
+ export { SingleChoiceSegmentedButtonRow } from '../SingleChoiceSegmentedButtonRow';
107
+ export type { SingleChoiceSegmentedButtonRowProps } from '../SingleChoiceSegmentedButtonRow';
108
+ export { MultiChoiceSegmentedButtonRow } from '../MultiChoiceSegmentedButtonRow';
109
+ export type { MultiChoiceSegmentedButtonRowProps } from '../MultiChoiceSegmentedButtonRow';
@@ -0,0 +1,34 @@
1
+ import { requireNativeView } from 'expo';
2
+
3
+ import { type ModifierConfig } from '../../types';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+
6
+ export type SingleChoiceSegmentedButtonRowProps = {
7
+ /**
8
+ * SegmentedButton children.
9
+ */
10
+ children: React.ReactNode;
11
+ /**
12
+ * Modifiers for the component.
13
+ */
14
+ modifiers?: ModifierConfig[];
15
+ };
16
+
17
+ const SingleChoiceSegmentedButtonRowNativeView: React.ComponentType<SingleChoiceSegmentedButtonRowProps> =
18
+ requireNativeView('ExpoUI', 'SingleChoiceSegmentedButtonRowView');
19
+
20
+ /**
21
+ * A row container for single-choice `SegmentedButton` children.
22
+ * Maps to Material 3 `SingleChoiceSegmentedButtonRow`.
23
+ */
24
+ export function SingleChoiceSegmentedButtonRow(props: SingleChoiceSegmentedButtonRowProps) {
25
+ const { children, modifiers, ...restProps } = props;
26
+ return (
27
+ <SingleChoiceSegmentedButtonRowNativeView
28
+ modifiers={modifiers}
29
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
30
+ {...restProps}>
31
+ {children}
32
+ </SingleChoiceSegmentedButtonRowNativeView>
33
+ );
34
+ }