@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,14 +1,24 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { type ColorValue } from 'react-native';
3
3
 
4
- import { ExpoModifier, ViewEvent } from '../../types';
4
+ import { type ModifierConfig, ViewEvent } from '../../types';
5
5
  import { createViewModifierEventListener } from '../modifiers/utils';
6
6
 
7
+ type SlotNativeViewProps = {
8
+ slotName: string;
9
+ children: React.ReactNode;
10
+ };
11
+
12
+ const SlotNativeView: React.ComponentType<SlotNativeViewProps> = requireNativeView(
13
+ 'ExpoUI',
14
+ 'SlotView'
15
+ );
16
+
7
17
  /**
8
- * Colors for slider's core elements.
18
+ * Colors for slider elements. Maps directly to Material3's `SliderDefaults.colors()`.
9
19
  * @platform android
10
20
  */
11
- export type SliderElementColors = {
21
+ export type SliderColors = {
12
22
  thumbColor?: ColorValue;
13
23
  activeTrackColor?: ColorValue;
14
24
  inactiveTrackColor?: ColorValue;
@@ -38,35 +48,47 @@ export type SliderProps = {
38
48
  */
39
49
  max?: number;
40
50
  /**
41
- * Colors for slider's core elements.
42
- * @platform android
51
+ * Whether the slider is enabled for user interaction.
52
+ * @default true
43
53
  */
44
- elementColors?: SliderElementColors;
54
+ enabled?: boolean;
45
55
  /**
46
- * Slider color.
56
+ * Colors for slider elements. Maps to Material3's `SliderDefaults.colors()`.
57
+ * @platform android
47
58
  */
48
- color?: ColorValue;
59
+ colors?: SliderColors;
49
60
  /**
50
61
  * Callback triggered on dragging along the slider.
51
62
  */
52
63
  onValueChange?: (value: number) => void;
53
-
64
+ /**
65
+ * Callback triggered when the user finishes changing the value (for example, lifts a finger).
66
+ * Maps to Material3's `onValueChangeFinished`.
67
+ */
68
+ onValueChangeFinished?: () => void;
54
69
  /**
55
70
  * Modifiers for the component.
56
71
  */
57
- modifiers?: ExpoModifier[];
72
+ modifiers?: ModifierConfig[];
73
+ /**
74
+ * Slot children for custom thumb and track.
75
+ */
76
+ children?: React.ReactNode;
58
77
  };
59
78
 
60
- type NativeSliderProps = Omit<SliderProps, 'onValueChange'> &
61
- ViewEvent<'onValueChanged', { value: number }>;
79
+ type NativeSliderProps = Omit<SliderProps, 'onValueChange' | 'onValueChangeFinished' | 'children'> &
80
+ ViewEvent<'onValueChange', { value: number }> &
81
+ ViewEvent<'onValueChangeFinished', void> & { children?: React.ReactNode };
62
82
 
63
83
  const SliderNativeView: React.ComponentType<NativeSliderProps> = requireNativeView(
64
84
  'ExpoUI',
65
85
  'SliderView'
66
86
  );
67
87
 
68
- function transformSliderProps(props: SliderProps): NativeSliderProps {
69
- const { modifiers, ...restProps } = props;
88
+ function transformSliderProps(
89
+ props: Omit<SliderProps, 'children'>
90
+ ): Omit<NativeSliderProps, 'children'> {
91
+ const { modifiers, onValueChange, onValueChangeFinished, ...restProps } = props;
70
92
  return {
71
93
  modifiers,
72
94
  ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
@@ -75,22 +97,47 @@ function transformSliderProps(props: SliderProps): NativeSliderProps {
75
97
  max: props.max ?? 1,
76
98
  steps: props.steps ?? 0,
77
99
  value: props.value ?? 0,
78
- onValueChanged: ({ nativeEvent: { value } }) => {
79
- props?.onValueChange?.(value);
80
- },
81
- elementColors: props.elementColors
82
- ? props.elementColors
83
- : props.color
84
- ? {
85
- thumbColor: props.color,
86
- activeTrackColor: props.color,
87
- activeTickColor: props.color,
88
- }
89
- : undefined,
90
- color: props.color,
100
+ enabled: props.enabled ?? true,
101
+ onValueChange: onValueChange
102
+ ? ({ nativeEvent: { value } }) => {
103
+ onValueChange(value);
104
+ }
105
+ : undefined,
106
+ onValueChangeFinished: onValueChangeFinished ? () => onValueChangeFinished() : undefined,
91
107
  };
92
108
  }
93
109
 
94
- export function Slider(props: SliderProps) {
95
- return <SliderNativeView {...transformSliderProps(props)} />;
110
+ /**
111
+ * A custom thumb slot for `Slider`.
112
+ * Wrap any content to use as the slider's thumb indicator.
113
+ *
114
+ * @platform android
115
+ */
116
+ function Thumb(props: { children: React.ReactNode }) {
117
+ return <SlotNativeView slotName="thumb">{props.children}</SlotNativeView>;
96
118
  }
119
+
120
+ /**
121
+ * A custom track slot for `Slider`.
122
+ * Wrap any content to use as the slider's track.
123
+ *
124
+ * @platform android
125
+ */
126
+ function Track(props: { children: React.ReactNode }) {
127
+ return <SlotNativeView slotName="track">{props.children}</SlotNativeView>;
128
+ }
129
+
130
+ /**
131
+ * A slider component that wraps Material3's `Slider`.
132
+ *
133
+ * @platform android
134
+ */
135
+ function SliderComponent(props: SliderProps) {
136
+ const { children, ...restProps } = props;
137
+ return <SliderNativeView {...transformSliderProps(restProps)}>{children}</SliderNativeView>;
138
+ }
139
+
140
+ SliderComponent.Thumb = Thumb;
141
+ SliderComponent.Track = Track;
142
+
143
+ export { SliderComponent as Slider };
@@ -1,15 +1,14 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { NativeSyntheticEvent, type ColorValue } from 'react-native';
3
3
 
4
- import { ExpoModifier } from '../../types';
4
+ import { type ModifierConfig } from '../../types';
5
5
  import { ExpoUIModule } from '../ExpoUIModule';
6
6
  import { createViewModifierEventListener } from '../modifiers/utils';
7
7
 
8
- // @docsMissing
9
8
  /**
10
- * Only for switch.
9
+ * Colors for switch core elements.
11
10
  */
12
- type SwitchElementColors = {
11
+ export type SwitchColors = {
13
12
  checkedThumbColor?: ColorValue;
14
13
  checkedTrackColor?: ColorValue;
15
14
  checkedBorderColor?: ColorValue;
@@ -28,89 +27,38 @@ type SwitchElementColors = {
28
27
  disabledUncheckedIconColor?: ColorValue;
29
28
  };
30
29
 
31
- // @docsMissing
32
- /**
33
- * Only for checkbox.
34
- */
35
- type CheckboxElementColors = {
36
- checkedColor?: ColorValue;
37
- disabledCheckedColor?: ColorValue;
38
- uncheckedColor?: ColorValue;
39
- disabledUncheckedColor?: ColorValue;
40
- checkmarkColor?: ColorValue;
41
- disabledIndeterminateColor?: ColorValue;
42
- };
43
-
44
30
  export type SwitchProps = {
45
31
  /**
46
32
  * Indicates whether the switch is checked.
47
33
  */
48
34
  value: boolean;
49
- /**
50
- * Label for the switch.
51
- *
52
- * > On Android, the label has an effect only when the `Switch` is used inside a `ContextMenu`.
53
- */
54
- label?: string;
55
-
56
- /**
57
- * Type of the switch component. Can be `'checkbox'`, `'switch'`, or `'button'`.
58
- * @default 'switch'
59
- */
60
- variant?: 'checkbox' | 'switch' | 'button';
61
35
  /**
62
36
  * Whether the switch is enabled.
63
37
  * @default true
64
- * @platform android
65
38
  */
66
39
  enabled?: boolean;
67
40
  /**
68
41
  * Callback function that is called when the checked state changes.
69
42
  */
70
- onValueChange?: (value: boolean) => void;
71
-
43
+ onCheckedChange?: (value: boolean) => void;
72
44
  /**
73
- * Picker color.
45
+ * Colors for switch core elements.
74
46
  */
75
- color?: ColorValue;
76
-
47
+ colors?: SwitchColors;
77
48
  /**
78
49
  * Modifiers for the component.
79
50
  */
80
- modifiers?: ExpoModifier[];
81
-
51
+ modifiers?: ModifierConfig[];
82
52
  /**
83
53
  * Children containing ThumbContent slot.
84
54
  * @platform android
85
55
  */
86
56
  children?: React.ReactNode;
87
- } & (SwitchSwitchVariantProps | SwitchCheckboxVariantProps | SwitchButtonVariantProps);
88
-
89
- export type SwitchSwitchVariantProps = {
90
- variant?: 'switch';
91
- /**
92
- * Colors for switch's core elements.
93
- * @platform android
94
- */
95
- elementColors?: SwitchElementColors;
96
- };
97
-
98
- export type SwitchCheckboxVariantProps = {
99
- variant: 'checkbox';
100
- /**
101
- * Colors for checkbox core elements.
102
- * @platform android
103
- */
104
- elementColors?: CheckboxElementColors;
105
57
  };
106
58
 
107
- export type SwitchButtonVariantProps = {
108
- variant: 'button';
109
- elementColors?: undefined;
110
- };
111
-
112
- type NativeSwitchProps = Omit<SwitchProps, 'onValueChange'> & {
113
- onValueChange: (event: NativeSyntheticEvent<{ value: boolean }>) => void;
59
+ type NativeSwitchProps = Omit<SwitchProps, 'onCheckedChange' | 'children'> & {
60
+ children?: React.ReactNode;
61
+ onCheckedChange: (event: NativeSyntheticEvent<{ value: boolean }>) => void;
114
62
  };
115
63
 
116
64
  type NativeSlotViewProps = {
@@ -140,39 +88,21 @@ export function SwitchThumbContent(props: ThumbContentProps) {
140
88
  return <SlotNativeView slotName="thumbContent">{props.children}</SlotNativeView>;
141
89
  }
142
90
 
143
- function getElementColors(props: SwitchProps) {
144
- if (props.variant === 'button') {
145
- return undefined;
146
- }
147
- if (!props.elementColors) {
148
- if (props.variant === 'switch') {
149
- return {
150
- checkedTrackColor: props.color,
151
- };
152
- } else {
153
- return {
154
- checkedColor: props.color,
155
- };
156
- }
157
- }
158
- return props.elementColors;
159
- }
160
-
161
91
  function transformSwitchProps(props: SwitchProps): Omit<NativeSwitchProps, 'children'> {
162
- const { modifiers, children, ...restProps } = props;
92
+ const { modifiers, children, onCheckedChange, ...restProps } = props;
163
93
  return {
164
94
  modifiers,
165
95
  ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
166
96
  ...restProps,
167
- variant: props.variant ?? 'switch',
168
- elementColors: getElementColors(props),
169
- color: props.color,
170
- onValueChange: ({ nativeEvent: { value } }) => {
171
- props?.onValueChange?.(value);
97
+ onCheckedChange: ({ nativeEvent: { value } }) => {
98
+ onCheckedChange?.(value);
172
99
  },
173
- } as Omit<NativeSwitchProps, 'children'>;
100
+ };
174
101
  }
175
102
 
103
+ /**
104
+ * A switch component.
105
+ */
176
106
  function SwitchComponent(props: SwitchProps) {
177
107
  return <SwitchNativeView {...transformSwitchProps(props)}>{props.children}</SwitchNativeView>;
178
108
  }
@@ -13,6 +13,8 @@ export type TextInputRef = {
13
13
  setText: (newText: string) => Promise<void>;
14
14
  };
15
15
 
16
+ export type TextInputVariant = 'filled' | 'outlined';
17
+
16
18
  export type TextInputProps = {
17
19
  /**
18
20
  * Can be used for imperatively setting text on the TextInput component.
@@ -22,6 +24,14 @@ export type TextInputProps = {
22
24
  * Initial value that the TextInput displays when being mounted. As the TextInput is an uncontrolled component, change the key prop if you need to change the text value.
23
25
  */
24
26
  defaultValue?: string;
27
+ /**
28
+ * The visual style of the text input field.
29
+ * - `filled` - A text field with a filled background (default).
30
+ * - `outlined` - A text field with a transparent background and a border outline.
31
+ * @default filled
32
+ * @platform android
33
+ */
34
+ variant?: TextInputVariant;
25
35
  /**
26
36
  * A callback triggered when user types in text into the TextInput.
27
37
  */
@@ -1,83 +1,107 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { type ColorValue } from 'react-native';
3
3
 
4
- import { type ExpoModifier, type ViewEvent } from '../../types';
4
+ import type { ModifierConfig, ViewEvent } from '../../types';
5
5
  import { ExpoUIModule } from '../ExpoUIModule';
6
6
  import { createViewModifierEventListener } from '../modifiers/utils';
7
7
 
8
+ /**
9
+ * Colors for toggle button elements.
10
+ */
11
+ export type ToggleButtonColors = {
12
+ containerColor?: ColorValue;
13
+ contentColor?: ColorValue;
14
+ checkedContainerColor?: ColorValue;
15
+ checkedContentColor?: ColorValue;
16
+ disabledContainerColor?: ColorValue;
17
+ disabledContentColor?: ColorValue;
18
+ };
19
+
8
20
  export type ToggleButtonProps = {
9
21
  /**
10
22
  * Whether the toggle button is checked.
11
23
  */
12
24
  checked: boolean;
13
25
  /**
14
- * Text to display in the button.
15
- */
16
- text?: string;
17
- /**
18
- * The variant of the toggle button.
19
- * - `'default'` - Material 3 ToggleButton
20
- * - `'icon'` - Icon toggle button
21
- * - `'filledIcon'` - Filled icon toggle button
22
- * - `'outlinedIcon'` - Outlined icon toggle button
23
- * @default 'default'
24
- */
25
- variant?: 'default' | 'icon' | 'filledIcon' | 'outlinedIcon';
26
- /**
27
- * The color of the toggle button when checked.
26
+ * Callback that is called when the checked state changes.
28
27
  */
29
- color?: ColorValue;
28
+ onCheckedChange?: (checked: boolean) => void;
30
29
  /**
31
- * Whether the button is disabled.
30
+ * Whether the button is enabled for user interaction.
31
+ * @default true
32
32
  */
33
- disabled?: boolean;
33
+ enabled?: boolean;
34
34
  /**
35
- * Callback that is called when the checked state changes.
35
+ * Colors for toggle button elements.
36
36
  */
37
- onCheckedChange?: (checked: boolean) => void;
37
+ colors?: ToggleButtonColors;
38
38
  /**
39
39
  * Modifiers for the component.
40
40
  */
41
- modifiers?: ExpoModifier[];
42
-
41
+ modifiers?: ModifierConfig[];
43
42
  /**
44
- * The content to display inside the toggle button.
43
+ * Content to display inside the toggle button.
45
44
  */
46
- children?: React.ReactNode;
45
+ children: React.ReactNode;
47
46
  };
48
47
 
49
- type NativeToggleButtonProps = Omit<ToggleButtonProps, 'onCheckedChange'> &
50
- ViewEvent<'onCheckedChange', { checked: boolean }>;
51
-
52
- const ToggleButtonNativeView: React.ComponentType<NativeToggleButtonProps> = requireNativeView(
53
- 'ExpoUI',
54
- 'ToggleButtonView'
55
- );
48
+ type NativeToggleButtonProps = Omit<ToggleButtonProps, 'onCheckedChange' | 'children'> & {
49
+ children?: React.ReactNode;
50
+ } & ViewEvent<'onCheckedChange', { checked: boolean }>;
56
51
 
57
- function transformProps(props: ToggleButtonProps): Omit<NativeToggleButtonProps, 'children'> {
58
- const { modifiers, onCheckedChange, children, ...restProps } = props;
52
+ /**
53
+ * @hidden
54
+ */
55
+ export function transformToggleButtonProps(
56
+ props: Omit<ToggleButtonProps, 'children'>
57
+ ): NativeToggleButtonProps {
58
+ const { onCheckedChange, modifiers, ...restProps } = props;
59
59
  return {
60
60
  modifiers,
61
61
  ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
62
62
  ...restProps,
63
+ enabled: props.enabled ?? true,
63
64
  onCheckedChange: onCheckedChange
64
65
  ? ({ nativeEvent: { checked } }) => onCheckedChange(checked)
65
66
  : undefined,
66
67
  };
67
68
  }
69
+
70
+ function createToggleButtonComponent(name: string) {
71
+ const NativeView: React.ComponentType<NativeToggleButtonProps> = requireNativeView(
72
+ 'ExpoUI',
73
+ name
74
+ );
75
+
76
+ function Component(props: ToggleButtonProps) {
77
+ const { children, ...restProps } = props;
78
+ return <NativeView {...transformToggleButtonProps(restProps)}>{children}</NativeView>;
79
+ }
80
+ Component.displayName = name;
81
+ return Component;
82
+ }
83
+
68
84
  /**
69
85
  * A toggle button component that can be toggled on and off.
70
- *
71
- * When `text` prop is provided, it displays the text.
72
- * Otherwise, custom children can be passed to render custom content.
73
86
  */
74
- function ToggleButton(props: ToggleButtonProps) {
75
- const { children } = props;
87
+ const ToggleButton = Object.assign(createToggleButtonComponent('ToggleButton'), {
88
+ DefaultIconSpacing: ExpoUIModule.ToggleButtonIconSpacing as number,
89
+ DefaultIconSize: ExpoUIModule.ToggleButtonIconSize as number,
90
+ });
76
91
 
77
- return <ToggleButtonNativeView {...transformProps(props)}>{children}</ToggleButtonNativeView>;
78
- }
92
+ /**
93
+ * An icon toggle button with no background.
94
+ */
95
+ const IconToggleButton = createToggleButtonComponent('IconToggleButton');
79
96
 
80
- ToggleButton.DefaultIconSpacing = ExpoUIModule.ToggleButtonIconSpacing;
81
- ToggleButton.DefaultIconSize = ExpoUIModule.ToggleButtonIconSize;
97
+ /**
98
+ * A filled icon toggle button with a solid background.
99
+ */
100
+ const FilledIconToggleButton = createToggleButtonComponent('FilledIconToggleButton');
101
+
102
+ /**
103
+ * An outlined icon toggle button with a border and no fill.
104
+ */
105
+ const OutlinedIconToggleButton = createToggleButtonComponent('OutlinedIconToggleButton');
82
106
 
83
- export { ToggleButton };
107
+ export { ToggleButton, IconToggleButton, FilledIconToggleButton, OutlinedIconToggleButton };
@@ -3,24 +3,23 @@ import './MaterialSymbolsAssetsTransformer.fx';
3
3
  export * from './AlertDialog';
4
4
  export * from './BasicAlertDialog';
5
5
  export * from './Card';
6
+ export * from './Checkbox';
6
7
  export * from './Chip';
7
- export * from './FilterChip';
8
8
  export * from './Button';
9
9
  export * from './Icon';
10
10
  export * from './IconButton';
11
- export * from './ContextMenu';
11
+ export * from './DropdownMenu';
12
12
  export * from './Divider';
13
13
  export * from './Host';
14
14
  export * from './LazyColumn';
15
15
  export * from './ListItem';
16
16
  export * from './RNHostView';
17
17
  export * from './DatePicker';
18
- export * from './Picker';
18
+ export * from './SegmentedButton';
19
19
  export * from './Progress';
20
20
  export * from './Slider';
21
21
  export * from './Spacer';
22
22
  export * from './Switch';
23
- export * from './TextButton';
24
23
  export * from './TextInput';
25
24
  export * from './ToggleButton';
26
25
  export * from './Shape';
@@ -29,11 +28,13 @@ export * from './Carousel';
29
28
  export * from './SearchBar';
30
29
  export * from './DockedSearchBar';
31
30
  export * from './HorizontalFloatingToolbar';
31
+ export * from './FloatingActionButton';
32
32
  export * from './PullToRefreshBox';
33
33
  export * from './RadioButton';
34
34
  export * from './Surface';
35
35
  export * from './Text';
36
36
 
37
+ export * from './AnimatedVisibility';
37
38
  export * from './Box';
38
39
  export * from './Row';
39
40
  export * from './Column';
@@ -262,9 +262,33 @@ export const clickable = (handler: () => void, options?: { indication?: boolean
262
262
  * Makes the view selectable, like a radio button row.
263
263
  * @param selected - Whether the item is currently selected.
264
264
  * @param handler - Function to call when the item is clicked.
265
+ * @param role - Optional semantic role for accessibility: 'radioButton', 'checkbox', 'switch', or 'tab'.
265
266
  */
266
- export const selectable = (selected: boolean, handler: () => void) =>
267
- createModifierWithEventListener('selectable', handler, { selected });
267
+ export const selectable = (
268
+ selected: boolean,
269
+ handler: () => void,
270
+ role?: 'radioButton' | 'checkbox' | 'switch' | 'tab'
271
+ ) => createModifierWithEventListener('selectable', handler, { selected, role });
272
+
273
+ /**
274
+ * Marks a column/row as a selectable group for accessibility.
275
+ * Screen readers will treat the children as a group of selectable items.
276
+ */
277
+ export const selectableGroup = () => createModifier('selectableGroup');
278
+
279
+ /**
280
+ * Makes the view toggleable with accessibility semantics.
281
+ * Use this to make a row containing a checkbox or switch tappable as a whole.
282
+ * @param value - The current toggle state.
283
+ * @param handler - Function to call when toggled.
284
+ * @param options - Optional configuration.
285
+ * @param options.role - The semantic role for accessibility: `'checkbox'`, `'radioButton'`, `'switch'`, or `'tab'`.
286
+ */
287
+ export const toggleable = (
288
+ value: boolean,
289
+ handler: () => void,
290
+ options?: { role?: 'checkbox' | 'radioButton' | 'switch' | 'tab' }
291
+ ) => createModifierWithEventListener('toggleable', handler, { value, role: options?.role });
268
292
 
269
293
  // =============================================================================
270
294
  // Utility Modifiers
@@ -0,0 +1,52 @@
1
+ import { requireNativeView } from 'expo';
2
+
3
+ import { createViewModifierEventListener } from '../modifiers/utils';
4
+ import { type CommonViewModifierProps } from '../types';
5
+
6
+ export type LinkProps = {
7
+ /**
8
+ * The text label for the Link. Use this for simple text links.
9
+ */
10
+ label?: string;
11
+ /**
12
+ * The URL for the link.
13
+ */
14
+ destination: string;
15
+ /**
16
+ * Custom content for the link label. Use this for custom label views.
17
+ * Only nested elements are supported, not plain strings.
18
+ */
19
+ children?: React.ReactElement | React.ReactElement[];
20
+ } & CommonViewModifierProps;
21
+
22
+ const LinkNativeView: React.ComponentType<LinkProps> = requireNativeView('ExpoUI', 'LinkView');
23
+
24
+ /**
25
+ * Displays a native link component.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * import { Link } from '@expo/ui/swift-ui';
30
+ * import { foregroundStyle, font } from '@expo/ui/swift-ui/modifiers';
31
+ *
32
+ * <Link
33
+ * label="Open"
34
+ * destination="https://expo.dev"
35
+ * modifiers={[
36
+ * foregroundStyle('red'),
37
+ * font({ size: 24, weight: 'bold' })
38
+ * ]}
39
+ * />
40
+ * ```
41
+ */
42
+ export function Link(props: LinkProps) {
43
+ const { children, modifiers, ...restProps } = props;
44
+
45
+ const baseProps = {
46
+ ...restProps,
47
+ modifiers,
48
+ ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
49
+ };
50
+
51
+ return <LinkNativeView {...baseProps}>{children}</LinkNativeView>;
52
+ }
@@ -1,9 +1,7 @@
1
1
  import { requireNativeView } from 'expo';
2
2
 
3
3
  import { createViewModifierEventListener } from '../modifiers/utils';
4
- import { type CommonViewModifierProps } from '../types';
5
-
6
- export type ClosedRangeDate = { lower: Date; upper: Date };
4
+ import { type ClosedRangeDate, type CommonViewModifierProps } from '../types';
7
5
 
8
6
  export type ProgressViewProps = {
9
7
  /**
@@ -10,9 +10,9 @@ export type StepperProps = {
10
10
  */
11
11
  label: string;
12
12
  /**
13
- * The initial/default value of the stepper.
13
+ * The current value of the stepper.
14
14
  */
15
- defaultValue?: number;
15
+ value?: number;
16
16
  /**
17
17
  * The step value for increment/decrement operations.
18
18
  */
@@ -28,11 +28,11 @@ export type StepperProps = {
28
28
  /**
29
29
  * Called when the stepper value changes.
30
30
  */
31
- onValueChanged: (value: number) => void;
31
+ onValueChange: (value: number) => void;
32
32
  } & CommonViewModifierProps;
33
33
 
34
- type NativeStepperProps = Omit<StepperProps, 'onValueChanged'> &
35
- ViewEvent<'onValueChanged', { value: number }>;
34
+ type NativeStepperProps = Omit<StepperProps, 'onValueChange'> &
35
+ ViewEvent<'onValueChange', { value: number }>;
36
36
 
37
37
  const StepperNativeView: React.ComponentType<NativeStepperProps> = requireNativeView(
38
38
  'ExpoUI',
@@ -45,8 +45,8 @@ function transformStepperProps(props: StepperProps): NativeStepperProps {
45
45
  modifiers,
46
46
  ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
47
47
  ...restProps,
48
- onValueChanged: ({ nativeEvent: { value } }) => {
49
- props.onValueChanged(value);
48
+ onValueChange: ({ nativeEvent: { value } }) => {
49
+ props.onValueChange(value);
50
50
  },
51
51
  };
52
52
  }